@aws-sdk/client-sustainability 3.1075.0 → 3.1077.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.
@@ -20,8 +20,13 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
20
20
  | import("@smithy/core/protocols").HttpHandler<any>
21
21
  | RequestHandler;
22
22
  retryMode: string | import("@smithy/types").Provider<string>;
23
- sha256: import("@smithy/types").HashConstructor;
24
- streamCollector: import("@smithy/types").StreamCollector;
23
+ streamCollector: (
24
+ stream:
25
+ | import("stream").Readable
26
+ | import("stream/web").ReadableStream
27
+ | ReadableStream
28
+ | Blob
29
+ ) => Promise<Uint8Array>;
25
30
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
26
31
  (boolean | import("@smithy/types").Provider<boolean | undefined>);
27
32
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
@@ -36,6 +41,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
36
41
  [setting: string]: unknown;
37
42
  };
38
43
  apiVersion: string;
44
+ sha256: import("@smithy/types").HashConstructor;
39
45
  urlParser: import("@smithy/types").UrlParser;
40
46
  base64Decoder: import("@smithy/types").Decoder;
41
47
  base64Encoder: (_input: Uint8Array | string) => string;
@@ -21,11 +21,16 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
21
21
  | RequestHandler
22
22
  | import("@smithy/core/protocols").HttpHandler<any>;
23
23
  retryMode: string | import("@smithy/types").Provider<string>;
24
- sha256: import("@smithy/types").HashConstructor;
25
24
  sigv4aSigningRegionSet:
26
25
  | string[]
27
26
  | import("@smithy/types").Provider<string[] | undefined>;
28
- streamCollector: import("@smithy/types").StreamCollector;
27
+ streamCollector: (
28
+ stream:
29
+ | import("stream").Readable
30
+ | import("stream/web").ReadableStream
31
+ | ReadableStream
32
+ | Blob
33
+ ) => Promise<Uint8Array>;
29
34
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
30
35
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
31
36
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -39,6 +44,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
39
44
  [setting: string]: unknown;
40
45
  };
41
46
  apiVersion: string;
47
+ sha256: import("@smithy/types").HashConstructor;
42
48
  urlParser: import("@smithy/types").UrlParser;
43
49
  base64Decoder: import("@smithy/types").Decoder;
44
50
  base64Encoder: (_input: Uint8Array | string) => string;
@@ -1,7 +1,6 @@
1
1
  import { SustainabilityClientConfig } from "./SustainabilityClient";
2
2
  export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
3
3
  runtime: string;
4
- sha256: import("@smithy/types").HashConstructor;
5
4
  requestHandler:
6
5
  | import("@smithy/types").NodeHttpHandlerOptions
7
6
  | import("@smithy/types").FetchHttpHandlerOptions
@@ -18,9 +17,16 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
18
17
  [setting: string]: unknown;
19
18
  };
20
19
  apiVersion: string;
20
+ sha256: import("@smithy/types").HashConstructor;
21
21
  urlParser: import("@smithy/types").UrlParser;
22
22
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
23
- streamCollector: import("@smithy/types").StreamCollector;
23
+ streamCollector: (
24
+ stream:
25
+ | import("stream").Readable
26
+ | import("stream/web").ReadableStream
27
+ | ReadableStream
28
+ | Blob
29
+ ) => Promise<Uint8Array>;
24
30
  base64Decoder: import("@smithy/types").Decoder;
25
31
  base64Encoder: (_input: Uint8Array | string) => string;
26
32
  utf8Decoder: import("@smithy/types").Decoder;
@@ -25,6 +25,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
25
25
  defaultNamespace?: string;
26
26
  };
27
27
  serviceId: string;
28
+ sha256: import("@smithy/types").HashConstructor;
28
29
  signerConstructor:
29
30
  | typeof SignatureV4MultiRegion
