@opencrvs/toolkit 1.9.12-rc.b03dff5 → 1.9.12-rc.ba08187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/build.sh +5 -0
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/application-config/index.d.ts +2 -0
  4. package/dist/application-config/index.d.ts.map +1 -0
  5. package/dist/application-config/index.js +124 -0
  6. package/dist/commons/api/router.d.ts +3163 -2251
  7. package/dist/commons/application-config/index.d.ts +87 -0
  8. package/dist/commons/conditionals/conditionals.d.ts +27 -3
  9. package/dist/commons/conditionals/validate.d.ts +13 -2
  10. package/dist/commons/events/ActionConfig.d.ts +415 -1555
  11. package/dist/commons/events/ActionDocument.d.ts +888 -1941
  12. package/dist/commons/events/ActionInput.d.ts +277 -1073
  13. package/dist/commons/events/ActionType.d.ts +91 -11
  14. package/dist/commons/events/AdvancedSearchConfig.d.ts +288 -1496
  15. package/dist/commons/events/AuditLog.d.ts +223 -0
  16. package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
  17. package/dist/commons/events/Conditional.d.ts +26 -38
  18. package/dist/commons/events/Constants.d.ts +1 -1
  19. package/dist/commons/events/CountryConfigQueryInput.d.ts +1345 -4495
  20. package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
  21. package/dist/commons/events/Draft.d.ts +72 -107
  22. package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
  23. package/dist/commons/events/EventConfig.d.ts +35 -2420
  24. package/dist/commons/events/EventConfigInput.d.ts +0 -3
  25. package/dist/commons/events/EventDocument.d.ts +354 -1366
  26. package/dist/commons/events/EventIndex.d.ts +208 -1014
  27. package/dist/commons/events/EventInput.d.ts +3 -8
  28. package/dist/commons/events/EventMetadata.d.ts +130 -357
  29. package/dist/commons/events/FieldConfig.d.ts +2671 -12896
  30. package/dist/commons/events/FieldType.d.ts +25 -4
  31. package/dist/commons/events/FieldTypeMapping.d.ts +289 -907
  32. package/dist/commons/events/FieldValue.d.ts +121 -527
  33. package/dist/commons/events/FileUtils.d.ts +2 -2
  34. package/dist/commons/events/Flag.d.ts +67 -0
  35. package/dist/commons/events/FormConfig.d.ts +54 -721
  36. package/dist/commons/events/PageConfig.d.ts +58 -320
  37. package/dist/commons/events/PlainDate.d.ts +1 -1
  38. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  39. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  40. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  41. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  42. package/dist/commons/events/WorkqueueConfig.d.ts +2008 -7597
  43. package/dist/commons/events/deduplication.d.ts +3 -3
  44. package/dist/commons/events/defineConfig.d.ts +2 -243
  45. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  46. package/dist/commons/events/index.d.ts +3 -0
  47. package/dist/commons/events/locations.d.ts +57 -20
  48. package/dist/commons/events/scopes.d.ts +33 -33
  49. package/dist/commons/events/state/availableActions.d.ts +7 -2
  50. package/dist/commons/events/state/flags.d.ts +21 -3
  51. package/dist/commons/events/state/index.d.ts +30 -27
  52. package/dist/commons/events/state/utils.d.ts +190 -172
  53. package/dist/commons/events/test.utils.d.ts +52 -11
  54. package/dist/commons/events/transactions.d.ts +1 -1
  55. package/dist/commons/events/utils.d.ts +413 -310
  56. package/dist/commons/notification/UserNotifications.d.ts +55 -636
  57. package/dist/conditionals/index.d.ts.map +1 -1
  58. package/dist/conditionals/index.js +587 -14
  59. package/dist/events/deduplication.d.ts +3 -3
  60. package/dist/events/index.js +2689 -1891
  61. package/dist/notification/index.d.ts.map +1 -1
  62. package/dist/notification/index.js +1987 -1553
  63. package/dist/scopes/index.d.ts +352 -302
  64. package/dist/scopes/index.d.ts.map +1 -1
  65. package/dist/scopes/index.js +444 -210
  66. package/opencrvs-toolkit-1.9.12-rc.ba08187.tgz +0 -0
  67. package/package.json +11 -5
  68. package/tsconfig.json +9 -2
  69. package/tsconfig.tsbuildinfo +1 -1
  70. package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { ActionType, DeclarationActionType } from './ActionType';
1
+ import { ActionType, DeclarationActionType, DisplayableAction } from './ActionType';
2
2
  import { EventConfig } from './EventConfig';
3
3
  import { FieldConfig, FieldReference } from './FieldConfig';
