@opencrvs/toolkit 1.8.0-rc.faacbde → 1.8.0-rc.fb0e687

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.
@@ -22,15 +22,16 @@ export declare const ActionType: {
22
22
  readonly UNASSIGN: "UNASSIGN";
23
23
  };
24
24
  export type ActionType = (typeof ActionType)[keyof typeof ActionType];
25
+ export declare const ConfirmableActions: readonly ["NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "REJECT", "ARCHIVE", "PRINT_CERTIFICATE"];
25
26
  /** Testing building types from enums as an alternative */
26
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"]>;
27
28
  /** Actions which change event data (declaration) before registration / during declaration. */
28
29
  export declare const DeclarationActions: z.ZodEnum<["DECLARE", "VALIDATE", "REGISTER"]>;
29
- export type DeclarationAction = z.infer<typeof DeclarationActions>;
30
+ export type DeclarationActionType = z.infer<typeof DeclarationActions>;
30
31
  /** Actions that can modify declaration data. Request can be corrected after declaring it. */
31
32
  export declare const DeclarationUpdateActions: z.ZodEnum<["DECLARE", "VALIDATE", "REGISTER", "REQUEST_CORRECTION"]>;
32
- export type DeclarationUpdateAction = z.infer<typeof DeclarationUpdateActions>;
33
+ export type DeclarationUpdateActionType = z.infer<typeof DeclarationUpdateActions>;
33
34
  /** Actions which update annotation or status of an event. */
34
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"]>;
35
- export type MetadataAction = z.infer<typeof annotationActions>;
36
+ export type AnnotationActionType = z.infer<typeof annotationActions>;
36
37
  //# sourceMappingURL=ActionType.d.ts.map
@@ -1,15 +1,15 @@
1
1
  import { JSONSchema } from '../conditionals/conditionals';
2
2
  import { z } from 'zod';
3
- export declare function Conditional(): z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
3
+ export declare const Conditional: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
4
4
  /**
5
5
  * By default, when conditionals are undefined, action is visible and enabled to everyone.
6
6
  */
7
7
  export declare const ConditionalType: {
8
- /** When 'SHOW' conditional is defined, the action is shown to the user only if the condition is met */
9
8
  readonly SHOW: "SHOW";
10
- /** If 'ENABLE' conditional is defined, the action is enabled only if the condition is met */
11
9
  readonly ENABLE: "ENABLE";
10
+ readonly DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW";
12
11
  };
12
+ export type ConditionalType = (typeof ConditionalType)[keyof typeof ConditionalType];
13
13
  export declare const ShowConditional: z.ZodObject<{
14
14
  type: z.ZodLiteral<"SHOW">;
15
15
  conditional: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
@@ -31,9 +31,25 @@ export declare const EnableConditional: z.ZodObject<{
31
31
  conditional: JSONSchema;
32
32
  }>;
33
33
  /** @knipignore */
34
- export type AllActionConditionalFields = typeof ShowConditional | typeof EnableConditional;
34
+ export type ActionConditionalType = typeof ShowConditional | typeof EnableConditional;
35
35
  /** @knipignore */
36
36
  export type InferredActionConditional = z.infer<typeof ShowConditional> | z.infer<typeof EnableConditional>;
37
- export declare const ActionConditional: z.ZodDiscriminatedUnion<"type", AllActionConditionalFields[]>;
37
+ export declare const ActionConditional: z.ZodDiscriminatedUnion<"type", ActionConditionalType[]>;
38
38
  export type ActionConditional = InferredActionConditional;
39
+ export declare const DisplayOnReviewConditional: z.ZodObject<{
40
+ type: z.ZodLiteral<"DISPLAY_ON_REVIEW">;
41
+ conditional: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ type: "DISPLAY_ON_REVIEW";
44
+ conditional: JSONSchema;
45
+ }, {
46
+ type: "DISPLAY_ON_REVIEW";
47
+ conditional: JSONSchema;
48
+ }>;
49
+ /** @knipignore */
50
+ export type FieldConditionalType = typeof ShowConditional | typeof EnableConditional | typeof DisplayOnReviewConditional;
51
+ /** @knipignore */
52
+ export type InferredFieldConditional = z.infer<typeof ShowConditional> | z.infer<typeof EnableConditional> | z.infer<typeof DisplayOnReviewConditional>;
53
+ export declare const FieldConditional: z.ZodDiscriminatedUnion<"type", FieldConditionalType[]>;
54
+ export type FieldConditional = z.infer<typeof FieldConditional>;
39
55
  //# sourceMappingURL=Conditional.d.ts.map
@@ -237,10 +237,13 @@ export declare const Draft: z.ZodObject<{
237
237
  postcodeOrZip?: string | null | undefined;
238
238
  }>]>>>;
239
239
  createdAtLocation: z.ZodString;
240
+ status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>;
241
+ originalActionId: z.ZodOptional<z.ZodString>;
240
242
  }, {
241
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"]>;
242
244
  }>, "id">, "strip", z.ZodTypeAny, {
243
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
+ status: "Rejected" | "Requested" | "Accepted";
244
247
  createdAt: string;
245
248
  createdBy: string;
246
249
  declaration: Record<string, string | number | boolean | {
@@ -320,8 +323,10 @@ export declare const Draft: z.ZodObject<{
320
323
  filename: string;
321
324
  originalFilename: string;
322
325
  }[] | undefined> | undefined;
326
+ originalActionId?: string | undefined;
323
327
  }, {
324
328
  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";
329
+ status: "Rejected" | "Requested" | "Accepted";
325
330
  createdAt: string;
326
331
  createdBy: string;
327
332
  declaration: Record<string, string | number | boolean | {
@@ -401,6 +406,7 @@ export declare const Draft: z.ZodObject<{
401
406
  filename: string;
402
407
  originalFilename: string;
403
408
  }[] | undefined> | undefined;
409
+ originalActionId?: string | undefined;
404
410
  }>;
405
411
  }, "strip", z.ZodTypeAny, {
406
412
  id: string;
@@ -409,6 +415,7 @@ export declare const Draft: z.ZodObject<{
409
415
  transactionId: string;
410
416
  action: {
411
417
  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";
418
+ status: "Rejected" | "Requested" | "Accepted";
412
419
  createdAt: string;
413
420
  createdBy: string;
414
421
  declaration: Record<string, string | number | boolean | {
@@ -488,6 +495,7 @@ export declare const Draft: z.ZodObject<{
488
495
  filename: string;
489
496
  originalFilename: string;
490
497
  }[] | undefined> | undefined;
498
+ originalActionId?: string | undefined;
491
499
  };
492
500
  }, {
493
501
  id: string;
@@ -496,6 +504,7 @@ export declare const Draft: z.ZodObject<{
496
504
  transactionId: string;
497
505
  action: {
498
506
  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";
507
+ status: "Rejected" | "Requested" | "Accepted";
499
508
  createdAt: string;
500
509
  createdBy: string;
501
510
  declaration: Record<string, string | number | boolean | {
@@ -575,12 +584,13 @@ export declare const Draft: z.ZodObject<{
575
584
  filename: string;
576
585
  originalFilename: string;
577
586
  }[] | undefined> | undefined;
587
+ originalActionId?: string | undefined;
578
588
  };
579
589
  }>;
580
590
  export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
581
591
  eventId: z.ZodString;
582
592
  transactionId: z.ZodString;
583
- declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
593
+ declaration: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
584
594
  filename: z.ZodString;
585
595
  originalFilename: z.ZodString;
586
596
  type: z.ZodString;
@@ -693,7 +703,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
693
703
  addressLine2?: string | null | undefined;
694
704
  addressLine3?: string | null | undefined;
695
705
  postcodeOrZip?: string | null | undefined;
696
- }>]>>;
706
+ }>]>>>;
697
707
  annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
698
708
  filename: z.ZodString;
699
709
  originalFilename: z.ZodString;
@@ -808,6 +818,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
808
818
  addressLine3?: string | null | undefined;
809
819
  postcodeOrZip?: string | null | undefined;
810
820
  }>]>>>;
