newscatcher-catchall-sdk 1.1.2 → 1.4.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/README.md +365 -284
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +18 -0
- package/dist/cjs/Client.js +83 -6
- package/dist/cjs/api/errors/BadRequestError.d.ts +1 -2
- package/dist/cjs/api/resources/datasets/client/Client.d.ts +245 -0
- package/dist/cjs/api/resources/datasets/client/Client.js +779 -0
- package/dist/cjs/api/resources/datasets/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/datasets/client/index.js +17 -0
- package/dist/cjs/api/resources/datasets/client/requests/AddEntitiesToDatasetRequest.d.ts +15 -0
- package/dist/cjs/api/resources/datasets/client/requests/AddEntitiesToDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/CreateDatasetFromCsvRequest.d.ts +16 -0
- package/dist/cjs/api/resources/datasets/client/requests/CreateDatasetFromCsvRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/CreateDatasetRequest.d.ts +16 -0
- package/dist/cjs/api/resources/datasets/client/requests/CreateDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/DeleteDatasetRequest.d.ts +10 -0
- package/dist/cjs/api/resources/datasets/client/requests/DeleteDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/GetDatasetRequest.d.ts +10 -0
- package/dist/cjs/api/resources/datasets/client/requests/GetDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/GetDatasetStatusHistoryRequest.d.ts +10 -0
- package/dist/cjs/api/resources/datasets/client/requests/GetDatasetStatusHistoryRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.d.ts +19 -0
- package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.ts +21 -0
- package/dist/cjs/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/RemoveEntitiesFromDatasetRequest.d.ts +15 -0
- package/dist/cjs/api/resources/datasets/client/requests/RemoveEntitiesFromDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/UpdateDatasetRequest.d.ts +16 -0
- package/dist/cjs/api/resources/datasets/client/requests/UpdateDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/UploadCsvToDatasetRequest.d.ts +14 -0
- package/dist/cjs/api/resources/datasets/client/requests/UploadCsvToDatasetRequest.js +3 -0
- package/dist/cjs/api/resources/datasets/client/requests/index.d.ts +11 -0
- package/dist/cjs/api/resources/datasets/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/datasets/exports.d.ts +2 -0
- package/dist/cjs/api/resources/datasets/exports.js +21 -0
- package/dist/cjs/api/resources/datasets/index.d.ts +1 -0
- package/dist/cjs/api/resources/datasets/index.js +17 -0
- package/dist/cjs/api/resources/entities/client/Client.d.ts +164 -0
- package/dist/cjs/api/resources/entities/client/Client.js +468 -0
- package/dist/cjs/api/resources/entities/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/entities/client/index.js +17 -0
- package/dist/cjs/api/resources/entities/client/requests/CreateEntitiesBatchRequest.d.ts +35 -0
- package/dist/cjs/api/resources/entities/client/requests/CreateEntitiesBatchRequest.js +3 -0
- package/dist/cjs/api/resources/entities/client/requests/DeleteEntityRequest.d.ts +10 -0
- package/dist/cjs/api/resources/entities/client/requests/DeleteEntityRequest.js +3 -0
- package/dist/cjs/api/resources/entities/client/requests/GetEntityRequest.d.ts +10 -0
- package/dist/cjs/api/resources/entities/client/requests/GetEntityRequest.js +3 -0
- package/dist/cjs/api/resources/entities/client/requests/ListEntitiesRequest.d.ts +19 -0
- package/dist/cjs/api/resources/entities/client/requests/ListEntitiesRequest.js +3 -0
- package/dist/cjs/api/resources/entities/client/requests/UpdateEntityRequest.d.ts +22 -0
- package/dist/cjs/api/resources/entities/client/requests/UpdateEntityRequest.js +3 -0
- package/dist/cjs/api/resources/entities/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/entities/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/entities/exports.d.ts +2 -0
- package/dist/cjs/api/resources/entities/exports.js +21 -0
- package/dist/cjs/api/resources/entities/index.d.ts +1 -0
- package/dist/cjs/api/resources/entities/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +5 -1
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +32 -31
- package/dist/cjs/api/resources/jobs/client/Client.js +75 -74
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +28 -1
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.js +14 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/jobs/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/meta/client/Client.d.ts +15 -3
- package/dist/cjs/api/resources/meta/client/Client.js +49 -1
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +40 -40
- package/dist/cjs/api/resources/monitors/client/Client.js +101 -101
- package/dist/cjs/api/types/AdditionalAttributes.d.ts +7 -0
- package/dist/cjs/api/types/AdditionalAttributes.js +3 -0
- package/dist/cjs/api/types/CompanyAttributes.d.ts +17 -0
- package/dist/cjs/api/types/CompanyAttributes.js +3 -0
- package/dist/cjs/api/types/ConnectedEntity.d.ts +30 -0
- package/dist/cjs/api/types/ConnectedEntity.js +3 -0
- package/dist/cjs/api/types/CreateDatasetCsvResponse.d.ts +10 -0
- package/dist/cjs/api/types/CreateDatasetCsvResponse.js +3 -0
- package/dist/cjs/api/types/CreateEntitiesBatchResponse.d.ts +7 -0
- package/dist/cjs/api/types/CreateEntitiesBatchResponse.js +3 -0
- package/dist/cjs/api/types/CreateEntityRequest.d.ts +13 -0
- package/dist/cjs/api/types/CreateEntityRequest.js +3 -0
- package/dist/cjs/api/types/CreateEntityResponse.d.ts +6 -0
- package/dist/cjs/api/types/CreateEntityResponse.js +3 -0
- package/dist/cjs/api/types/DatasetEntityIdsRequest.d.ts +4 -0
- package/dist/cjs/api/types/DatasetEntityIdsRequest.js +3 -0
- package/dist/cjs/api/types/DatasetEntityListResponse.d.ts +11 -0
- package/dist/cjs/api/types/DatasetEntityListResponse.js +3 -0
- package/dist/cjs/api/types/DatasetListResponse.d.ts +11 -0
- package/dist/cjs/api/types/DatasetListResponse.js +3 -0
- package/dist/cjs/api/types/DatasetResponse.d.ts +20 -0
- package/dist/cjs/api/types/DatasetResponse.js +3 -0
- package/dist/cjs/api/types/DatasetSortBy.d.ts +7 -0
- package/dist/cjs/api/types/DatasetSortBy.js +10 -0
- package/dist/cjs/api/types/DatasetStatus.d.ts +15 -0
- package/dist/cjs/api/types/DatasetStatus.js +18 -0
- package/dist/cjs/api/types/DatasetStatusEntry.d.ts +11 -0
- package/dist/cjs/api/types/DatasetStatusEntry.js +3 -0
- package/dist/cjs/api/types/DatasetStatusHistoryResponse.d.ts +7 -0
- package/dist/cjs/api/types/DatasetStatusHistoryResponse.js +3 -0
- package/dist/cjs/api/types/EnrichmentType.d.ts +3 -1
- package/dist/cjs/api/types/EnrichmentType.js +3 -1
- package/dist/cjs/api/types/EntityListResponse.d.ts +11 -0
- package/dist/cjs/api/types/EntityListResponse.js +3 -0
- package/dist/cjs/api/types/EntityResponse.d.ts +20 -0
- package/dist/cjs/api/types/EntityResponse.js +3 -0
- package/dist/cjs/api/types/EntitySortBy.d.ts +7 -0
- package/dist/cjs/api/types/EntitySortBy.js +10 -0
- package/dist/cjs/api/types/EntityStatus.d.ts +15 -0
- package/dist/cjs/api/types/EntityStatus.js +18 -0
- package/dist/cjs/api/types/EntitySummary.d.ts +18 -0
- package/dist/cjs/api/types/EntitySummary.js +3 -0
- package/dist/cjs/api/types/EntityType.d.ts +11 -0
- package/dist/cjs/api/types/EntityType.js +14 -0
- package/dist/cjs/api/types/EntityValidationErrorBody.d.ts +16 -0
- package/dist/cjs/api/types/EntityValidationErrorBody.js +3 -0
- package/dist/cjs/api/types/GetPlanLimitsResponseDto.d.ts +5 -0
- package/dist/cjs/api/types/GetPlanLimitsResponseDto.js +3 -0
- package/dist/cjs/api/types/ManageEntitiesResponse.d.ts +6 -0
- package/dist/cjs/api/types/ManageEntitiesResponse.js +3 -0
- package/dist/cjs/api/types/MonitorListItemDto.d.ts +4 -2
- package/dist/cjs/api/types/MonitorRecord.d.ts +1 -0
- package/dist/cjs/api/types/PlanFeature.d.ts +12 -0
- package/dist/cjs/api/types/PlanFeature.js +3 -0
- package/dist/cjs/api/types/PullJobResponseDto.d.ts +12 -8
- package/dist/cjs/api/types/PullJobResponseDto.js +9 -0
- package/dist/cjs/api/types/Record_.d.ts +5 -0
- package/dist/cjs/api/types/SkippedRow.d.ts +13 -0
- package/dist/cjs/api/types/SkippedRow.js +3 -0
- package/dist/cjs/api/types/SortOrder.d.ts +11 -0
- package/dist/cjs/api/types/SortOrder.js +14 -0
- package/dist/cjs/api/types/UploadCsvToDatasetResponse.d.ts +8 -0
- package/dist/cjs/api/types/UploadCsvToDatasetResponse.js +3 -0
- package/dist/cjs/api/types/UserJob.d.ts +12 -0
- package/dist/cjs/api/types/UserJob.js +9 -0
- package/dist/cjs/api/types/ValidationReport.d.ts +17 -0
- package/dist/cjs/api/types/ValidationReport.js +3 -0
- package/dist/cjs/api/types/index.d.ts +29 -0
- package/dist/cjs/api/types/index.js +29 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +1 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -0
- package/dist/cjs/core/fetcher/Fetcher.js +4 -0
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- package/dist/cjs/core/file/exports.d.ts +1 -0
- package/dist/cjs/core/file/exports.js +2 -0
- package/dist/cjs/core/file/file.d.ts +10 -0
- package/dist/cjs/core/file/file.js +222 -0
- package/dist/cjs/core/file/index.d.ts +2 -0
- package/dist/cjs/core/file/index.js +18 -0
- package/dist/cjs/core/file/types.d.ts +66 -0
- package/dist/cjs/core/file/types.js +2 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.js +185 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/cjs/core/form-data-utils/index.d.ts +2 -0
- package/dist/cjs/core/form-data-utils/index.js +20 -0
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +3 -1
- package/dist/cjs/errors/CatchAllApiError.d.ts +3 -1
- package/dist/cjs/errors/CatchAllApiError.js +4 -1
- package/dist/cjs/errors/CatchAllApiTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/CatchAllApiTimeoutError.js +4 -1
- package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +18 -0
- package/dist/esm/Client.mjs +44 -0
- package/dist/esm/api/errors/BadRequestError.d.mts +1 -2
- package/dist/esm/api/resources/datasets/client/Client.d.mts +245 -0
- package/dist/esm/api/resources/datasets/client/Client.mjs +742 -0
- package/dist/esm/api/resources/datasets/client/index.d.mts +1 -0
- package/dist/esm/api/resources/datasets/client/index.mjs +1 -0
- package/dist/esm/api/resources/datasets/client/requests/AddEntitiesToDatasetRequest.d.mts +15 -0
- package/dist/esm/api/resources/datasets/client/requests/AddEntitiesToDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/CreateDatasetFromCsvRequest.d.mts +16 -0
- package/dist/esm/api/resources/datasets/client/requests/CreateDatasetFromCsvRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/CreateDatasetRequest.d.mts +16 -0
- package/dist/esm/api/resources/datasets/client/requests/CreateDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/DeleteDatasetRequest.d.mts +10 -0
- package/dist/esm/api/resources/datasets/client/requests/DeleteDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/GetDatasetRequest.d.mts +10 -0
- package/dist/esm/api/resources/datasets/client/requests/GetDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/GetDatasetStatusHistoryRequest.d.mts +10 -0
- package/dist/esm/api/resources/datasets/client/requests/GetDatasetStatusHistoryRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.d.mts +19 -0
- package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.mts +21 -0
- package/dist/esm/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/RemoveEntitiesFromDatasetRequest.d.mts +15 -0
- package/dist/esm/api/resources/datasets/client/requests/RemoveEntitiesFromDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/UpdateDatasetRequest.d.mts +16 -0
- package/dist/esm/api/resources/datasets/client/requests/UpdateDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/UploadCsvToDatasetRequest.d.mts +14 -0
- package/dist/esm/api/resources/datasets/client/requests/UploadCsvToDatasetRequest.mjs +2 -0
- package/dist/esm/api/resources/datasets/client/requests/index.d.mts +11 -0
- package/dist/esm/api/resources/datasets/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/datasets/exports.d.mts +2 -0
- package/dist/esm/api/resources/datasets/exports.mjs +3 -0
- package/dist/esm/api/resources/datasets/index.d.mts +1 -0
- package/dist/esm/api/resources/datasets/index.mjs +1 -0
- package/dist/esm/api/resources/entities/client/Client.d.mts +164 -0
- package/dist/esm/api/resources/entities/client/Client.mjs +431 -0
- package/dist/esm/api/resources/entities/client/index.d.mts +1 -0
- package/dist/esm/api/resources/entities/client/index.mjs +1 -0
- package/dist/esm/api/resources/entities/client/requests/CreateEntitiesBatchRequest.d.mts +35 -0
- package/dist/esm/api/resources/entities/client/requests/CreateEntitiesBatchRequest.mjs +2 -0
- package/dist/esm/api/resources/entities/client/requests/DeleteEntityRequest.d.mts +10 -0
- package/dist/esm/api/resources/entities/client/requests/DeleteEntityRequest.mjs +2 -0
- package/dist/esm/api/resources/entities/client/requests/GetEntityRequest.d.mts +10 -0
- package/dist/esm/api/resources/entities/client/requests/GetEntityRequest.mjs +2 -0
- package/dist/esm/api/resources/entities/client/requests/ListEntitiesRequest.d.mts +19 -0
- package/dist/esm/api/resources/entities/client/requests/ListEntitiesRequest.mjs +2 -0
- package/dist/esm/api/resources/entities/client/requests/UpdateEntityRequest.d.mts +22 -0
- package/dist/esm/api/resources/entities/client/requests/UpdateEntityRequest.mjs +2 -0
- package/dist/esm/api/resources/entities/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/entities/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/entities/exports.d.mts +2 -0
- package/dist/esm/api/resources/entities/exports.mjs +3 -0
- package/dist/esm/api/resources/entities/index.d.mts +1 -0
- package/dist/esm/api/resources/entities/index.mjs +1 -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 +32 -31
- package/dist/esm/api/resources/jobs/client/Client.mjs +75 -74
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +28 -1
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.mjs +13 -1
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/meta/client/Client.d.mts +15 -3
- package/dist/esm/api/resources/meta/client/Client.mjs +50 -2
- package/dist/esm/api/resources/monitors/client/Client.d.mts +40 -40
- package/dist/esm/api/resources/monitors/client/Client.mjs +101 -101
- package/dist/esm/api/types/AdditionalAttributes.d.mts +7 -0
- package/dist/esm/api/types/AdditionalAttributes.mjs +2 -0
- package/dist/esm/api/types/CompanyAttributes.d.mts +17 -0
- package/dist/esm/api/types/CompanyAttributes.mjs +2 -0
- package/dist/esm/api/types/ConnectedEntity.d.mts +30 -0
- package/dist/esm/api/types/ConnectedEntity.mjs +2 -0
- package/dist/esm/api/types/CreateDatasetCsvResponse.d.mts +10 -0
- package/dist/esm/api/types/CreateDatasetCsvResponse.mjs +2 -0
- package/dist/esm/api/types/CreateEntitiesBatchResponse.d.mts +7 -0
- package/dist/esm/api/types/CreateEntitiesBatchResponse.mjs +2 -0
- package/dist/esm/api/types/CreateEntityRequest.d.mts +13 -0
- package/dist/esm/api/types/CreateEntityRequest.mjs +2 -0
- package/dist/esm/api/types/CreateEntityResponse.d.mts +6 -0
- package/dist/esm/api/types/CreateEntityResponse.mjs +2 -0
- package/dist/esm/api/types/DatasetEntityIdsRequest.d.mts +4 -0
- package/dist/esm/api/types/DatasetEntityIdsRequest.mjs +2 -0
- package/dist/esm/api/types/DatasetEntityListResponse.d.mts +11 -0
- package/dist/esm/api/types/DatasetEntityListResponse.mjs +2 -0
- package/dist/esm/api/types/DatasetListResponse.d.mts +11 -0
- package/dist/esm/api/types/DatasetListResponse.mjs +2 -0
- package/dist/esm/api/types/DatasetResponse.d.mts +20 -0
- package/dist/esm/api/types/DatasetResponse.mjs +2 -0
- package/dist/esm/api/types/DatasetSortBy.d.mts +7 -0
- package/dist/esm/api/types/DatasetSortBy.mjs +7 -0
- package/dist/esm/api/types/DatasetStatus.d.mts +15 -0
- package/dist/esm/api/types/DatasetStatus.mjs +15 -0
- package/dist/esm/api/types/DatasetStatusEntry.d.mts +11 -0
- package/dist/esm/api/types/DatasetStatusEntry.mjs +2 -0
- package/dist/esm/api/types/DatasetStatusHistoryResponse.d.mts +7 -0
- package/dist/esm/api/types/DatasetStatusHistoryResponse.mjs +2 -0
- package/dist/esm/api/types/EnrichmentType.d.mts +3 -1
- package/dist/esm/api/types/EnrichmentType.mjs +3 -1
- package/dist/esm/api/types/EntityListResponse.d.mts +11 -0
- package/dist/esm/api/types/EntityListResponse.mjs +2 -0
- package/dist/esm/api/types/EntityResponse.d.mts +20 -0
- package/dist/esm/api/types/EntityResponse.mjs +2 -0
- package/dist/esm/api/types/EntitySortBy.d.mts +7 -0
- package/dist/esm/api/types/EntitySortBy.mjs +7 -0
- package/dist/esm/api/types/EntityStatus.d.mts +15 -0
- package/dist/esm/api/types/EntityStatus.mjs +15 -0
- package/dist/esm/api/types/EntitySummary.d.mts +18 -0
- package/dist/esm/api/types/EntitySummary.mjs +2 -0
- package/dist/esm/api/types/EntityType.d.mts +11 -0
- package/dist/esm/api/types/EntityType.mjs +11 -0
- package/dist/esm/api/types/EntityValidationErrorBody.d.mts +16 -0
- package/dist/esm/api/types/EntityValidationErrorBody.mjs +2 -0
- package/dist/esm/api/types/GetPlanLimitsResponseDto.d.mts +5 -0
- package/dist/esm/api/types/GetPlanLimitsResponseDto.mjs +2 -0
- package/dist/esm/api/types/ManageEntitiesResponse.d.mts +6 -0
- package/dist/esm/api/types/ManageEntitiesResponse.mjs +2 -0
- package/dist/esm/api/types/MonitorListItemDto.d.mts +4 -2
- package/dist/esm/api/types/MonitorRecord.d.mts +1 -0
- package/dist/esm/api/types/PlanFeature.d.mts +12 -0
- package/dist/esm/api/types/PlanFeature.mjs +2 -0
- package/dist/esm/api/types/PullJobResponseDto.d.mts +12 -8
- package/dist/esm/api/types/PullJobResponseDto.mjs +8 -1
- package/dist/esm/api/types/Record_.d.mts +5 -0
- package/dist/esm/api/types/SkippedRow.d.mts +13 -0
- package/dist/esm/api/types/SkippedRow.mjs +2 -0
- package/dist/esm/api/types/SortOrder.d.mts +11 -0
- package/dist/esm/api/types/SortOrder.mjs +11 -0
- package/dist/esm/api/types/UploadCsvToDatasetResponse.d.mts +8 -0
- package/dist/esm/api/types/UploadCsvToDatasetResponse.mjs +2 -0
- package/dist/esm/api/types/UserJob.d.mts +12 -0
- package/dist/esm/api/types/UserJob.mjs +8 -1
- package/dist/esm/api/types/ValidationReport.d.mts +17 -0
- package/dist/esm/api/types/ValidationReport.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +29 -0
- package/dist/esm/api/types/index.mjs +29 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.d.mts +2 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +4 -0
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- package/dist/esm/core/file/exports.d.mts +1 -0
- package/dist/esm/core/file/exports.mjs +1 -0
- package/dist/esm/core/file/file.d.mts +10 -0
- package/dist/esm/core/file/file.mjs +185 -0
- package/dist/esm/core/file/index.d.mts +2 -0
- package/dist/esm/core/file/index.mjs +2 -0
- package/dist/esm/core/file/types.d.mts +66 -0
- package/dist/esm/core/file/types.mjs +1 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +147 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/dist/esm/core/form-data-utils/index.d.mts +2 -0
- package/dist/esm/core/form-data-utils/index.mjs +2 -0
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/errors/CatchAllApiError.d.mts +3 -1
- package/dist/esm/errors/CatchAllApiError.mjs +4 -1
- package/dist/esm/errors/CatchAllApiTimeoutError.d.mts +4 -1
- package/dist/esm/errors/CatchAllApiTimeoutError.mjs +4 -1
- package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +29 -7
- package/reference.md +1312 -58
package/README.md
CHANGED
|
@@ -1,284 +1,365 @@
|
|
|
1
|
-
# Newscatcher
|
|
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
|
|
7
|
-
|
|
8
|
-
## Table of Contents
|
|
9
|
-
|
|
10
|
-
- [Documentation](#documentation)
|
|
11
|
-
- [Installation](#installation)
|
|
12
|
-
- [Reference](#reference)
|
|
13
|
-
- [Usage](#usage)
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
- [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
1
|
+
# Newscatcher 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 TypeScript library provides convenient access to the Newscatcher APIs from TypeScript.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Documentation](#documentation)
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Reference](#reference)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
- [Environments](#environments)
|
|
15
|
+
- [Request and Response Types](#request-and-response-types)
|
|
16
|
+
- [Exception Handling](#exception-handling)
|
|
17
|
+
- [File Uploads](#file-uploads)
|
|
18
|
+
- [Advanced](#advanced)
|
|
19
|
+
- [Subpackage Exports](#subpackage-exports)
|
|
20
|
+
- [Additional Headers](#additional-headers)
|
|
21
|
+
- [Additional Query String Parameters](#additional-query-string-parameters)
|
|
22
|
+
- [Retries](#retries)
|
|
23
|
+
- [Timeouts](#timeouts)
|
|
24
|
+
- [Aborting Requests](#aborting-requests)
|
|
25
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
26
|
+
- [Logging](#logging)
|
|
27
|
+
- [Custom Fetch](#custom-fetch)
|
|
28
|
+
- [Runtime Compatibility](#runtime-compatibility)
|
|
29
|
+
- [Contributing](#contributing)
|
|
30
|
+
- [Support](#support)
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
|
|
34
|
+
API reference documentation is available [here](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/initialize-job).
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npm i -s newscatcher-catchall-sdk
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Reference
|
|
43
|
+
|
|
44
|
+
A full reference for this library is available [here](https://github.com/Newscatcher/newscatcher-catchall-typescript/blob/HEAD/./reference.md).
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
Instantiate and use the client with the following:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { CatchAllApiClient } from "newscatcher-catchall-sdk";
|
|
52
|
+
|
|
53
|
+
const client = new CatchAllApiClient({ apiKey: "YOUR_API_KEY" });
|
|
54
|
+
await client.jobs.createJob({
|
|
55
|
+
query: "Series B funding rounds for SaaS startups",
|
|
56
|
+
context: "Focus on funding amount and company name",
|
|
57
|
+
limit: 10,
|
|
58
|
+
start_date: "2026-02-18T00:00:00Z",
|
|
59
|
+
end_date: "2026-02-23T00:00:00Z",
|
|
60
|
+
mode: "base"
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Environments
|
|
65
|
+
|
|
66
|
+
This SDK allows you to configure different environments for API requests.
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { CatchAllApiClient, CatchAllApiEnvironment } from "newscatcher-catchall-sdk";
|
|
70
|
+
|
|
71
|
+
const client = new CatchAllApiClient({
|
|
72
|
+
environment: CatchAllApiEnvironment.Default,
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Request and Response Types
|
|
77
|
+
|
|
78
|
+
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
79
|
+
following namespace:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { CatchAllApi } from "newscatcher-catchall-sdk";
|
|
83
|
+
|
|
84
|
+
const request: CatchAllApi.GetUserJobsRequest = {
|
|
85
|
+
...
|
|
86
|
+
};
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Exception Handling
|
|
90
|
+
|
|
91
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
92
|
+
will be thrown.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { CatchAllApiError } from "newscatcher-catchall-sdk";
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
await client.jobs.createJob(...);
|
|
99
|
+
} catch (err) {
|
|
100
|
+
if (err instanceof CatchAllApiError) {
|
|
101
|
+
console.log(err.statusCode);
|
|
102
|
+
console.log(err.message);
|
|
103
|
+
console.log(err.body);
|
|
104
|
+
console.log(err.rawResponse);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## File Uploads
|
|
110
|
+
|
|
111
|
+
You can upload files using the client:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { createReadStream } from "fs";
|
|
115
|
+
import * as fs from "fs";
|
|
116
|
+
import { CatchAllApiClient } from "newscatcher-catchall-sdk";
|
|
117
|
+
|
|
118
|
+
const client = new CatchAllApiClient({ apiKey: "YOUR_API_KEY" });
|
|
119
|
+
await client.datasets.createDatasetFromCsv({
|
|
120
|
+
file: fs.createReadStream("/path/to/your/file"),
|
|
121
|
+
name: "name"
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
The client accepts a variety of types for file upload parameters:
|
|
125
|
+
* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream`
|
|
126
|
+
* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array`
|
|
127
|
+
|
|
128
|
+
### Metadata
|
|
129
|
+
|
|
130
|
+
You can configure metadata when uploading a file:
|
|
131
|
+
```typescript
|
|
132
|
+
const file: Uploadable.WithMetadata = {
|
|
133
|
+
data: createReadStream("path/to/file"),
|
|
134
|
+
filename: "my-file", // optional
|
|
135
|
+
contentType: "audio/mpeg", // optional
|
|
136
|
+
contentLength: 1949, // optional
|
|
137
|
+
};
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Alternatively, you can upload a file directly from a file path:
|
|
141
|
+
```typescript
|
|
142
|
+
const file : Uploadable.FromPath = {
|
|
143
|
+
path: "path/to/file",
|
|
144
|
+
filename: "my-file", // optional
|
|
145
|
+
contentType: "audio/mpeg", // optional
|
|
146
|
+
contentLength: 1949, // optional
|
|
147
|
+
};
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically.
|
|
151
|
+
For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory.
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## Advanced
|
|
155
|
+
|
|
156
|
+
### Subpackage Exports
|
|
157
|
+
|
|
158
|
+
This SDK supports direct imports of subpackage clients, which allows JavaScript bundlers to tree-shake and include only the imported subpackage code. This results in much smaller bundle sizes.
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
import { JobsClient } from 'newscatcher-catchall-sdk/jobs';
|
|
162
|
+
|
|
163
|
+
const client = new JobsClient({...});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Additional Headers
|
|
167
|
+
|
|
168
|
+
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
import { CatchAllApiClient } from "newscatcher-catchall-sdk";
|
|
172
|
+
|
|
173
|
+
const client = new CatchAllApiClient({
|
|
174
|
+
...
|
|
175
|
+
headers: {
|
|
176
|
+
'X-Custom-Header': 'custom value'
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const response = await client.jobs.createJob(..., {
|
|
181
|
+
headers: {
|
|
182
|
+
'X-Custom-Header': 'custom value'
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Additional Query String Parameters
|
|
188
|
+
|
|
189
|
+
If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
const response = await client.jobs.createJob(..., {
|
|
193
|
+
queryParams: {
|
|
194
|
+
'customQueryParamKey': 'custom query param value'
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Retries
|
|
200
|
+
|
|
201
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
202
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
203
|
+
retry limit (default: 2).
|
|
204
|
+
|
|
205
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
206
|
+
|
|
207
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
208
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
209
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
210
|
+
|
|
211
|
+
Use the `maxRetries` request option to configure this behavior.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
const response = await client.jobs.createJob(..., {
|
|
215
|
+
maxRetries: 0 // override maxRetries at the request level
|
|
216
|
+
});
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Timeouts
|
|
220
|
+
|
|
221
|
+
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
const response = await client.jobs.createJob(..., {
|
|
225
|
+
timeoutInSeconds: 30 // override timeout to 30s
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Aborting Requests
|
|
230
|
+
|
|
231
|
+
The SDK allows users to abort requests at any point by passing in an abort signal.
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
const controller = new AbortController();
|
|
235
|
+
const response = await client.jobs.createJob(..., {
|
|
236
|
+
abortSignal: controller.signal
|
|
237
|
+
});
|
|
238
|
+
controller.abort(); // aborts the request
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Access Raw Response Data
|
|
242
|
+
|
|
243
|
+
The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
|
|
244
|
+
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
const { data, rawResponse } = await client.jobs.createJob(...).withRawResponse();
|
|
248
|
+
|
|
249
|
+
console.log(data);
|
|
250
|
+
console.log(rawResponse.headers['X-My-Header']);
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Logging
|
|
254
|
+
|
|
255
|
+
The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
import { CatchAllApiClient, logging } from "newscatcher-catchall-sdk";
|
|
259
|
+
|
|
260
|
+
const client = new CatchAllApiClient({
|
|
261
|
+
...
|
|
262
|
+
logging: {
|
|
263
|
+
level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
|
|
264
|
+
logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
|
|
265
|
+
silent: false, // defaults to true, set to false to enable logging
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
```
|
|
269
|
+
The `logging` object can have the following properties:
|
|
270
|
+
- `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
|
|
271
|
+
- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
|
|
272
|
+
- `silent`: Whether to silence the logger. Defaults to `true`.
|
|
273
|
+
|
|
274
|
+
The `level` property can be one of the following values:
|
|
275
|
+
- `logging.LogLevel.Debug`
|
|
276
|
+
- `logging.LogLevel.Info`
|
|
277
|
+
- `logging.LogLevel.Warn`
|
|
278
|
+
- `logging.LogLevel.Error`
|
|
279
|
+
|
|
280
|
+
To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
|
|
281
|
+
|
|
282
|
+
<details>
|
|
283
|
+
<summary>Custom logger examples</summary>
|
|
284
|
+
|
|
285
|
+
Here's an example using the popular `winston` logging library.
|
|
286
|
+
```ts
|
|
287
|
+
import winston from 'winston';
|
|
288
|
+
|
|
289
|
+
const winstonLogger = winston.createLogger({...});
|
|
290
|
+
|
|
291
|
+
const logger: logging.ILogger = {
|
|
292
|
+
debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
|
|
293
|
+
info: (msg, ...args) => winstonLogger.info(msg, ...args),
|
|
294
|
+
warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
|
|
295
|
+
error: (msg, ...args) => winstonLogger.error(msg, ...args),
|
|
296
|
+
};
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Here's an example using the popular `pino` logging library.
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
import pino from 'pino';
|
|
303
|
+
|
|
304
|
+
const pinoLogger = pino({...});
|
|
305
|
+
|
|
306
|
+
const logger: logging.ILogger = {
|
|
307
|
+
debug: (msg, ...args) => pinoLogger.debug(args, msg),
|
|
308
|
+
info: (msg, ...args) => pinoLogger.info(args, msg),
|
|
309
|
+
warn: (msg, ...args) => pinoLogger.warn(args, msg),
|
|
310
|
+
error: (msg, ...args) => pinoLogger.error(args, msg),
|
|
311
|
+
};
|
|
312
|
+
```
|
|
313
|
+
</details>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
### Custom Fetch
|
|
317
|
+
|
|
318
|
+
The SDK provides a low-level `fetch` method for making custom HTTP requests while still
|
|
319
|
+
benefiting from SDK-level configuration like authentication, retries, timeouts, and logging.
|
|
320
|
+
This is useful for calling API endpoints not yet supported in the SDK.
|
|
321
|
+
|
|
322
|
+
```typescript
|
|
323
|
+
const response = await client.fetch("/v1/custom/endpoint", {
|
|
324
|
+
method: "GET",
|
|
325
|
+
}, {
|
|
326
|
+
timeoutInSeconds: 30,
|
|
327
|
+
maxRetries: 3,
|
|
328
|
+
headers: {
|
|
329
|
+
"X-Custom-Header": "custom-value",
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
const data = await response.json();
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Runtime Compatibility
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
The SDK works in the following runtimes:
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
- Node.js 18+
|
|
344
|
+
- Vercel
|
|
345
|
+
- Cloudflare Workers
|
|
346
|
+
- Deno v1.25+
|
|
347
|
+
- Bun 1.0+
|
|
348
|
+
- React Native
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
## Contributing
|
|
352
|
+
|
|
353
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
354
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
355
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
356
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
357
|
+
an issue first to discuss with us!
|
|
358
|
+
|
|
359
|
+
On the other hand, contributions to the README are always very welcome!
|
|
360
|
+
## Support
|
|
361
|
+
|
|
362
|
+
- Documentation: [www.newscatcherapi.com/docs/web-search-api](https://www.newscatcherapi.com/docs/web-search-api/get-started/introduction)
|
|
363
|
+
- Support: <support@newscatcherapi.com>
|
|
364
|
+
|
|
365
|
+
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "newscatcher-catchall-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "1.
|
|
47
|
-
"User-Agent": "newscatcher-catchall-sdk/1.
|
|
46
|
+
"X-Fern-SDK-Version": "1.4.0",
|
|
47
|
+
"User-Agent": "newscatcher-catchall-sdk/1.4.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|