4
4
  import { Action, ActionDocument, ActionUpdate, EventState } from './ActionDocument';
@@ -7,56 +7,99 @@ import { ValidatorContext } from '../conditionals/validate';
7
7
  import { Draft } from './Draft';
8
8
  import { EventDocument } from './EventDocument';
9
9
  import { UUID } from '../uuid';
10
- import { ActionConfig } from './ActionConfig';
10
+ import { ActionConfig, ActionConfigTypes } from './ActionConfig';
11
11
  import { FormConfig } from './FormConfig';
12
12
  import { PlainDate, SelectDateRangeValue } from './FieldValue';
13
- export declare function ageToDate(age: number, asOfDate: PlainDate): string & import("zod").BRAND<"PlainDate">;
13
+ export declare function ageToDate(age: number, asOfDate: PlainDate): string & import("zod").$brand<"PlainDate">;
14
14
  export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
15
15
  export declare function getDeclarationPages(configuration: EventConfig): {
16
- type: "FORM";
17
16
  id: string;
18
- title: import("./TranslationConfig").TranslationConfig;
19
- fields: FieldConfig[];
17
+ title: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
20
22
  requireCompletionToContinue: boolean;
21
- conditional?: import(".").JSONSchema | undefined;
23
+ fields: FieldConfig[];
24
+ type: "FORM";
25
+ conditional?: any;
22
26
  }[];
23
27
  export declare function getDeclaration(configuration: EventConfig): {
24
- label: import("./TranslationConfig").TranslationConfig;
28
+ label: {
29
+ id: string;
30
+ defaultMessage: string;
31
+ description: string;
32
+ };
25
33
  pages: {
26
- type: "FORM";
27
34
  id: string;
28
- title: import("./TranslationConfig").TranslationConfig;
29
- fields: FieldConfig[];
35
+ title: {
36
+ id: string;
37
+ defaultMessage: string;
38
+ description: string;
39
+ };
30
40
  requireCompletionToContinue: boolean;
31
- conditional?: import(".").JSONSchema | undefined;
41
+ fields: FieldConfig[];
42
+ type: "FORM";
43
+ conditional?: any;
32
44
  }[];
33
45
  };
46
+ export declare function isActionConfigType(type: ActionType): type is ActionConfigTypes;
47
+ export declare function getActionConfig({ eventConfiguration, actionType, customActionType }: {
48
+ eventConfiguration: EventConfig;
49
+ actionType: DisplayableAction;
50
+ customActionType?: string;
51
+ }): ActionConfig | undefined;
52
+ export declare function getCustomActionFields(eventConfiguration: EventConfig, customActionType: string): FieldConfig[];
34
53
  export declare function getPrintCertificatePages(configuration: EventConfig): ({
35
- type: "FORM";
36
54
  id: string;
37
- title: import("./TranslationConfig").TranslationConfig;
38
- fields: FieldConfig[];
55
+ title: {
56
+ id: string;
57
+ defaultMessage: string;
58
+ description: string;
59
+ };
39
60
  requireCompletionToContinue: boolean;
40
- conditional?: import(".").JSONSchema | undefined;
61
+ fields: FieldConfig[];
62
+ type: "FORM";
63
+ conditional?: any;
41
64
  } | {
42
- type: "VERIFICATION";
43
65
  id: string;
44
- title: import("./TranslationConfig").TranslationConfig;
66
+ title: {
67
+ id: string;
68
+ defaultMessage: string;
69
+ description: string;
70
+ };
71
+ requireCompletionToContinue: boolean;
72
+ fields: FieldConfig[];
73
+ type: "VERIFICATION";
45
74
  actions: {
75
+ verify: {
76
+ label: {
77
+ id: string;
78
+ defaultMessage: string;
79
+ description: string;
80
+ };
81
+ };
46
82
  cancel: {
47
- label: import("./TranslationConfig").TranslationConfig;
83
+ label: {
84
+ id: string;
85
+ defaultMessage: string;
86
+ description: string;
87
+ };
48
88
  confirmation: {
49
- title: import("./TranslationConfig").TranslationConfig;
50
- body: import("./TranslationConfig").TranslationConfig;
89
+ title: {
90
+ id: string;
91
+ defaultMessage: string;
92
+ description: string;
93
+ };
94
+ body: {
95
+ id: string;
96
+ defaultMessage: string;
97
+ description: string;
98
+ };
51
99
  };
52
100
  };
53
- verify: {
54
- label: import("./TranslationConfig").TranslationConfig;
55
- };
56
101
  };
57
- fields: FieldConfig[];
58
- requireCompletionToContinue: boolean;
59
- conditional?: import(".").JSONSchema | undefined;
102
+ conditional?: any;
60
103
  })[];
