@webiny/app-scheduler 6.3.0-beta.4 → 6.4.0-beta.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 (353) hide show
  1. package/Domain/Models/SchedulerItem/SchedulerItem.js +15 -14
  2. package/Domain/Models/SchedulerItem/SchedulerItem.js.map +1 -1
  3. package/Domain/Models/SchedulerItem/index.js +0 -2
  4. package/Domain/Models/index.js +0 -2
  5. package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.js +0 -3
  6. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js +107 -116
  7. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js.map +1 -1
  8. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js +13 -12
  9. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js.map +1 -1
  10. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js +34 -33
  11. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js.map +1 -1
  12. package/Domain/Repositories/SchedulerItems/index.js +0 -2
  13. package/Domain/Repositories/Search/ISearchRepository.js +0 -3
  14. package/Domain/Repositories/Search/SearchRepository.js +12 -11
  15. package/Domain/Repositories/Search/SearchRepository.js.map +1 -1
  16. package/Domain/Repositories/Search/SearchRepositoryFactory.js +13 -12
  17. package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +1 -1
  18. package/Domain/Repositories/Search/index.js +0 -2
  19. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +0 -3
  20. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +24 -23
  21. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +1 -1
  22. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +13 -12
  23. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +1 -1
  24. package/Domain/Repositories/SelectedItems/index.js +0 -2
  25. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +16 -17
  26. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +1 -1
  27. package/Domain/Repositories/Sorting/index.js +0 -2
  28. package/Domain/Repositories/index.js +0 -2
  29. package/Domain/index.js +0 -2
  30. package/Gateways/SchedulerCancelGraphQLGateway.js +23 -29
  31. package/Gateways/SchedulerCancelGraphQLGateway.js.map +1 -1
  32. package/Gateways/SchedulerGetGraphQLGateway.js +41 -45
  33. package/Gateways/SchedulerGetGraphQLGateway.js.map +1 -1
  34. package/Gateways/SchedulerListGraphQLGateway.js +42 -48
  35. package/Gateways/SchedulerListGraphQLGateway.js.map +1 -1
  36. package/Gateways/SchedulerPublishGraphQLGateway.js +31 -39
  37. package/Gateways/SchedulerPublishGraphQLGateway.js.map +1 -1
  38. package/Gateways/SchedulerUnpublishGraphQLGateway.js +35 -41
  39. package/Gateways/SchedulerUnpublishGraphQLGateway.js.map +1 -1
  40. package/Gateways/abstractions/CancelScheduledActionGateway.js +0 -3
  41. package/Gateways/abstractions/GetScheduledActionGateway.js +0 -3
  42. package/Gateways/abstractions/ListScheduledActionsGateway.js +0 -3
  43. package/Gateways/abstractions/SchedulePublishActionGateway.js +0 -3
  44. package/Gateways/abstractions/ScheduleUnpublishActionGateway.js +0 -3
  45. package/Gateways/graphql/fields.js +2 -3
  46. package/Gateways/graphql/fields.js.map +1 -1
  47. package/Gateways/index.js +0 -3
  48. package/Gateways/schema/schedulerEntry.js +13 -16
  49. package/Gateways/schema/schedulerEntry.js.map +1 -1
  50. package/Presentation/Scheduler/Scheduler.js +69 -58
  51. package/Presentation/Scheduler/Scheduler.js.map +1 -1
  52. package/Presentation/Scheduler/SchedulerControllers.js +49 -67
  53. package/Presentation/Scheduler/SchedulerControllers.js.map +1 -1
  54. package/Presentation/Scheduler/SchedulerPresenter.js +39 -38
  55. package/Presentation/Scheduler/SchedulerPresenter.js.map +1 -1
  56. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js +9 -8
  57. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js.map +1 -1
  58. package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.js +0 -3
  59. package/Presentation/Scheduler/controllers/CancelItem/index.js +0 -2
  60. package/Presentation/Scheduler/controllers/GetItem/GetItemController.js +9 -8
  61. package/Presentation/Scheduler/controllers/GetItem/GetItemController.js.map +1 -1
  62. package/Presentation/Scheduler/controllers/GetItem/IGetItemController.js +0 -3
  63. package/Presentation/Scheduler/controllers/GetItem/index.js +0 -2
  64. package/Presentation/Scheduler/controllers/ListItems/IListItemsController.js +0 -3
  65. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js +9 -8
  66. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js.map +1 -1
  67. package/Presentation/Scheduler/controllers/ListItems/index.js +0 -2
  68. package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.js +0 -3
  69. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js +9 -8
  70. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js.map +1 -1
  71. package/Presentation/Scheduler/controllers/ListMoreItems/index.js +0 -2
  72. package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.js +0 -3
  73. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js +9 -8
  74. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js.map +1 -1
  75. package/Presentation/Scheduler/controllers/PublishItem/index.js +0 -2
  76. package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.js +0 -3
  77. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js +12 -11
  78. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js.map +1 -1
  79. package/Presentation/Scheduler/controllers/SearchItems/index.js +0 -2
  80. package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.js +0 -3
  81. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js +9 -8
  82. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js.map +1 -1
  83. package/Presentation/Scheduler/controllers/SelectAllItems/index.js +0 -2
  84. package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.js +0 -3
  85. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js +10 -9
  86. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js.map +1 -1
  87. package/Presentation/Scheduler/controllers/SelectItems/index.js +0 -2
  88. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.d.ts +2 -2
  89. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js +0 -3
  90. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.d.ts +2 -2
  91. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js +13 -14
  92. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js.map +1 -1
  93. package/Presentation/Scheduler/controllers/SortItems/index.js +0 -2
  94. package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.js +0 -3
  95. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js +9 -8
  96. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js.map +1 -1
  97. package/Presentation/Scheduler/controllers/UnpublishItem/index.js +0 -2
  98. package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.js +0 -3
  99. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js +9 -8
  100. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js.map +1 -1
  101. package/Presentation/Scheduler/controllers/UnselectAllItems/index.js +0 -2
  102. package/Presentation/Scheduler/controllers/index.js +0 -2
  103. package/Presentation/Scheduler/index.js +0 -2
  104. package/Presentation/SchedulerConfigs/SchedulerConfigs.js +48 -51
  105. package/Presentation/SchedulerConfigs/SchedulerConfigs.js.map +1 -1
  106. package/Presentation/SchedulerConfigs/index.js +0 -2
  107. package/Presentation/SchedulerRenderer/SchedulerRenderer.js +10 -15
  108. package/Presentation/SchedulerRenderer/SchedulerRenderer.js.map +1 -1
  109. package/Presentation/SchedulerRenderer/index.js +0 -2
  110. package/Presentation/abstractions/ISchedulerControllers.js +0 -3
  111. package/Presentation/abstractions/ISchedulerPresenter.js +0 -3
  112. package/Presentation/abstractions/index.js +0 -3
  113. package/Presentation/components/Actions/CancelItem/CancelItem.js +14 -19
  114. package/Presentation/components/Actions/CancelItem/CancelItem.js.map +1 -1
  115. package/Presentation/components/Actions/CancelItem/index.js +0 -2
  116. package/Presentation/components/Actions/index.js +0 -2
  117. package/Presentation/components/BottomInfoBar/BottomInfoBar.js +11 -12
  118. package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +1 -1
  119. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js +41 -67
  120. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -1
  121. package/Presentation/components/BottomInfoBar/ListMeta.js +6 -9
  122. package/Presentation/components/BottomInfoBar/ListMeta.js.map +1 -1
  123. package/Presentation/components/BottomInfoBar/ListStatus.js +8 -12
  124. package/Presentation/components/BottomInfoBar/ListStatus.js.map +1 -1
  125. package/Presentation/components/BottomInfoBar/index.js +0 -2
  126. package/Presentation/components/Cells/CellActions/CellActions.js +12 -17
  127. package/Presentation/components/Cells/CellActions/CellActions.js.map +1 -1
  128. package/Presentation/components/Cells/CellActions/index.js +0 -2
  129. package/Presentation/components/Cells/CellRevision/CellRevision.js +9 -14
  130. package/Presentation/components/Cells/CellRevision/CellRevision.js.map +1 -1
  131. package/Presentation/components/Cells/CellRevision/CellRevision.styled.d.ts +1 -1
  132. package/Presentation/components/Cells/CellRevision/CellRevision.styled.js +16 -42
  133. package/Presentation/components/Cells/CellRevision/CellRevision.styled.js.map +1 -1
  134. package/Presentation/components/Cells/CellRevision/index.js +0 -2
  135. package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.js +6 -9
  136. package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -1
  137. package/Presentation/components/Cells/CellScheduledBy/index.js +0 -2
  138. package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js +11 -18
  139. package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -1
  140. package/Presentation/components/Cells/CellScheduledOn/index.js +0 -2
  141. package/Presentation/components/Cells/CellTitle/CellTitle.js +9 -12
  142. package/Presentation/components/Cells/CellTitle/CellTitle.js.map +1 -1
  143. package/Presentation/components/Cells/CellTitle/CellTitle.styled.d.ts +1 -1
  144. package/Presentation/components/Cells/CellTitle/CellTitle.styled.js +16 -42
  145. package/Presentation/components/Cells/CellTitle/CellTitle.styled.js.map +1 -1
  146. package/Presentation/components/Cells/CellTitle/index.js +0 -2
  147. package/Presentation/components/Cells/CellType/CellActionType.js +10 -13
  148. package/Presentation/components/Cells/CellType/CellActionType.js.map +1 -1
  149. package/Presentation/components/Cells/CellType/CellActionType.styled.d.ts +1 -1
  150. package/Presentation/components/Cells/CellType/CellActionType.styled.js +16 -42
  151. package/Presentation/components/Cells/CellType/CellActionType.styled.js.map +1 -1
  152. package/Presentation/components/Cells/CellType/index.js +0 -2
  153. package/Presentation/components/Cells/index.js +0 -2
  154. package/Presentation/components/Empty/Empty.js +15 -16
  155. package/Presentation/components/Empty/Empty.js.map +1 -1
  156. package/Presentation/components/Empty/Empty.styled.js +14 -28
  157. package/Presentation/components/Empty/Empty.styled.js.map +1 -1
  158. package/Presentation/components/Empty/index.js +0 -2
  159. package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js +0 -3
  160. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js +75 -79
  161. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js.map +1 -1
  162. package/Presentation/components/ScheduleDialog/index.js +0 -2
  163. package/Presentation/components/ScheduleDialog/types.js +0 -3
  164. package/Presentation/components/ScheduleDialog/useScheduleDialog.js +165 -207
  165. package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +1 -1
  166. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js +19 -25
  167. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js.map +1 -1
  168. package/Presentation/components/SchedulerOverlay/index.js +0 -2
  169. package/Presentation/components/SearchInput/SearchInput.js +25 -32
  170. package/Presentation/components/SearchInput/SearchInput.js.map +1 -1
  171. package/Presentation/components/SearchInput/index.js +0 -2
  172. package/Presentation/components/Table/Table.js +23 -28
  173. package/Presentation/components/Table/Table.js.map +1 -1
  174. package/Presentation/components/Table/index.js +0 -2
  175. package/Presentation/components/Title/Title.js +7 -12
  176. package/Presentation/components/Title/Title.js.map +1 -1
  177. package/Presentation/components/Title/Title.styled.d.ts +1 -2
  178. package/Presentation/components/Title/Title.styled.js +11 -16
  179. package/Presentation/components/Title/Title.styled.js.map +1 -1
  180. package/Presentation/components/Title/index.js +0 -2
  181. package/Presentation/configs/index.js +0 -2
  182. package/Presentation/configs/list/Browser/EntryAction.js +8 -11
  183. package/Presentation/configs/list/Browser/EntryAction.js.map +1 -1
  184. package/Presentation/configs/list/Browser/Table/Column.js +7 -10
  185. package/Presentation/configs/list/Browser/Table/Column.js.map +1 -1
  186. package/Presentation/configs/list/Browser/Table/Sorting.js +4 -7
  187. package/Presentation/configs/list/Browser/Table/Sorting.js.map +1 -1
  188. package/Presentation/configs/list/Browser/Table/index.js +4 -3
  189. package/Presentation/configs/list/Browser/Table/index.js.map +1 -1
  190. package/Presentation/configs/list/Browser/index.js +4 -3
  191. package/Presentation/configs/list/Browser/index.js.map +1 -1
  192. package/Presentation/configs/list/SchedulerListConfig.js +20 -21
  193. package/Presentation/configs/list/SchedulerListConfig.js.map +1 -1
  194. package/Presentation/configs/list/index.js +0 -2
  195. package/Presentation/hooks/index.js +0 -2
  196. package/Presentation/hooks/useCancelSchedulerItem.js +22 -27
  197. package/Presentation/hooks/useCancelSchedulerItem.js.map +1 -1
  198. package/Presentation/hooks/useScheduler.js +62 -46
  199. package/Presentation/hooks/useScheduler.js.map +1 -1
  200. package/Presentation/hooks/useSchedulerItem.js +4 -6
  201. package/Presentation/hooks/useSchedulerItem.js.map +1 -1
  202. package/Presentation/index.js +35 -42
  203. package/Presentation/index.js.map +1 -1
  204. package/UseCases/CancelItem/CancelItemUseCase.js +9 -8
  205. package/UseCases/CancelItem/CancelItemUseCase.js.map +1 -1
  206. package/UseCases/CancelItem/ICancelItemUseCase.js +0 -3
  207. package/UseCases/CancelItem/index.js +0 -2
  208. package/UseCases/GetItem/GetItemUseCase.js +9 -8
  209. package/UseCases/GetItem/GetItemUseCase.js.map +1 -1
  210. package/UseCases/GetItem/IGetItemUseCase.js +0 -3
  211. package/UseCases/GetItem/index.js +0 -2
  212. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js +10 -9
  213. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js.map +1 -1
  214. package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.js +0 -3
  215. package/UseCases/GetScheduledItem/index.js +0 -2
  216. package/UseCases/ListItems/IListItemsUseCase.js +0 -3
  217. package/UseCases/ListItems/ListItemsUseCase.js +9 -8
  218. package/UseCases/ListItems/ListItemsUseCase.js.map +1 -1
  219. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +19 -18
  220. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +1 -1
  221. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +16 -17
  222. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +1 -1
  223. package/UseCases/ListItems/index.js +0 -2
  224. package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +0 -3
  225. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +9 -8
  226. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +1 -1
  227. package/UseCases/ListMoreItems/index.js +0 -2
  228. package/UseCases/PublishItem/IPublishItemUseCase.js +0 -3
  229. package/UseCases/PublishItem/PublishItemUseCase.js +9 -8
  230. package/UseCases/PublishItem/PublishItemUseCase.js.map +1 -1
  231. package/UseCases/PublishItem/index.js +0 -2
  232. package/UseCases/SearchItems/ISearchItemsUseCase.js +0 -3
  233. package/UseCases/SearchItems/SearchItemsUseCase.js +9 -8
  234. package/UseCases/SearchItems/SearchItemsUseCase.js.map +1 -1
  235. package/UseCases/SearchItems/index.js +0 -2
  236. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +0 -3
  237. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +9 -8
  238. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +1 -1
  239. package/UseCases/SelectAllItems/index.js +0 -2
  240. package/UseCases/SelectItems/ISelectItemsUseCase.js +0 -3
  241. package/UseCases/SelectItems/SelectItemsUseCase.js +9 -8
  242. package/UseCases/SelectItems/SelectItemsUseCase.js.map +1 -1
  243. package/UseCases/SelectItems/index.js +0 -2
  244. package/UseCases/SortItems/ISortItemsUseCase.js +0 -3
  245. package/UseCases/SortItems/SortItemsUseCase.js +9 -8
  246. package/UseCases/SortItems/SortItemsUseCase.js.map +1 -1
  247. package/UseCases/SortItems/index.js +0 -2
  248. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +0 -3
  249. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +9 -8
  250. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +1 -1
  251. package/UseCases/UnSelectAllItems/index.js +0 -2
  252. package/UseCases/UnpublishItem/IUnpublishItemUseCase.js +0 -3
  253. package/UseCases/UnpublishItem/UnpublishItemUseCase.js +9 -8
  254. package/UseCases/UnpublishItem/UnpublishItemUseCase.js.map +1 -1
  255. package/UseCases/UnpublishItem/index.js +0 -2
  256. package/UseCases/index.js +0 -2
  257. package/index.js +1 -3
  258. package/package.json +16 -18
  259. package/types.js +12 -11
  260. package/types.js.map +1 -1
  261. package/Domain/Models/SchedulerItem/index.js.map +0 -1
  262. package/Domain/Models/index.js.map +0 -1
  263. package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.js.map +0 -1
  264. package/Domain/Repositories/SchedulerItems/index.js.map +0 -1
  265. package/Domain/Repositories/Search/ISearchRepository.js.map +0 -1
  266. package/Domain/Repositories/Search/index.js.map +0 -1
  267. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js.map +0 -1
  268. package/Domain/Repositories/SelectedItems/index.js.map +0 -1
  269. package/Domain/Repositories/Sorting/index.js.map +0 -1
  270. package/Domain/Repositories/index.js.map +0 -1
  271. package/Domain/index.js.map +0 -1
  272. package/Gateways/abstractions/CancelScheduledActionGateway.js.map +0 -1
  273. package/Gateways/abstractions/GetScheduledActionGateway.js.map +0 -1
  274. package/Gateways/abstractions/ListScheduledActionsGateway.js.map +0 -1
  275. package/Gateways/abstractions/SchedulePublishActionGateway.js.map +0 -1
  276. package/Gateways/abstractions/ScheduleUnpublishActionGateway.js.map +0 -1
  277. package/Gateways/index.js.map +0 -1
  278. package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.js.map +0 -1
  279. package/Presentation/Scheduler/controllers/CancelItem/index.js.map +0 -1
  280. package/Presentation/Scheduler/controllers/GetItem/IGetItemController.js.map +0 -1
  281. package/Presentation/Scheduler/controllers/GetItem/index.js.map +0 -1
  282. package/Presentation/Scheduler/controllers/ListItems/IListItemsController.js.map +0 -1
  283. package/Presentation/Scheduler/controllers/ListItems/index.js.map +0 -1
  284. package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.js.map +0 -1
  285. package/Presentation/Scheduler/controllers/ListMoreItems/index.js.map +0 -1
  286. package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.js.map +0 -1
  287. package/Presentation/Scheduler/controllers/PublishItem/index.js.map +0 -1
  288. package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.js.map +0 -1
  289. package/Presentation/Scheduler/controllers/SearchItems/index.js.map +0 -1
  290. package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.js.map +0 -1
  291. package/Presentation/Scheduler/controllers/SelectAllItems/index.js.map +0 -1
  292. package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.js.map +0 -1
  293. package/Presentation/Scheduler/controllers/SelectItems/index.js.map +0 -1
  294. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js.map +0 -1
  295. package/Presentation/Scheduler/controllers/SortItems/index.js.map +0 -1
  296. package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.js.map +0 -1
  297. package/Presentation/Scheduler/controllers/UnpublishItem/index.js.map +0 -1
  298. package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.js.map +0 -1
  299. package/Presentation/Scheduler/controllers/UnselectAllItems/index.js.map +0 -1
  300. package/Presentation/Scheduler/controllers/index.js.map +0 -1
  301. package/Presentation/Scheduler/index.js.map +0 -1
  302. package/Presentation/SchedulerConfigs/index.js.map +0 -1
  303. package/Presentation/SchedulerRenderer/index.js.map +0 -1
  304. package/Presentation/abstractions/ISchedulerControllers.js.map +0 -1
  305. package/Presentation/abstractions/ISchedulerPresenter.js.map +0 -1
  306. package/Presentation/abstractions/index.js.map +0 -1
  307. package/Presentation/components/Actions/CancelItem/index.js.map +0 -1
  308. package/Presentation/components/Actions/index.js.map +0 -1
  309. package/Presentation/components/BottomInfoBar/index.js.map +0 -1
  310. package/Presentation/components/Cells/CellActions/index.js.map +0 -1
  311. package/Presentation/components/Cells/CellRevision/index.js.map +0 -1
  312. package/Presentation/components/Cells/CellScheduledBy/index.js.map +0 -1
  313. package/Presentation/components/Cells/CellScheduledOn/index.js.map +0 -1
  314. package/Presentation/components/Cells/CellTitle/index.js.map +0 -1
  315. package/Presentation/components/Cells/CellType/index.js.map +0 -1
  316. package/Presentation/components/Cells/index.js.map +0 -1
  317. package/Presentation/components/Empty/index.js.map +0 -1
  318. package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js.map +0 -1
  319. package/Presentation/components/ScheduleDialog/index.js.map +0 -1
  320. package/Presentation/components/ScheduleDialog/types.js.map +0 -1
  321. package/Presentation/components/SchedulerOverlay/index.js.map +0 -1
  322. package/Presentation/components/SearchInput/index.js.map +0 -1
  323. package/Presentation/components/Table/index.js.map +0 -1
  324. package/Presentation/components/Title/index.js.map +0 -1
  325. package/Presentation/configs/index.js.map +0 -1
  326. package/Presentation/configs/list/index.js.map +0 -1
  327. package/Presentation/hooks/index.js.map +0 -1
  328. package/UseCases/CancelItem/ICancelItemUseCase.js.map +0 -1
  329. package/UseCases/CancelItem/index.js.map +0 -1
  330. package/UseCases/GetItem/IGetItemUseCase.js.map +0 -1
  331. package/UseCases/GetItem/index.js.map +0 -1
  332. package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.js.map +0 -1
  333. package/UseCases/GetScheduledItem/index.js.map +0 -1
  334. package/UseCases/ListItems/IListItemsUseCase.js.map +0 -1
  335. package/UseCases/ListItems/index.js.map +0 -1
  336. package/UseCases/ListMoreItems/IListMoreItemsUseCase.js.map +0 -1
  337. package/UseCases/ListMoreItems/index.js.map +0 -1
  338. package/UseCases/PublishItem/IPublishItemUseCase.js.map +0 -1
  339. package/UseCases/PublishItem/index.js.map +0 -1
  340. package/UseCases/SearchItems/ISearchItemsUseCase.js.map +0 -1
  341. package/UseCases/SearchItems/index.js.map +0 -1
  342. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js.map +0 -1
  343. package/UseCases/SelectAllItems/index.js.map +0 -1
  344. package/UseCases/SelectItems/ISelectItemsUseCase.js.map +0 -1
  345. package/UseCases/SelectItems/index.js.map +0 -1
  346. package/UseCases/SortItems/ISortItemsUseCase.js.map +0 -1
  347. package/UseCases/SortItems/index.js.map +0 -1
  348. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js.map +0 -1
  349. package/UseCases/UnSelectAllItems/index.js.map +0 -1
  350. package/UseCases/UnpublishItem/IUnpublishItemUseCase.js.map +0 -1
  351. package/UseCases/UnpublishItem/index.js.map +0 -1
  352. package/UseCases/index.js.map +0 -1
  353. package/index.js.map +0 -1
