@opencrvs/toolkit 1.9.2 → 1.9.3-rc.0263d03

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 (59) hide show
  1. package/dist/commons/api/router.d.ts +28094 -2317
  2. package/dist/commons/conditionals/conditionals.d.ts +54 -1
  3. package/dist/commons/conditionals/validate.d.ts +12 -4
  4. package/dist/commons/events/ActionConfig.d.ts +23125 -1523
  5. package/dist/commons/events/ActionDocument.d.ts +840 -1849
  6. package/dist/commons/events/ActionInput.d.ts +290 -1066
  7. package/dist/commons/events/ActionType.d.ts +91 -8
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +222 -1238
  9. package/dist/commons/events/CompositeFieldValue.d.ts +25 -176
  10. package/dist/commons/events/Conditional.d.ts +26 -38
  11. package/dist/commons/events/Constants.d.ts +1 -1
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +931 -4169
  13. package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
  14. package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
  15. package/dist/commons/events/Draft.d.ts +72 -105
  16. package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
  17. package/dist/commons/events/EventConfig.d.ts +18322 -2096
  18. package/dist/commons/events/EventConfigInput.d.ts +1 -1
  19. package/dist/commons/events/EventDocument.d.ts +336 -1326
  20. package/dist/commons/events/EventIndex.d.ts +197 -967
  21. package/dist/commons/events/EventInput.d.ts +2 -8
  22. package/dist/commons/events/EventMetadata.d.ts +106 -346
  23. package/dist/commons/events/FieldConfig.d.ts +4173 -11778
  24. package/dist/commons/events/FieldType.d.ts +9 -4
  25. package/dist/commons/events/FieldTypeMapping.d.ts +172 -811
  26. package/dist/commons/events/FieldValue.d.ts +82 -355
  27. package/dist/commons/events/Flag.d.ts +70 -0
  28. package/dist/commons/events/FormConfig.d.ts +12882 -697
  29. package/dist/commons/events/PageConfig.d.ts +8605 -314
  30. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  31. package/dist/commons/events/TemplateConfig.d.ts +3 -3
  32. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  33. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  34. package/dist/commons/events/WorkqueueConfig.d.ts +1695 -7156
  35. package/dist/commons/events/deduplication.d.ts +3 -3
  36. package/dist/commons/events/defineConfig.d.ts +25160 -147
  37. package/dist/commons/events/event.d.ts +4 -4
  38. package/dist/commons/events/field.d.ts +110 -0
  39. package/dist/commons/events/index.d.ts +1 -0
  40. package/dist/commons/events/locations.d.ts +15 -19
  41. package/dist/commons/events/scopes.d.ts +3 -1
  42. package/dist/commons/events/state/availableActions.d.ts +2 -1
  43. package/dist/commons/events/state/flags.d.ts +21 -3
  44. package/dist/commons/events/state/index.d.ts +23 -19
  45. package/dist/commons/events/state/utils.d.ts +142 -110
  46. package/dist/commons/events/test.utils.d.ts +23 -6
  47. package/dist/commons/events/transactions.d.ts +1 -1
  48. package/dist/commons/events/utils.d.ts +50377 -357
  49. package/dist/commons/notification/UserNotifications.d.ts +55 -636
  50. package/dist/conditionals/index.d.ts.map +1 -1
  51. package/dist/conditionals/index.js +103 -10
  52. package/dist/events/deduplication.d.ts +3 -3
  53. package/dist/events/index.js +1921 -1501
  54. package/dist/notification/index.d.ts.map +1 -1
  55. package/dist/notification/index.js +1645 -1471
  56. package/dist/scopes/index.d.ts +138 -138
  57. package/dist/scopes/index.d.ts.map +1 -1
  58. package/dist/scopes/index.js +123 -93
  59. package/package.json +5 -5
@@ -10,7 +10,7 @@ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConf
10
10
  */
