@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,42 @@
|
|
|
1
|
+
import type { QName } from '../wsdl/qname.js';
|
|
2
|
+
import type { ElementDecl, ResolvedAttribute, SourceRef } from './model.js';
|
|
3
|
+
import type { SchemaSet } from './schema-set.js';
|
|
4
|
+
/** A half-open character range in a text document. */
|
|
5
|
+
export interface TextRange {
|
|
6
|
+
readonly start: number;
|
|
7
|
+
readonly end: number;
|
|
8
|
+
}
|
|
9
|
+
/** What the completion provider needs to offer children of the element the cursor is in. */
|
|
10
|
+
export interface CompletionContext {
|
|
11
|
+
/** Ancestor chain of the element that would contain the completed child, outermost first. */
|
|
12
|
+
readonly path: readonly QName[];
|
|
13
|
+
/** The (possibly empty) element name typed so far after `<`, including any prefix. */
|
|
14
|
+
readonly partial: string;
|
|
15
|
+
/** Namespace prefixes in scope at the cursor. */
|
|
16
|
+
readonly prefixes: Readonly<Record<string, string>>;
|
|
17
|
+
/** The range of `partial` in the document, to replace with the accepted completion. */
|
|
18
|
+
readonly replaceRange: TextRange;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Ancestor chain (outermost first) of the element containing `offset`,
|
|
22
|
+
* resolved to expanded QNames via the `xmlns` declarations in scope at that
|
|
23
|
+
* point in the text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function elementPathAt(text: string, offset: number): QName[];
|
|
26
|
+
/**
|
|
27
|
+
* Pure text analysis for the completion provider: detects an in-progress
|
|
28
|
+
* `<partial` element-name token ending at `offset` and reports the ancestor
|
|
29
|
+
* path, in-scope prefixes and the range to replace with the accepted item.
|
|
30
|
+
* Returns `undefined` when the cursor is not positioned right after an open
|
|
31
|
+
* `<` (e.g. mid-attribute, or not inside a tag at all).
|
|
32
|
+
*/
|
|
33
|
+
export declare function completionContextAt(text: string, offset: number): CompletionContext | undefined;
|
|
34
|
+
/** Element declarations legal as children of the element at `path`, in schema order (substitution members included). */
|
|
35
|
+
export declare function childrenAllowedAt(schemaSet: SchemaSet, path: readonly QName[]): ElementDecl[];
|
|
36
|
+
/** Attributes legal on the element at `path`. */
|
|
37
|
+
export declare function attributesAllowedAt(schemaSet: SchemaSet, path: readonly QName[]): readonly ResolvedAttribute[];
|
|
38
|
+
/** The declaration and source location of the element at `path`, or `undefined` when unresolvable. */
|
|
39
|
+
export declare function declarationOf(schemaSet: SchemaSet, path: readonly QName[]): {
|
|
40
|
+
readonly element: ElementDecl;
|
|
41
|
+
readonly source: SourceRef;
|
|
42
|
+
} | undefined;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { qnameEquals } from '../wsdl/qname.js';
|
|
2
|
+
const OPEN_TAG_RE = /<([^\s/!?>][^\s/>]*)((?:\s+[^<>]*)?)\s*(\/?)>/g;
|
|
3
|
+
const ATTR_RE = /([:\w.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
4
|
+
const XML_PREFIX = 'xml';
|
|
5
|
+
const XML_NS = 'http://www.w3.org/XML/1998/namespace';
|
|
6
|
+
/** Extracts `xmlns`/`xmlns:prefix` declarations from a tag's raw attribute text. */
|
|
7
|
+
function xmlnsDeclarations(rawAttrs) {
|
|
8
|
+
const decls = {};
|
|
9
|
+
const re = new RegExp(ATTR_RE);
|
|
10
|
+
let m;
|
|
11
|
+
while ((m = re.exec(rawAttrs)) !== null) {
|
|
12
|
+
const attrName = m[1];
|
|
13
|
+
const value = m[2] ?? m[3] ?? '';
|
|
14
|
+
if (attrName === 'xmlns') {
|
|
15
|
+
decls[''] = value;
|
|
16
|
+
}
|
|
17
|
+
else if (attrName.startsWith('xmlns:')) {
|
|
18
|
+
decls[attrName.slice('xmlns:'.length)] = value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return decls;
|
|
22
|
+
}
|
|
23
|
+
function resolvePrefixed(name, prefixes) {
|
|
24
|
+
const colon = name.indexOf(':');
|
|
25
|
+
if (colon === -1) {
|
|
26
|
+
return { namespaceUri: prefixes[''] ?? '', localName: name };
|
|
27
|
+
}
|
|
28
|
+
const prefix = name.slice(0, colon);
|
|
29
|
+
const localName = name.slice(colon + 1);
|
|
30
|
+
if (prefix === XML_PREFIX) {
|
|
31
|
+
return { namespaceUri: XML_NS, localName };
|
|
32
|
+
}
|
|
33
|
+
return { namespaceUri: prefixes[prefix] ?? '', localName };
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Walks open/close tags textually (never a DOM parse) to find the in-scope
|
|
37
|
+
* ancestor stack ending just before `offset`. Tolerant of an unfinished tag
|
|
38
|
+
* at the cursor: a `<…` with no closing `>` yet in the text simply does not
|
|
39
|
+
* match and is ignored.
|
|
40
|
+
*/
|
|
41
|
+
function scopeStackAt(text, offset) {
|
|
42
|
+
const stack = [];
|
|
43
|
+
const re = new RegExp(OPEN_TAG_RE);
|
|
44
|
+
let m;
|
|
45
|
+
while ((m = re.exec(text)) !== null) {
|
|
46
|
+
const matchEnd = m.index + m[0].length;
|
|
47
|
+
if (matchEnd > offset) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
const raw = m[0];
|
|
51
|
+
if (raw.startsWith('</')) {
|
|
52
|
+
// Tolerant of stray/mismatched close tags: just pop, since the source text
|
|
53
|
+
// up to the cursor is assumed well-formed for the purpose of this walk.
|
|
54
|
+
if (stack.length > 0) {
|
|
55
|
+
stack.pop();
|
|
56
|
+
}
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const name = m[1].replace(/^\//, '');
|
|
60
|
+
const rawAttrs = m[2] ?? '';
|
|
61
|
+
const selfClosing = m[3] === '/';
|
|
62
|
+
const parentPrefixes = stack.length > 0 ? stack[stack.length - 1].prefixes : {};
|
|
63
|
+
const ownDecls = xmlnsDeclarations(rawAttrs);
|
|
64
|
+
const prefixes = Object.keys(ownDecls).length > 0 ? { ...parentPrefixes, ...ownDecls } : parentPrefixes;
|
|
65
|
+
const qname = resolvePrefixed(name, prefixes);
|
|
66
|
+
if (!selfClosing) {
|
|
67
|
+
stack.push({ qname, prefixes });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return stack;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Ancestor chain (outermost first) of the element containing `offset`,
|
|
74
|
+
* resolved to expanded QNames via the `xmlns` declarations in scope at that
|
|
75
|
+
* point in the text.
|
|
76
|
+
*/
|
|
77
|
+
export function elementPathAt(text, offset) {
|
|
78
|
+
return scopeStackAt(text, offset).map((s) => s.qname);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Pure text analysis for the completion provider: detects an in-progress
|
|
82
|
+
* `<partial` element-name token ending at `offset` and reports the ancestor
|
|
83
|
+
* path, in-scope prefixes and the range to replace with the accepted item.
|
|
84
|
+
* Returns `undefined` when the cursor is not positioned right after an open
|
|
85
|
+
* `<` (e.g. mid-attribute, or not inside a tag at all).
|
|
86
|
+
*/
|
|
87
|
+
export function completionContextAt(text, offset) {
|
|
88
|
+
const before = text.slice(0, offset);
|
|
89
|
+
const ltIndex = before.lastIndexOf('<');
|
|
90
|
+
if (ltIndex === -1) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
const between = text.slice(ltIndex + 1, offset);
|
|
94
|
+
if (/[\s>/]/.test(between) || between.startsWith('/')) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
let end = offset;
|
|
98
|
+
while (end < text.length && /[\w:.-]/.test(text[end])) {
|
|
99
|
+
end += 1;
|
|
100
|
+
}
|
|
101
|
+
const path = elementPathAt(text, ltIndex);
|
|
102
|
+
const scope = scopeStackAt(text, ltIndex);
|
|
103
|
+
const prefixes = scope.length > 0 ? scope[scope.length - 1].prefixes : {};
|
|
104
|
+
return {
|
|
105
|
+
path,
|
|
106
|
+
partial: between,
|
|
107
|
+
prefixes,
|
|
108
|
+
replaceRange: { start: ltIndex + 1, end },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function resolveDeclType(schemaSet, decl) {
|
|
112
|
+
if (decl.type !== undefined) {
|
|
113
|
+
const type = schemaSet.lookupType(decl.type);
|
|
114
|
+
return type?.kind === 'complexType' ? type : undefined;
|
|
115
|
+
}
|
|
116
|
+
return decl.anonymousType?.kind === 'complexType' ? decl.anonymousType : undefined;
|
|
117
|
+
}
|
|
118
|
+
function findChildDecl(particle, schemaSet, name) {
|
|
119
|
+
switch (particle.kind) {
|
|
120
|
+
case 'localElement':
|
|
121
|
+
return qnameEquals(particle.decl.name, name) ? particle.decl : undefined;
|
|
122
|
+
case 'elementRef': {
|
|
123
|
+
const head = schemaSet.lookupElement(particle.ref);
|
|
124
|
+
if (head !== undefined && qnameEquals(head.name, name)) {
|
|
125
|
+
return head;
|
|
126
|
+
}
|
|
127
|
+
for (const sub of schemaSet.substitutionsFor(particle.ref)) {
|
|
128
|
+
if (qnameEquals(sub.name, name)) {
|
|
129
|
+
return sub;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
case 'sequence':
|
|
135
|
+
case 'choice':
|
|
136
|
+
case 'all':
|
|
137
|
+
for (const p of particle.particles) {
|
|
138
|
+
const found = findChildDecl(p, schemaSet, name);
|
|
139
|
+
if (found !== undefined) {
|
|
140
|
+
return found;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
case 'groupRef': {
|
|
145
|
+
const group = schemaSet.lookupGroup(particle.ref);
|
|
146
|
+
return group !== undefined ? findChildDecl(group.particle, schemaSet, name) : undefined;
|
|
147
|
+
}
|
|
148
|
+
case 'any':
|
|
149
|
+
return undefined;
|
|
150
|
+
default:
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function collectChildElements(particle, schemaSet, out) {
|
|
155
|
+
switch (particle.kind) {
|
|
156
|
+
case 'localElement':
|
|
157
|
+
out.push(particle.decl);
|
|
158
|
+
return;
|
|
159
|
+
case 'elementRef': {
|
|
160
|
+
const head = schemaSet.lookupElement(particle.ref);
|
|
161
|
+
if (head !== undefined) {
|
|
162
|
+
out.push(head);
|
|
163
|
+
}
|
|
164
|
+
for (const sub of schemaSet.substitutionsFor(particle.ref)) {
|
|
165
|
+
out.push(sub);
|
|
166
|
+
}
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
case 'sequence':
|
|
170
|
+
case 'choice':
|
|
171
|
+
case 'all':
|
|
172
|
+
for (const p of particle.particles) {
|
|
173
|
+
collectChildElements(p, schemaSet, out);
|
|
174
|
+
}
|
|
175
|
+
return;
|
|
176
|
+
case 'groupRef': {
|
|
177
|
+
const group = schemaSet.lookupGroup(particle.ref);
|
|
178
|
+
if (group !== undefined) {
|
|
179
|
+
collectChildElements(group.particle, schemaSet, out);
|
|
180
|
+
}
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
case 'any':
|
|
184
|
+
return;
|
|
185
|
+
default:
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/** Resolves the element declaration at the end of `path` by walking global elements through their content models. */
|
|
190
|
+
function resolveElementAt(schemaSet, path) {
|
|
191
|
+
if (path.length === 0) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
let decl = schemaSet.lookupElement(path[0]);
|
|
195
|
+
if (decl === undefined) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
for (let i = 1; i < path.length; i += 1) {
|
|
199
|
+
const type = resolveDeclType(schemaSet, decl);
|
|
200
|
+
if (type === undefined) {
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
const content = schemaSet.resolveContent(type);
|
|
204
|
+
if (content.particle === undefined) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
const child = findChildDecl(content.particle, schemaSet, path[i]);
|
|
208
|
+
if (child === undefined) {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
decl = child;
|
|
212
|
+
}
|
|
213
|
+
return decl;
|
|
214
|
+
}
|
|
215
|
+
/** Element declarations legal as children of the element at `path`, in schema order (substitution members included). */
|
|
216
|
+
export function childrenAllowedAt(schemaSet, path) {
|
|
217
|
+
const decl = resolveElementAt(schemaSet, path);
|
|
218
|
+
if (decl === undefined) {
|
|
219
|
+
return [];
|
|
220
|
+
}
|
|
221
|
+
const type = resolveDeclType(schemaSet, decl);
|
|
222
|
+
if (type === undefined) {
|
|
223
|
+
return [];
|
|
224
|
+
}
|
|
225
|
+
const content = schemaSet.resolveContent(type);
|
|
226
|
+
if (content.particle === undefined) {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
const out = [];
|
|
230
|
+
collectChildElements(content.particle, schemaSet, out);
|
|
231
|
+
return out;
|
|
232
|
+
}
|
|
233
|
+
/** Attributes legal on the element at `path`. */
|
|
234
|
+
export function attributesAllowedAt(schemaSet, path) {
|
|
235
|
+
const decl = resolveElementAt(schemaSet, path);
|
|
236
|
+
if (decl === undefined) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
const type = resolveDeclType(schemaSet, decl);
|
|
240
|
+
if (type === undefined) {
|
|
241
|
+
return [];
|
|
242
|
+
}
|
|
243
|
+
return schemaSet.resolveContent(type).attributes;
|
|
244
|
+
}
|
|
245
|
+
/** The declaration and source location of the element at `path`, or `undefined` when unresolvable. */
|
|
246
|
+
export function declarationOf(schemaSet, path) {
|
|
247
|
+
const decl = resolveElementAt(schemaSet, path);
|
|
248
|
+
return decl === undefined ? undefined : { element: decl, source: decl.source };
|
|
249
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { QName } from '../wsdl/qname.js';
|
|
2
|
+
/**
|
|
3
|
+
* Occurrence constraints of a particle (`minOccurs`/`maxOccurs`). Both default
|
|
4
|
+
* to `1`; `maxOccurs="unbounded"` is modelled as the literal `'unbounded'`.
|
|
5
|
+
*/
|
|
6
|
+
export interface Occurs {
|
|
7
|
+
readonly min: number;
|
|
8
|
+
readonly max: number | 'unbounded';
|
|
9
|
+
}
|
|
10
|
+
/** Where a schema component was declared, for diagnostics and "jump to source". */
|
|
11
|
+
export interface SourceRef {
|
|
12
|
+
/** Document location, or `'<inline>'` when the caller supplied bare schema elements. */
|
|
13
|
+
readonly location: string;
|
|
14
|
+
readonly line?: number;
|
|
15
|
+
readonly column?: number;
|
|
16
|
+
}
|
|
17
|
+
/** A wildcard's `processContents` mode. Defaults to `'strict'` in XSD 1.0. */
|
|
18
|
+
export type ProcessContents = 'strict' | 'lax' | 'skip';
|
|
19
|
+
/** How an attribute may appear on an element. */
|
|
20
|
+
export type AttributeUseKind = 'optional' | 'required' | 'prohibited';
|
|
21
|
+
/** A constraining facet on a simple type. */
|
|
22
|
+
export type Facet = {
|
|
23
|
+
readonly kind: 'enumeration';
|
|
24
|
+
readonly values: readonly string[];
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'pattern';
|
|
27
|
+
readonly value: string;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: 'length' | 'minLength' | 'maxLength' | 'totalDigits' | 'fractionDigits';
|
|
30
|
+
readonly value: number;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'minInclusive' | 'maxInclusive' | 'minExclusive' | 'maxExclusive';
|
|
33
|
+
readonly value: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'whiteSpace';
|
|
36
|
+
readonly value: 'preserve' | 'replace' | 'collapse';
|
|
37
|
+
};
|
|
38
|
+
/** A simple type definition (named or anonymous). */
|
|
39
|
+
export interface SimpleType {
|
|
40
|
+
readonly kind: 'simpleType';
|
|
41
|
+
/** Absent for an anonymous type declared inline in an element/attribute/list/union. */
|
|
42
|
+
readonly name?: QName;
|
|
43
|
+
readonly variety: 'atomic' | 'list' | 'union';
|
|
44
|
+
/** The `xs:restriction` base, for atomic varieties. */
|
|
45
|
+
readonly base?: QName;
|
|
46
|
+
/** An inline `xs:simpleType` used as the restriction base instead of `base`. */
|
|
47
|
+
readonly baseType?: SimpleType;
|
|
48
|
+
/** The list item type: a named reference or an inline definition. */
|
|
49
|
+
readonly itemType?: QName | SimpleType;
|
|
50
|
+
/** Union members, in declaration order: `memberTypes` first, then inline definitions. */
|
|
51
|
+
readonly memberTypes?: readonly (QName | SimpleType)[];
|
|
52
|
+
readonly facets: readonly Facet[];
|
|
53
|
+
readonly documentation?: string;
|
|
54
|
+
readonly source: SourceRef;
|
|
55
|
+
}
|
|
56
|
+
/** A global or local element declaration. */
|
|
57
|
+
export interface ElementDecl {
|
|
58
|
+
readonly kind: 'element';
|
|
59
|
+
readonly name: QName;
|
|
60
|
+
/** A reference to a named type; mutually exclusive with {@link ElementDecl.anonymousType}. */
|
|
61
|
+
readonly type?: QName;
|
|
62
|
+
/** An inline `xs:complexType`/`xs:simpleType`. */
|
|
63
|
+
readonly anonymousType?: ComplexType | SimpleType;
|
|
64
|
+
readonly nillable: boolean;
|
|
65
|
+
readonly abstract: boolean;
|
|
66
|
+
readonly substitutionGroup?: QName;
|
|
67
|
+
readonly default?: string;
|
|
68
|
+
readonly fixed?: string;
|
|
69
|
+
readonly documentation?: string;
|
|
70
|
+
readonly source: SourceRef;
|
|
71
|
+
}
|
|
72
|
+
/** An element declared inline inside a particle. */
|
|
73
|
+
export interface LocalElement {
|
|
74
|
+
readonly kind: 'localElement';
|
|
75
|
+
readonly decl: ElementDecl;
|
|
76
|
+
readonly occurs: Occurs;
|
|
77
|
+
}
|
|
78
|
+
/** An `<xs:element ref="…"/>` particle pointing at a global element declaration. */
|
|
79
|
+
export interface ElementRef {
|
|
80
|
+
readonly kind: 'elementRef';
|
|
81
|
+
readonly ref: QName;
|
|
82
|
+
readonly occurs: Occurs;
|
|
83
|
+
}
|
|
84
|
+
/** An `<xs:any/>` element wildcard. */
|
|
85
|
+
export interface AnyParticle {
|
|
86
|
+
readonly kind: 'any';
|
|
87
|
+
/** Raw `namespace` attribute, e.g. `##any`, `##other`, or a space-separated URI list. */
|
|
88
|
+
readonly namespace: string;
|
|
89
|
+
readonly processContents: ProcessContents;
|
|
90
|
+
readonly occurs: Occurs;
|
|
91
|
+
}
|
|
92
|
+
/** An `<xs:sequence>` compositor. */
|
|
93
|
+
export interface Sequence {
|
|
94
|
+
readonly kind: 'sequence';
|
|
95
|
+
readonly particles: readonly Particle[];
|
|
96
|
+
readonly occurs: Occurs;
|
|
97
|
+
}
|
|
98
|
+
/** An `<xs:choice>` compositor. */
|
|
99
|
+
export interface Choice {
|
|
100
|
+
readonly kind: 'choice';
|
|
101
|
+
readonly particles: readonly Particle[];
|
|
102
|
+
readonly occurs: Occurs;
|
|
103
|
+
}
|
|
104
|
+
/** An `<xs:all>` compositor. */
|
|
105
|
+
export interface All {
|
|
106
|
+
readonly kind: 'all';
|
|
107
|
+
readonly particles: readonly Particle[];
|
|
108
|
+
readonly occurs: Occurs;
|
|
109
|
+
}
|
|
110
|
+
/** An `<xs:group ref="…"/>` particle. */
|
|
111
|
+
export interface GroupRef {
|
|
112
|
+
readonly kind: 'groupRef';
|
|
113
|
+
readonly ref: QName;
|
|
114
|
+
readonly occurs: Occurs;
|
|
115
|
+
}
|
|
116
|
+
/** Any content-model particle. */
|
|
117
|
+
export type Particle = LocalElement | ElementRef | AnyParticle | Sequence | Choice | All | GroupRef;
|
|
118
|
+
/** A compositor particle (the only thing a named `xs:group` may contain). */
|
|
119
|
+
export type Compositor = Sequence | Choice | All;
|
|
120
|
+
/** A global or local attribute declaration. */
|
|
121
|
+
export interface AttributeDecl {
|
|
122
|
+
readonly kind: 'attribute';
|
|
123
|
+
readonly name: QName;
|
|
124
|
+
readonly type?: QName;
|
|
125
|
+
readonly anonymousType?: SimpleType;
|
|
126
|
+
readonly use: AttributeUseKind;
|
|
127
|
+
readonly default?: string;
|
|
128
|
+
readonly fixed?: string;
|
|
129
|
+
readonly documentation?: string;
|
|
130
|
+
readonly source: SourceRef;
|
|
131
|
+
}
|
|
132
|
+
/** An `<xs:attribute ref="…"/>` pointing at a global attribute declaration. */
|
|
133
|
+
export interface AttributeRef {
|
|
134
|
+
readonly kind: 'attributeRef';
|
|
135
|
+
readonly ref: QName;
|
|
136
|
+
readonly use: AttributeUseKind;
|
|
137
|
+
readonly default?: string;
|
|
138
|
+
readonly fixed?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The raw `wsdl:arrayType` value (e.g. `xs:string[]`) written on a
|
|
141
|
+
* `soapenc:arrayType` reference inside a SOAP-encoded array type. Kept
|
|
142
|
+
* verbatim because it is the only place the array's item type is recorded.
|
|
143
|
+
*/
|
|
144
|
+
readonly arrayType?: string;
|
|
145
|
+
}
|
|
146
|
+
/** An `<xs:attributeGroup ref="…"/>`. */
|
|
147
|
+
export interface AttributeGroupRef {
|
|
148
|
+
readonly kind: 'attributeGroupRef';
|
|
149
|
+
readonly ref: QName;
|
|
150
|
+
}
|
|
151
|
+
/** An `<xs:anyAttribute/>` wildcard. */
|
|
152
|
+
export interface AnyAttribute {
|
|
153
|
+
readonly kind: 'anyAttribute';
|
|
154
|
+
readonly namespace: string;
|
|
155
|
+
readonly processContents: ProcessContents;
|
|
156
|
+
}
|
|
157
|
+
/** Anything that may appear in a complex type's attribute list. */
|
|
158
|
+
export type AttributeUse = AttributeDecl | AttributeRef | AttributeGroupRef | AnyAttribute;
|
|
159
|
+
/** The content model of a complex type, discriminated by how it was declared. */
|
|
160
|
+
export type ComplexContentModel = {
|
|
161
|
+
readonly kind: 'empty';
|
|
162
|
+
readonly attributes: readonly AttributeUse[];
|
|
163
|
+
}
|
|
164
|
+
/** An implicit complex content: a compositor written directly under `xs:complexType`. */
|
|
165
|
+
| {
|
|
166
|
+
readonly kind: 'particle';
|
|
167
|
+
readonly particle: Particle;
|
|
168
|
+
readonly attributes: readonly AttributeUse[];
|
|
169
|
+
} | {
|
|
170
|
+
readonly kind: 'complexContent';
|
|
171
|
+
readonly derivation: 'extension' | 'restriction';
|
|
172
|
+
readonly base: QName;
|
|
173
|
+
readonly particle?: Particle;
|
|
174
|
+
readonly attributes: readonly AttributeUse[];
|
|
175
|
+
} | {
|
|
176
|
+
readonly kind: 'simpleContent';
|
|
177
|
+
readonly derivation: 'extension' | 'restriction';
|
|
178
|
+
readonly base: QName;
|
|
179
|
+
readonly attributes: readonly AttributeUse[];
|
|
180
|
+
/** Facets on a `simpleContent restriction`. */
|
|
181
|
+
readonly facets?: readonly Facet[];
|
|
182
|
+
};
|
|
183
|
+
/** A complex type definition (named or anonymous). */
|
|
184
|
+
export interface ComplexType {
|
|
185
|
+
readonly kind: 'complexType';
|
|
186
|
+
/** Absent for an anonymous type declared inline in an element declaration. */
|
|
187
|
+
readonly name?: QName;
|
|
188
|
+
readonly abstract: boolean;
|
|
189
|
+
readonly mixed: boolean;
|
|
190
|
+
readonly content: ComplexContentModel;
|
|
191
|
+
readonly documentation?: string;
|
|
192
|
+
readonly source: SourceRef;
|
|
193
|
+
}
|
|
194
|
+
/** Either kind of type definition. */
|
|
195
|
+
export type TypeDefinition = ComplexType | SimpleType;
|
|
196
|
+
/** A named model group (`xs:group`). */
|
|
197
|
+
export interface Group {
|
|
198
|
+
readonly kind: 'group';
|
|
199
|
+
readonly name: QName;
|
|
200
|
+
readonly particle: Compositor;
|
|
201
|
+
readonly documentation?: string;
|
|
202
|
+
readonly source: SourceRef;
|
|
203
|
+
}
|
|
204
|
+
/** A named attribute group (`xs:attributeGroup`). */
|
|
205
|
+
export interface AttributeGroup {
|
|
206
|
+
readonly kind: 'attributeGroup';
|
|
207
|
+
readonly name: QName;
|
|
208
|
+
readonly attributes: readonly AttributeUse[];
|
|
209
|
+
readonly documentation?: string;
|
|
210
|
+
readonly source: SourceRef;
|
|
211
|
+
}
|
|
212
|
+
/** A non-fatal problem found while building a {@link SchemaSet}. */
|
|
213
|
+
export interface SchemaProblem {
|
|
214
|
+
readonly code: 'unresolved-ref' | 'duplicate-component' | 'unsupported' | 'invalid-schema';
|
|
215
|
+
readonly message: string;
|
|
216
|
+
readonly location: string;
|
|
217
|
+
readonly line?: number;
|
|
218
|
+
readonly column?: number;
|
|
219
|
+
}
|
|
220
|
+
/** A single attribute after attribute groups and inheritance have been flattened. */
|
|
221
|
+
export interface ResolvedAttribute {
|
|
222
|
+
readonly name: QName;
|
|
223
|
+
readonly type?: QName;
|
|
224
|
+
readonly anonymousType?: SimpleType;
|
|
225
|
+
readonly use: 'optional' | 'required';
|
|
226
|
+
readonly default?: string;
|
|
227
|
+
readonly fixed?: string;
|
|
228
|
+
/** The `wsdl:arrayType` value carried by a `soapenc:arrayType` reference, if any. */
|
|
229
|
+
readonly arrayType?: string;
|
|
230
|
+
}
|
|
231
|
+
/** A complex type's effective content after derivation, groups and attribute groups are flattened. */
|
|
232
|
+
export interface ResolvedContent {
|
|
233
|
+
/**
|
|
234
|
+
* The effective particle: extension chains flattened base-first (wrapped in a
|
|
235
|
+
* synthetic `sequence` when needed), `groupRef`s expanded in place, and
|
|
236
|
+
* `all`/`choice` compositors kept as declared. Absent for empty content.
|
|
237
|
+
*/
|
|
238
|
+
readonly particle?: Particle;
|
|
239
|
+
/** Attributes from the whole derivation chain, deduped by name; prohibited ones removed. */
|
|
240
|
+
readonly attributes: readonly ResolvedAttribute[];
|
|
241
|
+
readonly mixed: boolean;
|
|
242
|
+
/** For `simpleContent` types: the ultimate simple base of the derivation chain. */
|
|
243
|
+
readonly simpleContentBase?: QName;
|
|
244
|
+
/** The effective attribute wildcard, if any level of the chain declares one. */
|
|
245
|
+
readonly anyAttribute?: {
|
|
246
|
+
readonly namespace: string;
|
|
247
|
+
readonly processContents: ProcessContents;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Element } from '@xmldom/xmldom';
|
|
2
|
+
import type { QName } from '../wsdl/qname.js';
|
|
3
|
+
import type { AttributeUse, ElementDecl, Facet, Occurs, Particle, ComplexType, SchemaProblem, SimpleType, SourceRef } from './model.js';
|
|
4
|
+
/** Parses an `xs:complexType` element; injected to break the particle/type parsing cycle. */
|
|
5
|
+
export type ParseComplexType = (element: Element, ctx: SchemaContext, name?: QName) => ComplexType;
|
|
6
|
+
/** Per-schema state threaded through parsing: where we are and how names qualify. */
|
|
7
|
+
export interface SchemaContext {
|
|
8
|
+
/** The document location the schema element came from, or `'<inline>'`. */
|
|
9
|
+
readonly location: string;
|
|
10
|
+
readonly targetNamespace: string;
|
|
11
|
+
readonly elementFormDefault: 'qualified' | 'unqualified';
|
|
12
|
+
readonly attributeFormDefault: 'qualified' | 'unqualified';
|
|
13
|
+
/** Sink for non-fatal problems; mutated during the build. */
|
|
14
|
+
readonly problems: SchemaProblem[];
|
|
15
|
+
}
|
|
16
|
+
/** Builds a {@link SourceRef} for `el` within `ctx`'s document. */
|
|
17
|
+
export declare function sourceRef(el: Element, ctx: SchemaContext): SourceRef;
|
|
18
|
+
/** Records a non-fatal problem positioned at `el`. */
|
|
19
|
+
export declare function addProblem(ctx: SchemaContext, code: SchemaProblem['code'], message: string, el: Element): void;
|
|
20
|
+
/**
|
|
21
|
+
* Reads a QName-valued attribute.
|
|
22
|
+
*
|
|
23
|
+
* Unprefixed values resolve to the in-scope XML default namespace (`xmlns="…"`)
|
|
24
|
+
* and, when none is declared, to no namespace — never to the schema's
|
|
25
|
+
* `targetNamespace`. That is the XSD rule, and differs from the lenient WSDL
|
|
26
|
+
* fallback, so `''` is passed as {@link parseQName}'s `defaultNamespace`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function readQName(el: Element, attribute: string, ctx: SchemaContext): QName | undefined;
|
|
29
|
+
/** Reads `minOccurs`/`maxOccurs`, defaulting both to 1. */
|
|
30
|
+
export declare function readOccurs(el: Element): Occurs;
|
|
31
|
+
/** Reads the trimmed text of an `xs:annotation/xs:documentation` child, if present. */
|
|
32
|
+
export declare function readAnnotation(el: Element): string | undefined;
|
|
33
|
+
/** Collects the facet children of an `xs:restriction`, merging repeated enumerations. */
|
|
34
|
+
export declare function parseFacets(restriction: Element): Facet[];
|
|
35
|
+
/** Parses an `xs:simpleType` element (named or anonymous). */
|
|
36
|
+
export declare function parseSimpleType(el: Element, ctx: SchemaContext, name?: QName): SimpleType;
|
|
37
|
+
/** Parses a single `xs:attribute` element into a declaration or a ref. */
|
|
38
|
+
export declare function parseAttribute(el: Element, ctx: SchemaContext, global: boolean): AttributeUse;
|
|
39
|
+
/** Collects every `attribute`/`attributeGroup ref`/`anyAttribute` child of `parent`, in order. */
|
|
40
|
+
export declare function parseAttributeUses(parent: Element, ctx: SchemaContext): AttributeUse[];
|
|
41
|
+
/** Parses an `xs:element` declaration; `global` elements always take the target namespace. */
|
|
42
|
+
export declare function parseElementDecl(el: Element, ctx: SchemaContext, global: boolean, parseComplexType: ParseComplexType): ElementDecl;
|
|
43
|
+
/** Parses a compositor (`sequence`/`choice`/`all`) or any other particle element. */
|
|
44
|
+
export declare function parseParticle(el: Element, ctx: SchemaContext, parseComplexType: ParseComplexType): Particle | undefined;
|
|
45
|
+
/** Parses every particle child of `parent`, skipping annotations and unknown elements. */
|
|
46
|
+
export declare function parseParticleChildren(parent: Element, ctx: SchemaContext, parseComplexType: ParseComplexType): Particle[];
|
|
47
|
+
/** Finds the first compositor child (`sequence`/`choice`/`all`/`group ref`) of `parent`. */
|
|
48
|
+
export declare function firstParticleChild(parent: Element): Element | undefined;
|