@opencrvs/toolkit 1.8.0-rc.fef85f2 → 1.8.0-rc.ff0b26c
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/commons/api/router.d.ts +10585 -4200
- package/dist/commons/conditionals/conditionals.d.ts +9 -6
- package/dist/commons/events/ActionConfig.d.ts +97080 -1720
- package/dist/commons/events/ActionDocument.d.ts +542 -211
- package/dist/commons/events/ActionInput.d.ts +248 -240
- package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
- package/dist/commons/events/Draft.d.ts +33 -20
- package/dist/commons/events/EventConfig.d.ts +46237 -1398
- package/dist/commons/events/EventDocument.d.ts +337 -159
- package/dist/commons/events/EventIndex.d.ts +1735 -16
- package/dist/commons/events/EventInput.d.ts +13 -0
- package/dist/commons/events/EventMetadata.d.ts +274 -14
- package/dist/commons/events/FieldConfig.d.ts +4229 -744
- package/dist/commons/events/FieldType.d.ts +3 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
- package/dist/commons/events/FieldValue.d.ts +7 -4
- package/dist/commons/events/FormConfig.d.ts +43591 -439
- package/dist/commons/events/PageConfig.d.ts +10860 -204
- package/dist/commons/events/SummaryConfig.d.ts +17 -47
- package/dist/commons/events/WorkqueueConfig.d.ts +1549 -19
- package/dist/commons/events/defineConfig.d.ts +7199 -27
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +82 -0
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/scopes.d.ts +21 -1
- package/dist/commons/events/test.utils.d.ts +10 -47
- package/dist/commons/events/utils.d.ts +3665 -67
- package/dist/conditionals/index.js +36 -33
- package/dist/events/index.js +1771 -966
- package/dist/scopes/index.d.ts +158 -1
- package/dist/scopes/index.js +152 -1
- package/package.json +3 -2
@@ -2,12 +2,25 @@ import { z } from 'zod';
|
|
2
2
|
export declare const EventInput: z.ZodObject<{
|
3
3
|
transactionId: z.ZodString;
|
4
4
|
type: z.ZodString;
|
5
|
+
dateOfEvent: z.ZodOptional<z.ZodObject<{
|
6
|
+
fieldId: z.ZodString;
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
8
|
+
fieldId: string;
|
9
|
+
}, {
|
10
|
+
fieldId: string;
|
11
|
+
}>>;
|
5
12
|
}, "strip", z.ZodTypeAny, {
|
6
13
|
type: string;
|
7
14
|
transactionId: string;
|
15
|
+
dateOfEvent?: {
|
16
|
+
fieldId: string;
|
17
|
+
} | undefined;
|
8
18
|
}, {
|
9
19
|
type: string;
|
10
20
|
transactionId: string;
|
21
|
+
dateOfEvent?: {
|
22
|
+
fieldId: string;
|
23
|
+
} | undefined;
|
11
24
|
}>;
|
12
25
|
export type EventInput = z.infer<typeof EventInput>;
|
13
26
|
//# sourceMappingURL=EventInput.d.ts.map
|
@@ -14,6 +14,15 @@ export declare const EventStatus: {
|
|
14
14
|
readonly ARCHIVED: "ARCHIVED";
|
15
15
|
};
|
16
16
|
export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus];
|
17
|
+
export declare const EventStatusEnum: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>;
|
18
|
+
export declare const CustomFlags: {
|
19
|
+
readonly CERTIFICATE_PRINTED: "certificate-printed";
|
20
|
+
};
|
21
|
+
export type CustomFlags = (typeof CustomFlags)[keyof typeof CustomFlags];
|
22
|
+
export declare const Flag: z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
|
23
|
+
readonly CERTIFICATE_PRINTED: "certificate-printed";
|
24
|
+
}>]>;
|
25
|
+
export type Flag = z.infer<typeof Flag>;
|
17
26
|
export declare const eventStatuses: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[];
|
18
27
|
export declare const EventStatuses: z.ZodNativeEnum<{
|
19
28
|
readonly CREATED: "CREATED";
|
@@ -25,6 +34,127 @@ export declare const EventStatuses: z.ZodNativeEnum<{
|
|
25
34
|
readonly REJECTED: "REJECTED";
|
26
35
|
readonly ARCHIVED: "ARCHIVED";
|
27
36
|
}>;
|
37
|
+
export declare const ZodDate: z.ZodString;
|
38
|
+
export declare const ActionCreationMetadata: z.ZodObject<{
|
39
|
+
createdAt: z.ZodString;
|
40
|
+
createdBy: z.ZodString;
|
41
|
+
createdAtLocation: z.ZodString;
|
42
|
+
acceptedAt: z.ZodString;
|
43
|
+
createdByRole: z.ZodString;
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
45
|
+
createdAt: string;
|
46
|
+
createdBy: string;
|
47
|
+
createdByRole: string;
|
48
|
+
createdAtLocation: string;
|
49
|
+
acceptedAt: string;
|
50
|
+
}, {
|
51
|
+
createdAt: string;
|
52
|
+
createdBy: string;
|
53
|
+
createdByRole: string;
|
54
|
+
createdAtLocation: string;
|
55
|
+
acceptedAt: string;
|
56
|
+
}>;
|
57
|
+
export type ActionCreationMetadata = z.infer<typeof ActionCreationMetadata>;
|
58
|
+
export declare const RegistrationCreationMetadata: z.ZodObject<z.objectUtil.extendShape<{
|
59
|
+
createdAt: z.ZodString;
|
60
|
+
createdBy: z.ZodString;
|
61
|
+
createdAtLocation: z.ZodString;
|
62
|
+
acceptedAt: z.ZodString;
|
63
|
+
createdByRole: z.ZodString;
|
64
|
+
}, {
|
65
|
+
registrationNumber: z.ZodString;
|
66
|
+
}>, "strip", z.ZodTypeAny, {
|
67
|
+
createdAt: string;
|
68
|
+
createdBy: string;
|
69
|
+
createdByRole: string;
|
70
|
+
createdAtLocation: string;
|
71
|
+
registrationNumber: string;
|
72
|
+
acceptedAt: string;
|
73
|
+
}, {
|
74
|
+
createdAt: string;
|
75
|
+
createdBy: string;
|
76
|
+
createdByRole: string;
|
77
|
+
createdAtLocation: string;
|
78
|
+
registrationNumber: string;
|
79
|
+
acceptedAt: string;
|
80
|
+
}>;
|
81
|
+
export type RegistrationCreationMetadata = z.infer<typeof RegistrationCreationMetadata>;
|
82
|
+
export declare const LegalStatuses: z.ZodObject<{
|
83
|
+
DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
84
|
+
createdAt: z.ZodString;
|
85
|
+
createdBy: z.ZodString;
|
86
|
+
createdAtLocation: z.ZodString;
|
87
|
+
acceptedAt: z.ZodString;
|
88
|
+
createdByRole: z.ZodString;
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
90
|
+
createdAt: string;
|
91
|
+
createdBy: string;
|
92
|
+
createdByRole: string;
|
93
|
+
createdAtLocation: string;
|
94
|
+
acceptedAt: string;
|
95
|
+
}, {
|
96
|
+
createdAt: string;
|
97
|
+
createdBy: string;
|
98
|
+
createdByRole: string;
|
99
|
+
createdAtLocation: string;
|
100
|
+
acceptedAt: string;
|
101
|
+
}>>>;
|
102
|
+
REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
103
|
+
createdAt: z.ZodString;
|
104
|
+
createdBy: z.ZodString;
|
105
|
+
createdAtLocation: z.ZodString;
|
106
|
+
acceptedAt: z.ZodString;
|
107
|
+
createdByRole: z.ZodString;
|
108
|
+
}, {
|
109
|
+
registrationNumber: z.ZodString;
|
110
|
+
}>, "strip", z.ZodTypeAny, {
|
111
|
+
createdAt: string;
|
112
|
+
createdBy: string;
|
113
|
+
createdByRole: string;
|
114
|
+
createdAtLocation: string;
|
115
|
+
registrationNumber: string;
|
116
|
+
acceptedAt: string;
|
117
|
+
}, {
|
118
|
+
createdAt: string;
|
119
|
+
createdBy: string;
|
120
|
+
createdByRole: string;
|
121
|
+
createdAtLocation: string;
|
122
|
+
registrationNumber: string;
|
123
|
+
acceptedAt: string;
|
124
|
+
}>>>;
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
126
|
+
DECLARED?: {
|
127
|
+
createdAt: string;
|
128
|
+
createdBy: string;
|
129
|
+
createdByRole: string;
|
130
|
+
createdAtLocation: string;
|
131
|
+
acceptedAt: string;
|
132
|
+
} | null | undefined;
|
133
|
+
REGISTERED?: {
|
134
|
+
createdAt: string;
|
135
|
+
createdBy: string;
|
136
|
+
createdByRole: string;
|
137
|
+
createdAtLocation: string;
|
138
|
+
registrationNumber: string;
|
139
|
+
acceptedAt: string;
|
140
|
+
} | null | undefined;
|
141
|
+
}, {
|
142
|
+
DECLARED?: {
|
143
|
+
createdAt: string;
|
144
|
+
createdBy: string;
|
145
|
+
createdByRole: string;
|
146
|
+
createdAtLocation: string;
|
147
|
+
acceptedAt: string;
|
148
|
+
} | null | undefined;
|
149
|
+
REGISTERED?: {
|
150
|
+
createdAt: string;
|
151
|
+
createdBy: string;
|
152
|
+
createdByRole: string;
|
153
|
+
createdAtLocation: string;
|
154
|
+
registrationNumber: string;
|
155
|
+
acceptedAt: string;
|
156
|
+
} | null | undefined;
|
157
|
+
}>;
|
28
158
|
/**
|
29
159
|
* Event metadata exposed to client.
|
30
160
|
*
|
@@ -43,15 +173,95 @@ export declare const EventMetadata: z.ZodObject<{
|
|
43
173
|
readonly REJECTED: "REJECTED";
|
44
174
|
readonly ARCHIVED: "ARCHIVED";
|
45
175
|
}>;
|
176
|
+
legalStatuses: z.ZodObject<{
|
177
|
+
DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
178
|
+
createdAt: z.ZodString;
|
179
|
+
createdBy: z.ZodString;
|
180
|
+
createdAtLocation: z.ZodString;
|
181
|
+
acceptedAt: z.ZodString;
|
182
|
+
createdByRole: z.ZodString;
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
184
|
+
createdAt: string;
|
185
|
+
createdBy: string;
|
186
|
+
createdByRole: string;
|
187
|
+
createdAtLocation: string;
|
188
|
+
acceptedAt: string;
|
189
|
+
}, {
|
190
|
+
createdAt: string;
|
191
|
+
createdBy: string;
|
192
|
+
createdByRole: string;
|
193
|
+
createdAtLocation: string;
|
194
|
+
acceptedAt: string;
|
195
|
+
}>>>;
|
196
|
+
REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
197
|
+
createdAt: z.ZodString;
|
198
|
+
createdBy: z.ZodString;
|
199
|
+
createdAtLocation: z.ZodString;
|
200
|
+
acceptedAt: z.ZodString;
|
201
|
+
createdByRole: z.ZodString;
|
202
|
+
}, {
|
203
|
+
registrationNumber: z.ZodString;
|
204
|
+
}>, "strip", z.ZodTypeAny, {
|
205
|
+
createdAt: string;
|
206
|
+
createdBy: string;
|
207
|
+
createdByRole: string;
|
208
|
+
createdAtLocation: string;
|
209
|
+
registrationNumber: string;
|
210
|
+
acceptedAt: string;
|
211
|
+
}, {
|
212
|
+
createdAt: string;
|
213
|
+
createdBy: string;
|
214
|
+
createdByRole: string;
|
215
|
+
createdAtLocation: string;
|
216
|
+
registrationNumber: string;
|
217
|
+
acceptedAt: string;
|
218
|
+
}>>>;
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
220
|
+
DECLARED?: {
|
221
|
+
createdAt: string;
|
222
|
+
createdBy: string;
|
223
|
+
createdByRole: string;
|
224
|
+
createdAtLocation: string;
|
225
|
+
acceptedAt: string;
|
226
|
+
} | null | undefined;
|
227
|
+
REGISTERED?: {
|
228
|
+
createdAt: string;
|
229
|
+
createdBy: string;
|
230
|
+
createdByRole: string;
|
231
|
+
createdAtLocation: string;
|
232
|
+
registrationNumber: string;
|
233
|
+
acceptedAt: string;
|
234
|
+
} | null | undefined;
|
235
|
+
}, {
|
236
|
+
DECLARED?: {
|
237
|
+
createdAt: string;
|
238
|
+
createdBy: string;
|
239
|
+
createdByRole: string;
|
240
|
+
createdAtLocation: string;
|
241
|
+
acceptedAt: string;
|
242
|
+
} | null | undefined;
|
243
|
+
REGISTERED?: {
|
244
|
+
createdAt: string;
|
245
|
+
createdBy: string;
|
246
|
+
createdByRole: string;
|
247
|
+
createdAtLocation: string;
|
248
|
+
registrationNumber: string;
|
249
|
+
acceptedAt: string;
|
250
|
+
} | null | undefined;
|
251
|
+
}>;
|
46
252
|
createdAt: z.ZodString;
|
253
|
+
dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
47
254
|
createdBy: z.ZodString;
|
255
|
+
updatedByUserRole: z.ZodString;
|
48
256
|
createdAtLocation: z.ZodString;
|
49
|
-
updatedAtLocation: z.ZodString
|
50
|
-
|
257
|
+
updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
258
|
+
updatedAt: z.ZodString;
|
51
259
|
assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
52
|
-
updatedBy: z.ZodString
|
260
|
+
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
53
261
|
trackingId: z.ZodString;
|
54
|
-
|
262
|
+
flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{
|
263
|
+
readonly CERTIFICATE_PRINTED: "certificate-printed";
|
264
|
+
}>]>, "many">;
|
55
265
|
}, "strip", z.ZodTypeAny, {
|
56
266
|
type: string;
|
57
267
|
id: string;
|
@@ -59,12 +269,31 @@ export declare const EventMetadata: z.ZodObject<{
|
|
59
269
|
createdAt: string;
|
60
270
|
createdBy: string;
|
61
271
|
createdAtLocation: string;
|
62
|
-
|
272
|
+
updatedAt: string;
|
63
273
|
trackingId: string;
|
64
|
-
|
65
|
-
|
274
|
+
legalStatuses: {
|
275
|
+
DECLARED?: {
|
276
|
+
createdAt: string;
|
277
|
+
createdBy: string;
|
278
|
+
createdByRole: string;
|
279
|
+
createdAtLocation: string;
|
280
|
+
acceptedAt: string;
|
281
|
+
} | null | undefined;
|
282
|
+
REGISTERED?: {
|
283
|
+
createdAt: string;
|
284
|
+
createdBy: string;
|
285
|
+
createdByRole: string;
|
286
|
+
createdAtLocation: string;
|
287
|
+
registrationNumber: string;
|
288
|
+
acceptedAt: string;
|
289
|
+
} | null | undefined;
|
290
|
+
};
|
291
|
+
updatedByUserRole: string;
|
292
|
+
flags: string[];
|
66
293
|
assignedTo?: string | null | undefined;
|
67
|
-
|
294
|
+
dateOfEvent?: string | null | undefined;
|
295
|
+
updatedAtLocation?: string | null | undefined;
|
296
|
+
updatedBy?: string | null | undefined;
|
68
297
|
}, {
|
69
298
|
type: string;
|
70
299
|
id: string;
|
@@ -72,19 +301,50 @@ export declare const EventMetadata: z.ZodObject<{
|
|
72
301
|
createdAt: string;
|
73
302
|
createdBy: string;
|
74
303
|
createdAtLocation: string;
|
75
|
-
|
304
|
+
updatedAt: string;
|
76
305
|
trackingId: string;
|
77
|
-
|
78
|
-
|
306
|
+
legalStatuses: {
|
307
|
+
DECLARED?: {
|
308
|
+
createdAt: string;
|
309
|
+
createdBy: string;
|
310
|
+
createdByRole: string;
|
311
|
+
createdAtLocation: string;
|
312
|
+
acceptedAt: string;
|
313
|
+
} | null | undefined;
|
314
|
+
REGISTERED?: {
|
315
|
+
createdAt: string;
|
316
|
+
createdBy: string;
|
317
|
+
createdByRole: string;
|
318
|
+
createdAtLocation: string;
|
319
|
+
registrationNumber: string;
|
320
|
+
acceptedAt: string;
|
321
|
+
} | null | undefined;
|
322
|
+
};
|
323
|
+
updatedByUserRole: string;
|
324
|
+
flags: string[];
|
79
325
|
assignedTo?: string | null | undefined;
|
80
|
-
|
326
|
+
dateOfEvent?: string | null | undefined;
|
327
|
+
updatedAtLocation?: string | null | undefined;
|
328
|
+
updatedBy?: string | null | undefined;
|
81
329
|
}>;
|
82
330
|
export type EventMetadata = z.infer<typeof EventMetadata>;
|
83
|
-
export
|
331
|
+
export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
|
332
|
+
export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>;
|
333
|
+
/**
|
334
|
+
* This ensures `event.field()` takes a key from `EventMetadata`
|
335
|
+
*/
|
336
|
+
export declare const EventMetadataParameter: z.ZodObject<{
|
337
|
+
$event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>;
|
338
|
+
}, "strip", z.ZodTypeAny, {
|
339
|
+
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
|
340
|
+
}, {
|
341
|
+
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
|
342
|
+
}>;
|
343
|
+
export type EventMetadataParameter = z.infer<typeof EventMetadataParameter>;
|
84
344
|
/**
|
85
345
|
* Mapping of event metadata keys to translation configuration.
|
86
346
|
* Consider introducing type in same manner as we have in FieldConfig.
|
87
347
|
* We need a way to know how to parse it.
|
88
348
|
*/
|
89
|
-
export declare const eventMetadataLabelMap: Record<EventMetadataKeys
|
349
|
+
export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>;
|
90
350
|
//# sourceMappingURL=EventMetadata.d.ts.map
|