@webiny/webhooks 0.0.0-unstable.7be00a75a9

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 (591) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/admin/WebhookRoutes.d.ts +2 -0
  4. package/admin/WebhookRoutes.js +68 -0
  5. package/admin/WebhookRoutes.js.map +1 -0
  6. package/admin/Webhooks.d.ts +2 -0
  7. package/admin/Webhooks.js +64 -0
  8. package/admin/Webhooks.js.map +1 -0
  9. package/admin/features/ListWebhooks/ListWebhooksGateway.d.ts +11 -0
  10. package/admin/features/ListWebhooks/ListWebhooksGateway.js +62 -0
  11. package/admin/features/ListWebhooks/ListWebhooksGateway.js.map +1 -0
  12. package/admin/features/ListWebhooks/ListWebhooksRepository.d.ts +10 -0
  13. package/admin/features/ListWebhooks/ListWebhooksRepository.js +18 -0
  14. package/admin/features/ListWebhooks/ListWebhooksRepository.js.map +1 -0
  15. package/admin/features/ListWebhooks/ListWebhooksUseCase.d.ts +10 -0
  16. package/admin/features/ListWebhooks/ListWebhooksUseCase.js +18 -0
  17. package/admin/features/ListWebhooks/ListWebhooksUseCase.js.map +1 -0
  18. package/admin/features/ListWebhooks/abstractions.d.ts +36 -0
  19. package/admin/features/ListWebhooks/abstractions.js +7 -0
  20. package/admin/features/ListWebhooks/abstractions.js.map +1 -0
  21. package/admin/features/ListWebhooks/feature.d.ts +3 -0
  22. package/admin/features/ListWebhooks/feature.js +21 -0
  23. package/admin/features/ListWebhooks/feature.js.map +1 -0
  24. package/admin/features/ListWebhooks/index.d.ts +2 -0
  25. package/admin/features/ListWebhooks/index.js +2 -0
  26. package/admin/features/createWebhook/CreateWebhookGateway.d.ts +12 -0
  27. package/admin/features/createWebhook/CreateWebhookGateway.js +21 -0
  28. package/admin/features/createWebhook/CreateWebhookGateway.js.map +1 -0
  29. package/admin/features/createWebhook/CreateWebhookUseCase.d.ts +11 -0
  30. package/admin/features/createWebhook/CreateWebhookUseCase.js +18 -0
  31. package/admin/features/createWebhook/CreateWebhookUseCase.js.map +1 -0
  32. package/admin/features/createWebhook/abstractions.d.ts +23 -0
  33. package/admin/features/createWebhook/abstractions.js +6 -0
  34. package/admin/features/createWebhook/abstractions.js.map +1 -0
  35. package/admin/features/createWebhook/feature.d.ts +3 -0
  36. package/admin/features/createWebhook/feature.js +19 -0
  37. package/admin/features/createWebhook/feature.js.map +1 -0
  38. package/admin/features/createWebhook/index.d.ts +2 -0
  39. package/admin/features/createWebhook/index.js +2 -0
  40. package/admin/features/deleteWebhook/DeleteWebhookGateway.d.ts +11 -0
  41. package/admin/features/deleteWebhook/DeleteWebhookGateway.js +23 -0
  42. package/admin/features/deleteWebhook/DeleteWebhookGateway.js.map +1 -0
  43. package/admin/features/deleteWebhook/DeleteWebhookUseCase.d.ts +10 -0
  44. package/admin/features/deleteWebhook/DeleteWebhookUseCase.js +18 -0
  45. package/admin/features/deleteWebhook/DeleteWebhookUseCase.js.map +1 -0
  46. package/admin/features/deleteWebhook/abstractions.d.ts +14 -0
  47. package/admin/features/deleteWebhook/abstractions.js +6 -0
  48. package/admin/features/deleteWebhook/abstractions.js.map +1 -0
  49. package/admin/features/deleteWebhook/feature.d.ts +3 -0
  50. package/admin/features/deleteWebhook/feature.js +19 -0
  51. package/admin/features/deleteWebhook/feature.js.map +1 -0
  52. package/admin/features/deleteWebhook/index.d.ts +2 -0
  53. package/admin/features/deleteWebhook/index.js +2 -0
  54. package/admin/features/getWebhook/GetWebhookGateway.d.ts +12 -0
  55. package/admin/features/getWebhook/GetWebhookGateway.js +23 -0
  56. package/admin/features/getWebhook/GetWebhookGateway.js.map +1 -0
  57. package/admin/features/getWebhook/GetWebhookUseCase.d.ts +11 -0
  58. package/admin/features/getWebhook/GetWebhookUseCase.js +18 -0
  59. package/admin/features/getWebhook/GetWebhookUseCase.js.map +1 -0
  60. package/admin/features/getWebhook/abstractions.d.ts +15 -0
  61. package/admin/features/getWebhook/abstractions.js +6 -0
  62. package/admin/features/getWebhook/abstractions.js.map +1 -0
  63. package/admin/features/getWebhook/feature.d.ts +3 -0
  64. package/admin/features/getWebhook/feature.js +19 -0
  65. package/admin/features/getWebhook/feature.js.map +1 -0
  66. package/admin/features/getWebhook/index.d.ts +2 -0
  67. package/admin/features/getWebhook/index.js +2 -0
  68. package/admin/features/getWebhookSettings/GetWebhookSettingsGateway.d.ts +12 -0
  69. package/admin/features/getWebhookSettings/GetWebhookSettingsGateway.js +41 -0
  70. package/admin/features/getWebhookSettings/GetWebhookSettingsGateway.js.map +1 -0
  71. package/admin/features/getWebhookSettings/GetWebhookSettingsUseCase.d.ts +11 -0
  72. package/admin/features/getWebhookSettings/GetWebhookSettingsUseCase.js +18 -0
  73. package/admin/features/getWebhookSettings/GetWebhookSettingsUseCase.js.map +1 -0
  74. package/admin/features/getWebhookSettings/abstractions.d.ts +15 -0
  75. package/admin/features/getWebhookSettings/abstractions.js +6 -0
  76. package/admin/features/getWebhookSettings/abstractions.js.map +1 -0
  77. package/admin/features/getWebhookSettings/feature.d.ts +3 -0
  78. package/admin/features/getWebhookSettings/feature.js +19 -0
  79. package/admin/features/getWebhookSettings/feature.js.map +1 -0
  80. package/admin/features/getWebhookSettings/index.d.ts +2 -0
  81. package/admin/features/getWebhookSettings/index.js +2 -0
  82. package/admin/features/listAvailableEvents/ListAvailableEventsGateway.d.ts +12 -0
  83. package/admin/features/listAvailableEvents/ListAvailableEventsGateway.js +21 -0
  84. package/admin/features/listAvailableEvents/ListAvailableEventsGateway.js.map +1 -0
  85. package/admin/features/listAvailableEvents/ListAvailableEventsUseCase.d.ts +11 -0
  86. package/admin/features/listAvailableEvents/ListAvailableEventsUseCase.js +18 -0
  87. package/admin/features/listAvailableEvents/ListAvailableEventsUseCase.js.map +1 -0
  88. package/admin/features/listAvailableEvents/abstractions.d.ts +15 -0
  89. package/admin/features/listAvailableEvents/abstractions.js +6 -0
  90. package/admin/features/listAvailableEvents/abstractions.js.map +1 -0
  91. package/admin/features/listAvailableEvents/feature.d.ts +3 -0
  92. package/admin/features/listAvailableEvents/feature.js +19 -0
  93. package/admin/features/listAvailableEvents/feature.js.map +1 -0
  94. package/admin/features/listAvailableEvents/index.d.ts +2 -0
  95. package/admin/features/listAvailableEvents/index.js +2 -0
  96. package/admin/features/listWebhookDeliveries/ListWebhookDeliveriesGateway.d.ts +11 -0
  97. package/admin/features/listWebhookDeliveries/ListWebhookDeliveriesGateway.js +28 -0
  98. package/admin/features/listWebhookDeliveries/ListWebhookDeliveriesGateway.js.map +1 -0
  99. package/admin/features/listWebhookDeliveries/ListWebhookDeliveriesUseCase.d.ts +10 -0
  100. package/admin/features/listWebhookDeliveries/ListWebhookDeliveriesUseCase.js +18 -0
  101. package/admin/features/listWebhookDeliveries/ListWebhookDeliveriesUseCase.js.map +1 -0
  102. package/admin/features/listWebhookDeliveries/abstractions.d.ts +33 -0
  103. package/admin/features/listWebhookDeliveries/abstractions.js +6 -0
  104. package/admin/features/listWebhookDeliveries/abstractions.js.map +1 -0
  105. package/admin/features/listWebhookDeliveries/feature.d.ts +3 -0
  106. package/admin/features/listWebhookDeliveries/feature.js +19 -0
  107. package/admin/features/listWebhookDeliveries/feature.js.map +1 -0
  108. package/admin/features/listWebhookDeliveries/index.d.ts +2 -0
  109. package/admin/features/listWebhookDeliveries/index.js +2 -0
  110. package/admin/features/permissions/abstractions.d.ts +17 -0
  111. package/admin/features/permissions/abstractions.js +6 -0
  112. package/admin/features/permissions/abstractions.js.map +1 -0
  113. package/admin/features/permissions/feature.d.ts +14 -0
  114. package/admin/features/permissions/feature.js +7 -0
  115. package/admin/features/permissions/feature.js.map +1 -0
  116. package/admin/features/permissions/index.d.ts +2 -0
  117. package/admin/features/permissions/index.js +2 -0
  118. package/admin/features/resendWebhookDelivery/ResendWebhookDeliveryGateway.d.ts +11 -0
  119. package/admin/features/resendWebhookDelivery/ResendWebhookDeliveryGateway.js +23 -0
  120. package/admin/features/resendWebhookDelivery/ResendWebhookDeliveryGateway.js.map +1 -0
  121. package/admin/features/resendWebhookDelivery/ResendWebhookDeliveryUseCase.d.ts +10 -0
  122. package/admin/features/resendWebhookDelivery/ResendWebhookDeliveryUseCase.js +18 -0
  123. package/admin/features/resendWebhookDelivery/ResendWebhookDeliveryUseCase.js.map +1 -0
  124. package/admin/features/resendWebhookDelivery/abstractions.d.ts +14 -0
  125. package/admin/features/resendWebhookDelivery/abstractions.js +6 -0
  126. package/admin/features/resendWebhookDelivery/abstractions.js.map +1 -0
  127. package/admin/features/resendWebhookDelivery/feature.d.ts +3 -0
  128. package/admin/features/resendWebhookDelivery/feature.js +19 -0
  129. package/admin/features/resendWebhookDelivery/feature.js.map +1 -0
  130. package/admin/features/resendWebhookDelivery/index.d.ts +2 -0
  131. package/admin/features/resendWebhookDelivery/index.js +2 -0
  132. package/admin/features/triggerWebhook/TriggerWebhookGateway.d.ts +12 -0
  133. package/admin/features/triggerWebhook/TriggerWebhookGateway.js +24 -0
  134. package/admin/features/triggerWebhook/TriggerWebhookGateway.js.map +1 -0
  135. package/admin/features/triggerWebhook/TriggerWebhookUseCase.d.ts +11 -0
  136. package/admin/features/triggerWebhook/TriggerWebhookUseCase.js +18 -0
  137. package/admin/features/triggerWebhook/TriggerWebhookUseCase.js.map +1 -0
  138. package/admin/features/triggerWebhook/abstractions.d.ts +15 -0
  139. package/admin/features/triggerWebhook/abstractions.js +6 -0
  140. package/admin/features/triggerWebhook/abstractions.js.map +1 -0
  141. package/admin/features/triggerWebhook/feature.d.ts +3 -0
  142. package/admin/features/triggerWebhook/feature.js +19 -0
  143. package/admin/features/triggerWebhook/feature.js.map +1 -0
  144. package/admin/features/triggerWebhook/index.d.ts +2 -0
  145. package/admin/features/triggerWebhook/index.js +2 -0
  146. package/admin/features/updateWebhook/UpdateWebhookGateway.d.ts +12 -0
  147. package/admin/features/updateWebhook/UpdateWebhookGateway.js +24 -0
  148. package/admin/features/updateWebhook/UpdateWebhookGateway.js.map +1 -0
  149. package/admin/features/updateWebhook/UpdateWebhookUseCase.d.ts +11 -0
  150. package/admin/features/updateWebhook/UpdateWebhookUseCase.js +18 -0
  151. package/admin/features/updateWebhook/UpdateWebhookUseCase.js.map +1 -0
  152. package/admin/features/updateWebhook/abstractions.d.ts +23 -0
  153. package/admin/features/updateWebhook/abstractions.js +6 -0
  154. package/admin/features/updateWebhook/abstractions.js.map +1 -0
  155. package/admin/features/updateWebhook/feature.d.ts +3 -0
  156. package/admin/features/updateWebhook/feature.js +19 -0
  157. package/admin/features/updateWebhook/feature.js.map +1 -0
  158. package/admin/features/updateWebhook/index.d.ts +2 -0
  159. package/admin/features/updateWebhook/index.js +2 -0
  160. package/admin/features/updateWebhookSettings/UpdateWebhookSettingsGateway.d.ts +12 -0
  161. package/admin/features/updateWebhookSettings/UpdateWebhookSettingsGateway.js +44 -0
  162. package/admin/features/updateWebhookSettings/UpdateWebhookSettingsGateway.js.map +1 -0
  163. package/admin/features/updateWebhookSettings/UpdateWebhookSettingsUseCase.d.ts +11 -0
  164. package/admin/features/updateWebhookSettings/UpdateWebhookSettingsUseCase.js +18 -0
  165. package/admin/features/updateWebhookSettings/UpdateWebhookSettingsUseCase.js.map +1 -0
  166. package/admin/features/updateWebhookSettings/abstractions.d.ts +19 -0
  167. package/admin/features/updateWebhookSettings/abstractions.js +6 -0
  168. package/admin/features/updateWebhookSettings/abstractions.js.map +1 -0
  169. package/admin/features/updateWebhookSettings/feature.d.ts +3 -0
  170. package/admin/features/updateWebhookSettings/feature.js +19 -0
  171. package/admin/features/updateWebhookSettings/feature.js.map +1 -0
  172. package/admin/features/updateWebhookSettings/index.d.ts +2 -0
  173. package/admin/features/updateWebhookSettings/index.js +2 -0
  174. package/admin/index.d.ts +2 -0
  175. package/admin/index.js +2 -0
  176. package/admin/permissions.d.ts +12 -0
  177. package/admin/permissions.js +22 -0
  178. package/admin/permissions.js.map +1 -0
  179. package/admin/presentation/WebhookDeliveries/WebhookDeliveriesDataSource.d.ts +16 -0
  180. package/admin/presentation/WebhookDeliveries/WebhookDeliveriesDataSource.js +68 -0
  181. package/admin/presentation/WebhookDeliveries/WebhookDeliveriesDataSource.js.map +1 -0
  182. package/admin/presentation/WebhookDeliveries/WebhookDeliveriesPresenter.d.ts +21 -0
  183. package/admin/presentation/WebhookDeliveries/WebhookDeliveriesPresenter.js +57 -0
  184. package/admin/presentation/WebhookDeliveries/WebhookDeliveriesPresenter.js.map +1 -0
  185. package/admin/presentation/WebhookDeliveries/abstractions.d.ts +18 -0
  186. package/admin/presentation/WebhookDeliveries/abstractions.js +5 -0
  187. package/admin/presentation/WebhookDeliveries/abstractions.js.map +1 -0
  188. package/admin/presentation/WebhookDeliveries/components/DeliveryAccordionRow.d.ts +11 -0
  189. package/admin/presentation/WebhookDeliveries/components/DeliveryAccordionRow.js +36 -0
  190. package/admin/presentation/WebhookDeliveries/components/DeliveryAccordionRow.js.map +1 -0
  191. package/admin/presentation/WebhookDeliveries/components/DeliveryDetail.d.ts +11 -0
  192. package/admin/presentation/WebhookDeliveries/components/DeliveryDetail.js +32 -0
  193. package/admin/presentation/WebhookDeliveries/components/DeliveryDetail.js.map +1 -0
  194. package/admin/presentation/WebhookDeliveries/components/DeliveryDetailContent.d.ts +7 -0
  195. package/admin/presentation/WebhookDeliveries/components/DeliveryDetailContent.js +76 -0
  196. package/admin/presentation/WebhookDeliveries/components/DeliveryDetailContent.js.map +1 -0
  197. package/admin/presentation/WebhookDeliveries/components/DeliveryDetailPanel.d.ts +9 -0
  198. package/admin/presentation/WebhookDeliveries/components/DeliveryDetailPanel.js +22 -0
  199. package/admin/presentation/WebhookDeliveries/components/DeliveryDetailPanel.js.map +1 -0
  200. package/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.d.ts +8 -0
  201. package/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.js +119 -0
  202. package/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.js.map +1 -0
  203. package/admin/presentation/WebhookDeliveries/components/statusVariant.d.ts +1 -0
  204. package/admin/presentation/WebhookDeliveries/components/statusVariant.js +13 -0
  205. package/admin/presentation/WebhookDeliveries/components/statusVariant.js.map +1 -0
  206. package/admin/presentation/WebhookDeliveries/feature.d.ts +3 -0
  207. package/admin/presentation/WebhookDeliveries/feature.js +17 -0
  208. package/admin/presentation/WebhookDeliveries/feature.js.map +1 -0
  209. package/admin/presentation/WebhookDeliveries/index.d.ts +2 -0
  210. package/admin/presentation/WebhookDeliveries/index.js +2 -0
  211. package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesPagePresenter.d.ts +37 -0
  212. package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesPagePresenter.js +196 -0
  213. package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesPagePresenter.js.map +1 -0
  214. package/admin/presentation/WebhookDeliveriesPage/abstractions.d.ts +39 -0
  215. package/admin/presentation/WebhookDeliveriesPage/abstractions.js +5 -0
  216. package/admin/presentation/WebhookDeliveriesPage/abstractions.js.map +1 -0
  217. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryBottomInfoBar.d.ts +9 -0
  218. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryBottomInfoBar.js +43 -0
  219. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryBottomInfoBar.js.map +1 -0
  220. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.d.ts +9 -0
  221. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.js +66 -0
  222. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.js.map +1 -0
  223. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.d.ts +9 -0
  224. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.js +45 -0
  225. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.js.map +1 -0
  226. package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.d.ts +2 -0
  227. package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.js +64 -0
  228. package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.js.map +1 -0
  229. package/admin/presentation/WebhookDeliveriesPage/feature.d.ts +3 -0
  230. package/admin/presentation/WebhookDeliveriesPage/feature.js +17 -0
  231. package/admin/presentation/WebhookDeliveriesPage/feature.js.map +1 -0
  232. package/admin/presentation/WebhookDeliveriesPage/index.d.ts +5 -0
  233. package/admin/presentation/WebhookDeliveriesPage/index.js +1 -0
  234. package/admin/presentation/WebhookForm/WebhookFormPresenter.d.ts +42 -0
  235. package/admin/presentation/WebhookForm/WebhookFormPresenter.js +252 -0
  236. package/admin/presentation/WebhookForm/WebhookFormPresenter.js.map +1 -0
  237. package/admin/presentation/WebhookForm/abstractions.d.ts +27 -0
  238. package/admin/presentation/WebhookForm/abstractions.js +5 -0
  239. package/admin/presentation/WebhookForm/abstractions.js.map +1 -0
  240. package/admin/presentation/WebhookForm/components/SigningSecret.d.ts +9 -0
  241. package/admin/presentation/WebhookForm/components/SigningSecret.js +47 -0
  242. package/admin/presentation/WebhookForm/components/SigningSecret.js.map +1 -0
  243. package/admin/presentation/WebhookForm/components/WebhookFormView.d.ts +2 -0
  244. package/admin/presentation/WebhookForm/components/WebhookFormView.js +97 -0
  245. package/admin/presentation/WebhookForm/components/WebhookFormView.js.map +1 -0
  246. package/admin/presentation/WebhookForm/feature.d.ts +3 -0
  247. package/admin/presentation/WebhookForm/feature.js +17 -0
  248. package/admin/presentation/WebhookForm/feature.js.map +1 -0
  249. package/admin/presentation/WebhookForm/index.d.ts +2 -0
  250. package/admin/presentation/WebhookForm/index.js +2 -0
  251. package/admin/presentation/WebhookList/WebhookListDataSource.d.ts +15 -0
  252. package/admin/presentation/WebhookList/WebhookListDataSource.js +67 -0
  253. package/admin/presentation/WebhookList/WebhookListDataSource.js.map +1 -0
  254. package/admin/presentation/WebhookList/WebhookListPresenter.d.ts +46 -0
  255. package/admin/presentation/WebhookList/WebhookListPresenter.js +92 -0
  256. package/admin/presentation/WebhookList/WebhookListPresenter.js.map +1 -0
  257. package/admin/presentation/WebhookList/abstractions.d.ts +45 -0
  258. package/admin/presentation/WebhookList/abstractions.js +5 -0
  259. package/admin/presentation/WebhookList/abstractions.js.map +1 -0
  260. package/admin/presentation/WebhookList/components/CreateWebhookButton.d.ts +2 -0
  261. package/admin/presentation/WebhookList/components/CreateWebhookButton.js +22 -0
  262. package/admin/presentation/WebhookList/components/CreateWebhookButton.js.map +1 -0
  263. package/admin/presentation/WebhookList/components/WebhookListContent.d.ts +9 -0
  264. package/admin/presentation/WebhookList/components/WebhookListContent.js +158 -0
  265. package/admin/presentation/WebhookList/components/WebhookListContent.js.map +1 -0
  266. package/admin/presentation/WebhookList/components/WebhookListView.d.ts +2 -0
  267. package/admin/presentation/WebhookList/components/WebhookListView.js +46 -0
  268. package/admin/presentation/WebhookList/components/WebhookListView.js.map +1 -0
  269. package/admin/presentation/WebhookList/feature.d.ts +3 -0
  270. package/admin/presentation/WebhookList/feature.js +17 -0
  271. package/admin/presentation/WebhookList/feature.js.map +1 -0
  272. package/admin/presentation/WebhookList/index.d.ts +2 -0
  273. package/admin/presentation/WebhookList/index.js +2 -0
  274. package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.d.ts +21 -0
  275. package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.js +89 -0
  276. package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.js.map +1 -0
  277. package/admin/presentation/WebhookSettings/abstractions.d.ts +16 -0
  278. package/admin/presentation/WebhookSettings/abstractions.js +5 -0
  279. package/admin/presentation/WebhookSettings/abstractions.js.map +1 -0
  280. package/admin/presentation/WebhookSettings/components/WebhookSettingsView.d.ts +2 -0
  281. package/admin/presentation/WebhookSettings/components/WebhookSettingsView.js +56 -0
  282. package/admin/presentation/WebhookSettings/components/WebhookSettingsView.js.map +1 -0
  283. package/admin/presentation/WebhookSettings/feature.d.ts +3 -0
  284. package/admin/presentation/WebhookSettings/feature.js +17 -0
  285. package/admin/presentation/WebhookSettings/feature.js.map +1 -0
  286. package/admin/presentation/WebhookSettings/index.d.ts +2 -0
  287. package/admin/presentation/WebhookSettings/index.js +2 -0
  288. package/admin/presentation/security/HasPermission.d.ts +12 -0
  289. package/admin/presentation/security/HasPermission.js +6 -0
  290. package/admin/presentation/security/HasPermission.js.map +1 -0
  291. package/admin/presentation/security/usePermissions.d.ts +12 -0
  292. package/admin/presentation/security/usePermissions.js +6 -0
  293. package/admin/presentation/security/usePermissions.js.map +1 -0
  294. package/admin/routes.d.ts +9 -0
  295. package/admin/routes.js +25 -0
  296. package/admin/routes.js.map +1 -0
  297. package/admin/shared/types.d.ts +9 -0
  298. package/admin/shared/types.js +0 -0
  299. package/api/Extension.d.ts +1 -0
  300. package/api/Extension.js +1 -0
  301. package/api/WebhooksFeature.d.ts +4 -0
  302. package/api/WebhooksFeature.js +65 -0
  303. package/api/WebhooksFeature.js.map +1 -0
  304. package/api/domain/Webhook.d.ts +27 -0
  305. package/api/domain/Webhook.js +0 -0
  306. package/api/domain/WebhookDelivery.d.ts +35 -0
  307. package/api/domain/WebhookDelivery.js +0 -0
  308. package/api/domain/WebhookSettings.d.ts +4 -0
  309. package/api/domain/WebhookSettings.js +0 -0
  310. package/api/domain/constants.d.ts +5 -0
  311. package/api/domain/constants.js +8 -0
  312. package/api/domain/constants.js.map +1 -0
  313. package/api/domain/errors.d.ts +41 -0
  314. package/api/domain/errors.js +83 -0
  315. package/api/domain/errors.js.map +1 -0
  316. package/api/features/CreateWebhook/CreateWebhookRepository.d.ts +18 -0
  317. package/api/features/CreateWebhook/CreateWebhookRepository.js +43 -0
  318. package/api/features/CreateWebhook/CreateWebhookRepository.js.map +1 -0
  319. package/api/features/CreateWebhook/CreateWebhookUseCase.d.ts +16 -0
  320. package/api/features/CreateWebhook/CreateWebhookUseCase.js +48 -0
  321. package/api/features/CreateWebhook/CreateWebhookUseCase.js.map +1 -0
  322. package/api/features/CreateWebhook/abstractions.d.ts +33 -0
  323. package/api/features/CreateWebhook/abstractions.js +6 -0
  324. package/api/features/CreateWebhook/abstractions.js.map +1 -0
  325. package/api/features/CreateWebhook/feature.d.ts +4 -0
  326. package/api/features/CreateWebhook/feature.js +13 -0
  327. package/api/features/CreateWebhook/feature.js.map +1 -0
  328. package/api/features/CreateWebhook/schema.d.ts +10 -0
  329. package/api/features/CreateWebhook/schema.js +16 -0
  330. package/api/features/CreateWebhook/schema.js.map +1 -0
  331. package/api/features/CreateWebhookDelivery/CreateWebhookDeliveryRepository.d.ts +20 -0
  332. package/api/features/CreateWebhookDelivery/CreateWebhookDeliveryRepository.js +60 -0
  333. package/api/features/CreateWebhookDelivery/CreateWebhookDeliveryRepository.js.map +1 -0
  334. package/api/features/CreateWebhookDelivery/abstractions.d.ts +21 -0
  335. package/api/features/CreateWebhookDelivery/abstractions.js +5 -0
  336. package/api/features/CreateWebhookDelivery/abstractions.js.map +1 -0
  337. package/api/features/CreateWebhookDelivery/feature.d.ts +4 -0
  338. package/api/features/CreateWebhookDelivery/feature.js +11 -0
  339. package/api/features/CreateWebhookDelivery/feature.js.map +1 -0
  340. package/api/features/DeleteWebhook/DeleteWebhookRepository.d.ts +19 -0
  341. package/api/features/DeleteWebhook/DeleteWebhookRepository.js +66 -0
  342. package/api/features/DeleteWebhook/DeleteWebhookRepository.js.map +1 -0
  343. package/api/features/DeleteWebhook/DeleteWebhookUseCase.d.ts +15 -0
  344. package/api/features/DeleteWebhook/DeleteWebhookUseCase.js +34 -0
  345. package/api/features/DeleteWebhook/DeleteWebhookUseCase.js.map +1 -0
  346. package/api/features/DeleteWebhook/abstractions.d.ts +20 -0
  347. package/api/features/DeleteWebhook/abstractions.js +6 -0
  348. package/api/features/DeleteWebhook/abstractions.js.map +1 -0
  349. package/api/features/DeleteWebhook/feature.d.ts +4 -0
  350. package/api/features/DeleteWebhook/feature.js +13 -0
  351. package/api/features/DeleteWebhook/feature.js.map +1 -0
  352. package/api/features/DeleteWebhook/schema.d.ts +4 -0
  353. package/api/features/DeleteWebhook/schema.js +7 -0
  354. package/api/features/DeleteWebhook/schema.js.map +1 -0
  355. package/api/features/GetWebhook/GetWebhookRepository.d.ts +17 -0
  356. package/api/features/GetWebhook/GetWebhookRepository.js +39 -0
  357. package/api/features/GetWebhook/GetWebhookRepository.js.map +1 -0
  358. package/api/features/GetWebhook/GetWebhookUseCase.d.ts +14 -0
  359. package/api/features/GetWebhook/GetWebhookUseCase.js +29 -0
  360. package/api/features/GetWebhook/GetWebhookUseCase.js.map +1 -0
  361. package/api/features/GetWebhook/abstractions.d.ts +21 -0
  362. package/api/features/GetWebhook/abstractions.js +6 -0
  363. package/api/features/GetWebhook/abstractions.js.map +1 -0
  364. package/api/features/GetWebhook/feature.d.ts +4 -0
  365. package/api/features/GetWebhook/feature.js +13 -0
  366. package/api/features/GetWebhook/feature.js.map +1 -0
  367. package/api/features/GetWebhook/schema.d.ts +4 -0
  368. package/api/features/GetWebhook/schema.js +7 -0
  369. package/api/features/GetWebhook/schema.js.map +1 -0
  370. package/api/features/GetWebhookDelivery/GetWebhookDeliveryRepository.d.ts +17 -0
  371. package/api/features/GetWebhookDelivery/GetWebhookDeliveryRepository.js +39 -0
  372. package/api/features/GetWebhookDelivery/GetWebhookDeliveryRepository.js.map +1 -0
  373. package/api/features/GetWebhookDelivery/GetWebhookDeliveryUseCase.d.ts +14 -0
  374. package/api/features/GetWebhookDelivery/GetWebhookDeliveryUseCase.js +29 -0
  375. package/api/features/GetWebhookDelivery/GetWebhookDeliveryUseCase.js.map +1 -0
  376. package/api/features/GetWebhookDelivery/abstractions.d.ts +21 -0
  377. package/api/features/GetWebhookDelivery/abstractions.js +6 -0
  378. package/api/features/GetWebhookDelivery/abstractions.js.map +1 -0
  379. package/api/features/GetWebhookDelivery/feature.d.ts +4 -0
  380. package/api/features/GetWebhookDelivery/feature.js +13 -0
  381. package/api/features/GetWebhookDelivery/feature.js.map +1 -0
  382. package/api/features/GetWebhookDelivery/schema.d.ts +4 -0
  383. package/api/features/GetWebhookDelivery/schema.js +7 -0
  384. package/api/features/GetWebhookDelivery/schema.js.map +1 -0
  385. package/api/features/GetWebhookSettings/GetWebhookSettingsRepository.d.ts +19 -0
  386. package/api/features/GetWebhookSettings/GetWebhookSettingsRepository.js +57 -0
  387. package/api/features/GetWebhookSettings/GetWebhookSettingsRepository.js.map +1 -0
  388. package/api/features/GetWebhookSettings/abstractions.d.ts +13 -0
  389. package/api/features/GetWebhookSettings/abstractions.js +5 -0
  390. package/api/features/GetWebhookSettings/abstractions.js.map +1 -0
  391. package/api/features/GetWebhookSettings/feature.d.ts +4 -0
  392. package/api/features/GetWebhookSettings/feature.js +11 -0
  393. package/api/features/GetWebhookSettings/feature.js.map +1 -0
  394. package/api/features/ListAvailableWebhookEvents/ListAvailableWebhookEventsUseCase.d.ts +14 -0
  395. package/api/features/ListAvailableWebhookEvents/ListAvailableWebhookEventsUseCase.js +30 -0
  396. package/api/features/ListAvailableWebhookEvents/ListAvailableWebhookEventsUseCase.js.map +1 -0
  397. package/api/features/ListAvailableWebhookEvents/abstractions.d.ts +9 -0
  398. package/api/features/ListAvailableWebhookEvents/abstractions.js +5 -0
  399. package/api/features/ListAvailableWebhookEvents/abstractions.js.map +1 -0
  400. package/api/features/ListAvailableWebhookEvents/feature.d.ts +4 -0
  401. package/api/features/ListAvailableWebhookEvents/feature.js +11 -0
  402. package/api/features/ListAvailableWebhookEvents/feature.js.map +1 -0
  403. package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesRepository.d.ts +21 -0
  404. package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesRepository.js +63 -0
  405. package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesRepository.js.map +1 -0
  406. package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesUseCase.d.ts +14 -0
  407. package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesUseCase.js +27 -0
  408. package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesUseCase.js.map +1 -0
  409. package/api/features/ListWebhookDeliveries/abstractions.d.ts +40 -0
  410. package/api/features/ListWebhookDeliveries/abstractions.js +6 -0
  411. package/api/features/ListWebhookDeliveries/abstractions.js.map +1 -0
  412. package/api/features/ListWebhookDeliveries/feature.d.ts +4 -0
  413. package/api/features/ListWebhookDeliveries/feature.js +13 -0
  414. package/api/features/ListWebhookDeliveries/feature.js.map +1 -0
  415. package/api/features/ListWebhookDeliveries/schema.d.ts +7 -0
  416. package/api/features/ListWebhookDeliveries/schema.js +10 -0
  417. package/api/features/ListWebhookDeliveries/schema.js.map +1 -0
  418. package/api/features/ListWebhooks/ListWebhooksRepository.d.ts +21 -0
  419. package/api/features/ListWebhooks/ListWebhooksRepository.js +63 -0
  420. package/api/features/ListWebhooks/ListWebhooksRepository.js.map +1 -0
  421. package/api/features/ListWebhooks/ListWebhooksUseCase.d.ts +14 -0
  422. package/api/features/ListWebhooks/ListWebhooksUseCase.js +27 -0
  423. package/api/features/ListWebhooks/ListWebhooksUseCase.js.map +1 -0
  424. package/api/features/ListWebhooks/abstractions.d.ts +41 -0
  425. package/api/features/ListWebhooks/abstractions.js +6 -0
  426. package/api/features/ListWebhooks/abstractions.js.map +1 -0
  427. package/api/features/ListWebhooks/feature.d.ts +4 -0
  428. package/api/features/ListWebhooks/feature.js +13 -0
  429. package/api/features/ListWebhooks/feature.js.map +1 -0
  430. package/api/features/ListWebhooks/schema.d.ts +7 -0
  431. package/api/features/ListWebhooks/schema.js +10 -0
  432. package/api/features/ListWebhooks/schema.js.map +1 -0
  433. package/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.d.ts +22 -0
  434. package/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.js +70 -0
  435. package/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.js.map +1 -0
  436. package/api/features/ResendWebhookDelivery/abstractions.d.ts +12 -0
  437. package/api/features/ResendWebhookDelivery/abstractions.js +5 -0
  438. package/api/features/ResendWebhookDelivery/abstractions.js.map +1 -0
  439. package/api/features/ResendWebhookDelivery/feature.d.ts +4 -0
  440. package/api/features/ResendWebhookDelivery/feature.js +11 -0
  441. package/api/features/ResendWebhookDelivery/feature.js.map +1 -0
  442. package/api/features/ResendWebhookDelivery/schema.d.ts +4 -0
  443. package/api/features/ResendWebhookDelivery/schema.js +7 -0
  444. package/api/features/ResendWebhookDelivery/schema.js.map +1 -0
  445. package/api/features/SendWebhookTask/SendWebhookTask.d.ts +33 -0
  446. package/api/features/SendWebhookTask/SendWebhookTask.js +111 -0
  447. package/api/features/SendWebhookTask/SendWebhookTask.js.map +1 -0
  448. package/api/features/SendWebhookTask/feature.d.ts +4 -0
  449. package/api/features/SendWebhookTask/feature.js +11 -0
  450. package/api/features/SendWebhookTask/feature.js.map +1 -0
  451. package/api/features/SendWebhookTask/types.d.ts +16 -0
  452. package/api/features/SendWebhookTask/types.js +0 -0
  453. package/api/features/Transformers/WebhookDeliveryTransformer.d.ts +13 -0
  454. package/api/features/Transformers/WebhookDeliveryTransformer.js +57 -0
  455. package/api/features/Transformers/WebhookDeliveryTransformer.js.map +1 -0
  456. package/api/features/Transformers/WebhookTransformer.d.ts +11 -0
  457. package/api/features/Transformers/WebhookTransformer.js +35 -0
  458. package/api/features/Transformers/WebhookTransformer.js.map +1 -0
  459. package/api/features/Transformers/abstractions/WebhookDeliveryTransformer.d.ts +10 -0
  460. package/api/features/Transformers/abstractions/WebhookDeliveryTransformer.js +5 -0
  461. package/api/features/Transformers/abstractions/WebhookDeliveryTransformer.js.map +1 -0
  462. package/api/features/Transformers/abstractions/WebhookTransformer.d.ts +10 -0
  463. package/api/features/Transformers/abstractions/WebhookTransformer.js +5 -0
  464. package/api/features/Transformers/abstractions/WebhookTransformer.js.map +1 -0
  465. package/api/features/Transformers/feature.d.ts +4 -0
  466. package/api/features/Transformers/feature.js +13 -0
  467. package/api/features/Transformers/feature.js.map +1 -0
  468. package/api/features/Transformers/index.d.ts +2 -0
  469. package/api/features/Transformers/index.js +2 -0
  470. package/api/features/TriggerWebhook/TriggerWebhookUseCase.d.ts +21 -0
  471. package/api/features/TriggerWebhook/TriggerWebhookUseCase.js +65 -0
  472. package/api/features/TriggerWebhook/TriggerWebhookUseCase.js.map +1 -0
  473. package/api/features/TriggerWebhook/abstractions.d.ts +13 -0
  474. package/api/features/TriggerWebhook/abstractions.js +5 -0
  475. package/api/features/TriggerWebhook/abstractions.js.map +1 -0
  476. package/api/features/TriggerWebhook/feature.d.ts +4 -0
  477. package/api/features/TriggerWebhook/feature.js +11 -0
  478. package/api/features/TriggerWebhook/feature.js.map +1 -0
  479. package/api/features/TriggerWebhook/schema.d.ts +5 -0
  480. package/api/features/TriggerWebhook/schema.js +8 -0
  481. package/api/features/TriggerWebhook/schema.js.map +1 -0
  482. package/api/features/UpdateWebhook/UpdateWebhookRepository.d.ts +21 -0
  483. package/api/features/UpdateWebhook/UpdateWebhookRepository.js +50 -0
  484. package/api/features/UpdateWebhook/UpdateWebhookRepository.js.map +1 -0
  485. package/api/features/UpdateWebhook/UpdateWebhookUseCase.d.ts +16 -0
  486. package/api/features/UpdateWebhook/UpdateWebhookUseCase.js +42 -0
  487. package/api/features/UpdateWebhook/UpdateWebhookUseCase.js.map +1 -0
  488. package/api/features/UpdateWebhook/abstractions.d.ts +30 -0
  489. package/api/features/UpdateWebhook/abstractions.js +6 -0
  490. package/api/features/UpdateWebhook/abstractions.js.map +1 -0
  491. package/api/features/UpdateWebhook/feature.d.ts +4 -0
  492. package/api/features/UpdateWebhook/feature.js +13 -0
  493. package/api/features/UpdateWebhook/feature.js.map +1 -0
  494. package/api/features/UpdateWebhook/schema.d.ts +9 -0
  495. package/api/features/UpdateWebhook/schema.js +15 -0
  496. package/api/features/UpdateWebhook/schema.js.map +1 -0
  497. package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.d.ts +22 -0
  498. package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.js +62 -0
  499. package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.js.map +1 -0
  500. package/api/features/UpdateWebhookDelivery/abstractions.d.ts +23 -0
  501. package/api/features/UpdateWebhookDelivery/abstractions.js +5 -0
  502. package/api/features/UpdateWebhookDelivery/abstractions.js.map +1 -0
  503. package/api/features/UpdateWebhookDelivery/feature.d.ts +4 -0
  504. package/api/features/UpdateWebhookDelivery/feature.js +11 -0
  505. package/api/features/UpdateWebhookDelivery/feature.js.map +1 -0
  506. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.d.ts +21 -0
  507. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js +62 -0
  508. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js.map +1 -0
  509. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsUseCase.d.ts +14 -0
  510. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsUseCase.js +27 -0
  511. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsUseCase.js.map +1 -0
  512. package/api/features/UpdateWebhookSettings/abstractions.d.ts +27 -0
  513. package/api/features/UpdateWebhookSettings/abstractions.js +6 -0
  514. package/api/features/UpdateWebhookSettings/abstractions.js.map +1 -0
  515. package/api/features/UpdateWebhookSettings/feature.d.ts +4 -0
  516. package/api/features/UpdateWebhookSettings/feature.js +13 -0
  517. package/api/features/UpdateWebhookSettings/feature.js.map +1 -0
  518. package/api/features/UpdateWebhookSettings/schema.d.ts +5 -0
  519. package/api/features/UpdateWebhookSettings/schema.js +9 -0
  520. package/api/features/UpdateWebhookSettings/schema.js.map +1 -0
  521. package/api/features/WebhookDeliver/WebhookDeliver.d.ts +13 -0
  522. package/api/features/WebhookDeliver/WebhookDeliver.js +79 -0
  523. package/api/features/WebhookDeliver/WebhookDeliver.js.map +1 -0
  524. package/api/features/WebhookDeliver/abstractions.d.ts +24 -0
  525. package/api/features/WebhookDeliver/abstractions.js +5 -0
  526. package/api/features/WebhookDeliver/abstractions.js.map +1 -0
  527. package/api/features/WebhookDeliver/feature.d.ts +4 -0
  528. package/api/features/WebhookDeliver/feature.js +11 -0
  529. package/api/features/WebhookDeliver/feature.js.map +1 -0
  530. package/api/features/WebhookDeliver/index.d.ts +2 -0
  531. package/api/features/WebhookDeliver/index.js +2 -0
  532. package/api/features/WebhookDispatcher/WebhookDispatcher.d.ts +19 -0
  533. package/api/features/WebhookDispatcher/WebhookDispatcher.js +61 -0
  534. package/api/features/WebhookDispatcher/WebhookDispatcher.js.map +1 -0
  535. package/api/features/WebhookDispatcher/feature.d.ts +4 -0
  536. package/api/features/WebhookDispatcher/feature.js +11 -0
  537. package/api/features/WebhookDispatcher/feature.js.map +1 -0
  538. package/api/features/WebhookPermissions/abstractions.d.ts +17 -0
  539. package/api/features/WebhookPermissions/abstractions.js +6 -0
  540. package/api/features/WebhookPermissions/abstractions.js.map +1 -0
  541. package/api/features/WebhookPermissions/feature.d.ts +4 -0
  542. package/api/features/WebhookPermissions/feature.js +7 -0
  543. package/api/features/WebhookPermissions/feature.js.map +1 -0
  544. package/api/features/WebhookSignPayload/WebhookSignPayload.d.ts +9 -0
  545. package/api/features/WebhookSignPayload/WebhookSignPayload.js +26 -0
  546. package/api/features/WebhookSignPayload/WebhookSignPayload.js.map +1 -0
  547. package/api/features/WebhookSignPayload/feature.d.ts +4 -0
  548. package/api/features/WebhookSignPayload/feature.js +11 -0
  549. package/api/features/WebhookSignPayload/feature.js.map +1 -0
  550. package/api/features/WebhookVerifyPayload/WebhookVerifyPayload.d.ts +10 -0
  551. package/api/features/WebhookVerifyPayload/WebhookVerifyPayload.js +22 -0
  552. package/api/features/WebhookVerifyPayload/WebhookVerifyPayload.js.map +1 -0
  553. package/api/features/WebhookVerifyPayload/feature.d.ts +4 -0
  554. package/api/features/WebhookVerifyPayload/feature.js +11 -0
  555. package/api/features/WebhookVerifyPayload/feature.js.map +1 -0
  556. package/api/graphql/WebhookCrudSchema.d.ts +8 -0
  557. package/api/graphql/WebhookCrudSchema.js +166 -0
  558. package/api/graphql/WebhookCrudSchema.js.map +1 -0
  559. package/api/graphql/WebhookDeliverySchema.d.ts +8 -0
  560. package/api/graphql/WebhookDeliverySchema.js +100 -0
  561. package/api/graphql/WebhookDeliverySchema.js.map +1 -0
  562. package/api/graphql/WebhookEventSchema.d.ts +8 -0
  563. package/api/graphql/WebhookEventSchema.js +45 -0
  564. package/api/graphql/WebhookEventSchema.js.map +1 -0
  565. package/api/graphql/WebhookSettingsSchema.d.ts +8 -0
  566. package/api/graphql/WebhookSettingsSchema.js +62 -0
  567. package/api/graphql/WebhookSettingsSchema.js.map +1 -0
  568. package/api/graphql/WebhookTriggerSchema.d.ts +8 -0
  569. package/api/graphql/WebhookTriggerSchema.js +36 -0
  570. package/api/graphql/WebhookTriggerSchema.js.map +1 -0
  571. package/api/index.d.ts +1 -0
  572. package/api/index.js +8 -0
  573. package/api/index.js.map +1 -0
  574. package/api/models/WebhookDeliveryModel.d.ts +8 -0
  575. package/api/models/WebhookDeliveryModel.js +36 -0
  576. package/api/models/WebhookDeliveryModel.js.map +1 -0
  577. package/api/models/WebhookModel.d.ts +8 -0
  578. package/api/models/WebhookModel.js +33 -0
  579. package/api/models/WebhookModel.js.map +1 -0
  580. package/api/models/WebhookSettingsModel.d.ts +8 -0
  581. package/api/models/WebhookSettingsModel.js +28 -0
  582. package/api/models/WebhookSettingsModel.js.map +1 -0
  583. package/api/permissions.d.ts +12 -0
  584. package/api/permissions.js +22 -0
  585. package/api/permissions.js.map +1 -0
  586. package/api/utils/isValidEndpointUrl.d.ts +1 -0
  587. package/api/utils/isValidEndpointUrl.js +13 -0
  588. package/api/utils/isValidEndpointUrl.js.map +1 -0
  589. package/exports/api/webhooks.d.ts +5 -0
  590. package/exports/api/webhooks.js +1 -0
  591. package/package.json +58 -0
