diff --git a/clients/client-cognito-identity/karma.conf.js b/clients/client-cognito-identity/karma.conf.js deleted file mode 100644 index edb2dfe72215..000000000000 --- a/clients/client-cognito-identity/karma.conf.js +++ /dev/null @@ -1,71 +0,0 @@ -// Set up following binaries before running the test: -// CHROME_BIN: path to Chromium browser -const webpack = require("webpack"); - -module.exports = function (config) { - config.set({ - basePath: "", - frameworks: ["mocha", "chai"], - files: ["test/e2e/**/*.ispec.ts"], - processKillTimeout: 5000, - preprocessors: { - "test/e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"], - }, - webpackMiddleware: { - stats: "minimal", - }, - webpack: { - resolve: { - extensions: [".ts", ".js"], - }, - mode: "development", - module: { - rules: [ - { - test: /\.tsx?$/, - use: [ - { - loader: "ts-loader", - options: { - configFile: "tsconfig.json", - compilerOptions: { - rootDir: "./", - }, - }, - }, - ], - exclude: /node_modules/, - }, - ], - }, - plugins: [new webpack.NormalModuleReplacementPlugin(/\.\/runtimeConfig$/, "./runtimeConfig.browser")], - devtool: "inline-source-map", - }, - envPreprocessor: ["AWS_SMOKE_TEST_REGION", "AWS_SMOKE_TEST_IDENTITY_POOL_ID"], - plugins: [ - "@aws-sdk/karma-credential-loader", - "karma-chrome-launcher", - "karma-mocha", - "karma-chai", - "karma-webpack", - "karma-coverage", - "karma-sourcemap-loader", - "karma-env-preprocessor", - ], - reporters: ["progress"], - port: 9876, - colors: true, - logLevel: config.LOG_WARN, - autoWatch: false, - browsers: ["ChromeHeadlessNoSandbox"], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: "ChromeHeadless", - flags: ["--no-sandbox"], - }, - }, - singleRun: true, - concurrency: Infinity, - exclude: ["**/*.d.ts", "*.spec.ts"], - }); -}; diff --git a/clients/client-cognito-identity/package.json b/clients/client-cognito-identity/package.json index f145d6874db2..885f4a2218b3 100644 --- a/clients/client-cognito-identity/package.json +++ b/clients/client-cognito-identity/package.json @@ -12,7 +12,8 @@ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo cognito-identity", - "test:e2e": "ts-mocha test/**/*.ispec.ts && karma start karma.conf.js" + "test:e2e": "vitest run -c vitest.config.e2e.ts", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/clients/client-cognito-identity/test/e2e/CognitoIdentity.ispec.ts b/clients/client-cognito-identity/test/e2e/CognitoIdentity.e2e.spec.ts similarity index 51% rename from clients/client-cognito-identity/test/e2e/CognitoIdentity.ispec.ts rename to clients/client-cognito-identity/test/e2e/CognitoIdentity.e2e.spec.ts index 5a0eb9b8d99f..836bb76119f0 100644 --- a/clients/client-cognito-identity/test/e2e/CognitoIdentity.ispec.ts +++ b/clients/client-cognito-identity/test/e2e/CognitoIdentity.e2e.spec.ts @@ -1,21 +1,25 @@ -/// -/** - * This is the integration test that make sure the client can make request cross-platform-ly - * in NodeJS, Chromium and Firefox. This test is written in mocha. - */ -import { expect } from "chai"; +import { beforeAll, describe, expect, test as it } from "vitest"; +import { getIntegTestResources } from "../../../../tests/e2e/get-integ-test-resources"; import { CognitoIdentity } from "../../src/index"; -// There will be default values of defaultRegion, credentials, and isBrowser variable in browser tests. -// Define the values for Node.js tests -const region: string | undefined = (globalThis as any).defaultRegion || process?.env?.AWS_SMOKE_TEST_REGION; -const IdentityPoolId = - (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_IDENTITY_POOL_ID || - process?.env?.AWS_SMOKE_TEST_IDENTITY_POOL_ID; -describe("@aws-sdk/client-cognito-identity", function () { - const unAuthClient = new CognitoIdentity({ - region, +describe("@aws-sdk/client-cognito-identity", () => { + let unAuthClient: CognitoIdentity; + let region: string; + let IdentityPoolId: string; + + beforeAll(async () => { + const integTestResourcesEnv = await getIntegTestResources(); + Object.assign(process.env, integTestResourcesEnv); + + region = process?.env?.AWS_SMOKE_TEST_REGION as string; + IdentityPoolId = + (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_IDENTITY_POOL_ID || + process?.env?.AWS_SMOKE_TEST_IDENTITY_POOL_ID; + + unAuthClient = new CognitoIdentity({ + region, + }); }); it("should successfully fetch Id and get credentials", async () => { diff --git a/clients/client-cognito-identity/tsconfig.json b/clients/client-cognito-identity/tsconfig.json index e7f5ec56b742..bae83b8420ee 100644 --- a/clients/client-cognito-identity/tsconfig.json +++ b/clients/client-cognito-identity/tsconfig.json @@ -9,5 +9,5 @@ "rootDir": "src", "useUnknownInCatchVariables": false }, - "exclude": ["test/"] + "exclude": ["test/", "vitest.*.ts"] } diff --git a/clients/client-cognito-identity/vitest.config.e2e.ts b/clients/client-cognito-identity/vitest.config.e2e.ts new file mode 100644 index 000000000000..a08a0dfa31c3 --- /dev/null +++ b/clients/client-cognito-identity/vitest.config.e2e.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.e2e.spec.ts"], + environment: "happy-dom", + }, +}); diff --git a/clients/client-kinesis/jest.config.e2e.js b/clients/client-kinesis/jest.config.e2e.js deleted file mode 100644 index b4d9bee23f48..000000000000 --- a/clients/client-kinesis/jest.config.e2e.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.e2e.spec.ts"], -}; diff --git a/clients/client-kinesis/package.json b/clients/client-kinesis/package.json index 4fd7034b7ca6..4eb4160dead9 100644 --- a/clients/client-kinesis/package.json +++ b/clients/client-kinesis/package.json @@ -12,7 +12,8 @@ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo kinesis", - "test:e2e": "jest --config jest.config.e2e.js" + "test:e2e": "vitest run -c vitest.config.e2e.ts", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/clients/client-kinesis/test/Kinesis.e2e.spec.ts b/clients/client-kinesis/test/Kinesis.e2e.spec.ts index ca22bba08d10..b0bd4e69f688 100644 --- a/clients/client-kinesis/test/Kinesis.e2e.spec.ts +++ b/clients/client-kinesis/test/Kinesis.e2e.spec.ts @@ -1,3 +1,5 @@ +import { test as it, describe, expect } from "vitest"; + import { KinesisClient, ListStreamsCommand } from "../src/index"; describe("@aws-sdk/client-kinesis", () => { @@ -5,7 +7,7 @@ describe("@aws-sdk/client-kinesis", () => { const ONE_SECOND = 1 * 1000; // TODO: not working in CI - xit( + it.skip( `${ListStreamsCommand.name} should succeed`, async () => { const { StreamNames } = await client.send(new ListStreamsCommand({})); diff --git a/clients/client-kinesis/vitest.config.e2e.ts b/clients/client-kinesis/vitest.config.e2e.ts new file mode 100644 index 000000000000..92073c6cfcf0 --- /dev/null +++ b/clients/client-kinesis/vitest.config.e2e.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.e2e.spec.ts"], + environment: "node", + }, +}); diff --git a/clients/client-s3/jest.config.e2e.js b/clients/client-s3/jest.config.e2e.js deleted file mode 100644 index c3aa6055ef75..000000000000 --- a/clients/client-s3/jest.config.e2e.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.e2e.spec.ts"], - bail: true, -}; diff --git a/clients/client-s3/karma.conf.js b/clients/client-s3/karma.conf.js deleted file mode 100644 index 5f0c811dfd76..000000000000 --- a/clients/client-s3/karma.conf.js +++ /dev/null @@ -1,74 +0,0 @@ -// Set up following binaries before running the test: -// CHROME_BIN: path to Chromium browser -const webpack = require("webpack"); - -module.exports = function (config) { - config.set({ - basePath: "", - frameworks: ["mocha", "chai", "webpack"], - files: ["test/e2e/**/*.ispec.ts"], - processKillTimeout: 5000, - preprocessors: { - "test/e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"], - }, - webpackMiddleware: { - stats: "minimal", - }, - webpack: { - resolve: { - extensions: [".ts", ".js"], - fallback: { - stream: false, - }, - }, - mode: "development", - module: { - rules: [ - { - test: /\.tsx?$/, - use: [ - { - loader: "ts-loader", - options: { - configFile: "tsconfig.json", - compilerOptions: { - rootDir: "./", - }, - }, - }, - ], - exclude: /node_modules/, - }, - ], - }, - plugins: [new webpack.NormalModuleReplacementPlugin(/\.\/runtimeConfig$/, "./runtimeConfig.browser")], - devtool: "inline-source-map", - }, - envPreprocessor: ["AWS_SMOKE_TEST_REGION", "AWS_SMOKE_TEST_BUCKET", "AWS_SMOKE_TEST_MRAP_ARN"], - plugins: [ - "@aws-sdk/karma-credential-loader", - "karma-chrome-launcher", - "karma-mocha", - "karma-chai", - "karma-webpack", - "karma-coverage", - "karma-sourcemap-loader", - "karma-env-preprocessor", - ], - reporters: ["progress"], - port: 9876, - colors: true, - logLevel: config.LOG_WARN, - autoWatch: false, - browsers: ["ChromeHeadlessNoSandbox"], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: "ChromeHeadless", - flags: ["--no-sandbox"], - }, - }, - singleRun: true, - concurrency: Infinity, - exclude: ["**/*.d.ts", "*.spec.ts"], - }); -}; diff --git a/clients/client-s3/package.json b/clients/client-s3/package.json index 7a14f5a145bc..1cfbb736c1d8 100644 --- a/clients/client-s3/package.json +++ b/clients/client-s3/package.json @@ -12,11 +12,11 @@ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo s3", - "test": "yarn test:unit", - "test:e2e": "yarn test:e2e:node && yarn test:e2e:browser", - "test:e2e:browser": "ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js", - "test:e2e:node": "jest --c jest.config.e2e.js", - "test:unit": "ts-mocha test/unit/**/*.spec.ts" + "test": "vitest run", + "test:watch": "vitest watch", + "test:e2e": "vitest run -c vitest.config.e2e.ts && yarn test:browser", + "test:browser": "node ./test/browser-build/esbuild && vitest run -c vitest.config.browser.ts", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/clients/client-s3/test/browser-build/browser-s3-bundle.js b/clients/client-s3/test/browser-build/browser-s3-bundle.js new file mode 100644 index 000000000000..6b5b65143f10 --- /dev/null +++ b/clients/client-s3/test/browser-build/browser-s3-bundle.js @@ -0,0 +1,12929 @@ +// dist-es/S3Client.js +import { getAddExpectContinuePlugin } from "@aws-sdk/middleware-expect-continue"; +import { resolveFlexibleChecksumsConfig } from "@aws-sdk/middleware-flexible-checksums"; +import { getHostHeaderPlugin, resolveHostHeaderConfig } from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getRegionRedirectMiddlewarePlugin, + getS3ExpressHttpSigningPlugin, + getS3ExpressPlugin, + getValidateBucketNamePlugin, + resolveS3Config, +} from "@aws-sdk/middleware-sdk-s3"; +import { getUserAgentPlugin, resolveUserAgentConfig } from "@aws-sdk/middleware-user-agent"; +import { resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { resolveEventStreamSerdeConfig } from "@smithy/eventstream-serde-config-resolver"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry"; +import { Client as __Client } from "@smithy/smithy-client"; + +// dist-es/auth/httpAuthSchemeProvider.js +import { resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config } from "@aws-sdk/core"; +import { signatureV4CrtContainer } from "@aws-sdk/signature-v4-multi-region"; +import { resolveParams } from "@smithy/middleware-endpoint"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +// dist-es/endpoint/endpointResolver.js +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { customEndpointFunctions, EndpointCache, resolveEndpoint } from "@smithy/util-endpoints"; + +// dist-es/endpoint/ruleset.js +var ce = "required"; +var cf = "type"; +var cg = "conditions"; +var ch = "fn"; +var ci = "argv"; +var cj = "ref"; +var ck = "assign"; +var cl = "url"; +var cm = "properties"; +var cn = "backend"; +var co = "authSchemes"; +var cp = "disableDoubleEncoding"; +var cq = "signingName"; +var cr = "signingRegion"; +var cs = "headers"; +var ct = "signingRegionSet"; +var a = false; +var b = true; +var c = "isSet"; +var d = "booleanEquals"; +var e = "error"; +var f = "aws.partition"; +var g = "stringEquals"; +var h = "getAttr"; +var i = "name"; +var j = "substring"; +var k = "bucketSuffix"; +var l = "parseURL"; +var m = "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}"; +var n = "endpoint"; +var o = "tree"; +var p = "aws.isVirtualHostableS3Bucket"; +var q = "{url#scheme}://{Bucket}.{url#authority}{url#path}"; +var r = "not"; +var s = "{url#scheme}://{url#authority}{url#path}"; +var t = "hardwareType"; +var u = "regionPrefix"; +var v = "bucketAliasSuffix"; +var w = "outpostId"; +var x = "isValidHostLabel"; +var y = "sigv4a"; +var z = "s3-outposts"; +var A = "s3"; +var B = "{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}"; +var C = "https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}"; +var D = "https://{Bucket}.s3.{partitionResult#dnsSuffix}"; +var E = "aws.parseArn"; +var F = "bucketArn"; +var G = "arnType"; +var H = ""; +var I = "s3-object-lambda"; +var J = "accesspoint"; +var K = "accessPointName"; +var L = "{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}"; +var M = "mrapPartition"; +var N = "outpostType"; +var O = "arnPrefix"; +var P = "{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}"; +var Q = "https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}"; +var R = "https://s3.{partitionResult#dnsSuffix}"; +var S = { [ce]: false, [cf]: "String" }; +var T = { [ce]: true, default: false, [cf]: "Boolean" }; +var U = { [ce]: false, [cf]: "Boolean" }; +var V = { [ch]: d, [ci]: [{ [cj]: "Accelerate" }, true] }; +var W = { [ch]: d, [ci]: [{ [cj]: "UseFIPS" }, true] }; +var X = { [ch]: d, [ci]: [{ [cj]: "UseDualStack" }, true] }; +var Y = { [ch]: c, [ci]: [{ [cj]: "Endpoint" }] }; +var Z = { [ch]: f, [ci]: [{ [cj]: "Region" }], [ck]: "partitionResult" }; +var aa = { [ch]: g, [ci]: [{ [ch]: h, [ci]: [{ [cj]: "partitionResult" }, i] }, "aws-cn"] }; +var ab = { [ch]: c, [ci]: [{ [cj]: "Bucket" }] }; +var ac = { [cj]: "Bucket" }; +var ad = { [ch]: l, [ci]: [{ [cj]: "Endpoint" }], [ck]: "url" }; +var ae = { [ch]: d, [ci]: [{ [ch]: h, [ci]: [{ [cj]: "url" }, "isIp"] }, true] }; +var af = { [cj]: "url" }; +var ag = { [ch]: "uriEncode", [ci]: [ac], [ck]: "uri_encoded_bucket" }; +var ah = { [cn]: "S3Express", [co]: [{ [cp]: true, [i]: "sigv4", [cq]: "s3express", [cr]: "{Region}" }] }; +var ai = {}; +var aj = { [ch]: p, [ci]: [ac, false] }; +var ak = { [e]: "S3Express bucket name is not a valid virtual hostable name.", [cf]: e }; +var al = { [cn]: "S3Express", [co]: [{ [cp]: true, [i]: "sigv4-s3express", [cq]: "s3express", [cr]: "{Region}" }] }; +var am = { [ch]: c, [ci]: [{ [cj]: "UseS3ExpressControlEndpoint" }] }; +var an = { [ch]: d, [ci]: [{ [cj]: "UseS3ExpressControlEndpoint" }, true] }; +var ao = { [ch]: r, [ci]: [Y] }; +var ap = { [e]: "Unrecognized S3Express bucket name format.", [cf]: e }; +var aq = { [ch]: r, [ci]: [ab] }; +var ar = { [cj]: t }; +var as = { [cg]: [ao], [e]: "Expected a endpoint to be specified but no endpoint was found", [cf]: e }; +var at = { + [co]: [ + { [cp]: true, [i]: y, [cq]: z, [ct]: ["*"] }, + { [cp]: true, [i]: "sigv4", [cq]: z, [cr]: "{Region}" }, + ], +}; +var au = { [ch]: d, [ci]: [{ [cj]: "ForcePathStyle" }, false] }; +var av = { [cj]: "ForcePathStyle" }; +var aw = { [ch]: d, [ci]: [{ [cj]: "Accelerate" }, false] }; +var ax = { [ch]: g, [ci]: [{ [cj]: "Region" }, "aws-global"] }; +var ay = { [co]: [{ [cp]: true, [i]: "sigv4", [cq]: A, [cr]: "us-east-1" }] }; +var az = { [ch]: r, [ci]: [ax] }; +var aA = { [ch]: d, [ci]: [{ [cj]: "UseGlobalEndpoint" }, true] }; +var aB = { + [cl]: "https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", + [cm]: { [co]: [{ [cp]: true, [i]: "sigv4", [cq]: A, [cr]: "{Region}" }] }, + [cs]: {}, +}; +var aC = { [co]: [{ [cp]: true, [i]: "sigv4", [cq]: A, [cr]: "{Region}" }] }; +var aD = { [ch]: d, [ci]: [{ [cj]: "UseGlobalEndpoint" }, false] }; +var aE = { [ch]: d, [ci]: [{ [cj]: "UseDualStack" }, false] }; +var aF = { [cl]: "https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var aG = { [ch]: d, [ci]: [{ [cj]: "UseFIPS" }, false] }; +var aH = { [cl]: "https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var aI = { [cl]: "https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var aJ = { [ch]: d, [ci]: [{ [ch]: h, [ci]: [af, "isIp"] }, false] }; +var aK = { [cl]: B, [cm]: aC, [cs]: {} }; +var aL = { [cl]: q, [cm]: aC, [cs]: {} }; +var aM = { [n]: aL, [cf]: n }; +var aN = { [cl]: C, [cm]: aC, [cs]: {} }; +var aO = { [cl]: "https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var aP = { [e]: "Invalid region: region was not a valid DNS name.", [cf]: e }; +var aQ = { [cj]: F }; +var aR = { [cj]: G }; +var aS = { [ch]: h, [ci]: [aQ, "service"] }; +var aT = { [cj]: K }; +var aU = { [cg]: [X], [e]: "S3 Object Lambda does not support Dual-stack", [cf]: e }; +var aV = { [cg]: [V], [e]: "S3 Object Lambda does not support S3 Accelerate", [cf]: e }; +var aW = { + [cg]: [ + { [ch]: c, [ci]: [{ [cj]: "DisableAccessPoints" }] }, + { [ch]: d, [ci]: [{ [cj]: "DisableAccessPoints" }, true] }, + ], + [e]: "Access points are not supported for this operation", + [cf]: e, +}; +var aX = { + [cg]: [ + { [ch]: c, [ci]: [{ [cj]: "UseArnRegion" }] }, + { [ch]: d, [ci]: [{ [cj]: "UseArnRegion" }, false] }, + { [ch]: r, [ci]: [{ [ch]: g, [ci]: [{ [ch]: h, [ci]: [aQ, "region"] }, "{Region}"] }] }, + ], + [e]: "Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`", + [cf]: e, +}; +var aY = { [ch]: h, [ci]: [{ [cj]: "bucketPartition" }, i] }; +var aZ = { [ch]: h, [ci]: [aQ, "accountId"] }; +var ba = { [co]: [{ [cp]: true, [i]: "sigv4", [cq]: I, [cr]: "{bucketArn#region}" }] }; +var bb = { + [e]: "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`", + [cf]: e, +}; +var bc = { + [e]: "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`", + [cf]: e, +}; +var bd = { [e]: "Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)", [cf]: e }; +var be = { + [e]: "Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`", + [cf]: e, +}; +var bf = { [e]: "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.", [cf]: e }; +var bg = { + [e]: "Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided", + [cf]: e, +}; +var bh = { [co]: [{ [cp]: true, [i]: "sigv4", [cq]: A, [cr]: "{bucketArn#region}" }] }; +var bi = { + [co]: [ + { [cp]: true, [i]: y, [cq]: z, [ct]: ["*"] }, + { [cp]: true, [i]: "sigv4", [cq]: z, [cr]: "{bucketArn#region}" }, + ], +}; +var bj = { [ch]: E, [ci]: [ac] }; +var bk = { + [cl]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", + [cm]: aC, + [cs]: {}, +}; +var bl = { [cl]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cm]: aC, [cs]: {} }; +var bm = { [cl]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cm]: aC, [cs]: {} }; +var bn = { [cl]: P, [cm]: aC, [cs]: {} }; +var bo = { [cl]: "https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cm]: aC, [cs]: {} }; +var bp = { [cj]: "UseObjectLambdaEndpoint" }; +var bq = { [co]: [{ [cp]: true, [i]: "sigv4", [cq]: I, [cr]: "{Region}" }] }; +var br = { [cl]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var bs = { [cl]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var bt = { [cl]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var bu = { [cl]: s, [cm]: aC, [cs]: {} }; +var bv = { [cl]: "https://s3.{Region}.{partitionResult#dnsSuffix}", [cm]: aC, [cs]: {} }; +var bw = [{ [cj]: "Region" }]; +var bx = [{ [cj]: "Endpoint" }]; +var by = [ac]; +var bz = [X]; +var bA = [V]; +var bB = [Y, ad]; +var bC = [ + { [ch]: c, [ci]: [{ [cj]: "DisableS3ExpressSessionAuth" }] }, + { [ch]: d, [ci]: [{ [cj]: "DisableS3ExpressSessionAuth" }, true] }, +]; +var bD = [ae]; +var bE = [ag]; +var bF = [aj]; +var bG = [W]; +var bH = [ + { [ch]: j, [ci]: [ac, 6, 14, true], [ck]: "s3expressAvailabilityZoneId" }, + { [ch]: j, [ci]: [ac, 14, 16, true], [ck]: "s3expressAvailabilityZoneDelim" }, + { [ch]: g, [ci]: [{ [cj]: "s3expressAvailabilityZoneDelim" }, "--"] }, +]; +var bI = [ + { + [cg]: [W], + [n]: { + [cl]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", + [cm]: ah, + [cs]: {}, + }, + [cf]: n, + }, + { + [n]: { + [cl]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", + [cm]: ah, + [cs]: {}, + }, + [cf]: n, + }, +]; +var bJ = [ + { [ch]: j, [ci]: [ac, 6, 15, true], [ck]: "s3expressAvailabilityZoneId" }, + { [ch]: j, [ci]: [ac, 15, 17, true], [ck]: "s3expressAvailabilityZoneDelim" }, + { [ch]: g, [ci]: [{ [cj]: "s3expressAvailabilityZoneDelim" }, "--"] }, +]; +var bK = [ + { + [cg]: [W], + [n]: { + [cl]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", + [cm]: al, + [cs]: {}, + }, + [cf]: n, + }, + { + [n]: { + [cl]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", + [cm]: al, + [cs]: {}, + }, + [cf]: n, + }, +]; +var bL = [ab]; +var bM = [{ [ch]: x, [ci]: [{ [cj]: w }, false] }]; +var bN = [{ [ch]: g, [ci]: [{ [cj]: u }, "beta"] }]; +var bO = ["*"]; +var bP = [Z]; +var bQ = [{ [ch]: x, [ci]: [{ [cj]: "Region" }, false] }]; +var bR = [{ [ch]: g, [ci]: [{ [cj]: "Region" }, "us-east-1"] }]; +var bS = [{ [ch]: g, [ci]: [aR, J] }]; +var bT = [ + { [ch]: h, [ci]: [aQ, "resourceId[1]"], [ck]: K }, + { [ch]: r, [ci]: [{ [ch]: g, [ci]: [aT, H] }] }, +]; +var bU = [aQ, "resourceId[1]"]; +var bV = [{ [ch]: r, [ci]: [{ [ch]: g, [ci]: [{ [ch]: h, [ci]: [aQ, "region"] }, H] }] }]; +var bW = [{ [ch]: r, [ci]: [{ [ch]: c, [ci]: [{ [ch]: h, [ci]: [aQ, "resourceId[2]"] }] }] }]; +var bX = [aQ, "resourceId[2]"]; +var bY = [{ [ch]: f, [ci]: [{ [ch]: h, [ci]: [aQ, "region"] }], [ck]: "bucketPartition" }]; +var bZ = [{ [ch]: g, [ci]: [aY, { [ch]: h, [ci]: [{ [cj]: "partitionResult" }, i] }] }]; +var ca = [{ [ch]: x, [ci]: [{ [ch]: h, [ci]: [aQ, "region"] }, true] }]; +var cb = [{ [ch]: x, [ci]: [aZ, false] }]; +var cc = [{ [ch]: x, [ci]: [aT, false] }]; +var cd = [{ [ch]: x, [ci]: [{ [cj]: "Region" }, true] }]; +var _data = { + version: "1.0", + parameters: { + Bucket: S, + Region: S, + UseFIPS: T, + UseDualStack: T, + Endpoint: S, + ForcePathStyle: T, + Accelerate: T, + UseGlobalEndpoint: T, + UseObjectLambdaEndpoint: U, + Key: S, + Prefix: S, + CopySource: S, + DisableAccessPoints: U, + DisableMultiRegionAccessPoints: T, + UseArnRegion: U, + UseS3ExpressControlEndpoint: U, + DisableS3ExpressSessionAuth: U, + }, + rules: [ + { + [cg]: [{ [ch]: c, [ci]: bw }], + rules: [ + { [cg]: [V, W], error: "Accelerate cannot be used with FIPS", [cf]: e }, + { [cg]: [X, Y], error: "Cannot set dual-stack in combination with a custom endpoint.", [cf]: e }, + { [cg]: [Y, W], error: "A custom endpoint cannot be combined with FIPS", [cf]: e }, + { [cg]: [Y, V], error: "A custom endpoint cannot be combined with S3 Accelerate", [cf]: e }, + { [cg]: [W, Z, aa], error: "Partition does not support FIPS", [cf]: e }, + { + [cg]: [ab, { [ch]: j, [ci]: [ac, 0, 6, b], [ck]: k }, { [ch]: g, [ci]: [{ [cj]: k }, "--x-s3"] }], + rules: [ + { [cg]: bz, error: "S3Express does not support Dual-stack.", [cf]: e }, + { [cg]: bA, error: "S3Express does not support S3 Accelerate.", [cf]: e }, + { + [cg]: bB, + rules: [ + { + [cg]: bC, + rules: [ + { + [cg]: bD, + rules: [{ [cg]: bE, rules: [{ endpoint: { [cl]: m, [cm]: ah, [cs]: ai }, [cf]: n }], [cf]: o }], + [cf]: o, + }, + { [cg]: bF, rules: [{ endpoint: { [cl]: q, [cm]: ah, [cs]: ai }, [cf]: n }], [cf]: o }, + ak, + ], + [cf]: o, + }, + { + [cg]: bD, + rules: [{ [cg]: bE, rules: [{ endpoint: { [cl]: m, [cm]: al, [cs]: ai }, [cf]: n }], [cf]: o }], + [cf]: o, + }, + { [cg]: bF, rules: [{ endpoint: { [cl]: q, [cm]: al, [cs]: ai }, [cf]: n }], [cf]: o }, + ak, + ], + [cf]: o, + }, + { + [cg]: [am, an], + rules: [ + { + [cg]: [ag, ao], + rules: [ + { + [cg]: bG, + endpoint: { + [cl]: "https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}", + [cm]: ah, + [cs]: ai, + }, + [cf]: n, + }, + { + endpoint: { + [cl]: "https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}", + [cm]: ah, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { + [cg]: bF, + rules: [ + { [cg]: bC, rules: [{ [cg]: bH, rules: bI, [cf]: o }, { [cg]: bJ, rules: bI, [cf]: o }, ap], [cf]: o }, + { [cg]: bH, rules: bK, [cf]: o }, + { [cg]: bJ, rules: bK, [cf]: o }, + ap, + ], + [cf]: o, + }, + ak, + ], + [cf]: o, + }, + { + [cg]: [aq, am, an], + rules: [ + { [cg]: bB, endpoint: { [cl]: s, [cm]: ah, [cs]: ai }, [cf]: n }, + { + [cg]: bG, + endpoint: { [cl]: "https://s3express-control-fips.{Region}.amazonaws.com", [cm]: ah, [cs]: ai }, + [cf]: n, + }, + { endpoint: { [cl]: "https://s3express-control.{Region}.amazonaws.com", [cm]: ah, [cs]: ai }, [cf]: n }, + ], + [cf]: o, + }, + { + [cg]: [ + ab, + { [ch]: j, [ci]: [ac, 49, 50, b], [ck]: t }, + { [ch]: j, [ci]: [ac, 8, 12, b], [ck]: u }, + { [ch]: j, [ci]: [ac, 0, 7, b], [ck]: v }, + { [ch]: j, [ci]: [ac, 32, 49, b], [ck]: w }, + { [ch]: f, [ci]: bw, [ck]: "regionPartition" }, + { [ch]: g, [ci]: [{ [cj]: v }, "--op-s3"] }, + ], + rules: [ + { + [cg]: bM, + rules: [ + { + [cg]: [{ [ch]: g, [ci]: [ar, "e"] }], + rules: [ + { + [cg]: bN, + rules: [ + as, + { + [cg]: bB, + endpoint: { [cl]: "https://{Bucket}.ec2.{url#authority}", [cm]: at, [cs]: ai }, + [cf]: n, + }, + ], + [cf]: o, + }, + { + endpoint: { + [cl]: "https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}", + [cm]: at, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + { + [cg]: [{ [ch]: g, [ci]: [ar, "o"] }], + rules: [ + { + [cg]: bN, + rules: [ + as, + { + [cg]: bB, + endpoint: { [cl]: "https://{Bucket}.op-{outpostId}.{url#authority}", [cm]: at, [cs]: ai }, + [cf]: n, + }, + ], + [cf]: o, + }, + { + endpoint: { + [cl]: "https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}", + [cm]: at, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + { + error: 'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"', + [cf]: e, + }, + ], + [cf]: o, + }, + { error: "Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.", [cf]: e }, + ], + [cf]: o, + }, + { + [cg]: bL, + rules: [ + { + [cg]: [Y, { [ch]: r, [ci]: [{ [ch]: c, [ci]: [{ [ch]: l, [ci]: bx }] }] }], + error: "Custom endpoint `{Endpoint}` was not a valid URI", + [cf]: e, + }, + { + [cg]: [au, aj], + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: bQ, + rules: [ + { [cg]: [V, aa], error: "S3 Accelerate cannot be used in this region", [cf]: e }, + { + [cg]: [X, W, aw, ao, ax], + endpoint: { + [cl]: "https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [X, W, aw, ao, az, aA], rules: [{ endpoint: aB, [cf]: n }], [cf]: o }, + { [cg]: [X, W, aw, ao, az, aD], endpoint: aB, [cf]: n }, + { + [cg]: [aE, W, aw, ao, ax], + endpoint: { + [cl]: "https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [aE, W, aw, ao, az, aA], rules: [{ endpoint: aF, [cf]: n }], [cf]: o }, + { [cg]: [aE, W, aw, ao, az, aD], endpoint: aF, [cf]: n }, + { + [cg]: [X, aG, V, ao, ax], + endpoint: { + [cl]: "https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [X, aG, V, ao, az, aA], rules: [{ endpoint: aH, [cf]: n }], [cf]: o }, + { [cg]: [X, aG, V, ao, az, aD], endpoint: aH, [cf]: n }, + { + [cg]: [X, aG, aw, ao, ax], + endpoint: { + [cl]: "https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [X, aG, aw, ao, az, aA], rules: [{ endpoint: aI, [cf]: n }], [cf]: o }, + { [cg]: [X, aG, aw, ao, az, aD], endpoint: aI, [cf]: n }, + { [cg]: [aE, aG, aw, Y, ad, ae, ax], endpoint: { [cl]: B, [cm]: ay, [cs]: ai }, [cf]: n }, + { [cg]: [aE, aG, aw, Y, ad, aJ, ax], endpoint: { [cl]: q, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aE, aG, aw, Y, ad, ae, az, aA], + rules: [ + { [cg]: bR, endpoint: aK, [cf]: n }, + { endpoint: aK, [cf]: n }, + ], + [cf]: o, + }, + { + [cg]: [aE, aG, aw, Y, ad, aJ, az, aA], + rules: [{ [cg]: bR, endpoint: aL, [cf]: n }, aM], + [cf]: o, + }, + { [cg]: [aE, aG, aw, Y, ad, ae, az, aD], endpoint: aK, [cf]: n }, + { [cg]: [aE, aG, aw, Y, ad, aJ, az, aD], endpoint: aL, [cf]: n }, + { [cg]: [aE, aG, V, ao, ax], endpoint: { [cl]: C, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aE, aG, V, ao, az, aA], + rules: [ + { [cg]: bR, endpoint: aN, [cf]: n }, + { endpoint: aN, [cf]: n }, + ], + [cf]: o, + }, + { [cg]: [aE, aG, V, ao, az, aD], endpoint: aN, [cf]: n }, + { [cg]: [aE, aG, aw, ao, ax], endpoint: { [cl]: D, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aE, aG, aw, ao, az, aA], + rules: [ + { [cg]: bR, endpoint: { [cl]: D, [cm]: aC, [cs]: ai }, [cf]: n }, + { endpoint: aO, [cf]: n }, + ], + [cf]: o, + }, + { [cg]: [aE, aG, aw, ao, az, aD], endpoint: aO, [cf]: n }, + ], + [cf]: o, + }, + aP, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { + [cg]: [ + Y, + ad, + { [ch]: g, [ci]: [{ [ch]: h, [ci]: [af, "scheme"] }, "http"] }, + { [ch]: p, [ci]: [ac, b] }, + au, + aG, + aE, + aw, + ], + rules: [{ [cg]: bP, rules: [{ [cg]: bQ, rules: [aM], [cf]: o }, aP], [cf]: o }], + [cf]: o, + }, + { + [cg]: [au, { [ch]: E, [ci]: by, [ck]: F }], + rules: [ + { + [cg]: [ + { [ch]: h, [ci]: [aQ, "resourceId[0]"], [ck]: G }, + { [ch]: r, [ci]: [{ [ch]: g, [ci]: [aR, H] }] }, + ], + rules: [ + { + [cg]: [{ [ch]: g, [ci]: [aS, I] }], + rules: [ + { + [cg]: bS, + rules: [ + { + [cg]: bT, + rules: [ + aU, + aV, + { + [cg]: bV, + rules: [ + aW, + { + [cg]: bW, + rules: [ + aX, + { + [cg]: bY, + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: bZ, + rules: [ + { + [cg]: ca, + rules: [ + { + [cg]: [{ [ch]: g, [ci]: [aZ, H] }], + error: "Invalid ARN: Missing account id", + [cf]: e, + }, + { + [cg]: cb, + rules: [ + { + [cg]: cc, + rules: [ + { + [cg]: bB, + endpoint: { [cl]: L, [cm]: ba, [cs]: ai }, + [cf]: n, + }, + { + [cg]: bG, + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: ba, + [cs]: ai, + }, + [cf]: n, + }, + { + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: ba, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + bb, + ], + [cf]: o, + }, + bc, + ], + [cf]: o, + }, + bd, + ], + [cf]: o, + }, + be, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + bf, + ], + [cf]: o, + }, + { error: "Invalid ARN: bucket ARN is missing a region", [cf]: e }, + ], + [cf]: o, + }, + bg, + ], + [cf]: o, + }, + { + error: + "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`", + [cf]: e, + }, + ], + [cf]: o, + }, + { + [cg]: bS, + rules: [ + { + [cg]: bT, + rules: [ + { + [cg]: bV, + rules: [ + { + [cg]: bS, + rules: [ + { + [cg]: bV, + rules: [ + aW, + { + [cg]: bW, + rules: [ + aX, + { + [cg]: bY, + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: [{ [ch]: g, [ci]: [aY, "{partitionResult#name}"] }], + rules: [ + { + [cg]: ca, + rules: [ + { + [cg]: [{ [ch]: g, [ci]: [aS, A] }], + rules: [ + { + [cg]: cb, + rules: [ + { + [cg]: cc, + rules: [ + { + [cg]: bA, + error: + "Access Points do not support S3 Accelerate", + [cf]: e, + }, + { + [cg]: [W, X], + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: bh, + [cs]: ai, + }, + [cf]: n, + }, + { + [cg]: [W, aE], + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: bh, + [cs]: ai, + }, + [cf]: n, + }, + { + [cg]: [aG, X], + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: bh, + [cs]: ai, + }, + [cf]: n, + }, + { + [cg]: [aG, aE, Y, ad], + endpoint: { [cl]: L, [cm]: bh, [cs]: ai }, + [cf]: n, + }, + { + [cg]: [aG, aE], + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: bh, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + bb, + ], + [cf]: o, + }, + bc, + ], + [cf]: o, + }, + { + error: + "Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}", + [cf]: e, + }, + ], + [cf]: o, + }, + bd, + ], + [cf]: o, + }, + be, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + bf, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { + [cg]: [{ [ch]: x, [ci]: [aT, b] }], + rules: [ + { [cg]: bz, error: "S3 MRAP does not support dual-stack", [cf]: e }, + { [cg]: bG, error: "S3 MRAP does not support FIPS", [cf]: e }, + { [cg]: bA, error: "S3 MRAP does not support S3 Accelerate", [cf]: e }, + { + [cg]: [{ [ch]: d, [ci]: [{ [cj]: "DisableMultiRegionAccessPoints" }, b] }], + error: "Invalid configuration: Multi-Region Access Point ARNs are disabled.", + [cf]: e, + }, + { + [cg]: [{ [ch]: f, [ci]: bw, [ck]: M }], + rules: [ + { + [cg]: [ + { + [ch]: g, + [ci]: [ + { [ch]: h, [ci]: [{ [cj]: M }, i] }, + { [ch]: h, [ci]: [aQ, "partition"] }, + ], + }, + ], + rules: [ + { + endpoint: { + [cl]: "https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}", + [cm]: { [co]: [{ [cp]: b, name: y, [cq]: A, [ct]: bO }] }, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + { + error: + "Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`", + [cf]: e, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { error: "Invalid Access Point Name", [cf]: e }, + ], + [cf]: o, + }, + bg, + ], + [cf]: o, + }, + { + [cg]: [{ [ch]: g, [ci]: [aS, z] }], + rules: [ + { [cg]: bz, error: "S3 Outposts does not support Dual-stack", [cf]: e }, + { [cg]: bG, error: "S3 Outposts does not support FIPS", [cf]: e }, + { [cg]: bA, error: "S3 Outposts does not support S3 Accelerate", [cf]: e }, + { + [cg]: [{ [ch]: c, [ci]: [{ [ch]: h, [ci]: [aQ, "resourceId[4]"] }] }], + error: "Invalid Arn: Outpost Access Point ARN contains sub resources", + [cf]: e, + }, + { + [cg]: [{ [ch]: h, [ci]: bU, [ck]: w }], + rules: [ + { + [cg]: bM, + rules: [ + aX, + { + [cg]: bY, + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: bZ, + rules: [ + { + [cg]: ca, + rules: [ + { + [cg]: cb, + rules: [ + { + [cg]: [{ [ch]: h, [ci]: bX, [ck]: N }], + rules: [ + { + [cg]: [{ [ch]: h, [ci]: [aQ, "resourceId[3]"], [ck]: K }], + rules: [ + { + [cg]: [{ [ch]: g, [ci]: [{ [cj]: N }, J] }], + rules: [ + { + [cg]: bB, + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}", + [cm]: bi, + [cs]: ai, + }, + [cf]: n, + }, + { + endpoint: { + [cl]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}", + [cm]: bi, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + { + error: + "Expected an outpost type `accesspoint`, found {outpostType}", + [cf]: e, + }, + ], + [cf]: o, + }, + { + error: "Invalid ARN: expected an access point name", + [cf]: e, + }, + ], + [cf]: o, + }, + { error: "Invalid ARN: Expected a 4-component resource", [cf]: e }, + ], + [cf]: o, + }, + bc, + ], + [cf]: o, + }, + bd, + ], + [cf]: o, + }, + be, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { + error: + "Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`", + [cf]: e, + }, + ], + [cf]: o, + }, + { error: "Invalid ARN: The Outpost Id was not set", [cf]: e }, + ], + [cf]: o, + }, + { error: "Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})", [cf]: e }, + ], + [cf]: o, + }, + { error: "Invalid ARN: No ARN type specified", [cf]: e }, + ], + [cf]: o, + }, + { + [cg]: [ + { [ch]: j, [ci]: [ac, 0, 4, a], [ck]: O }, + { [ch]: g, [ci]: [{ [cj]: O }, "arn:"] }, + { [ch]: r, [ci]: [{ [ch]: c, [ci]: [bj] }] }, + ], + error: "Invalid ARN: `{Bucket}` was not a valid ARN", + [cf]: e, + }, + { + [cg]: [{ [ch]: d, [ci]: [av, b] }, bj], + error: "Path-style addressing cannot be used with ARN buckets", + [cf]: e, + }, + { + [cg]: bE, + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: [aw], + rules: [ + { + [cg]: [X, ao, W, ax], + endpoint: { + [cl]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [X, ao, W, az, aA], rules: [{ endpoint: bk, [cf]: n }], [cf]: o }, + { [cg]: [X, ao, W, az, aD], endpoint: bk, [cf]: n }, + { + [cg]: [aE, ao, W, ax], + endpoint: { + [cl]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [aE, ao, W, az, aA], rules: [{ endpoint: bl, [cf]: n }], [cf]: o }, + { [cg]: [aE, ao, W, az, aD], endpoint: bl, [cf]: n }, + { + [cg]: [X, ao, aG, ax], + endpoint: { + [cl]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [X, ao, aG, az, aA], rules: [{ endpoint: bm, [cf]: n }], [cf]: o }, + { [cg]: [X, ao, aG, az, aD], endpoint: bm, [cf]: n }, + { [cg]: [aE, Y, ad, aG, ax], endpoint: { [cl]: P, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aE, Y, ad, aG, az, aA], + rules: [ + { [cg]: bR, endpoint: bn, [cf]: n }, + { endpoint: bn, [cf]: n }, + ], + [cf]: o, + }, + { [cg]: [aE, Y, ad, aG, az, aD], endpoint: bn, [cf]: n }, + { [cg]: [aE, ao, aG, ax], endpoint: { [cl]: Q, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aE, ao, aG, az, aA], + rules: [ + { [cg]: bR, endpoint: { [cl]: Q, [cm]: aC, [cs]: ai }, [cf]: n }, + { endpoint: bo, [cf]: n }, + ], + [cf]: o, + }, + { [cg]: [aE, ao, aG, az, aD], endpoint: bo, [cf]: n }, + ], + [cf]: o, + }, + { error: "Path-style addressing cannot be used with S3 Accelerate", [cf]: e }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { + [cg]: [ + { [ch]: c, [ci]: [bp] }, + { [ch]: d, [ci]: [bp, b] }, + ], + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: cd, + rules: [ + aU, + aV, + { [cg]: bB, endpoint: { [cl]: s, [cm]: bq, [cs]: ai }, [cf]: n }, + { + [cg]: bG, + endpoint: { + [cl]: "https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}", + [cm]: bq, + [cs]: ai, + }, + [cf]: n, + }, + { + endpoint: { + [cl]: "https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}", + [cm]: bq, + [cs]: ai, + }, + [cf]: n, + }, + ], + [cf]: o, + }, + aP, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { + [cg]: [aq], + rules: [ + { + [cg]: bP, + rules: [ + { + [cg]: cd, + rules: [ + { + [cg]: [W, X, ao, ax], + endpoint: { + [cl]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [W, X, ao, az, aA], rules: [{ endpoint: br, [cf]: n }], [cf]: o }, + { [cg]: [W, X, ao, az, aD], endpoint: br, [cf]: n }, + { + [cg]: [W, aE, ao, ax], + endpoint: { [cl]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cm]: ay, [cs]: ai }, + [cf]: n, + }, + { [cg]: [W, aE, ao, az, aA], rules: [{ endpoint: bs, [cf]: n }], [cf]: o }, + { [cg]: [W, aE, ao, az, aD], endpoint: bs, [cf]: n }, + { + [cg]: [aG, X, ao, ax], + endpoint: { + [cl]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", + [cm]: ay, + [cs]: ai, + }, + [cf]: n, + }, + { [cg]: [aG, X, ao, az, aA], rules: [{ endpoint: bt, [cf]: n }], [cf]: o }, + { [cg]: [aG, X, ao, az, aD], endpoint: bt, [cf]: n }, + { [cg]: [aG, aE, Y, ad, ax], endpoint: { [cl]: s, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aG, aE, Y, ad, az, aA], + rules: [ + { [cg]: bR, endpoint: bu, [cf]: n }, + { endpoint: bu, [cf]: n }, + ], + [cf]: o, + }, + { [cg]: [aG, aE, Y, ad, az, aD], endpoint: bu, [cf]: n }, + { [cg]: [aG, aE, ao, ax], endpoint: { [cl]: R, [cm]: ay, [cs]: ai }, [cf]: n }, + { + [cg]: [aG, aE, ao, az, aA], + rules: [ + { [cg]: bR, endpoint: { [cl]: R, [cm]: aC, [cs]: ai }, [cf]: n }, + { endpoint: bv, [cf]: n }, + ], + [cf]: o, + }, + { [cg]: [aG, aE, ao, az, aD], endpoint: bv, [cf]: n }, + ], + [cf]: o, + }, + aP, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + ], + [cf]: o, + }, + { error: "A region must be set when sending requests to S3.", [cf]: e }, + ], +}; +var ruleSet = _data; + +// dist-es/endpoint/endpointResolver.js +var cache = new EndpointCache({ + size: 50, + params: [ + "Accelerate", + "Bucket", + "DisableAccessPoints", + "DisableMultiRegionAccessPoints", + "DisableS3ExpressSessionAuth", + "Endpoint", + "ForcePathStyle", + "Region", + "UseArnRegion", + "UseDualStack", + "UseFIPS", + "UseGlobalEndpoint", + "UseObjectLambdaEndpoint", + "UseS3ExpressControlEndpoint", + ], +}); +var defaultEndpointResolver = (endpointParams, context = {}) => { + return cache.get(endpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams, + logger: context.logger, + }) + ); +}; +customEndpointFunctions.aws = awsEndpointFunctions; + +// dist-es/auth/httpAuthSchemeProvider.js +var createEndpointRuleSetHttpAuthSchemeParametersProvider = + (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => { + if (!input) { + throw new Error(`Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\``); + } + const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input); + const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor?.getEndpointParameterInstructions; + if (!instructionsFn) { + throw new Error(`getEndpointParameterInstructions() is not defined on \`${context.commandName}\``); + } + const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config); + return Object.assign(defaultParameters, endpointParameters); + }; +var _defaultS3HttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: getSmithyContext(context).operation, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; +var defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider( + _defaultS3HttpAuthSchemeParametersProvider +); +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "s3", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, + }, + }), + }; +} +function createAwsAuthSigv4aHttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4a", + signingProperties: { + name: "s3", + region: authParameters.region, + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context, + }, + }), + }; +} +var createEndpointRuleSetHttpAuthSchemeProvider = ( + defaultEndpointResolver2, + defaultHttpAuthSchemeResolver, + createHttpAuthOptionFunctions +) => { + const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => { + const endpoint = defaultEndpointResolver2(authParameters); + const authSchemes = endpoint.properties?.authSchemes; + if (!authSchemes) { + return defaultHttpAuthSchemeResolver(authParameters); + } + const options = []; + for (const scheme of authSchemes) { + const { name: resolvedName, properties = {}, ...rest } = scheme; + const name = resolvedName.toLowerCase(); + if (resolvedName !== name) { + console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${resolvedName}\` to \`${name}\``); + } + let schemeId; + if (name === "sigv4a") { + schemeId = "aws.auth#sigv4a"; + const sigv4Present = authSchemes.find((s2) => { + const name2 = s2.name.toLowerCase(); + return name2 !== "sigv4a" && name2.startsWith("sigv4"); + }); + if (!signatureV4CrtContainer.CrtSignerV4 && sigv4Present) { + continue; + } + } else if (name.startsWith("sigv4")) { + schemeId = "aws.auth#sigv4"; + } else { + throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${name}\``); + } + const createOption = createHttpAuthOptionFunctions[schemeId]; + if (!createOption) { + throw new Error(`Could not find HttpAuthOption create function for \`${schemeId}\``); + } + const option = createOption(authParameters); + option.schemeId = schemeId; + option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties }; + options.push(option); + } + return options; + }; + return endpointRuleSetHttpAuthSchemeProvider; +}; +var _defaultS3HttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); + } + } + return options; +}; +var defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider( + defaultEndpointResolver, + _defaultS3HttpAuthSchemeProvider, + { + "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption, + "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption, + } +); +var resolveHttpAuthSchemeConfig = (config) => { + const config_0 = resolveAwsSdkSigV4Config(config); + const config_1 = resolveAwsSdkSigV4AConfig(config_0); + return { + ...config_1, + }; +}; + +// dist-es/commands/CreateSessionCommand.js +import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; + +// dist-es/endpoint/EndpointParameters.js +var resolveClientEndpointParameters = (options) => { + return { + ...options, + useFipsEndpoint: options.useFipsEndpoint ?? false, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + forcePathStyle: options.forcePathStyle ?? false, + useAccelerateEndpoint: options.useAccelerateEndpoint ?? false, + useGlobalEndpoint: options.useGlobalEndpoint ?? false, + disableMultiregionAccessPoints: options.disableMultiregionAccessPoints ?? false, + defaultSigningName: "s3", + }; +}; +var commonParams = { + ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" }, + UseArnRegion: { type: "clientContextParams", name: "useArnRegion" }, + DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" }, + Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" }, + DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" }, + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, +}; + +// dist-es/models/models_0.js +import { SENSITIVE_STRING } from "@smithy/smithy-client"; + +// dist-es/models/S3ServiceException.js +import { ServiceException as __ServiceException } from "@smithy/smithy-client"; +var S3ServiceException = class _S3ServiceException extends __ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _S3ServiceException.prototype); + } +}; + +// dist-es/models/models_0.js +var RequestCharged = { + requester: "requester", +}; +var RequestPayer = { + requester: "requester", +}; +var NoSuchUpload = class _NoSuchUpload extends S3ServiceException { + constructor(opts) { + super({ + name: "NoSuchUpload", + $fault: "client", + ...opts, + }); + this.name = "NoSuchUpload"; + this.$fault = "client"; + Object.setPrototypeOf(this, _NoSuchUpload.prototype); + } +}; +var BucketAccelerateStatus = { + Enabled: "Enabled", + Suspended: "Suspended", +}; +var Type = { + AmazonCustomerByEmail: "AmazonCustomerByEmail", + CanonicalUser: "CanonicalUser", + Group: "Group", +}; +var Permission = { + FULL_CONTROL: "FULL_CONTROL", + READ: "READ", + READ_ACP: "READ_ACP", + WRITE: "WRITE", + WRITE_ACP: "WRITE_ACP", +}; +var OwnerOverride = { + Destination: "Destination", +}; +var ServerSideEncryption = { + AES256: "AES256", + aws_kms: "aws:kms", + aws_kms_dsse: "aws:kms:dsse", +}; +var ObjectCannedACL = { + authenticated_read: "authenticated-read", + aws_exec_read: "aws-exec-read", + bucket_owner_full_control: "bucket-owner-full-control", + bucket_owner_read: "bucket-owner-read", + private: "private", + public_read: "public-read", + public_read_write: "public-read-write", +}; +var ChecksumAlgorithm = { + CRC32: "CRC32", + CRC32C: "CRC32C", + SHA1: "SHA1", + SHA256: "SHA256", +}; +var MetadataDirective = { + COPY: "COPY", + REPLACE: "REPLACE", +}; +var ObjectLockLegalHoldStatus = { + OFF: "OFF", + ON: "ON", +}; +var ObjectLockMode = { + COMPLIANCE: "COMPLIANCE", + GOVERNANCE: "GOVERNANCE", +}; +var StorageClass = { + DEEP_ARCHIVE: "DEEP_ARCHIVE", + EXPRESS_ONEZONE: "EXPRESS_ONEZONE", + GLACIER: "GLACIER", + GLACIER_IR: "GLACIER_IR", + INTELLIGENT_TIERING: "INTELLIGENT_TIERING", + ONEZONE_IA: "ONEZONE_IA", + OUTPOSTS: "OUTPOSTS", + REDUCED_REDUNDANCY: "REDUCED_REDUNDANCY", + SNOW: "SNOW", + STANDARD: "STANDARD", + STANDARD_IA: "STANDARD_IA", +}; +var TaggingDirective = { + COPY: "COPY", + REPLACE: "REPLACE", +}; +var ObjectNotInActiveTierError = class _ObjectNotInActiveTierError extends S3ServiceException { + constructor(opts) { + super({ + name: "ObjectNotInActiveTierError", + $fault: "client", + ...opts, + }); + this.name = "ObjectNotInActiveTierError"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ObjectNotInActiveTierError.prototype); + } +}; +var BucketAlreadyExists = class _BucketAlreadyExists extends S3ServiceException { + constructor(opts) { + super({ + name: "BucketAlreadyExists", + $fault: "client", + ...opts, + }); + this.name = "BucketAlreadyExists"; + this.$fault = "client"; + Object.setPrototypeOf(this, _BucketAlreadyExists.prototype); + } +}; +var BucketAlreadyOwnedByYou = class _BucketAlreadyOwnedByYou extends S3ServiceException { + constructor(opts) { + super({ + name: "BucketAlreadyOwnedByYou", + $fault: "client", + ...opts, + }); + this.name = "BucketAlreadyOwnedByYou"; + this.$fault = "client"; + Object.setPrototypeOf(this, _BucketAlreadyOwnedByYou.prototype); + } +}; +var BucketCannedACL = { + authenticated_read: "authenticated-read", + private: "private", + public_read: "public-read", + public_read_write: "public-read-write", +}; +var DataRedundancy = { + SingleAvailabilityZone: "SingleAvailabilityZone", +}; +var BucketType = { + Directory: "Directory", +}; +var LocationType = { + AvailabilityZone: "AvailabilityZone", +}; +var BucketLocationConstraint = { + EU: "EU", + af_south_1: "af-south-1", + ap_east_1: "ap-east-1", + ap_northeast_1: "ap-northeast-1", + ap_northeast_2: "ap-northeast-2", + ap_northeast_3: "ap-northeast-3", + ap_south_1: "ap-south-1", + ap_south_2: "ap-south-2", + ap_southeast_1: "ap-southeast-1", + ap_southeast_2: "ap-southeast-2", + ap_southeast_3: "ap-southeast-3", + ca_central_1: "ca-central-1", + cn_north_1: "cn-north-1", + cn_northwest_1: "cn-northwest-1", + eu_central_1: "eu-central-1", + eu_north_1: "eu-north-1", + eu_south_1: "eu-south-1", + eu_south_2: "eu-south-2", + eu_west_1: "eu-west-1", + eu_west_2: "eu-west-2", + eu_west_3: "eu-west-3", + me_south_1: "me-south-1", + sa_east_1: "sa-east-1", + us_east_2: "us-east-2", + us_gov_east_1: "us-gov-east-1", + us_gov_west_1: "us-gov-west-1", + us_west_1: "us-west-1", + us_west_2: "us-west-2", +}; +var ObjectOwnership = { + BucketOwnerEnforced: "BucketOwnerEnforced", + BucketOwnerPreferred: "BucketOwnerPreferred", + ObjectWriter: "ObjectWriter", +}; +var SessionMode = { + ReadOnly: "ReadOnly", + ReadWrite: "ReadWrite", +}; +var NoSuchBucket = class _NoSuchBucket extends S3ServiceException { + constructor(opts) { + super({ + name: "NoSuchBucket", + $fault: "client", + ...opts, + }); + this.name = "NoSuchBucket"; + this.$fault = "client"; + Object.setPrototypeOf(this, _NoSuchBucket.prototype); + } +}; +var AnalyticsFilter; +(function (AnalyticsFilter2) { + AnalyticsFilter2.visit = (value, visitor) => { + if (value.Prefix !== void 0) return visitor.Prefix(value.Prefix); + if (value.Tag !== void 0) return visitor.Tag(value.Tag); + if (value.And !== void 0) return visitor.And(value.And); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +})(AnalyticsFilter || (AnalyticsFilter = {})); +var AnalyticsS3ExportFileFormat = { + CSV: "CSV", +}; +var StorageClassAnalysisSchemaVersion = { + V_1: "V_1", +}; +var IntelligentTieringStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var IntelligentTieringAccessTier = { + ARCHIVE_ACCESS: "ARCHIVE_ACCESS", + DEEP_ARCHIVE_ACCESS: "DEEP_ARCHIVE_ACCESS", +}; +var InventoryFormat = { + CSV: "CSV", + ORC: "ORC", + Parquet: "Parquet", +}; +var InventoryIncludedObjectVersions = { + All: "All", + Current: "Current", +}; +var InventoryOptionalField = { + BucketKeyStatus: "BucketKeyStatus", + ChecksumAlgorithm: "ChecksumAlgorithm", + ETag: "ETag", + EncryptionStatus: "EncryptionStatus", + IntelligentTieringAccessTier: "IntelligentTieringAccessTier", + IsMultipartUploaded: "IsMultipartUploaded", + LastModifiedDate: "LastModifiedDate", + ObjectAccessControlList: "ObjectAccessControlList", + ObjectLockLegalHoldStatus: "ObjectLockLegalHoldStatus", + ObjectLockMode: "ObjectLockMode", + ObjectLockRetainUntilDate: "ObjectLockRetainUntilDate", + ObjectOwner: "ObjectOwner", + ReplicationStatus: "ReplicationStatus", + Size: "Size", + StorageClass: "StorageClass", +}; +var InventoryFrequency = { + Daily: "Daily", + Weekly: "Weekly", +}; +var TransitionStorageClass = { + DEEP_ARCHIVE: "DEEP_ARCHIVE", + GLACIER: "GLACIER", + GLACIER_IR: "GLACIER_IR", + INTELLIGENT_TIERING: "INTELLIGENT_TIERING", + ONEZONE_IA: "ONEZONE_IA", + STANDARD_IA: "STANDARD_IA", +}; +var ExpirationStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var TransitionDefaultMinimumObjectSize = { + all_storage_classes_128K: "all_storage_classes_128K", + varies_by_storage_class: "varies_by_storage_class", +}; +var BucketLogsPermission = { + FULL_CONTROL: "FULL_CONTROL", + READ: "READ", + WRITE: "WRITE", +}; +var PartitionDateSource = { + DeliveryTime: "DeliveryTime", + EventTime: "EventTime", +}; +var MetricsFilter; +(function (MetricsFilter2) { + MetricsFilter2.visit = (value, visitor) => { + if (value.Prefix !== void 0) return visitor.Prefix(value.Prefix); + if (value.Tag !== void 0) return visitor.Tag(value.Tag); + if (value.AccessPointArn !== void 0) return visitor.AccessPointArn(value.AccessPointArn); + if (value.And !== void 0) return visitor.And(value.And); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +})(MetricsFilter || (MetricsFilter = {})); +var Event = { + s3_IntelligentTiering: "s3:IntelligentTiering", + s3_LifecycleExpiration_: "s3:LifecycleExpiration:*", + s3_LifecycleExpiration_Delete: "s3:LifecycleExpiration:Delete", + s3_LifecycleExpiration_DeleteMarkerCreated: "s3:LifecycleExpiration:DeleteMarkerCreated", + s3_LifecycleTransition: "s3:LifecycleTransition", + s3_ObjectAcl_Put: "s3:ObjectAcl:Put", + s3_ObjectCreated_: "s3:ObjectCreated:*", + s3_ObjectCreated_CompleteMultipartUpload: "s3:ObjectCreated:CompleteMultipartUpload", + s3_ObjectCreated_Copy: "s3:ObjectCreated:Copy", + s3_ObjectCreated_Post: "s3:ObjectCreated:Post", + s3_ObjectCreated_Put: "s3:ObjectCreated:Put", + s3_ObjectRemoved_: "s3:ObjectRemoved:*", + s3_ObjectRemoved_Delete: "s3:ObjectRemoved:Delete", + s3_ObjectRemoved_DeleteMarkerCreated: "s3:ObjectRemoved:DeleteMarkerCreated", + s3_ObjectRestore_: "s3:ObjectRestore:*", + s3_ObjectRestore_Completed: "s3:ObjectRestore:Completed", + s3_ObjectRestore_Delete: "s3:ObjectRestore:Delete", + s3_ObjectRestore_Post: "s3:ObjectRestore:Post", + s3_ObjectTagging_: "s3:ObjectTagging:*", + s3_ObjectTagging_Delete: "s3:ObjectTagging:Delete", + s3_ObjectTagging_Put: "s3:ObjectTagging:Put", + s3_ReducedRedundancyLostObject: "s3:ReducedRedundancyLostObject", + s3_Replication_: "s3:Replication:*", + s3_Replication_OperationFailedReplication: "s3:Replication:OperationFailedReplication", + s3_Replication_OperationMissedThreshold: "s3:Replication:OperationMissedThreshold", + s3_Replication_OperationNotTracked: "s3:Replication:OperationNotTracked", + s3_Replication_OperationReplicatedAfterThreshold: "s3:Replication:OperationReplicatedAfterThreshold", +}; +var FilterRuleName = { + prefix: "prefix", + suffix: "suffix", +}; +var DeleteMarkerReplicationStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var MetricsStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var ReplicationTimeStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var ExistingObjectReplicationStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var ReplicaModificationsStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var SseKmsEncryptedObjectsStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var ReplicationRuleStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var Payer = { + BucketOwner: "BucketOwner", + Requester: "Requester", +}; +var MFADeleteStatus = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var BucketVersioningStatus = { + Enabled: "Enabled", + Suspended: "Suspended", +}; +var Protocol = { + http: "http", + https: "https", +}; +var ReplicationStatus = { + COMPLETE: "COMPLETE", + COMPLETED: "COMPLETED", + FAILED: "FAILED", + PENDING: "PENDING", + REPLICA: "REPLICA", +}; +var ChecksumMode = { + ENABLED: "ENABLED", +}; +var InvalidObjectState = class _InvalidObjectState extends S3ServiceException { + constructor(opts) { + super({ + name: "InvalidObjectState", + $fault: "client", + ...opts, + }); + this.name = "InvalidObjectState"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidObjectState.prototype); + this.StorageClass = opts.StorageClass; + this.AccessTier = opts.AccessTier; + } +}; +var NoSuchKey = class _NoSuchKey extends S3ServiceException { + constructor(opts) { + super({ + name: "NoSuchKey", + $fault: "client", + ...opts, + }); + this.name = "NoSuchKey"; + this.$fault = "client"; + Object.setPrototypeOf(this, _NoSuchKey.prototype); + } +}; +var ObjectAttributes = { + CHECKSUM: "Checksum", + ETAG: "ETag", + OBJECT_PARTS: "ObjectParts", + OBJECT_SIZE: "ObjectSize", + STORAGE_CLASS: "StorageClass", +}; +var ObjectLockEnabled = { + Enabled: "Enabled", +}; +var ObjectLockRetentionMode = { + COMPLIANCE: "COMPLIANCE", + GOVERNANCE: "GOVERNANCE", +}; +var NotFound = class _NotFound extends S3ServiceException { + constructor(opts) { + super({ + name: "NotFound", + $fault: "client", + ...opts, + }); + this.name = "NotFound"; + this.$fault = "client"; + Object.setPrototypeOf(this, _NotFound.prototype); + } +}; +var ArchiveStatus = { + ARCHIVE_ACCESS: "ARCHIVE_ACCESS", + DEEP_ARCHIVE_ACCESS: "DEEP_ARCHIVE_ACCESS", +}; +var EncodingType = { + url: "url", +}; +var ObjectStorageClass = { + DEEP_ARCHIVE: "DEEP_ARCHIVE", + EXPRESS_ONEZONE: "EXPRESS_ONEZONE", + GLACIER: "GLACIER", + GLACIER_IR: "GLACIER_IR", + INTELLIGENT_TIERING: "INTELLIGENT_TIERING", + ONEZONE_IA: "ONEZONE_IA", + OUTPOSTS: "OUTPOSTS", + REDUCED_REDUNDANCY: "REDUCED_REDUNDANCY", + SNOW: "SNOW", + STANDARD: "STANDARD", + STANDARD_IA: "STANDARD_IA", +}; +var OptionalObjectAttributes = { + RESTORE_STATUS: "RestoreStatus", +}; +var ObjectVersionStorageClass = { + STANDARD: "STANDARD", +}; +var CompleteMultipartUploadOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), +}); +var CompleteMultipartUploadRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), +}); +var CopyObjectOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }), +}); +var CopyObjectRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }), + ...(obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING }), +}); +var CreateMultipartUploadOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }), +}); +var CreateMultipartUploadRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }), +}); +var SessionCredentialsFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SecretAccessKey && { SecretAccessKey: SENSITIVE_STRING }), + ...(obj.SessionToken && { SessionToken: SENSITIVE_STRING }), +}); +var CreateSessionOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }), + ...(obj.Credentials && { Credentials: SessionCredentialsFilterSensitiveLog(obj.Credentials) }), +}); +var CreateSessionRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }), +}); +var ServerSideEncryptionByDefaultFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.KMSMasterKeyID && { KMSMasterKeyID: SENSITIVE_STRING }), +}); +var ServerSideEncryptionRuleFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.ApplyServerSideEncryptionByDefault && { + ApplyServerSideEncryptionByDefault: ServerSideEncryptionByDefaultFilterSensitiveLog( + obj.ApplyServerSideEncryptionByDefault + ), + }), +}); +var ServerSideEncryptionConfigurationFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.Rules && { Rules: obj.Rules.map((item) => ServerSideEncryptionRuleFilterSensitiveLog(item)) }), +}); +var GetBucketEncryptionOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.ServerSideEncryptionConfiguration && { + ServerSideEncryptionConfiguration: ServerSideEncryptionConfigurationFilterSensitiveLog( + obj.ServerSideEncryptionConfiguration + ), + }), +}); +var SSEKMSFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.KeyId && { KeyId: SENSITIVE_STRING }), +}); +var InventoryEncryptionFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMS && { SSEKMS: SSEKMSFilterSensitiveLog(obj.SSEKMS) }), +}); +var InventoryS3BucketDestinationFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.Encryption && { Encryption: InventoryEncryptionFilterSensitiveLog(obj.Encryption) }), +}); +var InventoryDestinationFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.S3BucketDestination && { + S3BucketDestination: InventoryS3BucketDestinationFilterSensitiveLog(obj.S3BucketDestination), + }), +}); +var InventoryConfigurationFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.Destination && { Destination: InventoryDestinationFilterSensitiveLog(obj.Destination) }), +}); +var GetBucketInventoryConfigurationOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.InventoryConfiguration && { + InventoryConfiguration: InventoryConfigurationFilterSensitiveLog(obj.InventoryConfiguration), + }), +}); +var GetObjectOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), +}); +var GetObjectRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), +}); +var GetObjectAttributesRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), +}); +var GetObjectTorrentOutputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +var HeadObjectOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }), +}); +var HeadObjectRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), +}); +var ListBucketInventoryConfigurationsOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.InventoryConfigurationList && { + InventoryConfigurationList: obj.InventoryConfigurationList.map((item) => + InventoryConfigurationFilterSensitiveLog(item) + ), + }), +}); +var ListPartsRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }), +}); +var PutBucketEncryptionRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.ServerSideEncryptionConfiguration && { + ServerSideEncryptionConfiguration: ServerSideEncryptionConfigurationFilterSensitiveLog( + obj.ServerSideEncryptionConfiguration + ), + }), +}); +var PutBucketInventoryConfigurationRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.InventoryConfiguration && { + InventoryConfiguration: InventoryConfigurationFilterSensitiveLog(obj.InventoryConfiguration), + }), +}); + +// dist-es/protocols/Aws_restXml.js +import { loadRestXmlErrorCode, parseXmlBody as parseBody, parseXmlErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; +import { requestBuilder as rb } from "@smithy/core"; +import { isValidHostname as __isValidHostname } from "@smithy/protocol-http"; +import { + collectBody, + dateToUtcString as __dateToUtcString, + decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectObject as __expectObject, + expectString as __expectString, + expectUnion as __expectUnion, + getArrayIfSingleItem as __getArrayIfSingleItem, + isSerializableHeaderValue, + map, + parseBoolean as __parseBoolean, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime as __parseRfc7231DateTime, + quoteHeader as __quoteHeader, + serializeDateTime as __serializeDateTime, + strictParseInt32 as __strictParseInt32, + strictParseLong as __strictParseLong, + withBaseException, +} from "@smithy/smithy-client"; + +// dist-es/models/models_1.js +import { SENSITIVE_STRING as SENSITIVE_STRING2 } from "@smithy/smithy-client"; +var MFADelete = { + Disabled: "Disabled", + Enabled: "Enabled", +}; +var ObjectAlreadyInActiveTierError = class _ObjectAlreadyInActiveTierError extends S3ServiceException { + constructor(opts) { + super({ + name: "ObjectAlreadyInActiveTierError", + $fault: "client", + ...opts, + }); + this.name = "ObjectAlreadyInActiveTierError"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ObjectAlreadyInActiveTierError.prototype); + } +}; +var Tier = { + Bulk: "Bulk", + Expedited: "Expedited", + Standard: "Standard", +}; +var ExpressionType = { + SQL: "SQL", +}; +var CompressionType = { + BZIP2: "BZIP2", + GZIP: "GZIP", + NONE: "NONE", +}; +var FileHeaderInfo = { + IGNORE: "IGNORE", + NONE: "NONE", + USE: "USE", +}; +var JSONType = { + DOCUMENT: "DOCUMENT", + LINES: "LINES", +}; +var QuoteFields = { + ALWAYS: "ALWAYS", + ASNEEDED: "ASNEEDED", +}; +var RestoreRequestType = { + SELECT: "SELECT", +}; +var SelectObjectContentEventStream; +(function (SelectObjectContentEventStream2) { + SelectObjectContentEventStream2.visit = (value, visitor) => { + if (value.Records !== void 0) return visitor.Records(value.Records); + if (value.Stats !== void 0) return visitor.Stats(value.Stats); + if (value.Progress !== void 0) return visitor.Progress(value.Progress); + if (value.Cont !== void 0) return visitor.Cont(value.Cont); + if (value.End !== void 0) return visitor.End(value.End); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +})(SelectObjectContentEventStream || (SelectObjectContentEventStream = {})); +var PutObjectOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING2 }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING2 }), +}); +var PutObjectRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING2 }), + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING2 }), + ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING2 }), +}); +var EncryptionFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.KMSKeyId && { KMSKeyId: SENSITIVE_STRING2 }), +}); +var S3LocationFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.Encryption && { Encryption: EncryptionFilterSensitiveLog(obj.Encryption) }), +}); +var OutputLocationFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.S3 && { S3: S3LocationFilterSensitiveLog(obj.S3) }), +}); +var RestoreRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.OutputLocation && { OutputLocation: OutputLocationFilterSensitiveLog(obj.OutputLocation) }), +}); +var RestoreObjectRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.RestoreRequest && { RestoreRequest: RestoreRequestFilterSensitiveLog(obj.RestoreRequest) }), +}); +var SelectObjectContentEventStreamFilterSensitiveLog = (obj) => { + if (obj.Records !== void 0) return { Records: obj.Records }; + if (obj.Stats !== void 0) return { Stats: obj.Stats }; + if (obj.Progress !== void 0) return { Progress: obj.Progress }; + if (obj.Cont !== void 0) return { Cont: obj.Cont }; + if (obj.End !== void 0) return { End: obj.End }; + if (obj.$unknown !== void 0) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; +var SelectObjectContentOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.Payload && { Payload: "STREAMING_CONTENT" }), +}); +var SelectObjectContentRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING2 }), +}); +var UploadPartOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING2 }), +}); +var UploadPartRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING2 }), +}); +var UploadPartCopyOutputFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING2 }), +}); +var UploadPartCopyRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING2 }), + ...(obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING2 }), +}); +var WriteGetObjectResponseRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING2 }), +}); + +// dist-es/protocols/Aws_restXml.js +var se_AbortMultipartUploadCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "AbortMultipartUpload"], + [_uI]: [, __expectNonNull(input[_UI], `UploadId`)], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_CompleteMultipartUploadCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xacc]: input[_CCRC], + [_xacc_]: input[_CCRCC], + [_xacs]: input[_CSHA], + [_xacs_]: input[_CSHAh], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_inm]: input[_INM], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_uI]: [, __expectNonNull(input[_UI], `UploadId`)], + }); + let body; + let contents; + if (input.MultipartUpload !== void 0) { + contents = se_CompletedMultipartUpload(input.MultipartUpload, context); + contents = contents.n("CompleteMultipartUpload"); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("POST").h(headers).q(query).b(body); + return b2.build(); +}; +var se_CopyObjectCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaa]: input[_ACL], + [_cc]: input[_CC], + [_xaca]: input[_CA], + [_cd]: input[_CD], + [_ce]: input[_CE], + [_cl]: input[_CL], + [_ct]: input[_CT], + [_xacs__]: input[_CS], + [_xacsim]: input[_CSIM], + [_xacsims]: [() => isSerializableHeaderValue(input[_CSIMS]), () => __dateToUtcString(input[_CSIMS]).toString()], + [_xacsinm]: input[_CSINM], + [_xacsius]: [() => isSerializableHeaderValue(input[_CSIUS]), () => __dateToUtcString(input[_CSIUS]).toString()], + [_e]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()], + [_xagfc]: input[_GFC], + [_xagr]: input[_GR], + [_xagra]: input[_GRACP], + [_xagwa]: input[_GWACP], + [_xamd]: input[_MD], + [_xatd]: input[_TD], + [_xasse]: input[_SSE], + [_xasc]: input[_SC], + [_xawrl]: input[_WRL], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xasseakki]: input[_SSEKMSKI], + [_xassec]: input[_SSEKMSEC], + [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()], + [_xacssseca]: input[_CSSSECA], + [_xacssseck]: input[_CSSSECK], + [_xacssseckm]: input[_CSSSECKMD], + [_xarp]: input[_RP], + [_xat]: input[_T], + [_xaolm]: input[_OLM], + [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => __serializeDateTime(input[_OLRUD]).toString()], + [_xaollh]: input[_OLLHS], + [_xaebo]: input[_EBO], + [_xasebo]: input[_ESBO], + ...(input.Metadata !== void 0 && + Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {})), + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "CopyObject"], + }); + let body; + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_CreateBucketCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaa]: input[_ACL], + [_xagfc]: input[_GFC], + [_xagr]: input[_GR], + [_xagra]: input[_GRACP], + [_xagw]: input[_GW], + [_xagwa]: input[_GWACP], + [_xabole]: [() => isSerializableHeaderValue(input[_OLEFB]), () => input[_OLEFB].toString()], + [_xaoo]: input[_OO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + let body; + let contents; + if (input.CreateBucketConfiguration !== void 0) { + contents = se_CreateBucketConfiguration(input.CreateBucketConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).b(body); + return b2.build(); +}; +var se_CreateMultipartUploadCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaa]: input[_ACL], + [_cc]: input[_CC], + [_cd]: input[_CD], + [_ce]: input[_CE], + [_cl]: input[_CL], + [_ct]: input[_CT], + [_e]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()], + [_xagfc]: input[_GFC], + [_xagr]: input[_GR], + [_xagra]: input[_GRACP], + [_xagwa]: input[_GWACP], + [_xasse]: input[_SSE], + [_xasc]: input[_SC], + [_xawrl]: input[_WRL], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xasseakki]: input[_SSEKMSKI], + [_xassec]: input[_SSEKMSEC], + [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()], + [_xarp]: input[_RP], + [_xat]: input[_T], + [_xaolm]: input[_OLM], + [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => __serializeDateTime(input[_OLRUD]).toString()], + [_xaollh]: input[_OLLHS], + [_xaebo]: input[_EBO], + [_xaca]: input[_CA], + ...(input.Metadata !== void 0 && + Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {})), + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_u]: [, ""], + }); + let body; + b2.m("POST").h(headers).q(query).b(body); + return b2.build(); +}; +var se_CreateSessionCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xacsm]: input[_SM], + [_xasse]: input[_SSE], + [_xasseakki]: input[_SSEKMSKI], + [_xassec]: input[_SSEKMSEC], + [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_s]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + let body; + b2.m("DELETE").h(headers).b(body); + return b2.build(); +}; +var se_DeleteBucketAnalyticsConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_a]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketCorsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_c]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketEncryptionCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_en]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketIntelligentTieringConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = {}; + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_it]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketInventoryConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_in]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketLifecycleCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_l]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketMetricsConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_m]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketOwnershipControlsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_oC]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketPolicyCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_p]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketReplicationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_r]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketTaggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_t]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteBucketWebsiteCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_w]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteObjectCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xam]: input[_MFA], + [_xarp]: input[_RP], + [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "DeleteObject"], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteObjectsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xam]: input[_MFA], + [_xarp]: input[_RP], + [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()], + [_xaebo]: input[_EBO], + [_xasca]: input[_CA], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_d]: [, ""], + }); + let body; + let contents; + if (input.Delete !== void 0) { + contents = se_Delete(input.Delete, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("POST").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeleteObjectTaggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_t]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_DeletePublicAccessBlockCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_pAB]: [, ""], + }); + let body; + b2.m("DELETE").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketAccelerateConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + [_xarp]: input[_RP], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_ac]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketAclCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_acl]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketAnalyticsConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_a]: [, ""], + [_xi]: [, "GetBucketAnalyticsConfiguration"], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketCorsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_c]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketEncryptionCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_en]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketIntelligentTieringConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = {}; + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_it]: [, ""], + [_xi]: [, "GetBucketIntelligentTieringConfiguration"], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketInventoryConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_in]: [, ""], + [_xi]: [, "GetBucketInventoryConfiguration"], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketLifecycleConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_l]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketLocationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_lo]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketLoggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_log]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketMetricsConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_m]: [, ""], + [_xi]: [, "GetBucketMetricsConfiguration"], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketNotificationConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_n]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketOwnershipControlsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_oC]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketPolicyCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_p]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketPolicyStatusCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_pS]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketReplicationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_r]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketRequestPaymentCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_rP]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketTaggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_t]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketVersioningCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_v]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetBucketWebsiteCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_w]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_im]: input[_IM], + [_ims]: [() => isSerializableHeaderValue(input[_IMS]), () => __dateToUtcString(input[_IMS]).toString()], + [_inm]: input[_INM], + [_ius]: [() => isSerializableHeaderValue(input[_IUS]), () => __dateToUtcString(input[_IUS]).toString()], + [_ra]: input[_R], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xacm]: input[_CM], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "GetObject"], + [_rcc]: [, input[_RCC]], + [_rcd]: [, input[_RCD]], + [_rce]: [, input[_RCE]], + [_rcl]: [, input[_RCL]], + [_rct]: [, input[_RCT]], + [_re]: [() => input.ResponseExpires !== void 0, () => __dateToUtcString(input[_RE]).toString()], + [_vI]: [, input[_VI]], + [_pN]: [() => input.PartNumber !== void 0, () => input[_PN].toString()], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectAclCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_acl]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectAttributesCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xamp]: [() => isSerializableHeaderValue(input[_MP]), () => input[_MP].toString()], + [_xapnm]: input[_PNM], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xaoa]: [() => isSerializableHeaderValue(input[_OA]), () => (input[_OA] || []).map(__quoteHeader).join(", ")], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_at]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectLegalHoldCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_lh]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectLockConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_ol]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectRetentionCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_ret]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectTaggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + [_xarp]: input[_RP], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_t]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetObjectTorrentCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_to]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_GetPublicAccessBlockCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_pAB]: [, ""], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_HeadBucketCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + let body; + b2.m("HEAD").h(headers).b(body); + return b2.build(); +}; +var se_HeadObjectCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_im]: input[_IM], + [_ims]: [() => isSerializableHeaderValue(input[_IMS]), () => __dateToUtcString(input[_IMS]).toString()], + [_inm]: input[_INM], + [_ius]: [() => isSerializableHeaderValue(input[_IUS]), () => __dateToUtcString(input[_IUS]).toString()], + [_ra]: input[_R], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xacm]: input[_CM], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_rcc]: [, input[_RCC]], + [_rcd]: [, input[_RCD]], + [_rce]: [, input[_RCE]], + [_rcl]: [, input[_RCL]], + [_rct]: [, input[_RCT]], + [_re]: [() => input.ResponseExpires !== void 0, () => __dateToUtcString(input[_RE]).toString()], + [_vI]: [, input[_VI]], + [_pN]: [() => input.PartNumber !== void 0, () => input[_PN].toString()], + }); + let body; + b2.m("HEAD").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListBucketAnalyticsConfigurationsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_a]: [, ""], + [_xi]: [, "ListBucketAnalyticsConfigurations"], + [_ct_]: [, input[_CTo]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListBucketIntelligentTieringConfigurationsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = {}; + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_it]: [, ""], + [_xi]: [, "ListBucketIntelligentTieringConfigurations"], + [_ct_]: [, input[_CTo]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListBucketInventoryConfigurationsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_in]: [, ""], + [_xi]: [, "ListBucketInventoryConfigurations"], + [_ct_]: [, input[_CTo]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListBucketMetricsConfigurationsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_m]: [, ""], + [_xi]: [, "ListBucketMetricsConfigurations"], + [_ct_]: [, input[_CTo]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListBucketsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = {}; + b2.bp("/"); + const query = map({ + [_xi]: [, "ListBuckets"], + [_mb]: [() => input.MaxBuckets !== void 0, () => input[_MB].toString()], + [_ct_]: [, input[_CTo]], + [_pr]: [, input[_P]], + [_br]: [, input[_BR]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListDirectoryBucketsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = {}; + b2.bp("/"); + const query = map({ + [_xi]: [, "ListDirectoryBuckets"], + [_ct_]: [, input[_CTo]], + [_mdb]: [() => input.MaxDirectoryBuckets !== void 0, () => input[_MDB].toString()], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListMultipartUploadsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + [_xarp]: input[_RP], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_u]: [, ""], + [_de]: [, input[_D]], + [_et]: [, input[_ET]], + [_km]: [, input[_KM]], + [_mu]: [() => input.MaxUploads !== void 0, () => input[_MU].toString()], + [_pr]: [, input[_P]], + [_uim]: [, input[_UIM]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListObjectsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(__quoteHeader).join(", ")], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_de]: [, input[_D]], + [_et]: [, input[_ET]], + [_ma]: [, input[_M]], + [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()], + [_pr]: [, input[_P]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListObjectsV2Command = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(__quoteHeader).join(", ")], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_lt]: [, "2"], + [_de]: [, input[_D]], + [_et]: [, input[_ET]], + [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()], + [_pr]: [, input[_P]], + [_ct_]: [, input[_CTo]], + [_fo]: [() => input.FetchOwner !== void 0, () => input[_FO].toString()], + [_sa]: [, input[_SA]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListObjectVersionsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xaebo]: input[_EBO], + [_xarp]: input[_RP], + [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(__quoteHeader).join(", ")], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_ver]: [, ""], + [_de]: [, input[_D]], + [_et]: [, input[_ET]], + [_km]: [, input[_KM]], + [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()], + [_pr]: [, input[_P]], + [_vim]: [, input[_VIM]], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_ListPartsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "ListParts"], + [_mp]: [() => input.MaxParts !== void 0, () => input[_MP].toString()], + [_pnm]: [, input[_PNM]], + [_uI]: [, __expectNonNull(input[_UI], `UploadId`)], + }); + let body; + b2.m("GET").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketAccelerateConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaebo]: input[_EBO], + [_xasca]: input[_CA], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_ac]: [, ""], + }); + let body; + let contents; + if (input.AccelerateConfiguration !== void 0) { + contents = se_AccelerateConfiguration(input.AccelerateConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketAclCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaa]: input[_ACL], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xagfc]: input[_GFC], + [_xagr]: input[_GR], + [_xagra]: input[_GRACP], + [_xagw]: input[_GW], + [_xagwa]: input[_GWACP], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_acl]: [, ""], + }); + let body; + let contents; + if (input.AccessControlPolicy !== void 0) { + contents = se_AccessControlPolicy(input.AccessControlPolicy, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketAnalyticsConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_a]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + let contents; + if (input.AnalyticsConfiguration !== void 0) { + contents = se_AnalyticsConfiguration(input.AnalyticsConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketCorsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_c]: [, ""], + }); + let body; + let contents; + if (input.CORSConfiguration !== void 0) { + contents = se_CORSConfiguration(input.CORSConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketEncryptionCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_en]: [, ""], + }); + let body; + let contents; + if (input.ServerSideEncryptionConfiguration !== void 0) { + contents = se_ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketIntelligentTieringConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = { + "content-type": "application/xml", + }; + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_it]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + let contents; + if (input.IntelligentTieringConfiguration !== void 0) { + contents = se_IntelligentTieringConfiguration(input.IntelligentTieringConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketInventoryConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_in]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + let contents; + if (input.InventoryConfiguration !== void 0) { + contents = se_InventoryConfiguration(input.InventoryConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketLifecycleConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + [_xatdmos]: input[_TDMOS], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_l]: [, ""], + }); + let body; + let contents; + if (input.LifecycleConfiguration !== void 0) { + contents = se_BucketLifecycleConfiguration(input.LifecycleConfiguration, context); + contents = contents.n("LifecycleConfiguration"); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketLoggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_log]: [, ""], + }); + let body; + let contents; + if (input.BucketLoggingStatus !== void 0) { + contents = se_BucketLoggingStatus(input.BucketLoggingStatus, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketMetricsConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_m]: [, ""], + [_i]: [, __expectNonNull(input[_I], `Id`)], + }); + let body; + let contents; + if (input.MetricsConfiguration !== void 0) { + contents = se_MetricsConfiguration(input.MetricsConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketNotificationConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaebo]: input[_EBO], + [_xasdv]: [() => isSerializableHeaderValue(input[_SDV]), () => input[_SDV].toString()], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_n]: [, ""], + }); + let body; + let contents; + if (input.NotificationConfiguration !== void 0) { + contents = se_NotificationConfiguration(input.NotificationConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketOwnershipControlsCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_oC]: [, ""], + }); + let body; + let contents; + if (input.OwnershipControls !== void 0) { + contents = se_OwnershipControls(input.OwnershipControls, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketPolicyCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "text/plain", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xacrsba]: [() => isSerializableHeaderValue(input[_CRSBA]), () => input[_CRSBA].toString()], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_p]: [, ""], + }); + let body; + let contents; + if (input.Policy !== void 0) { + contents = input.Policy; + body = contents; + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketReplicationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xabolt]: input[_To], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_r]: [, ""], + }); + let body; + let contents; + if (input.ReplicationConfiguration !== void 0) { + contents = se_ReplicationConfiguration(input.ReplicationConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketRequestPaymentCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_rP]: [, ""], + }); + let body; + let contents; + if (input.RequestPaymentConfiguration !== void 0) { + contents = se_RequestPaymentConfiguration(input.RequestPaymentConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketTaggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_t]: [, ""], + }); + let body; + let contents; + if (input.Tagging !== void 0) { + contents = se_Tagging(input.Tagging, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketVersioningCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xam]: input[_MFA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_v]: [, ""], + }); + let body; + let contents; + if (input.VersioningConfiguration !== void 0) { + contents = se_VersioningConfiguration(input.VersioningConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutBucketWebsiteCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_w]: [, ""], + }); + let body; + let contents; + if (input.WebsiteConfiguration !== void 0) { + contents = se_WebsiteConfiguration(input.WebsiteConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutObjectCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_ct]: input[_CT] || "application/octet-stream", + [_xaa]: input[_ACL], + [_cc]: input[_CC], + [_cd]: input[_CD], + [_ce]: input[_CE], + [_cl]: input[_CL], + [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xacc]: input[_CCRC], + [_xacc_]: input[_CCRCC], + [_xacs]: input[_CSHA], + [_xacs_]: input[_CSHAh], + [_e]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()], + [_inm]: input[_INM], + [_xagfc]: input[_GFC], + [_xagr]: input[_GR], + [_xagra]: input[_GRACP], + [_xagwa]: input[_GWACP], + [_xasse]: input[_SSE], + [_xasc]: input[_SC], + [_xawrl]: input[_WRL], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xasseakki]: input[_SSEKMSKI], + [_xassec]: input[_SSEKMSEC], + [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()], + [_xarp]: input[_RP], + [_xat]: input[_T], + [_xaolm]: input[_OLM], + [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => __serializeDateTime(input[_OLRUD]).toString()], + [_xaollh]: input[_OLLHS], + [_xaebo]: input[_EBO], + ...(input.Metadata !== void 0 && + Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {})), + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "PutObject"], + }); + let body; + let contents; + if (input.Body !== void 0) { + contents = input.Body; + body = contents; + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutObjectAclCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xaa]: input[_ACL], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xagfc]: input[_GFC], + [_xagr]: input[_GR], + [_xagra]: input[_GRACP], + [_xagw]: input[_GW], + [_xagwa]: input[_GWACP], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_acl]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + let contents; + if (input.AccessControlPolicy !== void 0) { + contents = se_AccessControlPolicy(input.AccessControlPolicy, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutObjectLegalHoldCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xarp]: input[_RP], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_lh]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + let contents; + if (input.LegalHold !== void 0) { + contents = se_ObjectLockLegalHold(input.LegalHold, context); + contents = contents.n("LegalHold"); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutObjectLockConfigurationCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xarp]: input[_RP], + [_xabolt]: input[_To], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_ol]: [, ""], + }); + let body; + let contents; + if (input.ObjectLockConfiguration !== void 0) { + contents = se_ObjectLockConfiguration(input.ObjectLockConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutObjectRetentionCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xarp]: input[_RP], + [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_ret]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + let contents; + if (input.Retention !== void 0) { + contents = se_ObjectLockRetention(input.Retention, context); + contents = contents.n("Retention"); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutObjectTaggingCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + [_xarp]: input[_RP], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_t]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + let contents; + if (input.Tagging !== void 0) { + contents = se_Tagging(input.Tagging, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_PutPublicAccessBlockCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + const query = map({ + [_pAB]: [, ""], + }); + let body; + let contents; + if (input.PublicAccessBlockConfiguration !== void 0) { + contents = se_PublicAccessBlockConfiguration(input.PublicAccessBlockConfiguration, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_RestoreObjectCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xarp]: input[_RP], + [_xasca]: input[_CA], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_res]: [, ""], + [_vI]: [, input[_VI]], + }); + let body; + let contents; + if (input.RestoreRequest !== void 0) { + contents = se_RestoreRequest(input.RestoreRequest, context); + body = _ve; + contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + body += contents.toString(); + } + b2.m("POST").h(headers).q(query).b(body); + return b2.build(); +}; +var se_SelectObjectContentCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_se]: [, ""], + [_st]: [, "2"], + }); + let body; + body = _ve; + const bn2 = new __XmlNode(_SOCR); + bn2.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); + bn2.cc(input, _Ex); + bn2.cc(input, _ETx); + if (input[_IS] != null) { + bn2.c(se_InputSerialization(input[_IS], context).n(_IS)); + } + if (input[_OS] != null) { + bn2.c(se_OutputSerialization(input[_OS], context).n(_OS)); + } + if (input[_RPe] != null) { + bn2.c(se_RequestProgress(input[_RPe], context).n(_RPe)); + } + if (input[_SR] != null) { + bn2.c(se_ScanRange(input[_SR], context).n(_SR)); + } + body += bn2.toString(); + b2.m("POST").h(headers).q(query).b(body); + return b2.build(); +}; +var se_UploadPartCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "content-type": "application/octet-stream", + [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()], + [_cm]: input[_CMD], + [_xasca]: input[_CA], + [_xacc]: input[_CCRC], + [_xacc_]: input[_CCRCC], + [_xacs]: input[_CSHA], + [_xacs_]: input[_CSHAh], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "UploadPart"], + [_pN]: [__expectNonNull(input.PartNumber, `PartNumber`) != null, () => input[_PN].toString()], + [_uI]: [, __expectNonNull(input[_UI], `UploadId`)], + }); + let body; + let contents; + if (input.Body !== void 0) { + contents = input.Body; + body = contents; + } + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_UploadPartCopyCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + [_xacs__]: input[_CS], + [_xacsim]: input[_CSIM], + [_xacsims]: [() => isSerializableHeaderValue(input[_CSIMS]), () => __dateToUtcString(input[_CSIMS]).toString()], + [_xacsinm]: input[_CSINM], + [_xacsius]: [() => isSerializableHeaderValue(input[_CSIUS]), () => __dateToUtcString(input[_CSIUS]).toString()], + [_xacsr]: input[_CSR], + [_xasseca]: input[_SSECA], + [_xasseck]: input[_SSECK], + [_xasseckm]: input[_SSECKMD], + [_xacssseca]: input[_CSSSECA], + [_xacssseck]: input[_CSSSECK], + [_xacssseckm]: input[_CSSSECKMD], + [_xarp]: input[_RP], + [_xaebo]: input[_EBO], + [_xasebo]: input[_ESBO], + }); + b2.bp("/{Key+}"); + b2.p("Bucket", () => input.Bucket, "{Bucket}", false); + b2.p("Key", () => input.Key, "{Key+}", true); + const query = map({ + [_xi]: [, "UploadPartCopy"], + [_pN]: [__expectNonNull(input.PartNumber, `PartNumber`) != null, () => input[_PN].toString()], + [_uI]: [, __expectNonNull(input[_UI], `UploadId`)], + }); + let body; + b2.m("PUT").h(headers).q(query).b(body); + return b2.build(); +}; +var se_WriteGetObjectResponseCommand = async (input, context) => { + const b2 = rb(input, context); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-content-sha256": "UNSIGNED-PAYLOAD", + "content-type": "application/octet-stream", + [_xarr]: input[_RR], + [_xart]: input[_RT], + [_xafs]: [() => isSerializableHeaderValue(input[_SCt]), () => input[_SCt].toString()], + [_xafec]: input[_EC], + [_xafem]: input[_EM], + [_xafhar]: input[_AR], + [_xafhcc]: input[_CC], + [_xafhcd]: input[_CD], + [_xafhce]: input[_CE], + [_xafhcl]: input[_CL], + [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()], + [_xafhcr]: input[_CR], + [_xafhct]: input[_CT], + [_xafhxacc]: input[_CCRC], + [_xafhxacc_]: input[_CCRCC], + [_xafhxacs]: input[_CSHA], + [_xafhxacs_]: input[_CSHAh], + [_xafhxadm]: [() => isSerializableHeaderValue(input[_DM]), () => input[_DM].toString()], + [_xafhe]: input[_ETa], + [_xafhe_]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()], + [_xafhxae]: input[_Exp], + [_xafhlm]: [() => isSerializableHeaderValue(input[_LM]), () => __dateToUtcString(input[_LM]).toString()], + [_xafhxamm]: [() => isSerializableHeaderValue(input[_MM]), () => input[_MM].toString()], + [_xafhxaolm]: input[_OLM], + [_xafhxaollh]: input[_OLLHS], + [_xafhxaolrud]: [ + () => isSerializableHeaderValue(input[_OLRUD]), + () => __serializeDateTime(input[_OLRUD]).toString(), + ], + [_xafhxampc]: [() => isSerializableHeaderValue(input[_PC]), () => input[_PC].toString()], + [_xafhxars]: input[_RS], + [_xafhxarc]: input[_RC], + [_xafhxar]: input[_Re], + [_xafhxasse]: input[_SSE], + [_xafhxasseca]: input[_SSECA], + [_xafhxasseakki]: input[_SSEKMSKI], + [_xafhxasseckm]: input[_SSECKMD], + [_xafhxasc]: input[_SC], + [_xafhxatc]: [() => isSerializableHeaderValue(input[_TC]), () => input[_TC].toString()], + [_xafhxavi]: input[_VI], + [_xafhxassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()], + ...(input.Metadata !== void 0 && + Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {})), + }); + b2.bp("/WriteGetObjectResponse"); + let body; + let contents; + if (input.Body !== void 0) { + contents = input.Body; + body = contents; + } + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "{RequestRoute}." + resolvedHostname; + if (input.RequestRoute === void 0) { + throw new Error("Empty value provided for input host prefix: RequestRoute."); + } + resolvedHostname = resolvedHostname.replace("{RequestRoute}", input.RequestRoute); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + b2.hn(resolvedHostname); + b2.m("POST").h(headers).b(body); + return b2.build(); +}; +var de_AbortMultipartUploadCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_CompleteMultipartUploadCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_Exp]: [, output.headers[_xae]], + [_SSE]: [, output.headers[_xasse]], + [_VI]: [, output.headers[_xavi]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_B] != null) { + contents[_B] = __expectString(data[_B]); + } + if (data[_CCRC] != null) { + contents[_CCRC] = __expectString(data[_CCRC]); + } + if (data[_CCRCC] != null) { + contents[_CCRCC] = __expectString(data[_CCRCC]); + } + if (data[_CSHA] != null) { + contents[_CSHA] = __expectString(data[_CSHA]); + } + if (data[_CSHAh] != null) { + contents[_CSHAh] = __expectString(data[_CSHAh]); + } + if (data[_ETa] != null) { + contents[_ETa] = __expectString(data[_ETa]); + } + if (data[_K] != null) { + contents[_K] = __expectString(data[_K]); + } + if (data[_L] != null) { + contents[_L] = __expectString(data[_L]); + } + return contents; +}; +var de_CopyObjectCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_Exp]: [, output.headers[_xae]], + [_CSVI]: [, output.headers[_xacsvi]], + [_VI]: [, output.headers[_xavi]], + [_SSE]: [, output.headers[_xasse]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_SSEKMSEC]: [, output.headers[_xassec]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.CopyObjectResult = de_CopyObjectResult(data, context); + return contents; +}; +var de_CreateBucketCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_CreateMultipartUploadCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_AD]: [ + () => void 0 !== output.headers[_xaad], + () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xaad])), + ], + [_ARI]: [, output.headers[_xaari]], + [_SSE]: [, output.headers[_xasse]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_SSEKMSEC]: [, output.headers[_xassec]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_RC]: [, output.headers[_xarc]], + [_CA]: [, output.headers[_xaca]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_B] != null) { + contents[_B] = __expectString(data[_B]); + } + if (data[_K] != null) { + contents[_K] = __expectString(data[_K]); + } + if (data[_UI] != null) { + contents[_UI] = __expectString(data[_UI]); + } + return contents; +}; +var de_CreateSessionCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_SSE]: [, output.headers[_xasse]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_SSEKMSEC]: [, output.headers[_xassec]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_C] != null) { + contents[_C] = de_SessionCredentials(data[_C], context); + } + return contents; +}; +var de_DeleteBucketCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketAnalyticsConfigurationCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketCorsCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketEncryptionCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketIntelligentTieringConfigurationCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketInventoryConfigurationCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketLifecycleCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketMetricsConfigurationCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketOwnershipControlsCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketPolicyCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketReplicationCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketTaggingCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteBucketWebsiteCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteObjectCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])], + [_VI]: [, output.headers[_xavi]], + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeleteObjectsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Deleted === "") { + contents[_De] = []; + } else if (data[_De] != null) { + contents[_De] = de_DeletedObjects(__getArrayIfSingleItem(data[_De]), context); + } + if (data.Error === "") { + contents[_Err] = []; + } else if (data[_Er] != null) { + contents[_Err] = de_Errors(__getArrayIfSingleItem(data[_Er]), context); + } + return contents; +}; +var de_DeleteObjectTaggingCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_VI]: [, output.headers[_xavi]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_DeletePublicAccessBlockCommand = async (output, context) => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_GetBucketAccelerateConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_S] != null) { + contents[_S] = __expectString(data[_S]); + } + return contents; +}; +var de_GetBucketAclCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.AccessControlList === "") { + contents[_Gr] = []; + } else if (data[_ACLc] != null && data[_ACLc][_G] != null) { + contents[_Gr] = de_Grants(__getArrayIfSingleItem(data[_ACLc][_G]), context); + } + if (data[_O] != null) { + contents[_O] = de_Owner(data[_O], context); + } + return contents; +}; +var de_GetBucketAnalyticsConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.AnalyticsConfiguration = de_AnalyticsConfiguration(data, context); + return contents; +}; +var de_GetBucketCorsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CORSRule === "") { + contents[_CORSRu] = []; + } else if (data[_CORSR] != null) { + contents[_CORSRu] = de_CORSRules(__getArrayIfSingleItem(data[_CORSR]), context); + } + return contents; +}; +var de_GetBucketEncryptionCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.ServerSideEncryptionConfiguration = de_ServerSideEncryptionConfiguration(data, context); + return contents; +}; +var de_GetBucketIntelligentTieringConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.IntelligentTieringConfiguration = de_IntelligentTieringConfiguration(data, context); + return contents; +}; +var de_GetBucketInventoryConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.InventoryConfiguration = de_InventoryConfiguration(data, context); + return contents; +}; +var de_GetBucketLifecycleConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_TDMOS]: [, output.headers[_xatdmos]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Rule === "") { + contents[_Rul] = []; + } else if (data[_Ru] != null) { + contents[_Rul] = de_LifecycleRules(__getArrayIfSingleItem(data[_Ru]), context); + } + return contents; +}; +var de_GetBucketLocationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_LC] != null) { + contents[_LC] = __expectString(data[_LC]); + } + return contents; +}; +var de_GetBucketLoggingCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_LE] != null) { + contents[_LE] = de_LoggingEnabled(data[_LE], context); + } + return contents; +}; +var de_GetBucketMetricsConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.MetricsConfiguration = de_MetricsConfiguration(data, context); + return contents; +}; +var de_GetBucketNotificationConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_EBC] != null) { + contents[_EBC] = de_EventBridgeConfiguration(data[_EBC], context); + } + if (data.CloudFunctionConfiguration === "") { + contents[_LFC] = []; + } else if (data[_CFC] != null) { + contents[_LFC] = de_LambdaFunctionConfigurationList(__getArrayIfSingleItem(data[_CFC]), context); + } + if (data.QueueConfiguration === "") { + contents[_QCu] = []; + } else if (data[_QC] != null) { + contents[_QCu] = de_QueueConfigurationList(__getArrayIfSingleItem(data[_QC]), context); + } + if (data.TopicConfiguration === "") { + contents[_TCop] = []; + } else if (data[_TCo] != null) { + contents[_TCop] = de_TopicConfigurationList(__getArrayIfSingleItem(data[_TCo]), context); + } + return contents; +}; +var de_GetBucketOwnershipControlsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.OwnershipControls = de_OwnershipControls(data, context); + return contents; +}; +var de_GetBucketPolicyCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = await collectBodyString(output.body, context); + contents.Policy = __expectString(data); + return contents; +}; +var de_GetBucketPolicyStatusCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.PolicyStatus = de_PolicyStatus(data, context); + return contents; +}; +var de_GetBucketReplicationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.ReplicationConfiguration = de_ReplicationConfiguration(data, context); + return contents; +}; +var de_GetBucketRequestPaymentCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_Pa] != null) { + contents[_Pa] = __expectString(data[_Pa]); + } + return contents; +}; +var de_GetBucketTaggingCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.TagSet === "") { + contents[_TS] = []; + } else if (data[_TS] != null && data[_TS][_Ta] != null) { + contents[_TS] = de_TagSet(__getArrayIfSingleItem(data[_TS][_Ta]), context); + } + return contents; +}; +var de_GetBucketVersioningCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_MDf] != null) { + contents[_MFAD] = __expectString(data[_MDf]); + } + if (data[_S] != null) { + contents[_S] = __expectString(data[_S]); + } + return contents; +}; +var de_GetBucketWebsiteCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_ED] != null) { + contents[_ED] = de_ErrorDocument(data[_ED], context); + } + if (data[_ID] != null) { + contents[_ID] = de_IndexDocument(data[_ID], context); + } + if (data[_RART] != null) { + contents[_RART] = de_RedirectAllRequestsTo(data[_RART], context); + } + if (data.RoutingRules === "") { + contents[_RRo] = []; + } else if (data[_RRo] != null && data[_RRo][_RRou] != null) { + contents[_RRo] = de_RoutingRules(__getArrayIfSingleItem(data[_RRo][_RRou]), context); + } + return contents; +}; +var de_GetObjectCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])], + [_AR]: [, output.headers[_ar]], + [_Exp]: [, output.headers[_xae]], + [_Re]: [, output.headers[_xar]], + [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))], + [_CLo]: [() => void 0 !== output.headers[_cl_], () => __strictParseLong(output.headers[_cl_])], + [_ETa]: [, output.headers[_eta]], + [_CCRC]: [, output.headers[_xacc]], + [_CCRCC]: [, output.headers[_xacc_]], + [_CSHA]: [, output.headers[_xacs]], + [_CSHAh]: [, output.headers[_xacs_]], + [_MM]: [() => void 0 !== output.headers[_xamm], () => __strictParseInt32(output.headers[_xamm])], + [_VI]: [, output.headers[_xavi]], + [_CC]: [, output.headers[_cc]], + [_CD]: [, output.headers[_cd]], + [_CE]: [, output.headers[_ce]], + [_CL]: [, output.headers[_cl]], + [_CR]: [, output.headers[_cr]], + [_CT]: [, output.headers[_ct]], + [_E]: [() => void 0 !== output.headers[_e], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_e]))], + [_ES]: [, output.headers[_ex]], + [_WRL]: [, output.headers[_xawrl]], + [_SSE]: [, output.headers[_xasse]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_SC]: [, output.headers[_xasc]], + [_RC]: [, output.headers[_xarc]], + [_RS]: [, output.headers[_xars]], + [_PC]: [() => void 0 !== output.headers[_xampc], () => __strictParseInt32(output.headers[_xampc])], + [_TC]: [() => void 0 !== output.headers[_xatc], () => __strictParseInt32(output.headers[_xatc])], + [_OLM]: [, output.headers[_xaolm]], + [_OLRUD]: [ + () => void 0 !== output.headers[_xaolrud], + () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xaolrud])), + ], + [_OLLHS]: [, output.headers[_xaollh]], + Metadata: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("x-amz-meta-")) + .reduce((acc, header) => { + acc[header.substring(11)] = output.headers[header]; + return acc; + }, {}), + ], + }); + const data = output.body; + context.sdkStreamMixin(data); + contents.Body = data; + return contents; +}; +var de_GetObjectAclCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.AccessControlList === "") { + contents[_Gr] = []; + } else if (data[_ACLc] != null && data[_ACLc][_G] != null) { + contents[_Gr] = de_Grants(__getArrayIfSingleItem(data[_ACLc][_G]), context); + } + if (data[_O] != null) { + contents[_O] = de_Owner(data[_O], context); + } + return contents; +}; +var de_GetObjectAttributesCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])], + [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))], + [_VI]: [, output.headers[_xavi]], + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_Ch] != null) { + contents[_Ch] = de_Checksum(data[_Ch], context); + } + if (data[_ETa] != null) { + contents[_ETa] = __expectString(data[_ETa]); + } + if (data[_OP] != null) { + contents[_OP] = de_GetObjectAttributesParts(data[_OP], context); + } + if (data[_OSb] != null) { + contents[_OSb] = __strictParseLong(data[_OSb]); + } + if (data[_SC] != null) { + contents[_SC] = __expectString(data[_SC]); + } + return contents; +}; +var de_GetObjectLegalHoldCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.LegalHold = de_ObjectLockLegalHold(data, context); + return contents; +}; +var de_GetObjectLockConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.ObjectLockConfiguration = de_ObjectLockConfiguration(data, context); + return contents; +}; +var de_GetObjectRetentionCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.Retention = de_ObjectLockRetention(data, context); + return contents; +}; +var de_GetObjectTaggingCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_VI]: [, output.headers[_xavi]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.TagSet === "") { + contents[_TS] = []; + } else if (data[_TS] != null && data[_TS][_Ta] != null) { + contents[_TS] = de_TagSet(__getArrayIfSingleItem(data[_TS][_Ta]), context); + } + return contents; +}; +var de_GetObjectTorrentCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = output.body; + context.sdkStreamMixin(data); + contents.Body = data; + return contents; +}; +var de_GetPublicAccessBlockCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.PublicAccessBlockConfiguration = de_PublicAccessBlockConfiguration(data, context); + return contents; +}; +var de_HeadBucketCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_BLT]: [, output.headers[_xablt]], + [_BLN]: [, output.headers[_xabln]], + [_BR]: [, output.headers[_xabr]], + [_APA]: [() => void 0 !== output.headers[_xaapa], () => __parseBoolean(output.headers[_xaapa])], + }); + await collectBody(output.body, context); + return contents; +}; +var de_HeadObjectCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])], + [_AR]: [, output.headers[_ar]], + [_Exp]: [, output.headers[_xae]], + [_Re]: [, output.headers[_xar]], + [_AS]: [, output.headers[_xaas]], + [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))], + [_CLo]: [() => void 0 !== output.headers[_cl_], () => __strictParseLong(output.headers[_cl_])], + [_CCRC]: [, output.headers[_xacc]], + [_CCRCC]: [, output.headers[_xacc_]], + [_CSHA]: [, output.headers[_xacs]], + [_CSHAh]: [, output.headers[_xacs_]], + [_ETa]: [, output.headers[_eta]], + [_MM]: [() => void 0 !== output.headers[_xamm], () => __strictParseInt32(output.headers[_xamm])], + [_VI]: [, output.headers[_xavi]], + [_CC]: [, output.headers[_cc]], + [_CD]: [, output.headers[_cd]], + [_CE]: [, output.headers[_ce]], + [_CL]: [, output.headers[_cl]], + [_CT]: [, output.headers[_ct]], + [_E]: [() => void 0 !== output.headers[_e], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_e]))], + [_ES]: [, output.headers[_ex]], + [_WRL]: [, output.headers[_xawrl]], + [_SSE]: [, output.headers[_xasse]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_SC]: [, output.headers[_xasc]], + [_RC]: [, output.headers[_xarc]], + [_RS]: [, output.headers[_xars]], + [_PC]: [() => void 0 !== output.headers[_xampc], () => __strictParseInt32(output.headers[_xampc])], + [_OLM]: [, output.headers[_xaolm]], + [_OLRUD]: [ + () => void 0 !== output.headers[_xaolrud], + () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xaolrud])), + ], + [_OLLHS]: [, output.headers[_xaollh]], + Metadata: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("x-amz-meta-")) + .reduce((acc, header) => { + acc[header.substring(11)] = output.headers[header]; + return acc; + }, {}), + ], + }); + await collectBody(output.body, context); + return contents; +}; +var de_ListBucketAnalyticsConfigurationsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.AnalyticsConfiguration === "") { + contents[_ACLn] = []; + } else if (data[_AC] != null) { + contents[_ACLn] = de_AnalyticsConfigurationList(__getArrayIfSingleItem(data[_AC]), context); + } + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_NCT] != null) { + contents[_NCT] = __expectString(data[_NCT]); + } + return contents; +}; +var de_ListBucketIntelligentTieringConfigurationsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + if (data.IntelligentTieringConfiguration === "") { + contents[_ITCL] = []; + } else if (data[_ITC] != null) { + contents[_ITCL] = de_IntelligentTieringConfigurationList(__getArrayIfSingleItem(data[_ITC]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_NCT] != null) { + contents[_NCT] = __expectString(data[_NCT]); + } + return contents; +}; +var de_ListBucketInventoryConfigurationsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + if (data.InventoryConfiguration === "") { + contents[_ICL] = []; + } else if (data[_IC] != null) { + contents[_ICL] = de_InventoryConfigurationList(__getArrayIfSingleItem(data[_IC]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_NCT] != null) { + contents[_NCT] = __expectString(data[_NCT]); + } + return contents; +}; +var de_ListBucketMetricsConfigurationsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data.MetricsConfiguration === "") { + contents[_MCL] = []; + } else if (data[_MC] != null) { + contents[_MCL] = de_MetricsConfigurationList(__getArrayIfSingleItem(data[_MC]), context); + } + if (data[_NCT] != null) { + contents[_NCT] = __expectString(data[_NCT]); + } + return contents; +}; +var de_ListBucketsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Buckets === "") { + contents[_Bu] = []; + } else if (data[_Bu] != null && data[_Bu][_B] != null) { + contents[_Bu] = de_Buckets(__getArrayIfSingleItem(data[_Bu][_B]), context); + } + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + if (data[_O] != null) { + contents[_O] = de_Owner(data[_O], context); + } + if (data[_P] != null) { + contents[_P] = __expectString(data[_P]); + } + return contents; +}; +var de_ListDirectoryBucketsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Buckets === "") { + contents[_Bu] = []; + } else if (data[_Bu] != null && data[_Bu][_B] != null) { + contents[_Bu] = de_Buckets(__getArrayIfSingleItem(data[_Bu][_B]), context); + } + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + return contents; +}; +var de_ListMultipartUploadsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_B] != null) { + contents[_B] = __expectString(data[_B]); + } + if (data.CommonPrefixes === "") { + contents[_CP] = []; + } else if (data[_CP] != null) { + contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context); + } + if (data[_D] != null) { + contents[_D] = __expectString(data[_D]); + } + if (data[_ET] != null) { + contents[_ET] = __expectString(data[_ET]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_KM] != null) { + contents[_KM] = __expectString(data[_KM]); + } + if (data[_MU] != null) { + contents[_MU] = __strictParseInt32(data[_MU]); + } + if (data[_NKM] != null) { + contents[_NKM] = __expectString(data[_NKM]); + } + if (data[_NUIM] != null) { + contents[_NUIM] = __expectString(data[_NUIM]); + } + if (data[_P] != null) { + contents[_P] = __expectString(data[_P]); + } + if (data[_UIM] != null) { + contents[_UIM] = __expectString(data[_UIM]); + } + if (data.Upload === "") { + contents[_Up] = []; + } else if (data[_U] != null) { + contents[_Up] = de_MultipartUploadList(__getArrayIfSingleItem(data[_U]), context); + } + return contents; +}; +var de_ListObjectsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CommonPrefixes === "") { + contents[_CP] = []; + } else if (data[_CP] != null) { + contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context); + } + if (data.Contents === "") { + contents[_Co] = []; + } else if (data[_Co] != null) { + contents[_Co] = de_ObjectList(__getArrayIfSingleItem(data[_Co]), context); + } + if (data[_D] != null) { + contents[_D] = __expectString(data[_D]); + } + if (data[_ET] != null) { + contents[_ET] = __expectString(data[_ET]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_M] != null) { + contents[_M] = __expectString(data[_M]); + } + if (data[_MK] != null) { + contents[_MK] = __strictParseInt32(data[_MK]); + } + if (data[_N] != null) { + contents[_N] = __expectString(data[_N]); + } + if (data[_NM] != null) { + contents[_NM] = __expectString(data[_NM]); + } + if (data[_P] != null) { + contents[_P] = __expectString(data[_P]); + } + return contents; +}; +var de_ListObjectsV2Command = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CommonPrefixes === "") { + contents[_CP] = []; + } else if (data[_CP] != null) { + contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context); + } + if (data.Contents === "") { + contents[_Co] = []; + } else if (data[_Co] != null) { + contents[_Co] = de_ObjectList(__getArrayIfSingleItem(data[_Co]), context); + } + if (data[_CTo] != null) { + contents[_CTo] = __expectString(data[_CTo]); + } + if (data[_D] != null) { + contents[_D] = __expectString(data[_D]); + } + if (data[_ET] != null) { + contents[_ET] = __expectString(data[_ET]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_KC] != null) { + contents[_KC] = __strictParseInt32(data[_KC]); + } + if (data[_MK] != null) { + contents[_MK] = __strictParseInt32(data[_MK]); + } + if (data[_N] != null) { + contents[_N] = __expectString(data[_N]); + } + if (data[_NCT] != null) { + contents[_NCT] = __expectString(data[_NCT]); + } + if (data[_P] != null) { + contents[_P] = __expectString(data[_P]); + } + if (data[_SA] != null) { + contents[_SA] = __expectString(data[_SA]); + } + return contents; +}; +var de_ListObjectVersionsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CommonPrefixes === "") { + contents[_CP] = []; + } else if (data[_CP] != null) { + contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context); + } + if (data.DeleteMarker === "") { + contents[_DMe] = []; + } else if (data[_DM] != null) { + contents[_DMe] = de_DeleteMarkers(__getArrayIfSingleItem(data[_DM]), context); + } + if (data[_D] != null) { + contents[_D] = __expectString(data[_D]); + } + if (data[_ET] != null) { + contents[_ET] = __expectString(data[_ET]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_KM] != null) { + contents[_KM] = __expectString(data[_KM]); + } + if (data[_MK] != null) { + contents[_MK] = __strictParseInt32(data[_MK]); + } + if (data[_N] != null) { + contents[_N] = __expectString(data[_N]); + } + if (data[_NKM] != null) { + contents[_NKM] = __expectString(data[_NKM]); + } + if (data[_NVIM] != null) { + contents[_NVIM] = __expectString(data[_NVIM]); + } + if (data[_P] != null) { + contents[_P] = __expectString(data[_P]); + } + if (data[_VIM] != null) { + contents[_VIM] = __expectString(data[_VIM]); + } + if (data.Version === "") { + contents[_Ve] = []; + } else if (data[_V] != null) { + contents[_Ve] = de_ObjectVersionList(__getArrayIfSingleItem(data[_V]), context); + } + return contents; +}; +var de_ListPartsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_AD]: [ + () => void 0 !== output.headers[_xaad], + () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xaad])), + ], + [_ARI]: [, output.headers[_xaari]], + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_B] != null) { + contents[_B] = __expectString(data[_B]); + } + if (data[_CA] != null) { + contents[_CA] = __expectString(data[_CA]); + } + if (data[_In] != null) { + contents[_In] = de_Initiator(data[_In], context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_K] != null) { + contents[_K] = __expectString(data[_K]); + } + if (data[_MP] != null) { + contents[_MP] = __strictParseInt32(data[_MP]); + } + if (data[_NPNM] != null) { + contents[_NPNM] = __expectString(data[_NPNM]); + } + if (data[_O] != null) { + contents[_O] = de_Owner(data[_O], context); + } + if (data[_PNM] != null) { + contents[_PNM] = __expectString(data[_PNM]); + } + if (data.Part === "") { + contents[_Part] = []; + } else if (data[_Par] != null) { + contents[_Part] = de_Parts(__getArrayIfSingleItem(data[_Par]), context); + } + if (data[_SC] != null) { + contents[_SC] = __expectString(data[_SC]); + } + if (data[_UI] != null) { + contents[_UI] = __expectString(data[_UI]); + } + return contents; +}; +var de_PutBucketAccelerateConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketAclCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketAnalyticsConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketCorsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketEncryptionCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketIntelligentTieringConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketInventoryConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketLifecycleConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_TDMOS]: [, output.headers[_xatdmos]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketLoggingCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketMetricsConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketNotificationConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketOwnershipControlsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketPolicyCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketReplicationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketRequestPaymentCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketTaggingCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketVersioningCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutBucketWebsiteCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutObjectCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_Exp]: [, output.headers[_xae]], + [_ETa]: [, output.headers[_eta]], + [_CCRC]: [, output.headers[_xacc]], + [_CCRCC]: [, output.headers[_xacc_]], + [_CSHA]: [, output.headers[_xacs]], + [_CSHAh]: [, output.headers[_xacs_]], + [_SSE]: [, output.headers[_xasse]], + [_VI]: [, output.headers[_xavi]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_SSEKMSEC]: [, output.headers[_xassec]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutObjectAclCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutObjectLegalHoldCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutObjectLockConfigurationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutObjectRetentionCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutObjectTaggingCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_VI]: [, output.headers[_xavi]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_PutPublicAccessBlockCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_RestoreObjectCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_RC]: [, output.headers[_xarc]], + [_ROP]: [, output.headers[_xarop]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_SelectObjectContentCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = output.body; + contents.Payload = de_SelectObjectContentEventStream(data, context); + return contents; +}; +var de_UploadPartCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_SSE]: [, output.headers[_xasse]], + [_ETa]: [, output.headers[_eta]], + [_CCRC]: [, output.headers[_xacc]], + [_CCRCC]: [, output.headers[_xacc_]], + [_CSHA]: [, output.headers[_xacs]], + [_CSHAh]: [, output.headers[_xacs_]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_RC]: [, output.headers[_xarc]], + }); + await collectBody(output.body, context); + return contents; +}; +var de_UploadPartCopyCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + [_CSVI]: [, output.headers[_xacsvi]], + [_SSE]: [, output.headers[_xasse]], + [_SSECA]: [, output.headers[_xasseca]], + [_SSECKMD]: [, output.headers[_xasseckm]], + [_SSEKMSKI]: [, output.headers[_xasseakki]], + [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])], + [_RC]: [, output.headers[_xarc]], + }); + const data = __expectObject(await parseBody(output.body, context)); + contents.CopyPartResult = de_CopyPartResult(data, context); + return contents; +}; +var de_WriteGetObjectResponseCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +var de_CommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "NoSuchUpload": + case "com.amazonaws.s3#NoSuchUpload": + throw await de_NoSuchUploadRes(parsedOutput, context); + case "ObjectNotInActiveTierError": + case "com.amazonaws.s3#ObjectNotInActiveTierError": + throw await de_ObjectNotInActiveTierErrorRes(parsedOutput, context); + case "BucketAlreadyExists": + case "com.amazonaws.s3#BucketAlreadyExists": + throw await de_BucketAlreadyExistsRes(parsedOutput, context); + case "BucketAlreadyOwnedByYou": + case "com.amazonaws.s3#BucketAlreadyOwnedByYou": + throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context); + case "NoSuchBucket": + case "com.amazonaws.s3#NoSuchBucket": + throw await de_NoSuchBucketRes(parsedOutput, context); + case "InvalidObjectState": + case "com.amazonaws.s3#InvalidObjectState": + throw await de_InvalidObjectStateRes(parsedOutput, context); + case "NoSuchKey": + case "com.amazonaws.s3#NoSuchKey": + throw await de_NoSuchKeyRes(parsedOutput, context); + case "NotFound": + case "com.amazonaws.s3#NotFound": + throw await de_NotFoundRes(parsedOutput, context); + case "ObjectAlreadyInActiveTierError": + case "com.amazonaws.s3#ObjectAlreadyInActiveTierError": + throw await de_ObjectAlreadyInActiveTierErrorRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; +var throwDefaultError = withBaseException(S3ServiceException); +var de_BucketAlreadyExistsRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new BucketAlreadyExists({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_BucketAlreadyOwnedByYouRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new BucketAlreadyOwnedByYou({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_InvalidObjectStateRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data[_AT] != null) { + contents[_AT] = __expectString(data[_AT]); + } + if (data[_SC] != null) { + contents[_SC] = __expectString(data[_SC]); + } + const exception = new InvalidObjectState({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_NoSuchBucketRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new NoSuchBucket({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_NoSuchKeyRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new NoSuchKey({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_NoSuchUploadRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new NoSuchUpload({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_NotFoundRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new NotFound({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_ObjectAlreadyInActiveTierErrorRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new ObjectAlreadyInActiveTierError({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_ObjectNotInActiveTierErrorRes = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + const exception = new ObjectNotInActiveTierError({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +var de_SelectObjectContentEventStream = (output, context) => { + return context.eventStreamMarshaller.deserialize(output, async (event) => { + if (event["Records"] != null) { + return { + Records: await de_RecordsEvent_event(event["Records"], context), + }; + } + if (event["Stats"] != null) { + return { + Stats: await de_StatsEvent_event(event["Stats"], context), + }; + } + if (event["Progress"] != null) { + return { + Progress: await de_ProgressEvent_event(event["Progress"], context), + }; + } + if (event["Cont"] != null) { + return { + Cont: await de_ContinuationEvent_event(event["Cont"], context), + }; + } + if (event["End"] != null) { + return { + End: await de_EndEvent_event(event["End"], context), + }; + } + return { $unknown: output }; + }); +}; +var de_ContinuationEvent_event = async (output, context) => { + const contents = {}; + const data = await parseBody(output.body, context); + Object.assign(contents, de_ContinuationEvent(data, context)); + return contents; +}; +var de_EndEvent_event = async (output, context) => { + const contents = {}; + const data = await parseBody(output.body, context); + Object.assign(contents, de_EndEvent(data, context)); + return contents; +}; +var de_ProgressEvent_event = async (output, context) => { + const contents = {}; + const data = await parseBody(output.body, context); + contents.Details = de_Progress(data, context); + return contents; +}; +var de_RecordsEvent_event = async (output, context) => { + const contents = {}; + contents.Payload = output.body; + return contents; +}; +var de_StatsEvent_event = async (output, context) => { + const contents = {}; + const data = await parseBody(output.body, context); + contents.Details = de_Stats(data, context); + return contents; +}; +var se_AbortIncompleteMultipartUpload = (input, context) => { + const bn2 = new __XmlNode(_AIMU); + if (input[_DAI] != null) { + bn2.c(__XmlNode.of(_DAI, String(input[_DAI])).n(_DAI)); + } + return bn2; +}; +var se_AccelerateConfiguration = (input, context) => { + const bn2 = new __XmlNode(_ACc); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_BAS, input[_S]).n(_S)); + } + return bn2; +}; +var se_AccessControlPolicy = (input, context) => { + const bn2 = new __XmlNode(_ACP); + bn2.lc(input, "Grants", "AccessControlList", () => se_Grants(input[_Gr], context)); + if (input[_O] != null) { + bn2.c(se_Owner(input[_O], context).n(_O)); + } + return bn2; +}; +var se_AccessControlTranslation = (input, context) => { + const bn2 = new __XmlNode(_ACT); + if (input[_O] != null) { + bn2.c(__XmlNode.of(_OOw, input[_O]).n(_O)); + } + return bn2; +}; +var se_AllowedHeaders = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = __XmlNode.of(_AH, entry); + return n2.n(_me); + }); +}; +var se_AllowedMethods = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = __XmlNode.of(_AM, entry); + return n2.n(_me); + }); +}; +var se_AllowedOrigins = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = __XmlNode.of(_AO, entry); + return n2.n(_me); + }); +}; +var se_AnalyticsAndOperator = (input, context) => { + const bn2 = new __XmlNode(_AAO); + bn2.cc(input, _P); + bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context)); + return bn2; +}; +var se_AnalyticsConfiguration = (input, context) => { + const bn2 = new __XmlNode(_AC); + if (input[_I] != null) { + bn2.c(__XmlNode.of(_AI, input[_I]).n(_I)); + } + if (input[_F] != null) { + bn2.c(se_AnalyticsFilter(input[_F], context).n(_F)); + } + if (input[_SCA] != null) { + bn2.c(se_StorageClassAnalysis(input[_SCA], context).n(_SCA)); + } + return bn2; +}; +var se_AnalyticsExportDestination = (input, context) => { + const bn2 = new __XmlNode(_AED); + if (input[_SBD] != null) { + bn2.c(se_AnalyticsS3BucketDestination(input[_SBD], context).n(_SBD)); + } + return bn2; +}; +var se_AnalyticsFilter = (input, context) => { + const bn2 = new __XmlNode(_AF); + AnalyticsFilter.visit(input, { + Prefix: (value) => { + if (input[_P] != null) { + bn2.c(__XmlNode.of(_P, value).n(_P)); + } + }, + Tag: (value) => { + if (input[_Ta] != null) { + bn2.c(se_Tag(value, context).n(_Ta)); + } + }, + And: (value) => { + if (input[_A] != null) { + bn2.c(se_AnalyticsAndOperator(value, context).n(_A)); + } + }, + _: (name, value) => { + if (!(value instanceof __XmlNode || value instanceof __XmlText)) { + throw new Error("Unable to serialize unknown union members in XML."); + } + bn2.c(new __XmlNode(name).c(value)); + }, + }); + return bn2; +}; +var se_AnalyticsS3BucketDestination = (input, context) => { + const bn2 = new __XmlNode(_ASBD); + if (input[_Fo] != null) { + bn2.c(__XmlNode.of(_ASEFF, input[_Fo]).n(_Fo)); + } + if (input[_BAI] != null) { + bn2.c(__XmlNode.of(_AIc, input[_BAI]).n(_BAI)); + } + if (input[_B] != null) { + bn2.c(__XmlNode.of(_BN, input[_B]).n(_B)); + } + bn2.cc(input, _P); + return bn2; +}; +var se_BucketInfo = (input, context) => { + const bn2 = new __XmlNode(_BI); + bn2.cc(input, _DR); + if (input[_Ty] != null) { + bn2.c(__XmlNode.of(_BT, input[_Ty]).n(_Ty)); + } + return bn2; +}; +var se_BucketLifecycleConfiguration = (input, context) => { + const bn2 = new __XmlNode(_BLC); + bn2.l(input, "Rules", "Rule", () => se_LifecycleRules(input[_Rul], context)); + return bn2; +}; +var se_BucketLoggingStatus = (input, context) => { + const bn2 = new __XmlNode(_BLS); + if (input[_LE] != null) { + bn2.c(se_LoggingEnabled(input[_LE], context).n(_LE)); + } + return bn2; +}; +var se_CompletedMultipartUpload = (input, context) => { + const bn2 = new __XmlNode(_CMU); + bn2.l(input, "Parts", "Part", () => se_CompletedPartList(input[_Part], context)); + return bn2; +}; +var se_CompletedPart = (input, context) => { + const bn2 = new __XmlNode(_CPo); + bn2.cc(input, _ETa); + bn2.cc(input, _CCRC); + bn2.cc(input, _CCRCC); + bn2.cc(input, _CSHA); + bn2.cc(input, _CSHAh); + if (input[_PN] != null) { + bn2.c(__XmlNode.of(_PN, String(input[_PN])).n(_PN)); + } + return bn2; +}; +var se_CompletedPartList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_CompletedPart(entry, context); + return n2.n(_me); + }); +}; +var se_Condition = (input, context) => { + const bn2 = new __XmlNode(_Con); + bn2.cc(input, _HECRE); + bn2.cc(input, _KPE); + return bn2; +}; +var se_CORSConfiguration = (input, context) => { + const bn2 = new __XmlNode(_CORSC); + bn2.l(input, "CORSRules", "CORSRule", () => se_CORSRules(input[_CORSRu], context)); + return bn2; +}; +var se_CORSRule = (input, context) => { + const bn2 = new __XmlNode(_CORSR); + bn2.cc(input, _ID_); + bn2.l(input, "AllowedHeaders", "AllowedHeader", () => se_AllowedHeaders(input[_AHl], context)); + bn2.l(input, "AllowedMethods", "AllowedMethod", () => se_AllowedMethods(input[_AMl], context)); + bn2.l(input, "AllowedOrigins", "AllowedOrigin", () => se_AllowedOrigins(input[_AOl], context)); + bn2.l(input, "ExposeHeaders", "ExposeHeader", () => se_ExposeHeaders(input[_EH], context)); + if (input[_MAS] != null) { + bn2.c(__XmlNode.of(_MAS, String(input[_MAS])).n(_MAS)); + } + return bn2; +}; +var se_CORSRules = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_CORSRule(entry, context); + return n2.n(_me); + }); +}; +var se_CreateBucketConfiguration = (input, context) => { + const bn2 = new __XmlNode(_CBC); + if (input[_LC] != null) { + bn2.c(__XmlNode.of(_BLCu, input[_LC]).n(_LC)); + } + if (input[_L] != null) { + bn2.c(se_LocationInfo(input[_L], context).n(_L)); + } + if (input[_B] != null) { + bn2.c(se_BucketInfo(input[_B], context).n(_B)); + } + return bn2; +}; +var se_CSVInput = (input, context) => { + const bn2 = new __XmlNode(_CSVIn); + bn2.cc(input, _FHI); + bn2.cc(input, _Com); + bn2.cc(input, _QEC); + bn2.cc(input, _RD); + bn2.cc(input, _FD); + bn2.cc(input, _QCuo); + if (input[_AQRD] != null) { + bn2.c(__XmlNode.of(_AQRD, String(input[_AQRD])).n(_AQRD)); + } + return bn2; +}; +var se_CSVOutput = (input, context) => { + const bn2 = new __XmlNode(_CSVO); + bn2.cc(input, _QF); + bn2.cc(input, _QEC); + bn2.cc(input, _RD); + bn2.cc(input, _FD); + bn2.cc(input, _QCuo); + return bn2; +}; +var se_DefaultRetention = (input, context) => { + const bn2 = new __XmlNode(_DRe); + if (input[_Mo] != null) { + bn2.c(__XmlNode.of(_OLRM, input[_Mo]).n(_Mo)); + } + if (input[_Da] != null) { + bn2.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da)); + } + if (input[_Y] != null) { + bn2.c(__XmlNode.of(_Y, String(input[_Y])).n(_Y)); + } + return bn2; +}; +var se_Delete = (input, context) => { + const bn2 = new __XmlNode(_Del); + bn2.l(input, "Objects", "Object", () => se_ObjectIdentifierList(input[_Ob], context)); + if (input[_Q] != null) { + bn2.c(__XmlNode.of(_Q, String(input[_Q])).n(_Q)); + } + return bn2; +}; +var se_DeleteMarkerReplication = (input, context) => { + const bn2 = new __XmlNode(_DMR); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_DMRS, input[_S]).n(_S)); + } + return bn2; +}; +var se_Destination = (input, context) => { + const bn2 = new __XmlNode(_Des); + if (input[_B] != null) { + bn2.c(__XmlNode.of(_BN, input[_B]).n(_B)); + } + if (input[_Ac] != null) { + bn2.c(__XmlNode.of(_AIc, input[_Ac]).n(_Ac)); + } + bn2.cc(input, _SC); + if (input[_ACT] != null) { + bn2.c(se_AccessControlTranslation(input[_ACT], context).n(_ACT)); + } + if (input[_ECn] != null) { + bn2.c(se_EncryptionConfiguration(input[_ECn], context).n(_ECn)); + } + if (input[_RTe] != null) { + bn2.c(se_ReplicationTime(input[_RTe], context).n(_RTe)); + } + if (input[_Me] != null) { + bn2.c(se_Metrics(input[_Me], context).n(_Me)); + } + return bn2; +}; +var se_Encryption = (input, context) => { + const bn2 = new __XmlNode(_En); + if (input[_ETn] != null) { + bn2.c(__XmlNode.of(_SSE, input[_ETn]).n(_ETn)); + } + if (input[_KMSKI] != null) { + bn2.c(__XmlNode.of(_SSEKMSKI, input[_KMSKI]).n(_KMSKI)); + } + bn2.cc(input, _KMSC); + return bn2; +}; +var se_EncryptionConfiguration = (input, context) => { + const bn2 = new __XmlNode(_ECn); + bn2.cc(input, _RKKID); + return bn2; +}; +var se_ErrorDocument = (input, context) => { + const bn2 = new __XmlNode(_ED); + if (input[_K] != null) { + bn2.c(__XmlNode.of(_OK, input[_K]).n(_K)); + } + return bn2; +}; +var se_EventBridgeConfiguration = (input, context) => { + const bn2 = new __XmlNode(_EBC); + return bn2; +}; +var se_EventList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = __XmlNode.of(_Ev, entry); + return n2.n(_me); + }); +}; +var se_ExistingObjectReplication = (input, context) => { + const bn2 = new __XmlNode(_EOR); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_EORS, input[_S]).n(_S)); + } + return bn2; +}; +var se_ExposeHeaders = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = __XmlNode.of(_EHx, entry); + return n2.n(_me); + }); +}; +var se_FilterRule = (input, context) => { + const bn2 = new __XmlNode(_FR); + if (input[_N] != null) { + bn2.c(__XmlNode.of(_FRN, input[_N]).n(_N)); + } + if (input[_Va] != null) { + bn2.c(__XmlNode.of(_FRV, input[_Va]).n(_Va)); + } + return bn2; +}; +var se_FilterRuleList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_FilterRule(entry, context); + return n2.n(_me); + }); +}; +var se_GlacierJobParameters = (input, context) => { + const bn2 = new __XmlNode(_GJP); + bn2.cc(input, _Ti); + return bn2; +}; +var se_Grant = (input, context) => { + const bn2 = new __XmlNode(_G); + if (input[_Gra] != null) { + const n2 = se_Grantee(input[_Gra], context).n(_Gra); + n2.a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + bn2.c(n2); + } + bn2.cc(input, _Pe); + return bn2; +}; +var se_Grantee = (input, context) => { + const bn2 = new __XmlNode(_Gra); + bn2.cc(input, _DN); + bn2.cc(input, _EA); + bn2.cc(input, _ID_); + bn2.cc(input, _URI); + bn2.a("xsi:type", input[_Ty]); + return bn2; +}; +var se_Grants = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_Grant(entry, context); + return n2.n(_G); + }); +}; +var se_IndexDocument = (input, context) => { + const bn2 = new __XmlNode(_ID); + bn2.cc(input, _Su); + return bn2; +}; +var se_InputSerialization = (input, context) => { + const bn2 = new __XmlNode(_IS); + if (input[_CSV] != null) { + bn2.c(se_CSVInput(input[_CSV], context).n(_CSV)); + } + bn2.cc(input, _CTom); + if (input[_JSON] != null) { + bn2.c(se_JSONInput(input[_JSON], context).n(_JSON)); + } + if (input[_Parq] != null) { + bn2.c(se_ParquetInput(input[_Parq], context).n(_Parq)); + } + return bn2; +}; +var se_IntelligentTieringAndOperator = (input, context) => { + const bn2 = new __XmlNode(_ITAO); + bn2.cc(input, _P); + bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context)); + return bn2; +}; +var se_IntelligentTieringConfiguration = (input, context) => { + const bn2 = new __XmlNode(_ITC); + if (input[_I] != null) { + bn2.c(__XmlNode.of(_ITI, input[_I]).n(_I)); + } + if (input[_F] != null) { + bn2.c(se_IntelligentTieringFilter(input[_F], context).n(_F)); + } + if (input[_S] != null) { + bn2.c(__XmlNode.of(_ITS, input[_S]).n(_S)); + } + bn2.l(input, "Tierings", "Tiering", () => se_TieringList(input[_Tie], context)); + return bn2; +}; +var se_IntelligentTieringFilter = (input, context) => { + const bn2 = new __XmlNode(_ITF); + bn2.cc(input, _P); + if (input[_Ta] != null) { + bn2.c(se_Tag(input[_Ta], context).n(_Ta)); + } + if (input[_A] != null) { + bn2.c(se_IntelligentTieringAndOperator(input[_A], context).n(_A)); + } + return bn2; +}; +var se_InventoryConfiguration = (input, context) => { + const bn2 = new __XmlNode(_IC); + if (input[_Des] != null) { + bn2.c(se_InventoryDestination(input[_Des], context).n(_Des)); + } + if (input[_IE] != null) { + bn2.c(__XmlNode.of(_IE, String(input[_IE])).n(_IE)); + } + if (input[_F] != null) { + bn2.c(se_InventoryFilter(input[_F], context).n(_F)); + } + if (input[_I] != null) { + bn2.c(__XmlNode.of(_II, input[_I]).n(_I)); + } + if (input[_IOV] != null) { + bn2.c(__XmlNode.of(_IIOV, input[_IOV]).n(_IOV)); + } + bn2.lc(input, "OptionalFields", "OptionalFields", () => se_InventoryOptionalFields(input[_OF], context)); + if (input[_Sc] != null) { + bn2.c(se_InventorySchedule(input[_Sc], context).n(_Sc)); + } + return bn2; +}; +var se_InventoryDestination = (input, context) => { + const bn2 = new __XmlNode(_IDn); + if (input[_SBD] != null) { + bn2.c(se_InventoryS3BucketDestination(input[_SBD], context).n(_SBD)); + } + return bn2; +}; +var se_InventoryEncryption = (input, context) => { + const bn2 = new __XmlNode(_IEn); + if (input[_SSES] != null) { + bn2.c(se_SSES3(input[_SSES], context).n(_SS)); + } + if (input[_SSEKMS] != null) { + bn2.c(se_SSEKMS(input[_SSEKMS], context).n(_SK)); + } + return bn2; +}; +var se_InventoryFilter = (input, context) => { + const bn2 = new __XmlNode(_IF); + bn2.cc(input, _P); + return bn2; +}; +var se_InventoryOptionalFields = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = __XmlNode.of(_IOF, entry); + return n2.n(_Fi); + }); +}; +var se_InventoryS3BucketDestination = (input, context) => { + const bn2 = new __XmlNode(_ISBD); + bn2.cc(input, _AIc); + if (input[_B] != null) { + bn2.c(__XmlNode.of(_BN, input[_B]).n(_B)); + } + if (input[_Fo] != null) { + bn2.c(__XmlNode.of(_IFn, input[_Fo]).n(_Fo)); + } + bn2.cc(input, _P); + if (input[_En] != null) { + bn2.c(se_InventoryEncryption(input[_En], context).n(_En)); + } + return bn2; +}; +var se_InventorySchedule = (input, context) => { + const bn2 = new __XmlNode(_ISn); + if (input[_Fr] != null) { + bn2.c(__XmlNode.of(_IFnv, input[_Fr]).n(_Fr)); + } + return bn2; +}; +var se_JSONInput = (input, context) => { + const bn2 = new __XmlNode(_JSONI); + if (input[_Ty] != null) { + bn2.c(__XmlNode.of(_JSONT, input[_Ty]).n(_Ty)); + } + return bn2; +}; +var se_JSONOutput = (input, context) => { + const bn2 = new __XmlNode(_JSONO); + bn2.cc(input, _RD); + return bn2; +}; +var se_LambdaFunctionConfiguration = (input, context) => { + const bn2 = new __XmlNode(_LFCa); + if (input[_I] != null) { + bn2.c(__XmlNode.of(_NI, input[_I]).n(_I)); + } + if (input[_LFA] != null) { + bn2.c(__XmlNode.of(_LFA, input[_LFA]).n(_CF)); + } + bn2.l(input, "Events", "Event", () => se_EventList(input[_Eve], context)); + if (input[_F] != null) { + bn2.c(se_NotificationConfigurationFilter(input[_F], context).n(_F)); + } + return bn2; +}; +var se_LambdaFunctionConfigurationList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_LambdaFunctionConfiguration(entry, context); + return n2.n(_me); + }); +}; +var se_LifecycleExpiration = (input, context) => { + const bn2 = new __XmlNode(_LEi); + if (input[_Dat] != null) { + bn2.c(__XmlNode.of(_Dat, __serializeDateTime(input[_Dat]).toString()).n(_Dat)); + } + if (input[_Da] != null) { + bn2.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da)); + } + if (input[_EODM] != null) { + bn2.c(__XmlNode.of(_EODM, String(input[_EODM])).n(_EODM)); + } + return bn2; +}; +var se_LifecycleRule = (input, context) => { + const bn2 = new __XmlNode(_LR); + if (input[_Exp] != null) { + bn2.c(se_LifecycleExpiration(input[_Exp], context).n(_Exp)); + } + bn2.cc(input, _ID_); + bn2.cc(input, _P); + if (input[_F] != null) { + bn2.c(se_LifecycleRuleFilter(input[_F], context).n(_F)); + } + if (input[_S] != null) { + bn2.c(__XmlNode.of(_ESx, input[_S]).n(_S)); + } + bn2.l(input, "Transitions", "Transition", () => se_TransitionList(input[_Tr], context)); + bn2.l(input, "NoncurrentVersionTransitions", "NoncurrentVersionTransition", () => + se_NoncurrentVersionTransitionList(input[_NVT], context) + ); + if (input[_NVE] != null) { + bn2.c(se_NoncurrentVersionExpiration(input[_NVE], context).n(_NVE)); + } + if (input[_AIMU] != null) { + bn2.c(se_AbortIncompleteMultipartUpload(input[_AIMU], context).n(_AIMU)); + } + return bn2; +}; +var se_LifecycleRuleAndOperator = (input, context) => { + const bn2 = new __XmlNode(_LRAO); + bn2.cc(input, _P); + bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context)); + if (input[_OSGT] != null) { + bn2.c(__XmlNode.of(_OSGTB, String(input[_OSGT])).n(_OSGT)); + } + if (input[_OSLT] != null) { + bn2.c(__XmlNode.of(_OSLTB, String(input[_OSLT])).n(_OSLT)); + } + return bn2; +}; +var se_LifecycleRuleFilter = (input, context) => { + const bn2 = new __XmlNode(_LRF); + bn2.cc(input, _P); + if (input[_Ta] != null) { + bn2.c(se_Tag(input[_Ta], context).n(_Ta)); + } + if (input[_OSGT] != null) { + bn2.c(__XmlNode.of(_OSGTB, String(input[_OSGT])).n(_OSGT)); + } + if (input[_OSLT] != null) { + bn2.c(__XmlNode.of(_OSLTB, String(input[_OSLT])).n(_OSLT)); + } + if (input[_A] != null) { + bn2.c(se_LifecycleRuleAndOperator(input[_A], context).n(_A)); + } + return bn2; +}; +var se_LifecycleRules = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_LifecycleRule(entry, context); + return n2.n(_me); + }); +}; +var se_LocationInfo = (input, context) => { + const bn2 = new __XmlNode(_LI); + if (input[_Ty] != null) { + bn2.c(__XmlNode.of(_LT, input[_Ty]).n(_Ty)); + } + if (input[_N] != null) { + bn2.c(__XmlNode.of(_LNAS, input[_N]).n(_N)); + } + return bn2; +}; +var se_LoggingEnabled = (input, context) => { + const bn2 = new __XmlNode(_LE); + bn2.cc(input, _TB); + bn2.lc(input, "TargetGrants", "TargetGrants", () => se_TargetGrants(input[_TG], context)); + bn2.cc(input, _TP); + if (input[_TOKF] != null) { + bn2.c(se_TargetObjectKeyFormat(input[_TOKF], context).n(_TOKF)); + } + return bn2; +}; +var se_MetadataEntry = (input, context) => { + const bn2 = new __XmlNode(_ME); + if (input[_N] != null) { + bn2.c(__XmlNode.of(_MKe, input[_N]).n(_N)); + } + if (input[_Va] != null) { + bn2.c(__XmlNode.of(_MV, input[_Va]).n(_Va)); + } + return bn2; +}; +var se_Metrics = (input, context) => { + const bn2 = new __XmlNode(_Me); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_MS, input[_S]).n(_S)); + } + if (input[_ETv] != null) { + bn2.c(se_ReplicationTimeValue(input[_ETv], context).n(_ETv)); + } + return bn2; +}; +var se_MetricsAndOperator = (input, context) => { + const bn2 = new __XmlNode(_MAO); + bn2.cc(input, _P); + bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context)); + bn2.cc(input, _APAc); + return bn2; +}; +var se_MetricsConfiguration = (input, context) => { + const bn2 = new __XmlNode(_MC); + if (input[_I] != null) { + bn2.c(__XmlNode.of(_MI, input[_I]).n(_I)); + } + if (input[_F] != null) { + bn2.c(se_MetricsFilter(input[_F], context).n(_F)); + } + return bn2; +}; +var se_MetricsFilter = (input, context) => { + const bn2 = new __XmlNode(_MF); + MetricsFilter.visit(input, { + Prefix: (value) => { + if (input[_P] != null) { + bn2.c(__XmlNode.of(_P, value).n(_P)); + } + }, + Tag: (value) => { + if (input[_Ta] != null) { + bn2.c(se_Tag(value, context).n(_Ta)); + } + }, + AccessPointArn: (value) => { + if (input[_APAc] != null) { + bn2.c(__XmlNode.of(_APAc, value).n(_APAc)); + } + }, + And: (value) => { + if (input[_A] != null) { + bn2.c(se_MetricsAndOperator(value, context).n(_A)); + } + }, + _: (name, value) => { + if (!(value instanceof __XmlNode || value instanceof __XmlText)) { + throw new Error("Unable to serialize unknown union members in XML."); + } + bn2.c(new __XmlNode(name).c(value)); + }, + }); + return bn2; +}; +var se_NoncurrentVersionExpiration = (input, context) => { + const bn2 = new __XmlNode(_NVE); + if (input[_ND] != null) { + bn2.c(__XmlNode.of(_Da, String(input[_ND])).n(_ND)); + } + if (input[_NNV] != null) { + bn2.c(__XmlNode.of(_VC, String(input[_NNV])).n(_NNV)); + } + return bn2; +}; +var se_NoncurrentVersionTransition = (input, context) => { + const bn2 = new __XmlNode(_NVTo); + if (input[_ND] != null) { + bn2.c(__XmlNode.of(_Da, String(input[_ND])).n(_ND)); + } + if (input[_SC] != null) { + bn2.c(__XmlNode.of(_TSC, input[_SC]).n(_SC)); + } + if (input[_NNV] != null) { + bn2.c(__XmlNode.of(_VC, String(input[_NNV])).n(_NNV)); + } + return bn2; +}; +var se_NoncurrentVersionTransitionList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_NoncurrentVersionTransition(entry, context); + return n2.n(_me); + }); +}; +var se_NotificationConfiguration = (input, context) => { + const bn2 = new __XmlNode(_NC); + bn2.l(input, "TopicConfigurations", "TopicConfiguration", () => se_TopicConfigurationList(input[_TCop], context)); + bn2.l(input, "QueueConfigurations", "QueueConfiguration", () => se_QueueConfigurationList(input[_QCu], context)); + bn2.l(input, "LambdaFunctionConfigurations", "CloudFunctionConfiguration", () => + se_LambdaFunctionConfigurationList(input[_LFC], context) + ); + if (input[_EBC] != null) { + bn2.c(se_EventBridgeConfiguration(input[_EBC], context).n(_EBC)); + } + return bn2; +}; +var se_NotificationConfigurationFilter = (input, context) => { + const bn2 = new __XmlNode(_NCF); + if (input[_K] != null) { + bn2.c(se_S3KeyFilter(input[_K], context).n(_SKe)); + } + return bn2; +}; +var se_ObjectIdentifier = (input, context) => { + const bn2 = new __XmlNode(_OI); + if (input[_K] != null) { + bn2.c(__XmlNode.of(_OK, input[_K]).n(_K)); + } + if (input[_VI] != null) { + bn2.c(__XmlNode.of(_OVI, input[_VI]).n(_VI)); + } + return bn2; +}; +var se_ObjectIdentifierList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_ObjectIdentifier(entry, context); + return n2.n(_me); + }); +}; +var se_ObjectLockConfiguration = (input, context) => { + const bn2 = new __XmlNode(_OLC); + bn2.cc(input, _OLE); + if (input[_Ru] != null) { + bn2.c(se_ObjectLockRule(input[_Ru], context).n(_Ru)); + } + return bn2; +}; +var se_ObjectLockLegalHold = (input, context) => { + const bn2 = new __XmlNode(_OLLH); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_OLLHS, input[_S]).n(_S)); + } + return bn2; +}; +var se_ObjectLockRetention = (input, context) => { + const bn2 = new __XmlNode(_OLR); + if (input[_Mo] != null) { + bn2.c(__XmlNode.of(_OLRM, input[_Mo]).n(_Mo)); + } + if (input[_RUD] != null) { + bn2.c(__XmlNode.of(_Dat, __serializeDateTime(input[_RUD]).toString()).n(_RUD)); + } + return bn2; +}; +var se_ObjectLockRule = (input, context) => { + const bn2 = new __XmlNode(_OLRb); + if (input[_DRe] != null) { + bn2.c(se_DefaultRetention(input[_DRe], context).n(_DRe)); + } + return bn2; +}; +var se_OutputLocation = (input, context) => { + const bn2 = new __XmlNode(_OL); + if (input[_S_] != null) { + bn2.c(se_S3Location(input[_S_], context).n(_S_)); + } + return bn2; +}; +var se_OutputSerialization = (input, context) => { + const bn2 = new __XmlNode(_OS); + if (input[_CSV] != null) { + bn2.c(se_CSVOutput(input[_CSV], context).n(_CSV)); + } + if (input[_JSON] != null) { + bn2.c(se_JSONOutput(input[_JSON], context).n(_JSON)); + } + return bn2; +}; +var se_Owner = (input, context) => { + const bn2 = new __XmlNode(_O); + bn2.cc(input, _DN); + bn2.cc(input, _ID_); + return bn2; +}; +var se_OwnershipControls = (input, context) => { + const bn2 = new __XmlNode(_OC); + bn2.l(input, "Rules", "Rule", () => se_OwnershipControlsRules(input[_Rul], context)); + return bn2; +}; +var se_OwnershipControlsRule = (input, context) => { + const bn2 = new __XmlNode(_OCR); + bn2.cc(input, _OO); + return bn2; +}; +var se_OwnershipControlsRules = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_OwnershipControlsRule(entry, context); + return n2.n(_me); + }); +}; +var se_ParquetInput = (input, context) => { + const bn2 = new __XmlNode(_PI); + return bn2; +}; +var se_PartitionedPrefix = (input, context) => { + const bn2 = new __XmlNode(_PP); + bn2.cc(input, _PDS); + return bn2; +}; +var se_PublicAccessBlockConfiguration = (input, context) => { + const bn2 = new __XmlNode(_PABC); + if (input[_BPA] != null) { + bn2.c(__XmlNode.of(_Se, String(input[_BPA])).n(_BPA)); + } + if (input[_IPA] != null) { + bn2.c(__XmlNode.of(_Se, String(input[_IPA])).n(_IPA)); + } + if (input[_BPP] != null) { + bn2.c(__XmlNode.of(_Se, String(input[_BPP])).n(_BPP)); + } + if (input[_RPB] != null) { + bn2.c(__XmlNode.of(_Se, String(input[_RPB])).n(_RPB)); + } + return bn2; +}; +var se_QueueConfiguration = (input, context) => { + const bn2 = new __XmlNode(_QC); + if (input[_I] != null) { + bn2.c(__XmlNode.of(_NI, input[_I]).n(_I)); + } + if (input[_QA] != null) { + bn2.c(__XmlNode.of(_QA, input[_QA]).n(_Qu)); + } + bn2.l(input, "Events", "Event", () => se_EventList(input[_Eve], context)); + if (input[_F] != null) { + bn2.c(se_NotificationConfigurationFilter(input[_F], context).n(_F)); + } + return bn2; +}; +var se_QueueConfigurationList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_QueueConfiguration(entry, context); + return n2.n(_me); + }); +}; +var se_Redirect = (input, context) => { + const bn2 = new __XmlNode(_Red); + bn2.cc(input, _HN); + bn2.cc(input, _HRC); + bn2.cc(input, _Pr); + bn2.cc(input, _RKPW); + bn2.cc(input, _RKW); + return bn2; +}; +var se_RedirectAllRequestsTo = (input, context) => { + const bn2 = new __XmlNode(_RART); + bn2.cc(input, _HN); + bn2.cc(input, _Pr); + return bn2; +}; +var se_ReplicaModifications = (input, context) => { + const bn2 = new __XmlNode(_RM); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_RMS, input[_S]).n(_S)); + } + return bn2; +}; +var se_ReplicationConfiguration = (input, context) => { + const bn2 = new __XmlNode(_RCe); + bn2.cc(input, _Ro); + bn2.l(input, "Rules", "Rule", () => se_ReplicationRules(input[_Rul], context)); + return bn2; +}; +var se_ReplicationRule = (input, context) => { + const bn2 = new __XmlNode(_RRe); + bn2.cc(input, _ID_); + if (input[_Pri] != null) { + bn2.c(__XmlNode.of(_Pri, String(input[_Pri])).n(_Pri)); + } + bn2.cc(input, _P); + if (input[_F] != null) { + bn2.c(se_ReplicationRuleFilter(input[_F], context).n(_F)); + } + if (input[_S] != null) { + bn2.c(__XmlNode.of(_RRS, input[_S]).n(_S)); + } + if (input[_SSC] != null) { + bn2.c(se_SourceSelectionCriteria(input[_SSC], context).n(_SSC)); + } + if (input[_EOR] != null) { + bn2.c(se_ExistingObjectReplication(input[_EOR], context).n(_EOR)); + } + if (input[_Des] != null) { + bn2.c(se_Destination(input[_Des], context).n(_Des)); + } + if (input[_DMR] != null) { + bn2.c(se_DeleteMarkerReplication(input[_DMR], context).n(_DMR)); + } + return bn2; +}; +var se_ReplicationRuleAndOperator = (input, context) => { + const bn2 = new __XmlNode(_RRAO); + bn2.cc(input, _P); + bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context)); + return bn2; +}; +var se_ReplicationRuleFilter = (input, context) => { + const bn2 = new __XmlNode(_RRF); + bn2.cc(input, _P); + if (input[_Ta] != null) { + bn2.c(se_Tag(input[_Ta], context).n(_Ta)); + } + if (input[_A] != null) { + bn2.c(se_ReplicationRuleAndOperator(input[_A], context).n(_A)); + } + return bn2; +}; +var se_ReplicationRules = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_ReplicationRule(entry, context); + return n2.n(_me); + }); +}; +var se_ReplicationTime = (input, context) => { + const bn2 = new __XmlNode(_RTe); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_RTS, input[_S]).n(_S)); + } + if (input[_Tim] != null) { + bn2.c(se_ReplicationTimeValue(input[_Tim], context).n(_Tim)); + } + return bn2; +}; +var se_ReplicationTimeValue = (input, context) => { + const bn2 = new __XmlNode(_RTV); + if (input[_Mi] != null) { + bn2.c(__XmlNode.of(_Mi, String(input[_Mi])).n(_Mi)); + } + return bn2; +}; +var se_RequestPaymentConfiguration = (input, context) => { + const bn2 = new __XmlNode(_RPC); + bn2.cc(input, _Pa); + return bn2; +}; +var se_RequestProgress = (input, context) => { + const bn2 = new __XmlNode(_RPe); + if (input[_Ena] != null) { + bn2.c(__XmlNode.of(_ERP, String(input[_Ena])).n(_Ena)); + } + return bn2; +}; +var se_RestoreRequest = (input, context) => { + const bn2 = new __XmlNode(_RRes); + if (input[_Da] != null) { + bn2.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da)); + } + if (input[_GJP] != null) { + bn2.c(se_GlacierJobParameters(input[_GJP], context).n(_GJP)); + } + if (input[_Ty] != null) { + bn2.c(__XmlNode.of(_RRT, input[_Ty]).n(_Ty)); + } + bn2.cc(input, _Ti); + bn2.cc(input, _Desc); + if (input[_SP] != null) { + bn2.c(se_SelectParameters(input[_SP], context).n(_SP)); + } + if (input[_OL] != null) { + bn2.c(se_OutputLocation(input[_OL], context).n(_OL)); + } + return bn2; +}; +var se_RoutingRule = (input, context) => { + const bn2 = new __XmlNode(_RRou); + if (input[_Con] != null) { + bn2.c(se_Condition(input[_Con], context).n(_Con)); + } + if (input[_Red] != null) { + bn2.c(se_Redirect(input[_Red], context).n(_Red)); + } + return bn2; +}; +var se_RoutingRules = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_RoutingRule(entry, context); + return n2.n(_RRou); + }); +}; +var se_S3KeyFilter = (input, context) => { + const bn2 = new __XmlNode(_SKF); + bn2.l(input, "FilterRules", "FilterRule", () => se_FilterRuleList(input[_FRi], context)); + return bn2; +}; +var se_S3Location = (input, context) => { + const bn2 = new __XmlNode(_SL); + bn2.cc(input, _BN); + if (input[_P] != null) { + bn2.c(__XmlNode.of(_LP, input[_P]).n(_P)); + } + if (input[_En] != null) { + bn2.c(se_Encryption(input[_En], context).n(_En)); + } + if (input[_CACL] != null) { + bn2.c(__XmlNode.of(_OCACL, input[_CACL]).n(_CACL)); + } + bn2.lc(input, "AccessControlList", "AccessControlList", () => se_Grants(input[_ACLc], context)); + if (input[_T] != null) { + bn2.c(se_Tagging(input[_T], context).n(_T)); + } + bn2.lc(input, "UserMetadata", "UserMetadata", () => se_UserMetadata(input[_UM], context)); + bn2.cc(input, _SC); + return bn2; +}; +var se_ScanRange = (input, context) => { + const bn2 = new __XmlNode(_SR); + if (input[_St] != null) { + bn2.c(__XmlNode.of(_St, String(input[_St])).n(_St)); + } + if (input[_End] != null) { + bn2.c(__XmlNode.of(_End, String(input[_End])).n(_End)); + } + return bn2; +}; +var se_SelectParameters = (input, context) => { + const bn2 = new __XmlNode(_SP); + if (input[_IS] != null) { + bn2.c(se_InputSerialization(input[_IS], context).n(_IS)); + } + bn2.cc(input, _ETx); + bn2.cc(input, _Ex); + if (input[_OS] != null) { + bn2.c(se_OutputSerialization(input[_OS], context).n(_OS)); + } + return bn2; +}; +var se_ServerSideEncryptionByDefault = (input, context) => { + const bn2 = new __XmlNode(_SSEBD); + if (input[_SSEA] != null) { + bn2.c(__XmlNode.of(_SSE, input[_SSEA]).n(_SSEA)); + } + if (input[_KMSMKID] != null) { + bn2.c(__XmlNode.of(_SSEKMSKI, input[_KMSMKID]).n(_KMSMKID)); + } + return bn2; +}; +var se_ServerSideEncryptionConfiguration = (input, context) => { + const bn2 = new __XmlNode(_SSEC); + bn2.l(input, "Rules", "Rule", () => se_ServerSideEncryptionRules(input[_Rul], context)); + return bn2; +}; +var se_ServerSideEncryptionRule = (input, context) => { + const bn2 = new __XmlNode(_SSER); + if (input[_ASSEBD] != null) { + bn2.c(se_ServerSideEncryptionByDefault(input[_ASSEBD], context).n(_ASSEBD)); + } + if (input[_BKE] != null) { + bn2.c(__XmlNode.of(_BKE, String(input[_BKE])).n(_BKE)); + } + return bn2; +}; +var se_ServerSideEncryptionRules = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_ServerSideEncryptionRule(entry, context); + return n2.n(_me); + }); +}; +var se_SimplePrefix = (input, context) => { + const bn2 = new __XmlNode(_SPi); + return bn2; +}; +var se_SourceSelectionCriteria = (input, context) => { + const bn2 = new __XmlNode(_SSC); + if (input[_SKEO] != null) { + bn2.c(se_SseKmsEncryptedObjects(input[_SKEO], context).n(_SKEO)); + } + if (input[_RM] != null) { + bn2.c(se_ReplicaModifications(input[_RM], context).n(_RM)); + } + return bn2; +}; +var se_SSEKMS = (input, context) => { + const bn2 = new __XmlNode(_SK); + if (input[_KI] != null) { + bn2.c(__XmlNode.of(_SSEKMSKI, input[_KI]).n(_KI)); + } + return bn2; +}; +var se_SseKmsEncryptedObjects = (input, context) => { + const bn2 = new __XmlNode(_SKEO); + if (input[_S] != null) { + bn2.c(__XmlNode.of(_SKEOS, input[_S]).n(_S)); + } + return bn2; +}; +var se_SSES3 = (input, context) => { + const bn2 = new __XmlNode(_SS); + return bn2; +}; +var se_StorageClassAnalysis = (input, context) => { + const bn2 = new __XmlNode(_SCA); + if (input[_DE] != null) { + bn2.c(se_StorageClassAnalysisDataExport(input[_DE], context).n(_DE)); + } + return bn2; +}; +var se_StorageClassAnalysisDataExport = (input, context) => { + const bn2 = new __XmlNode(_SCADE); + if (input[_OSV] != null) { + bn2.c(__XmlNode.of(_SCASV, input[_OSV]).n(_OSV)); + } + if (input[_Des] != null) { + bn2.c(se_AnalyticsExportDestination(input[_Des], context).n(_Des)); + } + return bn2; +}; +var se_Tag = (input, context) => { + const bn2 = new __XmlNode(_Ta); + if (input[_K] != null) { + bn2.c(__XmlNode.of(_OK, input[_K]).n(_K)); + } + bn2.cc(input, _Va); + return bn2; +}; +var se_Tagging = (input, context) => { + const bn2 = new __XmlNode(_T); + bn2.lc(input, "TagSet", "TagSet", () => se_TagSet(input[_TS], context)); + return bn2; +}; +var se_TagSet = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_Tag(entry, context); + return n2.n(_Ta); + }); +}; +var se_TargetGrant = (input, context) => { + const bn2 = new __XmlNode(_TGa); + if (input[_Gra] != null) { + const n2 = se_Grantee(input[_Gra], context).n(_Gra); + n2.a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + bn2.c(n2); + } + if (input[_Pe] != null) { + bn2.c(__XmlNode.of(_BLP, input[_Pe]).n(_Pe)); + } + return bn2; +}; +var se_TargetGrants = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_TargetGrant(entry, context); + return n2.n(_G); + }); +}; +var se_TargetObjectKeyFormat = (input, context) => { + const bn2 = new __XmlNode(_TOKF); + if (input[_SPi] != null) { + bn2.c(se_SimplePrefix(input[_SPi], context).n(_SPi)); + } + if (input[_PP] != null) { + bn2.c(se_PartitionedPrefix(input[_PP], context).n(_PP)); + } + return bn2; +}; +var se_Tiering = (input, context) => { + const bn2 = new __XmlNode(_Tier); + if (input[_Da] != null) { + bn2.c(__XmlNode.of(_ITD, String(input[_Da])).n(_Da)); + } + if (input[_AT] != null) { + bn2.c(__XmlNode.of(_ITAT, input[_AT]).n(_AT)); + } + return bn2; +}; +var se_TieringList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_Tiering(entry, context); + return n2.n(_me); + }); +}; +var se_TopicConfiguration = (input, context) => { + const bn2 = new __XmlNode(_TCo); + if (input[_I] != null) { + bn2.c(__XmlNode.of(_NI, input[_I]).n(_I)); + } + if (input[_TA] != null) { + bn2.c(__XmlNode.of(_TA, input[_TA]).n(_Top)); + } + bn2.l(input, "Events", "Event", () => se_EventList(input[_Eve], context)); + if (input[_F] != null) { + bn2.c(se_NotificationConfigurationFilter(input[_F], context).n(_F)); + } + return bn2; +}; +var se_TopicConfigurationList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_TopicConfiguration(entry, context); + return n2.n(_me); + }); +}; +var se_Transition = (input, context) => { + const bn2 = new __XmlNode(_Tra); + if (input[_Dat] != null) { + bn2.c(__XmlNode.of(_Dat, __serializeDateTime(input[_Dat]).toString()).n(_Dat)); + } + if (input[_Da] != null) { + bn2.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da)); + } + if (input[_SC] != null) { + bn2.c(__XmlNode.of(_TSC, input[_SC]).n(_SC)); + } + return bn2; +}; +var se_TransitionList = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_Transition(entry, context); + return n2.n(_me); + }); +}; +var se_UserMetadata = (input, context) => { + return input + .filter((e2) => e2 != null) + .map((entry) => { + const n2 = se_MetadataEntry(entry, context); + return n2.n(_ME); + }); +}; +var se_VersioningConfiguration = (input, context) => { + const bn2 = new __XmlNode(_VCe); + if (input[_MFAD] != null) { + bn2.c(__XmlNode.of(_MFAD, input[_MFAD]).n(_MDf)); + } + if (input[_S] != null) { + bn2.c(__XmlNode.of(_BVS, input[_S]).n(_S)); + } + return bn2; +}; +var se_WebsiteConfiguration = (input, context) => { + const bn2 = new __XmlNode(_WC); + if (input[_ED] != null) { + bn2.c(se_ErrorDocument(input[_ED], context).n(_ED)); + } + if (input[_ID] != null) { + bn2.c(se_IndexDocument(input[_ID], context).n(_ID)); + } + if (input[_RART] != null) { + bn2.c(se_RedirectAllRequestsTo(input[_RART], context).n(_RART)); + } + bn2.lc(input, "RoutingRules", "RoutingRules", () => se_RoutingRules(input[_RRo], context)); + return bn2; +}; +var de_AbortIncompleteMultipartUpload = (output, context) => { + const contents = {}; + if (output[_DAI] != null) { + contents[_DAI] = __strictParseInt32(output[_DAI]); + } + return contents; +}; +var de_AccessControlTranslation = (output, context) => { + const contents = {}; + if (output[_O] != null) { + contents[_O] = __expectString(output[_O]); + } + return contents; +}; +var de_AllowedHeaders = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_AllowedMethods = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_AllowedOrigins = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_AnalyticsAndOperator = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output.Tag === "") { + contents[_Tag] = []; + } else if (output[_Ta] != null) { + contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context); + } + return contents; +}; +var de_AnalyticsConfiguration = (output, context) => { + const contents = {}; + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output.Filter === "") { + } else if (output[_F] != null) { + contents[_F] = de_AnalyticsFilter(__expectUnion(output[_F]), context); + } + if (output[_SCA] != null) { + contents[_SCA] = de_StorageClassAnalysis(output[_SCA], context); + } + return contents; +}; +var de_AnalyticsConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_AnalyticsConfiguration(entry, context); + }); +}; +var de_AnalyticsExportDestination = (output, context) => { + const contents = {}; + if (output[_SBD] != null) { + contents[_SBD] = de_AnalyticsS3BucketDestination(output[_SBD], context); + } + return contents; +}; +var de_AnalyticsFilter = (output, context) => { + if (output[_P] != null) { + return { + Prefix: __expectString(output[_P]), + }; + } + if (output[_Ta] != null) { + return { + Tag: de_Tag(output[_Ta], context), + }; + } + if (output[_A] != null) { + return { + And: de_AnalyticsAndOperator(output[_A], context), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; +var de_AnalyticsS3BucketDestination = (output, context) => { + const contents = {}; + if (output[_Fo] != null) { + contents[_Fo] = __expectString(output[_Fo]); + } + if (output[_BAI] != null) { + contents[_BAI] = __expectString(output[_BAI]); + } + if (output[_B] != null) { + contents[_B] = __expectString(output[_B]); + } + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + return contents; +}; +var de_Bucket = (output, context) => { + const contents = {}; + if (output[_N] != null) { + contents[_N] = __expectString(output[_N]); + } + if (output[_CDr] != null) { + contents[_CDr] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_CDr])); + } + if (output[_BR] != null) { + contents[_BR] = __expectString(output[_BR]); + } + return contents; +}; +var de_Buckets = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_Bucket(entry, context); + }); +}; +var de_Checksum = (output, context) => { + const contents = {}; + if (output[_CCRC] != null) { + contents[_CCRC] = __expectString(output[_CCRC]); + } + if (output[_CCRCC] != null) { + contents[_CCRCC] = __expectString(output[_CCRCC]); + } + if (output[_CSHA] != null) { + contents[_CSHA] = __expectString(output[_CSHA]); + } + if (output[_CSHAh] != null) { + contents[_CSHAh] = __expectString(output[_CSHAh]); + } + return contents; +}; +var de_ChecksumAlgorithmList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_CommonPrefix = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + return contents; +}; +var de_CommonPrefixList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_CommonPrefix(entry, context); + }); +}; +var de_Condition = (output, context) => { + const contents = {}; + if (output[_HECRE] != null) { + contents[_HECRE] = __expectString(output[_HECRE]); + } + if (output[_KPE] != null) { + contents[_KPE] = __expectString(output[_KPE]); + } + return contents; +}; +var de_ContinuationEvent = (output, context) => { + const contents = {}; + return contents; +}; +var de_CopyObjectResult = (output, context) => { + const contents = {}; + if (output[_ETa] != null) { + contents[_ETa] = __expectString(output[_ETa]); + } + if (output[_LM] != null) { + contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM])); + } + if (output[_CCRC] != null) { + contents[_CCRC] = __expectString(output[_CCRC]); + } + if (output[_CCRCC] != null) { + contents[_CCRCC] = __expectString(output[_CCRCC]); + } + if (output[_CSHA] != null) { + contents[_CSHA] = __expectString(output[_CSHA]); + } + if (output[_CSHAh] != null) { + contents[_CSHAh] = __expectString(output[_CSHAh]); + } + return contents; +}; +var de_CopyPartResult = (output, context) => { + const contents = {}; + if (output[_ETa] != null) { + contents[_ETa] = __expectString(output[_ETa]); + } + if (output[_LM] != null) { + contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM])); + } + if (output[_CCRC] != null) { + contents[_CCRC] = __expectString(output[_CCRC]); + } + if (output[_CCRCC] != null) { + contents[_CCRCC] = __expectString(output[_CCRCC]); + } + if (output[_CSHA] != null) { + contents[_CSHA] = __expectString(output[_CSHA]); + } + if (output[_CSHAh] != null) { + contents[_CSHAh] = __expectString(output[_CSHAh]); + } + return contents; +}; +var de_CORSRule = (output, context) => { + const contents = {}; + if (output[_ID_] != null) { + contents[_ID_] = __expectString(output[_ID_]); + } + if (output.AllowedHeader === "") { + contents[_AHl] = []; + } else if (output[_AH] != null) { + contents[_AHl] = de_AllowedHeaders(__getArrayIfSingleItem(output[_AH]), context); + } + if (output.AllowedMethod === "") { + contents[_AMl] = []; + } else if (output[_AM] != null) { + contents[_AMl] = de_AllowedMethods(__getArrayIfSingleItem(output[_AM]), context); + } + if (output.AllowedOrigin === "") { + contents[_AOl] = []; + } else if (output[_AO] != null) { + contents[_AOl] = de_AllowedOrigins(__getArrayIfSingleItem(output[_AO]), context); + } + if (output.ExposeHeader === "") { + contents[_EH] = []; + } else if (output[_EHx] != null) { + contents[_EH] = de_ExposeHeaders(__getArrayIfSingleItem(output[_EHx]), context); + } + if (output[_MAS] != null) { + contents[_MAS] = __strictParseInt32(output[_MAS]); + } + return contents; +}; +var de_CORSRules = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_CORSRule(entry, context); + }); +}; +var de_DefaultRetention = (output, context) => { + const contents = {}; + if (output[_Mo] != null) { + contents[_Mo] = __expectString(output[_Mo]); + } + if (output[_Da] != null) { + contents[_Da] = __strictParseInt32(output[_Da]); + } + if (output[_Y] != null) { + contents[_Y] = __strictParseInt32(output[_Y]); + } + return contents; +}; +var de_DeletedObject = (output, context) => { + const contents = {}; + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_VI] != null) { + contents[_VI] = __expectString(output[_VI]); + } + if (output[_DM] != null) { + contents[_DM] = __parseBoolean(output[_DM]); + } + if (output[_DMVI] != null) { + contents[_DMVI] = __expectString(output[_DMVI]); + } + return contents; +}; +var de_DeletedObjects = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_DeletedObject(entry, context); + }); +}; +var de_DeleteMarkerEntry = (output, context) => { + const contents = {}; + if (output[_O] != null) { + contents[_O] = de_Owner(output[_O], context); + } + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_VI] != null) { + contents[_VI] = __expectString(output[_VI]); + } + if (output[_IL] != null) { + contents[_IL] = __parseBoolean(output[_IL]); + } + if (output[_LM] != null) { + contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM])); + } + return contents; +}; +var de_DeleteMarkerReplication = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + return contents; +}; +var de_DeleteMarkers = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_DeleteMarkerEntry(entry, context); + }); +}; +var de_Destination = (output, context) => { + const contents = {}; + if (output[_B] != null) { + contents[_B] = __expectString(output[_B]); + } + if (output[_Ac] != null) { + contents[_Ac] = __expectString(output[_Ac]); + } + if (output[_SC] != null) { + contents[_SC] = __expectString(output[_SC]); + } + if (output[_ACT] != null) { + contents[_ACT] = de_AccessControlTranslation(output[_ACT], context); + } + if (output[_ECn] != null) { + contents[_ECn] = de_EncryptionConfiguration(output[_ECn], context); + } + if (output[_RTe] != null) { + contents[_RTe] = de_ReplicationTime(output[_RTe], context); + } + if (output[_Me] != null) { + contents[_Me] = de_Metrics(output[_Me], context); + } + return contents; +}; +var de_EncryptionConfiguration = (output, context) => { + const contents = {}; + if (output[_RKKID] != null) { + contents[_RKKID] = __expectString(output[_RKKID]); + } + return contents; +}; +var de_EndEvent = (output, context) => { + const contents = {}; + return contents; +}; +var de__Error = (output, context) => { + const contents = {}; + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_VI] != null) { + contents[_VI] = __expectString(output[_VI]); + } + if (output[_Cod] != null) { + contents[_Cod] = __expectString(output[_Cod]); + } + if (output[_Mes] != null) { + contents[_Mes] = __expectString(output[_Mes]); + } + return contents; +}; +var de_ErrorDocument = (output, context) => { + const contents = {}; + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + return contents; +}; +var de_Errors = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de__Error(entry, context); + }); +}; +var de_EventBridgeConfiguration = (output, context) => { + const contents = {}; + return contents; +}; +var de_EventList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_ExistingObjectReplication = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + return contents; +}; +var de_ExposeHeaders = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_FilterRule = (output, context) => { + const contents = {}; + if (output[_N] != null) { + contents[_N] = __expectString(output[_N]); + } + if (output[_Va] != null) { + contents[_Va] = __expectString(output[_Va]); + } + return contents; +}; +var de_FilterRuleList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_FilterRule(entry, context); + }); +}; +var de_GetObjectAttributesParts = (output, context) => { + const contents = {}; + if (output[_PC] != null) { + contents[_TPC] = __strictParseInt32(output[_PC]); + } + if (output[_PNM] != null) { + contents[_PNM] = __expectString(output[_PNM]); + } + if (output[_NPNM] != null) { + contents[_NPNM] = __expectString(output[_NPNM]); + } + if (output[_MP] != null) { + contents[_MP] = __strictParseInt32(output[_MP]); + } + if (output[_IT] != null) { + contents[_IT] = __parseBoolean(output[_IT]); + } + if (output.Part === "") { + contents[_Part] = []; + } else if (output[_Par] != null) { + contents[_Part] = de_PartsList(__getArrayIfSingleItem(output[_Par]), context); + } + return contents; +}; +var de_Grant = (output, context) => { + const contents = {}; + if (output[_Gra] != null) { + contents[_Gra] = de_Grantee(output[_Gra], context); + } + if (output[_Pe] != null) { + contents[_Pe] = __expectString(output[_Pe]); + } + return contents; +}; +var de_Grantee = (output, context) => { + const contents = {}; + if (output[_DN] != null) { + contents[_DN] = __expectString(output[_DN]); + } + if (output[_EA] != null) { + contents[_EA] = __expectString(output[_EA]); + } + if (output[_ID_] != null) { + contents[_ID_] = __expectString(output[_ID_]); + } + if (output[_URI] != null) { + contents[_URI] = __expectString(output[_URI]); + } + if (output[_x] != null) { + contents[_Ty] = __expectString(output[_x]); + } + return contents; +}; +var de_Grants = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_Grant(entry, context); + }); +}; +var de_IndexDocument = (output, context) => { + const contents = {}; + if (output[_Su] != null) { + contents[_Su] = __expectString(output[_Su]); + } + return contents; +}; +var de_Initiator = (output, context) => { + const contents = {}; + if (output[_ID_] != null) { + contents[_ID_] = __expectString(output[_ID_]); + } + if (output[_DN] != null) { + contents[_DN] = __expectString(output[_DN]); + } + return contents; +}; +var de_IntelligentTieringAndOperator = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output.Tag === "") { + contents[_Tag] = []; + } else if (output[_Ta] != null) { + contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context); + } + return contents; +}; +var de_IntelligentTieringConfiguration = (output, context) => { + const contents = {}; + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output[_F] != null) { + contents[_F] = de_IntelligentTieringFilter(output[_F], context); + } + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + if (output.Tiering === "") { + contents[_Tie] = []; + } else if (output[_Tier] != null) { + contents[_Tie] = de_TieringList(__getArrayIfSingleItem(output[_Tier]), context); + } + return contents; +}; +var de_IntelligentTieringConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_IntelligentTieringConfiguration(entry, context); + }); +}; +var de_IntelligentTieringFilter = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output[_Ta] != null) { + contents[_Ta] = de_Tag(output[_Ta], context); + } + if (output[_A] != null) { + contents[_A] = de_IntelligentTieringAndOperator(output[_A], context); + } + return contents; +}; +var de_InventoryConfiguration = (output, context) => { + const contents = {}; + if (output[_Des] != null) { + contents[_Des] = de_InventoryDestination(output[_Des], context); + } + if (output[_IE] != null) { + contents[_IE] = __parseBoolean(output[_IE]); + } + if (output[_F] != null) { + contents[_F] = de_InventoryFilter(output[_F], context); + } + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output[_IOV] != null) { + contents[_IOV] = __expectString(output[_IOV]); + } + if (output.OptionalFields === "") { + contents[_OF] = []; + } else if (output[_OF] != null && output[_OF][_Fi] != null) { + contents[_OF] = de_InventoryOptionalFields(__getArrayIfSingleItem(output[_OF][_Fi]), context); + } + if (output[_Sc] != null) { + contents[_Sc] = de_InventorySchedule(output[_Sc], context); + } + return contents; +}; +var de_InventoryConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_InventoryConfiguration(entry, context); + }); +}; +var de_InventoryDestination = (output, context) => { + const contents = {}; + if (output[_SBD] != null) { + contents[_SBD] = de_InventoryS3BucketDestination(output[_SBD], context); + } + return contents; +}; +var de_InventoryEncryption = (output, context) => { + const contents = {}; + if (output[_SS] != null) { + contents[_SSES] = de_SSES3(output[_SS], context); + } + if (output[_SK] != null) { + contents[_SSEKMS] = de_SSEKMS(output[_SK], context); + } + return contents; +}; +var de_InventoryFilter = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + return contents; +}; +var de_InventoryOptionalFields = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return __expectString(entry); + }); +}; +var de_InventoryS3BucketDestination = (output, context) => { + const contents = {}; + if (output[_AIc] != null) { + contents[_AIc] = __expectString(output[_AIc]); + } + if (output[_B] != null) { + contents[_B] = __expectString(output[_B]); + } + if (output[_Fo] != null) { + contents[_Fo] = __expectString(output[_Fo]); + } + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output[_En] != null) { + contents[_En] = de_InventoryEncryption(output[_En], context); + } + return contents; +}; +var de_InventorySchedule = (output, context) => { + const contents = {}; + if (output[_Fr] != null) { + contents[_Fr] = __expectString(output[_Fr]); + } + return contents; +}; +var de_LambdaFunctionConfiguration = (output, context) => { + const contents = {}; + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output[_CF] != null) { + contents[_LFA] = __expectString(output[_CF]); + } + if (output.Event === "") { + contents[_Eve] = []; + } else if (output[_Ev] != null) { + contents[_Eve] = de_EventList(__getArrayIfSingleItem(output[_Ev]), context); + } + if (output[_F] != null) { + contents[_F] = de_NotificationConfigurationFilter(output[_F], context); + } + return contents; +}; +var de_LambdaFunctionConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_LambdaFunctionConfiguration(entry, context); + }); +}; +var de_LifecycleExpiration = (output, context) => { + const contents = {}; + if (output[_Dat] != null) { + contents[_Dat] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Dat])); + } + if (output[_Da] != null) { + contents[_Da] = __strictParseInt32(output[_Da]); + } + if (output[_EODM] != null) { + contents[_EODM] = __parseBoolean(output[_EODM]); + } + return contents; +}; +var de_LifecycleRule = (output, context) => { + const contents = {}; + if (output[_Exp] != null) { + contents[_Exp] = de_LifecycleExpiration(output[_Exp], context); + } + if (output[_ID_] != null) { + contents[_ID_] = __expectString(output[_ID_]); + } + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output[_F] != null) { + contents[_F] = de_LifecycleRuleFilter(output[_F], context); + } + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + if (output.Transition === "") { + contents[_Tr] = []; + } else if (output[_Tra] != null) { + contents[_Tr] = de_TransitionList(__getArrayIfSingleItem(output[_Tra]), context); + } + if (output.NoncurrentVersionTransition === "") { + contents[_NVT] = []; + } else if (output[_NVTo] != null) { + contents[_NVT] = de_NoncurrentVersionTransitionList(__getArrayIfSingleItem(output[_NVTo]), context); + } + if (output[_NVE] != null) { + contents[_NVE] = de_NoncurrentVersionExpiration(output[_NVE], context); + } + if (output[_AIMU] != null) { + contents[_AIMU] = de_AbortIncompleteMultipartUpload(output[_AIMU], context); + } + return contents; +}; +var de_LifecycleRuleAndOperator = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output.Tag === "") { + contents[_Tag] = []; + } else if (output[_Ta] != null) { + contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context); + } + if (output[_OSGT] != null) { + contents[_OSGT] = __strictParseLong(output[_OSGT]); + } + if (output[_OSLT] != null) { + contents[_OSLT] = __strictParseLong(output[_OSLT]); + } + return contents; +}; +var de_LifecycleRuleFilter = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output[_Ta] != null) { + contents[_Ta] = de_Tag(output[_Ta], context); + } + if (output[_OSGT] != null) { + contents[_OSGT] = __strictParseLong(output[_OSGT]); + } + if (output[_OSLT] != null) { + contents[_OSLT] = __strictParseLong(output[_OSLT]); + } + if (output[_A] != null) { + contents[_A] = de_LifecycleRuleAndOperator(output[_A], context); + } + return contents; +}; +var de_LifecycleRules = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_LifecycleRule(entry, context); + }); +}; +var de_LoggingEnabled = (output, context) => { + const contents = {}; + if (output[_TB] != null) { + contents[_TB] = __expectString(output[_TB]); + } + if (output.TargetGrants === "") { + contents[_TG] = []; + } else if (output[_TG] != null && output[_TG][_G] != null) { + contents[_TG] = de_TargetGrants(__getArrayIfSingleItem(output[_TG][_G]), context); + } + if (output[_TP] != null) { + contents[_TP] = __expectString(output[_TP]); + } + if (output[_TOKF] != null) { + contents[_TOKF] = de_TargetObjectKeyFormat(output[_TOKF], context); + } + return contents; +}; +var de_Metrics = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + if (output[_ETv] != null) { + contents[_ETv] = de_ReplicationTimeValue(output[_ETv], context); + } + return contents; +}; +var de_MetricsAndOperator = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output.Tag === "") { + contents[_Tag] = []; + } else if (output[_Ta] != null) { + contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context); + } + if (output[_APAc] != null) { + contents[_APAc] = __expectString(output[_APAc]); + } + return contents; +}; +var de_MetricsConfiguration = (output, context) => { + const contents = {}; + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output.Filter === "") { + } else if (output[_F] != null) { + contents[_F] = de_MetricsFilter(__expectUnion(output[_F]), context); + } + return contents; +}; +var de_MetricsConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_MetricsConfiguration(entry, context); + }); +}; +var de_MetricsFilter = (output, context) => { + if (output[_P] != null) { + return { + Prefix: __expectString(output[_P]), + }; + } + if (output[_Ta] != null) { + return { + Tag: de_Tag(output[_Ta], context), + }; + } + if (output[_APAc] != null) { + return { + AccessPointArn: __expectString(output[_APAc]), + }; + } + if (output[_A] != null) { + return { + And: de_MetricsAndOperator(output[_A], context), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; +var de_MultipartUpload = (output, context) => { + const contents = {}; + if (output[_UI] != null) { + contents[_UI] = __expectString(output[_UI]); + } + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_Ini] != null) { + contents[_Ini] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Ini])); + } + if (output[_SC] != null) { + contents[_SC] = __expectString(output[_SC]); + } + if (output[_O] != null) { + contents[_O] = de_Owner(output[_O], context); + } + if (output[_In] != null) { + contents[_In] = de_Initiator(output[_In], context); + } + if (output[_CA] != null) { + contents[_CA] = __expectString(output[_CA]); + } + return contents; +}; +var de_MultipartUploadList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_MultipartUpload(entry, context); + }); +}; +var de_NoncurrentVersionExpiration = (output, context) => { + const contents = {}; + if (output[_ND] != null) { + contents[_ND] = __strictParseInt32(output[_ND]); + } + if (output[_NNV] != null) { + contents[_NNV] = __strictParseInt32(output[_NNV]); + } + return contents; +}; +var de_NoncurrentVersionTransition = (output, context) => { + const contents = {}; + if (output[_ND] != null) { + contents[_ND] = __strictParseInt32(output[_ND]); + } + if (output[_SC] != null) { + contents[_SC] = __expectString(output[_SC]); + } + if (output[_NNV] != null) { + contents[_NNV] = __strictParseInt32(output[_NNV]); + } + return contents; +}; +var de_NoncurrentVersionTransitionList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_NoncurrentVersionTransition(entry, context); + }); +}; +var de_NotificationConfigurationFilter = (output, context) => { + const contents = {}; + if (output[_SKe] != null) { + contents[_K] = de_S3KeyFilter(output[_SKe], context); + } + return contents; +}; +var de__Object = (output, context) => { + const contents = {}; + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_LM] != null) { + contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM])); + } + if (output[_ETa] != null) { + contents[_ETa] = __expectString(output[_ETa]); + } + if (output.ChecksumAlgorithm === "") { + contents[_CA] = []; + } else if (output[_CA] != null) { + contents[_CA] = de_ChecksumAlgorithmList(__getArrayIfSingleItem(output[_CA]), context); + } + if (output[_Si] != null) { + contents[_Si] = __strictParseLong(output[_Si]); + } + if (output[_SC] != null) { + contents[_SC] = __expectString(output[_SC]); + } + if (output[_O] != null) { + contents[_O] = de_Owner(output[_O], context); + } + if (output[_RSe] != null) { + contents[_RSe] = de_RestoreStatus(output[_RSe], context); + } + return contents; +}; +var de_ObjectList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de__Object(entry, context); + }); +}; +var de_ObjectLockConfiguration = (output, context) => { + const contents = {}; + if (output[_OLE] != null) { + contents[_OLE] = __expectString(output[_OLE]); + } + if (output[_Ru] != null) { + contents[_Ru] = de_ObjectLockRule(output[_Ru], context); + } + return contents; +}; +var de_ObjectLockLegalHold = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + return contents; +}; +var de_ObjectLockRetention = (output, context) => { + const contents = {}; + if (output[_Mo] != null) { + contents[_Mo] = __expectString(output[_Mo]); + } + if (output[_RUD] != null) { + contents[_RUD] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_RUD])); + } + return contents; +}; +var de_ObjectLockRule = (output, context) => { + const contents = {}; + if (output[_DRe] != null) { + contents[_DRe] = de_DefaultRetention(output[_DRe], context); + } + return contents; +}; +var de_ObjectPart = (output, context) => { + const contents = {}; + if (output[_PN] != null) { + contents[_PN] = __strictParseInt32(output[_PN]); + } + if (output[_Si] != null) { + contents[_Si] = __strictParseLong(output[_Si]); + } + if (output[_CCRC] != null) { + contents[_CCRC] = __expectString(output[_CCRC]); + } + if (output[_CCRCC] != null) { + contents[_CCRCC] = __expectString(output[_CCRCC]); + } + if (output[_CSHA] != null) { + contents[_CSHA] = __expectString(output[_CSHA]); + } + if (output[_CSHAh] != null) { + contents[_CSHAh] = __expectString(output[_CSHAh]); + } + return contents; +}; +var de_ObjectVersion = (output, context) => { + const contents = {}; + if (output[_ETa] != null) { + contents[_ETa] = __expectString(output[_ETa]); + } + if (output.ChecksumAlgorithm === "") { + contents[_CA] = []; + } else if (output[_CA] != null) { + contents[_CA] = de_ChecksumAlgorithmList(__getArrayIfSingleItem(output[_CA]), context); + } + if (output[_Si] != null) { + contents[_Si] = __strictParseLong(output[_Si]); + } + if (output[_SC] != null) { + contents[_SC] = __expectString(output[_SC]); + } + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_VI] != null) { + contents[_VI] = __expectString(output[_VI]); + } + if (output[_IL] != null) { + contents[_IL] = __parseBoolean(output[_IL]); + } + if (output[_LM] != null) { + contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM])); + } + if (output[_O] != null) { + contents[_O] = de_Owner(output[_O], context); + } + if (output[_RSe] != null) { + contents[_RSe] = de_RestoreStatus(output[_RSe], context); + } + return contents; +}; +var de_ObjectVersionList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_ObjectVersion(entry, context); + }); +}; +var de_Owner = (output, context) => { + const contents = {}; + if (output[_DN] != null) { + contents[_DN] = __expectString(output[_DN]); + } + if (output[_ID_] != null) { + contents[_ID_] = __expectString(output[_ID_]); + } + return contents; +}; +var de_OwnershipControls = (output, context) => { + const contents = {}; + if (output.Rule === "") { + contents[_Rul] = []; + } else if (output[_Ru] != null) { + contents[_Rul] = de_OwnershipControlsRules(__getArrayIfSingleItem(output[_Ru]), context); + } + return contents; +}; +var de_OwnershipControlsRule = (output, context) => { + const contents = {}; + if (output[_OO] != null) { + contents[_OO] = __expectString(output[_OO]); + } + return contents; +}; +var de_OwnershipControlsRules = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_OwnershipControlsRule(entry, context); + }); +}; +var de_Part = (output, context) => { + const contents = {}; + if (output[_PN] != null) { + contents[_PN] = __strictParseInt32(output[_PN]); + } + if (output[_LM] != null) { + contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM])); + } + if (output[_ETa] != null) { + contents[_ETa] = __expectString(output[_ETa]); + } + if (output[_Si] != null) { + contents[_Si] = __strictParseLong(output[_Si]); + } + if (output[_CCRC] != null) { + contents[_CCRC] = __expectString(output[_CCRC]); + } + if (output[_CCRCC] != null) { + contents[_CCRCC] = __expectString(output[_CCRCC]); + } + if (output[_CSHA] != null) { + contents[_CSHA] = __expectString(output[_CSHA]); + } + if (output[_CSHAh] != null) { + contents[_CSHAh] = __expectString(output[_CSHAh]); + } + return contents; +}; +var de_PartitionedPrefix = (output, context) => { + const contents = {}; + if (output[_PDS] != null) { + contents[_PDS] = __expectString(output[_PDS]); + } + return contents; +}; +var de_Parts = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_Part(entry, context); + }); +}; +var de_PartsList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_ObjectPart(entry, context); + }); +}; +var de_PolicyStatus = (output, context) => { + const contents = {}; + if (output[_IP] != null) { + contents[_IP] = __parseBoolean(output[_IP]); + } + return contents; +}; +var de_Progress = (output, context) => { + const contents = {}; + if (output[_BS] != null) { + contents[_BS] = __strictParseLong(output[_BS]); + } + if (output[_BP] != null) { + contents[_BP] = __strictParseLong(output[_BP]); + } + if (output[_BRy] != null) { + contents[_BRy] = __strictParseLong(output[_BRy]); + } + return contents; +}; +var de_PublicAccessBlockConfiguration = (output, context) => { + const contents = {}; + if (output[_BPA] != null) { + contents[_BPA] = __parseBoolean(output[_BPA]); + } + if (output[_IPA] != null) { + contents[_IPA] = __parseBoolean(output[_IPA]); + } + if (output[_BPP] != null) { + contents[_BPP] = __parseBoolean(output[_BPP]); + } + if (output[_RPB] != null) { + contents[_RPB] = __parseBoolean(output[_RPB]); + } + return contents; +}; +var de_QueueConfiguration = (output, context) => { + const contents = {}; + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output[_Qu] != null) { + contents[_QA] = __expectString(output[_Qu]); + } + if (output.Event === "") { + contents[_Eve] = []; + } else if (output[_Ev] != null) { + contents[_Eve] = de_EventList(__getArrayIfSingleItem(output[_Ev]), context); + } + if (output[_F] != null) { + contents[_F] = de_NotificationConfigurationFilter(output[_F], context); + } + return contents; +}; +var de_QueueConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_QueueConfiguration(entry, context); + }); +}; +var de_Redirect = (output, context) => { + const contents = {}; + if (output[_HN] != null) { + contents[_HN] = __expectString(output[_HN]); + } + if (output[_HRC] != null) { + contents[_HRC] = __expectString(output[_HRC]); + } + if (output[_Pr] != null) { + contents[_Pr] = __expectString(output[_Pr]); + } + if (output[_RKPW] != null) { + contents[_RKPW] = __expectString(output[_RKPW]); + } + if (output[_RKW] != null) { + contents[_RKW] = __expectString(output[_RKW]); + } + return contents; +}; +var de_RedirectAllRequestsTo = (output, context) => { + const contents = {}; + if (output[_HN] != null) { + contents[_HN] = __expectString(output[_HN]); + } + if (output[_Pr] != null) { + contents[_Pr] = __expectString(output[_Pr]); + } + return contents; +}; +var de_ReplicaModifications = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + return contents; +}; +var de_ReplicationConfiguration = (output, context) => { + const contents = {}; + if (output[_Ro] != null) { + contents[_Ro] = __expectString(output[_Ro]); + } + if (output.Rule === "") { + contents[_Rul] = []; + } else if (output[_Ru] != null) { + contents[_Rul] = de_ReplicationRules(__getArrayIfSingleItem(output[_Ru]), context); + } + return contents; +}; +var de_ReplicationRule = (output, context) => { + const contents = {}; + if (output[_ID_] != null) { + contents[_ID_] = __expectString(output[_ID_]); + } + if (output[_Pri] != null) { + contents[_Pri] = __strictParseInt32(output[_Pri]); + } + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output[_F] != null) { + contents[_F] = de_ReplicationRuleFilter(output[_F], context); + } + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + if (output[_SSC] != null) { + contents[_SSC] = de_SourceSelectionCriteria(output[_SSC], context); + } + if (output[_EOR] != null) { + contents[_EOR] = de_ExistingObjectReplication(output[_EOR], context); + } + if (output[_Des] != null) { + contents[_Des] = de_Destination(output[_Des], context); + } + if (output[_DMR] != null) { + contents[_DMR] = de_DeleteMarkerReplication(output[_DMR], context); + } + return contents; +}; +var de_ReplicationRuleAndOperator = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output.Tag === "") { + contents[_Tag] = []; + } else if (output[_Ta] != null) { + contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context); + } + return contents; +}; +var de_ReplicationRuleFilter = (output, context) => { + const contents = {}; + if (output[_P] != null) { + contents[_P] = __expectString(output[_P]); + } + if (output[_Ta] != null) { + contents[_Ta] = de_Tag(output[_Ta], context); + } + if (output[_A] != null) { + contents[_A] = de_ReplicationRuleAndOperator(output[_A], context); + } + return contents; +}; +var de_ReplicationRules = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_ReplicationRule(entry, context); + }); +}; +var de_ReplicationTime = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + if (output[_Tim] != null) { + contents[_Tim] = de_ReplicationTimeValue(output[_Tim], context); + } + return contents; +}; +var de_ReplicationTimeValue = (output, context) => { + const contents = {}; + if (output[_Mi] != null) { + contents[_Mi] = __strictParseInt32(output[_Mi]); + } + return contents; +}; +var de_RestoreStatus = (output, context) => { + const contents = {}; + if (output[_IRIP] != null) { + contents[_IRIP] = __parseBoolean(output[_IRIP]); + } + if (output[_RED] != null) { + contents[_RED] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_RED])); + } + return contents; +}; +var de_RoutingRule = (output, context) => { + const contents = {}; + if (output[_Con] != null) { + contents[_Con] = de_Condition(output[_Con], context); + } + if (output[_Red] != null) { + contents[_Red] = de_Redirect(output[_Red], context); + } + return contents; +}; +var de_RoutingRules = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_RoutingRule(entry, context); + }); +}; +var de_S3KeyFilter = (output, context) => { + const contents = {}; + if (output.FilterRule === "") { + contents[_FRi] = []; + } else if (output[_FR] != null) { + contents[_FRi] = de_FilterRuleList(__getArrayIfSingleItem(output[_FR]), context); + } + return contents; +}; +var de_ServerSideEncryptionByDefault = (output, context) => { + const contents = {}; + if (output[_SSEA] != null) { + contents[_SSEA] = __expectString(output[_SSEA]); + } + if (output[_KMSMKID] != null) { + contents[_KMSMKID] = __expectString(output[_KMSMKID]); + } + return contents; +}; +var de_ServerSideEncryptionConfiguration = (output, context) => { + const contents = {}; + if (output.Rule === "") { + contents[_Rul] = []; + } else if (output[_Ru] != null) { + contents[_Rul] = de_ServerSideEncryptionRules(__getArrayIfSingleItem(output[_Ru]), context); + } + return contents; +}; +var de_ServerSideEncryptionRule = (output, context) => { + const contents = {}; + if (output[_ASSEBD] != null) { + contents[_ASSEBD] = de_ServerSideEncryptionByDefault(output[_ASSEBD], context); + } + if (output[_BKE] != null) { + contents[_BKE] = __parseBoolean(output[_BKE]); + } + return contents; +}; +var de_ServerSideEncryptionRules = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_ServerSideEncryptionRule(entry, context); + }); +}; +var de_SessionCredentials = (output, context) => { + const contents = {}; + if (output[_AKI] != null) { + contents[_AKI] = __expectString(output[_AKI]); + } + if (output[_SAK] != null) { + contents[_SAK] = __expectString(output[_SAK]); + } + if (output[_ST] != null) { + contents[_ST] = __expectString(output[_ST]); + } + if (output[_Exp] != null) { + contents[_Exp] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Exp])); + } + return contents; +}; +var de_SimplePrefix = (output, context) => { + const contents = {}; + return contents; +}; +var de_SourceSelectionCriteria = (output, context) => { + const contents = {}; + if (output[_SKEO] != null) { + contents[_SKEO] = de_SseKmsEncryptedObjects(output[_SKEO], context); + } + if (output[_RM] != null) { + contents[_RM] = de_ReplicaModifications(output[_RM], context); + } + return contents; +}; +var de_SSEKMS = (output, context) => { + const contents = {}; + if (output[_KI] != null) { + contents[_KI] = __expectString(output[_KI]); + } + return contents; +}; +var de_SseKmsEncryptedObjects = (output, context) => { + const contents = {}; + if (output[_S] != null) { + contents[_S] = __expectString(output[_S]); + } + return contents; +}; +var de_SSES3 = (output, context) => { + const contents = {}; + return contents; +}; +var de_Stats = (output, context) => { + const contents = {}; + if (output[_BS] != null) { + contents[_BS] = __strictParseLong(output[_BS]); + } + if (output[_BP] != null) { + contents[_BP] = __strictParseLong(output[_BP]); + } + if (output[_BRy] != null) { + contents[_BRy] = __strictParseLong(output[_BRy]); + } + return contents; +}; +var de_StorageClassAnalysis = (output, context) => { + const contents = {}; + if (output[_DE] != null) { + contents[_DE] = de_StorageClassAnalysisDataExport(output[_DE], context); + } + return contents; +}; +var de_StorageClassAnalysisDataExport = (output, context) => { + const contents = {}; + if (output[_OSV] != null) { + contents[_OSV] = __expectString(output[_OSV]); + } + if (output[_Des] != null) { + contents[_Des] = de_AnalyticsExportDestination(output[_Des], context); + } + return contents; +}; +var de_Tag = (output, context) => { + const contents = {}; + if (output[_K] != null) { + contents[_K] = __expectString(output[_K]); + } + if (output[_Va] != null) { + contents[_Va] = __expectString(output[_Va]); + } + return contents; +}; +var de_TagSet = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_Tag(entry, context); + }); +}; +var de_TargetGrant = (output, context) => { + const contents = {}; + if (output[_Gra] != null) { + contents[_Gra] = de_Grantee(output[_Gra], context); + } + if (output[_Pe] != null) { + contents[_Pe] = __expectString(output[_Pe]); + } + return contents; +}; +var de_TargetGrants = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_TargetGrant(entry, context); + }); +}; +var de_TargetObjectKeyFormat = (output, context) => { + const contents = {}; + if (output[_SPi] != null) { + contents[_SPi] = de_SimplePrefix(output[_SPi], context); + } + if (output[_PP] != null) { + contents[_PP] = de_PartitionedPrefix(output[_PP], context); + } + return contents; +}; +var de_Tiering = (output, context) => { + const contents = {}; + if (output[_Da] != null) { + contents[_Da] = __strictParseInt32(output[_Da]); + } + if (output[_AT] != null) { + contents[_AT] = __expectString(output[_AT]); + } + return contents; +}; +var de_TieringList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_Tiering(entry, context); + }); +}; +var de_TopicConfiguration = (output, context) => { + const contents = {}; + if (output[_I] != null) { + contents[_I] = __expectString(output[_I]); + } + if (output[_Top] != null) { + contents[_TA] = __expectString(output[_Top]); + } + if (output.Event === "") { + contents[_Eve] = []; + } else if (output[_Ev] != null) { + contents[_Eve] = de_EventList(__getArrayIfSingleItem(output[_Ev]), context); + } + if (output[_F] != null) { + contents[_F] = de_NotificationConfigurationFilter(output[_F], context); + } + return contents; +}; +var de_TopicConfigurationList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_TopicConfiguration(entry, context); + }); +}; +var de_Transition = (output, context) => { + const contents = {}; + if (output[_Dat] != null) { + contents[_Dat] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Dat])); + } + if (output[_Da] != null) { + contents[_Da] = __strictParseInt32(output[_Da]); + } + if (output[_SC] != null) { + contents[_SC] = __expectString(output[_SC]); + } + return contents; +}; +var de_TransitionList = (output, context) => { + return (output || []) + .filter((e2) => e2 != null) + .map((entry) => { + return de_Transition(entry, context); + }); +}; +var deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +var collectBodyString = (streamBody, context) => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +var _A = "And"; +var _AAO = "AnalyticsAndOperator"; +var _AC = "AnalyticsConfiguration"; +var _ACL = "ACL"; +var _ACLc = "AccessControlList"; +var _ACLn = "AnalyticsConfigurationList"; +var _ACP = "AccessControlPolicy"; +var _ACT = "AccessControlTranslation"; +var _ACc = "AccelerateConfiguration"; +var _AD = "AbortDate"; +var _AED = "AnalyticsExportDestination"; +var _AF = "AnalyticsFilter"; +var _AH = "AllowedHeader"; +var _AHl = "AllowedHeaders"; +var _AI = "AnalyticsId"; +var _AIMU = "AbortIncompleteMultipartUpload"; +var _AIc = "AccountId"; +var _AKI = "AccessKeyId"; +var _AM = "AllowedMethod"; +var _AMl = "AllowedMethods"; +var _AO = "AllowedOrigin"; +var _AOl = "AllowedOrigins"; +var _APA = "AccessPointAlias"; +var _APAc = "AccessPointArn"; +var _AQRD = "AllowQuotedRecordDelimiter"; +var _AR = "AcceptRanges"; +var _ARI = "AbortRuleId"; +var _AS = "ArchiveStatus"; +var _ASBD = "AnalyticsS3BucketDestination"; +var _ASEFF = "AnalyticsS3ExportFileFormat"; +var _ASSEBD = "ApplyServerSideEncryptionByDefault"; +var _AT = "AccessTier"; +var _Ac = "Account"; +var _B = "Bucket"; +var _BAI = "BucketAccountId"; +var _BAS = "BucketAccelerateStatus"; +var _BGR = "BypassGovernanceRetention"; +var _BI = "BucketInfo"; +var _BKE = "BucketKeyEnabled"; +var _BLC = "BucketLifecycleConfiguration"; +var _BLCu = "BucketLocationConstraint"; +var _BLN = "BucketLocationName"; +var _BLP = "BucketLogsPermission"; +var _BLS = "BucketLoggingStatus"; +var _BLT = "BucketLocationType"; +var _BN = "BucketName"; +var _BP = "BytesProcessed"; +var _BPA = "BlockPublicAcls"; +var _BPP = "BlockPublicPolicy"; +var _BR = "BucketRegion"; +var _BRy = "BytesReturned"; +var _BS = "BytesScanned"; +var _BT = "BucketType"; +var _BVS = "BucketVersioningStatus"; +var _Bu = "Buckets"; +var _C = "Credentials"; +var _CA = "ChecksumAlgorithm"; +var _CACL = "CannedACL"; +var _CBC = "CreateBucketConfiguration"; +var _CC = "CacheControl"; +var _CCRC = "ChecksumCRC32"; +var _CCRCC = "ChecksumCRC32C"; +var _CD = "ContentDisposition"; +var _CDr = "CreationDate"; +var _CE = "ContentEncoding"; +var _CF = "CloudFunction"; +var _CFC = "CloudFunctionConfiguration"; +var _CL = "ContentLanguage"; +var _CLo = "ContentLength"; +var _CM = "ChecksumMode"; +var _CMD = "ContentMD5"; +var _CMU = "CompletedMultipartUpload"; +var _CORSC = "CORSConfiguration"; +var _CORSR = "CORSRule"; +var _CORSRu = "CORSRules"; +var _CP = "CommonPrefixes"; +var _CPo = "CompletedPart"; +var _CR = "ContentRange"; +var _CRSBA = "ConfirmRemoveSelfBucketAccess"; +var _CS = "CopySource"; +var _CSHA = "ChecksumSHA1"; +var _CSHAh = "ChecksumSHA256"; +var _CSIM = "CopySourceIfMatch"; +var _CSIMS = "CopySourceIfModifiedSince"; +var _CSINM = "CopySourceIfNoneMatch"; +var _CSIUS = "CopySourceIfUnmodifiedSince"; +var _CSR = "CopySourceRange"; +var _CSSSECA = "CopySourceSSECustomerAlgorithm"; +var _CSSSECK = "CopySourceSSECustomerKey"; +var _CSSSECKMD = "CopySourceSSECustomerKeyMD5"; +var _CSV = "CSV"; +var _CSVI = "CopySourceVersionId"; +var _CSVIn = "CSVInput"; +var _CSVO = "CSVOutput"; +var _CT = "ContentType"; +var _CTo = "ContinuationToken"; +var _CTom = "CompressionType"; +var _Ch = "Checksum"; +var _Co = "Contents"; +var _Cod = "Code"; +var _Com = "Comments"; +var _Con = "Condition"; +var _D = "Delimiter"; +var _DAI = "DaysAfterInitiation"; +var _DE = "DataExport"; +var _DM = "DeleteMarker"; +var _DMR = "DeleteMarkerReplication"; +var _DMRS = "DeleteMarkerReplicationStatus"; +var _DMVI = "DeleteMarkerVersionId"; +var _DMe = "DeleteMarkers"; +var _DN = "DisplayName"; +var _DR = "DataRedundancy"; +var _DRe = "DefaultRetention"; +var _Da = "Days"; +var _Dat = "Date"; +var _De = "Deleted"; +var _Del = "Delete"; +var _Des = "Destination"; +var _Desc = "Description"; +var _E = "Expires"; +var _EA = "EmailAddress"; +var _EBC = "EventBridgeConfiguration"; +var _EBO = "ExpectedBucketOwner"; +var _EC = "ErrorCode"; +var _ECn = "EncryptionConfiguration"; +var _ED = "ErrorDocument"; +var _EH = "ExposeHeaders"; +var _EHx = "ExposeHeader"; +var _EM = "ErrorMessage"; +var _EODM = "ExpiredObjectDeleteMarker"; +var _EOR = "ExistingObjectReplication"; +var _EORS = "ExistingObjectReplicationStatus"; +var _ERP = "EnableRequestProgress"; +var _ES = "ExpiresString"; +var _ESBO = "ExpectedSourceBucketOwner"; +var _ESx = "ExpirationStatus"; +var _ET = "EncodingType"; +var _ETa = "ETag"; +var _ETn = "EncryptionType"; +var _ETv = "EventThreshold"; +var _ETx = "ExpressionType"; +var _En = "Encryption"; +var _Ena = "Enabled"; +var _End = "End"; +var _Er = "Error"; +var _Err = "Errors"; +var _Ev = "Event"; +var _Eve = "Events"; +var _Ex = "Expression"; +var _Exp = "Expiration"; +var _F = "Filter"; +var _FD = "FieldDelimiter"; +var _FHI = "FileHeaderInfo"; +var _FO = "FetchOwner"; +var _FR = "FilterRule"; +var _FRN = "FilterRuleName"; +var _FRV = "FilterRuleValue"; +var _FRi = "FilterRules"; +var _Fi = "Field"; +var _Fo = "Format"; +var _Fr = "Frequency"; +var _G = "Grant"; +var _GFC = "GrantFullControl"; +var _GJP = "GlacierJobParameters"; +var _GR = "GrantRead"; +var _GRACP = "GrantReadACP"; +var _GW = "GrantWrite"; +var _GWACP = "GrantWriteACP"; +var _Gr = "Grants"; +var _Gra = "Grantee"; +var _HECRE = "HttpErrorCodeReturnedEquals"; +var _HN = "HostName"; +var _HRC = "HttpRedirectCode"; +var _I = "Id"; +var _IC = "InventoryConfiguration"; +var _ICL = "InventoryConfigurationList"; +var _ID = "IndexDocument"; +var _ID_ = "ID"; +var _IDn = "InventoryDestination"; +var _IE = "IsEnabled"; +var _IEn = "InventoryEncryption"; +var _IF = "InventoryFilter"; +var _IFn = "InventoryFormat"; +var _IFnv = "InventoryFrequency"; +var _II = "InventoryId"; +var _IIOV = "InventoryIncludedObjectVersions"; +var _IL = "IsLatest"; +var _IM = "IfMatch"; +var _IMS = "IfModifiedSince"; +var _INM = "IfNoneMatch"; +var _IOF = "InventoryOptionalField"; +var _IOV = "IncludedObjectVersions"; +var _IP = "IsPublic"; +var _IPA = "IgnorePublicAcls"; +var _IRIP = "IsRestoreInProgress"; +var _IS = "InputSerialization"; +var _ISBD = "InventoryS3BucketDestination"; +var _ISn = "InventorySchedule"; +var _IT = "IsTruncated"; +var _ITAO = "IntelligentTieringAndOperator"; +var _ITAT = "IntelligentTieringAccessTier"; +var _ITC = "IntelligentTieringConfiguration"; +var _ITCL = "IntelligentTieringConfigurationList"; +var _ITD = "IntelligentTieringDays"; +var _ITF = "IntelligentTieringFilter"; +var _ITI = "IntelligentTieringId"; +var _ITS = "IntelligentTieringStatus"; +var _IUS = "IfUnmodifiedSince"; +var _In = "Initiator"; +var _Ini = "Initiated"; +var _JSON = "JSON"; +var _JSONI = "JSONInput"; +var _JSONO = "JSONOutput"; +var _JSONT = "JSONType"; +var _K = "Key"; +var _KC = "KeyCount"; +var _KI = "KeyId"; +var _KM = "KeyMarker"; +var _KMSC = "KMSContext"; +var _KMSKI = "KMSKeyId"; +var _KMSMKID = "KMSMasterKeyID"; +var _KPE = "KeyPrefixEquals"; +var _L = "Location"; +var _LC = "LocationConstraint"; +var _LE = "LoggingEnabled"; +var _LEi = "LifecycleExpiration"; +var _LFA = "LambdaFunctionArn"; +var _LFC = "LambdaFunctionConfigurations"; +var _LFCa = "LambdaFunctionConfiguration"; +var _LI = "LocationInfo"; +var _LM = "LastModified"; +var _LNAS = "LocationNameAsString"; +var _LP = "LocationPrefix"; +var _LR = "LifecycleRule"; +var _LRAO = "LifecycleRuleAndOperator"; +var _LRF = "LifecycleRuleFilter"; +var _LT = "LocationType"; +var _M = "Marker"; +var _MAO = "MetricsAndOperator"; +var _MAS = "MaxAgeSeconds"; +var _MB = "MaxBuckets"; +var _MC = "MetricsConfiguration"; +var _MCL = "MetricsConfigurationList"; +var _MD = "MetadataDirective"; +var _MDB = "MaxDirectoryBuckets"; +var _MDf = "MfaDelete"; +var _ME = "MetadataEntry"; +var _MF = "MetricsFilter"; +var _MFA = "MFA"; +var _MFAD = "MFADelete"; +var _MI = "MetricsId"; +var _MK = "MaxKeys"; +var _MKe = "MetadataKey"; +var _MM = "MissingMeta"; +var _MP = "MaxParts"; +var _MS = "MetricsStatus"; +var _MU = "MaxUploads"; +var _MV = "MetadataValue"; +var _Me = "Metrics"; +var _Mes = "Message"; +var _Mi = "Minutes"; +var _Mo = "Mode"; +var _N = "Name"; +var _NC = "NotificationConfiguration"; +var _NCF = "NotificationConfigurationFilter"; +var _NCT = "NextContinuationToken"; +var _ND = "NoncurrentDays"; +var _NI = "NotificationId"; +var _NKM = "NextKeyMarker"; +var _NM = "NextMarker"; +var _NNV = "NewerNoncurrentVersions"; +var _NPNM = "NextPartNumberMarker"; +var _NUIM = "NextUploadIdMarker"; +var _NVE = "NoncurrentVersionExpiration"; +var _NVIM = "NextVersionIdMarker"; +var _NVT = "NoncurrentVersionTransitions"; +var _NVTo = "NoncurrentVersionTransition"; +var _O = "Owner"; +var _OA = "ObjectAttributes"; +var _OC = "OwnershipControls"; +var _OCACL = "ObjectCannedACL"; +var _OCR = "OwnershipControlsRule"; +var _OF = "OptionalFields"; +var _OI = "ObjectIdentifier"; +var _OK = "ObjectKey"; +var _OL = "OutputLocation"; +var _OLC = "ObjectLockConfiguration"; +var _OLE = "ObjectLockEnabled"; +var _OLEFB = "ObjectLockEnabledForBucket"; +var _OLLH = "ObjectLockLegalHold"; +var _OLLHS = "ObjectLockLegalHoldStatus"; +var _OLM = "ObjectLockMode"; +var _OLR = "ObjectLockRetention"; +var _OLRM = "ObjectLockRetentionMode"; +var _OLRUD = "ObjectLockRetainUntilDate"; +var _OLRb = "ObjectLockRule"; +var _OO = "ObjectOwnership"; +var _OOA = "OptionalObjectAttributes"; +var _OOw = "OwnerOverride"; +var _OP = "ObjectParts"; +var _OS = "OutputSerialization"; +var _OSGT = "ObjectSizeGreaterThan"; +var _OSGTB = "ObjectSizeGreaterThanBytes"; +var _OSLT = "ObjectSizeLessThan"; +var _OSLTB = "ObjectSizeLessThanBytes"; +var _OSV = "OutputSchemaVersion"; +var _OSb = "ObjectSize"; +var _OVI = "ObjectVersionId"; +var _Ob = "Objects"; +var _P = "Prefix"; +var _PABC = "PublicAccessBlockConfiguration"; +var _PC = "PartsCount"; +var _PDS = "PartitionDateSource"; +var _PI = "ParquetInput"; +var _PN = "PartNumber"; +var _PNM = "PartNumberMarker"; +var _PP = "PartitionedPrefix"; +var _Pa = "Payer"; +var _Par = "Part"; +var _Parq = "Parquet"; +var _Part = "Parts"; +var _Pe = "Permission"; +var _Pr = "Protocol"; +var _Pri = "Priority"; +var _Q = "Quiet"; +var _QA = "QueueArn"; +var _QC = "QueueConfiguration"; +var _QCu = "QueueConfigurations"; +var _QCuo = "QuoteCharacter"; +var _QEC = "QuoteEscapeCharacter"; +var _QF = "QuoteFields"; +var _Qu = "Queue"; +var _R = "Range"; +var _RART = "RedirectAllRequestsTo"; +var _RC = "RequestCharged"; +var _RCC = "ResponseCacheControl"; +var _RCD = "ResponseContentDisposition"; +var _RCE = "ResponseContentEncoding"; +var _RCL = "ResponseContentLanguage"; +var _RCT = "ResponseContentType"; +var _RCe = "ReplicationConfiguration"; +var _RD = "RecordDelimiter"; +var _RE = "ResponseExpires"; +var _RED = "RestoreExpiryDate"; +var _RKKID = "ReplicaKmsKeyID"; +var _RKPW = "ReplaceKeyPrefixWith"; +var _RKW = "ReplaceKeyWith"; +var _RM = "ReplicaModifications"; +var _RMS = "ReplicaModificationsStatus"; +var _ROP = "RestoreOutputPath"; +var _RP = "RequestPayer"; +var _RPB = "RestrictPublicBuckets"; +var _RPC = "RequestPaymentConfiguration"; +var _RPe = "RequestProgress"; +var _RR = "RequestRoute"; +var _RRAO = "ReplicationRuleAndOperator"; +var _RRF = "ReplicationRuleFilter"; +var _RRS = "ReplicationRuleStatus"; +var _RRT = "RestoreRequestType"; +var _RRe = "ReplicationRule"; +var _RRes = "RestoreRequest"; +var _RRo = "RoutingRules"; +var _RRou = "RoutingRule"; +var _RS = "ReplicationStatus"; +var _RSe = "RestoreStatus"; +var _RT = "RequestToken"; +var _RTS = "ReplicationTimeStatus"; +var _RTV = "ReplicationTimeValue"; +var _RTe = "ReplicationTime"; +var _RUD = "RetainUntilDate"; +var _Re = "Restore"; +var _Red = "Redirect"; +var _Ro = "Role"; +var _Ru = "Rule"; +var _Rul = "Rules"; +var _S = "Status"; +var _SA = "StartAfter"; +var _SAK = "SecretAccessKey"; +var _SBD = "S3BucketDestination"; +var _SC = "StorageClass"; +var _SCA = "StorageClassAnalysis"; +var _SCADE = "StorageClassAnalysisDataExport"; +var _SCASV = "StorageClassAnalysisSchemaVersion"; +var _SCt = "StatusCode"; +var _SDV = "SkipDestinationValidation"; +var _SK = "SSE-KMS"; +var _SKEO = "SseKmsEncryptedObjects"; +var _SKEOS = "SseKmsEncryptedObjectsStatus"; +var _SKF = "S3KeyFilter"; +var _SKe = "S3Key"; +var _SL = "S3Location"; +var _SM = "SessionMode"; +var _SOCR = "SelectObjectContentRequest"; +var _SP = "SelectParameters"; +var _SPi = "SimplePrefix"; +var _SR = "ScanRange"; +var _SS = "SSE-S3"; +var _SSC = "SourceSelectionCriteria"; +var _SSE = "ServerSideEncryption"; +var _SSEA = "SSEAlgorithm"; +var _SSEBD = "ServerSideEncryptionByDefault"; +var _SSEC = "ServerSideEncryptionConfiguration"; +var _SSECA = "SSECustomerAlgorithm"; +var _SSECK = "SSECustomerKey"; +var _SSECKMD = "SSECustomerKeyMD5"; +var _SSEKMS = "SSEKMS"; +var _SSEKMSEC = "SSEKMSEncryptionContext"; +var _SSEKMSKI = "SSEKMSKeyId"; +var _SSER = "ServerSideEncryptionRule"; +var _SSES = "SSES3"; +var _ST = "SessionToken"; +var _S_ = "S3"; +var _Sc = "Schedule"; +var _Se = "Setting"; +var _Si = "Size"; +var _St = "Start"; +var _Su = "Suffix"; +var _T = "Tagging"; +var _TA = "TopicArn"; +var _TB = "TargetBucket"; +var _TC = "TagCount"; +var _TCo = "TopicConfiguration"; +var _TCop = "TopicConfigurations"; +var _TD = "TaggingDirective"; +var _TDMOS = "TransitionDefaultMinimumObjectSize"; +var _TG = "TargetGrants"; +var _TGa = "TargetGrant"; +var _TOKF = "TargetObjectKeyFormat"; +var _TP = "TargetPrefix"; +var _TPC = "TotalPartsCount"; +var _TS = "TagSet"; +var _TSC = "TransitionStorageClass"; +var _Ta = "Tag"; +var _Tag = "Tags"; +var _Ti = "Tier"; +var _Tie = "Tierings"; +var _Tier = "Tiering"; +var _Tim = "Time"; +var _To = "Token"; +var _Top = "Topic"; +var _Tr = "Transitions"; +var _Tra = "Transition"; +var _Ty = "Type"; +var _U = "Upload"; +var _UI = "UploadId"; +var _UIM = "UploadIdMarker"; +var _UM = "UserMetadata"; +var _URI = "URI"; +var _Up = "Uploads"; +var _V = "Version"; +var _VC = "VersionCount"; +var _VCe = "VersioningConfiguration"; +var _VI = "VersionId"; +var _VIM = "VersionIdMarker"; +var _Va = "Value"; +var _Ve = "Versions"; +var _WC = "WebsiteConfiguration"; +var _WRL = "WebsiteRedirectLocation"; +var _Y = "Years"; +var _a = "analytics"; +var _ac = "accelerate"; +var _acl = "acl"; +var _ar = "accept-ranges"; +var _at = "attributes"; +var _br = "bucket-region"; +var _c = "cors"; +var _cc = "cache-control"; +var _cd = "content-disposition"; +var _ce = "content-encoding"; +var _cl = "content-language"; +var _cl_ = "content-length"; +var _cm = "content-md5"; +var _cr = "content-range"; +var _ct = "content-type"; +var _ct_ = "continuation-token"; +var _d = "delete"; +var _de = "delimiter"; +var _e = "expires"; +var _en = "encryption"; +var _et = "encoding-type"; +var _eta = "etag"; +var _ex = "expiresstring"; +var _fo = "fetch-owner"; +var _i = "id"; +var _im = "if-match"; +var _ims = "if-modified-since"; +var _in = "inventory"; +var _inm = "if-none-match"; +var _it = "intelligent-tiering"; +var _ius = "if-unmodified-since"; +var _km = "key-marker"; +var _l = "lifecycle"; +var _lh = "legal-hold"; +var _lm = "last-modified"; +var _lo = "location"; +var _log = "logging"; +var _lt = "list-type"; +var _m = "metrics"; +var _ma = "marker"; +var _mb = "max-buckets"; +var _mdb = "max-directory-buckets"; +var _me = "member"; +var _mk = "max-keys"; +var _mp = "max-parts"; +var _mu = "max-uploads"; +var _n = "notification"; +var _oC = "ownershipControls"; +var _ol = "object-lock"; +var _p = "policy"; +var _pAB = "publicAccessBlock"; +var _pN = "partNumber"; +var _pS = "policyStatus"; +var _pnm = "part-number-marker"; +var _pr = "prefix"; +var _r = "replication"; +var _rP = "requestPayment"; +var _ra = "range"; +var _rcc = "response-cache-control"; +var _rcd = "response-content-disposition"; +var _rce = "response-content-encoding"; +var _rcl = "response-content-language"; +var _rct = "response-content-type"; +var _re = "response-expires"; +var _res = "restore"; +var _ret = "retention"; +var _s = "session"; +var _sa = "start-after"; +var _se = "select"; +var _st = "select-type"; +var _t = "tagging"; +var _to = "torrent"; +var _u = "uploads"; +var _uI = "uploadId"; +var _uim = "upload-id-marker"; +var _v = "versioning"; +var _vI = "versionId"; +var _ve = ''; +var _ver = "versions"; +var _vim = "version-id-marker"; +var _w = "website"; +var _x = "xsi:type"; +var _xaa = "x-amz-acl"; +var _xaad = "x-amz-abort-date"; +var _xaapa = "x-amz-access-point-alias"; +var _xaari = "x-amz-abort-rule-id"; +var _xaas = "x-amz-archive-status"; +var _xabgr = "x-amz-bypass-governance-retention"; +var _xabln = "x-amz-bucket-location-name"; +var _xablt = "x-amz-bucket-location-type"; +var _xabole = "x-amz-bucket-object-lock-enabled"; +var _xabolt = "x-amz-bucket-object-lock-token"; +var _xabr = "x-amz-bucket-region"; +var _xaca = "x-amz-checksum-algorithm"; +var _xacc = "x-amz-checksum-crc32"; +var _xacc_ = "x-amz-checksum-crc32c"; +var _xacm = "x-amz-checksum-mode"; +var _xacrsba = "x-amz-confirm-remove-self-bucket-access"; +var _xacs = "x-amz-checksum-sha1"; +var _xacs_ = "x-amz-checksum-sha256"; +var _xacs__ = "x-amz-copy-source"; +var _xacsim = "x-amz-copy-source-if-match"; +var _xacsims = "x-amz-copy-source-if-modified-since"; +var _xacsinm = "x-amz-copy-source-if-none-match"; +var _xacsius = "x-amz-copy-source-if-unmodified-since"; +var _xacsm = "x-amz-create-session-mode"; +var _xacsr = "x-amz-copy-source-range"; +var _xacssseca = "x-amz-copy-source-server-side-encryption-customer-algorithm"; +var _xacssseck = "x-amz-copy-source-server-side-encryption-customer-key"; +var _xacssseckm = "x-amz-copy-source-server-side-encryption-customer-key-md5"; +var _xacsvi = "x-amz-copy-source-version-id"; +var _xadm = "x-amz-delete-marker"; +var _xae = "x-amz-expiration"; +var _xaebo = "x-amz-expected-bucket-owner"; +var _xafec = "x-amz-fwd-error-code"; +var _xafem = "x-amz-fwd-error-message"; +var _xafhar = "x-amz-fwd-header-accept-ranges"; +var _xafhcc = "x-amz-fwd-header-cache-control"; +var _xafhcd = "x-amz-fwd-header-content-disposition"; +var _xafhce = "x-amz-fwd-header-content-encoding"; +var _xafhcl = "x-amz-fwd-header-content-language"; +var _xafhcr = "x-amz-fwd-header-content-range"; +var _xafhct = "x-amz-fwd-header-content-type"; +var _xafhe = "x-amz-fwd-header-etag"; +var _xafhe_ = "x-amz-fwd-header-expires"; +var _xafhlm = "x-amz-fwd-header-last-modified"; +var _xafhxacc = "x-amz-fwd-header-x-amz-checksum-crc32"; +var _xafhxacc_ = "x-amz-fwd-header-x-amz-checksum-crc32c"; +var _xafhxacs = "x-amz-fwd-header-x-amz-checksum-sha1"; +var _xafhxacs_ = "x-amz-fwd-header-x-amz-checksum-sha256"; +var _xafhxadm = "x-amz-fwd-header-x-amz-delete-marker"; +var _xafhxae = "x-amz-fwd-header-x-amz-expiration"; +var _xafhxamm = "x-amz-fwd-header-x-amz-missing-meta"; +var _xafhxampc = "x-amz-fwd-header-x-amz-mp-parts-count"; +var _xafhxaollh = "x-amz-fwd-header-x-amz-object-lock-legal-hold"; +var _xafhxaolm = "x-amz-fwd-header-x-amz-object-lock-mode"; +var _xafhxaolrud = "x-amz-fwd-header-x-amz-object-lock-retain-until-date"; +var _xafhxar = "x-amz-fwd-header-x-amz-restore"; +var _xafhxarc = "x-amz-fwd-header-x-amz-request-charged"; +var _xafhxars = "x-amz-fwd-header-x-amz-replication-status"; +var _xafhxasc = "x-amz-fwd-header-x-amz-storage-class"; +var _xafhxasse = "x-amz-fwd-header-x-amz-server-side-encryption"; +var _xafhxasseakki = "x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id"; +var _xafhxassebke = "x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled"; +var _xafhxasseca = "x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm"; +var _xafhxasseckm = "x-amz-fwd-header-x-amz-server-side-encryption-customer-key-md5"; +var _xafhxatc = "x-amz-fwd-header-x-amz-tagging-count"; +var _xafhxavi = "x-amz-fwd-header-x-amz-version-id"; +var _xafs = "x-amz-fwd-status"; +var _xagfc = "x-amz-grant-full-control"; +var _xagr = "x-amz-grant-read"; +var _xagra = "x-amz-grant-read-acp"; +var _xagw = "x-amz-grant-write"; +var _xagwa = "x-amz-grant-write-acp"; +var _xam = "x-amz-mfa"; +var _xamd = "x-amz-metadata-directive"; +var _xamm = "x-amz-missing-meta"; +var _xamp = "x-amz-max-parts"; +var _xampc = "x-amz-mp-parts-count"; +var _xaoa = "x-amz-object-attributes"; +var _xaollh = "x-amz-object-lock-legal-hold"; +var _xaolm = "x-amz-object-lock-mode"; +var _xaolrud = "x-amz-object-lock-retain-until-date"; +var _xaoo = "x-amz-object-ownership"; +var _xaooa = "x-amz-optional-object-attributes"; +var _xapnm = "x-amz-part-number-marker"; +var _xar = "x-amz-restore"; +var _xarc = "x-amz-request-charged"; +var _xarop = "x-amz-restore-output-path"; +var _xarp = "x-amz-request-payer"; +var _xarr = "x-amz-request-route"; +var _xars = "x-amz-replication-status"; +var _xart = "x-amz-request-token"; +var _xasc = "x-amz-storage-class"; +var _xasca = "x-amz-sdk-checksum-algorithm"; +var _xasdv = "x-amz-skip-destination-validation"; +var _xasebo = "x-amz-source-expected-bucket-owner"; +var _xasse = "x-amz-server-side-encryption"; +var _xasseakki = "x-amz-server-side-encryption-aws-kms-key-id"; +var _xassebke = "x-amz-server-side-encryption-bucket-key-enabled"; +var _xassec = "x-amz-server-side-encryption-context"; +var _xasseca = "x-amz-server-side-encryption-customer-algorithm"; +var _xasseck = "x-amz-server-side-encryption-customer-key"; +var _xasseckm = "x-amz-server-side-encryption-customer-key-md5"; +var _xat = "x-amz-tagging"; +var _xatc = "x-amz-tagging-count"; +var _xatd = "x-amz-tagging-directive"; +var _xatdmos = "x-amz-transition-default-minimum-object-size"; +var _xavi = "x-amz-version-id"; +var _xawrl = "x-amz-website-redirect-location"; +var _xi = "x-id"; + +// dist-es/commands/CreateSessionCommand.js +var CreateSessionCommand = class extends $Command + .classBuilder() + .ep({ + ...commonParams, + DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin(config), + ]; + }) + .s("AmazonS3", "CreateSession", {}) + .n("S3Client", "CreateSessionCommand") + .f(CreateSessionRequestFilterSensitiveLog, CreateSessionOutputFilterSensitiveLog) + .ser(se_CreateSessionCommand) + .de(de_CreateSessionCommand) + .build() {}; + +// package.json +var package_default = { + name: "@aws-sdk/client-s3", + description: "AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native", + version: "3.677.0", + scripts: { + build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "node ../../scripts/compilation/inline client-s3", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo s3", + test: "vitest run", + "test:watch": "vitest watch", + "test:e2e": "vitest run -c vitest.config.e2e.ts && yarn test:browser", + "test:browser": "node ./test/browser-build/esbuild && vitest run -c vitest.config.browser.ts", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts", + }, + main: "./dist-cjs/index.js", + types: "./dist-types/index.d.ts", + module: "./dist-es/index.js", + sideEffects: false, + dependencies: { + "@aws-crypto/sha1-browser": "5.2.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "*", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-bucket-endpoint": "*", + "@aws-sdk/middleware-expect-continue": "*", + "@aws-sdk/middleware-flexible-checksums": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-location-constraint": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-sdk-s3": "*", + "@aws-sdk/middleware-ssec": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/signature-v4-multi-region": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@aws-sdk/xml-builder": "*", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/eventstream-serde-browser": "^3.0.10", + "@smithy/eventstream-serde-config-resolver": "^3.0.7", + "@smithy/eventstream-serde-node": "^3.0.9", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-blob-browser": "^3.1.6", + "@smithy/hash-node": "^3.0.7", + "@smithy/hash-stream-node": "^3.1.6", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/md5-js": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-stream": "^3.1.9", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.6", + tslib: "^2.6.2", + }, + devDependencies: { + "@aws-sdk/signature-v4-crt": "*", + "@tsconfig/node16": "16.1.3", + "@types/chai": "^4.2.11", + "@types/mocha": "^8.0.4", + "@types/node": "^16.18.96", + concurrently: "7.0.0", + "downlevel-dts": "0.10.1", + rimraf: "3.0.2", + typescript: "~4.9.5", + }, + engines: { + node: ">=16.0.0", + }, + typesVersions: { + "<4.0": { + "dist-types/*": ["dist-types/ts3.4/*"], + }, + }, + files: ["dist-*/**"], + author: { + name: "AWS SDK for JavaScript Team", + url: "https://aws.amazon.com/javascript/", + }, + license: "Apache-2.0", + browser: { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser", + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native", + }, + homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3", + repository: { + type: "git", + url: "https://github.com/aws/aws-sdk-js-v3.git", + directory: "clients/client-s3", + }, +}; + +// dist-es/runtimeConfig.browser.js +import { Sha1 } from "@aws-crypto/sha1-browser"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { blobHasher as streamHasher } from "@smithy/hash-blob-browser"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { Md5 } from "@smithy/md5-js"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; + +// dist-es/runtimeConfig.shared.js +import { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { SignatureV4MultiRegion } from "@aws-sdk/signature-v4-multi-region"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { getAwsChunkedEncodingStream, sdkStreamMixin } from "@smithy/util-stream"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; +var getRuntimeConfig = (config) => { + return { + apiVersion: "2006-03-01", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? getAwsChunkedEncodingStream, + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultS3HttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + { + schemeId: "aws.auth#sigv4a", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), + signer: new AwsSdkSigV4ASigner(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin, + serviceId: config?.serviceId ?? "S3", + signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion, + signingEscapePath: config?.signingEscapePath ?? false, + urlParser: config?.urlParser ?? parseUrl, + useArnRegion: config?.useArnRegion ?? false, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; + +// dist-es/runtimeConfig.browser.js +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; +var getRuntimeConfig2 = (config) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ + serviceId: clientSharedValues.serviceId, + clientVersion: package_default.version, + }), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + md5: config?.md5 ?? Md5, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha1: config?.sha1 ?? Sha1, + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; + +// dist-es/runtimeExtensions.js +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +// dist-es/auth/httpAuthExtensionConfiguration.js +var getHttpAuthExtensionConfiguration = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider) { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + }, + }; +}; +var resolveHttpAuthRuntimeConfig = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; + +// dist-es/runtimeExtensions.js +var asPartial = (t2) => t2; +var resolveRuntimeExtensions = (runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), + ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)), + }; + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), + ...resolveDefaultRuntimeConfig(extensionConfiguration), + ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration), + }; +}; + +// dist-es/S3Client.js +var S3Client = class extends __Client { + constructor(...[configuration]) { + const _config_0 = getRuntimeConfig2(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveFlexibleChecksumsConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveRegionConfig(_config_4); + const _config_6 = resolveHostHeaderConfig(_config_5); + const _config_7 = resolveEndpointConfig(_config_6); + const _config_8 = resolveEventStreamSerdeConfig(_config_7); + const _config_9 = resolveHttpAuthSchemeConfig(_config_8); + const _config_10 = resolveS3Config(_config_9, { session: [() => this, CreateSessionCommand] }); + const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []); + super(_config_11); + this.config = _config_11; + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultS3HttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + "aws.auth#sigv4a": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + this.middlewareStack.use(getValidateBucketNamePlugin(this.config)); + this.middlewareStack.use(getAddExpectContinuePlugin(this.config)); + this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config)); + this.middlewareStack.use(getS3ExpressPlugin(this.config)); + this.middlewareStack.use(getS3ExpressHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } +}; + +// dist-es/S3.js +import { createAggregatedClient } from "@smithy/smithy-client"; + +// dist-es/commands/AbortMultipartUploadCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin2 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin2 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin2 } from "@smithy/middleware-serde"; +import { Command as $Command2 } from "@smithy/smithy-client"; +var AbortMultipartUploadCommand = class extends $Command2 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin2(config, this.serialize, this.deserialize), + getEndpointPlugin2(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin2(config), + ]; + }) + .s("AmazonS3", "AbortMultipartUpload", {}) + .n("S3Client", "AbortMultipartUploadCommand") + .f(void 0, void 0) + .ser(se_AbortMultipartUploadCommand) + .de(de_AbortMultipartUploadCommand) + .build() {}; + +// dist-es/commands/CompleteMultipartUploadCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin3 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin3 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin3 } from "@smithy/middleware-serde"; +import { Command as $Command3 } from "@smithy/smithy-client"; +var CompleteMultipartUploadCommand = class extends $Command3 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin3(config, this.serialize, this.deserialize), + getEndpointPlugin3(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin3(config), + getSsecPlugin(config), + ]; + }) + .s("AmazonS3", "CompleteMultipartUpload", {}) + .n("S3Client", "CompleteMultipartUploadCommand") + .f(CompleteMultipartUploadRequestFilterSensitiveLog, CompleteMultipartUploadOutputFilterSensitiveLog) + .ser(se_CompleteMultipartUploadCommand) + .de(de_CompleteMultipartUploadCommand) + .build() {}; + +// dist-es/commands/CopyObjectCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin4 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin2 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin4 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin4 } from "@smithy/middleware-serde"; +import { Command as $Command4 } from "@smithy/smithy-client"; +var CopyObjectCommand = class extends $Command4 + .classBuilder() + .ep({ + ...commonParams, + DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + CopySource: { type: "contextParams", name: "CopySource" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin4(config, this.serialize, this.deserialize), + getEndpointPlugin4(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin4(config), + getSsecPlugin2(config), + ]; + }) + .s("AmazonS3", "CopyObject", {}) + .n("S3Client", "CopyObjectCommand") + .f(CopyObjectRequestFilterSensitiveLog, CopyObjectOutputFilterSensitiveLog) + .ser(se_CopyObjectCommand) + .de(de_CopyObjectCommand) + .build() {}; + +// dist-es/commands/CreateBucketCommand.js +import { getLocationConstraintPlugin } from "@aws-sdk/middleware-location-constraint"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin5 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin5 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin5 } from "@smithy/middleware-serde"; +import { Command as $Command5 } from "@smithy/smithy-client"; +var CreateBucketCommand = class extends $Command5 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + DisableAccessPoints: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin5(config, this.serialize, this.deserialize), + getEndpointPlugin5(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin5(config), + getLocationConstraintPlugin(config), + ]; + }) + .s("AmazonS3", "CreateBucket", {}) + .n("S3Client", "CreateBucketCommand") + .f(void 0, void 0) + .ser(se_CreateBucketCommand) + .de(de_CreateBucketCommand) + .build() {}; + +// dist-es/commands/CreateMultipartUploadCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin6 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin3 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin6 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin6 } from "@smithy/middleware-serde"; +import { Command as $Command6 } from "@smithy/smithy-client"; +var CreateMultipartUploadCommand = class extends $Command6 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin6(config, this.serialize, this.deserialize), + getEndpointPlugin6(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin6(config), + getSsecPlugin3(config), + ]; + }) + .s("AmazonS3", "CreateMultipartUpload", {}) + .n("S3Client", "CreateMultipartUploadCommand") + .f(CreateMultipartUploadRequestFilterSensitiveLog, CreateMultipartUploadOutputFilterSensitiveLog) + .ser(se_CreateMultipartUploadCommand) + .de(de_CreateMultipartUploadCommand) + .build() {}; + +// dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin7 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin7 } from "@smithy/middleware-serde"; +import { Command as $Command7 } from "@smithy/smithy-client"; +var DeleteBucketAnalyticsConfigurationCommand = class extends $Command7 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin7(config, this.serialize, this.deserialize), + getEndpointPlugin7(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketAnalyticsConfiguration", {}) + .n("S3Client", "DeleteBucketAnalyticsConfigurationCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketAnalyticsConfigurationCommand) + .de(de_DeleteBucketAnalyticsConfigurationCommand) + .build() {}; + +// dist-es/commands/DeleteBucketCommand.js +import { getEndpointPlugin as getEndpointPlugin8 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin8 } from "@smithy/middleware-serde"; +import { Command as $Command8 } from "@smithy/smithy-client"; +var DeleteBucketCommand = class extends $Command8 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin8(config, this.serialize, this.deserialize), + getEndpointPlugin8(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucket", {}) + .n("S3Client", "DeleteBucketCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketCommand) + .de(de_DeleteBucketCommand) + .build() {}; + +// dist-es/commands/DeleteBucketCorsCommand.js +import { getEndpointPlugin as getEndpointPlugin9 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin9 } from "@smithy/middleware-serde"; +import { Command as $Command9 } from "@smithy/smithy-client"; +var DeleteBucketCorsCommand = class extends $Command9 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin9(config, this.serialize, this.deserialize), + getEndpointPlugin9(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketCors", {}) + .n("S3Client", "DeleteBucketCorsCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketCorsCommand) + .de(de_DeleteBucketCorsCommand) + .build() {}; + +// dist-es/commands/DeleteBucketEncryptionCommand.js +import { getEndpointPlugin as getEndpointPlugin10 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin10 } from "@smithy/middleware-serde"; +import { Command as $Command10 } from "@smithy/smithy-client"; +var DeleteBucketEncryptionCommand = class extends $Command10 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin10(config, this.serialize, this.deserialize), + getEndpointPlugin10(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketEncryption", {}) + .n("S3Client", "DeleteBucketEncryptionCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketEncryptionCommand) + .de(de_DeleteBucketEncryptionCommand) + .build() {}; + +// dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin11 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin11 } from "@smithy/middleware-serde"; +import { Command as $Command11 } from "@smithy/smithy-client"; +var DeleteBucketIntelligentTieringConfigurationCommand = class extends $Command11 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin11(config, this.serialize, this.deserialize), + getEndpointPlugin11(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketIntelligentTieringConfiguration", {}) + .n("S3Client", "DeleteBucketIntelligentTieringConfigurationCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketIntelligentTieringConfigurationCommand) + .de(de_DeleteBucketIntelligentTieringConfigurationCommand) + .build() {}; + +// dist-es/commands/DeleteBucketInventoryConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin12 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin12 } from "@smithy/middleware-serde"; +import { Command as $Command12 } from "@smithy/smithy-client"; +var DeleteBucketInventoryConfigurationCommand = class extends $Command12 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin12(config, this.serialize, this.deserialize), + getEndpointPlugin12(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketInventoryConfiguration", {}) + .n("S3Client", "DeleteBucketInventoryConfigurationCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketInventoryConfigurationCommand) + .de(de_DeleteBucketInventoryConfigurationCommand) + .build() {}; + +// dist-es/commands/DeleteBucketLifecycleCommand.js +import { getEndpointPlugin as getEndpointPlugin13 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin13 } from "@smithy/middleware-serde"; +import { Command as $Command13 } from "@smithy/smithy-client"; +var DeleteBucketLifecycleCommand = class extends $Command13 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin13(config, this.serialize, this.deserialize), + getEndpointPlugin13(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketLifecycle", {}) + .n("S3Client", "DeleteBucketLifecycleCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketLifecycleCommand) + .de(de_DeleteBucketLifecycleCommand) + .build() {}; + +// dist-es/commands/DeleteBucketMetricsConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin14 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin14 } from "@smithy/middleware-serde"; +import { Command as $Command14 } from "@smithy/smithy-client"; +var DeleteBucketMetricsConfigurationCommand = class extends $Command14 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin14(config, this.serialize, this.deserialize), + getEndpointPlugin14(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketMetricsConfiguration", {}) + .n("S3Client", "DeleteBucketMetricsConfigurationCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketMetricsConfigurationCommand) + .de(de_DeleteBucketMetricsConfigurationCommand) + .build() {}; + +// dist-es/commands/DeleteBucketOwnershipControlsCommand.js +import { getEndpointPlugin as getEndpointPlugin15 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin15 } from "@smithy/middleware-serde"; +import { Command as $Command15 } from "@smithy/smithy-client"; +var DeleteBucketOwnershipControlsCommand = class extends $Command15 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin15(config, this.serialize, this.deserialize), + getEndpointPlugin15(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketOwnershipControls", {}) + .n("S3Client", "DeleteBucketOwnershipControlsCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketOwnershipControlsCommand) + .de(de_DeleteBucketOwnershipControlsCommand) + .build() {}; + +// dist-es/commands/DeleteBucketPolicyCommand.js +import { getEndpointPlugin as getEndpointPlugin16 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin16 } from "@smithy/middleware-serde"; +import { Command as $Command16 } from "@smithy/smithy-client"; +var DeleteBucketPolicyCommand = class extends $Command16 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin16(config, this.serialize, this.deserialize), + getEndpointPlugin16(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketPolicy", {}) + .n("S3Client", "DeleteBucketPolicyCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketPolicyCommand) + .de(de_DeleteBucketPolicyCommand) + .build() {}; + +// dist-es/commands/DeleteBucketReplicationCommand.js +import { getEndpointPlugin as getEndpointPlugin17 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin17 } from "@smithy/middleware-serde"; +import { Command as $Command17 } from "@smithy/smithy-client"; +var DeleteBucketReplicationCommand = class extends $Command17 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin17(config, this.serialize, this.deserialize), + getEndpointPlugin17(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketReplication", {}) + .n("S3Client", "DeleteBucketReplicationCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketReplicationCommand) + .de(de_DeleteBucketReplicationCommand) + .build() {}; + +// dist-es/commands/DeleteBucketTaggingCommand.js +import { getEndpointPlugin as getEndpointPlugin18 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin18 } from "@smithy/middleware-serde"; +import { Command as $Command18 } from "@smithy/smithy-client"; +var DeleteBucketTaggingCommand = class extends $Command18 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin18(config, this.serialize, this.deserialize), + getEndpointPlugin18(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketTagging", {}) + .n("S3Client", "DeleteBucketTaggingCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketTaggingCommand) + .de(de_DeleteBucketTaggingCommand) + .build() {}; + +// dist-es/commands/DeleteBucketWebsiteCommand.js +import { getEndpointPlugin as getEndpointPlugin19 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin19 } from "@smithy/middleware-serde"; +import { Command as $Command19 } from "@smithy/smithy-client"; +var DeleteBucketWebsiteCommand = class extends $Command19 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin19(config, this.serialize, this.deserialize), + getEndpointPlugin19(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeleteBucketWebsite", {}) + .n("S3Client", "DeleteBucketWebsiteCommand") + .f(void 0, void 0) + .ser(se_DeleteBucketWebsiteCommand) + .de(de_DeleteBucketWebsiteCommand) + .build() {}; + +// dist-es/commands/DeleteObjectCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin7 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin20 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin20 } from "@smithy/middleware-serde"; +import { Command as $Command20 } from "@smithy/smithy-client"; +var DeleteObjectCommand = class extends $Command20 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin20(config, this.serialize, this.deserialize), + getEndpointPlugin20(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin7(config), + ]; + }) + .s("AmazonS3", "DeleteObject", {}) + .n("S3Client", "DeleteObjectCommand") + .f(void 0, void 0) + .ser(se_DeleteObjectCommand) + .de(de_DeleteObjectCommand) + .build() {}; + +// dist-es/commands/DeleteObjectsCommand.js +import { getFlexibleChecksumsPlugin } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin8 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin21 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin21 } from "@smithy/middleware-serde"; +import { Command as $Command21 } from "@smithy/smithy-client"; +var DeleteObjectsCommand = class extends $Command21 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin21(config, this.serialize, this.deserialize), + getEndpointPlugin21(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin8(config), + ]; + }) + .s("AmazonS3", "DeleteObjects", {}) + .n("S3Client", "DeleteObjectsCommand") + .f(void 0, void 0) + .ser(se_DeleteObjectsCommand) + .de(de_DeleteObjectsCommand) + .build() {}; + +// dist-es/commands/DeleteObjectTaggingCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin9 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin22 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin22 } from "@smithy/middleware-serde"; +import { Command as $Command22 } from "@smithy/smithy-client"; +var DeleteObjectTaggingCommand = class extends $Command22 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin22(config, this.serialize, this.deserialize), + getEndpointPlugin22(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin9(config), + ]; + }) + .s("AmazonS3", "DeleteObjectTagging", {}) + .n("S3Client", "DeleteObjectTaggingCommand") + .f(void 0, void 0) + .ser(se_DeleteObjectTaggingCommand) + .de(de_DeleteObjectTaggingCommand) + .build() {}; + +// dist-es/commands/DeletePublicAccessBlockCommand.js +import { getEndpointPlugin as getEndpointPlugin23 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin23 } from "@smithy/middleware-serde"; +import { Command as $Command23 } from "@smithy/smithy-client"; +var DeletePublicAccessBlockCommand = class extends $Command23 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin23(config, this.serialize, this.deserialize), + getEndpointPlugin23(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "DeletePublicAccessBlock", {}) + .n("S3Client", "DeletePublicAccessBlockCommand") + .f(void 0, void 0) + .ser(se_DeletePublicAccessBlockCommand) + .de(de_DeletePublicAccessBlockCommand) + .build() {}; + +// dist-es/commands/GetBucketAccelerateConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin10 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin24 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin24 } from "@smithy/middleware-serde"; +import { Command as $Command24 } from "@smithy/smithy-client"; +var GetBucketAccelerateConfigurationCommand = class extends $Command24 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin24(config, this.serialize, this.deserialize), + getEndpointPlugin24(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin10(config), + ]; + }) + .s("AmazonS3", "GetBucketAccelerateConfiguration", {}) + .n("S3Client", "GetBucketAccelerateConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetBucketAccelerateConfigurationCommand) + .de(de_GetBucketAccelerateConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketAclCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin11 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin25 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin25 } from "@smithy/middleware-serde"; +import { Command as $Command25 } from "@smithy/smithy-client"; +var GetBucketAclCommand = class extends $Command25 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin25(config, this.serialize, this.deserialize), + getEndpointPlugin25(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin11(config), + ]; + }) + .s("AmazonS3", "GetBucketAcl", {}) + .n("S3Client", "GetBucketAclCommand") + .f(void 0, void 0) + .ser(se_GetBucketAclCommand) + .de(de_GetBucketAclCommand) + .build() {}; + +// dist-es/commands/GetBucketAnalyticsConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin12 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin26 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin26 } from "@smithy/middleware-serde"; +import { Command as $Command26 } from "@smithy/smithy-client"; +var GetBucketAnalyticsConfigurationCommand = class extends $Command26 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin26(config, this.serialize, this.deserialize), + getEndpointPlugin26(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin12(config), + ]; + }) + .s("AmazonS3", "GetBucketAnalyticsConfiguration", {}) + .n("S3Client", "GetBucketAnalyticsConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetBucketAnalyticsConfigurationCommand) + .de(de_GetBucketAnalyticsConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketCorsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin13 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin27 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin27 } from "@smithy/middleware-serde"; +import { Command as $Command27 } from "@smithy/smithy-client"; +var GetBucketCorsCommand = class extends $Command27 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin27(config, this.serialize, this.deserialize), + getEndpointPlugin27(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin13(config), + ]; + }) + .s("AmazonS3", "GetBucketCors", {}) + .n("S3Client", "GetBucketCorsCommand") + .f(void 0, void 0) + .ser(se_GetBucketCorsCommand) + .de(de_GetBucketCorsCommand) + .build() {}; + +// dist-es/commands/GetBucketEncryptionCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin14 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin28 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin28 } from "@smithy/middleware-serde"; +import { Command as $Command28 } from "@smithy/smithy-client"; +var GetBucketEncryptionCommand = class extends $Command28 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin28(config, this.serialize, this.deserialize), + getEndpointPlugin28(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin14(config), + ]; + }) + .s("AmazonS3", "GetBucketEncryption", {}) + .n("S3Client", "GetBucketEncryptionCommand") + .f(void 0, GetBucketEncryptionOutputFilterSensitiveLog) + .ser(se_GetBucketEncryptionCommand) + .de(de_GetBucketEncryptionCommand) + .build() {}; + +// dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin15 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin29 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin29 } from "@smithy/middleware-serde"; +import { Command as $Command29 } from "@smithy/smithy-client"; +var GetBucketIntelligentTieringConfigurationCommand = class extends $Command29 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin29(config, this.serialize, this.deserialize), + getEndpointPlugin29(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin15(config), + ]; + }) + .s("AmazonS3", "GetBucketIntelligentTieringConfiguration", {}) + .n("S3Client", "GetBucketIntelligentTieringConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetBucketIntelligentTieringConfigurationCommand) + .de(de_GetBucketIntelligentTieringConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketInventoryConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin16 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin30 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin30 } from "@smithy/middleware-serde"; +import { Command as $Command30 } from "@smithy/smithy-client"; +var GetBucketInventoryConfigurationCommand = class extends $Command30 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin30(config, this.serialize, this.deserialize), + getEndpointPlugin30(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin16(config), + ]; + }) + .s("AmazonS3", "GetBucketInventoryConfiguration", {}) + .n("S3Client", "GetBucketInventoryConfigurationCommand") + .f(void 0, GetBucketInventoryConfigurationOutputFilterSensitiveLog) + .ser(se_GetBucketInventoryConfigurationCommand) + .de(de_GetBucketInventoryConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketLifecycleConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin17 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin31 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin31 } from "@smithy/middleware-serde"; +import { Command as $Command31 } from "@smithy/smithy-client"; +var GetBucketLifecycleConfigurationCommand = class extends $Command31 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin31(config, this.serialize, this.deserialize), + getEndpointPlugin31(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin17(config), + ]; + }) + .s("AmazonS3", "GetBucketLifecycleConfiguration", {}) + .n("S3Client", "GetBucketLifecycleConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetBucketLifecycleConfigurationCommand) + .de(de_GetBucketLifecycleConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketLocationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin18 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin32 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin32 } from "@smithy/middleware-serde"; +import { Command as $Command32 } from "@smithy/smithy-client"; +var GetBucketLocationCommand = class extends $Command32 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin32(config, this.serialize, this.deserialize), + getEndpointPlugin32(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin18(config), + ]; + }) + .s("AmazonS3", "GetBucketLocation", {}) + .n("S3Client", "GetBucketLocationCommand") + .f(void 0, void 0) + .ser(se_GetBucketLocationCommand) + .de(de_GetBucketLocationCommand) + .build() {}; + +// dist-es/commands/GetBucketLoggingCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin19 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin33 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin33 } from "@smithy/middleware-serde"; +import { Command as $Command33 } from "@smithy/smithy-client"; +var GetBucketLoggingCommand = class extends $Command33 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin33(config, this.serialize, this.deserialize), + getEndpointPlugin33(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin19(config), + ]; + }) + .s("AmazonS3", "GetBucketLogging", {}) + .n("S3Client", "GetBucketLoggingCommand") + .f(void 0, void 0) + .ser(se_GetBucketLoggingCommand) + .de(de_GetBucketLoggingCommand) + .build() {}; + +// dist-es/commands/GetBucketMetricsConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin20 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin34 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin34 } from "@smithy/middleware-serde"; +import { Command as $Command34 } from "@smithy/smithy-client"; +var GetBucketMetricsConfigurationCommand = class extends $Command34 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin34(config, this.serialize, this.deserialize), + getEndpointPlugin34(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin20(config), + ]; + }) + .s("AmazonS3", "GetBucketMetricsConfiguration", {}) + .n("S3Client", "GetBucketMetricsConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetBucketMetricsConfigurationCommand) + .de(de_GetBucketMetricsConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketNotificationConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin21 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin35 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin35 } from "@smithy/middleware-serde"; +import { Command as $Command35 } from "@smithy/smithy-client"; +var GetBucketNotificationConfigurationCommand = class extends $Command35 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin35(config, this.serialize, this.deserialize), + getEndpointPlugin35(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin21(config), + ]; + }) + .s("AmazonS3", "GetBucketNotificationConfiguration", {}) + .n("S3Client", "GetBucketNotificationConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetBucketNotificationConfigurationCommand) + .de(de_GetBucketNotificationConfigurationCommand) + .build() {}; + +// dist-es/commands/GetBucketOwnershipControlsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin22 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin36 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin36 } from "@smithy/middleware-serde"; +import { Command as $Command36 } from "@smithy/smithy-client"; +var GetBucketOwnershipControlsCommand = class extends $Command36 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin36(config, this.serialize, this.deserialize), + getEndpointPlugin36(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin22(config), + ]; + }) + .s("AmazonS3", "GetBucketOwnershipControls", {}) + .n("S3Client", "GetBucketOwnershipControlsCommand") + .f(void 0, void 0) + .ser(se_GetBucketOwnershipControlsCommand) + .de(de_GetBucketOwnershipControlsCommand) + .build() {}; + +// dist-es/commands/GetBucketPolicyCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin23 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin37 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin37 } from "@smithy/middleware-serde"; +import { Command as $Command37 } from "@smithy/smithy-client"; +var GetBucketPolicyCommand = class extends $Command37 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin37(config, this.serialize, this.deserialize), + getEndpointPlugin37(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin23(config), + ]; + }) + .s("AmazonS3", "GetBucketPolicy", {}) + .n("S3Client", "GetBucketPolicyCommand") + .f(void 0, void 0) + .ser(se_GetBucketPolicyCommand) + .de(de_GetBucketPolicyCommand) + .build() {}; + +// dist-es/commands/GetBucketPolicyStatusCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin24 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin38 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin38 } from "@smithy/middleware-serde"; +import { Command as $Command38 } from "@smithy/smithy-client"; +var GetBucketPolicyStatusCommand = class extends $Command38 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin38(config, this.serialize, this.deserialize), + getEndpointPlugin38(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin24(config), + ]; + }) + .s("AmazonS3", "GetBucketPolicyStatus", {}) + .n("S3Client", "GetBucketPolicyStatusCommand") + .f(void 0, void 0) + .ser(se_GetBucketPolicyStatusCommand) + .de(de_GetBucketPolicyStatusCommand) + .build() {}; + +// dist-es/commands/GetBucketReplicationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin25 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin39 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin39 } from "@smithy/middleware-serde"; +import { Command as $Command39 } from "@smithy/smithy-client"; +var GetBucketReplicationCommand = class extends $Command39 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin39(config, this.serialize, this.deserialize), + getEndpointPlugin39(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin25(config), + ]; + }) + .s("AmazonS3", "GetBucketReplication", {}) + .n("S3Client", "GetBucketReplicationCommand") + .f(void 0, void 0) + .ser(se_GetBucketReplicationCommand) + .de(de_GetBucketReplicationCommand) + .build() {}; + +// dist-es/commands/GetBucketRequestPaymentCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin26 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin40 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin40 } from "@smithy/middleware-serde"; +import { Command as $Command40 } from "@smithy/smithy-client"; +var GetBucketRequestPaymentCommand = class extends $Command40 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin40(config, this.serialize, this.deserialize), + getEndpointPlugin40(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin26(config), + ]; + }) + .s("AmazonS3", "GetBucketRequestPayment", {}) + .n("S3Client", "GetBucketRequestPaymentCommand") + .f(void 0, void 0) + .ser(se_GetBucketRequestPaymentCommand) + .de(de_GetBucketRequestPaymentCommand) + .build() {}; + +// dist-es/commands/GetBucketTaggingCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin27 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin41 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin41 } from "@smithy/middleware-serde"; +import { Command as $Command41 } from "@smithy/smithy-client"; +var GetBucketTaggingCommand = class extends $Command41 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin41(config, this.serialize, this.deserialize), + getEndpointPlugin41(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin27(config), + ]; + }) + .s("AmazonS3", "GetBucketTagging", {}) + .n("S3Client", "GetBucketTaggingCommand") + .f(void 0, void 0) + .ser(se_GetBucketTaggingCommand) + .de(de_GetBucketTaggingCommand) + .build() {}; + +// dist-es/commands/GetBucketVersioningCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin28 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin42 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin42 } from "@smithy/middleware-serde"; +import { Command as $Command42 } from "@smithy/smithy-client"; +var GetBucketVersioningCommand = class extends $Command42 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin42(config, this.serialize, this.deserialize), + getEndpointPlugin42(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin28(config), + ]; + }) + .s("AmazonS3", "GetBucketVersioning", {}) + .n("S3Client", "GetBucketVersioningCommand") + .f(void 0, void 0) + .ser(se_GetBucketVersioningCommand) + .de(de_GetBucketVersioningCommand) + .build() {}; + +// dist-es/commands/GetBucketWebsiteCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin29 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin43 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin43 } from "@smithy/middleware-serde"; +import { Command as $Command43 } from "@smithy/smithy-client"; +var GetBucketWebsiteCommand = class extends $Command43 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin43(config, this.serialize, this.deserialize), + getEndpointPlugin43(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin29(config), + ]; + }) + .s("AmazonS3", "GetBucketWebsite", {}) + .n("S3Client", "GetBucketWebsiteCommand") + .f(void 0, void 0) + .ser(se_GetBucketWebsiteCommand) + .de(de_GetBucketWebsiteCommand) + .build() {}; + +// dist-es/commands/GetObjectAclCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin30 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin44 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin44 } from "@smithy/middleware-serde"; +import { Command as $Command44 } from "@smithy/smithy-client"; +var GetObjectAclCommand = class extends $Command44 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin44(config, this.serialize, this.deserialize), + getEndpointPlugin44(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin30(config), + ]; + }) + .s("AmazonS3", "GetObjectAcl", {}) + .n("S3Client", "GetObjectAclCommand") + .f(void 0, void 0) + .ser(se_GetObjectAclCommand) + .de(de_GetObjectAclCommand) + .build() {}; + +// dist-es/commands/GetObjectAttributesCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin31 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin4 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin45 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin45 } from "@smithy/middleware-serde"; +import { Command as $Command45 } from "@smithy/smithy-client"; +var GetObjectAttributesCommand = class extends $Command45 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin45(config, this.serialize, this.deserialize), + getEndpointPlugin45(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin31(config), + getSsecPlugin4(config), + ]; + }) + .s("AmazonS3", "GetObjectAttributes", {}) + .n("S3Client", "GetObjectAttributesCommand") + .f(GetObjectAttributesRequestFilterSensitiveLog, void 0) + .ser(se_GetObjectAttributesCommand) + .de(de_GetObjectAttributesCommand) + .build() {}; + +// dist-es/commands/GetObjectCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin2 } from "@aws-sdk/middleware-flexible-checksums"; +import { getS3ExpiresMiddlewarePlugin } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin5 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin46 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin46 } from "@smithy/middleware-serde"; +import { Command as $Command46 } from "@smithy/smithy-client"; +var GetObjectCommand = class extends $Command46 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin46(config, this.serialize, this.deserialize), + getEndpointPlugin46(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin2(config, { + input: this.input, + requestChecksumRequired: false, + requestValidationModeMember: "ChecksumMode", + responseAlgorithms: ["CRC32", "CRC32C", "SHA256", "SHA1"], + }), + getSsecPlugin5(config), + getS3ExpiresMiddlewarePlugin(config), + ]; + }) + .s("AmazonS3", "GetObject", {}) + .n("S3Client", "GetObjectCommand") + .f(GetObjectRequestFilterSensitiveLog, GetObjectOutputFilterSensitiveLog) + .ser(se_GetObjectCommand) + .de(de_GetObjectCommand) + .build() {}; + +// dist-es/commands/GetObjectLegalHoldCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin32 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin47 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin47 } from "@smithy/middleware-serde"; +import { Command as $Command47 } from "@smithy/smithy-client"; +var GetObjectLegalHoldCommand = class extends $Command47 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin47(config, this.serialize, this.deserialize), + getEndpointPlugin47(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin32(config), + ]; + }) + .s("AmazonS3", "GetObjectLegalHold", {}) + .n("S3Client", "GetObjectLegalHoldCommand") + .f(void 0, void 0) + .ser(se_GetObjectLegalHoldCommand) + .de(de_GetObjectLegalHoldCommand) + .build() {}; + +// dist-es/commands/GetObjectLockConfigurationCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin33 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin48 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin48 } from "@smithy/middleware-serde"; +import { Command as $Command48 } from "@smithy/smithy-client"; +var GetObjectLockConfigurationCommand = class extends $Command48 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin48(config, this.serialize, this.deserialize), + getEndpointPlugin48(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin33(config), + ]; + }) + .s("AmazonS3", "GetObjectLockConfiguration", {}) + .n("S3Client", "GetObjectLockConfigurationCommand") + .f(void 0, void 0) + .ser(se_GetObjectLockConfigurationCommand) + .de(de_GetObjectLockConfigurationCommand) + .build() {}; + +// dist-es/commands/GetObjectRetentionCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin34 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin49 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin49 } from "@smithy/middleware-serde"; +import { Command as $Command49 } from "@smithy/smithy-client"; +var GetObjectRetentionCommand = class extends $Command49 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin49(config, this.serialize, this.deserialize), + getEndpointPlugin49(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin34(config), + ]; + }) + .s("AmazonS3", "GetObjectRetention", {}) + .n("S3Client", "GetObjectRetentionCommand") + .f(void 0, void 0) + .ser(se_GetObjectRetentionCommand) + .de(de_GetObjectRetentionCommand) + .build() {}; + +// dist-es/commands/GetObjectTaggingCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin35 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin50 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin50 } from "@smithy/middleware-serde"; +import { Command as $Command50 } from "@smithy/smithy-client"; +var GetObjectTaggingCommand = class extends $Command50 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin50(config, this.serialize, this.deserialize), + getEndpointPlugin50(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin35(config), + ]; + }) + .s("AmazonS3", "GetObjectTagging", {}) + .n("S3Client", "GetObjectTaggingCommand") + .f(void 0, void 0) + .ser(se_GetObjectTaggingCommand) + .de(de_GetObjectTaggingCommand) + .build() {}; + +// dist-es/commands/GetObjectTorrentCommand.js +import { getEndpointPlugin as getEndpointPlugin51 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin51 } from "@smithy/middleware-serde"; +import { Command as $Command51 } from "@smithy/smithy-client"; +var GetObjectTorrentCommand = class extends $Command51 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin51(config, this.serialize, this.deserialize), + getEndpointPlugin51(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "GetObjectTorrent", {}) + .n("S3Client", "GetObjectTorrentCommand") + .f(void 0, GetObjectTorrentOutputFilterSensitiveLog) + .ser(se_GetObjectTorrentCommand) + .de(de_GetObjectTorrentCommand) + .build() {}; + +// dist-es/commands/GetPublicAccessBlockCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin36 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin52 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin52 } from "@smithy/middleware-serde"; +import { Command as $Command52 } from "@smithy/smithy-client"; +var GetPublicAccessBlockCommand = class extends $Command52 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin52(config, this.serialize, this.deserialize), + getEndpointPlugin52(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin36(config), + ]; + }) + .s("AmazonS3", "GetPublicAccessBlock", {}) + .n("S3Client", "GetPublicAccessBlockCommand") + .f(void 0, void 0) + .ser(se_GetPublicAccessBlockCommand) + .de(de_GetPublicAccessBlockCommand) + .build() {}; + +// dist-es/commands/HeadBucketCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin37 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin53 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin53 } from "@smithy/middleware-serde"; +import { Command as $Command53 } from "@smithy/smithy-client"; +var HeadBucketCommand = class extends $Command53 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin53(config, this.serialize, this.deserialize), + getEndpointPlugin53(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin37(config), + ]; + }) + .s("AmazonS3", "HeadBucket", {}) + .n("S3Client", "HeadBucketCommand") + .f(void 0, void 0) + .ser(se_HeadBucketCommand) + .de(de_HeadBucketCommand) + .build() {}; + +// dist-es/commands/HeadObjectCommand.js +import { + getS3ExpiresMiddlewarePlugin as getS3ExpiresMiddlewarePlugin2, + getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin38, +} from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin6 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin54 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin54 } from "@smithy/middleware-serde"; +import { Command as $Command54 } from "@smithy/smithy-client"; +var HeadObjectCommand = class extends $Command54 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin54(config, this.serialize, this.deserialize), + getEndpointPlugin54(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin38(config), + getSsecPlugin6(config), + getS3ExpiresMiddlewarePlugin2(config), + ]; + }) + .s("AmazonS3", "HeadObject", {}) + .n("S3Client", "HeadObjectCommand") + .f(HeadObjectRequestFilterSensitiveLog, HeadObjectOutputFilterSensitiveLog) + .ser(se_HeadObjectCommand) + .de(de_HeadObjectCommand) + .build() {}; + +// dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin39 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin55 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin55 } from "@smithy/middleware-serde"; +import { Command as $Command55 } from "@smithy/smithy-client"; +var ListBucketAnalyticsConfigurationsCommand = class extends $Command55 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin55(config, this.serialize, this.deserialize), + getEndpointPlugin55(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin39(config), + ]; + }) + .s("AmazonS3", "ListBucketAnalyticsConfigurations", {}) + .n("S3Client", "ListBucketAnalyticsConfigurationsCommand") + .f(void 0, void 0) + .ser(se_ListBucketAnalyticsConfigurationsCommand) + .de(de_ListBucketAnalyticsConfigurationsCommand) + .build() {}; + +// dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin40 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin56 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin56 } from "@smithy/middleware-serde"; +import { Command as $Command56 } from "@smithy/smithy-client"; +var ListBucketIntelligentTieringConfigurationsCommand = class extends $Command56 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin56(config, this.serialize, this.deserialize), + getEndpointPlugin56(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin40(config), + ]; + }) + .s("AmazonS3", "ListBucketIntelligentTieringConfigurations", {}) + .n("S3Client", "ListBucketIntelligentTieringConfigurationsCommand") + .f(void 0, void 0) + .ser(se_ListBucketIntelligentTieringConfigurationsCommand) + .de(de_ListBucketIntelligentTieringConfigurationsCommand) + .build() {}; + +// dist-es/commands/ListBucketInventoryConfigurationsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin41 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin57 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin57 } from "@smithy/middleware-serde"; +import { Command as $Command57 } from "@smithy/smithy-client"; +var ListBucketInventoryConfigurationsCommand = class extends $Command57 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin57(config, this.serialize, this.deserialize), + getEndpointPlugin57(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin41(config), + ]; + }) + .s("AmazonS3", "ListBucketInventoryConfigurations", {}) + .n("S3Client", "ListBucketInventoryConfigurationsCommand") + .f(void 0, ListBucketInventoryConfigurationsOutputFilterSensitiveLog) + .ser(se_ListBucketInventoryConfigurationsCommand) + .de(de_ListBucketInventoryConfigurationsCommand) + .build() {}; + +// dist-es/commands/ListBucketMetricsConfigurationsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin42 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin58 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin58 } from "@smithy/middleware-serde"; +import { Command as $Command58 } from "@smithy/smithy-client"; +var ListBucketMetricsConfigurationsCommand = class extends $Command58 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin58(config, this.serialize, this.deserialize), + getEndpointPlugin58(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin42(config), + ]; + }) + .s("AmazonS3", "ListBucketMetricsConfigurations", {}) + .n("S3Client", "ListBucketMetricsConfigurationsCommand") + .f(void 0, void 0) + .ser(se_ListBucketMetricsConfigurationsCommand) + .de(de_ListBucketMetricsConfigurationsCommand) + .build() {}; + +// dist-es/commands/ListBucketsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin43 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin59 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin59 } from "@smithy/middleware-serde"; +import { Command as $Command59 } from "@smithy/smithy-client"; +var ListBucketsCommand = class extends $Command59 + .classBuilder() + .ep(commonParams) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin59(config, this.serialize, this.deserialize), + getEndpointPlugin59(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin43(config), + ]; + }) + .s("AmazonS3", "ListBuckets", {}) + .n("S3Client", "ListBucketsCommand") + .f(void 0, void 0) + .ser(se_ListBucketsCommand) + .de(de_ListBucketsCommand) + .build() {}; + +// dist-es/commands/ListDirectoryBucketsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin44 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin60 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin60 } from "@smithy/middleware-serde"; +import { Command as $Command60 } from "@smithy/smithy-client"; +var ListDirectoryBucketsCommand = class extends $Command60 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin60(config, this.serialize, this.deserialize), + getEndpointPlugin60(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin44(config), + ]; + }) + .s("AmazonS3", "ListDirectoryBuckets", {}) + .n("S3Client", "ListDirectoryBucketsCommand") + .f(void 0, void 0) + .ser(se_ListDirectoryBucketsCommand) + .de(de_ListDirectoryBucketsCommand) + .build() {}; + +// dist-es/commands/ListMultipartUploadsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin45 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin61 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin61 } from "@smithy/middleware-serde"; +import { Command as $Command61 } from "@smithy/smithy-client"; +var ListMultipartUploadsCommand = class extends $Command61 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin61(config, this.serialize, this.deserialize), + getEndpointPlugin61(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin45(config), + ]; + }) + .s("AmazonS3", "ListMultipartUploads", {}) + .n("S3Client", "ListMultipartUploadsCommand") + .f(void 0, void 0) + .ser(se_ListMultipartUploadsCommand) + .de(de_ListMultipartUploadsCommand) + .build() {}; + +// dist-es/commands/ListObjectsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin46 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin62 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin62 } from "@smithy/middleware-serde"; +import { Command as $Command62 } from "@smithy/smithy-client"; +var ListObjectsCommand = class extends $Command62 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin62(config, this.serialize, this.deserialize), + getEndpointPlugin62(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin46(config), + ]; + }) + .s("AmazonS3", "ListObjects", {}) + .n("S3Client", "ListObjectsCommand") + .f(void 0, void 0) + .ser(se_ListObjectsCommand) + .de(de_ListObjectsCommand) + .build() {}; + +// dist-es/commands/ListObjectsV2Command.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin47 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin63 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin63 } from "@smithy/middleware-serde"; +import { Command as $Command63 } from "@smithy/smithy-client"; +var ListObjectsV2Command = class extends $Command63 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin63(config, this.serialize, this.deserialize), + getEndpointPlugin63(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin47(config), + ]; + }) + .s("AmazonS3", "ListObjectsV2", {}) + .n("S3Client", "ListObjectsV2Command") + .f(void 0, void 0) + .ser(se_ListObjectsV2Command) + .de(de_ListObjectsV2Command) + .build() {}; + +// dist-es/commands/ListObjectVersionsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin48 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin64 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin64 } from "@smithy/middleware-serde"; +import { Command as $Command64 } from "@smithy/smithy-client"; +var ListObjectVersionsCommand = class extends $Command64 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin64(config, this.serialize, this.deserialize), + getEndpointPlugin64(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin48(config), + ]; + }) + .s("AmazonS3", "ListObjectVersions", {}) + .n("S3Client", "ListObjectVersionsCommand") + .f(void 0, void 0) + .ser(se_ListObjectVersionsCommand) + .de(de_ListObjectVersionsCommand) + .build() {}; + +// dist-es/commands/ListPartsCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin49 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin7 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin65 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin65 } from "@smithy/middleware-serde"; +import { Command as $Command65 } from "@smithy/smithy-client"; +var ListPartsCommand = class extends $Command65 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin65(config, this.serialize, this.deserialize), + getEndpointPlugin65(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin49(config), + getSsecPlugin7(config), + ]; + }) + .s("AmazonS3", "ListParts", {}) + .n("S3Client", "ListPartsCommand") + .f(ListPartsRequestFilterSensitiveLog, void 0) + .ser(se_ListPartsCommand) + .de(de_ListPartsCommand) + .build() {}; + +// dist-es/commands/PutBucketAccelerateConfigurationCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin3 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin66 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin66 } from "@smithy/middleware-serde"; +import { Command as $Command66 } from "@smithy/smithy-client"; +var PutBucketAccelerateConfigurationCommand = class extends $Command66 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin66(config, this.serialize, this.deserialize), + getEndpointPlugin66(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin3(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: false, + }), + ]; + }) + .s("AmazonS3", "PutBucketAccelerateConfiguration", {}) + .n("S3Client", "PutBucketAccelerateConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutBucketAccelerateConfigurationCommand) + .de(de_PutBucketAccelerateConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketAclCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin4 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin67 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin67 } from "@smithy/middleware-serde"; +import { Command as $Command67 } from "@smithy/smithy-client"; +var PutBucketAclCommand = class extends $Command67 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin67(config, this.serialize, this.deserialize), + getEndpointPlugin67(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin4(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketAcl", {}) + .n("S3Client", "PutBucketAclCommand") + .f(void 0, void 0) + .ser(se_PutBucketAclCommand) + .de(de_PutBucketAclCommand) + .build() {}; + +// dist-es/commands/PutBucketAnalyticsConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin68 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin68 } from "@smithy/middleware-serde"; +import { Command as $Command68 } from "@smithy/smithy-client"; +var PutBucketAnalyticsConfigurationCommand = class extends $Command68 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin68(config, this.serialize, this.deserialize), + getEndpointPlugin68(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "PutBucketAnalyticsConfiguration", {}) + .n("S3Client", "PutBucketAnalyticsConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutBucketAnalyticsConfigurationCommand) + .de(de_PutBucketAnalyticsConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketCorsCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin5 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin69 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin69 } from "@smithy/middleware-serde"; +import { Command as $Command69 } from "@smithy/smithy-client"; +var PutBucketCorsCommand = class extends $Command69 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin69(config, this.serialize, this.deserialize), + getEndpointPlugin69(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin5(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketCors", {}) + .n("S3Client", "PutBucketCorsCommand") + .f(void 0, void 0) + .ser(se_PutBucketCorsCommand) + .de(de_PutBucketCorsCommand) + .build() {}; + +// dist-es/commands/PutBucketEncryptionCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin6 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin70 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin70 } from "@smithy/middleware-serde"; +import { Command as $Command70 } from "@smithy/smithy-client"; +var PutBucketEncryptionCommand = class extends $Command70 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin70(config, this.serialize, this.deserialize), + getEndpointPlugin70(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin6(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketEncryption", {}) + .n("S3Client", "PutBucketEncryptionCommand") + .f(PutBucketEncryptionRequestFilterSensitiveLog, void 0) + .ser(se_PutBucketEncryptionCommand) + .de(de_PutBucketEncryptionCommand) + .build() {}; + +// dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin71 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin71 } from "@smithy/middleware-serde"; +import { Command as $Command71 } from "@smithy/smithy-client"; +var PutBucketIntelligentTieringConfigurationCommand = class extends $Command71 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin71(config, this.serialize, this.deserialize), + getEndpointPlugin71(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "PutBucketIntelligentTieringConfiguration", {}) + .n("S3Client", "PutBucketIntelligentTieringConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutBucketIntelligentTieringConfigurationCommand) + .de(de_PutBucketIntelligentTieringConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketInventoryConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin72 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin72 } from "@smithy/middleware-serde"; +import { Command as $Command72 } from "@smithy/smithy-client"; +var PutBucketInventoryConfigurationCommand = class extends $Command72 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin72(config, this.serialize, this.deserialize), + getEndpointPlugin72(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "PutBucketInventoryConfiguration", {}) + .n("S3Client", "PutBucketInventoryConfigurationCommand") + .f(PutBucketInventoryConfigurationRequestFilterSensitiveLog, void 0) + .ser(se_PutBucketInventoryConfigurationCommand) + .de(de_PutBucketInventoryConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketLifecycleConfigurationCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin7 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin50 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin73 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin73 } from "@smithy/middleware-serde"; +import { Command as $Command73 } from "@smithy/smithy-client"; +var PutBucketLifecycleConfigurationCommand = class extends $Command73 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin73(config, this.serialize, this.deserialize), + getEndpointPlugin73(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin7(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin50(config), + ]; + }) + .s("AmazonS3", "PutBucketLifecycleConfiguration", {}) + .n("S3Client", "PutBucketLifecycleConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutBucketLifecycleConfigurationCommand) + .de(de_PutBucketLifecycleConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketLoggingCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin8 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin74 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin74 } from "@smithy/middleware-serde"; +import { Command as $Command74 } from "@smithy/smithy-client"; +var PutBucketLoggingCommand = class extends $Command74 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin74(config, this.serialize, this.deserialize), + getEndpointPlugin74(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin8(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketLogging", {}) + .n("S3Client", "PutBucketLoggingCommand") + .f(void 0, void 0) + .ser(se_PutBucketLoggingCommand) + .de(de_PutBucketLoggingCommand) + .build() {}; + +// dist-es/commands/PutBucketMetricsConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin75 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin75 } from "@smithy/middleware-serde"; +import { Command as $Command75 } from "@smithy/smithy-client"; +var PutBucketMetricsConfigurationCommand = class extends $Command75 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin75(config, this.serialize, this.deserialize), + getEndpointPlugin75(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "PutBucketMetricsConfiguration", {}) + .n("S3Client", "PutBucketMetricsConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutBucketMetricsConfigurationCommand) + .de(de_PutBucketMetricsConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketNotificationConfigurationCommand.js +import { getEndpointPlugin as getEndpointPlugin76 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin76 } from "@smithy/middleware-serde"; +import { Command as $Command76 } from "@smithy/smithy-client"; +var PutBucketNotificationConfigurationCommand = class extends $Command76 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin76(config, this.serialize, this.deserialize), + getEndpointPlugin76(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "PutBucketNotificationConfiguration", {}) + .n("S3Client", "PutBucketNotificationConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutBucketNotificationConfigurationCommand) + .de(de_PutBucketNotificationConfigurationCommand) + .build() {}; + +// dist-es/commands/PutBucketOwnershipControlsCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin9 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin77 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin77 } from "@smithy/middleware-serde"; +import { Command as $Command77 } from "@smithy/smithy-client"; +var PutBucketOwnershipControlsCommand = class extends $Command77 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin77(config, this.serialize, this.deserialize), + getEndpointPlugin77(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin9(config, { + input: this.input, + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketOwnershipControls", {}) + .n("S3Client", "PutBucketOwnershipControlsCommand") + .f(void 0, void 0) + .ser(se_PutBucketOwnershipControlsCommand) + .de(de_PutBucketOwnershipControlsCommand) + .build() {}; + +// dist-es/commands/PutBucketPolicyCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin10 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin78 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin78 } from "@smithy/middleware-serde"; +import { Command as $Command78 } from "@smithy/smithy-client"; +var PutBucketPolicyCommand = class extends $Command78 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin78(config, this.serialize, this.deserialize), + getEndpointPlugin78(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin10(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketPolicy", {}) + .n("S3Client", "PutBucketPolicyCommand") + .f(void 0, void 0) + .ser(se_PutBucketPolicyCommand) + .de(de_PutBucketPolicyCommand) + .build() {}; + +// dist-es/commands/PutBucketReplicationCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin11 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin79 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin79 } from "@smithy/middleware-serde"; +import { Command as $Command79 } from "@smithy/smithy-client"; +var PutBucketReplicationCommand = class extends $Command79 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin79(config, this.serialize, this.deserialize), + getEndpointPlugin79(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin11(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketReplication", {}) + .n("S3Client", "PutBucketReplicationCommand") + .f(void 0, void 0) + .ser(se_PutBucketReplicationCommand) + .de(de_PutBucketReplicationCommand) + .build() {}; + +// dist-es/commands/PutBucketRequestPaymentCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin12 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin80 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin80 } from "@smithy/middleware-serde"; +import { Command as $Command80 } from "@smithy/smithy-client"; +var PutBucketRequestPaymentCommand = class extends $Command80 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin80(config, this.serialize, this.deserialize), + getEndpointPlugin80(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin12(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketRequestPayment", {}) + .n("S3Client", "PutBucketRequestPaymentCommand") + .f(void 0, void 0) + .ser(se_PutBucketRequestPaymentCommand) + .de(de_PutBucketRequestPaymentCommand) + .build() {}; + +// dist-es/commands/PutBucketTaggingCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin13 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin81 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin81 } from "@smithy/middleware-serde"; +import { Command as $Command81 } from "@smithy/smithy-client"; +var PutBucketTaggingCommand = class extends $Command81 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin81(config, this.serialize, this.deserialize), + getEndpointPlugin81(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin13(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketTagging", {}) + .n("S3Client", "PutBucketTaggingCommand") + .f(void 0, void 0) + .ser(se_PutBucketTaggingCommand) + .de(de_PutBucketTaggingCommand) + .build() {}; + +// dist-es/commands/PutBucketVersioningCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin14 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin82 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin82 } from "@smithy/middleware-serde"; +import { Command as $Command82 } from "@smithy/smithy-client"; +var PutBucketVersioningCommand = class extends $Command82 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin82(config, this.serialize, this.deserialize), + getEndpointPlugin82(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin14(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketVersioning", {}) + .n("S3Client", "PutBucketVersioningCommand") + .f(void 0, void 0) + .ser(se_PutBucketVersioningCommand) + .de(de_PutBucketVersioningCommand) + .build() {}; + +// dist-es/commands/PutBucketWebsiteCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin15 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin83 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin83 } from "@smithy/middleware-serde"; +import { Command as $Command83 } from "@smithy/smithy-client"; +var PutBucketWebsiteCommand = class extends $Command83 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin83(config, this.serialize, this.deserialize), + getEndpointPlugin83(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin15(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutBucketWebsite", {}) + .n("S3Client", "PutBucketWebsiteCommand") + .f(void 0, void 0) + .ser(se_PutBucketWebsiteCommand) + .de(de_PutBucketWebsiteCommand) + .build() {}; + +// dist-es/commands/PutObjectAclCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin16 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin51 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin84 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin84 } from "@smithy/middleware-serde"; +import { Command as $Command84 } from "@smithy/smithy-client"; +var PutObjectAclCommand = class extends $Command84 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin84(config, this.serialize, this.deserialize), + getEndpointPlugin84(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin16(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin51(config), + ]; + }) + .s("AmazonS3", "PutObjectAcl", {}) + .n("S3Client", "PutObjectAclCommand") + .f(void 0, void 0) + .ser(se_PutObjectAclCommand) + .de(de_PutObjectAclCommand) + .build() {}; + +// dist-es/commands/PutObjectCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin17 } from "@aws-sdk/middleware-flexible-checksums"; +import { + getCheckContentLengthHeaderPlugin, + getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin52, +} from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin8 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin85 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin85 } from "@smithy/middleware-serde"; +import { Command as $Command85 } from "@smithy/smithy-client"; +var PutObjectCommand = class extends $Command85 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin85(config, this.serialize, this.deserialize), + getEndpointPlugin85(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin17(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: false, + }), + getCheckContentLengthHeaderPlugin(config), + getThrow200ExceptionsPlugin52(config), + getSsecPlugin8(config), + ]; + }) + .s("AmazonS3", "PutObject", {}) + .n("S3Client", "PutObjectCommand") + .f(PutObjectRequestFilterSensitiveLog, PutObjectOutputFilterSensitiveLog) + .ser(se_PutObjectCommand) + .de(de_PutObjectCommand) + .build() {}; + +// dist-es/commands/PutObjectLegalHoldCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin18 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin53 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin86 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin86 } from "@smithy/middleware-serde"; +import { Command as $Command86 } from "@smithy/smithy-client"; +var PutObjectLegalHoldCommand = class extends $Command86 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin86(config, this.serialize, this.deserialize), + getEndpointPlugin86(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin18(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin53(config), + ]; + }) + .s("AmazonS3", "PutObjectLegalHold", {}) + .n("S3Client", "PutObjectLegalHoldCommand") + .f(void 0, void 0) + .ser(se_PutObjectLegalHoldCommand) + .de(de_PutObjectLegalHoldCommand) + .build() {}; + +// dist-es/commands/PutObjectLockConfigurationCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin19 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin54 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin87 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin87 } from "@smithy/middleware-serde"; +import { Command as $Command87 } from "@smithy/smithy-client"; +var PutObjectLockConfigurationCommand = class extends $Command87 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin87(config, this.serialize, this.deserialize), + getEndpointPlugin87(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin19(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin54(config), + ]; + }) + .s("AmazonS3", "PutObjectLockConfiguration", {}) + .n("S3Client", "PutObjectLockConfigurationCommand") + .f(void 0, void 0) + .ser(se_PutObjectLockConfigurationCommand) + .de(de_PutObjectLockConfigurationCommand) + .build() {}; + +// dist-es/commands/PutObjectRetentionCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin20 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin55 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin88 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin88 } from "@smithy/middleware-serde"; +import { Command as $Command88 } from "@smithy/smithy-client"; +var PutObjectRetentionCommand = class extends $Command88 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin88(config, this.serialize, this.deserialize), + getEndpointPlugin88(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin20(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin55(config), + ]; + }) + .s("AmazonS3", "PutObjectRetention", {}) + .n("S3Client", "PutObjectRetentionCommand") + .f(void 0, void 0) + .ser(se_PutObjectRetentionCommand) + .de(de_PutObjectRetentionCommand) + .build() {}; + +// dist-es/commands/PutObjectTaggingCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin21 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin56 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin89 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin89 } from "@smithy/middleware-serde"; +import { Command as $Command89 } from "@smithy/smithy-client"; +var PutObjectTaggingCommand = class extends $Command89 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin89(config, this.serialize, this.deserialize), + getEndpointPlugin89(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin21(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + getThrow200ExceptionsPlugin56(config), + ]; + }) + .s("AmazonS3", "PutObjectTagging", {}) + .n("S3Client", "PutObjectTaggingCommand") + .f(void 0, void 0) + .ser(se_PutObjectTaggingCommand) + .de(de_PutObjectTaggingCommand) + .build() {}; + +// dist-es/commands/PutPublicAccessBlockCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin22 } from "@aws-sdk/middleware-flexible-checksums"; +import { getEndpointPlugin as getEndpointPlugin90 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin90 } from "@smithy/middleware-serde"; +import { Command as $Command90 } from "@smithy/smithy-client"; +var PutPublicAccessBlockCommand = class extends $Command90 + .classBuilder() + .ep({ + ...commonParams, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin90(config, this.serialize, this.deserialize), + getEndpointPlugin90(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin22(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: true, + }), + ]; + }) + .s("AmazonS3", "PutPublicAccessBlock", {}) + .n("S3Client", "PutPublicAccessBlockCommand") + .f(void 0, void 0) + .ser(se_PutPublicAccessBlockCommand) + .de(de_PutPublicAccessBlockCommand) + .build() {}; + +// dist-es/commands/RestoreObjectCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin23 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin57 } from "@aws-sdk/middleware-sdk-s3"; +import { getEndpointPlugin as getEndpointPlugin91 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin91 } from "@smithy/middleware-serde"; +import { Command as $Command91 } from "@smithy/smithy-client"; +var RestoreObjectCommand = class extends $Command91 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin91(config, this.serialize, this.deserialize), + getEndpointPlugin91(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin23(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: false, + }), + getThrow200ExceptionsPlugin57(config), + ]; + }) + .s("AmazonS3", "RestoreObject", {}) + .n("S3Client", "RestoreObjectCommand") + .f(RestoreObjectRequestFilterSensitiveLog, void 0) + .ser(se_RestoreObjectCommand) + .de(de_RestoreObjectCommand) + .build() {}; + +// dist-es/commands/SelectObjectContentCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin58 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin9 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin92 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin92 } from "@smithy/middleware-serde"; +import { Command as $Command92 } from "@smithy/smithy-client"; +var SelectObjectContentCommand = class extends $Command92 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin92(config, this.serialize, this.deserialize), + getEndpointPlugin92(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin58(config), + getSsecPlugin9(config), + ]; + }) + .s("AmazonS3", "SelectObjectContent", { + eventStream: { + output: true, + }, + }) + .n("S3Client", "SelectObjectContentCommand") + .f(SelectObjectContentRequestFilterSensitiveLog, SelectObjectContentOutputFilterSensitiveLog) + .ser(se_SelectObjectContentCommand) + .de(de_SelectObjectContentCommand) + .build() {}; + +// dist-es/commands/UploadPartCommand.js +import { getFlexibleChecksumsPlugin as getFlexibleChecksumsPlugin24 } from "@aws-sdk/middleware-flexible-checksums"; +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin59 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin10 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin93 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin93 } from "@smithy/middleware-serde"; +import { Command as $Command93 } from "@smithy/smithy-client"; +var UploadPartCommand = class extends $Command93 + .classBuilder() + .ep({ + ...commonParams, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin93(config, this.serialize, this.deserialize), + getEndpointPlugin93(config, Command.getEndpointParameterInstructions()), + getFlexibleChecksumsPlugin24(config, { + input: this.input, + requestAlgorithmMember: "ChecksumAlgorithm", + requestChecksumRequired: false, + }), + getThrow200ExceptionsPlugin59(config), + getSsecPlugin10(config), + ]; + }) + .s("AmazonS3", "UploadPart", {}) + .n("S3Client", "UploadPartCommand") + .f(UploadPartRequestFilterSensitiveLog, UploadPartOutputFilterSensitiveLog) + .ser(se_UploadPartCommand) + .de(de_UploadPartCommand) + .build() {}; + +// dist-es/commands/UploadPartCopyCommand.js +import { getThrow200ExceptionsPlugin as getThrow200ExceptionsPlugin60 } from "@aws-sdk/middleware-sdk-s3"; +import { getSsecPlugin as getSsecPlugin11 } from "@aws-sdk/middleware-ssec"; +import { getEndpointPlugin as getEndpointPlugin94 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin94 } from "@smithy/middleware-serde"; +import { Command as $Command94 } from "@smithy/smithy-client"; +var UploadPartCopyCommand = class extends $Command94 + .classBuilder() + .ep({ + ...commonParams, + DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin94(config, this.serialize, this.deserialize), + getEndpointPlugin94(config, Command.getEndpointParameterInstructions()), + getThrow200ExceptionsPlugin60(config), + getSsecPlugin11(config), + ]; + }) + .s("AmazonS3", "UploadPartCopy", {}) + .n("S3Client", "UploadPartCopyCommand") + .f(UploadPartCopyRequestFilterSensitiveLog, UploadPartCopyOutputFilterSensitiveLog) + .ser(se_UploadPartCopyCommand) + .de(de_UploadPartCopyCommand) + .build() {}; + +// dist-es/commands/WriteGetObjectResponseCommand.js +import { getEndpointPlugin as getEndpointPlugin95 } from "@smithy/middleware-endpoint"; +import { getSerdePlugin as getSerdePlugin95 } from "@smithy/middleware-serde"; +import { Command as $Command95 } from "@smithy/smithy-client"; +var WriteGetObjectResponseCommand = class extends $Command95 + .classBuilder() + .ep({ + ...commonParams, + UseObjectLambdaEndpoint: { type: "staticContextParams", value: true }, + }) + .m(function (Command, cs2, config, o2) { + return [ + getSerdePlugin95(config, this.serialize, this.deserialize), + getEndpointPlugin95(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonS3", "WriteGetObjectResponse", {}) + .n("S3Client", "WriteGetObjectResponseCommand") + .f(WriteGetObjectResponseRequestFilterSensitiveLog, void 0) + .ser(se_WriteGetObjectResponseCommand) + .de(de_WriteGetObjectResponseCommand) + .build() {}; + +// dist-es/S3.js +var commands = { + AbortMultipartUploadCommand, + CompleteMultipartUploadCommand, + CopyObjectCommand, + CreateBucketCommand, + CreateMultipartUploadCommand, + CreateSessionCommand, + DeleteBucketCommand, + DeleteBucketAnalyticsConfigurationCommand, + DeleteBucketCorsCommand, + DeleteBucketEncryptionCommand, + DeleteBucketIntelligentTieringConfigurationCommand, + DeleteBucketInventoryConfigurationCommand, + DeleteBucketLifecycleCommand, + DeleteBucketMetricsConfigurationCommand, + DeleteBucketOwnershipControlsCommand, + DeleteBucketPolicyCommand, + DeleteBucketReplicationCommand, + DeleteBucketTaggingCommand, + DeleteBucketWebsiteCommand, + DeleteObjectCommand, + DeleteObjectsCommand, + DeleteObjectTaggingCommand, + DeletePublicAccessBlockCommand, + GetBucketAccelerateConfigurationCommand, + GetBucketAclCommand, + GetBucketAnalyticsConfigurationCommand, + GetBucketCorsCommand, + GetBucketEncryptionCommand, + GetBucketIntelligentTieringConfigurationCommand, + GetBucketInventoryConfigurationCommand, + GetBucketLifecycleConfigurationCommand, + GetBucketLocationCommand, + GetBucketLoggingCommand, + GetBucketMetricsConfigurationCommand, + GetBucketNotificationConfigurationCommand, + GetBucketOwnershipControlsCommand, + GetBucketPolicyCommand, + GetBucketPolicyStatusCommand, + GetBucketReplicationCommand, + GetBucketRequestPaymentCommand, + GetBucketTaggingCommand, + GetBucketVersioningCommand, + GetBucketWebsiteCommand, + GetObjectCommand, + GetObjectAclCommand, + GetObjectAttributesCommand, + GetObjectLegalHoldCommand, + GetObjectLockConfigurationCommand, + GetObjectRetentionCommand, + GetObjectTaggingCommand, + GetObjectTorrentCommand, + GetPublicAccessBlockCommand, + HeadBucketCommand, + HeadObjectCommand, + ListBucketAnalyticsConfigurationsCommand, + ListBucketIntelligentTieringConfigurationsCommand, + ListBucketInventoryConfigurationsCommand, + ListBucketMetricsConfigurationsCommand, + ListBucketsCommand, + ListDirectoryBucketsCommand, + ListMultipartUploadsCommand, + ListObjectsCommand, + ListObjectsV2Command, + ListObjectVersionsCommand, + ListPartsCommand, + PutBucketAccelerateConfigurationCommand, + PutBucketAclCommand, + PutBucketAnalyticsConfigurationCommand, + PutBucketCorsCommand, + PutBucketEncryptionCommand, + PutBucketIntelligentTieringConfigurationCommand, + PutBucketInventoryConfigurationCommand, + PutBucketLifecycleConfigurationCommand, + PutBucketLoggingCommand, + PutBucketMetricsConfigurationCommand, + PutBucketNotificationConfigurationCommand, + PutBucketOwnershipControlsCommand, + PutBucketPolicyCommand, + PutBucketReplicationCommand, + PutBucketRequestPaymentCommand, + PutBucketTaggingCommand, + PutBucketVersioningCommand, + PutBucketWebsiteCommand, + PutObjectCommand, + PutObjectAclCommand, + PutObjectLegalHoldCommand, + PutObjectLockConfigurationCommand, + PutObjectRetentionCommand, + PutObjectTaggingCommand, + PutPublicAccessBlockCommand, + RestoreObjectCommand, + SelectObjectContentCommand, + UploadPartCommand, + UploadPartCopyCommand, + WriteGetObjectResponseCommand, +}; +var S3 = class extends S3Client {}; +createAggregatedClient(commands, S3); + +// dist-es/pagination/ListBucketsPaginator.js +import { createPaginator } from "@smithy/core"; +var paginateListBuckets = createPaginator( + S3Client, + ListBucketsCommand, + "ContinuationToken", + "ContinuationToken", + "MaxBuckets" +); + +// dist-es/pagination/ListDirectoryBucketsPaginator.js +import { createPaginator as createPaginator2 } from "@smithy/core"; +var paginateListDirectoryBuckets = createPaginator2( + S3Client, + ListDirectoryBucketsCommand, + "ContinuationToken", + "ContinuationToken", + "MaxDirectoryBuckets" +); + +// dist-es/pagination/ListObjectsV2Paginator.js +import { createPaginator as createPaginator3 } from "@smithy/core"; +var paginateListObjectsV2 = createPaginator3( + S3Client, + ListObjectsV2Command, + "ContinuationToken", + "NextContinuationToken", + "MaxKeys" +); + +// dist-es/pagination/ListPartsPaginator.js +import { createPaginator as createPaginator4 } from "@smithy/core"; +var paginateListParts = createPaginator4( + S3Client, + ListPartsCommand, + "PartNumberMarker", + "NextPartNumberMarker", + "MaxParts" +); + +// dist-es/waiters/waitForBucketExists.js +import { checkExceptions, createWaiter, WaiterState } from "@smithy/util-waiter"; +var checkState = async (client, input) => { + let reason; + try { + const result = await client.send(new HeadBucketCommand(input)); + reason = result; + return { state: WaiterState.SUCCESS, reason }; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: WaiterState.RETRY, reason }; + } + } + return { state: WaiterState.RETRY, reason }; +}; +var waitForBucketExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return createWaiter({ ...serviceDefaults, ...params }, input, checkState); +}; +var waitUntilBucketExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState); + return checkExceptions(result); +}; + +// dist-es/waiters/waitForBucketNotExists.js +import { + checkExceptions as checkExceptions2, + createWaiter as createWaiter2, + WaiterState as WaiterState2, +} from "@smithy/util-waiter"; +var checkState2 = async (client, input) => { + let reason; + try { + const result = await client.send(new HeadBucketCommand(input)); + reason = result; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: WaiterState2.SUCCESS, reason }; + } + } + return { state: WaiterState2.RETRY, reason }; +}; +var waitForBucketNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return createWaiter2({ ...serviceDefaults, ...params }, input, checkState2); +}; +var waitUntilBucketNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await createWaiter2({ ...serviceDefaults, ...params }, input, checkState2); + return checkExceptions2(result); +}; + +// dist-es/waiters/waitForObjectExists.js +import { + checkExceptions as checkExceptions3, + createWaiter as createWaiter3, + WaiterState as WaiterState3, +} from "@smithy/util-waiter"; +var checkState3 = async (client, input) => { + let reason; + try { + const result = await client.send(new HeadObjectCommand(input)); + reason = result; + return { state: WaiterState3.SUCCESS, reason }; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: WaiterState3.RETRY, reason }; + } + } + return { state: WaiterState3.RETRY, reason }; +}; +var waitForObjectExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return createWaiter3({ ...serviceDefaults, ...params }, input, checkState3); +}; +var waitUntilObjectExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await createWaiter3({ ...serviceDefaults, ...params }, input, checkState3); + return checkExceptions3(result); +}; + +// dist-es/waiters/waitForObjectNotExists.js +import { + checkExceptions as checkExceptions4, + createWaiter as createWaiter4, + WaiterState as WaiterState4, +} from "@smithy/util-waiter"; +var checkState4 = async (client, input) => { + let reason; + try { + const result = await client.send(new HeadObjectCommand(input)); + reason = result; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: WaiterState4.SUCCESS, reason }; + } + } + return { state: WaiterState4.RETRY, reason }; +}; +var waitForObjectNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return createWaiter4({ ...serviceDefaults, ...params }, input, checkState4); +}; +var waitUntilObjectNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await createWaiter4({ ...serviceDefaults, ...params }, input, checkState4); + return checkExceptions4(result); +}; +export { + AbortMultipartUploadCommand, + AnalyticsFilter, + AnalyticsS3ExportFileFormat, + ArchiveStatus, + BucketAccelerateStatus, + BucketAlreadyExists, + BucketAlreadyOwnedByYou, + BucketCannedACL, + BucketLocationConstraint, + BucketLogsPermission, + BucketType, + BucketVersioningStatus, + ChecksumAlgorithm, + ChecksumMode, + CompleteMultipartUploadCommand, + CompleteMultipartUploadOutputFilterSensitiveLog, + CompleteMultipartUploadRequestFilterSensitiveLog, + CompressionType, + CopyObjectCommand, + CopyObjectOutputFilterSensitiveLog, + CopyObjectRequestFilterSensitiveLog, + CreateBucketCommand, + CreateMultipartUploadCommand, + CreateMultipartUploadOutputFilterSensitiveLog, + CreateMultipartUploadRequestFilterSensitiveLog, + CreateSessionCommand, + CreateSessionOutputFilterSensitiveLog, + CreateSessionRequestFilterSensitiveLog, + DataRedundancy, + DeleteBucketAnalyticsConfigurationCommand, + DeleteBucketCommand, + DeleteBucketCorsCommand, + DeleteBucketEncryptionCommand, + DeleteBucketIntelligentTieringConfigurationCommand, + DeleteBucketInventoryConfigurationCommand, + DeleteBucketLifecycleCommand, + DeleteBucketMetricsConfigurationCommand, + DeleteBucketOwnershipControlsCommand, + DeleteBucketPolicyCommand, + DeleteBucketReplicationCommand, + DeleteBucketTaggingCommand, + DeleteBucketWebsiteCommand, + DeleteMarkerReplicationStatus, + DeleteObjectCommand, + DeleteObjectTaggingCommand, + DeleteObjectsCommand, + DeletePublicAccessBlockCommand, + EncodingType, + EncryptionFilterSensitiveLog, + Event, + ExistingObjectReplicationStatus, + ExpirationStatus, + ExpressionType, + FileHeaderInfo, + FilterRuleName, + GetBucketAccelerateConfigurationCommand, + GetBucketAclCommand, + GetBucketAnalyticsConfigurationCommand, + GetBucketCorsCommand, + GetBucketEncryptionCommand, + GetBucketEncryptionOutputFilterSensitiveLog, + GetBucketIntelligentTieringConfigurationCommand, + GetBucketInventoryConfigurationCommand, + GetBucketInventoryConfigurationOutputFilterSensitiveLog, + GetBucketLifecycleConfigurationCommand, + GetBucketLocationCommand, + GetBucketLoggingCommand, + GetBucketMetricsConfigurationCommand, + GetBucketNotificationConfigurationCommand, + GetBucketOwnershipControlsCommand, + GetBucketPolicyCommand, + GetBucketPolicyStatusCommand, + GetBucketReplicationCommand, + GetBucketRequestPaymentCommand, + GetBucketTaggingCommand, + GetBucketVersioningCommand, + GetBucketWebsiteCommand, + GetObjectAclCommand, + GetObjectAttributesCommand, + GetObjectAttributesRequestFilterSensitiveLog, + GetObjectCommand, + GetObjectLegalHoldCommand, + GetObjectLockConfigurationCommand, + GetObjectOutputFilterSensitiveLog, + GetObjectRequestFilterSensitiveLog, + GetObjectRetentionCommand, + GetObjectTaggingCommand, + GetObjectTorrentCommand, + GetObjectTorrentOutputFilterSensitiveLog, + GetPublicAccessBlockCommand, + HeadBucketCommand, + HeadObjectCommand, + HeadObjectOutputFilterSensitiveLog, + HeadObjectRequestFilterSensitiveLog, + IntelligentTieringAccessTier, + IntelligentTieringStatus, + InvalidObjectState, + InventoryConfigurationFilterSensitiveLog, + InventoryDestinationFilterSensitiveLog, + InventoryEncryptionFilterSensitiveLog, + InventoryFormat, + InventoryFrequency, + InventoryIncludedObjectVersions, + InventoryOptionalField, + InventoryS3BucketDestinationFilterSensitiveLog, + JSONType, + ListBucketAnalyticsConfigurationsCommand, + ListBucketIntelligentTieringConfigurationsCommand, + ListBucketInventoryConfigurationsCommand, + ListBucketInventoryConfigurationsOutputFilterSensitiveLog, + ListBucketMetricsConfigurationsCommand, + ListBucketsCommand, + ListDirectoryBucketsCommand, + ListMultipartUploadsCommand, + ListObjectVersionsCommand, + ListObjectsCommand, + ListObjectsV2Command, + ListPartsCommand, + ListPartsRequestFilterSensitiveLog, + LocationType, + MFADelete, + MFADeleteStatus, + MetadataDirective, + MetricsFilter, + MetricsStatus, + NoSuchBucket, + NoSuchKey, + NoSuchUpload, + NotFound, + ObjectAlreadyInActiveTierError, + ObjectAttributes, + ObjectCannedACL, + ObjectLockEnabled, + ObjectLockLegalHoldStatus, + ObjectLockMode, + ObjectLockRetentionMode, + ObjectNotInActiveTierError, + ObjectOwnership, + ObjectStorageClass, + ObjectVersionStorageClass, + OptionalObjectAttributes, + OutputLocationFilterSensitiveLog, + OwnerOverride, + PartitionDateSource, + Payer, + Permission, + Protocol, + PutBucketAccelerateConfigurationCommand, + PutBucketAclCommand, + PutBucketAnalyticsConfigurationCommand, + PutBucketCorsCommand, + PutBucketEncryptionCommand, + PutBucketEncryptionRequestFilterSensitiveLog, + PutBucketIntelligentTieringConfigurationCommand, + PutBucketInventoryConfigurationCommand, + PutBucketInventoryConfigurationRequestFilterSensitiveLog, + PutBucketLifecycleConfigurationCommand, + PutBucketLoggingCommand, + PutBucketMetricsConfigurationCommand, + PutBucketNotificationConfigurationCommand, + PutBucketOwnershipControlsCommand, + PutBucketPolicyCommand, + PutBucketReplicationCommand, + PutBucketRequestPaymentCommand, + PutBucketTaggingCommand, + PutBucketVersioningCommand, + PutBucketWebsiteCommand, + PutObjectAclCommand, + PutObjectCommand, + PutObjectLegalHoldCommand, + PutObjectLockConfigurationCommand, + PutObjectOutputFilterSensitiveLog, + PutObjectRequestFilterSensitiveLog, + PutObjectRetentionCommand, + PutObjectTaggingCommand, + PutPublicAccessBlockCommand, + QuoteFields, + ReplicaModificationsStatus, + ReplicationRuleStatus, + ReplicationStatus, + ReplicationTimeStatus, + RequestCharged, + RequestPayer, + RestoreObjectCommand, + RestoreObjectRequestFilterSensitiveLog, + RestoreRequestFilterSensitiveLog, + RestoreRequestType, + S3, + S3Client, + S3LocationFilterSensitiveLog, + S3ServiceException, + SSEKMSFilterSensitiveLog, + SelectObjectContentCommand, + SelectObjectContentEventStream, + SelectObjectContentEventStreamFilterSensitiveLog, + SelectObjectContentOutputFilterSensitiveLog, + SelectObjectContentRequestFilterSensitiveLog, + ServerSideEncryption, + ServerSideEncryptionByDefaultFilterSensitiveLog, + ServerSideEncryptionConfigurationFilterSensitiveLog, + ServerSideEncryptionRuleFilterSensitiveLog, + SessionCredentialsFilterSensitiveLog, + SessionMode, + SseKmsEncryptedObjectsStatus, + StorageClass, + StorageClassAnalysisSchemaVersion, + TaggingDirective, + Tier, + TransitionDefaultMinimumObjectSize, + TransitionStorageClass, + Type, + UploadPartCommand, + UploadPartCopyCommand, + UploadPartCopyOutputFilterSensitiveLog, + UploadPartCopyRequestFilterSensitiveLog, + UploadPartOutputFilterSensitiveLog, + UploadPartRequestFilterSensitiveLog, + WriteGetObjectResponseCommand, + WriteGetObjectResponseRequestFilterSensitiveLog, + __Client, + paginateListBuckets, + paginateListDirectoryBuckets, + paginateListObjectsV2, + paginateListParts, + waitForBucketExists, + waitForBucketNotExists, + waitForObjectExists, + waitForObjectNotExists, + waitUntilBucketExists, + waitUntilBucketNotExists, + waitUntilObjectExists, + waitUntilObjectNotExists, +}; diff --git a/clients/client-s3/test/browser-build/esbuild.js b/clients/client-s3/test/browser-build/esbuild.js new file mode 100644 index 000000000000..09934dd66715 --- /dev/null +++ b/clients/client-s3/test/browser-build/esbuild.js @@ -0,0 +1,20 @@ +const esbuild = require("esbuild"); +const path = require("path"); + +const buildOptions = { + platform: "browser", + target: ["chrome120"], + bundle: true, + format: "esm", + mainFields: ["module", "browser", "main"], + allowOverwrite: true, + entryPoints: [path.join(__dirname, "..", "..", "dist-es", "index.js")], + supported: { + "dynamic-import": false, + }, + outfile: path.join(__dirname, "browser-s3-bundle.js"), + packages: "external", + external: ["@smithy/*", "@aws-sdk/*", "node_modules/*"], +}; + +esbuild.build(buildOptions); diff --git a/clients/client-s3/test/e2e/S3.browser.ispec.ts b/clients/client-s3/test/e2e/S3.browser.e2e.spec.ts similarity index 60% rename from clients/client-s3/test/e2e/S3.browser.ispec.ts rename to clients/client-s3/test/e2e/S3.browser.e2e.spec.ts index 9cfd2f4d047a..eaf180e11394 100644 --- a/clients/client-s3/test/e2e/S3.browser.ispec.ts +++ b/clients/client-s3/test/e2e/S3.browser.e2e.spec.ts @@ -1,46 +1,64 @@ -/// /** * This is the integration test that make sure the client can make request cross-platform-ly - * in NodeJS, Chromium and Firefox. This test is written in mocha. + * in NodeJS and browsers. */ -import { Credentials } from "@aws-sdk/types"; -import chai from "chai"; -import chaiAsPromised from "chai-as-promised"; +import type { S3, SelectObjectContentEventStream } from "@aws-sdk/client-s3"; +import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; +import { FetchHttpHandler } from "@smithy/fetch-http-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, test as it } from "vitest"; -import { S3, SelectObjectContentEventStream } from "../../src/index"; +import { getIntegTestResources } from "../../../../tests/e2e/get-integ-test-resources"; +import { getRuntimeConfig } from "../../src/runtimeConfig.browser"; +import { S3 as S3Impl } from "../browser-build/browser-s3-bundle"; import { createBuffer } from "./helpers"; -chai.use(chaiAsPromised); -const { expect } = chai; -const region: string | undefined = (globalThis as any).defaultRegion || process?.env?.AWS_SMOKE_TEST_REGION; -const credentials: Credentials | undefined = (globalThis as any).credentials || undefined; -const isBrowser: boolean | undefined = (globalThis as any).isBrowser || false; -const Bucket = (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_BUCKET || process?.env?.AWS_SMOKE_TEST_BUCKET; -const mrapArn = (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_MRAP_ARN || process?.env?.AWS_SMOKE_TEST_MRAP_ARN; +describe("@aws-sdk/client-s3", () => { + let client: S3; + let Bucket: string; + let region: string; + let mrapArn: string; + let Key = `${Date.now()}`; -let Key = `${Date.now()}`; + beforeAll(async () => { + const integTestResourcesEnv = await getIntegTestResources(); + Object.assign(process.env, integTestResourcesEnv); -(isBrowser ? describe : xdescribe)("@aws-sdk/client-s3", () => { - const client = new S3({ - region: region, - credentials, + region = process?.env?.AWS_SMOKE_TEST_REGION as string; + Bucket = process?.env?.AWS_SMOKE_TEST_BUCKET as string; + mrapArn = (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_MRAP_ARN || process?.env?.AWS_SMOKE_TEST_MRAP_ARN; + + client = new S3Impl( + getRuntimeConfig({ + region, + credentials: fromNodeProviderChain(), + requestHandler: new FetchHttpHandler(), + }) + ) as S3; }); describe("PutObject", () => { - before(() => { + beforeEach(() => { Key = `${Date.now()}`; }); - after(async () => { + + afterEach(async () => { await client.deleteObject({ Bucket, Key }); }); + const buf = createBuffer("1KB"); - it("should succeed with blob body", async () => { + + // TODO(vitest) + // Caused by: RequestContentLengthMismatchError: Request body length does not match content-length header + // only in vitest + happy-dom. + it.skip("should succeed with blob body", async () => { + const blob = new Blob([buf]); const result = await client.putObject({ Bucket, Key, - Body: new Blob([buf]), + Body: blob, + ContentLength: blob.size, }); - expect(result.$metadata.httpStatusCode).to.equal(200); + expect(result.$metadata.httpStatusCode).toEqual(200); }); it("should succeed with TypedArray body", async () => { @@ -49,13 +67,10 @@ let Key = `${Date.now()}`; Key, Body: buf, }); - expect(result.$metadata.httpStatusCode).to.equal(200); + expect(result.$metadata.httpStatusCode).toEqual(200); }); - // todo: fix needed - // todo: TypeError: Failed to construct 'Request': The `duplex` member must - // todo: be specified for a request with a streaming body - it.skip("should succeed with ReadableStream body", async () => { + it("should succeed with ReadableStream body", async () => { const length = 10 * 1000; // 10KB const chunkSize = 10; const readableStream = new ReadableStream({ @@ -75,18 +90,18 @@ let Key = `${Date.now()}`; Bucket, Key, Body: readableStream, + ContentLength: length, }); - expect(result.$metadata.httpStatusCode).to.equal(200); + expect(result.$metadata.httpStatusCode).toEqual(200); }); }); describe("GetObject", function () { - this.timeout(10 * 1000); - before(async () => { + beforeEach(async () => { Key = `${Date.now()}`; }); - after(async () => { + afterEach(async () => { await client.deleteObject({ Bucket, Key }); }); @@ -109,36 +124,37 @@ let Key = `${Date.now()}`; throw e; } - expect(result.$metadata.httpStatusCode).to.equal(200); - expect(result.Body).to.be.instanceOf(ReadableStream); + expect(result.$metadata.httpStatusCode).toEqual(200); + expect(result.Body).toBeInstanceOf(ReadableStream); }); - }); + }, 10_000); describe("ListObjects", () => { - before(async () => { + beforeEach(async () => { Key = `${Date.now()}`; await client.putObject({ Bucket, Key, Body: "foo" }); }); - after(async () => { + afterEach(async () => { await client.deleteObject({ Bucket, Key }); }); it("should succeed with valid bucket", async () => { const result = await client.listObjects({ Bucket, }); - expect(result.$metadata.httpStatusCode).to.equal(200); - expect(result.Contents).to.be.instanceOf(Array); + expect(result.$metadata.httpStatusCode).toEqual(200); + expect(result.Contents).toBeInstanceOf(Array); }); - it("should throw with invalid bucket", () => - expect(client.listObjects({ Bucket: "invalid-bucket" })).to.eventually.be.rejected.and.be.an.instanceOf(Error)); + it("should throw with invalid bucket", () => { + expect(() => client.listObjects({ Bucket: "invalid-bucket" })).rejects.toThrow(); + }); }); describe("MultipartUpload", () => { let UploadId: string; let Etag: string; const multipartObjectKey = `${Key}-multipart`; - before(() => { + beforeEach(() => { Key = `${Date.now()}`; }); afterEach(async () => { @@ -161,8 +177,8 @@ let Key = `${Date.now()}`; Bucket, Key: multipartObjectKey, }); - expect(createResult.$metadata.httpStatusCode).to.equal(200); - expect(typeof createResult.UploadId).to.equal("string"); + expect(createResult.$metadata.httpStatusCode).toEqual(200); + expect(typeof createResult.UploadId).toEqual("string"); UploadId = createResult.UploadId as string; //upload part @@ -173,8 +189,8 @@ let Key = `${Date.now()}`; PartNumber: 1, Body: createBuffer("1KB"), }); - expect(uploadResult.$metadata.httpStatusCode).to.equal(200); - expect(typeof uploadResult.ETag).to.equal("string"); + expect(uploadResult.$metadata.httpStatusCode).toEqual(200); + expect(typeof uploadResult.ETag).toEqual("string"); Etag = uploadResult.ETag as string; //list parts @@ -183,9 +199,9 @@ let Key = `${Date.now()}`; Key: multipartObjectKey, UploadId, }); - expect(listPartsResult.$metadata.httpStatusCode).to.equal(200); - expect(listPartsResult.Parts?.length).to.equal(1); - expect(listPartsResult.Parts?.[0].ETag).to.equal(Etag); + expect(listPartsResult.$metadata.httpStatusCode).toEqual(200); + expect(listPartsResult.Parts?.length).toEqual(1); + expect(listPartsResult.Parts?.[0].ETag).toEqual(Etag); //complete multipart upload const completeResult = await client.completeMultipartUpload({ @@ -194,14 +210,14 @@ let Key = `${Date.now()}`; UploadId, MultipartUpload: { Parts: [{ ETag: Etag, PartNumber: 1 }] }, }); - expect(completeResult.$metadata.httpStatusCode).to.equal(200); + expect(completeResult.$metadata.httpStatusCode).toEqual(200); //validate the object is uploaded const headResult = await client.headObject({ Bucket, Key: multipartObjectKey, }); - expect(headResult.$metadata.httpStatusCode).to.equal(200); + expect(headResult.$metadata.httpStatusCode).toEqual(200); }); it("should successfully create, abort, and list upload", async () => { @@ -210,9 +226,9 @@ let Key = `${Date.now()}`; Bucket, Key: multipartObjectKey, }); - expect(createResult.$metadata.httpStatusCode).to.equal(200); + expect(createResult.$metadata.httpStatusCode).toEqual(200); const toAbort = createResult.UploadId; - expect(typeof toAbort).to.equal("string"); + expect(typeof toAbort).toEqual("string"); //abort multipart upload const abortResult = await client.abortMultipartUpload({ @@ -220,14 +236,14 @@ let Key = `${Date.now()}`; Key: multipartObjectKey, UploadId: toAbort, }); - expect(abortResult.$metadata.httpStatusCode).to.equal(204); + expect(abortResult.$metadata.httpStatusCode).toEqual(204); //validate multipart upload is aborted const listUploadsResult = await client.listMultipartUploads({ Bucket, }); - expect(listUploadsResult.$metadata.httpStatusCode).to.equal(200); - expect((listUploadsResult.Uploads || []).map((upload) => upload.UploadId)).not.to.contain(toAbort); + expect(listUploadsResult.$metadata.httpStatusCode).toEqual(200); + expect((listUploadsResult.Uploads || []).map((upload) => upload.UploadId)).not.toContain(toAbort); }); }); @@ -236,11 +252,11 @@ let Key = `${Date.now()}`; jsrocks,13 node4life,22 esfuture,29`; - before(async () => { + beforeEach(async () => { Key = `${Date.now()}`; await client.putObject({ Bucket, Key, Body: csvFile }); }); - after(async () => { + afterEach(async () => { await client.deleteObject({ Bucket, Key }); }); it("should succeed", async () => { @@ -264,26 +280,26 @@ esfuture,29`; for await (const event of Payload!) { events.push(event); } - expect(events.length).to.equal(3); - expect(new TextDecoder().decode(events[0].Records?.Payload)).to.equal("node4life\nesfuture\n"); - expect(events[1].Stats?.Details).to.be.exist; - expect(events[2].End).to.be.exist; + expect(events.length).toEqual(3); + expect(new TextDecoder().decode(events[0].Records?.Payload)).toEqual("node4life\nesfuture\n"); + expect(events[1].Stats?.Details).toBeDefined(); + expect(events[2].End).toBeDefined(); }); }); describe("Multi-region access point", () => { - before(async () => { + beforeEach(async () => { Key = `${Date.now()}`; }); - after(async () => {}); + afterEach(async () => {}); it("should throw for aws-crt no available in browser", async () => { try { await client.listObjects({ Bucket: mrapArn, }); - expect.fail("MRAP call in browser should throw"); + throw new Error("MRAP call in browser should throw"); } catch (e) { - expect(e.message).include("only available in Node.js"); + expect(e.message).toContain("only available in Node.js"); } }); }); diff --git a/clients/client-s3/test/e2e/S3.e2e.spec.ts b/clients/client-s3/test/e2e/S3.e2e.spec.ts index 6d1e01eed08e..b38870fa1e0b 100644 --- a/clients/client-s3/test/e2e/S3.e2e.spec.ts +++ b/clients/client-s3/test/e2e/S3.e2e.spec.ts @@ -1,21 +1,36 @@ import "@aws-sdk/signature-v4-crt"; -import { Credentials } from "@aws-sdk/types"; +import { S3, SelectObjectContentEventStream } from "@aws-sdk/client-s3"; +import { AwsCredentialIdentity } from "@aws-sdk/types"; +import { afterAll, afterEach, beforeAll, describe, expect, test as it } from "vitest"; -import { S3, SelectObjectContentEventStream } from "../../src/index"; +import { getIntegTestResources } from "../../../../tests/e2e/get-integ-test-resources"; import { createBuffer } from "./helpers"; -const region: string | undefined = (globalThis as any).defaultRegion || process?.env?.AWS_SMOKE_TEST_REGION; -const credentials: Credentials | undefined = (globalThis as any).credentials || undefined; -const Bucket = (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_BUCKET || process?.env?.AWS_SMOKE_TEST_BUCKET; -const mrapArn = (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_MRAP_ARN || process?.env?.AWS_SMOKE_TEST_MRAP_ARN; - let Key = `${Date.now()}`; describe("@aws-sdk/client-s3", () => { - const client = new S3({ - region: region, - credentials, + let client: S3; + let Bucket: string; + let region: string; + let credentials: AwsCredentialIdentity; + let mrapArn: string; + + beforeAll(async () => { + const integTestResourcesEnv = await getIntegTestResources(); + Object.assign(process.env, integTestResourcesEnv); + + region = process?.env?.AWS_SMOKE_TEST_REGION as string; + credentials = (globalThis as any).credentials || undefined; + Bucket = process?.env?.AWS_SMOKE_TEST_BUCKET as string; + mrapArn = (globalThis as any)?.window?.__env__?.AWS_SMOKE_TEST_MRAP_ARN || process?.env?.AWS_SMOKE_TEST_MRAP_ARN; + + Key = ``; + + client = new S3({ + region, + credentials, + }); }); describe("PutObject", () => { @@ -54,8 +69,7 @@ describe("@aws-sdk/client-s3", () => { }); }); - describe("GetObject", function () { - jest.setTimeout(10 * 1000); + describe("GetObject", () => { beforeAll(async () => { Key = `${Date.now()}`; }); @@ -87,7 +101,7 @@ describe("@aws-sdk/client-s3", () => { const { Readable } = require("stream"); expect(result.Body).toBeInstanceOf(Readable); }); - }); + }, 10_000); describe("ListObjects", () => { beforeAll(async () => { diff --git a/clients/client-s3/test/unit/S3.spec.ts b/clients/client-s3/test/unit/S3.spec.ts index 70bb865f208f..bb201b3f8c86 100644 --- a/clients/client-s3/test/unit/S3.spec.ts +++ b/clients/client-s3/test/unit/S3.spec.ts @@ -1,15 +1,10 @@ -/// import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { BuildMiddleware, FinalizeRequestMiddleware, SerializeMiddleware } from "@smithy/types"; -import chai from "chai"; -import chaiAsPromised from "chai-as-promised"; import { PassThrough, Readable } from "stream"; +import { beforeEach, describe, expect, test as it } from "vitest"; import { S3 } from "../../src/S3"; -chai.use(chaiAsPromised); -const { expect } = chai; - describe("endpoint", () => { it("users can override endpoint from client.", async () => { //use s3 here but all the clients are generated similarly @@ -178,19 +173,15 @@ describe("Throw 200 response", () => { }); it("should throw if CopyObject() return with 200 and empty payload", async () => { - return expect(client.copyObject(params)).to.eventually.be.rejectedWith(errorMsg); + return expect(client.copyObject(params)).rejects.toThrowError(errorMsg); }); it("should throw if UploadPartCopy() return with 200 and empty payload", async () => { - return expect(client.uploadPartCopy({ ...params, UploadId: "id", PartNumber: 1 })).to.eventually.be.rejectedWith( - errorMsg - ); + return expect(client.uploadPartCopy({ ...params, UploadId: "id", PartNumber: 1 })).rejects.toThrowError(errorMsg); }); it("should throw if CompleteMultipartUpload() return with 200 and empty payload", async () => { - return expect(client.completeMultipartUpload({ ...params, UploadId: "id" })).to.eventually.be.rejectedWith( - errorMsg - ); + return expect(client.completeMultipartUpload({ ...params, UploadId: "id" })).rejects.toThrowError(errorMsg); }); }); @@ -209,19 +200,15 @@ describe("Throw 200 response", () => { }); it("should throw if CopyObject() return with 200 and error preamble", async () => { - return expect(client.copyObject(params)).to.eventually.be.rejectedWith(errorMsg); + return expect(client.copyObject(params)).rejects.toThrowError(errorMsg); }); it("should throw if UploadPartCopy() return with 200 and error preamble", async () => { - return expect(client.uploadPartCopy({ ...params, UploadId: "id", PartNumber: 1 })).to.eventually.be.rejectedWith( - errorMsg - ); + return expect(client.uploadPartCopy({ ...params, UploadId: "id", PartNumber: 1 })).rejects.toThrowError(errorMsg); }); it("should throw if CompleteMultipartUpload() return with 200 and error preamble", async () => { - return expect(client.completeMultipartUpload({ ...params, UploadId: "id" })).to.eventually.be.rejectedWith( - errorMsg - ); + return expect(client.completeMultipartUpload({ ...params, UploadId: "id" })).rejects.toThrowError(errorMsg); }); }); }); @@ -270,6 +257,10 @@ describe("signing", () => { expect(request.path).to.equal("/some%20file.txt"); return { response: new HttpResponse({ statusCode: 200 }) }; }, + updateHttpClientConfig(key: keyof any, value: any[typeof key]): void {}, + httpHandlerConfigs(): any { + return {} as any; + }, }; const client = new S3({ requestHandler }); diff --git a/clients/client-s3/test/unit/dotSegmentInUriLabel.spec.ts b/clients/client-s3/test/unit/dotSegmentInUriLabel.spec.ts index e34075bc35ba..8179a6d4b686 100644 --- a/clients/client-s3/test/unit/dotSegmentInUriLabel.spec.ts +++ b/clients/client-s3/test/unit/dotSegmentInUriLabel.spec.ts @@ -1,12 +1,8 @@ -/// +import { test as it, describe, expect } from "vitest"; + import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { HttpHandlerOptions } from "@smithy/types"; import { S3 } from "../../src/S3"; -import chai from "chai"; -import chaiAsPromised from "chai-as-promised"; - -chai.use(chaiAsPromised); -const { expect } = chai; /** * Throws an expected exception that contains the serialized request. @@ -39,10 +35,10 @@ describe("Dot Segment in URI Label", () => { Bucket: "mybucket", Key: "../key.txt", }); - fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown"); + throw new Error("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown"); } catch (err) { if (!(err instanceof ExpectedRequestSerializationError)) { - fail(err); + throw new Error(err); } const r = err.request; expect(r.method).to.eql("GET"); @@ -56,10 +52,10 @@ describe("Dot Segment in URI Label", () => { Bucket: "mybucket", Key: "foo/../key.txt", }); - fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown"); + throw new Error("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown"); } catch (err) { if (!(err instanceof ExpectedRequestSerializationError)) { - fail(err); + throw new Error(err); } const r = err.request; expect(r.method).to.eql("GET"); diff --git a/clients/client-s3/test/unit/flexibleChecksums.spec.ts b/clients/client-s3/test/unit/flexibleChecksums.spec.ts index ec0d7f02545d..c7093245006c 100644 --- a/clients/client-s3/test/unit/flexibleChecksums.spec.ts +++ b/clients/client-s3/test/unit/flexibleChecksums.spec.ts @@ -1,15 +1,11 @@ -/// +import { test as it, describe, expect } from "vitest"; + import { ChecksumAlgorithm } from "@aws-sdk/middleware-flexible-checksums"; import { HttpRequest } from "@smithy/protocol-http"; import { BuildMiddleware } from "@smithy/types"; -import chai from "chai"; -import chaiAsPromised from "chai-as-promised"; import { Readable } from "stream"; -import { S3 } from "../../src/S3"; - -chai.use(chaiAsPromised); -const { expect } = chai; +import { S3, ChecksumAlgorithm as Algo } from "../../src/index"; describe("Flexible Checksums", () => { const testCases = [ @@ -69,11 +65,11 @@ describe("Flexible Checksums", () => { Bucket: "bucket", Key: "key", Body: body, - ChecksumAlgorithm: checksumAlgorithm, + ChecksumAlgorithm: checksumAlgorithm as Algo, }); }); - it(`when body is sent as a stream`, (done) => { + it(`when body is sent as a stream`, async () => { const requestChecksumValidator: BuildMiddleware = (next) => async (args) => { // middleware intercept the request and return it early const request = args.request as HttpRequest; @@ -88,7 +84,6 @@ describe("Flexible Checksums", () => { if (stringValue.startsWith(checksumHeader)) { const receivedChecksum = stringValue.replace("\r\n", "").split(":")[1]; expect(receivedChecksum).to.equal(checksumValue); - done(); } }); return { output: {} as any, response: {} as any }; @@ -101,11 +96,11 @@ describe("Flexible Checksums", () => { }); const bodyStream = getBodyAsReadableStream(body); - client.putObject({ + await client.putObject({ Bucket: "bucket", Key: "key", Body: bodyStream, - ChecksumAlgorithm: checksumAlgorithm, + ChecksumAlgorithm: checksumAlgorithm as Algo, }); }); }); diff --git a/clients/client-s3/tsconfig.json b/clients/client-s3/tsconfig.json index e7f5ec56b742..bae83b8420ee 100644 --- a/clients/client-s3/tsconfig.json +++ b/clients/client-s3/tsconfig.json @@ -9,5 +9,5 @@ "rootDir": "src", "useUnknownInCatchVariables": false }, - "exclude": ["test/"] + "exclude": ["test/", "vitest.*.ts"] } diff --git a/clients/client-s3/tsconfig.types.json b/clients/client-s3/tsconfig.types.json index 4c3dfa7b3d25..8b7606a2c091 100644 --- a/clients/client-s3/tsconfig.types.json +++ b/clients/client-s3/tsconfig.types.json @@ -6,5 +6,5 @@ "declarationDir": "dist-types", "emitDeclarationOnly": true }, - "exclude": ["test/**/*", "dist-types/**/*"] + "exclude": ["test/**/*", "dist-types/**/*", "vitest.*.ts"] } diff --git a/clients/client-s3/vitest.config.browser.ts b/clients/client-s3/vitest.config.browser.ts new file mode 100644 index 000000000000..0d43266410be --- /dev/null +++ b/clients/client-s3/vitest.config.browser.ts @@ -0,0 +1,11 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.browser.e2e.spec.ts", "test/unit/**/*.spec.ts"], + environment: "happy-dom", + testTransformMode: { + web: ["**/*.browser.e2e.spec.ts", "test/unit/**/*.spec.ts"], + }, + }, +}); diff --git a/clients/client-s3/vitest.config.e2e.ts b/clients/client-s3/vitest.config.e2e.ts new file mode 100644 index 000000000000..13bf99384530 --- /dev/null +++ b/clients/client-s3/vitest.config.e2e.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,browser}.spec.ts"], + include: ["**/*.e2e.spec.ts"], + environment: "node", + }, +}); diff --git a/clients/client-s3/vitest.config.ts b/clients/client-s3/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/clients/client-s3/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/clients/client-sts/jest.config.js b/clients/client-sts/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/clients/client-sts/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/clients/client-sts/package.json b/clients/client-sts/package.json index df82b65a7b6b..a51a73cc1bf8 100644 --- a/clients/client-sts/package.json +++ b/clients/client-sts/package.json @@ -12,8 +12,8 @@ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo sts", - "test": "yarn test:unit", - "test:unit": "jest" + "test": "vitest run", + "test:watch": "vitest watch" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/clients/client-sts/test/defaultRoleAssumers.spec.ts b/clients/client-sts/test/defaultRoleAssumers.spec.ts index f1c369b01260..fce6dde584b2 100644 --- a/clients/client-sts/test/defaultRoleAssumers.spec.ts +++ b/clients/client-sts/test/defaultRoleAssumers.spec.ts @@ -3,18 +3,19 @@ import { NodeHttp2Handler, NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; import { HttpResponse } from "@smithy/protocol-http"; import { Readable } from "stream"; +import { beforeAll, beforeEach, describe, expect, test as it, vi } from "vitest"; import type { AssumeRoleCommandInput } from "../src/commands/AssumeRoleCommand"; import { AssumeRoleWithWebIdentityCommandInput } from "../src/commands/AssumeRoleWithWebIdentityCommand"; import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "../src/defaultRoleAssumers"; -const mockHandle = jest.fn().mockResolvedValue({ +const mockHandle = vi.fn().mockResolvedValue({ response: new HttpResponse({ statusCode: 200, body: Readable.from([""]), }), }); -jest.mock("@smithy/node-http-handler", () => { +vi.mock("@smithy/node-http-handler", () => { class MockNodeHttpHandler { static create(instanceOrOptions?: any) { if (typeof instanceOrOptions?.handle === "function") { @@ -41,18 +42,26 @@ jest.mock("@smithy/node-http-handler", () => { return { NodeHttpHandler: MockNodeHttpHandler, NodeHttp2Handler: MockNodeHttp2Handler, - streamCollector: jest.fn(), + streamCollector: vi.fn(), }; }); -const mockConstructorInput = jest.fn(); -jest.mock("../src/STSClient", () => ({ - STSClient: function (params: any) { - mockConstructorInput(params); - //@ts-ignore - return new (jest.requireActual("../src/STSClient").STSClient)(params); - }, -})); +const STSCtor = vi.fn(); + +vi.mock("../src/STSClient", async () => { + const actual: any = await vi.importActual("../src/STSClient"); + + const pkg = { + ...actual, + STSClient: class STSClient extends actual.STSClient { + constructor(...args: any[]) { + super(...args); + STSCtor(...args); + } + }, + }; + return pkg; +}); describe("getDefaultRoleAssumer", () => { const assumeRoleResponse = ` @@ -74,11 +83,11 @@ describe("getDefaultRoleAssumer", () => { `; beforeAll(() => { - (streamCollector as jest.Mock).mockImplementation(async () => Buffer.from(assumeRoleResponse)); + vi.mocked(streamCollector).mockImplementation(async () => Buffer.from(assumeRoleResponse)); }); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should use supplied source credentials", async () => { @@ -134,8 +143,8 @@ describe("getDefaultRoleAssumer", () => { }; const sourceCred = { accessKeyId: "key", secretAccessKey: "secret" }; await roleAssumer(sourceCred, params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: handler, region, @@ -159,8 +168,8 @@ describe("getDefaultRoleAssumer", () => { }; const sourceCred = { accessKeyId: "key", secretAccessKey: "secret" }; await roleAssumer(sourceCred, params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: handler, region, @@ -184,8 +193,8 @@ describe("getDefaultRoleAssumer", () => { }; const sourceCred = { accessKeyId: "key", secretAccessKey: "secret" }; await roleAssumer(sourceCred, params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: undefined, region, @@ -193,7 +202,7 @@ describe("getDefaultRoleAssumer", () => { }); it("should use the STS client middleware", async () => { - const customMiddlewareFunction = jest.fn(); + const customMiddlewareFunction = vi.fn(); const roleAssumer = getDefaultRoleAssumer({}, [ { applyToStack: (stack) => { @@ -233,11 +242,11 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => { `; beforeAll(() => { - (streamCollector as jest.Mock).mockImplementation(async () => Buffer.from(assumeRoleResponse)); + vi.mocked(streamCollector).mockImplementation(async () => Buffer.from(assumeRoleResponse)); }); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should use the STS client config", async () => { @@ -255,8 +264,8 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => { WebIdentityToken: "token", }; await roleAssumerWithWebIdentity(params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: handler, region, @@ -275,7 +284,7 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => { }); it("should use the STS client middleware", async () => { - const customMiddlewareFunction = jest.fn(); + const customMiddlewareFunction = vi.fn(); const roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({}, [ { applyToStack: (stack) => { diff --git a/clients/client-sts/tsconfig.json b/clients/client-sts/tsconfig.json index e7f5ec56b742..bae83b8420ee 100644 --- a/clients/client-sts/tsconfig.json +++ b/clients/client-sts/tsconfig.json @@ -9,5 +9,5 @@ "rootDir": "src", "useUnknownInCatchVariables": false }, - "exclude": ["test/"] + "exclude": ["test/", "vitest.*.ts"] } diff --git a/clients/client-sts/vitest.config.ts b/clients/client-sts/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/clients/client-sts/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/clients/client-transcribe-streaming/.gitignore b/clients/client-transcribe-streaming/.gitignore index 08d359af39e7..8aa820805c0c 100644 --- a/clients/client-transcribe-streaming/.gitignore +++ b/clients/client-transcribe-streaming/.gitignore @@ -7,4 +7,4 @@ *.tgz *.log package-lock.json -!jest*.config.js +!vite*.ts diff --git a/clients/client-transcribe-streaming/jest.config.e2e.js b/clients/client-transcribe-streaming/jest.config.e2e.js deleted file mode 100644 index b4d9bee23f48..000000000000 --- a/clients/client-transcribe-streaming/jest.config.e2e.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.e2e.spec.ts"], -}; diff --git a/clients/client-transcribe-streaming/package.json b/clients/client-transcribe-streaming/package.json index 3529ffc40006..6b62b7b40516 100644 --- a/clients/client-transcribe-streaming/package.json +++ b/clients/client-transcribe-streaming/package.json @@ -12,7 +12,8 @@ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo transcribe-streaming", - "test:e2e": "jest --config jest.config.e2e.js" + "test:e2e": "vitest run -c vitest.config.e2e.ts", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/clients/client-transcribe-streaming/test/index.e2e.spec.ts b/clients/client-transcribe-streaming/test/index.e2e.spec.ts index abc5a05e8147..dbcc8f3f36ab 100644 --- a/clients/client-transcribe-streaming/test/index.e2e.spec.ts +++ b/clients/client-transcribe-streaming/test/index.e2e.spec.ts @@ -1,3 +1,5 @@ +import { test as it, afterAll, describe, expect } from "vitest"; + import { createReadStream } from "fs"; import { join } from "path"; @@ -11,7 +13,7 @@ describe("TranscribeStream client", () => { }); // TODO: not working in Node.js with HTTP2 handler? - xit("should stream the transcript", async () => { + it.skip("should stream the transcript", async () => { const LanguageCode = "en-GB"; const MediaEncoding = "pcm"; const MediaSampleRateHertz = 44100; diff --git a/clients/client-transcribe-streaming/vitest.config.e2e.ts b/clients/client-transcribe-streaming/vitest.config.e2e.ts new file mode 100644 index 000000000000..92073c6cfcf0 --- /dev/null +++ b/clients/client-transcribe-streaming/vitest.config.e2e.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.e2e.spec.ts"], + environment: "node", + }, +}); diff --git a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts index 13eb424242ad..34acdcf8a35b 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts +++ b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts @@ -1,18 +1,19 @@ import { NodeHttp2Handler, NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; import { HttpResponse } from "@smithy/protocol-http"; import { Readable } from "stream"; +import { beforeAll, beforeEach, describe, expect, test as it, vi } from "vitest"; import type { AssumeRoleCommandInput } from "../src/commands/AssumeRoleCommand"; import { AssumeRoleWithWebIdentityCommandInput } from "../src/commands/AssumeRoleWithWebIdentityCommand"; import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "../src/defaultRoleAssumers"; -const mockHandle = jest.fn().mockResolvedValue({ +const mockHandle = vi.fn().mockResolvedValue({ response: new HttpResponse({ statusCode: 200, body: Readable.from([""]), }), }); -jest.mock("@smithy/node-http-handler", () => { +vi.mock("@smithy/node-http-handler", () => { class MockNodeHttpHandler { static create(instanceOrOptions?: any) { if (typeof instanceOrOptions?.handle === "function") { @@ -23,20 +24,42 @@ jest.mock("@smithy/node-http-handler", () => { destroy() {} handle = mockHandle; } + class MockNodeHttp2Handler { + public metadata = { + handlerProtocol: "h2", + }; + static create(instanceOrOptions?: any) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new MockNodeHttp2Handler(); + } + destroy() {} + handle = mockHandle; + } return { NodeHttpHandler: MockNodeHttpHandler, - streamCollector: jest.fn(), + NodeHttp2Handler: MockNodeHttp2Handler, + streamCollector: vi.fn(), }; }); -const mockConstructorInput = jest.fn(); -jest.mock("../src/STSClient", () => ({ - STSClient: function (params: any) { - mockConstructorInput(params); - //@ts-ignore - return new (jest.requireActual("../src/STSClient").STSClient)(params); - }, -})); +const STSCtor = vi.fn(); + +vi.mock("../src/STSClient", async () => { + const actual: any = await vi.importActual("../src/STSClient"); + + const pkg = { + ...actual, + STSClient: class STSClient extends actual.STSClient { + constructor(...args: any[]) { + super(...args); + STSCtor(...args); + } + }, + }; + return pkg; +}); describe("getDefaultRoleAssumer", () => { const assumeRoleResponse = ` @@ -58,11 +81,11 @@ describe("getDefaultRoleAssumer", () => { `; beforeAll(() => { - (streamCollector as jest.Mock).mockImplementation(async () => Buffer.from(assumeRoleResponse)); + vi.mocked(streamCollector).mockImplementation(async () => Buffer.from(assumeRoleResponse)); }); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should use supplied source credentials", async () => { @@ -118,8 +141,8 @@ describe("getDefaultRoleAssumer", () => { }; const sourceCred = { accessKeyId: "key", secretAccessKey: "secret" }; await roleAssumer(sourceCred, params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: handler, region, @@ -143,8 +166,8 @@ describe("getDefaultRoleAssumer", () => { }; const sourceCred = { accessKeyId: "key", secretAccessKey: "secret" }; await roleAssumer(sourceCred, params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: handler, region, @@ -168,8 +191,8 @@ describe("getDefaultRoleAssumer", () => { }; const sourceCred = { accessKeyId: "key", secretAccessKey: "secret" }; await roleAssumer(sourceCred, params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: undefined, region, @@ -177,7 +200,7 @@ describe("getDefaultRoleAssumer", () => { }); it("should use the STS client middleware", async () => { - const customMiddlewareFunction = jest.fn(); + const customMiddlewareFunction = vi.fn(); const roleAssumer = getDefaultRoleAssumer({}, [ { applyToStack: (stack) => { @@ -217,11 +240,11 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => { `; beforeAll(() => { - (streamCollector as jest.Mock).mockImplementation(async () => Buffer.from(assumeRoleResponse)); + vi.mocked(streamCollector).mockImplementation(async () => Buffer.from(assumeRoleResponse)); }); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should use the STS client config", async () => { @@ -239,8 +262,8 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => { WebIdentityToken: "token", }; await roleAssumerWithWebIdentity(params); - expect(mockConstructorInput).toHaveBeenCalledTimes(1); - expect(mockConstructorInput.mock.calls[0][0]).toMatchObject({ + expect(vi.mocked(STSCtor)).toHaveBeenCalledTimes(1); + expect(vi.mocked(STSCtor).mock.calls[0][0]).toMatchObject({ logger, requestHandler: handler, region, @@ -259,7 +282,7 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => { }); it("should use the STS client middleware", async () => { - const customMiddlewareFunction = jest.fn(); + const customMiddlewareFunction = vi.fn(); const roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({}, [ { applyToStack: (stack) => { diff --git a/lib/lib-dynamodb/vitest.config.e2e.ts b/lib/lib-dynamodb/vitest.config.e2e.ts index 8e3e8ccc5726..92073c6cfcf0 100644 --- a/lib/lib-dynamodb/vitest.config.e2e.ts +++ b/lib/lib-dynamodb/vitest.config.e2e.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["**/*.e2e.spec.{ts,js}"], + include: ["**/*.e2e.spec.ts"], environment: "node", }, }); diff --git a/lib/lib-dynamodb/vitest.config.ts b/lib/lib-dynamodb/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/lib/lib-dynamodb/vitest.config.ts +++ b/lib/lib-dynamodb/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/lib/lib-storage/vitest.config.e2e.ts b/lib/lib-storage/vitest.config.e2e.ts index 8e3e8ccc5726..92073c6cfcf0 100644 --- a/lib/lib-storage/vitest.config.e2e.ts +++ b/lib/lib-storage/vitest.config.e2e.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["**/*.e2e.spec.{ts,js}"], + include: ["**/*.e2e.spec.ts"], environment: "node", }, }); diff --git a/lib/lib-storage/vitest.config.ts b/lib/lib-storage/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/lib/lib-storage/vitest.config.ts +++ b/lib/lib-storage/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/package.json b/package.json index 1261ba08c124..e44073302bbb 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,11 @@ "local-publish": "node ./scripts/verdaccio-publish/index.js", "test:all": "yarn build:all && jest --coverage --passWithNoTests && lerna run test --scope '@aws-sdk/{fetch-http-handler,hash-blob-browser}' && yarn test:versions && yarn test:integration", "test:ci": "lerna run test --since origin/main", - "test:e2e": "node ./tests/e2e/index.js && node ./tests/canary/canary", + "test:e2e": "node ./scripts/turbo test:e2e && node ./tests/canary/canary", "test:e2e:legacy": "cucumber-js --fail-fast", "test:e2e:legacy:preview": "./tests/e2e-legacy/preview.mjs", "test:e2e:legacy:since:release": "./tests/e2e-legacy/since-release.mjs", - "test:functional": "jest --passWithNoTests --config tests/functional/jest.config.js && lerna run test:unit --scope \"@aws-sdk/client-*\"", + "test:functional": "jest --passWithNoTests --config tests/functional/jest.config.js && lerna run test --scope \"@aws-sdk/client-*\"", "test:integration": "node ./scripts/turbo test:integration", "test:integration:legacy": "yarn test:e2e:legacy", "test:integration:legacy:since:release": "yarn test:e2e:legacy:since:release", diff --git a/packages/body-checksum-browser/vitest.config.ts b/packages/body-checksum-browser/vitest.config.ts index 93500dad24d6..44808064872c 100644 --- a/packages/body-checksum-browser/vitest.config.ts +++ b/packages/body-checksum-browser/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e}.spec.ts"], + include: ["**/*.spec.ts"], environment: "happy-dom", }, }); diff --git a/packages/body-checksum-node/vitest.config.ts b/packages/body-checksum-node/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/body-checksum-node/vitest.config.ts +++ b/packages/body-checksum-node/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/chunked-stream-reader-node/vitest.config.ts b/packages/chunked-stream-reader-node/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/chunked-stream-reader-node/vitest.config.ts +++ b/packages/chunked-stream-reader-node/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/cloudfront-signer/vitest.config.ts b/packages/cloudfront-signer/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/cloudfront-signer/vitest.config.ts +++ b/packages/cloudfront-signer/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/core/vitest.config.integ.ts b/packages/core/vitest.config.integ.ts index 35e2b17c4f3d..5802db1ac64a 100644 --- a/packages/core/vitest.config.integ.ts +++ b/packages/core/vitest.config.integ.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["**/*.integ.spec.{ts,js}"], + include: ["**/*.integ.spec.ts"], environment: "node", }, }); diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/core/vitest.config.ts +++ b/packages/core/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-cognito-identity/vitest.config.ts b/packages/credential-provider-cognito-identity/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-cognito-identity/vitest.config.ts +++ b/packages/credential-provider-cognito-identity/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-env/vitest.config.ts b/packages/credential-provider-env/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-env/vitest.config.ts +++ b/packages/credential-provider-env/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-http/vitest.config.ts b/packages/credential-provider-http/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-http/vitest.config.ts +++ b/packages/credential-provider-http/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-ini/vitest.config.ts b/packages/credential-provider-ini/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-ini/vitest.config.ts +++ b/packages/credential-provider-ini/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-node/vitest.config.integ.ts b/packages/credential-provider-node/vitest.config.integ.ts index 35e2b17c4f3d..5802db1ac64a 100644 --- a/packages/credential-provider-node/vitest.config.integ.ts +++ b/packages/credential-provider-node/vitest.config.integ.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["**/*.integ.spec.{ts,js}"], + include: ["**/*.integ.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-node/vitest.config.ts b/packages/credential-provider-node/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-node/vitest.config.ts +++ b/packages/credential-provider-node/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-process/vitest.config.ts b/packages/credential-provider-process/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-process/vitest.config.ts +++ b/packages/credential-provider-process/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-sso/vitest.config.ts b/packages/credential-provider-sso/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-sso/vitest.config.ts +++ b/packages/credential-provider-sso/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-provider-web-identity/vitest.config.ts b/packages/credential-provider-web-identity/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-provider-web-identity/vitest.config.ts +++ b/packages/credential-provider-web-identity/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-providers/vitest.config.integ.ts b/packages/credential-providers/vitest.config.integ.ts index 35e2b17c4f3d..5802db1ac64a 100644 --- a/packages/credential-providers/vitest.config.integ.ts +++ b/packages/credential-providers/vitest.config.integ.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["**/*.integ.spec.{ts,js}"], + include: ["**/*.integ.spec.ts"], environment: "node", }, }); diff --git a/packages/credential-providers/vitest.config.ts b/packages/credential-providers/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/credential-providers/vitest.config.ts +++ b/packages/credential-providers/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/ec2-metadata-service/vitest.config.e2e.ts b/packages/ec2-metadata-service/vitest.config.e2e.ts index 8e3e8ccc5726..92073c6cfcf0 100644 --- a/packages/ec2-metadata-service/vitest.config.e2e.ts +++ b/packages/ec2-metadata-service/vitest.config.e2e.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["**/*.e2e.spec.{ts,js}"], + include: ["**/*.e2e.spec.ts"], environment: "node", }, }); diff --git a/packages/ec2-metadata-service/vitest.config.ts b/packages/ec2-metadata-service/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/ec2-metadata-service/vitest.config.ts +++ b/packages/ec2-metadata-service/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/endpoint-cache/vitest.config.ts b/packages/endpoint-cache/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/endpoint-cache/vitest.config.ts +++ b/packages/endpoint-cache/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/eventstream-handler-node/vitest.config.ts b/packages/eventstream-handler-node/vitest.config.ts index f360902f18aa..4e46707824a5 100644 --- a/packages/eventstream-handler-node/vitest.config.ts +++ b/packages/eventstream-handler-node/vitest.config.ts @@ -2,8 +2,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], - include: ["**/*.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], environment: "node", }, }); diff --git a/packages/karma-credential-loader/jest.config.js b/packages/karma-credential-loader/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/karma-credential-loader/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/karma-credential-loader/package.json b/packages/karma-credential-loader/package.json index 4af49ec3a2dd..7f63b6aa914a 100644 --- a/packages/karma-credential-loader/package.json +++ b/packages/karma-credential-loader/package.json @@ -10,7 +10,7 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --passWithNoTests" + "test": "(exit 0)" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-api-key/jest.config.js b/packages/middleware-api-key/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-api-key/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-api-key/package.json b/packages/middleware-api-key/package.json index 96a3c519339b..c22e695665f6 100644 --- a/packages/middleware-api-key/package.json +++ b/packages/middleware-api-key/package.json @@ -9,7 +9,8 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --passWithNoTests" + "test": "vitest run", + "test:watch": "vitest watch" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-api-key/src/apiKeyConfiguration.spec.ts b/packages/middleware-api-key/src/apiKeyConfiguration.spec.ts index 8744be19c842..d67bae14a948 100644 --- a/packages/middleware-api-key/src/apiKeyConfiguration.spec.ts +++ b/packages/middleware-api-key/src/apiKeyConfiguration.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { resolveApiKeyConfig } from "./index"; describe("ApiKeyConfig", () => { diff --git a/packages/middleware-api-key/src/apiKeyMiddleware.spec.ts b/packages/middleware-api-key/src/apiKeyMiddleware.spec.ts index 5bc8b5319c20..4273057e93f6 100644 --- a/packages/middleware-api-key/src/apiKeyMiddleware.spec.ts +++ b/packages/middleware-api-key/src/apiKeyMiddleware.spec.ts @@ -1,5 +1,6 @@ import { HttpRequest } from "@smithy/protocol-http"; import { HttpAuthLocation, MiddlewareStack } from "@smithy/types"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { apiKeyMiddleware, getApiKeyPlugin } from "./index"; @@ -14,8 +15,8 @@ describe("getApiKeyPlugin", () => { name: "key", } ); - const mockApplied = jest.fn(); - const mockOther = jest.fn(); + const mockApplied = vi.fn(); + const mockOther = vi.fn(); // TODO there's got to be a better way to do this mocking plugin.applyToStack({ @@ -39,10 +40,10 @@ describe("getApiKeyPlugin", () => { describe(apiKeyMiddleware.name, () => { describe("returned middleware function", () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should set the query parameter if the location is `query`", async () => { diff --git a/packages/middleware-api-key/vitest.config.ts b/packages/middleware-api-key/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-api-key/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-bucket-endpoint/jest.config.js b/packages/middleware-bucket-endpoint/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-bucket-endpoint/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-bucket-endpoint/package.json b/packages/middleware-bucket-endpoint/package.json index f7698f16f83f..ad2d9c6f22f0 100644 --- a/packages/middleware-bucket-endpoint/package.json +++ b/packages/middleware-bucket-endpoint/package.json @@ -10,7 +10,8 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", - "test": "jest" + "test": "vitest run", + "test:watch": "vitest watch" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-bucket-endpoint/src/NodeDisableMultiregionAccessPointConfigOptions.spec.ts b/packages/middleware-bucket-endpoint/src/NodeDisableMultiregionAccessPointConfigOptions.spec.ts index 4115b970128f..53925437b6e2 100644 --- a/packages/middleware-bucket-endpoint/src/NodeDisableMultiregionAccessPointConfigOptions.spec.ts +++ b/packages/middleware-bucket-endpoint/src/NodeDisableMultiregionAccessPointConfigOptions.spec.ts @@ -1,4 +1,5 @@ import { booleanSelector, SelectorType } from "@smithy/util-config-provider"; +import { afterEach, describe, expect, test as it, vi } from "vitest"; import { NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS, @@ -6,23 +7,23 @@ import { NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME, } from "./NodeDisableMultiregionAccessPointConfigOptions"; -jest.mock("@smithy/util-config-provider"); +vi.mock("@smithy/util-config-provider"); describe("NODE_USE_ARN_REGION_CONFIG_OPTIONS", () => { afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); const test = (func: Function, obj: Record, key: string, type: SelectorType) => { it.each([true, false, undefined])("returns %s", (output) => { - (booleanSelector as jest.Mock).mockReturnValueOnce(output); + vi.mocked(booleanSelector).mockReturnValueOnce(output); expect(func(obj)).toEqual(output); expect(booleanSelector).toBeCalledWith(obj, key, type); }); it("throws error", () => { const mockError = new Error("error"); - (booleanSelector as jest.Mock).mockImplementationOnce(() => { + vi.mocked(booleanSelector).mockImplementationOnce(() => { throw mockError; }); expect(() => { diff --git a/packages/middleware-bucket-endpoint/src/NodeUseArnRegionConfigOptions.spec.ts b/packages/middleware-bucket-endpoint/src/NodeUseArnRegionConfigOptions.spec.ts index 927bf6999923..08116c56647e 100644 --- a/packages/middleware-bucket-endpoint/src/NodeUseArnRegionConfigOptions.spec.ts +++ b/packages/middleware-bucket-endpoint/src/NodeUseArnRegionConfigOptions.spec.ts @@ -1,4 +1,5 @@ import { booleanSelector, SelectorType } from "@smithy/util-config-provider"; +import { afterEach, describe, expect, test as it, vi } from "vitest"; import { NODE_USE_ARN_REGION_CONFIG_OPTIONS, @@ -6,23 +7,23 @@ import { NODE_USE_ARN_REGION_INI_NAME, } from "./NodeUseArnRegionConfigOptions"; -jest.mock("@smithy/util-config-provider"); +vi.mock("@smithy/util-config-provider"); describe("NODE_USE_ARN_REGION_CONFIG_OPTIONS", () => { afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); const test = (func: Function, obj: Record, key: string, type: SelectorType) => { it.each([true, false, undefined])("returns %s", (output) => { - (booleanSelector as jest.Mock).mockReturnValueOnce(output); + vi.mocked(booleanSelector).mockReturnValueOnce(output); expect(func(obj)).toEqual(output); expect(booleanSelector).toBeCalledWith(obj, key, type); }); it("throws error", () => { const mockError = new Error("error"); - (booleanSelector as jest.Mock).mockImplementationOnce(() => { + vi.mocked(booleanSelector).mockImplementationOnce(() => { throw mockError; }); expect(() => { diff --git a/packages/middleware-bucket-endpoint/src/bucketEndpointMiddleware.spec.ts b/packages/middleware-bucket-endpoint/src/bucketEndpointMiddleware.spec.ts index 5b96767bc852..fcb52d46a609 100644 --- a/packages/middleware-bucket-endpoint/src/bucketEndpointMiddleware.spec.ts +++ b/packages/middleware-bucket-endpoint/src/bucketEndpointMiddleware.spec.ts @@ -1,20 +1,23 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { resolveBucketEndpointConfig } from "./configurations"; -const mockBucketHostname = jest.fn(); -jest.mock("./bucketHostname", () => ({ - bucketHostname: mockBucketHostname, -})); const mockBucketArn = "an ARN structure"; -const mockArnParse = jest.fn().mockReturnValue(mockBucketArn); -const mockArnValidation = jest.fn(); -jest.mock("@aws-sdk/util-arn-parser", () => ({ - parse: mockArnParse, - validate: mockArnValidation, + +vi.mock("./bucketHostname", () => ({ + bucketHostname: vi.fn(), })); +vi.mock("@aws-sdk/util-arn-parser", () => ({ + parse: vi.fn().mockReturnValue("an ARN structure"), + validate: vi.fn(), +})); + +import { parse, validate } from "@aws-sdk/util-arn-parser"; + import { bucketEndpointMiddleware } from "./bucketEndpointMiddleware"; +import { bucketHostname } from "./bucketHostname"; describe("bucketEndpointMiddleware", () => { const input = { Bucket: "bucket" }; @@ -26,26 +29,26 @@ describe("bucketEndpointMiddleware", () => { hostname: "s3.us-west-2.amazonaws.com", path: "/bucket", }; - const next = jest.fn(); + const next = vi.fn(); const previouslyResolvedConfig = { isCustomEndpoint: false, - region: jest.fn().mockResolvedValue(mockRegion), - regionInfoProvider: jest + region: vi.fn().mockResolvedValue(mockRegion), + regionInfoProvider: vi .fn() .mockResolvedValue({ hostname: "foo.us-foo-2.amazonaws.com", partition: "aws-foo", signingRegion: mockRegion }), - useArnRegion: jest.fn().mockResolvedValue(false), + useArnRegion: vi.fn().mockResolvedValue(false), useFipsEndpoint: () => Promise.resolve(false), useDualstackEndpoint: () => Promise.resolve(false), }; afterEach(() => { - mockArnValidation.mockClear(); - mockBucketHostname.mockClear(); + vi.mocked(validate).mockClear(); + vi.mocked(bucketHostname).mockClear(); }); describe("with regular bucket name", () => { beforeEach(() => { - mockBucketHostname.mockReturnValue({ + vi.mocked(bucketHostname).mockReturnValue({ bucketEndpoint: true, hostname: "bucket.s3.us-west-2.amazonaws.com", }); @@ -53,15 +56,15 @@ describe("bucketEndpointMiddleware", () => { it("should supply default parameters to bucket hostname constructor", async () => { const request = new HttpRequest(requestInput); - mockArnValidation.mockReturnValue(false); + vi.mocked(validate).mockReturnValue(false); const handler = bucketEndpointMiddleware( resolveBucketEndpointConfig({ ...previouslyResolvedConfig, }) )(next, {} as any); await handler({ input, request }); - expect(mockBucketHostname).toBeCalled(); - const param = mockBucketHostname.mock.calls[0][0]; + expect(vi.mocked(bucketHostname)).toBeCalled(); + const param = vi.mocked(bucketHostname).mock.calls[0][0]; expect(param).toEqual({ bucketName: input.Bucket, baseHostname: requestInput.hostname, @@ -77,7 +80,7 @@ describe("bucketEndpointMiddleware", () => { it("should relay parameters to bucket hostname constructor", async () => { const request = new HttpRequest({ ...requestInput, protocol: "http:" }); - mockArnValidation.mockReturnValue(false); + vi.mocked(validate).mockReturnValue(false); const handler = bucketEndpointMiddleware( resolveBucketEndpointConfig({ ...previouslyResolvedConfig, @@ -88,8 +91,8 @@ describe("bucketEndpointMiddleware", () => { }) )(next, {} as any); await handler({ input, request }); - expect(mockBucketHostname).toBeCalled(); - const param = mockBucketHostname.mock.calls[0][0]; + expect(vi.mocked(bucketHostname)).toBeCalled(); + const param = vi.mocked(bucketHostname).mock.calls[0][0]; expect(param).toEqual({ bucketName: input.Bucket, baseHostname: requestInput.hostname, @@ -106,8 +109,8 @@ describe("bucketEndpointMiddleware", () => { describe("allows bucket name to be an ARN", () => { beforeEach(() => { - mockArnValidation.mockReturnValue(true); - mockBucketHostname.mockReturnValue({ + vi.mocked(validate).mockReturnValue(true); + vi.mocked(bucketHostname).mockReturnValue({ bucketEndpoint: true, hostname: "myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com", }); @@ -124,8 +127,8 @@ describe("bucketEndpointMiddleware", () => { input: { Bucket: "myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com" }, request, }); - expect(mockBucketHostname).toBeCalled(); - const param = mockBucketHostname.mock.calls[0][0]; + expect(vi.mocked(bucketHostname)).toBeCalled(); + const param = vi.mocked(bucketHostname).mock.calls[0][0]; expect(param).toEqual({ bucketName: mockBucketArn, baseHostname: requestInput.hostname, @@ -173,14 +176,14 @@ describe("bucketEndpointMiddleware", () => { input: { Bucket: "myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com" }, request, }); - expect(mockBucketHostname).toBeCalled(); - expect(mockBucketHostname.mock.calls[0][0].bucketName).toBe(mockBucketArn); - expect(mockArnParse).toBeCalled(); - expect(mockArnValidation).toBeCalled(); + expect(vi.mocked(bucketHostname)).toBeCalled(); + expect(vi.mocked(bucketHostname).mock.calls[0][0].bucketName).toBe(mockBucketArn); + expect(vi.mocked(parse)).toBeCalled(); + expect(vi.mocked(validate)).toBeCalled(); }); it("should set signing_region to middleware context if the request will use region from ARN", async () => { - mockBucketHostname.mockReturnValue({ + vi.mocked(bucketHostname).mockReturnValue({ bucketEndpoint: true, hostname: "myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com", signingService: "s3-foo", diff --git a/packages/middleware-bucket-endpoint/src/bucketHostname.spec.ts b/packages/middleware-bucket-endpoint/src/bucketHostname.spec.ts index 9b73384978ca..1eb2f733b48b 100644 --- a/packages/middleware-bucket-endpoint/src/bucketHostname.spec.ts +++ b/packages/middleware-bucket-endpoint/src/bucketHostname.spec.ts @@ -1,4 +1,5 @@ import { parse as parseArn } from "@aws-sdk/util-arn-parser"; +import { describe, expect, expect, test as it } from "vitest"; import { bucketHostname } from "./bucketHostname"; diff --git a/packages/middleware-bucket-endpoint/src/index.spec.ts b/packages/middleware-bucket-endpoint/src/index.spec.ts index a01c01ba9175..7940a4a494b2 100644 --- a/packages/middleware-bucket-endpoint/src/index.spec.ts +++ b/packages/middleware-bucket-endpoint/src/index.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { bucketEndpointMiddleware, getBucketEndpointPlugin, resolveBucketEndpointConfig } from "./index"; describe("middleware-bucket-endpoint package exports", () => { diff --git a/packages/middleware-bucket-endpoint/vitest.config.ts b/packages/middleware-bucket-endpoint/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-bucket-endpoint/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-endpoint-discovery/jest.config.integ.js b/packages/middleware-endpoint-discovery/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-endpoint-discovery/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-endpoint-discovery/jest.config.js b/packages/middleware-endpoint-discovery/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-endpoint-discovery/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-endpoint-discovery/package.json b/packages/middleware-endpoint-discovery/package.json index c8339ebd7ef7..fca1ea530dcc 100644 --- a/packages/middleware-endpoint-discovery/package.json +++ b/packages/middleware-endpoint-discovery/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-endpoint-discovery/src/configurations.spec.ts b/packages/middleware-endpoint-discovery/src/configurations.spec.ts index da8312948040..570cf10e6430 100644 --- a/packages/middleware-endpoint-discovery/src/configurations.spec.ts +++ b/packages/middleware-endpoint-discovery/src/configurations.spec.ts @@ -1,3 +1,5 @@ +import { afterEach, beforeEach, describe, expect, test as it } from "vitest"; + import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "./configurations"; const { diff --git a/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.spec.ts b/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.spec.ts index 340450e0fe71..4e071d2d6a80 100644 --- a/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.spec.ts +++ b/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.spec.ts @@ -1,27 +1,28 @@ import { EndpointCache } from "@aws-sdk/endpoint-cache"; import { HttpRequest } from "@smithy/protocol-http"; import { BuildHandlerArguments, MiddlewareStack } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { endpointDiscoveryMiddleware } from "./endpointDiscoveryMiddleware"; import { getCacheKey } from "./getCacheKey"; import { updateDiscoveredEndpointInCache } from "./updateDiscoveredEndpointInCache"; -jest.mock("./updateDiscoveredEndpointInCache"); -jest.mock("./getCacheKey"); -jest.mock("@smithy/protocol-http"); +vi.mock("./updateDiscoveredEndpointInCache"); +vi.mock("./getCacheKey"); +vi.mock("@smithy/protocol-http"); describe(endpointDiscoveryMiddleware.name, () => { const cacheKey = "cacheKey"; const endpoint = "endpoint"; - const getEndpoint = jest.fn().mockReturnValue(endpoint); + const getEndpoint = vi.fn().mockReturnValue(endpoint); const mockConfig = { - credentials: jest.fn(), + credentials: vi.fn(), endpointCache: { getEndpoint, } as unknown as EndpointCache, - endpointDiscoveryEnabled: jest.fn().mockResolvedValue(undefined), - endpointDiscoveryEnabledProvider: jest.fn(), - endpointDiscoveryCommandCtor: jest.fn(), + endpointDiscoveryEnabled: vi.fn().mockResolvedValue(undefined), + endpointDiscoveryEnabledProvider: vi.fn(), + endpointDiscoveryCommandCtor: vi.fn(), isCustomEndpoint: false, isClientEndpointDiscoveryEnabled: false, }; @@ -31,7 +32,7 @@ describe(endpointDiscoveryMiddleware.name, () => { clientStack: {} as MiddlewareStack, }; - const mockNext = jest.fn(); + const mockNext = vi.fn(); const mockContext = { clientName: "ExampleClient", commandName: "ExampleCommand", @@ -39,14 +40,14 @@ describe(endpointDiscoveryMiddleware.name, () => { const mockArgs = { request: {} }; beforeEach(() => { - (getCacheKey as jest.Mock).mockResolvedValue(cacheKey); - (updateDiscoveredEndpointInCache as jest.Mock).mockResolvedValue(undefined); + vi.mocked(getCacheKey).mockResolvedValue(cacheKey); + vi.mocked(updateDiscoveredEndpointInCache).mockResolvedValue(undefined); const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(true); + (isInstance as unknown as any).mockReturnValue(true); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe(`isCustomEndpoint=true`, () => { @@ -75,7 +76,7 @@ describe(endpointDiscoveryMiddleware.name, () => { mockContext )(mockArgs as BuildHandlerArguments); expect(mockNext).toHaveBeenCalledWith(mockArgs); - expect(updateDiscoveredEndpointInCache as jest.Mock).not.toHaveBeenCalled(); + expect(vi.mocked(updateDiscoveredEndpointInCache)).not.toHaveBeenCalled(); }); }); diff --git a/packages/middleware-endpoint-discovery/src/getCacheKey.spec.ts b/packages/middleware-endpoint-discovery/src/getCacheKey.spec.ts index 03d4c72811fd..b42ee40f6c93 100644 --- a/packages/middleware-endpoint-discovery/src/getCacheKey.spec.ts +++ b/packages/middleware-endpoint-discovery/src/getCacheKey.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { getCacheKey } from "./getCacheKey"; describe(getCacheKey.name, () => { diff --git a/packages/middleware-endpoint-discovery/src/getEndpointDiscoveryPlugin.spec.ts b/packages/middleware-endpoint-discovery/src/getEndpointDiscoveryPlugin.spec.ts index a85937e5a77b..882c6f9391bb 100644 --- a/packages/middleware-endpoint-discovery/src/getEndpointDiscoveryPlugin.spec.ts +++ b/packages/middleware-endpoint-discovery/src/getEndpointDiscoveryPlugin.spec.ts @@ -1,13 +1,15 @@ +import { describe, expect, test as it, vi } from "vitest"; + import { endpointDiscoveryMiddleware } from "./endpointDiscoveryMiddleware"; import { endpointDiscoveryMiddlewareOptions, getEndpointDiscoveryPlugin } from "./getEndpointDiscoveryPlugin"; -jest.mock("./endpointDiscoveryMiddleware"); +vi.mock("./endpointDiscoveryMiddleware"); describe(getEndpointDiscoveryPlugin.name, () => { const pluginConfig = { isCustomEndpoint: false, - endpointCache: jest.fn(), - endpointDiscoveryEnabled: jest.fn(), + endpointCache: vi.fn(), + endpointDiscoveryEnabled: vi.fn(), isClientEndpointDiscoveryEnabled: false, }; const middlewareConfig = { @@ -16,11 +18,11 @@ describe(getEndpointDiscoveryPlugin.name, () => { it(`applyToStack function adds endpoint discovery middleware`, () => { const middlewareReturn = {}; - (endpointDiscoveryMiddleware as jest.Mock).mockReturnValueOnce(middlewareReturn); + vi.mocked(endpointDiscoveryMiddleware).mockReturnValueOnce(middlewareReturn); // @ts-ignore const plugin = getEndpointDiscoveryPlugin(pluginConfig, middlewareConfig); - const commandStack = { add: jest.fn() }; + const commandStack = { add: vi.fn() }; // @ts-ignore plugin.applyToStack(commandStack); diff --git a/packages/middleware-endpoint-discovery/src/middleware-endpoint-discovery.integ.spec.ts b/packages/middleware-endpoint-discovery/src/middleware-endpoint-discovery.integ.spec.ts index 91c28b83d59d..362445f95962 100644 --- a/packages/middleware-endpoint-discovery/src/middleware-endpoint-discovery.integ.spec.ts +++ b/packages/middleware-endpoint-discovery/src/middleware-endpoint-discovery.integ.spec.ts @@ -1,6 +1,7 @@ import { TimestreamQuery } from "@aws-sdk/client-timestream-query"; import { TimestreamWrite } from "@aws-sdk/client-timestream-write"; import { EndpointCache } from "@aws-sdk/endpoint-cache"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; import { getCacheKey } from "./getCacheKey"; diff --git a/packages/middleware-endpoint-discovery/src/resolveEndpointDiscoveryConfig.spec.ts b/packages/middleware-endpoint-discovery/src/resolveEndpointDiscoveryConfig.spec.ts index 88a5d92ee2b1..07bb2f9ce32d 100644 --- a/packages/middleware-endpoint-discovery/src/resolveEndpointDiscoveryConfig.spec.ts +++ b/packages/middleware-endpoint-discovery/src/resolveEndpointDiscoveryConfig.spec.ts @@ -1,19 +1,20 @@ import { EndpointCache } from "@aws-sdk/endpoint-cache"; +import { afterEach, describe, expect, test as it, vi } from "vitest"; import { resolveEndpointDiscoveryConfig } from "./resolveEndpointDiscoveryConfig"; -jest.mock("@aws-sdk/endpoint-cache"); +vi.mock("@aws-sdk/endpoint-cache"); describe(resolveEndpointDiscoveryConfig.name, () => { - const endpointDiscoveryCommandCtor = jest.fn(); + const endpointDiscoveryCommandCtor = vi.fn(); const mockInput = { isCustomEndpoint: false, - credentials: jest.fn(), - endpointDiscoveryEnabledProvider: jest.fn(), + credentials: vi.fn(), + endpointDiscoveryEnabledProvider: vi.fn(), }; afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("assigns endpointDiscoveryCommandCtor in resolvedConfig", () => { diff --git a/packages/middleware-endpoint-discovery/src/updateDiscoveredEndpointInCache.spec.ts b/packages/middleware-endpoint-discovery/src/updateDiscoveredEndpointInCache.spec.ts index e5edc6d09802..f98fa6bfe4c3 100644 --- a/packages/middleware-endpoint-discovery/src/updateDiscoveredEndpointInCache.spec.ts +++ b/packages/middleware-endpoint-discovery/src/updateDiscoveredEndpointInCache.spec.ts @@ -1,13 +1,15 @@ +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; + import { updateDiscoveredEndpointInCache } from "./updateDiscoveredEndpointInCache"; describe(updateDiscoveredEndpointInCache.name, () => { const cacheKey = "cacheKey"; - const mockGet = jest.fn(); - const mockSet = jest.fn(); - const mockDelete = jest.fn(); + const mockGet = vi.fn(); + const mockSet = vi.fn(); + const mockDelete = vi.fn(); - const mockHandler = jest.fn(); - const mockResolveMiddleware = jest.fn().mockReturnValue(mockHandler); + const mockHandler = vi.fn(); + const mockResolveMiddleware = vi.fn().mockReturnValue(mockHandler); const mockEndpoints = [{ Address: "mockAddress", CachePeriodInMinutes: 2 }]; const placeholderEndpoints = [{ Address: "", CachePeriodInMinutes: 1 }]; @@ -19,7 +21,7 @@ describe(updateDiscoveredEndpointInCache.name, () => { const options = { cacheKey, commandName: "ExampleCommand", - endpointDiscoveryCommandCtor: jest.fn().mockReturnValue({ resolveMiddleware: mockResolveMiddleware }), + endpointDiscoveryCommandCtor: vi.fn().mockReturnValue({ resolveMiddleware: mockResolveMiddleware }), isDiscoveredEndpointRequired: false, identifiers: { key: "value" }, }; @@ -29,7 +31,7 @@ describe(updateDiscoveredEndpointInCache.name, () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it(`returns if endpoints are present in cacheKey`, async () => { diff --git a/packages/middleware-endpoint-discovery/vitest.config.integ.ts b/packages/middleware-endpoint-discovery/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-endpoint-discovery/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-endpoint-discovery/vitest.config.ts b/packages/middleware-endpoint-discovery/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-endpoint-discovery/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-eventstream/jest.config.integ.js b/packages/middleware-eventstream/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-eventstream/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-eventstream/package.json b/packages/middleware-eventstream/package.json index bf810c406372..40143869ad56 100644 --- a/packages/middleware-eventstream/package.json +++ b/packages/middleware-eventstream/package.json @@ -10,7 +10,8 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "test": "exit 0", - "test:integration": "jest -c jest.config.integ.js" + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-eventstream/src/middleware-eventstream.integ.spec.ts b/packages/middleware-eventstream/src/middleware-eventstream.integ.spec.ts index b412e9e98c68..781f563e5300 100644 --- a/packages/middleware-eventstream/src/middleware-eventstream.integ.spec.ts +++ b/packages/middleware-eventstream/src/middleware-eventstream.integ.spec.ts @@ -1,6 +1,7 @@ import { LexRuntimeV2 } from "@aws-sdk/client-lex-runtime-v2"; import { RekognitionStreaming } from "@aws-sdk/client-rekognitionstreaming"; import { TranscribeStreaming } from "@aws-sdk/client-transcribe-streaming"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; @@ -14,7 +15,7 @@ describe("middleware-eventstream", () => { }; // TODO: http2 in CI - xdescribe(LexRuntimeV2.name, () => { + describe.skip(LexRuntimeV2.name, () => { it("should set streaming headers", async () => { const client = new LexRuntimeV2({ region: "us-west-2", logger }); @@ -61,7 +62,7 @@ describe("middleware-eventstream", () => { }); // TODO: http2 in CI - xdescribe(TranscribeStreaming.name, () => { + describe.skip(TranscribeStreaming.name, () => { it("should set streaming headers", async () => { const client = new TranscribeStreaming({ region: "us-west-2", logger }); diff --git a/packages/middleware-eventstream/vitest.config.integ.ts b/packages/middleware-eventstream/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-eventstream/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-expect-continue/jest.config.integ.js b/packages/middleware-expect-continue/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-expect-continue/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-expect-continue/jest.config.js b/packages/middleware-expect-continue/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-expect-continue/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-expect-continue/package.json b/packages/middleware-expect-continue/package.json index b57b600d3456..77e3c3958c4b 100644 --- a/packages/middleware-expect-continue/package.json +++ b/packages/middleware-expect-continue/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-expect-continue/src/index.spec.ts b/packages/middleware-expect-continue/src/index.spec.ts index 83f863b6ffcd..3baa0f63a62c 100644 --- a/packages/middleware-expect-continue/src/index.spec.ts +++ b/packages/middleware-expect-continue/src/index.spec.ts @@ -1,12 +1,13 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { addExpectContinueMiddleware } from "./index"; describe("addExpectContinueMiddleware", () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("sets the Expect header to 100-continue if there is a request body in node runtime", async () => { diff --git a/packages/middleware-expect-continue/src/middleware-expect-continue.integ.spec.ts b/packages/middleware-expect-continue/src/middleware-expect-continue.integ.spec.ts index 583b9abb880a..22748f844c08 100644 --- a/packages/middleware-expect-continue/src/middleware-expect-continue.integ.spec.ts +++ b/packages/middleware-expect-continue/src/middleware-expect-continue.integ.spec.ts @@ -1,4 +1,5 @@ import { S3 } from "@aws-sdk/client-s3"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-expect-continue/vitest.config.integ.ts b/packages/middleware-expect-continue/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-expect-continue/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-expect-continue/vitest.config.ts b/packages/middleware-expect-continue/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-expect-continue/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-flexible-checksums/jest.config.integ.js b/packages/middleware-flexible-checksums/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-flexible-checksums/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-flexible-checksums/jest.config.js b/packages/middleware-flexible-checksums/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-flexible-checksums/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-flexible-checksums/package.json b/packages/middleware-flexible-checksums/package.json index 48caaedec308..0c89806ee9bf 100644 --- a/packages/middleware-flexible-checksums/package.json +++ b/packages/middleware-flexible-checksums/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --coverage", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.spec.ts b/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.spec.ts index 995ae1db5480..a29583f62c35 100644 --- a/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.spec.ts +++ b/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.spec.ts @@ -1,5 +1,6 @@ import { HttpRequest } from "@smithy/protocol-http"; import { BuildHandlerArguments } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { PreviouslyResolved } from "./configuration"; import { ChecksumAlgorithm } from "./constants"; @@ -11,19 +12,19 @@ import { isStreaming } from "./isStreaming"; import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction"; import { stringHasher } from "./stringHasher"; -jest.mock("@smithy/protocol-http"); -jest.mock("./getChecksumAlgorithmForRequest"); -jest.mock("./getChecksumLocationName"); -jest.mock("./hasHeader"); -jest.mock("./isStreaming"); -jest.mock("./selectChecksumAlgorithmFunction"); -jest.mock("./stringHasher"); +vi.mock("@smithy/protocol-http"); +vi.mock("./getChecksumAlgorithmForRequest"); +vi.mock("./getChecksumLocationName"); +vi.mock("./hasHeader"); +vi.mock("./isStreaming"); +vi.mock("./selectChecksumAlgorithmFunction"); +vi.mock("./stringHasher"); describe(flexibleChecksumsMiddleware.name, () => { - const mockNext = jest.fn(); + const mockNext = vi.fn(); const mockChecksum = "mockChecksum"; - const mockChecksumAlgorithmFunction = jest.fn(); + const mockChecksumAlgorithmFunction = vi.fn(); const mockChecksumLocationName = "mock-checksum-location-name"; const mockInput = {}; @@ -39,23 +40,23 @@ describe(flexibleChecksumsMiddleware.name, () => { beforeEach(() => { mockNext.mockResolvedValueOnce(mockResult); const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(true); - (getChecksumAlgorithmForRequest as jest.Mock).mockReturnValue(ChecksumAlgorithm.MD5); - (getChecksumLocationName as jest.Mock).mockReturnValue(mockChecksumLocationName); - (hasHeader as jest.Mock).mockReturnValue(true); - (isStreaming as jest.Mock).mockReturnValue(false); - (selectChecksumAlgorithmFunction as jest.Mock).mockReturnValue(mockChecksumAlgorithmFunction); + (isInstance as unknown as any).mockReturnValue(true); + vi.mocked(getChecksumAlgorithmForRequest).mockReturnValue(ChecksumAlgorithm.MD5); + vi.mocked(getChecksumLocationName).mockReturnValue(mockChecksumLocationName); + vi.mocked(hasHeader).mockReturnValue(true); + vi.mocked(isStreaming).mockReturnValue(false); + vi.mocked(selectChecksumAlgorithmFunction).mockReturnValue(mockChecksumAlgorithmFunction); }); afterEach(() => { expect(mockNext).toHaveBeenCalledTimes(1); - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("skips", () => { it("if not an instance of HttpRequest", async () => { const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(false); + (isInstance as unknown as any).mockReturnValue(false); const handler = flexibleChecksumsMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, {}); await handler(mockArgs); expect(getChecksumAlgorithmForRequest).not.toHaveBeenCalled(); @@ -67,7 +68,7 @@ describe(flexibleChecksumsMiddleware.name, () => { }); it("if checksumAlgorithm is not defined", async () => { - (getChecksumAlgorithmForRequest as jest.Mock).mockReturnValue(undefined); + vi.mocked(getChecksumAlgorithmForRequest).mockReturnValue(undefined); const handler = flexibleChecksumsMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, {}); await handler(mockArgs); expect(getChecksumLocationName).not.toHaveBeenCalled(); @@ -99,13 +100,13 @@ describe(flexibleChecksumsMiddleware.name, () => { }); it("for streaming body", async () => { - (isStreaming as jest.Mock).mockReturnValue(true); + vi.mocked(isStreaming).mockReturnValue(true); const mockUpdatedBody = { body: "mockUpdatedBody" }; - const mockBase64Encoder = jest.fn(); - const mockStreamHasher = jest.fn(); - const mockBodyLengthChecker = jest.fn(); - const mockGetAwsChunkedEncodingStream = jest.fn().mockReturnValue(mockUpdatedBody); + const mockBase64Encoder = vi.fn(); + const mockStreamHasher = vi.fn(); + const mockBodyLengthChecker = vi.fn(); + const mockGetAwsChunkedEncodingStream = vi.fn().mockReturnValue(mockUpdatedBody); const handler = flexibleChecksumsMiddleware( { @@ -146,9 +147,9 @@ describe(flexibleChecksumsMiddleware.name, () => { it("for non-streaming body", async () => { const mockRawChecksum = Buffer.from(mockChecksum); - const mockBase64Encoder = jest.fn().mockReturnValue(mockChecksum); - (stringHasher as jest.Mock).mockResolvedValue(mockRawChecksum); - (hasHeader as jest.Mock).mockReturnValue(false); + const mockBase64Encoder = vi.fn().mockReturnValue(mockChecksum); + vi.mocked(stringHasher).mockResolvedValue(mockRawChecksum); + vi.mocked(hasHeader).mockReturnValue(false); const handler = flexibleChecksumsMiddleware( { ...mockConfig, base64Encoder: mockBase64Encoder }, diff --git a/packages/middleware-flexible-checksums/src/flexibleChecksumsResponseMiddleware.spec.ts b/packages/middleware-flexible-checksums/src/flexibleChecksumsResponseMiddleware.spec.ts index 5dc42ae84836..7f65d998e1fe 100644 --- a/packages/middleware-flexible-checksums/src/flexibleChecksumsResponseMiddleware.spec.ts +++ b/packages/middleware-flexible-checksums/src/flexibleChecksumsResponseMiddleware.spec.ts @@ -1,5 +1,6 @@ import { HttpRequest } from "@smithy/protocol-http"; import { DeserializeHandlerArguments } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { PreviouslyResolved } from "./configuration"; import { ChecksumAlgorithm } from "./constants"; @@ -10,14 +11,14 @@ import { isChecksumWithPartNumber } from "./isChecksumWithPartNumber"; import { isStreaming } from "./isStreaming"; import { validateChecksumFromResponse } from "./validateChecksumFromResponse"; -jest.mock("@smithy/protocol-http"); -jest.mock("./isChecksumWithPartNumber"); -jest.mock("./isStreaming"); -jest.mock("./getChecksumLocationName"); -jest.mock("./validateChecksumFromResponse"); +vi.mock("@smithy/protocol-http"); +vi.mock("./isChecksumWithPartNumber"); +vi.mock("./isStreaming"); +vi.mock("./getChecksumLocationName"); +vi.mock("./validateChecksumFromResponse"); describe(flexibleChecksumsResponseMiddleware.name, () => { - const mockNext = jest.fn(); + const mockNext = vi.fn(); const mockContext = { clientName: "mockClientName", commandName: "mockCommandName", @@ -47,21 +48,21 @@ describe(flexibleChecksumsResponseMiddleware.name, () => { beforeEach(() => { mockNext.mockResolvedValueOnce(mockResult); const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(true); - (isChecksumWithPartNumber as jest.Mock).mockReturnValue(false); - (isStreaming as jest.Mock).mockReturnValue(false); - (getChecksumLocationName as jest.Mock).mockImplementation((algorithm) => algorithm); + (isInstance as unknown as any).mockReturnValue(true); + vi.mocked(isChecksumWithPartNumber).mockReturnValue(false); + vi.mocked(isStreaming).mockReturnValue(false); + vi.mocked(getChecksumLocationName).mockImplementation((algorithm) => algorithm); }); afterEach(() => { expect(mockNext).toHaveBeenCalledTimes(1); - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("skips", () => { it("if not an instance of HttpRequest", async () => { const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(false); + (isInstance as unknown as any).mockReturnValue(false); const handler = flexibleChecksumsResponseMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, mockContext); await handler(mockArgs); expect(validateChecksumFromResponse).not.toHaveBeenCalled(); @@ -83,7 +84,7 @@ describe(flexibleChecksumsResponseMiddleware.name, () => { }); it("if checksum is for S3 whole-object multipart GET", async () => { - (isChecksumWithPartNumber as jest.Mock).mockReturnValue(true); + vi.mocked(isChecksumWithPartNumber).mockReturnValue(true); const handler = flexibleChecksumsResponseMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, { clientName: "S3Client", commandName: "GetObjectCommand", @@ -108,7 +109,7 @@ describe(flexibleChecksumsResponseMiddleware.name, () => { }); it("if checksum is for S3 GET without part number", async () => { - (isChecksumWithPartNumber as jest.Mock).mockReturnValue(false); + vi.mocked(isChecksumWithPartNumber).mockReturnValue(false); const handler = flexibleChecksumsResponseMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, { clientName: "S3Client", commandName: "GetObjectCommand", diff --git a/packages/middleware-flexible-checksums/src/getChecksum.spec.ts b/packages/middleware-flexible-checksums/src/getChecksum.spec.ts index 187719a67561..2a8b37001468 100644 --- a/packages/middleware-flexible-checksums/src/getChecksum.spec.ts +++ b/packages/middleware-flexible-checksums/src/getChecksum.spec.ts @@ -1,15 +1,17 @@ +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; + import { getChecksum } from "./getChecksum"; import { isStreaming } from "./isStreaming"; import { stringHasher } from "./stringHasher"; -jest.mock("./isStreaming"); -jest.mock("./stringHasher"); +vi.mock("./isStreaming"); +vi.mock("./stringHasher"); describe(getChecksum.name, () => { const mockOptions = { - streamHasher: jest.fn(), - checksumAlgorithmFn: jest.fn(), - base64Encoder: jest.fn(), + streamHasher: vi.fn(), + checksumAlgorithmFn: vi.fn(), + base64Encoder: vi.fn(), }; const mockBody = "mockBody"; @@ -21,11 +23,11 @@ describe(getChecksum.name, () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("gets checksum from streamHasher if body is streaming", async () => { - (isStreaming as jest.Mock).mockReturnValue(true); + vi.mocked(isStreaming).mockReturnValue(true); mockOptions.streamHasher.mockResolvedValue(mockRawOutput); const checksum = await getChecksum(mockBody, mockOptions); expect(checksum).toEqual(mockOutput); @@ -34,8 +36,8 @@ describe(getChecksum.name, () => { }); it("gets checksum from stringHasher if body is not streaming", async () => { - (isStreaming as jest.Mock).mockReturnValue(false); - (stringHasher as jest.Mock).mockResolvedValue(mockRawOutput); + vi.mocked(isStreaming).mockReturnValue(false); + vi.mocked(stringHasher).mockResolvedValue(mockRawOutput); const checksum = await getChecksum(mockBody, mockOptions); expect(checksum).toEqual(mockOutput); expect(mockOptions.streamHasher).not.toHaveBeenCalled(); diff --git a/packages/middleware-flexible-checksums/src/getChecksumAlgorithmForRequest.spec.ts b/packages/middleware-flexible-checksums/src/getChecksumAlgorithmForRequest.spec.ts index ffefd6efd2b6..f333b56f9d9e 100644 --- a/packages/middleware-flexible-checksums/src/getChecksumAlgorithmForRequest.spec.ts +++ b/packages/middleware-flexible-checksums/src/getChecksumAlgorithmForRequest.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { ChecksumAlgorithm } from "./constants"; import { getChecksumAlgorithmForRequest } from "./getChecksumAlgorithmForRequest"; import { CLIENT_SUPPORTED_ALGORITHMS } from "./types"; diff --git a/packages/middleware-flexible-checksums/src/getChecksumAlgorithmListForResponse.spec.ts b/packages/middleware-flexible-checksums/src/getChecksumAlgorithmListForResponse.spec.ts index 4084925e827a..572d9abdf9bb 100644 --- a/packages/middleware-flexible-checksums/src/getChecksumAlgorithmListForResponse.spec.ts +++ b/packages/middleware-flexible-checksums/src/getChecksumAlgorithmListForResponse.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { getChecksumAlgorithmListForResponse } from "./getChecksumAlgorithmListForResponse"; import { PRIORITY_ORDER_ALGORITHMS } from "./types"; diff --git a/packages/middleware-flexible-checksums/src/getChecksumLocationName.spec.ts b/packages/middleware-flexible-checksums/src/getChecksumLocationName.spec.ts index cbd04755c526..26b46fe2b748 100644 --- a/packages/middleware-flexible-checksums/src/getChecksumLocationName.spec.ts +++ b/packages/middleware-flexible-checksums/src/getChecksumLocationName.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { ChecksumAlgorithm } from "./constants"; import { getChecksumLocationName } from "./getChecksumLocationName"; diff --git a/packages/middleware-flexible-checksums/src/hasHeader.spec.ts b/packages/middleware-flexible-checksums/src/hasHeader.spec.ts index ccd0aade5bad..f14254d08ea0 100644 --- a/packages/middleware-flexible-checksums/src/hasHeader.spec.ts +++ b/packages/middleware-flexible-checksums/src/hasHeader.spec.ts @@ -1,4 +1,5 @@ import { HeaderBag } from "@smithy/types"; +import { describe, expect, test as it } from "vitest"; import { hasHeader } from "./hasHeader"; diff --git a/packages/middleware-flexible-checksums/src/isChecksumWithPartNumber.spec.ts b/packages/middleware-flexible-checksums/src/isChecksumWithPartNumber.spec.ts index 72e6c7fca5e5..816cf4b6df90 100644 --- a/packages/middleware-flexible-checksums/src/isChecksumWithPartNumber.spec.ts +++ b/packages/middleware-flexible-checksums/src/isChecksumWithPartNumber.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { isChecksumWithPartNumber } from "./isChecksumWithPartNumber"; describe(isChecksumWithPartNumber.name, () => { diff --git a/packages/middleware-flexible-checksums/src/isStreaming.spec.ts b/packages/middleware-flexible-checksums/src/isStreaming.spec.ts index 339774dcacf4..e47530c6a6e4 100644 --- a/packages/middleware-flexible-checksums/src/isStreaming.spec.ts +++ b/packages/middleware-flexible-checksums/src/isStreaming.spec.ts @@ -1,20 +1,21 @@ import { isArrayBuffer } from "@smithy/is-array-buffer"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { isStreaming } from "./isStreaming"; -jest.mock("@smithy/is-array-buffer"); +vi.mock("@smithy/is-array-buffer"); describe(isStreaming.name, () => { beforeEach(() => { - (isArrayBuffer as unknown as jest.Mock).mockReturnValue(true); + (isArrayBuffer as unknown as any).mockReturnValue(true); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("returns true when body is a stream", () => { - (isArrayBuffer as unknown as jest.Mock).mockReturnValue(false); + (isArrayBuffer as unknown as any).mockReturnValue(false); // Mocking {} as a stream const mockStream = {}; expect(isStreaming(mockStream)).toBe(true); diff --git a/packages/middleware-flexible-checksums/src/middleware-flexible-checksums.integ.spec.ts b/packages/middleware-flexible-checksums/src/middleware-flexible-checksums.integ.spec.ts index 40b0d1a045d2..7dae9a2145fb 100644 --- a/packages/middleware-flexible-checksums/src/middleware-flexible-checksums.integ.spec.ts +++ b/packages/middleware-flexible-checksums/src/middleware-flexible-checksums.integ.spec.ts @@ -1,5 +1,6 @@ import { ChecksumAlgorithm, S3 } from "@aws-sdk/client-s3"; import { Transform } from "stream"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts b/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts index 59d909a607f3..404e3df5ec17 100644 --- a/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts +++ b/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts @@ -1,4 +1,5 @@ import { normalizeProvider } from "@smithy/util-middleware"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { DEFAULT_REQUEST_CHECKSUM_CALCULATION, @@ -8,15 +9,15 @@ import { } from "./constants"; import { resolveFlexibleChecksumsConfig } from "./resolveFlexibleChecksumsConfig"; -jest.mock("@smithy/util-middleware"); +vi.mock("@smithy/util-middleware"); describe(resolveFlexibleChecksumsConfig.name, () => { beforeEach(() => { - (normalizeProvider as jest.Mock).mockImplementation((input) => input); + vi.mocked(normalizeProvider).mockImplementation((input) => input); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("returns default client checksums configuration, if not provided", () => { diff --git a/packages/middleware-flexible-checksums/src/selectChecksumAlgorithmFunction.spec.ts b/packages/middleware-flexible-checksums/src/selectChecksumAlgorithmFunction.spec.ts index f26a57242303..b1323228740e 100644 --- a/packages/middleware-flexible-checksums/src/selectChecksumAlgorithmFunction.spec.ts +++ b/packages/middleware-flexible-checksums/src/selectChecksumAlgorithmFunction.spec.ts @@ -1,14 +1,15 @@ import { AwsCrc32 } from "@aws-crypto/crc32"; import { AwsCrc32c } from "@aws-crypto/crc32c"; +import { describe, expect, test as it, vi } from "vitest"; import { ChecksumAlgorithm } from "./constants"; import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction"; describe(selectChecksumAlgorithmFunction.name, () => { const mockConfig = { - md5: jest.fn(), - sha1: jest.fn(), - sha256: jest.fn(), + md5: vi.fn(), + sha1: vi.fn(), + sha256: vi.fn(), }; it.each([ diff --git a/packages/middleware-flexible-checksums/src/streams/create-read-stream-on-buffer.spec.ts b/packages/middleware-flexible-checksums/src/streams/create-read-stream-on-buffer.spec.ts index 6b01f5c2515c..ecd2429fce28 100644 --- a/packages/middleware-flexible-checksums/src/streams/create-read-stream-on-buffer.spec.ts +++ b/packages/middleware-flexible-checksums/src/streams/create-read-stream-on-buffer.spec.ts @@ -1,5 +1,6 @@ import { streamCollector } from "@smithy/node-http-handler"; import { toUtf8 } from "@smithy/util-utf8"; +import { describe, expect, test as it } from "vitest"; import { createReadStreamOnBuffer } from "./create-read-stream-on-buffer"; diff --git a/packages/middleware-flexible-checksums/src/stringHasher.spec.ts b/packages/middleware-flexible-checksums/src/stringHasher.spec.ts index f3c8fdde8aad..8aaf233b270a 100644 --- a/packages/middleware-flexible-checksums/src/stringHasher.spec.ts +++ b/packages/middleware-flexible-checksums/src/stringHasher.spec.ts @@ -1,12 +1,13 @@ import { toUint8Array } from "@smithy/util-utf8"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { stringHasher } from "./stringHasher"; describe(stringHasher.name, () => { const mockHash = new Uint8Array(Buffer.from("mockHash")); - const mockUpdate = jest.fn(); - const mockDigest = jest.fn(); - const mockChecksumAlgorithmFn = jest.fn().mockImplementation(() => ({ + const mockUpdate = vi.fn(); + const mockDigest = vi.fn(); + const mockChecksumAlgorithmFn = vi.fn().mockImplementation(() => ({ update: mockUpdate, digest: mockDigest, })); @@ -19,7 +20,7 @@ describe(stringHasher.name, () => { expect(mockChecksumAlgorithmFn).toHaveBeenCalledTimes(1); expect(mockUpdate).toHaveBeenCalledTimes(1); expect(mockDigest).toHaveBeenCalledTimes(1); - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("calculates hash of the provided string", async () => { diff --git a/packages/middleware-flexible-checksums/src/stringUnionSelector.spec.ts b/packages/middleware-flexible-checksums/src/stringUnionSelector.spec.ts index 6bcfae43b0e8..969c3527f1d9 100644 --- a/packages/middleware-flexible-checksums/src/stringUnionSelector.spec.ts +++ b/packages/middleware-flexible-checksums/src/stringUnionSelector.spec.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, test as it } from "vitest"; + import { SelectorType, stringUnionSelector } from "./stringUnionSelector"; describe(stringUnionSelector.name, () => { diff --git a/packages/middleware-flexible-checksums/src/validateChecksumFromResponse.spec.ts b/packages/middleware-flexible-checksums/src/validateChecksumFromResponse.spec.ts index 4a74aae269ca..8a8944bbe9a2 100644 --- a/packages/middleware-flexible-checksums/src/validateChecksumFromResponse.spec.ts +++ b/packages/middleware-flexible-checksums/src/validateChecksumFromResponse.spec.ts @@ -1,4 +1,5 @@ import { HttpResponse } from "@smithy/protocol-http"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { PreviouslyResolved } from "./configuration"; import { ChecksumAlgorithm } from "./constants"; @@ -8,15 +9,15 @@ import { getChecksumLocationName } from "./getChecksumLocationName"; import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction"; import { validateChecksumFromResponse } from "./validateChecksumFromResponse"; -jest.mock("./getChecksum"); -jest.mock("./getChecksumLocationName"); -jest.mock("./getChecksumAlgorithmListForResponse"); -jest.mock("./selectChecksumAlgorithmFunction"); +vi.mock("./getChecksum"); +vi.mock("./getChecksumLocationName"); +vi.mock("./getChecksumAlgorithmListForResponse"); +vi.mock("./selectChecksumAlgorithmFunction"); describe(validateChecksumFromResponse.name, () => { const mockConfig = { - streamHasher: jest.fn(), - base64Encoder: jest.fn(), + streamHasher: vi.fn(), + base64Encoder: vi.fn(), } as unknown as PreviouslyResolved; const mockBody = {}; @@ -34,7 +35,7 @@ describe(validateChecksumFromResponse.name, () => { responseAlgorithms: mockResponseAlgorithms, }; - const mockChecksumAlgorithmFn = jest.fn(); + const mockChecksumAlgorithmFn = vi.fn(); const getMockResponseWithHeader = (headerKey: string, headerValue: string) => ({ ...mockResponse, @@ -45,15 +46,15 @@ describe(validateChecksumFromResponse.name, () => { }); beforeEach(() => { - (getChecksumLocationName as jest.Mock).mockImplementation((algorithm) => algorithm); - (getChecksumAlgorithmListForResponse as jest.Mock).mockImplementation((responseAlgorithms) => responseAlgorithms); - (selectChecksumAlgorithmFunction as jest.Mock).mockReturnValue(mockChecksumAlgorithmFn); - (getChecksum as jest.Mock).mockResolvedValue(mockChecksum); + vi.mocked(getChecksumLocationName).mockImplementation((algorithm) => algorithm); + vi.mocked(getChecksumAlgorithmListForResponse).mockImplementation((responseAlgorithms) => responseAlgorithms); + vi.mocked(selectChecksumAlgorithmFunction).mockReturnValue(mockChecksumAlgorithmFn); + vi.mocked(getChecksum).mockResolvedValue(mockChecksum); }); afterEach(() => { expect(getChecksumAlgorithmListForResponse).toHaveBeenCalledTimes(1); - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("skip validation", () => { @@ -70,7 +71,7 @@ describe(validateChecksumFromResponse.name, () => { }); it("if updated algorithm list from response is empty", async () => { - (getChecksumAlgorithmListForResponse as jest.Mock).mockImplementation(() => []); + vi.mocked(getChecksumAlgorithmListForResponse).mockImplementation(() => []); await validateChecksumFromResponse(mockResponse, mockOptions); expect(getChecksumAlgorithmListForResponse).toHaveBeenCalledWith(mockResponseAlgorithms); expect(getChecksumLocationName).not.toHaveBeenCalled(); diff --git a/packages/middleware-flexible-checksums/vitest.config.integ.ts b/packages/middleware-flexible-checksums/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-flexible-checksums/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-flexible-checksums/vitest.config.ts b/packages/middleware-flexible-checksums/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-flexible-checksums/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-host-header/jest.config.integ.js b/packages/middleware-host-header/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-host-header/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-host-header/jest.config.js b/packages/middleware-host-header/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-host-header/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-host-header/package.json b/packages/middleware-host-header/package.json index bf619b4f1029..5518093fb7f8 100644 --- a/packages/middleware-host-header/package.json +++ b/packages/middleware-host-header/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-host-header/src/index.spec.ts b/packages/middleware-host-header/src/index.spec.ts index a39b0e14f697..e708a1006c5a 100644 --- a/packages/middleware-host-header/src/index.spec.ts +++ b/packages/middleware-host-header/src/index.spec.ts @@ -1,11 +1,12 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, expect, test as it, vi } from "vitest"; import { hostHeaderMiddleware } from "./index"; describe("hostHeaderMiddleware", () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should set host header if not already set", async () => { diff --git a/packages/middleware-host-header/src/middleware-host-header.integ.spec.ts b/packages/middleware-host-header/src/middleware-host-header.integ.spec.ts index 25fbe5c3a00c..a3fc56b606a1 100644 --- a/packages/middleware-host-header/src/middleware-host-header.integ.spec.ts +++ b/packages/middleware-host-header/src/middleware-host-header.integ.spec.ts @@ -1,4 +1,5 @@ import { SageMaker } from "@aws-sdk/client-sagemaker"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-host-header/vitest.config.integ.ts b/packages/middleware-host-header/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-host-header/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-host-header/vitest.config.ts b/packages/middleware-host-header/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-host-header/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-location-constraint/jest.config.integ.js b/packages/middleware-location-constraint/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-location-constraint/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-location-constraint/jest.config.js b/packages/middleware-location-constraint/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-location-constraint/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-location-constraint/package.json b/packages/middleware-location-constraint/package.json index c88f93164080..6377315f513e 100644 --- a/packages/middleware-location-constraint/package.json +++ b/packages/middleware-location-constraint/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-location-constraint/src/index.spec.ts b/packages/middleware-location-constraint/src/index.spec.ts index 6dd832185eb6..320c4be1cd18 100644 --- a/packages/middleware-location-constraint/src/index.spec.ts +++ b/packages/middleware-location-constraint/src/index.spec.ts @@ -1,13 +1,15 @@ +import { beforeEach, describe, expect, test as it, vi } from "vitest"; + import { locationConstraintMiddleware } from "./"; describe("locationConstrainMiddleware", () => { - const next = jest.fn(); + const next = vi.fn(); const basicInput = { foo: "bar", }; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("for region us-east-1", () => { diff --git a/packages/middleware-location-constraint/src/middleware-location-constraint.integ.spec.ts b/packages/middleware-location-constraint/src/middleware-location-constraint.integ.spec.ts index 3ea1798df1e5..3f6e84a3c02a 100644 --- a/packages/middleware-location-constraint/src/middleware-location-constraint.integ.spec.ts +++ b/packages/middleware-location-constraint/src/middleware-location-constraint.integ.spec.ts @@ -1,4 +1,5 @@ import { S3 } from "@aws-sdk/client-s3"; +import { describe, expect, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-location-constraint/vitest.config.integ.ts b/packages/middleware-location-constraint/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-location-constraint/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-location-constraint/vitest.config.ts b/packages/middleware-location-constraint/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-location-constraint/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-logger/jest.config.integ.js b/packages/middleware-logger/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-logger/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-logger/jest.config.js b/packages/middleware-logger/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-logger/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-logger/package.json b/packages/middleware-logger/package.json index 0985d323975d..621259afdfef 100644 --- a/packages/middleware-logger/package.json +++ b/packages/middleware-logger/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --passWithNoTests", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "author": { "name": "AWS SDK for JavaScript Team", diff --git a/packages/middleware-logger/src/loggerMiddleware.spec.ts b/packages/middleware-logger/src/loggerMiddleware.spec.ts index 4ec3f88cc60f..9c64c1b15053 100644 --- a/packages/middleware-logger/src/loggerMiddleware.spec.ts +++ b/packages/middleware-logger/src/loggerMiddleware.spec.ts @@ -1,14 +1,15 @@ import { HandlerExecutionContext, Logger, MiddlewareStack } from "@smithy/types"; +import { afterEach, describe, expect, test as it, vi } from "vitest"; import { getLoggerPlugin, loggerMiddleware, loggerMiddlewareOptions } from "./loggerMiddleware"; describe("getLoggerPlugin", () => { const mockClientStack = { - add: jest.fn(), + add: vi.fn(), }; afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("adds loggerMiddleware", () => { @@ -19,7 +20,7 @@ describe("getLoggerPlugin", () => { }); describe("loggerMiddleware", () => { - const mockNext = jest.fn(); + const mockNext = vi.fn(); const mockArgs = { input: { @@ -54,7 +55,7 @@ describe("loggerMiddleware", () => { }; afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("returns without logging if context.logger is not defined", async () => { @@ -84,14 +85,14 @@ describe("loggerMiddleware", () => { it("success case with clientName, commandName, input, metadata", async () => { mockNext.mockResolvedValueOnce(mockResponse); - const logger = { info: jest.fn() } as unknown as Logger; + const logger = { info: vi.fn() } as unknown as Logger; const clientName = "mockClientName"; const commandName = "mockCommandName"; const mockInputLog = { inputKey: "inputKey", inputSensitiveKey: "SENSITIVE_VALUE" }; - const inputFilterSensitiveLog = jest.fn().mockReturnValueOnce(mockInputLog); + const inputFilterSensitiveLog = vi.fn().mockReturnValueOnce(mockInputLog); const mockOutputLog = { outputKey: "outputKey", outputSensitiveKey: "SENSITIVE_VALUE" }; - const outputFilterSensitiveLog = jest.fn().mockReturnValueOnce(mockOutputLog); + const outputFilterSensitiveLog = vi.fn().mockReturnValueOnce(mockOutputLog); const context = { logger, @@ -125,14 +126,14 @@ describe("loggerMiddleware", () => { it("should use override log filters for DynamoDBDocumentClient if present", async () => { mockNext.mockResolvedValueOnce(mockResponse); - const logger = { info: jest.fn() } as unknown as Logger; + const logger = { info: vi.fn() } as unknown as Logger; const clientName = "mockClientName"; const commandName = "mockCommandName"; const mockInputLog = { inputKey: "inputKey", inputSensitiveKey: "SENSITIVE_VALUE" }; - const inputFilterSensitiveLog = jest.fn().mockReturnValueOnce(mockInputLog); + const inputFilterSensitiveLog = vi.fn().mockReturnValueOnce(mockInputLog); const mockOutputLog = { outputKey: "outputKey", outputSensitiveKey: "SENSITIVE_VALUE" }; - const outputFilterSensitiveLog = jest.fn().mockReturnValueOnce(mockOutputLog); + const outputFilterSensitiveLog = vi.fn().mockReturnValueOnce(mockOutputLog); const context: HandlerExecutionContext = { logger, @@ -183,9 +184,9 @@ describe("loggerMiddleware", () => { }, }; mockNext.mockResolvedValueOnce(customResponse); - const logger = { info: jest.fn() } as unknown as Logger; - const inputFilterSensitiveLog = jest.fn().mockImplementationOnce((input) => input); - const outputFilterSensitiveLog = jest.fn().mockImplementationOnce((output) => output); + const logger = { info: vi.fn() } as unknown as Logger; + const inputFilterSensitiveLog = vi.fn().mockImplementationOnce((input) => input); + const outputFilterSensitiveLog = vi.fn().mockImplementationOnce((output) => output); const context = { logger, @@ -219,9 +220,9 @@ describe("loggerMiddleware", () => { const clientName = "mockClientName"; const commandName = "mockCommandName"; - const logger = { error: jest.fn() } as unknown as Logger; - const inputFilterSensitiveLog = jest.fn().mockImplementationOnce((input) => input); - const outputFilterSensitiveLog = jest.fn().mockImplementationOnce((output) => output); + const logger = { error: vi.fn() } as unknown as Logger; + const inputFilterSensitiveLog = vi.fn().mockImplementationOnce((input) => input); + const outputFilterSensitiveLog = vi.fn().mockImplementationOnce((output) => output); const context = { clientName, @@ -253,9 +254,9 @@ describe("loggerMiddleware", () => { const clientName = "mockClientName"; const commandName = "mockCommandName"; - const logger = { error: jest.fn() } as unknown as Logger; - const inputFilterSensitiveLog = jest.fn().mockImplementationOnce((input) => input); - const outputFilterSensitiveLog = jest.fn().mockImplementationOnce((output) => output); + const logger = { error: vi.fn() } as unknown as Logger; + const inputFilterSensitiveLog = vi.fn().mockImplementationOnce((input) => input); + const outputFilterSensitiveLog = vi.fn().mockImplementationOnce((output) => output); const context = { clientName, @@ -284,14 +285,14 @@ describe("loggerMiddleware", () => { Object.assign(nextError, { $metadata }); mockNext.mockRejectedValueOnce(nextError); - const logger = { error: jest.fn() } as unknown as Logger; + const logger = { error: vi.fn() } as unknown as Logger; const clientName = "mockClientName"; const commandName = "mockCommandName"; const mockInputLog = { inputKey: "inputKey", inputSensitiveKey: "SENSITIVE_VALUE" }; - const inputFilterSensitiveLog = jest.fn().mockReturnValueOnce(mockInputLog); + const inputFilterSensitiveLog = vi.fn().mockReturnValueOnce(mockInputLog); const mockOutputLog = { outputKey: "outputKey", outputSensitiveKey: "SENSITIVE_VALUE" }; - const outputFilterSensitiveLog = jest.fn().mockReturnValueOnce(mockOutputLog); + const outputFilterSensitiveLog = vi.fn().mockReturnValueOnce(mockOutputLog); const context: HandlerExecutionContext = { logger, diff --git a/packages/middleware-logger/src/middleware-logger.integ.spec.ts b/packages/middleware-logger/src/middleware-logger.integ.spec.ts index 835cb42ead64..fef3f8f13a34 100644 --- a/packages/middleware-logger/src/middleware-logger.integ.spec.ts +++ b/packages/middleware-logger/src/middleware-logger.integ.spec.ts @@ -1,4 +1,5 @@ import { CloudFront } from "@aws-sdk/client-cloudfront"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-logger/vitest.config.integ.ts b/packages/middleware-logger/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-logger/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-logger/vitest.config.ts b/packages/middleware-logger/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-logger/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-recursion-detection/jest.config.integ.js b/packages/middleware-recursion-detection/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-recursion-detection/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-recursion-detection/jest.config.js b/packages/middleware-recursion-detection/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-recursion-detection/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-recursion-detection/package.json b/packages/middleware-recursion-detection/package.json index 531aece1e4e5..9730545b2c93 100644 --- a/packages/middleware-recursion-detection/package.json +++ b/packages/middleware-recursion-detection/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-recursion-detection/src/index.spec.ts b/packages/middleware-recursion-detection/src/index.spec.ts index c7e067e0fa47..5b2452816021 100644 --- a/packages/middleware-recursion-detection/src/index.spec.ts +++ b/packages/middleware-recursion-detection/src/index.spec.ts @@ -1,14 +1,15 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { afterAll, beforeEach, describe, expect, test as it, vi } from "vitest"; import { recursionDetectionMiddleware } from "./index"; describe(recursionDetectionMiddleware.name, () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); const originEnv = process.env; const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); process.env = {}; }); diff --git a/packages/middleware-recursion-detection/src/middleware-recursion-detection.integ.spec.ts b/packages/middleware-recursion-detection/src/middleware-recursion-detection.integ.spec.ts index aa7697b570ab..12905350be66 100644 --- a/packages/middleware-recursion-detection/src/middleware-recursion-detection.integ.spec.ts +++ b/packages/middleware-recursion-detection/src/middleware-recursion-detection.integ.spec.ts @@ -1,4 +1,5 @@ import { Lambda } from "@aws-sdk/client-lambda"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-recursion-detection/vitest.config.integ.ts b/packages/middleware-recursion-detection/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-recursion-detection/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-recursion-detection/vitest.config.ts b/packages/middleware-recursion-detection/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-recursion-detection/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-api-gateway/jest.config.integ.js b/packages/middleware-sdk-api-gateway/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-api-gateway/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-api-gateway/jest.config.js b/packages/middleware-sdk-api-gateway/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-api-gateway/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-api-gateway/package.json b/packages/middleware-sdk-api-gateway/package.json index 82753a7b446b..38baa7532a94 100644 --- a/packages/middleware-sdk-api-gateway/package.json +++ b/packages/middleware-sdk-api-gateway/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-api-gateway/src/index.spec.ts b/packages/middleware-sdk-api-gateway/src/index.spec.ts index 154a0a3c9c2d..8db268b36571 100644 --- a/packages/middleware-sdk-api-gateway/src/index.spec.ts +++ b/packages/middleware-sdk-api-gateway/src/index.spec.ts @@ -1,12 +1,13 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { acceptHeaderMiddleware } from "./index"; describe("acceptHeaderMiddleware", () => { - const next = jest.fn(); + const next = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("sets Accept header to application/json", async () => { diff --git a/packages/middleware-sdk-api-gateway/src/middleware-sdk-api-gateway.integ.spec.ts b/packages/middleware-sdk-api-gateway/src/middleware-sdk-api-gateway.integ.spec.ts index 317051d53f60..72328a5de9a3 100644 --- a/packages/middleware-sdk-api-gateway/src/middleware-sdk-api-gateway.integ.spec.ts +++ b/packages/middleware-sdk-api-gateway/src/middleware-sdk-api-gateway.integ.spec.ts @@ -1,4 +1,5 @@ import { APIGateway } from "@aws-sdk/client-api-gateway"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-api-gateway/vitest.config.integ.ts b/packages/middleware-sdk-api-gateway/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-api-gateway/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-api-gateway/vitest.config.ts b/packages/middleware-sdk-api-gateway/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-api-gateway/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-ec2/jest.config.integ.js b/packages/middleware-sdk-ec2/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-ec2/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-ec2/jest.config.js b/packages/middleware-sdk-ec2/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-ec2/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-ec2/package.json b/packages/middleware-sdk-ec2/package.json index b254d0c9dbf6..73c852e66271 100644 --- a/packages/middleware-sdk-ec2/package.json +++ b/packages/middleware-sdk-ec2/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest --config jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-ec2/src/index.spec.ts b/packages/middleware-sdk-ec2/src/index.spec.ts index ac93307ddb72..55f2a76f7d67 100755 --- a/packages/middleware-sdk-ec2/src/index.spec.ts +++ b/packages/middleware-sdk-ec2/src/index.spec.ts @@ -1,10 +1,11 @@ import { HttpRequest } from "@smithy/protocol-http"; import { EndpointV2 } from "@smithy/types"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { credentials, MockSha256, region } from "./fixture"; import { copySnapshotPresignedUrlMiddleware } from "./index"; -const nextHandler = jest.fn(); +const nextHandler = vi.fn(); const handler = copySnapshotPresignedUrlMiddleware({ credentials, region, @@ -20,7 +21,7 @@ const handler = copySnapshotPresignedUrlMiddleware({ describe("middleware-sdk-ec2", () => { beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("generates PresignedUrl and DestinationRegion parameters", async () => { diff --git a/packages/middleware-sdk-ec2/src/middleware-sdk-ec2.integ.spec.ts b/packages/middleware-sdk-ec2/src/middleware-sdk-ec2.integ.spec.ts index edd46061e974..ac1d89e89a7c 100644 --- a/packages/middleware-sdk-ec2/src/middleware-sdk-ec2.integ.spec.ts +++ b/packages/middleware-sdk-ec2/src/middleware-sdk-ec2.integ.spec.ts @@ -1,4 +1,5 @@ import { EC2 } from "@aws-sdk/client-ec2"; +import { describe, expect, expect, test as it } from "vitest"; import { TestHttpHandler } from "../../../private/aws-util-test/src"; @@ -78,7 +79,7 @@ describe("EC2", () => { }); // skipped due to ISOB failing DNS lookup - xit("in us-isob-east-1, serializes PSU and DestinationRegion when Encrypted=true and KmsKeyId present", async () => { + it.skip("in us-isob-east-1, serializes PSU and DestinationRegion when Encrypted=true and KmsKeyId present", async () => { const client = new EC2({ region: "us-isob-east-1", }); diff --git a/packages/middleware-sdk-ec2/vitest.config.integ.ts b/packages/middleware-sdk-ec2/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-ec2/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-ec2/vitest.config.ts b/packages/middleware-sdk-ec2/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-ec2/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-glacier/jest.config.integ.js b/packages/middleware-sdk-glacier/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-glacier/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-glacier/jest.config.js b/packages/middleware-sdk-glacier/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-glacier/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-glacier/package.json b/packages/middleware-sdk-glacier/package.json index d790ebb10512..d9500af0a0d3 100644 --- a/packages/middleware-sdk-glacier/package.json +++ b/packages/middleware-sdk-glacier/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-glacier/src/account-id-default.spec.ts b/packages/middleware-sdk-glacier/src/account-id-default.spec.ts index bf11331a7114..32c54897e26b 100644 --- a/packages/middleware-sdk-glacier/src/account-id-default.spec.ts +++ b/packages/middleware-sdk-glacier/src/account-id-default.spec.ts @@ -1,10 +1,12 @@ +import { beforeEach, describe, expect, test as it, vi } from "vitest"; + import { accountIdDefaultMiddleware } from "./account-id-default"; describe("accountIdDefaultMiddleware", () => { - const next = jest.fn(); + const next = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("adds default accountId if not set on input", async () => { diff --git a/packages/middleware-sdk-glacier/src/add-checksum-headers.spec.ts b/packages/middleware-sdk-glacier/src/add-checksum-headers.spec.ts index 88cd6dbe5b2d..742c5152e303 100644 --- a/packages/middleware-sdk-glacier/src/add-checksum-headers.spec.ts +++ b/packages/middleware-sdk-glacier/src/add-checksum-headers.spec.ts @@ -1,17 +1,18 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { addChecksumHeadersMiddleware } from "./add-checksum-headers"; describe("addChecksumHeadersMiddleware", () => { - const bodyChecksumGenerator = jest + const bodyChecksumGenerator = vi .fn() .mockReturnValue([ "733cf513448ce6b20ad1bc5e50eb27c06aefae0c320713a5dd99f4e51bc1ca60", "733cf513448ce6b20ad1bc5e50eb27c06aefae0c320713a5dd99f4e51bc1ca60", ]); - const sha256 = jest.fn(); - const utf8Decoder = jest.fn(); - const next = jest.fn(); + const sha256 = vi.fn(); + const utf8Decoder = vi.fn(); + const next = vi.fn(); const minimalRequest = { method: "POST", @@ -29,7 +30,7 @@ describe("addChecksumHeadersMiddleware", () => { }; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("will not set content-sha256 headers if request body is empty", async () => { diff --git a/packages/middleware-sdk-glacier/src/add-glacier-api-version.spec.ts b/packages/middleware-sdk-glacier/src/add-glacier-api-version.spec.ts index 8b72e5f1bad2..ab92faf68f66 100644 --- a/packages/middleware-sdk-glacier/src/add-glacier-api-version.spec.ts +++ b/packages/middleware-sdk-glacier/src/add-glacier-api-version.spec.ts @@ -1,13 +1,14 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { addGlacierApiVersionMiddleware } from "./add-glacier-api-version"; describe("addGlacierApiVersion", () => { - const mockNextHandler = jest.fn(); - const unusedDep = jest.fn(); + const mockNextHandler = vi.fn(); + const unusedDep = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); const config = { diff --git a/packages/middleware-sdk-glacier/src/index.spec.ts b/packages/middleware-sdk-glacier/src/index.spec.ts index 811b496bc773..4c80ecc8c013 100644 --- a/packages/middleware-sdk-glacier/src/index.spec.ts +++ b/packages/middleware-sdk-glacier/src/index.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { accountIdDefaultMiddleware, addChecksumHeadersMiddleware, diff --git a/packages/middleware-sdk-glacier/src/middleware-sdk-glacier.integ.spec.ts b/packages/middleware-sdk-glacier/src/middleware-sdk-glacier.integ.spec.ts index 595b0cb28e40..39964b82751c 100644 --- a/packages/middleware-sdk-glacier/src/middleware-sdk-glacier.integ.spec.ts +++ b/packages/middleware-sdk-glacier/src/middleware-sdk-glacier.integ.spec.ts @@ -1,4 +1,5 @@ import { Glacier } from "@aws-sdk/client-glacier"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-glacier/vitest.config.integ.ts b/packages/middleware-sdk-glacier/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-glacier/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-glacier/vitest.config.ts b/packages/middleware-sdk-glacier/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-glacier/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-machinelearning/jest.config.integ.js b/packages/middleware-sdk-machinelearning/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-machinelearning/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-machinelearning/jest.config.js b/packages/middleware-sdk-machinelearning/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-machinelearning/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-machinelearning/package.json b/packages/middleware-sdk-machinelearning/package.json index 3b71a9b66de6..efb1151e9aca 100644 --- a/packages/middleware-sdk-machinelearning/package.json +++ b/packages/middleware-sdk-machinelearning/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-machinelearning/src/index.spec.ts b/packages/middleware-sdk-machinelearning/src/index.spec.ts index 361820dce602..74a218204cf9 100644 --- a/packages/middleware-sdk-machinelearning/src/index.spec.ts +++ b/packages/middleware-sdk-machinelearning/src/index.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { getPredictEndpointPlugin, predictEndpointMiddleware } from "./index"; describe("middleware-sdk-machinelearning package exports", () => { diff --git a/packages/middleware-sdk-machinelearning/src/middleware-sdk-machinelearning.integ.spec.ts b/packages/middleware-sdk-machinelearning/src/middleware-sdk-machinelearning.integ.spec.ts index 10941b612e3c..3decb68c0d70 100644 --- a/packages/middleware-sdk-machinelearning/src/middleware-sdk-machinelearning.integ.spec.ts +++ b/packages/middleware-sdk-machinelearning/src/middleware-sdk-machinelearning.integ.spec.ts @@ -1,4 +1,5 @@ import { MachineLearning } from "@aws-sdk/client-machine-learning"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-machinelearning/src/predict-endpoint.spec.ts b/packages/middleware-sdk-machinelearning/src/predict-endpoint.spec.ts index 0008bc4a9ae9..8d51b1ffd035 100644 --- a/packages/middleware-sdk-machinelearning/src/predict-endpoint.spec.ts +++ b/packages/middleware-sdk-machinelearning/src/predict-endpoint.spec.ts @@ -1,14 +1,15 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { predictEndpointMiddleware } from "./predict-endpoint"; describe("predictEndpointMiddleware", () => { - const mockUrlParser = jest.fn().mockReturnValue({ + const mockUrlParser = vi.fn().mockReturnValue({ hostname: "api.example.com", path: "/foo/bar", protocol: "http:", }); - const next = jest.fn(); + const next = vi.fn(); beforeEach(() => { mockUrlParser.mockClear(); diff --git a/packages/middleware-sdk-machinelearning/vitest.config.integ.ts b/packages/middleware-sdk-machinelearning/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-machinelearning/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-machinelearning/vitest.config.ts b/packages/middleware-sdk-machinelearning/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-machinelearning/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-rds/jest.config.integ.js b/packages/middleware-sdk-rds/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-rds/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-rds/jest.config.js b/packages/middleware-sdk-rds/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-rds/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-rds/package.json b/packages/middleware-sdk-rds/package.json index d02c7efbba7a..809e30f3de03 100644 --- a/packages/middleware-sdk-rds/package.json +++ b/packages/middleware-sdk-rds/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest --config jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-rds/src/index.spec.ts b/packages/middleware-sdk-rds/src/index.spec.ts index 7134cf8002e5..b82d683cecb5 100644 --- a/packages/middleware-sdk-rds/src/index.spec.ts +++ b/packages/middleware-sdk-rds/src/index.spec.ts @@ -1,7 +1,9 @@ +import { beforeEach, describe, expect, test as it, vi } from "vitest"; + import { crossRegionPresignedUrlMiddleware } from "./"; import { credentials, endpoint, MockSha256, region } from "./fixture"; -const nextHandler = jest.fn(); +const nextHandler = vi.fn(); const arn = "arn:aws:rds:src-region:000000000000:src-snapshot:dist-snapshot"; const arnSameRegion = "arn:aws:rds:mock-region:000000000000:src-snapshot:dist-snapshot"; const sourceIdentifier = "src-snapshot"; @@ -16,7 +18,7 @@ const handler = crossRegionPresignedUrlMiddleware({ describe("middleware-sdk-rds", () => { beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should build CopyDBSnapshot cross origin presigned url correctly ", async () => { diff --git a/packages/middleware-sdk-rds/src/middleware-sdk-rds.integ.spec.ts b/packages/middleware-sdk-rds/src/middleware-sdk-rds.integ.spec.ts index 7a9af75243ba..8825c6671171 100644 --- a/packages/middleware-sdk-rds/src/middleware-sdk-rds.integ.spec.ts +++ b/packages/middleware-sdk-rds/src/middleware-sdk-rds.integ.spec.ts @@ -1,4 +1,5 @@ import { RDS } from "@aws-sdk/client-rds"; +import { describe, expect, expect, test as it } from "vitest"; import { TestHttpHandler } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-rds/vitest.config.integ.ts b/packages/middleware-sdk-rds/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-rds/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-rds/vitest.config.ts b/packages/middleware-sdk-rds/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-rds/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-route53/jest.config.integ.js b/packages/middleware-sdk-route53/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-route53/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-route53/jest.config.js b/packages/middleware-sdk-route53/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-route53/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-route53/package.json b/packages/middleware-sdk-route53/package.json index b1b4697b5812..a821717a00d3 100644 --- a/packages/middleware-sdk-route53/package.json +++ b/packages/middleware-sdk-route53/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-route53/src/change-resource-record-sets.spec.ts b/packages/middleware-sdk-route53/src/change-resource-record-sets.spec.ts index 7835cbc7a203..933a8c91624d 100644 --- a/packages/middleware-sdk-route53/src/change-resource-record-sets.spec.ts +++ b/packages/middleware-sdk-route53/src/change-resource-record-sets.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it, vi } from "vitest"; + import { changeResourceRecordSetsMiddleware } from "./change-resource-record-sets"; const prefixedProps = ["/hostedzone/ID", "/change/ID", "/delegationset/ID"]; @@ -5,7 +7,7 @@ const prefixedProps = ["/hostedzone/ID", "/change/ID", "/delegationset/ID"]; describe("changeResourceRecordSetsMiddleware", () => { for (const prefixed of prefixedProps) { it(`should strip the prefix from the ChangeBatch.Changes[*].ResourceRecordSet.AliasTarget.HostedZoneId parameter`, async () => { - const next = jest.fn(); + const next = vi.fn(); const input = { ChangeBatch: { Changes: (function* () { diff --git a/packages/middleware-sdk-route53/src/id-normalizer.spec.ts b/packages/middleware-sdk-route53/src/id-normalizer.spec.ts index e8f8ea787320..f2a40a337ee3 100644 --- a/packages/middleware-sdk-route53/src/id-normalizer.spec.ts +++ b/packages/middleware-sdk-route53/src/id-normalizer.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it, vi } from "vitest"; + import { idNormalizerMiddleware } from "./id-normalizer"; const prefixedProps = ["/hostedzone/ID", "/change/ID", "/delegationset/ID"]; @@ -7,7 +9,7 @@ describe("idNormalizerMiddleware", () => { for (const paramName of idParams) { for (const prefixed of prefixedProps) { it(`should strip the prefix from the ${paramName} parameter`, async () => { - const next = jest.fn(); + const next = vi.fn(); const input = { [paramName]: prefixed }; const handler = idNormalizerMiddleware()(next, {} as any); diff --git a/packages/middleware-sdk-route53/src/index.spec.ts b/packages/middleware-sdk-route53/src/index.spec.ts index aa4a90613fec..920ddfbbb6ea 100644 --- a/packages/middleware-sdk-route53/src/index.spec.ts +++ b/packages/middleware-sdk-route53/src/index.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { changeResourceRecordSetsMiddleware, getChangeResourceRecordSetsPlugin, diff --git a/packages/middleware-sdk-route53/src/middleware-sdk-route53.integ.spec.ts b/packages/middleware-sdk-route53/src/middleware-sdk-route53.integ.spec.ts index 8fea9f7e35fe..db1cc54faf30 100644 --- a/packages/middleware-sdk-route53/src/middleware-sdk-route53.integ.spec.ts +++ b/packages/middleware-sdk-route53/src/middleware-sdk-route53.integ.spec.ts @@ -1,5 +1,6 @@ import { Route53 } from "@aws-sdk/client-route-53"; import { XMLParser } from "fast-xml-parser"; +import { describe, expect, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-route53/vitest.config.integ.ts b/packages/middleware-sdk-route53/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-route53/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-route53/vitest.config.ts b/packages/middleware-sdk-route53/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-route53/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-s3-control/jest.config.integ.js b/packages/middleware-sdk-s3-control/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-s3-control/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-s3-control/jest.config.js b/packages/middleware-sdk-s3-control/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-s3-control/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-s3-control/package.json b/packages/middleware-sdk-s3-control/package.json index 039c5b82e09a..11a49c53b6e0 100644 --- a/packages/middleware-sdk-s3-control/package.json +++ b/packages/middleware-sdk-s3-control/package.json @@ -9,9 +9,11 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js", - "extract:docs": "api-extractor run --local" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "extract:docs": "api-extractor run --local", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts b/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts index 6d1c6c250d88..c1b4c231014b 100644 --- a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts +++ b/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { deduplicateHostPrefix } from "./deduplicateHostPrefix"; describe(deduplicateHostPrefix.name, () => { diff --git a/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts b/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts index 9c0fd10e32c5..186a362de21d 100644 --- a/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts +++ b/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts @@ -1,4 +1,5 @@ import { S3Control } from "@aws-sdk/client-s3-control"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getOutpostEndpoint.spec.ts b/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getOutpostEndpoint.spec.ts index d4fc5b3138a2..c25d1956bf62 100644 --- a/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getOutpostEndpoint.spec.ts +++ b/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getOutpostEndpoint.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { getOutpostEndpoint } from "./getOutpostEndpoint"; describe(getOutpostEndpoint.name, () => { diff --git a/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getProcessArnablesPlugin.spec.ts b/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getProcessArnablesPlugin.spec.ts index 2de3a578dd41..eaa978f28731 100644 --- a/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getProcessArnablesPlugin.spec.ts +++ b/packages/middleware-sdk-s3-control/src/process-arnables-plugin/getProcessArnablesPlugin.spec.ts @@ -1,6 +1,7 @@ import { constructStack } from "@smithy/middleware-stack"; import { HttpRequest } from "@smithy/protocol-http"; import { Provider, RegionInfo } from "@smithy/types"; +import { beforeEach, describe, expect, expect, test as it, vi } from "vitest"; import { S3ControlResolvedConfig } from "../configurations"; import { getProcessArnablesPlugin } from "./getProcessArnablesPlugin"; @@ -19,9 +20,9 @@ describe("getProcessArnablesMiddleware", () => { useFipsEndpoint: () => Promise.resolve(false), useDualstackEndpoint: () => Promise.resolve(false), ...options, - regionInfoProvider: options.regionInfoProvider ?? jest.fn().mockResolvedValue({ partition: "aws" }), - region: jest.fn().mockResolvedValue(options.region), - useArnRegion: jest.fn().mockResolvedValue(options.useArnRegion ?? false), + regionInfoProvider: options.regionInfoProvider ?? vi.fn().mockResolvedValue({ partition: "aws" }), + region: vi.fn().mockResolvedValue(options.region), + useArnRegion: vi.fn().mockResolvedValue(options.useArnRegion ?? false), isCustomEndpoint: false, }; }; @@ -57,7 +58,7 @@ describe("getProcessArnablesMiddleware", () => { }; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("Outposts Access Point Arn", () => { diff --git a/packages/middleware-sdk-s3-control/src/redirect-from-postid.spec.ts b/packages/middleware-sdk-s3-control/src/redirect-from-postid.spec.ts index 8264b76deb4c..4c999940ed3e 100644 --- a/packages/middleware-sdk-s3-control/src/redirect-from-postid.spec.ts +++ b/packages/middleware-sdk-s3-control/src/redirect-from-postid.spec.ts @@ -1,4 +1,5 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { describe, expect, test as it } from "vitest"; import { redirectFromPostIdMiddleware } from "./redirect-from-postid"; diff --git a/packages/middleware-sdk-s3-control/vitest.config.integ.ts b/packages/middleware-sdk-s3-control/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-s3-control/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-s3-control/vitest.config.ts b/packages/middleware-sdk-s3-control/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-s3-control/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-s3/jest.config.e2e.js b/packages/middleware-sdk-s3/jest.config.e2e.js deleted file mode 100644 index b4d9bee23f48..000000000000 --- a/packages/middleware-sdk-s3/jest.config.e2e.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.e2e.spec.ts"], -}; diff --git a/packages/middleware-sdk-s3/jest.config.integ.js b/packages/middleware-sdk-s3/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-s3/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-s3/jest.config.js b/packages/middleware-sdk-s3/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-s3/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-s3/package.json b/packages/middleware-sdk-s3/package.json index 39afb34941ea..96647c9e0721 100644 --- a/packages/middleware-sdk-s3/package.json +++ b/packages/middleware-sdk-s3/package.json @@ -9,10 +9,13 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js", - "test:e2e": "jest -c jest.config.e2e.js", - "extract:docs": "api-extractor run --local" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:e2e": "vitest run -c vitest.config.e2e.ts", + "extract:docs": "api-extractor run --local", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-s3/src/check-content-length-header.spec.ts b/packages/middleware-sdk-s3/src/check-content-length-header.spec.ts index 57f3ec28f402..27ed5c258ad5 100644 --- a/packages/middleware-sdk-s3/src/check-content-length-header.spec.ts +++ b/packages/middleware-sdk-s3/src/check-content-length-header.spec.ts @@ -1,18 +1,19 @@ import { NoOpLogger } from "@smithy/smithy-client"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { checkContentLengthHeader } from "./check-content-length-header"; describe("checkContentLengthHeaderMiddleware", () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); - let spy: jest.SpyInstance; + let spy: vi.SpyInstance; beforeEach(() => { - spy = jest.spyOn(console, "warn"); + spy = vi.spyOn(console, "warn"); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("warns if uploading a payload of unknown length", async () => { diff --git a/packages/middleware-sdk-s3/src/middleware-sdk-s3.integ.spec.ts b/packages/middleware-sdk-s3/src/middleware-sdk-s3.integ.spec.ts index b94232466f6f..6e619da79e69 100644 --- a/packages/middleware-sdk-s3/src/middleware-sdk-s3.integ.spec.ts +++ b/packages/middleware-sdk-s3/src/middleware-sdk-s3.integ.spec.ts @@ -1,4 +1,5 @@ import { S3 } from "@aws-sdk/client-s3"; +import { describe, expect, expect, test as it, vi } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; @@ -33,11 +34,11 @@ describe("middleware-sdk-s3", () => { const client = new S3({ region: "us-west-2", logger: Object.assign({ - trace: jest.fn(), - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), + trace: vi.fn(), + debug: vi.fn(), + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), }), }); diff --git a/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts b/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts index c7267bb4f878..78ef2589452d 100644 --- a/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts +++ b/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts @@ -1,7 +1,6 @@ import { S3 } from "@aws-sdk/client-s3"; import { GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; - -jest.setTimeout(100000); +import { afterAll, beforeAll, describe, expect, test as it } from "vitest"; const testValue = "Hello S3 global client!"; @@ -65,7 +64,7 @@ describe("S3 Global Client Test", () => { } } }); -}); +}, 100_000); async function deleteBucket(s3: S3, bucketName: string) { const Bucket = bucketName; diff --git a/packages/middleware-sdk-s3/src/region-redirect-middleware.spec.ts b/packages/middleware-sdk-s3/src/region-redirect-middleware.spec.ts index 3b30b8827de2..b755f360397b 100644 --- a/packages/middleware-sdk-s3/src/region-redirect-middleware.spec.ts +++ b/packages/middleware-sdk-s3/src/region-redirect-middleware.spec.ts @@ -1,4 +1,5 @@ import { HandlerExecutionContext } from "@smithy/types"; +import { beforeEach, describe, expect, test as it } from "vitest"; import { regionRedirectMiddleware } from "./region-redirect-middleware"; diff --git a/packages/middleware-sdk-s3/src/s3-expires-middleware.e2e.spec.ts b/packages/middleware-sdk-s3/src/s3-expires-middleware.e2e.spec.ts index 6b7ca0f78e8b..ff45d623bfea 100644 --- a/packages/middleware-sdk-s3/src/s3-expires-middleware.e2e.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-expires-middleware.e2e.spec.ts @@ -1,7 +1,6 @@ import { S3 } from "@aws-sdk/client-s3"; import { GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; - -jest.setTimeout(25000); +import { afterAll, beforeAll, describe, expect, test as it, vi } from "vitest"; describe("S3 Expires e2e test", () => { const s3 = new S3({ @@ -10,7 +9,7 @@ describe("S3 Expires e2e test", () => { trace() {}, debug() {}, info() {}, - warn: jest.fn(), + warn: vi.fn(), error() {}, }, }); @@ -77,7 +76,7 @@ describe("S3 Expires e2e test", () => { ); expect(get.ExpiresString).toEqual("undefined, NaN undefined NaN NaN:NaN:NaN GMT"); }); -}); +}, 25_000); async function deleteBucket(s3: S3, bucketName: string) { const Bucket = bucketName; diff --git a/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCache.spec.ts b/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCache.spec.ts index 800a952cf5e4..1f0dee83fb5d 100644 --- a/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCache.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCache.spec.ts @@ -1,3 +1,5 @@ +import { afterAll, describe, expect, test as it } from "vitest"; + import { S3ExpressIdentityCache } from "./S3ExpressIdentityCache"; import { S3ExpressIdentityCacheEntry } from "./S3ExpressIdentityCacheEntry"; diff --git a/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCacheEntry.spec.ts b/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCacheEntry.spec.ts index 28f2937f5e8d..60ddc0124cbc 100644 --- a/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCacheEntry.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityCacheEntry.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { S3ExpressIdentityCacheEntry } from "./S3ExpressIdentityCacheEntry"; describe(S3ExpressIdentityCacheEntry.name, () => { diff --git a/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityProviderImpl.spec.ts b/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityProviderImpl.spec.ts index 7dc2521b7dca..d31c6bb91609 100644 --- a/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityProviderImpl.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityProviderImpl.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it, vi } from "vitest"; + import { S3ExpressIdentityProviderImpl } from "./S3ExpressIdentityProviderImpl"; describe(S3ExpressIdentityProviderImpl.name, () => { @@ -19,7 +21,7 @@ describe(S3ExpressIdentityProviderImpl.name, () => { describe(S3ExpressIdentityProviderImpl.prototype.getS3ExpressIdentity.name, () => { it("calls getIdentity when cache is empty", async () => { - const createSessionFn = jest.fn().mockImplementation(async () => ({ Credentials })); + const createSessionFn = vi.fn().mockImplementation(async () => ({ Credentials })); const identityProvider = new S3ExpressIdentityProviderImpl(createSessionFn); const identity = await identityProvider.getS3ExpressIdentity(s3ExpressCredentials, { Bucket: "Bucky" }); @@ -28,7 +30,7 @@ describe(S3ExpressIdentityProviderImpl.name, () => { }); it("returns cached entries", async () => { - const createSessionFn = jest.fn().mockImplementation(async () => ({ Credentials })); + const createSessionFn = vi.fn().mockImplementation(async () => ({ Credentials })); const identityProvider = new S3ExpressIdentityProviderImpl(createSessionFn); const identity = await identityProvider.getS3ExpressIdentity(s3ExpressCredentials, { Bucket: "Bucky" }); diff --git a/packages/middleware-sdk-s3/src/s3-express/classes/SignatureV4S3Express.spec.ts b/packages/middleware-sdk-s3/src/s3-express/classes/SignatureV4S3Express.spec.ts index ce3be18c666b..8f84439bd279 100644 --- a/packages/middleware-sdk-s3/src/s3-express/classes/SignatureV4S3Express.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/classes/SignatureV4S3Express.spec.ts @@ -1,7 +1,8 @@ +import { describe, expect, test as it } from "vitest"; + // import { Hash } from "@smithy/hash-node"; // import { HttpRequest } from "@smithy/protocol-http"; // import { SignatureV4 } from "@smithy/signature-v4"; - // import { SESSION_TOKEN_HEADER } from "../constants"; import { SignatureV4S3Express } from "./SignatureV4S3Express"; diff --git a/packages/middleware-sdk-s3/src/s3-express/functions/s3ExpressMiddleware.spec.ts b/packages/middleware-sdk-s3/src/s3-express/functions/s3ExpressMiddleware.spec.ts index df805e78129e..814d82530d25 100644 --- a/packages/middleware-sdk-s3/src/s3-express/functions/s3ExpressMiddleware.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/functions/s3ExpressMiddleware.spec.ts @@ -1,3 +1,5 @@ +import { describe, test as it } from "vitest"; + import { s3ExpressMiddleware } from "./s3ExpressMiddleware"; describe(s3ExpressMiddleware.name, () => { diff --git a/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.e2e.spec.ts b/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.e2e.spec.ts index 24fb6032d268..971236036213 100644 --- a/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.e2e.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.e2e.spec.ts @@ -3,14 +3,13 @@ import { STS } from "@aws-sdk/client-sts"; import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; import http from "http"; import https from "https"; +import { afterAll, beforeAll, describe, expect, test as it } from "vitest"; const region = "us-east-1"; const zone = "use1-az6"; const suffix = `${zone}--x-s3`; describe("s3 express CRUD test suite", () => { - jest.setTimeout(30000); - let s3: S3; // test subject. let controller: S3; // separate test-assistant client. let bucketName: string; // test bucket (temp) @@ -147,7 +146,7 @@ describe("s3 express CRUD test suite", () => { expect(data).toEqual("abcd"); }); - xit("can presign put", async () => { + it.skip("can presign put", async () => { const body = Buffer.from("abcd"); const putObject = new PutObjectCommand({ Bucket: bucketName, @@ -187,7 +186,7 @@ describe("s3 express CRUD test suite", () => { expect(data).toEqual("xyz"); }); -}); +}, 30_000); async function createClientAndRecorder() { const sts = new STS({ region }); @@ -218,9 +217,7 @@ async function createClientAndRecorder() { const commandName = context.commandName + s3ExpressSuffix; const input = args.input; const commandRecorder = (recorder.calls[commandName] = recorder.calls[commandName] ?? {}); - // @ts-expect-error Element implicitly has an 'any' type commandRecorder[input["Bucket"] ?? "-"] |= 0; - // @ts-expect-error Element implicitly has an 'any' type commandRecorder[input["Bucket"] ?? "-"]++; return continuation; diff --git a/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.integ.spec.ts b/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.integ.spec.ts index e969678effe7..7b3727f83959 100644 --- a/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.integ.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-express/middleware-s3-express.integ.spec.ts @@ -1,5 +1,6 @@ import { S3 } from "@aws-sdk/client-s3"; import { AwsCredentialIdentity } from "@aws-sdk/types"; +import { describe, expect, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../../private/aws-util-test/src"; import { S3ExpressIdentity, S3ExpressIdentityProvider } from "./index"; diff --git a/packages/middleware-sdk-s3/src/s3-type-transforms.integ.spec.ts b/packages/middleware-sdk-s3/src/s3-type-transforms.integ.spec.ts index a8e9430be877..723130fa0526 100644 --- a/packages/middleware-sdk-s3/src/s3-type-transforms.integ.spec.ts +++ b/packages/middleware-sdk-s3/src/s3-type-transforms.integ.spec.ts @@ -1,5 +1,6 @@ import { GetObjectCommand, GetObjectCommandInput, S3, S3Client } from "@aws-sdk/client-s3"; import type { AssertiveClient, BrowserClient, NodeJsClient, NoUndefined, UncheckedClient } from "@smithy/types"; +import { describe, test as it } from "vitest"; describe("S3 client transform integration test", () => { it("has the expected compilation behavior", async () => { diff --git a/packages/middleware-sdk-s3/src/throw-200-exceptions.e2e.spec.ts b/packages/middleware-sdk-s3/src/throw-200-exceptions.e2e.spec.ts index c4e32a64bb91..8ef2d004fb42 100644 --- a/packages/middleware-sdk-s3/src/throw-200-exceptions.e2e.spec.ts +++ b/packages/middleware-sdk-s3/src/throw-200-exceptions.e2e.spec.ts @@ -1,7 +1,6 @@ import { S3 } from "@aws-sdk/client-s3"; import { GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; - -jest.setTimeout(100000); +import { afterAll, beforeAll, describe, test as it } from "vitest"; describe("S3 throw 200 exceptions", () => { const config = { @@ -54,4 +53,4 @@ describe("S3 throw 200 exceptions", () => { }); } }); -}); +}, 100_000); diff --git a/packages/middleware-sdk-s3/src/throw-200-exceptions.spec.ts b/packages/middleware-sdk-s3/src/throw-200-exceptions.spec.ts index 031631803c4c..ab8b0ce09ad9 100644 --- a/packages/middleware-sdk-s3/src/throw-200-exceptions.spec.ts +++ b/packages/middleware-sdk-s3/src/throw-200-exceptions.spec.ts @@ -1,18 +1,19 @@ import { HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { toUtf8 } from "@smithy/util-utf8"; import { Readable } from "stream"; +import { beforeEach, describe, expect, expect, test as it, vi } from "vitest"; import { throw200ExceptionsMiddleware } from "./throw-200-exceptions"; describe("throw200ExceptionsMiddlewareOptions", () => { - const mockNextHandler = jest.fn(); - const mockResponse = jest.fn(); + const mockNextHandler = vi.fn(); + const mockResponse = vi.fn(); const mockConfig = { utf8Encoder: toUtf8, }; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("tests for statusCode < 200 and >= 300", () => { diff --git a/packages/middleware-sdk-s3/src/validate-bucket-name.spec.ts b/packages/middleware-sdk-s3/src/validate-bucket-name.spec.ts index b0864379f881..e0a5fb5c112e 100644 --- a/packages/middleware-sdk-s3/src/validate-bucket-name.spec.ts +++ b/packages/middleware-sdk-s3/src/validate-bucket-name.spec.ts @@ -1,13 +1,17 @@ -const mockValidateArn = jest.fn(); -jest.mock("@aws-sdk/util-arn-parser", () => ({ validate: mockValidateArn })); +import { beforeEach, describe, expect, test as it, vi } from "vitest"; + +vi.mock("@aws-sdk/util-arn-parser", () => ({ validate: vi.fn() })); + +import { validate } from "@aws-sdk/util-arn-parser"; + import { validateBucketNameMiddleware } from "./validate-bucket-name"; describe("validateBucketNameMiddleware", () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); - mockValidateArn.mockReturnValue(false); + vi.clearAllMocks(); + vi.mocked(validate).mockReturnValue(false); }); it("throws error if Bucket parameter contains '/'", async () => { @@ -41,7 +45,7 @@ describe("validateBucketNameMiddleware", () => { }); it("should not validate bucket name if the bucket name is an ARN", async () => { - mockValidateArn.mockReturnValue(true); + vi.mocked(validate).mockReturnValue(true); const handler = validateBucketNameMiddleware({} as any)(mockNextHandler, {} as any); const args = { input: { diff --git a/packages/middleware-sdk-s3/vitest.config.e2e.ts b/packages/middleware-sdk-s3/vitest.config.e2e.ts new file mode 100644 index 000000000000..92073c6cfcf0 --- /dev/null +++ b/packages/middleware-sdk-s3/vitest.config.e2e.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.e2e.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-s3/vitest.config.integ.ts b/packages/middleware-sdk-s3/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-s3/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-s3/vitest.config.ts b/packages/middleware-sdk-s3/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-s3/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-sqs/jest.config.integ.js b/packages/middleware-sdk-sqs/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-sqs/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-sqs/jest.config.js b/packages/middleware-sdk-sqs/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-sdk-sqs/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-sdk-sqs/package.json b/packages/middleware-sdk-sqs/package.json index df0a8c5311f6..4b092d06adb1 100644 --- a/packages/middleware-sdk-sqs/package.json +++ b/packages/middleware-sdk-sqs/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-sqs/src/middleware-sdk-sqs.integ.spec.ts b/packages/middleware-sdk-sqs/src/middleware-sdk-sqs.integ.spec.ts index 12b0bc0c0e58..73307c091435 100644 --- a/packages/middleware-sdk-sqs/src/middleware-sdk-sqs.integ.spec.ts +++ b/packages/middleware-sdk-sqs/src/middleware-sdk-sqs.integ.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpResponse } from "@smithy/protocol-http"; import type { AwsCredentialIdentity } from "@smithy/types"; import crypto from "crypto"; import { Readable } from "stream"; +import { beforeEach, describe, expect, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-sdk-sqs/src/queue-url.spec.ts b/packages/middleware-sdk-sqs/src/queue-url.spec.ts index 69d8826499a9..7750ac3fa109 100644 --- a/packages/middleware-sdk-sqs/src/queue-url.spec.ts +++ b/packages/middleware-sdk-sqs/src/queue-url.spec.ts @@ -1,15 +1,16 @@ import { HttpRequest } from "@aws-sdk/protocol-http"; import { FinalizeHandlerArguments, HandlerExecutionContext } from "@aws-sdk/types"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { queueUrlMiddleware } from "./queue-url"; describe("queueUrlMiddleware", () => { - const mockNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); const mockContext: HandlerExecutionContext = { logger: { ...console, - warn: jest.fn(), + warn: vi.fn(), }, endpointV2: void 0, }; @@ -23,7 +24,7 @@ describe("queueUrlMiddleware", () => { }); afterEach(() => { - jest.resetAllMocks(); + vi.resetAllMocks(); }); it("should use the QueueUrl hostname as the endpoint if useQueueUrlAsEndpoint is true", async () => { diff --git a/packages/middleware-sdk-sqs/src/receive-messages.spec.ts b/packages/middleware-sdk-sqs/src/receive-messages.spec.ts index 1d185cfaad06..97967e463607 100644 --- a/packages/middleware-sdk-sqs/src/receive-messages.spec.ts +++ b/packages/middleware-sdk-sqs/src/receive-messages.spec.ts @@ -1,11 +1,12 @@ import { ChecksumConstructor } from "@smithy/types"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { receiveMessageMiddleware } from "./receive-message"; describe("receiveMessageMiddleware", () => { - const mockHashUpdate = jest.fn(); - const mockHashDigest = jest.fn().mockReturnValue(new Uint8Array(1)); - const mockHashReset = jest.fn(); + const mockHashUpdate = vi.fn(); + const mockHashDigest = vi.fn().mockReturnValue(new Uint8Array(1)); + const mockHashReset = vi.fn(); const MockHash: ChecksumConstructor = class {} as any; MockHash.prototype.update = mockHashUpdate; MockHash.prototype.digest = mockHashDigest; @@ -18,7 +19,7 @@ describe("receiveMessageMiddleware", () => { }); it("should only call next once", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Messages: [ { Body: "foo", MD5OfBody: "00", MessageId: "fooMessage" }, @@ -34,7 +35,7 @@ describe("receiveMessageMiddleware", () => { }); it("should do nothing if the checksums match", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Messages: [ { Body: "foo", MD5OfBody: "00", MessageId: "fooMessage" }, @@ -53,7 +54,7 @@ describe("receiveMessageMiddleware", () => { }); it("should throw if the checksum does not match", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Messages: [ { Body: "foo", MD5OfBody: "00", MessageId: "fooMessage" }, @@ -71,7 +72,7 @@ describe("receiveMessageMiddleware", () => { }); it("ignores checksum if md5=false in config", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Messages: [ { Body: "foo", MD5OfBody: "XXYYZZ", MessageId: "fooMessage" }, diff --git a/packages/middleware-sdk-sqs/src/send-message-batch.spec.ts b/packages/middleware-sdk-sqs/src/send-message-batch.spec.ts index 4eff4185e186..1a4e0905b5eb 100644 --- a/packages/middleware-sdk-sqs/src/send-message-batch.spec.ts +++ b/packages/middleware-sdk-sqs/src/send-message-batch.spec.ts @@ -1,11 +1,12 @@ import { ChecksumConstructor } from "@smithy/types"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { sendMessageBatchMiddleware } from "./send-message-batch"; describe("sendMessageBatchMiddleware", () => { - const mockHashUpdate = jest.fn(); - const mockHashDigest = jest.fn().mockReturnValue(new Uint8Array(1)); - const mockHashReset = jest.fn(); + const mockHashUpdate = vi.fn(); + const mockHashDigest = vi.fn().mockReturnValue(new Uint8Array(1)); + const mockHashReset = vi.fn(); const MockHash: ChecksumConstructor = class {} as any; MockHash.prototype.update = mockHashUpdate; MockHash.prototype.digest = mockHashDigest; @@ -18,7 +19,7 @@ describe("sendMessageBatchMiddleware", () => { }); it("should call next exactly once", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Successful: [ { Id: "foo", MD5OfMessageBody: "00" }, @@ -43,7 +44,7 @@ describe("sendMessageBatchMiddleware", () => { }); it("should do nothing if the checksums match", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Successful: [ { Id: "foo", MD5OfMessageBody: "00" }, @@ -69,7 +70,7 @@ describe("sendMessageBatchMiddleware", () => { }); it("should throw if the checksum does not match", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { Successful: [ { Id: "foo", MD5OfMessageBody: "00", MessageId: "fooMessage" }, diff --git a/packages/middleware-sdk-sqs/src/send-message.spec.ts b/packages/middleware-sdk-sqs/src/send-message.spec.ts index 2eeea59abacf..948cd609825a 100644 --- a/packages/middleware-sdk-sqs/src/send-message.spec.ts +++ b/packages/middleware-sdk-sqs/src/send-message.spec.ts @@ -1,11 +1,12 @@ import { ChecksumConstructor } from "@smithy/types"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { sendMessageMiddleware } from "./send-message"; describe("sendMessageMiddleware", () => { - const mockHashUpdate = jest.fn(); - const mockHashReset = jest.fn(); - const mockHashDigest = jest.fn().mockReturnValue(new Uint8Array(1)); + const mockHashUpdate = vi.fn(); + const mockHashReset = vi.fn(); + const mockHashDigest = vi.fn().mockReturnValue(new Uint8Array(1)); const MockHash: ChecksumConstructor = class {} as any; MockHash.prototype.update = mockHashUpdate; MockHash.prototype.digest = mockHashDigest; @@ -18,7 +19,7 @@ describe("sendMessageMiddleware", () => { }); it("should only call next once", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { MD5OfMessageBody: "00", }, @@ -31,7 +32,7 @@ describe("sendMessageMiddleware", () => { }); it("should do nothing if the checksum matches", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { MD5OfMessageBody: "00", }, @@ -47,7 +48,7 @@ describe("sendMessageMiddleware", () => { }); it("should throw if the checksum does not match", async () => { - const next = jest.fn().mockReturnValue({ + const next = vi.fn().mockReturnValue({ output: { MD5OfMessageBody: "1", }, diff --git a/packages/middleware-sdk-sqs/vitest.config.integ.ts b/packages/middleware-sdk-sqs/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-sqs/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-sqs/vitest.config.ts b/packages/middleware-sdk-sqs/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-sqs/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-sts/jest.config.integ.js b/packages/middleware-sdk-sts/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-sts/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-sts/package.json b/packages/middleware-sdk-sts/package.json index 30b0d27147c0..db4ad70a1f5c 100644 --- a/packages/middleware-sdk-sts/package.json +++ b/packages/middleware-sdk-sts/package.json @@ -10,7 +10,8 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "test": "exit 0", - "test:integration": "jest -c jest.config.integ.js" + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-sdk-sts/src/middleware-sdk-sts.integ.spec.ts b/packages/middleware-sdk-sts/src/middleware-sdk-sts.integ.spec.ts index 7a4c7a6f18ef..bf0618073200 100644 --- a/packages/middleware-sdk-sts/src/middleware-sdk-sts.integ.spec.ts +++ b/packages/middleware-sdk-sts/src/middleware-sdk-sts.integ.spec.ts @@ -1,4 +1,5 @@ import { STS, STSClient } from "@aws-sdk/client-sts"; +import { describe, expect, test as it } from "vitest"; describe("middleware-sdk-sts", () => { describe(STS.name, () => { diff --git a/packages/middleware-sdk-sts/vitest.config.integ.ts b/packages/middleware-sdk-sts/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-sts/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-transcribe-streaming/jest.config.integ.js b/packages/middleware-sdk-transcribe-streaming/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-sdk-transcribe-streaming/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-sdk-transcribe-streaming/jest.config.js b/packages/middleware-sdk-transcribe-streaming/jest.config.js deleted file mode 100644 index 64f3d932819c..000000000000 --- a/packages/middleware-sdk-transcribe-streaming/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, - //only test cjs dist, avoid testing the package twice - testPathIgnorePatterns: ["/node_modules/", "/es/"], -}; diff --git a/packages/middleware-sdk-transcribe-streaming/package.json b/packages/middleware-sdk-transcribe-streaming/package.json index d530ebdf8f35..f56a0cc05d25 100644 --- a/packages/middleware-sdk-transcribe-streaming/package.json +++ b/packages/middleware-sdk-transcribe-streaming/package.json @@ -12,8 +12,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --passWithNoTests", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "author": { "name": "AWS SDK for JavaScript Team", @@ -34,7 +36,6 @@ "@tsconfig/recommended": "1.0.1", "concurrently": "7.0.0", "downlevel-dts": "0.10.1", - "jest-websocket-mock": "^2.0.2", "mock-socket": "9.1.5", "rimraf": "3.0.2", "typescript": "~4.9.5" diff --git a/packages/middleware-sdk-transcribe-streaming/src/middleware-port.spec.ts b/packages/middleware-sdk-transcribe-streaming/src/middleware-port.spec.ts index 325876ba1f67..556e27ba1d74 100644 --- a/packages/middleware-sdk-transcribe-streaming/src/middleware-port.spec.ts +++ b/packages/middleware-sdk-transcribe-streaming/src/middleware-port.spec.ts @@ -1,5 +1,6 @@ import { HttpRequest } from "@smithy/protocol-http"; import { BuildHandlerArguments, RequestHandler } from "@smithy/types"; +import { describe, expect, test as it } from "vitest"; import { websocketPortMiddleware } from "./middleware-port"; @@ -8,44 +9,53 @@ describe("websocketPortMiddleware", () => { metadata: { handlerProtocol: "websocket" }, handle: () => ({} as any), }; - it("should skip non-http request", (done) => { + it("should skip non-http request", async () => { const nonHttpRequest = { foo: "bar", }; + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(args.request).toEqual(nonHttpRequest); - done(); + resolve(); }; const mw = websocketPortMiddleware({ requestHandler: mockHandler }); mw(next as any, {} as any)({ request: nonHttpRequest, input: {} }); + await promise; }); - it("should skip non WebSocket requests", (done) => { + it("should skip non WebSocket requests", async () => { const mockHandler: RequestHandler = { metadata: { handlerProtocol: "some_protocol" }, handle: () => ({} as any), }; const request = new HttpRequest({}); + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(args.request).toEqual(request); - done(); + resolve(); }; const mw = websocketPortMiddleware({ requestHandler: mockHandler }); mw(next as any, {} as any)({ request, input: {} }); + await promise; }); - it("should update endpoint to websocket url", (done) => { + it("should update endpoint to websocket url", async () => { const request = new HttpRequest({ hostname: "transcribestreaming.us-east-1.amazonaws.com", }); + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(HttpRequest.isInstance(args.request)).toBeTruthy(); const processed = args.request as HttpRequest; expect(processed.hostname).toEqual("transcribestreaming.us-east-1.amazonaws.com:8443"); expect(processed.headers.host).toEqual("transcribestreaming.us-east-1.amazonaws.com:8443"); - done(); + resolve(); }; const mw = websocketPortMiddleware({ requestHandler: mockHandler }); mw(next as any, {} as any)({ request, input: {} }); + await promise; }); }); diff --git a/packages/middleware-sdk-transcribe-streaming/src/middleware-sdk-transcribe-streaming.integ.spec.ts b/packages/middleware-sdk-transcribe-streaming/src/middleware-sdk-transcribe-streaming.integ.spec.ts index 1e01f09cffd9..682b6d35f21a 100644 --- a/packages/middleware-sdk-transcribe-streaming/src/middleware-sdk-transcribe-streaming.integ.spec.ts +++ b/packages/middleware-sdk-transcribe-streaming/src/middleware-sdk-transcribe-streaming.integ.spec.ts @@ -1,10 +1,11 @@ import { TranscribeStreaming } from "@aws-sdk/client-transcribe-streaming"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; describe("middleware-sdk-transcribe-streaming", () => { // TODO: http2 in CI - xdescribe(TranscribeStreaming.name, () => { + describe.skip(TranscribeStreaming.name, () => { it("should set port on hostname and copy params to query", async () => { const client = new TranscribeStreaming({ region: "us-west-2", diff --git a/packages/middleware-sdk-transcribe-streaming/vitest.config.integ.ts b/packages/middleware-sdk-transcribe-streaming/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-sdk-transcribe-streaming/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-sdk-transcribe-streaming/vitest.config.ts b/packages/middleware-sdk-transcribe-streaming/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-sdk-transcribe-streaming/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-signing/jest.config.integ.js b/packages/middleware-signing/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-signing/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-signing/jest.config.js b/packages/middleware-signing/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-signing/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-signing/package.json b/packages/middleware-signing/package.json index 10994680d66b..ca3535b03710 100644 --- a/packages/middleware-signing/package.json +++ b/packages/middleware-signing/package.json @@ -9,9 +9,11 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --passWithNoTests", - "test:integration": "jest -c jest.config.integ.js", - "extract:docs": "api-extractor run --local" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "extract:docs": "api-extractor run --local", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-signing/src/awsAuthConfiguration.spec.ts b/packages/middleware-signing/src/awsAuthConfiguration.spec.ts index 6d0357a04457..1423d1b3de85 100644 --- a/packages/middleware-signing/src/awsAuthConfiguration.spec.ts +++ b/packages/middleware-signing/src/awsAuthConfiguration.spec.ts @@ -1,4 +1,5 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { resolveAwsAuthConfig, resolveSigV4AuthConfig } from "./awsAuthConfiguration"; @@ -13,20 +14,20 @@ describe("AuthConfig", () => { describe("resolveAwsAuthConfig", () => { const inputParams = { credentialDefaultProvider: () => () => Promise.resolve({ accessKeyId: "key", secretAccessKey: "secret" }), - region: jest.fn().mockImplementation(() => Promise.resolve("us-foo-1")), + region: vi.fn().mockImplementation(() => Promise.resolve("us-foo-1")), regionInfoProvider: () => Promise.resolve({ hostname: "foo.com", partition: "aws" }), serviceId: "foo", - sha256: jest.fn().mockReturnValue({ - update: jest.fn(), - digest: jest.fn().mockReturnValue("SHA256 hash"), + sha256: vi.fn().mockReturnValue({ + update: vi.fn(), + digest: vi.fn().mockReturnValue("SHA256 hash"), }), - credentials: jest.fn().mockResolvedValue({ accessKeyId: "key", secretAccessKey: "secret" }), + credentials: vi.fn().mockResolvedValue({ accessKeyId: "key", secretAccessKey: "secret" }), useFipsEndpoint: () => Promise.resolve(false), useDualstackEndpoint: () => Promise.resolve(false), }; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should memoize custom credential provider", async () => { @@ -44,7 +45,7 @@ describe("AuthConfig", () => { const FOUR_MINUTES_AND_59_SEC = 299 * 1000; const input = { ...inputParams, - credentials: jest + credentials: vi .fn() .mockResolvedValueOnce({ accessKeyId: "key", @@ -67,17 +68,17 @@ describe("AuthConfig", () => { describe("resolveSigV4AuthConfig", () => { const inputParams = { credentialDefaultProvider: () => () => Promise.resolve({ accessKeyId: "key", secretAccessKey: "secret" }), - region: jest.fn().mockImplementation(() => Promise.resolve("us-foo-1")), + region: vi.fn().mockImplementation(() => Promise.resolve("us-foo-1")), signingName: "foo", - sha256: jest.fn().mockReturnValue({ - update: jest.fn(), - digest: jest.fn().mockReturnValue("SHA256 hash"), + sha256: vi.fn().mockReturnValue({ + update: vi.fn(), + digest: vi.fn().mockReturnValue("SHA256 hash"), }), - credentials: jest.fn().mockResolvedValue({ accessKeyId: "key", secretAccessKey: "secret" }), + credentials: vi.fn().mockResolvedValue({ accessKeyId: "key", secretAccessKey: "secret" }), }; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should memoize custom credential provider", async () => { @@ -95,7 +96,7 @@ describe("AuthConfig", () => { const FOUR_MINUTES_AND_59_SEC = 299 * 1000; const input = { ...inputParams, - credentials: jest + credentials: vi .fn() .mockResolvedValueOnce({ accessKeyId: "key", diff --git a/packages/middleware-signing/src/awsAuthMiddleware.spec.ts b/packages/middleware-signing/src/awsAuthMiddleware.spec.ts index 0bb1b18a958f..c0d5f1d2884c 100644 --- a/packages/middleware-signing/src/awsAuthMiddleware.spec.ts +++ b/packages/middleware-signing/src/awsAuthMiddleware.spec.ts @@ -1,20 +1,21 @@ import { HttpRequest } from "@smithy/protocol-http"; import { FinalizeHandler, RequestSigner } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { AwsAuthResolvedConfig } from "./awsAuthConfiguration"; import { awsAuthMiddleware } from "./awsAuthMiddleware"; import { getSkewCorrectedDate } from "./utils/getSkewCorrectedDate"; import { getUpdatedSystemClockOffset } from "./utils/getUpdatedSystemClockOffset"; -jest.mock("./utils/getUpdatedSystemClockOffset"); -jest.mock("./utils/getSkewCorrectedDate"); +vi.mock("./utils/getUpdatedSystemClockOffset"); +vi.mock("./utils/getSkewCorrectedDate"); describe(awsAuthMiddleware.name, () => { - let mockSignFn: jest.Mock; + let mockSignFn: vi.Mock; let mockSigner: () => Promise; let mockOptions: AwsAuthResolvedConfig; - const mockNext: jest.MockedFunction> = jest.fn(); + const mockNext: vi.MockedFunction> = vi.fn(); const mockSystemClockOffset = 100; const mockUpdatedSystemClockOffset = 500; const mockSigningHandlerArgs = { @@ -28,17 +29,17 @@ describe(awsAuthMiddleware.name, () => { const mockResponse = { output: "", response: "" }; beforeEach(() => { - mockSignFn = jest.fn().mockResolvedValue(mockSignedRequest); + mockSignFn = vi.fn().mockResolvedValue(mockSignedRequest); mockSigner = () => Promise.resolve({ sign: mockSignFn } as RequestSigner); mockNext.mockResolvedValue(mockResponse); mockOptions = { - credentials: jest.fn(), + credentials: vi.fn(), signer: mockSigner, signingEscapePath: true, systemClockOffset: mockSystemClockOffset, }; - (getUpdatedSystemClockOffset as jest.Mock).mockReturnValue(mockUpdatedSystemClockOffset); - (getSkewCorrectedDate as jest.Mock).mockReturnValue(mockSkewCorrectedDate); + vi.mocked(getUpdatedSystemClockOffset).mockReturnValue(mockUpdatedSystemClockOffset); + vi.mocked(getSkewCorrectedDate).mockReturnValue(mockSkewCorrectedDate); }); afterEach(() => { @@ -47,7 +48,7 @@ describe(awsAuthMiddleware.name, () => { expect(mockSignFn).toHaveBeenCalledTimes(1); expect(mockNext).toHaveBeenCalledTimes(1); expect(mockNext).toHaveBeenCalledWith({ ...mockSigningHandlerArgs, request: mockSignedRequest }); - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should sign the request with systemClockOffset", async () => { diff --git a/packages/middleware-signing/src/middleware-signing.integ.spec.ts b/packages/middleware-signing/src/middleware-signing.integ.spec.ts index ecffac89dd19..492dd86e86de 100644 --- a/packages/middleware-signing/src/middleware-signing.integ.spec.ts +++ b/packages/middleware-signing/src/middleware-signing.integ.spec.ts @@ -1,5 +1,6 @@ import { EC2 } from "@aws-sdk/client-ec2"; import { SageMaker } from "@aws-sdk/client-sagemaker"; +import { describe, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-signing/src/utils/getSkewCorrectedDate.spec.ts b/packages/middleware-signing/src/utils/getSkewCorrectedDate.spec.ts index 8661f876bf41..8fe34f8a2e4d 100644 --- a/packages/middleware-signing/src/utils/getSkewCorrectedDate.spec.ts +++ b/packages/middleware-signing/src/utils/getSkewCorrectedDate.spec.ts @@ -1,14 +1,16 @@ +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; + import { getSkewCorrectedDate } from "./getSkewCorrectedDate"; describe(getSkewCorrectedDate.name, () => { const mockDateNow = Date.now(); beforeEach(() => { - jest.spyOn(Date, "now").mockReturnValue(mockDateNow); + vi.spyOn(Date, "now").mockReturnValue(mockDateNow); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it.each([-100000, -100, 0, 100, 100000])("systemClockOffset: %d", (systemClockOffset) => { diff --git a/packages/middleware-signing/src/utils/getUpdatedSystemClockOffset.spec.ts b/packages/middleware-signing/src/utils/getUpdatedSystemClockOffset.spec.ts index a604f3c25e41..8cd04ea6619a 100644 --- a/packages/middleware-signing/src/utils/getUpdatedSystemClockOffset.spec.ts +++ b/packages/middleware-signing/src/utils/getUpdatedSystemClockOffset.spec.ts @@ -1,7 +1,9 @@ +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; + import { getUpdatedSystemClockOffset } from "./getUpdatedSystemClockOffset"; import { isClockSkewed } from "./isClockSkewed"; -jest.mock("./isClockSkewed"); +vi.mock("./isClockSkewed"); describe(getUpdatedSystemClockOffset.name, () => { // Mock ServerTime is accurate to last second, to remove milliseconds information. @@ -9,11 +11,11 @@ describe(getUpdatedSystemClockOffset.name, () => { const mockSystemClockOffset = 100; afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("returns passed systemClockOffset when clock is not skewed", () => { - (isClockSkewed as jest.Mock).mockReturnValue(false); + vi.mocked(isClockSkewed).mockReturnValue(false); expect(getUpdatedSystemClockOffset(mockClockTime.toString(), mockSystemClockOffset)).toEqual(mockSystemClockOffset); }); @@ -21,8 +23,8 @@ describe(getUpdatedSystemClockOffset.name, () => { const dateDotNowFn = Date.now; beforeEach(() => { - (isClockSkewed as jest.Mock).mockReturnValue(true); - jest.spyOn(Date, "now").mockReturnValueOnce(mockClockTime.getTime()); + vi.mocked(isClockSkewed).mockReturnValue(true); + vi.spyOn(Date, "now").mockReturnValueOnce(mockClockTime.getTime()); }); afterEach(() => { diff --git a/packages/middleware-signing/src/utils/isClockSkewed.spec.ts b/packages/middleware-signing/src/utils/isClockSkewed.spec.ts index a07d481c40dd..6acd3785cf32 100644 --- a/packages/middleware-signing/src/utils/isClockSkewed.spec.ts +++ b/packages/middleware-signing/src/utils/isClockSkewed.spec.ts @@ -1,19 +1,21 @@ +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; + import { getSkewCorrectedDate } from "./getSkewCorrectedDate"; import { isClockSkewed } from "./isClockSkewed"; -jest.mock("./getSkewCorrectedDate"); +vi.mock("./getSkewCorrectedDate"); describe(isClockSkewed.name, () => { const mockSystemClockOffset = 100; const mockSkewCorrectedDate = new Date(); beforeEach(() => { - (getSkewCorrectedDate as jest.Mock).mockReturnValue(mockSkewCorrectedDate); + vi.mocked(getSkewCorrectedDate).mockReturnValue(mockSkewCorrectedDate); }); afterEach(() => { expect(getSkewCorrectedDate).toHaveBeenCalledWith(mockSystemClockOffset); - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("returns true for time difference >=300000", () => { diff --git a/packages/middleware-signing/vitest.config.integ.ts b/packages/middleware-signing/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-signing/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-signing/vitest.config.ts b/packages/middleware-signing/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-signing/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-ssec/jest.config.integ.js b/packages/middleware-ssec/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-ssec/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-ssec/jest.config.js b/packages/middleware-ssec/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-ssec/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-ssec/package.json b/packages/middleware-ssec/package.json index ab6e6b457a5a..5d26e40b1dc9 100644 --- a/packages/middleware-ssec/package.json +++ b/packages/middleware-ssec/package.json @@ -9,8 +9,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-ssec/src/index.spec.ts b/packages/middleware-ssec/src/index.spec.ts index 9f57558b236b..47330df7e071 100644 --- a/packages/middleware-ssec/src/index.spec.ts +++ b/packages/middleware-ssec/src/index.spec.ts @@ -1,17 +1,18 @@ import { ChecksumConstructor } from "@smithy/types"; import * as crypto from "crypto"; +import { beforeEach, describe, expect, test as it, vi } from "vitest"; import { isValidBase64EncodedSSECustomerKey, ssecMiddleware } from "./"; describe("ssecMiddleware", () => { - const next = jest.fn(); - const decoder = jest.fn().mockResolvedValue(new Uint8Array(0)); - const base64Decoder = jest.fn(); - const encoder1 = jest.fn(); - const encoder2 = jest.fn(); - const mockHashUpdate = jest.fn(); - const mockHashReset = jest.fn(); - const mockHashDigest = jest.fn().mockReturnValue(new Uint8Array(0)); + const next = vi.fn(); + const decoder = vi.fn().mockResolvedValue(new Uint8Array(0)); + const base64Decoder = vi.fn(); + const encoder1 = vi.fn(); + const encoder2 = vi.fn(); + const mockHashUpdate = vi.fn(); + const mockHashReset = vi.fn(); + const mockHashDigest = vi.fn().mockReturnValue(new Uint8Array(0)); const MockHash: ChecksumConstructor = class {} as any; MockHash.prototype.update = mockHashUpdate; MockHash.prototype.digest = mockHashDigest; @@ -69,11 +70,11 @@ describe("ssecMiddleware", () => { base64Decoder.mockReturnValue(decodedBytes); const mockMD5Instance = { - update: jest.fn().mockReturnThis(), - digest: jest.fn().mockReturnValue(md5Hash), + update: vi.fn().mockReturnThis(), + digest: vi.fn().mockReturnValue(md5Hash), }; - const mockMD5Constructor = jest.fn().mockReturnValue(mockMD5Instance); - const base64Encoder = jest.fn().mockReturnValue(base64EncodedMD5Hash); + const mockMD5Constructor = vi.fn().mockReturnValue(mockMD5Instance); + const base64Encoder = vi.fn().mockReturnValue(base64EncodedMD5Hash); const handler = ssecMiddleware({ base64Encoder, @@ -117,12 +118,12 @@ describe("ssecMiddleware", () => { const base64EncodedKey = binaryKey.toString("base64"); const base64EncodedMD5Hash = md5Hash.toString("base64"); - const mockMD5Constructor = jest.fn().mockReturnValue({ - update: jest.fn().mockReturnThis(), - digest: jest.fn().mockReturnValueOnce(md5Hash).mockReturnValueOnce(md5Hash), + const mockMD5Constructor = vi.fn().mockReturnValue({ + update: vi.fn().mockReturnThis(), + digest: vi.fn().mockReturnValueOnce(md5Hash).mockReturnValueOnce(md5Hash), }); - const base64Encoder = jest + const base64Encoder = vi .fn() .mockReturnValueOnce(base64EncodedKey) .mockReturnValueOnce(base64EncodedMD5Hash) @@ -161,7 +162,7 @@ describe("ssecMiddleware", () => { it("should return false for an invalid base64 string", () => { const invalidBase64 = "invalid!@#$%"; - const base64Decoder = jest.fn(); + const base64Decoder = vi.fn(); const options = { base64Decoder }; const result = isValidBase64EncodedSSECustomerKey(invalidBase64, options as any); @@ -172,7 +173,7 @@ describe("ssecMiddleware", () => { it("should return true for a valid base64 string and 32 bytes", () => { const validBase64EncodedSSECustomerKey = "QUIwMTIzNDU2Nzg5QUJDREVGQUJDREVGQUJDREVGQUI="; const decodedBytes = new Uint8Array(32); - const base64Decoder = jest.fn().mockReturnValue(decodedBytes); + const base64Decoder = vi.fn().mockReturnValue(decodedBytes); const options = { base64Decoder }; const result = isValidBase64EncodedSSECustomerKey(validBase64EncodedSSECustomerKey, options as any); @@ -183,7 +184,7 @@ describe("ssecMiddleware", () => { it("should return false for a valid base64 string but not 32 bytes", () => { const validBase64NonThirtyTwoBytes = "SGVsbG8="; - const base64Decoder = jest.fn().mockReturnValue(new Uint8Array([72, 101, 108, 108, 111])); + const base64Decoder = vi.fn().mockReturnValue(new Uint8Array([72, 101, 108, 108, 111])); const options = { base64Decoder }; const result = isValidBase64EncodedSSECustomerKey(validBase64NonThirtyTwoBytes, options as any); diff --git a/packages/middleware-ssec/src/middleware-ssec.integ.spec.ts b/packages/middleware-ssec/src/middleware-ssec.integ.spec.ts index 337f61b1b98f..d5ee0bf31c8b 100644 --- a/packages/middleware-ssec/src/middleware-ssec.integ.spec.ts +++ b/packages/middleware-ssec/src/middleware-ssec.integ.spec.ts @@ -1,5 +1,6 @@ import { S3 } from "@aws-sdk/client-s3"; import * as crypto from "crypto"; +import { describe, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-ssec/vitest.config.integ.ts b/packages/middleware-ssec/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-ssec/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-ssec/vitest.config.ts b/packages/middleware-ssec/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-ssec/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-token/jest.config.integ.js b/packages/middleware-token/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-token/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-token/jest.config.js b/packages/middleware-token/jest.config.js deleted file mode 100644 index 95d8863b22a1..000000000000 --- a/packages/middleware-token/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, - testMatch: ["**/*.spec.ts"], -}; diff --git a/packages/middleware-token/package.json b/packages/middleware-token/package.json index f02c17a164d9..2521206f96ee 100644 --- a/packages/middleware-token/package.json +++ b/packages/middleware-token/package.json @@ -13,8 +13,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "keywords": [ "aws", diff --git a/packages/middleware-token/src/getTokenPlugin.spec.ts b/packages/middleware-token/src/getTokenPlugin.spec.ts index 7cb26af89f9d..d91199b6c349 100644 --- a/packages/middleware-token/src/getTokenPlugin.spec.ts +++ b/packages/middleware-token/src/getTokenPlugin.spec.ts @@ -1,7 +1,9 @@ +import { describe, expect, test as it, vi } from "vitest"; + import { getTokenPlugin } from "./getTokenPlugin"; import { tokenMiddleware, tokenMiddlewareOptions } from "./tokenMiddleware"; -jest.mock("./tokenMiddleware"); +vi.mock("./tokenMiddleware"); const ONE_HOUR_IN_MS = 3600 * 1000; @@ -16,11 +18,11 @@ describe(getTokenPlugin.name, () => { it("applyToStack adds tokenMiddleware", () => { const middlewareReturn = {}; - (tokenMiddleware as jest.Mock).mockReturnValueOnce(middlewareReturn); + vi.mocked(tokenMiddleware).mockReturnValueOnce(middlewareReturn); // @ts-ignore const plugin = getTokenPlugin(pluginConfig); - const commandStack = { addRelativeTo: jest.fn() }; + const commandStack = { addRelativeTo: vi.fn() }; // @ts-ignore plugin.applyToStack(commandStack); diff --git a/packages/middleware-token/src/middleware-token.integ.spec.ts b/packages/middleware-token/src/middleware-token.integ.spec.ts index 1238971a98a9..4bd743114947 100644 --- a/packages/middleware-token/src/middleware-token.integ.spec.ts +++ b/packages/middleware-token/src/middleware-token.integ.spec.ts @@ -1,4 +1,5 @@ import { CodeCatalyst } from "@aws-sdk/client-codecatalyst"; +import { describe, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-token/src/normalizeTokenProvider.spec.ts b/packages/middleware-token/src/normalizeTokenProvider.spec.ts index 54bd27d73dff..9a4ef2033b78 100644 --- a/packages/middleware-token/src/normalizeTokenProvider.spec.ts +++ b/packages/middleware-token/src/normalizeTokenProvider.spec.ts @@ -1,10 +1,11 @@ import { memoize } from "@smithy/property-provider"; import { normalizeProvider } from "@smithy/util-middleware"; +import { afterEach, beforeEach, describe, expect, expect, test as it, vi } from "vitest"; import { normalizeTokenProvider } from "./normalizeTokenProvider"; -jest.mock("@smithy/property-provider"); -jest.mock("@smithy/util-middleware"); +vi.mock("@smithy/property-provider"); +vi.mock("@smithy/util-middleware"); const ONE_SECOND_IN_MS = 1000; const ONE_HOUR_IN_MS = 3600 * ONE_SECOND_IN_MS; @@ -16,13 +17,13 @@ describe(normalizeTokenProvider.name, () => { }; afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("if token is a function", () => { - const mockInputToken = jest.fn(); - const mockMemoizeFn = jest.fn().mockResolvedValue(mockToken); - (memoize as jest.Mock).mockReturnValue(mockMemoizeFn); + const mockInputToken = vi.fn(); + const mockMemoizeFn = vi.fn().mockResolvedValue(mockToken); + vi.mocked(memoize).mockReturnValue(mockMemoizeFn); afterEach(() => { expect(memoize).toHaveBeenCalledWith(mockInputToken, expect.any(Function), expect.any(Function)); @@ -38,30 +39,30 @@ describe(normalizeTokenProvider.name, () => { const mockDateNow = Date.now(); beforeEach(async () => { - jest.spyOn(Date, "now").mockReturnValueOnce(mockDateNow); + vi.spyOn(Date, "now").mockReturnValueOnce(mockDateNow); normalizeTokenProvider(mockInputToken); }); it("returns true if expiration is defined, and token has expired", () => { - const memoizeExpiredFn = (memoize as jest.Mock).mock.calls[0][1]; + const memoizeExpiredFn = vi.mocked(memoize).mock.calls[0][1]; const expiration = new Date(mockDateNow - 24 * ONE_HOUR_IN_MS); expect(memoizeExpiredFn({ expiration })).toEqual(true); }); it("returns true if expiration is defined, and token expires in <5 mins", () => { - const memoizeExpiredFn = (memoize as jest.Mock).mock.calls[0][1]; + const memoizeExpiredFn = vi.mocked(memoize).mock.calls[0][1]; const expiration = new Date(mockDateNow + 299 * ONE_SECOND_IN_MS); expect(memoizeExpiredFn({ expiration })).toEqual(true); }); it("returns false if expiration is defined, but token expires in >5 mins", () => { - const memoizeExpiredFn = (memoize as jest.Mock).mock.calls[0][1]; + const memoizeExpiredFn = vi.mocked(memoize).mock.calls[0][1]; const expiration = new Date(mockDateNow + 301 * ONE_SECOND_IN_MS); expect(memoizeExpiredFn({ expiration })).toEqual(false); }); it("returns false if expiration is not defined", () => { - const memoizeExpiredFn = (memoize as jest.Mock).mock.calls[0][1]; + const memoizeExpiredFn = vi.mocked(memoize).mock.calls[0][1]; expect(memoizeExpiredFn({})).toEqual(false); }); }); @@ -72,13 +73,13 @@ describe(normalizeTokenProvider.name, () => { }); it("returns true if expiration is not defined", () => { - const memoizeRefreshFn = (memoize as jest.Mock).mock.calls[0][2]; + const memoizeRefreshFn = vi.mocked(memoize).mock.calls[0][2]; const expiration = Date.now(); expect(memoizeRefreshFn({ expiration })).toEqual(true); }); it("returns false if expiration is not defined", () => { - const memoizeRefreshFn = (memoize as jest.Mock).mock.calls[0][2]; + const memoizeRefreshFn = vi.mocked(memoize).mock.calls[0][2]; expect(memoizeRefreshFn({})).toEqual(false); }); }); diff --git a/packages/middleware-token/src/resolveTokenConfig.spec.ts b/packages/middleware-token/src/resolveTokenConfig.spec.ts index 8eae1a6c3b1a..18ab6f5b5886 100644 --- a/packages/middleware-token/src/resolveTokenConfig.spec.ts +++ b/packages/middleware-token/src/resolveTokenConfig.spec.ts @@ -1,9 +1,11 @@ +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; + import { normalizeTokenProvider } from "./normalizeTokenProvider"; import { resolveTokenConfig } from "./resolveTokenConfig"; import { tokenDefaultProvider } from "./tokenDefaultProvider"; -jest.mock("./normalizeTokenProvider"); -jest.mock("./tokenDefaultProvider"); +vi.mock("./normalizeTokenProvider"); +vi.mock("./tokenDefaultProvider"); const ONE_HOUR_IN_MS = 3600 * 1000; @@ -16,13 +18,13 @@ describe(resolveTokenConfig.name, () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("sets token from normalizeTokenProvider if token is provided", () => { beforeEach(() => { - (normalizeTokenProvider as jest.Mock).mockReturnValue(mockOutputToken); - (tokenDefaultProvider as jest.Mock).mockReturnValue(mockOutputToken); + vi.mocked(normalizeTokenProvider).mockReturnValue(mockOutputToken); + vi.mocked(tokenDefaultProvider).mockReturnValue(mockOutputToken); }); afterEach(() => { @@ -35,7 +37,7 @@ describe(resolveTokenConfig.name, () => { }; it("when token is a function", () => { - testTokenProviderWithToken(jest.fn()); + testTokenProviderWithToken(vi.fn()); }); it("when token is an object", () => { @@ -47,7 +49,7 @@ describe(resolveTokenConfig.name, () => { }); it("sets token from tokenDefaultProvider if token is not provided", () => { - (tokenDefaultProvider as jest.Mock).mockReturnValue(mockOutputToken); + vi.mocked(tokenDefaultProvider).mockReturnValue(mockOutputToken); expect(resolveTokenConfig(mockInput)).toEqual({ ...mockInput, token: mockOutputToken }); expect(tokenDefaultProvider).toHaveBeenCalledWith(mockInput); expect(normalizeTokenProvider).not.toHaveBeenCalled(); diff --git a/packages/middleware-token/src/tokenDefaultProvider.browser.spec.ts b/packages/middleware-token/src/tokenDefaultProvider.browser.spec.ts index cf70bc75df54..3dc98950bfb6 100644 --- a/packages/middleware-token/src/tokenDefaultProvider.browser.spec.ts +++ b/packages/middleware-token/src/tokenDefaultProvider.browser.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + /** * @jest-environment jsdom */ diff --git a/packages/middleware-token/src/tokenDefaultProvider.spec.ts b/packages/middleware-token/src/tokenDefaultProvider.spec.ts index 0a3e5adaefd6..68af187476e4 100644 --- a/packages/middleware-token/src/tokenDefaultProvider.spec.ts +++ b/packages/middleware-token/src/tokenDefaultProvider.spec.ts @@ -1,8 +1,9 @@ import { nodeProvider } from "@aws-sdk/token-providers"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { tokenDefaultProvider } from "./tokenDefaultProvider"; -jest.mock("@aws-sdk/token-providers"); +vi.mock("@aws-sdk/token-providers"); const ONE_HOUR_IN_MS = 3600 * 1000; @@ -14,11 +15,11 @@ describe(tokenDefaultProvider.name, () => { }); beforeEach(() => { - (nodeProvider as jest.Mock).mockReturnValue(mockOutputToken); + vi.mocked(nodeProvider).mockReturnValue(mockOutputToken); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should return nodeProvider", () => { diff --git a/packages/middleware-token/src/tokenMiddleware.spec.ts b/packages/middleware-token/src/tokenMiddleware.spec.ts index 6505ec5700fb..2e99e8a0a482 100644 --- a/packages/middleware-token/src/tokenMiddleware.spec.ts +++ b/packages/middleware-token/src/tokenMiddleware.spec.ts @@ -1,8 +1,9 @@ import { HttpRequest } from "@smithy/protocol-http"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { tokenMiddleware } from "./tokenMiddleware"; -jest.mock("@smithy/protocol-http"); +vi.mock("@smithy/protocol-http"); const ONE_HOUR_IN_MS = 3600 * 1000; @@ -11,23 +12,23 @@ describe(tokenMiddleware.name, () => { token: "mockAccessToken", expiration: new Date(Date.now() + ONE_HOUR_IN_MS), }; - const mockTokenProvider = jest.fn().mockReturnValue(Promise.resolve(mockToken)); + const mockTokenProvider = vi.fn().mockReturnValue(Promise.resolve(mockToken)); const mockOptions = { token: mockTokenProvider, }; - const mockNext = jest.fn(); + const mockNext = vi.fn(); const mockContext = {}; const mockArgs = { request: { headers: {} } }; afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("no changes if it's not an HttpRequest", async () => { const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(false); + (isInstance as unknown as any).mockReturnValue(false); await tokenMiddleware(mockOptions)(mockNext, mockContext)(mockArgs as any); expect(mockNext).toHaveBeenCalledWith(mockArgs); expect(mockOptions.token).not.toHaveBeenCalled(); @@ -36,7 +37,7 @@ describe(tokenMiddleware.name, () => { describe("HttpRequest", () => { beforeEach(() => { const { isInstance } = HttpRequest; - (isInstance as unknown as jest.Mock).mockReturnValue(true); + (isInstance as unknown as any).mockReturnValue(true); }); it("continues if token is not provided", async () => { diff --git a/packages/middleware-token/vitest.config.integ.ts b/packages/middleware-token/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-token/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-token/vitest.config.ts b/packages/middleware-token/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-token/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-user-agent/jest.config.integ.js b/packages/middleware-user-agent/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-user-agent/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-user-agent/jest.config.js b/packages/middleware-user-agent/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/middleware-user-agent/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/middleware-user-agent/package.json b/packages/middleware-user-agent/package.json index c8a0c4872597..0e3649226fb5 100644 --- a/packages/middleware-user-agent/package.json +++ b/packages/middleware-user-agent/package.json @@ -9,9 +9,11 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --passWithNoTests", - "test:integration": "jest -c jest.config.integ.js", - "extract:docs": "api-extractor run --local" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "extract:docs": "api-extractor run --local", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/middleware-user-agent/src/check-features.spec.ts b/packages/middleware-user-agent/src/check-features.spec.ts index 685afb723d98..d52fa4040504 100644 --- a/packages/middleware-user-agent/src/check-features.spec.ts +++ b/packages/middleware-user-agent/src/check-features.spec.ts @@ -1,11 +1,12 @@ import { AwsHandlerExecutionContext } from "@aws-sdk/types"; +import { describe, expect, test as it, vi } from "vitest"; import { checkFeatures } from "./check-features"; describe(checkFeatures.name, () => { it("should not call the credentials provider to retrieve the identity", async () => { const config = { - credentials: jest.fn(), + credentials: vi.fn(), }; const context = { diff --git a/packages/middleware-user-agent/src/encode-features.spec.ts b/packages/middleware-user-agent/src/encode-features.spec.ts index c9b01a0eb166..e893e895067b 100644 --- a/packages/middleware-user-agent/src/encode-features.spec.ts +++ b/packages/middleware-user-agent/src/encode-features.spec.ts @@ -1,3 +1,5 @@ +import { describe, expect, test as it } from "vitest"; + import { encodeFeatures } from "./encode-features"; describe(encodeFeatures.name, () => { diff --git a/packages/middleware-user-agent/src/middleware-user-agent.integ.spec.ts b/packages/middleware-user-agent/src/middleware-user-agent.integ.spec.ts index 2ee442d5bf28..0289ad462e1d 100644 --- a/packages/middleware-user-agent/src/middleware-user-agent.integ.spec.ts +++ b/packages/middleware-user-agent/src/middleware-user-agent.integ.spec.ts @@ -1,6 +1,7 @@ import { CodeCatalyst } from "@aws-sdk/client-codecatalyst"; import { DynamoDB } from "@aws-sdk/client-dynamodb"; import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb"; +import { describe, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-user-agent/src/user-agent-middleware.spec.ts b/packages/middleware-user-agent/src/user-agent-middleware.spec.ts index b01e90b967ea..d305f77e67da 100644 --- a/packages/middleware-user-agent/src/user-agent-middleware.spec.ts +++ b/packages/middleware-user-agent/src/user-agent-middleware.spec.ts @@ -1,16 +1,17 @@ import { setPartitionInfo, useDefaultPartitionInfo } from "@aws-sdk/util-endpoints"; import { HttpRequest } from "@smithy/protocol-http"; import { UserAgentPair } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, expect, test as it, vi } from "vitest"; import { USER_AGENT, X_AMZ_USER_AGENT } from "./constants"; import { userAgentMiddleware } from "./user-agent-middleware"; describe("userAgentMiddleware", () => { - const mockNextHandler = jest.fn(); - const mockInternalNextHandler = jest.fn(); + const mockNextHandler = vi.fn(); + const mockInternalNextHandler = vi.fn(); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); afterEach(() => { diff --git a/packages/middleware-user-agent/vitest.config.integ.ts b/packages/middleware-user-agent/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-user-agent/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-user-agent/vitest.config.ts b/packages/middleware-user-agent/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/middleware-user-agent/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-websocket/jest.config.integ.js b/packages/middleware-websocket/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/packages/middleware-websocket/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/packages/middleware-websocket/jest.config.js b/packages/middleware-websocket/jest.config.js deleted file mode 100644 index 64f3d932819c..000000000000 --- a/packages/middleware-websocket/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, - //only test cjs dist, avoid testing the package twice - testPathIgnorePatterns: ["/node_modules/", "/es/"], -}; diff --git a/packages/middleware-websocket/package.json b/packages/middleware-websocket/package.json index c4f2089fcdeb..0078ae137360 100644 --- a/packages/middleware-websocket/package.json +++ b/packages/middleware-websocket/package.json @@ -12,8 +12,10 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest", - "test:integration": "jest -c jest.config.integ.js" + "test": "vitest run", + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:watch": "vitest watch", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "author": { "name": "AWS SDK for JavaScript Team", @@ -37,7 +39,7 @@ "@tsconfig/recommended": "1.0.1", "concurrently": "7.0.0", "downlevel-dts": "0.10.1", - "jest-websocket-mock": "^2.0.2", + "vitest-websocket-mock": "0.2.3", "mock-socket": "9.1.5", "rimraf": "3.0.2", "typescript": "~4.9.5", diff --git a/packages/middleware-websocket/src/EventStreamPayloadHandler.spec.ts b/packages/middleware-websocket/src/EventStreamPayloadHandler.spec.ts index f4975d7583d0..70a93a930106 100644 --- a/packages/middleware-websocket/src/EventStreamPayloadHandler.spec.ts +++ b/packages/middleware-websocket/src/EventStreamPayloadHandler.spec.ts @@ -1,34 +1,32 @@ -/** - * @jest-environment jsdom - */ import { EventStreamCodec } from "@smithy/eventstream-codec"; import { Decoder, Encoder, FinalizeHandler, FinalizeHandlerArguments, HttpRequest, MessageSigner } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, expect, test as it, vi } from "vitest"; import { ReadableStream, TransformStream } from "web-streams-polyfill"; import { EventStreamPayloadHandler } from "./EventStreamPayloadHandler"; import { getEventSigningTransformStream } from "./get-event-signing-stream"; -jest.mock("./get-event-signing-stream"); -jest.mock("@smithy/eventstream-codec"); +vi.mock("./get-event-signing-stream"); +vi.mock("@smithy/eventstream-codec"); describe(EventStreamPayloadHandler.name, () => { const mockSigner: MessageSigner = { - sign: jest.fn(), - signMessage: jest.fn(), + sign: vi.fn(), + signMessage: vi.fn(), }; - const mockUtf8Decoder: Decoder = jest.fn(); - const mockUtf8encoder: Encoder = jest.fn(); - const mockNextHandler: FinalizeHandler = jest.fn(); + const mockUtf8Decoder: Decoder = vi.fn(); + const mockUtf8encoder: Encoder = vi.fn(); + const mockNextHandler: FinalizeHandler = vi.fn(); const originalTransformStreamCtor = window.TransformStream; beforeEach(() => { window.TransformStream = TransformStream; - (getEventSigningTransformStream as unknown as jest.Mock).mockImplementation(() => new TransformStream()); - (EventStreamCodec as jest.Mock).mockImplementation(() => {}); + (getEventSigningTransformStream as unknown as any).mockImplementation(() => new TransformStream()); + vi.mocked(EventStreamCodec).mockImplementation(() => {}); }); afterEach(() => { window.TransformStream = originalTransformStreamCtor; - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("should throw if request payload is not a stream", () => { diff --git a/packages/middleware-websocket/src/WebsocketSignatureV4.spec.ts b/packages/middleware-websocket/src/WebsocketSignatureV4.spec.ts index d8e4b79729e6..8e14e446f78a 100644 --- a/packages/middleware-websocket/src/WebsocketSignatureV4.spec.ts +++ b/packages/middleware-websocket/src/WebsocketSignatureV4.spec.ts @@ -1,17 +1,18 @@ // TODO: remove this file as duplicated to @aws-sdk/middleware-websocket import { HttpRequest } from "@smithy/protocol-http"; import { RequestPresigningArguments, RequestSigningArguments } from "@smithy/types"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { WebsocketSignatureV4 } from "./WebsocketSignatureV4"; -jest.mock("@smithy/protocol-http"); +vi.mock("@smithy/protocol-http"); describe("WebsocketSignatureV4", () => { const mockPresignedRequest = { req: "mockPresignedRequest" }; const mockSignedRequest = { req: "mockSignedRequest" }; - const presign = jest.fn().mockResolvedValue(mockPresignedRequest); - const sign = jest.fn().mockResolvedValue(mockSignedRequest); + const presign = vi.fn().mockResolvedValue(mockPresignedRequest); + const sign = vi.fn().mockResolvedValue(mockSignedRequest); const headers = { "x-amz-foo": "foo", @@ -25,7 +26,7 @@ describe("WebsocketSignatureV4", () => { const sigV4 = new WebsocketSignatureV4({ signer: { sign, presign } as any }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("presign", () => { @@ -55,7 +56,7 @@ describe("WebsocketSignatureV4", () => { const { isInstance } = HttpRequest; beforeEach(() => { - (isInstance as unknown as jest.Mock).mockReturnValueOnce(true); + (isInstance as unknown as any).mockReturnValueOnce(true); }); const expectSignArgs = (result: any, options: RequestPresigningArguments = {}) => { @@ -94,7 +95,7 @@ describe("WebsocketSignatureV4", () => { const { isInstance } = HttpRequest; beforeEach(() => { - (isInstance as unknown as jest.Mock).mockReturnValueOnce(false); + (isInstance as unknown as any).mockReturnValueOnce(false); }); const expectSignArgs = (result: any, options?: RequestSigningArguments) => { diff --git a/packages/middleware-websocket/src/get-event-signing-stream.spec.ts b/packages/middleware-websocket/src/get-event-signing-stream.spec.ts index 2936ab3d3ee7..8e54bc2afca5 100644 --- a/packages/middleware-websocket/src/get-event-signing-stream.spec.ts +++ b/packages/middleware-websocket/src/get-event-signing-stream.spec.ts @@ -1,9 +1,7 @@ -/** - * @jest-environment jsdom - */ import { EventStreamCodec } from "@smithy/eventstream-codec"; import { Message, MessageHeaders, SignedMessage } from "@smithy/types"; import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; +import { afterEach, beforeEach, describe, expect, test as it } from "vitest"; import { TransformStream } from "web-streams-polyfill"; import { getEventSigningTransformStream } from "./get-event-signing-stream"; @@ -58,7 +56,7 @@ describe(getEventSigningTransformStream.name, () => { headers: {}, body: fromUtf8("bar"), }; - const mockMessageSigner = jest + const mockMessageSigner = vi .fn() .mockReturnValueOnce({ message: message1, signature: "7369676e617475726531" } as SignedMessage) //'signature1' .mockReturnValueOnce({ message: message2, signature: "7369676e617475726532" } as SignedMessage); //'signature2' diff --git a/packages/middleware-websocket/src/middleware-session-id.spec.ts b/packages/middleware-websocket/src/middleware-session-id.spec.ts index cb9e6d05d6b2..6ca95c4fa706 100644 --- a/packages/middleware-websocket/src/middleware-session-id.spec.ts +++ b/packages/middleware-websocket/src/middleware-session-id.spec.ts @@ -1,7 +1,9 @@ +import { describe, expect, test as it, vi } from "vitest"; + import { injectSessionIdMiddleware } from "./middleware-session-id"; describe(injectSessionIdMiddleware.name, () => { - const mockNextHandler = jest.fn().mockResolvedValue({ output: {} }); + const mockNextHandler = vi.fn().mockResolvedValue({ output: {} }); it("should populate the SessionId parameter in response", async () => { const mw = injectSessionIdMiddleware(); const { output } = await mw(mockNextHandler as any, {} as any)({ input: { SessionId: "ID" } }); diff --git a/packages/middleware-websocket/src/middleware-websocket-endpoint.spec.ts b/packages/middleware-websocket/src/middleware-websocket-endpoint.spec.ts index fe4658023d32..f2ba4ca18e07 100644 --- a/packages/middleware-websocket/src/middleware-websocket-endpoint.spec.ts +++ b/packages/middleware-websocket/src/middleware-websocket-endpoint.spec.ts @@ -1,30 +1,36 @@ import { HttpRequest } from "@smithy/protocol-http"; import { BuildHandlerArguments, RequestHandler } from "@smithy/types"; +import { describe, expect, test as it } from "vitest"; import { websocketEndpointMiddleware } from "./middleware-websocket-endpoint"; describe(websocketEndpointMiddleware.name, () => { const config = { requestHandler: { metadata: { handlerProtocol: "websocket/h1.1" } } as RequestHandler }; const handlerOption = { headerPrefix: "some-thing" }; - it("should skip non-http request", (done) => { + it("should skip non-http request", async () => { const nonHttpRequest = { foo: "bar", }; + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(args.request).toEqual(nonHttpRequest); - done(); + resolve(); }; const mw = websocketEndpointMiddleware(config, handlerOption); mw(next as any, {} as any)({ request: nonHttpRequest, input: {} }); + await promise; }); - it("should update endpoint to websocket url", (done) => { + it("should update endpoint to websocket url", async () => { const request = new HttpRequest({ protocol: "https:", hostname: "foo.us-east-1.amazonaws.com", path: "/stream-operation", method: "POST", }); + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(HttpRequest.isInstance(args.request)).toBeTruthy(); const processed = args.request as HttpRequest; @@ -32,13 +38,14 @@ describe(websocketEndpointMiddleware.name, () => { expect(processed.hostname).toEqual("foo.us-east-1.amazonaws.com"); expect(processed.path).toEqual("/stream-operation-websocket"); expect(processed.method).toEqual("GET"); - done(); + resolve(); }; const mw = websocketEndpointMiddleware(config, handlerOption); mw(next as any, {} as any)({ request, input: {} }); + await promise; }); - it("should remove content-type and sha256 hash header without transferring them to query parameters", (done) => { + it("should remove content-type and sha256 hash header without transferring them to query parameters", async () => { const request = new HttpRequest({ headers: { "content-type": "application/vnd.amazon.eventstream", @@ -47,33 +54,39 @@ describe(websocketEndpointMiddleware.name, () => { "X-Amz-Content-Sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS", }, }); + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(HttpRequest.isInstance(args.request)).toBeTruthy(); const processed = args.request as HttpRequest; const queryKeys = Object.keys(processed.query).map((key) => key.toLowerCase()); expect(queryKeys).not.toContain("content-type"); expect(queryKeys).not.toContain("x-amz-content-sha256"); - done(); + resolve(); }; const mw = websocketEndpointMiddleware(config, handlerOption); mw(next as any, {} as any)({ request, input: {} }); + await promise; }); - it("should contain only a host header after adjustment", (done) => { + it("should contain only a host header after adjustment", async () => { const request = new HttpRequest({}); + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(HttpRequest.isInstance(args.request)).toBeTruthy(); const processed = args.request as HttpRequest; const headerKeys = Object.keys(processed.headers).map((key) => key.toLowerCase()); expect(headerKeys).toEqual(["host"]); expect(processed.headers["host"]).toBeDefined(); - done(); + resolve(); }; const mw = websocketEndpointMiddleware(config, handlerOption); mw(next as any, {} as any)({ request, input: {} }); + await promise; }); - it("should move API parameters from headers to query", (done) => { + it("should move API parameters from headers to query", async () => { const request = new HttpRequest({ headers: { "x-amzn-transcribe-language-code": "en-US", @@ -83,6 +96,8 @@ describe(websocketEndpointMiddleware.name, () => { "x-amzn-transcribe-sample-rate": "44100", }, }); + let resolve: (resolved?: unknown) => void; + const promise = new Promise((r) => (resolve = r)); const next = (args: BuildHandlerArguments) => { expect(HttpRequest.isInstance(args.request)).toBeTruthy(); const processed = args.request as HttpRequest; @@ -93,9 +108,10 @@ describe(websocketEndpointMiddleware.name, () => { "vocabulary-name": "abc", "sample-rate": "44100", }); - done(); + resolve(); }; const mw = websocketEndpointMiddleware(config, { headerPrefix: "x-amzn-transcribe-" }); mw(next as any, {} as any)({ request, input: {} }); + await promise; }); }); diff --git a/packages/middleware-websocket/src/middleware-websocket.integ.spec.ts b/packages/middleware-websocket/src/middleware-websocket.integ.spec.ts index 26ce910f83f5..926bac4fb669 100644 --- a/packages/middleware-websocket/src/middleware-websocket.integ.spec.ts +++ b/packages/middleware-websocket/src/middleware-websocket.integ.spec.ts @@ -1,4 +1,5 @@ import { RekognitionStreaming } from "@aws-sdk/client-rekognitionstreaming"; +import { describe, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/packages/middleware-websocket/src/websocket-fetch-handler.spec.ts b/packages/middleware-websocket/src/websocket-fetch-handler.spec.ts index 2125a8ebc21d..6194081a03de 100644 --- a/packages/middleware-websocket/src/websocket-fetch-handler.spec.ts +++ b/packages/middleware-websocket/src/websocket-fetch-handler.spec.ts @@ -1,19 +1,20 @@ import { FetchHttpHandler } from "@smithy/fetch-http-handler"; import { HttpRequest } from "@smithy/protocol-http"; -import WS from "jest-websocket-mock"; import { WebSocket } from "mock-socket"; import { PassThrough } from "stream"; +import { afterEach, beforeEach, describe, expect, expect, test as it, vi } from "vitest"; +import WS from "vitest-websocket-mock"; import { WebSocketFetchHandler } from "./websocket-fetch-handler"; -jest.mock("@smithy/fetch-http-handler"); +vi.mock("@smithy/fetch-http-handler"); describe(WebSocketFetchHandler.name, () => { const mockHostname = "localhost:6789"; const mockUrl = `ws://${mockHostname}/`; beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe("should handle WebSocket connections", () => { @@ -117,7 +118,7 @@ describe(WebSocketFetchHandler.name, () => { it("should return retryable error if cannot setup ws connection", async () => { expect.assertions(5); const originalFn = setTimeout; - (global as any).setTimeout = jest.fn().mockImplementation(setTimeout); + (global as any).setTimeout = vi.fn().mockImplementation(setTimeout); const connectionTimeout = 1000; const handler = new WebSocketFetchHandler(async () => ({ connectionTimeout })); //Using Node stream is fine because they are also async iterables. @@ -138,7 +139,7 @@ describe(WebSocketFetchHandler.name, () => { expect(err.$metadata).toBeDefined(); expect(err.$metadata.httpStatusCode >= 500).toBe(true); expect( - ((global as any).setTimeout as jest.Mock).mock.calls.filter((args) => { + ((global as any).setTimeout as any).mock.calls.filter((args) => { //find the 'setTimeout' call from the websocket handler return args[0].toString().indexOf("$metadata") >= 0; })[0][1] diff --git a/packages/middleware-websocket/vitest.config.integ.ts b/packages/middleware-websocket/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/packages/middleware-websocket/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/middleware-websocket/vitest.config.ts b/packages/middleware-websocket/vitest.config.ts new file mode 100644 index 000000000000..44808064872c --- /dev/null +++ b/packages/middleware-websocket/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "happy-dom", + }, +}); diff --git a/packages/s3-presigned-post/jest.config.e2e.js b/packages/s3-presigned-post/jest.config.e2e.js deleted file mode 100644 index b4d9bee23f48..000000000000 --- a/packages/s3-presigned-post/jest.config.e2e.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.e2e.spec.ts"], -}; diff --git a/packages/s3-presigned-post/jest.config.js b/packages/s3-presigned-post/jest.config.js deleted file mode 100644 index a8d1c2e49912..000000000000 --- a/packages/s3-presigned-post/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require("../../jest.config.base.js"); - -module.exports = { - ...base, -}; diff --git a/packages/s3-presigned-post/package.json b/packages/s3-presigned-post/package.json index eef9078b57ba..fb84b6240dcd 100644 --- a/packages/s3-presigned-post/package.json +++ b/packages/s3-presigned-post/package.json @@ -10,8 +10,10 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", - "test": "jest", - "test:e2e": "jest -c jest.config.e2e.js" + "test": "vitest run", + "test:e2e": "vitest run -c vitest.config.e2e.ts", + "test:watch": "vitest watch", + "test:e2e:watch": "vitest watch -c vitest.config.e2e.ts" }, "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", diff --git a/packages/s3-presigned-post/src/createPresignedPost.e2e.spec.ts b/packages/s3-presigned-post/src/createPresignedPost.e2e.spec.ts index 2a2686c44d4f..49d719c6e354 100644 --- a/packages/s3-presigned-post/src/createPresignedPost.e2e.spec.ts +++ b/packages/s3-presigned-post/src/createPresignedPost.e2e.spec.ts @@ -1,24 +1,27 @@ // Run using AWS_SMOKE_TEST_REGION=[Region] AWS_SMOKE_TEST_BUCKET=[Bucket] yarn test:e2e // These params are established in /tests/e2e. - import { NoSuchKey, S3 } from "@aws-sdk/client-s3"; +import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test as it } from "vitest"; const FormData = require("form-data"); import { createReadStream, existsSync, rmSync, writeFileSync } from "fs"; import { join } from "path"; +import { getIntegTestResources } from "../../../tests/e2e/get-integ-test-resources"; import { createPresignedPost } from "./createPresignedPost"; -const region = process.env.AWS_SMOKE_TEST_REGION ?? ""; -const Bucket = process.env.AWS_SMOKE_TEST_BUCKET ?? ""; -if (!Bucket) { - throw new Error("process.env.AWS_SMOKE_TEST_BUCKET is not set."); -} -if (!region) { - throw new Error("process.env.AWS_SMOKE_TEST_REGION is not set."); -} - describe(createPresignedPost.name, () => { + let Bucket: string; + let region: string; + + beforeAll(async () => { + const integTestResourcesEnv = await getIntegTestResources(); + Object.assign(process.env, integTestResourcesEnv); + + region = process?.env?.AWS_SMOKE_TEST_REGION as string; + Bucket = process?.env?.AWS_SMOKE_TEST_BUCKET as string; + }); + it("should allow custom endpoints to be modified by endpoint resolution options", async () => { const Key = "test-key"; { diff --git a/packages/s3-presigned-post/src/createPresignedPost.spec.ts b/packages/s3-presigned-post/src/createPresignedPost.spec.ts index dd8d32bae25b..5387efc0fe80 100644 --- a/packages/s3-presigned-post/src/createPresignedPost.spec.ts +++ b/packages/s3-presigned-post/src/createPresignedPost.spec.ts @@ -1,5 +1,7 @@ import { defaultEndpointResolver } from "@aws-sdk/client-s3/src/endpoint/endpointResolver"; +import { createScope, getSigningKey } from "@smithy/signature-v4"; import { HttpRequest, SourceData } from "@smithy/types"; +import { afterAll, beforeEach, describe, expect, test as it, vi } from "vitest"; import { ALGORITHM_IDENTIFIER, @@ -8,22 +10,18 @@ import { CREDENTIAL_QUERY_PARAM, SIGNATURE_QUERY_PARAM, } from "./constants"; +import { createPresignedPost } from "./createPresignedPost"; -const mockCreateScope = jest.fn().mockReturnValue("mock_credential_scope"); -const mockGetSigningKey = jest.fn().mockReturnValue(Buffer.from("mock_signing_key")); -jest.mock("@smithy/signature-v4", () => ({ - createScope: mockCreateScope, - getSigningKey: mockGetSigningKey, +vi.mock("@smithy/signature-v4", () => ({ + createScope: vi.fn().mockReturnValue("mock_credential_scope"), + getSigningKey: vi.fn().mockReturnValue(Buffer.from("mock_signing_key")), SignatureV4: class {}, })); -const mockHexEncoder = jest.fn().mockReturnValue("mock_hex_encoded"); -jest.mock("@smithy/util-hex-encoding", () => ({ - toHex: mockHexEncoder, +vi.mock("@smithy/util-hex-encoding", () => ({ + toHex: vi.fn().mockReturnValue("mock_hex_encoded"), })); -import { createPresignedPost } from "./createPresignedPost"; - const endpoint: HttpRequest = { method: "POST", protocol: "https:", @@ -36,8 +34,8 @@ const credentials = { accessKeyId: "AKID", secretAccessKey: "SECRET", }; -const mockHashUpdate = jest.fn(); -const mockHashCtor = jest.fn(); +const mockHashUpdate = vi.fn(); +const mockHashCtor = vi.fn(); const sha256 = function (secret: SourceData) { mockHashCtor(secret); //@ts-ignore mock constructor @@ -54,8 +52,8 @@ const mockS3Client = { endpointProvider: defaultEndpointResolver, forcePathStyle: true, systemClockOffset: 0, - base64Encoder: jest.fn().mockReturnValue("mock_base64_encoded"), - utf8Decoder: jest.fn().mockReturnValue(Buffer.from("mock_utf8_decoded")), + base64Encoder: vi.fn().mockReturnValue("mock_base64_encoded"), + utf8Decoder: vi.fn().mockReturnValue(Buffer.from("mock_utf8_decoded")), sha256, region: async () => region, credentials: async () => credentials, @@ -66,10 +64,10 @@ describe("createPresignedPost", () => { const Bucket = "bucket"; const Key = "key"; //Mock Date.now() to be 2020-10-28T22:56:49.535Z - const dateNowMock = jest.spyOn(Date, "now").mockImplementation(() => 1603925809535); + const dateNowMock = vi.spyOn(Date, "now").mockImplementation(() => 1603925809535); beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); afterAll(() => { @@ -93,9 +91,9 @@ describe("createPresignedPost", () => { [SIGNATURE_QUERY_PARAM]: "mock_hex_encoded", }); - expect(mockCreateScope.mock.calls[0]).toEqual(["20201028", "us-foo-1", "s3"]); + expect(vi.mocked(createScope).mock.calls[0]).toEqual(["20201028", "us-foo-1", "s3"]); expect(mockS3Client.config.utf8Decoder).toBeCalled(); - expect(mockGetSigningKey.mock.calls[0]).toEqual([sha256, credentials, "20201028", "us-foo-1", "s3"]); + expect(vi.mocked(getSigningKey).mock.calls[0]).toEqual([sha256, credentials, "20201028", "us-foo-1", "s3"]); }); it("should generate presigned post with filename", async () => { diff --git a/packages/s3-presigned-post/vitest.config.e2e.ts b/packages/s3-presigned-post/vitest.config.e2e.ts new file mode 100644 index 000000000000..92073c6cfcf0 --- /dev/null +++ b/packages/s3-presigned-post/vitest.config.e2e.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.e2e.spec.ts"], + environment: "node", + }, +}); diff --git a/packages/s3-presigned-post/vitest.config.ts b/packages/s3-presigned-post/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/packages/s3-presigned-post/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/private/aws-middleware-test/jest.config.js b/private/aws-middleware-test/jest.config.js deleted file mode 100644 index 37675d406a43..000000000000 --- a/private/aws-middleware-test/jest.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.spec.ts"], -}; diff --git a/private/aws-middleware-test/package.json b/private/aws-middleware-test/package.json index 5b61d31c79cc..1d995edee168 100644 --- a/private/aws-middleware-test/package.json +++ b/private/aws-middleware-test/package.json @@ -10,7 +10,8 @@ "build:types": "exit 0", "build:types:downlevel": "exit 0", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "test": "jest --coverage --passWithNoTests" + "test": "vitest run", + "test:watch": "vitest watch" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/private/aws-middleware-test/src/middleware-apply-body-checksum.spec.ts b/private/aws-middleware-test/src/middleware-apply-body-checksum.spec.ts index f913246e2045..859ec9cf31dc 100644 --- a/private/aws-middleware-test/src/middleware-apply-body-checksum.spec.ts +++ b/private/aws-middleware-test/src/middleware-apply-body-checksum.spec.ts @@ -1,4 +1,5 @@ import { S3Control } from "@aws-sdk/client-s3-control"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../aws-util-test/src"; diff --git a/private/aws-middleware-test/src/middleware-content-length.spec.ts b/private/aws-middleware-test/src/middleware-content-length.spec.ts index e4849e9ffa9d..1ac77a156a81 100644 --- a/private/aws-middleware-test/src/middleware-content-length.spec.ts +++ b/private/aws-middleware-test/src/middleware-content-length.spec.ts @@ -1,6 +1,7 @@ import { AccessAnalyzer } from "@aws-sdk/client-accessanalyzer"; import { S3 } from "@aws-sdk/client-s3"; import { XRay } from "@aws-sdk/client-xray"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../../private/aws-util-test/src"; diff --git a/private/aws-middleware-test/src/middleware-endpoint.spec.ts b/private/aws-middleware-test/src/middleware-endpoint.spec.ts index fd35effa31d4..6550d1c6d387 100644 --- a/private/aws-middleware-test/src/middleware-endpoint.spec.ts +++ b/private/aws-middleware-test/src/middleware-endpoint.spec.ts @@ -1,5 +1,6 @@ import { S3 } from "@aws-sdk/client-s3"; import { S3Control } from "@aws-sdk/client-s3-control"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../aws-util-test/src"; diff --git a/private/aws-middleware-test/src/middleware-retry.spec.ts b/private/aws-middleware-test/src/middleware-retry.spec.ts index f22880ffee54..9e8a649cf0fa 100644 --- a/private/aws-middleware-test/src/middleware-retry.spec.ts +++ b/private/aws-middleware-test/src/middleware-retry.spec.ts @@ -1,4 +1,5 @@ import { Lambda } from "@aws-sdk/client-lambda"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../aws-util-test/src"; diff --git a/private/aws-middleware-test/src/middleware-serde.spec.ts b/private/aws-middleware-test/src/middleware-serde.spec.ts index 88f476cf556a..7e86611c7462 100644 --- a/private/aws-middleware-test/src/middleware-serde.spec.ts +++ b/private/aws-middleware-test/src/middleware-serde.spec.ts @@ -2,6 +2,7 @@ import { EC2 } from "@aws-sdk/client-ec2"; import { S3 } from "@aws-sdk/client-s3"; import { SageMaker } from "@aws-sdk/client-sagemaker"; import { SageMakerRuntime } from "@aws-sdk/client-sagemaker-runtime"; +import { describe, test as it } from "vitest"; import { requireRequestsFrom } from "../../aws-util-test/src"; diff --git a/private/aws-middleware-test/src/util-stream.spec.ts b/private/aws-middleware-test/src/util-stream.spec.ts index 9a171afd2ee6..dd22adc04365 100644 --- a/private/aws-middleware-test/src/util-stream.spec.ts +++ b/private/aws-middleware-test/src/util-stream.spec.ts @@ -4,6 +4,7 @@ import { HttpRequest as IHttpRequest } from "@smithy/types"; import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; import { fromUtf8 } from "@smithy/util-utf8"; import { Readable } from "stream"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../../aws-util-test/src"; diff --git a/private/aws-middleware-test/vitest.config.ts b/private/aws-middleware-test/vitest.config.ts new file mode 100644 index 000000000000..4e46707824a5 --- /dev/null +++ b/private/aws-middleware-test/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); diff --git a/private/aws-util-test/jest.config.integ.js b/private/aws-util-test/jest.config.integ.js deleted file mode 100644 index d09aba7398c7..000000000000 --- a/private/aws-util-test/jest.config.integ.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testMatch: ["**/*.integ.spec.ts"], -}; diff --git a/private/aws-util-test/package.json b/private/aws-util-test/package.json index 73979c279706..b7bdf3bbbe66 100644 --- a/private/aws-util-test/package.json +++ b/private/aws-util-test/package.json @@ -10,7 +10,8 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", "prepack": "yarn run clean && yarn run build", - "test:integration": "jest --coverage --passWithNoTests --config jest.config.integ.js" + "test:integration": "vitest run -c vitest.config.integ.ts", + "test:integration:watch": "vitest watch -c vitest.config.integ.ts" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts", diff --git a/private/aws-util-test/src/clients/Weather.integ.spec.ts b/private/aws-util-test/src/clients/Weather.integ.spec.ts index 9e45c8ab6b18..4df5afaea2a6 100644 --- a/private/aws-util-test/src/clients/Weather.integ.spec.ts +++ b/private/aws-util-test/src/clients/Weather.integ.spec.ts @@ -1,4 +1,5 @@ import { Weather } from "@aws-sdk/weather"; +import { describe, expect, test as it } from "vitest"; import { requireRequestsFrom } from "../requests/test-http-handler"; diff --git a/private/aws-util-test/src/requests/test-http-handler.integ.spec.ts b/private/aws-util-test/src/requests/test-http-handler.integ.spec.ts index b0ee38d6b192..85d8a8697da8 100644 --- a/private/aws-util-test/src/requests/test-http-handler.integ.spec.ts +++ b/private/aws-util-test/src/requests/test-http-handler.integ.spec.ts @@ -1,15 +1,14 @@ +import { describe, expect, test as it } from "vitest"; + // import { JsonProtocol } from "@aws-sdk/aws-protocoltests-json"; // CI has difficult importing a named private client from the workspace. // This file remains as a code sample. - import { TestHttpHandler } from "./test-http-handler"; describe(TestHttpHandler.name, () => { it("checks requests using matchers", async () => { // const client = new JsonProtocol({}); - // expect.assertions(15); - // new TestHttpHandler({ // method: "POST", // hostname: /jsonprotocol\.(.*?)\.amazonaws\.com/, @@ -35,7 +34,6 @@ describe(TestHttpHandler.name, () => { // expect(parse.Boolean).toBe(false); // }, // }).watch(client); - // await client.kitchenSinkOperation({ // Blob: new Uint8Array(), // Boolean: false, diff --git a/private/aws-util-test/src/requests/test-http-handler.ts b/private/aws-util-test/src/requests/test-http-handler.ts index 0be329ed7ddb..e27282cd780b 100644 --- a/private/aws-util-test/src/requests/test-http-handler.ts +++ b/private/aws-util-test/src/requests/test-http-handler.ts @@ -1,5 +1,6 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Client, HttpHandlerOptions, RequestHandler, RequestHandlerOutput } from "@smithy/types"; +import { expect } from "vitest"; /** * Instructs {@link TestHttpHandler} how to match the handled request and the expected request. diff --git a/private/aws-util-test/tsconfig.json b/private/aws-util-test/tsconfig.json index 78506bf92c0b..182e01894218 100644 --- a/private/aws-util-test/tsconfig.json +++ b/private/aws-util-test/tsconfig.json @@ -9,5 +9,5 @@ "rootDir": "src", "useUnknownInCatchVariables": false }, - "exclude": ["test/", "*.spec.ts"] + "exclude": ["test/", "*.spec.ts", "vitest.*.ts"] } diff --git a/private/aws-util-test/vitest.config.integ.ts b/private/aws-util-test/vitest.config.integ.ts new file mode 100644 index 000000000000..5802db1ac64a --- /dev/null +++ b/private/aws-util-test/vitest.config.integ.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.integ.spec.ts"], + environment: "node", + }, +}); diff --git a/scripts/runtime-dependency-version-check/check-dependencies.js b/scripts/runtime-dependency-version-check/check-dependencies.js index c806252aeee0..2bf0e358e2fb 100644 --- a/scripts/runtime-dependency-version-check/check-dependencies.js +++ b/scripts/runtime-dependency-version-check/check-dependencies.js @@ -45,6 +45,8 @@ const node_libraries = [ "zlib", ]; +const ignored = [...node_libraries, "vitest"]; + (async () => { const errors = []; @@ -85,7 +87,7 @@ const node_libraries = [ ...new Set( [...(contents.toString().match(/(from |import\()"(.*?)"\)?;/g) ?? [])] .map((_) => _.replace(/(from ")|(import\(")/g, "").replace(/"\)?;$/, "")) - .filter((_) => !_.startsWith(".") && !node_libraries.includes(_)) + .filter((_) => !_.startsWith(".") && !ignored.includes(_)) ) ); diff --git a/scripts/runtime-dependency-version-check/runtime-dep-version-check.js b/scripts/runtime-dependency-version-check/runtime-dep-version-check.js index 5f8aa0167aab..e55e8d37d901 100644 --- a/scripts/runtime-dependency-version-check/runtime-dep-version-check.js +++ b/scripts/runtime-dependency-version-check/runtime-dep-version-check.js @@ -50,6 +50,8 @@ const deps = { } */ }; +const ignored = ["vitest"]; + readPackages(clientPackages); checkVersions(); @@ -132,6 +134,9 @@ function checkVersions() { const errors = []; for (const [pkg, versions] of Object.entries(deps)) { + if (ignored.includes(pkg)) { + continue; + } const versionCount = Object.keys(versions).length; if (versionCount > 1) { console.error("There is more than one version of a declared runtime dependency."); diff --git a/scripts/validation/vitest-validation.js b/scripts/validation/vitest-validation.js index 4ceaa246038f..7ae496de613a 100644 --- a/scripts/validation/vitest-validation.js +++ b/scripts/validation/vitest-validation.js @@ -3,25 +3,62 @@ const path = require("path"); const walk = require("../utils/walk"); const paths = [ - path.join(__dirname, "..", "..", "lib", "lib-dynamodb"), - path.join(__dirname, "..", "..", "lib", "lib-storage"), - path.join(__dirname, "..", "..", "packages", "body-checksum-browser"), - path.join(__dirname, "..", "..", "packages", "body-checksum-node"), - path.join(__dirname, "..", "..", "packages", "chunked-stream-reader-node"), - path.join(__dirname, "..", "..", "packages", "cloudfront-signer"), - path.join(__dirname, "..", "..", "packages", "core"), - path.join(__dirname, "..", "..", "packages", "credential-provider-cognito-identity"), - path.join(__dirname, "..", "..", "packages", "credential-provider-env"), - path.join(__dirname, "..", "..", "packages", "credential-provider-http"), - path.join(__dirname, "..", "..", "packages", "credential-provider-ini"), - path.join(__dirname, "..", "..", "packages", "credential-provider-node"), - path.join(__dirname, "..", "..", "packages", "credential-provider-process"), - path.join(__dirname, "..", "..", "packages", "credential-provider-sso"), - path.join(__dirname, "..", "..", "packages", "credential-provider-web-identity"), - path.join(__dirname, "..", "..", "packages", "credential-providers"), - path.join(__dirname, "..", "..", "packages", "ec2-metadata-service"), - path.join(__dirname, "..", "..", "packages", "endpoint-cache"), - path.join(__dirname, "..", "..", "packages", "eventstream-handler-node"), + // path.join(__dirname, "..", "..", "clients", "client-kinesis"), + // path.join(__dirname, "..", "..", "clients", "client-s3"), + // path.join(__dirname, "..", "..", "clients", "client-sts"), + // path.join(__dirname, "..", "..", "clients", "client-transcribe-streaming"), + + // path.join(__dirname, "..", "..", "lib", "lib-dynamodb"), + // path.join(__dirname, "..", "..", "lib", "lib-storage"), + // path.join(__dirname, "..", "..", "packages", "body-checksum-browser"), + // path.join(__dirname, "..", "..", "packages", "body-checksum-node"), + // path.join(__dirname, "..", "..", "packages", "chunked-stream-reader-node"), + // path.join(__dirname, "..", "..", "packages", "cloudfront-signer"), + // path.join(__dirname, "..", "..", "packages", "core"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-cognito-identity"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-env"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-http"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-ini"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-node"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-process"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-sso"), + // path.join(__dirname, "..", "..", "packages", "credential-provider-web-identity"), + // path.join(__dirname, "..", "..", "packages", "credential-providers"), + // path.join(__dirname, "..", "..", "packages", "ec2-metadata-service"), + // path.join(__dirname, "..", "..", "packages", "endpoint-cache"), + // path.join(__dirname, "..", "..", "packages", "eventstream-handler-node"), + + // path.join(__dirname, "..", "..", "packages", "middleware-api-key"), + // path.join(__dirname, "..", "..", "packages", "middleware-bucket-endpoint"), + // path.join(__dirname, "..", "..", "packages", "middleware-endpoint-discovery"), + // path.join(__dirname, "..", "..", "packages", "middleware-eventstream"), + // path.join(__dirname, "..", "..", "packages", "middleware-expect-continue"), + // path.join(__dirname, "..", "..", "packages", "middleware-flexible-checksums"), + // path.join(__dirname, "..", "..", "packages", "middleware-host-header"), + // path.join(__dirname, "..", "..", "packages", "middleware-location-constraint"), + // path.join(__dirname, "..", "..", "packages", "middleware-logger"), + // path.join(__dirname, "..", "..", "packages", "middleware-recursion-detection"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-api-gateway"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-ec2"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-glacier"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-machinelearning"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-rds"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-route53"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-s3"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-s3-control"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-sqs"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-sts"), + // path.join(__dirname, "..", "..", "packages", "middleware-sdk-transcribe-streaming"), + // path.join(__dirname, "..", "..", "packages", "middleware-signing"), + // path.join(__dirname, "..", "..", "packages", "middleware-ssec"), + // path.join(__dirname, "..", "..", "packages", "middleware-token"), + // path.join(__dirname, "..", "..", "packages", "middleware-user-agent"), + // path.join(__dirname, "..", "..", "packages", "middleware-websocket"), + + // path.join(__dirname, "..", "..", "packages", "s3-presigned-post"), + + // path.join(__dirname, "..", "..", "private", "aws-middleware-test"), + path.join(__dirname, "..", "..", "private", "aws-util-test"), ]; (async () => { @@ -53,7 +90,7 @@ const paths = [ } } - for (const testType of [/* "integ", */ "e2e"]) { + for (const testType of ["integ", "e2e"]) { const script = testType === "integ" ? "integration" : testType; if (pkgJson.scripts[`test:${script}`]) { pkgJson.scripts[`test:${script}:watch`] = `vitest watch -c vitest.config.${testType}.ts`; @@ -120,8 +157,12 @@ const paths = [ } } + if (contents.includes("expect.")) { + imports.push("expect"); + } + contents = contents.replace(/import {(.*?)} from "(vitest|vtestest)";/g, ""); - contents = `import { ${imports.join(", ")} } from "vitest";\n\n` + contents; + contents = `import { ${[...new Set(imports)].join(", ")} } from "vitest";\n\n` + contents; fs.writeFileSync(file, contents); } diff --git a/tests/e2e/get-integ-test-resources.d.ts b/tests/e2e/get-integ-test-resources.d.ts new file mode 100644 index 000000000000..fe58c2acd5a8 --- /dev/null +++ b/tests/e2e/get-integ-test-resources.d.ts @@ -0,0 +1 @@ +export function getIntegTestResources(): Promise; diff --git a/turbo.json b/turbo.json index 67e299cd6222..7e1ec42b901c 100644 --- a/turbo.json +++ b/turbo.json @@ -44,6 +44,9 @@ }, "test:integration": { "cache": false + }, + "test:e2e": { + "cache": false } } } diff --git a/vitest.config.e2e.ts b/vitest.config.e2e.ts index 63cc1b795d99..9b90fa996c26 100644 --- a/vitest.config.e2e.ts +++ b/vitest.config.e2e.ts @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["lib/lib-dynamodb/**/*.e2e.spec.{ts,js}", "lib/lib-storage/**/*.e2e.spec.{ts,js}"], + include: ["lib/lib-dynamodb/**/*.e2e.spec.ts", "lib/lib-storage/**/*.e2e.spec.ts", "packages/**/*.e2e.spec.ts"], environment: "node", }, }); diff --git a/vitest.config.integ.ts b/vitest.config.integ.ts new file mode 100644 index 000000000000..f24eb5805243 --- /dev/null +++ b/vitest.config.integ.ts @@ -0,0 +1,55 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{e2e,browser}.spec.ts"], + include: [ + "lib/lib-dynamodb/**/*.integ.spec.ts", + "lib/lib-storage/**/*.integ.spec.ts", + // "packages/body-checksum-browser/**/*.integ.spec.ts", + "packages/body-checksum-node/**/*.integ.spec.ts", + "packages/chunked-stream-reader-node/**/*.integ.spec.ts", + "packages/cloudfront-signer/**/*.integ.spec.ts", + "packages/core/**/*.integ.spec.ts", + "packages/credential-provider-cognito-identity/**/*.integ.spec.ts", + "packages/credential-provider-env/**/*.integ.spec.ts", + "packages/credential-provider-http/**/*.integ.spec.ts", + "packages/credential-provider-ini/**/*.integ.spec.ts", + // "packages/credential-provider-node/**/*.integ.spec.ts", + "packages/credential-provider-process/**/*.integ.spec.ts", + "packages/credential-provider-sso/**/*.integ.spec.ts", + "packages/credential-provider-web-identity/**/*.integ.spec.ts", + "packages/credential-providers/**/*.integ.spec.ts", + "packages/ec2-metadata-service/**/*.integ.spec.ts", + "packages/endpoint-cache/**/*.integ.spec.ts", + "packages/eventstream-handler-node/**/*.integ.spec.ts", + "packages/middleware-api-key/**/*.integ.spec.ts", + "packages/middleware-bucket-endpoint/**/*.integ.spec.ts", + "packages/middleware-endpoint-discovery/**/*.integ.spec.ts", + "packages/middleware-eventstream/**/*.integ.spec.ts", + "packages/middleware-expect-continue/**/*.integ.spec.ts", + "packages/middleware-flexible-checksums/**/*.integ.spec.ts", + "packages/middleware-host-header/**/*.integ.spec.ts", + "packages/middleware-location-constraint/**/*.integ.spec.ts", + "packages/middleware-logger/**/*.integ.spec.ts", + "packages/middleware-recursion-detection/**/*.integ.spec.ts", + "packages/middleware-sdk-api-gateway/**/*.integ.spec.ts", + "packages/middleware-sdk-ec2/**/*.integ.spec.ts", + "packages/middleware-sdk-glacier/**/*.integ.spec.ts", + "packages/middleware-sdk-machinelearning/**/*.integ.spec.ts", + "packages/middleware-sdk-rds/**/*.integ.spec.ts", + "packages/middleware-sdk-route53/**/*.integ.spec.ts", + "packages/middleware-sdk-s3/**/*.integ.spec.ts", + "packages/middleware-sdk-s3-control/**/*.integ.spec.ts", + "packages/middleware-sdk-sqs/**/*.integ.spec.ts", + "packages/middleware-sdk-sts/**/*.integ.spec.ts", + "packages/middleware-sdk-transcribe-streaming/**/*.integ.spec.ts", + "packages/middleware-signing/**/*.integ.spec.ts", + "packages/middleware-ssec/**/*.integ.spec.ts", + "packages/middleware-token/**/*.integ.spec.ts", + "packages/middleware-user-agent/**/*.integ.spec.ts", + "packages/middleware-websocket/**/*.integ.spec.ts", + ], + environment: "node", + }, +}); diff --git a/vitest.config.ts b/vitest.config.ts index e1db99b6dcbf..0e34a11c1215 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,27 +2,54 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - exclude: ["**/*.{integ,e2e,browser}.spec.{ts,js}"], + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], include: [ - "lib/lib-dynamodb/**/*.spec.{ts,js}", - "lib/lib-storage/**/*.spec.{ts,js}", - // "packages/body-checksum-browser/**/*.spec.{ts,js}", - "packages/body-checksum-node/**/*.spec.{ts,js}", - "packages/chunked-stream-reader-node/**/*.spec.{ts,js}", - "packages/cloudfront-signer/**/*.spec.{ts,js}", - "packages/core/**/*.spec.{ts,js}", - "packages/credential-provider-cognito-identity/**/*.spec.{ts,js}", - "packages/credential-provider-env/**/*.spec.{ts,js}", - "packages/credential-provider-http/**/*.spec.{ts,js}", - "packages/credential-provider-ini/**/*.spec.{ts,js}", - "packages/credential-provider-node/**/*.spec.{ts,js}", - "packages/credential-provider-process/**/*.spec.{ts,js}", - "packages/credential-provider-sso/**/*.spec.{ts,js}", - "packages/credential-provider-web-identity/**/*.spec.{ts,js}", - "packages/credential-providers/**/*.spec.{ts,js}", - "packages/ec2-metadata-service/**/*.spec.{ts,js}", - "packages/endpoint-cache/**/*.spec.{ts,js}", - "packages/eventstream-handler-node/**/*.spec.{ts,js}", + "clients/client-*/**/*.spec.ts", + "lib/lib-dynamodb/**/*.spec.ts", + "lib/lib-storage/**/*.spec.ts", + // "packages/body-checksum-browser/**/*.spec.ts", + "packages/body-checksum-node/**/*.spec.ts", + "packages/chunked-stream-reader-node/**/*.spec.ts", + "packages/cloudfront-signer/**/*.spec.ts", + "packages/core/**/*.spec.ts", + "packages/credential-provider-cognito-identity/**/*.spec.ts", + "packages/credential-provider-env/**/*.spec.ts", + "packages/credential-provider-http/**/*.spec.ts", + "packages/credential-provider-ini/**/*.spec.ts", + "packages/credential-provider-node/**/*.spec.ts", + "packages/credential-provider-process/**/*.spec.ts", + "packages/credential-provider-sso/**/*.spec.ts", + "packages/credential-provider-web-identity/**/*.spec.ts", + "packages/credential-providers/**/*.spec.ts", + "packages/ec2-metadata-service/**/*.spec.ts", + "packages/endpoint-cache/**/*.spec.ts", + "packages/eventstream-handler-node/**/*.spec.ts", + "packages/middleware-api-key/**/*.spec.ts", + "packages/middleware-bucket-endpoint/**/*.spec.ts", + "packages/middleware-endpoint-discovery/**/*.spec.ts", + "packages/middleware-eventstream/**/*.spec.ts", + "packages/middleware-expect-continue/**/*.spec.ts", + "packages/middleware-flexible-checksums/**/*.spec.ts", + "packages/middleware-host-header/**/*.spec.ts", + "packages/middleware-location-constraint/**/*.spec.ts", + "packages/middleware-logger/**/*.spec.ts", + "packages/middleware-recursion-detection/**/*.spec.ts", + "packages/middleware-sdk-api-gateway/**/*.spec.ts", + "packages/middleware-sdk-ec2/**/*.spec.ts", + "packages/middleware-sdk-glacier/**/*.spec.ts", + "packages/middleware-sdk-machinelearning/**/*.spec.ts", + "packages/middleware-sdk-rds/**/*.spec.ts", + "packages/middleware-sdk-route53/**/*.spec.ts", + "packages/middleware-sdk-s3/**/*.spec.ts", + "packages/middleware-sdk-s3-control/**/*.spec.ts", + "packages/middleware-sdk-sqs/**/*.spec.ts", + "packages/middleware-sdk-sts/**/*.spec.ts", + "packages/middleware-sdk-transcribe-streaming/**/*.spec.ts", + "packages/middleware-signing/**/*.spec.ts", + "packages/middleware-ssec/**/*.spec.ts", + "packages/middleware-token/**/*.spec.ts", + "packages/middleware-user-agent/**/*.spec.ts", + // "packages/middleware-websocket/**/*.spec.ts", ], environment: "node", }, diff --git a/yarn.lock b/yarn.lock index a9d45230dcf1..05786cefc5c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8432,7 +8432,7 @@ jest-config@^29.7.0: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.0.2, jest-diff@^28.1.3: +jest-diff@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-28.1.3.tgz" integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== @@ -8442,6 +8442,16 @@ jest-diff@^28.0.2, jest-diff@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" +jest-diff@^29.2.0, jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + jest-diff@^29.6.1: version "29.6.1" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz" @@ -8452,16 +8462,6 @@ jest-diff@^29.6.1: jest-get-type "^29.4.3" pretty-format "^29.6.1" -jest-diff@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" - integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.6.3" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - jest-docblock@^28.1.1: version "28.1.1" resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-28.1.1.tgz" @@ -8999,14 +8999,6 @@ jest-watcher@^29.7.0: jest-util "^29.7.0" string-length "^4.0.1" -jest-websocket-mock@^2.0.2: - version "2.4.0" - resolved "https://registry.npmjs.org/jest-websocket-mock/-/jest-websocket-mock-2.4.0.tgz" - integrity sha512-AOwyuRw6fgROXHxMOiTDl1/T4dh3fV4jDquha5N0csS/PNp742HeTZWPAuKppVRSQ8s3fUGgJHoyZT9JDO0hMA== - dependencies: - jest-diff "^28.0.2" - mock-socket "^9.1.0" - jest-worker@^27.4.5, jest-worker@^27.4.6: version "27.5.1" resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz" @@ -10184,10 +10176,10 @@ mock-socket@9.1.5: resolved "https://registry.npmjs.org/mock-socket/-/mock-socket-9.1.5.tgz" integrity sha512-3DeNIcsQixWHHKk6NdoBhWI4t1VMj5/HzfnI1rE/pLl5qKx7+gd4DNA07ehTaZ6MoUU053si6Hd+YtiM/tQZfg== -mock-socket@^9.1.0: - version "9.2.1" - resolved "https://registry.npmjs.org/mock-socket/-/mock-socket-9.2.1.tgz" - integrity sha512-aw9F9T9G2zpGipLLhSNh6ZpgUyUl4frcVmRN08uE1NWPWg43Wx6+sGPDbQ7E5iFZZDJW5b5bypMeAEHqTbIFag== +mock-socket@^9.2.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/mock-socket/-/mock-socket-9.3.1.tgz#24fb00c2f573c84812aa4a24181bb025de80cc8e" + integrity sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw== modify-values@^1.0.0: version "1.0.1" @@ -13449,6 +13441,14 @@ vite@4.5.5, "vite@^3.0.0 || ^4.0.0", "vite@^3.0.0 || ^4.0.0 || ^5.0.0-0", "vite@ optionalDependencies: fsevents "~2.3.2" +vitest-websocket-mock@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/vitest-websocket-mock/-/vitest-websocket-mock-0.2.3.tgz#664a17a3f3ec38283810e4191dcc159c55b5fa33" + integrity sha512-Ea2CcXHWJj/DhXcFeZsAjCPQ/SD0LDkin8k5zexq4/1izaPqRROta4eYCBbD3l9NfEWOnvrcOPkk+jNNieLCWQ== + dependencies: + jest-diff "^29.2.0" + mock-socket "^9.2.1" + vitest@0.34.6: version "0.34.6" resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.6.tgz#44880feeeef493c04b7f795ed268f24a543250d7"