61
104
  export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => FieldConfig[];
62
105
  export declare function getAllUniqueFields(eventConfig: EventConfig): FieldConfig[];
@@ -66,9 +109,13 @@ export declare function getDeclarationFieldById(config: EventConfig, fieldId: st
66
109
  */
67
110
  export declare const findRecordActionPages: (config: EventConfig, actionType: ActionType) => PageConfig[];
68
111
  export declare function getActionReview(configuration: EventConfig, actionType: ActionType): {
69
- title: import("./TranslationConfig").TranslationConfig;
112
+ title: {
113
+ id: string;
114
+ defaultMessage: string;
115
+ description: string;
116
+ };
70
117
  fields: FieldConfig[];
71
- };
118
+ } | undefined;
72
119
  export declare function getActionReviewFields(configuration: EventConfig, actionType: DeclarationActionType): FieldConfig[];
73
120
  export declare function isPageVisible(page: PageConfig, formValues: ActionUpdate, context: ValidatorContext): boolean;
74
121
  /**
@@ -96,9 +143,9 @@ export declare function isVerificationPage(page: PageConfig): page is Verificati
96
143
  export declare function getVisibleVerificationPageIds(pages: PageConfig[], annotation: ActionUpdate, context: ValidatorContext): string[];
97
144
  export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, declaration: EventState, annotation: ActionUpdate, context: ValidatorContext): Partial<{
98
145
  [x: string]: string | number | boolean | {
99
- type: string;
100
- path: string;
146
+ path: string & import("zod").$brand<"DocumentPath">;
101
147
  originalFilename: string;
148
+ type: string;
102
149
  } | {
103
150
  firstname: string;
104
151
  surname: string;
@@ -126,46 +173,38 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
126
173
  country?: string | null | undefined;
127
174
  streetLevelDetails?: Record<string, string | null> | null | undefined;
128
175
  } | {
176
+ path: string & import("zod").$brand<"DocumentPath">;
177
+ originalFilename: string;
129
178
  type: string;
130
179
  option: string;
131
- path: string;
132
- originalFilename: string;
133
180
  }[] | {
134
181
  loading: boolean;
135
- data?: any;
182
+ data: any;
136
183
  error?: {
137
- message: string;
138
184
  statusCode: number;
139
- } | null | undefined;
140
- } | {
141
- data?: any;
142
- error?: {
143
185
  message: string;
144
- statusCode: number;
145
186
  } | null | undefined;
146
- loading?: boolean | null | undefined;
147
- } | {
148
- data: Record<string, string>;
149
187
  } | {
150
188
  data: Record<string, string>;
189
+ updatedAt: string;
151
190
  } | {
152
- data?: any;
191
+ data: any;
153
192
  } | {
154
193
  numericValue: number;
155
194
  unit: string;
156
195
  } | {
157
196
  numericValue?: number | undefined;
158
197
  unit?: string | undefined;
159
- } | (string & import("zod").BRAND<"PlainDate">) | {
198
+ } | import("zod").$brand<"CustomFieldValue"> | (string & import("zod").$brand<"PlainDate">) | {
160
199
  age: number;
161
200
  asOfDateRef: string;
162
201
  } | {
163
- start: string & import("zod").BRAND<"PlainDate">;
164
- end: string & import("zod").BRAND<"PlainDate">;
202
+ start: string & import("zod").$brand<"PlainDate">;
203
+ end: string & import("zod").$brand<"PlainDate">;
165
204
  } | Record<string, string | number | boolean | {
166
- type: string;
167
- path: string;
205
+ path: string & import("zod").$brand<"DocumentPath">;
168
206
  originalFilename: string;
207
+ type: string;
169
208
  } | {
170
209
  firstname: string;
171
210
  surname: string;
@@ -184,38 +223,39 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
184
223
  addressType: "INTERNATIONAL";
185
224
  streetLevelDetails?: Record<string, string> | undefined;
186
225
  } | {
226
+ path: string & import("zod").$brand<"DocumentPath">;
227
+ originalFilename: string;
187
228
  type: string;
188
229
  option: string;
189
- path: string;
190
- originalFilename: string;
191
230
  }[] | {
192
231
  loading: boolean;
193
- data?: any;
232
+ data: any;
194
233
  error?: {
195
- message: string;
196
234
  statusCode: number;
235
+ message: string;
197
236
  } | null | undefined;
198
237
  } | {
199
238
  data: Record<string, string>;
239
+ updatedAt: string;
200
240
  } | {
201
- data?: any;
241
+ data: any;
202
242
  } | {
203
243
  numericValue: number;
204
244
  unit: string;
205
245
  } | {
206
246
  numericValue?: number | undefined;
207
247
  unit?: string | undefined;
208
- } | (string & import("zod").BRAND<"PlainDate">) | {
248
+ } | import("zod").$brand<"CustomFieldValue"> | (string & import("zod").$brand<"PlainDate">) | {
209
249
  age: number;
210
250
  asOfDateRef: string;
211
251
  } | {
212
- start: string & import("zod").BRAND<"PlainDate">;
213
- end: string & import("zod").BRAND<"PlainDate">;
252
+ start: string & import("zod").$brand<"PlainDate">;
253
+ end: string & import("zod").$brand<"PlainDate">;
214
254
  } | null | undefined> | {
215
255
  data: Record<string, string | number | boolean | {
216
- type: string;
217
- path: string;
256
+ path: string & import("zod").$brand<"DocumentPath">;
218
257
  originalFilename: string;
258
+ type: string;
219
259
  } | {
220
260
  firstname: string;
221
261
  surname: string;
@@ -234,34 +274,44 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
234
274
  addressType: "INTERNATIONAL";
235
275
  streetLevelDetails?: Record<string, string> | undefined;
236
276
  } | {
277
+ path: string & import("zod").$brand<"DocumentPath">;
278
+ originalFilename: string;
237
279
  type: string;
238
280
  option: string;
239
- path: string;
240
- originalFilename: string;
241
281
  }[] | {
242
282
  loading: boolean;
243
- data?: any;
283
+ data: any;
244
284
  error?: {
245
- message: string;
246
285
  statusCode: number;
286
+ message: string;
247
287
  } | null | undefined;
248
288
  } | {
249
289
  data: Record<string, string>;
290
+ updatedAt: string;
250
291
  } | {
251
- data?: any;
292
+ data: any;
252
293
  } | {
253
294
  numericValue: number;
254
295
  unit: string;
255
296
  } | {
256
297
  numericValue?: number | undefined;
257
298
  unit?: string | undefined;
258
- } | (string & import("zod").BRAND<"PlainDate">) | {
299
+ } | import("zod").$brand<"CustomFieldValue"> | (string & import("zod").$brand<"PlainDate">) | {
259
300
  age: number;
260
301
  asOfDateRef: string;
261
302
  } | {
262
- start: string & import("zod").BRAND<"PlainDate">;
263
- end: string & import("zod").BRAND<"PlainDate">;
303
+ start: string & import("zod").$brand<"PlainDate">;
304
+ end: string & import("zod").$brand<"PlainDate">;
264
305
  } | null | undefined>;
306
+ } | {
307
+ loading?: boolean | null | undefined;
308
+ error?: {
309
+ statusCode: number;
310
+ message: string;
311
+ } | null | undefined;
312
+ data?: any;
313
+ } | {
314
+ data: Record<string, string>;
265
315
  } | null | undefined;
266
316
  }>;
267
317
  /**
@@ -273,7 +323,300 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
273
323
  * @example { annotation: {'review.signature': { path: '/path.png', type: 'image/png' }}, { annotation: { foo: 'bar'}) } } => { annotation: { foo: 'bar' } }
274
324
  */
