@aws-sdk/core 3.974.20 → 3.974.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +45 -50
- package/dist-cjs/submodules/account-id-endpoint/index.js +2 -4
- package/dist-cjs/submodules/client/index.browser.js +297 -23
- package/dist-cjs/submodules/client/index.js +327 -52
- package/dist-cjs/submodules/client/index.native.js +297 -23
- package/dist-cjs/submodules/httpAuthSchemes/index.js +19 -21
- package/dist-cjs/submodules/protocols/index.js +107 -109
- package/dist-cjs/submodules/util/index.js +2 -4
- package/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +276 -1
- package/package.json +8 -8
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const { Retry, RETRY_MODES } = require("@smithy/core/retry");
|
|
2
|
+
const { HttpRequest, parseUrl } = require("@smithy/core/protocols");
|
|
3
|
+
const { InvokeStore } = require("@aws/lambda-invoke-store");
|
|
4
|
+
const { normalizeProvider } = require("@smithy/core");
|
|
5
|
+
const { platform, release } = require("node:os");
|
|
6
|
+
const { versions, env } = require("node:process");
|
|
7
|
+
const { booleanSelector, SelectorType, loadConfig, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS } = require("@smithy/core/config");
|
|
8
|
+
const { REGION_ENV_NAME, REGION_INI_NAME, resolveRegionConfig } = require("@smithy/core/config");
|
|
9
|
+
exports.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS;
|
|
10
|
+
exports.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS;
|
|
11
|
+
exports.REGION_ENV_NAME = REGION_ENV_NAME;
|
|
12
|
+
exports.REGION_INI_NAME = REGION_INI_NAME;
|
|
13
|
+
exports.resolveRegionConfig = resolveRegionConfig;
|
|
14
|
+
const { readFile } = require("node:fs/promises");
|
|
15
|
+
const { normalize, sep, join } = require("node:path");
|
|
16
|
+
const { isValidHostLabel, isIpAddress, customEndpointFunctions } = require("@smithy/core/endpoints");
|
|
17
|
+
const { EndpointError, resolveEndpoint } = require("@smithy/core/endpoints");
|
|
18
|
+
exports.EndpointError = EndpointError;
|
|
19
|
+
exports.isIpAddress = isIpAddress;
|
|
20
|
+
exports.resolveEndpoint = resolveEndpoint;
|
|
13
21
|
|
|
14
22
|
const state = {
|
|
15
23
|
warningEmitted: false,
|
|
@@ -60,7 +68,7 @@ function setCredentialFeature(credentials, feature, value) {
|
|
|
60
68
|
return credentials;
|
|
61
69
|
}
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
|
|
64
72
|
function setFeature(context, feature, value) {
|
|
65
73
|
if (!context.__aws_sdk_context) {
|
|
66
74
|
context.__aws_sdk_context = {
|
|
@@ -85,7 +93,7 @@ function resolveHostHeaderConfig(input) {
|
|
|
85
93
|
return input;
|
|
86
94
|
}
|
|
87
95
|
const hostHeaderMiddleware = (options) => (next) => async (args) => {
|
|
88
|
-
if (!
|
|
96
|
+
if (!HttpRequest.isInstance(args.request))
|
|
89
97
|
return next(args);
|
|
90
98
|
const { request } = args;
|
|
91
99
|
const { handlerProtocol = "" } = options.requestHandler.metadata || {};
|
|
@@ -170,7 +178,7 @@ const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
|
|
|
170
178
|
const ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
|
|
171
179
|
const recursionDetectionMiddleware = () => (next) => async (args) => {
|
|
172
180
|
const { request } = args;
|
|
173
|
-
if (!
|
|
181
|
+
if (!HttpRequest.isInstance(request)) {
|
|
174
182
|
return next(args);
|
|
175
183
|
}
|
|
176
184
|
const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ??
|
|
@@ -180,7 +188,7 @@ const recursionDetectionMiddleware = () => (next) => async (args) => {
|
|
|
180
188
|
}
|
|
181
189
|
const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
|
|
182
190
|
const traceIdFromEnv = process.env[ENV_TRACE_ID];
|
|
183
|
-
const invokeStore = await
|
|
191
|
+
const invokeStore = await InvokeStore.getInstanceAsync();
|
|
184
192
|
const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();
|
|
185
193
|
const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;
|
|
186
194
|
const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
|
|
@@ -207,7 +215,7 @@ function isValidUserAgentAppId(appId) {
|
|
|
207
215
|
return typeof appId === "string" && appId.length <= 50;
|
|
208
216
|
}
|
|
209
217
|
function resolveUserAgentConfig(input) {
|
|
210
|
-
const normalizedAppIdProvider =
|
|
218
|
+
const normalizedAppIdProvider = normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
|
|
211
219
|
const { customUserAgent } = input;
|
|
212
220
|
return Object.assign(input, {
|
|
213
221
|
customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
|
|
@@ -227,7 +235,282 @@ function resolveUserAgentConfig(input) {
|
|
|
227
235
|
});
|
|
228
236
|
}
|
|
229
237
|
|
|
230
|
-
const partitionsInfo = {
|
|
238
|
+
const partitionsInfo = {
|
|
239
|
+
"partitions": [
|
|
240
|
+
{
|
|
241
|
+
"id": "aws",
|
|
242
|
+
"outputs": {
|
|
243
|
+
"dnsSuffix": "amazonaws.com",
|
|
244
|
+
"dualStackDnsSuffix": "api.aws",
|
|
245
|
+
"implicitGlobalRegion": "us-east-1",
|
|
246
|
+
"name": "aws",
|
|
247
|
+
"supportsDualStack": true,
|
|
248
|
+
"supportsFIPS": true
|
|
249
|
+
},
|
|
250
|
+
"regionRegex": "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
|
|
251
|
+
"regions": {
|
|
252
|
+
"af-south-1": {
|
|
253
|
+
"description": "Africa (Cape Town)"
|
|
254
|
+
},
|
|
255
|
+
"ap-east-1": {
|
|
256
|
+
"description": "Asia Pacific (Hong Kong)"
|
|
257
|
+
},
|
|
258
|
+
"ap-east-2": {
|
|
259
|
+
"description": "Asia Pacific (Taipei)"
|
|
260
|
+
},
|
|
261
|
+
"ap-northeast-1": {
|
|
262
|
+
"description": "Asia Pacific (Tokyo)"
|
|
263
|
+
},
|
|
264
|
+
"ap-northeast-2": {
|
|
265
|
+
"description": "Asia Pacific (Seoul)"
|
|
266
|
+
},
|
|
267
|
+
"ap-northeast-3": {
|
|
268
|
+
"description": "Asia Pacific (Osaka)"
|
|
269
|
+
},
|
|
270
|
+
"ap-south-1": {
|
|
271
|
+
"description": "Asia Pacific (Mumbai)"
|
|
272
|
+
},
|
|
273
|
+
"ap-south-2": {
|
|
274
|
+
"description": "Asia Pacific (Hyderabad)"
|
|
275
|
+
},
|
|
276
|
+
"ap-southeast-1": {
|
|
277
|
+
"description": "Asia Pacific (Singapore)"
|
|
278
|
+
},
|
|
279
|
+
"ap-southeast-2": {
|
|
280
|
+
"description": "Asia Pacific (Sydney)"
|
|
281
|
+
},
|
|
282
|
+
"ap-southeast-3": {
|
|
283
|
+
"description": "Asia Pacific (Jakarta)"
|
|
284
|
+
},
|
|
285
|
+
"ap-southeast-4": {
|
|
286
|
+
"description": "Asia Pacific (Melbourne)"
|
|
287
|
+
},
|
|
288
|
+
"ap-southeast-5": {
|
|
289
|
+
"description": "Asia Pacific (Malaysia)"
|
|
290
|
+
},
|
|
291
|
+
"ap-southeast-6": {
|
|
292
|
+
"description": "Asia Pacific (New Zealand)"
|
|
293
|
+
},
|
|
294
|
+
"ap-southeast-7": {
|
|
295
|
+
"description": "Asia Pacific (Thailand)"
|
|
296
|
+
},
|
|
297
|
+
"aws-global": {
|
|
298
|
+
"description": "aws global region"
|
|
299
|
+
},
|
|
300
|
+
"ca-central-1": {
|
|
301
|
+
"description": "Canada (Central)"
|
|
302
|
+
},
|
|
303
|
+
"ca-west-1": {
|
|
304
|
+
"description": "Canada West (Calgary)"
|
|
305
|
+
},
|
|
306
|
+
"eu-central-1": {
|
|
307
|
+
"description": "Europe (Frankfurt)"
|
|
308
|
+
},
|
|
309
|
+
"eu-central-2": {
|
|
310
|
+
"description": "Europe (Zurich)"
|
|
311
|
+
},
|
|
312
|
+
"eu-north-1": {
|
|
313
|
+
"description": "Europe (Stockholm)"
|
|
314
|
+
},
|
|
315
|
+
"eu-south-1": {
|
|
316
|
+
"description": "Europe (Milan)"
|
|
317
|
+
},
|
|
318
|
+
"eu-south-2": {
|
|
319
|
+
"description": "Europe (Spain)"
|
|
320
|
+
},
|
|
321
|
+
"eu-west-1": {
|
|
322
|
+
"description": "Europe (Ireland)"
|
|
323
|
+
},
|
|
324
|
+
"eu-west-2": {
|
|
325
|
+
"description": "Europe (London)"
|
|
326
|
+
},
|
|
327
|
+
"eu-west-3": {
|
|
328
|
+
"description": "Europe (Paris)"
|
|
329
|
+
},
|
|
330
|
+
"il-central-1": {
|
|
331
|
+
"description": "Israel (Tel Aviv)"
|
|
332
|
+
},
|
|
333
|
+
"me-central-1": {
|
|
334
|
+
"description": "Middle East (UAE)"
|
|
335
|
+
},
|
|
336
|
+
"me-south-1": {
|
|
337
|
+
"description": "Middle East (Bahrain)"
|
|
338
|
+
},
|
|
339
|
+
"mx-central-1": {
|
|
340
|
+
"description": "Mexico (Central)"
|
|
341
|
+
},
|
|
342
|
+
"sa-east-1": {
|
|
343
|
+
"description": "South America (Sao Paulo)"
|
|
344
|
+
},
|
|
345
|
+
"us-east-1": {
|
|
346
|
+
"description": "US East (N. Virginia)"
|
|
347
|
+
},
|
|
348
|
+
"us-east-2": {
|
|
349
|
+
"description": "US East (Ohio)"
|
|
350
|
+
},
|
|
351
|
+
"us-west-1": {
|
|
352
|
+
"description": "US West (N. California)"
|
|
353
|
+
},
|
|
354
|
+
"us-west-2": {
|
|
355
|
+
"description": "US West (Oregon)"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"id": "aws-cn",
|
|
361
|
+
"outputs": {
|
|
362
|
+
"dnsSuffix": "amazonaws.com.cn",
|
|
363
|
+
"dualStackDnsSuffix": "api.amazonwebservices.com.cn",
|
|
364
|
+
"implicitGlobalRegion": "cn-northwest-1",
|
|
365
|
+
"name": "aws-cn",
|
|
366
|
+
"supportsDualStack": true,
|
|
367
|
+
"supportsFIPS": true
|
|
368
|
+
},
|
|
369
|
+
"regionRegex": "^cn\\-\\w+\\-\\d+$",
|
|
370
|
+
"regions": {
|
|
371
|
+
"aws-cn-global": {
|
|
372
|
+
"description": "aws-cn global region"
|
|
373
|
+
},
|
|
374
|
+
"cn-north-1": {
|
|
375
|
+
"description": "China (Beijing)"
|
|
376
|
+
},
|
|
377
|
+
"cn-northwest-1": {
|
|
378
|
+
"description": "China (Ningxia)"
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"id": "aws-eusc",
|
|
384
|
+
"outputs": {
|
|
385
|
+
"dnsSuffix": "amazonaws.eu",
|
|
386
|
+
"dualStackDnsSuffix": "api.amazonwebservices.eu",
|
|
387
|
+
"implicitGlobalRegion": "eusc-de-east-1",
|
|
388
|
+
"name": "aws-eusc",
|
|
389
|
+
"supportsDualStack": true,
|
|
390
|
+
"supportsFIPS": true
|
|
391
|
+
},
|
|
392
|
+
"regionRegex": "^eusc\\-(de)\\-\\w+\\-\\d+$",
|
|
393
|
+
"regions": {
|
|
394
|
+
"eusc-de-east-1": {
|
|
395
|
+
"description": "AWS European Sovereign Cloud (Germany)"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"id": "aws-iso",
|
|
401
|
+
"outputs": {
|
|
402
|
+
"dnsSuffix": "c2s.ic.gov",
|
|
403
|
+
"dualStackDnsSuffix": "api.aws.ic.gov",
|
|
404
|
+
"implicitGlobalRegion": "us-iso-east-1",
|
|
405
|
+
"name": "aws-iso",
|
|
406
|
+
"supportsDualStack": true,
|
|
407
|
+
"supportsFIPS": true
|
|
408
|
+
},
|
|
409
|
+
"regionRegex": "^us\\-iso\\-\\w+\\-\\d+$",
|
|
410
|
+
"regions": {
|
|
411
|
+
"aws-iso-global": {
|
|
412
|
+
"description": "aws-iso global region"
|
|
413
|
+
},
|
|
414
|
+
"us-iso-east-1": {
|
|
415
|
+
"description": "US ISO East"
|
|
416
|
+
},
|
|
417
|
+
"us-iso-west-1": {
|
|
418
|
+
"description": "US ISO WEST"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"id": "aws-iso-b",
|
|
424
|
+
"outputs": {
|
|
425
|
+
"dnsSuffix": "sc2s.sgov.gov",
|
|
426
|
+
"dualStackDnsSuffix": "api.aws.scloud",
|
|
427
|
+
"implicitGlobalRegion": "us-isob-east-1",
|
|
428
|
+
"name": "aws-iso-b",
|
|
429
|
+
"supportsDualStack": true,
|
|
430
|
+
"supportsFIPS": true
|
|
431
|
+
},
|
|
432
|
+
"regionRegex": "^us\\-isob\\-\\w+\\-\\d+$",
|
|
433
|
+
"regions": {
|
|
434
|
+
"aws-iso-b-global": {
|
|
435
|
+
"description": "aws-iso-b global region"
|
|
436
|
+
},
|
|
437
|
+
"us-isob-east-1": {
|
|
438
|
+
"description": "US ISOB East (Ohio)"
|
|
439
|
+
},
|
|
440
|
+
"us-isob-west-1": {
|
|
441
|
+
"description": "US ISOB West"
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"id": "aws-iso-e",
|
|
447
|
+
"outputs": {
|
|
448
|
+
"dnsSuffix": "cloud.adc-e.uk",
|
|
449
|
+
"dualStackDnsSuffix": "api.cloud-aws.adc-e.uk",
|
|
450
|
+
"implicitGlobalRegion": "eu-isoe-west-1",
|
|
451
|
+
"name": "aws-iso-e",
|
|
452
|
+
"supportsDualStack": true,
|
|
453
|
+
"supportsFIPS": true
|
|
454
|
+
},
|
|
455
|
+
"regionRegex": "^eu\\-isoe\\-\\w+\\-\\d+$",
|
|
456
|
+
"regions": {
|
|
457
|
+
"aws-iso-e-global": {
|
|
458
|
+
"description": "aws-iso-e global region"
|
|
459
|
+
},
|
|
460
|
+
"eu-isoe-west-1": {
|
|
461
|
+
"description": "EU ISOE West"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"id": "aws-iso-f",
|
|
467
|
+
"outputs": {
|
|
468
|
+
"dnsSuffix": "csp.hci.ic.gov",
|
|
469
|
+
"dualStackDnsSuffix": "api.aws.hci.ic.gov",
|
|
470
|
+
"implicitGlobalRegion": "us-isof-south-1",
|
|
471
|
+
"name": "aws-iso-f",
|
|
472
|
+
"supportsDualStack": true,
|
|
473
|
+
"supportsFIPS": true
|
|
474
|
+
},
|
|
475
|
+
"regionRegex": "^us\\-isof\\-\\w+\\-\\d+$",
|
|
476
|
+
"regions": {
|
|
477
|
+
"aws-iso-f-global": {
|
|
478
|
+
"description": "aws-iso-f global region"
|
|
479
|
+
},
|
|
480
|
+
"us-isof-east-1": {
|
|
481
|
+
"description": "US ISOF EAST"
|
|
482
|
+
},
|
|
483
|
+
"us-isof-south-1": {
|
|
484
|
+
"description": "US ISOF SOUTH"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"id": "aws-us-gov",
|
|
490
|
+
"outputs": {
|
|
491
|
+
"dnsSuffix": "amazonaws.com",
|
|
492
|
+
"dualStackDnsSuffix": "api.aws",
|
|
493
|
+
"implicitGlobalRegion": "us-gov-west-1",
|
|
494
|
+
"name": "aws-us-gov",
|
|
495
|
+
"supportsDualStack": true,
|
|
496
|
+
"supportsFIPS": true
|
|
497
|
+
},
|
|
498
|
+
"regionRegex": "^us\\-gov\\-\\w+\\-\\d+$",
|
|
499
|
+
"regions": {
|
|
500
|
+
"aws-us-gov-global": {
|
|
501
|
+
"description": "aws-us-gov global region"
|
|
502
|
+
},
|
|
503
|
+
"us-gov-east-1": {
|
|
504
|
+
"description": "AWS GovCloud (US-East)"
|
|
505
|
+
},
|
|
506
|
+
"us-gov-west-1": {
|
|
507
|
+
"description": "AWS GovCloud (US-West)"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
],
|
|
512
|
+
"version": "1.1"
|
|
513
|
+
};
|
|
231
514
|
|
|
232
515
|
let selectedPartitionsInfo = partitionsInfo;
|
|
233
516
|
let selectedUserAgentPrefix = "";
|
|
@@ -280,10 +563,10 @@ async function checkFeatures(context, config, args) {
|
|
|
280
563
|
const retryStrategy = await config.retryStrategy();
|
|
281
564
|
if (typeof retryStrategy.mode === "string") {
|
|
282
565
|
switch (retryStrategy.mode) {
|
|
283
|
-
case
|
|
566
|
+
case RETRY_MODES.ADAPTIVE:
|
|
284
567
|
setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
|
|
285
568
|
break;
|
|
286
|
-
case
|
|
569
|
+
case RETRY_MODES.STANDARD:
|
|
287
570
|
setFeature(context, "RETRY_MODE_STANDARD", "E");
|
|
288
571
|
break;
|
|
289
572
|
}
|
|
@@ -347,7 +630,7 @@ function encodeFeatures(features) {
|
|
|
347
630
|
|
|
348
631
|
const userAgentMiddleware = (options) => (next, context) => async (args) => {
|
|
349
632
|
const { request } = args;
|
|
350
|
-
if (!
|
|
633
|
+
if (!HttpRequest.isInstance(request)) {
|
|
351
634
|
return next(args);
|
|
352
635
|
}
|
|
353
636
|
const { headers } = request;
|
|
@@ -426,11 +709,11 @@ const getUserAgentPlugin = (config) => ({
|
|
|
426
709
|
const getRuntimeUserAgentPair = () => {
|
|
427
710
|
const runtimesToCheck = ["deno", "bun", "llrt"];
|
|
428
711
|
for (const runtime of runtimesToCheck) {
|
|
429
|
-
if (
|
|
430
|
-
return [`md/${runtime}`,
|
|
712
|
+
if (versions[runtime]) {
|
|
713
|
+
return [`md/${runtime}`, versions[runtime]];
|
|
431
714
|
}
|
|
432
715
|
}
|
|
433
|
-
return ["md/nodejs",
|
|
716
|
+
return ["md/nodejs", versions.node];
|
|
434
717
|
};
|
|
435
718
|
|
|
436
719
|
const getNodeModulesParentDirs = (dirname) => {
|
|
@@ -438,10 +721,10 @@ const getNodeModulesParentDirs = (dirname) => {
|
|
|
438
721
|
if (!dirname) {
|
|
439
722
|
return [cwd];
|
|
440
723
|
}
|
|
441
|
-
const normalizedPath =
|
|
442
|
-
const parts = normalizedPath.split(
|
|
724
|
+
const normalizedPath = normalize(dirname);
|
|
725
|
+
const parts = normalizedPath.split(sep);
|
|
443
726
|
const nodeModulesIndex = parts.indexOf("node_modules");
|
|
444
|
-
const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(
|
|
727
|
+
const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep) : normalizedPath;
|
|
445
728
|
if (cwd === parentDir) {
|
|
446
729
|
return [cwd];
|
|
447
730
|
}
|
|
@@ -473,7 +756,7 @@ const getSanitizedDevTypeScriptVersion = (version = "") => {
|
|
|
473
756
|
};
|
|
474
757
|
|
|
475
758
|
let tscVersion;
|
|
476
|
-
const TS_PACKAGE_JSON =
|
|
759
|
+
const TS_PACKAGE_JSON = join("node_modules", "typescript", "package.json");
|
|
477
760
|
const getTypeScriptUserAgentPair = async () => {
|
|
478
761
|
if (tscVersion === null) {
|
|
479
762
|
return undefined;
|
|
@@ -484,7 +767,7 @@ const getTypeScriptUserAgentPair = async () => {
|
|
|
484
767
|
let isTypeScriptDetectionDisabled = false;
|
|
485
768
|
try {
|
|
486
769
|
isTypeScriptDetectionDisabled =
|
|
487
|
-
|
|
770
|
+
booleanSelector(process.env, "AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED", SelectorType.ENV) || false;
|
|
488
771
|
}
|
|
489
772
|
catch { }
|
|
490
773
|
if (isTypeScriptDetectionDisabled) {
|
|
@@ -496,8 +779,8 @@ const getTypeScriptUserAgentPair = async () => {
|
|
|
496
779
|
let versionFromApp;
|
|
497
780
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
498
781
|
try {
|
|
499
|
-
const appPackageJsonPath =
|
|
500
|
-
const packageJson = await
|
|
782
|
+
const appPackageJsonPath = join(nodeModulesParentDir, "package.json");
|
|
783
|
+
const packageJson = await readFile(appPackageJsonPath, "utf-8");
|
|
501
784
|
const { dependencies, devDependencies } = JSON.parse(packageJson);
|
|
502
785
|
const version = devDependencies?.typescript ?? dependencies?.typescript;
|
|
503
786
|
if (typeof version !== "string") {
|
|
@@ -516,8 +799,8 @@ const getTypeScriptUserAgentPair = async () => {
|
|
|
516
799
|
let versionFromNodeModules;
|
|
517
800
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
518
801
|
try {
|
|
519
|
-
const tsPackageJsonPath =
|
|
520
|
-
const packageJson = await
|
|
802
|
+
const tsPackageJsonPath = join(nodeModulesParentDir, TS_PACKAGE_JSON);
|
|
803
|
+
const packageJson = await readFile(tsPackageJsonPath, "utf-8");
|
|
521
804
|
const { version } = JSON.parse(packageJson);
|
|
522
805
|
const sanitizedVersion = getSanitizedTypeScriptVersion(version);
|
|
523
806
|
if (typeof sanitizedVersion !== "string") {
|
|
@@ -559,7 +842,7 @@ const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
|
|
|
559
842
|
const sections = [
|
|
560
843
|
["aws-sdk-js", clientVersion],
|
|
561
844
|
["ua", "2.1"],
|
|
562
|
-
[`os/${
|
|
845
|
+
[`os/${platform()}`, release()],
|
|
563
846
|
["lang/js"],
|
|
564
847
|
runtimeUserAgentPair,
|
|
565
848
|
];
|
|
@@ -574,8 +857,8 @@ const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
|
|
|
574
857
|
if (serviceId) {
|
|
575
858
|
sections.push([`api/${serviceId}`, clientVersion]);
|
|
576
859
|
}
|
|
577
|
-
if (
|
|
578
|
-
sections.push([`exec-env/${
|
|
860
|
+
if (env.AWS_EXECUTION_ENV) {
|
|
861
|
+
sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
|
|
579
862
|
}
|
|
580
863
|
const appId = await config?.userAgentAppId?.();
|
|
581
864
|
const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
|
|
@@ -594,7 +877,7 @@ const NODE_APP_ID_CONFIG_OPTIONS = {
|
|
|
594
877
|
};
|
|
595
878
|
|
|
596
879
|
const createUserAgentStringParsingProvider = ({ serviceId, clientVersion }) => async (config) => {
|
|
597
|
-
const module =
|
|
880
|
+
const module = require('bowser');
|
|
598
881
|
const parse = module.parse ?? module.default.parse ?? (() => "");
|
|
599
882
|
const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent ? parse(window.navigator.userAgent) : undefined;
|
|
600
883
|
const sections = [
|
|
@@ -650,7 +933,7 @@ const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
|
650
933
|
}
|
|
651
934
|
return true;
|
|
652
935
|
}
|
|
653
|
-
if (!
|
|
936
|
+
if (!isValidHostLabel(value)) {
|
|
654
937
|
return false;
|
|
655
938
|
}
|
|
656
939
|
if (value.length < 3 || value.length > 63) {
|
|
@@ -659,7 +942,7 @@ const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
|
659
942
|
if (value !== value.toLowerCase()) {
|
|
660
943
|
return false;
|
|
661
944
|
}
|
|
662
|
-
if (
|
|
945
|
+
if (isIpAddress(value)) {
|
|
663
946
|
return false;
|
|
664
947
|
}
|
|
665
948
|
return true;
|
|
@@ -689,7 +972,7 @@ const awsEndpointFunctions = {
|
|
|
689
972
|
parseArn: parseArn,
|
|
690
973
|
partition: partition,
|
|
691
974
|
};
|
|
692
|
-
|
|
975
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
693
976
|
|
|
694
977
|
const resolveDefaultAwsRegionalEndpointsConfig = (input) => {
|
|
695
978
|
if (typeof input.endpointProvider !== "function") {
|
|
@@ -710,18 +993,18 @@ const resolveDefaultAwsRegionalEndpointsConfig = (input) => {
|
|
|
710
993
|
}
|
|
711
994
|
return input;
|
|
712
995
|
};
|
|
713
|
-
const toEndpointV1 = (endpoint) =>
|
|
996
|
+
const toEndpointV1 = (endpoint) => parseUrl(endpoint.url);
|
|
714
997
|
|
|
715
998
|
function stsRegionDefaultResolver(loaderConfig = {}) {
|
|
716
|
-
return
|
|
717
|
-
...
|
|
999
|
+
return loadConfig({
|
|
1000
|
+
...NODE_REGION_CONFIG_OPTIONS,
|
|
718
1001
|
async default() {
|
|
719
1002
|
if (!warning.silence) {
|
|
720
1003
|
console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");
|
|
721
1004
|
}
|
|
722
1005
|
return "us-east-1";
|
|
723
1006
|
},
|
|
724
|
-
}, { ...
|
|
1007
|
+
}, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig });
|
|
725
1008
|
}
|
|
726
1009
|
const warning = {
|
|
727
1010
|
silence: false,
|
|
@@ -743,14 +1026,6 @@ const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration)
|
|
|
743
1026
|
};
|
|
744
1027
|
};
|
|
745
1028
|
|
|
746
|
-
exports.NODE_REGION_CONFIG_FILE_OPTIONS = config.NODE_REGION_CONFIG_FILE_OPTIONS;
|
|
747
|
-
exports.NODE_REGION_CONFIG_OPTIONS = config.NODE_REGION_CONFIG_OPTIONS;
|
|
748
|
-
exports.REGION_ENV_NAME = config.REGION_ENV_NAME;
|
|
749
|
-
exports.REGION_INI_NAME = config.REGION_INI_NAME;
|
|
750
|
-
exports.resolveRegionConfig = config.resolveRegionConfig;
|
|
751
|
-
exports.EndpointError = endpoints.EndpointError;
|
|
752
|
-
exports.isIpAddress = endpoints.isIpAddress;
|
|
753
|
-
exports.resolveEndpoint = endpoints.resolveEndpoint;
|
|
754
1029
|
exports.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID;
|
|
755
1030
|
exports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS;
|
|
756
1031
|
exports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME;
|