@webiny/api-workflows 0.0.0-unstable.e2758ee1cf → 0.0.0-unstable.e6f0dc8ca7
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/features/internal/GetUserTeams/feature.d.ts +4 -1
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.d.ts +1 -1
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.js +1 -1
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.js.map +1 -1
- package/features/notifications/ListNotificationTypes/feature.d.ts +4 -1
- package/features/notifications/NotificationTransport/feature.d.ts +4 -1
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.d.ts +2 -2
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.js +2 -2
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.js.map +1 -1
- package/features/workflow/CreateWorkflow/events.d.ts +2 -2
- package/features/workflow/CreateWorkflow/events.js +1 -1
- package/features/workflow/CreateWorkflow/events.js.map +1 -1
- package/features/workflow/CreateWorkflow/feature.d.ts +4 -1
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.d.ts +2 -2
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.js +2 -2
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.js.map +1 -1
- package/features/workflow/DeleteWorkflow/events.d.ts +2 -2
- package/features/workflow/DeleteWorkflow/events.js +1 -1
- package/features/workflow/DeleteWorkflow/events.js.map +1 -1
- package/features/workflow/DeleteWorkflow/feature.d.ts +4 -1
- package/features/workflow/GetWorkflow/feature.d.ts +4 -1
- package/features/workflow/ListWorkflows/feature.d.ts +4 -1
- package/features/workflow/StoreWorkflow/feature.d.ts +4 -1
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.d.ts +2 -2
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.js +2 -2
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.js.map +1 -1
- package/features/workflow/UpdateWorkflow/events.d.ts +2 -2
- package/features/workflow/UpdateWorkflow/events.js +1 -1
- package/features/workflow/UpdateWorkflow/events.js.map +1 -1
- package/features/workflow/UpdateWorkflow/feature.d.ts +4 -1
- package/features/workflowState/ApproveWorkflowStateStep/events.d.ts +2 -2
- package/features/workflowState/ApproveWorkflowStateStep/events.js +1 -1
- package/features/workflowState/ApproveWorkflowStateStep/events.js.map +1 -1
- package/features/workflowState/ApproveWorkflowStateStep/feature.d.ts +4 -1
- package/features/workflowState/CancelWorkflowState/events.d.ts +2 -2
- package/features/workflowState/CancelWorkflowState/events.js +1 -1
- package/features/workflowState/CancelWorkflowState/events.js.map +1 -1
- package/features/workflowState/CancelWorkflowState/feature.d.ts +4 -1
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.d.ts +2 -2
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.js +2 -2
- package/features/workflowState/CreateWorkflowState/CreateWorkflowStateUseCase.js.map +1 -1
- package/features/workflowState/CreateWorkflowState/events.d.ts +2 -2
- package/features/workflowState/CreateWorkflowState/events.js +1 -1
- package/features/workflowState/CreateWorkflowState/events.js.map +1 -1
- package/features/workflowState/CreateWorkflowState/feature.d.ts +4 -1
- package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.d.ts +2 -2
- package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.js +2 -2
- package/features/workflowState/DeleteTargetWorkflowState/DeleteTargetWorkflowStateUseCase.js.map +1 -1
- package/features/workflowState/DeleteTargetWorkflowState/events.d.ts +2 -2
- package/features/workflowState/DeleteTargetWorkflowState/events.js +1 -1
- package/features/workflowState/DeleteTargetWorkflowState/events.js.map +1 -1
- package/features/workflowState/DeleteTargetWorkflowState/feature.d.ts +4 -1
- package/features/workflowState/DeleteWorkflowState/feature.d.ts +4 -1
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.d.ts +1 -1
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.js +1 -1
- package/features/workflowState/GetTargetWorkflowState/GetTargetWorkflowStateUseCase.js.map +1 -1
- package/features/workflowState/GetTargetWorkflowState/feature.d.ts +4 -1
- package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.d.ts +1 -1
- package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.js +1 -1
- package/features/workflowState/GetWorkflowState/GetWorkflowStateUseCase.js.map +1 -1
- package/features/workflowState/GetWorkflowState/feature.d.ts +4 -1
- package/features/workflowState/ListOwnWorkflowStates/ListOwnWorkflowStatesUseCase.d.ts +1 -1
- package/features/workflowState/ListOwnWorkflowStates/ListOwnWorkflowStatesUseCase.js +1 -1
- package/features/workflowState/ListOwnWorkflowStates/ListOwnWorkflowStatesUseCase.js.map +1 -1
- package/features/workflowState/ListOwnWorkflowStates/feature.d.ts +4 -1
- package/features/workflowState/ListRequestedWorkflowStates/ListRequestedWorkflowStatesUseCase.d.ts +1 -1
- package/features/workflowState/ListRequestedWorkflowStates/ListRequestedWorkflowStatesUseCase.js +1 -1
- package/features/workflowState/ListRequestedWorkflowStates/ListRequestedWorkflowStatesUseCase.js.map +1 -1
- package/features/workflowState/ListRequestedWorkflowStates/feature.d.ts +4 -1
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.d.ts +1 -1
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.js +1 -1
- package/features/workflowState/ListWorkflowStates/ListWorkflowStatesUseCase.js.map +1 -1
- package/features/workflowState/ListWorkflowStates/feature.d.ts +4 -1
- package/features/workflowState/README.md +2 -2
- package/features/workflowState/RejectWorkflowStateStep/events.d.ts +2 -2
- package/features/workflowState/RejectWorkflowStateStep/events.js +1 -1
- package/features/workflowState/RejectWorkflowStateStep/events.js.map +1 -1
- package/features/workflowState/RejectWorkflowStateStep/feature.d.ts +4 -1
- package/features/workflowState/StartWorkflowStateStep/events.d.ts +2 -2
- package/features/workflowState/StartWorkflowStateStep/events.js +1 -1
- package/features/workflowState/StartWorkflowStateStep/events.js.map +1 -1
- package/features/workflowState/StartWorkflowStateStep/feature.d.ts +4 -1
- package/features/workflowState/TakeOverWorkflowStateStep/events.d.ts +2 -2
- package/features/workflowState/TakeOverWorkflowStateStep/events.js +1 -1
- package/features/workflowState/TakeOverWorkflowStateStep/events.js.map +1 -1
- package/features/workflowState/TakeOverWorkflowStateStep/feature.d.ts +4 -1
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.d.ts +2 -2
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.js +2 -2
- package/features/workflowState/UpdateWorkflowState/UpdateWorkflowStateUseCase.js.map +1 -1
- package/features/workflowState/UpdateWorkflowState/events.d.ts +2 -2
- package/features/workflowState/UpdateWorkflowState/events.js +1 -1
- package/features/workflowState/UpdateWorkflowState/events.js.map +1 -1
- package/features/workflowState/UpdateWorkflowState/feature.d.ts +4 -1
- package/graphql/validation/approveWorkflowState.d.ts +1 -7
- package/graphql/validation/cancelWorkflowState.d.ts +1 -5
- package/graphql/validation/createWorkflowState.d.ts +1 -9
- package/graphql/validation/deleteWorkflow.d.ts +1 -7
- package/graphql/validation/getTargetWorkflowState.d.ts +1 -7
- package/graphql/validation/getWorkflow.d.ts +1 -7
- package/graphql/validation/getWorkflowState.d.ts +1 -5
- package/graphql/validation/listWorkflowStates.d.ts +14 -96
- package/graphql/validation/listWorkflows.d.ts +6 -36
- package/graphql/validation/rejectWorkflowState.d.ts +1 -7
- package/graphql/validation/startWorkflowState.d.ts +1 -5
- package/graphql/validation/step.d.ts +8 -36
- package/graphql/validation/storeWorkflow.d.ts +14 -86
- package/graphql/validation/takeOverWorkflowStateStep.d.ts +1 -5
- package/graphql/validation/workflow.d.ts +13 -60
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +22 -19
|
@@ -3,106 +3,24 @@ import { WorkflowStateRecordState } from "../../domain/workflowState/abstraction
|
|
|
3
3
|
export declare const listWorkflowStatesValidation: zod.ZodOptional<zod.ZodObject<{
|
|
4
4
|
where: zod.ZodOptional<zod.ZodObject<{
|
|
5
5
|
app: zod.ZodOptional<zod.ZodString>;
|
|
6
|
-
app_in: zod.ZodOptional<zod.ZodArray<zod.ZodString
|
|
6
|
+
app_in: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
7
7
|
workflowId: zod.ZodOptional<zod.ZodString>;
|
|
8
|
-
workflowId_in: zod.ZodOptional<zod.ZodArray<zod.ZodString
|
|
8
|
+
workflowId_in: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
9
9
|
targetId: zod.ZodOptional<zod.ZodString>;
|
|
10
|
-
targetId_in: zod.ZodOptional<zod.ZodArray<zod.ZodString
|
|
10
|
+
targetId_in: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
11
11
|
targetRevisionId: zod.ZodOptional<zod.ZodString>;
|
|
12
|
-
targetRevisionId_in: zod.ZodOptional<zod.ZodArray<zod.ZodString
|
|
13
|
-
state: zod.ZodOptional<zod.
|
|
14
|
-
state_in: zod.ZodOptional<zod.ZodArray<zod.
|
|
15
|
-
createdOn_gte: zod.
|
|
16
|
-
createdOn_lte: zod.
|
|
17
|
-
savedOn_gte: zod.
|
|
18
|
-
savedOn_lte: zod.
|
|
12
|
+
targetRevisionId_in: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
13
|
+
state: zod.ZodOptional<zod.ZodEnum<typeof WorkflowStateRecordState>>;
|
|
14
|
+
state_in: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<typeof WorkflowStateRecordState>>>;
|
|
15
|
+
createdOn_gte: zod.ZodPreprocess<zod.ZodOptional<zod.ZodDate>>;
|
|
16
|
+
createdOn_lte: zod.ZodPreprocess<zod.ZodOptional<zod.ZodDate>>;
|
|
17
|
+
savedOn_gte: zod.ZodPreprocess<zod.ZodOptional<zod.ZodDate>>;
|
|
18
|
+
savedOn_lte: zod.ZodPreprocess<zod.ZodOptional<zod.ZodDate>>;
|
|
19
19
|
createdBy: zod.ZodOptional<zod.ZodString>;
|
|
20
20
|
savedBy: zod.ZodOptional<zod.ZodString>;
|
|
21
21
|
isActive: zod.ZodOptional<zod.ZodBoolean>;
|
|
22
|
-
},
|
|
23
|
-
app?: string | undefined;
|
|
24
|
-
savedBy?: string | undefined;
|
|
25
|
-
createdBy?: string | undefined;
|
|
26
|
-
workflowId?: string | undefined;
|
|
27
|
-
targetId?: string | undefined;
|
|
28
|
-
targetRevisionId?: string | undefined;
|
|
29
|
-
isActive?: boolean | undefined;
|
|
30
|
-
state?: WorkflowStateRecordState | undefined;
|
|
31
|
-
app_in?: string[] | undefined;
|
|
32
|
-
workflowId_in?: string[] | undefined;
|
|
33
|
-
targetId_in?: string[] | undefined;
|
|
34
|
-
targetRevisionId_in?: string[] | undefined;
|
|
35
|
-
state_in?: WorkflowStateRecordState[] | undefined;
|
|
36
|
-
createdOn_gte?: Date | undefined;
|
|
37
|
-
createdOn_lte?: Date | undefined;
|
|
38
|
-
savedOn_gte?: Date | undefined;
|
|
39
|
-
savedOn_lte?: Date | undefined;
|
|
40
|
-
}, {
|
|
41
|
-
app?: string | undefined;
|
|
42
|
-
savedBy?: string | undefined;
|
|
43
|
-
createdBy?: string | undefined;
|
|
44
|
-
workflowId?: string | undefined;
|
|
45
|
-
targetId?: string | undefined;
|
|
46
|
-
targetRevisionId?: string | undefined;
|
|
47
|
-
isActive?: boolean | undefined;
|
|
48
|
-
state?: WorkflowStateRecordState | undefined;
|
|
49
|
-
app_in?: string[] | undefined;
|
|
50
|
-
workflowId_in?: string[] | undefined;
|
|
51
|
-
targetId_in?: string[] | undefined;
|
|
52
|
-
targetRevisionId_in?: string[] | undefined;
|
|
53
|
-
state_in?: WorkflowStateRecordState[] | undefined;
|
|
54
|
-
createdOn_gte?: unknown;
|
|
55
|
-
createdOn_lte?: unknown;
|
|
56
|
-
savedOn_gte?: unknown;
|
|
57
|
-
savedOn_lte?: unknown;
|
|
58
|
-
}>>;
|
|
22
|
+
}, zod.core.$strip>>;
|
|
59
23
|
limit: zod.ZodOptional<zod.ZodNumber>;
|
|
60
|
-
sort: zod.ZodOptional<zod.ZodArray<zod.
|
|
61
|
-
after: zod.
|
|
62
|
-
},
|
|
63
|
-
limit?: number | undefined;
|
|
64
|
-
sort?: (`${string}_DESC` | `${string}_ASC`)[] | undefined;
|
|
65
|
-
after?: string | undefined;
|
|
66
|
-
where?: {
|
|
67
|
-
app?: string | undefined;
|
|
68
|
-
savedBy?: string | undefined;
|
|
69
|
-
createdBy?: string | undefined;
|
|
70
|
-
workflowId?: string | undefined;
|
|
71
|
-
targetId?: string | undefined;
|
|
72
|
-
targetRevisionId?: string | undefined;
|
|
73
|
-
isActive?: boolean | undefined;
|
|
74
|
-
state?: WorkflowStateRecordState | undefined;
|
|
75
|
-
app_in?: string[] | undefined;
|
|
76
|
-
workflowId_in?: string[] | undefined;
|
|
77
|
-
targetId_in?: string[] | undefined;
|
|
78
|
-
targetRevisionId_in?: string[] | undefined;
|
|
79
|
-
state_in?: WorkflowStateRecordState[] | undefined;
|
|
80
|
-
createdOn_gte?: Date | undefined;
|
|
81
|
-
createdOn_lte?: Date | undefined;
|
|
82
|
-
savedOn_gte?: Date | undefined;
|
|
83
|
-
savedOn_lte?: Date | undefined;
|
|
84
|
-
} | undefined;
|
|
85
|
-
}, {
|
|
86
|
-
limit?: number | undefined;
|
|
87
|
-
sort?: string[] | undefined;
|
|
88
|
-
after?: string | null | undefined;
|
|
89
|
-
where?: {
|
|
90
|
-
app?: string | undefined;
|
|
91
|
-
savedBy?: string | undefined;
|
|
92
|
-
createdBy?: string | undefined;
|
|
93
|
-
workflowId?: string | undefined;
|
|
94
|
-
targetId?: string | undefined;
|
|
95
|
-
targetRevisionId?: string | undefined;
|
|
96
|
-
isActive?: boolean | undefined;
|
|
97
|
-
state?: WorkflowStateRecordState | undefined;
|
|
98
|
-
app_in?: string[] | undefined;
|
|
99
|
-
workflowId_in?: string[] | undefined;
|
|
100
|
-
targetId_in?: string[] | undefined;
|
|
101
|
-
targetRevisionId_in?: string[] | undefined;
|
|
102
|
-
state_in?: WorkflowStateRecordState[] | undefined;
|
|
103
|
-
createdOn_gte?: unknown;
|
|
104
|
-
createdOn_lte?: unknown;
|
|
105
|
-
savedOn_gte?: unknown;
|
|
106
|
-
savedOn_lte?: unknown;
|
|
107
|
-
} | undefined;
|
|
108
|
-
}>>;
|
|
24
|
+
sort: zod.ZodOptional<zod.ZodArray<zod.ZodPipe<zod.ZodString, zod.ZodTransform<`${string}_DESC` | `${string}_ASC`, string>>>>;
|
|
25
|
+
after: zod.ZodPipe<zod.ZodOptional<zod.ZodNullable<zod.ZodOptional<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
26
|
+
}, zod.core.$strip>>;
|
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
import zod from "zod";
|
|
2
2
|
export declare const listWorkflowsValidation: zod.ZodObject<{
|
|
3
3
|
limit: zod.ZodOptional<zod.ZodNumber>;
|
|
4
|
-
sort: zod.ZodOptional<zod.ZodArray<zod.
|
|
5
|
-
after: zod.
|
|
4
|
+
sort: zod.ZodOptional<zod.ZodArray<zod.ZodPipe<zod.ZodString, zod.ZodTransform<`${string}_DESC` | `${string}_ASC`, string>>>>;
|
|
5
|
+
after: zod.ZodPipe<zod.ZodOptional<zod.ZodNullable<zod.ZodOptional<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
6
6
|
where: zod.ZodOptional<zod.ZodObject<{
|
|
7
7
|
id: zod.ZodOptional<zod.ZodString>;
|
|
8
|
-
id_in: zod.ZodOptional<zod.ZodArray<zod.ZodString
|
|
8
|
+
id_in: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
9
9
|
app: zod.ZodOptional<zod.ZodString>;
|
|
10
|
-
app_in: zod.ZodOptional<zod.ZodArray<zod.ZodString
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
id?: string | undefined;
|
|
14
|
-
id_in?: string[] | undefined;
|
|
15
|
-
app_in?: string[] | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
app?: string | undefined;
|
|
18
|
-
id?: string | undefined;
|
|
19
|
-
id_in?: string[] | undefined;
|
|
20
|
-
app_in?: string[] | undefined;
|
|
21
|
-
}>>;
|
|
22
|
-
}, "strip", zod.ZodTypeAny, {
|
|
23
|
-
limit?: number | undefined;
|
|
24
|
-
sort?: (`${string}_DESC` | `${string}_ASC`)[] | undefined;
|
|
25
|
-
after?: string | undefined;
|
|
26
|
-
where?: {
|
|
27
|
-
app?: string | undefined;
|
|
28
|
-
id?: string | undefined;
|
|
29
|
-
id_in?: string[] | undefined;
|
|
30
|
-
app_in?: string[] | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
limit?: number | undefined;
|
|
34
|
-
sort?: string[] | undefined;
|
|
35
|
-
after?: string | null | undefined;
|
|
36
|
-
where?: {
|
|
37
|
-
app?: string | undefined;
|
|
38
|
-
id?: string | undefined;
|
|
39
|
-
id_in?: string[] | undefined;
|
|
40
|
-
app_in?: string[] | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
}>;
|
|
10
|
+
app_in: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
11
|
+
}, zod.core.$strip>>;
|
|
12
|
+
}, zod.core.$strip>;
|
|
@@ -2,10 +2,4 @@ import zod from "zod";
|
|
|
2
2
|
export declare const rejectWorkflowStateValidation: zod.ZodObject<{
|
|
3
3
|
id: zod.ZodString;
|
|
4
4
|
comment: zod.ZodString;
|
|
5
|
-
},
|
|
6
|
-
id: string;
|
|
7
|
-
comment: string;
|
|
8
|
-
}, {
|
|
9
|
-
id: string;
|
|
10
|
-
comment: string;
|
|
11
|
-
}>;
|
|
5
|
+
}, zod.core.$strip>;
|
|
@@ -5,45 +5,17 @@ export declare const stepValidation: zod.ZodObject<{
|
|
|
5
5
|
id: zod.ZodString;
|
|
6
6
|
title: zod.ZodString;
|
|
7
7
|
color: zod.ZodString;
|
|
8
|
-
description: zod.
|
|
9
|
-
teams: zod.
|
|
8
|
+
description: zod.ZodPipe<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
9
|
+
teams: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
10
10
|
id: zod.ZodString;
|
|
11
|
-
},
|
|
11
|
+
}, zod.core.$strip>>, zod.ZodTransform<NonEmptyArray<IWorkflowStepTeam>, {
|
|
12
12
|
id: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
}>, "many">, NonEmptyArray<IWorkflowStepTeam>, {
|
|
16
|
-
id: string;
|
|
17
|
-
}[]>;
|
|
18
|
-
notifications: zod.ZodEffects<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
13
|
+
}[]>>;
|
|
14
|
+
notifications: zod.ZodPipe<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
19
15
|
id: zod.ZodString;
|
|
20
|
-
},
|
|
21
|
-
id: string;
|
|
22
|
-
}, {
|
|
23
|
-
id: string;
|
|
24
|
-
}>, "many">>>>, {
|
|
16
|
+
}, zod.core.$strip>>>>>, zod.ZodTransform<{
|
|
25
17
|
id: string;
|
|
26
18
|
}[] | undefined, {
|
|
27
19
|
id: string;
|
|
28
|
-
}[] | null | undefined
|
|
29
|
-
},
|
|
30
|
-
id: string;
|
|
31
|
-
title: string;
|
|
32
|
-
color: string;
|
|
33
|
-
teams: NonEmptyArray<IWorkflowStepTeam>;
|
|
34
|
-
description?: string | undefined;
|
|
35
|
-
notifications?: {
|
|
36
|
-
id: string;
|
|
37
|
-
}[] | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
id: string;
|
|
40
|
-
title: string;
|
|
41
|
-
color: string;
|
|
42
|
-
teams: {
|
|
43
|
-
id: string;
|
|
44
|
-
}[];
|
|
45
|
-
description?: string | null | undefined;
|
|
46
|
-
notifications?: {
|
|
47
|
-
id: string;
|
|
48
|
-
}[] | null | undefined;
|
|
49
|
-
}>;
|
|
20
|
+
}[] | null | undefined>>;
|
|
21
|
+
}, zod.core.$strip>;
|
|
@@ -4,104 +4,32 @@ export declare const storeWorkflowValidation: zod.ZodObject<{
|
|
|
4
4
|
id: zod.ZodString;
|
|
5
5
|
data: zod.ZodObject<{
|
|
6
6
|
name: zod.ZodString;
|
|
7
|
-
steps: zod.
|
|
7
|
+
steps: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
8
8
|
id: zod.ZodString;
|
|
9
9
|
title: zod.ZodString;
|
|
10
10
|
color: zod.ZodString;
|
|
11
|
-
description: zod.
|
|
12
|
-
teams: zod.
|
|
11
|
+
description: zod.ZodPipe<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
12
|
+
teams: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
13
13
|
id: zod.ZodString;
|
|
14
|
-
},
|
|
14
|
+
}, zod.core.$strip>>, zod.ZodTransform<import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStepTeam>, {
|
|
15
15
|
id: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}>, "many">, import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStepTeam>, {
|
|
19
|
-
id: string;
|
|
20
|
-
}[]>;
|
|
21
|
-
notifications: zod.ZodEffects<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
16
|
+
}[]>>;
|
|
17
|
+
notifications: zod.ZodPipe<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
22
18
|
id: zod.ZodString;
|
|
23
|
-
},
|
|
24
|
-
id: string;
|
|
25
|
-
}, {
|
|
26
|
-
id: string;
|
|
27
|
-
}>, "many">>>>, {
|
|
19
|
+
}, zod.core.$strip>>>>>, zod.ZodTransform<{
|
|
28
20
|
id: string;
|
|
29
21
|
}[] | undefined, {
|
|
30
22
|
id: string;
|
|
31
|
-
}[] | null | undefined
|
|
32
|
-
},
|
|
23
|
+
}[] | null | undefined>>;
|
|
24
|
+
}, zod.core.$strip>>, zod.ZodTransform<import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStep>, {
|
|
33
25
|
id: string;
|
|
34
26
|
title: string;
|
|
35
27
|
color: string;
|
|
28
|
+
description: string | undefined;
|
|
36
29
|
teams: import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStepTeam>;
|
|
37
|
-
|
|
38
|
-
notifications?: {
|
|
30
|
+
notifications: {
|
|
39
31
|
id: string;
|
|
40
32
|
}[] | undefined;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
color: string;
|
|
45
|
-
teams: {
|
|
46
|
-
id: string;
|
|
47
|
-
}[];
|
|
48
|
-
description?: string | null | undefined;
|
|
49
|
-
notifications?: {
|
|
50
|
-
id: string;
|
|
51
|
-
}[] | null | undefined;
|
|
52
|
-
}>, "many">, import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStep>, {
|
|
53
|
-
id: string;
|
|
54
|
-
title: string;
|
|
55
|
-
color: string;
|
|
56
|
-
teams: {
|
|
57
|
-
id: string;
|
|
58
|
-
}[];
|
|
59
|
-
description?: string | null | undefined;
|
|
60
|
-
notifications?: {
|
|
61
|
-
id: string;
|
|
62
|
-
}[] | null | undefined;
|
|
63
|
-
}[]>;
|
|
64
|
-
}, "strip", zod.ZodTypeAny, {
|
|
65
|
-
name: string;
|
|
66
|
-
steps: import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStep>;
|
|
67
|
-
}, {
|
|
68
|
-
name: string;
|
|
69
|
-
steps: {
|
|
70
|
-
id: string;
|
|
71
|
-
title: string;
|
|
72
|
-
color: string;
|
|
73
|
-
teams: {
|
|
74
|
-
id: string;
|
|
75
|
-
}[];
|
|
76
|
-
description?: string | null | undefined;
|
|
77
|
-
notifications?: {
|
|
78
|
-
id: string;
|
|
79
|
-
}[] | null | undefined;
|
|
80
|
-
}[];
|
|
81
|
-
}>;
|
|
82
|
-
}, "strip", zod.ZodTypeAny, {
|
|
83
|
-
app: string;
|
|
84
|
-
id: string;
|
|
85
|
-
data: {
|
|
86
|
-
name: string;
|
|
87
|
-
steps: import("@webiny/api/types.js").NonEmptyArray<import("../../domain/workflow/abstractions.js").IWorkflowStep>;
|
|
88
|
-
};
|
|
89
|
-
}, {
|
|
90
|
-
app: string;
|
|
91
|
-
id: string;
|
|
92
|
-
data: {
|
|
93
|
-
name: string;
|
|
94
|
-
steps: {
|
|
95
|
-
id: string;
|
|
96
|
-
title: string;
|
|
97
|
-
color: string;
|
|
98
|
-
teams: {
|
|
99
|
-
id: string;
|
|
100
|
-
}[];
|
|
101
|
-
description?: string | null | undefined;
|
|
102
|
-
notifications?: {
|
|
103
|
-
id: string;
|
|
104
|
-
}[] | null | undefined;
|
|
105
|
-
}[];
|
|
106
|
-
};
|
|
107
|
-
}>;
|
|
33
|
+
}[]>>;
|
|
34
|
+
}, zod.core.$strip>;
|
|
35
|
+
}, zod.core.$strip>;
|
|
@@ -3,78 +3,31 @@ import type { NonEmptyArray } from "@webiny/api/types.js";
|
|
|
3
3
|
import type { IWorkflowStep } from "../../domain/workflow/abstractions.js";
|
|
4
4
|
export declare const workflowValidation: zod.ZodObject<{
|
|
5
5
|
name: zod.ZodString;
|
|
6
|
-
steps: zod.
|
|
6
|
+
steps: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
7
7
|
id: zod.ZodString;
|
|
8
8
|
title: zod.ZodString;
|
|
9
9
|
color: zod.ZodString;
|
|
10
|
-
description: zod.
|
|
11
|
-
teams: zod.
|
|
10
|
+
description: zod.ZodPipe<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
11
|
+
teams: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
12
12
|
id: zod.ZodString;
|
|
13
|
-
},
|
|
13
|
+
}, zod.core.$strip>>, zod.ZodTransform<NonEmptyArray<import("~/domain/workflow/abstractions.js").IWorkflowStepTeam>, {
|
|
14
14
|
id: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}>, "many">, NonEmptyArray<import("~/domain/workflow/abstractions.js").IWorkflowStepTeam>, {
|
|
18
|
-
id: string;
|
|
19
|
-
}[]>;
|
|
20
|
-
notifications: zod.ZodEffects<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
15
|
+
}[]>>;
|
|
16
|
+
notifications: zod.ZodPipe<zod.ZodOptional<zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
21
17
|
id: zod.ZodString;
|
|
22
|
-
},
|
|
23
|
-
id: string;
|
|
24
|
-
}, {
|
|
25
|
-
id: string;
|
|
26
|
-
}>, "many">>>>, {
|
|
18
|
+
}, zod.core.$strip>>>>>, zod.ZodTransform<{
|
|
27
19
|
id: string;
|
|
28
20
|
}[] | undefined, {
|
|
29
21
|
id: string;
|
|
30
|
-
}[] | null | undefined
|
|
31
|
-
},
|
|
22
|
+
}[] | null | undefined>>;
|
|
23
|
+
}, zod.core.$strip>>, zod.ZodTransform<NonEmptyArray<IWorkflowStep>, {
|
|
32
24
|
id: string;
|
|
33
25
|
title: string;
|
|
34
26
|
color: string;
|
|
27
|
+
description: string | undefined;
|
|
35
28
|
teams: NonEmptyArray<import("~/domain/workflow/abstractions.js").IWorkflowStepTeam>;
|
|
36
|
-
|
|
37
|
-
notifications?: {
|
|
29
|
+
notifications: {
|
|
38
30
|
id: string;
|
|
39
31
|
}[] | undefined;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
title: string;
|
|
43
|
-
color: string;
|
|
44
|
-
teams: {
|
|
45
|
-
id: string;
|
|
46
|
-
}[];
|
|
47
|
-
description?: string | null | undefined;
|
|
48
|
-
notifications?: {
|
|
49
|
-
id: string;
|
|
50
|
-
}[] | null | undefined;
|
|
51
|
-
}>, "many">, NonEmptyArray<IWorkflowStep>, {
|
|
52
|
-
id: string;
|
|
53
|
-
title: string;
|
|
54
|
-
color: string;
|
|
55
|
-
teams: {
|
|
56
|
-
id: string;
|
|
57
|
-
}[];
|
|
58
|
-
description?: string | null | undefined;
|
|
59
|
-
notifications?: {
|
|
60
|
-
id: string;
|
|
61
|
-
}[] | null | undefined;
|
|
62
|
-
}[]>;
|
|
63
|
-
}, "strip", zod.ZodTypeAny, {
|
|
64
|
-
name: string;
|
|
65
|
-
steps: NonEmptyArray<IWorkflowStep>;
|
|
66
|
-
}, {
|
|
67
|
-
name: string;
|
|
68
|
-
steps: {
|
|
69
|
-
id: string;
|
|
70
|
-
title: string;
|
|
71
|
-
color: string;
|
|
72
|
-
teams: {
|
|
73
|
-
id: string;
|
|
74
|
-
}[];
|
|
75
|
-
description?: string | null | undefined;
|
|
76
|
-
notifications?: {
|
|
77
|
-
id: string;
|
|
78
|
-
}[] | null | undefined;
|
|
79
|
-
}[];
|
|
80
|
-
}>;
|
|
32
|
+
}[]>>;
|
|
33
|
+
}, zod.core.$strip>;
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextPlugin } from "@webiny/handler";
|
|
2
|
-
import { TenantContext } from "@webiny/api-core/features/TenantContext";
|
|
2
|
+
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
3
3
|
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
4
4
|
import { WcpContext } from "@webiny/api-core/features/wcp/WcpContext/index.js";
|
|
5
5
|
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ContextPlugin","TenantContext","IdentityContext","WcpContext","GetModelUseCase","WORKFLOW_MODEL_ID","WorkflowModel","WorkflowPrivateModel","WORKFLOW_STATE_MODEL_ID","WorkflowStateModel","WorkflowStatePrivateModel","createWorkflowsSchema","createWorkflowStateSchema","WorkflowMapper","WorkflowStateMapper","GetWorkflowFeature","ListWorkflowsFeature","CreateWorkflowFeature","DeleteWorkflowFeature","UpdateWorkflowFeature","StoreWorkflowFeature","GetWorkflowStateFeature","GetTargetWorkflowStateFeature","ListOwnWorkflowStatesFeature","ListWorkflowStatesFeature","ListRequestedWorkflowStatesFeature","CreateWorkflowStateFeature","UpdateWorkflowStateFeature","CancelWorkflowStateFeature","DeleteWorkflowStateFeature","DeleteTargetWorkflowStateFeature","StartWorkflowStateStepFeature","ApproveWorkflowStateStepFeature","RejectWorkflowStateStepFeature","TakeOverWorkflowStateStepFeature","GetUserTeamsFeature","ListNotificationTypesFeature","NotificationTransportFeature","createNotificationsGraphQL","createWorkflows","plugin","context","tenantContext","container","resolve","identityContext","wcpContext","hasTenant","getTenant","canUseWorkflows","register","getModel","withoutAuthorization","workflowModel","workflowStateModel","Promise","all","execute","registerInstance","value","plugins","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/handler\";\nimport { TenantContext } from \"@webiny/api-core/features/TenantContext\";\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 {\n WORKFLOW_MODEL_ID,\n WorkflowModel as WorkflowPrivateModel\n} from \"./domain/workflow/workflowModel.js\";\nimport {\n WORKFLOW_STATE_MODEL_ID,\n WorkflowStateModel as WorkflowStatePrivateModel\n} from \"./domain/workflowState/stateModel.js\";\nimport { createWorkflowsSchema } from \"~/graphql/workflows.js\";\nimport { createWorkflowStateSchema } from \"~/graphql/workflowState.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\";\nimport { createNotificationsGraphQL } from \"~/graphql/notifications.js\";\n\nexport const createWorkflows = () => {\n const plugin = new ContextPlugin(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n const identityContext = context.container.resolve(IdentityContext);\n const wcpContext = context.container.resolve(WcpContext);\n\n const hasTenant = tenantContext.getTenant();\n const canUseWorkflows = wcpContext.canUseWorkflows();\n if (!hasTenant) {\n return;\n }\n\n if (!canUseWorkflows) {\n return;\n }\n\n // Register private models\n context.container.register(WorkflowPrivateModel);\n context.container.register(WorkflowStatePrivateModel);\n\n // Fetch and register CMS models\n const getModel = context.container.resolve(GetModelUseCase);\n\n await identityContext.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 context.container.registerInstance(WorkflowModel, workflowModel.value);\n context.container.registerInstance(WorkflowStateModel, workflowStateModel.value);\n });\n\n // Register mappers\n context.container.register(WorkflowMapper);\n context.container.register(WorkflowStateMapper);\n\n // Register notification features\n ListNotificationTypesFeature.register(context.container);\n NotificationTransportFeature.register(context.container);\n\n // Register workflow features\n GetWorkflowFeature.register(context.container);\n ListWorkflowsFeature.register(context.container);\n CreateWorkflowFeature.register(context.container);\n DeleteWorkflowFeature.register(context.container);\n UpdateWorkflowFeature.register(context.container);\n StoreWorkflowFeature.register(context.container);\n\n // Register internal features\n GetUserTeamsFeature.register(context.container);\n\n // Register workflow state features\n GetWorkflowStateFeature.register(context.container);\n GetTargetWorkflowStateFeature.register(context.container);\n ListOwnWorkflowStatesFeature.register(context.container);\n ListWorkflowStatesFeature.register(context.container);\n ListRequestedWorkflowStatesFeature.register(context.container);\n CreateWorkflowStateFeature.register(context.container);\n UpdateWorkflowStateFeature.register(context.container);\n CancelWorkflowStateFeature.register(context.container);\n DeleteWorkflowStateFeature.register(context.container);\n DeleteTargetWorkflowStateFeature.register(context.container);\n StartWorkflowStateStepFeature.register(context.container);\n ApproveWorkflowStateStepFeature.register(context.container);\n RejectWorkflowStateStepFeature.register(context.container);\n TakeOverWorkflowStateStepFeature.register(context.container);\n\n context.plugins.register(\n createNotificationsGraphQL(),\n createWorkflowsSchema(),\n createWorkflowStateSchema()\n );\n });\n\n plugin.name = \"workflows.context\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,aAAa,QAAQ,yCAAyC;AACvE,SAASC,eAAe,QAAQ,6DAA6D;AAC7F,SAASC,UAAU,QAAQ,mDAAmD;AAC9E,SAASC,eAAe,QAAQ,kEAAkE;AAClG,SACIC,iBAAiB,EACjBC,aAAa,IAAIC,oBAAoB;AAEzC,SACIC,uBAAuB,EACvBC,kBAAkB,IAAIC,yBAAyB;AAEnD,SAASC,qBAAqB;AAC9B,SAASC,yBAAyB;AAClC,SAASN,aAAa;AACtB,SAASG,kBAAkB;AAC3B,SAASI,cAAc;AACvB,SAASC,mBAAmB;AAC5B,SAASC,kBAAkB;AAC3B,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,6BAA6B;AACtC,SAASC,4BAA4B;AACrC,SAASC,yBAAyB;AAClC,SAASC,kCAAkC;AAC3C,SAASC,0BAA0B;AACnC,SAASC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A0B,CAACwB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IACtDhB,0BAA0B,CAACuB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IACtDf,0BAA0B,CAACsB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IACtDd,0BAA0B,CAACqB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IACtDb,gCAAgC,CAACoB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IAC5DZ,6BAA6B,CAACmB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IACzDX,+BAA+B,CAACkB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IAC3DV,8BAA8B,CAACiB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IAC1DT,gCAAgC,CAACgB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IAE5DF,OAAO,CAACmB,OAAO,CAACV,QAAQ,CACpBZ,0BAA0B,CAAC,CAAC,EAC5B3B,qBAAqB,CAAC,CAAC,EACvBC,yBAAyB,CAAC,CAC9B,CAAC;EACL,CAAC,CAAC;EAEF4B,MAAM,CAACqB,IAAI,GAAG,mBAAmB;EAEjC,OAAOrB,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ContextPlugin","TenantContext","IdentityContext","WcpContext","GetModelUseCase","WORKFLOW_MODEL_ID","WorkflowModel","WorkflowPrivateModel","WORKFLOW_STATE_MODEL_ID","WorkflowStateModel","WorkflowStatePrivateModel","createWorkflowsSchema","createWorkflowStateSchema","WorkflowMapper","WorkflowStateMapper","GetWorkflowFeature","ListWorkflowsFeature","CreateWorkflowFeature","DeleteWorkflowFeature","UpdateWorkflowFeature","StoreWorkflowFeature","GetWorkflowStateFeature","GetTargetWorkflowStateFeature","ListOwnWorkflowStatesFeature","ListWorkflowStatesFeature","ListRequestedWorkflowStatesFeature","CreateWorkflowStateFeature","UpdateWorkflowStateFeature","CancelWorkflowStateFeature","DeleteWorkflowStateFeature","DeleteTargetWorkflowStateFeature","StartWorkflowStateStepFeature","ApproveWorkflowStateStepFeature","RejectWorkflowStateStepFeature","TakeOverWorkflowStateStepFeature","GetUserTeamsFeature","ListNotificationTypesFeature","NotificationTransportFeature","createNotificationsGraphQL","createWorkflows","plugin","context","tenantContext","container","resolve","identityContext","wcpContext","hasTenant","getTenant","canUseWorkflows","register","getModel","withoutAuthorization","workflowModel","workflowStateModel","Promise","all","execute","registerInstance","value","plugins","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/handler\";\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 {\n WORKFLOW_MODEL_ID,\n WorkflowModel as WorkflowPrivateModel\n} from \"./domain/workflow/workflowModel.js\";\nimport {\n WORKFLOW_STATE_MODEL_ID,\n WorkflowStateModel as WorkflowStatePrivateModel\n} from \"./domain/workflowState/stateModel.js\";\nimport { createWorkflowsSchema } from \"~/graphql/workflows.js\";\nimport { createWorkflowStateSchema } from \"~/graphql/workflowState.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\";\nimport { createNotificationsGraphQL } from \"~/graphql/notifications.js\";\n\nexport const createWorkflows = () => {\n const plugin = new ContextPlugin(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n const identityContext = context.container.resolve(IdentityContext);\n const wcpContext = context.container.resolve(WcpContext);\n\n const hasTenant = tenantContext.getTenant();\n const canUseWorkflows = wcpContext.canUseWorkflows();\n if (!hasTenant) {\n return;\n }\n\n if (!canUseWorkflows) {\n return;\n }\n\n // Register private models\n context.container.register(WorkflowPrivateModel);\n context.container.register(WorkflowStatePrivateModel);\n\n // Fetch and register CMS models\n const getModel = context.container.resolve(GetModelUseCase);\n\n await identityContext.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 context.container.registerInstance(WorkflowModel, workflowModel.value);\n context.container.registerInstance(WorkflowStateModel, workflowStateModel.value);\n });\n\n // Register mappers\n context.container.register(WorkflowMapper);\n context.container.register(WorkflowStateMapper);\n\n // Register notification features\n ListNotificationTypesFeature.register(context.container);\n NotificationTransportFeature.register(context.container);\n\n // Register workflow features\n GetWorkflowFeature.register(context.container);\n ListWorkflowsFeature.register(context.container);\n CreateWorkflowFeature.register(context.container);\n DeleteWorkflowFeature.register(context.container);\n UpdateWorkflowFeature.register(context.container);\n StoreWorkflowFeature.register(context.container);\n\n // Register internal features\n GetUserTeamsFeature.register(context.container);\n\n // Register workflow state features\n GetWorkflowStateFeature.register(context.container);\n GetTargetWorkflowStateFeature.register(context.container);\n ListOwnWorkflowStatesFeature.register(context.container);\n ListWorkflowStatesFeature.register(context.container);\n ListRequestedWorkflowStatesFeature.register(context.container);\n CreateWorkflowStateFeature.register(context.container);\n UpdateWorkflowStateFeature.register(context.container);\n CancelWorkflowStateFeature.register(context.container);\n DeleteWorkflowStateFeature.register(context.container);\n DeleteTargetWorkflowStateFeature.register(context.container);\n StartWorkflowStateStepFeature.register(context.container);\n ApproveWorkflowStateStepFeature.register(context.container);\n RejectWorkflowStateStepFeature.register(context.container);\n TakeOverWorkflowStateStepFeature.register(context.container);\n\n context.plugins.register(\n createNotificationsGraphQL(),\n createWorkflowsSchema(),\n createWorkflowStateSchema()\n );\n });\n\n plug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S,CAAC;IAE5DF,OAAO,CAACmB,OAAO,CAACV,QAAQ,CACpBZ,0BAA0B,CAAC,CAAC,EAC5B3B,qBAAqB,CAAC,CAAC,EACvBC,yBAAyB,CAAC,CAC9B,CAAC;EACL,CAAC,CAAC;EAEF4B,MAAM,CAACqB,IAAI,GAAG,mBAAmB;EAEjC,OAAOrB,MAAM;AACjB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-workflows",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.e6f0dc8ca7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"description": "Workflows API",
|
|
7
10
|
"keywords": [
|
|
8
11
|
"api-workflows:base"
|
|
@@ -14,28 +17,28 @@
|
|
|
14
17
|
},
|
|
15
18
|
"license": "MIT",
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"@webiny/api": "0.0.0-unstable.
|
|
18
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
19
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
20
|
-
"@webiny/api-mailer": "0.0.0-unstable.
|
|
21
|
-
"@webiny/feature": "0.0.0-unstable.
|
|
22
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
23
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
24
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
25
|
-
"zod": "
|
|
20
|
+
"@webiny/api": "0.0.0-unstable.e6f0dc8ca7",
|
|
21
|
+
"@webiny/api-core": "0.0.0-unstable.e6f0dc8ca7",
|
|
22
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.e6f0dc8ca7",
|
|
23
|
+
"@webiny/api-mailer": "0.0.0-unstable.e6f0dc8ca7",
|
|
24
|
+
"@webiny/feature": "0.0.0-unstable.e6f0dc8ca7",
|
|
25
|
+
"@webiny/handler": "0.0.0-unstable.e6f0dc8ca7",
|
|
26
|
+
"@webiny/handler-graphql": "0.0.0-unstable.e6f0dc8ca7",
|
|
27
|
+
"@webiny/utils": "0.0.0-unstable.e6f0dc8ca7",
|
|
28
|
+
"zod": "4.4.3"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
29
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
30
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
31
|
-
"@webiny/testing": "0.0.0-unstable.
|
|
32
|
-
"type-fest": "5.
|
|
33
|
-
"typescript": "
|
|
34
|
-
"vitest": "4.
|
|
31
|
+
"@webiny/build-tools": "0.0.0-unstable.e6f0dc8ca7",
|
|
32
|
+
"@webiny/plugins": "0.0.0-unstable.e6f0dc8ca7",
|
|
33
|
+
"@webiny/project-utils": "0.0.0-unstable.e6f0dc8ca7",
|
|
34
|
+
"@webiny/testing": "0.0.0-unstable.e6f0dc8ca7",
|
|
35
|
+
"type-fest": "5.6.0",
|
|
36
|
+
"typescript": "6.0.3",
|
|
37
|
+
"vitest": "4.1.5"
|
|
35
38
|
},
|
|
36
39
|
"publishConfig": {
|
|
37
40
|
"access": "public",
|
|
38
41
|
"directory": "dist"
|
|
39
42
|
},
|
|
40
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "e6f0dc8ca741c1fcc3fec9a5b9e86fdd49544641"
|
|
41
44
|
}
|