pulse-ts-sdk 0.0.51 → 0.0.52
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/dist/cjs/BaseClient.d.ts +39 -0
- package/dist/cjs/BaseClient.js +62 -0
- package/dist/cjs/Client.d.ts +57 -0
- package/dist/cjs/Client.js +189 -0
- package/dist/cjs/api/errors/BadRequestError.d.ts +5 -0
- package/dist/cjs/api/errors/BadRequestError.js +54 -0
- package/dist/cjs/api/errors/ForbiddenError.d.ts +5 -0
- package/dist/cjs/api/errors/ForbiddenError.js +54 -0
- package/dist/cjs/api/errors/InternalServerError.d.ts +5 -0
- package/dist/cjs/api/errors/InternalServerError.js +54 -0
- package/dist/cjs/api/errors/NotFoundError.d.ts +5 -0
- package/dist/cjs/api/errors/NotFoundError.js +54 -0
- package/dist/cjs/api/errors/TooManyRequestsError.d.ts +5 -0
- package/dist/cjs/api/errors/TooManyRequestsError.js +54 -0
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +5 -0
- package/dist/cjs/api/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +6 -0
- package/dist/cjs/api/errors/index.js +22 -0
- package/dist/cjs/api/index.d.ts +3 -0
- package/dist/cjs/api/index.js +19 -0
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +43 -0
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +53 -0
- package/dist/cjs/api/resources/jobs/client/Client.js +185 -0
- package/dist/cjs/api/resources/jobs/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/jobs/client/index.js +17 -0
- package/dist/cjs/api/resources/jobs/client/requests/CancelJobRequest.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/CancelJobRequest.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/GetJobRequest.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/GetJobRequest.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/jobs/index.d.ts +1 -0
- package/dist/cjs/api/resources/jobs/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +108 -0
- package/dist/cjs/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/index.js +2 -0
- package/dist/cjs/api/resources/webhooks/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/index.js +18 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookLinkResponse.d.ts +4 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookLinkResponse.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +17 -0
- package/dist/cjs/api/types/ExtractAsyncInput.d.ts +1 -0
- package/dist/cjs/api/types/ExtractAsyncInput.js +3 -0
- package/dist/cjs/api/types/ExtractAsyncResponse.d.ts +22 -0
- package/dist/cjs/api/types/ExtractAsyncResponse.js +15 -0
- package/dist/cjs/api/types/ExtractInput.d.ts +1 -0
- package/dist/cjs/api/types/ExtractInput.js +3 -0
- package/dist/cjs/api/types/ExtractJsonInput.d.ts +61 -0
- package/dist/cjs/api/types/ExtractJsonInput.js +3 -0
- package/dist/cjs/api/types/ExtractMultipartInput.d.ts +59 -0
- package/dist/cjs/api/types/ExtractMultipartInput.js +3 -0
- package/dist/cjs/api/types/ExtractOptions.d.ts +59 -0
- package/dist/cjs/api/types/ExtractOptions.js +3 -0
- package/dist/cjs/api/types/ExtractResponse.d.ts +17 -0
- package/dist/cjs/api/types/ExtractResponse.js +3 -0
- package/dist/cjs/api/types/JobCancellationResponse.d.ts +9 -0
- package/dist/cjs/api/types/JobCancellationResponse.js +3 -0
- package/dist/cjs/api/types/JobStatus.d.ts +9 -0
- package/dist/cjs/api/types/JobStatus.js +12 -0
- package/dist/cjs/api/types/JobStatusResponse.d.ts +17 -0
- package/dist/cjs/api/types/JobStatusResponse.js +3 -0
- package/dist/cjs/api/types/JsonSource.d.ts +7 -0
- package/dist/cjs/api/types/JsonSource.js +3 -0
- package/dist/cjs/api/types/MultipartSource.d.ts +10 -0
- package/dist/cjs/api/types/MultipartSource.js +3 -0
- package/dist/cjs/api/types/index.d.ts +12 -0
- package/dist/cjs/api/types/index.js +28 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +16 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +9 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +17 -0
- package/dist/cjs/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/cjs/core/fetcher/APIResponse.js +2 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/cjs/core/fetcher/BinaryResponse.js +17 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +49 -0
- package/dist/cjs/core/fetcher/Fetcher.js +316 -0
- package/dist/cjs/core/fetcher/Headers.d.ts +2 -0
- package/dist/cjs/core/fetcher/Headers.js +84 -0
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/cjs/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/cjs/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/cjs/core/fetcher/RawResponse.js +44 -0
- package/dist/cjs/core/fetcher/Supplier.d.ts +4 -0
- package/dist/cjs/core/fetcher/Supplier.js +22 -0
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/cjs/core/fetcher/createRequestUrl.js +8 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +45 -0
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/cjs/core/fetcher/getFetchFn.js +17 -0
- package/dist/cjs/core/fetcher/getHeader.d.ts +1 -0
- package/dist/cjs/core/fetcher/getHeader.js +11 -0
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/cjs/core/fetcher/getRequestBody.js +27 -0
- package/dist/cjs/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +69 -0
- package/dist/cjs/core/fetcher/index.d.ts +11 -0
- package/dist/cjs/core/fetcher/index.js +17 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/cjs/core/fetcher/makeRequest.js +40 -0
- package/dist/cjs/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/cjs/core/fetcher/requestWithRetries.js +67 -0
- package/dist/cjs/core/fetcher/signals.d.ts +5 -0
- package/dist/cjs/core/fetcher/signals.js +24 -0
- package/dist/cjs/core/headers.d.ts +2 -0
- package/dist/cjs/core/headers.js +31 -0
- package/dist/cjs/core/index.d.ts +6 -0
- package/dist/cjs/core/index.js +45 -0
- package/dist/cjs/core/json.d.ts +15 -0
- package/dist/cjs/core/json.js +24 -0
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/runtime/index.d.ts +1 -0
- package/dist/cjs/core/runtime/index.js +5 -0
- package/dist/cjs/core/runtime/runtime.d.ts +9 -0
- package/dist/cjs/core/runtime/runtime.js +103 -0
- package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
- package/dist/cjs/core/url/encodePathParam.js +21 -0
- package/dist/cjs/core/url/index.d.ts +3 -0
- package/dist/cjs/core/url/index.js +9 -0
- package/dist/cjs/core/url/join.d.ts +1 -0
- package/dist/cjs/core/url/join.js +68 -0
- package/dist/cjs/core/url/qs.d.ts +6 -0
- package/dist/cjs/core/url/qs.js +64 -0
- package/dist/cjs/environments.d.ts +4 -0
- package/dist/cjs/environments.js +7 -0
- package/dist/cjs/errors/PulseError.d.ts +12 -0
- package/dist/cjs/errors/PulseError.js +32 -0
- package/dist/cjs/errors/PulseTimeoutError.d.ts +3 -0
- package/dist/cjs/errors/PulseTimeoutError.js +15 -0
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/errors/index.d.ts +2 -0
- package/dist/cjs/errors/index.js +7 -0
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +48 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +4 -0
- package/dist/esm/BaseClient.d.mts +39 -0
- package/dist/esm/BaseClient.mjs +25 -0
- package/dist/esm/Client.d.mts +57 -0
- package/dist/esm/Client.mjs +152 -0
- package/dist/esm/api/errors/BadRequestError.d.mts +5 -0
- package/dist/esm/api/errors/BadRequestError.mjs +17 -0
- package/dist/esm/api/errors/ForbiddenError.d.mts +5 -0
- package/dist/esm/api/errors/ForbiddenError.mjs +17 -0
- package/dist/esm/api/errors/InternalServerError.d.mts +5 -0
- package/dist/esm/api/errors/InternalServerError.mjs +17 -0
- package/dist/esm/api/errors/NotFoundError.d.mts +5 -0
- package/dist/esm/api/errors/NotFoundError.mjs +17 -0
- package/dist/esm/api/errors/TooManyRequestsError.d.mts +5 -0
- package/dist/esm/api/errors/TooManyRequestsError.mjs +17 -0
- package/dist/esm/api/errors/UnauthorizedError.d.mts +5 -0
- package/dist/esm/api/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +6 -0
- package/dist/esm/api/errors/index.mjs +6 -0
- package/dist/esm/api/index.d.mts +3 -0
- package/dist/esm/api/index.mjs +3 -0
- package/dist/esm/api/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/index.mjs +4 -0
- package/dist/esm/api/resources/jobs/client/Client.d.mts +53 -0
- package/dist/esm/api/resources/jobs/client/Client.mjs +148 -0
- package/dist/esm/api/resources/jobs/client/index.d.mts +1 -0
- package/dist/esm/api/resources/jobs/client/index.mjs +1 -0
- package/dist/esm/api/resources/jobs/client/requests/CancelJobRequest.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/CancelJobRequest.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/GetJobRequest.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/GetJobRequest.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/jobs/index.d.mts +1 -0
- package/dist/esm/api/resources/jobs/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +71 -0
- package/dist/esm/api/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/index.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookLinkResponse.d.mts +4 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookLinkResponse.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +1 -0
- package/dist/esm/api/types/ExtractAsyncInput.d.mts +1 -0
- package/dist/esm/api/types/ExtractAsyncInput.mjs +2 -0
- package/dist/esm/api/types/ExtractAsyncResponse.d.mts +22 -0
- package/dist/esm/api/types/ExtractAsyncResponse.mjs +12 -0
- package/dist/esm/api/types/ExtractInput.d.mts +1 -0
- package/dist/esm/api/types/ExtractInput.mjs +2 -0
- package/dist/esm/api/types/ExtractJsonInput.d.mts +61 -0
- package/dist/esm/api/types/ExtractJsonInput.mjs +2 -0
- package/dist/esm/api/types/ExtractMultipartInput.d.mts +59 -0
- package/dist/esm/api/types/ExtractMultipartInput.mjs +2 -0
- package/dist/esm/api/types/ExtractOptions.d.mts +59 -0
- package/dist/esm/api/types/ExtractOptions.mjs +2 -0
- package/dist/esm/api/types/ExtractResponse.d.mts +17 -0
- package/dist/esm/api/types/ExtractResponse.mjs +2 -0
- package/dist/esm/api/types/JobCancellationResponse.d.mts +9 -0
- package/dist/esm/api/types/JobCancellationResponse.mjs +2 -0
- package/dist/esm/api/types/JobStatus.d.mts +9 -0
- package/dist/esm/api/types/JobStatus.mjs +9 -0
- package/dist/esm/api/types/JobStatusResponse.d.mts +17 -0
- package/dist/esm/api/types/JobStatusResponse.mjs +2 -0
- package/dist/esm/api/types/JsonSource.d.mts +7 -0
- package/dist/esm/api/types/JsonSource.mjs +2 -0
- package/dist/esm/api/types/MultipartSource.d.mts +10 -0
- package/dist/esm/api/types/MultipartSource.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +12 -0
- package/dist/esm/api/types/index.mjs +12 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +16 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +3 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/APIResponse.d.mts +20 -0
- package/dist/esm/core/fetcher/APIResponse.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +19 -0
- package/dist/esm/core/fetcher/BinaryResponse.mjs +14 -0
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
- package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +49 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +312 -0
- package/dist/esm/core/fetcher/Headers.d.mts +2 -0
- package/dist/esm/core/fetcher/Headers.mjs +82 -0
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +58 -0
- package/dist/esm/core/fetcher/HttpResponsePromise.mjs +99 -0
- package/dist/esm/core/fetcher/RawResponse.d.mts +29 -0
- package/dist/esm/core/fetcher/RawResponse.mjs +40 -0
- package/dist/esm/core/fetcher/Supplier.d.mts +4 -0
- package/dist/esm/core/fetcher/Supplier.mjs +19 -0
- package/dist/esm/core/fetcher/createRequestUrl.d.mts +1 -0
- package/dist/esm/core/fetcher/createRequestUrl.mjs +5 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +42 -0
- package/dist/esm/core/fetcher/getFetchFn.d.mts +1 -0
- package/dist/esm/core/fetcher/getFetchFn.mjs +14 -0
- package/dist/esm/core/fetcher/getHeader.d.mts +1 -0
- package/dist/esm/core/fetcher/getHeader.mjs +8 -0
- package/dist/esm/core/fetcher/getRequestBody.d.mts +7 -0
- package/dist/esm/core/fetcher/getRequestBody.mjs +24 -0
- package/dist/esm/core/fetcher/getResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +66 -0
- package/dist/esm/core/fetcher/index.d.mts +11 -0
- package/dist/esm/core/fetcher/index.mjs +6 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -0
- package/dist/esm/core/fetcher/makeRequest.mjs +36 -0
- package/dist/esm/core/fetcher/requestWithRetries.d.mts +1 -0
- package/dist/esm/core/fetcher/requestWithRetries.mjs +64 -0
- package/dist/esm/core/fetcher/signals.d.mts +5 -0
- package/dist/esm/core/fetcher/signals.mjs +20 -0
- package/dist/esm/core/headers.d.mts +2 -0
- package/dist/esm/core/headers.mjs +27 -0
- package/dist/esm/core/index.d.mts +6 -0
- package/dist/esm/core/index.mjs +6 -0
- package/dist/esm/core/json.d.mts +15 -0
- package/dist/esm/core/json.mjs +19 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/runtime/index.d.mts +1 -0
- package/dist/esm/core/runtime/index.mjs +1 -0
- package/dist/esm/core/runtime/runtime.d.mts +9 -0
- package/dist/esm/core/runtime/runtime.mjs +100 -0
- package/dist/esm/core/url/encodePathParam.d.mts +1 -0
- package/dist/esm/core/url/encodePathParam.mjs +18 -0
- package/dist/esm/core/url/index.d.mts +3 -0
- package/dist/esm/core/url/index.mjs +3 -0
- package/dist/esm/core/url/join.d.mts +1 -0
- package/dist/esm/core/url/join.mjs +65 -0
- package/dist/esm/core/url/qs.d.mts +6 -0
- package/dist/esm/core/url/qs.mjs +61 -0
- package/dist/esm/environments.d.mts +4 -0
- package/dist/esm/environments.mjs +4 -0
- package/dist/esm/errors/PulseError.d.mts +12 -0
- package/dist/esm/errors/PulseError.mjs +28 -0
- package/dist/esm/errors/PulseTimeoutError.d.mts +3 -0
- package/dist/esm/errors/PulseTimeoutError.mjs +11 -0
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/errors/index.d.mts +2 -0
- package/dist/esm/errors/index.mjs +2 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +6 -0
- package/dist/esm/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -0
- package/dist/esm/version.mjs +1 -0
- package/package.json +1 -1
- package/reference.md +6 -6
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import * as Pulse from "./api/index.mjs";
|
|
12
|
+
import { JobsClient } from "./api/resources/jobs/client/Client.mjs";
|
|
13
|
+
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
14
|
+
import { normalizeClientOptions } from "./BaseClient.mjs";
|
|
15
|
+
import { mergeHeaders } from "./core/headers.mjs";
|
|
16
|
+
import * as core from "./core/index.mjs";
|
|
17
|
+
import * as environments from "./environments.mjs";
|
|
18
|
+
import { handleNonStatusCodeError } from "./errors/handleNonStatusCodeError.mjs";
|
|
19
|
+
import * as errors from "./errors/index.mjs";
|
|
20
|
+
export class PulseClient {
|
|
21
|
+
constructor(options = {}) {
|
|
22
|
+
this._options = normalizeClientOptions(options);
|
|
23
|
+
}
|
|
24
|
+
get jobs() {
|
|
25
|
+
var _a;
|
|
26
|
+
return ((_a = this._jobs) !== null && _a !== void 0 ? _a : (this._jobs = new JobsClient(this._options)));
|
|
27
|
+
}
|
|
28
|
+
get webhooks() {
|
|
29
|
+
var _a;
|
|
30
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new WebhooksClient(this._options)));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The primary endpoint for the Pulse API. Parses uploaded documents or remote
|
|
34
|
+
* file URLs and returns rich markdown content with optional structured data
|
|
35
|
+
* extraction based on user-provided schemas and extraction options.
|
|
36
|
+
*
|
|
37
|
+
* @param {Pulse.ExtractJsonInput} request
|
|
38
|
+
* @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Pulse.BadRequestError}
|
|
41
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
42
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.extract({
|
|
46
|
+
* fileUrl: "fileUrl"
|
|
47
|
+
* })
|
|
48
|
+
*/
|
|
49
|
+
extract(request, requestOptions) {
|
|
50
|
+
return core.HttpResponsePromise.fromPromise(this.__extract(request, requestOptions));
|
|
51
|
+
}
|
|
52
|
+
__extract(request, requestOptions) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
55
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
56
|
+
const _response = yield core.fetcher({
|
|
57
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, "extract"),
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: _headers,
|
|
60
|
+
contentType: "application/json",
|
|
61
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
62
|
+
requestType: "json",
|
|
63
|
+
body: request,
|
|
64
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
65
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
66
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
67
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
68
|
+
logging: this._options.logging,
|
|
69
|
+
});
|
|
70
|
+
if (_response.ok) {
|
|
71
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
72
|
+
}
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 400:
|
|
76
|
+
throw new Pulse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
77
|
+
case 401:
|
|
78
|
+
throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 429:
|
|
80
|
+
throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
81
|
+
default:
|
|
82
|
+
throw new errors.PulseError({
|
|
83
|
+
statusCode: _response.error.statusCode,
|
|
84
|
+
body: _response.error.body,
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/extract");
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Starts an asynchronous extraction job. The request mirrors the
|
|
94
|
+
* synchronous options but returns immediately with a job identifier that
|
|
95
|
+
* clients can poll for completion status.
|
|
96
|
+
*
|
|
97
|
+
* @param {Pulse.ExtractJsonInput} request
|
|
98
|
+
* @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
99
|
+
*
|
|
100
|
+
* @throws {@link Pulse.BadRequestError}
|
|
101
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
102
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* await client.extractAsync({
|
|
106
|
+
* fileUrl: "fileUrl"
|
|
107
|
+
* })
|
|
108
|
+
*/
|
|
109
|
+
extractAsync(request, requestOptions) {
|
|
110
|
+
return core.HttpResponsePromise.fromPromise(this.__extractAsync(request, requestOptions));
|
|
111
|
+
}
|
|
112
|
+
__extractAsync(request, requestOptions) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
115
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
116
|
+
const _response = yield core.fetcher({
|
|
117
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, "extract_async"),
|
|
118
|
+
method: "POST",
|
|
119
|
+
headers: _headers,
|
|
120
|
+
contentType: "application/json",
|
|
121
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
122
|
+
requestType: "json",
|
|
123
|
+
body: request,
|
|
124
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
125
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
126
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
127
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
128
|
+
logging: this._options.logging,
|
|
129
|
+
});
|
|
130
|
+
if (_response.ok) {
|
|
131
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
132
|
+
}
|
|
133
|
+
if (_response.error.reason === "status-code") {
|
|
134
|
+
switch (_response.error.statusCode) {
|
|
135
|
+
case 400:
|
|
136
|
+
throw new Pulse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
137
|
+
case 401:
|
|
138
|
+
throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
139
|
+
case 429:
|
|
140
|
+
throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
141
|
+
default:
|
|
142
|
+
throw new errors.PulseError({
|
|
143
|
+
statusCode: _response.error.statusCode,
|
|
144
|
+
body: _response.error.body,
|
|
145
|
+
rawResponse: _response.rawResponse,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/extract_async");
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class BadRequestError extends errors.PulseError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "BadRequestError",
|
|
7
|
+
statusCode: 400,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class ForbiddenError extends errors.PulseError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "ForbiddenError",
|
|
7
|
+
statusCode: 403,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class InternalServerError extends errors.PulseError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "InternalServerError",
|
|
7
|
+
statusCode: 500,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class NotFoundError extends errors.PulseError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "NotFoundError",
|
|
7
|
+
statusCode: 404,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class TooManyRequestsError extends errors.PulseError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "TooManyRequestsError",
|
|
7
|
+
statusCode: 429,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class UnauthorizedError extends errors.PulseError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "UnauthorizedError",
|
|
7
|
+
statusCode: 401,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Pulse from "../../../index.mjs";
|
|
5
|
+
export declare namespace JobsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class JobsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptions<JobsClient.Options>;
|
|
12
|
+
constructor(options?: JobsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Check the status and retrieve results of an asynchronous job
|
|
15
|
+
* (e.g., submitted via `/extract_async`).
|
|
16
|
+
*
|
|
17
|
+
* @param {Pulse.GetJobRequest} request
|
|
18
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
21
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
22
|
+
* @throws {@link Pulse.NotFoundError}
|
|
23
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
24
|
+
* @throws {@link Pulse.InternalServerError}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.jobs.getJob({
|
|
28
|
+
* jobId: "jobId"
|
|
29
|
+
* })
|
|
30
|
+
*/
|
|
31
|
+
getJob(request: Pulse.GetJobRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Pulse.JobStatusResponse>;
|
|
32
|
+
private __getJob;
|
|
33
|
+
/**
|
|
34
|
+
* Attempts to cancel an asynchronous job that is currently pending
|
|
35
|
+
* or processing. Jobs that have already completed will remain unchanged.
|
|
36
|
+
*
|
|
37
|
+
* @param {Pulse.CancelJobRequest} request
|
|
38
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
41
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
42
|
+
* @throws {@link Pulse.NotFoundError}
|
|
43
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
44
|
+
* @throws {@link Pulse.InternalServerError}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.jobs.cancelJob({
|
|
48
|
+
* jobId: "jobId"
|
|
49
|
+
* })
|
|
50
|
+
*/
|
|
51
|
+
cancelJob(request: Pulse.CancelJobRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Pulse.JobCancellationResponse>;
|
|
52
|
+
private __cancelJob;
|
|
53
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Pulse from "../../../index.mjs";
|
|
18
|
+
export class JobsClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptions(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Check the status and retrieve results of an asynchronous job
|
|
24
|
+
* (e.g., submitted via `/extract_async`).
|
|
25
|
+
*
|
|
26
|
+
* @param {Pulse.GetJobRequest} request
|
|
27
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
30
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
31
|
+
* @throws {@link Pulse.NotFoundError}
|
|
32
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
33
|
+
* @throws {@link Pulse.InternalServerError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.jobs.getJob({
|
|
37
|
+
* jobId: "jobId"
|
|
38
|
+
* })
|
|
39
|
+
*/
|
|
40
|
+
getJob(request, requestOptions) {
|
|
41
|
+
return core.HttpResponsePromise.fromPromise(this.__getJob(request, requestOptions));
|
|
42
|
+
}
|
|
43
|
+
__getJob(request, requestOptions) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46
|
+
const { jobId } = request;
|
|
47
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
48
|
+
const _response = yield core.fetcher({
|
|
49
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, `job/${core.url.encodePathParam(jobId)}`),
|
|
50
|
+
method: "GET",
|
|
51
|
+
headers: _headers,
|
|
52
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
53
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
54
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
55
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
57
|
+
logging: this._options.logging,
|
|
58
|
+
});
|
|
59
|
+
if (_response.ok) {
|
|
60
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
61
|
+
}
|
|
62
|
+
if (_response.error.reason === "status-code") {
|
|
63
|
+
switch (_response.error.statusCode) {
|
|
64
|
+
case 401:
|
|
65
|
+
throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
66
|
+
case 403:
|
|
67
|
+
throw new Pulse.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
68
|
+
case 404:
|
|
69
|
+
throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
70
|
+
case 429:
|
|
71
|
+
throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
72
|
+
case 500:
|
|
73
|
+
throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
|
|
74
|
+
default:
|
|
75
|
+
throw new errors.PulseError({
|
|
76
|
+
statusCode: _response.error.statusCode,
|
|
77
|
+
body: _response.error.body,
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/job/{jobId}");
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Attempts to cancel an asynchronous job that is currently pending
|
|
87
|
+
* or processing. Jobs that have already completed will remain unchanged.
|
|
88
|
+
*
|
|
89
|
+
* @param {Pulse.CancelJobRequest} request
|
|
90
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
93
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
94
|
+
* @throws {@link Pulse.NotFoundError}
|
|
95
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
96
|
+
* @throws {@link Pulse.InternalServerError}
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* await client.jobs.cancelJob({
|
|
100
|
+
* jobId: "jobId"
|
|
101
|
+
* })
|
|
102
|
+
*/
|
|
103
|
+
cancelJob(request, requestOptions) {
|
|
104
|
+
return core.HttpResponsePromise.fromPromise(this.__cancelJob(request, requestOptions));
|
|
105
|
+
}
|
|
106
|
+
__cancelJob(request, requestOptions) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
109
|
+
const { jobId } = request;
|
|
110
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
111
|
+
const _response = yield core.fetcher({
|
|
112
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, `job/${core.url.encodePathParam(jobId)}`),
|
|
113
|
+
method: "DELETE",
|
|
114
|
+
headers: _headers,
|
|
115
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
116
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
117
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
118
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
119
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
120
|
+
logging: this._options.logging,
|
|
121
|
+
});
|
|
122
|
+
if (_response.ok) {
|
|
123
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
124
|
+
}
|
|
125
|
+
if (_response.error.reason === "status-code") {
|
|
126
|
+
switch (_response.error.statusCode) {
|
|
127
|
+
case 401:
|
|
128
|
+
throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
129
|
+
case 403:
|
|
130
|
+
throw new Pulse.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
131
|
+
case 404:
|
|
132
|
+
throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
133
|
+
case 429:
|
|
134
|
+
throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
135
|
+
case 500:
|
|
136
|
+
throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
|
|
137
|
+
default:
|
|
138
|
+
throw new errors.PulseError({
|
|
139
|
+
statusCode: _response.error.statusCode,
|
|
140
|
+
body: _response.error.body,
|
|
141
|
+
rawResponse: _response.rawResponse,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/job/{jobId}");
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Pulse from "../../../index.mjs";
|
|
5
|
+
export declare namespace WebhooksClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class WebhooksClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptions<WebhooksClient.Options>;
|
|
12
|
+
constructor(options?: WebhooksClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Generates a temporary link to the Svix webhook portal where users can manage their webhook endpoints and view message logs.
|
|
15
|
+
*
|
|
16
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
19
|
+
* @throws {@link Pulse.InternalServerError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.webhooks.createWebhookLink()
|
|
23
|
+
*/
|
|
24
|
+
createWebhookLink(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<Pulse.CreateWebhookLinkResponse>;
|
|
25
|
+
private __createWebhookLink;
|
|
26
|
+
}
|