@aws-sdk/middleware-sdk-s3 3.495.0 → 3.499.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 +56 -11
- package/dist-cjs/s3-expires-middleware.js +1 -0
- package/dist-es/index.js +1 -0
- package/dist-es/s3-expires-middleware.js +33 -0
- package/dist-types/index.d.ts +1 -0
- package/dist-types/s3-expires-middleware.d.ts +26 -0
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/s3-expires-middleware.d.ts +14 -0
- package/package.json +8 -8
package/dist-cjs/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(src_exports, {
|
|
|
29
29
|
checkContentLengthHeaderMiddlewareOptions: () => checkContentLengthHeaderMiddlewareOptions,
|
|
30
30
|
getCheckContentLengthHeaderPlugin: () => getCheckContentLengthHeaderPlugin,
|
|
31
31
|
getRegionRedirectMiddlewarePlugin: () => getRegionRedirectMiddlewarePlugin,
|
|
32
|
+
getS3ExpiresMiddlewarePlugin: () => getS3ExpiresMiddlewarePlugin,
|
|
32
33
|
getS3ExpressPlugin: () => getS3ExpressPlugin,
|
|
33
34
|
getThrow200ExceptionsPlugin: () => getThrow200ExceptionsPlugin,
|
|
34
35
|
getValidateBucketNamePlugin: () => getValidateBucketNamePlugin,
|
|
@@ -37,6 +38,8 @@ __export(src_exports, {
|
|
|
37
38
|
regionRedirectMiddleware: () => regionRedirectMiddleware,
|
|
38
39
|
regionRedirectMiddlewareOptions: () => regionRedirectMiddlewareOptions,
|
|
39
40
|
resolveS3Config: () => resolveS3Config,
|
|
41
|
+
s3ExpiresMiddleware: () => s3ExpiresMiddleware,
|
|
42
|
+
s3ExpiresMiddlewareOptions: () => s3ExpiresMiddlewareOptions,
|
|
40
43
|
s3ExpressMiddleware: () => s3ExpressMiddleware,
|
|
41
44
|
s3ExpressMiddlewareOptions: () => s3ExpressMiddlewareOptions,
|
|
42
45
|
throw200ExceptionsMiddleware: () => throw200ExceptionsMiddleware,
|
|
@@ -146,6 +149,43 @@ var getRegionRedirectMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) =>
|
|
|
146
149
|
}
|
|
147
150
|
}), "getRegionRedirectMiddlewarePlugin");
|
|
148
151
|
|
|
152
|
+
// src/s3-expires-middleware.ts
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
var s3ExpiresMiddleware = /* @__PURE__ */ __name((config) => {
|
|
156
|
+
return (next, context) => async (args) => {
|
|
157
|
+
var _a;
|
|
158
|
+
const result = await next(args);
|
|
159
|
+
const { response } = result;
|
|
160
|
+
if (import_protocol_http.HttpResponse.isInstance(response)) {
|
|
161
|
+
if (response.headers.expires) {
|
|
162
|
+
response.headers.expiresstring = response.headers.expires;
|
|
163
|
+
try {
|
|
164
|
+
(0, import_smithy_client.parseRfc7231DateTime)(response.headers.expires);
|
|
165
|
+
} catch (e) {
|
|
166
|
+
(_a = context.logger) == null ? void 0 : _a.warn(
|
|
167
|
+
`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e}`
|
|
168
|
+
);
|
|
169
|
+
delete response.headers.expires;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return result;
|
|
174
|
+
};
|
|
175
|
+
}, "s3ExpiresMiddleware");
|
|
176
|
+
var s3ExpiresMiddlewareOptions = {
|
|
177
|
+
tags: ["S3"],
|
|
178
|
+
name: "s3ExpiresMiddleware",
|
|
179
|
+
override: true,
|
|
180
|
+
relation: "after",
|
|
181
|
+
toMiddleware: "deserializerMiddleware"
|
|
182
|
+
};
|
|
183
|
+
var getS3ExpiresMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({
|
|
184
|
+
applyToStack: (clientStack) => {
|
|
185
|
+
clientStack.addRelativeTo(s3ExpiresMiddleware(clientConfig), s3ExpiresMiddlewareOptions);
|
|
186
|
+
}
|
|
187
|
+
}), "getS3ExpiresMiddlewarePlugin");
|
|
188
|
+
|
|
149
189
|
// src/s3-express/classes/S3ExpressIdentityCache.ts
|
|
150
190
|
var _S3ExpressIdentityCache = class _S3ExpressIdentityCache {
|
|
151
191
|
constructor(data = {}) {
|
|
@@ -468,28 +508,33 @@ var getValidateBucketNamePlugin = /* @__PURE__ */ __name((unused) => ({
|
|
|
468
508
|
}
|
|
469
509
|
}), "getValidateBucketNamePlugin");
|
|
470
510
|
// Annotate the CommonJS export names for ESM import in node:
|
|
511
|
+
|
|
471
512
|
0 && (module.exports = {
|
|
472
|
-
NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS,
|
|
473
|
-
S3ExpressIdentityCache,
|
|
474
|
-
S3ExpressIdentityCacheEntry,
|
|
475
|
-
S3ExpressIdentityProviderImpl,
|
|
476
|
-
SignatureV4S3Express,
|
|
477
513
|
checkContentLengthHeader,
|
|
478
514
|
checkContentLengthHeaderMiddlewareOptions,
|
|
479
515
|
getCheckContentLengthHeaderPlugin,
|
|
480
|
-
getRegionRedirectMiddlewarePlugin,
|
|
481
|
-
getS3ExpressPlugin,
|
|
482
|
-
getThrow200ExceptionsPlugin,
|
|
483
|
-
getValidateBucketNamePlugin,
|
|
484
516
|
regionRedirectEndpointMiddleware,
|
|
485
517
|
regionRedirectEndpointMiddlewareOptions,
|
|
486
518
|
regionRedirectMiddleware,
|
|
487
519
|
regionRedirectMiddlewareOptions,
|
|
488
|
-
|
|
520
|
+
getRegionRedirectMiddlewarePlugin,
|
|
521
|
+
s3ExpiresMiddleware,
|
|
522
|
+
s3ExpiresMiddlewareOptions,
|
|
523
|
+
getS3ExpiresMiddlewarePlugin,
|
|
524
|
+
S3ExpressIdentityCache,
|
|
525
|
+
S3ExpressIdentityCacheEntry,
|
|
526
|
+
S3ExpressIdentityProviderImpl,
|
|
527
|
+
SignatureV4S3Express,
|
|
528
|
+
NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS,
|
|
529
|
+
getS3ExpressPlugin,
|
|
489
530
|
s3ExpressMiddleware,
|
|
490
531
|
s3ExpressMiddlewareOptions,
|
|
532
|
+
resolveS3Config,
|
|
491
533
|
throw200ExceptionsMiddleware,
|
|
492
534
|
throw200ExceptionsMiddlewareOptions,
|
|
535
|
+
getThrow200ExceptionsPlugin,
|
|
493
536
|
validateBucketNameMiddleware,
|
|
494
|
-
validateBucketNameMiddlewareOptions
|
|
537
|
+
validateBucketNameMiddlewareOptions,
|
|
538
|
+
getValidateBucketNamePlugin
|
|
495
539
|
});
|
|
540
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./index.js");
|
package/dist-es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./check-content-length-header";
|
|
2
2
|
export * from "./region-redirect-endpoint-middleware";
|
|
3
3
|
export * from "./region-redirect-middleware";
|
|
4
|
+
export * from "./s3-expires-middleware";
|
|
4
5
|
export * from "./s3-express/index";
|
|
5
6
|
export * from "./s3Configuration";
|
|
6
7
|
export * from "./throw-200-exceptions";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HttpResponse } from "@smithy/protocol-http";
|
|
2
|
+
import { parseRfc7231DateTime } from "@smithy/smithy-client";
|
|
3
|
+
export const s3ExpiresMiddleware = (config) => {
|
|
4
|
+
return (next, context) => async (args) => {
|
|
5
|
+
const result = await next(args);
|
|
6
|
+
const { response } = result;
|
|
7
|
+
if (HttpResponse.isInstance(response)) {
|
|
8
|
+
if (response.headers.expires) {
|
|
9
|
+
response.headers.expiresstring = response.headers.expires;
|
|
10
|
+
try {
|
|
11
|
+
parseRfc7231DateTime(response.headers.expires);
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e}`);
|
|
15
|
+
delete response.headers.expires;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export const s3ExpiresMiddlewareOptions = {
|
|
23
|
+
tags: ["S3"],
|
|
24
|
+
name: "s3ExpiresMiddleware",
|
|
25
|
+
override: true,
|
|
26
|
+
relation: "after",
|
|
27
|
+
toMiddleware: "deserializerMiddleware",
|
|
28
|
+
};
|
|
29
|
+
export const getS3ExpiresMiddlewarePlugin = (clientConfig) => ({
|
|
30
|
+
applyToStack: (clientStack) => {
|
|
31
|
+
clientStack.addRelativeTo(s3ExpiresMiddleware(clientConfig), s3ExpiresMiddlewareOptions);
|
|
32
|
+
},
|
|
33
|
+
});
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./check-content-length-header";
|
|
2
2
|
export * from "./region-redirect-endpoint-middleware";
|
|
3
3
|
export * from "./region-redirect-middleware";
|
|
4
|
+
export * from "./s3-expires-middleware";
|
|
4
5
|
export * from "./s3-express/index";
|
|
5
6
|
export * from "./s3Configuration";
|
|
6
7
|
export * from "./throw-200-exceptions";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DeserializeMiddleware, Pluggable, RelativeMiddlewareOptions } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
interface PreviouslyResolved {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*
|
|
10
|
+
* From the S3 Expires compatibility spec.
|
|
11
|
+
* A model transform will ensure S3#Expires remains a timestamp shape, though
|
|
12
|
+
* it is deprecated.
|
|
13
|
+
* If a particular object has a non-date string set as the Expires value,
|
|
14
|
+
* the SDK will have the raw string as "ExpiresString" on the response.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare const s3ExpiresMiddleware: (config: PreviouslyResolved) => DeserializeMiddleware<any, any>;
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const s3ExpiresMiddlewareOptions: RelativeMiddlewareOptions;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const getS3ExpiresMiddlewarePlugin: (clientConfig: PreviouslyResolved) => Pluggable<any, any>;
|
|
26
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./check-content-length-header";
|
|
2
2
|
export * from "./region-redirect-endpoint-middleware";
|
|
3
3
|
export * from "./region-redirect-middleware";
|
|
4
|
+
export * from "./s3-expires-middleware";
|
|
4
5
|
export * from "./s3-express/index";
|
|
5
6
|
export * from "./s3Configuration";
|
|
6
7
|
export * from "./throw-200-exceptions";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeserializeMiddleware,
|
|
3
|
+
Pluggable,
|
|
4
|
+
RelativeMiddlewareOptions,
|
|
5
|
+
} from "@smithy/types";
|
|
6
|
+
interface PreviouslyResolved {}
|
|
7
|
+
export declare const s3ExpiresMiddleware: (
|
|
8
|
+
config: PreviouslyResolved
|
|
9
|
+
) => DeserializeMiddleware<any, any>;
|
|
10
|
+
export declare const s3ExpiresMiddlewareOptions: RelativeMiddlewareOptions;
|
|
11
|
+
export declare const getS3ExpiresMiddlewarePlugin: (
|
|
12
|
+
clientConfig: PreviouslyResolved
|
|
13
|
+
) => Pluggable<any, any>;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-s3",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.499.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",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/types": "3.
|
|
26
|
+
"@aws-sdk/types": "3.496.0",
|
|
27
27
|
"@aws-sdk/util-arn-parser": "3.495.0",
|
|
28
|
-
"@smithy/node-config-provider": "^2.2.
|
|
29
|
-
"@smithy/protocol-http": "^3.1.
|
|
30
|
-
"@smithy/signature-v4": "^2.1.
|
|
31
|
-
"@smithy/smithy-client": "^2.3.
|
|
32
|
-
"@smithy/types": "^2.9.
|
|
33
|
-
"@smithy/util-config-provider": "^2.2.
|
|
28
|
+
"@smithy/node-config-provider": "^2.2.1",
|
|
29
|
+
"@smithy/protocol-http": "^3.1.1",
|
|
30
|
+
"@smithy/signature-v4": "^2.1.1",
|
|
31
|
+
"@smithy/smithy-client": "^2.3.1",
|
|
32
|
+
"@smithy/types": "^2.9.1",
|
|
33
|
+
"@smithy/util-config-provider": "^2.2.1",
|
|
34
34
|
"tslib": "^2.5.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|