11
11
  declare function eventFn(fieldId: EventFieldIdInput): {
12
12
  range: () => {
13
- fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
13
+ fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
14
14
  fieldType: "event";
15
15
  } & {
16
16
  config: {
@@ -18,7 +18,7 @@ declare function eventFn(fieldId: EventFieldIdInput): {
18
18
  };
19
19
  };
20
20
  exact: () => {
21
- fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
21
+ fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
22
22
  fieldType: "event";
23
23
  } & {
24
24
  config: {
@@ -26,7 +26,7 @@ declare function eventFn(fieldId: EventFieldIdInput): {
26
26
  };
27
27
  };
28
28
  fuzzy: () => {
29
- fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
29
+ fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
30
30
  fieldType: "event";
31
31
  } & {
32
32
  config: {
@@ -34,7 +34,7 @@ declare function eventFn(fieldId: EventFieldIdInput): {
34
34
  };
35
35
  };
36
36
  within: () => {
37
- fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
37
+ fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
38
38
  fieldType: "event";
39
39
  } & {
40
40
  config: {
@@ -77,6 +77,11 @@ export declare function field(fieldId: string, options?: {
77
77
  days: (days: number) => {
78
78
  inPast: () => import("../conditionals/conditionals").JSONSchema;
79
79
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
80
+ fromDate: (date: `${string}-${string}-${string}` | {
81
+ $$field: string;
82
+ $$subfield: string[];
83
+ }) => import("../conditionals/conditionals").JSONSchema;
84
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
80
85
  };
81
86
  date: (date: string | {
82
87
  $$field: string;
@@ -88,6 +93,11 @@ export declare function field(fieldId: string, options?: {
88
93
  days: (days: number) => {
89
94
  inPast: () => import("../conditionals/conditionals").JSONSchema;
90
95
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
96
+ fromDate: (date: `${string}-${string}-${string}` | {
97
+ $$field: string;
98
+ $$subfield: string[];
99
+ }) => import("../conditionals/conditionals").JSONSchema;
100
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
91
101
  };
92
102
  date: (date: `${string}-${string}-${string}` | {
93
103
  $$field: string;
@@ -125,6 +135,11 @@ export declare function field(fieldId: string, options?: {
125
135
  days: (days: number) => {
126
136
  inPast: () => import("../conditionals/conditionals").JSONSchema;
127
137
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
138
+ fromDate: (date: `${string}-${string}-${string}` | {
139
+ $$field: string;
140
+ $$subfield: string[];
141
+ }) => import("../conditionals/conditionals").JSONSchema;
142
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
128
143
  };
129
144
  date: (date: string | {
130
145
  $$field: string;
@@ -136,6 +151,11 @@ export declare function field(fieldId: string, options?: {
136
151
  days: (days: number) => {
137
152
  inPast: () => import("../conditionals/conditionals").JSONSchema;
138
153
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
154
+ fromDate: (date: `${string}-${string}-${string}` | {
155
+ $$field: string;
156
+ $$subfield: string[];
157
+ }) => import("../conditionals/conditionals").JSONSchema;
158
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
139
159
  };
140
160
  date: (date: `${string}-${string}-${string}` | {
141
161
  $$field: string;
@@ -181,6 +201,11 @@ export declare function field(fieldId: string, options?: {
181
201
  days: (days: number) => {
182
202
  inPast: () => import("../conditionals/conditionals").JSONSchema;
183
203
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
204
+ fromDate: (date: `${string}-${string}-${string}` | {
205
+ $$field: string;
206
+ $$subfield: string[];
207
+ }) => import("../conditionals/conditionals").JSONSchema;
208
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
184
209
  };
185
210
  date: (date: string | {
186
211
  $$field: string;
@@ -192,6 +217,11 @@ export declare function field(fieldId: string, options?: {
192
217
  days: (days: number) => {
193
218
  inPast: () => import("../conditionals/conditionals").JSONSchema;
194
219
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
220
+ fromDate: (date: `${string}-${string}-${string}` | {
221
+ $$field: string;
222
+ $$subfield: string[];
223
+ }) => import("../conditionals/conditionals").JSONSchema;
224
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
195
225
  };
196
226
  date: (date: `${string}-${string}-${string}` | {
197
227
  $$field: string;
@@ -235,6 +265,11 @@ export declare function field(fieldId: string, options?: {
235
265
  days: (days: number) => {
236
266
  inPast: () => import("../conditionals/conditionals").JSONSchema;
237
267
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
268
+ fromDate: (date: `${string}-${string}-${string}` | {
269
+ $$field: string;
270
+ $$subfield: string[];
271
+ }) => import("../conditionals/conditionals").JSONSchema;
272
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
238
273
  };
239
274
  date: (date: string | {
240
275
  $$field: string;
@@ -246,6 +281,11 @@ export declare function field(fieldId: string, options?: {
246
281
  days: (days: number) => {
247
282
  inPast: () => import("../conditionals/conditionals").JSONSchema;
248
283
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
284
+ fromDate: (date: `${string}-${string}-${string}` | {
285
+ $$field: string;
286
+ $$subfield: string[];
287
+ }) => import("../conditionals/conditionals").JSONSchema;
288
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
249
289
  };
250
290
  date: (date: `${string}-${string}-${string}` | {
251
291
  $$field: string;
@@ -288,6 +328,11 @@ export declare function field(fieldId: string, options?: {
288
328
  days: (days: number) => {
289
329
  inPast: () => import("../conditionals/conditionals").JSONSchema;
290
330
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
331
+ fromDate: (date: `${string}-${string}-${string}` | {
332
+ $$field: string;
333
+ $$subfield: string[];
334
+ }) => import("../conditionals/conditionals").JSONSchema;
335
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
291
336
  };
292
337
  date: (date: string | {
293
338
  $$field: string;
@@ -299,6 +344,11 @@ export declare function field(fieldId: string, options?: {
299
344
  days: (days: number) => {
300
345
  inPast: () => import("../conditionals/conditionals").JSONSchema;
301
346
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
347
+ fromDate: (date: `${string}-${string}-${string}` | {
348
+ $$field: string;
349
+ $$subfield: string[];
350
+ }) => import("../conditionals/conditionals").JSONSchema;
351
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
302
352
  };
303
353
  date: (date: `${string}-${string}-${string}` | {
304
354
  $$field: string;
@@ -334,6 +384,11 @@ export declare function field(fieldId: string, options?: {
334
384
  days: (days: number) => {
335
385
  inPast: () => import("../conditionals/conditionals").JSONSchema;
336
386
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
387
+ fromDate: (date: `${string}-${string}-${string}` | {
388
+ $$field: string;
389
+ $$subfield: string[];
390
+ }) => import("../conditionals/conditionals").JSONSchema;
391
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
337
392
  };
338
393
  date: (date: string | {
339
394
  $$field: string;
@@ -345,6 +400,11 @@ export declare function field(fieldId: string, options?: {
345
400
  days: (days: number) => {
346
401
  inPast: () => import("../conditionals/conditionals").JSONSchema;
347
402
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
403
+ fromDate: (date: `${string}-${string}-${string}` | {
404
+ $$field: string;
405
+ $$subfield: string[];
406
+ }) => import("../conditionals/conditionals").JSONSchema;
407
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
348
408
  };
349
409
  date: (date: `${string}-${string}-${string}` | {
350
410
  $$field: string;
@@ -391,6 +451,11 @@ export declare function field(fieldId: string, options?: {
391
451
  days: (days: number) => {
392
452
  inPast: () => import("../conditionals/conditionals").JSONSchema;
393
453
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
454
+ fromDate: (date: `${string}-${string}-${string}` | {
455
+ $$field: string;
456
+ $$subfield: string[];
457
+ }) => import("../conditionals/conditionals").JSONSchema;
458
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
394
459
  };
395
460
  date: (date: string | {
396
461
  $$field: string;
@@ -402,6 +467,11 @@ export declare function field(fieldId: string, options?: {
402
467
  days: (days: number) => {
403
468
  inPast: () => import("../conditionals/conditionals").JSONSchema;
404
469
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
470
+ fromDate: (date: `${string}-${string}-${string}` | {
471
+ $$field: string;
472
+ $$subfield: string[];
473
+ }) => import("../conditionals/conditionals").JSONSchema;
474
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
405
475
  };
406
476
  date: (date: `${string}-${string}-${string}` | {
407
477
  $$field: string;
@@ -439,6 +509,11 @@ export declare function field(fieldId: string, options?: {
439
509
  days: (days: number) => {
440
510
  inPast: () => import("../conditionals/conditionals").JSONSchema;
441
511
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
512
+ fromDate: (date: `${string}-${string}-${string}` | {
513
+ $$field: string;
514
+ $$subfield: string[];
515
+ }) => import("../conditionals/conditionals").JSONSchema;
516
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
442
517
  };
443
518
  date: (date: string | {
444
519
  $$field: string;
@@ -450,6 +525,11 @@ export declare function field(fieldId: string, options?: {
450
525
  days: (days: number) => {
451
526
  inPast: () => import("../conditionals/conditionals").JSONSchema;
452
527
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
528
+ fromDate: (date: `${string}-${string}-${string}` | {
529
+ $$field: string;
530
+ $$subfield: string[];
531
+ }) => import("../conditionals/conditionals").JSONSchema;
532
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
453
533
  };
454
534
  date: (date: `${string}-${string}-${string}` | {
455
535
  $$field: string;
@@ -496,6 +576,11 @@ export declare function field(fieldId: string, options?: {
496
576
  days: (days: number) => {
497
577
  inPast: () => import("../conditionals/conditionals").JSONSchema;
498
578
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
579
+ fromDate: (date: `${string}-${string}-${string}` | {
580
+ $$field: string;
581
+ $$subfield: string[];
582
+ }) => import("../conditionals/conditionals").JSONSchema;
583
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
499
584
  };
500
585
  date: (date: string | {
501
586
  $$field: string;
@@ -507,6 +592,11 @@ export declare function field(fieldId: string, options?: {
507
592
  days: (days: number) => {
508
593
  inPast: () => import("../conditionals/conditionals").JSONSchema;
509
594
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
595
+ fromDate: (date: `${string}-${string}-${string}` | {
596
+ $$field: string;
597
+ $$subfield: string[];
598
+ }) => import("../conditionals/conditionals").JSONSchema;
599
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
510
600
  };
511
601
  date: (date: `${string}-${string}-${string}` | {
512
602
  $$field: string;
@@ -544,6 +634,11 @@ export declare function field(fieldId: string, options?: {
544
634
  days: (days: number) => {
545
635
  inPast: () => import("../conditionals/conditionals").JSONSchema;
546
636
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
637
+ fromDate: (date: `${string}-${string}-${string}` | {
638
+ $$field: string;
639
+ $$subfield: string[];
640
+ }) => import("../conditionals/conditionals").JSONSchema;
641
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
547
642
  };
548
643
  date: (date: string | {
549
644
  $$field: string;
@@ -555,6 +650,11 @@ export declare function field(fieldId: string, options?: {
555
650
  days: (days: number) => {
556
651
  inPast: () => import("../conditionals/conditionals").JSONSchema;
557
652
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
653
+ fromDate: (date: `${string}-${string}-${string}` | {
654
+ $$field: string;
655
+ $$subfield: string[];
656
+ }) => import("../conditionals/conditionals").JSONSchema;
657
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
558
658
  };
559
659
  date: (date: `${string}-${string}-${string}` | {
560
660
  $$field: string;
@@ -590,6 +690,11 @@ export declare function field(fieldId: string, options?: {
590
690
  days: (days: number) => {
591
691
  inPast: () => import("../conditionals/conditionals").JSONSchema;
592
692
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
693
+ fromDate: (date: `${string}-${string}-${string}` | {
694
+ $$field: string;
695
+ $$subfield: string[];
696
+ }) => import("../conditionals/conditionals").JSONSchema;
697
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
593
698
  };
594
699
  date: (date: string | {
595
700
  $$field: string;
@@ -601,6 +706,11 @@ export declare function field(fieldId: string, options?: {
601
706
  days: (days: number) => {
602
707
  inPast: () => import("../conditionals/conditionals").JSONSchema;
603
708
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
709
+ fromDate: (date: `${string}-${string}-${string}` | {
710
+ $$field: string;
711
+ $$subfield: string[];
712
+ }) => import("../conditionals/conditionals").JSONSchema;
713
+ fromNow: () => import("../conditionals/conditionals").JSONSchema;
604
714
  };
605
715
  date: (date: `${string}-${string}-${string}` | {
606
716
  $$field: string;
@@ -39,6 +39,7 @@ export * from './FileUtils';
39
39
  export * from '../conditionals/conditionals';
40
40
  export * from '../conditionals/validate';
41
41
  export * from './field';
42
+ export * from './Flag';
42
43
  export * from './event';
43
44
  export * from './locations';
44
45
  export { UUID } from '../uuid';
@@ -1,24 +1,20 @@
1
- import { z } from 'zod';
2
- export declare const LocationType: z.ZodEnum<["ADMIN_STRUCTURE", "CRVS_OFFICE", "HEALTH_FACILITY"]>;
1
+ import * as z from 'zod/v4';
2
+ export declare const LocationType: z.ZodEnum<{
3
+ ADMIN_STRUCTURE: "ADMIN_STRUCTURE";
4
+ HEALTH_FACILITY: "HEALTH_FACILITY";
5
+ CRVS_OFFICE: "CRVS_OFFICE";
6
+ }>;
3
7
  export type LocationType = z.infer<typeof LocationType>;
4
8
  export declare const Location: z.ZodObject<{
5
- id: z.ZodBranded<z.ZodString, "UUID">;
9
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID">;
6
10
  name: z.ZodString;
7
- parentId: z.ZodNullable<z.ZodBranded<z.ZodString, "UUID">>;
8
- validUntil: z.ZodNullable<z.ZodString>;
9
- locationType: z.ZodNullable<z.ZodEnum<["ADMIN_STRUCTURE", "CRVS_OFFICE", "HEALTH_FACILITY"]>>;
10
- }, "strip", z.ZodTypeAny, {
11
- id: string & z.BRAND<"UUID">;
12
- name: string;
13
- parentId: (string & z.BRAND<"UUID">) | null;
14
- validUntil: string | null;
15
- locationType: "ADMIN_STRUCTURE" | "HEALTH_FACILITY" | "CRVS_OFFICE" | null;
16
- }, {
17
- id: string;
18
- name: string;
19
- parentId: string | null;
20
- validUntil: string | null;
21
- locationType: "ADMIN_STRUCTURE" | "HEALTH_FACILITY" | "CRVS_OFFICE" | null;
22
- }>;
11
+ parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>;
12
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
13
+ locationType: z.ZodNullable<z.ZodEnum<{
14
+ ADMIN_STRUCTURE: "ADMIN_STRUCTURE";
15
+ HEALTH_FACILITY: "HEALTH_FACILITY";
16
+ CRVS_OFFICE: "CRVS_OFFICE";
17
+ }>>;
18
+ }, z.core.$strip>;
23
19
  export type Location = z.infer<typeof Location>;
24
20
  //# sourceMappingURL=locations.d.ts.map
@@ -6,6 +6,7 @@ export declare const ACTION_SCOPE_MAP: {
6
6
  CREATE: "record.create"[];
7
7
  NOTIFY: "record.notify"[];
8
8
  DECLARE: ("record.register" | "record.declare" | "record.declared.validate")[];
9
+ EDIT: "record.declared.edit"[];
9
10
  DELETE: "record.declare"[];
10
11
  VALIDATE: ("record.register" | "record.declared.validate")[];
11
12
  REGISTER: "record.register"[];
@@ -21,9 +22,10 @@ export declare const ACTION_SCOPE_MAP: {
21
22
  ASSIGN: null;
22
23
  UNASSIGN: null;
23
24
  DUPLICATE_DETECTED: never[];
25
+ CUSTOM: never[];
24
26
  };
25
27
  export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
26
- export declare function configurableEventScopeAllowed(scopes: Scope[], allowedConfigurableScopes: ConfigurableScopeType[], eventType: string): boolean;
28
+ export declare function configurableEventScopeAllowed(scopes: Scope[], allowedConfigurableScopes: ConfigurableScopeType[], eventType: string, customActionType?: string): boolean;
27
29
  /**
28
30
  * Checks if a given action is allowed for the provided scopes and event type.
29
31
  *
@@ -1,6 +1,7 @@
1
1
  import { DisplayableAction } from '../ActionType';
2
2
  import { EventIndex } from '../EventIndex';
3
- import { EventStatus, Flag } from '../EventMetadata';
3
+ import { EventStatus } from '../EventMetadata';
4
+ import { Flag } from '../Flag';
4
5
  export declare function getAvailableActions(status: EventStatus, flags: Flag[]): DisplayableAction[];
5
6
  export declare function getAvailableActionsForEvent(event: EventIndex): DisplayableAction[];
6
7
  //# sourceMappingURL=availableActions.d.ts.map
@@ -1,4 +1,22 @@
1
- import { Action } from '../ActionDocument';
2
- import { Flag } from '../EventMetadata';
3
- export declare function getFlagsFromActions(actions: Action[]): Flag[];
1
+ import { Flag, CustomFlag } from '../Flag';
2
+ import { EventConfig } from '../EventConfig';
3
+ import { EventDocument } from '../EventDocument';
4
+ /**
5
+ * This function resolves custom flags for an event based on its actions.
6
+ * Flags are not stored to the event state or any database directly, instead they are always computed/evaluated from the event actions.
7
+ *
8
+ * Processes accepted actions in chronological order, evaluating flag conditions
9
+ * at each action step. Flags can be added or removed based on action configurations
10
+ * and conditional logic. Duplicate flags are filtered out.
11
+ *
12
+ * @param event - The event document containing actions and metadata
13
+ * @param eventConfiguration - The configuration object for the event type defining action rules and flag behaviors
14
+ * @returns An array of unique custom flag IDs that apply to the event after processing all non-meta actions
15
+ *
16
+ * @example
17
+ * const flags = resolveEventCustomFlags(eventDoc, config);
18
+ * // Returns: ['flag-1', 'flag-3']
19
+ */
20
+ export declare function resolveEventCustomFlags(event: EventDocument, eventConfiguration: EventConfig): CustomFlag[];
21
+ export declare function getEventFlags(event: EventDocument, config: EventConfig): Flag[];
4
22
  //# sourceMappingURL=flags.d.ts.map
@@ -7,7 +7,7 @@ import { Draft } from '../Draft';
7
7
  import { EventConfig } from '../EventConfig';
8
8
  import { UUID } from '../../uuid';
9
9
  import { DocumentPath, FullDocumentPath, FullDocumentUrl } from '../../documents';
10
- export declare function getStatusFromActions(actions: Array<Action>): "ARCHIVED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED";
10
+ export declare function getStatusFromActions(actions: Array<Action>): "ARCHIVED" | "DECLARED" | "REGISTERED" | "CREATED" | "NOTIFIED";
11
11
  export declare function getAssignedUserFromActions(actions: Array<ActionDocument>): string | null;
12
12
  export declare function getAssignedUserSignatureFromActions(actions: Array<ActionDocument>): string | null;
13
13
  type NonNullableDeep<T> = T extends [unknown, ...unknown[]] ? {
@@ -28,9 +28,14 @@ export declare const DEFAULT_DATE_OF_EVENT_PROPERTY = "createdAt";
28
28
  export declare function resolveDateOfEvent(eventMetadata: {
29
29
  createdAt: string;
30
30
  }, declaration: EventState, config: EventConfig): string | undefined;
31
+ export declare const DEFAULT_PLACE_OF_EVENT_PROPERTY = "createdAtLocation";
32
+ export declare function resolvePlaceOfEvent(eventMetadata: {
33
+ createdAtLocation?: UUID | undefined | null;
34
+ }, declaration: EventState, config: EventConfig): UUID | undefined | null;
31
35
  export declare function extractPotentialDuplicatesFromActions(actions: Action[]): PotentialDuplicate[];
32
36
  /**
33
37
  * NOTE: This function should not run field validations. It should return the state based on the actions, without considering context (users, roles, permissions, etc).
38
+ createdAtLocation: CreatedAtLocation
34
39
  *
35
40
  * If you update this function, please ensure @EventIndex type is updated accordingly.
36
41
  * In most cases, you won't need to add new parameters to this function. Discuss with the team before doing so.
@@ -38,9 +43,7 @@ export declare function extractPotentialDuplicatesFromActions(actions: Action[])
38
43
  * @returns Calculates a snapshot summary of the event based on the actions taken on it.
39
44
  * @see EventIndex for the description of the returned object.
40
45
  */
41
- export declare function getCurrentEventState(event: EventDocument,
42
- /** @TODO: remove config parameter, it is only used by resolveDateOfEvent. See if it can be achieved in some other way. */
43
- config: EventConfig): EventIndex;
46
+ export declare function getCurrentEventState(event: EventDocument, config: EventConfig): EventIndex;
44
47
  /**
45
48
  * @returns the future state of the event with drafts applied to all fields.
46
49
  *
@@ -62,47 +65,48 @@ export declare function applyDeclarationToEventIndex(eventIndex: EventIndex, dec
62
65
  *
63
66
  */
64
67
  export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Draft, eventConfiguration: EventConfig): {
68
+ id: string & import("zod/v4").$brand<"UUID">;
65
69
  type: string;
66
- id: string & import("zod").BRAND<"UUID">;
67
- status: "ARCHIVED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED";
68
- createdAt: string;
69
- createdBy: string;
70
- declaration: Record<string, import("..").FieldValue>;
71
- trackingId: string;
72
- updatedAt: string;
70
+ status: "ARCHIVED" | "DECLARED" | "REGISTERED" | "CREATED" | "NOTIFIED";
73
71
  legalStatuses: {
74
72
  DECLARED?: {
75
73
  createdAt: string;
76
74
  createdBy: string;
77
- createdByRole: string;
78
75
  acceptedAt: string;
76
+ createdByRole: string;
77
+ createdAtLocation?: (string & import("zod/v4").$brand<"UUID">) | null | undefined;
79
78
  createdByUserType?: "system" | "user" | null | undefined;
80
79
  createdBySignature?: string | null | undefined;
81
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
82
80
  } | null | undefined;
83
81
  REGISTERED?: {
84
82
  createdAt: string;
85
83
  createdBy: string;
84
+ acceptedAt: string;
86
85
  createdByRole: string;
87
86
  registrationNumber: string;
88
- acceptedAt: string;
87
+ createdAtLocation?: (string & import("zod/v4").$brand<"UUID">) | null | undefined;
89
88
  createdByUserType?: "system" | "user" | null | undefined;
90
89
  createdBySignature?: string | null | undefined;
91
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
92
90
  } | null | undefined;
93
91
  };
92
+ createdAt: string;
93
+ createdBy: string;
94
94
  updatedByUserRole: string;
95
+ updatedAt: string;
96
+ trackingId: string;
95
97
  potentialDuplicates: {
96
- id: string & import("zod").BRAND<"UUID">;
98
+ id: string & import("zod/v4").$brand<"UUID">;
97
99
  trackingId: string;
98
100
  }[];
99
101
  flags: string[];
102
+ declaration: Record<string, import("..").FieldValue>;
103
+ dateOfEvent?: string | null | undefined;
104
+ placeOfEvent?: (string & import("zod/v4").$brand<"UUID">) | null | undefined;
100
105
  createdByUserType?: "system" | "user" | null | undefined;
106
+ createdAtLocation?: (string & import("zod/v4").$brand<"UUID">) | null | undefined;
101
107
  createdBySignature?: string | null | undefined;
102
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
108
+ updatedAtLocation?: (string & import("zod/v4").$brand<"UUID">) | null | undefined;
103
109
  assignedTo?: string | null | undefined;
104
- dateOfEvent?: string | null | undefined;
105
- updatedAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
106
110
  updatedBy?: string | null | undefined;
107
111
  };
108
112
  /**