@opencrvs/toolkit 2.0.0-rc.b387062 → 2.0.0-rc.b4498f2
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/dist/cli.js +187 -93
- package/dist/commons/api/router.d.ts +2676 -143
- package/dist/commons/conditionals/validate.d.ts +1 -0
- package/dist/commons/events/ActionInput.d.ts +72 -0
- package/dist/commons/events/Draft.d.ts +2 -0
- package/dist/commons/events/utils.d.ts +1 -1
- package/dist/events/index.js +15 -14
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
- package/dist/migrations/v2.0/index.d.ts +5 -3
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +187 -93
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
- package/dist/notification/index.js +2 -0
- package/opencrvs-toolkit-2.0.0-rc.b4498f2.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.b387062.tgz +0 -0
|
@@ -28,6 +28,7 @@ export type ValidatorContext = {
|
|
|
28
28
|
id: UUID;
|
|
29
29
|
}>;
|
|
30
30
|
event?: EventDocument;
|
|
31
|
+
baseFormState?: EventState;
|
|
31
32
|
};
|
|
32
33
|
export declare function isFieldVisible(field: FieldConfig, form: Partial<ActionUpdate | EventState>, context: ValidatorContext): boolean;
|
|
33
34
|
export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
|
|
@@ -6,6 +6,8 @@ export declare const BaseActionInput: z.ZodObject<{
|
|
|
6
6
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
7
7
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
8
8
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
9
11
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
10
12
|
}, z.core.$strip>;
|
|
11
13
|
export declare const RegisterActionInput: z.ZodObject<{
|
|
@@ -15,6 +17,8 @@ export declare const RegisterActionInput: z.ZodObject<{
|
|
|
15
17
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
16
18
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
17
19
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
18
22
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
19
23
|
type: z.ZodDefault<z.ZodLiteral<"REGISTER">>;
|
|
20
24
|
registrationNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -27,6 +31,8 @@ export declare const NotifyActionInput: z.ZodObject<{
|
|
|
27
31
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
28
32
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
29
33
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
30
36
|
type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
|
|
31
37
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
32
38
|
}, z.core.$strip>;
|
|
@@ -38,6 +44,8 @@ export declare const DeclareActionInput: z.ZodObject<{
|
|
|
38
44
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
39
45
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
40
46
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
41
49
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
42
50
|
type: z.ZodDefault<z.ZodLiteral<"DECLARE">>;
|
|
43
51
|
}, z.core.$strip>;
|
|
@@ -48,6 +56,8 @@ export declare const EditActionInput: z.ZodObject<{
|
|
|
48
56
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
49
57
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
50
58
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
51
61
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
52
62
|
type: z.ZodDefault<z.ZodLiteral<"EDIT">>;
|
|
53
63
|
content: z.ZodObject<{
|
|
@@ -62,6 +72,8 @@ export declare const PrintCertificateActionInput: z.ZodObject<{
|
|
|
62
72
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
63
73
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
64
74
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
65
77
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
66
78
|
type: z.ZodDefault<z.ZodLiteral<"PRINT_CERTIFICATE">>;
|
|
67
79
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -76,6 +88,8 @@ export declare const RejectDeclarationActionInput: z.ZodObject<{
|
|
|
76
88
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
77
89
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
78
90
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
79
93
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
80
94
|
type: z.ZodDefault<z.ZodLiteral<"REJECT">>;
|
|
81
95
|
content: z.ZodObject<{
|
|
@@ -90,6 +104,8 @@ export declare const DuplicateDetectedActionInput: z.ZodObject<{
|
|
|
90
104
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
91
105
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
92
106
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
93
109
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
94
110
|
type: z.ZodDefault<z.ZodLiteral<"DUPLICATE_DETECTED">>;
|
|
95
111
|
content: z.ZodObject<{
|
|
@@ -106,6 +122,8 @@ export declare const MarkAsDuplicateActionInput: z.ZodObject<{
|
|
|
106
122
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
107
123
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
108
124
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
109
127
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
110
128
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_DUPLICATE">>;
|
|
111
129
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -120,6 +138,8 @@ export declare const MarkNotDuplicateActionInput: z.ZodObject<{
|
|
|
120
138
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
121
139
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
122
140
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
123
143
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
124
144
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">>;
|
|
125
145
|
}, z.core.$strip>;
|
|
@@ -131,6 +151,8 @@ export declare const ArchiveActionInput: z.ZodObject<{
|
|
|
131
151
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
132
152
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
133
153
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
134
156
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
135
157
|
type: z.ZodDefault<z.ZodLiteral<"ARCHIVE">>;
|
|
136
158
|
content: z.ZodObject<{
|
|
@@ -145,6 +167,8 @@ export declare const AssignActionInput: z.ZodObject<{
|
|
|
145
167
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
146
168
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
147
169
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
148
172
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
149
173
|
type: z.ZodLiteral<"ASSIGN">;
|
|
150
174
|
assignedTo: z.ZodString;
|
|
@@ -157,6 +181,8 @@ export declare const UnassignActionInput: z.ZodObject<{
|
|
|
157
181
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
158
182
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
159
183
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
160
186
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
161
187
|
type: z.ZodDefault<z.ZodLiteral<"UNASSIGN">>;
|
|
162
188
|
assignedTo: z.ZodDefault<z.ZodLiteral<null>>;
|
|
@@ -169,6 +195,8 @@ export declare const RequestCorrectionActionInput: z.ZodObject<{
|
|
|
169
195
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
170
196
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
171
197
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
172
200
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
173
201
|
type: z.ZodDefault<z.ZodLiteral<"REQUEST_CORRECTION">>;
|
|
174
202
|
}, z.core.$strip>;
|
|
@@ -180,6 +208,8 @@ export declare const RejectCorrectionActionInput: z.ZodObject<{
|
|
|
180
208
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
181
209
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
182
210
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
212
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
183
213
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
184
214
|
requestId: z.ZodString;
|
|
185
215
|
type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
|
|
@@ -195,6 +225,8 @@ export declare const ApproveCorrectionActionInput: z.ZodObject<{
|
|
|
195
225
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
196
226
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
197
227
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
198
230
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
199
231
|
requestId: z.ZodString;
|
|
200
232
|
type: z.ZodDefault<z.ZodLiteral<"APPROVE_CORRECTION">>;
|
|
@@ -207,6 +239,8 @@ export declare const ReadActionInput: z.ZodObject<{
|
|
|
207
239
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
208
240
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
209
241
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
242
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
210
244
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
211
245
|
type: z.ZodDefault<z.ZodLiteral<"READ">>;
|
|
212
246
|
}, z.core.$strip>;
|
|
@@ -222,6 +256,8 @@ export declare const CustomActionInput: z.ZodObject<{
|
|
|
222
256
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
223
257
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
224
258
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
260
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
225
261
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
226
262
|
type: z.ZodDefault<z.ZodLiteral<"CUSTOM">>;
|
|
227
263
|
customActionType: z.ZodString;
|
|
@@ -242,6 +278,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
242
278
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
243
279
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
244
280
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
245
283
|
type: z.ZodDefault<z.ZodLiteral<"CREATE">>;
|
|
246
284
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
247
285
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -251,6 +289,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
251
289
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
252
290
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
253
291
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
292
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
293
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
254
294
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
255
295
|
type: z.ZodDefault<z.ZodLiteral<"REGISTER">>;
|
|
256
296
|
registrationNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -261,6 +301,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
261
301
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
262
302
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
263
303
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
304
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
305
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
264
306
|
type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
|
|
265
307
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
266
308
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -270,6 +312,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
270
312
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
271
313
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
272
314
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
273
317
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
274
318
|
type: z.ZodDefault<z.ZodLiteral<"DECLARE">>;
|
|
275
319
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -279,6 +323,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
279
323
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
280
324
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
281
325
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
282
328
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
283
329
|
type: z.ZodDefault<z.ZodLiteral<"REJECT">>;
|
|
284
330
|
content: z.ZodObject<{
|
|
@@ -291,6 +337,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
291
337
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
292
338
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
293
339
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
294
342
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
295
343
|
type: z.ZodDefault<z.ZodLiteral<"DUPLICATE_DETECTED">>;
|
|
296
344
|
content: z.ZodObject<{
|
|
@@ -306,6 +354,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
306
354
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
307
355
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
308
356
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
357
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
309
359
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
310
360
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_DUPLICATE">>;
|
|
311
361
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -318,6 +368,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
318
368
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
319
369
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
320
370
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
371
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
372
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
321
373
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
322
374
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">>;
|
|
323
375
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -327,6 +379,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
327
379
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
328
380
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
329
381
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
382
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
330
384
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
331
385
|
type: z.ZodDefault<z.ZodLiteral<"ARCHIVE">>;
|
|
332
386
|
content: z.ZodObject<{
|
|
@@ -339,6 +393,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
339
393
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
340
394
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
341
395
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
396
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
397
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
342
398
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
343
399
|
type: z.ZodLiteral<"ASSIGN">;
|
|
344
400
|
assignedTo: z.ZodString;
|
|
@@ -349,6 +405,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
349
405
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
350
406
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
351
407
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
409
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
352
410
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
353
411
|
type: z.ZodDefault<z.ZodLiteral<"UNASSIGN">>;
|
|
354
412
|
assignedTo: z.ZodDefault<z.ZodLiteral<null>>;
|
|
@@ -359,6 +417,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
359
417
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
360
418
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
361
419
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
421
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
362
422
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
363
423
|
type: z.ZodDefault<z.ZodLiteral<"PRINT_CERTIFICATE">>;
|
|
364
424
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -371,6 +431,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
371
431
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
372
432
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
373
433
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
435
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
374
436
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
375
437
|
type: z.ZodDefault<z.ZodLiteral<"REQUEST_CORRECTION">>;
|
|
376
438
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -380,6 +442,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
380
442
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
381
443
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
382
444
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
445
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
446
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
383
447
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
384
448
|
requestId: z.ZodString;
|
|
385
449
|
type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
|
|
@@ -393,6 +457,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
393
457
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
394
458
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
395
459
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
460
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
461
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
396
462
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
397
463
|
requestId: z.ZodString;
|
|
398
464
|
type: z.ZodDefault<z.ZodLiteral<"APPROVE_CORRECTION">>;
|
|
@@ -403,6 +469,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
403
469
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
404
470
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
405
471
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
472
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
473
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
406
474
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
407
475
|
type: z.ZodDefault<z.ZodLiteral<"READ">>;
|
|
408
476
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -412,6 +480,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
412
480
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
413
481
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
414
482
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
483
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
484
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
415
485
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
416
486
|
type: z.ZodDefault<z.ZodLiteral<"CUSTOM">>;
|
|
417
487
|
customActionType: z.ZodString;
|
|
@@ -422,6 +492,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
422
492
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
423
493
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
424
494
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
495
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
496
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
425
497
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
426
498
|
type: z.ZodDefault<z.ZodLiteral<"EDIT">>;
|
|
427
499
|
content: z.ZodObject<{
|
|
@@ -51,6 +51,8 @@ export declare const DraftInput: z.ZodObject<{
|
|
|
51
51
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
52
52
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
53
53
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
54
56
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
55
57
|
type: z.ZodEnum<{
|
|
56
58
|
CUSTOM: "CUSTOM";
|
|
@@ -131,7 +131,7 @@ export declare function isPageVisible(page: PageConfig, formValues: ActionUpdate
|
|
|
131
131
|
* * @param validatorContext - custom validation context
|
|
132
132
|
* @returns {Partial<T>} A new object containing only the values for visible fields
|
|
133
133
|
*/
|
|
134
|
-
export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], formValues: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean
|
|
134
|
+
export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], formValues: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean): Partial<T>;
|
|
135
135
|
export declare function omitHiddenPaginatedFields<T extends EventState | ActionUpdate>(formConfig: FormConfig, values: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean): Partial<Partial<T>>;
|
|
136
136
|
/**
|
|
137
137
|
*
|
package/dist/events/index.js
CHANGED
|
@@ -3804,6 +3804,9 @@ function precompileActionSchemas(eventConfigurations) {
|
|
|
3804
3804
|
function isAgeValue(value) {
|
|
3805
3805
|
return typeof value === "object" && value !== null && "age" in value && typeof value.age === "number";
|
|
3806
3806
|
}
|
|
3807
|
+
function mergeWithBaseFormState(values, context) {
|
|
3808
|
+
return { ...context.baseFormState, ...values };
|
|
3809
|
+
}
|
|
3807
3810
|
function validate(schema, data) {
|
|
3808
3811
|
const validator = ajv.getSchema(schema.$id) || ajv.compile(schema);
|
|
3809
3812
|
if ("$form" in data) {
|
|
@@ -3842,7 +3845,7 @@ function isOnline() {
|
|
|
3842
3845
|
}
|
|
3843
3846
|
function isConditionMet(conditional, values, context, eventIndex) {
|
|
3844
3847
|
return validate(conditional, {
|
|
3845
|
-
$form: values,
|
|
3848
|
+
$form: mergeWithBaseFormState(values, context),
|
|
3846
3849
|
$now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
|
|
3847
3850
|
$online: isOnline(),
|
|
3848
3851
|
$user: context.user,
|
|
@@ -3871,7 +3874,7 @@ function isFieldConditionMet(field3, form, conditionalType, context) {
|
|
|
3871
3874
|
return true;
|
|
3872
3875
|
}
|
|
3873
3876
|
const validConditionals = getConditionalActionsForField(field3, {
|
|
3874
|
-
$form: form,
|
|
3877
|
+
$form: mergeWithBaseFormState(form, context),
|
|
3875
3878
|
$now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
|
|
3876
3879
|
$online: isOnline(),
|
|
3877
3880
|
$user: context.user,
|
|
@@ -4063,7 +4066,7 @@ function runFieldValidations({
|
|
|
4063
4066
|
return [];
|
|
4064
4067
|
}
|
|
4065
4068
|
const conditionalParameters = {
|
|
4066
|
-
$form: form,
|
|
4069
|
+
$form: mergeWithBaseFormState(form, context),
|
|
4067
4070
|
$now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
|
|
4068
4071
|
/**
|
|
4069
4072
|
* In real use cases, there can be hundreds of thousands of locations.
|
|
@@ -4307,17 +4310,16 @@ function isPageVisible(page, formValues, context) {
|
|
|
4307
4310
|
}
|
|
4308
4311
|
return isConditionMet(page.conditional, formValues, context);
|
|
4309
4312
|
}
|
|
4310
|
-
function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false
|
|
4313
|
+
function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false) {
|
|
4311
4314
|
const base = (0, import_lodash.cloneDeep)(formValues);
|
|
4312
4315
|
function fn(prevVisibilityContext) {
|
|
4313
|
-
const visibilityForm = declarationContext ? { ...declarationContext, ...prevVisibilityContext } : prevVisibilityContext;
|
|
4314
4316
|
const cleaned = (0, import_lodash.omitBy)(base, (value, fieldId) => {
|
|
4315
4317
|
const fieldConfig = fields.filter((f) => f.id === fieldId);
|
|
4316
4318
|
if (!fieldConfig.length) {
|
|
4317
4319
|
return false;
|
|
4318
4320
|
}
|
|
4319
4321
|
const isHidden = fieldConfig.every(
|
|
4320
|
-
(f) => !isFieldVisible(f,
|
|
4322
|
+
(f) => !isFieldVisible(f, prevVisibilityContext, validatorContext)
|
|
4321
4323
|
);
|
|
4322
4324
|
if (!isHidden) {
|
|
4323
4325
|
return false;
|
|
@@ -4335,7 +4337,7 @@ function omitHiddenPaginatedFields(formConfig, values, validatorContext, include
|
|
|
4335
4337
|
const visibleFields = formConfig.pages.filter((p) => isPageVisible(p, values, validatorContext)).flatMap((p) => p.fields);
|
|
4336
4338
|
const hiddenFields = formConfig.pages.filter((p) => !isPageVisible(p, values, validatorContext)).flatMap((p) => p.fields);
|
|
4337
4339
|
const valuesExceptHiddenPage = (0, import_lodash.omitBy)(values, (_2, fieldId) => {
|
|
4338
|
-
return hiddenFields.some((f) => f.id === fieldId);
|
|
4340
|
+
return hiddenFields.some((f) => f.id === fieldId) && !visibleFields.some((f) => f.id === fieldId);
|
|
4339
4341
|
});
|
|
4340
4342
|
return omitHiddenFields(
|
|
4341
4343
|
visibleFields,
|
|
@@ -4382,13 +4384,10 @@ function getVisibleVerificationPageIds(pages, annotation, context) {
|
|
|
4382
4384
|
}
|
|
4383
4385
|
function omitHiddenAnnotationFields(actionConfig, declaration, annotation, context) {
|
|
4384
4386
|
const annotationFields = getActionAnnotationFields(actionConfig);
|
|
4385
|
-
return omitHiddenFields(
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
false,
|
|
4390
|
-
declaration
|
|
4391
|
-
);
|
|
4387
|
+
return omitHiddenFields(annotationFields, annotation, {
|
|
4388
|
+
...context,
|
|
4389
|
+
baseFormState: declaration
|
|
4390
|
+
});
|
|
4392
4391
|
}
|
|
4393
4392
|
function deepMerge(currentDocument, actionDocument) {
|
|
4394
4393
|
const currentDocumentClone = (0, import_lodash.cloneDeep)(currentDocument);
|
|
@@ -5900,6 +5899,8 @@ var BaseActionInput = z38.object({
|
|
|
5900
5899
|
originalActionId: UUID.optional(),
|
|
5901
5900
|
// should not be part of base action.
|
|
5902
5901
|
keepAssignment: z38.boolean().optional(),
|
|
5902
|
+
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
5903
|
+
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
5903
5904
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
5904
5905
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
5905
5906
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const UPSTREAM_URL = "https://github.com/opencrvs/opencrvs-countryconfig.git";
|
|
2
|
-
export declare const UPSTREAM_BRANCH = "
|
|
2
|
+
export declare const UPSTREAM_BRANCH = "release-v2.0.0";
|
|
3
3
|
/**
|
|
4
4
|
* Runs a git command in the country config working directory.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;
|
|
1
|
+
{"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;AAE1D,eAAO,MAAM,eAAe,mBAAmB,CAAA;AAc/C;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAO9C;AAED,wBAAgB,eAAe,IAAI,IAAI,CAMtC;AAID,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -59,8 +59,7 @@ exports.main = main;
|
|
|
59
59
|
*/
|
|
60
60
|
const child_process_1 = require("child_process");
|
|
61
61
|
exports.UPSTREAM_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git';
|
|
62
|
-
|
|
63
|
-
exports.UPSTREAM_BRANCH = 'develop';
|
|
62
|
+
exports.UPSTREAM_BRANCH = 'release-v2.0.0';
|
|
64
63
|
// Remote name used only for the duration of this codemod. Prefixed to avoid
|
|
65
64
|
// clashing with remotes the user may have (origin, upstream, etc.).
|
|
66
65
|
const TEMP_REMOTE = 'opencrvs-upgrade-v19-v20-codemod';
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
interface DeleteInfrastructureOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Top-level entries directly under `infrastructure/` to preserve. Names
|
|
4
|
+
* match against the basename of each entry (file or directory). When
|
|
5
|
+
* empty (the default), the whole `infrastructure/` directory is deleted.
|
|
6
|
+
*/
|
|
7
|
+
keep?: string[];
|
|
8
|
+
}
|
|
9
|
+
declare function main({ keep }?: DeleteInfrastructureOptions): Promise<void>;
|
|
2
10
|
export { main };
|
|
3
11
|
//# sourceMappingURL=delete-infrastructure-directory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-infrastructure-directory.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/delete-infrastructure-directory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-infrastructure-directory.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/delete-infrastructure-directory.ts"],"names":[],"mappings":"AAoDA,UAAU,2BAA2B;IACnC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,iBAAe,IAAI,CAAC,EAClB,IAAS,EACV,GAAE,2BAAgC,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FlD;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -27,20 +27,28 @@ exports.main = main;
|
|
|
27
27
|
* via Docker Swarm. In that case the `infrastructure/` directory shipped
|
|
28
28
|
* with opencrvs-countryconfig is no longer needed and can be removed.
|
|
29
29
|
*
|
|
30
|
+
* Some non-Swarm deployments still need a small subset of
|
|
31
|
+
* `infrastructure/` (e.g. `postgres/` and `metabase/`). Pass `keep` to
|
|
32
|
+
* preserve those top-level subdirectories — everything else under
|
|
33
|
+
* `infrastructure/` is deleted, and the kept subdirectories can then be
|
|
34
|
+
* refreshed from upstream by `merge-infrastructure-directory.ts` with the
|
|
35
|
+
* matching `subdirs` option.
|
|
36
|
+
*
|
|
30
37
|
* Usage:
|
|
31
38
|
* ts-node -r tsconfig-paths/register src/migrations/v2.0/delete-infrastructure-directory.ts
|
|
32
39
|
*
|
|
33
40
|
* What it does:
|
|
34
41
|
* 1. Stages deletion of all tracked files under `infrastructure/` via
|
|
35
|
-
* `git rm -rf --ignore-unmatch --
|
|
36
|
-
*
|
|
42
|
+
* `git rm -rf --ignore-unmatch -- <path>`. This both removes the
|
|
43
|
+
* files from the working tree and records the deletion in the
|
|
37
44
|
* index, so it shows up in the upgrade commit alongside the other
|
|
38
|
-
* codemod changes.
|
|
45
|
+
* codemod changes. When `keep` is provided, deletion is scoped to
|
|
46
|
+
* the top-level entries that are NOT in `keep`.
|
|
39
47
|
* 2. Cleans up any untracked files / empty directory that `git rm` left
|
|
40
|
-
* behind, so the
|
|
48
|
+
* behind, so the deleted paths are fully gone from the working tree.
|
|
41
49
|
*
|
|
42
50
|
* Caveats:
|
|
43
|
-
* - Destructive: any local edits to
|
|
51
|
+
* - Destructive: any local edits to deleted paths are lost. Run on a
|
|
44
52
|
* clean working tree (or after committing your local changes).
|
|
45
53
|
* - If `infrastructure/` doesn't exist, this codemod is a no-op.
|
|
46
54
|
* - Requires git to be installed and the country config working directory
|
|
@@ -51,27 +59,65 @@ const path_1 = require("path");
|
|
|
51
59
|
const checkout_upstream_files_1 = require("./checkout-upstream-files");
|
|
52
60
|
const INFRASTRUCTURE_DIR = 'infrastructure';
|
|
53
61
|
function main() {
|
|
54
|
-
return __awaiter(this,
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* ({ keep = [] } = {}) {
|
|
55
63
|
const fullPath = (0, path_1.join)(process.cwd(), INFRASTRUCTURE_DIR);
|
|
56
64
|
if (!(0, fs_1.existsSync)(fullPath)) {
|
|
57
65
|
console.log(`'${INFRASTRUCTURE_DIR}/' not found in ${process.cwd()} — nothing to delete.`);
|
|
58
66
|
return;
|
|
59
67
|
}
|
|
60
|
-
console.log(`Deleting '${INFRASTRUCTURE_DIR}/'...\n`);
|
|
61
68
|
(0, checkout_upstream_files_1.assertIsGitRepo)();
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
// ─── Whole-directory delete (legacy behavior) ────────────────────────
|
|
70
|
+
if (keep.length === 0) {
|
|
71
|
+
console.log(`Deleting '${INFRASTRUCTURE_DIR}/'...\n`);
|
|
72
|
+
// `git rm -rf --ignore-unmatch` removes tracked files (working tree +
|
|
73
|
+
// index) and is a no-op for paths with no tracked entries, so it's
|
|
74
|
+
// safe to run even when `infrastructure/` exists only as untracked
|
|
75
|
+
// files.
|
|
76
|
+
(0, checkout_upstream_files_1.runGit)(['rm', '-rf', '--ignore-unmatch', '--', `${INFRASTRUCTURE_DIR}/`], {
|
|
77
|
+
silent: true
|
|
78
|
+
});
|
|
79
|
+
console.log(` Staged deletion of tracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
80
|
+
// `git rm` leaves untracked files (and any now-empty directory) on
|
|
81
|
+
// disk; remove whatever's left so the path is fully gone.
|
|
82
|
+
if ((0, fs_1.existsSync)(fullPath)) {
|
|
83
|
+
(0, fs_1.rmSync)(fullPath, { recursive: true, force: true });
|
|
84
|
+
console.log(` Removed remaining untracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
85
|
+
}
|
|
86
|
+
console.log(`\n Done. Review the staged deletion with: git diff --cached -- '${INFRASTRUCTURE_DIR}/'`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// ─── Selective delete: keep listed top-level entries ─────────────────
|
|
90
|
+
const keepSet = new Set(keep);
|
|
91
|
+
console.log(`Deleting contents of '${INFRASTRUCTURE_DIR}/' except: ${[...keepSet]
|
|
92
|
+
.map((name) => `'${name}'`)
|
|
93
|
+
.join(', ')}\n`);
|
|
94
|
+
const topLevelEntries = (0, fs_1.readdirSync)(fullPath, { withFileTypes: true });
|
|
95
|
+
let deleted = 0;
|
|
96
|
+
for (const entry of topLevelEntries) {
|
|
97
|
+
if (keepSet.has(entry.name)) {
|
|
98
|
+
console.log(` Keeping '${INFRASTRUCTURE_DIR}/${entry.name}'.`);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
// Append a trailing slash for directories so git treats it as a tree
|
|
102
|
+
// pathspec (matches the recursive behavior of `git rm -rf`).
|
|
103
|
+
const relPath = `${INFRASTRUCTURE_DIR}/${entry.name}${entry.isDirectory() ? '/' : ''}`;
|
|
104
|
+
(0, checkout_upstream_files_1.runGit)(['rm', '-rf', '--ignore-unmatch', '--', relPath], { silent: true });
|
|
105
|
+
const fullEntryPath = (0, path_1.join)(fullPath, entry.name);
|
|
106
|
+
if ((0, fs_1.existsSync)(fullEntryPath)) {
|
|
107
|
+
(0, fs_1.rmSync)(fullEntryPath, { recursive: true, force: true });
|
|
108
|
+
}
|
|
109
|
+
console.log(` Deleted '${relPath}'.`);
|
|
110
|
+
deleted++;
|
|
111
|
+
}
|
|
112
|
+
// Note any requested keeps that weren't actually present, so the dev
|
|
113
|
+
// notices typos / missing directories.
|
|
114
|
+
const presentNames = new Set(topLevelEntries.map((e) => e.name));
|
|
115
|
+
const missingKeeps = [...keepSet].filter((name) => !presentNames.has(name));
|
|
116
|
+
if (missingKeeps.length > 0) {
|
|
117
|
+
console.warn(` [warn] Requested to keep ${missingKeeps
|
|
118
|
+
.map((n) => `'${n}'`)
|
|
119
|
+
.join(', ')} but they don't exist under '${INFRASTRUCTURE_DIR}/'.`);
|
|
74
120
|
}
|
|
75
|
-
console.log(`\n Done. Review the staged
|
|
121
|
+
console.log(`\n Done. Deleted ${deleted} top-level entr${deleted === 1 ? 'y' : 'ies'}. Review the staged deletions with: git diff --cached -- '${INFRASTRUCTURE_DIR}/'`);
|
|
76
122
|
});
|
|
77
123
|
}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* directory.
|
|
4
4
|
*
|
|
5
5
|
* @param dockerSwarm - When true, the local `infrastructure/` directory is
|
|
6
|
-
* merged with upstream changes (Docker Swarm deployments
|
|
7
|
-
* When false (the default),
|
|
8
|
-
*
|
|
6
|
+
* merged with upstream changes in its entirety (Docker Swarm deployments
|
|
7
|
+
* still need it all). When false (the default), everything under
|
|
8
|
+
* `infrastructure/` is deleted EXCEPT the subdirectories listed in
|
|
9
|
+
* `NON_SWARM_INFRA_SUBDIRS`, and those preserved subdirectories are then
|
|
10
|
+
* merged with upstream.
|
|
9
11
|
*/
|
|
10
12
|
export declare function runUpgrade(dockerSwarm: boolean): Promise<void>;
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AA6CA;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBAgCpD"}
|