@aws-sdk/client-forecastquery 3.489.0 → 3.495.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.
@@ -1,15 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Forecastquery = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- const QueryForecastCommand_1 = require("./commands/QueryForecastCommand");
6
- const QueryWhatIfForecastCommand_1 = require("./commands/QueryWhatIfForecastCommand");
7
- const ForecastqueryClient_1 = require("./ForecastqueryClient");
8
- const commands = {
9
- QueryForecastCommand: QueryForecastCommand_1.QueryForecastCommand,
10
- QueryWhatIfForecastCommand: QueryWhatIfForecastCommand_1.QueryWhatIfForecastCommand,
11
- };
12
- class Forecastquery extends ForecastqueryClient_1.ForecastqueryClient {
13
- }
14
- exports.Forecastquery = Forecastquery;
15
- (0, smithy_client_1.createAggregatedClient)(commands, Forecastquery);
1
+ module.exports = require("./index.js");
@@ -1,43 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForecastqueryClient = exports.__Client = void 0;
4
- const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
5
- const middleware_logger_1 = require("@aws-sdk/middleware-logger");
6
- const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
7
- const middleware_signing_1 = require("@aws-sdk/middleware-signing");
8
- const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
9
- const config_resolver_1 = require("@smithy/config-resolver");
10
- const middleware_content_length_1 = require("@smithy/middleware-content-length");
11
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
12
- const middleware_retry_1 = require("@smithy/middleware-retry");
13
- const smithy_client_1 = require("@smithy/smithy-client");
14
- Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
15
- const EndpointParameters_1 = require("./endpoint/EndpointParameters");
16
- const runtimeConfig_1 = require("./runtimeConfig");
17
- const runtimeExtensions_1 = require("./runtimeExtensions");
18
- class ForecastqueryClient extends smithy_client_1.Client {
19
- constructor(...[configuration]) {
20
- const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
21
- const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
22
- const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1);
23
- const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2);
24
- const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3);
25
- const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
26
- const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5);
27
- const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6);
28
- const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
29
- super(_config_8);
30
- this.config = _config_8;
31
- this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
32
- this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
33
- this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
34
- this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
35
- this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
36
- this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config));
37
- this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
38
- }
39
- destroy() {
40
- super.destroy();
41
- }
42
- }
43
- exports.ForecastqueryClient = ForecastqueryClient;
1
+ module.exports = require("./index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryForecastCommand = exports.$Command = void 0;
4
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
- const middleware_serde_1 = require("@smithy/middleware-serde");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- const EndpointParameters_1 = require("../endpoint/EndpointParameters");
9
- const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
10
- class QueryForecastCommand extends smithy_client_1.Command
11
- .classBuilder()
12
- .ep({
13
- ...EndpointParameters_1.commonParams,
14
- })
15
- .m(function (Command, cs, config, o) {
16
- return [
17
- (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
18
- (0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
19
- ];
20
- })
21
- .s("AmazonForecastRuntime", "QueryForecast", {})
22
- .n("ForecastqueryClient", "QueryForecastCommand")
23
- .f(void 0, void 0)
24
- .ser(Aws_json1_1_1.se_QueryForecastCommand)
25
- .de(Aws_json1_1_1.de_QueryForecastCommand)
26
- .build() {
27
- }
28
- exports.QueryForecastCommand = QueryForecastCommand;
1
+ module.exports = require("../index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryWhatIfForecastCommand = exports.$Command = void 0;
4
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
- const middleware_serde_1 = require("@smithy/middleware-serde");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- const EndpointParameters_1 = require("../endpoint/EndpointParameters");
9
- const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
10
- class QueryWhatIfForecastCommand extends smithy_client_1.Command
11
- .classBuilder()
12
- .ep({
13
- ...EndpointParameters_1.commonParams,
14
- })
15
- .m(function (Command, cs, config, o) {
16
- return [
17
- (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
18
- (0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
19
- ];
20
- })
21
- .s("AmazonForecastRuntime", "QueryWhatIfForecast", {})
22
- .n("ForecastqueryClient", "QueryWhatIfForecastCommand")
23
- .f(void 0, void 0)
24
- .ser(Aws_json1_1_1.se_QueryWhatIfForecastCommand)
25
- .de(Aws_json1_1_1.de_QueryWhatIfForecastCommand)
26
- .build() {
27
- }
28
- exports.QueryWhatIfForecastCommand = QueryWhatIfForecastCommand;
1
+ module.exports = require("../index.js");
@@ -1,5 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./QueryForecastCommand"), exports);
5
- tslib_1.__exportStar(require("./QueryWhatIfForecastCommand"), exports);
1
+ module.exports = require("../index.js");
@@ -1,18 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commonParams = exports.resolveClientEndpointParameters = void 0;
4
- const resolveClientEndpointParameters = (options) => {
5
- return {
6
- ...options,
7
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
8
- useFipsEndpoint: options.useFipsEndpoint ?? false,
9
- defaultSigningName: "forecast",
10
- };
11
- };
12
- exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
13
- exports.commonParams = {
14
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
15
- Endpoint: { type: "builtInParams", name: "endpoint" },
16
- Region: { type: "builtInParams", name: "region" },
17
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
18
- };
1
+ module.exports = require("../index.js");
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,11 +1,554 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForecastqueryServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./ForecastqueryClient"), exports);
6
- tslib_1.__exportStar(require("./Forecastquery"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./models"), exports);
9
- require("@aws-sdk/util-endpoints");
10
- var ForecastqueryServiceException_1 = require("./models/ForecastqueryServiceException");
11
- Object.defineProperty(exports, "ForecastqueryServiceException", { enumerable: true, get: function () { return ForecastqueryServiceException_1.ForecastqueryServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ Forecastquery: () => Forecastquery,
25
+ ForecastqueryClient: () => ForecastqueryClient,
26
+ ForecastqueryServiceException: () => ForecastqueryServiceException,
27
+ InvalidInputException: () => InvalidInputException,
28
+ InvalidNextTokenException: () => InvalidNextTokenException,
29
+ LimitExceededException: () => LimitExceededException,
30
+ QueryForecastCommand: () => QueryForecastCommand,
31
+ QueryWhatIfForecastCommand: () => QueryWhatIfForecastCommand,
32
+ ResourceInUseException: () => ResourceInUseException,
33
+ ResourceNotFoundException: () => ResourceNotFoundException,
34
+ __Client: () => import_smithy_client.Client
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // src/ForecastqueryClient.ts
39
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
40
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
41
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
42
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
43
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
44
+ var import_config_resolver = require("@smithy/config-resolver");
45
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
46
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
47
+ var import_middleware_retry = require("@smithy/middleware-retry");
48
+
49
+
50
+ // src/endpoint/EndpointParameters.ts
51
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
52
+ return {
53
+ ...options,
54
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
55
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
56
+ defaultSigningName: "forecast"
57
+ };
58
+ }, "resolveClientEndpointParameters");
59
+ var commonParams = {
60
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61
+ Endpoint: { type: "builtInParams", name: "endpoint" },
62
+ Region: { type: "builtInParams", name: "region" },
63
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
64
+ };
65
+
66
+ // src/ForecastqueryClient.ts
67
+ var import_runtimeConfig = require("././runtimeConfig");
68
+
69
+ // src/runtimeExtensions.ts
70
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
71
+ var import_protocol_http = require("@smithy/protocol-http");
72
+ var import_smithy_client = require("@smithy/smithy-client");
73
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
74
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
75
+ const extensionConfiguration = {
76
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
77
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
78
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
79
+ };
80
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
81
+ return {
82
+ ...runtimeConfig,
83
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
84
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
85
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
86
+ };
87
+ }, "resolveRuntimeExtensions");
88
+
89
+ // src/ForecastqueryClient.ts
90
+ var _ForecastqueryClient = class _ForecastqueryClient extends import_smithy_client.Client {
91
+ constructor(...[configuration]) {
92
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
93
+ const _config_1 = resolveClientEndpointParameters(_config_0);
94
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
95
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
96
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
97
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
98
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
99
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
100
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
101
+ super(_config_8);
102
+ this.config = _config_8;
103
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
104
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
105
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
106
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
107
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
108
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
109
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
110
+ }
111
+ /**
112
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
113
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
114
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
115
+ */
116
+ destroy() {
117
+ super.destroy();
118
+ }
119
+ };
120
+ __name(_ForecastqueryClient, "ForecastqueryClient");
121
+ var ForecastqueryClient = _ForecastqueryClient;
122
+
123
+ // src/Forecastquery.ts
124
+
125
+
126
+ // src/commands/QueryForecastCommand.ts
127
+
128
+ var import_middleware_serde = require("@smithy/middleware-serde");
129
+
130
+ var import_types = require("@smithy/types");
131
+
132
+ // src/protocols/Aws_json1_1.ts
133
+
134
+
135
+
136
+ // src/models/ForecastqueryServiceException.ts
137
+
138
+ var _ForecastqueryServiceException = class _ForecastqueryServiceException extends import_smithy_client.ServiceException {
139
+ /**
140
+ * @internal
141
+ */
142
+ constructor(options) {
143
+ super(options);
144
+ Object.setPrototypeOf(this, _ForecastqueryServiceException.prototype);
145
+ }
146
+ };
147
+ __name(_ForecastqueryServiceException, "ForecastqueryServiceException");
148
+ var ForecastqueryServiceException = _ForecastqueryServiceException;
149
+
150
+ // src/models/models_0.ts
151
+ var _InvalidInputException = class _InvalidInputException extends ForecastqueryServiceException {
152
+ /**
153
+ * @internal
154
+ */
155
+ constructor(opts) {
156
+ super({
157
+ name: "InvalidInputException",
158
+ $fault: "client",
159
+ ...opts
160
+ });
161
+ this.name = "InvalidInputException";
162
+ this.$fault = "client";
163
+ Object.setPrototypeOf(this, _InvalidInputException.prototype);
164
+ this.Message = opts.Message;
165
+ }
166
+ };
167
+ __name(_InvalidInputException, "InvalidInputException");
168
+ var InvalidInputException = _InvalidInputException;
169
+ var _InvalidNextTokenException = class _InvalidNextTokenException extends ForecastqueryServiceException {
170
+ /**
171
+ * @internal
172
+ */
173
+ constructor(opts) {
174
+ super({
175
+ name: "InvalidNextTokenException",
176
+ $fault: "client",
177
+ ...opts
178
+ });
179
+ this.name = "InvalidNextTokenException";
180
+ this.$fault = "client";
181
+ Object.setPrototypeOf(this, _InvalidNextTokenException.prototype);
182
+ this.Message = opts.Message;
183
+ }
184
+ };
185
+ __name(_InvalidNextTokenException, "InvalidNextTokenException");
186
+ var InvalidNextTokenException = _InvalidNextTokenException;
187
+ var _LimitExceededException = class _LimitExceededException extends ForecastqueryServiceException {
188
+ /**
189
+ * @internal
190
+ */
191
+ constructor(opts) {
192
+ super({
193
+ name: "LimitExceededException",
194
+ $fault: "client",
195
+ ...opts
196
+ });
197
+ this.name = "LimitExceededException";
198
+ this.$fault = "client";
199
+ Object.setPrototypeOf(this, _LimitExceededException.prototype);
200
+ this.Message = opts.Message;
201
+ }
202
+ };
203
+ __name(_LimitExceededException, "LimitExceededException");
204
+ var LimitExceededException = _LimitExceededException;
205
+ var _ResourceInUseException = class _ResourceInUseException extends ForecastqueryServiceException {
206
+ /**
207
+ * @internal
208
+ */
209
+ constructor(opts) {
210
+ super({
211
+ name: "ResourceInUseException",
212
+ $fault: "client",
213
+ ...opts
214
+ });
215
+ this.name = "ResourceInUseException";
216
+ this.$fault = "client";
217
+ Object.setPrototypeOf(this, _ResourceInUseException.prototype);
218
+ this.Message = opts.Message;
219
+ }
220
+ };
221
+ __name(_ResourceInUseException, "ResourceInUseException");
222
+ var ResourceInUseException = _ResourceInUseException;
223
+ var _ResourceNotFoundException = class _ResourceNotFoundException extends ForecastqueryServiceException {
224
+ /**
225
+ * @internal
226
+ */
227
+ constructor(opts) {
228
+ super({
229
+ name: "ResourceNotFoundException",
230
+ $fault: "client",
231
+ ...opts
232
+ });
233
+ this.name = "ResourceNotFoundException";
234
+ this.$fault = "client";
235
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
236
+ this.Message = opts.Message;
237
+ }
238
+ };
239
+ __name(_ResourceNotFoundException, "ResourceNotFoundException");
240
+ var ResourceNotFoundException = _ResourceNotFoundException;
241
+
242
+ // src/protocols/Aws_json1_1.ts
243
+ var se_QueryForecastCommand = /* @__PURE__ */ __name(async (input, context) => {
244
+ const headers = sharedHeaders("QueryForecast");
245
+ let body;
246
+ body = JSON.stringify((0, import_smithy_client._json)(input));
247
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
248
+ }, "se_QueryForecastCommand");
249
+ var se_QueryWhatIfForecastCommand = /* @__PURE__ */ __name(async (input, context) => {
250
+ const headers = sharedHeaders("QueryWhatIfForecast");
251
+ let body;
252
+ body = JSON.stringify((0, import_smithy_client._json)(input));
253
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
254
+ }, "se_QueryWhatIfForecastCommand");
255
+ var de_QueryForecastCommand = /* @__PURE__ */ __name(async (output, context) => {
256
+ if (output.statusCode >= 300) {
257
+ return de_QueryForecastCommandError(output, context);
258
+ }
259
+ const data = await parseBody(output.body, context);
260
+ let contents = {};
261
+ contents = de_QueryForecastResponse(data, context);
262
+ const response = {
263
+ $metadata: deserializeMetadata(output),
264
+ ...contents
265
+ };
266
+ return response;
267
+ }, "de_QueryForecastCommand");
268
+ var de_QueryForecastCommandError = /* @__PURE__ */ __name(async (output, context) => {
269
+ const parsedOutput = {
270
+ ...output,
271
+ body: await parseErrorBody(output.body, context)
272
+ };
273
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
274
+ switch (errorCode) {
275
+ case "InvalidInputException":
276
+ case "com.amazonaws.forecastquery#InvalidInputException":
277
+ throw await de_InvalidInputExceptionRes(parsedOutput, context);
278
+ case "InvalidNextTokenException":
279
+ case "com.amazonaws.forecastquery#InvalidNextTokenException":
280
+ throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
281
+ case "LimitExceededException":
282
+ case "com.amazonaws.forecastquery#LimitExceededException":
283
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
284
+ case "ResourceInUseException":
285
+ case "com.amazonaws.forecastquery#ResourceInUseException":
286
+ throw await de_ResourceInUseExceptionRes(parsedOutput, context);
287
+ case "ResourceNotFoundException":
288
+ case "com.amazonaws.forecastquery#ResourceNotFoundException":
289
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
290
+ default:
291
+ const parsedBody = parsedOutput.body;
292
+ return throwDefaultError({
293
+ output,
294
+ parsedBody,
295
+ errorCode
296
+ });
297
+ }
298
+ }, "de_QueryForecastCommandError");
299
+ var de_QueryWhatIfForecastCommand = /* @__PURE__ */ __name(async (output, context) => {
300
+ if (output.statusCode >= 300) {
301
+ return de_QueryWhatIfForecastCommandError(output, context);
302
+ }
303
+ const data = await parseBody(output.body, context);
304
+ let contents = {};
305
+ contents = de_QueryWhatIfForecastResponse(data, context);
306
+ const response = {
307
+ $metadata: deserializeMetadata(output),
308
+ ...contents
309
+ };
310
+ return response;
311
+ }, "de_QueryWhatIfForecastCommand");
312
+ var de_QueryWhatIfForecastCommandError = /* @__PURE__ */ __name(async (output, context) => {
313
+ const parsedOutput = {
314
+ ...output,
315
+ body: await parseErrorBody(output.body, context)
316
+ };
317
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
318
+ switch (errorCode) {
319
+ case "InvalidInputException":
320
+ case "com.amazonaws.forecastquery#InvalidInputException":
321
+ throw await de_InvalidInputExceptionRes(parsedOutput, context);
322
+ case "InvalidNextTokenException":
323
+ case "com.amazonaws.forecastquery#InvalidNextTokenException":
324
+ throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
325
+ case "LimitExceededException":
326
+ case "com.amazonaws.forecastquery#LimitExceededException":
327
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
328
+ case "ResourceInUseException":
329
+ case "com.amazonaws.forecastquery#ResourceInUseException":
330
+ throw await de_ResourceInUseExceptionRes(parsedOutput, context);
331
+ case "ResourceNotFoundException":
332
+ case "com.amazonaws.forecastquery#ResourceNotFoundException":
333
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
334
+ default:
335
+ const parsedBody = parsedOutput.body;
336
+ return throwDefaultError({
337
+ output,
338
+ parsedBody,
339
+ errorCode
340
+ });
341
+ }
342
+ }, "de_QueryWhatIfForecastCommandError");
343
+ var de_InvalidInputExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
344
+ const body = parsedOutput.body;
345
+ const deserialized = (0, import_smithy_client._json)(body);
346
+ const exception = new InvalidInputException({
347
+ $metadata: deserializeMetadata(parsedOutput),
348
+ ...deserialized
349
+ });
350
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
351
+ }, "de_InvalidInputExceptionRes");
352
+ var de_InvalidNextTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
353
+ const body = parsedOutput.body;
354
+ const deserialized = (0, import_smithy_client._json)(body);
355
+ const exception = new InvalidNextTokenException({
356
+ $metadata: deserializeMetadata(parsedOutput),
357
+ ...deserialized
358
+ });
359
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
360
+ }, "de_InvalidNextTokenExceptionRes");
361
+ var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
362
+ const body = parsedOutput.body;
363
+ const deserialized = (0, import_smithy_client._json)(body);
364
+ const exception = new LimitExceededException({
365
+ $metadata: deserializeMetadata(parsedOutput),
366
+ ...deserialized
367
+ });
368
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
369
+ }, "de_LimitExceededExceptionRes");
370
+ var de_ResourceInUseExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
371
+ const body = parsedOutput.body;
372
+ const deserialized = (0, import_smithy_client._json)(body);
373
+ const exception = new ResourceInUseException({
374
+ $metadata: deserializeMetadata(parsedOutput),
375
+ ...deserialized
376
+ });
377
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
378
+ }, "de_ResourceInUseExceptionRes");
379
+ var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
380
+ const body = parsedOutput.body;
381
+ const deserialized = (0, import_smithy_client._json)(body);
382
+ const exception = new ResourceNotFoundException({
383
+ $metadata: deserializeMetadata(parsedOutput),
384
+ ...deserialized
385
+ });
386
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
387
+ }, "de_ResourceNotFoundExceptionRes");
388
+ var de_DataPoint = /* @__PURE__ */ __name((output, context) => {
389
+ return (0, import_smithy_client.take)(output, {
390
+ Timestamp: import_smithy_client.expectString,
391
+ Value: import_smithy_client.limitedParseDouble
392
+ });
393
+ }, "de_DataPoint");
394
+ var de_Forecast = /* @__PURE__ */ __name((output, context) => {
395
+ return (0, import_smithy_client.take)(output, {
396
+ Predictions: (_) => de_Predictions(_, context)
397
+ });
398
+ }, "de_Forecast");
399
+ var de_Predictions = /* @__PURE__ */ __name((output, context) => {
400
+ return Object.entries(output).reduce((acc, [key, value]) => {
401
+ if (value === null) {
402
+ return acc;
403
+ }
404
+ acc[key] = de_TimeSeries(value, context);
405
+ return acc;
406
+ }, {});
407
+ }, "de_Predictions");
408
+ var de_QueryForecastResponse = /* @__PURE__ */ __name((output, context) => {
409
+ return (0, import_smithy_client.take)(output, {
410
+ Forecast: (_) => de_Forecast(_, context)
411
+ });
412
+ }, "de_QueryForecastResponse");
413
+ var de_QueryWhatIfForecastResponse = /* @__PURE__ */ __name((output, context) => {
414
+ return (0, import_smithy_client.take)(output, {
415
+ Forecast: (_) => de_Forecast(_, context)
416
+ });
417
+ }, "de_QueryWhatIfForecastResponse");
418
+ var de_TimeSeries = /* @__PURE__ */ __name((output, context) => {
419
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
420
+ return de_DataPoint(entry, context);
421
+ });
422
+ return retVal;
423
+ }, "de_TimeSeries");
424
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
425
+ httpStatusCode: output.statusCode,
426
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
427
+ extendedRequestId: output.headers["x-amz-id-2"],
428
+ cfId: output.headers["x-amz-cf-id"]
429
+ }), "deserializeMetadata");
430
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
431
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(ForecastqueryServiceException);
432
+ var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
433
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
434
+ const contents = {
435
+ protocol,
436
+ hostname,
437
+ port,
438
+ method: "POST",
439
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
440
+ headers
441
+ };
442
+ if (resolvedHostname !== void 0) {
443
+ contents.hostname = resolvedHostname;
444
+ }
445
+ if (body !== void 0) {
446
+ contents.body = body;
447
+ }
448
+ return new import_protocol_http.HttpRequest(contents);
449
+ }, "buildHttpRpcRequest");
450
+ function sharedHeaders(operation) {
451
+ return {
452
+ "content-type": "application/x-amz-json-1.1",
453
+ "x-amz-target": `AmazonForecastRuntime.${operation}`
454
+ };
455
+ }
456
+ __name(sharedHeaders, "sharedHeaders");
457
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
458
+ if (encoded.length) {
459
+ return JSON.parse(encoded);
460
+ }
461
+ return {};
462
+ }), "parseBody");
463
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
464
+ const value = await parseBody(errorBody, context);
465
+ value.message = value.message ?? value.Message;
466
+ return value;
467
+ }, "parseErrorBody");
468
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
469
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
470
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
471
+ let cleanValue = rawValue;
472
+ if (typeof cleanValue === "number") {
473
+ cleanValue = cleanValue.toString();
474
+ }
475
+ if (cleanValue.indexOf(",") >= 0) {
476
+ cleanValue = cleanValue.split(",")[0];
477
+ }
478
+ if (cleanValue.indexOf(":") >= 0) {
479
+ cleanValue = cleanValue.split(":")[0];
480
+ }
481
+ if (cleanValue.indexOf("#") >= 0) {
482
+ cleanValue = cleanValue.split("#")[1];
483
+ }
484
+ return cleanValue;
485
+ }, "sanitizeErrorCode");
486
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
487
+ if (headerKey !== void 0) {
488
+ return sanitizeErrorCode(output.headers[headerKey]);
489
+ }
490
+ if (data.code !== void 0) {
491
+ return sanitizeErrorCode(data.code);
492
+ }
493
+ if (data["__type"] !== void 0) {
494
+ return sanitizeErrorCode(data["__type"]);
495
+ }
496
+ }, "loadRestJsonErrorCode");
497
+
498
+ // src/commands/QueryForecastCommand.ts
499
+ var _QueryForecastCommand = class _QueryForecastCommand extends import_smithy_client.Command.classBuilder().ep({
500
+ ...commonParams
501
+ }).m(function(Command, cs, config, o) {
502
+ return [
503
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
504
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
505
+ ];
506
+ }).s("AmazonForecastRuntime", "QueryForecast", {}).n("ForecastqueryClient", "QueryForecastCommand").f(void 0, void 0).ser(se_QueryForecastCommand).de(de_QueryForecastCommand).build() {
507
+ };
508
+ __name(_QueryForecastCommand, "QueryForecastCommand");
509
+ var QueryForecastCommand = _QueryForecastCommand;
510
+
511
+ // src/commands/QueryWhatIfForecastCommand.ts
512
+
513
+
514
+
515
+
516
+ var _QueryWhatIfForecastCommand = class _QueryWhatIfForecastCommand extends import_smithy_client.Command.classBuilder().ep({
517
+ ...commonParams
518
+ }).m(function(Command, cs, config, o) {
519
+ return [
520
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
521
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
522
+ ];
523
+ }).s("AmazonForecastRuntime", "QueryWhatIfForecast", {}).n("ForecastqueryClient", "QueryWhatIfForecastCommand").f(void 0, void 0).ser(se_QueryWhatIfForecastCommand).de(de_QueryWhatIfForecastCommand).build() {
524
+ };
525
+ __name(_QueryWhatIfForecastCommand, "QueryWhatIfForecastCommand");
526
+ var QueryWhatIfForecastCommand = _QueryWhatIfForecastCommand;
527
+
528
+ // src/Forecastquery.ts
529
+ var commands = {
530
+ QueryForecastCommand,
531
+ QueryWhatIfForecastCommand
532
+ };
533
+ var _Forecastquery = class _Forecastquery extends ForecastqueryClient {
534
+ };
535
+ __name(_Forecastquery, "Forecastquery");
536
+ var Forecastquery = _Forecastquery;
537
+ (0, import_smithy_client.createAggregatedClient)(commands, Forecastquery);
538
+
539
+ // src/index.ts
540
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
541
+ // Annotate the CommonJS export names for ESM import in node:
542
+ 0 && (module.exports = {
543
+ Forecastquery,
544
+ ForecastqueryClient,
545
+ ForecastqueryServiceException,
546
+ InvalidInputException,
547
+ InvalidNextTokenException,
548
+ LimitExceededException,
549
+ QueryForecastCommand,
550
+ QueryWhatIfForecastCommand,
551
+ ResourceInUseException,
552
+ ResourceNotFoundException,
553
+ __Client
554
+ });
@@ -1,12 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForecastqueryServiceException = exports.__ServiceException = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
6
- class ForecastqueryServiceException extends smithy_client_1.ServiceException {
7
- constructor(options) {
8
- super(options);
9
- Object.setPrototypeOf(this, ForecastqueryServiceException.prototype);
10
- }
11
- }
12
- exports.ForecastqueryServiceException = ForecastqueryServiceException;
1
+ module.exports = require("../index.js");
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./models_0"), exports);
1
+ module.exports = require("../index.js");
@@ -1,74 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceNotFoundException = exports.ResourceInUseException = exports.LimitExceededException = exports.InvalidNextTokenException = exports.InvalidInputException = void 0;
4
- const ForecastqueryServiceException_1 = require("./ForecastqueryServiceException");
5
- class InvalidInputException extends ForecastqueryServiceException_1.ForecastqueryServiceException {
6
- constructor(opts) {
7
- super({
8
- name: "InvalidInputException",
9
- $fault: "client",
10
- ...opts,
11
- });
12
- this.name = "InvalidInputException";
13
- this.$fault = "client";
14
- Object.setPrototypeOf(this, InvalidInputException.prototype);
15
- this.Message = opts.Message;
16
- }
17
- }
18
- exports.InvalidInputException = InvalidInputException;
19
- class InvalidNextTokenException extends ForecastqueryServiceException_1.ForecastqueryServiceException {
20
- constructor(opts) {
21
- super({
22
- name: "InvalidNextTokenException",
23
- $fault: "client",
24
- ...opts,
25
- });
26
- this.name = "InvalidNextTokenException";
27
- this.$fault = "client";
28
- Object.setPrototypeOf(this, InvalidNextTokenException.prototype);
29
- this.Message = opts.Message;
30
- }
31
- }
32
- exports.InvalidNextTokenException = InvalidNextTokenException;
33
- class LimitExceededException extends ForecastqueryServiceException_1.ForecastqueryServiceException {
34
- constructor(opts) {
35
- super({
36
- name: "LimitExceededException",
37
- $fault: "client",
38
- ...opts,
39
- });
40
- this.name = "LimitExceededException";
41
- this.$fault = "client";
42
- Object.setPrototypeOf(this, LimitExceededException.prototype);
43
- this.Message = opts.Message;
44
- }
45
- }
46
- exports.LimitExceededException = LimitExceededException;
47
- class ResourceInUseException extends ForecastqueryServiceException_1.ForecastqueryServiceException {
48
- constructor(opts) {
49
- super({
50
- name: "ResourceInUseException",
51
- $fault: "client",
52
- ...opts,
53
- });
54
- this.name = "ResourceInUseException";
55
- this.$fault = "client";
56
- Object.setPrototypeOf(this, ResourceInUseException.prototype);
57
- this.Message = opts.Message;
58
- }
59
- }
60
- exports.ResourceInUseException = ResourceInUseException;
61
- class ResourceNotFoundException extends ForecastqueryServiceException_1.ForecastqueryServiceException {
62
- constructor(opts) {
63
- super({
64
- name: "ResourceNotFoundException",
65
- $fault: "client",
66
- ...opts,
67
- });
68
- this.name = "ResourceNotFoundException";
69
- this.$fault = "client";
70
- Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
71
- this.Message = opts.Message;
72
- }
73
- }
74
- exports.ResourceNotFoundException = ResourceNotFoundException;
1
+ module.exports = require("../index.js");
@@ -1,266 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_QueryWhatIfForecastCommand = exports.de_QueryForecastCommand = exports.se_QueryWhatIfForecastCommand = exports.se_QueryForecastCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const ForecastqueryServiceException_1 = require("../models/ForecastqueryServiceException");
7
- const models_0_1 = require("../models/models_0");
8
- const se_QueryForecastCommand = async (input, context) => {
9
- const headers = sharedHeaders("QueryForecast");
10
- let body;
11
- body = JSON.stringify((0, smithy_client_1._json)(input));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- exports.se_QueryForecastCommand = se_QueryForecastCommand;
15
- const se_QueryWhatIfForecastCommand = async (input, context) => {
16
- const headers = sharedHeaders("QueryWhatIfForecast");
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1._json)(input));
19
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
- };
21
- exports.se_QueryWhatIfForecastCommand = se_QueryWhatIfForecastCommand;
22
- const de_QueryForecastCommand = async (output, context) => {
23
- if (output.statusCode >= 300) {
24
- return de_QueryForecastCommandError(output, context);
25
- }
26
- const data = await parseBody(output.body, context);
27
- let contents = {};
28
- contents = de_QueryForecastResponse(data, context);
29
- const response = {
30
- $metadata: deserializeMetadata(output),
31
- ...contents,
32
- };
33
- return response;
34
- };
35
- exports.de_QueryForecastCommand = de_QueryForecastCommand;
36
- const de_QueryForecastCommandError = async (output, context) => {
37
- const parsedOutput = {
38
- ...output,
39
- body: await parseErrorBody(output.body, context),
40
- };
41
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
42
- switch (errorCode) {
43
- case "InvalidInputException":
44
- case "com.amazonaws.forecastquery#InvalidInputException":
45
- throw await de_InvalidInputExceptionRes(parsedOutput, context);
46
- case "InvalidNextTokenException":
47
- case "com.amazonaws.forecastquery#InvalidNextTokenException":
48
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
49
- case "LimitExceededException":
50
- case "com.amazonaws.forecastquery#LimitExceededException":
51
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
52
- case "ResourceInUseException":
53
- case "com.amazonaws.forecastquery#ResourceInUseException":
54
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
55
- case "ResourceNotFoundException":
56
- case "com.amazonaws.forecastquery#ResourceNotFoundException":
57
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
58
- default:
59
- const parsedBody = parsedOutput.body;
60
- return throwDefaultError({
61
- output,
62
- parsedBody,
63
- errorCode,
64
- });
65
- }
66
- };
67
- const de_QueryWhatIfForecastCommand = async (output, context) => {
68
- if (output.statusCode >= 300) {
69
- return de_QueryWhatIfForecastCommandError(output, context);
70
- }
71
- const data = await parseBody(output.body, context);
72
- let contents = {};
73
- contents = de_QueryWhatIfForecastResponse(data, context);
74
- const response = {
75
- $metadata: deserializeMetadata(output),
76
- ...contents,
77
- };
78
- return response;
79
- };
80
- exports.de_QueryWhatIfForecastCommand = de_QueryWhatIfForecastCommand;
81
- const de_QueryWhatIfForecastCommandError = async (output, context) => {
82
- const parsedOutput = {
83
- ...output,
84
- body: await parseErrorBody(output.body, context),
85
- };
86
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
87
- switch (errorCode) {
88
- case "InvalidInputException":
89
- case "com.amazonaws.forecastquery#InvalidInputException":
90
- throw await de_InvalidInputExceptionRes(parsedOutput, context);
91
- case "InvalidNextTokenException":
92
- case "com.amazonaws.forecastquery#InvalidNextTokenException":
93
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
94
- case "LimitExceededException":
95
- case "com.amazonaws.forecastquery#LimitExceededException":
96
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
97
- case "ResourceInUseException":
98
- case "com.amazonaws.forecastquery#ResourceInUseException":
99
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
100
- case "ResourceNotFoundException":
101
- case "com.amazonaws.forecastquery#ResourceNotFoundException":
102
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
103
- default:
104
- const parsedBody = parsedOutput.body;
105
- return throwDefaultError({
106
- output,
107
- parsedBody,
108
- errorCode,
109
- });
110
- }
111
- };
112
- const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
113
- const body = parsedOutput.body;
114
- const deserialized = (0, smithy_client_1._json)(body);
115
- const exception = new models_0_1.InvalidInputException({
116
- $metadata: deserializeMetadata(parsedOutput),
117
- ...deserialized,
118
- });
119
- return (0, smithy_client_1.decorateServiceException)(exception, body);
120
- };
121
- const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
122
- const body = parsedOutput.body;
123
- const deserialized = (0, smithy_client_1._json)(body);
124
- const exception = new models_0_1.InvalidNextTokenException({
125
- $metadata: deserializeMetadata(parsedOutput),
126
- ...deserialized,
127
- });
128
- return (0, smithy_client_1.decorateServiceException)(exception, body);
129
- };
130
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
131
- const body = parsedOutput.body;
132
- const deserialized = (0, smithy_client_1._json)(body);
133
- const exception = new models_0_1.LimitExceededException({
134
- $metadata: deserializeMetadata(parsedOutput),
135
- ...deserialized,
136
- });
137
- return (0, smithy_client_1.decorateServiceException)(exception, body);
138
- };
139
- const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
140
- const body = parsedOutput.body;
141
- const deserialized = (0, smithy_client_1._json)(body);
142
- const exception = new models_0_1.ResourceInUseException({
143
- $metadata: deserializeMetadata(parsedOutput),
144
- ...deserialized,
145
- });
146
- return (0, smithy_client_1.decorateServiceException)(exception, body);
147
- };
148
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
149
- const body = parsedOutput.body;
150
- const deserialized = (0, smithy_client_1._json)(body);
151
- const exception = new models_0_1.ResourceNotFoundException({
152
- $metadata: deserializeMetadata(parsedOutput),
153
- ...deserialized,
154
- });
155
- return (0, smithy_client_1.decorateServiceException)(exception, body);
156
- };
157
- const de_DataPoint = (output, context) => {
158
- return (0, smithy_client_1.take)(output, {
159
- Timestamp: smithy_client_1.expectString,
160
- Value: smithy_client_1.limitedParseDouble,
161
- });
162
- };
163
- const de_Forecast = (output, context) => {
164
- return (0, smithy_client_1.take)(output, {
165
- Predictions: (_) => de_Predictions(_, context),
166
- });
167
- };
168
- const de_Predictions = (output, context) => {
169
- return Object.entries(output).reduce((acc, [key, value]) => {
170
- if (value === null) {
171
- return acc;
172
- }
173
- acc[key] = de_TimeSeries(value, context);
174
- return acc;
175
- }, {});
176
- };
177
- const de_QueryForecastResponse = (output, context) => {
178
- return (0, smithy_client_1.take)(output, {
179
- Forecast: (_) => de_Forecast(_, context),
180
- });
181
- };
182
- const de_QueryWhatIfForecastResponse = (output, context) => {
183
- return (0, smithy_client_1.take)(output, {
184
- Forecast: (_) => de_Forecast(_, context),
185
- });
186
- };
187
- const de_TimeSeries = (output, context) => {
188
- const retVal = (output || [])
189
- .filter((e) => e != null)
190
- .map((entry) => {
191
- return de_DataPoint(entry, context);
192
- });
193
- return retVal;
194
- };
195
- const deserializeMetadata = (output) => ({
196
- httpStatusCode: output.statusCode,
197
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
198
- extendedRequestId: output.headers["x-amz-id-2"],
199
- cfId: output.headers["x-amz-cf-id"],
200
- });
201
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
202
- const throwDefaultError = (0, smithy_client_1.withBaseException)(ForecastqueryServiceException_1.ForecastqueryServiceException);
203
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
204
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
205
- const contents = {
206
- protocol,
207
- hostname,
208
- port,
209
- method: "POST",
210
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
211
- headers,
212
- };
213
- if (resolvedHostname !== undefined) {
214
- contents.hostname = resolvedHostname;
215
- }
216
- if (body !== undefined) {
217
- contents.body = body;
218
- }
219
- return new protocol_http_1.HttpRequest(contents);
220
- };
221
- function sharedHeaders(operation) {
222
- return {
223
- "content-type": "application/x-amz-json-1.1",
224
- "x-amz-target": `AmazonForecastRuntime.${operation}`,
225
- };
226
- }
227
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
228
- if (encoded.length) {
229
- return JSON.parse(encoded);
230
- }
231
- return {};
232
- });
233
- const parseErrorBody = async (errorBody, context) => {
234
- const value = await parseBody(errorBody, context);
235
- value.message = value.message ?? value.Message;
236
- return value;
237
- };
238
- const loadRestJsonErrorCode = (output, data) => {
239
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
240
- const sanitizeErrorCode = (rawValue) => {
241
- let cleanValue = rawValue;
242
- if (typeof cleanValue === "number") {
243
- cleanValue = cleanValue.toString();
244
- }
245
- if (cleanValue.indexOf(",") >= 0) {
246
- cleanValue = cleanValue.split(",")[0];
247
- }
248
- if (cleanValue.indexOf(":") >= 0) {
249
- cleanValue = cleanValue.split(":")[0];
250
- }
251
- if (cleanValue.indexOf("#") >= 0) {
252
- cleanValue = cleanValue.split("#")[1];
253
- }
254
- return cleanValue;
255
- };
256
- const headerKey = findKey(output.headers, "x-amzn-errortype");
257
- if (headerKey !== undefined) {
258
- return sanitizeErrorCode(output.headers[headerKey]);
259
- }
260
- if (data.code !== undefined) {
261
- return sanitizeErrorCode(data.code);
262
- }
263
- if (data["__type"] !== undefined) {
264
- return sanitizeErrorCode(data["__type"]);
265
- }
266
- };
1
+ module.exports = require("../index.js");
@@ -1,22 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const asPartial = (t) => t;
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = {
10
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
11
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
12
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
13
- };
14
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
15
- return {
16
- ...runtimeConfig,
17
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
18
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
19
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
20
- };
21
- };
22
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-forecastquery",
3
3
  "description": "AWS SDK for JavaScript Forecastquery Client for Node.js, Browser and React Native",
