@aws-sdk/middleware-sdk-glacier 3.489.0 → 3.495.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,19 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.accountIdDefaultMiddlewareOptions = exports.accountIdDefaultMiddleware = void 0;
4
- function accountIdDefaultMiddleware() {
5
- return (next) => async (args) => {
6
- const { input } = args;
7
- if (input.accountId === undefined) {
8
- input.accountId = "-";
9
- }
10
- return next({ ...args, input });
11
- };
12
- }
13
- exports.accountIdDefaultMiddleware = accountIdDefaultMiddleware;
14
- exports.accountIdDefaultMiddlewareOptions = {
15
- step: "initialize",
16
- tags: ["ACCOUNT_ID_DEFAULT"],
17
- name: "accountIdDefaultMiddleware",
18
- override: true,
19
- };
1
+ module.exports = require("./index.js");
@@ -1,39 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addChecksumHeadersMiddlewareOptions = exports.addChecksumHeadersMiddleware = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- function addChecksumHeadersMiddleware(options) {
6
- return (next) => async (args) => {
7
- const request = args.request;
8
- if (protocol_http_1.HttpRequest.isInstance(request)) {
9
- let headers = request.headers;
10
- const body = request.body;
11
- if (body) {
12
- const [contentHash, treeHash] = await options.bodyChecksumGenerator(request, options);
13
- for (const [headerName, hash] of [
14
- ["x-amz-content-sha256", contentHash],
15
- ["x-amz-sha256-tree-hash", treeHash],
16
- ]) {
17
- if (!(headerName in headers) && hash) {
18
- headers = {
19
- ...headers,
20
- [headerName]: hash,
21
- };
22
- }
23
- }
24
- request.headers = headers;
25
- }
26
- }
27
- return next({
28
- ...args,
29
- request,
30
- });
31
- };
32
- }
33
- exports.addChecksumHeadersMiddleware = addChecksumHeadersMiddleware;
34
- exports.addChecksumHeadersMiddlewareOptions = {
35
- step: "build",
36
- tags: ["SET_CHECKSUM_HEADERS"],
37
- name: "addChecksumHeadersMiddleware",
38
- override: true,
39
- };
1
+ module.exports = require("./index.js");
@@ -1,23 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addGlacierApiVersionMiddlewareOptions = exports.addGlacierApiVersionMiddleware = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- function addGlacierApiVersionMiddleware(options) {
6
- return (next) => async (args) => {
7
- const request = args.request;
8
- if (protocol_http_1.HttpRequest.isInstance(request)) {
9
- request.headers["x-amz-glacier-version"] = options.apiVersion;
10
- }
11
- return next({
12
- ...args,
13
- request,
14
- });
15
- };
16
- }
17
- exports.addGlacierApiVersionMiddleware = addGlacierApiVersionMiddleware;
18
- exports.addGlacierApiVersionMiddlewareOptions = {
19
- step: "build",
20
- tags: ["SET_GLACIER_VERSION"],
21
- name: "addGlacierApiVersionMiddleware",
22
- override: true,
23
- };
1
+ module.exports = require("./index.js");
@@ -1,14 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGlacierPlugin = void 0;
4
- const account_id_default_1 = require("./account-id-default");
5
- const add_checksum_headers_1 = require("./add-checksum-headers");
6
- const add_glacier_api_version_1 = require("./add-glacier-api-version");
7
- const getGlacierPlugin = (config) => ({
8
- applyToStack: (clientStack) => {
9
- clientStack.add((0, account_id_default_1.accountIdDefaultMiddleware)(), account_id_default_1.accountIdDefaultMiddlewareOptions);
10
- clientStack.add((0, add_glacier_api_version_1.addGlacierApiVersionMiddleware)(config), add_glacier_api_version_1.addGlacierApiVersionMiddlewareOptions);
11
- clientStack.add((0, add_checksum_headers_1.addChecksumHeadersMiddleware)(config), add_checksum_headers_1.addChecksumHeadersMiddlewareOptions);
12
- },
13
- });
14
- exports.getGlacierPlugin = getGlacierPlugin;
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,7 +1,128 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./account-id-default"), exports);
5
- tslib_1.__exportStar(require("./add-checksum-headers"), exports);
6
- tslib_1.__exportStar(require("./add-glacier-api-version"), exports);
7
- tslib_1.__exportStar(require("./configurations"), exports);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ accountIdDefaultMiddleware: () => accountIdDefaultMiddleware,
24
+ accountIdDefaultMiddlewareOptions: () => accountIdDefaultMiddlewareOptions,
25
+ addChecksumHeadersMiddleware: () => addChecksumHeadersMiddleware,
26
+ addChecksumHeadersMiddlewareOptions: () => addChecksumHeadersMiddlewareOptions,
27
+ addGlacierApiVersionMiddleware: () => addGlacierApiVersionMiddleware,
28
+ addGlacierApiVersionMiddlewareOptions: () => addGlacierApiVersionMiddlewareOptions,
29
+ getGlacierPlugin: () => getGlacierPlugin
30
+ });
31
+ module.exports = __toCommonJS(src_exports);
32
+
33
+ // src/account-id-default.ts
34
+ function accountIdDefaultMiddleware() {
35
+ return (next) => async (args) => {
36
+ const { input } = args;
37
+ if (input.accountId === void 0) {
38
+ input.accountId = "-";
39
+ }
40
+ return next({ ...args, input });
41
+ };
42
+ }
43
+ __name(accountIdDefaultMiddleware, "accountIdDefaultMiddleware");
44
+ var accountIdDefaultMiddlewareOptions = {
45
+ step: "initialize",
46
+ tags: ["ACCOUNT_ID_DEFAULT"],
47
+ name: "accountIdDefaultMiddleware",
48
+ override: true
49
+ };
50
+
51
+ // src/add-checksum-headers.ts
52
+ var import_protocol_http = require("@smithy/protocol-http");
53
+ function addChecksumHeadersMiddleware(options) {
54
+ return (next) => async (args) => {
55
+ const request = args.request;
56
+ if (import_protocol_http.HttpRequest.isInstance(request)) {
57
+ let headers = request.headers;
58
+ const body = request.body;
59
+ if (body) {
60
+ const [contentHash, treeHash] = await options.bodyChecksumGenerator(request, options);
61
+ for (const [headerName, hash] of [
62
+ ["x-amz-content-sha256", contentHash],
63
+ ["x-amz-sha256-tree-hash", treeHash]
64
+ ]) {
65
+ if (!(headerName in headers) && hash) {
66
+ headers = {
67
+ ...headers,
68
+ [headerName]: hash
69
+ };
70
+ }
71
+ }
72
+ request.headers = headers;
73
+ }
74
+ }
75
+ return next({
76
+ ...args,
77
+ request
78
+ });
79
+ };
80
+ }
81
+ __name(addChecksumHeadersMiddleware, "addChecksumHeadersMiddleware");
82
+ var addChecksumHeadersMiddlewareOptions = {
83
+ step: "build",
84
+ tags: ["SET_CHECKSUM_HEADERS"],
85
+ name: "addChecksumHeadersMiddleware",
86
+ override: true
87
+ };
88
+
89
+ // src/add-glacier-api-version.ts
90
+
91
+ function addGlacierApiVersionMiddleware(options) {
92
+ return (next) => async (args) => {
93
+ const request = args.request;
94
+ if (import_protocol_http.HttpRequest.isInstance(request)) {
95
+ request.headers["x-amz-glacier-version"] = options.apiVersion;
96
+ }
97
+ return next({
98
+ ...args,
99
+ request
100
+ });
101
+ };
102
+ }
103
+ __name(addGlacierApiVersionMiddleware, "addGlacierApiVersionMiddleware");
104
+ var addGlacierApiVersionMiddlewareOptions = {
105
+ step: "build",
106
+ tags: ["SET_GLACIER_VERSION"],
107
+ name: "addGlacierApiVersionMiddleware",
108
+ override: true
109
+ };
110
+
111
+ // src/configurations.ts
112
+ var getGlacierPlugin = /* @__PURE__ */ __name((config) => ({
113
+ applyToStack: (clientStack) => {
114
+ clientStack.add(accountIdDefaultMiddleware(), accountIdDefaultMiddlewareOptions);
115
+ clientStack.add(addGlacierApiVersionMiddleware(config), addGlacierApiVersionMiddlewareOptions);
116
+ clientStack.add(addChecksumHeadersMiddleware(config), addChecksumHeadersMiddlewareOptions);
117
+ }
118
+ }), "getGlacierPlugin");
119
+ // Annotate the CommonJS export names for ESM import in node:
120
+ 0 && (module.exports = {
121
+ accountIdDefaultMiddleware,
122
+ accountIdDefaultMiddlewareOptions,
123
+ addChecksumHeadersMiddleware,
124
+ addChecksumHeadersMiddlewareOptions,
125
+ addGlacierApiVersionMiddleware,
126
+ addGlacierApiVersionMiddlewareOptions,
127
+ getGlacierPlugin
128
+ });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-glacier",
3
- "version": "3.489.0",
3
+ "version": "3.495.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
- "build:cjs": "tsc -p tsconfig.cjs.json",
6
+ "build:cjs": "node ../../scripts/compilation/inline middleware-sdk-glacier",
7
7
  "build:es": "tsc -p tsconfig.es.json",
8
8
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
9
9
  "build:types": "tsc -p tsconfig.types.json",
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@aws-sdk/types": "3.489.0",
25
- "@smithy/protocol-http": "^3.0.12",
26
- "@smithy/types": "^2.8.0",
24
+ "@aws-sdk/types": "3.495.0",
25
+ "@smithy/protocol-http": "^3.1.0",
26
+ "@smithy/types": "^2.9.0",
27
27
  "tslib": "^2.5.0"
28
28
  },
29
29
  "engines": {