@opencrvs/toolkit 1.9.4-rc.0e695b2 → 1.9.4-rc.469f912

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 (58) hide show
  1. package/dist/commons/api/router.d.ts +2440 -28495
  2. package/dist/commons/conditionals/conditionals.d.ts +1 -10
  3. package/dist/commons/conditionals/validate.d.ts +4 -11
  4. package/dist/commons/events/ActionConfig.d.ts +1552 -23416
  5. package/dist/commons/events/ActionDocument.d.ts +1856 -803
  6. package/dist/commons/events/ActionInput.d.ts +1073 -277
  7. package/dist/commons/events/ActionType.d.ts +9 -86
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +1238 -228
  9. package/dist/commons/events/CompositeFieldValue.d.ts +176 -27
  10. package/dist/commons/events/Conditional.d.ts +38 -26
  11. package/dist/commons/events/Constants.d.ts +1 -1
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +4169 -931
  13. package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
  14. package/dist/commons/events/DeduplicationConfig.d.ts +150 -15
  15. package/dist/commons/events/Draft.d.ts +105 -70
  16. package/dist/commons/events/DynamicFieldValue.d.ts +91 -7
  17. package/dist/commons/events/EventConfig.d.ts +2120 -18663
  18. package/dist/commons/events/EventConfigInput.d.ts +1 -1
  19. package/dist/commons/events/EventDocument.d.ts +1332 -320
  20. package/dist/commons/events/EventIndex.d.ts +967 -197
  21. package/dist/commons/events/EventInput.d.ts +8 -2
  22. package/dist/commons/events/EventMetadata.d.ts +346 -106
  23. package/dist/commons/events/FieldConfig.d.ts +11774 -4259
  24. package/dist/commons/events/FieldType.d.ts +4 -20
  25. package/dist/commons/events/FieldTypeMapping.d.ts +813 -181
  26. package/dist/commons/events/FieldValue.d.ts +356 -83
  27. package/dist/commons/events/FormConfig.d.ts +721 -13140
  28. package/dist/commons/events/PageConfig.d.ts +319 -8780
  29. package/dist/commons/events/SummaryConfig.d.ts +161 -14
  30. package/dist/commons/events/TemplateConfig.d.ts +3 -3
  31. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  32. package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
  33. package/dist/commons/events/WorkqueueConfig.d.ts +7080 -1615
  34. package/dist/commons/events/deduplication.d.ts +3 -3
  35. package/dist/commons/events/defineConfig.d.ts +163 -25639
  36. package/dist/commons/events/event.d.ts +4 -4
  37. package/dist/commons/events/index.d.ts +0 -1
  38. package/dist/commons/events/locations.d.ts +19 -15
  39. package/dist/commons/events/scopes.d.ts +4 -5
  40. package/dist/commons/events/state/availableActions.d.ts +1 -2
  41. package/dist/commons/events/state/flags.d.ts +3 -21
  42. package/dist/commons/events/state/index.d.ts +19 -23
  43. package/dist/commons/events/state/utils.d.ts +112 -130
  44. package/dist/commons/events/test.utils.d.ts +8 -17
  45. package/dist/commons/events/transactions.d.ts +1 -1
  46. package/dist/commons/events/utils.d.ts +373 -51350
  47. package/dist/commons/notification/UserNotifications.d.ts +636 -55
  48. package/dist/conditionals/index.d.ts.map +1 -1
  49. package/dist/conditionals/index.js +5 -38
  50. package/dist/events/deduplication.d.ts +3 -3
  51. package/dist/events/index.js +1545 -1805
  52. package/dist/notification/index.d.ts.map +1 -1
  53. package/dist/notification/index.js +1412 -1430
  54. package/dist/scopes/index.d.ts +132 -167
  55. package/dist/scopes/index.d.ts.map +1 -1
  56. package/dist/scopes/index.js +94 -133
  57. package/package.json +5 -5
  58. package/dist/commons/events/Flag.d.ts +0 -70
