@detent/sdk 0.0.0
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/.devcontainer/devcontainer.json +45 -0
- package/.speakeasy/temp/downloaded_DebOqZlrza.json +1 -0
- package/.speakeasy/temp/downloaded_YLnaAbCoUV.json +1 -0
- package/FUNCTIONS.md +87 -0
- package/README.md +413 -0
- package/RUNTIMES.md +48 -0
- package/dist/commonjs/core.d.ts +10 -0
- package/dist/commonjs/core.d.ts.map +1 -0
- package/dist/commonjs/core.js +17 -0
- package/dist/commonjs/core.js.map +1 -0
- package/dist/commonjs/funcs/diagnostics-create.d.ts +24 -0
- package/dist/commonjs/funcs/diagnostics-create.d.ts.map +1 -0
- package/dist/commonjs/funcs/diagnostics-create.js +120 -0
- package/dist/commonjs/funcs/diagnostics-create.js.map +1 -0
- package/dist/commonjs/hooks/hooks.d.ts +25 -0
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
- package/dist/commonjs/hooks/hooks.js +86 -0
- package/dist/commonjs/hooks/hooks.js.map +1 -0
- package/dist/commonjs/hooks/index.d.ts +3 -0
- package/dist/commonjs/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/hooks/index.js +22 -0
- package/dist/commonjs/hooks/index.js.map +1 -0
- package/dist/commonjs/hooks/registration.d.ts +3 -0
- package/dist/commonjs/hooks/registration.d.ts.map +1 -0
- package/dist/commonjs/hooks/registration.js +15 -0
- package/dist/commonjs/hooks/registration.js.map +1 -0
- package/dist/commonjs/hooks/types.d.ts +76 -0
- package/dist/commonjs/hooks/types.d.ts.map +1 -0
- package/dist/commonjs/hooks/types.js +6 -0
- package/dist/commonjs/hooks/types.js.map +1 -0
- package/dist/commonjs/index.d.ts +6 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +48 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/lib/base64.d.ts +10 -0
- package/dist/commonjs/lib/base64.d.ts.map +1 -0
- package/dist/commonjs/lib/base64.js +73 -0
- package/dist/commonjs/lib/base64.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +37 -0
- package/dist/commonjs/lib/config.d.ts.map +1 -0
- package/dist/commonjs/lib/config.js +42 -0
- package/dist/commonjs/lib/config.js.map +1 -0
- package/dist/commonjs/lib/dlv.d.ts +14 -0
- package/dist/commonjs/lib/dlv.d.ts.map +1 -0
- package/dist/commonjs/lib/dlv.js +49 -0
- package/dist/commonjs/lib/dlv.js.map +1 -0
- package/dist/commonjs/lib/encodings.d.ts +53 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -0
- package/dist/commonjs/lib/encodings.js +384 -0
- package/dist/commonjs/lib/encodings.js.map +1 -0
- package/dist/commonjs/lib/env.d.ts +14 -0
- package/dist/commonjs/lib/env.d.ts.map +1 -0
- package/dist/commonjs/lib/env.js +81 -0
- package/dist/commonjs/lib/env.js.map +1 -0
- package/dist/commonjs/lib/files.d.ts +13 -0
- package/dist/commonjs/lib/files.d.ts.map +1 -0
- package/dist/commonjs/lib/files.js +77 -0
- package/dist/commonjs/lib/files.js.map +1 -0
- package/dist/commonjs/lib/http.d.ts +67 -0
- package/dist/commonjs/lib/http.d.ts.map +1 -0
- package/dist/commonjs/lib/http.js +217 -0
- package/dist/commonjs/lib/http.js.map +1 -0
- package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
- package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
- package/dist/commonjs/lib/is-plain-object.js +41 -0
- package/dist/commonjs/lib/is-plain-object.js.map +1 -0
- package/dist/commonjs/lib/logger.d.ts +6 -0
- package/dist/commonjs/lib/logger.d.ts.map +1 -0
- package/dist/commonjs/lib/logger.js +6 -0
- package/dist/commonjs/lib/logger.js.map +1 -0
- package/dist/commonjs/lib/matchers.d.ts +59 -0
- package/dist/commonjs/lib/matchers.d.ts.map +1 -0
- package/dist/commonjs/lib/matchers.js +222 -0
- package/dist/commonjs/lib/matchers.js.map +1 -0
- package/dist/commonjs/lib/primitives.d.ts +26 -0
- package/dist/commonjs/lib/primitives.d.ts.map +1 -0
- package/dist/commonjs/lib/primitives.js +111 -0
- package/dist/commonjs/lib/primitives.js.map +1 -0
- package/dist/commonjs/lib/retries.d.ts +38 -0
- package/dist/commonjs/lib/retries.d.ts.map +1 -0
- package/dist/commonjs/lib/retries.js +153 -0
- package/dist/commonjs/lib/retries.js.map +1 -0
- package/dist/commonjs/lib/schemas.d.ts +21 -0
- package/dist/commonjs/lib/schemas.d.ts.map +1 -0
- package/dist/commonjs/lib/schemas.js +95 -0
- package/dist/commonjs/lib/schemas.js.map +1 -0
- package/dist/commonjs/lib/sdks.d.ts +63 -0
- package/dist/commonjs/lib/sdks.d.ts.map +1 -0
- package/dist/commonjs/lib/sdks.js +273 -0
- package/dist/commonjs/lib/sdks.js.map +1 -0
- package/dist/commonjs/lib/security.d.ts +80 -0
- package/dist/commonjs/lib/security.d.ts.map +1 -0
- package/dist/commonjs/lib/security.js +126 -0
- package/dist/commonjs/lib/security.js.map +1 -0
- package/dist/commonjs/lib/url.d.ts +5 -0
- package/dist/commonjs/lib/url.d.ts.map +1 -0
- package/dist/commonjs/lib/url.js +25 -0
- package/dist/commonjs/lib/url.js.map +1 -0
- package/dist/commonjs/models/detected-tool.d.ts +19 -0
- package/dist/commonjs/models/detected-tool.d.ts.map +1 -0
- package/dist/commonjs/models/detected-tool.js +54 -0
- package/dist/commonjs/models/detected-tool.js.map +1 -0
- package/dist/commonjs/models/diagnostic-lite.d.ts +25 -0
- package/dist/commonjs/models/diagnostic-lite.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostic-lite.js +59 -0
- package/dist/commonjs/models/diagnostic-lite.js.map +1 -0
- package/dist/commonjs/models/diagnostic-summary.d.ts +24 -0
- package/dist/commonjs/models/diagnostic-summary.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostic-summary.js +53 -0
- package/dist/commonjs/models/diagnostic-summary.js.map +1 -0
- package/dist/commonjs/models/diagnostic.d.ts +46 -0
- package/dist/commonjs/models/diagnostic.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostic.js +68 -0
- package/dist/commonjs/models/diagnostic.js.map +1 -0
- package/dist/commonjs/models/diagnostics-request.d.ts +27 -0
- package/dist/commonjs/models/diagnostics-request.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostics-request.js +53 -0
- package/dist/commonjs/models/diagnostics-request.js.map +1 -0
- package/dist/commonjs/models/diagnostics-response-full.d.ts +31 -0
- package/dist/commonjs/models/diagnostics-response-full.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostics-response-full.js +62 -0
- package/dist/commonjs/models/diagnostics-response-full.js.map +1 -0
- package/dist/commonjs/models/diagnostics-response-lite.d.ts +26 -0
- package/dist/commonjs/models/diagnostics-response-lite.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostics-response-lite.js +60 -0
- package/dist/commonjs/models/diagnostics-response-lite.js.map +1 -0
- package/dist/commonjs/models/diagnostics-response.d.ts +11 -0
- package/dist/commonjs/models/diagnostics-response.d.ts.map +1 -0
- package/dist/commonjs/models/diagnostics-response.js +20 -0
- package/dist/commonjs/models/diagnostics-response.js.map +1 -0
- package/dist/commonjs/models/errors/detent-sdk-default-error.d.ts +10 -0
- package/dist/commonjs/models/errors/detent-sdk-default-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/detent-sdk-default-error.js +34 -0
- package/dist/commonjs/models/errors/detent-sdk-default-error.js.map +1 -0
- package/dist/commonjs/models/errors/detent-sdk-error.d.ts +19 -0
- package/dist/commonjs/models/errors/detent-sdk-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/detent-sdk-error.js +20 -0
- package/dist/commonjs/models/errors/detent-sdk-error.js.map +1 -0
- package/dist/commonjs/models/errors/error-response.d.ts +24 -0
- package/dist/commonjs/models/errors/error-response.d.ts.map +1 -0
- package/dist/commonjs/models/errors/error-response.js +68 -0
- package/dist/commonjs/models/errors/error-response.js.map +1 -0
- package/dist/commonjs/models/errors/http-client-errors.d.ts +44 -0
- package/dist/commonjs/models/errors/http-client-errors.d.ts.map +1 -0
- package/dist/commonjs/models/errors/http-client-errors.js +78 -0
- package/dist/commonjs/models/errors/http-client-errors.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +8 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -0
- package/dist/commonjs/models/errors/index.js +27 -0
- package/dist/commonjs/models/errors/index.js.map +1 -0
- package/dist/commonjs/models/errors/rate-limit-error.d.ts +32 -0
- package/dist/commonjs/models/errors/rate-limit-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/rate-limit-error.js +70 -0
- package/dist/commonjs/models/errors/rate-limit-error.js.map +1 -0
- package/dist/commonjs/models/errors/response-validation-error.d.ts +26 -0
- package/dist/commonjs/models/errors/response-validation-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/response-validation-error.js +66 -0
- package/dist/commonjs/models/errors/response-validation-error.js.map +1 -0
- package/dist/commonjs/models/errors/sdk-validation-error.d.ts +21 -0
- package/dist/commonjs/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/sdk-validation-error.js +82 -0
- package/dist/commonjs/models/errors/sdk-validation-error.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +11 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +30 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/mode-enum.d.ts +16 -0
- package/dist/commonjs/models/mode-enum.d.ts.map +1 -0
- package/dist/commonjs/models/mode-enum.js +50 -0
- package/dist/commonjs/models/mode-enum.js.map +1 -0
- package/dist/commonjs/models/severity.d.ts +16 -0
- package/dist/commonjs/models/severity.d.ts.map +1 -0
- package/dist/commonjs/models/severity.js +50 -0
- package/dist/commonjs/models/severity.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/sdk/diagnostics.d.ts +18 -0
- package/dist/commonjs/sdk/diagnostics.d.ts.map +1 -0
- package/dist/commonjs/sdk/diagnostics.js +28 -0
- package/dist/commonjs/sdk/diagnostics.js.map +1 -0
- package/dist/commonjs/sdk/index.d.ts +2 -0
- package/dist/commonjs/sdk/index.d.ts.map +1 -0
- package/dist/commonjs/sdk/index.js +21 -0
- package/dist/commonjs/sdk/index.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +7 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
- package/dist/commonjs/sdk/sdk.js +15 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -0
- package/dist/commonjs/types/async.d.ts +23 -0
- package/dist/commonjs/types/async.d.ts.map +1 -0
- package/dist/commonjs/types/async.js +44 -0
- package/dist/commonjs/types/async.js.map +1 -0
- package/dist/commonjs/types/blobs.d.ts +4 -0
- package/dist/commonjs/types/blobs.d.ts.map +1 -0
- package/dist/commonjs/types/blobs.js +62 -0
- package/dist/commonjs/types/blobs.js.map +1 -0
- package/dist/commonjs/types/const-date-time.d.ts +3 -0
- package/dist/commonjs/types/const-date-time.d.ts.map +1 -0
- package/dist/commonjs/types/const-date-time.js +46 -0
- package/dist/commonjs/types/const-date-time.js.map +1 -0
- package/dist/commonjs/types/default-to-zero-value.d.ts +12 -0
- package/dist/commonjs/types/default-to-zero-value.d.ts.map +1 -0
- package/dist/commonjs/types/default-to-zero-value.js +35 -0
- package/dist/commonjs/types/default-to-zero-value.js.map +1 -0
- package/dist/commonjs/types/discriminated-union.d.ts +25 -0
- package/dist/commonjs/types/discriminated-union.d.ts.map +1 -0
- package/dist/commonjs/types/discriminated-union.js +98 -0
- package/dist/commonjs/types/discriminated-union.js.map +1 -0
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.d.ts.map +1 -0
- package/dist/commonjs/types/enums.js +66 -0
- package/dist/commonjs/types/enums.js.map +1 -0
- package/dist/commonjs/types/fp.d.ts +31 -0
- package/dist/commonjs/types/fp.d.ts.map +1 -0
- package/dist/commonjs/types/fp.js +37 -0
- package/dist/commonjs/types/fp.js.map +1 -0
- package/dist/commonjs/types/index.d.ts +10 -0
- package/dist/commonjs/types/index.d.ts.map +1 -0
- package/dist/commonjs/types/index.js +31 -0
- package/dist/commonjs/types/index.js.map +1 -0
- package/dist/commonjs/types/operations.d.ts +27 -0
- package/dist/commonjs/types/operations.d.ts.map +1 -0
- package/dist/commonjs/types/operations.js +83 -0
- package/dist/commonjs/types/operations.js.map +1 -0
- package/dist/commonjs/types/primitives.d.ts +11 -0
- package/dist/commonjs/types/primitives.d.ts.map +1 -0
- package/dist/commonjs/types/primitives.js +176 -0
- package/dist/commonjs/types/primitives.js.map +1 -0
- package/dist/commonjs/types/rfcdate.d.ts +21 -0
- package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
- package/dist/commonjs/types/rfcdate.js +46 -0
- package/dist/commonjs/types/rfcdate.js.map +1 -0
- package/dist/commonjs/types/smart-union.d.ts +7 -0
- package/dist/commonjs/types/smart-union.d.ts.map +1 -0
- package/dist/commonjs/types/smart-union.js +147 -0
- package/dist/commonjs/types/smart-union.js.map +1 -0
- package/dist/commonjs/types/streams.d.ts +2 -0
- package/dist/commonjs/types/streams.d.ts.map +1 -0
- package/dist/commonjs/types/streams.js +18 -0
- package/dist/commonjs/types/streams.js.map +1 -0
- package/dist/commonjs/types/unrecognized.d.ts +16 -0
- package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
- package/dist/commonjs/types/unrecognized.js +34 -0
- package/dist/commonjs/types/unrecognized.js.map +1 -0
- package/dist/esm/core.d.ts +10 -0
- package/dist/esm/core.d.ts.map +1 -0
- package/dist/esm/core.js +13 -0
- package/dist/esm/core.js.map +1 -0
- package/dist/esm/funcs/diagnostics-create.d.ts +24 -0
- package/dist/esm/funcs/diagnostics-create.d.ts.map +1 -0
- package/dist/esm/funcs/diagnostics-create.js +84 -0
- package/dist/esm/funcs/diagnostics-create.js.map +1 -0
- package/dist/esm/hooks/hooks.d.ts +25 -0
- package/dist/esm/hooks/hooks.d.ts.map +1 -0
- package/dist/esm/hooks/hooks.js +82 -0
- package/dist/esm/hooks/hooks.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +3 -0
- package/dist/esm/hooks/index.d.ts.map +1 -0
- package/dist/esm/hooks/index.js +6 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/registration.d.ts +3 -0
- package/dist/esm/hooks/registration.d.ts.map +1 -0
- package/dist/esm/hooks/registration.js +12 -0
- package/dist/esm/hooks/registration.js.map +1 -0
- package/dist/esm/hooks/types.d.ts +76 -0
- package/dist/esm/hooks/types.d.ts.map +1 -0
- package/dist/esm/hooks/types.js +5 -0
- package/dist/esm/hooks/types.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/base64.d.ts +10 -0
- package/dist/esm/lib/base64.d.ts.map +1 -0
- package/dist/esm/lib/base64.js +31 -0
- package/dist/esm/lib/base64.js.map +1 -0
- package/dist/esm/lib/config.d.ts +37 -0
- package/dist/esm/lib/config.d.ts.map +1 -0
- package/dist/esm/lib/config.js +38 -0
- package/dist/esm/lib/config.js.map +1 -0
- package/dist/esm/lib/dlv.d.ts +14 -0
- package/dist/esm/lib/dlv.d.ts.map +1 -0
- package/dist/esm/lib/dlv.js +46 -0
- package/dist/esm/lib/dlv.js.map +1 -0
- package/dist/esm/lib/encodings.d.ts +53 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -0
- package/dist/esm/lib/encodings.js +370 -0
- package/dist/esm/lib/encodings.js.map +1 -0
- package/dist/esm/lib/env.d.ts +14 -0
- package/dist/esm/lib/env.d.ts.map +1 -0
- package/dist/esm/lib/env.js +43 -0
- package/dist/esm/lib/env.js.map +1 -0
- package/dist/esm/lib/files.d.ts +13 -0
- package/dist/esm/lib/files.d.ts.map +1 -0
- package/dist/esm/lib/files.js +73 -0
- package/dist/esm/lib/files.js.map +1 -0
- package/dist/esm/lib/http.d.ts +67 -0
- package/dist/esm/lib/http.d.ts.map +1 -0
- package/dist/esm/lib/http.js +207 -0
- package/dist/esm/lib/http.js.map +1 -0
- package/dist/esm/lib/is-plain-object.d.ts +2 -0
- package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
- package/dist/esm/lib/is-plain-object.js +38 -0
- package/dist/esm/lib/is-plain-object.js.map +1 -0
- package/dist/esm/lib/logger.d.ts +6 -0
- package/dist/esm/lib/logger.d.ts.map +1 -0
- package/dist/esm/lib/logger.js +5 -0
- package/dist/esm/lib/logger.js.map +1 -0
- package/dist/esm/lib/matchers.d.ts +59 -0
- package/dist/esm/lib/matchers.d.ts.map +1 -0
- package/dist/esm/lib/matchers.js +203 -0
- package/dist/esm/lib/matchers.js.map +1 -0
- package/dist/esm/lib/primitives.d.ts +26 -0
- package/dist/esm/lib/primitives.d.ts.map +1 -0
- package/dist/esm/lib/primitives.js +103 -0
- package/dist/esm/lib/primitives.js.map +1 -0
- package/dist/esm/lib/retries.d.ts +38 -0
- package/dist/esm/lib/retries.d.ts.map +1 -0
- package/dist/esm/lib/retries.js +147 -0
- package/dist/esm/lib/retries.js.map +1 -0
- package/dist/esm/lib/schemas.d.ts +21 -0
- package/dist/esm/lib/schemas.d.ts.map +1 -0
- package/dist/esm/lib/schemas.js +57 -0
- package/dist/esm/lib/schemas.js.map +1 -0
- package/dist/esm/lib/sdks.d.ts +63 -0
- package/dist/esm/lib/sdks.d.ts.map +1 -0
- package/dist/esm/lib/sdks.js +269 -0
- package/dist/esm/lib/sdks.js.map +1 -0
- package/dist/esm/lib/security.d.ts +80 -0
- package/dist/esm/lib/security.d.ts.map +1 -0
- package/dist/esm/lib/security.js +121 -0
- package/dist/esm/lib/security.js.map +1 -0
- package/dist/esm/lib/url.d.ts +5 -0
- package/dist/esm/lib/url.d.ts.map +1 -0
- package/dist/esm/lib/url.js +22 -0
- package/dist/esm/lib/url.js.map +1 -0
- package/dist/esm/models/detected-tool.d.ts +19 -0
- package/dist/esm/models/detected-tool.d.ts.map +1 -0
- package/dist/esm/models/detected-tool.js +18 -0
- package/dist/esm/models/detected-tool.js.map +1 -0
- package/dist/esm/models/diagnostic-lite.d.ts +25 -0
- package/dist/esm/models/diagnostic-lite.d.ts.map +1 -0
- package/dist/esm/models/diagnostic-lite.js +22 -0
- package/dist/esm/models/diagnostic-lite.js.map +1 -0
- package/dist/esm/models/diagnostic-summary.d.ts +24 -0
- package/dist/esm/models/diagnostic-summary.d.ts.map +1 -0
- package/dist/esm/models/diagnostic-summary.js +16 -0
- package/dist/esm/models/diagnostic-summary.js.map +1 -0
- package/dist/esm/models/diagnostic.d.ts +46 -0
- package/dist/esm/models/diagnostic.d.ts.map +1 -0
- package/dist/esm/models/diagnostic.js +31 -0
- package/dist/esm/models/diagnostic.js.map +1 -0
- package/dist/esm/models/diagnostics-request.d.ts +27 -0
- package/dist/esm/models/diagnostics-request.d.ts.map +1 -0
- package/dist/esm/models/diagnostics-request.js +16 -0
- package/dist/esm/models/diagnostics-request.js.map +1 -0
- package/dist/esm/models/diagnostics-response-full.d.ts +31 -0
- package/dist/esm/models/diagnostics-response-full.d.ts.map +1 -0
- package/dist/esm/models/diagnostics-response-full.js +25 -0
- package/dist/esm/models/diagnostics-response-full.js.map +1 -0
- package/dist/esm/models/diagnostics-response-lite.d.ts +26 -0
- package/dist/esm/models/diagnostics-response-lite.d.ts.map +1 -0
- package/dist/esm/models/diagnostics-response-lite.js +23 -0
- package/dist/esm/models/diagnostics-response-lite.js.map +1 -0
- package/dist/esm/models/diagnostics-response.d.ts +11 -0
- package/dist/esm/models/diagnostics-response.d.ts.map +1 -0
- package/dist/esm/models/diagnostics-response.js +16 -0
- package/dist/esm/models/diagnostics-response.js.map +1 -0
- package/dist/esm/models/errors/detent-sdk-default-error.d.ts +10 -0
- package/dist/esm/models/errors/detent-sdk-default-error.d.ts.map +1 -0
- package/dist/esm/models/errors/detent-sdk-default-error.js +30 -0
- package/dist/esm/models/errors/detent-sdk-default-error.js.map +1 -0
- package/dist/esm/models/errors/detent-sdk-error.d.ts +19 -0
- package/dist/esm/models/errors/detent-sdk-error.d.ts.map +1 -0
- package/dist/esm/models/errors/detent-sdk-error.js +16 -0
- package/dist/esm/models/errors/detent-sdk-error.js.map +1 -0
- package/dist/esm/models/errors/error-response.d.ts +24 -0
- package/dist/esm/models/errors/error-response.d.ts.map +1 -0
- package/dist/esm/models/errors/error-response.js +31 -0
- package/dist/esm/models/errors/error-response.js.map +1 -0
- package/dist/esm/models/errors/http-client-errors.d.ts +44 -0
- package/dist/esm/models/errors/http-client-errors.d.ts.map +1 -0
- package/dist/esm/models/errors/http-client-errors.js +69 -0
- package/dist/esm/models/errors/http-client-errors.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +8 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -0
- package/dist/esm/models/errors/index.js +11 -0
- package/dist/esm/models/errors/index.js.map +1 -0
- package/dist/esm/models/errors/rate-limit-error.d.ts +32 -0
- package/dist/esm/models/errors/rate-limit-error.d.ts.map +1 -0
- package/dist/esm/models/errors/rate-limit-error.js +33 -0
- package/dist/esm/models/errors/rate-limit-error.js.map +1 -0
- package/dist/esm/models/errors/response-validation-error.d.ts +26 -0
- package/dist/esm/models/errors/response-validation-error.d.ts.map +1 -0
- package/dist/esm/models/errors/response-validation-error.js +29 -0
- package/dist/esm/models/errors/response-validation-error.js.map +1 -0
- package/dist/esm/models/errors/sdk-validation-error.d.ts +21 -0
- package/dist/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/dist/esm/models/errors/sdk-validation-error.js +44 -0
- package/dist/esm/models/errors/sdk-validation-error.js.map +1 -0
- package/dist/esm/models/index.d.ts +11 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +14 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/mode-enum.d.ts +16 -0
- package/dist/esm/models/mode-enum.d.ts.map +1 -0
- package/dist/esm/models/mode-enum.js +14 -0
- package/dist/esm/models/mode-enum.js.map +1 -0
- package/dist/esm/models/severity.d.ts +16 -0
- package/dist/esm/models/severity.d.ts.map +1 -0
- package/dist/esm/models/severity.js +14 -0
- package/dist/esm/models/severity.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/sdk/diagnostics.d.ts +18 -0
- package/dist/esm/sdk/diagnostics.d.ts.map +1 -0
- package/dist/esm/sdk/diagnostics.js +24 -0
- package/dist/esm/sdk/diagnostics.js.map +1 -0
- package/dist/esm/sdk/index.d.ts +2 -0
- package/dist/esm/sdk/index.d.ts.map +1 -0
- package/dist/esm/sdk/index.js +5 -0
- package/dist/esm/sdk/index.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +7 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -0
- package/dist/esm/sdk/sdk.js +11 -0
- package/dist/esm/sdk/sdk.js.map +1 -0
- package/dist/esm/types/async.d.ts +23 -0
- package/dist/esm/types/async.d.ts.map +1 -0
- package/dist/esm/types/async.js +40 -0
- package/dist/esm/types/async.js.map +1 -0
- package/dist/esm/types/blobs.d.ts +4 -0
- package/dist/esm/types/blobs.d.ts.map +1 -0
- package/dist/esm/types/blobs.js +25 -0
- package/dist/esm/types/blobs.js.map +1 -0
- package/dist/esm/types/const-date-time.d.ts +3 -0
- package/dist/esm/types/const-date-time.d.ts.map +1 -0
- package/dist/esm/types/const-date-time.js +10 -0
- package/dist/esm/types/const-date-time.js.map +1 -0
- package/dist/esm/types/default-to-zero-value.d.ts +12 -0
- package/dist/esm/types/default-to-zero-value.d.ts.map +1 -0
- package/dist/esm/types/default-to-zero-value.js +31 -0
- package/dist/esm/types/default-to-zero-value.js.map +1 -0
- package/dist/esm/types/discriminated-union.d.ts +25 -0
- package/dist/esm/types/discriminated-union.d.ts.map +1 -0
- package/dist/esm/types/discriminated-union.js +61 -0
- package/dist/esm/types/discriminated-union.js.map +1 -0
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.d.ts.map +1 -0
- package/dist/esm/types/enums.js +27 -0
- package/dist/esm/types/enums.js.map +1 -0
- package/dist/esm/types/fp.d.ts +31 -0
- package/dist/esm/types/fp.d.ts.map +1 -0
- package/dist/esm/types/fp.js +31 -0
- package/dist/esm/types/fp.js.map +1 -0
- package/dist/esm/types/index.d.ts +10 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/operations.d.ts +27 -0
- package/dist/esm/types/operations.d.ts.map +1 -0
- package/dist/esm/types/operations.js +77 -0
- package/dist/esm/types/operations.js.map +1 -0
- package/dist/esm/types/primitives.d.ts +11 -0
- package/dist/esm/types/primitives.d.ts.map +1 -0
- package/dist/esm/types/primitives.js +132 -0
- package/dist/esm/types/primitives.js.map +1 -0
- package/dist/esm/types/rfcdate.d.ts +21 -0
- package/dist/esm/types/rfcdate.d.ts.map +1 -0
- package/dist/esm/types/rfcdate.js +42 -0
- package/dist/esm/types/rfcdate.js.map +1 -0
- package/dist/esm/types/smart-union.d.ts +7 -0
- package/dist/esm/types/smart-union.d.ts.map +1 -0
- package/dist/esm/types/smart-union.js +111 -0
- package/dist/esm/types/smart-union.js.map +1 -0
- package/dist/esm/types/streams.d.ts +2 -0
- package/dist/esm/types/streams.d.ts.map +1 -0
- package/dist/esm/types/streams.js +15 -0
- package/dist/esm/types/streams.js.map +1 -0
- package/dist/esm/types/unrecognized.d.ts +16 -0
- package/dist/esm/types/unrecognized.d.ts.map +1 -0
- package/dist/esm/types/unrecognized.js +31 -0
- package/dist/esm/types/unrecognized.js.map +1 -0
- package/examples/diagnosticsCreate.example.ts +26 -0
- package/examples/node_modules/.package-lock.json +174 -0
- package/examples/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/examples/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/examples/node_modules/@types/node/assert.d.ts +1062 -0
- package/examples/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/examples/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/examples/node_modules/@types/node/buffer.d.ts +1936 -0
- package/examples/node_modules/@types/node/child_process.d.ts +1475 -0
- package/examples/node_modules/@types/node/cluster.d.ts +577 -0
- package/examples/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/examples/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/examples/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/examples/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/examples/node_modules/@types/node/console.d.ts +452 -0
- package/examples/node_modules/@types/node/constants.d.ts +21 -0
- package/examples/node_modules/@types/node/crypto.d.ts +4590 -0
- package/examples/node_modules/@types/node/dgram.d.ts +597 -0
- package/examples/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/examples/node_modules/@types/node/dns/promises.d.ts +479 -0
- package/examples/node_modules/@types/node/dns.d.ts +871 -0
- package/examples/node_modules/@types/node/domain.d.ts +170 -0
- package/examples/node_modules/@types/node/events.d.ts +977 -0
- package/examples/node_modules/@types/node/fs/promises.d.ts +1270 -0
- package/examples/node_modules/@types/node/fs.d.ts +4375 -0
- package/examples/node_modules/@types/node/globals.d.ts +172 -0
- package/examples/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/examples/node_modules/@types/node/http.d.ts +2049 -0
- package/examples/node_modules/@types/node/http2.d.ts +2631 -0
- package/examples/node_modules/@types/node/https.d.ts +578 -0
- package/examples/node_modules/@types/node/index.d.ts +93 -0
- package/examples/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/examples/node_modules/@types/node/module.d.ts +539 -0
- package/examples/node_modules/@types/node/net.d.ts +1012 -0
- package/examples/node_modules/@types/node/os.d.ts +506 -0
- package/examples/node_modules/@types/node/package.json +140 -0
- package/examples/node_modules/@types/node/path.d.ts +200 -0
- package/examples/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/examples/node_modules/@types/node/process.d.ts +1966 -0
- package/examples/node_modules/@types/node/punycode.d.ts +117 -0
- package/examples/node_modules/@types/node/querystring.d.ts +152 -0
- package/examples/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/examples/node_modules/@types/node/readline.d.ts +589 -0
- package/examples/node_modules/@types/node/repl.d.ts +430 -0
- package/examples/node_modules/@types/node/sea.d.ts +153 -0
- package/examples/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/examples/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/examples/node_modules/@types/node/stream/web.d.ts +533 -0
- package/examples/node_modules/@types/node/stream.d.ts +1675 -0
- package/examples/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/examples/node_modules/@types/node/test.d.ts +1787 -0
- package/examples/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/examples/node_modules/@types/node/timers.d.ts +286 -0
- package/examples/node_modules/@types/node/tls.d.ts +1259 -0
- package/examples/node_modules/@types/node/trace_events.d.ts +197 -0
- package/examples/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/examples/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/examples/node_modules/@types/node/ts5.6/index.d.ts +93 -0
- package/examples/node_modules/@types/node/tty.d.ts +208 -0
- package/examples/node_modules/@types/node/url.d.ts +964 -0
- package/examples/node_modules/@types/node/util.d.ts +2331 -0
- package/examples/node_modules/@types/node/v8.d.ts +809 -0
- package/examples/node_modules/@types/node/vm.d.ts +1001 -0
- package/examples/node_modules/@types/node/wasi.d.ts +181 -0
- package/examples/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/examples/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/examples/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/examples/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/examples/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/examples/node_modules/@types/node/zlib.d.ts +540 -0
- package/examples/node_modules/dotenv/config.d.ts +1 -0
- package/examples/node_modules/dotenv/config.js +9 -0
- package/examples/node_modules/dotenv/lib/cli-options.js +17 -0
- package/examples/node_modules/dotenv/lib/env-options.js +28 -0
- package/examples/node_modules/dotenv/lib/main.d.ts +162 -0
- package/examples/node_modules/dotenv/lib/main.js +386 -0
- package/examples/node_modules/dotenv/package.json +62 -0
- package/examples/node_modules/esbuild/install.js +289 -0
- package/examples/node_modules/esbuild/lib/main.d.ts +716 -0
- package/examples/node_modules/esbuild/lib/main.js +2242 -0
- package/examples/node_modules/esbuild/package.json +49 -0
- package/examples/node_modules/fsevents/fsevents.d.ts +46 -0
- package/examples/node_modules/fsevents/fsevents.js +83 -0
- package/examples/node_modules/fsevents/package.json +62 -0
- package/examples/node_modules/get-tsconfig/dist/index.mjs +7 -0
- package/examples/node_modules/get-tsconfig/package.json +46 -0
- package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +1 -0
- package/examples/node_modules/resolve-pkg-maps/package.json +42 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/cli.mjs +55 -0
- package/examples/node_modules/tsx/dist/client-BQVF1NaW.mjs +1 -0
- package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/esm/index.mjs +2 -0
- package/examples/node_modules/tsx/dist/get-pipe-path-BHW2eJdv.mjs +1 -0
- package/examples/node_modules/tsx/dist/index-7AaEi15b.mjs +14 -0
- package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
- package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
- package/examples/node_modules/tsx/dist/loader.mjs +1 -0
- package/examples/node_modules/tsx/dist/node-features-_8ZFwP_x.mjs +1 -0
- package/examples/node_modules/tsx/dist/package-CeBgXWuR.mjs +1 -0
- package/examples/node_modules/tsx/dist/patch-repl.mjs +1 -0
- package/examples/node_modules/tsx/dist/preflight.mjs +1 -0
- package/examples/node_modules/tsx/dist/register-B7jrtLTO.mjs +1 -0
- package/examples/node_modules/tsx/dist/register-CFH5oNdT.mjs +4 -0
- package/examples/node_modules/tsx/dist/repl.mjs +3 -0
- package/examples/node_modules/tsx/dist/require-DQxpCAr4.mjs +1 -0
- package/examples/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
- package/examples/node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs +1 -0
- package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
- package/examples/node_modules/tsx/package.json +68 -0
- package/examples/node_modules/undici-types/agent.d.ts +31 -0
- package/examples/node_modules/undici-types/api.d.ts +43 -0
- package/examples/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/examples/node_modules/undici-types/cache.d.ts +36 -0
- package/examples/node_modules/undici-types/client.d.ts +108 -0
- package/examples/node_modules/undici-types/connector.d.ts +34 -0
- package/examples/node_modules/undici-types/content-type.d.ts +21 -0
- package/examples/node_modules/undici-types/cookies.d.ts +28 -0
- package/examples/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/examples/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/examples/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/examples/node_modules/undici-types/errors.d.ts +149 -0
- package/examples/node_modules/undici-types/eventsource.d.ts +61 -0
- package/examples/node_modules/undici-types/fetch.d.ts +209 -0
- package/examples/node_modules/undici-types/file.d.ts +39 -0
- package/examples/node_modules/undici-types/filereader.d.ts +54 -0
- package/examples/node_modules/undici-types/formdata.d.ts +108 -0
- package/examples/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/examples/node_modules/undici-types/global-origin.d.ts +7 -0
- package/examples/node_modules/undici-types/handlers.d.ts +15 -0
- package/examples/node_modules/undici-types/header.d.ts +4 -0
- package/examples/node_modules/undici-types/index.d.ts +71 -0
- package/examples/node_modules/undici-types/interceptors.d.ts +17 -0
- package/examples/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/examples/node_modules/undici-types/mock-client.d.ts +25 -0
- package/examples/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/examples/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/examples/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/examples/node_modules/undici-types/package.json +55 -0
- package/examples/node_modules/undici-types/patch.d.ts +33 -0
- package/examples/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/examples/node_modules/undici-types/pool.d.ts +39 -0
- package/examples/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/examples/node_modules/undici-types/readable.d.ts +65 -0
- package/examples/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/examples/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/examples/node_modules/undici-types/util.d.ts +18 -0
- package/examples/node_modules/undici-types/webidl.d.ts +228 -0
- package/examples/node_modules/undici-types/websocket.d.ts +150 -0
- package/examples/package-lock.json +611 -0
- package/examples/package.json +18 -0
- package/jsr.json +27 -0
- package/package.json +110 -0
- package/src/core.ts +13 -0
- package/src/funcs/diagnostics-create.ts +174 -0
- package/src/hooks/hooks.ts +132 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +107 -0
- package/src/index.ts +9 -0
- package/src/lib/base64.ts +39 -0
- package/src/lib/config.ts +69 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +501 -0
- package/src/lib/env.ts +53 -0
- package/src/lib/files.ts +82 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +352 -0
- package/src/lib/primitives.ts +150 -0
- package/src/lib/retries.ts +218 -0
- package/src/lib/schemas.ts +94 -0
- package/src/lib/sdks.ts +406 -0
- package/src/lib/security.ts +237 -0
- package/src/lib/url.ts +33 -0
- package/src/models/detected-tool.ts +25 -0
- package/src/models/diagnostic-lite.ts +57 -0
- package/src/models/diagnostic-summary.ts +47 -0
- package/src/models/diagnostic.ts +83 -0
- package/src/models/diagnostics-request.ts +47 -0
- package/src/models/diagnostics-response-full.ts +67 -0
- package/src/models/diagnostics-response-lite.ts +61 -0
- package/src/models/diagnostics-response.ts +42 -0
- package/src/models/errors/detent-sdk-default-error.ts +40 -0
- package/src/models/errors/detent-sdk-error.ts +35 -0
- package/src/models/errors/error-response.ts +58 -0
- package/src/models/errors/http-client-errors.ts +62 -0
- package/src/models/errors/index.ts +11 -0
- package/src/models/errors/rate-limit-error.ts +68 -0
- package/src/models/errors/response-validation-error.ts +50 -0
- package/src/models/errors/sdk-validation-error.ts +54 -0
- package/src/models/index.ts +14 -0
- package/src/models/mode-enum.ts +23 -0
- package/src/models/severity.ts +23 -0
- package/src/sdk/diagnostics.ts +33 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/sdk.ts +13 -0
- package/src/types/async.ts +68 -0
- package/src/types/blobs.ts +33 -0
- package/src/types/const-date-time.ts +15 -0
- package/src/types/default-to-zero-value.ts +33 -0
- package/src/types/discriminated-union.ts +101 -0
- package/src/types/enums.ts +45 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +13 -0
- package/src/types/operations.ts +105 -0
- package/src/types/primitives.ts +168 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/smart-union.ts +146 -0
- package/src/types/streams.ts +21 -0
- package/src/types/unrecognized.ts +35 -0
- package/tsconfig.json +40 -0
package/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@detent/sdk",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"author": "Speakeasy",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"tshy": {
|
|
7
|
+
"sourceDialects": [
|
|
8
|
+
"@detent/sdk/source"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.ts",
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
"./types": "./src/types/index.ts",
|
|
14
|
+
"./models/errors": "./src/models/errors/index.ts",
|
|
15
|
+
"./models": "./src/models/index.ts",
|
|
16
|
+
"./*.js": "./src/*.ts",
|
|
17
|
+
"./*": "./src/*.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"scripts": {
|
|
22
|
+
"lint": "eslint --cache --max-warnings=0 src",
|
|
23
|
+
"build": "tshy",
|
|
24
|
+
"prepublishOnly": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@eslint/js": "^9.19.0",
|
|
29
|
+
"eslint": "^9.19.0",
|
|
30
|
+
"globals": "^15.14.0",
|
|
31
|
+
"tshy": "^2.0.0",
|
|
32
|
+
"typescript": "~5.8.3",
|
|
33
|
+
"typescript-eslint": "^8.26.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"zod": "^3.25.65 || ^4.0.0"
|
|
37
|
+
},
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"import": {
|
|
41
|
+
"@detent/sdk/source": "./src/index.ts",
|
|
42
|
+
"types": "./dist/esm/index.d.ts",
|
|
43
|
+
"default": "./dist/esm/index.js"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
47
|
+
"default": "./dist/commonjs/index.js"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json",
|
|
51
|
+
"./types": {
|
|
52
|
+
"import": {
|
|
53
|
+
"@detent/sdk/source": "./src/types/index.ts",
|
|
54
|
+
"types": "./dist/esm/types/index.d.ts",
|
|
55
|
+
"default": "./dist/esm/types/index.js"
|
|
56
|
+
},
|
|
57
|
+
"require": {
|
|
58
|
+
"types": "./dist/commonjs/types/index.d.ts",
|
|
59
|
+
"default": "./dist/commonjs/types/index.js"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"./models/errors": {
|
|
63
|
+
"import": {
|
|
64
|
+
"@detent/sdk/source": "./src/models/errors/index.ts",
|
|
65
|
+
"types": "./dist/esm/models/errors/index.d.ts",
|
|
66
|
+
"default": "./dist/esm/models/errors/index.js"
|
|
67
|
+
},
|
|
68
|
+
"require": {
|
|
69
|
+
"types": "./dist/commonjs/models/errors/index.d.ts",
|
|
70
|
+
"default": "./dist/commonjs/models/errors/index.js"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"./models": {
|
|
74
|
+
"import": {
|
|
75
|
+
"@detent/sdk/source": "./src/models/index.ts",
|
|
76
|
+
"types": "./dist/esm/models/index.d.ts",
|
|
77
|
+
"default": "./dist/esm/models/index.js"
|
|
78
|
+
},
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/commonjs/models/index.d.ts",
|
|
81
|
+
"default": "./dist/commonjs/models/index.js"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"./*.js": {
|
|
85
|
+
"import": {
|
|
86
|
+
"@detent/sdk/source": "./src/*.ts",
|
|
87
|
+
"types": "./dist/esm/*.d.ts",
|
|
88
|
+
"default": "./dist/esm/*.js"
|
|
89
|
+
},
|
|
90
|
+
"require": {
|
|
91
|
+
"types": "./dist/commonjs/*.d.ts",
|
|
92
|
+
"default": "./dist/commonjs/*.js"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"./*": {
|
|
96
|
+
"import": {
|
|
97
|
+
"@detent/sdk/source": "./src/*.ts",
|
|
98
|
+
"types": "./dist/esm/*.d.ts",
|
|
99
|
+
"default": "./dist/esm/*.js"
|
|
100
|
+
},
|
|
101
|
+
"require": {
|
|
102
|
+
"types": "./dist/commonjs/*.d.ts",
|
|
103
|
+
"default": "./dist/commonjs/*.js"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"main": "./dist/commonjs/index.js",
|
|
108
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
109
|
+
"module": "./dist/esm/index.js"
|
|
110
|
+
}
|
package/src/core.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK } from "./lib/sdks.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
9
|
+
* instance of this class would be instantiated once at the start of an
|
|
10
|
+
* application and passed around through some dependency injection mechanism to
|
|
11
|
+
* parts of an application that need to make SDK calls.
|
|
12
|
+
*/
|
|
13
|
+
export class DetentSDKCore extends ClientSDK {}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { DetentSDKCore } from "../core.js";
|
|
7
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { DetentSDKError } from "../models/errors/detent-sdk-error.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/http-client-errors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Parse CI/build logs into structured diagnostics
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Extracts structured error and warning information from raw CI/build log output.
|
|
33
|
+
*
|
|
34
|
+
* Supports auto-detection of common tools (ESLint, TypeScript, Vitest, Cargo, golangci-lint) or accepts a hint via the `tool` parameter.
|
|
35
|
+
*
|
|
36
|
+
* Returns parsed diagnostics with file locations, severity, and tool-specific metadata.
|
|
37
|
+
*
|
|
38
|
+
* **Note:** Sensitive data (API keys, tokens, credentials) detected in the output is automatically redacted for security.
|
|
39
|
+
*/
|
|
40
|
+
export function diagnosticsCreate(
|
|
41
|
+
client: DetentSDKCore,
|
|
42
|
+
request: models.DiagnosticsRequest,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): APIPromise<
|
|
45
|
+
Result<
|
|
46
|
+
models.DiagnosticsResponse,
|
|
47
|
+
| errors.ErrorResponse
|
|
48
|
+
| errors.RateLimitError
|
|
49
|
+
| DetentSDKError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: DetentSDKCore,
|
|
68
|
+
request: models.DiagnosticsRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
models.DiagnosticsResponse,
|
|
74
|
+
| errors.ErrorResponse
|
|
75
|
+
| errors.RateLimitError
|
|
76
|
+
| DetentSDKError
|
|
77
|
+
| ResponseValidationError
|
|
78
|
+
| ConnectionError
|
|
79
|
+
| RequestAbortedError
|
|
80
|
+
| RequestTimeoutError
|
|
81
|
+
| InvalidRequestError
|
|
82
|
+
| UnexpectedClientError
|
|
83
|
+
| SDKValidationError
|
|
84
|
+
>,
|
|
85
|
+
APICall,
|
|
86
|
+
]
|
|
87
|
+
> {
|
|
88
|
+
const parsed = safeParse(
|
|
89
|
+
request,
|
|
90
|
+
(value) => z.parse(models.DiagnosticsRequest$outboundSchema, value),
|
|
91
|
+
"Input validation failed",
|
|
92
|
+
);
|
|
93
|
+
if (!parsed.ok) {
|
|
94
|
+
return [parsed, { status: "invalid" }];
|
|
95
|
+
}
|
|
96
|
+
const payload = parsed.value;
|
|
97
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
98
|
+
|
|
99
|
+
const path = pathToFunc("/v1/diagnostics")();
|
|
100
|
+
|
|
101
|
+
const headers = new Headers(compactMap({
|
|
102
|
+
"Content-Type": "application/json",
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const context = {
|
|
107
|
+
options: client._options,
|
|
108
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
109
|
+
operationID: "post_/v1/diagnostics",
|
|
110
|
+
oAuth2Scopes: null,
|
|
111
|
+
|
|
112
|
+
resolvedSecurity: null,
|
|
113
|
+
|
|
114
|
+
securitySource: null,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const requestRes = client._createRequest(context, {
|
|
122
|
+
method: "POST",
|
|
123
|
+
baseURL: options?.serverURL,
|
|
124
|
+
path: path,
|
|
125
|
+
headers: headers,
|
|
126
|
+
body: body,
|
|
127
|
+
userAgent: client._options.userAgent,
|
|
128
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
129
|
+
}, options);
|
|
130
|
+
if (!requestRes.ok) {
|
|
131
|
+
return [requestRes, { status: "invalid" }];
|
|
132
|
+
}
|
|
133
|
+
const req = requestRes.value;
|
|
134
|
+
|
|
135
|
+
const doResult = await client._do(req, {
|
|
136
|
+
context,
|
|
137
|
+
errorCodes: ["400", "429", "4XX", "5XX"],
|
|
138
|
+
retryConfig: context.retryConfig,
|
|
139
|
+
retryCodes: context.retryCodes,
|
|
140
|
+
});
|
|
141
|
+
if (!doResult.ok) {
|
|
142
|
+
return [doResult, { status: "request-error", request: req }];
|
|
143
|
+
}
|
|
144
|
+
const response = doResult.value;
|
|
145
|
+
|
|
146
|
+
const responseFields = {
|
|
147
|
+
HttpMeta: { Response: response, Request: req },
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
models.DiagnosticsResponse,
|
|
152
|
+
| errors.ErrorResponse
|
|
153
|
+
| errors.RateLimitError
|
|
154
|
+
| DetentSDKError
|
|
155
|
+
| ResponseValidationError
|
|
156
|
+
| ConnectionError
|
|
157
|
+
| RequestAbortedError
|
|
158
|
+
| RequestTimeoutError
|
|
159
|
+
| InvalidRequestError
|
|
160
|
+
| UnexpectedClientError
|
|
161
|
+
| SDKValidationError
|
|
162
|
+
>(
|
|
163
|
+
M.json(200, models.DiagnosticsResponse$inboundSchema),
|
|
164
|
+
M.jsonErr(400, errors.ErrorResponse$inboundSchema),
|
|
165
|
+
M.jsonErr(429, errors.RateLimitError$inboundSchema),
|
|
166
|
+
M.fail("4XX"),
|
|
167
|
+
M.fail("5XX"),
|
|
168
|
+
)(response, req, { extraFields: responseFields });
|
|
169
|
+
if (!result.ok) {
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKOptions } from "../lib/config.js";
|
|
6
|
+
import { RequestInput } from "../lib/http.js";
|
|
7
|
+
import {
|
|
8
|
+
AfterErrorContext,
|
|
9
|
+
AfterErrorHook,
|
|
10
|
+
AfterSuccessContext,
|
|
11
|
+
AfterSuccessHook,
|
|
12
|
+
BeforeCreateRequestContext,
|
|
13
|
+
BeforeCreateRequestHook,
|
|
14
|
+
BeforeRequestContext,
|
|
15
|
+
BeforeRequestHook,
|
|
16
|
+
Hook,
|
|
17
|
+
Hooks,
|
|
18
|
+
SDKInitHook,
|
|
19
|
+
} from "./types.js";
|
|
20
|
+
|
|
21
|
+
import { initHooks } from "./registration.js";
|
|
22
|
+
|
|
23
|
+
export class SDKHooks implements Hooks {
|
|
24
|
+
sdkInitHooks: SDKInitHook[] = [];
|
|
25
|
+
beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
|
|
26
|
+
beforeRequestHooks: BeforeRequestHook[] = [];
|
|
27
|
+
afterSuccessHooks: AfterSuccessHook[] = [];
|
|
28
|
+
afterErrorHooks: AfterErrorHook[] = [];
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
const presetHooks: Array<Hook> = [];
|
|
32
|
+
|
|
33
|
+
for (const hook of presetHooks) {
|
|
34
|
+
if ("sdkInit" in hook) {
|
|
35
|
+
this.registerSDKInitHook(hook);
|
|
36
|
+
}
|
|
37
|
+
if ("beforeCreateRequest" in hook) {
|
|
38
|
+
this.registerBeforeCreateRequestHook(hook);
|
|
39
|
+
}
|
|
40
|
+
if ("beforeRequest" in hook) {
|
|
41
|
+
this.registerBeforeRequestHook(hook);
|
|
42
|
+
}
|
|
43
|
+
if ("afterSuccess" in hook) {
|
|
44
|
+
this.registerAfterSuccessHook(hook);
|
|
45
|
+
}
|
|
46
|
+
if ("afterError" in hook) {
|
|
47
|
+
this.registerAfterErrorHook(hook);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
initHooks(this);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
registerSDKInitHook(hook: SDKInitHook) {
|
|
54
|
+
this.sdkInitHooks.push(hook);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) {
|
|
58
|
+
this.beforeCreateRequestHooks.push(hook);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
registerBeforeRequestHook(hook: BeforeRequestHook) {
|
|
62
|
+
this.beforeRequestHooks.push(hook);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
registerAfterSuccessHook(hook: AfterSuccessHook) {
|
|
66
|
+
this.afterSuccessHooks.push(hook);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
registerAfterErrorHook(hook: AfterErrorHook) {
|
|
70
|
+
this.afterErrorHooks.push(hook);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
sdkInit(opts: SDKOptions): SDKOptions {
|
|
74
|
+
return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
beforeCreateRequest(
|
|
78
|
+
hookCtx: BeforeCreateRequestContext,
|
|
79
|
+
input: RequestInput,
|
|
80
|
+
): RequestInput {
|
|
81
|
+
let inp = input;
|
|
82
|
+
|
|
83
|
+
for (const hook of this.beforeCreateRequestHooks) {
|
|
84
|
+
inp = hook.beforeCreateRequest(hookCtx, inp);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return inp;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async beforeRequest(
|
|
91
|
+
hookCtx: BeforeRequestContext,
|
|
92
|
+
request: Request,
|
|
93
|
+
): Promise<Request> {
|
|
94
|
+
let req = request;
|
|
95
|
+
|
|
96
|
+
for (const hook of this.beforeRequestHooks) {
|
|
97
|
+
req = await hook.beforeRequest(hookCtx, req);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return req;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async afterSuccess(
|
|
104
|
+
hookCtx: AfterSuccessContext,
|
|
105
|
+
response: Response,
|
|
106
|
+
): Promise<Response> {
|
|
107
|
+
let res = response;
|
|
108
|
+
|
|
109
|
+
for (const hook of this.afterSuccessHooks) {
|
|
110
|
+
res = await hook.afterSuccess(hookCtx, res);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return res;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async afterError(
|
|
117
|
+
hookCtx: AfterErrorContext,
|
|
118
|
+
response: Response | null,
|
|
119
|
+
error: unknown,
|
|
120
|
+
): Promise<{ response: Response | null; error: unknown }> {
|
|
121
|
+
let res = response;
|
|
122
|
+
let err = error;
|
|
123
|
+
|
|
124
|
+
for (const hook of this.afterErrorHooks) {
|
|
125
|
+
const result = await hook.afterError(hookCtx, res, err);
|
|
126
|
+
res = result.response;
|
|
127
|
+
err = result.error;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return { response: res, error: err };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Hooks } from "./types.js";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* This file is only ever generated once on the first generation and then is free to be modified.
|
|
5
|
+
* Any hooks you wish to add should be registered in the initHooks function. Feel free to define them
|
|
6
|
+
* in this file or in separate files in the hooks folder.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// @ts-expect-error remove this line when you add your first hook and hooks is used
|
|
10
|
+
export function initHooks(hooks: Hooks) {
|
|
11
|
+
// Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook
|
|
12
|
+
// with an instance of a hook that implements that specific Hook interface
|
|
13
|
+
// Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
|
|
14
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKOptions } from "../lib/config.js";
|
|
6
|
+
import { RequestInput } from "../lib/http.js";
|
|
7
|
+
import { RetryConfig } from "../lib/retries.js";
|
|
8
|
+
import { SecurityState } from "../lib/security.js";
|
|
9
|
+
|
|
10
|
+
export type HookContext = {
|
|
11
|
+
baseURL: string | URL;
|
|
12
|
+
operationID: string;
|
|
13
|
+
oAuth2Scopes: string[] | null;
|
|
14
|
+
securitySource?: any | (() => Promise<any>);
|
|
15
|
+
retryConfig: RetryConfig;
|
|
16
|
+
resolvedSecurity: SecurityState | null;
|
|
17
|
+
options: SDKOptions;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type Awaitable<T> = T | Promise<T>;
|
|
21
|
+
|
|
22
|
+
export type BeforeCreateRequestContext = HookContext & {};
|
|
23
|
+
export type BeforeRequestContext = HookContext & {};
|
|
24
|
+
export type AfterSuccessContext = HookContext & {};
|
|
25
|
+
export type AfterErrorContext = HookContext & {};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* SDKInitHook is called when the SDK is initializing. The
|
|
29
|
+
* hook can return a new baseURL and HTTP client to be used by the SDK.
|
|
30
|
+
*/
|
|
31
|
+
export interface SDKInitHook {
|
|
32
|
+
sdkInit: (opts: SDKOptions) => SDKOptions;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface BeforeCreateRequestHook {
|
|
36
|
+
/**
|
|
37
|
+
* A hook that is called before the SDK creates a `Request` object. The hook
|
|
38
|
+
* can modify how a request is constructed since certain modifications, like
|
|
39
|
+
* changing the request URL, cannot be done on a request object directly.
|
|
40
|
+
*/
|
|
41
|
+
beforeCreateRequest: (
|
|
42
|
+
hookCtx: BeforeCreateRequestContext,
|
|
43
|
+
input: RequestInput,
|
|
44
|
+
) => RequestInput;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface BeforeRequestHook {
|
|
48
|
+
/**
|
|
49
|
+
* A hook that is called before the SDK sends a request. The hook can
|
|
50
|
+
* introduce instrumentation code such as logging, tracing and metrics or
|
|
51
|
+
* replace the request before it is sent or throw an error to stop the
|
|
52
|
+
* request from being sent.
|
|
53
|
+
*/
|
|
54
|
+
beforeRequest: (
|
|
55
|
+
hookCtx: BeforeRequestContext,
|
|
56
|
+
request: Request,
|
|
57
|
+
) => Awaitable<Request>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface AfterSuccessHook {
|
|
61
|
+
/**
|
|
62
|
+
* A hook that is called after the SDK receives a response. The hook can
|
|
63
|
+
* introduce instrumentation code such as logging, tracing and metrics or
|
|
64
|
+
* modify the response before it is handled or throw an error to stop the
|
|
65
|
+
* response from being handled.
|
|
66
|
+
*/
|
|
67
|
+
afterSuccess: (
|
|
68
|
+
hookCtx: AfterSuccessContext,
|
|
69
|
+
response: Response,
|
|
70
|
+
) => Awaitable<Response>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface AfterErrorHook {
|
|
74
|
+
/**
|
|
75
|
+
* A hook that is called after the SDK encounters an error, or a
|
|
76
|
+
* non-successful response. The hook can introduce instrumentation code such
|
|
77
|
+
* as logging, tracing and metrics or modify the response or error values.
|
|
78
|
+
*/
|
|
79
|
+
afterError: (
|
|
80
|
+
hookCtx: AfterErrorContext,
|
|
81
|
+
response: Response | null,
|
|
82
|
+
error: unknown,
|
|
83
|
+
) => Awaitable<{
|
|
84
|
+
response: Response | null;
|
|
85
|
+
error: unknown;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Hooks {
|
|
90
|
+
/** Registers a hook to be used by the SDK for initialization event. */
|
|
91
|
+
registerSDKInitHook(hook: SDKInitHook): void;
|
|
92
|
+
/** Registers a hook to be used by the SDK for to modify `Request` construction. */
|
|
93
|
+
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
|
|
94
|
+
/** Registers a hook to be used by the SDK for the before request event. */
|
|
95
|
+
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
|
96
|
+
/** Registers a hook to be used by the SDK for the after success event. */
|
|
97
|
+
registerAfterSuccessHook(hook: AfterSuccessHook): void;
|
|
98
|
+
/** Registers a hook to be used by the SDK for the after error event. */
|
|
99
|
+
registerAfterErrorHook(hook: AfterErrorHook): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type Hook =
|
|
103
|
+
| SDKInitHook
|
|
104
|
+
| BeforeCreateRequestHook
|
|
105
|
+
| BeforeRequestHook
|
|
106
|
+
| AfterSuccessHook
|
|
107
|
+
| AfterErrorHook;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from "./lib/config.js";
|
|
6
|
+
export * as files from "./lib/files.js";
|
|
7
|
+
export { HTTPClient } from "./lib/http.js";
|
|
8
|
+
export type { Fetcher, HTTPClientOptions } from "./lib/http.js";
|
|
9
|
+
export * from "./sdk/sdk.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export function bytesToBase64(u8arr: Uint8Array): string {
|
|
8
|
+
return btoa(String.fromCodePoint(...u8arr));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function bytesFromBase64(encoded: string): Uint8Array {
|
|
12
|
+
return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function stringToBytes(str: string): Uint8Array {
|
|
16
|
+
return new TextEncoder().encode(str);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function stringFromBytes(u8arr: Uint8Array): string {
|
|
20
|
+
return new TextDecoder().decode(u8arr);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function stringToBase64(str: string): string {
|
|
24
|
+
return bytesToBase64(stringToBytes(str));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function stringFromBase64(b64str: string): string {
|
|
28
|
+
return stringFromBytes(bytesFromBase64(b64str));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const zodOutbound = z.union([
|
|
32
|
+
z.custom<Uint8Array>(x => x instanceof Uint8Array),
|
|
33
|
+
z.pipe(z.string(), z.transform(stringToBytes)),
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
export const zodInbound = z.union([
|
|
37
|
+
z.custom<Uint8Array>(x => x instanceof Uint8Array),
|
|
38
|
+
z.pipe(z.string(), z.transform(bytesFromBase64)),
|
|
39
|
+
]);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { HTTPClient } from "./http.js";
|
|
6
|
+
import { Logger } from "./logger.js";
|
|
7
|
+
import { RetryConfig } from "./retries.js";
|
|
8
|
+
import { Params, pathToFunc } from "./url.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Contains the list of servers available to the SDK
|
|
12
|
+
*/
|
|
13
|
+
export const ServerList = [
|
|
14
|
+
/**
|
|
15
|
+
* Production
|
|
16
|
+
*/
|
|
17
|
+
"https://backend.detent.sh",
|
|
18
|
+
/**
|
|
19
|
+
* Local development
|
|
20
|
+
*/
|
|
21
|
+
"http://localhost:8787",
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
export type SDKOptions = {
|
|
25
|
+
httpClient?: HTTPClient;
|
|
26
|
+
/**
|
|
27
|
+
* Allows overriding the default server used by the SDK
|
|
28
|
+
*/
|
|
29
|
+
serverIdx?: number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Allows overriding the default server URL used by the SDK
|
|
32
|
+
*/
|
|
33
|
+
serverURL?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Allows overriding the default user agent used by the SDK
|
|
36
|
+
*/
|
|
37
|
+
userAgent?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Allows overriding the default retry config used by the SDK
|
|
40
|
+
*/
|
|
41
|
+
retryConfig?: RetryConfig;
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
debugLogger?: Logger;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
47
|
+
let serverURL = options.serverURL;
|
|
48
|
+
|
|
49
|
+
const params: Params = {};
|
|
50
|
+
|
|
51
|
+
if (!serverURL) {
|
|
52
|
+
const serverIdx = options.serverIdx ?? 0;
|
|
53
|
+
if (serverIdx < 0 || serverIdx >= ServerList.length) {
|
|
54
|
+
throw new Error(`Invalid server index ${serverIdx}`);
|
|
55
|
+
}
|
|
56
|
+
serverURL = ServerList[serverIdx] || "";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const u = pathToFunc(serverURL)(params);
|
|
60
|
+
return new URL(u);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const SDK_METADATA = {
|
|
64
|
+
language: "typescript",
|
|
65
|
+
openapiDocVersion: "1.0.0",
|
|
66
|
+
sdkVersion: "0.1.0",
|
|
67
|
+
genVersion: "2.801.0",
|
|
68
|
+
userAgent: "speakeasy-sdk/typescript 0.1.0 2.801.0 1.0.0 @detent/sdk",
|
|
69
|
+
} as const;
|