@webiny/app-scheduler 0.0.0-unstable.0d717d18dd

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 (229) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/domain/schedulerEntry.d.ts +16 -0
  4. package/domain/schedulerEntry.js +19 -0
  5. package/domain/schedulerEntry.js.map +1 -0
  6. package/features/cancelScheduledAction/CancelScheduledActionGateway.d.ts +11 -0
  7. package/features/cancelScheduledAction/CancelScheduledActionGateway.js +41 -0
  8. package/features/cancelScheduledAction/CancelScheduledActionGateway.js.map +1 -0
  9. package/features/cancelScheduledAction/abstractions.d.ts +11 -0
  10. package/features/cancelScheduledAction/abstractions.js +5 -0
  11. package/features/cancelScheduledAction/abstractions.js.map +1 -0
  12. package/features/cancelScheduledAction/feature.d.ts +1 -0
  13. package/features/cancelScheduledAction/feature.js +11 -0
  14. package/features/cancelScheduledAction/feature.js.map +1 -0
  15. package/features/feature.d.ts +1 -0
  16. package/features/feature.js +19 -0
  17. package/features/feature.js.map +1 -0
  18. package/features/getScheduledAction/GetScheduledActionGateway.d.ts +11 -0
  19. package/features/getScheduledAction/GetScheduledActionGateway.js +57 -0
  20. package/features/getScheduledAction/GetScheduledActionGateway.js.map +1 -0
  21. package/features/getScheduledAction/abstractions.d.ts +13 -0
  22. package/features/getScheduledAction/abstractions.js +5 -0
  23. package/features/getScheduledAction/abstractions.js.map +1 -0
  24. package/features/getScheduledAction/feature.d.ts +1 -0
  25. package/features/getScheduledAction/feature.js +11 -0
  26. package/features/getScheduledAction/feature.js.map +1 -0
  27. package/features/graphqlFields.d.ts +2 -0
  28. package/features/graphqlFields.js +23 -0
  29. package/features/graphqlFields.js.map +1 -0
  30. package/features/listScheduledActions/ListScheduledActionsGateway.d.ts +11 -0
  31. package/features/listScheduledActions/ListScheduledActionsGateway.js +84 -0
  32. package/features/listScheduledActions/ListScheduledActionsGateway.js.map +1 -0
  33. package/features/listScheduledActions/abstractions.d.ts +30 -0
  34. package/features/listScheduledActions/abstractions.js +5 -0
  35. package/features/listScheduledActions/abstractions.js.map +1 -0
  36. package/features/listScheduledActions/feature.d.ts +1 -0
  37. package/features/listScheduledActions/feature.js +11 -0
  38. package/features/listScheduledActions/feature.js.map +1 -0
  39. package/features/schedulePublishAction/SchedulePublishActionGateway.d.ts +11 -0
  40. package/features/schedulePublishAction/SchedulePublishActionGateway.js +67 -0
  41. package/features/schedulePublishAction/SchedulePublishActionGateway.js.map +1 -0
  42. package/features/schedulePublishAction/abstractions.d.ts +16 -0
  43. package/features/schedulePublishAction/abstractions.js +5 -0
  44. package/features/schedulePublishAction/abstractions.js.map +1 -0
  45. package/features/schedulePublishAction/feature.d.ts +1 -0
  46. package/features/schedulePublishAction/feature.js +11 -0
  47. package/features/schedulePublishAction/feature.js.map +1 -0
  48. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.d.ts +11 -0
  49. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js +71 -0
  50. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js.map +1 -0
  51. package/features/scheduleUnpublishAction/abstractions.d.ts +16 -0
  52. package/features/scheduleUnpublishAction/abstractions.js +5 -0
  53. package/features/scheduleUnpublishAction/abstractions.js.map +1 -0
  54. package/features/scheduleUnpublishAction/feature.d.ts +1 -0
  55. package/features/scheduleUnpublishAction/feature.js +11 -0
  56. package/features/scheduleUnpublishAction/feature.js.map +1 -0
  57. package/index.d.ts +9 -0
  58. package/index.js +17 -0
  59. package/index.js.map +1 -0
  60. package/package.json +56 -0
  61. package/presentation/SchedulerConfigs/SchedulerConfigs.d.ts +2 -0
  62. package/presentation/SchedulerConfigs/SchedulerConfigs.js +52 -0
  63. package/presentation/SchedulerConfigs/SchedulerConfigs.js.map +1 -0
  64. package/presentation/SchedulerConfigs/index.d.ts +1 -0
  65. package/presentation/SchedulerConfigs/index.js +1 -0
  66. package/presentation/components/Actions/CancelItem/CancelItem.d.ts +2 -0
  67. package/presentation/components/Actions/CancelItem/CancelItem.js +18 -0
  68. package/presentation/components/Actions/CancelItem/CancelItem.js.map +1 -0
  69. package/presentation/components/Actions/CancelItem/index.d.ts +1 -0
  70. package/presentation/components/Actions/CancelItem/index.js +1 -0
  71. package/presentation/components/Actions/index.d.ts +1 -0
  72. package/presentation/components/Actions/index.js +1 -0
  73. package/presentation/components/BottomInfoBar/BottomInfoBar.styled.d.ts +20 -0
  74. package/presentation/components/BottomInfoBar/BottomInfoBar.styled.js +43 -0
  75. package/presentation/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -0
  76. package/presentation/components/BottomInfoBar/ListMeta.d.ts +7 -0
  77. package/presentation/components/BottomInfoBar/ListMeta.js +9 -0
  78. package/presentation/components/BottomInfoBar/ListMeta.js.map +1 -0
  79. package/presentation/components/BottomInfoBar/ListStatus.d.ts +5 -0
  80. package/presentation/components/BottomInfoBar/ListStatus.js +12 -0
  81. package/presentation/components/BottomInfoBar/ListStatus.js.map +1 -0
  82. package/presentation/components/Cells/CellActions/CellActions.d.ts +2 -0
  83. package/presentation/components/Cells/CellActions/CellActions.js +18 -0
  84. package/presentation/components/Cells/CellActions/CellActions.js.map +1 -0
  85. package/presentation/components/Cells/CellActions/index.d.ts +1 -0
  86. package/presentation/components/Cells/CellActions/index.js +1 -0
  87. package/presentation/components/Cells/CellRevision/CellRevision.d.ts +2 -0
  88. package/presentation/components/Cells/CellRevision/CellRevision.js +15 -0
  89. package/presentation/components/Cells/CellRevision/CellRevision.js.map +1 -0
  90. package/presentation/components/Cells/CellRevision/CellRevision.styled.d.ts +11 -0
  91. package/presentation/components/Cells/CellRevision/CellRevision.styled.js +18 -0
  92. package/presentation/components/Cells/CellRevision/CellRevision.styled.js.map +1 -0
  93. package/presentation/components/Cells/CellRevision/index.d.ts +1 -0
  94. package/presentation/components/Cells/CellRevision/index.js +1 -0
  95. package/presentation/components/Cells/CellScheduledBy/CellScheduledBy.d.ts +2 -0
  96. package/presentation/components/Cells/CellScheduledBy/CellScheduledBy.js +10 -0
  97. package/presentation/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -0
  98. package/presentation/components/Cells/CellScheduledBy/index.d.ts +1 -0
  99. package/presentation/components/Cells/CellScheduledBy/index.js +1 -0
  100. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.d.ts +24 -0
  101. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js +19 -0
  102. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -0
  103. package/presentation/components/Cells/CellScheduledOn/index.d.ts +1 -0
  104. package/presentation/components/Cells/CellScheduledOn/index.js +1 -0
  105. package/presentation/components/Cells/CellTitle/CellTitle.d.ts +2 -0
  106. package/presentation/components/Cells/CellTitle/CellTitle.js +14 -0
  107. package/presentation/components/Cells/CellTitle/CellTitle.js.map +1 -0
  108. package/presentation/components/Cells/CellTitle/CellTitle.styled.d.ts +11 -0
  109. package/presentation/components/Cells/CellTitle/CellTitle.styled.js +18 -0
  110. package/presentation/components/Cells/CellTitle/CellTitle.styled.js.map +1 -0
  111. package/presentation/components/Cells/CellTitle/index.d.ts +1 -0
  112. package/presentation/components/Cells/CellTitle/index.js +1 -0
  113. package/presentation/components/Cells/CellType/CellActionType.d.ts +2 -0
  114. package/presentation/components/Cells/CellType/CellActionType.js +15 -0
  115. package/presentation/components/Cells/CellType/CellActionType.js.map +1 -0
  116. package/presentation/components/Cells/CellType/CellActionType.styled.d.ts +11 -0
  117. package/presentation/components/Cells/CellType/CellActionType.styled.js +18 -0
  118. package/presentation/components/Cells/CellType/CellActionType.styled.js.map +1 -0
  119. package/presentation/components/Cells/CellType/index.d.ts +1 -0
  120. package/presentation/components/Cells/CellType/index.js +1 -0
  121. package/presentation/components/Cells/index.d.ts +6 -0
  122. package/presentation/components/Cells/index.js +6 -0
  123. package/presentation/components/Empty/Empty.styled.d.ts +8 -0
  124. package/presentation/components/Empty/Empty.styled.js +16 -0
  125. package/presentation/components/Empty/Empty.styled.js.map +1 -0
  126. package/presentation/components/Title/Title.d.ts +5 -0
  127. package/presentation/components/Title/Title.js +10 -0
  128. package/presentation/components/Title/Title.js.map +1 -0
  129. package/presentation/components/Title/Title.styled.d.ts +3 -0
  130. package/presentation/components/Title/Title.styled.js +13 -0
  131. package/presentation/components/Title/Title.styled.js.map +1 -0
  132. package/presentation/components/Title/index.d.ts +1 -0
  133. package/presentation/components/Title/index.js +1 -0
  134. package/presentation/configs/index.d.ts +1 -0
  135. package/presentation/configs/index.js +1 -0
  136. package/presentation/configs/list/Browser/EntryAction.d.ts +8 -0
  137. package/presentation/configs/list/Browser/EntryAction.js +13 -0
  138. package/presentation/configs/list/Browser/EntryAction.js.map +1 -0
  139. package/presentation/configs/list/Browser/Table/Column.d.ts +15 -0
  140. package/presentation/configs/list/Browser/Table/Column.js +11 -0
  141. package/presentation/configs/list/Browser/Table/Column.js.map +1 -0
  142. package/presentation/configs/list/Browser/Table/Sorting.d.ts +5 -0
  143. package/presentation/configs/list/Browser/Table/Sorting.js +7 -0
  144. package/presentation/configs/list/Browser/Table/Sorting.js.map +1 -0
  145. package/presentation/configs/list/Browser/Table/index.d.ts +19 -0
  146. package/presentation/configs/list/Browser/Table/index.js +9 -0
  147. package/presentation/configs/list/Browser/Table/index.js.map +1 -0
  148. package/presentation/configs/list/Browser/index.d.ts +23 -0
  149. package/presentation/configs/list/Browser/index.js +9 -0
  150. package/presentation/configs/list/Browser/index.js.map +1 -0
  151. package/presentation/configs/list/SchedulerListConfig.d.ts +35 -0
  152. package/presentation/configs/list/SchedulerListConfig.js +30 -0
  153. package/presentation/configs/list/SchedulerListConfig.js.map +1 -0
  154. package/presentation/configs/list/index.d.ts +1 -0
  155. package/presentation/configs/list/index.js +1 -0
  156. package/presentation/hooks/index.d.ts +2 -0
  157. package/presentation/hooks/index.js +2 -0
  158. package/presentation/hooks/useCancelSchedulerItem.d.ts +8 -0
  159. package/presentation/hooks/useCancelSchedulerItem.js +32 -0
  160. package/presentation/hooks/useCancelSchedulerItem.js.map +1 -0
  161. package/presentation/hooks/useSchedulerItem.d.ts +11 -0
  162. package/presentation/hooks/useSchedulerItem.js +7 -0
  163. package/presentation/hooks/useSchedulerItem.js.map +1 -0
  164. package/presentation/scheduleDialog/ScheduleDialogPresenter.d.ts +26 -0
  165. package/presentation/scheduleDialog/ScheduleDialogPresenter.js +115 -0
  166. package/presentation/scheduleDialog/ScheduleDialogPresenter.js.map +1 -0
  167. package/presentation/scheduleDialog/abstractions.d.ts +35 -0
  168. package/presentation/scheduleDialog/abstractions.js +5 -0
  169. package/presentation/scheduleDialog/abstractions.js.map +1 -0
  170. package/presentation/scheduleDialog/components/CancelButtonComponent.d.ts +10 -0
  171. package/presentation/scheduleDialog/components/CancelButtonComponent.js +20 -0
  172. package/presentation/scheduleDialog/components/CancelButtonComponent.js.map +1 -0
  173. package/presentation/scheduleDialog/components/FormComponent.d.ts +9 -0
  174. package/presentation/scheduleDialog/components/FormComponent.js +32 -0
  175. package/presentation/scheduleDialog/components/FormComponent.js.map +1 -0
  176. package/presentation/scheduleDialog/components/ReschedulingAlert.d.ts +7 -0
  177. package/presentation/scheduleDialog/components/ReschedulingAlert.js +14 -0
  178. package/presentation/scheduleDialog/components/ReschedulingAlert.js.map +1 -0
  179. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.d.ts +24 -0
  180. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js +15 -0
  181. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js.map +1 -0
  182. package/presentation/scheduleDialog/createMinDateValidator.d.ts +7 -0
  183. package/presentation/scheduleDialog/createMinDateValidator.js +14 -0
  184. package/presentation/scheduleDialog/createMinDateValidator.js.map +1 -0
  185. package/presentation/scheduleDialog/feature.d.ts +3 -0
  186. package/presentation/scheduleDialog/feature.js +17 -0
  187. package/presentation/scheduleDialog/feature.js.map +1 -0
  188. package/presentation/scheduleDialog/useScheduleDialog.d.ts +20 -0
  189. package/presentation/scheduleDialog/useScheduleDialog.js +128 -0
  190. package/presentation/scheduleDialog/useScheduleDialog.js.map +1 -0
  191. package/presentation/schedulerList/Scheduler.d.ts +18 -0
  192. package/presentation/schedulerList/Scheduler.js +28 -0
  193. package/presentation/schedulerList/Scheduler.js.map +1 -0
  194. package/presentation/schedulerList/SchedulerListDataSource.d.ts +15 -0
  195. package/presentation/schedulerList/SchedulerListDataSource.js +41 -0
  196. package/presentation/schedulerList/SchedulerListDataSource.js.map +1 -0
  197. package/presentation/schedulerList/SchedulerListPresenter.d.ts +21 -0
  198. package/presentation/schedulerList/SchedulerListPresenter.js +47 -0
  199. package/presentation/schedulerList/SchedulerListPresenter.js.map +1 -0
  200. package/presentation/schedulerList/abstractions.d.ts +13 -0
  201. package/presentation/schedulerList/abstractions.js +5 -0
  202. package/presentation/schedulerList/abstractions.js.map +1 -0
  203. package/presentation/schedulerList/components/BottomInfoBar.d.ts +9 -0
  204. package/presentation/schedulerList/components/BottomInfoBar.js +18 -0
  205. package/presentation/schedulerList/components/BottomInfoBar.js.map +1 -0
  206. package/presentation/schedulerList/components/Empty.d.ts +9 -0
  207. package/presentation/schedulerList/components/Empty.js +21 -0
  208. package/presentation/schedulerList/components/Empty.js.map +1 -0
  209. package/presentation/schedulerList/components/SchedulerListView.d.ts +8 -0
  210. package/presentation/schedulerList/components/SchedulerListView.js +40 -0
  211. package/presentation/schedulerList/components/SchedulerListView.js.map +1 -0
  212. package/presentation/schedulerList/components/SchedulerOverlay.d.ts +11 -0
  213. package/presentation/schedulerList/components/SchedulerOverlay.js +38 -0
  214. package/presentation/schedulerList/components/SchedulerOverlay.js.map +1 -0
  215. package/presentation/schedulerList/components/SchedulerTable.d.ts +9 -0
  216. package/presentation/schedulerList/components/SchedulerTable.js +48 -0
  217. package/presentation/schedulerList/components/SchedulerTable.js.map +1 -0
  218. package/presentation/schedulerList/components/SearchInput.d.ts +9 -0
  219. package/presentation/schedulerList/components/SearchInput.js +30 -0
  220. package/presentation/schedulerList/components/SearchInput.js.map +1 -0
  221. package/presentation/schedulerList/feature.d.ts +3 -0
  222. package/presentation/schedulerList/feature.js +17 -0
  223. package/presentation/schedulerList/feature.js.map +1 -0
  224. package/presentation/schedulerList/useSchedulerListPresenter.d.ts +1 -0
  225. package/presentation/schedulerList/useSchedulerListPresenter.js +6 -0
  226. package/presentation/schedulerList/useSchedulerListPresenter.js.map +1 -0
  227. package/types.d.ts +30 -0
  228. package/types.js +8 -0
  229. package/types.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @webiny/app-scheduler
