@aws-sdk/body-checksum-browser 3.226.0 → 3.257.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 +2 -1
- package/dist-es/index.js +2 -1
- package/dist-types/index.d.ts +2 -2
- package/dist-types/ts3.4/index.d.ts +7 -2
- package/package.json +6 -5
package/dist-cjs/index.js
CHANGED
|
@@ -4,13 +4,14 @@ exports.bodyChecksumGenerator = void 0;
|
|
|
4
4
|
const chunked_blob_reader_1 = require("@aws-sdk/chunked-blob-reader");
|
|
5
5
|
const sha256_tree_hash_1 = require("@aws-sdk/sha256-tree-hash");
|
|
6
6
|
const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding");
|
|
7
|
+
const util_utf8_1 = require("@aws-sdk/util-utf8");
|
|
7
8
|
const MiB = 1024 * 1024;
|
|
8
9
|
async function bodyChecksumGenerator(request, options) {
|
|
9
10
|
const contentHash = new options.sha256();
|
|
10
11
|
const treeHash = new sha256_tree_hash_1.TreeHash(options.sha256, options.utf8Decoder);
|
|
11
12
|
const { body } = request;
|
|
12
13
|
if (typeof body === "string") {
|
|
13
|
-
contentHash.update(body);
|
|
14
|
+
contentHash.update((0, util_utf8_1.toUint8Array)(body));
|
|
14
15
|
treeHash.update(body);
|
|
15
16
|
}
|
|
16
17
|
else {
|
package/dist-es/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { blobReader } from "@aws-sdk/chunked-blob-reader";
|
|
2
2
|
import { TreeHash } from "@aws-sdk/sha256-tree-hash";
|
|
3
3
|
import { toHex } from "@aws-sdk/util-hex-encoding";
|
|
4
|
+
import { toUint8Array } from "@aws-sdk/util-utf8";
|
|
4
5
|
const MiB = 1024 * 1024;
|
|
5
6
|
export async function bodyChecksumGenerator(request, options) {
|
|
6
7
|
const contentHash = new options.sha256();
|
|
7
8
|
const treeHash = new TreeHash(options.sha256, options.utf8Decoder);
|
|
8
9
|
const { body } = request;
|
|
9
10
|
if (typeof body === "string") {
|
|
10
|
-
contentHash.update(body);
|
|
11
|
+
contentHash.update(toUint8Array(body));
|
|
11
12
|
treeHash.update(body);
|
|
12
13
|
}
|
|
13
14
|
else {
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Decoder, HashConstructor, HttpRequest } from "@aws-sdk/types";
|
|
1
|
+
import { ChecksumConstructor, Decoder, HashConstructor, HttpRequest } from "@aws-sdk/types";
|
|
2
2
|
export declare function bodyChecksumGenerator(request: HttpRequest, options: {
|
|
3
|
-
sha256: HashConstructor;
|
|
3
|
+
sha256: ChecksumConstructor | HashConstructor;
|
|
4
4
|
utf8Decoder: Decoder;
|
|
5
5
|
}): Promise<[string, string]>;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ChecksumConstructor,
|
|
3
|
+
Decoder,
|
|
4
|
+
HashConstructor,
|
|
5
|
+
HttpRequest,
|
|
6
|
+
} from "@aws-sdk/types";
|
|
2
7
|
export declare function bodyChecksumGenerator(
|
|
3
8
|
request: HttpRequest,
|
|
4
9
|
options: {
|
|
5
|
-
sha256: HashConstructor;
|
|
10
|
+
sha256: ChecksumConstructor | HashConstructor;
|
|
6
11
|
utf8Decoder: Decoder;
|
|
7
12
|
}
|
|
8
13
|
): Promise<[string, string]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/body-checksum-browser",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.257.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",
|
|
@@ -21,14 +21,15 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@aws-sdk/chunked-blob-reader": "3.188.0",
|
|
24
|
-
"@aws-sdk/protocol-http": "3.
|
|
25
|
-
"@aws-sdk/sha256-tree-hash": "3.
|
|
26
|
-
"@aws-sdk/types": "3.
|
|
24
|
+
"@aws-sdk/protocol-http": "3.257.0",
|
|
25
|
+
"@aws-sdk/sha256-tree-hash": "3.257.0",
|
|
26
|
+
"@aws-sdk/types": "3.257.0",
|
|
27
27
|
"@aws-sdk/util-hex-encoding": "3.201.0",
|
|
28
|
+
"@aws-sdk/util-utf8": "3.254.0",
|
|
28
29
|
"tslib": "^2.3.1"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@aws-crypto/sha256-js": "
|
|
32
|
+
"@aws-crypto/sha256-js": "3.0.0",
|
|
32
33
|
"@aws-sdk/util-utf8-browser": "3.188.0",
|
|
33
34
|
"@tsconfig/recommended": "1.0.1",
|
|
34
35
|
"concurrently": "7.0.0",
|