@@ -1,23 +1,170 @@
1
- import * as z from 'zod/v4';
1
+ import { z } from 'zod';
2
+ import { TranslationConfig } from './TranslationConfig';
2
3
  export declare const SummaryConfig: z.ZodObject<{
3
- fields: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
4
- emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
4
+ fields: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
5
+ emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
6
+ id: string;
7
+ description: string;
8
+ defaultMessage: string;
9
+ }>>;
5
10
  conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
6
11
  type: z.ZodLiteral<"SHOW">;
7
- conditional: z.ZodAny;
8
- }, z.core.$strip>>>>;
12
+ conditional: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ type: "SHOW";
15
+ conditional: import(".").JSONSchema;
16
+ }, {
17
+ type: "SHOW";
18
+ conditional: import(".").JSONSchema;
19
+ }>, "many">>>;
20
+ }, {
9
21
  id: z.ZodString;
10
- value: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
11
- label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
12
- }, z.core.$strip>, z.ZodObject<{
13
- emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
22
+ value: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
23
+ id: string;
24
+ description: string;
25
+ defaultMessage: string;
26
+ }>;
27
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
28
+ id: string;
29
+ description: string;
30
+ defaultMessage: string;
31
+ }>;
32
+ }>, "strip", z.ZodTypeAny, {
33
+ id: string;
34
+ value: TranslationConfig;
35
+ label: TranslationConfig;
36
+ conditionals?: {
37
+ type: "SHOW";
38
+ conditional: import(".").JSONSchema;
39
+ }[] | undefined;
40
+ emptyValueMessage?: TranslationConfig | undefined;
41
+ }, {
42
+ id: string;
43
+ value: {
44
+ id: string;
45
+ description: string;
46
+ defaultMessage: string;
47
+ };
48
+ label: {
49
+ id: string;
50
+ description: string;
51
+ defaultMessage: string;
52
+ };
53
+ conditionals?: {
54
+ type: "SHOW";
55
+ conditional: import(".").JSONSchema;
56
+ }[] | undefined;
57
+ emptyValueMessage?: {
58
+ id: string;
59
+ description: string;
60
+ defaultMessage: string;
61
+ } | undefined;
62
+ }>, z.ZodObject<z.objectUtil.extendShape<{
63
+ emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
64
+ id: string;
65
+ description: string;
66
+ defaultMessage: string;
67
+ }>>;
14
68
  conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
15
69
  type: z.ZodLiteral<"SHOW">;
16
- conditional: z.ZodAny;
17
- }, z.core.$strip>>>>;
70
+ conditional: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ type: "SHOW";
73
+ conditional: import(".").JSONSchema;
74
+ }, {
75
+ type: "SHOW";
76
+ conditional: import(".").JSONSchema;
77
+ }>, "many">>>;
78
+ }, {
18
79
  fieldId: z.ZodString;
19
- label: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
20
- }, z.core.$strip>]>>;
21
- }, z.core.$strip>;
80
+ label: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
81
+ id: string;
82
+ description: string;
83
+ defaultMessage: string;
84
+ }>>;
85
+ }>, "strip", z.ZodTypeAny, {
86
+ fieldId: string;
87
+ label?: TranslationConfig | undefined;
88
+ conditionals?: {
89
+ type: "SHOW";
90
+ conditional: import(".").JSONSchema;
91
+ }[] | undefined;
92
+ emptyValueMessage?: TranslationConfig | undefined;
93
+ }, {
94
+ fieldId: string;
95
+ label?: {
96
+ id: string;
97
+ description: string;
98
+ defaultMessage: string;
99
+ } | undefined;
100
+ conditionals?: {
101
+ type: "SHOW";
102
+ conditional: import(".").JSONSchema;
103
+ }[] | undefined;
104
+ emptyValueMessage?: {
105
+ id: string;
106
+ description: string;
107
+ defaultMessage: string;
108
+ } | undefined;
109
+ }>]>, "many">;
110
+ }, "strip", z.ZodTypeAny, {
111
+ fields: ({
112
+ fieldId: string;
113
+ label?: TranslationConfig | undefined;
114
+ conditionals?: {
115
+ type: "SHOW";
116
+ conditional: import(".").JSONSchema;
117
+ }[] | undefined;
118
+ emptyValueMessage?: TranslationConfig | undefined;
119
+ } | {
120
+ id: string;
121
+ value: TranslationConfig;
122
+ label: TranslationConfig;
123
+ conditionals?: {
124
+ type: "SHOW";
125
+ conditional: import(".").JSONSchema;
126
+ }[] | undefined;
127
+ emptyValueMessage?: TranslationConfig | undefined;
128
+ })[];
129
+ }, {
130
+ fields: ({
131
+ fieldId: string;
132
+ label?: {
133
+ id: string;
134
+ description: string;
135
+ defaultMessage: string;
136
+ } | undefined;
137
+ conditionals?: {
138
+ type: "SHOW";
139
+ conditional: import(".").JSONSchema;
140
+ }[] | undefined;
141
+ emptyValueMessage?: {
142
+ id: string;
143
+ description: string;
144
+ defaultMessage: string;
145
+ } | undefined;
146
+ } | {
147
+ id: string;
148
+ value: {
149
+ id: string;
150
+ description: string;
151
+ defaultMessage: string;
152
+ };
153
+ label: {
154
+ id: string;
155
+ description: string;
156
+ defaultMessage: string;
157
+ };
158
+ conditionals?: {
159
+ type: "SHOW";
160
+ conditional: import(".").JSONSchema;
161
+ }[] | undefined;
162
+ emptyValueMessage?: {
163
+ id: string;
164
+ description: string;
165
+ defaultMessage: string;
166
+ } | undefined;
167
+ })[];
168
+ }>;
22
169
  export type SummaryConfig = z.infer<typeof SummaryConfig>;
