@aws-sdk/middleware-sdk-s3 3.496.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 +54 -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 +1 -1
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 = {}) {
|
|
@@ -470,28 +510,31 @@ var getValidateBucketNamePlugin = /* @__PURE__ */ __name((unused) => ({
|
|
|
470
510
|
// Annotate the CommonJS export names for ESM import in node:
|
|
471
511
|
|
|
472
512
|
0 && (module.exports = {
|
|
473
|
-
NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS,
|
|
474
|
-
S3ExpressIdentityCache,
|
|
475
|
-
S3ExpressIdentityCacheEntry,
|
|
476
|
-
S3ExpressIdentityProviderImpl,
|
|
477
|
-
SignatureV4S3Express,
|
|
478
513
|
checkContentLengthHeader,
|
|
479
514
|
checkContentLengthHeaderMiddlewareOptions,
|
|
480
515
|
getCheckContentLengthHeaderPlugin,
|
|
481
|
-
getRegionRedirectMiddlewarePlugin,
|
|
482
|
-
getS3ExpressPlugin,
|
|
483
|
-
getThrow200ExceptionsPlugin,
|
|
484
|
-
getValidateBucketNamePlugin,
|
|
485
516
|
regionRedirectEndpointMiddleware,
|
|
486
517
|
regionRedirectEndpointMiddlewareOptions,
|
|
487
518
|
regionRedirectMiddleware,
|
|
488
519
|
regionRedirectMiddlewareOptions,
|
|
489
|
-
|
|
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,
|
|
490
530
|
s3ExpressMiddleware,
|
|
491
531
|
s3ExpressMiddlewareOptions,
|
|
532
|
+
resolveS3Config,
|
|
492
533
|
throw200ExceptionsMiddleware,
|
|
493
534
|
throw200ExceptionsMiddlewareOptions,
|
|
535
|
+
getThrow200ExceptionsPlugin,
|
|
494
536
|
validateBucketNameMiddleware,
|
|
495
|
-
validateBucketNameMiddlewareOptions
|
|
537
|
+
validateBucketNameMiddlewareOptions,
|
|
538
|
+
getValidateBucketNamePlugin
|
|
496
539
|
});
|
|
497
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