@opencrvs/toolkit 1.8.0-rc.f7910f3 → 1.8.0-rc.f876361

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.
@@ -1,29 +1,37 @@
1
+ import { z } from 'zod';
1
2
  /**
2
3
  * Actions recognized by the system
3
4
  */
4
5
  export declare const ActionType: {
6
+ readonly DELETE: "DELETE";
5
7
  readonly CREATE: "CREATE";
6
- readonly ASSIGN: "ASSIGN";
7
- readonly UNASSIGN: "UNASSIGN";
8
- readonly REGISTER: "REGISTER";
9
- readonly VALIDATE: "VALIDATE";
10
- readonly REQUEST_CORRECTION: "REQUEST_CORRECTION";
11
- readonly REJECT_CORRECTION: "REJECT_CORRECTION";
12
- readonly APPROVE_CORRECTION: "APPROVE_CORRECTION";
13
- readonly DETECT_DUPLICATE: "DETECT_DUPLICATE";
14
8
  readonly NOTIFY: "NOTIFY";
15
9
  readonly DECLARE: "DECLARE";
16
- readonly DELETE: "DELETE";
17
- readonly PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
18
- readonly CUSTOM: "CUSTOM";
10
+ readonly VALIDATE: "VALIDATE";
11
+ readonly REGISTER: "REGISTER";
12
+ readonly DETECT_DUPLICATE: "DETECT_DUPLICATE";
19
13
  readonly REJECT: "REJECT";
20
14
  readonly MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE";
21
15
  readonly ARCHIVE: "ARCHIVE";
16
+ readonly PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
17
+ readonly REQUEST_CORRECTION: "REQUEST_CORRECTION";
18
+ readonly REJECT_CORRECTION: "REJECT_CORRECTION";
19
+ readonly APPROVE_CORRECTION: "APPROVE_CORRECTION";
20
+ readonly READ: "READ";
21
+ readonly ASSIGN: "ASSIGN";
22
+ readonly UNASSIGN: "UNASSIGN";
22
23
  };
23
- /**
24
- * Actions that can be attached to an event document
25
- * even if they are not in event configuration
26
- */
27
- export declare const LatentActions: ("REJECT" | "ARCHIVE")[];
28
24
  export type ActionType = (typeof ActionType)[keyof typeof ActionType];