4
- "version": "3.489.0",
4
+ "version": "3.495.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
- "build:cjs": "tsc -p tsconfig.cjs.json",
7
+ "build:cjs": "node ../../scripts/compilation/inline client-forecastquery",
8
8
  "build:es": "tsc -p tsconfig.es.json",
9
9
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
10
10
  "build:types": "tsc -p tsconfig.types.json",
@@ -20,46 +20,46 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.489.0",
24
- "@aws-sdk/core": "3.485.0",
25
- "@aws-sdk/credential-provider-node": "3.489.0",
26
- "@aws-sdk/middleware-host-header": "3.489.0",
27
- "@aws-sdk/middleware-logger": "3.489.0",
28
- "@aws-sdk/middleware-recursion-detection": "3.489.0",
29
- "@aws-sdk/middleware-signing": "3.489.0",
30
- "@aws-sdk/middleware-user-agent": "3.489.0",
31
- "@aws-sdk/region-config-resolver": "3.489.0",
32
- "@aws-sdk/types": "3.489.0",
33
- "@aws-sdk/util-endpoints": "3.489.0",
34
- "@aws-sdk/util-user-agent-browser": "3.489.0",
35
- "@aws-sdk/util-user-agent-node": "3.489.0",
36
- "@smithy/config-resolver": "^2.0.23",
37
- "@smithy/fetch-http-handler": "^2.3.2",
38
- "@smithy/hash-node": "^2.0.18",
39
- "@smithy/invalid-dependency": "^2.0.16",
40
- "@smithy/middleware-content-length": "^2.0.18",
41
- "@smithy/middleware-endpoint": "^2.3.0",
42
- "@smithy/middleware-retry": "^2.0.26",
43
- "@smithy/middleware-serde": "^2.0.16",
44
- "@smithy/middleware-stack": "^2.0.10",
45
- "@smithy/node-config-provider": "^2.1.9",
46
- "@smithy/node-http-handler": "^2.2.2",
47
- "@smithy/protocol-http": "^3.0.12",
48
- "@smithy/smithy-client": "^2.2.1",
49
- "@smithy/types": "^2.8.0",
50
- "@smithy/url-parser": "^2.0.16",
51
- "@smithy/util-base64": "^2.0.1",
52
- "@smithy/util-body-length-browser": "^2.0.1",
53
- "@smithy/util-body-length-node": "^2.1.0",
54
- "@smithy/util-defaults-mode-browser": "^2.0.24",
55
- "@smithy/util-defaults-mode-node": "^2.0.32",
56
- "@smithy/util-endpoints": "^1.0.8",
57
- "@smithy/util-retry": "^2.0.9",
58
- "@smithy/util-utf8": "^2.0.2",
23
+ "@aws-sdk/client-sts": "3.495.0",
24
+ "@aws-sdk/core": "3.495.0",
25
+ "@aws-sdk/credential-provider-node": "3.495.0",
26
+ "@aws-sdk/middleware-host-header": "3.495.0",
27
+ "@aws-sdk/middleware-logger": "3.495.0",
28
+ "@aws-sdk/middleware-recursion-detection": "3.495.0",
29
+ "@aws-sdk/middleware-signing": "3.495.0",
30
+ "@aws-sdk/middleware-user-agent": "3.495.0",
31
+ "@aws-sdk/region-config-resolver": "3.495.0",
32
+ "@aws-sdk/types": "3.495.0",
33
+ "@aws-sdk/util-endpoints": "3.495.0",
34
+ "@aws-sdk/util-user-agent-browser": "3.495.0",
35
+ "@aws-sdk/util-user-agent-node": "3.495.0",
36
+ "@smithy/config-resolver": "^2.1.0",
37
+ "@smithy/fetch-http-handler": "^2.4.0",
38
+ "@smithy/hash-node": "^2.1.0",
39
+ "@smithy/invalid-dependency": "^2.1.0",
40
+ "@smithy/middleware-content-length": "^2.1.0",
41
+ "@smithy/middleware-endpoint": "^2.4.0",
42
+ "@smithy/middleware-retry": "^2.1.0",
43
+ "@smithy/middleware-serde": "^2.1.0",
44
+ "@smithy/middleware-stack": "^2.1.0",
45
+ "@smithy/node-config-provider": "^2.2.0",
46
+ "@smithy/node-http-handler": "^2.3.0",
47
+ "@smithy/protocol-http": "^3.1.0",
48
+ "@smithy/smithy-client": "^2.3.0",
49
+ "@smithy/types": "^2.9.0",
50
+ "@smithy/url-parser": "^2.1.0",
51
+ "@smithy/util-base64": "^2.1.0",
52
+ "@smithy/util-body-length-browser": "^2.1.0",
53
+ "@smithy/util-body-length-node": "^2.2.0",
54
+ "@smithy/util-defaults-mode-browser": "^2.1.0",
55
+ "@smithy/util-defaults-mode-node": "^2.1.0",
56
+ "@smithy/util-endpoints": "^1.1.0",
57
+ "@smithy/util-retry": "^2.1.0",
58
+ "@smithy/util-utf8": "^2.1.0",
59
59
  "tslib": "^2.5.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@smithy/service-client-documentation-generator": "^2.0.0",
62
+ "@smithy/service-client-documentation-generator": "^2.1.0",
63
63
  "@tsconfig/node14": "1.0.3",
64
64
  "@types/node": "^14.14.31",
65
65
  "concurrently": "7.0.0",