@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,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Building a {@link ProtoSet} out of the encoded `FileDescriptorProto`s a server's reflection
|
|
3
|
+
* response carries, so a discovered schema and an imported one are the same thing downstream.
|
|
4
|
+
*
|
|
5
|
+
* An import parses `.proto` text; reflection receives the compiler's own output instead, one
|
|
6
|
+
* `FileDescriptorProto` per file. protobufjs reads that form through `Root.fromDescriptor`, which
|
|
7
|
+
* its `ext/descriptor` extension installs onto `Root` as a side effect — hence the bare import
|
|
8
|
+
* below, which also brings the type declaration for the method with it. The set it produces is
|
|
9
|
+
* indistinguishable to `describeServices`, the codec and `apiFromProtoSet` from a parsed one, so
|
|
10
|
+
* everything the import pipeline does after loading is reused unchanged.
|
|
11
|
+
*/
|
|
12
|
+
import 'protobufjs/ext/descriptor.js';
|
|
13
|
+
import type { ProtoSet } from '../proto/load.js';
|
|
14
|
+
/** A file's own name and the files it imports, read from its descriptor without a full decode. */
|
|
15
|
+
export interface DescriptorHeader {
|
|
16
|
+
/** The file's name as the compiler recorded it, which is also what an `import` in another file spells. */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
/** The names this file imports, in declaration order. */
|
|
19
|
+
readonly dependencies: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reads a descriptor's `name` and `dependency` list.
|
|
23
|
+
*
|
|
24
|
+
* @throws ProtoError `grpc-reflection-descriptor` when the bytes are not a readable descriptor
|
|
25
|
+
*/
|
|
26
|
+
export declare function descriptorHeader(bytes: Uint8Array): DescriptorHeader;
|
|
27
|
+
/**
|
|
28
|
+
* Wraps encoded `FileDescriptorProto`s in a `FileDescriptorSet`.
|
|
29
|
+
*
|
|
30
|
+
* `FileDescriptorSet` is one repeated message field, number 1, so the encoding is a length-delimited
|
|
31
|
+
* record per file and nothing has to be re-serialised: the server's bytes go through untouched, which
|
|
32
|
+
* is the same byte-exactness the `.proto` cache keeps.
|
|
33
|
+
*/
|
|
34
|
+
export declare function encodeFileDescriptorSet(files: readonly Uint8Array[]): Uint8Array;
|
|
35
|
+
/** Reads the file names of a whole `FileDescriptorSet`, in the order it stores them. */
|
|
36
|
+
export declare function descriptorSetHeaders(bytes: Uint8Array): DescriptorHeader[];
|
|
37
|
+
/**
|
|
38
|
+
* Orders files so every file comes after the ones it imports. protobufjs resolves references as it
|
|
39
|
+
* adds each file, and a file naming a type from one added later would not find it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function orderDescriptors(files: ReadonlyMap<string, Uint8Array>): string[];
|
|
42
|
+
/** The collected descriptors as one `FileDescriptorSet`, dependencies first. */
|
|
43
|
+
export declare function descriptorSetBytes(files: ReadonlyMap<string, Uint8Array>): Uint8Array;
|
|
44
|
+
/** Options for {@link protoSetFromDescriptorSet}. */
|
|
45
|
+
export interface ProtoSetFromDescriptorSetOptions {
|
|
46
|
+
/** The files to record as the set's roots. Defaults to every file in it. */
|
|
47
|
+
readonly roots?: readonly string[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolves an encoded `FileDescriptorSet` into a loaded schema — the form the describe, sample and
|
|
51
|
+
* codec modules read, and the form a cached reflection definition is stored in.
|
|
52
|
+
*
|
|
53
|
+
* @throws ProtoError `grpc-reflection-empty` when the set has no files, `proto-unresolved` when a
|
|
54
|
+
* type reference in it resolves to nothing, which is what a set missing a dependency looks like
|
|
55
|
+
*/
|
|
56
|
+
export declare function protoSetFromDescriptorSet(bytes: Uint8Array, options?: ProtoSetFromDescriptorSetOptions): ProtoSet;
|
|
57
|
+
/** Input to {@link protoSetFromDescriptors}. */
|
|
58
|
+
export interface ProtoSetFromDescriptorsInput {
|
|
59
|
+
/** Every descriptor collected, keyed by the file name its own header carries. */
|
|
60
|
+
readonly files: ReadonlyMap<string, Uint8Array>;
|
|
61
|
+
/** The files the discovery started from — the ones declaring the services. Defaults to every file. */
|
|
62
|
+
readonly roots?: readonly string[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolves a set of descriptors into a loaded schema.
|
|
66
|
+
*
|
|
67
|
+
* @throws as {@link protoSetFromDescriptorSet}
|
|
68
|
+
*/
|
|
69
|
+
export declare function protoSetFromDescriptors(input: ProtoSetFromDescriptorsInput): ProtoSet;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Building a {@link ProtoSet} out of the encoded `FileDescriptorProto`s a server's reflection
|
|
3
|
+
* response carries, so a discovered schema and an imported one are the same thing downstream.
|
|
4
|
+
*
|
|
5
|
+
* An import parses `.proto` text; reflection receives the compiler's own output instead, one
|
|
6
|
+
* `FileDescriptorProto` per file. protobufjs reads that form through `Root.fromDescriptor`, which
|
|
7
|
+
* its `ext/descriptor` extension installs onto `Root` as a side effect — hence the bare import
|
|
8
|
+
* below, which also brings the type declaration for the method with it. The set it produces is
|
|
9
|
+
* indistinguishable to `describeServices`, the codec and `apiFromProtoSet` from a parsed one, so
|
|
10
|
+
* everything the import pipeline does after loading is reused unchanged.
|
|
11
|
+
*/
|
|
12
|
+
import protobuf from 'protobufjs';
|
|
13
|
+
import 'protobufjs/ext/descriptor.js';
|
|
14
|
+
import { ProtoError } from '../../errors.js';
|
|
15
|
+
import { decodeMessage } from '../codec.js';
|
|
16
|
+
import { DESCRIPTOR_HEADER_TYPE, DESCRIPTOR_SET_HEADER_TYPE, descriptorHeaderProtoSet } from './proto.js';
|
|
17
|
+
/**
|
|
18
|
+
* Reads a descriptor's `name` and `dependency` list.
|
|
19
|
+
*
|
|
20
|
+
* @throws ProtoError `grpc-reflection-descriptor` when the bytes are not a readable descriptor
|
|
21
|
+
*/
|
|
22
|
+
export function descriptorHeader(bytes) {
|
|
23
|
+
let decoded;
|
|
24
|
+
try {
|
|
25
|
+
decoded = decodeMessage(descriptorHeaderProtoSet(), DESCRIPTOR_HEADER_TYPE, bytes);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new ProtoError('grpc-reflection-descriptor', 'The server sent a file descriptor this client could not read', {
|
|
29
|
+
cause: error,
|
|
30
|
+
details: { bytes: bytes.byteLength },
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const record = (decoded ?? {});
|
|
34
|
+
const name = typeof record.name === 'string' ? record.name : '';
|
|
35
|
+
const dependencies = Array.isArray(record.dependency)
|
|
36
|
+
? record.dependency.filter((entry) => typeof entry === 'string')
|
|
37
|
+
: [];
|
|
38
|
+
return { name, dependencies };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Wraps encoded `FileDescriptorProto`s in a `FileDescriptorSet`.
|
|
42
|
+
*
|
|
43
|
+
* `FileDescriptorSet` is one repeated message field, number 1, so the encoding is a length-delimited
|
|
44
|
+
* record per file and nothing has to be re-serialised: the server's bytes go through untouched, which
|
|
45
|
+
* is the same byte-exactness the `.proto` cache keeps.
|
|
46
|
+
*/
|
|
47
|
+
export function encodeFileDescriptorSet(files) {
|
|
48
|
+
const writer = new protobuf.Writer();
|
|
49
|
+
for (const file of files) {
|
|
50
|
+
writer.uint32(0x0a).bytes(file);
|
|
51
|
+
}
|
|
52
|
+
return writer.finish();
|
|
53
|
+
}
|
|
54
|
+
/** Reads the file names of a whole `FileDescriptorSet`, in the order it stores them. */
|
|
55
|
+
export function descriptorSetHeaders(bytes) {
|
|
56
|
+
let decoded;
|
|
57
|
+
try {
|
|
58
|
+
decoded = decodeMessage(descriptorHeaderProtoSet(), DESCRIPTOR_SET_HEADER_TYPE, bytes);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new ProtoError('grpc-reflection-descriptor', 'The descriptor set could not be read', {
|
|
62
|
+
cause: error,
|
|
63
|
+
details: { bytes: bytes.byteLength },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const files = decoded.file;
|
|
67
|
+
return (Array.isArray(files) ? files : []).map((file) => {
|
|
68
|
+
const record = (file ?? {});
|
|
69
|
+
return {
|
|
70
|
+
name: typeof record.name === 'string' ? record.name : '',
|
|
71
|
+
dependencies: Array.isArray(record.dependency)
|
|
72
|
+
? record.dependency.filter((entry) => typeof entry === 'string')
|
|
73
|
+
: [],
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Orders files so every file comes after the ones it imports. protobufjs resolves references as it
|
|
79
|
+
* adds each file, and a file naming a type from one added later would not find it.
|
|
80
|
+
*/
|
|
81
|
+
export function orderDescriptors(files) {
|
|
82
|
+
const ordered = [];
|
|
83
|
+
const seen = new Set();
|
|
84
|
+
const add = (name) => {
|
|
85
|
+
if (seen.has(name)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
seen.add(name);
|
|
89
|
+
const bytes = files.get(name);
|
|
90
|
+
if (bytes === undefined) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
for (const dependency of descriptorHeader(bytes).dependencies) {
|
|
94
|
+
add(dependency);
|
|
95
|
+
}
|
|
96
|
+
ordered.push(name);
|
|
97
|
+
};
|
|
98
|
+
for (const name of files.keys()) {
|
|
99
|
+
add(name);
|
|
100
|
+
}
|
|
101
|
+
return ordered;
|
|
102
|
+
}
|
|
103
|
+
/** The collected descriptors as one `FileDescriptorSet`, dependencies first. */
|
|
104
|
+
export function descriptorSetBytes(files) {
|
|
105
|
+
return encodeFileDescriptorSet(orderDescriptors(files).map((name) => files.get(name)));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Resolves an encoded `FileDescriptorSet` into a loaded schema — the form the describe, sample and
|
|
109
|
+
* codec modules read, and the form a cached reflection definition is stored in.
|
|
110
|
+
*
|
|
111
|
+
* @throws ProtoError `grpc-reflection-empty` when the set has no files, `proto-unresolved` when a
|
|
112
|
+
* type reference in it resolves to nothing, which is what a set missing a dependency looks like
|
|
113
|
+
*/
|
|
114
|
+
export function protoSetFromDescriptorSet(bytes, options = {}) {
|
|
115
|
+
const files = descriptorSetHeaders(bytes).map((header) => header.name);
|
|
116
|
+
if (files.length === 0) {
|
|
117
|
+
throw new ProtoError('grpc-reflection-empty', 'The descriptor set describes no files');
|
|
118
|
+
}
|
|
119
|
+
let root;
|
|
120
|
+
try {
|
|
121
|
+
root = protobuf.Root.fromDescriptor(bytes, { keepCase: true });
|
|
122
|
+
root.resolveAll();
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
126
|
+
throw new ProtoError('proto-unresolved', message, { cause: error });
|
|
127
|
+
}
|
|
128
|
+
return { root, files, roots: [...(options.roots ?? files)] };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Resolves a set of descriptors into a loaded schema.
|
|
132
|
+
*
|
|
133
|
+
* @throws as {@link protoSetFromDescriptorSet}
|
|
134
|
+
*/
|
|
135
|
+
export function protoSetFromDescriptors(input) {
|
|
136
|
+
if (input.files.size === 0) {
|
|
137
|
+
throw new ProtoError('grpc-reflection-empty', 'The server described no files');
|
|
138
|
+
}
|
|
139
|
+
return protoSetFromDescriptorSet(descriptorSetBytes(input.files), input.roots !== undefined ? { roots: input.roots } : {});
|
|
140
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server reflection service, as a `.proto` the engine carries with it.
|
|
3
|
+
*
|
|
4
|
+
* A server that speaks reflection describes itself over a service the client must already know, so
|
|
5
|
+
* this one definition cannot come from the user. It is a string constant rather than a shipped
|
|
6
|
+
* `.proto` file because the engine builds with `tsc -b` alone and has no step that would copy an
|
|
7
|
+
* asset into `dist/`; it is loaded through the same {@link loadProtoSet} every imported file goes
|
|
8
|
+
* through, so the codec meets it exactly as it meets a user's own schema.
|
|
9
|
+
*
|
|
10
|
+
* Two packages exist for the same service. `grpc.reflection.v1alpha` is what servers shipped for
|
|
11
|
+
* years; `grpc.reflection.v1` is the stable name, and the message shapes are identical — which is
|
|
12
|
+
* why one template with the package substituted covers both rather than two copies that could drift.
|
|
13
|
+
*/
|
|
14
|
+
import type { ProtoSet } from '../proto/load.js';
|
|
15
|
+
export type { GrpcReflectionVersion } from '../model.js';
|
|
16
|
+
/** The two versions a server may answer on, newest first — the order `auto` tries them in. */
|
|
17
|
+
export declare const REFLECTION_VERSIONS: readonly ['v1', 'v1alpha'];
|
|
18
|
+
/** The `package` a version's service lives in. */
|
|
19
|
+
export declare function reflectionPackage(version: 'v1' | 'v1alpha'): string;
|
|
20
|
+
/** The fully qualified service name for a version. */
|
|
21
|
+
export declare function reflectionServiceName(version: 'v1' | 'v1alpha'): string;
|
|
22
|
+
/** The single method, a bidirectional stream whose exchange is request/response per message. */
|
|
23
|
+
export declare const REFLECTION_METHOD = "ServerReflectionInfo";
|
|
24
|
+
/** The reflection definition's source text for one version. */
|
|
25
|
+
export declare function reflectionProtoSource(version: 'v1' | 'v1alpha'): string;
|
|
26
|
+
/** The loaded reflection schema for one version, parsed once per process. */
|
|
27
|
+
export declare function reflectionProtoSet(version: 'v1' | 'v1alpha'): ProtoSet;
|
|
28
|
+
/** The message type {@link descriptorHeaderProtoSet} declares for one file. */
|
|
29
|
+
export declare const DESCRIPTOR_HEADER_TYPE = "wirebench.reflection.FileDescriptorHeader";
|
|
30
|
+
/** The message type {@link descriptorHeaderProtoSet} declares for a whole set. */
|
|
31
|
+
export declare const DESCRIPTOR_SET_HEADER_TYPE = "wirebench.reflection.FileDescriptorSetHeader";
|
|
32
|
+
/** The partial `FileDescriptorProto` schema, parsed once per process. */
|
|
33
|
+
export declare function descriptorHeaderProtoSet(): ProtoSet;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server reflection service, as a `.proto` the engine carries with it.
|
|
3
|
+
*
|
|
4
|
+
* A server that speaks reflection describes itself over a service the client must already know, so
|
|
5
|
+
* this one definition cannot come from the user. It is a string constant rather than a shipped
|
|
6
|
+
* `.proto` file because the engine builds with `tsc -b` alone and has no step that would copy an
|
|
7
|
+
* asset into `dist/`; it is loaded through the same {@link loadProtoSet} every imported file goes
|
|
8
|
+
* through, so the codec meets it exactly as it meets a user's own schema.
|
|
9
|
+
*
|
|
10
|
+
* Two packages exist for the same service. `grpc.reflection.v1alpha` is what servers shipped for
|
|
11
|
+
* years; `grpc.reflection.v1` is the stable name, and the message shapes are identical — which is
|
|
12
|
+
* why one template with the package substituted covers both rather than two copies that could drift.
|
|
13
|
+
*/
|
|
14
|
+
import { loadProtoSet } from '../proto/load.js';
|
|
15
|
+
/** The two versions a server may answer on, newest first — the order `auto` tries them in. */
|
|
16
|
+
export const REFLECTION_VERSIONS = ['v1', 'v1alpha'];
|
|
17
|
+
/** The `package` a version's service lives in. */
|
|
18
|
+
export function reflectionPackage(version) {
|
|
19
|
+
return `grpc.reflection.${version}`;
|
|
20
|
+
}
|
|
21
|
+
/** The fully qualified service name for a version. */
|
|
22
|
+
export function reflectionServiceName(version) {
|
|
23
|
+
return `${reflectionPackage(version)}.ServerReflection`;
|
|
24
|
+
}
|
|
25
|
+
/** The single method, a bidirectional stream whose exchange is request/response per message. */
|
|
26
|
+
export const REFLECTION_METHOD = 'ServerReflectionInfo';
|
|
27
|
+
/** The import path the reflection definition is loaded under. */
|
|
28
|
+
const REFLECTION_FILE = 'grpc/reflection/reflection.proto';
|
|
29
|
+
/**
|
|
30
|
+
* `reflection.proto` with `__PACKAGE__` where the package name goes. Transcribed from the gRPC
|
|
31
|
+
* specification's own definition; the field numbers are part of the wire contract, so the gaps
|
|
32
|
+
* (`ServerReflectionRequest` has no field 2, `ServerReflectionResponse` no field 3) are deliberate.
|
|
33
|
+
*/
|
|
34
|
+
const REFLECTION_TEMPLATE = `syntax = "proto3";
|
|
35
|
+
|
|
36
|
+
package __PACKAGE__;
|
|
37
|
+
|
|
38
|
+
service ServerReflection {
|
|
39
|
+
rpc ServerReflectionInfo(stream ServerReflectionRequest) returns (stream ServerReflectionResponse);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message ServerReflectionRequest {
|
|
43
|
+
string host = 1;
|
|
44
|
+
oneof message_request {
|
|
45
|
+
string file_by_filename = 3;
|
|
46
|
+
string file_containing_symbol = 4;
|
|
47
|
+
ExtensionRequest file_containing_extension = 5;
|
|
48
|
+
string all_extension_numbers_of_type = 6;
|
|
49
|
+
string list_services = 7;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message ExtensionRequest {
|
|
54
|
+
string containing_type = 1;
|
|
55
|
+
int32 extension_number = 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message ServerReflectionResponse {
|
|
59
|
+
string valid_host = 1;
|
|
60
|
+
ServerReflectionRequest original_request = 2;
|
|
61
|
+
oneof message_response {
|
|
62
|
+
FileDescriptorResponse file_descriptor_response = 4;
|
|
63
|
+
ExtensionNumberResponse all_extension_numbers_response = 5;
|
|
64
|
+
ListServiceResponse list_services_response = 6;
|
|
65
|
+
ErrorResponse error_response = 7;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message FileDescriptorResponse {
|
|
70
|
+
repeated bytes file_descriptor_proto = 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message ExtensionNumberResponse {
|
|
74
|
+
string base_type_name = 1;
|
|
75
|
+
repeated int32 extension_number = 2;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message ListServiceResponse {
|
|
79
|
+
repeated ServiceResponse service = 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message ServiceResponse {
|
|
83
|
+
string name = 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message ErrorResponse {
|
|
87
|
+
int32 error_code = 1;
|
|
88
|
+
string error_message = 2;
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
/** The reflection definition's source text for one version. */
|
|
92
|
+
export function reflectionProtoSource(version) {
|
|
93
|
+
return REFLECTION_TEMPLATE.replaceAll('__PACKAGE__', reflectionPackage(version));
|
|
94
|
+
}
|
|
95
|
+
const cached = new Map();
|
|
96
|
+
/** The loaded reflection schema for one version, parsed once per process. */
|
|
97
|
+
export function reflectionProtoSet(version) {
|
|
98
|
+
const existing = cached.get(version);
|
|
99
|
+
if (existing !== undefined) {
|
|
100
|
+
return existing;
|
|
101
|
+
}
|
|
102
|
+
const set = loadProtoSet(new Map([[REFLECTION_FILE, reflectionProtoSource(version)]]), { roots: [REFLECTION_FILE] });
|
|
103
|
+
cached.set(version, set);
|
|
104
|
+
return set;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The import path a descriptor file the engine loaded from a reflection response is called by, and
|
|
108
|
+
* the partial `FileDescriptorProto` the client reads its name and dependencies from.
|
|
109
|
+
*
|
|
110
|
+
* A reflection response carries each file as encoded `FileDescriptorProto` bytes, and the client has
|
|
111
|
+
* to know a file's own name (to key it, and to satisfy a later `file_by_filename`) and what it
|
|
112
|
+
* imports (to notice a dependency the server did not volunteer) *before* it can build a schema out
|
|
113
|
+
* of the set. Protobuf's unknown-field rule makes that cheap: decoding a full `FileDescriptorProto`
|
|
114
|
+
* against a message declaring only fields 1 and 3 yields exactly those two and skips everything
|
|
115
|
+
* else, so the engine needs no copy of `descriptor.proto` to read a file's header.
|
|
116
|
+
*/
|
|
117
|
+
const HEADER_FILE = 'grpc/reflection/descriptor-header.proto';
|
|
118
|
+
/** The message type {@link descriptorHeaderProtoSet} declares for one file. */
|
|
119
|
+
export const DESCRIPTOR_HEADER_TYPE = 'wirebench.reflection.FileDescriptorHeader';
|
|
120
|
+
/** The message type {@link descriptorHeaderProtoSet} declares for a whole set. */
|
|
121
|
+
export const DESCRIPTOR_SET_HEADER_TYPE = 'wirebench.reflection.FileDescriptorSetHeader';
|
|
122
|
+
const HEADER_SOURCE = `syntax = "proto3";
|
|
123
|
+
|
|
124
|
+
package wirebench.reflection;
|
|
125
|
+
|
|
126
|
+
// The first fields of google.protobuf.FileDescriptorProto. Every other field decodes as unknown and
|
|
127
|
+
// is skipped, which is all this client needs to key a file and follow its imports.
|
|
128
|
+
message FileDescriptorHeader {
|
|
129
|
+
string name = 1;
|
|
130
|
+
repeated string dependency = 3;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// google.protobuf.FileDescriptorSet, read one header deep: enough to list a cached set's files in
|
|
134
|
+
// the order they were written without decoding every declaration in them.
|
|
135
|
+
message FileDescriptorSetHeader {
|
|
136
|
+
repeated FileDescriptorHeader file = 1;
|
|
137
|
+
}
|
|
138
|
+
`;
|
|
139
|
+
let headerSet;
|
|
140
|
+
/** The partial `FileDescriptorProto` schema, parsed once per process. */
|
|
141
|
+
export function descriptorHeaderProtoSet() {
|
|
142
|
+
headerSet ??= loadProtoSet(new Map([[HEADER_FILE, HEADER_SOURCE]]), { roots: [HEADER_FILE] });
|
|
143
|
+
return headerSet;
|
|
144
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sending one gRPC call over HTTP/2 with Node's `http2` module.
|
|
3
|
+
*
|
|
4
|
+
* gRPC is HTTP/2 with a fixed shape: a `POST` to `/<service>/<method>`, `content-type:
|
|
5
|
+
* application/grpc`, `te: trailers`, each message length-prefixed in the body, and the outcome in
|
|
6
|
+
* `grpc-status`/`grpc-message` trailers (or in the headers, for a "trailers-only" response). The
|
|
7
|
+
* REST transport's HTTP client hides trailers and buffers bodies, which is exactly what a server
|
|
8
|
+
* stream must not have, so this module speaks HTTP/2 directly. It knows nothing about protobuf:
|
|
9
|
+
* messages arrive and leave as bytes, and `call.ts` is where the codec meets the wire.
|
|
10
|
+
*
|
|
11
|
+
* A non-`OK` status is a result, not an error — the user asked what the server would say, and it
|
|
12
|
+
* said `NOT_FOUND`. Only a failure to get an answer at all (connection, TLS, an abort, a malformed
|
|
13
|
+
* stream) throws.
|
|
14
|
+
*/
|
|
15
|
+
import type { SslInfo } from '../http/tls.js';
|
|
16
|
+
import type { Timings, TlsOptions } from '../http/types.js';
|
|
17
|
+
import type { KeyValueEntry } from '../rest/model.js';
|
|
18
|
+
import type { SendAuth } from '../types.js';
|
|
19
|
+
import type { GrpcTarget } from './target.js';
|
|
20
|
+
export { parseGrpcTarget } from './target.js';
|
|
21
|
+
export type { GrpcTarget } from './target.js';
|
|
22
|
+
/** Everything {@link sendGrpc} needs, with every property already expanded and every secret resolved. */
|
|
23
|
+
export interface GrpcSendInput {
|
|
24
|
+
readonly target: string;
|
|
25
|
+
readonly tls: boolean;
|
|
26
|
+
readonly service: string;
|
|
27
|
+
readonly method: string;
|
|
28
|
+
/** The request messages, already encoded; one for a unary or server-streaming call. */
|
|
29
|
+
readonly messages: readonly Uint8Array[];
|
|
30
|
+
/** Metadata rows: the API's defaults first, then the request's own, a later row winning a repeated key. */
|
|
31
|
+
readonly metadata: readonly KeyValueEntry[];
|
|
32
|
+
/** Metadata the host adds on the call's behalf (`user-agent`), which a typed row overrides. */
|
|
33
|
+
readonly defaultMetadata?: Readonly<Record<string, string>>;
|
|
34
|
+
/** Credentials, already resolved to values. Basic, Bearer, OAuth2 and header API keys become `authorization` or a header. */
|
|
35
|
+
readonly auth?: SendAuth;
|
|
36
|
+
/** The deadline, sent as `grpc-timeout` and enforced locally. */
|
|
37
|
+
readonly timeoutMs: number;
|
|
38
|
+
/** Stop reading once this many response message bytes have arrived. */
|
|
39
|
+
readonly maxSizeBytes?: number;
|
|
40
|
+
readonly localAddress?: string;
|
|
41
|
+
readonly tlsOptions?: TlsOptions;
|
|
42
|
+
readonly signal?: AbortSignal;
|
|
43
|
+
/** Clock for timings; tests inject one. */
|
|
44
|
+
readonly now?: () => number;
|
|
45
|
+
/**
|
|
46
|
+
* Called once with the initial metadata, the moment the server's headers arrive rather than when
|
|
47
|
+
* the call ends. A server stream can run for minutes before its first message, and the headers
|
|
48
|
+
* are the first sign it was accepted at all.
|
|
49
|
+
*/
|
|
50
|
+
readonly onHeaders?: (headers: Readonly<Record<string, string>>, httpStatus: number) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Called for each response message as it is parsed, already decompressed, in arrival order. The
|
|
53
|
+
* same messages are still collected into {@link GrpcExchange.messages}, so a caller that only
|
|
54
|
+
* wants the end result ignores this and sees no difference.
|
|
55
|
+
*/
|
|
56
|
+
readonly onMessage?: (message: Uint8Array, index: number) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Opts into *interactive* mode: the request side stays open after {@link GrpcSendInput.messages}
|
|
59
|
+
* are written, and the handle pushes further messages or half-closes. Without it — every batch
|
|
60
|
+
* caller — `sendGrpc` writes every message and half-closes immediately, as it always has.
|
|
61
|
+
*
|
|
62
|
+
* The call still ends the way it always did: when the server ends the stream, the deadline
|
|
63
|
+
* passes, or the signal aborts. Half-closing is not required to finish, since a server may
|
|
64
|
+
* answer and end while the client still holds its side open.
|
|
65
|
+
*/
|
|
66
|
+
readonly onOpen?: (handle: GrpcStreamHandle) => void;
|
|
67
|
+
}
|
|
68
|
+
/** The client's side of a call left open by {@link GrpcSendInput.onOpen}. */
|
|
69
|
+
export interface GrpcStreamHandle {
|
|
70
|
+
/**
|
|
71
|
+
* Frames and writes one more request message.
|
|
72
|
+
*
|
|
73
|
+
* @throws GrpcError `grpc-stream-closed` once the request side is half-closed or the call is over
|
|
74
|
+
*/
|
|
75
|
+
readonly write: (message: Uint8Array) => void;
|
|
76
|
+
/** Half-closes the request side. Idempotent, and a no-op once the call has ended. */
|
|
77
|
+
readonly end: () => void;
|
|
78
|
+
/** False once {@link end} has been called or the call has ended. */
|
|
79
|
+
readonly isOpen: () => boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Where a call's status came from, which the response pane says when it is not the trailers. */
|
|
82
|
+
export type GrpcStatusSource = 'trailers' | 'headers' | 'http' | 'local';
|
|
83
|
+
/** The full record of one gRPC call. */
|
|
84
|
+
export interface GrpcExchange {
|
|
85
|
+
readonly request: {
|
|
86
|
+
readonly authority: string;
|
|
87
|
+
readonly path: string;
|
|
88
|
+
/** The headers as sent, pseudo-headers included, lower-cased. */
|
|
89
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
90
|
+
readonly messages: readonly Uint8Array[];
|
|
91
|
+
};
|
|
92
|
+
/** The HTTP status, 200 for every answer a gRPC server gives itself. */
|
|
93
|
+
readonly httpStatus: number;
|
|
94
|
+
/** Response headers (initial metadata), lower-cased, pseudo-headers removed. */
|
|
95
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
96
|
+
readonly trailers: Readonly<Record<string, string>>;
|
|
97
|
+
readonly status: number;
|
|
98
|
+
readonly statusName: string;
|
|
99
|
+
readonly statusMessage?: string;
|
|
100
|
+
readonly statusSource: GrpcStatusSource;
|
|
101
|
+
/** Response messages in arrival order, decompressed. */
|
|
102
|
+
readonly messages: readonly Uint8Array[];
|
|
103
|
+
/** The `grpc-encoding` the server used, when it compressed. */
|
|
104
|
+
readonly encoding?: string;
|
|
105
|
+
/** True when reading stopped at `maxSizeBytes` before the stream ended. */
|
|
106
|
+
readonly truncated: boolean;
|
|
107
|
+
readonly timings: Timings;
|
|
108
|
+
readonly tls?: SslInfo;
|
|
109
|
+
/** Request pseudo-headers and headers as text, then the framed messages, as they went on the wire. */
|
|
110
|
+
readonly rawRequest: Uint8Array;
|
|
111
|
+
/** Response headers as text, the framed messages, then the trailers as text. */
|
|
112
|
+
readonly rawResponse: Uint8Array;
|
|
113
|
+
readonly durationMs: number;
|
|
114
|
+
}
|
|
115
|
+
/** Builds the request headers: protocol first, then host defaults, credentials, and the user's rows last. */
|
|
116
|
+
export declare function buildGrpcHeaders(input: GrpcSendInput, target: GrpcTarget): Record<string, string>;
|
|
117
|
+
/**
|
|
118
|
+
* Sends one gRPC call and collects every response message and the final status.
|
|
119
|
+
*
|
|
120
|
+
* Client-streaming and bidirectional methods are sent in "batch" form: every request message is
|
|
121
|
+
* written, the request side is closed, and the responses are read until the server ends the stream.
|
|
122
|
+
* {@link GrpcSendInput.onOpen} turns that into an interactive call instead, where the caller keeps
|
|
123
|
+
* pushing messages until it half-closes.
|
|
124
|
+
*
|
|
125
|
+
* {@link GrpcSendInput.onHeaders} and {@link GrpcSendInput.onMessage} report the initial metadata
|
|
126
|
+
* and each response message as they arrive, for a caller that shows a stream while it runs.
|
|
127
|
+
*
|
|
128
|
+
* @throws HttpError for a connection, DNS, TLS or abort failure, with the HTTP transport's codes;
|
|
129
|
+
* GrpcError `grpc-target-invalid`, `grpc-auth-unsupported`, `grpc-stream-malformed`,
|
|
130
|
+
* `grpc-encoding-unsupported`, `grpc-message-too-large`, `grpc-stream-closed`
|
|
131
|
+
*/
|
|
132
|
+
export declare function sendGrpc(input: GrpcSendInput): Promise<GrpcExchange>;
|