@webiny/api-workflows 0.0.0-unstable.0d717d18dd → 0.0.0-unstable.33e4fd9647

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/WorkflowsFeature.js +55 -2
  2. package/WorkflowsFeature.js.map +1 -1
  3. package/WorkflowsSchemaFactory.d.ts +1 -0
  4. package/WorkflowsSchemaFactory.js +4 -0
  5. package/WorkflowsSchemaFactory.js.map +1 -1
  6. package/domain/workflow/abstractions.d.ts +13 -3
  7. package/domain/workflow/abstractions.js +2 -2
  8. package/domain/workflow/abstractions.js.map +1 -1
  9. package/domain/workflow/workflowModel.js +2 -1
  10. package/domain/workflow/workflowModel.js.map +1 -1
  11. package/domain/workflowState/abstractions.d.ts +13 -3
  12. package/domain/workflowState/abstractions.js +2 -2
  13. package/domain/workflowState/abstractions.js.map +1 -1
  14. package/domain/workflowState/stateModel.js +2 -1
  15. package/domain/workflowState/stateModel.js.map +1 -1
  16. package/features/WorkflowModelProviders.d.ts +34 -0
  17. package/features/WorkflowModelProviders.js +40 -0
  18. package/features/WorkflowModelProviders.js.map +1 -0
  19. package/features/workflow/CreateWorkflow/CreateWorkflowRepository.d.ts +3 -3
  20. package/features/workflow/CreateWorkflow/CreateWorkflowRepository.js +6 -5
  21. package/features/workflow/CreateWorkflow/CreateWorkflowRepository.js.map +1 -1
  22. package/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.d.ts +3 -3
  23. package/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.js +6 -5
  24. package/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.js.map +1 -1
  25. package/features/workflow/GetWorkflow/GetWorkflowRepository.d.ts +3 -3
  26. package/features/workflow/GetWorkflow/GetWorkflowRepository.js +6 -5
  27. package/features/workflow/GetWorkflow/GetWorkflowRepository.js.map +1 -1
  28. package/features/workflow/ListWorkflows/ListWorkflowsRepository.d.ts +3 -3
  29. package/features/workflow/ListWorkflows/ListWorkflowsRepository.js +7 -6
  30. package/features/workflow/ListWorkflows/ListWorkflowsRepository.js.map +1 -1
  31. package/features/workflow/UpdateWorkflow/UpdateWorkflowRepository.d.ts +3 -3
  32. package/features/workflow/UpdateWorkflow/UpdateWorkflowRepository.js +6 -5
  33. package/features/workflow/UpdateWorkflow/UpdateWorkflowRepository.js.map +1 -1
  34. package/features/workflowState/CreateWorkflowState/CreateWorkflowStateRepository.d.ts +3 -3
  35. package/features/workflowState/CreateWorkflowState/CreateWorkflowStateRepository.js +6 -5
  36. package/features/workflowState/CreateWorkflowState/CreateWorkflowStateRepository.js.map +1 -1
  37. package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.js +1 -0
  38. package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.js.map +1 -1
  39. package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.js +1 -0
  40. package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.js.map +1 -1
  41. package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateRepository.d.ts +3 -3
  42. package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateRepository.js +6 -5
  43. package/features/workflowState/DeleteWorkflowState/DeleteWorkflowStateRepository.js.map +1 -1
  44. package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateRepository.d.ts +3 -3
  45. package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateRepository.js +6 -5
  46. package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateRepository.js.map +1 -1
  47. package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.js +1 -0
  48. package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.js.map +1 -1
  49. package/features/workflowState/GetWorkflowState/GetWorkflowStateRepository.d.ts +3 -3
  50. package/features/workflowState/GetWorkflowState/GetWorkflowStateRepository.js +6 -5
  51. package/features/workflowState/GetWorkflowState/GetWorkflowStateRepository.js.map +1 -1
  52. package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.js +1 -0
  53. package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.js.map +1 -1
  54. package/features/workflowState/ListWorkflowStates/ListWorkflowStatesRepository.d.ts +3 -3
  55. package/features/workflowState/ListWorkflowStates/ListWorkflowStatesRepository.js +7 -6
  56. package/features/workflowState/ListWorkflowStates/ListWorkflowStatesRepository.js.map +1 -1
  57. package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.js +1 -0
  58. package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.js.map +1 -1
  59. package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateRepository.d.ts +3 -3
  60. package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateRepository.js +7 -6
  61. package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateRepository.js.map +1 -1
  62. package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.js +1 -0
  63. package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.js.map +1 -1
  64. package/package.json +13 -16
  65. package/WorkflowsInitializer.d.ts +0 -19
  66. package/WorkflowsInitializer.js +0 -97
  67. package/WorkflowsInitializer.js.map +0 -1
@@ -1,15 +1,68 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
- import { WorkflowsInitializer } from "./WorkflowsInitializer.js";
2
+ import { FeatureFlags } from "@webiny/api-core/features/featureFlags/abstractions.js";
3
3
  import { WorkflowsSchemaFactory } from "./WorkflowsSchemaFactory.js";
4
4
  import { WorkflowModel } from "./domain/workflow/workflowModel.js";
5
5
  import { WorkflowStateModel } from "./domain/workflowState/stateModel.js";
6
+ import { WorkflowModelProviderImpl, WorkflowStateModelProviderImpl } from "./features/WorkflowModelProviders.js";
7
+ import { WorkflowMapper } from "./domain/workflow/WorkflowMapper.js";
8
+ import { WorkflowStateMapper } from "./domain/workflowState/WorkflowStateMapper.js";
9
+ import { GetWorkflowFeature } from "./features/workflow/GetWorkflow/feature.js";
10
+ import { ListWorkflowsFeature } from "./features/workflow/ListWorkflows/feature.js";
11
+ import { CreateWorkflowFeature } from "./features/workflow/CreateWorkflow/feature.js";
12
+ import { DeleteWorkflowFeature } from "./features/workflow/DeleteWorkflow/feature.js";
13
+ import { UpdateWorkflowFeature } from "./features/workflow/UpdateWorkflow/feature.js";
14
+ import { StoreWorkflowFeature } from "./features/workflow/StoreWorkflow/feature.js";
15
+ import { GetWorkflowStateFeature } from "./features/workflowState/GetWorkflowState/feature.js";
16
+ import { GetTargetWorkflowStateFeature } from "./features/workflowState/GetTargetWorkflowState/feature.js";
17
+ import { ListOwnWorkflowStatesFeature } from "./features/workflowState/ListOwnWorkflowStates/feature.js";
18
+ import { ListWorkflowStatesFeature } from "./features/workflowState/ListWorkflowStates/feature.js";
19
+ import { ListRequestedWorkflowStatesFeature } from "./features/workflowState/ListRequestedWorkflowStates/feature.js";
20
+ import { CreateWorkflowStateFeature } from "./features/workflowState/CreateWorkflowState/feature.js";
21
+ import { UpdateWorkflowStateFeature } from "./features/workflowState/UpdateWorkflowState/feature.js";
22
+ import { CancelWorkflowStateFeature } from "./features/workflowState/CancelWorkflowState/feature.js";
23
+ import { DeleteWorkflowStateFeature } from "./features/workflowState/DeleteWorkflowState/feature.js";
24
+ import { DeleteTargetWorkflowStateFeature } from "./features/workflowState/DeleteTargetWorkflowState/feature.js";
25
+ import { StartWorkflowStateStepFeature } from "./features/workflowState/StartWorkflowStateStep/feature.js";
26
+ import { ApproveWorkflowStateStepFeature } from "./features/workflowState/ApproveWorkflowStateStep/feature.js";
27
+ import { RejectWorkflowStateStepFeature } from "./features/workflowState/RejectWorkflowStateStep/feature.js";
28
+ import { TakeOverWorkflowStateStepFeature } from "./features/workflowState/TakeOverWorkflowStateStep/feature.js";
29
+ import { GetUserTeamsFeature } from "./features/internal/GetUserTeams/feature.js";
30
+ import { ListNotificationTypesFeature } from "./features/notifications/ListNotificationTypes/index.js";
31
+ import { NotificationTransportFeature } from "./features/notifications/NotificationTransport/index.js";
6
32
  const WorkflowsFeature = createFeature({
7
33
  name: "Workflows",
8
34
  register (container) {
35
+ if (!container.resolve(FeatureFlags).get().isEnabled("advancedPublishingWorkflow")) return;
9
36
  container.register(WorkflowModel);
10
37
  container.register(WorkflowStateModel);
11
- container.register(WorkflowsInitializer);
12
38
  container.register(WorkflowsSchemaFactory);
39
+ container.register(WorkflowModelProviderImpl);
40
+ container.register(WorkflowStateModelProviderImpl);
41
+ container.register(WorkflowMapper);
42
+ container.register(WorkflowStateMapper);
43
+ ListNotificationTypesFeature.register(container);
44
+ NotificationTransportFeature.register(container);
45
+ GetWorkflowFeature.register(container);
46
+ ListWorkflowsFeature.register(container);
47
+ CreateWorkflowFeature.register(container);
48
+ DeleteWorkflowFeature.register(container);
49
+ UpdateWorkflowFeature.register(container);
50
+ StoreWorkflowFeature.register(container);
51
+ GetUserTeamsFeature.register(container);
52
+ GetWorkflowStateFeature.register(container);
53
+ GetTargetWorkflowStateFeature.register(container);
54
+ ListOwnWorkflowStatesFeature.register(container);
55
+ ListWorkflowStatesFeature.register(container);
56
+ ListRequestedWorkflowStatesFeature.register(container);
57
+ CreateWorkflowStateFeature.register(container);
58
+ UpdateWorkflowStateFeature.register(container);
59
+ CancelWorkflowStateFeature.register(container);
60
+ DeleteWorkflowStateFeature.register(container);
61
+ DeleteTargetWorkflowStateFeature.register(container);
62
+ StartWorkflowStateStepFeature.register(container);
63
+ ApproveWorkflowStateStepFeature.register(container);
64
+ RejectWorkflowStateStepFeature.register(container);
65
+ TakeOverWorkflowStateStepFeature.register(container);
13
66
  }
14
67
  });