275
325
  export declare function deepMerge<T extends Record<string, unknown>, K extends Record<string, unknown>>(currentDocument: T, actionDocument: K): T & K;
276
- export declare function findLastAssignmentAction(actions: Action[]): Action | undefined;
326
+ export declare function findLastAssignmentAction(actions: Action[]): {
327
+ id: string & import("zod").$brand<"UUID">;
328
+ transactionId: string;
329
+ createdByUserType: "user" | "system";
330
+ createdAt: string;
331
+ createdBy: string;
332
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
333
+ status: "Requested" | "Accepted" | "Rejected";
334
+ type: "REGISTER";
335
+ createdByRole?: string | undefined;
336
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
337
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
338
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
339
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
340
+ registrationNumber?: string | undefined;
341
+ } | {
342
+ id: string & import("zod").$brand<"UUID">;
343
+ transactionId: string;
344
+ createdByUserType: "user" | "system";
345
+ createdAt: string;
346
+ createdBy: string;
347
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
348
+ status: "Requested" | "Accepted" | "Rejected";
349
+ type: "DUPLICATE_DETECTED";
350
+ content: {
351
+ duplicates: {
352
+ id: string & import("zod").$brand<"UUID">;
353
+ trackingId: string;
354
+ }[];
355
+ };
356
+ createdByRole?: string | undefined;
357
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
358
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
359
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
360
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
361
+ } | {
362
+ id: string & import("zod").$brand<"UUID">;
363
+ transactionId: string;
364
+ createdByUserType: "user" | "system";
365
+ createdAt: string;
366
+ createdBy: string;
367
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
368
+ status: "Requested" | "Accepted" | "Rejected";
369
+ type: "EDIT";
370
+ content: {
371
+ comment?: string | undefined;
372
+ };
373
+ createdByRole?: string | undefined;
374
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
375
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
376
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
377
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
378
+ } | {
379
+ id: string & import("zod").$brand<"UUID">;
380
+ transactionId: string;
381
+ createdByUserType: "user" | "system";
382
+ createdAt: string;
383
+ createdBy: string;
384
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
385
+ status: "Requested" | "Accepted" | "Rejected";
386
+ type: "PRINT_CERTIFICATE";
387
+ createdByRole?: string | undefined;
388
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
389
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
390
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
391
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
392
+ content?: {
393
+ templateId?: string | undefined;
394
+ } | null | undefined;
395
+ } | {
396
+ id: string & import("zod").$brand<"UUID">;
397
+ transactionId: string;
398
+ createdByUserType: "user" | "system";
399
+ createdAt: string;
400
+ createdBy: string;
401
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
402
+ status: "Requested" | "Accepted" | "Rejected";
403
+ type: "REQUEST_CORRECTION";
404
+ createdByRole?: string | undefined;
405
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
406
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
407
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
408
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
409
+ } | {
410
+ id: string & import("zod").$brand<"UUID">;
411
+ transactionId: string;
412
+ createdByUserType: "user" | "system";
413
+ createdAt: string;
414
+ createdBy: string;
415
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
416
+ status: "Requested" | "Accepted" | "Rejected";
417
+ type: "CUSTOM";
418
+ customActionType: string;
419
+ createdByRole?: string | undefined;
420
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
421
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
422
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
423
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
424
+ } | {
425
+ id: string & import("zod").$brand<"UUID">;
426
+ transactionId: string;
427
+ createdByUserType: "user" | "system";
428
+ createdAt: string;
429
+ createdBy: string;
430
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
431
+ status: "Requested" | "Accepted" | "Rejected";
432
+ type: "CREATE";
433
+ createdByRole?: string | undefined;
434
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
435
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
436
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
437
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
438
+ } | {
439
+ id: string & import("zod").$brand<"UUID">;
440
+ transactionId: string;
441
+ createdByUserType: "user" | "system";
442
+ createdAt: string;
443
+ createdBy: string;
444
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
445
+ status: "Requested" | "Accepted" | "Rejected";
446
+ type: "REJECT";
447
+ content: {
448
+ reason: string;
449
+ };
450
+ createdByRole?: string | undefined;
451
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
452
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
453
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
454
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
455
+ } | {
456
+ id: string & import("zod").$brand<"UUID">;
457
+ transactionId: string;
458
+ createdByUserType: "user" | "system";
459
+ createdAt: string;
460
+ createdBy: string;
461
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
462
+ status: "Requested" | "Accepted" | "Rejected";
463
+ type: "MARK_AS_NOT_DUPLICATE";
464
+ createdByRole?: string | undefined;
465
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
466
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
467
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
468
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
469
+ } | {
470
+ id: string & import("zod").$brand<"UUID">;
471
+ transactionId: string;
472
+ createdByUserType: "user" | "system";
473
+ createdAt: string;
474
+ createdBy: string;
475
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
476
+ status: "Requested" | "Accepted" | "Rejected";
477
+ type: "MARK_AS_DUPLICATE";
478
+ createdByRole?: string | undefined;
479
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
480
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
481
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
482
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
483
+ content?: {
484
+ duplicateOf: string & import("zod").$brand<"UUID">;
485
+ } | undefined;
486
+ } | {
487
+ id: string & import("zod").$brand<"UUID">;
488
+ transactionId: string;
489
+ createdByUserType: "user" | "system";
490
+ createdAt: string;
491
+ createdBy: string;
492
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
493
+ status: "Requested" | "Accepted" | "Rejected";
494
+ type: "ARCHIVE";
495
+ content: {
496
+ reason: string;
497
+ };
498
+ createdByRole?: string | undefined;
499
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
500
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
501
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
502
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
503
+ } | {
504
+ id: string & import("zod").$brand<"UUID">;
505
+ transactionId: string;
506
+ createdByUserType: "user" | "system";
507
+ createdAt: string;
508
+ createdBy: string;
509
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
510
+ status: "Requested" | "Accepted" | "Rejected";
511
+ type: "NOTIFY";
512
+ createdByRole?: string | undefined;
513
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
514
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
515
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
516
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
517
+ } | {
518
+ id: string & import("zod").$brand<"UUID">;
519
+ transactionId: string;
520
+ createdByUserType: "user" | "system";
521
+ createdAt: string;
522
+ createdBy: string;
523
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
524
+ status: "Requested" | "Accepted" | "Rejected";
525
+ type: "DECLARE";
526
+ createdByRole?: string | undefined;
527
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
528
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
529
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
530
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
531
+ } | {
532
+ id: string & import("zod").$brand<"UUID">;
533
+ transactionId: string;
534
+ createdByUserType: "user" | "system";
535
+ createdAt: string;
536
+ createdBy: string;
537
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
538
+ status: "Requested" | "Accepted" | "Rejected";
539
+ type: "ASSIGN";
540
+ assignedTo: string;
541
+ createdByRole?: string | undefined;
542
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
543
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
544
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
545
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
546
+ } | {
547
+ id: string & import("zod").$brand<"UUID">;
548
+ transactionId: string;
549
+ createdByUserType: "user" | "system";
550
+ createdAt: string;
551
+ createdBy: string;
552
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
553
+ status: "Requested" | "Accepted" | "Rejected";
554
+ type: "APPROVE_CORRECTION";
555
+ requestId: string;
556
+ createdByRole?: string | undefined;
557
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
558
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
559
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
560
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
561
+ } | {
562
+ id: string & import("zod").$brand<"UUID">;
563
+ transactionId: string;
564
+ createdByUserType: "user" | "system";
565
+ createdAt: string;
566
+ createdBy: string;
567
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
568
+ status: "Requested" | "Accepted" | "Rejected";
569
+ type: "REJECT_CORRECTION";
570
+ requestId: string;
571
+ content: {
572
+ reason: string;
573
+ };
574
+ createdByRole?: string | undefined;
575
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
576
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
577
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
578
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
579
+ } | {
580
+ id: string & import("zod").$brand<"UUID">;
581
+ transactionId: string;
582
+ createdByUserType: "user" | "system";
583
+ createdAt: string;
584
+ createdBy: string;
585
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
586
+ status: "Requested" | "Accepted" | "Rejected";
587
+ type: "UNASSIGN";
588
+ createdByRole?: string | undefined;
589
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
590
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
591
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
592
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
593
+ } | {
594
+ id: string & import("zod").$brand<"UUID">;
595
+ transactionId: string;
596
+ createdByUserType: "user" | "system";
597
+ createdAt: string;
598
+ createdBy: string;
599
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
600
+ status: "Requested" | "Accepted" | "Rejected";
601
+ type: "READ";
602
+ createdByRole?: string | undefined;
603
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
604
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
605
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
606
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
607
+ } | {
608
+ id: string & import("zod").$brand<"UUID">;
609
+ transactionId: string;
610
+ createdByUserType: "user" | "system";
611
+ createdAt: string;
612
+ createdBy: string;
613
+ type: "NOTIFY" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "CUSTOM";
614
+ status: "Rejected";
615
+ createdByRole?: string | undefined;
616
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
617
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
618
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
619
+ } | undefined;
277
620
  /**
278
621
  * Tell compiler that accessing record with arbitrary key might result to undefined
279
622
  * Use when you **cannot guarantee** that key exists in the record
@@ -381,248 +724,7 @@ export declare const findAllFields: (config: EventConfig) => FieldConfig[];
381
724
  * @returns the value of the object at the given path.
382
725
  */
