@semiont/graph 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +0 -6
  2. package/dist/bowser-D72SKZAH.js +2820 -0
  3. package/dist/bowser-D72SKZAH.js.map +1 -0
  4. package/dist/chunk-27S56UPF.js +4754 -0
  5. package/dist/chunk-27S56UPF.js.map +1 -0
  6. package/dist/chunk-4UP2SG3N.js +2095 -0
  7. package/dist/chunk-4UP2SG3N.js.map +1 -0
  8. package/dist/chunk-6DEJAFBY.js +125 -0
  9. package/dist/chunk-6DEJAFBY.js.map +1 -0
  10. package/dist/chunk-7UD62TQI.js +3317 -0
  11. package/dist/chunk-7UD62TQI.js.map +1 -0
  12. package/dist/chunk-B2W57CWL.js +47 -0
  13. package/dist/chunk-B2W57CWL.js.map +1 -0
  14. package/dist/chunk-DCLCNCC5.js +1051 -0
  15. package/dist/chunk-DCLCNCC5.js.map +1 -0
  16. package/dist/chunk-KE4TRQI4.js +576 -0
  17. package/dist/chunk-KE4TRQI4.js.map +1 -0
  18. package/dist/chunk-MWZWSKZD.js +1166 -0
  19. package/dist/chunk-MWZWSKZD.js.map +1 -0
  20. package/dist/chunk-V4VXQDJC.js +436 -0
  21. package/dist/chunk-V4VXQDJC.js.map +1 -0
  22. package/dist/dist-es-2CKOZ7UJ.js +69 -0
  23. package/dist/dist-es-2CKOZ7UJ.js.map +1 -0
  24. package/dist/dist-es-CUJAAJXF.js +6632 -0
  25. package/dist/dist-es-CUJAAJXF.js.map +1 -0
  26. package/dist/dist-es-LM7J2FUI.js +87 -0
  27. package/dist/dist-es-LM7J2FUI.js.map +1 -0
  28. package/dist/dist-es-QTXLRLLM.js +169 -0
  29. package/dist/dist-es-QTXLRLLM.js.map +1 -0
  30. package/dist/dist-es-R223S2WP.js +484 -0
  31. package/dist/dist-es-R223S2WP.js.map +1 -0
  32. package/dist/dist-es-SI3C7IEH.js +22 -0
  33. package/dist/dist-es-SI3C7IEH.js.map +1 -0
  34. package/dist/dist-es-XNPYIYQW.js +314 -0
  35. package/dist/dist-es-XNPYIYQW.js.map +1 -0
  36. package/dist/dist-es-ZYIOCGDF.js +376 -0
  37. package/dist/dist-es-ZYIOCGDF.js.map +1 -0
  38. package/dist/event-streams-AI5RIQ2F.js +1376 -0
  39. package/dist/event-streams-AI5RIQ2F.js.map +1 -0
  40. package/dist/index.js +2 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/loadSso-6PVX5KA7.js +576 -0
  43. package/dist/loadSso-6PVX5KA7.js.map +1 -0
  44. package/dist/signin-GV4P4PGF.js +662 -0
  45. package/dist/signin-GV4P4PGF.js.map +1 -0
  46. package/dist/sso-oidc-WFVKSVW6.js +829 -0
  47. package/dist/sso-oidc-WFVKSVW6.js.map +1 -0
  48. package/dist/sts-7N7QMJRQ.js +1244 -0
  49. package/dist/sts-7N7QMJRQ.js.map +1 -0
  50. package/package.json +12 -7