@@ -0,0 +1,27 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { ListWebhooksRepository, ListWebhooksUseCase } from "./abstractions.js";
3
+ import { ListWebhooksInputSchema } from "./schema.js";
4
+ import { WebhookPermissions } from "../WebhookPermissions/abstractions.js";
5
+ import { WebhookNotAuthorizedError, WebhookValidationError } from "../../domain/errors.js";
6
+ class ListWebhooksUseCaseImpl {
7
+ constructor(permissions, repository){
8
+ this.permissions = permissions;
9
+ this.repository = repository;
10
+ }
11
+ async execute(input) {
12
+ if (!await this.permissions.canRead("webhook")) return Result.fail(new WebhookNotAuthorizedError());
13
+ const parsed = ListWebhooksInputSchema.safeParse(input ?? {});
14
+ if (!parsed.success) return Result.fail(new WebhookValidationError(parsed.error));
15
+ return this.repository.execute(input);
16
+ }
17
+ }
18
+ const ListWebhooksUseCase_ListWebhooksUseCase = ListWebhooksUseCase.createImplementation({
19
+ implementation: ListWebhooksUseCaseImpl,
20
+ dependencies: [
21
+ WebhookPermissions,
22
+ ListWebhooksRepository
23
+ ]
24
+ });
25
+ export { ListWebhooksUseCase_ListWebhooksUseCase as ListWebhooksUseCase };
26
+
27
+ //# sourceMappingURL=ListWebhooksUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ListWebhooks/ListWebhooksUseCase.js","sources":["../../../../src/api/features/ListWebhooks/ListWebhooksUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n ListWebhooksUseCase as UseCaseAbstraction,\n ListWebhooksRepository\n} from \"./abstractions.js\";\nimport { ListWebhooksInputSchema } from \"./schema.js\";\nimport { WebhookPermissions } from \"~/api/features/WebhookPermissions/abstractions.js\";\nimport { WebhookNotAuthorizedError, WebhookValidationError } from \"~/api/domain/errors.js\";\nimport type { IListWebhooksInput } from \"./abstractions.js\";\n\nclass ListWebhooksUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private readonly permissions: WebhookPermissions.Interface,\n private readonly repository: ListWebhooksRepository.Interface\n ) {}\n\n async execute(\n input?: IListWebhooksInput\n ): Promise<Result<UseCaseAbstraction.Output, UseCaseAbstraction.Error>> {\n if (!(await this.permissions.canRead(\"webhook\"))) {\n return Result.fail(new WebhookNotAuthorizedError());\n }\n\n const parsed = ListWebhooksInputSchema.safeParse(input ?? {});\n if (!parsed.success) {\n return Result.fail(new WebhookValidationError(parsed.error));\n }\n\n return this.repository.execute(input);\n }\n}\n\nexport const ListWebhooksUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListWebhooksUseCaseImpl,\n dependencies: [WebhookPermissions, ListWebhooksRepository]\n});\n"],"names":["ListWebhooksUseCaseImpl","permissions","repository","input","Result","WebhookNotAuthorizedError","parsed","ListWebhooksInputSchema","WebhookValidationError","ListWebhooksUseCase","UseCaseAbstraction","WebhookPermissions","ListWebhooksRepository"],"mappings":";;;;;AAUA,MAAMA;IACF,YACqBC,WAAyC,EACzCC,UAA4C,CAC/D;aAFmBD,WAAW,GAAXA;aACAC,UAAU,GAAVA;IAClB;IAEH,MAAM,QACFC,KAA0B,EAC0C;QACpE,IAAI,CAAE,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YACjC,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,SAASC,wBAAwB,SAAS,CAACJ,SAAS,CAAC;QAC3D,IAAI,CAACG,OAAO,OAAO,EACf,OAAOF,OAAO,IAAI,CAAC,IAAII,uBAAuBF,OAAO,KAAK;QAG9D,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAACH;IACnC;AACJ;AAEO,MAAMM,0CAAsBC,oBAAAA,oBAAuC,CAAC;IACvE,gBAAgBV;IAChB,cAAc;QAACW;QAAoBC;KAAuB;AAC9D"}
@@ -0,0 +1,41 @@
1
+ import { type Result } from "@webiny/feature/api";
2
+ import type { Webhook } from "../../../api/domain/Webhook.js";
3
+ import type { WebhookModelNotFoundError, WebhookPersistenceError, WebhookNotAuthorizedError, WebhookValidationError } from "../../../api/domain/errors.js";
4
+ import type { DateStringInterfaceGenerator, IdInterfaceGenerator, TextInterfaceGenerator, TruthfulInterfaceGenerator } from "@webiny/api";
5
+ export interface IListWebhooksInputWhere extends IdInterfaceGenerator<"id">, DateStringInterfaceGenerator<"createdOn">, DateStringInterfaceGenerator<"savedOn">, TextInterfaceGenerator<"name">, TextInterfaceGenerator<"slug">, TextInterfaceGenerator<"endpointUrl">, TextInterfaceGenerator<"events">, TruthfulInterfaceGenerator<"enabled"> {
6
+ }
7
+ export interface IListWebhooksInput {
8
+ where?: IListWebhooksInputWhere;
9
+ limit?: number;
10
+ after?: string;
11
+ sort?: (`${string}_ASC` | `${string}_DESC`)[];
12
+ }
13
+ export interface IListMeta {
14
+ cursor: string | null;
15
+ hasMoreItems: boolean;
16
+ totalCount: number;
17
+ }
18
+ type IError = WebhookModelNotFoundError | WebhookPersistenceError | WebhookNotAuthorizedError | WebhookValidationError;
19
+ export interface IListWebhooksOutput {
20
+ items: Webhook[];
21
+ meta: IListMeta;
22
+ }
23
+ export interface IListWebhooksUseCase {
24
+ execute(input?: IListWebhooksInput): Promise<Result<IListWebhooksOutput, IError>>;
25
+ }
26
+ export declare const ListWebhooksUseCase: import("@webiny/di").Abstraction<IListWebhooksUseCase>;
27
+ export declare namespace ListWebhooksUseCase {
28
+ type Interface = IListWebhooksUseCase;
29
+ type Output = IListWebhooksOutput;
30
+ type Error = IError;
31
+ }
32
+ export interface IListWebhooksRepository {
33
+ execute(input?: IListWebhooksInput): Promise<Result<IListWebhooksOutput, IError>>;
34
+ }
35
+ export declare const ListWebhooksRepository: import("@webiny/di").Abstraction<IListWebhooksRepository>;
36
+ export declare namespace ListWebhooksRepository {
37
+ type Interface = IListWebhooksRepository;
38
+ type Output = IListWebhooksOutput;
39
+ type Error = IError;
40
+ }
41
+ export {};
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const ListWebhooksUseCase = createAbstraction("Webhooks/ListWebhooksUseCase");
3
+ const ListWebhooksRepository = createAbstraction("Webhooks/ListWebhooksRepository");
4
+ export { ListWebhooksRepository, ListWebhooksUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ListWebhooks/abstractions.js","sources":["../../../../src/api/features/ListWebhooks/abstractions.ts"],"sourcesContent":["import { createAbstraction, type Result } from \"@webiny/feature/api\";\nimport type { Webhook } from \"~/api/domain/Webhook.js\";\nimport type {\n WebhookModelNotFoundError,\n WebhookPersistenceError,\n WebhookNotAuthorizedError,\n WebhookValidationError\n} from \"~/api/domain/errors.js\";\nimport type {\n DateStringInterfaceGenerator,\n IdInterfaceGenerator,\n TextInterfaceGenerator,\n TruthfulInterfaceGenerator\n} from \"@webiny/api\";\n\nexport interface IListWebhooksInputWhere\n extends\n IdInterfaceGenerator<\"id\">,\n DateStringInterfaceGenerator<\"createdOn\">,\n DateStringInterfaceGenerator<\"savedOn\">,\n TextInterfaceGenerator<\"name\">,\n TextInterfaceGenerator<\"slug\">,\n TextInterfaceGenerator<\"endpointUrl\">,\n TextInterfaceGenerator<\"events\">,\n TruthfulInterfaceGenerator<\"enabled\"> {\n //\n}\n\nexport interface IListWebhooksInput {\n where?: IListWebhooksInputWhere;\n limit?: number;\n after?: string;\n sort?: (`${string}_ASC` | `${string}_DESC`)[];\n}\n\nexport interface IListMeta {\n cursor: string | null;\n hasMoreItems: boolean;\n totalCount: number;\n}\n\ntype IError =\n | WebhookModelNotFoundError\n | WebhookPersistenceError\n | WebhookNotAuthorizedError\n | WebhookValidationError;\n\nexport interface IListWebhooksOutput {\n items: Webhook[];\n meta: IListMeta;\n}\n\nexport interface IListWebhooksUseCase {\n execute(input?: IListWebhooksInput): Promise<Result<IListWebhooksOutput, IError>>;\n}\n\nexport const ListWebhooksUseCase = createAbstraction<IListWebhooksUseCase>(\n \"Webhooks/ListWebhooksUseCase\"\n);\n\nexport namespace ListWebhooksUseCase {\n export type Interface = IListWebhooksUseCase;\n export type Output = IListWebhooksOutput;\n export type Error = IError;\n}\n\nexport interface IListWebhooksRepository {\n execute(input?: IListWebhooksInput): Promise<Result<IListWebhooksOutput, IError>>;\n}\n\nexport const ListWebhooksRepository = createAbstraction<IListWebhooksRepository>(\n \"Webhooks/ListWebhooksRepository\"\n);\n\nexport namespace ListWebhooksRepository {\n export type Interface = IListWebhooksRepository;\n export type Output = IListWebhooksOutput;\n export type Error = IError;\n}\n"],"names":["ListWebhooksUseCase","createAbstraction","ListWebhooksRepository"],"mappings":";AAwDO,MAAMA,sBAAsBC,kBAC/B;AAaG,MAAMC,yBAAyBD,kBAClC"}
@@ -0,0 +1,4 @@
1
+ export declare const ListWebhooksFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,13 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { ListWebhooksUseCase } from "./ListWebhooksUseCase.js";
3
+ import { ListWebhooksRepository } from "./ListWebhooksRepository.js";
4
+ const ListWebhooksFeature = createFeature({
5
+ name: "ListWebhooks",
6
+ register (container) {
7
+ container.register(ListWebhooksUseCase);
8
+ container.register(ListWebhooksRepository).inSingletonScope();
9
+ }
10
+ });
11
+ export { ListWebhooksFeature };
12
+
13
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ListWebhooks/feature.js","sources":["../../../../src/api/features/ListWebhooks/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListWebhooksUseCase } from \"./ListWebhooksUseCase.js\";\nimport { ListWebhooksRepository } from \"./ListWebhooksRepository.js\";\n\nexport const ListWebhooksFeature = createFeature({\n name: \"ListWebhooks\",\n register(container) {\n container.register(ListWebhooksUseCase);\n container.register(ListWebhooksRepository).inSingletonScope();\n }\n});\n"],"names":["ListWebhooksFeature","createFeature","container","ListWebhooksUseCase","ListWebhooksRepository"],"mappings":";;;AAIO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,wBAAwB,gBAAgB;IAC/D;AACJ"}
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ export declare const ListWebhooksInputSchema: z.ZodObject<{
3
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4
+ limit: z.ZodOptional<z.ZodNumber>;
5
+ after: z.ZodOptional<z.ZodString>;
6
+ sort: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ }, z.core.$strip>;
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ const ListWebhooksInputSchema = z.object({
3
+ where: z.record(z.string(), z.unknown()).optional(),
4
+ limit: z.number().int().positive("Limit must be a positive integer.").optional(),
5
+ after: z.string().optional(),
6
+ sort: z.array(z.string()).optional()
7
+ });
8
+ export { ListWebhooksInputSchema };
9
+
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ListWebhooks/schema.js","sources":["../../../../src/api/features/ListWebhooks/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ListWebhooksInputSchema = z.object({\n where: z.record(z.string(), z.unknown()).optional(),\n limit: z.number().int().positive(\"Limit must be a positive integer.\").optional(),\n after: z.string().optional(),\n sort: z.array(z.string()).optional()\n});\n"],"names":["ListWebhooksInputSchema","z"],"mappings":";AAEO,MAAMA,0BAA0BC,EAAE,MAAM,CAAC;IAC5C,OAAOA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,OAAO,IAAI,QAAQ;IACjD,OAAOA,EAAE,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,qCAAqC,QAAQ;IAC9E,OAAOA,EAAE,MAAM,GAAG,QAAQ;IAC1B,MAAMA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ;AACtC"}
@@ -0,0 +1,22 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { ResendWebhookDeliveryUseCase as UseCaseAbstraction } from "./abstractions.js";
3
+ import { GetWebhookDeliveryRepository } from "../../../api/features/GetWebhookDelivery/abstractions.js";
4
+ import { GetWebhookRepository } from "../../../api/features/GetWebhook/abstractions.js";
5
+ import { CreateWebhookDeliveryRepository } from "../../../api/features/CreateWebhookDelivery/abstractions.js";
6
+ import { GetWebhookSettingsRepository } from "../../../api/features/GetWebhookSettings/abstractions.js";
7
+ import { WebhookPermissions } from "../../../api/features/WebhookPermissions/abstractions.js";
8
+ import { TaskService } from "@webiny/api-core/exports/api/tasks.js";
9
+ declare class ResendWebhookDeliveryUseCaseImpl implements UseCaseAbstraction.Interface {
10
+ private readonly permissions;
11
+ private readonly getDeliveryRepository;
12
+ private readonly getWebhookRepository;
13
+ private readonly createDeliveryRepository;
14
+ private readonly taskService;
15
+ private readonly getSettingsRepository;
16
+ constructor(permissions: WebhookPermissions.Interface, getDeliveryRepository: GetWebhookDeliveryRepository.Interface, getWebhookRepository: GetWebhookRepository.Interface, createDeliveryRepository: CreateWebhookDeliveryRepository.Interface, taskService: TaskService.Interface, getSettingsRepository: GetWebhookSettingsRepository.Interface);
17
+ execute(deliveryId: string): Promise<Result<boolean, UseCaseAbstraction.Error>>;
18
+ }
19
+ export declare const ResendWebhookDeliveryUseCase: typeof ResendWebhookDeliveryUseCaseImpl & {
20
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IResendWebhookDeliveryUseCase>;
21
+ };
22
+ export {};
@@ -0,0 +1,70 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { ResendWebhookDeliveryUseCase } from "./abstractions.js";
3
+ import { ResendWebhookDeliveryInputSchema } from "./schema.js";
4
+ import { GetWebhookDeliveryRepository } from "../GetWebhookDelivery/abstractions.js";
5
+ import { GetWebhookRepository } from "../GetWebhook/abstractions.js";
6
+ import { CreateWebhookDeliveryRepository } from "../CreateWebhookDelivery/abstractions.js";
7
+ import { GetWebhookSettingsRepository } from "../GetWebhookSettings/abstractions.js";
8
+ import { WebhookPermissions } from "../WebhookPermissions/abstractions.js";
9
+ import { WebhookNotAuthorizedError, WebhookValidationError } from "../../domain/errors.js";
10
+ import { TaskService } from "@webiny/api-core/exports/api/tasks.js";
11
+ import { SEND_WEBHOOK_TASK, WEBHOOK_DELIVERY_MAX_RETENTION_DAYS } from "../../domain/constants.js";
12
+ class ResendWebhookDeliveryUseCaseImpl {
13
+ constructor(permissions, getDeliveryRepository, getWebhookRepository, createDeliveryRepository, taskService, getSettingsRepository){
14
+ this.permissions = permissions;
15
+ this.getDeliveryRepository = getDeliveryRepository;
16
+ this.getWebhookRepository = getWebhookRepository;
17
+ this.createDeliveryRepository = createDeliveryRepository;
18
+ this.taskService = taskService;
19
+ this.getSettingsRepository = getSettingsRepository;
20
+ }
21
+ async execute(deliveryId) {
22
+ if (!await this.permissions.canEdit("webhook")) return Result.fail(new WebhookNotAuthorizedError());
23
+ const parsed = ResendWebhookDeliveryInputSchema.safeParse({
24
+ deliveryId
25
+ });
26
+ if (!parsed.success) return Result.fail(new WebhookValidationError(parsed.error));
27
+ const deliveryResult = await this.getDeliveryRepository.execute(parsed.data.deliveryId);
28
+ if (deliveryResult.isFail()) return Result.fail(deliveryResult.error);
29
+ const delivery = deliveryResult.value;
30
+ const webhookResult = await this.getWebhookRepository.execute(delivery.webhookId);
31
+ if (webhookResult.isFail()) return Result.fail(webhookResult.error);
32
+ const originalPayload = delivery.payload;
33
+ const data = originalPayload?.data ?? {};
34
+ const settingsResult = await this.getSettingsRepository.execute();
35
+ const retentionDays = settingsResult.isOk() ? settingsResult.value.deliveryRetentionDays ?? WEBHOOK_DELIVERY_MAX_RETENTION_DAYS : WEBHOOK_DELIVERY_MAX_RETENTION_DAYS;
36
+ const expiresAt = new Date(Date.now() + 24 * retentionDays * 3600000);
37
+ const newDeliveryResult = await this.createDeliveryRepository.execute({
38
+ webhookId: delivery.webhookId,
39
+ eventType: delivery.eventType,
40
+ status: "pending",
41
+ payload: data,
42
+ expiresAt
43
+ });
44
+ if (newDeliveryResult.isFail()) return Result.fail(newDeliveryResult.error);
45
+ await this.taskService.trigger({
46
+ definition: SEND_WEBHOOK_TASK,
47
+ name: `Resend webhook: ${delivery.eventType}`,
48
+ input: {
49
+ webhookId: delivery.webhookId,
50
+ eventName: delivery.eventType,
51
+ deliveryId: newDeliveryResult.value.id
52
+ }
53
+ });
54
+ return Result.ok(true);
55
+ }
56
+ }
57
+ const ResendWebhookDeliveryUseCase_ResendWebhookDeliveryUseCase = ResendWebhookDeliveryUseCase.createImplementation({
58
+ implementation: ResendWebhookDeliveryUseCaseImpl,
59
+ dependencies: [
60
+ WebhookPermissions,
61
+ GetWebhookDeliveryRepository,
62
+ GetWebhookRepository,
63
+ CreateWebhookDeliveryRepository,
64
+ TaskService,
65
+ GetWebhookSettingsRepository
66
+ ]
67
+ });
68
+ export { ResendWebhookDeliveryUseCase_ResendWebhookDeliveryUseCase as ResendWebhookDeliveryUseCase };
69
+
70
+ //# sourceMappingURL=ResendWebhookDeliveryUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.js","sources":["../../../../src/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { ResendWebhookDeliveryUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { ResendWebhookDeliveryInputSchema } from \"./schema.js\";\nimport { GetWebhookDeliveryRepository } from \"~/api/features/GetWebhookDelivery/abstractions.js\";\nimport { GetWebhookRepository } from \"~/api/features/GetWebhook/abstractions.js\";\nimport { CreateWebhookDeliveryRepository } from \"~/api/features/CreateWebhookDelivery/abstractions.js\";\nimport { GetWebhookSettingsRepository } from \"~/api/features/GetWebhookSettings/abstractions.js\";\nimport { WebhookPermissions } from \"~/api/features/WebhookPermissions/abstractions.js\";\nimport { WebhookNotAuthorizedError, WebhookValidationError } from \"~/api/domain/errors.js\";\nimport { TaskService } from \"@webiny/api-core/exports/api/tasks.js\";\nimport { SEND_WEBHOOK_TASK, WEBHOOK_DELIVERY_MAX_RETENTION_DAYS } from \"~/api/domain/constants.js\";\nimport type { IWebhookPayload } from \"~/api/features/SendWebhookTask/types.js\";\n\nclass ResendWebhookDeliveryUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private readonly permissions: WebhookPermissions.Interface,\n private readonly getDeliveryRepository: GetWebhookDeliveryRepository.Interface,\n private readonly getWebhookRepository: GetWebhookRepository.Interface,\n private readonly createDeliveryRepository: CreateWebhookDeliveryRepository.Interface,\n private readonly taskService: TaskService.Interface,\n private readonly getSettingsRepository: GetWebhookSettingsRepository.Interface\n ) {}\n\n async execute(deliveryId: string): Promise<Result<boolean, UseCaseAbstraction.Error>> {\n if (!(await this.permissions.canEdit(\"webhook\"))) {\n return Result.fail(new WebhookNotAuthorizedError());\n }\n\n const parsed = ResendWebhookDeliveryInputSchema.safeParse({ deliveryId });\n if (!parsed.success) {\n return Result.fail(new WebhookValidationError(parsed.error));\n }\n\n const deliveryResult = await this.getDeliveryRepository.execute(parsed.data.deliveryId);\n if (deliveryResult.isFail()) {\n return Result.fail(deliveryResult.error);\n }\n\n const delivery = deliveryResult.value;\n\n const webhookResult = await this.getWebhookRepository.execute(delivery.webhookId);\n if (webhookResult.isFail()) {\n return Result.fail(webhookResult.error);\n }\n\n const originalPayload = delivery.payload as IWebhookPayload | null;\n const data = originalPayload?.data ?? {};\n\n const settingsResult = await this.getSettingsRepository.execute();\n const retentionDays = settingsResult.isOk()\n ? (settingsResult.value.deliveryRetentionDays ?? WEBHOOK_DELIVERY_MAX_RETENTION_DAYS)\n : WEBHOOK_DELIVERY_MAX_RETENTION_DAYS;\n\n const expiresAt = new Date(Date.now() + retentionDays * 24 * 60 * 60 * 1000);\n\n const newDeliveryResult = await this.createDeliveryRepository.execute({\n webhookId: delivery.webhookId,\n eventType: delivery.eventType,\n status: \"pending\",\n payload: data as Record<string, unknown>,\n expiresAt\n });\n\n if (newDeliveryResult.isFail()) {\n return Result.fail(newDeliveryResult.error);\n }\n\n await this.taskService.trigger({\n definition: SEND_WEBHOOK_TASK,\n name: `Resend webhook: ${delivery.eventType}`,\n input: {\n webhookId: delivery.webhookId,\n eventName: delivery.eventType,\n deliveryId: newDeliveryResult.value.id\n }\n });\n\n return Result.ok(true);\n }\n}\n\nexport const ResendWebhookDeliveryUseCase = UseCaseAbstraction.createImplementation({\n implementation: ResendWebhookDeliveryUseCaseImpl,\n dependencies: [\n WebhookPermissions,\n GetWebhookDeliveryRepository,\n GetWebhookRepository,\n CreateWebhookDeliveryRepository,\n TaskService,\n GetWebhookSettingsRepository\n ]\n});\n"],"names":["ResendWebhookDeliveryUseCaseImpl","permissions","getDeliveryRepository","getWebhookRepository","createDeliveryRepository","taskService","getSettingsRepository","deliveryId","Result","WebhookNotAuthorizedError","parsed","ResendWebhookDeliveryInputSchema","WebhookValidationError","deliveryResult","delivery","webhookResult","originalPayload","data","settingsResult","retentionDays","WEBHOOK_DELIVERY_MAX_RETENTION_DAYS","expiresAt","Date","newDeliveryResult","SEND_WEBHOOK_TASK","ResendWebhookDeliveryUseCase","UseCaseAbstraction","WebhookPermissions","GetWebhookDeliveryRepository","GetWebhookRepository","CreateWebhookDeliveryRepository","TaskService","GetWebhookSettingsRepository"],"mappings":";;;;;;;;;;;AAaA,MAAMA;IACF,YACqBC,WAAyC,EACzCC,qBAA6D,EAC7DC,oBAAoD,EACpDC,wBAAmE,EACnEC,WAAkC,EAClCC,qBAA6D,CAChF;aANmBL,WAAW,GAAXA;aACAC,qBAAqB,GAArBA;aACAC,oBAAoB,GAApBA;aACAC,wBAAwB,GAAxBA;aACAC,WAAW,GAAXA;aACAC,qBAAqB,GAArBA;IAClB;IAEH,MAAM,QAAQC,UAAkB,EAAsD;QAClF,IAAI,CAAE,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YACjC,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,SAASC,iCAAiC,SAAS,CAAC;YAAEJ;QAAW;QACvE,IAAI,CAACG,OAAO,OAAO,EACf,OAAOF,OAAO,IAAI,CAAC,IAAII,uBAAuBF,OAAO,KAAK;QAG9D,MAAMG,iBAAiB,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAACH,OAAO,IAAI,CAAC,UAAU;QACtF,IAAIG,eAAe,MAAM,IACrB,OAAOL,OAAO,IAAI,CAACK,eAAe,KAAK;QAG3C,MAAMC,WAAWD,eAAe,KAAK;QAErC,MAAME,gBAAgB,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAACD,SAAS,SAAS;QAChF,IAAIC,cAAc,MAAM,IACpB,OAAOP,OAAO,IAAI,CAACO,cAAc,KAAK;QAG1C,MAAMC,kBAAkBF,SAAS,OAAO;QACxC,MAAMG,OAAOD,iBAAiB,QAAQ,CAAC;QAEvC,MAAME,iBAAiB,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO;QAC/D,MAAMC,gBAAgBD,eAAe,IAAI,KAClCA,eAAe,KAAK,CAAC,qBAAqB,IAAIE,sCAC/CA;QAEN,MAAMC,YAAY,IAAIC,KAAKA,KAAK,GAAG,KAAKH,AAAgB,KAAhBA,gBAAAA;QAExC,MAAMI,oBAAoB,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC;YAClE,WAAWT,SAAS,SAAS;YAC7B,WAAWA,SAAS,SAAS;YAC7B,QAAQ;YACR,SAASG;YACTI;QACJ;QAEA,IAAIE,kBAAkB,MAAM,IACxB,OAAOf,OAAO,IAAI,CAACe,kBAAkB,KAAK;QAG9C,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC3B,YAAYC;YACZ,MAAM,CAAC,gBAAgB,EAAEV,SAAS,SAAS,EAAE;YAC7C,OAAO;gBACH,WAAWA,SAAS,SAAS;gBAC7B,WAAWA,SAAS,SAAS;gBAC7B,YAAYS,kBAAkB,KAAK,CAAC,EAAE;YAC1C;QACJ;QAEA,OAAOf,OAAO,EAAE,CAAC;IACrB;AACJ;AAEO,MAAMiB,4DAA+BC,6BAAAA,oBAAuC,CAAC;IAChF,gBAAgB1B;IAChB,cAAc;QACV2B;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -0,0 +1,12 @@
1
+ import { type Result } from "@webiny/feature/api";
2
+ import type { WebhookDeliveryNotFoundError, WebhookNotFoundError, WebhookPersistenceError, WebhookModelNotFoundError, WebhookNotAuthorizedError, WebhookValidationError } from "../../../api/domain/errors.js";
3
+ type IError = WebhookDeliveryNotFoundError | WebhookNotFoundError | WebhookPersistenceError | WebhookModelNotFoundError | WebhookNotAuthorizedError | WebhookValidationError;
4
+ export interface IResendWebhookDeliveryUseCase {
5
+ execute(deliveryId: string): Promise<Result<boolean, IError>>;
6
+ }
7
+ export declare const ResendWebhookDeliveryUseCase: import("@webiny/di").Abstraction<IResendWebhookDeliveryUseCase>;
8
+ export declare namespace ResendWebhookDeliveryUseCase {
9
+ type Interface = IResendWebhookDeliveryUseCase;
10
+ type Error = IError;
11
+ }
12
+ export {};
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const ResendWebhookDeliveryUseCase = createAbstraction("Webhooks/ResendWebhookDeliveryUseCase");
3
+ export { ResendWebhookDeliveryUseCase };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ResendWebhookDelivery/abstractions.js","sources":["../../../../src/api/features/ResendWebhookDelivery/abstractions.ts"],"sourcesContent":["import { createAbstraction, type Result } from \"@webiny/feature/api\";\nimport type {\n WebhookDeliveryNotFoundError,\n WebhookNotFoundError,\n WebhookPersistenceError,\n WebhookModelNotFoundError,\n WebhookNotAuthorizedError,\n WebhookValidationError\n} from \"~/api/domain/errors.js\";\n\ntype IError =\n | WebhookDeliveryNotFoundError\n | WebhookNotFoundError\n | WebhookPersistenceError\n | WebhookModelNotFoundError\n | WebhookNotAuthorizedError\n | WebhookValidationError;\n\nexport interface IResendWebhookDeliveryUseCase {\n execute(deliveryId: string): Promise<Result<boolean, IError>>;\n}\n\nexport const ResendWebhookDeliveryUseCase = createAbstraction<IResendWebhookDeliveryUseCase>(\n \"Webhooks/ResendWebhookDeliveryUseCase\"\n);\n\nexport namespace ResendWebhookDeliveryUseCase {\n export type Interface = IResendWebhookDeliveryUseCase;\n export type Error = IError;\n}\n"],"names":["ResendWebhookDeliveryUseCase","createAbstraction"],"mappings":";AAsBO,MAAMA,+BAA+BC,kBACxC"}
@@ -0,0 +1,4 @@
1
+ export declare const ResendWebhookDeliveryFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { ResendWebhookDeliveryUseCase } from "./ResendWebhookDeliveryUseCase.js";
3
+ const ResendWebhookDeliveryFeature = createFeature({
4
+ name: "ResendWebhookDelivery",
5
+ register (container) {
6
+ container.register(ResendWebhookDeliveryUseCase);
7
+ }
8
+ });
9
+ export { ResendWebhookDeliveryFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ResendWebhookDelivery/feature.js","sources":["../../../../src/api/features/ResendWebhookDelivery/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ResendWebhookDeliveryUseCase } from \"./ResendWebhookDeliveryUseCase.js\";\n\nexport const ResendWebhookDeliveryFeature = createFeature({\n name: \"ResendWebhookDelivery\",\n register(container) {\n container.register(ResendWebhookDeliveryUseCase);\n }\n});\n"],"names":["ResendWebhookDeliveryFeature","createFeature","container","ResendWebhookDeliveryUseCase"],"mappings":";;AAGO,MAAMA,+BAA+BC,cAAc;IACtD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const ResendWebhookDeliveryInputSchema: z.ZodObject<{
3
+ deliveryId: z.ZodString;
4
+ }, z.core.$strip>;
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ const ResendWebhookDeliveryInputSchema = z.object({
3
+ deliveryId: z.string().min(1, "Delivery ID is required.")
4
+ });
5
+ export { ResendWebhookDeliveryInputSchema };
6
+
7
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/ResendWebhookDelivery/schema.js","sources":["../../../../src/api/features/ResendWebhookDelivery/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ResendWebhookDeliveryInputSchema = z.object({\n deliveryId: z.string().min(1, \"Delivery ID is required.\")\n});\n"],"names":["ResendWebhookDeliveryInputSchema","z"],"mappings":";AAEO,MAAMA,mCAAmCC,EAAE,MAAM,CAAC;IACrD,YAAYA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG;AAClC"}
@@ -0,0 +1,33 @@
1
+ import "@webiny/tasks/types.js";
2
+ import { TaskDefinition } from "@webiny/api-core/exports/api/tasks.js";
3
+ import { TenantContext } from "@webiny/api-core/exports/api/tenancy.js";
4
+ import { WebhookSignPayload } from "@webiny/api-core/features/webhooks/index.js";
5
+ import { GetWebhookRepository } from "../../../api/features/GetWebhook/abstractions.js";
6
+ import { GetWebhookDeliveryRepository } from "../../../api/features/GetWebhookDelivery/abstractions.js";
7
+ import { UpdateWebhookDeliveryRepository } from "../../../api/features/UpdateWebhookDelivery/abstractions.js";
8
+ import { GetWebhookSettingsRepository } from "../../../api/features/GetWebhookSettings/abstractions.js";
9
+ import { WebhookDeliver } from "../../../api/features/WebhookDeliver/abstractions.js";
10
+ import type { ISendWebhookTaskInput, ISendWebhookTaskOutput } from "./types.js";
11
+ type IRunParams = TaskDefinition.RunParams<ISendWebhookTaskInput, ISendWebhookTaskOutput>;
12
+ declare class SendWebhookTaskDefinition implements TaskDefinition.Interface<ISendWebhookTaskInput, ISendWebhookTaskOutput> {
13
+ private readonly getWebhookRepository;
14
+ private readonly getWebhookDeliveryRepository;
15
+ private readonly updateDeliveryRepository;
16
+ private readonly signPayload;
17
+ private readonly tenantContext;
18
+ private readonly getWebhookSettingsRepository;
19
+ private readonly deliver;
20
+ readonly id = "sendWebhook";
21
+ readonly title = "Send Webhook";
22
+ readonly maxIterations = 1;
23
+ readonly isPrivate = true;
24
+ readonly databaseLogs = false;
25
+ readonly description = "POST a signed event payload to a webhook endpoint and log the delivery.";
26
+ readonly selfCleanup = "always";
27
+ constructor(getWebhookRepository: GetWebhookRepository.Interface, getWebhookDeliveryRepository: GetWebhookDeliveryRepository.Interface, updateDeliveryRepository: UpdateWebhookDeliveryRepository.Interface, signPayload: WebhookSignPayload.Interface, tenantContext: TenantContext.Interface, getWebhookSettingsRepository: GetWebhookSettingsRepository.Interface, deliver: WebhookDeliver.Interface);
28
+ run(params: IRunParams): Promise<import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskResultError | TaskDefinition.ResultDone<ISendWebhookTaskOutput>>;
29
+ }
30
+ export declare const SendWebhookTask: typeof SendWebhookTaskDefinition & {
31
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskDefinition<import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskInput, import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskOutput>>;
32
+ };
33
+ export {};
@@ -0,0 +1,111 @@
1
+ import "@webiny/tasks/types.js";
2
+ import { TaskDefinition } from "@webiny/api-core/exports/api/tasks.js";
3
+ import { TenantContext } from "@webiny/api-core/exports/api/tenancy.js";
4
+ import { WebhookSignPayload } from "@webiny/api-core/features/webhooks/index.js";
5
+ import { GetWebhookRepository } from "../GetWebhook/abstractions.js";
6
+ import { GetWebhookDeliveryRepository } from "../GetWebhookDelivery/abstractions.js";
7
+ import { UpdateWebhookDeliveryRepository } from "../UpdateWebhookDelivery/abstractions.js";
8
+ import { GetWebhookSettingsRepository } from "../GetWebhookSettings/abstractions.js";
9
+ import { WebhookDeliver } from "../WebhookDeliver/abstractions.js";
10
+ import { SEND_WEBHOOK_TASK } from "../../domain/constants.js";
11
+ class SendWebhookTaskDefinition {
12
+ constructor(getWebhookRepository, getWebhookDeliveryRepository, updateDeliveryRepository, signPayload, tenantContext, getWebhookSettingsRepository, deliver){
13
+ this.getWebhookRepository = getWebhookRepository;
14
+ this.getWebhookDeliveryRepository = getWebhookDeliveryRepository;
15
+ this.updateDeliveryRepository = updateDeliveryRepository;
16
+ this.signPayload = signPayload;
17
+ this.tenantContext = tenantContext;
18
+ this.getWebhookSettingsRepository = getWebhookSettingsRepository;
19
+ this.deliver = deliver;
20
+ this.id = SEND_WEBHOOK_TASK;
21
+ this.title = "Send Webhook";
22
+ this.maxIterations = 1;
23
+ this.isPrivate = true;
24
+ this.databaseLogs = false;
25
+ this.description = "POST a signed event payload to a webhook endpoint and log the delivery.";
26
+ this.selfCleanup = "always";
27
+ }
28
+ async run(params) {
29
+ const { input, controller } = params;
30
+ const taskId = controller.state.getTask().id;
31
+ const delivery = await this.getWebhookDeliveryRepository.execute(input.deliveryId);
32
+ if (delivery.isFail()) return controller.response.error(delivery.error);
33
+ await this.updateDeliveryRepository.execute(input.deliveryId, {
34
+ backgroundTaskId: taskId,
35
+ status: "delivering"
36
+ });
37
+ const webhookResult = await this.getWebhookRepository.execute(input.webhookId);
38
+ if (webhookResult.isFail()) {
39
+ await this.updateDeliveryRepository.execute(input.deliveryId, {
40
+ status: "failed"
41
+ });
42
+ return controller.response.error(webhookResult.error);
43
+ }
44
+ const webhook = webhookResult.value;
45
+ const now = new Date();
46
+ const payload = {
47
+ id: taskId,
48
+ event: input.eventName,
49
+ timestamp: now.toISOString(),
50
+ webhookId: input.webhookId,
51
+ deliveryId: input.deliveryId,
52
+ tenant: this.tenantContext.getTenant().id,
53
+ data: delivery.value.payload
54
+ };
55
+ const rawBody = JSON.stringify(payload);
56
+ let signHeaders;
57
+ const settingsResult = await this.getWebhookSettingsRepository.execute();
58
+ if (settingsResult.isFail()) {
59
+ await this.updateDeliveryRepository.execute(input.deliveryId, {
60
+ status: "failed"
61
+ });
62
+ return controller.response.error(settingsResult.error);
63
+ }
64
+ const signingSecret = webhook.signingSecret || settingsResult.value.signingSecret || "";
65
+ try {
66
+ signHeaders = await this.signPayload.sign(taskId, now, rawBody, signingSecret);
67
+ } catch (ex) {
68
+ await this.updateDeliveryRepository.execute(input.deliveryId, {
69
+ status: "failed"
70
+ });
71
+ return controller.response.error(ex);
72
+ }
73
+ const requestHeaders = {
74
+ "Content-Type": "application/json",
75
+ ...signHeaders
76
+ };
77
+ const result = await this.deliver.execute({
78
+ url: webhook.endpointUrl,
79
+ headers: requestHeaders,
80
+ body: rawBody,
81
+ timeout: 600000,
82
+ maxRetries: 3,
83
+ initialDelay: 1000,
84
+ maxDelay: 30000
85
+ });
86
+ await this.updateDeliveryRepository.execute(input.deliveryId, {
87
+ payload,
88
+ requestHeaders,
89
+ responseTime: result.responseTime,
90
+ responseStatus: result.status,
91
+ responseBody: result.body,
92
+ status: result.status > 0 ? "delivered" : "failed"
93
+ });
94
+ return controller.response.done();
95
+ }
96
+ }
97
+ const SendWebhookTask = TaskDefinition.createImplementation({
98
+ implementation: SendWebhookTaskDefinition,
99
+ dependencies: [
100
+ GetWebhookRepository,
101
+ GetWebhookDeliveryRepository,
102
+ UpdateWebhookDeliveryRepository,
103
+ WebhookSignPayload,
104
+ TenantContext,
105
+ GetWebhookSettingsRepository,
106
+ WebhookDeliver
107
+ ]
108
+ });
109
+ export { SendWebhookTask };
110
+
111
+ //# sourceMappingURL=SendWebhookTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/SendWebhookTask/SendWebhookTask.js","sources":["../../../../src/api/features/SendWebhookTask/SendWebhookTask.ts"],"sourcesContent":["import \"@webiny/tasks/types.js\";\nimport { TaskDefinition } from \"@webiny/api-core/exports/api/tasks.js\";\nimport { TenantContext } from \"@webiny/api-core/exports/api/tenancy.js\";\nimport { WebhookSignPayload } from \"@webiny/api-core/features/webhooks/index.js\";\nimport { GetWebhookRepository } from \"~/api/features/GetWebhook/abstractions.js\";\nimport { GetWebhookDeliveryRepository } from \"~/api/features/GetWebhookDelivery/abstractions.js\";\nimport { UpdateWebhookDeliveryRepository } from \"~/api/features/UpdateWebhookDelivery/abstractions.js\";\nimport { GetWebhookSettingsRepository } from \"~/api/features/GetWebhookSettings/abstractions.js\";\nimport { WebhookDeliver } from \"~/api/features/WebhookDeliver/abstractions.js\";\nimport { SEND_WEBHOOK_TASK } from \"~/api/domain/constants.js\";\nimport type { ISendWebhookTaskInput, ISendWebhookTaskOutput, IWebhookPayload } from \"./types.js\";\nimport type { IWebhookSignPayloadHeaders } from \"@webiny/api-core/features/webhooks/WebhookSignPayload/abstractions.js\";\n\ntype IRunParams = TaskDefinition.RunParams<ISendWebhookTaskInput, ISendWebhookTaskOutput>;\n\nclass SendWebhookTaskDefinition implements TaskDefinition.Interface<\n ISendWebhookTaskInput,\n ISendWebhookTaskOutput\n> {\n public readonly id = SEND_WEBHOOK_TASK;\n public readonly title = \"Send Webhook\";\n public readonly maxIterations = 1;\n public readonly isPrivate = true;\n public readonly databaseLogs = false;\n public readonly description =\n \"POST a signed event payload to a webhook endpoint and log the delivery.\";\n public readonly selfCleanup = \"always\";\n\n public constructor(\n private readonly getWebhookRepository: GetWebhookRepository.Interface,\n private readonly getWebhookDeliveryRepository: GetWebhookDeliveryRepository.Interface,\n private readonly updateDeliveryRepository: UpdateWebhookDeliveryRepository.Interface,\n private readonly signPayload: WebhookSignPayload.Interface,\n private readonly tenantContext: TenantContext.Interface,\n private readonly getWebhookSettingsRepository: GetWebhookSettingsRepository.Interface,\n private readonly deliver: WebhookDeliver.Interface\n ) {}\n\n public async run(params: IRunParams) {\n const { input, controller } = params;\n const taskId = controller.state.getTask().id;\n\n const delivery = await this.getWebhookDeliveryRepository.execute(input.deliveryId);\n if (delivery.isFail()) {\n return controller.response.error(delivery.error);\n }\n\n await this.updateDeliveryRepository.execute(input.deliveryId, {\n backgroundTaskId: taskId,\n status: \"delivering\"\n });\n\n const webhookResult = await this.getWebhookRepository.execute(input.webhookId);\n if (webhookResult.isFail()) {\n await this.updateDeliveryRepository.execute(input.deliveryId, { status: \"failed\" });\n return controller.response.error(webhookResult.error);\n }\n const webhook = webhookResult.value;\n\n const now = new Date();\n const payload: IWebhookPayload = {\n id: taskId,\n event: input.eventName,\n timestamp: now.toISOString(),\n webhookId: input.webhookId,\n deliveryId: input.deliveryId,\n tenant: this.tenantContext.getTenant().id,\n data: delivery.value.payload\n };\n const rawBody = JSON.stringify(payload);\n let signHeaders: IWebhookSignPayloadHeaders;\n\n const settingsResult = await this.getWebhookSettingsRepository.execute();\n if (settingsResult.isFail()) {\n await this.updateDeliveryRepository.execute(input.deliveryId, { status: \"failed\" });\n return controller.response.error(settingsResult.error);\n }\n const signingSecret = webhook.signingSecret || settingsResult.value.signingSecret || \"\";\n\n try {\n signHeaders = await this.signPayload.sign(taskId, now, rawBody, signingSecret);\n } catch (ex) {\n await this.updateDeliveryRepository.execute(input.deliveryId, { status: \"failed\" });\n return controller.response.error(ex);\n }\n\n const requestHeaders: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...signHeaders\n };\n\n const result = await this.deliver.execute({\n url: webhook.endpointUrl,\n headers: requestHeaders,\n body: rawBody,\n timeout: 600_000,\n maxRetries: 3,\n initialDelay: 1000,\n maxDelay: 30_000\n });\n\n await this.updateDeliveryRepository.execute(input.deliveryId, {\n payload,\n requestHeaders,\n responseTime: result.responseTime,\n responseStatus: result.status,\n responseBody: result.body,\n status: result.status > 0 ? \"delivered\" : \"failed\"\n });\n\n return controller.response.done();\n }\n}\n\nexport const SendWebhookTask = TaskDefinition.createImplementation({\n implementation: SendWebhookTaskDefinition,\n dependencies: [\n GetWebhookRepository,\n GetWebhookDeliveryRepository,\n UpdateWebhookDeliveryRepository,\n WebhookSignPayload,\n TenantContext,\n GetWebhookSettingsRepository,\n WebhookDeliver\n ]\n});\n"],"names":["SendWebhookTaskDefinition","getWebhookRepository","getWebhookDeliveryRepository","updateDeliveryRepository","signPayload","tenantContext","getWebhookSettingsRepository","deliver","SEND_WEBHOOK_TASK","params","input","controller","taskId","delivery","webhookResult","webhook","now","Date","payload","rawBody","JSON","signHeaders","settingsResult","signingSecret","ex","requestHeaders","result","SendWebhookTask","TaskDefinition","GetWebhookRepository","GetWebhookDeliveryRepository","UpdateWebhookDeliveryRepository","WebhookSignPayload","TenantContext","GetWebhookSettingsRepository","WebhookDeliver"],"mappings":";;;;;;;;;;AAeA,MAAMA;IAaF,YACqBC,oBAAoD,EACpDC,4BAAoE,EACpEC,wBAAmE,EACnEC,WAAyC,EACzCC,aAAsC,EACtCC,4BAAoE,EACpEC,OAAiC,CACpD;aAPmBN,oBAAoB,GAApBA;aACAC,4BAA4B,GAA5BA;aACAC,wBAAwB,GAAxBA;aACAC,WAAW,GAAXA;aACAC,aAAa,GAAbA;aACAC,4BAA4B,GAA5BA;aACAC,OAAO,GAAPA;aAhBL,EAAE,GAAGC;aACL,KAAK,GAAG;aACR,aAAa,GAAG;aAChB,SAAS,GAAG;aACZ,YAAY,GAAG;aACf,WAAW,GACvB;aACY,WAAW,GAAG;IAU3B;IAEH,MAAa,IAAIC,MAAkB,EAAE;QACjC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;QAC9B,MAAMG,SAASD,WAAW,KAAK,CAAC,OAAO,GAAG,EAAE;QAE5C,MAAME,WAAW,MAAM,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAACH,MAAM,UAAU;QACjF,IAAIG,SAAS,MAAM,IACf,OAAOF,WAAW,QAAQ,CAAC,KAAK,CAACE,SAAS,KAAK;QAGnD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACH,MAAM,UAAU,EAAE;YAC1D,kBAAkBE;YAClB,QAAQ;QACZ;QAEA,MAAME,gBAAgB,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAACJ,MAAM,SAAS;QAC7E,IAAII,cAAc,MAAM,IAAI;YACxB,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACJ,MAAM,UAAU,EAAE;gBAAE,QAAQ;YAAS;YACjF,OAAOC,WAAW,QAAQ,CAAC,KAAK,CAACG,cAAc,KAAK;QACxD;QACA,MAAMC,UAAUD,cAAc,KAAK;QAEnC,MAAME,MAAM,IAAIC;QAChB,MAAMC,UAA2B;YAC7B,IAAIN;YACJ,OAAOF,MAAM,SAAS;YACtB,WAAWM,IAAI,WAAW;YAC1B,WAAWN,MAAM,SAAS;YAC1B,YAAYA,MAAM,UAAU;YAC5B,QAAQ,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG,EAAE;YACzC,MAAMG,SAAS,KAAK,CAAC,OAAO;QAChC;QACA,MAAMM,UAAUC,KAAK,SAAS,CAACF;QAC/B,IAAIG;QAEJ,MAAMC,iBAAiB,MAAM,IAAI,CAAC,4BAA4B,CAAC,OAAO;QACtE,IAAIA,eAAe,MAAM,IAAI;YACzB,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACZ,MAAM,UAAU,EAAE;gBAAE,QAAQ;YAAS;YACjF,OAAOC,WAAW,QAAQ,CAAC,KAAK,CAACW,eAAe,KAAK;QACzD;QACA,MAAMC,gBAAgBR,QAAQ,aAAa,IAAIO,eAAe,KAAK,CAAC,aAAa,IAAI;QAErF,IAAI;YACAD,cAAc,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAACT,QAAQI,KAAKG,SAASI;QACpE,EAAE,OAAOC,IAAI;YACT,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACd,MAAM,UAAU,EAAE;gBAAE,QAAQ;YAAS;YACjF,OAAOC,WAAW,QAAQ,CAAC,KAAK,CAACa;QACrC;QAEA,MAAMC,iBAAyC;YAC3C,gBAAgB;YAChB,GAAGJ,WAAW;QAClB;QAEA,MAAMK,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACtC,KAAKX,QAAQ,WAAW;YACxB,SAASU;YACT,MAAMN;YACN,SAAS;YACT,YAAY;YACZ,cAAc;YACd,UAAU;QACd;QAEA,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACT,MAAM,UAAU,EAAE;YAC1DQ;YACAO;YACA,cAAcC,OAAO,YAAY;YACjC,gBAAgBA,OAAO,MAAM;YAC7B,cAAcA,OAAO,IAAI;YACzB,QAAQA,OAAO,MAAM,GAAG,IAAI,cAAc;QAC9C;QAEA,OAAOf,WAAW,QAAQ,CAAC,IAAI;IACnC;AACJ;AAEO,MAAMgB,kBAAkBC,eAAe,oBAAoB,CAAC;IAC/D,gBAAgB5B;IAChB,cAAc;QACV6B;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -0,0 +1,4 @@
1
+ export declare const SendWebhookTaskFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { SendWebhookTask } from "./SendWebhookTask.js";
3
+ const SendWebhookTaskFeature = createFeature({
4
+ name: "SendWebhookTask",
5
+ register (container) {
6
+ container.register(SendWebhookTask);
7
+ }
8
+ });
9
+ export { SendWebhookTaskFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/SendWebhookTask/feature.js","sources":["../../../../src/api/features/SendWebhookTask/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { SendWebhookTask } from \"./SendWebhookTask.js\";\n\nexport const SendWebhookTaskFeature = createFeature({\n name: \"SendWebhookTask\",\n register(container) {\n container.register(SendWebhookTask);\n }\n});\n"],"names":["SendWebhookTaskFeature","createFeature","container","SendWebhookTask"],"mappings":";;AAGO,MAAMA,yBAAyBC,cAAc;IAChD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -0,0 +1,16 @@
1
+ export interface ISendWebhookTaskInput {
2
+ webhookId: string;
3
+ eventName: string;
4
+ deliveryId: string;
5
+ }
6
+ export interface ISendWebhookTaskOutput {
7
+ }
8
+ export interface IWebhookPayload {
9
+ id: string;
10
+ event: string;
11
+ timestamp: string;
12
+ webhookId: string;
13
+ deliveryId: string;
14
+ tenant: string;
15
+ data: unknown;
16
+ }
File without changes
@@ -0,0 +1,13 @@
1
+ import { WebhookDeliveryTransformer as WebhookDeliveryTransformerAbstraction } from "./abstractions/WebhookDeliveryTransformer.js";
2
+ import type { CmsEntry } from "@webiny/api-headless-cms/types/index.js";
3
+ import type { WebhookDelivery, WebhookDeliveryCmsEntryValues } from "../../../api/domain/WebhookDelivery.js";
4
+ declare class WebhookDeliveryTransformerImpl implements WebhookDeliveryTransformerAbstraction.Interface {
5
+ fromStorage(entry: CmsEntry<WebhookDeliveryCmsEntryValues>): WebhookDelivery;
6
+ toStorage(delivery: WebhookDelivery): WebhookDeliveryCmsEntryValues;
7
+ private compress;
8
+ private decompress;
9
+ }
10
+ export declare const WebhookDeliveryTransformer: typeof WebhookDeliveryTransformerImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions/WebhookDeliveryTransformer.js").IWebhookDeliveryTransformer>;
12
+ };
13
+ export {};
@@ -0,0 +1,57 @@
1
+ import { WebhookDeliveryTransformer } from "./abstractions/WebhookDeliveryTransformer.js";
2
+ class WebhookDeliveryTransformerImpl {
3
+ fromStorage(entry) {
4
+ return {
5
+ id: entry.entryId,
6
+ createdOn: entry.createdOn,
7
+ savedOn: entry.savedOn,
8
+ webhookId: entry.values.webhookId,
9
+ backgroundTaskId: entry.values.backgroundTaskId,
10
+ eventType: entry.values.eventType,
11
+ status: entry.values.status,
12
+ payload: this.decompress(entry.values.payload),
13
+ requestHeaders: this.decompress(entry.values.requestHeaders),
14
+ responseTime: entry.values.responseTime,
15
+ responseStatus: entry.values.responseStatus,
16
+ responseHeaders: this.decompress(entry.values.responseHeaders),
17
+ responseBody: this.decompress(entry.values.responseBody)
18
+ };
19
+ }
20
+ toStorage(delivery) {
21
+ return {
22
+ webhookId: delivery.webhookId,
23
+ backgroundTaskId: delivery.backgroundTaskId,
24
+ eventType: delivery.eventType,
25
+ status: delivery.status,
26
+ payload: this.compress(delivery.payload),
27
+ requestHeaders: this.compress(delivery.requestHeaders),
28
+ responseTime: delivery.responseTime,
29
+ responseStatus: delivery.responseStatus,
30
+ responseHeaders: this.compress(delivery.responseHeaders),
31
+ responseBody: this.compress(delivery.responseBody)
32
+ };
33
+ }
34
+ compress(value) {
35
+ if (null == value) return null;
36
+ try {
37
+ return JSON.stringify(value);
38
+ } catch {
39
+ return value;
40
+ }
41
+ }
42
+ decompress(stored) {
43
+ if (!stored) return null;
44
+ try {
45
+ return JSON.parse(stored);
46
+ } catch {
47
+ return stored;
48
+ }
49
+ }
50
+ }
51
+ const WebhookDeliveryTransformer_WebhookDeliveryTransformer = WebhookDeliveryTransformer.createImplementation({
52
+ implementation: WebhookDeliveryTransformerImpl,
53
+ dependencies: []
54
+ });
55
+ export { WebhookDeliveryTransformer_WebhookDeliveryTransformer as WebhookDeliveryTransformer };
56
+
57
+ //# sourceMappingURL=WebhookDeliveryTransformer.js.map