@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,212 @@
|
|
|
1
|
+
import diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { sslInfoForSocket } from './tls.js';
|
|
3
|
+
/** Default timer, injectable for deterministic tests. */
|
|
4
|
+
const defaultNow = () => performance.now();
|
|
5
|
+
/**
|
|
6
|
+
* Number of `sendHttp` calls currently in flight, process-wide. `undici:client:*`
|
|
7
|
+
* connect-level diagnostics_channel events carry no per-exchange correlation id,
|
|
8
|
+
* so when more than one exchange is in flight we cannot tell which exchange a
|
|
9
|
+
* given connect event belongs to. Rather than risk mis-attributing connect/TLS
|
|
10
|
+
* timings to the wrong exchange, we only record them when exactly one exchange
|
|
11
|
+
* is in flight; concurrent exchanges leave `connectMs`/`tlsMs` undefined
|
|
12
|
+
* (a documented imprecision, not a bug).
|
|
13
|
+
*
|
|
14
|
+
* `tls` (the peer/protocol snapshot) is not subject to that restriction: it is
|
|
15
|
+
* correlated by origin instead — see `onSendHeaders`.
|
|
16
|
+
*/
|
|
17
|
+
let inFlightCount = 0;
|
|
18
|
+
/** Narrows a diagnostics-channel payload to the TLS socket it carries, if it carries one. */
|
|
19
|
+
function encryptedSocketOf(message) {
|
|
20
|
+
const socket = message?.socket;
|
|
21
|
+
return socket?.encrypted === true ? socket : undefined;
|
|
22
|
+
}
|
|
23
|
+
/** The `request` object a diagnostics-channel payload carries, when it carries one. */
|
|
24
|
+
function requestOf(message) {
|
|
25
|
+
return message?.request;
|
|
26
|
+
}
|
|
27
|
+
/** The `origin` string undici stamps on the request the event belongs to, when it has one. */
|
|
28
|
+
function requestOriginOf(message) {
|
|
29
|
+
const origin = message?.request?.origin;
|
|
30
|
+
if (typeof origin === 'string')
|
|
31
|
+
return origin;
|
|
32
|
+
// undici accepts a URL for `origin` too; both shapes normalise to the same string.
|
|
33
|
+
return origin instanceof URL ? origin.origin : undefined;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Tracks timings for one physical HTTP exchange. `connectMs`/`tlsMs` still rely on
|
|
37
|
+
* this module never issuing concurrent requests through the same dispatcher call (so
|
|
38
|
+
* "the next connect event" can only be this exchange's) — but `tls`, the peer/protocol
|
|
39
|
+
* snapshot, does not get that luxury: two exchanges can easily be concurrently in
|
|
40
|
+
* flight to the *same* origin on *different* sockets, and `undici:client:sendHeaders`
|
|
41
|
+
* carries no correlation id of its own beyond the undici `Request` object reference.
|
|
42
|
+
* `captureRequestFor` threads that reference through explicitly, so `onSendHeaders`
|
|
43
|
+
* can match on it exactly instead of guessing from origin.
|
|
44
|
+
*
|
|
45
|
+
* Sources:
|
|
46
|
+
* - `connectMs`/`tlsMs`: `undici:client:beforeConnect` / `undici:client:connected`.
|
|
47
|
+
* Only observed when a *new* socket is opened for this exchange; a reused
|
|
48
|
+
* keep-alive connection leaves both undefined.
|
|
49
|
+
* - `tls` (the {@link SslInfo} snapshot): `undici:client:sendHeaders`, which carries
|
|
50
|
+
* the request, and the socket its bytes were written to — so a request that reuses a
|
|
51
|
+
* warm keep-alive connection still gets the peer chain, which `undici:client:connected`
|
|
52
|
+
* alone (fresh connections only) cannot give. Correlated by request identity (see
|
|
53
|
+
* {@link captureRequestFor}); origin matching is a fallback for the case where no
|
|
54
|
+
* identity was captured, not the primary mechanism.
|
|
55
|
+
* - `ttfbMs`: `undici:request:headers` (response headers received).
|
|
56
|
+
* - `downloadMs`: measured after headers, ended by our own body-read loop
|
|
57
|
+
* (not a diagnostics channel — undici doesn't expose a clean "body fully
|
|
58
|
+
* read" timestamp before trailers, and we already know when we finish reading).
|
|
59
|
+
* - `dnsMs`: left undefined. Wiring a custom `connect.lookup` timer for this
|
|
60
|
+
* would require plumbing through every dispatcher construction path
|
|
61
|
+
* (including caller-supplied dispatchers for Task 35's NTLM `Client`), which
|
|
62
|
+
* is more invasive than this task's payoff justifies. Documented, not silently dropped.
|
|
63
|
+
*/
|
|
64
|
+
export class TimingTracker {
|
|
65
|
+
now;
|
|
66
|
+
startedAtMs;
|
|
67
|
+
startedAtIso;
|
|
68
|
+
connectStart;
|
|
69
|
+
connectEnd;
|
|
70
|
+
tlsEnd;
|
|
71
|
+
headersAt;
|
|
72
|
+
ssl;
|
|
73
|
+
/** The origin this exchange is currently talking to; a redirect moves it. */
|
|
74
|
+
origin;
|
|
75
|
+
/**
|
|
76
|
+
* The exact undici `Request` object this physical attempt is using, captured via
|
|
77
|
+
* {@link captureRequestFor}. Compared by identity (`===`) in `onSendHeaders` — see
|
|
78
|
+
* that handler for why this, rather than origin, is the correlation key.
|
|
79
|
+
*/
|
|
80
|
+
request;
|
|
81
|
+
onBeforeConnect;
|
|
82
|
+
onConnected;
|
|
83
|
+
onSendHeaders;
|
|
84
|
+
disposed = false;
|
|
85
|
+
constructor(now = defaultNow) {
|
|
86
|
+
this.now = now;
|
|
87
|
+
this.startedAtMs = now();
|
|
88
|
+
this.startedAtIso = new Date().toISOString();
|
|
89
|
+
inFlightCount += 1;
|
|
90
|
+
this.onBeforeConnect = () => {
|
|
91
|
+
if (inFlightCount !== 1)
|
|
92
|
+
return; // another exchange is concurrently in flight; can't attribute safely
|
|
93
|
+
if (this.connectStart === undefined)
|
|
94
|
+
this.connectStart = this.now();
|
|
95
|
+
};
|
|
96
|
+
this.onConnected = (message) => {
|
|
97
|
+
const socket = encryptedSocketOf(message);
|
|
98
|
+
// Warm the per-socket cache while the handshake is fresh, whatever else we
|
|
99
|
+
// can or cannot attribute: a *later* exchange reusing this very socket
|
|
100
|
+
// reads it back through `sendHeaders`.
|
|
101
|
+
if (socket !== undefined)
|
|
102
|
+
sslInfoForSocket(socket);
|
|
103
|
+
if (inFlightCount !== 1)
|
|
104
|
+
return; // another exchange is concurrently in flight; can't attribute safely
|
|
105
|
+
if (this.connectStart === undefined)
|
|
106
|
+
return; // beforeConnect for this exchange was never observed
|
|
107
|
+
this.connectEnd = this.now();
|
|
108
|
+
if (socket !== undefined) {
|
|
109
|
+
this.tlsEnd = this.connectEnd;
|
|
110
|
+
this.ssl = sslInfoForSocket(socket);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
this.onSendHeaders = (message) => {
|
|
114
|
+
const socket = encryptedSocketOf(message);
|
|
115
|
+
if (socket === undefined)
|
|
116
|
+
return;
|
|
117
|
+
if (this.request !== undefined) {
|
|
118
|
+
// Correlate by the exact undici `Request` object identity: `captureRequestFor`
|
|
119
|
+
// records it synchronously from `undici:request:create`, which undici fires
|
|
120
|
+
// inside the very call that starts this attempt, before any other exchange's
|
|
121
|
+
// code can run (Node is single-threaded and nothing awaits in between). That
|
|
122
|
+
// makes this exact — unlike origin matching, which conflates two concurrent
|
|
123
|
+
// exchanges to the *same* origin on *different* sockets (they usually share a
|
|
124
|
+
// certificate, but not always: see the concurrent-same-origin integration test).
|
|
125
|
+
if (requestOf(message) !== this.request)
|
|
126
|
+
return;
|
|
127
|
+
this.ssl = sslInfoForSocket(socket);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// Fall back to origin matching only when no request identity was ever captured
|
|
131
|
+
// for this exchange (defensive: `client.ts` always wraps its `undiciRequest()`
|
|
132
|
+
// call in `captureRequestFor`, so in practice this branch is not expected to run).
|
|
133
|
+
const origin = requestOriginOf(message);
|
|
134
|
+
const matches = this.origin !== undefined && origin !== undefined ? origin === this.origin : inFlightCount === 1;
|
|
135
|
+
if (!matches)
|
|
136
|
+
return;
|
|
137
|
+
this.ssl = sslInfoForSocket(socket);
|
|
138
|
+
};
|
|
139
|
+
diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(this.onBeforeConnect);
|
|
140
|
+
diagnosticsChannel.channel('undici:client:connected').subscribe(this.onConnected);
|
|
141
|
+
diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(this.onSendHeaders);
|
|
142
|
+
}
|
|
143
|
+
/** Records which origin the next physical request goes to, so TLS events can be attributed to it. */
|
|
144
|
+
setOrigin(origin) {
|
|
145
|
+
this.origin = origin;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Runs `fn` — a call that synchronously triggers undici's `undici:request:create`
|
|
149
|
+
* diagnostics event, as every plain `undiciRequest()` call does — while listening for
|
|
150
|
+
* that event, so `this.request` becomes the exact undici `Request` object this
|
|
151
|
+
* physical attempt is using. Call this wrapping the `undiciRequest()` call itself
|
|
152
|
+
* (not a `.then()`/`await` of it): the create event fires inside the synchronous
|
|
153
|
+
* portion of that call, before it returns a pending promise, which is what makes the
|
|
154
|
+
* capture race-free even when another exchange's own send is interleaved via
|
|
155
|
+
* `Promise.all` — no other code runs between this subscribe and unsubscribe.
|
|
156
|
+
*/
|
|
157
|
+
captureRequestFor(fn) {
|
|
158
|
+
const channel = diagnosticsChannel.channel('undici:request:create');
|
|
159
|
+
const onCreate = (message) => {
|
|
160
|
+
const request = requestOf(message);
|
|
161
|
+
if (request !== undefined)
|
|
162
|
+
this.request = request;
|
|
163
|
+
};
|
|
164
|
+
channel.subscribe(onCreate);
|
|
165
|
+
try {
|
|
166
|
+
return fn();
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
channel.unsubscribe(onCreate);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/** Call when the response headers arrive (time-to-first-byte). */
|
|
173
|
+
markHeaders() {
|
|
174
|
+
this.headersAt = this.now();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Stops listening to diagnostics channels and decrements the in-flight
|
|
178
|
+
* counter. Always call this, even on error paths — idempotent, so it is
|
|
179
|
+
* safe to call more than once (e.g. from a `finally` after an early throw).
|
|
180
|
+
*/
|
|
181
|
+
dispose() {
|
|
182
|
+
if (this.disposed)
|
|
183
|
+
return;
|
|
184
|
+
this.disposed = true;
|
|
185
|
+
diagnosticsChannel.channel('undici:client:beforeConnect').unsubscribe(this.onBeforeConnect);
|
|
186
|
+
diagnosticsChannel.channel('undici:client:connected').unsubscribe(this.onConnected);
|
|
187
|
+
diagnosticsChannel.channel('undici:client:sendHeaders').unsubscribe(this.onSendHeaders);
|
|
188
|
+
inFlightCount -= 1;
|
|
189
|
+
}
|
|
190
|
+
/** Finalizes the timing record. Call once the response body is fully read (or the exchange failed). */
|
|
191
|
+
finish() {
|
|
192
|
+
const end = this.now();
|
|
193
|
+
const connectMs = this.connectStart !== undefined && this.connectEnd !== undefined
|
|
194
|
+
? this.connectEnd - this.connectStart
|
|
195
|
+
: undefined;
|
|
196
|
+
const tlsMs = this.connectStart !== undefined && this.tlsEnd !== undefined ? this.tlsEnd - this.connectStart : undefined;
|
|
197
|
+
const ttfbMs = this.headersAt !== undefined ? this.headersAt - this.startedAtMs : undefined;
|
|
198
|
+
const downloadMs = this.headersAt !== undefined ? end - this.headersAt : undefined;
|
|
199
|
+
return {
|
|
200
|
+
startedAt: this.startedAtIso,
|
|
201
|
+
totalMs: end - this.startedAtMs,
|
|
202
|
+
...(connectMs !== undefined ? { connectMs } : {}),
|
|
203
|
+
...(tlsMs !== undefined ? { tlsMs } : {}),
|
|
204
|
+
...(ttfbMs !== undefined ? { ttfbMs } : {}),
|
|
205
|
+
...(downloadMs !== undefined ? { downloadMs } : {}),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/** The TLS peer/protocol snapshot for the connection this exchange used, if it was a TLS one. */
|
|
209
|
+
tlsInfo() {
|
|
210
|
+
return this.ssl;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS peer inspection: turns a live `tls.TLSSocket` into the serialisable
|
|
3
|
+
* {@link SslInfo} the SSL Info inspector renders. Kept apart from `timings.ts`
|
|
4
|
+
* so the certificate walk can be unit-tested against a plain object, with no
|
|
5
|
+
* sockets and no network.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Splits a PEM bundle into its individual certificates.
|
|
9
|
+
*
|
|
10
|
+
* Node's `ca` option accepts an array of PEM strings; handing it one blob that happens to hold
|
|
11
|
+
* several certificates works by accident of OpenSSL's parser rather than by contract, and
|
|
12
|
+
* silently ignores everything after the first block on some builds. Splitting here makes a
|
|
13
|
+
* multi-root corporate bundle behave the way the user expects, and makes "how many anchors did
|
|
14
|
+
* we actually load?" answerable.
|
|
15
|
+
*
|
|
16
|
+
* Anything outside a `BEGIN/END CERTIFICATE` block (comments, `Bag Attributes` preambles,
|
|
17
|
+
* stray whitespace) is dropped.
|
|
18
|
+
*
|
|
19
|
+
* @param bundle the file's text
|
|
20
|
+
* @returns one PEM string per certificate, in file order; empty when the text holds none
|
|
21
|
+
*/
|
|
22
|
+
export declare function splitPemBundle(bundle: string): string[];
|
|
23
|
+
/**
|
|
24
|
+
* The subset of Node's `tls.PeerCertificate` this module reads. Declared
|
|
25
|
+
* structurally (rather than importing `node:tls`) so tests can hand in a plain
|
|
26
|
+
* object and so a Node version that drops an optional field still type-checks.
|
|
27
|
+
*/
|
|
28
|
+
export interface PeerCertificateLike {
|
|
29
|
+
readonly subject?: Readonly<Record<string, string | readonly string[]>> | undefined;
|
|
30
|
+
readonly issuer?: Readonly<Record<string, string | readonly string[]>> | undefined;
|
|
31
|
+
/** OpenSSL's `DNS:a, IP Address:1.2.3.4` rendering of the subjectAltName extension. */
|
|
32
|
+
readonly subjectaltname?: string | undefined;
|
|
33
|
+
readonly valid_from?: string | undefined;
|
|
34
|
+
readonly valid_to?: string | undefined;
|
|
35
|
+
readonly serialNumber?: string | undefined;
|
|
36
|
+
readonly fingerprint256?: string | undefined;
|
|
37
|
+
readonly ca?: boolean | undefined;
|
|
38
|
+
readonly issuerCertificate?: PeerCertificateLike | undefined;
|
|
39
|
+
}
|
|
40
|
+
/** The subset of `tls.TLSSocket` this module reads; every accessor is optional but `getPeerCertificate`. */
|
|
41
|
+
export interface TlsSocketLike {
|
|
42
|
+
getPeerCertificate(detailed?: boolean): PeerCertificateLike | undefined | null;
|
|
43
|
+
/** The *local* certificate, i.e. the client identity this side presented (Node >= 11.4). */
|
|
44
|
+
getCertificate?: () => PeerCertificateLike | undefined | null;
|
|
45
|
+
getProtocol?: () => string | null | undefined;
|
|
46
|
+
getCipher?: () => {
|
|
47
|
+
readonly name?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
readonly authorized?: boolean | undefined;
|
|
50
|
+
readonly authorizationError?: Error | string | null | undefined;
|
|
51
|
+
/** `false` when the client sent no SNI. */
|
|
52
|
+
readonly servername?: string | false | null | undefined;
|
|
53
|
+
/** `false` when no protocol was negotiated. */
|
|
54
|
+
readonly alpnProtocol?: string | false | null | undefined;
|
|
55
|
+
}
|
|
56
|
+
/** One certificate of the peer's chain, flattened to strings so it can cross IPC unchanged. */
|
|
57
|
+
export interface PeerCert {
|
|
58
|
+
/** Distinguished name, rendered `CN=…, O=…` in the certificate's own attribute order. */
|
|
59
|
+
readonly subject: string;
|
|
60
|
+
readonly issuer: string;
|
|
61
|
+
/** ISO 8601, or the certificate's own `valid_from` text when it cannot be parsed. */
|
|
62
|
+
readonly validFrom: string;
|
|
63
|
+
readonly validTo: string;
|
|
64
|
+
readonly serialNumber?: string;
|
|
65
|
+
/** SAN entries with OpenSSL's `DNS:` / `IP Address:` type prefix stripped. */
|
|
66
|
+
readonly sans: readonly string[];
|
|
67
|
+
/** SHA-256 fingerprint as 64 lower-case hex characters (OpenSSL's colons removed). */
|
|
68
|
+
readonly fingerprint256: string;
|
|
69
|
+
readonly isCA?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** Everything known about the TLS connection one exchange travelled over. */
|
|
72
|
+
export interface SslInfo {
|
|
73
|
+
/** e.g. `TLSv1.3`. */
|
|
74
|
+
readonly protocol?: string;
|
|
75
|
+
/** Cipher suite name, e.g. `TLS_AES_256_GCM_SHA384`. */
|
|
76
|
+
readonly cipher?: string;
|
|
77
|
+
/** Whether the peer chain verified against the trust store in use. */
|
|
78
|
+
readonly authorized?: boolean;
|
|
79
|
+
/** OpenSSL's reason the chain did not verify, e.g. `SELF_SIGNED_CERT_IN_CHAIN`. */
|
|
80
|
+
readonly authorizationError?: string;
|
|
81
|
+
/** The SNI name sent on the handshake. */
|
|
82
|
+
readonly servername?: string;
|
|
83
|
+
/** Leaf first, then each issuer up to (and including) the root the peer presented. */
|
|
84
|
+
readonly peerChain: readonly PeerCert[];
|
|
85
|
+
/** Negotiated ALPN protocol, e.g. `http/1.1`. */
|
|
86
|
+
readonly alpn?: string;
|
|
87
|
+
/** The client identity this side presented, when a keystore supplied one. */
|
|
88
|
+
readonly clientCertificate?: {
|
|
89
|
+
readonly subject: string;
|
|
90
|
+
readonly issuer: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Snapshots everything the SSL Info inspector shows about one TLS connection:
|
|
95
|
+
* negotiated protocol/cipher/ALPN, whether the peer chain verified, and the
|
|
96
|
+
* chain itself walked from the leaf to the root the peer presented.
|
|
97
|
+
*
|
|
98
|
+
* Pure and synchronous — safe to call from a diagnostics-channel subscriber.
|
|
99
|
+
*
|
|
100
|
+
* @param socket a connected `tls.TLSSocket` (only the accessors in {@link TlsSocketLike} are used)
|
|
101
|
+
* @returns the serialisable snapshot; `peerChain` is empty when the socket has no peer certificate
|
|
102
|
+
*/
|
|
103
|
+
export declare function captureSslInfo(socket: TlsSocketLike): SslInfo;
|
|
104
|
+
/**
|
|
105
|
+
* {@link captureSslInfo}, memoised per socket. Use this on the hot path
|
|
106
|
+
* (every request that goes out on a connection), not just on a fresh connect.
|
|
107
|
+
*
|
|
108
|
+
* @param socket the socket the request was written to
|
|
109
|
+
* @returns the cached or freshly captured snapshot
|
|
110
|
+
*/
|
|
111
|
+
export declare function sslInfoForSocket(socket: TlsSocketLike): SslInfo;
|
package/dist/http/tls.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS peer inspection: turns a live `tls.TLSSocket` into the serialisable
|
|
3
|
+
* {@link SslInfo} the SSL Info inspector renders. Kept apart from `timings.ts`
|
|
4
|
+
* so the certificate walk can be unit-tested against a plain object, with no
|
|
5
|
+
* sockets and no network.
|
|
6
|
+
*/
|
|
7
|
+
/** Matches each `-----BEGIN CERTIFICATE-----`…`-----END CERTIFICATE-----` block of a PEM bundle. */
|
|
8
|
+
const PEM_BLOCK = /-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g;
|
|
9
|
+
/**
|
|
10
|
+
* Splits a PEM bundle into its individual certificates.
|
|
11
|
+
*
|
|
12
|
+
* Node's `ca` option accepts an array of PEM strings; handing it one blob that happens to hold
|
|
13
|
+
* several certificates works by accident of OpenSSL's parser rather than by contract, and
|
|
14
|
+
* silently ignores everything after the first block on some builds. Splitting here makes a
|
|
15
|
+
* multi-root corporate bundle behave the way the user expects, and makes "how many anchors did
|
|
16
|
+
* we actually load?" answerable.
|
|
17
|
+
*
|
|
18
|
+
* Anything outside a `BEGIN/END CERTIFICATE` block (comments, `Bag Attributes` preambles,
|
|
19
|
+
* stray whitespace) is dropped.
|
|
20
|
+
*
|
|
21
|
+
* @param bundle the file's text
|
|
22
|
+
* @returns one PEM string per certificate, in file order; empty when the text holds none
|
|
23
|
+
*/
|
|
24
|
+
export function splitPemBundle(bundle) {
|
|
25
|
+
return bundle.match(PEM_BLOCK) ?? [];
|
|
26
|
+
}
|
|
27
|
+
/** How far up the issuer chain we walk before giving up, as a defence against pathological chains. */
|
|
28
|
+
const MAX_CHAIN_DEPTH = 16;
|
|
29
|
+
/** Renders a Node DN object (`{ CN: 'x', OU: ['a','b'] }`) as `CN=x, OU=a, OU=b`. */
|
|
30
|
+
function renderDn(dn) {
|
|
31
|
+
if (dn === undefined)
|
|
32
|
+
return '';
|
|
33
|
+
const parts = [];
|
|
34
|
+
for (const [key, value] of Object.entries(dn)) {
|
|
35
|
+
if (Array.isArray(value)) {
|
|
36
|
+
for (const item of value)
|
|
37
|
+
parts.push(`${key}=${item}`);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
parts.push(`${key}=${String(value)}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return parts.join(', ');
|
|
44
|
+
}
|
|
45
|
+
/** `DNS:localhost, IP Address:127.0.0.1` → `['localhost', '127.0.0.1']`. */
|
|
46
|
+
function parseSans(subjectAltName) {
|
|
47
|
+
if (subjectAltName === undefined || subjectAltName.length === 0)
|
|
48
|
+
return [];
|
|
49
|
+
return subjectAltName
|
|
50
|
+
.split(',')
|
|
51
|
+
.map((entry) => entry.trim())
|
|
52
|
+
.filter((entry) => entry.length > 0)
|
|
53
|
+
.map((entry) => {
|
|
54
|
+
const colon = entry.indexOf(':');
|
|
55
|
+
return colon === -1 ? entry : entry.slice(colon + 1).trim();
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** ISO 8601 when the certificate's date text parses, the original text when it does not. */
|
|
59
|
+
function toIsoDate(text) {
|
|
60
|
+
if (text === undefined || text.length === 0)
|
|
61
|
+
return '';
|
|
62
|
+
const parsed = new Date(text);
|
|
63
|
+
return Number.isNaN(parsed.getTime()) ? text : parsed.toISOString();
|
|
64
|
+
}
|
|
65
|
+
/** OpenSSL prints `AB:CD:…`; the UI wants a copyable 64-character hex string. */
|
|
66
|
+
function normalizeFingerprint(fingerprint) {
|
|
67
|
+
return (fingerprint ?? '').replace(/:/g, '').toLowerCase();
|
|
68
|
+
}
|
|
69
|
+
/** True when Node returned the empty object it uses for "this socket has no peer certificate". */
|
|
70
|
+
function isEmptyCertificate(cert) {
|
|
71
|
+
return cert === undefined || cert === null || Object.keys(cert).length === 0;
|
|
72
|
+
}
|
|
73
|
+
function toPeerCert(cert) {
|
|
74
|
+
return {
|
|
75
|
+
subject: renderDn(cert.subject),
|
|
76
|
+
issuer: renderDn(cert.issuer),
|
|
77
|
+
validFrom: toIsoDate(cert.valid_from),
|
|
78
|
+
validTo: toIsoDate(cert.valid_to),
|
|
79
|
+
...(cert.serialNumber !== undefined ? { serialNumber: cert.serialNumber } : {}),
|
|
80
|
+
sans: parseSans(cert.subjectaltname),
|
|
81
|
+
fingerprint256: normalizeFingerprint(cert.fingerprint256),
|
|
82
|
+
...(cert.ca !== undefined ? { isCA: cert.ca } : {}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Walks `issuerCertificate` from the leaf upwards. Node makes a self-signed
|
|
87
|
+
* root point at itself, so identity is the natural stop; a `Set` guards against
|
|
88
|
+
* a cross-signed pair that would otherwise loop forever, and `MAX_CHAIN_DEPTH`
|
|
89
|
+
* against anything stranger than that.
|
|
90
|
+
*/
|
|
91
|
+
function walkChain(leaf) {
|
|
92
|
+
const chain = [];
|
|
93
|
+
const seen = new Set();
|
|
94
|
+
let current = leaf;
|
|
95
|
+
while (current !== undefined && !seen.has(current) && chain.length < MAX_CHAIN_DEPTH) {
|
|
96
|
+
seen.add(current);
|
|
97
|
+
chain.push(toPeerCert(current));
|
|
98
|
+
const issuer = current.issuerCertificate;
|
|
99
|
+
current = issuer === null ? undefined : issuer;
|
|
100
|
+
}
|
|
101
|
+
return chain;
|
|
102
|
+
}
|
|
103
|
+
/** The authorization failure as a plain string; Node hands back an `Error` on modern versions. */
|
|
104
|
+
function toAuthorizationError(error) {
|
|
105
|
+
if (error === null || error === undefined)
|
|
106
|
+
return undefined;
|
|
107
|
+
const message = typeof error === 'string' ? error : error.message;
|
|
108
|
+
return message.length > 0 ? message : undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Snapshots everything the SSL Info inspector shows about one TLS connection:
|
|
112
|
+
* negotiated protocol/cipher/ALPN, whether the peer chain verified, and the
|
|
113
|
+
* chain itself walked from the leaf to the root the peer presented.
|
|
114
|
+
*
|
|
115
|
+
* Pure and synchronous — safe to call from a diagnostics-channel subscriber.
|
|
116
|
+
*
|
|
117
|
+
* @param socket a connected `tls.TLSSocket` (only the accessors in {@link TlsSocketLike} are used)
|
|
118
|
+
* @returns the serialisable snapshot; `peerChain` is empty when the socket has no peer certificate
|
|
119
|
+
*/
|
|
120
|
+
export function captureSslInfo(socket) {
|
|
121
|
+
const leaf = socket.getPeerCertificate(true);
|
|
122
|
+
const protocol = socket.getProtocol?.() ?? undefined;
|
|
123
|
+
const cipher = socket.getCipher?.()?.name;
|
|
124
|
+
const servername = typeof socket.servername === 'string' ? socket.servername : undefined;
|
|
125
|
+
const alpn = typeof socket.alpnProtocol === 'string' ? socket.alpnProtocol : undefined;
|
|
126
|
+
const authorizationError = toAuthorizationError(socket.authorizationError);
|
|
127
|
+
const local = socket.getCertificate?.();
|
|
128
|
+
// The SSL inspector shows this so "did my keystore actually get used?" is answerable without
|
|
129
|
+
// reading the server's logs; only the DNs are kept, never any key material.
|
|
130
|
+
const clientCertificate = isEmptyCertificate(local)
|
|
131
|
+
? undefined
|
|
132
|
+
: {
|
|
133
|
+
subject: renderDn(local.subject),
|
|
134
|
+
issuer: renderDn(local.issuer),
|
|
135
|
+
};
|
|
136
|
+
return {
|
|
137
|
+
...(protocol !== null && protocol !== undefined ? { protocol } : {}),
|
|
138
|
+
...(cipher !== undefined ? { cipher } : {}),
|
|
139
|
+
...(socket.authorized !== undefined ? { authorized: socket.authorized } : {}),
|
|
140
|
+
...(authorizationError !== undefined ? { authorizationError } : {}),
|
|
141
|
+
...(servername !== undefined ? { servername } : {}),
|
|
142
|
+
peerChain: isEmptyCertificate(leaf) ? [] : walkChain(leaf),
|
|
143
|
+
...(alpn !== undefined ? { alpn } : {}),
|
|
144
|
+
...(clientCertificate !== undefined ? { clientCertificate } : {}),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Per-socket cache of {@link captureSslInfo}. A keep-alive connection carries
|
|
149
|
+
* many exchanges but only ever one handshake, so the chain walk runs once per
|
|
150
|
+
* socket; the `WeakMap` keeps nothing alive after the socket is collected.
|
|
151
|
+
*/
|
|
152
|
+
const bySocket = new WeakMap();
|
|
153
|
+
/**
|
|
154
|
+
* {@link captureSslInfo}, memoised per socket. Use this on the hot path
|
|
155
|
+
* (every request that goes out on a connection), not just on a fresh connect.
|
|
156
|
+
*
|
|
157
|
+
* @param socket the socket the request was written to
|
|
158
|
+
* @returns the cached or freshly captured snapshot
|
|
159
|
+
*/
|
|
160
|
+
export function sslInfoForSocket(socket) {
|
|
161
|
+
const cached = bySocket.get(socket);
|
|
162
|
+
if (cached !== undefined)
|
|
163
|
+
return cached;
|
|
164
|
+
const info = captureSslInfo(socket);
|
|
165
|
+
bySocket.set(socket, info);
|
|
166
|
+
return info;
|
|
167
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire-level types for the HTTP transport (Task 10). These are transport
|
|
3
|
+
* concerns only: no auth, no MIME/SOAP semantics. Auth (Task 49) and WS-Security
|
|
4
|
+
* layer on top by producing headers/body before `sendHttp` is called.
|
|
5
|
+
*/
|
|
6
|
+
import type { SslInfo } from './tls.js';
|
|
7
|
+
/** An HTTP request as fully resolved bytes/headers, ready to send. */
|
|
8
|
+
export interface HttpRequest {
|
|
9
|
+
readonly url: string;
|
|
10
|
+
readonly method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'PATCH';
|
|
11
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
12
|
+
readonly body?: Uint8Array;
|
|
13
|
+
readonly timeoutMs: number;
|
|
14
|
+
readonly followRedirects: boolean;
|
|
15
|
+
/** Maximum number of redirects to follow. Default 5. */
|
|
16
|
+
readonly maxRedirects?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Keep the method and body across a 301 or 302 that would otherwise become a bodyless `GET`.
|
|
19
|
+
*
|
|
20
|
+
* Browsers downgrade those two, which is why the default does too (RFC 9110 §15.4.3 notes the
|
|
21
|
+
* practice), but a REST client talking to an API that answers a `POST` with a 302 to the created
|
|
22
|
+
* resource needs the choice. 303 always becomes a `GET`: that is what the status means.
|
|
23
|
+
*/
|
|
24
|
+
readonly preserveMethodOnRedirect?: boolean;
|
|
25
|
+
/** Maximum response body size to buffer, in bytes. Undefined = unlimited. */
|
|
26
|
+
readonly maxSizeBytes?: number;
|
|
27
|
+
readonly signal?: AbortSignal;
|
|
28
|
+
/**
|
|
29
|
+
* Local interface address to bind the outgoing socket to. Passed straight to the connector;
|
|
30
|
+
* an address the host does not own makes the connection fail, which is the intended feedback.
|
|
31
|
+
*/
|
|
32
|
+
readonly localAddress?: string;
|
|
33
|
+
readonly tls?: TlsOptions;
|
|
34
|
+
readonly proxy?: ProxyOptions;
|
|
35
|
+
/** Whether to transparently decompress a gzip/deflate/br response body. Default true. */
|
|
36
|
+
readonly decompress?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Offer HTTP/2 in the TLS ALPN handshake. Off by default: HTTP/2 changes how headers reach
|
|
39
|
+
* the wire (and so what the raw view can faithfully reconstruct), so it is opt-in. Plain
|
|
40
|
+
* HTTP is always HTTP/1.1 — there is no ALPN to negotiate over.
|
|
41
|
+
*/
|
|
42
|
+
readonly allowH2?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* TLS options, passed through to undici's connector. The Task 49 UI will
|
|
46
|
+
* populate these; this task only wires the pass-through.
|
|
47
|
+
*/
|
|
48
|
+
export interface TlsOptions {
|
|
49
|
+
readonly rejectUnauthorized?: boolean;
|
|
50
|
+
readonly ca?: readonly string[];
|
|
51
|
+
readonly cert?: string;
|
|
52
|
+
readonly key?: string;
|
|
53
|
+
readonly passphrase?: string;
|
|
54
|
+
readonly minVersion?: 'TLSv1.2' | 'TLSv1.3';
|
|
55
|
+
readonly servername?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Proxy options, passed through to undici's `ProxyAgent`. The Task 49 UI
|
|
59
|
+
* will populate these; this task only wires the pass-through.
|
|
60
|
+
*/
|
|
61
|
+
export interface ProxyOptions {
|
|
62
|
+
readonly url: string;
|
|
63
|
+
readonly auth?: {
|
|
64
|
+
readonly username: string;
|
|
65
|
+
readonly password: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** Timing breakdown for one HTTP exchange. Every field but `totalMs` is best-effort. */
|
|
69
|
+
export interface Timings {
|
|
70
|
+
readonly startedAt: string;
|
|
71
|
+
readonly totalMs: number;
|
|
72
|
+
readonly dnsMs?: number;
|
|
73
|
+
readonly connectMs?: number;
|
|
74
|
+
readonly tlsMs?: number;
|
|
75
|
+
readonly ttfbMs?: number;
|
|
76
|
+
readonly downloadMs?: number;
|
|
77
|
+
}
|
|
78
|
+
/** The full record of one HTTP request/response exchange, including raw wire bytes. */
|
|
79
|
+
export interface HttpExchange {
|
|
80
|
+
readonly request: {
|
|
81
|
+
readonly url: string;
|
|
82
|
+
readonly method: string;
|
|
83
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
84
|
+
};
|
|
85
|
+
readonly status: number;
|
|
86
|
+
readonly statusText: string;
|
|
87
|
+
/** Lower-cased header names; multi-values joined with ', ' except `set-cookie`, which keeps only the first. */
|
|
88
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
89
|
+
readonly rawHeaders: readonly (readonly [string, string])[];
|
|
90
|
+
/** Decoded response body (decompressed when `decompress` was requested). */
|
|
91
|
+
readonly body: Uint8Array;
|
|
92
|
+
/** Response body exactly as received on the wire, possibly still compressed. */
|
|
93
|
+
readonly rawBody: Uint8Array;
|
|
94
|
+
/**
|
|
95
|
+
* The protocol the exchange actually travelled over, from the negotiated ALPN: `2` only when
|
|
96
|
+
* the caller offered HTTP/2 and the server took it. Labels the raw view.
|
|
97
|
+
*/
|
|
98
|
+
readonly httpVersion: '1.1' | '2';
|
|
99
|
+
/** True when the body was cut short because it exceeded `maxSizeBytes`. */
|
|
100
|
+
readonly truncated: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Set when the response body failed to decompress (e.g. malformed gzip).
|
|
103
|
+
* When present, `body` equals `rawBody` (decompression was not applied)
|
|
104
|
+
* rather than throwing.
|
|
105
|
+
*/
|
|
106
|
+
readonly decodeError?: string;
|
|
107
|
+
readonly timings: Timings;
|
|
108
|
+
/** Reconstructed request line + headers + body, as it was (or would be) sent on the wire. */
|
|
109
|
+
readonly rawRequest: Uint8Array;
|
|
110
|
+
/** Reconstructed status line + headers + body, as received on the wire. */
|
|
111
|
+
readonly rawResponse: Uint8Array;
|
|
112
|
+
readonly redirects: readonly {
|
|
113
|
+
readonly url: string;
|
|
114
|
+
readonly status: number;
|
|
115
|
+
}[];
|
|
116
|
+
/**
|
|
117
|
+
* The TLS connection this exchange travelled over: protocol, cipher, whether the
|
|
118
|
+
* peer chain verified, and the chain itself. Absent for plain HTTP.
|
|
119
|
+
*/
|
|
120
|
+
readonly tls?: SslInfo;
|
|
121
|
+
}
|
|
122
|
+
/** Stable, machine-readable classification for {@link HttpError}. */
|
|
123
|
+
export type HttpErrorCode = 'timeout' | 'aborted' | 'connection-refused' | 'dns' | 'tls'
|
|
124
|
+
/** The peer chain did not verify against the trust store in use; `details.peerSubject` names the leaf. */
|
|
125
|
+
| 'tls-untrusted' | 'too-large' | 'too-many-redirects' | 'invalid-url' | 'proxy' | 'network';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format detection for API definition imports: WSDL, OpenAPI / Swagger, Postman Collections,
|
|
3
|
+
* Protocol Buffers (`.proto`) and legacy single-XML SOAP projects.
|
|
4
|
+
*
|
|
5
|
+
* Inspects document text, file names, or URLs to classify definition formats before or during import.
|
|
6
|
+
*/
|
|
7
|
+
export type ImportFormatKind = 'openapi' | 'postman' | 'wsdl' | 'proto' | 'legacy-soap-project' | 'unknown';
|
|
8
|
+
export interface DetectedImportFormat {
|
|
9
|
+
readonly kind: ImportFormatKind;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly confidence: 'definite' | 'probable' | 'unknown';
|
|
12
|
+
}
|
|
13
|
+
export interface ImportDetectInput {
|
|
14
|
+
readonly text?: string | undefined;
|
|
15
|
+
readonly filename?: string | undefined;
|
|
16
|
+
readonly url?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `text` with the whitespace and `//` / `/* *\/` comments a `.proto` may open with removed, by a
|
|
20
|
+
* linear scan: a regex with a repeated comment group backtracks badly on crafted input.
|
|
21
|
+
*/
|
|
22
|
+
export declare function stripLeadingProtoComments(text: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Detects the API definition format from text content, filename, or URL.
|
|
25
|
+
*/
|
|
26
|
+
export declare function detectImportFormat(input: ImportDetectInput): DetectedImportFormat;
|