@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,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The WS-I Basic Profile 1.1 assertion contracts.
|
|
3
|
+
*
|
|
4
|
+
* An *assertion* is one testable requirement of the profile (`R2001`, `R2705`, …). Each lives in
|
|
5
|
+
* its own module under `assertions/`, is registered in `assertions/index.ts`, and is evaluated by
|
|
6
|
+
* `runWsdlAssertions` against a {@link WsiWsdlContext} — the parsed WSDL plus the raw documents it
|
|
7
|
+
* was parsed from, so an assertion can look at constructs the model deliberately drops.
|
|
8
|
+
*
|
|
9
|
+
* Profile text is quoted only in short fragments (it is published under the WS-I document
|
|
10
|
+
* licence); the rest of every assertion's description is a paraphrase.
|
|
11
|
+
*/
|
|
12
|
+
import type { Document, Element } from '@xmldom/xmldom';
|
|
13
|
+
import type { SoapExchange } from '../../types.js';
|
|
14
|
+
import type { WsdlDefinition } from '../../wsdl/model.js';
|
|
15
|
+
import type { DefinitionBundle } from '../../wsdl/resolver.js';
|
|
16
|
+
import type { SchemaSet } from '../../xsd/schema-set.js';
|
|
17
|
+
/** Conformance level of an assertion: a `MUST`, a `SHOULD`, or a `MAY` in the profile's wording. */
|
|
18
|
+
export type WsiAssertionLevel = 'REQUIRED' | 'RECOMMENDED' | 'PERMITTED';
|
|
19
|
+
/**
|
|
20
|
+
* Outcome of evaluating one assertion:
|
|
21
|
+
* - `passed` — the construct occurs and conforms;
|
|
22
|
+
* - `failed` — a `REQUIRED` assertion is violated;
|
|
23
|
+
* - `warning` — a `RECOMMENDED` assertion is violated;
|
|
24
|
+
* - `notApplicable` — the construct the assertion is about does not occur at all.
|
|
25
|
+
*/
|
|
26
|
+
export type WsiAssertionResult = 'passed' | 'failed' | 'warning' | 'notApplicable';
|
|
27
|
+
/** Where in the description a finding was raised. */
|
|
28
|
+
export interface WsiLocation {
|
|
29
|
+
/** Absolute location of the document holding the offending construct. */
|
|
30
|
+
readonly document: string;
|
|
31
|
+
/** 1-based line within that document. */
|
|
32
|
+
readonly line?: number;
|
|
33
|
+
/** 1-based column within that document. */
|
|
34
|
+
readonly column?: number;
|
|
35
|
+
/** A readable element path, e.g. `/definitions/binding[@name='EchoBinding']`. */
|
|
36
|
+
readonly xpath?: string;
|
|
37
|
+
}
|
|
38
|
+
/** One concrete violation of an assertion. */
|
|
39
|
+
export interface WsiFinding {
|
|
40
|
+
readonly message: string;
|
|
41
|
+
readonly location?: WsiLocation;
|
|
42
|
+
}
|
|
43
|
+
/** The sentinel a `check` returns when the construct it examines does not occur. */
|
|
44
|
+
export interface WsiNotApplicable {
|
|
45
|
+
readonly applicable: false;
|
|
46
|
+
}
|
|
47
|
+
/** The sentinel value assertions return instead of vacuously passing. */
|
|
48
|
+
export declare const NOT_APPLICABLE: WsiNotApplicable;
|
|
49
|
+
/** What an assertion's `check` returns: findings (possibly none), or {@link NOT_APPLICABLE}. */
|
|
50
|
+
export type WsiCheckOutcome = readonly WsiFinding[] | WsiNotApplicable;
|
|
51
|
+
/** Narrows a {@link WsiCheckOutcome} to the not-applicable sentinel. */
|
|
52
|
+
export declare function isNotApplicable(outcome: WsiCheckOutcome): outcome is WsiNotApplicable;
|
|
53
|
+
/** Everything a WSDL-level assertion may inspect. */
|
|
54
|
+
export interface WsiWsdlContext {
|
|
55
|
+
/** The merged, parsed definition. */
|
|
56
|
+
readonly definition: WsdlDefinition;
|
|
57
|
+
/** The resolved import graph, including every document's raw text and kind. */
|
|
58
|
+
readonly bundle: DefinitionBundle;
|
|
59
|
+
/** The compiled schema set, for resolving element/type references. */
|
|
60
|
+
readonly schemaSet: SchemaSet;
|
|
61
|
+
/** Every document of the bundle, keyed by its canonical location. */
|
|
62
|
+
readonly documents: ReadonlyMap<string, Document>;
|
|
63
|
+
}
|
|
64
|
+
/** One testable requirement of the profile. */
|
|
65
|
+
export interface WsiAssertion {
|
|
66
|
+
/** The profile's requirement id, e.g. `R2001`. */
|
|
67
|
+
readonly id: string;
|
|
68
|
+
/** A one-line, paraphrased statement of the requirement. */
|
|
69
|
+
readonly title: string;
|
|
70
|
+
readonly level: WsiAssertionLevel;
|
|
71
|
+
/** The profile section the requirement belongs to, e.g. `4.1 Required Description Formats`. */
|
|
72
|
+
readonly section: string;
|
|
73
|
+
/**
|
|
74
|
+
* Set when the requirement is real and implemented but its *number* could not be confirmed
|
|
75
|
+
* against the published profile. The generated catalogue marks such rows so a reader does not
|
|
76
|
+
* quote an id Wirebench is not sure of.
|
|
77
|
+
*/
|
|
78
|
+
readonly unverifiedId?: boolean;
|
|
79
|
+
/** Evaluates the requirement against one description. */
|
|
80
|
+
check(context: WsiWsdlContext): WsiCheckOutcome;
|
|
81
|
+
}
|
|
82
|
+
/** One assertion's entry in a {@link WsiReport}. */
|
|
83
|
+
export interface WsiAssertionReport {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly title: string;
|
|
86
|
+
readonly level: WsiAssertionLevel;
|
|
87
|
+
readonly section: string;
|
|
88
|
+
readonly result: WsiAssertionResult;
|
|
89
|
+
readonly findings: readonly WsiFinding[];
|
|
90
|
+
/** Carried from {@link WsiAssertion.unverifiedId}/{@link WsiMessageAssertion.unverifiedId}. */
|
|
91
|
+
readonly unverifiedId?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** How many assertions ended in each result. Always counts every assertion that ran. */
|
|
94
|
+
export interface WsiSummary {
|
|
95
|
+
readonly passed: number;
|
|
96
|
+
readonly failed: number;
|
|
97
|
+
readonly warning: number;
|
|
98
|
+
readonly notApplicable: number;
|
|
99
|
+
}
|
|
100
|
+
/** The result of analysing one description against the profile. */
|
|
101
|
+
export interface WsiReport {
|
|
102
|
+
/** The location of the description that was analysed (the bundle's root document). */
|
|
103
|
+
readonly target: string;
|
|
104
|
+
readonly profile: 'BP1.1';
|
|
105
|
+
/** Counts across every assertion that ran, regardless of `verbose`. */
|
|
106
|
+
readonly summary: WsiSummary;
|
|
107
|
+
/** Every assertion when `verbose`, only the failed/warning ones otherwise. */
|
|
108
|
+
readonly assertions: readonly WsiAssertionReport[];
|
|
109
|
+
}
|
|
110
|
+
/** Which half of an exchange an assertion is looking at. */
|
|
111
|
+
export type WsiMessageDirection = 'request' | 'response';
|
|
112
|
+
/**
|
|
113
|
+
* What the binding says about the messages of one operation. The message assertions need only
|
|
114
|
+
* this much of the description: whether a construct is legal usually turns on the SOAP version,
|
|
115
|
+
* the style and the `use`.
|
|
116
|
+
*/
|
|
117
|
+
export interface WsiMessageBinding {
|
|
118
|
+
readonly soapVersion: '1.1' | '1.2';
|
|
119
|
+
readonly style: 'document' | 'rpc';
|
|
120
|
+
readonly use: 'literal' | 'encoded';
|
|
121
|
+
/** The bound operation's name, for a readable finding. */
|
|
122
|
+
readonly operation?: string;
|
|
123
|
+
/** The `soapAction` the binding declares, when it declares one. */
|
|
124
|
+
readonly soapAction?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* One half of the exchange, prepared for the assertions: the HTTP metadata plus the parsed
|
|
128
|
+
* envelope. `document` is absent when the half carried no XML or could not be parsed — an
|
|
129
|
+
* assertion that needs a DOM reports {@link NOT_APPLICABLE} rather than guessing.
|
|
130
|
+
*/
|
|
131
|
+
export interface WsiMessageView {
|
|
132
|
+
readonly direction: WsiMessageDirection;
|
|
133
|
+
/**
|
|
134
|
+
* Header names lower-cased, as both `HttpExchange` halves already store them, and redacted down
|
|
135
|
+
* to the allow-list the message assertions actually need (`content-type`, `soapaction`,
|
|
136
|
+
* `content-length`, `transfer-encoding`, `content-encoding`, `accept`, `host`, `connection`) —
|
|
137
|
+
* see `HEADER_ALLOWLIST` in `run-message.ts`. Never quote a header value or element text outside
|
|
138
|
+
* this allow-list: an `Authorization` header or a WSS credential must never reach a finding
|
|
139
|
+
* message or an exported report.
|
|
140
|
+
*/
|
|
141
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
142
|
+
/** The envelope text, when one is available. */
|
|
143
|
+
readonly envelopeXml?: string;
|
|
144
|
+
readonly document?: Document;
|
|
145
|
+
/** The document element, when it is a `soap:Envelope` of a SOAP version the profile knows. */
|
|
146
|
+
readonly envelope?: Element;
|
|
147
|
+
/** The envelope namespace actually used, which may differ from the bound version. */
|
|
148
|
+
readonly soapNs?: string;
|
|
149
|
+
/** HTTP status; responses only. */
|
|
150
|
+
readonly status?: number;
|
|
151
|
+
}
|
|
152
|
+
/** Everything a message-level assertion may inspect. */
|
|
153
|
+
export interface WsiMessageContext {
|
|
154
|
+
readonly exchange: SoapExchange;
|
|
155
|
+
readonly binding: WsiMessageBinding;
|
|
156
|
+
/** The half the run was asked about; both halves are still offered in {@link messages}. */
|
|
157
|
+
readonly direction: WsiMessageDirection;
|
|
158
|
+
readonly request: WsiMessageView;
|
|
159
|
+
/** Absent when the send never got a response. */
|
|
160
|
+
readonly response?: WsiMessageView;
|
|
161
|
+
/** The request, then the response when there is one — what most assertions iterate. */
|
|
162
|
+
readonly messages: readonly WsiMessageView[];
|
|
163
|
+
}
|
|
164
|
+
/** One testable requirement of the profile that constrains a message rather than a description. */
|
|
165
|
+
export interface WsiMessageAssertion {
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly title: string;
|
|
168
|
+
readonly level: WsiAssertionLevel;
|
|
169
|
+
readonly section: string;
|
|
170
|
+
/** See {@link WsiAssertion.unverifiedId}. */
|
|
171
|
+
readonly unverifiedId?: boolean;
|
|
172
|
+
check(context: WsiMessageContext): WsiCheckOutcome;
|
|
173
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The WS-I Basic Profile 1.1 assertion contracts.
|
|
3
|
+
*
|
|
4
|
+
* An *assertion* is one testable requirement of the profile (`R2001`, `R2705`, …). Each lives in
|
|
5
|
+
* its own module under `assertions/`, is registered in `assertions/index.ts`, and is evaluated by
|
|
6
|
+
* `runWsdlAssertions` against a {@link WsiWsdlContext} — the parsed WSDL plus the raw documents it
|
|
7
|
+
* was parsed from, so an assertion can look at constructs the model deliberately drops.
|
|
8
|
+
*
|
|
9
|
+
* Profile text is quoted only in short fragments (it is published under the WS-I document
|
|
10
|
+
* licence); the rest of every assertion's description is a paraphrase.
|
|
11
|
+
*/
|
|
12
|
+
/** The sentinel value assertions return instead of vacuously passing. */
|
|
13
|
+
export const NOT_APPLICABLE = Object.freeze({ applicable: false });
|
|
14
|
+
/** Narrows a {@link WsiCheckOutcome} to the not-applicable sentinel. */
|
|
15
|
+
export function isNotApplicable(outcome) {
|
|
16
|
+
return 'applicable' in outcome;
|
|
17
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a path inside a shared workspace's tree to the entity it belongs to, and turns a list of
|
|
3
|
+
* changed paths into a git commit message. Pure: no file-system access, no git. `SyncService`
|
|
4
|
+
* (main) calls {@link commitMessage} with the paths `git status`/`diff --name-only` reported for
|
|
5
|
+
* the working tree, right before running `git commit`.
|
|
6
|
+
*
|
|
7
|
+
* Paths are always `/`-separated tree-relative paths, as git itself reports them — never joined
|
|
8
|
+
* with `node:path`, which would emit `\` on Windows and break every pattern below.
|
|
9
|
+
*/
|
|
10
|
+
/** What kind of entity a tree path belongs to. */
|
|
11
|
+
export type TreeEntityKind = 'workspace' | 'environment' | 'project' | 'interface' | 'request' | 'project-environment' | 'wss' | 'keystores' | 'attachment' | 'definition' | 'other';
|
|
12
|
+
/**
|
|
13
|
+
* The entity a tree path belongs to. `key` identifies the entity itself (as opposed to the file):
|
|
14
|
+
* a request's `.request.yaml` and `.xml` share one key, as do every file under one interface's
|
|
15
|
+
* `definition/` cache — so {@link commitMessage} can group them into a single change.
|
|
16
|
+
*/
|
|
17
|
+
export interface TreeEntity {
|
|
18
|
+
readonly kind: TreeEntityKind;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly projectSlug?: string;
|
|
21
|
+
readonly key: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Classifies a tree-relative path into the {@link TreeEntity} it belongs to, following the tree
|
|
25
|
+
* layout `workspace.yaml`, `environments/<slug>.yaml`, `.gitattributes` at the root plus
|
|
26
|
+
* `projects/<slug>/` per internal project (itself laid out exactly as `project/serialize.ts`'s
|
|
27
|
+
* `projectFiles()` writes it). Anything unrecognised — including `.gitattributes` — classifies as
|
|
28
|
+
* `other`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function describeTreePath(relativePath: string): TreeEntity;
|
|
31
|
+
/** A path that changed in the tree, as `git status`/`diff --name-only` reports it. */
|
|
32
|
+
export interface TreeChange {
|
|
33
|
+
readonly path: string;
|
|
34
|
+
readonly status: 'added' | 'modified' | 'deleted';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Builds a git commit message — subject line, blank line, one changed path per line — from the
|
|
38
|
+
* tree paths a save touched. `''` for no changes (nothing to commit).
|
|
39
|
+
*
|
|
40
|
+
* One entity changed: `Update request GetWeather in billing`, `Add environment QA`, `Update
|
|
41
|
+
* workspace properties`. Several: `Update 3 requests, 1 environment`, counts sorted by count
|
|
42
|
+
* descending then label ascending. `options.autosave` appends ` (autosave)`; the subject
|
|
43
|
+
* (suffix included) is truncated to {@link MAX_SUBJECT_LENGTH} characters with a trailing `…`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function commitMessage(changes: readonly TreeChange[], options?: {
|
|
46
|
+
readonly autosave?: boolean;
|
|
47
|
+
}): string;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a path inside a shared workspace's tree to the entity it belongs to, and turns a list of
|
|
3
|
+
* changed paths into a git commit message. Pure: no file-system access, no git. `SyncService`
|
|
4
|
+
* (main) calls {@link commitMessage} with the paths `git status`/`diff --name-only` reported for
|
|
5
|
+
* the working tree, right before running `git commit`.
|
|
6
|
+
*
|
|
7
|
+
* Paths are always `/`-separated tree-relative paths, as git itself reports them — never joined
|
|
8
|
+
* with `node:path`, which would emit `\` on Windows and break every pattern below.
|
|
9
|
+
*/
|
|
10
|
+
import { WSS_DIR, REQUEST_SUFFIX } from '../project/paths.js';
|
|
11
|
+
import { KEYSTORES_PATH } from '../project/serialize.js';
|
|
12
|
+
import { WORKSPACE_ENVIRONMENTS_DIR, WORKSPACE_MANIFEST, WORKSPACE_PROJECTS_DIR } from './paths.js';
|
|
13
|
+
/** Last `/`-separated segment of a path. */
|
|
14
|
+
function basename(path) {
|
|
15
|
+
const index = path.lastIndexOf('/');
|
|
16
|
+
return index === -1 ? path : path.slice(index + 1);
|
|
17
|
+
}
|
|
18
|
+
/** Classifies a path inside a project's own folder (relative to `projects/<slug>/`). */
|
|
19
|
+
function describeProjectPath(projectSlug, relative, fullPath) {
|
|
20
|
+
if (relative === 'wirebench.yaml') {
|
|
21
|
+
return { kind: 'project', name: projectSlug, projectSlug, key: fullPath };
|
|
22
|
+
}
|
|
23
|
+
if (relative === KEYSTORES_PATH) {
|
|
24
|
+
return { kind: 'keystores', name: 'keystores', projectSlug, key: fullPath };
|
|
25
|
+
}
|
|
26
|
+
const wssMatch = /^wss\/[^/]+\/([^/]+)\.yaml$/.exec(relative);
|
|
27
|
+
if (wssMatch !== undefined && wssMatch !== null) {
|
|
28
|
+
return { kind: 'wss', name: wssMatch[1] ?? basename(relative), projectSlug, key: fullPath };
|
|
29
|
+
}
|
|
30
|
+
if (relative.startsWith(`${WSS_DIR}/`)) {
|
|
31
|
+
// Any other file under wss/ that isn't the registry or a `<direction>/<name>.yaml` config.
|
|
32
|
+
return { kind: 'wss', name: basename(relative), projectSlug, key: fullPath };
|
|
33
|
+
}
|
|
34
|
+
if (relative.startsWith('attachments/')) {
|
|
35
|
+
return { kind: 'attachment', name: basename(relative), projectSlug, key: fullPath };
|
|
36
|
+
}
|
|
37
|
+
const environmentMatch = /^environments\/([^/]+)\.yaml$/.exec(relative);
|
|
38
|
+
if (environmentMatch !== undefined && environmentMatch !== null) {
|
|
39
|
+
return { kind: 'project-environment', name: environmentMatch[1] ?? basename(relative), projectSlug, key: fullPath };
|
|
40
|
+
}
|
|
41
|
+
// A request occupies two files under the same operation folder that share one entity key:
|
|
42
|
+
// `<slug>.request.yaml` (metadata) and `<slug>.xml` (the verbatim envelope) — see
|
|
43
|
+
// `project/paths.ts`'s `requestFiles()`.
|
|
44
|
+
const requestSuffix = escapeRegExp(REQUEST_SUFFIX);
|
|
45
|
+
const requestMatch = new RegExp(`^interfaces/[^/]+/operations/[^/]+/([^/]+)(?:${requestSuffix}|\\.xml)$`).exec(relative);
|
|
46
|
+
if (requestMatch !== undefined && requestMatch !== null) {
|
|
47
|
+
const requestSlug = requestMatch[1] ?? basename(relative);
|
|
48
|
+
const suffixLength = relative.endsWith(REQUEST_SUFFIX) ? REQUEST_SUFFIX.length : '.xml'.length;
|
|
49
|
+
const key = fullPath.slice(0, fullPath.length - suffixLength);
|
|
50
|
+
return { kind: 'request', name: requestSlug, projectSlug, key };
|
|
51
|
+
}
|
|
52
|
+
const interfaceMatch = /^interfaces\/([^/]+)\/interface\.yaml$/.exec(relative);
|
|
53
|
+
if (interfaceMatch !== undefined && interfaceMatch !== null) {
|
|
54
|
+
return { kind: 'interface', name: interfaceMatch[1] ?? basename(relative), projectSlug, key: fullPath };
|
|
55
|
+
}
|
|
56
|
+
const definitionMatch = /^interfaces\/([^/]+)\/definition\//.exec(relative);
|
|
57
|
+
if (definitionMatch !== undefined && definitionMatch !== null) {
|
|
58
|
+
const interfaceSlug = definitionMatch[1] ?? basename(relative);
|
|
59
|
+
return {
|
|
60
|
+
kind: 'definition',
|
|
61
|
+
name: interfaceSlug,
|
|
62
|
+
projectSlug,
|
|
63
|
+
key: `${WORKSPACE_PROJECTS_DIR}/${projectSlug}/interfaces/${interfaceSlug}/definition`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return { kind: 'other', name: basename(relative), key: fullPath };
|
|
67
|
+
}
|
|
68
|
+
function escapeRegExp(value) {
|
|
69
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Classifies a tree-relative path into the {@link TreeEntity} it belongs to, following the tree
|
|
73
|
+
* layout `workspace.yaml`, `environments/<slug>.yaml`, `.gitattributes` at the root plus
|
|
74
|
+
* `projects/<slug>/` per internal project (itself laid out exactly as `project/serialize.ts`'s
|
|
75
|
+
* `projectFiles()` writes it). Anything unrecognised — including `.gitattributes` — classifies as
|
|
76
|
+
* `other`.
|
|
77
|
+
*/
|
|
78
|
+
export function describeTreePath(relativePath) {
|
|
79
|
+
if (relativePath === WORKSPACE_MANIFEST) {
|
|
80
|
+
return { kind: 'workspace', name: 'workspace', key: relativePath };
|
|
81
|
+
}
|
|
82
|
+
const environmentMatch = new RegExp(`^${WORKSPACE_ENVIRONMENTS_DIR}/([^/]+)\\.yaml$`).exec(relativePath);
|
|
83
|
+
if (environmentMatch !== undefined && environmentMatch !== null) {
|
|
84
|
+
return { kind: 'environment', name: environmentMatch[1] ?? basename(relativePath), key: relativePath };
|
|
85
|
+
}
|
|
86
|
+
const projectMatch = new RegExp(`^${WORKSPACE_PROJECTS_DIR}/([^/]+)/(.+)$`).exec(relativePath);
|
|
87
|
+
if (projectMatch !== undefined && projectMatch !== null) {
|
|
88
|
+
const projectSlug = projectMatch[1] ?? '';
|
|
89
|
+
const rest = projectMatch[2] ?? '';
|
|
90
|
+
return describeProjectPath(projectSlug, rest, relativePath);
|
|
91
|
+
}
|
|
92
|
+
return { kind: 'other', name: basename(relativePath), key: relativePath };
|
|
93
|
+
}
|
|
94
|
+
/** Human-facing label for one entity kind, singular. */
|
|
95
|
+
const LABELS = {
|
|
96
|
+
workspace: 'workspace properties',
|
|
97
|
+
environment: 'environment',
|
|
98
|
+
project: 'project',
|
|
99
|
+
interface: 'interface',
|
|
100
|
+
request: 'request',
|
|
101
|
+
'project-environment': 'project environment',
|
|
102
|
+
wss: 'WS-Security config',
|
|
103
|
+
keystores: 'keystores',
|
|
104
|
+
attachment: 'attachment',
|
|
105
|
+
definition: 'definition',
|
|
106
|
+
other: 'file',
|
|
107
|
+
};
|
|
108
|
+
/** Kinds whose label does not take a plain `s` suffix when the count isn't 1. */
|
|
109
|
+
const INVARIANT_PLURAL = new Set(['keystores', 'workspace']);
|
|
110
|
+
function pluralise(kind, count) {
|
|
111
|
+
const label = LABELS[kind];
|
|
112
|
+
if (count === 1 || INVARIANT_PLURAL.has(kind)) {
|
|
113
|
+
return label;
|
|
114
|
+
}
|
|
115
|
+
return `${label}s`;
|
|
116
|
+
}
|
|
117
|
+
const MAX_SUBJECT_LENGTH = 72;
|
|
118
|
+
const AUTOSAVE_SUFFIX = ' (autosave)';
|
|
119
|
+
/** Combines an entity's changed-file statuses into one verb: mixed statuses read as `modified`. */
|
|
120
|
+
function combinedStatus(statuses) {
|
|
121
|
+
if (statuses.every((status) => status === 'added')) {
|
|
122
|
+
return 'added';
|
|
123
|
+
}
|
|
124
|
+
if (statuses.every((status) => status === 'deleted')) {
|
|
125
|
+
return 'deleted';
|
|
126
|
+
}
|
|
127
|
+
return 'modified';
|
|
128
|
+
}
|
|
129
|
+
const VERBS = {
|
|
130
|
+
added: 'Add',
|
|
131
|
+
modified: 'Update',
|
|
132
|
+
deleted: 'Delete',
|
|
133
|
+
};
|
|
134
|
+
/** Truncates `subject` to fit `AUTOSAVE_SUFFIX` (when `autosave`) within {@link MAX_SUBJECT_LENGTH}. */
|
|
135
|
+
function withAutosave(subject, autosave) {
|
|
136
|
+
const suffix = autosave === true ? AUTOSAVE_SUFFIX : '';
|
|
137
|
+
const full = `${subject}${suffix}`;
|
|
138
|
+
if (full.length <= MAX_SUBJECT_LENGTH) {
|
|
139
|
+
return full;
|
|
140
|
+
}
|
|
141
|
+
const budget = MAX_SUBJECT_LENGTH - suffix.length - 1; // 1 for the ellipsis
|
|
142
|
+
return `${subject.slice(0, budget)}…${suffix}`;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Builds a git commit message — subject line, blank line, one changed path per line — from the
|
|
146
|
+
* tree paths a save touched. `''` for no changes (nothing to commit).
|
|
147
|
+
*
|
|
148
|
+
* One entity changed: `Update request GetWeather in billing`, `Add environment QA`, `Update
|
|
149
|
+
* workspace properties`. Several: `Update 3 requests, 1 environment`, counts sorted by count
|
|
150
|
+
* descending then label ascending. `options.autosave` appends ` (autosave)`; the subject
|
|
151
|
+
* (suffix included) is truncated to {@link MAX_SUBJECT_LENGTH} characters with a trailing `…`.
|
|
152
|
+
*/
|
|
153
|
+
export function commitMessage(changes, options) {
|
|
154
|
+
if (changes.length === 0) {
|
|
155
|
+
return '';
|
|
156
|
+
}
|
|
157
|
+
const groups = new Map();
|
|
158
|
+
for (const change of changes) {
|
|
159
|
+
const entity = describeTreePath(change.path);
|
|
160
|
+
let group = groups.get(entity.key);
|
|
161
|
+
if (group === undefined) {
|
|
162
|
+
group = { entity, paths: [], statuses: [] };
|
|
163
|
+
groups.set(entity.key, group);
|
|
164
|
+
}
|
|
165
|
+
group.paths.push(change.path);
|
|
166
|
+
group.statuses.push(change.status);
|
|
167
|
+
}
|
|
168
|
+
const body = [...changes.map((change) => change.path)].sort().join('\n');
|
|
169
|
+
let subject;
|
|
170
|
+
if (groups.size === 1) {
|
|
171
|
+
const group = groups.values().next().value;
|
|
172
|
+
const { entity } = group;
|
|
173
|
+
const verb = VERBS[combinedStatus(group.statuses)];
|
|
174
|
+
const label = LABELS[entity.kind];
|
|
175
|
+
const nameSuffix = entity.kind === 'workspace' ? '' : ` ${entity.name}`;
|
|
176
|
+
const projectSuffix = entity.projectSlug === undefined ? '' : ` in ${entity.projectSlug}`;
|
|
177
|
+
subject = `${verb} ${label}${nameSuffix}${projectSuffix}`;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const counts = new Map();
|
|
181
|
+
for (const group of groups.values()) {
|
|
182
|
+
counts.set(group.entity.kind, (counts.get(group.entity.kind) ?? 0) + 1);
|
|
183
|
+
}
|
|
184
|
+
const parts = [...counts.entries()]
|
|
185
|
+
.sort(([kindA, countA], [kindB, countB]) => {
|
|
186
|
+
if (countA !== countB) {
|
|
187
|
+
return countB - countA;
|
|
188
|
+
}
|
|
189
|
+
return LABELS[kindA].localeCompare(LABELS[kindB]);
|
|
190
|
+
})
|
|
191
|
+
.map(([kind, count]) => `${count} ${pluralise(kind, count)}`);
|
|
192
|
+
subject = `Update ${parts.join(', ')}`;
|
|
193
|
+
}
|
|
194
|
+
return `${withAutosave(subject, options?.autosave)}\n\n${body}`;
|
|
195
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teaches the workspace layer to `project/properties.ts` and
|
|
3
|
+
* `project/environments.ts`: linking a workspace environment to the project
|
|
4
|
+
* environment of the same slug, building the `PropertyScopes` for a project
|
|
5
|
+
* open inside a workspace, and resolving the endpoint a request should
|
|
6
|
+
* actually be sent to under an active workspace environment.
|
|
7
|
+
*
|
|
8
|
+
* Precedence for the endpoint: a linked project environment's own override
|
|
9
|
+
* for the interface wins (same as `resolveEndpoint`'s environment case);
|
|
10
|
+
* otherwise the active workspace environment's override for
|
|
11
|
+
* `<projectSlug>/<interfaceSlug>`; otherwise whatever `resolveEndpoint`
|
|
12
|
+
* would return with no project environment active (request-custom,
|
|
13
|
+
* request-endpoint, interface-default). Environment layers name no
|
|
14
|
+
* `Endpoint` object of their own, so neither of the first two branches
|
|
15
|
+
* carries one.
|
|
16
|
+
*/
|
|
17
|
+
import type { Endpoint, Environment, Interface, Project, PropertyMap, RequestDef } from '../project/model.js';
|
|
18
|
+
import type { BaseUrlSource, EndpointSource } from '../project/environments.js';
|
|
19
|
+
import type { RestApi } from '../rest/model.js';
|
|
20
|
+
import type { PropertyScopes } from '../project/properties.js';
|
|
21
|
+
import type { Workspace, WorkspaceEnvironment } from './model.js';
|
|
22
|
+
/**
|
|
23
|
+
* The project environment whose `slug` matches `workspaceEnv`'s, or
|
|
24
|
+
* `undefined` when there is no such environment (or `workspaceEnv` itself
|
|
25
|
+
* is `undefined`).
|
|
26
|
+
*/
|
|
27
|
+
export declare function linkedEnvironment(project: Project, workspaceEnv: WorkspaceEnvironment | undefined): Environment | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Builds the {@link PropertyScopes} for expanding properties against `project` as opened inside
|
|
30
|
+
* `workspace`. `env` merges the active workspace environment's properties with the linked
|
|
31
|
+
* project environment's (project wins on a shared key), and is omitted entirely when neither
|
|
32
|
+
* exists, so shorthand lookups correctly skip it — matching `resolveScopes`'s behaviour for a
|
|
33
|
+
* project with no active environment. A property switched off via `disabledProperties` (on the
|
|
34
|
+
* workspace, the project, the active workspace environment, or the linked project environment)
|
|
35
|
+
* is excluded from its own scope before the merge, so e.g. a value disabled only in the
|
|
36
|
+
* workspace environment still falls through to an enabled value in the linked project
|
|
37
|
+
* environment — see {@link enabledProperties}.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveWorkspaceScopes(input: {
|
|
40
|
+
readonly workspace: Workspace;
|
|
41
|
+
readonly project: Project;
|
|
42
|
+
readonly globals: PropertyMap;
|
|
43
|
+
readonly system?: PropertyScopes['system'];
|
|
44
|
+
}): PropertyScopes;
|
|
45
|
+
/**
|
|
46
|
+
* Resolves the URL a request should actually be sent to for a project open inside `workspace`.
|
|
47
|
+
* See the module doc for the precedence order. `endpoint` is present only when the URL came
|
|
48
|
+
* from an `Endpoint` object (i.e. the fallback to {@link resolveEndpoint} landed on
|
|
49
|
+
* `request-endpoint` or `interface-default`) — the two environment-override branches name no
|
|
50
|
+
* `Endpoint`, matching `resolveEndpoint`'s own contract.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveWorkspaceEndpoint(input: {
|
|
53
|
+
readonly workspace: Workspace;
|
|
54
|
+
readonly project: Project;
|
|
55
|
+
readonly projectSlug: string;
|
|
56
|
+
readonly iface: Interface;
|
|
57
|
+
readonly request: Pick<RequestDef, 'endpointId' | 'endpointUrl'>;
|
|
58
|
+
}): {
|
|
59
|
+
url: string | undefined;
|
|
60
|
+
source: EndpointSource;
|
|
61
|
+
endpoint?: Endpoint;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Resolves an API's base URL the way a project open inside a workspace actually resolves it:
|
|
65
|
+
* a linked project's own environment first, then the workspace environment's override keyed
|
|
66
|
+
* `<projectSlug>/<apiSlug>`, then the API's own base URL.
|
|
67
|
+
*
|
|
68
|
+
* The same ladder {@link resolveWorkspaceEndpoint} climbs for a SOAP interface, and keyed the same
|
|
69
|
+
* way — which is why an API and an interface may not share a slug (`project/load.ts` refuses it).
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveWorkspaceApiBaseUrl(input: {
|
|
72
|
+
readonly workspace: Workspace;
|
|
73
|
+
readonly project: Project;
|
|
74
|
+
readonly projectSlug: string;
|
|
75
|
+
readonly api: Pick<RestApi, 'slug' | 'baseUrl'>;
|
|
76
|
+
}): {
|
|
77
|
+
url: string;
|
|
78
|
+
source: BaseUrlSource;
|
|
79
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teaches the workspace layer to `project/properties.ts` and
|
|
3
|
+
* `project/environments.ts`: linking a workspace environment to the project
|
|
4
|
+
* environment of the same slug, building the `PropertyScopes` for a project
|
|
5
|
+
* open inside a workspace, and resolving the endpoint a request should
|
|
6
|
+
* actually be sent to under an active workspace environment.
|
|
7
|
+
*
|
|
8
|
+
* Precedence for the endpoint: a linked project environment's own override
|
|
9
|
+
* for the interface wins (same as `resolveEndpoint`'s environment case);
|
|
10
|
+
* otherwise the active workspace environment's override for
|
|
11
|
+
* `<projectSlug>/<interfaceSlug>`; otherwise whatever `resolveEndpoint`
|
|
12
|
+
* would return with no project environment active (request-custom,
|
|
13
|
+
* request-endpoint, interface-default). Environment layers name no
|
|
14
|
+
* `Endpoint` object of their own, so neither of the first two branches
|
|
15
|
+
* carries one.
|
|
16
|
+
*/
|
|
17
|
+
import { resolveApiBaseUrl, resolveEndpoint } from '../project/environments.js';
|
|
18
|
+
import { enabledProperties } from '../project/properties.js';
|
|
19
|
+
/**
|
|
20
|
+
* The project environment whose `slug` matches `workspaceEnv`'s, or
|
|
21
|
+
* `undefined` when there is no such environment (or `workspaceEnv` itself
|
|
22
|
+
* is `undefined`).
|
|
23
|
+
*/
|
|
24
|
+
export function linkedEnvironment(project, workspaceEnv) {
|
|
25
|
+
if (workspaceEnv === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return project.environments.find((environment) => environment.slug === workspaceEnv.slug);
|
|
29
|
+
}
|
|
30
|
+
/** Finds `workspace`'s active environment (per `activeEnvironmentId`), or `undefined` when none is active. */
|
|
31
|
+
function activeWorkspaceEnvironment(workspace) {
|
|
32
|
+
if (workspace.activeEnvironmentId === undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return workspace.environments.find((environment) => environment.id === workspace.activeEnvironmentId);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Builds the {@link PropertyScopes} for expanding properties against `project` as opened inside
|
|
39
|
+
* `workspace`. `env` merges the active workspace environment's properties with the linked
|
|
40
|
+
* project environment's (project wins on a shared key), and is omitted entirely when neither
|
|
41
|
+
* exists, so shorthand lookups correctly skip it — matching `resolveScopes`'s behaviour for a
|
|
42
|
+
* project with no active environment. A property switched off via `disabledProperties` (on the
|
|
43
|
+
* workspace, the project, the active workspace environment, or the linked project environment)
|
|
44
|
+
* is excluded from its own scope before the merge, so e.g. a value disabled only in the
|
|
45
|
+
* workspace environment still falls through to an enabled value in the linked project
|
|
46
|
+
* environment — see {@link enabledProperties}.
|
|
47
|
+
*/
|
|
48
|
+
export function resolveWorkspaceScopes(input) {
|
|
49
|
+
const { workspace, project, globals, system } = input;
|
|
50
|
+
const activeWorkspaceEnv = activeWorkspaceEnvironment(workspace);
|
|
51
|
+
const linkedProjectEnv = linkedEnvironment(project, activeWorkspaceEnv);
|
|
52
|
+
const enabledWorkspaceEnvProperties = activeWorkspaceEnv !== undefined
|
|
53
|
+
? enabledProperties(activeWorkspaceEnv.properties, activeWorkspaceEnv.disabledProperties)
|
|
54
|
+
: undefined;
|
|
55
|
+
const enabledLinkedProjectEnvProperties = linkedProjectEnv !== undefined
|
|
56
|
+
? enabledProperties(linkedProjectEnv.properties, linkedProjectEnv.disabledProperties)
|
|
57
|
+
: undefined;
|
|
58
|
+
const env = activeWorkspaceEnv !== undefined || linkedProjectEnv !== undefined
|
|
59
|
+
? { ...enabledWorkspaceEnvProperties, ...enabledLinkedProjectEnvProperties }
|
|
60
|
+
: undefined;
|
|
61
|
+
return {
|
|
62
|
+
project: enabledProperties(project.properties, project.disabledProperties),
|
|
63
|
+
workspace: enabledProperties(workspace.properties, workspace.disabledProperties),
|
|
64
|
+
global: globals,
|
|
65
|
+
...(env !== undefined ? { env } : {}),
|
|
66
|
+
...(system !== undefined ? { system } : {}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Resolves the URL a request should actually be sent to for a project open inside `workspace`.
|
|
71
|
+
* See the module doc for the precedence order. `endpoint` is present only when the URL came
|
|
72
|
+
* from an `Endpoint` object (i.e. the fallback to {@link resolveEndpoint} landed on
|
|
73
|
+
* `request-endpoint` or `interface-default`) — the two environment-override branches name no
|
|
74
|
+
* `Endpoint`, matching `resolveEndpoint`'s own contract.
|
|
75
|
+
*/
|
|
76
|
+
export function resolveWorkspaceEndpoint(input) {
|
|
77
|
+
const { workspace, project, projectSlug, iface, request } = input;
|
|
78
|
+
const activeWorkspaceEnv = activeWorkspaceEnvironment(workspace);
|
|
79
|
+
const linkedProjectEnv = linkedEnvironment(project, activeWorkspaceEnv);
|
|
80
|
+
if (linkedProjectEnv !== undefined) {
|
|
81
|
+
const override = linkedProjectEnv.endpoints[iface.slug];
|
|
82
|
+
if (override !== undefined) {
|
|
83
|
+
return { url: override, source: 'environment' };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (activeWorkspaceEnv !== undefined) {
|
|
87
|
+
const override = activeWorkspaceEnv.endpoints[`${projectSlug}/${iface.slug}`];
|
|
88
|
+
if (override !== undefined) {
|
|
89
|
+
return { url: override, source: 'workspace-environment' };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return resolveEndpoint(project, undefined, iface, request);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Resolves an API's base URL the way a project open inside a workspace actually resolves it:
|
|
96
|
+
* a linked project's own environment first, then the workspace environment's override keyed
|
|
97
|
+
* `<projectSlug>/<apiSlug>`, then the API's own base URL.
|
|
98
|
+
*
|
|
99
|
+
* The same ladder {@link resolveWorkspaceEndpoint} climbs for a SOAP interface, and keyed the same
|
|
100
|
+
* way — which is why an API and an interface may not share a slug (`project/load.ts` refuses it).
|
|
101
|
+
*/
|
|
102
|
+
export function resolveWorkspaceApiBaseUrl(input) {
|
|
103
|
+
const { workspace, project, projectSlug, api } = input;
|
|
104
|
+
const activeWorkspaceEnv = activeWorkspaceEnvironment(workspace);
|
|
105
|
+
const linkedProjectEnv = linkedEnvironment(project, activeWorkspaceEnv);
|
|
106
|
+
const linkedOverride = linkedProjectEnv?.endpoints[api.slug];
|
|
107
|
+
if (linkedOverride !== undefined) {
|
|
108
|
+
return { url: linkedOverride, source: 'environment' };
|
|
109
|
+
}
|
|
110
|
+
const workspaceOverride = activeWorkspaceEnv?.endpoints[`${projectSlug}/${api.slug}`];
|
|
111
|
+
if (workspaceOverride !== undefined) {
|
|
112
|
+
return { url: workspaceOverride, source: 'workspace-environment' };
|
|
113
|
+
}
|
|
114
|
+
return resolveApiBaseUrl(project, undefined, api);
|
|
115
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface of the workspace module: a workspace's model, its on-disk
|
|
3
|
+
* schema and file-system layout, and the load/save/migrate functions that
|
|
4
|
+
* move between the two. Mirrors the shape of `project/` one level up (see
|
|
5
|
+
* `workspace/model.ts` for what a workspace is), collected here so
|
|
6
|
+
* `src/index.ts` can re-export the whole module with one pair of blocks.
|
|
7
|
+
*/
|
|
8
|
+
export { WORKSPACE_FORMAT_VERSION, createWorkspace, createWorkspaceEnvironment } from './model.js';
|
|
9
|
+
export type { Workspace, WorkspaceEnvironment, WorkspaceProjectRef } from './model.js';
|
|
10
|
+
export { parseWorkspaceFile, workspaceEnvironmentFileSchema, workspaceManifestSchema, workspaceProjectRefSchema, workspaceLocalStateSchema, workspaceShareSchema, } from './schema.js';
|
|
11
|
+
export type { WorkspaceEnvironmentFile, WorkspaceManifestFile, WorkspaceProjectRefFile } from './schema.js';
|
|
12
|
+
export { WORKSPACES_DIR, WORKSPACE_ENVIRONMENTS_DIR, WORKSPACE_MANIFEST, WORKSPACE_PROJECTS_DIR, WORKSPACE_STATE_FILE, WORKSPACE_TREE_DIR, WORKSPACE_JOINING_DIR, GIT_ATTRIBUTES_FILE, GIT_ATTRIBUTES, workspaceDir, workspaceEnvironmentFile, workspaceManifestFile, workspaceProjectDir, workspaceTreeDir, assertPathSegment, } from './paths.js';
|
|
13
|
+
export { workspaceFiles } from './serialize.js';
|
|
14
|
+
export type { WorkspaceFiles } from './serialize.js';
|
|
15
|
+
export { loadWorkspace } from './load.js';
|
|
16
|
+
export type { LoadWorkspaceOptions, LoadWorkspaceResult, WorkspaceProblem } from './load.js';
|
|
17
|
+
export { saveWorkspace } from './save.js';
|
|
18
|
+
export type { SaveWorkspaceOptions } from './save.js';
|
|
19
|
+
export { migrateWorkspace } from './migrate.js';
|
|
20
|
+
export type { MigratedWorkspaceManifest } from './migrate.js';
|
|
21
|
+
export { WORKSPACE_LOCAL_FILE, EMPTY_LOCAL_STATE, loadLocalState, saveLocalState } from './local-state.js';
|
|
22
|
+
export type { WorkspaceLocalState, LocalStateOptions } from './local-state.js';
|
|
23
|
+
export { WORKSPACE_SHARE_FILE, DEFAULT_GIT_SHARE_SETTINGS, loadShare, saveShare, deleteShare } from './share.js';
|
|
24
|
+
export type { ShareKind, GitShareSettings, WorkspaceShare, ShareOptions } from './share.js';
|
|
25
|
+
export { reidentifyProject } from './reidentify.js';
|
|
26
|
+
export { resolveWorkspaceApiBaseUrl, linkedEnvironment, resolveWorkspaceEndpoint, resolveWorkspaceScopes, } from './environments.js';
|
|
27
|
+
export { commitMessage, describeTreePath } from './commit-message.js';
|
|
28
|
+
export type { TreeChange, TreeEntity, TreeEntityKind } from './commit-message.js';
|