@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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a legacy single-XML SOAP project from a file or text. Mapping it onto a Wirebench project
|
|
3
|
+
* is `map.ts`'s job, once each interface's definition has been resolved.
|
|
4
|
+
*/
|
|
5
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
6
|
+
import { LegacyProjectError } from '../../errors.js';
|
|
7
|
+
import { parseLegacyProject } from './parse.js';
|
|
8
|
+
/** Largest project accepted, in bytes (file) or UTF-16 code units (text). */
|
|
9
|
+
export const MAX_LEGACY_PROJECT_BYTES = 50 * 1024 * 1024;
|
|
10
|
+
function tooLarge() {
|
|
11
|
+
return new LegacyProjectError('legacy-too-large', `The project file is larger than ${String(MAX_LEGACY_PROJECT_BYTES / (1024 * 1024))} MB`);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Reads and parses a legacy SOAP project.
|
|
15
|
+
*
|
|
16
|
+
* @throws LegacyProjectError when the file cannot be read, is too large, or is not a readable project.
|
|
17
|
+
*/
|
|
18
|
+
export async function readLegacySoapProject(source) {
|
|
19
|
+
if (source.kind === 'text') {
|
|
20
|
+
if (source.text.length > MAX_LEGACY_PROJECT_BYTES) {
|
|
21
|
+
throw tooLarge();
|
|
22
|
+
}
|
|
23
|
+
return parseLegacyProject(source.text);
|
|
24
|
+
}
|
|
25
|
+
let size;
|
|
26
|
+
try {
|
|
27
|
+
size = (await stat(source.path)).size;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
size = undefined; // reported by readFile below
|
|
31
|
+
}
|
|
32
|
+
if (size !== undefined && size > MAX_LEGACY_PROJECT_BYTES) {
|
|
33
|
+
throw tooLarge();
|
|
34
|
+
}
|
|
35
|
+
let text;
|
|
36
|
+
try {
|
|
37
|
+
text = await readFile(source.path, 'utf8');
|
|
38
|
+
}
|
|
39
|
+
catch (cause) {
|
|
40
|
+
throw new LegacyProjectError('legacy-read-failed', `Could not read "${source.path}"`, {
|
|
41
|
+
cause,
|
|
42
|
+
details: { path: source.path },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return parseLegacyProject(text, source.path);
|
|
46
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { looksLikeLegacyProject } from './format.js';
|
|
2
|
+
export { MAX_LEGACY_PROJECT_BYTES, readLegacySoapProject } from './import.js';
|
|
3
|
+
export type { LegacyProjectSource } from './import.js';
|
|
4
|
+
export type * from './model.js';
|
|
5
|
+
export { parseLegacyProject } from './parse.js';
|
|
6
|
+
export { definitionRootOf, fetchDocumentFromCache } from './definition-fetcher.js';
|
|
7
|
+
export type { CacheFetchOptions } from './definition-fetcher.js';
|
|
8
|
+
export { formatLegacyImportReport, IMPORTED_SCRIPTS_DIR, mapLegacyProject, resolvedOperationsOf } from './map.js';
|
|
9
|
+
export type { LegacyImportReport, LegacyImportReportItem, LegacyMapContext, LegacyScriptFile, MappedLegacyProject, ResolvedLegacyInterface, ResolvedOperation, } from './map.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { looksLikeLegacyProject } from './format.js';
|
|
2
|
+
export { MAX_LEGACY_PROJECT_BYTES, readLegacySoapProject } from './import.js';
|
|
3
|
+
export { parseLegacyProject } from './parse.js';
|
|
4
|
+
export { definitionRootOf, fetchDocumentFromCache } from './definition-fetcher.js';
|
|
5
|
+
export { formatLegacyImportReport, IMPORTED_SCRIPTS_DIR, mapLegacyProject, resolvedOperationsOf } from './map.js';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a parsed legacy SOAP project onto Wirebench project entities.
|
|
3
|
+
*
|
|
4
|
+
* Pure: resolving each interface's definition (which needs the network or the definition cache) is
|
|
5
|
+
* the caller's job, and it hands the result in as a {@link ResolvedLegacyInterface}. What comes back
|
|
6
|
+
* is ready to be added to a project, plus the report of everything that did not come across.
|
|
7
|
+
*/
|
|
8
|
+
import type { Environment, IdGenerator, Interface } from '../../project/model.js';
|
|
9
|
+
import type { OperationSummary } from '../../types.js';
|
|
10
|
+
import type { LegacyInterface, LegacyProject } from './model.js';
|
|
11
|
+
/** One operation of a resolved definition, as the mapper needs it. */
|
|
12
|
+
export interface ResolvedOperation {
|
|
13
|
+
/** The owning binding as `{namespace}localName`. */
|
|
14
|
+
readonly bindingName: string;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly soapVersion: '1.1' | '1.2' | 'none';
|
|
17
|
+
readonly soapAction?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The engine's operation summaries, as {@link ResolvedOperation}s. */
|
|
20
|
+
export declare function resolvedOperationsOf(summaries: readonly OperationSummary[]): ResolvedOperation[];
|
|
21
|
+
/** A legacy interface after the caller tried to resolve its definition. */
|
|
22
|
+
export type ResolvedLegacyInterface = {
|
|
23
|
+
readonly legacy: LegacyInterface;
|
|
24
|
+
/** The id and slug the caller chose (the slug names the definition-cache folder it wrote). */
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly slug: string;
|
|
27
|
+
} & ({
|
|
28
|
+
readonly resolved: true;
|
|
29
|
+
readonly definitionUrl: string;
|
|
30
|
+
readonly targetNamespace?: string;
|
|
31
|
+
readonly operations: readonly ResolvedOperation[];
|
|
32
|
+
/** Locations that were not in the file's cache and came from the network. */
|
|
33
|
+
readonly fetchedFromNetwork: readonly string[];
|
|
34
|
+
} | {
|
|
35
|
+
readonly resolved: false;
|
|
36
|
+
readonly problem: string;
|
|
37
|
+
});
|
|
38
|
+
/** What the target project already holds, so nothing imported collides with it. */
|
|
39
|
+
export interface LegacyMapContext {
|
|
40
|
+
readonly environmentNames: ReadonlySet<string>;
|
|
41
|
+
readonly environmentSlugs: ReadonlySet<string>;
|
|
42
|
+
readonly propertyNames: ReadonlySet<string>;
|
|
43
|
+
/** The `order` the first imported interface gets; interfaces and APIs share one sequence. */
|
|
44
|
+
readonly firstInterfaceOrder: number;
|
|
45
|
+
readonly firstEnvironmentOrder: number;
|
|
46
|
+
readonly newId?: IdGenerator;
|
|
47
|
+
}
|
|
48
|
+
/** One line of the import report. */
|
|
49
|
+
export interface LegacyImportReportItem {
|
|
50
|
+
readonly severity: 'info' | 'warning';
|
|
51
|
+
/** Owner names from the project down, joined with ` › `; empty for the project itself. */
|
|
52
|
+
readonly path: string;
|
|
53
|
+
readonly message: string;
|
|
54
|
+
}
|
|
55
|
+
/** What came across, and what did not. */
|
|
56
|
+
export interface LegacyImportReport {
|
|
57
|
+
readonly projectName: string;
|
|
58
|
+
readonly counts: {
|
|
59
|
+
readonly interfaces: number;
|
|
60
|
+
readonly operations: number;
|
|
61
|
+
readonly requests: number;
|
|
62
|
+
readonly environments: number;
|
|
63
|
+
readonly properties: number;
|
|
64
|
+
readonly scripts: number;
|
|
65
|
+
};
|
|
66
|
+
readonly items: readonly LegacyImportReportItem[];
|
|
67
|
+
}
|
|
68
|
+
/** A script to write, as is, under the project folder. */
|
|
69
|
+
export interface LegacyScriptFile {
|
|
70
|
+
/** Relative to the project root, `/`-separated, always under {@link IMPORTED_SCRIPTS_DIR}. */
|
|
71
|
+
readonly path: string;
|
|
72
|
+
readonly source: string;
|
|
73
|
+
}
|
|
74
|
+
/** The mapped entities, ready to add to a project. */
|
|
75
|
+
export interface MappedLegacyProject {
|
|
76
|
+
readonly interfaces: readonly Interface[];
|
|
77
|
+
readonly environments: readonly Environment[];
|
|
78
|
+
/** Only the properties the project did not already have. */
|
|
79
|
+
readonly properties: Readonly<Record<string, string>>;
|
|
80
|
+
readonly scripts: readonly LegacyScriptFile[];
|
|
81
|
+
readonly report: LegacyImportReport;
|
|
82
|
+
}
|
|
83
|
+
/** The folder imported scripts are written to. Nothing in Wirebench reads it. */
|
|
84
|
+
export declare const IMPORTED_SCRIPTS_DIR = "imported-scripts";
|
|
85
|
+
/**
|
|
86
|
+
* Maps `project` onto Wirebench entities. `resolved` holds one entry per `project.interfaces`
|
|
87
|
+
* element, in the same order.
|
|
88
|
+
*/
|
|
89
|
+
export declare function mapLegacyProject(project: LegacyProject, resolved: readonly ResolvedLegacyInterface[], context: LegacyMapContext): MappedLegacyProject;
|
|
90
|
+
/** The report as plain text, one line per item, for copying out of the dialog. */
|
|
91
|
+
export declare function formatLegacyImportReport(report: LegacyImportReport): string;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a parsed legacy SOAP project onto Wirebench project entities.
|
|
3
|
+
*
|
|
4
|
+
* Pure: resolving each interface's definition (which needs the network or the definition cache) is
|
|
5
|
+
* the caller's job, and it hands the result in as a {@link ResolvedLegacyInterface}. What comes back
|
|
6
|
+
* is ready to be added to a project, plus the report of everything that did not come across.
|
|
7
|
+
*/
|
|
8
|
+
import { createInterface, createRequest, generateId } from '../../project/model.js';
|
|
9
|
+
import { slugify, uniqueSlug } from '../../project/paths.js';
|
|
10
|
+
import { DEFAULT_WSA_CONFIG } from '../../wsa/model.js';
|
|
11
|
+
import { qnameToString } from '../../wsdl/qname.js';
|
|
12
|
+
/** The engine's operation summaries, as {@link ResolvedOperation}s. */
|
|
13
|
+
export function resolvedOperationsOf(summaries) {
|
|
14
|
+
return summaries.map((summary) => ({
|
|
15
|
+
bindingName: qnameToString(summary.bindingName),
|
|
16
|
+
name: summary.operationName,
|
|
17
|
+
soapVersion: summary.soapVersion,
|
|
18
|
+
...(summary.soapAction !== undefined ? { soapAction: summary.soapAction } : {}),
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/** The folder imported scripts are written to. Nothing in Wirebench reads it. */
|
|
22
|
+
export const IMPORTED_SCRIPTS_DIR = 'imported-scripts';
|
|
23
|
+
const PATH_SEPARATOR = ' › ';
|
|
24
|
+
/** Auth types the file can name that a username alone cannot stand in for. */
|
|
25
|
+
const UNSUPPORTED_AUTH = new Set(['SPNEGO/Kerberos', 'OAuth 2.0', 'OAuth 1.0']);
|
|
26
|
+
function joinPath(...segments) {
|
|
27
|
+
return segments.filter((segment) => segment !== '').join(PATH_SEPARATOR);
|
|
28
|
+
}
|
|
29
|
+
/** A name not in `taken`, numbered from 2 when it is: `Staging`, `Staging 2`, ... */
|
|
30
|
+
function uniqueName(name, taken) {
|
|
31
|
+
const lower = new Set([...taken].map((entry) => entry.toLowerCase()));
|
|
32
|
+
if (!lower.has(name.toLowerCase())) {
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
for (let n = 2;; n += 1) {
|
|
36
|
+
const candidate = `${name} ${String(n)}`;
|
|
37
|
+
if (!lower.has(candidate.toLowerCase())) {
|
|
38
|
+
return candidate;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** The credentials a call carried, as Wirebench auth: a username kept, the password never. */
|
|
43
|
+
function authOf(call) {
|
|
44
|
+
const { username, domain, authType } = call.credentials;
|
|
45
|
+
if (username === undefined || (authType !== undefined && UNSUPPORTED_AUTH.has(authType))) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if (domain !== undefined || authType === 'NTLM') {
|
|
49
|
+
return { type: 'ntlm', username, ...(domain !== undefined ? { domain } : {}) };
|
|
50
|
+
}
|
|
51
|
+
return { type: 'basic', username, ...(authType === 'Preemptive' ? { preemptive: true } : {}) };
|
|
52
|
+
}
|
|
53
|
+
class ReportBuilder {
|
|
54
|
+
items = [];
|
|
55
|
+
info(path, message) {
|
|
56
|
+
this.items.push({ severity: 'info', path, message });
|
|
57
|
+
}
|
|
58
|
+
warning(path, message) {
|
|
59
|
+
this.items.push({ severity: 'warning', path, message });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Everything a call carried that the request cannot, reported against `path`. */
|
|
63
|
+
function reportCallLosses(call, path, report) {
|
|
64
|
+
if (call.credentials.hadPassword) {
|
|
65
|
+
report.warning(path, 'The password was not imported. Enter it again under Auth.');
|
|
66
|
+
}
|
|
67
|
+
const { authType, username } = call.credentials;
|
|
68
|
+
if (username !== undefined && authType !== undefined && UNSUPPORTED_AUTH.has(authType)) {
|
|
69
|
+
report.warning(path, `${authType} authentication is not imported. Set up auth for this request again.`);
|
|
70
|
+
}
|
|
71
|
+
if (call.assertions > 0) {
|
|
72
|
+
report.warning(path, `${String(call.assertions)} assertion${call.assertions === 1 ? ' was' : 's were'} not imported.`);
|
|
73
|
+
}
|
|
74
|
+
if (call.attachments > 0) {
|
|
75
|
+
report.warning(path, `${String(call.attachments)} attachment${call.attachments === 1 ? ' was' : 's were'} not imported. Add the files again.`);
|
|
76
|
+
}
|
|
77
|
+
for (const ref of call.wssRefs) {
|
|
78
|
+
report.warning(path, `The WS-Security configuration "${ref}" was not imported.`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The interface's operations: every operation of the legacy binding in definition order, then any
|
|
83
|
+
* legacy operation the definition no longer has (its requests marked orphaned).
|
|
84
|
+
*/
|
|
85
|
+
function mapOperations(entry, endpoints, newId, report) {
|
|
86
|
+
const { legacy } = entry;
|
|
87
|
+
const ownBinding = entry.operations.filter((operation) => legacy.bindingName === undefined || operation.bindingName === legacy.bindingName);
|
|
88
|
+
const byName = new Map();
|
|
89
|
+
for (const operation of legacy.operations) {
|
|
90
|
+
byName.set(operation.bindingOperationName, operation);
|
|
91
|
+
}
|
|
92
|
+
const taken = new Set();
|
|
93
|
+
const operations = [];
|
|
94
|
+
let requests = 0;
|
|
95
|
+
const build = (name, bindingName, source, resolved) => {
|
|
96
|
+
const slug = uniqueSlug(name, taken);
|
|
97
|
+
taken.add(slug);
|
|
98
|
+
const requestSlugs = new Set();
|
|
99
|
+
const defs = [];
|
|
100
|
+
for (const call of source?.calls ?? []) {
|
|
101
|
+
const path = joinPath(legacy.name, name, call.name);
|
|
102
|
+
if (call.envelope === undefined) {
|
|
103
|
+
report.warning(path, `The request was skipped: ${call.envelopeProblem ?? 'its body could not be read'}.`);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const requestSlug = uniqueSlug(call.name, requestSlugs);
|
|
107
|
+
requestSlugs.add(requestSlug);
|
|
108
|
+
const endpoint = call.endpoint === undefined ? undefined : endpoints.find((candidate) => candidate.url === call.endpoint);
|
|
109
|
+
const soapVersion = resolved !== undefined && resolved.soapVersion !== 'none' ? resolved.soapVersion : legacy.soapVersion;
|
|
110
|
+
const soapAction = resolved?.soapAction ?? source?.action;
|
|
111
|
+
const auth = authOf(call);
|
|
112
|
+
const request = createRequest(call.name, {
|
|
113
|
+
newId,
|
|
114
|
+
slug: requestSlug,
|
|
115
|
+
order: defs.length,
|
|
116
|
+
envelopeXml: call.envelope,
|
|
117
|
+
soapVersion,
|
|
118
|
+
...(soapAction !== undefined ? { soapAction } : {}),
|
|
119
|
+
...(endpoint !== undefined ? { endpointId: endpoint.id } : {}),
|
|
120
|
+
properties: {
|
|
121
|
+
...(call.encoding !== undefined ? { encoding: call.encoding } : {}),
|
|
122
|
+
...(call.timeoutMs !== undefined ? { timeoutMs: call.timeoutMs } : {}),
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
defs.push({
|
|
126
|
+
...request,
|
|
127
|
+
...(endpoint === undefined && call.endpoint !== undefined ? { endpointUrl: call.endpoint } : {}),
|
|
128
|
+
...(auth !== undefined ? { auth } : {}),
|
|
129
|
+
...(call.useWsAddressing ? { wsa: { ...DEFAULT_WSA_CONFIG, enabled: true } } : {}),
|
|
130
|
+
...(resolved === undefined ? { orphaned: true } : {}),
|
|
131
|
+
});
|
|
132
|
+
reportCallLosses(call, path, report);
|
|
133
|
+
}
|
|
134
|
+
requests += defs.length;
|
|
135
|
+
operations.push({ name, bindingName, slug, order: operations.length, requests: defs });
|
|
136
|
+
};
|
|
137
|
+
const matched = new Set();
|
|
138
|
+
for (const resolved of ownBinding) {
|
|
139
|
+
const source = byName.get(resolved.name);
|
|
140
|
+
if (source !== undefined) {
|
|
141
|
+
matched.add(source);
|
|
142
|
+
}
|
|
143
|
+
build(resolved.name, resolved.bindingName, source, resolved);
|
|
144
|
+
}
|
|
145
|
+
const fallbackBinding = legacy.bindingName ?? ownBinding[0]?.bindingName ?? '';
|
|
146
|
+
for (const source of legacy.operations) {
|
|
147
|
+
if (matched.has(source)) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (source.calls.length > 0) {
|
|
151
|
+
report.info(joinPath(legacy.name, source.name), 'The definition no longer has this operation; its requests were kept and marked as orphaned.');
|
|
152
|
+
}
|
|
153
|
+
build(source.bindingOperationName, fallbackBinding, source, undefined);
|
|
154
|
+
}
|
|
155
|
+
return { operations, requests };
|
|
156
|
+
}
|
|
157
|
+
/** Where a script lands: `imported-scripts/<owners...>/<element>.<ext>`, unique within `taken`. */
|
|
158
|
+
function scriptPath(script, taken) {
|
|
159
|
+
const extension = script.language?.toLowerCase() === 'javascript' ? 'js' : 'groovy';
|
|
160
|
+
const folder = [IMPORTED_SCRIPTS_DIR, ...script.ownerPath.map(slugify)].join('/');
|
|
161
|
+
let candidate = `${folder}/${script.element}.${extension}`;
|
|
162
|
+
for (let n = 2; taken.has(candidate.toLowerCase()); n += 1) {
|
|
163
|
+
candidate = `${folder}/${script.element}-${String(n)}.${extension}`;
|
|
164
|
+
}
|
|
165
|
+
taken.add(candidate.toLowerCase());
|
|
166
|
+
return candidate;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Maps `project` onto Wirebench entities. `resolved` holds one entry per `project.interfaces`
|
|
170
|
+
* element, in the same order.
|
|
171
|
+
*/
|
|
172
|
+
export function mapLegacyProject(project, resolved, context) {
|
|
173
|
+
const newId = context.newId ?? generateId;
|
|
174
|
+
const report = new ReportBuilder();
|
|
175
|
+
const interfaces = [];
|
|
176
|
+
const slugByLegacyName = new Map();
|
|
177
|
+
let operationCount = 0;
|
|
178
|
+
let requestCount = 0;
|
|
179
|
+
for (const entry of resolved) {
|
|
180
|
+
const { legacy } = entry;
|
|
181
|
+
if (!entry.resolved) {
|
|
182
|
+
report.warning(legacy.name, `The interface was not imported: ${entry.problem}`);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
for (const location of entry.fetchedFromNetwork) {
|
|
186
|
+
report.info(legacy.name, `The project file held no copy of ${location}, so it was fetched from the network.`);
|
|
187
|
+
}
|
|
188
|
+
const endpoints = legacy.endpoints.map((url) => ({
|
|
189
|
+
id: newId(),
|
|
190
|
+
name: url,
|
|
191
|
+
url,
|
|
192
|
+
authMode: 'complement',
|
|
193
|
+
}));
|
|
194
|
+
const { operations, requests } = mapOperations(entry, endpoints, newId, report);
|
|
195
|
+
operationCount += operations.length;
|
|
196
|
+
requestCount += requests;
|
|
197
|
+
interfaces.push(createInterface(legacy.name, {
|
|
198
|
+
id: entry.id,
|
|
199
|
+
slug: entry.slug,
|
|
200
|
+
order: context.firstInterfaceOrder + interfaces.length,
|
|
201
|
+
definitionUrl: entry.definitionUrl,
|
|
202
|
+
...(entry.targetNamespace !== undefined ? { targetNamespace: entry.targetNamespace } : {}),
|
|
203
|
+
endpoints,
|
|
204
|
+
operations,
|
|
205
|
+
}));
|
|
206
|
+
slugByLegacyName.set(legacy.name, entry.slug);
|
|
207
|
+
}
|
|
208
|
+
const properties = {};
|
|
209
|
+
for (const property of project.properties) {
|
|
210
|
+
if (context.propertyNames.has(property.name) || property.name in properties) {
|
|
211
|
+
report.info('', `The project property "${property.name}" already exists and kept its current value.`);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
properties[property.name] = property.value;
|
|
215
|
+
}
|
|
216
|
+
const environmentNames = new Set(context.environmentNames);
|
|
217
|
+
const environmentSlugs = new Set(context.environmentSlugs);
|
|
218
|
+
const environments = [];
|
|
219
|
+
for (const legacy of project.environments) {
|
|
220
|
+
const name = uniqueName(legacy.name, environmentNames);
|
|
221
|
+
environmentNames.add(name);
|
|
222
|
+
if (name !== legacy.name) {
|
|
223
|
+
report.info(legacy.name, `An environment with this name already exists, so it was imported as "${name}".`);
|
|
224
|
+
}
|
|
225
|
+
const slug = uniqueSlug(name, environmentSlugs);
|
|
226
|
+
environmentSlugs.add(slug);
|
|
227
|
+
const endpoints = {};
|
|
228
|
+
for (const override of legacy.endpoints) {
|
|
229
|
+
const interfaceSlug = slugByLegacyName.get(override.interfaceName);
|
|
230
|
+
if (interfaceSlug === undefined) {
|
|
231
|
+
report.warning(joinPath(name, override.interfaceName), 'The endpoint override was not imported: its interface was not imported.');
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
endpoints[interfaceSlug] = override.url;
|
|
235
|
+
}
|
|
236
|
+
const values = {};
|
|
237
|
+
for (const property of legacy.properties) {
|
|
238
|
+
values[property.name] = property.value;
|
|
239
|
+
}
|
|
240
|
+
environments.push({
|
|
241
|
+
id: newId(),
|
|
242
|
+
name,
|
|
243
|
+
slug,
|
|
244
|
+
order: context.firstEnvironmentOrder + environments.length,
|
|
245
|
+
endpoints,
|
|
246
|
+
properties: values,
|
|
247
|
+
disabledProperties: [],
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
const scriptPaths = new Set();
|
|
251
|
+
const scripts = project.scripts.map((script) => {
|
|
252
|
+
const path = scriptPath(script, scriptPaths);
|
|
253
|
+
report.info(joinPath(...script.ownerPath), `A script (${script.element}) was saved to ${path}. It is not run.`);
|
|
254
|
+
return { path, source: script.source };
|
|
255
|
+
});
|
|
256
|
+
for (const unmapped of project.unmapped) {
|
|
257
|
+
report.warning(joinPath(...unmapped.ownerPath), unmapped.message);
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
interfaces,
|
|
261
|
+
environments,
|
|
262
|
+
properties,
|
|
263
|
+
scripts,
|
|
264
|
+
report: {
|
|
265
|
+
projectName: project.name,
|
|
266
|
+
counts: {
|
|
267
|
+
interfaces: interfaces.length,
|
|
268
|
+
operations: operationCount,
|
|
269
|
+
requests: requestCount,
|
|
270
|
+
environments: environments.length,
|
|
271
|
+
properties: Object.keys(properties).length,
|
|
272
|
+
scripts: scripts.length,
|
|
273
|
+
},
|
|
274
|
+
items: report.items,
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/** The report as plain text, one line per item, for copying out of the dialog. */
|
|
279
|
+
export function formatLegacyImportReport(report) {
|
|
280
|
+
const { counts } = report;
|
|
281
|
+
const lines = [
|
|
282
|
+
`Imported "${report.projectName}": ${String(counts.interfaces)} interfaces, ${String(counts.operations)} operations, ` +
|
|
283
|
+
`${String(counts.requests)} requests, ${String(counts.environments)} environments, ` +
|
|
284
|
+
`${String(counts.properties)} properties, ${String(counts.scripts)} scripts.`,
|
|
285
|
+
];
|
|
286
|
+
for (const item of report.items) {
|
|
287
|
+
lines.push(`${item.severity === 'warning' ? 'Warning' : 'Note'}: ${item.path === '' ? '' : `${item.path}: `}${item.message}`);
|
|
288
|
+
}
|
|
289
|
+
return lines.join('\n');
|
|
290
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A legacy single-XML SOAP project file as the import reads it: only what v1 maps, plus enough about
|
|
3
|
+
* everything else to say in the import report what was left behind.
|
|
4
|
+
*/
|
|
5
|
+
/** A name/value pair from a `properties` list or an environment. */
|
|
6
|
+
export interface LegacyProperty {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly value: string;
|
|
9
|
+
}
|
|
10
|
+
/** One document of an interface's cached definition, keyed by the URL it was fetched from. */
|
|
11
|
+
export interface LegacyDefinitionPart {
|
|
12
|
+
readonly url: string;
|
|
13
|
+
readonly content: string;
|
|
14
|
+
}
|
|
15
|
+
/** The definition an interface carried, so it can be resolved without the network. */
|
|
16
|
+
export interface LegacyDefinitionCache {
|
|
17
|
+
/** The URL of the root WSDL among {@link parts}, when the file names one. */
|
|
18
|
+
readonly rootPart?: string;
|
|
19
|
+
readonly parts: readonly LegacyDefinitionPart[];
|
|
20
|
+
}
|
|
21
|
+
/** The credentials of a saved request. The password itself is never kept. */
|
|
22
|
+
export interface LegacyCredentials {
|
|
23
|
+
readonly username?: string;
|
|
24
|
+
readonly domain?: string;
|
|
25
|
+
/** True when the file had a non-empty password, so the report can ask for it to be re-entered. */
|
|
26
|
+
readonly hadPassword: boolean;
|
|
27
|
+
readonly authType?: string;
|
|
28
|
+
}
|
|
29
|
+
/** A saved request (`call`) under an operation. */
|
|
30
|
+
export interface LegacyCall {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly endpoint?: string;
|
|
33
|
+
/** The envelope as text, decompressed when it was stored compressed. Absent when it could not be read. */
|
|
34
|
+
readonly envelope?: string;
|
|
35
|
+
/** Why {@link envelope} is absent. */
|
|
36
|
+
readonly envelopeProblem?: string;
|
|
37
|
+
readonly encoding?: string;
|
|
38
|
+
readonly timeoutMs?: number;
|
|
39
|
+
readonly credentials: LegacyCredentials;
|
|
40
|
+
readonly useWsAddressing: boolean;
|
|
41
|
+
readonly assertions: number;
|
|
42
|
+
readonly attachments: number;
|
|
43
|
+
/** Names of the outgoing and incoming WS-Security configurations the request referenced. */
|
|
44
|
+
readonly wssRefs: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
/** A binding operation and its saved requests. */
|
|
47
|
+
export interface LegacyOperation {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
/** The operation's name in the binding; falls back to {@link name}. */
|
|
50
|
+
readonly bindingOperationName: string;
|
|
51
|
+
readonly action?: string;
|
|
52
|
+
readonly calls: readonly LegacyCall[];
|
|
53
|
+
}
|
|
54
|
+
/** A SOAP interface (one WSDL binding). */
|
|
55
|
+
export interface LegacyInterface {
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly definitionUrl?: string;
|
|
58
|
+
/** The binding as `{namespace}localName`. */
|
|
59
|
+
readonly bindingName?: string;
|
|
60
|
+
readonly soapVersion: '1.1' | '1.2';
|
|
61
|
+
readonly cache?: LegacyDefinitionCache;
|
|
62
|
+
readonly endpoints: readonly string[];
|
|
63
|
+
readonly operations: readonly LegacyOperation[];
|
|
64
|
+
}
|
|
65
|
+
/** A named set of property values and per-interface endpoint overrides. */
|
|
66
|
+
export interface LegacyEnvironment {
|
|
67
|
+
readonly name: string;
|
|
68
|
+
readonly properties: readonly LegacyProperty[];
|
|
69
|
+
/** The endpoint URL this environment sends each named interface to. */
|
|
70
|
+
readonly endpoints: readonly {
|
|
71
|
+
readonly interfaceName: string;
|
|
72
|
+
readonly url: string;
|
|
73
|
+
}[];
|
|
74
|
+
}
|
|
75
|
+
/** A script found anywhere in the file, never run. */
|
|
76
|
+
export interface LegacyScript {
|
|
77
|
+
/** Names of the owning items from the project down, e.g. `['Smoke', 'Echo once']`. Empty at project level. */
|
|
78
|
+
readonly ownerPath: readonly string[];
|
|
79
|
+
/** The element that held it, e.g. `afterLoadScript`, or `script` for a script test step. */
|
|
80
|
+
readonly element: string;
|
|
81
|
+
readonly language?: string;
|
|
82
|
+
readonly source: string;
|
|
83
|
+
}
|
|
84
|
+
/** Something in the file that holds user work v1 does not map. */
|
|
85
|
+
export interface LegacyUnmapped {
|
|
86
|
+
readonly ownerPath: readonly string[];
|
|
87
|
+
readonly message: string;
|
|
88
|
+
}
|
|
89
|
+
/** The whole file as read. */
|
|
90
|
+
export interface LegacyProject {
|
|
91
|
+
readonly name: string;
|
|
92
|
+
readonly description?: string;
|
|
93
|
+
readonly properties: readonly LegacyProperty[];
|
|
94
|
+
readonly interfaces: readonly LegacyInterface[];
|
|
95
|
+
readonly environments: readonly LegacyEnvironment[];
|
|
96
|
+
readonly scripts: readonly LegacyScript[];
|
|
97
|
+
readonly unmapped: readonly LegacyUnmapped[];
|
|
98
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 type { LegacyProject } from './model.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parses `text` as a legacy single-XML SOAP project.
|
|
11
|
+
*
|
|
12
|
+
* @throws LegacyProjectError `legacy-malformed` when the XML is not well-formed or declares a DTD,
|
|
13
|
+
* `legacy-not-a-project` when it is some other document, and `legacy-encrypted` when the project
|
|
14
|
+
* was saved encrypted.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseLegacyProject(text: string, location?: string): LegacyProject;
|