@aws-sdk/middleware-flexible-checksums 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 +18 -21
- package/dist-es/resolveFlexibleChecksumsConfig.js +8 -6
- package/dist-types/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.d.ts +9 -0
- package/dist-types/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.d.ts +9 -0
- package/dist-types/configuration.d.ts +3 -0
- package/dist-types/constants.d.ts +16 -0
- package/dist-types/crc64-nvme-crt-container.d.ts +1 -1
- package/dist-types/flexibleChecksumsInputMiddleware.d.ts +3 -0
- package/dist-types/flexibleChecksumsMiddleware.d.ts +6 -1
- package/dist-types/flexibleChecksumsResponseMiddleware.d.ts +3 -0
- package/dist-types/getFlexibleChecksumsPlugin.d.ts +6 -0
- package/dist-types/resolveFlexibleChecksumsConfig.d.ts +9 -0
- package/package.json +10 -9
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
|
|
23
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
24
|
CONFIG_REQUEST_CHECKSUM_CALCULATION: () => CONFIG_REQUEST_CHECKSUM_CALCULATION,
|
|
25
25
|
CONFIG_RESPONSE_CHECKSUM_VALIDATION: () => CONFIG_RESPONSE_CHECKSUM_VALIDATION,
|
|
26
26
|
ChecksumAlgorithm: () => ChecksumAlgorithm,
|
|
@@ -40,7 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
getFlexibleChecksumsPlugin: () => getFlexibleChecksumsPlugin,
|
|
41
41
|
resolveFlexibleChecksumsConfig: () => resolveFlexibleChecksumsConfig
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(index_exports);
|
|
44
44
|
|
|
45
45
|
// src/constants.ts
|
|
46
46
|
var RequestChecksumCalculation = {
|
|
@@ -95,8 +95,7 @@ var DEFAULT_CHECKSUM_ALGORITHM = "CRC32" /* CRC32 */;
|
|
|
95
95
|
|
|
96
96
|
// src/stringUnionSelector.ts
|
|
97
97
|
var stringUnionSelector = /* @__PURE__ */ __name((obj, key, union, type) => {
|
|
98
|
-
if (!(key in obj))
|
|
99
|
-
return void 0;
|
|
98
|
+
if (!(key in obj)) return void 0;
|
|
100
99
|
const value = obj[key].toUpperCase();
|
|
101
100
|
if (!Object.values(union).includes(value)) {
|
|
102
101
|
throw new TypeError(`Cannot load ${type} '${key}'. Expected one of ${Object.values(union)}, got '${obj[key]}'.`);
|
|
@@ -108,8 +107,8 @@ var stringUnionSelector = /* @__PURE__ */ __name((obj, key, union, type) => {
|
|
|
108
107
|
var ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
|
|
109
108
|
var CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
|
|
110
109
|
var NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = {
|
|
111
|
-
environmentVariableSelector: (env) => stringUnionSelector(env, ENV_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, "env" /* ENV */),
|
|
112
|
-
configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, "shared config entry" /* CONFIG */),
|
|
110
|
+
environmentVariableSelector: /* @__PURE__ */ __name((env) => stringUnionSelector(env, ENV_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, "env" /* ENV */), "environmentVariableSelector"),
|
|
111
|
+
configFileSelector: /* @__PURE__ */ __name((profile) => stringUnionSelector(profile, CONFIG_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, "shared config entry" /* CONFIG */), "configFileSelector"),
|
|
113
112
|
default: DEFAULT_REQUEST_CHECKSUM_CALCULATION
|
|
114
113
|
};
|
|
115
114
|
|
|
@@ -117,8 +116,8 @@ var NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = {
|
|
|
117
116
|
var ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
|
|
118
117
|
var CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
|
|
119
118
|
var NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = {
|
|
120
|
-
environmentVariableSelector: (env) => stringUnionSelector(env, ENV_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, "env" /* ENV */),
|
|
121
|
-
configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, "shared config entry" /* CONFIG */),
|
|
119
|
+
environmentVariableSelector: /* @__PURE__ */ __name((env) => stringUnionSelector(env, ENV_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, "env" /* ENV */), "environmentVariableSelector"),
|
|
120
|
+
configFileSelector: /* @__PURE__ */ __name((profile) => stringUnionSelector(profile, CONFIG_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, "shared config entry" /* CONFIG */), "configFileSelector"),
|
|
122
121
|
default: DEFAULT_RESPONSE_CHECKSUM_VALIDATION
|
|
123
122
|
};
|
|
124
123
|
|
|
@@ -478,7 +477,7 @@ var flexibleChecksumsResponseMiddleware = /* @__PURE__ */ __name((config, middle
|
|
|
478
477
|
|
|
479
478
|
// src/getFlexibleChecksumsPlugin.ts
|
|
480
479
|
var getFlexibleChecksumsPlugin = /* @__PURE__ */ __name((config, middlewareConfig) => ({
|
|
481
|
-
applyToStack: (clientStack) => {
|
|
480
|
+
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
482
481
|
clientStack.add(flexibleChecksumsMiddleware(config, middlewareConfig), flexibleChecksumsMiddlewareOptions);
|
|
483
482
|
clientStack.addRelativeTo(
|
|
484
483
|
flexibleChecksumsInputMiddleware(config, middlewareConfig),
|
|
@@ -488,21 +487,19 @@ var getFlexibleChecksumsPlugin = /* @__PURE__ */ __name((config, middlewareConfi
|
|
|
488
487
|
flexibleChecksumsResponseMiddleware(config, middlewareConfig),
|
|
489
488
|
flexibleChecksumsResponseMiddlewareOptions
|
|
490
489
|
);
|
|
491
|
-
}
|
|
490
|
+
}, "applyToStack")
|
|
492
491
|
}), "getFlexibleChecksumsPlugin");
|
|
493
492
|
|
|
494
493
|
// src/resolveFlexibleChecksumsConfig.ts
|
|
495
494
|
var import_util_middleware = require("@smithy/util-middleware");
|
|
496
|
-
var resolveFlexibleChecksumsConfig = /* @__PURE__ */ __name((input) =>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
requestStreamBufferSize: Number(input.requestStreamBufferSize ?? 0)
|
|
505
|
-
}), "resolveFlexibleChecksumsConfig");
|
|
495
|
+
var resolveFlexibleChecksumsConfig = /* @__PURE__ */ __name((input) => {
|
|
496
|
+
const { requestChecksumCalculation, responseChecksumValidation, requestStreamBufferSize } = input;
|
|
497
|
+
return Object.assign(input, {
|
|
498
|
+
requestChecksumCalculation: (0, import_util_middleware.normalizeProvider)(requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION),
|
|
499
|
+
responseChecksumValidation: (0, import_util_middleware.normalizeProvider)(responseChecksumValidation ?? DEFAULT_RESPONSE_CHECKSUM_VALIDATION),
|
|
500
|
+
requestStreamBufferSize: Number(requestStreamBufferSize ?? 0)
|
|
501
|
+
});
|
|
502
|
+
}, "resolveFlexibleChecksumsConfig");
|
|
506
503
|
// Annotate the CommonJS export names for ESM import in node:
|
|
507
504
|
|
|
508
505
|
0 && (module.exports = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { normalizeProvider } from "@smithy/util-middleware";
|
|
2
2
|
import { DEFAULT_REQUEST_CHECKSUM_CALCULATION, DEFAULT_RESPONSE_CHECKSUM_VALIDATION, } from "./constants";
|
|
3
|
-
export const resolveFlexibleChecksumsConfig = (input) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export const resolveFlexibleChecksumsConfig = (input) => {
|
|
4
|
+
const { requestChecksumCalculation, responseChecksumValidation, requestStreamBufferSize } = input;
|
|
5
|
+
return Object.assign(input, {
|
|
6
|
+
requestChecksumCalculation: normalizeProvider(requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION),
|
|
7
|
+
responseChecksumValidation: normalizeProvider(responseChecksumValidation ?? DEFAULT_RESPONSE_CHECKSUM_VALIDATION),
|
|
8
|
+
requestStreamBufferSize: Number(requestStreamBufferSize ?? 0),
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { LoadedConfigSelectors } from "@smithy/node-config-provider";
|
|
2
2
|
import { RequestChecksumCalculation } from "./constants";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export declare const ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
4
10
|
export declare const CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
5
14
|
export declare const NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS: LoadedConfigSelectors<RequestChecksumCalculation>;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { LoadedConfigSelectors } from "@smithy/node-config-provider";
|
|
2
2
|
import { ResponseChecksumValidation } from "./constants";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export declare const ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
4
10
|
export declare const CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
5
14
|
export declare const NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS: LoadedConfigSelectors<ResponseChecksumValidation>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BodyLengthCalculator, ChecksumConstructor, Encoder, GetAwsChunkedEncodingStream, HashConstructor, Provider, StreamCollector, StreamHasher } from "@smithy/types";
|
|
2
2
|
import { RequestChecksumCalculation, ResponseChecksumValidation } from "./constants";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export interface PreviouslyResolved {
|
|
4
7
|
/**
|
|
5
8
|
* The function that will be used to convert binary data to a base64-encoded string.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Determines when a checksum will be calculated for request payloads.
|
|
3
|
+
* @public
|
|
3
4
|
*/
|
|
4
5
|
export declare const RequestChecksumCalculation: {
|
|
5
6
|
/**
|
|
@@ -17,10 +18,17 @@ export declare const RequestChecksumCalculation: {
|
|
|
17
18
|
*/
|
|
18
19
|
readonly WHEN_REQUIRED: "WHEN_REQUIRED";
|
|
19
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
20
24
|
export type RequestChecksumCalculation = (typeof RequestChecksumCalculation)[keyof typeof RequestChecksumCalculation];
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
21
28
|
export declare const DEFAULT_REQUEST_CHECKSUM_CALCULATION: "WHEN_SUPPORTED";
|
|
22
29
|
/**
|
|
23
30
|
* Determines when checksum validation will be performed on response payloads.
|
|
31
|
+
* @public
|
|
24
32
|
*/
|
|
25
33
|
export declare const ResponseChecksumValidation: {
|
|
26
34
|
/**
|
|
@@ -38,10 +46,17 @@ export declare const ResponseChecksumValidation: {
|
|
|
38
46
|
*/
|
|
39
47
|
readonly WHEN_REQUIRED: "WHEN_REQUIRED";
|
|
40
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
41
52
|
export type ResponseChecksumValidation = (typeof ResponseChecksumValidation)[keyof typeof ResponseChecksumValidation];
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
42
56
|
export declare const DEFAULT_RESPONSE_CHECKSUM_VALIDATION: "WHEN_SUPPORTED";
|
|
43
57
|
/**
|
|
44
58
|
* Checksum Algorithms supported by the SDK.
|
|
59
|
+
* @public
|
|
45
60
|
*/
|
|
46
61
|
export declare enum ChecksumAlgorithm {
|
|
47
62
|
/**
|
|
@@ -56,6 +71,7 @@ export declare enum ChecksumAlgorithm {
|
|
|
56
71
|
}
|
|
57
72
|
/**
|
|
58
73
|
* Location when the checksum is stored in the request body.
|
|
74
|
+
* @internal
|
|
59
75
|
*/
|
|
60
76
|
export declare enum ChecksumLocation {
|
|
61
77
|
HEADER = "header",
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { RelativeMiddlewareOptions, SerializeMiddleware } from "@smithy/types";
|
|
2
2
|
import { PreviouslyResolved } from "./configuration";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export interface FlexibleChecksumsInputMiddlewareConfig {
|
|
4
7
|
/**
|
|
5
8
|
* Defines a top-level operation input member used to opt-in to best-effort validation
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BuildHandlerOptions, BuildMiddleware } from "@smithy/types";
|
|
2
2
|
import { PreviouslyResolved } from "./configuration";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export interface FlexibleChecksumsRequestMiddlewareConfig {
|
|
4
|
-
/**
|
|
5
7
|
/**
|
|
6
8
|
* Indicates an operation requires a checksum in its HTTP request.
|
|
7
9
|
*/
|
|
@@ -21,6 +23,9 @@ export interface FlexibleChecksumsRequestMiddlewareConfig {
|
|
|
21
23
|
httpHeader?: string;
|
|
22
24
|
};
|
|
23
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
24
29
|
export declare const flexibleChecksumsMiddlewareOptions: BuildHandlerOptions;
|
|
25
30
|
/**
|
|
26
31
|
* @internal
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DeserializeMiddleware, RelativeMiddlewareOptions } from "@smithy/types";
|
|
2
2
|
import { PreviouslyResolved } from "./configuration";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export interface FlexibleChecksumsResponseMiddlewareConfig {
|
|
4
7
|
/**
|
|
5
8
|
* Defines a top-level operation input member used to opt-in to best-effort validation
|
|
@@ -3,6 +3,12 @@ import { PreviouslyResolved } from "./configuration";
|
|
|
3
3
|
import { FlexibleChecksumsInputMiddlewareConfig } from "./flexibleChecksumsInputMiddleware";
|
|
4
4
|
import { FlexibleChecksumsRequestMiddlewareConfig } from "./flexibleChecksumsMiddleware";
|
|
5
5
|
import { FlexibleChecksumsResponseMiddlewareConfig } from "./flexibleChecksumsResponseMiddleware";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
6
9
|
export interface FlexibleChecksumsMiddlewareConfig extends FlexibleChecksumsRequestMiddlewareConfig, FlexibleChecksumsInputMiddlewareConfig, FlexibleChecksumsResponseMiddlewareConfig {
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
8
14
|
export declare const getFlexibleChecksumsPlugin: (config: PreviouslyResolved, middlewareConfig: FlexibleChecksumsMiddlewareConfig) => Pluggable<any, any>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Provider } from "@smithy/types";
|
|
2
2
|
import { RequestChecksumCalculation, ResponseChecksumValidation } from "./constants";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export interface FlexibleChecksumsInputConfig {
|
|
4
7
|
/**
|
|
5
8
|
* Determines when a checksum will be calculated for request payloads.
|
|
@@ -26,9 +29,15 @@ export interface FlexibleChecksumsInputConfig {
|
|
|
26
29
|
*/
|
|
27
30
|
requestStreamBufferSize?: number | false;
|
|
28
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
29
35
|
export interface FlexibleChecksumsResolvedConfig {
|
|
30
36
|
requestChecksumCalculation: Provider<RequestChecksumCalculation>;
|
|
31
37
|
responseChecksumValidation: Provider<ResponseChecksumValidation>;
|
|
32
38
|
requestStreamBufferSize: number;
|
|
33
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
34
43
|
export declare const resolveFlexibleChecksumsConfig: <T>(input: T & FlexibleChecksumsInputConfig) => T & FlexibleChecksumsResolvedConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-flexible-checksums",
|
|
3
|
-
"version": "3.
|
|
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-flexible-checksums",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"build:types": "tsc -p tsconfig.types.json",
|
|
10
10
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
11
11
|
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
|
|
12
|
+
"extract:docs": "api-extractor run --local",
|
|
12
13
|
"test": "yarn g:vitest run",
|
|
13
14
|
"test:watch": "yarn g:vitest watch",
|
|
14
15
|
"test:integration": "yarn g:vitest run -c vitest.config.integ.ts",
|
|
@@ -35,19 +36,19 @@
|
|
|
35
36
|
"@aws-crypto/crc32": "5.2.0",
|
|
36
37
|
"@aws-crypto/crc32c": "5.2.0",
|
|
37
38
|
"@aws-crypto/util": "5.2.0",
|
|
38
|
-
"@aws-sdk/core": "3.
|
|
39
|
-
"@aws-sdk/types": "3.
|
|
39
|
+
"@aws-sdk/core": "3.775.0",
|
|
40
|
+
"@aws-sdk/types": "3.775.0",
|
|
40
41
|
"@smithy/is-array-buffer": "^4.0.0",
|
|
41
|
-
"@smithy/node-config-provider": "^4.0.
|
|
42
|
-
"@smithy/protocol-http": "^5.0
|
|
43
|
-
"@smithy/types": "^4.
|
|
44
|
-
"@smithy/util-middleware": "^4.0.
|
|
45
|
-
"@smithy/util-stream": "^4.
|
|
42
|
+
"@smithy/node-config-provider": "^4.0.2",
|
|
43
|
+
"@smithy/protocol-http": "^5.1.0",
|
|
44
|
+
"@smithy/types": "^4.2.0",
|
|
45
|
+
"@smithy/util-middleware": "^4.0.2",
|
|
46
|
+
"@smithy/util-stream": "^4.2.0",
|
|
46
47
|
"@smithy/util-utf8": "^4.0.0",
|
|
47
48
|
"tslib": "^2.6.2"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
|
-
"@smithy/node-http-handler": "^4.0.
|
|
51
|
+
"@smithy/node-http-handler": "^4.0.4",
|
|
51
52
|
"concurrently": "7.0.0",
|
|
52
53
|
"downlevel-dts": "0.10.1",
|
|
53
54
|
"rimraf": "3.0.2",
|