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