@opencrvs/toolkit 1.8.0-rc.f9d33b7 → 1.8.0-rc.f9fb039

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