@aws-sdk/middleware-sdk-s3 3.758.0 → 3.775.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -19,8 +19,8 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
 
21
21
  // src/index.ts
22
- var src_exports = {};
23
- __export(src_exports, {
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
24
  NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS: () => NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS,
25
25
  S3ExpressIdentityCache: () => S3ExpressIdentityCache,
26
26
  S3ExpressIdentityCacheEntry: () => S3ExpressIdentityCacheEntry,
@@ -51,7 +51,7 @@ __export(src_exports, {
51
51
  validateBucketNameMiddleware: () => validateBucketNameMiddleware,
52
52
  validateBucketNameMiddlewareOptions: () => validateBucketNameMiddlewareOptions
53
53
  });
54
- module.exports = __toCommonJS(src_exports);
54
+ module.exports = __toCommonJS(index_exports);
55
55
 
56
56
  // src/check-content-length-header.ts
57
57
  var import_protocol_http = require("@smithy/protocol-http");
@@ -82,9 +82,9 @@ var checkContentLengthHeaderMiddlewareOptions = {
82
82
  override: true
83
83
  };
84
84
  var getCheckContentLengthHeaderPlugin = /* @__PURE__ */ __name((unused) => ({
85
- applyToStack: (clientStack) => {
85
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
86
86
  clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
87
- }
87
+ }, "applyToStack")
88
88
  }), "getCheckContentLengthHeaderPlugin");
89
89
 
90
90
  // src/region-redirect-endpoint-middleware.ts
@@ -97,9 +97,9 @@ var regionRedirectEndpointMiddleware = /* @__PURE__ */ __name((config) => {
97
97
  if (context.__s3RegionRedirect) {
98
98
  Object.defineProperty(config, "region", {
99
99
  writable: false,
100
- value: async () => {
100
+ value: /* @__PURE__ */ __name(async () => {
101
101
  return context.__s3RegionRedirect;
102
- }
102
+ }, "value")
103
103
  });
104
104
  unlock = /* @__PURE__ */ __name(() => Object.defineProperty(config, "region", {
105
105
  writable: true,
@@ -161,10 +161,10 @@ var regionRedirectMiddlewareOptions = {
161
161
  override: true
162
162
  };
163
163
  var getRegionRedirectMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({
164
- applyToStack: (clientStack) => {
164
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
165
165
  clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
166
166
  clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
167
- }
167
+ }, "applyToStack")
168
168
  }), "getRegionRedirectMiddlewarePlugin");
169
169
 
170
170
  // src/s3-expires-middleware.ts
@@ -198,9 +198,9 @@ var s3ExpiresMiddlewareOptions = {
198
198
  toMiddleware: "deserializerMiddleware"
199
199
  };
200
200
  var getS3ExpiresMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({
201
- applyToStack: (clientStack) => {
201
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
202
202
  clientStack.addRelativeTo(s3ExpiresMiddleware(clientConfig), s3ExpiresMiddlewareOptions);
203
- }
203
+ }, "applyToStack")
204
204
  }), "getS3ExpiresMiddlewarePlugin");
205
205
 
206
206
  // src/s3-express/classes/S3ExpressIdentityCache.ts
@@ -330,8 +330,8 @@ var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
330
330
  var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
331
331
  var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
332
332
  var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
333
- environmentVariableSelector: (env) => (0, import_util_config_provider.booleanSelector)(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, import_util_config_provider.SelectorType.ENV),
334
- configFileSelector: (profile) => (0, import_util_config_provider.booleanSelector)(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, import_util_config_provider.SelectorType.CONFIG),
333
+ environmentVariableSelector: /* @__PURE__ */ __name((env) => (0, import_util_config_provider.booleanSelector)(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, import_util_config_provider.SelectorType.ENV), "environmentVariableSelector"),
334
+ configFileSelector: /* @__PURE__ */ __name((profile) => (0, import_util_config_provider.booleanSelector)(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, import_util_config_provider.SelectorType.CONFIG), "configFileSelector"),
335
335
  default: false
336
336
  };
337
337
 
@@ -430,9 +430,9 @@ var s3ExpressMiddlewareOptions = {
430
430
  override: true
431
431
  };
432
432
  var getS3ExpressPlugin = /* @__PURE__ */ __name((options) => ({
433
- applyToStack: (clientStack) => {
433
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
434
434
  clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
435
- }
435
+ }, "applyToStack")
436
436
  }), "getS3ExpressPlugin");
