@larkup/cli 0.2.25 → 0.2.26
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/README.md +8 -0
- package/dist/{analytics-store-KI3NXDYV.js → analytics-store-4NYU7DMO.js} +2 -2
- package/dist/api-X4PHQJTH.js +6943 -0
- package/dist/bowser-GZLEN3PD.js +2821 -0
- package/dist/{chroma-BCASZNMJ.js → chroma-RJVBZZMP.js} +2 -11
- package/dist/chunk-3EBUYTA7.js +136 -0
- package/dist/chunk-4XN2IRCG.js +46 -0
- package/dist/{chunk-FM6HYXZ5.js → chunk-5UWKP64Q.js} +24 -72
- package/dist/chunk-65EVYGDT.js +2904 -0
- package/dist/chunk-A7HMSODH.js +126 -0
- package/dist/chunk-BDMLJQRN.js +534 -0
- package/dist/chunk-FUTLPXFR.js +921 -0
- package/dist/chunk-HAABLEPO.js +1570 -0
- package/dist/chunk-HOPZALAP.js +449 -0
- package/dist/{chunk-L34L3RDQ.js → chunk-JZ3UCEGF.js} +157 -197
- package/dist/chunk-MACWQEJS.js +2091 -0
- package/dist/chunk-MYOADNR2.js +515 -0
- package/dist/chunk-N6IF5QLH.js +1850 -0
- package/dist/chunk-ODWAFTDP.js +1711 -0
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/chunk-S5DCG3CZ.js +41 -0
- package/dist/{chunk-I6JJWCUQ.js → chunk-V3VNCOZ6.js} +118 -29
- package/dist/dist-es-5DTOPEBY.js +322 -0
- package/dist/dist-es-BM4STLL5.js +70 -0
- package/dist/dist-es-DS5SFRTK.js +377 -0
- package/dist/dist-es-F6WXDZQY.js +88 -0
- package/dist/dist-es-KMHWFNXI.js +295 -0
- package/dist/dist-es-LRDDK5LI.js +11761 -0
- package/dist/dist-es-LWW2DNRF.js +139 -0
- package/dist/dist-es-NEADJWQM.js +176 -0
- package/dist/dist-es-S5FAFKBD.js +23 -0
- package/dist/dist-es-YD724GH3.js +221 -0
- package/dist/event-streams-NPIZBVLJ.js +43 -0
- package/dist/index.js +2074 -1768
- package/dist/{lancedb-UB2EPDCN.js → lancedb-TCUZKSHN.js} +1 -1
- package/dist/lexer-DQCqS3nf-CGRGK47I.js +62 -0
- package/dist/loadSso-HXXA5UNF.js +584 -0
- package/dist/{pinecone-OHOY4YYM.js → pinecone-ME3YOCQJ.js} +3 -21
- package/dist/signin-7FUGJFG3.js +822 -0
- package/dist/sso-oidc-EPMF7LMF.js +838 -0
- package/dist/sts-RBEOIBEJ.js +1118 -0
- package/dist/{tool-loader-KKODIWEV.js → tool-loader-PEQZZWTB.js} +3 -3
- package/dist/{tool-registry-CXCFMOWA.js → tool-registry-VJYLRXKJ.js} +2 -2
- package/package.json +20 -16
- package/dist/chunk-3RG5ZIWI.js +0 -10
|
@@ -0,0 +1,1711 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONFIG_PREFIX_SEPARATOR,
|
|
3
|
+
SelectorType,
|
|
4
|
+
booleanSelector,
|
|
5
|
+
loadConfig
|
|
6
|
+
} from "./chunk-HAABLEPO.js";
|
|
7
|
+
import {
|
|
8
|
+
AlgorithmId,
|
|
9
|
+
EndpointURLScheme,
|
|
10
|
+
NormalizedSchema,
|
|
11
|
+
SMITHY_CONTEXT_KEY,
|
|
12
|
+
getSmithyContext,
|
|
13
|
+
hasOwn,
|
|
14
|
+
isValidHostLabel,
|
|
15
|
+
normalizeProvider,
|
|
16
|
+
toEndpointV1
|
|
17
|
+
} from "./chunk-MACWQEJS.js";
|
|
18
|
+
|
|
19
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js
|
|
20
|
+
var getAllAliases = (name, aliases) => {
|
|
21
|
+
const _aliases = [];
|
|
22
|
+
if (name) {
|
|
23
|
+
_aliases.push(name);
|
|
24
|
+
}
|
|
25
|
+
if (aliases) {
|
|
26
|
+
for (const alias of aliases) {
|
|
27
|
+
_aliases.push(alias);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return _aliases;
|
|
31
|
+
};
|
|
32
|
+
var getMiddlewareNameWithAliases = (name, aliases) => {
|
|
33
|
+
return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
|
|
34
|
+
};
|
|
35
|
+
var constructStack = () => {
|
|
36
|
+
let absoluteEntries = [];
|
|
37
|
+
let relativeEntries = [];
|
|
38
|
+
let identifyOnResolve = false;
|
|
39
|
+
const entriesNameSet = /* @__PURE__ */ new Set();
|
|
40
|
+
const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]);
|
|
41
|
+
const removeByName = (toRemove) => {
|
|
42
|
+
let isRemoved = false;
|
|
43
|
+
const filterCb = (entry) => {
|
|
44
|
+
const aliases = getAllAliases(entry.name, entry.aliases);
|
|
45
|
+
if (aliases.includes(toRemove)) {
|
|
46
|
+
isRemoved = true;
|
|
47
|
+
for (const alias of aliases) {
|
|
48
|
+
entriesNameSet.delete(alias);
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
54
|
+
absoluteEntries = absoluteEntries.filter(filterCb);
|
|
55
|
+
relativeEntries = relativeEntries.filter(filterCb);
|
|
56
|
+
return isRemoved;
|
|
57
|
+
};
|
|
58
|
+
const removeByReference = (toRemove) => {
|
|
59
|
+
let isRemoved = false;
|
|
60
|
+
const filterCb = (entry) => {
|
|
61
|
+
if (entry.middleware === toRemove) {
|
|
62
|
+
isRemoved = true;
|
|
63
|
+
for (const alias of getAllAliases(entry.name, entry.aliases)) {
|
|
64
|
+
entriesNameSet.delete(alias);
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
};
|
|
70
|
+
absoluteEntries = absoluteEntries.filter(filterCb);
|
|
71
|
+
relativeEntries = relativeEntries.filter(filterCb);
|
|
72
|
+
return isRemoved;
|
|
73
|
+
};
|
|
74
|
+
const cloneTo = (toStack) => {
|
|
75
|
+
absoluteEntries.forEach((entry) => {
|
|
76
|
+
toStack.add(entry.middleware, { ...entry });
|
|
77
|
+
});
|
|
78
|
+
relativeEntries.forEach((entry) => {
|
|
79
|
+
toStack.addRelativeTo(entry.middleware, { ...entry });
|
|
80
|
+
});
|
|
81
|
+
toStack.identifyOnResolve?.(stack.identifyOnResolve());
|
|
82
|
+
return toStack;
|
|
83
|
+
};
|
|
84
|
+
const expandRelativeMiddlewareList = (from) => {
|
|
85
|
+
const expandedMiddlewareList = [];
|
|
86
|
+
from.before.forEach((entry) => {
|
|
87
|
+
if (entry.before.length === 0 && entry.after.length === 0) {
|
|
88
|
+
expandedMiddlewareList.push(entry);
|
|
89
|
+
} else {
|
|
90
|
+
expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
expandedMiddlewareList.push(from);
|
|
94
|
+
from.after.reverse().forEach((entry) => {
|
|
95
|
+
if (entry.before.length === 0 && entry.after.length === 0) {
|
|
96
|
+
expandedMiddlewareList.push(entry);
|
|
97
|
+
} else {
|
|
98
|
+
expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return expandedMiddlewareList;
|
|
102
|
+
};
|
|
103
|
+
const getMiddlewareList = (debug = false) => {
|
|
104
|
+
const normalizedAbsoluteEntries = [];
|
|
105
|
+
const normalizedRelativeEntries = [];
|
|
106
|
+
const normalizedEntriesNameMap = {};
|
|
107
|
+
absoluteEntries.forEach((entry) => {
|
|
108
|
+
const normalizedEntry = {
|
|
109
|
+
...entry,
|
|
110
|
+
before: [],
|
|
111
|
+
after: []
|
|
112
|
+
};
|
|
113
|
+
for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
|
|
114
|
+
normalizedEntriesNameMap[alias] = normalizedEntry;
|
|
115
|
+
}
|
|
116
|
+
normalizedAbsoluteEntries.push(normalizedEntry);
|
|
117
|
+
});
|
|
118
|
+
relativeEntries.forEach((entry) => {
|
|
119
|
+
const normalizedEntry = {
|
|
120
|
+
...entry,
|
|
121
|
+
before: [],
|
|
122
|
+
after: []
|
|
123
|
+
};
|
|
124
|
+
for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
|
|
125
|
+
normalizedEntriesNameMap[alias] = normalizedEntry;
|
|
126
|
+
}
|
|
127
|
+
normalizedRelativeEntries.push(normalizedEntry);
|
|
128
|
+
});
|
|
129
|
+
normalizedRelativeEntries.forEach((entry) => {
|
|
130
|
+
if (entry.toMiddleware) {
|
|
131
|
+
const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
|
|
132
|
+
if (toMiddleware === void 0) {
|
|
133
|
+
if (debug) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`);
|
|
137
|
+
}
|
|
138
|
+
if (entry.relation === "after") {
|
|
139
|
+
toMiddleware.after.push(entry);
|
|
140
|
+
}
|
|
141
|
+
if (entry.relation === "before") {
|
|
142
|
+
toMiddleware.before.push(entry);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {
|
|
147
|
+
wholeList.push(...expandedMiddlewareList);
|
|
148
|
+
return wholeList;
|
|
149
|
+
}, []);
|
|
150
|
+
return mainChain;
|
|
151
|
+
};
|
|
152
|
+
const stack = {
|
|
153
|
+
add: (middleware, options = {}) => {
|
|
154
|
+
const { name, override, aliases: _aliases } = options;
|
|
155
|
+
const entry = {
|
|
156
|
+
step: "initialize",
|
|
157
|
+
priority: "normal",
|
|
158
|
+
middleware,
|
|
159
|
+
...options
|
|
160
|
+
};
|
|
161
|
+
const aliases = getAllAliases(name, _aliases);
|
|
162
|
+
if (aliases.length > 0) {
|
|
163
|
+
if (aliases.some((alias) => entriesNameSet.has(alias))) {
|
|
164
|
+
if (!override)
|
|
165
|
+
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
|
|
166
|
+
for (const alias of aliases) {
|
|
167
|
+
const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
|
|
168
|
+
if (toOverrideIndex === -1) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const toOverride = absoluteEntries[toOverrideIndex];
|
|
172
|
+
if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
|
|
173
|
+
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.`);
|
|
174
|
+
}
|
|
175
|
+
absoluteEntries.splice(toOverrideIndex, 1);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
for (const alias of aliases) {
|
|
179
|
+
entriesNameSet.add(alias);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
absoluteEntries.push(entry);
|
|
183
|
+
},
|
|
184
|
+
addRelativeTo: (middleware, options) => {
|
|
185
|
+
const { name, override, aliases: _aliases } = options;
|
|
186
|
+
const entry = {
|
|
187
|
+
middleware,
|
|
188
|
+
...options
|
|
189
|
+
};
|
|
190
|
+
const aliases = getAllAliases(name, _aliases);
|
|
191
|
+
if (aliases.length > 0) {
|
|
192
|
+
if (aliases.some((alias) => entriesNameSet.has(alias))) {
|
|
193
|
+
if (!override)
|
|
194
|
+
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
|
|
195
|
+
for (const alias of aliases) {
|
|
196
|
+
const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
|
|
197
|
+
if (toOverrideIndex === -1) {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
const toOverride = relativeEntries[toOverrideIndex];
|
|
201
|
+
if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
|
|
202
|
+
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.`);
|
|
203
|
+
}
|
|
204
|
+
relativeEntries.splice(toOverrideIndex, 1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
for (const alias of aliases) {
|
|
208
|
+
entriesNameSet.add(alias);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
relativeEntries.push(entry);
|
|
212
|
+
},
|
|
213
|
+
clone: () => cloneTo(constructStack()),
|
|
214
|
+
use: (plugin) => {
|
|
215
|
+
plugin.applyToStack(stack);
|
|
216
|
+
},
|
|
217
|
+
remove: (toRemove) => {
|
|
218
|
+
if (typeof toRemove === "string")
|
|
219
|
+
return removeByName(toRemove);
|
|
220
|
+
else
|
|
221
|
+
return removeByReference(toRemove);
|
|
222
|
+
},
|
|
223
|
+
removeByTag: (toRemove) => {
|
|
224
|
+
let isRemoved = false;
|
|
225
|
+
const filterCb = (entry) => {
|
|
226
|
+
const { tags, name, aliases: _aliases } = entry;
|
|
227
|
+
if (tags && tags.includes(toRemove)) {
|
|
228
|
+
const aliases = getAllAliases(name, _aliases);
|
|
229
|
+
for (const alias of aliases) {
|
|
230
|
+
entriesNameSet.delete(alias);
|
|
231
|
+
}
|
|
232
|
+
isRemoved = true;
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
return true;
|
|
236
|
+
};
|
|
237
|
+
absoluteEntries = absoluteEntries.filter(filterCb);
|
|
238
|
+
relativeEntries = relativeEntries.filter(filterCb);
|
|
239
|
+
return isRemoved;
|
|
240
|
+
},
|
|
241
|
+
concat: (from) => {
|
|
242
|
+
const cloned = cloneTo(constructStack());
|
|
243
|
+
cloned.use(from);
|
|
244
|
+
cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
|
|
245
|
+
return cloned;
|
|
246
|
+
},
|
|
247
|
+
applyToStack: cloneTo,
|
|
248
|
+
identify: () => {
|
|
249
|
+
return getMiddlewareList(true).map((mw) => {
|
|
250
|
+
const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
|
|
251
|
+
return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
identifyOnResolve(toggle) {
|
|
255
|
+
if (typeof toggle === "boolean")
|
|
256
|
+
identifyOnResolve = toggle;
|
|
257
|
+
return identifyOnResolve;
|
|
258
|
+
},
|
|
259
|
+
resolve: (handler, context) => {
|
|
260
|
+
for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
|
|
261
|
+
handler = middleware(handler, context);
|
|
262
|
+
}
|
|
263
|
+
if (identifyOnResolve) {
|
|
264
|
+
console.log(stack.identify());
|
|
265
|
+
}
|
|
266
|
+
return handler;
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
return stack;
|
|
270
|
+
};
|
|
271
|
+
var stepWeights = {
|
|
272
|
+
initialize: 5,
|
|
273
|
+
serialize: 4,
|
|
274
|
+
build: 3,
|
|
275
|
+
finalizeRequest: 2,
|
|
276
|
+
deserialize: 1
|
|
277
|
+
};
|
|
278
|
+
var priorityWeights = {
|
|
279
|
+
high: 3,
|
|
280
|
+
normal: 2,
|
|
281
|
+
low: 1
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client.js
|
|
285
|
+
var Client = class {
|
|
286
|
+
config;
|
|
287
|
+
middlewareStack = constructStack();
|
|
288
|
+
initConfig;
|
|
289
|
+
handlers;
|
|
290
|
+
constructor(config) {
|
|
291
|
+
this.config = config;
|
|
292
|
+
const { protocol, protocolSettings } = config;
|
|
293
|
+
if (protocolSettings) {
|
|
294
|
+
if (typeof protocol === "function") {
|
|
295
|
+
config.protocol = new protocol(protocolSettings);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
send(command, optionsOrCb, cb) {
|
|
300
|
+
const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
|
|
301
|
+
const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
|
|
302
|
+
const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true;
|
|
303
|
+
let handler;
|
|
304
|
+
if (useHandlerCache) {
|
|
305
|
+
if (!this.handlers) {
|
|
306
|
+
this.handlers = /* @__PURE__ */ new WeakMap();
|
|
307
|
+
}
|
|
308
|
+
const handlers = this.handlers;
|
|
309
|
+
if (handlers.has(command.constructor)) {
|
|
310
|
+
handler = handlers.get(command.constructor);
|
|
311
|
+
} else {
|
|
312
|
+
handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
313
|
+
handlers.set(command.constructor, handler);
|
|
314
|
+
}
|
|
315
|
+
} else {
|
|
316
|
+
delete this.handlers;
|
|
317
|
+
handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
318
|
+
}
|
|
319
|
+
if (callback) {
|
|
320
|
+
handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => {
|
|
321
|
+
});
|
|
322
|
+
} else {
|
|
323
|
+
return handler(command).then((result) => result.output);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
destroy() {
|
|
327
|
+
this.config?.requestHandler?.destroy?.();
|
|
328
|
+
delete this.handlers;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js
|
|
333
|
+
var SENSITIVE_STRING = "***SensitiveInformation***";
|
|
334
|
+
function schemaLogFilter(schema, data) {
|
|
335
|
+
if (data == null) {
|
|
336
|
+
return data;
|
|
337
|
+
}
|
|
338
|
+
const ns = NormalizedSchema.of(schema);
|
|
339
|
+
if (ns.getMergedTraits().sensitive) {
|
|
340
|
+
return SENSITIVE_STRING;
|
|
341
|
+
}
|
|
342
|
+
if (ns.isListSchema()) {
|
|
343
|
+
const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
|
|
344
|
+
if (isSensitive) {
|
|
345
|
+
return SENSITIVE_STRING;
|
|
346
|
+
}
|
|
347
|
+
} else if (ns.isMapSchema()) {
|
|
348
|
+
const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
|
|
349
|
+
if (isSensitive) {
|
|
350
|
+
return SENSITIVE_STRING;
|
|
351
|
+
}
|
|
352
|
+
} else if (ns.isStructSchema() && typeof data === "object") {
|
|
353
|
+
const object = data;
|
|
354
|
+
const newObject = {};
|
|
355
|
+
for (const [member, memberNs] of ns.structIterator()) {
|
|
356
|
+
if (object[member] != null) {
|
|
357
|
+
newObject[member] = schemaLogFilter(memberNs, object[member]);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return newObject;
|
|
361
|
+
}
|
|
362
|
+
return data;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js
|
|
366
|
+
var Command = class {
|
|
367
|
+
middlewareStack = constructStack();
|
|
368
|
+
schema;
|
|
369
|
+
static classBuilder() {
|
|
370
|
+
return new ClassBuilder();
|
|
371
|
+
}
|
|
372
|
+
resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) {
|
|
373
|
+
for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
|
|
374
|
+
this.middlewareStack.use(mw);
|
|
375
|
+
}
|
|
376
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
377
|
+
const { logger } = configuration;
|
|
378
|
+
const handlerExecutionContext = {
|
|
379
|
+
logger,
|
|
380
|
+
clientName,
|
|
381
|
+
commandName,
|
|
382
|
+
inputFilterSensitiveLog,
|
|
383
|
+
outputFilterSensitiveLog,
|
|
384
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
385
|
+
commandInstance: this,
|
|
386
|
+
...smithyContext
|
|
387
|
+
},
|
|
388
|
+
...additionalContext
|
|
389
|
+
};
|
|
390
|
+
const { requestHandler } = configuration;
|
|
391
|
+
let requestOptions = options ?? {};
|
|
392
|
+
if (smithyContext.eventStream) {
|
|
393
|
+
requestOptions = {
|
|
394
|
+
isEventStream: true,
|
|
395
|
+
...requestOptions
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
return stack.resolve((request) => requestHandler.handle(request.request, requestOptions), handlerExecutionContext);
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
var ClassBuilder = class {
|
|
402
|
+
_init = () => {
|
|
403
|
+
};
|
|
404
|
+
_ep = {};
|
|
405
|
+
_middlewareFn = () => [];
|
|
406
|
+
_commandName = "";
|
|
407
|
+
_clientName = "";
|
|
408
|
+
_additionalContext = {};
|
|
409
|
+
_smithyContext = {};
|
|
410
|
+
_inputFilterSensitiveLog = void 0;
|
|
411
|
+
_outputFilterSensitiveLog = void 0;
|
|
412
|
+
_serializer = null;
|
|
413
|
+
_deserializer = null;
|
|
414
|
+
_operationSchema;
|
|
415
|
+
init(cb) {
|
|
416
|
+
this._init = cb;
|
|
417
|
+
}
|
|
418
|
+
ep(endpointParameterInstructions) {
|
|
419
|
+
this._ep = endpointParameterInstructions;
|
|
420
|
+
return this;
|
|
421
|
+
}
|
|
422
|
+
m(middlewareSupplier) {
|
|
423
|
+
this._middlewareFn = middlewareSupplier;
|
|
424
|
+
return this;
|
|
425
|
+
}
|
|
426
|
+
s(service, operation, smithyContext = {}) {
|
|
427
|
+
this._smithyContext = {
|
|
428
|
+
service,
|
|
429
|
+
operation,
|
|
430
|
+
...smithyContext
|
|
431
|
+
};
|
|
432
|
+
return this;
|
|
433
|
+
}
|
|
434
|
+
c(additionalContext = {}) {
|
|
435
|
+
this._additionalContext = additionalContext;
|
|
436
|
+
return this;
|
|
437
|
+
}
|
|
438
|
+
n(clientName, commandName) {
|
|
439
|
+
this._clientName = clientName;
|
|
440
|
+
this._commandName = commandName;
|
|
441
|
+
return this;
|
|
442
|
+
}
|
|
443
|
+
f(inputFilter = (_) => _, outputFilter = (_) => _) {
|
|
444
|
+
this._inputFilterSensitiveLog = inputFilter;
|
|
445
|
+
this._outputFilterSensitiveLog = outputFilter;
|
|
446
|
+
return this;
|
|
447
|
+
}
|
|
448
|
+
ser(serializer) {
|
|
449
|
+
this._serializer = serializer;
|
|
450
|
+
return this;
|
|
451
|
+
}
|
|
452
|
+
de(deserializer) {
|
|
453
|
+
this._deserializer = deserializer;
|
|
454
|
+
return this;
|
|
455
|
+
}
|
|
456
|
+
sc(operation) {
|
|
457
|
+
this._operationSchema = operation;
|
|
458
|
+
this._smithyContext.operationSchema = operation;
|
|
459
|
+
return this;
|
|
460
|
+
}
|
|
461
|
+
build() {
|
|
462
|
+
const closure = this;
|
|
463
|
+
let CommandRef;
|
|
464
|
+
return CommandRef = class extends Command {
|
|
465
|
+
input;
|
|
466
|
+
static getEndpointParameterInstructions() {
|
|
467
|
+
return closure._ep;
|
|
468
|
+
}
|
|
469
|
+
constructor(...[input]) {
|
|
470
|
+
super();
|
|
471
|
+
this.input = input ?? {};
|
|
472
|
+
closure._init(this);
|
|
473
|
+
this.schema = closure._operationSchema;
|
|
474
|
+
}
|
|
475
|
+
resolveMiddleware(stack, configuration, options) {
|
|
476
|
+
const op = closure._operationSchema;
|
|
477
|
+
const input = op?.[4] ?? op?.input;
|
|
478
|
+
const output = op?.[5] ?? op?.output;
|
|
479
|
+
return this.resolveMiddlewareWithContext(stack, configuration, options, {
|
|
480
|
+
CommandCtor: CommandRef,
|
|
481
|
+
middlewareFn: closure._middlewareFn,
|
|
482
|
+
clientName: closure._clientName,
|
|
483
|
+
commandName: closure._commandName,
|
|
484
|
+
inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _),
|
|
485
|
+
outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _),
|
|
486
|
+
smithyContext: closure._smithyContext,
|
|
487
|
+
additionalContext: closure._additionalContext
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
serialize = closure._serializer;
|
|
491
|
+
deserialize = closure._deserializer;
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/util-waiter/circularReplacer.js
|
|
497
|
+
var getCircularReplacer = () => {
|
|
498
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
499
|
+
return (key, value) => {
|
|
500
|
+
if (typeof value === "object" && value !== null) {
|
|
501
|
+
if (seen.has(value)) {
|
|
502
|
+
return "[Circular]";
|
|
503
|
+
}
|
|
504
|
+
seen.add(value);
|
|
505
|
+
}
|
|
506
|
+
return value;
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/util-waiter/utils/sleep.js
|
|
511
|
+
var sleep = (seconds) => {
|
|
512
|
+
return new Promise((resolve) => setTimeout(resolve, seconds * 1e3));
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/util-waiter/waiter.js
|
|
516
|
+
var waiterServiceDefaults = {
|
|
517
|
+
minDelay: 2,
|
|
518
|
+
maxDelay: 120
|
|
519
|
+
};
|
|
520
|
+
var WaiterState;
|
|
521
|
+
(function(WaiterState2) {
|
|
522
|
+
WaiterState2["ABORTED"] = "ABORTED";
|
|
523
|
+
WaiterState2["FAILURE"] = "FAILURE";
|
|
524
|
+
WaiterState2["SUCCESS"] = "SUCCESS";
|
|
525
|
+
WaiterState2["RETRY"] = "RETRY";
|
|
526
|
+
WaiterState2["TIMEOUT"] = "TIMEOUT";
|
|
527
|
+
})(WaiterState || (WaiterState = {}));
|
|
528
|
+
var checkExceptions = (result) => {
|
|
529
|
+
if (result.state === WaiterState.ABORTED) {
|
|
530
|
+
const abortError = new Error(`${JSON.stringify({
|
|
531
|
+
...result,
|
|
532
|
+
reason: "Request was aborted"
|
|
533
|
+
}, getCircularReplacer())}`);
|
|
534
|
+
abortError.name = "AbortError";
|
|
535
|
+
throw abortError;
|
|
536
|
+
} else if (result.state === WaiterState.TIMEOUT) {
|
|
537
|
+
const timeoutError = new Error(`${JSON.stringify({
|
|
538
|
+
...result,
|
|
539
|
+
reason: "Waiter has timed out"
|
|
540
|
+
}, getCircularReplacer())}`);
|
|
541
|
+
timeoutError.name = "TimeoutError";
|
|
542
|
+
throw timeoutError;
|
|
543
|
+
} else if (result.state !== WaiterState.SUCCESS) {
|
|
544
|
+
throw new Error(`${JSON.stringify(result, getCircularReplacer())}`);
|
|
545
|
+
}
|
|
546
|
+
return result;
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/util-waiter/poller.js
|
|
550
|
+
var runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => {
|
|
551
|
+
const observedResponses = {};
|
|
552
|
+
const [minDelayMs, maxDelayMs] = [minDelay * 1e3, maxDelay * 1e3];
|
|
553
|
+
let currentAttempt = 0;
|
|
554
|
+
const waitUntil = Date.now() + maxWaitTime * 1e3;
|
|
555
|
+
const warn403Time = Date.now() + 6e4;
|
|
556
|
+
let didWarn403 = false;
|
|
557
|
+
while (true) {
|
|
558
|
+
if (currentAttempt > 0) {
|
|
559
|
+
const delayMs = exponentialBackoffWithJitter(minDelayMs, maxDelayMs, currentAttempt, waitUntil);
|
|
560
|
+
if (abortController?.signal?.aborted || abortSignal?.aborted) {
|
|
561
|
+
const message = "AbortController signal aborted.";
|
|
562
|
+
observedResponses[message] |= 0;
|
|
563
|
+
observedResponses[message] += 1;
|
|
564
|
+
return { state: WaiterState.ABORTED, observedResponses };
|
|
565
|
+
}
|
|
566
|
+
if (Date.now() + delayMs > waitUntil) {
|
|
567
|
+
return { state: WaiterState.TIMEOUT, observedResponses };
|
|
568
|
+
}
|
|
569
|
+
await sleep(delayMs / 1e3);
|
|
570
|
+
}
|
|
571
|
+
const { state, reason } = await acceptorChecks(client, input);
|
|
572
|
+
if (reason) {
|
|
573
|
+
const message = createMessageFromResponse(reason);
|
|
574
|
+
observedResponses[message] |= 0;
|
|
575
|
+
observedResponses[message] += 1;
|
|
576
|
+
}
|
|
577
|
+
if (state !== WaiterState.RETRY) {
|
|
578
|
+
return { state, reason, final: reason, observedResponses };
|
|
579
|
+
}
|
|
580
|
+
currentAttempt += 1;
|
|
581
|
+
if (!didWarn403 && Date.now() >= warn403Time) {
|
|
582
|
+
checkWarn403(observedResponses, client);
|
|
583
|
+
didWarn403 = true;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
var checkWarn403 = (observedResponses = {}, client) => {
|
|
588
|
+
const orderedErrors = Object.keys(observedResponses);
|
|
589
|
+
let maxCount = 0;
|
|
590
|
+
let count403 = 0;
|
|
591
|
+
for (const response of orderedErrors) {
|
|
592
|
+
const n = observedResponses[response] | 0;
|
|
593
|
+
maxCount = Math.max(n, maxCount);
|
|
594
|
+
if (response.startsWith("403:")) {
|
|
595
|
+
count403 += n;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
const clientLogger = client?.config?.logger;
|
|
599
|
+
const warningLogger = typeof clientLogger?.warn === "function" && !clientLogger.constructor?.name?.includes?.("NoOpLogger") ? clientLogger : console;
|
|
600
|
+
if (count403 >= 3 || orderedErrors[orderedErrors.length - 1]?.startsWith("403:")) {
|
|
601
|
+
warningLogger.warn(`@smithy/util-waiter WARN - 403 status code encountered during waiter polling.`);
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
var createMessageFromResponse = (reason) => {
|
|
605
|
+
const status = reason?.$response?.statusCode ?? reason?.$metadata?.httpStatusCode;
|
|
606
|
+
if (reason?.$responseBodyText) {
|
|
607
|
+
return `${status ? status + ": " : ""}Deserialization error for body: ${reason.$responseBodyText}`;
|
|
608
|
+
}
|
|
609
|
+
if (status) {
|
|
610
|
+
if (reason?.$response || reason?.message) {
|
|
611
|
+
return `${status ?? "Unknown"}: ${reason?.message}`;
|
|
612
|
+
}
|
|
613
|
+
return `${status}: OK`;
|
|
614
|
+
}
|
|
615
|
+
return String(reason?.message ?? JSON.stringify(reason, getCircularReplacer()) ?? "Unknown");
|
|
616
|
+
};
|
|
617
|
+
var exponentialBackoffWithJitter = (minDelayMs, maxDelayMs, attempt, waitUntil) => {
|
|
618
|
+
const attemptCountCeiling = Math.log(maxDelayMs / minDelayMs) / Math.log(2) + 1;
|
|
619
|
+
if (attempt > attemptCountCeiling) {
|
|
620
|
+
return maxDelayMs;
|
|
621
|
+
}
|
|
622
|
+
const delay = minDelayMs * 2 ** (attempt - 1);
|
|
623
|
+
const capped = Math.min(delay, maxDelayMs);
|
|
624
|
+
const waitFor = randomInRange(minDelayMs, capped);
|
|
625
|
+
if (Date.now() + waitFor > waitUntil) {
|
|
626
|
+
const timeRemaining = waitUntil - Date.now();
|
|
627
|
+
return Math.max(0, timeRemaining - 500);
|
|
628
|
+
}
|
|
629
|
+
return waitFor;
|
|
630
|
+
};
|
|
631
|
+
var randomInRange = (min, max) => min + Math.random() * (max - min);
|
|
632
|
+
|
|
633
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/util-waiter/utils/validate.js
|
|
634
|
+
var validateWaiterOptions = (options) => {
|
|
635
|
+
if (options.maxWaitTime <= 0) {
|
|
636
|
+
throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`);
|
|
637
|
+
} else if (options.minDelay <= 0) {
|
|
638
|
+
throw new Error(`WaiterConfiguration.minDelay must be greater than 0`);
|
|
639
|
+
} else if (options.maxDelay <= 0) {
|
|
640
|
+
throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`);
|
|
641
|
+
} else if (options.maxWaitTime <= options.minDelay) {
|
|
642
|
+
throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`);
|
|
643
|
+
} else if (options.maxDelay < options.minDelay) {
|
|
644
|
+
throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`);
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/util-waiter/createWaiter.js
|
|
649
|
+
var abortTimeout = (abortSignal) => {
|
|
650
|
+
let onAbort;
|
|
651
|
+
const promise = new Promise((resolve) => {
|
|
652
|
+
onAbort = () => resolve({ state: WaiterState.ABORTED });
|
|
653
|
+
if (typeof abortSignal.addEventListener === "function") {
|
|
654
|
+
abortSignal.addEventListener("abort", onAbort);
|
|
655
|
+
} else {
|
|
656
|
+
abortSignal.onabort = onAbort;
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
return {
|
|
660
|
+
clearListener() {
|
|
661
|
+
if (typeof abortSignal.removeEventListener === "function") {
|
|
662
|
+
abortSignal.removeEventListener("abort", onAbort);
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
aborted: promise
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
var createWaiter = async (options, input, acceptorChecks) => {
|
|
669
|
+
const params = {
|
|
670
|
+
...waiterServiceDefaults,
|
|
671
|
+
...options
|
|
672
|
+
};
|
|
673
|
+
validateWaiterOptions(params);
|
|
674
|
+
const exitConditions = [runPolling(params, input, acceptorChecks)];
|
|
675
|
+
const finalize = [];
|
|
676
|
+
if (options.abortSignal) {
|
|
677
|
+
const { aborted, clearListener } = abortTimeout(options.abortSignal);
|
|
678
|
+
finalize.push(clearListener);
|
|
679
|
+
exitConditions.push(aborted);
|
|
680
|
+
}
|
|
681
|
+
if (options.abortController?.signal) {
|
|
682
|
+
const { aborted, clearListener } = abortTimeout(options.abortController.signal);
|
|
683
|
+
finalize.push(clearListener);
|
|
684
|
+
exitConditions.push(aborted);
|
|
685
|
+
}
|
|
686
|
+
return Promise.race(exitConditions).then((result) => {
|
|
687
|
+
for (const fn of finalize) {
|
|
688
|
+
fn();
|
|
689
|
+
}
|
|
690
|
+
return result;
|
|
691
|
+
});
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js
|
|
695
|
+
var createAggregatedClient = (commands, Client2, options) => {
|
|
696
|
+
for (const [command, CommandCtor] of Object.entries(commands)) {
|
|
697
|
+
const methodImpl = async function(args, optionsOrCb, cb) {
|
|
698
|
+
const command2 = new CommandCtor(args);
|
|
699
|
+
if (typeof optionsOrCb === "function") {
|
|
700
|
+
this.send(command2, optionsOrCb);
|
|
701
|
+
} else if (typeof cb === "function") {
|
|
702
|
+
if (typeof optionsOrCb !== "object")
|
|
703
|
+
throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
|
|
704
|
+
this.send(command2, optionsOrCb || {}, cb);
|
|
705
|
+
} else {
|
|
706
|
+
return this.send(command2, optionsOrCb);
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
|
|
710
|
+
Client2.prototype[methodName] = methodImpl;
|
|
711
|
+
}
|
|
712
|
+
const { paginators = {}, waiters = {} } = options ?? {};
|
|
713
|
+
for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {
|
|
714
|
+
if (Client2.prototype[paginatorName] === void 0) {
|
|
715
|
+
Client2.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) {
|
|
716
|
+
return paginatorFn({
|
|
717
|
+
...paginationConfiguration,
|
|
718
|
+
client: this
|
|
719
|
+
}, commandInput, ...rest);
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
for (const [waiterName, waiterFn] of Object.entries(waiters)) {
|
|
724
|
+
if (Client2.prototype[waiterName] === void 0) {
|
|
725
|
+
Client2.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) {
|
|
726
|
+
let config = waiterConfiguration;
|
|
727
|
+
if (typeof waiterConfiguration === "number") {
|
|
728
|
+
config = {
|
|
729
|
+
maxWaitTime: waiterConfiguration
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
return waiterFn({
|
|
733
|
+
...config,
|
|
734
|
+
client: this
|
|
735
|
+
}, commandInput, ...rest);
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js
|
|
742
|
+
var ServiceException = class _ServiceException extends Error {
|
|
743
|
+
$fault;
|
|
744
|
+
$response;
|
|
745
|
+
$retryable;
|
|
746
|
+
$metadata;
|
|
747
|
+
constructor(options) {
|
|
748
|
+
super(options.message);
|
|
749
|
+
Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);
|
|
750
|
+
this.name = options.name;
|
|
751
|
+
this.$fault = options.$fault;
|
|
752
|
+
this.$metadata = options.$metadata;
|
|
753
|
+
}
|
|
754
|
+
static isInstance(value) {
|
|
755
|
+
if (!value)
|
|
756
|
+
return false;
|
|
757
|
+
const candidate = value;
|
|
758
|
+
return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server");
|
|
759
|
+
}
|
|
760
|
+
static [Symbol.hasInstance](instance) {
|
|
761
|
+
if (!instance)
|
|
762
|
+
return false;
|
|
763
|
+
const candidate = instance;
|
|
764
|
+
if (this === _ServiceException) {
|
|
765
|
+
return _ServiceException.isInstance(instance);
|
|
766
|
+
}
|
|
767
|
+
if (_ServiceException.isInstance(instance)) {
|
|
768
|
+
if (candidate.name && this.name) {
|
|
769
|
+
return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;
|
|
770
|
+
}
|
|
771
|
+
return this.prototype.isPrototypeOf(instance);
|
|
772
|
+
}
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
var decorateServiceException = (exception, additions = {}) => {
|
|
777
|
+
Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => {
|
|
778
|
+
if (exception[k] == void 0 || exception[k] === "") {
|
|
779
|
+
exception[k] = v;
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
const message = exception.message || exception.Message || "UnknownError";
|
|
783
|
+
exception.message = message;
|
|
784
|
+
delete exception.Message;
|
|
785
|
+
return exception;
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/defaults-mode.js
|
|
789
|
+
var loadConfigsForDefaultMode = (mode) => {
|
|
790
|
+
switch (mode) {
|
|
791
|
+
case "standard":
|
|
792
|
+
return {
|
|
793
|
+
retryMode: "standard",
|
|
794
|
+
connectionTimeout: 3100
|
|
795
|
+
};
|
|
796
|
+
case "in-region":
|
|
797
|
+
return {
|
|
798
|
+
retryMode: "standard",
|
|
799
|
+
connectionTimeout: 1100
|
|
800
|
+
};
|
|
801
|
+
case "cross-region":
|
|
802
|
+
return {
|
|
803
|
+
retryMode: "standard",
|
|
804
|
+
connectionTimeout: 3100
|
|
805
|
+
};
|
|
806
|
+
case "mobile":
|
|
807
|
+
return {
|
|
808
|
+
retryMode: "standard",
|
|
809
|
+
connectionTimeout: 3e4
|
|
810
|
+
};
|
|
811
|
+
default:
|
|
812
|
+
return {};
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.js
|
|
817
|
+
var warningEmitted = false;
|
|
818
|
+
var emitWarningIfUnsupportedVersion = (version) => {
|
|
819
|
+
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
|
|
820
|
+
warningEmitted = true;
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js
|
|
825
|
+
var knownAlgorithms = Object.values(AlgorithmId);
|
|
826
|
+
var getChecksumConfiguration = (runtimeConfig) => {
|
|
827
|
+
const checksumAlgorithms = [];
|
|
828
|
+
for (const id in AlgorithmId) {
|
|
829
|
+
if (!hasOwn(AlgorithmId, id))
|
|
830
|
+
continue;
|
|
831
|
+
const algorithmId = AlgorithmId[id];
|
|
832
|
+
if (runtimeConfig[algorithmId] === void 0) {
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
checksumAlgorithms.push({
|
|
836
|
+
algorithmId: () => algorithmId,
|
|
837
|
+
checksumConstructor: () => runtimeConfig[algorithmId]
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
for (const [id, ChecksumCtor] of Object.entries(runtimeConfig.checksumAlgorithms ?? {})) {
|
|
841
|
+
checksumAlgorithms.push({
|
|
842
|
+
algorithmId: () => id,
|
|
843
|
+
checksumConstructor: () => ChecksumCtor
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
return {
|
|
847
|
+
addChecksumAlgorithm(algo) {
|
|
848
|
+
runtimeConfig.checksumAlgorithms = runtimeConfig.checksumAlgorithms ?? {};
|
|
849
|
+
const id = algo.algorithmId();
|
|
850
|
+
const ctor = algo.checksumConstructor();
|
|
851
|
+
if (knownAlgorithms.includes(id)) {
|
|
852
|
+
runtimeConfig.checksumAlgorithms[id.toUpperCase()] = ctor;
|
|
853
|
+
} else {
|
|
854
|
+
runtimeConfig.checksumAlgorithms[id] = ctor;
|
|
855
|
+
}
|
|
856
|
+
checksumAlgorithms.push(algo);
|
|
857
|
+
},
|
|
858
|
+
checksumAlgorithms() {
|
|
859
|
+
return checksumAlgorithms;
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
var resolveChecksumRuntimeConfig = (clientConfig) => {
|
|
864
|
+
const runtimeConfig = {};
|
|
865
|
+
clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
|
|
866
|
+
const id = checksumAlgorithm.algorithmId();
|
|
867
|
+
if (knownAlgorithms.includes(id)) {
|
|
868
|
+
runtimeConfig[id] = checksumAlgorithm.checksumConstructor();
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
return runtimeConfig;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/retry.js
|
|
875
|
+
var getRetryConfiguration = (runtimeConfig) => {
|
|
876
|
+
return {
|
|
877
|
+
setRetryStrategy(retryStrategy) {
|
|
878
|
+
runtimeConfig.retryStrategy = retryStrategy;
|
|
879
|
+
},
|
|
880
|
+
retryStrategy() {
|
|
881
|
+
return runtimeConfig.retryStrategy;
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
var resolveRetryRuntimeConfig = (retryStrategyConfiguration) => {
|
|
886
|
+
const runtimeConfig = {};
|
|
887
|
+
runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
|
|
888
|
+
return runtimeConfig;
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.js
|
|
892
|
+
var getDefaultExtensionConfiguration = (runtimeConfig) => {
|
|
893
|
+
return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));
|
|
894
|
+
};
|
|
895
|
+
var resolveDefaultRuntimeConfig = (config) => {
|
|
896
|
+
return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js
|
|
900
|
+
var getValueFromTextNode = (obj) => {
|
|
901
|
+
const textNodeName = "#text";
|
|
902
|
+
for (const key in obj) {
|
|
903
|
+
if (!hasOwn(obj, key))
|
|
904
|
+
continue;
|
|
905
|
+
if (obj[key][textNodeName] !== void 0) {
|
|
906
|
+
obj[key] = obj[key][textNodeName];
|
|
907
|
+
} else if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
908
|
+
obj[key] = getValueFromTextNode(obj[key]);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return obj;
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/NoOpLogger.js
|
|
915
|
+
var NoOpLogger = class {
|
|
916
|
+
trace() {
|
|
917
|
+
}
|
|
918
|
+
debug() {
|
|
919
|
+
}
|
|
920
|
+
info() {
|
|
921
|
+
}
|
|
922
|
+
warn() {
|
|
923
|
+
}
|
|
924
|
+
error() {
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client-command-builder.js
|
|
929
|
+
function makeBuilder(common, service, name, ep) {
|
|
930
|
+
return function makeCommand(added, plugins, op, $, smithyContext = {}) {
|
|
931
|
+
const epMerged = Object.assign({}, common, added);
|
|
932
|
+
return Command.classBuilder().ep(epMerged).m(function(CommandCtor, clientStack, config, options) {
|
|
933
|
+
const list = plugins.call(this, CommandCtor, clientStack, config, options);
|
|
934
|
+
list.unshift(ep(config, CommandCtor.getEndpointParameterInstructions()));
|
|
935
|
+
return list;
|
|
936
|
+
}).s(service, op, smithyContext).n(name, op.charAt(0).toUpperCase() + op.slice(1) + "Command").sc($).build();
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js
|
|
941
|
+
var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
|
|
942
|
+
var CONFIG_ENDPOINT_URL = "endpoint_url";
|
|
943
|
+
var getEndpointUrlConfig = (serviceId) => ({
|
|
944
|
+
environmentVariableSelector: (env) => {
|
|
945
|
+
const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
|
|
946
|
+
const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")];
|
|
947
|
+
if (serviceEndpointUrl)
|
|
948
|
+
return serviceEndpointUrl;
|
|
949
|
+
const endpointUrl = env[ENV_ENDPOINT_URL];
|
|
950
|
+
if (endpointUrl)
|
|
951
|
+
return endpointUrl;
|
|
952
|
+
return void 0;
|
|
953
|
+
},
|
|
954
|
+
configFileSelector: (profile, config) => {
|
|
955
|
+
if (profile.services) {
|
|
956
|
+
const servicesSectionKey = ["services", profile.services].join(CONFIG_PREFIX_SEPARATOR);
|
|
957
|
+
if (!config || !config[servicesSectionKey]) {
|
|
958
|
+
throw new Error(`The services section "${profile.services}" specified in the profile is not present in the shared configuration file.`);
|
|
959
|
+
}
|
|
960
|
+
const servicesSection = config[servicesSectionKey];
|
|
961
|
+
const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
|
|
962
|
+
const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
|
|
963
|
+
if (endpointUrl2)
|
|
964
|
+
return endpointUrl2;
|
|
965
|
+
}
|
|
966
|
+
const endpointUrl = profile[CONFIG_ENDPOINT_URL];
|
|
967
|
+
if (endpointUrl)
|
|
968
|
+
return endpointUrl;
|
|
969
|
+
return void 0;
|
|
970
|
+
},
|
|
971
|
+
default: void 0
|
|
972
|
+
});
|
|
973
|
+
|
|
974
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.js
|
|
975
|
+
var ENV_IGNORE_CONFIGURED_ENDPOINT_URLS = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS";
|
|
976
|
+
var CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS = "ignore_configured_endpoint_urls";
|
|
977
|
+
var ignoreConfiguredEndpointUrlsConfigSelectors = {
|
|
978
|
+
environmentVariableSelector: (env) => booleanSelector(env, ENV_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.ENV),
|
|
979
|
+
configFileSelector: (profile) => booleanSelector(profile, CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.CONFIG),
|
|
980
|
+
default: false
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js
|
|
984
|
+
var getEndpointFromConfig = async (serviceId) => {
|
|
985
|
+
const ignore = await loadConfig(ignoreConfiguredEndpointUrlsConfigSelectors)();
|
|
986
|
+
if (ignore) {
|
|
987
|
+
return void 0;
|
|
988
|
+
}
|
|
989
|
+
return loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/s3.js
|
|
993
|
+
var resolveParamsForS3 = async (endpointParams) => {
|
|
994
|
+
const bucket = endpointParams?.Bucket || "";
|
|
995
|
+
if (typeof endpointParams.Bucket === "string") {
|
|
996
|
+
endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
|
|
997
|
+
}
|
|
998
|
+
if (isArnBucketName(bucket)) {
|
|
999
|
+
if (endpointParams.ForcePathStyle === true) {
|
|
1000
|
+
throw new Error("Path-style addressing cannot be used with ARN buckets");
|
|
1001
|
+
}
|
|
1002
|
+
} else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
|
|
1003
|
+
endpointParams.ForcePathStyle = true;
|
|
1004
|
+
}
|
|
1005
|
+
if (endpointParams.DisableMultiRegionAccessPoints) {
|
|
1006
|
+
endpointParams.disableMultiRegionAccessPoints = true;
|
|
1007
|
+
endpointParams.DisableMRAP = true;
|
|
1008
|
+
}
|
|
1009
|
+
return endpointParams;
|
|
1010
|
+
};
|
|
1011
|
+
var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/;
|
|
1012
|
+
var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
|
|
1013
|
+
var DOTS_PATTERN = /\.\./;
|
|
1014
|
+
var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
|
|
1015
|
+
var isArnBucketName = (bucketName) => {
|
|
1016
|
+
const [arn, partition, service, , , bucket] = bucketName.split(":");
|
|
1017
|
+
const isArn = arn === "arn" && bucketName.split(":").length >= 6;
|
|
1018
|
+
const isValidArn = Boolean(isArn && partition && service && bucket);
|
|
1019
|
+
if (isArn && !isValidArn) {
|
|
1020
|
+
throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
|
|
1021
|
+
}
|
|
1022
|
+
return isValidArn;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.js
|
|
1026
|
+
var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config, isClientContextParam = false) => {
|
|
1027
|
+
const configProvider = async () => {
|
|
1028
|
+
let configValue;
|
|
1029
|
+
if (isClientContextParam) {
|
|
1030
|
+
const clientContextParams = config.clientContextParams;
|
|
1031
|
+
const nestedValue = clientContextParams?.[configKey];
|
|
1032
|
+
configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey];
|
|
1033
|
+
} else {
|
|
1034
|
+
configValue = config[configKey] ?? config[canonicalEndpointParamKey];
|
|
1035
|
+
}
|
|
1036
|
+
if (typeof configValue === "function") {
|
|
1037
|
+
return configValue();
|
|
1038
|
+
}
|
|
1039
|
+
return configValue;
|
|
1040
|
+
};
|
|
1041
|
+
if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
|
|
1042
|
+
return async () => {
|
|
1043
|
+
const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
|
|
1044
|
+
const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
|
|
1045
|
+
return configValue;
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
|
|
1049
|
+
return async () => {
|
|
1050
|
+
const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
|
|
1051
|
+
const configValue = credentials?.accountId ?? credentials?.AccountId;
|
|
1052
|
+
return configValue;
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
|
1056
|
+
return async () => {
|
|
1057
|
+
if (config.isCustomEndpoint === false) {
|
|
1058
|
+
return void 0;
|
|
1059
|
+
}
|
|
1060
|
+
const endpoint = await configProvider();
|
|
1061
|
+
if (endpoint && typeof endpoint === "object") {
|
|
1062
|
+
if ("url" in endpoint) {
|
|
1063
|
+
return endpoint.url.href;
|
|
1064
|
+
}
|
|
1065
|
+
if ("hostname" in endpoint) {
|
|
1066
|
+
const { protocol, hostname, port, path } = endpoint;
|
|
1067
|
+
return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
return endpoint;
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
return configProvider;
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js
|
|
1077
|
+
function bindGetEndpointFromInstructions(getEndpointFromConfig2) {
|
|
1078
|
+
return async (commandInput, instructionsSupplier, clientConfig, context) => {
|
|
1079
|
+
if (!clientConfig.isCustomEndpoint && !clientConfig.ignoreConfiguredEndpointUrls) {
|
|
1080
|
+
let endpointFromConfig;
|
|
1081
|
+
if (clientConfig.serviceConfiguredEndpoint) {
|
|
1082
|
+
endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
|
|
1083
|
+
} else {
|
|
1084
|
+
endpointFromConfig = await getEndpointFromConfig2(clientConfig.serviceId);
|
|
1085
|
+
}
|
|
1086
|
+
if (endpointFromConfig) {
|
|
1087
|
+
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
|
1088
|
+
clientConfig.isCustomEndpoint = true;
|
|
1089
|
+
context?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${endpointFromConfig}`);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
|
|
1093
|
+
if (typeof clientConfig.endpointProvider !== "function") {
|
|
1094
|
+
throw new Error("config.endpointProvider is not set.");
|
|
1095
|
+
}
|
|
1096
|
+
const endpoint = clientConfig.endpointProvider(endpointParams, context);
|
|
1097
|
+
if (clientConfig.isCustomEndpoint && clientConfig.endpoint) {
|
|
1098
|
+
const customEndpoint = await clientConfig.endpoint();
|
|
1099
|
+
if (customEndpoint?.headers) {
|
|
1100
|
+
endpoint.headers ??= {};
|
|
1101
|
+
for (const [name, value] of Object.entries(customEndpoint.headers)) {
|
|
1102
|
+
endpoint.headers[name] = Array.isArray(value) ? value : [value];
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
return endpoint;
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
|
|
1110
|
+
const endpointParams = {};
|
|
1111
|
+
const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
|
|
1112
|
+
for (const [name, instruction] of Object.entries(instructions)) {
|
|
1113
|
+
switch (instruction.type) {
|
|
1114
|
+
case "staticContextParams":
|
|
1115
|
+
endpointParams[name] = instruction.value;
|
|
1116
|
+
break;
|
|
1117
|
+
case "contextParams":
|
|
1118
|
+
endpointParams[name] = commandInput[instruction.name];
|
|
1119
|
+
break;
|
|
1120
|
+
case "clientContextParams":
|
|
1121
|
+
case "builtInParams":
|
|
1122
|
+
endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")();
|
|
1123
|
+
break;
|
|
1124
|
+
case "operationContextParams":
|
|
1125
|
+
endpointParams[name] = instruction.get(commandInput);
|
|
1126
|
+
break;
|
|
1127
|
+
default:
|
|
1128
|
+
throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
if (Object.keys(instructions).length === 0) {
|
|
1132
|
+
Object.assign(endpointParams, clientConfig);
|
|
1133
|
+
}
|
|
1134
|
+
if (String(clientConfig.serviceId).toLowerCase() === "s3") {
|
|
1135
|
+
await resolveParamsForS3(endpointParams);
|
|
1136
|
+
}
|
|
1137
|
+
return endpointParams;
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js
|
|
1141
|
+
function setFeature(context, feature, value) {
|
|
1142
|
+
if (!context.__smithy_context) {
|
|
1143
|
+
context.__smithy_context = { features: {} };
|
|
1144
|
+
} else if (!context.__smithy_context.features) {
|
|
1145
|
+
context.__smithy_context.features = {};
|
|
1146
|
+
}
|
|
1147
|
+
context.__smithy_context.features[feature] = value;
|
|
1148
|
+
}
|
|
1149
|
+
function bindEndpointMiddleware(getEndpointFromConfig2) {
|
|
1150
|
+
const getEndpointFromInstructions2 = bindGetEndpointFromInstructions(getEndpointFromConfig2);
|
|
1151
|
+
return ({ config, instructions }) => {
|
|
1152
|
+
return (next, context) => async (args) => {
|
|
1153
|
+
if (config.isCustomEndpoint) {
|
|
1154
|
+
setFeature(context, "ENDPOINT_OVERRIDE", "N");
|
|
1155
|
+
}
|
|
1156
|
+
const endpoint = await getEndpointFromInstructions2(args.input, {
|
|
1157
|
+
getEndpointParameterInstructions() {
|
|
1158
|
+
return instructions;
|
|
1159
|
+
}
|
|
1160
|
+
}, { ...config }, context);
|
|
1161
|
+
context.endpointV2 = endpoint;
|
|
1162
|
+
context.authSchemes = endpoint.properties?.authSchemes;
|
|
1163
|
+
const authScheme = context.authSchemes?.[0];
|
|
1164
|
+
if (authScheme) {
|
|
1165
|
+
context["signing_region"] = authScheme.signingRegion;
|
|
1166
|
+
context["signing_service"] = authScheme.signingName;
|
|
1167
|
+
const smithyContext = getSmithyContext(context);
|
|
1168
|
+
const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
|
|
1169
|
+
if (httpAuthOption) {
|
|
1170
|
+
httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
|
|
1171
|
+
signing_region: authScheme.signingRegion,
|
|
1172
|
+
signingRegion: authScheme.signingRegion,
|
|
1173
|
+
signing_service: authScheme.signingName,
|
|
1174
|
+
signingName: authScheme.signingName,
|
|
1175
|
+
signingRegionSet: authScheme.signingRegionSet
|
|
1176
|
+
}, authScheme.properties);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
return next({
|
|
1180
|
+
...args
|
|
1181
|
+
});
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js
|
|
1187
|
+
var serializerMiddlewareOption = {
|
|
1188
|
+
name: "serializerMiddleware",
|
|
1189
|
+
step: "serialize",
|
|
1190
|
+
tags: ["SERIALIZER"],
|
|
1191
|
+
override: true
|
|
1192
|
+
};
|
|
1193
|
+
var endpointMiddlewareOptions = {
|
|
1194
|
+
step: "serialize",
|
|
1195
|
+
tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
|
|
1196
|
+
name: "endpointV2Middleware",
|
|
1197
|
+
override: true,
|
|
1198
|
+
relation: "before",
|
|
1199
|
+
toMiddleware: serializerMiddlewareOption.name
|
|
1200
|
+
};
|
|
1201
|
+
function bindGetEndpointPlugin(getEndpointFromConfig2) {
|
|
1202
|
+
const endpointMiddleware2 = bindEndpointMiddleware(getEndpointFromConfig2);
|
|
1203
|
+
return (config, instructions) => ({
|
|
1204
|
+
applyToStack: (clientStack) => {
|
|
1205
|
+
clientStack.addRelativeTo(endpointMiddleware2({
|
|
1206
|
+
config,
|
|
1207
|
+
instructions
|
|
1208
|
+
}), endpointMiddlewareOptions);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js
|
|
1214
|
+
function bindResolveEndpointConfig(getEndpointFromConfig2) {
|
|
1215
|
+
return (input) => {
|
|
1216
|
+
const tls = input.tls ?? true;
|
|
1217
|
+
const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
|
|
1218
|
+
const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : void 0;
|
|
1219
|
+
const isCustomEndpoint = !!endpoint;
|
|
1220
|
+
const resolvedConfig = Object.assign(input, {
|
|
1221
|
+
endpoint: customEndpointProvider,
|
|
1222
|
+
tls,
|
|
1223
|
+
isCustomEndpoint,
|
|
1224
|
+
useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
|
|
1225
|
+
useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),
|
|
1226
|
+
ignoreConfiguredEndpointUrls: !!input.ignoreConfiguredEndpointUrls
|
|
1227
|
+
});
|
|
1228
|
+
let configuredEndpointPromise = void 0;
|
|
1229
|
+
resolvedConfig.serviceConfiguredEndpoint = async () => {
|
|
1230
|
+
if (input.serviceId && !configuredEndpointPromise) {
|
|
1231
|
+
configuredEndpointPromise = getEndpointFromConfig2(input.serviceId);
|
|
1232
|
+
}
|
|
1233
|
+
return configuredEndpointPromise;
|
|
1234
|
+
};
|
|
1235
|
+
return resolvedConfig;
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js
|
|
1240
|
+
var BinaryDecisionDiagram = class _BinaryDecisionDiagram {
|
|
1241
|
+
nodes;
|
|
1242
|
+
root;
|
|
1243
|
+
conditions;
|
|
1244
|
+
results;
|
|
1245
|
+
constructor(bdd, root, conditions, results) {
|
|
1246
|
+
this.nodes = bdd;
|
|
1247
|
+
this.root = root;
|
|
1248
|
+
this.conditions = conditions;
|
|
1249
|
+
this.results = results;
|
|
1250
|
+
}
|
|
1251
|
+
static from(bdd, root, conditions, results) {
|
|
1252
|
+
return new _BinaryDecisionDiagram(bdd, root, conditions, results);
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js
|
|
1257
|
+
var EndpointCache = class {
|
|
1258
|
+
capacity;
|
|
1259
|
+
data = /* @__PURE__ */ new Map();
|
|
1260
|
+
parameters = [];
|
|
1261
|
+
constructor({ size, params }) {
|
|
1262
|
+
this.capacity = size ?? 50;
|
|
1263
|
+
if (params) {
|
|
1264
|
+
this.parameters = params;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
get(endpointParams, resolver) {
|
|
1268
|
+
const key = this.hash(endpointParams);
|
|
1269
|
+
if (key === false) {
|
|
1270
|
+
return resolver();
|
|
1271
|
+
}
|
|
1272
|
+
if (!this.data.has(key)) {
|
|
1273
|
+
if (this.data.size > this.capacity + 10) {
|
|
1274
|
+
const keys = this.data.keys();
|
|
1275
|
+
let i = 0;
|
|
1276
|
+
while (true) {
|
|
1277
|
+
const { value, done } = keys.next();
|
|
1278
|
+
this.data.delete(value);
|
|
1279
|
+
if (done || ++i > 10) {
|
|
1280
|
+
break;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
this.data.set(key, resolver());
|
|
1285
|
+
}
|
|
1286
|
+
return this.data.get(key);
|
|
1287
|
+
}
|
|
1288
|
+
size() {
|
|
1289
|
+
return this.data.size;
|
|
1290
|
+
}
|
|
1291
|
+
hash(endpointParams) {
|
|
1292
|
+
let buffer = "";
|
|
1293
|
+
const { parameters } = this;
|
|
1294
|
+
if (parameters.length === 0) {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
for (const param of parameters) {
|
|
1298
|
+
const val = String(endpointParams[param] ?? "");
|
|
1299
|
+
if (val.includes("|;")) {
|
|
1300
|
+
return false;
|
|
1301
|
+
}
|
|
1302
|
+
buffer += val + "|;";
|
|
1303
|
+
}
|
|
1304
|
+
return buffer;
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js
|
|
1309
|
+
var EndpointError = class extends Error {
|
|
1310
|
+
constructor(message) {
|
|
1311
|
+
super(message);
|
|
1312
|
+
this.name = "EndpointError";
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js
|
|
1317
|
+
var debugId = "endpoints";
|
|
1318
|
+
|
|
1319
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js
|
|
1320
|
+
function toDebugString(input) {
|
|
1321
|
+
if (typeof input !== "object" || input == null) {
|
|
1322
|
+
return input;
|
|
1323
|
+
}
|
|
1324
|
+
if ("ref" in input) {
|
|
1325
|
+
return `$${toDebugString(input.ref)}`;
|
|
1326
|
+
}
|
|
1327
|
+
if ("fn" in input) {
|
|
1328
|
+
return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
|
|
1329
|
+
}
|
|
1330
|
+
return JSON.stringify(input, null, 2);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js
|
|
1334
|
+
var customEndpointFunctions = {};
|
|
1335
|
+
|
|
1336
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js
|
|
1337
|
+
var booleanEquals = (value1, value2) => value1 === value2;
|
|
1338
|
+
|
|
1339
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js
|
|
1340
|
+
function coalesce(...args) {
|
|
1341
|
+
for (const arg of args) {
|
|
1342
|
+
if (arg != null) {
|
|
1343
|
+
return arg;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
return void 0;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js
|
|
1350
|
+
var getAttrPathList = (path) => {
|
|
1351
|
+
const parts = path.split(".");
|
|
1352
|
+
const pathList = [];
|
|
1353
|
+
for (const part of parts) {
|
|
1354
|
+
const squareBracketIndex = part.indexOf("[");
|
|
1355
|
+
if (squareBracketIndex !== -1) {
|
|
1356
|
+
if (part.indexOf("]") !== part.length - 1) {
|
|
1357
|
+
throw new EndpointError(`Path: '${path}' does not end with ']'`);
|
|
1358
|
+
}
|
|
1359
|
+
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
1360
|
+
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
1361
|
+
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
|
|
1362
|
+
}
|
|
1363
|
+
if (squareBracketIndex !== 0) {
|
|
1364
|
+
pathList.push(part.slice(0, squareBracketIndex));
|
|
1365
|
+
}
|
|
1366
|
+
pathList.push(arrayIndex);
|
|
1367
|
+
} else {
|
|
1368
|
+
pathList.push(part);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
return pathList;
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js
|
|
1375
|
+
var getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
1376
|
+
if (typeof acc !== "object") {
|
|
1377
|
+
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
1378
|
+
} else if (Array.isArray(acc)) {
|
|
1379
|
+
const i = parseInt(index);
|
|
1380
|
+
return acc[i < 0 ? acc.length + i : i];
|
|
1381
|
+
}
|
|
1382
|
+
return acc[index];
|
|
1383
|
+
}, value);
|
|
1384
|
+
|
|
1385
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js
|
|
1386
|
+
var isSet = (value) => value != null;
|
|
1387
|
+
|
|
1388
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js
|
|
1389
|
+
function ite(condition, trueValue, falseValue) {
|
|
1390
|
+
return condition ? trueValue : falseValue;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js
|
|
1394
|
+
var not = (value) => !value;
|
|
1395
|
+
|
|
1396
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js
|
|
1397
|
+
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}$`);
|
|
1398
|
+
var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]");
|
|
1399
|
+
|
|
1400
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js
|
|
1401
|
+
var DEFAULT_PORTS = {
|
|
1402
|
+
[EndpointURLScheme.HTTP]: 80,
|
|
1403
|
+
[EndpointURLScheme.HTTPS]: 443
|
|
1404
|
+
};
|
|
1405
|
+
var parseURL = (value) => {
|
|
1406
|
+
const whatwgURL = (() => {
|
|
1407
|
+
try {
|
|
1408
|
+
if (value instanceof URL) {
|
|
1409
|
+
return value;
|
|
1410
|
+
}
|
|
1411
|
+
if (typeof value === "object" && "hostname" in value) {
|
|
1412
|
+
const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
|
|
1413
|
+
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
|
|
1414
|
+
url.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&");
|
|
1415
|
+
return url;
|
|
1416
|
+
}
|
|
1417
|
+
return new URL(value);
|
|
1418
|
+
} catch (ignored) {
|
|
1419
|
+
return null;
|
|
1420
|
+
}
|
|
1421
|
+
})();
|
|
1422
|
+
if (!whatwgURL) {
|
|
1423
|
+
console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
|
|
1424
|
+
return null;
|
|
1425
|
+
}
|
|
1426
|
+
const urlString = whatwgURL.href;
|
|
1427
|
+
const { host, hostname, pathname, protocol, search } = whatwgURL;
|
|
1428
|
+
if (search) {
|
|
1429
|
+
return null;
|
|
1430
|
+
}
|
|
1431
|
+
const scheme = protocol.slice(0, -1);
|
|
1432
|
+
if (!Object.values(EndpointURLScheme).includes(scheme)) {
|
|
1433
|
+
return null;
|
|
1434
|
+
}
|
|
1435
|
+
const isIp = isIpAddress(hostname);
|
|
1436
|
+
const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`);
|
|
1437
|
+
const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
|
|
1438
|
+
return {
|
|
1439
|
+
scheme,
|
|
1440
|
+
authority,
|
|
1441
|
+
path: pathname,
|
|
1442
|
+
normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
|
|
1443
|
+
isIp
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1447
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js
|
|
1448
|
+
function split(value, delimiter, limit) {
|
|
1449
|
+
if (limit === 1) {
|
|
1450
|
+
return [value];
|
|
1451
|
+
}
|
|
1452
|
+
if (value === "") {
|
|
1453
|
+
return [""];
|
|
1454
|
+
}
|
|
1455
|
+
const parts = value.split(delimiter);
|
|
1456
|
+
if (limit === 0) {
|
|
1457
|
+
return parts;
|
|
1458
|
+
}
|
|
1459
|
+
return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter));
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js
|
|
1463
|
+
var stringEquals = (value1, value2) => value1 === value2;
|
|
1464
|
+
|
|
1465
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js
|
|
1466
|
+
var substring = (input, start, stop, reverse) => {
|
|
1467
|
+
if (input == null || start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) {
|
|
1468
|
+
return null;
|
|
1469
|
+
}
|
|
1470
|
+
if (!reverse) {
|
|
1471
|
+
return input.substring(start, stop);
|
|
1472
|
+
}
|
|
1473
|
+
return input.substring(input.length - stop, input.length - start);
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js
|
|
1477
|
+
var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
1478
|
+
|
|
1479
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js
|
|
1480
|
+
var endpointFunctions = {
|
|
1481
|
+
booleanEquals,
|
|
1482
|
+
coalesce,
|
|
1483
|
+
getAttr,
|
|
1484
|
+
isSet,
|
|
1485
|
+
isValidHostLabel,
|
|
1486
|
+
ite,
|
|
1487
|
+
not,
|
|
1488
|
+
parseURL,
|
|
1489
|
+
split,
|
|
1490
|
+
stringEquals,
|
|
1491
|
+
substring,
|
|
1492
|
+
uriEncode
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1495
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js
|
|
1496
|
+
var evaluateTemplate = (template, options) => {
|
|
1497
|
+
const evaluatedTemplateArr = [];
|
|
1498
|
+
const { referenceRecord, endpointParams } = options;
|
|
1499
|
+
let currentIndex = 0;
|
|
1500
|
+
while (currentIndex < template.length) {
|
|
1501
|
+
const openingBraceIndex = template.indexOf("{", currentIndex);
|
|
1502
|
+
if (openingBraceIndex === -1) {
|
|
1503
|
+
evaluatedTemplateArr.push(template.slice(currentIndex));
|
|
1504
|
+
break;
|
|
1505
|
+
}
|
|
1506
|
+
evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
|
|
1507
|
+
const closingBraceIndex = template.indexOf("}", openingBraceIndex);
|
|
1508
|
+
if (closingBraceIndex === -1) {
|
|
1509
|
+
evaluatedTemplateArr.push(template.slice(openingBraceIndex));
|
|
1510
|
+
break;
|
|
1511
|
+
}
|
|
1512
|
+
if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
|
|
1513
|
+
evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
|
|
1514
|
+
currentIndex = closingBraceIndex + 2;
|
|
1515
|
+
}
|
|
1516
|
+
const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
|
|
1517
|
+
if (parameterName.includes("#")) {
|
|
1518
|
+
const [refName, attrName] = parameterName.split("#");
|
|
1519
|
+
evaluatedTemplateArr.push(getAttr(referenceRecord[refName] ?? endpointParams[refName], attrName));
|
|
1520
|
+
} else {
|
|
1521
|
+
evaluatedTemplateArr.push(referenceRecord[parameterName] ?? endpointParams[parameterName]);
|
|
1522
|
+
}
|
|
1523
|
+
currentIndex = closingBraceIndex + 1;
|
|
1524
|
+
}
|
|
1525
|
+
return evaluatedTemplateArr.join("");
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getReferenceValue.js
|
|
1529
|
+
var getReferenceValue = ({ ref }, options) => {
|
|
1530
|
+
return options.referenceRecord[ref] ?? options.endpointParams[ref];
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateExpression.js
|
|
1534
|
+
var evaluateExpression = (obj, keyName, options) => {
|
|
1535
|
+
if (typeof obj === "string") {
|
|
1536
|
+
return evaluateTemplate(obj, options);
|
|
1537
|
+
} else if (obj["fn"]) {
|
|
1538
|
+
return group.callFunction(obj, options);
|
|
1539
|
+
} else if (obj["ref"]) {
|
|
1540
|
+
return getReferenceValue(obj, options);
|
|
1541
|
+
}
|
|
1542
|
+
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
|
1543
|
+
};
|
|
1544
|
+
var callFunction = ({ fn, argv }, options) => {
|
|
1545
|
+
const evaluatedArgs = Array(argv.length);
|
|
1546
|
+
for (let i = 0; i < evaluatedArgs.length; ++i) {
|
|
1547
|
+
const arg = argv[i];
|
|
1548
|
+
if (typeof arg === "boolean" || typeof arg === "number") {
|
|
1549
|
+
evaluatedArgs[i] = arg;
|
|
1550
|
+
} else {
|
|
1551
|
+
evaluatedArgs[i] = group.evaluateExpression(arg, "arg", options);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
const namespaceSeparatorIndex = fn.indexOf(".");
|
|
1555
|
+
if (namespaceSeparatorIndex !== -1) {
|
|
1556
|
+
const namespaceFunctions = customEndpointFunctions[fn.slice(0, namespaceSeparatorIndex)];
|
|
1557
|
+
const customFunction = namespaceFunctions?.[fn.slice(namespaceSeparatorIndex + 1)];
|
|
1558
|
+
if (typeof customFunction === "function") {
|
|
1559
|
+
return customFunction(...evaluatedArgs);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
const callable = endpointFunctions[fn];
|
|
1563
|
+
if (typeof callable === "function") {
|
|
1564
|
+
return callable(...evaluatedArgs);
|
|
1565
|
+
}
|
|
1566
|
+
throw new Error(`function ${fn} not loaded in endpointFunctions.`);
|
|
1567
|
+
};
|
|
1568
|
+
var group = {
|
|
1569
|
+
evaluateExpression,
|
|
1570
|
+
callFunction
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateCondition.js
|
|
1574
|
+
var evaluateCondition = (condition, options) => {
|
|
1575
|
+
const { assign } = condition;
|
|
1576
|
+
if (assign && assign in options.referenceRecord) {
|
|
1577
|
+
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
|
|
1578
|
+
}
|
|
1579
|
+
const value = callFunction(condition, options);
|
|
1580
|
+
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(condition)} = ${toDebugString(value)}`);
|
|
1581
|
+
const result = value === "" ? true : !!value;
|
|
1582
|
+
if (assign != null) {
|
|
1583
|
+
return { result, toAssign: { name: assign, value } };
|
|
1584
|
+
}
|
|
1585
|
+
return { result };
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.js
|
|
1589
|
+
var getEndpointHeaders = (headers, options) => Object.entries(headers ?? {}).reduce((acc, [headerKey, headerVal]) => {
|
|
1590
|
+
acc[headerKey] = headerVal.map((headerValEntry) => {
|
|
1591
|
+
const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
|
|
1592
|
+
if (typeof processedExpr !== "string") {
|
|
1593
|
+
throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
|
|
1594
|
+
}
|
|
1595
|
+
return processedExpr;
|
|
1596
|
+
});
|
|
1597
|
+
return acc;
|
|
1598
|
+
}, {});
|
|
1599
|
+
|
|
1600
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointProperties.js
|
|
1601
|
+
var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => {
|
|
1602
|
+
acc[propertyKey] = group2.getEndpointProperty(propertyVal, options);
|
|
1603
|
+
return acc;
|
|
1604
|
+
}, {});
|
|
1605
|
+
var getEndpointProperty = (property, options) => {
|
|
1606
|
+
if (Array.isArray(property)) {
|
|
1607
|
+
return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
|
|
1608
|
+
}
|
|
1609
|
+
switch (typeof property) {
|
|
1610
|
+
case "string":
|
|
1611
|
+
return evaluateTemplate(property, options);
|
|
1612
|
+
case "object":
|
|
1613
|
+
if (property === null) {
|
|
1614
|
+
throw new EndpointError(`Unexpected endpoint property: ${property}`);
|
|
1615
|
+
}
|
|
1616
|
+
return group2.getEndpointProperties(property, options);
|
|
1617
|
+
case "boolean":
|
|
1618
|
+
return property;
|
|
1619
|
+
default:
|
|
1620
|
+
throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
var group2 = {
|
|
1624
|
+
getEndpointProperty,
|
|
1625
|
+
getEndpointProperties
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointUrl.js
|
|
1629
|
+
var getEndpointUrl = (endpointUrl, options) => {
|
|
1630
|
+
const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
|
|
1631
|
+
if (typeof expression === "string") {
|
|
1632
|
+
try {
|
|
1633
|
+
return new URL(expression);
|
|
1634
|
+
} catch (error) {
|
|
1635
|
+
console.error(`Failed to construct URL with ${expression}`, error);
|
|
1636
|
+
throw error;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1642
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/decideEndpoint.js
|
|
1643
|
+
var RESULT = 1e8;
|
|
1644
|
+
var decideEndpoint = (bdd, options) => {
|
|
1645
|
+
const { nodes, root, results, conditions } = bdd;
|
|
1646
|
+
let ref = root;
|
|
1647
|
+
const referenceRecord = {};
|
|
1648
|
+
const closure = {
|
|
1649
|
+
referenceRecord,
|
|
1650
|
+
endpointParams: options.endpointParams,
|
|
1651
|
+
logger: options.logger
|
|
1652
|
+
};
|
|
1653
|
+
while (ref !== 1 && ref !== -1 && ref < RESULT) {
|
|
1654
|
+
const node_i = 3 * (Math.abs(ref) - 1);
|
|
1655
|
+
const [condition_i, highRef, lowRef] = [nodes[node_i], nodes[node_i + 1], nodes[node_i + 2]];
|
|
1656
|
+
const [fn, argv, assign] = conditions[condition_i];
|
|
1657
|
+
const evaluation = evaluateCondition({ fn, assign, argv }, closure);
|
|
1658
|
+
if (evaluation.toAssign) {
|
|
1659
|
+
const { name, value } = evaluation.toAssign;
|
|
1660
|
+
referenceRecord[name] = value;
|
|
1661
|
+
}
|
|
1662
|
+
ref = ref >= 0 === evaluation.result ? highRef : lowRef;
|
|
1663
|
+
}
|
|
1664
|
+
if (ref >= RESULT) {
|
|
1665
|
+
const result = results[ref - RESULT];
|
|
1666
|
+
if (result[0] === -1) {
|
|
1667
|
+
const [, errorExpression] = result;
|
|
1668
|
+
throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
|
|
1669
|
+
}
|
|
1670
|
+
const [url, properties, headers] = result;
|
|
1671
|
+
return {
|
|
1672
|
+
url: getEndpointUrl(url, closure),
|
|
1673
|
+
properties: getEndpointProperties(properties, closure),
|
|
1674
|
+
headers: getEndpointHeaders(headers ?? {}, closure)
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
throw new EndpointError(`No matching endpoint.`);
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
// ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js
|
|
1681
|
+
var getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig);
|
|
1682
|
+
var resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);
|
|
1683
|
+
var endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);
|
|
1684
|
+
var getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig);
|
|
1685
|
+
|
|
1686
|
+
export {
|
|
1687
|
+
WaiterState,
|
|
1688
|
+
checkExceptions,
|
|
1689
|
+
createWaiter,
|
|
1690
|
+
Client,
|
|
1691
|
+
Command,
|
|
1692
|
+
createAggregatedClient,
|
|
1693
|
+
ServiceException,
|
|
1694
|
+
decorateServiceException,
|
|
1695
|
+
loadConfigsForDefaultMode,
|
|
1696
|
+
emitWarningIfUnsupportedVersion,
|
|
1697
|
+
getDefaultExtensionConfiguration,
|
|
1698
|
+
resolveDefaultRuntimeConfig,
|
|
1699
|
+
getValueFromTextNode,
|
|
1700
|
+
NoOpLogger,
|
|
1701
|
+
makeBuilder,
|
|
1702
|
+
resolveParams,
|
|
1703
|
+
BinaryDecisionDiagram,
|
|
1704
|
+
EndpointCache,
|
|
1705
|
+
customEndpointFunctions,
|
|
1706
|
+
isIpAddress,
|
|
1707
|
+
decideEndpoint,
|
|
1708
|
+
getEndpointFromInstructions,
|
|
1709
|
+
resolveEndpointConfig,
|
|
1710
|
+
getEndpointPlugin
|
|
1711
|
+
};
|