@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,320 @@
|
|
|
1
|
+
import { NS } from '../xml/namespaces.js';
|
|
2
|
+
import { getPosition } from '../xml/parse.js';
|
|
3
|
+
import { childElements, firstChildElement, optionalAttribute } from '../wsdl/dom-utils.js';
|
|
4
|
+
import { parseQName } from '../wsdl/qname.js';
|
|
5
|
+
/** Builds a {@link SourceRef} for `el` within `ctx`'s document. */
|
|
6
|
+
export function sourceRef(el, ctx) {
|
|
7
|
+
const pos = getPosition(el);
|
|
8
|
+
return { location: ctx.location, ...(pos !== undefined ? pos : {}) };
|
|
9
|
+
}
|
|
10
|
+
/** Records a non-fatal problem positioned at `el`. */
|
|
11
|
+
export function addProblem(ctx, code, message, el) {
|
|
12
|
+
const pos = getPosition(el);
|
|
13
|
+
ctx.problems.push({ code, message, location: ctx.location, ...(pos !== undefined ? pos : {}) });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reads a QName-valued attribute.
|
|
17
|
+
*
|
|
18
|
+
* Unprefixed values resolve to the in-scope XML default namespace (`xmlns="…"`)
|
|
19
|
+
* and, when none is declared, to no namespace — never to the schema's
|
|
20
|
+
* `targetNamespace`. That is the XSD rule, and differs from the lenient WSDL
|
|
21
|
+
* fallback, so `''` is passed as {@link parseQName}'s `defaultNamespace`.
|
|
22
|
+
*/
|
|
23
|
+
export function readQName(el, attribute, ctx) {
|
|
24
|
+
const raw = optionalAttribute(el, attribute);
|
|
25
|
+
if (raw === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
return parseQName(raw, el, '');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
addProblem(ctx, 'invalid-schema', `Cannot resolve QName "${raw}": ${String(error)}`, el);
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Reads `minOccurs`/`maxOccurs`, defaulting both to 1. */
|
|
37
|
+
export function readOccurs(el) {
|
|
38
|
+
const minRaw = optionalAttribute(el, 'minOccurs');
|
|
39
|
+
const maxRaw = optionalAttribute(el, 'maxOccurs');
|
|
40
|
+
const min = minRaw === undefined ? 1 : Number.parseInt(minRaw, 10);
|
|
41
|
+
const max = maxRaw === undefined ? 1 : maxRaw === 'unbounded' ? 'unbounded' : Number.parseInt(maxRaw, 10);
|
|
42
|
+
return {
|
|
43
|
+
min: Number.isFinite(min) ? min : 1,
|
|
44
|
+
max: max === 'unbounded' || Number.isFinite(max) ? max : 1,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Reads the trimmed text of an `xs:annotation/xs:documentation` child, if present. */
|
|
48
|
+
export function readAnnotation(el) {
|
|
49
|
+
const annotation = firstChildElement(el, NS.XSD, 'annotation');
|
|
50
|
+
if (annotation === undefined) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const doc = firstChildElement(annotation, NS.XSD, 'documentation');
|
|
54
|
+
const text = (doc?.textContent ?? '').trim();
|
|
55
|
+
return text.length > 0 ? text : undefined;
|
|
56
|
+
}
|
|
57
|
+
const NUMERIC_FACETS = new Set(['length', 'minLength', 'maxLength', 'totalDigits', 'fractionDigits']);
|
|
58
|
+
const LEXICAL_FACETS = new Set(['minInclusive', 'maxInclusive', 'minExclusive', 'maxExclusive']);
|
|
59
|
+
const WHITESPACE_VALUES = new Set(['preserve', 'replace', 'collapse']);
|
|
60
|
+
/** Collects the facet children of an `xs:restriction`, merging repeated enumerations. */
|
|
61
|
+
export function parseFacets(restriction) {
|
|
62
|
+
const facets = [];
|
|
63
|
+
const enumeration = [];
|
|
64
|
+
let child = restriction.firstChild;
|
|
65
|
+
while (child !== null) {
|
|
66
|
+
if (child.nodeType === 1) {
|
|
67
|
+
const el = child;
|
|
68
|
+
if (el.namespaceURI === NS.XSD) {
|
|
69
|
+
const value = optionalAttribute(el, 'value') ?? '';
|
|
70
|
+
const localName = el.localName ?? '';
|
|
71
|
+
if (localName === 'enumeration') {
|
|
72
|
+
enumeration.push(value);
|
|
73
|
+
}
|
|
74
|
+
else if (NUMERIC_FACETS.has(localName)) {
|
|
75
|
+
facets.push({ kind: localName, value: Number.parseInt(value, 10) });
|
|
76
|
+
}
|
|
77
|
+
else if (LEXICAL_FACETS.has(localName)) {
|
|
78
|
+
facets.push({ kind: localName, value });
|
|
79
|
+
}
|
|
80
|
+
else if (el.localName === 'pattern') {
|
|
81
|
+
facets.push({ kind: 'pattern', value });
|
|
82
|
+
}
|
|
83
|
+
else if (el.localName === 'whiteSpace' && WHITESPACE_VALUES.has(value)) {
|
|
84
|
+
facets.push({ kind: 'whiteSpace', value: value });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
child = child.nextSibling;
|
|
89
|
+
}
|
|
90
|
+
if (enumeration.length > 0) {
|
|
91
|
+
facets.unshift({ kind: 'enumeration', values: enumeration });
|
|
92
|
+
}
|
|
93
|
+
return facets;
|
|
94
|
+
}
|
|
95
|
+
/** Parses an `xs:simpleType` element (named or anonymous). */
|
|
96
|
+
export function parseSimpleType(el, ctx, name) {
|
|
97
|
+
const documentation = readAnnotation(el);
|
|
98
|
+
const common = {
|
|
99
|
+
kind: 'simpleType',
|
|
100
|
+
...(name !== undefined ? { name } : {}),
|
|
101
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
102
|
+
source: sourceRef(el, ctx),
|
|
103
|
+
};
|
|
104
|
+
const list = firstChildElement(el, NS.XSD, 'list');
|
|
105
|
+
if (list !== undefined) {
|
|
106
|
+
const itemTypeRef = readQName(list, 'itemType', ctx);
|
|
107
|
+
const inline = firstChildElement(list, NS.XSD, 'simpleType');
|
|
108
|
+
const itemType = itemTypeRef ?? (inline !== undefined ? parseSimpleType(inline, ctx) : undefined);
|
|
109
|
+
return { ...common, variety: 'list', ...(itemType !== undefined ? { itemType } : {}), facets: [] };
|
|
110
|
+
}
|
|
111
|
+
const union = firstChildElement(el, NS.XSD, 'union');
|
|
112
|
+
if (union !== undefined) {
|
|
113
|
+
const raw = optionalAttribute(union, 'memberTypes') ?? '';
|
|
114
|
+
const members = [];
|
|
115
|
+
for (const token of raw.split(/\s+/).filter((t) => t.length > 0)) {
|
|
116
|
+
try {
|
|
117
|
+
members.push(parseQName(token, union, ''));
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
addProblem(ctx, 'invalid-schema', `Cannot resolve union member "${token}": ${String(error)}`, union);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
for (const inline of childElements(union, NS.XSD, 'simpleType')) {
|
|
124
|
+
members.push(parseSimpleType(inline, ctx));
|
|
125
|
+
}
|
|
126
|
+
return { ...common, variety: 'union', memberTypes: members, facets: [] };
|
|
127
|
+
}
|
|
128
|
+
const restriction = firstChildElement(el, NS.XSD, 'restriction');
|
|
129
|
+
if (restriction === undefined) {
|
|
130
|
+
return { ...common, variety: 'atomic', facets: [] };
|
|
131
|
+
}
|
|
132
|
+
const base = readQName(restriction, 'base', ctx);
|
|
133
|
+
const inlineBase = firstChildElement(restriction, NS.XSD, 'simpleType');
|
|
134
|
+
return {
|
|
135
|
+
...common,
|
|
136
|
+
variety: 'atomic',
|
|
137
|
+
...(base !== undefined ? { base } : {}),
|
|
138
|
+
...(base === undefined && inlineBase !== undefined ? { baseType: parseSimpleType(inlineBase, ctx) } : {}),
|
|
139
|
+
facets: parseFacets(restriction),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function readUse(el) {
|
|
143
|
+
const raw = optionalAttribute(el, 'use');
|
|
144
|
+
return raw === 'required' || raw === 'prohibited' ? raw : 'optional';
|
|
145
|
+
}
|
|
146
|
+
/** Parses a single `xs:attribute` element into a declaration or a ref. */
|
|
147
|
+
export function parseAttribute(el, ctx, global) {
|
|
148
|
+
const use = readUse(el);
|
|
149
|
+
const defaultValue = optionalAttribute(el, 'default');
|
|
150
|
+
const fixedValue = optionalAttribute(el, 'fixed');
|
|
151
|
+
const ref = global ? undefined : readQName(el, 'ref', ctx);
|
|
152
|
+
if (ref !== undefined) {
|
|
153
|
+
// `wsdl:arrayType` on a `soapenc:arrayType` ref is the only record of an
|
|
154
|
+
// encoded array's item type, so it is preserved verbatim.
|
|
155
|
+
const arrayType = el.getAttributeNS(NS.WSDL, 'arrayType') ?? undefined;
|
|
156
|
+
return {
|
|
157
|
+
kind: 'attributeRef',
|
|
158
|
+
ref,
|
|
159
|
+
use,
|
|
160
|
+
...(defaultValue !== undefined ? { default: defaultValue } : {}),
|
|
161
|
+
...(fixedValue !== undefined ? { fixed: fixedValue } : {}),
|
|
162
|
+
...(arrayType !== undefined && arrayType !== '' ? { arrayType } : {}),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
const localName = optionalAttribute(el, 'name') ?? '';
|
|
166
|
+
const form = optionalAttribute(el, 'form');
|
|
167
|
+
const qualified = global || form === 'qualified' || (form === undefined && ctx.attributeFormDefault === 'qualified');
|
|
168
|
+
const type = readQName(el, 'type', ctx);
|
|
169
|
+
const inline = firstChildElement(el, NS.XSD, 'simpleType');
|
|
170
|
+
const documentation = readAnnotation(el);
|
|
171
|
+
const decl = {
|
|
172
|
+
kind: 'attribute',
|
|
173
|
+
name: { namespaceUri: qualified ? ctx.targetNamespace : '', localName },
|
|
174
|
+
...(type !== undefined ? { type } : {}),
|
|
175
|
+
...(type === undefined && inline !== undefined ? { anonymousType: parseSimpleType(inline, ctx) } : {}),
|
|
176
|
+
use,
|
|
177
|
+
...(defaultValue !== undefined ? { default: defaultValue } : {}),
|
|
178
|
+
...(fixedValue !== undefined ? { fixed: fixedValue } : {}),
|
|
179
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
180
|
+
source: sourceRef(el, ctx),
|
|
181
|
+
};
|
|
182
|
+
return decl;
|
|
183
|
+
}
|
|
184
|
+
function readProcessContents(el) {
|
|
185
|
+
const raw = optionalAttribute(el, 'processContents');
|
|
186
|
+
return raw === 'lax' || raw === 'skip' ? raw : 'strict';
|
|
187
|
+
}
|
|
188
|
+
function parseAnyAttribute(el) {
|
|
189
|
+
return {
|
|
190
|
+
kind: 'anyAttribute',
|
|
191
|
+
namespace: optionalAttribute(el, 'namespace') ?? '##any',
|
|
192
|
+
processContents: readProcessContents(el),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** Collects every `attribute`/`attributeGroup ref`/`anyAttribute` child of `parent`, in order. */
|
|
196
|
+
export function parseAttributeUses(parent, ctx) {
|
|
197
|
+
const uses = [];
|
|
198
|
+
let child = parent.firstChild;
|
|
199
|
+
while (child !== null) {
|
|
200
|
+
if (child.nodeType === 1) {
|
|
201
|
+
const el = child;
|
|
202
|
+
if (el.namespaceURI === NS.XSD) {
|
|
203
|
+
if (el.localName === 'attribute') {
|
|
204
|
+
uses.push(parseAttribute(el, ctx, false));
|
|
205
|
+
}
|
|
206
|
+
else if (el.localName === 'attributeGroup') {
|
|
207
|
+
const ref = readQName(el, 'ref', ctx);
|
|
208
|
+
if (ref !== undefined) {
|
|
209
|
+
uses.push({ kind: 'attributeGroupRef', ref });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else if (el.localName === 'anyAttribute') {
|
|
213
|
+
uses.push(parseAnyAttribute(el));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
child = child.nextSibling;
|
|
218
|
+
}
|
|
219
|
+
return uses;
|
|
220
|
+
}
|
|
221
|
+
/** Parses an `xs:element` declaration; `global` elements always take the target namespace. */
|
|
222
|
+
export function parseElementDecl(el, ctx, global, parseComplexType) {
|
|
223
|
+
const localName = optionalAttribute(el, 'name') ?? '';
|
|
224
|
+
const form = optionalAttribute(el, 'form');
|
|
225
|
+
const qualified = global || form === 'qualified' || (form === undefined && ctx.elementFormDefault === 'qualified');
|
|
226
|
+
const type = readQName(el, 'type', ctx);
|
|
227
|
+
const inlineComplex = firstChildElement(el, NS.XSD, 'complexType');
|
|
228
|
+
const inlineSimple = firstChildElement(el, NS.XSD, 'simpleType');
|
|
229
|
+
const substitutionGroup = readQName(el, 'substitutionGroup', ctx);
|
|
230
|
+
const defaultValue = optionalAttribute(el, 'default');
|
|
231
|
+
const fixedValue = optionalAttribute(el, 'fixed');
|
|
232
|
+
const documentation = readAnnotation(el);
|
|
233
|
+
const anonymousType = type !== undefined
|
|
234
|
+
? undefined
|
|
235
|
+
: inlineComplex !== undefined
|
|
236
|
+
? parseComplexType(inlineComplex, ctx)
|
|
237
|
+
: inlineSimple !== undefined
|
|
238
|
+
? parseSimpleType(inlineSimple, ctx)
|
|
239
|
+
: undefined;
|
|
240
|
+
return {
|
|
241
|
+
kind: 'element',
|
|
242
|
+
name: { namespaceUri: qualified ? ctx.targetNamespace : '', localName },
|
|
243
|
+
...(type !== undefined ? { type } : {}),
|
|
244
|
+
...(anonymousType !== undefined ? { anonymousType } : {}),
|
|
245
|
+
nillable: optionalAttribute(el, 'nillable') === 'true',
|
|
246
|
+
abstract: optionalAttribute(el, 'abstract') === 'true',
|
|
247
|
+
...(substitutionGroup !== undefined ? { substitutionGroup } : {}),
|
|
248
|
+
...(defaultValue !== undefined ? { default: defaultValue } : {}),
|
|
249
|
+
...(fixedValue !== undefined ? { fixed: fixedValue } : {}),
|
|
250
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
251
|
+
source: sourceRef(el, ctx),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/** Parses a compositor (`sequence`/`choice`/`all`) or any other particle element. */
|
|
255
|
+
export function parseParticle(el, ctx, parseComplexType) {
|
|
256
|
+
const occurs = readOccurs(el);
|
|
257
|
+
switch (el.localName) {
|
|
258
|
+
case 'sequence':
|
|
259
|
+
case 'choice':
|
|
260
|
+
case 'all':
|
|
261
|
+
return {
|
|
262
|
+
kind: el.localName,
|
|
263
|
+
particles: parseParticleChildren(el, ctx, parseComplexType),
|
|
264
|
+
occurs,
|
|
265
|
+
};
|
|
266
|
+
case 'group': {
|
|
267
|
+
const ref = readQName(el, 'ref', ctx);
|
|
268
|
+
return ref !== undefined ? { kind: 'groupRef', ref, occurs } : undefined;
|
|
269
|
+
}
|
|
270
|
+
case 'any':
|
|
271
|
+
return {
|
|
272
|
+
kind: 'any',
|
|
273
|
+
namespace: optionalAttribute(el, 'namespace') ?? '##any',
|
|
274
|
+
processContents: readProcessContents(el),
|
|
275
|
+
occurs,
|
|
276
|
+
};
|
|
277
|
+
case 'element': {
|
|
278
|
+
const ref = readQName(el, 'ref', ctx);
|
|
279
|
+
if (ref !== undefined) {
|
|
280
|
+
return { kind: 'elementRef', ref, occurs };
|
|
281
|
+
}
|
|
282
|
+
return { kind: 'localElement', decl: parseElementDecl(el, ctx, false, parseComplexType), occurs };
|
|
283
|
+
}
|
|
284
|
+
default:
|
|
285
|
+
return undefined;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/** Parses every particle child of `parent`, skipping annotations and unknown elements. */
|
|
289
|
+
export function parseParticleChildren(parent, ctx, parseComplexType) {
|
|
290
|
+
const particles = [];
|
|
291
|
+
let child = parent.firstChild;
|
|
292
|
+
while (child !== null) {
|
|
293
|
+
if (child.nodeType === 1) {
|
|
294
|
+
const el = child;
|
|
295
|
+
if (el.namespaceURI === NS.XSD) {
|
|
296
|
+
const particle = parseParticle(el, ctx, parseComplexType);
|
|
297
|
+
if (particle !== undefined) {
|
|
298
|
+
particles.push(particle);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
child = child.nextSibling;
|
|
303
|
+
}
|
|
304
|
+
return particles;
|
|
305
|
+
}
|
|
306
|
+
/** Finds the first compositor child (`sequence`/`choice`/`all`/`group ref`) of `parent`. */
|
|
307
|
+
export function firstParticleChild(parent) {
|
|
308
|
+
let child = parent.firstChild;
|
|
309
|
+
while (child !== null) {
|
|
310
|
+
if (child.nodeType === 1) {
|
|
311
|
+
const el = child;
|
|
312
|
+
if (el.namespaceURI === NS.XSD &&
|
|
313
|
+
(el.localName === 'sequence' || el.localName === 'choice' || el.localName === 'all' || el.localName === 'group')) {
|
|
314
|
+
return el;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
child = child.nextSibling;
|
|
318
|
+
}
|
|
319
|
+
return undefined;
|
|
320
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Element } from '@xmldom/xmldom';
|
|
2
|
+
import type { QName } from '../wsdl/qname.js';
|
|
3
|
+
import type { AttributeDecl, AttributeGroup, ComplexType, ElementDecl, Group, SimpleType } from './model.js';
|
|
4
|
+
import type { SchemaContext } from './parse-particles.js';
|
|
5
|
+
/** The global components declared by one `xs:schema` element. */
|
|
6
|
+
export interface SchemaComponents {
|
|
7
|
+
readonly elements: readonly ElementDecl[];
|
|
8
|
+
readonly types: readonly (ComplexType | SimpleType)[];
|
|
9
|
+
readonly groups: readonly Group[];
|
|
10
|
+
readonly attributeGroups: readonly AttributeGroup[];
|
|
11
|
+
readonly attributes: readonly AttributeDecl[];
|
|
12
|
+
}
|
|
13
|
+
/** Parses an `xs:complexType` element (named when `name` is given, anonymous otherwise). */
|
|
14
|
+
export declare function parseComplexType(el: Element, ctx: SchemaContext, name?: QName): ComplexType;
|
|
15
|
+
/**
|
|
16
|
+
* Parses the global components of one `xs:schema` element.
|
|
17
|
+
*
|
|
18
|
+
* `xs:import`/`xs:include` are ignored (the bundle already resolved them);
|
|
19
|
+
* `xs:redefine` records an `unsupported` problem and its content is skipped.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseSchemaElement(schemaEl: Element, ctx: SchemaContext): SchemaComponents;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { NS } from '../xml/namespaces.js';
|
|
2
|
+
import { childElements, firstChildElement, optionalAttribute } from '../wsdl/dom-utils.js';
|
|
3
|
+
import { addProblem, parseAttribute, firstParticleChild, parseAttributeUses, parseElementDecl, parseFacets, parseParticle, parseSimpleType, readAnnotation, readQName, sourceRef, } from './parse-particles.js';
|
|
4
|
+
function parseDerivedContent(derivationEl, ctx, wrapper, derivation) {
|
|
5
|
+
const base = readQName(derivationEl, 'base', ctx) ?? { namespaceUri: '', localName: '' };
|
|
6
|
+
const attributes = parseAttributeUses(derivationEl, ctx);
|
|
7
|
+
if (wrapper === 'simpleContent') {
|
|
8
|
+
const facets = derivation === 'restriction' ? parseFacets(derivationEl) : [];
|
|
9
|
+
return {
|
|
10
|
+
kind: 'simpleContent',
|
|
11
|
+
derivation,
|
|
12
|
+
base,
|
|
13
|
+
attributes,
|
|
14
|
+
...(facets.length > 0 ? { facets } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const particleEl = firstParticleChild(derivationEl);
|
|
18
|
+
const particle = particleEl !== undefined ? parseParticle(particleEl, ctx, parseComplexType) : undefined;
|
|
19
|
+
return {
|
|
20
|
+
kind: 'complexContent',
|
|
21
|
+
derivation,
|
|
22
|
+
base,
|
|
23
|
+
...(particle !== undefined ? { particle } : {}),
|
|
24
|
+
attributes,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Parses an `xs:complexType` element (named when `name` is given, anonymous otherwise). */
|
|
28
|
+
export function parseComplexType(el, ctx, name) {
|
|
29
|
+
const documentation = readAnnotation(el);
|
|
30
|
+
const common = {
|
|
31
|
+
kind: 'complexType',
|
|
32
|
+
...(name !== undefined ? { name } : {}),
|
|
33
|
+
abstract: optionalAttribute(el, 'abstract') === 'true',
|
|
34
|
+
mixed: optionalAttribute(el, 'mixed') === 'true',
|
|
35
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
36
|
+
source: sourceRef(el, ctx),
|
|
37
|
+
};
|
|
38
|
+
for (const wrapper of ['complexContent', 'simpleContent']) {
|
|
39
|
+
const wrapperEl = firstChildElement(el, NS.XSD, wrapper);
|
|
40
|
+
if (wrapperEl === undefined) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
// `mixed` may also be declared on `xs:complexContent`.
|
|
44
|
+
const mixed = common.mixed || optionalAttribute(wrapperEl, 'mixed') === 'true';
|
|
45
|
+
for (const derivation of ['extension', 'restriction']) {
|
|
46
|
+
const derivationEl = firstChildElement(wrapperEl, NS.XSD, derivation);
|
|
47
|
+
if (derivationEl !== undefined) {
|
|
48
|
+
return { ...common, mixed, content: parseDerivedContent(derivationEl, ctx, wrapper, derivation) };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
addProblem(ctx, 'invalid-schema', `<xs:${wrapper}> without extension or restriction`, wrapperEl);
|
|
52
|
+
return { ...common, mixed, content: { kind: 'empty', attributes: [] } };
|
|
53
|
+
}
|
|
54
|
+
const attributes = parseAttributeUses(el, ctx);
|
|
55
|
+
const particleEl = firstParticleChild(el);
|
|
56
|
+
const particle = particleEl !== undefined ? parseParticle(particleEl, ctx, parseComplexType) : undefined;
|
|
57
|
+
if (particle === undefined) {
|
|
58
|
+
return { ...common, content: { kind: 'empty', attributes } };
|
|
59
|
+
}
|
|
60
|
+
return { ...common, content: { kind: 'particle', particle, attributes } };
|
|
61
|
+
}
|
|
62
|
+
function parseGroup(el, ctx, name) {
|
|
63
|
+
const particleEl = firstParticleChild(el);
|
|
64
|
+
const particle = particleEl !== undefined ? parseParticle(particleEl, ctx, parseComplexType) : undefined;
|
|
65
|
+
if (particle === undefined || particle.kind === 'groupRef') {
|
|
66
|
+
addProblem(ctx, 'invalid-schema', `<xs:group name="${name.localName}"> has no compositor child`, el);
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
const documentation = readAnnotation(el);
|
|
70
|
+
return {
|
|
71
|
+
kind: 'group',
|
|
72
|
+
name,
|
|
73
|
+
particle: particle,
|
|
74
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
75
|
+
source: sourceRef(el, ctx),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Parses the global components of one `xs:schema` element.
|
|
80
|
+
*
|
|
81
|
+
* `xs:import`/`xs:include` are ignored (the bundle already resolved them);
|
|
82
|
+
* `xs:redefine` records an `unsupported` problem and its content is skipped.
|
|
83
|
+
*/
|
|
84
|
+
export function parseSchemaElement(schemaEl, ctx) {
|
|
85
|
+
const elements = [];
|
|
86
|
+
const types = [];
|
|
87
|
+
const groups = [];
|
|
88
|
+
const attributeGroups = [];
|
|
89
|
+
const attributes = [];
|
|
90
|
+
for (const child of childElements(schemaEl, NS.XSD, 'redefine')) {
|
|
91
|
+
addProblem(ctx, 'unsupported', 'xs:redefine is not supported; its content is ignored', child);
|
|
92
|
+
}
|
|
93
|
+
let child = schemaEl.firstChild;
|
|
94
|
+
while (child !== null) {
|
|
95
|
+
if (child.nodeType === 1) {
|
|
96
|
+
const el = child;
|
|
97
|
+
if (el.namespaceURI === NS.XSD) {
|
|
98
|
+
const localName = optionalAttribute(el, 'name');
|
|
99
|
+
const name = { namespaceUri: ctx.targetNamespace, localName: localName ?? '' };
|
|
100
|
+
switch (el.localName) {
|
|
101
|
+
case 'element':
|
|
102
|
+
elements.push(parseElementDecl(el, ctx, true, parseComplexType));
|
|
103
|
+
break;
|
|
104
|
+
case 'complexType':
|
|
105
|
+
types.push(parseComplexType(el, ctx, name));
|
|
106
|
+
break;
|
|
107
|
+
case 'simpleType':
|
|
108
|
+
types.push(parseSimpleType(el, ctx, name));
|
|
109
|
+
break;
|
|
110
|
+
case 'group': {
|
|
111
|
+
const group = parseGroup(el, ctx, name);
|
|
112
|
+
if (group !== undefined) {
|
|
113
|
+
groups.push(group);
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case 'attributeGroup': {
|
|
118
|
+
const documentation = readAnnotation(el);
|
|
119
|
+
attributeGroups.push({
|
|
120
|
+
kind: 'attributeGroup',
|
|
121
|
+
name,
|
|
122
|
+
attributes: parseAttributeUses(el, ctx),
|
|
123
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
124
|
+
source: sourceRef(el, ctx),
|
|
125
|
+
});
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case 'attribute': {
|
|
129
|
+
const parsed = parseAttribute(el, ctx, true);
|
|
130
|
+
if (parsed.kind === 'attribute') {
|
|
131
|
+
attributes.push(parsed);
|
|
132
|
+
}
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
default:
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
child = child.nextSibling;
|
|
141
|
+
}
|
|
142
|
+
return { elements, types, groups, attributeGroups, attributes };
|
|
143
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QName } from '../wsdl/qname.js';
|
|
2
|
+
import type { AttributeGroup, ComplexType, Group, ResolvedContent, TypeDefinition } from './model.js';
|
|
3
|
+
/** The lookups {@link resolveContent} needs; satisfied by the built `SchemaSet`. */
|
|
4
|
+
export interface ResolutionContext {
|
|
5
|
+
lookupType(name: QName): TypeDefinition | undefined;
|
|
6
|
+
lookupGroup(name: QName): Group | undefined;
|
|
7
|
+
lookupAttributeGroup(name: QName): AttributeGroup | undefined;
|
|
8
|
+
lookupAttribute(name: QName): import('./model.js').AttributeDecl | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Computes a complex type's effective content: extension chains flattened
|
|
12
|
+
* base-first, `groupRef`s expanded in place, attribute groups and inherited
|
|
13
|
+
* attributes merged (later declarations win, `prohibited` ones removed).
|
|
14
|
+
*
|
|
15
|
+
* Cycle-safe: a base chain that loops back on itself stops at the repeat, and
|
|
16
|
+
* recursive element declarations are left as references rather than expanded.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveContent(type: ComplexType, ctx: ResolutionContext): ResolvedContent;
|