@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.
package/dist-cjs/index.js CHANGED
@@ -1,21 +1,188 @@
1
- var __exportStar = (m, e) => { Object.assign(e, m); };
2
- const { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
1
+ const { awsEndpointFunctions, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$1, createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
3
2
  const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin, createPaginator } = require("@smithy/core");
4
- const { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
3
+ const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
5
4
  exports.$Command = Command;
6
5
  exports.__Client = Client;
7
- const { resolveRegionConfig } = require("@smithy/core/config");
8
- const { resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
9
- const { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
10
- const { resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
11
- const { getSchemaSerdePlugin } = require("@smithy/core/schema");
12
- const { resolveHttpAuthSchemeConfig, defaultSustainabilityHttpAuthSchemeParametersProvider } = require("./auth/httpAuthSchemeProvider");
13
- const { getRuntimeConfig } = require("./runtimeConfig");
14
- const { GetEstimatedCarbonEmissions$, GetEstimatedCarbonEmissionsDimensionValues$ } = require("./schemas/schemas_0");
15
- __exportStar(require("./schemas/schemas_0"), exports);
16
- __exportStar(require("./models/errors"), exports);
17
- const { SustainabilityServiceException } = require("./models/SustainabilityServiceException");
18
- exports.SustainabilityServiceException = SustainabilityServiceException;
6
+ const { resolveDefaultsModeConfig, loadConfig, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig } = require("@smithy/core/config");
7
+ const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveParams, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
8
+ const { parseUrl, getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
9
+ const { DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
10
+ const { TypeRegistry, getSchemaSerdePlugin } = require("@smithy/core/schema");
11
+ const { resolveAwsSdkSigV4Config, resolveAwsSdkSigV4AConfig, AwsSdkSigV4Signer, AwsSdkSigV4ASigner, NODE_SIGV4A_CONFIG_OPTIONS, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
12
+ const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
13
+ const { defaultProvider } = require("@aws-sdk/credential-provider-node");
14
+ const { toUtf8, fromUtf8, toBase64, fromBase64, calculateBodyLength } = require("@smithy/core/serde");
15
+ const { streamCollector, NodeHttpHandler } = require("@smithy/node-http-handler");
16
+ const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
17
+ const { Sha256 } = require("@smithy/core/checksum");
18
+
19
+ const k = "ref", l = "authSchemes", m = "name", n = "signingRegion";
20
+ 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" }];
21
+ const _data = {
22
+ conditions: [
23
+ [a, [e]],
24
+ [a, j],
25
+ ["aws.partition", j, b],
26
+ ["booleanEquals", [{ [k]: "UseFIPS" }, true]],
27
+ [c, [f, "aws"]],
28
+ [c, [f, "aws-us-gov"]]
29
+ ],
30
+ results: [
31
+ [-1],
32
+ [-1, "Invalid Configuration: FIPS and custom endpoint are not supported"],
33
+ [e, { [l]: [g, { [m]: d }] }],
34
+ ["https://api.sustainability.{Region}.{PartitionResult#dualStackDnsSuffix}", { [l]: [g, { [m]: d, [n]: "us-east-1" }] }],
35
+ ["https://sustainability.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
36
+ ["https://sustainability-fips.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
37
+ ["https://sustainability-fips.global.{PartitionResult#dualStackDnsSuffix}", i],
38
+ ["https://sustainability.global.{PartitionResult#dualStackDnsSuffix}", i],
39
+ [-1, "Invalid Configuration: Missing Region"]
40
+ ]
41
+ };
42
+ const root = 2;
43
+ const r = 100_000_000;
44
+ const nodes = new Int32Array([
45
+ -1, 1, -1,
46
+ 0, 9, 3,
47
+ 1, 4, r + 8,
48
+ 2, 5, r + 8,
49
+ 3, 8, 6,
50
+ 4, r + 3, 7,
51
+ 5, r + 4, r + 7,
52
+ 5, r + 5, r + 6,
53
+ 3, r + 1, r + 2,
54
+ ]);
55
+ const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
56
+
57
+ const cache = new EndpointCache({
58
+ size: 50,
59
+ params: ["Endpoint", "Region", "UseFIPS"],
60
+ });
61
+ const defaultEndpointResolver = (endpointParams, context = {}) => {
62
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
63
+ endpointParams: endpointParams,
64
+ logger: context.logger,
65
+ }));
66
+ };
67
+ customEndpointFunctions.aws = awsEndpointFunctions;
68
+
69
+ const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
70
+ if (!input) {
71
+ throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
72
+ }
73
+ const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
74
+ const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
75
+ ?.getEndpointParameterInstructions;
76
+ if (!instructionsFn) {
77
+ throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
78
+ }
79
+ const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
80
+ return Object.assign(defaultParameters, endpointParameters);
81
+ };
82
+ const _defaultSustainabilityHttpAuthSchemeParametersProvider = async (config, context, input) => {
83
+ return {
84
+ operation: getSmithyContext(context).operation,
85
+ region: await normalizeProvider(config.region)() || (() => {
86
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
87
+ })(),
88
+ };
89
+ };
90
+ const defaultSustainabilityHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSustainabilityHttpAuthSchemeParametersProvider);
91
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
92
+ return {
93
+ schemeId: "aws.auth#sigv4",
94
+ signingProperties: {
95
+ name: "sustainability",
96
+ region: authParameters.region,
97
+ },
98
+ propertiesExtractor: (config, context) => ({
99
+ signingProperties: {
100
+ config,
101
+ context,
102
+ },
103
+ }),
104
+ };
105
+ }
106
+ function createAwsAuthSigv4aHttpAuthOption(authParameters) {
107
+ return {
108
+ schemeId: "aws.auth#sigv4a",
109
+ signingProperties: {
110
+ name: "sustainability",
111
+ region: authParameters.region,
112
+ },
113
+ propertiesExtractor: (config, context) => ({
114
+ signingProperties: {
115
+ config,
116
+ context,
117
+ },
118
+ }),
119
+ };
120
+ }
121
+ const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
122
+ const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
123
+ const endpoint = defaultEndpointResolver(authParameters);
124
+ const authSchemes = endpoint.properties?.authSchemes;
125
+ if (!authSchemes) {
126
+ return defaultHttpAuthSchemeResolver(authParameters);
127
+ }
128
+ const options = [];
129
+ for (const scheme of authSchemes) {
130
+ const { name: resolvedName, properties = {}, ...rest } = scheme;
131
+ const name = resolvedName.toLowerCase();
132
+ if (resolvedName !== name) {
133
+ console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
134
+ }
135
+ let schemeId;
136
+ if (name === "sigv4a") {
137
+ schemeId = "aws.auth#sigv4a";
138
+ const sigv4Present = authSchemes.find((s) => {
139
+ const name = s.name.toLowerCase();
140
+ return name !== "sigv4a" && name.startsWith("sigv4");
141
+ });
142
+ if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
143
+ continue;
144
+ }
145
+ }
146
+ else if (name.startsWith("sigv4")) {
147
+ schemeId = "aws.auth#sigv4";
148
+ }
149
+ else {
150
+ throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
151
+ }
152
+ const createOption = createHttpAuthOptionFunctions[schemeId];
153
+ if (!createOption) {
154
+ throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
155
+ }
156
+ const option = createOption(authParameters);
157
+ option.schemeId = schemeId;
158
+ option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
159
+ options.push(option);
160
+ }
161
+ return options;
162
+ };
163
+ return endpointRuleSetHttpAuthSchemeProvider;
164
+ };
165
+ const _defaultSustainabilityHttpAuthSchemeProvider = (authParameters) => {
166
+ const options = [];
167
+ switch (authParameters.operation) {
168
+ default: {
169
+ options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
170
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
171
+ }
172
+ }
173
+ return options;
174
+ };
175
+ const defaultSustainabilityHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSustainabilityHttpAuthSchemeProvider, {
176
+ "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
177
+ "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
178
+ });
179
+ const resolveHttpAuthSchemeConfig = (config) => {
180
+ const config_0 = resolveAwsSdkSigV4Config(config);
181
+ const config_1 = resolveAwsSdkSigV4AConfig(config_0);
182
+ return Object.assign(config_1, {
183
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
184
+ });
185
+ };
19
186
 
