@aws-sdk/util-endpoints 3.489.0 → 3.495.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/aws.js +1 -12
- package/dist-cjs/index.js +422 -8
- package/dist-cjs/lib/aws/index.js +1 -6
- package/dist-cjs/lib/aws/isVirtualHostableS3Bucket.js +1 -29
- package/dist-cjs/lib/aws/parseArn.js +1 -19
- package/dist-cjs/lib/aws/partition.js +1 -49
- package/dist-cjs/lib/isIpAddress.js +1 -5
- package/dist-cjs/resolveEndpoint.js +1 -5
- package/dist-cjs/types/EndpointError.js +1 -5
- package/dist-cjs/types/EndpointRuleObject.js +1 -2
- package/dist-cjs/types/ErrorRuleObject.js +1 -2
- package/dist-cjs/types/RuleSetObject.js +1 -2
- package/dist-cjs/types/TreeRuleObject.js +1 -2
- package/dist-cjs/types/index.js +1 -9
- package/dist-cjs/types/shared.js +1 -2
- package/package.json +5 -5
package/dist-cjs/aws.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const util_endpoints_1 = require("@smithy/util-endpoints");
|
|
4
|
-
const isVirtualHostableS3Bucket_1 = require("./lib/aws/isVirtualHostableS3Bucket");
|
|
5
|
-
const parseArn_1 = require("./lib/aws/parseArn");
|
|
6
|
-
const partition_1 = require("./lib/aws/partition");
|
|
7
|
-
const awsEndpointFunctions = {
|
|
8
|
-
isVirtualHostableS3Bucket: isVirtualHostableS3Bucket_1.isVirtualHostableS3Bucket,
|
|
9
|
-
parseArn: parseArn_1.parseArn,
|
|
10
|
-
partition: partition_1.partition,
|
|
11
|
-
};
|
|
12
|
-
util_endpoints_1.customEndpointFunctions.aws = awsEndpointFunctions;
|
|
1
|
+
module.exports = require("./index.js");
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,8 +1,422 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
ConditionObject: () => import_util_endpoints.ConditionObject,
|
|
24
|
+
DeprecatedObject: () => import_util_endpoints.DeprecatedObject,
|
|
25
|
+
EndpointError: () => import_util_endpoints.EndpointError,
|
|
26
|
+
EndpointObject: () => import_util_endpoints.EndpointObject,
|
|
27
|
+
EndpointObjectHeaders: () => import_util_endpoints.EndpointObjectHeaders,
|
|
28
|
+
EndpointObjectProperties: () => import_util_endpoints.EndpointObjectProperties,
|
|
29
|
+
EndpointParams: () => import_util_endpoints.EndpointParams,
|
|
30
|
+
EndpointResolverOptions: () => import_util_endpoints.EndpointResolverOptions,
|
|
31
|
+
EndpointRuleObject: () => import_util_endpoints.EndpointRuleObject,
|
|
32
|
+
ErrorRuleObject: () => import_util_endpoints.ErrorRuleObject,
|
|
33
|
+
EvaluateOptions: () => import_util_endpoints.EvaluateOptions,
|
|
34
|
+
Expression: () => import_util_endpoints.Expression,
|
|
35
|
+
FunctionArgv: () => import_util_endpoints.FunctionArgv,
|
|
36
|
+
FunctionObject: () => import_util_endpoints.FunctionObject,
|
|
37
|
+
FunctionReturn: () => import_util_endpoints.FunctionReturn,
|
|
38
|
+
ParameterObject: () => import_util_endpoints.ParameterObject,
|
|
39
|
+
ReferenceObject: () => import_util_endpoints.ReferenceObject,
|
|
40
|
+
ReferenceRecord: () => import_util_endpoints.ReferenceRecord,
|
|
41
|
+
RuleSetObject: () => import_util_endpoints.RuleSetObject,
|
|
42
|
+
RuleSetRules: () => import_util_endpoints.RuleSetRules,
|
|
43
|
+
TreeRuleObject: () => import_util_endpoints.TreeRuleObject,
|
|
44
|
+
getUserAgentPrefix: () => getUserAgentPrefix,
|
|
45
|
+
isIpAddress: () => import_util_endpoints.isIpAddress,
|
|
46
|
+
partition: () => partition,
|
|
47
|
+
resolveEndpoint: () => import_util_endpoints.resolveEndpoint,
|
|
48
|
+
setPartitionInfo: () => setPartitionInfo,
|
|
49
|
+
useDefaultPartitionInfo: () => useDefaultPartitionInfo
|
|
50
|
+
});
|
|
51
|
+
module.exports = __toCommonJS(src_exports);
|
|
52
|
+
|
|
53
|
+
// src/aws.ts
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// src/lib/aws/isVirtualHostableS3Bucket.ts
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// src/lib/isIpAddress.ts
|
|
60
|
+
var import_util_endpoints = require("@smithy/util-endpoints");
|
|
61
|
+
|
|
62
|
+
// src/lib/aws/isVirtualHostableS3Bucket.ts
|
|
63
|
+
var isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
|
|
64
|
+
if (allowSubDomains) {
|
|
65
|
+
for (const label of value.split(".")) {
|
|
66
|
+
if (!isVirtualHostableS3Bucket(label)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (!(0, import_util_endpoints.isValidHostLabel)(value)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (value.length < 3 || value.length > 63) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
if (value !== value.toLowerCase()) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if ((0, import_util_endpoints.isIpAddress)(value)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}, "isVirtualHostableS3Bucket");
|
|
86
|
+
|
|
87
|
+
// src/lib/aws/parseArn.ts
|
|
88
|
+
var parseArn = /* @__PURE__ */ __name((value) => {
|
|
89
|
+
const segments = value.split(":");
|
|
90
|
+
if (segments.length < 6)
|
|
91
|
+
return null;
|
|
92
|
+
const [arn, partition2, service, region, accountId, ...resourceId] = segments;
|
|
93
|
+
if (arn !== "arn" || partition2 === "" || service === "" || resourceId[0] === "")
|
|
94
|
+
return null;
|
|
95
|
+
return {
|
|
96
|
+
partition: partition2,
|
|
97
|
+
service,
|
|
98
|
+
region,
|
|
99
|
+
accountId,
|
|
100
|
+
resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId
|
|
101
|
+
};
|
|
102
|
+
}, "parseArn");
|
|
103
|
+
|
|
104
|
+
// src/lib/aws/partitions.json
|
|
105
|
+
var partitions_default = {
|
|
106
|
+
partitions: [{
|
|
107
|
+
id: "aws",
|
|
108
|
+
outputs: {
|
|
109
|
+
dnsSuffix: "amazonaws.com",
|
|
110
|
+
dualStackDnsSuffix: "api.aws",
|
|
111
|
+
implicitGlobalRegion: "us-east-1",
|
|
112
|
+
name: "aws",
|
|
113
|
+
supportsDualStack: true,
|
|
114
|
+
supportsFIPS: true
|
|
115
|
+
},
|
|
116
|
+
regionRegex: "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",
|
|
117
|
+
regions: {
|
|
118
|
+
"af-south-1": {
|
|
119
|
+
description: "Africa (Cape Town)"
|
|
120
|
+
},
|
|
121
|
+
"ap-east-1": {
|
|
122
|
+
description: "Asia Pacific (Hong Kong)"
|
|
123
|
+
},
|
|
124
|
+
"ap-northeast-1": {
|
|
125
|
+
description: "Asia Pacific (Tokyo)"
|
|
126
|
+
},
|
|
127
|
+
"ap-northeast-2": {
|
|
128
|
+
description: "Asia Pacific (Seoul)"
|
|
129
|
+
},
|
|
130
|
+
"ap-northeast-3": {
|
|
131
|
+
description: "Asia Pacific (Osaka)"
|
|
132
|
+
},
|
|
133
|
+
"ap-south-1": {
|
|
134
|
+
description: "Asia Pacific (Mumbai)"
|
|
135
|
+
},
|
|
136
|
+
"ap-south-2": {
|
|
137
|
+
description: "Asia Pacific (Hyderabad)"
|
|
138
|
+
},
|
|
139
|
+
"ap-southeast-1": {
|
|
140
|
+
description: "Asia Pacific (Singapore)"
|
|
141
|
+
},
|
|
142
|
+
"ap-southeast-2": {
|
|
143
|
+
description: "Asia Pacific (Sydney)"
|
|
144
|
+
},
|
|
145
|
+
"ap-southeast-3": {
|
|
146
|
+
description: "Asia Pacific (Jakarta)"
|
|
147
|
+
},
|
|
148
|
+
"ap-southeast-4": {
|
|
149
|
+
description: "Asia Pacific (Melbourne)"
|
|
150
|
+
},
|
|
151
|
+
"aws-global": {
|
|
152
|
+
description: "AWS Standard global region"
|
|
153
|
+
},
|
|
154
|
+
"ca-central-1": {
|
|
155
|
+
description: "Canada (Central)"
|
|
156
|
+
},
|
|
157
|
+
"ca-west-1": {
|
|
158
|
+
description: "Canada West (Calgary)"
|
|
159
|
+
},
|
|
160
|
+
"eu-central-1": {
|
|
161
|
+
description: "Europe (Frankfurt)"
|
|
162
|
+
},
|
|
163
|
+
"eu-central-2": {
|
|
164
|
+
description: "Europe (Zurich)"
|
|
165
|
+
},
|
|
166
|
+
"eu-north-1": {
|
|
167
|
+
description: "Europe (Stockholm)"
|
|
168
|
+
},
|
|
169
|
+
"eu-south-1": {
|
|
170
|
+
description: "Europe (Milan)"
|
|
171
|
+
},
|
|
172
|
+
"eu-south-2": {
|
|
173
|
+
description: "Europe (Spain)"
|
|
174
|
+
},
|
|
175
|
+
"eu-west-1": {
|
|
176
|
+
description: "Europe (Ireland)"
|
|
177
|
+
},
|
|
178
|
+
"eu-west-2": {
|
|
179
|
+
description: "Europe (London)"
|
|
180
|
+
},
|
|
181
|
+
"eu-west-3": {
|
|
182
|
+
description: "Europe (Paris)"
|
|
183
|
+
},
|
|
184
|
+
"il-central-1": {
|
|
185
|
+
description: "Israel (Tel Aviv)"
|
|
186
|
+
},
|
|
187
|
+
"me-central-1": {
|
|
188
|
+
description: "Middle East (UAE)"
|
|
189
|
+
},
|
|
190
|
+
"me-south-1": {
|
|
191
|
+
description: "Middle East (Bahrain)"
|
|
192
|
+
},
|
|
193
|
+
"sa-east-1": {
|
|
194
|
+
description: "South America (Sao Paulo)"
|
|
195
|
+
},
|
|
196
|
+
"us-east-1": {
|
|
197
|
+
description: "US East (N. Virginia)"
|
|
198
|
+
},
|
|
199
|
+
"us-east-2": {
|
|
200
|
+
description: "US East (Ohio)"
|
|
201
|
+
},
|
|
202
|
+
"us-west-1": {
|
|
203
|
+
description: "US West (N. California)"
|
|
204
|
+
},
|
|
205
|
+
"us-west-2": {
|
|
206
|
+
description: "US West (Oregon)"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}, {
|
|
210
|
+
id: "aws-cn",
|
|
211
|
+
outputs: {
|
|
212
|
+
dnsSuffix: "amazonaws.com.cn",
|
|
213
|
+
dualStackDnsSuffix: "api.amazonwebservices.com.cn",
|
|
214
|
+
implicitGlobalRegion: "cn-northwest-1",
|
|
215
|
+
name: "aws-cn",
|
|
216
|
+
supportsDualStack: true,
|
|
217
|
+
supportsFIPS: true
|
|
218
|
+
},
|
|
219
|
+
regionRegex: "^cn\\-\\w+\\-\\d+$",
|
|
220
|
+
regions: {
|
|
221
|
+
"aws-cn-global": {
|
|
222
|
+
description: "AWS China global region"
|
|
223
|
+
},
|
|
224
|
+
"cn-north-1": {
|
|
225
|
+
description: "China (Beijing)"
|
|
226
|
+
},
|
|
227
|
+
"cn-northwest-1": {
|
|
228
|
+
description: "China (Ningxia)"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
id: "aws-us-gov",
|
|
233
|
+
outputs: {
|
|
234
|
+
dnsSuffix: "amazonaws.com",
|
|
235
|
+
dualStackDnsSuffix: "api.aws",
|
|
236
|
+
implicitGlobalRegion: "us-gov-west-1",
|
|
237
|
+
name: "aws-us-gov",
|
|
238
|
+
supportsDualStack: true,
|
|
239
|
+
supportsFIPS: true
|
|
240
|
+
},
|
|
241
|
+
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
|
|
242
|
+
regions: {
|
|
243
|
+
"aws-us-gov-global": {
|
|
244
|
+
description: "AWS GovCloud (US) global region"
|
|
245
|
+
},
|
|
246
|
+
"us-gov-east-1": {
|
|
247
|
+
description: "AWS GovCloud (US-East)"
|
|
248
|
+
},
|
|
249
|
+
"us-gov-west-1": {
|
|
250
|
+
description: "AWS GovCloud (US-West)"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}, {
|
|
254
|
+
id: "aws-iso",
|
|
255
|
+
outputs: {
|
|
256
|
+
dnsSuffix: "c2s.ic.gov",
|
|
257
|
+
dualStackDnsSuffix: "c2s.ic.gov",
|
|
258
|
+
implicitGlobalRegion: "us-iso-east-1",
|
|
259
|
+
name: "aws-iso",
|
|
260
|
+
supportsDualStack: false,
|
|
261
|
+
supportsFIPS: true
|
|
262
|
+
},
|
|
263
|
+
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
|
|
264
|
+
regions: {
|
|
265
|
+
"aws-iso-global": {
|
|
266
|
+
description: "AWS ISO (US) global region"
|
|
267
|
+
},
|
|
268
|
+
"us-iso-east-1": {
|
|
269
|
+
description: "US ISO East"
|
|
270
|
+
},
|
|
271
|
+
"us-iso-west-1": {
|
|
272
|
+
description: "US ISO WEST"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}, {
|
|
276
|
+
id: "aws-iso-b",
|
|
277
|
+
outputs: {
|
|
278
|
+
dnsSuffix: "sc2s.sgov.gov",
|
|
279
|
+
dualStackDnsSuffix: "sc2s.sgov.gov",
|
|
280
|
+
implicitGlobalRegion: "us-isob-east-1",
|
|
281
|
+
name: "aws-iso-b",
|
|
282
|
+
supportsDualStack: false,
|
|
283
|
+
supportsFIPS: true
|
|
284
|
+
},
|
|
285
|
+
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
|
|
286
|
+
regions: {
|
|
287
|
+
"aws-iso-b-global": {
|
|
288
|
+
description: "AWS ISOB (US) global region"
|
|
289
|
+
},
|
|
290
|
+
"us-isob-east-1": {
|
|
291
|
+
description: "US ISOB East (Ohio)"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
id: "aws-iso-e",
|
|
296
|
+
outputs: {
|
|
297
|
+
dnsSuffix: "cloud.adc-e.uk",
|
|
298
|
+
dualStackDnsSuffix: "cloud.adc-e.uk",
|
|
299
|
+
implicitGlobalRegion: "eu-isoe-west-1",
|
|
300
|
+
name: "aws-iso-e",
|
|
301
|
+
supportsDualStack: false,
|
|
302
|
+
supportsFIPS: true
|
|
303
|
+
},
|
|
304
|
+
regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
|
|
305
|
+
regions: {}
|
|
306
|
+
}, {
|
|
307
|
+
id: "aws-iso-f",
|
|
308
|
+
outputs: {
|
|
309
|
+
dnsSuffix: "csp.hci.ic.gov",
|
|
310
|
+
dualStackDnsSuffix: "csp.hci.ic.gov",
|
|
311
|
+
implicitGlobalRegion: "us-isof-south-1",
|
|
312
|
+
name: "aws-iso-f",
|
|
313
|
+
supportsDualStack: false,
|
|
314
|
+
supportsFIPS: true
|
|
315
|
+
},
|
|
316
|
+
regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
|
|
317
|
+
regions: {}
|
|
318
|
+
}],
|
|
319
|
+
version: "1.1"
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// src/lib/aws/partition.ts
|
|
323
|
+
var selectedPartitionsInfo = partitions_default;
|
|
324
|
+
var selectedUserAgentPrefix = "";
|
|
325
|
+
var partition = /* @__PURE__ */ __name((value) => {
|
|
326
|
+
const { partitions } = selectedPartitionsInfo;
|
|
327
|
+
for (const partition2 of partitions) {
|
|
328
|
+
const { regions, outputs } = partition2;
|
|
329
|
+
for (const [region, regionData] of Object.entries(regions)) {
|
|
330
|
+
if (region === value) {
|
|
331
|
+
return {
|
|
332
|
+
...outputs,
|
|
333
|
+
...regionData
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
for (const partition2 of partitions) {
|
|
339
|
+
const { regionRegex, outputs } = partition2;
|
|
340
|
+
if (new RegExp(regionRegex).test(value)) {
|
|
341
|
+
return {
|
|
342
|
+
...outputs
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
|
|
347
|
+
if (!DEFAULT_PARTITION) {
|
|
348
|
+
throw new Error(
|
|
349
|
+
"Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
...DEFAULT_PARTITION.outputs
|
|
354
|
+
};
|
|
355
|
+
}, "partition");
|
|
356
|
+
var setPartitionInfo = /* @__PURE__ */ __name((partitionsInfo, userAgentPrefix = "") => {
|
|
357
|
+
selectedPartitionsInfo = partitionsInfo;
|
|
358
|
+
selectedUserAgentPrefix = userAgentPrefix;
|
|
359
|
+
}, "setPartitionInfo");
|
|
360
|
+
var useDefaultPartitionInfo = /* @__PURE__ */ __name(() => {
|
|
361
|
+
setPartitionInfo(partitions_default, "");
|
|
362
|
+
}, "useDefaultPartitionInfo");
|
|
363
|
+
var getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix");
|
|
364
|
+
|
|
365
|
+
// src/aws.ts
|
|
366
|
+
var awsEndpointFunctions = {
|
|
367
|
+
isVirtualHostableS3Bucket,
|
|
368
|
+
parseArn,
|
|
369
|
+
partition
|
|
370
|
+
};
|
|
371
|
+
import_util_endpoints.customEndpointFunctions.aws = awsEndpointFunctions;
|
|
372
|
+
|
|
373
|
+
// src/resolveEndpoint.ts
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
// src/types/EndpointError.ts
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
// src/types/EndpointRuleObject.ts
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
// src/types/ErrorRuleObject.ts
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
// src/types/RuleSetObject.ts
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
// src/types/TreeRuleObject.ts
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
// src/types/shared.ts
|
|
392
|
+
|
|
393
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
394
|
+
0 && (module.exports = {
|
|
395
|
+
ConditionObject,
|
|
396
|
+
DeprecatedObject,
|
|
397
|
+
EndpointError,
|
|
398
|
+
EndpointObject,
|
|
399
|
+
EndpointObjectHeaders,
|
|
400
|
+
EndpointObjectProperties,
|
|
401
|
+
EndpointParams,
|
|
402
|
+
EndpointResolverOptions,
|
|
403
|
+
EndpointRuleObject,
|
|
404
|
+
ErrorRuleObject,
|
|
405
|
+
EvaluateOptions,
|
|
406
|
+
Expression,
|
|
407
|
+
FunctionArgv,
|
|
408
|
+
FunctionObject,
|
|
409
|
+
FunctionReturn,
|
|
410
|
+
ParameterObject,
|
|
411
|
+
ReferenceObject,
|
|
412
|
+
ReferenceRecord,
|
|
413
|
+
RuleSetObject,
|
|
414
|
+
RuleSetRules,
|
|
415
|
+
TreeRuleObject,
|
|
416
|
+
getUserAgentPrefix,
|
|
417
|
+
isIpAddress,
|
|
418
|
+
partition,
|
|
419
|
+
resolveEndpoint,
|
|
420
|
+
setPartitionInfo,
|
|
421
|
+
useDefaultPartitionInfo
|
|
422
|
+
});
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./isVirtualHostableS3Bucket"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./parseArn"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./partition"), exports);
|
|
1
|
+
module.exports = require("../../index.js");
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isVirtualHostableS3Bucket = void 0;
|
|
4
|
-
const util_endpoints_1 = require("@smithy/util-endpoints");
|
|
5
|
-
const isIpAddress_1 = require("../isIpAddress");
|
|
6
|
-
const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
7
|
-
if (allowSubDomains) {
|
|
8
|
-
for (const label of value.split(".")) {
|
|
9
|
-
if (!(0, exports.isVirtualHostableS3Bucket)(label)) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
if (!(0, util_endpoints_1.isValidHostLabel)(value)) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
if (value.length < 3 || value.length > 63) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (value !== value.toLowerCase()) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if ((0, isIpAddress_1.isIpAddress)(value)) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
};
|
|
29
|
-
exports.isVirtualHostableS3Bucket = isVirtualHostableS3Bucket;
|
|
1
|
+
module.exports = require("../../index.js");
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseArn = void 0;
|
|
4
|
-
const parseArn = (value) => {
|
|
5
|
-
const segments = value.split(":");
|
|
6
|
-
if (segments.length < 6)
|
|
7
|
-
return null;
|
|
8
|
-
const [arn, partition, service, region, accountId, ...resourceId] = segments;
|
|
9
|
-
if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "")
|
|
10
|
-
return null;
|
|
11
|
-
return {
|
|
12
|
-
partition,
|
|
13
|
-
service,
|
|
14
|
-
region,
|
|
15
|
-
accountId,
|
|
16
|
-
resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId,
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
exports.parseArn = parseArn;
|
|
1
|
+
module.exports = require("../../index.js");
|
|
@@ -1,49 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserAgentPrefix = exports.useDefaultPartitionInfo = exports.setPartitionInfo = exports.partition = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const partitions_json_1 = tslib_1.__importDefault(require("./partitions.json"));
|
|
6
|
-
let selectedPartitionsInfo = partitions_json_1.default;
|
|
7
|
-
let selectedUserAgentPrefix = "";
|
|
8
|
-
const partition = (value) => {
|
|
9
|
-
const { partitions } = selectedPartitionsInfo;
|
|
10
|
-
for (const partition of partitions) {
|
|
11
|
-
const { regions, outputs } = partition;
|
|
12
|
-
for (const [region, regionData] of Object.entries(regions)) {
|
|
13
|
-
if (region === value) {
|
|
14
|
-
return {
|
|
15
|
-
...outputs,
|
|
16
|
-
...regionData,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
for (const partition of partitions) {
|
|
22
|
-
const { regionRegex, outputs } = partition;
|
|
23
|
-
if (new RegExp(regionRegex).test(value)) {
|
|
24
|
-
return {
|
|
25
|
-
...outputs,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws");
|
|
30
|
-
if (!DEFAULT_PARTITION) {
|
|
31
|
-
throw new Error("Provided region was not found in the partition array or regex," +
|
|
32
|
-
" and default partition with id 'aws' doesn't exist.");
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
...DEFAULT_PARTITION.outputs,
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
exports.partition = partition;
|
|
39
|
-
const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => {
|
|
40
|
-
selectedPartitionsInfo = partitionsInfo;
|
|
41
|
-
selectedUserAgentPrefix = userAgentPrefix;
|
|
42
|
-
};
|
|
43
|
-
exports.setPartitionInfo = setPartitionInfo;
|
|
44
|
-
const useDefaultPartitionInfo = () => {
|
|
45
|
-
(0, exports.setPartitionInfo)(partitions_json_1.default, "");
|
|
46
|
-
};
|
|
47
|
-
exports.useDefaultPartitionInfo = useDefaultPartitionInfo;
|
|
48
|
-
const getUserAgentPrefix = () => selectedUserAgentPrefix;
|
|
49
|
-
exports.getUserAgentPrefix = getUserAgentPrefix;
|
|
1
|
+
module.exports = require("../../index.js");
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isIpAddress = void 0;
|
|
4
|
-
var util_endpoints_1 = require("@smithy/util-endpoints");
|
|
5
|
-
Object.defineProperty(exports, "isIpAddress", { enumerable: true, get: function () { return util_endpoints_1.isIpAddress; } });
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveEndpoint = void 0;
|
|
4
|
-
var util_endpoints_1 = require("@smithy/util-endpoints");
|
|
5
|
-
Object.defineProperty(exports, "resolveEndpoint", { enumerable: true, get: function () { return util_endpoints_1.resolveEndpoint; } });
|
|
1
|
+
module.exports = require("./index.js");
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EndpointError = void 0;
|
|
4
|
-
var util_endpoints_1 = require("@smithy/util-endpoints");
|
|
5
|
-
Object.defineProperty(exports, "EndpointError", { enumerable: true, get: function () { return util_endpoints_1.EndpointError; } });
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
module.exports = require("../index.js");
|
package/dist-cjs/types/index.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./EndpointError"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./EndpointRuleObject"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./ErrorRuleObject"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./RuleSetObject"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./TreeRuleObject"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./shared"), exports);
|
|
1
|
+
module.exports = require("../index.js");
|
package/dist-cjs/types/shared.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
module.exports = require("../index.js");
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-endpoints",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.495.0",
|
|
4
4
|
"description": "Utilities to help with endpoint resolution",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"types": "./dist-types/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
10
|
-
"build:cjs": "
|
|
10
|
+
"build:cjs": "node ../../scripts/compilation/inline util-endpoints",
|
|
11
11
|
"build:es": "tsc -p tsconfig.es.json",
|
|
12
12
|
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
|
|
13
13
|
"build:types": "tsc -p tsconfig.types.json",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/types": "3.
|
|
26
|
-
"@smithy/types": "^2.
|
|
27
|
-
"@smithy/util-endpoints": "^1.0
|
|
25
|
+
"@aws-sdk/types": "3.495.0",
|
|
26
|
+
"@smithy/types": "^2.9.0",
|
|
27
|
+
"@smithy/util-endpoints": "^1.1.0",
|
|
28
28
|
"tslib": "^2.5.0"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|