@junando/core 0.10.1 → 0.11.1

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 (44) hide show
  1. package/dist/index.d.ts +829 -577
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +1877 -9909
  4. package/dist/index.js.map +1 -0
  5. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  6. package/dist/shared/metrics/index.d.ts +29 -0
  7. package/dist/shared/metrics/index.d.ts.map +1 -0
  8. package/dist/shared/metrics/index.js +131 -0
  9. package/dist/shared/metrics/index.js.map +1 -0
  10. package/package.json +12 -11
  11. package/dist/chunk-3OJNTHWB.js +0 -225
  12. package/dist/chunk-5LNMHOUT.js +0 -229
  13. package/dist/chunk-72FU6SG6.js +0 -236
  14. package/dist/chunk-7SYJ764U.js +0 -579
  15. package/dist/chunk-AZU6S4RC.js +0 -11
  16. package/dist/chunk-BGPI5BQ5.js +0 -27
  17. package/dist/chunk-DKQSWD3S.js +0 -46
  18. package/dist/chunk-H4ND7Z4R.js +0 -504
  19. package/dist/chunk-HVICRLMN.js +0 -742
  20. package/dist/chunk-ID7PWYSN.js +0 -12
  21. package/dist/chunk-KU245W3C.js +0 -16
  22. package/dist/chunk-L67CO4EG.js +0 -1038
  23. package/dist/chunk-MLKGABMK.js +0 -9
  24. package/dist/chunk-MQ4JUE6V.js +0 -447
  25. package/dist/chunk-N5AJP37P.js +0 -385
  26. package/dist/chunk-SIDCDO4Q.js +0 -1315
  27. package/dist/chunk-TDZF3WAT.js +0 -3824
  28. package/dist/chunk-VMBT3R2K.js +0 -0
  29. package/dist/chunk-WWHXKECU.js +0 -100
  30. package/dist/chunk-ZKH7AMP3.js +0 -42
  31. package/dist/chunk-ZOU3QHNL.js +0 -28
  32. package/dist/dist-es-CBFEDVZZ.js +0 -493
  33. package/dist/dist-es-ROXOWRKX.js +0 -22
  34. package/dist/dist-es-S3QCFNII.js +0 -327
  35. package/dist/dist-es-SQCUDQ4Y.js +0 -90
  36. package/dist/dist-es-UWOSB3KA.js +0 -72
  37. package/dist/dist-es-VXERFT35.js +0 -172
  38. package/dist/dist-es-Y44CAW7E.js +0 -385
  39. package/dist/event-streams-2IMLK3TK.js +0 -252
  40. package/dist/event-streams-NLZW3NHF.js +0 -1376
  41. package/dist/loadSso-T6VCDGCZ.js +0 -558
  42. package/dist/signin-BC6ZNJCV.js +0 -653
  43. package/dist/sso-oidc-PTS5E3NX.js +0 -793
  44. package/dist/sts-JSJ57UXB.js +0 -6108
