@aws-sdk/middleware-sdk-glacier 3.183.0 → 3.186.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.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-glacier
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/middleware-sdk-glacier
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
export function accountIdDefaultMiddleware() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
input
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
var _this = this;
|
|
4
|
+
return function (next) {
|
|
5
|
+
return function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
6
|
+
var input;
|
|
7
|
+
return __generator(this, function (_a) {
|
|
8
|
+
input = args.input;
|
|
9
|
+
if (input.accountId === undefined) {
|
|
10
|
+
input.accountId = "-";
|
|
11
|
+
}
|
|
12
|
+
return [2, next(__assign(__assign({}, args), { input: input }))];
|
|
13
|
+
});
|
|
14
|
+
}); };
|
|
8
15
|
};
|
|
9
16
|
}
|
|
10
|
-
export
|
|
17
|
+
export var accountIdDefaultMiddlewareOptions = {
|
|
11
18
|
step: "initialize",
|
|
12
19
|
tags: ["ACCOUNT_ID_DEFAULT"],
|
|
13
20
|
name: "accountIdDefaultMiddleware",
|
|
@@ -1,33 +1,49 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator, __read, __values } from "tslib";
|
|
1
2
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
export function addChecksumHeadersMiddleware(options) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
var _this = this;
|
|
5
|
+
return function (next) {
|
|
6
|
+
return function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
7
|
+
var request, headers, body, _a, contentHash, treeHash, _b, _c, _d, headerName, hash;
|
|
8
|
+
var e_1, _e, _f;
|
|
9
|
+
return __generator(this, function (_g) {
|
|
10
|
+
switch (_g.label) {
|
|
11
|
+
case 0:
|
|
12
|
+
request = args.request;
|
|
13
|
+
if (!HttpRequest.isInstance(request)) return [3, 2];
|
|
14
|
+
headers = request.headers;
|
|
15
|
+
body = request.body;
|
|
16
|
+
if (!body) return [3, 2];
|
|
17
|
+
return [4, options.bodyChecksumGenerator(request, options)];
|
|
18
|
+
case 1:
|
|
19
|
+
_a = __read.apply(void 0, [_g.sent(), 2]), contentHash = _a[0], treeHash = _a[1];
|
|
20
|
+
try {
|
|
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 }))];
|
|
20
41
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return next({
|
|
25
|
-
...args,
|
|
26
|
-
request,
|
|
27
|
-
});
|
|
42
|
+
});
|
|
43
|
+
}); };
|
|
28
44
|
};
|
|
29
45
|
}
|
|
30
|
-
export
|
|
46
|
+
export var addChecksumHeadersMiddlewareOptions = {
|
|
31
47
|
step: "build",
|
|
32
48
|
tags: ["SET_CHECKSUM_HEADERS"],
|
|
33
49
|
name: "addChecksumHeadersMiddleware",
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
export function addGlacierApiVersionMiddleware(options) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
request
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
var _this = this;
|
|
5
|
+
return function (next) {
|
|
6
|
+
return function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
7
|
+
var request;
|
|
8
|
+
return __generator(this, function (_a) {
|
|
9
|
+
request = args.request;
|
|
10
|
+
if (HttpRequest.isInstance(request)) {
|
|
11
|
+
request.headers["x-amz-glacier-version"] = options.apiVersion;
|
|
12
|
+
}
|
|
13
|
+
return [2, next(__assign(__assign({}, args), { request: request }))];
|
|
14
|
+
});
|
|
15
|
+
}); };
|
|
12
16
|
};
|
|
13
17
|
}
|
|
14
|
-
export
|
|
18
|
+
export var addGlacierApiVersionMiddlewareOptions = {
|
|
15
19
|
step: "build",
|
|
16
20
|
tags: ["SET_GLACIER_VERSION"],
|
|
17
21
|
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: (clientStack)
|
|
4
|
+
export var getGlacierPlugin = function (config) { return ({
|
|
5
|
+
applyToStack: function (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.186.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.186.0",
|
|
24
|
+
"@aws-sdk/types": "3.186.0",
|
|
25
25
|
"tslib": "^2.3.1"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|