@wirebench/engine 2.2.0 → 3.1.0-rc.1
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/README.md +134 -1
- package/dist/account/schema.d.ts +34 -0
- package/dist/account/schema.js +29 -0
- package/dist/assert/callback.d.ts +76 -0
- package/dist/assert/callback.js +320 -0
- package/dist/assert/capture-source.d.ts +50 -0
- package/dist/assert/capture-source.js +89 -0
- package/dist/assert/check.d.ts +8 -0
- package/dist/assert/check.js +18 -0
- package/dist/assert/header.d.ts +5 -0
- package/dist/assert/header.js +48 -0
- package/dist/assert/index.d.ts +2 -2
- package/dist/assert/index.js +12 -0
- package/dist/assert/match.d.ts +6 -0
- package/dist/assert/match.js +13 -4
- package/dist/assert/model.d.ts +110 -3
- package/dist/assert/model.js +16 -1
- package/dist/assert/schema.d.ts +194 -1
- package/dist/assert/schema.js +154 -12
- package/dist/assert/status-names.d.ts +9 -0
- package/dist/assert/status-names.js +27 -0
- package/dist/assert/status.d.ts +4 -1
- package/dist/assert/status.js +27 -3
- package/dist/asyncapi/browser.d.ts +7 -0
- package/dist/asyncapi/browser.js +6 -0
- package/dist/asyncapi/frame-check-worker-host.d.ts +44 -0
- package/dist/asyncapi/frame-check-worker-host.js +175 -0
- package/dist/asyncapi/frame-check-worker.d.ts +12 -0
- package/dist/asyncapi/frame-check-worker.js +25 -0
- package/dist/asyncapi/frame-check.d.ts +25 -0
- package/dist/asyncapi/frame-check.js +78 -0
- package/dist/asyncapi/import.d.ts +25 -0
- package/dist/asyncapi/import.js +34 -0
- package/dist/asyncapi/map.d.ts +40 -0
- package/dist/asyncapi/map.js +230 -0
- package/dist/asyncapi/model.d.ts +84 -0
- package/dist/asyncapi/model.js +7 -0
- package/dist/asyncapi/normalise-2.d.ts +13 -0
- package/dist/asyncapi/normalise-2.js +113 -0
- package/dist/asyncapi/normalise-3.d.ts +14 -0
- package/dist/asyncapi/normalise-3.js +133 -0
- package/dist/asyncapi/parse.d.ts +31 -0
- package/dist/asyncapi/parse.js +85 -0
- package/dist/asyncapi/read.d.ts +35 -0
- package/dist/asyncapi/read.js +186 -0
- package/dist/asyncapi/security.d.ts +14 -0
- package/dist/asyncapi/security.js +55 -0
- package/dist/asyncapi/update.d.ts +53 -0
- package/dist/asyncapi/update.js +220 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.js +22 -0
- package/dist/grpc/events.d.ts +22 -0
- package/dist/grpc/events.js +1 -0
- package/dist/grpc/expand.d.ts +1 -1
- package/dist/grpc/expand.js +15 -5
- package/dist/grpc/files.d.ts +271 -0
- package/dist/grpc/files.js +62 -0
- package/dist/grpc/model.d.ts +11 -1
- package/dist/grpc/module.d.ts +2 -0
- package/dist/grpc/module.js +13 -0
- package/dist/grpc/run.d.ts +73 -0
- package/dist/grpc/run.js +407 -0
- package/dist/grpc/script-types.d.ts +8 -0
- package/dist/grpc/script-types.js +149 -0
- package/dist/grpc/scripting.d.ts +34 -0
- package/dist/grpc/scripting.js +147 -0
- package/dist/grpc/send-input.d.ts +46 -0
- package/dist/grpc/send-input.js +42 -0
- package/dist/grpc/send.d.ts +2 -2
- package/dist/grpc/status.d.ts +9 -2
- package/dist/grpc/status.js +11 -24
- package/dist/grpc/storage.d.ts +9 -0
- package/dist/grpc/storage.js +167 -0
- package/dist/{rest/auth.d.ts → http/auth/apply-auth.d.ts} +4 -4
- package/dist/{rest/auth.js → http/auth/apply-auth.js} +1 -1
- package/dist/http/auth/apply.d.ts +1 -1
- package/dist/{rest → http/auth}/oauth2.d.ts +2 -2
- package/dist/{rest → http/auth}/oauth2.js +1 -1
- package/dist/http/auth/send-auth.d.ts +57 -0
- package/dist/http/auth/send-auth.js +7 -0
- package/dist/http/client.js +150 -8
- package/dist/http/cookies.d.ts +79 -0
- package/dist/http/cookies.js +81 -0
- package/dist/http/curl.d.ts +4 -14
- package/dist/http/curl.js +4 -154
- package/dist/http/decompress.d.ts +7 -0
- package/dist/http/decompress.js +23 -1
- package/dist/http/document-fetch.d.ts +42 -0
- package/dist/http/document-fetch.js +207 -0
- package/dist/http/entries.d.ts +27 -0
- package/dist/http/entries.js +16 -0
- package/dist/http/escape.d.ts +18 -0
- package/dist/http/escape.js +30 -0
- package/dist/http/fetch-document.d.ts +28 -0
- package/dist/{wsdl/fetch.js → http/fetch-document.js} +8 -16
- package/dist/http/media-type.d.ts +9 -0
- package/dist/http/media-type.js +12 -0
- package/dist/http/transcript-cap.d.ts +26 -0
- package/dist/http/transcript-cap.js +36 -0
- package/dist/http/types.d.ts +59 -0
- package/dist/http/webhook-signature.d.ts +81 -0
- package/dist/http/webhook-signature.js +227 -0
- package/dist/import-detect.d.ts +2 -2
- package/dist/import-detect.js +10 -1
- package/dist/index.d.ts +207 -55
- package/dist/index.js +129 -32
- package/dist/json/cursor.d.ts +2 -0
- package/dist/json/cursor.js +1 -0
- package/dist/json/pointer-range.d.ts +18 -0
- package/dist/json/pointer-range.js +157 -0
- package/dist/json/schema/model.d.ts +59 -0
- package/dist/json/schema/model.js +8 -0
- package/dist/json/schema/parse-text.d.ts +16 -0
- package/dist/json/schema/parse-text.js +37 -0
- package/dist/{rest/openapi → json/schema}/refs.d.ts +2 -2
- package/dist/{rest/openapi → json/schema}/refs.js +3 -3
- package/dist/{rest/openapi → json/schema}/sample.d.ts +4 -0
- package/dist/{rest/openapi → json/schema}/sample.js +2 -2
- package/dist/json/schema/source.d.ts +21 -0
- package/dist/json/schema/source.js +8 -0
- package/dist/json/schema-validate.d.ts +49 -0
- package/dist/json/schema-validate.js +557 -0
- package/dist/{wss/keystore → keystore}/index.js +1 -1
- package/dist/{wss/keystore → keystore}/pem.js +1 -1
- package/dist/{wss/keystore → keystore}/pkcs12.js +1 -1
- package/dist/project/attachments-cache.d.ts +3 -1
- package/dist/{wsdl → project}/cache-naming.js +1 -1
- package/dist/project/endpoints.d.ts +18 -8
- package/dist/project/endpoints.js +21 -6
- package/dist/project/environments.d.ts +7 -5
- package/dist/project/history.d.ts +105 -9
- package/dist/project/history.js +195 -23
- package/dist/project/inherit.d.ts +7 -0
- package/dist/project/inherit.js +9 -0
- package/dist/project/keystores.d.ts +1 -1
- package/dist/project/load-helpers.d.ts +89 -0
- package/dist/project/load-helpers.js +177 -0
- package/dist/project/load.d.ts +30 -4
- package/dist/project/load.js +168 -545
- package/dist/project/managed-files.d.ts +36 -0
- package/dist/project/managed-files.js +97 -0
- package/dist/project/migrate.d.ts +2 -2
- package/dist/project/migrate.js +2 -2
- package/dist/project/model.d.ts +92 -14
- package/dist/project/model.js +50 -4
- package/dist/project/paths.d.ts +10 -1
- package/dist/project/paths.js +10 -1
- package/dist/project/preferences.d.ts +11 -2
- package/dist/project/preferences.js +5 -1
- package/dist/project/properties.d.ts +31 -17
- package/dist/project/properties.js +89 -70
- package/dist/project/request-location.d.ts +20 -0
- package/dist/project/request-location.js +62 -0
- package/dist/project/save.d.ts +12 -2
- package/dist/project/save.js +186 -141
- package/dist/project/schema-parts.d.ts +337 -0
- package/dist/project/schema-parts.js +248 -0
- package/dist/project/schema.d.ts +72 -928
- package/dist/project/schema.js +17 -466
- package/dist/project/sequence-guards.d.ts +43 -0
- package/dist/project/sequence-guards.js +109 -0
- package/dist/project/serialize-helpers.d.ts +60 -0
- package/dist/project/serialize-helpers.js +108 -0
- package/dist/project/serialize.d.ts +7 -8
- package/dist/project/serialize.js +34 -293
- package/dist/protocol/features.d.ts +51 -0
- package/dist/protocol/features.js +64 -0
- package/dist/protocol/index.d.ts +7 -0
- package/dist/protocol/index.js +4 -0
- package/dist/protocol/module.d.ts +247 -0
- package/dist/protocol/module.js +48 -0
- package/dist/protocol/registry.d.ts +42 -0
- package/dist/protocol/registry.js +47 -0
- package/dist/protocols.d.ts +77 -0
- package/dist/protocols.js +40 -0
- package/dist/redact/index.d.ts +12 -1
- package/dist/redact/index.js +55 -7
- package/dist/redact/literal.d.ts +10 -0
- package/dist/redact/literal.js +110 -12
- package/dist/rest/body.d.ts +2 -10
- package/dist/rest/body.js +3 -25
- package/dist/rest/browser.d.ts +4 -0
- package/dist/rest/browser.js +5 -0
- package/dist/rest/contract-check-worker-host.d.ts +36 -0
- package/dist/rest/contract-check-worker-host.js +158 -0
- package/dist/rest/contract-check-worker.d.ts +7 -0
- package/dist/rest/contract-check-worker.js +28 -0
- package/dist/rest/contract-check.d.ts +43 -0
- package/dist/rest/contract-check.js +217 -0
- package/dist/rest/cookie-jar.d.ts +62 -0
- package/dist/rest/cookie-jar.js +262 -0
- package/dist/rest/cookies.d.ts +6 -22
- package/dist/rest/cookies.js +6 -42
- package/dist/rest/curl.js +5 -1
- package/dist/rest/events.d.ts +12 -0
- package/dist/rest/events.js +1 -0
- package/dist/rest/expand.d.ts +6 -1
- package/dist/rest/expand.js +29 -11
- package/dist/rest/files.d.ts +439 -0
- package/dist/rest/files.js +107 -0
- package/dist/rest/json-form.d.ts +97 -0
- package/dist/rest/json-form.js +396 -0
- package/dist/rest/model.d.ts +35 -24
- package/dist/rest/model.js +6 -9
- package/dist/rest/module.d.ts +2 -0
- package/dist/rest/module.js +13 -0
- package/dist/rest/openapi/cache.d.ts +7 -2
- package/dist/rest/openapi/cache.js +2 -2
- package/dist/rest/openapi/import.d.ts +11 -16
- package/dist/rest/openapi/import.js +6 -2
- package/dist/rest/openapi/map.d.ts +38 -1
- package/dist/rest/openapi/map.js +151 -41
- package/dist/rest/openapi/match.d.ts +20 -0
- package/dist/rest/openapi/match.js +117 -0
- package/dist/rest/openapi/model.d.ts +33 -45
- package/dist/rest/openapi/parse.d.ts +3 -12
- package/dist/rest/openapi/parse.js +138 -67
- package/dist/rest/openapi/responses.d.ts +23 -0
- package/dist/rest/openapi/responses.js +59 -0
- package/dist/rest/openapi/runtime-expression.d.ts +69 -0
- package/dist/rest/openapi/runtime-expression.js +213 -0
- package/dist/rest/openapi/update.d.ts +116 -0
- package/dist/rest/openapi/update.js +456 -0
- package/dist/rest/postman/map.d.ts +1 -0
- package/dist/rest/postman/map.js +66 -4
- package/dist/rest/postman/model.d.ts +9 -0
- package/dist/rest/postman/parse.js +33 -10
- package/dist/rest/response.d.ts +2 -23
- package/dist/rest/response.js +3 -75
- package/dist/rest/run.d.ts +56 -0
- package/dist/rest/run.js +395 -0
- package/dist/rest/script-types.d.ts +7 -0
- package/dist/rest/script-types.js +83 -0
- package/dist/rest/scripting.d.ts +38 -0
- package/dist/rest/scripting.js +282 -0
- package/dist/rest/send-input.d.ts +54 -0
- package/dist/rest/send-input.js +73 -0
- package/dist/rest/send.d.ts +77 -4
- package/dist/rest/send.js +128 -7
- package/dist/rest/sse-transcript.d.ts +25 -0
- package/dist/rest/sse-transcript.js +95 -0
- package/dist/rest/sse.d.ts +43 -0
- package/dist/rest/sse.js +195 -0
- package/dist/rest/storage.d.ts +26 -0
- package/dist/rest/storage.js +262 -0
- package/dist/rest/url.d.ts +10 -4
- package/dist/rest/url.js +38 -5
- package/dist/run/baseline-update.d.ts +35 -0
- package/dist/run/baseline-update.js +97 -0
- package/dist/run/baseline.d.ts +42 -0
- package/dist/run/baseline.js +93 -0
- package/dist/run/context.d.ts +86 -0
- package/dist/run/context.js +31 -0
- package/dist/run/current-values.d.ts +32 -0
- package/dist/run/current-values.js +43 -0
- package/dist/run/event-queue.d.ts +14 -0
- package/dist/run/event-queue.js +46 -0
- package/dist/run/exchange.d.ts +62 -0
- package/dist/run/exchange.js +65 -0
- package/dist/run/host.d.ts +89 -0
- package/dist/run/host.js +1 -0
- package/dist/run/index.d.ts +20 -7
- package/dist/run/index.js +12 -4
- package/dist/run/oauth2-token.d.ts +42 -0
- package/dist/run/oauth2-token.js +92 -0
- package/dist/run/open.d.ts +12 -0
- package/dist/run/open.js +16 -0
- package/dist/run/run.d.ts +124 -4
- package/dist/run/run.js +293 -134
- package/dist/run/scope.d.ts +11 -0
- package/dist/run/scope.js +26 -0
- package/dist/run/script-support.d.ts +53 -0
- package/dist/run/script-support.js +68 -0
- package/dist/run/secret-needs.d.ts +11 -4
- package/dist/run/secret-needs.js +48 -96
- package/dist/run/select.d.ts +34 -25
- package/dist/run/select.js +45 -54
- package/dist/run/send-helpers.d.ts +93 -0
- package/dist/run/send-helpers.js +255 -0
- package/dist/run/tree.d.ts +50 -0
- package/dist/run/tree.js +54 -0
- package/dist/script/api/postman.d.ts +10 -0
- package/dist/script/api/postman.js +264 -0
- package/dist/script/api/prelude.d.ts +20 -0
- package/dist/script/api/prelude.js +215 -0
- package/dist/script/apply.d.ts +44 -0
- package/dist/script/apply.js +120 -0
- package/dist/script/check/host.d.ts +41 -0
- package/dist/script/check/host.js +143 -0
- package/dist/script/check/service.d.ts +52 -0
- package/dist/script/check/service.js +195 -0
- package/dist/script/check/worker.d.ts +1 -0
- package/dist/script/check/worker.js +40 -0
- package/dist/script/index.d.ts +16 -0
- package/dist/script/index.js +10 -0
- package/dist/script/lookup.d.ts +10 -0
- package/dist/script/lookup.js +23 -0
- package/dist/script/model.d.ts +82 -0
- package/dist/script/model.js +18 -0
- package/dist/script/props.d.ts +8 -0
- package/dist/script/props.js +28 -0
- package/dist/script/request-scripts.d.ts +83 -0
- package/dist/script/request-scripts.js +160 -0
- package/dist/script/run.d.ts +47 -0
- package/dist/script/run.js +146 -0
- package/dist/script/sandbox/execute.d.ts +26 -0
- package/dist/script/sandbox/execute.js +212 -0
- package/dist/script/sandbox/host-api.d.ts +27 -0
- package/dist/script/sandbox/host-api.js +101 -0
- package/dist/script/sandbox/host.d.ts +18 -0
- package/dist/script/sandbox/host.js +172 -0
- package/dist/script/sandbox/model.d.ts +69 -0
- package/dist/script/sandbox/model.js +24 -0
- package/dist/script/sandbox/worker.d.ts +1 -0
- package/dist/script/sandbox/worker.js +20 -0
- package/dist/script/send.d.ts +27 -0
- package/dist/script/send.js +76 -0
- package/dist/script/strip.d.ts +5 -0
- package/dist/script/strip.js +43 -0
- package/dist/script/types/api.d.ts +38 -0
- package/dist/script/types/api.js +113 -0
- package/dist/script/types/json-schema.d.ts +26 -0
- package/dist/script/types/json-schema.js +206 -0
- package/dist/secrets/env-names.d.ts +9 -1
- package/dist/secrets/env-names.js +17 -1
- package/dist/secrets/resolve.d.ts +44 -4
- package/dist/secrets/resolve.js +58 -1
- package/dist/secrets/scan/apply.d.ts +36 -0
- package/dist/secrets/scan/apply.js +194 -0
- package/dist/secrets/scan/rules.d.ts +32 -0
- package/dist/secrets/scan/rules.js +346 -0
- package/dist/secrets/scan/scan.d.ts +6 -0
- package/dist/secrets/scan/scan.js +57 -0
- package/dist/secrets/scan/walk.d.ts +70 -0
- package/dist/secrets/scan/walk.js +156 -0
- package/dist/secrets/secret-refs.d.ts +8 -0
- package/dist/secrets/secret-refs.js +25 -0
- package/dist/secrets/secret-token.d.ts +17 -0
- package/dist/secrets/secret-token.js +25 -0
- package/dist/sequence/file.d.ts +169 -0
- package/dist/sequence/file.js +237 -0
- package/dist/sequence/index.d.ts +7 -0
- package/dist/sequence/index.js +5 -0
- package/dist/sequence/load.d.ts +32 -0
- package/dist/sequence/load.js +56 -0
- package/dist/sequence/model.d.ts +115 -0
- package/dist/sequence/model.js +53 -0
- package/dist/sequence/run.d.ts +131 -0
- package/dist/sequence/run.js +191 -0
- package/dist/sequence/transfer.d.ts +24 -0
- package/dist/sequence/transfer.js +75 -0
- package/dist/server-api/audit.d.ts +455 -0
- package/dist/server-api/audit.js +186 -0
- package/dist/server-api/ci-tokens.d.ts +50 -0
- package/dist/server-api/ci-tokens.js +35 -0
- package/dist/server-api/hooks.d.ts +337 -0
- package/dist/server-api/hooks.js +152 -0
- package/dist/server-api/identity.d.ts +210 -0
- package/dist/server-api/identity.js +115 -0
- package/dist/server-api/licensing.d.ts +80 -0
- package/dist/server-api/licensing.js +53 -0
- package/dist/server-api/live.d.ts +132 -0
- package/dist/server-api/live.js +102 -0
- package/dist/server-api/meta.d.ts +31 -0
- package/dist/server-api/meta.js +21 -0
- package/dist/server-api/sync.d.ts +179 -0
- package/dist/server-api/sync.js +124 -0
- package/dist/server-api/teams.d.ts +306 -0
- package/dist/server-api/teams.js +113 -0
- package/dist/snapshot/diff.d.ts +30 -0
- package/dist/snapshot/diff.js +75 -0
- package/dist/snapshot/format.d.ts +17 -0
- package/dist/snapshot/format.js +40 -0
- package/dist/snapshot/golden-file.d.ts +45 -0
- package/dist/snapshot/golden-file.js +173 -0
- package/dist/snapshot/ignore.d.ts +14 -0
- package/dist/snapshot/ignore.js +79 -0
- package/dist/snapshot/index.d.ts +9 -0
- package/dist/snapshot/index.js +9 -0
- package/dist/snapshot/json-diff.d.ts +3 -0
- package/dist/snapshot/json-diff.js +93 -0
- package/dist/snapshot/xml-diff.d.ts +10 -0
- package/dist/snapshot/xml-diff.js +194 -0
- package/dist/soap/auth.d.ts +26 -0
- package/dist/soap/auth.js +54 -0
- package/dist/soap/curl.d.ts +20 -0
- package/dist/soap/curl.js +161 -0
- package/dist/soap/expand.d.ts +24 -0
- package/dist/soap/expand.js +95 -0
- package/dist/soap/files.d.ts +384 -0
- package/dist/soap/files.js +114 -0
- package/dist/soap/form-request.d.ts +13 -0
- package/dist/soap/form-request.js +2 -2
- package/dist/soap/generate.d.ts +12 -0
- package/dist/{generate.js → soap/generate.js} +4 -4
- package/dist/{import.d.ts → soap/import.d.ts} +4 -4
- package/dist/{import.js → soap/import.js} +13 -13
- package/dist/soap/json-operation.d.ts +35 -0
- package/dist/soap/json-operation.js +225 -0
- package/dist/soap/legacy-project/env-refs.d.ts +19 -0
- package/dist/soap/legacy-project/env-refs.js +105 -0
- package/dist/soap/legacy-project/map.d.ts +2 -2
- package/dist/soap/legacy-project/map.js +6 -0
- package/dist/soap/mime/multipart.d.ts +2 -2
- package/dist/soap/mime/multipart.js +2 -5
- package/dist/soap/mime/send-pipeline.d.ts +1 -1
- package/dist/soap/mime/send-pipeline.js +1 -1
- package/dist/soap/mime/types.d.ts +1 -3
- package/dist/soap/module.d.ts +2 -0
- package/dist/soap/module.js +13 -0
- package/dist/soap/namespace-scope.js +1 -1
- package/dist/soap/operations.d.ts +12 -0
- package/dist/{operations.js → soap/operations.js} +4 -4
- package/dist/soap/run.d.ts +70 -0
- package/dist/soap/run.js +549 -0
- package/dist/soap/script-types.d.ts +65 -0
- package/dist/soap/script-types.js +379 -0
- package/dist/soap/scripting.d.ts +45 -0
- package/dist/soap/scripting.js +221 -0
- package/dist/soap/send-input.d.ts +61 -0
- package/dist/{send-options.js → soap/send-input.js} +5 -109
- package/dist/{send.d.ts → soap/send.d.ts} +1 -1
- package/dist/{send.js → soap/send.js} +28 -12
- package/dist/soap/storage.d.ts +9 -0
- package/dist/soap/storage.js +237 -0
- package/dist/soap/transforms.d.ts +3 -12
- package/dist/soap/transforms.js +3 -14
- package/dist/{types.d.ts → soap/types.d.ts} +34 -84
- package/dist/sync/git-cli.d.ts +202 -0
- package/dist/sync/git-cli.js +684 -0
- package/dist/sync/three-way-merge.d.ts +41 -0
- package/dist/sync/three-way-merge.js +85 -0
- package/dist/sync/tree-paths.d.ts +34 -0
- package/dist/sync/tree-paths.js +131 -0
- package/dist/team-secrets/envelope.d.ts +10 -0
- package/dist/team-secrets/envelope.js +121 -0
- package/dist/team-secrets/errors.d.ts +26 -0
- package/dist/team-secrets/errors.js +27 -0
- package/dist/team-secrets/index.d.ts +14 -0
- package/dist/team-secrets/index.js +8 -0
- package/dist/team-secrets/keys.d.ts +52 -0
- package/dist/team-secrets/keys.js +158 -0
- package/dist/team-secrets/log.d.ts +48 -0
- package/dist/team-secrets/log.js +175 -0
- package/dist/team-secrets/resolve-conflict.d.ts +7 -0
- package/dist/team-secrets/resolve-conflict.js +14 -0
- package/dist/team-secrets/schema.d.ts +97 -0
- package/dist/team-secrets/schema.js +157 -0
- package/dist/team-secrets/sign.d.ts +24 -0
- package/dist/team-secrets/sign.js +71 -0
- package/dist/team-secrets/vault.d.ts +49 -0
- package/dist/team-secrets/vault.js +148 -0
- package/dist/validate/wsi/run-message.d.ts +2 -2
- package/dist/validate/wsi/run-message.js +1 -1
- package/dist/validate/wsi/run-wsdl.d.ts +2 -2
- package/dist/validate/wsi/run-wsdl.js +1 -1
- package/dist/validate/wsi/types.d.ts +1 -1
- package/dist/webhooks/model.d.ts +138 -0
- package/dist/webhooks/model.js +150 -0
- package/dist/workspace/commit-message.d.ts +1 -1
- package/dist/workspace/commit-message.js +6 -1
- package/dist/workspace/environments.d.ts +11 -4
- package/dist/workspace/environments.js +12 -0
- package/dist/workspace/index.d.ts +3 -3
- package/dist/workspace/index.js +2 -2
- package/dist/workspace/paths.d.ts +5 -2
- package/dist/workspace/paths.js +5 -2
- package/dist/workspace/schema.d.ts +7 -3
- package/dist/workspace/schema.js +24 -3
- package/dist/workspace/share.d.ts +30 -11
- package/dist/workspace/share.js +32 -6
- package/dist/ws/call.d.ts +1 -1
- package/dist/ws/call.js +2 -2
- package/dist/ws/connect.d.ts +60 -0
- package/dist/ws/connect.js +131 -0
- package/dist/ws/events.d.ts +17 -0
- package/dist/ws/events.js +1 -0
- package/dist/ws/expand.d.ts +1 -1
- package/dist/ws/expand.js +1 -1
- package/dist/ws/files.d.ts +284 -0
- package/dist/ws/files.js +71 -0
- package/dist/ws/history-entry.d.ts +44 -0
- package/dist/ws/history-entry.js +93 -0
- package/dist/ws/model.d.ts +44 -3
- package/dist/ws/model.js +3 -0
- package/dist/ws/module.d.ts +2 -0
- package/dist/ws/module.js +11 -0
- package/dist/ws/run.d.ts +63 -0
- package/dist/ws/run.js +470 -0
- package/dist/ws/session.d.ts +18 -0
- package/dist/ws/session.js +52 -25
- package/dist/ws/storage.d.ts +9 -0
- package/dist/ws/storage.js +176 -0
- package/dist/ws/transcript.d.ts +3 -4
- package/dist/ws/transcript.js +26 -17
- package/dist/ws/url.d.ts +1 -1
- package/dist/wsdl/cache.js +1 -1
- package/dist/wsdl/docs-generator.d.ts +3 -3
- package/dist/wsdl/docs-generator.js +1 -1
- package/dist/wsdl/export-definition.js +1 -1
- package/dist/wsdl/qname.d.ts +2 -5
- package/dist/wsdl/resolver.d.ts +4 -11
- package/dist/wsdl/resolver.js +3 -3
- package/dist/wsdl/update-definition.d.ts +5 -5
- package/dist/wsdl/update-definition.js +6 -6
- package/dist/wss/apply.js +1 -1
- package/dist/{project/wss-configs.d.ts → wss/configs.d.ts} +2 -2
- package/dist/{project/wss-configs.js → wss/configs.js} +2 -2
- package/dist/wss/incoming/decrypt.d.ts +1 -1
- package/dist/wss/incoming/index.js +1 -1
- package/dist/wss/incoming/verify.d.ts +1 -1
- package/dist/wss/incoming/verify.js +1 -1
- package/dist/wss/key-identifiers.js +1 -1
- package/dist/wss/model.d.ts +1 -1
- package/dist/wss/outgoing/encryption.d.ts +1 -1
- package/dist/wss/outgoing/signature.d.ts +1 -1
- package/dist/xml/decode.d.ts +15 -0
- package/dist/xml/decode.js +22 -0
- package/dist/xml/entitize.d.ts +17 -0
- package/dist/xml/entitize.js +19 -0
- package/dist/xml/index.d.ts +1 -1
- package/dist/xml/index.js +1 -1
- package/dist/xml/locate.d.ts +39 -0
- package/dist/xml/locate.js +117 -0
- package/dist/xml/qname.d.ts +12 -0
- package/dist/xml/qname.js +8 -0
- package/dist/xpath/evaluate-async.d.ts +19 -0
- package/dist/xpath/evaluate-async.js +31 -11
- package/dist/xpath/evaluate.d.ts +1 -1
- package/dist/xpath/namespaces.js +1 -1
- package/dist/xpath/worker.d.ts +11 -5
- package/dist/xpath/worker.js +24 -7
- package/dist/xsd/form-model.d.ts +19 -2
- package/dist/xsd/form-model.js +14 -2
- package/dist/xsd/json-bridge.d.ts +152 -0
- package/dist/xsd/json-bridge.js +1213 -0
- package/dist/xsd/locate.d.ts +2 -30
- package/dist/xsd/locate.js +1 -109
- package/dist/xsd/xml-scan.d.ts +2 -0
- package/dist/xsd/xml-scan.js +1 -1
- package/dist/xsd/xml-writer.d.ts +2 -0
- package/dist/xsd/xml-writer.js +4 -0
- package/package.json +12 -1
- package/dist/generate.d.ts +0 -12
- package/dist/operations.d.ts +0 -12
- package/dist/run/effective-auth.d.ts +0 -10
- package/dist/run/effective-auth.js +0 -19
- package/dist/run/prepare.d.ts +0 -43
- package/dist/run/prepare.js +0 -280
- package/dist/send-options.d.ts +0 -141
- package/dist/wsdl/fetch.d.ts +0 -13
- /package/dist/{soap → http}/charset.d.ts +0 -0
- /package/dist/{soap → http}/charset.js +0 -0
- /package/dist/{wsdl → http}/ref-policy.d.ts +0 -0
- /package/dist/{wsdl → http}/ref-policy.js +0 -0
- /package/dist/{wss/keystore → keystore}/certificate.d.ts +0 -0
- /package/dist/{wss/keystore → keystore}/certificate.js +0 -0
- /package/dist/{wss/keystore → keystore}/index.d.ts +0 -0
- /package/dist/{wss/keystore → keystore}/model.d.ts +0 -0
- /package/dist/{wss/keystore → keystore}/model.js +0 -0
- /package/dist/{wss/keystore → keystore}/pem.d.ts +0 -0
- /package/dist/{wss/keystore → keystore}/pkcs12.d.ts +0 -0
- /package/dist/{wsdl → project}/cache-naming.d.ts +0 -0
- /package/dist/{types.js → soap/types.js} +0 -0
- /package/dist/{soap → xml}/prefixes.d.ts +0 -0
- /package/dist/{soap → xml}/prefixes.js +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the protocol modules share when they prepare and send a request in a run: secret tokens,
|
|
3
|
+
* the project-folder boundary, keystores and TLS, OAuth2 tokens, the base URL an environment
|
|
4
|
+
* overrides, and the secret a keystore needs. Core code: it names no protocol.
|
|
5
|
+
*/
|
|
6
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
7
|
+
import { resolve as resolvePath } from 'node:path';
|
|
8
|
+
import { WirebenchError } from '../errors.js';
|
|
9
|
+
import { isInsideRealDir } from '../fs.js';
|
|
10
|
+
import { resolveApiBaseUrl } from '../project/environments.js';
|
|
11
|
+
import { toKeystoreDef } from '../project/keystores.js';
|
|
12
|
+
import { secretNamesIn } from '../project/properties.js';
|
|
13
|
+
import { urlOrigin } from '../project/sequence-guards.js';
|
|
14
|
+
import { resolveAuthConfig, resolveSecretTokens } from '../secrets/resolve.js';
|
|
15
|
+
import { resolveWorkspaceApiBaseUrl, withActiveEnvironment } from '../workspace/environments.js';
|
|
16
|
+
import { loadKeystore, toTlsClientIdentity } from '../keystore/index.js';
|
|
17
|
+
import { scopesFor } from './context.js';
|
|
18
|
+
import { createRunTokenSource, requiredSecret } from './oauth2-token.js';
|
|
19
|
+
/**
|
|
20
|
+
* The `${secret:name}` names anywhere in `value`'s strings — a send input or a saved request —
|
|
21
|
+
* following property values through `scopes`, in first-use order. Binary data is skipped.
|
|
22
|
+
*/
|
|
23
|
+
export function secretNamesInValue(value, scopes) {
|
|
24
|
+
const found = new Set();
|
|
25
|
+
const visit = (current) => {
|
|
26
|
+
if (typeof current === 'string') {
|
|
27
|
+
if (current.includes('${')) {
|
|
28
|
+
for (const name of secretNamesIn(current, scopes)) {
|
|
29
|
+
found.add(name);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (Array.isArray(current)) {
|
|
34
|
+
current.forEach(visit);
|
|
35
|
+
}
|
|
36
|
+
else if (current !== null && typeof current === 'object' && !ArrayBuffer.isView(current)) {
|
|
37
|
+
Object.values(current).forEach(visit);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
visit(value);
|
|
41
|
+
return [...found];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* `scopes` with the value of every `${secret:name}` token `input` reaches. Each value comes from
|
|
45
|
+
* `getSecret`, so a host that masks what it hands out (the CLI's `createEnvSecrets`) masks these too.
|
|
46
|
+
*/
|
|
47
|
+
export async function withSecrets(input, scopes, getSecret, placeholders) {
|
|
48
|
+
const names = secretNamesInValue(input, scopes);
|
|
49
|
+
if (names.length === 0)
|
|
50
|
+
return scopes;
|
|
51
|
+
return {
|
|
52
|
+
...scopes,
|
|
53
|
+
secrets: placeholders !== undefined ? placeholders.scopeFor(names) : await resolveSecretTokens(names, getSecret),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The refusal for a request whose text holds property references nothing resolves, under the code
|
|
58
|
+
* its protocol raises (spec §8).
|
|
59
|
+
*/
|
|
60
|
+
export function unresolvedError(code, path, unresolved) {
|
|
61
|
+
const exprs = unresolved.map((ref) => ref.expr);
|
|
62
|
+
return new WirebenchError(code, `"${path}" has property references nothing resolves: ${exprs.join(', ')}`, {
|
|
63
|
+
details: { path, unresolved: exprs },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* `path` resolved against the project folder, refused when it lands outside it. The app also
|
|
68
|
+
* accepts a file its user picked through a dialog; a pipeline has no such user, so the project
|
|
69
|
+
* folder is the whole boundary.
|
|
70
|
+
*/
|
|
71
|
+
export async function insideProject(context, path, code, name) {
|
|
72
|
+
const resolved = resolvePath(context.projectDir, path);
|
|
73
|
+
if (!(await isInsideRealDir(context.projectDir, resolved))) {
|
|
74
|
+
throw new WirebenchError(code, `"${name}" resolves outside the project folder.`, { details: { path } });
|
|
75
|
+
}
|
|
76
|
+
return resolved;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Mirrors the app's keystore loading, minus its cache and its picked files: a run loads each keystore
|
|
80
|
+
* it needs, from inside the project folder. Reached through {@link keystoreFor} only.
|
|
81
|
+
*/
|
|
82
|
+
async function loadKeystoreById(context, keystoreId) {
|
|
83
|
+
const ref = context.project.wss.keystores.find((candidate) => candidate.id === keystoreId);
|
|
84
|
+
if (ref === undefined) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const def = toKeystoreDef(ref);
|
|
88
|
+
const path = await insideProject(context, def.path, 'keystore-outside-project', def.name);
|
|
89
|
+
try {
|
|
90
|
+
await stat(path);
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
throw new WirebenchError('keystore-unreadable', `The keystore file "${def.path}" could not be read.`, {
|
|
94
|
+
details: { id: def.id },
|
|
95
|
+
cause: error,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const password = def.passwordSecretRef === undefined
|
|
99
|
+
? undefined
|
|
100
|
+
: await requiredSecret(def.passwordSecretRef, context.host.getSecret);
|
|
101
|
+
return loadKeystore(await readFile(path), { type: def.type, ...(password !== undefined ? { password } : {}) });
|
|
102
|
+
}
|
|
103
|
+
/** A keystore by its entry id: through the host's loader when it lends one, else from the project folder. */
|
|
104
|
+
export async function keystoreFor(context, keystoreId) {
|
|
105
|
+
const { keystoreFor: lent } = context.host;
|
|
106
|
+
return lent !== undefined ? await lent(keystoreId) : await loadKeystoreById(context, keystoreId);
|
|
107
|
+
}
|
|
108
|
+
/** The `cert`/`key` a request's own keystore presents; there is no global keystore in a run. */
|
|
109
|
+
export async function clientIdentityFor(context, keystoreId) {
|
|
110
|
+
if (keystoreId === undefined || keystoreId.length === 0) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const keystore = await keystoreFor(context, keystoreId);
|
|
114
|
+
const def = context.project.wss.keystores.find((candidate) => candidate.id === keystoreId);
|
|
115
|
+
if (keystore === undefined || def === undefined) {
|
|
116
|
+
throw new WirebenchError('keystore-missing', 'This request selects a keystore the project no longer has.', {
|
|
117
|
+
details: { keystoreId },
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const identity = toTlsClientIdentity(keystore, toKeystoreDef(def).defaultAlias);
|
|
121
|
+
return { cert: identity.cert, key: identity.key };
|
|
122
|
+
}
|
|
123
|
+
/** Identity, then the only two trust opt-outs a run honours: `--insecure` and the file's own flag. */
|
|
124
|
+
export async function tlsFor(context, keystoreId, trustInvalid) {
|
|
125
|
+
const { tls } = context.host;
|
|
126
|
+
const identity = tls?.identityFor !== undefined ? await tls.identityFor(keystoreId) : await clientIdentityFor(context, keystoreId);
|
|
127
|
+
const skipVerify = context.insecure === true || trustInvalid;
|
|
128
|
+
const anchors = tls?.anchors;
|
|
129
|
+
if (identity === undefined && !skipVerify && anchors === undefined)
|
|
130
|
+
return undefined;
|
|
131
|
+
return {
|
|
132
|
+
...(identity !== undefined ? { cert: identity.cert, key: identity.key } : {}),
|
|
133
|
+
...(anchors !== undefined ? { ca: [...anchors] } : {}),
|
|
134
|
+
...(skipVerify ? { rejectUnauthorized: false } : {}),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** The run's shared token source, or a fresh one for a send outside a run. */
|
|
138
|
+
export function tokenSourceOf(context) {
|
|
139
|
+
return (context.host.tokens ??
|
|
140
|
+
createRunTokenSource({
|
|
141
|
+
getSecret: context.host.getSecret,
|
|
142
|
+
...(context.host.onSecretValue !== undefined ? { onSecretValue: context.host.onSecretValue } : {}),
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* A request's effective auth with its secrets resolved. OAuth2 client credentials obtains a token
|
|
147
|
+
* (the token request uses the request's own TLS, the proxy for the token URL and the run's
|
|
148
|
+
* timeout); the authorization-code grant needs a browser a pipeline does not have, and is refused.
|
|
149
|
+
*
|
|
150
|
+
* @throws WirebenchError `auth-grant-unsupported` | `secret-missing` | `unresolved-properties` |
|
|
151
|
+
* `oauth2-token-error` | `oauth2-token-malformed`
|
|
152
|
+
*/
|
|
153
|
+
export async function authFor(configured, path, context, tls) {
|
|
154
|
+
if (configured.type !== 'oauth2') {
|
|
155
|
+
return reportedAuth(await resolveAuthConfig(configured, context.host.getSecret), context);
|
|
156
|
+
}
|
|
157
|
+
const accessToken = await tokenSourceOf(context).accessTokenFor(configured, {
|
|
158
|
+
scopes: scopesFor(context),
|
|
159
|
+
...(tls !== undefined ? { tls } : {}),
|
|
160
|
+
...(context.host.proxyFor !== undefined ? { proxy: context.host.proxyFor } : {}),
|
|
161
|
+
...(context.timeoutMs !== undefined ? { timeoutMs: context.timeoutMs } : {}),
|
|
162
|
+
...(context.signal !== undefined ? { signal: context.signal } : {}),
|
|
163
|
+
});
|
|
164
|
+
return reportedAuth(await resolveAuthConfig(configured, context.host.getSecret, { accessToken }), context);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Tells the host each credential a resolved auth puts on the wire, in the form it travels there,
|
|
168
|
+
* so a server that echoes one back has it masked: an API key's value, a bearer or OAuth2 access
|
|
169
|
+
* token, and Basic's `base64(user:password)`. A password is never reported bare — people choose
|
|
170
|
+
* them, so one is often ordinary text — and NTLM's password never travels at all.
|
|
171
|
+
*/
|
|
172
|
+
export function reportedAuth(auth, context) {
|
|
173
|
+
const report = context.host.onSecretValue;
|
|
174
|
+
if (report === undefined || auth === undefined)
|
|
175
|
+
return auth;
|
|
176
|
+
switch (auth.type) {
|
|
177
|
+
case 'api-key':
|
|
178
|
+
report(auth.value);
|
|
179
|
+
break;
|
|
180
|
+
case 'bearer':
|
|
181
|
+
report(auth.token);
|
|
182
|
+
break;
|
|
183
|
+
case 'oauth2':
|
|
184
|
+
report(auth.accessToken);
|
|
185
|
+
break;
|
|
186
|
+
case 'basic':
|
|
187
|
+
report(Buffer.from(`${auth.username}:${auth.password}`, 'utf-8').toString('base64'));
|
|
188
|
+
break;
|
|
189
|
+
default:
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
return auth;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* An API's base URL (or target) and where it came from, through the workspace's environment when
|
|
196
|
+
* the run has a workspace: what a preview reports beside the URL.
|
|
197
|
+
*/
|
|
198
|
+
export function resolvedBaseUrl(context, api) {
|
|
199
|
+
const { project, environmentId, workspace } = context;
|
|
200
|
+
return workspace === undefined
|
|
201
|
+
? resolveApiBaseUrl(project, environmentId, api)
|
|
202
|
+
: resolveWorkspaceApiBaseUrl({
|
|
203
|
+
workspace: withActiveEnvironment(workspace.workspace, environmentId),
|
|
204
|
+
project,
|
|
205
|
+
projectSlug: workspace.projectSlug,
|
|
206
|
+
api,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/** An API's base URL (or target), through the workspace's environment likewise. */
|
|
210
|
+
export function baseUrlFor(context, api) {
|
|
211
|
+
return resolvedBaseUrl(context, api).url;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* After a server refused the credentials a send carried, drops the run's OAuth2 token among them,
|
|
215
|
+
* so the next request behind that configuration fetches a new one instead of repeating the refusal.
|
|
216
|
+
* The refused request itself is never sent again.
|
|
217
|
+
*/
|
|
218
|
+
export function dropRefusedToken(context, auth, refused) {
|
|
219
|
+
if (refused && auth?.type === 'oauth2') {
|
|
220
|
+
context.host.tokens?.reject(auth.accessToken);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** The origin a request went to, as a sent request reports it; nothing for a URL without one. */
|
|
224
|
+
export function originOf(url) {
|
|
225
|
+
const origin = urlOrigin(url);
|
|
226
|
+
return origin !== undefined ? { origin } : {};
|
|
227
|
+
}
|
|
228
|
+
/** True for a reference that is set: neither absent nor empty. */
|
|
229
|
+
export const present = (id) => id !== undefined && id.length > 0;
|
|
230
|
+
/** A keystore's password, when the registry entry has one; an unreadable entry needs nothing here. */
|
|
231
|
+
export function keystoreNeeds(project, keystoreId) {
|
|
232
|
+
if (!present(keystoreId)) {
|
|
233
|
+
return [];
|
|
234
|
+
}
|
|
235
|
+
const ref = project.wss.keystores.find((candidate) => candidate.id === keystoreId);
|
|
236
|
+
if (ref === undefined) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
try {
|
|
240
|
+
const def = toKeystoreDef(ref);
|
|
241
|
+
return present(def.passwordSecretRef)
|
|
242
|
+
? [
|
|
243
|
+
{
|
|
244
|
+
ref: def.passwordSecretRef,
|
|
245
|
+
...(def.passwordEnv !== undefined ? { envName: def.passwordEnv } : {}),
|
|
246
|
+
purpose: `keystore password for "${def.name}"`,
|
|
247
|
+
},
|
|
248
|
+
]
|
|
249
|
+
: [];
|
|
250
|
+
}
|
|
251
|
+
catch {
|
|
252
|
+
// The module's send refuses such a request with its own error; it needs no secret before then.
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walking a container's tree of folders and requests, as the REST, gRPC and WebSocket modules all
|
|
3
|
+
* keep one. Core code: it names no protocol.
|
|
4
|
+
*/
|
|
5
|
+
/** Explorer order: by `order`, then by name. */
|
|
6
|
+
export declare const byOrder: <T extends {
|
|
7
|
+
readonly order: number;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
}>(a: T, b: T) => number;
|
|
10
|
+
/** Why a request its contract no longer has cannot be a sequence step. */
|
|
11
|
+
export declare const ORPHANED_STEP_REASON = "The request is no longer in its contract (orphaned)";
|
|
12
|
+
/** What a tree's request has, as far as the walk cares. */
|
|
13
|
+
export interface TreeRequest {
|
|
14
|
+
readonly order: number;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly slug: string;
|
|
17
|
+
}
|
|
18
|
+
/** What a tree's folder has, as far as the walk cares. */
|
|
19
|
+
export interface TreeFolder<F, R> {
|
|
20
|
+
readonly order: number;
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly slug: string;
|
|
23
|
+
readonly folders: readonly F[];
|
|
24
|
+
readonly requests: readonly R[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Walks a request tree in explorer order. `make` turns a request the protocol can run into its
|
|
28
|
+
* selection, or answers `undefined` for one it skips (orphaned, streaming). Each selection is pushed
|
|
29
|
+
* to `out` with the request's path on disk, without the `.request.yaml` suffix.
|
|
30
|
+
*/
|
|
31
|
+
export declare function walkTree<F extends TreeFolder<F, R>, R extends TreeRequest, S>(node: {
|
|
32
|
+
readonly folders: readonly F[];
|
|
33
|
+
readonly requests: readonly R[];
|
|
34
|
+
}, chain: readonly F[], group: string, diskDir: string, make: (request: R, chain: readonly F[], group: string) => S | undefined, out: {
|
|
35
|
+
item: S;
|
|
36
|
+
diskPath: string;
|
|
37
|
+
}[]): void;
|
|
38
|
+
/** A tree of folders and requests, as far as a lookup by id cares. */
|
|
39
|
+
export interface RequestTree<R extends {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
} = {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
}> {
|
|
44
|
+
readonly folders: readonly RequestTree<R>[];
|
|
45
|
+
readonly requests: readonly R[];
|
|
46
|
+
}
|
|
47
|
+
/** The request with `id` anywhere in `tree`, depth-first. */
|
|
48
|
+
export declare function findInTree<R extends {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
}>(tree: RequestTree<R>, id: string): R | undefined;
|
package/dist/run/tree.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walking a container's tree of folders and requests, as the REST, gRPC and WebSocket modules all
|
|
3
|
+
* keep one. Core code: it names no protocol.
|
|
4
|
+
*/
|
|
5
|
+
/** Explorer order: by `order`, then by name. */
|
|
6
|
+
export const byOrder = (a, b) => a.order - b.order || a.name.localeCompare(b.name);
|
|
7
|
+
/** Why a request its contract no longer has cannot be a sequence step. */
|
|
8
|
+
export const ORPHANED_STEP_REASON = 'The request is no longer in its contract (orphaned)';
|
|
9
|
+
/**
|
|
10
|
+
* Walks a request tree in explorer order. `make` turns a request the protocol can run into its
|
|
11
|
+
* selection, or answers `undefined` for one it skips (orphaned, streaming). Each selection is pushed
|
|
12
|
+
* to `out` with the request's path on disk, without the `.request.yaml` suffix.
|
|
13
|
+
*/
|
|
14
|
+
export function walkTree(node, chain, group, diskDir, make, out) {
|
|
15
|
+
const children = [
|
|
16
|
+
...node.requests.map((request) => ({
|
|
17
|
+
tag: 'request',
|
|
18
|
+
order: request.order,
|
|
19
|
+
name: request.name,
|
|
20
|
+
request,
|
|
21
|
+
})),
|
|
22
|
+
...node.folders.map((folder) => ({
|
|
23
|
+
tag: 'folder',
|
|
24
|
+
order: folder.order,
|
|
25
|
+
name: folder.name,
|
|
26
|
+
folder,
|
|
27
|
+
})),
|
|
28
|
+
].sort(byOrder);
|
|
29
|
+
for (const child of children) {
|
|
30
|
+
if (child.tag === 'request') {
|
|
31
|
+
const item = make(child.request, chain, group);
|
|
32
|
+
if (item !== undefined) {
|
|
33
|
+
out.push({ item, diskPath: `${diskDir}/${child.request.slug}` });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
walkTree(child.folder, [...chain, child.folder], `${group}/${child.folder.name}`, `${diskDir}/${child.folder.slug}`, make, out);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** The request with `id` anywhere in `tree`, depth-first. */
|
|
42
|
+
export function findInTree(tree, id) {
|
|
43
|
+
const own = tree.requests.find((request) => request.id === id);
|
|
44
|
+
if (own !== undefined) {
|
|
45
|
+
return own;
|
|
46
|
+
}
|
|
47
|
+
for (const folder of tree.folders) {
|
|
48
|
+
const found = findInTree(folder, id);
|
|
49
|
+
if (found !== undefined) {
|
|
50
|
+
return found;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Postman layer (spec §Postman): `pm`, `postman`, `CryptoJS`, `btoa` and `atob`, as JavaScript
|
|
3
|
+
* that runs inside the sandbox after the API and before an imported script. It is written over the
|
|
4
|
+
* same API a typed script uses — `vars`, `props`, `test`, `request`, `response`, `crypto`,
|
|
5
|
+
* `encoding` — so it can do nothing a typed script cannot.
|
|
6
|
+
*
|
|
7
|
+
* It covers what imported collections mostly use. Anything else throws `ScriptUnsupported` naming
|
|
8
|
+
* the call, which the host reports as `script-unsupported`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const POSTMAN_LAYER: string;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Postman layer (spec §Postman): `pm`, `postman`, `CryptoJS`, `btoa` and `atob`, as JavaScript
|
|
3
|
+
* that runs inside the sandbox after the API and before an imported script. It is written over the
|
|
4
|
+
* same API a typed script uses — `vars`, `props`, `test`, `request`, `response`, `crypto`,
|
|
5
|
+
* `encoding` — so it can do nothing a typed script cannot.
|
|
6
|
+
*
|
|
7
|
+
* It covers what imported collections mostly use. Anything else throws `ScriptUnsupported` naming
|
|
8
|
+
* the call, which the host reports as `script-unsupported`.
|
|
9
|
+
*/
|
|
10
|
+
export const POSTMAN_LAYER = String.raw `
|
|
11
|
+
const unsupported = (name) => () => {
|
|
12
|
+
throw new ScriptUnsupported(name + ' is not supported: a script cannot send requests, keep cookies or control the run');
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const asValue = (value) => (value === undefined || value === null ? '' : typeof value === 'object' ? JSON.stringify(value) : value);
|
|
16
|
+
const variables = Object.freeze({
|
|
17
|
+
get: (name) => { const v = vars.get(name); return v !== undefined ? v : props.get(name); },
|
|
18
|
+
set: (name, value) => vars.set(name, asValue(value)),
|
|
19
|
+
unset: (name) => vars.set(name, ''),
|
|
20
|
+
has: (name) => vars.get(name) !== undefined || props.get(name) !== undefined,
|
|
21
|
+
clear: unsupported('Clearing variables'),
|
|
22
|
+
toObject: () => ({}),
|
|
23
|
+
replaceIn: (text) => String(text).replace(/\{\{\s*([^{}]*?)\s*\}\}/g, (whole, name) => {
|
|
24
|
+
const v = variables.get(name);
|
|
25
|
+
return v === undefined ? whole : String(v);
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// --- expect: the chai chains collections use ---------------------------------------------------
|
|
30
|
+
const typeName = (value) => {
|
|
31
|
+
if (value === null) return 'null';
|
|
32
|
+
if (Array.isArray(value)) return 'array';
|
|
33
|
+
if (value instanceof RegExp) return 'regexp';
|
|
34
|
+
return typeof value;
|
|
35
|
+
};
|
|
36
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
37
|
+
const chain = (actual, flags) => {
|
|
38
|
+
const assert = (passed, message) => {
|
|
39
|
+
if (passed === flags.not) throw new ExpectationFailed('expected ' + show(actual) + (flags.not ? ' not ' : ' ') + message);
|
|
40
|
+
return self;
|
|
41
|
+
};
|
|
42
|
+
const self = {};
|
|
43
|
+
const word = (name) => Object.defineProperty(self, name, { get: () => self });
|
|
44
|
+
for (const w of ['to', 'be', 'been', 'is', 'that', 'which', 'and', 'has', 'have', 'with', 'at', 'of', 'same', 'but', 'does', 'still', 'also']) word(w);
|
|
45
|
+
Object.defineProperty(self, 'not', { get: () => chain(actual, { ...flags, not: !flags.not }) });
|
|
46
|
+
Object.defineProperty(self, 'deep', { get: () => chain(actual, { ...flags, deep: true }) });
|
|
47
|
+
const equal = (expected) => assert(flags.deep ? same(actual, expected) : Object.is(actual, expected), 'to equal ' + show(expected));
|
|
48
|
+
self.equal = self.equals = self.eq = equal;
|
|
49
|
+
self.eql = self.eqls = (expected) => assert(same(actual, expected), 'to deeply equal ' + show(expected));
|
|
50
|
+
self.a = self.an = (type) => assert(typeName(actual) === String(type).toLowerCase(), 'to be a ' + type);
|
|
51
|
+
self.include = self.includes = self.contain = self.contains = (item) => assert(
|
|
52
|
+
typeof actual === 'string' ? actual.includes(String(item))
|
|
53
|
+
: Array.isArray(actual) ? actual.some((x) => (flags.deep ? same(x, item) : Object.is(x, item)))
|
|
54
|
+
: actual !== null && typeof actual === 'object' && item !== null && typeof item === 'object'
|
|
55
|
+
? Object.keys(item).every((k) => same(actual[k], item[k]))
|
|
56
|
+
: false,
|
|
57
|
+
'to include ' + show(item));
|
|
58
|
+
self.property = (name, ...value) => {
|
|
59
|
+
const has = actual !== null && actual !== undefined && typeof actual === 'object' && name in actual;
|
|
60
|
+
assert(has && (value.length === 0 || same(actual[name], value[0])), 'to have property ' + name + (value.length === 0 ? '' : ' of ' + show(value[0])));
|
|
61
|
+
return has && !flags.not ? chain(actual[name], {}) : self;
|
|
62
|
+
};
|
|
63
|
+
self.above = self.gt = self.greaterThan = (n) => assert(actual > n, 'to be above ' + n);
|
|
64
|
+
self.below = self.lt = self.lessThan = (n) => assert(actual < n, 'to be below ' + n);
|
|
65
|
+
self.least = self.gte = (n) => assert(actual >= n, 'to be at least ' + n);
|
|
66
|
+
self.most = self.lte = (n) => assert(actual <= n, 'to be at most ' + n);
|
|
67
|
+
self.within = (lo, hi) => assert(actual >= lo && actual <= hi, 'to be within ' + lo + '..' + hi);
|
|
68
|
+
self.lengthOf = (n) => assert(actual !== null && actual !== undefined && actual.length === n, 'to have length ' + n);
|
|
69
|
+
self.oneOf = (list) => assert(list.some((x) => same(x, actual)), 'to be one of ' + show(list));
|
|
70
|
+
self.match = self.matches = (re) => assert(re instanceof RegExp && re.test(String(actual)), 'to match ' + String(re));
|
|
71
|
+
self.string = (text) => assert(typeof actual === 'string' && actual.includes(text), 'to contain ' + show(text));
|
|
72
|
+
self.keys = self.key = (...names) => {
|
|
73
|
+
const list = names.length === 1 && Array.isArray(names[0]) ? names[0] : names;
|
|
74
|
+
return assert(actual !== null && typeof actual === 'object' && list.every((k) => k in actual), 'to have keys ' + show(list));
|
|
75
|
+
};
|
|
76
|
+
const getter = (name, test, message) => Object.defineProperty(self, name, { get: () => assert(test(), message) });
|
|
77
|
+
getter('true', () => actual === true, 'to be true');
|
|
78
|
+
getter('false', () => actual === false, 'to be false');
|
|
79
|
+
getter('ok', () => Boolean(actual), 'to be ok');
|
|
80
|
+
getter('null', () => actual === null, 'to be null');
|
|
81
|
+
getter('undefined', () => actual === undefined, 'to be undefined');
|
|
82
|
+
getter('exist', () => actual !== null && actual !== undefined, 'to exist');
|
|
83
|
+
getter('empty', () => (typeof actual === 'string' || Array.isArray(actual) ? actual.length === 0 : actual !== null && typeof actual === 'object' ? Object.keys(actual).length === 0 : false), 'to be empty');
|
|
84
|
+
getter('NaN', () => Number.isNaN(actual), 'to be NaN');
|
|
85
|
+
self.length = (n) => self.lengthOf(n);
|
|
86
|
+
return self;
|
|
87
|
+
};
|
|
88
|
+
const pmExpect = (actual) => chain(actual, { not: false, deep: false });
|
|
89
|
+
|
|
90
|
+
// --- pm.request / pm.response ------------------------------------------------------------------
|
|
91
|
+
const pairs = (list) => Object.freeze({
|
|
92
|
+
get: (name) => list.get(name),
|
|
93
|
+
has: (name, value) => (value === undefined ? list.has(name) : list.get(name) === String(value)),
|
|
94
|
+
toObject: () => list.toObject(),
|
|
95
|
+
all: () => list.list().map((h) => ({ key: h.name, value: h.value })),
|
|
96
|
+
each: (fn) => list.list().forEach((h) => fn({ key: h.name, value: h.value })),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const pmRequest = () => {
|
|
100
|
+
const writable = input.phase === 'pre';
|
|
101
|
+
const headers = {
|
|
102
|
+
...pairs(request.headers),
|
|
103
|
+
add: (header) => request.headers.add(String(header.key), String(header.value)),
|
|
104
|
+
upsert: (header) => request.headers.set(String(header.key), String(header.value)),
|
|
105
|
+
remove: (name) => request.headers.delete(typeof name === 'object' ? String(name.key) : String(name)),
|
|
106
|
+
};
|
|
107
|
+
const body = {};
|
|
108
|
+
if (request.body !== undefined && typeof request.body === 'object' && 'text' in request.body) {
|
|
109
|
+
Object.defineProperty(body, 'raw', {
|
|
110
|
+
get: () => (request.body.kind === 'other' ? undefined : request.body.text),
|
|
111
|
+
set: (text) => { request.body.text = String(text); },
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(body, 'mode', { get: () => (request.body.kind === 'text' ? 'raw' : request.body.kind) });
|
|
114
|
+
}
|
|
115
|
+
const url = {
|
|
116
|
+
toString: () => String(request.url),
|
|
117
|
+
getHost: () => /^[a-z]+:\/\/([^/?#:]+)/i.exec(String(request.url))?.[1] ?? '',
|
|
118
|
+
getPath: () => /^[a-z]+:\/\/[^/?#]*([^?#]*)/i.exec(String(request.url))?.[1] ?? '',
|
|
119
|
+
query: request.query === undefined ? undefined : {
|
|
120
|
+
get: (name) => request.query.get(name),
|
|
121
|
+
add: (q) => request.query.add(String(q.key), String(q.value)),
|
|
122
|
+
upsert: (q) => request.query.set(String(q.key), String(q.value)),
|
|
123
|
+
remove: (name) => request.query.delete(String(name)),
|
|
124
|
+
toObject: () => Object.fromEntries(request.query.list().map((q) => [q.name, q.value])),
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
get method() { return request.method; },
|
|
129
|
+
set method(value) { if (writable) request.method = String(value); },
|
|
130
|
+
url,
|
|
131
|
+
headers,
|
|
132
|
+
body,
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const pmResponse = () => {
|
|
137
|
+
if (input.phase !== 'post') return undefined;
|
|
138
|
+
const status = response.status;
|
|
139
|
+
const code = typeof status === 'number' ? status : status.code;
|
|
140
|
+
const text = response.text !== undefined ? response.text : response.message === undefined ? '' : JSON.stringify(response.message);
|
|
141
|
+
const res = {
|
|
142
|
+
code,
|
|
143
|
+
status: response.statusText !== undefined ? response.statusText : String(code),
|
|
144
|
+
headers: pairs(response.headers !== undefined ? response.headers : response.metadata),
|
|
145
|
+
responseTime: response.durationMs,
|
|
146
|
+
responseSize: text.length,
|
|
147
|
+
json: () => (response.json !== undefined ? response.json() : JSON.parse(text)),
|
|
148
|
+
text: () => text,
|
|
149
|
+
};
|
|
150
|
+
const has = {
|
|
151
|
+
status: (expected) => {
|
|
152
|
+
const passed = typeof expected === 'number' ? code === expected : res.status === String(expected);
|
|
153
|
+
if (!passed) throw new ExpectationFailed('expected response to have status ' + show(expected) + ' but got ' + code);
|
|
154
|
+
},
|
|
155
|
+
header: (name, value) => {
|
|
156
|
+
const actual = res.headers.get(name);
|
|
157
|
+
if (actual === undefined || (value !== undefined && actual !== String(value))) {
|
|
158
|
+
throw new ExpectationFailed('expected response to have header ' + name + (value === undefined ? '' : ' with value ' + show(value)));
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
body: (value) => {
|
|
162
|
+
if (value !== undefined && text !== String(value)) throw new ExpectationFailed('expected response body to be ' + show(value));
|
|
163
|
+
},
|
|
164
|
+
jsonBody: (path) => {
|
|
165
|
+
const body = res.json();
|
|
166
|
+
if (path !== undefined && !(String(path).split('.').reduce((o, k) => (o !== null && typeof o === 'object' && k in o ? o[k] : undefined), body) !== undefined)) {
|
|
167
|
+
throw new ExpectationFailed('expected response JSON to have ' + path);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
const be = {
|
|
172
|
+
get ok() { if (code < 200 || code > 299) throw new ExpectationFailed('expected a 2xx response but got ' + code); return undefined; },
|
|
173
|
+
get success() { return be.ok; },
|
|
174
|
+
get clientError() { if (code < 400 || code > 499) throw new ExpectationFailed('expected a 4xx response but got ' + code); return undefined; },
|
|
175
|
+
get serverError() { if (code < 500 || code > 599) throw new ExpectationFailed('expected a 5xx response but got ' + code); return undefined; },
|
|
176
|
+
get error() { if (code < 400) throw new ExpectationFailed('expected an error response but got ' + code); return undefined; },
|
|
177
|
+
get notFound() { if (code !== 404) throw new ExpectationFailed('expected 404 but got ' + code); return undefined; },
|
|
178
|
+
get json() { res.json(); return undefined; },
|
|
179
|
+
};
|
|
180
|
+
res.to = { have: has, be };
|
|
181
|
+
return res;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// --- CryptoJS: hashes, HMACs and the encoders, over crypto and encoding --------------------------
|
|
185
|
+
const Hex = { name: 'hex' };
|
|
186
|
+
const Base64 = {
|
|
187
|
+
name: 'base64',
|
|
188
|
+
stringify: (words) => words.toString(Base64),
|
|
189
|
+
parse: (text) => words({ utf8: encoding.fromBase64(String(text)) }),
|
|
190
|
+
};
|
|
191
|
+
const Utf8 = {
|
|
192
|
+
name: 'utf8',
|
|
193
|
+
stringify: (w) => w.toString(Utf8),
|
|
194
|
+
parse: (text) => words({ utf8: String(text) }),
|
|
195
|
+
};
|
|
196
|
+
const Latin1 = Utf8;
|
|
197
|
+
const words = (source) => ({
|
|
198
|
+
toString(encoder) {
|
|
199
|
+
const target = encoder === undefined ? Hex : encoder;
|
|
200
|
+
if (source.utf8 !== undefined) {
|
|
201
|
+
if (target === Base64) return encoding.base64(source.utf8);
|
|
202
|
+
if (target === Utf8) return source.utf8;
|
|
203
|
+
throw new ScriptUnsupported('CryptoJS: hex of a text word array');
|
|
204
|
+
}
|
|
205
|
+
if (target === Utf8) throw new ScriptUnsupported('CryptoJS: a hash as UTF-8 text');
|
|
206
|
+
return source.digest(target === Base64 ? 'base64' : 'hex');
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
const text = (value) => (value !== null && typeof value === 'object' && typeof value.toString === 'function' ? value.toString(Utf8) : String(value));
|
|
210
|
+
const hashOf = (algorithm) => (data) => words({ digest: (enc) => crypto.hash(algorithm, text(data), enc) });
|
|
211
|
+
const hmacOf = (algorithm) => (data, key) => words({ digest: (enc) => crypto.hmac(algorithm, text(key), text(data), enc) });
|
|
212
|
+
const CryptoJS = Object.freeze({
|
|
213
|
+
MD5: hashOf('md5'),
|
|
214
|
+
SHA1: hashOf('sha1'),
|
|
215
|
+
SHA256: hashOf('sha256'),
|
|
216
|
+
SHA512: hashOf('sha512'),
|
|
217
|
+
HmacSHA1: hmacOf('sha1'),
|
|
218
|
+
HmacSHA256: hmacOf('sha256'),
|
|
219
|
+
HmacSHA512: hmacOf('sha512'),
|
|
220
|
+
enc: Object.freeze({ Hex, Base64, Utf8, Latin1 }),
|
|
221
|
+
AES: Object.freeze({ encrypt: unsupported('CryptoJS.AES'), decrypt: unsupported('CryptoJS.AES') }),
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// --- pm, postman and the globals -----------------------------------------------------------------
|
|
225
|
+
const pmObject = {
|
|
226
|
+
test: (name, check) => test(name, () => check()),
|
|
227
|
+
expect: pmExpect,
|
|
228
|
+
environment: variables,
|
|
229
|
+
collectionVariables: variables,
|
|
230
|
+
globals: variables,
|
|
231
|
+
variables,
|
|
232
|
+
info: Object.freeze({
|
|
233
|
+
requestName: input.info.requestName,
|
|
234
|
+
eventName: input.phase === 'pre' ? 'prerequest' : 'test',
|
|
235
|
+
iteration: 0,
|
|
236
|
+
iterationCount: 1,
|
|
237
|
+
}),
|
|
238
|
+
request: pmRequest(),
|
|
239
|
+
sendRequest: unsupported('pm.sendRequest'),
|
|
240
|
+
cookies: Object.freeze({ get: () => undefined, has: () => false, toObject: () => ({}), jar: unsupported('pm.cookies.jar') }),
|
|
241
|
+
visualizer: Object.freeze({ set: unsupported('pm.visualizer') }),
|
|
242
|
+
execution: Object.freeze({ setNextRequest: unsupported('pm.execution.setNextRequest'), skipRequest: unsupported('pm.execution.skipRequest') }),
|
|
243
|
+
iterationData: Object.freeze({ get: unsupported('pm.iterationData') }),
|
|
244
|
+
vault: Object.freeze({ get: unsupported('pm.vault') }),
|
|
245
|
+
require: unsupported('pm.require'),
|
|
246
|
+
};
|
|
247
|
+
const pmResponseValue = pmResponse();
|
|
248
|
+
if (pmResponseValue !== undefined) pmObject.response = pmResponseValue;
|
|
249
|
+
define('pm', Object.freeze(pmObject));
|
|
250
|
+
define('postman', Object.freeze({
|
|
251
|
+
setNextRequest: unsupported('postman.setNextRequest'),
|
|
252
|
+
setEnvironmentVariable: (name, value) => variables.set(name, value),
|
|
253
|
+
getEnvironmentVariable: (name) => variables.get(name),
|
|
254
|
+
setGlobalVariable: (name, value) => variables.set(name, value),
|
|
255
|
+
getGlobalVariable: (name) => variables.get(name),
|
|
256
|
+
clearEnvironmentVariable: (name) => variables.unset(name),
|
|
257
|
+
}));
|
|
258
|
+
define('CryptoJS', CryptoJS);
|
|
259
|
+
define('btoa', (value) => encoding.base64(String(value)));
|
|
260
|
+
define('atob', (value) => encoding.fromBase64(String(value)));
|
|
261
|
+
define('require', unsupported('require'));
|
|
262
|
+
define('tests', {});
|
|
263
|
+
define('responseCode', pmResponseValue === undefined ? undefined : { code: pmResponseValue.code });
|
|
264
|
+
`;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The script API, as JavaScript that runs inside the sandbox before the script (spec §API).
|
|
3
|
+
*
|
|
4
|
+
* It is built over `__host` (plain functions of strings) and `__host.inputJson` (the request, the
|
|
5
|
+
* response and the run's values as JSON). It defines the globals a script uses and `__finish()`,
|
|
6
|
+
* which hands back the tests, the values and — for a pre-request script — the changed request. The
|
|
7
|
+
* host checks everything `__finish` returns (`../apply.ts`, `../run.ts`): a script can call
|
|
8
|
+
* `__finish` or `__host` itself, and gains nothing by it.
|
|
9
|
+
*
|
|
10
|
+
* Errors a rule raises carry a name the host maps to a code: `ScriptSecretDenied` →
|
|
11
|
+
* `script-secret-denied`, `ScriptValueInvalid` → `script-value-invalid`, `ScriptUnsupported` →
|
|
12
|
+
* `script-unsupported`.
|
|
13
|
+
*/
|
|
14
|
+
import type { ProtocolScripting } from '../../protocol/module.js';
|
|
15
|
+
import type { ScriptApi, ScriptPhase } from '../model.js';
|
|
16
|
+
/**
|
|
17
|
+
* The prelude for one script: the common API, the protocol's `request`/`response` from its
|
|
18
|
+
* scripting facet, any extra layer and `__finish`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildPrelude(scripting: ProtocolScripting, phase: ScriptPhase, api: ScriptApi, layer?: string): string;
|