437
437
 
438
438
  // src/s3-express/functions/s3ExpressHttpSigningMiddleware.ts
@@ -489,12 +489,12 @@ var s3ExpressHttpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, c
489
489
  return output;
490
490
  }, "s3ExpressHttpSigningMiddleware");
491
491
  var getS3ExpressHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
492
- applyToStack: (clientStack) => {
492
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
493
493
  clientStack.addRelativeTo(
494
494
  s3ExpressHttpSigningMiddleware(config),
495
495
  import_core2.httpSigningMiddlewareOptions
496
496
  );
497
- }
497
+ }, "applyToStack")
498
498
  }), "getS3ExpressHttpSigningPlugin");
499
499
 
500
500
  // src/s3Configuration.ts
@@ -502,21 +502,28 @@ var resolveS3Config = /* @__PURE__ */ __name((input, {
502
502
  session
503
503
  }) => {
504
504
  const [s3ClientProvider, CreateSessionCommandCtor] = session;
505
- return {
506
- ...input,
507
- forcePathStyle: input.forcePathStyle ?? false,
508
- useAccelerateEndpoint: input.useAccelerateEndpoint ?? false,
509
- disableMultiregionAccessPoints: input.disableMultiregionAccessPoints ?? false,
510
- followRegionRedirects: input.followRegionRedirects ?? false,
511
- s3ExpressIdentityProvider: input.s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(
505
+ const {
506
+ forcePathStyle,
507
+ useAccelerateEndpoint,
508
+ disableMultiregionAccessPoints,
509
+ followRegionRedirects,
510
+ s3ExpressIdentityProvider,
511
+ bucketEndpoint
512
+ } = input;
513
+ return Object.assign(input, {
514
+ forcePathStyle: forcePathStyle ?? false,
515
+ useAccelerateEndpoint: useAccelerateEndpoint ?? false,
516
+ disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
517
+ followRegionRedirects: followRegionRedirects ?? false,
518
+ s3ExpressIdentityProvider: s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(
512
519
  async (key) => s3ClientProvider().send(
513
520
  new CreateSessionCommandCtor({
514
521
  Bucket: key
515
522
  })
516
523
  )
517
524
  ),
518
- bucketEndpoint: input.bucketEndpoint ?? false
519
- };
525
+ bucketEndpoint: bucketEndpoint ?? false
526
+ });
520
527
  }, "resolveS3Config");
521
528
 
522
529
  // src/throw-200-exceptions.ts
@@ -549,9 +556,9 @@ var throw200ExceptionsMiddleware = /* @__PURE__ */ __name((config) => (next, con
549
556
  }
550
557
  response.body = body;
551
558
  const bodyBytes = await collectBody(bodyCopy, {
552
- streamCollector: async (stream) => {
559
+ streamCollector: /* @__PURE__ */ __name(async (stream) => {
553
560
  return (0, import_util_stream.headStream)(stream, MAX_BYTES_TO_INSPECT);
554
- }
561
+ }, "streamCollector")
555
562
  });
556
563
  if (typeof bodyCopy?.destroy === "function") {
557
564
  bodyCopy.destroy();
@@ -581,9 +588,9 @@ var throw200ExceptionsMiddlewareOptions = {
581
588
  override: true
582
589
  };
583
590
  var getThrow200ExceptionsPlugin = /* @__PURE__ */ __name((config) => ({
584
- applyToStack: (clientStack) => {
591
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
585
592
  clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
586
- }
593
+ }, "applyToStack")
587
594
  }), "getThrow200ExceptionsPlugin");
588
595
 
589
596
  // src/validate-bucket-name.ts
@@ -648,10 +655,10 @@ var validateBucketNameMiddlewareOptions = {
648
655
  override: true
649
656
  };
650
657
  var getValidateBucketNamePlugin = /* @__PURE__ */ __name((options) => ({
651
- applyToStack: (clientStack) => {
658
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
652
659
  clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
653
660
  clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
654
- }
661
+ }, "applyToStack")
655
662
  }), "getValidateBucketNamePlugin");
656
663
  // Annotate the CommonJS export names for ESM import in node:
657
664
 
@@ -1,16 +1,16 @@
1
1
  import { S3ExpressIdentityProviderImpl } from "./s3-express";
