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