2
+
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
6
+
7
+ 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
8
+
9
+ ---
10
+
11
+ _This README file is automatically generated during the publish process._
@@ -0,0 +1,16 @@
1
+ import zod from "zod";
2
+ import { ScheduleActionType } from "../types.js";
3
+ export declare const schedulerEntrySchema: zod.ZodObject<{
4
+ id: zod.ZodString;
5
+ targetId: zod.ZodString;
6
+ namespace: zod.ZodString;
7
+ scheduledBy: zod.ZodObject<{
8
+ id: zod.ZodString;
9
+ displayName: zod.ZodString;
10
+ type: zod.ZodString;
11
+ }, zod.core.$strip>;
12
+ publishOn: zod.ZodPipe<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>, zod.ZodTransform<Date | undefined, string | null | undefined>>;
13
+ unpublishOn: zod.ZodPipe<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>, zod.ZodTransform<Date | undefined, string | null | undefined>>;
14
+ actionType: zod.ZodEnum<typeof ScheduleActionType>;
15
+ title: zod.ZodString;
16
+ }, zod.core.$strip>;
@@ -0,0 +1,19 @@
1
+ import zod from "zod";
2
+ import { ScheduleActionType } from "../types.js";
3
+ const schedulerEntrySchema = zod.object({
4
+ id: zod.string(),
5
+ targetId: zod.string(),
6
+ namespace: zod.string(),
7
+ scheduledBy: zod.object({
8
+ id: zod.string(),
9
+ displayName: zod.string(),
10
+ type: zod.string()
11
+ }),
12
+ publishOn: zod.string().nullable().optional().transform((value)=>value ? new Date(value) : void 0),
13
+ unpublishOn: zod.string().nullable().optional().transform((value)=>value ? new Date(value) : void 0),
14
+ actionType: zod["enum"](ScheduleActionType),
15
+ title: zod.string()
16
+ });
17
+ export { schedulerEntrySchema };
18
+
19
+ //# sourceMappingURL=schedulerEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain/schedulerEntry.js","sources":["../../src/domain/schedulerEntry.ts"],"sourcesContent":["import zod from \"zod\";\nimport { ScheduleActionType } from \"~/types.js\";\n\nexport const schedulerEntrySchema = zod.object({\n id: zod.string(),\n targetId: zod.string(),\n namespace: zod.string(),\n scheduledBy: zod.object({\n id: zod.string(),\n displayName: zod.string(),\n type: zod.string()\n }),\n publishOn: zod\n .string()\n .nullable()\n .optional()\n .transform(value => {\n return !!value ? new Date(value) : undefined;\n }),\n unpublishOn: zod\n .string()\n .nullable()\n .optional()\n .transform(value => {\n return !!value ? new Date(value) : undefined;\n }),\n actionType: zod.enum(ScheduleActionType),\n title: zod.string()\n});\n"],"names":["schedulerEntrySchema","zod","value","Date","undefined","ScheduleActionType"],"mappings":";;AAGO,MAAMA,uBAAuBC,IAAI,MAAM,CAAC;IAC3C,IAAIA,IAAI,MAAM;IACd,UAAUA,IAAI,MAAM;IACpB,WAAWA,IAAI,MAAM;IACrB,aAAaA,IAAI,MAAM,CAAC;QACpB,IAAIA,IAAI,MAAM;QACd,aAAaA,IAAI,MAAM;QACvB,MAAMA,IAAI,MAAM;IACpB;IACA,WAAWA,IAAAA,MACA,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,CAACC,CAAAA,QACA,AAAEA,QAAQ,IAAIC,KAAKD,SAASE;IAE3C,aAAaH,IAAAA,MACF,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,CAACC,CAAAA,QACA,AAAEA,QAAQ,IAAIC,KAAKD,SAASE;IAE3C,YAAYH,GAAG,CAAHA,OAAQ,CAACI;IACrB,OAAOJ,IAAI,MAAM;AACrB"}
@@ -0,0 +1,11 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { CancelScheduledActionGateway as GatewayAbstraction, type ICancelScheduledActionGatewayParams } from "./abstractions.js";
3
+ declare class CancelScheduledActionGatewayImpl implements GatewayAbstraction.Interface {
4
+ private client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(params: ICancelScheduledActionGatewayParams): Promise<void>;
7
+ }
8
+ export declare const CancelScheduledActionGateway: typeof CancelScheduledActionGatewayImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICancelScheduledActionGateway>;
10
+ };
11
+ export {};
@@ -0,0 +1,41 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ERROR_FIELDS } from "../graphqlFields.js";
3
+ import { CancelScheduledActionGateway } from "./abstractions.js";
4
+ const CANCEL_SCHEDULED_ACTION_MUTATION = `
5
+ mutation ScheduleCancelAction($namespace: String!, $id: ID!) {
6
+ scheduler {
7
+ cancelScheduledAction(namespace: $namespace, id: $id) {
8
+ data
9
+ error {
10
+ ${ERROR_FIELDS}
11
+ }
12
+ }
13
+ }
14
+ }
15
+ `;
16
+ class CancelScheduledActionGatewayImpl {
17
+ constructor(client){
18
+ this.client = client;
19
+ }
20
+ async execute(params) {
21
+ const response = await this.client.execute({
22
+ query: CANCEL_SCHEDULED_ACTION_MUTATION,
23
+ variables: {
24
+ namespace: params.namespace,
25
+ id: params.id
26
+ }
27
+ });
28
+ const result = response?.scheduler?.cancelScheduledAction;
29
+ if (!result) throw new Error("Network error while canceling a scheduled action.");
30
+ if (!result.data) throw new Error(result.error?.message || "Could not cancel scheduled action.");
31
+ }
32
+ }
33
+ const CancelScheduledActionGateway_CancelScheduledActionGateway = CancelScheduledActionGateway.createImplementation({
34
+ implementation: CancelScheduledActionGatewayImpl,
35
+ dependencies: [
36
+ MainGraphQLClient
37
+ ]
38
+ });
39
+ export { CancelScheduledActionGateway_CancelScheduledActionGateway as CancelScheduledActionGateway };
40
+
41
+ //# sourceMappingURL=CancelScheduledActionGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/cancelScheduledAction/CancelScheduledActionGateway.js","sources":["../../../src/features/cancelScheduledAction/CancelScheduledActionGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n CancelScheduledActionGateway as GatewayAbstraction,\n type ICancelScheduledActionGatewayParams\n} from \"./abstractions.js\";\nimport type { SchedulerErrorResponse } from \"~/types.js\";\n\nconst CANCEL_SCHEDULED_ACTION_MUTATION = /* GraphQL */ `\n mutation ScheduleCancelAction($namespace: String!, $id: ID!) {\n scheduler {\n cancelScheduledAction(namespace: $namespace, id: $id) {\n data\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\ninterface CancelScheduledActionResponse {\n scheduler: {\n cancelScheduledAction: {\n data: boolean | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nclass CancelScheduledActionGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(params: ICancelScheduledActionGatewayParams): Promise<void> {\n const response = await this.client.execute<CancelScheduledActionResponse>({\n query: CANCEL_SCHEDULED_ACTION_MUTATION,\n variables: {\n namespace: params.namespace,\n id: params.id\n }\n });\n\n const result = response?.scheduler?.cancelScheduledAction;\n if (!result) {\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\nexport const CancelScheduledActionGateway = GatewayAbstraction.createImplementation({\n implementation: CancelScheduledActionGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["CANCEL_SCHEDULED_ACTION_MUTATION","ERROR_FIELDS","CancelScheduledActionGatewayImpl","client","params","response","result","Error","CancelScheduledActionGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;AAQA,MAAMA,mCAAiD,CAAC;;;;;;oBAMpC,EAAEC,aAAa;;;;;AAKnC,CAAC;AAWD,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA2C,EAAiB;QACtE,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAgC;YACtE,OAAOL;YACP,WAAW;gBACP,WAAWI,OAAO,SAAS;gBAC3B,IAAIA,OAAO,EAAE;YACjB;QACJ;QAEA,MAAME,SAASD,UAAU,WAAW;QACpC,IAAI,CAACC,QACD,MAAM,IAAIC,MAAM;QAGpB,IAAI,CAACD,OAAO,IAAI,EACZ,MAAM,IAAIC,MAAMD,OAAO,KAAK,EAAE,WAAW;IAEjD;AACJ;AAEO,MAAME,4DAA+BC,6BAAAA,oBAAuC,CAAC;IAChF,gBAAgBP;IAChB,cAAc;QAACQ;KAAkB;AACrC"}
@@ -0,0 +1,11 @@
1
+ export interface ICancelScheduledActionGatewayParams {
2
+ namespace: string;
3
+ id: string;
4
+ }
5
+ export interface ICancelScheduledActionGateway {
6
+ execute(params: ICancelScheduledActionGatewayParams): Promise<void>;
7
+ }
8
+ export declare const CancelScheduledActionGateway: import("@webiny/di").Abstraction<ICancelScheduledActionGateway>;
9
+ export declare namespace CancelScheduledActionGateway {
10
+ type Interface = ICancelScheduledActionGateway;
11
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const CancelScheduledActionGateway = createAbstraction("Scheduler/CancelScheduledActionGateway");
3
+ export { CancelScheduledActionGateway };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/cancelScheduledAction/abstractions.js","sources":["../../../src/features/cancelScheduledAction/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface ICancelScheduledActionGatewayParams {\n namespace: string;\n id: string;\n}\n\nexport interface ICancelScheduledActionGateway {\n execute(params: ICancelScheduledActionGatewayParams): Promise<void>;\n}\n\nexport const CancelScheduledActionGateway = createAbstraction<ICancelScheduledActionGateway>(\n \"Scheduler/CancelScheduledActionGateway\"\n);\n\nexport namespace CancelScheduledActionGateway {\n export type Interface = ICancelScheduledActionGateway;\n}\n"],"names":["CancelScheduledActionGateway","createAbstraction"],"mappings":";AAWO,MAAMA,+BAA+BC,kBACxC"}
@@ -0,0 +1 @@
1
+ export declare const CancelScheduledActionFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { CancelScheduledActionGateway } from "./CancelScheduledActionGateway.js";
3
+ const CancelScheduledActionFeature = createFeature({
4
+ name: "Scheduler/CancelScheduledAction",
5
+ register (container) {
6
+ container.register(CancelScheduledActionGateway).inSingletonScope();
7
+ }
8
+ });
9
+ export { CancelScheduledActionFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/cancelScheduledAction/feature.js","sources":["../../../src/features/cancelScheduledAction/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CancelScheduledActionGateway } from \"./CancelScheduledActionGateway.js\";\n\nexport const CancelScheduledActionFeature = createFeature({\n name: \"Scheduler/CancelScheduledAction\",\n register(container) {\n container.register(CancelScheduledActionGateway).inSingletonScope();\n }\n});\n"],"names":["CancelScheduledActionFeature","createFeature","container","CancelScheduledActionGateway"],"mappings":";;AAGO,MAAMA,+BAA+BC,cAAc;IACtD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,8BAA8B,gBAAgB;IACrE;AACJ"}
@@ -0,0 +1 @@
1
+ export declare const SchedulerFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ListScheduledActionsFeature } from "./listScheduledActions/feature.js";
3
+ import { GetScheduledActionFeature } from "./getScheduledAction/feature.js";
4
+ import { SchedulePublishActionFeature } from "./schedulePublishAction/feature.js";
5
+ import { ScheduleUnpublishActionFeature } from "./scheduleUnpublishAction/feature.js";
6
+ import { CancelScheduledActionFeature } from "./cancelScheduledAction/feature.js";
7
+ const SchedulerFeature = createFeature({
8
+ name: "Scheduler",
9
+ register (container) {
10
+ ListScheduledActionsFeature.register(container);
11
+ GetScheduledActionFeature.register(container);
12
+ SchedulePublishActionFeature.register(container);
13
+ ScheduleUnpublishActionFeature.register(container);
14
+ CancelScheduledActionFeature.register(container);
15
+ }
16
+ });
17
+ export { SchedulerFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/feature.js","sources":["../../src/features/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListScheduledActionsFeature } from \"./listScheduledActions/feature.js\";\nimport { GetScheduledActionFeature } from \"./getScheduledAction/feature.js\";\nimport { SchedulePublishActionFeature } from \"./schedulePublishAction/feature.js\";\nimport { ScheduleUnpublishActionFeature } from \"./scheduleUnpublishAction/feature.js\";\nimport { CancelScheduledActionFeature } from \"./cancelScheduledAction/feature.js\";\n\nexport const SchedulerFeature = createFeature({\n name: \"Scheduler\",\n register(container) {\n ListScheduledActionsFeature.register(container);\n GetScheduledActionFeature.register(container);\n SchedulePublishActionFeature.register(container);\n ScheduleUnpublishActionFeature.register(container);\n CancelScheduledActionFeature.register(container);\n }\n});\n"],"names":["SchedulerFeature","createFeature","container","ListScheduledActionsFeature","GetScheduledActionFeature","SchedulePublishActionFeature","ScheduleUnpublishActionFeature","CancelScheduledActionFeature"],"mappings":";;;;;;AAOO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAS;QACdC,4BAA4B,QAAQ,CAACD;QACrCE,0BAA0B,QAAQ,CAACF;QACnCG,6BAA6B,QAAQ,CAACH;QACtCI,+BAA+B,QAAQ,CAACJ;QACxCK,6BAA6B,QAAQ,CAACL;IAC1C;AACJ"}
@@ -0,0 +1,11 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { GetScheduledActionGateway as GatewayAbstraction, type IGetScheduledActionGatewayExecuteParams, type IGetScheduledActionGatewayResponse } from "./abstractions.js";
3
+ declare class GetScheduledActionGatewayImpl implements GatewayAbstraction.Interface {
4
+ private client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(params: IGetScheduledActionGatewayExecuteParams): Promise<IGetScheduledActionGatewayResponse>;
7
+ }
8
+ export declare const GetScheduledActionGateway: typeof GetScheduledActionGatewayImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetScheduledActionGateway>;
10
+ };
11
+ export {};
@@ -0,0 +1,57 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import zod from "zod";
3
+ import { createZodError } from "@webiny/utils/createZodError.js";
4
+ import { schedulerEntrySchema } from "../../domain/schedulerEntry.js";
5
+ import { ERROR_FIELDS, SCHEDULER_ENTRY_FIELDS } from "../graphqlFields.js";
6
+ import { GetScheduledActionGateway } from "./abstractions.js";
7
+ const GET_SCHEDULED_ACTION_QUERY = `
8
+ query GetTargetScheduledActionQuery($namespace: String!, $id: ID!) {
9
+ scheduler {
10
+ getTargetScheduledAction(namespace: $namespace, id: $id) {
11
+ data {
12
+ ${SCHEDULER_ENTRY_FIELDS}
13
+ }
14
+ error {
15
+ ${ERROR_FIELDS}
16
+ }
17
+ }
18
+ }
19
+ }
20
+ `;
21
+ const schema = zod.object({
22
+ data: schedulerEntrySchema
23
+ });
24
+ class GetScheduledActionGatewayImpl {
25
+ constructor(client){
26
+ this.client = client;
27
+ }
28
+ async execute(params) {
29
+ const response = await this.client.execute({
30
+ query: GET_SCHEDULED_ACTION_QUERY,
31
+ variables: {
32
+ namespace: params.namespace,
33
+ id: params.id
34
+ }
35
+ });
36
+ const result = response?.scheduler?.getTargetScheduledAction;
37
+ if (!result) throw new Error("Network error while getting scheduled action.");
38
+ if (result.error) throw new Error(result.error.message || "Could not fetch scheduled action.");
39
+ if (!result.data) return null;
40
+ const validated = await schema.safeParseAsync(result);
41
+ if (!validated.success) {
42
+ const err = createZodError(validated.error);
43
+ console.error(err);
44
+ throw err;
45
+ }
46
+ return validated.data.data;
47
+ }
48
+ }
49
+ const GetScheduledActionGateway_GetScheduledActionGateway = GetScheduledActionGateway.createImplementation({
50
+ implementation: GetScheduledActionGatewayImpl,
51
+ dependencies: [
52
+ MainGraphQLClient
53
+ ]
54
+ });
55
+ export { GetScheduledActionGateway_GetScheduledActionGateway as GetScheduledActionGateway };
56
+
57
+ //# sourceMappingURL=GetScheduledActionGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/getScheduledAction/GetScheduledActionGateway.js","sources":["../../../src/features/getScheduledAction/GetScheduledActionGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils/createZodError.js\";\nimport { schedulerEntrySchema } from \"~/domain/schedulerEntry.js\";\nimport { SCHEDULER_ENTRY_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n GetScheduledActionGateway as GatewayAbstraction,\n type IGetScheduledActionGatewayExecuteParams,\n type IGetScheduledActionGatewayResponse\n} from \"./abstractions.js\";\nimport type { SchedulerEntry, SchedulerErrorResponse } from \"~/types.js\";\n\nconst GET_SCHEDULED_ACTION_QUERY = /* GraphQL */ `\n query GetTargetScheduledActionQuery($namespace: String!, $id: ID!) {\n scheduler {\n getTargetScheduledAction(namespace: $namespace, id: $id) {\n data {\n ${SCHEDULER_ENTRY_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\ninterface GetScheduledActionResponse {\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\nclass GetScheduledActionGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(\n params: IGetScheduledActionGatewayExecuteParams\n ): Promise<IGetScheduledActionGatewayResponse> {\n const response = await this.client.execute<GetScheduledActionResponse>({\n query: GET_SCHEDULED_ACTION_QUERY,\n variables: {\n namespace: params.namespace,\n id: params.id\n }\n });\n\n const result = response?.scheduler?.getTargetScheduledAction;\n if (!result) {\n throw new Error(\"Network error while getting scheduled action.\");\n }\n\n if (result.error) {\n throw new Error(result.error.message || \"Could not fetch scheduled action.\");\n }\n\n 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 throw err;\n }\n\n return validated.data.data;\n }\n}\n\nexport const GetScheduledActionGateway = GatewayAbstraction.createImplementation({\n implementation: GetScheduledActionGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["GET_SCHEDULED_ACTION_QUERY","SCHEDULER_ENTRY_FIELDS","ERROR_FIELDS","schema","zod","schedulerEntrySchema","GetScheduledActionGatewayImpl","client","params","response","result","Error","validated","err","createZodError","console","GetScheduledActionGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;;;;AAYA,MAAMA,6BAA2C,CAAC;;;;;oBAK9B,EAAEC,uBAAuB;;;oBAGzB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAWD,MAAMC,SAASC,IAAI,MAAM,CAAC;IACtB,MAAMC;AACV;AAEA,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QACFC,MAA+C,EACJ;QAC3C,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA6B;YACnE,OAAOT;YACP,WAAW;gBACP,WAAWQ,OAAO,SAAS;gBAC3B,IAAIA,OAAO,EAAE;YACjB;QACJ;QAEA,MAAME,SAASD,UAAU,WAAW;QACpC,IAAI,CAACC,QACD,MAAM,IAAIC,MAAM;QAGpB,IAAID,OAAO,KAAK,EACZ,MAAM,IAAIC,MAAMD,OAAO,KAAK,CAAC,OAAO,IAAI;QAG5C,IAAI,CAACA,OAAO,IAAI,EACZ,OAAO;QAGX,MAAME,YAAY,MAAMT,OAAO,cAAc,CAACO;QAC9C,IAAI,CAACE,UAAU,OAAO,EAAE;YACpB,MAAMC,MAAMC,eAAeF,UAAU,KAAK;YAC1CG,QAAQ,KAAK,CAACF;YACd,MAAMA;QACV;QAEA,OAAOD,UAAU,IAAI,CAAC,IAAI;IAC9B;AACJ;AAEO,MAAMI,sDAA4BC,0BAAAA,oBAAuC,CAAC;IAC7E,gBAAgBX;IAChB,cAAc;QAACY;KAAkB;AACrC"}
@@ -0,0 +1,13 @@
1
+ import type { SchedulerEntry } from "../../types.js";
2
+ export interface IGetScheduledActionGatewayExecuteParams {
3
+ namespace: string;
4
+ id: string;
5
+ }
6
+ export type IGetScheduledActionGatewayResponse = SchedulerEntry | null;
7
+ export interface IGetScheduledActionGateway {
8
+ execute(params: IGetScheduledActionGatewayExecuteParams): Promise<IGetScheduledActionGatewayResponse>;
9
+ }
10
+ export declare const GetScheduledActionGateway: import("@webiny/di").Abstraction<IGetScheduledActionGateway>;
11
+ export declare namespace GetScheduledActionGateway {
12
+ type Interface = IGetScheduledActionGateway;
13
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const GetScheduledActionGateway = createAbstraction("Scheduler/GetScheduledActionGateway");
3
+ export { GetScheduledActionGateway };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/getScheduledAction/abstractions.js","sources":["../../../src/features/getScheduledAction/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\nexport interface IGetScheduledActionGatewayExecuteParams {\n namespace: string;\n id: string;\n}\n\nexport type IGetScheduledActionGatewayResponse = SchedulerEntry | null;\n\nexport interface IGetScheduledActionGateway {\n execute(\n params: IGetScheduledActionGatewayExecuteParams\n ): Promise<IGetScheduledActionGatewayResponse>;\n}\n\nexport const GetScheduledActionGateway = createAbstraction<IGetScheduledActionGateway>(\n \"Scheduler/GetScheduledActionGateway\"\n);\n\nexport namespace GetScheduledActionGateway {\n export type Interface = IGetScheduledActionGateway;\n}\n"],"names":["GetScheduledActionGateway","createAbstraction"],"mappings":";AAgBO,MAAMA,4BAA4BC,kBACrC"}
@@ -0,0 +1 @@
1
+ export declare const GetScheduledActionFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { GetScheduledActionGateway } from "./GetScheduledActionGateway.js";
3
+ const GetScheduledActionFeature = createFeature({
4
+ name: "Scheduler/GetScheduledAction",
5
+ register (container) {
6
+ container.register(GetScheduledActionGateway).inSingletonScope();
7
+ }
8
+ });
9
+ export { GetScheduledActionFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/getScheduledAction/feature.js","sources":["../../../src/features/getScheduledAction/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { GetScheduledActionGateway } from \"./GetScheduledActionGateway.js\";\n\nexport const GetScheduledActionFeature = createFeature({\n name: \"Scheduler/GetScheduledAction\",\n register(container) {\n container.register(GetScheduledActionGateway).inSingletonScope();\n }\n});\n"],"names":["GetScheduledActionFeature","createFeature","container","GetScheduledActionGateway"],"mappings":";;AAGO,MAAMA,4BAA4BC,cAAc;IACnD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,2BAA2B,gBAAgB;IAClE;AACJ"}
@@ -0,0 +1,2 @@
1
+ export declare const SCHEDULER_ENTRY_FIELDS = "\n id\n targetId\n namespace\n scheduledBy {\n id\n displayName\n type\n }\n publishOn\n unpublishOn\n actionType\n title\n";
2
+ export declare const ERROR_FIELDS = "\n message\n code\n data\n stack\n";
@@ -0,0 +1,23 @@
1
+ const SCHEDULER_ENTRY_FIELDS = `
2
+ id
3
+ targetId
4
+ namespace
5
+ scheduledBy {
6
+ id
7
+ displayName
8
+ type
9
+ }
10
+ publishOn
11
+ unpublishOn
12
+ actionType
13
+ title
14
+ `;
15
+ const ERROR_FIELDS = `
16
+ message
17
+ code
18
+ data
19
+ stack
20
+ `;
21
+ export { ERROR_FIELDS, SCHEDULER_ENTRY_FIELDS };
22
+
23
+ //# sourceMappingURL=graphqlFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlFields.js","sources":["../../src/features/graphqlFields.ts"],"sourcesContent":["export const SCHEDULER_ENTRY_FIELDS = /* GraphQL */ `\n id\n targetId\n namespace\n scheduledBy {\n id\n displayName\n type\n }\n publishOn\n unpublishOn\n actionType\n title\n`;\n\nexport const ERROR_FIELDS = /* GraphQL */ `\n message\n code\n data\n stack\n`;\n"],"names":["SCHEDULER_ENTRY_FIELDS","ERROR_FIELDS"],"mappings":"AAAO,MAAMA,yBAAuC,CAAC;;;;;;;;;;;;;AAarD,CAAC;AAEM,MAAMC,eAA6B,CAAC;;;;;AAK3C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ListScheduledActionsGateway as GatewayAbstraction, type IListScheduledActionsGatewayExecuteParams, type IListScheduledActionsGatewayExecuteResponse } from "./abstractions.js";
3
+ declare class ListScheduledActionsGatewayImpl implements GatewayAbstraction.Interface {
4
+ private client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(params: IListScheduledActionsGatewayExecuteParams): Promise<IListScheduledActionsGatewayExecuteResponse>;
7
+ }
8
+ export declare const ListScheduledActionsGateway: typeof ListScheduledActionsGatewayImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListScheduledActionsGateway>;
10
+ };
11
+ export {};
@@ -0,0 +1,84 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import zod from "zod";
3
+ import { createZodError } from "@webiny/utils/createZodError.js";
4
+ import { schedulerEntrySchema } from "../../domain/schedulerEntry.js";
5
+ import { ERROR_FIELDS, SCHEDULER_ENTRY_FIELDS } from "../graphqlFields.js";
6
+ import { ListScheduledActionsGateway } from "./abstractions.js";
7
+ const LIST_SCHEDULED_ACTIONS_QUERY = `
8
+ query ListScheduledActions(
9
+ $namespace: String!
10
+ $where: ListScheduledActionsWhereInput
11
+ $sort: [ListScheduledActionsSorter!]
12
+ $limit: Int
13
+ $after: String
14
+ ) {
15
+ scheduler {
16
+ listScheduledActions(
17
+ namespace: $namespace
18
+ where: $where
19
+ sort: $sort
20
+ limit: $limit
21
+ after: $after
22
+ ) {
23
+ data {
24
+ ${SCHEDULER_ENTRY_FIELDS}
25
+ }
26
+ meta {
27
+ totalCount
28
+ cursor
29
+ hasMoreItems
30
+ }
31
+ error {
32
+ ${ERROR_FIELDS}
33
+ }
34
+ }
35
+ }
36
+ }
37
+ `;
38
+ const schema = zod.object({
39
+ data: zod.array(schedulerEntrySchema),
40
+ meta: zod.object({
41
+ totalCount: zod.number(),
42
+ cursor: zod.string().nullable(),
43
+ hasMoreItems: zod.boolean()
44
+ })
45
+ });
46
+ class ListScheduledActionsGatewayImpl {
47
+ constructor(client){
48
+ this.client = client;
49
+ }
50
+ async execute(params) {
51
+ const response = await this.client.execute({
52
+ query: LIST_SCHEDULED_ACTIONS_QUERY,
53
+ variables: {
54
+ namespace: params.namespace,
55
+ where: params.where,
56
+ limit: params.limit,
57
+ after: params.after,
58
+ sort: params.sort
59
+ }
60
+ });
61
+ const result = response?.scheduler?.listScheduledActions;
62
+ if (!result) throw new Error("Network error while listing scheduled actions.");
63
+ if (!result.data || !result.meta) throw new Error(result.error?.message || "Could not list schedule actions.");
64
+ const validated = await schema.safeParseAsync(result);
65
+ if (!validated.success) {
66
+ const err = createZodError(validated.error);
67
+ console.error(err);
68
+ throw err;
69
+ }
70
+ return {
71
+ items: validated.data.data,
72
+ meta: validated.data.meta
73
+ };
74
+ }
75
+ }
76
+ const ListScheduledActionsGateway_ListScheduledActionsGateway = ListScheduledActionsGateway.createImplementation({
77
+ implementation: ListScheduledActionsGatewayImpl,
78
+ dependencies: [
79
+ MainGraphQLClient
80
+ ]
81
+ });
82
+ export { ListScheduledActionsGateway_ListScheduledActionsGateway as ListScheduledActionsGateway };
83
+
84
+ //# sourceMappingURL=ListScheduledActionsGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listScheduledActions/ListScheduledActionsGateway.js","sources":["../../../src/features/listScheduledActions/ListScheduledActionsGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils/createZodError.js\";\nimport { schedulerEntrySchema } from \"~/domain/schedulerEntry.js\";\nimport { SCHEDULER_ENTRY_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n ListScheduledActionsGateway as GatewayAbstraction,\n type IListScheduledActionsGatewayExecuteParams,\n type IListScheduledActionsGatewayExecuteResponse\n} from \"./abstractions.js\";\nimport type { SchedulerEntry, SchedulerErrorResponse, SchedulerMetaResponse } from \"~/types.js\";\n\nconst LIST_SCHEDULED_ACTIONS_QUERY = /* GraphQL */ `\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 ${SCHEDULER_ENTRY_FIELDS}\n }\n meta {\n totalCount\n cursor\n hasMoreItems\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\ninterface ListScheduledActionsResponse {\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\nclass ListScheduledActionsGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(\n params: IListScheduledActionsGatewayExecuteParams\n ): Promise<IListScheduledActionsGatewayExecuteResponse> {\n const response = await this.client.execute<ListScheduledActionsResponse>({\n query: LIST_SCHEDULED_ACTIONS_QUERY,\n variables: {\n namespace: params.namespace,\n where: params.where,\n limit: params.limit,\n after: params.after,\n sort: params.sort\n }\n });\n\n const result = response?.scheduler?.listScheduledActions;\n if (!result) {\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\nexport const ListScheduledActionsGateway = GatewayAbstraction.createImplementation({\n implementation: ListScheduledActionsGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["LIST_SCHEDULED_ACTIONS_QUERY","SCHEDULER_ENTRY_FIELDS","ERROR_FIELDS","schema","zod","schedulerEntrySchema","ListScheduledActionsGatewayImpl","client","params","response","result","Error","validated","err","createZodError","console","ListScheduledActionsGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;;;;AAYA,MAAMA,+BAA6C,CAAC;;;;;;;;;;;;;;;;;oBAiBhC,EAAEC,uBAAuB;;;;;;;;oBAQzB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAYD,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;AAEA,MAAME;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QACFC,MAAiD,EACG;QACpD,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA+B;YACrE,OAAOT;YACP,WAAW;gBACP,WAAWQ,OAAO,SAAS;gBAC3B,OAAOA,OAAO,KAAK;gBACnB,OAAOA,OAAO,KAAK;gBACnB,OAAOA,OAAO,KAAK;gBACnB,MAAMA,OAAO,IAAI;YACrB;QACJ;QAEA,MAAME,SAASD,UAAU,WAAW;QACpC,IAAI,CAACC,QACD,MAAM,IAAIC,MAAM;QAGpB,IAAI,CAACD,OAAO,IAAI,IAAI,CAACA,OAAO,IAAI,EAC5B,MAAM,IAAIC,MAAMD,OAAO,KAAK,EAAE,WAAW;QAG7C,MAAME,YAAY,MAAMT,OAAO,cAAc,CAACO;QAC9C,IAAI,CAACE,UAAU,OAAO,EAAE;YACpB,MAAMC,MAAMC,eAAeF,UAAU,KAAK;YAC1CG,QAAQ,KAAK,CAACF;YACd,MAAMA;QACV;QAEA,OAAO;YACH,OAAOD,UAAU,IAAI,CAAC,IAAI;YAC1B,MAAMA,UAAU,IAAI,CAAC,IAAI;QAC7B;IACJ;AACJ;AAEO,MAAMI,0DAA8BC,4BAAAA,oBAAuC,CAAC;IAC/E,gBAAgBX;IAChB,cAAc;QAACY;KAAkB;AACrC"}
@@ -0,0 +1,30 @@
1
+ import type { SchedulerEntry, SchedulerMetaResponse, ScheduleActionType } from "../../types.js";
2
+ export interface IListScheduledActionsExecuteParamsWhere {
3
+ targetId?: string;
4
+ title_contains?: string;
5
+ title_not_contains?: string;
6
+ type?: ScheduleActionType;
7
+ scheduledBy?: string;
8
+ scheduledFor?: Date;
9
+ scheduledFor_gte?: Date;
10
+ scheduledFor_lte?: Date;
11
+ }
12
+ export type IListScheduledActionsExecuteParamsSort = "scheduledFor_ASC" | "scheduledFor_DESC";
13
+ export interface IListScheduledActionsGatewayExecuteParams {
14
+ namespace: string;
15
+ where?: IListScheduledActionsExecuteParamsWhere;
16
+ sort?: IListScheduledActionsExecuteParamsSort[];
17
+ limit?: number;
18
+ after?: string;
19
+ }
20
+ export interface IListScheduledActionsGatewayExecuteResponse {
21
+ items: SchedulerEntry[];
22
+ meta: SchedulerMetaResponse;
23
+ }
24
+ export interface IListScheduledActionsGateway {
25
+ execute(params: IListScheduledActionsGatewayExecuteParams): Promise<IListScheduledActionsGatewayExecuteResponse>;
26
+ }
27
+ export declare const ListScheduledActionsGateway: import("@webiny/di").Abstraction<IListScheduledActionsGateway>;
28
+ export declare namespace ListScheduledActionsGateway {
29
+ type Interface = IListScheduledActionsGateway;
30
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const ListScheduledActionsGateway = createAbstraction("Scheduler/ListScheduledActionsGateway");
3
+ export { ListScheduledActionsGateway };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listScheduledActions/abstractions.js","sources":["../../../src/features/listScheduledActions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { SchedulerEntry, SchedulerMetaResponse, ScheduleActionType } from \"~/types.js\";\n\nexport interface IListScheduledActionsExecuteParamsWhere {\n targetId?: string;\n title_contains?: string;\n title_not_contains?: string;\n type?: ScheduleActionType;\n scheduledBy?: string;\n scheduledFor?: Date;\n scheduledFor_gte?: Date;\n scheduledFor_lte?: Date;\n}\n\nexport type IListScheduledActionsExecuteParamsSort = \"scheduledFor_ASC\" | \"scheduledFor_DESC\";\n\nexport interface IListScheduledActionsGatewayExecuteParams {\n namespace: string;\n where?: IListScheduledActionsExecuteParamsWhere;\n sort?: IListScheduledActionsExecuteParamsSort[];\n limit?: number;\n after?: string;\n}\n\nexport interface IListScheduledActionsGatewayExecuteResponse {\n items: SchedulerEntry[];\n meta: SchedulerMetaResponse;\n}\n\nexport interface IListScheduledActionsGateway {\n execute(\n params: IListScheduledActionsGatewayExecuteParams\n ): Promise<IListScheduledActionsGatewayExecuteResponse>;\n}\n\nexport const ListScheduledActionsGateway = createAbstraction<IListScheduledActionsGateway>(\n \"Scheduler/ListScheduledActionsGateway\"\n);\n\nexport namespace ListScheduledActionsGateway {\n export type Interface = IListScheduledActionsGateway;\n}\n"],"names":["ListScheduledActionsGateway","createAbstraction"],"mappings":";AAmCO,MAAMA,8BAA8BC,kBACvC"}
@@ -0,0 +1 @@
1
+ export declare const ListScheduledActionsFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ListScheduledActionsGateway } from "./ListScheduledActionsGateway.js";
3
+ const ListScheduledActionsFeature = createFeature({
4
+ name: "Scheduler/ListScheduledActions",
5
+ register (container) {
6
+ container.register(ListScheduledActionsGateway).inSingletonScope();
7
+ }
8
+ });
9
+ export { ListScheduledActionsFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listScheduledActions/feature.js","sources":["../../../src/features/listScheduledActions/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListScheduledActionsGateway } from \"./ListScheduledActionsGateway.js\";\n\nexport const ListScheduledActionsFeature = createFeature({\n name: \"Scheduler/ListScheduledActions\",\n register(container) {\n container.register(ListScheduledActionsGateway).inSingletonScope();\n }\n});\n"],"names":["ListScheduledActionsFeature","createFeature","container","ListScheduledActionsGateway"],"mappings":";;AAGO,MAAMA,8BAA8BC,cAAc;IACrD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,6BAA6B,gBAAgB;IACpE;AACJ"}
@@ -0,0 +1,11 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { SchedulePublishActionGateway as GatewayAbstraction, type ISchedulePublishActionGatewayExecuteParams, type ISchedulePublishActionGatewayExecuteResponse } from "./abstractions.js";
3
+ declare class SchedulePublishActionGatewayImpl implements GatewayAbstraction.Interface {
4
+ private client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(params: ISchedulePublishActionGatewayExecuteParams): Promise<ISchedulePublishActionGatewayExecuteResponse>;
7
+ }
8
+ export declare const SchedulePublishActionGateway: typeof SchedulePublishActionGatewayImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ISchedulePublishActionGateway>;
10
+ };
11
+ export {};