2
2
  export const resolveS3Config = (input, { session, }) => {
3
3
  const [s3ClientProvider, CreateSessionCommandCtor] = session;
4
- return {
5
- ...input,
6
- forcePathStyle: input.forcePathStyle ?? false,
7
- useAccelerateEndpoint: input.useAccelerateEndpoint ?? false,
8
- disableMultiregionAccessPoints: input.disableMultiregionAccessPoints ?? false,
9
- followRegionRedirects: input.followRegionRedirects ?? false,
10
- s3ExpressIdentityProvider: input.s3ExpressIdentityProvider ??
4
+ const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, } = input;
5
+ return Object.assign(input, {
6
+ forcePathStyle: forcePathStyle ?? false,
7
+ useAccelerateEndpoint: useAccelerateEndpoint ?? false,
8
+ disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
9
+ followRegionRedirects: followRegionRedirects ?? false,
10
+ s3ExpressIdentityProvider: s3ExpressIdentityProvider ??
11
11
  new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
12
12
  Bucket: key,
13
13
  }))),
14
- bucketEndpoint: input.bucketEndpoint ?? false,
15
- };
14
+ bucketEndpoint: bucketEndpoint ?? false,
15
+ });
16
16
  };
@@ -1,9 +1,8 @@
1
1
  import type { Client, Command } from "@smithy/types";
2
2
  import { S3ExpressIdentityProvider } from "./s3-express";
3
3
  /**
4
- * @public
5
- *
6
4
  * All endpoint parameters with built-in bindings of AWS::S3::*
5
+ * @public
7
6
  */
8
7
  export interface S3InputConfig {
9
8
  /**
@@ -26,6 +25,9 @@ export interface S3InputConfig {
26
25
  * This feature should only be used as a last resort if you do not know the region of your bucket(s) ahead of time.
27
26
  */
28
27
  followRegionRedirects?: boolean;
28
+ /**
29
+ * Identity provider for an S3 feature.
30
+ */
29
31
  s3ExpressIdentityProvider?: S3ExpressIdentityProvider;
30
32
  /**
31
33
  * Whether to use the bucket name as the endpoint for this client.
@@ -33,15 +35,15 @@ export interface S3InputConfig {
33
35
  bucketEndpoint?: boolean;
34
36
  }
35
37
  /**
36
- * @internal
37
38
  * This is a placeholder for the actual
38
39
  * S3Client type from \@aws-sdk/client-s3. It is not explicitly
39
40
  * imported to avoid a circular dependency.
41
+ * @internal
40
42
  */
41
43
  type PlaceholderS3Client = Client<any, any, any> & any;
42
44
  /**
43
- * @internal
44
45
  * Placeholder for the constructor for CreateSessionCommand.
46
+ * @internal
45
47
  */
46
48
  type PlaceholderCreateSessionCommandCtor = {
47
49
  new (args: any): Command<any, any, any, any, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-s3",
3
- "version": "3.758.0",
3
+ "version": "3.775.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline middleware-sdk-s3",
@@ -27,18 +27,18 @@
27
27
  },
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@aws-sdk/core": "3.758.0",
31
- "@aws-sdk/types": "3.734.0",
30
+ "@aws-sdk/core": "3.775.0",
31
+ "@aws-sdk/types": "3.775.0",
32
32
  "@aws-sdk/util-arn-parser": "3.723.0",
33
- "@smithy/core": "^3.1.5",
34
- "@smithy/node-config-provider": "^4.0.1",
35
- "@smithy/protocol-http": "^5.0.1",
36
- "@smithy/signature-v4": "^5.0.1",
37
- "@smithy/smithy-client": "^4.1.6",
38
- "@smithy/types": "^4.1.0",
33
+ "@smithy/core": "^3.2.0",
34
+ "@smithy/node-config-provider": "^4.0.2",
35
+ "@smithy/protocol-http": "^5.1.0",
36
+ "@smithy/signature-v4": "^5.0.2",
37
+ "@smithy/smithy-client": "^4.2.0",
38
+ "@smithy/types": "^4.2.0",
39
39
  "@smithy/util-config-provider": "^4.0.0",
40
- "@smithy/util-middleware": "^4.0.1",
41
- "@smithy/util-stream": "^4.1.2",
40
+ "@smithy/util-middleware": "^4.0.2",
41
+ "@smithy/util-stream": "^4.2.0",
42
42
  "@smithy/util-utf8": "^4.0.0",
43
43
  "tslib": "^2.6.2"
44
44
  },