@detent/sdk 0.1.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/FUNCTIONS.md +87 -0
- package/README.md +413 -0
- package/RUNTIMES.md +48 -0
- package/_speakeasy/.github/action-inputs-config.json +53 -0
- package/_speakeasy/.github/action-security-config.json +88 -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/package-lock.json +611 -0
- package/examples/package.json +18 -0
- package/jsr.json +27 -0
- package/package.json +114 -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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { DetentSDKError } from "./detent-sdk-error.js";
|
|
6
|
+
|
|
7
|
+
/** The fallback error class if no more specific error class is matched */
|
|
8
|
+
export class DetentSDKDefaultError extends DetentSDKError {
|
|
9
|
+
constructor(
|
|
10
|
+
message: string,
|
|
11
|
+
httpMeta: {
|
|
12
|
+
response: Response;
|
|
13
|
+
request: Request;
|
|
14
|
+
body: string;
|
|
15
|
+
},
|
|
16
|
+
) {
|
|
17
|
+
if (message) {
|
|
18
|
+
message += `: `;
|
|
19
|
+
}
|
|
20
|
+
message += `Status ${httpMeta.response.status}`;
|
|
21
|
+
const contentType = httpMeta.response.headers.get("content-type") || `""`;
|
|
22
|
+
if (contentType !== "application/json") {
|
|
23
|
+
message += ` Content-Type ${
|
|
24
|
+
contentType.includes(" ") ? `"${contentType}"` : contentType
|
|
25
|
+
}`;
|
|
26
|
+
}
|
|
27
|
+
const body = httpMeta.body || `""`;
|
|
28
|
+
message += body.length > 100 ? "\n" : ". ";
|
|
29
|
+
let bodyDisplay = body;
|
|
30
|
+
if (body.length > 10000) {
|
|
31
|
+
const truncated = body.substring(0, 10000);
|
|
32
|
+
const remaining = body.length - 10000;
|
|
33
|
+
bodyDisplay = `${truncated}...and ${remaining} more chars`;
|
|
34
|
+
}
|
|
35
|
+
message += `Body: ${bodyDisplay}`;
|
|
36
|
+
message = message.trim();
|
|
37
|
+
super(message, httpMeta);
|
|
38
|
+
this.name = "DetentSDKDefaultError";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** The base class for all HTTP error responses */
|
|
6
|
+
export class DetentSDKError extends Error {
|
|
7
|
+
/** HTTP status code */
|
|
8
|
+
public readonly statusCode: number;
|
|
9
|
+
/** HTTP body */
|
|
10
|
+
public readonly body: string;
|
|
11
|
+
/** HTTP headers */
|
|
12
|
+
public readonly headers: Headers;
|
|
13
|
+
/** HTTP content type */
|
|
14
|
+
public readonly contentType: string;
|
|
15
|
+
/** Raw response */
|
|
16
|
+
public readonly rawResponse: Response;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
message: string,
|
|
20
|
+
httpMeta: {
|
|
21
|
+
response: Response;
|
|
22
|
+
request: Request;
|
|
23
|
+
body: string;
|
|
24
|
+
},
|
|
25
|
+
) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.statusCode = httpMeta.response.status;
|
|
28
|
+
this.body = httpMeta.body;
|
|
29
|
+
this.headers = httpMeta.response.headers;
|
|
30
|
+
this.contentType = httpMeta.response.headers.get("content-type") || "";
|
|
31
|
+
this.rawResponse = httpMeta.response;
|
|
32
|
+
|
|
33
|
+
this.name = "DetentSDKError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as types from "../../types/primitives.js";
|
|
7
|
+
import { DetentSDKError } from "./detent-sdk-error.js";
|
|
8
|
+
|
|
9
|
+
export type ErrorResponseData = {
|
|
10
|
+
/**
|
|
11
|
+
* Error message
|
|
12
|
+
*/
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export class ErrorResponse extends DetentSDKError {
|
|
17
|
+
/**
|
|
18
|
+
* Error message
|
|
19
|
+
*/
|
|
20
|
+
error: string;
|
|
21
|
+
|
|
22
|
+
/** The original data that was passed to this error instance. */
|
|
23
|
+
data$: ErrorResponseData;
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
err: ErrorResponseData,
|
|
27
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
28
|
+
) {
|
|
29
|
+
const message = "message" in err && typeof err.message === "string"
|
|
30
|
+
? err.message
|
|
31
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
32
|
+
super(message, httpMeta);
|
|
33
|
+
this.data$ = err;
|
|
34
|
+
this.error = err.error;
|
|
35
|
+
|
|
36
|
+
this.name = "ErrorResponse";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ErrorResponse$inboundSchema: z.ZodMiniType<
|
|
42
|
+
ErrorResponse,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.pipe(
|
|
45
|
+
z.object({
|
|
46
|
+
error: types.string(),
|
|
47
|
+
request$: z.custom<Request>(x => x instanceof Request),
|
|
48
|
+
response$: z.custom<Response>(x => x instanceof Response),
|
|
49
|
+
body$: z.string(),
|
|
50
|
+
}),
|
|
51
|
+
z.transform((v) => {
|
|
52
|
+
return new ErrorResponse(v, {
|
|
53
|
+
request: v.request$,
|
|
54
|
+
response: v.response$,
|
|
55
|
+
body: v.body$,
|
|
56
|
+
});
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all HTTP errors.
|
|
7
|
+
*/
|
|
8
|
+
export class HTTPClientError extends Error {
|
|
9
|
+
/** The underlying cause of the error. */
|
|
10
|
+
override readonly cause: unknown;
|
|
11
|
+
override name = "HTTPClientError";
|
|
12
|
+
constructor(message: string, opts?: { cause?: unknown }) {
|
|
13
|
+
let msg = message;
|
|
14
|
+
if (opts?.cause) {
|
|
15
|
+
msg += `: ${opts.cause}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
super(msg, opts);
|
|
19
|
+
// In older runtimes, the cause field would not have been assigned through
|
|
20
|
+
// the super() call.
|
|
21
|
+
if (typeof this.cause === "undefined") {
|
|
22
|
+
this.cause = opts?.cause;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An error to capture unrecognised or unexpected errors when making HTTP calls.
|
|
29
|
+
*/
|
|
30
|
+
export class UnexpectedClientError extends HTTPClientError {
|
|
31
|
+
override name = "UnexpectedClientError";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* An error that is raised when any inputs used to create a request are invalid.
|
|
36
|
+
*/
|
|
37
|
+
export class InvalidRequestError extends HTTPClientError {
|
|
38
|
+
override name = "InvalidRequestError";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An error that is raised when a HTTP request was aborted by the client error.
|
|
43
|
+
*/
|
|
44
|
+
export class RequestAbortedError extends HTTPClientError {
|
|
45
|
+
override readonly name = "RequestAbortedError";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An error that is raised when a HTTP request timed out due to an AbortSignal
|
|
50
|
+
* signal timeout.
|
|
51
|
+
*/
|
|
52
|
+
export class RequestTimeoutError extends HTTPClientError {
|
|
53
|
+
override readonly name = "RequestTimeoutError";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* An error that is raised when a HTTP client is unable to make a request to
|
|
58
|
+
* a server.
|
|
59
|
+
*/
|
|
60
|
+
export class ConnectionError extends HTTPClientError {
|
|
61
|
+
override readonly name = "ConnectionError";
|
|
62
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from "./detent-sdk-default-error.js";
|
|
6
|
+
export * from "./detent-sdk-error.js";
|
|
7
|
+
export * from "./error-response.js";
|
|
8
|
+
export * from "./http-client-errors.js";
|
|
9
|
+
export * from "./rate-limit-error.js";
|
|
10
|
+
export * from "./response-validation-error.js";
|
|
11
|
+
export * from "./sdk-validation-error.js";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as types from "../../types/primitives.js";
|
|
7
|
+
import { DetentSDKError } from "./detent-sdk-error.js";
|
|
8
|
+
|
|
9
|
+
export type RateLimitErrorData = {
|
|
10
|
+
/**
|
|
11
|
+
* Rate limit error message
|
|
12
|
+
*/
|
|
13
|
+
error: string;
|
|
14
|
+
/**
|
|
15
|
+
* Unix timestamp when the rate limit resets
|
|
16
|
+
*/
|
|
17
|
+
retryAfter: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export class RateLimitError extends DetentSDKError {
|
|
21
|
+
/**
|
|
22
|
+
* Rate limit error message
|
|
23
|
+
*/
|
|
24
|
+
error: string;
|
|
25
|
+
/**
|
|
26
|
+
* Unix timestamp when the rate limit resets
|
|
27
|
+
*/
|
|
28
|
+
retryAfter: number;
|
|
29
|
+
|
|
30
|
+
/** The original data that was passed to this error instance. */
|
|
31
|
+
data$: RateLimitErrorData;
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
err: RateLimitErrorData,
|
|
35
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
36
|
+
) {
|
|
37
|
+
const message = "message" in err && typeof err.message === "string"
|
|
38
|
+
? err.message
|
|
39
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
40
|
+
super(message, httpMeta);
|
|
41
|
+
this.data$ = err;
|
|
42
|
+
this.error = err.error;
|
|
43
|
+
this.retryAfter = err.retryAfter;
|
|
44
|
+
|
|
45
|
+
this.name = "RateLimitError";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const RateLimitError$inboundSchema: z.ZodMiniType<
|
|
51
|
+
RateLimitError,
|
|
52
|
+
unknown
|
|
53
|
+
> = z.pipe(
|
|
54
|
+
z.object({
|
|
55
|
+
error: types.string(),
|
|
56
|
+
retryAfter: types.number(),
|
|
57
|
+
request$: z.custom<Request>(x => x instanceof Request),
|
|
58
|
+
response$: z.custom<Response>(x => x instanceof Response),
|
|
59
|
+
body$: z.string(),
|
|
60
|
+
}),
|
|
61
|
+
z.transform((v) => {
|
|
62
|
+
return new RateLimitError(v, {
|
|
63
|
+
request: v.request$,
|
|
64
|
+
response: v.response$,
|
|
65
|
+
body: v.body$,
|
|
66
|
+
});
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4/core";
|
|
6
|
+
import { DetentSDKError } from "./detent-sdk-error.js";
|
|
7
|
+
import { formatZodError } from "./sdk-validation-error.js";
|
|
8
|
+
|
|
9
|
+
export class ResponseValidationError extends DetentSDKError {
|
|
10
|
+
/**
|
|
11
|
+
* The raw value that failed validation.
|
|
12
|
+
*/
|
|
13
|
+
public readonly rawValue: unknown;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The raw message that failed validation.
|
|
17
|
+
*/
|
|
18
|
+
public readonly rawMessage: unknown;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
message: string,
|
|
22
|
+
extra: {
|
|
23
|
+
response: Response;
|
|
24
|
+
request: Request;
|
|
25
|
+
body: string;
|
|
26
|
+
cause: unknown;
|
|
27
|
+
rawValue: unknown;
|
|
28
|
+
rawMessage: unknown;
|
|
29
|
+
},
|
|
30
|
+
) {
|
|
31
|
+
super(message, extra);
|
|
32
|
+
this.name = "ResponseValidationError";
|
|
33
|
+
this.cause = extra.cause;
|
|
34
|
+
this.rawValue = extra.rawValue;
|
|
35
|
+
this.rawMessage = extra.rawMessage;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return a pretty-formatted error message if the underlying validation error
|
|
40
|
+
* is a ZodError or some other recognized error type, otherwise return the
|
|
41
|
+
* default error message.
|
|
42
|
+
*/
|
|
43
|
+
public pretty(): string {
|
|
44
|
+
if (this.cause instanceof z.$ZodError) {
|
|
45
|
+
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
|
|
46
|
+
} else {
|
|
47
|
+
return this.toString();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4/core";
|
|
6
|
+
|
|
7
|
+
export class SDKValidationError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* The raw value that failed validation.
|
|
10
|
+
*/
|
|
11
|
+
public readonly rawValue: unknown;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The raw message that failed validation.
|
|
15
|
+
*/
|
|
16
|
+
public readonly rawMessage: unknown;
|
|
17
|
+
|
|
18
|
+
// Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
|
|
19
|
+
static override [Symbol.hasInstance](
|
|
20
|
+
instance: unknown,
|
|
21
|
+
): instance is SDKValidationError {
|
|
22
|
+
if (!(instance instanceof Error)) return false;
|
|
23
|
+
if (!("rawValue" in instance)) return false;
|
|
24
|
+
if (!("rawMessage" in instance)) return false;
|
|
25
|
+
if (!("pretty" in instance)) return false;
|
|
26
|
+
if (typeof instance.pretty !== "function") return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
constructor(message: string, cause: unknown, rawValue: unknown) {
|
|
31
|
+
super(`${message}: ${cause}`);
|
|
32
|
+
this.name = "SDKValidationError";
|
|
33
|
+
this.cause = cause;
|
|
34
|
+
this.rawValue = rawValue;
|
|
35
|
+
this.rawMessage = message;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return a pretty-formatted error message if the underlying validation error
|
|
40
|
+
* is a ZodError or some other recognized error type, otherwise return the
|
|
41
|
+
* default error message.
|
|
42
|
+
*/
|
|
43
|
+
public pretty(): string {
|
|
44
|
+
if (this.cause instanceof z.$ZodError) {
|
|
45
|
+
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
|
|
46
|
+
} else {
|
|
47
|
+
return this.toString();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function formatZodError(err: z.$ZodError): string {
|
|
53
|
+
return z.prettifyError(err);
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from "./detected-tool.js";
|
|
6
|
+
export * from "./diagnostic-lite.js";
|
|
7
|
+
export * from "./diagnostic-summary.js";
|
|
8
|
+
export * from "./diagnostic.js";
|
|
9
|
+
export * from "./diagnostics-request.js";
|
|
10
|
+
export * from "./diagnostics-response-full.js";
|
|
11
|
+
export * from "./diagnostics-response-lite.js";
|
|
12
|
+
export * from "./diagnostics-response.js";
|
|
13
|
+
export * from "./mode-enum.js";
|
|
14
|
+
export * from "./severity.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Response detail level. 'full' includes severity, ruleId, suggestions. 'lite' is minimal.
|
|
10
|
+
*/
|
|
11
|
+
export const ModeEnum = {
|
|
12
|
+
Full: "full",
|
|
13
|
+
Lite: "lite",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* Response detail level. 'full' includes severity, ruleId, suggestions. 'lite' is minimal.
|
|
17
|
+
*/
|
|
18
|
+
export type ModeEnum = ClosedEnum<typeof ModeEnum>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const ModeEnum$outboundSchema: z.ZodMiniEnum<typeof ModeEnum> = z.enum(
|
|
22
|
+
ModeEnum,
|
|
23
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../types/enums.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Issue severity level
|
|
11
|
+
*/
|
|
12
|
+
export const Severity = {
|
|
13
|
+
Error: "error",
|
|
14
|
+
Warning: "warning",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Issue severity level
|
|
18
|
+
*/
|
|
19
|
+
export type Severity = OpenEnum<typeof Severity>;
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const Severity$inboundSchema: z.ZodMiniType<Severity, unknown> =
|
|
23
|
+
openEnums.inboundSchema(Severity);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { diagnosticsCreate } from "../funcs/diagnostics-create.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as models from "../models/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class Diagnostics extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Parse CI/build logs into structured diagnostics
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Extracts structured error and warning information from raw CI/build log output.
|
|
16
|
+
*
|
|
17
|
+
* Supports auto-detection of common tools (ESLint, TypeScript, Vitest, Cargo, golangci-lint) or accepts a hint via the `tool` parameter.
|
|
18
|
+
*
|
|
19
|
+
* Returns parsed diagnostics with file locations, severity, and tool-specific metadata.
|
|
20
|
+
*
|
|
21
|
+
* **Note:** Sensitive data (API keys, tokens, credentials) detected in the output is automatically redacted for security.
|
|
22
|
+
*/
|
|
23
|
+
async create(
|
|
24
|
+
request: models.DiagnosticsRequest,
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): Promise<models.DiagnosticsResponse> {
|
|
27
|
+
return unwrapAsync(diagnosticsCreate(
|
|
28
|
+
this,
|
|
29
|
+
request,
|
|
30
|
+
options,
|
|
31
|
+
));
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/sdk/index.ts
ADDED
package/src/sdk/sdk.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
|
+
import { Diagnostics } from "./diagnostics.js";
|
|
7
|
+
|
|
8
|
+
export class DetentSDK extends ClientSDK {
|
|
9
|
+
private _diagnostics?: Diagnostics;
|
|
10
|
+
get diagnostics(): Diagnostics {
|
|
11
|
+
return (this._diagnostics ??= new Diagnostics(this._options));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type APICall =
|
|
6
|
+
| {
|
|
7
|
+
status: "complete";
|
|
8
|
+
request: Request;
|
|
9
|
+
response: Response;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
status: "request-error";
|
|
13
|
+
request: Request;
|
|
14
|
+
response?: undefined;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
status: "invalid";
|
|
18
|
+
request?: undefined;
|
|
19
|
+
response?: undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class APIPromise<T> implements Promise<T> {
|
|
23
|
+
readonly #promise: Promise<[T, APICall]>;
|
|
24
|
+
readonly #unwrapped: Promise<T>;
|
|
25
|
+
|
|
26
|
+
readonly [Symbol.toStringTag] = "APIPromise";
|
|
27
|
+
|
|
28
|
+
constructor(p: [T, APICall] | Promise<[T, APICall]>) {
|
|
29
|
+
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
30
|
+
this.#unwrapped =
|
|
31
|
+
p instanceof Promise
|
|
32
|
+
? this.#promise.then(([value]) => value)
|
|
33
|
+
: Promise.resolve(p[0]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
then<TResult1 = T, TResult2 = never>(
|
|
37
|
+
onfulfilled?:
|
|
38
|
+
| ((value: T) => TResult1 | PromiseLike<TResult1>)
|
|
39
|
+
| null
|
|
40
|
+
| undefined,
|
|
41
|
+
onrejected?:
|
|
42
|
+
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
|
|
43
|
+
| null
|
|
44
|
+
| undefined,
|
|
45
|
+
): Promise<TResult1 | TResult2> {
|
|
46
|
+
return this.#promise.then(
|
|
47
|
+
onfulfilled ? ([value]) => onfulfilled(value) : void 0,
|
|
48
|
+
onrejected,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
catch<TResult = never>(
|
|
53
|
+
onrejected?:
|
|
54
|
+
| ((reason: any) => TResult | PromiseLike<TResult>)
|
|
55
|
+
| null
|
|
56
|
+
| undefined,
|
|
57
|
+
): Promise<T | TResult> {
|
|
58
|
+
return this.#unwrapped.catch(onrejected);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
|
|
62
|
+
return this.#unwrapped.finally(onfinally);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
$inspect(): Promise<[T, APICall]> {
|
|
66
|
+
return this.#promise;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 const blobLikeSchema: z.ZodMiniType<Blob, Blob> = z.custom<Blob>(
|
|
8
|
+
isBlobLike,
|
|
9
|
+
{
|
|
10
|
+
message: "expected a Blob, File or Blob-like object",
|
|
11
|
+
abort: true,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export function isBlobLike(val: unknown): val is Blob {
|
|
16
|
+
if (val instanceof Blob) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const name = val[Symbol.toStringTag];
|
|
25
|
+
if (typeof name !== "string") {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (name !== "Blob" && name !== "File") {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return "stream" in val && typeof val.stream === "function";
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 constDateTime(
|
|
8
|
+
val: string,
|
|
9
|
+
): z.ZodMiniType<string, unknown> {
|
|
10
|
+
return z.custom<string>((v) => {
|
|
11
|
+
return (
|
|
12
|
+
typeof v === "string" && new Date(v).getTime() === new Date(val).getTime()
|
|
13
|
+
);
|
|
14
|
+
}, `Value must be equivalent to ${val}`);
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { type Unrecognized, unrecognized } from "./unrecognized.js";
|
|
6
|
+
|
|
7
|
+
let globalCount = 0;
|
|
8
|
+
let refCount = 0;
|
|
9
|
+
|
|
10
|
+
export function defaultToZeroValue<T>(value: T): Unrecognized<T> {
|
|
11
|
+
globalCount++;
|
|
12
|
+
return unrecognized(value);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function startCountingDefaultToZeroValue() {
|
|
16
|
+
refCount++;
|
|
17
|
+
const start = globalCount;
|
|
18
|
+
return {
|
|
19
|
+
/**
|
|
20
|
+
* Ends counting and returns the delta.
|
|
21
|
+
* @param delta - If provided, only this amount is added to the parent counter
|
|
22
|
+
* (used for nested unions where we only want to record the winning option's count).
|
|
23
|
+
* If not provided, records all counts since start().
|
|
24
|
+
*/
|
|
25
|
+
end: (delta?: number) => {
|
|
26
|
+
const count = globalCount - start;
|
|
27
|
+
// Reset globalCount back to start, then add only the specified delta
|
|
28
|
+
globalCount = start + (delta ?? count);
|
|
29
|
+
if (--refCount === 0) globalCount = 0;
|
|
30
|
+
return count;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|