@webiny/app-scheduler 6.4.11 → 6.6.0-alpha.1
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.
- package/{Gateways/schema → domain}/schedulerEntry.d.ts +1 -1
- package/{Gateways/schema → domain}/schedulerEntry.js +1 -1
- package/domain/schedulerEntry.js.map +1 -0
- package/features/cancelScheduledAction/CancelScheduledActionGateway.d.ts +11 -0
- package/features/cancelScheduledAction/CancelScheduledActionGateway.js +41 -0
- package/features/cancelScheduledAction/CancelScheduledActionGateway.js.map +1 -0
- package/features/cancelScheduledAction/abstractions.d.ts +11 -0
- package/features/cancelScheduledAction/abstractions.js +5 -0
- package/features/cancelScheduledAction/abstractions.js.map +1 -0
- package/features/cancelScheduledAction/feature.d.ts +1 -0
- package/features/cancelScheduledAction/feature.js +11 -0
- package/features/cancelScheduledAction/feature.js.map +1 -0
- package/features/feature.d.ts +1 -0
- package/features/feature.js +19 -0
- package/features/feature.js.map +1 -0
- package/features/getScheduledAction/GetScheduledActionGateway.d.ts +11 -0
- package/features/getScheduledAction/GetScheduledActionGateway.js +57 -0
- package/features/getScheduledAction/GetScheduledActionGateway.js.map +1 -0
- package/{Gateways/abstractions/GetScheduledActionGateway.d.ts → features/getScheduledAction/abstractions.d.ts} +4 -0
- package/features/getScheduledAction/abstractions.js +5 -0
- package/features/getScheduledAction/abstractions.js.map +1 -0
- package/features/getScheduledAction/feature.d.ts +1 -0
- package/features/getScheduledAction/feature.js +11 -0
- package/features/getScheduledAction/feature.js.map +1 -0
- package/features/graphqlFields.d.ts +2 -0
- package/features/graphqlFields.js +23 -0
- package/features/graphqlFields.js.map +1 -0
- package/features/listScheduledActions/ListScheduledActionsGateway.d.ts +11 -0
- package/features/listScheduledActions/ListScheduledActionsGateway.js +84 -0
- package/features/listScheduledActions/ListScheduledActionsGateway.js.map +1 -0
- package/{Gateways/abstractions/ListScheduledActionsGateway.d.ts → features/listScheduledActions/abstractions.d.ts} +5 -2
- package/features/listScheduledActions/abstractions.js +5 -0
- package/features/listScheduledActions/abstractions.js.map +1 -0
- package/features/listScheduledActions/feature.d.ts +1 -0
- package/features/listScheduledActions/feature.js +11 -0
- package/features/listScheduledActions/feature.js.map +1 -0
- package/features/schedulePublishAction/SchedulePublishActionGateway.d.ts +11 -0
- package/features/schedulePublishAction/SchedulePublishActionGateway.js +67 -0
- package/features/schedulePublishAction/SchedulePublishActionGateway.js.map +1 -0
- package/{Gateways/abstractions/SchedulePublishActionGateway.d.ts → features/schedulePublishAction/abstractions.d.ts} +4 -0
- package/features/schedulePublishAction/abstractions.js +5 -0
- package/features/schedulePublishAction/abstractions.js.map +1 -0
- package/features/schedulePublishAction/feature.d.ts +1 -0
- package/features/schedulePublishAction/feature.js +11 -0
- package/features/schedulePublishAction/feature.js.map +1 -0
- package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.d.ts +11 -0
- package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js +71 -0
- package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js.map +1 -0
- package/{Gateways/abstractions/ScheduleUnpublishActionGateway.d.ts → features/scheduleUnpublishAction/abstractions.d.ts} +4 -0
- package/features/scheduleUnpublishAction/abstractions.js +5 -0
- package/features/scheduleUnpublishAction/abstractions.js.map +1 -0
- package/features/scheduleUnpublishAction/feature.d.ts +1 -0
- package/features/scheduleUnpublishAction/feature.js +11 -0
- package/features/scheduleUnpublishAction/feature.js.map +1 -0
- package/index.d.ts +9 -1
- package/index.js +17 -1
- package/index.js.map +1 -0
- package/package.json +17 -18
- package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.js.map +1 -1
- package/{Presentation → presentation}/components/Actions/CancelItem/CancelItem.js +2 -3
- package/presentation/components/Actions/CancelItem/CancelItem.js.map +1 -0
- package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -1
- package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.js.map +1 -1
- package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellActions/CellActions.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.js +3 -1
- package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -0
- package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellType/CellActionType.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Empty/Empty.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Title/Title.js.map +1 -1
- package/{Presentation → presentation}/components/Title/Title.styled.js.map +1 -1
- package/{Presentation → presentation}/configs/list/Browser/EntryAction.d.ts +2 -1
- package/{Presentation → presentation}/configs/list/Browser/EntryAction.js.map +1 -1
- package/{Presentation → presentation}/configs/list/Browser/Table/Column.d.ts +4 -3
- package/{Presentation → presentation}/configs/list/Browser/Table/Column.js.map +1 -1
- package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.js.map +1 -1
- package/presentation/configs/list/Browser/Table/index.d.ts +19 -0
- package/{Presentation → presentation}/configs/list/Browser/Table/index.js.map +1 -1
- package/presentation/configs/list/Browser/index.d.ts +23 -0
- package/{Presentation → presentation}/configs/list/Browser/index.js.map +1 -1
- package/{Presentation → presentation}/configs/list/SchedulerListConfig.d.ts +8 -6
- package/{Presentation → presentation}/configs/list/SchedulerListConfig.js.map +1 -1
- package/{Presentation → presentation}/hooks/index.d.ts +0 -1
- package/{Presentation → presentation}/hooks/index.js +0 -1
- package/{Presentation → presentation}/hooks/useCancelSchedulerItem.js +12 -7
- package/presentation/hooks/useCancelSchedulerItem.js.map +1 -0
- package/{Presentation → presentation}/hooks/useSchedulerItem.js.map +1 -1
- package/presentation/scheduleDialog/ScheduleDialogPresenter.d.ts +26 -0
- package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/ScheduleDialogPresenter.js +38 -9
- package/presentation/scheduleDialog/ScheduleDialogPresenter.js.map +1 -0
- package/{Presentation/components/ScheduleDialog/IScheduleDialogPresenter.d.ts → presentation/scheduleDialog/abstractions.d.ts} +10 -1
- package/presentation/scheduleDialog/abstractions.js +5 -0
- package/presentation/scheduleDialog/abstractions.js.map +1 -0
- package/presentation/scheduleDialog/components/CancelButtonComponent.d.ts +10 -0
- package/presentation/scheduleDialog/components/CancelButtonComponent.js +20 -0
- package/presentation/scheduleDialog/components/CancelButtonComponent.js.map +1 -0
- package/presentation/scheduleDialog/components/FormComponent.d.ts +9 -0
- package/presentation/scheduleDialog/components/FormComponent.js +32 -0
- package/presentation/scheduleDialog/components/FormComponent.js.map +1 -0
- package/presentation/scheduleDialog/components/ReschedulingAlert.d.ts +7 -0
- package/presentation/scheduleDialog/components/ReschedulingAlert.js +14 -0
- package/presentation/scheduleDialog/components/ReschedulingAlert.js.map +1 -0
- package/{Presentation/components/ScheduleDialog/useScheduleDialog.d.ts → presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.d.ts} +1 -18
- package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js +15 -0
- package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js.map +1 -0
- package/presentation/scheduleDialog/createMinDateValidator.d.ts +7 -0
- package/presentation/scheduleDialog/createMinDateValidator.js +14 -0
- package/presentation/scheduleDialog/createMinDateValidator.js.map +1 -0
- package/presentation/scheduleDialog/feature.d.ts +3 -0
- package/presentation/scheduleDialog/feature.js +17 -0
- package/presentation/scheduleDialog/feature.js.map +1 -0
- package/presentation/scheduleDialog/useScheduleDialog.d.ts +20 -0
- package/presentation/scheduleDialog/useScheduleDialog.js +128 -0
- package/presentation/scheduleDialog/useScheduleDialog.js.map +1 -0
- package/{Presentation/index.d.ts → presentation/schedulerList/Scheduler.d.ts} +2 -9
- package/presentation/schedulerList/Scheduler.js +28 -0
- package/presentation/schedulerList/Scheduler.js.map +1 -0
- package/presentation/schedulerList/SchedulerListDataSource.d.ts +15 -0
- package/presentation/schedulerList/SchedulerListDataSource.js +41 -0
- package/presentation/schedulerList/SchedulerListDataSource.js.map +1 -0
- package/presentation/schedulerList/SchedulerListPresenter.d.ts +21 -0
- package/presentation/schedulerList/SchedulerListPresenter.js +47 -0
- package/presentation/schedulerList/SchedulerListPresenter.js.map +1 -0
- package/presentation/schedulerList/abstractions.d.ts +13 -0
- package/presentation/schedulerList/abstractions.js +5 -0
- package/presentation/schedulerList/abstractions.js.map +1 -0
- package/presentation/schedulerList/components/BottomInfoBar.d.ts +9 -0
- package/presentation/schedulerList/components/BottomInfoBar.js +18 -0
- package/presentation/schedulerList/components/BottomInfoBar.js.map +1 -0
- package/presentation/schedulerList/components/Empty.d.ts +9 -0
- package/{Presentation/components/Empty → presentation/schedulerList/components}/Empty.js +6 -6
- package/presentation/schedulerList/components/Empty.js.map +1 -0
- package/presentation/schedulerList/components/SchedulerListView.d.ts +8 -0
- package/presentation/schedulerList/components/SchedulerListView.js +40 -0
- package/presentation/schedulerList/components/SchedulerListView.js.map +1 -0
- package/presentation/schedulerList/components/SchedulerOverlay.d.ts +11 -0
- package/presentation/schedulerList/components/SchedulerOverlay.js +38 -0
- package/presentation/schedulerList/components/SchedulerOverlay.js.map +1 -0
- package/presentation/schedulerList/components/SchedulerTable.d.ts +9 -0
- package/presentation/schedulerList/components/SchedulerTable.js +48 -0
- package/presentation/schedulerList/components/SchedulerTable.js.map +1 -0
- package/presentation/schedulerList/components/SearchInput.d.ts +9 -0
- package/{Presentation/components/SearchInput → presentation/schedulerList/components}/SearchInput.js +8 -8
- package/presentation/schedulerList/components/SearchInput.js.map +1 -0
- package/presentation/schedulerList/feature.d.ts +3 -0
- package/presentation/schedulerList/feature.js +17 -0
- package/presentation/schedulerList/feature.js.map +1 -0
- package/presentation/schedulerList/useSchedulerListPresenter.d.ts +1 -0
- package/presentation/schedulerList/useSchedulerListPresenter.js +6 -0
- package/presentation/schedulerList/useSchedulerListPresenter.js.map +1 -0
- package/types.d.ts +0 -7
- package/types.js +1 -9
- package/types.js.map +1 -1
- package/Domain/Models/SchedulerItem/SchedulerItem.d.ts +0 -13
- package/Domain/Models/SchedulerItem/SchedulerItem.js +0 -18
- package/Domain/Models/SchedulerItem/SchedulerItem.js.map +0 -1
- package/Domain/Models/SchedulerItem/index.d.ts +0 -1
- package/Domain/Models/SchedulerItem/index.js +0 -1
- package/Domain/Models/index.d.ts +0 -1
- package/Domain/Models/index.js +0 -1
- package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.d.ts +0 -14
- package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.js +0 -0
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.d.ts +0 -36
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js +0 -119
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js.map +0 -1
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.d.ts +0 -19
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js +0 -18
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js.map +0 -1
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.d.ts +0 -17
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js +0 -39
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js.map +0 -1
- package/Domain/Repositories/SchedulerItems/index.d.ts +0 -4
- package/Domain/Repositories/SchedulerItems/index.js +0 -3
- package/Domain/Repositories/Search/ISearchRepository.d.ts +0 -4
- package/Domain/Repositories/Search/ISearchRepository.js +0 -0
- package/Domain/Repositories/Search/SearchRepository.d.ts +0 -7
- package/Domain/Repositories/Search/SearchRepository.js +0 -16
- package/Domain/Repositories/Search/SearchRepository.js.map +0 -1
- package/Domain/Repositories/Search/SearchRepositoryFactory.d.ts +0 -7
- package/Domain/Repositories/Search/SearchRepositoryFactory.js +0 -18
- package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +0 -1
- package/Domain/Repositories/Search/index.d.ts +0 -3
- package/Domain/Repositories/Search/index.js +0 -2
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.d.ts +0 -8
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +0 -0
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.d.ts +0 -12
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +0 -28
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +0 -1
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.d.ts +0 -7
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +0 -18
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +0 -1
- package/Domain/Repositories/SelectedItems/index.d.ts +0 -3
- package/Domain/Repositories/SelectedItems/index.js +0 -2
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.d.ts +0 -8
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +0 -21
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +0 -1
- package/Domain/Repositories/Sorting/index.d.ts +0 -1
- package/Domain/Repositories/Sorting/index.js +0 -1
- package/Domain/Repositories/index.d.ts +0 -4
- package/Domain/Repositories/index.js +0 -4
- package/Domain/index.d.ts +0 -2
- package/Domain/index.js +0 -2
- package/Gateways/SchedulerCancelGraphQLGateway.d.ts +0 -7
- package/Gateways/SchedulerCancelGraphQLGateway.js +0 -42
- package/Gateways/SchedulerCancelGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerGetGraphQLGateway.d.ts +0 -21
- package/Gateways/SchedulerGetGraphQLGateway.js +0 -68
- package/Gateways/SchedulerGetGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerListGraphQLGateway.d.ts +0 -7
- package/Gateways/SchedulerListGraphQLGateway.js +0 -86
- package/Gateways/SchedulerListGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerPublishGraphQLGateway.d.ts +0 -7
- package/Gateways/SchedulerPublishGraphQLGateway.js +0 -59
- package/Gateways/SchedulerPublishGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerUnpublishGraphQLGateway.d.ts +0 -23
- package/Gateways/SchedulerUnpublishGraphQLGateway.js +0 -63
- package/Gateways/SchedulerUnpublishGraphQLGateway.js.map +0 -1
- package/Gateways/abstractions/CancelScheduledActionGateway.d.ts +0 -7
- package/Gateways/abstractions/CancelScheduledActionGateway.js +0 -0
- package/Gateways/abstractions/GetScheduledActionGateway.js +0 -0
- package/Gateways/abstractions/ListScheduledActionsGateway.js +0 -0
- package/Gateways/abstractions/SchedulePublishActionGateway.js +0 -0
- package/Gateways/abstractions/ScheduleUnpublishActionGateway.js +0 -0
- package/Gateways/graphql/fields.d.ts +0 -1
- package/Gateways/graphql/fields.js +0 -17
- package/Gateways/graphql/fields.js.map +0 -1
- package/Gateways/index.d.ts +0 -5
- package/Gateways/index.js +0 -0
- package/Gateways/schema/schedulerEntry.js.map +0 -1
- package/Presentation/Scheduler/Scheduler.d.ts +0 -17
- package/Presentation/Scheduler/Scheduler.js +0 -78
- package/Presentation/Scheduler/Scheduler.js.map +0 -1
- package/Presentation/Scheduler/SchedulerControllers.d.ts +0 -30
- package/Presentation/Scheduler/SchedulerControllers.js +0 -54
- package/Presentation/Scheduler/SchedulerControllers.js.map +0 -1
- package/Presentation/Scheduler/SchedulerPresenter.d.ts +0 -32
- package/Presentation/Scheduler/SchedulerPresenter.js +0 -45
- package/Presentation/Scheduler/SchedulerPresenter.js.map +0 -1
- package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js +0 -12
- package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.js +0 -0
- package/Presentation/Scheduler/controllers/CancelItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/CancelItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/GetItem/GetItemController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/GetItem/GetItemController.js +0 -12
- package/Presentation/Scheduler/controllers/GetItem/GetItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/GetItem/IGetItemController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/GetItem/IGetItemController.js +0 -0
- package/Presentation/Scheduler/controllers/GetItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/GetItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/ListItems/IListItemsController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/ListItems/IListItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/ListItems/ListItemsController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/ListItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/ListItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/ListMoreItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/ListMoreItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.js +0 -0
- package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js +0 -12
- package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/PublishItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/PublishItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js +0 -15
- package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SearchItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SearchItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SelectAllItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SelectAllItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js +0 -14
- package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SelectItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SelectItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.d.ts +0 -9
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js +0 -18
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SortItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SortItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.js +0 -0
- package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js +0 -12
- package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/UnpublishItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/UnpublishItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/UnselectAllItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/UnselectAllItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/index.d.ts +0 -11
- package/Presentation/Scheduler/controllers/index.js +0 -11
- package/Presentation/Scheduler/index.d.ts +0 -1
- package/Presentation/Scheduler/index.js +0 -1
- package/Presentation/SchedulerRenderer/SchedulerRenderer.d.ts +0 -6
- package/Presentation/SchedulerRenderer/SchedulerRenderer.js +0 -16
- package/Presentation/SchedulerRenderer/SchedulerRenderer.js.map +0 -1
- package/Presentation/SchedulerRenderer/index.d.ts +0 -1
- package/Presentation/SchedulerRenderer/index.js +0 -1
- package/Presentation/abstractions/ISchedulerControllers.d.ts +0 -14
- package/Presentation/abstractions/ISchedulerControllers.js +0 -0
- package/Presentation/abstractions/ISchedulerPresenter.d.ts +0 -20
- package/Presentation/abstractions/ISchedulerPresenter.js +0 -0
- package/Presentation/abstractions/index.d.ts +0 -2
- package/Presentation/abstractions/index.js +0 -0
- package/Presentation/components/Actions/CancelItem/CancelItem.js.map +0 -1
- package/Presentation/components/BottomInfoBar/BottomInfoBar.d.ts +0 -2
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js +0 -19
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +0 -1
- package/Presentation/components/BottomInfoBar/index.d.ts +0 -1
- package/Presentation/components/BottomInfoBar/index.js +0 -1
- package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +0 -1
- package/Presentation/components/Empty/Empty.d.ts +0 -2
- package/Presentation/components/Empty/Empty.js.map +0 -1
- package/Presentation/components/Empty/index.d.ts +0 -1
- package/Presentation/components/Empty/index.js +0 -1
- package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js +0 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.d.ts +0 -22
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js.map +0 -1
- package/Presentation/components/ScheduleDialog/index.d.ts +0 -1
- package/Presentation/components/ScheduleDialog/index.js +0 -1
- package/Presentation/components/ScheduleDialog/types.d.ts +0 -15
- package/Presentation/components/ScheduleDialog/types.js +0 -0
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js +0 -192
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +0 -1
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.d.ts +0 -7
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js +0 -30
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js.map +0 -1
- package/Presentation/components/SchedulerOverlay/index.d.ts +0 -1
- package/Presentation/components/SchedulerOverlay/index.js +0 -1
- package/Presentation/components/SearchInput/SearchInput.d.ts +0 -2
- package/Presentation/components/SearchInput/SearchInput.js.map +0 -1
- package/Presentation/components/SearchInput/index.d.ts +0 -1
- package/Presentation/components/SearchInput/index.js +0 -1
- package/Presentation/components/Table/Table.d.ts +0 -2
- package/Presentation/components/Table/Table.js +0 -29
- package/Presentation/components/Table/Table.js.map +0 -1
- package/Presentation/components/Table/index.d.ts +0 -1
- package/Presentation/components/Table/index.js +0 -1
- package/Presentation/configs/list/Browser/Table/index.d.ts +0 -18
- package/Presentation/configs/list/Browser/index.d.ts +0 -23
- package/Presentation/hooks/useCancelSchedulerItem.js.map +0 -1
- package/Presentation/hooks/useScheduler.d.ts +0 -28
- package/Presentation/hooks/useScheduler.js +0 -68
- package/Presentation/hooks/useScheduler.js.map +0 -1
- package/Presentation/index.js +0 -49
- package/Presentation/index.js.map +0 -1
- package/UseCases/CancelItem/CancelItemUseCase.d.ts +0 -7
- package/UseCases/CancelItem/CancelItemUseCase.js +0 -13
- package/UseCases/CancelItem/CancelItemUseCase.js.map +0 -1
- package/UseCases/CancelItem/ICancelItemUseCase.d.ts +0 -3
- package/UseCases/CancelItem/ICancelItemUseCase.js +0 -0
- package/UseCases/CancelItem/index.d.ts +0 -2
- package/UseCases/CancelItem/index.js +0 -1
- package/UseCases/GetItem/GetItemUseCase.d.ts +0 -8
- package/UseCases/GetItem/GetItemUseCase.js +0 -13
- package/UseCases/GetItem/GetItemUseCase.js.map +0 -1
- package/UseCases/GetItem/IGetItemUseCase.d.ts +0 -4
- package/UseCases/GetItem/IGetItemUseCase.js +0 -0
- package/UseCases/GetItem/index.d.ts +0 -2
- package/UseCases/GetItem/index.js +0 -1
- package/UseCases/GetScheduledItem/GetScheduledItemUseCase.d.ts +0 -7
- package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js +0 -14
- package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js.map +0 -1
- package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.d.ts +0 -4
- package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.js +0 -0
- package/UseCases/GetScheduledItem/index.d.ts +0 -2
- package/UseCases/GetScheduledItem/index.js +0 -1
- package/UseCases/ListItems/IListItemsUseCase.d.ts +0 -4
- package/UseCases/ListItems/IListItemsUseCase.js +0 -0
- package/UseCases/ListItems/ListItemsUseCase.d.ts +0 -8
- package/UseCases/ListItems/ListItemsUseCase.js +0 -13
- package/UseCases/ListItems/ListItemsUseCase.js.map +0 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.d.ts +0 -9
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +0 -23
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +0 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.d.ts +0 -9
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +0 -21
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +0 -1
- package/UseCases/ListItems/index.d.ts +0 -4
- package/UseCases/ListItems/index.js +0 -3
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.d.ts +0 -3
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +0 -0
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.d.ts +0 -7
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +0 -13
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +0 -1
- package/UseCases/ListMoreItems/index.d.ts +0 -2
- package/UseCases/ListMoreItems/index.js +0 -1
- package/UseCases/PublishItem/IPublishItemUseCase.d.ts +0 -3
- package/UseCases/PublishItem/IPublishItemUseCase.js +0 -0
- package/UseCases/PublishItem/PublishItemUseCase.d.ts +0 -7
- package/UseCases/PublishItem/PublishItemUseCase.js +0 -13
- package/UseCases/PublishItem/PublishItemUseCase.js.map +0 -1
- package/UseCases/PublishItem/index.d.ts +0 -2
- package/UseCases/PublishItem/index.js +0 -1
- package/UseCases/SearchItems/ISearchItemsUseCase.d.ts +0 -3
- package/UseCases/SearchItems/ISearchItemsUseCase.js +0 -0
- package/UseCases/SearchItems/SearchItemsUseCase.d.ts +0 -7
- package/UseCases/SearchItems/SearchItemsUseCase.js +0 -13
- package/UseCases/SearchItems/SearchItemsUseCase.js.map +0 -1
- package/UseCases/SearchItems/index.d.ts +0 -2
- package/UseCases/SearchItems/index.js +0 -1
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.d.ts +0 -3
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +0 -0
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.d.ts +0 -7
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +0 -13
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +0 -1
- package/UseCases/SelectAllItems/index.d.ts +0 -2
- package/UseCases/SelectAllItems/index.js +0 -1
- package/UseCases/SelectItems/ISelectItemsUseCase.d.ts +0 -4
- package/UseCases/SelectItems/ISelectItemsUseCase.js +0 -0
- package/UseCases/SelectItems/SelectItemsUseCase.d.ts +0 -7
- package/UseCases/SelectItems/SelectItemsUseCase.js +0 -13
- package/UseCases/SelectItems/SelectItemsUseCase.js.map +0 -1
- package/UseCases/SelectItems/index.d.ts +0 -2
- package/UseCases/SelectItems/index.js +0 -1
- package/UseCases/SortItems/ISortItemsUseCase.d.ts +0 -4
- package/UseCases/SortItems/ISortItemsUseCase.js +0 -0
- package/UseCases/SortItems/SortItemsUseCase.d.ts +0 -7
- package/UseCases/SortItems/SortItemsUseCase.js +0 -13
- package/UseCases/SortItems/SortItemsUseCase.js.map +0 -1
- package/UseCases/SortItems/index.d.ts +0 -2
- package/UseCases/SortItems/index.js +0 -1
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.d.ts +0 -3
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +0 -0
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.d.ts +0 -7
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +0 -13
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +0 -1
- package/UseCases/UnSelectAllItems/index.d.ts +0 -2
- package/UseCases/UnSelectAllItems/index.js +0 -1
- package/UseCases/UnpublishItem/IUnpublishItemUseCase.d.ts +0 -3
- package/UseCases/UnpublishItem/IUnpublishItemUseCase.js +0 -0
- package/UseCases/UnpublishItem/UnpublishItemUseCase.d.ts +0 -7
- package/UseCases/UnpublishItem/UnpublishItemUseCase.js +0 -13
- package/UseCases/UnpublishItem/UnpublishItemUseCase.js.map +0 -1
- package/UseCases/UnpublishItem/index.d.ts +0 -2
- package/UseCases/UnpublishItem/index.js +0 -1
- package/UseCases/index.d.ts +0 -11
- package/UseCases/index.js +0 -11
- /package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.d.ts +0 -0
- /package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.js +0 -0
- /package/{Presentation → presentation}/SchedulerConfigs/index.d.ts +0 -0
- /package/{Presentation → presentation}/SchedulerConfigs/index.js +0 -0
- /package/{Presentation → presentation}/components/Actions/CancelItem/CancelItem.d.ts +0 -0
- /package/{Presentation → presentation}/components/Actions/CancelItem/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Actions/CancelItem/index.js +0 -0
- /package/{Presentation → presentation}/components/Actions/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Actions/index.js +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.js +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.d.ts +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.js +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.d.ts +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/CellActions.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/CellActions.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/index.js +0 -0
- /package/{Presentation → presentation}/components/Empty/Empty.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Empty/Empty.styled.js +0 -0
- /package/{Presentation → presentation}/components/Title/Title.d.ts +0 -0
- /package/{Presentation → presentation}/components/Title/Title.js +0 -0
- /package/{Presentation → presentation}/components/Title/Title.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Title/Title.styled.js +0 -0
- /package/{Presentation → presentation}/components/Title/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Title/index.js +0 -0
- /package/{Presentation → presentation}/configs/index.d.ts +0 -0
- /package/{Presentation → presentation}/configs/index.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/EntryAction.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/Column.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.d.ts +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/index.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/index.js +0 -0
- /package/{Presentation → presentation}/configs/list/SchedulerListConfig.js +0 -0
- /package/{Presentation → presentation}/configs/list/index.d.ts +0 -0
- /package/{Presentation → presentation}/configs/list/index.js +0 -0
- /package/{Presentation → presentation}/hooks/useCancelSchedulerItem.d.ts +0 -0
- /package/{Presentation → presentation}/hooks/useSchedulerItem.d.ts +0 -0
- /package/{Presentation → presentation}/hooks/useSchedulerItem.js +0 -0
|
@@ -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 @@
|
|
|
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"}
|
|
@@ -7,3 +7,7 @@ export type IGetScheduledActionGatewayResponse = SchedulerEntry | null;
|
|
|
7
7
|
export interface IGetScheduledActionGateway {
|
|
8
8
|
execute(params: IGetScheduledActionGatewayExecuteParams): Promise<IGetScheduledActionGatewayResponse>;
|
|
9
9
|
}
|
|
10
|
+
export declare const GetScheduledActionGateway: import("@webiny/di").Abstraction<IGetScheduledActionGateway>;
|
|
11
|
+
export declare namespace GetScheduledActionGateway {
|
|
12
|
+
type Interface = IGetScheduledActionGateway;
|
|
13
|
+
}
|
|
@@ -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,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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { SchedulerEntry, SchedulerMetaResponse } from "../../types.js";
|
|
2
|
-
import type { ScheduleActionType } from "../../types.js";
|
|
1
|
+
import type { SchedulerEntry, SchedulerMetaResponse, ScheduleActionType } from "../../types.js";
|
|
3
2
|
export interface IListScheduledActionsExecuteParamsWhere {
|
|
4
3
|
targetId?: string;
|
|
5
4
|
title_contains?: string;
|
|
@@ -25,3 +24,7 @@ export interface IListScheduledActionsGatewayExecuteResponse {
|
|
|
25
24
|
export interface IListScheduledActionsGateway {
|
|
26
25
|
execute(params: IListScheduledActionsGatewayExecuteParams): Promise<IListScheduledActionsGatewayExecuteResponse>;
|
|
27
26
|
}
|
|
27
|
+
export declare const ListScheduledActionsGateway: import("@webiny/di").Abstraction<IListScheduledActionsGateway>;
|
|
28
|
+
export declare namespace ListScheduledActionsGateway {
|
|
29
|
+
type Interface = IListScheduledActionsGateway;
|
|
30
|
+
}
|
|
@@ -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 {};
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { SchedulePublishActionGateway } from "./abstractions.js";
|
|
7
|
+
import { ScheduleActionType } from "../../types.js";
|
|
8
|
+
const SCHEDULE_PUBLISH_ACTION_MUTATION = `
|
|
9
|
+
mutation CreateSchedulePublishAction(
|
|
10
|
+
$namespace: String!
|
|
11
|
+
$targetId: ID!
|
|
12
|
+
$scheduleFor: DateTime
|
|
13
|
+
$actionType: ScheduleRecordType!
|
|
14
|
+
) {
|
|
15
|
+
scheduler {
|
|
16
|
+
scheduleAction(
|
|
17
|
+
namespace: $namespace
|
|
18
|
+
targetId: $targetId
|
|
19
|
+
scheduleFor: $scheduleFor
|
|
20
|
+
actionType: $actionType
|
|
21
|
+
) {
|
|
22
|
+
data {
|
|
23
|
+
${SCHEDULER_ENTRY_FIELDS}
|
|
24
|
+
}
|
|
25
|
+
error {
|
|
26
|
+
${ERROR_FIELDS}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const schema = zod.object({
|
|
33
|
+
data: schedulerEntrySchema
|
|
34
|
+
});
|
|
35
|
+
class SchedulePublishActionGatewayImpl {
|
|
36
|
+
constructor(client){
|
|
37
|
+
this.client = client;
|
|
38
|
+
}
|
|
39
|
+
async execute(params) {
|
|
40
|
+
const response = await this.client.execute({
|
|
41
|
+
query: SCHEDULE_PUBLISH_ACTION_MUTATION,
|
|
42
|
+
variables: {
|
|
43
|
+
namespace: params.namespace,
|
|
44
|
+
targetId: params.targetId,
|
|
45
|
+
scheduleFor: params.scheduleOn,
|
|
46
|
+
actionType: ScheduleActionType.publish
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const result = response?.scheduler?.scheduleAction;
|
|
50
|
+
if (!result) throw new Error("Network error while scheduling an action.");
|
|
51
|
+
if (!result.data) throw new Error(result.error?.message || "Could execute schedule publish action.");
|
|
52
|
+
const validated = await schema.safeParseAsync(result);
|
|
53
|
+
if (!validated.success) throw createZodError(validated.error);
|
|
54
|
+
return {
|
|
55
|
+
item: validated.data.data
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const SchedulePublishActionGateway_SchedulePublishActionGateway = SchedulePublishActionGateway.createImplementation({
|
|
60
|
+
implementation: SchedulePublishActionGatewayImpl,
|
|
61
|
+
dependencies: [
|
|
62
|
+
MainGraphQLClient
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
export { SchedulePublishActionGateway_SchedulePublishActionGateway as SchedulePublishActionGateway };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=SchedulePublishActionGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/schedulePublishAction/SchedulePublishActionGateway.js","sources":["../../../src/features/schedulePublishAction/SchedulePublishActionGateway.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 SchedulePublishActionGateway as GatewayAbstraction,\n type ISchedulePublishActionGatewayExecuteParams,\n type ISchedulePublishActionGatewayExecuteResponse\n} from \"./abstractions.js\";\nimport { type SchedulerEntry, type SchedulerErrorResponse, ScheduleActionType } from \"~/types.js\";\n\nconst SCHEDULE_PUBLISH_ACTION_MUTATION = /* GraphQL */ `\n mutation CreateSchedulePublishAction(\n $namespace: String!\n $targetId: ID!\n $scheduleFor: DateTime\n $actionType: ScheduleRecordType!\n ) {\n scheduler {\n scheduleAction(\n namespace: $namespace\n targetId: $targetId\n scheduleFor: $scheduleFor\n actionType: $actionType\n ) {\n data {\n ${SCHEDULER_ENTRY_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\ninterface SchedulePublishActionResponse {\n scheduler: {\n scheduleAction: {\n data: SchedulerEntry | null;\n error: SchedulerErrorResponse | null;\n };\n };\n}\n\nconst schema = zod.object({\n data: schedulerEntrySchema\n});\n\nclass SchedulePublishActionGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(\n params: ISchedulePublishActionGatewayExecuteParams\n ): Promise<ISchedulePublishActionGatewayExecuteResponse> {\n const response = await this.client.execute<SchedulePublishActionResponse>({\n query: SCHEDULE_PUBLISH_ACTION_MUTATION,\n variables: {\n namespace: params.namespace,\n targetId: params.targetId,\n scheduleFor: params.scheduleOn,\n actionType: ScheduleActionType.publish\n }\n });\n\n const result = response?.scheduler?.scheduleAction;\n if (!result) {\n throw new Error(\"Network error while scheduling an action.\");\n }\n\n if (!result.data) {\n throw new Error(result.error?.message || \"Could execute schedule publish action.\");\n }\n\n const validated = await schema.safeParseAsync(result);\n if (!validated.success) {\n throw createZodError(validated.error);\n }\n\n return {\n item: validated.data.data\n };\n }\n}\n\nexport const SchedulePublishActionGateway = GatewayAbstraction.createImplementation({\n implementation: SchedulePublishActionGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["SCHEDULE_PUBLISH_ACTION_MUTATION","SCHEDULER_ENTRY_FIELDS","ERROR_FIELDS","schema","zod","schedulerEntrySchema","SchedulePublishActionGatewayImpl","client","params","response","ScheduleActionType","result","Error","validated","createZodError","SchedulePublishActionGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;;;;;AAYA,MAAMA,mCAAiD,CAAC;;;;;;;;;;;;;;;oBAepC,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,MAAkD,EACG;QACrD,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAgC;YACtE,OAAOT;YACP,WAAW;gBACP,WAAWQ,OAAO,SAAS;gBAC3B,UAAUA,OAAO,QAAQ;gBACzB,aAAaA,OAAO,UAAU;gBAC9B,YAAYE,mBAAmB,OAAO;YAC1C;QACJ;QAEA,MAAMC,SAASF,UAAU,WAAW;QACpC,IAAI,CAACE,QACD,MAAM,IAAIC,MAAM;QAGpB,IAAI,CAACD,OAAO,IAAI,EACZ,MAAM,IAAIC,MAAMD,OAAO,KAAK,EAAE,WAAW;QAG7C,MAAME,YAAY,MAAMV,OAAO,cAAc,CAACQ;QAC9C,IAAI,CAACE,UAAU,OAAO,EAClB,MAAMC,eAAeD,UAAU,KAAK;QAGxC,OAAO;YACH,MAAMA,UAAU,IAAI,CAAC,IAAI;QAC7B;IACJ;AACJ;AAEO,MAAME,4DAA+BC,6BAAAA,oBAAuC,CAAC;IAChF,gBAAgBV;IAChB,cAAc;QAACW;KAAkB;AACrC"}
|
|
@@ -10,3 +10,7 @@ export interface ISchedulePublishActionGatewayExecuteResponse {
|
|
|
10
10
|
export interface ISchedulePublishActionGateway {
|
|
11
11
|
execute(params: ISchedulePublishActionGatewayExecuteParams): Promise<ISchedulePublishActionGatewayExecuteResponse>;
|
|
12
12
|
}
|
|
13
|
+
export declare const SchedulePublishActionGateway: import("@webiny/di").Abstraction<ISchedulePublishActionGateway>;
|
|
14
|
+
export declare namespace SchedulePublishActionGateway {
|
|
15
|
+
type Interface = ISchedulePublishActionGateway;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/schedulePublishAction/abstractions.js","sources":["../../../src/features/schedulePublishAction/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\nexport interface ISchedulePublishActionGatewayExecuteParams {\n namespace: string;\n targetId: string;\n scheduleOn: Date;\n}\n\nexport interface ISchedulePublishActionGatewayExecuteResponse {\n item: SchedulerEntry;\n}\n\nexport interface ISchedulePublishActionGateway {\n execute(\n params: ISchedulePublishActionGatewayExecuteParams\n ): Promise<ISchedulePublishActionGatewayExecuteResponse>;\n}\n\nexport const SchedulePublishActionGateway = createAbstraction<ISchedulePublishActionGateway>(\n \"Scheduler/SchedulePublishActionGateway\"\n);\n\nexport namespace SchedulePublishActionGateway {\n export type Interface = ISchedulePublishActionGateway;\n}\n"],"names":["SchedulePublishActionGateway","createAbstraction"],"mappings":";AAmBO,MAAMA,+BAA+BC,kBACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SchedulePublishActionFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { SchedulePublishActionGateway } from "./SchedulePublishActionGateway.js";
|
|
3
|
+
const SchedulePublishActionFeature = createFeature({
|
|
4
|
+
name: "Scheduler/SchedulePublishAction",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(SchedulePublishActionGateway).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { SchedulePublishActionFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/schedulePublishAction/feature.js","sources":["../../../src/features/schedulePublishAction/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { SchedulePublishActionGateway } from \"./SchedulePublishActionGateway.js\";\n\nexport const SchedulePublishActionFeature = createFeature({\n name: \"Scheduler/SchedulePublishAction\",\n register(container) {\n container.register(SchedulePublishActionGateway).inSingletonScope();\n }\n});\n"],"names":["SchedulePublishActionFeature","createFeature","container","SchedulePublishActionGateway"],"mappings":";;AAGO,MAAMA,+BAA+BC,cAAc;IACtD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,8BAA8B,gBAAgB;IACrE;AACJ"}
|