@aws-sdk/middleware-sdk-glacier 3.178.0 → 3.183.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-glacier
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.178.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.177.0...v3.178.0) (2022-09-23)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/middleware-sdk-glacier
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
export function accountIdDefaultMiddleware() {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (input.accountId === undefined) {
|
|
10
|
-
input.accountId = "-";
|
|
11
|
-
}
|
|
12
|
-
return [2, next(__assign(__assign({}, args), { input: input }))];
|
|
13
|
-
});
|
|
14
|
-
}); };
|
|
2
|
+
return (next) => async (args) => {
|
|
3
|
+
const { input } = args;
|
|
4
|
+
if (input.accountId === undefined) {
|
|
5
|
+
input.accountId = "-";
|
|
6
|
+
}
|
|
7
|
+
return next({ ...args, input });
|
|
15
8
|
};
|
|
16
9
|
}
|
|
17
|
-
export
|
|
10
|
+
export const accountIdDefaultMiddlewareOptions = {
|
|
18
11
|
step: "initialize",
|
|
19
12
|
tags: ["ACCOUNT_ID_DEFAULT"],
|
|
20
13
|
name: "accountIdDefaultMiddleware",
|
|
@@ -1,49 +1,33 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read, __values } from "tslib";
|
|
2
1
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
export function addChecksumHeadersMiddleware(options) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (_b = __values([
|
|
22
|
-
["x-amz-content-sha256", contentHash],
|
|
23
|
-
["x-amz-sha256-tree-hash", treeHash],
|
|
24
|
-
]), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
25
|
-
_d = __read(_c.value, 2), headerName = _d[0], hash = _d[1];
|
|
26
|
-
if (!(headerName in headers) && hash) {
|
|
27
|
-
headers = __assign(__assign({}, headers), (_f = {}, _f[headerName] = hash, _f));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
32
|
-
finally {
|
|
33
|
-
try {
|
|
34
|
-
if (_c && !_c.done && (_e = _b.return)) _e.call(_b);
|
|
35
|
-
}
|
|
36
|
-
finally { if (e_1) throw e_1.error; }
|
|
37
|
-
}
|
|
38
|
-
request.headers = headers;
|
|
39
|
-
_g.label = 2;
|
|
40
|
-
case 2: return [2, next(__assign(__assign({}, args), { request: request }))];
|
|
3
|
+
return (next) => async (args) => {
|
|
4
|
+
const request = args.request;
|
|
5
|
+
if (HttpRequest.isInstance(request)) {
|
|
6
|
+
let headers = request.headers;
|
|
7
|
+
const body = request.body;
|
|
8
|
+
if (body) {
|
|
9
|
+
const [contentHash, treeHash] = await options.bodyChecksumGenerator(request, options);
|
|
10
|
+
for (const [headerName, hash] of [
|
|
11
|
+
["x-amz-content-sha256", contentHash],
|
|
12
|
+
["x-amz-sha256-tree-hash", treeHash],
|
|
13
|
+
]) {
|
|
14
|
+
if (!(headerName in headers) && hash) {
|
|
15
|
+
headers = {
|
|
16
|
+
...headers,
|
|
17
|
+
[headerName]: hash,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
41
20
|
}
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
request.headers = headers;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return next({
|
|
25
|
+
...args,
|
|
26
|
+
request,
|
|
27
|
+
});
|
|
44
28
|
};
|
|
45
29
|
}
|
|
46
|
-
export
|
|
30
|
+
export const addChecksumHeadersMiddlewareOptions = {
|
|
47
31
|
step: "build",
|
|
48
32
|
tags: ["SET_CHECKSUM_HEADERS"],
|
|
49
33
|
name: "addChecksumHeadersMiddleware",
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
export function addGlacierApiVersionMiddleware(options) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return [2, next(__assign(__assign({}, args), { request: request }))];
|
|
14
|
-
});
|
|
15
|
-
}); };
|
|
3
|
+
return (next) => async (args) => {
|
|
4
|
+
const request = args.request;
|
|
5
|
+
if (HttpRequest.isInstance(request)) {
|
|
6
|
+
request.headers["x-amz-glacier-version"] = options.apiVersion;
|
|
7
|
+
}
|
|
8
|
+
return next({
|
|
9
|
+
...args,
|
|
10
|
+
request,
|
|
11
|
+
});
|
|
16
12
|
};
|
|
17
13
|
}
|
|
18
|
-
export
|
|
14
|
+
export const addGlacierApiVersionMiddlewareOptions = {
|
|
19
15
|
step: "build",
|
|
20
16
|
tags: ["SET_GLACIER_VERSION"],
|
|
21
17
|
name: "addGlacierApiVersionMiddleware",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { accountIdDefaultMiddleware, accountIdDefaultMiddlewareOptions } from "./account-id-default";
|
|
2
2
|
import { addChecksumHeadersMiddleware, addChecksumHeadersMiddlewareOptions } from "./add-checksum-headers";
|
|
3
3
|
import { addGlacierApiVersionMiddleware, addGlacierApiVersionMiddlewareOptions } from "./add-glacier-api-version";
|
|
4
|
-
export
|
|
5
|
-
applyToStack:
|
|
4
|
+
export const getGlacierPlugin = (config) => ({
|
|
5
|
+
applyToStack: (clientStack) => {
|
|
6
6
|
clientStack.add(accountIdDefaultMiddleware(), accountIdDefaultMiddlewareOptions);
|
|
7
7
|
clientStack.add(addGlacierApiVersionMiddleware(config), addGlacierApiVersionMiddlewareOptions);
|
|
8
8
|
clientStack.add(addChecksumHeadersMiddleware(config), addChecksumHeadersMiddlewareOptions);
|
|
9
9
|
},
|
|
10
|
-
});
|
|
10
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-glacier",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.183.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,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/protocol-http": "3.
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
23
|
+
"@aws-sdk/protocol-http": "3.183.0",
|
|
24
|
+
"@aws-sdk/types": "3.183.0",
|
|
25
25
|
"tslib": "^2.3.1"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|