@cdk8s/awscdk-resolver 0.0.375 → 0.0.376
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.
- package/.jsii +2 -2
- package/lib/resolve.js +1 -1
- package/node_modules/@smithy/abort-controller/dist-cjs/index.js +28 -80
- package/node_modules/@smithy/abort-controller/dist-es/AbortController.js +1 -3
- package/node_modules/@smithy/abort-controller/dist-es/AbortSignal.js +2 -2
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/dist-cjs/index.js +158 -215
- package/node_modules/@smithy/config-resolver/package.json +5 -5
- package/node_modules/@smithy/core/dist-cjs/index.js +308 -412
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +957 -969
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +198 -249
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +793 -895
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +617 -811
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +584 -680
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +18 -18
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +9 -7
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +3 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +3 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +16 -8
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +14 -14
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +1 -1
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +4 -2
- package/node_modules/@smithy/core/package.json +11 -11
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +340 -412
- package/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js +2 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +190 -238
- package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -0
- package/node_modules/@smithy/fetch-http-handler/package.json +6 -6
- package/node_modules/@smithy/hash-node/dist-cjs/index.js +38 -63
- package/node_modules/@smithy/hash-node/dist-es/index.js +3 -0
- package/node_modules/@smithy/hash-node/package.json +4 -4
- package/node_modules/@smithy/invalid-dependency/dist-cjs/index.js +7 -38
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +4 -30
- package/node_modules/@smithy/is-array-buffer/package.json +1 -1
- package/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +39 -64
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +1 -1
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +219 -277
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +327 -380
- package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.browser.js +1 -1
- package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +2 -2
- package/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js +1 -0
- package/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js +5 -1
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +89 -118
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/dist-cjs/index.js +274 -297
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/dist-cjs/index.js +51 -98
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +663 -771
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +5 -3
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +4 -2
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +3 -1
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -4
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +3 -1
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/dist-cjs/index.js +105 -158
- package/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js +1 -1
- package/node_modules/@smithy/property-provider/dist-es/ProviderError.js +2 -1
- package/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js +1 -1
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/dist-cjs/index.js +154 -246
- package/node_modules/@smithy/protocol-http/dist-es/Field.js +3 -0
- package/node_modules/@smithy/protocol-http/dist-es/Fields.js +2 -1
- package/node_modules/@smithy/protocol-http/dist-es/httpRequest.js +11 -0
- package/node_modules/@smithy/protocol-http/dist-es/httpResponse.js +4 -0
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/dist-cjs/index.js +21 -47
- package/node_modules/@smithy/querystring-builder/package.json +3 -3
- package/node_modules/@smithy/querystring-parser/dist-cjs/index.js +22 -48
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +70 -103
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +171 -210
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +1 -1
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +525 -648
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +1 -1
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +6 -0
- package/node_modules/@smithy/signature-v4/package.json +8 -8
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +554 -747
- package/node_modules/@smithy/smithy-client/dist-es/client.js +4 -1
- package/node_modules/@smithy/smithy-client/dist-es/command.js +17 -18
- package/node_modules/@smithy/smithy-client/dist-es/exceptions.js +4 -0
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-cjs/index.js +80 -133
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/dist-cjs/index.js +20 -46
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-base64/dist-cjs/index.js +16 -24
- package/node_modules/@smithy/util-base64/package.json +3 -3
- package/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js +26 -50
- package/node_modules/@smithy/util-body-length-browser/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +27 -50
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +17 -44
- package/node_modules/@smithy/util-buffer-from/package.json +2 -2
- package/node_modules/@smithy/util-config-provider/dist-cjs/index.js +26 -56
- package/node_modules/@smithy/util-config-provider/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/index.js +9 -22
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +4 -5
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js +2 -2
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +65 -110
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +445 -526
- package/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js +3 -2
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +29 -58
- package/node_modules/@smithy/util-hex-encoding/package.json +1 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/index.js +11 -40
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +260 -340
- package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +4 -1
- package/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js +1 -0
- package/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js +17 -8
- package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +5 -3
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js +3 -2
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +7 -3
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +2 -3
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +1 -1
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +2 -3
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.js +4 -8
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +83 -93
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +3 -7
- package/node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js +3 -2
- package/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js +5 -0
- package/node_modules/@smithy/util-stream/dist-es/headStream.js +3 -6
- package/node_modules/@smithy/util-stream/package.json +8 -8
- package/node_modules/@smithy/util-uri-escape/dist-cjs/index.js +6 -40
- package/node_modules/@smithy/util-uri-escape/package.json +1 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/index.js +27 -60
- package/node_modules/@smithy/util-utf8/package.json +2 -2
- package/node_modules/@smithy/util-waiter/dist-cjs/index.js +152 -189
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/node_modules/@smithy/uuid/dist-cjs/index.js +33 -42
- package/node_modules/@smithy/uuid/package.json +1 -1
- package/package.json +3 -3
- package/node_modules/@smithy/abort-controller/dist-cjs/AbortController.js +0 -1
- package/node_modules/@smithy/abort-controller/dist-cjs/AbortSignal.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/index.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/config.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/getRealRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/index.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/isFipsRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariant.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/PartitionHash.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/RegionHash.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getRegionInfo.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/index.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/Endpoint.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointMode.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/error/InstanceMetadataV1FallbackError.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromContainerMetadata.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromInstanceMetadata.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/index.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/retry.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/create-request.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/fetch-http-handler.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/request-timeout.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/stream-collector.js +0 -1
- package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidFunction.js +0 -1
- package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidProvider.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js +0 -1
- package/node_modules/@smithy/middleware-stack/dist-cjs/MiddlewareStack.js +0 -1
- package/node_modules/@smithy/middleware-stack/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/configLoader.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromEnv.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromSharedConfigFiles.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromStatic.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/getSelectorName.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/get-transformed-headers.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-manager.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-pool.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/readable.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/server.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-connection-timeout.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-keep-alive.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-timeout.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/collector.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/index.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/readable.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/timing.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/write-request-body.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/CredentialsProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/ProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/TokenProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/chain.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/fromStatic.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/memoize.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/Field.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/Fields.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/httpExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/index.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/service-error-classification/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/externalDataInterceptor.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigFilepath.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getProfileName.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSsoSessionData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/mergeConfigFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseIni.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseKnownFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/HeaderFormatter.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4Base.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/credentialDerivation.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalHeaders.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalQuery.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getPayloadHash.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/headerUtil.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/moveHeadersToQuery.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/prepareRequest.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/signature-v4a-container.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/suite.fixture.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/utilDate.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/abort-handler.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/abort.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpApiKeyAuth.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthScheme.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthSchemeProvider.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpSigner.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/IdentityProviderConfig.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/auth.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/blob/blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/checksum.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/client.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/command.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/config.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/manager.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/pool.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/crypto.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/downlevel-ts3.4/transform/type-transform.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/encode.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoint.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/shared.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/eventStream.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/checksum.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/defaultExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/retry.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/externals-check/browser-externals-check.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/feature-ids.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/http/httpHandlerInitialization.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/http.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/apiKeyIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/identity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/tokenIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/logger.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/middleware.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/pagination.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/profile.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/response.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/retry.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/schema.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/sentinels.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/traits.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/serde.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/shapes.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/signature.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/stream.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-common-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-output-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transfer.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/client-method-transforms.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/client-payload-blob-type-narrow.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/exact.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/mutable.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/no-undefined.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/type-transform.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/uri.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/util.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/waiter.js +0 -1
- package/node_modules/@smithy/util-body-length-browser/dist-cjs/calculateBodyLength.js +0 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/calculateBodyLength.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/booleanSelector.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/numberSelector.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/cache/EndpointCache.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/debugId.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/toDebugString.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/getEndpointUrlConfig.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/booleanEquals.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttr.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttrPathList.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isIpAddress.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isSet.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isValidHostLabel.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/not.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/parseURL.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/stringEquals.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/substring.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/uriEncode.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/resolveEndpoint.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointError.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/RuleSetObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/shared.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/callFunction.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/customEndpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/endpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateCondition.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateConditions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateErrorRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateExpression.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateRules.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTemplate.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTreeRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointHeaders.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperties.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperty.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointUrl.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getReferenceValue.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/index.js +0 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/getSmithyContext.js +0 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/DefaultRateLimiter.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/config.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryBackoffStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryToken.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/util-stream/dist-cjs/blob/Uint8ArrayBlobAdapter.js +0 -1
- package/node_modules/@smithy/util-stream/dist-cjs/blob/transforms.js +0 -1
- package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri-path.js +0 -1
- package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.browser.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUint8Array.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.browser.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/createWaiter.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/poller.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/index.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/sleep.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/validate.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/waiter.js +0 -1
- package/node_modules/@smithy/uuid/dist-cjs/randomUUID.browser.js +0 -1
- package/node_modules/@smithy/uuid/dist-cjs/v4.js +0 -1
|
@@ -1,544 +1,463 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const { value, done } = keys.next();
|
|
69
|
-
this.data.delete(value);
|
|
70
|
-
if (done || ++i > 10) {
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var types = require('@smithy/types');
|
|
4
|
+
|
|
5
|
+
class EndpointCache {
|
|
6
|
+
capacity;
|
|
7
|
+
data = new Map();
|
|
8
|
+
parameters = [];
|
|
9
|
+
constructor({ size, params }) {
|
|
10
|
+
this.capacity = size ?? 50;
|
|
11
|
+
if (params) {
|
|
12
|
+
this.parameters = params;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
get(endpointParams, resolver) {
|
|
16
|
+
const key = this.hash(endpointParams);
|
|
17
|
+
if (key === false) {
|
|
18
|
+
return resolver();
|
|
19
|
+
}
|
|
20
|
+
if (!this.data.has(key)) {
|
|
21
|
+
if (this.data.size > this.capacity + 10) {
|
|
22
|
+
const keys = this.data.keys();
|
|
23
|
+
let i = 0;
|
|
24
|
+
while (true) {
|
|
25
|
+
const { value, done } = keys.next();
|
|
26
|
+
this.data.delete(value);
|
|
27
|
+
if (done || ++i > 10) {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
this.data.set(key, resolver());
|
|
33
|
+
}
|
|
34
|
+
return this.data.get(key);
|
|
35
|
+
}
|
|
36
|
+
size() {
|
|
37
|
+
return this.data.size;
|
|
38
|
+
}
|
|
39
|
+
hash(endpointParams) {
|
|
40
|
+
let buffer = "";
|
|
41
|
+
const { parameters } = this;
|
|
42
|
+
if (parameters.length === 0) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
for (const param of parameters) {
|
|
46
|
+
const val = String(endpointParams[param] ?? "");
|
|
47
|
+
if (val.includes("|;")) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
buffer += val + "|;";
|
|
51
|
+
}
|
|
52
|
+
return buffer;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`);
|
|
57
|
+
const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]"));
|
|
58
|
+
|
|
59
|
+
const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
60
|
+
const isValidHostLabel = (value, allowSubDomains = false) => {
|
|
61
|
+
if (!allowSubDomains) {
|
|
62
|
+
return VALID_HOST_LABEL_REGEX.test(value);
|
|
63
|
+
}
|
|
64
|
+
const labels = value.split(".");
|
|
65
|
+
for (const label of labels) {
|
|
66
|
+
if (!isValidHostLabel(label)) {
|
|
67
|
+
return false;
|
|
73
68
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
return this.data.get(key);
|
|
78
|
-
}
|
|
79
|
-
size() {
|
|
80
|
-
return this.data.size;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @returns cache key or false if not cachable.
|
|
84
|
-
*/
|
|
85
|
-
hash(endpointParams) {
|
|
86
|
-
let buffer = "";
|
|
87
|
-
const { parameters } = this;
|
|
88
|
-
if (parameters.length === 0) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
for (const param of parameters) {
|
|
92
|
-
const val = String(endpointParams[param] ?? "");
|
|
93
|
-
if (val.includes("|;")) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
buffer += val + "|;";
|
|
97
|
-
}
|
|
98
|
-
return buffer;
|
|
99
|
-
}
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
100
71
|
};
|
|
101
72
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
var isIpAddress = /* @__PURE__ */ __name((value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"), "isIpAddress");
|
|
107
|
-
|
|
108
|
-
// src/lib/isValidHostLabel.ts
|
|
109
|
-
var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
110
|
-
var isValidHostLabel = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
|
|
111
|
-
if (!allowSubDomains) {
|
|
112
|
-
return VALID_HOST_LABEL_REGEX.test(value);
|
|
113
|
-
}
|
|
114
|
-
const labels = value.split(".");
|
|
115
|
-
for (const label of labels) {
|
|
116
|
-
if (!isValidHostLabel(label)) {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return true;
|
|
121
|
-
}, "isValidHostLabel");
|
|
122
|
-
|
|
123
|
-
// src/utils/customEndpointFunctions.ts
|
|
124
|
-
var customEndpointFunctions = {};
|
|
125
|
-
|
|
126
|
-
// src/debug/debugId.ts
|
|
127
|
-
var debugId = "endpoints";
|
|
128
|
-
|
|
129
|
-
// src/debug/toDebugString.ts
|
|
73
|
+
const customEndpointFunctions = {};
|
|
74
|
+
|
|
75
|
+
const debugId = "endpoints";
|
|
76
|
+
|
|
130
77
|
function toDebugString(input) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
78
|
+
if (typeof input !== "object" || input == null) {
|
|
79
|
+
return input;
|
|
80
|
+
}
|
|
81
|
+
if ("ref" in input) {
|
|
82
|
+
return `$${toDebugString(input.ref)}`;
|
|
83
|
+
}
|
|
84
|
+
if ("fn" in input) {
|
|
85
|
+
return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
|
|
86
|
+
}
|
|
87
|
+
return JSON.stringify(input, null, 2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class EndpointError extends Error {
|
|
91
|
+
constructor(message) {
|
|
92
|
+
super(message);
|
|
93
|
+
this.name = "EndpointError";
|
|
94
|
+
}
|
|
141
95
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
96
|
+
|
|
97
|
+
const booleanEquals = (value1, value2) => value1 === value2;
|
|
98
|
+
|
|
99
|
+
const getAttrPathList = (path) => {
|
|
100
|
+
const parts = path.split(".");
|
|
101
|
+
const pathList = [];
|
|
102
|
+
for (const part of parts) {
|
|
103
|
+
const squareBracketIndex = part.indexOf("[");
|
|
104
|
+
if (squareBracketIndex !== -1) {
|
|
105
|
+
if (part.indexOf("]") !== part.length - 1) {
|
|
106
|
+
throw new EndpointError(`Path: '${path}' does not end with ']'`);
|
|
107
|
+
}
|
|
108
|
+
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
109
|
+
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
110
|
+
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
|
|
111
|
+
}
|
|
112
|
+
if (squareBracketIndex !== 0) {
|
|
113
|
+
pathList.push(part.slice(0, squareBracketIndex));
|
|
114
|
+
}
|
|
115
|
+
pathList.push(arrayIndex);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
pathList.push(part);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return pathList;
|
|
153
122
|
};
|
|
154
123
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (squareBracketIndex !== 0) {
|
|
173
|
-
pathList.push(part.slice(0, squareBracketIndex));
|
|
174
|
-
}
|
|
175
|
-
pathList.push(arrayIndex);
|
|
176
|
-
} else {
|
|
177
|
-
pathList.push(part);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return pathList;
|
|
181
|
-
}, "getAttrPathList");
|
|
182
|
-
|
|
183
|
-
// src/lib/getAttr.ts
|
|
184
|
-
var getAttr = /* @__PURE__ */ __name((value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
185
|
-
if (typeof acc !== "object") {
|
|
186
|
-
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
187
|
-
} else if (Array.isArray(acc)) {
|
|
188
|
-
return acc[parseInt(index)];
|
|
189
|
-
}
|
|
190
|
-
return acc[index];
|
|
191
|
-
}, value), "getAttr");
|
|
192
|
-
|
|
193
|
-
// src/lib/isSet.ts
|
|
194
|
-
var isSet = /* @__PURE__ */ __name((value) => value != null, "isSet");
|
|
195
|
-
|
|
196
|
-
// src/lib/not.ts
|
|
197
|
-
var not = /* @__PURE__ */ __name((value) => !value, "not");
|
|
198
|
-
|
|
199
|
-
// src/lib/parseURL.ts
|
|
200
|
-
var import_types3 = require("@smithy/types");
|
|
201
|
-
var DEFAULT_PORTS = {
|
|
202
|
-
[import_types3.EndpointURLScheme.HTTP]: 80,
|
|
203
|
-
[import_types3.EndpointURLScheme.HTTPS]: 443
|
|
124
|
+
const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
125
|
+
if (typeof acc !== "object") {
|
|
126
|
+
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
127
|
+
}
|
|
128
|
+
else if (Array.isArray(acc)) {
|
|
129
|
+
return acc[parseInt(index)];
|
|
130
|
+
}
|
|
131
|
+
return acc[index];
|
|
132
|
+
}, value);
|
|
133
|
+
|
|
134
|
+
const isSet = (value) => value != null;
|
|
135
|
+
|
|
136
|
+
const not = (value) => !value;
|
|
137
|
+
|
|
138
|
+
const DEFAULT_PORTS = {
|
|
139
|
+
[types.EndpointURLScheme.HTTP]: 80,
|
|
140
|
+
[types.EndpointURLScheme.HTTPS]: 443,
|
|
204
141
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
scheme
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
// src/lib/substring.ts
|
|
251
|
-
var substring = /* @__PURE__ */ __name((input, start, stop, reverse) => {
|
|
252
|
-
if (start >= stop || input.length < stop) {
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
|
-
if (!reverse) {
|
|
256
|
-
return input.substring(start, stop);
|
|
257
|
-
}
|
|
258
|
-
return input.substring(input.length - stop, input.length - start);
|
|
259
|
-
}, "substring");
|
|
260
|
-
|
|
261
|
-
// src/lib/uriEncode.ts
|
|
262
|
-
var uriEncode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`), "uriEncode");
|
|
263
|
-
|
|
264
|
-
// src/utils/endpointFunctions.ts
|
|
265
|
-
var endpointFunctions = {
|
|
266
|
-
booleanEquals,
|
|
267
|
-
getAttr,
|
|
268
|
-
isSet,
|
|
269
|
-
isValidHostLabel,
|
|
270
|
-
not,
|
|
271
|
-
parseURL,
|
|
272
|
-
stringEquals,
|
|
273
|
-
substring,
|
|
274
|
-
uriEncode
|
|
142
|
+
const parseURL = (value) => {
|
|
143
|
+
const whatwgURL = (() => {
|
|
144
|
+
try {
|
|
145
|
+
if (value instanceof URL) {
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
if (typeof value === "object" && "hostname" in value) {
|
|
149
|
+
const { hostname, port, protocol = "", path = "", query = {} } = value;
|
|
150
|
+
const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`);
|
|
151
|
+
url.search = Object.entries(query)
|
|
152
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
153
|
+
.join("&");
|
|
154
|
+
return url;
|
|
155
|
+
}
|
|
156
|
+
return new URL(value);
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
})();
|
|
162
|
+
if (!whatwgURL) {
|
|
163
|
+
console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
const urlString = whatwgURL.href;
|
|
167
|
+
const { host, hostname, pathname, protocol, search } = whatwgURL;
|
|
168
|
+
if (search) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const scheme = protocol.slice(0, -1);
|
|
172
|
+
if (!Object.values(types.EndpointURLScheme).includes(scheme)) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
const isIp = isIpAddress(hostname);
|
|
176
|
+
const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) ||
|
|
177
|
+
(typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`));
|
|
178
|
+
const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
|
|
179
|
+
return {
|
|
180
|
+
scheme,
|
|
181
|
+
authority,
|
|
182
|
+
path: pathname,
|
|
183
|
+
normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
|
|
184
|
+
isIp,
|
|
185
|
+
};
|
|
275
186
|
};
|
|
276
187
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
currentIndex = closingBraceIndex + 1;
|
|
309
|
-
}
|
|
310
|
-
return evaluatedTemplateArr.join("");
|
|
311
|
-
}, "evaluateTemplate");
|
|
312
|
-
|
|
313
|
-
// src/utils/getReferenceValue.ts
|
|
314
|
-
var getReferenceValue = /* @__PURE__ */ __name(({ ref }, options) => {
|
|
315
|
-
const referenceRecord = {
|
|
316
|
-
...options.endpointParams,
|
|
317
|
-
...options.referenceRecord
|
|
318
|
-
};
|
|
319
|
-
return referenceRecord[ref];
|
|
320
|
-
}, "getReferenceValue");
|
|
321
|
-
|
|
322
|
-
// src/utils/evaluateExpression.ts
|
|
323
|
-
var evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options) => {
|
|
324
|
-
if (typeof obj === "string") {
|
|
325
|
-
return evaluateTemplate(obj, options);
|
|
326
|
-
} else if (obj["fn"]) {
|
|
327
|
-
return callFunction(obj, options);
|
|
328
|
-
} else if (obj["ref"]) {
|
|
329
|
-
return getReferenceValue(obj, options);
|
|
330
|
-
}
|
|
331
|
-
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
|
332
|
-
}, "evaluateExpression");
|
|
333
|
-
|
|
334
|
-
// src/utils/callFunction.ts
|
|
335
|
-
var callFunction = /* @__PURE__ */ __name(({ fn, argv }, options) => {
|
|
336
|
-
const evaluatedArgs = argv.map(
|
|
337
|
-
(arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options)
|
|
338
|
-
);
|
|
339
|
-
const fnSegments = fn.split(".");
|
|
340
|
-
if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
|
|
341
|
-
return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
|
|
342
|
-
}
|
|
343
|
-
return endpointFunctions[fn](...evaluatedArgs);
|
|
344
|
-
}, "callFunction");
|
|
345
|
-
|
|
346
|
-
// src/utils/evaluateCondition.ts
|
|
347
|
-
var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => {
|
|
348
|
-
if (assign && assign in options.referenceRecord) {
|
|
349
|
-
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
|
|
350
|
-
}
|
|
351
|
-
const value = callFunction(fnArgs, options);
|
|
352
|
-
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
|
|
353
|
-
return {
|
|
354
|
-
result: value === "" ? true : !!value,
|
|
355
|
-
...assign != null && { toAssign: { name: assign, value } }
|
|
356
|
-
};
|
|
357
|
-
}, "evaluateCondition");
|
|
358
|
-
|
|
359
|
-
// src/utils/evaluateConditions.ts
|
|
360
|
-
var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => {
|
|
361
|
-
const conditionsReferenceRecord = {};
|
|
362
|
-
for (const condition of conditions) {
|
|
363
|
-
const { result, toAssign } = evaluateCondition(condition, {
|
|
364
|
-
...options,
|
|
365
|
-
referenceRecord: {
|
|
188
|
+
const stringEquals = (value1, value2) => value1 === value2;
|
|
189
|
+
|
|
190
|
+
const substring = (input, start, stop, reverse) => {
|
|
191
|
+
if (start >= stop || input.length < stop) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
if (!reverse) {
|
|
195
|
+
return input.substring(start, stop);
|
|
196
|
+
}
|
|
197
|
+
return input.substring(input.length - stop, input.length - start);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
201
|
+
|
|
202
|
+
const endpointFunctions = {
|
|
203
|
+
booleanEquals,
|
|
204
|
+
getAttr,
|
|
205
|
+
isSet,
|
|
206
|
+
isValidHostLabel,
|
|
207
|
+
not,
|
|
208
|
+
parseURL,
|
|
209
|
+
stringEquals,
|
|
210
|
+
substring,
|
|
211
|
+
uriEncode,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const evaluateTemplate = (template, options) => {
|
|
215
|
+
const evaluatedTemplateArr = [];
|
|
216
|
+
const templateContext = {
|
|
217
|
+
...options.endpointParams,
|
|
366
218
|
...options.referenceRecord,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
219
|
+
};
|
|
220
|
+
let currentIndex = 0;
|
|
221
|
+
while (currentIndex < template.length) {
|
|
222
|
+
const openingBraceIndex = template.indexOf("{", currentIndex);
|
|
223
|
+
if (openingBraceIndex === -1) {
|
|
224
|
+
evaluatedTemplateArr.push(template.slice(currentIndex));
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
|
|
228
|
+
const closingBraceIndex = template.indexOf("}", openingBraceIndex);
|
|
229
|
+
if (closingBraceIndex === -1) {
|
|
230
|
+
evaluatedTemplateArr.push(template.slice(openingBraceIndex));
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
|
|
234
|
+
evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
|
|
235
|
+
currentIndex = closingBraceIndex + 2;
|
|
236
|
+
}
|
|
237
|
+
const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
|
|
238
|
+
if (parameterName.includes("#")) {
|
|
239
|
+
const [refName, attrName] = parameterName.split("#");
|
|
240
|
+
evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
evaluatedTemplateArr.push(templateContext[parameterName]);
|
|
244
|
+
}
|
|
245
|
+
currentIndex = closingBraceIndex + 1;
|
|
372
246
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
247
|
+
return evaluatedTemplateArr.join("");
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const getReferenceValue = ({ ref }, options) => {
|
|
251
|
+
const referenceRecord = {
|
|
252
|
+
...options.endpointParams,
|
|
253
|
+
...options.referenceRecord,
|
|
254
|
+
};
|
|
255
|
+
return referenceRecord[ref];
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const evaluateExpression = (obj, keyName, options) => {
|
|
259
|
+
if (typeof obj === "string") {
|
|
260
|
+
return evaluateTemplate(obj, options);
|
|
261
|
+
}
|
|
262
|
+
else if (obj["fn"]) {
|
|
263
|
+
return callFunction(obj, options);
|
|
264
|
+
}
|
|
265
|
+
else if (obj["ref"]) {
|
|
266
|
+
return getReferenceValue(obj, options);
|
|
267
|
+
}
|
|
268
|
+
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const callFunction = ({ fn, argv }, options) => {
|
|
272
|
+
const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options));
|
|
273
|
+
const fnSegments = fn.split(".");
|
|
274
|
+
if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
|
|
275
|
+
return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
|
|
276
|
+
}
|
|
277
|
+
return endpointFunctions[fn](...evaluatedArgs);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const evaluateCondition = ({ assign, ...fnArgs }, options) => {
|
|
281
|
+
if (assign && assign in options.referenceRecord) {
|
|
282
|
+
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
|
|
283
|
+
}
|
|
284
|
+
const value = callFunction(fnArgs, options);
|
|
285
|
+
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
|
|
286
|
+
return {
|
|
287
|
+
result: value === "" ? true : !!value,
|
|
288
|
+
...(assign != null && { toAssign: { name: assign, value } }),
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
const evaluateConditions = (conditions = [], options) => {
|
|
293
|
+
const conditionsReferenceRecord = {};
|
|
294
|
+
for (const condition of conditions) {
|
|
295
|
+
const { result, toAssign } = evaluateCondition(condition, {
|
|
296
|
+
...options,
|
|
297
|
+
referenceRecord: {
|
|
298
|
+
...options.referenceRecord,
|
|
299
|
+
...conditionsReferenceRecord,
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
if (!result) {
|
|
303
|
+
return { result };
|
|
304
|
+
}
|
|
305
|
+
if (toAssign) {
|
|
306
|
+
conditionsReferenceRecord[toAssign.name] = toAssign.value;
|
|
307
|
+
options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
|
|
308
|
+
}
|
|
376
309
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}, "evaluateConditions");
|
|
310
|
+
return { result: true, referenceRecord: conditionsReferenceRecord };
|
|
311
|
+
};
|
|
380
312
|
|
|
381
|
-
|
|
382
|
-
var getEndpointHeaders = /* @__PURE__ */ __name((headers, options) => Object.entries(headers).reduce(
|
|
383
|
-
(acc, [headerKey, headerVal]) => ({
|
|
313
|
+
const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
|
|
384
314
|
...acc,
|
|
385
315
|
[headerKey]: headerVal.map((headerValEntry) => {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
})
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}, "getEndpointProperty");
|
|
415
|
-
|
|
416
|
-
// src/utils/getEndpointProperties.ts
|
|
417
|
-
var getEndpointProperties = /* @__PURE__ */ __name((properties, options) => Object.entries(properties).reduce(
|
|
418
|
-
(acc, [propertyKey, propertyVal]) => ({
|
|
316
|
+
const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
|
|
317
|
+
if (typeof processedExpr !== "string") {
|
|
318
|
+
throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
|
|
319
|
+
}
|
|
320
|
+
return processedExpr;
|
|
321
|
+
}),
|
|
322
|
+
}), {});
|
|
323
|
+
|
|
324
|
+
const getEndpointProperty = (property, options) => {
|
|
325
|
+
if (Array.isArray(property)) {
|
|
326
|
+
return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
|
|
327
|
+
}
|
|
328
|
+
switch (typeof property) {
|
|
329
|
+
case "string":
|
|
330
|
+
return evaluateTemplate(property, options);
|
|
331
|
+
case "object":
|
|
332
|
+
if (property === null) {
|
|
333
|
+
throw new EndpointError(`Unexpected endpoint property: ${property}`);
|
|
334
|
+
}
|
|
335
|
+
return getEndpointProperties(property, options);
|
|
336
|
+
case "boolean":
|
|
337
|
+
return property;
|
|
338
|
+
default:
|
|
339
|
+
throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({
|
|
419
344
|
...acc,
|
|
420
|
-
[propertyKey]: getEndpointProperty(propertyVal, options)
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
})
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return endpoint;
|
|
533
|
-
}, "resolveEndpoint");
|
|
534
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
535
|
-
|
|
536
|
-
0 && (module.exports = {
|
|
537
|
-
EndpointCache,
|
|
538
|
-
isIpAddress,
|
|
539
|
-
isValidHostLabel,
|
|
540
|
-
customEndpointFunctions,
|
|
541
|
-
resolveEndpoint,
|
|
542
|
-
EndpointError
|
|
543
|
-
});
|
|
345
|
+
[propertyKey]: getEndpointProperty(propertyVal, options),
|
|
346
|
+
}), {});
|
|
347
|
+
|
|
348
|
+
const getEndpointUrl = (endpointUrl, options) => {
|
|
349
|
+
const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
|
|
350
|
+
if (typeof expression === "string") {
|
|
351
|
+
try {
|
|
352
|
+
return new URL(expression);
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
console.error(`Failed to construct URL with ${expression}`, error);
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
const evaluateEndpointRule = (endpointRule, options) => {
|
|
363
|
+
const { conditions, endpoint } = endpointRule;
|
|
364
|
+
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
365
|
+
if (!result) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const endpointRuleOptions = {
|
|
369
|
+
...options,
|
|
370
|
+
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
371
|
+
};
|
|
372
|
+
const { url, properties, headers } = endpoint;
|
|
373
|
+
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
|
|
374
|
+
return {
|
|
375
|
+
...(headers != undefined && {
|
|
376
|
+
headers: getEndpointHeaders(headers, endpointRuleOptions),
|
|
377
|
+
}),
|
|
378
|
+
...(properties != undefined && {
|
|
379
|
+
properties: getEndpointProperties(properties, endpointRuleOptions),
|
|
380
|
+
}),
|
|
381
|
+
url: getEndpointUrl(url, endpointRuleOptions),
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
const evaluateErrorRule = (errorRule, options) => {
|
|
386
|
+
const { conditions, error } = errorRule;
|
|
387
|
+
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
388
|
+
if (!result) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
throw new EndpointError(evaluateExpression(error, "Error", {
|
|
392
|
+
...options,
|
|
393
|
+
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
394
|
+
}));
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const evaluateTreeRule = (treeRule, options) => {
|
|
398
|
+
const { conditions, rules } = treeRule;
|
|
399
|
+
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
400
|
+
if (!result) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
return evaluateRules(rules, {
|
|
404
|
+
...options,
|
|
405
|
+
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
const evaluateRules = (rules, options) => {
|
|
410
|
+
for (const rule of rules) {
|
|
411
|
+
if (rule.type === "endpoint") {
|
|
412
|
+
const endpointOrUndefined = evaluateEndpointRule(rule, options);
|
|
413
|
+
if (endpointOrUndefined) {
|
|
414
|
+
return endpointOrUndefined;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
else if (rule.type === "error") {
|
|
418
|
+
evaluateErrorRule(rule, options);
|
|
419
|
+
}
|
|
420
|
+
else if (rule.type === "tree") {
|
|
421
|
+
const endpointOrUndefined = evaluateTreeRule(rule, options);
|
|
422
|
+
if (endpointOrUndefined) {
|
|
423
|
+
return endpointOrUndefined;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
throw new EndpointError(`Unknown endpoint rule: ${rule}`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
throw new EndpointError(`Rules evaluation failed`);
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
const resolveEndpoint = (ruleSetObject, options) => {
|
|
434
|
+
const { endpointParams, logger } = options;
|
|
435
|
+
const { parameters, rules } = ruleSetObject;
|
|
436
|
+
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
437
|
+
const paramsWithDefault = Object.entries(parameters)
|
|
438
|
+
.filter(([, v]) => v.default != null)
|
|
439
|
+
.map(([k, v]) => [k, v.default]);
|
|
440
|
+
if (paramsWithDefault.length > 0) {
|
|
441
|
+
for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
|
|
442
|
+
endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
const requiredParams = Object.entries(parameters)
|
|
446
|
+
.filter(([, v]) => v.required)
|
|
447
|
+
.map(([k]) => k);
|
|
448
|
+
for (const requiredParam of requiredParams) {
|
|
449
|
+
if (endpointParams[requiredParam] == null) {
|
|
450
|
+
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
|
|
454
|
+
options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
|
|
455
|
+
return endpoint;
|
|
456
|
+
};
|
|
544
457
|
|
|
458
|
+
exports.EndpointCache = EndpointCache;
|
|
459
|
+
exports.EndpointError = EndpointError;
|
|
460
|
+
exports.customEndpointFunctions = customEndpointFunctions;
|
|
461
|
+
exports.isIpAddress = isIpAddress;
|
|
462
|
+
exports.isValidHostLabel = isValidHostLabel;
|
|
463
|
+
exports.resolveEndpoint = resolveEndpoint;
|