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.
Files changed (347) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +6 -0
  4. package/dist/cjs/Client.js +10 -0
  5. package/dist/cjs/api/resources/datasets/client/Client.d.ts +2 -1
  6. package/dist/cjs/api/resources/datasets/client/Client.js +4 -2
  7. package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.d.ts +4 -1
  8. package/dist/cjs/api/resources/index.d.ts +5 -0
  9. package/dist/cjs/api/resources/index.js +6 -1
  10. package/dist/cjs/api/resources/jobs/client/Client.d.ts +21 -1
  11. package/dist/cjs/api/resources/jobs/client/Client.js +63 -2
  12. package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +5 -1
  13. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +4 -0
  14. package/dist/cjs/api/resources/jobs/client/requests/ValidateQueryRequestDto.d.ts +10 -0
  15. package/dist/cjs/api/resources/jobs/client/requests/ValidateQueryRequestDto.js +3 -0
  16. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/monitors/client/Client.d.ts +5 -15
  18. package/dist/cjs/api/resources/monitors/client/Client.js +7 -16
  19. package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +10 -10
  20. package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +5 -1
  21. package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +7 -10
  22. package/dist/cjs/api/resources/monitors/types/DisableMonitorResponse.d.ts +1 -1
  23. package/dist/cjs/api/resources/monitors/types/EnableMonitorResponse.d.ts +1 -1
  24. package/dist/cjs/api/resources/projects/client/Client.d.ts +178 -0
  25. package/dist/cjs/api/resources/projects/client/Client.js +626 -0
  26. package/dist/cjs/api/resources/projects/client/index.d.ts +1 -0
  27. package/dist/cjs/api/resources/projects/client/index.js +17 -0
  28. package/dist/cjs/api/resources/projects/client/requests/AddResourceRequestDto.d.ts +17 -0
  29. package/dist/cjs/api/resources/projects/client/requests/AddResourceRequestDto.js +3 -0
  30. package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequestDto.d.ts +13 -0
  31. package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequestDto.js +3 -0
  32. package/dist/cjs/api/resources/projects/client/requests/DeleteProjectRequest.d.ts +12 -0
  33. package/dist/cjs/api/resources/projects/client/requests/DeleteProjectRequest.js +3 -0
  34. package/dist/cjs/api/resources/projects/client/requests/GetProjectOverviewRequest.d.ts +10 -0
  35. package/dist/cjs/api/resources/projects/client/requests/GetProjectOverviewRequest.js +3 -0
  36. package/dist/cjs/api/resources/projects/client/requests/GetProjectRequest.d.ts +10 -0
  37. package/dist/cjs/api/resources/projects/client/requests/GetProjectRequest.js +3 -0
  38. package/dist/cjs/api/resources/projects/client/requests/ListProjectResourcesRequest.d.ts +16 -0
  39. package/dist/cjs/api/resources/projects/client/requests/ListProjectResourcesRequest.js +3 -0
  40. package/dist/cjs/api/resources/projects/client/requests/ListProjectsRequest.d.ts +16 -0
  41. package/dist/cjs/api/resources/projects/client/requests/ListProjectsRequest.js +3 -0
  42. package/dist/cjs/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.d.ts +16 -0
  43. package/dist/cjs/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.js +3 -0
  44. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequestDto.d.ts +15 -0
  45. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequestDto.js +3 -0
  46. package/dist/cjs/api/resources/projects/client/requests/index.d.ts +9 -0
  47. package/dist/cjs/api/resources/projects/client/requests/index.js +2 -0
  48. package/dist/cjs/api/resources/projects/exports.d.ts +2 -0
  49. package/dist/cjs/api/resources/projects/exports.js +21 -0
  50. package/dist/cjs/api/resources/projects/index.d.ts +1 -0
  51. package/dist/cjs/api/resources/projects/index.js +17 -0
  52. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +231 -0
  53. package/dist/cjs/api/resources/webhooks/client/Client.js +779 -0
  54. package/dist/cjs/api/resources/webhooks/client/index.d.ts +1 -0
  55. package/dist/cjs/api/resources/webhooks/client/index.js +17 -0
  56. package/dist/cjs/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.d.ts +17 -0
  57. package/dist/cjs/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.js +3 -0
  58. package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.ts +42 -0
  59. package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhookRequestDto.js +3 -0
  60. package/dist/cjs/api/resources/webhooks/client/requests/DeleteWebhookRequest.d.ts +10 -0
  61. package/dist/cjs/api/resources/webhooks/client/requests/DeleteWebhookRequest.js +3 -0
  62. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.d.ts +18 -0
  63. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.js +3 -0
  64. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookRequest.d.ts +10 -0
  65. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookRequest.js +3 -0
  66. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.d.ts +16 -0
  67. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.js +3 -0
  68. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.d.ts +19 -0
  69. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.js +3 -0
  70. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +12 -0
  71. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksRequest.js +3 -0
  72. package/dist/cjs/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.d.ts +16 -0
  73. package/dist/cjs/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.js +3 -0
  74. package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequestDto.d.ts +19 -0
  75. package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequestDto.js +3 -0
  76. package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.ts +30 -0
  77. package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.js +3 -0
  78. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +11 -0
  79. package/dist/cjs/api/resources/webhooks/client/requests/index.js +2 -0
  80. package/dist/cjs/api/resources/webhooks/exports.d.ts +2 -0
  81. package/dist/cjs/api/resources/webhooks/exports.js +21 -0
  82. package/dist/cjs/api/resources/webhooks/index.d.ts +2 -0
  83. package/dist/cjs/api/resources/webhooks/index.js +18 -0
  84. package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.d.ts +19 -0
  85. package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.js +3 -0
  86. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.d.ts +16 -0
  87. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.js +3 -0
  88. package/dist/cjs/api/resources/webhooks/types/index.d.ts +2 -0
  89. package/dist/cjs/api/resources/webhooks/types/index.js +18 -0
  90. package/dist/cjs/api/types/AddResourceResponseDto.d.ts +9 -0
  91. package/dist/cjs/api/types/AddResourceResponseDto.js +3 -0
  92. package/dist/cjs/api/types/ApiKeyAuthDto.d.ts +6 -0
  93. package/dist/cjs/api/types/ApiKeyAuthDto.js +3 -0
  94. package/dist/cjs/api/types/AssignWebhookResourceResponseDto.d.ts +11 -0
  95. package/dist/cjs/api/types/AssignWebhookResourceResponseDto.js +3 -0
  96. package/dist/cjs/api/types/BasicAuthDto.d.ts +6 -0
  97. package/dist/cjs/api/types/BasicAuthDto.js +3 -0
  98. package/dist/cjs/api/types/BearerAuthDto.d.ts +4 -0
  99. package/dist/cjs/api/types/BearerAuthDto.js +3 -0
  100. package/dist/cjs/api/types/ConnectedEntity.d.ts +1 -1
  101. package/dist/cjs/api/types/CreateProjectResponseDto.d.ts +10 -0
  102. package/dist/cjs/api/types/CreateProjectResponseDto.js +3 -0
  103. package/dist/cjs/api/types/CreateWebhookResponseDto.d.ts +9 -0
  104. package/dist/cjs/api/types/CreateWebhookResponseDto.js +3 -0
  105. package/dist/cjs/api/types/DeleteJobResponseDto.d.ts +1 -1
  106. package/dist/cjs/api/types/DeleteMonitorResponseDto.d.ts +1 -1
  107. package/dist/cjs/api/types/DeliveryHistoryItemDto.d.ts +25 -0
  108. package/dist/cjs/api/types/DeliveryHistoryItemDto.js +3 -0
  109. package/dist/cjs/api/types/DeliveryHistoryResponseDto.d.ts +17 -0
  110. package/dist/cjs/api/types/DeliveryHistoryResponseDto.js +3 -0
  111. package/dist/cjs/api/types/DeliveryMode.d.ts +11 -0
  112. package/dist/cjs/api/types/DeliveryMode.js +14 -0
  113. package/dist/cjs/api/types/DeliveryStatus.d.ts +6 -0
  114. package/dist/cjs/api/types/DeliveryStatus.js +9 -0
  115. package/dist/cjs/api/types/GetWebhookResponseDto.d.ts +9 -0
  116. package/dist/cjs/api/types/GetWebhookResponseDto.js +3 -0
  117. package/dist/cjs/api/types/HttpMethod.d.ts +9 -0
  118. package/dist/cjs/api/types/HttpMethod.js +12 -0
  119. package/dist/cjs/api/types/IssueType.d.ts +25 -0
  120. package/dist/cjs/api/types/IssueType.js +28 -0
  121. package/dist/cjs/api/types/JobStep.d.ts +1 -1
  122. package/dist/cjs/api/types/ListWebhookResourcesResponseDto.d.ts +13 -0
  123. package/dist/cjs/api/types/ListWebhookResourcesResponseDto.js +3 -0
  124. package/dist/cjs/api/types/ListWebhooksResponseDto.d.ts +13 -0
  125. package/dist/cjs/api/types/ListWebhooksResponseDto.js +3 -0
  126. package/dist/cjs/api/types/MappableResourceType.d.ts +7 -0
  127. package/dist/cjs/api/types/MappableResourceType.js +10 -0
  128. package/dist/cjs/api/types/MonitorListItemDto.d.ts +1 -1
  129. package/dist/cjs/api/types/MonitorStatusHistoryResponseDto.d.ts +1 -1
  130. package/dist/cjs/api/types/ProjectListResponseDto.d.ts +13 -0
  131. package/dist/cjs/api/types/ProjectListResponseDto.js +3 -0
  132. package/dist/cjs/api/types/ProjectOverviewCountsDto.d.ts +4 -0
  133. package/dist/cjs/api/types/ProjectOverviewCountsDto.js +3 -0
  134. package/dist/cjs/api/types/ProjectOverviewResponseDto.d.ts +18 -0
  135. package/dist/cjs/api/types/ProjectOverviewResponseDto.js +3 -0
  136. package/dist/cjs/api/types/ProjectResourceDto.d.ts +18 -0
  137. package/dist/cjs/api/types/ProjectResourceDto.js +3 -0
  138. package/dist/cjs/api/types/ProjectResourceListResponseDto.d.ts +13 -0
  139. package/dist/cjs/api/types/ProjectResourceListResponseDto.js +3 -0
  140. package/dist/cjs/api/types/ProjectResourceType.d.ts +8 -0
  141. package/dist/cjs/api/types/ProjectResourceType.js +11 -0
  142. package/dist/cjs/api/types/ProjectResponseDto.d.ts +18 -0
  143. package/dist/cjs/api/types/ProjectResponseDto.js +3 -0
  144. package/dist/cjs/api/types/ProjectSummaryDto.d.ts +17 -0
  145. package/dist/cjs/api/types/ProjectSummaryDto.js +3 -0
  146. package/dist/cjs/api/types/QueryStatus.d.ts +13 -0
  147. package/dist/cjs/api/types/QueryStatus.js +16 -0
  148. package/dist/cjs/api/types/RemoveResourceResponseDto.d.ts +6 -0
  149. package/dist/cjs/api/types/RemoveResourceResponseDto.js +3 -0
  150. package/dist/cjs/api/types/ResourceItemDto.d.ts +6 -0
  151. package/dist/cjs/api/types/ResourceItemDto.js +3 -0
  152. package/dist/cjs/api/types/ResourceResultDto.d.ts +12 -0
  153. package/dist/cjs/api/types/ResourceResultDto.js +3 -0
  154. package/dist/cjs/api/types/Suggestion.d.ts +12 -0
  155. package/dist/cjs/api/types/Suggestion.js +3 -0
  156. package/dist/cjs/api/types/TestWebhookResponseDto.d.ts +10 -0
  157. package/dist/cjs/api/types/TestWebhookResponseDto.js +3 -0
  158. package/dist/cjs/api/types/UpdateProjectResponseDto.d.ts +8 -0
  159. package/dist/cjs/api/types/UpdateProjectResponseDto.js +3 -0
  160. package/dist/cjs/api/types/UpdateWebhookResponseDto.d.ts +9 -0
  161. package/dist/cjs/api/types/UpdateWebhookResponseDto.js +3 -0
  162. package/dist/cjs/api/types/ValidateQueryResponseDto.d.ts +18 -0
  163. package/dist/cjs/api/types/ValidateQueryResponseDto.js +3 -0
  164. package/dist/cjs/api/types/WebhookResourceMappingResponseDto.d.ts +12 -0
  165. package/dist/cjs/api/types/WebhookResourceMappingResponseDto.js +3 -0
  166. package/dist/cjs/api/types/WebhookResponseDto.d.ts +28 -0
  167. package/dist/cjs/api/types/WebhookResponseDto.js +3 -0
  168. package/dist/cjs/api/types/WebhookType.d.ts +17 -0
  169. package/dist/cjs/api/types/WebhookType.js +20 -0
  170. package/dist/cjs/api/types/index.d.ts +37 -0
  171. package/dist/cjs/api/types/index.js +37 -0
  172. package/dist/cjs/version.d.ts +1 -1
  173. package/dist/cjs/version.js +1 -1
  174. package/dist/esm/BaseClient.mjs +2 -2
  175. package/dist/esm/Client.d.mts +6 -0
  176. package/dist/esm/Client.mjs +10 -0
  177. package/dist/esm/api/resources/datasets/client/Client.d.mts +2 -1
  178. package/dist/esm/api/resources/datasets/client/Client.mjs +4 -2
  179. package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.d.mts +4 -1
  180. package/dist/esm/api/resources/index.d.mts +5 -0
  181. package/dist/esm/api/resources/index.mjs +5 -0
  182. package/dist/esm/api/resources/jobs/client/Client.d.mts +21 -1
  183. package/dist/esm/api/resources/jobs/client/Client.mjs +63 -2
  184. package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +5 -1
  185. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +4 -0
  186. package/dist/esm/api/resources/jobs/client/requests/ValidateQueryRequestDto.d.mts +10 -0
  187. package/dist/esm/api/resources/jobs/client/requests/ValidateQueryRequestDto.mjs +2 -0
  188. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -0
  189. package/dist/esm/api/resources/monitors/client/Client.d.mts +5 -15
  190. package/dist/esm/api/resources/monitors/client/Client.mjs +7 -16
  191. package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +10 -10
  192. package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +5 -1
  193. package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +7 -10
  194. package/dist/esm/api/resources/monitors/types/DisableMonitorResponse.d.mts +1 -1
  195. package/dist/esm/api/resources/monitors/types/EnableMonitorResponse.d.mts +1 -1
  196. package/dist/esm/api/resources/projects/client/Client.d.mts +178 -0
  197. package/dist/esm/api/resources/projects/client/Client.mjs +589 -0
  198. package/dist/esm/api/resources/projects/client/index.d.mts +1 -0
  199. package/dist/esm/api/resources/projects/client/index.mjs +1 -0
  200. package/dist/esm/api/resources/projects/client/requests/AddResourceRequestDto.d.mts +17 -0
  201. package/dist/esm/api/resources/projects/client/requests/AddResourceRequestDto.mjs +2 -0
  202. package/dist/esm/api/resources/projects/client/requests/CreateProjectRequestDto.d.mts +13 -0
  203. package/dist/esm/api/resources/projects/client/requests/CreateProjectRequestDto.mjs +2 -0
  204. package/dist/esm/api/resources/projects/client/requests/DeleteProjectRequest.d.mts +12 -0
  205. package/dist/esm/api/resources/projects/client/requests/DeleteProjectRequest.mjs +2 -0
  206. package/dist/esm/api/resources/projects/client/requests/GetProjectOverviewRequest.d.mts +10 -0
  207. package/dist/esm/api/resources/projects/client/requests/GetProjectOverviewRequest.mjs +2 -0
  208. package/dist/esm/api/resources/projects/client/requests/GetProjectRequest.d.mts +10 -0
  209. package/dist/esm/api/resources/projects/client/requests/GetProjectRequest.mjs +2 -0
  210. package/dist/esm/api/resources/projects/client/requests/ListProjectResourcesRequest.d.mts +16 -0
  211. package/dist/esm/api/resources/projects/client/requests/ListProjectResourcesRequest.mjs +2 -0
  212. package/dist/esm/api/resources/projects/client/requests/ListProjectsRequest.d.mts +16 -0
  213. package/dist/esm/api/resources/projects/client/requests/ListProjectsRequest.mjs +2 -0
  214. package/dist/esm/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.d.mts +16 -0
  215. package/dist/esm/api/resources/projects/client/requests/RemoveResourceFromProjectRequest.mjs +2 -0
  216. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequestDto.d.mts +15 -0
  217. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequestDto.mjs +2 -0
  218. package/dist/esm/api/resources/projects/client/requests/index.d.mts +9 -0
  219. package/dist/esm/api/resources/projects/client/requests/index.mjs +1 -0
  220. package/dist/esm/api/resources/projects/exports.d.mts +2 -0
  221. package/dist/esm/api/resources/projects/exports.mjs +3 -0
  222. package/dist/esm/api/resources/projects/index.d.mts +1 -0
  223. package/dist/esm/api/resources/projects/index.mjs +1 -0
  224. package/dist/esm/api/resources/webhooks/client/Client.d.mts +231 -0
  225. package/dist/esm/api/resources/webhooks/client/Client.mjs +742 -0
  226. package/dist/esm/api/resources/webhooks/client/index.d.mts +1 -0
  227. package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
  228. package/dist/esm/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.d.mts +17 -0
  229. package/dist/esm/api/resources/webhooks/client/requests/AssignWebhookResourceRequestDto.mjs +2 -0
  230. package/dist/esm/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.mts +42 -0
  231. package/dist/esm/api/resources/webhooks/client/requests/CreateWebhookRequestDto.mjs +2 -0
  232. package/dist/esm/api/resources/webhooks/client/requests/DeleteWebhookRequest.d.mts +10 -0
  233. package/dist/esm/api/resources/webhooks/client/requests/DeleteWebhookRequest.mjs +2 -0
  234. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.d.mts +18 -0
  235. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookDeliveryHistoryRequest.mjs +2 -0
  236. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookRequest.d.mts +10 -0
  237. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookRequest.mjs +2 -0
  238. package/dist/esm/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.d.mts +16 -0
  239. package/dist/esm/api/resources/webhooks/client/requests/ListWebhookResourcesRequest.mjs +2 -0
  240. package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.d.mts +19 -0
  241. package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksForResourceRequest.mjs +2 -0
  242. package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksRequest.d.mts +12 -0
  243. package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksRequest.mjs +2 -0
  244. package/dist/esm/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.d.mts +16 -0
  245. package/dist/esm/api/resources/webhooks/client/requests/RemoveWebhookResourceRequest.mjs +2 -0
  246. package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequestDto.d.mts +19 -0
  247. package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequestDto.mjs +2 -0
  248. package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.mts +30 -0
  249. package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.mjs +2 -0
  250. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +11 -0
  251. package/dist/esm/api/resources/webhooks/client/requests/index.mjs +1 -0
  252. package/dist/esm/api/resources/webhooks/exports.d.mts +2 -0
  253. package/dist/esm/api/resources/webhooks/exports.mjs +3 -0
  254. package/dist/esm/api/resources/webhooks/index.d.mts +2 -0
  255. package/dist/esm/api/resources/webhooks/index.mjs +2 -0
  256. package/dist/esm/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.d.mts +19 -0
  257. package/dist/esm/api/resources/webhooks/types/CreateWebhookRequestDtoAuth.mjs +2 -0
  258. package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.d.mts +16 -0
  259. package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestDtoAuth.mjs +2 -0
  260. package/dist/esm/api/resources/webhooks/types/index.d.mts +2 -0
  261. package/dist/esm/api/resources/webhooks/types/index.mjs +2 -0
  262. package/dist/esm/api/types/AddResourceResponseDto.d.mts +9 -0
  263. package/dist/esm/api/types/AddResourceResponseDto.mjs +2 -0
  264. package/dist/esm/api/types/ApiKeyAuthDto.d.mts +6 -0
  265. package/dist/esm/api/types/ApiKeyAuthDto.mjs +2 -0
  266. package/dist/esm/api/types/AssignWebhookResourceResponseDto.d.mts +11 -0
  267. package/dist/esm/api/types/AssignWebhookResourceResponseDto.mjs +2 -0
  268. package/dist/esm/api/types/BasicAuthDto.d.mts +6 -0
  269. package/dist/esm/api/types/BasicAuthDto.mjs +2 -0
  270. package/dist/esm/api/types/BearerAuthDto.d.mts +4 -0
  271. package/dist/esm/api/types/BearerAuthDto.mjs +2 -0
  272. package/dist/esm/api/types/ConnectedEntity.d.mts +1 -1
  273. package/dist/esm/api/types/CreateProjectResponseDto.d.mts +10 -0
  274. package/dist/esm/api/types/CreateProjectResponseDto.mjs +2 -0
  275. package/dist/esm/api/types/CreateWebhookResponseDto.d.mts +9 -0
  276. package/dist/esm/api/types/CreateWebhookResponseDto.mjs +2 -0
  277. package/dist/esm/api/types/DeleteJobResponseDto.d.mts +1 -1
  278. package/dist/esm/api/types/DeleteMonitorResponseDto.d.mts +1 -1
  279. package/dist/esm/api/types/DeliveryHistoryItemDto.d.mts +25 -0
  280. package/dist/esm/api/types/DeliveryHistoryItemDto.mjs +2 -0
  281. package/dist/esm/api/types/DeliveryHistoryResponseDto.d.mts +17 -0
  282. package/dist/esm/api/types/DeliveryHistoryResponseDto.mjs +2 -0
  283. package/dist/esm/api/types/DeliveryMode.d.mts +11 -0
  284. package/dist/esm/api/types/DeliveryMode.mjs +11 -0
  285. package/dist/esm/api/types/DeliveryStatus.d.mts +6 -0
  286. package/dist/esm/api/types/DeliveryStatus.mjs +6 -0
  287. package/dist/esm/api/types/GetWebhookResponseDto.d.mts +9 -0
  288. package/dist/esm/api/types/GetWebhookResponseDto.mjs +2 -0
  289. package/dist/esm/api/types/HttpMethod.d.mts +9 -0
  290. package/dist/esm/api/types/HttpMethod.mjs +9 -0
  291. package/dist/esm/api/types/IssueType.d.mts +25 -0
  292. package/dist/esm/api/types/IssueType.mjs +25 -0
  293. package/dist/esm/api/types/JobStep.d.mts +1 -1
  294. package/dist/esm/api/types/ListWebhookResourcesResponseDto.d.mts +13 -0
  295. package/dist/esm/api/types/ListWebhookResourcesResponseDto.mjs +2 -0
  296. package/dist/esm/api/types/ListWebhooksResponseDto.d.mts +13 -0
  297. package/dist/esm/api/types/ListWebhooksResponseDto.mjs +2 -0
  298. package/dist/esm/api/types/MappableResourceType.d.mts +7 -0
  299. package/dist/esm/api/types/MappableResourceType.mjs +7 -0
  300. package/dist/esm/api/types/MonitorListItemDto.d.mts +1 -1
  301. package/dist/esm/api/types/MonitorStatusHistoryResponseDto.d.mts +1 -1
  302. package/dist/esm/api/types/ProjectListResponseDto.d.mts +13 -0
  303. package/dist/esm/api/types/ProjectListResponseDto.mjs +2 -0
  304. package/dist/esm/api/types/ProjectOverviewCountsDto.d.mts +4 -0
  305. package/dist/esm/api/types/ProjectOverviewCountsDto.mjs +2 -0
  306. package/dist/esm/api/types/ProjectOverviewResponseDto.d.mts +18 -0
  307. package/dist/esm/api/types/ProjectOverviewResponseDto.mjs +2 -0
  308. package/dist/esm/api/types/ProjectResourceDto.d.mts +18 -0
  309. package/dist/esm/api/types/ProjectResourceDto.mjs +2 -0
  310. package/dist/esm/api/types/ProjectResourceListResponseDto.d.mts +13 -0
  311. package/dist/esm/api/types/ProjectResourceListResponseDto.mjs +2 -0
  312. package/dist/esm/api/types/ProjectResourceType.d.mts +8 -0
  313. package/dist/esm/api/types/ProjectResourceType.mjs +8 -0
  314. package/dist/esm/api/types/ProjectResponseDto.d.mts +18 -0
  315. package/dist/esm/api/types/ProjectResponseDto.mjs +2 -0
  316. package/dist/esm/api/types/ProjectSummaryDto.d.mts +17 -0
  317. package/dist/esm/api/types/ProjectSummaryDto.mjs +2 -0
  318. package/dist/esm/api/types/QueryStatus.d.mts +13 -0
  319. package/dist/esm/api/types/QueryStatus.mjs +13 -0
  320. package/dist/esm/api/types/RemoveResourceResponseDto.d.mts +6 -0
  321. package/dist/esm/api/types/RemoveResourceResponseDto.mjs +2 -0
  322. package/dist/esm/api/types/ResourceItemDto.d.mts +6 -0
  323. package/dist/esm/api/types/ResourceItemDto.mjs +2 -0
  324. package/dist/esm/api/types/ResourceResultDto.d.mts +12 -0
  325. package/dist/esm/api/types/ResourceResultDto.mjs +2 -0
  326. package/dist/esm/api/types/Suggestion.d.mts +12 -0
  327. package/dist/esm/api/types/Suggestion.mjs +2 -0
  328. package/dist/esm/api/types/TestWebhookResponseDto.d.mts +10 -0
  329. package/dist/esm/api/types/TestWebhookResponseDto.mjs +2 -0
  330. package/dist/esm/api/types/UpdateProjectResponseDto.d.mts +8 -0
  331. package/dist/esm/api/types/UpdateProjectResponseDto.mjs +2 -0
  332. package/dist/esm/api/types/UpdateWebhookResponseDto.d.mts +9 -0
  333. package/dist/esm/api/types/UpdateWebhookResponseDto.mjs +2 -0
  334. package/dist/esm/api/types/ValidateQueryResponseDto.d.mts +18 -0
  335. package/dist/esm/api/types/ValidateQueryResponseDto.mjs +2 -0
  336. package/dist/esm/api/types/WebhookResourceMappingResponseDto.d.mts +12 -0
  337. package/dist/esm/api/types/WebhookResourceMappingResponseDto.mjs +2 -0
  338. package/dist/esm/api/types/WebhookResponseDto.d.mts +28 -0
  339. package/dist/esm/api/types/WebhookResponseDto.mjs +2 -0
  340. package/dist/esm/api/types/WebhookType.d.mts +17 -0
  341. package/dist/esm/api/types/WebhookType.mjs +17 -0
  342. package/dist/esm/api/types/index.d.mts +37 -0
  343. package/dist/esm/api/types/index.mjs +37 -0
  344. package/dist/esm/version.d.mts +1 -1
  345. package/dist/esm/version.mjs +1 -1
  346. package/package.json +23 -1
  347. 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
+ }