@aws-sdk/core 3.620.0 → 3.621.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/account-id-endpoint.js +6 -0
- package/dist-cjs/submodules/account-id-endpoint/index.js +97 -0
- package/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.js +15 -0
- package/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConstants.js +5 -0
- package/dist-es/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.js +24 -0
- package/dist-es/submodules/account-id-endpoint/index.js +3 -0
- package/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +30 -0
- package/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +7 -0
- package/dist-types/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +14 -0
- package/dist-types/submodules/account-id-endpoint/index.d.ts +3 -0
- package/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +15 -0
- package/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +6 -0
- package/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +7 -0
- package/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +3 -0
- package/package.json +16 -6
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/submodules/account-id-endpoint/index.ts
|
|
22
|
+
var account_id_endpoint_exports = {};
|
|
23
|
+
__export(account_id_endpoint_exports, {
|
|
24
|
+
ACCOUNT_ID_ENDPOINT_MODE_VALUES: () => ACCOUNT_ID_ENDPOINT_MODE_VALUES,
|
|
25
|
+
CONFIG_ACCOUNT_ID_ENDPOINT_MODE: () => CONFIG_ACCOUNT_ID_ENDPOINT_MODE,
|
|
26
|
+
DEFAULT_ACCOUNT_ID_ENDPOINT_MODE: () => DEFAULT_ACCOUNT_ID_ENDPOINT_MODE,
|
|
27
|
+
ENV_ACCOUNT_ID_ENDPOINT_MODE: () => ENV_ACCOUNT_ID_ENDPOINT_MODE,
|
|
28
|
+
NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS: () => NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS,
|
|
29
|
+
resolveAccountIdEndpointModeConfig: () => resolveAccountIdEndpointModeConfig,
|
|
30
|
+
validateAccountIdEndpointMode: () => validateAccountIdEndpointMode
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(account_id_endpoint_exports);
|
|
33
|
+
|
|
34
|
+
// src/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.ts
|
|
35
|
+
var import_util_middleware = require("@smithy/util-middleware");
|
|
36
|
+
|
|
37
|
+
// src/submodules/account-id-endpoint/AccountIdEndpointModeConstants.ts
|
|
38
|
+
var DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
|
|
39
|
+
var ACCOUNT_ID_ENDPOINT_MODE_VALUES = ["disabled", "preferred", "required"];
|
|
40
|
+
function validateAccountIdEndpointMode(value) {
|
|
41
|
+
return ACCOUNT_ID_ENDPOINT_MODE_VALUES.includes(value);
|
|
42
|
+
}
|
|
43
|
+
__name(validateAccountIdEndpointMode, "validateAccountIdEndpointMode");
|
|
44
|
+
|
|
45
|
+
// src/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.ts
|
|
46
|
+
var resolveAccountIdEndpointModeConfig = /* @__PURE__ */ __name((input) => {
|
|
47
|
+
return {
|
|
48
|
+
...input,
|
|
49
|
+
accountIdEndpointMode: async () => {
|
|
50
|
+
const accountIdEndpointModeProvider = (0, import_util_middleware.normalizeProvider)(
|
|
51
|
+
input.accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE
|
|
52
|
+
);
|
|
53
|
+
const accIdMode = await accountIdEndpointModeProvider();
|
|
54
|
+
if (!validateAccountIdEndpointMode(accIdMode)) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`Invalid value for accountIdEndpointMode: ${accIdMode}. Valid values are: "required", "preferred", "disabled".`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return accIdMode;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, "resolveAccountIdEndpointModeConfig");
|
|
63
|
+
|
|
64
|
+
// src/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.ts
|
|
65
|
+
var err = "Invalid AccountIdEndpointMode value";
|
|
66
|
+
var _throw = /* @__PURE__ */ __name((message) => {
|
|
67
|
+
throw new Error(message);
|
|
68
|
+
}, "_throw");
|
|
69
|
+
var ENV_ACCOUNT_ID_ENDPOINT_MODE = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
|
|
70
|
+
var CONFIG_ACCOUNT_ID_ENDPOINT_MODE = "account_id_endpoint_mode";
|
|
71
|
+
var NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS = {
|
|
72
|
+
environmentVariableSelector: (env) => {
|
|
73
|
+
const value = env[ENV_ACCOUNT_ID_ENDPOINT_MODE];
|
|
74
|
+
if (value && !validateAccountIdEndpointMode(value)) {
|
|
75
|
+
_throw(err);
|
|
76
|
+
}
|
|
77
|
+
return value;
|
|
78
|
+
},
|
|
79
|
+
configFileSelector: (profile) => {
|
|
80
|
+
const value = profile[CONFIG_ACCOUNT_ID_ENDPOINT_MODE];
|
|
81
|
+
if (value && !validateAccountIdEndpointMode(value)) {
|
|
82
|
+
_throw(err);
|
|
83
|
+
}
|
|
84
|
+
return value;
|
|
85
|
+
},
|
|
86
|
+
default: DEFAULT_ACCOUNT_ID_ENDPOINT_MODE
|
|
87
|
+
};
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
ACCOUNT_ID_ENDPOINT_MODE_VALUES,
|
|
91
|
+
CONFIG_ACCOUNT_ID_ENDPOINT_MODE,
|
|
92
|
+
DEFAULT_ACCOUNT_ID_ENDPOINT_MODE,
|
|
93
|
+
ENV_ACCOUNT_ID_ENDPOINT_MODE,
|
|
94
|
+
NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS,
|
|
95
|
+
resolveAccountIdEndpointModeConfig,
|
|
96
|
+
validateAccountIdEndpointMode
|
|
97
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { normalizeProvider } from "@smithy/util-middleware";
|
|
2
|
+
import { DEFAULT_ACCOUNT_ID_ENDPOINT_MODE, validateAccountIdEndpointMode, } from "./AccountIdEndpointModeConstants";
|
|
3
|
+
export const resolveAccountIdEndpointModeConfig = (input) => {
|
|
4
|
+
return {
|
|
5
|
+
...input,
|
|
6
|
+
accountIdEndpointMode: async () => {
|
|
7
|
+
const accountIdEndpointModeProvider = normalizeProvider(input.accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE);
|
|
8
|
+
const accIdMode = await accountIdEndpointModeProvider();
|
|
9
|
+
if (!validateAccountIdEndpointMode(accIdMode)) {
|
|
10
|
+
throw new Error(`Invalid value for accountIdEndpointMode: ${accIdMode}. Valid values are: "required", "preferred", "disabled".`);
|
|
11
|
+
}
|
|
12
|
+
return accIdMode;
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DEFAULT_ACCOUNT_ID_ENDPOINT_MODE, validateAccountIdEndpointMode, } from "./AccountIdEndpointModeConstants";
|
|
2
|
+
const err = "Invalid AccountIdEndpointMode value";
|
|
3
|
+
const _throw = (message) => {
|
|
4
|
+
throw new Error(message);
|
|
5
|
+
};
|
|
6
|
+
export const ENV_ACCOUNT_ID_ENDPOINT_MODE = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
|
|
7
|
+
export const CONFIG_ACCOUNT_ID_ENDPOINT_MODE = "account_id_endpoint_mode";
|
|
8
|
+
export const NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS = {
|
|
9
|
+
environmentVariableSelector: (env) => {
|
|
10
|
+
const value = env[ENV_ACCOUNT_ID_ENDPOINT_MODE];
|
|
11
|
+
if (value && !validateAccountIdEndpointMode(value)) {
|
|
12
|
+
_throw(err);
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
},
|
|
16
|
+
configFileSelector: (profile) => {
|
|
17
|
+
const value = profile[CONFIG_ACCOUNT_ID_ENDPOINT_MODE];
|
|
18
|
+
if (value && !validateAccountIdEndpointMode(value)) {
|
|
19
|
+
_throw(err);
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
},
|
|
23
|
+
default: DEFAULT_ACCOUNT_ID_ENDPOINT_MODE,
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Provider } from "@smithy/types";
|
|
2
|
+
import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface AccountIdEndpointModeInputConfig {
|
|
7
|
+
/**
|
|
8
|
+
* The account ID endpoint mode to use.
|
|
9
|
+
*/
|
|
10
|
+
accountIdEndpointMode?: AccountIdEndpointMode | Provider<AccountIdEndpointMode>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
interface PreviouslyResolved {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface AccountIdEndpointModeResolvedConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Resolved value for input config {config.accountIdEndpointMode}
|
|
23
|
+
*/
|
|
24
|
+
accountIdEndpointMode: Provider<AccountIdEndpointMode>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const resolveAccountIdEndpointModeConfig: <T>(input: T & AccountIdEndpointModeInputConfig & PreviouslyResolved) => T & AccountIdEndpointModeResolvedConfig;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type AccountIdEndpointMode = "disabled" | "preferred" | "required";
|
|
2
|
+
export declare const DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
|
|
3
|
+
export declare const ACCOUNT_ID_ENDPOINT_MODE_VALUES: AccountIdEndpointMode[];
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateAccountIdEndpointMode(value: any): value is AccountIdEndpointMode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LoadedConfigSelectors } from "@smithy/node-config-provider";
|
|
2
|
+
import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const ENV_ACCOUNT_ID_ENDPOINT_MODE = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const CONFIG_ACCOUNT_ID_ENDPOINT_MODE = "account_id_endpoint_mode";
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<AccountIdEndpointMode>;
|
package/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Provider } from "@smithy/types";
|
|
2
|
+
import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
|
|
3
|
+
export interface AccountIdEndpointModeInputConfig {
|
|
4
|
+
accountIdEndpointMode?:
|
|
5
|
+
| AccountIdEndpointMode
|
|
6
|
+
| Provider<AccountIdEndpointMode>;
|
|
7
|
+
}
|
|
8
|
+
interface PreviouslyResolved {}
|
|
9
|
+
export interface AccountIdEndpointModeResolvedConfig {
|
|
10
|
+
accountIdEndpointMode: Provider<AccountIdEndpointMode>;
|
|
11
|
+
}
|
|
12
|
+
export declare const resolveAccountIdEndpointModeConfig: <T>(
|
|
13
|
+
input: T & AccountIdEndpointModeInputConfig & PreviouslyResolved
|
|
14
|
+
) => T & AccountIdEndpointModeResolvedConfig;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type AccountIdEndpointMode = "disabled" | "preferred" | "required";
|
|
2
|
+
export declare const DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
|
|
3
|
+
export declare const ACCOUNT_ID_ENDPOINT_MODE_VALUES: AccountIdEndpointMode[];
|
|
4
|
+
export declare function validateAccountIdEndpointMode(
|
|
5
|
+
value: any
|
|
6
|
+
): value is AccountIdEndpointMode;
|
package/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LoadedConfigSelectors } from "@smithy/node-config-provider";
|
|
2
|
+
import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
|
|
3
|
+
export declare const ENV_ACCOUNT_ID_ENDPOINT_MODE =
|
|
4
|
+
"AWS_ACCOUNT_ID_ENDPOINT_MODE";
|
|
5
|
+
export declare const CONFIG_ACCOUNT_ID_ENDPOINT_MODE =
|
|
6
|
+
"account_id_endpoint_mode";
|
|
7
|
+
export declare const NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<AccountIdEndpointMode>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.621.0",
|
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
@@ -46,6 +46,13 @@
|
|
|
46
46
|
"require": "./dist-cjs/submodules/httpAuthSchemes/index.js",
|
|
47
47
|
"types": "./dist-types/submodules/httpAuthSchemes/index.d.ts"
|
|
48
48
|
},
|
|
49
|
+
"./account-id-endpoint": {
|
|
50
|
+
"module": "./dist-es/submodules/account-id-endpoint/index.js",
|
|
51
|
+
"node": "./dist-cjs/submodules/account-id-endpoint/index.js",
|
|
52
|
+
"import": "./dist-es/submodules/account-id-endpoint/index.js",
|
|
53
|
+
"require": "./dist-cjs/submodules/account-id-endpoint/index.js",
|
|
54
|
+
"types": "./dist-types/submodules/account-id-endpoint/index.d.ts"
|
|
55
|
+
},
|
|
49
56
|
"./protocols": {
|
|
50
57
|
"module": "./dist-es/submodules/protocols/index.js",
|
|
51
58
|
"node": "./dist-cjs/submodules/protocols/index.js",
|
|
@@ -58,7 +65,8 @@
|
|
|
58
65
|
"dist-*/**",
|
|
59
66
|
"./client.js",
|
|
60
67
|
"./httpAuthSchemes.js",
|
|
61
|
-
"./protocols.js"
|
|
68
|
+
"./protocols.js",
|
|
69
|
+
"./account-id-endpoint.js"
|
|
62
70
|
],
|
|
63
71
|
"sideEffects": false,
|
|
64
72
|
"author": {
|
|
@@ -67,12 +75,14 @@
|
|
|
67
75
|
},
|
|
68
76
|
"license": "Apache-2.0",
|
|
69
77
|
"dependencies": {
|
|
70
|
-
"@smithy/core": "^2.3.
|
|
78
|
+
"@smithy/core": "^2.3.1",
|
|
79
|
+
"@smithy/node-config-provider": "^3.1.4",
|
|
71
80
|
"@smithy/protocol-http": "^4.1.0",
|
|
72
81
|
"@smithy/signature-v4": "^4.1.0",
|
|
73
|
-
"@smithy/smithy-client": "^3.1.
|
|
82
|
+
"@smithy/smithy-client": "^3.1.11",
|
|
74
83
|
"@smithy/types": "^3.3.0",
|
|
75
|
-
"
|
|
84
|
+
"@smithy/util-middleware": "^3.0.3",
|
|
85
|
+
"fast-xml-parser": "4.4.1",
|
|
76
86
|
"tslib": "^2.6.2"
|
|
77
87
|
},
|
|
78
88
|
"devDependencies": {
|
|
@@ -92,7 +102,7 @@
|
|
|
92
102
|
]
|
|
93
103
|
}
|
|
94
104
|
},
|
|
95
|
-
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/
|
|
105
|
+
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/core",
|
|
96
106
|
"repository": {
|
|
97
107
|
"type": "git",
|
|
98
108
|
"url": "https://github.com/aws/aws-sdk-js-v3.git",
|