@wirebench/engine 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/dist/assert/contract.d.ts +3 -0
- package/dist/assert/contract.js +17 -0
- package/dist/assert/index.d.ts +4 -0
- package/dist/assert/index.js +27 -0
- package/dist/assert/match.d.ts +3 -0
- package/dist/assert/match.js +58 -0
- package/dist/assert/model.d.ts +73 -0
- package/dist/assert/model.js +8 -0
- package/dist/assert/schema.d.ts +34 -0
- package/dist/assert/schema.js +46 -0
- package/dist/assert/sla.d.ts +3 -0
- package/dist/assert/sla.js +8 -0
- package/dist/assert/soap-fault.d.ts +3 -0
- package/dist/assert/soap-fault.js +20 -0
- package/dist/assert/status.d.ts +3 -0
- package/dist/assert/status.js +14 -0
- package/dist/errors.d.ts +77 -0
- package/dist/errors.js +121 -0
- package/dist/fs.d.ts +35 -0
- package/dist/fs.js +64 -0
- package/dist/generate.d.ts +12 -0
- package/dist/generate.js +14 -0
- package/dist/grpc/browser.d.ts +11 -0
- package/dist/grpc/browser.js +9 -0
- package/dist/grpc/cache.d.ts +113 -0
- package/dist/grpc/cache.js +244 -0
- package/dist/grpc/call.d.ts +64 -0
- package/dist/grpc/call.js +72 -0
- package/dist/grpc/codec.d.ts +29 -0
- package/dist/grpc/codec.js +416 -0
- package/dist/grpc/command.d.ts +23 -0
- package/dist/grpc/command.js +91 -0
- package/dist/grpc/expand.d.ts +25 -0
- package/dist/grpc/expand.js +52 -0
- package/dist/grpc/framing.d.ts +28 -0
- package/dist/grpc/framing.js +61 -0
- package/dist/grpc/import.d.ts +47 -0
- package/dist/grpc/import.js +88 -0
- package/dist/grpc/model.d.ts +179 -0
- package/dist/grpc/model.js +91 -0
- package/dist/grpc/proto/describe.d.ts +92 -0
- package/dist/grpc/proto/describe.js +205 -0
- package/dist/grpc/proto/load.d.ts +35 -0
- package/dist/grpc/proto/load.js +112 -0
- package/dist/grpc/proto/sample.d.ts +21 -0
- package/dist/grpc/proto/sample.js +79 -0
- package/dist/grpc/proto/well-known.d.ts +42 -0
- package/dist/grpc/proto/well-known.js +143 -0
- package/dist/grpc/reconcile.d.ts +42 -0
- package/dist/grpc/reconcile.js +153 -0
- package/dist/grpc/reflection/client.d.ts +70 -0
- package/dist/grpc/reflection/client.js +197 -0
- package/dist/grpc/reflection/descriptors.d.ts +69 -0
- package/dist/grpc/reflection/descriptors.js +140 -0
- package/dist/grpc/reflection/proto.d.ts +33 -0
- package/dist/grpc/reflection/proto.js +144 -0
- package/dist/grpc/send.d.ts +132 -0
- package/dist/grpc/send.js +435 -0
- package/dist/grpc/shape.d.ts +29 -0
- package/dist/grpc/shape.js +36 -0
- package/dist/grpc/status.d.ts +21 -0
- package/dist/grpc/status.js +62 -0
- package/dist/grpc/target.d.ts +21 -0
- package/dist/grpc/target.js +66 -0
- package/dist/http/auth/apply.d.ts +37 -0
- package/dist/http/auth/apply.js +74 -0
- package/dist/http/auth/basic.d.ts +36 -0
- package/dist/http/auth/basic.js +69 -0
- package/dist/http/auth/md4.d.ts +13 -0
- package/dist/http/auth/md4.js +81 -0
- package/dist/http/auth/ntlm-transport.d.ts +61 -0
- package/dist/http/auth/ntlm-transport.js +97 -0
- package/dist/http/auth/ntlm.d.ts +190 -0
- package/dist/http/auth/ntlm.js +377 -0
- package/dist/http/client.d.ts +73 -0
- package/dist/http/client.js +403 -0
- package/dist/http/curl-flags.d.ts +15 -0
- package/dist/http/curl-flags.js +95 -0
- package/dist/http/curl.d.ts +94 -0
- package/dist/http/curl.js +245 -0
- package/dist/http/decompress.d.ts +7 -0
- package/dist/http/decompress.js +22 -0
- package/dist/http/errors.d.ts +22 -0
- package/dist/http/errors.js +144 -0
- package/dist/http/failed-request.d.ts +27 -0
- package/dist/http/failed-request.js +48 -0
- package/dist/http/headers.d.ts +15 -0
- package/dist/http/headers.js +50 -0
- package/dist/http/heredoc.d.ts +25 -0
- package/dist/http/heredoc.js +74 -0
- package/dist/http/proxy.d.ts +103 -0
- package/dist/http/proxy.js +168 -0
- package/dist/http/raw-capture.d.ts +23 -0
- package/dist/http/raw-capture.js +57 -0
- package/dist/http/timings.d.ts +79 -0
- package/dist/http/timings.js +212 -0
- package/dist/http/tls.d.ts +111 -0
- package/dist/http/tls.js +167 -0
- package/dist/http/types.d.ts +125 -0
- package/dist/http/types.js +6 -0
- package/dist/import-detect.d.ts +26 -0
- package/dist/import-detect.js +169 -0
- package/dist/import.d.ts +20 -0
- package/dist/import.js +163 -0
- package/dist/index.d.ts +272 -0
- package/dist/index.js +157 -0
- package/dist/json/cursor.d.ts +43 -0
- package/dist/json/cursor.js +168 -0
- package/dist/operations.d.ts +12 -0
- package/dist/operations.js +52 -0
- package/dist/project/attachments-cache.d.ts +80 -0
- package/dist/project/attachments-cache.js +186 -0
- package/dist/project/endpoints.d.ts +23 -0
- package/dist/project/endpoints.js +47 -0
- package/dist/project/environments.d.ts +68 -0
- package/dist/project/environments.js +124 -0
- package/dist/project/fs.d.ts +45 -0
- package/dist/project/fs.js +78 -0
- package/dist/project/history.d.ts +171 -0
- package/dist/project/history.js +179 -0
- package/dist/project/keystores.d.ts +24 -0
- package/dist/project/keystores.js +66 -0
- package/dist/project/load.d.ts +44 -0
- package/dist/project/load.js +634 -0
- package/dist/project/migrate.d.ts +27 -0
- package/dist/project/migrate.js +46 -0
- package/dist/project/model.d.ts +401 -0
- package/dist/project/model.js +126 -0
- package/dist/project/paths.d.ts +134 -0
- package/dist/project/paths.js +259 -0
- package/dist/project/preferences.d.ts +318 -0
- package/dist/project/preferences.js +239 -0
- package/dist/project/properties.d.ts +97 -0
- package/dist/project/properties.js +356 -0
- package/dist/project/save.d.ts +65 -0
- package/dist/project/save.js +295 -0
- package/dist/project/schema.d.ts +1329 -0
- package/dist/project/schema.js +737 -0
- package/dist/project/serialize.d.ts +42 -0
- package/dist/project/serialize.js +385 -0
- package/dist/project/wss-configs.d.ts +40 -0
- package/dist/project/wss-configs.js +142 -0
- package/dist/project/yaml.d.ts +17 -0
- package/dist/project/yaml.js +39 -0
- package/dist/redact/index.d.ts +77 -0
- package/dist/redact/index.js +328 -0
- package/dist/redact/literal.d.ts +12 -0
- package/dist/redact/literal.js +68 -0
- package/dist/rest/auth.d.ts +53 -0
- package/dist/rest/auth.js +80 -0
- package/dist/rest/body.d.ts +61 -0
- package/dist/rest/body.js +184 -0
- package/dist/rest/browser.d.ts +12 -0
- package/dist/rest/browser.js +11 -0
- package/dist/rest/cookies.d.ts +41 -0
- package/dist/rest/cookies.js +102 -0
- package/dist/rest/curl.d.ts +75 -0
- package/dist/rest/curl.js +417 -0
- package/dist/rest/expand.d.ts +35 -0
- package/dist/rest/expand.js +104 -0
- package/dist/rest/model.d.ts +247 -0
- package/dist/rest/model.js +118 -0
- package/dist/rest/oauth2.d.ts +118 -0
- package/dist/rest/oauth2.js +212 -0
- package/dist/rest/openapi/cache.d.ts +54 -0
- package/dist/rest/openapi/cache.js +128 -0
- package/dist/rest/openapi/import.d.ts +67 -0
- package/dist/rest/openapi/import.js +91 -0
- package/dist/rest/openapi/map.d.ts +102 -0
- package/dist/rest/openapi/map.js +477 -0
- package/dist/rest/openapi/model.d.ts +203 -0
- package/dist/rest/openapi/model.js +37 -0
- package/dist/rest/openapi/parse.d.ts +44 -0
- package/dist/rest/openapi/parse.js +1530 -0
- package/dist/rest/openapi/refs.d.ts +63 -0
- package/dist/rest/openapi/refs.js +258 -0
- package/dist/rest/openapi/sample.d.ts +68 -0
- package/dist/rest/openapi/sample.js +336 -0
- package/dist/rest/postman/import.d.ts +21 -0
- package/dist/rest/postman/import.js +47 -0
- package/dist/rest/postman/index.d.ts +7 -0
- package/dist/rest/postman/index.js +7 -0
- package/dist/rest/postman/map.d.ts +28 -0
- package/dist/rest/postman/map.js +427 -0
- package/dist/rest/postman/model.d.ts +118 -0
- package/dist/rest/postman/model.js +7 -0
- package/dist/rest/postman/parse.d.ts +29 -0
- package/dist/rest/postman/parse.js +518 -0
- package/dist/rest/response.d.ts +72 -0
- package/dist/rest/response.js +221 -0
- package/dist/rest/send.d.ts +102 -0
- package/dist/rest/send.js +148 -0
- package/dist/rest/url.d.ts +92 -0
- package/dist/rest/url.js +213 -0
- package/dist/run/effective-auth.d.ts +10 -0
- package/dist/run/effective-auth.js +19 -0
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.js +4 -0
- package/dist/run/prepare.d.ts +43 -0
- package/dist/run/prepare.js +280 -0
- package/dist/run/run.d.ts +53 -0
- package/dist/run/run.js +223 -0
- package/dist/run/secret-needs.d.ts +13 -0
- package/dist/run/secret-needs.js +125 -0
- package/dist/run/select.d.ts +34 -0
- package/dist/run/select.js +76 -0
- package/dist/secrets/env-names.d.ts +27 -0
- package/dist/secrets/env-names.js +40 -0
- package/dist/secrets/resolve.d.ts +58 -0
- package/dist/secrets/resolve.js +136 -0
- package/dist/send-options.d.ts +141 -0
- package/dist/send-options.js +228 -0
- package/dist/send.d.ts +53 -0
- package/dist/send.js +210 -0
- package/dist/soap/body-builder.d.ts +38 -0
- package/dist/soap/body-builder.js +250 -0
- package/dist/soap/build-problems.d.ts +12 -0
- package/dist/soap/build-problems.js +2 -0
- package/dist/soap/charset.d.ts +23 -0
- package/dist/soap/charset.js +47 -0
- package/dist/soap/envelope.d.ts +44 -0
- package/dist/soap/envelope.js +76 -0
- package/dist/soap/fault.d.ts +46 -0
- package/dist/soap/fault.js +129 -0
- package/dist/soap/form-request.d.ts +34 -0
- package/dist/soap/form-request.js +251 -0
- package/dist/soap/legacy-project/definition-fetcher.d.ts +21 -0
- package/dist/soap/legacy-project/definition-fetcher.js +43 -0
- package/dist/soap/legacy-project/format.d.ts +18 -0
- package/dist/soap/legacy-project/format.js +24 -0
- package/dist/soap/legacy-project/import.d.ts +21 -0
- package/dist/soap/legacy-project/import.js +46 -0
- package/dist/soap/legacy-project/index.d.ts +9 -0
- package/dist/soap/legacy-project/index.js +5 -0
- package/dist/soap/legacy-project/map.d.ts +91 -0
- package/dist/soap/legacy-project/map.js +290 -0
- package/dist/soap/legacy-project/model.d.ts +98 -0
- package/dist/soap/legacy-project/model.js +5 -0
- package/dist/soap/legacy-project/parse.d.ts +16 -0
- package/dist/soap/legacy-project/parse.js +325 -0
- package/dist/soap/mime/cid-scan.d.ts +36 -0
- package/dist/soap/mime/cid-scan.js +52 -0
- package/dist/soap/mime/inline-files.d.ts +39 -0
- package/dist/soap/mime/inline-files.js +71 -0
- package/dist/soap/mime/mtom.d.ts +74 -0
- package/dist/soap/mime/mtom.js +134 -0
- package/dist/soap/mime/multipart.d.ts +66 -0
- package/dist/soap/mime/multipart.js +329 -0
- package/dist/soap/mime/send-pipeline.d.ts +61 -0
- package/dist/soap/mime/send-pipeline.js +145 -0
- package/dist/soap/mime/swa.d.ts +45 -0
- package/dist/soap/mime/swa.js +62 -0
- package/dist/soap/mime/types.d.ts +69 -0
- package/dist/soap/mime/types.js +10 -0
- package/dist/soap/namespace-scope.d.ts +32 -0
- package/dist/soap/namespace-scope.js +85 -0
- package/dist/soap/prefixes.d.ts +24 -0
- package/dist/soap/prefixes.js +70 -0
- package/dist/soap/recreate.d.ts +28 -0
- package/dist/soap/recreate.js +168 -0
- package/dist/soap/request-builder.d.ts +63 -0
- package/dist/soap/request-builder.js +161 -0
- package/dist/soap/response-parser.d.ts +29 -0
- package/dist/soap/response-parser.js +71 -0
- package/dist/soap/soap-action.d.ts +31 -0
- package/dist/soap/soap-action.js +28 -0
- package/dist/soap/transforms.d.ts +52 -0
- package/dist/soap/transforms.js +164 -0
- package/dist/types.d.ts +307 -0
- package/dist/types.js +6 -0
- package/dist/validate/index.d.ts +61 -0
- package/dist/validate/index.js +72 -0
- package/dist/validate/schema-file-set.d.ts +51 -0
- package/dist/validate/schema-file-set.js +288 -0
- package/dist/validate/schema-validator.d.ts +53 -0
- package/dist/validate/schema-validator.js +251 -0
- package/dist/validate/soap-structure.d.ts +34 -0
- package/dist/validate/soap-structure.js +255 -0
- package/dist/validate/types.d.ts +47 -0
- package/dist/validate/types.js +8 -0
- package/dist/validate/wsi/assertions/helpers.d.ts +145 -0
- package/dist/validate/wsi/assertions/helpers.js +387 -0
- package/dist/validate/wsi/assertions/index.d.ts +44 -0
- package/dist/validate/wsi/assertions/index.js +77 -0
- package/dist/validate/wsi/assertions/message/helpers.d.ts +63 -0
- package/dist/validate/wsi/assertions/message/helpers.js +168 -0
- package/dist/validate/wsi/assertions/message/index.d.ts +39 -0
- package/dist/validate/wsi/assertions/message/index.js +62 -0
- package/dist/validate/wsi/assertions/message/r1001.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1001.js +38 -0
- package/dist/validate/wsi/assertions/message/r1003.d.ts +14 -0
- package/dist/validate/wsi/assertions/message/r1003.js +45 -0
- package/dist/validate/wsi/assertions/message/r1005.d.ts +12 -0
- package/dist/validate/wsi/assertions/message/r1005.js +37 -0
- package/dist/validate/wsi/assertions/message/r1006.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1006.js +49 -0
- package/dist/validate/wsi/assertions/message/r1007.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1007.js +30 -0
- package/dist/validate/wsi/assertions/message/r1011.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1011.js +33 -0
- package/dist/validate/wsi/assertions/message/r1012.d.ts +13 -0
- package/dist/validate/wsi/assertions/message/r1012.js +37 -0
- package/dist/validate/wsi/assertions/message/r1013.d.ts +9 -0
- package/dist/validate/wsi/assertions/message/r1013.js +42 -0
- package/dist/validate/wsi/assertions/message/r1014.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1014.js +30 -0
- package/dist/validate/wsi/assertions/message/r1015.d.ts +12 -0
- package/dist/validate/wsi/assertions/message/r1015.js +36 -0
- package/dist/validate/wsi/assertions/message/r1017.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1017.js +30 -0
- package/dist/validate/wsi/assertions/message/r1100.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1100.js +39 -0
- package/dist/validate/wsi/assertions/message/r1101.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1101.js +37 -0
- package/dist/validate/wsi/assertions/message/r1102.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1102.js +41 -0
- package/dist/validate/wsi/assertions/message/r1103.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1103.js +28 -0
- package/dist/validate/wsi/assertions/message/r1107.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1107.js +38 -0
- package/dist/validate/wsi/assertions/message/r1109.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1109.js +32 -0
- package/dist/validate/wsi/assertions/message/r1124.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1124.js +31 -0
- package/dist/validate/wsi/assertions/message/r1132.d.ts +9 -0
- package/dist/validate/wsi/assertions/message/r1132.js +23 -0
- package/dist/validate/wsi/assertions/message/r1140.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1140.js +42 -0
- package/dist/validate/wsi/assertions/message/r1141.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1141.js +32 -0
- package/dist/validate/wsi/assertions/message/r2113.d.ts +11 -0
- package/dist/validate/wsi/assertions/message/r2113.js +33 -0
- package/dist/validate/wsi/assertions/message/r2211.d.ts +7 -0
- package/dist/validate/wsi/assertions/message/r2211.js +42 -0
- package/dist/validate/wsi/assertions/r2001.d.ts +15 -0
- package/dist/validate/wsi/assertions/r2001.js +47 -0
- package/dist/validate/wsi/assertions/r2002.d.ts +11 -0
- package/dist/validate/wsi/assertions/r2002.js +38 -0
- package/dist/validate/wsi/assertions/r2003.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2003.js +32 -0
- package/dist/validate/wsi/assertions/r2005.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2005.js +40 -0
- package/dist/validate/wsi/assertions/r2101.d.ts +14 -0
- package/dist/validate/wsi/assertions/r2101.js +65 -0
- package/dist/validate/wsi/assertions/r2102.d.ts +10 -0
- package/dist/validate/wsi/assertions/r2102.js +41 -0
- package/dist/validate/wsi/assertions/r2105.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2105.js +39 -0
- package/dist/validate/wsi/assertions/r2110.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2110.js +38 -0
- package/dist/validate/wsi/assertions/r2111.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2111.js +30 -0
- package/dist/validate/wsi/assertions/r2112.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2112.js +35 -0
- package/dist/validate/wsi/assertions/r2201.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2201.js +28 -0
- package/dist/validate/wsi/assertions/r2203.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2203.js +30 -0
- package/dist/validate/wsi/assertions/r2204.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2204.js +29 -0
- package/dist/validate/wsi/assertions/r2205.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2205.js +46 -0
- package/dist/validate/wsi/assertions/r2206.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2206.js +36 -0
- package/dist/validate/wsi/assertions/r2209.d.ts +12 -0
- package/dist/validate/wsi/assertions/r2209.js +37 -0
- package/dist/validate/wsi/assertions/r2210.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2210.js +30 -0
- package/dist/validate/wsi/assertions/r2303.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2303.js +44 -0
- package/dist/validate/wsi/assertions/r2304.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2304.js +32 -0
- package/dist/validate/wsi/assertions/r2401.d.ts +12 -0
- package/dist/validate/wsi/assertions/r2401.js +31 -0
- package/dist/validate/wsi/assertions/r2701.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2701.js +28 -0
- package/dist/validate/wsi/assertions/r2702.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2702.js +26 -0
- package/dist/validate/wsi/assertions/r2705.d.ts +11 -0
- package/dist/validate/wsi/assertions/r2705.js +31 -0
- package/dist/validate/wsi/assertions/r2706.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2706.js +29 -0
- package/dist/validate/wsi/assertions/r2710.d.ts +13 -0
- package/dist/validate/wsi/assertions/r2710.js +37 -0
- package/dist/validate/wsi/assertions/r2716.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2716.js +29 -0
- package/dist/validate/wsi/assertions/r2717.d.ts +9 -0
- package/dist/validate/wsi/assertions/r2717.js +31 -0
- package/dist/validate/wsi/assertions/r2718.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2718.js +41 -0
- package/dist/validate/wsi/assertions/r2720.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2720.js +29 -0
- package/dist/validate/wsi/assertions/r2721.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2721.js +27 -0
- package/dist/validate/wsi/assertions/r2722.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2722.js +29 -0
- package/dist/validate/wsi/assertions/r2801.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2801.js +39 -0
- package/dist/validate/wsi/assertions/r2803.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2803.js +29 -0
- package/dist/validate/wsi/docs.d.ts +29 -0
- package/dist/validate/wsi/docs.js +167 -0
- package/dist/validate/wsi/index.d.ts +16 -0
- package/dist/validate/wsi/index.js +11 -0
- package/dist/validate/wsi/report-html.d.ts +36 -0
- package/dist/validate/wsi/report-html.js +135 -0
- package/dist/validate/wsi/run-message.d.ts +50 -0
- package/dist/validate/wsi/run-message.js +190 -0
- package/dist/validate/wsi/run-wsdl.d.ts +48 -0
- package/dist/validate/wsi/run-wsdl.js +99 -0
- package/dist/validate/wsi/types.d.ts +173 -0
- package/dist/validate/wsi/types.js +17 -0
- package/dist/workspace/commit-message.d.ts +47 -0
- package/dist/workspace/commit-message.js +195 -0
- package/dist/workspace/environments.d.ts +79 -0
- package/dist/workspace/environments.js +115 -0
- package/dist/workspace/index.d.ts +28 -0
- package/dist/workspace/index.js +19 -0
- package/dist/workspace/load.d.ts +45 -0
- package/dist/workspace/load.js +155 -0
- package/dist/workspace/local-state.d.ts +37 -0
- package/dist/workspace/local-state.js +59 -0
- package/dist/workspace/migrate.d.ts +38 -0
- package/dist/workspace/migrate.js +50 -0
- package/dist/workspace/model.d.ts +86 -0
- package/dist/workspace/model.js +54 -0
- package/dist/workspace/paths.d.ts +64 -0
- package/dist/workspace/paths.js +97 -0
- package/dist/workspace/reidentify.d.ts +22 -0
- package/dist/workspace/reidentify.js +122 -0
- package/dist/workspace/save.d.ts +31 -0
- package/dist/workspace/save.js +84 -0
- package/dist/workspace/schema.d.ts +93 -0
- package/dist/workspace/schema.js +115 -0
- package/dist/workspace/serialize.d.ts +24 -0
- package/dist/workspace/serialize.js +60 -0
- package/dist/workspace/share.d.ts +52 -0
- package/dist/workspace/share.js +89 -0
- package/dist/ws/browser.d.ts +13 -0
- package/dist/ws/browser.js +11 -0
- package/dist/ws/call.d.ts +53 -0
- package/dist/ws/call.js +106 -0
- package/dist/ws/command.d.ts +19 -0
- package/dist/ws/command.js +28 -0
- package/dist/ws/expand.d.ts +38 -0
- package/dist/ws/expand.js +76 -0
- package/dist/ws/model.d.ts +191 -0
- package/dist/ws/model.js +83 -0
- package/dist/ws/pretty.d.ts +12 -0
- package/dist/ws/pretty.js +25 -0
- package/dist/ws/session.d.ts +50 -0
- package/dist/ws/session.js +333 -0
- package/dist/ws/shape.d.ts +18 -0
- package/dist/ws/shape.js +28 -0
- package/dist/ws/transcript.d.ts +14 -0
- package/dist/ws/transcript.js +29 -0
- package/dist/ws/url.d.ts +3 -0
- package/dist/ws/url.js +44 -0
- package/dist/wsa/headers.d.ts +78 -0
- package/dist/wsa/headers.js +244 -0
- package/dist/wsa/model.d.ts +66 -0
- package/dist/wsa/model.js +52 -0
- package/dist/wsa/policy-detect.d.ts +81 -0
- package/dist/wsa/policy-detect.js +245 -0
- package/dist/wsdl/cache-naming.d.ts +39 -0
- package/dist/wsdl/cache-naming.js +90 -0
- package/dist/wsdl/cache.d.ts +48 -0
- package/dist/wsdl/cache.js +141 -0
- package/dist/wsdl/docs-generator.d.ts +47 -0
- package/dist/wsdl/docs-generator.js +439 -0
- package/dist/wsdl/dom-utils.d.ts +15 -0
- package/dist/wsdl/dom-utils.js +50 -0
- package/dist/wsdl/export-definition.d.ts +38 -0
- package/dist/wsdl/export-definition.js +100 -0
- package/dist/wsdl/fetch.d.ts +13 -0
- package/dist/wsdl/fetch.js +60 -0
- package/dist/wsdl/merge.d.ts +17 -0
- package/dist/wsdl/merge.js +57 -0
- package/dist/wsdl/model.d.ts +176 -0
- package/dist/wsdl/model.js +17 -0
- package/dist/wsdl/parse-binding.d.ts +6 -0
- package/dist/wsdl/parse-binding.js +150 -0
- package/dist/wsdl/parse-wsdl.d.ts +47 -0
- package/dist/wsdl/parse-wsdl.js +161 -0
- package/dist/wsdl/qname.d.ts +28 -0
- package/dist/wsdl/qname.js +41 -0
- package/dist/wsdl/ref-policy.d.ts +54 -0
- package/dist/wsdl/ref-policy.js +87 -0
- package/dist/wsdl/resolver.d.ts +81 -0
- package/dist/wsdl/resolver.js +276 -0
- package/dist/wsdl/update-definition.d.ts +106 -0
- package/dist/wsdl/update-definition.js +314 -0
- package/dist/wss/apply.d.ts +40 -0
- package/dist/wss/apply.js +212 -0
- package/dist/wss/c14n-prefixes.d.ts +27 -0
- package/dist/wss/c14n-prefixes.js +95 -0
- package/dist/wss/incoming/decrypt.d.ts +35 -0
- package/dist/wss/incoming/decrypt.js +57 -0
- package/dist/wss/incoming/index.d.ts +56 -0
- package/dist/wss/incoming/index.js +189 -0
- package/dist/wss/incoming/verify.d.ts +74 -0
- package/dist/wss/incoming/verify.js +440 -0
- package/dist/wss/key-identifiers.d.ts +76 -0
- package/dist/wss/key-identifiers.js +139 -0
- package/dist/wss/keystore/certificate.d.ts +45 -0
- package/dist/wss/keystore/certificate.js +134 -0
- package/dist/wss/keystore/index.d.ts +50 -0
- package/dist/wss/keystore/index.js +80 -0
- package/dist/wss/keystore/model.d.ts +83 -0
- package/dist/wss/keystore/model.js +27 -0
- package/dist/wss/keystore/pem.d.ts +21 -0
- package/dist/wss/keystore/pem.js +140 -0
- package/dist/wss/keystore/pkcs12.d.ts +21 -0
- package/dist/wss/keystore/pkcs12.js +125 -0
- package/dist/wss/model.d.ts +160 -0
- package/dist/wss/model.js +37 -0
- package/dist/wss/outgoing/encryption.d.ts +76 -0
- package/dist/wss/outgoing/encryption.js +618 -0
- package/dist/wss/outgoing/signature.d.ts +73 -0
- package/dist/wss/outgoing/signature.js +239 -0
- package/dist/wss/outgoing/timestamp.d.ts +29 -0
- package/dist/wss/outgoing/timestamp.js +39 -0
- package/dist/wss/outgoing/username-token.d.ts +36 -0
- package/dist/wss/outgoing/username-token.js +68 -0
- package/dist/wss/security-header.d.ts +31 -0
- package/dist/wss/security-header.js +83 -0
- package/dist/xml/index.d.ts +7 -0
- package/dist/xml/index.js +7 -0
- package/dist/xml/namespaces.d.ts +36 -0
- package/dist/xml/namespaces.js +60 -0
- package/dist/xml/parse.d.ts +79 -0
- package/dist/xml/parse.js +109 -0
- package/dist/xml/positions.d.ts +26 -0
- package/dist/xml/positions.js +71 -0
- package/dist/xml/pretty.d.ts +37 -0
- package/dist/xml/pretty.js +137 -0
- package/dist/xml/serialize.d.ts +6 -0
- package/dist/xml/serialize.js +8 -0
- package/dist/xml/tolerant-tree.d.ts +56 -0
- package/dist/xml/tolerant-tree.js +134 -0
- package/dist/xpath/evaluate-async.d.ts +31 -0
- package/dist/xpath/evaluate-async.js +81 -0
- package/dist/xpath/evaluate.d.ts +98 -0
- package/dist/xpath/evaluate.js +340 -0
- package/dist/xpath/jsonpath.d.ts +40 -0
- package/dist/xpath/jsonpath.js +109 -0
- package/dist/xpath/namespaces.d.ts +29 -0
- package/dist/xpath/namespaces.js +101 -0
- package/dist/xpath/worker.d.ts +7 -0
- package/dist/xpath/worker.js +26 -0
- package/dist/xsd/builtins.d.ts +36 -0
- package/dist/xsd/builtins.js +108 -0
- package/dist/xsd/check-references.d.ts +25 -0
- package/dist/xsd/check-references.js +145 -0
- package/dist/xsd/form-edits.d.ts +57 -0
- package/dist/xsd/form-edits.js +153 -0
- package/dist/xsd/form-model.d.ts +153 -0
- package/dist/xsd/form-model.js +691 -0
- package/dist/xsd/locate.d.ts +42 -0
- package/dist/xsd/locate.js +249 -0
- package/dist/xsd/model.d.ts +249 -0
- package/dist/xsd/model.js +1 -0
- package/dist/xsd/parse-particles.d.ts +48 -0
- package/dist/xsd/parse-particles.js +320 -0
- package/dist/xsd/parse-schema.d.ts +21 -0
- package/dist/xsd/parse-schema.js +143 -0
- package/dist/xsd/resolve-content.d.ts +18 -0
- package/dist/xsd/resolve-content.js +242 -0
- package/dist/xsd/sample-generator.d.ts +51 -0
- package/dist/xsd/sample-generator.js +291 -0
- package/dist/xsd/sample-types.d.ts +21 -0
- package/dist/xsd/sample-types.js +69 -0
- package/dist/xsd/sample-values.d.ts +54 -0
- package/dist/xsd/sample-values.js +267 -0
- package/dist/xsd/schema-set.d.ts +51 -0
- package/dist/xsd/schema-set.js +203 -0
- package/dist/xsd/xml-scan.d.ts +64 -0
- package/dist/xsd/xml-scan.js +286 -0
- package/dist/xsd/xml-writer.d.ts +56 -0
- package/dist/xsd/xml-writer.js +103 -0
- package/package.json +69 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a cursor sits in a JSON document, worked out from the text alone.
|
|
3
|
+
*
|
|
4
|
+
* The counterpart of `xsd/locate.ts`'s `completionContextAt` for XML, and it exists for the same
|
|
5
|
+
* reason: a completion provider runs against a document that is, by definition, half-typed, so a
|
|
6
|
+
* parse is the one thing that cannot be relied on. This scans characters left to right, keeping a
|
|
7
|
+
* stack of the containers it has entered, and answers what object the cursor is in, what key has
|
|
8
|
+
* been typed so far, and which keys that object already holds.
|
|
9
|
+
*
|
|
10
|
+
* Array indices are not path segments. A repeated field's items all have the element type, so
|
|
11
|
+
* `{"items": [{ | }]}` is at `["items"]` — the same place a singular message field would be. The
|
|
12
|
+
* one container that does add a segment of its own is a map, whose keys the user names; a caller
|
|
13
|
+
* resolving the path against a schema consumes that segment itself.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here knows about protobuf: it is a JSON text helper, and the schema half lives in
|
|
16
|
+
* `grpc/proto/describe.ts`.
|
|
17
|
+
*/
|
|
18
|
+
/** Where a string starting at `start` ends, and whether a quote or a line break ended it. */
|
|
19
|
+
function endOfString(text, start) {
|
|
20
|
+
let i = start;
|
|
21
|
+
while (i < text.length) {
|
|
22
|
+
const char = text[i];
|
|
23
|
+
if (char === '\\') {
|
|
24
|
+
i += 2;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (char === '"') {
|
|
28
|
+
return { end: i, closed: true };
|
|
29
|
+
}
|
|
30
|
+
// An unterminated string is taken to end at the line break. A user who has not closed one has
|
|
31
|
+
// moved on, and stopping here keeps a single missing quote from swallowing the rest of the file.
|
|
32
|
+
if (char === '\n') {
|
|
33
|
+
return { end: i, closed: false };
|
|
34
|
+
}
|
|
35
|
+
i += 1;
|
|
36
|
+
}
|
|
37
|
+
return { end: text.length, closed: false };
|
|
38
|
+
}
|
|
39
|
+
/** Whether a container is entered at the value position of an object, and so takes its key as a segment. */
|
|
40
|
+
function segmentFor(parent) {
|
|
41
|
+
if (parent === undefined || parent.kind !== 'object' || !parent.afterColon) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return parent.pendingKey;
|
|
45
|
+
}
|
|
46
|
+
function enter(stack, kind) {
|
|
47
|
+
const segment = segmentFor(stack[stack.length - 1]);
|
|
48
|
+
stack.push({ kind, keys: [], afterColon: false, ...(segment !== undefined ? { segment } : {}) });
|
|
49
|
+
}
|
|
50
|
+
/** The path a stack of frames spells: every segment it carries, arrays included, root excluded. */
|
|
51
|
+
function pathOf(stack) {
|
|
52
|
+
const path = [];
|
|
53
|
+
for (const frame of stack) {
|
|
54
|
+
if (frame.segment !== undefined) {
|
|
55
|
+
path.push(frame.segment);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return path;
|
|
59
|
+
}
|
|
60
|
+
/** The characters a bare (unquoted) key token is made of. */
|
|
61
|
+
const WORD = /[A-Za-z0-9_]/;
|
|
62
|
+
/**
|
|
63
|
+
* Pure text analysis for a JSON completion provider: the object the cursor is in, the key being
|
|
64
|
+
* typed and the range to replace with the accepted one.
|
|
65
|
+
*
|
|
66
|
+
* Returns `undefined` wherever a key cannot go — in a value, directly inside an array, at the top
|
|
67
|
+
* level outside any object, or anywhere a key would not be the next thing written.
|
|
68
|
+
*/
|
|
69
|
+
export function jsonCompletionContextAt(text, offset) {
|
|
70
|
+
const stack = [];
|
|
71
|
+
let cursorString;
|
|
72
|
+
let i = 0;
|
|
73
|
+
while (i < offset) {
|
|
74
|
+
const char = text[i];
|
|
75
|
+
const top = stack[stack.length - 1];
|
|
76
|
+
if (char === '"') {
|
|
77
|
+
const contentStart = i + 1;
|
|
78
|
+
const { end: contentEnd, closed } = endOfString(text, contentStart);
|
|
79
|
+
const isKey = top !== undefined && top.kind === 'object' && !top.afterColon;
|
|
80
|
+
// The position just past a key's closing quote still belongs to that key: the user has typed
|
|
81
|
+
// it and not yet reached for the colon, so completing it is what they are asking for.
|
|
82
|
+
const last = isKey && closed ? contentEnd + 1 : contentEnd;
|
|
83
|
+
if (offset >= contentStart && offset <= last) {
|
|
84
|
+
cursorString = { contentStart, contentEnd, isKey };
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
if (isKey && top !== undefined) {
|
|
88
|
+
const key = text.slice(contentStart, contentEnd);
|
|
89
|
+
top.pendingKey = key;
|
|
90
|
+
top.keys.push(key);
|
|
91
|
+
}
|
|
92
|
+
if (!closed && top !== undefined && top.kind === 'object') {
|
|
93
|
+
// The value was abandoned at the line break, so the next line starts a member of its own.
|
|
94
|
+
top.afterColon = false;
|
|
95
|
+
delete top.pendingKey;
|
|
96
|
+
}
|
|
97
|
+
i = contentEnd + 1;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (char === '{' || char === '[') {
|
|
101
|
+
enter(stack, char === '{' ? 'object' : 'array');
|
|
102
|
+
}
|
|
103
|
+
else if (char === '}' || char === ']') {
|
|
104
|
+
stack.pop();
|
|
105
|
+
const parent = stack[stack.length - 1];
|
|
106
|
+
if (parent !== undefined && parent.kind === 'object') {
|
|
107
|
+
parent.afterColon = false;
|
|
108
|
+
delete parent.pendingKey;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else if (char === ':') {
|
|
112
|
+
if (top !== undefined && top.kind === 'object') {
|
|
113
|
+
top.afterColon = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else if (char === ',') {
|
|
117
|
+
if (top !== undefined && top.kind === 'object') {
|
|
118
|
+
top.afterColon = false;
|
|
119
|
+
delete top.pendingKey;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
i += 1;
|
|
123
|
+
}
|
|
124
|
+
const frame = stack[stack.length - 1];
|
|
125
|
+
if (frame === undefined || frame.kind !== 'object') {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
if (cursorString !== undefined) {
|
|
129
|
+
if (!cursorString.isKey) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
path: pathOf(stack),
|
|
134
|
+
partial: text.slice(cursorString.contentStart, Math.min(offset, cursorString.contentEnd)),
|
|
135
|
+
replaceRange: { start: cursorString.contentStart, end: cursorString.contentEnd },
|
|
136
|
+
quoted: true,
|
|
137
|
+
siblings: [...frame.keys],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (frame.afterColon) {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
// An unquoted word is still worth completing: Monaco asks as soon as a letter is typed, and a
|
|
144
|
+
// user who has not reached for the quote key yet means the same thing by it.
|
|
145
|
+
let start = offset;
|
|
146
|
+
while (start > 0 && WORD.test(text[start - 1])) {
|
|
147
|
+
start -= 1;
|
|
148
|
+
}
|
|
149
|
+
let before = start - 1;
|
|
150
|
+
while (before >= 0 && /\s/.test(text[before])) {
|
|
151
|
+
before -= 1;
|
|
152
|
+
}
|
|
153
|
+
const preceding = before >= 0 ? text[before] : '';
|
|
154
|
+
if (preceding !== '{' && preceding !== ',') {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
let end = offset;
|
|
158
|
+
while (end < text.length && WORD.test(text[end])) {
|
|
159
|
+
end += 1;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
path: pathOf(stack),
|
|
163
|
+
partial: text.slice(start, offset),
|
|
164
|
+
replaceRange: { start, end },
|
|
165
|
+
quoted: false,
|
|
166
|
+
siblings: [...frame.keys],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the operation-picker summary (`OperationSummary[]`) for an imported
|
|
3
|
+
* WSDL definition: every binding operation, cross-referenced with the ports
|
|
4
|
+
* (and their services) that expose it.
|
|
5
|
+
*/
|
|
6
|
+
import type { WsdlDefinition } from './wsdl/model.js';
|
|
7
|
+
import type { OperationSummary } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Walks every `binding` x `operation` pair in `definition`, mapping each to
|
|
10
|
+
* the ports (and their services) that reference the binding.
|
|
11
|
+
*/
|
|
12
|
+
export declare function summarizeOperations(definition: WsdlDefinition): readonly OperationSummary[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the operation-picker summary (`OperationSummary[]`) for an imported
|
|
3
|
+
* WSDL definition: every binding operation, cross-referenced with the ports
|
|
4
|
+
* (and their services) that expose it.
|
|
5
|
+
*/
|
|
6
|
+
import { findPortType } from './wsdl/model.js';
|
|
7
|
+
import { qnameEquals } from './wsdl/qname.js';
|
|
8
|
+
/** The services/ports that bind to `binding`, across every service in the definition. */
|
|
9
|
+
function portsFor(definition, binding) {
|
|
10
|
+
const ports = [];
|
|
11
|
+
for (const service of definition.services) {
|
|
12
|
+
for (const port of service.ports) {
|
|
13
|
+
if (qnameEquals(port.binding, binding.name)) {
|
|
14
|
+
ports.push({
|
|
15
|
+
serviceName: service.name,
|
|
16
|
+
portName: port.name,
|
|
17
|
+
...(port.address !== undefined ? { address: port.address } : {}),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return ports;
|
|
23
|
+
}
|
|
24
|
+
/** The abstract `wsdl:operation` behind a binding operation, for its documentation. */
|
|
25
|
+
function abstractOperationFor(definition, binding, operationName) {
|
|
26
|
+
const portType = findPortType(definition, binding.type);
|
|
27
|
+
return portType?.operations.find((op) => op.name === operationName);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Walks every `binding` x `operation` pair in `definition`, mapping each to
|
|
31
|
+
* the ports (and their services) that reference the binding.
|
|
32
|
+
*/
|
|
33
|
+
export function summarizeOperations(definition) {
|
|
34
|
+
const summaries = [];
|
|
35
|
+
for (const binding of definition.bindings) {
|
|
36
|
+
const ports = portsFor(definition, binding);
|
|
37
|
+
for (const operation of binding.operations) {
|
|
38
|
+
const documentation = abstractOperationFor(definition, binding, operation.name)?.documentation;
|
|
39
|
+
summaries.push({
|
|
40
|
+
bindingName: binding.name,
|
|
41
|
+
operationName: operation.name,
|
|
42
|
+
soapVersion: binding.soapVersion,
|
|
43
|
+
...(operation.soapAction !== undefined ? { soapAction: operation.soapAction } : {}),
|
|
44
|
+
style: operation.style ?? binding.style,
|
|
45
|
+
...(documentation !== undefined ? { documentation } : {}),
|
|
46
|
+
ports,
|
|
47
|
+
inputMimeParts: operation.input?.mimeParts ?? [],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return summaries;
|
|
52
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project's attachment cache: `attachments/<sha256>` plus an `attachments/index.yaml`
|
|
3
|
+
* describing each blob.
|
|
4
|
+
*
|
|
5
|
+
* Content addressing means adding the same file twice costs one copy, a request that
|
|
6
|
+
* references it keeps working when the original is moved or deleted, and the project stays
|
|
7
|
+
* diffable — the index is the only file that changes when metadata does. Nothing is ever
|
|
8
|
+
* deleted implicitly: {@link pruneAttachments} exists so the UI can offer it explicitly,
|
|
9
|
+
* because a blob whose last reference was removed in an unsaved edit must survive an undo.
|
|
10
|
+
*/
|
|
11
|
+
import { type FsLike } from './fs.js';
|
|
12
|
+
import type { AttachmentResolver } from '../soap/mime/types.js';
|
|
13
|
+
/** One blob in the attachment cache, as recorded in `attachments/index.yaml`. */
|
|
14
|
+
export interface AttachmentCacheEntry {
|
|
15
|
+
readonly sha256: string;
|
|
16
|
+
/** Name of the file the bytes were added from. */
|
|
17
|
+
readonly originalName: string;
|
|
18
|
+
readonly contentType: string;
|
|
19
|
+
readonly size: number;
|
|
20
|
+
}
|
|
21
|
+
/** Options every cache function accepts. */
|
|
22
|
+
export interface AttachmentCacheOptions {
|
|
23
|
+
readonly fs?: FsLike;
|
|
24
|
+
}
|
|
25
|
+
/** Absolute path of the attachment cache directory. */
|
|
26
|
+
export declare function attachmentsDir(projectDir: string): string;
|
|
27
|
+
/** Absolute path of the cache index. */
|
|
28
|
+
export declare function attachmentsIndexFile(projectDir: string): string;
|
|
29
|
+
/** Absolute path of one cached blob. */
|
|
30
|
+
export declare function attachmentFile(projectDir: string, sha256: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Copies `bytes` into the project's attachment cache, returning the digest a
|
|
33
|
+
* {@link Attachment} with a `cache` source references.
|
|
34
|
+
*
|
|
35
|
+
* Re-adding identical bytes is a no-op beyond the index lookup, and the metadata of the
|
|
36
|
+
* first add wins: the digest is the identity, so a second name for the same content would
|
|
37
|
+
* only make the index ambiguous.
|
|
38
|
+
*
|
|
39
|
+
* @param projectDir the project root
|
|
40
|
+
* @param bytes the file content to cache
|
|
41
|
+
* @param meta the name and content type to record for it
|
|
42
|
+
*/
|
|
43
|
+
export declare function putAttachment(projectDir: string, bytes: Uint8Array, meta: {
|
|
44
|
+
readonly originalName: string;
|
|
45
|
+
readonly contentType: string;
|
|
46
|
+
}, options?: AttachmentCacheOptions): Promise<{
|
|
47
|
+
readonly sha256: string;
|
|
48
|
+
readonly size: number;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Reads one cached blob.
|
|
52
|
+
*
|
|
53
|
+
* @param projectDir the project root
|
|
54
|
+
* @param sha256 the digest recorded on the attachment
|
|
55
|
+
*/
|
|
56
|
+
export declare function readAttachment(projectDir: string, sha256: string, options?: AttachmentCacheOptions): Promise<Uint8Array>;
|
|
57
|
+
/** Every blob in the cache, ordered by digest. */
|
|
58
|
+
export declare function listAttachments(projectDir: string, options?: AttachmentCacheOptions): Promise<readonly AttachmentCacheEntry[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Deletes every cached blob whose digest is not in `referencedShas`, index entry included.
|
|
61
|
+
*
|
|
62
|
+
* Called only when the UI explicitly asks: an automatic prune would race with editing (an
|
|
63
|
+
* attachment removed from a request but not yet saved is still referenced by the document
|
|
64
|
+
* on disk, and vice versa).
|
|
65
|
+
*
|
|
66
|
+
* @param projectDir the project root
|
|
67
|
+
* @param referencedShas digests still referenced by the project's requests
|
|
68
|
+
*/
|
|
69
|
+
export declare function pruneAttachments(projectDir: string, referencedShas: Iterable<string>, options?: AttachmentCacheOptions): Promise<{
|
|
70
|
+
readonly removed: readonly string[];
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* The {@link AttachmentResolver} the desktop main process hands to the send path: cached
|
|
74
|
+
* attachments come out of `attachments/`, path attachments off disk (absolute, or relative
|
|
75
|
+
* to the resource root and then to the project itself, in that order).
|
|
76
|
+
*
|
|
77
|
+
* @param projectDir the project root
|
|
78
|
+
* @param resourceRoot the project's resource root, when it has one
|
|
79
|
+
*/
|
|
80
|
+
export declare function createFileAttachmentResolver(projectDir: string, resourceRoot?: string, options?: AttachmentCacheOptions): AttachmentResolver;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project's attachment cache: `attachments/<sha256>` plus an `attachments/index.yaml`
|
|
3
|
+
* describing each blob.
|
|
4
|
+
*
|
|
5
|
+
* Content addressing means adding the same file twice costs one copy, a request that
|
|
6
|
+
* references it keeps working when the original is moved or deleted, and the project stays
|
|
7
|
+
* diffable — the index is the only file that changes when metadata does. Nothing is ever
|
|
8
|
+
* deleted implicitly: {@link pruneAttachments} exists so the UI can offer it explicitly,
|
|
9
|
+
* because a blob whose last reference was removed in an unsaved edit must survive an undo.
|
|
10
|
+
*/
|
|
11
|
+
import { createHash } from 'node:crypto';
|
|
12
|
+
import { isAbsolute, join } from 'node:path';
|
|
13
|
+
import { ProjectError } from '../errors.js';
|
|
14
|
+
import { nodeFs, readFileIfExists, readdirIfExists, writeFileAtomic } from './fs.js';
|
|
15
|
+
import { ATTACHMENTS_DIR } from './paths.js';
|
|
16
|
+
import { parseYaml, stringifyYaml } from './yaml.js';
|
|
17
|
+
const SHA256 = /^[0-9a-f]{64}$/;
|
|
18
|
+
/** Absolute path of the attachment cache directory. */
|
|
19
|
+
export function attachmentsDir(projectDir) {
|
|
20
|
+
return join(projectDir, ATTACHMENTS_DIR);
|
|
21
|
+
}
|
|
22
|
+
/** Absolute path of the cache index. */
|
|
23
|
+
export function attachmentsIndexFile(projectDir) {
|
|
24
|
+
return join(attachmentsDir(projectDir), 'index.yaml');
|
|
25
|
+
}
|
|
26
|
+
/** Absolute path of one cached blob. */
|
|
27
|
+
export function attachmentFile(projectDir, sha256) {
|
|
28
|
+
assertDigest(sha256);
|
|
29
|
+
return join(attachmentsDir(projectDir), sha256);
|
|
30
|
+
}
|
|
31
|
+
function assertDigest(sha256) {
|
|
32
|
+
if (!SHA256.test(sha256)) {
|
|
33
|
+
throw new ProjectError('attachment-invalid-digest', `"${sha256}" is not a sha256 digest`, {
|
|
34
|
+
details: { sha256 },
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The cache index, or an empty one when the project has no attachments yet. */
|
|
39
|
+
async function readIndex(projectDir, fs) {
|
|
40
|
+
const buffer = await readFileIfExists(fs, attachmentsIndexFile(projectDir));
|
|
41
|
+
const index = new Map();
|
|
42
|
+
if (buffer === undefined) {
|
|
43
|
+
return index;
|
|
44
|
+
}
|
|
45
|
+
const parsed = parseYaml(buffer.toString('utf8'), `${ATTACHMENTS_DIR}/index.yaml`);
|
|
46
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
47
|
+
return index;
|
|
48
|
+
}
|
|
49
|
+
for (const [sha256, value] of Object.entries(parsed)) {
|
|
50
|
+
if (typeof value !== 'object' || value === null) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const record = value;
|
|
54
|
+
index.set(sha256, {
|
|
55
|
+
sha256,
|
|
56
|
+
originalName: typeof record.originalName === 'string' ? record.originalName : sha256,
|
|
57
|
+
contentType: typeof record.contentType === 'string' ? record.contentType : 'application/octet-stream',
|
|
58
|
+
size: typeof record.size === 'number' ? record.size : 0,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return index;
|
|
62
|
+
}
|
|
63
|
+
async function writeIndex(projectDir, fs, index) {
|
|
64
|
+
const document = {};
|
|
65
|
+
for (const entry of [...index.values()].sort((a, b) => a.sha256.localeCompare(b.sha256))) {
|
|
66
|
+
document[entry.sha256] = {
|
|
67
|
+
originalName: entry.originalName,
|
|
68
|
+
contentType: entry.contentType,
|
|
69
|
+
size: entry.size,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
await writeFileAtomic(fs, attachmentsIndexFile(projectDir), stringifyYaml(document));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Copies `bytes` into the project's attachment cache, returning the digest a
|
|
76
|
+
* {@link Attachment} with a `cache` source references.
|
|
77
|
+
*
|
|
78
|
+
* Re-adding identical bytes is a no-op beyond the index lookup, and the metadata of the
|
|
79
|
+
* first add wins: the digest is the identity, so a second name for the same content would
|
|
80
|
+
* only make the index ambiguous.
|
|
81
|
+
*
|
|
82
|
+
* @param projectDir the project root
|
|
83
|
+
* @param bytes the file content to cache
|
|
84
|
+
* @param meta the name and content type to record for it
|
|
85
|
+
*/
|
|
86
|
+
export async function putAttachment(projectDir, bytes, meta, options = {}) {
|
|
87
|
+
const fs = options.fs ?? nodeFs;
|
|
88
|
+
const sha256 = createHash('sha256').update(bytes).digest('hex');
|
|
89
|
+
const index = await readIndex(projectDir, fs);
|
|
90
|
+
const file = attachmentFile(projectDir, sha256);
|
|
91
|
+
// The blob is rewritten when it is missing even though the index knows it: a project
|
|
92
|
+
// whose `attachments/` was partly lost (a bad merge, a stray delete) heals on the next add.
|
|
93
|
+
if ((await readFileIfExists(fs, file)) === undefined) {
|
|
94
|
+
await writeFileAtomic(fs, file, Buffer.from(bytes));
|
|
95
|
+
}
|
|
96
|
+
if (!index.has(sha256)) {
|
|
97
|
+
index.set(sha256, { sha256, originalName: meta.originalName, contentType: meta.contentType, size: bytes.length });
|
|
98
|
+
await writeIndex(projectDir, fs, index);
|
|
99
|
+
}
|
|
100
|
+
return { sha256, size: bytes.length };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Reads one cached blob.
|
|
104
|
+
*
|
|
105
|
+
* @param projectDir the project root
|
|
106
|
+
* @param sha256 the digest recorded on the attachment
|
|
107
|
+
*/
|
|
108
|
+
export async function readAttachment(projectDir, sha256, options = {}) {
|
|
109
|
+
const fs = options.fs ?? nodeFs;
|
|
110
|
+
const file = attachmentFile(projectDir, sha256);
|
|
111
|
+
const buffer = await readFileIfExists(fs, file);
|
|
112
|
+
if (buffer === undefined) {
|
|
113
|
+
throw new ProjectError('attachment-missing', `Cached attachment ${sha256} is not in this project`, {
|
|
114
|
+
details: { sha256 },
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return new Uint8Array(buffer);
|
|
118
|
+
}
|
|
119
|
+
/** Every blob in the cache, ordered by digest. */
|
|
120
|
+
export async function listAttachments(projectDir, options = {}) {
|
|
121
|
+
const fs = options.fs ?? nodeFs;
|
|
122
|
+
const index = await readIndex(projectDir, fs);
|
|
123
|
+
return [...index.values()].sort((a, b) => a.sha256.localeCompare(b.sha256));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Deletes every cached blob whose digest is not in `referencedShas`, index entry included.
|
|
127
|
+
*
|
|
128
|
+
* Called only when the UI explicitly asks: an automatic prune would race with editing (an
|
|
129
|
+
* attachment removed from a request but not yet saved is still referenced by the document
|
|
130
|
+
* on disk, and vice versa).
|
|
131
|
+
*
|
|
132
|
+
* @param projectDir the project root
|
|
133
|
+
* @param referencedShas digests still referenced by the project's requests
|
|
134
|
+
*/
|
|
135
|
+
export async function pruneAttachments(projectDir, referencedShas, options = {}) {
|
|
136
|
+
const fs = options.fs ?? nodeFs;
|
|
137
|
+
const keep = new Set(referencedShas);
|
|
138
|
+
const index = await readIndex(projectDir, fs);
|
|
139
|
+
const onDisk = (await readdirIfExists(fs, attachmentsDir(projectDir)))
|
|
140
|
+
.filter((entry) => entry.isFile && SHA256.test(entry.name))
|
|
141
|
+
.map((entry) => entry.name);
|
|
142
|
+
const removed = [];
|
|
143
|
+
for (const sha256 of new Set([...index.keys(), ...onDisk]).values()) {
|
|
144
|
+
if (keep.has(sha256)) {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
await fs.rm(attachmentFile(projectDir, sha256), { force: true });
|
|
148
|
+
index.delete(sha256);
|
|
149
|
+
removed.push(sha256);
|
|
150
|
+
}
|
|
151
|
+
if (removed.length > 0) {
|
|
152
|
+
await writeIndex(projectDir, fs, index);
|
|
153
|
+
}
|
|
154
|
+
return { removed: removed.sort() };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The {@link AttachmentResolver} the desktop main process hands to the send path: cached
|
|
158
|
+
* attachments come out of `attachments/`, path attachments off disk (absolute, or relative
|
|
159
|
+
* to the resource root and then to the project itself, in that order).
|
|
160
|
+
*
|
|
161
|
+
* @param projectDir the project root
|
|
162
|
+
* @param resourceRoot the project's resource root, when it has one
|
|
163
|
+
*/
|
|
164
|
+
export function createFileAttachmentResolver(projectDir, resourceRoot, options = {}) {
|
|
165
|
+
const fs = options.fs ?? nodeFs;
|
|
166
|
+
return async (attachment) => {
|
|
167
|
+
if (attachment.source.kind === 'cache') {
|
|
168
|
+
return readAttachment(projectDir, attachment.source.sha256, { fs });
|
|
169
|
+
}
|
|
170
|
+
const path = attachment.source.path;
|
|
171
|
+
const candidates = isAbsolute(path)
|
|
172
|
+
? [path]
|
|
173
|
+
: resourceRoot === undefined
|
|
174
|
+
? [join(projectDir, path)]
|
|
175
|
+
: [join(resourceRoot, path), join(projectDir, path)];
|
|
176
|
+
for (const candidate of candidates) {
|
|
177
|
+
const buffer = await readFileIfExists(fs, candidate);
|
|
178
|
+
if (buffer !== undefined) {
|
|
179
|
+
return new Uint8Array(buffer);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
throw new ProjectError('attachment-unreadable', `Attachment "${attachment.name}" could not be read from ${path}`, {
|
|
183
|
+
details: { attachmentId: attachment.id, path },
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endpoint-level credential precedence: how a request's own `EndpointAuth` combines with the
|
|
3
|
+
* auth configured on the endpoint it is sent to (and, as a last resort, on its interface).
|
|
4
|
+
* Pure — the desktop app resolves the resulting `passwordRef` afterwards.
|
|
5
|
+
*/
|
|
6
|
+
import type { EndpointAuth } from './model.js';
|
|
7
|
+
/**
|
|
8
|
+
* Combines request, endpoint and interface credentials for one send.
|
|
9
|
+
*
|
|
10
|
+
* `override` (the endpoint wins): a defined endpoint auth replaces the request's entirely —
|
|
11
|
+
* including an explicit `{ type: 'none' }`, which deliberately turns authentication off.
|
|
12
|
+
* `complement` (the endpoint only fills blanks): start from the request's auth and take
|
|
13
|
+
* `username`, `passwordRef`, `domain` and `preemptive` from the endpoint wherever the request
|
|
14
|
+
* left them undefined, plus `type` when the request has no type or asks for `none`.
|
|
15
|
+
*
|
|
16
|
+
* When nothing is configured at either level, the interface's auth applies unchanged.
|
|
17
|
+
*
|
|
18
|
+
* @param requestAuth the request's own credentials, if any
|
|
19
|
+
* @param endpointAuth the credentials configured on the target endpoint, if any
|
|
20
|
+
* @param authMode how the endpoint's credentials combine with the request's
|
|
21
|
+
* @param interfaceAuth the interface-wide fallback, if any
|
|
22
|
+
*/
|
|
23
|
+
export declare function effectiveAuth(requestAuth: EndpointAuth | undefined, endpointAuth: EndpointAuth | undefined, authMode: 'override' | 'complement', interfaceAuth?: EndpointAuth): EndpointAuth | undefined;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endpoint-level credential precedence: how a request's own `EndpointAuth` combines with the
|
|
3
|
+
* auth configured on the endpoint it is sent to (and, as a last resort, on its interface).
|
|
4
|
+
* Pure — the desktop app resolves the resulting `passwordRef` afterwards.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Combines request, endpoint and interface credentials for one send.
|
|
8
|
+
*
|
|
9
|
+
* `override` (the endpoint wins): a defined endpoint auth replaces the request's entirely —
|
|
10
|
+
* including an explicit `{ type: 'none' }`, which deliberately turns authentication off.
|
|
11
|
+
* `complement` (the endpoint only fills blanks): start from the request's auth and take
|
|
12
|
+
* `username`, `passwordRef`, `domain` and `preemptive` from the endpoint wherever the request
|
|
13
|
+
* left them undefined, plus `type` when the request has no type or asks for `none`.
|
|
14
|
+
*
|
|
15
|
+
* When nothing is configured at either level, the interface's auth applies unchanged.
|
|
16
|
+
*
|
|
17
|
+
* @param requestAuth the request's own credentials, if any
|
|
18
|
+
* @param endpointAuth the credentials configured on the target endpoint, if any
|
|
19
|
+
* @param authMode how the endpoint's credentials combine with the request's
|
|
20
|
+
* @param interfaceAuth the interface-wide fallback, if any
|
|
21
|
+
*/
|
|
22
|
+
export function effectiveAuth(requestAuth, endpointAuth, authMode, interfaceAuth) {
|
|
23
|
+
return combine(requestAuth, endpointAuth, authMode) ?? interfaceAuth;
|
|
24
|
+
}
|
|
25
|
+
function combine(requestAuth, endpointAuth, authMode) {
|
|
26
|
+
if (authMode === 'override') {
|
|
27
|
+
return endpointAuth ?? requestAuth;
|
|
28
|
+
}
|
|
29
|
+
if (endpointAuth === undefined) {
|
|
30
|
+
return requestAuth;
|
|
31
|
+
}
|
|
32
|
+
if (requestAuth === undefined) {
|
|
33
|
+
return endpointAuth;
|
|
34
|
+
}
|
|
35
|
+
const type = requestAuth.type === 'none' ? endpointAuth.type : requestAuth.type;
|
|
36
|
+
const username = requestAuth.username ?? endpointAuth.username;
|
|
37
|
+
const passwordRef = requestAuth.passwordRef ?? endpointAuth.passwordRef;
|
|
38
|
+
const domain = requestAuth.domain ?? endpointAuth.domain;
|
|
39
|
+
const preemptive = requestAuth.preemptive ?? endpointAuth.preemptive;
|
|
40
|
+
return {
|
|
41
|
+
type,
|
|
42
|
+
...(username !== undefined ? { username } : {}),
|
|
43
|
+
...(passwordRef !== undefined ? { passwordRef } : {}),
|
|
44
|
+
...(domain !== undefined ? { domain } : {}),
|
|
45
|
+
...(preemptive !== undefined ? { preemptive } : {}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 type { Endpoint, Environment, Interface, Project, PropertyMap, RequestDef } from './model.js';
|
|
13
|
+
import type { RestApi } from '../rest/model.js';
|
|
14
|
+
import type { PropertyScopes } from './properties.js';
|
|
15
|
+
/** Finds the environment with `envId` in `project`, or `undefined` when there is none or it isn't found. */
|
|
16
|
+
export declare function findEnvironment(project: Project, envId: string | undefined): Environment | undefined;
|
|
17
|
+
/** Where {@link resolveEndpoint}'s URL came from. */
|
|
18
|
+
export type EndpointSource = 'environment' | 'workspace-environment' | 'request-custom' | 'request-endpoint' | 'interface-default' | 'none';
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the URL a request should actually be sent to, given an optional
|
|
21
|
+
* active environment. See the module doc for the precedence order.
|
|
22
|
+
*
|
|
23
|
+
* `endpoint` is the `Endpoint` object the URL came from, when one exists — the environment
|
|
24
|
+
* override and a request's custom URL name no endpoint, so they carry none. Callers that need
|
|
25
|
+
* the endpoint's own settings (its `trustInvalid` flag, say) read it from here rather than
|
|
26
|
+
* re-deriving the precedence.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveEndpoint(project: Project, envId: string | undefined, iface: Interface, request: Pick<RequestDef, 'endpointId' | 'endpointUrl'>): {
|
|
29
|
+
url: string | undefined;
|
|
30
|
+
source: EndpointSource;
|
|
31
|
+
endpoint?: Endpoint;
|
|
32
|
+
};
|
|
33
|
+
/** Where an API's effective base URL came from. */
|
|
34
|
+
export type BaseUrlSource = 'environment' | 'workspace-environment' | 'api';
|
|
35
|
+
/**
|
|
36
|
+
* Resolves the base URL a REST API's requests are sent against.
|
|
37
|
+
*
|
|
38
|
+
* The same shape as {@link resolveEndpoint} and the same precedence as far as it goes: an active
|
|
39
|
+
* environment's override for the API wins over the API's own base URL, because choosing an
|
|
40
|
+
* environment is how a user says "point everything at test". An API has no per-request URL
|
|
41
|
+
* override to consider — a request that needs another host writes an absolute URL instead.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveApiBaseUrl(project: Project, envId: string | undefined, api: Pick<RestApi, 'slug' | 'baseUrl'>): {
|
|
44
|
+
url: string;
|
|
45
|
+
source: BaseUrlSource;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Resolves the `Endpoint` object a request's *credentials* should come from: the request's own
|
|
49
|
+
* chosen endpoint, else the interface's default, else its first endpoint — the same precedence
|
|
50
|
+
* {@link resolveEndpoint} uses for the URL (minus the environment-override and custom-URL cases,
|
|
51
|
+
* which name no `Endpoint` object of their own, so have no auth to contribute). Callers that need
|
|
52
|
+
* a request's effective auth (not just its URL) should resolve the endpoint through this function
|
|
53
|
+
* rather than re-deriving the precedence, so the two cannot drift apart.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveAuthEndpoint(iface: Interface, request: Pick<RequestDef, 'endpointId'>): Endpoint | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Builds the {@link PropertyScopes} for expanding properties against `project`
|
|
58
|
+
* under the (optional) active environment `envId`. `env` is omitted entirely
|
|
59
|
+
* when there is no active environment, so shorthand lookups correctly skip it.
|
|
60
|
+
* A property switched off via `disabledProperties` (on the project, or on the
|
|
61
|
+
* active environment) is excluded from its scope's map, so it resolves exactly
|
|
62
|
+
* as if it were absent — see {@link enabledProperties}.
|
|
63
|
+
*/
|
|
64
|
+
export declare function resolveScopes(project: Project, envId: string | undefined, globals: PropertyMap, system?: PropertyScopes['system']): PropertyScopes;
|
|
65
|
+
/** Replaces the environment with `env.id` if present, else appends it; preserves relative order otherwise. */
|
|
66
|
+
export declare function upsertEnvironment(project: Project, env: Environment): Project;
|
|
67
|
+
/** Removes the environment with `envId`, keeping the remaining environments' relative order. */
|
|
68
|
+
export declare function removeEnvironment(project: Project, envId: string): Project;
|