@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,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the text of a legacy single-XML SOAP project file into a {@link LegacyProject}.
|
|
3
|
+
*
|
|
4
|
+
* Tolerant by design: every optional element may be missing, and anything unexpected is skipped
|
|
5
|
+
* rather than fatal. Only a document that is not well-formed, is not this format, or is encrypted
|
|
6
|
+
* is rejected, with a {@link LegacyProjectError}.
|
|
7
|
+
*/
|
|
8
|
+
import { gunzipSync } from 'node:zlib';
|
|
9
|
+
import { LegacyProjectError, WirebenchError } from '../../errors.js';
|
|
10
|
+
import { parseXmlDetailed } from '../../xml/parse.js';
|
|
11
|
+
import { serializeXml } from '../../xml/serialize.js';
|
|
12
|
+
import { LEGACY_PROJECT_NAMESPACE, LEGACY_PROJECT_ROOT } from './format.js';
|
|
13
|
+
const NS = LEGACY_PROJECT_NAMESPACE;
|
|
14
|
+
/** The direct child elements of `parent` in the format's namespace, optionally only those called `localName`. */
|
|
15
|
+
function children(parent, localName) {
|
|
16
|
+
const found = [];
|
|
17
|
+
for (let node = parent.firstChild; node !== null; node = node.nextSibling) {
|
|
18
|
+
if (node.nodeType !== 1) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const element = node;
|
|
22
|
+
if (element.namespaceURI === NS && (localName === undefined || element.localName === localName)) {
|
|
23
|
+
found.push(element);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return found;
|
|
27
|
+
}
|
|
28
|
+
function child(parent, localName) {
|
|
29
|
+
return children(parent, localName)[0];
|
|
30
|
+
}
|
|
31
|
+
/** The text of the named child, or `undefined` when the child is missing. */
|
|
32
|
+
function childText(parent, localName) {
|
|
33
|
+
const element = child(parent, localName);
|
|
34
|
+
return element === undefined ? undefined : (element.textContent ?? '');
|
|
35
|
+
}
|
|
36
|
+
/** An attribute's value, with an empty string treated as absent. */
|
|
37
|
+
function attr(element, name) {
|
|
38
|
+
const value = element.getAttribute(name);
|
|
39
|
+
return value === null || value === '' ? undefined : value;
|
|
40
|
+
}
|
|
41
|
+
function nonEmpty(value) {
|
|
42
|
+
return value === undefined || value.trim() === '' ? undefined : value;
|
|
43
|
+
}
|
|
44
|
+
function readProperties(elements) {
|
|
45
|
+
const properties = [];
|
|
46
|
+
for (const element of elements) {
|
|
47
|
+
const name = nonEmpty(childText(element, 'name'))?.trim();
|
|
48
|
+
if (name !== undefined) {
|
|
49
|
+
properties.push({ name, value: childText(element, 'value') ?? '' });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return properties;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A cache part's document. It is held either as text (usually a CDATA section) or inline as the
|
|
56
|
+
* content element's single child element, which is serialized back to text.
|
|
57
|
+
*/
|
|
58
|
+
function partContent(content) {
|
|
59
|
+
for (let node = content.firstChild; node !== null; node = node.nextSibling) {
|
|
60
|
+
if (node.nodeType === 1) {
|
|
61
|
+
return serializeXml(node);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return (content.textContent ?? '').trim();
|
|
65
|
+
}
|
|
66
|
+
function readCache(iface) {
|
|
67
|
+
const cache = child(iface, 'definitionCache');
|
|
68
|
+
if (cache === undefined) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const parts = [];
|
|
72
|
+
for (const part of children(cache, 'part')) {
|
|
73
|
+
const url = nonEmpty(childText(part, 'url'))?.trim();
|
|
74
|
+
const content = child(part, 'content');
|
|
75
|
+
if (url !== undefined && content !== undefined) {
|
|
76
|
+
parts.push({ url, content: partContent(content) });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (parts.length === 0) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const rootPart = attr(cache, 'rootPart');
|
|
83
|
+
return { ...(rootPart !== undefined ? { rootPart } : {}), parts };
|
|
84
|
+
}
|
|
85
|
+
/** Decodes a `request` element: plain text, or base64 of a gzip stream when `compression` is set. */
|
|
86
|
+
function readEnvelope(request) {
|
|
87
|
+
if (request === undefined) {
|
|
88
|
+
return { envelopeProblem: 'it has no request body' };
|
|
89
|
+
}
|
|
90
|
+
const text = request.textContent ?? '';
|
|
91
|
+
const compression = attr(request, 'compression');
|
|
92
|
+
if (compression === undefined) {
|
|
93
|
+
return { envelope: text };
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
return { envelope: gunzipSync(Buffer.from(text.trim(), 'base64')).toString('utf8') };
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return { envelopeProblem: `its body is compressed as "${compression}", which could not be decoded` };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function readCredentials(call) {
|
|
103
|
+
const credentials = child(call, 'credentials');
|
|
104
|
+
if (credentials === undefined) {
|
|
105
|
+
return { hadPassword: false };
|
|
106
|
+
}
|
|
107
|
+
const username = nonEmpty(childText(credentials, 'username'));
|
|
108
|
+
const domain = nonEmpty(childText(credentials, 'domain'));
|
|
109
|
+
const authType = nonEmpty(childText(credentials, 'authType'));
|
|
110
|
+
return {
|
|
111
|
+
...(username !== undefined ? { username } : {}),
|
|
112
|
+
...(domain !== undefined ? { domain } : {}),
|
|
113
|
+
hadPassword: nonEmpty(childText(credentials, 'password')) !== undefined,
|
|
114
|
+
...(authType !== undefined ? { authType } : {}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function readCall(call, index) {
|
|
118
|
+
const endpoint = nonEmpty(childText(call, 'endpoint'))?.trim();
|
|
119
|
+
const encoding = nonEmpty(childText(call, 'encoding'))?.trim();
|
|
120
|
+
const timeout = attr(call, 'timeout');
|
|
121
|
+
const timeoutMs = timeout !== undefined && /^\d+$/.test(timeout.trim()) ? Number(timeout.trim()) : undefined;
|
|
122
|
+
const wssRefs = [attr(call, 'outgoingWss'), attr(call, 'incomingWss')].filter((ref) => ref !== undefined);
|
|
123
|
+
return {
|
|
124
|
+
name: attr(call, 'name') ?? `Request ${String(index + 1)}`,
|
|
125
|
+
...(endpoint !== undefined ? { endpoint } : {}),
|
|
126
|
+
...readEnvelope(child(call, 'request')),
|
|
127
|
+
...(encoding !== undefined ? { encoding } : {}),
|
|
128
|
+
...(timeoutMs !== undefined ? { timeoutMs } : {}),
|
|
129
|
+
credentials: readCredentials(call),
|
|
130
|
+
useWsAddressing: attr(call, 'useWsAddressing') === 'true',
|
|
131
|
+
assertions: children(call, 'assertion').length,
|
|
132
|
+
attachments: children(call, 'attachment').length,
|
|
133
|
+
wssRefs,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function readOperation(operation, index) {
|
|
137
|
+
const name = attr(operation, 'name') ?? attr(operation, 'bindingOperationName') ?? `Operation ${String(index + 1)}`;
|
|
138
|
+
const action = attr(operation, 'action');
|
|
139
|
+
return {
|
|
140
|
+
name,
|
|
141
|
+
bindingOperationName: attr(operation, 'bindingOperationName') ?? name,
|
|
142
|
+
...(action !== undefined ? { action } : {}),
|
|
143
|
+
calls: children(operation, 'call').map(readCall),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function readInterface(iface, index) {
|
|
147
|
+
const definitionUrl = attr(iface, 'definition');
|
|
148
|
+
const bindingName = attr(iface, 'bindingName');
|
|
149
|
+
const cache = readCache(iface);
|
|
150
|
+
const endpointsElement = child(iface, 'endpoints');
|
|
151
|
+
const endpoints = endpointsElement === undefined
|
|
152
|
+
? []
|
|
153
|
+
: children(endpointsElement, 'endpoint')
|
|
154
|
+
.map((endpoint) => (endpoint.textContent ?? '').trim())
|
|
155
|
+
.filter((url) => url !== '');
|
|
156
|
+
return {
|
|
157
|
+
name: attr(iface, 'name') ?? `Interface ${String(index + 1)}`,
|
|
158
|
+
...(definitionUrl !== undefined ? { definitionUrl } : {}),
|
|
159
|
+
...(bindingName !== undefined ? { bindingName } : {}),
|
|
160
|
+
soapVersion: attr(iface, 'soapVersion') === '1_2' ? '1.2' : '1.1',
|
|
161
|
+
...(cache !== undefined ? { cache } : {}),
|
|
162
|
+
endpoints: [...new Set(endpoints)],
|
|
163
|
+
operations: children(iface, 'operation').map(readOperation),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function readEnvironment(environment, index) {
|
|
167
|
+
const endpoints = [];
|
|
168
|
+
for (const service of children(environment, 'service')) {
|
|
169
|
+
const interfaceName = attr(service, 'name');
|
|
170
|
+
const url = nonEmpty(childText(service, 'endpoint'))?.trim();
|
|
171
|
+
if (interfaceName !== undefined && url !== undefined) {
|
|
172
|
+
endpoints.push({ interfaceName, url });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
name: attr(environment, 'name') ?? `Environment ${String(index + 1)}`,
|
|
177
|
+
properties: readProperties(children(environment, 'property')),
|
|
178
|
+
endpoints,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/** Names of the named elements from just below the root down to (and including) `element`. */
|
|
182
|
+
function ownerPathOf(element, root) {
|
|
183
|
+
const path = [];
|
|
184
|
+
for (let node = element; node !== null && node !== root; node = node.parentNode) {
|
|
185
|
+
if (node.nodeType === 1) {
|
|
186
|
+
const name = attr(node, 'name');
|
|
187
|
+
if (name !== undefined) {
|
|
188
|
+
path.unshift(name);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return path;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Every script in the document: each element in the format's namespace whose local name ends in
|
|
196
|
+
* `Script` and has text, and the `script` body of each script test step.
|
|
197
|
+
*/
|
|
198
|
+
function collectScripts(root) {
|
|
199
|
+
const scripts = [];
|
|
200
|
+
const visit = (element) => {
|
|
201
|
+
for (let node = element.firstChild; node !== null; node = node.nextSibling) {
|
|
202
|
+
if (node.nodeType !== 1) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const current = node;
|
|
206
|
+
const isHook = current.namespaceURI === NS && /Script$/.test(current.localName ?? '');
|
|
207
|
+
const isStepScript = current.localName === 'script' &&
|
|
208
|
+
current.parentNode?.nodeType === 1 &&
|
|
209
|
+
current.parentNode.localName === 'config';
|
|
210
|
+
if (isHook || isStepScript) {
|
|
211
|
+
const source = current.textContent ?? '';
|
|
212
|
+
if (source.trim() !== '') {
|
|
213
|
+
const language = attr(current, 'language');
|
|
214
|
+
const owner = current.parentNode;
|
|
215
|
+
scripts.push({
|
|
216
|
+
ownerPath: ownerPathOf(isStepScript ? owner.parentNode : owner, root),
|
|
217
|
+
element: current.localName ?? 'script',
|
|
218
|
+
...(language !== undefined ? { language } : {}),
|
|
219
|
+
source,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
visit(current);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
visit(root);
|
|
228
|
+
return scripts;
|
|
229
|
+
}
|
|
230
|
+
function hasChildElements(element) {
|
|
231
|
+
if (element === undefined) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
for (let node = element.firstChild; node !== null; node = node.nextSibling) {
|
|
235
|
+
if (node.nodeType === 1) {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
/** Everything under the root that holds user work v1 does not map, for the import report. */
|
|
242
|
+
function collectUnmapped(root) {
|
|
243
|
+
const unmapped = [];
|
|
244
|
+
for (const iface of children(root, 'interface')) {
|
|
245
|
+
const type = attr(iface, 'type');
|
|
246
|
+
if (type !== 'wsdl') {
|
|
247
|
+
unmapped.push({
|
|
248
|
+
ownerPath: [attr(iface, 'name') ?? 'Unnamed service'],
|
|
249
|
+
message: `A ${type ?? 'non-SOAP'} service is not imported; only SOAP interfaces are.`,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
for (const suite of children(root, 'testSuite')) {
|
|
254
|
+
const cases = children(suite, 'testCase').length;
|
|
255
|
+
unmapped.push({
|
|
256
|
+
ownerPath: [attr(suite, 'name') ?? 'Unnamed test suite'],
|
|
257
|
+
message: `Test suite with ${String(cases)} test case${cases === 1 ? '' : 's'} is not imported.`,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
for (const kind of ['mockService', 'restMockService']) {
|
|
261
|
+
for (const mock of children(root, kind)) {
|
|
262
|
+
unmapped.push({
|
|
263
|
+
ownerPath: [attr(mock, 'name') ?? 'Unnamed mock service'],
|
|
264
|
+
message: 'Mock service is not imported.',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const containers = [
|
|
269
|
+
['wssContainer', 'WS-Security configurations and keystores are not imported; set them up under WS-Security.'],
|
|
270
|
+
['databaseConnectionContainer', 'Database connections are not imported.'],
|
|
271
|
+
['oAuth2ProfileContainer', 'OAuth 2.0 profiles are not imported.'],
|
|
272
|
+
['oAuth1ProfileContainer', 'OAuth 1.0 profiles are not imported.'],
|
|
273
|
+
['requirements', 'Requirements are not imported.'],
|
|
274
|
+
];
|
|
275
|
+
for (const [localName, message] of containers) {
|
|
276
|
+
if (hasChildElements(child(root, localName))) {
|
|
277
|
+
unmapped.push({ ownerPath: [], message });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return unmapped;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Parses `text` as a legacy single-XML SOAP project.
|
|
284
|
+
*
|
|
285
|
+
* @throws LegacyProjectError `legacy-malformed` when the XML is not well-formed or declares a DTD,
|
|
286
|
+
* `legacy-not-a-project` when it is some other document, and `legacy-encrypted` when the project
|
|
287
|
+
* was saved encrypted.
|
|
288
|
+
*/
|
|
289
|
+
export function parseLegacyProject(text, location) {
|
|
290
|
+
if (/<!DOCTYPE/i.test(text)) {
|
|
291
|
+
throw new LegacyProjectError('legacy-malformed', 'The project file declares a DTD, which is not accepted', {
|
|
292
|
+
...(location !== undefined ? { details: { location } } : {}),
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
let root;
|
|
296
|
+
try {
|
|
297
|
+
root = parseXmlDetailed(text, location !== undefined ? { location } : undefined).document.documentElement;
|
|
298
|
+
}
|
|
299
|
+
catch (cause) {
|
|
300
|
+
const message = cause instanceof WirebenchError ? cause.message : 'The file is not well-formed XML';
|
|
301
|
+
throw new LegacyProjectError('legacy-malformed', `The project file is not well-formed XML: ${message}`, {
|
|
302
|
+
cause,
|
|
303
|
+
...(cause instanceof WirebenchError && cause.details !== undefined ? { details: cause.details } : {}),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
if (root === null || root.namespaceURI !== NS || root.localName !== LEGACY_PROJECT_ROOT) {
|
|
307
|
+
throw new LegacyProjectError('legacy-not-a-project', 'The file is not a legacy SOAP project');
|
|
308
|
+
}
|
|
309
|
+
if (nonEmpty(childText(root, 'encryptedContent')) !== undefined) {
|
|
310
|
+
throw new LegacyProjectError('legacy-encrypted', 'The project was saved encrypted. Open it in the tool that wrote it, save it without a password, and import that copy.');
|
|
311
|
+
}
|
|
312
|
+
const description = nonEmpty(childText(root, 'description'));
|
|
313
|
+
const propertiesElement = child(root, 'properties');
|
|
314
|
+
return {
|
|
315
|
+
name: attr(root, 'name') ?? 'Imported project',
|
|
316
|
+
...(description !== undefined ? { description } : {}),
|
|
317
|
+
properties: propertiesElement === undefined ? [] : readProperties(children(propertiesElement, 'property')),
|
|
318
|
+
interfaces: children(root, 'interface')
|
|
319
|
+
.filter((iface) => attr(iface, 'type') === 'wsdl')
|
|
320
|
+
.map(readInterface),
|
|
321
|
+
environments: children(root, 'environment').map(readEnvironment),
|
|
322
|
+
scripts: collectScripts(root),
|
|
323
|
+
unmapped: collectUnmapped(root),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding the `cid:` references an envelope makes, without a DOM.
|
|
3
|
+
*
|
|
4
|
+
* Both MTOM and SwA key off the same syntactic rule: an element whose text
|
|
5
|
+
* content is *exactly* a `cid:` reference points at an attachment. Anything else — a
|
|
6
|
+
* sentence that merely mentions `cid:`, an attribute, a mixed-content element — is left
|
|
7
|
+
* alone. The tolerant scanner is used (rather than a strict parse) because a request being
|
|
8
|
+
* edited is frequently not yet well-formed, and a half-typed envelope must still send.
|
|
9
|
+
*/
|
|
10
|
+
import { type ScannedElement, type TextRange } from '../../xsd/xml-scan.js';
|
|
11
|
+
/** One `cid:` reference found in an envelope, with the range of the text that carries it. */
|
|
12
|
+
export interface CidReference {
|
|
13
|
+
/** The reference without its `cid:` scheme, e.g. `A1@wirebench`. */
|
|
14
|
+
readonly cid: string;
|
|
15
|
+
/** Range of the element's text content, ready to be spliced over. */
|
|
16
|
+
readonly range: TextRange;
|
|
17
|
+
}
|
|
18
|
+
/** What {@link findCidReferences} found. */
|
|
19
|
+
export interface CidScan {
|
|
20
|
+
readonly references: readonly CidReference[];
|
|
21
|
+
/** False when the envelope was too malformed to scan; callers then leave it untouched. */
|
|
22
|
+
readonly scannable: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Visits every element of a scanned envelope, depth first, parents before children. */
|
|
25
|
+
export declare function forEachScannedElement(elements: readonly ScannedElement[], visit: (element: ScannedElement) => void): void;
|
|
26
|
+
/**
|
|
27
|
+
* Every element whose entire text content is a `cid:` reference, in document order.
|
|
28
|
+
*
|
|
29
|
+
* @param envelopeXml the envelope to scan
|
|
30
|
+
*/
|
|
31
|
+
export declare function findCidReferences(envelopeXml: string): CidScan;
|
|
32
|
+
/** Replaces `[start, end)` ranges in `text`, applying them right to left so offsets stay valid. */
|
|
33
|
+
export declare function spliceRanges(text: string, edits: readonly {
|
|
34
|
+
readonly range: TextRange;
|
|
35
|
+
readonly text: string;
|
|
36
|
+
}[]): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding the `cid:` references an envelope makes, without a DOM.
|
|
3
|
+
*
|
|
4
|
+
* Both MTOM and SwA key off the same syntactic rule: an element whose text
|
|
5
|
+
* content is *exactly* a `cid:` reference points at an attachment. Anything else — a
|
|
6
|
+
* sentence that merely mentions `cid:`, an attribute, a mixed-content element — is left
|
|
7
|
+
* alone. The tolerant scanner is used (rather than a strict parse) because a request being
|
|
8
|
+
* edited is frequently not yet well-formed, and a half-typed envelope must still send.
|
|
9
|
+
*/
|
|
10
|
+
import { scanXml } from '../../xsd/xml-scan.js';
|
|
11
|
+
const CID_TEXT = /^cid:(.+)$/;
|
|
12
|
+
function walk(elements, visit) {
|
|
13
|
+
for (const element of elements) {
|
|
14
|
+
visit(element);
|
|
15
|
+
walk(element.children, visit);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Visits every element of a scanned envelope, depth first, parents before children. */
|
|
19
|
+
export function forEachScannedElement(elements, visit) {
|
|
20
|
+
walk(elements, visit);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Every element whose entire text content is a `cid:` reference, in document order.
|
|
24
|
+
*
|
|
25
|
+
* @param envelopeXml the envelope to scan
|
|
26
|
+
*/
|
|
27
|
+
export function findCidReferences(envelopeXml) {
|
|
28
|
+
const scan = scanXml(envelopeXml);
|
|
29
|
+
if (scan.problems.length > 0) {
|
|
30
|
+
return { references: [], scannable: false };
|
|
31
|
+
}
|
|
32
|
+
const references = [];
|
|
33
|
+
forEachScannedElement(scan.elements, (element) => {
|
|
34
|
+
const text = element.text;
|
|
35
|
+
if (text === undefined) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const match = CID_TEXT.exec(text.value.trim());
|
|
39
|
+
if (match?.[1] !== undefined) {
|
|
40
|
+
references.push({ cid: match[1], range: text.range });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return { references, scannable: true };
|
|
44
|
+
}
|
|
45
|
+
/** Replaces `[start, end)` ranges in `text`, applying them right to left so offsets stay valid. */
|
|
46
|
+
export function spliceRanges(text, edits) {
|
|
47
|
+
let out = text;
|
|
48
|
+
for (const edit of [...edits].sort((a, b) => b.range.start - a.range.start)) {
|
|
49
|
+
out = out.slice(0, edit.range.start) + edit.text + out.slice(edit.range.end);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Enable Inline Files": an element whose text is exactly `file:<path>` has that
|
|
3
|
+
* file's bytes substituted, base64-encoded, at send time.
|
|
4
|
+
*
|
|
5
|
+
* The decision is syntactic, not schema-driven, so a
|
|
6
|
+
* request can carry a file reference before its schema is even known. A reference that
|
|
7
|
+
* cannot be read is reported and left verbatim in the envelope rather than failing the
|
|
8
|
+
* send: the server's own error is usually more informative than a client-side abort.
|
|
9
|
+
*/
|
|
10
|
+
/** Knobs for {@link inlineFiles}. */
|
|
11
|
+
export interface InlineFilesOptions {
|
|
12
|
+
/** The request's "Enable Inline Files" property; nothing happens when false. */
|
|
13
|
+
readonly enabled: boolean;
|
|
14
|
+
/** Reads one file, rejecting when it does not exist. */
|
|
15
|
+
readonly resolveFile: (path: string) => Promise<Uint8Array>;
|
|
16
|
+
/** Project resource root; relative references are tried against it first. */
|
|
17
|
+
readonly resourceRoot?: string;
|
|
18
|
+
}
|
|
19
|
+
/** A file reference that could not be read. */
|
|
20
|
+
export interface InlineFileProblem {
|
|
21
|
+
readonly code: 'inline-file-missing';
|
|
22
|
+
readonly message: string;
|
|
23
|
+
/** The path as written in the envelope. */
|
|
24
|
+
readonly path: string;
|
|
25
|
+
}
|
|
26
|
+
/** What {@link inlineFiles} produced. */
|
|
27
|
+
export interface InlinedFiles {
|
|
28
|
+
readonly envelopeXml: string;
|
|
29
|
+
/** How many references were replaced. */
|
|
30
|
+
readonly inlined: number;
|
|
31
|
+
readonly problems: readonly InlineFileProblem[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Replaces every `file:` reference in `envelopeXml` with the base64 of the file it names.
|
|
35
|
+
*
|
|
36
|
+
* @param envelopeXml the envelope to rewrite
|
|
37
|
+
* @param options whether the feature is on, how to read a file, and the resource root
|
|
38
|
+
*/
|
|
39
|
+
export declare function inlineFiles(envelopeXml: string, options: InlineFilesOptions): Promise<InlinedFiles>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Enable Inline Files": an element whose text is exactly `file:<path>` has that
|
|
3
|
+
* file's bytes substituted, base64-encoded, at send time.
|
|
4
|
+
*
|
|
5
|
+
* The decision is syntactic, not schema-driven, so a
|
|
6
|
+
* request can carry a file reference before its schema is even known. A reference that
|
|
7
|
+
* cannot be read is reported and left verbatim in the envelope rather than failing the
|
|
8
|
+
* send: the server's own error is usually more informative than a client-side abort.
|
|
9
|
+
*/
|
|
10
|
+
import { isAbsolute, join } from 'node:path';
|
|
11
|
+
import { scanXml } from '../../xsd/xml-scan.js';
|
|
12
|
+
import { forEachScannedElement, spliceRanges } from './cid-scan.js';
|
|
13
|
+
const FILE_TEXT = /^file:(.+)$/;
|
|
14
|
+
/** The paths a reference may resolve to, most specific first. */
|
|
15
|
+
function candidatePaths(reference, resourceRoot) {
|
|
16
|
+
const path = reference.startsWith('//') ? reference.slice(2) : reference;
|
|
17
|
+
if (isAbsolute(path) || resourceRoot === undefined) {
|
|
18
|
+
return [path];
|
|
19
|
+
}
|
|
20
|
+
return [join(resourceRoot, path), path];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Replaces every `file:` reference in `envelopeXml` with the base64 of the file it names.
|
|
24
|
+
*
|
|
25
|
+
* @param envelopeXml the envelope to rewrite
|
|
26
|
+
* @param options whether the feature is on, how to read a file, and the resource root
|
|
27
|
+
*/
|
|
28
|
+
export async function inlineFiles(envelopeXml, options) {
|
|
29
|
+
if (!options.enabled) {
|
|
30
|
+
return { envelopeXml, inlined: 0, problems: [] };
|
|
31
|
+
}
|
|
32
|
+
const scan = scanXml(envelopeXml);
|
|
33
|
+
if (scan.problems.length > 0) {
|
|
34
|
+
return { envelopeXml, inlined: 0, problems: [] };
|
|
35
|
+
}
|
|
36
|
+
const references = [];
|
|
37
|
+
forEachScannedElement(scan.elements, (element) => {
|
|
38
|
+
const text = element.text;
|
|
39
|
+
if (text === undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const match = FILE_TEXT.exec(text.value.trim());
|
|
43
|
+
if (match?.[1] !== undefined) {
|
|
44
|
+
references.push({ path: match[1], range: text.range });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const edits = [];
|
|
48
|
+
const problems = [];
|
|
49
|
+
for (const reference of references) {
|
|
50
|
+
let bytes;
|
|
51
|
+
for (const candidate of candidatePaths(reference.path, options.resourceRoot)) {
|
|
52
|
+
try {
|
|
53
|
+
bytes = await options.resolveFile(candidate);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
bytes = undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (bytes === undefined) {
|
|
61
|
+
problems.push({
|
|
62
|
+
code: 'inline-file-missing',
|
|
63
|
+
message: `Inline file "${reference.path}" could not be read; the reference was left in the request`,
|
|
64
|
+
path: reference.path,
|
|
65
|
+
});
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
edits.push({ range: reference.range, text: Buffer.from(bytes).toString('base64') });
|
|
69
|
+
}
|
|
70
|
+
return { envelopeXml: spliceRanges(envelopeXml, edits), inlined: edits.length, problems };
|
|
71
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTOM/XOP (SOAP Message Transmission Optimization Mechanism).
|
|
3
|
+
*
|
|
4
|
+
* Outgoing, this implements the rule the request editor exposes: an element
|
|
5
|
+
* whose text is exactly `cid:<content-id>` names an attachment, and enabling MTOM replaces
|
|
6
|
+
* that text with an `<xop:Include>` while the bytes travel unencoded in their own MIME
|
|
7
|
+
* part. Nothing is inferred from the schema — a base64Binary element that does not carry a
|
|
8
|
+
* `cid:` reference is left alone, and a `cid:` reference naming no attachment stays as it
|
|
9
|
+
* is (the server may know what it means).
|
|
10
|
+
*
|
|
11
|
+
* Incoming, an `<xop:Include>` can either be expanded back into base64 inside the envelope
|
|
12
|
+
* ("Expand MTOM Attachments") or left in place with the part listed alongside.
|
|
13
|
+
*/
|
|
14
|
+
import type { Attachment } from '../../project/model.js';
|
|
15
|
+
import { type ParsedMultipart } from './multipart.js';
|
|
16
|
+
import type { AttachmentResolver, MultipartPart, ResponseAttachment } from './types.js';
|
|
17
|
+
/** The XOP namespace, whose `Include` element replaces optimised content. */
|
|
18
|
+
export declare const XOP_NS = "http://www.w3.org/2004/08/xop/include";
|
|
19
|
+
/** Knobs for {@link prepareMtomRequest}. */
|
|
20
|
+
export interface MtomOptions {
|
|
21
|
+
/** "Force MTOM": package as MTOM even when nothing was optimised. */
|
|
22
|
+
readonly force: boolean;
|
|
23
|
+
readonly resolver: AttachmentResolver;
|
|
24
|
+
}
|
|
25
|
+
/** What {@link prepareMtomRequest} produced. */
|
|
26
|
+
export interface PreparedMtom {
|
|
27
|
+
/** The envelope with every resolved `cid:` reference replaced by an `xop:Include`. */
|
|
28
|
+
readonly envelopeXml: string;
|
|
29
|
+
readonly parts: readonly MultipartPart[];
|
|
30
|
+
/** True when the message must be packaged as an MTOM `multipart/related`. */
|
|
31
|
+
readonly used: boolean;
|
|
32
|
+
/** Ids of the attachments that became XOP parts; the rest fall through to SwA. */
|
|
33
|
+
readonly consumedIds: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/** What {@link expandMtomResponse} produced. */
|
|
36
|
+
export interface ExpandedMtom {
|
|
37
|
+
readonly envelopeXml: string;
|
|
38
|
+
readonly attachments: readonly ResponseAttachment[];
|
|
39
|
+
/** Content-IDs whose bytes were written into the envelope as base64. */
|
|
40
|
+
readonly inlinedContentIds: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Turns a SOAP content type into the XOP root part's content type.
|
|
44
|
+
*
|
|
45
|
+
* The SOAP media type moves into the `type` parameter (so the receiver knows what the
|
|
46
|
+
* package encodes) and any SOAP 1.2 `action` parameter is kept, at the end, on the root
|
|
47
|
+
* part itself — the multipart's own `Content-Type` has no room for it.
|
|
48
|
+
*
|
|
49
|
+
* @param soapContentType e.g. `text/xml;charset=UTF-8` or `application/soap+xml;charset=UTF-8;action="urn:Add"`
|
|
50
|
+
*/
|
|
51
|
+
export declare function xopContentType(soapContentType: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Rewrites `envelopeXml` for MTOM and resolves the bytes of every attachment it optimises.
|
|
54
|
+
*
|
|
55
|
+
* @param envelopeXml the envelope as it would otherwise be sent
|
|
56
|
+
* @param attachments the request's attachments
|
|
57
|
+
* @param options `force` packaging and the resolver that reads attachment bytes
|
|
58
|
+
*/
|
|
59
|
+
export declare function prepareMtomRequest(envelopeXml: string, attachments: readonly Attachment[], options: MtomOptions): Promise<PreparedMtom>;
|
|
60
|
+
/**
|
|
61
|
+
* Expands (or merely lists) the XOP parts of a `multipart/related` response.
|
|
62
|
+
*
|
|
63
|
+
* With `inline` set, every `<xop:Include>` whose part is present is replaced by that
|
|
64
|
+
* part's base64, which is what the receiver's own XML tooling would have seen; the parts
|
|
65
|
+
* stay listed so the caller can still show and save them. Without it the envelope is
|
|
66
|
+
* returned as received.
|
|
67
|
+
*
|
|
68
|
+
* @param parsed the parsed multipart response
|
|
69
|
+
* @param options `inline` expansion, and the already charset-decoded root text when the caller has it
|
|
70
|
+
*/
|
|
71
|
+
export declare function expandMtomResponse(parsed: ParsedMultipart, options: {
|
|
72
|
+
readonly inline: boolean;
|
|
73
|
+
readonly envelopeXml?: string;
|
|
74
|
+
}): ExpandedMtom;
|