@aws-sdk/middleware-flexible-checksums 3.974.25 → 3.974.26

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.
Files changed (79) hide show
  1. package/dist-cjs/index.js +21 -447
  2. package/dist-es/index.js +1 -6
  3. package/dist-types/index.d.ts +2 -6
  4. package/package.json +3 -34
  5. package/dist-cjs/getCrc32ChecksumAlgorithmFunction.browser.js +0 -6
  6. package/dist-cjs/getCrc32ChecksumAlgorithmFunction.js +0 -26
  7. package/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js +0 -9
  8. package/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js +0 -9
  9. package/dist-es/configuration.js +0 -1
  10. package/dist-es/constants.js +0 -25
  11. package/dist-es/flexibleChecksumsInputMiddleware.js +0 -37
  12. package/dist-es/flexibleChecksumsMiddleware.js +0 -123
  13. package/dist-es/flexibleChecksumsResponseMiddleware.js +0 -48
  14. package/dist-es/getChecksum.js +0 -2
  15. package/dist-es/getChecksumAlgorithmForRequest.js +0 -13
  16. package/dist-es/getChecksumAlgorithmListForResponse.js +0 -15
  17. package/dist-es/getChecksumLocationName.js +0 -2
  18. package/dist-es/getCrc32ChecksumAlgorithmFunction.browser.js +0 -2
  19. package/dist-es/getCrc32ChecksumAlgorithmFunction.js +0 -21
  20. package/dist-es/getFlexibleChecksumsPlugin.js +0 -10
  21. package/dist-es/hasHeader.js +0 -9
  22. package/dist-es/hasHeaderWithPrefix.js +0 -9
  23. package/dist-es/isChecksumWithPartNumber.js +0 -13
  24. package/dist-es/isStreaming.js +0 -2
  25. package/dist-es/resolveFlexibleChecksumsConfig.js +0 -11
  26. package/dist-es/selectChecksumAlgorithmFunction.js +0 -32
  27. package/dist-es/stringHasher.js +0 -6
  28. package/dist-es/stringUnionSelector.js +0 -14
  29. package/dist-es/types.js +0 -15
  30. package/dist-es/validateChecksumFromResponse.js +0 -45
  31. package/dist-types/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.d.ts +0 -14
  32. package/dist-types/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.d.ts +0 -14
  33. package/dist-types/configuration.d.ts +0 -58
  34. package/dist-types/constants.d.ts +0 -83
  35. package/dist-types/flexibleChecksumsInputMiddleware.d.ts +0 -22
  36. package/dist-types/flexibleChecksumsMiddleware.d.ts +0 -33
  37. package/dist-types/flexibleChecksumsResponseMiddleware.d.ts +0 -27
  38. package/dist-types/getChecksum.d.ts +0 -6
  39. package/dist-types/getChecksumAlgorithmForRequest.d.ts +0 -22
  40. package/dist-types/getChecksumAlgorithmListForResponse.d.ts +0 -6
  41. package/dist-types/getChecksumLocationName.d.ts +0 -5
  42. package/dist-types/getCrc32ChecksumAlgorithmFunction.browser.d.ts +0 -2
  43. package/dist-types/getCrc32ChecksumAlgorithmFunction.d.ts +0 -10
  44. package/dist-types/getFlexibleChecksumsPlugin.d.ts +0 -14
  45. package/dist-types/hasHeader.d.ts +0 -6
  46. package/dist-types/hasHeaderWithPrefix.d.ts +0 -6
  47. package/dist-types/isChecksumWithPartNumber.d.ts +0 -1
  48. package/dist-types/isStreaming.d.ts +0 -4
  49. package/dist-types/resolveFlexibleChecksumsConfig.d.ts +0 -57
  50. package/dist-types/selectChecksumAlgorithmFunction.d.ts +0 -7
  51. package/dist-types/stringHasher.d.ts +0 -5
  52. package/dist-types/stringUnionSelector.d.ts +0 -12
  53. package/dist-types/ts3.4/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.d.ts +0 -7
  54. package/dist-types/ts3.4/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.d.ts +0 -7
  55. package/dist-types/ts3.4/configuration.d.ts +0 -29
  56. package/dist-types/ts3.4/constants.d.ts +0 -27
  57. package/dist-types/ts3.4/flexibleChecksumsInputMiddleware.d.ts +0 -10
  58. package/dist-types/ts3.4/flexibleChecksumsMiddleware.d.ts +0 -14
  59. package/dist-types/ts3.4/flexibleChecksumsResponseMiddleware.d.ts +0 -14
  60. package/dist-types/ts3.4/getChecksum.d.ts +0 -9
  61. package/dist-types/ts3.4/getChecksumAlgorithmForRequest.d.ts +0 -15
  62. package/dist-types/ts3.4/getChecksumAlgorithmListForResponse.d.ts +0 -4
  63. package/dist-types/ts3.4/getChecksumLocationName.d.ts +0 -4
  64. package/dist-types/ts3.4/getCrc32ChecksumAlgorithmFunction.browser.d.ts +0 -2
  65. package/dist-types/ts3.4/getCrc32ChecksumAlgorithmFunction.d.ts +0 -12
  66. package/dist-types/ts3.4/getFlexibleChecksumsPlugin.d.ts +0 -13
  67. package/dist-types/ts3.4/hasHeader.d.ts +0 -2
  68. package/dist-types/ts3.4/hasHeaderWithPrefix.d.ts +0 -5
  69. package/dist-types/ts3.4/index.d.ts +0 -6
  70. package/dist-types/ts3.4/isChecksumWithPartNumber.d.ts +0 -1
  71. package/dist-types/ts3.4/isStreaming.d.ts +0 -1
  72. package/dist-types/ts3.4/resolveFlexibleChecksumsConfig.d.ts +0 -32
  73. package/dist-types/ts3.4/selectChecksumAlgorithmFunction.d.ts +0 -7
  74. package/dist-types/ts3.4/stringHasher.d.ts +0 -5
  75. package/dist-types/ts3.4/stringUnionSelector.d.ts +0 -10
  76. package/dist-types/ts3.4/types.d.ts +0 -3
  77. package/dist-types/ts3.4/validateChecksumFromResponse.d.ts +0 -12
  78. package/dist-types/types.d.ts +0 -9
  79. package/dist-types/validateChecksumFromResponse.d.ts +0 -13
