@aws-sdk/region-config-resolver 3.731.0 → 3.775.0
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
CHANGED
|
@@ -19,8 +19,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
|
-
var
|
|
23
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
24
|
NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS,
|
|
25
25
|
NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS,
|
|
26
26
|
REGION_ENV_NAME: () => REGION_ENV_NAME,
|
|
@@ -29,26 +29,16 @@ __export(src_exports, {
|
|
|
29
29
|
resolveAwsRegionExtensionConfiguration: () => resolveAwsRegionExtensionConfiguration,
|
|
30
30
|
resolveRegionConfig: () => resolveRegionConfig
|
|
31
31
|
});
|
|
32
|
-
module.exports = __toCommonJS(
|
|
32
|
+
module.exports = __toCommonJS(index_exports);
|
|
33
33
|
|
|
34
34
|
// src/extensions/index.ts
|
|
35
35
|
var getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
|
|
36
|
-
let runtimeConfigRegion = /* @__PURE__ */ __name(async () => {
|
|
37
|
-
if (runtimeConfig.region === void 0) {
|
|
38
|
-
throw new Error("Region is missing from runtimeConfig");
|
|
39
|
-
}
|
|
40
|
-
const region = runtimeConfig.region;
|
|
41
|
-
if (typeof region === "string") {
|
|
42
|
-
return region;
|
|
43
|
-
}
|
|
44
|
-
return region();
|
|
45
|
-
}, "runtimeConfigRegion");
|
|
46
36
|
return {
|
|
47
37
|
setRegion(region) {
|
|
48
|
-
|
|
38
|
+
runtimeConfig.region = region;
|
|
49
39
|
},
|
|
50
40
|
region() {
|
|
51
|
-
return
|
|
41
|
+
return runtimeConfig.region;
|
|
52
42
|
}
|
|
53
43
|
};
|
|
54
44
|
}, "getAwsRegionExtensionConfiguration");
|
|
@@ -62,11 +52,11 @@ var resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionEx
|
|
|
62
52
|
var REGION_ENV_NAME = "AWS_REGION";
|
|
63
53
|
var REGION_INI_NAME = "region";
|
|
64
54
|
var NODE_REGION_CONFIG_OPTIONS = {
|
|
65
|
-
environmentVariableSelector: (env) => env[REGION_ENV_NAME],
|
|
66
|
-
configFileSelector: (profile) => profile[REGION_INI_NAME],
|
|
67
|
-
default: () => {
|
|
55
|
+
environmentVariableSelector: /* @__PURE__ */ __name((env) => env[REGION_ENV_NAME], "environmentVariableSelector"),
|
|
56
|
+
configFileSelector: /* @__PURE__ */ __name((profile) => profile[REGION_INI_NAME], "configFileSelector"),
|
|
57
|
+
default: /* @__PURE__ */ __name(() => {
|
|
68
58
|
throw new Error("Region is missing");
|
|
69
|
-
}
|
|
59
|
+
}, "default")
|
|
70
60
|
};
|
|
71
61
|
var NODE_REGION_CONFIG_FILE_OPTIONS = {
|
|
72
62
|
preferredFile: "credentials"
|
|
@@ -84,23 +74,22 @@ var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
|
|
|
84
74
|
if (!region) {
|
|
85
75
|
throw new Error("Region is missing");
|
|
86
76
|
}
|
|
87
|
-
return {
|
|
88
|
-
|
|
89
|
-
region: async () => {
|
|
77
|
+
return Object.assign(input, {
|
|
78
|
+
region: /* @__PURE__ */ __name(async () => {
|
|
90
79
|
if (typeof region === "string") {
|
|
91
80
|
return getRealRegion(region);
|
|
92
81
|
}
|
|
93
82
|
const providedRegion = await region();
|
|
94
83
|
return getRealRegion(providedRegion);
|
|
95
|
-
},
|
|
96
|
-
useFipsEndpoint: async () => {
|
|
84
|
+
}, "region"),
|
|
85
|
+
useFipsEndpoint: /* @__PURE__ */ __name(async () => {
|
|
97
86
|
const providedRegion = typeof region === "string" ? region : await region();
|
|
98
87
|
if (isFipsRegion(providedRegion)) {
|
|
99
88
|
return true;
|
|
100
89
|
}
|
|
101
90
|
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
|
|
102
|
-
}
|
|
103
|
-
};
|
|
91
|
+
}, "useFipsEndpoint")
|
|
92
|
+
});
|
|
104
93
|
}, "resolveRegionConfig");
|
|
105
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
106
95
|
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
export const getAwsRegionExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
-
let runtimeConfigRegion = async () => {
|
|
3
|
-
if (runtimeConfig.region === undefined) {
|
|
4
|
-
throw new Error("Region is missing from runtimeConfig");
|
|
5
|
-
}
|
|
6
|
-
const region = runtimeConfig.region;
|
|
7
|
-
if (typeof region === "string") {
|
|
8
|
-
return region;
|
|
9
|
-
}
|
|
10
|
-
return region();
|
|
11
|
-
};
|
|
12
2
|
return {
|
|
13
3
|
setRegion(region) {
|
|
14
|
-
|
|
4
|
+
runtimeConfig.region = region;
|
|
15
5
|
},
|
|
16
6
|
region() {
|
|
17
|
-
return
|
|
7
|
+
return runtimeConfig.region;
|
|
18
8
|
},
|
|
19
9
|
};
|
|
20
10
|
};
|
|
@@ -5,8 +5,7 @@ export const resolveRegionConfig = (input) => {
|
|
|
5
5
|
if (!region) {
|
|
6
6
|
throw new Error("Region is missing");
|
|
7
7
|
}
|
|
8
|
-
return {
|
|
9
|
-
...input,
|
|
8
|
+
return Object.assign(input, {
|
|
10
9
|
region: async () => {
|
|
11
10
|
if (typeof region === "string") {
|
|
12
11
|
return getRealRegion(region);
|
|
@@ -21,5 +20,5 @@ export const resolveRegionConfig = (input) => {
|
|
|
21
20
|
}
|
|
22
21
|
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
|
|
23
22
|
},
|
|
24
|
-
};
|
|
23
|
+
});
|
|
25
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/region-config-resolver",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.775.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline region-config-resolver",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/types": "3.
|
|
26
|
-
"@smithy/node-config-provider": "^4.0.
|
|
27
|
-
"@smithy/types": "^4.
|
|
25
|
+
"@aws-sdk/types": "3.775.0",
|
|
26
|
+
"@smithy/node-config-provider": "^4.0.2",
|
|
27
|
+
"@smithy/types": "^4.2.0",
|
|
28
28
|
"@smithy/util-config-provider": "^4.0.0",
|
|
29
|
-
"@smithy/util-middleware": "^4.0.
|
|
29
|
+
"@smithy/util-middleware": "^4.0.2",
|
|
30
30
|
"tslib": "^2.6.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|