File Explorer

/var/runtime/node_modules/@aws-sdk/client-forecastquery/dist-cjs

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

2 dirs
3 files
index.js20.7 KB · 548 lines
"use strict";var __defProp = Object.defineProperty;var __getOwnPropDesc = Object.getOwnPropertyDescriptor;var __getOwnPropNames = Object.getOwnPropertyNames;var __hasOwnProp = Object.prototype.hasOwnProperty;var __name = (target, value) => __defProp(target, "name", { value, configurable: true });var __export = (target, all) => {  for (var name in all)    __defProp(target, name, { get: all[name], enumerable: true });};var __copyProps = (to, from, except, desc) => {  if (from && typeof from === "object" || typeof from === "function") {    for (let key of __getOwnPropNames(from))      if (!__hasOwnProp.call(to, key) && key !== except)        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });  }  return to;};var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.tsvar index_exports = {};__export(index_exports, {  Forecastquery: () => Forecastquery,  ForecastqueryClient: () => ForecastqueryClient,  ForecastqueryServiceException: () => ForecastqueryServiceException,  InvalidInputException: () => InvalidInputException,  InvalidNextTokenException: () => InvalidNextTokenException,  LimitExceededException: () => LimitExceededException,  QueryForecastCommand: () => QueryForecastCommand,  QueryWhatIfForecastCommand: () => QueryWhatIfForecastCommand,  ResourceInUseException: () => ResourceInUseException,  ResourceNotFoundException: () => ResourceNotFoundException,  __Client: () => import_smithy_client.Client});module.exports = __toCommonJS(index_exports); // src/ForecastqueryClient.tsvar import_middleware_host_header = require("@aws-sdk/middleware-host-header");var import_middleware_logger = require("@aws-sdk/middleware-logger");var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");var import_config_resolver = require("@smithy/config-resolver");var import_core = require("@smithy/core");var import_middleware_content_length = require("@smithy/middleware-content-length");var import_middleware_endpoint = require("@smithy/middleware-endpoint");var import_middleware_retry = require("@smithy/middleware-retry"); var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider"); // src/endpoint/EndpointParameters.tsvar resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {  return Object.assign(options, {    useDualstackEndpoint: options.useDualstackEndpoint ?? false,    useFipsEndpoint: options.useFipsEndpoint ?? false,    defaultSigningName: "forecast"  });}, "resolveClientEndpointParameters");var commonParams = {  UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },  Endpoint: { type: "builtInParams", name: "endpoint" },  Region: { type: "builtInParams", name: "region" },  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }}; // src/ForecastqueryClient.tsvar import_runtimeConfig = require("././runtimeConfig"); // src/runtimeExtensions.tsvar import_region_config_resolver = require("@aws-sdk/region-config-resolver");var import_protocol_http = require("@smithy/protocol-http");var import_smithy_client = require("@smithy/smithy-client"); // src/auth/httpAuthExtensionConfiguration.tsvar getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;  let _credentials = runtimeConfig.credentials;  return {    setHttpAuthScheme(httpAuthScheme) {      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);      if (index === -1) {        _httpAuthSchemes.push(httpAuthScheme);      } else {        _httpAuthSchemes.splice(index, 1, httpAuthScheme);      }    },    httpAuthSchemes() {      return _httpAuthSchemes;    },    setHttpAuthSchemeProvider(httpAuthSchemeProvider) {      _httpAuthSchemeProvider = httpAuthSchemeProvider;    },    httpAuthSchemeProvider() {      return _httpAuthSchemeProvider;    },    setCredentials(credentials) {      _credentials = credentials;    },    credentials() {      return _credentials;    }  };}, "getHttpAuthExtensionConfiguration");var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {  return {    httpAuthSchemes: config.httpAuthSchemes(),    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),    credentials: config.credentials()  };}, "resolveHttpAuthRuntimeConfig"); // src/runtimeExtensions.tsvar resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {  const extensionConfiguration = Object.assign(    (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),    (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),    (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),    getHttpAuthExtensionConfiguration(runtimeConfig)  );  extensions.forEach((extension) => extension.configure(extensionConfiguration));  return Object.assign(    runtimeConfig,    (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),    (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),    (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),    resolveHttpAuthRuntimeConfig(extensionConfiguration)  );}, "resolveRuntimeExtensions"); // src/ForecastqueryClient.tsvar ForecastqueryClient = class extends import_smithy_client.Client {  static {    __name(this, "ForecastqueryClient");  }  /**   * The resolved configuration of ForecastqueryClient class. This is resolved and normalized from the {@link ForecastqueryClientConfig | constructor configuration interface}.   */  config;  constructor(...[configuration]) {    const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});    super(_config_0);    this.initConfig = _config_0;    const _config_1 = resolveClientEndpointParameters(_config_0);    const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);    const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);    const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);    const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);    const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);    const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);    const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);    this.config = _config_8;    this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));    this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));    this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));    this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));    this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));    this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));    this.middlewareStack.use(      (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {        httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultForecastqueryHttpAuthSchemeParametersProvider,        identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({          "aws.auth#sigv4": config.credentials        }), "identityProviderConfigProvider")      })    );    this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));  }  /**   * Destroy underlying resources, like sockets. It's usually not necessary to do this.   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.   * Otherwise, sockets might stay open for quite a long time before the server terminates them.   */  destroy() {    super.destroy();  }}; // src/Forecastquery.ts  // src/commands/QueryForecastCommand.ts var import_middleware_serde = require("@smithy/middleware-serde");  // src/protocols/Aws_json1_1.tsvar import_core2 = require("@aws-sdk/core");   // src/models/ForecastqueryServiceException.ts var ForecastqueryServiceException = class _ForecastqueryServiceException extends import_smithy_client.ServiceException {  static {    __name(this, "ForecastqueryServiceException");  }  /**   * @internal   */  constructor(options) {    super(options);    Object.setPrototypeOf(this, _ForecastqueryServiceException.prototype);  }}; // src/models/models_0.tsvar InvalidInputException = class _InvalidInputException extends ForecastqueryServiceException {  static {    __name(this, "InvalidInputException");  }  name = "InvalidInputException";  $fault = "client";  Message;  /**   * @internal   */  constructor(opts) {    super({      name: "InvalidInputException",      $fault: "client",      ...opts    });    Object.setPrototypeOf(this, _InvalidInputException.prototype);    this.Message = opts.Message;  }};var InvalidNextTokenException = class _InvalidNextTokenException extends ForecastqueryServiceException {  static {    __name(this, "InvalidNextTokenException");  }  name = "InvalidNextTokenException";  $fault = "client";  Message;  /**   * @internal   */  constructor(opts) {    super({      name: "InvalidNextTokenException",      $fault: "client",      ...opts    });    Object.setPrototypeOf(this, _InvalidNextTokenException.prototype);    this.Message = opts.Message;  }};var LimitExceededException = class _LimitExceededException extends ForecastqueryServiceException {  static {    __name(this, "LimitExceededException");  }  name = "LimitExceededException";  $fault = "client";  Message;  /**   * @internal   */  constructor(opts) {    super({      name: "LimitExceededException",      $fault: "client",      ...opts    });    Object.setPrototypeOf(this, _LimitExceededException.prototype);    this.Message = opts.Message;  }};var ResourceInUseException = class _ResourceInUseException extends ForecastqueryServiceException {  static {    __name(this, "ResourceInUseException");  }  name = "ResourceInUseException";  $fault = "client";  Message;  /**   * @internal   */  constructor(opts) {    super({      name: "ResourceInUseException",      $fault: "client",      ...opts    });    Object.setPrototypeOf(this, _ResourceInUseException.prototype);    this.Message = opts.Message;  }};var ResourceNotFoundException = class _ResourceNotFoundException extends ForecastqueryServiceException {  static {    __name(this, "ResourceNotFoundException");  }  name = "ResourceNotFoundException";  $fault = "client";  Message;  /**   * @internal   */  constructor(opts) {    super({      name: "ResourceNotFoundException",      $fault: "client",      ...opts    });    Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);    this.Message = opts.Message;  }}; // src/protocols/Aws_json1_1.tsvar se_QueryForecastCommand = /* @__PURE__ */ __name(async (input, context) => {  const headers = sharedHeaders("QueryForecast");  let body;  body = JSON.stringify((0, import_smithy_client._json)(input));  return buildHttpRpcRequest(context, headers, "/", void 0, body);}, "se_QueryForecastCommand");var se_QueryWhatIfForecastCommand = /* @__PURE__ */ __name(async (input, context) => {  const headers = sharedHeaders("QueryWhatIfForecast");  let body;  body = JSON.stringify((0, import_smithy_client._json)(input));  return buildHttpRpcRequest(context, headers, "/", void 0, body);}, "se_QueryWhatIfForecastCommand");var de_QueryForecastCommand = /* @__PURE__ */ __name(async (output, context) => {  if (output.statusCode >= 300) {    return de_CommandError(output, context);  }  const data = await (0, import_core2.parseJsonBody)(output.body, context);  let contents = {};  contents = de_QueryForecastResponse(data, context);  const response = {    $metadata: deserializeMetadata(output),    ...contents  };  return response;}, "de_QueryForecastCommand");var de_QueryWhatIfForecastCommand = /* @__PURE__ */ __name(async (output, context) => {  if (output.statusCode >= 300) {    return de_CommandError(output, context);  }  const data = await (0, import_core2.parseJsonBody)(output.body, context);  let contents = {};  contents = de_QueryWhatIfForecastResponse(data, context);  const response = {    $metadata: deserializeMetadata(output),    ...contents  };  return response;}, "de_QueryWhatIfForecastCommand");var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {  const parsedOutput = {    ...output,    body: await (0, import_core2.parseJsonErrorBody)(output.body, context)  };  const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);  switch (errorCode) {    case "InvalidInputException":    case "com.amazonaws.forecastquery#InvalidInputException":      throw await de_InvalidInputExceptionRes(parsedOutput, context);    case "InvalidNextTokenException":    case "com.amazonaws.forecastquery#InvalidNextTokenException":      throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);    case "LimitExceededException":    case "com.amazonaws.forecastquery#LimitExceededException":      throw await de_LimitExceededExceptionRes(parsedOutput, context);    case "ResourceInUseException":    case "com.amazonaws.forecastquery#ResourceInUseException":      throw await de_ResourceInUseExceptionRes(parsedOutput, context);    case "ResourceNotFoundException":    case "com.amazonaws.forecastquery#ResourceNotFoundException":      throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);    default:      const parsedBody = parsedOutput.body;      return throwDefaultError({        output,        parsedBody,        errorCode      });  }}, "de_CommandError");var de_InvalidInputExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {  const body = parsedOutput.body;  const deserialized = (0, import_smithy_client._json)(body);  const exception = new InvalidInputException({    $metadata: deserializeMetadata(parsedOutput),    ...deserialized  });  return (0, import_smithy_client.decorateServiceException)(exception, body);}, "de_InvalidInputExceptionRes");var de_InvalidNextTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {  const body = parsedOutput.body;  const deserialized = (0, import_smithy_client._json)(body);  const exception = new InvalidNextTokenException({    $metadata: deserializeMetadata(parsedOutput),    ...deserialized  });  return (0, import_smithy_client.decorateServiceException)(exception, body);}, "de_InvalidNextTokenExceptionRes");var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {  const body = parsedOutput.body;  const deserialized = (0, import_smithy_client._json)(body);  const exception = new LimitExceededException({    $metadata: deserializeMetadata(parsedOutput),    ...deserialized  });  return (0, import_smithy_client.decorateServiceException)(exception, body);}, "de_LimitExceededExceptionRes");var de_ResourceInUseExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {  const body = parsedOutput.body;  const deserialized = (0, import_smithy_client._json)(body);  const exception = new ResourceInUseException({    $metadata: deserializeMetadata(parsedOutput),    ...deserialized  });  return (0, import_smithy_client.decorateServiceException)(exception, body);}, "de_ResourceInUseExceptionRes");var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {  const body = parsedOutput.body;  const deserialized = (0, import_smithy_client._json)(body);  const exception = new ResourceNotFoundException({    $metadata: deserializeMetadata(parsedOutput),    ...deserialized  });  return (0, import_smithy_client.decorateServiceException)(exception, body);}, "de_ResourceNotFoundExceptionRes");var de_DataPoint = /* @__PURE__ */ __name((output, context) => {  return (0, import_smithy_client.take)(output, {    Timestamp: import_smithy_client.expectString,    Value: import_smithy_client.limitedParseDouble  });}, "de_DataPoint");var de_Forecast = /* @__PURE__ */ __name((output, context) => {  return (0, import_smithy_client.take)(output, {    Predictions: /* @__PURE__ */ __name((_) => de_Predictions(_, context), "Predictions")  });}, "de_Forecast");var de_Predictions = /* @__PURE__ */ __name((output, context) => {  return Object.entries(output).reduce((acc, [key, value]) => {    if (value === null) {      return acc;    }    acc[key] = de_TimeSeries(value, context);    return acc;  }, {});}, "de_Predictions");var de_QueryForecastResponse = /* @__PURE__ */ __name((output, context) => {  return (0, import_smithy_client.take)(output, {    Forecast: /* @__PURE__ */ __name((_) => de_Forecast(_, context), "Forecast")  });}, "de_QueryForecastResponse");var de_QueryWhatIfForecastResponse = /* @__PURE__ */ __name((output, context) => {  return (0, import_smithy_client.take)(output, {    Forecast: /* @__PURE__ */ __name((_) => de_Forecast(_, context), "Forecast")  });}, "de_QueryWhatIfForecastResponse");var de_TimeSeries = /* @__PURE__ */ __name((output, context) => {  const retVal = (output || []).filter((e) => e != null).map((entry) => {    return de_DataPoint(entry, context);  });  return retVal;}, "de_TimeSeries");var deserializeMetadata = /* @__PURE__ */ __name((output) => ({  httpStatusCode: output.statusCode,  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],  extendedRequestId: output.headers["x-amz-id-2"],  cfId: output.headers["x-amz-cf-id"]}), "deserializeMetadata");var throwDefaultError = (0, import_smithy_client.withBaseException)(ForecastqueryServiceException);var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();  const contents = {    protocol,    hostname,    port,    method: "POST",    path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,    headers  };  if (resolvedHostname !== void 0) {    contents.hostname = resolvedHostname;  }  if (body !== void 0) {    contents.body = body;  }  return new import_protocol_http.HttpRequest(contents);}, "buildHttpRpcRequest");function sharedHeaders(operation) {  return {    "content-type": "application/x-amz-json-1.1",    "x-amz-target": `AmazonForecastRuntime.${operation}`  };}__name(sharedHeaders, "sharedHeaders"); // src/commands/QueryForecastCommand.tsvar QueryForecastCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {  return [    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())  ];}).s("AmazonForecastRuntime", "QueryForecast", {}).n("ForecastqueryClient", "QueryForecastCommand").f(void 0, void 0).ser(se_QueryForecastCommand).de(de_QueryForecastCommand).build() {  static {    __name(this, "QueryForecastCommand");  }}; // src/commands/QueryWhatIfForecastCommand.ts   var QueryWhatIfForecastCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {  return [    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())  ];}).s("AmazonForecastRuntime", "QueryWhatIfForecast", {}).n("ForecastqueryClient", "QueryWhatIfForecastCommand").f(void 0, void 0).ser(se_QueryWhatIfForecastCommand).de(de_QueryWhatIfForecastCommand).build() {  static {    __name(this, "QueryWhatIfForecastCommand");  }}; // src/Forecastquery.tsvar commands = {  QueryForecastCommand,  QueryWhatIfForecastCommand};var Forecastquery = class extends ForecastqueryClient {  static {    __name(this, "Forecastquery");  }};(0, import_smithy_client.createAggregatedClient)(commands, Forecastquery);// Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = {  ForecastqueryServiceException,  __Client,  ForecastqueryClient,  Forecastquery,  $Command,  QueryForecastCommand,  QueryWhatIfForecastCommand,  InvalidInputException,  InvalidNextTokenException,  LimitExceededException,  ResourceInUseException,  ResourceNotFoundException});