newscatcher-catchall-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/LICENSE +21 -0
- package/README.md +332 -0
- package/dist/cjs/BaseClient.d.ts +31 -0
- package/dist/cjs/BaseClient.js +50 -0
- package/dist/cjs/Client.d.ts +20 -0
- package/dist/cjs/Client.js +26 -0
- package/dist/cjs/api/errors/ForbiddenError.d.ts +6 -0
- package/dist/cjs/api/errors/ForbiddenError.js +50 -0
- package/dist/cjs/api/errors/NotFoundError.d.ts +6 -0
- package/dist/cjs/api/errors/NotFoundError.js +50 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.js +50 -0
- package/dist/cjs/api/errors/index.d.ts +3 -0
- package/dist/cjs/api/errors/index.js +19 -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 +7 -0
- package/dist/cjs/api/resources/index.js +46 -0
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +77 -0
- package/dist/cjs/api/resources/jobs/client/Client.js +335 -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/GetJobResultsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsRequest.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +14 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +3 -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/meta/client/Client.d.ts +37 -0
- package/dist/cjs/api/resources/meta/client/Client.js +172 -0
- package/dist/cjs/api/resources/meta/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/meta/client/index.js +2 -0
- package/dist/cjs/api/resources/meta/index.d.ts +2 -0
- package/dist/cjs/api/resources/meta/index.js +18 -0
- package/dist/cjs/api/resources/meta/types/GetVersionResponse.d.ts +3 -0
- package/dist/cjs/api/resources/meta/types/GetVersionResponse.js +3 -0
- package/dist/cjs/api/resources/meta/types/HealthCheckResponse.d.ts +3 -0
- package/dist/cjs/api/resources/meta/types/HealthCheckResponse.js +3 -0
- package/dist/cjs/api/resources/meta/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/meta/types/index.js +18 -0
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +119 -0
- package/dist/cjs/api/resources/monitors/client/Client.js +482 -0
- package/dist/cjs/api/resources/monitors/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/monitors/client/index.js +17 -0
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +23 -0
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/DisableMonitorRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/DisableMonitorRequest.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorJobsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorJobsRequest.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsRequest.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/monitors/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/monitors/index.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/index.js +18 -0
- package/dist/cjs/api/resources/monitors/types/DisableMonitorResponse.d.ts +8 -0
- package/dist/cjs/api/resources/monitors/types/DisableMonitorResponse.js +3 -0
- package/dist/cjs/api/resources/monitors/types/EnableMonitorResponse.d.ts +8 -0
- package/dist/cjs/api/resources/monitors/types/EnableMonitorResponse.js +3 -0
- package/dist/cjs/api/resources/monitors/types/ListMonitorJobsRequestSort.d.ts +5 -0
- package/dist/cjs/api/resources/monitors/types/ListMonitorJobsRequestSort.js +8 -0
- package/dist/cjs/api/resources/monitors/types/ListMonitorJobsResponse.d.ts +19 -0
- package/dist/cjs/api/resources/monitors/types/ListMonitorJobsResponse.js +12 -0
- package/dist/cjs/api/resources/monitors/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/monitors/types/index.js +20 -0
- package/dist/cjs/api/types/Citation.d.ts +8 -0
- package/dist/cjs/api/types/Citation.js +3 -0
- package/dist/cjs/api/types/Context.d.ts +4 -0
- package/dist/cjs/api/types/Context.js +3 -0
- package/dist/cjs/api/types/CreateMonitorResponseDto.d.ts +6 -0
- package/dist/cjs/api/types/CreateMonitorResponseDto.js +3 -0
- package/dist/cjs/api/types/Error_.d.ts +4 -0
- package/dist/cjs/api/types/Error_.js +3 -0
- package/dist/cjs/api/types/JobStatus.d.ts +23 -0
- package/dist/cjs/api/types/JobStatus.js +26 -0
- package/dist/cjs/api/types/JobStep.d.ts +8 -0
- package/dist/cjs/api/types/JobStep.js +3 -0
- package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -0
- package/dist/cjs/api/types/ListMonitorsResponseDto.js +3 -0
- package/dist/cjs/api/types/ListUserJobsResponseDto.d.ts +6 -0
- package/dist/cjs/api/types/ListUserJobsResponseDto.js +3 -0
- package/dist/cjs/api/types/MonitorCitation.d.ts +16 -0
- package/dist/cjs/api/types/MonitorCitation.js +3 -0
- package/dist/cjs/api/types/MonitorJobItem.d.ts +8 -0
- package/dist/cjs/api/types/MonitorJobItem.js +3 -0
- package/dist/cjs/api/types/MonitorListItemDto.d.ts +16 -0
- package/dist/cjs/api/types/MonitorListItemDto.js +3 -0
- package/dist/cjs/api/types/MonitorRecord.d.ts +23 -0
- package/dist/cjs/api/types/MonitorRecord.js +3 -0
- package/dist/cjs/api/types/PullJobResponseDto.d.ts +34 -0
- package/dist/cjs/api/types/PullJobResponseDto.js +3 -0
- package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +35 -0
- package/dist/cjs/api/types/PullMonitorResponseDto.js +3 -0
- package/dist/cjs/api/types/Query.d.ts +6 -0
- package/dist/cjs/api/types/Query.js +3 -0
- package/dist/cjs/api/types/Record_.d.ts +15 -0
- package/dist/cjs/api/types/Record_.js +3 -0
- package/dist/cjs/api/types/ReferenceJob.d.ts +6 -0
- package/dist/cjs/api/types/ReferenceJob.js +3 -0
- package/dist/cjs/api/types/Schema.d.ts +6 -0
- package/dist/cjs/api/types/Schema.js +3 -0
- package/dist/cjs/api/types/StatusResponseDto.d.ts +9 -0
- package/dist/cjs/api/types/StatusResponseDto.js +3 -0
- package/dist/cjs/api/types/SubmitResponseBody.d.ts +4 -0
- package/dist/cjs/api/types/SubmitResponseBody.js +3 -0
- package/dist/cjs/api/types/ValidationErrorDetail.d.ts +14 -0
- package/dist/cjs/api/types/ValidationErrorDetail.js +3 -0
- package/dist/cjs/api/types/ValidationErrorResponse.d.ts +4 -0
- package/dist/cjs/api/types/ValidationErrorResponse.js +3 -0
- package/dist/cjs/api/types/WebhookDto.d.ts +20 -0
- package/dist/cjs/api/types/WebhookDto.js +12 -0
- package/dist/cjs/api/types/WebhookPayload.d.ts +28 -0
- package/dist/cjs/api/types/WebhookPayload.js +3 -0
- package/dist/cjs/api/types/index.d.ts +24 -0
- package/dist/cjs/api/types/index.js +40 -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 +20 -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 +45 -0
- package/dist/cjs/core/fetcher/Fetcher.js +315 -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/ResponseWithBody.d.ts +4 -0
- package/dist/cjs/core/fetcher/ResponseWithBody.js +6 -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 +55 -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 +4 -0
- package/dist/cjs/core/index.js +43 -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 +102 -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/CatchAllApiError.d.ts +12 -0
- package/dist/cjs/errors/CatchAllApiError.js +28 -0
- package/dist/cjs/errors/CatchAllApiTimeoutError.d.ts +3 -0
- package/dist/cjs/errors/CatchAllApiTimeoutError.js +11 -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 +31 -0
- package/dist/esm/BaseClient.mjs +14 -0
- package/dist/esm/Client.d.mts +20 -0
- package/dist/esm/Client.mjs +22 -0
- package/dist/esm/api/errors/ForbiddenError.d.mts +6 -0
- package/dist/esm/api/errors/ForbiddenError.mjs +13 -0
- package/dist/esm/api/errors/NotFoundError.d.mts +6 -0
- package/dist/esm/api/errors/NotFoundError.mjs +13 -0
- package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +13 -0
- package/dist/esm/api/errors/index.d.mts +3 -0
- package/dist/esm/api/errors/index.mjs +3 -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 +7 -0
- package/dist/esm/api/resources/index.mjs +7 -0
- package/dist/esm/api/resources/jobs/client/Client.d.mts +77 -0
- package/dist/esm/api/resources/jobs/client/Client.mjs +298 -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/GetJobResultsRequest.d.mts +14 -0
- package/dist/esm/api/resources/jobs/client/requests/GetJobResultsRequest.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +14 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +3 -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/meta/client/Client.d.mts +37 -0
- package/dist/esm/api/resources/meta/client/Client.mjs +135 -0
- package/dist/esm/api/resources/meta/client/index.d.mts +1 -0
- package/dist/esm/api/resources/meta/client/index.mjs +1 -0
- package/dist/esm/api/resources/meta/index.d.mts +2 -0
- package/dist/esm/api/resources/meta/index.mjs +2 -0
- package/dist/esm/api/resources/meta/types/GetVersionResponse.d.mts +3 -0
- package/dist/esm/api/resources/meta/types/GetVersionResponse.mjs +2 -0
- package/dist/esm/api/resources/meta/types/HealthCheckResponse.d.mts +3 -0
- package/dist/esm/api/resources/meta/types/HealthCheckResponse.mjs +2 -0
- package/dist/esm/api/resources/meta/types/index.d.mts +2 -0
- package/dist/esm/api/resources/meta/types/index.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/Client.d.mts +119 -0
- package/dist/esm/api/resources/monitors/client/Client.mjs +445 -0
- package/dist/esm/api/resources/monitors/client/index.d.mts +1 -0
- package/dist/esm/api/resources/monitors/client/index.mjs +1 -0
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +23 -0
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/DisableMonitorRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/DisableMonitorRequest.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorJobsRequest.d.mts +13 -0
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorJobsRequest.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsRequest.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/monitors/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/monitors/index.d.mts +2 -0
- package/dist/esm/api/resources/monitors/index.mjs +2 -0
- package/dist/esm/api/resources/monitors/types/DisableMonitorResponse.d.mts +8 -0
- package/dist/esm/api/resources/monitors/types/DisableMonitorResponse.mjs +2 -0
- package/dist/esm/api/resources/monitors/types/EnableMonitorResponse.d.mts +8 -0
- package/dist/esm/api/resources/monitors/types/EnableMonitorResponse.mjs +2 -0
- package/dist/esm/api/resources/monitors/types/ListMonitorJobsRequestSort.d.mts +5 -0
- package/dist/esm/api/resources/monitors/types/ListMonitorJobsRequestSort.mjs +5 -0
- package/dist/esm/api/resources/monitors/types/ListMonitorJobsResponse.d.mts +19 -0
- package/dist/esm/api/resources/monitors/types/ListMonitorJobsResponse.mjs +9 -0
- package/dist/esm/api/resources/monitors/types/index.d.mts +4 -0
- package/dist/esm/api/resources/monitors/types/index.mjs +4 -0
- package/dist/esm/api/types/Citation.d.mts +8 -0
- package/dist/esm/api/types/Citation.mjs +2 -0
- package/dist/esm/api/types/Context.d.mts +4 -0
- package/dist/esm/api/types/Context.mjs +2 -0
- package/dist/esm/api/types/CreateMonitorResponseDto.d.mts +6 -0
- package/dist/esm/api/types/CreateMonitorResponseDto.mjs +2 -0
- package/dist/esm/api/types/Error_.d.mts +4 -0
- package/dist/esm/api/types/Error_.mjs +2 -0
- package/dist/esm/api/types/JobStatus.d.mts +23 -0
- package/dist/esm/api/types/JobStatus.mjs +23 -0
- package/dist/esm/api/types/JobStep.d.mts +8 -0
- package/dist/esm/api/types/JobStep.mjs +2 -0
- package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -0
- package/dist/esm/api/types/ListMonitorsResponseDto.mjs +2 -0
- package/dist/esm/api/types/ListUserJobsResponseDto.d.mts +6 -0
- package/dist/esm/api/types/ListUserJobsResponseDto.mjs +2 -0
- package/dist/esm/api/types/MonitorCitation.d.mts +16 -0
- package/dist/esm/api/types/MonitorCitation.mjs +2 -0
- package/dist/esm/api/types/MonitorJobItem.d.mts +8 -0
- package/dist/esm/api/types/MonitorJobItem.mjs +2 -0
- package/dist/esm/api/types/MonitorListItemDto.d.mts +16 -0
- package/dist/esm/api/types/MonitorListItemDto.mjs +2 -0
- package/dist/esm/api/types/MonitorRecord.d.mts +23 -0
- package/dist/esm/api/types/MonitorRecord.mjs +2 -0
- package/dist/esm/api/types/PullJobResponseDto.d.mts +34 -0
- package/dist/esm/api/types/PullJobResponseDto.mjs +2 -0
- package/dist/esm/api/types/PullMonitorResponseDto.d.mts +35 -0
- package/dist/esm/api/types/PullMonitorResponseDto.mjs +2 -0
- package/dist/esm/api/types/Query.d.mts +6 -0
- package/dist/esm/api/types/Query.mjs +2 -0
- package/dist/esm/api/types/Record_.d.mts +15 -0
- package/dist/esm/api/types/Record_.mjs +2 -0
- package/dist/esm/api/types/ReferenceJob.d.mts +6 -0
- package/dist/esm/api/types/ReferenceJob.mjs +2 -0
- package/dist/esm/api/types/Schema.d.mts +6 -0
- package/dist/esm/api/types/Schema.mjs +2 -0
- package/dist/esm/api/types/StatusResponseDto.d.mts +9 -0
- package/dist/esm/api/types/StatusResponseDto.mjs +2 -0
- package/dist/esm/api/types/SubmitResponseBody.d.mts +4 -0
- package/dist/esm/api/types/SubmitResponseBody.mjs +2 -0
- package/dist/esm/api/types/ValidationErrorDetail.d.mts +14 -0
- package/dist/esm/api/types/ValidationErrorDetail.mjs +2 -0
- package/dist/esm/api/types/ValidationErrorResponse.d.mts +4 -0
- package/dist/esm/api/types/ValidationErrorResponse.mjs +2 -0
- package/dist/esm/api/types/WebhookDto.d.mts +20 -0
- package/dist/esm/api/types/WebhookDto.mjs +9 -0
- package/dist/esm/api/types/WebhookPayload.d.mts +28 -0
- package/dist/esm/api/types/WebhookPayload.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +24 -0
- package/dist/esm/api/types/index.mjs +24 -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 +20 -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 +45 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +311 -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/ResponseWithBody.d.mts +4 -0
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +3 -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 +52 -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 +4 -0
- package/dist/esm/core/index.mjs +4 -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 +99 -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/CatchAllApiError.d.mts +12 -0
- package/dist/esm/errors/CatchAllApiError.mjs +24 -0
- package/dist/esm/errors/CatchAllApiTimeoutError.d.mts +3 -0
- package/dist/esm/errors/CatchAllApiTimeoutError.mjs +7 -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 +67 -0
- package/reference.md +753 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Newscatcher
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
# Newscatcher CatchAll TypeScript Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FNewscatcher%2Fnewscatcher-catchall-typescript)
|
|
4
|
+
[](https://www.npmjs.com/package/newscatcher-catchall-sdk)
|
|
5
|
+
|
|
6
|
+
The Newscatcher CatchAll TypeScript library provides access to the [CatchAll API](https://www.newscatcherapi.com/docs/v3/catch-all/overview/introduction), which transforms natural language queries into structured data extracted from web sources.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install newscatcher-catchall-sdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Reference
|
|
15
|
+
|
|
16
|
+
A full reference for this library is available [here](./reference.md).
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Jobs
|
|
21
|
+
|
|
22
|
+
Submit a query and retrieve structured results:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { CatchAllApiClient } from "newscatcher-catchall-sdk";
|
|
26
|
+
|
|
27
|
+
const client = new CatchAllApiClient({ apiKey: "YOUR_API_KEY" });
|
|
28
|
+
|
|
29
|
+
// Create a job
|
|
30
|
+
const job = await client.jobs.createJob({
|
|
31
|
+
query: "Tech company earnings this quarter",
|
|
32
|
+
context: "Focus on revenue and profit margins",
|
|
33
|
+
schema: "Company [NAME] earned [REVENUE] in [QUARTER]",
|
|
34
|
+
});
|
|
35
|
+
console.log(`Job created: ${job.jobId}`);
|
|
36
|
+
|
|
37
|
+
// Poll for completion with progress updates
|
|
38
|
+
while (true) {
|
|
39
|
+
const status = await client.jobs.getJobStatus(job.jobId);
|
|
40
|
+
|
|
41
|
+
// Check if completed
|
|
42
|
+
const completed = status.steps.some(s => s.status === "completed" && s.completed);
|
|
43
|
+
if (completed) {
|
|
44
|
+
console.log("Job completed!");
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Show current processing step
|
|
49
|
+
const currentStep = status.steps.find(s => !s.completed);
|
|
50
|
+
if (currentStep) {
|
|
51
|
+
console.log(`Processing: ${currentStep.status} (step ${currentStep.order}/7)`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
await new Promise(resolve => setTimeout(resolve, 60000)); // Wait 60 seconds
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Retrieve results
|
|
58
|
+
const results = await client.jobs.getJobResults(job.jobId);
|
|
59
|
+
console.log(`Found ${results.validRecords} valid records from ${results.candidateRecords} candidates`);
|
|
60
|
+
|
|
61
|
+
for (const record of results.allRecords) {
|
|
62
|
+
console.log(record.recordTitle);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Jobs process asynchronously and typically complete in 10-15 minutes. To learn more, see the [Quickstart](https://www.newscatcherapi.com/docs/v3/catch-all/overview/quickstart).
|
|
67
|
+
|
|
68
|
+
### Monitors
|
|
69
|
+
|
|
70
|
+
Automate recurring queries with scheduled execution:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { CatchAllApiClient } from "newscatcher-catchall-sdk";
|
|
74
|
+
|
|
75
|
+
const client = new CatchAllApiClient({ apiKey: "YOUR_API_KEY" });
|
|
76
|
+
|
|
77
|
+
// Create a monitor from a completed job
|
|
78
|
+
const monitor = await client.monitors.createMonitor({
|
|
79
|
+
referenceJobId: job.jobId,
|
|
80
|
+
schedule: "every day at 12 PM UTC",
|
|
81
|
+
webhook: {
|
|
82
|
+
url: "https://your-endpoint.com/webhook",
|
|
83
|
+
method: "POST",
|
|
84
|
+
headers: { "Authorization": "Bearer YOUR_TOKEN" },
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
console.log(`Monitor created: ${monitor.monitorId}`);
|
|
88
|
+
|
|
89
|
+
// List all monitors
|
|
90
|
+
const monitors = await client.monitors.listMonitors();
|
|
91
|
+
console.log(`Total monitors: ${monitors.totalMonitors}`);
|
|
92
|
+
|
|
93
|
+
// Get aggregated results
|
|
94
|
+
const results = await client.monitors.pullMonitorResults(monitor.monitorId);
|
|
95
|
+
console.log(`Collected ${results.records} records`);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Monitors run jobs on your schedule and send webhook notifications when complete. See the [Monitors documentation](https://www.newscatcherapi.com/docs/v3/catch-all/overview/monitors) for setup and configuration.
|
|
99
|
+
|
|
100
|
+
## Request and response types
|
|
101
|
+
|
|
102
|
+
The SDK exports all request and response types as TypeScript interfaces:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import { CatchAllApi } from "newscatcher-catchall-sdk";
|
|
106
|
+
|
|
107
|
+
const request: CatchAllApi.SubmitRequestDto = {
|
|
108
|
+
query: "Tech company earnings this quarter",
|
|
109
|
+
context: "Focus on revenue and profit margins",
|
|
110
|
+
};
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Exception handling
|
|
114
|
+
|
|
115
|
+
Handle API errors with the `CatchAllApiError` exception:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { CatchAllApiError } from "newscatcher-catchall-sdk";
|
|
119
|
+
|
|
120
|
+
try {
|
|
121
|
+
await client.jobs.createJob({
|
|
122
|
+
query: "Tech company earnings this quarter",
|
|
123
|
+
});
|
|
124
|
+
} catch (err) {
|
|
125
|
+
if (err instanceof CatchAllApiError) {
|
|
126
|
+
console.log(`Status: ${err.statusCode}`);
|
|
127
|
+
console.log(`Message: ${err.message}`);
|
|
128
|
+
console.log(`Body: ${JSON.stringify(err.body)}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Advanced
|
|
134
|
+
|
|
135
|
+
### Pagination
|
|
136
|
+
|
|
137
|
+
Retrieve large result sets with pagination:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
// Retrieve large result sets with pagination
|
|
141
|
+
let page = 1;
|
|
142
|
+
while (true) {
|
|
143
|
+
const results = await client.jobs.getJobResults(
|
|
144
|
+
jobId,
|
|
145
|
+
{
|
|
146
|
+
page: page,
|
|
147
|
+
pageSize: 100,
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
console.log(`Page ${results.page}/${results.totalPages}: ${results.allRecords.length} records`);
|
|
152
|
+
|
|
153
|
+
for (const record of results.allRecords) {
|
|
154
|
+
// Process each record
|
|
155
|
+
console.log(` - ${record.recordTitle}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (results.page >= results.totalPages) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
page++;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
console.log(`Processed ${results.validRecords} total records`);
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Access raw response data
|
|
168
|
+
|
|
169
|
+
Access response headers and raw data:
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
const { data, rawResponse } = await client.jobs.createJob({
|
|
173
|
+
query: "Tech company earnings this quarter",
|
|
174
|
+
}).withRawResponse();
|
|
175
|
+
|
|
176
|
+
console.log(data);
|
|
177
|
+
console.log(rawResponse.headers.get('X-Custom-Header'));
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Additional headers
|
|
181
|
+
|
|
182
|
+
Send custom headers with your request:
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
const response = await client.jobs.createJob({
|
|
186
|
+
query: "Tech company earnings this quarter",
|
|
187
|
+
}, {
|
|
188
|
+
headers: {
|
|
189
|
+
'X-Custom-Header': 'custom value'
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Retries
|
|
195
|
+
|
|
196
|
+
The SDK retries failed requests automatically with exponential backoff. Configure retry behavior:
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
const response = await client.jobs.createJob({
|
|
200
|
+
query: "Tech company earnings this quarter",
|
|
201
|
+
}, {
|
|
202
|
+
maxRetries: 3, // override maxRetries at the request level (default: 2)
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
A request is retried when any of these HTTP status codes is returned:
|
|
207
|
+
|
|
208
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
209
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
210
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
211
|
+
|
|
212
|
+
### Timeouts
|
|
213
|
+
|
|
214
|
+
Set custom timeouts at the request level:
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
const response = await client.jobs.createJob({
|
|
218
|
+
query: "Tech company earnings this quarter",
|
|
219
|
+
}, {
|
|
220
|
+
timeoutInSeconds: 30, // override timeout to 30s (default: 60s)
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Aborting requests
|
|
225
|
+
|
|
226
|
+
Cancel requests using an abort signal:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
const controller = new AbortController();
|
|
230
|
+
const response = await client.jobs.createJob({
|
|
231
|
+
query: "Tech company earnings this quarter",
|
|
232
|
+
}, {
|
|
233
|
+
abortSignal: controller.signal
|
|
234
|
+
});
|
|
235
|
+
controller.abort(); // cancels the request
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Logging
|
|
239
|
+
|
|
240
|
+
Configure logging to debug SDK behavior:
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
import { CatchAllApiClient, logging } from "newscatcher-catchall-sdk";
|
|
244
|
+
|
|
245
|
+
const client = new CatchAllApiClient({
|
|
246
|
+
apiKey: "YOUR_API_KEY",
|
|
247
|
+
logging: {
|
|
248
|
+
level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
|
|
249
|
+
logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
|
|
250
|
+
silent: false, // defaults to true, set to false to enable logging
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Available log levels:
|
|
256
|
+
|
|
257
|
+
- `logging.LogLevel.Debug`
|
|
258
|
+
- `logging.LogLevel.Info`
|
|
259
|
+
- `logging.LogLevel.Warn`
|
|
260
|
+
- `logging.LogLevel.Error`
|
|
261
|
+
|
|
262
|
+
<details>
|
|
263
|
+
<summary>Custom logger examples</summary>
|
|
264
|
+
|
|
265
|
+
Using Winston:
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
import winston from 'winston';
|
|
269
|
+
|
|
270
|
+
const winstonLogger = winston.createLogger({...});
|
|
271
|
+
|
|
272
|
+
const logger: logging.ILogger = {
|
|
273
|
+
debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
|
|
274
|
+
info: (msg, ...args) => winstonLogger.info(msg, ...args),
|
|
275
|
+
warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
|
|
276
|
+
error: (msg, ...args) => winstonLogger.error(msg, ...args),
|
|
277
|
+
};
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Using Pino:
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
import pino from 'pino';
|
|
284
|
+
|
|
285
|
+
const pinoLogger = pino({...});
|
|
286
|
+
|
|
287
|
+
const logger: logging.ILogger = {
|
|
288
|
+
debug: (msg, ...args) => pinoLogger.debug(args, msg),
|
|
289
|
+
info: (msg, ...args) => pinoLogger.info(args, msg),
|
|
290
|
+
warn: (msg, ...args) => pinoLogger.warn(args, msg),
|
|
291
|
+
error: (msg, ...args) => pinoLogger.error(args, msg),
|
|
292
|
+
};
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
</details>
|
|
296
|
+
|
|
297
|
+
### Runtime compatibility
|
|
298
|
+
|
|
299
|
+
The SDK works in the following runtimes:
|
|
300
|
+
|
|
301
|
+
- Node.js 18+
|
|
302
|
+
- Vercel
|
|
303
|
+
- Cloudflare Workers
|
|
304
|
+
- Deno v1.25+
|
|
305
|
+
- Bun 1.0+
|
|
306
|
+
- React Native
|
|
307
|
+
|
|
308
|
+
### Custom fetch client
|
|
309
|
+
|
|
310
|
+
Customize the underlying HTTP client for unsupported environments:
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
import { CatchAllApiClient } from "newscatcher-catchall-sdk";
|
|
314
|
+
|
|
315
|
+
const client = new CatchAllApiClient({
|
|
316
|
+
apiKey: "YOUR_API_KEY",
|
|
317
|
+
fetcher: // provide your implementation here
|
|
318
|
+
});
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Beta status
|
|
322
|
+
|
|
323
|
+
CatchAll API is in beta. Breaking changes may occur in minor version updates. See the [Changelog](https://www.newscatcherapi.com/docs/v3/catch-all/overview/changelog) for updates.
|
|
324
|
+
|
|
325
|
+
## Contributing
|
|
326
|
+
|
|
327
|
+
This library is generated programmatically from our API specification. Direct contributions to the generated code cannot be merged, but README improvements are welcome. To suggest SDK changes, please [open an issue](https://github.com/Newscatcher/newscatcher-catchall-typescript/issues).
|
|
328
|
+
|
|
329
|
+
## Support
|
|
330
|
+
|
|
331
|
+
- Documentation: [https://www.newscatcherapi.com/docs/v3/catch-all](https://www.newscatcherapi.com/docs/v3/catch-all)
|
|
332
|
+
- Support: <support@newscatcherapi.com>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as core from "./core/index.js";
|
|
2
|
+
import type * as environments from "./environments.js";
|
|
3
|
+
export interface BaseClientOptions {
|
|
4
|
+
environment?: core.Supplier<environments.CatchAllApiEnvironment | string>;
|
|
5
|
+
/** Specify a custom URL to connect the client to. */
|
|
6
|
+
baseUrl?: core.Supplier<string>;
|
|
7
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
8
|
+
/** Additional headers to include in requests. */
|
|
9
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
|
+
/** The default maximum time to wait for a response in seconds. */
|
|
11
|
+
timeoutInSeconds?: number;
|
|
12
|
+
/** The default number of times to retry the request. Defaults to 2. */
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
/** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
|
|
15
|
+
fetch?: typeof fetch;
|
|
16
|
+
/** Configure logging for the client. */
|
|
17
|
+
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
18
|
+
}
|
|
19
|
+
export interface BaseRequestOptions {
|
|
20
|
+
/** The maximum time to wait for a response in seconds. */
|
|
21
|
+
timeoutInSeconds?: number;
|
|
22
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
23
|
+
maxRetries?: number;
|
|
24
|
+
/** A hook to abort the request. */
|
|
25
|
+
abortSignal?: AbortSignal;
|
|
26
|
+
/** Additional query string parameters to include in the request. */
|
|
27
|
+
queryParams?: Record<string, unknown>;
|
|
28
|
+
/** Additional headers to include in the request. */
|
|
29
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
30
|
+
}
|
|
31
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): T;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.normalizeClientOptions = normalizeClientOptions;
|
|
38
|
+
const headers_js_1 = require("./core/headers.js");
|
|
39
|
+
const core = __importStar(require("./core/index.js"));
|
|
40
|
+
function normalizeClientOptions(options) {
|
|
41
|
+
const headers = (0, headers_js_1.mergeHeaders)({
|
|
42
|
+
"X-Fern-Language": "JavaScript",
|
|
43
|
+
"X-Fern-SDK-Name": "newscatcher-catchall-sdk",
|
|
44
|
+
"X-Fern-SDK-Version": "0.1.0",
|
|
45
|
+
"User-Agent": "newscatcher-catchall-sdk/0.1.0",
|
|
46
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
47
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
48
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
49
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JobsClient } from "./api/resources/jobs/client/Client.js";
|
|
2
|
+
import { MetaClient } from "./api/resources/meta/client/Client.js";
|
|
3
|
+
import { MonitorsClient } from "./api/resources/monitors/client/Client.js";
|
|
4
|
+
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
5
|
+
export declare namespace CatchAllApiClient {
|
|
6
|
+
interface Options extends BaseClientOptions {
|
|
7
|
+
}
|
|
8
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare class CatchAllApiClient {
|
|
12
|
+
protected readonly _options: CatchAllApiClient.Options;
|
|
13
|
+
protected _jobs: JobsClient | undefined;
|
|
14
|
+
protected _monitors: MonitorsClient | undefined;
|
|
15
|
+
protected _meta: MetaClient | undefined;
|
|
16
|
+
constructor(options?: CatchAllApiClient.Options);
|
|
17
|
+
get jobs(): JobsClient;
|
|
18
|
+
get monitors(): MonitorsClient;
|
|
19
|
+
get meta(): MetaClient;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CatchAllApiClient = void 0;
|
|
5
|
+
const Client_js_1 = require("./api/resources/jobs/client/Client.js");
|
|
6
|
+
const Client_js_2 = require("./api/resources/meta/client/Client.js");
|
|
7
|
+
const Client_js_3 = require("./api/resources/monitors/client/Client.js");
|
|
8
|
+
const BaseClient_js_1 = require("./BaseClient.js");
|
|
9
|
+
class CatchAllApiClient {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
12
|
+
}
|
|
13
|
+
get jobs() {
|
|
14
|
+
var _a;
|
|
15
|
+
return ((_a = this._jobs) !== null && _a !== void 0 ? _a : (this._jobs = new Client_js_1.JobsClient(this._options)));
|
|
16
|
+
}
|
|
17
|
+
get monitors() {
|
|
18
|
+
var _a;
|
|
19
|
+
return ((_a = this._monitors) !== null && _a !== void 0 ? _a : (this._monitors = new Client_js_3.MonitorsClient(this._options)));
|
|
20
|
+
}
|
|
21
|
+
get meta() {
|
|
22
|
+
var _a;
|
|
23
|
+
return ((_a = this._meta) !== null && _a !== void 0 ? _a : (this._meta = new Client_js_2.MetaClient(this._options)));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.CatchAllApiClient = CatchAllApiClient;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as CatchAllApi from "../index.js";
|
|
4
|
+
export declare class ForbiddenError extends errors.CatchAllApiError {
|
|
5
|
+
constructor(body: CatchAllApi.Error_, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ForbiddenError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class ForbiddenError extends errors.CatchAllApiError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "ForbiddenError",
|
|
43
|
+
statusCode: 403,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, ForbiddenError.prototype);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ForbiddenError = ForbiddenError;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as CatchAllApi from "../index.js";
|
|
4
|
+
export declare class NotFoundError extends errors.CatchAllApiError {
|
|
5
|
+
constructor(body: CatchAllApi.Error_, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.NotFoundError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class NotFoundError extends errors.CatchAllApiError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "NotFoundError",
|
|
43
|
+
statusCode: 404,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.NotFoundError = NotFoundError;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as CatchAllApi from "../index.js";
|
|
4
|
+
export declare class UnprocessableEntityError extends errors.CatchAllApiError {
|
|
5
|
+
constructor(body: CatchAllApi.ValidationErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.UnprocessableEntityError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class UnprocessableEntityError extends errors.CatchAllApiError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "UnprocessableEntityError",
|
|
43
|
+
statusCode: 422,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ForbiddenError.js"), exports);
|
|
18
|
+
__exportStar(require("./NotFoundError.js"), exports);
|
|
19
|
+
__exportStar(require("./UnprocessableEntityError.js"), exports);
|