25
+ export declare const ConfirmableActions: readonly ["NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "REJECT", "ARCHIVE", "PRINT_CERTIFICATE"];
26
+ /** Testing building types from enums as an alternative */
27
+ export declare const ActionTypes: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
28
+ /** Actions which change event data (declaration) before registration / during declaration. */
29
+ export declare const DeclarationActions: z.ZodEnum<["DECLARE", "VALIDATE", "REGISTER"]>;
30
+ export type DeclarationAction = z.infer<typeof DeclarationActions>;
31
+ /** Actions that can modify declaration data. Request can be corrected after declaring it. */
32
+ export declare const DeclarationUpdateActions: z.ZodEnum<["DECLARE", "VALIDATE", "REGISTER", "REQUEST_CORRECTION"]>;
33
+ export type DeclarationUpdateAction = z.infer<typeof DeclarationUpdateActions>;
34
+ /** Actions which update annotation or status of an event. */
35
+ export declare const annotationActions: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
36
+ export type MetadataAction = z.infer<typeof annotationActions>;
29
37
  //# sourceMappingURL=ActionType.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { ActionType } from './ActionType';
3
2
  export declare const Draft: z.ZodObject<{
4
3
  id: z.ZodString;
5
4
  eventId: z.ZodString;
@@ -9,7 +8,7 @@ export declare const Draft: z.ZodObject<{
9
8
  id: z.ZodString;
10
9
  createdAt: z.ZodString;
11
10
  createdBy: z.ZodString;
12
- data: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
11
+ declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
13
12
  filename: z.ZodString;
14
13
  originalFilename: z.ZodString;
15
14
  type: z.ZodString;
@@ -123,7 +122,7 @@ export declare const Draft: z.ZodObject<{
123
122
  addressLine3?: string | null | undefined;
124
123
  postcodeOrZip?: string | null | undefined;
125
124
  }>]>>;
126
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
125
+ annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
127
126
  filename: z.ZodString;
128
127
  originalFilename: z.ZodString;
129
128
  type: z.ZodString;
@@ -238,11 +237,15 @@ export declare const Draft: z.ZodObject<{
238
237
  postcodeOrZip?: string | null | undefined;
239
238
  }>]>>>;
240
239
  createdAtLocation: z.ZodString;
240
+ status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>;
241
+ originalActionId: z.ZodOptional<z.ZodString>;
241
242
  }, {
242
- type: z.ZodEnum<[ActionType, ...ActionType[]]>;
243
- }>, "id">, "strip", z.ZodTypeAny, {
244
- type: ActionType;
245
- data: Record<string, string | number | boolean | {
243
+ type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
244
+ }>, "id" | "status">, "strip", z.ZodTypeAny, {
245
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
246
+ createdAt: string;
247
+ createdBy: string;
248
+ declaration: Record<string, string | number | boolean | {
246
249
  type: string;
247
250
  filename: string;
248
251
  originalFilename: string;
@@ -280,10 +283,8 @@ export declare const Draft: z.ZodObject<{
280
283
  filename: string;
281
284
  originalFilename: string;
282
285
  }[] | undefined>;
283
- createdAt: string;
284
- createdBy: string;
285
286
  createdAtLocation: string;
286
- metadata?: Record<string, string | number | boolean | {
287
+ annotation?: Record<string, string | number | boolean | {
287
288
  type: string;
288
289
  filename: string;
289
290
  originalFilename: string;
@@ -321,9 +322,12 @@ export declare const Draft: z.ZodObject<{
321
322
  filename: string;
322
323
  originalFilename: string;
323
324
  }[] | undefined> | undefined;
325
+ originalActionId?: string | undefined;
324
326
  }, {
325
- type: ActionType;
326
- data: Record<string, string | number | boolean | {
327
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
328
+ createdAt: string;
329
+ createdBy: string;
330
+ declaration: Record<string, string | number | boolean | {
327
331
  type: string;
328
332
  filename: string;
329
333
  originalFilename: string;
@@ -361,10 +365,8 @@ export declare const Draft: z.ZodObject<{
361
365
  filename: string;
362
366
  originalFilename: string;
363
367
  }[] | undefined>;
364
- createdAt: string;
365
- createdBy: string;
366
368
  createdAtLocation: string;
367
- metadata?: Record<string, string | number | boolean | {
369
+ annotation?: Record<string, string | number | boolean | {
368
370
  type: string;
369
371
  filename: string;
370
372
  originalFilename: string;
@@ -402,6 +404,7 @@ export declare const Draft: z.ZodObject<{
402
404
  filename: string;
403
405
  originalFilename: string;
404
406
  }[] | undefined> | undefined;
407
+ originalActionId?: string | undefined;
405
408
  }>;
406
409
  }, "strip", z.ZodTypeAny, {
407
410
  id: string;
@@ -409,8 +412,10 @@ export declare const Draft: z.ZodObject<{
409
412
  eventId: string;
410
413
  transactionId: string;
411
414
  action: {
412
- type: ActionType;
413
- data: Record<string, string | number | boolean | {
415
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
416
+ createdAt: string;
417
+ createdBy: string;
418
+ declaration: Record<string, string | number | boolean | {
414
419
  type: string;
415
420
  filename: string;
416
421
  originalFilename: string;
@@ -448,10 +453,8 @@ export declare const Draft: z.ZodObject<{
448
453
  filename: string;
449
454
  originalFilename: string;
450
455
  }[] | undefined>;
451
- createdAt: string;
452
- createdBy: string;
453
456
  createdAtLocation: string;
454
- metadata?: Record<string, string | number | boolean | {
457
+ annotation?: Record<string, string | number | boolean | {
455
458
  type: string;
456
459
  filename: string;
457
460
  originalFilename: string;
@@ -489,6 +492,7 @@ export declare const Draft: z.ZodObject<{
489
492
  filename: string;
490
493
  originalFilename: string;
491
494
  }[] | undefined> | undefined;
495
+ originalActionId?: string | undefined;
492
496
  };
493
497
  }, {
494
498
  id: string;
@@ -496,8 +500,10 @@ export declare const Draft: z.ZodObject<{
496
500
  eventId: string;
497
501
  transactionId: string;
498
502
  action: {
499
- type: ActionType;
500
- data: Record<string, string | number | boolean | {
503
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
504
+ createdAt: string;
505
+ createdBy: string;
506
+ declaration: Record<string, string | number | boolean | {
501
507
  type: string;
502
508
  filename: string;
503
509
  originalFilename: string;
@@ -535,10 +541,8 @@ export declare const Draft: z.ZodObject<{
535
541
  filename: string;
536
542
  originalFilename: string;
537
543
  }[] | undefined>;
538
- createdAt: string;
539
- createdBy: string;
540
544
  createdAtLocation: string;
541
- metadata?: Record<string, string | number | boolean | {
545
+ annotation?: Record<string, string | number | boolean | {
542
546
  type: string;
543
547
  filename: string;
544
548
  originalFilename: string;
@@ -576,12 +580,13 @@ export declare const Draft: z.ZodObject<{
576
580
  filename: string;
577
581
  originalFilename: string;
578
582
  }[] | undefined> | undefined;
583
+ originalActionId?: string | undefined;
579
584
  };
580
585
  }>;
581
586
  export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
582
587
  eventId: z.ZodString;
583
588
  transactionId: z.ZodString;
584
- data: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
589
+ declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
585
590
  filename: z.ZodString;
586
591
  originalFilename: z.ZodString;
587
592
  type: z.ZodString;
@@ -695,7 +700,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
695
700
  addressLine3?: string | null | undefined;
696
701
  postcodeOrZip?: string | null | undefined;
697
702
  }>]>>;
698
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
703
+ annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
699
704
  filename: z.ZodString;
700
705
  originalFilename: z.ZodString;
701
706
  type: z.ZodString;
@@ -809,11 +814,12 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
809
814
  addressLine3?: string | null | undefined;
810
815
  postcodeOrZip?: string | null | undefined;
811
816
  }>]>>>;
817
+ originalActionId: z.ZodOptional<z.ZodString>;
812
818
  }, {
813
- type: z.ZodEnum<[ActionType, ...ActionType[]]>;
819
+ type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
814
820
  }>, "strip", z.ZodTypeAny, {
815
- type: ActionType;
816
- data: Record<string, string | number | boolean | {
821
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
822
+ declaration: Record<string, string | number | boolean | {
817
823
  type: string;
818
824
  filename: string;
819
825
  originalFilename: string;
@@ -853,7 +859,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
853
859
  }[] | undefined>;
854
860
  eventId: string;
855
861
  transactionId: string;
856
- metadata?: Record<string, string | number | boolean | {
862
+ annotation?: Record<string, string | number | boolean | {
857
863
  type: string;
858
864
  filename: string;
859
865
  originalFilename: string;
@@ -891,9 +897,10 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
891
897
  filename: string;
892
898
  originalFilename: string;
893
899
  }[] | undefined> | undefined;
900
+ originalActionId?: string | undefined;
894
901
  }, {
895
- type: ActionType;
896
- data: Record<string, string | number | boolean | {
902
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
903
+ declaration: Record<string, string | number | boolean | {
897
904
  type: string;
898
905
  filename: string;
899
906
  originalFilename: string;
@@ -933,7 +940,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
933
940
  }[] | undefined>;
934
941
  eventId: string;
935
942
  transactionId: string;
936
- metadata?: Record<string, string | number | boolean | {
943
+ annotation?: Record<string, string | number | boolean | {
937
944
  type: string;
938
945
  filename: string;
939
946
  originalFilename: string;
@@ -971,6 +978,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
971
978
  filename: string;
972
979
  originalFilename: string;
973
980
  }[] | undefined> | undefined;
981
+ originalActionId?: string | undefined;
974
982
  }>;
975
983
  export type Draft = z.infer<typeof Draft>;
976
984
  export type DraftInput = z.infer<typeof DraftInput>;