@cdklabs/cdk-ssm-documents 0.0.55 → 0.0.57
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 +12 -12
- package/lib/construct/synth-utils.js +1 -1
- package/lib/document/automation-document.js +1 -1
- package/lib/document/command-document.js +1 -1
- package/lib/document/document-builder.js +2 -2
- package/lib/document/ssm-document.js +1 -1
- package/lib/domain/aws-service.js +1 -1
- package/lib/domain/choice.js +1 -1
- package/lib/domain/data-type.js +1 -1
- package/lib/domain/enum/install-action.js +2 -2
- package/lib/domain/enum/install-uninstall-repair.js +2 -2
- package/lib/domain/enum/installation-type.js +2 -2
- package/lib/domain/enum/package-name.js +2 -2
- package/lib/domain/input.js +1 -1
- package/lib/domain/operation.js +1 -1
- package/lib/domain/platform.js +1 -1
- package/lib/domain/precondition.js +1 -1
- package/lib/incident-response/incident-response.js +3 -3
- package/lib/interface/approve-hook.js +2 -2
- package/lib/interface/auth-method.js +3 -3
- package/lib/interface/aws-invoker.js +2 -2
- package/lib/interface/downloadable-content.js +8 -8
- package/lib/interface/environment.js +3 -3
- package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
- package/lib/interface/observer.js +1 -1
- package/lib/interface/on-failure.js +6 -6
- package/lib/interface/pause-hook.js +2 -2
- package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
- package/lib/interface/run-document-location.js +2 -2
- package/lib/interface/sleep-hook.js +2 -2
- package/lib/interface/step-ref.js +1 -1
- package/lib/interface/variables/boolean-variable.js +2 -2
- package/lib/interface/variables/map-list-variable.js +2 -2
- package/lib/interface/variables/number-variable.js +2 -2
- package/lib/interface/variables/secure-string-variable.js +4 -4
- package/lib/interface/variables/string-list-variable.js +2 -2
- package/lib/interface/variables/string-map-variable.js +2 -2
- package/lib/interface/variables/string-variable.js +4 -4
- package/lib/interface/variables/variable.js +2 -2
- package/lib/interface/webhook.js +1 -1
- package/lib/parent-steps/automation/approve-step.js +1 -1
- package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
- package/lib/parent-steps/automation/aws-api-step.js +1 -1
- package/lib/parent-steps/automation/branch-step.js +1 -1
- package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
- package/lib/parent-steps/automation/copy-image-step.js +1 -1
- package/lib/parent-steps/automation/create-image-step.js +1 -1
- package/lib/parent-steps/automation/create-stack-step.js +3 -3
- package/lib/parent-steps/automation/create-tags-step.js +3 -3
- package/lib/parent-steps/automation/delete-image-step.js +1 -1
- package/lib/parent-steps/automation/delete-stack-step.js +1 -1
- package/lib/parent-steps/automation/execute-automation-step.js +1 -1
- package/lib/parent-steps/automation/execute-script-step.js +5 -5
- package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
- package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
- package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
- package/lib/parent-steps/automation/pause-step.js +1 -1
- package/lib/parent-steps/automation/run-command-step.js +3 -3
- package/lib/parent-steps/automation/run-instance-step.js +1 -1
- package/lib/parent-steps/automation/sleep-step.js +1 -1
- package/lib/parent-steps/automation/update-variable.js +1 -1
- package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
- package/lib/parent-steps/automation-step.js +1 -1
- package/lib/parent-steps/command/applications-step.js +1 -1
- package/lib/parent-steps/command/configure-docker-step.js +1 -1
- package/lib/parent-steps/command/configure-package-step.js +1 -1
- package/lib/parent-steps/command/domain-join-step.js +1 -1
- package/lib/parent-steps/command/download-content-step.js +1 -1
- package/lib/parent-steps/command/ps-module-step.js +1 -1
- package/lib/parent-steps/command/run-docker-action-step.js +1 -1
- package/lib/parent-steps/command/run-document-step.js +1 -1
- package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
- package/lib/parent-steps/command/run-shell-script-step.js +1 -1
- package/lib/parent-steps/command/software-inventory-step.js +1 -1
- package/lib/parent-steps/command/update-agent-step.js +1 -1
- package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
- package/lib/parent-steps/command-step.js +1 -1
- package/lib/parent-steps/step.js +1 -1
- package/lib/patterns/automation/composite-step.js +2 -2
- package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
- package/lib/patterns/automation/string-step.js +1 -1
- package/lib/patterns/document/string-document.js +1 -1
- package/lib/patterns/document/timed-document.js +1 -1
- package/lib/samples/hello-world.js +1 -1
- package/lib/simulation/automation/approve-simulation.js +1 -1
- package/lib/simulation/automation/assert-aws-resource-simulation.js +1 -1
- package/lib/simulation/automation/automation-simulation-base.js +1 -1
- package/lib/simulation/automation/aws-api-simulation.js +1 -1
- package/lib/simulation/automation/branch-simulation.js +1 -1
- package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
- package/lib/simulation/automation/copy-image-simulation.js +1 -1
- package/lib/simulation/automation/create-image-simulation.js +1 -1
- package/lib/simulation/automation/create-stack-simulation.js +1 -1
- package/lib/simulation/automation/create-tags-simulation.js +1 -1
- package/lib/simulation/automation/delete-image-simulation.js +1 -1
- package/lib/simulation/automation/delete-stack-simulation.js +1 -1
- package/lib/simulation/automation/execute-script-simulation.js +1 -1
- package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
- package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
- package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
- package/lib/simulation/automation/pause-simulation.js +1 -1
- package/lib/simulation/automation/run-command-simulation.js +1 -1
- package/lib/simulation/automation/run-instance-simulation.js +1 -1
- package/lib/simulation/automation/sleep-simulation.js +1 -1
- package/lib/simulation/automation/update-variable-simulation.js +1 -1
- package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
- package/lib/simulation/automation-step-simulation.js +1 -1
- package/lib/simulation/command/command-simulation-base.js +1 -1
- package/lib/simulation/command/ps-module-simulation.js +1 -1
- package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
- package/lib/simulation/command/run-shell-script-simulation.js +1 -1
- package/lib/simulation/command-step-simulation.js +1 -1
- package/lib/simulation/document/automation-simulation.js +1 -1
- package/lib/simulation/document/command-simulation.js +1 -1
- package/lib/simulation/simulation.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +34 -34
- package/node_modules/@aws-sdk/client-cloudwatch/dist-types/models/models_0.d.ts +2 -2
- package/node_modules/@aws-sdk/client-cloudwatch/package.json +36 -36
- package/node_modules/@aws-sdk/client-ec2/README.md +14 -0
- package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +41 -0
- package/node_modules/@aws-sdk/client-ec2/dist-cjs/schemas/schemas_0.js +156 -78
- package/node_modules/@aws-sdk/client-ec2/dist-es/EC2.js +6 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/GetCapacityManagerMonitoredTagKeysCommand.js +16 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/UpdateCapacityManagerMonitoredTagKeysCommand.js +16 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/index.js +2 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/enums.js +8 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/pagination/GetCapacityManagerMonitoredTagKeysPaginator.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/pagination/index.js +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/schemas/schemas_0.js +96 -18
- package/node_modules/@aws-sdk/client-ec2/dist-types/EC2.d.ts +23 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/EC2Client.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMetricDataCommand.d.ts +9 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMetricDimensionsCommand.d.ts +9 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMonitoredTagKeysCommand.d.ts +87 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetConsoleScreenshotCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetDeclarativePoliciesReportSummaryCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ModifyTrafficMirrorFilterRuleCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/UpdateCapacityManagerMonitoredTagKeysCommand.d.ts +91 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/index.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/enums.d.ts +16 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_5.d.ts +126 -79
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_6.d.ts +81 -122
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_7.d.ts +168 -3
- package/node_modules/@aws-sdk/client-ec2/dist-types/pagination/GetCapacityManagerMonitoredTagKeysPaginator.d.ts +7 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/pagination/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/schemas/schemas_0.d.ts +8 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2.d.ts +55 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2Client.d.ts +12 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetCapacityManagerMonitoredTagKeysCommand.d.ts +51 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetConsoleScreenshotCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetDeclarativePoliciesReportSummaryCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ModifyTrafficMirrorFilterRuleCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/UpdateCapacityManagerMonitoredTagKeysCommand.d.ts +51 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/enums.d.ts +10 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_5.d.ts +23 -18
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_6.d.ts +19 -34
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_7.d.ts +43 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/pagination/GetCapacityManagerMonitoredTagKeysPaginator.d.ts +11 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/pagination/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/schemas/schemas_0.d.ts +8 -0
- package/node_modules/@aws-sdk/client-ec2/package.json +36 -36
- package/node_modules/@aws-sdk/client-iam/package.json +35 -35
- package/node_modules/@aws-sdk/client-lambda/dist-cjs/models/errors.js +52 -1
- package/node_modules/@aws-sdk/client-lambda/dist-cjs/schemas/schemas_0.js +29 -8
- package/node_modules/@aws-sdk/client-lambda/dist-es/models/errors.js +48 -0
- package/node_modules/@aws-sdk/client-lambda/dist-es/schemas/schemas_0.js +22 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/InvokeCommand.d.ts +9 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/InvokeWithResponseStreamCommand.d.ts +9 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/models/errors.d.ts +66 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/models/models_0.d.ts +6 -6
- package/node_modules/@aws-sdk/client-lambda/dist-types/schemas/schemas_0.d.ts +3 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/models/errors.d.ts +30 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/schemas/schemas_0.d.ts +3 -0
- package/node_modules/@aws-sdk/client-lambda/package.json +38 -38
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-es/models/enums.js +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateBucketCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLocationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/models/enums.d.ts +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/enums.d.ts +5 -0
- package/node_modules/@aws-sdk/client-s3/package.json +50 -50
- package/node_modules/@aws-sdk/client-sns/package.json +33 -33
- package/node_modules/@aws-sdk/client-sqs/dist-cjs/index.js +2 -0
- package/node_modules/@aws-sdk/client-sqs/dist-es/commands/ReceiveMessageCommand.js +2 -0
- package/node_modules/@aws-sdk/client-sqs/package.json +36 -36
- package/node_modules/@aws-sdk/client-ssm/package.json +34 -34
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +69 -50
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +17 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +52 -50
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js +15 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +11 -10
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js +4 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +4 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +9 -7
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +17 -17
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -8
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/longPollMiddleware.d.ts +14 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/package.json +11 -11
- package/node_modules/@aws-sdk/crc64-nvme/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
- package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/middleware-bucket-endpoint/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-expect-continue/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +10 -10
- package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-location-constraint/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +8 -8
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +11 -11
- package/node_modules/@aws-sdk/middleware-sdk-sqs/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-ssec/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
- package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
- package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +6 -6
- package/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
- package/node_modules/@aws-sdk/util-format-url/package.json +4 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@smithy/config-resolver/package.json +5 -5
- package/node_modules/@smithy/core/dist-cjs/index.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -14
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +16 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +17 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +6 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +6 -3
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +23 -11
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +9 -3
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +16 -8
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +8 -6
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +6 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +6 -3
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +7 -7
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/eventstream-codec/package.json +2 -2
- package/node_modules/@smithy/eventstream-serde-browser/package.json +3 -3
- package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +2 -2
- package/node_modules/@smithy/eventstream-serde-node/package.json +3 -3
- package/node_modules/@smithy/eventstream-serde-universal/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-blob-browser/package.json +2 -2
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/hash-stream-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/md5-js/package.json +2 -2
- package/node_modules/@smithy/middleware-compression/package.json +6 -6
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/package.json +4 -4
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +191 -96
- package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +45 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +71 -35
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -18
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +44 -43
- package/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +42 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +34 -14
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +32 -8
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +14 -6
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +5 -0
- package/node_modules/@smithy/service-error-classification/dist-es/index.js +4 -0
- package/node_modules/@smithy/service-error-classification/dist-types/index.d.ts +6 -0
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +11 -5
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +11 -5
- package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +3 -3
- package/node_modules/@smithy/signature-v4/package.json +4 -4
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +8 -1
- package/node_modules/@smithy/smithy-client/dist-es/command.js +8 -1
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-types/connection/config.d.ts +5 -0
- package/node_modules/@smithy/types/dist-types/signature.d.ts +20 -3
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +212 -111
- package/node_modules/@smithy/util-endpoints/dist-es/bdd/BinaryDecisionDiagram.js +15 -0
- package/node_modules/@smithy/util-endpoints/dist-es/decideEndpoint.js +42 -0
- package/node_modules/@smithy/util-endpoints/dist-es/index.js +2 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/coalesce.js +8 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js +2 -1
- package/node_modules/@smithy/util-endpoints/dist-es/lib/index.js +3 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/ite.js +3 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/split.js +13 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js +1 -1
- package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +8 -13
- package/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js +4 -1
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js +9 -7
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js +12 -8
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js +14 -13
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js +7 -4
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js +22 -5
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js +4 -4
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js +3 -6
- package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js +5 -5
- package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js +4 -4
- package/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js +1 -5
- package/node_modules/@smithy/util-endpoints/dist-types/bdd/BinaryDecisionDiagram.d.ts +22 -0
- package/node_modules/@smithy/util-endpoints/dist-types/decideEndpoint.d.ts +7 -0
- package/node_modules/@smithy/util-endpoints/dist-types/index.d.ts +2 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/coalesce.d.ts +7 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/index.d.ts +3 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/ite.d.ts +6 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/split.d.ts +11 -0
- package/node_modules/@smithy/util-endpoints/dist-types/types/shared.d.ts +3 -3
- package/node_modules/@smithy/util-endpoints/dist-types/utils/endpointFunctions.d.ts +2 -11
- package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateCondition.d.ts +6 -3
- package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateConditions.d.ts +3 -3
- package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts +1 -1
- package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointProperties.d.ts +2 -2
- package/node_modules/@smithy/util-endpoints/dist-types/utils/getReferenceValue.d.ts +3 -1
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +6 -0
- package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +3 -0
- package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +3 -0
- package/node_modules/@smithy/util-retry/dist-types/AdaptiveRetryStrategy.d.ts +5 -0
- package/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +5 -0
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/package.json +4 -4
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/node_modules/fast-xml-builder/package.json +1 -1
- package/node_modules/fast-xml-builder/src/fxb.js +6 -2
- package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +16 -2
- package/node_modules/path-expression-matcher/README.md +214 -62
- package/node_modules/path-expression-matcher/lib/pem.cjs +1 -1
- package/node_modules/path-expression-matcher/lib/pem.d.cts +111 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js +1 -1
- package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -1
- package/node_modules/path-expression-matcher/package.json +1 -1
- package/node_modules/path-expression-matcher/src/Expression.js +2 -2
- package/node_modules/path-expression-matcher/src/ExpressionSet.js +209 -0
- package/node_modules/path-expression-matcher/src/Matcher.js +235 -177
- package/node_modules/path-expression-matcher/src/index.d.ts +199 -194
- package/node_modules/path-expression-matcher/src/index.js +3 -2
- package/node_modules/strnum/package.json +1 -1
- package/package.json +10 -10
- package/node_modules/strnum/.github/SECURITY.md +0 -5
- package/node_modules/strnum/.vscode/launch.json +0 -25
- package/node_modules/strnum/algo.stflow +0 -84
- package/node_modules/strnum/tests/infinity_test.js +0 -18
- package/node_modules/strnum/tests/strnum_test.js +0 -175
- package/node_modules/strnum/tests/temp.js +0 -8
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
var types = require('@smithy/types');
|
|
4
4
|
|
|
5
|
+
class BinaryDecisionDiagram {
|
|
6
|
+
nodes;
|
|
7
|
+
root;
|
|
8
|
+
conditions;
|
|
9
|
+
results;
|
|
10
|
+
constructor(bdd, root, conditions, results) {
|
|
11
|
+
this.nodes = bdd;
|
|
12
|
+
this.root = root;
|
|
13
|
+
this.conditions = conditions;
|
|
14
|
+
this.results = results;
|
|
15
|
+
}
|
|
16
|
+
static from(bdd, root, conditions, results) {
|
|
17
|
+
return new BinaryDecisionDiagram(bdd, root, conditions, results);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
5
21
|
class EndpointCache {
|
|
6
22
|
capacity;
|
|
7
23
|
data = new Map();
|
|
@@ -53,24 +69,12 @@ class EndpointCache {
|
|
|
53
69
|
}
|
|
54
70
|
}
|
|
55
71
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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;
|
|
68
|
-
}
|
|
72
|
+
class EndpointError extends Error {
|
|
73
|
+
constructor(message) {
|
|
74
|
+
super(message);
|
|
75
|
+
this.name = "EndpointError";
|
|
69
76
|
}
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const customEndpointFunctions = {};
|
|
77
|
+
}
|
|
74
78
|
|
|
75
79
|
const debugId = "endpoints";
|
|
76
80
|
|
|
@@ -87,15 +91,19 @@ function toDebugString(input) {
|
|
|
87
91
|
return JSON.stringify(input, null, 2);
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
|
|
91
|
-
constructor(message) {
|
|
92
|
-
super(message);
|
|
93
|
-
this.name = "EndpointError";
|
|
94
|
-
}
|
|
95
|
-
}
|
|
94
|
+
const customEndpointFunctions = {};
|
|
96
95
|
|
|
97
96
|
const booleanEquals = (value1, value2) => value1 === value2;
|
|
98
97
|
|
|
98
|
+
function coalesce(...args) {
|
|
99
|
+
for (const arg of args) {
|
|
100
|
+
if (arg != null) {
|
|
101
|
+
return arg;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
const getAttrPathList = (path) => {
|
|
100
108
|
const parts = path.split(".");
|
|
101
109
|
const pathList = [];
|
|
@@ -126,15 +134,37 @@ const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
|
126
134
|
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
127
135
|
}
|
|
128
136
|
else if (Array.isArray(acc)) {
|
|
129
|
-
|
|
137
|
+
const i = parseInt(index);
|
|
138
|
+
return acc[i < 0 ? acc.length + i : i];
|
|
130
139
|
}
|
|
131
140
|
return acc[index];
|
|
132
141
|
}, value);
|
|
133
142
|
|
|
134
143
|
const isSet = (value) => value != null;
|
|
135
144
|
|
|
145
|
+
const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
146
|
+
const isValidHostLabel = (value, allowSubDomains = false) => {
|
|
147
|
+
if (!allowSubDomains) {
|
|
148
|
+
return VALID_HOST_LABEL_REGEX.test(value);
|
|
149
|
+
}
|
|
150
|
+
const labels = value.split(".");
|
|
151
|
+
for (const label of labels) {
|
|
152
|
+
if (!isValidHostLabel(label)) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return true;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
function ite(condition, trueValue, falseValue) {
|
|
160
|
+
return condition ? trueValue : falseValue;
|
|
161
|
+
}
|
|
162
|
+
|
|
136
163
|
const not = (value) => !value;
|
|
137
164
|
|
|
165
|
+
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}$`);
|
|
166
|
+
const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]"));
|
|
167
|
+
|
|
138
168
|
const DEFAULT_PORTS = {
|
|
139
169
|
[types.EndpointURLScheme.HTTP]: 80,
|
|
140
170
|
[types.EndpointURLScheme.HTTPS]: 443,
|
|
@@ -185,10 +215,24 @@ const parseURL = (value) => {
|
|
|
185
215
|
};
|
|
186
216
|
};
|
|
187
217
|
|
|
218
|
+
function split(value, delimiter, limit) {
|
|
219
|
+
if (limit === 1) {
|
|
220
|
+
return [value];
|
|
221
|
+
}
|
|
222
|
+
if (value === "") {
|
|
223
|
+
return [""];
|
|
224
|
+
}
|
|
225
|
+
const parts = value.split(delimiter);
|
|
226
|
+
if (limit === 0) {
|
|
227
|
+
return parts;
|
|
228
|
+
}
|
|
229
|
+
return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter));
|
|
230
|
+
}
|
|
231
|
+
|
|
188
232
|
const stringEquals = (value1, value2) => value1 === value2;
|
|
189
233
|
|
|
190
234
|
const substring = (input, start, stop, reverse) => {
|
|
191
|
-
if (start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) {
|
|
235
|
+
if (input == null || start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) {
|
|
192
236
|
return null;
|
|
193
237
|
}
|
|
194
238
|
if (!reverse) {
|
|
@@ -201,11 +245,14 @@ const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) =
|
|
|
201
245
|
|
|
202
246
|
const endpointFunctions = {
|
|
203
247
|
booleanEquals,
|
|
248
|
+
coalesce,
|
|
204
249
|
getAttr,
|
|
205
250
|
isSet,
|
|
206
251
|
isValidHostLabel,
|
|
252
|
+
ite,
|
|
207
253
|
not,
|
|
208
254
|
parseURL,
|
|
255
|
+
split,
|
|
209
256
|
stringEquals,
|
|
210
257
|
substring,
|
|
211
258
|
uriEncode,
|
|
@@ -213,10 +260,7 @@ const endpointFunctions = {
|
|
|
213
260
|
|
|
214
261
|
const evaluateTemplate = (template, options) => {
|
|
215
262
|
const evaluatedTemplateArr = [];
|
|
216
|
-
const
|
|
217
|
-
...options.endpointParams,
|
|
218
|
-
...options.referenceRecord,
|
|
219
|
-
};
|
|
263
|
+
const { referenceRecord, endpointParams } = options;
|
|
220
264
|
let currentIndex = 0;
|
|
221
265
|
while (currentIndex < template.length) {
|
|
222
266
|
const openingBraceIndex = template.indexOf("{", currentIndex);
|
|
@@ -237,10 +281,10 @@ const evaluateTemplate = (template, options) => {
|
|
|
237
281
|
const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
|
|
238
282
|
if (parameterName.includes("#")) {
|
|
239
283
|
const [refName, attrName] = parameterName.split("#");
|
|
240
|
-
evaluatedTemplateArr.push(getAttr(
|
|
284
|
+
evaluatedTemplateArr.push(getAttr((referenceRecord[refName] ?? endpointParams[refName]), attrName));
|
|
241
285
|
}
|
|
242
286
|
else {
|
|
243
|
-
evaluatedTemplateArr.push(
|
|
287
|
+
evaluatedTemplateArr.push((referenceRecord[parameterName] ?? endpointParams[parameterName]));
|
|
244
288
|
}
|
|
245
289
|
currentIndex = closingBraceIndex + 1;
|
|
246
290
|
}
|
|
@@ -248,11 +292,7 @@ const evaluateTemplate = (template, options) => {
|
|
|
248
292
|
};
|
|
249
293
|
|
|
250
294
|
const getReferenceValue = ({ ref }, options) => {
|
|
251
|
-
|
|
252
|
-
...options.endpointParams,
|
|
253
|
-
...options.referenceRecord,
|
|
254
|
-
};
|
|
255
|
-
return referenceRecord[ref];
|
|
295
|
+
return options.referenceRecord[ref] ?? options.endpointParams[ref];
|
|
256
296
|
};
|
|
257
297
|
|
|
258
298
|
const evaluateExpression = (obj, keyName, options) => {
|
|
@@ -268,66 +308,64 @@ const evaluateExpression = (obj, keyName, options) => {
|
|
|
268
308
|
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
|
269
309
|
};
|
|
270
310
|
const callFunction = ({ fn, argv }, options) => {
|
|
271
|
-
const evaluatedArgs = argv.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
311
|
+
const evaluatedArgs = Array(argv.length);
|
|
312
|
+
for (let i = 0; i < evaluatedArgs.length; ++i) {
|
|
313
|
+
const arg = argv[i];
|
|
314
|
+
if (typeof arg === "boolean" || typeof arg === "number") {
|
|
315
|
+
evaluatedArgs[i] = arg;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
evaluatedArgs[i] = group$2.evaluateExpression(arg, "arg", options);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const namespaceSeparatorIndex = fn.indexOf(".");
|
|
322
|
+
if (namespaceSeparatorIndex !== -1) {
|
|
323
|
+
const namespaceFunctions = customEndpointFunctions[fn.slice(0, namespaceSeparatorIndex)];
|
|
324
|
+
const customFunction = namespaceFunctions?.[fn.slice(namespaceSeparatorIndex + 1)];
|
|
325
|
+
if (typeof customFunction === "function") {
|
|
326
|
+
return customFunction(...evaluatedArgs);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const callable = endpointFunctions[fn];
|
|
330
|
+
if (typeof callable === "function") {
|
|
331
|
+
return callable(...evaluatedArgs);
|
|
275
332
|
}
|
|
276
|
-
|
|
333
|
+
throw new Error(`function ${fn} not loaded in endpointFunctions.`);
|
|
277
334
|
};
|
|
278
335
|
const group$2 = {
|
|
279
336
|
evaluateExpression,
|
|
280
337
|
callFunction,
|
|
281
338
|
};
|
|
282
339
|
|
|
283
|
-
const evaluateCondition = (
|
|
340
|
+
const evaluateCondition = (condition, options) => {
|
|
341
|
+
const { assign } = condition;
|
|
284
342
|
if (assign && assign in options.referenceRecord) {
|
|
285
343
|
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
|
|
286
344
|
}
|
|
287
|
-
const value = callFunction(
|
|
288
|
-
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
const evaluateConditions = (conditions = [], options) => {
|
|
296
|
-
const conditionsReferenceRecord = {};
|
|
297
|
-
for (const condition of conditions) {
|
|
298
|
-
const { result, toAssign } = evaluateCondition(condition, {
|
|
299
|
-
...options,
|
|
300
|
-
referenceRecord: {
|
|
301
|
-
...options.referenceRecord,
|
|
302
|
-
...conditionsReferenceRecord,
|
|
303
|
-
},
|
|
304
|
-
});
|
|
305
|
-
if (!result) {
|
|
306
|
-
return { result };
|
|
307
|
-
}
|
|
308
|
-
if (toAssign) {
|
|
309
|
-
conditionsReferenceRecord[toAssign.name] = toAssign.value;
|
|
310
|
-
options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
|
|
311
|
-
}
|
|
345
|
+
const value = callFunction(condition, options);
|
|
346
|
+
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(condition)} = ${toDebugString(value)}`);
|
|
347
|
+
const result = value === "" ? true : !!value;
|
|
348
|
+
if (assign != null) {
|
|
349
|
+
return { result, toAssign: { name: assign, value } };
|
|
312
350
|
}
|
|
313
|
-
return { result
|
|
351
|
+
return { result };
|
|
314
352
|
};
|
|
315
353
|
|
|
316
|
-
const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) =>
|
|
317
|
-
|
|
318
|
-
[headerKey]: headerVal.map((headerValEntry) => {
|
|
354
|
+
const getEndpointHeaders = (headers, options) => Object.entries(headers ?? {}).reduce((acc, [headerKey, headerVal]) => {
|
|
355
|
+
acc[headerKey] = headerVal.map((headerValEntry) => {
|
|
319
356
|
const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
|
|
320
357
|
if (typeof processedExpr !== "string") {
|
|
321
358
|
throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
|
|
322
359
|
}
|
|
323
360
|
return processedExpr;
|
|
324
|
-
})
|
|
325
|
-
|
|
361
|
+
});
|
|
362
|
+
return acc;
|
|
363
|
+
}, {});
|
|
326
364
|
|
|
327
|
-
const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) =>
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
365
|
+
const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => {
|
|
366
|
+
acc[propertyKey] = group$1.getEndpointProperty(propertyVal, options);
|
|
367
|
+
return acc;
|
|
368
|
+
}, {});
|
|
331
369
|
const getEndpointProperty = (property, options) => {
|
|
332
370
|
if (Array.isArray(property)) {
|
|
333
371
|
return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
|
|
@@ -365,27 +403,90 @@ const getEndpointUrl = (endpointUrl, options) => {
|
|
|
365
403
|
throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
|
|
366
404
|
};
|
|
367
405
|
|
|
406
|
+
const RESULT = 100_000_000;
|
|
407
|
+
const decideEndpoint = (bdd, options) => {
|
|
408
|
+
const { nodes, root, results, conditions } = bdd;
|
|
409
|
+
let ref = root;
|
|
410
|
+
const referenceRecord = {};
|
|
411
|
+
const closure = {
|
|
412
|
+
referenceRecord,
|
|
413
|
+
endpointParams: options.endpointParams,
|
|
414
|
+
logger: options.logger,
|
|
415
|
+
};
|
|
416
|
+
while (ref !== 1 && ref !== -1 && ref < RESULT) {
|
|
417
|
+
const node_i = 3 * (Math.abs(ref) - 1);
|
|
418
|
+
const [condition_i, highRef, lowRef] = [nodes[node_i], nodes[node_i + 1], nodes[node_i + 2]];
|
|
419
|
+
const [fn, argv, assign] = conditions[condition_i];
|
|
420
|
+
const evaluation = evaluateCondition({ fn, assign, argv }, closure);
|
|
421
|
+
if (evaluation.toAssign) {
|
|
422
|
+
const { name, value } = evaluation.toAssign;
|
|
423
|
+
referenceRecord[name] = value;
|
|
424
|
+
}
|
|
425
|
+
ref = ref >= 0 === evaluation.result ? highRef : lowRef;
|
|
426
|
+
}
|
|
427
|
+
if (ref >= RESULT) {
|
|
428
|
+
const result = results[ref - RESULT];
|
|
429
|
+
if (result[0] === -1) {
|
|
430
|
+
const [, errorExpression] = result;
|
|
431
|
+
throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
|
|
432
|
+
}
|
|
433
|
+
const [url, properties, headers] = result;
|
|
434
|
+
return {
|
|
435
|
+
url: getEndpointUrl(url, closure),
|
|
436
|
+
properties: getEndpointProperties(properties, closure),
|
|
437
|
+
headers: getEndpointHeaders(headers ?? {}, closure),
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
throw new EndpointError(`No matching endpoint.`);
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
const evaluateConditions = (conditions = [], options) => {
|
|
444
|
+
const conditionsReferenceRecord = {};
|
|
445
|
+
const conditionOptions = {
|
|
446
|
+
...options,
|
|
447
|
+
referenceRecord: { ...options.referenceRecord },
|
|
448
|
+
};
|
|
449
|
+
let didAssign = false;
|
|
450
|
+
for (const condition of conditions) {
|
|
451
|
+
const { result, toAssign } = evaluateCondition(condition, conditionOptions);
|
|
452
|
+
if (!result) {
|
|
453
|
+
return { result };
|
|
454
|
+
}
|
|
455
|
+
if (toAssign) {
|
|
456
|
+
didAssign = true;
|
|
457
|
+
conditionsReferenceRecord[toAssign.name] = toAssign.value;
|
|
458
|
+
conditionOptions.referenceRecord[toAssign.name] = toAssign.value;
|
|
459
|
+
options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (didAssign) {
|
|
463
|
+
return { result: true, referenceRecord: conditionsReferenceRecord };
|
|
464
|
+
}
|
|
465
|
+
return { result: true };
|
|
466
|
+
};
|
|
467
|
+
|
|
368
468
|
const evaluateEndpointRule = (endpointRule, options) => {
|
|
369
469
|
const { conditions, endpoint } = endpointRule;
|
|
370
470
|
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
371
471
|
if (!result) {
|
|
372
472
|
return;
|
|
373
473
|
}
|
|
374
|
-
const endpointRuleOptions =
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
474
|
+
const endpointRuleOptions = referenceRecord
|
|
475
|
+
? {
|
|
476
|
+
...options,
|
|
477
|
+
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
478
|
+
}
|
|
479
|
+
: options;
|
|
378
480
|
const { url, properties, headers } = endpoint;
|
|
379
481
|
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
};
|
|
482
|
+
const endpointToReturn = { url: getEndpointUrl(url, endpointRuleOptions) };
|
|
483
|
+
if (headers != null) {
|
|
484
|
+
endpointToReturn.headers = getEndpointHeaders(headers, endpointRuleOptions);
|
|
485
|
+
}
|
|
486
|
+
if (properties != null) {
|
|
487
|
+
endpointToReturn.properties = getEndpointProperties(properties, endpointRuleOptions);
|
|
488
|
+
}
|
|
489
|
+
return endpointToReturn;
|
|
389
490
|
};
|
|
390
491
|
|
|
391
492
|
const evaluateErrorRule = (errorRule, options) => {
|
|
@@ -394,10 +495,13 @@ const evaluateErrorRule = (errorRule, options) => {
|
|
|
394
495
|
if (!result) {
|
|
395
496
|
return;
|
|
396
497
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
498
|
+
const errorRuleOptions = referenceRecord
|
|
499
|
+
? {
|
|
500
|
+
...options,
|
|
501
|
+
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
502
|
+
}
|
|
503
|
+
: options;
|
|
504
|
+
throw new EndpointError(evaluateExpression(error, "Error", errorRuleOptions));
|
|
401
505
|
};
|
|
402
506
|
|
|
403
507
|
const evaluateRules = (rules, options) => {
|
|
@@ -429,10 +533,10 @@ const evaluateTreeRule = (treeRule, options) => {
|
|
|
429
533
|
if (!result) {
|
|
430
534
|
return;
|
|
431
535
|
}
|
|
432
|
-
|
|
433
|
-
...options,
|
|
434
|
-
|
|
435
|
-
|
|
536
|
+
const treeRuleOptions = referenceRecord
|
|
537
|
+
? { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } }
|
|
538
|
+
: options;
|
|
539
|
+
return group.evaluateRules(rules, treeRuleOptions);
|
|
436
540
|
};
|
|
437
541
|
const group = {
|
|
438
542
|
evaluateRules,
|
|
@@ -443,20 +547,15 @@ const resolveEndpoint = (ruleSetObject, options) => {
|
|
|
443
547
|
const { endpointParams, logger } = options;
|
|
444
548
|
const { parameters, rules } = ruleSetObject;
|
|
445
549
|
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
550
|
+
for (const paramKey in parameters) {
|
|
551
|
+
const parameter = parameters[paramKey];
|
|
552
|
+
const endpointParam = endpointParams[paramKey];
|
|
553
|
+
if (endpointParam == null && parameter.default != null) {
|
|
554
|
+
endpointParams[paramKey] = parameter.default;
|
|
555
|
+
continue;
|
|
452
556
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
.filter(([, v]) => v.required)
|
|
456
|
-
.map(([k]) => k);
|
|
457
|
-
for (const requiredParam of requiredParams) {
|
|
458
|
-
if (endpointParams[requiredParam] == null) {
|
|
459
|
-
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
557
|
+
if (parameter.required && endpointParam == null) {
|
|
558
|
+
throw new EndpointError(`Missing required parameter: '${paramKey}'`);
|
|
460
559
|
}
|
|
461
560
|
}
|
|
462
561
|
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
|
|
@@ -464,9 +563,11 @@ const resolveEndpoint = (ruleSetObject, options) => {
|
|
|
464
563
|
return endpoint;
|
|
465
564
|
};
|
|
466
565
|
|
|
566
|
+
exports.BinaryDecisionDiagram = BinaryDecisionDiagram;
|
|
467
567
|
exports.EndpointCache = EndpointCache;
|
|
468
568
|
exports.EndpointError = EndpointError;
|
|
469
569
|
exports.customEndpointFunctions = customEndpointFunctions;
|
|
570
|
+
exports.decideEndpoint = decideEndpoint;
|
|
470
571
|
exports.isIpAddress = isIpAddress;
|
|
471
572
|
exports.isValidHostLabel = isValidHostLabel;
|
|
472
573
|
exports.resolveEndpoint = resolveEndpoint;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class BinaryDecisionDiagram {
|
|
2
|
+
nodes;
|
|
3
|
+
root;
|
|
4
|
+
conditions;
|
|
5
|
+
results;
|
|
6
|
+
constructor(bdd, root, conditions, results) {
|
|
7
|
+
this.nodes = bdd;
|
|
8
|
+
this.root = root;
|
|
9
|
+
this.conditions = conditions;
|
|
10
|
+
this.results = results;
|
|
11
|
+
}
|
|
12
|
+
static from(bdd, root, conditions, results) {
|
|
13
|
+
return new BinaryDecisionDiagram(bdd, root, conditions, results);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EndpointError } from "./types";
|
|
2
|
+
import { evaluateCondition } from "./utils/evaluateCondition";
|
|
3
|
+
import { evaluateExpression } from "./utils/evaluateExpression";
|
|
4
|
+
import { getEndpointHeaders } from "./utils/getEndpointHeaders";
|
|
5
|
+
import { getEndpointProperties } from "./utils/getEndpointProperties";
|
|
6
|
+
import { getEndpointUrl } from "./utils/getEndpointUrl";
|
|
7
|
+
const RESULT = 100_000_000;
|
|
8
|
+
export const decideEndpoint = (bdd, options) => {
|
|
9
|
+
const { nodes, root, results, conditions } = bdd;
|
|
10
|
+
let ref = root;
|
|
11
|
+
const referenceRecord = {};
|
|
12
|
+
const closure = {
|
|
13
|
+
referenceRecord,
|
|
14
|
+
endpointParams: options.endpointParams,
|
|
15
|
+
logger: options.logger,
|
|
16
|
+
};
|
|
17
|
+
while (ref !== 1 && ref !== -1 && ref < RESULT) {
|
|
18
|
+
const node_i = 3 * (Math.abs(ref) - 1);
|
|
19
|
+
const [condition_i, highRef, lowRef] = [nodes[node_i], nodes[node_i + 1], nodes[node_i + 2]];
|
|
20
|
+
const [fn, argv, assign] = conditions[condition_i];
|
|
21
|
+
const evaluation = evaluateCondition({ fn, assign, argv }, closure);
|
|
22
|
+
if (evaluation.toAssign) {
|
|
23
|
+
const { name, value } = evaluation.toAssign;
|
|
24
|
+
referenceRecord[name] = value;
|
|
25
|
+
}
|
|
26
|
+
ref = ref >= 0 === evaluation.result ? highRef : lowRef;
|
|
27
|
+
}
|
|
28
|
+
if (ref >= RESULT) {
|
|
29
|
+
const result = results[ref - RESULT];
|
|
30
|
+
if (result[0] === -1) {
|
|
31
|
+
const [, errorExpression] = result;
|
|
32
|
+
throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
|
|
33
|
+
}
|
|
34
|
+
const [url, properties, headers] = result;
|
|
35
|
+
return {
|
|
36
|
+
url: getEndpointUrl(url, closure),
|
|
37
|
+
properties: getEndpointProperties(properties, closure),
|
|
38
|
+
headers: getEndpointHeaders(headers ?? {}, closure),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
throw new EndpointError(`No matching endpoint.`);
|
|
42
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { BinaryDecisionDiagram } from "./bdd/BinaryDecisionDiagram";
|
|
1
2
|
export * from "./cache/EndpointCache";
|
|
3
|
+
export { decideEndpoint } from "./decideEndpoint";
|
|
2
4
|
export * from "./lib/isIpAddress";
|
|
3
5
|
export * from "./lib/isValidHostLabel";
|
|
4
6
|
export * from "./utils/customEndpointFunctions";
|
|
@@ -5,7 +5,8 @@ export const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index
|
|
|
5
5
|
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
6
6
|
}
|
|
7
7
|
else if (Array.isArray(acc)) {
|
|
8
|
-
|
|
8
|
+
const i = parseInt(index);
|
|
9
|
+
return acc[i < 0 ? acc.length + i : i];
|
|
9
10
|
}
|
|
10
11
|
return acc[index];
|
|
11
12
|
}, value);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export * from "./booleanEquals";
|
|
2
|
+
export * from "./coalesce";
|
|
2
3
|
export * from "./getAttr";
|
|
3
4
|
export * from "./isSet";
|
|
4
5
|
export * from "./isValidHostLabel";
|
|
6
|
+
export * from "./ite";
|
|
5
7
|
export * from "./not";
|
|
6
8
|
export * from "./parseURL";
|
|
9
|
+
export * from "./split";
|
|
7
10
|
export * from "./stringEquals";
|
|
8
11
|
export * from "./substring";
|
|
9
12
|
export * from "./uriEncode";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function split(value, delimiter, limit) {
|
|
2
|
+
if (limit === 1) {
|
|
3
|
+
return [value];
|
|
4
|
+
}
|
|
5
|
+
if (value === "") {
|
|
6
|
+
return [""];
|
|
7
|
+
}
|
|
8
|
+
const parts = value.split(delimiter);
|
|
9
|
+
if (limit === 0) {
|
|
10
|
+
return parts;
|
|
11
|
+
}
|
|
12
|
+
return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter));
|
|
13
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const substring = (input, start, stop, reverse) => {
|
|
2
|
-
if (start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) {
|
|
2
|
+
if (input == null || start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) {
|
|
3
3
|
return null;
|
|
4
4
|
}
|
|
5
5
|
if (!reverse) {
|
|
@@ -5,20 +5,15 @@ export const resolveEndpoint = (ruleSetObject, options) => {
|
|
|
5
5
|
const { endpointParams, logger } = options;
|
|
6
6
|
const { parameters, rules } = ruleSetObject;
|
|
7
7
|
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
for (const paramKey in parameters) {
|
|
9
|
+
const parameter = parameters[paramKey];
|
|
10
|
+
const endpointParam = endpointParams[paramKey];
|
|
11
|
+
if (endpointParam == null && parameter.default != null) {
|
|
12
|
+
endpointParams[paramKey] = parameter.default;
|
|
13
|
+
continue;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.filter(([, v]) => v.required)
|
|
18
|
-
.map(([k]) => k);
|
|
19
|
-
for (const requiredParam of requiredParams) {
|
|
20
|
-
if (endpointParams[requiredParam] == null) {
|
|
21
|
-
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
15
|
+
if (parameter.required && endpointParam == null) {
|
|
16
|
+
throw new EndpointError(`Missing required parameter: '${paramKey}'`);
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { booleanEquals, getAttr, isSet, isValidHostLabel, not, parseURL, stringEquals, substring, uriEncode, } from "../lib";
|
|
1
|
+
import { booleanEquals, coalesce, getAttr, isSet, isValidHostLabel, ite, not, parseURL, split, stringEquals, substring, uriEncode, } from "../lib";
|
|
2
2
|
export const endpointFunctions = {
|
|
3
3
|
booleanEquals,
|
|
4
|
+
coalesce,
|
|
4
5
|
getAttr,
|
|
5
6
|
isSet,
|
|
6
7
|
isValidHostLabel,
|
|
8
|
+
ite,
|
|
7
9
|
not,
|
|
8
10
|
parseURL,
|
|
11
|
+
split,
|
|
9
12
|
stringEquals,
|
|
10
13
|
substring,
|
|
11
14
|
uriEncode,
|