@@ -1,1315 +0,0 @@
1
- import {
2
- IniSectionType
3
- } from "./chunk-AZU6S4RC.js";
4
- import {
5
- getSmithyContext,
6
- normalizeProvider
7
- } from "./chunk-L67CO4EG.js";
8
- import {
9
- parseUrl
10
- } from "./chunk-5LNMHOUT.js";
11
-
12
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/property-provider/ProviderError.js
13
- var ProviderError = class _ProviderError extends Error {
14
- name = "ProviderError";
15
- tryNextLink;
16
- constructor(message, options = true) {
17
- let logger;
18
- let tryNextLink = true;
19
- if (typeof options === "boolean") {
20
- logger = void 0;
21
- tryNextLink = options;
22
- } else if (options != null && typeof options === "object") {
23
- logger = options.logger;
24
- tryNextLink = options.tryNextLink ?? true;
25
- }
26
- super(message);
27
- this.tryNextLink = tryNextLink;
28
- Object.setPrototypeOf(this, _ProviderError.prototype);
29
- logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
30
- }
31
- static from(error, options = true) {
32
- return Object.assign(new this(error.message, options), error);
33
- }
34
- };
35
-
36
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/property-provider/chain.js
37
- var chain = (...providers) => async () => {
38
- if (providers.length === 0) {
39
- throw new ProviderError("No providers in chain");
40
- }
41
- let lastProviderError;
42
- for (const provider of providers) {
43
- try {
44
- const credentials = await provider();
45
- return credentials;
46
- } catch (err) {
47
- lastProviderError = err;
48
- if (err?.tryNextLink) {
49
- continue;
50
- }
51
- throw err;
52
- }
53
- }
54
- throw lastProviderError;
55
- };
56
-
57
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/property-provider/memoize.js
58
- var memoize = (provider, isExpired, requiresRefresh) => {
59
- let resolved;
60
- let pending;
61
- let hasResult;
62
- let isConstant = false;
63
- const coalesceProvider = async () => {
64
- if (!pending) {
65
- pending = provider();
66
- }
67
- try {
68
- resolved = await pending;
69
- hasResult = true;
70
- isConstant = false;
71
- } finally {
72
- pending = void 0;
73
- }
74
- return resolved;
75
- };
76
- if (isExpired === void 0) {
77
- return async (options) => {
78
- if (!hasResult || options?.forceRefresh) {
79
- resolved = await coalesceProvider();
80
- }
81
- return resolved;
82
- };
83
- }
84
- return async (options) => {
85
- if (!hasResult || options?.forceRefresh) {
86
- resolved = await coalesceProvider();
87
- }
88
- if (isConstant) {
89
- return resolved;
90
- }
91
- if (requiresRefresh && !requiresRefresh(resolved)) {
92
- isConstant = true;
93
- return resolved;
94
- }
95
- if (isExpired(resolved)) {
96
- await coalesceProvider();
97
- return resolved;
98
- }
99
- return resolved;
100
- };
101
- };
102
-
103
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/property-provider/CredentialsProviderError.js
104
- var CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
105
- name = "CredentialsProviderError";
106
- constructor(message, options = true) {
107
- super(message, options);
108
- Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
109
- }
110
- };
111
-
112
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/getSelectorName.js
113
- function getSelectorName(functionString) {
114
- try {
115
- const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
116
- constants.delete("CONFIG");
117
- constants.delete("CONFIG_PREFIX_SEPARATOR");
118
- constants.delete("ENV");
119
- return [...constants].join(", ");
120
- } catch (e) {
121
- return functionString;
122
- }
123
- }
124
-
125
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromEnv.js
126
- var fromEnv = (envVarSelector, options) => async () => {
127
- try {
128
- const config = envVarSelector(process.env, options);
129
- if (config === void 0) {
130
- throw new Error();
131
- }
132
- return config;
133
- } catch (e) {
134
- throw new CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });
135
- }
136
- };
137
-
138
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getProfileName.js
139
- var ENV_PROFILE = "AWS_PROFILE";
140
- var DEFAULT_PROFILE = "default";
141
- var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
142
-
143
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js
144
- import { join as join3 } from "path";
145
-
146
- // ../../node_modules/.pnpm/@smithy+types@4.14.1/node_modules/@smithy/types/dist-es/endpoint.js
147
- var EndpointURLScheme;
148
- (function(EndpointURLScheme2) {
149
- EndpointURLScheme2["HTTP"] = "http";
150
- EndpointURLScheme2["HTTPS"] = "https";
151
- })(EndpointURLScheme || (EndpointURLScheme = {}));
152
-
153
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/constants.js
154
- var CONFIG_PREFIX_SEPARATOR = ".";
155
-
156
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigData.js
157
- var getConfigData = (data) => Object.entries(data).filter(([key]) => {
158
- const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
159
- if (indexOfSeparator === -1) {
160
- return false;
161
- }
162
- return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator));
163
- }).reduce((acc, [key, value]) => {
164
- const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
165
- const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;
166
- acc[updatedKey] = value;
167
- return acc;
168
- }, {
169
- ...data.default && { default: data.default }
170
- });
171
-
172
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js
173
- import { join } from "path";
174
-
175
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js
176
- import { homedir } from "os";
177
- import { sep } from "path";
178
- var homeDirCache = {};
179
- var getHomeDirCacheKey = () => {
180
- if (process && process.geteuid) {
181
- return `${process.geteuid()}`;
182
- }
183
- return "DEFAULT";
184
- };
185
- var getHomeDir = () => {
186
- const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env;
187
- if (HOME)
188
- return HOME;
189
- if (USERPROFILE)
190
- return USERPROFILE;
191
- if (HOMEPATH)
192
- return `${HOMEDRIVE}${HOMEPATH}`;
193
- const homeDirCacheKey = getHomeDirCacheKey();
194
- if (!homeDirCache[homeDirCacheKey])
195
- homeDirCache[homeDirCacheKey] = homedir();
196
- return homeDirCache[homeDirCacheKey];
197
- };
198
-
199
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js
200
- var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
201
- var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), ".aws", "config");
202
-
203
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getCredentialsFilepath.js
204
- import { join as join2 } from "path";
205
- var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
206
- var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join2(getHomeDir(), ".aws", "credentials");
207
-
208
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseIni.js
209
- var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
210
- var profileNameBlockList = ["__proto__", "profile __proto__"];
211
- var parseIni = (iniData) => {
212
- const map = {};
213
- let currentSection;
214
- let currentSubSection;
215
- for (const iniLine of iniData.split(/\r?\n/)) {
216
- const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim();
217
- const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]";
218
- if (isSection) {
219
- currentSection = void 0;
220
- currentSubSection = void 0;
221
- const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
222
- const matches = prefixKeyRegex.exec(sectionName);
223
- if (matches) {
224
- const [, prefix, , name] = matches;
225
- if (Object.values(IniSectionType).includes(prefix)) {
226
- currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);
227
- }
228
- } else {
229
- currentSection = sectionName;
230
- }
231
- if (profileNameBlockList.includes(sectionName)) {
232
- throw new Error(`Found invalid profile name "${sectionName}"`);
233
- }
234
- } else if (currentSection) {
235
- const indexOfEqualsSign = trimmedLine.indexOf("=");
236
- if (![0, -1].includes(indexOfEqualsSign)) {
237
- const [name, value] = [
238
- trimmedLine.substring(0, indexOfEqualsSign).trim(),
239
- trimmedLine.substring(indexOfEqualsSign + 1).trim()
240
- ];
241
- if (value === "") {
242
- currentSubSection = name;
243
- } else {
244
- if (currentSubSection && iniLine.trimStart() === iniLine) {
245
- currentSubSection = void 0;
246
- }
247
- map[currentSection] = map[currentSection] || {};
248
- const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;
249
- map[currentSection][key] = value;
250
- }
251
- }
252
- }
253
- }
254
- return map;
255
- };
256
-
257
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js
258
- import { readFile as fsReadFile } from "fs/promises";
259
- var filePromises = {};
260
- var fileIntercept = {};
261
- var readFile = (path, options) => {
262
- if (fileIntercept[path] !== void 0) {
263
- return fileIntercept[path];
264
- }
265
- if (!filePromises[path] || options?.ignoreCache) {
266
- filePromises[path] = fsReadFile(path, "utf8");
267
- }
268
- return filePromises[path];
269
- };
270
-
271
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js
272
- var swallowError = () => ({});
273
- var loadSharedConfigFiles = async (init = {}) => {
274
- const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;
275
- const homeDir = getHomeDir();
276
- const relativeHomeDirPrefix = "~/";
277
- let resolvedFilepath = filepath;
278
- if (filepath.startsWith(relativeHomeDirPrefix)) {
279
- resolvedFilepath = join3(homeDir, filepath.slice(2));
280
- }
281
- let resolvedConfigFilepath = configFilepath;
282
- if (configFilepath.startsWith(relativeHomeDirPrefix)) {
283
- resolvedConfigFilepath = join3(homeDir, configFilepath.slice(2));
284
- }
285
- const parsedFiles = await Promise.all([
286
- readFile(resolvedConfigFilepath, {
287
- ignoreCache: init.ignoreCache
288
- }).then(parseIni).then(getConfigData).catch(swallowError),
289
- readFile(resolvedFilepath, {
290
- ignoreCache: init.ignoreCache
291
- }).then(parseIni).catch(swallowError)
292
- ]);
293
- return {
294
- configFile: parsedFiles[0],
295
- credentialsFile: parsedFiles[1]
296
- };
297
- };
298
-
299
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromSharedConfigFiles.js
300
- var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => {
301
- const profile = getProfileName(init);
302
- const { configFile, credentialsFile } = await loadSharedConfigFiles(init);
303
- const profileFromCredentials = credentialsFile[profile] || {};
304
- const profileFromConfig = configFile[profile] || {};
305
- const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials };
306
- try {
307
- const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
308
- const configValue = configSelector(mergedProfile, cfgFile);
309
- if (configValue === void 0) {
310
- throw new Error();
311
- }
312
- return configValue;
313
- } catch (e) {
314
- throw new CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });
315
- }
316
- };
317
-
318
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/property-provider/fromValue.js
319
- var fromValue = (staticValue) => () => Promise.resolve(staticValue);
320
-
321
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromStatic.js
322
- var isFunction = (func) => typeof func === "function";
323
- var fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : fromValue(defaultValue);
324
-
325
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/configLoader.js
326
- var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
327
- const { signingName, logger } = configuration;
328
- const envOptions = { signingName, logger };
329
- return memoize(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));
330
- };
331
-
332
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js
333
- var booleanSelector = (obj, key, type) => {
334
- if (!(key in obj))
335
- return void 0;
336
- if (obj[key] === "true")
337
- return true;
338
- if (obj[key] === "false")
339
- return false;
340
- throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
341
- };
342
-
343
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js
344
- var SelectorType;
345
- (function(SelectorType2) {
346
- SelectorType2["ENV"] = "env";
347
- SelectorType2["CONFIG"] = "shared config entry";
348
- })(SelectorType || (SelectorType = {}));
349
-
350
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
351
- var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
352
- var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
353
- var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
354
- environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),
355
- configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG),
356
- default: false
357
- };
358
-
359
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.js
360
- var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
361
- var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
362
- var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
363
- environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),
364
- configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG),
365
- default: false
366
- };
367
-
368
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js
369
- var REGION_ENV_NAME = "AWS_REGION";
370
- var REGION_INI_NAME = "region";
371
- var NODE_REGION_CONFIG_OPTIONS = {
372
- environmentVariableSelector: (env) => env[REGION_ENV_NAME],
373
- configFileSelector: (profile) => profile[REGION_INI_NAME],
374
- default: () => {
375
- throw new Error("Region is missing");
376
- }
377
- };
378
- var NODE_REGION_CONFIG_FILE_OPTIONS = {
379
- preferredFile: "credentials"
380
- };
381
-
382
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js
383
- var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
384
- var AWS_REGION_ENV = "AWS_REGION";
385
- var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
386
- var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
387
- var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
388
- var IMDS_REGION_PATH = "/latest/meta-data/placement/region";
389
-
390
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/defaultsModeConfig.js
391
- var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
392
- var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
393
- var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
394
- environmentVariableSelector: (env) => {
395
- return env[AWS_DEFAULTS_MODE_ENV];
396
- },
397
- configFileSelector: (profile) => {
398
- return profile[AWS_DEFAULTS_MODE_CONFIG];
399
- },
400
- default: "legacy"
401
- };
402
-
403
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js
404
- var resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
405
- const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
406
- switch (mode?.toLowerCase()) {
407
- case "auto":
408
- return resolveNodeDefaultsModeAuto(region);
409
- case "in-region":
410
- case "cross-region":
411
- case "mobile":
412
- case "standard":
413
- case "legacy":
414
- return Promise.resolve(mode?.toLocaleLowerCase());
415
- case void 0:
416
- return Promise.resolve("legacy");
417
- default:
418
- throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
419
- }
420
- });
421
- var resolveNodeDefaultsModeAuto = async (clientRegion) => {
422
- if (clientRegion) {
423
- const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
424
- const inferredRegion = await inferPhysicalRegion();
425
- if (!inferredRegion) {
426
- return "standard";
427
- }
428
- if (resolvedRegion === inferredRegion) {
429
- return "in-region";
430
- } else {
431
- return "cross-region";
432
- }
433
- }
434
- return "standard";
435
- };
436
- var inferPhysicalRegion = async () => {
437
- if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
438
- return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
439
- }
440
- if (!process.env[ENV_IMDS_DISABLED]) {
441
- try {
442
- const endpoint = await getImdsEndpoint();
443
- return (await imdsHttpGet({ hostname: endpoint.hostname, path: IMDS_REGION_PATH })).toString();
444
- } catch (e) {
445
- }
446
- }
447
- };
448
- var getImdsEndpoint = async () => {
449
- const envEndpoint = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;
450
- if (envEndpoint) {
451
- const url = new URL(envEndpoint);
452
- return { hostname: url.hostname, path: url.pathname };
453
- }
454
- const envMode = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE;
455
- if (envMode === "IPv6") {
456
- return { hostname: "fd00:ec2::254", path: "/" };
457
- }
458
- return { hostname: "169.254.169.254", path: "/" };
459
- };
460
- var imdsHttpGet = async ({ hostname, path }) => {
461
- const { request } = await import("http");
462
- return new Promise((resolve, reject) => {
463
- const req = request({
464
- method: "GET",
465
- hostname: hostname.replace(/^\[(.+)]$/, "$1"),
466
- path,
467
- timeout: 1e3,
468
- signal: AbortSignal.timeout(1e3)
469
- });
470
- req.on("error", (err) => {
471
- reject(err);
472
- req.destroy();
473
- });
474
- req.on("timeout", () => {
475
- reject(new Error("TimeoutError from instance metadata service"));
476
- req.destroy();
477
- });
478
- req.on("response", (res) => {
479
- const { statusCode = 400 } = res;
480
- if (statusCode < 200 || 300 <= statusCode) {
481
- reject(Object.assign(new Error("Error response received from instance metadata service"), { statusCode }));
482
- req.destroy();
483
- return;
484
- }
485
- const chunks = [];
486
- res.on("data", (chunk) => chunks.push(chunk));
487
- res.on("end", () => {
488
- resolve(Buffer.concat(chunks));
489
- req.destroy();
490
- });
491
- });
492
- req.end();
493
- });
494
- };
495
-
496
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js
497
- var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
498
- var CONFIG_ENDPOINT_URL = "endpoint_url";
499
- var getEndpointUrlConfig = (serviceId) => ({
500
- environmentVariableSelector: (env) => {
501
- const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
502
- const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")];
503
- if (serviceEndpointUrl)
504
- return serviceEndpointUrl;
505
- const endpointUrl = env[ENV_ENDPOINT_URL];
506
- if (endpointUrl)
507
- return endpointUrl;
508
- return void 0;
509
- },
510
- configFileSelector: (profile, config) => {
511
- if (config && profile.services) {
512
- const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
513
- if (servicesSection) {
514
- const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
515
- const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
516
- if (endpointUrl2)
517
- return endpointUrl2;
518
- }
519
- }
520
- const endpointUrl = profile[CONFIG_ENDPOINT_URL];
521
- if (endpointUrl)
522
- return endpointUrl;
523
- return void 0;
524
- },
525
- default: void 0
526
- });
527
-
528
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js
529
- var getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
530
-
531
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/s3.js
532
- var resolveParamsForS3 = async (endpointParams) => {
533
- const bucket = endpointParams?.Bucket || "";
534
- if (typeof endpointParams.Bucket === "string") {
535
- endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
536
- }
537
- if (isArnBucketName(bucket)) {
538
- if (endpointParams.ForcePathStyle === true) {
539
- throw new Error("Path-style addressing cannot be used with ARN buckets");
540
- }
541
- } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
542
- endpointParams.ForcePathStyle = true;
543
- }
544
- if (endpointParams.DisableMultiRegionAccessPoints) {
545
- endpointParams.disableMultiRegionAccessPoints = true;
546
- endpointParams.DisableMRAP = true;
547
- }
548
- return endpointParams;
549
- };
550
- var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
551
- var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
552
- var DOTS_PATTERN = /\.\./;
553
- var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
554
- var isArnBucketName = (bucketName) => {
555
- const [arn, partition, service, , , bucket] = bucketName.split(":");
556
- const isArn = arn === "arn" && bucketName.split(":").length >= 6;
557
- const isValidArn = Boolean(isArn && partition && service && bucket);
558
- if (isArn && !isValidArn) {
559
- throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
560
- }
561
- return isValidArn;
562
- };
563
-
564
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.js
565
- var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config, isClientContextParam = false) => {
566
- const configProvider = async () => {
567
- let configValue;
568
- if (isClientContextParam) {
569
- const clientContextParams = config.clientContextParams;
570
- const nestedValue = clientContextParams?.[configKey];
571
- configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey];
572
- } else {
573
- configValue = config[configKey] ?? config[canonicalEndpointParamKey];
574
- }
575
- if (typeof configValue === "function") {
576
- return configValue();
577
- }
578
- return configValue;
579
- };
580
- if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
581
- return async () => {
582
- const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
583
- const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
584
- return configValue;
585
- };
586
- }
587
- if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
588
- return async () => {
589
- const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
590
- const configValue = credentials?.accountId ?? credentials?.AccountId;
591
- return configValue;
592
- };
593
- }
594
- if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
595
- return async () => {
596
- if (config.isCustomEndpoint === false) {
597
- return void 0;
598
- }
599
- const endpoint = await configProvider();
600
- if (endpoint && typeof endpoint === "object") {
601
- if ("url" in endpoint) {
602
- return endpoint.url.href;
603
- }
604
- if ("hostname" in endpoint) {
605
- const { protocol, hostname, port, path } = endpoint;
606
- return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
607
- }
608
- }
609
- return endpoint;
610
- };
611
- }
612
- return configProvider;
613
- };
614
-
615
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js
616
- var toEndpointV1 = (endpoint) => {
617
- if (typeof endpoint === "object") {
618
- if ("url" in endpoint) {
619
- const v1Endpoint = parseUrl(endpoint.url);
620
- if (endpoint.headers) {
621
- v1Endpoint.headers = {};
622
- for (const name in endpoint.headers) {
623
- v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
624
- }
625
- }
626
- return v1Endpoint;
627
- }
628
- return endpoint;
629
- }
630
- return parseUrl(endpoint);
631
- };
632
-
633
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js
634
- function bindGetEndpointFromInstructions(getEndpointFromConfig2) {
635
- return async (commandInput, instructionsSupplier, clientConfig, context) => {
636
- if (!clientConfig.isCustomEndpoint) {
637
- let endpointFromConfig;
638
- if (clientConfig.serviceConfiguredEndpoint) {
639
- endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
640
- } else {
641
- endpointFromConfig = await getEndpointFromConfig2(clientConfig.serviceId);
642
- }
643
- if (endpointFromConfig) {
644
- clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
645
- clientConfig.isCustomEndpoint = true;
646
- }
647
- }
648
- const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
649
- if (typeof clientConfig.endpointProvider !== "function") {
650
- throw new Error("config.endpointProvider is not set.");
651
- }
652
- const endpoint = clientConfig.endpointProvider(endpointParams, context);
653
- if (clientConfig.isCustomEndpoint && clientConfig.endpoint) {
654
- const customEndpoint = await clientConfig.endpoint();
655
- if (customEndpoint?.headers) {
656
- endpoint.headers ??= {};
657
- for (const [name, value] of Object.entries(customEndpoint.headers)) {
658
- endpoint.headers[name] = Array.isArray(value) ? value : [value];
659
- }
660
- }
661
- }
662
- return endpoint;
663
- };
664
- }
665
- var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
666
- const endpointParams = {};
667
- const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
668
- for (const [name, instruction] of Object.entries(instructions)) {
669
- switch (instruction.type) {
670
- case "staticContextParams":
671
- endpointParams[name] = instruction.value;
672
- break;
673
- case "contextParams":
674
- endpointParams[name] = commandInput[instruction.name];
675
- break;
676
- case "clientContextParams":
677
- case "builtInParams":
678
- endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")();
679
- break;
680
- case "operationContextParams":
681
- endpointParams[name] = instruction.get(commandInput);
682
- break;
683
- default:
684
- throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
685
- }
686
- }
687
- if (Object.keys(instructions).length === 0) {
688
- Object.assign(endpointParams, clientConfig);
689
- }
690
- if (String(clientConfig.serviceId).toLowerCase() === "s3") {
691
- await resolveParamsForS3(endpointParams);
692
- }
693
- return endpointParams;
694
- };
695
-
696
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js
697
- function setFeature(context, feature, value) {
698
- if (!context.__smithy_context) {
699
- context.__smithy_context = { features: {} };
700
- } else if (!context.__smithy_context.features) {
701
- context.__smithy_context.features = {};
702
- }
703
- context.__smithy_context.features[feature] = value;
704
- }
705
- function bindEndpointMiddleware(getEndpointFromConfig2) {
706
- const getEndpointFromInstructions2 = bindGetEndpointFromInstructions(getEndpointFromConfig2);
707
- return ({ config, instructions }) => {
708
- return (next, context) => async (args) => {
709
- if (config.isCustomEndpoint) {
710
- setFeature(context, "ENDPOINT_OVERRIDE", "N");
711
- }
712
- const endpoint = await getEndpointFromInstructions2(args.input, {
713
- getEndpointParameterInstructions() {
714
- return instructions;
715
- }
716
- }, { ...config }, context);
717
- context.endpointV2 = endpoint;
718
- context.authSchemes = endpoint.properties?.authSchemes;
719
- const authScheme = context.authSchemes?.[0];
720
- if (authScheme) {
721
- context["signing_region"] = authScheme.signingRegion;
722
- context["signing_service"] = authScheme.signingName;
723
- const smithyContext = getSmithyContext(context);
724
- const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
725
- if (httpAuthOption) {
726
- httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
727
- signing_region: authScheme.signingRegion,
728
- signingRegion: authScheme.signingRegion,
729
- signing_service: authScheme.signingName,
730
- signingName: authScheme.signingName,
731
- signingRegionSet: authScheme.signingRegionSet
732
- }, authScheme.properties);
733
- }
734
- }
735
- return next({
736
- ...args
737
- });
738
- };
739
- };
740
- }
741
-
742
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js
743
- var serializerMiddlewareOption = {
744
- name: "serializerMiddleware",
745
- step: "serialize",
746
- tags: ["SERIALIZER"],
747
- override: true
748
- };
749
- var endpointMiddlewareOptions = {
750
- step: "serialize",
751
- tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
752
- name: "endpointV2Middleware",
753
- override: true,
754
- relation: "before",
755
- toMiddleware: serializerMiddlewareOption.name
756
- };
757
- function bindGetEndpointPlugin(getEndpointFromConfig2) {
758
- const endpointMiddleware2 = bindEndpointMiddleware(getEndpointFromConfig2);
759
- return (config, instructions) => ({
760
- applyToStack: (clientStack) => {
761
- clientStack.addRelativeTo(endpointMiddleware2({
762
- config,
763
- instructions
764
- }), endpointMiddlewareOptions);
765
- }
766
- });
767
- }
768
-
769
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js
770
- function bindResolveEndpointConfig(getEndpointFromConfig2) {
771
- return (input) => {
772
- const tls = input.tls ?? true;
773
- const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
774
- const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : void 0;
775
- const isCustomEndpoint = !!endpoint;
776
- const resolvedConfig = Object.assign(input, {
777
- endpoint: customEndpointProvider,
778
- tls,
779
- isCustomEndpoint,
780
- useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
781
- useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false)
782
- });
783
- let configuredEndpointPromise = void 0;
784
- resolvedConfig.serviceConfiguredEndpoint = async () => {
785
- if (input.serviceId && !configuredEndpointPromise) {
786
- configuredEndpointPromise = getEndpointFromConfig2(input.serviceId);
787
- }
788
- return configuredEndpointPromise;
789
- };
790
- return resolvedConfig;
791
- };
792
- }
793
-
794
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js
795
- var BinaryDecisionDiagram = class _BinaryDecisionDiagram {
796
- nodes;
797
- root;
798
- conditions;
799
- results;
800
- constructor(bdd, root, conditions, results) {
801
- this.nodes = bdd;
802
- this.root = root;
803
- this.conditions = conditions;
804
- this.results = results;
805
- }
806
- static from(bdd, root, conditions, results) {
807
- return new _BinaryDecisionDiagram(bdd, root, conditions, results);
808
- }
809
- };
810
-
811
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js
812
- var EndpointCache = class {
813
- capacity;
814
- data = /* @__PURE__ */ new Map();
815
- parameters = [];
816
- constructor({ size, params }) {
817
- this.capacity = size ?? 50;
818
- if (params) {
819
- this.parameters = params;
820
- }
821
- }
822
- get(endpointParams, resolver) {
823
- const key = this.hash(endpointParams);
824
- if (key === false) {
825
- return resolver();
826
- }
827
- if (!this.data.has(key)) {
828
- if (this.data.size > this.capacity + 10) {
829
- const keys = this.data.keys();
830
- let i = 0;
831
- while (true) {
832
- const { value, done } = keys.next();
833
- this.data.delete(value);
834
- if (done || ++i > 10) {
835
- break;
836
- }
837
- }
838
- }
839
- this.data.set(key, resolver());
840
- }
841
- return this.data.get(key);
842
- }
843
- size() {
844
- return this.data.size;
845
- }
846
- hash(endpointParams) {
847
- let buffer = "";
848
- const { parameters } = this;
849
- if (parameters.length === 0) {
850
- return false;
851
- }
852
- for (const param of parameters) {
853
- const val = String(endpointParams[param] ?? "");
854
- if (val.includes("|;")) {
855
- return false;
856
- }
857
- buffer += val + "|;";
858
- }
859
- return buffer;
860
- }
861
- };
862
-
863
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js
864
- var EndpointError = class extends Error {
865
- constructor(message) {
866
- super(message);
867
- this.name = "EndpointError";
868
- }
869
- };
870
-
871
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js
872
- var debugId = "endpoints";
873
-
874
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js
875
- function toDebugString(input) {
876
- if (typeof input !== "object" || input == null) {
877
- return input;
878
- }
879
- if ("ref" in input) {
880
- return `$${toDebugString(input.ref)}`;
881
- }
882
- if ("fn" in input) {
883
- return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
884
- }
885
- return JSON.stringify(input, null, 2);
886
- }
887
-
888
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js
889
- var customEndpointFunctions = {};
890
-
891
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js
892
- var booleanEquals = (value1, value2) => value1 === value2;
893
-
894
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js
895
- function coalesce(...args) {
896
- for (const arg of args) {
897
- if (arg != null) {
898
- return arg;
899
- }
900
- }
901
- return void 0;
902
- }
903
-
904
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js
905
- var getAttrPathList = (path) => {
906
- const parts = path.split(".");
907
- const pathList = [];
908
- for (const part of parts) {
909
- const squareBracketIndex = part.indexOf("[");
910
- if (squareBracketIndex !== -1) {
911
- if (part.indexOf("]") !== part.length - 1) {
912
- throw new EndpointError(`Path: '${path}' does not end with ']'`);
913
- }
914
- const arrayIndex = part.slice(squareBracketIndex + 1, -1);
915
- if (Number.isNaN(parseInt(arrayIndex))) {
916
- throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
917
- }
918
- if (squareBracketIndex !== 0) {
919
- pathList.push(part.slice(0, squareBracketIndex));
920
- }
921
- pathList.push(arrayIndex);
922
- } else {
923
- pathList.push(part);
924
- }
925
- }
926
- return pathList;
927
- };
928
-
929
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js
930
- var getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
931
- if (typeof acc !== "object") {
932
- throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
933
- } else if (Array.isArray(acc)) {
934
- const i = parseInt(index);
935
- return acc[i < 0 ? acc.length + i : i];
936
- }
937
- return acc[index];
938
- }, value);
939
-
940
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js
941
- var isSet = (value) => value != null;
942
-
943
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isValidHostLabel.js
944
- var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
945
- var isValidHostLabel = (value, allowSubDomains = false) => {
946
- if (!allowSubDomains) {
947
- return VALID_HOST_LABEL_REGEX.test(value);
948
- }
949
- const labels = value.split(".");
950
- for (const label of labels) {
951
- if (!isValidHostLabel(label)) {
952
- return false;
953
- }
954
- }
955
- return true;
956
- };
957
-
958
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js
959
- function ite(condition, trueValue, falseValue) {
960
- return condition ? trueValue : falseValue;
961
- }
962
-
963
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js
964
- var not = (value) => !value;
965
-
966
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js
967
- 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}$`);
968
- var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]");
969
-
970
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js
971
- var DEFAULT_PORTS = {
972
- [EndpointURLScheme.HTTP]: 80,
973
- [EndpointURLScheme.HTTPS]: 443
974
- };
975
- var parseURL = (value) => {
976
- const whatwgURL = (() => {
977
- try {
978
- if (value instanceof URL) {
979
- return value;
980
- }
981
- if (typeof value === "object" && "hostname" in value) {
982
- const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
983
- const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
984
- url.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&");
985
- return url;
986
- }
987
- return new URL(value);
988
- } catch (error) {
989
- return null;
990
- }
991
- })();
992
- if (!whatwgURL) {
993
- console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
994
- return null;
995
- }
996
- const urlString = whatwgURL.href;
997
- const { host, hostname, pathname, protocol, search } = whatwgURL;
998
- if (search) {
999
- return null;
1000
- }
1001
- const scheme = protocol.slice(0, -1);
1002
- if (!Object.values(EndpointURLScheme).includes(scheme)) {
1003
- return null;
1004
- }
1005
- const isIp = isIpAddress(hostname);
1006
- const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`);
1007
- const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
1008
- return {
1009
- scheme,
1010
- authority,
1011
- path: pathname,
1012
- normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
1013
- isIp
1014
- };
1015
- };
1016
-
1017
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js
1018
- function split(value, delimiter, limit) {
1019
- if (limit === 1) {
1020
- return [value];
1021
- }
1022
- if (value === "") {
1023
- return [""];
1024
- }
1025
- const parts = value.split(delimiter);
1026
- if (limit === 0) {
1027
- return parts;
1028
- }
1029
- return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter));
1030
- }
1031
-
1032
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js
1033
- var stringEquals = (value1, value2) => value1 === value2;
1034
-
1035
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js
1036
- var substring = (input, start, stop, reverse) => {
1037
- if (input == null || start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) {
1038
- return null;
1039
- }
1040
- if (!reverse) {
1041
- return input.substring(start, stop);
1042
- }
1043
- return input.substring(input.length - stop, input.length - start);
1044
- };
1045
-
1046
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js
1047
- var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
1048
-
1049
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js
1050
- var endpointFunctions = {
1051
- booleanEquals,
1052
- coalesce,
1053
- getAttr,
1054
- isSet,
1055
- isValidHostLabel,
1056
- ite,
1057
- not,
1058
- parseURL,
1059
- split,
1060
- stringEquals,
1061
- substring,
1062
- uriEncode
1063
- };
1064
-
1065
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js
1066
- var evaluateTemplate = (template, options) => {
1067
- const evaluatedTemplateArr = [];
1068
- const { referenceRecord, endpointParams } = options;
1069
- let currentIndex = 0;
1070
- while (currentIndex < template.length) {
1071
- const openingBraceIndex = template.indexOf("{", currentIndex);
1072
- if (openingBraceIndex === -1) {
1073
- evaluatedTemplateArr.push(template.slice(currentIndex));
1074
- break;
1075
- }
1076
- evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
1077
- const closingBraceIndex = template.indexOf("}", openingBraceIndex);
1078
- if (closingBraceIndex === -1) {
1079
- evaluatedTemplateArr.push(template.slice(openingBraceIndex));
1080
- break;
1081
- }
1082
- if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
1083
- evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
1084
- currentIndex = closingBraceIndex + 2;
1085
- }
1086
- const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
1087
- if (parameterName.includes("#")) {
1088
- const [refName, attrName] = parameterName.split("#");
1089
- evaluatedTemplateArr.push(getAttr(referenceRecord[refName] ?? endpointParams[refName], attrName));
1090
- } else {
1091
- evaluatedTemplateArr.push(referenceRecord[parameterName] ?? endpointParams[parameterName]);
1092
- }
1093
- currentIndex = closingBraceIndex + 1;
1094
- }
1095
- return evaluatedTemplateArr.join("");
1096
- };
1097
-
1098
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getReferenceValue.js
1099
- var getReferenceValue = ({ ref }, options) => {
1100
- return options.referenceRecord[ref] ?? options.endpointParams[ref];
1101
- };
1102
-
1103
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateExpression.js
1104
- var evaluateExpression = (obj, keyName, options) => {
1105
- if (typeof obj === "string") {
1106
- return evaluateTemplate(obj, options);
1107
- } else if (obj["fn"]) {
1108
- return group.callFunction(obj, options);
1109
- } else if (obj["ref"]) {
1110
- return getReferenceValue(obj, options);
1111
- }
1112
- throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
1113
- };
1114
- var callFunction = ({ fn, argv }, options) => {
1115
- const evaluatedArgs = Array(argv.length);
1116
- for (let i = 0; i < evaluatedArgs.length; ++i) {
1117
- const arg = argv[i];
1118
- if (typeof arg === "boolean" || typeof arg === "number") {
1119
- evaluatedArgs[i] = arg;
1120
- } else {
1121
- evaluatedArgs[i] = group.evaluateExpression(arg, "arg", options);
1122
- }
1123
- }
1124
- const namespaceSeparatorIndex = fn.indexOf(".");
1125
- if (namespaceSeparatorIndex !== -1) {
1126
- const namespaceFunctions = customEndpointFunctions[fn.slice(0, namespaceSeparatorIndex)];
1127
- const customFunction = namespaceFunctions?.[fn.slice(namespaceSeparatorIndex + 1)];
1128
- if (typeof customFunction === "function") {
1129
- return customFunction(...evaluatedArgs);
1130
- }
1131
- }
1132
- const callable = endpointFunctions[fn];
1133
- if (typeof callable === "function") {
1134
- return callable(...evaluatedArgs);
1135
- }
1136
- throw new Error(`function ${fn} not loaded in endpointFunctions.`);
1137
- };
1138
- var group = {
1139
- evaluateExpression,
1140
- callFunction
1141
- };
1142
-
1143
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateCondition.js
1144
- var evaluateCondition = (condition, options) => {
1145
- const { assign } = condition;
1146
- if (assign && assign in options.referenceRecord) {
1147
- throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
1148
- }
1149
- const value = callFunction(condition, options);
1150
- options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(condition)} = ${toDebugString(value)}`);
1151
- const result = value === "" ? true : !!value;
1152
- if (assign != null) {
1153
- return { result, toAssign: { name: assign, value } };
1154
- }
1155
- return { result };
1156
- };
1157
-
1158
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.js
1159
- var getEndpointHeaders = (headers, options) => Object.entries(headers ?? {}).reduce((acc, [headerKey, headerVal]) => {
1160
- acc[headerKey] = headerVal.map((headerValEntry) => {
1161
- const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
1162
- if (typeof processedExpr !== "string") {
1163
- throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
1164
- }
1165
- return processedExpr;
1166
- });
1167
- return acc;
1168
- }, {});
1169
-
1170
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointProperties.js
1171
- var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => {
1172
- acc[propertyKey] = group2.getEndpointProperty(propertyVal, options);
1173
- return acc;
1174
- }, {});
1175
- var getEndpointProperty = (property, options) => {
1176
- if (Array.isArray(property)) {
1177
- return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
1178
- }
1179
- switch (typeof property) {
1180
- case "string":
1181
- return evaluateTemplate(property, options);
1182
- case "object":
1183
- if (property === null) {
1184
- throw new EndpointError(`Unexpected endpoint property: ${property}`);
1185
- }
1186
- return group2.getEndpointProperties(property, options);
1187
- case "boolean":
1188
- return property;
1189
- default:
1190
- throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
1191
- }
1192
- };
1193
- var group2 = {
1194
- getEndpointProperty,
1195
- getEndpointProperties
1196
- };
1197
-
1198
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointUrl.js
1199
- var getEndpointUrl = (endpointUrl, options) => {
1200
- const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
1201
- if (typeof expression === "string") {
1202
- try {
1203
- return new URL(expression);
1204
- } catch (error) {
1205
- console.error(`Failed to construct URL with ${expression}`, error);
1206
- throw error;
1207
- }
1208
- }
1209
- throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
1210
- };
1211
-
1212
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/decideEndpoint.js
1213
- var RESULT = 1e8;
1214
- var decideEndpoint = (bdd, options) => {
1215
- const { nodes, root, results, conditions } = bdd;
1216
- let ref = root;
1217
- const referenceRecord = {};
1218
- const closure = {
1219
- referenceRecord,
1220
- endpointParams: options.endpointParams,
1221
- logger: options.logger
1222
- };
1223
- while (ref !== 1 && ref !== -1 && ref < RESULT) {
1224
- const node_i = 3 * (Math.abs(ref) - 1);
1225
- const [condition_i, highRef, lowRef] = [nodes[node_i], nodes[node_i + 1], nodes[node_i + 2]];
1226
- const [fn, argv, assign] = conditions[condition_i];
1227
- const evaluation = evaluateCondition({ fn, assign, argv }, closure);
1228
- if (evaluation.toAssign) {
1229
- const { name, value } = evaluation.toAssign;
1230
- referenceRecord[name] = value;
1231
- }
1232
- ref = ref >= 0 === evaluation.result ? highRef : lowRef;
1233
- }
1234
- if (ref >= RESULT) {
1235
- const result = results[ref - RESULT];
1236
- if (result[0] === -1) {
1237
- const [, errorExpression] = result;
1238
- throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
1239
- }
1240
- const [url, properties, headers] = result;
1241
- return {
1242
- url: getEndpointUrl(url, closure),
1243
- properties: getEndpointProperties(properties, closure),
1244
- headers: getEndpointHeaders(headers ?? {}, closure)
1245
- };
1246
- }
1247
- throw new EndpointError(`No matching endpoint.`);
1248
- };
1249
-
1250
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js
1251
- var getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig);
1252
- var resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);
1253
- var endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);
1254
- var getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig);
1255
-
1256
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js
1257
- var validRegions = /* @__PURE__ */ new Set();
1258
- var checkRegion = (region, check = isValidHostLabel) => {
1259
- if (!validRegions.has(region) && !check(region)) {
1260
- if (region === "*") {
1261
- 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.`);
1262
- } else {
1263
- throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`);
1264
- }
1265
- } else {
1266
- validRegions.add(region);
1267
- }
1268
- };
1269
-
1270
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/isFipsRegion.js
1271
- var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips"));
1272
-
1273
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getRealRegion.js
1274
- var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region;
1275
-
1276
- // ../../node_modules/.pnpm/@smithy+core@3.24.1/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/resolveRegionConfig.js
1277
- var resolveRegionConfig = (input) => {
1278
- const { region, useFipsEndpoint } = input;
1279
- if (!region) {
1280
- throw new Error("Region is missing");
1281
- }
1282
- return Object.assign(input, {
1283
- region: async () => {
1284
- const providedRegion = typeof region === "function" ? await region() : region;
1285
- const realRegion = getRealRegion(providedRegion);
1286
- checkRegion(realRegion);
1287
- return realRegion;
1288
- },
1289
- useFipsEndpoint: async () => {
1290
- const providedRegion = typeof region === "string" ? region : await region();
1291
- if (isFipsRegion(providedRegion)) {
1292
- return true;
1293
- }
1294
- return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
1295
- }
1296
- });
1297
- };
1298
-
1299
- export {
1300
- loadConfig,
1301
- NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
1302
- NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
1303
- NODE_REGION_CONFIG_OPTIONS,
1304
- NODE_REGION_CONFIG_FILE_OPTIONS,
1305
- resolveRegionConfig,
1306
- resolveDefaultsModeConfig,
1307
- toEndpointV1,
1308
- resolveParams,
1309
- BinaryDecisionDiagram,
1310
- EndpointCache,
1311
- customEndpointFunctions,
1312
- decideEndpoint,
1313
- resolveEndpointConfig,
1314
- getEndpointPlugin
1315
- };