15
68
  export { WorkflowsFeature };
@@ -1 +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"}
1
+ {"version":3,"file":"WorkflowsFeature.js","sources":["../src/WorkflowsFeature.ts"],"sourcesContent":["import { type Container, createFeature } from \"@webiny/feature/api\";\nimport { FeatureFlags } from \"@webiny/api-core/features/featureFlags/abstractions.js\";\nimport { WorkflowsSchemaFactory } from \"./WorkflowsSchemaFactory.js\";\nimport { WorkflowModel as WorkflowPrivateModel } from \"./domain/workflow/workflowModel.js\";\nimport { WorkflowStateModel as WorkflowStatePrivateModel } from \"./domain/workflowState/stateModel.js\";\nimport {\n WorkflowModelProviderImpl,\n WorkflowStateModelProviderImpl\n} from \"~/features/WorkflowModelProviders.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\nexport const WorkflowsFeature = createFeature({\n name: \"Workflows\",\n register(container: Container) {\n // Advanced publishing workflow is license-gated. Check the effective flag at register time\n // (the license is refreshed pre-register) so nothing is wired up without the entitlement.\n if (!container.resolve(FeatureFlags).get().isEnabled(\"advancedPublishingWorkflow\")) {\n return;\n }\n\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(WorkflowsSchemaFactory);\n\n // The per-tenant models are resolved on demand — see WorkflowModelProviders.\n container.register(WorkflowModelProviderImpl);\n container.register(WorkflowStateModelProviderImpl);\n\n container.register(WorkflowMapper);\n container.register(WorkflowStateMapper);\n\n // Notifications\n ListNotificationTypesFeature.register(container);\n NotificationTransportFeature.register(container);\n\n // Workflows\n GetWorkflowFeature.register(container);\n ListWorkflowsFeature.register(container);\n CreateWorkflowFeature.register(container);\n DeleteWorkflowFeature.register(container);\n UpdateWorkflowFeature.register(container);\n StoreWorkflowFeature.register(container);\n\n // Internal\n GetUserTeamsFeature.register(container);\n\n // Workflow state\n GetWorkflowStateFeature.register(container);\n GetTargetWorkflowStateFeature.register(container);\n ListOwnWorkflowStatesFeature.register(container);\n ListWorkflowStatesFeature.register(container);\n ListRequestedWorkflowStatesFeature.register(container);\n CreateWorkflowStateFeature.register(container);\n UpdateWorkflowStateFeature.register(container);\n CancelWorkflowStateFeature.register(container);\n DeleteWorkflowStateFeature.register(container);\n DeleteTargetWorkflowStateFeature.register(container);\n StartWorkflowStateStepFeature.register(container);\n ApproveWorkflowStateStepFeature.register(container);\n RejectWorkflowStateStepFeature.register(container);\n TakeOverWorkflowStateStepFeature.register(container);\n }\n});\n"],"names":["WorkflowsFeature","createFeature","container","FeatureFlags","WorkflowPrivateModel","WorkflowStatePrivateModel","WorkflowsSchemaFactory","WorkflowModelProviderImpl","WorkflowStateModelProviderImpl","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAoB;QAGzB,IAAI,CAACA,UAAU,OAAO,CAACC,cAAc,GAAG,GAAG,SAAS,CAAC,+BACjD;QAKJD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QAGnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QAEnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;QAGnBC,6BAA6B,QAAQ,CAACT;QACtCU,6BAA6B,QAAQ,CAACV;QAGtCW,mBAAmB,QAAQ,CAACX;QAC5BY,qBAAqB,QAAQ,CAACZ;QAC9Ba,sBAAsB,QAAQ,CAACb;QAC/Bc,sBAAsB,QAAQ,CAACd;QAC/Be,sBAAsB,QAAQ,CAACf;QAC/BgB,qBAAqB,QAAQ,CAAChB;QAG9BiB,oBAAoB,QAAQ,CAACjB;QAG7BkB,wBAAwB,QAAQ,CAAClB;QACjCmB,8BAA8B,QAAQ,CAACnB;QACvCoB,6BAA6B,QAAQ,CAACpB;QACtCqB,0BAA0B,QAAQ,CAACrB;QACnCsB,mCAAmC,QAAQ,CAACtB;QAC5CuB,2BAA2B,QAAQ,CAACvB;QACpCwB,2BAA2B,QAAQ,CAACxB;QACpCyB,2BAA2B,QAAQ,CAACzB;QACpC0B,2BAA2B,QAAQ,CAAC1B;QACpC2B,iCAAiC,QAAQ,CAAC3B;QAC1C4B,8BAA8B,QAAQ,CAAC5B;QACvC6B,gCAAgC,QAAQ,CAAC7B;QACzC8B,+BAA+B,QAAQ,CAAC9B;QACxC+B,iCAAiC,QAAQ,CAAC/B;IAC9C;AACJ"}
@@ -1,5 +1,6 @@
1
1
  import type { IGraphQLSchemaFactory, GraphQLSchemaFactory as GQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
2
2
  declare class WorkflowsSchemaFactoryImpl implements IGraphQLSchemaFactory {
3
+ getSchemaKey: () => string;
3
4
  execute(builder: GQLSchemaFactory.SchemaBuilder): Promise<GQLSchemaFactory.SchemaBuilder>;
4
5
  }
5
6
  export declare const WorkflowsSchemaFactory: typeof WorkflowsSchemaFactoryImpl & {
@@ -1,4 +1,5 @@
1
1
  import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
2
+ import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
2
3
  import { addNotificationsSchema } from "./graphql/notifications.js";
3
4
  import { addWorkflowsSchema } from "./graphql/workflows.js";
4
5
  import { addWorkflowStateSchema } from "./graphql/workflowState.js";
@@ -9,6 +10,9 @@ class WorkflowsSchemaFactoryImpl {
9
10
  addNotificationsSchema(builder);
10
11
  return builder;
11
12
  }
13
+ constructor(){
14
+ this.getSchemaKey = staticSchemaKey("api-workflows/WorkflowsSchemaFactoryImpl");
15
+ }
12
16
  }
13
17
  const WorkflowsSchemaFactory = GraphQLSchemaFactory.createImplementation({
14
18
  implementation: WorkflowsSchemaFactoryImpl,
@@ -1 +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"}
1
+ {"version":3,"file":"WorkflowsSchemaFactory.js","sources":["../src/WorkflowsSchemaFactory.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.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 public getSchemaKey = staticSchemaKey(\"api-workflows/WorkflowsSchemaFactoryImpl\");\n\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","staticSchemaKey","WorkflowsSchemaFactory","GraphQLSchemaFactory"],"mappings":";;;;;AAUA,MAAMA;IAGF,MAAM,QACFC,OAAuC,EACA;QACvCC,mBAAmBD;QACnBE,uBAAuBF;QACvBG,uBAAuBH;QAEvB,OAAOA;IACX;;aAVO,YAAY,GAAGI,gBAAgB;;AAW1C;AAEO,MAAMC,yBAAyBC,qBAAqB,oBAAoB,CAAC;IAC5E,gBAAgBP;IAChB,cAAc,EAAE;AACpB"}
@@ -23,9 +23,19 @@ export interface IWorkflowValues {
23
23
  export interface IWorkflow extends IWorkflowValues {
24
24
  id: string;
25
25
  }
26
- export declare const WorkflowModel: import("@webiny/di").Abstraction<CmsModel>;
27
- export declare namespace WorkflowModel {
28
- type Interface = CmsModel;
26
+ /**
27
+ * Provides the tenant's workflow CMS model.
28
+ *
29
+ * A provider rather than the model itself: fetching a model is asynchronous and tenant-dependent,
30
+ * while DI resolution is synchronous — so an already-resolved `CmsModel` could only be supplied by a
31
+ * per-request hook running before every consumer. Consumers `await get()` at the point of use.
32
+ */
33
+ export interface IWorkflowModelProvider {
34
+ get(): Promise<CmsModel>;
35
+ }
36
+ export declare const WorkflowModelProvider: import("@webiny/di").Abstraction<IWorkflowModelProvider>;
37
+ export declare namespace WorkflowModelProvider {
38
+ type Interface = IWorkflowModelProvider;
29
39
  }
30
40
  export interface IWorkflowMapper {
31
41
  fromCmsEntry(input: CmsEntry<Omit<IWorkflow, "id">>): IWorkflow;
@@ -1,6 +1,6 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
- const WorkflowModel = createAbstraction("WorkflowModel");
2
+ const WorkflowModelProvider = createAbstraction("WorkflowModelProvider");
3
3
  const WorkflowMapper = createAbstraction("WorkflowMapper");
4
- export { WorkflowMapper, WorkflowModel };
4
+ export { WorkflowMapper, WorkflowModelProvider };
5
5
 
6
6
  //# sourceMappingURL=abstractions.js.map
@@ -1 +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"}
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\n/**\n * Provides the tenant's workflow CMS model.\n *\n * A provider rather than the model itself: fetching a model is asynchronous and tenant-dependent,\n * while DI resolution is synchronous — so an already-resolved `CmsModel` could only be supplied by a\n * per-request hook running before every consumer. Consumers `await get()` at the point of use.\n */\nexport interface IWorkflowModelProvider {\n get(): Promise<CmsModel>;\n}\n\nexport const WorkflowModelProvider =\n createAbstraction<IWorkflowModelProvider>(\"WorkflowModelProvider\");\n\nexport namespace WorkflowModelProvider {\n export type Interface = IWorkflowModelProvider;\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":["WorkflowModelProvider","createAbstraction","WorkflowMapper"],"mappings":";AA4CO,MAAMA,wBACTC,kBAA0C;AAWvC,MAAMC,iBAAiBD,kBAAmC"}
@@ -5,7 +5,8 @@ class WorkflowModelImpl {
5
5
  return [
6
6
  builder.private({
7
7
  modelId: WORKFLOW_MODEL_ID,
8
- name: "Workflow"
8
+ name: "Workflow",
9
+ lifecycleEvents: false
9
10
  }).fields((fields)=>({
10
11
  name: fields.text().label("Name").required("Workflow name is required."),
11
12
  app: fields.text().label("App").required("App is required."),
@@ -1 +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"}
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 lifecycleEvents: false\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;gBACN,iBAAiB;YACrB,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"}
@@ -60,9 +60,19 @@ export interface IWorkflowState {
60
60
  readonly nextStep: IEnrichedWorkflowStateRecordStep | null;
61
61
  readonly previousStep: IEnrichedWorkflowStateRecordStep | null;
62
62
  }
63
- export declare const WorkflowStateModel: import("@webiny/di").Abstraction<CmsModel>;
64
- export declare namespace WorkflowStateModel {
65
- type Interface = CmsModel;
63
+ /**
64
+ * Provides the tenant's workflow state CMS model.
65
+ *
66
+ * A provider rather than the model itself: fetching a model is asynchronous and tenant-dependent,
67
+ * while DI resolution is synchronous — so an already-resolved `CmsModel` could only be supplied by a
68
+ * per-request hook running before every consumer. Consumers `await get()` at the point of use.
69
+ */
70
+ export interface IWorkflowStateModelProvider {
71
+ get(): Promise<CmsModel>;
72
+ }
73
+ export declare const WorkflowStateModelProvider: import("@webiny/di").Abstraction<IWorkflowStateModelProvider>;
74
+ export declare namespace WorkflowStateModelProvider {
75
+ type Interface = IWorkflowStateModelProvider;
66
76
  }
67
77
  export type IWorkflowStateTransformerFromCmsEntryInput = CmsEntry<Omit<IWorkflowStateRecord, "id" | "savedOn" | "createdOn" | "savedBy" | "createdBy">>;
68
78
  export type IWorkflowStateTransformerFromCmsEntryOutput = IWorkflowStateRecord;
@@ -6,8 +6,8 @@ var abstractions_WorkflowStateRecordState = /*#__PURE__*/ function(WorkflowState
6
6
  WorkflowStateRecordState["rejected"] = "rejected";
7
7
  return WorkflowStateRecordState;
8
8
  }({});
9
- const WorkflowStateModel = createAbstraction("WorkflowStateModel");
9
+ const WorkflowStateModelProvider = createAbstraction("WorkflowStateModelProvider");
10
10
  const WorkflowStateMapper = createAbstraction("WorkflowStateMapper");
11
- export { WorkflowStateMapper, WorkflowStateModel, abstractions_WorkflowStateRecordState as WorkflowStateRecordState };
11
+ export { WorkflowStateMapper, WorkflowStateModelProvider, abstractions_WorkflowStateRecordState as WorkflowStateRecordState };
12
12
 
13
13
  //# sourceMappingURL=abstractions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"domain/workflowState/abstractions.js","sources":["../../../src/domain/workflowState/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntry, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport type { IWorkflowStep } from \"../workflow/abstractions.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport enum WorkflowStateRecordState {\n pending = \"pending\",\n inReview = \"inReview\",\n approved = \"approved\",\n rejected = \"rejected\"\n}\n\nexport interface IWorkflowStateIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n\nexport interface IWorkflowStateRecordStep extends IWorkflowStep {\n state: WorkflowStateRecordState;\n comment: string | null;\n savedBy: IWorkflowStateIdentity | null;\n}\n\nexport interface IWorkflowStateRecord<\n Steps extends IWorkflowStateRecordStep = IWorkflowStateRecordStep\n> {\n id: string;\n app: string;\n title: string;\n workflowId: string;\n targetId: string;\n targetRevisionId: string;\n isActive: boolean;\n comment: string | undefined;\n state: WorkflowStateRecordState;\n steps: Steps[];\n createdOn: Date;\n savedOn: Date;\n createdBy: IWorkflowStateIdentity;\n savedBy: IWorkflowStateIdentity;\n targetContext: GenericRecord;\n}\n\nexport interface IEnrichedWorkflowStateRecordStep extends IWorkflowStateRecordStep {\n isOwner: boolean;\n canTakeOver: boolean;\n canReview: boolean;\n}\n\nexport interface IWorkflowState {\n readonly id: string;\n readonly app: string;\n readonly title: string;\n readonly workflowId: string;\n readonly targetId: string;\n readonly targetRevisionId: string;\n readonly isActive: boolean;\n readonly comment: string | undefined;\n readonly state: WorkflowStateRecordState;\n readonly steps: IEnrichedWorkflowStateRecordStep[];\n readonly createdOn: Date;\n readonly savedOn: Date;\n readonly createdBy: IWorkflowStateIdentity;\n readonly savedBy: IWorkflowStateIdentity;\n readonly targetContext: GenericRecord;\n readonly done: boolean;\n readonly currentStep: IEnrichedWorkflowStateRecordStep;\n readonly nextStep: IEnrichedWorkflowStateRecordStep | null;\n readonly previousStep: IEnrichedWorkflowStateRecordStep | null;\n}\n\n// Abstractions\nexport const WorkflowStateModel = createAbstraction<CmsModel>(\"WorkflowStateModel\");\n\nexport namespace WorkflowStateModel {\n export type Interface = CmsModel;\n}\n\nexport type IWorkflowStateTransformerFromCmsEntryInput = CmsEntry<\n Omit<IWorkflowStateRecord, \"id\" | \"savedOn\" | \"createdOn\" | \"savedBy\" | \"createdBy\">\n>;\n\nexport type IWorkflowStateTransformerFromCmsEntryOutput = IWorkflowStateRecord;\n\nexport type IWorkflowStateTransformerToCmsEntryInput = Omit<\n IWorkflowStateRecord,\n \"savedOn\" | \"createdOn\" | \"savedBy\"\n>;\n\nexport type IWorkflowStateTransformerToCmsEntryOutput = Omit<\n IWorkflowStateRecord,\n \"id\" | \"savedOn\" | \"createdOn\" | \"savedBy\" | \"createdBy\"\n>;\n\nexport interface IWorkflowStateMapper {\n fromCmsEntry(\n input: IWorkflowStateTransformerFromCmsEntryInput\n ): IWorkflowStateTransformerFromCmsEntryOutput;\n toCmsEntry(\n input: IWorkflowStateTransformerToCmsEntryInput\n ): IWorkflowStateTransformerToCmsEntryOutput;\n}\n\nexport const WorkflowStateMapper = createAbstraction<IWorkflowStateMapper>(\"WorkflowStateMapper\");\n\nexport namespace WorkflowStateMapper {\n export type Interface = IWorkflowStateMapper;\n}\n"],"names":["WorkflowStateRecordState","WorkflowStateModel","createAbstraction","WorkflowStateMapper"],"mappings":";AAKO,IAAKA,wCAAwBA,WAAAA,GAAAA,SAAxBA,wBAAwB;;;;;WAAxBA;;AAoEL,MAAMC,qBAAqBC,kBAA4B;AA+BvD,MAAMC,sBAAsBD,kBAAwC"}
1
+ {"version":3,"file":"domain/workflowState/abstractions.js","sources":["../../../src/domain/workflowState/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntry, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport type { IWorkflowStep } from \"../workflow/abstractions.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport enum WorkflowStateRecordState {\n pending = \"pending\",\n inReview = \"inReview\",\n approved = \"approved\",\n rejected = \"rejected\"\n}\n\nexport interface IWorkflowStateIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n\nexport interface IWorkflowStateRecordStep extends IWorkflowStep {\n state: WorkflowStateRecordState;\n comment: string | null;\n savedBy: IWorkflowStateIdentity | null;\n}\n\nexport interface IWorkflowStateRecord<\n Steps extends IWorkflowStateRecordStep = IWorkflowStateRecordStep\n> {\n id: string;\n app: string;\n title: string;\n workflowId: string;\n targetId: string;\n targetRevisionId: string;\n isActive: boolean;\n comment: string | undefined;\n state: WorkflowStateRecordState;\n steps: Steps[];\n createdOn: Date;\n savedOn: Date;\n createdBy: IWorkflowStateIdentity;\n savedBy: IWorkflowStateIdentity;\n targetContext: GenericRecord;\n}\n\nexport interface IEnrichedWorkflowStateRecordStep extends IWorkflowStateRecordStep {\n isOwner: boolean;\n canTakeOver: boolean;\n canReview: boolean;\n}\n\nexport interface IWorkflowState {\n readonly id: string;\n readonly app: string;\n readonly title: string;\n readonly workflowId: string;\n readonly targetId: string;\n readonly targetRevisionId: string;\n readonly isActive: boolean;\n readonly comment: string | undefined;\n readonly state: WorkflowStateRecordState;\n readonly steps: IEnrichedWorkflowStateRecordStep[];\n readonly createdOn: Date;\n readonly savedOn: Date;\n readonly createdBy: IWorkflowStateIdentity;\n readonly savedBy: IWorkflowStateIdentity;\n readonly targetContext: GenericRecord;\n readonly done: boolean;\n readonly currentStep: IEnrichedWorkflowStateRecordStep;\n readonly nextStep: IEnrichedWorkflowStateRecordStep | null;\n readonly previousStep: IEnrichedWorkflowStateRecordStep | null;\n}\n\n// Abstractions\n/**\n * Provides the tenant's workflow state CMS model.\n *\n * A provider rather than the model itself: fetching a model is asynchronous and tenant-dependent,\n * while DI resolution is synchronous — so an already-resolved `CmsModel` could only be supplied by a\n * per-request hook running before every consumer. Consumers `await get()` at the point of use.\n */\nexport interface IWorkflowStateModelProvider {\n get(): Promise<CmsModel>;\n}\n\nexport const WorkflowStateModelProvider = createAbstraction<IWorkflowStateModelProvider>(\n \"WorkflowStateModelProvider\"\n);\n\nexport namespace WorkflowStateModelProvider {\n export type Interface = IWorkflowStateModelProvider;\n}\n\nexport type IWorkflowStateTransformerFromCmsEntryInput = CmsEntry<\n Omit<IWorkflowStateRecord, \"id\" | \"savedOn\" | \"createdOn\" | \"savedBy\" | \"createdBy\">\n>;\n\nexport type IWorkflowStateTransformerFromCmsEntryOutput = IWorkflowStateRecord;\n\nexport type IWorkflowStateTransformerToCmsEntryInput = Omit<\n IWorkflowStateRecord,\n \"savedOn\" | \"createdOn\" | \"savedBy\"\n>;\n\nexport type IWorkflowStateTransformerToCmsEntryOutput = Omit<\n IWorkflowStateRecord,\n \"id\" | \"savedOn\" | \"createdOn\" | \"savedBy\" | \"createdBy\"\n>;\n\nexport interface IWorkflowStateMapper {\n fromCmsEntry(\n input: IWorkflowStateTransformerFromCmsEntryInput\n ): IWorkflowStateTransformerFromCmsEntryOutput;\n toCmsEntry(\n input: IWorkflowStateTransformerToCmsEntryInput\n ): IWorkflowStateTransformerToCmsEntryOutput;\n}\n\nexport const WorkflowStateMapper = createAbstraction<IWorkflowStateMapper>(\"WorkflowStateMapper\");\n\nexport namespace WorkflowStateMapper {\n export type Interface = IWorkflowStateMapper;\n}\n"],"names":["WorkflowStateRecordState","WorkflowStateModelProvider","createAbstraction","WorkflowStateMapper"],"mappings":";AAKO,IAAKA,wCAAwBA,WAAAA,GAAAA,SAAxBA,wBAAwB;;;;;WAAxBA;;AA+EL,MAAMC,6BAA6BC,kBACtC;AAgCG,MAAMC,sBAAsBD,kBAAwC"}
@@ -24,7 +24,8 @@ class WorkflowStateModelImpl {
24
24
  return [
25
25
  builder.private({
26
26
  modelId: WORKFLOW_STATE_MODEL_ID,
27
- name: "RecordWorkflow State"
27
+ name: "RecordWorkflow State",
28
+ lifecycleEvents: false
28
29
  }).fields((fields)=>({
29
30
  workflowId: fields.text().label("Workflow ID"),
30
31
  app: fields.text().label("App").required("App is required."),
@@ -1 +1 @@
1
- {"version":3,"file":"domain/workflowState/stateModel.js","sources":["../../../src/domain/workflowState/stateModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WorkflowStateRecordState } from \"~/domain/workflowState/abstractions.js\";\n\nexport const WORKFLOW_STATE_MODEL_ID = \"wbyWorkflowState\";\n\nconst states = [\n {\n label: \"Pending\",\n value: WorkflowStateRecordState.pending\n },\n {\n label: \"In Review\",\n value: WorkflowStateRecordState.inReview\n },\n {\n label: \"Approved\",\n value: WorkflowStateRecordState.approved\n },\n {\n label: \"Rejected\",\n value: WorkflowStateRecordState.rejected\n }\n];\n\nclass WorkflowStateModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: WORKFLOW_STATE_MODEL_ID,\n name: \"RecordWorkflow State\"\n })\n .fields(fields => ({\n workflowId: fields.text().label(\"Workflow ID\"),\n app: fields.text().label(\"App\").required(\"App is required.\"),\n title: fields.text().label(\"Title\").required(\"Title is required.\"),\n targetRevisionId: fields.text().label(\"Target Revision ID\"),\n targetId: fields.text().label(\"Target ID\"),\n isActive: fields.boolean().label(\"Is Active\"),\n comment: fields.text().label(\"Comment\"),\n state: fields.text().label(\"State\").predefinedValues(states),\n targetContext: fields.json().label(\"Target Context\"),\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(stepFields => ({\n id: stepFields.text().label(\"ID\").required(\"ID is required.\"),\n title: stepFields.text().label(\"Title\").required(\"Title is required.\"),\n color: stepFields.text().label(\"Color\").required(\"Color is required.\"),\n description: stepFields.text().label(\"Description\"),\n teams: stepFields\n .object()\n .label(\"Teams\")\n .list()\n .required(\"At least one team is required.\")\n .listMinLength(1, \"At least one team is required.\")\n .fields(teamFields => ({\n id: teamFields.text().label(\"ID\").required(\"ID is required.\")\n })),\n notifications: stepFields\n .object()\n .label(\"Notifications\")\n .list()\n .fields(notificationFields => ({\n id: notificationFields\n .text()\n .label(\"ID\")\n .required(\"ID is required.\")\n })),\n state: stepFields.text().label(\"State\").predefinedValues(states),\n savedBy: stepFields\n .object()\n .label(\"User\")\n .fields(userFields => ({\n id: userFields.text().label(\"ID\").required(\"ID is required.\"),\n displayName: userFields\n .text()\n .label(\"Display Name\")\n .required(\"Display name is required.\"),\n type: userFields\n .text()\n .label(\"Type\")\n .required(\"Type is required.\")\n })),\n comment: stepFields.text().label(\"Comment\")\n }))\n }))\n ];\n }\n}\n\nexport const WorkflowStateModel = ModelFactory.createImplementation({\n implementation: WorkflowStateModelImpl,\n dependencies: []\n});\n"],"names":["WORKFLOW_STATE_MODEL_ID","states","WorkflowStateRecordState","WorkflowStateModelImpl","builder","fields","stepFields","teamFields","notificationFields","userFields","WorkflowStateModel","ModelFactory"],"mappings":";;AAGO,MAAMA,0BAA0B;AAEvC,MAAMC,SAAS;IACX;QACI,OAAO;QACP,OAAOC,yBAAyB,OAAO;IAC3C;IACA;QACI,OAAO;QACP,OAAOA,yBAAyB,QAAQ;IAC5C;IACA;QACI,OAAO;QACP,OAAOA,yBAAyB,QAAQ;IAC5C;IACA;QACI,OAAO;QACP,OAAOA,yBAAyB,QAAQ;IAC5C;CACH;AAED,MAAMC;IACF,MAAa,QAAQC,OAA6B,EAAE;QAChD,OAAO;YACHA,QACK,OAAO,CAAC;gBACL,SAASJ;gBACT,MAAM;YACV,GACC,MAAM,CAACK,CAAAA,SAAW;oBACf,YAAYA,OAAO,IAAI,GAAG,KAAK,CAAC;oBAChC,KAAKA,OAAO,IAAI,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC;oBACzC,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;oBAC7C,kBAAkBA,OAAO,IAAI,GAAG,KAAK,CAAC;oBACtC,UAAUA,OAAO,IAAI,GAAG,KAAK,CAAC;oBAC9B,UAAUA,OAAO,OAAO,GAAG,KAAK,CAAC;oBACjC,SAASA,OAAO,IAAI,GAAG,KAAK,CAAC;oBAC7B,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC,SAAS,gBAAgB,CAACJ;oBACrD,eAAeI,OAAO,IAAI,GAAG,KAAK,CAAC;oBACnC,OAAOA,OACF,MAAM,GACN,KAAK,CAAC,SACN,IAAI,GACJ,QAAQ,CAAC,uBACT,aAAa,CAAC,GAAG,kCACjB,MAAM,CAACC,CAAAA,aAAe;4BACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;4BAC3C,OAAOA,WAAW,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;4BACjD,OAAOA,WAAW,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;4BACjD,aAAaA,WAAW,IAAI,GAAG,KAAK,CAAC;4BACrC,OAAOA,WACF,MAAM,GACN,KAAK,CAAC,SACN,IAAI,GACJ,QAAQ,CAAC,kCACT,aAAa,CAAC,GAAG,kCACjB,MAAM,CAACC,CAAAA,aAAe;oCACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;gCAC/C;4BACJ,eAAeD,WACV,MAAM,GACN,KAAK,CAAC,iBACN,IAAI,GACJ,MAAM,CAACE,CAAAA,qBAAuB;oCAC3B,IAAIA,mBACC,IAAI,GACJ,KAAK,CAAC,MACN,QAAQ,CAAC;gCAClB;4BACJ,OAAOF,WAAW,IAAI,GAAG,KAAK,CAAC,SAAS,gBAAgB,CAACL;4BACzD,SAASK,WACJ,MAAM,GACN,KAAK,CAAC,QACN,MAAM,CAACG,CAAAA,aAAe;oCACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;oCAC3C,aAAaA,WACR,IAAI,GACJ,KAAK,CAAC,gBACN,QAAQ,CAAC;oCACd,MAAMA,WACD,IAAI,GACJ,KAAK,CAAC,QACN,QAAQ,CAAC;gCAClB;4BACJ,SAASH,WAAW,IAAI,GAAG,KAAK,CAAC;wBACrC;gBACR;SACP;IACL;AACJ;AAEO,MAAMI,qBAAqBC,aAAa,oBAAoB,CAAC;IAChE,gBAAgBR;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"domain/workflowState/stateModel.js","sources":["../../../src/domain/workflowState/stateModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WorkflowStateRecordState } from \"~/domain/workflowState/abstractions.js\";\n\nexport const WORKFLOW_STATE_MODEL_ID = \"wbyWorkflowState\";\n\nconst states = [\n {\n label: \"Pending\",\n value: WorkflowStateRecordState.pending\n },\n {\n label: \"In Review\",\n value: WorkflowStateRecordState.inReview\n },\n {\n label: \"Approved\",\n value: WorkflowStateRecordState.approved\n },\n {\n label: \"Rejected\",\n value: WorkflowStateRecordState.rejected\n }\n];\n\nclass WorkflowStateModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: WORKFLOW_STATE_MODEL_ID,\n name: \"RecordWorkflow State\",\n lifecycleEvents: false\n })\n .fields(fields => ({\n workflowId: fields.text().label(\"Workflow ID\"),\n app: fields.text().label(\"App\").required(\"App is required.\"),\n title: fields.text().label(\"Title\").required(\"Title is required.\"),\n targetRevisionId: fields.text().label(\"Target Revision ID\"),\n targetId: fields.text().label(\"Target ID\"),\n isActive: fields.boolean().label(\"Is Active\"),\n comment: fields.text().label(\"Comment\"),\n state: fields.text().label(\"State\").predefinedValues(states),\n targetContext: fields.json().label(\"Target Context\"),\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(stepFields => ({\n id: stepFields.text().label(\"ID\").required(\"ID is required.\"),\n title: stepFields.text().label(\"Title\").required(\"Title is required.\"),\n color: stepFields.text().label(\"Color\").required(\"Color is required.\"),\n description: stepFields.text().label(\"Description\"),\n teams: stepFields\n .object()\n .label(\"Teams\")\n .list()\n .required(\"At least one team is required.\")\n .listMinLength(1, \"At least one team is required.\")\n .fields(teamFields => ({\n id: teamFields.text().label(\"ID\").required(\"ID is required.\")\n })),\n notifications: stepFields\n .object()\n .label(\"Notifications\")\n .list()\n .fields(notificationFields => ({\n id: notificationFields\n .text()\n .label(\"ID\")\n .required(\"ID is required.\")\n })),\n state: stepFields.text().label(\"State\").predefinedValues(states),\n savedBy: stepFields\n .object()\n .label(\"User\")\n .fields(userFields => ({\n id: userFields.text().label(\"ID\").required(\"ID is required.\"),\n displayName: userFields\n .text()\n .label(\"Display Name\")\n .required(\"Display name is required.\"),\n type: userFields\n .text()\n .label(\"Type\")\n .required(\"Type is required.\")\n })),\n comment: stepFields.text().label(\"Comment\")\n }))\n }))\n ];\n }\n}\n\nexport const WorkflowStateModel = ModelFactory.createImplementation({\n implementation: WorkflowStateModelImpl,\n dependencies: []\n});\n"],"names":["WORKFLOW_STATE_MODEL_ID","states","WorkflowStateRecordState","WorkflowStateModelImpl","builder","fields","stepFields","teamFields","notificationFields","userFields","WorkflowStateModel","ModelFactory"],"mappings":";;AAGO,MAAMA,0BAA0B;AAEvC,MAAMC,SAAS;IACX;QACI,OAAO;QACP,OAAOC,yBAAyB,OAAO;IAC3C;IACA;QACI,OAAO;QACP,OAAOA,yBAAyB,QAAQ;IAC5C;IACA;QACI,OAAO;QACP,OAAOA,yBAAyB,QAAQ;IAC5C;IACA;QACI,OAAO;QACP,OAAOA,yBAAyB,QAAQ;IAC5C;CACH;AAED,MAAMC;IACF,MAAa,QAAQC,OAA6B,EAAE;QAChD,OAAO;YACHA,QACK,OAAO,CAAC;gBACL,SAASJ;gBACT,MAAM;gBACN,iBAAiB;YACrB,GACC,MAAM,CAACK,CAAAA,SAAW;oBACf,YAAYA,OAAO,IAAI,GAAG,KAAK,CAAC;oBAChC,KAAKA,OAAO,IAAI,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC;oBACzC,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;oBAC7C,kBAAkBA,OAAO,IAAI,GAAG,KAAK,CAAC;oBACtC,UAAUA,OAAO,IAAI,GAAG,KAAK,CAAC;oBAC9B,UAAUA,OAAO,OAAO,GAAG,KAAK,CAAC;oBACjC,SAASA,OAAO,IAAI,GAAG,KAAK,CAAC;oBAC7B,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC,SAAS,gBAAgB,CAACJ;oBACrD,eAAeI,OAAO,IAAI,GAAG,KAAK,CAAC;oBACnC,OAAOA,OACF,MAAM,GACN,KAAK,CAAC,SACN,IAAI,GACJ,QAAQ,CAAC,uBACT,aAAa,CAAC,GAAG,kCACjB,MAAM,CAACC,CAAAA,aAAe;4BACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;4BAC3C,OAAOA,WAAW,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;4BACjD,OAAOA,WAAW,IAAI,GAAG,KAAK,CAAC,SAAS,QAAQ,CAAC;4BACjD,aAAaA,WAAW,IAAI,GAAG,KAAK,CAAC;4BACrC,OAAOA,WACF,MAAM,GACN,KAAK,CAAC,SACN,IAAI,GACJ,QAAQ,CAAC,kCACT,aAAa,CAAC,GAAG,kCACjB,MAAM,CAACC,CAAAA,aAAe;oCACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;gCAC/C;4BACJ,eAAeD,WACV,MAAM,GACN,KAAK,CAAC,iBACN,IAAI,GACJ,MAAM,CAACE,CAAAA,qBAAuB;oCAC3B,IAAIA,mBACC,IAAI,GACJ,KAAK,CAAC,MACN,QAAQ,CAAC;gCAClB;4BACJ,OAAOF,WAAW,IAAI,GAAG,KAAK,CAAC,SAAS,gBAAgB,CAACL;4BACzD,SAASK,WACJ,MAAM,GACN,KAAK,CAAC,QACN,MAAM,CAACG,CAAAA,aAAe;oCACnB,IAAIA,WAAW,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;oCAC3C,aAAaA,WACR,IAAI,GACJ,KAAK,CAAC,gBACN,QAAQ,CAAC;oCACd,MAAMA,WACD,IAAI,GACJ,KAAK,CAAC,QACN,QAAQ,CAAC;gCAClB;4BACJ,SAASH,WAAW,IAAI,GAAG,KAAK,CAAC;wBACrC;gBACR;SACP;IACL;AACJ;AAEO,MAAMI,qBAAqBC,aAAa,oBAAoB,CAAC;IAChE,gBAAgBR;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,34 @@
1
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
2
+ import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
3
+ import { WorkflowModelProvider } from "../domain/workflow/abstractions.js";
4
+ import { WorkflowStateModelProvider } from "../domain/workflowState/abstractions.js";
5
+ /**
6
+ * Resolve the tenant's workflow models on demand, replacing the per-request hook
7
+ * (`WorkflowsInitializer`) that used to push already-resolved models into the container.
8
+ *
9
+ * No memoization: `ModelsFetcher` already caches the model list per request (`ModelCache` is a
10
+ * per-request `createMemoryCache()`). No `withoutAuthorization` either — both models are private,
11
+ * and `PrivateModelBuilder` sets `authorization: false`, which short-circuits `canAccessModel()` to
12
+ * true for every identity, so the wrapper the initializer used changed nothing.
13
+ *
14
+ * `GetModelUseCase` is an ordinary constructor dependency: a provider is only constructed when a
15
+ * consumer first awaits `get()`, during request handling — after the CMS has registered everything
16
+ * the use case needs. That timing is what forced the initializer's lazy `container.resolve()`.
17
+ */
18
+ declare class WorkflowModelProviderImplementation implements WorkflowModelProvider.Interface {
19
+ private getModel;
20
+ constructor(getModel: GetModelUseCase.Interface);
21
+ get(): Promise<CmsModel>;
22
+ }
23
+ declare class WorkflowStateModelProviderImplementation implements WorkflowStateModelProvider.Interface {
24
+ private getModel;
25
+ constructor(getModel: GetModelUseCase.Interface);
26
+ get(): Promise<CmsModel>;
27
+ }
28
+ export declare const WorkflowModelProviderImpl: typeof WorkflowModelProviderImplementation & {
29
+ __abstraction: import("@webiny/di").Abstraction<import("~/domain/workflow/abstractions.js").IWorkflowModelProvider>;
30
+ };
31
+ export declare const WorkflowStateModelProviderImpl: typeof WorkflowStateModelProviderImplementation & {
32
+ __abstraction: import("@webiny/di").Abstraction<import("~/domain/workflowState/abstractions.js").IWorkflowStateModelProvider>;
33
+ };
34
+ export {};
@@ -0,0 +1,40 @@
1
+ import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
2
+ import { WorkflowModelProvider } from "../domain/workflow/abstractions.js";
3
+ import { WorkflowStateModelProvider } from "../domain/workflowState/abstractions.js";
4
+ import { WORKFLOW_MODEL_ID } from "../constants.js";
5
+ import { WORKFLOW_STATE_MODEL_ID } from "../domain/workflowState/stateModel.js";
6
+ class WorkflowModelProviderImplementation {
7
+ constructor(getModel){
8
+ this.getModel = getModel;
9
+ }
10
+ async get() {
11
+ const result = await this.getModel.execute(WORKFLOW_MODEL_ID);
12
+ if (result.isFail()) throw result.error;
13
+ return result.value;
14
+ }
15
+ }
16
+ class WorkflowStateModelProviderImplementation {
17
+ constructor(getModel){
18
+ this.getModel = getModel;
19
+ }
20
+ async get() {
21
+ const result = await this.getModel.execute(WORKFLOW_STATE_MODEL_ID);
22
+ if (result.isFail()) throw result.error;
23
+ return result.value;
24
+ }
25
+ }
26
+ const WorkflowModelProviderImpl = WorkflowModelProvider.createImplementation({
27
+ implementation: WorkflowModelProviderImplementation,
28
+ dependencies: [
29
+ GetModelUseCase
30
+ ]
31
+ });
32
+ const WorkflowStateModelProviderImpl = WorkflowStateModelProvider.createImplementation({
33
+ implementation: WorkflowStateModelProviderImplementation,
34
+ dependencies: [
35
+ GetModelUseCase
36
+ ]
37
+ });
38
+ export { WorkflowModelProviderImpl, WorkflowStateModelProviderImpl };
39
+
40
+ //# sourceMappingURL=WorkflowModelProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/WorkflowModelProviders.js","sources":["../../src/features/WorkflowModelProviders.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { WorkflowModelProvider } from \"~/domain/workflow/abstractions.js\";\nimport { WorkflowStateModelProvider } from \"~/domain/workflowState/abstractions.js\";\nimport { WORKFLOW_MODEL_ID } from \"~/constants.js\";\nimport { WORKFLOW_STATE_MODEL_ID } from \"~/domain/workflowState/stateModel.js\";\n\n/**\n * Resolve the tenant's workflow models on demand, replacing the per-request hook\n * (`WorkflowsInitializer`) that used to push already-resolved models into the container.\n *\n * No memoization: `ModelsFetcher` already caches the model list per request (`ModelCache` is a\n * per-request `createMemoryCache()`). No `withoutAuthorization` either — both models are private,\n * and `PrivateModelBuilder` sets `authorization: false`, which short-circuits `canAccessModel()` to\n * true for every identity, so the wrapper the initializer used changed nothing.\n *\n * `GetModelUseCase` is an ordinary constructor dependency: a provider is only constructed when a\n * consumer first awaits `get()`, during request handling — after the CMS has registered everything\n * the use case needs. That timing is what forced the initializer's lazy `container.resolve()`.\n */\nclass WorkflowModelProviderImplementation implements WorkflowModelProvider.Interface {\n constructor(private getModel: GetModelUseCase.Interface) {}\n\n async get(): Promise<CmsModel> {\n const result = await this.getModel.execute(WORKFLOW_MODEL_ID);\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n }\n}\n\nclass WorkflowStateModelProviderImplementation implements WorkflowStateModelProvider.Interface {\n constructor(private getModel: GetModelUseCase.Interface) {}\n\n async get(): Promise<CmsModel> {\n const result = await this.getModel.execute(WORKFLOW_STATE_MODEL_ID);\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n }\n}\n\nexport const WorkflowModelProviderImpl = WorkflowModelProvider.createImplementation({\n implementation: WorkflowModelProviderImplementation,\n dependencies: [GetModelUseCase]\n});\n\nexport const WorkflowStateModelProviderImpl = WorkflowStateModelProvider.createImplementation({\n implementation: WorkflowStateModelProviderImplementation,\n dependencies: [GetModelUseCase]\n});\n"],"names":["WorkflowModelProviderImplementation","getModel","result","WORKFLOW_MODEL_ID","WorkflowStateModelProviderImplementation","WORKFLOW_STATE_MODEL_ID","WorkflowModelProviderImpl","WorkflowModelProvider","GetModelUseCase","WorkflowStateModelProviderImpl","WorkflowStateModelProvider"],"mappings":";;;;;AAoBA,MAAMA;IACF,YAAoBC,QAAmC,CAAE;aAArCA,QAAQ,GAARA;IAAsC;IAE1D,MAAM,MAAyB;QAC3B,MAAMC,SAAS,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACC;QAC3C,IAAID,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;QAEtB,OAAOA,OAAO,KAAK;IACvB;AACJ;AAEA,MAAME;IACF,YAAoBH,QAAmC,CAAE;aAArCA,QAAQ,GAARA;IAAsC;IAE1D,MAAM,MAAyB;QAC3B,MAAMC,SAAS,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACG;QAC3C,IAAIH,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;QAEtB,OAAOA,OAAO,KAAK;IACvB;AACJ;AAEO,MAAMI,4BAA4BC,sBAAsB,oBAAoB,CAAC;IAChF,gBAAgBP;IAChB,cAAc;QAACQ;KAAgB;AACnC;AAEO,MAAMC,iCAAiCC,2BAA2B,oBAAoB,CAAC;IAC1F,gBAAgBN;IAChB,cAAc;QAACI;KAAgB;AACnC"}
@@ -1,11 +1,11 @@
1
1
  import { CreateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js";
2
- import { WorkflowMapper, WorkflowModel } from "../../../domain/workflow/abstractions.js";
2
+ import { WorkflowMapper, WorkflowModelProvider } from "../../../domain/workflow/abstractions.js";
3
3
  import { CreateWorkflowRepository as Repository } from "./abstractions.js";
4
4
  declare class CreateWorkflowRepositoryImpl implements Repository.Interface {
5
5
  private createEntry;
6
- private model;
6
+ private modelProvider;
7
7
  private mapper;
8
- constructor(createEntry: CreateEntryUseCase.Interface, model: WorkflowModel.Interface, mapper: WorkflowMapper.Interface);
8
+ constructor(createEntry: CreateEntryUseCase.Interface, modelProvider: WorkflowModelProvider.Interface, mapper: WorkflowMapper.Interface);
9
9
  execute(input: Repository.Input): Repository.Return;
10
10
  }
11
11
  export declare const CreateWorkflowRepository: typeof CreateWorkflowRepositoryImpl & {
@@ -1,16 +1,17 @@
1
1
  import { Result } from "@webiny/feature/api";
2
2
  import { parseIdentifier } from "@webiny/utils/parseIdentifier.js";
3
3
  import { CreateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js";
4
- import { WorkflowMapper, WorkflowModel } from "../../../domain/workflow/abstractions.js";
4
+ import { WorkflowMapper, WorkflowModelProvider } from "../../../domain/workflow/abstractions.js";
5
5
  import { WorkflowPersistenceError } from "../../../domain/workflow/errors.js";
6
6
  import { CreateWorkflowRepository } from "./abstractions.js";
7
7
  class CreateWorkflowRepositoryImpl {
8
- constructor(createEntry, model, mapper){
8
+ constructor(createEntry, modelProvider, mapper){
9
9
  this.createEntry = createEntry;
10
- this.model = model;
10
+ this.modelProvider = modelProvider;
11
11
  this.mapper = mapper;
12
12
  }
13
13
  async execute(input) {
14
+ const model = await this.modelProvider.get();
14
15
  const { id } = parseIdentifier(input.id);
15
16
  const values = this.mapper.toCmsEntry({
16
17
  id,
@@ -19,7 +20,7 @@ class CreateWorkflowRepositoryImpl {
19
20
  steps: input.steps
20
21
  });
21
22
  try {
22
- const createResult = await this.createEntry.execute(this.model, {
23
+ const createResult = await this.createEntry.execute(model, {
23
24
  id,
24
25
  values
25
26
  });
@@ -37,7 +38,7 @@ const CreateWorkflowRepository_CreateWorkflowRepository = CreateWorkflowReposito
37
38
  implementation: CreateWorkflowRepositoryImpl,
38
39
  dependencies: [
39
40
  CreateEntryUseCase,
40
- WorkflowModel,
41
+ WorkflowModelProvider,
41
42
  WorkflowMapper
42
43
  ]
43
44
  });
@@ -1 +1 @@
1
- {"version":3,"file":"features/workflow/CreateWorkflow/CreateWorkflowRepository.js","sources":["../../../../src/features/workflow/CreateWorkflow/CreateWorkflowRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { parseIdentifier } from \"@webiny/utils/parseIdentifier.js\";\nimport { CreateEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js\";\nimport { type IWorkflow, WorkflowMapper, WorkflowModel } from \"~/domain/workflow/abstractions.js\";\nimport { WorkflowPersistenceError } from \"~/domain/workflow/errors.js\";\nimport { CreateWorkflowRepository as Repository } from \"./abstractions.js\";\n\nclass CreateWorkflowRepositoryImpl implements Repository.Interface {\n constructor(\n private createEntry: CreateEntryUseCase.Interface,\n private model: WorkflowModel.Interface,\n private mapper: WorkflowMapper.Interface\n ) {}\n\n async execute(input: Repository.Input): Repository.Return {\n const { id } = parseIdentifier(input.id);\n\n const values = this.mapper.toCmsEntry({\n id,\n app: input.app,\n name: input.name,\n steps: input.steps\n });\n try {\n const createResult = await this.createEntry.execute<IWorkflow>(this.model, {\n id,\n values\n });\n\n if (createResult.isFail()) {\n return Result.fail(new WorkflowPersistenceError(createResult.error));\n }\n\n return Result.ok({ ...values, id });\n } catch (error) {\n return Result.fail(new WorkflowPersistenceError(error));\n }\n }\n}\n\nexport const CreateWorkflowRepository = Repository.createImplementation({\n implementation: CreateWorkflowRepositoryImpl,\n dependencies: [CreateEntryUseCase, WorkflowModel, WorkflowMapper]\n});\n"],"names":["CreateWorkflowRepositoryImpl","createEntry","model","mapper","input","id","parseIdentifier","values","createResult","Result","WorkflowPersistenceError","error","CreateWorkflowRepository","Repository","CreateEntryUseCase","WorkflowModel","WorkflowMapper"],"mappings":";;;;;;AAOA,MAAMA;IACF,YACYC,WAAyC,EACzCC,KAA8B,EAC9BC,MAAgC,CAC1C;aAHUF,WAAW,GAAXA;aACAC,KAAK,GAALA;aACAC,MAAM,GAANA;IACT;IAEH,MAAM,QAAQC,KAAuB,EAAqB;QACtD,MAAM,EAAEC,EAAE,EAAE,GAAGC,gBAAgBF,MAAM,EAAE;QAEvC,MAAMG,SAAS,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;YAClCF;YACA,KAAKD,MAAM,GAAG;YACd,MAAMA,MAAM,IAAI;YAChB,OAAOA,MAAM,KAAK;QACtB;QACA,IAAI;YACA,MAAMI,eAAe,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAY,IAAI,CAAC,KAAK,EAAE;gBACvEH;gBACAE;YACJ;YAEA,IAAIC,aAAa,MAAM,IACnB,OAAOC,OAAO,IAAI,CAAC,IAAIC,yBAAyBF,aAAa,KAAK;YAGtE,OAAOC,OAAO,EAAE,CAAC;gBAAE,GAAGF,MAAM;gBAAEF;YAAG;QACrC,EAAE,OAAOM,OAAO;YACZ,OAAOF,OAAO,IAAI,CAAC,IAAIC,yBAAyBC;QACpD;IACJ;AACJ;AAEO,MAAMC,oDAA2BC,yBAAAA,oBAA+B,CAAC;IACpE,gBAAgBb;IAChB,cAAc;QAACc;QAAoBC;QAAeC;KAAe;AACrE"}
1
+ {"version":3,"file":"features/workflow/CreateWorkflow/CreateWorkflowRepository.js","sources":["../../../../src/features/workflow/CreateWorkflow/CreateWorkflowRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { parseIdentifier } from \"@webiny/utils/parseIdentifier.js\";\nimport { CreateEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js\";\nimport {\n type IWorkflow,\n WorkflowMapper,\n WorkflowModelProvider\n} from \"~/domain/workflow/abstractions.js\";\nimport { WorkflowPersistenceError } from \"~/domain/workflow/errors.js\";\nimport { CreateWorkflowRepository as Repository } from \"./abstractions.js\";\n\nclass CreateWorkflowRepositoryImpl implements Repository.Interface {\n constructor(\n private createEntry: CreateEntryUseCase.Interface,\n private modelProvider: WorkflowModelProvider.Interface,\n private mapper: WorkflowMapper.Interface\n ) {}\n\n async execute(input: Repository.Input): Repository.Return {\n const model = await this.modelProvider.get();\n const { id } = parseIdentifier(input.id);\n\n const values = this.mapper.toCmsEntry({\n id,\n app: input.app,\n name: input.name,\n steps: input.steps\n });\n try {\n const createResult = await this.createEntry.execute<IWorkflow>(model, {\n id,\n values\n });\n\n if (createResult.isFail()) {\n return Result.fail(new WorkflowPersistenceError(createResult.error));\n }\n\n return Result.ok({ ...values, id });\n } catch (error) {\n return Result.fail(new WorkflowPersistenceError(error));\n }\n }\n}\n\nexport const CreateWorkflowRepository = Repository.createImplementation({\n implementation: CreateWorkflowRepositoryImpl,\n dependencies: [CreateEntryUseCase, WorkflowModelProvider, WorkflowMapper]\n});\n"],"names":["CreateWorkflowRepositoryImpl","createEntry","modelProvider","mapper","input","model","id","parseIdentifier","values","createResult","Result","WorkflowPersistenceError","error","CreateWorkflowRepository","Repository","CreateEntryUseCase","WorkflowModelProvider","WorkflowMapper"],"mappings":";;;;;;AAWA,MAAMA;IACF,YACYC,WAAyC,EACzCC,aAA8C,EAC9CC,MAAgC,CAC1C;aAHUF,WAAW,GAAXA;aACAC,aAAa,GAAbA;aACAC,MAAM,GAANA;IACT;IAEH,MAAM,QAAQC,KAAuB,EAAqB;QACtD,MAAMC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG;QAC1C,MAAM,EAAEC,EAAE,EAAE,GAAGC,gBAAgBH,MAAM,EAAE;QAEvC,MAAMI,SAAS,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;YAClCF;YACA,KAAKF,MAAM,GAAG;YACd,MAAMA,MAAM,IAAI;YAChB,OAAOA,MAAM,KAAK;QACtB;QACA,IAAI;YACA,MAAMK,eAAe,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAYJ,OAAO;gBAClEC;gBACAE;YACJ;YAEA,IAAIC,aAAa,MAAM,IACnB,OAAOC,OAAO,IAAI,CAAC,IAAIC,yBAAyBF,aAAa,KAAK;YAGtE,OAAOC,OAAO,EAAE,CAAC;gBAAE,GAAGF,MAAM;gBAAEF;YAAG;QACrC,EAAE,OAAOM,OAAO;YACZ,OAAOF,OAAO,IAAI,CAAC,IAAIC,yBAAyBC;QACpD;IACJ;AACJ;AAEO,MAAMC,oDAA2BC,yBAAAA,oBAA+B,CAAC;IACpE,gBAAgBd;IAChB,cAAc;QAACe;QAAoBC;QAAuBC;KAAe;AAC7E"}
@@ -1,10 +1,10 @@
1
1
  import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
2
- import { WorkflowModel } from "../../../domain/workflow/abstractions.js";
2
+ import { WorkflowModelProvider } from "../../../domain/workflow/abstractions.js";
3
3
  import { DeleteWorkflowRepository as Repository } from "./abstractions.js";
4
4
  declare class DeleteWorkflowRepositoryImpl implements Repository.Interface {
5
5
  private deleteEntry;
6
- private model;
7
- constructor(deleteEntry: DeleteEntryUseCase.Interface, model: WorkflowModel.Interface);
6
+ private modelProvider;
7
+ constructor(deleteEntry: DeleteEntryUseCase.Interface, modelProvider: WorkflowModelProvider.Interface);
8
8
  execute(input: Repository.Params): Repository.Return;
9
9
  }
10
10
  export declare const DeleteWorkflowRepository: typeof DeleteWorkflowRepositoryImpl & {
@@ -1,21 +1,22 @@
1
1
  import { Result } from "@webiny/feature/api";
2
2
  import { createIdentifier } from "@webiny/utils";
3
3
  import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
4
- import { WorkflowModel } from "../../../domain/workflow/abstractions.js";
4
+ import { WorkflowModelProvider } from "../../../domain/workflow/abstractions.js";
5
5
  import { WorkflowPersistenceError } from "../../../domain/workflow/errors.js";
6
6
  import { DeleteWorkflowRepository } from "./abstractions.js";
7
7
  class DeleteWorkflowRepositoryImpl {
8
- constructor(deleteEntry, model){
8
+ constructor(deleteEntry, modelProvider){
9
9
  this.deleteEntry = deleteEntry;
10
- this.model = model;
10
+ this.modelProvider = modelProvider;
11
11
  }
12
12
  async execute(input) {
13
+ const model = await this.modelProvider.get();
13
14
  const workflowId = createIdentifier({
14
15
  id: input.id,
15
16
  version: 1
16
17
  });
17
18
  try {
18
- const result = await this.deleteEntry.execute(this.model, workflowId);
19
+ const result = await this.deleteEntry.execute(model, workflowId);
19
20
  if (result.isFail()) return Result.fail(new WorkflowPersistenceError(result.error));
20
21
  return Result.ok();
21
22
  } catch (error) {
@@ -27,7 +28,7 @@ const DeleteWorkflowRepository_DeleteWorkflowRepository = DeleteWorkflowReposito
27
28
  implementation: DeleteWorkflowRepositoryImpl,
28
29
  dependencies: [
29
30
  DeleteEntryUseCase,
30
- WorkflowModel
31
+ WorkflowModelProvider
31
32
  ]
32
33
  });
33
34
  export { DeleteWorkflowRepository_DeleteWorkflowRepository as DeleteWorkflowRepository };
@@ -1 +1 @@
1
- {"version":3,"file":"features/workflow/DeleteWorkflow/DeleteWorkflowRepository.js","sources":["../../../../src/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createIdentifier } from \"@webiny/utils\";\nimport { DeleteEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js\";\nimport { WorkflowModel } from \"~/domain/workflow/abstractions.js\";\nimport { WorkflowPersistenceError } from \"~/domain/workflow/errors.js\";\nimport { DeleteWorkflowRepository as Repository } from \"./abstractions.js\";\n\nclass DeleteWorkflowRepositoryImpl implements Repository.Interface {\n constructor(\n private deleteEntry: DeleteEntryUseCase.Interface,\n private model: WorkflowModel.Interface\n ) {}\n\n async execute(input: Repository.Params): Repository.Return {\n const workflowId = createIdentifier({\n id: input.id,\n version: 1\n });\n\n try {\n const result = await this.deleteEntry.execute(this.model, workflowId);\n\n if (result.isFail()) {\n return Result.fail(new WorkflowPersistenceError(result.error));\n }\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new WorkflowPersistenceError(error as Error));\n }\n }\n}\n\nexport const DeleteWorkflowRepository = Repository.createImplementation({\n implementation: DeleteWorkflowRepositoryImpl,\n dependencies: [DeleteEntryUseCase, WorkflowModel]\n});\n"],"names":["DeleteWorkflowRepositoryImpl","deleteEntry","model","input","workflowId","createIdentifier","result","Result","WorkflowPersistenceError","error","DeleteWorkflowRepository","Repository","DeleteEntryUseCase","WorkflowModel"],"mappings":";;;;;;AAOA,MAAMA;IACF,YACYC,WAAyC,EACzCC,KAA8B,CACxC;aAFUD,WAAW,GAAXA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QAAQC,KAAwB,EAAqB;QACvD,MAAMC,aAAaC,iBAAiB;YAChC,IAAIF,MAAM,EAAE;YACZ,SAAS;QACb;QAEA,IAAI;YACA,MAAMG,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAEF;YAE1D,IAAIE,OAAO,MAAM,IACb,OAAOC,OAAO,IAAI,CAAC,IAAIC,yBAAyBF,OAAO,KAAK;YAGhE,OAAOC,OAAO,EAAE;QACpB,EAAE,OAAOE,OAAO;YACZ,OAAOF,OAAO,IAAI,CAAC,IAAIC,yBAAyBC;QACpD;IACJ;AACJ;AAEO,MAAMC,oDAA2BC,yBAAAA,oBAA+B,CAAC;IACpE,gBAAgBX;IAChB,cAAc;QAACY;QAAoBC;KAAc;AACrD"}
1
+ {"version":3,"file":"features/workflow/DeleteWorkflow/DeleteWorkflowRepository.js","sources":["../../../../src/features/workflow/DeleteWorkflow/DeleteWorkflowRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createIdentifier } from \"@webiny/utils\";\nimport { DeleteEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js\";\nimport { WorkflowModelProvider } from \"~/domain/workflow/abstractions.js\";\nimport { WorkflowPersistenceError } from \"~/domain/workflow/errors.js\";\nimport { DeleteWorkflowRepository as Repository } from \"./abstractions.js\";\n\nclass DeleteWorkflowRepositoryImpl implements Repository.Interface {\n constructor(\n private deleteEntry: DeleteEntryUseCase.Interface,\n private modelProvider: WorkflowModelProvider.Interface\n ) {}\n\n async execute(input: Repository.Params): Repository.Return {\n const model = await this.modelProvider.get();\n const workflowId = createIdentifier({\n id: input.id,\n version: 1\n });\n\n try {\n const result = await this.deleteEntry.execute(model, workflowId);\n\n if (result.isFail()) {\n return Result.fail(new WorkflowPersistenceError(result.error));\n }\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new WorkflowPersistenceError(error as Error));\n }\n }\n}\n\nexport const DeleteWorkflowRepository = Repository.createImplementation({\n implementation: DeleteWorkflowRepositoryImpl,\n dependencies: [DeleteEntryUseCase, WorkflowModelProvider]\n});\n"],"names":["DeleteWorkflowRepositoryImpl","deleteEntry","modelProvider","input","model","workflowId","createIdentifier","result","Result","WorkflowPersistenceError","error","DeleteWorkflowRepository","Repository","DeleteEntryUseCase","WorkflowModelProvider"],"mappings":";;;;;;AAOA,MAAMA;IACF,YACYC,WAAyC,EACzCC,aAA8C,CACxD;aAFUD,WAAW,GAAXA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,KAAwB,EAAqB;QACvD,MAAMC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG;QAC1C,MAAMC,aAAaC,iBAAiB;YAChC,IAAIH,MAAM,EAAE;YACZ,SAAS;QACb;QAEA,IAAI;YACA,MAAMI,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAACH,OAAOC;YAErD,IAAIE,OAAO,MAAM,IACb,OAAOC,OAAO,IAAI,CAAC,IAAIC,yBAAyBF,OAAO,KAAK;YAGhE,OAAOC,OAAO,EAAE;QACpB,EAAE,OAAOE,OAAO;YACZ,OAAOF,OAAO,IAAI,CAAC,IAAIC,yBAAyBC;QACpD;IACJ;AACJ;AAEO,MAAMC,oDAA2BC,yBAAAA,oBAA+B,CAAC;IACpE,gBAAgBZ;IAChB,cAAc;QAACa;QAAoBC;KAAsB;AAC7D"}
@@ -1,11 +1,11 @@
1
1
  import { GetEntryByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js";
2
- import { WorkflowMapper, WorkflowModel } from "../../../domain/workflow/abstractions.js";
2
+ import { WorkflowMapper, WorkflowModelProvider } from "../../../domain/workflow/abstractions.js";
3
3
  import { GetWorkflowRepository as Repository } from "./abstractions.js";
4
4
  declare class GetWorkflowRepositoryImpl implements Repository.Interface {
5
5
  private getEntryById;
6
- private model;
6
+ private modelProvider;
7
7
  private mapper;
8
- constructor(getEntryById: GetEntryByIdUseCase.Interface, model: WorkflowModel.Interface, mapper: WorkflowMapper.Interface);
8
+ constructor(getEntryById: GetEntryByIdUseCase.Interface, modelProvider: WorkflowModelProvider.Interface, mapper: WorkflowMapper.Interface);
9
9
  execute(input: Repository.Params): Repository.Return;
10
10
  }
11
11
  export declare const GetWorkflowRepository: typeof GetWorkflowRepositoryImpl & {