383
726
  export declare function getMixedPath<T = unknown>(obj: Record<string, unknown>, path: string, defaultValue?: T | undefined): T | undefined;
384
- export declare function getEventConfigById(eventConfigs: EventConfig[], id: string): {
385
- id: string;
386
- title: import("./TranslationConfig").TranslationConfig;
387
- declaration: {
388
- label: import("./TranslationConfig").TranslationConfig;
389
- pages: {
390
- type: "FORM";
391
- id: string;
392
- title: import("./TranslationConfig").TranslationConfig;
393
- fields: FieldConfig[];
394
- requireCompletionToContinue: boolean;
395
- conditional?: import(".").JSONSchema | undefined;
396
- }[];
397
- };
398
- actions: ({
399
- type: "READ";
400
- label: import("./TranslationConfig").TranslationConfig;
401
- review: {
402
- title: import("./TranslationConfig").TranslationConfig;
403
- fields: FieldConfig[];
404
- };
405
- } | {
406
- type: "DECLARE";
407
- label: import("./TranslationConfig").TranslationConfig;
408
- review: {
409
- title: import("./TranslationConfig").TranslationConfig;
410
- fields: FieldConfig[];
411
- };
412
- deduplication?: {
413
- id: string;
414
- query: import("./DeduplicationConfig").ClauseOutput;
415
- label: import("./TranslationConfig").TranslationConfig;
416
- } | undefined;
417
- } | {
418
- type: "VALIDATE";
419
- label: import("./TranslationConfig").TranslationConfig;
420
- review: {
421
- title: import("./TranslationConfig").TranslationConfig;
422
- fields: FieldConfig[];
423
- };
424
- deduplication?: {
425
- id: string;
426
- query: import("./DeduplicationConfig").ClauseOutput;
427
- label: import("./TranslationConfig").TranslationConfig;
428
- } | undefined;
429
- } | {
430
- type: "REJECT";
431
- label: import("./TranslationConfig").TranslationConfig;
432
- } | {
433
- type: "ARCHIVE";
434
- label: import("./TranslationConfig").TranslationConfig;
435
- } | {
436
- type: "REGISTER";
437
- label: import("./TranslationConfig").TranslationConfig;
438
- review: {
439
- title: import("./TranslationConfig").TranslationConfig;
440
- fields: FieldConfig[];
441
- };
442
- deduplication?: {
443
- id: string;
444
- query: import("./DeduplicationConfig").ClauseOutput;
445
- label: import("./TranslationConfig").TranslationConfig;
446
- } | undefined;
447
- } | {
448
- type: "DELETE";
449
- label: import("./TranslationConfig").TranslationConfig;
450
- } | {
451
- type: "PRINT_CERTIFICATE";
452
- label: import("./TranslationConfig").TranslationConfig;
453
- printForm: {
454
- label: import("./TranslationConfig").TranslationConfig;
455
- pages: ({
456
- type: "FORM";
457
- id: string;
458
- title: import("./TranslationConfig").TranslationConfig;
459
- fields: FieldConfig[];
460
- requireCompletionToContinue: boolean;
461
- conditional?: import(".").JSONSchema | undefined;
462
- } | {
463
- type: "VERIFICATION";
464
- id: string;
465
- title: import("./TranslationConfig").TranslationConfig;
466
- actions: {
467
- cancel: {
468
- label: import("./TranslationConfig").TranslationConfig;
469
- confirmation: {
470
- title: import("./TranslationConfig").TranslationConfig;
471
- body: import("./TranslationConfig").TranslationConfig;
472
- };
473
- };
474
- verify: {
475
- label: import("./TranslationConfig").TranslationConfig;
476
- };
477
- };
478
- fields: FieldConfig[];
479
- requireCompletionToContinue: boolean;
480
- conditional?: import(".").JSONSchema | undefined;
481
- })[];
482
- };
483
- } | {
484
- type: "REQUEST_CORRECTION";
485
- label: import("./TranslationConfig").TranslationConfig;
486
- correctionForm: {
487
- label: import("./TranslationConfig").TranslationConfig;
488
- pages: ({
489
- type: "FORM";
490
- id: string;
491
- title: import("./TranslationConfig").TranslationConfig;
492
- fields: FieldConfig[];
493
- requireCompletionToContinue: boolean;
494
- conditional?: import(".").JSONSchema | undefined;
495
- } | {
496
- type: "VERIFICATION";
497
- id: string;
498
- title: import("./TranslationConfig").TranslationConfig;
499
- actions: {
500
- cancel: {
501
- label: import("./TranslationConfig").TranslationConfig;
502
- confirmation: {
503
- title: import("./TranslationConfig").TranslationConfig;
504
- body: import("./TranslationConfig").TranslationConfig;
505
- };
506
- };
507
- verify: {
508
- label: import("./TranslationConfig").TranslationConfig;
509
- };
510
- };
511
- fields: FieldConfig[];
512
- requireCompletionToContinue: boolean;
513
- conditional?: import(".").JSONSchema | undefined;
514
- })[];
515
- };
516
- } | {
517
- type: "REJECT_CORRECTION";
518
- label: import("./TranslationConfig").TranslationConfig;
519
- } | {
520
- type: "APPROVE_CORRECTION";
521
- label: import("./TranslationConfig").TranslationConfig;
522
- })[];
523
- label: import("./TranslationConfig").TranslationConfig;
524
- summary: {
525
- fields: ({
526
- fieldId: string;
527
- label?: import("./TranslationConfig").TranslationConfig | undefined;
528
- conditionals?: {
529
- type: "SHOW";
530
- conditional: import(".").JSONSchema;
531
- }[] | undefined;
532
- emptyValueMessage?: import("./TranslationConfig").TranslationConfig | undefined;
533
- } | {
534
- id: string;
535
- value: import("./TranslationConfig").TranslationConfig;
536
- label: import("./TranslationConfig").TranslationConfig;
537
- conditionals?: {
538
- type: "SHOW";
539
- conditional: import(".").JSONSchema;
540
- }[] | undefined;
541
- emptyValueMessage?: import("./TranslationConfig").TranslationConfig | undefined;
542
- })[];
543
- };
544
- advancedSearch: {
545
- title: import("./TranslationConfig").TranslationConfig;
546
- fields: ({
547
- config: {
548
- type: "exact" | "fuzzy" | "range" | "within";
549
- searchFields?: string[] | undefined;
550
- };
551
- fieldId: string;
552
- fieldType: "field";
553
- type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FIELD_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
554
- options?: {
555
- value: string;
556
- label: string | import("./TranslationConfig").TranslationConfig;
557
- conditionals?: ({
558
- type: "SHOW";
559
- conditional: import(".").JSONSchema;
560
- } | {
561
- type: "ENABLE";
562
- conditional: import(".").JSONSchema;
563
- })[] | undefined;
564
- }[] | undefined;
565
- label?: import("./TranslationConfig").TranslationConfig | undefined;
566
- conditionals?: ({
567
- type: "SHOW";
568
- conditional: import(".").JSONSchema;
569
- } | {
570
- type: "ENABLE";
571
- conditional: import(".").JSONSchema;
572
- } | {
573
- type: "DISPLAY_ON_REVIEW";
574
- conditional: import(".").JSONSchema;
575
- })[] | undefined;
576
- searchCriteriaLabelPrefix?: import("./TranslationConfig").TranslationConfig | undefined;
577
- validations?: {
578
- message: import("./TranslationConfig").TranslationConfig;
579
- validator: import(".").JSONSchema;
580
- }[] | undefined;
581
- } | {
582
- config: {
583
- type: "exact" | "fuzzy" | "range" | "within";
584
- searchFields?: string[] | undefined;
585
- };
586
- fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
587
- fieldType: "event";
588
- type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FIELD_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
589
- options?: {
590
- value: string;
591
- label: string | import("./TranslationConfig").TranslationConfig;
592
- conditionals?: ({
593
- type: "SHOW";
594
- conditional: import(".").JSONSchema;
595
- } | {
596
- type: "ENABLE";
597
- conditional: import(".").JSONSchema;
598
- })[] | undefined;
599
- }[] | undefined;
600
- label?: import("./TranslationConfig").TranslationConfig | undefined;
601
- conditionals?: ({
602
- type: "SHOW";
603
- conditional: import(".").JSONSchema;
604
- } | {
605
- type: "ENABLE";
606
- conditional: import(".").JSONSchema;
607
- } | {
608
- type: "DISPLAY_ON_REVIEW";
609
- conditional: import(".").JSONSchema;
610
- })[] | undefined;
611
- searchCriteriaLabelPrefix?: import("./TranslationConfig").TranslationConfig | undefined;
612
- validations?: {
613
- message: import("./TranslationConfig").TranslationConfig;
614
- validator: import(".").JSONSchema;
615
- }[] | undefined;
616
- })[];
617
- }[];
618
- dateOfEvent?: {
619
- $$field: string;
620
- $$subfield: string[];
621
- } | {
622
- $$event: "createdAt" | "updatedAt" | "legalStatuses.DECLARED.createdAt" | "legalStatuses.DECLARED.acceptedAt" | "legalStatuses.REGISTERED.createdAt" | "legalStatuses.REGISTERED.acceptedAt";
623
- } | undefined;
624
- fallbackTitle?: import("./TranslationConfig").TranslationConfig | undefined;
625
- };
727
+ export declare function getEventConfigById(eventConfigs: EventConfig[], id: string): EventConfig;
626
728
  export declare function timePeriodToDateRange(value: SelectDateRangeValue): {
627
729
  startDate: string;
628
730
  endDate: string;
@@ -633,4 +735,5 @@ export declare function getCompleteActionAnnotation(annotation: ActionUpdate, ev
633
735
  export declare function getCompleteActionDeclaration<T extends EventState | ActionUpdate>(declaration: T, event: EventDocument, action: ActionDocument): T;
634
736
  export declare function getAcceptedActions(event: EventDocument): ActionDocument[];
635
737
  export declare function aggregateActionDeclarations(event: EventDocument): EventState;
738
+ export declare function aggregateActionAnnotations(event: EventDocument): EventState;
636
739
  //# sourceMappingURL=utils.d.ts.map