821
+ originalActionId: z.ZodOptional<z.ZodString>;
811
822
  }, {
812
823
  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"]>;
813
824
  }>, "strip", z.ZodTypeAny, {
@@ -890,9 +901,12 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
890
901
  filename: string;
891
902
  originalFilename: string;
892
903
  }[] | undefined> | undefined;
904
+ originalActionId?: string | undefined;
893
905
  }, {
894
906
  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";
895
- declaration: Record<string, string | number | boolean | {
907
+ eventId: string;
908
+ transactionId: string;
909
+ declaration?: Record<string, string | number | boolean | {
896
910
  type: string;
897
911
  filename: string;
898
912
  originalFilename: string;
@@ -929,9 +943,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
929
943
  option: string;
930
944
  filename: string;
931
945
  originalFilename: string;
932
- }[] | undefined>;
933
- eventId: string;
934
- transactionId: string;
946
+ }[] | undefined> | undefined;
935
947
  annotation?: Record<string, string | number | boolean | {
936
948
  type: string;
937
949
  filename: string;
@@ -970,6 +982,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
970
982
  filename: string;
971
983
  originalFilename: string;
972
984
  }[] | undefined> | undefined;
985
+ originalActionId?: string | undefined;
973
986
  }>;
974
987
  export type Draft = z.infer<typeof Draft>;
975
988
  export type DraftInput = z.infer<typeof DraftInput>;