@@ -1,27 +1,28 @@
1
1
  import { makeAutoObservable } from "mobx";
2
- export class SelectedItemsRepository {
3
- items = [];
4
- selectedAll = false;
5
- constructor() {
6
- makeAutoObservable(this);
7
- }
8
- getSelectedItems() {
9
- return this.items;
10
- }
11
- getSelectedAllItems() {
12
- return this.selectedAll;
13
- }
14
- async selectItems(items) {
15
- this.items = items;
16
- this.selectedAll = false;
17
- }
18
- async selectAllItems() {
19
- this.selectedAll = true;
20
- }
21
- async unselectAllItems() {
22
- this.items = [];
23
- this.selectedAll = false;
24
- }
2
+ class SelectedItemsRepository {
3
+ constructor(){
4
+ this.items = [];
5
+ this.selectedAll = false;
6
+ makeAutoObservable(this);
7
+ }
8
+ getSelectedItems() {
9
+ return this.items;
10
+ }
11
+ getSelectedAllItems() {
12
+ return this.selectedAll;
13
+ }
14
+ async selectItems(items) {
15
+ this.items = items;
16
+ this.selectedAll = false;
17
+ }
18
+ async selectAllItems() {
19
+ this.selectedAll = true;
20
+ }
21
+ async unselectAllItems() {
22
+ this.items = [];
23
+ this.selectedAll = false;
24
+ }
25
25
  }
26
+ export { SelectedItemsRepository };
26
27
 
27
28
  //# sourceMappingURL=SelectedItemsRepository.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["makeAutoObservable","SelectedItemsRepository","items","selectedAll","constructor","getSelectedItems","getSelectedAllItems","selectItems","selectAllItems","unselectAllItems"],"sources":["SelectedItemsRepository.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport type { SchedulerItem } from \"~/Domain/index.js\";\nimport type { ISelectedItemsRepository } from \"./ISelectedItemsRepository.js\";\n\nexport class SelectedItemsRepository implements ISelectedItemsRepository {\n private items: SchedulerItem[] = [];\n private selectedAll = false;\n\n public constructor() {\n makeAutoObservable(this);\n }\n\n public getSelectedItems() {\n return this.items;\n }\n\n public getSelectedAllItems() {\n return this.selectedAll;\n }\n\n public async selectItems(items: SchedulerItem[]) {\n this.items = items;\n this.selectedAll = false;\n }\n\n public async selectAllItems() {\n this.selectedAll = true;\n }\n\n public async unselectAllItems() {\n this.items = [];\n this.selectedAll = false;\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAIzC,OAAO,MAAMC,uBAAuB,CAAqC;EAC7DC,KAAK,GAAoB,EAAE;EAC3BC,WAAW,GAAG,KAAK;EAEpBC,WAAWA,CAAA,EAAG;IACjBJ,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEOK,gBAAgBA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACH,KAAK;EACrB;EAEOI,mBAAmBA,CAAA,EAAG;IACzB,OAAO,IAAI,CAACH,WAAW;EAC3B;EAEA,MAAaI,WAAWA,CAACL,KAAsB,EAAE;IAC7C,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,WAAW,GAAG,KAAK;EAC5B;EAEA,MAAaK,cAAcA,CAAA,EAAG;IAC1B,IAAI,CAACL,WAAW,GAAG,IAAI;EAC3B;EAEA,MAAaM,gBAAgBA,CAAA,EAAG;IAC5B,IAAI,CAACP,KAAK,GAAG,EAAE;IACf,IAAI,CAACC,WAAW,GAAG,KAAK;EAC5B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"Domain/Repositories/SelectedItems/SelectedItemsRepository.js","sources":["../../../../src/Domain/Repositories/SelectedItems/SelectedItemsRepository.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport type { SchedulerItem } from \"~/Domain/index.js\";\nimport type { ISelectedItemsRepository } from \"./ISelectedItemsRepository.js\";\n\nexport class SelectedItemsRepository implements ISelectedItemsRepository {\n private items: SchedulerItem[] = [];\n private selectedAll = false;\n\n public constructor() {\n makeAutoObservable(this);\n }\n\n public getSelectedItems() {\n return this.items;\n }\n\n public getSelectedAllItems() {\n return this.selectedAll;\n }\n\n public async selectItems(items: SchedulerItem[]) {\n this.items = items;\n this.selectedAll = false;\n }\n\n public async selectAllItems() {\n this.selectedAll = true;\n }\n\n public async unselectAllItems() {\n this.items = [];\n this.selectedAll = false;\n }\n}\n"],"names":["SelectedItemsRepository","makeAutoObservable","items"],"mappings":";AAIO,MAAMA;IAIT,aAAqB;aAHb,KAAK,GAAoB,EAAE;aAC3B,WAAW,GAAG;QAGlBC,mBAAmB,IAAI;IAC3B;IAEO,mBAAmB;QACtB,OAAO,IAAI,CAAC,KAAK;IACrB;IAEO,sBAAsB;QACzB,OAAO,IAAI,CAAC,WAAW;IAC3B;IAEA,MAAa,YAAYC,KAAsB,EAAE;QAC7C,IAAI,CAAC,KAAK,GAAGA;QACb,IAAI,CAAC,WAAW,GAAG;IACvB;IAEA,MAAa,iBAAiB;QAC1B,IAAI,CAAC,WAAW,GAAG;IACvB;IAEA,MAAa,mBAAmB;QAC5B,IAAI,CAAC,KAAK,GAAG,EAAE;QACf,IAAI,CAAC,WAAW,GAAG;IACvB;AACJ"}
@@ -1,17 +1,18 @@
1
1
  import { SelectedItemsRepository } from "./SelectedItemsRepository.js";
2
- export class SelectedItemsRepositoryFactory {
3
- cache = new Map();
4
- getRepository() {
5
- const cacheKey = this.getCacheKey();
6
- if (!this.cache.has(cacheKey)) {
7
- this.cache.set(cacheKey, new SelectedItemsRepository());
2
+ class SelectedItemsRepositoryFactory {
3
+ getRepository() {
4
+ const cacheKey = this.getCacheKey();
5
+ if (!this.cache.has(cacheKey)) this.cache.set(cacheKey, new SelectedItemsRepository());
6
+ return this.cache.get(cacheKey);
7
+ }
8
+ getCacheKey() {
9
+ return Date.now().toString();
10
+ }
11
+ constructor(){
12
+ this.cache = new Map();
8
13
  }
9
- return this.cache.get(cacheKey);
10
- }
11
- getCacheKey() {
12
- return Date.now().toString();
13
- }
14
14
  }
15
- export const selectedItemsRepositoryFactory = new SelectedItemsRepositoryFactory();
15
+ const selectedItemsRepositoryFactory = new SelectedItemsRepositoryFactory();
16
+ export { SelectedItemsRepositoryFactory, selectedItemsRepositoryFactory };
16
17
 
17
18
  //# sourceMappingURL=SelectedItemsRepositoryFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SelectedItemsRepository","SelectedItemsRepositoryFactory","cache","Map","getRepository","cacheKey","getCacheKey","has","set","get","Date","now","toString","selectedItemsRepositoryFactory"],"sources":["SelectedItemsRepositoryFactory.ts"],"sourcesContent":["import { SelectedItemsRepository } from \"./SelectedItemsRepository.js\";\n\nexport class SelectedItemsRepositoryFactory {\n private readonly cache: Map<string, SelectedItemsRepository> = new Map();\n\n public getRepository() {\n const cacheKey = this.getCacheKey();\n\n if (!this.cache.has(cacheKey)) {\n this.cache.set(cacheKey, new SelectedItemsRepository());\n }\n\n return this.cache.get(cacheKey) as SelectedItemsRepository;\n }\n\n private getCacheKey() {\n return Date.now().toString();\n }\n}\n\nexport const selectedItemsRepositoryFactory = new SelectedItemsRepositoryFactory();\n"],"mappings":"AAAA,SAASA,uBAAuB;AAEhC,OAAO,MAAMC,8BAA8B,CAAC;EACvBC,KAAK,GAAyC,IAAIC,GAAG,CAAC,CAAC;EAEjEC,aAAaA,CAAA,EAAG;IACnB,MAAMC,QAAQ,GAAG,IAAI,CAACC,WAAW,CAAC,CAAC;IAEnC,IAAI,CAAC,IAAI,CAACJ,KAAK,CAACK,GAAG,CAACF,QAAQ,CAAC,EAAE;MAC3B,IAAI,CAACH,KAAK,CAACM,GAAG,CAACH,QAAQ,EAAE,IAAIL,uBAAuB,CAAC,CAAC,CAAC;IAC3D;IAEA,OAAO,IAAI,CAACE,KAAK,CAACO,GAAG,CAACJ,QAAQ,CAAC;EACnC;EAEQC,WAAWA,CAAA,EAAG;IAClB,OAAOI,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAChC;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAG,IAAIZ,8BAA8B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js","sources":["../../../../src/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.ts"],"sourcesContent":["import { SelectedItemsRepository } from \"./SelectedItemsRepository.js\";\n\nexport class SelectedItemsRepositoryFactory {\n private readonly cache: Map<string, SelectedItemsRepository> = new Map();\n\n public getRepository() {\n const cacheKey = this.getCacheKey();\n\n if (!this.cache.has(cacheKey)) {\n this.cache.set(cacheKey, new SelectedItemsRepository());\n }\n\n return this.cache.get(cacheKey) as SelectedItemsRepository;\n }\n\n private getCacheKey() {\n return Date.now().toString();\n }\n}\n\nexport const selectedItemsRepositoryFactory = new SelectedItemsRepositoryFactory();\n"],"names":["SelectedItemsRepositoryFactory","cacheKey","SelectedItemsRepository","Date","Map","selectedItemsRepositoryFactory"],"mappings":";AAEO,MAAMA;IAGF,gBAAgB;QACnB,MAAMC,WAAW,IAAI,CAAC,WAAW;QAEjC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,WAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,UAAU,IAAIC;QAGjC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACD;IAC1B;IAEQ,cAAc;QAClB,OAAOE,KAAK,GAAG,GAAG,QAAQ;IAC9B;;aAdiB,KAAK,GAAyC,IAAIC;;AAevE;AAEO,MAAMC,iCAAiC,IAAIL"}
@@ -1,4 +1,2 @@
1
1
  export * from "./SelectedItemsRepository.js";
2
2
  export * from "./SelectedItemsRepositoryFactory.js";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,22 +1,21 @@
1
1
  import { makeAutoObservable, runInAction } from "mobx";
2
- export class SortingRepositoryWithDefaults {
3
- constructor(defaults, repository) {
4
- this.defaults = defaults;
5
- this.repository = repository;
6
- makeAutoObservable(this);
7
- }
8
- get() {
9
- const existingSort = this.repository.get();
10
- if (existingSort.length === 0) {
11
- runInAction(() => {
12
- this.set(this.defaults);
13
- });
2
+ class SortingRepositoryWithDefaults {
3
+ constructor(defaults, repository){
4
+ this.defaults = defaults;
5
+ this.repository = repository;
6
+ makeAutoObservable(this);
7
+ }
8
+ get() {
9
+ const existingSort = this.repository.get();
10
+ if (0 === existingSort.length) runInAction(()=>{
11
+ this.set(this.defaults);
12
+ });
13
+ return this.repository.get();
14
+ }
15
+ set(sorts) {
16
+ return this.repository.set(sorts);
14
17
  }
15
- return this.repository.get();
16
- }
17
- set(sorts) {
18
- return this.repository.set(sorts);
19
- }
20
18
  }
19
+ export { SortingRepositoryWithDefaults };
21
20
 
22
21
  //# sourceMappingURL=SortingRepositoryWithDefaults.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["makeAutoObservable","runInAction","SortingRepositoryWithDefaults","constructor","defaults","repository","get","existingSort","length","set","sorts"],"sources":["SortingRepositoryWithDefaults.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport type { ISortingRepository, Sorting } from \"@webiny/app-utils\";\n\nexport class SortingRepositoryWithDefaults implements ISortingRepository {\n private readonly defaults: Sorting[];\n private readonly repository: ISortingRepository;\n\n public constructor(defaults: Sorting[], repository: ISortingRepository) {\n this.defaults = defaults;\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n public get() {\n const existingSort = this.repository.get();\n\n if (existingSort.length === 0) {\n runInAction(() => {\n this.set(this.defaults);\n });\n }\n\n return this.repository.get();\n }\n\n public set(sorts: Sorting[]) {\n return this.repository.set(sorts);\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AAGtD,OAAO,MAAMC,6BAA6B,CAA+B;EAI9DC,WAAWA,CAACC,QAAmB,EAAEC,UAA8B,EAAE;IACpE,IAAI,CAACD,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5BL,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEOM,GAAGA,CAAA,EAAG;IACT,MAAMC,YAAY,GAAG,IAAI,CAACF,UAAU,CAACC,GAAG,CAAC,CAAC;IAE1C,IAAIC,YAAY,CAACC,MAAM,KAAK,CAAC,EAAE;MAC3BP,WAAW,CAAC,MAAM;QACd,IAAI,CAACQ,GAAG,CAAC,IAAI,CAACL,QAAQ,CAAC;MAC3B,CAAC,CAAC;IACN;IAEA,OAAO,IAAI,CAACC,UAAU,CAACC,GAAG,CAAC,CAAC;EAChC;EAEOG,GAAGA,CAACC,KAAgB,EAAE;IACzB,OAAO,IAAI,CAACL,UAAU,CAACI,GAAG,CAACC,KAAK,CAAC;EACrC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js","sources":["../../../../src/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport type { ISortingRepository, Sorting } from \"@webiny/app-utils\";\n\nexport class SortingRepositoryWithDefaults implements ISortingRepository {\n private readonly defaults: Sorting[];\n private readonly repository: ISortingRepository;\n\n public constructor(defaults: Sorting[], repository: ISortingRepository) {\n this.defaults = defaults;\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n public get() {\n const existingSort = this.repository.get();\n\n if (existingSort.length === 0) {\n runInAction(() => {\n this.set(this.defaults);\n });\n }\n\n return this.repository.get();\n }\n\n public set(sorts: Sorting[]) {\n return this.repository.set(sorts);\n }\n}\n"],"names":["SortingRepositoryWithDefaults","defaults","repository","makeAutoObservable","existingSort","runInAction","sorts"],"mappings":";AAGO,MAAMA;IAIT,YAAmBC,QAAmB,EAAEC,UAA8B,CAAE;QACpE,IAAI,CAAC,QAAQ,GAAGD;QAChB,IAAI,CAAC,UAAU,GAAGC;QAClBC,mBAAmB,IAAI;IAC3B;IAEO,MAAM;QACT,MAAMC,eAAe,IAAI,CAAC,UAAU,CAAC,GAAG;QAExC,IAAIA,AAAwB,MAAxBA,aAAa,MAAM,EACnBC,YAAY;YACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ;QAC1B;QAGJ,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG;IAC9B;IAEO,IAAIC,KAAgB,EAAE;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAACA;IAC/B;AACJ"}
@@ -1,3 +1 @@
1
1
  export * from "./SortingRepositoryWithDefaults.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -2,5 +2,3 @@ export * from "./SelectedItems/index.js";
2
2
  export * from "./Sorting/index.js";
3
3
  export * from "./Search/index.js";
4
4
  export * from "./SchedulerItems/index.js";
5
-
6
- //# sourceMappingURL=index.js.map
package/Domain/index.js CHANGED
@@ -1,4 +1,2 @@
1
1
  export * from "./Models/index.js";
2
2
  export * from "./Repositories/index.js";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,5 @@
1
- import gql from "graphql-tag";
2
- const createScheduleCancelActionMutation = () => {
3
- return gql`
1
+ import graphql_tag from "graphql-tag";
2
+ const createScheduleCancelActionMutation = ()=>graphql_tag`
4
3
  mutation ScheduleCancelAction($namespace: String!, $id: ID!) {
5
4
  scheduler {
6
5
  cancelScheduledAction(namespace: $namespace, id: $id) {
@@ -15,34 +14,29 @@ const createScheduleCancelActionMutation = () => {
15
14
  }
16
15
  }
17
16
  `;
18
- };
19
- export class SchedulerCancelGraphQLGateway {
20
- constructor(client) {
21
- this.client = client;
22
- }
23
- async execute(params) {
24
- const {
25
- data: response,
26
- errors
27
- } = await this.client.mutate({
28
- mutation: createScheduleCancelActionMutation(),
29
- variables: {
30
- namespace: params.namespace,
31
- id: params.id
32
- },
33
- fetchPolicy: "no-cache"
34
- });
35
- const result = response?.scheduler?.cancelScheduledAction;
36
- if (!result || errors?.length) {
37
- console.error({
38
- errors
39
- });
40
- throw new Error("Network error while canceling a scheduled action.");
17
+ class SchedulerCancelGraphQLGateway {
18
+ constructor(client){
19
+ this.client = client;
41
20
  }
42
- if (!result.data) {
43
- throw new Error(result.error?.message || "Could not cancel scheduled action.");
21
+ async execute(params) {
22
+ const { data: response, errors } = await this.client.mutate({
23
+ mutation: createScheduleCancelActionMutation(),
24
+ variables: {
25
+ namespace: params.namespace,
26
+ id: params.id
27
+ },
28
+ fetchPolicy: "no-cache"
29
+ });
30
+ const result = response?.scheduler?.cancelScheduledAction;
31
+ if (!result || errors?.length) {
32
+ console.error({
33
+ errors
34
+ });
35
+ throw new Error("Network error while canceling a scheduled action.");
36
+ }
37
+ if (!result.data) throw new Error(result.error?.message || "Could not cancel scheduled action.");
44
38
  }
45
- }
46
39
  }
40
+ export { SchedulerCancelGraphQLGateway };
47
41
 
48
42
  //# sourceMappingURL=SchedulerCancelGraphQLGateway.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["gql","createScheduleCancelActionMutation","SchedulerCancelGraphQLGateway","constructor","client","execute","params","data","response","errors","mutate","mutation","variables","namespace","id","fetchPolicy","result","scheduler","cancelScheduledAction","length","console","error","Error","message"],"sources":["SchedulerCancelGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport type { SchedulerErrorResponse } from \"~/types.js\";\nimport type {\n ICancelScheduledActionGateway,\n ICancelScheduledActionGatewayParams\n} from \"./abstractions/CancelScheduledActionGateway.js\";\n\nconst createScheduleCancelActionMutation = () => {\n return gql`\n mutation ScheduleCancelAction($namespace: String!, $id: ID!) {\n scheduler {\n cancelScheduledAction(namespace: $namespace, id: $id) {\n data\n error {\n message\n code\n data\n stack\n }\n }\n }\n }\n `;\n};\n\ninterface SchedulerCancelGraphQLMutationVariables {\n namespace: string;\n id: string;\n}\n\ninterface SchedulerCancelGraphQLMutationResponse {\n scheduler: {\n cancelScheduledAction: {\n data: boolean | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nexport class SchedulerCancelGraphQLGateway implements ICancelScheduledActionGateway {\n private readonly client: ApolloClient<object>;\n\n public constructor(client: ApolloClient<object>) {\n this.client = client;\n }\n\n public async execute(params: ICancelScheduledActionGatewayParams) {\n const { data: response, errors } = await this.client.mutate<\n SchedulerCancelGraphQLMutationResponse,\n SchedulerCancelGraphQLMutationVariables\n >({\n mutation: createScheduleCancelActionMutation(),\n variables: {\n namespace: params.namespace,\n id: params.id\n },\n fetchPolicy: \"no-cache\"\n });\n\n const result = response?.scheduler?.cancelScheduledAction;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while canceling a scheduled action.\");\n }\n\n if (!result.data) {\n throw new Error(result.error?.message || \"Could not cancel scheduled action.\");\n }\n }\n}\n"],"mappings":"AACA,OAAOA,GAAG,MAAM,aAAa;AAO7B,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;EAC7C,OAAOD,GAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AAgBD,OAAO,MAAME,6BAA6B,CAA0C;EAGzEC,WAAWA,CAACC,MAA4B,EAAE;IAC7C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,OAAOA,CAACC,MAA2C,EAAE;IAC9D,MAAM;MAAEC,IAAI,EAAEC,QAAQ;MAAEC;IAAO,CAAC,GAAG,MAAM,IAAI,CAACL,MAAM,CAACM,MAAM,CAGzD;MACEC,QAAQ,EAAEV,kCAAkC,CAAC,CAAC;MAC9CW,SAAS,EAAE;QACPC,SAAS,EAAEP,MAAM,CAACO,SAAS;QAC3BC,EAAE,EAAER,MAAM,CAACQ;MACf,CAAC;MACDC,WAAW,EAAE;IACjB,CAAC,CAAC;IAEF,MAAMC,MAAM,GAAGR,QAAQ,EAAES,SAAS,EAAEC,qBAAqB;IACzD,IAAI,CAACF,MAAM,IAAIP,MAAM,EAAEU,MAAM,EAAE;MAC3BC,OAAO,CAACC,KAAK,CAAC;QACVZ;MACJ,CAAC,CAAC;MACF,MAAM,IAAIa,KAAK,CAAC,mDAAmD,CAAC;IACxE;IAEA,IAAI,CAACN,MAAM,CAACT,IAAI,EAAE;MACd,MAAM,IAAIe,KAAK,CAACN,MAAM,CAACK,KAAK,EAAEE,OAAO,IAAI,oCAAoC,CAAC;IAClF;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"Gateways/SchedulerCancelGraphQLGateway.js","sources":["../../src/Gateways/SchedulerCancelGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport type { SchedulerErrorResponse } from \"~/types.js\";\nimport type {\n ICancelScheduledActionGateway,\n ICancelScheduledActionGatewayParams\n} from \"./abstractions/CancelScheduledActionGateway.js\";\n\nconst createScheduleCancelActionMutation = () => {\n return gql`\n mutation ScheduleCancelAction($namespace: String!, $id: ID!) {\n scheduler {\n cancelScheduledAction(namespace: $namespace, id: $id) {\n data\n error {\n message\n code\n data\n stack\n }\n }\n }\n }\n `;\n};\n\ninterface SchedulerCancelGraphQLMutationVariables {\n namespace: string;\n id: string;\n}\n\ninterface SchedulerCancelGraphQLMutationResponse {\n scheduler: {\n cancelScheduledAction: {\n data: boolean | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nexport class SchedulerCancelGraphQLGateway implements ICancelScheduledActionGateway {\n private readonly client: ApolloClient<object>;\n\n public constructor(client: ApolloClient<object>) {\n this.client = client;\n }\n\n public async execute(params: ICancelScheduledActionGatewayParams) {\n const { data: response, errors } = await this.client.mutate<\n SchedulerCancelGraphQLMutationResponse,\n SchedulerCancelGraphQLMutationVariables\n >({\n mutation: createScheduleCancelActionMutation(),\n variables: {\n namespace: params.namespace,\n id: params.id\n },\n fetchPolicy: \"no-cache\"\n });\n\n const result = response?.scheduler?.cancelScheduledAction;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while canceling a scheduled action.\");\n }\n\n if (!result.data) {\n throw new Error(result.error?.message || \"Could not cancel scheduled action.\");\n }\n }\n}\n"],"names":["createScheduleCancelActionMutation","gql","SchedulerCancelGraphQLGateway","client","params","response","errors","result","console","Error"],"mappings":";AAQA,MAAMA,qCAAqC,IAChCC,WAAG,CAAC;;;;;;;;;;;;;;IAcX,CAAC;AAiBE,MAAMC;IAGT,YAAmBC,MAA4B,CAAE;QAC7C,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,MAAa,QAAQC,MAA2C,EAAE;QAC9D,MAAM,EAAE,MAAMC,QAAQ,EAAEC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAGzD;YACE,UAAUN;YACV,WAAW;gBACP,WAAWI,OAAO,SAAS;gBAC3B,IAAIA,OAAO,EAAE;YACjB;YACA,aAAa;QACjB;QAEA,MAAMG,SAASF,UAAU,WAAW;QACpC,IAAI,CAACE,UAAUD,QAAQ,QAAQ;YAC3BE,QAAQ,KAAK,CAAC;gBACVF;YACJ;YACA,MAAM,IAAIG,MAAM;QACpB;QAEA,IAAI,CAACF,OAAO,IAAI,EACZ,MAAM,IAAIE,MAAMF,OAAO,KAAK,EAAE,WAAW;IAEjD;AACJ"}
@@ -1,10 +1,9 @@
1
- import gql from "graphql-tag";
1
+ import graphql_tag from "graphql-tag";
2
2
  import zod from "zod";
3
3
  import { createZodError } from "@webiny/utils/createZodError.js";
4
4
  import { schedulerEntrySchema } from "./schema/schedulerEntry.js";
5
5
  import { createSchedulerEntryFields } from "./graphql/fields.js";
6
- export const createGetScheduledActionQuery = () => {
7
- return gql`
6
+ const createGetScheduledActionQuery = ()=>graphql_tag`
8
7
  query GetTargetScheduledActionQuery($namespace: String!, $id: ID!) {
9
8
  scheduler {
10
9
  getTargetScheduledAction(namespace: $namespace, id: $id) {
@@ -21,52 +20,49 @@ export const createGetScheduledActionQuery = () => {
21
20
  }
22
21
  }
23
22
  `;
24
- };
25
23
  const schema = zod.object({
26
- data: schedulerEntrySchema
24
+ data: schedulerEntrySchema
27
25
  });
28
- export class SchedulerGetGraphQLGateway {
29
- constructor(client) {
30
- this.client = client;
31
- }
32
- async execute(params) {
33
- const {
34
- data: response,
35
- errors
36
- } = await this.client.query({
37
- query: createGetScheduledActionQuery(),
38
- variables: {
39
- namespace: params.namespace,
40
- id: params.id
41
- },
42
- fetchPolicy: "network-only"
43
- });
44
- const result = response?.scheduler?.getTargetScheduledAction;
45
- if (!result || errors?.length) {
46
- console.error({
47
- errors
48
- });
49
- throw new Error("Network error while getting scheduled action.");
50
- } else if (result.error) {
51
- console.error({
52
- error: result.error
53
- });
54
- throw new Error(result.error.message || "Could not fetch scheduled action.");
55
- } else if (!result.data) {
56
- return null;
26
+ class SchedulerGetGraphQLGateway {
27
+ constructor(client){
28
+ this.client = client;
57
29
  }
58
- const validated = await schema.safeParseAsync(result);
59
- if (!validated.success) {
60
- const err = createZodError(validated.error);
61
- console.error(err);
62
- console.log(JSON.stringify({
63
- err,
64
- ex: validated.error
65
- }));
66
- throw err;
30
+ async execute(params) {
31
+ const { data: response, errors } = await this.client.query({
32
+ query: createGetScheduledActionQuery(),
33
+ variables: {
34
+ namespace: params.namespace,
35
+ id: params.id
36
+ },
37
+ fetchPolicy: "network-only"
38
+ });
39
+ const result = response?.scheduler?.getTargetScheduledAction;
40
+ if (!result || errors?.length) {
41
+ console.error({
42
+ errors
43
+ });
44
+ throw new Error("Network error while getting scheduled action.");
45
+ }
46
+ if (result.error) {
47
+ console.error({
48
+ error: result.error
49
+ });
50
+ throw new Error(result.error.message || "Could not fetch scheduled action.");
51
+ }
52
+ if (!result.data) return null;
53
+ const validated = await schema.safeParseAsync(result);
54
+ if (!validated.success) {
55
+ const err = createZodError(validated.error);
56
+ console.error(err);
57
+ console.log(JSON.stringify({
58
+ err,
59
+ ex: validated.error
60
+ }));
61
+ throw err;
62
+ }
63
+ return validated.data.data;
67
64
  }
68
- return validated.data.data;
69
- }
70
65
  }
66
+ export { SchedulerGetGraphQLGateway, createGetScheduledActionQuery };
71
67
 
72
68
  //# sourceMappingURL=SchedulerGetGraphQLGateway.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["gql","zod","createZodError","schedulerEntrySchema","createSchedulerEntryFields","createGetScheduledActionQuery","schema","object","data","SchedulerGetGraphQLGateway","constructor","client","execute","params","response","errors","query","variables","namespace","id","fetchPolicy","result","scheduler","getTargetScheduledAction","length","console","error","Error","message","validated","safeParseAsync","success","err","log","JSON","stringify","ex"],"sources":["SchedulerGetGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils/createZodError.js\";\nimport { schedulerEntrySchema } from \"./schema/schedulerEntry.js\";\nimport { createSchedulerEntryFields } from \"./graphql/fields.js\";\nimport type {\n IGetScheduledActionGateway,\n IGetScheduledActionGatewayExecuteParams\n} from \"./abstractions/GetScheduledActionGateway.js\";\nimport type { SchedulerEntry, SchedulerErrorResponse } from \"~/types.js\";\n\nexport const createGetScheduledActionQuery = () => {\n return gql`\n query GetTargetScheduledActionQuery($namespace: String!, $id: ID!) {\n scheduler {\n getTargetScheduledAction(namespace: $namespace, id: $id) {\n data {\n ${createSchedulerEntryFields()}\n }\n error {\n message\n code\n data\n stack\n }\n }\n }\n }\n `;\n};\n\ninterface SchedulerGetGraphQLQueryResponse {\n scheduler: {\n getTargetScheduledAction: {\n data: SchedulerEntry | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nconst schema = zod.object({\n data: schedulerEntrySchema\n});\n\nexport class SchedulerGetGraphQLGateway implements IGetScheduledActionGateway {\n private readonly client: ApolloClient<any>;\n\n public constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n public async execute(params: IGetScheduledActionGatewayExecuteParams) {\n const { data: response, errors } = await this.client.query<\n SchedulerGetGraphQLQueryResponse,\n IGetScheduledActionGatewayExecuteParams\n >({\n query: createGetScheduledActionQuery(),\n variables: {\n namespace: params.namespace,\n id: params.id\n },\n fetchPolicy: \"network-only\"\n });\n\n const result = response?.scheduler?.getTargetScheduledAction;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while getting scheduled action.\");\n } else if (result.error) {\n console.error({\n error: result.error\n });\n throw new Error(result.error.message || \"Could not fetch scheduled action.\");\n } else if (!result.data) {\n return null;\n }\n\n const validated = await schema.safeParseAsync(result);\n if (!validated.success) {\n const err = createZodError(validated.error);\n console.error(err);\n console.log(\n JSON.stringify({\n err,\n ex: validated.error\n })\n );\n throw err;\n }\n\n return validated.data.data;\n }\n}\n"],"mappings":"AACA,OAAOA,GAAG,MAAM,aAAa;AAC7B,OAAOC,GAAG,MAAM,KAAK;AACrB,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,oBAAoB;AAC7B,SAASC,0BAA0B;AAOnC,OAAO,MAAMC,6BAA6B,GAAGA,CAAA,KAAM;EAC/C,OAAOL,GAAG;AACd;AACA;AACA;AACA;AACA,0BAA0BI,0BAA0B,CAAC,CAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AAWD,MAAME,MAAM,GAAGL,GAAG,CAACM,MAAM,CAAC;EACtBC,IAAI,EAAEL;AACV,CAAC,CAAC;AAEF,OAAO,MAAMM,0BAA0B,CAAuC;EAGnEC,WAAWA,CAACC,MAAyB,EAAE;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,OAAOA,CAACC,MAA+C,EAAE;IAClE,MAAM;MAAEL,IAAI,EAAEM,QAAQ;MAAEC;IAAO,CAAC,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,KAAK,CAGxD;MACEA,KAAK,EAAEX,6BAA6B,CAAC,CAAC;MACtCY,SAAS,EAAE;QACPC,SAAS,EAAEL,MAAM,CAACK,SAAS;QAC3BC,EAAE,EAAEN,MAAM,CAACM;MACf,CAAC;MACDC,WAAW,EAAE;IACjB,CAAC,CAAC;IAEF,MAAMC,MAAM,GAAGP,QAAQ,EAAEQ,SAAS,EAAEC,wBAAwB;IAC5D,IAAI,CAACF,MAAM,IAAIN,MAAM,EAAES,MAAM,EAAE;MAC3BC,OAAO,CAACC,KAAK,CAAC;QACVX;MACJ,CAAC,CAAC;MACF,MAAM,IAAIY,KAAK,CAAC,+CAA+C,CAAC;IACpE,CAAC,MAAM,IAAIN,MAAM,CAACK,KAAK,EAAE;MACrBD,OAAO,CAACC,KAAK,CAAC;QACVA,KAAK,EAAEL,MAAM,CAACK;MAClB,CAAC,CAAC;MACF,MAAM,IAAIC,KAAK,CAACN,MAAM,CAACK,KAAK,CAACE,OAAO,IAAI,mCAAmC,CAAC;IAChF,CAAC,MAAM,IAAI,CAACP,MAAM,CAACb,IAAI,EAAE;MACrB,OAAO,IAAI;IACf;IAEA,MAAMqB,SAAS,GAAG,MAAMvB,MAAM,CAACwB,cAAc,CAACT,MAAM,CAAC;IACrD,IAAI,CAACQ,SAAS,CAACE,OAAO,EAAE;MACpB,MAAMC,GAAG,GAAG9B,cAAc,CAAC2B,SAAS,CAACH,KAAK,CAAC;MAC3CD,OAAO,CAACC,KAAK,CAACM,GAAG,CAAC;MAClBP,OAAO,CAACQ,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXH,GAAG;QACHI,EAAE,EAAEP,SAAS,CAACH;MAClB,CAAC,CACL,CAAC;MACD,MAAMM,GAAG;IACb;IAEA,OAAOH,SAAS,CAACrB,IAAI,CAACA,IAAI;EAC9B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"Gateways/SchedulerGetGraphQLGateway.js","sources":["../../src/Gateways/SchedulerGetGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils/createZodError.js\";\nimport { schedulerEntrySchema } from \"./schema/schedulerEntry.js\";\nimport { createSchedulerEntryFields } from \"./graphql/fields.js\";\nimport type {\n IGetScheduledActionGateway,\n IGetScheduledActionGatewayExecuteParams\n} from \"./abstractions/GetScheduledActionGateway.js\";\nimport type { SchedulerEntry, SchedulerErrorResponse } from \"~/types.js\";\n\nexport const createGetScheduledActionQuery = () => {\n return gql`\n query GetTargetScheduledActionQuery($namespace: String!, $id: ID!) {\n scheduler {\n getTargetScheduledAction(namespace: $namespace, id: $id) {\n data {\n ${createSchedulerEntryFields()}\n }\n error {\n message\n code\n data\n stack\n }\n }\n }\n }\n `;\n};\n\ninterface SchedulerGetGraphQLQueryResponse {\n scheduler: {\n getTargetScheduledAction: {\n data: SchedulerEntry | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nconst schema = zod.object({\n data: schedulerEntrySchema\n});\n\nexport class SchedulerGetGraphQLGateway implements IGetScheduledActionGateway {\n private readonly client: ApolloClient<any>;\n\n public constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n public async execute(params: IGetScheduledActionGatewayExecuteParams) {\n const { data: response, errors } = await this.client.query<\n SchedulerGetGraphQLQueryResponse,\n IGetScheduledActionGatewayExecuteParams\n >({\n query: createGetScheduledActionQuery(),\n variables: {\n namespace: params.namespace,\n id: params.id\n },\n fetchPolicy: \"network-only\"\n });\n\n const result = response?.scheduler?.getTargetScheduledAction;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while getting scheduled action.\");\n } else if (result.error) {\n console.error({\n error: result.error\n });\n throw new Error(result.error.message || \"Could not fetch scheduled action.\");\n } else if (!result.data) {\n return null;\n }\n\n const validated = await schema.safeParseAsync(result);\n if (!validated.success) {\n const err = createZodError(validated.error);\n console.error(err);\n console.log(\n JSON.stringify({\n err,\n ex: validated.error\n })\n );\n throw err;\n }\n\n return validated.data.data;\n }\n}\n"],"names":["createGetScheduledActionQuery","gql","createSchedulerEntryFields","schema","zod","schedulerEntrySchema","SchedulerGetGraphQLGateway","client","params","response","errors","result","console","Error","validated","err","createZodError","JSON"],"mappings":";;;;;AAYO,MAAMA,gCAAgC,IAClCC,WAAG,CAAC;;;;;wBAKS,EAAEC,6BAA6B;;;;;;;;;;;IAWnD,CAAC;AAYL,MAAMC,SAASC,IAAI,MAAM,CAAC;IACtB,MAAMC;AACV;AAEO,MAAMC;IAGT,YAAmBC,MAAyB,CAAE;QAC1C,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,MAAa,QAAQC,MAA+C,EAAE;QAClE,MAAM,EAAE,MAAMC,QAAQ,EAAEC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAGxD;YACE,OAAOV;YACP,WAAW;gBACP,WAAWQ,OAAO,SAAS;gBAC3B,IAAIA,OAAO,EAAE;YACjB;YACA,aAAa;QACjB;QAEA,MAAMG,SAASF,UAAU,WAAW;QACpC,IAAI,CAACE,UAAUD,QAAQ,QAAQ;YAC3BE,QAAQ,KAAK,CAAC;gBACVF;YACJ;YACA,MAAM,IAAIG,MAAM;QACpB;QAAO,IAAIF,OAAO,KAAK,EAAE;YACrBC,QAAQ,KAAK,CAAC;gBACV,OAAOD,OAAO,KAAK;YACvB;YACA,MAAM,IAAIE,MAAMF,OAAO,KAAK,CAAC,OAAO,IAAI;QAC5C;QAAO,IAAI,CAACA,OAAO,IAAI,EACnB,OAAO;QAGX,MAAMG,YAAY,MAAMX,OAAO,cAAc,CAACQ;QAC9C,IAAI,CAACG,UAAU,OAAO,EAAE;YACpB,MAAMC,MAAMC,eAAeF,UAAU,KAAK;YAC1CF,QAAQ,KAAK,CAACG;YACdH,QAAQ,GAAG,CACPK,KAAK,SAAS,CAAC;gBACXF;gBACA,IAAID,UAAU,KAAK;YACvB;YAEJ,MAAMC;QACV;QAEA,OAAOD,UAAU,IAAI,CAAC,IAAI;IAC9B;AACJ"}
@@ -1,10 +1,9 @@
1
- import gql from "graphql-tag";
1
+ import graphql_tag from "graphql-tag";
2
2
  import zod from "zod";
3
3
  import { createZodError } from "@webiny/utils/createZodError.js";
4
4
  import { schedulerEntrySchema } from "./schema/schedulerEntry.js";
5
5
  import { createSchedulerEntryFields } from "./graphql/fields.js";
6
- const createListScheduledActionsQuery = () => {
7
- return gql`
6
+ const createListScheduledActionsQuery = ()=>graphql_tag`
8
7
  query ListScheduledActions(
9
8
  $namespace: String!
10
9
  $where: ListScheduledActionsWhereInput
@@ -38,55 +37,50 @@ const createListScheduledActionsQuery = () => {
38
37
  }
39
38
  }
40
39
  `;
41
- };
42
40
  const schema = zod.object({
43
- data: zod.array(schedulerEntrySchema),
44
- meta: zod.object({
45
- totalCount: zod.number(),
46
- cursor: zod.string().nullable(),
47
- hasMoreItems: zod.boolean()
48
- })
41
+ data: zod.array(schedulerEntrySchema),
42
+ meta: zod.object({
43
+ totalCount: zod.number(),
44
+ cursor: zod.string().nullable(),
45
+ hasMoreItems: zod.boolean()
46
+ })
49
47
  });
50
- export class SchedulerListGraphQLGateway {
51
- constructor(client) {
52
- this.client = client;
53
- }
54
- async execute(params) {
55
- const {
56
- data: response,
57
- errors
58
- } = await this.client.query({
59
- query: createListScheduledActionsQuery(),
60
- variables: {
61
- namespace: params.namespace,
62
- where: params.where,
63
- limit: params.limit,
64
- after: params.after,
65
- sort: params.sort
66
- },
67
- fetchPolicy: "network-only"
68
- });
69
- const result = response?.scheduler?.listScheduledActions;
70
- if (!result || errors?.length) {
71
- console.error({
72
- errors
73
- });
74
- throw new Error("Network error while listing scheduled actions.");
48
+ class SchedulerListGraphQLGateway {
49
+ constructor(client){
50
+ this.client = client;
75
51
  }
76
- if (!result.data || !result.meta) {
77
- throw new Error(result.error?.message || "Could not list schedule actions.");
78
- }
79
- const validated = await schema.safeParseAsync(result);
80
- if (!validated.success) {
81
- const err = createZodError(validated.error);
82
- console.error(err);
83
- throw err;
52
+ async execute(params) {
53
+ const { data: response, errors } = await this.client.query({
54
+ query: createListScheduledActionsQuery(),
55
+ variables: {
56
+ namespace: params.namespace,
57
+ where: params.where,
58
+ limit: params.limit,
59
+ after: params.after,
60
+ sort: params.sort
61
+ },
62
+ fetchPolicy: "network-only"
63
+ });
64
+ const result = response?.scheduler?.listScheduledActions;
65
+ if (!result || errors?.length) {
66
+ console.error({
67
+ errors
68
+ });
69
+ throw new Error("Network error while listing scheduled actions.");
70
+ }
71
+ if (!result.data || !result.meta) throw new Error(result.error?.message || "Could not list schedule actions.");
72
+ const validated = await schema.safeParseAsync(result);
73
+ if (!validated.success) {
74
+ const err = createZodError(validated.error);
75
+ console.error(err);
76
+ throw err;
77
+ }
78
+ return {
79
+ items: validated.data.data,
80
+ meta: validated.data.meta
81
+ };
84
82
  }
85
- return {
86
- items: validated.data.data,
87
- meta: validated.data.meta
88
- };
89
- }
90
83
  }
84
+ export { SchedulerListGraphQLGateway };
91
85
 
92
86
  //# sourceMappingURL=SchedulerListGraphQLGateway.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["gql","zod","createZodError","schedulerEntrySchema","createSchedulerEntryFields","createListScheduledActionsQuery","schema","object","data","array","meta","totalCount","number","cursor","string","nullable","hasMoreItems","boolean","SchedulerListGraphQLGateway","constructor","client","execute","params","response","errors","query","variables","namespace","where","limit","after","sort","fetchPolicy","result","scheduler","listScheduledActions","length","console","error","Error","message","validated","safeParseAsync","success","err","items"],"sources":["SchedulerListGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils/createZodError.js\";\nimport { schedulerEntrySchema } from \"./schema/schedulerEntry.js\";\nimport { createSchedulerEntryFields } from \"./graphql/fields.js\";\nimport type {\n IListScheduledActionsGateway,\n IListScheduledActionsGatewayExecuteParams,\n IListScheduledActionsGatewayExecuteResponse\n} from \"./abstractions/ListScheduledActionsGateway.js\";\nimport type { SchedulerEntry, SchedulerErrorResponse, SchedulerMetaResponse } from \"~/types.js\";\n\nconst createListScheduledActionsQuery = () => {\n return gql`\n query ListScheduledActions(\n $namespace: String!\n $where: ListScheduledActionsWhereInput\n $sort: [ListScheduledActionsSorter!]\n $limit: Int\n $after: String\n ) {\n scheduler {\n listScheduledActions(\n namespace: $namespace\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n ) {\n data {\n ${createSchedulerEntryFields()}\n }\n meta {\n totalCount\n cursor\n hasMoreItems\n }\n error {\n message\n code\n data\n stack\n }\n }\n }\n }\n `;\n};\n\ninterface SchedulerListGraphQLQueryResponse {\n scheduler: {\n listScheduledActions: {\n data: SchedulerEntry[] | null;\n meta: SchedulerMetaResponse | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nconst schema = zod.object({\n data: zod.array(schedulerEntrySchema),\n meta: zod.object({\n totalCount: zod.number(),\n cursor: zod.string().nullable(),\n hasMoreItems: zod.boolean()\n })\n});\n\nexport class SchedulerListGraphQLGateway implements IListScheduledActionsGateway {\n private readonly client: ApolloClient<any>;\n\n public constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n public async execute(\n params: IListScheduledActionsGatewayExecuteParams\n ): Promise<IListScheduledActionsGatewayExecuteResponse> {\n const { data: response, errors } = await this.client.query<\n SchedulerListGraphQLQueryResponse,\n IListScheduledActionsGatewayExecuteParams\n >({\n query: createListScheduledActionsQuery(),\n variables: {\n namespace: params.namespace,\n where: params.where,\n limit: params.limit,\n after: params.after,\n sort: params.sort\n },\n fetchPolicy: \"network-only\"\n });\n\n const result = response?.scheduler?.listScheduledActions;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while listing scheduled actions.\");\n }\n\n if (!result.data || !result.meta) {\n throw new Error(result.error?.message || \"Could not list schedule actions.\");\n }\n\n const validated = await schema.safeParseAsync(result);\n if (!validated.success) {\n const err = createZodError(validated.error);\n console.error(err);\n throw err;\n }\n\n return {\n items: validated.data.data,\n meta: validated.data.meta\n };\n }\n}\n"],"mappings":"AACA,OAAOA,GAAG,MAAM,aAAa;AAC7B,OAAOC,GAAG,MAAM,KAAK;AACrB,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,oBAAoB;AAC7B,SAASC,0BAA0B;AAQnC,MAAMC,+BAA+B,GAAGA,CAAA,KAAM;EAC1C,OAAOL,GAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BI,0BAA0B,CAAC,CAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AAYD,MAAME,MAAM,GAAGL,GAAG,CAACM,MAAM,CAAC;EACtBC,IAAI,EAAEP,GAAG,CAACQ,KAAK,CAACN,oBAAoB,CAAC;EACrCO,IAAI,EAAET,GAAG,CAACM,MAAM,CAAC;IACbI,UAAU,EAAEV,GAAG,CAACW,MAAM,CAAC,CAAC;IACxBC,MAAM,EAAEZ,GAAG,CAACa,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IAC/BC,YAAY,EAAEf,GAAG,CAACgB,OAAO,CAAC;EAC9B,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,MAAMC,2BAA2B,CAAyC;EAGtEC,WAAWA,CAACC,MAAyB,EAAE;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,OAAOA,CAChBC,MAAiD,EACG;IACpD,MAAM;MAAEd,IAAI,EAAEe,QAAQ;MAAEC;IAAO,CAAC,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,KAAK,CAGxD;MACEA,KAAK,EAAEpB,+BAA+B,CAAC,CAAC;MACxCqB,SAAS,EAAE;QACPC,SAAS,EAAEL,MAAM,CAACK,SAAS;QAC3BC,KAAK,EAAEN,MAAM,CAACM,KAAK;QACnBC,KAAK,EAAEP,MAAM,CAACO,KAAK;QACnBC,KAAK,EAAER,MAAM,CAACQ,KAAK;QACnBC,IAAI,EAAET,MAAM,CAACS;MACjB,CAAC;MACDC,WAAW,EAAE;IACjB,CAAC,CAAC;IAEF,MAAMC,MAAM,GAAGV,QAAQ,EAAEW,SAAS,EAAEC,oBAAoB;IACxD,IAAI,CAACF,MAAM,IAAIT,MAAM,EAAEY,MAAM,EAAE;MAC3BC,OAAO,CAACC,KAAK,CAAC;QACVd;MACJ,CAAC,CAAC;MACF,MAAM,IAAIe,KAAK,CAAC,gDAAgD,CAAC;IACrE;IAEA,IAAI,CAACN,MAAM,CAACzB,IAAI,IAAI,CAACyB,MAAM,CAACvB,IAAI,EAAE;MAC9B,MAAM,IAAI6B,KAAK,CAACN,MAAM,CAACK,KAAK,EAAEE,OAAO,IAAI,kCAAkC,CAAC;IAChF;IAEA,MAAMC,SAAS,GAAG,MAAMnC,MAAM,CAACoC,cAAc,CAACT,MAAM,CAAC;IACrD,IAAI,CAACQ,SAAS,CAACE,OAAO,EAAE;MACpB,MAAMC,GAAG,GAAG1C,cAAc,CAACuC,SAAS,CAACH,KAAK,CAAC;MAC3CD,OAAO,CAACC,KAAK,CAACM,GAAG,CAAC;MAClB,MAAMA,GAAG;IACb;IAEA,OAAO;MACHC,KAAK,EAAEJ,SAAS,CAACjC,IAAI,CAACA,IAAI;MAC1BE,IAAI,EAAE+B,SAAS,CAACjC,IAAI,CAACE;IACzB,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"Gateways/SchedulerListGraphQLGateway.js","sources":["../../src/Gateways/SchedulerListGraphQLGateway.ts"],"sourcesContent":["import type { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils/createZodError.js\";\nimport { schedulerEntrySchema } from \"./schema/schedulerEntry.js\";\nimport { createSchedulerEntryFields } from \"./graphql/fields.js\";\nimport type {\n IListScheduledActionsGateway,\n IListScheduledActionsGatewayExecuteParams,\n IListScheduledActionsGatewayExecuteResponse\n} from \"./abstractions/ListScheduledActionsGateway.js\";\nimport type { SchedulerEntry, SchedulerErrorResponse, SchedulerMetaResponse } from \"~/types.js\";\n\nconst createListScheduledActionsQuery = () => {\n return gql`\n query ListScheduledActions(\n $namespace: String!\n $where: ListScheduledActionsWhereInput\n $sort: [ListScheduledActionsSorter!]\n $limit: Int\n $after: String\n ) {\n scheduler {\n listScheduledActions(\n namespace: $namespace\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n ) {\n data {\n ${createSchedulerEntryFields()}\n }\n meta {\n totalCount\n cursor\n hasMoreItems\n }\n error {\n message\n code\n data\n stack\n }\n }\n }\n }\n `;\n};\n\ninterface SchedulerListGraphQLQueryResponse {\n scheduler: {\n listScheduledActions: {\n data: SchedulerEntry[] | null;\n meta: SchedulerMetaResponse | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nconst schema = zod.object({\n data: zod.array(schedulerEntrySchema),\n meta: zod.object({\n totalCount: zod.number(),\n cursor: zod.string().nullable(),\n hasMoreItems: zod.boolean()\n })\n});\n\nexport class SchedulerListGraphQLGateway implements IListScheduledActionsGateway {\n private readonly client: ApolloClient<any>;\n\n public constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n public async execute(\n params: IListScheduledActionsGatewayExecuteParams\n ): Promise<IListScheduledActionsGatewayExecuteResponse> {\n const { data: response, errors } = await this.client.query<\n SchedulerListGraphQLQueryResponse,\n IListScheduledActionsGatewayExecuteParams\n >({\n query: createListScheduledActionsQuery(),\n variables: {\n namespace: params.namespace,\n where: params.where,\n limit: params.limit,\n after: params.after,\n sort: params.sort\n },\n fetchPolicy: \"network-only\"\n });\n\n const result = response?.scheduler?.listScheduledActions;\n if (!result || errors?.length) {\n console.error({\n errors\n });\n throw new Error(\"Network error while listing scheduled actions.\");\n }\n\n if (!result.data || !result.meta) {\n throw new Error(result.error?.message || \"Could not list schedule actions.\");\n }\n\n const validated = await schema.safeParseAsync(result);\n if (!validated.success) {\n const err = createZodError(validated.error);\n console.error(err);\n throw err;\n }\n\n return {\n items: validated.data.data,\n meta: validated.data.meta\n };\n }\n}\n"],"names":["createListScheduledActionsQuery","gql","createSchedulerEntryFields","schema","zod","schedulerEntrySchema","SchedulerListGraphQLGateway","client","params","response","errors","result","console","Error","validated","err","createZodError"],"mappings":";;;;;AAaA,MAAMA,kCAAkC,IAC7BC,WAAG,CAAC;;;;;;;;;;;;;;;;;wBAiBS,EAAEC,6BAA6B;;;;;;;;;;;;;;;;IAgBnD,CAAC;AAaL,MAAMC,SAASC,IAAI,MAAM,CAAC;IACtB,MAAMA,IAAI,KAAK,CAACC;IAChB,MAAMD,IAAI,MAAM,CAAC;QACb,YAAYA,IAAI,MAAM;QACtB,QAAQA,IAAI,MAAM,GAAG,QAAQ;QAC7B,cAAcA,IAAI,OAAO;IAC7B;AACJ;AAEO,MAAME;IAGT,YAAmBC,MAAyB,CAAE;QAC1C,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,MAAa,QACTC,MAAiD,EACG;QACpD,MAAM,EAAE,MAAMC,QAAQ,EAAEC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAGxD;YACE,OAAOV;YACP,WAAW;gBACP,WAAWQ,OAAO,SAAS;gBAC3B,OAAOA,OAAO,KAAK;gBACnB,OAAOA,OAAO,KAAK;gBACnB,OAAOA,OAAO,KAAK;gBACnB,MAAMA,OAAO,IAAI;YACrB;YACA,aAAa;QACjB;QAEA,MAAMG,SAASF,UAAU,WAAW;QACpC,IAAI,CAACE,UAAUD,QAAQ,QAAQ;YAC3BE,QAAQ,KAAK,CAAC;gBACVF;YACJ;YACA,MAAM,IAAIG,MAAM;QACpB;QAEA,IAAI,CAACF,OAAO,IAAI,IAAI,CAACA,OAAO,IAAI,EAC5B,MAAM,IAAIE,MAAMF,OAAO,KAAK,EAAE,WAAW;QAG7C,MAAMG,YAAY,MAAMX,OAAO,cAAc,CAACQ;QAC9C,IAAI,CAACG,UAAU,OAAO,EAAE;YACpB,MAAMC,MAAMC,eAAeF,UAAU,KAAK;YAC1CF,QAAQ,KAAK,CAACG;YACd,MAAMA;QACV;QAEA,OAAO;YACH,OAAOD,UAAU,IAAI,CAAC,IAAI;YAC1B,MAAMA,UAAU,IAAI,CAAC,IAAI;QAC7B;IACJ;AACJ"}