@aws-sdk/client-forecastquery 3.35.0 → 3.36.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist-cjs/Forecastquery.js +0 -1
  3. package/dist-cjs/ForecastqueryClient.js +0 -1
  4. package/dist-cjs/commands/QueryForecastCommand.js +0 -1
  5. package/dist-cjs/endpoints.js +0 -1
  6. package/dist-cjs/index.js +0 -1
  7. package/dist-cjs/models/index.js +0 -1
  8. package/dist-cjs/models/models_0.js +0 -1
  9. package/dist-cjs/protocols/Aws_json1_1.js +0 -1
  10. package/dist-cjs/runtimeConfig.browser.js +2 -3
  11. package/dist-cjs/runtimeConfig.js +3 -4
  12. package/dist-cjs/runtimeConfig.native.js +0 -1
  13. package/dist-cjs/runtimeConfig.shared.js +0 -1
  14. package/dist-es/Forecastquery.js +0 -1
  15. package/dist-es/ForecastqueryClient.js +0 -1
  16. package/dist-es/commands/QueryForecastCommand.js +0 -1
  17. package/dist-es/endpoints.js +0 -1
  18. package/dist-es/index.js +0 -1
  19. package/dist-es/models/index.js +0 -1
  20. package/dist-es/models/models_0.js +0 -1
  21. package/dist-es/protocols/Aws_json1_1.js +0 -1
  22. package/dist-es/runtimeConfig.browser.js +1 -2
  23. package/dist-es/runtimeConfig.js +2 -3
  24. package/dist-es/runtimeConfig.native.js +0 -1
  25. package/dist-es/runtimeConfig.shared.js +0 -1
  26. package/package.json +33 -30
  27. package/dist-cjs/Forecastquery.js.map +0 -1
  28. package/dist-cjs/ForecastqueryClient.js.map +0 -1
  29. package/dist-cjs/commands/QueryForecastCommand.js.map +0 -1
  30. package/dist-cjs/endpoints.js.map +0 -1
  31. package/dist-cjs/index.js.map +0 -1
  32. package/dist-cjs/models/index.js.map +0 -1
  33. package/dist-cjs/models/models_0.js.map +0 -1
  34. package/dist-cjs/protocols/Aws_json1_1.js.map +0 -1
  35. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  36. package/dist-cjs/runtimeConfig.js.map +0 -1
  37. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  38. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  39. package/dist-es/Forecastquery.js.map +0 -1
  40. package/dist-es/ForecastqueryClient.js.map +0 -1
  41. package/dist-es/commands/QueryForecastCommand.js.map +0 -1
  42. package/dist-es/endpoints.js.map +0 -1
  43. package/dist-es/index.js.map +0 -1
  44. package/dist-es/models/index.js.map +0 -1
  45. package/dist-es/models/models_0.js.map +0 -1
  46. package/dist-es/protocols/Aws_json1_1.js.map +0 -1
  47. package/dist-es/runtimeConfig.browser.js.map +0 -1
  48. package/dist-es/runtimeConfig.js.map +0 -1
  49. package/dist-es/runtimeConfig.native.js.map +0 -1
  50. package/dist-es/runtimeConfig.shared.js.map +0 -1
  51. package/jest.config.js +0 -4
  52. package/src/Forecastquery.ts +0 -56
  53. package/src/ForecastqueryClient.ts +0 -237
  54. package/src/commands/QueryForecastCommand.ts +0 -106
  55. package/src/endpoints.ts +0 -73
  56. package/src/index.ts +0 -4
  57. package/src/models/index.ts +0 -1
  58. package/src/models/models_0.ts +0 -213
  59. package/src/protocols/Aws_json1_1.ts +0 -389
  60. package/src/runtimeConfig.browser.ts +0 -41
  61. package/src/runtimeConfig.native.ts +0 -17
  62. package/src/runtimeConfig.shared.ts +0 -17
  63. package/src/runtimeConfig.ts +0 -46
  64. package/tsconfig.es.json +0 -10
  65. package/tsconfig.json +0 -33
  66. package/tsconfig.types.json +0 -9
