@webiny/api-workflows 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.
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/WorkflowsFeature.d.ts +5 -0
- package/WorkflowsFeature.js +17 -0
- package/WorkflowsFeature.js.map +1 -0
- package/WorkflowsInitializer.d.ts +19 -0
- package/WorkflowsInitializer.js +97 -0
- package/WorkflowsInitializer.js.map +1 -0
- package/WorkflowsSchemaFactory.d.ts +8 -0
- package/WorkflowsSchemaFactory.js +19 -0
- package/WorkflowsSchemaFactory.js.map +1 -0
- package/constants.d.ts +3 -0
- package/constants.js +6 -0
- package/constants.js.map +1 -0
- package/domain/notifications/abstractions.d.ts +64 -0
- package/domain/notifications/abstractions.js +11 -0
- package/domain/notifications/abstractions.js.map +1 -0
- package/domain/notifications/errors.d.ts +5 -0
- package/domain/notifications/errors.js +11 -0
- package/domain/notifications/errors.js.map +1 -0
- package/domain/workflow/WorkflowMapper.d.ts +12 -0
- package/domain/workflow/WorkflowMapper.js +28 -0
- package/domain/workflow/WorkflowMapper.js.map +1 -0
- package/domain/workflow/abstractions.d.ts +37 -0
- package/domain/workflow/abstractions.js +6 -0
- package/domain/workflow/abstractions.js.map +1 -0
- package/domain/workflow/errors.d.ts +23 -0
- package/domain/workflow/errors.js +33 -0
- package/domain/workflow/errors.js.map +1 -0
- package/domain/workflow/workflowModel.d.ts +9 -0
- package/domain/workflow/workflowModel.js +34 -0
- package/domain/workflow/workflowModel.js.map +1 -0
- package/domain/workflowState/WorkflowState.d.ts +56 -0
- package/domain/workflowState/WorkflowState.js +227 -0
- package/domain/workflowState/WorkflowState.js.map +1 -0
- package/domain/workflowState/WorkflowStateMapper.d.ts +9 -0
- package/domain/workflowState/WorkflowStateMapper.js +43 -0
- package/domain/workflowState/WorkflowStateMapper.js.map +1 -0
- package/domain/workflowState/abstractions.d.ts +78 -0
- package/domain/workflowState/abstractions.js +13 -0
- package/domain/workflowState/abstractions.js.map +1 -0
- package/domain/workflowState/errors.d.ts +86 -0
- package/domain/workflowState/errors.js +126 -0
- package/domain/workflowState/errors.js.map +1 -0
- package/domain/workflowState/guards/canReview.d.ts +2 -0
- package/domain/workflowState/guards/canReview.js +4 -0
- package/domain/workflowState/guards/canReview.js.map +1 -0
- package/domain/workflowState/guards/canTakeOver.d.ts +2 -0
- package/domain/workflowState/guards/canTakeOver.js +4 -0
- package/domain/workflowState/guards/canTakeOver.js.map +1 -0
- package/domain/workflowState/guards/isInReview.d.ts +2 -0
- package/domain/workflowState/guards/isInReview.js +5 -0
- package/domain/workflowState/guards/isInReview.js.map +1 -0
- package/domain/workflowState/guards/isRejected.d.ts +2 -0
- package/domain/workflowState/guards/isRejected.js +5 -0
- package/domain/workflowState/guards/isRejected.js.map +1 -0
- package/domain/workflowState/guards/isStepOwner.d.ts +2 -0
- package/domain/workflowState/guards/isStepOwner.js +4 -0
- package/domain/workflowState/guards/isStepOwner.js.map +1 -0
- package/domain/workflowState/stateModel.d.ts +9 -0
- package/domain/workflowState/stateModel.js +67 -0
- package/domain/workflowState/stateModel.js.map +1 -0
- package/features/internal/GetUserTeams/GetUserTeamsUseCase.d.ts +12 -0
- package/features/internal/GetUserTeams/GetUserTeamsUseCase.js +29 -0
- package/features/internal/GetUserTeams/GetUserTeamsUseCase.js.map +1 -0
- package/features/internal/GetUserTeams/abstractions.d.ts +10 -0
- package/features/internal/GetUserTeams/abstractions.js +5 -0
- package/features/internal/GetUserTeams/abstractions.js.map +1 -0
- package/features/internal/GetUserTeams/feature.d.ts +4 -0
- package/features/internal/GetUserTeams/feature.js +11 -0
- package/features/internal/GetUserTeams/feature.js.map +1 -0
- package/features/internal/GetUserTeams/index.d.ts +1 -0
- package/features/internal/GetUserTeams/index.js +1 -0
- package/features/notifications/ListNotificationTypes/ListNotificationTypesRepository.d.ts +11 -0
- package/features/notifications/ListNotificationTypes/ListNotificationTypesRepository.js +28 -0
- package/features/notifications/ListNotificationTypes/ListNotificationTypesRepository.js.map +1 -0
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.d.ts +13 -0
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.js +34 -0
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.js.map +1 -0
- package/features/notifications/ListNotificationTypes/abstractions.d.ts +31 -0
- package/features/notifications/ListNotificationTypes/abstractions.js +6 -0
- package/features/notifications/ListNotificationTypes/abstractions.js.map +1 -0
- package/features/notifications/ListNotificationTypes/feature.d.ts +4 -0
- package/features/notifications/ListNotificationTypes/feature.js +13 -0
- package/features/notifications/ListNotificationTypes/feature.js.map +1 -0
- package/features/notifications/ListNotificationTypes/index.d.ts +3 -0
- package/features/notifications/ListNotificationTypes/index.js +2 -0
- package/features/notifications/NotificationTransport/MailNotificationTransport.d.ts +13 -0
- package/features/notifications/NotificationTransport/MailNotificationTransport.js +38 -0
- package/features/notifications/NotificationTransport/MailNotificationTransport.js.map +1 -0
- package/features/notifications/NotificationTransport/abstractions.d.ts +21 -0
- package/features/notifications/NotificationTransport/abstractions.js +5 -0
- package/features/notifications/NotificationTransport/abstractions.js.map +1 -0
- package/features/notifications/NotificationTransport/feature.d.ts +4 -0
- package/features/notifications/NotificationTransport/feature.js +11 -0
- package/features/notifications/NotificationTransport/feature.js.map +1 -0
- package/features/notifications/NotificationTransport/index.d.ts +3 -0
- package/features/notifications/NotificationTransport/index.js +2 -0
- package/features/shared/abstractions.d.ts +21 -0
- package/features/shared/abstractions.js +0 -0
- package/features/workflow/CreateWorkflow/CreateWorkflowRepository.d.ts +14 -0
- package/features/workflow/CreateWorkflow/CreateWorkflowRepository.js +46 -0
- package/features/workflow/CreateWorkflow/CreateWorkflowRepository.js.map +1 -0
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.d.ts +15 -0
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.js +52 -0
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.js.map +1 -0
- package/features/workflow/CreateWorkflow/abstractions.d.ts +56 -0
- package/features/workflow/CreateWorkflow/abstractions.js +6 -0
- package/features/workflow/CreateWorkflow/abstractions.js.map +1 -0
- package/features/workflow/CreateWorkflow/events.d.ts +21 -0
- package/features/workflow/CreateWorkflow/events.js +23 -0
- package/features/workflow/CreateWorkflow/events.js.map +1 -0
- package/features/workflow/CreateWorkflow/feature.d.ts +4 -0
- package/features/workflow/CreateWorkflow/feature.js +13 -0
- package/features/workflow/CreateWorkflow/feature.js.map +1 -0
- package/features/workflow/CreateWorkflow/index.d.ts +4 -0
- package/features/workflow/CreateWorkflow/index.js +3 -0
- package/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.d.ts +13 -0
- package/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.js +35 -0
- package/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.js.map +1 -0
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.d.ts +17 -0
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.js +53 -0
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.js.map +1 -0
- package/features/workflow/DeleteWorkflow/abstractions.d.ts +50 -0
- package/features/workflow/DeleteWorkflow/abstractions.js +6 -0
- package/features/workflow/DeleteWorkflow/abstractions.js.map +1 -0
- package/features/workflow/DeleteWorkflow/events.d.ts +21 -0
- package/features/workflow/DeleteWorkflow/events.js +23 -0
- package/features/workflow/DeleteWorkflow/events.js.map +1 -0
- package/features/workflow/DeleteWorkflow/feature.d.ts +4 -0
- package/features/workflow/DeleteWorkflow/feature.js +13 -0
- package/features/workflow/DeleteWorkflow/feature.js.map +1 -0
- package/features/workflow/DeleteWorkflow/index.d.ts +4 -0
- package/features/workflow/DeleteWorkflow/index.js +3 -0
- package/features/workflow/GetWorkflow/GetWorkflowRepository.d.ts +14 -0
- package/features/workflow/GetWorkflow/GetWorkflowRepository.js +45 -0
- package/features/workflow/GetWorkflow/GetWorkflowRepository.js.map +1 -0
- package/features/workflow/GetWorkflow/GetWorkflowUseCase.d.ts +13 -0
- package/features/workflow/GetWorkflow/GetWorkflowUseCase.js +32 -0
- package/features/workflow/GetWorkflow/GetWorkflowUseCase.js.map +1 -0
- package/features/workflow/GetWorkflow/abstractions.d.ts +45 -0
- package/features/workflow/GetWorkflow/abstractions.js +6 -0
- package/features/workflow/GetWorkflow/abstractions.js.map +1 -0
- package/features/workflow/GetWorkflow/feature.d.ts +4 -0
- package/features/workflow/GetWorkflow/feature.js +13 -0
- package/features/workflow/GetWorkflow/feature.js.map +1 -0
- package/features/workflow/GetWorkflow/index.d.ts +1 -0
- package/features/workflow/GetWorkflow/index.js +1 -0
- package/features/workflow/ListWorkflows/ListWorkflowsRepository.d.ts +18 -0
- package/features/workflow/ListWorkflows/ListWorkflowsRepository.js +62 -0
- package/features/workflow/ListWorkflows/ListWorkflowsRepository.js.map +1 -0
- package/features/workflow/ListWorkflows/ListWorkflowsUseCase.d.ts +10 -0
- package/features/workflow/ListWorkflows/ListWorkflowsUseCase.js +21 -0
- package/features/workflow/ListWorkflows/ListWorkflowsUseCase.js.map +1 -0
- package/features/workflow/ListWorkflows/abstractions.d.ts +60 -0
- package/features/workflow/ListWorkflows/abstractions.js +6 -0
- package/features/workflow/ListWorkflows/abstractions.js.map +1 -0
- package/features/workflow/ListWorkflows/feature.d.ts +4 -0
- package/features/workflow/ListWorkflows/feature.js +13 -0
- package/features/workflow/ListWorkflows/feature.js.map +1 -0
- package/features/workflow/ListWorkflows/index.d.ts +1 -0
- package/features/workflow/ListWorkflows/index.js +1 -0
- package/features/workflow/StoreWorkflow/StoreWorkflowUseCase.d.ts +15 -0
- package/features/workflow/StoreWorkflow/StoreWorkflowUseCase.js +35 -0
- package/features/workflow/StoreWorkflow/StoreWorkflowUseCase.js.map +1 -0
- package/features/workflow/StoreWorkflow/abstractions.d.ts +32 -0
- package/features/workflow/StoreWorkflow/abstractions.js +5 -0
- package/features/workflow/StoreWorkflow/abstractions.js.map +1 -0
- package/features/workflow/StoreWorkflow/feature.d.ts +4 -0
- package/features/workflow/StoreWorkflow/feature.js +15 -0
- package/features/workflow/StoreWorkflow/feature.js.map +1 -0
- package/features/workflow/StoreWorkflow/index.d.ts +3 -0
- package/features/workflow/StoreWorkflow/index.js +2 -0
- package/features/workflow/UpdateWorkflow/UpdateWorkflowRepository.d.ts +15 -0
- package/features/workflow/UpdateWorkflow/UpdateWorkflowRepository.js +50 -0
- package/features/workflow/UpdateWorkflow/UpdateWorkflowRepository.js.map +1 -0
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.d.ts +15 -0
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.js +54 -0
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.js.map +1 -0
- package/features/workflow/UpdateWorkflow/abstractions.d.ts +57 -0
- package/features/workflow/UpdateWorkflow/abstractions.js +6 -0
- package/features/workflow/UpdateWorkflow/abstractions.js.map +1 -0
- package/features/workflow/UpdateWorkflow/events.d.ts +21 -0
- package/features/workflow/UpdateWorkflow/events.js +23 -0
- package/features/workflow/UpdateWorkflow/events.js.map +1 -0
- package/features/workflow/UpdateWorkflow/feature.d.ts +4 -0
- package/features/workflow/UpdateWorkflow/feature.js +13 -0
- package/features/workflow/UpdateWorkflow/feature.js.map +1 -0
- package/features/workflow/UpdateWorkflow/index.d.ts +4 -0
- package/features/workflow/UpdateWorkflow/index.js +3 -0
- package/features/workflowState/ApproveWorkflowStateStep/ApproveWorkflowStateStepUseCase.d.ts +15 -0
- package/features/workflowState/ApproveWorkflowStateStep/ApproveWorkflowStateStepUseCase.js +38 -0
- package/features/workflowState/ApproveWorkflowStateStep/ApproveWorkflowStateStepUseCase.js.map +1 -0
- package/features/workflowState/ApproveWorkflowStateStep/abstractions.d.ts +26 -0
- package/features/workflowState/ApproveWorkflowStateStep/abstractions.js +5 -0
- package/features/workflowState/ApproveWorkflowStateStep/abstractions.js.map +1 -0
- package/features/workflowState/ApproveWorkflowStateStep/events.d.ts +12 -0
- package/features/workflowState/ApproveWorkflowStateStep/events.js +14 -0
- package/features/workflowState/ApproveWorkflowStateStep/events.js.map +1 -0
- package/features/workflowState/ApproveWorkflowStateStep/feature.d.ts +4 -0
- package/features/workflowState/ApproveWorkflowStateStep/feature.js +11 -0
- package/features/workflowState/ApproveWorkflowStateStep/feature.js.map +1 -0
- package/features/workflowState/ApproveWorkflowStateStep/index.d.ts +2 -0
- package/features/workflowState/ApproveWorkflowStateStep/index.js +2 -0
- package/features/workflowState/CancelWorkflowState/CancelWorkflowStateUseCase.d.ts +13 -0
- package/features/workflowState/CancelWorkflowState/CancelWorkflowStateUseCase.js +31 -0
- package/features/workflowState/CancelWorkflowState/CancelWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/CancelWorkflowState/abstractions.d.ts +26 -0
- package/features/workflowState/CancelWorkflowState/abstractions.js +5 -0
- package/features/workflowState/CancelWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/CancelWorkflowState/events.d.ts +12 -0
- package/features/workflowState/CancelWorkflowState/events.js +14 -0
- package/features/workflowState/CancelWorkflowState/events.js.map +1 -0
- package/features/workflowState/CancelWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/CancelWorkflowState/feature.js +11 -0
- package/features/workflowState/CancelWorkflowState/feature.js.map +1 -0
- package/features/workflowState/CancelWorkflowState/index.d.ts +2 -0
- package/features/workflowState/CancelWorkflowState/index.js +2 -0
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateRepository.d.ts +14 -0
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateRepository.js +35 -0
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateRepository.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.d.ts +22 -0
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.js +104 -0
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/DefaultWorkflowStateContextProvider.d.ts +9 -0
- package/features/workflowState/CreateWorkflowState/DefaultWorkflowStateContextProvider.js +13 -0
- package/features/workflowState/CreateWorkflowState/DefaultWorkflowStateContextProvider.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/WorkflowStateContextProvider.d.ts +13 -0
- package/features/workflowState/CreateWorkflowState/WorkflowStateContextProvider.js +5 -0
- package/features/workflowState/CreateWorkflowState/WorkflowStateContextProvider.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/abstractions.d.ts +54 -0
- package/features/workflowState/CreateWorkflowState/abstractions.js +6 -0
- package/features/workflowState/CreateWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/events.d.ts +12 -0
- package/features/workflowState/CreateWorkflowState/events.js +14 -0
- package/features/workflowState/CreateWorkflowState/events.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/CreateWorkflowState/feature.js +15 -0
- package/features/workflowState/CreateWorkflowState/feature.js.map +1 -0
- package/features/workflowState/CreateWorkflowState/index.d.ts +3 -0
- package/features/workflowState/CreateWorkflowState/index.js +3 -0
- package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.d.ts +21 -0
- package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.js +61 -0
- package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/DeleteTargetWorkflowState/abstractions.d.ts +23 -0
- package/features/workflowState/DeleteTargetWorkflowState/abstractions.js +5 -0
- package/features/workflowState/DeleteTargetWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/DeleteTargetWorkflowState/events.d.ts +12 -0
- package/features/workflowState/DeleteTargetWorkflowState/events.js +14 -0
- package/features/workflowState/DeleteTargetWorkflowState/events.js.map +1 -0
- package/features/workflowState/DeleteTargetWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/DeleteTargetWorkflowState/feature.js +11 -0
- package/features/workflowState/DeleteTargetWorkflowState/feature.js.map +1 -0
- package/features/workflowState/DeleteTargetWorkflowState/index.d.ts +2 -0
- package/features/workflowState/DeleteTargetWorkflowState/index.js +2 -0
- package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateRepository.d.ts +13 -0
- package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateRepository.js +24 -0
- package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateRepository.js.map +1 -0
- package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateUseCase.d.ts +14 -0
- package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateUseCase.js +33 -0
- package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/DeleteWorkflowState/abstractions.d.ts +25 -0
- package/features/workflowState/DeleteWorkflowState/abstractions.js +6 -0
- package/features/workflowState/DeleteWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/DeleteWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/DeleteWorkflowState/feature.js +13 -0
- package/features/workflowState/DeleteWorkflowState/feature.js.map +1 -0
- package/features/workflowState/DeleteWorkflowState/index.d.ts +1 -0
- package/features/workflowState/DeleteWorkflowState/index.js +1 -0
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateRepository.d.ts +14 -0
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateRepository.js +48 -0
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateRepository.js.map +1 -0
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.d.ts +14 -0
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.js +37 -0
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/GetTargetWorkflowState/abstractions.d.ts +48 -0
- package/features/workflowState/GetTargetWorkflowState/abstractions.js +6 -0
- package/features/workflowState/GetTargetWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/GetTargetWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/GetTargetWorkflowState/feature.js +13 -0
- package/features/workflowState/GetTargetWorkflowState/feature.js.map +1 -0
- package/features/workflowState/GetTargetWorkflowState/index.d.ts +1 -0
- package/features/workflowState/GetTargetWorkflowState/index.js +1 -0
- package/features/workflowState/GetWorkflowState/GetWorkflowStateRepository.d.ts +14 -0
- package/features/workflowState/GetWorkflowState/GetWorkflowStateRepository.js +35 -0
- package/features/workflowState/GetWorkflowState/GetWorkflowStateRepository.js.map +1 -0
- package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.d.ts +14 -0
- package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.js +33 -0
- package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/GetWorkflowState/abstractions.d.ts +39 -0
- package/features/workflowState/GetWorkflowState/abstractions.js +6 -0
- package/features/workflowState/GetWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/GetWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/GetWorkflowState/feature.js +13 -0
- package/features/workflowState/GetWorkflowState/feature.js.map +1 -0
- package/features/workflowState/GetWorkflowState/index.d.ts +1 -0
- package/features/workflowState/GetWorkflowState/index.js +1 -0
- package/features/workflowState/ListOwnWorkflowStates/ListOwnWorkflowStatesUseCase.d.ts +13 -0
- package/features/workflowState/ListOwnWorkflowStates/ListOwnWorkflowStatesUseCase.js +42 -0
- package/features/workflowState/ListOwnWorkflowStates/ListOwnWorkflowStatesUseCase.js.map +1 -0
- package/features/workflowState/ListOwnWorkflowStates/abstractions.d.ts +22 -0
- package/features/workflowState/ListOwnWorkflowStates/abstractions.js +5 -0
- package/features/workflowState/ListOwnWorkflowStates/abstractions.js.map +1 -0
- package/features/workflowState/ListOwnWorkflowStates/feature.d.ts +4 -0
- package/features/workflowState/ListOwnWorkflowStates/feature.js +11 -0
- package/features/workflowState/ListOwnWorkflowStates/feature.js.map +1 -0
- package/features/workflowState/ListOwnWorkflowStates/index.d.ts +1 -0
- package/features/workflowState/ListOwnWorkflowStates/index.js +1 -0
- package/features/workflowState/ListRequestedWorkflowStates/ListRequestedWorkflowStatesUseCase.d.ts +15 -0
- package/features/workflowState/ListRequestedWorkflowStates/ListRequestedWorkflowStatesUseCase.js +52 -0
- package/features/workflowState/ListRequestedWorkflowStates/ListRequestedWorkflowStatesUseCase.js.map +1 -0
- package/features/workflowState/ListRequestedWorkflowStates/abstractions.d.ts +22 -0
- package/features/workflowState/ListRequestedWorkflowStates/abstractions.js +5 -0
- package/features/workflowState/ListRequestedWorkflowStates/abstractions.js.map +1 -0
- package/features/workflowState/ListRequestedWorkflowStates/feature.d.ts +4 -0
- package/features/workflowState/ListRequestedWorkflowStates/feature.js +11 -0
- package/features/workflowState/ListRequestedWorkflowStates/feature.js.map +1 -0
- package/features/workflowState/ListRequestedWorkflowStates/index.d.ts +1 -0
- package/features/workflowState/ListRequestedWorkflowStates/index.js +1 -0
- package/features/workflowState/ListWorkflowStates/DefaultWorkflowStateFilter.d.ts +9 -0
- package/features/workflowState/ListWorkflowStates/DefaultWorkflowStateFilter.js +13 -0
- package/features/workflowState/ListWorkflowStates/DefaultWorkflowStateFilter.js.map +1 -0
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesRepository.d.ts +16 -0
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesRepository.js +46 -0
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesRepository.js.map +1 -0
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.d.ts +16 -0
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.js +67 -0
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.js.map +1 -0
- package/features/workflowState/ListWorkflowStates/WorkflowStateFilter.d.ts +8 -0
- package/features/workflowState/ListWorkflowStates/WorkflowStateFilter.js +5 -0
- package/features/workflowState/ListWorkflowStates/WorkflowStateFilter.js.map +1 -0
- package/features/workflowState/ListWorkflowStates/abstractions.d.ts +71 -0
- package/features/workflowState/ListWorkflowStates/abstractions.js +6 -0
- package/features/workflowState/ListWorkflowStates/abstractions.js.map +1 -0
- package/features/workflowState/ListWorkflowStates/feature.d.ts +4 -0
- package/features/workflowState/ListWorkflowStates/feature.js +15 -0
- package/features/workflowState/ListWorkflowStates/feature.js.map +1 -0
- package/features/workflowState/ListWorkflowStates/index.d.ts +2 -0
- package/features/workflowState/ListWorkflowStates/index.js +2 -0
- package/features/workflowState/README.md +8 -0
- package/features/workflowState/RejectWorkflowStateStep/RejectWorkflowStateStepUseCase.d.ts +15 -0
- package/features/workflowState/RejectWorkflowStateStep/RejectWorkflowStateStepUseCase.js +38 -0
- package/features/workflowState/RejectWorkflowStateStep/RejectWorkflowStateStepUseCase.js.map +1 -0
- package/features/workflowState/RejectWorkflowStateStep/abstractions.d.ts +26 -0
- package/features/workflowState/RejectWorkflowStateStep/abstractions.js +5 -0
- package/features/workflowState/RejectWorkflowStateStep/abstractions.js.map +1 -0
- package/features/workflowState/RejectWorkflowStateStep/events.d.ts +12 -0
- package/features/workflowState/RejectWorkflowStateStep/events.js +14 -0
- package/features/workflowState/RejectWorkflowStateStep/events.js.map +1 -0
- package/features/workflowState/RejectWorkflowStateStep/feature.d.ts +4 -0
- package/features/workflowState/RejectWorkflowStateStep/feature.js +11 -0
- package/features/workflowState/RejectWorkflowStateStep/feature.js.map +1 -0
- package/features/workflowState/RejectWorkflowStateStep/index.d.ts +2 -0
- package/features/workflowState/RejectWorkflowStateStep/index.js +2 -0
- package/features/workflowState/StartWorkflowStateStep/StartWorkflowStateStepUseCase.d.ts +15 -0
- package/features/workflowState/StartWorkflowStateStep/StartWorkflowStateStepUseCase.js +38 -0
- package/features/workflowState/StartWorkflowStateStep/StartWorkflowStateStepUseCase.js.map +1 -0
- package/features/workflowState/StartWorkflowStateStep/abstractions.d.ts +25 -0
- package/features/workflowState/StartWorkflowStateStep/abstractions.js +5 -0
- package/features/workflowState/StartWorkflowStateStep/abstractions.js.map +1 -0
- package/features/workflowState/StartWorkflowStateStep/events.d.ts +12 -0
- package/features/workflowState/StartWorkflowStateStep/events.js +14 -0
- package/features/workflowState/StartWorkflowStateStep/events.js.map +1 -0
- package/features/workflowState/StartWorkflowStateStep/feature.d.ts +4 -0
- package/features/workflowState/StartWorkflowStateStep/feature.js +11 -0
- package/features/workflowState/StartWorkflowStateStep/feature.js.map +1 -0
- package/features/workflowState/StartWorkflowStateStep/index.d.ts +2 -0
- package/features/workflowState/StartWorkflowStateStep/index.js +2 -0
- package/features/workflowState/TakeOverWorkflowStateStep/TakeOverWorkflowStateStepUseCase.d.ts +15 -0
- package/features/workflowState/TakeOverWorkflowStateStep/TakeOverWorkflowStateStepUseCase.js +38 -0
- package/features/workflowState/TakeOverWorkflowStateStep/TakeOverWorkflowStateStepUseCase.js.map +1 -0
- package/features/workflowState/TakeOverWorkflowStateStep/abstractions.d.ts +26 -0
- package/features/workflowState/TakeOverWorkflowStateStep/abstractions.js +5 -0
- package/features/workflowState/TakeOverWorkflowStateStep/abstractions.js.map +1 -0
- package/features/workflowState/TakeOverWorkflowStateStep/events.d.ts +12 -0
- package/features/workflowState/TakeOverWorkflowStateStep/events.js +14 -0
- package/features/workflowState/TakeOverWorkflowStateStep/events.js.map +1 -0
- package/features/workflowState/TakeOverWorkflowStateStep/feature.d.ts +4 -0
- package/features/workflowState/TakeOverWorkflowStateStep/feature.js +11 -0
- package/features/workflowState/TakeOverWorkflowStateStep/feature.js.map +1 -0
- package/features/workflowState/TakeOverWorkflowStateStep/index.d.ts +2 -0
- package/features/workflowState/TakeOverWorkflowStateStep/index.js +2 -0
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateRepository.d.ts +17 -0
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateRepository.js +50 -0
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateRepository.js.map +1 -0
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.d.ts +20 -0
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.js +59 -0
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.js.map +1 -0
- package/features/workflowState/UpdateWorkflowState/abstractions.d.ts +48 -0
- package/features/workflowState/UpdateWorkflowState/abstractions.js +6 -0
- package/features/workflowState/UpdateWorkflowState/abstractions.js.map +1 -0
- package/features/workflowState/UpdateWorkflowState/events.d.ts +12 -0
- package/features/workflowState/UpdateWorkflowState/events.js +14 -0
- package/features/workflowState/UpdateWorkflowState/events.js.map +1 -0
- package/features/workflowState/UpdateWorkflowState/feature.d.ts +4 -0
- package/features/workflowState/UpdateWorkflowState/feature.js +13 -0
- package/features/workflowState/UpdateWorkflowState/feature.js.map +1 -0
- package/features/workflowState/UpdateWorkflowState/index.d.ts +2 -0
- package/features/workflowState/UpdateWorkflowState/index.js +2 -0
- package/graphql/notifications.d.ts +2 -0
- package/graphql/notifications.js +49 -0
- package/graphql/notifications.js.map +1 -0
- package/graphql/validation/approveWorkflowState.d.ts +5 -0
- package/graphql/validation/approveWorkflowState.js +8 -0
- package/graphql/validation/approveWorkflowState.js.map +1 -0
- package/graphql/validation/cancelWorkflowState.d.ts +4 -0
- package/graphql/validation/cancelWorkflowState.js +7 -0
- package/graphql/validation/cancelWorkflowState.js.map +1 -0
- package/graphql/validation/createWorkflowState.d.ts +6 -0
- package/graphql/validation/createWorkflowState.js +9 -0
- package/graphql/validation/createWorkflowState.js.map +1 -0
- package/graphql/validation/deleteWorkflow.d.ts +5 -0
- package/graphql/validation/deleteWorkflow.js +8 -0
- package/graphql/validation/deleteWorkflow.js.map +1 -0
- package/graphql/validation/getTargetWorkflowState.d.ts +5 -0
- package/graphql/validation/getTargetWorkflowState.js +8 -0
- package/graphql/validation/getTargetWorkflowState.js.map +1 -0
- package/graphql/validation/getWorkflow.d.ts +5 -0
- package/graphql/validation/getWorkflow.js +8 -0
- package/graphql/validation/getWorkflow.js.map +1 -0
- package/graphql/validation/getWorkflowState.d.ts +4 -0
- package/graphql/validation/getWorkflowState.js +7 -0
- package/graphql/validation/getWorkflowState.js.map +1 -0
- package/graphql/validation/listWorkflowStates.d.ts +26 -0
- package/graphql/validation/listWorkflowStates.js +36 -0
- package/graphql/validation/listWorkflowStates.js.map +1 -0
- package/graphql/validation/listWorkflows.d.ts +12 -0
- package/graphql/validation/listWorkflows.js +19 -0
- package/graphql/validation/listWorkflows.js.map +1 -0
- package/graphql/validation/rejectWorkflowState.d.ts +5 -0
- package/graphql/validation/rejectWorkflowState.js +8 -0
- package/graphql/validation/rejectWorkflowState.js.map +1 -0
- package/graphql/validation/startWorkflowState.d.ts +4 -0
- package/graphql/validation/startWorkflowState.js +7 -0
- package/graphql/validation/startWorkflowState.js.map +1 -0
- package/graphql/validation/step.d.ts +21 -0
- package/graphql/validation/step.js +16 -0
- package/graphql/validation/step.js.map +1 -0
- package/graphql/validation/storeWorkflow.d.ts +35 -0
- package/graphql/validation/storeWorkflow.js +10 -0
- package/graphql/validation/storeWorkflow.js.map +1 -0
- package/graphql/validation/takeOverWorkflowStateStep.d.ts +4 -0
- package/graphql/validation/takeOverWorkflowStateStep.js +7 -0
- package/graphql/validation/takeOverWorkflowStateStep.js.map +1 -0
- package/graphql/validation/workflow.d.ts +33 -0
- package/graphql/validation/workflow.js +9 -0
- package/graphql/validation/workflow.js.map +1 -0
- package/graphql/workflowState.d.ts +2 -0
- package/graphql/workflowState.js +429 -0
- package/graphql/workflowState.js.map +1 -0
- package/graphql/workflows.d.ts +2 -0
- package/graphql/workflows.js +213 -0
- package/graphql/workflows.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +48 -0
- package/types.d.ts +20 -0
- package/types.js +0 -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/api-workflows
|
|
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,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { WorkflowsInitializer } from "./WorkflowsInitializer.js";
|
|
3
|
+
import { WorkflowsSchemaFactory } from "./WorkflowsSchemaFactory.js";
|
|
4
|
+
import { WorkflowModel } from "./domain/workflow/workflowModel.js";
|
|
5
|
+
import { WorkflowStateModel } from "./domain/workflowState/stateModel.js";
|
|
6
|
+
const WorkflowsFeature = createFeature({
|
|
7
|
+
name: "Workflows",
|
|
8
|
+
register (container) {
|
|
9
|
+
container.register(WorkflowModel);
|
|
10
|
+
container.register(WorkflowStateModel);
|
|
11
|
+
container.register(WorkflowsInitializer);
|
|
12
|
+
container.register(WorkflowsSchemaFactory);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { WorkflowsFeature };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=WorkflowsFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowsFeature.js","sources":["../src/WorkflowsFeature.ts"],"sourcesContent":["import { type Container, createFeature } from \"@webiny/feature/api\";\nimport { WorkflowsInitializer } from \"./WorkflowsInitializer.js\";\nimport { WorkflowsSchemaFactory } from \"./WorkflowsSchemaFactory.js\";\nimport { WorkflowModel as WorkflowPrivateModel } from \"./domain/workflow/workflowModel.js\";\nimport { WorkflowStateModel as WorkflowStatePrivateModel } from \"./domain/workflowState/stateModel.js\";\n\nexport const WorkflowsFeature = createFeature({\n name: \"Workflows\",\n register(container: Container) {\n // Register private CMS model definitions early so HeadlessCmsInitializerImpl\n // picks them up when it builds the model list during the enhance phase.\n container.register(WorkflowPrivateModel);\n container.register(WorkflowStatePrivateModel);\n container.register(WorkflowsInitializer);\n container.register(WorkflowsSchemaFactory);\n }\n});\n"],"names":["WorkflowsFeature","createFeature","container","WorkflowPrivateModel","WorkflowStatePrivateModel","WorkflowsInitializer","WorkflowsSchemaFactory"],"mappings":";;;;;AAMO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAoB;QAGzBA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;IACvB;AACJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
import type { IRequestContextInitializer } from "@webiny/event-handler-core";
|
|
3
|
+
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
4
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
5
|
+
import { WcpContext } from "@webiny/api-core/features/wcp/WcpContext/index.js";
|
|
6
|
+
declare class WorkflowsInitializerImpl implements IRequestContextInitializer {
|
|
7
|
+
private container;
|
|
8
|
+
private tenantCtx;
|
|
9
|
+
private identityCtx;
|
|
10
|
+
private wcp;
|
|
11
|
+
private initialized;
|
|
12
|
+
constructor(container: Container, tenantCtx: TenantContext.Interface, identityCtx: IdentityContext.Interface, wcp: WcpContext.Interface);
|
|
13
|
+
init(_ctx: Record<string, any>): Promise<void>;
|
|
14
|
+
private registerWorkflowFeatures;
|
|
15
|
+
}
|
|
16
|
+
export declare const WorkflowsInitializer: typeof WorkflowsInitializerImpl & {
|
|
17
|
+
__abstraction: import("@webiny/di").Abstraction<IRequestContextInitializer>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { RequestContainer, RequestContextInitializer } from "@webiny/event-handler-core";
|
|
2
|
+
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
3
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
4
|
+
import { WcpContext } from "@webiny/api-core/features/wcp/WcpContext/index.js";
|
|
5
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
6
|
+
import { WORKFLOW_MODEL_ID } from "./domain/workflow/workflowModel.js";
|
|
7
|
+
import { WORKFLOW_STATE_MODEL_ID } from "./domain/workflowState/stateModel.js";
|
|
8
|
+
import { WorkflowModel } from "./domain/workflow/abstractions.js";
|
|
9
|
+
import { WorkflowStateModel } from "./domain/workflowState/abstractions.js";
|
|
10
|
+
import { WorkflowMapper } from "./domain/workflow/WorkflowMapper.js";
|
|
11
|
+
import { WorkflowStateMapper } from "./domain/workflowState/WorkflowStateMapper.js";
|
|
12
|
+
import { GetWorkflowFeature } from "./features/workflow/GetWorkflow/feature.js";
|
|
13
|
+
import { ListWorkflowsFeature } from "./features/workflow/ListWorkflows/feature.js";
|
|
14
|
+
import { CreateWorkflowFeature } from "./features/workflow/CreateWorkflow/feature.js";
|
|
15
|
+
import { DeleteWorkflowFeature } from "./features/workflow/DeleteWorkflow/feature.js";
|
|
16
|
+
import { UpdateWorkflowFeature } from "./features/workflow/UpdateWorkflow/feature.js";
|
|
17
|
+
import { StoreWorkflowFeature } from "./features/workflow/StoreWorkflow/feature.js";
|
|
18
|
+
import { GetWorkflowStateFeature } from "./features/workflowState/GetWorkflowState/feature.js";
|
|
19
|
+
import { GetTargetWorkflowStateFeature } from "./features/workflowState/GetTargetWorkflowState/feature.js";
|
|
20
|
+
import { ListOwnWorkflowStatesFeature } from "./features/workflowState/ListOwnWorkflowStates/feature.js";
|
|
21
|
+
import { ListWorkflowStatesFeature } from "./features/workflowState/ListWorkflowStates/feature.js";
|
|
22
|
+
import { ListRequestedWorkflowStatesFeature } from "./features/workflowState/ListRequestedWorkflowStates/feature.js";
|
|
23
|
+
import { CreateWorkflowStateFeature } from "./features/workflowState/CreateWorkflowState/feature.js";
|
|
24
|
+
import { UpdateWorkflowStateFeature } from "./features/workflowState/UpdateWorkflowState/feature.js";
|
|
25
|
+
import { CancelWorkflowStateFeature } from "./features/workflowState/CancelWorkflowState/feature.js";
|
|
26
|
+
import { DeleteWorkflowStateFeature } from "./features/workflowState/DeleteWorkflowState/feature.js";
|
|
27
|
+
import { DeleteTargetWorkflowStateFeature } from "./features/workflowState/DeleteTargetWorkflowState/feature.js";
|
|
28
|
+
import { StartWorkflowStateStepFeature } from "./features/workflowState/StartWorkflowStateStep/feature.js";
|
|
29
|
+
import { ApproveWorkflowStateStepFeature } from "./features/workflowState/ApproveWorkflowStateStep/feature.js";
|
|
30
|
+
import { RejectWorkflowStateStepFeature } from "./features/workflowState/RejectWorkflowStateStep/feature.js";
|
|
31
|
+
import { TakeOverWorkflowStateStepFeature } from "./features/workflowState/TakeOverWorkflowStateStep/feature.js";
|
|
32
|
+
import { GetUserTeamsFeature } from "./features/internal/GetUserTeams/feature.js";
|
|
33
|
+
import { ListNotificationTypesFeature } from "./features/notifications/ListNotificationTypes/index.js";
|
|
34
|
+
import { NotificationTransportFeature } from "./features/notifications/NotificationTransport/index.js";
|
|
35
|
+
class WorkflowsInitializerImpl {
|
|
36
|
+
constructor(container, tenantCtx, identityCtx, wcp){
|
|
37
|
+
this.container = container;
|
|
38
|
+
this.tenantCtx = tenantCtx;
|
|
39
|
+
this.identityCtx = identityCtx;
|
|
40
|
+
this.wcp = wcp;
|
|
41
|
+
this.initialized = false;
|
|
42
|
+
}
|
|
43
|
+
async init(_ctx) {
|
|
44
|
+
if (!this.initialized) {
|
|
45
|
+
this.initialized = true;
|
|
46
|
+
if (this.tenantCtx.getTenant() && this.wcp.canUseWorkflows()) await this.registerWorkflowFeatures();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async registerWorkflowFeatures() {
|
|
50
|
+
const getModel = this.container.resolve(GetModelUseCase);
|
|
51
|
+
await this.identityCtx.withoutAuthorization(async ()=>{
|
|
52
|
+
const [workflowModel, workflowStateModel] = await Promise.all([
|
|
53
|
+
getModel.execute(WORKFLOW_MODEL_ID),
|
|
54
|
+
getModel.execute(WORKFLOW_STATE_MODEL_ID)
|
|
55
|
+
]);
|
|
56
|
+
this.container.registerInstance(WorkflowModel, workflowModel.value);
|
|
57
|
+
this.container.registerInstance(WorkflowStateModel, workflowStateModel.value);
|
|
58
|
+
});
|
|
59
|
+
this.container.register(WorkflowMapper);
|
|
60
|
+
this.container.register(WorkflowStateMapper);
|
|
61
|
+
ListNotificationTypesFeature.register(this.container);
|
|
62
|
+
NotificationTransportFeature.register(this.container);
|
|
63
|
+
GetWorkflowFeature.register(this.container);
|
|
64
|
+
ListWorkflowsFeature.register(this.container);
|
|
65
|
+
CreateWorkflowFeature.register(this.container);
|
|
66
|
+
DeleteWorkflowFeature.register(this.container);
|
|
67
|
+
UpdateWorkflowFeature.register(this.container);
|
|
68
|
+
StoreWorkflowFeature.register(this.container);
|
|
69
|
+
GetUserTeamsFeature.register(this.container);
|
|
70
|
+
GetWorkflowStateFeature.register(this.container);
|
|
71
|
+
GetTargetWorkflowStateFeature.register(this.container);
|
|
72
|
+
ListOwnWorkflowStatesFeature.register(this.container);
|
|
73
|
+
ListWorkflowStatesFeature.register(this.container);
|
|
74
|
+
ListRequestedWorkflowStatesFeature.register(this.container);
|
|
75
|
+
CreateWorkflowStateFeature.register(this.container);
|
|
76
|
+
UpdateWorkflowStateFeature.register(this.container);
|
|
77
|
+
CancelWorkflowStateFeature.register(this.container);
|
|
78
|
+
DeleteWorkflowStateFeature.register(this.container);
|
|
79
|
+
DeleteTargetWorkflowStateFeature.register(this.container);
|
|
80
|
+
StartWorkflowStateStepFeature.register(this.container);
|
|
81
|
+
ApproveWorkflowStateStepFeature.register(this.container);
|
|
82
|
+
RejectWorkflowStateStepFeature.register(this.container);
|
|
83
|
+
TakeOverWorkflowStateStepFeature.register(this.container);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const WorkflowsInitializer = RequestContextInitializer.createImplementation({
|
|
87
|
+
implementation: WorkflowsInitializerImpl,
|
|
88
|
+
dependencies: [
|
|
89
|
+
RequestContainer,
|
|
90
|
+
TenantContext,
|
|
91
|
+
IdentityContext,
|
|
92
|
+
WcpContext
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
export { WorkflowsInitializer };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=WorkflowsInitializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowsInitializer.js","sources":["../src/WorkflowsInitializer.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { RequestContextInitializer } from \"@webiny/event-handler-core\";\nimport type { IRequestContextInitializer } from \"@webiny/event-handler-core\";\nimport { RequestContainer } from \"@webiny/event-handler-core\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { WcpContext } from \"@webiny/api-core/features/wcp/WcpContext/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { WORKFLOW_MODEL_ID } from \"./domain/workflow/workflowModel.js\";\nimport { WORKFLOW_STATE_MODEL_ID } from \"./domain/workflowState/stateModel.js\";\nimport { WorkflowModel } from \"./domain/workflow/abstractions.js\";\nimport { WorkflowStateModel } from \"./domain/workflowState/abstractions.js\";\nimport { WorkflowMapper } from \"~/domain/workflow/WorkflowMapper.js\";\nimport { WorkflowStateMapper } from \"~/domain/workflowState/WorkflowStateMapper.js\";\nimport { GetWorkflowFeature } from \"~/features/workflow/GetWorkflow/feature.js\";\nimport { ListWorkflowsFeature } from \"~/features/workflow/ListWorkflows/feature.js\";\nimport { CreateWorkflowFeature } from \"~/features/workflow/CreateWorkflow/feature.js\";\nimport { DeleteWorkflowFeature } from \"~/features/workflow/DeleteWorkflow/feature.js\";\nimport { UpdateWorkflowFeature } from \"~/features/workflow/UpdateWorkflow/feature.js\";\nimport { StoreWorkflowFeature } from \"~/features/workflow/StoreWorkflow/feature.js\";\nimport { GetWorkflowStateFeature } from \"~/features/workflowState/GetWorkflowState/feature.js\";\nimport { GetTargetWorkflowStateFeature } from \"~/features/workflowState/GetTargetWorkflowState/feature.js\";\nimport { ListOwnWorkflowStatesFeature } from \"~/features/workflowState/ListOwnWorkflowStates/feature.js\";\nimport { ListWorkflowStatesFeature } from \"~/features/workflowState/ListWorkflowStates/feature.js\";\nimport { ListRequestedWorkflowStatesFeature } from \"~/features/workflowState/ListRequestedWorkflowStates/feature.js\";\nimport { CreateWorkflowStateFeature } from \"~/features/workflowState/CreateWorkflowState/feature.js\";\nimport { UpdateWorkflowStateFeature } from \"~/features/workflowState/UpdateWorkflowState/feature.js\";\nimport { CancelWorkflowStateFeature } from \"~/features/workflowState/CancelWorkflowState/feature.js\";\nimport { DeleteWorkflowStateFeature } from \"~/features/workflowState/DeleteWorkflowState/feature.js\";\nimport { DeleteTargetWorkflowStateFeature } from \"~/features/workflowState/DeleteTargetWorkflowState/feature.js\";\nimport { StartWorkflowStateStepFeature } from \"~/features/workflowState/StartWorkflowStateStep/feature.js\";\nimport { ApproveWorkflowStateStepFeature } from \"~/features/workflowState/ApproveWorkflowStateStep/feature.js\";\nimport { RejectWorkflowStateStepFeature } from \"~/features/workflowState/RejectWorkflowStateStep/feature.js\";\nimport { TakeOverWorkflowStateStepFeature } from \"~/features/workflowState/TakeOverWorkflowStateStep/feature.js\";\nimport { GetUserTeamsFeature } from \"~/features/internal/GetUserTeams/feature.js\";\nimport { ListNotificationTypesFeature } from \"~/features/notifications/ListNotificationTypes/index.js\";\nimport { NotificationTransportFeature } from \"./features/notifications/NotificationTransport/index.js\";\n\n// A request initializer — it contributes no schema content (the static schema is registered via\n// WorkflowsSchemaFactory). It runs after context enhancers and before resolvers, making it the\n// right hook for the async CMS model fetch and lazy feature registrations resolvers depend on.\nclass WorkflowsInitializerImpl implements IRequestContextInitializer {\n private initialized = false;\n\n constructor(\n private container: Container,\n private tenantCtx: TenantContext.Interface,\n private identityCtx: IdentityContext.Interface,\n private wcp: WcpContext.Interface\n ) {}\n\n async init(_ctx: Record<string, any>): Promise<void> {\n if (!this.initialized) {\n this.initialized = true;\n\n if (this.tenantCtx.getTenant() && this.wcp.canUseWorkflows()) {\n await this.registerWorkflowFeatures();\n }\n }\n }\n\n private async registerWorkflowFeatures(): Promise<void> {\n // Fetch and register CMS models — resolved lazily here because CmsContext is only\n // registered after HeadlessCmsInitializerImpl.enhance() runs (before this runs).\n const getModel = this.container.resolve(GetModelUseCase);\n await this.identityCtx.withoutAuthorization(async () => {\n const [workflowModel, workflowStateModel] = await Promise.all([\n getModel.execute(WORKFLOW_MODEL_ID),\n getModel.execute(WORKFLOW_STATE_MODEL_ID)\n ]);\n\n this.container.registerInstance(WorkflowModel, workflowModel.value);\n this.container.registerInstance(WorkflowStateModel, workflowStateModel.value);\n });\n\n // Register mappers\n this.container.register(WorkflowMapper);\n this.container.register(WorkflowStateMapper);\n\n // Register notification features\n ListNotificationTypesFeature.register(this.container);\n NotificationTransportFeature.register(this.container);\n\n // Register workflow features\n GetWorkflowFeature.register(this.container);\n ListWorkflowsFeature.register(this.container);\n CreateWorkflowFeature.register(this.container);\n DeleteWorkflowFeature.register(this.container);\n UpdateWorkflowFeature.register(this.container);\n StoreWorkflowFeature.register(this.container);\n\n // Register internal features\n GetUserTeamsFeature.register(this.container);\n\n // Register workflow state features\n GetWorkflowStateFeature.register(this.container);\n GetTargetWorkflowStateFeature.register(this.container);\n ListOwnWorkflowStatesFeature.register(this.container);\n ListWorkflowStatesFeature.register(this.container);\n ListRequestedWorkflowStatesFeature.register(this.container);\n CreateWorkflowStateFeature.register(this.container);\n UpdateWorkflowStateFeature.register(this.container);\n CancelWorkflowStateFeature.register(this.container);\n DeleteWorkflowStateFeature.register(this.container);\n DeleteTargetWorkflowStateFeature.register(this.container);\n StartWorkflowStateStepFeature.register(this.container);\n ApproveWorkflowStateStepFeature.register(this.container);\n RejectWorkflowStateStepFeature.register(this.container);\n TakeOverWorkflowStateStepFeature.register(this.container);\n }\n}\n\nexport const WorkflowsInitializer = RequestContextInitializer.createImplementation({\n implementation: WorkflowsInitializerImpl,\n dependencies: [RequestContainer, TenantContext, IdentityContext, WcpContext]\n});\n"],"names":["WorkflowsInitializerImpl","container","tenantCtx","identityCtx","wcp","_ctx","getModel","GetModelUseCase","workflowModel","workflowStateModel","Promise","WORKFLOW_MODEL_ID","WORKFLOW_STATE_MODEL_ID","WorkflowModel","WorkflowStateModel","WorkflowMapper","WorkflowStateMapper","ListNotificationTypesFeature","NotificationTransportFeature","GetWorkflowFeature","ListWorkflowsFeature","CreateWorkflowFeature","DeleteWorkflowFeature","UpdateWorkflowFeature","StoreWorkflowFeature","GetUserTeamsFeature","GetWorkflowStateFeature","GetTargetWorkflowStateFeature","ListOwnWorkflowStatesFeature","ListWorkflowStatesFeature","ListRequestedWorkflowStatesFeature","CreateWorkflowStateFeature","UpdateWorkflowStateFeature","CancelWorkflowStateFeature","DeleteWorkflowStateFeature","DeleteTargetWorkflowStateFeature","StartWorkflowStateStepFeature","ApproveWorkflowStateStepFeature","RejectWorkflowStateStepFeature","TakeOverWorkflowStateStepFeature","WorkflowsInitializer","RequestContextInitializer","RequestContainer","TenantContext","IdentityContext","WcpContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAMA;IAGF,YACYC,SAAoB,EACpBC,SAAkC,EAClCC,WAAsC,EACtCC,GAAyB,CACnC;aAJUH,SAAS,GAATA;aACAC,SAAS,GAATA;aACAC,WAAW,GAAXA;aACAC,GAAG,GAAHA;aANJ,WAAW,GAAG;IAOnB;IAEH,MAAM,KAAKC,IAAyB,EAAiB;QACjD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG;YAEnB,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,IACtD,MAAM,IAAI,CAAC,wBAAwB;QAE3C;IACJ;IAEA,MAAc,2BAA0C;QAGpD,MAAMC,WAAW,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;QACxC,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC;YACxC,MAAM,CAACC,eAAeC,mBAAmB,GAAG,MAAMC,QAAQ,GAAG,CAAC;gBAC1DJ,SAAS,OAAO,CAACK;gBACjBL,SAAS,OAAO,CAACM;aACpB;YAED,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAACC,eAAeL,cAAc,KAAK;YAClE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAACM,oBAAoBL,mBAAmB,KAAK;QAChF;QAGA,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACM;QACxB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACC;QAGxBC,6BAA6B,QAAQ,CAAC,IAAI,CAAC,SAAS;QACpDC,6BAA6B,QAAQ,CAAC,IAAI,CAAC,SAAS;QAGpDC,mBAAmB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC1CC,qBAAqB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC5CC,sBAAsB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC7CC,sBAAsB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC7CC,sBAAsB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC7CC,qBAAqB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAG5CC,oBAAoB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAG3CC,wBAAwB,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC/CC,8BAA8B,QAAQ,CAAC,IAAI,CAAC,SAAS;QACrDC,6BAA6B,QAAQ,CAAC,IAAI,CAAC,SAAS;QACpDC,0BAA0B,QAAQ,CAAC,IAAI,CAAC,SAAS;QACjDC,mCAAmC,QAAQ,CAAC,IAAI,CAAC,SAAS;QAC1DC,2BAA2B,QAAQ,CAAC,IAAI,CAAC,SAAS;QAClDC,2BAA2B,QAAQ,CAAC,IAAI,CAAC,SAAS;QAClDC,2BAA2B,QAAQ,CAAC,IAAI,CAAC,SAAS;QAClDC,2BAA2B,QAAQ,CAAC,IAAI,CAAC,SAAS;QAClDC,iCAAiC,QAAQ,CAAC,IAAI,CAAC,SAAS;QACxDC,8BAA8B,QAAQ,CAAC,IAAI,CAAC,SAAS;QACrDC,gCAAgC,QAAQ,CAAC,IAAI,CAAC,SAAS;QACvDC,+BAA+B,QAAQ,CAAC,IAAI,CAAC,SAAS;QACtDC,iCAAiC,QAAQ,CAAC,IAAI,CAAC,SAAS;IAC5D;AACJ;AAEO,MAAMC,uBAAuBC,0BAA0B,oBAAoB,CAAC;IAC/E,gBAAgBzC;IAChB,cAAc;QAAC0C;QAAkBC;QAAeC;QAAiBC;KAAW;AAChF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IGraphQLSchemaFactory, GraphQLSchemaFactory as GQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
declare class WorkflowsSchemaFactoryImpl implements IGraphQLSchemaFactory {
|
|
3
|
+
execute(builder: GQLSchemaFactory.SchemaBuilder): Promise<GQLSchemaFactory.SchemaBuilder>;
|
|
4
|
+
}
|
|
5
|
+
export declare const WorkflowsSchemaFactory: typeof WorkflowsSchemaFactoryImpl & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { addNotificationsSchema } from "./graphql/notifications.js";
|
|
3
|
+
import { addWorkflowsSchema } from "./graphql/workflows.js";
|
|
4
|
+
import { addWorkflowStateSchema } from "./graphql/workflowState.js";
|
|
5
|
+
class WorkflowsSchemaFactoryImpl {
|
|
6
|
+
async execute(builder) {
|
|
7
|
+
addWorkflowsSchema(builder);
|
|
8
|
+
addWorkflowStateSchema(builder);
|
|
9
|
+
addNotificationsSchema(builder);
|
|
10
|
+
return builder;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const WorkflowsSchemaFactory = GraphQLSchemaFactory.createImplementation({
|
|
14
|
+
implementation: WorkflowsSchemaFactoryImpl,
|
|
15
|
+
dependencies: []
|
|
16
|
+
});
|
|
17
|
+
export { WorkflowsSchemaFactory };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=WorkflowsSchemaFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowsSchemaFactory.js","sources":["../src/WorkflowsSchemaFactory.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport type {\n IGraphQLSchemaFactory,\n GraphQLSchemaFactory as GQLSchemaFactory\n} from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { addNotificationsSchema } from \"~/graphql/notifications.js\";\nimport { addWorkflowsSchema } from \"~/graphql/workflows.js\";\nimport { addWorkflowStateSchema } from \"~/graphql/workflowState.js\";\n\nclass WorkflowsSchemaFactoryImpl implements IGraphQLSchemaFactory {\n async execute(\n builder: GQLSchemaFactory.SchemaBuilder\n ): Promise<GQLSchemaFactory.SchemaBuilder> {\n addWorkflowsSchema(builder);\n addWorkflowStateSchema(builder);\n addNotificationsSchema(builder);\n\n return builder;\n }\n}\n\nexport const WorkflowsSchemaFactory = GraphQLSchemaFactory.createImplementation({\n implementation: WorkflowsSchemaFactoryImpl,\n dependencies: []\n});\n"],"names":["WorkflowsSchemaFactoryImpl","builder","addWorkflowsSchema","addWorkflowStateSchema","addNotificationsSchema","WorkflowsSchemaFactory","GraphQLSchemaFactory"],"mappings":";;;;AASA,MAAMA;IACF,MAAM,QACFC,OAAuC,EACA;QACvCC,mBAAmBD;QACnBE,uBAAuBF;QACvBG,uBAAuBH;QAEvB,OAAOA;IACX;AACJ;AAEO,MAAMI,yBAAyBC,qBAAqB,oBAAoB,CAAC;IAC5E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
package/constants.d.ts
ADDED
package/constants.js
ADDED
package/constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export const WORKFLOW_MODEL_ID = \"wbyWorkflow\";\nexport const WORKFLOW_STATE_MODEL_ID = \"wbyWorkflowState\";\nexport const WORKFLOWS_PERMISSION = \"workflows\";\n"],"names":["WORKFLOW_MODEL_ID","WORKFLOW_STATE_MODEL_ID","WORKFLOWS_PERMISSION"],"mappings":"AAAO,MAAMA,oBAAoB;AAC1B,MAAMC,0BAA0B;AAChC,MAAMC,uBAAuB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface INotificationTypeMessage {
|
|
2
|
+
title: string;
|
|
3
|
+
body: string;
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const NotificationTypeMessageOnRequestReview: import("@webiny/di").Abstraction<INotificationTypeMessage>;
|
|
7
|
+
export declare namespace NotificationTypeMessageOnRequestReview {
|
|
8
|
+
type Interface = INotificationTypeMessage;
|
|
9
|
+
}
|
|
10
|
+
export declare const NotificationTypeMessageOnRequestReviewCancel: import("@webiny/di").Abstraction<INotificationTypeMessage>;
|
|
11
|
+
export declare namespace NotificationTypeMessageOnRequestReviewCancel {
|
|
12
|
+
type Interface = INotificationTypeMessage;
|
|
13
|
+
}
|
|
14
|
+
export declare const NotificationTypeMessageOnReviewStepStart: import("@webiny/di").Abstraction<INotificationTypeMessage>;
|
|
15
|
+
export declare namespace NotificationTypeMessageOnReviewStepStart {
|
|
16
|
+
type Interface = INotificationTypeMessage;
|
|
17
|
+
}
|
|
18
|
+
export declare const NotificationTypeMessageOnReviewStepApprove: import("@webiny/di").Abstraction<INotificationTypeMessage>;
|
|
19
|
+
export declare namespace NotificationTypeMessageOnReviewStepApprove {
|
|
20
|
+
type Interface = INotificationTypeMessage;
|
|
21
|
+
}
|
|
22
|
+
export declare const NotificationTypeMessageOnReviewReject: import("@webiny/di").Abstraction<INotificationTypeMessage>;
|
|
23
|
+
export declare namespace NotificationTypeMessageOnReviewReject {
|
|
24
|
+
type Interface = INotificationTypeMessage;
|
|
25
|
+
}
|
|
26
|
+
export declare const NotificationTypeMessageOnReviewApprove: import("@webiny/di").Abstraction<INotificationTypeMessage>;
|
|
27
|
+
export declare namespace NotificationTypeMessageOnReviewApprove {
|
|
28
|
+
type Interface = INotificationTypeMessage;
|
|
29
|
+
}
|
|
30
|
+
export type INotificationTypes = NotificationTypeMessageOnRequestReview.Interface | NotificationTypeMessageOnRequestReviewCancel.Interface | NotificationTypeMessageOnReviewStepStart.Interface | NotificationTypeMessageOnReviewStepApprove.Interface | NotificationTypeMessageOnReviewReject.Interface | NotificationTypeMessageOnReviewApprove.Interface;
|
|
31
|
+
export interface INotificationTypeMessages {
|
|
32
|
+
/**
|
|
33
|
+
* User requests a review for a content.
|
|
34
|
+
*/
|
|
35
|
+
onRequestReview: NotificationTypeMessageOnRequestReview.Interface;
|
|
36
|
+
/**
|
|
37
|
+
* User cancels a review for a content.
|
|
38
|
+
*/
|
|
39
|
+
onRequestReviewCancel: NotificationTypeMessageOnRequestReviewCancel.Interface;
|
|
40
|
+
/**
|
|
41
|
+
* Reviewer starts a review step.
|
|
42
|
+
*/
|
|
43
|
+
onReviewStepStart: NotificationTypeMessageOnReviewStepStart.Interface;
|
|
44
|
+
/**
|
|
45
|
+
* Reviewer approves a review step - there are more steps after this one.
|
|
46
|
+
*/
|
|
47
|
+
onReviewStepApprove: NotificationTypeMessageOnReviewStepApprove.Interface;
|
|
48
|
+
/**
|
|
49
|
+
* Reviewer rejects a review - no step specific reject because as soon as step is rejected, whole review is rejected.
|
|
50
|
+
*/
|
|
51
|
+
onReviewReject: NotificationTypeMessageOnReviewReject.Interface;
|
|
52
|
+
/**
|
|
53
|
+
* Reviewer approves a final review step.
|
|
54
|
+
*/
|
|
55
|
+
onReviewApprove: NotificationTypeMessageOnReviewApprove.Interface;
|
|
56
|
+
}
|
|
57
|
+
export interface INotificationType {
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const NotificationType: import("@webiny/di").Abstraction<INotificationType>;
|
|
62
|
+
export declare namespace NotificationType {
|
|
63
|
+
type Interface = INotificationType;
|
|
64
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const NotificationTypeMessageOnRequestReview = createAbstraction("WorkflowNotificationTypeMessageOnRequestReview");
|
|
3
|
+
const NotificationTypeMessageOnRequestReviewCancel = createAbstraction("WorkflowNotificationTypeMessageOnRequestReviewCancel");
|
|
4
|
+
const NotificationTypeMessageOnReviewStepStart = createAbstraction("WorkflowNotificationTypeMessageOnReviewStepStart");
|
|
5
|
+
const NotificationTypeMessageOnReviewStepApprove = createAbstraction("WorkflowNotificationTypeMessageOnReviewStepApprove");
|
|
6
|
+
const NotificationTypeMessageOnReviewReject = createAbstraction("WorkflowNotificationTypeMessageOnReviewReject");
|
|
7
|
+
const NotificationTypeMessageOnReviewApprove = createAbstraction("WorkflowNotificationTypeMessageOnReviewApprove");
|
|
8
|
+
const NotificationType = createAbstraction("WorkflowNotificationType");
|
|
9
|
+
export { NotificationType, NotificationTypeMessageOnRequestReview, NotificationTypeMessageOnRequestReviewCancel, NotificationTypeMessageOnReviewApprove, NotificationTypeMessageOnReviewReject, NotificationTypeMessageOnReviewStepApprove, NotificationTypeMessageOnReviewStepStart };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain/notifications/abstractions.js","sources":["../../../src/domain/notifications/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\n\nexport interface INotificationTypeMessage {\n title: string;\n body: string;\n url: string;\n}\n\nexport const NotificationTypeMessageOnRequestReview = createAbstraction<INotificationTypeMessage>(\n \"WorkflowNotificationTypeMessageOnRequestReview\"\n);\n\nexport namespace NotificationTypeMessageOnRequestReview {\n export type Interface = INotificationTypeMessage;\n}\n\nexport const NotificationTypeMessageOnRequestReviewCancel =\n createAbstraction<INotificationTypeMessage>(\n \"WorkflowNotificationTypeMessageOnRequestReviewCancel\"\n );\n\nexport namespace NotificationTypeMessageOnRequestReviewCancel {\n export type Interface = INotificationTypeMessage;\n}\n\nexport const NotificationTypeMessageOnReviewStepStart = createAbstraction<INotificationTypeMessage>(\n \"WorkflowNotificationTypeMessageOnReviewStepStart\"\n);\n\nexport namespace NotificationTypeMessageOnReviewStepStart {\n export type Interface = INotificationTypeMessage;\n}\n\nexport const NotificationTypeMessageOnReviewStepApprove =\n createAbstraction<INotificationTypeMessage>(\n \"WorkflowNotificationTypeMessageOnReviewStepApprove\"\n );\n\nexport namespace NotificationTypeMessageOnReviewStepApprove {\n export type Interface = INotificationTypeMessage;\n}\n\nexport const NotificationTypeMessageOnReviewReject = createAbstraction<INotificationTypeMessage>(\n \"WorkflowNotificationTypeMessageOnReviewReject\"\n);\n\nexport namespace NotificationTypeMessageOnReviewReject {\n export type Interface = INotificationTypeMessage;\n}\n\nexport const NotificationTypeMessageOnReviewApprove = createAbstraction<INotificationTypeMessage>(\n \"WorkflowNotificationTypeMessageOnReviewApprove\"\n);\n\nexport namespace NotificationTypeMessageOnReviewApprove {\n export type Interface = INotificationTypeMessage;\n}\n\nexport type INotificationTypes =\n | NotificationTypeMessageOnRequestReview.Interface\n | NotificationTypeMessageOnRequestReviewCancel.Interface\n | NotificationTypeMessageOnReviewStepStart.Interface\n | NotificationTypeMessageOnReviewStepApprove.Interface\n | NotificationTypeMessageOnReviewReject.Interface\n | NotificationTypeMessageOnReviewApprove.Interface;\n\nexport interface INotificationTypeMessages {\n /**\n * User requests a review for a content.\n */\n onRequestReview: NotificationTypeMessageOnRequestReview.Interface;\n /**\n * User cancels a review for a content.\n */\n onRequestReviewCancel: NotificationTypeMessageOnRequestReviewCancel.Interface;\n /**\n * Reviewer starts a review step.\n */\n onReviewStepStart: NotificationTypeMessageOnReviewStepStart.Interface;\n /**\n * Reviewer approves a review step - there are more steps after this one.\n */\n onReviewStepApprove: NotificationTypeMessageOnReviewStepApprove.Interface;\n /**\n * Reviewer rejects a review - no step specific reject because as soon as step is rejected, whole review is rejected.\n */\n onReviewReject: NotificationTypeMessageOnReviewReject.Interface;\n /**\n * Reviewer approves a final review step.\n */\n onReviewApprove: NotificationTypeMessageOnReviewApprove.Interface;\n}\n\nexport interface INotificationType {\n id: string;\n title: string;\n}\n\nexport const NotificationType = createAbstraction<INotificationType>(\"WorkflowNotificationType\");\n\nexport namespace NotificationType {\n export type Interface = INotificationType;\n}\n"],"names":["NotificationTypeMessageOnRequestReview","createAbstraction","NotificationTypeMessageOnRequestReviewCancel","NotificationTypeMessageOnReviewStepStart","NotificationTypeMessageOnReviewStepApprove","NotificationTypeMessageOnReviewReject","NotificationTypeMessageOnReviewApprove","NotificationType"],"mappings":";AAQO,MAAMA,yCAAyCC,kBAClD;AAOG,MAAMC,+CACTD,kBACI;AAOD,MAAME,2CAA2CF,kBACpD;AAOG,MAAMG,6CACTH,kBACI;AAOD,MAAMI,wCAAwCJ,kBACjD;AAOG,MAAMK,yCAAyCL,kBAClD;AA+CG,MAAMM,mBAAmBN,kBAAqC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
class NotificationAuthorizedError extends BaseError {
|
|
3
|
+
constructor(message){
|
|
4
|
+
super({
|
|
5
|
+
message: message || "Not authorized to access notifications."
|
|
6
|
+
}), this.code = "Workflows/Notification/NotAuthorized";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export { NotificationAuthorizedError };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain/notifications/errors.js","sources":["../../../src/domain/notifications/errors.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/api\";\n\nexport class NotificationAuthorizedError extends BaseError {\n override readonly code = \"Workflows/Notification/NotAuthorized\" as const;\n\n constructor(message?: string) {\n super({\n message: message || \"Not authorized to access notifications.\"\n });\n }\n}\n"],"names":["NotificationAuthorizedError","BaseError","message"],"mappings":";AAEO,MAAMA,oCAAoCC;IAG7C,YAAYC,OAAgB,CAAE;QAC1B,KAAK,CAAC;YACF,SAASA,WAAW;QACxB,SALc,IAAI,GAAG;IAMzB;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IWorkflowValues, WorkflowMapper as MapperAbstraction } from "./abstractions.js";
|
|
2
|
+
import type { IWorkflow } from "./abstractions.js";
|
|
3
|
+
import type { CmsEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
+
import type { IWorkflowInput } from "../../features/shared/abstractions.js";
|
|
5
|
+
declare class WorkflowMapperImpl implements MapperAbstraction.Interface {
|
|
6
|
+
fromCmsEntry(entry: CmsEntry<IWorkflowValues>): IWorkflow;
|
|
7
|
+
toCmsEntry(workflow: IWorkflowInput): IWorkflow;
|
|
8
|
+
}
|
|
9
|
+
export declare const WorkflowMapper: typeof WorkflowMapperImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IWorkflowMapper>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { WorkflowMapper } from "./abstractions.js";
|
|
2
|
+
import { parseIdentifier } from "@webiny/utils/parseIdentifier.js";
|
|
3
|
+
class WorkflowMapperImpl {
|
|
4
|
+
fromCmsEntry(entry) {
|
|
5
|
+
const { id } = parseIdentifier(entry.id);
|
|
6
|
+
return {
|
|
7
|
+
id,
|
|
8
|
+
app: entry.values.app,
|
|
9
|
+
name: entry.values.name,
|
|
10
|
+
steps: entry.values.steps
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
toCmsEntry(workflow) {
|
|
14
|
+
return {
|
|
15
|
+
id: workflow.id,
|
|
16
|
+
app: workflow.app,
|
|
17
|
+
name: workflow.name,
|
|
18
|
+
steps: workflow.steps
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const WorkflowMapper_WorkflowMapper = WorkflowMapper.createImplementation({
|
|
23
|
+
implementation: WorkflowMapperImpl,
|
|
24
|
+
dependencies: []
|
|
25
|
+
});
|
|
26
|
+
export { WorkflowMapper_WorkflowMapper as WorkflowMapper };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=WorkflowMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain/workflow/WorkflowMapper.js","sources":["../../../src/domain/workflow/WorkflowMapper.ts"],"sourcesContent":["import { type IWorkflowValues, WorkflowMapper as MapperAbstraction } from \"./abstractions.js\";\nimport type { IWorkflow } from \"./abstractions.js\";\nimport { parseIdentifier } from \"@webiny/utils/parseIdentifier.js\";\nimport type { CmsEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { IWorkflowInput } from \"~/features/shared/abstractions.js\";\n\nclass WorkflowMapperImpl implements MapperAbstraction.Interface {\n fromCmsEntry(entry: CmsEntry<IWorkflowValues>): IWorkflow {\n const { id } = parseIdentifier(entry.id);\n return {\n id,\n app: entry.values.app,\n name: entry.values.name,\n steps: entry.values.steps\n };\n }\n\n toCmsEntry(workflow: IWorkflowInput): IWorkflow {\n return {\n id: workflow.id,\n app: workflow.app,\n name: workflow.name,\n steps: workflow.steps\n };\n }\n}\n\nexport const WorkflowMapper = MapperAbstraction.createImplementation({\n implementation: WorkflowMapperImpl,\n dependencies: []\n});\n"],"names":["WorkflowMapperImpl","entry","id","parseIdentifier","workflow","WorkflowMapper","MapperAbstraction"],"mappings":";;AAMA,MAAMA;IACF,aAAaC,KAAgC,EAAa;QACtD,MAAM,EAAEC,EAAE,EAAE,GAAGC,gBAAgBF,MAAM,EAAE;QACvC,OAAO;YACHC;YACA,KAAKD,MAAM,MAAM,CAAC,GAAG;YACrB,MAAMA,MAAM,MAAM,CAAC,IAAI;YACvB,OAAOA,MAAM,MAAM,CAAC,KAAK;QAC7B;IACJ;IAEA,WAAWG,QAAwB,EAAa;QAC5C,OAAO;YACH,IAAIA,SAAS,EAAE;YACf,KAAKA,SAAS,GAAG;YACjB,MAAMA,SAAS,IAAI;YACnB,OAAOA,SAAS,KAAK;QACzB;IACJ;AACJ;AAEO,MAAMC,gCAAiBC,eAAAA,oBAAsC,CAAC;IACjE,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CmsEntry, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import type { NonEmptyArray } from "@webiny/api/types.js";
|
|
3
|
+
import type { IWorkflowInput } from "../../features/shared/abstractions.js";
|
|
4
|
+
export interface IWorkflowStepNotification {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IWorkflowStepTeam {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IWorkflowStep {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
color: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
teams: NonEmptyArray<IWorkflowStepTeam>;
|
|
16
|
+
notifications?: IWorkflowStepNotification[];
|
|
17
|
+
}
|
|
18
|
+
export interface IWorkflowValues {
|
|
19
|
+
app: string;
|
|
20
|
+
name: string;
|
|
21
|
+
steps: NonEmptyArray<IWorkflowStep>;
|
|
22
|
+
}
|
|
23
|
+
export interface IWorkflow extends IWorkflowValues {
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const WorkflowModel: import("@webiny/di").Abstraction<CmsModel>;
|
|
27
|
+
export declare namespace WorkflowModel {
|
|
28
|
+
type Interface = CmsModel;
|
|
29
|
+
}
|
|
30
|
+
export interface IWorkflowMapper {
|
|
31
|
+
fromCmsEntry(input: CmsEntry<Omit<IWorkflow, "id">>): IWorkflow;
|
|
32
|
+
toCmsEntry(input: IWorkflowInput): IWorkflow;
|
|
33
|
+
}
|
|
34
|
+
export declare const WorkflowMapper: import("@webiny/di").Abstraction<IWorkflowMapper>;
|
|
35
|
+
export declare namespace WorkflowMapper {
|
|
36
|
+
type Interface = IWorkflowMapper;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain/workflow/abstractions.js","sources":["../../../src/domain/workflow/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntry, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport type { IWorkflowInput } from \"~/features/shared/abstractions.js\";\n\nexport interface IWorkflowStepNotification {\n id: string;\n}\n\nexport interface IWorkflowStepTeam {\n id: string;\n}\n\nexport interface IWorkflowStep {\n id: string;\n title: string;\n color: string;\n description?: string;\n teams: NonEmptyArray<IWorkflowStepTeam>;\n notifications?: IWorkflowStepNotification[];\n}\n\nexport interface IWorkflowValues {\n app: string;\n name: string;\n steps: NonEmptyArray<IWorkflowStep>;\n}\n\nexport interface IWorkflow extends IWorkflowValues {\n id: string;\n}\n\n// Abstractions\nexport const WorkflowModel = createAbstraction<CmsModel>(\"WorkflowModel\");\n\nexport namespace WorkflowModel {\n export type Interface = CmsModel;\n}\n\nexport interface IWorkflowMapper {\n fromCmsEntry(input: CmsEntry<Omit<IWorkflow, \"id\">>): IWorkflow;\n toCmsEntry(input: IWorkflowInput): IWorkflow;\n}\n\nexport const WorkflowMapper = createAbstraction<IWorkflowMapper>(\"WorkflowMapper\");\n\nexport namespace WorkflowMapper {\n export type Interface = IWorkflowMapper;\n}\n"],"names":["WorkflowModel","createAbstraction","WorkflowMapper"],"mappings":";AAiCO,MAAMA,gBAAgBC,kBAA4B;AAWlD,MAAMC,iBAAiBD,kBAAmC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
export declare class WorkflowNotFoundError extends BaseError<{
|
|
3
|
+
id: string;
|
|
4
|
+
app: string;
|
|
5
|
+
}> {
|
|
6
|
+
readonly code: "Workflows/Workflow/NotFound";
|
|
7
|
+
constructor(data: {
|
|
8
|
+
id: string;
|
|
9
|
+
app: string;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export declare class WorkflowNotAuthorizedError extends BaseError {
|
|
13
|
+
readonly code: "Workflows/Workflow/NotAuthorized";
|
|
14
|
+
constructor(message?: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class WorkflowPersistenceError extends BaseError {
|
|
17
|
+
readonly code: "Workflows/Workflow/Persistence";
|
|
18
|
+
constructor(error: Error);
|
|
19
|
+
}
|
|
20
|
+
export declare class WorkflowValidationError extends BaseError {
|
|
21
|
+
readonly code: "Workflows/Workflow/Validation";
|
|
22
|
+
constructor(message: string);
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
class WorkflowNotFoundError extends BaseError {
|
|
3
|
+
constructor(data){
|
|
4
|
+
super({
|
|
5
|
+
message: `Workflow in app "${data.app}" with id "${data.id}" was not found!`,
|
|
6
|
+
data
|
|
7
|
+
}), this.code = "Workflows/Workflow/NotFound";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class WorkflowNotAuthorizedError extends BaseError {
|
|
11
|
+
constructor(message){
|
|
12
|
+
super({
|
|
13
|
+
message: message || "Not authorized to access workflow"
|
|
14
|
+
}), this.code = "Workflows/Workflow/NotAuthorized";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class WorkflowPersistenceError extends BaseError {
|
|
18
|
+
constructor(error){
|
|
19
|
+
super({
|
|
20
|
+
message: error.message
|
|
21
|
+
}), this.code = "Workflows/Workflow/Persistence";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class WorkflowValidationError extends BaseError {
|
|
25
|
+
constructor(message){
|
|
26
|
+
super({
|
|
27
|
+
message
|
|
28
|
+
}), this.code = "Workflows/Workflow/Validation";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export { WorkflowNotAuthorizedError, WorkflowNotFoundError, WorkflowPersistenceError, WorkflowValidationError };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain/workflow/errors.js","sources":["../../../src/domain/workflow/errors.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/api\";\n\nexport class WorkflowNotFoundError extends BaseError<{ id: string; app: string }> {\n override readonly code = \"Workflows/Workflow/NotFound\" as const;\n\n constructor(data: { id: string; app: string }) {\n super({\n message: `Workflow in app \"${data.app}\" with id \"${data.id}\" was not found!`,\n data\n });\n }\n}\n\nexport class WorkflowNotAuthorizedError extends BaseError {\n override readonly code = \"Workflows/Workflow/NotAuthorized\" as const;\n\n constructor(message?: string) {\n super({\n message: message || \"Not authorized to access workflow\"\n });\n }\n}\n\nexport class WorkflowPersistenceError extends BaseError {\n override readonly code = \"Workflows/Workflow/Persistence\" as const;\n\n constructor(error: Error) {\n super({\n message: error.message\n });\n }\n}\n\nexport class WorkflowValidationError extends BaseError {\n override readonly code = \"Workflows/Workflow/Validation\" as const;\n\n constructor(message: string) {\n super({\n message\n });\n }\n}\n"],"names":["WorkflowNotFoundError","BaseError","data","WorkflowNotAuthorizedError","message","WorkflowPersistenceError","error","WorkflowValidationError"],"mappings":";AAEO,MAAMA,8BAA8BC;IAGvC,YAAYC,IAAiC,CAAE;QAC3C,KAAK,CAAC;YACF,SAAS,CAAC,iBAAiB,EAAEA,KAAK,GAAG,CAAC,WAAW,EAAEA,KAAK,EAAE,CAAC,gBAAgB,CAAC;YAC5EA;QACJ,SANc,IAAI,GAAG;IAOzB;AACJ;AAEO,MAAMC,mCAAmCF;IAG5C,YAAYG,OAAgB,CAAE;QAC1B,KAAK,CAAC;YACF,SAASA,WAAW;QACxB,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMC,iCAAiCJ;IAG1C,YAAYK,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAASA,MAAM,OAAO;QAC1B,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMC,gCAAgCN;IAGzC,YAAYG,OAAe,CAAE;QACzB,KAAK,CAAC;YACFA;QACJ,SALc,IAAI,GAAG;IAMzB;AACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
|
+
import { WORKFLOW_MODEL_ID } from "../../constants.js";
|
|
3
|
+
export { WORKFLOW_MODEL_ID };
|
|
4
|
+
declare class WorkflowModelImpl implements ModelFactory.Interface {
|
|
5
|
+
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").PrivateModelBuilder[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare const WorkflowModel: typeof WorkflowModelImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/modelBuilder/abstractions").IModelFactory>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
|
+
import { WORKFLOW_MODEL_ID } from "../../constants.js";
|
|
3
|
+
class WorkflowModelImpl {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
return [
|
|
6
|
+
builder.private({
|
|
7
|
+
modelId: WORKFLOW_MODEL_ID,
|
|
8
|
+
name: "Workflow"
|
|
9
|
+
}).fields((fields)=>({
|
|
10
|
+
name: fields.text().label("Name").required("Workflow name is required."),
|
|
11
|
+
app: fields.text().label("App").required("App is required."),
|
|
12
|
+
steps: fields.object().label("Steps").list().required("Steps are required.").listMinLength(1, "At least one step is required.").fields((fields)=>({
|
|
13
|
+
id: fields.text().label("ID").required("ID is required."),
|
|
14
|
+
title: fields.text().label("Title").required("Title is required."),
|
|
15
|
+
color: fields.text().label("Color"),
|
|
16
|
+
description: fields.text().label("Description"),
|
|
17
|
+
teams: fields.object().label("Teams").list().fields((teamFields)=>({
|
|
18
|
+
id: teamFields.text().label("ID").required("ID is required.")
|
|
19
|
+
})),
|
|
20
|
+
notifications: fields.object().list().label("Notifications").fields((fields)=>({
|
|
21
|
+
id: fields.text().label("Id").required("Id is required.")
|
|
22
|
+
}))
|
|
23
|
+
}))
|
|
24
|
+
}))
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const WorkflowModel = ModelFactory.createImplementation({
|
|
29
|
+
implementation: WorkflowModelImpl,
|
|
30
|
+
dependencies: []
|
|
31
|
+
});
|
|
32
|
+
export { WORKFLOW_MODEL_ID, WorkflowModel };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=workflowModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain/workflow/workflowModel.js","sources":["../../../src/domain/workflow/workflowModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WORKFLOW_MODEL_ID } from \"~/constants.js\";\n\nexport { WORKFLOW_MODEL_ID };\n\nclass WorkflowModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: WORKFLOW_MODEL_ID,\n name: \"Workflow\"\n })\n .fields(fields => ({\n name: fields.text().label(\"Name\").required(\"Workflow name is required.\"),\n app: fields.text().label(\"App\").required(\"App is required.\"),\n steps: fields\n .object()\n .label(\"Steps\")\n .list()\n .required(\"Steps are required.\")\n .listMinLength(1, \"At least one step is required.\")\n .fields(fields => ({\n id: fields.text().label(\"ID\").required(\"ID is required.\"),\n title: fields.text().label(\"Title\").required(\"Title is required.\"),\n color: fields.text().label(\"Color\"),\n description: fields.text().label(\"Description\"),\n teams: fields\n .object()\n .label(\"Teams\")\n .list()\n .fields(teamFields => ({\n id: teamFields.text().label(\"ID\").required(\"ID is required.\")\n })),\n notifications: fields\n .object()\n .list()\n .label(\"Notifications\")\n .fields(fields => ({\n id: fields.text().label(\"Id\").required(\"Id is required.\")\n }))\n }))\n }))\n ];\n }\n}\n\nexport const WorkflowModel = ModelFactory.createImplementation({\n implementation: WorkflowModelImpl,\n dependencies: []\n});\n"],"names":["WorkflowModelImpl","builder","WORKFLOW_MODEL_ID","fields","teamFields","WorkflowModel","ModelFactory"],"mappings":";;AAKA,MAAMA;IACF,MAAa,QAAQC,OAA6B,EAAE;QAChD,OAAO;YACHA,QACK,OAAO,CAAC;gBACL,SAASC;gBACT,MAAM;YACV,GACC,MAAM,CAACC,CAAAA,SAAW;oBACf,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;oBAC3C,KAAKA,OAAO,IAAI,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC;oBACzC,OAAOA,OACF,MAAM,GACN,KAAK,CAAC,SACN,IAAI,GACJ,QAAQ,CAAC,uBACT,aAAa,CAAC,GAAG,kCACjB,MAAM,CAACA,CAAAA,SAAW;4BACf,IAAIA,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;4BACvC,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;4BAC7C,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC;4BAC3B,aAAaA,OAAO,IAAI,GAAG,KAAK,CAAC;4BACjC,OAAOA,OACF,MAAM,GACN,KAAK,CAAC,SACN,IAAI,GACJ,MAAM,CAACC,CAAAA,aAAe;oCACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;gCAC/C;4BACJ,eAAeD,OACV,MAAM,GACN,IAAI,GACJ,KAAK,CAAC,iBACN,MAAM,CAACA,CAAAA,SAAW;oCACf,IAAIA,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;gCAC3C;wBACR;gBACR;SACP;IACL;AACJ;AAEO,MAAME,gBAAgBC,aAAa,oBAAoB,CAAC;IAC3D,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|