@@ -0,0 +1,2095 @@
1
+ import {
2
+ LazyJsonString,
3
+ NumericValue,
4
+ Uint8ArrayBlobAdapter,
5
+ _parseEpochTimestamp,
6
+ _parseRfc3339DateTimeWithOffset,
7
+ _parseRfc7231DateTime,
8
+ dateToUtcString,
9
+ fromBase64,
10
+ fromUtf8,
11
+ generateIdempotencyToken,
12
+ quoteHeader,
13
+ sdkStreamMixin,
14
+ splitEvery,
15
+ splitHeader,
16
+ toBase64,
17
+ toUtf8
18
+ } from "./chunk-DCLCNCC5.js";
19
+
20
+ // ../../node_modules/@smithy/types/dist-es/middleware.js
21
+ var SMITHY_CONTEXT_KEY = "__smithy_context";
22
+
23
+ // ../../node_modules/@smithy/types/dist-es/profile.js
24
+ var IniSectionType;
25
+ (function(IniSectionType2) {
26
+ IniSectionType2["PROFILE"] = "profile";
27
+ IniSectionType2["SSO_SESSION"] = "sso-session";
28
+ IniSectionType2["SERVICES"] = "services";
29
+ })(IniSectionType || (IniSectionType = {}));
30
+
31
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/getSmithyContext.js
32
+ var getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});
33
+
34
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js
35
+ var normalizeProvider = (input) => {
36
+ if (typeof input === "function")
37
+ return input;
38
+ const promisified = Promise.resolve(input);
39
+ return () => promisified;
40
+ };
41
+
42
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/parseQueryString.js
43
+ function parseQueryString(querystring) {
44
+ const query = {};
45
+ querystring = querystring.replace(/^\?/, "");
46
+ if (querystring) {
47
+ for (const pair of querystring.split("&")) {
48
+ let [key, value = null] = pair.split("=");
49
+ key = decodeURIComponent(key);
50
+ if (value) {
51
+ value = decodeURIComponent(value);
52
+ }
53
+ if (!(key in query)) {
54
+ query[key] = value;
55
+ } else if (Array.isArray(query[key])) {
56
+ query[key].push(value);
57
+ } else {
58
+ query[key] = [query[key], value];
59
+ }
60
+ }
61
+ }
62
+ return query;
63
+ }
64
+
65
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/parseUrl.js
66
+ var parseUrl = (url) => {
67
+ if (typeof url === "string") {
68
+ return parseUrl(new URL(url));
69
+ }
70
+ const { hostname, pathname, port, protocol, search } = url;
71
+ let query;
72
+ if (search) {
73
+ query = parseQueryString(search);
74
+ }
75
+ return {
76
+ hostname,
77
+ port: port ? parseInt(port) : void 0,
78
+ protocol,
79
+ path: pathname,
80
+ query
81
+ };
82
+ };
83
+
84
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/httpRequest.js
85
+ var HttpRequest = class _HttpRequest {
86
+ method;
87
+ protocol;
88
+ hostname;
89
+ port;
90
+ path;
91
+ query;
92
+ headers;
93
+ username;
94
+ password;
95
+ fragment;
96
+ body;
97
+ constructor(options) {
98
+ this.method = options.method || "GET";
99
+ this.hostname = options.hostname || "localhost";
100
+ this.port = options.port;
101
+ this.query = options.query || {};
102
+ this.headers = options.headers || {};
103
+ this.body = options.body;
104
+ this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
105
+ this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
106
+ this.username = options.username;
107
+ this.password = options.password;
108
+ this.fragment = options.fragment;
109
+ }
110
+ static clone(request) {
111
+ const cloned = new _HttpRequest({
112
+ ...request,
113
+ headers: { ...request.headers }
114
+ });
115
+ if (cloned.query) {
116
+ cloned.query = cloneQuery(cloned.query);
117
+ }
118
+ return cloned;
119
+ }
120
+ static isInstance(request) {
121
+ if (!request) {
122
+ return false;
123
+ }
124
+ const req = request;
125
+ return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
126
+ }
127
+ clone() {
128
+ return _HttpRequest.clone(this);
129
+ }
130
+ };
131
+ function cloneQuery(query) {
132
+ return Object.keys(query).reduce((carry, paramName) => {
133
+ const param = query[paramName];
134
+ return {
135
+ ...carry,
136
+ [paramName]: Array.isArray(param) ? [...param] : param
137
+ };
138
+ }, {});
139
+ }
140
+
141
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js
142
+ var HttpResponse = class {
143
+ statusCode;
144
+ reason;
145
+ headers;
146
+ body;
147
+ constructor(options) {
148
+ this.statusCode = options.statusCode;
149
+ this.reason = options.reason;
150
+ this.headers = options.headers || {};
151
+ this.body = options.body;
152
+ }
153
+ static isInstance(response) {
154
+ if (!response)
155
+ return false;
156
+ const resp = response;
157
+ return typeof resp.statusCode === "number" && typeof resp.headers === "object";
158
+ }
159
+ };
160
+
161
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/isValidHostLabel.js
162
+ var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
163
+ var isValidHostLabel = (value, allowSubDomains = false) => {
164
+ if (!allowSubDomains) {
165
+ return VALID_HOST_LABEL_REGEX.test(value);
166
+ }
167
+ const labels = value.split(".");
168
+ for (const label of labels) {
169
+ if (!isValidHostLabel(label)) {
170
+ return false;
171
+ }
172
+ }
173
+ return true;
174
+ };
175
+
176
+ // ../../node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js
177
+ var toEndpointV1 = (endpoint) => {
178
+ if (typeof endpoint === "object") {
179
+ if ("url" in endpoint) {
180
+ const v1Endpoint = parseUrl(endpoint.url);
181
+ if (endpoint.headers) {
182
+ v1Endpoint.headers = {};
183
+ for (const name in endpoint.headers) {
184
+ v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
185
+ }
186
+ }
187
+ return v1Endpoint;
188
+ }
189
+ return endpoint;
190
+ }
191
+ return parseUrl(endpoint);
192
+ };
193
+
194
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js
195
+ var TypeRegistry = class _TypeRegistry {
196
+ namespace;
197
+ schemas;
198
+ exceptions;
199
+ static registries = /* @__PURE__ */ new Map();
200
+ constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
201
+ this.namespace = namespace;
202
+ this.schemas = schemas;
203
+ this.exceptions = exceptions;
204
+ }
205
+ static for(namespace) {
206
+ if (!_TypeRegistry.registries.has(namespace)) {
207
+ _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace));
208
+ }
209
+ return _TypeRegistry.registries.get(namespace);
210
+ }
211
+ copyFrom(other) {
212
+ const { schemas, exceptions } = this;
213
+ for (const [k, v] of other.schemas) {
214
+ if (!schemas.has(k)) {
215
+ schemas.set(k, v);
216
+ }
217
+ }
218
+ for (const [k, v] of other.exceptions) {
219
+ if (!exceptions.has(k)) {
220
+ exceptions.set(k, v);
221
+ }
222
+ }
223
+ }
224
+ register(shapeId, schema) {
225
+ const qualifiedName = this.normalizeShapeId(shapeId);
226
+ for (const r of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) {
227
+ r.schemas.set(qualifiedName, schema);
228
+ }
229
+ }
230
+ getSchema(shapeId) {
231
+ const id = this.normalizeShapeId(shapeId);
232
+ if (!this.schemas.has(id)) {
233
+ if (!shapeId.includes("#")) {
234
+ const suffix = "#" + shapeId;
235
+ const candidates = [];
236
+ for (const [shapeId2, schema] of this.schemas.entries()) {
237
+ if (shapeId2.endsWith(suffix)) {
238
+ candidates.push(schema);
239
+ }
240
+ }
241
+ if (candidates.length === 1) {
242
+ return candidates[0];
243
+ }
244
+ }
245
+ throw new Error(`@smithy/core/schema - schema not found for ${id}`);
246
+ }
247
+ return this.schemas.get(id);
248
+ }
249
+ registerError(es, ctor) {
250
+ const $error = es;
251
+ const ns = $error[1];
252
+ for (const r of [this, _TypeRegistry.for(ns)]) {
253
+ r.schemas.set(ns + "#" + $error[2], $error);
254
+ r.exceptions.set($error, ctor);
255
+ }
256
+ }
257
+ getErrorCtor(es) {
258
+ const $error = es;
259
+ if (this.exceptions.has($error)) {
260
+ return this.exceptions.get($error);
261
+ }
262
+ const registry = _TypeRegistry.for($error[1]);
263
+ return registry.exceptions.get($error);
264
+ }
265
+ getBaseException() {
266
+ for (const exceptionKey of this.exceptions.keys()) {
267
+ if (Array.isArray(exceptionKey)) {
268
+ const [, ns, name] = exceptionKey;
269
+ const id = ns + "#" + name;
270
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
271
+ return exceptionKey;
272
+ }
273
+ }
274
+ }
275
+ return void 0;
276
+ }
277
+ find(predicate) {
278
+ for (const schema of this.schemas.values()) {
279
+ if (predicate(schema)) {
280
+ return schema;
281
+ }
282
+ }
283
+ return void 0;
284
+ }
285
+ clear() {
286
+ this.schemas.clear();
287
+ this.exceptions.clear();
288
+ }
289
+ normalizeShapeId(shapeId) {
290
+ if (shapeId.includes("#")) {
291
+ return shapeId;
292
+ }
293
+ return this.namespace + "#" + shapeId;
294
+ }
295
+ };
296
+
297
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/property-provider/ProviderError.js
298
+ var ProviderError = class _ProviderError extends Error {
299
+ name = "ProviderError";
300
+ tryNextLink;
301
+ constructor(message, options = true) {
302
+ let logger;
303
+ let tryNextLink = true;
304
+ if (typeof options === "boolean") {
305
+ logger = void 0;
306
+ tryNextLink = options;
307
+ } else if (options != null && typeof options === "object") {
308
+ logger = options.logger;
309
+ tryNextLink = options.tryNextLink ?? true;
310
+ }
311
+ super(message);
312
+ this.tryNextLink = tryNextLink;
313
+ Object.setPrototypeOf(this, _ProviderError.prototype);
314
+ logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
315
+ }
316
+ static from(error, options = true) {
317
+ return Object.assign(new this(error.message, options), error);
318
+ }
319
+ };
320
+
321
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/property-provider/CredentialsProviderError.js
322
+ var CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
323
+ name = "CredentialsProviderError";
324
+ constructor(message, options = true) {
325
+ super(message, options);
326
+ Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
327
+ }
328
+ };
329
+
330
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getProfileName.js
331
+ var ENV_PROFILE = "AWS_PROFILE";
332
+ var DEFAULT_PROFILE = "default";
333
+ var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
334
+
335
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js
336
+ import { join } from "path";
337
+
338
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js
339
+ import { homedir } from "os";
340
+ import { sep } from "path";
341
+ var homeDirCache = {};
342
+ var getHomeDirCacheKey = () => {
343
+ if (process && process.geteuid) {
344
+ return `${process.geteuid()}`;
345
+ }
346
+ return "DEFAULT";
347
+ };
348
+ var getHomeDir = () => {
349
+ const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env;
350
+ if (HOME)
351
+ return HOME;
352
+ if (USERPROFILE)
353
+ return USERPROFILE;
354
+ if (HOMEPATH)
355
+ return `${HOMEDRIVE}${HOMEPATH}`;
356
+ const homeDirCacheKey = getHomeDirCacheKey();
357
+ if (!homeDirCache[homeDirCacheKey])
358
+ homeDirCache[homeDirCacheKey] = homedir();
359
+ return homeDirCache[homeDirCacheKey];
360
+ };
361
+
362
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js
363
+ var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
364
+ var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), ".aws", "config");
365
+
366
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js
367
+ import { join as join3 } from "path";
368
+
369
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/constants.js
370
+ var CONFIG_PREFIX_SEPARATOR = ".";
371
+
372
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigData.js
373
+ var getConfigData = (data) => Object.entries(data).filter(([key]) => {
374
+ const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
375
+ if (indexOfSeparator === -1) {
376
+ return false;
377
+ }
378
+ return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator));
379
+ }).reduce((acc, [key, value]) => {
380
+ const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
381
+ const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;
382
+ acc[updatedKey] = value;
383
+ return acc;
384
+ }, {
385
+ ...data.default && { default: data.default }
386
+ });
387
+
388
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getCredentialsFilepath.js
389
+ import { join as join2 } from "path";
390
+ var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
391
+ var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join2(getHomeDir(), ".aws", "credentials");
392
+
393
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseIni.js
394
+ var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
395
+ var profileNameBlockList = ["__proto__", "profile __proto__"];
396
+ var parseIni = (iniData) => {
397
+ const map = {};
398
+ let currentSection;
399
+ let currentSubSection;
400
+ for (const iniLine of iniData.split(/\r?\n/)) {
401
+ const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim();
402
+ const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]";
403
+ if (isSection) {
404
+ currentSection = void 0;
405
+ currentSubSection = void 0;
406
+ const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
407
+ const matches = prefixKeyRegex.exec(sectionName);
408
+ if (matches) {
409
+ const [, prefix, , name] = matches;
410
+ if (Object.values(IniSectionType).includes(prefix)) {
411
+ currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);
412
+ }
413
+ } else {
414
+ currentSection = sectionName;
415
+ }
416
+ if (profileNameBlockList.includes(sectionName)) {
417
+ throw new Error(`Found invalid profile name "${sectionName}"`);
418
+ }
419
+ } else if (currentSection) {
420
+ const indexOfEqualsSign = trimmedLine.indexOf("=");
421
+ if (![0, -1].includes(indexOfEqualsSign)) {
422
+ const [name, value] = [
423
+ trimmedLine.substring(0, indexOfEqualsSign).trim(),
424
+ trimmedLine.substring(indexOfEqualsSign + 1).trim()
425
+ ];
426
+ if (value === "") {
427
+ currentSubSection = name;
428
+ } else {
429
+ if (currentSubSection && iniLine.trimStart() === iniLine) {
430
+ currentSubSection = void 0;
431
+ }
432
+ map[currentSection] = map[currentSection] || {};
433
+ const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;
434
+ map[currentSection][key] = value;
435
+ }
436
+ }
437
+ }
438
+ }
439
+ return map;
440
+ };
441
+
442
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js
443
+ import { readFile as fsReadFile } from "fs/promises";
444
+ var filePromises = {};
445
+ var fileIntercept = {};
446
+ var readFile = (path, options) => {
447
+ if (fileIntercept[path] !== void 0) {
448
+ return fileIntercept[path];
449
+ }
450
+ if (!filePromises[path] || options?.ignoreCache) {
451
+ filePromises[path] = fsReadFile(path, "utf8");
452
+ }
453
+ return filePromises[path];
454
+ };
455
+
456
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js
457
+ var swallowError = () => ({});
458
+ var loadSharedConfigFiles = async (init = {}) => {
459
+ const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;
460
+ const homeDir = getHomeDir();
461
+ const relativeHomeDirPrefix = "~/";
462
+ let resolvedFilepath = filepath;
463
+ if (filepath.startsWith(relativeHomeDirPrefix)) {
464
+ resolvedFilepath = join3(homeDir, filepath.slice(2));
465
+ }
466
+ let resolvedConfigFilepath = configFilepath;
467
+ if (configFilepath.startsWith(relativeHomeDirPrefix)) {
468
+ resolvedConfigFilepath = join3(homeDir, configFilepath.slice(2));
469
+ }
470
+ const parsedFiles = await Promise.all([
471
+ readFile(resolvedConfigFilepath, {
472
+ ignoreCache: init.ignoreCache
473
+ }).then(parseIni).then(getConfigData).catch(swallowError),
474
+ readFile(resolvedFilepath, {
475
+ ignoreCache: init.ignoreCache
476
+ }).then(parseIni).catch(swallowError)
477
+ ]);
478
+ return {
479
+ configFile: parsedFiles[0],
480
+ credentialsFile: parsedFiles[1]
481
+ };
482
+ };
483
+
484
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSsoSessionData.js
485
+ var getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});
486
+
487
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSsoSessionData.js
488
+ var swallowError2 = () => ({});
489
+ var loadSsoSessionData = async (init = {}) => readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2);
490
+
491
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/mergeConfigFiles.js
492
+ var mergeConfigFiles = (...files) => {
493
+ const merged = {};
494
+ for (const file of files) {
495
+ for (const [key, values] of Object.entries(file)) {
496
+ if (merged[key] !== void 0) {
497
+ Object.assign(merged[key], values);
498
+ } else {
499
+ merged[key] = values;
500
+ }
501
+ }
502
+ }
503
+ return merged;
504
+ };
505
+
506
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseKnownFiles.js
507
+ var parseKnownFiles = async (init) => {
508
+ const parsedFiles = await loadSharedConfigFiles(init);
509
+ return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
510
+ };
511
+
512
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.js
513
+ import { readFile as readFile2 } from "fs/promises";
514
+
515
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.js
516
+ import { createHash } from "crypto";
517
+ import { join as join4 } from "path";
518
+ var getSSOTokenFilepath = (id) => {
519
+ const hasher = createHash("sha1");
520
+ const cacheName = hasher.update(id).digest("hex");
521
+ return join4(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
522
+ };
523
+
524
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.js
525
+ var tokenIntercept = {};
526
+ var getSSOTokenFromFile = async (id) => {
527
+ if (tokenIntercept[id]) {
528
+ return tokenIntercept[id];
529
+ }
530
+ const ssoTokenFilepath = getSSOTokenFilepath(id);
531
+ const ssoTokenText = await readFile2(ssoTokenFilepath, "utf8");
532
+ return JSON.parse(ssoTokenText);
533
+ };
534
+
535
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/externalDataInterceptor.js
536
+ var externalDataInterceptor = {
537
+ getFileRecord() {
538
+ return fileIntercept;
539
+ },
540
+ interceptFile(path, contents) {
541
+ fileIntercept[path] = Promise.resolve(contents);
542
+ },
543
+ getTokenRecord() {
544
+ return tokenIntercept;
545
+ },
546
+ interceptToken(id, contents) {
547
+ tokenIntercept[id] = contents;
548
+ }
549
+ };
550
+
551
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/property-provider/chain.js
552
+ var chain = (...providers) => async () => {
553
+ if (providers.length === 0) {
554
+ throw new ProviderError("No providers in chain");
555
+ }
556
+ let lastProviderError;
557
+ for (const provider of providers) {
558
+ try {
559
+ const credentials = await provider();
560
+ return credentials;
561
+ } catch (err) {
562
+ lastProviderError = err;
563
+ if (err?.tryNextLink) {
564
+ continue;
565
+ }
566
+ throw err;
567
+ }
568
+ }
569
+ throw lastProviderError;
570
+ };
571
+
572
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/property-provider/memoize.js
573
+ var memoize = (provider, isExpired, requiresRefresh) => {
574
+ let resolved;
575
+ let pending;
576
+ let hasResult;
577
+ let isConstant = false;
578
+ const coalesceProvider = async () => {
579
+ if (!pending) {
580
+ pending = provider();
581
+ }
582
+ try {
583
+ resolved = await pending;
584
+ hasResult = true;
585
+ isConstant = false;
586
+ } finally {
587
+ pending = void 0;
588
+ }
589
+ return resolved;
590
+ };
591
+ if (isExpired === void 0) {
592
+ return async (options) => {
593
+ if (!hasResult || options?.forceRefresh) {
594
+ resolved = await coalesceProvider();
595
+ }
596
+ return resolved;
597
+ };
598
+ }
599
+ return async (options) => {
600
+ if (!hasResult || options?.forceRefresh) {
601
+ resolved = await coalesceProvider();
602
+ }
603
+ if (isConstant) {
604
+ return resolved;
605
+ }
606
+ if (requiresRefresh && !requiresRefresh(resolved)) {
607
+ isConstant = true;
608
+ return resolved;
609
+ }
610
+ if (isExpired(resolved)) {
611
+ await coalesceProvider();
612
+ return resolved;
613
+ }
614
+ return resolved;
615
+ };
616
+ };
617
+
618
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/getSelectorName.js
619
+ function getSelectorName(functionString) {
620
+ try {
621
+ const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
622
+ constants.delete("CONFIG");
623
+ constants.delete("CONFIG_PREFIX_SEPARATOR");
624
+ constants.delete("ENV");
625
+ return [...constants].join(", ");
626
+ } catch (e) {
627
+ return functionString;
628
+ }
629
+ }
630
+
631
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromEnv.js
632
+ var fromEnv = (envVarSelector, options) => async () => {
633
+ try {
634
+ const config = envVarSelector(process.env, options);
635
+ if (config === void 0) {
636
+ throw new Error();
637
+ }
638
+ return config;
639
+ } catch (e) {
640
+ throw new CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });
641
+ }
642
+ };
643
+
644
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromSharedConfigFiles.js
645
+ var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => {
646
+ const profile = getProfileName(init);
647
+ const { configFile, credentialsFile } = await loadSharedConfigFiles(init);
648
+ const profileFromCredentials = credentialsFile[profile] || {};
649
+ const profileFromConfig = configFile[profile] || {};
650
+ const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials };
651
+ try {
652
+ const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
653
+ const configValue = configSelector(mergedProfile, cfgFile);
654
+ if (configValue === void 0) {
655
+ throw new Error();
656
+ }
657
+ return configValue;
658
+ } catch (e) {
659
+ throw new CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });
660
+ }
661
+ };
662
+
663
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/property-provider/fromValue.js
664
+ var fromValue = (staticValue) => () => Promise.resolve(staticValue);
665
+
666
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromStatic.js
667
+ var isFunction = (func) => typeof func === "function";
668
+ var fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : fromValue(defaultValue);
669
+
670
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/configLoader.js
671
+ var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
672
+ const { signingName, logger } = configuration;
673
+ const envOptions = { signingName, logger };
674
+ return memoize(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));
675
+ };
676
+
677
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js
678
+ var validRegions = /* @__PURE__ */ new Set();
679
+ var checkRegion = (region, check = isValidHostLabel) => {
680
+ if (!validRegions.has(region) && !check(region)) {
681
+ if (region === "*") {
682
+ 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.`);
683
+ } else {
684
+ throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`);
685
+ }
686
+ } else {
687
+ validRegions.add(region);
688
+ }
689
+ };
690
+
691
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/isFipsRegion.js
692
+ var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips"));
693
+
694
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getRealRegion.js
695
+ var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region;
696
+
697
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/resolveRegionConfig.js
698
+ var resolveRegionConfig = (input) => {
699
+ const { region, useFipsEndpoint } = input;
700
+ if (!region) {
701
+ throw new Error("Region is missing");
702
+ }
703
+ return Object.assign(input, {
704
+ region: async () => {
705
+ const providedRegion = typeof region === "function" ? await region() : region;
706
+ const realRegion = getRealRegion(providedRegion);
707
+ checkRegion(realRegion);
708
+ return realRegion;
709
+ },
710
+ useFipsEndpoint: async () => {
711
+ const providedRegion = typeof region === "string" ? region : await region();
712
+ if (isFipsRegion(providedRegion)) {
713
+ return true;
714
+ }
715
+ return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
716
+ }
717
+ });
718
+ };
719
+
720
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/property-provider/TokenProviderError.js
721
+ var TokenProviderError = class _TokenProviderError extends ProviderError {
722
+ name = "TokenProviderError";
723
+ constructor(message, options = true) {
724
+ super(message, options);
725
+ Object.setPrototypeOf(this, _TokenProviderError.prototype);
726
+ }
727
+ };
728
+
729
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js
730
+ var booleanSelector = (obj, key, type) => {
731
+ if (!(key in obj))
732
+ return void 0;
733
+ if (obj[key] === "true")
734
+ return true;
735
+ if (obj[key] === "false")
736
+ return false;
737
+ throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
738
+ };
739
+
740
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js
741
+ var SelectorType;
742
+ (function(SelectorType2) {
743
+ SelectorType2["ENV"] = "env";
744
+ SelectorType2["CONFIG"] = "shared config entry";
745
+ })(SelectorType || (SelectorType = {}));
746
+
747
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
748
+ var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
749
+ var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
750
+ var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
751
+ environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),
752
+ configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG),
753
+ default: false
754
+ };
755
+
756
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.js
757
+ var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
758
+ var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
759
+ var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
760
+ environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),
761
+ configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG),
762
+ default: false
763
+ };
764
+
765
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/deref.js
766
+ var deref = (schemaRef) => {
767
+ if (typeof schemaRef === "function") {
768
+ return schemaRef();
769
+ }
770
+ return schemaRef;
771
+ };
772
+
773
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js
774
+ var traitsCache = [];
775
+ function translateTraits(indicator) {
776
+ if (typeof indicator === "object") {
777
+ return indicator;
778
+ }
779
+ indicator = indicator | 0;
780
+ if (traitsCache[indicator]) {
781
+ return traitsCache[indicator];
782
+ }
783
+ const traits = {};
784
+ let i = 0;
785
+ for (const trait of [
786
+ "httpLabel",
787
+ "idempotent",
788
+ "idempotencyToken",
789
+ "sensitive",
790
+ "httpPayload",
791
+ "httpResponseCode",
792
+ "httpQueryParams"
793
+ ]) {
794
+ if ((indicator >> i++ & 1) === 1) {
795
+ traits[trait] = 1;
796
+ }
797
+ }
798
+ return traitsCache[indicator] = traits;
799
+ }
800
+
801
+ // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js
802
+ var anno = {
803
+ it: /* @__PURE__ */ Symbol.for("@smithy/nor-struct-it"),
804
+ ns: /* @__PURE__ */ Symbol.for("@smithy/ns")
805
+ };
806
+ var simpleSchemaCacheN = [];
807
+ var simpleSchemaCacheS = {};
808
+ var NormalizedSchema = class _NormalizedSchema {
809
+ ref;
810
+ memberName;
811
+ static symbol = /* @__PURE__ */ Symbol.for("@smithy/nor");
812
+ symbol = _NormalizedSchema.symbol;
813
+ name;
814
+ schema;
815
+ _isMemberSchema;
816
+ traits;
817
+ memberTraits;
818
+ normalizedTraits;
819
+ constructor(ref, memberName) {
820
+ this.ref = ref;
821
+ this.memberName = memberName;
822
+ const traitStack = [];
823
+ let _ref = ref;
824
+ let schema = ref;
825
+ this._isMemberSchema = false;
826
+ while (isMemberSchema(_ref)) {
827
+ traitStack.push(_ref[1]);
828
+ _ref = _ref[0];
829
+ schema = deref(_ref);
830
+ this._isMemberSchema = true;
831
+ }
832
+ if (traitStack.length > 0) {
833
+ this.memberTraits = {};
834
+ for (let i = traitStack.length - 1; i >= 0; --i) {
835
+ const traitSet = traitStack[i];
836
+ Object.assign(this.memberTraits, translateTraits(traitSet));
837
+ }
838
+ } else {
839
+ this.memberTraits = 0;
840
+ }
841
+ if (schema instanceof _NormalizedSchema) {
842
+ const computedMemberTraits = this.memberTraits;
843
+ Object.assign(this, schema);
844
+ this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
845
+ this.normalizedTraits = void 0;
846
+ this.memberName = memberName ?? schema.memberName;
847
+ return;
848
+ }
849
+ this.schema = deref(schema);
850
+ if (isStaticSchema(this.schema)) {
851
+ this.name = `${this.schema[1]}#${this.schema[2]}`;
852
+ this.traits = this.schema[3];
853
+ } else {
854
+ this.name = this.memberName ?? String(schema);
855
+ this.traits = 0;
856
+ }
857
+ if (this._isMemberSchema && !memberName) {
858
+ throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
859
+ }
860
+ }
861
+ static [Symbol.hasInstance](lhs) {
862
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
863
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
864
+ const ns = lhs;
865
+ return ns.symbol === this.symbol;
866
+ }
867
+ return isPrototype;
868
+ }
869
+ static of(ref) {
870
+ const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null;
871
+ if (typeof ref === "number") {
872
+ if (simpleSchemaCacheN[ref]) {
873
+ return simpleSchemaCacheN[ref];
874
+ }
875
+ } else if (typeof ref === "string") {
876
+ if (simpleSchemaCacheS[ref]) {
877
+ return simpleSchemaCacheS[ref];
878
+ }
879
+ } else if (keyAble) {
880
+ if (ref[anno.ns]) {
881
+ return ref[anno.ns];
882
+ }
883
+ }
884
+ const sc = deref(ref);
885
+ if (sc instanceof _NormalizedSchema) {
886
+ return sc;
887
+ }
888
+ if (isMemberSchema(sc)) {
889
+ const [ns2, traits] = sc;
890
+ if (ns2 instanceof _NormalizedSchema) {
891
+ Object.assign(ns2.getMergedTraits(), translateTraits(traits));
892
+ return ns2;
893
+ }
894
+ throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
895
+ }
896
+ const ns = new _NormalizedSchema(sc);
897
+ if (keyAble) {
898
+ return ref[anno.ns] = ns;
899
+ }
900
+ if (typeof sc === "string") {
901
+ return simpleSchemaCacheS[sc] = ns;
902
+ }
903
+ if (typeof sc === "number") {
904
+ return simpleSchemaCacheN[sc] = ns;
905
+ }
906
+ return ns;
907
+ }
908
+ getSchema() {
909
+ const sc = this.schema;
910
+ if (Array.isArray(sc) && sc[0] === 0) {
911
+ return sc[4];
912
+ }
913
+ return sc;
914
+ }
915
+ getName(withNamespace = false) {
916
+ const { name } = this;
917
+ const short = !withNamespace && name && name.includes("#");
918
+ return short ? name.split("#")[1] : name || void 0;
919
+ }
920
+ getMemberName() {
921
+ return this.memberName;
922
+ }
923
+ isMemberSchema() {
924
+ return this._isMemberSchema;
925
+ }
926
+ isListSchema() {
927
+ const sc = this.getSchema();
928
+ return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
929
+ }
930
+ isMapSchema() {
931
+ const sc = this.getSchema();
932
+ return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
933
+ }
934
+ isStructSchema() {
935
+ const sc = this.getSchema();
936
+ if (typeof sc !== "object") {
937
+ return false;
938
+ }
939
+ const id = sc[0];
940
+ return id === 3 || id === -3 || id === 4;
941
+ }
942
+ isUnionSchema() {
943
+ const sc = this.getSchema();
944
+ if (typeof sc !== "object") {
945
+ return false;
946
+ }
947
+ return sc[0] === 4;
948
+ }
949
+ isBlobSchema() {
950
+ const sc = this.getSchema();
951
+ return sc === 21 || sc === 42;
952
+ }
953
+ isTimestampSchema() {
954
+ const sc = this.getSchema();
955
+ return typeof sc === "number" && sc >= 4 && sc <= 7;
956
+ }
957
+ isUnitSchema() {
958
+ return this.getSchema() === "unit";
959
+ }
960
+ isDocumentSchema() {
961
+ return this.getSchema() === 15;
962
+ }
963
+ isStringSchema() {
964
+ return this.getSchema() === 0;
965
+ }
966
+ isBooleanSchema() {
967
+ return this.getSchema() === 2;
968
+ }
969
+ isNumericSchema() {
970
+ return this.getSchema() === 1;
971
+ }
972
+ isBigIntegerSchema() {
973
+ return this.getSchema() === 17;
974
+ }
975
+ isBigDecimalSchema() {
976
+ return this.getSchema() === 19;
977
+ }
978
+ isStreaming() {
979
+ const { streaming } = this.getMergedTraits();
980
+ return !!streaming || this.getSchema() === 42;
981
+ }
982
+ isIdempotencyToken() {
983
+ return !!this.getMergedTraits().idempotencyToken;
984
+ }
985
+ getMergedTraits() {
986
+ return this.normalizedTraits ?? (this.normalizedTraits = {
987
+ ...this.getOwnTraits(),
988
+ ...this.getMemberTraits()
989
+ });
990
+ }
991
+ getMemberTraits() {
992
+ return translateTraits(this.memberTraits);
993
+ }
994
+ getOwnTraits() {
995
+ return translateTraits(this.traits);
996
+ }
997
+ getKeySchema() {
998
+ const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];
999
+ if (!isDoc && !isMap) {
1000
+ throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
1001
+ }
1002
+ const schema = this.getSchema();
1003
+ const memberSchema = isDoc ? 15 : schema[4] ?? 0;
1004
+ return member([memberSchema, 0], "key");
1005
+ }
1006
+ getValueSchema() {
1007
+ const sc = this.getSchema();
1008
+ const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()];
1009
+ const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0;
1010
+ if (memberSchema != null) {
1011
+ return member([memberSchema, 0], isMap ? "value" : "member");
1012
+ }
1013
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
1014
+ }
1015
+ getMemberSchema(memberName) {
1016
+ const struct = this.getSchema();
1017
+ if (this.isStructSchema() && struct[4].includes(memberName)) {
1018
+ const i = struct[4].indexOf(memberName);
1019
+ const memberSchema = struct[5][i];
1020
+ return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);
1021
+ }
1022
+ if (this.isDocumentSchema()) {
1023
+ return member([15, 0], memberName);
1024
+ }
1025
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`);
1026
+ }
1027
+ getMemberSchemas() {
1028
+ const buffer = {};
1029
+ try {
1030
+ for (const [k, v] of this.structIterator()) {
1031
+ buffer[k] = v;
1032
+ }
1033
+ } catch (ignored) {
1034
+ }
1035
+ return buffer;
1036
+ }
1037
+ getEventStreamMember() {
1038
+ if (this.isStructSchema()) {
1039
+ for (const [memberName, memberSchema] of this.structIterator()) {
1040
+ if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
1041
+ return memberName;
1042
+ }
1043
+ }
1044
+ }
1045
+ return "";
1046
+ }
1047
+ *structIterator() {
1048
+ if (this.isUnitSchema()) {
1049
+ return;
1050
+ }
1051
+ if (!this.isStructSchema()) {
1052
+ throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
1053
+ }
1054
+ const struct = this.getSchema();
1055
+ const z = struct[4].length;
1056
+ let it = struct[anno.it];
1057
+ if (it && z === it.length) {
1058
+ yield* it;
1059
+ return;
1060
+ }
1061
+ it = Array(z);
1062
+ for (let i = 0; i < z; ++i) {
1063
+ const k = struct[4][i];
1064
+ const v = member([struct[5][i], 0], k);
1065
+ yield it[i] = [k, v];
1066
+ }
1067
+ struct[anno.it] = it;
1068
+ }
1069
+ };
1070
+ function member(memberSchema, memberName) {
1071
+ if (memberSchema instanceof NormalizedSchema) {
1072
+ return Object.assign(memberSchema, {
1073
+ memberName,
1074
+ _isMemberSchema: true
1075
+ });
1076
+ }
1077
+ const internalCtorAccess = NormalizedSchema;
1078
+ return new internalCtorAccess(memberSchema, memberName);
1079
+ }
1080
+ var isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
1081
+ var isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
1082
+
1083
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js
1084
+ var REGION_ENV_NAME = "AWS_REGION";
1085
+ var REGION_INI_NAME = "region";
1086
+ var NODE_REGION_CONFIG_OPTIONS = {
1087
+ environmentVariableSelector: (env) => env[REGION_ENV_NAME],
1088
+ configFileSelector: (profile) => profile[REGION_INI_NAME],
1089
+ default: () => {
1090
+ throw new Error("Region is missing");
1091
+ }
1092
+ };
1093
+ var NODE_REGION_CONFIG_FILE_OPTIONS = {
1094
+ preferredFile: "credentials"
1095
+ };
1096
+
1097
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js
1098
+ var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
1099
+ var AWS_REGION_ENV = "AWS_REGION";
1100
+ var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
1101
+ var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
1102
+ var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
1103
+ var IMDS_REGION_PATH = "/latest/meta-data/placement/region";
1104
+
1105
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/defaultsModeConfig.js
1106
+ var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
1107
+ var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
1108
+ var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
1109
+ environmentVariableSelector: (env) => {
1110
+ return env[AWS_DEFAULTS_MODE_ENV];
1111
+ },
1112
+ configFileSelector: (profile) => {
1113
+ return profile[AWS_DEFAULTS_MODE_CONFIG];
1114
+ },
1115
+ default: "legacy"
1116
+ };
1117
+
1118
+ // ../../node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js
1119
+ var resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
1120
+ const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
1121
+ switch (mode?.toLowerCase()) {
1122
+ case "auto":
1123
+ return resolveNodeDefaultsModeAuto(region);
1124
+ case "in-region":
1125
+ case "cross-region":
1126
+ case "mobile":
1127
+ case "standard":
1128
+ case "legacy":
1129
+ return Promise.resolve(mode?.toLocaleLowerCase());
1130
+ case void 0:
1131
+ return Promise.resolve("legacy");
1132
+ default:
1133
+ throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
1134
+ }
1135
+ });
1136
+ var resolveNodeDefaultsModeAuto = async (clientRegion) => {
1137
+ if (clientRegion) {
1138
+ const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
1139
+ const inferredRegion = await inferPhysicalRegion();
1140
+ if (!inferredRegion) {
1141
+ return "standard";
1142
+ }
1143
+ if (resolvedRegion === inferredRegion) {
1144
+ return "in-region";
1145
+ } else {
1146
+ return "cross-region";
1147
+ }
1148
+ }
1149
+ return "standard";
1150
+ };
1151
+ var inferPhysicalRegion = async () => {
1152
+ if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
1153
+ return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
1154
+ }
1155
+ if (!process.env[ENV_IMDS_DISABLED]) {
1156
+ try {
1157
+ const endpoint = await getImdsEndpoint();
1158
+ return (await imdsHttpGet({ hostname: endpoint.hostname, path: IMDS_REGION_PATH })).toString();
1159
+ } catch (e) {
1160
+ }
1161
+ }
1162
+ };
1163
+ var getImdsEndpoint = async () => {
1164
+ const envEndpoint = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;
1165
+ if (envEndpoint) {
1166
+ const url = new URL(envEndpoint);
1167
+ return { hostname: url.hostname, path: url.pathname };
1168
+ }
1169
+ const envMode = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE;
1170
+ if (envMode === "IPv6") {
1171
+ return { hostname: "fd00:ec2::254", path: "/" };
1172
+ }
1173
+ return { hostname: "169.254.169.254", path: "/" };
1174
+ };
1175
+ var imdsHttpGet = async ({ hostname, path }) => {
1176
+ const { request } = await import("http");
1177
+ return new Promise((resolve, reject) => {
1178
+ const req = request({
1179
+ method: "GET",
1180
+ hostname: hostname.replace(/^\[(.+)]$/, "$1"),
1181
+ path,
1182
+ timeout: 1e3,
1183
+ signal: AbortSignal.timeout(1e3)
1184
+ });
1185
+ req.on("error", (err) => {
1186
+ reject(err);
1187
+ req.destroy();
1188
+ });
1189
+ req.on("timeout", () => {
1190
+ reject(new Error("TimeoutError from instance metadata service"));
1191
+ req.destroy();
1192
+ });
1193
+ req.on("response", (res) => {
1194
+ const { statusCode = 400 } = res;
1195
+ if (statusCode < 200 || 300 <= statusCode) {
1196
+ reject(Object.assign(new Error("Error response received from instance metadata service"), { statusCode }));
1197
+ req.destroy();
1198
+ return;
1199
+ }
1200
+ const chunks = [];
1201
+ res.on("data", (chunk) => chunks.push(chunk));
1202
+ res.on("end", () => {
1203
+ resolve(Buffer.concat(chunks));
1204
+ req.destroy();
1205
+ });
1206
+ });
1207
+ req.end();
1208
+ });
1209
+ };
1210
+
1211
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js
1212
+ var CONTENT_LENGTH_HEADER = "content-length";
1213
+ function contentLengthMiddleware(bodyLengthChecker) {
1214
+ return (next) => async (args) => {
1215
+ const request = args.request;
1216
+ if (HttpRequest.isInstance(request)) {
1217
+ const { body, headers } = request;
1218
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) {
1219
+ try {
1220
+ const length = bodyLengthChecker(body);
1221
+ request.headers = {
1222
+ ...request.headers,
1223
+ [CONTENT_LENGTH_HEADER]: String(length)
1224
+ };
1225
+ } catch (error) {
1226
+ }
1227
+ }
1228
+ }
1229
+ return next({
1230
+ ...args,
1231
+ request
1232
+ });
1233
+ };
1234
+ }
1235
+ var contentLengthMiddlewareOptions = {
1236
+ step: "build",
1237
+ tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
1238
+ name: "contentLengthMiddleware",
1239
+ override: true
1240
+ };
1241
+ var getContentLengthPlugin = (options) => ({
1242
+ applyToStack: (clientStack) => {
1243
+ clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
1244
+ }
1245
+ });
1246
+
1247
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
1248
+ var collectBody = async (streamBody = new Uint8Array(), context) => {
1249
+ if (streamBody instanceof Uint8Array) {
1250
+ return Uint8ArrayBlobAdapter.mutate(streamBody);
1251
+ }
1252
+ if (!streamBody) {
1253
+ return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
1254
+ }
1255
+ const fromContext = context.streamCollector(streamBody);
1256
+ return Uint8ArrayBlobAdapter.mutate(await fromContext);
1257
+ };
1258
+
1259
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
1260
+ function extendedEncodeURIComponent(str) {
1261
+ return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
1262
+ return "%" + c.charCodeAt(0).toString(16).toUpperCase();
1263
+ });
1264
+ }
1265
+
1266
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js
1267
+ var SerdeContext = class {
1268
+ serdeContext;
1269
+ setSerdeContext(serdeContext) {
1270
+ this.serdeContext = serdeContext;
1271
+ }
1272
+ };
1273
+
1274
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js
1275
+ var HttpProtocol = class extends SerdeContext {
1276
+ options;
1277
+ compositeErrorRegistry;
1278
+ constructor(options) {
1279
+ super();
1280
+ this.options = options;
1281
+ this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace);
1282
+ for (const etr of options.errorTypeRegistries ?? []) {
1283
+ this.compositeErrorRegistry.copyFrom(etr);
1284
+ }
1285
+ }
1286
+ getRequestType() {
1287
+ return HttpRequest;
1288
+ }
1289
+ getResponseType() {
1290
+ return HttpResponse;
1291
+ }
1292
+ setSerdeContext(serdeContext) {
1293
+ this.serdeContext = serdeContext;
1294
+ this.serializer.setSerdeContext(serdeContext);
1295
+ this.deserializer.setSerdeContext(serdeContext);
1296
+ if (this.getPayloadCodec()) {
1297
+ this.getPayloadCodec().setSerdeContext(serdeContext);
1298
+ }
1299
+ }
1300
+ updateServiceEndpoint(request, endpoint) {
1301
+ if ("url" in endpoint) {
1302
+ request.protocol = endpoint.url.protocol;
1303
+ request.hostname = endpoint.url.hostname;
1304
+ request.port = endpoint.url.port ? Number(endpoint.url.port) : void 0;
1305
+ request.path = endpoint.url.pathname;
1306
+ request.fragment = endpoint.url.hash || void 0;
1307
+ request.username = endpoint.url.username || void 0;
1308
+ request.password = endpoint.url.password || void 0;
1309
+ if (!request.query) {
1310
+ request.query = {};
1311
+ }
1312
+ for (const [k, v] of endpoint.url.searchParams.entries()) {
1313
+ request.query[k] = v;
1314
+ }
1315
+ if (endpoint.headers) {
1316
+ for (const name in endpoint.headers) {
1317
+ request.headers[name] = endpoint.headers[name].join(", ");
1318
+ }
1319
+ }
1320
+ return request;
1321
+ } else {
1322
+ request.protocol = endpoint.protocol;
1323
+ request.hostname = endpoint.hostname;
1324
+ request.port = endpoint.port ? Number(endpoint.port) : void 0;
1325
+ request.path = endpoint.path;
1326
+ request.query = {
1327
+ ...endpoint.query
1328
+ };
1329
+ if (endpoint.headers) {
1330
+ for (const name in endpoint.headers) {
1331
+ request.headers[name] = endpoint.headers[name];
1332
+ }
1333
+ }
1334
+ return request;
1335
+ }
1336
+ }
1337
+ setHostPrefix(request, operationSchema, input) {
1338
+ if (this.serdeContext?.disableHostPrefix) {
1339
+ return;
1340
+ }
1341
+ const inputNs = NormalizedSchema.of(operationSchema.input);
1342
+ const opTraits = translateTraits(operationSchema.traits ?? {});
1343
+ if (opTraits.endpoint) {
1344
+ let hostPrefix = opTraits.endpoint?.[0];
1345
+ if (typeof hostPrefix === "string") {
1346
+ for (const [name, member2] of inputNs.structIterator()) {
1347
+ if (!member2.getMergedTraits().hostLabel) {
1348
+ continue;
1349
+ }
1350
+ const replacement = input[name];
1351
+ if (typeof replacement !== "string") {
1352
+ throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
1353
+ }
1354
+ hostPrefix = hostPrefix.replace(`{${name}}`, replacement);
1355
+ }
1356
+ request.hostname = hostPrefix + request.hostname;
1357
+ }
1358
+ }
1359
+ }
1360
+ deserializeMetadata(output) {
1361
+ return {
1362
+ httpStatusCode: output.statusCode,
1363
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1364
+ extendedRequestId: output.headers["x-amz-id-2"],
1365
+ cfId: output.headers["x-amz-cf-id"]
1366
+ };
1367
+ }
1368
+ async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
1369
+ const eventStreamSerde = await this.loadEventStreamCapability();
1370
+ return eventStreamSerde.serializeEventStream({
1371
+ eventStream,
1372
+ requestSchema,
1373
+ initialRequest
1374
+ });
1375
+ }
1376
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
1377
+ const eventStreamSerde = await this.loadEventStreamCapability();
1378
+ return eventStreamSerde.deserializeEventStream({
1379
+ response,
1380
+ responseSchema,
1381
+ initialResponseContainer
1382
+ });
1383
+ }
1384
+ async loadEventStreamCapability() {
1385
+ const { EventStreamSerde } = await import("./event-streams-AI5RIQ2F.js");
1386
+ return new EventStreamSerde({
1387
+ marshaller: this.getEventStreamMarshaller(),
1388
+ serializer: this.serializer,
1389
+ deserializer: this.deserializer,
1390
+ serdeContext: this.serdeContext,
1391
+ defaultContentType: this.getDefaultContentType()
1392
+ });
1393
+ }
1394
+ getDefaultContentType() {
1395
+ throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
1396
+ }
1397
+ async deserializeHttpMessage(schema, context, response, arg4, arg5) {
1398
+ void schema;
1399
+ void context;
1400
+ void response;
1401
+ void arg4;
1402
+ void arg5;
1403
+ return [];
1404
+ }
1405
+ getEventStreamMarshaller() {
1406
+ const context = this.serdeContext;
1407
+ if (!context.eventStreamMarshaller) {
1408
+ throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
1409
+ }
1410
+ return context.eventStreamMarshaller;
1411
+ }
1412
+ };
1413
+
1414
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js
1415
+ var HttpBindingProtocol = class extends HttpProtocol {
1416
+ async serializeRequest(operationSchema, _input, context) {
1417
+ const input = _input && typeof _input === "object" ? _input : {};
1418
+ const serializer = this.serializer;
1419
+ const query = {};
1420
+ const headers = {};
1421
+ const endpoint = await context.endpoint();
1422
+ const ns = NormalizedSchema.of(operationSchema?.input);
1423
+ const payloadMemberNames = [];
1424
+ const payloadMemberSchemas = [];
1425
+ let hasNonHttpBindingMember = false;
1426
+ let payload;
1427
+ const request = new HttpRequest({
1428
+ protocol: "",
1429
+ hostname: "",
1430
+ port: void 0,
1431
+ path: "",
1432
+ fragment: void 0,
1433
+ query,
1434
+ headers,
1435
+ body: void 0
1436
+ });
1437
+ if (endpoint) {
1438
+ this.updateServiceEndpoint(request, endpoint);
1439
+ this.setHostPrefix(request, operationSchema, input);
1440
+ const opTraits = translateTraits(operationSchema.traits);
1441
+ if (opTraits.http) {
1442
+ request.method = opTraits.http[0];
1443
+ const [path, search] = opTraits.http[1].split("?");
1444
+ if (request.path == "/") {
1445
+ request.path = path;
1446
+ } else {
1447
+ request.path += path;
1448
+ }
1449
+ const traitSearchParams = new URLSearchParams(search ?? "");
1450
+ for (const [key, value] of traitSearchParams) {
1451
+ query[key] = value;
1452
+ }
1453
+ }
1454
+ }
1455
+ for (const [memberName, memberNs] of ns.structIterator()) {
1456
+ const memberTraits = memberNs.getMergedTraits() ?? {};
1457
+ const inputMemberValue = input[memberName];
1458
+ if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
1459
+ if (memberTraits.httpLabel) {
1460
+ if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) {
1461
+ throw new Error(`No value provided for input HTTP label: ${memberName}.`);
1462
+ }
1463
+ }
1464
+ continue;
1465
+ }
1466
+ if (memberTraits.httpPayload) {
1467
+ const isStreaming = memberNs.isStreaming();
1468
+ if (isStreaming) {
1469
+ const isEventStream = memberNs.isStructSchema();
1470
+ if (isEventStream) {
1471
+ if (input[memberName]) {
1472
+ payload = await this.serializeEventStream({
1473
+ eventStream: input[memberName],
1474
+ requestSchema: ns
1475
+ });
1476
+ }
1477
+ } else {
1478
+ payload = inputMemberValue;
1479
+ }
1480
+ } else {
1481
+ serializer.write(memberNs, inputMemberValue);
1482
+ payload = serializer.flush();
1483
+ }
1484
+ } else if (memberTraits.httpLabel) {
1485
+ serializer.write(memberNs, inputMemberValue);
1486
+ const replacement = serializer.flush();
1487
+ if (request.path.includes(`{${memberName}+}`)) {
1488
+ request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
1489
+ } else if (request.path.includes(`{${memberName}}`)) {
1490
+ request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
1491
+ }
1492
+ } else if (memberTraits.httpHeader) {
1493
+ serializer.write(memberNs, inputMemberValue);
1494
+ headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
1495
+ } else if (typeof memberTraits.httpPrefixHeaders === "string") {
1496
+ for (const key in inputMemberValue) {
1497
+ const val = inputMemberValue[key];
1498
+ const amalgam = memberTraits.httpPrefixHeaders + key;
1499
+ serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
1500
+ headers[amalgam.toLowerCase()] = serializer.flush();
1501
+ }
1502
+ } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
1503
+ this.serializeQuery(memberNs, inputMemberValue, query);
1504
+ } else {
1505
+ hasNonHttpBindingMember = true;
1506
+ payloadMemberNames.push(memberName);
1507
+ payloadMemberSchemas.push(memberNs);
1508
+ }
1509
+ }
1510
+ if (hasNonHttpBindingMember && input) {
1511
+ const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
1512
+ const requiredMembers = ns.getSchema()[6];
1513
+ const payloadSchema = [
1514
+ 3,
1515
+ namespace,
1516
+ name,
1517
+ ns.getMergedTraits(),
1518
+ payloadMemberNames,
1519
+ payloadMemberSchemas,
1520
+ void 0
1521
+ ];
1522
+ if (requiredMembers) {
1523
+ payloadSchema[6] = requiredMembers;
1524
+ } else {
1525
+ payloadSchema.pop();
1526
+ }
1527
+ serializer.write(payloadSchema, input);
1528
+ payload = serializer.flush();
1529
+ }
1530
+ request.headers = headers;
1531
+ request.query = query;
1532
+ request.body = payload;
1533
+ return request;
1534
+ }
1535
+ serializeQuery(ns, data, query) {
1536
+ const serializer = this.serializer;
1537
+ const traits = ns.getMergedTraits();
1538
+ if (traits.httpQueryParams) {
1539
+ for (const key in data) {
1540
+ if (!(key in query)) {
1541
+ const val = data[key];
1542
+ const valueSchema = ns.getValueSchema();
1543
+ Object.assign(valueSchema.getMergedTraits(), {
1544
+ ...traits,
1545
+ httpQuery: key,
1546
+ httpQueryParams: void 0
1547
+ });
1548
+ this.serializeQuery(valueSchema, val, query);
1549
+ }
1550
+ }
1551
+ return;
1552
+ }
1553
+ if (ns.isListSchema()) {
1554
+ const sparse = !!ns.getMergedTraits().sparse;
1555
+ const buffer = [];
1556
+ for (const item of data) {
1557
+ serializer.write([ns.getValueSchema(), traits], item);
1558
+ const serializable = serializer.flush();
1559
+ if (sparse || serializable !== void 0) {
1560
+ buffer.push(serializable);
1561
+ }
1562
+ }
1563
+ query[traits.httpQuery] = buffer;
1564
+ } else {
1565
+ serializer.write([ns, traits], data);
1566
+ query[traits.httpQuery] = serializer.flush();
1567
+ }
1568
+ }
1569
+ async deserializeResponse(operationSchema, context, response) {
1570
+ const deserializer = this.deserializer;
1571
+ const ns = NormalizedSchema.of(operationSchema.output);
1572
+ const dataObject = {};
1573
+ if (response.statusCode >= 300) {
1574
+ const bytes = await collectBody(response.body, context);
1575
+ if (bytes.byteLength > 0) {
1576
+ Object.assign(dataObject, await deserializer.read(15, bytes));
1577
+ }
1578
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
1579
+ throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
1580
+ }
1581
+ for (const header in response.headers) {
1582
+ const value = response.headers[header];
1583
+ delete response.headers[header];
1584
+ response.headers[header.toLowerCase()] = value;
1585
+ }
1586
+ const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
1587
+ if (nonHttpBindingMembers.length) {
1588
+ const bytes = await collectBody(response.body, context);
1589
+ if (bytes.byteLength > 0) {
1590
+ const dataFromBody = await deserializer.read(ns, bytes);
1591
+ for (const member2 of nonHttpBindingMembers) {
1592
+ if (dataFromBody[member2] != null) {
1593
+ dataObject[member2] = dataFromBody[member2];
1594
+ }
1595
+ }
1596
+ }
1597
+ } else if (nonHttpBindingMembers.discardResponseBody) {
1598
+ await collectBody(response.body, context);
1599
+ }
1600
+ dataObject.$metadata = this.deserializeMetadata(response);
1601
+ return dataObject;
1602
+ }
1603
+ async deserializeHttpMessage(schema, context, response, arg4, arg5) {
1604
+ let dataObject;
1605
+ if (arg4 instanceof Set) {
1606
+ dataObject = arg5;
1607
+ } else {
1608
+ dataObject = arg4;
1609
+ }
1610
+ let discardResponseBody = true;
1611
+ const deserializer = this.deserializer;
1612
+ const ns = NormalizedSchema.of(schema);
1613
+ const nonHttpBindingMembers = [];
1614
+ for (const [memberName, memberSchema] of ns.structIterator()) {
1615
+ const memberTraits = memberSchema.getMemberTraits();
1616
+ if (memberTraits.httpPayload) {
1617
+ discardResponseBody = false;
1618
+ const isStreaming = memberSchema.isStreaming();
1619
+ if (isStreaming) {
1620
+ const isEventStream = memberSchema.isStructSchema();
1621
+ if (isEventStream) {
1622
+ dataObject[memberName] = await this.deserializeEventStream({
1623
+ response,
1624
+ responseSchema: ns
1625
+ });
1626
+ } else {
1627
+ dataObject[memberName] = sdkStreamMixin(response.body);
1628
+ }
1629
+ } else if (response.body) {
1630
+ const bytes = await collectBody(response.body, context);
1631
+ if (bytes.byteLength > 0) {
1632
+ dataObject[memberName] = await deserializer.read(memberSchema, bytes);
1633
+ }
1634
+ }
1635
+ } else if (memberTraits.httpHeader) {
1636
+ const key = String(memberTraits.httpHeader).toLowerCase();
1637
+ const value = response.headers[key];
1638
+ if (null != value) {
1639
+ if (memberSchema.isListSchema()) {
1640
+ const headerListValueSchema = memberSchema.getValueSchema();
1641
+ headerListValueSchema.getMergedTraits().httpHeader = key;
1642
+ let sections;
1643
+ if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) {
1644
+ sections = splitEvery(value, ",", 2);
1645
+ } else {
1646
+ sections = splitHeader(value);
1647
+ }
1648
+ const list = [];
1649
+ for (const section of sections) {
1650
+ list.push(await deserializer.read(headerListValueSchema, section.trim()));
1651
+ }
1652
+ dataObject[memberName] = list;
1653
+ } else {
1654
+ dataObject[memberName] = await deserializer.read(memberSchema, value);
1655
+ }
1656
+ }
1657
+ } else if (memberTraits.httpPrefixHeaders !== void 0) {
1658
+ dataObject[memberName] = {};
1659
+ for (const header in response.headers) {
1660
+ if (header.startsWith(memberTraits.httpPrefixHeaders)) {
1661
+ const value = response.headers[header];
1662
+ const valueSchema = memberSchema.getValueSchema();
1663
+ valueSchema.getMergedTraits().httpHeader = header;
1664
+ dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
1665
+ }
1666
+ }
1667
+ } else if (memberTraits.httpResponseCode) {
1668
+ dataObject[memberName] = response.statusCode;
1669
+ } else {
1670
+ nonHttpBindingMembers.push(memberName);
1671
+ }
1672
+ }
1673
+ nonHttpBindingMembers.discardResponseBody = discardResponseBody;
1674
+ return nonHttpBindingMembers;
1675
+ }
1676
+ };
1677
+
1678
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js
1679
+ var RpcProtocol = class extends HttpProtocol {
1680
+ async serializeRequest(operationSchema, _input, context) {
1681
+ const serializer = this.serializer;
1682
+ const query = {};
1683
+ const headers = {};
1684
+ const endpoint = await context.endpoint();
1685
+ const ns = NormalizedSchema.of(operationSchema?.input);
1686
+ const schema = ns.getSchema();
1687
+ let payload;
1688
+ const input = _input && typeof _input === "object" ? _input : {};
1689
+ const request = new HttpRequest({
1690
+ protocol: "",
1691
+ hostname: "",
1692
+ port: void 0,
1693
+ path: "/",
1694
+ fragment: void 0,
1695
+ query,
1696
+ headers,
1697
+ body: void 0
1698
+ });
1699
+ if (endpoint) {
1700
+ this.updateServiceEndpoint(request, endpoint);
1701
+ this.setHostPrefix(request, operationSchema, input);
1702
+ }
1703
+ if (input) {
1704
+ const eventStreamMember = ns.getEventStreamMember();
1705
+ if (eventStreamMember) {
1706
+ if (input[eventStreamMember]) {
1707
+ const initialRequest = {};
1708
+ for (const [memberName, memberSchema] of ns.structIterator()) {
1709
+ if (memberName !== eventStreamMember && input[memberName]) {
1710
+ serializer.write(memberSchema, input[memberName]);
1711
+ initialRequest[memberName] = serializer.flush();
1712
+ }
1713
+ }
1714
+ payload = await this.serializeEventStream({
1715
+ eventStream: input[eventStreamMember],
1716
+ requestSchema: ns,
1717
+ initialRequest
1718
+ });
1719
+ }
1720
+ } else {
1721
+ serializer.write(schema, input);
1722
+ payload = serializer.flush();
1723
+ }
1724
+ }
1725
+ request.headers = Object.assign(request.headers, headers);
1726
+ request.query = query;
1727
+ request.body = payload;
1728
+ request.method = "POST";
1729
+ return request;
1730
+ }
1731
+ async deserializeResponse(operationSchema, context, response) {
1732
+ const deserializer = this.deserializer;
1733
+ const ns = NormalizedSchema.of(operationSchema.output);
1734
+ const dataObject = {};
1735
+ if (response.statusCode >= 300) {
1736
+ const bytes = await collectBody(response.body, context);
1737
+ if (bytes.byteLength > 0) {
1738
+ Object.assign(dataObject, await deserializer.read(15, bytes));
1739
+ }
1740
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
1741
+ throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
1742
+ }
1743
+ for (const header in response.headers) {
1744
+ const value = response.headers[header];
1745
+ delete response.headers[header];
1746
+ response.headers[header.toLowerCase()] = value;
1747
+ }
1748
+ const eventStreamMember = ns.getEventStreamMember();
1749
+ if (eventStreamMember) {
1750
+ dataObject[eventStreamMember] = await this.deserializeEventStream({
1751
+ response,
1752
+ responseSchema: ns,
1753
+ initialResponseContainer: dataObject
1754
+ });
1755
+ } else {
1756
+ const bytes = await collectBody(response.body, context);
1757
+ if (bytes.byteLength > 0) {
1758
+ Object.assign(dataObject, await deserializer.read(ns, bytes));
1759
+ }
1760
+ }
1761
+ dataObject.$metadata = this.deserializeMetadata(response);
1762
+ return dataObject;
1763
+ }
1764
+ };
1765
+
1766
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js
1767
+ function determineTimestampFormat(ns, settings) {
1768
+ if (settings.timestampFormat.useTrait) {
1769
+ if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) {
1770
+ return ns.getSchema();
1771
+ }
1772
+ }
1773
+ const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
1774
+ const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : void 0 : void 0;
1775
+ return bindingFormat ?? settings.timestampFormat.default;
1776
+ }
1777
+
1778
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js
1779
+ var FromStringShapeDeserializer = class extends SerdeContext {
1780
+ settings;
1781
+ constructor(settings) {
1782
+ super();
1783
+ this.settings = settings;
1784
+ }
1785
+ read(_schema, data) {
1786
+ const ns = NormalizedSchema.of(_schema);
1787
+ if (ns.isListSchema()) {
1788
+ return splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));
1789
+ }
1790
+ if (ns.isBlobSchema()) {
1791
+ return (this.serdeContext?.base64Decoder ?? fromBase64)(data);
1792
+ }
1793
+ if (ns.isTimestampSchema()) {
1794
+ const format = determineTimestampFormat(ns, this.settings);
1795
+ switch (format) {
1796
+ case 5:
1797
+ return _parseRfc3339DateTimeWithOffset(data);
1798
+ case 6:
1799
+ return _parseRfc7231DateTime(data);
1800
+ case 7:
1801
+ return _parseEpochTimestamp(data);
1802
+ default:
1803
+ console.warn("Missing timestamp format, parsing value with Date constructor:", data);
1804
+ return new Date(data);
1805
+ }
1806
+ }
1807
+ if (ns.isStringSchema()) {
1808
+ const mediaType = ns.getMergedTraits().mediaType;
1809
+ let intermediateValue = data;
1810
+ if (mediaType) {
1811
+ if (ns.getMergedTraits().httpHeader) {
1812
+ intermediateValue = this.base64ToUtf8(intermediateValue);
1813
+ }
1814
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
1815
+ if (isJson) {
1816
+ intermediateValue = LazyJsonString.from(intermediateValue);
1817
+ }
1818
+ return intermediateValue;
1819
+ }
1820
+ }
1821
+ if (ns.isNumericSchema()) {
1822
+ return Number(data);
1823
+ }
1824
+ if (ns.isBigIntegerSchema()) {
1825
+ return BigInt(data);
1826
+ }
1827
+ if (ns.isBigDecimalSchema()) {
1828
+ return new NumericValue(data, "bigDecimal");
1829
+ }
1830
+ if (ns.isBooleanSchema()) {
1831
+ return String(data).toLowerCase() === "true";
1832
+ }
1833
+ return data;
1834
+ }
1835
+ base64ToUtf8(base64String) {
1836
+ return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String));
1837
+ }
1838
+ };
1839
+
1840
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js
1841
+ var HttpInterceptingShapeDeserializer = class extends SerdeContext {
1842
+ codecDeserializer;
1843
+ stringDeserializer;
1844
+ constructor(codecDeserializer, codecSettings) {
1845
+ super();
1846
+ this.codecDeserializer = codecDeserializer;
1847
+ this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);
1848
+ }
1849
+ setSerdeContext(serdeContext) {
1850
+ this.stringDeserializer.setSerdeContext(serdeContext);
1851
+ this.codecDeserializer.setSerdeContext(serdeContext);
1852
+ this.serdeContext = serdeContext;
1853
+ }
1854
+ read(schema, data) {
1855
+ const ns = NormalizedSchema.of(schema);
1856
+ const traits = ns.getMergedTraits();
1857
+ const toString = this.serdeContext?.utf8Encoder ?? toUtf8;
1858
+ if (traits.httpHeader || traits.httpResponseCode) {
1859
+ return this.stringDeserializer.read(ns, toString(data));
1860
+ }
1861
+ if (traits.httpPayload) {
1862
+ if (ns.isBlobSchema()) {
1863
+ const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8;
1864
+ if (typeof data === "string") {
1865
+ return toBytes(data);
1866
+ }
1867
+ return data;
1868
+ } else if (ns.isStringSchema()) {
1869
+ if ("byteLength" in data) {
1870
+ return toString(data);
1871
+ }
1872
+ return data;
1873
+ }
1874
+ }
1875
+ return this.codecDeserializer.read(ns, data);
1876
+ }
1877
+ };
1878
+
1879
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js
1880
+ var ToStringShapeSerializer = class extends SerdeContext {
1881
+ settings;
1882
+ stringBuffer = "";
1883
+ constructor(settings) {
1884
+ super();
1885
+ this.settings = settings;
1886
+ }
1887
+ write(schema, value) {
1888
+ const ns = NormalizedSchema.of(schema);
1889
+ switch (typeof value) {
1890
+ case "object":
1891
+ if (value === null) {
1892
+ this.stringBuffer = "null";
1893
+ return;
1894
+ }
1895
+ if (ns.isTimestampSchema()) {
1896
+ if (!(value instanceof Date)) {
1897
+ throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
1898
+ }
1899
+ const format = determineTimestampFormat(ns, this.settings);
1900
+ switch (format) {
1901
+ case 5:
1902
+ this.stringBuffer = value.toISOString().replace(".000Z", "Z");
1903
+ break;
1904
+ case 6:
1905
+ this.stringBuffer = dateToUtcString(value);
1906
+ break;
1907
+ case 7:
1908
+ this.stringBuffer = String(value.getTime() / 1e3);
1909
+ break;
1910
+ default:
1911
+ console.warn("Missing timestamp format, using epoch seconds", value);
1912
+ this.stringBuffer = String(value.getTime() / 1e3);
1913
+ }
1914
+ return;
1915
+ }
1916
+ if (ns.isBlobSchema() && "byteLength" in value) {
1917
+ this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value);
1918
+ return;
1919
+ }
1920
+ if (ns.isListSchema() && Array.isArray(value)) {
1921
+ let buffer = "";
1922
+ for (const item of value) {
1923
+ this.write([ns.getValueSchema(), ns.getMergedTraits()], item);
1924
+ const headerItem = this.flush();
1925
+ const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem);
1926
+ if (buffer !== "") {
1927
+ buffer += ", ";
1928
+ }
1929
+ buffer += serialized;
1930
+ }
1931
+ this.stringBuffer = buffer;
1932
+ return;
1933
+ }
1934
+ this.stringBuffer = JSON.stringify(value, null, 2);
1935
+ break;
1936
+ case "string":
1937
+ const mediaType = ns.getMergedTraits().mediaType;
1938
+ let intermediateValue = value;
1939
+ if (mediaType) {
1940
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
1941
+ if (isJson) {
1942
+ intermediateValue = LazyJsonString.from(intermediateValue);
1943
+ }
1944
+ if (ns.getMergedTraits().httpHeader) {
1945
+ this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString());
1946
+ return;
1947
+ }
1948
+ }
1949
+ this.stringBuffer = value;
1950
+ break;
1951
+ default:
1952
+ if (ns.isIdempotencyToken()) {
1953
+ this.stringBuffer = generateIdempotencyToken();
1954
+ } else {
1955
+ this.stringBuffer = String(value);
1956
+ }
1957
+ }
1958
+ }
1959
+ flush() {
1960
+ const buffer = this.stringBuffer;
1961
+ this.stringBuffer = "";
1962
+ return buffer;
1963
+ }
1964
+ };
1965
+
1966
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js
1967
+ var HttpInterceptingShapeSerializer = class {
1968
+ codecSerializer;
1969
+ stringSerializer;
1970
+ buffer;
1971
+ constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) {
1972
+ this.codecSerializer = codecSerializer;
1973
+ this.stringSerializer = stringSerializer;
1974
+ }
1975
+ setSerdeContext(serdeContext) {
1976
+ this.codecSerializer.setSerdeContext(serdeContext);
1977
+ this.stringSerializer.setSerdeContext(serdeContext);
1978
+ }
1979
+ write(schema, value) {
1980
+ const ns = NormalizedSchema.of(schema);
1981
+ const traits = ns.getMergedTraits();
1982
+ if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {
1983
+ this.stringSerializer.write(ns, value);
1984
+ this.buffer = this.stringSerializer.flush();
1985
+ return;
1986
+ }
1987
+ return this.codecSerializer.write(ns, value);
1988
+ }
1989
+ flush() {
1990
+ if (this.buffer !== void 0) {
1991
+ const buffer = this.buffer;
1992
+ this.buffer = void 0;
1993
+ return buffer;
1994
+ }
1995
+ return this.codecSerializer.flush();
1996
+ }
1997
+ };
1998
+
1999
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js
2000
+ var getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
2001
+ return {
2002
+ setHttpHandler(handler) {
2003
+ runtimeConfig.httpHandler = handler;
2004
+ },
2005
+ httpHandler() {
2006
+ return runtimeConfig.httpHandler;
2007
+ },
2008
+ updateHttpClientConfig(key, value) {
2009
+ runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
2010
+ },
2011
+ httpHandlerConfigs() {
2012
+ return runtimeConfig.httpHandler.httpHandlerConfigs();
2013
+ }
2014
+ };
2015
+ };
2016
+ var resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
2017
+ return {
2018
+ httpHandler: httpHandlerExtensionConfiguration.httpHandler()
2019
+ };
2020
+ };
2021
+
2022
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri.js
2023
+ var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
2024
+ var hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
2025
+
2026
+ // ../../node_modules/@smithy/core/dist-es/submodules/protocols/querystring-builder/buildQueryString.js
2027
+ function buildQueryString(query) {
2028
+ const parts = [];
2029
+ for (let key of Object.keys(query).sort()) {
2030
+ const value = query[key];
2031
+ key = escapeUri(key);
2032
+ if (Array.isArray(value)) {
2033
+ for (let i = 0, iLen = value.length; i < iLen; i++) {
2034
+ parts.push(`${key}=${escapeUri(value[i])}`);
2035
+ }
2036
+ } else {
2037
+ let qsEntry = key;
2038
+ if (value || typeof value === "string") {
2039
+ qsEntry += `=${escapeUri(value)}`;
2040
+ }
2041
+ parts.push(qsEntry);
2042
+ }
2043
+ }
2044
+ return parts.join("&");
2045
+ }
2046
+
2047
+ export {
2048
+ SMITHY_CONTEXT_KEY,
2049
+ getSmithyContext,
2050
+ HttpRequest,
2051
+ HttpResponse,
2052
+ isValidHostLabel,
2053
+ normalizeProvider,
2054
+ parseUrl,
2055
+ toEndpointV1,
2056
+ deref,
2057
+ NormalizedSchema,
2058
+ TypeRegistry,
2059
+ ProviderError,
2060
+ CredentialsProviderError,
2061
+ TokenProviderError,
2062
+ chain,
2063
+ booleanSelector,
2064
+ SelectorType,
2065
+ ENV_PROFILE,
2066
+ getProfileName,
2067
+ getSSOTokenFilepath,
2068
+ getSSOTokenFromFile,
2069
+ CONFIG_PREFIX_SEPARATOR,
2070
+ readFile,
2071
+ loadSsoSessionData,
2072
+ parseKnownFiles,
2073
+ externalDataInterceptor,
2074
+ loadConfig,
2075
+ NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
2076
+ NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
2077
+ NODE_REGION_CONFIG_OPTIONS,
2078
+ NODE_REGION_CONFIG_FILE_OPTIONS,
2079
+ resolveRegionConfig,
2080
+ resolveDefaultsModeConfig,
2081
+ collectBody,
2082
+ extendedEncodeURIComponent,
2083
+ HttpBindingProtocol,
2084
+ RpcProtocol,
2085
+ determineTimestampFormat,
2086
+ FromStringShapeDeserializer,
2087
+ HttpInterceptingShapeDeserializer,
2088
+ HttpInterceptingShapeSerializer,
2089
+ getHttpHandlerExtensionConfiguration,
2090
+ resolveHttpHandlerRuntimeConfig,
2091
+ getContentLengthPlugin,
2092
+ escapeUri,
2093
+ buildQueryString
2094
+ };
2095
+ //# sourceMappingURL=chunk-4UP2SG3N.js.map