@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,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Recreate Request": merge a freshly generated envelope
|
|
3
|
+
* (the source of structure) with an existing edited envelope (the source of
|
|
4
|
+
* values), by matching elements on a root-relative path of
|
|
5
|
+
* `localName[siblingIndex]` steps rather than by DOM identity.
|
|
6
|
+
*/
|
|
7
|
+
import { scanXml } from '../xsd/xml-scan.js';
|
|
8
|
+
import { formatXml } from '../xml/pretty.js';
|
|
9
|
+
function pathKey(path) {
|
|
10
|
+
return path.join('/');
|
|
11
|
+
}
|
|
12
|
+
/** Builds a map from root-relative path → element, for every element in the tree(s). */
|
|
13
|
+
function indexByPath(roots) {
|
|
14
|
+
const map = new Map();
|
|
15
|
+
const walk = (elements, parentPath) => {
|
|
16
|
+
const counts = new Map();
|
|
17
|
+
for (const el of elements) {
|
|
18
|
+
const n = (counts.get(el.localName) ?? 0) + 1;
|
|
19
|
+
counts.set(el.localName, n);
|
|
20
|
+
const step = `${el.localName}[${n}]`;
|
|
21
|
+
const path = [...parentPath, step];
|
|
22
|
+
map.set(pathKey(path), el);
|
|
23
|
+
walk(el.children, path);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
walk(roots, []);
|
|
27
|
+
return map;
|
|
28
|
+
}
|
|
29
|
+
/** Counts every removed element in `current` (present, absent from `generated`) recursively. */
|
|
30
|
+
function countRemoved(currentRoots, generatedIndex, parentPath) {
|
|
31
|
+
let removed = 0;
|
|
32
|
+
const counts = new Map();
|
|
33
|
+
for (const el of currentRoots) {
|
|
34
|
+
const n = (counts.get(el.localName) ?? 0) + 1;
|
|
35
|
+
counts.set(el.localName, n);
|
|
36
|
+
const step = `${el.localName}[${n}]`;
|
|
37
|
+
const path = [...parentPath, step];
|
|
38
|
+
if (generatedIndex.has(pathKey(path))) {
|
|
39
|
+
removed += countRemoved(el.children, generatedIndex, path);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
removed += 1 + countAll(el.children);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return removed;
|
|
46
|
+
}
|
|
47
|
+
function countAll(elements) {
|
|
48
|
+
let n = 0;
|
|
49
|
+
for (const el of elements) {
|
|
50
|
+
n += 1 + countAll(el.children);
|
|
51
|
+
}
|
|
52
|
+
return n;
|
|
53
|
+
}
|
|
54
|
+
/** Splices `[value, at range]` replacements into `text`, applied back-to-front so ranges stay valid. */
|
|
55
|
+
function applyReplacements(text, replacements) {
|
|
56
|
+
const sorted = [...replacements].sort((a, b) => b.start - a.start);
|
|
57
|
+
let out = text;
|
|
58
|
+
for (const r of sorted) {
|
|
59
|
+
out = out.slice(0, r.start) + r.value + out.slice(r.end);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
function escapeXmlText(value) {
|
|
64
|
+
return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
65
|
+
}
|
|
66
|
+
function escapeXmlAttr(value) {
|
|
67
|
+
return escapeXmlText(value).replace(/"/g, '"');
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Merges `generatedXml` (structure) with `currentXml` (values), per the
|
|
71
|
+
* "Recreate Request" semantics.
|
|
72
|
+
*/
|
|
73
|
+
export function recreateRequest(currentXml, generatedXml, options) {
|
|
74
|
+
const { keepValues, keepHeaders } = options;
|
|
75
|
+
const currentScan = scanXml(currentXml);
|
|
76
|
+
const generatedScan = scanXml(generatedXml);
|
|
77
|
+
const currentEnvelope = currentScan.elements.find((e) => e.localName === 'Envelope');
|
|
78
|
+
const generatedEnvelope = generatedScan.elements.find((e) => e.localName === 'Envelope');
|
|
79
|
+
if (generatedEnvelope === undefined) {
|
|
80
|
+
return { xml: formatXml(generatedXml).text, kept: 0, added: 0, removed: 0 };
|
|
81
|
+
}
|
|
82
|
+
if (currentEnvelope === undefined) {
|
|
83
|
+
return { xml: formatXml(generatedXml).text, kept: 0, added: countAll(generatedEnvelope.children), removed: 0 };
|
|
84
|
+
}
|
|
85
|
+
const currentIndex = indexByPath(currentEnvelope.children);
|
|
86
|
+
const generatedIndex = indexByPath(generatedEnvelope.children);
|
|
87
|
+
let kept = 0;
|
|
88
|
+
const replacements = [];
|
|
89
|
+
const walkGenerated = (elements, parentPath) => {
|
|
90
|
+
const counts = new Map();
|
|
91
|
+
for (const el of elements) {
|
|
92
|
+
const n = (counts.get(el.localName) ?? 0) + 1;
|
|
93
|
+
counts.set(el.localName, n);
|
|
94
|
+
const step = `${el.localName}[${n}]`;
|
|
95
|
+
const path = [...parentPath, step];
|
|
96
|
+
const key = pathKey(path);
|
|
97
|
+
const currentEl = currentIndex.get(key);
|
|
98
|
+
if (currentEl === undefined) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
// Leaf element (no children in generated): copy text value if present in current.
|
|
102
|
+
if (el.children.length === 0) {
|
|
103
|
+
if (keepValues && currentEl.text !== undefined && el.text !== undefined) {
|
|
104
|
+
const currentValue = currentEl.text.value;
|
|
105
|
+
const generatedValue = el.text.value;
|
|
106
|
+
if (currentValue !== generatedValue) {
|
|
107
|
+
replacements.push({
|
|
108
|
+
start: el.text.range.start,
|
|
109
|
+
end: el.text.range.end,
|
|
110
|
+
value: escapeXmlText(currentValue),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
kept += 1;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
walkGenerated(el.children, path);
|
|
118
|
+
}
|
|
119
|
+
// Attributes: copy matching attribute values from current.
|
|
120
|
+
if (keepValues) {
|
|
121
|
+
for (const attr of el.attributes) {
|
|
122
|
+
const currentAttr = currentEl.attributes.find((a) => a.name === attr.name);
|
|
123
|
+
if (currentAttr !== undefined && currentAttr.value !== attr.value) {
|
|
124
|
+
replacements.push({
|
|
125
|
+
start: attr.valueRange.start,
|
|
126
|
+
end: attr.valueRange.end,
|
|
127
|
+
value: escapeXmlAttr(currentAttr.value),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
walkGenerated(generatedEnvelope.children, []);
|
|
135
|
+
let added = 0;
|
|
136
|
+
const countAdded = (elements, parentPath) => {
|
|
137
|
+
const counts = new Map();
|
|
138
|
+
for (const el of elements) {
|
|
139
|
+
const n = (counts.get(el.localName) ?? 0) + 1;
|
|
140
|
+
counts.set(el.localName, n);
|
|
141
|
+
const step = `${el.localName}[${n}]`;
|
|
142
|
+
const path = [...parentPath, step];
|
|
143
|
+
if (currentIndex.has(pathKey(path))) {
|
|
144
|
+
countAdded(el.children, path);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
added += 1 + countAll(el.children);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
countAdded(generatedEnvelope.children, []);
|
|
152
|
+
const removed = countRemoved(currentEnvelope.children, generatedIndex, []);
|
|
153
|
+
let mergedXml = applyReplacements(generatedXml, replacements);
|
|
154
|
+
if (keepHeaders) {
|
|
155
|
+
const currentHeader = currentEnvelope.children.find((e) => e.localName === 'Header');
|
|
156
|
+
const generatedHeaderInMerged = scanXml(mergedXml)
|
|
157
|
+
.elements.find((e) => e.localName === 'Envelope')
|
|
158
|
+
?.children.find((e) => e.localName === 'Header');
|
|
159
|
+
if (currentHeader !== undefined && generatedHeaderInMerged !== undefined) {
|
|
160
|
+
const headerText = currentXml.slice(currentHeader.range.start, currentHeader.range.end);
|
|
161
|
+
mergedXml =
|
|
162
|
+
mergedXml.slice(0, generatedHeaderInMerged.range.start) +
|
|
163
|
+
headerText +
|
|
164
|
+
mergedXml.slice(generatedHeaderInMerged.range.end);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return { xml: formatXml(mergedXml).text, kept, added, removed };
|
|
168
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the complete sample SOAP request for one binding operation — the
|
|
3
|
+
* envelope the user sees immediately after importing a WSDL.
|
|
4
|
+
*/
|
|
5
|
+
import type { WsdlDefinition } from '../wsdl/model.js';
|
|
6
|
+
import type { QName } from '../wsdl/qname.js';
|
|
7
|
+
import type { GenerateOptions } from '../xsd/sample-generator.js';
|
|
8
|
+
import type { SchemaSet } from '../xsd/schema-set.js';
|
|
9
|
+
import type { BuildProblem } from './build-problems.js';
|
|
10
|
+
import type { SoapEnvelopeVersion } from './envelope.js';
|
|
11
|
+
import type { SoapActionOptions } from './soap-action.js';
|
|
12
|
+
/** Identifies one operation of one binding. */
|
|
13
|
+
export interface OperationRef {
|
|
14
|
+
readonly bindingName: QName;
|
|
15
|
+
readonly operationName: string;
|
|
16
|
+
}
|
|
17
|
+
/** The parsed WSDL and its compiled schemas — everything a request is built from. */
|
|
18
|
+
export interface RequestBuildInput {
|
|
19
|
+
readonly definition: WsdlDefinition;
|
|
20
|
+
readonly schemaSet: SchemaSet;
|
|
21
|
+
}
|
|
22
|
+
/** A generated request: the envelope plus the transport metadata that must accompany it. */
|
|
23
|
+
export interface GeneratedRequest {
|
|
24
|
+
readonly envelopeXml: string;
|
|
25
|
+
readonly soapVersion: SoapEnvelopeVersion;
|
|
26
|
+
/** The binding's `soapAction`, when it declares one. */
|
|
27
|
+
readonly soapAction?: string;
|
|
28
|
+
readonly contentType: string;
|
|
29
|
+
/** Action-carrying headers (SOAP 1.1's `SOAPAction`); never includes `Content-Type`. */
|
|
30
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
31
|
+
/** Everything that could not be built; empty for a fully resolved operation. */
|
|
32
|
+
readonly problems: readonly BuildProblem[];
|
|
33
|
+
}
|
|
34
|
+
/** Options accepted by {@link buildSampleRequest} beyond the generator's own. */
|
|
35
|
+
export interface RequestBuildOptions extends SoapActionOptions {
|
|
36
|
+
/** Indent per level; three spaces by default. */
|
|
37
|
+
readonly indent?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Builds the sample SOAP request for one binding operation.
|
|
41
|
+
*
|
|
42
|
+
* The builder never throws for a modelling problem: it always returns an
|
|
43
|
+
* envelope (an empty one in the worst case) and reports what went wrong in
|
|
44
|
+
* {@link GeneratedRequest.problems}, so the UI can show a partial request.
|
|
45
|
+
*
|
|
46
|
+
* Every namespace used anywhere in the envelope is declared once on the
|
|
47
|
+
* `soapenv:Envelope` element with a short mnemonic prefix
|
|
48
|
+
* (`http://tempuri.org/` → `tem`); the fragments inside carry none.
|
|
49
|
+
*
|
|
50
|
+
* Deterministic: identical inputs always produce byte-identical output.
|
|
51
|
+
*
|
|
52
|
+
* @param input the parsed WSDL definition and its compiled schema set
|
|
53
|
+
* @param op which operation of which binding to build
|
|
54
|
+
* @param genOptions sample-generator options (optional elements, sample values, depth, prefixes)
|
|
55
|
+
* @param options indent plus SOAP action/`Content-Type` knobs
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildSampleRequest(input: RequestBuildInput, op: OperationRef, genOptions?: Partial<GenerateOptions>, options?: RequestBuildOptions): GeneratedRequest;
|
|
58
|
+
/**
|
|
59
|
+
* Builds an empty envelope for one binding operation — the "Create Empty"
|
|
60
|
+
* request. The envelope carries an empty `Header` and `Body`, while the SOAP
|
|
61
|
+
* version, action and `Content-Type` are exactly those of a sample request.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildEmptyRequest(input: RequestBuildInput, op: OperationRef, options?: RequestBuildOptions): GeneratedRequest;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the complete sample SOAP request for one binding operation — the
|
|
3
|
+
* envelope the user sees immediately after importing a WSDL.
|
|
4
|
+
*/
|
|
5
|
+
import { findBinding, findMessage, findPortType } from '../wsdl/model.js';
|
|
6
|
+
import { qnameToString } from '../wsdl/qname.js';
|
|
7
|
+
import { buildBody, buildHeaders } from './body-builder.js';
|
|
8
|
+
import { createEnvelope } from './envelope.js';
|
|
9
|
+
import { NamespaceScope } from './namespace-scope.js';
|
|
10
|
+
import { soapActionHeaders } from './soap-action.js';
|
|
11
|
+
function resolveOperation(input, op, problems) {
|
|
12
|
+
const binding = findBinding(input.definition, op.bindingName);
|
|
13
|
+
if (binding === undefined) {
|
|
14
|
+
problems.push({ code: 'unknown-binding', message: `No binding named ${qnameToString(op.bindingName)}` });
|
|
15
|
+
return { version: '1.1', buildable: false };
|
|
16
|
+
}
|
|
17
|
+
const bindingOperation = binding.operations.find((candidate) => candidate.name === op.operationName);
|
|
18
|
+
if (bindingOperation === undefined) {
|
|
19
|
+
problems.push({
|
|
20
|
+
code: 'unknown-operation',
|
|
21
|
+
message: `Binding ${qnameToString(op.bindingName)} has no operation "${op.operationName}"`,
|
|
22
|
+
});
|
|
23
|
+
return { binding, version: binding.soapVersion === '1.2' ? '1.2' : '1.1', buildable: false };
|
|
24
|
+
}
|
|
25
|
+
if (binding.soapVersion === 'none') {
|
|
26
|
+
problems.push({
|
|
27
|
+
code: 'unsupported-binding',
|
|
28
|
+
message: `Binding ${qnameToString(op.bindingName)} is not a SOAP binding`,
|
|
29
|
+
});
|
|
30
|
+
return { binding, bindingOperation, version: '1.1', buildable: false };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
binding,
|
|
34
|
+
bindingOperation,
|
|
35
|
+
version: binding.soapVersion,
|
|
36
|
+
...(bindingOperation.soapAction !== undefined ? { soapAction: bindingOperation.soapAction } : {}),
|
|
37
|
+
buildable: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Assembles the transport half of a {@link GeneratedRequest}. */
|
|
41
|
+
function transport(version, soapAction, actionOptions) {
|
|
42
|
+
const { contentType, headers } = soapActionHeaders(version, soapAction, actionOptions ?? {});
|
|
43
|
+
return { contentType, headers };
|
|
44
|
+
}
|
|
45
|
+
/** The abstract operation behind a binding operation, reporting what is missing. */
|
|
46
|
+
function findAbstractOperation(definition, binding, operationName, problems) {
|
|
47
|
+
const portType = findPortType(definition, binding.type);
|
|
48
|
+
if (portType === undefined) {
|
|
49
|
+
problems.push({
|
|
50
|
+
code: 'missing-portType',
|
|
51
|
+
message: `Binding ${qnameToString(binding.name)} refers to unknown portType ${qnameToString(binding.type)}`,
|
|
52
|
+
});
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
const operation = portType.operations.find((candidate) => candidate.name === operationName);
|
|
56
|
+
if (operation === undefined) {
|
|
57
|
+
problems.push({
|
|
58
|
+
code: 'unknown-operation',
|
|
59
|
+
message: `portType ${qnameToString(portType.name)} has no operation "${operationName}"`,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return operation;
|
|
63
|
+
}
|
|
64
|
+
/** The seed namespaces a scope names up-front, in a stable order. */
|
|
65
|
+
function seedNamespaces(input, bindingOperation) {
|
|
66
|
+
const bodyNamespace = bindingOperation?.input?.body.namespace;
|
|
67
|
+
return [
|
|
68
|
+
input.definition.targetNamespace,
|
|
69
|
+
...(bodyNamespace !== undefined ? [bodyNamespace] : []),
|
|
70
|
+
...input.schemaSet.namespaces,
|
|
71
|
+
].filter((uri) => uri !== '');
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Builds the sample SOAP request for one binding operation.
|
|
75
|
+
*
|
|
76
|
+
* The builder never throws for a modelling problem: it always returns an
|
|
77
|
+
* envelope (an empty one in the worst case) and reports what went wrong in
|
|
78
|
+
* {@link GeneratedRequest.problems}, so the UI can show a partial request.
|
|
79
|
+
*
|
|
80
|
+
* Every namespace used anywhere in the envelope is declared once on the
|
|
81
|
+
* `soapenv:Envelope` element with a short mnemonic prefix
|
|
82
|
+
* (`http://tempuri.org/` → `tem`); the fragments inside carry none.
|
|
83
|
+
*
|
|
84
|
+
* Deterministic: identical inputs always produce byte-identical output.
|
|
85
|
+
*
|
|
86
|
+
* @param input the parsed WSDL definition and its compiled schema set
|
|
87
|
+
* @param op which operation of which binding to build
|
|
88
|
+
* @param genOptions sample-generator options (optional elements, sample values, depth, prefixes)
|
|
89
|
+
* @param options indent plus SOAP action/`Content-Type` knobs
|
|
90
|
+
*/
|
|
91
|
+
export function buildSampleRequest(input, op, genOptions, options) {
|
|
92
|
+
const problems = [];
|
|
93
|
+
const resolved = resolveOperation(input, op, problems);
|
|
94
|
+
const indent = options?.indent ?? ' ';
|
|
95
|
+
if (!resolved.buildable || resolved.binding === undefined || resolved.bindingOperation === undefined) {
|
|
96
|
+
return {
|
|
97
|
+
envelopeXml: createEnvelope(resolved.version, { bodyXml: '' }, { indent }),
|
|
98
|
+
soapVersion: resolved.version,
|
|
99
|
+
...(resolved.soapAction !== undefined ? { soapAction: resolved.soapAction } : {}),
|
|
100
|
+
...transport(resolved.version, resolved.soapAction, options),
|
|
101
|
+
problems,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const { binding, bindingOperation } = resolved;
|
|
105
|
+
const scope = new NamespaceScope(seedNamespaces(input, bindingOperation), genOptions?.prefixes ?? {});
|
|
106
|
+
const ctx = {
|
|
107
|
+
definition: input.definition,
|
|
108
|
+
schemaSet: input.schemaSet,
|
|
109
|
+
scope,
|
|
110
|
+
genOptions: genOptions ?? {},
|
|
111
|
+
indent,
|
|
112
|
+
problems,
|
|
113
|
+
};
|
|
114
|
+
const headerXml = buildHeaders(ctx, bindingOperation.input?.headers ?? []);
|
|
115
|
+
let bodyXml = '';
|
|
116
|
+
const abstract = findAbstractOperation(input.definition, binding, op.operationName, problems);
|
|
117
|
+
const inputRef = abstract?.input;
|
|
118
|
+
if (abstract !== undefined && inputRef === undefined) {
|
|
119
|
+
problems.push({
|
|
120
|
+
code: 'missing-message',
|
|
121
|
+
message: `Operation "${op.operationName}" declares no input message`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (inputRef !== undefined) {
|
|
125
|
+
const message = findMessage(input.definition, inputRef.message);
|
|
126
|
+
if (message === undefined) {
|
|
127
|
+
problems.push({
|
|
128
|
+
code: 'missing-message',
|
|
129
|
+
message: `Operation "${op.operationName}" refers to unknown message ${qnameToString(inputRef.message)}`,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const style = bindingOperation.style ?? binding.style;
|
|
134
|
+
const body = bindingOperation.input?.body ?? { use: 'literal' };
|
|
135
|
+
bodyXml = buildBody(ctx, op.operationName, style, body, message, abstract?.parameterOrder);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
envelopeXml: createEnvelope(resolved.version, { headerXml, bodyXml, namespaces: scope.declarations() }, { indent }),
|
|
140
|
+
soapVersion: resolved.version,
|
|
141
|
+
...(resolved.soapAction !== undefined ? { soapAction: resolved.soapAction } : {}),
|
|
142
|
+
...transport(resolved.version, resolved.soapAction, options),
|
|
143
|
+
problems,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Builds an empty envelope for one binding operation — the "Create Empty"
|
|
148
|
+
* request. The envelope carries an empty `Header` and `Body`, while the SOAP
|
|
149
|
+
* version, action and `Content-Type` are exactly those of a sample request.
|
|
150
|
+
*/
|
|
151
|
+
export function buildEmptyRequest(input, op, options) {
|
|
152
|
+
const problems = [];
|
|
153
|
+
const resolved = resolveOperation(input, op, problems);
|
|
154
|
+
return {
|
|
155
|
+
envelopeXml: createEnvelope(resolved.version, { bodyXml: '' }, { indent: options?.indent ?? ' ' }),
|
|
156
|
+
soapVersion: resolved.version,
|
|
157
|
+
...(resolved.soapAction !== undefined ? { soapAction: resolved.soapAction } : {}),
|
|
158
|
+
...transport(resolved.version, resolved.soapAction, options),
|
|
159
|
+
problems,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural parsing of a SOAP response envelope. Transport concerns (status
|
|
3
|
+
* codes, redirects, MTOM) belong to the HTTP layer; this module only turns
|
|
4
|
+
* response XML into the envelope's parts.
|
|
5
|
+
*/
|
|
6
|
+
import type { Element } from '@xmldom/xmldom';
|
|
7
|
+
import type { SoapEnvelopeVersion } from './envelope.js';
|
|
8
|
+
import type { SoapFault } from './fault.js';
|
|
9
|
+
/** The dissected parts of a SOAP response envelope. */
|
|
10
|
+
export interface ParsedSoapResponse {
|
|
11
|
+
readonly version: SoapEnvelopeVersion;
|
|
12
|
+
readonly envelope: Element;
|
|
13
|
+
/** The `Header` element, when the response carries one. */
|
|
14
|
+
readonly header?: Element;
|
|
15
|
+
readonly body: Element;
|
|
16
|
+
/** The `Body`'s element children, in document order (empty for an empty body). */
|
|
17
|
+
readonly bodyChildren: readonly Element[];
|
|
18
|
+
/** The parsed fault, when the body carries one. */
|
|
19
|
+
readonly fault?: SoapFault;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parses a SOAP response envelope into its header, body and fault.
|
|
23
|
+
*
|
|
24
|
+
* @param xml the raw response body
|
|
25
|
+
* @throws {WirebenchError} `xml-parse-error` (propagated from {@link parseXml}) for malformed XML
|
|
26
|
+
* @throws {WirebenchError} `not-a-soap-envelope` when the root is not an `Envelope` in either SOAP namespace,
|
|
27
|
+
* or when such an envelope has no `Body`; the caller decides how to surface a non-SOAP response
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseSoapResponse(xml: string): ParsedSoapResponse;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural parsing of a SOAP response envelope. Transport concerns (status
|
|
3
|
+
* codes, redirects, MTOM) belong to the HTTP layer; this module only turns
|
|
4
|
+
* response XML into the envelope's parts.
|
|
5
|
+
*/
|
|
6
|
+
import { WirebenchError } from '../errors.js';
|
|
7
|
+
import { parseXml } from '../xml/parse.js';
|
|
8
|
+
import { detectEnvelopeVersion, envelopeNamespace } from './envelope.js';
|
|
9
|
+
import { parseFault } from './fault.js';
|
|
10
|
+
/** Element children of `parent` in the given namespace, in document order. */
|
|
11
|
+
function childElementsNS(parent, namespaceUri, localName) {
|
|
12
|
+
const result = [];
|
|
13
|
+
for (let node = parent.firstChild; node !== null; node = node.nextSibling) {
|
|
14
|
+
if (node.nodeType !== 1) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const element = node;
|
|
18
|
+
if (element.namespaceURI !== namespaceUri) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (localName === undefined || element.localName === localName) {
|
|
22
|
+
result.push(element);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
/** Every element child of `parent`, in document order. */
|
|
28
|
+
function allChildElements(parent) {
|
|
29
|
+
const result = [];
|
|
30
|
+
for (let node = parent.firstChild; node !== null; node = node.nextSibling) {
|
|
31
|
+
if (node.nodeType === 1) {
|
|
32
|
+
result.push(node);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parses a SOAP response envelope into its header, body and fault.
|
|
39
|
+
*
|
|
40
|
+
* @param xml the raw response body
|
|
41
|
+
* @throws {WirebenchError} `xml-parse-error` (propagated from {@link parseXml}) for malformed XML
|
|
42
|
+
* @throws {WirebenchError} `not-a-soap-envelope` when the root is not an `Envelope` in either SOAP namespace,
|
|
43
|
+
* or when such an envelope has no `Body`; the caller decides how to surface a non-SOAP response
|
|
44
|
+
*/
|
|
45
|
+
export function parseSoapResponse(xml) {
|
|
46
|
+
const doc = parseXml(xml);
|
|
47
|
+
const version = detectEnvelopeVersion(doc);
|
|
48
|
+
const envelope = doc.documentElement;
|
|
49
|
+
if (version === undefined || envelope === null) {
|
|
50
|
+
throw new WirebenchError('not-a-soap-envelope', 'Response is not a SOAP Envelope', {
|
|
51
|
+
details: { rootTag: envelope?.tagName ?? null, rootNamespace: envelope?.namespaceURI ?? null },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const ns = envelopeNamespace(version);
|
|
55
|
+
const body = childElementsNS(envelope, ns, 'Body')[0];
|
|
56
|
+
if (body === undefined) {
|
|
57
|
+
throw new WirebenchError('not-a-soap-envelope', 'SOAP Envelope has no Body element', {
|
|
58
|
+
details: { version },
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const header = childElementsNS(envelope, ns, 'Header')[0];
|
|
62
|
+
const fault = parseFault(doc);
|
|
63
|
+
return {
|
|
64
|
+
version,
|
|
65
|
+
envelope,
|
|
66
|
+
...(header !== undefined ? { header } : {}),
|
|
67
|
+
body,
|
|
68
|
+
bodyChildren: allChildElements(body),
|
|
69
|
+
...(fault !== undefined ? { fault } : {}),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transport-level naming of a SOAP operation: SOAP 1.1's `SOAPAction`
|
|
3
|
+
* header versus SOAP 1.2's `action` media-type parameter.
|
|
4
|
+
*/
|
|
5
|
+
import type { SoapEnvelopeVersion } from './envelope.js';
|
|
6
|
+
/** Knobs for {@link soapActionHeaders}. */
|
|
7
|
+
export interface SoapActionOptions {
|
|
8
|
+
/** Suppress the action entirely (some servers reject an unexpected `SOAPAction`). */
|
|
9
|
+
readonly skipSoapAction?: boolean;
|
|
10
|
+
/** Charset for the `Content-Type`; `UTF-8` by default, and used verbatim. */
|
|
11
|
+
readonly charset?: string;
|
|
12
|
+
}
|
|
13
|
+
/** The `Content-Type` and any extra request headers naming the operation. */
|
|
14
|
+
export interface SoapActionHeaders {
|
|
15
|
+
readonly contentType: string;
|
|
16
|
+
/** Additional headers to send; the `Content-Type` is *not* repeated here. */
|
|
17
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Computes the `Content-Type` and action-carrying headers for a request.
|
|
21
|
+
*
|
|
22
|
+
* SOAP 1.1 carries the action in a mandatory, always double-quoted `SOAPAction`
|
|
23
|
+
* header (an absent action is the empty quoted string `""`, per WSDL 1.1
|
|
24
|
+
* §3.5). SOAP 1.2 folds it into the `application/soap+xml` media type as an
|
|
25
|
+
* `action` parameter and defines no `SOAPAction` header at all.
|
|
26
|
+
*
|
|
27
|
+
* @param version the SOAP version of the envelope being sent
|
|
28
|
+
* @param soapAction the binding's `soapAction`, if any
|
|
29
|
+
* @param opts `skipSoapAction` omits the action in either version
|
|
30
|
+
*/
|
|
31
|
+
export declare function soapActionHeaders(version: SoapEnvelopeVersion, soapAction: string | undefined, opts?: SoapActionOptions): SoapActionHeaders;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transport-level naming of a SOAP operation: SOAP 1.1's `SOAPAction`
|
|
3
|
+
* header versus SOAP 1.2's `action` media-type parameter.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Computes the `Content-Type` and action-carrying headers for a request.
|
|
7
|
+
*
|
|
8
|
+
* SOAP 1.1 carries the action in a mandatory, always double-quoted `SOAPAction`
|
|
9
|
+
* header (an absent action is the empty quoted string `""`, per WSDL 1.1
|
|
10
|
+
* §3.5). SOAP 1.2 folds it into the `application/soap+xml` media type as an
|
|
11
|
+
* `action` parameter and defines no `SOAPAction` header at all.
|
|
12
|
+
*
|
|
13
|
+
* @param version the SOAP version of the envelope being sent
|
|
14
|
+
* @param soapAction the binding's `soapAction`, if any
|
|
15
|
+
* @param opts `skipSoapAction` omits the action in either version
|
|
16
|
+
*/
|
|
17
|
+
export function soapActionHeaders(version, soapAction, opts = {}) {
|
|
18
|
+
const charset = opts.charset ?? 'UTF-8';
|
|
19
|
+
const skip = opts.skipSoapAction === true;
|
|
20
|
+
if (version === '1.1') {
|
|
21
|
+
return {
|
|
22
|
+
contentType: `text/xml;charset=${charset}`,
|
|
23
|
+
headers: skip ? {} : { SOAPAction: `"${soapAction ?? ''}"` },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const action = !skip && soapAction !== undefined && soapAction.length > 0 ? `;action="${soapAction}"` : '';
|
|
27
|
+
return { contentType: `application/soap+xml;charset=${charset}${action}`, headers: {} };
|
|
28
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The envelope transforms applied on the way out, per request property:
|
|
3
|
+
* "Remove Empty Content", "Strip Whitespaces", "Pretty Print" and "Entitize Properties".
|
|
4
|
+
*
|
|
5
|
+
* All four are text transforms over a tolerant tokenizer, never a DOM round trip: an envelope
|
|
6
|
+
* a user hand-edited may not be well formed, and a transform that throws (or silently rewrites
|
|
7
|
+
* attribute quoting) on the way to the wire is worse than one that does nothing. Every function
|
|
8
|
+
* here returns its input unchanged when it cannot understand the document.
|
|
9
|
+
*
|
|
10
|
+
* Entitizing is the odd one out. It escapes the values substituted by property expansion,
|
|
11
|
+
* which cannot be identified after the fact — by the time an envelope is a string, a `&` that
|
|
12
|
+
* came from a property is indistinguishable from one the user typed. So {@link entitizeValue}
|
|
13
|
+
* is applied *during* expansion instead (see `project/properties.ts`'s `entitize` option), and
|
|
14
|
+
* lives here alongside its siblings.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* "Remove Empty Content": drops every element that has no attributes and whose whole
|
|
18
|
+
* content is empty, whitespace, or `?` placeholders — recursively, so a parent left with
|
|
19
|
+
* nothing but removed children goes too. The `Envelope`/`Header`/`Body` wrappers are never
|
|
20
|
+
* removed, however empty they are.
|
|
21
|
+
*
|
|
22
|
+
* @param xml the envelope text
|
|
23
|
+
* @returns the transformed envelope, or `xml` unchanged when it could not be parsed
|
|
24
|
+
*/
|
|
25
|
+
export declare function removeEmptyContent(xml: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* "Strip Whitespaces": drops whitespace-only text nodes between elements and trims
|
|
28
|
+
* the leading/trailing whitespace of every other text node. CDATA sections, comments and
|
|
29
|
+
* processing instructions are left exactly as they are.
|
|
30
|
+
*
|
|
31
|
+
* @param xml the envelope text
|
|
32
|
+
* @returns the transformed envelope, or `xml` unchanged when it could not be tokenized
|
|
33
|
+
*/
|
|
34
|
+
export declare function stripWhitespaces(xml: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* "Pretty Print": reformats the envelope with the given indent width.
|
|
37
|
+
*
|
|
38
|
+
* @param xml the envelope text
|
|
39
|
+
* @param indentWidth spaces per nesting level; defaults to 3, the editor's default tab size
|
|
40
|
+
* @returns the formatted envelope, or `xml` unchanged when it could not be formatted
|
|
41
|
+
*/
|
|
42
|
+
export declare function prettyPrint(xml: string, indentWidth?: number): string;
|
|
43
|
+
/**
|
|
44
|
+
* "Entitize Properties", applied to one substituted property value: escapes the three
|
|
45
|
+
* characters that would otherwise be read as markup once the value lands inside an envelope.
|
|
46
|
+
*
|
|
47
|
+
* `"` and `'` are deliberately left alone: expansion targets element content far more often
|
|
48
|
+
* than an attribute value, and escaping quotes there would show up as `"` in the payload.
|
|
49
|
+
*
|
|
50
|
+
* @param value the expanded property value
|
|
51
|
+
*/
|
|
52
|
+
export declare function entitizeValue(value: string): string;
|