@wirebench/engine 2.1.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/LICENSE +201 -0
- package/README.md +3 -0
- package/dist/assert/contract.d.ts +3 -0
- package/dist/assert/contract.js +17 -0
- package/dist/assert/index.d.ts +4 -0
- package/dist/assert/index.js +27 -0
- package/dist/assert/match.d.ts +3 -0
- package/dist/assert/match.js +58 -0
- package/dist/assert/model.d.ts +73 -0
- package/dist/assert/model.js +8 -0
- package/dist/assert/schema.d.ts +34 -0
- package/dist/assert/schema.js +46 -0
- package/dist/assert/sla.d.ts +3 -0
- package/dist/assert/sla.js +8 -0
- package/dist/assert/soap-fault.d.ts +3 -0
- package/dist/assert/soap-fault.js +20 -0
- package/dist/assert/status.d.ts +3 -0
- package/dist/assert/status.js +14 -0
- package/dist/errors.d.ts +77 -0
- package/dist/errors.js +121 -0
- package/dist/fs.d.ts +35 -0
- package/dist/fs.js +64 -0
- package/dist/generate.d.ts +12 -0
- package/dist/generate.js +14 -0
- package/dist/grpc/browser.d.ts +11 -0
- package/dist/grpc/browser.js +9 -0
- package/dist/grpc/cache.d.ts +113 -0
- package/dist/grpc/cache.js +244 -0
- package/dist/grpc/call.d.ts +64 -0
- package/dist/grpc/call.js +72 -0
- package/dist/grpc/codec.d.ts +29 -0
- package/dist/grpc/codec.js +416 -0
- package/dist/grpc/command.d.ts +23 -0
- package/dist/grpc/command.js +91 -0
- package/dist/grpc/expand.d.ts +25 -0
- package/dist/grpc/expand.js +52 -0
- package/dist/grpc/framing.d.ts +28 -0
- package/dist/grpc/framing.js +61 -0
- package/dist/grpc/import.d.ts +47 -0
- package/dist/grpc/import.js +88 -0
- package/dist/grpc/model.d.ts +179 -0
- package/dist/grpc/model.js +91 -0
- package/dist/grpc/proto/describe.d.ts +92 -0
- package/dist/grpc/proto/describe.js +205 -0
- package/dist/grpc/proto/load.d.ts +35 -0
- package/dist/grpc/proto/load.js +112 -0
- package/dist/grpc/proto/sample.d.ts +21 -0
- package/dist/grpc/proto/sample.js +79 -0
- package/dist/grpc/proto/well-known.d.ts +42 -0
- package/dist/grpc/proto/well-known.js +143 -0
- package/dist/grpc/reconcile.d.ts +42 -0
- package/dist/grpc/reconcile.js +153 -0
- package/dist/grpc/reflection/client.d.ts +70 -0
- package/dist/grpc/reflection/client.js +197 -0
- package/dist/grpc/reflection/descriptors.d.ts +69 -0
- package/dist/grpc/reflection/descriptors.js +140 -0
- package/dist/grpc/reflection/proto.d.ts +33 -0
- package/dist/grpc/reflection/proto.js +144 -0
- package/dist/grpc/send.d.ts +132 -0
- package/dist/grpc/send.js +435 -0
- package/dist/grpc/shape.d.ts +29 -0
- package/dist/grpc/shape.js +36 -0
- package/dist/grpc/status.d.ts +21 -0
- package/dist/grpc/status.js +62 -0
- package/dist/grpc/target.d.ts +21 -0
- package/dist/grpc/target.js +66 -0
- package/dist/http/auth/apply.d.ts +37 -0
- package/dist/http/auth/apply.js +74 -0
- package/dist/http/auth/basic.d.ts +36 -0
- package/dist/http/auth/basic.js +69 -0
- package/dist/http/auth/md4.d.ts +13 -0
- package/dist/http/auth/md4.js +81 -0
- package/dist/http/auth/ntlm-transport.d.ts +61 -0
- package/dist/http/auth/ntlm-transport.js +97 -0
- package/dist/http/auth/ntlm.d.ts +190 -0
- package/dist/http/auth/ntlm.js +377 -0
- package/dist/http/client.d.ts +73 -0
- package/dist/http/client.js +403 -0
- package/dist/http/curl-flags.d.ts +15 -0
- package/dist/http/curl-flags.js +95 -0
- package/dist/http/curl.d.ts +94 -0
- package/dist/http/curl.js +245 -0
- package/dist/http/decompress.d.ts +7 -0
- package/dist/http/decompress.js +22 -0
- package/dist/http/errors.d.ts +22 -0
- package/dist/http/errors.js +144 -0
- package/dist/http/failed-request.d.ts +27 -0
- package/dist/http/failed-request.js +48 -0
- package/dist/http/headers.d.ts +15 -0
- package/dist/http/headers.js +50 -0
- package/dist/http/heredoc.d.ts +25 -0
- package/dist/http/heredoc.js +74 -0
- package/dist/http/proxy.d.ts +103 -0
- package/dist/http/proxy.js +168 -0
- package/dist/http/raw-capture.d.ts +23 -0
- package/dist/http/raw-capture.js +57 -0
- package/dist/http/timings.d.ts +79 -0
- package/dist/http/timings.js +212 -0
- package/dist/http/tls.d.ts +111 -0
- package/dist/http/tls.js +167 -0
- package/dist/http/types.d.ts +125 -0
- package/dist/http/types.js +6 -0
- package/dist/import-detect.d.ts +26 -0
- package/dist/import-detect.js +169 -0
- package/dist/import.d.ts +20 -0
- package/dist/import.js +163 -0
- package/dist/index.d.ts +272 -0
- package/dist/index.js +157 -0
- package/dist/json/cursor.d.ts +43 -0
- package/dist/json/cursor.js +168 -0
- package/dist/operations.d.ts +12 -0
- package/dist/operations.js +52 -0
- package/dist/project/attachments-cache.d.ts +80 -0
- package/dist/project/attachments-cache.js +186 -0
- package/dist/project/endpoints.d.ts +23 -0
- package/dist/project/endpoints.js +47 -0
- package/dist/project/environments.d.ts +68 -0
- package/dist/project/environments.js +124 -0
- package/dist/project/fs.d.ts +45 -0
- package/dist/project/fs.js +78 -0
- package/dist/project/history.d.ts +171 -0
- package/dist/project/history.js +179 -0
- package/dist/project/keystores.d.ts +24 -0
- package/dist/project/keystores.js +66 -0
- package/dist/project/load.d.ts +44 -0
- package/dist/project/load.js +634 -0
- package/dist/project/migrate.d.ts +27 -0
- package/dist/project/migrate.js +46 -0
- package/dist/project/model.d.ts +401 -0
- package/dist/project/model.js +126 -0
- package/dist/project/paths.d.ts +134 -0
- package/dist/project/paths.js +259 -0
- package/dist/project/preferences.d.ts +318 -0
- package/dist/project/preferences.js +239 -0
- package/dist/project/properties.d.ts +97 -0
- package/dist/project/properties.js +356 -0
- package/dist/project/save.d.ts +65 -0
- package/dist/project/save.js +295 -0
- package/dist/project/schema.d.ts +1329 -0
- package/dist/project/schema.js +737 -0
- package/dist/project/serialize.d.ts +42 -0
- package/dist/project/serialize.js +385 -0
- package/dist/project/wss-configs.d.ts +40 -0
- package/dist/project/wss-configs.js +142 -0
- package/dist/project/yaml.d.ts +17 -0
- package/dist/project/yaml.js +39 -0
- package/dist/redact/index.d.ts +77 -0
- package/dist/redact/index.js +328 -0
- package/dist/redact/literal.d.ts +12 -0
- package/dist/redact/literal.js +68 -0
- package/dist/rest/auth.d.ts +53 -0
- package/dist/rest/auth.js +80 -0
- package/dist/rest/body.d.ts +61 -0
- package/dist/rest/body.js +184 -0
- package/dist/rest/browser.d.ts +12 -0
- package/dist/rest/browser.js +11 -0
- package/dist/rest/cookies.d.ts +41 -0
- package/dist/rest/cookies.js +102 -0
- package/dist/rest/curl.d.ts +75 -0
- package/dist/rest/curl.js +417 -0
- package/dist/rest/expand.d.ts +35 -0
- package/dist/rest/expand.js +104 -0
- package/dist/rest/model.d.ts +247 -0
- package/dist/rest/model.js +118 -0
- package/dist/rest/oauth2.d.ts +118 -0
- package/dist/rest/oauth2.js +212 -0
- package/dist/rest/openapi/cache.d.ts +54 -0
- package/dist/rest/openapi/cache.js +128 -0
- package/dist/rest/openapi/import.d.ts +67 -0
- package/dist/rest/openapi/import.js +91 -0
- package/dist/rest/openapi/map.d.ts +102 -0
- package/dist/rest/openapi/map.js +477 -0
- package/dist/rest/openapi/model.d.ts +203 -0
- package/dist/rest/openapi/model.js +37 -0
- package/dist/rest/openapi/parse.d.ts +44 -0
- package/dist/rest/openapi/parse.js +1530 -0
- package/dist/rest/openapi/refs.d.ts +63 -0
- package/dist/rest/openapi/refs.js +258 -0
- package/dist/rest/openapi/sample.d.ts +68 -0
- package/dist/rest/openapi/sample.js +336 -0
- package/dist/rest/postman/import.d.ts +21 -0
- package/dist/rest/postman/import.js +47 -0
- package/dist/rest/postman/index.d.ts +7 -0
- package/dist/rest/postman/index.js +7 -0
- package/dist/rest/postman/map.d.ts +28 -0
- package/dist/rest/postman/map.js +427 -0
- package/dist/rest/postman/model.d.ts +118 -0
- package/dist/rest/postman/model.js +7 -0
- package/dist/rest/postman/parse.d.ts +29 -0
- package/dist/rest/postman/parse.js +518 -0
- package/dist/rest/response.d.ts +72 -0
- package/dist/rest/response.js +221 -0
- package/dist/rest/send.d.ts +102 -0
- package/dist/rest/send.js +148 -0
- package/dist/rest/url.d.ts +92 -0
- package/dist/rest/url.js +213 -0
- package/dist/run/effective-auth.d.ts +10 -0
- package/dist/run/effective-auth.js +19 -0
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.js +4 -0
- package/dist/run/prepare.d.ts +43 -0
- package/dist/run/prepare.js +280 -0
- package/dist/run/run.d.ts +53 -0
- package/dist/run/run.js +223 -0
- package/dist/run/secret-needs.d.ts +13 -0
- package/dist/run/secret-needs.js +125 -0
- package/dist/run/select.d.ts +34 -0
- package/dist/run/select.js +76 -0
- package/dist/secrets/env-names.d.ts +27 -0
- package/dist/secrets/env-names.js +40 -0
- package/dist/secrets/resolve.d.ts +58 -0
- package/dist/secrets/resolve.js +136 -0
- package/dist/send-options.d.ts +141 -0
- package/dist/send-options.js +228 -0
- package/dist/send.d.ts +53 -0
- package/dist/send.js +210 -0
- package/dist/soap/body-builder.d.ts +38 -0
- package/dist/soap/body-builder.js +250 -0
- package/dist/soap/build-problems.d.ts +12 -0
- package/dist/soap/build-problems.js +2 -0
- package/dist/soap/charset.d.ts +23 -0
- package/dist/soap/charset.js +47 -0
- package/dist/soap/envelope.d.ts +44 -0
- package/dist/soap/envelope.js +76 -0
- package/dist/soap/fault.d.ts +46 -0
- package/dist/soap/fault.js +129 -0
- package/dist/soap/form-request.d.ts +34 -0
- package/dist/soap/form-request.js +251 -0
- package/dist/soap/legacy-project/definition-fetcher.d.ts +21 -0
- package/dist/soap/legacy-project/definition-fetcher.js +43 -0
- package/dist/soap/legacy-project/format.d.ts +18 -0
- package/dist/soap/legacy-project/format.js +24 -0
- package/dist/soap/legacy-project/import.d.ts +21 -0
- package/dist/soap/legacy-project/import.js +46 -0
- package/dist/soap/legacy-project/index.d.ts +9 -0
- package/dist/soap/legacy-project/index.js +5 -0
- package/dist/soap/legacy-project/map.d.ts +91 -0
- package/dist/soap/legacy-project/map.js +290 -0
- package/dist/soap/legacy-project/model.d.ts +98 -0
- package/dist/soap/legacy-project/model.js +5 -0
- package/dist/soap/legacy-project/parse.d.ts +16 -0
- package/dist/soap/legacy-project/parse.js +325 -0
- package/dist/soap/mime/cid-scan.d.ts +36 -0
- package/dist/soap/mime/cid-scan.js +52 -0
- package/dist/soap/mime/inline-files.d.ts +39 -0
- package/dist/soap/mime/inline-files.js +71 -0
- package/dist/soap/mime/mtom.d.ts +74 -0
- package/dist/soap/mime/mtom.js +134 -0
- package/dist/soap/mime/multipart.d.ts +66 -0
- package/dist/soap/mime/multipart.js +329 -0
- package/dist/soap/mime/send-pipeline.d.ts +61 -0
- package/dist/soap/mime/send-pipeline.js +145 -0
- package/dist/soap/mime/swa.d.ts +45 -0
- package/dist/soap/mime/swa.js +62 -0
- package/dist/soap/mime/types.d.ts +69 -0
- package/dist/soap/mime/types.js +10 -0
- package/dist/soap/namespace-scope.d.ts +32 -0
- package/dist/soap/namespace-scope.js +85 -0
- package/dist/soap/prefixes.d.ts +24 -0
- package/dist/soap/prefixes.js +70 -0
- package/dist/soap/recreate.d.ts +28 -0
- package/dist/soap/recreate.js +168 -0
- package/dist/soap/request-builder.d.ts +63 -0
- package/dist/soap/request-builder.js +161 -0
- package/dist/soap/response-parser.d.ts +29 -0
- package/dist/soap/response-parser.js +71 -0
- package/dist/soap/soap-action.d.ts +31 -0
- package/dist/soap/soap-action.js +28 -0
- package/dist/soap/transforms.d.ts +52 -0
- package/dist/soap/transforms.js +164 -0
- package/dist/types.d.ts +307 -0
- package/dist/types.js +6 -0
- package/dist/validate/index.d.ts +61 -0
- package/dist/validate/index.js +72 -0
- package/dist/validate/schema-file-set.d.ts +51 -0
- package/dist/validate/schema-file-set.js +288 -0
- package/dist/validate/schema-validator.d.ts +53 -0
- package/dist/validate/schema-validator.js +251 -0
- package/dist/validate/soap-structure.d.ts +34 -0
- package/dist/validate/soap-structure.js +255 -0
- package/dist/validate/types.d.ts +47 -0
- package/dist/validate/types.js +8 -0
- package/dist/validate/wsi/assertions/helpers.d.ts +145 -0
- package/dist/validate/wsi/assertions/helpers.js +387 -0
- package/dist/validate/wsi/assertions/index.d.ts +44 -0
- package/dist/validate/wsi/assertions/index.js +77 -0
- package/dist/validate/wsi/assertions/message/helpers.d.ts +63 -0
- package/dist/validate/wsi/assertions/message/helpers.js +168 -0
- package/dist/validate/wsi/assertions/message/index.d.ts +39 -0
- package/dist/validate/wsi/assertions/message/index.js +62 -0
- package/dist/validate/wsi/assertions/message/r1001.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1001.js +38 -0
- package/dist/validate/wsi/assertions/message/r1003.d.ts +14 -0
- package/dist/validate/wsi/assertions/message/r1003.js +45 -0
- package/dist/validate/wsi/assertions/message/r1005.d.ts +12 -0
- package/dist/validate/wsi/assertions/message/r1005.js +37 -0
- package/dist/validate/wsi/assertions/message/r1006.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1006.js +49 -0
- package/dist/validate/wsi/assertions/message/r1007.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1007.js +30 -0
- package/dist/validate/wsi/assertions/message/r1011.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1011.js +33 -0
- package/dist/validate/wsi/assertions/message/r1012.d.ts +13 -0
- package/dist/validate/wsi/assertions/message/r1012.js +37 -0
- package/dist/validate/wsi/assertions/message/r1013.d.ts +9 -0
- package/dist/validate/wsi/assertions/message/r1013.js +42 -0
- package/dist/validate/wsi/assertions/message/r1014.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1014.js +30 -0
- package/dist/validate/wsi/assertions/message/r1015.d.ts +12 -0
- package/dist/validate/wsi/assertions/message/r1015.js +36 -0
- package/dist/validate/wsi/assertions/message/r1017.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1017.js +30 -0
- package/dist/validate/wsi/assertions/message/r1100.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1100.js +39 -0
- package/dist/validate/wsi/assertions/message/r1101.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1101.js +37 -0
- package/dist/validate/wsi/assertions/message/r1102.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1102.js +41 -0
- package/dist/validate/wsi/assertions/message/r1103.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1103.js +28 -0
- package/dist/validate/wsi/assertions/message/r1107.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1107.js +38 -0
- package/dist/validate/wsi/assertions/message/r1109.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1109.js +32 -0
- package/dist/validate/wsi/assertions/message/r1124.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1124.js +31 -0
- package/dist/validate/wsi/assertions/message/r1132.d.ts +9 -0
- package/dist/validate/wsi/assertions/message/r1132.js +23 -0
- package/dist/validate/wsi/assertions/message/r1140.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1140.js +42 -0
- package/dist/validate/wsi/assertions/message/r1141.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1141.js +32 -0
- package/dist/validate/wsi/assertions/message/r2113.d.ts +11 -0
- package/dist/validate/wsi/assertions/message/r2113.js +33 -0
- package/dist/validate/wsi/assertions/message/r2211.d.ts +7 -0
- package/dist/validate/wsi/assertions/message/r2211.js +42 -0
- package/dist/validate/wsi/assertions/r2001.d.ts +15 -0
- package/dist/validate/wsi/assertions/r2001.js +47 -0
- package/dist/validate/wsi/assertions/r2002.d.ts +11 -0
- package/dist/validate/wsi/assertions/r2002.js +38 -0
- package/dist/validate/wsi/assertions/r2003.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2003.js +32 -0
- package/dist/validate/wsi/assertions/r2005.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2005.js +40 -0
- package/dist/validate/wsi/assertions/r2101.d.ts +14 -0
- package/dist/validate/wsi/assertions/r2101.js +65 -0
- package/dist/validate/wsi/assertions/r2102.d.ts +10 -0
- package/dist/validate/wsi/assertions/r2102.js +41 -0
- package/dist/validate/wsi/assertions/r2105.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2105.js +39 -0
- package/dist/validate/wsi/assertions/r2110.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2110.js +38 -0
- package/dist/validate/wsi/assertions/r2111.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2111.js +30 -0
- package/dist/validate/wsi/assertions/r2112.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2112.js +35 -0
- package/dist/validate/wsi/assertions/r2201.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2201.js +28 -0
- package/dist/validate/wsi/assertions/r2203.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2203.js +30 -0
- package/dist/validate/wsi/assertions/r2204.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2204.js +29 -0
- package/dist/validate/wsi/assertions/r2205.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2205.js +46 -0
- package/dist/validate/wsi/assertions/r2206.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2206.js +36 -0
- package/dist/validate/wsi/assertions/r2209.d.ts +12 -0
- package/dist/validate/wsi/assertions/r2209.js +37 -0
- package/dist/validate/wsi/assertions/r2210.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2210.js +30 -0
- package/dist/validate/wsi/assertions/r2303.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2303.js +44 -0
- package/dist/validate/wsi/assertions/r2304.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2304.js +32 -0
- package/dist/validate/wsi/assertions/r2401.d.ts +12 -0
- package/dist/validate/wsi/assertions/r2401.js +31 -0
- package/dist/validate/wsi/assertions/r2701.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2701.js +28 -0
- package/dist/validate/wsi/assertions/r2702.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2702.js +26 -0
- package/dist/validate/wsi/assertions/r2705.d.ts +11 -0
- package/dist/validate/wsi/assertions/r2705.js +31 -0
- package/dist/validate/wsi/assertions/r2706.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2706.js +29 -0
- package/dist/validate/wsi/assertions/r2710.d.ts +13 -0
- package/dist/validate/wsi/assertions/r2710.js +37 -0
- package/dist/validate/wsi/assertions/r2716.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2716.js +29 -0
- package/dist/validate/wsi/assertions/r2717.d.ts +9 -0
- package/dist/validate/wsi/assertions/r2717.js +31 -0
- package/dist/validate/wsi/assertions/r2718.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2718.js +41 -0
- package/dist/validate/wsi/assertions/r2720.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2720.js +29 -0
- package/dist/validate/wsi/assertions/r2721.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2721.js +27 -0
- package/dist/validate/wsi/assertions/r2722.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2722.js +29 -0
- package/dist/validate/wsi/assertions/r2801.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2801.js +39 -0
- package/dist/validate/wsi/assertions/r2803.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2803.js +29 -0
- package/dist/validate/wsi/docs.d.ts +29 -0
- package/dist/validate/wsi/docs.js +167 -0
- package/dist/validate/wsi/index.d.ts +16 -0
- package/dist/validate/wsi/index.js +11 -0
- package/dist/validate/wsi/report-html.d.ts +36 -0
- package/dist/validate/wsi/report-html.js +135 -0
- package/dist/validate/wsi/run-message.d.ts +50 -0
- package/dist/validate/wsi/run-message.js +190 -0
- package/dist/validate/wsi/run-wsdl.d.ts +48 -0
- package/dist/validate/wsi/run-wsdl.js +99 -0
- package/dist/validate/wsi/types.d.ts +173 -0
- package/dist/validate/wsi/types.js +17 -0
- package/dist/workspace/commit-message.d.ts +47 -0
- package/dist/workspace/commit-message.js +195 -0
- package/dist/workspace/environments.d.ts +79 -0
- package/dist/workspace/environments.js +115 -0
- package/dist/workspace/index.d.ts +28 -0
- package/dist/workspace/index.js +19 -0
- package/dist/workspace/load.d.ts +45 -0
- package/dist/workspace/load.js +155 -0
- package/dist/workspace/local-state.d.ts +37 -0
- package/dist/workspace/local-state.js +59 -0
- package/dist/workspace/migrate.d.ts +38 -0
- package/dist/workspace/migrate.js +50 -0
- package/dist/workspace/model.d.ts +86 -0
- package/dist/workspace/model.js +54 -0
- package/dist/workspace/paths.d.ts +64 -0
- package/dist/workspace/paths.js +97 -0
- package/dist/workspace/reidentify.d.ts +22 -0
- package/dist/workspace/reidentify.js +122 -0
- package/dist/workspace/save.d.ts +31 -0
- package/dist/workspace/save.js +84 -0
- package/dist/workspace/schema.d.ts +93 -0
- package/dist/workspace/schema.js +115 -0
- package/dist/workspace/serialize.d.ts +24 -0
- package/dist/workspace/serialize.js +60 -0
- package/dist/workspace/share.d.ts +52 -0
- package/dist/workspace/share.js +89 -0
- package/dist/ws/browser.d.ts +13 -0
- package/dist/ws/browser.js +11 -0
- package/dist/ws/call.d.ts +53 -0
- package/dist/ws/call.js +106 -0
- package/dist/ws/command.d.ts +19 -0
- package/dist/ws/command.js +28 -0
- package/dist/ws/expand.d.ts +38 -0
- package/dist/ws/expand.js +76 -0
- package/dist/ws/model.d.ts +191 -0
- package/dist/ws/model.js +83 -0
- package/dist/ws/pretty.d.ts +12 -0
- package/dist/ws/pretty.js +25 -0
- package/dist/ws/session.d.ts +50 -0
- package/dist/ws/session.js +333 -0
- package/dist/ws/shape.d.ts +18 -0
- package/dist/ws/shape.js +28 -0
- package/dist/ws/transcript.d.ts +14 -0
- package/dist/ws/transcript.js +29 -0
- package/dist/ws/url.d.ts +3 -0
- package/dist/ws/url.js +44 -0
- package/dist/wsa/headers.d.ts +78 -0
- package/dist/wsa/headers.js +244 -0
- package/dist/wsa/model.d.ts +66 -0
- package/dist/wsa/model.js +52 -0
- package/dist/wsa/policy-detect.d.ts +81 -0
- package/dist/wsa/policy-detect.js +245 -0
- package/dist/wsdl/cache-naming.d.ts +39 -0
- package/dist/wsdl/cache-naming.js +90 -0
- package/dist/wsdl/cache.d.ts +48 -0
- package/dist/wsdl/cache.js +141 -0
- package/dist/wsdl/docs-generator.d.ts +47 -0
- package/dist/wsdl/docs-generator.js +439 -0
- package/dist/wsdl/dom-utils.d.ts +15 -0
- package/dist/wsdl/dom-utils.js +50 -0
- package/dist/wsdl/export-definition.d.ts +38 -0
- package/dist/wsdl/export-definition.js +100 -0
- package/dist/wsdl/fetch.d.ts +13 -0
- package/dist/wsdl/fetch.js +60 -0
- package/dist/wsdl/merge.d.ts +17 -0
- package/dist/wsdl/merge.js +57 -0
- package/dist/wsdl/model.d.ts +176 -0
- package/dist/wsdl/model.js +17 -0
- package/dist/wsdl/parse-binding.d.ts +6 -0
- package/dist/wsdl/parse-binding.js +150 -0
- package/dist/wsdl/parse-wsdl.d.ts +47 -0
- package/dist/wsdl/parse-wsdl.js +161 -0
- package/dist/wsdl/qname.d.ts +28 -0
- package/dist/wsdl/qname.js +41 -0
- package/dist/wsdl/ref-policy.d.ts +54 -0
- package/dist/wsdl/ref-policy.js +87 -0
- package/dist/wsdl/resolver.d.ts +81 -0
- package/dist/wsdl/resolver.js +276 -0
- package/dist/wsdl/update-definition.d.ts +106 -0
- package/dist/wsdl/update-definition.js +314 -0
- package/dist/wss/apply.d.ts +40 -0
- package/dist/wss/apply.js +212 -0
- package/dist/wss/c14n-prefixes.d.ts +27 -0
- package/dist/wss/c14n-prefixes.js +95 -0
- package/dist/wss/incoming/decrypt.d.ts +35 -0
- package/dist/wss/incoming/decrypt.js +57 -0
- package/dist/wss/incoming/index.d.ts +56 -0
- package/dist/wss/incoming/index.js +189 -0
- package/dist/wss/incoming/verify.d.ts +74 -0
- package/dist/wss/incoming/verify.js +440 -0
- package/dist/wss/key-identifiers.d.ts +76 -0
- package/dist/wss/key-identifiers.js +139 -0
- package/dist/wss/keystore/certificate.d.ts +45 -0
- package/dist/wss/keystore/certificate.js +134 -0
- package/dist/wss/keystore/index.d.ts +50 -0
- package/dist/wss/keystore/index.js +80 -0
- package/dist/wss/keystore/model.d.ts +83 -0
- package/dist/wss/keystore/model.js +27 -0
- package/dist/wss/keystore/pem.d.ts +21 -0
- package/dist/wss/keystore/pem.js +140 -0
- package/dist/wss/keystore/pkcs12.d.ts +21 -0
- package/dist/wss/keystore/pkcs12.js +125 -0
- package/dist/wss/model.d.ts +160 -0
- package/dist/wss/model.js +37 -0
- package/dist/wss/outgoing/encryption.d.ts +76 -0
- package/dist/wss/outgoing/encryption.js +618 -0
- package/dist/wss/outgoing/signature.d.ts +73 -0
- package/dist/wss/outgoing/signature.js +239 -0
- package/dist/wss/outgoing/timestamp.d.ts +29 -0
- package/dist/wss/outgoing/timestamp.js +39 -0
- package/dist/wss/outgoing/username-token.d.ts +36 -0
- package/dist/wss/outgoing/username-token.js +68 -0
- package/dist/wss/security-header.d.ts +31 -0
- package/dist/wss/security-header.js +83 -0
- package/dist/xml/index.d.ts +7 -0
- package/dist/xml/index.js +7 -0
- package/dist/xml/namespaces.d.ts +36 -0
- package/dist/xml/namespaces.js +60 -0
- package/dist/xml/parse.d.ts +79 -0
- package/dist/xml/parse.js +109 -0
- package/dist/xml/positions.d.ts +26 -0
- package/dist/xml/positions.js +71 -0
- package/dist/xml/pretty.d.ts +37 -0
- package/dist/xml/pretty.js +137 -0
- package/dist/xml/serialize.d.ts +6 -0
- package/dist/xml/serialize.js +8 -0
- package/dist/xml/tolerant-tree.d.ts +56 -0
- package/dist/xml/tolerant-tree.js +134 -0
- package/dist/xpath/evaluate-async.d.ts +31 -0
- package/dist/xpath/evaluate-async.js +81 -0
- package/dist/xpath/evaluate.d.ts +98 -0
- package/dist/xpath/evaluate.js +340 -0
- package/dist/xpath/jsonpath.d.ts +40 -0
- package/dist/xpath/jsonpath.js +109 -0
- package/dist/xpath/namespaces.d.ts +29 -0
- package/dist/xpath/namespaces.js +101 -0
- package/dist/xpath/worker.d.ts +7 -0
- package/dist/xpath/worker.js +26 -0
- package/dist/xsd/builtins.d.ts +36 -0
- package/dist/xsd/builtins.js +108 -0
- package/dist/xsd/check-references.d.ts +25 -0
- package/dist/xsd/check-references.js +145 -0
- package/dist/xsd/form-edits.d.ts +57 -0
- package/dist/xsd/form-edits.js +153 -0
- package/dist/xsd/form-model.d.ts +153 -0
- package/dist/xsd/form-model.js +691 -0
- package/dist/xsd/locate.d.ts +42 -0
- package/dist/xsd/locate.js +249 -0
- package/dist/xsd/model.d.ts +249 -0
- package/dist/xsd/model.js +1 -0
- package/dist/xsd/parse-particles.d.ts +48 -0
- package/dist/xsd/parse-particles.js +320 -0
- package/dist/xsd/parse-schema.d.ts +21 -0
- package/dist/xsd/parse-schema.js +143 -0
- package/dist/xsd/resolve-content.d.ts +18 -0
- package/dist/xsd/resolve-content.js +242 -0
- package/dist/xsd/sample-generator.d.ts +51 -0
- package/dist/xsd/sample-generator.js +291 -0
- package/dist/xsd/sample-types.d.ts +21 -0
- package/dist/xsd/sample-types.js +69 -0
- package/dist/xsd/sample-values.d.ts +54 -0
- package/dist/xsd/sample-values.js +267 -0
- package/dist/xsd/schema-set.d.ts +51 -0
- package/dist/xsd/schema-set.js +203 -0
- package/dist/xsd/xml-scan.d.ts +64 -0
- package/dist/xsd/xml-scan.js +286 -0
- package/dist/xsd/xml-writer.d.ts +56 -0
- package/dist/xsd/xml-writer.js +103 -0
- package/package.json +69 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { QName } from '../wsdl/qname.js';
|
|
2
|
+
import type { BuiltinType } from './builtins.js';
|
|
3
|
+
import type { SimpleType, TypeDefinition } from './model.js';
|
|
4
|
+
/** The lookups the value helpers need; satisfied by a built `SchemaSet`. */
|
|
5
|
+
export interface SampleValueContext {
|
|
6
|
+
lookupType(name: QName): TypeDefinition | undefined;
|
|
7
|
+
builtin(name: QName): BuiltinType | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** Options controlling how a leaf's content is produced. */
|
|
10
|
+
export interface SampleValueOptions {
|
|
11
|
+
/** When false, every leaf is the placeholder `?`. */
|
|
12
|
+
readonly sampleValues: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** A reference to a simple type: a name, an inline definition, or nothing. */
|
|
15
|
+
export type SimpleTypeRef = QName | SimpleType | undefined;
|
|
16
|
+
/** The placeholder emitted for every leaf when sample values are off. */
|
|
17
|
+
export declare const PLACEHOLDER = "?";
|
|
18
|
+
/**
|
|
19
|
+
* Walks a simple type's restriction chain down to the built-in it ultimately
|
|
20
|
+
* derives from. Returns `undefined` for unresolvable or non-atomic chains.
|
|
21
|
+
*/
|
|
22
|
+
export declare function builtinBaseOf(ctx: SampleValueContext, ref: SimpleTypeRef, visited?: Set<string>): BuiltinType | undefined;
|
|
23
|
+
/** The constraining facets a form editor can act on, gathered from a restriction chain. */
|
|
24
|
+
export interface FormFacets {
|
|
25
|
+
readonly enum?: readonly string[];
|
|
26
|
+
readonly pattern?: string;
|
|
27
|
+
/** Lexical `minInclusive`/`minExclusive` bound, whichever the chain declares first. */
|
|
28
|
+
readonly min?: string;
|
|
29
|
+
readonly max?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Collects the facets a form field can enforce (`enumeration`, `pattern` and the
|
|
33
|
+
* numeric/date bounds) by walking a simple type's restriction chain, nearest
|
|
34
|
+
* declaration winning. Returns an empty object for built-ins and unresolvable
|
|
35
|
+
* references — the form never blocks on a facet it could not read.
|
|
36
|
+
*/
|
|
37
|
+
export declare function facetsOf(ctx: SampleValueContext, ref: SimpleTypeRef, visited?: Set<string>): FormFacets;
|
|
38
|
+
/**
|
|
39
|
+
* Produces the text content for a simple-typed leaf: the placeholder
|
|
40
|
+
* `?` unless `sampleValues` is on, in which case a facet- and built-in-derived
|
|
41
|
+
* example value is returned. Callers apply `fixed`/`default` themselves; those
|
|
42
|
+
* always win over anything computed here.
|
|
43
|
+
*
|
|
44
|
+
* @param type the leaf's type: a named reference, an inline definition, or `undefined` (treated as `xs:anyType`)
|
|
45
|
+
*/
|
|
46
|
+
export declare function sampleValueFor(ctx: SampleValueContext, type: SimpleTypeRef, options: SampleValueOptions): string;
|
|
47
|
+
/**
|
|
48
|
+
* Builds the body of a leaf's `<!--type: …-->` comment, e.g. `type: xs:int` or
|
|
49
|
+
* `type: xs:string - enumeration: [RED, GREEN, BLUE]`. Named simple types are
|
|
50
|
+
* reported by the built-in they ultimately restrict, so the comment always
|
|
51
|
+
* says what the value must look like. Returns `undefined` when nothing useful
|
|
52
|
+
* is known about the type.
|
|
53
|
+
*/
|
|
54
|
+
export declare function typeCommentFor(ctx: SampleValueContext, type: SimpleTypeRef): string | undefined;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { NS } from '../xml/namespaces.js';
|
|
2
|
+
import { qnameToString } from '../wsdl/qname.js';
|
|
3
|
+
/** The placeholder emitted for every leaf when sample values are off. */
|
|
4
|
+
export const PLACEHOLDER = '?';
|
|
5
|
+
const INTEGER_NAMES = new Set([
|
|
6
|
+
'integer',
|
|
7
|
+
'nonPositiveInteger',
|
|
8
|
+
'negativeInteger',
|
|
9
|
+
'long',
|
|
10
|
+
'int',
|
|
11
|
+
'short',
|
|
12
|
+
'byte',
|
|
13
|
+
'nonNegativeInteger',
|
|
14
|
+
'unsignedLong',
|
|
15
|
+
'unsignedInt',
|
|
16
|
+
'unsignedShort',
|
|
17
|
+
'unsignedByte',
|
|
18
|
+
'positiveInteger',
|
|
19
|
+
]);
|
|
20
|
+
function isQName(ref) {
|
|
21
|
+
return !('kind' in ref);
|
|
22
|
+
}
|
|
23
|
+
/** The value of the first `enumeration` facet, if the type declares one. */
|
|
24
|
+
function enumerationFacet(facets) {
|
|
25
|
+
for (const facet of facets) {
|
|
26
|
+
if (facet.kind === 'enumeration') {
|
|
27
|
+
return facet.values;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
/** The lexical value of the first bound facet of `kind`. */
|
|
33
|
+
function boundFacet(facets, kind) {
|
|
34
|
+
for (const facet of facets) {
|
|
35
|
+
if (facet.kind === kind) {
|
|
36
|
+
return facet.value;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
/** The value of the first `length` facet, falling back to `minLength`. */
|
|
42
|
+
function lengthFacet(facets) {
|
|
43
|
+
for (const kind of ['length', 'minLength']) {
|
|
44
|
+
for (const facet of facets) {
|
|
45
|
+
if (facet.kind === kind) {
|
|
46
|
+
return facet.value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
/** Resolves a named reference to its simple type definition, if the schema has one. */
|
|
53
|
+
function resolveSimple(ctx, ref) {
|
|
54
|
+
if (ref === undefined) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
if (!isQName(ref)) {
|
|
58
|
+
return ref;
|
|
59
|
+
}
|
|
60
|
+
const type = ctx.lookupType(ref);
|
|
61
|
+
return type !== undefined && type.kind === 'simpleType' ? type : undefined;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Walks a simple type's restriction chain down to the built-in it ultimately
|
|
65
|
+
* derives from. Returns `undefined` for unresolvable or non-atomic chains.
|
|
66
|
+
*/
|
|
67
|
+
export function builtinBaseOf(ctx, ref, visited = new Set()) {
|
|
68
|
+
if (ref === undefined) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
if (isQName(ref)) {
|
|
72
|
+
const key = qnameToString(ref);
|
|
73
|
+
if (visited.has(key)) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
visited.add(key);
|
|
77
|
+
const builtin = ctx.builtin(ref);
|
|
78
|
+
if (builtin !== undefined) {
|
|
79
|
+
return builtin.aliasOf !== undefined ? (ctx.builtin(builtin.aliasOf) ?? builtin) : builtin;
|
|
80
|
+
}
|
|
81
|
+
return builtinBaseOf(ctx, resolveSimple(ctx, ref), visited);
|
|
82
|
+
}
|
|
83
|
+
if (ref.variety !== 'atomic') {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return builtinBaseOf(ctx, ref.base ?? ref.baseType, visited);
|
|
87
|
+
}
|
|
88
|
+
/** The nearest `enumeration` facet in a simple type's restriction chain. */
|
|
89
|
+
function enumerationOf(ctx, ref, visited = new Set()) {
|
|
90
|
+
const simple = resolveSimple(ctx, ref);
|
|
91
|
+
if (simple === undefined) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
if (isQName(ref)) {
|
|
95
|
+
const key = qnameToString(ref);
|
|
96
|
+
if (visited.has(key)) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
visited.add(key);
|
|
100
|
+
}
|
|
101
|
+
const values = enumerationFacet(simple.facets);
|
|
102
|
+
if (values !== undefined && values.length > 0) {
|
|
103
|
+
return values;
|
|
104
|
+
}
|
|
105
|
+
return simple.variety === 'atomic' ? enumerationOf(ctx, simple.base ?? simple.baseType, visited) : undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Collects the facets a form field can enforce (`enumeration`, `pattern` and the
|
|
109
|
+
* numeric/date bounds) by walking a simple type's restriction chain, nearest
|
|
110
|
+
* declaration winning. Returns an empty object for built-ins and unresolvable
|
|
111
|
+
* references — the form never blocks on a facet it could not read.
|
|
112
|
+
*/
|
|
113
|
+
export function facetsOf(ctx, ref, visited = new Set()) {
|
|
114
|
+
const simple = resolveSimple(ctx, ref);
|
|
115
|
+
if (simple === undefined) {
|
|
116
|
+
return {};
|
|
117
|
+
}
|
|
118
|
+
if (ref !== undefined && isQName(ref)) {
|
|
119
|
+
const key = qnameToString(ref);
|
|
120
|
+
if (visited.has(key)) {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
visited.add(key);
|
|
124
|
+
}
|
|
125
|
+
const inherited = simple.variety === 'atomic' ? facetsOf(ctx, simple.base ?? simple.baseType, visited) : {};
|
|
126
|
+
const values = enumerationFacet(simple.facets);
|
|
127
|
+
const pattern = simple.facets.find((f) => f.kind === 'pattern');
|
|
128
|
+
const min = boundFacet(simple.facets, 'minInclusive') ?? boundFacet(simple.facets, 'minExclusive');
|
|
129
|
+
const max = boundFacet(simple.facets, 'maxInclusive') ?? boundFacet(simple.facets, 'maxExclusive');
|
|
130
|
+
return {
|
|
131
|
+
...inherited,
|
|
132
|
+
...(values !== undefined && values.length > 0 ? { enum: values } : {}),
|
|
133
|
+
...(pattern !== undefined && pattern.kind === 'pattern' ? { pattern: pattern.value } : {}),
|
|
134
|
+
...(min !== undefined ? { min } : {}),
|
|
135
|
+
...(max !== undefined ? { max } : {}),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/** Adds `delta` to an integer bound, leaving non-integer bounds untouched. */
|
|
139
|
+
function shiftBound(value, delta, integer) {
|
|
140
|
+
if (!integer) {
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
const parsed = Number(value);
|
|
144
|
+
return Number.isFinite(parsed) ? String(Math.trunc(parsed) + delta) : value;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Derives a value from a simple type's facets. Facets are considered in a fixed
|
|
148
|
+
* order so output stays predictable: `enumeration` (first value), then the
|
|
149
|
+
* bounds (`minInclusive`, `minExclusive` + 1 for integers, `maxInclusive`,
|
|
150
|
+
* `maxExclusive` - 1 for integers), then `length`/`minLength` (that many `?`),
|
|
151
|
+
* and finally the built-in base's own sample value.
|
|
152
|
+
*/
|
|
153
|
+
function atomicSample(ctx, simple, visited) {
|
|
154
|
+
const values = enumerationFacet(simple.facets);
|
|
155
|
+
if (values !== undefined && values.length > 0) {
|
|
156
|
+
return values[0];
|
|
157
|
+
}
|
|
158
|
+
const base = builtinBaseOf(ctx, simple);
|
|
159
|
+
const integer = base !== undefined && base.name.namespaceUri === NS.XSD && INTEGER_NAMES.has(base.name.localName);
|
|
160
|
+
const minInclusive = boundFacet(simple.facets, 'minInclusive');
|
|
161
|
+
if (minInclusive !== undefined) {
|
|
162
|
+
return minInclusive;
|
|
163
|
+
}
|
|
164
|
+
const minExclusive = boundFacet(simple.facets, 'minExclusive');
|
|
165
|
+
if (minExclusive !== undefined) {
|
|
166
|
+
return shiftBound(minExclusive, 1, integer);
|
|
167
|
+
}
|
|
168
|
+
const maxInclusive = boundFacet(simple.facets, 'maxInclusive');
|
|
169
|
+
if (maxInclusive !== undefined) {
|
|
170
|
+
return maxInclusive;
|
|
171
|
+
}
|
|
172
|
+
const maxExclusive = boundFacet(simple.facets, 'maxExclusive');
|
|
173
|
+
if (maxExclusive !== undefined) {
|
|
174
|
+
return shiftBound(maxExclusive, -1, integer);
|
|
175
|
+
}
|
|
176
|
+
const length = lengthFacet(simple.facets);
|
|
177
|
+
if (length !== undefined && length > 0 && length <= 64) {
|
|
178
|
+
return PLACEHOLDER.repeat(length);
|
|
179
|
+
}
|
|
180
|
+
return sampleFor(ctx, simple.base ?? simple.baseType, visited);
|
|
181
|
+
}
|
|
182
|
+
function sampleFor(ctx, ref, visited) {
|
|
183
|
+
if (ref === undefined) {
|
|
184
|
+
return PLACEHOLDER;
|
|
185
|
+
}
|
|
186
|
+
if (isQName(ref)) {
|
|
187
|
+
const key = qnameToString(ref);
|
|
188
|
+
if (visited.has(key)) {
|
|
189
|
+
return PLACEHOLDER;
|
|
190
|
+
}
|
|
191
|
+
visited.add(key);
|
|
192
|
+
const builtin = ctx.builtin(ref);
|
|
193
|
+
if (builtin !== undefined) {
|
|
194
|
+
return builtin.sampleValue === '' ? PLACEHOLDER : builtin.sampleValue;
|
|
195
|
+
}
|
|
196
|
+
const simple = resolveSimple(ctx, ref);
|
|
197
|
+
return simple === undefined ? PLACEHOLDER : sampleFor(ctx, simple, visited);
|
|
198
|
+
}
|
|
199
|
+
switch (ref.variety) {
|
|
200
|
+
case 'list': {
|
|
201
|
+
// A list sample shows two items so the separator is visible.
|
|
202
|
+
const item = sampleFor(ctx, ref.itemType, visited);
|
|
203
|
+
return `${item} ${item}`;
|
|
204
|
+
}
|
|
205
|
+
case 'union': {
|
|
206
|
+
const first = ref.memberTypes?.[0];
|
|
207
|
+
return first === undefined ? PLACEHOLDER : sampleFor(ctx, first, visited);
|
|
208
|
+
}
|
|
209
|
+
default:
|
|
210
|
+
return atomicSample(ctx, ref, visited);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Produces the text content for a simple-typed leaf: the placeholder
|
|
215
|
+
* `?` unless `sampleValues` is on, in which case a facet- and built-in-derived
|
|
216
|
+
* example value is returned. Callers apply `fixed`/`default` themselves; those
|
|
217
|
+
* always win over anything computed here.
|
|
218
|
+
*
|
|
219
|
+
* @param type the leaf's type: a named reference, an inline definition, or `undefined` (treated as `xs:anyType`)
|
|
220
|
+
*/
|
|
221
|
+
export function sampleValueFor(ctx, type, options) {
|
|
222
|
+
if (!options.sampleValues) {
|
|
223
|
+
return PLACEHOLDER;
|
|
224
|
+
}
|
|
225
|
+
return sampleFor(ctx, type, new Set());
|
|
226
|
+
}
|
|
227
|
+
/** Renders a type name with its conventional prefix (`xs:int`, `soapenc:string`, `ColorCode`). */
|
|
228
|
+
function typeLabel(name) {
|
|
229
|
+
if (name.namespaceUri === NS.XSD) {
|
|
230
|
+
return `xs:${name.localName}`;
|
|
231
|
+
}
|
|
232
|
+
if (name.namespaceUri === NS.SOAP11_ENC) {
|
|
233
|
+
return `soapenc:${name.localName}`;
|
|
234
|
+
}
|
|
235
|
+
return name.localName;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Builds the body of a leaf's `<!--type: …-->` comment, e.g. `type: xs:int` or
|
|
239
|
+
* `type: xs:string - enumeration: [RED, GREEN, BLUE]`. Named simple types are
|
|
240
|
+
* reported by the built-in they ultimately restrict, so the comment always
|
|
241
|
+
* says what the value must look like. Returns `undefined` when nothing useful
|
|
242
|
+
* is known about the type.
|
|
243
|
+
*/
|
|
244
|
+
export function typeCommentFor(ctx, type) {
|
|
245
|
+
if (type === undefined) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
const simple = resolveSimple(ctx, type);
|
|
249
|
+
if (simple !== undefined && simple.variety === 'list') {
|
|
250
|
+
const item = typeCommentFor(ctx, simple.itemType);
|
|
251
|
+
return item === undefined ? undefined : `type: list of ${item.replace(/^type: /, '')}`;
|
|
252
|
+
}
|
|
253
|
+
if (simple !== undefined && simple.variety === 'union') {
|
|
254
|
+
const members = (simple.memberTypes ?? [])
|
|
255
|
+
.map((m) => typeCommentFor(ctx, m)?.replace(/^type: /, ''))
|
|
256
|
+
.filter((m) => m !== undefined);
|
|
257
|
+
return members.length === 0 ? undefined : `type: union of [${members.join(', ')}]`;
|
|
258
|
+
}
|
|
259
|
+
const base = builtinBaseOf(ctx, type);
|
|
260
|
+
const label = base !== undefined ? typeLabel(base.name) : isQName(type) ? typeLabel(type) : undefined;
|
|
261
|
+
if (label === undefined) {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
const values = enumerationOf(ctx, type);
|
|
265
|
+
const suffix = values !== undefined ? ` - enumeration: [${values.join(', ')}]` : '';
|
|
266
|
+
return `type: ${label}${suffix}`;
|
|
267
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Element } from '@xmldom/xmldom';
|
|
2
|
+
import type { QName } from '../wsdl/qname.js';
|
|
3
|
+
import type { DefinitionBundle } from '../wsdl/resolver.js';
|
|
4
|
+
import type { BuiltinType } from './builtins.js';
|
|
5
|
+
import type { AttributeDecl, AttributeGroup, ComplexType, ElementDecl, Group, ResolvedContent, SchemaProblem, TypeDefinition } from './model.js';
|
|
6
|
+
/** A WSDL definition (or anything else) that exposes the inline `xs:schema` elements to index. */
|
|
7
|
+
export interface SchemaElementsInput {
|
|
8
|
+
readonly schemaElements: readonly Element[];
|
|
9
|
+
}
|
|
10
|
+
/** Everything {@link buildSchemaSet} accepts. */
|
|
11
|
+
export type SchemaSetInput = DefinitionBundle | SchemaElementsInput;
|
|
12
|
+
/** The queryable, resolved set of schema components collected from a WSDL/XSD bundle. */
|
|
13
|
+
export interface SchemaSet {
|
|
14
|
+
/** Every distinct `targetNamespace` contributing components, in first-seen order. */
|
|
15
|
+
readonly namespaces: readonly string[];
|
|
16
|
+
/** Global element declarations, keyed by Clark notation. */
|
|
17
|
+
readonly elements: ReadonlyMap<string, ElementDecl>;
|
|
18
|
+
/** Global type definitions (complex and simple), keyed by Clark notation. */
|
|
19
|
+
readonly types: ReadonlyMap<string, TypeDefinition>;
|
|
20
|
+
readonly groups: ReadonlyMap<string, Group>;
|
|
21
|
+
readonly attributeGroups: ReadonlyMap<string, AttributeGroup>;
|
|
22
|
+
/** Global attribute declarations, keyed by Clark notation. */
|
|
23
|
+
readonly attributes: ReadonlyMap<string, AttributeDecl>;
|
|
24
|
+
readonly problems: readonly SchemaProblem[];
|
|
25
|
+
lookupElement(name: QName): ElementDecl | undefined;
|
|
26
|
+
lookupType(name: QName): TypeDefinition | undefined;
|
|
27
|
+
lookupGroup(name: QName): Group | undefined;
|
|
28
|
+
lookupAttributeGroup(name: QName): AttributeGroup | undefined;
|
|
29
|
+
lookupAttribute(name: QName): AttributeDecl | undefined;
|
|
30
|
+
/** Transitive substitution-group members of `head`, excluding the head, including abstract members. */
|
|
31
|
+
substitutionsFor(head: QName): readonly ElementDecl[];
|
|
32
|
+
/** Flattens a complex type's derivation chain, group refs and attribute groups. */
|
|
33
|
+
resolveContent(type: ComplexType): ResolvedContent;
|
|
34
|
+
isBuiltin(name: QName): boolean;
|
|
35
|
+
builtin(name: QName): BuiltinType | undefined;
|
|
36
|
+
elementsInNamespace(namespaceUri: string): readonly ElementDecl[];
|
|
37
|
+
typesInNamespace(namespaceUri: string): readonly TypeDefinition[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Builds a queryable {@link SchemaSet} from every `xs:schema` in a resolved
|
|
41
|
+
* bundle (or from a bare list of `xs:schema` elements, e.g. a merged
|
|
42
|
+
* `WsdlDefinition.schemaElements`).
|
|
43
|
+
*
|
|
44
|
+
* Pure and synchronous: nothing is fetched. `xs:import`/`xs:include` are
|
|
45
|
+
* ignored because the bundle already resolved them; `xs:redefine` is reported
|
|
46
|
+
* as `unsupported`. Dangling references never throw — they are recorded in
|
|
47
|
+
* {@link SchemaSet.problems} and the corresponding lookup returns `undefined`.
|
|
48
|
+
*
|
|
49
|
+
* @param input a {@link DefinitionBundle}, or any object exposing `schemaElements`
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildSchemaSet(input: SchemaSetInput): SchemaSet;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { NS } from '../xml/namespaces.js';
|
|
2
|
+
import { childElements, firstChildElement, optionalAttribute } from '../wsdl/dom-utils.js';
|
|
3
|
+
import { qnameToString } from '../wsdl/qname.js';
|
|
4
|
+
import { isBuiltinType, lookupBuiltin } from './builtins.js';
|
|
5
|
+
import { parseSchemaElement } from './parse-schema.js';
|
|
6
|
+
import { resolveContent } from './resolve-content.js';
|
|
7
|
+
import { checkReferences } from './check-references.js';
|
|
8
|
+
function isDefinitionBundle(input) {
|
|
9
|
+
return 'documents' in input && 'root' in input;
|
|
10
|
+
}
|
|
11
|
+
function schemaElementsOfWsdl(document) {
|
|
12
|
+
const root = document.documentElement;
|
|
13
|
+
if (root === null) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const types = firstChildElement(root, NS.WSDL, 'types');
|
|
17
|
+
return types === undefined ? [] : childElements(types, NS.XSD, 'schema');
|
|
18
|
+
}
|
|
19
|
+
function collectSources(input) {
|
|
20
|
+
if (!isDefinitionBundle(input)) {
|
|
21
|
+
return input.schemaElements.map((element) => ({ element, location: '<inline>' }));
|
|
22
|
+
}
|
|
23
|
+
const sources = [];
|
|
24
|
+
for (const doc of input.documents) {
|
|
25
|
+
if (doc.kind === 'wsdl') {
|
|
26
|
+
for (const element of schemaElementsOfWsdl(doc.document)) {
|
|
27
|
+
sources.push({ element, location: doc.location });
|
|
28
|
+
}
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const root = doc.document.documentElement;
|
|
32
|
+
if (root === null || root.namespaceURI !== NS.XSD || root.localName !== 'schema') {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// A chameleon include has no `targetNamespace` of its own: the bundle records
|
|
36
|
+
// the namespace it adopted from the including schema.
|
|
37
|
+
sources.push({
|
|
38
|
+
element: root,
|
|
39
|
+
location: doc.location,
|
|
40
|
+
...(doc.chameleonFor !== undefined && doc.namespace !== undefined ? { namespaceOverride: doc.namespace } : {}),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return sources;
|
|
44
|
+
}
|
|
45
|
+
class SchemaSetImpl {
|
|
46
|
+
namespaces;
|
|
47
|
+
elements;
|
|
48
|
+
types;
|
|
49
|
+
groups;
|
|
50
|
+
attributeGroups;
|
|
51
|
+
attributes;
|
|
52
|
+
problems;
|
|
53
|
+
substitutionIndex = new Map();
|
|
54
|
+
constructor(namespaces, elements, types, groups, attributeGroups, attributes, problems) {
|
|
55
|
+
this.namespaces = namespaces;
|
|
56
|
+
this.elements = elements;
|
|
57
|
+
this.types = types;
|
|
58
|
+
this.groups = groups;
|
|
59
|
+
this.attributeGroups = attributeGroups;
|
|
60
|
+
this.attributes = attributes;
|
|
61
|
+
for (const decl of elements.values()) {
|
|
62
|
+
if (decl.substitutionGroup !== undefined) {
|
|
63
|
+
const key = qnameToString(decl.substitutionGroup);
|
|
64
|
+
const bucket = this.substitutionIndex.get(key);
|
|
65
|
+
if (bucket === undefined) {
|
|
66
|
+
this.substitutionIndex.set(key, [decl]);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
bucket.push(decl);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
checkReferences(this, problems);
|
|
74
|
+
this.problems = problems;
|
|
75
|
+
}
|
|
76
|
+
lookupElement(name) {
|
|
77
|
+
return this.elements.get(qnameToString(name));
|
|
78
|
+
}
|
|
79
|
+
lookupType(name) {
|
|
80
|
+
return this.types.get(qnameToString(name));
|
|
81
|
+
}
|
|
82
|
+
lookupGroup(name) {
|
|
83
|
+
return this.groups.get(qnameToString(name));
|
|
84
|
+
}
|
|
85
|
+
lookupAttributeGroup(name) {
|
|
86
|
+
return this.attributeGroups.get(qnameToString(name));
|
|
87
|
+
}
|
|
88
|
+
lookupAttribute(name) {
|
|
89
|
+
return this.attributes.get(qnameToString(name));
|
|
90
|
+
}
|
|
91
|
+
substitutionsFor(head) {
|
|
92
|
+
const result = [];
|
|
93
|
+
const seen = new Set([qnameToString(head)]);
|
|
94
|
+
const queue = [qnameToString(head)];
|
|
95
|
+
while (queue.length > 0) {
|
|
96
|
+
const key = queue.shift();
|
|
97
|
+
for (const member of this.substitutionIndex.get(key) ?? []) {
|
|
98
|
+
const memberKey = qnameToString(member.name);
|
|
99
|
+
if (seen.has(memberKey)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
seen.add(memberKey);
|
|
103
|
+
result.push(member);
|
|
104
|
+
queue.push(memberKey);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
resolveContent(type) {
|
|
110
|
+
return resolveContent(type, this);
|
|
111
|
+
}
|
|
112
|
+
isBuiltin(name) {
|
|
113
|
+
return isBuiltinType(name);
|
|
114
|
+
}
|
|
115
|
+
builtin(name) {
|
|
116
|
+
return lookupBuiltin(name);
|
|
117
|
+
}
|
|
118
|
+
elementsInNamespace(namespaceUri) {
|
|
119
|
+
return [...this.elements.values()].filter((e) => e.name.namespaceUri === namespaceUri);
|
|
120
|
+
}
|
|
121
|
+
typesInNamespace(namespaceUri) {
|
|
122
|
+
return [...this.types.values()].filter((t) => t.name?.namespaceUri === namespaceUri);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** Indexes a component, keeping the first occurrence and reporting real duplicates. */
|
|
126
|
+
function addComponent(map, key, component, what, problems) {
|
|
127
|
+
const existing = map.get(key);
|
|
128
|
+
if (existing === undefined) {
|
|
129
|
+
map.set(key, component);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
// The same schema reached twice (e.g. included from two places) is not a
|
|
133
|
+
// conflict: identical location *and* line means it is literally the same
|
|
134
|
+
// declaration, so it is skipped silently.
|
|
135
|
+
if (existing.source.location === component.source.location && existing.source.line === component.source.line) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
problems.push({
|
|
139
|
+
code: 'duplicate-component',
|
|
140
|
+
message: `Duplicate ${what} ${key}; keeping the declaration from ${existing.source.location}`,
|
|
141
|
+
location: component.source.location,
|
|
142
|
+
...(component.source.line !== undefined
|
|
143
|
+
? { line: component.source.line, column: component.source.column ?? 1 }
|
|
144
|
+
: {}),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Builds a queryable {@link SchemaSet} from every `xs:schema` in a resolved
|
|
149
|
+
* bundle (or from a bare list of `xs:schema` elements, e.g. a merged
|
|
150
|
+
* `WsdlDefinition.schemaElements`).
|
|
151
|
+
*
|
|
152
|
+
* Pure and synchronous: nothing is fetched. `xs:import`/`xs:include` are
|
|
153
|
+
* ignored because the bundle already resolved them; `xs:redefine` is reported
|
|
154
|
+
* as `unsupported`. Dangling references never throw — they are recorded in
|
|
155
|
+
* {@link SchemaSet.problems} and the corresponding lookup returns `undefined`.
|
|
156
|
+
*
|
|
157
|
+
* @param input a {@link DefinitionBundle}, or any object exposing `schemaElements`
|
|
158
|
+
*/
|
|
159
|
+
export function buildSchemaSet(input) {
|
|
160
|
+
const problems = [];
|
|
161
|
+
const elements = new Map();
|
|
162
|
+
const types = new Map();
|
|
163
|
+
const groups = new Map();
|
|
164
|
+
const attributeGroups = new Map();
|
|
165
|
+
const attributes = new Map();
|
|
166
|
+
const namespaces = [];
|
|
167
|
+
for (const source of collectSources(input)) {
|
|
168
|
+
const schemaEl = source.element;
|
|
169
|
+
if (schemaEl.namespaceURI !== NS.XSD || schemaEl.localName !== 'schema') {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const targetNamespace = source.namespaceOverride ?? optionalAttribute(schemaEl, 'targetNamespace') ?? '';
|
|
173
|
+
const ctx = {
|
|
174
|
+
location: source.location,
|
|
175
|
+
targetNamespace,
|
|
176
|
+
elementFormDefault: optionalAttribute(schemaEl, 'elementFormDefault') === 'qualified' ? 'qualified' : 'unqualified',
|
|
177
|
+
attributeFormDefault: optionalAttribute(schemaEl, 'attributeFormDefault') === 'qualified' ? 'qualified' : 'unqualified',
|
|
178
|
+
problems,
|
|
179
|
+
};
|
|
180
|
+
if (!namespaces.includes(targetNamespace)) {
|
|
181
|
+
namespaces.push(targetNamespace);
|
|
182
|
+
}
|
|
183
|
+
const components = parseSchemaElement(schemaEl, ctx);
|
|
184
|
+
for (const decl of components.elements) {
|
|
185
|
+
addComponent(elements, qnameToString(decl.name), decl, 'element', problems);
|
|
186
|
+
}
|
|
187
|
+
for (const type of components.types) {
|
|
188
|
+
if (type.name !== undefined) {
|
|
189
|
+
addComponent(types, qnameToString(type.name), type, 'type', problems);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (const group of components.groups) {
|
|
193
|
+
addComponent(groups, qnameToString(group.name), group, 'group', problems);
|
|
194
|
+
}
|
|
195
|
+
for (const group of components.attributeGroups) {
|
|
196
|
+
addComponent(attributeGroups, qnameToString(group.name), group, 'attribute group', problems);
|
|
197
|
+
}
|
|
198
|
+
for (const attribute of components.attributes) {
|
|
199
|
+
addComponent(attributes, qnameToString(attribute.name), attribute, 'attribute', problems);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return new SchemaSetImpl(namespaces, elements, types, groups, attributeGroups, attributes, problems);
|
|
203
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tolerant, dependency-free XML fragment scanner used by the form model.
|
|
3
|
+
*
|
|
4
|
+
* It walks the raw text once and produces an element tree in which every node,
|
|
5
|
+
* attribute value and text run carries the exact UTF-16 offset range it came
|
|
6
|
+
* from, so the form view can splice a single value back into the envelope
|
|
7
|
+
* without reformatting anything around it. Never throws: malformed input stops
|
|
8
|
+
* the scan and is reported, and elements still open at end-of-input are closed
|
|
9
|
+
* at the document end.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately minimal — it exists to read a body fragment, not to validate
|
|
12
|
+
* one, so entities are decoded but DTDs, namespaces beyond `xmlns` bookkeeping
|
|
13
|
+
* and processing instructions are skipped.
|
|
14
|
+
*/
|
|
15
|
+
/** A half-open UTF-16 character range in a text document. */
|
|
16
|
+
export interface TextRange {
|
|
17
|
+
readonly start: number;
|
|
18
|
+
readonly end: number;
|
|
19
|
+
}
|
|
20
|
+
/** One attribute, with the range of its value inside (not including) the quotes. */
|
|
21
|
+
export interface ScannedAttribute {
|
|
22
|
+
/** As written, including any prefix (e.g. `xsi:type`). */
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly value: string;
|
|
25
|
+
readonly valueRange: TextRange;
|
|
26
|
+
}
|
|
27
|
+
/** One scanned element. */
|
|
28
|
+
export interface ScannedElement {
|
|
29
|
+
/** As written, including any prefix (e.g. `tem:Add`). */
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly localName: string;
|
|
32
|
+
readonly prefix?: string;
|
|
33
|
+
/** Resolved from the `xmlns`/`xmlns:*` declarations in scope; `''` when in no namespace. */
|
|
34
|
+
readonly namespaceUri: string;
|
|
35
|
+
/** Prefix → URI declared *on this element*, empty when it declares none. */
|
|
36
|
+
readonly declaredNamespaces: Readonly<Record<string, string>>;
|
|
37
|
+
readonly attributes: readonly ScannedAttribute[];
|
|
38
|
+
/** The whole element, `<` through the end of its close tag (or `/>`). */
|
|
39
|
+
readonly range: TextRange;
|
|
40
|
+
/** Text content and its range — only for a non-self-closing element with no child elements. */
|
|
41
|
+
readonly text?: {
|
|
42
|
+
readonly value: string;
|
|
43
|
+
readonly range: TextRange;
|
|
44
|
+
};
|
|
45
|
+
readonly children: readonly ScannedElement[];
|
|
46
|
+
readonly selfClosing: boolean;
|
|
47
|
+
/** Comments found directly before this element inside its parent, in source order. */
|
|
48
|
+
readonly leadingComments: readonly string[];
|
|
49
|
+
/** Comments found inside this element after its last child element. */
|
|
50
|
+
readonly trailingComments: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
/** What {@link scanXml} returns: the top-level elements plus any tolerance notes. */
|
|
53
|
+
export interface ScanXmlResult {
|
|
54
|
+
readonly elements: readonly ScannedElement[];
|
|
55
|
+
readonly problems: readonly string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Scans an XML fragment into an element tree with exact ranges.
|
|
59
|
+
*
|
|
60
|
+
* @param text the raw fragment; may contain several top-level elements
|
|
61
|
+
* @param inScope prefix → URI bindings inherited from an enclosing document (a
|
|
62
|
+
* body fragment sliced out of an envelope carries none of its own)
|
|
63
|
+
*/
|
|
64
|
+
export declare function scanXml(text: string, inScope?: Readonly<Record<string, string>>): ScanXmlResult;
|