@aws-sdk/nested-clients 3.996.0 → 3.996.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.
- package/cognito-identity.d.ts +7 -0
- package/cognito-identity.js +5 -0
- package/dist-cjs/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +60 -0
- package/dist-cjs/submodules/cognito-identity/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/cognito-identity/endpoint/ruleset.js +146 -0
- package/dist-cjs/submodules/cognito-identity/index.js +174 -0
- package/dist-cjs/submodules/cognito-identity/models/CognitoIdentityServiceException.js +12 -0
- package/dist-cjs/submodules/cognito-identity/models/errors.js +121 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.browser.js +38 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.js +53 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.shared.js +50 -0
- package/dist-cjs/submodules/cognito-identity/schemas/schemas_0.js +110 -0
- package/dist-cjs/submodules/signin/endpoint/ruleset.js +128 -2
- package/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js +56 -0
- package/dist-cjs/submodules/sso/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/sso/endpoint/ruleset.js +106 -0
- package/dist-cjs/submodules/sso/index.js +160 -0
- package/dist-cjs/submodules/sso/models/SSOServiceException.js +12 -0
- package/dist-cjs/submodules/sso/models/errors.js +56 -0
- package/dist-cjs/submodules/sso/runtimeConfig.browser.js +38 -0
- package/dist-cjs/submodules/sso/runtimeConfig.js +53 -0
- package/dist-cjs/submodules/sso/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/sso/runtimeConfig.shared.js +49 -0
- package/dist-cjs/submodules/sso/schemas/schemas_0.js +90 -0
- package/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js +101 -2
- package/dist-cjs/submodules/sts/endpoint/ruleset.js +140 -2
- package/dist-es/submodules/cognito-identity/CognitoIdentity.js +11 -0
- package/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +50 -0
- package/dist-es/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +54 -0
- package/dist-es/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.js +16 -0
- package/dist-es/submodules/cognito-identity/commands/GetIdCommand.js +16 -0
- package/dist-es/submodules/cognito-identity/commands/index.js +2 -0
- package/dist-es/submodules/cognito-identity/endpoint/EndpointParameters.js +13 -0
- package/dist-es/submodules/cognito-identity/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/cognito-identity/endpoint/ruleset.js +143 -0
- package/dist-es/submodules/cognito-identity/extensionConfiguration.js +1 -0
- package/dist-es/submodules/cognito-identity/index.js +7 -0
- package/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +8 -0
- package/dist-es/submodules/cognito-identity/models/errors.js +109 -0
- package/dist-es/submodules/cognito-identity/models/models_0.js +1 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +33 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.js +48 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.shared.js +46 -0
- package/dist-es/submodules/cognito-identity/runtimeExtensions.js +9 -0
- package/dist-es/submodules/cognito-identity/schemas/schemas_0.js +107 -0
- package/dist-es/submodules/signin/Signin.js +1 -1
- package/dist-es/submodules/signin/endpoint/ruleset.js +128 -2
- package/dist-es/submodules/sso/SSO.js +9 -0
- package/dist-es/submodules/sso/SSOClient.js +50 -0
- package/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js +50 -0
- package/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js +16 -0
- package/dist-es/submodules/sso/commands/index.js +1 -0
- package/dist-es/submodules/sso/endpoint/EndpointParameters.js +13 -0
- package/dist-es/submodules/sso/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/sso/endpoint/ruleset.js +103 -0
- package/dist-es/submodules/sso/extensionConfiguration.js +1 -0
- package/dist-es/submodules/sso/index.js +7 -0
- package/dist-es/submodules/sso/models/SSOServiceException.js +8 -0
- package/dist-es/submodules/sso/models/errors.js +49 -0
- package/dist-es/submodules/sso/models/models_0.js +1 -0
- package/dist-es/submodules/sso/runtimeConfig.browser.js +33 -0
- package/dist-es/submodules/sso/runtimeConfig.js +48 -0
- package/dist-es/submodules/sso/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/sso/runtimeConfig.shared.js +45 -0
- package/dist-es/submodules/sso/runtimeExtensions.js +9 -0
- package/dist-es/submodules/sso/schemas/schemas_0.js +87 -0
- package/dist-es/submodules/sso-oidc/endpoint/ruleset.js +101 -2
- package/dist-es/submodules/sts/defaultStsRoleAssumers.js +1 -1
- package/dist-es/submodules/sts/endpoint/ruleset.js +140 -2
- package/dist-types/submodules/cognito-identity/CognitoIdentity.d.ts +38 -0
- package/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +198 -0
- package/dist-types/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.d.ts +30 -0
- package/dist-types/submodules/cognito-identity/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +120 -0
- package/dist-types/submodules/cognito-identity/commands/GetIdCommand.d.ts +107 -0
- package/dist-types/submodules/cognito-identity/commands/index.d.ts +2 -0
- package/dist-types/submodules/cognito-identity/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/submodules/cognito-identity/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/submodules/cognito-identity/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/cognito-identity/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/cognito-identity/index.d.ts +29 -0
- package/dist-types/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +14 -0
- package/dist-types/submodules/cognito-identity/models/errors.d.ts +119 -0
- package/dist-types/submodules/cognito-identity/models/models_0.d.ts +136 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +62 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +62 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +61 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +38 -0
- package/dist-types/submodules/cognito-identity/runtimeExtensions.d.ts +17 -0
- package/dist-types/submodules/cognito-identity/schemas/schemas_0.d.ts +25 -0
- package/dist-types/submodules/signin/Signin.d.ts +1 -1
- package/dist-types/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +2 -1
- package/dist-types/submodules/signin/endpoint/ruleset.d.ts +1 -1
- package/dist-types/submodules/signin/models/errors.d.ts +1 -1
- package/dist-types/submodules/sso/SSO.d.ts +32 -0
- package/dist-types/submodules/sso/SSOClient.d.ts +198 -0
- package/dist-types/submodules/sso/auth/httpAuthExtensionConfiguration.d.ts +30 -0
- package/dist-types/submodules/sso/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +97 -0
- package/dist-types/submodules/sso/commands/index.d.ts +1 -0
- package/dist-types/submodules/sso/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/submodules/sso/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/submodules/sso/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/sso/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/sso/index.d.ts +30 -0
- package/dist-types/submodules/sso/models/SSOServiceException.d.ts +14 -0
- package/dist-types/submodules/sso/models/errors.d.ts +53 -0
- package/dist-types/submodules/sso/models/models_0.d.ts +61 -0
- package/dist-types/submodules/sso/runtimeConfig.browser.d.ts +62 -0
- package/dist-types/submodules/sso/runtimeConfig.d.ts +62 -0
- package/dist-types/submodules/sso/runtimeConfig.native.d.ts +61 -0
- package/dist-types/submodules/sso/runtimeConfig.shared.d.ts +38 -0
- package/dist-types/submodules/sso/runtimeExtensions.d.ts +17 -0
- package/dist-types/submodules/sso/schemas/schemas_0.d.ts +17 -0
- package/dist-types/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +2 -1
- package/dist-types/submodules/sso-oidc/endpoint/ruleset.d.ts +1 -1
- package/dist-types/submodules/sso-oidc/models/errors.d.ts +1 -1
- package/dist-types/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +2 -1
- package/dist-types/submodules/sts/defaultRoleAssumers.d.ts +3 -3
- package/dist-types/submodules/sts/defaultStsRoleAssumers.d.ts +3 -3
- package/dist-types/submodules/sts/endpoint/ruleset.d.ts +1 -1
- package/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentity.d.ts +38 -0
- package/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentityClient.d.ts +126 -0
- package/dist-types/ts3.4/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/cognito-identity/auth/httpAuthSchemeProvider.d.ts +47 -0
- package/dist-types/ts3.4/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +51 -0
- package/dist-types/ts3.4/submodules/cognito-identity/commands/GetIdCommand.d.ts +41 -0
- package/dist-types/ts3.4/submodules/cognito-identity/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/submodules/cognito-identity/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/submodules/cognito-identity/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/cognito-identity/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/cognito-identity/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/cognito-identity/index.d.ts +10 -0
- package/dist-types/ts3.4/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/cognito-identity/models/errors.d.ts +68 -0
- package/dist-types/ts3.4/submodules/cognito-identity/models/models_0.d.ts +23 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +122 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +117 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +126 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +60 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeExtensions.d.ts +13 -0
- package/dist-types/ts3.4/submodules/cognito-identity/schemas/schemas_0.d.ts +24 -0
- package/dist-types/ts3.4/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/dist-types/ts3.4/submodules/sso/SSO.d.ts +22 -0
- package/dist-types/ts3.4/submodules/sso/SSOClient.d.ts +117 -0
- package/dist-types/ts3.4/submodules/sso/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/sso/auth/httpAuthSchemeProvider.d.ts +46 -0
- package/dist-types/ts3.4/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +47 -0
- package/dist-types/ts3.4/submodules/sso/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/sso/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/submodules/sso/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/sso/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/sso/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sso/index.d.ts +10 -0
- package/dist-types/ts3.4/submodules/sso/models/SSOServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sso/models/errors.d.ts +30 -0
- package/dist-types/ts3.4/submodules/sso/models/models_0.d.ts +14 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +120 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +115 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +124 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +58 -0
- package/dist-types/ts3.4/submodules/sso/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/submodules/sso/schemas/schemas_0.d.ts +16 -0
- package/dist-types/ts3.4/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/dist-types/ts3.4/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/package.json +54 -36
- package/sso.d.ts +7 -0
- package/sso.js +5 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit:
|
|
3
|
+
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
|
+
*/
|
|
5
|
+
declare module "@aws-sdk/nested-clients/cognito-identity" {
|
|
6
|
+
export * from "@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/index.d";
|
|
7
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveHttpAuthSchemeConfig = exports.defaultCognitoIdentityHttpAuthSchemeProvider = exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = void 0;
|
|
4
|
+
const core_1 = require("@aws-sdk/core");
|
|
5
|
+
const util_middleware_1 = require("@smithy/util-middleware");
|
|
6
|
+
const defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
7
|
+
return {
|
|
8
|
+
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
9
|
+
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
|
|
10
|
+
(() => {
|
|
11
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
12
|
+
})(),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = defaultCognitoIdentityHttpAuthSchemeParametersProvider;
|
|
16
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
17
|
+
return {
|
|
18
|
+
schemeId: "aws.auth#sigv4",
|
|
19
|
+
signingProperties: {
|
|
20
|
+
name: "cognito-identity",
|
|
21
|
+
region: authParameters.region,
|
|
22
|
+
},
|
|
23
|
+
propertiesExtractor: (config, context) => ({
|
|
24
|
+
signingProperties: {
|
|
25
|
+
config,
|
|
26
|
+
context,
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
32
|
+
return {
|
|
33
|
+
schemeId: "smithy.api#noAuth",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => {
|
|
37
|
+
const options = [];
|
|
38
|
+
switch (authParameters.operation) {
|
|
39
|
+
case "GetCredentialsForIdentity": {
|
|
40
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case "GetId": {
|
|
44
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
default: {
|
|
48
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return options;
|
|
52
|
+
};
|
|
53
|
+
exports.defaultCognitoIdentityHttpAuthSchemeProvider = defaultCognitoIdentityHttpAuthSchemeProvider;
|
|
54
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
55
|
+
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
|
|
56
|
+
return Object.assign(config_0, {
|
|
57
|
+
authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultEndpointResolver = void 0;
|
|
4
|
+
const util_endpoints_1 = require("@aws-sdk/util-endpoints");
|
|
5
|
+
const util_endpoints_2 = require("@smithy/util-endpoints");
|
|
6
|
+
const ruleset_1 = require("./ruleset");
|
|
7
|
+
const cache = new util_endpoints_2.EndpointCache({
|
|
8
|
+
size: 50,
|
|
9
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
10
|
+
});
|
|
11
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
12
|
+
return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
|
|
13
|
+
endpointParams: endpointParams,
|
|
14
|
+
logger: context.logger,
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
exports.defaultEndpointResolver = defaultEndpointResolver;
|
|
18
|
+
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleSet = void 0;
|
|
4
|
+
const w = "required", x = "fn", y = "argv", z = "ref";
|
|
5
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = "stringEquals", j = { [w]: false, type: "string" }, k = { [w]: true, default: false, type: "boolean" }, l = { [z]: "Endpoint" }, m = { [x]: c, [y]: [{ [z]: "UseFIPS" }, true] }, n = { [x]: c, [y]: [{ [z]: "UseDualStack" }, true] }, o = {}, p = { [z]: "Region" }, q = { [x]: h, [y]: [{ [z]: g }, "supportsFIPS"] }, r = { [z]: g }, s = { [x]: c, [y]: [true, { [x]: h, [y]: [r, "supportsDualStack"] }] }, t = [m], u = [n], v = [p];
|
|
6
|
+
const _data = {
|
|
7
|
+
version: "1.0",
|
|
8
|
+
parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j },
|
|
9
|
+
rules: [
|
|
10
|
+
{
|
|
11
|
+
conditions: [{ [x]: b, [y]: [l] }],
|
|
12
|
+
rules: [
|
|
13
|
+
{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d },
|
|
14
|
+
{ conditions: u, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d },
|
|
15
|
+
{ endpoint: { url: l, properties: o, headers: o }, type: e },
|
|
16
|
+
],
|
|
17
|
+
type: f,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
conditions: [{ [x]: b, [y]: v }],
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
conditions: [{ [x]: "aws.partition", [y]: v, assign: g }],
|
|
24
|
+
rules: [
|
|
25
|
+
{
|
|
26
|
+
conditions: [m, n],
|
|
27
|
+
rules: [
|
|
28
|
+
{
|
|
29
|
+
conditions: [{ [x]: c, [y]: [a, q] }, s],
|
|
30
|
+
rules: [
|
|
31
|
+
{
|
|
32
|
+
conditions: [{ [x]: i, [y]: [p, "us-east-1"] }],
|
|
33
|
+
endpoint: {
|
|
34
|
+
url: "https://cognito-identity-fips.us-east-1.amazonaws.com",
|
|
35
|
+
properties: o,
|
|
36
|
+
headers: o,
|
|
37
|
+
},
|
|
38
|
+
type: e,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
conditions: [{ [x]: i, [y]: [p, "us-east-2"] }],
|
|
42
|
+
endpoint: {
|
|
43
|
+
url: "https://cognito-identity-fips.us-east-2.amazonaws.com",
|
|
44
|
+
properties: o,
|
|
45
|
+
headers: o,
|
|
46
|
+
},
|
|
47
|
+
type: e,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
conditions: [{ [x]: i, [y]: [p, "us-west-1"] }],
|
|
51
|
+
endpoint: {
|
|
52
|
+
url: "https://cognito-identity-fips.us-west-1.amazonaws.com",
|
|
53
|
+
properties: o,
|
|
54
|
+
headers: o,
|
|
55
|
+
},
|
|
56
|
+
type: e,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
conditions: [{ [x]: i, [y]: [p, "us-west-2"] }],
|
|
60
|
+
endpoint: {
|
|
61
|
+
url: "https://cognito-identity-fips.us-west-2.amazonaws.com",
|
|
62
|
+
properties: o,
|
|
63
|
+
headers: o,
|
|
64
|
+
},
|
|
65
|
+
type: e,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
endpoint: {
|
|
69
|
+
url: "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
70
|
+
properties: o,
|
|
71
|
+
headers: o,
|
|
72
|
+
},
|
|
73
|
+
type: e,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
type: f,
|
|
77
|
+
},
|
|
78
|
+
{ error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d },
|
|
79
|
+
],
|
|
80
|
+
type: f,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
conditions: t,
|
|
84
|
+
rules: [
|
|
85
|
+
{
|
|
86
|
+
conditions: [{ [x]: c, [y]: [q, a] }],
|
|
87
|
+
rules: [
|
|
88
|
+
{
|
|
89
|
+
endpoint: {
|
|
90
|
+
url: "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",
|
|
91
|
+
properties: o,
|
|
92
|
+
headers: o,
|
|
93
|
+
},
|
|
94
|
+
type: e,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
type: f,
|
|
98
|
+
},
|
|
99
|
+
{ error: "FIPS is enabled but this partition does not support FIPS", type: d },
|
|
100
|
+
],
|
|
101
|
+
type: f,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
conditions: u,
|
|
105
|
+
rules: [
|
|
106
|
+
{
|
|
107
|
+
conditions: [s],
|
|
108
|
+
rules: [
|
|
109
|
+
{
|
|
110
|
+
conditions: [{ [x]: i, [y]: ["aws", { [x]: h, [y]: [r, "name"] }] }],
|
|
111
|
+
endpoint: { url: "https://cognito-identity.{Region}.amazonaws.com", properties: o, headers: o },
|
|
112
|
+
type: e,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
endpoint: {
|
|
116
|
+
url: "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
117
|
+
properties: o,
|
|
118
|
+
headers: o,
|
|
119
|
+
},
|
|
120
|
+
type: e,
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
type: f,
|
|
124
|
+
},
|
|
125
|
+
{ error: "DualStack is enabled but this partition does not support DualStack", type: d },
|
|
126
|
+
],
|
|
127
|
+
type: f,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
endpoint: {
|
|
131
|
+
url: "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
|
|
132
|
+
properties: o,
|
|
133
|
+
headers: o,
|
|
134
|
+
},
|
|
135
|
+
type: e,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
type: f,
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
type: f,
|
|
142
|
+
},
|
|
143
|
+
{ error: "Invalid Configuration: Missing Region", type: d },
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
exports.ruleSet = _data;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
|
|
4
|
+
var middlewareLogger = require('@aws-sdk/middleware-logger');
|
|
5
|
+
var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
|
|
6
|
+
var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
|
|
7
|
+
var configResolver = require('@smithy/config-resolver');
|
|
8
|
+
var core = require('@smithy/core');
|
|
9
|
+
var schema = require('@smithy/core/schema');
|
|
10
|
+
var middlewareContentLength = require('@smithy/middleware-content-length');
|
|
11
|
+
var middlewareEndpoint = require('@smithy/middleware-endpoint');
|
|
12
|
+
var middlewareRetry = require('@smithy/middleware-retry');
|
|
13
|
+
var smithyClient = require('@smithy/smithy-client');
|
|
14
|
+
var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
|
|
15
|
+
var runtimeConfig = require('./runtimeConfig');
|
|
16
|
+
var regionConfigResolver = require('@aws-sdk/region-config-resolver');
|
|
17
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
18
|
+
var schemas_0 = require('./schemas/schemas_0');
|
|
19
|
+
var errors = require('./models/errors');
|
|
20
|
+
var CognitoIdentityServiceException = require('./models/CognitoIdentityServiceException');
|
|
21
|
+
|
|
22
|
+
const resolveClientEndpointParameters = (options) => {
|
|
23
|
+
return Object.assign(options, {
|
|
24
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
25
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
26
|
+
defaultSigningName: "cognito-identity",
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const commonParams = {
|
|
30
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
31
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
32
|
+
Region: { type: "builtInParams", name: "region" },
|
|
33
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
37
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
38
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
39
|
+
let _credentials = runtimeConfig.credentials;
|
|
40
|
+
return {
|
|
41
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
42
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
43
|
+
if (index === -1) {
|
|
44
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
httpAuthSchemes() {
|
|
51
|
+
return _httpAuthSchemes;
|
|
52
|
+
},
|
|
53
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
54
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
55
|
+
},
|
|
56
|
+
httpAuthSchemeProvider() {
|
|
57
|
+
return _httpAuthSchemeProvider;
|
|
58
|
+
},
|
|
59
|
+
setCredentials(credentials) {
|
|
60
|
+
_credentials = credentials;
|
|
61
|
+
},
|
|
62
|
+
credentials() {
|
|
63
|
+
return _credentials;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
68
|
+
return {
|
|
69
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
70
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
71
|
+
credentials: config.credentials(),
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
76
|
+
const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
77
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
78
|
+
return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
class CognitoIdentityClient extends smithyClient.Client {
|
|
82
|
+
config;
|
|
83
|
+
constructor(...[configuration]) {
|
|
84
|
+
const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
|
|
85
|
+
super(_config_0);
|
|
86
|
+
this.initConfig = _config_0;
|
|
87
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
88
|
+
const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
|
|
89
|
+
const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
|
|
90
|
+
const _config_4 = configResolver.resolveRegionConfig(_config_3);
|
|
91
|
+
const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
|
|
92
|
+
const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
|
|
93
|
+
const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
|
|
94
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
95
|
+
this.config = _config_8;
|
|
96
|
+
this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
|
|
97
|
+
this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
|
|
98
|
+
this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
|
|
99
|
+
this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
|
|
100
|
+
this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
|
|
101
|
+
this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
|
|
102
|
+
this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
|
|
103
|
+
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
104
|
+
httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultCognitoIdentityHttpAuthSchemeParametersProvider,
|
|
105
|
+
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
|
|
106
|
+
"aws.auth#sigv4": config.credentials,
|
|
107
|
+
}),
|
|
108
|
+
}));
|
|
109
|
+
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
|
|
110
|
+
}
|
|
111
|
+
destroy() {
|
|
112
|
+
super.destroy();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
class GetCredentialsForIdentityCommand extends smithyClient.Command
|
|
117
|
+
.classBuilder()
|
|
118
|
+
.ep(commonParams)
|
|
119
|
+
.m(function (Command, cs, config, o) {
|
|
120
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
121
|
+
})
|
|
122
|
+
.s("AWSCognitoIdentityService", "GetCredentialsForIdentity", {})
|
|
123
|
+
.n("CognitoIdentityClient", "GetCredentialsForIdentityCommand")
|
|
124
|
+
.sc(schemas_0.GetCredentialsForIdentity$)
|
|
125
|
+
.build() {
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
class GetIdCommand extends smithyClient.Command
|
|
129
|
+
.classBuilder()
|
|
130
|
+
.ep(commonParams)
|
|
131
|
+
.m(function (Command, cs, config, o) {
|
|
132
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
133
|
+
})
|
|
134
|
+
.s("AWSCognitoIdentityService", "GetId", {})
|
|
135
|
+
.n("CognitoIdentityClient", "GetIdCommand")
|
|
136
|
+
.sc(schemas_0.GetId$)
|
|
137
|
+
.build() {
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const commands = {
|
|
141
|
+
GetCredentialsForIdentityCommand,
|
|
142
|
+
GetIdCommand,
|
|
143
|
+
};
|
|
144
|
+
class CognitoIdentity extends CognitoIdentityClient {
|
|
145
|
+
}
|
|
146
|
+
smithyClient.createAggregatedClient(commands, CognitoIdentity);
|
|
147
|
+
|
|
148
|
+
exports.$Command = smithyClient.Command;
|
|
149
|
+
exports.__Client = smithyClient.Client;
|
|
150
|
+
exports.CognitoIdentityServiceException = CognitoIdentityServiceException.CognitoIdentityServiceException;
|
|
151
|
+
exports.CognitoIdentity = CognitoIdentity;
|
|
152
|
+
exports.CognitoIdentityClient = CognitoIdentityClient;
|
|
153
|
+
exports.GetCredentialsForIdentityCommand = GetCredentialsForIdentityCommand;
|
|
154
|
+
exports.GetIdCommand = GetIdCommand;
|
|
155
|
+
Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&
|
|
156
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
157
|
+
Object.defineProperty(exports, '__proto__', {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
value: schemas_0['__proto__']
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
Object.keys(schemas_0).forEach(function (k) {
|
|
163
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];
|
|
164
|
+
});
|
|
165
|
+
Object.prototype.hasOwnProperty.call(errors, '__proto__') &&
|
|
166
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
167
|
+
Object.defineProperty(exports, '__proto__', {
|
|
168
|
+
enumerable: true,
|
|
169
|
+
value: errors['__proto__']
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
Object.keys(errors).forEach(function (k) {
|
|
173
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];
|
|
174
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CognitoIdentityServiceException = exports.__ServiceException = void 0;
|
|
4
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
+
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
|
|
6
|
+
class CognitoIdentityServiceException extends smithy_client_1.ServiceException {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
Object.setPrototypeOf(this, CognitoIdentityServiceException.prototype);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.CognitoIdentityServiceException = CognitoIdentityServiceException;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LimitExceededException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.ResourceConflictException = exports.NotAuthorizedException = exports.InvalidParameterException = exports.InvalidIdentityPoolConfigurationException = exports.InternalErrorException = exports.ExternalServiceException = void 0;
|
|
4
|
+
const CognitoIdentityServiceException_1 = require("./CognitoIdentityServiceException");
|
|
5
|
+
class ExternalServiceException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
6
|
+
name = "ExternalServiceException";
|
|
7
|
+
$fault = "client";
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
super({
|
|
10
|
+
name: "ExternalServiceException",
|
|
11
|
+
$fault: "client",
|
|
12
|
+
...opts,
|
|
13
|
+
});
|
|
14
|
+
Object.setPrototypeOf(this, ExternalServiceException.prototype);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ExternalServiceException = ExternalServiceException;
|
|
18
|
+
class InternalErrorException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
19
|
+
name = "InternalErrorException";
|
|
20
|
+
$fault = "server";
|
|
21
|
+
constructor(opts) {
|
|
22
|
+
super({
|
|
23
|
+
name: "InternalErrorException",
|
|
24
|
+
$fault: "server",
|
|
25
|
+
...opts,
|
|
26
|
+
});
|
|
27
|
+
Object.setPrototypeOf(this, InternalErrorException.prototype);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.InternalErrorException = InternalErrorException;
|
|
31
|
+
class InvalidIdentityPoolConfigurationException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
32
|
+
name = "InvalidIdentityPoolConfigurationException";
|
|
33
|
+
$fault = "client";
|
|
34
|
+
constructor(opts) {
|
|
35
|
+
super({
|
|
36
|
+
name: "InvalidIdentityPoolConfigurationException",
|
|
37
|
+
$fault: "client",
|
|
38
|
+
...opts,
|
|
39
|
+
});
|
|
40
|
+
Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException.prototype);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.InvalidIdentityPoolConfigurationException = InvalidIdentityPoolConfigurationException;
|
|
44
|
+
class InvalidParameterException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
45
|
+
name = "InvalidParameterException";
|
|
46
|
+
$fault = "client";
|
|
47
|
+
constructor(opts) {
|
|
48
|
+
super({
|
|
49
|
+
name: "InvalidParameterException",
|
|
50
|
+
$fault: "client",
|
|
51
|
+
...opts,
|
|
52
|
+
});
|
|
53
|
+
Object.setPrototypeOf(this, InvalidParameterException.prototype);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.InvalidParameterException = InvalidParameterException;
|
|
57
|
+
class NotAuthorizedException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
58
|
+
name = "NotAuthorizedException";
|
|
59
|
+
$fault = "client";
|
|
60
|
+
constructor(opts) {
|
|
61
|
+
super({
|
|
62
|
+
name: "NotAuthorizedException",
|
|
63
|
+
$fault: "client",
|
|
64
|
+
...opts,
|
|
65
|
+
});
|
|
66
|
+
Object.setPrototypeOf(this, NotAuthorizedException.prototype);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.NotAuthorizedException = NotAuthorizedException;
|
|
70
|
+
class ResourceConflictException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
71
|
+
name = "ResourceConflictException";
|
|
72
|
+
$fault = "client";
|
|
73
|
+
constructor(opts) {
|
|
74
|
+
super({
|
|
75
|
+
name: "ResourceConflictException",
|
|
76
|
+
$fault: "client",
|
|
77
|
+
...opts,
|
|
78
|
+
});
|
|
79
|
+
Object.setPrototypeOf(this, ResourceConflictException.prototype);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ResourceConflictException = ResourceConflictException;
|
|
83
|
+
class ResourceNotFoundException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
84
|
+
name = "ResourceNotFoundException";
|
|
85
|
+
$fault = "client";
|
|
86
|
+
constructor(opts) {
|
|
87
|
+
super({
|
|
88
|
+
name: "ResourceNotFoundException",
|
|
89
|
+
$fault: "client",
|
|
90
|
+
...opts,
|
|
91
|
+
});
|
|
92
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.ResourceNotFoundException = ResourceNotFoundException;
|
|
96
|
+
class TooManyRequestsException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
97
|
+
name = "TooManyRequestsException";
|
|
98
|
+
$fault = "client";
|
|
99
|
+
constructor(opts) {
|
|
100
|
+
super({
|
|
101
|
+
name: "TooManyRequestsException",
|
|
102
|
+
$fault: "client",
|
|
103
|
+
...opts,
|
|
104
|
+
});
|
|
105
|
+
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.TooManyRequestsException = TooManyRequestsException;
|
|
109
|
+
class LimitExceededException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException {
|
|
110
|
+
name = "LimitExceededException";
|
|
111
|
+
$fault = "client";
|
|
112
|
+
constructor(opts) {
|
|
113
|
+
super({
|
|
114
|
+
name: "LimitExceededException",
|
|
115
|
+
$fault: "client",
|
|
116
|
+
...opts,
|
|
117
|
+
});
|
|
118
|
+
Object.setPrototypeOf(this, LimitExceededException.prototype);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.LimitExceededException = LimitExceededException;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
6
|
+
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
8
|
+
const config_resolver_1 = require("@smithy/config-resolver");
|
|
9
|
+
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
10
|
+
const invalid_dependency_1 = require("@smithy/invalid-dependency");
|
|
11
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
12
|
+
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
13
|
+
const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
|
|
14
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
15
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
16
|
+
const getRuntimeConfig = (config) => {
|
|
17
|
+
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
|
18
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
19
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
20
|
+
return {
|
|
21
|
+
...clientSharedValues,
|
|
22
|
+
...config,
|
|
23
|
+
runtime: "browser",
|
|
24
|
+
defaultsMode,
|
|
25
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
26
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
27
|
+
(0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
28
|
+
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
29
|
+
region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
|
|
30
|
+
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
31
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
32
|
+
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
33
|
+
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
34
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
35
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
6
|
+
const core_1 = require("@aws-sdk/core");
|
|
7
|
+
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
8
|
+
const config_resolver_1 = require("@smithy/config-resolver");
|
|
9
|
+
const hash_node_1 = require("@smithy/hash-node");
|
|
10
|
+
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
11
|
+
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
12
|
+
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
13
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
14
|
+
const util_body_length_node_1 = require("@smithy/util-body-length-node");
|
|
15
|
+
const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
|
|
16
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
17
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
18
|
+
const getRuntimeConfig = (config) => {
|
|
19
|
+
(0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version);
|
|
20
|
+
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
21
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
22
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
23
|
+
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
|
|
24
|
+
const loaderConfig = {
|
|
25
|
+
profile: config?.profile,
|
|
26
|
+
logger: clientSharedValues.logger,
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
...clientSharedValues,
|
|
30
|
+
...config,
|
|
31
|
+
runtime: "node",
|
|
32
|
+
defaultsMode,
|
|
33
|
+
authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
34
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
35
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
36
|
+
(0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
37
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
38
|
+
region: config?.region ??
|
|
39
|
+
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
40
|
+
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
41
|
+
retryMode: config?.retryMode ??
|
|
42
|
+
(0, node_config_provider_1.loadConfig)({
|
|
43
|
+
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
44
|
+
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
|
|
45
|
+
}, config),
|
|
46
|
+
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
47
|
+
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
48
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
49
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
50
|
+
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
+
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
6
|
+
const getRuntimeConfig = (config) => {
|
|
7
|
+
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
|
8
|
+
return {
|
|
9
|
+
...browserDefaults,
|
|
10
|
+
...config,
|
|
11
|
+
runtime: "react-native",
|
|
12
|
+
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|