@aws-sdk/middleware-sdk-s3 3.226.0 → 3.254.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 +0 -1
- package/dist-es/index.js +0 -1
- package/dist-types/index.d.ts +0 -1
- package/dist-types/ts3.4/index.d.ts +0 -1
- package/package.json +3 -4
- package/dist-cjs/write-get-object-response-endpoint.js +0 -43
- package/dist-es/write-get-object-response-endpoint.js +0 -38
- package/dist-types/ts3.4/write-get-object-response-endpoint.d.ts +0 -20
- package/dist-types/write-get-object-response-endpoint.d.ts +0 -20
package/dist-cjs/index.js
CHANGED
|
@@ -5,4 +5,3 @@ tslib_1.__exportStar(require("./check-content-length-header"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./configuration"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./throw-200-exceptions"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./validate-bucket-name"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./write-get-object-response-endpoint"), exports);
|
package/dist-es/index.js
CHANGED
package/dist-types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-s3",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.254.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/
|
|
24
|
-
"@aws-sdk/
|
|
25
|
-
"@aws-sdk/types": "3.226.0",
|
|
23
|
+
"@aws-sdk/protocol-http": "3.254.0",
|
|
24
|
+
"@aws-sdk/types": "3.254.0",
|
|
26
25
|
"@aws-sdk/util-arn-parser": "3.208.0",
|
|
27
26
|
"tslib": "^2.3.1"
|
|
28
27
|
},
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWriteGetObjectResponseEndpointPlugin = exports.writeGetObjectResponseEndpointMiddlewareOptions = exports.writeGetObjectResponseEndpointMiddleware = void 0;
|
|
4
|
-
const middleware_bucket_endpoint_1 = require("@aws-sdk/middleware-bucket-endpoint");
|
|
5
|
-
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
6
|
-
const writeGetObjectResponseEndpointMiddleware = (config) => (next, context) => async (args) => {
|
|
7
|
-
const { region: regionProvider, isCustomEndpoint, disableHostPrefix } = config;
|
|
8
|
-
const region = await regionProvider();
|
|
9
|
-
const { request, input } = args;
|
|
10
|
-
if (!protocol_http_1.HttpRequest.isInstance(request))
|
|
11
|
-
return next({ ...args });
|
|
12
|
-
let hostname = request.hostname;
|
|
13
|
-
if (hostname.endsWith("s3.amazonaws.com") || hostname.endsWith("s3-external-1.amazonaws.com")) {
|
|
14
|
-
return next({ ...args });
|
|
15
|
-
}
|
|
16
|
-
if (!isCustomEndpoint) {
|
|
17
|
-
const [, suffix] = (0, middleware_bucket_endpoint_1.getSuffixForArnEndpoint)(request.hostname);
|
|
18
|
-
hostname = `s3-object-lambda.${region}.${suffix}`;
|
|
19
|
-
}
|
|
20
|
-
if (!disableHostPrefix && input.RequestRoute) {
|
|
21
|
-
hostname = `${input.RequestRoute}.${hostname}`;
|
|
22
|
-
}
|
|
23
|
-
request.hostname = hostname;
|
|
24
|
-
context["signing_service"] = "s3-object-lambda";
|
|
25
|
-
if (config.runtime === "node" && !request.headers["content-length"]) {
|
|
26
|
-
request.headers["transfer-encoding"] = "chunked";
|
|
27
|
-
}
|
|
28
|
-
return next({ ...args });
|
|
29
|
-
};
|
|
30
|
-
exports.writeGetObjectResponseEndpointMiddleware = writeGetObjectResponseEndpointMiddleware;
|
|
31
|
-
exports.writeGetObjectResponseEndpointMiddlewareOptions = {
|
|
32
|
-
relation: "after",
|
|
33
|
-
toMiddleware: "contentLengthMiddleware",
|
|
34
|
-
tags: ["WRITE_GET_OBJECT_RESPONSE", "S3", "ENDPOINT"],
|
|
35
|
-
name: "writeGetObjectResponseEndpointMiddleware",
|
|
36
|
-
override: true,
|
|
37
|
-
};
|
|
38
|
-
const getWriteGetObjectResponseEndpointPlugin = (config) => ({
|
|
39
|
-
applyToStack: (clientStack) => {
|
|
40
|
-
clientStack.addRelativeTo((0, exports.writeGetObjectResponseEndpointMiddleware)(config), exports.writeGetObjectResponseEndpointMiddlewareOptions);
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
exports.getWriteGetObjectResponseEndpointPlugin = getWriteGetObjectResponseEndpointPlugin;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getSuffixForArnEndpoint } from "@aws-sdk/middleware-bucket-endpoint";
|
|
2
|
-
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
-
export const writeGetObjectResponseEndpointMiddleware = (config) => (next, context) => async (args) => {
|
|
4
|
-
const { region: regionProvider, isCustomEndpoint, disableHostPrefix } = config;
|
|
5
|
-
const region = await regionProvider();
|
|
6
|
-
const { request, input } = args;
|
|
7
|
-
if (!HttpRequest.isInstance(request))
|
|
8
|
-
return next({ ...args });
|
|
9
|
-
let hostname = request.hostname;
|
|
10
|
-
if (hostname.endsWith("s3.amazonaws.com") || hostname.endsWith("s3-external-1.amazonaws.com")) {
|
|
11
|
-
return next({ ...args });
|
|
12
|
-
}
|
|
13
|
-
if (!isCustomEndpoint) {
|
|
14
|
-
const [, suffix] = getSuffixForArnEndpoint(request.hostname);
|
|
15
|
-
hostname = `s3-object-lambda.${region}.${suffix}`;
|
|
16
|
-
}
|
|
17
|
-
if (!disableHostPrefix && input.RequestRoute) {
|
|
18
|
-
hostname = `${input.RequestRoute}.${hostname}`;
|
|
19
|
-
}
|
|
20
|
-
request.hostname = hostname;
|
|
21
|
-
context["signing_service"] = "s3-object-lambda";
|
|
22
|
-
if (config.runtime === "node" && !request.headers["content-length"]) {
|
|
23
|
-
request.headers["transfer-encoding"] = "chunked";
|
|
24
|
-
}
|
|
25
|
-
return next({ ...args });
|
|
26
|
-
};
|
|
27
|
-
export const writeGetObjectResponseEndpointMiddlewareOptions = {
|
|
28
|
-
relation: "after",
|
|
29
|
-
toMiddleware: "contentLengthMiddleware",
|
|
30
|
-
tags: ["WRITE_GET_OBJECT_RESPONSE", "S3", "ENDPOINT"],
|
|
31
|
-
name: "writeGetObjectResponseEndpointMiddleware",
|
|
32
|
-
override: true,
|
|
33
|
-
};
|
|
34
|
-
export const getWriteGetObjectResponseEndpointPlugin = (config) => ({
|
|
35
|
-
applyToStack: (clientStack) => {
|
|
36
|
-
clientStack.addRelativeTo(writeGetObjectResponseEndpointMiddleware(config), writeGetObjectResponseEndpointMiddlewareOptions);
|
|
37
|
-
},
|
|
38
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BuildMiddleware,
|
|
3
|
-
Pluggable,
|
|
4
|
-
Provider,
|
|
5
|
-
RelativeMiddlewareOptions,
|
|
6
|
-
} from "@aws-sdk/types";
|
|
7
|
-
declare type PreviouslyResolved = {
|
|
8
|
-
region: Provider<string>;
|
|
9
|
-
isCustomEndpoint?: boolean;
|
|
10
|
-
disableHostPrefix: boolean;
|
|
11
|
-
runtime: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const writeGetObjectResponseEndpointMiddleware: (
|
|
14
|
-
config: PreviouslyResolved
|
|
15
|
-
) => BuildMiddleware<any, any>;
|
|
16
|
-
export declare const writeGetObjectResponseEndpointMiddlewareOptions: RelativeMiddlewareOptions;
|
|
17
|
-
export declare const getWriteGetObjectResponseEndpointPlugin: (
|
|
18
|
-
config: PreviouslyResolved
|
|
19
|
-
) => Pluggable<any, any>;
|
|
20
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BuildMiddleware, Pluggable, Provider, RelativeMiddlewareOptions } from "@aws-sdk/types";
|
|
2
|
-
declare type PreviouslyResolved = {
|
|
3
|
-
region: Provider<string>;
|
|
4
|
-
isCustomEndpoint?: boolean;
|
|
5
|
-
disableHostPrefix: boolean;
|
|
6
|
-
runtime: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare const writeGetObjectResponseEndpointMiddleware: (config: PreviouslyResolved) => BuildMiddleware<any, any>;
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare const writeGetObjectResponseEndpointMiddlewareOptions: RelativeMiddlewareOptions;
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare const getWriteGetObjectResponseEndpointPlugin: (config: PreviouslyResolved) => Pluggable<any, any>;
|
|
20
|
-
export {};
|