23
170
  //# sourceMappingURL=SummaryConfig.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TemplateConfig defines configuration rules for system-based variables (e.g. $user.role).
2
+ * TemplateConfig defines configuration rules for system-based variables (e.g. $user.province).
3
3
  * They are currently used for providing default values in FieldConfig.
4
4
  */
5
5
  import { FieldValue } from './FieldValue';
@@ -8,8 +8,8 @@ import { FieldValue } from './FieldValue';
8
8
  */
9
9
  export type SystemVariables = {
10
10
  $user: {
11
- name: string;
12
- role: string;
11
+ province: string;
12
+ district: string;
13
13
  };
14
14
  $window: {
15
15
  location: {
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import { z } from 'zod';
2
2
  export type TranslationConfig = {
3
3
  id: string;
4
4
  defaultMessage: string;
@@ -9,7 +9,7 @@ export type MessageDescriptorZod = {
9
9
  defaultMessage: z.ZodString;
10
10
  description: z.ZodString;
11
11
  };
12
- type ExplicitTypeToReduceDeclarationSize = z.ZodObject<MessageDescriptorZod>;
12
+ type ExplicitTypeToReduceDeclarationSize = z.ZodObject<MessageDescriptorZod, 'strip', z.ZodTypeAny, TranslationConfig>;
13
13
  export declare const TranslationConfig: ExplicitTypeToReduceDeclarationSize;
14
14
  export {};
15
15
  //# sourceMappingURL=TranslationConfig.d.ts.map
@@ -1,90 +1,53 @@
1
- import * as z from 'zod/v4';
2
- export declare const WorkqueueColumnKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "placeOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"];
3
- export declare const WorkqueueColumnKeys: z.ZodEnum<{
4
- type: "type";
5
- id: "id";
6
- status: "status";
7
- title: "title";
8
- createdByUserType: "createdByUserType";
9
- createdAt: "createdAt";
10
- createdBy: "createdBy";
11
- createdAtLocation: "createdAtLocation";
12
- assignedTo: "assignedTo";
13
- trackingId: "trackingId";
14
- placeOfEvent: "placeOfEvent";
15
- legalStatuses: "legalStatuses";
16
- dateOfEvent: "dateOfEvent";
17
- updatedByUserRole: "updatedByUserRole";
18
- updatedAtLocation: "updatedAtLocation";
19
- updatedAt: "updatedAt";
20
- updatedBy: "updatedBy";
21
- flags: "flags";
22
- outbox: "outbox";
23
- }>;
1
+ import { z } from 'zod';
2
+ import { TranslationConfig } from './TranslationConfig';
3
+ export declare const WorkqueueColumnKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"];
4
+ export declare const WorkqueueColumnKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"]>;
24
5
  export type WorkqueueColumnKeys = z.infer<typeof WorkqueueColumnKeys>;
25
6
  export declare const WorkqueueColumnValue: z.ZodObject<{
26
- $event: z.ZodEnum<{
27
- type: "type";
28
- id: "id";
29
- status: "status";
30
- title: "title";
31
- createdByUserType: "createdByUserType";
32
- createdAt: "createdAt";
33
- createdBy: "createdBy";
34
- createdAtLocation: "createdAtLocation";
35
- assignedTo: "assignedTo";
36
- trackingId: "trackingId";
37
- placeOfEvent: "placeOfEvent";
38
- legalStatuses: "legalStatuses";
39
- dateOfEvent: "dateOfEvent";
40
- updatedByUserRole: "updatedByUserRole";
41
- updatedAtLocation: "updatedAtLocation";
42
- updatedAt: "updatedAt";
43
- updatedBy: "updatedBy";
44
- flags: "flags";
45
- outbox: "outbox";
46
- }>;
47
- }, z.core.$strip>;
7
+ $event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"]>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
10
+ }, {
11
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
12
+ }>;
48
13
  export type WorkqueueColumnValue = z.infer<typeof WorkqueueColumnValue>;
49
14
  /**
50
15
  * Configuration for column header and value of cell of workqueue.
51
16
  */
52
17
  export declare const WorkqueueColumn: z.ZodObject<{
53
- label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
18
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
19
+ id: string;
20
+ description: string;
21
+ defaultMessage: string;
22
+ }>;
54
23
  value: z.ZodObject<{
55
- $event: z.ZodEnum<{
56
- type: "type";
57
- id: "id";
58
- status: "status";
59
- title: "title";
60
- createdByUserType: "createdByUserType";
61
- createdAt: "createdAt";
62
- createdBy: "createdBy";
63
- createdAtLocation: "createdAtLocation";
64
- assignedTo: "assignedTo";
65
- trackingId: "trackingId";
66
- placeOfEvent: "placeOfEvent";
67
- legalStatuses: "legalStatuses";
68
- dateOfEvent: "dateOfEvent";
69
- updatedByUserRole: "updatedByUserRole";
70
- updatedAtLocation: "updatedAtLocation";
71
- updatedAt: "updatedAt";
72
- updatedBy: "updatedBy";
73
- flags: "flags";
74
- outbox: "outbox";
75
- }>;
76
- }, z.core.$strip>;
77
- }, z.core.$strip>;
78
- export type WorkqueueColumn = z.infer<typeof WorkqueueColumn>;
79
- export type WorkqueueColumnInput = z.infer<typeof WorkqueueColumn>;
80
- export declare function defineWorkqueuesColumns(workqueueColumns: WorkqueueColumnInput[]): {
24
+ $event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"]>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
27
+ }, {
28
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
29
+ }>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ value: {
32
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
33
+ };
34
+ label: TranslationConfig;
35
+ }, {
36
+ value: {
37
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
38
+ };
81
39
  label: {
82
40
  id: string;
83
- defaultMessage: string;
84
41
  description: string;
42
+ defaultMessage: string;
85
43
  };
44
+ }>;
45
+ export type WorkqueueColumn = z.infer<typeof WorkqueueColumn>;
46
+ export type WorkqueueColumnInput = z.infer<typeof WorkqueueColumn>;
47
+ export declare function defineWorkqueuesColumns(workqueueColumns: WorkqueueColumnInput[]): {
86
48
  value: {
87
- $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "placeOfEvent" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
49
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "updatedAt" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
88
50
  };
51
+ label: TranslationConfig;
89
52
  }[];
90
53
  //# sourceMappingURL=WorkqueueColumnConfig.d.ts.map