@wirebench/engine 2.2.1 → 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
package/dist/wss/apply.js
CHANGED
|
@@ -12,7 +12,7 @@ import { buildTimestamp } from './outgoing/timestamp.js';
|
|
|
12
12
|
import { buildUsernameToken } from './outgoing/username-token.js';
|
|
13
13
|
import { signEnvelope } from './outgoing/signature.js';
|
|
14
14
|
import { encryptEnvelope } from './outgoing/encryption.js';
|
|
15
|
-
import { selectAlias } from '
|
|
15
|
+
import { selectAlias } from '../keystore/index.js';
|
|
16
16
|
import { actorAttribute, childElement, mustUnderstandValue, securityHeaders, securityActor, } from './security-header.js';
|
|
17
17
|
/** The namespace `xmlns:*` declarations themselves live in. */
|
|
18
18
|
const XMLNS = 'http://www.w3.org/2000/xmlns/';
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* survives) and the typed configurations the WS-Security code takes — the same shape as
|
|
5
5
|
* `project/keystores.ts` does for the keystore registry.
|
|
6
6
|
*/
|
|
7
|
-
import type { WssRef } from '
|
|
8
|
-
import type { WssIncomingConfig, WssOutgoingConfig } from '
|
|
7
|
+
import type { WssRef } from '../project/model.js';
|
|
8
|
+
import type { WssIncomingConfig, WssOutgoingConfig } from './model.js';
|
|
9
9
|
/**
|
|
10
10
|
* Reads one outgoing configuration out of its `WssRef`.
|
|
11
11
|
*
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* `project/keystores.ts` does for the keystore registry.
|
|
6
6
|
*/
|
|
7
7
|
import { ProjectError } from '../errors.js';
|
|
8
|
-
import { wssEntrySchema, wssIncomingFileSchema, wssOutgoingFileSchema } from '
|
|
9
|
-
import { DEFAULT_WSS_TIMESTAMP_SKEW_SECONDS } from '
|
|
8
|
+
import { wssEntrySchema, wssIncomingFileSchema, wssOutgoingFileSchema } from '../project/schema.js';
|
|
9
|
+
import { DEFAULT_WSS_TIMESTAMP_SKEW_SECONDS } from './model.js';
|
|
10
10
|
/**
|
|
11
11
|
* One stored entry as a typed {@link WssEntry}. An entry this build does not understand (a
|
|
12
12
|
* signature written by a later build, say) is carried through verbatim rather than dropped;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* that was not encrypted — so the caller gets the document back unchanged rather than a
|
|
8
8
|
* `wss-decrypt-failed` it would have to special-case.
|
|
9
9
|
*/
|
|
10
|
-
import type { Keystore, KeystoreAlias } from '
|
|
10
|
+
import type { Keystore, KeystoreAlias } from '../../keystore/model.js';
|
|
11
11
|
/** The keystore material {@link decryptIncoming} opens an `xenc:EncryptedKey` with. */
|
|
12
12
|
export interface ResolvedDecryptionKey {
|
|
13
13
|
readonly keystore: Keystore;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the server sent, not to hide it. The caller decides what to make of that.
|
|
9
9
|
*/
|
|
10
10
|
import { isWirebenchError } from '../../errors.js';
|
|
11
|
-
import { selectAlias } from '
|
|
11
|
+
import { selectAlias } from '../../keystore/index.js';
|
|
12
12
|
import { decryptIncoming } from './decrypt.js';
|
|
13
13
|
import { verifyIncoming } from './verify.js';
|
|
14
14
|
/** The message of a thrown value, without the stack or any `details` a secret could hide in. */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* `KeyInfo` is therefore a *hint* about which key to look up, never a source of trust.
|
|
17
17
|
*/
|
|
18
|
-
import type { Keystore } from '
|
|
18
|
+
import type { Keystore } from '../../keystore/model.js';
|
|
19
19
|
/** One `ds:Signature` as {@link verifyIncoming} judged it. */
|
|
20
20
|
export interface IncomingSignatureResult {
|
|
21
21
|
/** The signature held over the bytes that arrived. */
|
|
@@ -19,7 +19,7 @@ import forge from 'node-forge';
|
|
|
19
19
|
import { NS } from '../../xml/namespaces.js';
|
|
20
20
|
import { parseXml } from '../../xml/parse.js';
|
|
21
21
|
import { serializeXml } from '../../xml/serialize.js';
|
|
22
|
-
import { renderDn, renderDnRfc2253 } from '
|
|
22
|
+
import { renderDn, renderDnRfc2253 } from '../../keystore/certificate.js';
|
|
23
23
|
import { certificateBase64, subjectKeyIdentifierBase64, thumbprintSha1Base64, WSS_TOKEN_TYPES, } from '../key-identifiers.js';
|
|
24
24
|
import { childElement, findElement } from '../security-header.js';
|
|
25
25
|
import { verifySignature } from '../outgoing/signature.js';
|
|
@@ -11,7 +11,7 @@ import { createHash } from 'node:crypto';
|
|
|
11
11
|
import forge from 'node-forge';
|
|
12
12
|
import { WssError } from '../errors.js';
|
|
13
13
|
import { NS } from '../xml/namespaces.js';
|
|
14
|
-
import { renderDnRfc2253 } from '
|
|
14
|
+
import { renderDnRfc2253 } from '../keystore/certificate.js';
|
|
15
15
|
/** `ValueType`/`EncodingType` URIs from the WS-Security X.509 token profile. */
|
|
16
16
|
export const WSS_TOKEN_TYPES = {
|
|
17
17
|
/** A single DER-encoded certificate. */
|
package/dist/wss/model.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* every builder takes (so nothing here reads a keystore, a secret, the clock or the entropy
|
|
5
5
|
* pool on its own — the host supplies all four, and tests supply deterministic ones).
|
|
6
6
|
*/
|
|
7
|
-
import type { Keystore } from '
|
|
7
|
+
import type { Keystore } from '../keystore/model.js';
|
|
8
8
|
/** How a `wsse:UsernameToken` carries (or does not carry) its password. */
|
|
9
9
|
export type WssPasswordType = 'text' | 'digest' | 'none';
|
|
10
10
|
/** A `wsu:Timestamp` header element. */
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* *signature* entry earlier in the same configuration may already have swapped the document.
|
|
21
21
|
*/
|
|
22
22
|
import type { Document } from '@xmldom/xmldom';
|
|
23
|
-
import type { Keystore, KeystoreAlias } from '
|
|
23
|
+
import type { Keystore, KeystoreAlias } from '../../keystore/model.js';
|
|
24
24
|
import type { WssContext, WssEncryptionEntry } from '../model.js';
|
|
25
25
|
/** The keystore material {@link encryptEnvelope} encrypts *to*; only the certificate is used. */
|
|
26
26
|
export interface ResolvedEncryptionKey {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* after each signature entry for exactly that reason.
|
|
10
10
|
*/
|
|
11
11
|
import type { Document } from '@xmldom/xmldom';
|
|
12
|
-
import type { Keystore, KeystoreAlias } from '
|
|
12
|
+
import type { Keystore, KeystoreAlias } from '../../keystore/model.js';
|
|
13
13
|
import type { WssContext, WssSignatureEntry } from '../model.js';
|
|
14
14
|
/** The keystore material {@link signEnvelope} signs with, resolved by the caller. */
|
|
15
15
|
export interface ResolvedSigningKey {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the bytes of an XML document as text.
|
|
3
|
+
*
|
|
4
|
+
* In `xml/` because every definition fetcher decodes what it fetched, whatever the protocol, and
|
|
5
|
+
* core imports no protocol folder (protocol modules spec §7.2).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Decodes bytes as UTF-8, honouring an `<?xml ... encoding="iso-8859-1" ?>`
|
|
9
|
+
* declaration when present (single-byte, so it is safely sniffable by
|
|
10
|
+
* decoding the head as UTF-8 first). A `utf-16` declaration would require a
|
|
11
|
+
* BOM/byte-order sniff before the declaration itself is even legible, which
|
|
12
|
+
* does not fit a small helper like this — such documents fall back to (and
|
|
13
|
+
* garble under) UTF-8; use a pre-fetched `text` in that case instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare function decodeXmlBytes(bytes: Uint8Array): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the bytes of an XML document as text.
|
|
3
|
+
*
|
|
4
|
+
* In `xml/` because every definition fetcher decodes what it fetched, whatever the protocol, and
|
|
5
|
+
* core imports no protocol folder (protocol modules spec §7.2).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Decodes bytes as UTF-8, honouring an `<?xml ... encoding="iso-8859-1" ?>`
|
|
9
|
+
* declaration when present (single-byte, so it is safely sniffable by
|
|
10
|
+
* decoding the head as UTF-8 first). A `utf-16` declaration would require a
|
|
11
|
+
* BOM/byte-order sniff before the declaration itself is even legible, which
|
|
12
|
+
* does not fit a small helper like this — such documents fall back to (and
|
|
13
|
+
* garble under) UTF-8; use a pre-fetched `text` in that case instead.
|
|
14
|
+
*/
|
|
15
|
+
export function decodeXmlBytes(bytes) {
|
|
16
|
+
const head = new TextDecoder('utf-8').decode(bytes.subarray(0, 200));
|
|
17
|
+
const match = /^\s*<\?xml[^>]*\bencoding=["']([^"']+)["']/i.exec(head);
|
|
18
|
+
if (match?.[1]?.toLowerCase() === 'iso-8859-1') {
|
|
19
|
+
return new TextDecoder('iso-8859-1').decode(bytes);
|
|
20
|
+
}
|
|
21
|
+
return new TextDecoder('utf-8').decode(bytes);
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escaping a value that lands inside XML text.
|
|
3
|
+
*
|
|
4
|
+
* In `xml/` because property expansion (`project/properties.ts`) applies it for every protocol,
|
|
5
|
+
* and core imports no protocol folder (protocol modules spec §7.2). `soap/transforms.ts` re-exports
|
|
6
|
+
* it beside the envelope transforms it has always sat with.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* "Entitize Properties", applied to one substituted property value: escapes the three
|
|
10
|
+
* characters that would otherwise be read as markup once the value lands inside an envelope.
|
|
11
|
+
*
|
|
12
|
+
* `"` and `'` are deliberately left alone: expansion targets element content far more often
|
|
13
|
+
* than an attribute value, and escaping quotes there would show up as `"` in the payload.
|
|
14
|
+
*
|
|
15
|
+
* @param value the expanded property value
|
|
16
|
+
*/
|
|
17
|
+
export declare function entitizeValue(value: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escaping a value that lands inside XML text.
|
|
3
|
+
*
|
|
4
|
+
* In `xml/` because property expansion (`project/properties.ts`) applies it for every protocol,
|
|
5
|
+
* and core imports no protocol folder (protocol modules spec §7.2). `soap/transforms.ts` re-exports
|
|
6
|
+
* it beside the envelope transforms it has always sat with.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* "Entitize Properties", applied to one substituted property value: escapes the three
|
|
10
|
+
* characters that would otherwise be read as markup once the value lands inside an envelope.
|
|
11
|
+
*
|
|
12
|
+
* `"` and `'` are deliberately left alone: expansion targets element content far more often
|
|
13
|
+
* than an attribute value, and escaping quotes there would show up as `"` in the payload.
|
|
14
|
+
*
|
|
15
|
+
* @param value the expanded property value
|
|
16
|
+
*/
|
|
17
|
+
export function entitizeValue(value) {
|
|
18
|
+
return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
19
|
+
}
|
package/dist/xml/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* into the Electron renderer.
|
|
5
5
|
*/
|
|
6
6
|
export { formatXml, type FormatXmlOptions, type FormatXmlResult } from './pretty.js';
|
|
7
|
-
export { elementPathAt, completionContextAt, type CompletionContext, type TextRange } from '
|
|
7
|
+
export { elementPathAt, completionContextAt, type CompletionContext, type TextRange } from './locate.js';
|
package/dist/xml/index.js
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a cursor is in an XML text: the element path at an offset, and what a completion would
|
|
3
|
+
* replace. Pure text, no DOM and no schema, so it is safe in the browser subpath (`xml/index.ts`).
|
|
4
|
+
*
|
|
5
|
+
* In `xml/` because core's XML and XPath helpers use it and core imports no protocol folder
|
|
6
|
+
* (protocol modules spec §7.2). `xsd/locate.ts` keeps the half that reads a schema set, and
|
|
7
|
+
* re-exports these names.
|
|
8
|
+
*/
|
|
9
|
+
import type { QName } from './qname.js';
|
|
10
|
+
/** A half-open character range in a text document. */
|
|
11
|
+
export interface TextRange {
|
|
12
|
+
readonly start: number;
|
|
13
|
+
readonly end: number;
|
|
14
|
+
}
|
|
15
|
+
/** What the completion provider needs to offer children of the element the cursor is in. */
|
|
16
|
+
export interface CompletionContext {
|
|
17
|
+
/** Ancestor chain of the element that would contain the completed child, outermost first. */
|
|
18
|
+
readonly path: readonly QName[];
|
|
19
|
+
/** The (possibly empty) element name typed so far after `<`, including any prefix. */
|
|
20
|
+
readonly partial: string;
|
|
21
|
+
/** Namespace prefixes in scope at the cursor. */
|
|
22
|
+
readonly prefixes: Readonly<Record<string, string>>;
|
|
23
|
+
/** The range of `partial` in the document, to replace with the accepted completion. */
|
|
24
|
+
readonly replaceRange: TextRange;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Ancestor chain (outermost first) of the element containing `offset`,
|
|
28
|
+
* resolved to expanded QNames via the `xmlns` declarations in scope at that
|
|
29
|
+
* point in the text.
|
|
30
|
+
*/
|
|
31
|
+
export declare function elementPathAt(text: string, offset: number): QName[];
|
|
32
|
+
/**
|
|
33
|
+
* Pure text analysis for the completion provider: detects an in-progress
|
|
34
|
+
* `<partial` element-name token ending at `offset` and reports the ancestor
|
|
35
|
+
* path, in-scope prefixes and the range to replace with the accepted item.
|
|
36
|
+
* Returns `undefined` when the cursor is not positioned right after an open
|
|
37
|
+
* `<` (e.g. mid-attribute, or not inside a tag at all).
|
|
38
|
+
*/
|
|
39
|
+
export declare function completionContextAt(text: string, offset: number): CompletionContext | undefined;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a cursor is in an XML text: the element path at an offset, and what a completion would
|
|
3
|
+
* replace. Pure text, no DOM and no schema, so it is safe in the browser subpath (`xml/index.ts`).
|
|
4
|
+
*
|
|
5
|
+
* In `xml/` because core's XML and XPath helpers use it and core imports no protocol folder
|
|
6
|
+
* (protocol modules spec §7.2). `xsd/locate.ts` keeps the half that reads a schema set, and
|
|
7
|
+
* re-exports these names.
|
|
8
|
+
*/
|
|
9
|
+
const OPEN_TAG_RE = /<([^\s/!?>][^\s/>]*)((?:\s+[^<>]*)?)\s*(\/?)>/g;
|
|
10
|
+
const ATTR_RE = /([:\w.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
11
|
+
const XML_PREFIX = 'xml';
|
|
12
|
+
const XML_NS = 'http://www.w3.org/XML/1998/namespace';
|
|
13
|
+
/** Extracts `xmlns`/`xmlns:prefix` declarations from a tag's raw attribute text. */
|
|
14
|
+
function xmlnsDeclarations(rawAttrs) {
|
|
15
|
+
const decls = {};
|
|
16
|
+
const re = new RegExp(ATTR_RE);
|
|
17
|
+
let m;
|
|
18
|
+
while ((m = re.exec(rawAttrs)) !== null) {
|
|
19
|
+
const attrName = m[1];
|
|
20
|
+
const value = m[2] ?? m[3] ?? '';
|
|
21
|
+
if (attrName === 'xmlns') {
|
|
22
|
+
decls[''] = value;
|
|
23
|
+
}
|
|
24
|
+
else if (attrName.startsWith('xmlns:')) {
|
|
25
|
+
decls[attrName.slice('xmlns:'.length)] = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return decls;
|
|
29
|
+
}
|
|
30
|
+
function resolvePrefixed(name, prefixes) {
|
|
31
|
+
const colon = name.indexOf(':');
|
|
32
|
+
if (colon === -1) {
|
|
33
|
+
return { namespaceUri: prefixes[''] ?? '', localName: name };
|
|
34
|
+
}
|
|
35
|
+
const prefix = name.slice(0, colon);
|
|
36
|
+
const localName = name.slice(colon + 1);
|
|
37
|
+
if (prefix === XML_PREFIX) {
|
|
38
|
+
return { namespaceUri: XML_NS, localName };
|
|
39
|
+
}
|
|
40
|
+
return { namespaceUri: prefixes[prefix] ?? '', localName };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Walks open/close tags textually (never a DOM parse) to find the in-scope
|
|
44
|
+
* ancestor stack ending just before `offset`. Tolerant of an unfinished tag
|
|
45
|
+
* at the cursor: a `<…` with no closing `>` yet in the text simply does not
|
|
46
|
+
* match and is ignored.
|
|
47
|
+
*/
|
|
48
|
+
function scopeStackAt(text, offset) {
|
|
49
|
+
const stack = [];
|
|
50
|
+
const re = new RegExp(OPEN_TAG_RE);
|
|
51
|
+
let m;
|
|
52
|
+
while ((m = re.exec(text)) !== null) {
|
|
53
|
+
const matchEnd = m.index + m[0].length;
|
|
54
|
+
if (matchEnd > offset) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
const raw = m[0];
|
|
58
|
+
if (raw.startsWith('</')) {
|
|
59
|
+
// Tolerant of stray/mismatched close tags: just pop, since the source text
|
|
60
|
+
// up to the cursor is assumed well-formed for the purpose of this walk.
|
|
61
|
+
if (stack.length > 0) {
|
|
62
|
+
stack.pop();
|
|
63
|
+
}
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const name = m[1].replace(/^\//, '');
|
|
67
|
+
const rawAttrs = m[2] ?? '';
|
|
68
|
+
const selfClosing = m[3] === '/';
|
|
69
|
+
const parentPrefixes = stack.length > 0 ? stack[stack.length - 1].prefixes : {};
|
|
70
|
+
const ownDecls = xmlnsDeclarations(rawAttrs);
|
|
71
|
+
const prefixes = Object.keys(ownDecls).length > 0 ? { ...parentPrefixes, ...ownDecls } : parentPrefixes;
|
|
72
|
+
const qname = resolvePrefixed(name, prefixes);
|
|
73
|
+
if (!selfClosing) {
|
|
74
|
+
stack.push({ qname, prefixes });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return stack;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Ancestor chain (outermost first) of the element containing `offset`,
|
|
81
|
+
* resolved to expanded QNames via the `xmlns` declarations in scope at that
|
|
82
|
+
* point in the text.
|
|
83
|
+
*/
|
|
84
|
+
export function elementPathAt(text, offset) {
|
|
85
|
+
return scopeStackAt(text, offset).map((s) => s.qname);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Pure text analysis for the completion provider: detects an in-progress
|
|
89
|
+
* `<partial` element-name token ending at `offset` and reports the ancestor
|
|
90
|
+
* path, in-scope prefixes and the range to replace with the accepted item.
|
|
91
|
+
* Returns `undefined` when the cursor is not positioned right after an open
|
|
92
|
+
* `<` (e.g. mid-attribute, or not inside a tag at all).
|
|
93
|
+
*/
|
|
94
|
+
export function completionContextAt(text, offset) {
|
|
95
|
+
const before = text.slice(0, offset);
|
|
96
|
+
const ltIndex = before.lastIndexOf('<');
|
|
97
|
+
if (ltIndex === -1) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const between = text.slice(ltIndex + 1, offset);
|
|
101
|
+
if (/[\s>/]/.test(between) || between.startsWith('/')) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
let end = offset;
|
|
105
|
+
while (end < text.length && /[\w:.-]/.test(text[end])) {
|
|
106
|
+
end += 1;
|
|
107
|
+
}
|
|
108
|
+
const path = elementPathAt(text, ltIndex);
|
|
109
|
+
const scope = scopeStackAt(text, ltIndex);
|
|
110
|
+
const prefixes = scope.length > 0 ? scope[scope.length - 1].prefixes : {};
|
|
111
|
+
return {
|
|
112
|
+
path,
|
|
113
|
+
partial: between,
|
|
114
|
+
prefixes,
|
|
115
|
+
replaceRange: { start: ltIndex + 1, end },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A namespace-qualified name.
|
|
3
|
+
*
|
|
4
|
+
* In `xml/` because the text helpers beside it (`locate.ts`) speak of element names without
|
|
5
|
+
* knowing WSDL or XSD, and core imports no protocol folder (protocol modules spec §7.2).
|
|
6
|
+
* `wsdl/qname.ts` re-exports the type and keeps everything that resolves or compares one.
|
|
7
|
+
*/
|
|
8
|
+
/** A namespace-qualified name: an expanded `{namespaceUri}localName` pair. */
|
|
9
|
+
export interface QName {
|
|
10
|
+
readonly namespaceUri: string;
|
|
11
|
+
readonly localName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A namespace-qualified name.
|
|
3
|
+
*
|
|
4
|
+
* In `xml/` because the text helpers beside it (`locate.ts`) speak of element names without
|
|
5
|
+
* knowing WSDL or XSD, and core imports no protocol folder (protocol modules spec §7.2).
|
|
6
|
+
* `wsdl/qname.ts` re-exports the type and keeps everything that resolves or compares one.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -29,3 +29,22 @@ export interface EvaluateWithTimeoutOptions {
|
|
|
29
29
|
* @param timeoutOptions `{timeoutMs}`, default 5000
|
|
30
30
|
*/
|
|
31
31
|
export declare function evaluateWithTimeout(text: string, expression: string, options: EvaluateOptions, timeoutOptions?: EvaluateWithTimeoutOptions): Promise<QueryResult>;
|
|
32
|
+
/** The outcome of {@link matchRegexWithTimeout}. */
|
|
33
|
+
export type RegexMatchResult = {
|
|
34
|
+
readonly kind: 'matched';
|
|
35
|
+
readonly matched: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'error';
|
|
38
|
+
readonly code: 'regex-timeout' | 'regex-invalid';
|
|
39
|
+
readonly message: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Tests `pattern` against `text` on the same worker thread and time budget as
|
|
43
|
+
* {@link evaluateWithTimeout}.
|
|
44
|
+
*
|
|
45
|
+
* A pattern can come from a file someone else wrote (a request's or a sequence's `matches:`), and a
|
|
46
|
+
* backtracking pattern such as `(a+)+$` against a long near-miss runs for minutes. JavaScript cannot
|
|
47
|
+
* interrupt a running `RegExp`, so the only bound is a thread that can be terminated. Never throws
|
|
48
|
+
* or rejects: an invalid pattern, a timeout and a worker crash are all `{kind: 'error'}`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function matchRegexWithTimeout(pattern: string, text: string, timeoutOptions?: Pick<EvaluateWithTimeoutOptions, 'timeoutMs'>): Promise<RegexMatchResult>;
|
|
@@ -48,9 +48,35 @@ function workerUrl() {
|
|
|
48
48
|
export function evaluateWithTimeout(text, expression, options, timeoutOptions) {
|
|
49
49
|
const timeoutMs = timeoutOptions?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
50
50
|
const kind = timeoutOptions?.kind ?? 'xml';
|
|
51
|
+
return runOnWorker({ job: 'query', text, kind, expression, options }, timeoutMs, (failure) => failure.kind === 'timeout'
|
|
52
|
+
? { kind: 'error', code: 'xpath-timeout', message: `Query timed out after ${timeoutMs}ms` }
|
|
53
|
+
: { kind: 'error', message: failure.message });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Tests `pattern` against `text` on the same worker thread and time budget as
|
|
57
|
+
* {@link evaluateWithTimeout}.
|
|
58
|
+
*
|
|
59
|
+
* A pattern can come from a file someone else wrote (a request's or a sequence's `matches:`), and a
|
|
60
|
+
* backtracking pattern such as `(a+)+$` against a long near-miss runs for minutes. JavaScript cannot
|
|
61
|
+
* interrupt a running `RegExp`, so the only bound is a thread that can be terminated. Never throws
|
|
62
|
+
* or rejects: an invalid pattern, a timeout and a worker crash are all `{kind: 'error'}`.
|
|
63
|
+
*/
|
|
64
|
+
export function matchRegexWithTimeout(pattern, text, timeoutOptions) {
|
|
65
|
+
const timeoutMs = timeoutOptions?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
66
|
+
return runOnWorker({ job: 'regex', pattern, text }, timeoutMs, (failure) => failure.kind === 'timeout'
|
|
67
|
+
? { kind: 'error', code: 'regex-timeout', message: `Regular expression timed out after ${timeoutMs}ms` }
|
|
68
|
+
: { kind: 'error', code: 'regex-invalid', message: failure.message }, (posted) => 'error' in posted
|
|
69
|
+
? { kind: 'error', code: 'regex-invalid', message: posted.error }
|
|
70
|
+
: { kind: 'matched', matched: posted.matched });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Runs one job on a fresh worker, terminating it after `timeoutMs`. `onFailure` shapes a timeout or
|
|
74
|
+
* crash into the caller's result type; `map` shapes what the worker posted (identity by default).
|
|
75
|
+
*/
|
|
76
|
+
function runOnWorker(workerData, timeoutMs, onFailure, map = (posted) => posted) {
|
|
51
77
|
return new Promise((resolve) => {
|
|
52
78
|
let settled = false;
|
|
53
|
-
const worker = new Worker(workerUrl(), { workerData
|
|
79
|
+
const worker = new Worker(workerUrl(), { workerData });
|
|
54
80
|
const finish = (result) => {
|
|
55
81
|
if (settled) {
|
|
56
82
|
return;
|
|
@@ -61,20 +87,14 @@ export function evaluateWithTimeout(text, expression, options, timeoutOptions) {
|
|
|
61
87
|
void worker.terminate();
|
|
62
88
|
resolve(result);
|
|
63
89
|
};
|
|
64
|
-
const timer = setTimeout(() => {
|
|
65
|
-
finish({
|
|
66
|
-
kind: 'error',
|
|
67
|
-
code: 'xpath-timeout',
|
|
68
|
-
message: `Query timed out after ${timeoutMs}ms`,
|
|
69
|
-
});
|
|
70
|
-
}, timeoutMs);
|
|
90
|
+
const timer = setTimeout(() => finish(onFailure({ kind: 'timeout' })), timeoutMs);
|
|
71
91
|
timer.unref?.();
|
|
72
|
-
worker.once('message', (
|
|
73
|
-
worker.once('error', (error) => finish({ kind: '
|
|
92
|
+
worker.once('message', (posted) => finish(map(posted)));
|
|
93
|
+
worker.once('error', (error) => finish(onFailure({ kind: 'crash', message: error instanceof Error ? error.message : String(error) })));
|
|
74
94
|
worker.once('exit', (code) => {
|
|
75
95
|
/* v8 ignore next 3 -- normal completion always finishes via the 'message' listener first */
|
|
76
96
|
if (!settled) {
|
|
77
|
-
finish({ kind: '
|
|
97
|
+
finish(onFailure({ kind: 'crash', message: `xpath worker exited unexpectedly (code ${code})` }));
|
|
78
98
|
}
|
|
79
99
|
});
|
|
80
100
|
});
|
package/dist/xpath/evaluate.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the parsed document itself.
|
|
10
10
|
*/
|
|
11
11
|
import type { LinePosition } from '../xml/positions.js';
|
|
12
|
-
import type { TextRange } from '../
|
|
12
|
+
import type { TextRange } from '../xml/locate.js';
|
|
13
13
|
/** One node-shaped query result. */
|
|
14
14
|
export interface QueryNodeItem {
|
|
15
15
|
/** The node serialised back to text (an element/comment/PI/document), or an attribute's value. */
|
package/dist/xpath/namespaces.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* response document, and what the engine would suggest for the ones that aren't.
|
|
4
4
|
*/
|
|
5
5
|
import { parseXml } from '../xml/parse.js';
|
|
6
|
-
import { prefixForNamespace } from '../
|
|
6
|
+
import { prefixForNamespace } from '../xml/prefixes.js';
|
|
7
7
|
/** True for element nodes (xmldom `nodeType` 1) — the only nodes that carry `xmlns:*` attributes. */
|
|
8
8
|
function isElement(node) {
|
|
9
9
|
return node.nodeType === 1;
|
package/dist/xpath/worker.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Entry point run inside a `node:worker_threads` Worker by {@link evaluateWithTimeout}
|
|
3
|
-
* `{text, kind, expression, options}`
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Entry point run inside a `node:worker_threads` Worker by {@link evaluateWithTimeout} and
|
|
3
|
+
* {@link matchRegexWithTimeout}. Receives either a query (`{text, kind, expression, options}`) or a
|
|
4
|
+
* regular-expression job (`{job: 'regex', pattern, text}`) as `workerData`, runs it once, and posts
|
|
5
|
+
* the result back — this file never imports anything Electron/DOM-specific, only what the
|
|
6
|
+
* evaluators themselves need, so it can run unmodified in a bare worker thread.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
/** What a regex job posts back: whether it matched, or why the pattern could not be compiled. */
|
|
9
|
+
export type RegexWorkerResult = {
|
|
10
|
+
readonly matched: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
readonly error: string;
|
|
13
|
+
};
|
package/dist/xpath/worker.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Entry point run inside a `node:worker_threads` Worker by {@link evaluateWithTimeout}
|
|
3
|
-
* `{text, kind, expression, options}`
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Entry point run inside a `node:worker_threads` Worker by {@link evaluateWithTimeout} and
|
|
3
|
+
* {@link matchRegexWithTimeout}. Receives either a query (`{text, kind, expression, options}`) or a
|
|
4
|
+
* regular-expression job (`{job: 'regex', pattern, text}`) as `workerData`, runs it once, and posts
|
|
5
|
+
* the result back — this file never imports anything Electron/DOM-specific, only what the
|
|
6
|
+
* evaluators themselves need, so it can run unmodified in a bare worker thread.
|
|
6
7
|
*/
|
|
7
8
|
import { parentPort, workerData } from 'node:worker_threads';
|
|
8
9
|
import { evaluate, evaluateJson } from './evaluate.js';
|
|
9
10
|
/* v8 ignore start -- exercised only inside a real worker thread; covered by evaluate-async.test.ts
|
|
10
11
|
end-to-end (a query actually running to completion, or timing out), not by unit-level coverage
|
|
11
12
|
instrumentation, which does not attach across the thread boundary. */
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
function runRegex(request) {
|
|
14
|
+
try {
|
|
15
|
+
return { matched: new RegExp(request.pattern).test(request.text) };
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
return { error: error instanceof Error ? error.message : String(error) };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function runQuery(request) {
|
|
14
22
|
let result;
|
|
15
23
|
try {
|
|
16
24
|
result =
|
|
@@ -21,6 +29,15 @@ if (parentPort !== null) {
|
|
|
21
29
|
catch (error) {
|
|
22
30
|
result = { kind: 'error', message: error instanceof Error ? error.message : String(error) };
|
|
23
31
|
}
|
|
24
|
-
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
if (parentPort !== null) {
|
|
35
|
+
const request = workerData;
|
|
36
|
+
if (request.job === 'regex') {
|
|
37
|
+
parentPort.postMessage(runRegex(request));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
parentPort.postMessage(runQuery(request));
|
|
41
|
+
}
|
|
25
42
|
}
|
|
26
43
|
/* v8 ignore stop */
|
package/dist/xsd/form-model.d.ts
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
* the IPC boundary to the renderer as-is.
|
|
22
22
|
*/
|
|
23
23
|
import type { QName } from '../wsdl/qname.js';
|
|
24
|
-
import type { Occurs } from './model.js';
|
|
24
|
+
import type { ElementDecl, Occurs } from './model.js';
|
|
25
25
|
import type { SchemaSet } from './schema-set.js';
|
|
26
|
-
import type { TextRange } from './xml-scan.js';
|
|
26
|
+
import type { ScannedElement, TextRange } from './xml-scan.js';
|
|
27
27
|
export type { TextRange } from './xml-scan.js';
|
|
28
28
|
/** How a leaf's value should be edited. `other` means "no useful editor; plain text". */
|
|
29
29
|
export type FormValueBase = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'time' | 'dateTime' | 'binary' | 'other';
|
|
@@ -123,6 +123,18 @@ export interface BuildFormOptions {
|
|
|
123
123
|
*/
|
|
124
124
|
readonly inScope?: Readonly<Record<string, string>>;
|
|
125
125
|
}
|
|
126
|
+
/** The unconsumed source children of one element, claimed by name as particles are walked (the JSON bridge reads with it too). */
|
|
127
|
+
export declare class Pool {
|
|
128
|
+
readonly children: readonly ScannedElement[];
|
|
129
|
+
private readonly used;
|
|
130
|
+
constructor(children: readonly ScannedElement[]);
|
|
131
|
+
/** Claims the next unused child whose expanded name is in `names`. */
|
|
132
|
+
take(names: readonly QName[]): ScannedElement | undefined;
|
|
133
|
+
/** True when any unused child matches one of `names` — used to size a repeating compositor. */
|
|
134
|
+
has(names: readonly QName[]): boolean;
|
|
135
|
+
/** Every child no particle claimed, in source order. */
|
|
136
|
+
leftovers(): readonly ScannedElement[];
|
|
137
|
+
}
|
|
126
138
|
/**
|
|
127
139
|
* Builds the form tree for one global element declaration.
|
|
128
140
|
*
|
|
@@ -139,6 +151,11 @@ export declare function buildForm(schemaSet: SchemaSet, element: QName, xml?: st
|
|
|
139
151
|
* part takes.
|
|
140
152
|
*/
|
|
141
153
|
export declare function buildFormForType(schemaSet: SchemaSet, elementName: QName, type: QName, xml?: string, options?: BuildFormOptions): FormNode;
|
|
154
|
+
/**
|
|
155
|
+
* Builds the form tree for any element declaration, a local one included: what
|
|
156
|
+
* the JSON bridge expands where a form was cut at its depth limit.
|
|
157
|
+
*/
|
|
158
|
+
export declare function buildFormForDecl(schemaSet: SchemaSet, decl: ElementDecl, xml?: string, options?: BuildFormOptions): FormNode;
|
|
142
159
|
/** Knobs {@link applyForm} accepts. */
|
|
143
160
|
export interface ApplyFormOptions {
|
|
144
161
|
/** Indent per level; three spaces by default, matching the sample generator. */
|