30
31
  | (new (
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sustainability",
3
3
  "description": "AWS SDK for JavaScript Sustainability Client for Node.js, Browser and React Native",
4
- "version": "3.1075.0",
4
+ "version": "3.1077.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
7
7
  "build:cjs": "node ../../scripts/compilation/inline",
@@ -19,16 +19,14 @@
19
19
  "module": "./dist-es/index.js",
20
20
  "sideEffects": false,
21
21
  "dependencies": {
22
- "@aws-crypto/sha256-browser": "5.2.0",
23
- "@aws-crypto/sha256-js": "5.2.0",
24
- "@aws-sdk/core": "^3.974.23",
25
- "@aws-sdk/credential-provider-node": "^3.972.58",
26
- "@aws-sdk/signature-v4-multi-region": "^3.996.35",
27
- "@aws-sdk/types": "^3.973.13",
28
- "@smithy/core": "^3.24.6",
29
- "@smithy/fetch-http-handler": "^5.4.6",
30
- "@smithy/node-http-handler": "^4.7.6",
31
- "@smithy/types": "^4.14.3",
22
+ "@aws-sdk/core": "^3.974.25",
23
+ "@aws-sdk/credential-provider-node": "^3.972.60",
24
+ "@aws-sdk/signature-v4-multi-region": "^3.996.37",
25
+ "@aws-sdk/types": "^3.973.14",
26
+ "@smithy/core": "^3.28.0",
27
+ "@smithy/fetch-http-handler": "^5.6.1",
28
+ "@smithy/node-http-handler": "^4.9.1",
29
+ "@smithy/types": "^4.15.0",
32
30
  "tslib": "^2.6.2"
33
31
  },
34
32
  "devDependencies": {
@@ -1,122 +0,0 @@
1
- const { resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
3
- const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
4
- const { resolveParams } = require("@smithy/core/endpoints");
5
- const { defaultEndpointResolver } = require("../endpoint/endpointResolver");
6
- const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
7
- if (!input) {
8
- throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
9
- }
10
- const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
11
- const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
12
- ?.getEndpointParameterInstructions;
13
- if (!instructionsFn) {
14
- throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
15
- }
16
- const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
17
- return Object.assign(defaultParameters, endpointParameters);
18
- };
19
- const _defaultSustainabilityHttpAuthSchemeParametersProvider = async (config, context, input) => {
20
- return {
21
- operation: getSmithyContext(context).operation,
22
- region: await normalizeProvider(config.region)() || (() => {
23
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
24
- })(),
25
- };
26
- };
27
- exports.defaultSustainabilityHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSustainabilityHttpAuthSchemeParametersProvider);
28
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
29
- return {
30
- schemeId: "aws.auth#sigv4",
31
- signingProperties: {
32
- name: "sustainability",
33
- region: authParameters.region,
34
- },
35
- propertiesExtractor: (config, context) => ({
36
- signingProperties: {
37
- config,
38
- context,
39
- },
40
- }),
41
- };
42
- }
43
- function createAwsAuthSigv4aHttpAuthOption(authParameters) {
44
- return {
45
- schemeId: "aws.auth#sigv4a",
46
- signingProperties: {
47
- name: "sustainability",
48
- region: authParameters.region,
49
- },
50
- propertiesExtractor: (config, context) => ({
51
- signingProperties: {
52
- config,
53
- context,
54
- },
55
- }),
56
- };
57
- }
58
- const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
59
- const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
60
- const endpoint = defaultEndpointResolver(authParameters);
61
- const authSchemes = endpoint.properties?.authSchemes;
62
- if (!authSchemes) {
63
- return defaultHttpAuthSchemeResolver(authParameters);
64
- }
65
- const options = [];
66
- for (const scheme of authSchemes) {
67
- const { name: resolvedName, properties = {}, ...rest } = scheme;
68
- const name = resolvedName.toLowerCase();
69
- if (resolvedName !== name) {
70
- console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
71
- }
72
- let schemeId;
73
- if (name === "sigv4a") {
74
- schemeId = "aws.auth#sigv4a";
75
- const sigv4Present = authSchemes.find((s) => {
76
- const name = s.name.toLowerCase();
77
- return name !== "sigv4a" && name.startsWith("sigv4");
78
- });
79
- if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
80
- continue;
81
- }
82
- }
83
- else if (name.startsWith("sigv4")) {
84
- schemeId = "aws.auth#sigv4";
85
- }
86
- else {
87
- throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
88
- }
89
- const createOption = createHttpAuthOptionFunctions[schemeId];
90
- if (!createOption) {
91
- throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
92
- }
93
- const option = createOption(authParameters);
94
- option.schemeId = schemeId;
95
- option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
96
- options.push(option);
97
- }
98
- return options;
99
- };
100
- return endpointRuleSetHttpAuthSchemeProvider;
101
- };
102
- const _defaultSustainabilityHttpAuthSchemeProvider = (authParameters) => {
103
- const options = [];
104
- switch (authParameters.operation) {
105
- default: {
106
- options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
107
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
108
- }
109
- }
110
- return options;
111
- };
112
- exports.defaultSustainabilityHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSustainabilityHttpAuthSchemeProvider, {
113
- "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
114
- "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
115
- });
116
- exports.resolveHttpAuthSchemeConfig = (config) => {
117
- const config_0 = resolveAwsSdkSigV4Config(config);
118
- const config_1 = resolveAwsSdkSigV4AConfig(config_0);
119
- return Object.assign(config_1, {
120
- authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
121
- });
122
- };
@@ -1,38 +0,0 @@
1
- const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
2
- const k = "ref", l = "authSchemes", m = "name", n = "signingRegion";
3
- const a = "isSet", b = "PartitionResult", c = "stringEquals", d = "sigv4", e = { [k]: "Endpoint" }, f = { "fn": "getAttr", "argv": [{ [k]: b }, "name"] }, g = { [m]: "sigv4a", "signingRegionSet": ["*"] }, h = { [l]: [g, { [m]: d, [n]: "us-gov-west-1" }] }, i = { [l]: [g, { [m]: d, [n]: "{PartitionResult#implicitGlobalRegion}" }] }, j = [{ [k]: "Region" }];
4
- const _data = {
5
- conditions: [
6
- [a, [e]],
7
- [a, j],
8
- ["aws.partition", j, b],
9
- ["booleanEquals", [{ [k]: "UseFIPS" }, true]],
10
- [c, [f, "aws"]],
11
- [c, [f, "aws-us-gov"]]
12
- ],
13
- results: [
14
- [-1],
15
- [-1, "Invalid Configuration: FIPS and custom endpoint are not supported"],
16
- [e, { [l]: [g, { [m]: d }] }],
17
- ["https://api.sustainability.{Region}.{PartitionResult#dualStackDnsSuffix}", { [l]: [g, { [m]: d, [n]: "us-east-1" }] }],
18
- ["https://sustainability.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
19
- ["https://sustainability-fips.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
20
- ["https://sustainability-fips.global.{PartitionResult#dualStackDnsSuffix}", i],
21
- ["https://sustainability.global.{PartitionResult#dualStackDnsSuffix}", i],
22
- [-1, "Invalid Configuration: Missing Region"]
23
- ]
24
- };
25
- const root = 2;
26
- const r = 100_000_000;
27
- const nodes = new Int32Array([
28
- -1, 1, -1,
29
- 0, 9, 3,
30
- 1, 4, r + 8,
31
- 2, 5, r + 8,
32
- 3, 8, 6,
33
- 4, r + 3, 7,
34
- 5, r + 4, r + 7,
35
- 5, r + 5, r + 6,
36
- 3, r + 1, r + 2,
37
- ]);
38
- exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
@@ -1,14 +0,0 @@
1
- const { awsEndpointFunctions } = require("@aws-sdk/core/client");
2
- const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
3
- const { bdd } = require("./bdd");
4
- const cache = new EndpointCache({
5
- size: 50,
6
- params: ["Endpoint", "Region", "UseFIPS"],
7
- });
8
- exports.defaultEndpointResolver = (endpointParams, context = {}) => {
9
- return cache.get(endpointParams, () => decideEndpoint(bdd, {
10
- endpointParams: endpointParams,
11
- logger: context.logger,
12
- }));
13
- };
14
- customEndpointFunctions.aws = awsEndpointFunctions;
@@ -1,8 +0,0 @@
1
- const { ServiceException: __ServiceException } = require("@smithy/core/client");
2
- exports.__ServiceException = __ServiceException;
3
- exports.SustainabilityServiceException = class SustainabilityServiceException extends __ServiceException {
4
- constructor(options) {
5
- super(options);
6
- Object.setPrototypeOf(this, SustainabilityServiceException.prototype);
7
- }
8
- };
@@ -1,59 +0,0 @@
1
- const { SustainabilityServiceException: __BaseException } = require("./SustainabilityServiceException");
2
- exports.AccessDeniedException = class AccessDeniedException extends __BaseException {
3
- name = "AccessDeniedException";
4
- $fault = "client";
5
- Message;
6
- constructor(opts) {
7
- super({
8
- name: "AccessDeniedException",
9
- $fault: "client",
10
- ...opts,
11
- });
12
- Object.setPrototypeOf(this, AccessDeniedException.prototype);
13
- this.Message = opts.Message;
14
- }
15
- };
16
- exports.InternalServerException = class InternalServerException extends __BaseException {
17
- name = "InternalServerException";
18
- $fault = "server";
19
- $retryable = {};
20
- Message;
21
- constructor(opts) {
22
- super({
23
- name: "InternalServerException",
24
- $fault: "server",
25
- ...opts,
26
- });
27
- Object.setPrototypeOf(this, InternalServerException.prototype);
28
- this.Message = opts.Message;
29
- }
30
- };
31
- exports.ThrottlingException = class ThrottlingException extends __BaseException {
32
- name = "ThrottlingException";
33
- $fault = "client";
34
- $retryable = {};
35
- Message;
36
- constructor(opts) {
37
- super({
38
- name: "ThrottlingException",
39
- $fault: "client",
40
- ...opts,
41
- });
42
- Object.setPrototypeOf(this, ThrottlingException.prototype);
43
- this.Message = opts.Message;
44
- }
45
- };
46
- exports.ValidationException = class ValidationException extends __BaseException {
47
- name = "ValidationException";
48
- $fault = "client";
49
- Message;
50
- constructor(opts) {
51
- super({
52
- name: "ValidationException",
53
- $fault: "client",
54
- ...opts,
55
- });
56
- Object.setPrototypeOf(this, ValidationException.prototype);
57
- this.Message = opts.Message;
58
- }
59
- };
@@ -1,32 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { Sha256 } = require("@aws-crypto/sha256-browser");
3
- const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
4
- const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
5
- const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
6
- const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
7
- const { calculateBodyLength } = require("@smithy/core/serde");
8
- const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
9
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
10
- const getRuntimeConfig = (config) => {
11
- const defaultsMode = resolveDefaultsModeConfig(config);
12
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
13
- const clientSharedValues = getSharedRuntimeConfig(config);
14
- return {
15
- ...clientSharedValues,
16
- ...config,
17
- runtime: "browser",
18
- defaultsMode,
19
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
20
- credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
21
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
22
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
23
- region: config?.region ?? invalidProvider("Region is missing"),
24
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
25
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
26
- sha256: config?.sha256 ?? Sha256,
27
- streamCollector: config?.streamCollector ?? streamCollector,
28
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
29
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
30
- };
31
- };
32
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,46 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
3
- const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
4
- const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
5
- const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
6
- const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
7
- const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
8
- const { calculateBodyLength, Hash } = require("@smithy/core/serde");
9
- const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
10
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
11
- const getRuntimeConfig = (config) => {
12
- emitWarningIfUnsupportedVersion(process.version);
13
- const defaultsMode = resolveDefaultsModeConfig(config);
14
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
15
- const clientSharedValues = getSharedRuntimeConfig(config);
16
- awsCheckVersion(process.version);
17
- const loaderConfig = {
18
- profile: config?.profile,
19
- logger: clientSharedValues.logger,
20
- };
21
- return {
22
- ...clientSharedValues,
23
- ...config,
24
- runtime: "node",
25
- defaultsMode,
26
- authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
27
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
28
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
29
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
30
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
31
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
32
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
33
- retryMode: config?.retryMode ??
34
- loadNodeConfig({
35
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
36
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
37
- }, config),
38
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
39
- sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
40
- streamCollector: config?.streamCollector ?? streamCollector,
41
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
42
- useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
43
- userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
44
- };
45
- };
46
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,12 +0,0 @@
1
- const { Sha256 } = require("@aws-crypto/sha256-js");
2
- const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
3
- const getRuntimeConfig = (config) => {
4
- const browserDefaults = getBrowserRuntimeConfig(config);
5
- return {
6
- ...browserDefaults,
7
- ...config,
8
- runtime: "react-native",
9
- sha256: config?.sha256 ?? Sha256,
10
- };
11
- };
12
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,45 +0,0 @@
1
- const { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
3
- const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
4
- const { NoOpLogger } = require("@smithy/core/client");
5
- const { parseUrl } = require("@smithy/core/protocols");
6
- const { fromBase64, fromUtf8, toBase64, toUtf8 } = require("@smithy/core/serde");
7
- const { defaultSustainabilityHttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
8
- const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
9
- const { errorTypeRegistries } = require("./schemas/schemas_0");
10
- exports.getRuntimeConfig = (config) => {
11
- return {
12
- apiVersion: "2018-05-10",
13
- base64Decoder: config?.base64Decoder ?? fromBase64,
14
- base64Encoder: config?.base64Encoder ?? toBase64,
15
- disableHostPrefix: config?.disableHostPrefix ?? false,
16
- endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
17
- extensions: config?.extensions ?? [],
18
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSustainabilityHttpAuthSchemeProvider,
19
- httpAuthSchemes: config?.httpAuthSchemes ?? [
20
- {
21
- schemeId: "aws.auth#sigv4",
22
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
23
- signer: new AwsSdkSigV4Signer(),
24
- },
25
- {
26
- schemeId: "aws.auth#sigv4a",
27
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
28
- signer: new AwsSdkSigV4ASigner(),
29
- },
30
- ],
31
- logger: config?.logger ?? new NoOpLogger(),
32
- protocol: config?.protocol ?? AwsRestJsonProtocol,
33
- protocolSettings: config?.protocolSettings ?? {
34
- defaultNamespace: "com.amazonaws.sustainability",
35
- errorTypeRegistries,
36
- version: "2018-05-10",
37
- serviceTarget: "AwsSustainabilityApiService",
38
- },
39
- serviceId: config?.serviceId ?? "Sustainability",
40
- signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
41
- urlParser: config?.urlParser ?? parseUrl,
42
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
43
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
44
- };
45
- };