@@ -1,33 +0,0 @@
1
- import type { BuildHandlerOptions, BuildMiddleware } from "@smithy/types";
2
- import type { PreviouslyResolved } from "./configuration";
3
- /**
4
- * @internal
5
- */
6
- export interface FlexibleChecksumsRequestMiddlewareConfig {
7
- /**
8
- * Indicates an operation requires a checksum in its HTTP request.
9
- */
10
- requestChecksumRequired: boolean;
11
- /**
12
- * Member that is used to configure request checksum behavior.
13
- */
14
- requestAlgorithmMember?: {
15
- /**
16
- * Defines a top-level operation input member that is used to configure request checksum behavior.
17
- */
18
- name: string;
19
- /**
20
- * The {@link httpHeader} value, if present.
21
- * {@link https://smithy.io/2.0/spec/http-bindings.html#httpheader-trait httpHeader}
22
- */
23
- httpHeader?: string;
24
- };
25
- }
26
- /**
27
- * @internal
28
- */
29
- export declare const flexibleChecksumsMiddlewareOptions: BuildHandlerOptions;
30
- /**
31
- * @internal
32
- */
33
- export declare const flexibleChecksumsMiddleware: (config: PreviouslyResolved, middlewareConfig: FlexibleChecksumsRequestMiddlewareConfig) => BuildMiddleware<any, any>;
@@ -1,27 +0,0 @@
1
- import type { DeserializeMiddleware, RelativeMiddlewareOptions } from "@smithy/types";
2
- import type { PreviouslyResolved } from "./configuration";
3
- /**
4
- * @internal
5
- */
6
- export interface FlexibleChecksumsResponseMiddlewareConfig {
7
- /**
8
- * Defines a top-level operation input member used to opt-in to best-effort validation
9
- * of a checksum returned in the HTTP response of the operation.
10
- */
11
- requestValidationModeMember?: string;
12
- /**
13
- * Defines the checksum algorithms clients SHOULD look for when validating checksums
14
- * returned in the HTTP response.
15
- */
16
- responseAlgorithms?: string[];
17
- }
18
- /**
19
- * @internal
20
- */
21
- export declare const flexibleChecksumsResponseMiddlewareOptions: RelativeMiddlewareOptions;
22
- /**
23
- * @internal
24
- *
25
- * The validation counterpart to the flexibleChecksumsMiddleware.
26
- */
27
- export declare const flexibleChecksumsResponseMiddleware: (config: PreviouslyResolved, middlewareConfig: FlexibleChecksumsResponseMiddlewareConfig) => DeserializeMiddleware<any, any>;
@@ -1,6 +0,0 @@
1
- import type { ChecksumConstructor, Encoder, HashConstructor } from "@smithy/types";
2
- export interface GetChecksumDigestOptions {
3
- checksumAlgorithmFn: ChecksumConstructor | HashConstructor;
4
- base64Encoder: Encoder;
5
- }
6
- export declare const getChecksum: (body: unknown, { checksumAlgorithmFn, base64Encoder }: GetChecksumDigestOptions) => Promise<string>;
@@ -1,22 +0,0 @@
1
- import type { ChecksumAlgorithm } from "./constants";
2
- import { RequestChecksumCalculation } from "./constants";
3
- export interface GetChecksumAlgorithmForRequestOptions {
4
- /**
5
- * Indicates an operation requires a checksum in its HTTP request.
6
- */
7
- requestChecksumRequired: boolean;
8
- /**
9
- * Defines a top-level operation input member that is used to configure request checksum behavior.
10
- */
11
- requestAlgorithmMember?: string;
12
- /**
13
- * Determines when a checksum will be calculated for request payloads
14
- */
15
- requestChecksumCalculation: RequestChecksumCalculation;
16
- }
17
- /**
18
- * Returns the checksum algorithm to use for the request, along with
19
- * the priority array of location to use to populate checksum and names
20
- * to be used as a key at the location.
21
- */
22
- export declare const getChecksumAlgorithmForRequest: (input: any, { requestChecksumRequired, requestAlgorithmMember, requestChecksumCalculation }: GetChecksumAlgorithmForRequestOptions) => ChecksumAlgorithm | string | undefined;
@@ -1,6 +0,0 @@
1
- import type { ChecksumAlgorithm } from "./constants";
2
- /**
3
- * Returns the priority array of algorithm to use to verify checksum and names
4
- * to be used as a key in the response header.
5
- */
6
- export declare const getChecksumAlgorithmListForResponse: (responseAlgorithms?: string[]) => ChecksumAlgorithm[];
@@ -1,5 +0,0 @@
1
- import { ChecksumAlgorithm } from "./constants";
2
- /**
3
- * Returns location (header/trailer) name to use to populate checksum in.
4
- */
5
- export declare const getChecksumLocationName: (algorithm: ChecksumAlgorithm | string) => string;
@@ -1,2 +0,0 @@
1
- import { AwsCrc32 } from "@aws-crypto/crc32";
2
- export declare const getCrc32ChecksumAlgorithmFunction: () => typeof AwsCrc32;
@@ -1,10 +0,0 @@
1
- import { AwsCrc32 } from "@aws-crypto/crc32";
2
- import type { Checksum } from "@smithy/types";
3
- declare class NodeCrc32 implements Checksum {
4
- private checksum;
5
- update(data: Uint8Array): void;
6
- digest(): Promise<Uint8Array>;
7
- reset(): void;
8
- }
9
- export declare const getCrc32ChecksumAlgorithmFunction: () => typeof NodeCrc32 | typeof AwsCrc32;
10
- export {};
@@ -1,14 +0,0 @@
1
- import type { Pluggable } from "@smithy/types";
2
- import type { PreviouslyResolved } from "./configuration";
3
- import type { FlexibleChecksumsInputMiddlewareConfig } from "./flexibleChecksumsInputMiddleware";
4
- import type { FlexibleChecksumsRequestMiddlewareConfig } from "./flexibleChecksumsMiddleware";
5
- import type { FlexibleChecksumsResponseMiddlewareConfig } from "./flexibleChecksumsResponseMiddleware";
6
- /**
7
- * @internal
8
- */
9
- export interface FlexibleChecksumsMiddlewareConfig extends FlexibleChecksumsRequestMiddlewareConfig, FlexibleChecksumsInputMiddlewareConfig, FlexibleChecksumsResponseMiddlewareConfig {
10
- }
11
- /**
12
- * @internal
13
- */
14
- export declare const getFlexibleChecksumsPlugin: (config: PreviouslyResolved, middlewareConfig: FlexibleChecksumsMiddlewareConfig) => Pluggable<any, any>;
@@ -1,6 +0,0 @@
1
- import type { HeaderBag } from "@smithy/types";
2
- /**
3
- * Returns true if header is present in headers.
4
- * Comparisons are case-insensitive.
5
- */
6
- export declare const hasHeader: (header: string, headers: HeaderBag) => boolean;
@@ -1,6 +0,0 @@
1
- import type { HeaderBag } from "@smithy/types";
2
- /**
3
- * Returns true if header with headerPrefix is present in headers.
4
- * Comparisons are case-insensitive.
5
- */
6
- export declare const hasHeaderWithPrefix: (headerPrefix: string, headers: HeaderBag) => boolean;
@@ -1 +0,0 @@
1
- export declare const isChecksumWithPartNumber: (checksum: string) => boolean;
@@ -1,4 +0,0 @@
1
- /**
2
- * Returns true if the given value is a streaming response.
3
- */
4
- export declare const isStreaming: (body: unknown) => boolean;
@@ -1,57 +0,0 @@
1
- import type { ChecksumConstructor, Provider } from "@smithy/types";
2
- import type { RequestChecksumCalculation, ResponseChecksumValidation } from "./constants";
3
- /**
4
- * @public
5
- */
6
- export interface FlexibleChecksumsInputConfig {
7
- /**
8
- * Determines when a checksum will be calculated for request payloads.
9
- */
10
- requestChecksumCalculation?: RequestChecksumCalculation | Provider<RequestChecksumCalculation>;
11
- /**
12
- * Determines when checksum validation will be performed on response payloads.
13
- */
14
- responseChecksumValidation?: ResponseChecksumValidation | Provider<ResponseChecksumValidation>;
15
- /**
16
- * Default 0 (off).
17
- *
18
- * When set to a value greater than or equal to 8192, sets the minimum number
19
- * of bytes to buffer into a chunk when processing input streams
20
- * with chunked encoding (that is, when request checksums are enabled).
21
- * A minimum of 8kb = 8 * 1024 is required, and 64kb or higher is recommended.
22
- *
23
- * See https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html.
24
- *
25
- * This has a slight performance penalty because it must wrap and buffer
26
- * your input stream.
27
- * You do not need to set this value if your stream already flows chunks
28
- * of 8kb or greater.
29
- */
30
- requestStreamBufferSize?: number | false;
31
- /**
32
- * Optional implementations of checksum algorithms adhering to the
33
- * Checksum interface.
34
- */
35
- checksumAlgorithms?: {
36
- CRC32?: ChecksumConstructor;
37
- CRC32C?: ChecksumConstructor;
38
- CRC64NVME?: ChecksumConstructor;
39
- SHA1?: ChecksumConstructor;
40
- SHA256?: ChecksumConstructor;
41
- } & {
42
- [algorithmId: string]: ChecksumConstructor;
43
- };
44
- }
45
- /**
46
- * @internal
47
- */
48
- export interface FlexibleChecksumsResolvedConfig {
49
- requestChecksumCalculation: Provider<RequestChecksumCalculation>;
50
- responseChecksumValidation: Provider<ResponseChecksumValidation>;
51
- requestStreamBufferSize: number;
52
- checksumAlgorithms?: FlexibleChecksumsInputConfig["checksumAlgorithms"];
53
- }
54
- /**
55
- * @internal
56
- */
57
- export declare const resolveFlexibleChecksumsConfig: <T>(input: T & FlexibleChecksumsInputConfig) => T & FlexibleChecksumsResolvedConfig;
@@ -1,7 +0,0 @@
1
- import type { ChecksumConstructor, HashConstructor } from "@smithy/types";
2
- import type { PreviouslyResolved } from "./configuration";
3
- import { ChecksumAlgorithm } from "./constants";
4
- /**
5
- * Returns the function that will compute the checksum for the given {@link ChecksumAlgorithm}.
6
- */
7
- export declare const selectChecksumAlgorithmFunction: (checksumAlgorithm: ChecksumAlgorithm | string, config: PreviouslyResolved) => ChecksumConstructor | HashConstructor;
@@ -1,5 +0,0 @@
1
- import type { ChecksumConstructor, HashConstructor } from "@smithy/types";
2
- /**
3
- * A function that, given a hash constructor and a string, calculates the hash of the string.
4
- */
5
- export declare const stringHasher: (checksumAlgorithmFn: ChecksumConstructor | HashConstructor, body: any) => Promise<Uint8Array>;
@@ -1,12 +0,0 @@
1
- export declare enum SelectorType {
2
- ENV = "env",
3
- CONFIG = "shared config entry"
4
- }
5
- /**
6
- * Returns undefined, if obj[key] is not defined.
7
- * Returns string value, if the string is defined in obj[key] and it's uppercase matches union value.
8
- * Throws error for all other cases.
9
- *
10
- * @internal
11
- */
12
- export declare const stringUnionSelector: <U extends object, K extends keyof U>(obj: Record<string, string | undefined>, key: string, union: U, type: SelectorType) => U[K] | undefined;
@@ -1,7 +0,0 @@
1
- import { LoadedConfigSelectors } from "@smithy/core/config";
2
- import { RequestChecksumCalculation } from "./constants";
3
- export declare const ENV_REQUEST_CHECKSUM_CALCULATION =
4
- "AWS_REQUEST_CHECKSUM_CALCULATION";
5
- export declare const CONFIG_REQUEST_CHECKSUM_CALCULATION =
6
- "request_checksum_calculation";
7
- export declare const NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS: LoadedConfigSelectors<RequestChecksumCalculation>;
@@ -1,7 +0,0 @@
1
- import { LoadedConfigSelectors } from "@smithy/core/config";
2
- import { ResponseChecksumValidation } from "./constants";
3
- export declare const ENV_RESPONSE_CHECKSUM_VALIDATION =
4
- "AWS_RESPONSE_CHECKSUM_VALIDATION";
5
- export declare const CONFIG_RESPONSE_CHECKSUM_VALIDATION =
6
- "response_checksum_validation";
7
- export declare const NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS: LoadedConfigSelectors<ResponseChecksumValidation>;
@@ -1,29 +0,0 @@
1
- import {
2
- BodyLengthCalculator,
3
- ChecksumConstructor,
4
- Encoder,
5
- GetAwsChunkedEncodingStream,
6
- HashConstructor,
7
- Provider,
8
- StreamCollector,
9
- StreamHasher,
10
- } from "@smithy/types";
11
- import {
12
- RequestChecksumCalculation,
13
- ResponseChecksumValidation,
14
- } from "./constants";
15
- import { FlexibleChecksumsInputConfig } from "./resolveFlexibleChecksumsConfig";
16
- export interface PreviouslyResolved {
17
- base64Encoder: Encoder;
18
- bodyLengthChecker: BodyLengthCalculator;
19
- getAwsChunkedEncodingStream: GetAwsChunkedEncodingStream;
20
- md5: ChecksumConstructor | HashConstructor;
21
- requestChecksumCalculation: Provider<RequestChecksumCalculation>;
22
- responseChecksumValidation: Provider<ResponseChecksumValidation>;
23
- sha1: ChecksumConstructor | HashConstructor;
24
- sha256: ChecksumConstructor | HashConstructor;
25
- streamHasher: StreamHasher<any>;
26
- streamCollector: StreamCollector;
27
- requestStreamBufferSize: number;
28
- checksumAlgorithms?: FlexibleChecksumsInputConfig["checksumAlgorithms"];
29
- }
@@ -1,27 +0,0 @@
1
- export declare const RequestChecksumCalculation: {
2
- readonly WHEN_SUPPORTED: "WHEN_SUPPORTED";
3
- readonly WHEN_REQUIRED: "WHEN_REQUIRED";
4
- };
5
- export type RequestChecksumCalculation =
6
- (typeof RequestChecksumCalculation)[keyof typeof RequestChecksumCalculation];
7
- export declare const DEFAULT_REQUEST_CHECKSUM_CALCULATION: "WHEN_SUPPORTED";
8
- export declare const ResponseChecksumValidation: {
9
- readonly WHEN_SUPPORTED: "WHEN_SUPPORTED";
10
- readonly WHEN_REQUIRED: "WHEN_REQUIRED";
11
- };
12
- export type ResponseChecksumValidation =
13
- (typeof ResponseChecksumValidation)[keyof typeof ResponseChecksumValidation];
14
- export declare const DEFAULT_RESPONSE_CHECKSUM_VALIDATION: "WHEN_SUPPORTED";
15
- export declare enum ChecksumAlgorithm {
16
- MD5 = "MD5",
17
- CRC32 = "CRC32",
18
- CRC32C = "CRC32C",
19
- CRC64NVME = "CRC64NVME",
20
- SHA1 = "SHA1",
21
- SHA256 = "SHA256",
22
- }
23
- export declare enum ChecksumLocation {
24
- HEADER = "header",
25
- TRAILER = "trailer",
26
- }
27
- export declare const DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.CRC32;
@@ -1,10 +0,0 @@
1
- import { RelativeMiddlewareOptions, SerializeMiddleware } from "@smithy/types";
2
- import { PreviouslyResolved } from "./configuration";
3
- export interface FlexibleChecksumsInputMiddlewareConfig {
4
- requestValidationModeMember?: string;
5
- }
6
- export declare const flexibleChecksumsInputMiddlewareOptions: RelativeMiddlewareOptions;
7
- export declare const flexibleChecksumsInputMiddleware: (
8
- config: PreviouslyResolved,
9
- middlewareConfig: FlexibleChecksumsInputMiddlewareConfig
10
- ) => SerializeMiddleware<any, any>;
@@ -1,14 +0,0 @@
1
- import { BuildHandlerOptions, BuildMiddleware } from "@smithy/types";
2
- import { PreviouslyResolved } from "./configuration";
3
- export interface FlexibleChecksumsRequestMiddlewareConfig {
4
- requestChecksumRequired: boolean;
5
- requestAlgorithmMember?: {
6
- name: string;
7
- httpHeader?: string;
8
- };
9
- }
10
- export declare const flexibleChecksumsMiddlewareOptions: BuildHandlerOptions;
11
- export declare const flexibleChecksumsMiddleware: (
12
- config: PreviouslyResolved,
13
- middlewareConfig: FlexibleChecksumsRequestMiddlewareConfig
14
- ) => BuildMiddleware<any, any>;
@@ -1,14 +0,0 @@
1
- import {
2
- DeserializeMiddleware,
3
- RelativeMiddlewareOptions,
4
- } from "@smithy/types";
5
- import { PreviouslyResolved } from "./configuration";
6
- export interface FlexibleChecksumsResponseMiddlewareConfig {
7
- requestValidationModeMember?: string;
8
- responseAlgorithms?: string[];
9
- }
10
- export declare const flexibleChecksumsResponseMiddlewareOptions: RelativeMiddlewareOptions;
11
- export declare const flexibleChecksumsResponseMiddleware: (
12
- config: PreviouslyResolved,
13
- middlewareConfig: FlexibleChecksumsResponseMiddlewareConfig
14
- ) => DeserializeMiddleware<any, any>;
@@ -1,9 +0,0 @@
1
- import { ChecksumConstructor, Encoder, HashConstructor } from "@smithy/types";
2
- export interface GetChecksumDigestOptions {
3
- checksumAlgorithmFn: ChecksumConstructor | HashConstructor;
4
- base64Encoder: Encoder;
5
- }
6
- export declare const getChecksum: (
7
- body: unknown,
8
- { checksumAlgorithmFn, base64Encoder }: GetChecksumDigestOptions
9
- ) => Promise<string>;
@@ -1,15 +0,0 @@
1
- import { ChecksumAlgorithm } from "./constants";
2
- import { RequestChecksumCalculation } from "./constants";
3
- export interface GetChecksumAlgorithmForRequestOptions {
4
- requestChecksumRequired: boolean;
5
- requestAlgorithmMember?: string;
6
- requestChecksumCalculation: RequestChecksumCalculation;
7
- }
8
- export declare const getChecksumAlgorithmForRequest: (
9
- input: any,
10
- {
11
- requestChecksumRequired,
12
- requestAlgorithmMember,
13
- requestChecksumCalculation,
14
- }: GetChecksumAlgorithmForRequestOptions
15
- ) => ChecksumAlgorithm | string | undefined;
@@ -1,4 +0,0 @@
1
- import { ChecksumAlgorithm } from "./constants";
2
- export declare const getChecksumAlgorithmListForResponse: (
3
- responseAlgorithms?: string[]
4
- ) => ChecksumAlgorithm[];
@@ -1,4 +0,0 @@
1
- import { ChecksumAlgorithm } from "./constants";
2
- export declare const getChecksumLocationName: (
3
- algorithm: ChecksumAlgorithm | string
4
- ) => string;
@@ -1,2 +0,0 @@
1
- import { AwsCrc32 } from "@aws-crypto/crc32";
2
- export declare const getCrc32ChecksumAlgorithmFunction: () => typeof AwsCrc32;
@@ -1,12 +0,0 @@
1
- import { AwsCrc32 } from "@aws-crypto/crc32";
2
- import { Checksum } from "@smithy/types";
3
- declare class NodeCrc32 implements Checksum {
4
- private checksum;
5
- update(data: Uint8Array): void;
6
- digest(): Promise<Uint8Array>;
7
- reset(): void;
8
- }
9
- export declare const getCrc32ChecksumAlgorithmFunction: () =>
10
- | typeof NodeCrc32
11
- | typeof AwsCrc32;
12
- export {};
@@ -1,13 +0,0 @@
1
- import { Pluggable } from "@smithy/types";
2
- import { PreviouslyResolved } from "./configuration";
3
- import { FlexibleChecksumsInputMiddlewareConfig } from "./flexibleChecksumsInputMiddleware";
4
- import { FlexibleChecksumsRequestMiddlewareConfig } from "./flexibleChecksumsMiddleware";
5
- import { FlexibleChecksumsResponseMiddlewareConfig } from "./flexibleChecksumsResponseMiddleware";
6
- export interface FlexibleChecksumsMiddlewareConfig
7
- extends FlexibleChecksumsRequestMiddlewareConfig,
8
- FlexibleChecksumsInputMiddlewareConfig,
9
- FlexibleChecksumsResponseMiddlewareConfig {}
10
- export declare const getFlexibleChecksumsPlugin: (
11
- config: PreviouslyResolved,
12
- middlewareConfig: FlexibleChecksumsMiddlewareConfig
13
- ) => Pluggable<any, any>;
@@ -1,2 +0,0 @@
1
- import { HeaderBag } from "@smithy/types";
2
- export declare const hasHeader: (header: string, headers: HeaderBag) => boolean;
@@ -1,5 +0,0 @@
1
- import { HeaderBag } from "@smithy/types";
2
- export declare const hasHeaderWithPrefix: (
3
- headerPrefix: string,
4
- headers: HeaderBag
5
- ) => boolean;
@@ -1,6 +0,0 @@
1
- export * from "./NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS";
2
- export * from "./NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS";
3
- export * from "./constants";
4
- export * from "./flexibleChecksumsMiddleware";
5
- export * from "./getFlexibleChecksumsPlugin";
6
- export * from "./resolveFlexibleChecksumsConfig";
@@ -1 +0,0 @@
1
- export declare const isChecksumWithPartNumber: (checksum: string) => boolean;
@@ -1 +0,0 @@
1
- export declare const isStreaming: (body: unknown) => boolean;
@@ -1,32 +0,0 @@
1
- import { ChecksumConstructor, Provider } from "@smithy/types";
2
- import {
3
- RequestChecksumCalculation,
4
- ResponseChecksumValidation,
5
- } from "./constants";
6
- export interface FlexibleChecksumsInputConfig {
7
- requestChecksumCalculation?:
8
- | RequestChecksumCalculation
9
- | Provider<RequestChecksumCalculation>;
10
- responseChecksumValidation?:
11
- | ResponseChecksumValidation
12
- | Provider<ResponseChecksumValidation>;
13
- requestStreamBufferSize?: number | false;
14
- checksumAlgorithms?: {
15
- CRC32?: ChecksumConstructor;
16
- CRC32C?: ChecksumConstructor;
17
- CRC64NVME?: ChecksumConstructor;
18
- SHA1?: ChecksumConstructor;
19
- SHA256?: ChecksumConstructor;
20
- } & {
21
- [algorithmId: string]: ChecksumConstructor;
22
- };
23
- }
24
- export interface FlexibleChecksumsResolvedConfig {
25
- requestChecksumCalculation: Provider<RequestChecksumCalculation>;
26
- responseChecksumValidation: Provider<ResponseChecksumValidation>;
27
- requestStreamBufferSize: number;
28
- checksumAlgorithms?: FlexibleChecksumsInputConfig["checksumAlgorithms"];
29
- }
30
- export declare const resolveFlexibleChecksumsConfig: <T>(
31
- input: T & FlexibleChecksumsInputConfig
32
- ) => T & FlexibleChecksumsResolvedConfig;
@@ -1,7 +0,0 @@
1
- import { ChecksumConstructor, HashConstructor } from "@smithy/types";
2
- import { PreviouslyResolved } from "./configuration";
3
- import { ChecksumAlgorithm } from "./constants";
4
- export declare const selectChecksumAlgorithmFunction: (
5
- checksumAlgorithm: ChecksumAlgorithm | string,
6
- config: PreviouslyResolved
7
- ) => ChecksumConstructor | HashConstructor;
@@ -1,5 +0,0 @@
1
- import { ChecksumConstructor, HashConstructor } from "@smithy/types";
2
- export declare const stringHasher: (
3
- checksumAlgorithmFn: ChecksumConstructor | HashConstructor,
4
- body: any
5
- ) => Promise<Uint8Array>;
@@ -1,10 +0,0 @@
1
- export declare enum SelectorType {
2
- ENV = "env",
3
- CONFIG = "shared config entry",
4
- }
5
- export declare const stringUnionSelector: <U extends object, K extends keyof U>(
6
- obj: Record<string, string | undefined>,
7
- key: string,
8
- union: U,
9
- type: SelectorType
10
- ) => U[K] | undefined;
@@ -1,3 +0,0 @@
1
- import { ChecksumAlgorithm } from "./constants";
2
- export declare const CLIENT_SUPPORTED_ALGORITHMS: ChecksumAlgorithm[];
3
- export declare const PRIORITY_ORDER_ALGORITHMS: ChecksumAlgorithm[];
@@ -1,12 +0,0 @@
1
- import { HttpResponse } from "@smithy/core/protocols";
2
- import { Logger } from "@smithy/types";
3
- import { PreviouslyResolved } from "./configuration";
4
- export interface ValidateChecksumFromResponseOptions {
5
- config: PreviouslyResolved;
6
- responseAlgorithms?: string[];
7
- logger?: Logger;
8
- }
9
- export declare const validateChecksumFromResponse: (
10
- response: HttpResponse,
11
- { config, responseAlgorithms, logger }: ValidateChecksumFromResponseOptions
12
- ) => Promise<void>;
@@ -1,9 +0,0 @@
1
- import { ChecksumAlgorithm } from "./constants";
2
- /**
3
- * List of algorithms supported by client.
4
- */
5
- export declare const CLIENT_SUPPORTED_ALGORITHMS: ChecksumAlgorithm[];
6
- /**
7
- * Priority order for validating checksum algorithm. A faster algorithm has higher priority.
8
- */
9
- export declare const PRIORITY_ORDER_ALGORITHMS: ChecksumAlgorithm[];
@@ -1,13 +0,0 @@
1
- import type { HttpResponse } from "@smithy/core/protocols";
2
- import type { Logger } from "@smithy/types";
3
- import type { PreviouslyResolved } from "./configuration";
4
- export interface ValidateChecksumFromResponseOptions {
5
- config: PreviouslyResolved;
6
- /**
7
- * Defines the checksum algorithms clients SHOULD look for when validating checksums
8
- * returned in the HTTP response.
9
- */
10
- responseAlgorithms?: string[];
11
- logger?: Logger;
12
- }
13
- export declare const validateChecksumFromResponse: (response: HttpResponse, { config, responseAlgorithms, logger }: ValidateChecksumFromResponseOptions) => Promise<void>;