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