Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript (v3): Re-scope libs package. Bug #6161 #6162

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascriptv3/example_code/cloudwatch-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Corey Pyle <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-cloudwatch-events": "^3.229.0",
"@aws-sdk/client-cloudwatch-logs": "^3.229.0",
"@aws-sdk/client-lambda": "^3.229.0"
Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/cloudwatch-logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-cloudwatch-logs": "^3.215.0",
"@aws-sdk/client-iam": "^3.216.0",
"@aws-sdk/client-lambda": "^3.216.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
StartQueryCommand,
GetQueryResultsCommand,
} from "@aws-sdk/client-cloudwatch-logs";
import { splitDateRange } from "@aws-sdk-examples/libs/utils/util-date.js";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
import { splitDateRange } from "@aws-doc-sdk-examples/lib/utils/util-date.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

class DateOutOfBoundsError extends Error {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { DescribeSubscriptionFiltersCommand } from "@aws-sdk/client-cloudwatch-l
import { LambdaClient, waitUntilFunctionUpdated } from "@aws-sdk/client-lambda";
import { describe, it, beforeAll, afterAll, expect } from "vitest";

import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
import { setEnv } from "@aws-sdk-examples/libs/utils/util-node.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";
import { setEnv } from "@aws-doc-sdk-examples/lib/utils/util-node.js";

import {
addPermissionLogsInvokeFunction,
Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/cloudwatch/libs/ec2-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RunInstancesCommand,
TerminateInstancesCommand,
} from "@aws-sdk/client-ec2";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

const client = new EC2Client({});

Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/cloudwatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-cloudwatch": "^3.212.0",
"@aws-sdk/client-ec2": "^3.213.0"
},
Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/codebuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Corey Pyle <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-codebuild": "^3.391.0"
},
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
DeleteProjectCommand,
paginateListProjects,
} from "@aws-sdk/client-codebuild";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

describe(
"create-project",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"integration-test": "vitest run **/*.integration.test.js"
},
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-cognito-identity-provider": "^3.423.0",
"@aws-sdk/client-ses": "^3.423.0",
"@types/qrcode-terminal": "^0.12.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { getFirstEntry } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { getFirstEntry } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { adminGetUser } from "../../../actions/admin-get-user.js";
import { FILE_USER_POOLS } from "./constants.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
/** snippet-start:[javascript.v3.cognito-idp.scenarios.basic.AdminInitiateAuthHandler] **/
import qrcode from "qrcode-terminal";
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { adminInitiateAuth } from "../../../actions/admin-initiate-auth.js";
import { associateSoftwareToken } from "../../../actions/associate-software-token.js";
import { FILE_USER_POOLS } from "./constants.js";
import { getFirstEntry } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { getFirstEntry } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";

