UNPKG

lambda-live-debugger

Version:

Debug Lambda functions locally like it is running in the cloud

943 lines (912 loc) 36.9 kB
const { awsEndpointFunctions, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$1, createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client"); const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin, createPaginator } = require("@smithy/core"); const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, makeBuilder, createAggregatedClient } = require("@smithy/core/client"); const { Command: $Command } = require("@smithy/core/client"); exports.$Command = $Command; exports.__Client = Client; const { resolveDefaultsModeConfig, loadConfig, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig } = require("@smithy/core/config"); const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints"); const { parseUrl, getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols"); const { DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry"); const { TypeRegistry, getSchemaSerdePlugin } = require("@smithy/core/schema"); const { resolveAwsSdkSigV4Config, AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes"); const { defaultProvider } = require("@aws-sdk/credential-provider-node"); const { toUtf8, fromUtf8, toBase64, fromBase64, calculateBodyLength } = require("@smithy/core/serde"); const { streamCollector, NodeHttpHandler } = require("@smithy/node-http-handler"); const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols"); const { Sha256 } = require("@smithy/core/checksum"); const defaultIoTDataPlaneHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: getSmithyContext(context).operation, region: await normalizeProvider(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })(), }; }; function createAwsAuthSigv4HttpAuthOption(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "iotdata", region: authParameters.region, }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context, }, }), }; } const defaultIoTDataPlaneHttpAuthSchemeProvider = (authParameters) => { const options = []; switch (authParameters.operation) { default: { options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } return options; }; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = resolveAwsSdkSigV4Config(config); return Object.assign(config_0, { authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), }); }; const resolveClientEndpointParameters = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, defaultSigningName: "iotdata", }); }; const commonParams = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, }; var version = "3.1084.0"; var packageInfo = { version: version}; const n = "ref"; const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = "stringEquals", h = { [n]: "Endpoint" }, i = { [n]: d }, j = { [n]: "Region" }, k = { "fn": f, "argv": [i, "name"] }, l = {}, m = [j]; const _data = { conditions: [ [c, [h]], [c, m], ["aws.partition", m, d], [e, [{ [n]: "UseFIPS" }, b]], [e, [{ [n]: "UseDualStack" }, b]], [e, [{ fn: f, argv: [i, "supportsDualStack"] }, b]], [e, [{ fn: f, argv: [i, "supportsFIPS"] }, b]], [g, [j, "ca-central-1"]], [g, [j, "cn-north-1"]], [g, [j, "us-east-1"]], [g, [k, "aws"]], [g, [k, "aws-cn"]], [g, [k, "aws-us-gov"]], [g, [j, "us-east-2"]], [g, [j, "us-west-1"]], [g, [j, "us-west-2"]], [g, [j, "us-gov-east-1"]], [g, [j, "us-gov-west-1"]] ], results: [ [a], [a, "Invalid Configuration: FIPS and custom endpoint are not supported"], [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"], [h, l], ["https://data-ats.iot-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", l], [a, "FIPS and DualStack are enabled, but this partition does not support one or both"], ["https://data.iot-fips.ca-central-1.amazonaws.com", l], ["https://data.iot-fips.us-east-1.amazonaws.com", l], ["https://data.iot-fips.us-east-2.amazonaws.com", l], ["https://data.iot-fips.us-west-1.amazonaws.com", l], ["https://data.iot-fips.us-west-2.amazonaws.com", l], ["https://data.iot-fips.us-gov-east-1.amazonaws.com", l], ["https://data.iot-fips.us-gov-west-1.amazonaws.com", l], ["https://data-ats.iot-fips.{Region}.{PartitionResult#dnsSuffix}", l], [a, "FIPS is enabled but this partition does not support FIPS"], ["https://data-ats.iot.{Region}.{PartitionResult#dualStackDnsSuffix}", l], [a, "DualStack is enabled but this partition does not support DualStack"], ["https://data.ats.iot.cn-north-1.amazonaws.com.cn", l], ["https://data-ats.iot.{Region}.amazonaws.com", l], ["https://data-ats.iot.{Region}.amazonaws.com.cn", l], ["https://data-ats.iot.{Region}.{PartitionResult#dnsSuffix}", l], [a, "Invalid Configuration: Missing Region"] ] }; const root = 2; const r = 100_000_000; const nodes = new Int32Array([ -1, 1, -1, 0, 23, 3, 1, 4, r + 21, 2, 5, r + 21, 3, 12, 6, 4, 11, 7, 8, r + 17, 8, 10, r + 18, 9, 11, r + 19, 10, 12, r + 18, r + 20, 5, r + 15, r + 16, 4, 21, 13, 6, 14, r + 14, 7, r + 6, 15, 9, r + 7, 16, 13, r + 8, 17, 14, r + 9, 18, 15, r + 10, 19, 16, r + 11, 20, 17, r + 12, r + 13, 5, 22, r + 5, 6, r + 4, r + 5, 3, r + 1, 24, 4, r + 2, r + 3, ]); const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results); const cache = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"], }); const defaultEndpointResolver = (endpointParams, context = {}) => { return cache.get(endpointParams, () => decideEndpoint(bdd, { endpointParams: endpointParams, logger: context.logger, })); }; customEndpointFunctions.aws = awsEndpointFunctions; class IoTDataPlaneServiceException extends ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, IoTDataPlaneServiceException.prototype); } } class ConflictException extends IoTDataPlaneServiceException { name = "ConflictException"; $fault = "client"; constructor(opts) { super({ name: "ConflictException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, ConflictException.prototype); } } class ForbiddenException extends IoTDataPlaneServiceException { name = "ForbiddenException"; $fault = "client"; constructor(opts) { super({ name: "ForbiddenException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, ForbiddenException.prototype); } } class InternalFailureException extends IoTDataPlaneServiceException { name = "InternalFailureException"; $fault = "server"; constructor(opts) { super({ name: "InternalFailureException", $fault: "server", ...opts, }); Object.setPrototypeOf(this, InternalFailureException.prototype); } } class InvalidRequestException extends IoTDataPlaneServiceException { name = "InvalidRequestException"; $fault = "client"; constructor(opts) { super({ name: "InvalidRequestException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, InvalidRequestException.prototype); } } class ResourceNotFoundException extends IoTDataPlaneServiceException { name = "ResourceNotFoundException"; $fault = "client"; constructor(opts) { super({ name: "ResourceNotFoundException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, ResourceNotFoundException.prototype); } } class ThrottlingException extends IoTDataPlaneServiceException { name = "ThrottlingException"; $fault = "client"; constructor(opts) { super({ name: "ThrottlingException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, ThrottlingException.prototype); } } class MethodNotAllowedException extends IoTDataPlaneServiceException { name = "MethodNotAllowedException"; $fault = "client"; constructor(opts) { super({ name: "MethodNotAllowedException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, MethodNotAllowedException.prototype); } } class ServiceUnavailableException extends IoTDataPlaneServiceException { name = "ServiceUnavailableException"; $fault = "server"; constructor(opts) { super({ name: "ServiceUnavailableException", $fault: "server", ...opts, }); Object.setPrototypeOf(this, ServiceUnavailableException.prototype); } } class UnauthorizedException extends IoTDataPlaneServiceException { name = "UnauthorizedException"; $fault = "client"; constructor(opts) { super({ name: "UnauthorizedException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, UnauthorizedException.prototype); } } class UnsupportedDocumentEncodingException extends IoTDataPlaneServiceException { name = "UnsupportedDocumentEncodingException"; $fault = "client"; constructor(opts) { super({ name: "UnsupportedDocumentEncodingException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, UnsupportedDocumentEncodingException.prototype); } } class GatewayTimeoutException extends IoTDataPlaneServiceException { name = "GatewayTimeoutException"; $fault = "server"; constructor(opts) { super({ name: "GatewayTimeoutException", $fault: "server", ...opts, }); Object.setPrototypeOf(this, GatewayTimeoutException.prototype); } } class RequestEntityTooLargeException extends IoTDataPlaneServiceException { name = "RequestEntityTooLargeException"; $fault = "client"; constructor(opts) { super({ name: "RequestEntityTooLargeException", $fault: "client", ...opts, }); Object.setPrototypeOf(this, RequestEntityTooLargeException.prototype); } } const _CE = "ConflictException"; const _DC = "DeleteConnection"; const _DCR = "DeleteConnectionRequest"; const _DTS = "DeleteThingShadow"; const _DTSR = "DeleteThingShadowRequest"; const _DTSRe = "DeleteThingShadowResponse"; const _FE = "ForbiddenException"; const _GC = "GetConnection"; const _GCR = "GetConnectionRequest"; const _GCRe = "GetConnectionResponse"; const _GRM = "GetRetainedMessage"; const _GRMR = "GetRetainedMessageRequest"; const _GRMRe = "GetRetainedMessageResponse"; const _GTE = "GatewayTimeoutException"; const _GTS = "GetThingShadow"; const _GTSR = "GetThingShadowRequest"; const _GTSRe = "GetThingShadowResponse"; const _IFE = "InternalFailureException"; const _IRE = "InvalidRequestException"; const _LNSFT = "ListNamedShadowsForThing"; const _LNSFTR = "ListNamedShadowsForThingRequest"; const _LNSFTRi = "ListNamedShadowsForThingResponse"; const _LRM = "ListRetainedMessages"; const _LRMR = "ListRetainedMessagesRequest"; const _LRMRi = "ListRetainedMessagesResponse"; const _LS = "ListSubscriptions"; const _LSR = "ListSubscriptionsRequest"; const _LSRi = "ListSubscriptionsResponse"; const _MNAE = "MethodNotAllowedException"; const _P = "Publish"; const _PR = "PublishRequest"; const _RETLE = "RequestEntityTooLargeException"; const _RML = "RetainedMessageList"; const _RMS = "RetainedMessageSummary"; const _RNFE = "ResourceNotFoundException"; const _SDM = "SendDirectMessage"; const _SDMR = "SendDirectMessageRequest"; const _SDMRe = "SendDirectMessageResponse"; const _SJUP = "SynthesizedJsonUserProperties"; const _SL = "SubscriptionList"; const _SS = "SubscriptionSummary"; const _SUE = "ServiceUnavailableException"; const _TE = "ThrottlingException"; const _UDEE = "UnsupportedDocumentEncodingException"; const _UE = "UnauthorizedException"; const _UTS = "UpdateThingShadow"; const _UTSR = "UpdateThingShadowRequest"; const _UTSRp = "UpdateThingShadowResponse"; const _a = "application/json"; const _c = "client"; const _cD = "correlationData"; const _cI = "clientId"; const _cS = "cleanSession"; const _cSo = "connectedSince"; const _cT = "contentType"; const _co = "connected"; const _con = "confirmation"; const _dR = "disconnectReason"; const _dS = "disconnectedSince"; const _e = "error"; const _h = "http"; const _hE = "httpError"; const _hH = "httpHeader"; const _hQ = "httpQuery"; const _iSI = "includeSocketInformation"; const _kAD = "keepAliveDuration"; const _lMT = "lastModifiedTime"; const _m = "message"; const _mE = "messageExpiry"; const _mR = "maxResults"; const _mT = "mediaType"; const _n = "name"; const _nT = "nextToken"; const _p = "payload"; const _pFI = "payloadFormatIndicator"; const _pS = "pageSize"; const _pSa = "payloadSize"; const _pWM = "preventWillMessage"; const _q = "qos"; const _r = "results"; const _rT = "retainedTopics"; const _rTe = "responseTopic"; const _re = "retain"; const _s = "smithy.ts.sdk.synthetic.com.amazonaws.iotdataplane"; const _sE = "sessionExpiry"; const _sI = "sourceIp"; const _sN = "shadowName"; const _sP = "sourcePort"; const _se = "server"; const _su = "subscriptions"; const _t = "topic"; const _tF = "topicFilter"; const _tI = "targetIp"; const _tIr = "traceId"; const _tN = "thingName"; const _tP = "targetPort"; const _ti = "timestamp"; const _tim = "timeout"; const _uP = "userProperties"; const _vEI = "vpcEndpointId"; const _xamcd = "x-amz-mqtt5-correlation-data"; const _xampfi = "x-amz-mqtt5-payload-format-indicator"; const _xamup = "x-amz-mqtt5-user-properties"; const n0 = "com.amazonaws.iotdataplane"; const _s_registry = TypeRegistry.for(_s); var IoTDataPlaneServiceException$ = [-3, _s, "IoTDataPlaneServiceException", 0, [], []]; _s_registry.registerError(IoTDataPlaneServiceException$, IoTDataPlaneServiceException); const n0_registry = TypeRegistry.for(n0); var ConflictException$ = [-3, n0, _CE, { [_e]: _c, [_hE]: 409 }, [_m], [0] ]; n0_registry.registerError(ConflictException$, ConflictException); var ForbiddenException$ = [-3, n0, _FE, { [_e]: _c, [_hE]: 403 }, [_m], [0] ]; n0_registry.registerError(ForbiddenException$, ForbiddenException); var GatewayTimeoutException$ = [-3, n0, _GTE, { [_e]: _se, [_hE]: 504 }, [_m], [0] ]; n0_registry.registerError(GatewayTimeoutException$, GatewayTimeoutException); var InternalFailureException$ = [-3, n0, _IFE, { [_e]: _se, [_hE]: 500 }, [_m], [0] ]; n0_registry.registerError(InternalFailureException$, InternalFailureException); var InvalidRequestException$ = [-3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_m], [0] ]; n0_registry.registerError(InvalidRequestException$, InvalidRequestException); var MethodNotAllowedException$ = [-3, n0, _MNAE, { [_e]: _c, [_hE]: 405 }, [_m], [0] ]; n0_registry.registerError(MethodNotAllowedException$, MethodNotAllowedException); var RequestEntityTooLargeException$ = [-3, n0, _RETLE, { [_e]: _c, [_hE]: 413 }, [_m], [0] ]; n0_registry.registerError(RequestEntityTooLargeException$, RequestEntityTooLargeException); var ResourceNotFoundException$ = [-3, n0, _RNFE, { [_e]: _c, [_hE]: 404 }, [_m], [0] ]; n0_registry.registerError(ResourceNotFoundException$, ResourceNotFoundException); var ServiceUnavailableException$ = [-3, n0, _SUE, { [_e]: _se, [_hE]: 503 }, [_m], [0] ]; n0_registry.registerError(ServiceUnavailableException$, ServiceUnavailableException); var ThrottlingException$ = [-3, n0, _TE, { [_e]: _c, [_hE]: 429 }, [_m], [0] ]; n0_registry.registerError(ThrottlingException$, ThrottlingException); var UnauthorizedException$ = [-3, n0, _UE, { [_e]: _c, [_hE]: 401 }, [_m], [0] ]; n0_registry.registerError(UnauthorizedException$, UnauthorizedException); var UnsupportedDocumentEncodingException$ = [-3, n0, _UDEE, { [_e]: _c, [_hE]: 415 }, [_m], [0] ]; n0_registry.registerError(UnsupportedDocumentEncodingException$, UnsupportedDocumentEncodingException); const errorTypeRegistries = [ _s_registry, n0_registry, ]; var SynthesizedJsonUserProperties = [0, n0, _SJUP, { [_mT]: _a }, 0]; var DeleteConnectionRequest$ = [3, n0, _DCR, 0, [_cI, _cS, _pWM], [[0, 1], [2, { [_hQ]: _cS }], [2, { [_hQ]: _pWM }]], 1 ]; var DeleteThingShadowRequest$ = [3, n0, _DTSR, 0, [_tN, _sN], [[0, 1], [0, { [_hQ]: _n }]], 1 ]; var DeleteThingShadowResponse$ = [3, n0, _DTSRe, 0, [_p], [[21, 16]], 1 ]; var GetConnectionRequest$ = [3, n0, _GCR, 0, [_cI, _iSI], [[0, 1], [2, { [_hQ]: _iSI }]], 1 ]; var GetConnectionResponse$ = [3, n0, _GCRe, 0, [_co, _tN, _cS, _sI, _sP, _tI, _tP, _kAD, _cSo, _dS, _dR, _sE, _cI, _vEI], [2, 0, 2, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0] ]; var GetRetainedMessageRequest$ = [3, n0, _GRMR, 0, [_t], [[0, 1]], 1 ]; var GetRetainedMessageResponse$ = [3, n0, _GRMRe, 0, [_t, _p, _q, _lMT, _uP], [0, 21, 1, 1, 21] ]; var GetThingShadowRequest$ = [3, n0, _GTSR, 0, [_tN, _sN], [[0, 1], [0, { [_hQ]: _n }]], 1 ]; var GetThingShadowResponse$ = [3, n0, _GTSRe, 0, [_p], [[21, 16]] ]; var ListNamedShadowsForThingRequest$ = [3, n0, _LNSFTR, 0, [_tN, _nT, _pS], [[0, 1], [0, { [_hQ]: _nT }], [1, { [_hQ]: _pS }]], 1 ]; var ListNamedShadowsForThingResponse$ = [3, n0, _LNSFTRi, 0, [_r, _nT, _ti], [64 | 0, 0, 1] ]; var ListRetainedMessagesRequest$ = [3, n0, _LRMR, 0, [_nT, _mR], [[0, { [_hQ]: _nT }], [1, { [_hQ]: _mR }]] ]; var ListRetainedMessagesResponse$ = [3, n0, _LRMRi, 0, [_rT, _nT], [() => RetainedMessageList, 0] ]; var ListSubscriptionsRequest$ = [3, n0, _LSR, 0, [_cI, _nT, _mR], [[0, 1], [0, { [_hQ]: _nT }], [1, { [_hQ]: _mR }]], 1 ]; var ListSubscriptionsResponse$ = [3, n0, _LSRi, 0, [_su, _nT], [() => SubscriptionList, 0] ]; var PublishRequest$ = [3, n0, _PR, 0, [_t, _q, _re, _p, _uP, _pFI, _cT, _rTe, _cD, _mE], [[0, 1], [1, { [_hQ]: _q }], [2, { [_hQ]: _re }], [21, 16], [() => SynthesizedJsonUserProperties, { [_hH]: _xamup }], [0, { [_hH]: _xampfi }], [0, { [_hQ]: _cT }], [0, { [_hQ]: _rTe }], [0, { [_hH]: _xamcd }], [1, { [_hQ]: _mE }]], 1 ]; var RetainedMessageSummary$ = [3, n0, _RMS, 0, [_t, _pSa, _q, _lMT], [0, 1, 1, 1] ]; var SendDirectMessageRequest$ = [3, n0, _SDMR, 0, [_cI, _t, _cT, _rTe, _con, _tim, _p, _uP, _pFI, _cD], [[0, 1], [0, { [_hQ]: _t }], [0, { [_hQ]: _cT }], [0, { [_hQ]: _rTe }], [2, { [_hQ]: _con }], [1, { [_hQ]: _tim }], [21, 16], [() => SynthesizedJsonUserProperties, { [_hH]: _xamup }], [0, { [_hH]: _xampfi }], [0, { [_hH]: _xamcd }]], 2 ]; var SendDirectMessageResponse$ = [3, n0, _SDMRe, 0, [_m, _tIr], [0, 0] ]; var SubscriptionSummary$ = [3, n0, _SS, 0, [_tF, _q], [0, 1], 2 ]; var UpdateThingShadowRequest$ = [3, n0, _UTSR, 0, [_tN, _p, _sN], [[0, 1], [21, 16], [0, { [_hQ]: _n }]], 2 ]; var UpdateThingShadowResponse$ = [3, n0, _UTSRp, 0, [_p], [[21, 16]] ]; var __Unit = "unit"; var RetainedMessageList = [1, n0, _RML, 0, () => RetainedMessageSummary$ ]; var SubscriptionList = [1, n0, _SL, 0, () => SubscriptionSummary$ ]; var DeleteConnection$ = [9, n0, _DC, { [_h]: ["DELETE", "/connections/{clientId}", 200] }, () => DeleteConnectionRequest$, () => __Unit ]; var DeleteThingShadow$ = [9, n0, _DTS, { [_h]: ["DELETE", "/things/{thingName}/shadow", 200] }, () => DeleteThingShadowRequest$, () => DeleteThingShadowResponse$ ]; var GetConnection$ = [9, n0, _GC, { [_h]: ["GET", "/connections/{clientId}", 200] }, () => GetConnectionRequest$, () => GetConnectionResponse$ ]; var GetRetainedMessage$ = [9, n0, _GRM, { [_h]: ["GET", "/retainedMessage/{topic}", 200] }, () => GetRetainedMessageRequest$, () => GetRetainedMessageResponse$ ]; var GetThingShadow$ = [9, n0, _GTS, { [_h]: ["GET", "/things/{thingName}/shadow", 200] }, () => GetThingShadowRequest$, () => GetThingShadowResponse$ ]; var ListNamedShadowsForThing$ = [9, n0, _LNSFT, { [_h]: ["GET", "/api/things/shadow/ListNamedShadowsForThing/{thingName}", 200] }, () => ListNamedShadowsForThingRequest$, () => ListNamedShadowsForThingResponse$ ]; var ListRetainedMessages$ = [9, n0, _LRM, { [_h]: ["GET", "/retainedMessage", 200] }, () => ListRetainedMessagesRequest$, () => ListRetainedMessagesResponse$ ]; var ListSubscriptions$ = [9, n0, _LS, { [_h]: ["GET", "/connections/{clientId}/subscriptions", 200] }, () => ListSubscriptionsRequest$, () => ListSubscriptionsResponse$ ]; var Publish$ = [9, n0, _P, { [_h]: ["POST", "/topics/{topic}", 200] }, () => PublishRequest$, () => __Unit ]; var SendDirectMessage$ = [9, n0, _SDM, { [_h]: ["POST", "/connections/{clientId}/messages", 200] }, () => SendDirectMessageRequest$, () => SendDirectMessageResponse$ ]; var UpdateThingShadow$ = [9, n0, _UTS, { [_h]: ["POST", "/things/{thingName}/shadow", 200] }, () => UpdateThingShadowRequest$, () => UpdateThingShadowResponse$ ]; const getRuntimeConfig$1 = (config) => { return { apiVersion: "2015-05-28", base64Decoder: config?.base64Decoder ?? fromBase64, base64Encoder: config?.base64Encoder ?? toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultIoTDataPlaneHttpAuthSchemeProvider, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new AwsSdkSigV4Signer(), }, ], logger: config?.logger ?? new NoOpLogger(), protocol: config?.protocol ?? AwsRestJsonProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.iotdataplane", errorTypeRegistries, version: "2015-05-28", serviceTarget: "IotMoonrakerService", }, serviceId: config?.serviceId ?? "IoT Data Plane", sha256: config?.sha256 ?? Sha256, urlParser: config?.urlParser ?? parseUrl, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8, }; }; const getRuntimeConfig = (config) => { emitWarningIfUnsupportedVersion(process.version); const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getRuntimeConfig$1(config); emitWarningIfUnsupportedVersion$1(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger, }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? loadConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, }, config), streamCollector: config?.streamCollector ?? streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), }; }; const getHttpAuthExtensionConfiguration = (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; }, }; }; const resolveHttpAuthRuntimeConfig = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials(), }; }; const resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); }; class IoTDataPlaneClient extends Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = resolveUserAgentConfig(_config_1); const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveRegionConfig(_config_3); const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveHttpAuthSchemeConfig(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultIoTDataPlaneHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials, }), })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } } const command = makeBuilder(commonParams, "IotMoonrakerService", "IoTDataPlaneClient", getEndpointPlugin); const _ep0 = {}; const _mw0 = (Command, cs, config, o) => []; class DeleteConnectionCommand extends command(_ep0, _mw0, "DeleteConnection", DeleteConnection$) { } class DeleteThingShadowCommand extends command(_ep0, _mw0, "DeleteThingShadow", DeleteThingShadow$) { } class GetConnectionCommand extends command(_ep0, _mw0, "GetConnection", GetConnection$) { } class GetRetainedMessageCommand extends command(_ep0, _mw0, "GetRetainedMessage", GetRetainedMessage$) { } class GetThingShadowCommand extends command(_ep0, _mw0, "GetThingShadow", GetThingShadow$) { } class ListNamedShadowsForThingCommand extends command(_ep0, _mw0, "ListNamedShadowsForThing", ListNamedShadowsForThing$) { } class ListRetainedMessagesCommand extends command(_ep0, _mw0, "ListRetainedMessages", ListRetainedMessages$) { } class ListSubscriptionsCommand extends command(_ep0, _mw0, "ListSubscriptions", ListSubscriptions$) { } class PublishCommand extends command(_ep0, _mw0, "Publish", Publish$) { } class SendDirectMessageCommand extends command(_ep0, _mw0, "SendDirectMessage", SendDirectMessage$) { } class UpdateThingShadowCommand extends command(_ep0, _mw0, "UpdateThingShadow", UpdateThingShadow$) { } const paginateListRetainedMessages = createPaginator(IoTDataPlaneClient, ListRetainedMessagesCommand, "nextToken", "nextToken", "maxResults"); const paginateListSubscriptions = createPaginator(IoTDataPlaneClient, ListSubscriptionsCommand, "nextToken", "nextToken", "maxResults"); const commands = { DeleteConnectionCommand, DeleteThingShadowCommand, GetConnectionCommand, GetRetainedMessageCommand, GetThingShadowCommand, ListNamedShadowsForThingCommand, ListRetainedMessagesCommand, ListSubscriptionsCommand, PublishCommand, SendDirectMessageCommand, UpdateThingShadowCommand, }; const paginators = { paginateListRetainedMessages, paginateListSubscriptions, }; class IoTDataPlane extends IoTDataPlaneClient { } createAggregatedClient(commands, IoTDataPlane, { paginators }); const PayloadFormatIndicator = { UNSPECIFIED_BYTES: "UNSPECIFIED_BYTES", UTF8_DATA: "UTF8_DATA", }; exports.ConflictException = ConflictException; exports.ConflictException$ = ConflictException$; exports.DeleteConnection$ = DeleteConnection$; exports.DeleteConnectionCommand = DeleteConnectionCommand; exports.DeleteConnectionRequest$ = DeleteConnectionRequest$; exports.DeleteThingShadow$ = DeleteThingShadow$; exports.DeleteThingShadowCommand = DeleteThingShadowCommand; exports.DeleteThingShadowRequest$ = DeleteThingShadowRequest$; exports.DeleteThingShadowResponse$ = DeleteThingShadowResponse$; exports.ForbiddenException = ForbiddenException; exports.ForbiddenException$ = ForbiddenException$; exports.GatewayTimeoutException = GatewayTimeoutException; exports.GatewayTimeoutException$ = GatewayTimeoutException$; exports.GetConnection$ = GetConnection$; exports.GetConnectionCommand = GetConnectionCommand; exports.GetConnectionRequest$ = GetConnectionRequest$; exports.GetConnectionResponse$ = GetConnectionResponse$; exports.GetRetainedMessage$ = GetRetainedMessage$; exports.GetRetainedMessageCommand = GetRetainedMessageCommand; exports.GetRetainedMessageRequest$ = GetRetainedMessageRequest$; exports.GetRetainedMessageResponse$ = GetRetainedMessageResponse$; exports.GetThingShadow$ = GetThingShadow$; exports.GetThingShadowCommand = GetThingShadowCommand; exports.GetThingShadowRequest$ = GetThingShadowRequest$; exports.GetThingShadowResponse$ = GetThingShadowResponse$; exports.InternalFailureException = InternalFailureException; exports.InternalFailureException$ = InternalFailureException$; exports.InvalidRequestException = InvalidRequestException; exports.InvalidRequestException$ = InvalidRequestException$; exports.IoTDataPlane = IoTDataPlane; exports.IoTDataPlaneClient = IoTDataPlaneClient; exports.IoTDataPlaneServiceException = IoTDataPlaneServiceException; exports.IoTDataPlaneServiceException$ = IoTDataPlaneServiceException$; exports.ListNamedShadowsForThing$ = ListNamedShadowsForThing$; exports.ListNamedShadowsForThingCommand = ListNamedShadowsForThingCommand; exports.ListNamedShadowsForThingRequest$ = ListNamedShadowsForThingRequest$; exports.ListNamedShadowsForThingResponse$ = ListNamedShadowsForThingResponse$; exports.ListRetainedMessages$ = ListRetainedMessages$; exports.ListRetainedMessagesCommand = ListRetainedMessagesCommand; exports.ListRetainedMessagesRequest$ = ListRetainedMessagesRequest$; exports.ListRetainedMessagesResponse$ = ListRetainedMessagesResponse$; exports.ListSubscriptions$ = ListSubscriptions$; exports.ListSubscriptionsCommand = ListSubscriptionsCommand; exports.ListSubscriptionsRequest$ = ListSubscriptionsRequest$; exports.ListSubscriptionsResponse$ = ListSubscriptionsResponse$; exports.MethodNotAllowedException = MethodNotAllowedException; exports.MethodNotAllowedException$ = MethodNotAllowedException$; exports.PayloadFormatIndicator = PayloadFormatIndicator; exports.Publish$ = Publish$; exports.PublishCommand = PublishCommand; exports.PublishRequest$ = PublishRequest$; exports.RequestEntityTooLargeException = RequestEntityTooLargeException; exports.RequestEntityTooLargeException$ = RequestEntityTooLargeException$; exports.ResourceNotFoundException = ResourceNotFoundException; exports.ResourceNotFoundException$ = ResourceNotFoundException$; exports.RetainedMessageSummary$ = RetainedMessageSummary$; exports.SendDirectMessage$ = SendDirectMessage$; exports.SendDirectMessageCommand = SendDirectMessageCommand; exports.SendDirectMessageRequest$ = SendDirectMessageRequest$; exports.SendDirectMessageResponse$ = SendDirectMessageResponse$; exports.ServiceUnavailableException = ServiceUnavailableException; exports.ServiceUnavailableException$ = ServiceUnavailableException$; exports.SubscriptionSummary$ = SubscriptionSummary$; exports.ThrottlingException = ThrottlingException; exports.ThrottlingException$ = ThrottlingException$; exports.UnauthorizedException = UnauthorizedException; exports.UnauthorizedException$ = UnauthorizedException$; exports.UnsupportedDocumentEncodingException = UnsupportedDocumentEncodingException; exports.UnsupportedDocumentEncodingException$ = UnsupportedDocumentEncodingException$; exports.UpdateThingShadow$ = UpdateThingShadow$; exports.UpdateThingShadowCommand = UpdateThingShadowCommand; exports.UpdateThingShadowRequest$ = UpdateThingShadowRequest$; exports.UpdateThingShadowResponse$ = UpdateThingShadowResponse$; exports.errorTypeRegistries = errorTypeRegistries; exports.paginateListRetainedMessages = paginateListRetainedMessages; exports.paginateListSubscriptions = paginateListSubscriptions;