20
187
  const resolveClientEndpointParameters = (options) => {
21
188
  return Object.assign(options, {
@@ -29,6 +196,294 @@ const commonParams = {
29
196
  Region: { type: "builtInParams", name: "region" },
30
197
  };
31
198
 
199
+ var version = "3.1076.0";
200
+ var packageInfo = {
201
+ version: version};
202
+
203
+ class SustainabilityServiceException extends ServiceException {
204
+ constructor(options) {
205
+ super(options);
206
+ Object.setPrototypeOf(this, SustainabilityServiceException.prototype);
207
+ }
208
+ }
209
+
210
+ class AccessDeniedException extends SustainabilityServiceException {
211
+ name = "AccessDeniedException";
212
+ $fault = "client";
213
+ Message;
214
+ constructor(opts) {
215
+ super({
216
+ name: "AccessDeniedException",
217
+ $fault: "client",
218
+ ...opts,
219
+ });
220
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
221
+ this.Message = opts.Message;
222
+ }
223
+ }
224
+ class InternalServerException extends SustainabilityServiceException {
225
+ name = "InternalServerException";
226
+ $fault = "server";
227
+ $retryable = {};
228
+ Message;
229
+ constructor(opts) {
230
+ super({
231
+ name: "InternalServerException",
232
+ $fault: "server",
233
+ ...opts,
234
+ });
235
+ Object.setPrototypeOf(this, InternalServerException.prototype);
236
+ this.Message = opts.Message;
237
+ }
238
+ }
239
+ class ThrottlingException extends SustainabilityServiceException {
240
+ name = "ThrottlingException";
241
+ $fault = "client";
242
+ $retryable = {};
243
+ Message;
244
+ constructor(opts) {
245
+ super({
246
+ name: "ThrottlingException",
247
+ $fault: "client",
248
+ ...opts,
249
+ });
250
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
251
+ this.Message = opts.Message;
252
+ }
253
+ }
254
+ class ValidationException extends SustainabilityServiceException {
255
+ name = "ValidationException";
256
+ $fault = "client";
257
+ Message;
258
+ constructor(opts) {
259
+ super({
260
+ name: "ValidationException",
261
+ $fault: "client",
262
+ ...opts,
263
+ });
264
+ Object.setPrototypeOf(this, ValidationException.prototype);
265
+ this.Message = opts.Message;
266
+ }
267
+ }
268
+
269
+ const _ADE = "AccessDeniedException";
270
+ const _D = "Dimension";
271
+ const _DE = "DimensionEntry";
272
+ const _DEL = "DimensionEntryList";
273
+ const _DLM = "DimensionListMap";
274
+ const _DV = "DimensionsValues";
275
+ const _Di = "Dimensions";
276
+ const _E = "Emissions";
277
+ const _ECE = "EstimatedCarbonEmissions";
278
+ const _ECEL = "EstimatedCarbonEmissionsList";
279
+ const _EM = "EmissionsMap";
280
+ const _ET = "EmissionsTypes";
281
+ const _EV = "EmissionsValues";
282
+ const _En = "End";
283
+ const _FB = "FilterBy";
284
+ const _FE = "FilterExpression";
285
+ const _FYSM = "FiscalYearStartMonth";
286
+ const _G = "Granularity";
287
+ const _GB = "GroupBy";
288
+ const _GC = "GranularityConfiguration";
289
+ const _GECE = "GetEstimatedCarbonEmissions";
290
+ const _GECEDV = "GetEstimatedCarbonEmissionsDimensionValues";
291
+ const _GECEDVR = "GetEstimatedCarbonEmissionsDimensionValuesRequest";
292
+ const _GECEDVRe = "GetEstimatedCarbonEmissionsDimensionValuesResponse";
293
+ const _GECER = "GetEstimatedCarbonEmissionsRequest";
294
+ const _GECERe = "GetEstimatedCarbonEmissionsResponse";
295
+ const _ISE = "InternalServerException";
296
+ const _M = "Message";
297
+ const _MR = "MaxResults";
298
+ const _MV = "ModelVersion";
299
+ const _NT = "NextToken";
300
+ const _R = "Results";
301
+ const _S = "Start";
302
+ const _TE = "ThrottlingException";
303
+ const _TP = "TimePeriod";
304
+ const _U = "Unit";
305
+ const _V = "Value";
306
+ const _VE = "ValidationException";
307
+ const _c = "client";
308
+ const _e = "error";
309
+ const _h = "http";
310
+ const _hE = "httpError";
311
+ const _jN = "jsonName";
312
+ const _m = "message";
313
+ const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sustainability";
314
+ const _se = "server";
315
+ const n0 = "com.amazonaws.sustainability";
316
+ const _s_registry = TypeRegistry.for(_s);
317
+ var SustainabilityServiceException$ = [-3, _s, "SustainabilityServiceException", 0, [], []];
318
+ _s_registry.registerError(SustainabilityServiceException$, SustainabilityServiceException);
319
+ const n0_registry = TypeRegistry.for(n0);
320
+ var AccessDeniedException$ = [-3, n0, _ADE,
321
+ { [_e]: _c, [_hE]: 403 },
322
+ [_M],
323
+ [[0, { [_jN]: _m }]], 1
324
+ ];
325
+ n0_registry.registerError(AccessDeniedException$, AccessDeniedException);
326
+ var InternalServerException$ = [-3, n0, _ISE,
327
+ { [_e]: _se, [_hE]: 500 },
328
+ [_M],
329
+ [[0, { [_jN]: _m }]], 1
330
+ ];
331
+ n0_registry.registerError(InternalServerException$, InternalServerException);
332
+ var ThrottlingException$ = [-3, n0, _TE,
333
+ { [_e]: _c, [_hE]: 429 },
334
+ [_M],
335
+ [[0, { [_jN]: _m }]], 1
336
+ ];
337
+ n0_registry.registerError(ThrottlingException$, ThrottlingException);
338
+ var ValidationException$ = [-3, n0, _VE,
339
+ { [_e]: _c, [_hE]: 400 },
340
+ [_M],
341
+ [[0, { [_jN]: _m }]], 1
342
+ ];
343
+ n0_registry.registerError(ValidationException$, ValidationException);
344
+ const errorTypeRegistries = [
345
+ _s_registry,
346
+ n0_registry,
347
+ ];
348
+ var DimensionEntry$ = [3, n0, _DE,
349
+ 0,
350
+ [_D, _V],
351
+ [0, 0], 2
352
+ ];
353
+ var Emissions$ = [3, n0, _E,
354
+ 0,
355
+ [_V, _U],
356
+ [1, 0], 2
357
+ ];
358
+ var EstimatedCarbonEmissions$ = [3, n0, _ECE,
359
+ 0,
360
+ [_TP, _DV, _MV, _EV],
361
+ [() => TimePeriod$, 128 | 0, 0, () => EmissionsMap], 4
362
+ ];
363
+ var FilterExpression$ = [3, n0, _FE,
364
+ 0,
365
+ [_Di],
366
+ [[2, n0, _DLM, 0, 0, 64 | 0]]
367
+ ];
368
+ var GetEstimatedCarbonEmissionsDimensionValuesRequest$ = [3, n0, _GECEDVR,
369
+ 0,
370
+ [_TP, _Di, _MR, _NT],
371
+ [() => TimePeriod$, 64 | 0, 1, 0], 2
372
+ ];
373
+ var GetEstimatedCarbonEmissionsDimensionValuesResponse$ = [3, n0, _GECEDVRe,
374
+ 0,
375
+ [_R, _NT],
376
+ [() => DimensionEntryList, 0]
377
+ ];
378
+ var GetEstimatedCarbonEmissionsRequest$ = [3, n0, _GECER,
379
+ 0,
380
+ [_TP, _GB, _FB, _ET, _G, _GC, _MR, _NT],
381
+ [() => TimePeriod$, 64 | 0, () => FilterExpression$, 64 | 0, 0, () => GranularityConfiguration$, 1, 0], 1
382
+ ];
383
+ var GetEstimatedCarbonEmissionsResponse$ = [3, n0, _GECERe,
384
+ 0,
385
+ [_R, _NT],
386
+ [() => EstimatedCarbonEmissionsList, 0], 1
387
+ ];
388
+ var GranularityConfiguration$ = [3, n0, _GC,
389
+ 0,
390
+ [_FYSM],
391
+ [1]
392
+ ];
393
+ var TimePeriod$ = [3, n0, _TP,
394
+ 0,
395
+ [_S, _En],
396
+ [5, 5], 2
397
+ ];
398
+ var DimensionEntryList = [1, n0, _DEL,
399
+ 0, () => DimensionEntry$
400
+ ];
401
+ var EstimatedCarbonEmissionsList = [1, n0, _ECEL,
402
+ 0, () => EstimatedCarbonEmissions$
403
+ ];
404
+ var EmissionsMap = [2, n0, _EM,
405
+ 0, 0, () => Emissions$
406
+ ];
407
+ var GetEstimatedCarbonEmissions$ = [9, n0, _GECE,
408
+ { [_h]: ["POST", "/v1/estimated-carbon-emissions", 200] }, () => GetEstimatedCarbonEmissionsRequest$, () => GetEstimatedCarbonEmissionsResponse$
409
+ ];
410
+ var GetEstimatedCarbonEmissionsDimensionValues$ = [9, n0, _GECEDV,
411
+ { [_h]: ["POST", "/v1/estimated-carbon-emissions-dimension-values", 200] }, () => GetEstimatedCarbonEmissionsDimensionValuesRequest$, () => GetEstimatedCarbonEmissionsDimensionValuesResponse$
412
+ ];
413
+
414
+ const getRuntimeConfig$1 = (config) => {
415
+ return {
416
+ apiVersion: "2018-05-10",
417
+ base64Decoder: config?.base64Decoder ?? fromBase64,
418
+ base64Encoder: config?.base64Encoder ?? toBase64,
419
+ disableHostPrefix: config?.disableHostPrefix ?? false,
420
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
421
+ extensions: config?.extensions ?? [],
422
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSustainabilityHttpAuthSchemeProvider,
423
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
424
+ {
425
+ schemeId: "aws.auth#sigv4",
426
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
427
+ signer: new AwsSdkSigV4Signer(),
428
+ },
429
+ {
430
+ schemeId: "aws.auth#sigv4a",
431
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
432
+ signer: new AwsSdkSigV4ASigner(),
433
+ },
434
+ ],
435
+ logger: config?.logger ?? new NoOpLogger(),
436
+ protocol: config?.protocol ?? AwsRestJsonProtocol,
437
+ protocolSettings: config?.protocolSettings ?? {
438
+ defaultNamespace: "com.amazonaws.sustainability",
439
+ errorTypeRegistries,
440
+ version: "2018-05-10",
441
+ serviceTarget: "AwsSustainabilityApiService",
442
+ },
443
+ serviceId: config?.serviceId ?? "Sustainability",
444
+ sha256: config?.sha256 ?? Sha256,
445
+ signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
446
+ urlParser: config?.urlParser ?? parseUrl,
447
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
448
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
449
+ };
450
+ };
451
+
452
+ const getRuntimeConfig = (config) => {
453
+ emitWarningIfUnsupportedVersion(process.version);
454
+ const defaultsMode = resolveDefaultsModeConfig(config);
455
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
456
+ const clientSharedValues = getRuntimeConfig$1(config);
457
+ emitWarningIfUnsupportedVersion$1(process.version);
458
+ const loaderConfig = {
459
+ profile: config?.profile,
460
+ logger: clientSharedValues.logger,
461
+ };
462
+ return {
463
+ ...clientSharedValues,
464
+ ...config,
465
+ runtime: "node",
466
+ defaultsMode,
467
+ authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
468
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
469
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
470
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
471
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
472
+ region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
473
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
474
+ retryMode: config?.retryMode ??
475
+ loadConfig({
476
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
477
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
478
+ }, config),
479
+ sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
480
+ streamCollector: config?.streamCollector ?? streamCollector,
481
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
482
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
483
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
484
+ };
485
+ };
486
+
32
487
  const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
33
488
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
34
489
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
@@ -175,13 +630,36 @@ const EmissionsUnit = {
175
630
  MT_CO2E: "MTCO2e",
176
631
  };
177
632
 
633
+ exports.AccessDeniedException = AccessDeniedException;
634
+ exports.AccessDeniedException$ = AccessDeniedException$;
178
635
  exports.Dimension = Dimension;
636
+ exports.DimensionEntry$ = DimensionEntry$;
637
+ exports.Emissions$ = Emissions$;
179
638
  exports.EmissionsType = EmissionsType;
180
639
  exports.EmissionsUnit = EmissionsUnit;
640
+ exports.EstimatedCarbonEmissions$ = EstimatedCarbonEmissions$;
641
+ exports.FilterExpression$ = FilterExpression$;
642
+ exports.GetEstimatedCarbonEmissions$ = GetEstimatedCarbonEmissions$;
181
643
  exports.GetEstimatedCarbonEmissionsCommand = GetEstimatedCarbonEmissionsCommand;
644
+ exports.GetEstimatedCarbonEmissionsDimensionValues$ = GetEstimatedCarbonEmissionsDimensionValues$;
182
645
  exports.GetEstimatedCarbonEmissionsDimensionValuesCommand = GetEstimatedCarbonEmissionsDimensionValuesCommand;
646
+ exports.GetEstimatedCarbonEmissionsDimensionValuesRequest$ = GetEstimatedCarbonEmissionsDimensionValuesRequest$;
647
+ exports.GetEstimatedCarbonEmissionsDimensionValuesResponse$ = GetEstimatedCarbonEmissionsDimensionValuesResponse$;
648
+ exports.GetEstimatedCarbonEmissionsRequest$ = GetEstimatedCarbonEmissionsRequest$;
649
+ exports.GetEstimatedCarbonEmissionsResponse$ = GetEstimatedCarbonEmissionsResponse$;
650
+ exports.GranularityConfiguration$ = GranularityConfiguration$;
651
+ exports.InternalServerException = InternalServerException;
652
+ exports.InternalServerException$ = InternalServerException$;
183
653
  exports.Sustainability = Sustainability;
184
654
  exports.SustainabilityClient = SustainabilityClient;
655
+ exports.SustainabilityServiceException = SustainabilityServiceException;
656
+ exports.SustainabilityServiceException$ = SustainabilityServiceException$;
657
+ exports.ThrottlingException = ThrottlingException;
658
+ exports.ThrottlingException$ = ThrottlingException$;
185
659
  exports.TimeGranularity = TimeGranularity;
660
+ exports.TimePeriod$ = TimePeriod$;
661
+ exports.ValidationException = ValidationException;
662
+ exports.ValidationException$ = ValidationException$;
663
+ exports.errorTypeRegistries = errorTypeRegistries;
186
664
  exports.paginateGetEstimatedCarbonEmissions = paginateGetEstimatedCarbonEmissions;
187
665
  exports.paginateGetEstimatedCarbonEmissionsDimensionValues = paginateGetEstimatedCarbonEmissionsDimensionValues;
@@ -1,5 +1,4 @@
1
1
  import packageInfo from "../package.json";
2
- import { Sha256 } from "@aws-crypto/sha256-browser";
3
2
  import { createDefaultUserAgentProvider } from "@aws-sdk/core/client";
4
3
  import { invalidProvider, loadConfigsForDefaultMode } from "@smithy/core/client";
5
4
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig, } from "@smithy/core/config";
@@ -23,7 +22,6 @@ export const getRuntimeConfig = (config) => {
23
22
  region: config?.region ?? invalidProvider("Region is missing"),
24
23
  requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
25
24
  retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
26
- sha256: config?.sha256 ?? Sha256,
27
25
  streamCollector: config?.streamCollector ?? streamCollector,
28
26
  useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
29
27
  useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
@@ -5,7 +5,7 @@ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credentia
5
5
  import { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from "@smithy/core/client";
6
6
  import { loadConfig as loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig, } from "@smithy/core/config";
7
7
  import { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, } from "@smithy/core/retry";
8
- import { calculateBodyLength, Hash } from "@smithy/core/serde";
8
+ import { calculateBodyLength } from "@smithy/core/serde";
9
9
  import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
10
10
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
11
11
  export const getRuntimeConfig = (config) => {
@@ -35,7 +35,6 @@ export const getRuntimeConfig = (config) => {
35
35
  ...NODE_RETRY_MODE_CONFIG_OPTIONS,
36
36
  default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
37
37
  }, config),
38
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
39
38
  sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
40
39
  streamCollector: config?.streamCollector ?? streamCollector,
41
40
  useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
@@ -1,4 +1,3 @@
1
- import { Sha256 } from "@aws-crypto/sha256-js";
2
1
  import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
3
2
  export const getRuntimeConfig = (config) => {
4
3
  const browserDefaults = getBrowserRuntimeConfig(config);
@@ -6,6 +5,5 @@ export const getRuntimeConfig = (config) => {
6
5
  ...browserDefaults,
7
6
  ...config,
8
7
  runtime: "react-native",
9
- sha256: config?.sha256 ?? Sha256,
10
8
  };
11
9
  };
@@ -1,6 +1,7 @@
1
1
  import { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } from "@aws-sdk/core/httpAuthSchemes";
2
2
  import { AwsRestJsonProtocol } from "@aws-sdk/core/protocols";
3
3
  import { SignatureV4MultiRegion } from "@aws-sdk/signature-v4-multi-region";
4
+ import { Sha256 } from "@smithy/core/checksum";
4
5
  import { NoOpLogger } from "@smithy/core/client";
5
6
  import { parseUrl } from "@smithy/core/protocols";
6
7
  import { fromBase64, fromUtf8, toBase64, toUtf8 } from "@smithy/core/serde";
@@ -37,6 +38,7 @@ export const getRuntimeConfig = (config) => {
37
38
  serviceTarget: "AwsSustainabilityApiService",
38
39
  },
39
40
  serviceId: config?.serviceId ?? "Sustainability",
41
+ sha256: config?.sha256 ?? Sha256,
40
42
  signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
41
43
  urlParser: config?.urlParser ?? parseUrl,
42
44
  utf8Decoder: config?.utf8Decoder ?? fromUtf8,
@@ -13,8 +13,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
13
13
  region: string | import("@smithy/types").Provider<any>;
14
14
  requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
15
15
  retryMode: string | import("@smithy/types").Provider<string>;
16
- sha256: import("@smithy/types").HashConstructor;
17
- streamCollector: import("@smithy/types").StreamCollector;
16
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
18
17
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
19
18
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
20
19
  cacheMiddleware?: boolean | undefined;
@@ -24,6 +23,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
24
23
  [setting: string]: unknown;
25
24
  };
26
25
  apiVersion: string;
26
+ sha256: import("@smithy/types").HashConstructor;
27
27
  urlParser: import("@smithy/types").UrlParser;
28
28
  base64Decoder: import("@smithy/types").Decoder;
29
29
  base64Encoder: (_input: Uint8Array | string) => string;
@@ -14,9 +14,8 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
14
14
  region: string | import("@smithy/types").Provider<string>;
15
15
  requestHandler: RequestHandler | import("@smithy/core/protocols").HttpHandler<any>;
16
16
  retryMode: string | import("@smithy/types").Provider<string>;
17
- sha256: import("@smithy/types").HashConstructor;
18
17
  sigv4aSigningRegionSet: string[] | import("@smithy/types").Provider<string[] | undefined>;
19
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
20
19
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
21
20
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
22
21
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -27,6 +26,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
27
26
  [setting: string]: unknown;
28
27
  };
29
28
  apiVersion: string;
29
+ sha256: import("@smithy/types").HashConstructor;
30
30
  urlParser: import("@smithy/types").UrlParser;
31
31
  base64Decoder: import("@smithy/types").Decoder;
32
32
  base64Encoder: (_input: Uint8Array | string) => string;
@@ -4,7 +4,6 @@ import type { SustainabilityClientConfig } from "./SustainabilityClient";
4
4
  */
5
5
  export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
6
6
  runtime: string;
7
- sha256: import("@smithy/types").HashConstructor;
8
7
  requestHandler: import("@smithy/types").NodeHttpHandlerOptions | import("@smithy/types").FetchHttpHandlerOptions | Record<string, unknown> | import("@smithy/core/protocols").HttpHandler<any> | import("@smithy/fetch-http-handler").FetchHttpHandler;
9
8
  cacheMiddleware?: boolean;
10
9
  protocol: import("@smithy/types").ClientProtocol<any, any> | import("@smithy/types").ClientProtocolCtor<any, any> | typeof import("@aws-sdk/core/protocols").AwsRestJsonProtocol;
@@ -13,9 +12,10 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
13
12
  [setting: string]: unknown;
14
13
  };
15
14
  apiVersion: string;
15
+ sha256: import("@smithy/types").HashConstructor;
16
16
  urlParser: import("@smithy/types").UrlParser;
17
17
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
18
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
19
19
  base64Decoder: import("@smithy/types").Decoder;
20
20
  base64Encoder: (_input: Uint8Array | string) => string;
21
21
  utf8Decoder: import("@smithy/types").Decoder;
@@ -22,6 +22,7 @@ export declare const getRuntimeConfig: (config: SustainabilityClientConfig) => {
22
22
  defaultNamespace?: string;
23
23
  };
24
24
  serviceId: string;
25
+ sha256: import("@smithy/types").HashConstructor;
25
26
  signerConstructor: typeof SignatureV4MultiRegion | (new (options: import("@smithy/signature-v4").SignatureV4Init & import("@smithy/signature-v4").SignatureV4CryptoInit) => import("@smithy/types").RequestSigner);
26
27
  urlParser: import("@smithy/types").UrlParser;
27
28
  utf8Decoder: import("@smithy/types").Decoder;