newscatcher-catchall-sdk 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +10 -0
- package/dist/cjs/api/resources/datasets/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/datasets/client/Client.js +4 -2
- package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.d.ts +4 -1
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +6 -1
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +21 -1
- package/dist/cjs/api/resources/jobs/client/Client.js +63 -2
- package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +5 -1
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +4 -0
- package/dist/cjs/api/resources/jobs/client/requests/ValidateQueryRequestDto.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/ValidateQueryRequestDto.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +5 -15
- package/dist/cjs/api/resources/monitors/client/Client.js +7 -16
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +10 -10
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +5 -1
- package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +7 -10
- package/dist/cjs/api/resources/monitors/types/DisableMonitorResponse.d.ts +1 -1
- package/dist/cjs/api/resources/monitors/types/EnableMonitorResponse.d.ts +1 -1
- package/dist/cjs/api/resources/projects/client/Client.d.ts +178 -0
- package/dist/cjs/api/resources/projects/client/Client.js +626 -0
- package/dist/cjs/api/resources/projects/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/projects/client/index.js +17 -0
- package/dist/cjs/api/resources/projects/client/requests/AddResourceRequestDto.d.ts +17 -0
- package/dist/cjs/api/resources/projects/client/requests/AddResourceRequestDto.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequestDto.d.ts +13 -0
- package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequestDto.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/DeleteProjectRequest.d.ts +12 -0
- package/dist/cjs/api/resources/projects/client/requests/DeleteProjectRequest.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/GetProjectOverviewRequest.d.ts +10 -0
- package/dist/cjs/api/resources/projects/client/requests/GetProjectOverviewRequest.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/GetProjectRequest.d.ts +10 -0
- package/dist/cjs/api/resources/projects/client/requests/GetProjectRequest.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/ListProjectResourcesRequest.d.ts +16 -0
- package/dist/cjs/api/resources/projects/client/requests/ListProjectResourcesRequest.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/ListProjectsRequest.d.ts +16 -0
- package/dist/cjs/api/resources/projects/client/requests/ListProjectsRequest.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.d.ts +16 -0
- package/dist/cjs/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequestDto.d.ts +15 -0
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequestDto.js +3 -0
- package/dist/cjs/api/resources/projects/client/requests/index.d.ts +9 -0
- package/dist/cjs/api/resources/projects/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/projects/exports.d.ts +2 -0
- package/dist/cjs/api/resources/projects/exports.js +21 -0
- package/dist/cjs/api/resources/projects/index.d.ts +1 -0
- package/dist/cjs/api/resources/projects/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +231 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +779 -0
- package/dist/cjs/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.d.ts +17 -0
- package/dist/cjs/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.ts +42 -0
- package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhookRequestDto.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/DeleteWebhookRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/client/requests/DeleteWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.d.ts +18 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.d.ts +16 -0
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.d.ts +19 -0
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +12 -0
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.d.ts +16 -0
- package/dist/cjs/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequestDto.d.ts +19 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequestDto.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.ts +30 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +11 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/webhooks/exports.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/exports.js +21 -0
- package/dist/cjs/api/resources/webhooks/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/index.js +18 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.d.ts +19 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.d.ts +16 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +18 -0
- package/dist/cjs/api/types/AddResourceResponseDto.d.ts +9 -0
- package/dist/cjs/api/types/AddResourceResponseDto.js +3 -0
- package/dist/cjs/api/types/ApiKeyAuthDto.d.ts +6 -0
- package/dist/cjs/api/types/ApiKeyAuthDto.js +3 -0
- package/dist/cjs/api/types/AssignWebhookResourceResponseDto.d.ts +11 -0
- package/dist/cjs/api/types/AssignWebhookResourceResponseDto.js +3 -0
- package/dist/cjs/api/types/BasicAuthDto.d.ts +6 -0
- package/dist/cjs/api/types/BasicAuthDto.js +3 -0
- package/dist/cjs/api/types/BearerAuthDto.d.ts +4 -0
- package/dist/cjs/api/types/BearerAuthDto.js +3 -0
- package/dist/cjs/api/types/ConnectedEntity.d.ts +1 -1
- package/dist/cjs/api/types/CreateProjectResponseDto.d.ts +10 -0
- package/dist/cjs/api/types/CreateProjectResponseDto.js +3 -0
- package/dist/cjs/api/types/CreateWebhookResponseDto.d.ts +9 -0
- package/dist/cjs/api/types/CreateWebhookResponseDto.js +3 -0
- package/dist/cjs/api/types/DeleteJobResponseDto.d.ts +1 -1
- package/dist/cjs/api/types/DeleteMonitorResponseDto.d.ts +1 -1
- package/dist/cjs/api/types/DeliveryHistoryItemDto.d.ts +25 -0
- package/dist/cjs/api/types/DeliveryHistoryItemDto.js +3 -0
- package/dist/cjs/api/types/DeliveryHistoryResponseDto.d.ts +17 -0
- package/dist/cjs/api/types/DeliveryHistoryResponseDto.js +3 -0
- package/dist/cjs/api/types/DeliveryMode.d.ts +11 -0
- package/dist/cjs/api/types/DeliveryMode.js +14 -0
- package/dist/cjs/api/types/DeliveryStatus.d.ts +6 -0
- package/dist/cjs/api/types/DeliveryStatus.js +9 -0
- package/dist/cjs/api/types/GetWebhookResponseDto.d.ts +9 -0
- package/dist/cjs/api/types/GetWebhookResponseDto.js +3 -0
- package/dist/cjs/api/types/HttpMethod.d.ts +9 -0
- package/dist/cjs/api/types/HttpMethod.js +12 -0
- package/dist/cjs/api/types/IssueType.d.ts +25 -0
- package/dist/cjs/api/types/IssueType.js +28 -0
- package/dist/cjs/api/types/JobStep.d.ts +1 -1
- package/dist/cjs/api/types/ListWebhookResourcesResponseDto.d.ts +13 -0
- package/dist/cjs/api/types/ListWebhookResourcesResponseDto.js +3 -0
- package/dist/cjs/api/types/ListWebhooksResponseDto.d.ts +13 -0
- package/dist/cjs/api/types/ListWebhooksResponseDto.js +3 -0
- package/dist/cjs/api/types/MappableResourceType.d.ts +7 -0
- package/dist/cjs/api/types/MappableResourceType.js +10 -0
- package/dist/cjs/api/types/MonitorListItemDto.d.ts +1 -1
- package/dist/cjs/api/types/MonitorStatusHistoryResponseDto.d.ts +1 -1
- package/dist/cjs/api/types/ProjectListResponseDto.d.ts +13 -0
- package/dist/cjs/api/types/ProjectListResponseDto.js +3 -0
- package/dist/cjs/api/types/ProjectOverviewCountsDto.d.ts +4 -0
- package/dist/cjs/api/types/ProjectOverviewCountsDto.js +3 -0
- package/dist/cjs/api/types/ProjectOverviewResponseDto.d.ts +18 -0
- package/dist/cjs/api/types/ProjectOverviewResponseDto.js +3 -0
- package/dist/cjs/api/types/ProjectResourceDto.d.ts +18 -0
- package/dist/cjs/api/types/ProjectResourceDto.js +3 -0
- package/dist/cjs/api/types/ProjectResourceListResponseDto.d.ts +13 -0
- package/dist/cjs/api/types/ProjectResourceListResponseDto.js +3 -0
- package/dist/cjs/api/types/ProjectResourceType.d.ts +8 -0
- package/dist/cjs/api/types/ProjectResourceType.js +11 -0
- package/dist/cjs/api/types/ProjectResponseDto.d.ts +18 -0
- package/dist/cjs/api/types/ProjectResponseDto.js +3 -0
- package/dist/cjs/api/types/ProjectSummaryDto.d.ts +17 -0
- package/dist/cjs/api/types/ProjectSummaryDto.js +3 -0
- package/dist/cjs/api/types/QueryStatus.d.ts +13 -0
- package/dist/cjs/api/types/QueryStatus.js +16 -0
- package/dist/cjs/api/types/RemoveResourceResponseDto.d.ts +6 -0
- package/dist/cjs/api/types/RemoveResourceResponseDto.js +3 -0
- package/dist/cjs/api/types/ResourceItemDto.d.ts +6 -0
- package/dist/cjs/api/types/ResourceItemDto.js +3 -0
- package/dist/cjs/api/types/ResourceResultDto.d.ts +12 -0
- package/dist/cjs/api/types/ResourceResultDto.js +3 -0
- package/dist/cjs/api/types/Suggestion.d.ts +12 -0
- package/dist/cjs/api/types/Suggestion.js +3 -0
- package/dist/cjs/api/types/TestWebhookResponseDto.d.ts +10 -0
- package/dist/cjs/api/types/TestWebhookResponseDto.js +3 -0
- package/dist/cjs/api/types/UpdateProjectResponseDto.d.ts +8 -0
- package/dist/cjs/api/types/UpdateProjectResponseDto.js +3 -0
- package/dist/cjs/api/types/UpdateWebhookResponseDto.d.ts +9 -0
- package/dist/cjs/api/types/UpdateWebhookResponseDto.js +3 -0
- package/dist/cjs/api/types/ValidateQueryResponseDto.d.ts +18 -0
- package/dist/cjs/api/types/ValidateQueryResponseDto.js +3 -0
- package/dist/cjs/api/types/WebhookResourceMappingResponseDto.d.ts +12 -0
- package/dist/cjs/api/types/WebhookResourceMappingResponseDto.js +3 -0
- package/dist/cjs/api/types/WebhookResponseDto.d.ts +28 -0
- package/dist/cjs/api/types/WebhookResponseDto.js +3 -0
- package/dist/cjs/api/types/WebhookType.d.ts +17 -0
- package/dist/cjs/api/types/WebhookType.js +20 -0
- package/dist/cjs/api/types/index.d.ts +37 -0
- package/dist/cjs/api/types/index.js +37 -0
- 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 +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/datasets/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/datasets/client/Client.mjs +4 -2
- package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.d.mts +4 -1
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/resources/jobs/client/Client.d.mts +21 -1
- package/dist/esm/api/resources/jobs/client/Client.mjs +63 -2
- package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +5 -1
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +4 -0
- package/dist/esm/api/resources/jobs/client/requests/ValidateQueryRequestDto.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/ValidateQueryRequestDto.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/monitors/client/Client.d.mts +5 -15
- package/dist/esm/api/resources/monitors/client/Client.mjs +7 -16
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +10 -10
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +5 -1
- package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +7 -10
- package/dist/esm/api/resources/monitors/types/DisableMonitorResponse.d.mts +1 -1
- package/dist/esm/api/resources/monitors/types/EnableMonitorResponse.d.mts +1 -1
- package/dist/esm/api/resources/projects/client/Client.d.mts +178 -0
- package/dist/esm/api/resources/projects/client/Client.mjs +589 -0
- package/dist/esm/api/resources/projects/client/index.d.mts +1 -0
- package/dist/esm/api/resources/projects/client/index.mjs +1 -0
- package/dist/esm/api/resources/projects/client/requests/AddResourceRequestDto.d.mts +17 -0
- package/dist/esm/api/resources/projects/client/requests/AddResourceRequestDto.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/CreateProjectRequestDto.d.mts +13 -0
- package/dist/esm/api/resources/projects/client/requests/CreateProjectRequestDto.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/DeleteProjectRequest.d.mts +12 -0
- package/dist/esm/api/resources/projects/client/requests/DeleteProjectRequest.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/GetProjectOverviewRequest.d.mts +10 -0
- package/dist/esm/api/resources/projects/client/requests/GetProjectOverviewRequest.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/GetProjectRequest.d.mts +10 -0
- package/dist/esm/api/resources/projects/client/requests/GetProjectRequest.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/ListProjectResourcesRequest.d.mts +16 -0
- package/dist/esm/api/resources/projects/client/requests/ListProjectResourcesRequest.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/ListProjectsRequest.d.mts +16 -0
- package/dist/esm/api/resources/projects/client/requests/ListProjectsRequest.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.d.mts +16 -0
- package/dist/esm/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequestDto.d.mts +15 -0
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequestDto.mjs +2 -0
- package/dist/esm/api/resources/projects/client/requests/index.d.mts +9 -0
- package/dist/esm/api/resources/projects/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/projects/exports.d.mts +2 -0
- package/dist/esm/api/resources/projects/exports.mjs +3 -0
- package/dist/esm/api/resources/projects/index.d.mts +1 -0
- package/dist/esm/api/resources/projects/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +231 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +742 -0
- package/dist/esm/api/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.d.mts +17 -0
- package/dist/esm/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.mts +42 -0
- package/dist/esm/api/resources/webhooks/client/requests/CreateWebhookRequestDto.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/DeleteWebhookRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/client/requests/DeleteWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.d.mts +18 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.d.mts +16 -0
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.d.mts +19 -0
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksRequest.d.mts +12 -0
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.d.mts +16 -0
- package/dist/esm/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequestDto.d.mts +19 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequestDto.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.mts +30 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +11 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/exports.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/exports.mjs +3 -0
- package/dist/esm/api/resources/webhooks/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/index.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.d.mts +19 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.d.mts +16 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +2 -0
- package/dist/esm/api/types/AddResourceResponseDto.d.mts +9 -0
- package/dist/esm/api/types/AddResourceResponseDto.mjs +2 -0
- package/dist/esm/api/types/ApiKeyAuthDto.d.mts +6 -0
- package/dist/esm/api/types/ApiKeyAuthDto.mjs +2 -0
- package/dist/esm/api/types/AssignWebhookResourceResponseDto.d.mts +11 -0
- package/dist/esm/api/types/AssignWebhookResourceResponseDto.mjs +2 -0
- package/dist/esm/api/types/BasicAuthDto.d.mts +6 -0
- package/dist/esm/api/types/BasicAuthDto.mjs +2 -0
- package/dist/esm/api/types/BearerAuthDto.d.mts +4 -0
- package/dist/esm/api/types/BearerAuthDto.mjs +2 -0
- package/dist/esm/api/types/ConnectedEntity.d.mts +1 -1
- package/dist/esm/api/types/CreateProjectResponseDto.d.mts +10 -0
- package/dist/esm/api/types/CreateProjectResponseDto.mjs +2 -0
- package/dist/esm/api/types/CreateWebhookResponseDto.d.mts +9 -0
- package/dist/esm/api/types/CreateWebhookResponseDto.mjs +2 -0
- package/dist/esm/api/types/DeleteJobResponseDto.d.mts +1 -1
- package/dist/esm/api/types/DeleteMonitorResponseDto.d.mts +1 -1
- package/dist/esm/api/types/DeliveryHistoryItemDto.d.mts +25 -0
- package/dist/esm/api/types/DeliveryHistoryItemDto.mjs +2 -0
- package/dist/esm/api/types/DeliveryHistoryResponseDto.d.mts +17 -0
- package/dist/esm/api/types/DeliveryHistoryResponseDto.mjs +2 -0
- package/dist/esm/api/types/DeliveryMode.d.mts +11 -0
- package/dist/esm/api/types/DeliveryMode.mjs +11 -0
- package/dist/esm/api/types/DeliveryStatus.d.mts +6 -0
- package/dist/esm/api/types/DeliveryStatus.mjs +6 -0
- package/dist/esm/api/types/GetWebhookResponseDto.d.mts +9 -0
- package/dist/esm/api/types/GetWebhookResponseDto.mjs +2 -0
- package/dist/esm/api/types/HttpMethod.d.mts +9 -0
- package/dist/esm/api/types/HttpMethod.mjs +9 -0
- package/dist/esm/api/types/IssueType.d.mts +25 -0
- package/dist/esm/api/types/IssueType.mjs +25 -0
- package/dist/esm/api/types/JobStep.d.mts +1 -1
- package/dist/esm/api/types/ListWebhookResourcesResponseDto.d.mts +13 -0
- package/dist/esm/api/types/ListWebhookResourcesResponseDto.mjs +2 -0
- package/dist/esm/api/types/ListWebhooksResponseDto.d.mts +13 -0
- package/dist/esm/api/types/ListWebhooksResponseDto.mjs +2 -0
- package/dist/esm/api/types/MappableResourceType.d.mts +7 -0
- package/dist/esm/api/types/MappableResourceType.mjs +7 -0
- package/dist/esm/api/types/MonitorListItemDto.d.mts +1 -1
- package/dist/esm/api/types/MonitorStatusHistoryResponseDto.d.mts +1 -1
- package/dist/esm/api/types/ProjectListResponseDto.d.mts +13 -0
- package/dist/esm/api/types/ProjectListResponseDto.mjs +2 -0
- package/dist/esm/api/types/ProjectOverviewCountsDto.d.mts +4 -0
- package/dist/esm/api/types/ProjectOverviewCountsDto.mjs +2 -0
- package/dist/esm/api/types/ProjectOverviewResponseDto.d.mts +18 -0
- package/dist/esm/api/types/ProjectOverviewResponseDto.mjs +2 -0
- package/dist/esm/api/types/ProjectResourceDto.d.mts +18 -0
- package/dist/esm/api/types/ProjectResourceDto.mjs +2 -0
- package/dist/esm/api/types/ProjectResourceListResponseDto.d.mts +13 -0
- package/dist/esm/api/types/ProjectResourceListResponseDto.mjs +2 -0
- package/dist/esm/api/types/ProjectResourceType.d.mts +8 -0
- package/dist/esm/api/types/ProjectResourceType.mjs +8 -0
- package/dist/esm/api/types/ProjectResponseDto.d.mts +18 -0
- package/dist/esm/api/types/ProjectResponseDto.mjs +2 -0
- package/dist/esm/api/types/ProjectSummaryDto.d.mts +17 -0
- package/dist/esm/api/types/ProjectSummaryDto.mjs +2 -0
- package/dist/esm/api/types/QueryStatus.d.mts +13 -0
- package/dist/esm/api/types/QueryStatus.mjs +13 -0
- package/dist/esm/api/types/RemoveResourceResponseDto.d.mts +6 -0
- package/dist/esm/api/types/RemoveResourceResponseDto.mjs +2 -0
- package/dist/esm/api/types/ResourceItemDto.d.mts +6 -0
- package/dist/esm/api/types/ResourceItemDto.mjs +2 -0
- package/dist/esm/api/types/ResourceResultDto.d.mts +12 -0
- package/dist/esm/api/types/ResourceResultDto.mjs +2 -0
- package/dist/esm/api/types/Suggestion.d.mts +12 -0
- package/dist/esm/api/types/Suggestion.mjs +2 -0
- package/dist/esm/api/types/TestWebhookResponseDto.d.mts +10 -0
- package/dist/esm/api/types/TestWebhookResponseDto.mjs +2 -0
- package/dist/esm/api/types/UpdateProjectResponseDto.d.mts +8 -0
- package/dist/esm/api/types/UpdateProjectResponseDto.mjs +2 -0
- package/dist/esm/api/types/UpdateWebhookResponseDto.d.mts +9 -0
- package/dist/esm/api/types/UpdateWebhookResponseDto.mjs +2 -0
- package/dist/esm/api/types/ValidateQueryResponseDto.d.mts +18 -0
- package/dist/esm/api/types/ValidateQueryResponseDto.mjs +2 -0
- package/dist/esm/api/types/WebhookResourceMappingResponseDto.d.mts +12 -0
- package/dist/esm/api/types/WebhookResourceMappingResponseDto.mjs +2 -0
- package/dist/esm/api/types/WebhookResponseDto.d.mts +28 -0
- package/dist/esm/api/types/WebhookResponseDto.mjs +2 -0
- package/dist/esm/api/types/WebhookType.d.mts +17 -0
- package/dist/esm/api/types/WebhookType.mjs +17 -0
- package/dist/esm/api/types/index.d.mts +37 -0
- package/dist/esm/api/types/index.mjs +37 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +1599 -201
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
28
|
+
import * as CatchAllApi from "../../../index.mjs";
|
|
29
|
+
/**
|
|
30
|
+
* Operations to create and manage reusable webhook endpoints.
|
|
31
|
+
*
|
|
32
|
+
* A webhook is a named HTTP endpoint that receives a POST notification
|
|
33
|
+
* when a job or monitor completes. Create webhooks once at the organization
|
|
34
|
+
* level and attach them to any number of jobs or monitors via `webhook_ids`.
|
|
35
|
+
* Supports Slack, Microsoft Teams, and generic HTTP targets with configurable
|
|
36
|
+
* delivery modes, authentication, and headers.
|
|
37
|
+
*/
|
|
38
|
+
export class WebhooksClient {
|
|
39
|
+
constructor(options = {}) {
|
|
40
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns a paginated list of webhooks belonging to the organization.
|
|
44
|
+
*
|
|
45
|
+
* @param {CatchAllApi.ListWebhooksRequest} request
|
|
46
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
49
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.webhooks.listWebhooks()
|
|
53
|
+
*/
|
|
54
|
+
listWebhooks(request = {}, requestOptions) {
|
|
55
|
+
return core.HttpResponsePromise.fromPromise(this.__listWebhooks(request, requestOptions));
|
|
56
|
+
}
|
|
57
|
+
__listWebhooks() {
|
|
58
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
59
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
60
|
+
const { page, page_size: pageSize, search } = request;
|
|
61
|
+
const _queryParams = {
|
|
62
|
+
page,
|
|
63
|
+
page_size: pageSize,
|
|
64
|
+
search,
|
|
65
|
+
};
|
|
66
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
67
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
68
|
+
const _response = yield core.fetcher({
|
|
69
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/webhooks"),
|
|
70
|
+
method: "GET",
|
|
71
|
+
headers: _headers,
|
|
72
|
+
queryString: core.url
|
|
73
|
+
.queryBuilder()
|
|
74
|
+
.addMany(_queryParams)
|
|
75
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
76
|
+
.build(),
|
|
77
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
78
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
79
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
80
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
81
|
+
logging: this._options.logging,
|
|
82
|
+
});
|
|
83
|
+
if (_response.ok) {
|
|
84
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
85
|
+
}
|
|
86
|
+
if (_response.error.reason === "status-code") {
|
|
87
|
+
switch (_response.error.statusCode) {
|
|
88
|
+
case 403:
|
|
89
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
90
|
+
case 422:
|
|
91
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
92
|
+
default:
|
|
93
|
+
throw new errors.CatchAllApiError({
|
|
94
|
+
statusCode: _response.error.statusCode,
|
|
95
|
+
body: _response.error.body,
|
|
96
|
+
rawResponse: _response.rawResponse,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/webhooks");
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Creates a new webhook endpoint for the organization.
|
|
105
|
+
*
|
|
106
|
+
* @param {CatchAllApi.CreateWebhookRequestDto} request
|
|
107
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
110
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.webhooks.createWebhook({
|
|
114
|
+
* name: "Layoffs Alert",
|
|
115
|
+
* url: "https://hooks.slack.com/services/T000/B000/xxx",
|
|
116
|
+
* type: "slack",
|
|
117
|
+
* delivery_mode: "full"
|
|
118
|
+
* })
|
|
119
|
+
*/
|
|
120
|
+
createWebhook(request, requestOptions) {
|
|
121
|
+
return core.HttpResponsePromise.fromPromise(this.__createWebhook(request, requestOptions));
|
|
122
|
+
}
|
|
123
|
+
__createWebhook(request, requestOptions) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
126
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
127
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
128
|
+
const _response = yield core.fetcher({
|
|
129
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/webhooks"),
|
|
130
|
+
method: "POST",
|
|
131
|
+
headers: _headers,
|
|
132
|
+
contentType: "application/json",
|
|
133
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
134
|
+
requestType: "json",
|
|
135
|
+
body: request,
|
|
136
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
137
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
138
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
139
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
140
|
+
logging: this._options.logging,
|
|
141
|
+
});
|
|
142
|
+
if (_response.ok) {
|
|
143
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
144
|
+
}
|
|
145
|
+
if (_response.error.reason === "status-code") {
|
|
146
|
+
switch (_response.error.statusCode) {
|
|
147
|
+
case 403:
|
|
148
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
149
|
+
case 422:
|
|
150
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
151
|
+
default:
|
|
152
|
+
throw new errors.CatchAllApiError({
|
|
153
|
+
statusCode: _response.error.statusCode,
|
|
154
|
+
body: _response.error.body,
|
|
155
|
+
rawResponse: _response.rawResponse,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catchAll/webhooks");
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Returns the full configuration of a single webhook by ID.
|
|
164
|
+
*
|
|
165
|
+
* @param {CatchAllApi.GetWebhookRequest} request
|
|
166
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
167
|
+
*
|
|
168
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
169
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
170
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.webhooks.getWebhook({
|
|
174
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
175
|
+
* })
|
|
176
|
+
*/
|
|
177
|
+
getWebhook(request, requestOptions) {
|
|
178
|
+
return core.HttpResponsePromise.fromPromise(this.__getWebhook(request, requestOptions));
|
|
179
|
+
}
|
|
180
|
+
__getWebhook(request, requestOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
183
|
+
const { webhook_id: webhookId } = request;
|
|
184
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
185
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
186
|
+
const _response = yield core.fetcher({
|
|
187
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}`),
|
|
188
|
+
method: "GET",
|
|
189
|
+
headers: _headers,
|
|
190
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
191
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
192
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
193
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
194
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
195
|
+
logging: this._options.logging,
|
|
196
|
+
});
|
|
197
|
+
if (_response.ok) {
|
|
198
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
199
|
+
}
|
|
200
|
+
if (_response.error.reason === "status-code") {
|
|
201
|
+
switch (_response.error.statusCode) {
|
|
202
|
+
case 403:
|
|
203
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
204
|
+
case 404:
|
|
205
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
206
|
+
case 422:
|
|
207
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
208
|
+
default:
|
|
209
|
+
throw new errors.CatchAllApiError({
|
|
210
|
+
statusCode: _response.error.statusCode,
|
|
211
|
+
body: _response.error.body,
|
|
212
|
+
rawResponse: _response.rawResponse,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/webhooks/{webhook_id}");
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Permanently deletes a webhook and removes all resource assignments.
|
|
221
|
+
*
|
|
222
|
+
* Assigned jobs and monitors no longer trigger delivery to this webhook. This operation cannot be undone.
|
|
223
|
+
*
|
|
224
|
+
* @param {CatchAllApi.DeleteWebhookRequest} request
|
|
225
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
|
+
*
|
|
227
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
228
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* await client.webhooks.deleteWebhook({
|
|
232
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
233
|
+
* })
|
|
234
|
+
*/
|
|
235
|
+
deleteWebhook(request, requestOptions) {
|
|
236
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteWebhook(request, requestOptions));
|
|
237
|
+
}
|
|
238
|
+
__deleteWebhook(request, requestOptions) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
241
|
+
const { webhook_id: webhookId } = request;
|
|
242
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
243
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
244
|
+
const _response = yield core.fetcher({
|
|
245
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}`),
|
|
246
|
+
method: "DELETE",
|
|
247
|
+
headers: _headers,
|
|
248
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
249
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
250
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
251
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
253
|
+
logging: this._options.logging,
|
|
254
|
+
});
|
|
255
|
+
if (_response.ok) {
|
|
256
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
257
|
+
}
|
|
258
|
+
if (_response.error.reason === "status-code") {
|
|
259
|
+
switch (_response.error.statusCode) {
|
|
260
|
+
case 403:
|
|
261
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
262
|
+
case 404:
|
|
263
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
264
|
+
default:
|
|
265
|
+
throw new errors.CatchAllApiError({
|
|
266
|
+
statusCode: _response.error.statusCode,
|
|
267
|
+
body: _response.error.body,
|
|
268
|
+
rawResponse: _response.rawResponse,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/catchAll/webhooks/{webhook_id}");
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Updates one or more fields of an existing webhook.
|
|
277
|
+
*
|
|
278
|
+
* @param {CatchAllApi.UpdateWebhookRequestDto} request
|
|
279
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
280
|
+
*
|
|
281
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
282
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
283
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* await client.webhooks.updateWebhook({
|
|
287
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
288
|
+
* name: "Layoffs Alert (EU)",
|
|
289
|
+
* is_active: false
|
|
290
|
+
* })
|
|
291
|
+
*/
|
|
292
|
+
updateWebhook(request, requestOptions) {
|
|
293
|
+
return core.HttpResponsePromise.fromPromise(this.__updateWebhook(request, requestOptions));
|
|
294
|
+
}
|
|
295
|
+
__updateWebhook(request, requestOptions) {
|
|
296
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
297
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
298
|
+
const { webhook_id: webhookId } = request, _body = __rest(request, ["webhook_id"]);
|
|
299
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
300
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
301
|
+
const _response = yield core.fetcher({
|
|
302
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}`),
|
|
303
|
+
method: "PATCH",
|
|
304
|
+
headers: _headers,
|
|
305
|
+
contentType: "application/json",
|
|
306
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
307
|
+
requestType: "json",
|
|
308
|
+
body: _body,
|
|
309
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
310
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
311
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
312
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
313
|
+
logging: this._options.logging,
|
|
314
|
+
});
|
|
315
|
+
if (_response.ok) {
|
|
316
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
317
|
+
}
|
|
318
|
+
if (_response.error.reason === "status-code") {
|
|
319
|
+
switch (_response.error.statusCode) {
|
|
320
|
+
case 403:
|
|
321
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
322
|
+
case 404:
|
|
323
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
324
|
+
case 422:
|
|
325
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
326
|
+
default:
|
|
327
|
+
throw new errors.CatchAllApiError({
|
|
328
|
+
statusCode: _response.error.statusCode,
|
|
329
|
+
body: _response.error.body,
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/catchAll/webhooks/{webhook_id}");
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Sends a test HTTP request to the webhook URL using the webhook's configured method, headers, and auth. Returns the response from the target endpoint.
|
|
339
|
+
*
|
|
340
|
+
* Use this to verify URL reachability and authentication before attaching the webhook to a live job or monitor.
|
|
341
|
+
*
|
|
342
|
+
* @param {CatchAllApi.TestWebhookRequestDto} request
|
|
343
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
344
|
+
*
|
|
345
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
346
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
347
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* await client.webhooks.testWebhook({
|
|
351
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
352
|
+
* payload: {
|
|
353
|
+
* "test": true,
|
|
354
|
+
* "message": "CatchAll webhook test"
|
|
355
|
+
* }
|
|
356
|
+
* })
|
|
357
|
+
*/
|
|
358
|
+
testWebhook(request, requestOptions) {
|
|
359
|
+
return core.HttpResponsePromise.fromPromise(this.__testWebhook(request, requestOptions));
|
|
360
|
+
}
|
|
361
|
+
__testWebhook(request, requestOptions) {
|
|
362
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
363
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
364
|
+
const { webhook_id: webhookId } = request, _body = __rest(request, ["webhook_id"]);
|
|
365
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
366
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
367
|
+
const _response = yield core.fetcher({
|
|
368
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}/test`),
|
|
369
|
+
method: "POST",
|
|
370
|
+
headers: _headers,
|
|
371
|
+
contentType: "application/json",
|
|
372
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
373
|
+
requestType: "json",
|
|
374
|
+
body: _body,
|
|
375
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
376
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
377
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
378
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
379
|
+
logging: this._options.logging,
|
|
380
|
+
});
|
|
381
|
+
if (_response.ok) {
|
|
382
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
383
|
+
}
|
|
384
|
+
if (_response.error.reason === "status-code") {
|
|
385
|
+
switch (_response.error.statusCode) {
|
|
386
|
+
case 403:
|
|
387
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
388
|
+
case 404:
|
|
389
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
390
|
+
case 422:
|
|
391
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
392
|
+
default:
|
|
393
|
+
throw new errors.CatchAllApiError({
|
|
394
|
+
statusCode: _response.error.statusCode,
|
|
395
|
+
body: _response.error.body,
|
|
396
|
+
rawResponse: _response.rawResponse,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catchAll/webhooks/{webhook_id}/test");
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Returns a paginated list of resources currently assigned to this webhook.
|
|
405
|
+
*
|
|
406
|
+
* @param {CatchAllApi.ListWebhookResourcesRequest} request
|
|
407
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
408
|
+
*
|
|
409
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
410
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
411
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* await client.webhooks.listWebhookResources({
|
|
415
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
416
|
+
* })
|
|
417
|
+
*/
|
|
418
|
+
listWebhookResources(request, requestOptions) {
|
|
419
|
+
return core.HttpResponsePromise.fromPromise(this.__listWebhookResources(request, requestOptions));
|
|
420
|
+
}
|
|
421
|
+
__listWebhookResources(request, requestOptions) {
|
|
422
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
424
|
+
const { webhook_id: webhookId, resource_type: resourceType, page, page_size: pageSize } = request;
|
|
425
|
+
const _queryParams = {
|
|
426
|
+
resource_type: resourceType != null ? resourceType : undefined,
|
|
427
|
+
page,
|
|
428
|
+
page_size: pageSize,
|
|
429
|
+
};
|
|
430
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
431
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
432
|
+
const _response = yield core.fetcher({
|
|
433
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}/resources`),
|
|
434
|
+
method: "GET",
|
|
435
|
+
headers: _headers,
|
|
436
|
+
queryString: core.url
|
|
437
|
+
.queryBuilder()
|
|
438
|
+
.addMany(_queryParams)
|
|
439
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
440
|
+
.build(),
|
|
441
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
442
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
443
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
444
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
445
|
+
logging: this._options.logging,
|
|
446
|
+
});
|
|
447
|
+
if (_response.ok) {
|
|
448
|
+
return {
|
|
449
|
+
data: _response.body,
|
|
450
|
+
rawResponse: _response.rawResponse,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
if (_response.error.reason === "status-code") {
|
|
454
|
+
switch (_response.error.statusCode) {
|
|
455
|
+
case 403:
|
|
456
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
457
|
+
case 404:
|
|
458
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
459
|
+
case 422:
|
|
460
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
461
|
+
default:
|
|
462
|
+
throw new errors.CatchAllApiError({
|
|
463
|
+
statusCode: _response.error.statusCode,
|
|
464
|
+
body: _response.error.body,
|
|
465
|
+
rawResponse: _response.rawResponse,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/webhooks/{webhook_id}/resources");
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Attaches a job, monitor, or monitor group to the webhook. When the
|
|
474
|
+
* resource completes, the webhook receives a delivery.
|
|
475
|
+
*
|
|
476
|
+
* A single webhook can be assigned to multiple resources. Each resource
|
|
477
|
+
* can have up to 5 webhooks assigned.
|
|
478
|
+
*
|
|
479
|
+
* @param {CatchAllApi.AssignWebhookResourceRequestDto} request
|
|
480
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
481
|
+
*
|
|
482
|
+
* @throws {@link CatchAllApi.BadRequestError}
|
|
483
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
484
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
485
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
486
|
+
*
|
|
487
|
+
* @example
|
|
488
|
+
* await client.webhooks.assignWebhookResource({
|
|
489
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
490
|
+
* resource_type: "monitor",
|
|
491
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
492
|
+
* })
|
|
493
|
+
*/
|
|
494
|
+
assignWebhookResource(request, requestOptions) {
|
|
495
|
+
return core.HttpResponsePromise.fromPromise(this.__assignWebhookResource(request, requestOptions));
|
|
496
|
+
}
|
|
497
|
+
__assignWebhookResource(request, requestOptions) {
|
|
498
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
500
|
+
const { webhook_id: webhookId } = request, _body = __rest(request, ["webhook_id"]);
|
|
501
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
502
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
503
|
+
const _response = yield core.fetcher({
|
|
504
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}/resources`),
|
|
505
|
+
method: "POST",
|
|
506
|
+
headers: _headers,
|
|
507
|
+
contentType: "application/json",
|
|
508
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
509
|
+
requestType: "json",
|
|
510
|
+
body: _body,
|
|
511
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
512
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
513
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
514
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
515
|
+
logging: this._options.logging,
|
|
516
|
+
});
|
|
517
|
+
if (_response.ok) {
|
|
518
|
+
return {
|
|
519
|
+
data: _response.body,
|
|
520
|
+
rawResponse: _response.rawResponse,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
if (_response.error.reason === "status-code") {
|
|
524
|
+
switch (_response.error.statusCode) {
|
|
525
|
+
case 400:
|
|
526
|
+
throw new CatchAllApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
527
|
+
case 403:
|
|
528
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
529
|
+
case 404:
|
|
530
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
531
|
+
case 422:
|
|
532
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
533
|
+
default:
|
|
534
|
+
throw new errors.CatchAllApiError({
|
|
535
|
+
statusCode: _response.error.statusCode,
|
|
536
|
+
body: _response.error.body,
|
|
537
|
+
rawResponse: _response.rawResponse,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catchAll/webhooks/{webhook_id}/resources");
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Detaches a resource from this webhook. Completions of the resource no longer trigger delivery to this webhook.
|
|
546
|
+
*
|
|
547
|
+
* The webhook and the resource itself are not deleted.
|
|
548
|
+
*
|
|
549
|
+
* @param {CatchAllApi.RemoveWebhookResourceRequest} request
|
|
550
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
551
|
+
*
|
|
552
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
553
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* await client.webhooks.removeWebhookResource({
|
|
557
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
558
|
+
* resource_type: "job",
|
|
559
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
560
|
+
* })
|
|
561
|
+
*/
|
|
562
|
+
removeWebhookResource(request, requestOptions) {
|
|
563
|
+
return core.HttpResponsePromise.fromPromise(this.__removeWebhookResource(request, requestOptions));
|
|
564
|
+
}
|
|
565
|
+
__removeWebhookResource(request, requestOptions) {
|
|
566
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
567
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
568
|
+
const { webhook_id: webhookId, resource_type: resourceType, resource_id: resourceId } = request;
|
|
569
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
570
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
571
|
+
const _response = yield core.fetcher({
|
|
572
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/webhooks/${core.url.encodePathParam(webhookId)}/resources/${core.url.encodePathParam(resourceType)}/${core.url.encodePathParam(resourceId)}`),
|
|
573
|
+
method: "DELETE",
|
|
574
|
+
headers: _headers,
|
|
575
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
576
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
577
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
578
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
579
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
580
|
+
logging: this._options.logging,
|
|
581
|
+
});
|
|
582
|
+
if (_response.ok) {
|
|
583
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
584
|
+
}
|
|
585
|
+
if (_response.error.reason === "status-code") {
|
|
586
|
+
switch (_response.error.statusCode) {
|
|
587
|
+
case 403:
|
|
588
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
589
|
+
case 404:
|
|
590
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
591
|
+
default:
|
|
592
|
+
throw new errors.CatchAllApiError({
|
|
593
|
+
statusCode: _response.error.statusCode,
|
|
594
|
+
body: _response.error.body,
|
|
595
|
+
rawResponse: _response.rawResponse,
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/catchAll/webhooks/{webhook_id}/resources/{resource_type}/{resource_id}");
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Returns all webhooks currently assigned to the given resource.
|
|
604
|
+
*
|
|
605
|
+
* @param {CatchAllApi.ListWebhooksForResourceRequest} request
|
|
606
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
607
|
+
*
|
|
608
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
609
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
610
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
611
|
+
*
|
|
612
|
+
* @example
|
|
613
|
+
* await client.webhooks.listWebhooksForResource({
|
|
614
|
+
* resource_type: "job",
|
|
615
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
616
|
+
* })
|
|
617
|
+
*/
|
|
618
|
+
listWebhooksForResource(request, requestOptions) {
|
|
619
|
+
return core.HttpResponsePromise.fromPromise(this.__listWebhooksForResource(request, requestOptions));
|
|
620
|
+
}
|
|
621
|
+
__listWebhooksForResource(request, requestOptions) {
|
|
622
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
623
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
624
|
+
const { resource_type: resourceType, resource_id: resourceId, is_active: isActive, page, page_size: pageSize, } = request;
|
|
625
|
+
const _queryParams = {
|
|
626
|
+
is_active: isActive,
|
|
627
|
+
page,
|
|
628
|
+
page_size: pageSize,
|
|
629
|
+
};
|
|
630
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
631
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
632
|
+
const _response = yield core.fetcher({
|
|
633
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/resources/${core.url.encodePathParam(resourceType)}/${core.url.encodePathParam(resourceId)}/webhooks`),
|
|
634
|
+
method: "GET",
|
|
635
|
+
headers: _headers,
|
|
636
|
+
queryString: core.url
|
|
637
|
+
.queryBuilder()
|
|
638
|
+
.addMany(_queryParams)
|
|
639
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
640
|
+
.build(),
|
|
641
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
642
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
643
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
644
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
645
|
+
logging: this._options.logging,
|
|
646
|
+
});
|
|
647
|
+
if (_response.ok) {
|
|
648
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
649
|
+
}
|
|
650
|
+
if (_response.error.reason === "status-code") {
|
|
651
|
+
switch (_response.error.statusCode) {
|
|
652
|
+
case 403:
|
|
653
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
654
|
+
case 404:
|
|
655
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
656
|
+
case 422:
|
|
657
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
658
|
+
default:
|
|
659
|
+
throw new errors.CatchAllApiError({
|
|
660
|
+
statusCode: _response.error.statusCode,
|
|
661
|
+
body: _response.error.body,
|
|
662
|
+
rawResponse: _response.rawResponse,
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/resources/{resource_type}/{resource_id}/webhooks");
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Returns a paginated delivery log for a given resource, ordered by timestamp descending.
|
|
671
|
+
*
|
|
672
|
+
* Each record shows the webhook dispatched, the HTTP status code returned, delivery outcome, and any error or warning messages. Use this to debug failed deliveries or audit dispatch activity.
|
|
673
|
+
*
|
|
674
|
+
* @param {CatchAllApi.GetWebhookDeliveryHistoryRequest} request
|
|
675
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
676
|
+
*
|
|
677
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
678
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
679
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
680
|
+
*
|
|
681
|
+
* @example
|
|
682
|
+
* await client.webhooks.getWebhookDeliveryHistory({
|
|
683
|
+
* resource_type: "job",
|
|
684
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
685
|
+
* })
|
|
686
|
+
*/
|
|
687
|
+
getWebhookDeliveryHistory(request, requestOptions) {
|
|
688
|
+
return core.HttpResponsePromise.fromPromise(this.__getWebhookDeliveryHistory(request, requestOptions));
|
|
689
|
+
}
|
|
690
|
+
__getWebhookDeliveryHistory(request, requestOptions) {
|
|
691
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
692
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
693
|
+
const { resource_type: resourceType, resource_id: resourceId, page, page_size: pageSize } = request;
|
|
694
|
+
const _queryParams = {
|
|
695
|
+
resource_type: resourceType,
|
|
696
|
+
resource_id: resourceId,
|
|
697
|
+
page,
|
|
698
|
+
page_size: pageSize,
|
|
699
|
+
};
|
|
700
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
701
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
702
|
+
const _response = yield core.fetcher({
|
|
703
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/webhook-history"),
|
|
704
|
+
method: "GET",
|
|
705
|
+
headers: _headers,
|
|
706
|
+
queryString: core.url
|
|
707
|
+
.queryBuilder()
|
|
708
|
+
.addMany(_queryParams)
|
|
709
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
710
|
+
.build(),
|
|
711
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
712
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
713
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
714
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
715
|
+
logging: this._options.logging,
|
|
716
|
+
});
|
|
717
|
+
if (_response.ok) {
|
|
718
|
+
return {
|
|
719
|
+
data: _response.body,
|
|
720
|
+
rawResponse: _response.rawResponse,
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
if (_response.error.reason === "status-code") {
|
|
724
|
+
switch (_response.error.statusCode) {
|
|
725
|
+
case 403:
|
|
726
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
727
|
+
case 404:
|
|
728
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
729
|
+
case 422:
|
|
730
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
731
|
+
default:
|
|
732
|
+
throw new errors.CatchAllApiError({
|
|
733
|
+
statusCode: _response.error.statusCode,
|
|
734
|
+
body: _response.error.body,
|
|
735
|
+
rawResponse: _response.rawResponse,
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/webhook-history");
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
}
|