@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,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment resolution: named sets of endpoints and property overrides, which let a
|
|
3
|
+
* saved project be pointed at different deployments (endpoints + property
|
|
4
|
+
* overrides) without editing the project itself.
|
|
5
|
+
*
|
|
6
|
+
* Precedence for the endpoint a request is actually sent to: an active
|
|
7
|
+
* environment's override for the interface (an explicit deployment choice)
|
|
8
|
+
* wins over everything else, including a request's own custom URL; then the
|
|
9
|
+
* request's custom URL; then its chosen endpoint; then the interface
|
|
10
|
+
* default; then the interface's first endpoint.
|
|
11
|
+
*/
|
|
12
|
+
import { enabledProperties } from './properties.js';
|
|
13
|
+
/** Finds the environment with `envId` in `project`, or `undefined` when there is none or it isn't found. */
|
|
14
|
+
export function findEnvironment(project, envId) {
|
|
15
|
+
if (envId === undefined) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return project.environments.find((environment) => environment.id === envId);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the URL a request should actually be sent to, given an optional
|
|
22
|
+
* active environment. See the module doc for the precedence order.
|
|
23
|
+
*
|
|
24
|
+
* `endpoint` is the `Endpoint` object the URL came from, when one exists — the environment
|
|
25
|
+
* override and a request's custom URL name no endpoint, so they carry none. Callers that need
|
|
26
|
+
* the endpoint's own settings (its `trustInvalid` flag, say) read it from here rather than
|
|
27
|
+
* re-deriving the precedence.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveEndpoint(project, envId, iface, request) {
|
|
30
|
+
const environment = findEnvironment(project, envId);
|
|
31
|
+
if (environment !== undefined) {
|
|
32
|
+
const override = environment.endpoints[iface.slug];
|
|
33
|
+
if (override !== undefined) {
|
|
34
|
+
return { url: override, source: 'environment' };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (request.endpointUrl !== undefined) {
|
|
38
|
+
return { url: request.endpointUrl, source: 'request-custom' };
|
|
39
|
+
}
|
|
40
|
+
if (request.endpointId !== undefined) {
|
|
41
|
+
const endpoint = iface.endpoints.find((candidate) => candidate.id === request.endpointId);
|
|
42
|
+
if (endpoint !== undefined) {
|
|
43
|
+
return { url: endpoint.url, source: 'request-endpoint', endpoint };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (iface.defaultEndpointId !== undefined) {
|
|
47
|
+
const endpoint = iface.endpoints.find((candidate) => candidate.id === iface.defaultEndpointId);
|
|
48
|
+
if (endpoint !== undefined) {
|
|
49
|
+
return { url: endpoint.url, source: 'interface-default', endpoint };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const first = iface.endpoints[0];
|
|
53
|
+
if (first !== undefined) {
|
|
54
|
+
return { url: first.url, source: 'interface-default', endpoint: first };
|
|
55
|
+
}
|
|
56
|
+
return { url: undefined, source: 'none' };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolves the base URL a REST API's requests are sent against.
|
|
60
|
+
*
|
|
61
|
+
* The same shape as {@link resolveEndpoint} and the same precedence as far as it goes: an active
|
|
62
|
+
* environment's override for the API wins over the API's own base URL, because choosing an
|
|
63
|
+
* environment is how a user says "point everything at test". An API has no per-request URL
|
|
64
|
+
* override to consider — a request that needs another host writes an absolute URL instead.
|
|
65
|
+
*/
|
|
66
|
+
export function resolveApiBaseUrl(project, envId, api) {
|
|
67
|
+
const environment = findEnvironment(project, envId);
|
|
68
|
+
const override = environment?.endpoints[api.slug];
|
|
69
|
+
return override !== undefined ? { url: override, source: 'environment' } : { url: api.baseUrl, source: 'api' };
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Resolves the `Endpoint` object a request's *credentials* should come from: the request's own
|
|
73
|
+
* chosen endpoint, else the interface's default, else its first endpoint — the same precedence
|
|
74
|
+
* {@link resolveEndpoint} uses for the URL (minus the environment-override and custom-URL cases,
|
|
75
|
+
* which name no `Endpoint` object of their own, so have no auth to contribute). Callers that need
|
|
76
|
+
* a request's effective auth (not just its URL) should resolve the endpoint through this function
|
|
77
|
+
* rather than re-deriving the precedence, so the two cannot drift apart.
|
|
78
|
+
*/
|
|
79
|
+
export function resolveAuthEndpoint(iface, request) {
|
|
80
|
+
if (request.endpointId !== undefined) {
|
|
81
|
+
const endpoint = iface.endpoints.find((candidate) => candidate.id === request.endpointId);
|
|
82
|
+
if (endpoint !== undefined) {
|
|
83
|
+
return endpoint;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (iface.defaultEndpointId !== undefined) {
|
|
87
|
+
const endpoint = iface.endpoints.find((candidate) => candidate.id === iface.defaultEndpointId);
|
|
88
|
+
if (endpoint !== undefined) {
|
|
89
|
+
return endpoint;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return iface.endpoints[0];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Builds the {@link PropertyScopes} for expanding properties against `project`
|
|
96
|
+
* under the (optional) active environment `envId`. `env` is omitted entirely
|
|
97
|
+
* when there is no active environment, so shorthand lookups correctly skip it.
|
|
98
|
+
* A property switched off via `disabledProperties` (on the project, or on the
|
|
99
|
+
* active environment) is excluded from its scope's map, so it resolves exactly
|
|
100
|
+
* as if it were absent — see {@link enabledProperties}.
|
|
101
|
+
*/
|
|
102
|
+
export function resolveScopes(project, envId, globals, system) {
|
|
103
|
+
const environment = findEnvironment(project, envId);
|
|
104
|
+
return {
|
|
105
|
+
project: enabledProperties(project.properties, project.disabledProperties),
|
|
106
|
+
global: globals,
|
|
107
|
+
...(environment !== undefined
|
|
108
|
+
? { env: enabledProperties(environment.properties, environment.disabledProperties) }
|
|
109
|
+
: {}),
|
|
110
|
+
...(system !== undefined ? { system } : {}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Replaces the environment with `env.id` if present, else appends it; preserves relative order otherwise. */
|
|
114
|
+
export function upsertEnvironment(project, env) {
|
|
115
|
+
const exists = project.environments.some((candidate) => candidate.id === env.id);
|
|
116
|
+
const environments = exists
|
|
117
|
+
? project.environments.map((candidate) => (candidate.id === env.id ? env : candidate))
|
|
118
|
+
: [...project.environments, env];
|
|
119
|
+
return { ...project, environments };
|
|
120
|
+
}
|
|
121
|
+
/** Removes the environment with `envId`, keeping the remaining environments' relative order. */
|
|
122
|
+
export function removeEnvironment(project, envId) {
|
|
123
|
+
return { ...project, environments: project.environments.filter((candidate) => candidate.id !== envId) };
|
|
124
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The narrow file-system surface the project loader/saver needs, so callers can
|
|
3
|
+
* substitute an in-memory or instrumented implementation in tests.
|
|
4
|
+
*/
|
|
5
|
+
/** One entry of a directory listing. */
|
|
6
|
+
export interface DirEntry {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly isDirectory: boolean;
|
|
9
|
+
readonly isFile: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Minimal metadata about a path. */
|
|
12
|
+
export interface FileStat {
|
|
13
|
+
readonly isDirectory: boolean;
|
|
14
|
+
readonly isFile: boolean;
|
|
15
|
+
readonly size: number;
|
|
16
|
+
}
|
|
17
|
+
/** The file-system operations `loadProject`/`saveProject` depend on. */
|
|
18
|
+
export interface FsLike {
|
|
19
|
+
readFile(path: string): Promise<Buffer>;
|
|
20
|
+
writeFile(path: string, data: Buffer | string): Promise<void>;
|
|
21
|
+
rename(from: string, to: string): Promise<void>;
|
|
22
|
+
mkdir(path: string, options: {
|
|
23
|
+
readonly recursive: true;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
readdir(path: string): Promise<readonly DirEntry[]>;
|
|
26
|
+
stat(path: string): Promise<FileStat>;
|
|
27
|
+
rm(path: string, options?: {
|
|
28
|
+
readonly recursive?: boolean;
|
|
29
|
+
readonly force?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/** The default {@link FsLike}, backed by `node:fs/promises`. */
|
|
33
|
+
export declare const nodeFs: FsLike;
|
|
34
|
+
/** True when the error is a "no such file or directory" error. */
|
|
35
|
+
export declare function isNotFound(error: unknown): boolean;
|
|
36
|
+
/** Reads a file, returning `undefined` instead of throwing when it does not exist. */
|
|
37
|
+
export declare function readFileIfExists(fs: FsLike, path: string): Promise<Buffer | undefined>;
|
|
38
|
+
/** Lists a directory, returning `[]` instead of throwing when it does not exist. */
|
|
39
|
+
export declare function readdirIfExists(fs: FsLike, path: string): Promise<readonly DirEntry[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Writes `data` to `path` atomically: the bytes land in a sibling temp file that
|
|
42
|
+
* is then renamed over the target, so a crash mid-write can never leave a
|
|
43
|
+
* half-written project file behind.
|
|
44
|
+
*/
|
|
45
|
+
export declare function writeFileAtomic(fs: FsLike, path: string, data: Buffer | string): Promise<void>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The narrow file-system surface the project loader/saver needs, so callers can
|
|
3
|
+
* substitute an in-memory or instrumented implementation in tests.
|
|
4
|
+
*/
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import { dirname } from 'node:path';
|
|
7
|
+
import { mkdir as nodeMkdir, readFile as nodeReadFile, readdir as nodeReaddir, rename as nodeRename, rm as nodeRm, stat as nodeStat, writeFile as nodeWriteFile, } from 'node:fs/promises';
|
|
8
|
+
/** The default {@link FsLike}, backed by `node:fs/promises`. */
|
|
9
|
+
export const nodeFs = {
|
|
10
|
+
async readFile(path) {
|
|
11
|
+
return nodeReadFile(path);
|
|
12
|
+
},
|
|
13
|
+
async writeFile(path, data) {
|
|
14
|
+
await nodeWriteFile(path, data);
|
|
15
|
+
},
|
|
16
|
+
async rename(from, to) {
|
|
17
|
+
await nodeRename(from, to);
|
|
18
|
+
},
|
|
19
|
+
async mkdir(path, options) {
|
|
20
|
+
await nodeMkdir(path, options);
|
|
21
|
+
},
|
|
22
|
+
async readdir(path) {
|
|
23
|
+
const entries = await nodeReaddir(path, { withFileTypes: true });
|
|
24
|
+
return entries.map((e) => ({ name: e.name, isDirectory: e.isDirectory(), isFile: e.isFile() }));
|
|
25
|
+
},
|
|
26
|
+
async stat(path) {
|
|
27
|
+
const s = await nodeStat(path);
|
|
28
|
+
return { isDirectory: s.isDirectory(), isFile: s.isFile(), size: s.size };
|
|
29
|
+
},
|
|
30
|
+
async rm(path, options) {
|
|
31
|
+
await nodeRm(path, options);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
/** True when the error is a "no such file or directory" error. */
|
|
35
|
+
export function isNotFound(error) {
|
|
36
|
+
return typeof error === 'object' && error !== null && error.code === 'ENOENT';
|
|
37
|
+
}
|
|
38
|
+
/** Reads a file, returning `undefined` instead of throwing when it does not exist. */
|
|
39
|
+
export async function readFileIfExists(fs, path) {
|
|
40
|
+
try {
|
|
41
|
+
return await fs.readFile(path);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (isNotFound(error)) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** Lists a directory, returning `[]` instead of throwing when it does not exist. */
|
|
51
|
+
export async function readdirIfExists(fs, path) {
|
|
52
|
+
try {
|
|
53
|
+
return await fs.readdir(path);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (isNotFound(error)) {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Writes `data` to `path` atomically: the bytes land in a sibling temp file that
|
|
64
|
+
* is then renamed over the target, so a crash mid-write can never leave a
|
|
65
|
+
* half-written project file behind.
|
|
66
|
+
*/
|
|
67
|
+
export async function writeFileAtomic(fs, path, data) {
|
|
68
|
+
await fs.mkdir(dirname(path), { recursive: true });
|
|
69
|
+
const temp = `${path}.tmp-${randomBytes(6).toString('hex')}`;
|
|
70
|
+
try {
|
|
71
|
+
await fs.writeFile(temp, data);
|
|
72
|
+
await fs.rename(temp, path);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
await fs.rm(temp, { force: true }).catch(() => undefined);
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent, per-project request history: a JSON-Lines file the desktop app keeps outside the
|
|
3
|
+
* project folder (under Electron's `userData`), so history survives even when the project folder
|
|
4
|
+
* itself is deleted, moved, or never saved. Entries are appended already redacted — this module
|
|
5
|
+
* never sees a secret, it only stores and reads back whatever the caller hands it.
|
|
6
|
+
*
|
|
7
|
+
* Pure and `FsLike`-injectable, like the rest of `project/*`: no knowledge of Electron's
|
|
8
|
+
* `userData`, no knowledge of the wire format's redaction rules.
|
|
9
|
+
*/
|
|
10
|
+
import type { FsLike } from './fs.js';
|
|
11
|
+
import type { WsExchange, WsFrame } from '../ws/model.js';
|
|
12
|
+
/** One HTTP header, in author order. */
|
|
13
|
+
export interface HistoryHeader {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly value: string;
|
|
16
|
+
}
|
|
17
|
+
/** The SOAP fault a send resolved to, if any. */
|
|
18
|
+
export interface HistoryFault {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly reason: string;
|
|
21
|
+
}
|
|
22
|
+
/** Why a send failed before a response was ever received (transport error, timeout, abort, ...). */
|
|
23
|
+
export interface HistoryError {
|
|
24
|
+
readonly code: string;
|
|
25
|
+
readonly message: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The gRPC side of a history entry: the call and every message on both sides. The response is a
|
|
29
|
+
* list rather than one body because a server stream answers with several — the extension ADR-0007
|
|
30
|
+
* left room for — and the SOAP-shaped fields carry what they can (`interfaceName` the API, `endpoint`
|
|
31
|
+
* the target, `status` the HTTP status) so one history view serves all three protocols.
|
|
32
|
+
*/
|
|
33
|
+
export interface HistoryGrpc {
|
|
34
|
+
readonly service: string;
|
|
35
|
+
readonly method: string;
|
|
36
|
+
readonly methodKind: 'unary' | 'server-streaming' | 'client-streaming' | 'bidi-streaming';
|
|
37
|
+
/** The gRPC status code, absent when the call never produced one. */
|
|
38
|
+
readonly status?: number;
|
|
39
|
+
readonly statusName?: string;
|
|
40
|
+
readonly statusMessage?: string;
|
|
41
|
+
/** Request messages as canonical JSON text, in send order. */
|
|
42
|
+
readonly requestMessages: readonly string[];
|
|
43
|
+
/** Response messages as canonical JSON text (or base64 when one did not decode), in arrival order. */
|
|
44
|
+
readonly responseMessages: readonly string[];
|
|
45
|
+
readonly trailers: readonly HistoryHeader[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The WebSocket side of a history entry: one session's handshake outcome, how it closed, the
|
|
49
|
+
* frame counts, and a capped transcript ({@link capFrames}) so a chatty session doesn't blow up
|
|
50
|
+
* the history file.
|
|
51
|
+
*/
|
|
52
|
+
export interface HistoryWs {
|
|
53
|
+
readonly url: string;
|
|
54
|
+
/** The handshake's HTTP status, absent when the handshake never got a response. */
|
|
55
|
+
readonly status?: number;
|
|
56
|
+
/** The subprotocol the server picked, absent when none was negotiated. */
|
|
57
|
+
readonly protocol?: string;
|
|
58
|
+
readonly closeCode: number;
|
|
59
|
+
readonly closeReason: string;
|
|
60
|
+
readonly closedBy: 'client' | 'server' | 'error';
|
|
61
|
+
readonly counts: WsExchange['counts'];
|
|
62
|
+
readonly frames: readonly WsFrame[];
|
|
63
|
+
/** Set only when {@link capFrames} actually trimmed something (frames, or just a payload). */
|
|
64
|
+
readonly truncated?: boolean;
|
|
65
|
+
/** How many frames were dropped by the head/tail cap; absent when only a payload was stripped. */
|
|
66
|
+
readonly omittedFrames?: number;
|
|
67
|
+
/** The handshake's transport error, absent when the handshake succeeded (or never ran). */
|
|
68
|
+
readonly error?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* One recorded send. Stored **already redacted** by the caller — this module has no concept of
|
|
72
|
+
* secrets and never inspects `request`/`response` bodies beyond storing and searching them.
|
|
73
|
+
*/
|
|
74
|
+
export interface HistoryEntry {
|
|
75
|
+
/** ulid, also the entry's sort key (ulids are lexicographically time-ordered). */
|
|
76
|
+
readonly id: string;
|
|
77
|
+
/**
|
|
78
|
+
* Which protocol this send used. Absent in every line written before the REST client, so a
|
|
79
|
+
* missing value reads as `'soap'` ({@link normalizeHistoryEntry}) and no file needs migrating.
|
|
80
|
+
*
|
|
81
|
+
* The response side of the record is deliberately one message. A protocol that answers with
|
|
82
|
+
* several — a gRPC server stream — extends this union with its own shape rather than bending
|
|
83
|
+
* this one, which is why the field exists before there is a second value for it to hold.
|
|
84
|
+
*/
|
|
85
|
+
readonly kind?: 'soap' | 'rest' | 'grpc' | 'websocket';
|
|
86
|
+
/** The HTTP method, for a REST send. A SOAP send is always a POST and does not record one. */
|
|
87
|
+
readonly method?: string;
|
|
88
|
+
/** ISO-8601 timestamp of the send. */
|
|
89
|
+
readonly at: string;
|
|
90
|
+
readonly projectId: string;
|
|
91
|
+
/** The saved request this send came from, if it still existed at send time. */
|
|
92
|
+
readonly requestId?: string;
|
|
93
|
+
/** The saved request's name at send time, or a synthesised label for an ad-hoc/raw resend. */
|
|
94
|
+
readonly requestName: string;
|
|
95
|
+
readonly interfaceName: string;
|
|
96
|
+
readonly operationName: string;
|
|
97
|
+
readonly endpoint: string;
|
|
98
|
+
readonly soapVersion: '1.1' | '1.2' | 'none';
|
|
99
|
+
readonly soapAction?: string;
|
|
100
|
+
/** HTTP status, absent when the send never received a response. */
|
|
101
|
+
readonly status?: number;
|
|
102
|
+
readonly durationMs: number;
|
|
103
|
+
/** True for a 2xx response with no SOAP fault. */
|
|
104
|
+
readonly ok: boolean;
|
|
105
|
+
readonly fault?: HistoryFault;
|
|
106
|
+
readonly request: {
|
|
107
|
+
readonly envelopeXml: string;
|
|
108
|
+
readonly headers: readonly HistoryHeader[];
|
|
109
|
+
};
|
|
110
|
+
readonly response?: {
|
|
111
|
+
readonly envelopeXml?: string;
|
|
112
|
+
readonly rawHeaders: readonly (readonly [string, string])[];
|
|
113
|
+
readonly status: number;
|
|
114
|
+
readonly statusText: string;
|
|
115
|
+
};
|
|
116
|
+
readonly error?: HistoryError;
|
|
117
|
+
/** The call record of a gRPC send; absent for the other protocols. */
|
|
118
|
+
readonly grpc?: HistoryGrpc;
|
|
119
|
+
/** The session record of a WebSocket send; absent for the other protocols. */
|
|
120
|
+
readonly ws?: HistoryWs;
|
|
121
|
+
readonly sizeBytes: number;
|
|
122
|
+
readonly tags?: readonly string[];
|
|
123
|
+
}
|
|
124
|
+
/** Options accepted by {@link appendHistory} and {@link openHistory}. */
|
|
125
|
+
export interface HistoryOptions {
|
|
126
|
+
readonly fs?: FsLike;
|
|
127
|
+
/** Oldest entries are dropped once the file holds more than this many. Defaults to 1000. */
|
|
128
|
+
readonly cap?: number;
|
|
129
|
+
}
|
|
130
|
+
/** Filters accepted by {@link HistoryFile.list}. */
|
|
131
|
+
export interface HistoryListQuery {
|
|
132
|
+
/** Case-insensitive substring match over name/operation/interface/endpoint/status/fault/tags. */
|
|
133
|
+
readonly query?: string;
|
|
134
|
+
readonly limit?: number;
|
|
135
|
+
/** Only entries strictly older than this id (for paging past a previous page's last row). */
|
|
136
|
+
readonly before?: string;
|
|
137
|
+
}
|
|
138
|
+
/** A live handle on one project's history file: an in-memory cache backed by the jsonl file. */
|
|
139
|
+
export interface HistoryFile {
|
|
140
|
+
/** Appends one entry (serialised, rotated against the configured cap) and updates the cache. */
|
|
141
|
+
append(entry: HistoryEntry): Promise<void>;
|
|
142
|
+
/** Newest-first entries matching `query`, most recent (or most recent before `before`) first. */
|
|
143
|
+
list(query?: HistoryListQuery): HistoryEntry[];
|
|
144
|
+
get(id: string): HistoryEntry | undefined;
|
|
145
|
+
/** Empties the file and the cache. Returns the number of entries that were cleared. */
|
|
146
|
+
clear(): Promise<number>;
|
|
147
|
+
count(): number;
|
|
148
|
+
/** Corrupt lines skipped while loading the file. */
|
|
149
|
+
readonly problems: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* One entry as callers should see it: a line written before the REST client carried no `kind`,
|
|
153
|
+
* and every such send was SOAP. Applied on read so nothing has to rewrite a `.jsonl` file.
|
|
154
|
+
*/
|
|
155
|
+
export declare function normalizeHistoryEntry(entry: HistoryEntry): HistoryEntry;
|
|
156
|
+
/**
|
|
157
|
+
* Appends one entry to `file`, rotating so at most `cap` (default 1000) entries remain — the
|
|
158
|
+
* oldest are dropped first. Stateless: rereads the whole file first, so prefer {@link openHistory}
|
|
159
|
+
* when appending more than once (it keeps the entries cached in memory).
|
|
160
|
+
*/
|
|
161
|
+
export declare function appendHistory(file: string, entry: HistoryEntry, options?: HistoryOptions): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Opens a live handle on `file`'s history: loads the current entries into memory once, then
|
|
164
|
+
* serves `list`/`get`/`count` from that cache and keeps it (and the file) in sync on `append`/
|
|
165
|
+
* `clear`. Concurrent `append`/`clear` calls on the same handle are serialised.
|
|
166
|
+
*/
|
|
167
|
+
export declare function openHistory(file: string, options?: HistoryOptions): Promise<HistoryFile>;
|
|
168
|
+
/** Generates a new history entry id (ulid: lexicographically time-ordered, unique). */
|
|
169
|
+
export declare function generateHistoryId(): string;
|
|
170
|
+
/** Builds a {@link HistoryWs} from a completed session, applying {@link capFrames}. */
|
|
171
|
+
export declare function historyWsOf(exchange: WsExchange): HistoryWs;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent, per-project request history: a JSON-Lines file the desktop app keeps outside the
|
|
3
|
+
* project folder (under Electron's `userData`), so history survives even when the project folder
|
|
4
|
+
* itself is deleted, moved, or never saved. Entries are appended already redacted — this module
|
|
5
|
+
* never sees a secret, it only stores and reads back whatever the caller hands it.
|
|
6
|
+
*
|
|
7
|
+
* Pure and `FsLike`-injectable, like the rest of `project/*`: no knowledge of Electron's
|
|
8
|
+
* `userData`, no knowledge of the wire format's redaction rules.
|
|
9
|
+
*/
|
|
10
|
+
import { ulid } from 'ulidx';
|
|
11
|
+
import { nodeFs, readFileIfExists, writeFileAtomic } from './fs.js';
|
|
12
|
+
import { capFrames } from '../ws/transcript.js';
|
|
13
|
+
const DEFAULT_CAP = 1000;
|
|
14
|
+
/**
|
|
15
|
+
* One entry as callers should see it: a line written before the REST client carried no `kind`,
|
|
16
|
+
* and every such send was SOAP. Applied on read so nothing has to rewrite a `.jsonl` file.
|
|
17
|
+
*/
|
|
18
|
+
export function normalizeHistoryEntry(entry) {
|
|
19
|
+
return entry.kind === undefined ? { ...entry, kind: 'soap' } : entry;
|
|
20
|
+
}
|
|
21
|
+
/** Case-insensitive substring test, empty needle always matches. */
|
|
22
|
+
function matches(entry, needle) {
|
|
23
|
+
if (needle.length === 0) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
const lower = needle.toLowerCase();
|
|
27
|
+
const haystack = [
|
|
28
|
+
entry.requestName,
|
|
29
|
+
entry.operationName,
|
|
30
|
+
entry.interfaceName,
|
|
31
|
+
entry.endpoint,
|
|
32
|
+
entry.method ?? '',
|
|
33
|
+
entry.grpc?.service ?? '',
|
|
34
|
+
entry.grpc?.method ?? '',
|
|
35
|
+
entry.grpc?.statusName ?? '',
|
|
36
|
+
entry.ws?.url ?? '',
|
|
37
|
+
entry.ws?.protocol ?? '',
|
|
38
|
+
entry.status !== undefined ? String(entry.status) : '',
|
|
39
|
+
entry.fault?.reason ?? '',
|
|
40
|
+
...(entry.tags ?? []),
|
|
41
|
+
]
|
|
42
|
+
.join('\n')
|
|
43
|
+
.toLowerCase();
|
|
44
|
+
return haystack.includes(lower);
|
|
45
|
+
}
|
|
46
|
+
/** Parses one jsonl line into a `HistoryEntry`, or `undefined` when the line is corrupt/blank. */
|
|
47
|
+
function parseLine(line) {
|
|
48
|
+
const trimmed = line.trim();
|
|
49
|
+
if (trimmed.length === 0) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const parsed = JSON.parse(trimmed);
|
|
54
|
+
if (typeof parsed !== 'object' || parsed === null || typeof parsed.id !== 'string') {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
return normalizeHistoryEntry(parsed);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Reads a jsonl file's entries (oldest first, as stored) and the count of corrupt lines. */
|
|
64
|
+
async function readAll(fs, file) {
|
|
65
|
+
const buffer = await readFileIfExists(fs, file);
|
|
66
|
+
if (buffer === undefined) {
|
|
67
|
+
return { entries: [], problems: 0 };
|
|
68
|
+
}
|
|
69
|
+
const lines = buffer.toString('utf8').split('\n');
|
|
70
|
+
const entries = [];
|
|
71
|
+
let problems = 0;
|
|
72
|
+
for (const line of lines) {
|
|
73
|
+
if (line.trim().length === 0) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const entry = parseLine(line);
|
|
77
|
+
if (entry === undefined) {
|
|
78
|
+
problems += 1;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
entries.push(entry);
|
|
82
|
+
}
|
|
83
|
+
return { entries, problems };
|
|
84
|
+
}
|
|
85
|
+
/** Serialises entries (oldest first) back to jsonl text. */
|
|
86
|
+
function serialise(entries) {
|
|
87
|
+
return entries.map((entry) => JSON.stringify(entry)).join('\n') + (entries.length > 0 ? '\n' : '');
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Appends one entry to `file`, rotating so at most `cap` (default 1000) entries remain — the
|
|
91
|
+
* oldest are dropped first. Stateless: rereads the whole file first, so prefer {@link openHistory}
|
|
92
|
+
* when appending more than once (it keeps the entries cached in memory).
|
|
93
|
+
*/
|
|
94
|
+
export async function appendHistory(file, entry, options = {}) {
|
|
95
|
+
const fs = options.fs ?? nodeFs;
|
|
96
|
+
const cap = options.cap ?? DEFAULT_CAP;
|
|
97
|
+
const { entries } = await readAll(fs, file);
|
|
98
|
+
entries.push(entry);
|
|
99
|
+
const capped = entries.length > cap ? entries.slice(entries.length - cap) : entries;
|
|
100
|
+
await writeFileAtomic(fs, file, serialise(capped));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Opens a live handle on `file`'s history: loads the current entries into memory once, then
|
|
104
|
+
* serves `list`/`get`/`count` from that cache and keeps it (and the file) in sync on `append`/
|
|
105
|
+
* `clear`. Concurrent `append`/`clear` calls on the same handle are serialised.
|
|
106
|
+
*/
|
|
107
|
+
export async function openHistory(file, options = {}) {
|
|
108
|
+
const fs = options.fs ?? nodeFs;
|
|
109
|
+
const cap = options.cap ?? DEFAULT_CAP;
|
|
110
|
+
const { entries, problems } = await readAll(fs, file);
|
|
111
|
+
// Oldest-first in memory (matches on-disk order); newest-first is only materialised for `list`.
|
|
112
|
+
let cache = entries;
|
|
113
|
+
let queue = Promise.resolve();
|
|
114
|
+
const enqueue = (task) => {
|
|
115
|
+
const result = queue.then(task);
|
|
116
|
+
// Swallow rejections in the chain itself so one failed op doesn't wedge the queue for the
|
|
117
|
+
// next; the caller of this specific call still sees the real rejection via `result`.
|
|
118
|
+
queue = result.catch(() => undefined);
|
|
119
|
+
return result;
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
problems,
|
|
123
|
+
append(entry) {
|
|
124
|
+
return enqueue(async () => {
|
|
125
|
+
cache.push(entry);
|
|
126
|
+
if (cache.length > cap) {
|
|
127
|
+
cache = cache.slice(cache.length - cap);
|
|
128
|
+
}
|
|
129
|
+
await writeFileAtomic(fs, file, serialise(cache));
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
list(query) {
|
|
133
|
+
const needle = query?.query ?? '';
|
|
134
|
+
const limit = query?.limit ?? Number.POSITIVE_INFINITY;
|
|
135
|
+
const newestFirst = [...cache].reverse();
|
|
136
|
+
let startIndex = 0;
|
|
137
|
+
if (query?.before !== undefined) {
|
|
138
|
+
const cursor = newestFirst.findIndex((e) => e.id === query.before);
|
|
139
|
+
startIndex = cursor === -1 ? newestFirst.length : cursor + 1;
|
|
140
|
+
}
|
|
141
|
+
const filtered = newestFirst.slice(startIndex).filter((entry) => matches(entry, needle));
|
|
142
|
+
return filtered.slice(0, limit);
|
|
143
|
+
},
|
|
144
|
+
get(id) {
|
|
145
|
+
return cache.find((entry) => entry.id === id);
|
|
146
|
+
},
|
|
147
|
+
clear() {
|
|
148
|
+
return enqueue(async () => {
|
|
149
|
+
const cleared = cache.length;
|
|
150
|
+
cache = [];
|
|
151
|
+
await writeFileAtomic(fs, file, '');
|
|
152
|
+
return cleared;
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
count() {
|
|
156
|
+
return cache.length;
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/** Generates a new history entry id (ulid: lexicographically time-ordered, unique). */
|
|
161
|
+
export function generateHistoryId() {
|
|
162
|
+
return ulid();
|
|
163
|
+
}
|
|
164
|
+
/** Builds a {@link HistoryWs} from a completed session, applying {@link capFrames}. */
|
|
165
|
+
export function historyWsOf(exchange) {
|
|
166
|
+
const { frames, truncated, omittedFrames } = capFrames(exchange.frames);
|
|
167
|
+
return {
|
|
168
|
+
url: exchange.url,
|
|
169
|
+
...(exchange.handshake.status !== undefined ? { status: exchange.handshake.status } : {}),
|
|
170
|
+
...(exchange.handshake.protocol !== undefined ? { protocol: exchange.handshake.protocol } : {}),
|
|
171
|
+
closeCode: exchange.closed.code,
|
|
172
|
+
closeReason: exchange.closed.reason,
|
|
173
|
+
closedBy: exchange.closed.by,
|
|
174
|
+
counts: exchange.counts,
|
|
175
|
+
frames,
|
|
176
|
+
...(truncated ? { truncated: true, ...(omittedFrames > 0 ? { omittedFrames } : {}) } : {}),
|
|
177
|
+
...(exchange.handshake.error !== undefined ? { error: exchange.handshake.error } : {}),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bridge between the project model's loose `WssRef` (which round-trips the raw
|
|
3
|
+
* `wss/keystores.yaml` entry verbatim, so an unknown field written by a later build survives)
|
|
4
|
+
* and the typed `KeystoreDef` the keystore loaders take.
|
|
5
|
+
*/
|
|
6
|
+
import type { WssRef } from './model.js';
|
|
7
|
+
import type { KeystoreDef } from '../wss/keystore/model.js';
|
|
8
|
+
/**
|
|
9
|
+
* Reads one keystore registry entry out of its `WssRef`.
|
|
10
|
+
*
|
|
11
|
+
* @param ref the `Project.wss.keystores` entry
|
|
12
|
+
* @returns the typed definition
|
|
13
|
+
* @throws ProjectError `keystore-entry-invalid` when the stored document is not a keystore entry
|
|
14
|
+
*/
|
|
15
|
+
export declare function toKeystoreDef(ref: WssRef): KeystoreDef;
|
|
16
|
+
/**
|
|
17
|
+
* The `WssRef` that stores `def` in `wss/keystores.yaml`, preserving any unknown fields the
|
|
18
|
+
* existing entry carried.
|
|
19
|
+
*
|
|
20
|
+
* @param def the definition to persist
|
|
21
|
+
* @param existing the entry being replaced, when this is an update
|
|
22
|
+
* @returns the ref to put into `Project.wss.keystores`
|
|
23
|
+
*/
|
|
24
|
+
export declare function toKeystoreRef(def: KeystoreDef, existing?: WssRef): WssRef;
|