@etainabl/nodejs-sdk 1.3.192 → 1.3.196
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/esm/index.js +1546 -9430
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +7745 -31978
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/esm/chunk-3G3VXGQN.js +0 -164
- package/dist/esm/chunk-3G3VXGQN.js.map +0 -1
- package/dist/esm/chunk-4JDZJVKZ.js +0 -29
- package/dist/esm/chunk-4JDZJVKZ.js.map +0 -1
- package/dist/esm/chunk-4QSQRVYQ.js +0 -4408
- package/dist/esm/chunk-4QSQRVYQ.js.map +0 -1
- package/dist/esm/chunk-7QBJXGSP.js +0 -143
- package/dist/esm/chunk-7QBJXGSP.js.map +0 -1
- package/dist/esm/chunk-CRX53WMM.js +0 -222
- package/dist/esm/chunk-CRX53WMM.js.map +0 -1
- package/dist/esm/chunk-D74LA2XQ.js +0 -773
- package/dist/esm/chunk-D74LA2XQ.js.map +0 -1
- package/dist/esm/chunk-G3PMV62Z.js +0 -36
- package/dist/esm/chunk-G3PMV62Z.js.map +0 -1
- package/dist/esm/chunk-IX2LY325.js +0 -38
- package/dist/esm/chunk-IX2LY325.js.map +0 -1
- package/dist/esm/chunk-KWPO3OOT.js +0 -180
- package/dist/esm/chunk-KWPO3OOT.js.map +0 -1
- package/dist/esm/chunk-MCSCBMNG.js +0 -1424
- package/dist/esm/chunk-MCSCBMNG.js.map +0 -1
- package/dist/esm/chunk-RREOR7G6.js +0 -9
- package/dist/esm/chunk-RREOR7G6.js.map +0 -1
- package/dist/esm/chunk-UQAJZJ7E.js +0 -11
- package/dist/esm/chunk-UQAJZJ7E.js.map +0 -1
- package/dist/esm/chunk-UZGMBQZB.js +0 -13
- package/dist/esm/chunk-UZGMBQZB.js.map +0 -1
- package/dist/esm/chunk-XARQOPCZ.js +0 -47
- package/dist/esm/chunk-XARQOPCZ.js.map +0 -1
- package/dist/esm/chunk-YCRW5ZB7.js +0 -257
- package/dist/esm/chunk-YCRW5ZB7.js.map +0 -1
- package/dist/esm/chunk-YLT3BSXS.js +0 -180
- package/dist/esm/chunk-YLT3BSXS.js.map +0 -1
- package/dist/esm/chunk-Z63CAAFL.js +0 -43
- package/dist/esm/chunk-Z63CAAFL.js.map +0 -1
- package/dist/esm/dist-es-4VSEUPMG.js +0 -168
- package/dist/esm/dist-es-4VSEUPMG.js.map +0 -1
- package/dist/esm/dist-es-5G2D4IRG.js +0 -88
- package/dist/esm/dist-es-5G2D4IRG.js.map +0 -1
- package/dist/esm/dist-es-6PYQFA7S.js +0 -68
- package/dist/esm/dist-es-6PYQFA7S.js.map +0 -1
- package/dist/esm/dist-es-O7YXE2TO.js +0 -381
- package/dist/esm/dist-es-O7YXE2TO.js.map +0 -1
- package/dist/esm/dist-es-RVUNLU7U.js +0 -314
- package/dist/esm/dist-es-RVUNLU7U.js.map +0 -1
- package/dist/esm/dist-es-UEBBJXWA.js +0 -22
- package/dist/esm/dist-es-UEBBJXWA.js.map +0 -1
- package/dist/esm/dist-es-XS4DOSVC.js +0 -202
- package/dist/esm/dist-es-XS4DOSVC.js.map +0 -1
- package/dist/esm/event-streams-OE4R7Y65.js +0 -238
- package/dist/esm/event-streams-OE4R7Y65.js.map +0 -1
- package/dist/esm/loadSso-3FHKR3DN.js +0 -662
- package/dist/esm/loadSso-3FHKR3DN.js.map +0 -1
- package/dist/esm/sso-oidc-EORQ3JVU.js +0 -832
- package/dist/esm/sso-oidc-EORQ3JVU.js.map +0 -1
- package/dist/esm/sts-VPLY2J63.js +0 -1169
- package/dist/esm/sts-VPLY2J63.js.map +0 -1
|
@@ -1,4408 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
loadConfig,
|
|
3
|
-
memoize,
|
|
4
|
-
parseUrl
|
|
5
|
-
} from "./chunk-3G3VXGQN.js";
|
|
6
|
-
import {
|
|
7
|
-
HttpRequest,
|
|
8
|
-
HttpResponse,
|
|
9
|
-
escapeUri,
|
|
10
|
-
fromBase64,
|
|
11
|
-
fromHex,
|
|
12
|
-
toBase64,
|
|
13
|
-
toHex
|
|
14
|
-
} from "./chunk-D74LA2XQ.js";
|
|
15
|
-
import {
|
|
16
|
-
fromArrayBuffer,
|
|
17
|
-
fromString,
|
|
18
|
-
fromUtf8,
|
|
19
|
-
isArrayBuffer,
|
|
20
|
-
toUtf8
|
|
21
|
-
} from "./chunk-Z63CAAFL.js";
|
|
22
|
-
import {
|
|
23
|
-
CONFIG_PREFIX_SEPARATOR
|
|
24
|
-
} from "./chunk-CRX53WMM.js";
|
|
25
|
-
import {
|
|
26
|
-
setCredentialFeature
|
|
27
|
-
} from "./chunk-UZGMBQZB.js";
|
|
28
|
-
import {
|
|
29
|
-
ProviderError
|
|
30
|
-
} from "./chunk-IX2LY325.js";
|
|
31
|
-
|
|
32
|
-
// node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js
|
|
33
|
-
var getAllAliases = (name, aliases) => {
|
|
34
|
-
const _aliases = [];
|
|
35
|
-
if (name) {
|
|
36
|
-
_aliases.push(name);
|
|
37
|
-
}
|
|
38
|
-
if (aliases) {
|
|
39
|
-
for (const alias of aliases) {
|
|
40
|
-
_aliases.push(alias);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return _aliases;
|
|
44
|
-
};
|
|
45
|
-
var getMiddlewareNameWithAliases = (name, aliases) => {
|
|
46
|
-
return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
|
|
47
|
-
};
|
|
48
|
-
var constructStack = () => {
|
|
49
|
-
let absoluteEntries = [];
|
|
50
|
-
let relativeEntries = [];
|
|
51
|
-
let identifyOnResolve = false;
|
|
52
|
-
const entriesNameSet = /* @__PURE__ */ new Set();
|
|
53
|
-
const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]);
|
|
54
|
-
const removeByName = (toRemove) => {
|
|
55
|
-
let isRemoved = false;
|
|
56
|
-
const filterCb = (entry) => {
|
|
57
|
-
const aliases = getAllAliases(entry.name, entry.aliases);
|
|
58
|
-
if (aliases.includes(toRemove)) {
|
|
59
|
-
isRemoved = true;
|
|
60
|
-
for (const alias of aliases) {
|
|
61
|
-
entriesNameSet.delete(alias);
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
};
|
|
67
|
-
absoluteEntries = absoluteEntries.filter(filterCb);
|
|
68
|
-
relativeEntries = relativeEntries.filter(filterCb);
|
|
69
|
-
return isRemoved;
|
|
70
|
-
};
|
|
71
|
-
const removeByReference = (toRemove) => {
|
|
72
|
-
let isRemoved = false;
|
|
73
|
-
const filterCb = (entry) => {
|
|
74
|
-
if (entry.middleware === toRemove) {
|
|
75
|
-
isRemoved = true;
|
|
76
|
-
for (const alias of getAllAliases(entry.name, entry.aliases)) {
|
|
77
|
-
entriesNameSet.delete(alias);
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
};
|
|
83
|
-
absoluteEntries = absoluteEntries.filter(filterCb);
|
|
84
|
-
relativeEntries = relativeEntries.filter(filterCb);
|
|
85
|
-
return isRemoved;
|
|
86
|
-
};
|
|
87
|
-
const cloneTo = (toStack) => {
|
|
88
|
-
absoluteEntries.forEach((entry) => {
|
|
89
|
-
toStack.add(entry.middleware, { ...entry });
|
|
90
|
-
});
|
|
91
|
-
relativeEntries.forEach((entry) => {
|
|
92
|
-
toStack.addRelativeTo(entry.middleware, { ...entry });
|
|
93
|
-
});
|
|
94
|
-
toStack.identifyOnResolve?.(stack.identifyOnResolve());
|
|
95
|
-
return toStack;
|
|
96
|
-
};
|
|
97
|
-
const expandRelativeMiddlewareList = (from) => {
|
|
98
|
-
const expandedMiddlewareList = [];
|
|
99
|
-
from.before.forEach((entry) => {
|
|
100
|
-
if (entry.before.length === 0 && entry.after.length === 0) {
|
|
101
|
-
expandedMiddlewareList.push(entry);
|
|
102
|
-
} else {
|
|
103
|
-
expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
expandedMiddlewareList.push(from);
|
|
107
|
-
from.after.reverse().forEach((entry) => {
|
|
108
|
-
if (entry.before.length === 0 && entry.after.length === 0) {
|
|
109
|
-
expandedMiddlewareList.push(entry);
|
|
110
|
-
} else {
|
|
111
|
-
expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
return expandedMiddlewareList;
|
|
115
|
-
};
|
|
116
|
-
const getMiddlewareList = (debug = false) => {
|
|
117
|
-
const normalizedAbsoluteEntries = [];
|
|
118
|
-
const normalizedRelativeEntries = [];
|
|
119
|
-
const normalizedEntriesNameMap = {};
|
|
120
|
-
absoluteEntries.forEach((entry) => {
|
|
121
|
-
const normalizedEntry = {
|
|
122
|
-
...entry,
|
|
123
|
-
before: [],
|
|
124
|
-
after: []
|
|
125
|
-
};
|
|
126
|
-
for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
|
|
127
|
-
normalizedEntriesNameMap[alias] = normalizedEntry;
|
|
128
|
-
}
|
|
129
|
-
normalizedAbsoluteEntries.push(normalizedEntry);
|
|
130
|
-
});
|
|
131
|
-
relativeEntries.forEach((entry) => {
|
|
132
|
-
const normalizedEntry = {
|
|
133
|
-
...entry,
|
|
134
|
-
before: [],
|
|
135
|
-
after: []
|
|
136
|
-
};
|
|
137
|
-
for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
|
|
138
|
-
normalizedEntriesNameMap[alias] = normalizedEntry;
|
|
139
|
-
}
|
|
140
|
-
normalizedRelativeEntries.push(normalizedEntry);
|
|
141
|
-
});
|
|
142
|
-
normalizedRelativeEntries.forEach((entry) => {
|
|
143
|
-
if (entry.toMiddleware) {
|
|
144
|
-
const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
|
|
145
|
-
if (toMiddleware === void 0) {
|
|
146
|
-
if (debug) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`);
|
|
150
|
-
}
|
|
151
|
-
if (entry.relation === "after") {
|
|
152
|
-
toMiddleware.after.push(entry);
|
|
153
|
-
}
|
|
154
|
-
if (entry.relation === "before") {
|
|
155
|
-
toMiddleware.before.push(entry);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {
|
|
160
|
-
wholeList.push(...expandedMiddlewareList);
|
|
161
|
-
return wholeList;
|
|
162
|
-
}, []);
|
|
163
|
-
return mainChain;
|
|
164
|
-
};
|
|
165
|
-
const stack = {
|
|
166
|
-
add: (middleware, options = {}) => {
|
|
167
|
-
const { name, override, aliases: _aliases } = options;
|
|
168
|
-
const entry = {
|
|
169
|
-
step: "initialize",
|
|
170
|
-
priority: "normal",
|
|
171
|
-
middleware,
|
|
172
|
-
...options
|
|
173
|
-
};
|
|
174
|
-
const aliases = getAllAliases(name, _aliases);
|
|
175
|
-
if (aliases.length > 0) {
|
|
176
|
-
if (aliases.some((alias) => entriesNameSet.has(alias))) {
|
|
177
|
-
if (!override)
|
|
178
|
-
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
|
|
179
|
-
for (const alias of aliases) {
|
|
180
|
-
const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
|
|
181
|
-
if (toOverrideIndex === -1) {
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
const toOverride = absoluteEntries[toOverrideIndex];
|
|
185
|
-
if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
|
|
186
|
-
throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`);
|
|
187
|
-
}
|
|
188
|
-
absoluteEntries.splice(toOverrideIndex, 1);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (const alias of aliases) {
|
|
192
|
-
entriesNameSet.add(alias);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
absoluteEntries.push(entry);
|
|
196
|
-
},
|
|
197
|
-
addRelativeTo: (middleware, options) => {
|
|
198
|
-
const { name, override, aliases: _aliases } = options;
|
|
199
|
-
const entry = {
|
|
200
|
-
middleware,
|
|
201
|
-
...options
|
|
202
|
-
};
|
|
203
|
-
const aliases = getAllAliases(name, _aliases);
|
|
204
|
-
if (aliases.length > 0) {
|
|
205
|
-
if (aliases.some((alias) => entriesNameSet.has(alias))) {
|
|
206
|
-
if (!override)
|
|
207
|
-
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
|
|
208
|
-
for (const alias of aliases) {
|
|
209
|
-
const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
|
|
210
|
-
if (toOverrideIndex === -1) {
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
const toOverride = relativeEntries[toOverrideIndex];
|
|
214
|
-
if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
|
|
215
|
-
throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`);
|
|
216
|
-
}
|
|
217
|
-
relativeEntries.splice(toOverrideIndex, 1);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
for (const alias of aliases) {
|
|
221
|
-
entriesNameSet.add(alias);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
relativeEntries.push(entry);
|
|
225
|
-
},
|
|
226
|
-
clone: () => cloneTo(constructStack()),
|
|
227
|
-
use: (plugin) => {
|
|
228
|
-
plugin.applyToStack(stack);
|
|
229
|
-
},
|
|
230
|
-
remove: (toRemove) => {
|
|
231
|
-
if (typeof toRemove === "string")
|
|
232
|
-
return removeByName(toRemove);
|
|
233
|
-
else
|
|
234
|
-
return removeByReference(toRemove);
|
|
235
|
-
},
|
|
236
|
-
removeByTag: (toRemove) => {
|
|
237
|
-
let isRemoved = false;
|
|
238
|
-
const filterCb = (entry) => {
|
|
239
|
-
const { tags, name, aliases: _aliases } = entry;
|
|
240
|
-
if (tags && tags.includes(toRemove)) {
|
|
241
|
-
const aliases = getAllAliases(name, _aliases);
|
|
242
|
-
for (const alias of aliases) {
|
|
243
|
-
entriesNameSet.delete(alias);
|
|
244
|
-
}
|
|
245
|
-
isRemoved = true;
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
return true;
|
|
249
|
-
};
|
|
250
|
-
absoluteEntries = absoluteEntries.filter(filterCb);
|
|
251
|
-
relativeEntries = relativeEntries.filter(filterCb);
|
|
252
|
-
return isRemoved;
|
|
253
|
-
},
|
|
254
|
-
concat: (from) => {
|
|
255
|
-
const cloned = cloneTo(constructStack());
|
|
256
|
-
cloned.use(from);
|
|
257
|
-
cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
|
|
258
|
-
return cloned;
|
|
259
|
-
},
|
|
260
|
-
applyToStack: cloneTo,
|
|
261
|
-
identify: () => {
|
|
262
|
-
return getMiddlewareList(true).map((mw) => {
|
|
263
|
-
const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
|
|
264
|
-
return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
|
|
265
|
-
});
|
|
266
|
-
},
|
|
267
|
-
identifyOnResolve(toggle) {
|
|
268
|
-
if (typeof toggle === "boolean")
|
|
269
|
-
identifyOnResolve = toggle;
|
|
270
|
-
return identifyOnResolve;
|
|
271
|
-
},
|
|
272
|
-
resolve: (handler, context) => {
|
|
273
|
-
for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
|
|
274
|
-
handler = middleware(handler, context);
|
|
275
|
-
}
|
|
276
|
-
if (identifyOnResolve) {
|
|
277
|
-
console.log(stack.identify());
|
|
278
|
-
}
|
|
279
|
-
return handler;
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
return stack;
|
|
283
|
-
};
|
|
284
|
-
var stepWeights = {
|
|
285
|
-
initialize: 5,
|
|
286
|
-
serialize: 4,
|
|
287
|
-
build: 3,
|
|
288
|
-
finalizeRequest: 2,
|
|
289
|
-
deserialize: 1
|
|
290
|
-
};
|
|
291
|
-
var priorityWeights = {
|
|
292
|
-
high: 3,
|
|
293
|
-
normal: 2,
|
|
294
|
-
low: 1
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
// node_modules/@smithy/smithy-client/dist-es/client.js
|
|
298
|
-
var Client = class {
|
|
299
|
-
config;
|
|
300
|
-
middlewareStack = constructStack();
|
|
301
|
-
initConfig;
|
|
302
|
-
handlers;
|
|
303
|
-
constructor(config) {
|
|
304
|
-
this.config = config;
|
|
305
|
-
const { protocol, protocolSettings } = config;
|
|
306
|
-
if (protocolSettings) {
|
|
307
|
-
if (typeof protocol === "function") {
|
|
308
|
-
config.protocol = new protocol(protocolSettings);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
send(command, optionsOrCb, cb) {
|
|
313
|
-
const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
|
|
314
|
-
const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
|
|
315
|
-
const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true;
|
|
316
|
-
let handler;
|
|
317
|
-
if (useHandlerCache) {
|
|
318
|
-
if (!this.handlers) {
|
|
319
|
-
this.handlers = /* @__PURE__ */ new WeakMap();
|
|
320
|
-
}
|
|
321
|
-
const handlers = this.handlers;
|
|
322
|
-
if (handlers.has(command.constructor)) {
|
|
323
|
-
handler = handlers.get(command.constructor);
|
|
324
|
-
} else {
|
|
325
|
-
handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
326
|
-
handlers.set(command.constructor, handler);
|
|
327
|
-
}
|
|
328
|
-
} else {
|
|
329
|
-
delete this.handlers;
|
|
330
|
-
handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
331
|
-
}
|
|
332
|
-
if (callback) {
|
|
333
|
-
handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => {
|
|
334
|
-
});
|
|
335
|
-
} else {
|
|
336
|
-
return handler(command).then((result) => result.output);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
destroy() {
|
|
340
|
-
this.config?.requestHandler?.destroy?.();
|
|
341
|
-
delete this.handlers;
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
// node_modules/@smithy/types/dist-es/endpoint.js
|
|
346
|
-
var EndpointURLScheme;
|
|
347
|
-
(function(EndpointURLScheme2) {
|
|
348
|
-
EndpointURLScheme2["HTTP"] = "http";
|
|
349
|
-
EndpointURLScheme2["HTTPS"] = "https";
|
|
350
|
-
})(EndpointURLScheme || (EndpointURLScheme = {}));
|
|
351
|
-
|
|
352
|
-
// node_modules/@smithy/types/dist-es/extensions/checksum.js
|
|
353
|
-
var AlgorithmId;
|
|
354
|
-
(function(AlgorithmId2) {
|
|
355
|
-
AlgorithmId2["MD5"] = "md5";
|
|
356
|
-
AlgorithmId2["CRC32"] = "crc32";
|
|
357
|
-
AlgorithmId2["CRC32C"] = "crc32c";
|
|
358
|
-
AlgorithmId2["SHA1"] = "sha1";
|
|
359
|
-
AlgorithmId2["SHA256"] = "sha256";
|
|
360
|
-
})(AlgorithmId || (AlgorithmId = {}));
|
|
361
|
-
|
|
362
|
-
// node_modules/@smithy/types/dist-es/middleware.js
|
|
363
|
-
var SMITHY_CONTEXT_KEY = "__smithy_context";
|
|
364
|
-
|
|
365
|
-
// node_modules/@smithy/core/dist-es/submodules/schema/deref.js
|
|
366
|
-
var deref = (schemaRef) => {
|
|
367
|
-
if (typeof schemaRef === "function") {
|
|
368
|
-
return schemaRef();
|
|
369
|
-
}
|
|
370
|
-
return schemaRef;
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
// node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
|
|
374
|
-
var getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
|
|
375
|
-
return {
|
|
376
|
-
setHttpHandler(handler) {
|
|
377
|
-
runtimeConfig.httpHandler = handler;
|
|
378
|
-
},
|
|
379
|
-
httpHandler() {
|
|
380
|
-
return runtimeConfig.httpHandler;
|
|
381
|
-
},
|
|
382
|
-
updateHttpClientConfig(key, value) {
|
|
383
|
-
runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
|
|
384
|
-
},
|
|
385
|
-
httpHandlerConfigs() {
|
|
386
|
-
return runtimeConfig.httpHandler.httpHandlerConfigs();
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
};
|
|
390
|
-
var resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
|
|
391
|
-
return {
|
|
392
|
-
httpHandler: httpHandlerExtensionConfiguration.httpHandler()
|
|
393
|
-
};
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
// node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js
|
|
397
|
-
var getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});
|
|
398
|
-
|
|
399
|
-
// node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js
|
|
400
|
-
var normalizeProvider = (input) => {
|
|
401
|
-
if (typeof input === "function")
|
|
402
|
-
return input;
|
|
403
|
-
const promisified = Promise.resolve(input);
|
|
404
|
-
return () => promisified;
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
// node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js
|
|
408
|
-
function translateTraits(indicator) {
|
|
409
|
-
if (typeof indicator === "object") {
|
|
410
|
-
return indicator;
|
|
411
|
-
}
|
|
412
|
-
indicator = indicator | 0;
|
|
413
|
-
const traits = {};
|
|
414
|
-
let i = 0;
|
|
415
|
-
for (const trait of [
|
|
416
|
-
"httpLabel",
|
|
417
|
-
"idempotent",
|
|
418
|
-
"idempotencyToken",
|
|
419
|
-
"sensitive",
|
|
420
|
-
"httpPayload",
|
|
421
|
-
"httpResponseCode",
|
|
422
|
-
"httpQueryParams"
|
|
423
|
-
]) {
|
|
424
|
-
if ((indicator >> i++ & 1) === 1) {
|
|
425
|
-
traits[trait] = 1;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return traits;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js
|
|
432
|
-
var NormalizedSchema = class _NormalizedSchema {
|
|
433
|
-
ref;
|
|
434
|
-
memberName;
|
|
435
|
-
static symbol = Symbol.for("@smithy/nor");
|
|
436
|
-
symbol = _NormalizedSchema.symbol;
|
|
437
|
-
name;
|
|
438
|
-
schema;
|
|
439
|
-
_isMemberSchema;
|
|
440
|
-
traits;
|
|
441
|
-
memberTraits;
|
|
442
|
-
normalizedTraits;
|
|
443
|
-
constructor(ref, memberName) {
|
|
444
|
-
this.ref = ref;
|
|
445
|
-
this.memberName = memberName;
|
|
446
|
-
const traitStack = [];
|
|
447
|
-
let _ref = ref;
|
|
448
|
-
let schema = ref;
|
|
449
|
-
this._isMemberSchema = false;
|
|
450
|
-
while (isMemberSchema(_ref)) {
|
|
451
|
-
traitStack.push(_ref[1]);
|
|
452
|
-
_ref = _ref[0];
|
|
453
|
-
schema = deref(_ref);
|
|
454
|
-
this._isMemberSchema = true;
|
|
455
|
-
}
|
|
456
|
-
if (traitStack.length > 0) {
|
|
457
|
-
this.memberTraits = {};
|
|
458
|
-
for (let i = traitStack.length - 1; i >= 0; --i) {
|
|
459
|
-
const traitSet = traitStack[i];
|
|
460
|
-
Object.assign(this.memberTraits, translateTraits(traitSet));
|
|
461
|
-
}
|
|
462
|
-
} else {
|
|
463
|
-
this.memberTraits = 0;
|
|
464
|
-
}
|
|
465
|
-
if (schema instanceof _NormalizedSchema) {
|
|
466
|
-
const computedMemberTraits = this.memberTraits;
|
|
467
|
-
Object.assign(this, schema);
|
|
468
|
-
this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
|
|
469
|
-
this.normalizedTraits = void 0;
|
|
470
|
-
this.memberName = memberName ?? schema.memberName;
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
this.schema = deref(schema);
|
|
474
|
-
if (isStaticSchema(this.schema)) {
|
|
475
|
-
this.name = `${this.schema[1]}#${this.schema[2]}`;
|
|
476
|
-
this.traits = this.schema[3];
|
|
477
|
-
} else {
|
|
478
|
-
this.name = this.memberName ?? String(schema);
|
|
479
|
-
this.traits = 0;
|
|
480
|
-
}
|
|
481
|
-
if (this._isMemberSchema && !memberName) {
|
|
482
|
-
throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
static [Symbol.hasInstance](lhs) {
|
|
486
|
-
const isPrototype = this.prototype.isPrototypeOf(lhs);
|
|
487
|
-
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
488
|
-
const ns = lhs;
|
|
489
|
-
return ns.symbol === this.symbol;
|
|
490
|
-
}
|
|
491
|
-
return isPrototype;
|
|
492
|
-
}
|
|
493
|
-
static of(ref) {
|
|
494
|
-
const sc = deref(ref);
|
|
495
|
-
if (sc instanceof _NormalizedSchema) {
|
|
496
|
-
return sc;
|
|
497
|
-
}
|
|
498
|
-
if (isMemberSchema(sc)) {
|
|
499
|
-
const [ns, traits] = sc;
|
|
500
|
-
if (ns instanceof _NormalizedSchema) {
|
|
501
|
-
Object.assign(ns.getMergedTraits(), translateTraits(traits));
|
|
502
|
-
return ns;
|
|
503
|
-
}
|
|
504
|
-
throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
|
|
505
|
-
}
|
|
506
|
-
return new _NormalizedSchema(sc);
|
|
507
|
-
}
|
|
508
|
-
getSchema() {
|
|
509
|
-
const sc = this.schema;
|
|
510
|
-
if (sc[0] === 0) {
|
|
511
|
-
return sc[4];
|
|
512
|
-
}
|
|
513
|
-
return sc;
|
|
514
|
-
}
|
|
515
|
-
getName(withNamespace = false) {
|
|
516
|
-
const { name } = this;
|
|
517
|
-
const short = !withNamespace && name && name.includes("#");
|
|
518
|
-
return short ? name.split("#")[1] : name || void 0;
|
|
519
|
-
}
|
|
520
|
-
getMemberName() {
|
|
521
|
-
return this.memberName;
|
|
522
|
-
}
|
|
523
|
-
isMemberSchema() {
|
|
524
|
-
return this._isMemberSchema;
|
|
525
|
-
}
|
|
526
|
-
isListSchema() {
|
|
527
|
-
const sc = this.getSchema();
|
|
528
|
-
return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
|
|
529
|
-
}
|
|
530
|
-
isMapSchema() {
|
|
531
|
-
const sc = this.getSchema();
|
|
532
|
-
return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
|
|
533
|
-
}
|
|
534
|
-
isStructSchema() {
|
|
535
|
-
const sc = this.getSchema();
|
|
536
|
-
const id = sc[0];
|
|
537
|
-
return id === 3 || id === -3 || id === 4;
|
|
538
|
-
}
|
|
539
|
-
isUnionSchema() {
|
|
540
|
-
const sc = this.getSchema();
|
|
541
|
-
return sc[0] === 4;
|
|
542
|
-
}
|
|
543
|
-
isBlobSchema() {
|
|
544
|
-
const sc = this.getSchema();
|
|
545
|
-
return sc === 21 || sc === 42;
|
|
546
|
-
}
|
|
547
|
-
isTimestampSchema() {
|
|
548
|
-
const sc = this.getSchema();
|
|
549
|
-
return typeof sc === "number" && sc >= 4 && sc <= 7;
|
|
550
|
-
}
|
|
551
|
-
isUnitSchema() {
|
|
552
|
-
return this.getSchema() === "unit";
|
|
553
|
-
}
|
|
554
|
-
isDocumentSchema() {
|
|
555
|
-
return this.getSchema() === 15;
|
|
556
|
-
}
|
|
557
|
-
isStringSchema() {
|
|
558
|
-
return this.getSchema() === 0;
|
|
559
|
-
}
|
|
560
|
-
isBooleanSchema() {
|
|
561
|
-
return this.getSchema() === 2;
|
|
562
|
-
}
|
|
563
|
-
isNumericSchema() {
|
|
564
|
-
return this.getSchema() === 1;
|
|
565
|
-
}
|
|
566
|
-
isBigIntegerSchema() {
|
|
567
|
-
return this.getSchema() === 17;
|
|
568
|
-
}
|
|
569
|
-
isBigDecimalSchema() {
|
|
570
|
-
return this.getSchema() === 19;
|
|
571
|
-
}
|
|
572
|
-
isStreaming() {
|
|
573
|
-
const { streaming } = this.getMergedTraits();
|
|
574
|
-
return !!streaming || this.getSchema() === 42;
|
|
575
|
-
}
|
|
576
|
-
isIdempotencyToken() {
|
|
577
|
-
const match = (traits2) => (traits2 & 4) === 4 || !!traits2?.idempotencyToken;
|
|
578
|
-
const { normalizedTraits, traits, memberTraits } = this;
|
|
579
|
-
return match(normalizedTraits) || match(traits) || match(memberTraits);
|
|
580
|
-
}
|
|
581
|
-
getMergedTraits() {
|
|
582
|
-
return this.normalizedTraits ?? (this.normalizedTraits = {
|
|
583
|
-
...this.getOwnTraits(),
|
|
584
|
-
...this.getMemberTraits()
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
getMemberTraits() {
|
|
588
|
-
return translateTraits(this.memberTraits);
|
|
589
|
-
}
|
|
590
|
-
getOwnTraits() {
|
|
591
|
-
return translateTraits(this.traits);
|
|
592
|
-
}
|
|
593
|
-
getKeySchema() {
|
|
594
|
-
const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];
|
|
595
|
-
if (!isDoc && !isMap) {
|
|
596
|
-
throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
|
|
597
|
-
}
|
|
598
|
-
const schema = this.getSchema();
|
|
599
|
-
const memberSchema = isDoc ? 15 : schema[4] ?? 0;
|
|
600
|
-
return member([memberSchema, 0], "key");
|
|
601
|
-
}
|
|
602
|
-
getValueSchema() {
|
|
603
|
-
const sc = this.getSchema();
|
|
604
|
-
const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()];
|
|
605
|
-
const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0;
|
|
606
|
-
if (memberSchema != null) {
|
|
607
|
-
return member([memberSchema, 0], isMap ? "value" : "member");
|
|
608
|
-
}
|
|
609
|
-
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
|
|
610
|
-
}
|
|
611
|
-
getMemberSchema(memberName) {
|
|
612
|
-
const struct = this.getSchema();
|
|
613
|
-
if (this.isStructSchema() && struct[4].includes(memberName)) {
|
|
614
|
-
const i = struct[4].indexOf(memberName);
|
|
615
|
-
const memberSchema = struct[5][i];
|
|
616
|
-
return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);
|
|
617
|
-
}
|
|
618
|
-
if (this.isDocumentSchema()) {
|
|
619
|
-
return member([15, 0], memberName);
|
|
620
|
-
}
|
|
621
|
-
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no no member=${memberName}.`);
|
|
622
|
-
}
|
|
623
|
-
getMemberSchemas() {
|
|
624
|
-
const buffer = {};
|
|
625
|
-
try {
|
|
626
|
-
for (const [k, v] of this.structIterator()) {
|
|
627
|
-
buffer[k] = v;
|
|
628
|
-
}
|
|
629
|
-
} catch (ignored) {
|
|
630
|
-
}
|
|
631
|
-
return buffer;
|
|
632
|
-
}
|
|
633
|
-
getEventStreamMember() {
|
|
634
|
-
if (this.isStructSchema()) {
|
|
635
|
-
for (const [memberName, memberSchema] of this.structIterator()) {
|
|
636
|
-
if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
|
|
637
|
-
return memberName;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
return "";
|
|
642
|
-
}
|
|
643
|
-
*structIterator() {
|
|
644
|
-
if (this.isUnitSchema()) {
|
|
645
|
-
return;
|
|
646
|
-
}
|
|
647
|
-
if (!this.isStructSchema()) {
|
|
648
|
-
throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
|
|
649
|
-
}
|
|
650
|
-
const struct = this.getSchema();
|
|
651
|
-
for (let i = 0; i < struct[4].length; ++i) {
|
|
652
|
-
yield [struct[4][i], member([struct[5][i], 0], struct[4][i])];
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
function member(memberSchema, memberName) {
|
|
657
|
-
if (memberSchema instanceof NormalizedSchema) {
|
|
658
|
-
return Object.assign(memberSchema, {
|
|
659
|
-
memberName,
|
|
660
|
-
_isMemberSchema: true
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
const internalCtorAccess = NormalizedSchema;
|
|
664
|
-
return new internalCtorAccess(memberSchema, memberName);
|
|
665
|
-
}
|
|
666
|
-
var isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
|
|
667
|
-
var isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
|
|
668
|
-
|
|
669
|
-
// node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js
|
|
670
|
-
var SENSITIVE_STRING = "***SensitiveInformation***";
|
|
671
|
-
function schemaLogFilter(schema, data) {
|
|
672
|
-
if (data == null) {
|
|
673
|
-
return data;
|
|
674
|
-
}
|
|
675
|
-
const ns = NormalizedSchema.of(schema);
|
|
676
|
-
if (ns.getMergedTraits().sensitive) {
|
|
677
|
-
return SENSITIVE_STRING;
|
|
678
|
-
}
|
|
679
|
-
if (ns.isListSchema()) {
|
|
680
|
-
const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
|
|
681
|
-
if (isSensitive) {
|
|
682
|
-
return SENSITIVE_STRING;
|
|
683
|
-
}
|
|
684
|
-
} else if (ns.isMapSchema()) {
|
|
685
|
-
const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
|
|
686
|
-
if (isSensitive) {
|
|
687
|
-
return SENSITIVE_STRING;
|
|
688
|
-
}
|
|
689
|
-
} else if (ns.isStructSchema() && typeof data === "object") {
|
|
690
|
-
const object = data;
|
|
691
|
-
const newObject = {};
|
|
692
|
-
for (const [member2, memberNs] of ns.structIterator()) {
|
|
693
|
-
if (object[member2] != null) {
|
|
694
|
-
newObject[member2] = schemaLogFilter(memberNs, object[member2]);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
return newObject;
|
|
698
|
-
}
|
|
699
|
-
return data;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
// node_modules/@smithy/smithy-client/dist-es/command.js
|
|
703
|
-
var Command = class {
|
|
704
|
-
middlewareStack = constructStack();
|
|
705
|
-
schema;
|
|
706
|
-
static classBuilder() {
|
|
707
|
-
return new ClassBuilder();
|
|
708
|
-
}
|
|
709
|
-
resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) {
|
|
710
|
-
for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
|
|
711
|
-
this.middlewareStack.use(mw);
|
|
712
|
-
}
|
|
713
|
-
const stack = clientStack.concat(this.middlewareStack);
|
|
714
|
-
const { logger } = configuration;
|
|
715
|
-
const handlerExecutionContext = {
|
|
716
|
-
logger,
|
|
717
|
-
clientName,
|
|
718
|
-
commandName,
|
|
719
|
-
inputFilterSensitiveLog,
|
|
720
|
-
outputFilterSensitiveLog,
|
|
721
|
-
[SMITHY_CONTEXT_KEY]: {
|
|
722
|
-
commandInstance: this,
|
|
723
|
-
...smithyContext
|
|
724
|
-
},
|
|
725
|
-
...additionalContext
|
|
726
|
-
};
|
|
727
|
-
const { requestHandler } = configuration;
|
|
728
|
-
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
var ClassBuilder = class {
|
|
732
|
-
_init = () => {
|
|
733
|
-
};
|
|
734
|
-
_ep = {};
|
|
735
|
-
_middlewareFn = () => [];
|
|
736
|
-
_commandName = "";
|
|
737
|
-
_clientName = "";
|
|
738
|
-
_additionalContext = {};
|
|
739
|
-
_smithyContext = {};
|
|
740
|
-
_inputFilterSensitiveLog = void 0;
|
|
741
|
-
_outputFilterSensitiveLog = void 0;
|
|
742
|
-
_serializer = null;
|
|
743
|
-
_deserializer = null;
|
|
744
|
-
_operationSchema;
|
|
745
|
-
init(cb) {
|
|
746
|
-
this._init = cb;
|
|
747
|
-
}
|
|
748
|
-
ep(endpointParameterInstructions) {
|
|
749
|
-
this._ep = endpointParameterInstructions;
|
|
750
|
-
return this;
|
|
751
|
-
}
|
|
752
|
-
m(middlewareSupplier) {
|
|
753
|
-
this._middlewareFn = middlewareSupplier;
|
|
754
|
-
return this;
|
|
755
|
-
}
|
|
756
|
-
s(service, operation, smithyContext = {}) {
|
|
757
|
-
this._smithyContext = {
|
|
758
|
-
service,
|
|
759
|
-
operation,
|
|
760
|
-
...smithyContext
|
|
761
|
-
};
|
|
762
|
-
return this;
|
|
763
|
-
}
|
|
764
|
-
c(additionalContext = {}) {
|
|
765
|
-
this._additionalContext = additionalContext;
|
|
766
|
-
return this;
|
|
767
|
-
}
|
|
768
|
-
n(clientName, commandName) {
|
|
769
|
-
this._clientName = clientName;
|
|
770
|
-
this._commandName = commandName;
|
|
771
|
-
return this;
|
|
772
|
-
}
|
|
773
|
-
f(inputFilter = (_) => _, outputFilter = (_) => _) {
|
|
774
|
-
this._inputFilterSensitiveLog = inputFilter;
|
|
775
|
-
this._outputFilterSensitiveLog = outputFilter;
|
|
776
|
-
return this;
|
|
777
|
-
}
|
|
778
|
-
ser(serializer) {
|
|
779
|
-
this._serializer = serializer;
|
|
780
|
-
return this;
|
|
781
|
-
}
|
|
782
|
-
de(deserializer) {
|
|
783
|
-
this._deserializer = deserializer;
|
|
784
|
-
return this;
|
|
785
|
-
}
|
|
786
|
-
sc(operation) {
|
|
787
|
-
this._operationSchema = operation;
|
|
788
|
-
this._smithyContext.operationSchema = operation;
|
|
789
|
-
return this;
|
|
790
|
-
}
|
|
791
|
-
build() {
|
|
792
|
-
const closure = this;
|
|
793
|
-
let CommandRef;
|
|
794
|
-
return CommandRef = class extends Command {
|
|
795
|
-
input;
|
|
796
|
-
static getEndpointParameterInstructions() {
|
|
797
|
-
return closure._ep;
|
|
798
|
-
}
|
|
799
|
-
constructor(...[input]) {
|
|
800
|
-
super();
|
|
801
|
-
this.input = input ?? {};
|
|
802
|
-
closure._init(this);
|
|
803
|
-
this.schema = closure._operationSchema;
|
|
804
|
-
}
|
|
805
|
-
resolveMiddleware(stack, configuration, options) {
|
|
806
|
-
const op = closure._operationSchema;
|
|
807
|
-
const input = op?.[4] ?? op?.input;
|
|
808
|
-
const output = op?.[5] ?? op?.output;
|
|
809
|
-
return this.resolveMiddlewareWithContext(stack, configuration, options, {
|
|
810
|
-
CommandCtor: CommandRef,
|
|
811
|
-
middlewareFn: closure._middlewareFn,
|
|
812
|
-
clientName: closure._clientName,
|
|
813
|
-
commandName: closure._commandName,
|
|
814
|
-
inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _),
|
|
815
|
-
outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _),
|
|
816
|
-
smithyContext: closure._smithyContext,
|
|
817
|
-
additionalContext: closure._additionalContext
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
serialize = closure._serializer;
|
|
821
|
-
deserialize = closure._deserializer;
|
|
822
|
-
};
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
// node_modules/@aws-sdk/middleware-host-header/dist-es/index.js
|
|
827
|
-
function resolveHostHeaderConfig(input) {
|
|
828
|
-
return input;
|
|
829
|
-
}
|
|
830
|
-
var hostHeaderMiddleware = (options) => (next) => async (args) => {
|
|
831
|
-
if (!HttpRequest.isInstance(args.request))
|
|
832
|
-
return next(args);
|
|
833
|
-
const { request } = args;
|
|
834
|
-
const { handlerProtocol = "" } = options.requestHandler.metadata || {};
|
|
835
|
-
if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
|
|
836
|
-
delete request.headers["host"];
|
|
837
|
-
request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
|
|
838
|
-
} else if (!request.headers["host"]) {
|
|
839
|
-
let host = request.hostname;
|
|
840
|
-
if (request.port != null)
|
|
841
|
-
host += `:${request.port}`;
|
|
842
|
-
request.headers["host"] = host;
|
|
843
|
-
}
|
|
844
|
-
return next(args);
|
|
845
|
-
};
|
|
846
|
-
var hostHeaderMiddlewareOptions = {
|
|
847
|
-
name: "hostHeaderMiddleware",
|
|
848
|
-
step: "build",
|
|
849
|
-
priority: "low",
|
|
850
|
-
tags: ["HOST"],
|
|
851
|
-
override: true
|
|
852
|
-
};
|
|
853
|
-
var getHostHeaderPlugin = (options) => ({
|
|
854
|
-
applyToStack: (clientStack) => {
|
|
855
|
-
clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
|
|
859
|
-
// node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js
|
|
860
|
-
var loggerMiddleware = () => (next, context) => async (args) => {
|
|
861
|
-
try {
|
|
862
|
-
const response = await next(args);
|
|
863
|
-
const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
|
|
864
|
-
const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
865
|
-
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
866
|
-
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
|
|
867
|
-
const { $metadata, ...outputWithoutMetadata } = response.output;
|
|
868
|
-
logger?.info?.({
|
|
869
|
-
clientName,
|
|
870
|
-
commandName,
|
|
871
|
-
input: inputFilterSensitiveLog(args.input),
|
|
872
|
-
output: outputFilterSensitiveLog(outputWithoutMetadata),
|
|
873
|
-
metadata: $metadata
|
|
874
|
-
});
|
|
875
|
-
return response;
|
|
876
|
-
} catch (error) {
|
|
877
|
-
const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
|
|
878
|
-
const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
879
|
-
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
880
|
-
logger?.error?.({
|
|
881
|
-
clientName,
|
|
882
|
-
commandName,
|
|
883
|
-
input: inputFilterSensitiveLog(args.input),
|
|
884
|
-
error,
|
|
885
|
-
metadata: error.$metadata
|
|
886
|
-
});
|
|
887
|
-
throw error;
|
|
888
|
-
}
|
|
889
|
-
};
|
|
890
|
-
var loggerMiddlewareOptions = {
|
|
891
|
-
name: "loggerMiddleware",
|
|
892
|
-
tags: ["LOGGER"],
|
|
893
|
-
step: "initialize",
|
|
894
|
-
override: true
|
|
895
|
-
};
|
|
896
|
-
var getLoggerPlugin = (options) => ({
|
|
897
|
-
applyToStack: (clientStack) => {
|
|
898
|
-
clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
|
|
899
|
-
}
|
|
900
|
-
});
|
|
901
|
-
|
|
902
|
-
// node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js
|
|
903
|
-
var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
|
|
904
|
-
var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
|
|
905
|
-
var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
|
|
906
|
-
var recursionDetectionMiddleware = (options) => (next) => async (args) => {
|
|
907
|
-
const { request } = args;
|
|
908
|
-
if (!HttpRequest.isInstance(request) || options.runtime !== "node") {
|
|
909
|
-
return next(args);
|
|
910
|
-
}
|
|
911
|
-
const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME;
|
|
912
|
-
if (request.headers.hasOwnProperty(traceIdHeader)) {
|
|
913
|
-
return next(args);
|
|
914
|
-
}
|
|
915
|
-
const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
|
|
916
|
-
const traceId = process.env[ENV_TRACE_ID];
|
|
917
|
-
const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
|
|
918
|
-
if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
|
|
919
|
-
request.headers[TRACE_ID_HEADER_NAME] = traceId;
|
|
920
|
-
}
|
|
921
|
-
return next({
|
|
922
|
-
...args,
|
|
923
|
-
request
|
|
924
|
-
});
|
|
925
|
-
};
|
|
926
|
-
var addRecursionDetectionMiddlewareOptions = {
|
|
927
|
-
step: "build",
|
|
928
|
-
tags: ["RECURSION_DETECTION"],
|
|
929
|
-
name: "recursionDetectionMiddleware",
|
|
930
|
-
override: true,
|
|
931
|
-
priority: "low"
|
|
932
|
-
};
|
|
933
|
-
var getRecursionDetectionPlugin = (options) => ({
|
|
934
|
-
applyToStack: (clientStack) => {
|
|
935
|
-
clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
// node_modules/@smithy/smithy-client/dist-es/constants.js
|
|
940
|
-
var SENSITIVE_STRING2 = "***SensitiveInformation***";
|
|
941
|
-
|
|
942
|
-
// node_modules/@smithy/smithy-client/dist-es/exceptions.js
|
|
943
|
-
var ServiceException = class _ServiceException extends Error {
|
|
944
|
-
$fault;
|
|
945
|
-
$response;
|
|
946
|
-
$retryable;
|
|
947
|
-
$metadata;
|
|
948
|
-
constructor(options) {
|
|
949
|
-
super(options.message);
|
|
950
|
-
Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);
|
|
951
|
-
this.name = options.name;
|
|
952
|
-
this.$fault = options.$fault;
|
|
953
|
-
this.$metadata = options.$metadata;
|
|
954
|
-
}
|
|
955
|
-
static isInstance(value) {
|
|
956
|
-
if (!value)
|
|
957
|
-
return false;
|
|
958
|
-
const candidate = value;
|
|
959
|
-
return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server");
|
|
960
|
-
}
|
|
961
|
-
static [Symbol.hasInstance](instance) {
|
|
962
|
-
if (!instance)
|
|
963
|
-
return false;
|
|
964
|
-
const candidate = instance;
|
|
965
|
-
if (this === _ServiceException) {
|
|
966
|
-
return _ServiceException.isInstance(instance);
|
|
967
|
-
}
|
|
968
|
-
if (_ServiceException.isInstance(instance)) {
|
|
969
|
-
if (candidate.name && this.name) {
|
|
970
|
-
return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;
|
|
971
|
-
}
|
|
972
|
-
return this.prototype.isPrototypeOf(instance);
|
|
973
|
-
}
|
|
974
|
-
return false;
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
var decorateServiceException = (exception, additions = {}) => {
|
|
978
|
-
Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => {
|
|
979
|
-
if (exception[k] == void 0 || exception[k] === "") {
|
|
980
|
-
exception[k] = v;
|
|
981
|
-
}
|
|
982
|
-
});
|
|
983
|
-
const message = exception.message || exception.Message || "UnknownError";
|
|
984
|
-
exception.message = message;
|
|
985
|
-
delete exception.Message;
|
|
986
|
-
return exception;
|
|
987
|
-
};
|
|
988
|
-
|
|
989
|
-
// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js
|
|
990
|
-
var resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
|
|
991
|
-
if (!authSchemePreference || authSchemePreference.length === 0) {
|
|
992
|
-
return candidateAuthOptions;
|
|
993
|
-
}
|
|
994
|
-
const preferredAuthOptions = [];
|
|
995
|
-
for (const preferredSchemeName of authSchemePreference) {
|
|
996
|
-
for (const candidateAuthOption of candidateAuthOptions) {
|
|
997
|
-
const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
|
|
998
|
-
if (candidateAuthSchemeName === preferredSchemeName) {
|
|
999
|
-
preferredAuthOptions.push(candidateAuthOption);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
for (const candidateAuthOption of candidateAuthOptions) {
|
|
1004
|
-
if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
|
|
1005
|
-
preferredAuthOptions.push(candidateAuthOption);
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
return preferredAuthOptions;
|
|
1009
|
-
};
|
|
1010
|
-
|
|
1011
|
-
// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
|
|
1012
|
-
function convertHttpAuthSchemesToMap(httpAuthSchemes) {
|
|
1013
|
-
const map = /* @__PURE__ */ new Map();
|
|
1014
|
-
for (const scheme of httpAuthSchemes) {
|
|
1015
|
-
map.set(scheme.schemeId, scheme);
|
|
1016
|
-
}
|
|
1017
|
-
return map;
|
|
1018
|
-
}
|
|
1019
|
-
var httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
|
1020
|
-
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
|
1021
|
-
const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
|
|
1022
|
-
const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
|
|
1023
|
-
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
1024
|
-
const smithyContext = getSmithyContext(context);
|
|
1025
|
-
const failureReasons = [];
|
|
1026
|
-
for (const option of resolvedOptions) {
|
|
1027
|
-
const scheme = authSchemes.get(option.schemeId);
|
|
1028
|
-
if (!scheme) {
|
|
1029
|
-
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
|
|
1030
|
-
continue;
|
|
1031
|
-
}
|
|
1032
|
-
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
|
|
1033
|
-
if (!identityProvider) {
|
|
1034
|
-
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
1035
|
-
continue;
|
|
1036
|
-
}
|
|
1037
|
-
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
|
|
1038
|
-
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
1039
|
-
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
1040
|
-
smithyContext.selectedHttpAuthScheme = {
|
|
1041
|
-
httpAuthOption: option,
|
|
1042
|
-
identity: await identityProvider(option.identityProperties),
|
|
1043
|
-
signer: scheme.signer
|
|
1044
|
-
};
|
|
1045
|
-
break;
|
|
1046
|
-
}
|
|
1047
|
-
if (!smithyContext.selectedHttpAuthScheme) {
|
|
1048
|
-
throw new Error(failureReasons.join("\n"));
|
|
1049
|
-
}
|
|
1050
|
-
return next(args);
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
|
-
// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
|
|
1054
|
-
var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
|
1055
|
-
step: "serialize",
|
|
1056
|
-
tags: ["HTTP_AUTH_SCHEME"],
|
|
1057
|
-
name: "httpAuthSchemeMiddleware",
|
|
1058
|
-
override: true,
|
|
1059
|
-
relation: "before",
|
|
1060
|
-
toMiddleware: "endpointV2Middleware"
|
|
1061
|
-
};
|
|
1062
|
-
var getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
|
|
1063
|
-
applyToStack: (clientStack) => {
|
|
1064
|
-
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
|
1065
|
-
httpAuthSchemeParametersProvider,
|
|
1066
|
-
identityProviderConfigProvider
|
|
1067
|
-
}), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
|
|
1068
|
-
}
|
|
1069
|
-
});
|
|
1070
|
-
|
|
1071
|
-
// node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js
|
|
1072
|
-
var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
|
|
1073
|
-
const { response } = await next(args);
|
|
1074
|
-
try {
|
|
1075
|
-
const parsed = await deserializer(response, options);
|
|
1076
|
-
return {
|
|
1077
|
-
response,
|
|
1078
|
-
output: parsed
|
|
1079
|
-
};
|
|
1080
|
-
} catch (error) {
|
|
1081
|
-
Object.defineProperty(error, "$response", {
|
|
1082
|
-
value: response,
|
|
1083
|
-
enumerable: false,
|
|
1084
|
-
writable: false,
|
|
1085
|
-
configurable: false
|
|
1086
|
-
});
|
|
1087
|
-
if (!("$metadata" in error)) {
|
|
1088
|
-
const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
|
|
1089
|
-
try {
|
|
1090
|
-
error.message += "\n " + hint;
|
|
1091
|
-
} catch (e) {
|
|
1092
|
-
if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
|
|
1093
|
-
console.warn(hint);
|
|
1094
|
-
} else {
|
|
1095
|
-
context.logger?.warn?.(hint);
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
if (typeof error.$responseBodyText !== "undefined") {
|
|
1099
|
-
if (error.$response) {
|
|
1100
|
-
error.$response.body = error.$responseBodyText;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
try {
|
|
1104
|
-
if (HttpResponse.isInstance(response)) {
|
|
1105
|
-
const { headers = {} } = response;
|
|
1106
|
-
const headerEntries = Object.entries(headers);
|
|
1107
|
-
error.$metadata = {
|
|
1108
|
-
httpStatusCode: response.statusCode,
|
|
1109
|
-
requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
|
|
1110
|
-
extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
|
|
1111
|
-
cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
|
|
1112
|
-
};
|
|
1113
|
-
}
|
|
1114
|
-
} catch (e) {
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
throw error;
|
|
1118
|
-
}
|
|
1119
|
-
};
|
|
1120
|
-
var findHeader = (pattern, headers) => {
|
|
1121
|
-
return (headers.find(([k]) => {
|
|
1122
|
-
return k.match(pattern);
|
|
1123
|
-
}) || [void 0, void 0])[1];
|
|
1124
|
-
};
|
|
1125
|
-
|
|
1126
|
-
// node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js
|
|
1127
|
-
var serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
|
|
1128
|
-
const endpointConfig = options;
|
|
1129
|
-
const endpoint = context.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context.endpointV2.url) : endpointConfig.endpoint;
|
|
1130
|
-
if (!endpoint) {
|
|
1131
|
-
throw new Error("No valid endpoint provider available.");
|
|
1132
|
-
}
|
|
1133
|
-
const request = await serializer(args.input, { ...options, endpoint });
|
|
1134
|
-
return next({
|
|
1135
|
-
...args,
|
|
1136
|
-
request
|
|
1137
|
-
});
|
|
1138
|
-
};
|
|
1139
|
-
|
|
1140
|
-
// node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js
|
|
1141
|
-
var deserializerMiddlewareOption = {
|
|
1142
|
-
name: "deserializerMiddleware",
|
|
1143
|
-
step: "deserialize",
|
|
1144
|
-
tags: ["DESERIALIZER"],
|
|
1145
|
-
override: true
|
|
1146
|
-
};
|
|
1147
|
-
var serializerMiddlewareOption = {
|
|
1148
|
-
name: "serializerMiddleware",
|
|
1149
|
-
step: "serialize",
|
|
1150
|
-
tags: ["SERIALIZER"],
|
|
1151
|
-
override: true
|
|
1152
|
-
};
|
|
1153
|
-
function getSerdePlugin(config, serializer, deserializer) {
|
|
1154
|
-
return {
|
|
1155
|
-
applyToStack: (commandStack) => {
|
|
1156
|
-
commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
|
|
1157
|
-
commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
|
|
1158
|
-
}
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
// node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js
|
|
1163
|
-
var defaultErrorHandler = (signingProperties) => (error) => {
|
|
1164
|
-
throw error;
|
|
1165
|
-
};
|
|
1166
|
-
var defaultSuccessHandler = (httpResponse, signingProperties) => {
|
|
1167
|
-
};
|
|
1168
|
-
var httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
1169
|
-
if (!HttpRequest.isInstance(args.request)) {
|
|
1170
|
-
return next(args);
|
|
1171
|
-
}
|
|
1172
|
-
const smithyContext = getSmithyContext(context);
|
|
1173
|
-
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
1174
|
-
if (!scheme) {
|
|
1175
|
-
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
1176
|
-
}
|
|
1177
|
-
const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
|
|
1178
|
-
const output = await next({
|
|
1179
|
-
...args,
|
|
1180
|
-
request: await signer.sign(args.request, identity, signingProperties)
|
|
1181
|
-
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
1182
|
-
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
1183
|
-
return output;
|
|
1184
|
-
};
|
|
1185
|
-
|
|
1186
|
-
// node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js
|
|
1187
|
-
var httpSigningMiddlewareOptions = {
|
|
1188
|
-
step: "finalizeRequest",
|
|
1189
|
-
tags: ["HTTP_SIGNING"],
|
|
1190
|
-
name: "httpSigningMiddleware",
|
|
1191
|
-
aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
|
|
1192
|
-
override: true,
|
|
1193
|
-
relation: "after",
|
|
1194
|
-
toMiddleware: "retryMiddleware"
|
|
1195
|
-
};
|
|
1196
|
-
var getHttpSigningPlugin = (config) => ({
|
|
1197
|
-
applyToStack: (clientStack) => {
|
|
1198
|
-
clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
|
|
1199
|
-
}
|
|
1200
|
-
});
|
|
1201
|
-
|
|
1202
|
-
// node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js
|
|
1203
|
-
var DefaultIdentityProviderConfig = class {
|
|
1204
|
-
authSchemes = /* @__PURE__ */ new Map();
|
|
1205
|
-
constructor(config) {
|
|
1206
|
-
for (const [key, value] of Object.entries(config)) {
|
|
1207
|
-
if (value !== void 0) {
|
|
1208
|
-
this.authSchemes.set(key, value);
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
getIdentityProvider(schemeId) {
|
|
1213
|
-
return this.authSchemes.get(schemeId);
|
|
1214
|
-
}
|
|
1215
|
-
};
|
|
1216
|
-
|
|
1217
|
-
// node_modules/@smithy/core/dist-es/normalizeProvider.js
|
|
1218
|
-
var normalizeProvider2 = (input) => {
|
|
1219
|
-
if (typeof input === "function")
|
|
1220
|
-
return input;
|
|
1221
|
-
const promisified = Promise.resolve(input);
|
|
1222
|
-
return () => promisified;
|
|
1223
|
-
};
|
|
1224
|
-
|
|
1225
|
-
// node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
|
|
1226
|
-
var toUint8Array = (data) => {
|
|
1227
|
-
if (typeof data === "string") {
|
|
1228
|
-
return fromUtf8(data);
|
|
1229
|
-
}
|
|
1230
|
-
if (ArrayBuffer.isView(data)) {
|
|
1231
|
-
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
1232
|
-
}
|
|
1233
|
-
return new Uint8Array(data);
|
|
1234
|
-
};
|
|
1235
|
-
|
|
1236
|
-
// node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
|
|
1237
|
-
var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
|
|
1238
|
-
static fromString(source, encoding = "utf-8") {
|
|
1239
|
-
if (typeof source === "string") {
|
|
1240
|
-
if (encoding === "base64") {
|
|
1241
|
-
return _Uint8ArrayBlobAdapter.mutate(fromBase64(source));
|
|
1242
|
-
}
|
|
1243
|
-
return _Uint8ArrayBlobAdapter.mutate(fromUtf8(source));
|
|
1244
|
-
}
|
|
1245
|
-
throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
|
|
1246
|
-
}
|
|
1247
|
-
static mutate(source) {
|
|
1248
|
-
Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype);
|
|
1249
|
-
return source;
|
|
1250
|
-
}
|
|
1251
|
-
transformToString(encoding = "utf-8") {
|
|
1252
|
-
if (encoding === "base64") {
|
|
1253
|
-
return toBase64(this);
|
|
1254
|
-
}
|
|
1255
|
-
return toUtf8(this);
|
|
1256
|
-
}
|
|
1257
|
-
};
|
|
1258
|
-
|
|
1259
|
-
// node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
|
|
1260
|
-
var collectBody = async (streamBody = new Uint8Array(), context) => {
|
|
1261
|
-
if (streamBody instanceof Uint8Array) {
|
|
1262
|
-
return Uint8ArrayBlobAdapter.mutate(streamBody);
|
|
1263
|
-
}
|
|
1264
|
-
if (!streamBody) {
|
|
1265
|
-
return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
|
|
1266
|
-
}
|
|
1267
|
-
const fromContext = context.streamCollector(streamBody);
|
|
1268
|
-
return Uint8ArrayBlobAdapter.mutate(await fromContext);
|
|
1269
|
-
};
|
|
1270
|
-
|
|
1271
|
-
// node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
|
|
1272
|
-
function extendedEncodeURIComponent(str) {
|
|
1273
|
-
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
|
1274
|
-
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
// node_modules/@smithy/uuid/dist-es/randomUUID.js
|
|
1279
|
-
import crypto2 from "crypto";
|
|
1280
|
-
var randomUUID = crypto2.randomUUID.bind(crypto2);
|
|
1281
|
-
|
|
1282
|
-
// node_modules/@smithy/uuid/dist-es/v4.js
|
|
1283
|
-
var decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
1284
|
-
var v4 = () => {
|
|
1285
|
-
if (randomUUID) {
|
|
1286
|
-
return randomUUID();
|
|
1287
|
-
}
|
|
1288
|
-
const rnds = new Uint8Array(16);
|
|
1289
|
-
crypto.getRandomValues(rnds);
|
|
1290
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
1291
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
1292
|
-
return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]];
|
|
1293
|
-
};
|
|
1294
|
-
|
|
1295
|
-
// node_modules/@smithy/core/dist-es/setFeature.js
|
|
1296
|
-
function setFeature(context, feature, value) {
|
|
1297
|
-
if (!context.__smithy_context) {
|
|
1298
|
-
context.__smithy_context = {
|
|
1299
|
-
features: {}
|
|
1300
|
-
};
|
|
1301
|
-
} else if (!context.__smithy_context.features) {
|
|
1302
|
-
context.__smithy_context.features = {};
|
|
1303
|
-
}
|
|
1304
|
-
context.__smithy_context.features[feature] = value;
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
// node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js
|
|
1308
|
-
var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) {
|
|
1309
|
-
return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
|
1310
|
-
};
|
|
1311
|
-
var EXPIRATION_MS = 3e5;
|
|
1312
|
-
var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
|
|
1313
|
-
var doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0;
|
|
1314
|
-
var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
1315
|
-
if (provider === void 0) {
|
|
1316
|
-
return void 0;
|
|
1317
|
-
}
|
|
1318
|
-
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
|
|
1319
|
-
let resolved;
|
|
1320
|
-
let pending;
|
|
1321
|
-
let hasResult;
|
|
1322
|
-
let isConstant = false;
|
|
1323
|
-
const coalesceProvider = async (options) => {
|
|
1324
|
-
if (!pending) {
|
|
1325
|
-
pending = normalizedProvider(options);
|
|
1326
|
-
}
|
|
1327
|
-
try {
|
|
1328
|
-
resolved = await pending;
|
|
1329
|
-
hasResult = true;
|
|
1330
|
-
isConstant = false;
|
|
1331
|
-
} finally {
|
|
1332
|
-
pending = void 0;
|
|
1333
|
-
}
|
|
1334
|
-
return resolved;
|
|
1335
|
-
};
|
|
1336
|
-
if (isExpired === void 0) {
|
|
1337
|
-
return async (options) => {
|
|
1338
|
-
if (!hasResult || options?.forceRefresh) {
|
|
1339
|
-
resolved = await coalesceProvider(options);
|
|
1340
|
-
}
|
|
1341
|
-
return resolved;
|
|
1342
|
-
};
|
|
1343
|
-
}
|
|
1344
|
-
return async (options) => {
|
|
1345
|
-
if (!hasResult || options?.forceRefresh) {
|
|
1346
|
-
resolved = await coalesceProvider(options);
|
|
1347
|
-
}
|
|
1348
|
-
if (isConstant) {
|
|
1349
|
-
return resolved;
|
|
1350
|
-
}
|
|
1351
|
-
if (!requiresRefresh(resolved)) {
|
|
1352
|
-
isConstant = true;
|
|
1353
|
-
return resolved;
|
|
1354
|
-
}
|
|
1355
|
-
if (isExpired(resolved)) {
|
|
1356
|
-
await coalesceProvider(options);
|
|
1357
|
-
return resolved;
|
|
1358
|
-
}
|
|
1359
|
-
return resolved;
|
|
1360
|
-
};
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
// node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js
|
|
1364
|
-
var DEFAULT_UA_APP_ID = void 0;
|
|
1365
|
-
function isValidUserAgentAppId(appId) {
|
|
1366
|
-
if (appId === void 0) {
|
|
1367
|
-
return true;
|
|
1368
|
-
}
|
|
1369
|
-
return typeof appId === "string" && appId.length <= 50;
|
|
1370
|
-
}
|
|
1371
|
-
function resolveUserAgentConfig(input) {
|
|
1372
|
-
const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
|
|
1373
|
-
const { customUserAgent } = input;
|
|
1374
|
-
return Object.assign(input, {
|
|
1375
|
-
customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
|
|
1376
|
-
userAgentAppId: async () => {
|
|
1377
|
-
const appId = await normalizedAppIdProvider();
|
|
1378
|
-
if (!isValidUserAgentAppId(appId)) {
|
|
1379
|
-
const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
|
|
1380
|
-
if (typeof appId !== "string") {
|
|
1381
|
-
logger?.warn("userAgentAppId must be a string or undefined.");
|
|
1382
|
-
} else if (appId.length > 50) {
|
|
1383
|
-
logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
return appId;
|
|
1387
|
-
}
|
|
1388
|
-
});
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
// node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
|
|
1392
|
-
var EndpointCache = class {
|
|
1393
|
-
capacity;
|
|
1394
|
-
data = /* @__PURE__ */ new Map();
|
|
1395
|
-
parameters = [];
|
|
1396
|
-
constructor({ size, params }) {
|
|
1397
|
-
this.capacity = size ?? 50;
|
|
1398
|
-
if (params) {
|
|
1399
|
-
this.parameters = params;
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
get(endpointParams, resolver) {
|
|
1403
|
-
const key = this.hash(endpointParams);
|
|
1404
|
-
if (key === false) {
|
|
1405
|
-
return resolver();
|
|
1406
|
-
}
|
|
1407
|
-
if (!this.data.has(key)) {
|
|
1408
|
-
if (this.data.size > this.capacity + 10) {
|
|
1409
|
-
const keys = this.data.keys();
|
|
1410
|
-
let i = 0;
|
|
1411
|
-
while (true) {
|
|
1412
|
-
const { value, done } = keys.next();
|
|
1413
|
-
this.data.delete(value);
|
|
1414
|
-
if (done || ++i > 10) {
|
|
1415
|
-
break;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
this.data.set(key, resolver());
|
|
1420
|
-
}
|
|
1421
|
-
return this.data.get(key);
|
|
1422
|
-
}
|
|
1423
|
-
size() {
|
|
1424
|
-
return this.data.size;
|
|
1425
|
-
}
|
|
1426
|
-
hash(endpointParams) {
|
|
1427
|
-
let buffer = "";
|
|
1428
|
-
const { parameters } = this;
|
|
1429
|
-
if (parameters.length === 0) {
|
|
1430
|
-
return false;
|
|
1431
|
-
}
|
|
1432
|
-
for (const param of parameters) {
|
|
1433
|
-
const val = String(endpointParams[param] ?? "");
|
|
1434
|
-
if (val.includes("|;")) {
|
|
1435
|
-
return false;
|
|
1436
|
-
}
|
|
1437
|
-
buffer += val + "|;";
|
|
1438
|
-
}
|
|
1439
|
-
return buffer;
|
|
1440
|
-
}
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js
|
|
1444
|
-
var IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`);
|
|
1445
|
-
var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]");
|
|
1446
|
-
|
|
1447
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js
|
|
1448
|
-
var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
1449
|
-
var isValidHostLabel = (value, allowSubDomains = false) => {
|
|
1450
|
-
if (!allowSubDomains) {
|
|
1451
|
-
return VALID_HOST_LABEL_REGEX.test(value);
|
|
1452
|
-
}
|
|
1453
|
-
const labels = value.split(".");
|
|
1454
|
-
for (const label of labels) {
|
|
1455
|
-
if (!isValidHostLabel(label)) {
|
|
1456
|
-
return false;
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
return true;
|
|
1460
|
-
};
|
|
1461
|
-
|
|
1462
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js
|
|
1463
|
-
var customEndpointFunctions = {};
|
|
1464
|
-
|
|
1465
|
-
// node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js
|
|
1466
|
-
var debugId = "endpoints";
|
|
1467
|
-
|
|
1468
|
-
// node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js
|
|
1469
|
-
function toDebugString(input) {
|
|
1470
|
-
if (typeof input !== "object" || input == null) {
|
|
1471
|
-
return input;
|
|
1472
|
-
}
|
|
1473
|
-
if ("ref" in input) {
|
|
1474
|
-
return `$${toDebugString(input.ref)}`;
|
|
1475
|
-
}
|
|
1476
|
-
if ("fn" in input) {
|
|
1477
|
-
return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
|
|
1478
|
-
}
|
|
1479
|
-
return JSON.stringify(input, null, 2);
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
// node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js
|
|
1483
|
-
var EndpointError = class extends Error {
|
|
1484
|
-
constructor(message) {
|
|
1485
|
-
super(message);
|
|
1486
|
-
this.name = "EndpointError";
|
|
1487
|
-
}
|
|
1488
|
-
};
|
|
1489
|
-
|
|
1490
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js
|
|
1491
|
-
var booleanEquals = (value1, value2) => value1 === value2;
|
|
1492
|
-
|
|
1493
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js
|
|
1494
|
-
var getAttrPathList = (path) => {
|
|
1495
|
-
const parts = path.split(".");
|
|
1496
|
-
const pathList = [];
|
|
1497
|
-
for (const part of parts) {
|
|
1498
|
-
const squareBracketIndex = part.indexOf("[");
|
|
1499
|
-
if (squareBracketIndex !== -1) {
|
|
1500
|
-
if (part.indexOf("]") !== part.length - 1) {
|
|
1501
|
-
throw new EndpointError(`Path: '${path}' does not end with ']'`);
|
|
1502
|
-
}
|
|
1503
|
-
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
1504
|
-
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
1505
|
-
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
|
|
1506
|
-
}
|
|
1507
|
-
if (squareBracketIndex !== 0) {
|
|
1508
|
-
pathList.push(part.slice(0, squareBracketIndex));
|
|
1509
|
-
}
|
|
1510
|
-
pathList.push(arrayIndex);
|
|
1511
|
-
} else {
|
|
1512
|
-
pathList.push(part);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
return pathList;
|
|
1516
|
-
};
|
|
1517
|
-
|
|
1518
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js
|
|
1519
|
-
var getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
1520
|
-
if (typeof acc !== "object") {
|
|
1521
|
-
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
1522
|
-
} else if (Array.isArray(acc)) {
|
|
1523
|
-
return acc[parseInt(index)];
|
|
1524
|
-
}
|
|
1525
|
-
return acc[index];
|
|
1526
|
-
}, value);
|
|
1527
|
-
|
|
1528
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js
|
|
1529
|
-
var isSet = (value) => value != null;
|
|
1530
|
-
|
|
1531
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/not.js
|
|
1532
|
-
var not = (value) => !value;
|
|
1533
|
-
|
|
1534
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js
|
|
1535
|
-
var DEFAULT_PORTS = {
|
|
1536
|
-
[EndpointURLScheme.HTTP]: 80,
|
|
1537
|
-
[EndpointURLScheme.HTTPS]: 443
|
|
1538
|
-
};
|
|
1539
|
-
var parseURL = (value) => {
|
|
1540
|
-
const whatwgURL = (() => {
|
|
1541
|
-
try {
|
|
1542
|
-
if (value instanceof URL) {
|
|
1543
|
-
return value;
|
|
1544
|
-
}
|
|
1545
|
-
if (typeof value === "object" && "hostname" in value) {
|
|
1546
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
|
|
1547
|
-
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
|
|
1548
|
-
url.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&");
|
|
1549
|
-
return url;
|
|
1550
|
-
}
|
|
1551
|
-
return new URL(value);
|
|
1552
|
-
} catch (error) {
|
|
1553
|
-
return null;
|
|
1554
|
-
}
|
|
1555
|
-
})();
|
|
1556
|
-
if (!whatwgURL) {
|
|
1557
|
-
console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
|
|
1558
|
-
return null;
|
|
1559
|
-
}
|
|
1560
|
-
const urlString = whatwgURL.href;
|
|
1561
|
-
const { host, hostname, pathname, protocol, search } = whatwgURL;
|
|
1562
|
-
if (search) {
|
|
1563
|
-
return null;
|
|
1564
|
-
}
|
|
1565
|
-
const scheme = protocol.slice(0, -1);
|
|
1566
|
-
if (!Object.values(EndpointURLScheme).includes(scheme)) {
|
|
1567
|
-
return null;
|
|
1568
|
-
}
|
|
1569
|
-
const isIp = isIpAddress(hostname);
|
|
1570
|
-
const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`);
|
|
1571
|
-
const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
|
|
1572
|
-
return {
|
|
1573
|
-
scheme,
|
|
1574
|
-
authority,
|
|
1575
|
-
path: pathname,
|
|
1576
|
-
normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
|
|
1577
|
-
isIp
|
|
1578
|
-
};
|
|
1579
|
-
};
|
|
1580
|
-
|
|
1581
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js
|
|
1582
|
-
var stringEquals = (value1, value2) => value1 === value2;
|
|
1583
|
-
|
|
1584
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/substring.js
|
|
1585
|
-
var substring = (input, start, stop, reverse) => {
|
|
1586
|
-
if (start >= stop || input.length < stop) {
|
|
1587
|
-
return null;
|
|
1588
|
-
}
|
|
1589
|
-
if (!reverse) {
|
|
1590
|
-
return input.substring(start, stop);
|
|
1591
|
-
}
|
|
1592
|
-
return input.substring(input.length - stop, input.length - start);
|
|
1593
|
-
};
|
|
1594
|
-
|
|
1595
|
-
// node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js
|
|
1596
|
-
var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
1597
|
-
|
|
1598
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js
|
|
1599
|
-
var endpointFunctions = {
|
|
1600
|
-
booleanEquals,
|
|
1601
|
-
getAttr,
|
|
1602
|
-
isSet,
|
|
1603
|
-
isValidHostLabel,
|
|
1604
|
-
not,
|
|
1605
|
-
parseURL,
|
|
1606
|
-
stringEquals,
|
|
1607
|
-
substring,
|
|
1608
|
-
uriEncode
|
|
1609
|
-
};
|
|
1610
|
-
|
|
1611
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js
|
|
1612
|
-
var evaluateTemplate = (template, options) => {
|
|
1613
|
-
const evaluatedTemplateArr = [];
|
|
1614
|
-
const templateContext = {
|
|
1615
|
-
...options.endpointParams,
|
|
1616
|
-
...options.referenceRecord
|
|
1617
|
-
};
|
|
1618
|
-
let currentIndex = 0;
|
|
1619
|
-
while (currentIndex < template.length) {
|
|
1620
|
-
const openingBraceIndex = template.indexOf("{", currentIndex);
|
|
1621
|
-
if (openingBraceIndex === -1) {
|
|
1622
|
-
evaluatedTemplateArr.push(template.slice(currentIndex));
|
|
1623
|
-
break;
|
|
1624
|
-
}
|
|
1625
|
-
evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
|
|
1626
|
-
const closingBraceIndex = template.indexOf("}", openingBraceIndex);
|
|
1627
|
-
if (closingBraceIndex === -1) {
|
|
1628
|
-
evaluatedTemplateArr.push(template.slice(openingBraceIndex));
|
|
1629
|
-
break;
|
|
1630
|
-
}
|
|
1631
|
-
if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
|
|
1632
|
-
evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
|
|
1633
|
-
currentIndex = closingBraceIndex + 2;
|
|
1634
|
-
}
|
|
1635
|
-
const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
|
|
1636
|
-
if (parameterName.includes("#")) {
|
|
1637
|
-
const [refName, attrName] = parameterName.split("#");
|
|
1638
|
-
evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
|
|
1639
|
-
} else {
|
|
1640
|
-
evaluatedTemplateArr.push(templateContext[parameterName]);
|
|
1641
|
-
}
|
|
1642
|
-
currentIndex = closingBraceIndex + 1;
|
|
1643
|
-
}
|
|
1644
|
-
return evaluatedTemplateArr.join("");
|
|
1645
|
-
};
|
|
1646
|
-
|
|
1647
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js
|
|
1648
|
-
var getReferenceValue = ({ ref }, options) => {
|
|
1649
|
-
const referenceRecord = {
|
|
1650
|
-
...options.endpointParams,
|
|
1651
|
-
...options.referenceRecord
|
|
1652
|
-
};
|
|
1653
|
-
return referenceRecord[ref];
|
|
1654
|
-
};
|
|
1655
|
-
|
|
1656
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
|
|
1657
|
-
var evaluateExpression = (obj, keyName, options) => {
|
|
1658
|
-
if (typeof obj === "string") {
|
|
1659
|
-
return evaluateTemplate(obj, options);
|
|
1660
|
-
} else if (obj["fn"]) {
|
|
1661
|
-
return group.callFunction(obj, options);
|
|
1662
|
-
} else if (obj["ref"]) {
|
|
1663
|
-
return getReferenceValue(obj, options);
|
|
1664
|
-
}
|
|
1665
|
-
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
|
1666
|
-
};
|
|
1667
|
-
var callFunction = ({ fn, argv }, options) => {
|
|
1668
|
-
const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group.evaluateExpression(arg, "arg", options));
|
|
1669
|
-
const fnSegments = fn.split(".");
|
|
1670
|
-
if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
|
|
1671
|
-
return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
|
|
1672
|
-
}
|
|
1673
|
-
return endpointFunctions[fn](...evaluatedArgs);
|
|
1674
|
-
};
|
|
1675
|
-
var group = {
|
|
1676
|
-
evaluateExpression,
|
|
1677
|
-
callFunction
|
|
1678
|
-
};
|
|
1679
|
-
|
|
1680
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js
|
|
1681
|
-
var evaluateCondition = ({ assign, ...fnArgs }, options) => {
|
|
1682
|
-
if (assign && assign in options.referenceRecord) {
|
|
1683
|
-
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
|
|
1684
|
-
}
|
|
1685
|
-
const value = callFunction(fnArgs, options);
|
|
1686
|
-
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
|
|
1687
|
-
return {
|
|
1688
|
-
result: value === "" ? true : !!value,
|
|
1689
|
-
...assign != null && { toAssign: { name: assign, value } }
|
|
1690
|
-
};
|
|
1691
|
-
};
|
|
1692
|
-
|
|
1693
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js
|
|
1694
|
-
var evaluateConditions = (conditions = [], options) => {
|
|
1695
|
-
const conditionsReferenceRecord = {};
|
|
1696
|
-
for (const condition of conditions) {
|
|
1697
|
-
const { result, toAssign } = evaluateCondition(condition, {
|
|
1698
|
-
...options,
|
|
1699
|
-
referenceRecord: {
|
|
1700
|
-
...options.referenceRecord,
|
|
1701
|
-
...conditionsReferenceRecord
|
|
1702
|
-
}
|
|
1703
|
-
});
|
|
1704
|
-
if (!result) {
|
|
1705
|
-
return { result };
|
|
1706
|
-
}
|
|
1707
|
-
if (toAssign) {
|
|
1708
|
-
conditionsReferenceRecord[toAssign.name] = toAssign.value;
|
|
1709
|
-
options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
return { result: true, referenceRecord: conditionsReferenceRecord };
|
|
1713
|
-
};
|
|
1714
|
-
|
|
1715
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js
|
|
1716
|
-
var getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
|
|
1717
|
-
...acc,
|
|
1718
|
-
[headerKey]: headerVal.map((headerValEntry) => {
|
|
1719
|
-
const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
|
|
1720
|
-
if (typeof processedExpr !== "string") {
|
|
1721
|
-
throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
|
|
1722
|
-
}
|
|
1723
|
-
return processedExpr;
|
|
1724
|
-
})
|
|
1725
|
-
}), {});
|
|
1726
|
-
|
|
1727
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js
|
|
1728
|
-
var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({
|
|
1729
|
-
...acc,
|
|
1730
|
-
[propertyKey]: group2.getEndpointProperty(propertyVal, options)
|
|
1731
|
-
}), {});
|
|
1732
|
-
var getEndpointProperty = (property, options) => {
|
|
1733
|
-
if (Array.isArray(property)) {
|
|
1734
|
-
return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
|
|
1735
|
-
}
|
|
1736
|
-
switch (typeof property) {
|
|
1737
|
-
case "string":
|
|
1738
|
-
return evaluateTemplate(property, options);
|
|
1739
|
-
case "object":
|
|
1740
|
-
if (property === null) {
|
|
1741
|
-
throw new EndpointError(`Unexpected endpoint property: ${property}`);
|
|
1742
|
-
}
|
|
1743
|
-
return group2.getEndpointProperties(property, options);
|
|
1744
|
-
case "boolean":
|
|
1745
|
-
return property;
|
|
1746
|
-
default:
|
|
1747
|
-
throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
var group2 = {
|
|
1751
|
-
getEndpointProperty,
|
|
1752
|
-
getEndpointProperties
|
|
1753
|
-
};
|
|
1754
|
-
|
|
1755
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js
|
|
1756
|
-
var getEndpointUrl = (endpointUrl, options) => {
|
|
1757
|
-
const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
|
|
1758
|
-
if (typeof expression === "string") {
|
|
1759
|
-
try {
|
|
1760
|
-
return new URL(expression);
|
|
1761
|
-
} catch (error) {
|
|
1762
|
-
console.error(`Failed to construct URL with ${expression}`, error);
|
|
1763
|
-
throw error;
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
|
|
1767
|
-
};
|
|
1768
|
-
|
|
1769
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js
|
|
1770
|
-
var evaluateEndpointRule = (endpointRule, options) => {
|
|
1771
|
-
const { conditions, endpoint } = endpointRule;
|
|
1772
|
-
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
1773
|
-
if (!result) {
|
|
1774
|
-
return;
|
|
1775
|
-
}
|
|
1776
|
-
const endpointRuleOptions = {
|
|
1777
|
-
...options,
|
|
1778
|
-
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
|
|
1779
|
-
};
|
|
1780
|
-
const { url, properties, headers } = endpoint;
|
|
1781
|
-
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
|
|
1782
|
-
return {
|
|
1783
|
-
...headers != void 0 && {
|
|
1784
|
-
headers: getEndpointHeaders(headers, endpointRuleOptions)
|
|
1785
|
-
},
|
|
1786
|
-
...properties != void 0 && {
|
|
1787
|
-
properties: getEndpointProperties(properties, endpointRuleOptions)
|
|
1788
|
-
},
|
|
1789
|
-
url: getEndpointUrl(url, endpointRuleOptions)
|
|
1790
|
-
};
|
|
1791
|
-
};
|
|
1792
|
-
|
|
1793
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js
|
|
1794
|
-
var evaluateErrorRule = (errorRule, options) => {
|
|
1795
|
-
const { conditions, error } = errorRule;
|
|
1796
|
-
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
1797
|
-
if (!result) {
|
|
1798
|
-
return;
|
|
1799
|
-
}
|
|
1800
|
-
throw new EndpointError(evaluateExpression(error, "Error", {
|
|
1801
|
-
...options,
|
|
1802
|
-
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
|
|
1803
|
-
}));
|
|
1804
|
-
};
|
|
1805
|
-
|
|
1806
|
-
// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js
|
|
1807
|
-
var evaluateRules = (rules, options) => {
|
|
1808
|
-
for (const rule of rules) {
|
|
1809
|
-
if (rule.type === "endpoint") {
|
|
1810
|
-
const endpointOrUndefined = evaluateEndpointRule(rule, options);
|
|
1811
|
-
if (endpointOrUndefined) {
|
|
1812
|
-
return endpointOrUndefined;
|
|
1813
|
-
}
|
|
1814
|
-
} else if (rule.type === "error") {
|
|
1815
|
-
evaluateErrorRule(rule, options);
|
|
1816
|
-
} else if (rule.type === "tree") {
|
|
1817
|
-
const endpointOrUndefined = group3.evaluateTreeRule(rule, options);
|
|
1818
|
-
if (endpointOrUndefined) {
|
|
1819
|
-
return endpointOrUndefined;
|
|
1820
|
-
}
|
|
1821
|
-
} else {
|
|
1822
|
-
throw new EndpointError(`Unknown endpoint rule: ${rule}`);
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
throw new EndpointError(`Rules evaluation failed`);
|
|
1826
|
-
};
|
|
1827
|
-
var evaluateTreeRule = (treeRule, options) => {
|
|
1828
|
-
const { conditions, rules } = treeRule;
|
|
1829
|
-
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
1830
|
-
if (!result) {
|
|
1831
|
-
return;
|
|
1832
|
-
}
|
|
1833
|
-
return group3.evaluateRules(rules, {
|
|
1834
|
-
...options,
|
|
1835
|
-
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
|
|
1836
|
-
});
|
|
1837
|
-
};
|
|
1838
|
-
var group3 = {
|
|
1839
|
-
evaluateRules,
|
|
1840
|
-
evaluateTreeRule
|
|
1841
|
-
};
|
|
1842
|
-
|
|
1843
|
-
// node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js
|
|
1844
|
-
var resolveEndpoint = (ruleSetObject, options) => {
|
|
1845
|
-
const { endpointParams, logger } = options;
|
|
1846
|
-
const { parameters, rules } = ruleSetObject;
|
|
1847
|
-
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
1848
|
-
const paramsWithDefault = Object.entries(parameters).filter(([, v]) => v.default != null).map(([k, v]) => [k, v.default]);
|
|
1849
|
-
if (paramsWithDefault.length > 0) {
|
|
1850
|
-
for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
|
|
1851
|
-
endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
const requiredParams = Object.entries(parameters).filter(([, v]) => v.required).map(([k]) => k);
|
|
1855
|
-
for (const requiredParam of requiredParams) {
|
|
1856
|
-
if (endpointParams[requiredParam] == null) {
|
|
1857
|
-
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
|
|
1861
|
-
options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
|
|
1862
|
-
return endpoint;
|
|
1863
|
-
};
|
|
1864
|
-
|
|
1865
|
-
// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
|
|
1866
|
-
var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
1867
|
-
if (allowSubDomains) {
|
|
1868
|
-
for (const label of value.split(".")) {
|
|
1869
|
-
if (!isVirtualHostableS3Bucket(label)) {
|
|
1870
|
-
return false;
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
return true;
|
|
1874
|
-
}
|
|
1875
|
-
if (!isValidHostLabel(value)) {
|
|
1876
|
-
return false;
|
|
1877
|
-
}
|
|
1878
|
-
if (value.length < 3 || value.length > 63) {
|
|
1879
|
-
return false;
|
|
1880
|
-
}
|
|
1881
|
-
if (value !== value.toLowerCase()) {
|
|
1882
|
-
return false;
|
|
1883
|
-
}
|
|
1884
|
-
if (isIpAddress(value)) {
|
|
1885
|
-
return false;
|
|
1886
|
-
}
|
|
1887
|
-
return true;
|
|
1888
|
-
};
|
|
1889
|
-
|
|
1890
|
-
// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js
|
|
1891
|
-
var ARN_DELIMITER = ":";
|
|
1892
|
-
var RESOURCE_DELIMITER = "/";
|
|
1893
|
-
var parseArn = (value) => {
|
|
1894
|
-
const segments = value.split(ARN_DELIMITER);
|
|
1895
|
-
if (segments.length < 6)
|
|
1896
|
-
return null;
|
|
1897
|
-
const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
|
|
1898
|
-
if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
|
|
1899
|
-
return null;
|
|
1900
|
-
const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
|
|
1901
|
-
return {
|
|
1902
|
-
partition: partition2,
|
|
1903
|
-
service,
|
|
1904
|
-
region,
|
|
1905
|
-
accountId,
|
|
1906
|
-
resourceId
|
|
1907
|
-
};
|
|
1908
|
-
};
|
|
1909
|
-
|
|
1910
|
-
// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json
|
|
1911
|
-
var partitions_default = {
|
|
1912
|
-
partitions: [{
|
|
1913
|
-
id: "aws",
|
|
1914
|
-
outputs: {
|
|
1915
|
-
dnsSuffix: "amazonaws.com",
|
|
1916
|
-
dualStackDnsSuffix: "api.aws",
|
|
1917
|
-
implicitGlobalRegion: "us-east-1",
|
|
1918
|
-
name: "aws",
|
|
1919
|
-
supportsDualStack: true,
|
|
1920
|
-
supportsFIPS: true
|
|
1921
|
-
},
|
|
1922
|
-
regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
|
|
1923
|
-
regions: {
|
|
1924
|
-
"af-south-1": {
|
|
1925
|
-
description: "Africa (Cape Town)"
|
|
1926
|
-
},
|
|
1927
|
-
"ap-east-1": {
|
|
1928
|
-
description: "Asia Pacific (Hong Kong)"
|
|
1929
|
-
},
|
|
1930
|
-
"ap-east-2": {
|
|
1931
|
-
description: "Asia Pacific (Taipei)"
|
|
1932
|
-
},
|
|
1933
|
-
"ap-northeast-1": {
|
|
1934
|
-
description: "Asia Pacific (Tokyo)"
|
|
1935
|
-
},
|
|
1936
|
-
"ap-northeast-2": {
|
|
1937
|
-
description: "Asia Pacific (Seoul)"
|
|
1938
|
-
},
|
|
1939
|
-
"ap-northeast-3": {
|
|
1940
|
-
description: "Asia Pacific (Osaka)"
|
|
1941
|
-
},
|
|
1942
|
-
"ap-south-1": {
|
|
1943
|
-
description: "Asia Pacific (Mumbai)"
|
|
1944
|
-
},
|
|
1945
|
-
"ap-south-2": {
|
|
1946
|
-
description: "Asia Pacific (Hyderabad)"
|
|
1947
|
-
},
|
|
1948
|
-
"ap-southeast-1": {
|
|
1949
|
-
description: "Asia Pacific (Singapore)"
|
|
1950
|
-
},
|
|
1951
|
-
"ap-southeast-2": {
|
|
1952
|
-
description: "Asia Pacific (Sydney)"
|
|
1953
|
-
},
|
|
1954
|
-
"ap-southeast-3": {
|
|
1955
|
-
description: "Asia Pacific (Jakarta)"
|
|
1956
|
-
},
|
|
1957
|
-
"ap-southeast-4": {
|
|
1958
|
-
description: "Asia Pacific (Melbourne)"
|
|
1959
|
-
},
|
|
1960
|
-
"ap-southeast-5": {
|
|
1961
|
-
description: "Asia Pacific (Malaysia)"
|
|
1962
|
-
},
|
|
1963
|
-
"ap-southeast-7": {
|
|
1964
|
-
description: "Asia Pacific (Thailand)"
|
|
1965
|
-
},
|
|
1966
|
-
"aws-global": {
|
|
1967
|
-
description: "AWS Standard global region"
|
|
1968
|
-
},
|
|
1969
|
-
"ca-central-1": {
|
|
1970
|
-
description: "Canada (Central)"
|
|
1971
|
-
},
|
|
1972
|
-
"ca-west-1": {
|
|
1973
|
-
description: "Canada West (Calgary)"
|
|
1974
|
-
},
|
|
1975
|
-
"eu-central-1": {
|
|
1976
|
-
description: "Europe (Frankfurt)"
|
|
1977
|
-
},
|
|
1978
|
-
"eu-central-2": {
|
|
1979
|
-
description: "Europe (Zurich)"
|
|
1980
|
-
},
|
|
1981
|
-
"eu-north-1": {
|
|
1982
|
-
description: "Europe (Stockholm)"
|
|
1983
|
-
},
|
|
1984
|
-
"eu-south-1": {
|
|
1985
|
-
description: "Europe (Milan)"
|
|
1986
|
-
},
|
|
1987
|
-
"eu-south-2": {
|
|
1988
|
-
description: "Europe (Spain)"
|
|
1989
|
-
},
|
|
1990
|
-
"eu-west-1": {
|
|
1991
|
-
description: "Europe (Ireland)"
|
|
1992
|
-
},
|
|
1993
|
-
"eu-west-2": {
|
|
1994
|
-
description: "Europe (London)"
|
|
1995
|
-
},
|
|
1996
|
-
"eu-west-3": {
|
|
1997
|
-
description: "Europe (Paris)"
|
|
1998
|
-
},
|
|
1999
|
-
"il-central-1": {
|
|
2000
|
-
description: "Israel (Tel Aviv)"
|
|
2001
|
-
},
|
|
2002
|
-
"me-central-1": {
|
|
2003
|
-
description: "Middle East (UAE)"
|
|
2004
|
-
},
|
|
2005
|
-
"me-south-1": {
|
|
2006
|
-
description: "Middle East (Bahrain)"
|
|
2007
|
-
},
|
|
2008
|
-
"mx-central-1": {
|
|
2009
|
-
description: "Mexico (Central)"
|
|
2010
|
-
},
|
|
2011
|
-
"sa-east-1": {
|
|
2012
|
-
description: "South America (Sao Paulo)"
|
|
2013
|
-
},
|
|
2014
|
-
"us-east-1": {
|
|
2015
|
-
description: "US East (N. Virginia)"
|
|
2016
|
-
},
|
|
2017
|
-
"us-east-2": {
|
|
2018
|
-
description: "US East (Ohio)"
|
|
2019
|
-
},
|
|
2020
|
-
"us-west-1": {
|
|
2021
|
-
description: "US West (N. California)"
|
|
2022
|
-
},
|
|
2023
|
-
"us-west-2": {
|
|
2024
|
-
description: "US West (Oregon)"
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
}, {
|
|
2028
|
-
id: "aws-cn",
|
|
2029
|
-
outputs: {
|
|
2030
|
-
dnsSuffix: "amazonaws.com.cn",
|
|
2031
|
-
dualStackDnsSuffix: "api.amazonwebservices.com.cn",
|
|
2032
|
-
implicitGlobalRegion: "cn-northwest-1",
|
|
2033
|
-
name: "aws-cn",
|
|
2034
|
-
supportsDualStack: true,
|
|
2035
|
-
supportsFIPS: true
|
|
2036
|
-
},
|
|
2037
|
-
regionRegex: "^cn\\-\\w+\\-\\d+$",
|
|
2038
|
-
regions: {
|
|
2039
|
-
"aws-cn-global": {
|
|
2040
|
-
description: "AWS China global region"
|
|
2041
|
-
},
|
|
2042
|
-
"cn-north-1": {
|
|
2043
|
-
description: "China (Beijing)"
|
|
2044
|
-
},
|
|
2045
|
-
"cn-northwest-1": {
|
|
2046
|
-
description: "China (Ningxia)"
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
}, {
|
|
2050
|
-
id: "aws-us-gov",
|
|
2051
|
-
outputs: {
|
|
2052
|
-
dnsSuffix: "amazonaws.com",
|
|
2053
|
-
dualStackDnsSuffix: "api.aws",
|
|
2054
|
-
implicitGlobalRegion: "us-gov-west-1",
|
|
2055
|
-
name: "aws-us-gov",
|
|
2056
|
-
supportsDualStack: true,
|
|
2057
|
-
supportsFIPS: true
|
|
2058
|
-
},
|
|
2059
|
-
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
|
|
2060
|
-
regions: {
|
|
2061
|
-
"aws-us-gov-global": {
|
|
2062
|
-
description: "AWS GovCloud (US) global region"
|
|
2063
|
-
},
|
|
2064
|
-
"us-gov-east-1": {
|
|
2065
|
-
description: "AWS GovCloud (US-East)"
|
|
2066
|
-
},
|
|
2067
|
-
"us-gov-west-1": {
|
|
2068
|
-
description: "AWS GovCloud (US-West)"
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
}, {
|
|
2072
|
-
id: "aws-iso",
|
|
2073
|
-
outputs: {
|
|
2074
|
-
dnsSuffix: "c2s.ic.gov",
|
|
2075
|
-
dualStackDnsSuffix: "c2s.ic.gov",
|
|
2076
|
-
implicitGlobalRegion: "us-iso-east-1",
|
|
2077
|
-
name: "aws-iso",
|
|
2078
|
-
supportsDualStack: false,
|
|
2079
|
-
supportsFIPS: true
|
|
2080
|
-
},
|
|
2081
|
-
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
|
|
2082
|
-
regions: {
|
|
2083
|
-
"aws-iso-global": {
|
|
2084
|
-
description: "AWS ISO (US) global region"
|
|
2085
|
-
},
|
|
2086
|
-
"us-iso-east-1": {
|
|
2087
|
-
description: "US ISO East"
|
|
2088
|
-
},
|
|
2089
|
-
"us-iso-west-1": {
|
|
2090
|
-
description: "US ISO WEST"
|
|
2091
|
-
}
|
|
2092
|
-
}
|
|
2093
|
-
}, {
|
|
2094
|
-
id: "aws-iso-b",
|
|
2095
|
-
outputs: {
|
|
2096
|
-
dnsSuffix: "sc2s.sgov.gov",
|
|
2097
|
-
dualStackDnsSuffix: "sc2s.sgov.gov",
|
|
2098
|
-
implicitGlobalRegion: "us-isob-east-1",
|
|
2099
|
-
name: "aws-iso-b",
|
|
2100
|
-
supportsDualStack: false,
|
|
2101
|
-
supportsFIPS: true
|
|
2102
|
-
},
|
|
2103
|
-
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
|
|
2104
|
-
regions: {
|
|
2105
|
-
"aws-iso-b-global": {
|
|
2106
|
-
description: "AWS ISOB (US) global region"
|
|
2107
|
-
},
|
|
2108
|
-
"us-isob-east-1": {
|
|
2109
|
-
description: "US ISOB East (Ohio)"
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
}, {
|
|
2113
|
-
id: "aws-iso-e",
|
|
2114
|
-
outputs: {
|
|
2115
|
-
dnsSuffix: "cloud.adc-e.uk",
|
|
2116
|
-
dualStackDnsSuffix: "cloud.adc-e.uk",
|
|
2117
|
-
implicitGlobalRegion: "eu-isoe-west-1",
|
|
2118
|
-
name: "aws-iso-e",
|
|
2119
|
-
supportsDualStack: false,
|
|
2120
|
-
supportsFIPS: true
|
|
2121
|
-
},
|
|
2122
|
-
regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
|
|
2123
|
-
regions: {
|
|
2124
|
-
"aws-iso-e-global": {
|
|
2125
|
-
description: "AWS ISOE (Europe) global region"
|
|
2126
|
-
},
|
|
2127
|
-
"eu-isoe-west-1": {
|
|
2128
|
-
description: "EU ISOE West"
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
}, {
|
|
2132
|
-
id: "aws-iso-f",
|
|
2133
|
-
outputs: {
|
|
2134
|
-
dnsSuffix: "csp.hci.ic.gov",
|
|
2135
|
-
dualStackDnsSuffix: "csp.hci.ic.gov",
|
|
2136
|
-
implicitGlobalRegion: "us-isof-south-1",
|
|
2137
|
-
name: "aws-iso-f",
|
|
2138
|
-
supportsDualStack: false,
|
|
2139
|
-
supportsFIPS: true
|
|
2140
|
-
},
|
|
2141
|
-
regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
|
|
2142
|
-
regions: {
|
|
2143
|
-
"aws-iso-f-global": {
|
|
2144
|
-
description: "AWS ISOF global region"
|
|
2145
|
-
},
|
|
2146
|
-
"us-isof-east-1": {
|
|
2147
|
-
description: "US ISOF EAST"
|
|
2148
|
-
},
|
|
2149
|
-
"us-isof-south-1": {
|
|
2150
|
-
description: "US ISOF SOUTH"
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
}, {
|
|
2154
|
-
id: "aws-eusc",
|
|
2155
|
-
outputs: {
|
|
2156
|
-
dnsSuffix: "amazonaws.eu",
|
|
2157
|
-
dualStackDnsSuffix: "amazonaws.eu",
|
|
2158
|
-
implicitGlobalRegion: "eusc-de-east-1",
|
|
2159
|
-
name: "aws-eusc",
|
|
2160
|
-
supportsDualStack: false,
|
|
2161
|
-
supportsFIPS: true
|
|
2162
|
-
},
|
|
2163
|
-
regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$",
|
|
2164
|
-
regions: {
|
|
2165
|
-
"eusc-de-east-1": {
|
|
2166
|
-
description: "EU (Germany)"
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
}],
|
|
2170
|
-
version: "1.1"
|
|
2171
|
-
};
|
|
2172
|
-
|
|
2173
|
-
// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js
|
|
2174
|
-
var selectedPartitionsInfo = partitions_default;
|
|
2175
|
-
var selectedUserAgentPrefix = "";
|
|
2176
|
-
var partition = (value) => {
|
|
2177
|
-
const { partitions } = selectedPartitionsInfo;
|
|
2178
|
-
for (const partition2 of partitions) {
|
|
2179
|
-
const { regions, outputs } = partition2;
|
|
2180
|
-
for (const [region, regionData] of Object.entries(regions)) {
|
|
2181
|
-
if (region === value) {
|
|
2182
|
-
return {
|
|
2183
|
-
...outputs,
|
|
2184
|
-
...regionData
|
|
2185
|
-
};
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
}
|
|
2189
|
-
for (const partition2 of partitions) {
|
|
2190
|
-
const { regionRegex, outputs } = partition2;
|
|
2191
|
-
if (new RegExp(regionRegex).test(value)) {
|
|
2192
|
-
return {
|
|
2193
|
-
...outputs
|
|
2194
|
-
};
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
|
|
2198
|
-
if (!DEFAULT_PARTITION) {
|
|
2199
|
-
throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");
|
|
2200
|
-
}
|
|
2201
|
-
return {
|
|
2202
|
-
...DEFAULT_PARTITION.outputs
|
|
2203
|
-
};
|
|
2204
|
-
};
|
|
2205
|
-
var getUserAgentPrefix = () => selectedUserAgentPrefix;
|
|
2206
|
-
|
|
2207
|
-
// node_modules/@aws-sdk/util-endpoints/dist-es/aws.js
|
|
2208
|
-
var awsEndpointFunctions = {
|
|
2209
|
-
isVirtualHostableS3Bucket,
|
|
2210
|
-
parseArn,
|
|
2211
|
-
partition
|
|
2212
|
-
};
|
|
2213
|
-
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
2214
|
-
|
|
2215
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
|
|
2216
|
-
var state = {
|
|
2217
|
-
warningEmitted: false
|
|
2218
|
-
};
|
|
2219
|
-
var emitWarningIfUnsupportedVersion = (version) => {
|
|
2220
|
-
if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
|
|
2221
|
-
state.warningEmitted = true;
|
|
2222
|
-
process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
2223
|
-
no longer support Node.js 16.x on January 6, 2025.
|
|
2224
|
-
|
|
2225
|
-
To continue receiving updates to AWS services, bug fixes, and security
|
|
2226
|
-
updates please upgrade to a supported Node.js LTS version.
|
|
2227
|
-
|
|
2228
|
-
More information can be found at: https://a.co/74kJMmI`);
|
|
2229
|
-
}
|
|
2230
|
-
};
|
|
2231
|
-
|
|
2232
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
|
|
2233
|
-
function setFeature2(context, feature, value) {
|
|
2234
|
-
if (!context.__aws_sdk_context) {
|
|
2235
|
-
context.__aws_sdk_context = {
|
|
2236
|
-
features: {}
|
|
2237
|
-
};
|
|
2238
|
-
} else if (!context.__aws_sdk_context.features) {
|
|
2239
|
-
context.__aws_sdk_context.features = {};
|
|
2240
|
-
}
|
|
2241
|
-
context.__aws_sdk_context.features[feature] = value;
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js
|
|
2245
|
-
var getDateHeader = (response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0;
|
|
2246
|
-
|
|
2247
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js
|
|
2248
|
-
var getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
|
|
2249
|
-
|
|
2250
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js
|
|
2251
|
-
var isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5;
|
|
2252
|
-
|
|
2253
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js
|
|
2254
|
-
var getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {
|
|
2255
|
-
const clockTimeInMs = Date.parse(clockTime);
|
|
2256
|
-
if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
|
|
2257
|
-
return clockTimeInMs - Date.now();
|
|
2258
|
-
}
|
|
2259
|
-
return currentSystemClockOffset;
|
|
2260
|
-
};
|
|
2261
|
-
|
|
2262
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js
|
|
2263
|
-
var throwSigningPropertyError = (name, property) => {
|
|
2264
|
-
if (!property) {
|
|
2265
|
-
throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
|
|
2266
|
-
}
|
|
2267
|
-
return property;
|
|
2268
|
-
};
|
|
2269
|
-
var validateSigningProperties = async (signingProperties) => {
|
|
2270
|
-
const context = throwSigningPropertyError("context", signingProperties.context);
|
|
2271
|
-
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
2272
|
-
const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
|
|
2273
|
-
const signerFunction = throwSigningPropertyError("signer", config.signer);
|
|
2274
|
-
const signer = await signerFunction(authScheme);
|
|
2275
|
-
const signingRegion = signingProperties?.signingRegion;
|
|
2276
|
-
const signingRegionSet = signingProperties?.signingRegionSet;
|
|
2277
|
-
const signingName = signingProperties?.signingName;
|
|
2278
|
-
return {
|
|
2279
|
-
config,
|
|
2280
|
-
signer,
|
|
2281
|
-
signingRegion,
|
|
2282
|
-
signingRegionSet,
|
|
2283
|
-
signingName
|
|
2284
|
-
};
|
|
2285
|
-
};
|
|
2286
|
-
var AwsSdkSigV4Signer = class {
|
|
2287
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
2288
|
-
if (!HttpRequest.isInstance(httpRequest)) {
|
|
2289
|
-
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
2290
|
-
}
|
|
2291
|
-
const validatedProps = await validateSigningProperties(signingProperties);
|
|
2292
|
-
const { config, signer } = validatedProps;
|
|
2293
|
-
let { signingRegion, signingName } = validatedProps;
|
|
2294
|
-
const handlerExecutionContext = signingProperties.context;
|
|
2295
|
-
if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
|
|
2296
|
-
const [first, second] = handlerExecutionContext.authSchemes;
|
|
2297
|
-
if (first?.name === "sigv4a" && second?.name === "sigv4") {
|
|
2298
|
-
signingRegion = second?.signingRegion ?? signingRegion;
|
|
2299
|
-
signingName = second?.signingName ?? signingName;
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
const signedRequest = await signer.sign(httpRequest, {
|
|
2303
|
-
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
2304
|
-
signingRegion,
|
|
2305
|
-
signingService: signingName
|
|
2306
|
-
});
|
|
2307
|
-
return signedRequest;
|
|
2308
|
-
}
|
|
2309
|
-
errorHandler(signingProperties) {
|
|
2310
|
-
return (error) => {
|
|
2311
|
-
const serverTime = error.ServerTime ?? getDateHeader(error.$response);
|
|
2312
|
-
if (serverTime) {
|
|
2313
|
-
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
2314
|
-
const initialSystemClockOffset = config.systemClockOffset;
|
|
2315
|
-
config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
|
|
2316
|
-
const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
|
|
2317
|
-
if (clockSkewCorrected && error.$metadata) {
|
|
2318
|
-
error.$metadata.clockSkewCorrected = true;
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
throw error;
|
|
2322
|
-
};
|
|
2323
|
-
}
|
|
2324
|
-
successHandler(httpResponse, signingProperties) {
|
|
2325
|
-
const dateHeader = getDateHeader(httpResponse);
|
|
2326
|
-
if (dateHeader) {
|
|
2327
|
-
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
2328
|
-
config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
};
|
|
2332
|
-
|
|
2333
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js
|
|
2334
|
-
var AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer {
|
|
2335
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
2336
|
-
if (!HttpRequest.isInstance(httpRequest)) {
|
|
2337
|
-
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
2338
|
-
}
|
|
2339
|
-
const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
|
|
2340
|
-
const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
|
|
2341
|
-
const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
|
|
2342
|
-
const signedRequest = await signer.sign(httpRequest, {
|
|
2343
|
-
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
2344
|
-
signingRegion: multiRegionOverride,
|
|
2345
|
-
signingService: signingName
|
|
2346
|
-
});
|
|
2347
|
-
return signedRequest;
|
|
2348
|
-
}
|
|
2349
|
-
};
|
|
2350
|
-
|
|
2351
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js
|
|
2352
|
-
var getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : [];
|
|
2353
|
-
|
|
2354
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js
|
|
2355
|
-
var getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`;
|
|
2356
|
-
|
|
2357
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js
|
|
2358
|
-
var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE";
|
|
2359
|
-
var NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference";
|
|
2360
|
-
var NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
|
|
2361
|
-
environmentVariableSelector: (env2, options) => {
|
|
2362
|
-
if (options?.signingName) {
|
|
2363
|
-
const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
|
|
2364
|
-
if (bearerTokenKey in env2)
|
|
2365
|
-
return ["httpBearerAuth"];
|
|
2366
|
-
}
|
|
2367
|
-
if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env2))
|
|
2368
|
-
return void 0;
|
|
2369
|
-
return getArrayForCommaSeparatedString(env2[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
|
|
2370
|
-
},
|
|
2371
|
-
configFileSelector: (profile) => {
|
|
2372
|
-
if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))
|
|
2373
|
-
return void 0;
|
|
2374
|
-
return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
|
|
2375
|
-
},
|
|
2376
|
-
default: []
|
|
2377
|
-
};
|
|
2378
|
-
|
|
2379
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js
|
|
2380
|
-
var resolveAwsSdkSigV4AConfig = (config) => {
|
|
2381
|
-
config.sigv4aSigningRegionSet = normalizeProvider2(config.sigv4aSigningRegionSet);
|
|
2382
|
-
return config;
|
|
2383
|
-
};
|
|
2384
|
-
var NODE_SIGV4A_CONFIG_OPTIONS = {
|
|
2385
|
-
environmentVariableSelector(env2) {
|
|
2386
|
-
if (env2.AWS_SIGV4A_SIGNING_REGION_SET) {
|
|
2387
|
-
return env2.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
|
|
2388
|
-
}
|
|
2389
|
-
throw new ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
|
|
2390
|
-
tryNextLink: true
|
|
2391
|
-
});
|
|
2392
|
-
},
|
|
2393
|
-
configFileSelector(profile) {
|
|
2394
|
-
if (profile.sigv4a_signing_region_set) {
|
|
2395
|
-
return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
|
|
2396
|
-
}
|
|
2397
|
-
throw new ProviderError("sigv4a_signing_region_set not set in profile.", {
|
|
2398
|
-
tryNextLink: true
|
|
2399
|
-
});
|
|
2400
|
-
},
|
|
2401
|
-
default: void 0
|
|
2402
|
-
};
|
|
2403
|
-
|
|
2404
|
-
// node_modules/@smithy/signature-v4/dist-es/constants.js
|
|
2405
|
-
var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
|
|
2406
|
-
var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
|
|
2407
|
-
var AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
|
|
2408
|
-
var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
|
|
2409
|
-
var EXPIRES_QUERY_PARAM = "X-Amz-Expires";
|
|
2410
|
-
var SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
|
|
2411
|
-
var TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
|
|
2412
|
-
var AUTH_HEADER = "authorization";
|
|
2413
|
-
var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();
|
|
2414
|
-
var DATE_HEADER = "date";
|
|
2415
|
-
var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];
|
|
2416
|
-
var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();
|
|
2417
|
-
var SHA256_HEADER = "x-amz-content-sha256";
|
|
2418
|
-
var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();
|
|
2419
|
-
var ALWAYS_UNSIGNABLE_HEADERS = {
|
|
2420
|
-
authorization: true,
|
|
2421
|
-
"cache-control": true,
|
|
2422
|
-
connection: true,
|
|
2423
|
-
expect: true,
|
|
2424
|
-
from: true,
|
|
2425
|
-
"keep-alive": true,
|
|
2426
|
-
"max-forwards": true,
|
|
2427
|
-
pragma: true,
|
|
2428
|
-
referer: true,
|
|
2429
|
-
te: true,
|
|
2430
|
-
trailer: true,
|
|
2431
|
-
"transfer-encoding": true,
|
|
2432
|
-
upgrade: true,
|
|
2433
|
-
"user-agent": true,
|
|
2434
|
-
"x-amzn-trace-id": true
|
|
2435
|
-
};
|
|
2436
|
-
var PROXY_HEADER_PATTERN = /^proxy-/;
|
|
2437
|
-
var SEC_HEADER_PATTERN = /^sec-/;
|
|
2438
|
-
var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
|
|
2439
|
-
var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
|
|
2440
|
-
var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
|
|
2441
|
-
var MAX_CACHE_SIZE = 50;
|
|
2442
|
-
var KEY_TYPE_IDENTIFIER = "aws4_request";
|
|
2443
|
-
var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
|
|
2444
|
-
|
|
2445
|
-
// node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js
|
|
2446
|
-
var signingKeyCache = {};
|
|
2447
|
-
var cacheQueue = [];
|
|
2448
|
-
var createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;
|
|
2449
|
-
var getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => {
|
|
2450
|
-
const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
|
|
2451
|
-
const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;
|
|
2452
|
-
if (cacheKey in signingKeyCache) {
|
|
2453
|
-
return signingKeyCache[cacheKey];
|
|
2454
|
-
}
|
|
2455
|
-
cacheQueue.push(cacheKey);
|
|
2456
|
-
while (cacheQueue.length > MAX_CACHE_SIZE) {
|
|
2457
|
-
delete signingKeyCache[cacheQueue.shift()];
|
|
2458
|
-
}
|
|
2459
|
-
let key = `AWS4${credentials.secretAccessKey}`;
|
|
2460
|
-
for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {
|
|
2461
|
-
key = await hmac(sha256Constructor, key, signable);
|
|
2462
|
-
}
|
|
2463
|
-
return signingKeyCache[cacheKey] = key;
|
|
2464
|
-
};
|
|
2465
|
-
var hmac = (ctor, secret, data) => {
|
|
2466
|
-
const hash = new ctor(secret);
|
|
2467
|
-
hash.update(toUint8Array(data));
|
|
2468
|
-
return hash.digest();
|
|
2469
|
-
};
|
|
2470
|
-
|
|
2471
|
-
// node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js
|
|
2472
|
-
var getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => {
|
|
2473
|
-
const canonical = {};
|
|
2474
|
-
for (const headerName of Object.keys(headers).sort()) {
|
|
2475
|
-
if (headers[headerName] == void 0) {
|
|
2476
|
-
continue;
|
|
2477
|
-
}
|
|
2478
|
-
const canonicalHeaderName = headerName.toLowerCase();
|
|
2479
|
-
if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
|
|
2480
|
-
if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {
|
|
2481
|
-
continue;
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " ");
|
|
2485
|
-
}
|
|
2486
|
-
return canonical;
|
|
2487
|
-
};
|
|
2488
|
-
|
|
2489
|
-
// node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js
|
|
2490
|
-
var getPayloadHash = async ({ headers, body }, hashConstructor) => {
|
|
2491
|
-
for (const headerName of Object.keys(headers)) {
|
|
2492
|
-
if (headerName.toLowerCase() === SHA256_HEADER) {
|
|
2493
|
-
return headers[headerName];
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
if (body == void 0) {
|
|
2497
|
-
return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
|
2498
|
-
} else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {
|
|
2499
|
-
const hashCtor = new hashConstructor();
|
|
2500
|
-
hashCtor.update(toUint8Array(body));
|
|
2501
|
-
return toHex(await hashCtor.digest());
|
|
2502
|
-
}
|
|
2503
|
-
return UNSIGNED_PAYLOAD;
|
|
2504
|
-
};
|
|
2505
|
-
|
|
2506
|
-
// node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js
|
|
2507
|
-
var HeaderFormatter = class {
|
|
2508
|
-
format(headers) {
|
|
2509
|
-
const chunks = [];
|
|
2510
|
-
for (const headerName of Object.keys(headers)) {
|
|
2511
|
-
const bytes = fromUtf8(headerName);
|
|
2512
|
-
chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
|
|
2513
|
-
}
|
|
2514
|
-
const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
|
|
2515
|
-
let position = 0;
|
|
2516
|
-
for (const chunk of chunks) {
|
|
2517
|
-
out.set(chunk, position);
|
|
2518
|
-
position += chunk.byteLength;
|
|
2519
|
-
}
|
|
2520
|
-
return out;
|
|
2521
|
-
}
|
|
2522
|
-
formatHeaderValue(header) {
|
|
2523
|
-
switch (header.type) {
|
|
2524
|
-
case "boolean":
|
|
2525
|
-
return Uint8Array.from([header.value ? 0 : 1]);
|
|
2526
|
-
case "byte":
|
|
2527
|
-
return Uint8Array.from([2, header.value]);
|
|
2528
|
-
case "short":
|
|
2529
|
-
const shortView = new DataView(new ArrayBuffer(3));
|
|
2530
|
-
shortView.setUint8(0, 3);
|
|
2531
|
-
shortView.setInt16(1, header.value, false);
|
|
2532
|
-
return new Uint8Array(shortView.buffer);
|
|
2533
|
-
case "integer":
|
|
2534
|
-
const intView = new DataView(new ArrayBuffer(5));
|
|
2535
|
-
intView.setUint8(0, 4);
|
|
2536
|
-
intView.setInt32(1, header.value, false);
|
|
2537
|
-
return new Uint8Array(intView.buffer);
|
|
2538
|
-
case "long":
|
|
2539
|
-
const longBytes = new Uint8Array(9);
|
|
2540
|
-
longBytes[0] = 5;
|
|
2541
|
-
longBytes.set(header.value.bytes, 1);
|
|
2542
|
-
return longBytes;
|
|
2543
|
-
case "binary":
|
|
2544
|
-
const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
|
|
2545
|
-
binView.setUint8(0, 6);
|
|
2546
|
-
binView.setUint16(1, header.value.byteLength, false);
|
|
2547
|
-
const binBytes = new Uint8Array(binView.buffer);
|
|
2548
|
-
binBytes.set(header.value, 3);
|
|
2549
|
-
return binBytes;
|
|
2550
|
-
case "string":
|
|
2551
|
-
const utf8Bytes = fromUtf8(header.value);
|
|
2552
|
-
const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
|
|
2553
|
-
strView.setUint8(0, 7);
|
|
2554
|
-
strView.setUint16(1, utf8Bytes.byteLength, false);
|
|
2555
|
-
const strBytes = new Uint8Array(strView.buffer);
|
|
2556
|
-
strBytes.set(utf8Bytes, 3);
|
|
2557
|
-
return strBytes;
|
|
2558
|
-
case "timestamp":
|
|
2559
|
-
const tsBytes = new Uint8Array(9);
|
|
2560
|
-
tsBytes[0] = 8;
|
|
2561
|
-
tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
|
|
2562
|
-
return tsBytes;
|
|
2563
|
-
case "uuid":
|
|
2564
|
-
if (!UUID_PATTERN.test(header.value)) {
|
|
2565
|
-
throw new Error(`Invalid UUID received: ${header.value}`);
|
|
2566
|
-
}
|
|
2567
|
-
const uuidBytes = new Uint8Array(17);
|
|
2568
|
-
uuidBytes[0] = 9;
|
|
2569
|
-
uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
|
|
2570
|
-
return uuidBytes;
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
};
|
|
2574
|
-
var HEADER_VALUE_TYPE;
|
|
2575
|
-
(function(HEADER_VALUE_TYPE2) {
|
|
2576
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolTrue"] = 0] = "boolTrue";
|
|
2577
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolFalse"] = 1] = "boolFalse";
|
|
2578
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byte"] = 2] = "byte";
|
|
2579
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["short"] = 3] = "short";
|
|
2580
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["integer"] = 4] = "integer";
|
|
2581
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["long"] = 5] = "long";
|
|
2582
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byteArray"] = 6] = "byteArray";
|
|
2583
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["string"] = 7] = "string";
|
|
2584
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["timestamp"] = 8] = "timestamp";
|
|
2585
|
-
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["uuid"] = 9] = "uuid";
|
|
2586
|
-
})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
|
|
2587
|
-
var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
|
|
2588
|
-
var Int64 = class _Int64 {
|
|
2589
|
-
bytes;
|
|
2590
|
-
constructor(bytes) {
|
|
2591
|
-
this.bytes = bytes;
|
|
2592
|
-
if (bytes.byteLength !== 8) {
|
|
2593
|
-
throw new Error("Int64 buffers must be exactly 8 bytes");
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
static fromNumber(number) {
|
|
2597
|
-
if (number > 9223372036854776e3 || number < -9223372036854776e3) {
|
|
2598
|
-
throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
|
|
2599
|
-
}
|
|
2600
|
-
const bytes = new Uint8Array(8);
|
|
2601
|
-
for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
|
|
2602
|
-
bytes[i] = remaining;
|
|
2603
|
-
}
|
|
2604
|
-
if (number < 0) {
|
|
2605
|
-
negate(bytes);
|
|
2606
|
-
}
|
|
2607
|
-
return new _Int64(bytes);
|
|
2608
|
-
}
|
|
2609
|
-
valueOf() {
|
|
2610
|
-
const bytes = this.bytes.slice(0);
|
|
2611
|
-
const negative = bytes[0] & 128;
|
|
2612
|
-
if (negative) {
|
|
2613
|
-
negate(bytes);
|
|
2614
|
-
}
|
|
2615
|
-
return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
|
|
2616
|
-
}
|
|
2617
|
-
toString() {
|
|
2618
|
-
return String(this.valueOf());
|
|
2619
|
-
}
|
|
2620
|
-
};
|
|
2621
|
-
function negate(bytes) {
|
|
2622
|
-
for (let i = 0; i < 8; i++) {
|
|
2623
|
-
bytes[i] ^= 255;
|
|
2624
|
-
}
|
|
2625
|
-
for (let i = 7; i > -1; i--) {
|
|
2626
|
-
bytes[i]++;
|
|
2627
|
-
if (bytes[i] !== 0)
|
|
2628
|
-
break;
|
|
2629
|
-
}
|
|
2630
|
-
}
|
|
2631
|
-
|
|
2632
|
-
// node_modules/@smithy/signature-v4/dist-es/headerUtil.js
|
|
2633
|
-
var hasHeader = (soughtHeader, headers) => {
|
|
2634
|
-
soughtHeader = soughtHeader.toLowerCase();
|
|
2635
|
-
for (const headerName of Object.keys(headers)) {
|
|
2636
|
-
if (soughtHeader === headerName.toLowerCase()) {
|
|
2637
|
-
return true;
|
|
2638
|
-
}
|
|
2639
|
-
}
|
|
2640
|
-
return false;
|
|
2641
|
-
};
|
|
2642
|
-
|
|
2643
|
-
// node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js
|
|
2644
|
-
var moveHeadersToQuery = (request, options = {}) => {
|
|
2645
|
-
const { headers, query = {} } = HttpRequest.clone(request);
|
|
2646
|
-
for (const name of Object.keys(headers)) {
|
|
2647
|
-
const lname = name.toLowerCase();
|
|
2648
|
-
if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) {
|
|
2649
|
-
query[name] = headers[name];
|
|
2650
|
-
delete headers[name];
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
return {
|
|
2654
|
-
...request,
|
|
2655
|
-
headers,
|
|
2656
|
-
query
|
|
2657
|
-
};
|
|
2658
|
-
};
|
|
2659
|
-
|
|
2660
|
-
// node_modules/@smithy/signature-v4/dist-es/prepareRequest.js
|
|
2661
|
-
var prepareRequest = (request) => {
|
|
2662
|
-
request = HttpRequest.clone(request);
|
|
2663
|
-
for (const headerName of Object.keys(request.headers)) {
|
|
2664
|
-
if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
|
|
2665
|
-
delete request.headers[headerName];
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
return request;
|
|
2669
|
-
};
|
|
2670
|
-
|
|
2671
|
-
// node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js
|
|
2672
|
-
var getCanonicalQuery = ({ query = {} }) => {
|
|
2673
|
-
const keys = [];
|
|
2674
|
-
const serialized = {};
|
|
2675
|
-
for (const key of Object.keys(query)) {
|
|
2676
|
-
if (key.toLowerCase() === SIGNATURE_HEADER) {
|
|
2677
|
-
continue;
|
|
2678
|
-
}
|
|
2679
|
-
const encodedKey = escapeUri(key);
|
|
2680
|
-
keys.push(encodedKey);
|
|
2681
|
-
const value = query[key];
|
|
2682
|
-
if (typeof value === "string") {
|
|
2683
|
-
serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
|
|
2684
|
-
} else if (Array.isArray(value)) {
|
|
2685
|
-
serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&");
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&");
|
|
2689
|
-
};
|
|
2690
|
-
|
|
2691
|
-
// node_modules/@smithy/signature-v4/dist-es/utilDate.js
|
|
2692
|
-
var iso8601 = (time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
2693
|
-
var toDate = (time) => {
|
|
2694
|
-
if (typeof time === "number") {
|
|
2695
|
-
return new Date(time * 1e3);
|
|
2696
|
-
}
|
|
2697
|
-
if (typeof time === "string") {
|
|
2698
|
-
if (Number(time)) {
|
|
2699
|
-
return new Date(Number(time) * 1e3);
|
|
2700
|
-
}
|
|
2701
|
-
return new Date(time);
|
|
2702
|
-
}
|
|
2703
|
-
return time;
|
|
2704
|
-
};
|
|
2705
|
-
|
|
2706
|
-
// node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js
|
|
2707
|
-
var SignatureV4Base = class {
|
|
2708
|
-
service;
|
|
2709
|
-
regionProvider;
|
|
2710
|
-
credentialProvider;
|
|
2711
|
-
sha256;
|
|
2712
|
-
uriEscapePath;
|
|
2713
|
-
applyChecksum;
|
|
2714
|
-
constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
|
|
2715
|
-
this.service = service;
|
|
2716
|
-
this.sha256 = sha256;
|
|
2717
|
-
this.uriEscapePath = uriEscapePath;
|
|
2718
|
-
this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
|
|
2719
|
-
this.regionProvider = normalizeProvider(region);
|
|
2720
|
-
this.credentialProvider = normalizeProvider(credentials);
|
|
2721
|
-
}
|
|
2722
|
-
createCanonicalRequest(request, canonicalHeaders, payloadHash) {
|
|
2723
|
-
const sortedHeaders = Object.keys(canonicalHeaders).sort();
|
|
2724
|
-
return `${request.method}
|
|
2725
|
-
${this.getCanonicalPath(request)}
|
|
2726
|
-
${getCanonicalQuery(request)}
|
|
2727
|
-
${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")}
|
|
2728
|
-
|
|
2729
|
-
${sortedHeaders.join(";")}
|
|
2730
|
-
${payloadHash}`;
|
|
2731
|
-
}
|
|
2732
|
-
async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) {
|
|
2733
|
-
const hash = new this.sha256();
|
|
2734
|
-
hash.update(toUint8Array(canonicalRequest));
|
|
2735
|
-
const hashedRequest = await hash.digest();
|
|
2736
|
-
return `${algorithmIdentifier}
|
|
2737
|
-
${longDate}
|
|
2738
|
-
${credentialScope}
|
|
2739
|
-
${toHex(hashedRequest)}`;
|
|
2740
|
-
}
|
|
2741
|
-
getCanonicalPath({ path }) {
|
|
2742
|
-
if (this.uriEscapePath) {
|
|
2743
|
-
const normalizedPathSegments = [];
|
|
2744
|
-
for (const pathSegment of path.split("/")) {
|
|
2745
|
-
if (pathSegment?.length === 0)
|
|
2746
|
-
continue;
|
|
2747
|
-
if (pathSegment === ".")
|
|
2748
|
-
continue;
|
|
2749
|
-
if (pathSegment === "..") {
|
|
2750
|
-
normalizedPathSegments.pop();
|
|
2751
|
-
} else {
|
|
2752
|
-
normalizedPathSegments.push(pathSegment);
|
|
2753
|
-
}
|
|
2754
|
-
}
|
|
2755
|
-
const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`;
|
|
2756
|
-
const doubleEncoded = escapeUri(normalizedPath);
|
|
2757
|
-
return doubleEncoded.replace(/%2F/g, "/");
|
|
2758
|
-
}
|
|
2759
|
-
return path;
|
|
2760
|
-
}
|
|
2761
|
-
validateResolvedCredentials(credentials) {
|
|
2762
|
-
if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
|
|
2763
|
-
throw new Error("Resolved credential object is not valid");
|
|
2764
|
-
}
|
|
2765
|
-
}
|
|
2766
|
-
formatDate(now) {
|
|
2767
|
-
const longDate = iso8601(now).replace(/[\-:]/g, "");
|
|
2768
|
-
return {
|
|
2769
|
-
longDate,
|
|
2770
|
-
shortDate: longDate.slice(0, 8)
|
|
2771
|
-
};
|
|
2772
|
-
}
|
|
2773
|
-
getCanonicalHeaderList(headers) {
|
|
2774
|
-
return Object.keys(headers).sort().join(";");
|
|
2775
|
-
}
|
|
2776
|
-
};
|
|
2777
|
-
|
|
2778
|
-
// node_modules/@smithy/signature-v4/dist-es/SignatureV4.js
|
|
2779
|
-
var SignatureV4 = class extends SignatureV4Base {
|
|
2780
|
-
headerFormatter = new HeaderFormatter();
|
|
2781
|
-
constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
|
|
2782
|
-
super({
|
|
2783
|
-
applyChecksum,
|
|
2784
|
-
credentials,
|
|
2785
|
-
region,
|
|
2786
|
-
service,
|
|
2787
|
-
sha256,
|
|
2788
|
-
uriEscapePath
|
|
2789
|
-
});
|
|
2790
|
-
}
|
|
2791
|
-
async presign(originalRequest, options = {}) {
|
|
2792
|
-
const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options;
|
|
2793
|
-
const credentials = await this.credentialProvider();
|
|
2794
|
-
this.validateResolvedCredentials(credentials);
|
|
2795
|
-
const region = signingRegion ?? await this.regionProvider();
|
|
2796
|
-
const { longDate, shortDate } = this.formatDate(signingDate);
|
|
2797
|
-
if (expiresIn > MAX_PRESIGNED_TTL) {
|
|
2798
|
-
return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");
|
|
2799
|
-
}
|
|
2800
|
-
const scope = createScope(shortDate, region, signingService ?? this.service);
|
|
2801
|
-
const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders });
|
|
2802
|
-
if (credentials.sessionToken) {
|
|
2803
|
-
request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
2804
|
-
}
|
|
2805
|
-
request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;
|
|
2806
|
-
request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;
|
|
2807
|
-
request.query[AMZ_DATE_QUERY_PARAM] = longDate;
|
|
2808
|
-
request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);
|
|
2809
|
-
const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
|
|
2810
|
-
request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders);
|
|
2811
|
-
request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)));
|
|
2812
|
-
return request;
|
|
2813
|
-
}
|
|
2814
|
-
async sign(toSign, options) {
|
|
2815
|
-
if (typeof toSign === "string") {
|
|
2816
|
-
return this.signString(toSign, options);
|
|
2817
|
-
} else if (toSign.headers && toSign.payload) {
|
|
2818
|
-
return this.signEvent(toSign, options);
|
|
2819
|
-
} else if (toSign.message) {
|
|
2820
|
-
return this.signMessage(toSign, options);
|
|
2821
|
-
} else {
|
|
2822
|
-
return this.signRequest(toSign, options);
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) {
|
|
2826
|
-
const region = signingRegion ?? await this.regionProvider();
|
|
2827
|
-
const { shortDate, longDate } = this.formatDate(signingDate);
|
|
2828
|
-
const scope = createScope(shortDate, region, signingService ?? this.service);
|
|
2829
|
-
const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);
|
|
2830
|
-
const hash = new this.sha256();
|
|
2831
|
-
hash.update(headers);
|
|
2832
|
-
const hashedHeaders = toHex(await hash.digest());
|
|
2833
|
-
const stringToSign = [
|
|
2834
|
-
EVENT_ALGORITHM_IDENTIFIER,
|
|
2835
|
-
longDate,
|
|
2836
|
-
scope,
|
|
2837
|
-
priorSignature,
|
|
2838
|
-
hashedHeaders,
|
|
2839
|
-
hashedPayload
|
|
2840
|
-
].join("\n");
|
|
2841
|
-
return this.signString(stringToSign, { signingDate, signingRegion: region, signingService });
|
|
2842
|
-
}
|
|
2843
|
-
async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) {
|
|
2844
|
-
const promise = this.signEvent({
|
|
2845
|
-
headers: this.headerFormatter.format(signableMessage.message.headers),
|
|
2846
|
-
payload: signableMessage.message.body
|
|
2847
|
-
}, {
|
|
2848
|
-
signingDate,
|
|
2849
|
-
signingRegion,
|
|
2850
|
-
signingService,
|
|
2851
|
-
priorSignature: signableMessage.priorSignature
|
|
2852
|
-
});
|
|
2853
|
-
return promise.then((signature) => {
|
|
2854
|
-
return { message: signableMessage.message, signature };
|
|
2855
|
-
});
|
|
2856
|
-
}
|
|
2857
|
-
async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) {
|
|
2858
|
-
const credentials = await this.credentialProvider();
|
|
2859
|
-
this.validateResolvedCredentials(credentials);
|
|
2860
|
-
const region = signingRegion ?? await this.regionProvider();
|
|
2861
|
-
const { shortDate } = this.formatDate(signingDate);
|
|
2862
|
-
const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
|
|
2863
|
-
hash.update(toUint8Array(stringToSign));
|
|
2864
|
-
return toHex(await hash.digest());
|
|
2865
|
-
}
|
|
2866
|
-
async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) {
|
|
2867
|
-
const credentials = await this.credentialProvider();
|
|
2868
|
-
this.validateResolvedCredentials(credentials);
|
|
2869
|
-
const region = signingRegion ?? await this.regionProvider();
|
|
2870
|
-
const request = prepareRequest(requestToSign);
|
|
2871
|
-
const { longDate, shortDate } = this.formatDate(signingDate);
|
|
2872
|
-
const scope = createScope(shortDate, region, signingService ?? this.service);
|
|
2873
|
-
request.headers[AMZ_DATE_HEADER] = longDate;
|
|
2874
|
-
if (credentials.sessionToken) {
|
|
2875
|
-
request.headers[TOKEN_HEADER] = credentials.sessionToken;
|
|
2876
|
-
}
|
|
2877
|
-
const payloadHash = await getPayloadHash(request, this.sha256);
|
|
2878
|
-
if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {
|
|
2879
|
-
request.headers[SHA256_HEADER] = payloadHash;
|
|
2880
|
-
}
|
|
2881
|
-
const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
|
|
2882
|
-
const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash));
|
|
2883
|
-
request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;
|
|
2884
|
-
return request;
|
|
2885
|
-
}
|
|
2886
|
-
async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
|
|
2887
|
-
const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER);
|
|
2888
|
-
const hash = new this.sha256(await keyPromise);
|
|
2889
|
-
hash.update(toUint8Array(stringToSign));
|
|
2890
|
-
return toHex(await hash.digest());
|
|
2891
|
-
}
|
|
2892
|
-
getSigningKey(credentials, region, shortDate, service) {
|
|
2893
|
-
return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
|
|
2894
|
-
}
|
|
2895
|
-
};
|
|
2896
|
-
|
|
2897
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js
|
|
2898
|
-
var resolveAwsSdkSigV4Config = (config) => {
|
|
2899
|
-
let inputCredentials = config.credentials;
|
|
2900
|
-
let isUserSupplied = !!config.credentials;
|
|
2901
|
-
let resolvedCredentials = void 0;
|
|
2902
|
-
Object.defineProperty(config, "credentials", {
|
|
2903
|
-
set(credentials) {
|
|
2904
|
-
if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {
|
|
2905
|
-
isUserSupplied = true;
|
|
2906
|
-
}
|
|
2907
|
-
inputCredentials = credentials;
|
|
2908
|
-
const memoizedProvider = normalizeCredentialProvider(config, {
|
|
2909
|
-
credentials: inputCredentials,
|
|
2910
|
-
credentialDefaultProvider: config.credentialDefaultProvider
|
|
2911
|
-
});
|
|
2912
|
-
const boundProvider = bindCallerConfig(config, memoizedProvider);
|
|
2913
|
-
if (isUserSupplied && !boundProvider.attributed) {
|
|
2914
|
-
resolvedCredentials = async (options) => boundProvider(options).then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e"));
|
|
2915
|
-
resolvedCredentials.memoized = boundProvider.memoized;
|
|
2916
|
-
resolvedCredentials.configBound = boundProvider.configBound;
|
|
2917
|
-
resolvedCredentials.attributed = true;
|
|
2918
|
-
} else {
|
|
2919
|
-
resolvedCredentials = boundProvider;
|
|
2920
|
-
}
|
|
2921
|
-
},
|
|
2922
|
-
get() {
|
|
2923
|
-
return resolvedCredentials;
|
|
2924
|
-
},
|
|
2925
|
-
enumerable: true,
|
|
2926
|
-
configurable: true
|
|
2927
|
-
});
|
|
2928
|
-
config.credentials = inputCredentials;
|
|
2929
|
-
const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config;
|
|
2930
|
-
let signer;
|
|
2931
|
-
if (config.signer) {
|
|
2932
|
-
signer = normalizeProvider2(config.signer);
|
|
2933
|
-
} else if (config.regionInfoProvider) {
|
|
2934
|
-
signer = () => normalizeProvider2(config.region)().then(async (region) => [
|
|
2935
|
-
await config.regionInfoProvider(region, {
|
|
2936
|
-
useFipsEndpoint: await config.useFipsEndpoint(),
|
|
2937
|
-
useDualstackEndpoint: await config.useDualstackEndpoint()
|
|
2938
|
-
}) || {},
|
|
2939
|
-
region
|
|
2940
|
-
]).then(([regionInfo, region]) => {
|
|
2941
|
-
const { signingRegion, signingService } = regionInfo;
|
|
2942
|
-
config.signingRegion = config.signingRegion || signingRegion || region;
|
|
2943
|
-
config.signingName = config.signingName || signingService || config.serviceId;
|
|
2944
|
-
const params = {
|
|
2945
|
-
...config,
|
|
2946
|
-
credentials: config.credentials,
|
|
2947
|
-
region: config.signingRegion,
|
|
2948
|
-
service: config.signingName,
|
|
2949
|
-
sha256,
|
|
2950
|
-
uriEscapePath: signingEscapePath
|
|
2951
|
-
};
|
|
2952
|
-
const SignerCtor = config.signerConstructor || SignatureV4;
|
|
2953
|
-
return new SignerCtor(params);
|
|
2954
|
-
});
|
|
2955
|
-
} else {
|
|
2956
|
-
signer = async (authScheme) => {
|
|
2957
|
-
authScheme = Object.assign({}, {
|
|
2958
|
-
name: "sigv4",
|
|
2959
|
-
signingName: config.signingName || config.defaultSigningName,
|
|
2960
|
-
signingRegion: await normalizeProvider2(config.region)(),
|
|
2961
|
-
properties: {}
|
|
2962
|
-
}, authScheme);
|
|
2963
|
-
const signingRegion = authScheme.signingRegion;
|
|
2964
|
-
const signingService = authScheme.signingName;
|
|
2965
|
-
config.signingRegion = config.signingRegion || signingRegion;
|
|
2966
|
-
config.signingName = config.signingName || signingService || config.serviceId;
|
|
2967
|
-
const params = {
|
|
2968
|
-
...config,
|
|
2969
|
-
credentials: config.credentials,
|
|
2970
|
-
region: config.signingRegion,
|
|
2971
|
-
service: config.signingName,
|
|
2972
|
-
sha256,
|
|
2973
|
-
uriEscapePath: signingEscapePath
|
|
2974
|
-
};
|
|
2975
|
-
const SignerCtor = config.signerConstructor || SignatureV4;
|
|
2976
|
-
return new SignerCtor(params);
|
|
2977
|
-
};
|
|
2978
|
-
}
|
|
2979
|
-
const resolvedConfig = Object.assign(config, {
|
|
2980
|
-
systemClockOffset,
|
|
2981
|
-
signingEscapePath,
|
|
2982
|
-
signer
|
|
2983
|
-
});
|
|
2984
|
-
return resolvedConfig;
|
|
2985
|
-
};
|
|
2986
|
-
function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider }) {
|
|
2987
|
-
let credentialsProvider;
|
|
2988
|
-
if (credentials) {
|
|
2989
|
-
if (!credentials?.memoized) {
|
|
2990
|
-
credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh);
|
|
2991
|
-
} else {
|
|
2992
|
-
credentialsProvider = credentials;
|
|
2993
|
-
}
|
|
2994
|
-
} else {
|
|
2995
|
-
if (credentialDefaultProvider) {
|
|
2996
|
-
credentialsProvider = normalizeProvider2(credentialDefaultProvider(Object.assign({}, config, {
|
|
2997
|
-
parentClientConfig: config
|
|
2998
|
-
})));
|
|
2999
|
-
} else {
|
|
3000
|
-
credentialsProvider = async () => {
|
|
3001
|
-
throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.");
|
|
3002
|
-
};
|
|
3003
|
-
}
|
|
3004
|
-
}
|
|
3005
|
-
credentialsProvider.memoized = true;
|
|
3006
|
-
return credentialsProvider;
|
|
3007
|
-
}
|
|
3008
|
-
function bindCallerConfig(config, credentialsProvider) {
|
|
3009
|
-
if (credentialsProvider.configBound) {
|
|
3010
|
-
return credentialsProvider;
|
|
3011
|
-
}
|
|
3012
|
-
const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config });
|
|
3013
|
-
fn.memoized = credentialsProvider.memoized;
|
|
3014
|
-
fn.configBound = true;
|
|
3015
|
-
return fn;
|
|
3016
|
-
}
|
|
3017
|
-
|
|
3018
|
-
// node_modules/@smithy/smithy-client/dist-es/default-error-handler.js
|
|
3019
|
-
var throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => {
|
|
3020
|
-
const $metadata = deserializeMetadata(output);
|
|
3021
|
-
const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0;
|
|
3022
|
-
const response = new exceptionCtor({
|
|
3023
|
-
name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
|
|
3024
|
-
$fault: "client",
|
|
3025
|
-
$metadata
|
|
3026
|
-
});
|
|
3027
|
-
throw decorateServiceException(response, parsedBody);
|
|
3028
|
-
};
|
|
3029
|
-
var withBaseException = (ExceptionCtor) => {
|
|
3030
|
-
return ({ output, parsedBody, errorCode }) => {
|
|
3031
|
-
throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });
|
|
3032
|
-
};
|
|
3033
|
-
};
|
|
3034
|
-
var deserializeMetadata = (output) => ({
|
|
3035
|
-
httpStatusCode: output.statusCode,
|
|
3036
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
3037
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
3038
|
-
cfId: output.headers["x-amz-cf-id"]
|
|
3039
|
-
});
|
|
3040
|
-
|
|
3041
|
-
// node_modules/@smithy/smithy-client/dist-es/defaults-mode.js
|
|
3042
|
-
var loadConfigsForDefaultMode = (mode) => {
|
|
3043
|
-
switch (mode) {
|
|
3044
|
-
case "standard":
|
|
3045
|
-
return {
|
|
3046
|
-
retryMode: "standard",
|
|
3047
|
-
connectionTimeout: 3100
|
|
3048
|
-
};
|
|
3049
|
-
case "in-region":
|
|
3050
|
-
return {
|
|
3051
|
-
retryMode: "standard",
|
|
3052
|
-
connectionTimeout: 1100
|
|
3053
|
-
};
|
|
3054
|
-
case "cross-region":
|
|
3055
|
-
return {
|
|
3056
|
-
retryMode: "standard",
|
|
3057
|
-
connectionTimeout: 3100
|
|
3058
|
-
};
|
|
3059
|
-
case "mobile":
|
|
3060
|
-
return {
|
|
3061
|
-
retryMode: "standard",
|
|
3062
|
-
connectionTimeout: 3e4
|
|
3063
|
-
};
|
|
3064
|
-
default:
|
|
3065
|
-
return {};
|
|
3066
|
-
}
|
|
3067
|
-
};
|
|
3068
|
-
|
|
3069
|
-
// node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js
|
|
3070
|
-
var warningEmitted = false;
|
|
3071
|
-
var emitWarningIfUnsupportedVersion2 = (version) => {
|
|
3072
|
-
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
|
|
3073
|
-
warningEmitted = true;
|
|
3074
|
-
}
|
|
3075
|
-
};
|
|
3076
|
-
|
|
3077
|
-
// node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
|
|
3078
|
-
var getChecksumConfiguration = (runtimeConfig) => {
|
|
3079
|
-
const checksumAlgorithms = [];
|
|
3080
|
-
for (const id in AlgorithmId) {
|
|
3081
|
-
const algorithmId = AlgorithmId[id];
|
|
3082
|
-
if (runtimeConfig[algorithmId] === void 0) {
|
|
3083
|
-
continue;
|
|
3084
|
-
}
|
|
3085
|
-
checksumAlgorithms.push({
|
|
3086
|
-
algorithmId: () => algorithmId,
|
|
3087
|
-
checksumConstructor: () => runtimeConfig[algorithmId]
|
|
3088
|
-
});
|
|
3089
|
-
}
|
|
3090
|
-
return {
|
|
3091
|
-
addChecksumAlgorithm(algo) {
|
|
3092
|
-
checksumAlgorithms.push(algo);
|
|
3093
|
-
},
|
|
3094
|
-
checksumAlgorithms() {
|
|
3095
|
-
return checksumAlgorithms;
|
|
3096
|
-
}
|
|
3097
|
-
};
|
|
3098
|
-
};
|
|
3099
|
-
var resolveChecksumRuntimeConfig = (clientConfig) => {
|
|
3100
|
-
const runtimeConfig = {};
|
|
3101
|
-
clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
|
|
3102
|
-
runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
|
|
3103
|
-
});
|
|
3104
|
-
return runtimeConfig;
|
|
3105
|
-
};
|
|
3106
|
-
|
|
3107
|
-
// node_modules/@smithy/smithy-client/dist-es/extensions/retry.js
|
|
3108
|
-
var getRetryConfiguration = (runtimeConfig) => {
|
|
3109
|
-
return {
|
|
3110
|
-
setRetryStrategy(retryStrategy) {
|
|
3111
|
-
runtimeConfig.retryStrategy = retryStrategy;
|
|
3112
|
-
},
|
|
3113
|
-
retryStrategy() {
|
|
3114
|
-
return runtimeConfig.retryStrategy;
|
|
3115
|
-
}
|
|
3116
|
-
};
|
|
3117
|
-
};
|
|
3118
|
-
var resolveRetryRuntimeConfig = (retryStrategyConfiguration) => {
|
|
3119
|
-
const runtimeConfig = {};
|
|
3120
|
-
runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
|
|
3121
|
-
return runtimeConfig;
|
|
3122
|
-
};
|
|
3123
|
-
|
|
3124
|
-
// node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js
|
|
3125
|
-
var getDefaultExtensionConfiguration = (runtimeConfig) => {
|
|
3126
|
-
return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));
|
|
3127
|
-
};
|
|
3128
|
-
var resolveDefaultRuntimeConfig = (config) => {
|
|
3129
|
-
return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
|
|
3130
|
-
};
|
|
3131
|
-
|
|
3132
|
-
// node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js
|
|
3133
|
-
var NoOpLogger = class {
|
|
3134
|
-
trace() {
|
|
3135
|
-
}
|
|
3136
|
-
debug() {
|
|
3137
|
-
}
|
|
3138
|
-
info() {
|
|
3139
|
-
}
|
|
3140
|
-
warn() {
|
|
3141
|
-
}
|
|
3142
|
-
error() {
|
|
3143
|
-
}
|
|
3144
|
-
};
|
|
3145
|
-
|
|
3146
|
-
// node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js
|
|
3147
|
-
var collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
3148
|
-
|
|
3149
|
-
// node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js
|
|
3150
|
-
var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
|
|
3151
|
-
async function checkFeatures(context, config, args) {
|
|
3152
|
-
const request = args.request;
|
|
3153
|
-
if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
|
|
3154
|
-
setFeature2(context, "PROTOCOL_RPC_V2_CBOR", "M");
|
|
3155
|
-
}
|
|
3156
|
-
if (typeof config.retryStrategy === "function") {
|
|
3157
|
-
const retryStrategy = await config.retryStrategy();
|
|
3158
|
-
if (typeof retryStrategy.acquireInitialRetryToken === "function") {
|
|
3159
|
-
if (retryStrategy.constructor?.name?.includes("Adaptive")) {
|
|
3160
|
-
setFeature2(context, "RETRY_MODE_ADAPTIVE", "F");
|
|
3161
|
-
} else {
|
|
3162
|
-
setFeature2(context, "RETRY_MODE_STANDARD", "E");
|
|
3163
|
-
}
|
|
3164
|
-
} else {
|
|
3165
|
-
setFeature2(context, "RETRY_MODE_LEGACY", "D");
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
if (typeof config.accountIdEndpointMode === "function") {
|
|
3169
|
-
const endpointV2 = context.endpointV2;
|
|
3170
|
-
if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
|
|
3171
|
-
setFeature2(context, "ACCOUNT_ID_ENDPOINT", "O");
|
|
3172
|
-
}
|
|
3173
|
-
switch (await config.accountIdEndpointMode?.()) {
|
|
3174
|
-
case "disabled":
|
|
3175
|
-
setFeature2(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
|
|
3176
|
-
break;
|
|
3177
|
-
case "preferred":
|
|
3178
|
-
setFeature2(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
|
|
3179
|
-
break;
|
|
3180
|
-
case "required":
|
|
3181
|
-
setFeature2(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
|
|
3182
|
-
break;
|
|
3183
|
-
}
|
|
3184
|
-
}
|
|
3185
|
-
const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
|
|
3186
|
-
if (identity?.$source) {
|
|
3187
|
-
const credentials = identity;
|
|
3188
|
-
if (credentials.accountId) {
|
|
3189
|
-
setFeature2(context, "RESOLVED_ACCOUNT_ID", "T");
|
|
3190
|
-
}
|
|
3191
|
-
for (const [key, value] of Object.entries(credentials.$source ?? {})) {
|
|
3192
|
-
setFeature2(context, key, value);
|
|
3193
|
-
}
|
|
3194
|
-
}
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
// node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
|
|
3198
|
-
var USER_AGENT = "user-agent";
|
|
3199
|
-
var X_AMZ_USER_AGENT = "x-amz-user-agent";
|
|
3200
|
-
var SPACE = " ";
|
|
3201
|
-
var UA_NAME_SEPARATOR = "/";
|
|
3202
|
-
var UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
|
|
3203
|
-
var UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
|
|
3204
|
-
var UA_ESCAPE_CHAR = "-";
|
|
3205
|
-
|
|
3206
|
-
// node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js
|
|
3207
|
-
var BYTE_LIMIT = 1024;
|
|
3208
|
-
function encodeFeatures(features) {
|
|
3209
|
-
let buffer = "";
|
|
3210
|
-
for (const key in features) {
|
|
3211
|
-
const val = features[key];
|
|
3212
|
-
if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
|
|
3213
|
-
if (buffer.length) {
|
|
3214
|
-
buffer += "," + val;
|
|
3215
|
-
} else {
|
|
3216
|
-
buffer += val;
|
|
3217
|
-
}
|
|
3218
|
-
continue;
|
|
3219
|
-
}
|
|
3220
|
-
break;
|
|
3221
|
-
}
|
|
3222
|
-
return buffer;
|
|
3223
|
-
}
|
|
3224
|
-
|
|
3225
|
-
// node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
|
|
3226
|
-
var userAgentMiddleware = (options) => (next, context) => async (args) => {
|
|
3227
|
-
const { request } = args;
|
|
3228
|
-
if (!HttpRequest.isInstance(request)) {
|
|
3229
|
-
return next(args);
|
|
3230
|
-
}
|
|
3231
|
-
const { headers } = request;
|
|
3232
|
-
const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
|
|
3233
|
-
const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
|
|
3234
|
-
await checkFeatures(context, options, args);
|
|
3235
|
-
const awsContext = context;
|
|
3236
|
-
defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
|
|
3237
|
-
const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
|
|
3238
|
-
const appId = await options.userAgentAppId();
|
|
3239
|
-
if (appId) {
|
|
3240
|
-
defaultUserAgent.push(escapeUserAgent([`app/${appId}`]));
|
|
3241
|
-
}
|
|
3242
|
-
const prefix = getUserAgentPrefix();
|
|
3243
|
-
const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE);
|
|
3244
|
-
const normalUAValue = [
|
|
3245
|
-
...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
|
|
3246
|
-
...customUserAgent
|
|
3247
|
-
].join(SPACE);
|
|
3248
|
-
if (options.runtime !== "browser") {
|
|
3249
|
-
if (normalUAValue) {
|
|
3250
|
-
headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
|
|
3251
|
-
}
|
|
3252
|
-
headers[USER_AGENT] = sdkUserAgentValue;
|
|
3253
|
-
} else {
|
|
3254
|
-
headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
|
|
3255
|
-
}
|
|
3256
|
-
return next({
|
|
3257
|
-
...args,
|
|
3258
|
-
request
|
|
3259
|
-
});
|
|
3260
|
-
};
|
|
3261
|
-
var escapeUserAgent = (userAgentPair) => {
|
|
3262
|
-
const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
|
|
3263
|
-
const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
|
|
3264
|
-
const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
|
|
3265
|
-
const prefix = name.substring(0, prefixSeparatorIndex);
|
|
3266
|
-
let uaName = name.substring(prefixSeparatorIndex + 1);
|
|
3267
|
-
if (prefix === "api") {
|
|
3268
|
-
uaName = uaName.toLowerCase();
|
|
3269
|
-
}
|
|
3270
|
-
return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
|
|
3271
|
-
switch (index) {
|
|
3272
|
-
case 0:
|
|
3273
|
-
return item;
|
|
3274
|
-
case 1:
|
|
3275
|
-
return `${acc}/${item}`;
|
|
3276
|
-
default:
|
|
3277
|
-
return `${acc}#${item}`;
|
|
3278
|
-
}
|
|
3279
|
-
}, "");
|
|
3280
|
-
};
|
|
3281
|
-
var getUserAgentMiddlewareOptions = {
|
|
3282
|
-
name: "getUserAgentMiddleware",
|
|
3283
|
-
step: "build",
|
|
3284
|
-
priority: "low",
|
|
3285
|
-
tags: ["SET_USER_AGENT", "USER_AGENT"],
|
|
3286
|
-
override: true
|
|
3287
|
-
};
|
|
3288
|
-
var getUserAgentPlugin = (config) => ({
|
|
3289
|
-
applyToStack: (clientStack) => {
|
|
3290
|
-
clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
|
|
3291
|
-
}
|
|
3292
|
-
});
|
|
3293
|
-
|
|
3294
|
-
// node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js
|
|
3295
|
-
var validRegions = /* @__PURE__ */ new Set();
|
|
3296
|
-
var checkRegion = (region, check = isValidHostLabel) => {
|
|
3297
|
-
if (!validRegions.has(region) && !check(region)) {
|
|
3298
|
-
if (region === "*") {
|
|
3299
|
-
console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`);
|
|
3300
|
-
} else {
|
|
3301
|
-
throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`);
|
|
3302
|
-
}
|
|
3303
|
-
} else {
|
|
3304
|
-
validRegions.add(region);
|
|
3305
|
-
}
|
|
3306
|
-
};
|
|
3307
|
-
|
|
3308
|
-
// node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js
|
|
3309
|
-
var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips"));
|
|
3310
|
-
|
|
3311
|
-
// node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js
|
|
3312
|
-
var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region;
|
|
3313
|
-
|
|
3314
|
-
// node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js
|
|
3315
|
-
var resolveRegionConfig = (input) => {
|
|
3316
|
-
const { region, useFipsEndpoint } = input;
|
|
3317
|
-
if (!region) {
|
|
3318
|
-
throw new Error("Region is missing");
|
|
3319
|
-
}
|
|
3320
|
-
return Object.assign(input, {
|
|
3321
|
-
region: async () => {
|
|
3322
|
-
const providedRegion = typeof region === "function" ? await region() : region;
|
|
3323
|
-
const realRegion = getRealRegion(providedRegion);
|
|
3324
|
-
checkRegion(realRegion);
|
|
3325
|
-
return realRegion;
|
|
3326
|
-
},
|
|
3327
|
-
useFipsEndpoint: async () => {
|
|
3328
|
-
const providedRegion = typeof region === "string" ? region : await region();
|
|
3329
|
-
if (isFipsRegion(providedRegion)) {
|
|
3330
|
-
return true;
|
|
3331
|
-
}
|
|
3332
|
-
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
|
|
3333
|
-
}
|
|
3334
|
-
});
|
|
3335
|
-
};
|
|
3336
|
-
|
|
3337
|
-
// node_modules/@smithy/middleware-content-length/dist-es/index.js
|
|
3338
|
-
var CONTENT_LENGTH_HEADER = "content-length";
|
|
3339
|
-
function contentLengthMiddleware(bodyLengthChecker) {
|
|
3340
|
-
return (next) => async (args) => {
|
|
3341
|
-
const request = args.request;
|
|
3342
|
-
if (HttpRequest.isInstance(request)) {
|
|
3343
|
-
const { body, headers } = request;
|
|
3344
|
-
if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) {
|
|
3345
|
-
try {
|
|
3346
|
-
const length = bodyLengthChecker(body);
|
|
3347
|
-
request.headers = {
|
|
3348
|
-
...request.headers,
|
|
3349
|
-
[CONTENT_LENGTH_HEADER]: String(length)
|
|
3350
|
-
};
|
|
3351
|
-
} catch (error) {
|
|
3352
|
-
}
|
|
3353
|
-
}
|
|
3354
|
-
}
|
|
3355
|
-
return next({
|
|
3356
|
-
...args,
|
|
3357
|
-
request
|
|
3358
|
-
});
|
|
3359
|
-
};
|
|
3360
|
-
}
|
|
3361
|
-
var contentLengthMiddlewareOptions = {
|
|
3362
|
-
step: "build",
|
|
3363
|
-
tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
|
|
3364
|
-
name: "contentLengthMiddleware",
|
|
3365
|
-
override: true
|
|
3366
|
-
};
|
|
3367
|
-
var getContentLengthPlugin = (options) => ({
|
|
3368
|
-
applyToStack: (clientStack) => {
|
|
3369
|
-
clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
|
|
3370
|
-
}
|
|
3371
|
-
});
|
|
3372
|
-
|
|
3373
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js
|
|
3374
|
-
var resolveParamsForS3 = async (endpointParams) => {
|
|
3375
|
-
const bucket = endpointParams?.Bucket || "";
|
|
3376
|
-
if (typeof endpointParams.Bucket === "string") {
|
|
3377
|
-
endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
|
|
3378
|
-
}
|
|
3379
|
-
if (isArnBucketName(bucket)) {
|
|
3380
|
-
if (endpointParams.ForcePathStyle === true) {
|
|
3381
|
-
throw new Error("Path-style addressing cannot be used with ARN buckets");
|
|
3382
|
-
}
|
|
3383
|
-
} else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
|
|
3384
|
-
endpointParams.ForcePathStyle = true;
|
|
3385
|
-
}
|
|
3386
|
-
if (endpointParams.DisableMultiRegionAccessPoints) {
|
|
3387
|
-
endpointParams.disableMultiRegionAccessPoints = true;
|
|
3388
|
-
endpointParams.DisableMRAP = true;
|
|
3389
|
-
}
|
|
3390
|
-
return endpointParams;
|
|
3391
|
-
};
|
|
3392
|
-
var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
|
|
3393
|
-
var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
|
|
3394
|
-
var DOTS_PATTERN = /\.\./;
|
|
3395
|
-
var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
|
|
3396
|
-
var isArnBucketName = (bucketName) => {
|
|
3397
|
-
const [arn, partition2, service, , , bucket] = bucketName.split(":");
|
|
3398
|
-
const isArn = arn === "arn" && bucketName.split(":").length >= 6;
|
|
3399
|
-
const isValidArn = Boolean(isArn && partition2 && service && bucket);
|
|
3400
|
-
if (isArn && !isValidArn) {
|
|
3401
|
-
throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
|
|
3402
|
-
}
|
|
3403
|
-
return isValidArn;
|
|
3404
|
-
};
|
|
3405
|
-
|
|
3406
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js
|
|
3407
|
-
var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config, isClientContextParam = false) => {
|
|
3408
|
-
const configProvider = async () => {
|
|
3409
|
-
let configValue;
|
|
3410
|
-
if (isClientContextParam) {
|
|
3411
|
-
const clientContextParams = config.clientContextParams;
|
|
3412
|
-
const nestedValue = clientContextParams?.[configKey];
|
|
3413
|
-
configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey];
|
|
3414
|
-
} else {
|
|
3415
|
-
configValue = config[configKey] ?? config[canonicalEndpointParamKey];
|
|
3416
|
-
}
|
|
3417
|
-
if (typeof configValue === "function") {
|
|
3418
|
-
return configValue();
|
|
3419
|
-
}
|
|
3420
|
-
return configValue;
|
|
3421
|
-
};
|
|
3422
|
-
if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
|
|
3423
|
-
return async () => {
|
|
3424
|
-
const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
|
|
3425
|
-
const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
|
|
3426
|
-
return configValue;
|
|
3427
|
-
};
|
|
3428
|
-
}
|
|
3429
|
-
if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
|
|
3430
|
-
return async () => {
|
|
3431
|
-
const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
|
|
3432
|
-
const configValue = credentials?.accountId ?? credentials?.AccountId;
|
|
3433
|
-
return configValue;
|
|
3434
|
-
};
|
|
3435
|
-
}
|
|
3436
|
-
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
|
3437
|
-
return async () => {
|
|
3438
|
-
if (config.isCustomEndpoint === false) {
|
|
3439
|
-
return void 0;
|
|
3440
|
-
}
|
|
3441
|
-
const endpoint = await configProvider();
|
|
3442
|
-
if (endpoint && typeof endpoint === "object") {
|
|
3443
|
-
if ("url" in endpoint) {
|
|
3444
|
-
return endpoint.url.href;
|
|
3445
|
-
}
|
|
3446
|
-
if ("hostname" in endpoint) {
|
|
3447
|
-
const { protocol, hostname, port, path } = endpoint;
|
|
3448
|
-
return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
|
|
3449
|
-
}
|
|
3450
|
-
}
|
|
3451
|
-
return endpoint;
|
|
3452
|
-
};
|
|
3453
|
-
}
|
|
3454
|
-
return configProvider;
|
|
3455
|
-
};
|
|
3456
|
-
|
|
3457
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js
|
|
3458
|
-
var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
|
|
3459
|
-
var CONFIG_ENDPOINT_URL = "endpoint_url";
|
|
3460
|
-
var getEndpointUrlConfig = (serviceId) => ({
|
|
3461
|
-
environmentVariableSelector: (env2) => {
|
|
3462
|
-
const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
|
|
3463
|
-
const serviceEndpointUrl = env2[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")];
|
|
3464
|
-
if (serviceEndpointUrl)
|
|
3465
|
-
return serviceEndpointUrl;
|
|
3466
|
-
const endpointUrl = env2[ENV_ENDPOINT_URL];
|
|
3467
|
-
if (endpointUrl)
|
|
3468
|
-
return endpointUrl;
|
|
3469
|
-
return void 0;
|
|
3470
|
-
},
|
|
3471
|
-
configFileSelector: (profile, config) => {
|
|
3472
|
-
if (config && profile.services) {
|
|
3473
|
-
const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
|
|
3474
|
-
if (servicesSection) {
|
|
3475
|
-
const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
|
|
3476
|
-
const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
|
|
3477
|
-
if (endpointUrl2)
|
|
3478
|
-
return endpointUrl2;
|
|
3479
|
-
}
|
|
3480
|
-
}
|
|
3481
|
-
const endpointUrl = profile[CONFIG_ENDPOINT_URL];
|
|
3482
|
-
if (endpointUrl)
|
|
3483
|
-
return endpointUrl;
|
|
3484
|
-
return void 0;
|
|
3485
|
-
},
|
|
3486
|
-
default: void 0
|
|
3487
|
-
});
|
|
3488
|
-
|
|
3489
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js
|
|
3490
|
-
var getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
|
|
3491
|
-
|
|
3492
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js
|
|
3493
|
-
var toEndpointV1 = (endpoint) => {
|
|
3494
|
-
if (typeof endpoint === "object") {
|
|
3495
|
-
if ("url" in endpoint) {
|
|
3496
|
-
return parseUrl(endpoint.url);
|
|
3497
|
-
}
|
|
3498
|
-
return endpoint;
|
|
3499
|
-
}
|
|
3500
|
-
return parseUrl(endpoint);
|
|
3501
|
-
};
|
|
3502
|
-
|
|
3503
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js
|
|
3504
|
-
var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {
|
|
3505
|
-
if (!clientConfig.isCustomEndpoint) {
|
|
3506
|
-
let endpointFromConfig;
|
|
3507
|
-
if (clientConfig.serviceConfiguredEndpoint) {
|
|
3508
|
-
endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
|
|
3509
|
-
} else {
|
|
3510
|
-
endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
|
|
3511
|
-
}
|
|
3512
|
-
if (endpointFromConfig) {
|
|
3513
|
-
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
|
3514
|
-
clientConfig.isCustomEndpoint = true;
|
|
3515
|
-
}
|
|
3516
|
-
}
|
|
3517
|
-
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
|
|
3518
|
-
if (typeof clientConfig.endpointProvider !== "function") {
|
|
3519
|
-
throw new Error("config.endpointProvider is not set.");
|
|
3520
|
-
}
|
|
3521
|
-
const endpoint = clientConfig.endpointProvider(endpointParams, context);
|
|
3522
|
-
return endpoint;
|
|
3523
|
-
};
|
|
3524
|
-
var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
|
|
3525
|
-
const endpointParams = {};
|
|
3526
|
-
const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
|
|
3527
|
-
for (const [name, instruction] of Object.entries(instructions)) {
|
|
3528
|
-
switch (instruction.type) {
|
|
3529
|
-
case "staticContextParams":
|
|
3530
|
-
endpointParams[name] = instruction.value;
|
|
3531
|
-
break;
|
|
3532
|
-
case "contextParams":
|
|
3533
|
-
endpointParams[name] = commandInput[instruction.name];
|
|
3534
|
-
break;
|
|
3535
|
-
case "clientContextParams":
|
|
3536
|
-
case "builtInParams":
|
|
3537
|
-
endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")();
|
|
3538
|
-
break;
|
|
3539
|
-
case "operationContextParams":
|
|
3540
|
-
endpointParams[name] = instruction.get(commandInput);
|
|
3541
|
-
break;
|
|
3542
|
-
default:
|
|
3543
|
-
throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
|
|
3544
|
-
}
|
|
3545
|
-
}
|
|
3546
|
-
if (Object.keys(instructions).length === 0) {
|
|
3547
|
-
Object.assign(endpointParams, clientConfig);
|
|
3548
|
-
}
|
|
3549
|
-
if (String(clientConfig.serviceId).toLowerCase() === "s3") {
|
|
3550
|
-
await resolveParamsForS3(endpointParams);
|
|
3551
|
-
}
|
|
3552
|
-
return endpointParams;
|
|
3553
|
-
};
|
|
3554
|
-
|
|
3555
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js
|
|
3556
|
-
var endpointMiddleware = ({ config, instructions }) => {
|
|
3557
|
-
return (next, context) => async (args) => {
|
|
3558
|
-
if (config.isCustomEndpoint) {
|
|
3559
|
-
setFeature(context, "ENDPOINT_OVERRIDE", "N");
|
|
3560
|
-
}
|
|
3561
|
-
const endpoint = await getEndpointFromInstructions(args.input, {
|
|
3562
|
-
getEndpointParameterInstructions() {
|
|
3563
|
-
return instructions;
|
|
3564
|
-
}
|
|
3565
|
-
}, { ...config }, context);
|
|
3566
|
-
context.endpointV2 = endpoint;
|
|
3567
|
-
context.authSchemes = endpoint.properties?.authSchemes;
|
|
3568
|
-
const authScheme = context.authSchemes?.[0];
|
|
3569
|
-
if (authScheme) {
|
|
3570
|
-
context["signing_region"] = authScheme.signingRegion;
|
|
3571
|
-
context["signing_service"] = authScheme.signingName;
|
|
3572
|
-
const smithyContext = getSmithyContext(context);
|
|
3573
|
-
const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
|
|
3574
|
-
if (httpAuthOption) {
|
|
3575
|
-
httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
|
|
3576
|
-
signing_region: authScheme.signingRegion,
|
|
3577
|
-
signingRegion: authScheme.signingRegion,
|
|
3578
|
-
signing_service: authScheme.signingName,
|
|
3579
|
-
signingName: authScheme.signingName,
|
|
3580
|
-
signingRegionSet: authScheme.signingRegionSet
|
|
3581
|
-
}, authScheme.properties);
|
|
3582
|
-
}
|
|
3583
|
-
}
|
|
3584
|
-
return next({
|
|
3585
|
-
...args
|
|
3586
|
-
});
|
|
3587
|
-
};
|
|
3588
|
-
};
|
|
3589
|
-
|
|
3590
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js
|
|
3591
|
-
var endpointMiddlewareOptions = {
|
|
3592
|
-
step: "serialize",
|
|
3593
|
-
tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
|
|
3594
|
-
name: "endpointV2Middleware",
|
|
3595
|
-
override: true,
|
|
3596
|
-
relation: "before",
|
|
3597
|
-
toMiddleware: serializerMiddlewareOption.name
|
|
3598
|
-
};
|
|
3599
|
-
var getEndpointPlugin = (config, instructions) => ({
|
|
3600
|
-
applyToStack: (clientStack) => {
|
|
3601
|
-
clientStack.addRelativeTo(endpointMiddleware({
|
|
3602
|
-
config,
|
|
3603
|
-
instructions
|
|
3604
|
-
}), endpointMiddlewareOptions);
|
|
3605
|
-
}
|
|
3606
|
-
});
|
|
3607
|
-
|
|
3608
|
-
// node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js
|
|
3609
|
-
var resolveEndpointConfig = (input) => {
|
|
3610
|
-
const tls = input.tls ?? true;
|
|
3611
|
-
const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
|
|
3612
|
-
const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : void 0;
|
|
3613
|
-
const isCustomEndpoint = !!endpoint;
|
|
3614
|
-
const resolvedConfig = Object.assign(input, {
|
|
3615
|
-
endpoint: customEndpointProvider,
|
|
3616
|
-
tls,
|
|
3617
|
-
isCustomEndpoint,
|
|
3618
|
-
useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
|
|
3619
|
-
useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false)
|
|
3620
|
-
});
|
|
3621
|
-
let configuredEndpointPromise = void 0;
|
|
3622
|
-
resolvedConfig.serviceConfiguredEndpoint = async () => {
|
|
3623
|
-
if (input.serviceId && !configuredEndpointPromise) {
|
|
3624
|
-
configuredEndpointPromise = getEndpointFromConfig(input.serviceId);
|
|
3625
|
-
}
|
|
3626
|
-
return configuredEndpointPromise;
|
|
3627
|
-
};
|
|
3628
|
-
return resolvedConfig;
|
|
3629
|
-
};
|
|
3630
|
-
|
|
3631
|
-
// node_modules/@smithy/util-retry/dist-es/config.js
|
|
3632
|
-
var RETRY_MODES;
|
|
3633
|
-
(function(RETRY_MODES2) {
|
|
3634
|
-
RETRY_MODES2["STANDARD"] = "standard";
|
|
3635
|
-
RETRY_MODES2["ADAPTIVE"] = "adaptive";
|
|
3636
|
-
})(RETRY_MODES || (RETRY_MODES = {}));
|
|
3637
|
-
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
3638
|
-
var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
|
|
3639
|
-
|
|
3640
|
-
// node_modules/@smithy/service-error-classification/dist-es/constants.js
|
|
3641
|
-
var THROTTLING_ERROR_CODES = [
|
|
3642
|
-
"BandwidthLimitExceeded",
|
|
3643
|
-
"EC2ThrottledException",
|
|
3644
|
-
"LimitExceededException",
|
|
3645
|
-
"PriorRequestNotComplete",
|
|
3646
|
-
"ProvisionedThroughputExceededException",
|
|
3647
|
-
"RequestLimitExceeded",
|
|
3648
|
-
"RequestThrottled",
|
|
3649
|
-
"RequestThrottledException",
|
|
3650
|
-
"SlowDown",
|
|
3651
|
-
"ThrottledException",
|
|
3652
|
-
"Throttling",
|
|
3653
|
-
"ThrottlingException",
|
|
3654
|
-
"TooManyRequestsException",
|
|
3655
|
-
"TransactionInProgressException"
|
|
3656
|
-
];
|
|
3657
|
-
var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
3658
|
-
var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
3659
|
-
var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
3660
|
-
var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
|
|
3661
|
-
|
|
3662
|
-
// node_modules/@smithy/service-error-classification/dist-es/index.js
|
|
3663
|
-
var isRetryableByTrait = (error) => error?.$retryable !== void 0;
|
|
3664
|
-
var isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected;
|
|
3665
|
-
var isBrowserNetworkError = (error) => {
|
|
3666
|
-
const errorMessages = /* @__PURE__ */ new Set([
|
|
3667
|
-
"Failed to fetch",
|
|
3668
|
-
"NetworkError when attempting to fetch resource",
|
|
3669
|
-
"The Internet connection appears to be offline",
|
|
3670
|
-
"Load failed",
|
|
3671
|
-
"Network request failed"
|
|
3672
|
-
]);
|
|
3673
|
-
const isValid = error && error instanceof TypeError;
|
|
3674
|
-
if (!isValid) {
|
|
3675
|
-
return false;
|
|
3676
|
-
}
|
|
3677
|
-
return errorMessages.has(error.message);
|
|
3678
|
-
};
|
|
3679
|
-
var isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error.name) || error.$retryable?.throttling == true;
|
|
3680
|
-
var isTransientError = (error, depth = 0) => isRetryableByTrait(error) || isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1);
|
|
3681
|
-
var isServerError = (error) => {
|
|
3682
|
-
if (error.$metadata?.httpStatusCode !== void 0) {
|
|
3683
|
-
const statusCode = error.$metadata.httpStatusCode;
|
|
3684
|
-
if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
|
|
3685
|
-
return true;
|
|
3686
|
-
}
|
|
3687
|
-
return false;
|
|
3688
|
-
}
|
|
3689
|
-
return false;
|
|
3690
|
-
};
|
|
3691
|
-
|
|
3692
|
-
// node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js
|
|
3693
|
-
var DefaultRateLimiter = class _DefaultRateLimiter {
|
|
3694
|
-
static setTimeoutFn = setTimeout;
|
|
3695
|
-
beta;
|
|
3696
|
-
minCapacity;
|
|
3697
|
-
minFillRate;
|
|
3698
|
-
scaleConstant;
|
|
3699
|
-
smooth;
|
|
3700
|
-
currentCapacity = 0;
|
|
3701
|
-
enabled = false;
|
|
3702
|
-
lastMaxRate = 0;
|
|
3703
|
-
measuredTxRate = 0;
|
|
3704
|
-
requestCount = 0;
|
|
3705
|
-
fillRate;
|
|
3706
|
-
lastThrottleTime;
|
|
3707
|
-
lastTimestamp = 0;
|
|
3708
|
-
lastTxRateBucket;
|
|
3709
|
-
maxCapacity;
|
|
3710
|
-
timeWindow = 0;
|
|
3711
|
-
constructor(options) {
|
|
3712
|
-
this.beta = options?.beta ?? 0.7;
|
|
3713
|
-
this.minCapacity = options?.minCapacity ?? 1;
|
|
3714
|
-
this.minFillRate = options?.minFillRate ?? 0.5;
|
|
3715
|
-
this.scaleConstant = options?.scaleConstant ?? 0.4;
|
|
3716
|
-
this.smooth = options?.smooth ?? 0.8;
|
|
3717
|
-
const currentTimeInSeconds = this.getCurrentTimeInSeconds();
|
|
3718
|
-
this.lastThrottleTime = currentTimeInSeconds;
|
|
3719
|
-
this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
|
|
3720
|
-
this.fillRate = this.minFillRate;
|
|
3721
|
-
this.maxCapacity = this.minCapacity;
|
|
3722
|
-
}
|
|
3723
|
-
getCurrentTimeInSeconds() {
|
|
3724
|
-
return Date.now() / 1e3;
|
|
3725
|
-
}
|
|
3726
|
-
async getSendToken() {
|
|
3727
|
-
return this.acquireTokenBucket(1);
|
|
3728
|
-
}
|
|
3729
|
-
async acquireTokenBucket(amount) {
|
|
3730
|
-
if (!this.enabled) {
|
|
3731
|
-
return;
|
|
3732
|
-
}
|
|
3733
|
-
this.refillTokenBucket();
|
|
3734
|
-
if (amount > this.currentCapacity) {
|
|
3735
|
-
const delay = (amount - this.currentCapacity) / this.fillRate * 1e3;
|
|
3736
|
-
await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
|
|
3737
|
-
}
|
|
3738
|
-
this.currentCapacity = this.currentCapacity - amount;
|
|
3739
|
-
}
|
|
3740
|
-
refillTokenBucket() {
|
|
3741
|
-
const timestamp = this.getCurrentTimeInSeconds();
|
|
3742
|
-
if (!this.lastTimestamp) {
|
|
3743
|
-
this.lastTimestamp = timestamp;
|
|
3744
|
-
return;
|
|
3745
|
-
}
|
|
3746
|
-
const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
|
|
3747
|
-
this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
|
|
3748
|
-
this.lastTimestamp = timestamp;
|
|
3749
|
-
}
|
|
3750
|
-
updateClientSendingRate(response) {
|
|
3751
|
-
let calculatedRate;
|
|
3752
|
-
this.updateMeasuredRate();
|
|
3753
|
-
if (isThrottlingError(response)) {
|
|
3754
|
-
const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
|
|
3755
|
-
this.lastMaxRate = rateToUse;
|
|
3756
|
-
this.calculateTimeWindow();
|
|
3757
|
-
this.lastThrottleTime = this.getCurrentTimeInSeconds();
|
|
3758
|
-
calculatedRate = this.cubicThrottle(rateToUse);
|
|
3759
|
-
this.enableTokenBucket();
|
|
3760
|
-
} else {
|
|
3761
|
-
this.calculateTimeWindow();
|
|
3762
|
-
calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
|
|
3763
|
-
}
|
|
3764
|
-
const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
|
|
3765
|
-
this.updateTokenBucketRate(newRate);
|
|
3766
|
-
}
|
|
3767
|
-
calculateTimeWindow() {
|
|
3768
|
-
this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
|
|
3769
|
-
}
|
|
3770
|
-
cubicThrottle(rateToUse) {
|
|
3771
|
-
return this.getPrecise(rateToUse * this.beta);
|
|
3772
|
-
}
|
|
3773
|
-
cubicSuccess(timestamp) {
|
|
3774
|
-
return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
|
|
3775
|
-
}
|
|
3776
|
-
enableTokenBucket() {
|
|
3777
|
-
this.enabled = true;
|
|
3778
|
-
}
|
|
3779
|
-
updateTokenBucketRate(newRate) {
|
|
3780
|
-
this.refillTokenBucket();
|
|
3781
|
-
this.fillRate = Math.max(newRate, this.minFillRate);
|
|
3782
|
-
this.maxCapacity = Math.max(newRate, this.minCapacity);
|
|
3783
|
-
this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
|
|
3784
|
-
}
|
|
3785
|
-
updateMeasuredRate() {
|
|
3786
|
-
const t = this.getCurrentTimeInSeconds();
|
|
3787
|
-
const timeBucket = Math.floor(t * 2) / 2;
|
|
3788
|
-
this.requestCount++;
|
|
3789
|
-
if (timeBucket > this.lastTxRateBucket) {
|
|
3790
|
-
const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
|
|
3791
|
-
this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
|
|
3792
|
-
this.requestCount = 0;
|
|
3793
|
-
this.lastTxRateBucket = timeBucket;
|
|
3794
|
-
}
|
|
3795
|
-
}
|
|
3796
|
-
getPrecise(num) {
|
|
3797
|
-
return parseFloat(num.toFixed(8));
|
|
3798
|
-
}
|
|
3799
|
-
};
|
|
3800
|
-
|
|
3801
|
-
// node_modules/@smithy/util-retry/dist-es/constants.js
|
|
3802
|
-
var DEFAULT_RETRY_DELAY_BASE = 100;
|
|
3803
|
-
var MAXIMUM_RETRY_DELAY = 20 * 1e3;
|
|
3804
|
-
var THROTTLING_RETRY_DELAY_BASE = 500;
|
|
3805
|
-
var INITIAL_RETRY_TOKENS = 500;
|
|
3806
|
-
var RETRY_COST = 5;
|
|
3807
|
-
var TIMEOUT_RETRY_COST = 10;
|
|
3808
|
-
var NO_RETRY_INCREMENT = 1;
|
|
3809
|
-
var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
|
|
3810
|
-
var REQUEST_HEADER = "amz-sdk-request";
|
|
3811
|
-
|
|
3812
|
-
// node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js
|
|
3813
|
-
var getDefaultRetryBackoffStrategy = () => {
|
|
3814
|
-
let delayBase = DEFAULT_RETRY_DELAY_BASE;
|
|
3815
|
-
const computeNextBackoffDelay = (attempts) => {
|
|
3816
|
-
return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
|
|
3817
|
-
};
|
|
3818
|
-
const setDelayBase = (delay) => {
|
|
3819
|
-
delayBase = delay;
|
|
3820
|
-
};
|
|
3821
|
-
return {
|
|
3822
|
-
computeNextBackoffDelay,
|
|
3823
|
-
setDelayBase
|
|
3824
|
-
};
|
|
3825
|
-
};
|
|
3826
|
-
|
|
3827
|
-
// node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js
|
|
3828
|
-
var createDefaultRetryToken = ({ retryDelay, retryCount, retryCost }) => {
|
|
3829
|
-
const getRetryCount = () => retryCount;
|
|
3830
|
-
const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay);
|
|
3831
|
-
const getRetryCost = () => retryCost;
|
|
3832
|
-
return {
|
|
3833
|
-
getRetryCount,
|
|
3834
|
-
getRetryDelay,
|
|
3835
|
-
getRetryCost
|
|
3836
|
-
};
|
|
3837
|
-
};
|
|
3838
|
-
|
|
3839
|
-
// node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js
|
|
3840
|
-
var StandardRetryStrategy = class {
|
|
3841
|
-
maxAttempts;
|
|
3842
|
-
mode = RETRY_MODES.STANDARD;
|
|
3843
|
-
capacity = INITIAL_RETRY_TOKENS;
|
|
3844
|
-
retryBackoffStrategy = getDefaultRetryBackoffStrategy();
|
|
3845
|
-
maxAttemptsProvider;
|
|
3846
|
-
constructor(maxAttempts) {
|
|
3847
|
-
this.maxAttempts = maxAttempts;
|
|
3848
|
-
this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
|
|
3849
|
-
}
|
|
3850
|
-
async acquireInitialRetryToken(retryTokenScope) {
|
|
3851
|
-
return createDefaultRetryToken({
|
|
3852
|
-
retryDelay: DEFAULT_RETRY_DELAY_BASE,
|
|
3853
|
-
retryCount: 0
|
|
3854
|
-
});
|
|
3855
|
-
}
|
|
3856
|
-
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
3857
|
-
const maxAttempts = await this.getMaxAttempts();
|
|
3858
|
-
if (this.shouldRetry(token, errorInfo, maxAttempts)) {
|
|
3859
|
-
const errorType = errorInfo.errorType;
|
|
3860
|
-
this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);
|
|
3861
|
-
const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
|
|
3862
|
-
const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType;
|
|
3863
|
-
const capacityCost = this.getCapacityCost(errorType);
|
|
3864
|
-
this.capacity -= capacityCost;
|
|
3865
|
-
return createDefaultRetryToken({
|
|
3866
|
-
retryDelay,
|
|
3867
|
-
retryCount: token.getRetryCount() + 1,
|
|
3868
|
-
retryCost: capacityCost
|
|
3869
|
-
});
|
|
3870
|
-
}
|
|
3871
|
-
throw new Error("No retry token available");
|
|
3872
|
-
}
|
|
3873
|
-
recordSuccess(token) {
|
|
3874
|
-
this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
|
|
3875
|
-
}
|
|
3876
|
-
getCapacity() {
|
|
3877
|
-
return this.capacity;
|
|
3878
|
-
}
|
|
3879
|
-
async getMaxAttempts() {
|
|
3880
|
-
try {
|
|
3881
|
-
return await this.maxAttemptsProvider();
|
|
3882
|
-
} catch (error) {
|
|
3883
|
-
console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
|
|
3884
|
-
return DEFAULT_MAX_ATTEMPTS;
|
|
3885
|
-
}
|
|
3886
|
-
}
|
|
3887
|
-
shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
|
|
3888
|
-
const attempts = tokenToRenew.getRetryCount() + 1;
|
|
3889
|
-
return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType);
|
|
3890
|
-
}
|
|
3891
|
-
getCapacityCost(errorType) {
|
|
3892
|
-
return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
|
|
3893
|
-
}
|
|
3894
|
-
isRetryableError(errorType) {
|
|
3895
|
-
return errorType === "THROTTLING" || errorType === "TRANSIENT";
|
|
3896
|
-
}
|
|
3897
|
-
};
|
|
3898
|
-
|
|
3899
|
-
// node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js
|
|
3900
|
-
var AdaptiveRetryStrategy = class {
|
|
3901
|
-
maxAttemptsProvider;
|
|
3902
|
-
rateLimiter;
|
|
3903
|
-
standardRetryStrategy;
|
|
3904
|
-
mode = RETRY_MODES.ADAPTIVE;
|
|
3905
|
-
constructor(maxAttemptsProvider, options) {
|
|
3906
|
-
this.maxAttemptsProvider = maxAttemptsProvider;
|
|
3907
|
-
const { rateLimiter } = options ?? {};
|
|
3908
|
-
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
|
|
3909
|
-
this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
|
|
3910
|
-
}
|
|
3911
|
-
async acquireInitialRetryToken(retryTokenScope) {
|
|
3912
|
-
await this.rateLimiter.getSendToken();
|
|
3913
|
-
return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
|
|
3914
|
-
}
|
|
3915
|
-
async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
|
|
3916
|
-
this.rateLimiter.updateClientSendingRate(errorInfo);
|
|
3917
|
-
return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
|
|
3918
|
-
}
|
|
3919
|
-
recordSuccess(token) {
|
|
3920
|
-
this.rateLimiter.updateClientSendingRate({});
|
|
3921
|
-
this.standardRetryStrategy.recordSuccess(token);
|
|
3922
|
-
}
|
|
3923
|
-
};
|
|
3924
|
-
|
|
3925
|
-
// node_modules/@smithy/middleware-retry/dist-es/configurations.js
|
|
3926
|
-
var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
|
|
3927
|
-
var CONFIG_MAX_ATTEMPTS = "max_attempts";
|
|
3928
|
-
var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
|
|
3929
|
-
environmentVariableSelector: (env2) => {
|
|
3930
|
-
const value = env2[ENV_MAX_ATTEMPTS];
|
|
3931
|
-
if (!value)
|
|
3932
|
-
return void 0;
|
|
3933
|
-
const maxAttempt = parseInt(value);
|
|
3934
|
-
if (Number.isNaN(maxAttempt)) {
|
|
3935
|
-
throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
|
|
3936
|
-
}
|
|
3937
|
-
return maxAttempt;
|
|
3938
|
-
},
|
|
3939
|
-
configFileSelector: (profile) => {
|
|
3940
|
-
const value = profile[CONFIG_MAX_ATTEMPTS];
|
|
3941
|
-
if (!value)
|
|
3942
|
-
return void 0;
|
|
3943
|
-
const maxAttempt = parseInt(value);
|
|
3944
|
-
if (Number.isNaN(maxAttempt)) {
|
|
3945
|
-
throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
|
|
3946
|
-
}
|
|
3947
|
-
return maxAttempt;
|
|
3948
|
-
},
|
|
3949
|
-
default: DEFAULT_MAX_ATTEMPTS
|
|
3950
|
-
};
|
|
3951
|
-
var resolveRetryConfig = (input) => {
|
|
3952
|
-
const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
|
|
3953
|
-
const maxAttempts = normalizeProvider(_maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
|
|
3954
|
-
return Object.assign(input, {
|
|
3955
|
-
maxAttempts,
|
|
3956
|
-
retryStrategy: async () => {
|
|
3957
|
-
if (retryStrategy) {
|
|
3958
|
-
return retryStrategy;
|
|
3959
|
-
}
|
|
3960
|
-
const retryMode = await normalizeProvider(_retryMode)();
|
|
3961
|
-
if (retryMode === RETRY_MODES.ADAPTIVE) {
|
|
3962
|
-
return new AdaptiveRetryStrategy(maxAttempts);
|
|
3963
|
-
}
|
|
3964
|
-
return new StandardRetryStrategy(maxAttempts);
|
|
3965
|
-
}
|
|
3966
|
-
});
|
|
3967
|
-
};
|
|
3968
|
-
var ENV_RETRY_MODE = "AWS_RETRY_MODE";
|
|
3969
|
-
var CONFIG_RETRY_MODE = "retry_mode";
|
|
3970
|
-
var NODE_RETRY_MODE_CONFIG_OPTIONS = {
|
|
3971
|
-
environmentVariableSelector: (env2) => env2[ENV_RETRY_MODE],
|
|
3972
|
-
configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
|
|
3973
|
-
default: DEFAULT_RETRY_MODE
|
|
3974
|
-
};
|
|
3975
|
-
|
|
3976
|
-
// node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js
|
|
3977
|
-
import { Readable } from "stream";
|
|
3978
|
-
var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
|
|
3979
|
-
|
|
3980
|
-
// node_modules/@smithy/middleware-retry/dist-es/util.js
|
|
3981
|
-
var asSdkError = (error) => {
|
|
3982
|
-
if (error instanceof Error)
|
|
3983
|
-
return error;
|
|
3984
|
-
if (error instanceof Object)
|
|
3985
|
-
return Object.assign(new Error(), error);
|
|
3986
|
-
if (typeof error === "string")
|
|
3987
|
-
return new Error(error);
|
|
3988
|
-
return new Error(`AWS SDK error wrapper for ${error}`);
|
|
3989
|
-
};
|
|
3990
|
-
|
|
3991
|
-
// node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
|
|
3992
|
-
var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
3993
|
-
let retryStrategy = await options.retryStrategy();
|
|
3994
|
-
const maxAttempts = await options.maxAttempts();
|
|
3995
|
-
if (isRetryStrategyV2(retryStrategy)) {
|
|
3996
|
-
retryStrategy = retryStrategy;
|
|
3997
|
-
let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
|
|
3998
|
-
let lastError = new Error();
|
|
3999
|
-
let attempts = 0;
|
|
4000
|
-
let totalRetryDelay = 0;
|
|
4001
|
-
const { request } = args;
|
|
4002
|
-
const isRequest = HttpRequest.isInstance(request);
|
|
4003
|
-
if (isRequest) {
|
|
4004
|
-
request.headers[INVOCATION_ID_HEADER] = v4();
|
|
4005
|
-
}
|
|
4006
|
-
while (true) {
|
|
4007
|
-
try {
|
|
4008
|
-
if (isRequest) {
|
|
4009
|
-
request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
|
|
4010
|
-
}
|
|
4011
|
-
const { response, output } = await next(args);
|
|
4012
|
-
retryStrategy.recordSuccess(retryToken);
|
|
4013
|
-
output.$metadata.attempts = attempts + 1;
|
|
4014
|
-
output.$metadata.totalRetryDelay = totalRetryDelay;
|
|
4015
|
-
return { response, output };
|
|
4016
|
-
} catch (e) {
|
|
4017
|
-
const retryErrorInfo = getRetryErrorInfo(e);
|
|
4018
|
-
lastError = asSdkError(e);
|
|
4019
|
-
if (isRequest && isStreamingPayload(request)) {
|
|
4020
|
-
(context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
|
|
4021
|
-
throw lastError;
|
|
4022
|
-
}
|
|
4023
|
-
try {
|
|
4024
|
-
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
4025
|
-
} catch (refreshError) {
|
|
4026
|
-
if (!lastError.$metadata) {
|
|
4027
|
-
lastError.$metadata = {};
|
|
4028
|
-
}
|
|
4029
|
-
lastError.$metadata.attempts = attempts + 1;
|
|
4030
|
-
lastError.$metadata.totalRetryDelay = totalRetryDelay;
|
|
4031
|
-
throw lastError;
|
|
4032
|
-
}
|
|
4033
|
-
attempts = retryToken.getRetryCount();
|
|
4034
|
-
const delay = retryToken.getRetryDelay();
|
|
4035
|
-
totalRetryDelay += delay;
|
|
4036
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
4037
|
-
}
|
|
4038
|
-
}
|
|
4039
|
-
} else {
|
|
4040
|
-
retryStrategy = retryStrategy;
|
|
4041
|
-
if (retryStrategy?.mode)
|
|
4042
|
-
context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
|
|
4043
|
-
return retryStrategy.retry(next, args);
|
|
4044
|
-
}
|
|
4045
|
-
};
|
|
4046
|
-
var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
|
|
4047
|
-
var getRetryErrorInfo = (error) => {
|
|
4048
|
-
const errorInfo = {
|
|
4049
|
-
error,
|
|
4050
|
-
errorType: getRetryErrorType(error)
|
|
4051
|
-
};
|
|
4052
|
-
const retryAfterHint = getRetryAfterHint(error.$response);
|
|
4053
|
-
if (retryAfterHint) {
|
|
4054
|
-
errorInfo.retryAfterHint = retryAfterHint;
|
|
4055
|
-
}
|
|
4056
|
-
return errorInfo;
|
|
4057
|
-
};
|
|
4058
|
-
var getRetryErrorType = (error) => {
|
|
4059
|
-
if (isThrottlingError(error))
|
|
4060
|
-
return "THROTTLING";
|
|
4061
|
-
if (isTransientError(error))
|
|
4062
|
-
return "TRANSIENT";
|
|
4063
|
-
if (isServerError(error))
|
|
4064
|
-
return "SERVER_ERROR";
|
|
4065
|
-
return "CLIENT_ERROR";
|
|
4066
|
-
};
|
|
4067
|
-
var retryMiddlewareOptions = {
|
|
4068
|
-
name: "retryMiddleware",
|
|
4069
|
-
tags: ["RETRY"],
|
|
4070
|
-
step: "finalizeRequest",
|
|
4071
|
-
priority: "high",
|
|
4072
|
-
override: true
|
|
4073
|
-
};
|
|
4074
|
-
var getRetryPlugin = (options) => ({
|
|
4075
|
-
applyToStack: (clientStack) => {
|
|
4076
|
-
clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
|
|
4077
|
-
}
|
|
4078
|
-
});
|
|
4079
|
-
var getRetryAfterHint = (response) => {
|
|
4080
|
-
if (!HttpResponse.isInstance(response))
|
|
4081
|
-
return;
|
|
4082
|
-
const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
|
|
4083
|
-
if (!retryAfterHeaderName)
|
|
4084
|
-
return;
|
|
4085
|
-
const retryAfter = response.headers[retryAfterHeaderName];
|
|
4086
|
-
const retryAfterSeconds = Number(retryAfter);
|
|
4087
|
-
if (!Number.isNaN(retryAfterSeconds))
|
|
4088
|
-
return new Date(retryAfterSeconds * 1e3);
|
|
4089
|
-
const retryAfterDate = new Date(retryAfter);
|
|
4090
|
-
return retryAfterDate;
|
|
4091
|
-
};
|
|
4092
|
-
|
|
4093
|
-
// node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js
|
|
4094
|
-
var booleanSelector = (obj, key, type) => {
|
|
4095
|
-
if (!(key in obj))
|
|
4096
|
-
return void 0;
|
|
4097
|
-
if (obj[key] === "true")
|
|
4098
|
-
return true;
|
|
4099
|
-
if (obj[key] === "false")
|
|
4100
|
-
return false;
|
|
4101
|
-
throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
|
|
4102
|
-
};
|
|
4103
|
-
|
|
4104
|
-
// node_modules/@smithy/util-config-provider/dist-es/types.js
|
|
4105
|
-
var SelectorType;
|
|
4106
|
-
(function(SelectorType2) {
|
|
4107
|
-
SelectorType2["ENV"] = "env";
|
|
4108
|
-
SelectorType2["CONFIG"] = "shared config entry";
|
|
4109
|
-
})(SelectorType || (SelectorType = {}));
|
|
4110
|
-
|
|
4111
|
-
// node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
|
|
4112
|
-
var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
|
|
4113
|
-
var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
|
|
4114
|
-
var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
|
|
4115
|
-
environmentVariableSelector: (env2) => booleanSelector(env2, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),
|
|
4116
|
-
configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG),
|
|
4117
|
-
default: false
|
|
4118
|
-
};
|
|
4119
|
-
|
|
4120
|
-
// node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js
|
|
4121
|
-
var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
|
|
4122
|
-
var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
|
|
4123
|
-
var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
|
|
4124
|
-
environmentVariableSelector: (env2) => booleanSelector(env2, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),
|
|
4125
|
-
configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG),
|
|
4126
|
-
default: false
|
|
4127
|
-
};
|
|
4128
|
-
|
|
4129
|
-
// node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js
|
|
4130
|
-
var REGION_ENV_NAME = "AWS_REGION";
|
|
4131
|
-
var REGION_INI_NAME = "region";
|
|
4132
|
-
var NODE_REGION_CONFIG_OPTIONS = {
|
|
4133
|
-
environmentVariableSelector: (env2) => env2[REGION_ENV_NAME],
|
|
4134
|
-
configFileSelector: (profile) => profile[REGION_INI_NAME],
|
|
4135
|
-
default: () => {
|
|
4136
|
-
throw new Error("Region is missing");
|
|
4137
|
-
}
|
|
4138
|
-
};
|
|
4139
|
-
var NODE_REGION_CONFIG_FILE_OPTIONS = {
|
|
4140
|
-
preferredFile: "credentials"
|
|
4141
|
-
};
|
|
4142
|
-
|
|
4143
|
-
// node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
|
|
4144
|
-
import { platform, release } from "os";
|
|
4145
|
-
import { env, versions } from "process";
|
|
4146
|
-
|
|
4147
|
-
// node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js
|
|
4148
|
-
var crtAvailability = {
|
|
4149
|
-
isCrtAvailable: false
|
|
4150
|
-
};
|
|
4151
|
-
|
|
4152
|
-
// node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js
|
|
4153
|
-
var isCrtAvailable = () => {
|
|
4154
|
-
if (crtAvailability.isCrtAvailable) {
|
|
4155
|
-
return ["md/crt-avail"];
|
|
4156
|
-
}
|
|
4157
|
-
return null;
|
|
4158
|
-
};
|
|
4159
|
-
|
|
4160
|
-
// node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
|
|
4161
|
-
var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
|
|
4162
|
-
return async (config) => {
|
|
4163
|
-
const sections = [
|
|
4164
|
-
["aws-sdk-js", clientVersion],
|
|
4165
|
-
["ua", "2.1"],
|
|
4166
|
-
[`os/${platform()}`, release()],
|
|
4167
|
-
["lang/js"],
|
|
4168
|
-
["md/nodejs", `${versions.node}`]
|
|
4169
|
-
];
|
|
4170
|
-
const crtAvailable = isCrtAvailable();
|
|
4171
|
-
if (crtAvailable) {
|
|
4172
|
-
sections.push(crtAvailable);
|
|
4173
|
-
}
|
|
4174
|
-
if (serviceId) {
|
|
4175
|
-
sections.push([`api/${serviceId}`, clientVersion]);
|
|
4176
|
-
}
|
|
4177
|
-
if (env.AWS_EXECUTION_ENV) {
|
|
4178
|
-
sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
|
|
4179
|
-
}
|
|
4180
|
-
const appId = await config?.userAgentAppId?.();
|
|
4181
|
-
const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
|
|
4182
|
-
return resolvedUserAgent;
|
|
4183
|
-
};
|
|
4184
|
-
};
|
|
4185
|
-
|
|
4186
|
-
// node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js
|
|
4187
|
-
var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
|
|
4188
|
-
var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
|
|
4189
|
-
var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
|
|
4190
|
-
var NODE_APP_ID_CONFIG_OPTIONS = {
|
|
4191
|
-
environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
|
|
4192
|
-
configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED],
|
|
4193
|
-
default: DEFAULT_UA_APP_ID
|
|
4194
|
-
};
|
|
4195
|
-
|
|
4196
|
-
// node_modules/@smithy/hash-node/dist-es/index.js
|
|
4197
|
-
import { Buffer as Buffer2 } from "buffer";
|
|
4198
|
-
import { createHash, createHmac } from "crypto";
|
|
4199
|
-
var Hash = class {
|
|
4200
|
-
algorithmIdentifier;
|
|
4201
|
-
secret;
|
|
4202
|
-
hash;
|
|
4203
|
-
constructor(algorithmIdentifier, secret) {
|
|
4204
|
-
this.algorithmIdentifier = algorithmIdentifier;
|
|
4205
|
-
this.secret = secret;
|
|
4206
|
-
this.reset();
|
|
4207
|
-
}
|
|
4208
|
-
update(toHash, encoding) {
|
|
4209
|
-
this.hash.update(toUint8Array(castSourceData(toHash, encoding)));
|
|
4210
|
-
}
|
|
4211
|
-
digest() {
|
|
4212
|
-
return Promise.resolve(this.hash.digest());
|
|
4213
|
-
}
|
|
4214
|
-
reset() {
|
|
4215
|
-
this.hash = this.secret ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : createHash(this.algorithmIdentifier);
|
|
4216
|
-
}
|
|
4217
|
-
};
|
|
4218
|
-
function castSourceData(toCast, encoding) {
|
|
4219
|
-
if (Buffer2.isBuffer(toCast)) {
|
|
4220
|
-
return toCast;
|
|
4221
|
-
}
|
|
4222
|
-
if (typeof toCast === "string") {
|
|
4223
|
-
return fromString(toCast, encoding);
|
|
4224
|
-
}
|
|
4225
|
-
if (ArrayBuffer.isView(toCast)) {
|
|
4226
|
-
return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
|
|
4227
|
-
}
|
|
4228
|
-
return fromArrayBuffer(toCast);
|
|
4229
|
-
}
|
|
4230
|
-
|
|
4231
|
-
// node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js
|
|
4232
|
-
import { fstatSync, lstatSync, ReadStream } from "node:fs";
|
|
4233
|
-
var calculateBodyLength = (body) => {
|
|
4234
|
-
if (!body) {
|
|
4235
|
-
return 0;
|
|
4236
|
-
}
|
|
4237
|
-
if (typeof body === "string") {
|
|
4238
|
-
return Buffer.byteLength(body);
|
|
4239
|
-
} else if (typeof body.byteLength === "number") {
|
|
4240
|
-
return body.byteLength;
|
|
4241
|
-
} else if (typeof body.size === "number") {
|
|
4242
|
-
return body.size;
|
|
4243
|
-
} else if (typeof body.start === "number" && typeof body.end === "number") {
|
|
4244
|
-
return body.end + 1 - body.start;
|
|
4245
|
-
} else if (body instanceof ReadStream) {
|
|
4246
|
-
if (body.path != null) {
|
|
4247
|
-
return lstatSync(body.path).size;
|
|
4248
|
-
} else if (typeof body.fd === "number") {
|
|
4249
|
-
return fstatSync(body.fd).size;
|
|
4250
|
-
}
|
|
4251
|
-
}
|
|
4252
|
-
throw new Error(`Body Length computation failed for ${body}`);
|
|
4253
|
-
};
|
|
4254
|
-
|
|
4255
|
-
// node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js
|
|
4256
|
-
var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
|
|
4257
|
-
var AWS_REGION_ENV = "AWS_REGION";
|
|
4258
|
-
var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
|
|
4259
|
-
var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
|
|
4260
|
-
var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
|
|
4261
|
-
var IMDS_REGION_PATH = "/latest/meta-data/placement/region";
|
|
4262
|
-
|
|
4263
|
-
// node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js
|
|
4264
|
-
var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
|
|
4265
|
-
var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
|
|
4266
|
-
var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
|
|
4267
|
-
environmentVariableSelector: (env2) => {
|
|
4268
|
-
return env2[AWS_DEFAULTS_MODE_ENV];
|
|
4269
|
-
},
|
|
4270
|
-
configFileSelector: (profile) => {
|
|
4271
|
-
return profile[AWS_DEFAULTS_MODE_CONFIG];
|
|
4272
|
-
},
|
|
4273
|
-
default: "legacy"
|
|
4274
|
-
};
|
|
4275
|
-
|
|
4276
|
-
// node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js
|
|
4277
|
-
var resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
|
|
4278
|
-
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
|
|
4279
|
-
switch (mode?.toLowerCase()) {
|
|
4280
|
-
case "auto":
|
|
4281
|
-
return resolveNodeDefaultsModeAuto(region);
|
|
4282
|
-
case "in-region":
|
|
4283
|
-
case "cross-region":
|
|
4284
|
-
case "mobile":
|
|
4285
|
-
case "standard":
|
|
4286
|
-
case "legacy":
|
|
4287
|
-
return Promise.resolve(mode?.toLocaleLowerCase());
|
|
4288
|
-
case void 0:
|
|
4289
|
-
return Promise.resolve("legacy");
|
|
4290
|
-
default:
|
|
4291
|
-
throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
|
|
4292
|
-
}
|
|
4293
|
-
});
|
|
4294
|
-
var resolveNodeDefaultsModeAuto = async (clientRegion) => {
|
|
4295
|
-
if (clientRegion) {
|
|
4296
|
-
const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
|
|
4297
|
-
const inferredRegion = await inferPhysicalRegion();
|
|
4298
|
-
if (!inferredRegion) {
|
|
4299
|
-
return "standard";
|
|
4300
|
-
}
|
|
4301
|
-
if (resolvedRegion === inferredRegion) {
|
|
4302
|
-
return "in-region";
|
|
4303
|
-
} else {
|
|
4304
|
-
return "cross-region";
|
|
4305
|
-
}
|
|
4306
|
-
}
|
|
4307
|
-
return "standard";
|
|
4308
|
-
};
|
|
4309
|
-
var inferPhysicalRegion = async () => {
|
|
4310
|
-
if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
|
|
4311
|
-
return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
|
|
4312
|
-
}
|
|
4313
|
-
if (!process.env[ENV_IMDS_DISABLED]) {
|
|
4314
|
-
try {
|
|
4315
|
-
const { getInstanceMetadataEndpoint, httpRequest } = await import("./dist-es-O7YXE2TO.js");
|
|
4316
|
-
const endpoint = await getInstanceMetadataEndpoint();
|
|
4317
|
-
return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString();
|
|
4318
|
-
} catch (e) {
|
|
4319
|
-
}
|
|
4320
|
-
}
|
|
4321
|
-
};
|
|
4322
|
-
|
|
4323
|
-
// node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js
|
|
4324
|
-
var getAwsRegionExtensionConfiguration = (runtimeConfig) => {
|
|
4325
|
-
return {
|
|
4326
|
-
setRegion(region) {
|
|
4327
|
-
runtimeConfig.region = region;
|
|
4328
|
-
},
|
|
4329
|
-
region() {
|
|
4330
|
-
return runtimeConfig.region;
|
|
4331
|
-
}
|
|
4332
|
-
};
|
|
4333
|
-
};
|
|
4334
|
-
var resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
|
|
4335
|
-
return {
|
|
4336
|
-
region: awsRegionExtensionConfiguration.region()
|
|
4337
|
-
};
|
|
4338
|
-
};
|
|
4339
|
-
|
|
4340
|
-
export {
|
|
4341
|
-
getHttpHandlerExtensionConfiguration,
|
|
4342
|
-
resolveHttpHandlerRuntimeConfig,
|
|
4343
|
-
resolveHostHeaderConfig,
|
|
4344
|
-
getHostHeaderPlugin,
|
|
4345
|
-
getLoggerPlugin,
|
|
4346
|
-
getRecursionDetectionPlugin,
|
|
4347
|
-
Client,
|
|
4348
|
-
toUint8Array,
|
|
4349
|
-
collectBody,
|
|
4350
|
-
extendedEncodeURIComponent,
|
|
4351
|
-
getSmithyContext,
|
|
4352
|
-
normalizeProvider,
|
|
4353
|
-
Command,
|
|
4354
|
-
SENSITIVE_STRING2 as SENSITIVE_STRING,
|
|
4355
|
-
ServiceException,
|
|
4356
|
-
decorateServiceException,
|
|
4357
|
-
withBaseException,
|
|
4358
|
-
loadConfigsForDefaultMode,
|
|
4359
|
-
emitWarningIfUnsupportedVersion2 as emitWarningIfUnsupportedVersion,
|
|
4360
|
-
getDefaultExtensionConfiguration,
|
|
4361
|
-
resolveDefaultRuntimeConfig,
|
|
4362
|
-
NoOpLogger,
|
|
4363
|
-
getHttpAuthSchemeEndpointRuleSetPlugin,
|
|
4364
|
-
getSerdePlugin,
|
|
4365
|
-
httpSigningMiddlewareOptions,
|
|
4366
|
-
getHttpSigningPlugin,
|
|
4367
|
-
DefaultIdentityProviderConfig,
|
|
4368
|
-
resolveUserAgentConfig,
|
|
4369
|
-
EndpointCache,
|
|
4370
|
-
customEndpointFunctions,
|
|
4371
|
-
resolveEndpoint,
|
|
4372
|
-
awsEndpointFunctions,
|
|
4373
|
-
emitWarningIfUnsupportedVersion as emitWarningIfUnsupportedVersion2,
|
|
4374
|
-
setFeature2 as setFeature,
|
|
4375
|
-
AwsSdkSigV4Signer,
|
|
4376
|
-
AwsSdkSigV4ASigner,
|
|
4377
|
-
NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,
|
|
4378
|
-
resolveAwsSdkSigV4AConfig,
|
|
4379
|
-
NODE_SIGV4A_CONFIG_OPTIONS,
|
|
4380
|
-
SignatureV4,
|
|
4381
|
-
resolveAwsSdkSigV4Config,
|
|
4382
|
-
collectBodyString,
|
|
4383
|
-
getUserAgentPlugin,
|
|
4384
|
-
booleanSelector,
|
|
4385
|
-
SelectorType,
|
|
4386
|
-
NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
|
|
4387
|
-
NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
|
|
4388
|
-
NODE_REGION_CONFIG_OPTIONS,
|
|
4389
|
-
NODE_REGION_CONFIG_FILE_OPTIONS,
|
|
4390
|
-
resolveRegionConfig,
|
|
4391
|
-
getContentLengthPlugin,
|
|
4392
|
-
resolveParams,
|
|
4393
|
-
getEndpointPlugin,
|
|
4394
|
-
resolveEndpointConfig,
|
|
4395
|
-
DEFAULT_RETRY_MODE,
|
|
4396
|
-
NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
|
|
4397
|
-
resolveRetryConfig,
|
|
4398
|
-
NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
4399
|
-
getRetryPlugin,
|
|
4400
|
-
createDefaultUserAgentProvider,
|
|
4401
|
-
NODE_APP_ID_CONFIG_OPTIONS,
|
|
4402
|
-
Hash,
|
|
4403
|
-
calculateBodyLength,
|
|
4404
|
-
resolveDefaultsModeConfig,
|
|
4405
|
-
getAwsRegionExtensionConfiguration,
|
|
4406
|
-
resolveAwsRegionExtensionConfiguration
|
|
4407
|
-
};
|
|
4408
|
-
//# sourceMappingURL=chunk-4QSQRVYQ.js.map
|