@aws-sdk/types 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.
@@ -1,3 +1,4 @@
1
+ import { SourceData } from "./crypto";
1
2
  /**
2
3
  * An object that provides a checksum of data provided in chunks to `update`.
3
4
  * The checksum may be performed incrementally as chunks are received or all
@@ -48,3 +49,11 @@ export interface Checksum {
48
49
  */
49
50
  update(chunk: Uint8Array): void;
50
51
  }
52
+ /**
53
+ * A constructor for a Checksum that may be used to calculate an HMAC. Implementing
54
+ * classes should not directly hold the provided key in memory beyond the
55
+ * lexical scope of the constructor.
56
+ */
57
+ export interface ChecksumConstructor {
58
+ new (secret?: SourceData): Checksum;
59
+ }
@@ -26,6 +26,8 @@ export interface Hash {
26
26
  * A constructor for a hash that may be used to calculate an HMAC. Implementing
27
27
  * classes should not directly hold the provided key in memory beyond the
28
28
  * lexical scope of the constructor.
29
+ *
30
+ * @deprecated use {@link ChecksumConstructor}
29
31
  */
30
32
  export interface HashConstructor {
31
33
  new (secret?: SourceData): Hash;
@@ -1,9 +1,10 @@
1
+ import { ChecksumConstructor } from "./checksum";
1
2
  import { HashConstructor, StreamHasher } from "./crypto";
2
3
  import { BodyLengthCalculator, Encoder } from "./util";
3
4
  export interface GetAwsChunkedEncodingStreamOptions {
4
5
  base64Encoder?: Encoder;
5
6
  bodyLengthChecker: BodyLengthCalculator;
6
- checksumAlgorithmFn?: HashConstructor;
7
+ checksumAlgorithmFn?: ChecksumConstructor | HashConstructor;
7
8
  checksumLocationName?: string;
8
9
  streamHasher?: StreamHasher;
9
10
  }
@@ -1,3 +1,4 @@
1
+ import { SourceData } from "./crypto";
1
2
  export interface Checksum {
2
3
  digestLength?: number;
3
4
  copy?(): Checksum;
@@ -6,3 +7,6 @@ export interface Checksum {
6
7
  reset(): void;
7
8
  update(chunk: Uint8Array): void;
8
9
  }
10
+ export interface ChecksumConstructor {
11
+ new (secret?: SourceData): Checksum;
12
+ }
@@ -1,9 +1,10 @@
1
+ import { ChecksumConstructor } from "./checksum";
1
2
  import { HashConstructor, StreamHasher } from "./crypto";
2
3
  import { BodyLengthCalculator, Encoder } from "./util";
3
4
  export interface GetAwsChunkedEncodingStreamOptions {
4
5
  base64Encoder?: Encoder;
5
6
  bodyLengthChecker: BodyLengthCalculator;
6
- checksumAlgorithmFn?: HashConstructor;
7
+ checksumAlgorithmFn?: ChecksumConstructor | HashConstructor;
7
8
  checksumLocationName?: string;
8
9
  streamHasher?: StreamHasher;
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/types",
3
- "version": "3.226.0",
3
+ "version": "3.254.0",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "module": "./dist-es/index.js",
6
6
  "types": "./dist-types/index.d.ts",