@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,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Definition for an AsyncAPI-imported WebSocket API: a per-operation report of what a new
|
|
3
|
+
* version of the document changes, and applying it without losing anything the user made.
|
|
4
|
+
*
|
|
5
|
+
* The rule is the one gRPC and WSDL keep: **nothing is ever deleted.** A channel the document no
|
|
6
|
+
* longer has keeps its request, flagged `orphaned`; one that came back has the flag cleared. A value
|
|
7
|
+
* the mapping generated (URL, query, headers, subprotocols, a message sample, the API's URL and auth)
|
|
8
|
+
* follows the contract only while it still equals what the old contract generated; an edited one is
|
|
9
|
+
* kept, and for a message the new sample is added beside it as `<name> (updated)`.
|
|
10
|
+
*
|
|
11
|
+
* Pure: it compares through {@link mapAsyncApi}'s output and writes nothing.
|
|
12
|
+
*/
|
|
13
|
+
import { uniqueSlug } from '../project/paths.js';
|
|
14
|
+
import { createWsFolder, wsApiRequests, } from '../ws/model.js';
|
|
15
|
+
import { mapAsyncApi } from './map.js';
|
|
16
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
17
|
+
function opRef(op) {
|
|
18
|
+
return { key: op.key, channel: op.channel, direction: op.direction };
|
|
19
|
+
}
|
|
20
|
+
function channelServers(doc, channel) {
|
|
21
|
+
if (channel === undefined)
|
|
22
|
+
return [];
|
|
23
|
+
return channel.servers === 'all'
|
|
24
|
+
? [...doc.servers]
|
|
25
|
+
: doc.servers.filter((s) => channel.servers.includes(s.key));
|
|
26
|
+
}
|
|
27
|
+
function reasonsFor(old, next, a, b) {
|
|
28
|
+
const ca = old.channels.find((c) => c.key === a.channel);
|
|
29
|
+
const cb = next.channels.find((c) => c.key === b.channel);
|
|
30
|
+
const reasons = [];
|
|
31
|
+
if (!same(ca?.address, cb?.address) || !same(ca?.parameters, cb?.parameters)) {
|
|
32
|
+
reasons.push('address');
|
|
33
|
+
}
|
|
34
|
+
const keysA = a.messages.map((m) => m.key);
|
|
35
|
+
const keysB = b.messages.map((m) => m.key);
|
|
36
|
+
const payloadChanged = a.messages.some((m) => {
|
|
37
|
+
const n = b.messages.find((x) => x.key === m.key);
|
|
38
|
+
return n !== undefined && !same(m, n);
|
|
39
|
+
});
|
|
40
|
+
if (payloadChanged)
|
|
41
|
+
reasons.push('payload');
|
|
42
|
+
if (!same(ca?.bindings, cb?.bindings))
|
|
43
|
+
reasons.push('bindings');
|
|
44
|
+
const security = (doc, c) => channelServers(doc, c).map((s) => [s.key, s.security]);
|
|
45
|
+
if (!same(security(old, ca), security(next, cb)))
|
|
46
|
+
reasons.push('security');
|
|
47
|
+
if (a.direction !== b.direction || !same(keysA, keysB))
|
|
48
|
+
reasons.push('messages');
|
|
49
|
+
return reasons;
|
|
50
|
+
}
|
|
51
|
+
/** Operations added, removed and changed between two versions, keyed by operation id. */
|
|
52
|
+
export function planAsyncApiUpdate(old, next) {
|
|
53
|
+
const oldOps = new Map(old.operations.map((o) => [o.key, o]));
|
|
54
|
+
const nextOps = new Map(next.operations.map((o) => [o.key, o]));
|
|
55
|
+
// Requests are linked by channel, so an operation that moved to another channel key is, as applying
|
|
56
|
+
// sees it, removed from the old channel's request and added to the new one's — not an address change.
|
|
57
|
+
const sameChannel = (a, b) => a !== undefined && b !== undefined && a.channel === b.channel;
|
|
58
|
+
const added = next.operations.filter((o) => !sameChannel(oldOps.get(o.key), o)).map(opRef);
|
|
59
|
+
const removed = old.operations.filter((o) => !sameChannel(o, nextOps.get(o.key))).map(opRef);
|
|
60
|
+
const changed = [];
|
|
61
|
+
for (const b of next.operations) {
|
|
62
|
+
const a = oldOps.get(b.key);
|
|
63
|
+
if (a === undefined || !sameChannel(a, b))
|
|
64
|
+
continue;
|
|
65
|
+
const reasons = reasonsFor(old, next, a, b);
|
|
66
|
+
if (reasons.length > 0)
|
|
67
|
+
changed.push({ op: opRef(b), reasons });
|
|
68
|
+
}
|
|
69
|
+
return { added, removed, changed };
|
|
70
|
+
}
|
|
71
|
+
const GENERATED = ['url', 'query', 'headers', 'subprotocols'];
|
|
72
|
+
function byChannel(api) {
|
|
73
|
+
const map = new Map();
|
|
74
|
+
for (const r of wsApiRequests(api))
|
|
75
|
+
if (r.contract !== undefined)
|
|
76
|
+
map.set(r.contract.channel, r);
|
|
77
|
+
return map;
|
|
78
|
+
}
|
|
79
|
+
/** The folder a mapped request sits in (the mapping makes one level, by tag), or undefined at the root. */
|
|
80
|
+
function folderOf(api, id) {
|
|
81
|
+
return api.folders.find((f) => f.requests.some((r) => r.id === id))?.name;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Applies `next` to an API imported from `old`. Never deletes a request or a saved message.
|
|
85
|
+
*/
|
|
86
|
+
export function applyAsyncApiUpdate(api, old, next, options = {}) {
|
|
87
|
+
const mapOptions = options.server !== undefined ? { server: options.server } : {};
|
|
88
|
+
// The old mapping's ids are never kept: only its generated values are compared.
|
|
89
|
+
const oldMapped = mapAsyncApi(old, { ...mapOptions, newId: () => 'old' }).api;
|
|
90
|
+
const nextMapped = mapAsyncApi(next, {
|
|
91
|
+
...mapOptions,
|
|
92
|
+
...(options.newId !== undefined ? { newId: options.newId } : {}),
|
|
93
|
+
}).api;
|
|
94
|
+
const oldReqs = byChannel(oldMapped);
|
|
95
|
+
const nextReqs = byChannel(nextMapped);
|
|
96
|
+
const requestsOrphaned = [];
|
|
97
|
+
const requestsRestored = [];
|
|
98
|
+
const requestsRewritten = [];
|
|
99
|
+
const messagesReplaced = [];
|
|
100
|
+
const messagesAdded = [];
|
|
101
|
+
const update = (req) => {
|
|
102
|
+
const channel = req.contract?.channel;
|
|
103
|
+
if (channel === undefined)
|
|
104
|
+
return req;
|
|
105
|
+
const target = nextReqs.get(channel);
|
|
106
|
+
if (target === undefined) {
|
|
107
|
+
if (req.orphaned === true)
|
|
108
|
+
return req;
|
|
109
|
+
requestsOrphaned.push(req.id);
|
|
110
|
+
return { ...req, orphaned: true };
|
|
111
|
+
}
|
|
112
|
+
let out = req;
|
|
113
|
+
if (req.orphaned === true) {
|
|
114
|
+
requestsRestored.push(req.id);
|
|
115
|
+
const { orphaned, ...rest } = req;
|
|
116
|
+
void orphaned;
|
|
117
|
+
out = rest;
|
|
118
|
+
}
|
|
119
|
+
const before = oldReqs.get(channel);
|
|
120
|
+
let rewritten = false;
|
|
121
|
+
for (const field of GENERATED) {
|
|
122
|
+
if (before !== undefined && same(out[field], before[field]) && !same(out[field], target[field])) {
|
|
123
|
+
out = { ...out, [field]: target[field] };
|
|
124
|
+
rewritten = true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (rewritten)
|
|
128
|
+
requestsRewritten.push(req.id);
|
|
129
|
+
const messages = [...out.messages];
|
|
130
|
+
let touched = false;
|
|
131
|
+
const slugs = new Set(messages.map((m) => m.slug));
|
|
132
|
+
for (const sample of target.messages) {
|
|
133
|
+
const key = sample.contract.message;
|
|
134
|
+
const generated = sample.contract.generated;
|
|
135
|
+
const linked = messages.filter((m) => m.contract?.message === key);
|
|
136
|
+
if (linked.length === 0) {
|
|
137
|
+
const slug = uniqueSlug(sample.name, slugs);
|
|
138
|
+
slugs.add(slug);
|
|
139
|
+
messages.push({ ...sample, slug });
|
|
140
|
+
messagesAdded.push(sample.id);
|
|
141
|
+
touched = true;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (linked.some((m) => m.content === generated))
|
|
145
|
+
continue;
|
|
146
|
+
const untouched = linked.filter((m) => m.content === m.contract.generated);
|
|
147
|
+
if (untouched.length > 0) {
|
|
148
|
+
for (const m of untouched) {
|
|
149
|
+
messages[messages.indexOf(m)] = { ...m, content: generated, contract: { message: key, generated } };
|
|
150
|
+
messagesReplaced.push(m.id);
|
|
151
|
+
}
|
|
152
|
+
touched = true;
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const name = `${sample.name} (updated)`;
|
|
156
|
+
const slug = uniqueSlug(name, slugs);
|
|
157
|
+
slugs.add(slug);
|
|
158
|
+
messages.push({ ...sample, name, slug });
|
|
159
|
+
messagesAdded.push(sample.id);
|
|
160
|
+
touched = true;
|
|
161
|
+
}
|
|
162
|
+
return touched ? { ...out, messages } : out;
|
|
163
|
+
};
|
|
164
|
+
const updateFolder = (f) => ({
|
|
165
|
+
...f,
|
|
166
|
+
folders: f.folders.map(updateFolder),
|
|
167
|
+
requests: f.requests.map(update),
|
|
168
|
+
});
|
|
169
|
+
let result = { ...api, folders: api.folders.map(updateFolder), requests: api.requests.map(update) };
|
|
170
|
+
// Channels the API has no request for yet: into the folder their tag names, else the root.
|
|
171
|
+
const have = byChannel(result);
|
|
172
|
+
const requestsAdded = [];
|
|
173
|
+
const all = wsApiRequests(result);
|
|
174
|
+
let order = all.reduce((n, r) => Math.max(n, r.order + 1), 0);
|
|
175
|
+
for (const [channel, fresh] of nextReqs) {
|
|
176
|
+
if (have.has(channel))
|
|
177
|
+
continue;
|
|
178
|
+
const folderName = folderOf(nextMapped, fresh.id);
|
|
179
|
+
const siblings = folderName === undefined ? result.requests : (result.folders.find((f) => f.name === folderName)?.requests ?? []);
|
|
180
|
+
const slug = uniqueSlug(fresh.name, new Set(siblings.map((r) => r.slug)));
|
|
181
|
+
const req = { ...fresh, slug, order: order++ };
|
|
182
|
+
requestsAdded.push(req.id);
|
|
183
|
+
messagesAdded.push(...req.messages.map((m) => m.id));
|
|
184
|
+
if (folderName === undefined) {
|
|
185
|
+
result = { ...result, requests: [...result.requests, req] };
|
|
186
|
+
}
|
|
187
|
+
else if (result.folders.some((f) => f.name === folderName)) {
|
|
188
|
+
result = {
|
|
189
|
+
...result,
|
|
190
|
+
folders: result.folders.map((f) => (f.name === folderName ? { ...f, requests: [...f.requests, req] } : f)),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
const folderSlug = uniqueSlug(folderName, new Set(result.folders.map((f) => f.slug)));
|
|
195
|
+
const folder = createWsFolder(folderName, {
|
|
196
|
+
...(options.newId !== undefined ? { newId: options.newId } : {}),
|
|
197
|
+
slug: folderSlug,
|
|
198
|
+
order: result.folders.length,
|
|
199
|
+
requests: [req],
|
|
200
|
+
});
|
|
201
|
+
result = { ...result, folders: [...result.folders, folder] };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (same(result.url, oldMapped.url) && !same(result.url, nextMapped.url))
|
|
205
|
+
result = { ...result, url: nextMapped.url };
|
|
206
|
+
if (same(result.auth, oldMapped.auth) && !same(result.auth, nextMapped.auth)) {
|
|
207
|
+
const { auth, ...rest } = result;
|
|
208
|
+
void auth;
|
|
209
|
+
result = nextMapped.auth !== undefined ? { ...rest, auth: nextMapped.auth } : rest;
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
api: result,
|
|
213
|
+
requestsAdded,
|
|
214
|
+
requestsOrphaned,
|
|
215
|
+
requestsRestored,
|
|
216
|
+
requestsRewritten,
|
|
217
|
+
messagesReplaced,
|
|
218
|
+
messagesAdded,
|
|
219
|
+
};
|
|
220
|
+
}
|
package/dist/errors.d.ts
CHANGED
|
@@ -49,6 +49,14 @@ export declare class WorkspaceError extends WirebenchError {
|
|
|
49
49
|
export declare class OpenApiError extends WirebenchError {
|
|
50
50
|
constructor(code: string, message: string, options?: WirebenchErrorOptions);
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Thrown when an AsyncAPI document cannot be read at all: `asyncapi-malformed` (not JSON/YAML, or
|
|
54
|
+
* not a document with an `asyncapi` version) or `asyncapi-version-unsupported` (a version other
|
|
55
|
+
* than 2.x or 3.0). Anything parseable but unmappable is a note on the document, not this.
|
|
56
|
+
*/
|
|
57
|
+
export declare class AsyncApiError extends WirebenchError {
|
|
58
|
+
constructor(code: string, message: string, options?: WirebenchErrorOptions);
|
|
59
|
+
}
|
|
52
60
|
/** Thrown when a Postman collection cannot be read, or is structurally invalid. */
|
|
53
61
|
export declare class PostmanError extends WirebenchError {
|
|
54
62
|
constructor(code: string, message: string, options?: WirebenchErrorOptions);
|
|
@@ -73,5 +81,13 @@ export declare class WsError extends WirebenchError {
|
|
|
73
81
|
export declare class ValidationError extends WirebenchError {
|
|
74
82
|
constructor(code: string, message: string, options?: WirebenchErrorOptions);
|
|
75
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Thrown when a sequence step would put a value taken from a response somewhere ADR-0015 forbids:
|
|
86
|
+
* the origin of a URL or target (`sequence-origin-from-response`), or a line break or NUL into a
|
|
87
|
+
* URL, header or metadata (`sequence-value-invalid`).
|
|
88
|
+
*/
|
|
89
|
+
export declare class SequenceError extends WirebenchError {
|
|
90
|
+
constructor(code: string, message: string, options?: WirebenchErrorOptions);
|
|
91
|
+
}
|
|
76
92
|
/** Type guard identifying any {@link WirebenchError} (base class or subclass). */
|
|
77
93
|
export declare function isWirebenchError(e: unknown): e is WirebenchError;
|
package/dist/errors.js
CHANGED
|
@@ -73,6 +73,17 @@ export class OpenApiError extends WirebenchError {
|
|
|
73
73
|
this.name = 'OpenApiError';
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Thrown when an AsyncAPI document cannot be read at all: `asyncapi-malformed` (not JSON/YAML, or
|
|
78
|
+
* not a document with an `asyncapi` version) or `asyncapi-version-unsupported` (a version other
|
|
79
|
+
* than 2.x or 3.0). Anything parseable but unmappable is a note on the document, not this.
|
|
80
|
+
*/
|
|
81
|
+
export class AsyncApiError extends WirebenchError {
|
|
82
|
+
constructor(code, message, options) {
|
|
83
|
+
super(code, message, options);
|
|
84
|
+
this.name = 'AsyncApiError';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
76
87
|
/** Thrown when a Postman collection cannot be read, or is structurally invalid. */
|
|
77
88
|
export class PostmanError extends WirebenchError {
|
|
78
89
|
constructor(code, message, options) {
|
|
@@ -115,6 +126,17 @@ export class ValidationError extends WirebenchError {
|
|
|
115
126
|
this.name = 'ValidationError';
|
|
116
127
|
}
|
|
117
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Thrown when a sequence step would put a value taken from a response somewhere ADR-0015 forbids:
|
|
131
|
+
* the origin of a URL or target (`sequence-origin-from-response`), or a line break or NUL into a
|
|
132
|
+
* URL, header or metadata (`sequence-value-invalid`).
|
|
133
|
+
*/
|
|
134
|
+
export class SequenceError extends WirebenchError {
|
|
135
|
+
constructor(code, message, options) {
|
|
136
|
+
super(code, message, options);
|
|
137
|
+
this.name = 'SequenceError';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
118
140
|
/** Type guard identifying any {@link WirebenchError} (base class or subclass). */
|
|
119
141
|
export function isWirebenchError(e) {
|
|
120
142
|
return e instanceof WirebenchError;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a gRPC call reports while it runs (spec §3.2): the request side opening for pushes, the
|
|
3
|
+
* initial metadata, each response message decoded, and the request side half-closed.
|
|
4
|
+
*/
|
|
5
|
+
import type { GrpcResponseMessage } from './call.js';
|
|
6
|
+
export type GrpcLiveEvent = {
|
|
7
|
+
readonly protocol: 'grpc';
|
|
8
|
+
readonly kind: 'open';
|
|
9
|
+
} | {
|
|
10
|
+
readonly protocol: 'grpc';
|
|
11
|
+
readonly kind: 'headers';
|
|
12
|
+
readonly httpStatus: number;
|
|
13
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
14
|
+
} | {
|
|
15
|
+
readonly protocol: 'grpc';
|
|
16
|
+
readonly kind: 'message';
|
|
17
|
+
readonly index: number;
|
|
18
|
+
readonly message: GrpcResponseMessage;
|
|
19
|
+
} | {
|
|
20
|
+
readonly protocol: 'grpc';
|
|
21
|
+
readonly kind: 'closed';
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/grpc/expand.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* message alone, never to a header or the target.
|
|
7
7
|
*/
|
|
8
8
|
import type { PropertyScopes, UnresolvedRef } from '../project/properties.js';
|
|
9
|
-
import type { KeyValueEntry } from '../
|
|
9
|
+
import type { KeyValueEntry } from '../http/entries.js';
|
|
10
10
|
/** The parts of a call that carry text a property can appear in. */
|
|
11
11
|
export interface GrpcExpandable {
|
|
12
12
|
readonly target: string;
|
package/dist/grpc/expand.js
CHANGED
|
@@ -6,25 +6,35 @@
|
|
|
6
6
|
* message alone, never to a header or the target.
|
|
7
7
|
*/
|
|
8
8
|
import { expand } from '../project/properties.js';
|
|
9
|
-
import {
|
|
9
|
+
import { assertNoControlCharacters, assertOriginIndependent, expandWithSequenceEscaped, } from '../project/sequence-guards.js';
|
|
10
|
+
import { escapeForLanguage } from '../http/escape.js';
|
|
10
11
|
/** Expands every property reference in a call's target, metadata and message text. */
|
|
11
12
|
export function expandGrpcInput(input, scopes, options = {}) {
|
|
12
13
|
const unresolved = [];
|
|
13
|
-
const run = (text) => {
|
|
14
|
+
const run = (text, place) => {
|
|
14
15
|
const result = expand(text, scopes);
|
|
15
16
|
unresolved.push(...result.unresolved);
|
|
17
|
+
assertNoControlCharacters(place, result, scopes);
|
|
16
18
|
return result.text;
|
|
17
19
|
};
|
|
20
|
+
// The message is JSON. A Sequence value is JSON-escaped whether or not the request asks, because it
|
|
21
|
+
// came from a response and could otherwise add fields to the message (ADR-0015).
|
|
18
22
|
const runMessage = (text) => {
|
|
19
23
|
const result = expand(text, scopes);
|
|
20
24
|
unresolved.push(...result.unresolved);
|
|
21
|
-
return options.escape === true ? expand(text, escapedScopes(
|
|
25
|
+
return expandWithSequenceEscaped((s) => (options.escape === true ? expand(text, escapedScopes(s)) : expand(text, s)).text, scopes, (value) => escapeForLanguage(value, 'json'));
|
|
22
26
|
};
|
|
27
|
+
// A target is nothing but where the call goes, so no part of it may come from a response.
|
|
28
|
+
assertOriginIndependent('The target', (s) => expand(input.target, s).text, scopes, (target) => target);
|
|
23
29
|
return {
|
|
24
30
|
input: {
|
|
25
31
|
...input,
|
|
26
|
-
target: run(input.target),
|
|
27
|
-
metadata: input.metadata.map((row) => ({
|
|
32
|
+
target: run(input.target, 'The target'),
|
|
33
|
+
metadata: input.metadata.map((row) => ({
|
|
34
|
+
...row,
|
|
35
|
+
name: run(row.name, 'A metadata key'),
|
|
36
|
+
value: run(row.value, `The ${row.name} metadata`),
|
|
37
|
+
})),
|
|
28
38
|
messageText: runMessage(input.messageText),
|
|
29
39
|
},
|
|
30
40
|
unresolved,
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gRPC files of a project folder: `apis/<slug>/api.yaml` with `kind: grpc`, and each
|
|
3
|
+
* `*.request.yaml` of its request tree (spec §3.2).
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/** The four shapes a gRPC method can take. */
|
|
7
|
+
export declare const grpcMethodKindSchema: z.ZodEnum<{
|
|
8
|
+
unary: "unary";
|
|
9
|
+
"server-streaming": "server-streaming";
|
|
10
|
+
"client-streaming": "client-streaming";
|
|
11
|
+
"bidi-streaming": "bidi-streaming";
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* `apis/<slug>/requests/[<folder>/…]<name>.request.yaml` for a gRPC request. The message text lives
|
|
15
|
+
* in the sibling file `message` names, validated as a path segment before it is read (ADR-0005),
|
|
16
|
+
* so a JSON message is a JSON file in git like a REST raw body.
|
|
17
|
+
*/
|
|
18
|
+
export declare const grpcRequestFileSchema: z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"grpc">;
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
order: z.ZodNumber;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
service: z.ZodString;
|
|
25
|
+
method: z.ZodString;
|
|
26
|
+
methodKind: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
unary: "unary";
|
|
28
|
+
"server-streaming": "server-streaming";
|
|
29
|
+
"client-streaming": "client-streaming";
|
|
30
|
+
"bidi-streaming": "bidi-streaming";
|
|
31
|
+
}>>;
|
|
32
|
+
metadata: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
value: z.ZodString;
|
|
35
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
+
description: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$loose>>>;
|
|
38
|
+
message: z.ZodOptional<z.ZodString>;
|
|
39
|
+
auth: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
40
|
+
type: z.ZodEnum<{
|
|
41
|
+
none: "none";
|
|
42
|
+
basic: "basic";
|
|
43
|
+
ntlm: "ntlm";
|
|
44
|
+
}>;
|
|
45
|
+
username: z.ZodOptional<z.ZodString>;
|
|
46
|
+
passwordRef: z.ZodOptional<z.ZodString>;
|
|
47
|
+
passwordEnv: z.ZodOptional<z.ZodString>;
|
|
48
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
49
|
+
workstation: z.ZodOptional<z.ZodString>;
|
|
50
|
+
preemptive: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"inherit">;
|
|
53
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"bearer">;
|
|
55
|
+
tokenRef: z.ZodOptional<z.ZodString>;
|
|
56
|
+
tokenEnv: z.ZodOptional<z.ZodString>;
|
|
57
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"api-key">;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
valueRef: z.ZodOptional<z.ZodString>;
|
|
62
|
+
valueEnv: z.ZodOptional<z.ZodString>;
|
|
63
|
+
in: z.ZodEnum<{
|
|
64
|
+
header: "header";
|
|
65
|
+
query: "query";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"oauth2">;
|
|
69
|
+
grant: z.ZodEnum<{
|
|
70
|
+
"client-credentials": "client-credentials";
|
|
71
|
+
"authorization-code": "authorization-code";
|
|
72
|
+
}>;
|
|
73
|
+
tokenUrl: z.ZodString;
|
|
74
|
+
authorizationUrl: z.ZodOptional<z.ZodString>;
|
|
75
|
+
clientId: z.ZodString;
|
|
76
|
+
clientSecretRef: z.ZodOptional<z.ZodString>;
|
|
77
|
+
clientSecretEnv: z.ZodOptional<z.ZodString>;
|
|
78
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
79
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
80
|
+
clientAuth: z.ZodDefault<z.ZodEnum<{
|
|
81
|
+
basic: "basic";
|
|
82
|
+
body: "body";
|
|
83
|
+
}>>;
|
|
84
|
+
pkce: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
+
refreshTokenRef: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$loose>]>>;
|
|
87
|
+
settings: z.ZodDefault<z.ZodObject<{
|
|
88
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
trustInvalid: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
sslKeystoreRef: z.ZodOptional<z.ZodString>;
|
|
91
|
+
bindAddress: z.ZodOptional<z.ZodString>;
|
|
92
|
+
maxSizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
escapeProperties: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
}, z.core.$loose>>;
|
|
95
|
+
orphaned: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
assertions: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"status">;
|
|
98
|
+
equals: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodNumber, z.ZodString, z.ZodEnum<{
|
|
99
|
+
[x: string]: string;
|
|
100
|
+
}>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodNumber, z.ZodString, z.ZodEnum<{
|
|
101
|
+
[x: string]: string;
|
|
102
|
+
}>]>>]>;
|
|
103
|
+
name: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
105
|
+
type: z.ZodLiteral<"soap-fault">;
|
|
106
|
+
expect: z.ZodDefault<z.ZodEnum<{
|
|
107
|
+
none: "none";
|
|
108
|
+
present: "present";
|
|
109
|
+
}>>;
|
|
110
|
+
name: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
112
|
+
type: z.ZodLiteral<"match">;
|
|
113
|
+
language: z.ZodEnum<{
|
|
114
|
+
xpath: "xpath";
|
|
115
|
+
xquery: "xquery";
|
|
116
|
+
jsonpath: "jsonpath";
|
|
117
|
+
}>;
|
|
118
|
+
expression: z.ZodString;
|
|
119
|
+
namespaces: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
120
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
121
|
+
matches: z.ZodOptional<z.ZodString>;
|
|
122
|
+
exists: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
name: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
125
|
+
type: z.ZodLiteral<"schema">;
|
|
126
|
+
name: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"sla">;
|
|
129
|
+
maxMs: z.ZodNumber;
|
|
130
|
+
name: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"callback">;
|
|
133
|
+
catchUrl: z.ZodString;
|
|
134
|
+
withinMs: z.ZodDefault<z.ZodNumber>;
|
|
135
|
+
match: z.ZodDefault<z.ZodObject<{
|
|
136
|
+
method: z.ZodOptional<z.ZodString>;
|
|
137
|
+
path: z.ZodOptional<z.ZodString>;
|
|
138
|
+
pathMatches: z.ZodOptional<z.ZodString>;
|
|
139
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
140
|
+
equals: z.ZodOptional<z.ZodString>;
|
|
141
|
+
matches: z.ZodOptional<z.ZodString>;
|
|
142
|
+
exists: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
name: z.ZodString;
|
|
144
|
+
}, z.core.$loose>>>;
|
|
145
|
+
body: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
equals: z.ZodOptional<z.ZodString>;
|
|
147
|
+
matches: z.ZodOptional<z.ZodString>;
|
|
148
|
+
exists: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
language: z.ZodEnum<{
|
|
150
|
+
xpath: "xpath";
|
|
151
|
+
jsonpath: "jsonpath";
|
|
152
|
+
}>;
|
|
153
|
+
path: z.ZodString;
|
|
154
|
+
}, z.core.$loose>>;
|
|
155
|
+
}, z.core.$loose>>;
|
|
156
|
+
expect: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
157
|
+
body: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
equals: z.ZodOptional<z.ZodString>;
|
|
159
|
+
matches: z.ZodOptional<z.ZodString>;
|
|
160
|
+
exists: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
+
language: z.ZodEnum<{
|
|
162
|
+
xpath: "xpath";
|
|
163
|
+
jsonpath: "jsonpath";
|
|
164
|
+
}>;
|
|
165
|
+
path: z.ZodString;
|
|
166
|
+
}, z.core.$loose>>;
|
|
167
|
+
header: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
equals: z.ZodOptional<z.ZodString>;
|
|
169
|
+
matches: z.ZodOptional<z.ZodString>;
|
|
170
|
+
exists: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
name: z.ZodString;
|
|
172
|
+
}, z.core.$loose>>;
|
|
173
|
+
signature: z.ZodOptional<z.ZodLiteral<"verified">>;
|
|
174
|
+
}, z.core.$loose>>>;
|
|
175
|
+
name: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$loose>], "type">>>;
|
|
177
|
+
scripts: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
pre: z.ZodOptional<z.ZodString>;
|
|
179
|
+
post: z.ZodOptional<z.ZodString>;
|
|
180
|
+
api: z.ZodDefault<z.ZodEnum<{
|
|
181
|
+
wirebench: "wirebench";
|
|
182
|
+
postman: "postman";
|
|
183
|
+
}>>;
|
|
184
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
185
|
+
secrets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
186
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
}, z.core.$loose>>;
|
|
188
|
+
}, z.core.$loose>;
|
|
189
|
+
/** `apis/<slug>/api.yaml` for a gRPC API. */
|
|
190
|
+
export declare const grpcApiFileSchema: z.ZodObject<{
|
|
191
|
+
kind: z.ZodLiteral<"grpc">;
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
name: z.ZodString;
|
|
194
|
+
order: z.ZodNumber;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
target: z.ZodString;
|
|
197
|
+
tls: z.ZodDefault<z.ZodBoolean>;
|
|
198
|
+
metadata: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
value: z.ZodString;
|
|
201
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
202
|
+
description: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$loose>>>;
|
|
204
|
+
auth: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
205
|
+
type: z.ZodEnum<{
|
|
206
|
+
none: "none";
|
|
207
|
+
basic: "basic";
|
|
208
|
+
ntlm: "ntlm";
|
|
209
|
+
}>;
|
|
210
|
+
username: z.ZodOptional<z.ZodString>;
|
|
211
|
+
passwordRef: z.ZodOptional<z.ZodString>;
|
|
212
|
+
passwordEnv: z.ZodOptional<z.ZodString>;
|
|
213
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
214
|
+
workstation: z.ZodOptional<z.ZodString>;
|
|
215
|
+
preemptive: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
217
|
+
type: z.ZodLiteral<"inherit">;
|
|
218
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
219
|
+
type: z.ZodLiteral<"bearer">;
|
|
220
|
+
tokenRef: z.ZodOptional<z.ZodString>;
|
|
221
|
+
tokenEnv: z.ZodOptional<z.ZodString>;
|
|
222
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
224
|
+
type: z.ZodLiteral<"api-key">;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
valueRef: z.ZodOptional<z.ZodString>;
|
|
227
|
+
valueEnv: z.ZodOptional<z.ZodString>;
|
|
228
|
+
in: z.ZodEnum<{
|
|
229
|
+
header: "header";
|
|
230
|
+
query: "query";
|
|
231
|
+
}>;
|
|
232
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"oauth2">;
|
|
234
|
+
grant: z.ZodEnum<{
|
|
235
|
+
"client-credentials": "client-credentials";
|
|
236
|
+
"authorization-code": "authorization-code";
|
|
237
|
+
}>;
|
|
238
|
+
tokenUrl: z.ZodString;
|
|
239
|
+
authorizationUrl: z.ZodOptional<z.ZodString>;
|
|
240
|
+
clientId: z.ZodString;
|
|
241
|
+
clientSecretRef: z.ZodOptional<z.ZodString>;
|
|
242
|
+
clientSecretEnv: z.ZodOptional<z.ZodString>;
|
|
243
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
244
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
245
|
+
clientAuth: z.ZodDefault<z.ZodEnum<{
|
|
246
|
+
basic: "basic";
|
|
247
|
+
body: "body";
|
|
248
|
+
}>>;
|
|
249
|
+
pkce: z.ZodDefault<z.ZodBoolean>;
|
|
250
|
+
refreshTokenRef: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, z.core.$loose>]>>;
|
|
252
|
+
definition: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
254
|
+
proto: "proto";
|
|
255
|
+
reflection: "reflection";
|
|
256
|
+
}>>;
|
|
257
|
+
source: z.ZodString;
|
|
258
|
+
cache: z.ZodDefault<z.ZodBoolean>;
|
|
259
|
+
roots: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
260
|
+
reflectionVersion: z.ZodOptional<z.ZodEnum<{
|
|
261
|
+
v1: "v1";
|
|
262
|
+
v1alpha: "v1alpha";
|
|
263
|
+
auto: "auto";
|
|
264
|
+
}>>;
|
|
265
|
+
trustInvalid: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
}, z.core.$loose>>;
|
|
267
|
+
}, z.core.$loose>;
|
|
268
|
+
/** A gRPC `api.yaml` as parsed. */
|
|
269
|
+
export type GrpcApiFile = z.infer<typeof grpcApiFileSchema>;
|
|
270
|
+
/** A gRPC `*.request.yaml` as parsed. */
|
|
271
|
+
export type GrpcRequestFile = z.infer<typeof grpcRequestFileSchema>;
|