@@ -1,389 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import { expectString as __expectString, limitedParseDouble as __limitedParseDouble } from "@aws-sdk/smithy-client";
3
- import {
4
- Endpoint as __Endpoint,
5
- HeaderBag as __HeaderBag,
6
- MetadataBearer as __MetadataBearer,
7
- ResponseMetadata as __ResponseMetadata,
8
- SerdeContext as __SerdeContext,
9
- SmithyException as __SmithyException,
10
- } from "@aws-sdk/types";
11
-
12
- import { QueryForecastCommandInput, QueryForecastCommandOutput } from "../commands/QueryForecastCommand";
13
- import {
14
- DataPoint,
15
- Forecast,
16
- InvalidInputException,
17
- InvalidNextTokenException,
18
- LimitExceededException,
19
- QueryForecastRequest,
20
- QueryForecastResponse,
21
- ResourceInUseException,
22
- ResourceNotFoundException,
23
- } from "../models/models_0";
24
-
25
- export const serializeAws_json1_1QueryForecastCommand = async (
26
- input: QueryForecastCommandInput,
27
- context: __SerdeContext
28
- ): Promise<__HttpRequest> => {
29
- const headers: __HeaderBag = {
30
- "content-type": "application/x-amz-json-1.1",
31
- "x-amz-target": "AmazonForecastRuntime.QueryForecast",
32
- };
33
- let body: any;
34
- body = JSON.stringify(serializeAws_json1_1QueryForecastRequest(input, context));
35
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
- };
37
-
38
- export const deserializeAws_json1_1QueryForecastCommand = async (
39
- output: __HttpResponse,
40
- context: __SerdeContext
41
- ): Promise<QueryForecastCommandOutput> => {
42
- if (output.statusCode >= 300) {
43
- return deserializeAws_json1_1QueryForecastCommandError(output, context);
44
- }
45
- const data: any = await parseBody(output.body, context);
46
- let contents: any = {};
47
- contents = deserializeAws_json1_1QueryForecastResponse(data, context);
48
- const response: QueryForecastCommandOutput = {
49
- $metadata: deserializeMetadata(output),
50
- ...contents,
51
- };
52
- return Promise.resolve(response);
53
- };
54
-
55
- const deserializeAws_json1_1QueryForecastCommandError = async (
56
- output: __HttpResponse,
57
- context: __SerdeContext
58
- ): Promise<QueryForecastCommandOutput> => {
59
- const parsedOutput: any = {
60
- ...output,
61
- body: await parseBody(output.body, context),
62
- };
63
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
64
- let errorCode = "UnknownError";
65
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
66
- switch (errorCode) {
67
- case "InvalidInputException":
68
- case "com.amazonaws.forecastquery#InvalidInputException":
69
- response = {
70
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
71
- name: errorCode,
72
- $metadata: deserializeMetadata(output),
73
- };
74
- break;
75
- case "InvalidNextTokenException":
76
- case "com.amazonaws.forecastquery#InvalidNextTokenException":
77
- response = {
78
- ...(await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)),
79
- name: errorCode,
80
- $metadata: deserializeMetadata(output),
81
- };
82
- break;
83
- case "LimitExceededException":
84
- case "com.amazonaws.forecastquery#LimitExceededException":
85
- response = {
86
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
87
- name: errorCode,
88
- $metadata: deserializeMetadata(output),
89
- };
90
- break;
91
- case "ResourceInUseException":
92
- case "com.amazonaws.forecastquery#ResourceInUseException":
93
- response = {
94
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
95
- name: errorCode,
96
- $metadata: deserializeMetadata(output),
97
- };
98
- break;
99
- case "ResourceNotFoundException":
100
- case "com.amazonaws.forecastquery#ResourceNotFoundException":
101
- response = {
102
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
103
- name: errorCode,
104
- $metadata: deserializeMetadata(output),
105
- };
106
- break;
107
- default:
108
- const parsedBody = parsedOutput.body;
109
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
110
- response = {
111
- ...parsedBody,
112
- name: `${errorCode}`,
113
- message: parsedBody.message || parsedBody.Message || errorCode,
114
- $fault: "client",
115
- $metadata: deserializeMetadata(output),
116
- } as any;
117
- }
118
- const message = response.message || response.Message || errorCode;
119
- response.message = message;
120
- delete response.Message;
121
- return Promise.reject(Object.assign(new Error(message), response));
122
- };
123
-
124
- const deserializeAws_json1_1InvalidInputExceptionResponse = async (
125
- parsedOutput: any,
126
- context: __SerdeContext
127
- ): Promise<InvalidInputException> => {
128
- const body = parsedOutput.body;
129
- const deserialized: any = deserializeAws_json1_1InvalidInputException(body, context);
130
- const contents: InvalidInputException = {
131
- name: "InvalidInputException",
132
- $fault: "client",
133
- $metadata: deserializeMetadata(parsedOutput),
134
- ...deserialized,
135
- };
136
- return contents;
137
- };
138
-
139
- const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (
140
- parsedOutput: any,
141
- context: __SerdeContext
142
- ): Promise<InvalidNextTokenException> => {
143
- const body = parsedOutput.body;
144
- const deserialized: any = deserializeAws_json1_1InvalidNextTokenException(body, context);
145
- const contents: InvalidNextTokenException = {
146
- name: "InvalidNextTokenException",
147
- $fault: "client",
148
- $metadata: deserializeMetadata(parsedOutput),
149
- ...deserialized,
150
- };
151
- return contents;
152
- };
153
-
154
- const deserializeAws_json1_1LimitExceededExceptionResponse = async (
155
- parsedOutput: any,
156
- context: __SerdeContext
157
- ): Promise<LimitExceededException> => {
158
- const body = parsedOutput.body;
159
- const deserialized: any = deserializeAws_json1_1LimitExceededException(body, context);
160
- const contents: LimitExceededException = {
161
- name: "LimitExceededException",
162
- $fault: "client",
163
- $metadata: deserializeMetadata(parsedOutput),
164
- ...deserialized,
165
- };
166
- return contents;
167
- };
168
-
169
- const deserializeAws_json1_1ResourceInUseExceptionResponse = async (
170
- parsedOutput: any,
171
- context: __SerdeContext
172
- ): Promise<ResourceInUseException> => {
173
- const body = parsedOutput.body;
174
- const deserialized: any = deserializeAws_json1_1ResourceInUseException(body, context);
175
- const contents: ResourceInUseException = {
176
- name: "ResourceInUseException",
177
- $fault: "client",
178
- $metadata: deserializeMetadata(parsedOutput),
179
- ...deserialized,
180
- };
181
- return contents;
182
- };
183
-
184
- const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (
185
- parsedOutput: any,
186
- context: __SerdeContext
187
- ): Promise<ResourceNotFoundException> => {
188
- const body = parsedOutput.body;
189
- const deserialized: any = deserializeAws_json1_1ResourceNotFoundException(body, context);
190
- const contents: ResourceNotFoundException = {
191
- name: "ResourceNotFoundException",
192
- $fault: "client",
193
- $metadata: deserializeMetadata(parsedOutput),
194
- ...deserialized,
195
- };
196
- return contents;
197
- };
198
-
199
- const serializeAws_json1_1Filters = (input: { [key: string]: string }, context: __SerdeContext): any => {
200
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
201
- if (value === null) {
202
- return acc;
203
- }
204
- return {
205
- ...acc,
206
- [key]: value,
207
- };
208
- }, {});
209
- };
210
-
211
- const serializeAws_json1_1QueryForecastRequest = (input: QueryForecastRequest, context: __SerdeContext): any => {
212
- return {
213
- ...(input.EndDate !== undefined && input.EndDate !== null && { EndDate: input.EndDate }),
214
- ...(input.Filters !== undefined &&
215
- input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }),
216
- ...(input.ForecastArn !== undefined && input.ForecastArn !== null && { ForecastArn: input.ForecastArn }),
217
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
218
- ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }),
219
- };
220
- };
221
-
222
- const deserializeAws_json1_1DataPoint = (output: any, context: __SerdeContext): DataPoint => {
223
- return {
224
- Timestamp: __expectString(output.Timestamp),
225
- Value: __limitedParseDouble(output.Value),
226
- } as any;
227
- };
228
-
229
- const deserializeAws_json1_1Forecast = (output: any, context: __SerdeContext): Forecast => {
230
- return {
231
- Predictions:
232
- output.Predictions !== undefined && output.Predictions !== null
233
- ? deserializeAws_json1_1Predictions(output.Predictions, context)
234
- : undefined,
235
- } as any;
236
- };
237
-
238
- const deserializeAws_json1_1InvalidInputException = (output: any, context: __SerdeContext): InvalidInputException => {
239
- return {
240
- Message: __expectString(output.Message),
241
- } as any;
242
- };
243
-
244
- const deserializeAws_json1_1InvalidNextTokenException = (
245
- output: any,
246
- context: __SerdeContext
247
- ): InvalidNextTokenException => {
248
- return {
249
- Message: __expectString(output.Message),
250
- } as any;
251
- };
252
-
253
- const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => {
254
- return {
255
- Message: __expectString(output.Message),
256
- } as any;
257
- };
258
-
259
- const deserializeAws_json1_1Predictions = (output: any, context: __SerdeContext): { [key: string]: DataPoint[] } => {
260
- return Object.entries(output).reduce((acc: { [key: string]: DataPoint[] }, [key, value]: [string, any]) => {
261
- if (value === null) {
262
- return acc;
263
- }
264
- return {
265
- ...acc,
266
- [key]: deserializeAws_json1_1TimeSeries(value, context),
267
- };
268
- }, {});
269
- };
270
-
271
- const deserializeAws_json1_1QueryForecastResponse = (output: any, context: __SerdeContext): QueryForecastResponse => {
272
- return {
273
- Forecast:
274
- output.Forecast !== undefined && output.Forecast !== null
275
- ? deserializeAws_json1_1Forecast(output.Forecast, context)
276
- : undefined,
277
- } as any;
278
- };
279
-
280
- const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => {
281
- return {
282
- Message: __expectString(output.Message),
283
- } as any;
284
- };
285
-
286
- const deserializeAws_json1_1ResourceNotFoundException = (
287
- output: any,
288
- context: __SerdeContext
289
- ): ResourceNotFoundException => {
290
- return {
291
- Message: __expectString(output.Message),
292
- } as any;
293
- };
294
-
295
- const deserializeAws_json1_1TimeSeries = (output: any, context: __SerdeContext): DataPoint[] => {
296
- return (output || [])
297
- .filter((e: any) => e != null)
298
- .map((entry: any) => {
299
- if (entry === null) {
300
- return null as any;
301
- }
302
- return deserializeAws_json1_1DataPoint(entry, context);
303
- });
304
- };
305
-
306
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
307
- httpStatusCode: output.statusCode,
308
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
309
- extendedRequestId: output.headers["x-amz-id-2"],
310
- cfId: output.headers["x-amz-cf-id"],
311
- });
312
-
313
- // Collect low-level response body stream to Uint8Array.
314
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
315
- if (streamBody instanceof Uint8Array) {
316
- return Promise.resolve(streamBody);
317
- }
318
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
319
- };
320
-
321
- // Encode Uint8Array data into string with utf-8.
322
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
323
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
324
-
325
- const buildHttpRpcRequest = async (
326
- context: __SerdeContext,
327
- headers: __HeaderBag,
328
- path: string,
329
- resolvedHostname: string | undefined,
330
- body: any
331
- ): Promise<__HttpRequest> => {
332
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
333
- const contents: any = {
334
- protocol,
335
- hostname,
336
- port,
337
- method: "POST",
338
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
339
- headers,
340
- };
341
- if (resolvedHostname !== undefined) {
342
- contents.hostname = resolvedHostname;
343
- }
344
- if (body !== undefined) {
345
- contents.body = body;
346
- }
347
- return new __HttpRequest(contents);
348
- };
349
-
350
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
351
- collectBodyString(streamBody, context).then((encoded) => {
352
- if (encoded.length) {
353
- return JSON.parse(encoded);
354
- }
355
- return {};
356
- });
357
-
358
- /**
359
- * Load an error code for the aws.rest-json-1.1 protocol.
360
- */
361
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
362
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
363
-
364
- const sanitizeErrorCode = (rawValue: string): string => {
365
- let cleanValue = rawValue;
366
- if (cleanValue.indexOf(":") >= 0) {
367
- cleanValue = cleanValue.split(":")[0];
368
- }
369
- if (cleanValue.indexOf("#") >= 0) {
370
- cleanValue = cleanValue.split("#")[1];
371
- }
372
- return cleanValue;
373
- };
374
-
375
- const headerKey = findKey(output.headers, "x-amzn-errortype");
376
- if (headerKey !== undefined) {
377
- return sanitizeErrorCode(output.headers[headerKey]);
378
- }
379
-
380
- if (data.code !== undefined) {
381
- return sanitizeErrorCode(data.code);
382
- }
383
-
384
- if (data["__type"] !== undefined) {
385
- return sanitizeErrorCode(data["__type"]);
386
- }
387
-
388
- return "";
389
- };
@@ -1,41 +0,0 @@
1
- import { Sha256 } from "@aws-crypto/sha256-browser";
2
- import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
3
- import { invalidProvider } from "@aws-sdk/invalid-dependency";
4
- import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
5
- import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
6
- import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
7
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
8
- import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
9
-
10
- // @ts-ignore: package.json will be imported from dist folders
11
- import packageInfo from "../package.json";
12
- import { ForecastqueryClientConfig } from "./ForecastqueryClient";
13
- import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
14
-
15
- /**
16
- * @internal
17
- */
18
- export const getRuntimeConfig = (config: ForecastqueryClientConfig) => {
19
- const clientSharedValues = getSharedRuntimeConfig(config);
20
- return {
21
- ...clientSharedValues,
22
- ...config,
23
- runtime: "browser",
24
- base64Decoder: config?.base64Decoder ?? fromBase64,
25
- base64Encoder: config?.base64Encoder ?? toBase64,
26
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
27
- credentialDefaultProvider:
28
- config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
29
- defaultUserAgentProvider:
30
- config?.defaultUserAgentProvider ??
31
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
32
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
33
- region: config?.region ?? invalidProvider("Region is missing"),
34
- requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
35
- retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
36
- sha256: config?.sha256 ?? Sha256,
37
- streamCollector: config?.streamCollector ?? streamCollector,
38
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
39
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
40
- };
41
- };
@@ -1,17 +0,0 @@
1
- import { Sha256 } from "@aws-crypto/sha256-js";
2
-
3
- import { ForecastqueryClientConfig } from "./ForecastqueryClient";
4
- import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
5
-
6
- /**
7
- * @internal
8
- */
9
- export const getRuntimeConfig = (config: ForecastqueryClientConfig) => {
10
- const browserDefaults = getBrowserRuntimeConfig(config);
11
- return {
12
- ...browserDefaults,
13
- ...config,
14
- runtime: "react-native",
15
- sha256: config?.sha256 ?? Sha256,
16
- };
17
- };
@@ -1,17 +0,0 @@
1
- import { Logger as __Logger } from "@aws-sdk/types";
2
- import { parseUrl } from "@aws-sdk/url-parser";
3
-
4
- import { defaultRegionInfoProvider } from "./endpoints";
5
- import { ForecastqueryClientConfig } from "./ForecastqueryClient";
6
-
7
- /**
8
- * @internal
9
- */
10
- export const getRuntimeConfig = (config: ForecastqueryClientConfig) => ({
11
- apiVersion: "2018-06-26",
12
- disableHostPrefix: config?.disableHostPrefix ?? false,
13
- logger: config?.logger ?? ({} as __Logger),
14
- regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
15
- serviceId: config?.serviceId ?? "forecastquery",
16
- urlParser: config?.urlParser ?? parseUrl,
17
- });
@@ -1,46 +0,0 @@
1
- import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
2
- import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
3
- import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
4
- import { Hash } from "@aws-sdk/hash-node";
5
- import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
6
- import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
7
- import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
8
- import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
9
- import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
10
- import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
11
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
12
- import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
13
-
14
- // @ts-ignore: package.json will be imported from dist folders
15
- import packageInfo from "../package.json";
16
- import { ForecastqueryClientConfig } from "./ForecastqueryClient";
17
- import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
18
-
19
- /**
20
- * @internal
21
- */
22
- export const getRuntimeConfig = (config: ForecastqueryClientConfig) => {
23
- emitWarningIfUnsupportedVersion(process.version);
24
- const clientSharedValues = getSharedRuntimeConfig(config);
25
- return {
26
- ...clientSharedValues,
27
- ...config,
28
- runtime: "node",
29
- base64Decoder: config?.base64Decoder ?? fromBase64,
30
- base64Encoder: config?.base64Encoder ?? toBase64,
31
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
32
- credentialDefaultProvider:
33
- config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
34
- defaultUserAgentProvider:
35
- config?.defaultUserAgentProvider ??
36
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
37
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
38
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
39
- requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
40
- retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
41
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
42
- streamCollector: config?.streamCollector ?? streamCollector,
43
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
44
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
45
- };
46
- };
package/tsconfig.es.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "module": "esnext",
6
- "moduleResolution": "node",
7
- "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"],
8
- "outDir": "dist-es"
9
- }
10
- }
package/tsconfig.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "alwaysStrict": true,
4
- "target": "ES2018",
5
- "module": "commonjs",
6
- "strict": true,
7
- "sourceMap": true,
8
- "downlevelIteration": true,
9
- "importHelpers": true,
10
- "noEmitHelpers": true,
11
- "incremental": true,
12
- "resolveJsonModule": true,
13
- "esModuleInterop": true,
14
- "rootDir": "src",
15
- "outDir": "dist-cjs",
16
- "removeComments": true
17
- },
18
- "typedocOptions": {
19
- "exclude": ["**/node_modules/**", "**/*.spec.ts", "**/protocols/*.ts", "**/e2e/*.ts", "**/endpoints.ts"],
20
- "excludeNotExported": true,
21
- "excludePrivate": true,
22
- "hideGenerator": true,
23
- "ignoreCompilerErrors": true,
24
- "includeDeclarations": true,
25
- "stripInternal": true,
26
- "readme": "README.md",
27
- "mode": "file",
28
- "out": "docs",
29
- "theme": "minimal",
30
- "plugin": ["@aws-sdk/client-documentation-generator"]
31
- },
32
- "exclude": ["test/**/*"]
33
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "compilerOptions": {
4
- "removeComments": false,
5
- "declaration": true,
6
- "declarationDir": "dist-types"
7
- },
8
- "exclude": ["test/**/*", "dist-types/**/*"]
9
- }