const handleMfaSetup = async (session, username) => {
const { SecretCode, Session } = await associateSoftwareToken(session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

/** snippet-start:[javascript.v3.cognito-idp.scenarios.basic.AdminRespondToAuthChallengeHandler] **/
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { adminRespondToAuthChallenge } from "../../../actions/admin-respond-to-auth-challenge.js";
import { getFirstEntry } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { getFirstEntry } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";
import { FILE_USER_POOLS } from "./constants.js";

const verifyUsername = (username) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { deleteFiles } from "@aws-sdk-examples/libs/utils/util-fs.js";
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { deleteFiles } from "@aws-doc-sdk-examples/lib/utils/util-fs.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { deleteUserPool } from "../../../actions/delete-user-pool.js";
import { FILE_USER_POOLS } from "./constants.js";
import { getFirstValuesFromEntries } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { getFirstValuesFromEntries } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";

/**
* @param {string[]} userPoolIds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

/** snippet-start:[javascript.v3.cognito-idp.scenarios.basic.ConfirmSignUpHandler] **/
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { confirmSignUp } from "../../../actions/confirm-sign-up.js";
import { FILE_USER_POOLS } from "./constants.js";
import { getSecondValuesFromEntries } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { getSecondValuesFromEntries } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";

const validateClient = (clientId) => {
if (!clientId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { getTmp, setTmp } from "@aws-sdk-examples/libs/utils/util-fs.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { getTmp, setTmp } from "@aws-doc-sdk-examples/lib/utils/util-fs.js";
import { createUserPool } from "../../../actions/create-user-pool.js";
import { FILE_USER_POOLS, NAME_CLIENT } from "./constants.js";
import { setUserPoolMfaConfig } from "../../../actions/set-user-pool-mfa-config.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { getFirstEntry } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { getFirstEntry } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { listUsers } from "../../../actions/list-users.js";
import { FILE_USER_POOLS } from "./constants.js";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { getFirstEntry } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { getFirstEntry } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { resendConfirmationCode } from "../../../actions/resend-confirmation-code.js";
import { FILE_USER_POOLS } from "./constants.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

/** snippet-start:[javascript.v3.cognito-idp.scenarios.basic.SignUpHandler] **/
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { signUp } from "../../../actions/sign-up.js";
import { FILE_USER_POOLS } from "./constants.js";
import { getSecondValuesFromEntries } from "@aws-sdk-examples/libs/utils/util-csv.js";
import { getSecondValuesFromEntries } from "@aws-doc-sdk-examples/lib/utils/util-csv.js";

const validateClient = (clientId) => {
if (!clientId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

/** snippet-start:[javascript.v3.cognito-idp.scenarios.basic.VerifySoftwareTokenHandler] **/
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { verifySoftwareToken } from "../../../actions/verify-software-token.js";

const validateTotp = (totp) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { createInterface } from "readline";
import { stdin as input, stdout as output } from "process";

import { readCommands } from "@aws-sdk-examples/libs/cmd-runner.js";
import { log } from "@aws-sdk-examples/libs/utils/util-log.js";
import { startsWith } from "@aws-sdk-examples/libs/utils/util-array.js";
import { readCommands } from "@aws-doc-sdk-examples/lib/cmd-runner.js";
import { log } from "@aws-doc-sdk-examples/lib/utils/util-log.js";
import { startsWith } from "@aws-doc-sdk-examples/lib/utils/util-array.js";

import { createUserPoolHandler } from "./command-handlers/create-user-pool-handler.js";
import { cleanUpHandler } from "./command-handlers/clean-up-handler.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { describe, it, expect, afterAll } from "vitest";
import { createUserPool } from "../actions/create-user-pool.js";
import { getUniqueName } from "@aws-sdk-examples/libs/utils/util-string.js";
import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js";
import { deleteUserPool } from "../actions/delete-user-pool.js";
import { createUserPoolClient } from "../actions/create-user-pool-client.js";
import { listUsers } from "../actions/list-users.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {
Scenario,
parseScenarioArgs,
} from "@aws-sdk-examples/libs/scenario/index.js";
} from "@aws-doc-sdk-examples/lib/scenario/index.js";

/**
* The workflow steps are split into three stages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import {
ScenarioAction,
ScenarioInput,
ScenarioOutput,
} from "@aws-sdk-examples/libs/scenario/scenario.js";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
} from "@aws-doc-sdk-examples/lib/scenario/scenario.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

import { MESSAGES, NAMES, RESOURCES_PATH } from "./constants.js";
import { findLoadBalancer } from "./shared.js";
Expand Down Expand Up @@ -147,7 +147,7 @@ const statusSteps = [
];

/**
* @type {import('@aws-sdk-examples/libs/scenario.js').Step[]}
* @type {import('@aws-doc-sdk-examples/lib/scenario.js').Step[]}
*/
export const demoSteps = [
new ScenarioOutput("header", MESSAGES.demoHeader, { header: true }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ import {
ScenarioOutput,
ScenarioInput,
ScenarioAction,
} from "@aws-sdk-examples/libs/scenario/index.js";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
} from "@aws-doc-sdk-examples/lib/scenario/index.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

import { MESSAGES, NAMES, RESOURCES_PATH, ROOT } from "./constants.js";
import { initParamsSteps } from "./steps-reset-params.js";

/**
* @type {import('@aws-sdk-examples/libs/scenario.js').Step[]}
* @type {import('@aws-doc-sdk-examples/lib/scenario.js').Step[]}
*/
export const deploySteps = [
new ScenarioOutput("introduction", MESSAGES.introduction, { header: true }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ import {
ScenarioOutput,
ScenarioInput,
ScenarioAction,
} from "@aws-sdk-examples/libs/scenario/index.js";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
} from "@aws-doc-sdk-examples/lib/scenario/index.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

import { MESSAGES, NAMES } from "./constants.js";
import { findLoadBalancer } from "./shared.js";

/**
* @type {import('@aws-sdk-examples/libs/scenario.js').Step[]}
* @type {import('@aws-doc-sdk-examples/lib/scenario.js').Step[]}
*/
export const destroySteps = [
new ScenarioInput("destroy", MESSAGES.destroy, { type: "confirm" }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { ScenarioAction } from "@aws-sdk-examples/libs/scenario/scenario.js";
import { ScenarioAction } from "@aws-doc-sdk-examples/lib/scenario/scenario.js";

import { PutParameterCommand, SSMClient } from "@aws-sdk/client-ssm";
import { NAMES } from "./constants.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { SNSClient } from "@aws-sdk/client-sns";
import { SQSClient } from "@aws-sdk/client-sqs";

import { TopicsQueuesWkflw } from "./TopicsQueuesWkflw.js";
import { Prompter } from "@aws-sdk-examples/libs/prompter.js";
import { SlowLogger } from "@aws-sdk-examples/libs/slow-logger.js";
import { Prompter } from "@aws-doc-sdk-examples/lib/prompter.js";
import { SlowLogger } from "@aws-doc-sdk-examples/lib/slow-logger.js";

export const startSnsWorkflow = () => {
const noLoggerDelay = process.argv.find((arg) => arg === "--no-logger-delay");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-sns": "^3.379.1",
"@aws-sdk/client-sqs": "^3.379.1",
"@inquirer/prompts": "^3.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { readFileSync } from "fs";
// These modules are local to our GitHub repository. We recommend cloning
// the project from GitHub if you want to run this example.
// For more information, see https://github.com/awsdocs/aws-doc-sdk-examples.
import { dirnameFromMetaUrl } from "@aws-sdk-examples/libs/utils/util-fs.js";
import { chunkArray } from "@aws-sdk-examples/libs/utils/util-array.js";
import { dirnameFromMetaUrl } from "@aws-doc-sdk-examples/lib/utils/util-fs.js";
import { chunkArray } from "@aws-doc-sdk-examples/lib/utils/util-array.js";

const dirname = dirnameFromMetaUrl(import.meta.url);

Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"integration-test": "vitest run **/*.integration.test.js"
},
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-dynamodb": "^3.210.0",
"@aws-sdk/lib-dynamodb": "^3.210.0",
"libs": "*"
Expand Down
6 changes: 3 additions & 3 deletions javascriptv3/example_code/dynamodb/scenarios/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import {
// These modules are local to our GitHub repository. We recommend cloning
// the project from GitHub if you want to run this example.
// For more information, see https://github.com/awsdocs/aws-doc-sdk-examples.
import { getUniqueName } from "@aws-sdk-examples/libs/utils/util-string.js";
import { dirnameFromMetaUrl } from "@aws-sdk-examples/libs/utils/util-fs.js";
import { chunkArray } from "@aws-sdk-examples/libs/utils/util-array.js";
import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js";
import { dirnameFromMetaUrl } from "@aws-doc-sdk-examples/lib/utils/util-fs.js";
import { chunkArray } from "@aws-doc-sdk-examples/lib/utils/util-array.js";

const dirname = dirnameFromMetaUrl(import.meta.url);
const tableName = getUniqueName("Movies");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { describe, it, expect } from "vitest";
import { main } from "../actions/document-client/batch-write.js";
import { tableSetupTeardown } from "../libs/dynamodb-test.utils.js";
import { DynamoDBClient, GetItemCommand } from "@aws-sdk/client-dynamodb";
import { retry } from "@aws-sdk-examples/libs/utils/util-timers.js";
import { retry } from "@aws-doc-sdk-examples/lib/utils/util-timers.js";

describe("document-batch-write", () => {
const tableName = "BatchWriteMoviesTable";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { describe, it, expect } from "vitest";

import { main } from "../hello.js";
import { getUniqueName } from "@aws-sdk-examples/libs/utils/util-string.js";
import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js";
import { tableSetupTeardown } from "../libs/dynamodb-test.utils.js";

describe("hello test", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { describe, it, expect } from "vitest";

import { main } from "../actions/list-tables.js";
import { getUniqueName } from "@aws-sdk-examples/libs/utils/util-string.js";
import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js";
import { tableSetupTeardown } from "../libs/dynamodb-test.utils.js";

describe("list-tables", () => {
Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "vitest run **/*.unit.test.js"
},
"dependencies": {
"@aws-sdk-examples/libs": "^1.0.0",
"@aws-doc-sdk-examples/lib": "^1.0.0",
"@aws-sdk/client-ec2": "^3.266.1",
"@aws-sdk/client-ssm": "^3.271.0"
},
Expand Down
4 changes: 2 additions & 2 deletions javascriptv3/example_code/ec2/scenarios/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import {
} from "@aws-sdk/client-ec2";
import { paginateGetParametersByPath, SSMClient } from "@aws-sdk/client-ssm";

import { wrapText } from "@aws-sdk-examples/libs/utils/util-string.js";
import { Prompter } from "@aws-sdk-examples/libs/prompter.js";
import { wrapText } from "@aws-doc-sdk-examples/lib/utils/util-string.js";
import { Prompter } from "@aws-doc-sdk-examples/lib/prompter.js";

const ec2Client = new EC2Client();
const ssmClient = new SSMClient();
Expand Down
Loading
Loading