@opencrvs/toolkit 2.0.0-rc.ca280e0 → 2.0.0-rc.ca3fe84

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 (121) hide show
  1. package/README.md +15 -0
  2. package/build.sh +3 -2
  3. package/dist/application-config/index.js +70 -40
  4. package/dist/cli.js +3262 -50
  5. package/dist/commons/api/router.d.ts +3012 -2927
  6. package/dist/commons/application-config/index.d.ts +7 -6
  7. package/dist/commons/conditionals/conditionals.d.ts +287 -234
  8. package/dist/commons/conditionals/validate.d.ts +51 -2
  9. package/dist/commons/events/ActionConfig.d.ts +93 -67
  10. package/dist/commons/events/ActionDocument.d.ts +113 -107
  11. package/dist/commons/events/ActionInput.d.ts +6 -0
  12. package/dist/commons/events/ActionType.d.ts +57 -57
  13. package/dist/commons/events/AdvancedSearchConfig.d.ts +651 -297
  14. package/dist/commons/events/AuditLog.d.ts +41 -41
  15. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  16. package/dist/commons/events/Conditional.d.ts +3 -3
  17. package/dist/commons/events/CountryConfigQueryInput.d.ts +603 -561
  18. package/dist/commons/events/Draft.d.ts +35 -35
  19. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  20. package/dist/commons/events/EventConfig.d.ts +5 -3
  21. package/dist/commons/events/EventDocument.d.ts +46 -43
  22. package/dist/commons/events/EventIndex.d.ts +76 -51
  23. package/dist/commons/events/EventMetadata.d.ts +60 -34
  24. package/dist/commons/events/FieldConfig.d.ts +710 -372
  25. package/dist/commons/events/FieldType.d.ts +51 -50
  26. package/dist/commons/events/FieldTypeMapping.d.ts +101 -101
  27. package/dist/commons/events/FieldValue.d.ts +18 -12
  28. package/dist/commons/events/Flag.d.ts +15 -15
  29. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  30. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  31. package/dist/commons/events/WorkqueueConfig.d.ts +837 -798
  32. package/dist/commons/events/deduplication.d.ts +1 -1
  33. package/dist/commons/events/event.d.ts +2 -2
  34. package/dist/commons/events/field.d.ts +112 -189
  35. package/dist/commons/events/index.d.ts +1 -0
  36. package/dist/commons/events/locations.d.ts +5 -4
  37. package/dist/commons/events/mocks.test.utils.d.ts +2 -2
  38. package/dist/commons/events/scopes.d.ts +4 -4
  39. package/dist/commons/events/state/flags.d.ts +16 -0
  40. package/dist/commons/events/state/index.d.ts +23 -15
  41. package/dist/commons/events/state/utils.d.ts +25 -291
  42. package/dist/commons/events/test.utils.d.ts +33 -33
  43. package/dist/commons/events/utils.d.ts +120 -109
  44. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  45. package/dist/conditionals/index.js +58 -6
  46. package/dist/environment/custom-types.d.ts +33 -0
  47. package/dist/environment/custom-types.d.ts.map +1 -0
  48. package/dist/environment/custom-types.js +12 -0
  49. package/dist/environment/derived-variables.d.ts +134 -0
  50. package/dist/environment/derived-variables.d.ts.map +1 -0
  51. package/dist/environment/derived-variables.js +169 -0
  52. package/dist/environment/editor-questions.d.ts +4 -0
  53. package/dist/environment/editor-questions.d.ts.map +1 -0
  54. package/dist/environment/editor-questions.js +67 -0
  55. package/dist/environment/git.d.ts +5 -0
  56. package/dist/environment/git.d.ts.map +1 -0
  57. package/dist/environment/git.js +38 -0
  58. package/dist/environment/github.d.ts +26 -0
  59. package/dist/environment/github.d.ts.map +1 -0
  60. package/dist/environment/github.js +247 -0
  61. package/dist/environment/index.d.ts +5 -0
  62. package/dist/environment/index.d.ts.map +1 -0
  63. package/dist/environment/index.js +71 -0
  64. package/dist/environment/logger.d.ts +6 -0
  65. package/dist/environment/logger.d.ts.map +1 -0
  66. package/dist/environment/logger.js +25 -0
  67. package/dist/environment/manage-users.d.ts +11 -0
  68. package/dist/environment/manage-users.d.ts.map +1 -0
  69. package/dist/environment/manage-users.js +507 -0
  70. package/dist/environment/questions-helper.d.ts +15 -0
  71. package/dist/environment/questions-helper.d.ts.map +1 -0
  72. package/dist/environment/questions-helper.js +70 -0
  73. package/dist/environment/questions.d.ts +200 -0
  74. package/dist/environment/questions.d.ts.map +1 -0
  75. package/dist/environment/questions.js +412 -0
  76. package/dist/environment/setup-environment.d.ts +2 -0
  77. package/dist/environment/setup-environment.d.ts.map +1 -0
  78. package/dist/environment/setup-environment.js +788 -0
  79. package/dist/environment/ssh-keygen.d.ts +5 -0
  80. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  81. package/dist/environment/ssh-keygen.js +21 -0
  82. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  83. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  84. package/dist/environment/swarm-to-k8s.js +183 -0
  85. package/dist/environment/templates.d.ts +27 -0
  86. package/dist/environment/templates.d.ts.map +1 -0
  87. package/dist/environment/templates.js +163 -0
  88. package/dist/environment/update-workflows.d.ts +2 -0
  89. package/dist/environment/update-workflows.d.ts.map +1 -0
  90. package/dist/environment/update-workflows.js +179 -0
  91. package/dist/environment/users.d.ts +2 -0
  92. package/dist/environment/users.d.ts.map +1 -0
  93. package/dist/environment/users.js +122 -0
  94. package/dist/environment/utils.d.ts +18 -0
  95. package/dist/environment/utils.d.ts.map +1 -0
  96. package/dist/environment/utils.js +110 -0
  97. package/dist/events/deduplication.d.ts +1 -1
  98. package/dist/events/index.js +446 -147
  99. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  100. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  101. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  102. package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
  103. package/dist/migrations/v2.0/index.js +20 -9
  104. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  105. package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
  106. package/dist/notification/index.js +265 -45
  107. package/dist/scopes/index.d.ts +209 -123
  108. package/dist/scopes/index.js +19 -8
  109. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  110. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  111. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  112. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  113. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  114. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  115. package/dist/templates/inventory/inventory.template.yml +100 -0
  116. package/dist/templates/inventory/production.example.yml +77 -0
  117. package/dist/templates/inventory/qa.example.yml +48 -0
  118. package/opencrvs-toolkit-2.0.0-rc.ca3fe84.tgz +0 -0
  119. package/package.json +16 -3
  120. package/tsconfig.tsbuildinfo +1 -1
  121. package/opencrvs-toolkit-2.0.0-rc.ca280e0.tgz +0 -0
@@ -1,314 +1,48 @@
1
1
  import { Action } from '../ActionDocument';
2
2
  /**
3
- * Given action type and actions, returns the action creation metadata for the event.
4
- * Since we do not consistently store the request action, we need to check if it exists.
5
- * @returns details of last user who triggered **Declaration** action.
6
- * @see EventIndex for the description of the returned object.
3
+ * Returns the creation metadata of the last update action (Requested or Accepted).
4
+ * Requested actions are included so that async flows (202) correctly reflect the
5
+ * metadata of the user who triggered the action before country config accepts it.
7
6
  *
8
- * */
9
- export declare function getActionUpdateMetadata(actions: Action[]): Partial<{
10
- id: string & import("zod").$brand<"UUID">;
11
- transactionId: string;
12
- createdByUserType: "user" | "system";
13
- createdAt: string;
14
- createdBy: string;
15
- declaration: Record<string, import("..").FieldUpdateValue>;
16
- status: "Requested" | "Accepted" | "Rejected";
17
- type: "REGISTER";
18
- createdByRole?: string | undefined;
19
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
20
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
21
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
22
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
23
- registrationNumber?: string | undefined;
24
- } | {
25
- id: string & import("zod").$brand<"UUID">;
26
- transactionId: string;
27
- createdByUserType: "user" | "system";
28
- createdAt: string;
29
- createdBy: string;
30
- declaration: Record<string, import("..").FieldUpdateValue>;
31
- status: "Requested" | "Accepted" | "Rejected";
32
- type: "DUPLICATE_DETECTED";
33
- content: {
34
- duplicates: {
35
- id: string & import("zod").$brand<"UUID">;
36
- trackingId: string;
37
- }[];
38
- };
39
- createdByRole?: string | undefined;
40
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
41
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
42
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
43
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
44
- } | {
45
- id: string & import("zod").$brand<"UUID">;
46
- transactionId: string;
47
- createdByUserType: "user" | "system";
48
- createdAt: string;
49
- createdBy: string;
50
- declaration: Record<string, import("..").FieldUpdateValue>;
51
- status: "Requested" | "Accepted" | "Rejected";
52
- type: "EDIT";
53
- content: {
54
- comment?: string | undefined;
55
- };
56
- createdByRole?: string | undefined;
57
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
58
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
59
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
60
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
61
- } | {
62
- id: string & import("zod").$brand<"UUID">;
63
- transactionId: string;
64
- createdByUserType: "user" | "system";
65
- createdAt: string;
66
- createdBy: string;
67
- declaration: Record<string, import("..").FieldUpdateValue>;
68
- status: "Requested" | "Accepted" | "Rejected";
69
- type: "PRINT_CERTIFICATE";
70
- createdByRole?: string | undefined;
71
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
72
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
73
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
74
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
75
- content?: {
76
- templateId?: string | undefined;
77
- } | null | undefined;
78
- } | {
79
- id: string & import("zod").$brand<"UUID">;
80
- transactionId: string;
81
- createdByUserType: "user" | "system";
82
- createdAt: string;
83
- createdBy: string;
84
- declaration: Record<string, import("..").FieldUpdateValue>;
85
- status: "Requested" | "Accepted" | "Rejected";
86
- type: "REQUEST_CORRECTION";
87
- createdByRole?: string | undefined;
88
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
89
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
90
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
91
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
92
- } | {
93
- id: string & import("zod").$brand<"UUID">;
94
- transactionId: string;
95
- createdByUserType: "user" | "system";
96
- createdAt: string;
97
- createdBy: string;
98
- declaration: Record<string, import("..").FieldUpdateValue>;
99
- status: "Requested" | "Accepted" | "Rejected";
100
- type: "CUSTOM";
101
- customActionType: string;
102
- createdByRole?: string | undefined;
103
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
104
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
105
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
106
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
107
- } | {
108
- id: string & import("zod").$brand<"UUID">;
109
- transactionId: string;
110
- createdByUserType: "user" | "system";
111
- createdAt: string;
112
- createdBy: string;
113
- declaration: Record<string, import("..").FieldUpdateValue>;
114
- status: "Requested" | "Accepted" | "Rejected";
115
- type: "CREATE";
116
- createdByRole?: string | undefined;
117
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
118
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
119
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
120
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
121
- } | {
122
- id: string & import("zod").$brand<"UUID">;
123
- transactionId: string;
124
- createdByUserType: "user" | "system";
125
- createdAt: string;
126
- createdBy: string;
127
- declaration: Record<string, import("..").FieldUpdateValue>;
128
- status: "Requested" | "Accepted" | "Rejected";
129
- type: "REJECT";
130
- content: {
131
- reason: string;
132
- };
133
- createdByRole?: string | undefined;
134
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
135
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
136
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
137
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
138
- } | {
139
- id: string & import("zod").$brand<"UUID">;
140
- transactionId: string;
141
- createdByUserType: "user" | "system";
142
- createdAt: string;
143
- createdBy: string;
144
- declaration: Record<string, import("..").FieldUpdateValue>;
145
- status: "Requested" | "Accepted" | "Rejected";
146
- type: "MARK_AS_NOT_DUPLICATE";
147
- createdByRole?: string | undefined;
148
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
149
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
150
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
151
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
152
- } | {
153
- id: string & import("zod").$brand<"UUID">;
154
- transactionId: string;
155
- createdByUserType: "user" | "system";
156
- createdAt: string;
157
- createdBy: string;
158
- declaration: Record<string, import("..").FieldUpdateValue>;
159
- status: "Requested" | "Accepted" | "Rejected";
160
- type: "MARK_AS_DUPLICATE";
161
- createdByRole?: string | undefined;
162
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
163
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
164
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
165
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
166
- content?: {
167
- duplicateOf: string & import("zod").$brand<"UUID">;
168
- } | undefined;
169
- } | {
170
- id: string & import("zod").$brand<"UUID">;
171
- transactionId: string;
172
- createdByUserType: "user" | "system";
173
- createdAt: string;
174
- createdBy: string;
175
- declaration: Record<string, import("..").FieldUpdateValue>;
176
- status: "Requested" | "Accepted" | "Rejected";
177
- type: "ARCHIVE";
178
- content: {
179
- reason: string;
180
- };
181
- createdByRole?: string | undefined;
182
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
183
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
184
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
185
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
186
- } | {
187
- id: string & import("zod").$brand<"UUID">;
188
- transactionId: string;
189
- createdByUserType: "user" | "system";
190
- createdAt: string;
191
- createdBy: string;
192
- declaration: Record<string, import("..").FieldUpdateValue>;
193
- status: "Requested" | "Accepted" | "Rejected";
194
- type: "NOTIFY";
195
- createdByRole?: string | undefined;
196
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
197
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
198
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
199
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
200
- } | {
201
- id: string & import("zod").$brand<"UUID">;
202
- transactionId: string;
203
- createdByUserType: "user" | "system";
204
- createdAt: string;
205
- createdBy: string;
206
- declaration: Record<string, import("..").FieldUpdateValue>;
207
- status: "Requested" | "Accepted" | "Rejected";
208
- type: "DECLARE";
209
- createdByRole?: string | undefined;
210
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
211
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
212
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
213
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
214
- } | {
215
- id: string & import("zod").$brand<"UUID">;
216
- transactionId: string;
217
- createdByUserType: "user" | "system";
218
- createdAt: string;
219
- createdBy: string;
220
- declaration: Record<string, import("..").FieldUpdateValue>;
221
- status: "Requested" | "Accepted" | "Rejected";
222
- type: "ASSIGN";
223
- assignedTo: string;
224
- createdByRole?: string | undefined;
225
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
226
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
227
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
228
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
229
- } | {
230
- id: string & import("zod").$brand<"UUID">;
231
- transactionId: string;
232
- createdByUserType: "user" | "system";
233
- createdAt: string;
234
- createdBy: string;
235
- declaration: Record<string, import("..").FieldUpdateValue>;
236
- status: "Requested" | "Accepted" | "Rejected";
237
- type: "APPROVE_CORRECTION";
238
- requestId: string;
239
- createdByRole?: string | undefined;
240
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
241
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
242
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
243
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
244
- } | {
7
+ * When an Accepted action carries an originalActionId, its metadata is sourced from
8
+ * the original Requested action (the human who triggered it), not from the system
9
+ * or 3rd party that accepted it.
10
+ *
11
+ * @returns metadata of the last user who triggered a status-changing action.
12
+ * @see EventIndex for the description of the returned object.
13
+ */
14
+ export declare function getActionUpdateMetadata(actions: Action[]): Pick<{
245
15
  id: string & import("zod").$brand<"UUID">;
246
16
  transactionId: string;
247
- createdByUserType: "user" | "system";
17
+ createdByUserType: "system" | "user";
248
18
  createdAt: string;
249
19
  createdBy: string;
250
- declaration: Record<string, import("..").FieldUpdateValue>;
251
- status: "Requested" | "Accepted" | "Rejected";
252
- type: "REJECT_CORRECTION";
253
- requestId: string;
254
- content: {
255
- reason: string;
256
- };
257
20
  createdByRole?: string | undefined;
258
21
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
259
22
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
260
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
261
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
262
- } | {
263
- id: string & import("zod").$brand<"UUID">;
264
- transactionId: string;
265
- createdByUserType: "user" | "system";
266
- createdAt: string;
267
- createdBy: string;
268
23
  declaration: Record<string, import("..").FieldUpdateValue>;
269
- status: "Requested" | "Accepted" | "Rejected";
270
- type: "UNASSIGN";
271
- createdByRole?: string | undefined;
272
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
273
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
274
24
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
25
+ status: "Accepted" | "Rejected" | "Requested";
275
26
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
276
- } | {
277
- id: string & import("zod").$brand<"UUID">;
278
- transactionId: string;
279
- createdByUserType: "user" | "system";
280
- createdAt: string;
281
- createdBy: string;
282
- declaration: Record<string, import("..").FieldUpdateValue>;
283
- status: "Requested" | "Accepted" | "Rejected";
284
- type: "READ";
285
- createdByRole?: string | undefined;
286
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
287
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
288
- annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
289
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
290
- } | {
291
- id: string & import("zod").$brand<"UUID">;
292
- transactionId: string;
293
- createdByUserType: "user" | "system";
294
- createdAt: string;
295
- createdBy: string;
296
- type: "CUSTOM" | "NOTIFY" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION";
297
- status: "Rejected";
298
- createdByRole?: string | undefined;
299
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
300
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
301
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
302
- }>;
27
+ }, "createdAt" | "createdAtLocation" | "createdBy" | "createdByRole" | "createdByUserType">;
303
28
  /**
304
29
  * @returns the legal statuses of the event. Event is considered legal if it has been accepted.
305
30
  * @see EventIndex for the description of the returned object.
306
31
  */
307
32
  export declare function getLegalStatuses(actions: Action[]): {
33
+ NOTIFIED: {
34
+ createdAt: string;
35
+ createdBy: string;
36
+ createdByUserType: "system" | "user";
37
+ createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
38
+ acceptedAt: string;
39
+ createdByRole: string | undefined;
40
+ registrationNumber: string | null | undefined;
41
+ } | null;
308
42
  DECLARED: {
309
43
  createdAt: string;
310
44
  createdBy: string;
311
- createdByUserType: "user" | "system";
45
+ createdByUserType: "system" | "user";
312
46
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
313
47
  acceptedAt: string;
314
48
  createdByRole: string | undefined;
@@ -317,7 +51,7 @@ export declare function getLegalStatuses(actions: Action[]): {
317
51
  REGISTERED: {
318
52
  createdAt: string;
319
53
  createdBy: string;
320
- createdByUserType: "user" | "system";
54
+ createdByUserType: "system" | "user";
321
55
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
322
56
  acceptedAt: string;
323
57
  createdByRole: string | undefined;
@@ -23,15 +23,15 @@ export declare const TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
23
23
  * These are just for testing purposes to generate realistic mock data.
24
24
  */
25
25
  export declare const TestUserRole: z.ZodEnum<{
26
+ COMMUNITY_LEADER: "COMMUNITY_LEADER";
26
27
  FIELD_AGENT: "FIELD_AGENT";
27
28
  LOCAL_REGISTRAR: "LOCAL_REGISTRAR";
28
29
  LOCAL_SYSTEM_ADMIN: "LOCAL_SYSTEM_ADMIN";
29
30
  NATIONAL_REGISTRAR: "NATIONAL_REGISTRAR";
30
- REGISTRATION_AGENT: "REGISTRATION_AGENT";
31
31
  NATIONAL_SYSTEM_ADMIN: "NATIONAL_SYSTEM_ADMIN";
32
- SOCIAL_WORKER: "SOCIAL_WORKER";
33
- COMMUNITY_LEADER: "COMMUNITY_LEADER";
34
32
  PROVINCIAL_REGISTRAR: "PROVINCIAL_REGISTRAR";
33
+ REGISTRATION_AGENT: "REGISTRATION_AGENT";
34
+ SOCIAL_WORKER: "SOCIAL_WORKER";
35
35
  }>;
36
36
  export type TestUserRole = z.infer<typeof TestUserRole>;
37
37
  export declare function pickRandom<T>(rng: () => number, items: T[]): T;
@@ -72,103 +72,103 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
72
72
  };
73
73
  draft: ({ eventId, actionType, annotation, omitFields }: {
74
74
  eventId: UUID;
75
- actionType: Draft["action"]["type"];
75
+ actionType: Draft['action']['type'];
76
76
  annotation?: Record<string, any>;
77
77
  omitFields?: string[];
78
78
  }, input?: Partial<Draft>) => Draft;
79
79
  actions: {
80
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
80
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
81
+ keepAssignment?: boolean | undefined;
82
+ type: "DECLARE";
81
83
  transactionId: string;
82
84
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
83
85
  annotation: {};
84
- keepAssignment?: boolean | undefined;
85
- type: "DECLARE";
86
86
  eventId: string;
87
87
  };
88
88
  /**
89
89
  * Notify allows sending incomplete data. Think it as 'partial declare' for now.
90
90
  */
91
- notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
91
+ notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
92
92
  type: "NOTIFY";
93
93
  transactionId: string;
94
94
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
95
95
  eventId: string;
96
96
  keepAssignment: boolean | undefined;
97
97
  };
98
- edit: (eventId: string, input?: Partial<Pick<EditActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
99
- transactionId: string;
100
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
101
- annotation: {};
98
+ edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
102
99
  keepAssignment?: boolean | undefined;
103
100
  type: "EDIT";
104
101
  content: {
105
102
  comment: string;
106
103
  };
104
+ transactionId: string;
105
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
106
+ annotation: {};
107
107
  eventId: string;
108
108
  };
109
- assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
109
+ assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo'>>) => {
110
110
  type: "ASSIGN";
111
111
  transactionId: string;
112
112
  declaration: {};
113
113
  assignedTo: string;
114
114
  eventId: string;
115
115
  };
116
- unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
116
+ unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId'>>) => {
117
117
  type: "UNASSIGN";
118
118
  transactionId: string;
119
119
  declaration: {};
120
120
  assignedTo: null;
121
121
  eventId: string;
122
122
  };
123
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
124
- transactionId: string;
125
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
123
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
126
124
  keepAssignment?: boolean | undefined;
127
125
  type: "ARCHIVE";
126
+ transactionId: string;
127
+ declaration: {};
128
128
  annotation: {};
129
129
  eventId: string;
130
130
  content: {
131
131
  reason: string;
132
132
  };
133
133
  };
134
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
135
- transactionId: string;
136
- annotation: {};
134
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
137
135
  keepAssignment?: boolean | undefined;
138
136
  type: "REJECT";
137
+ transactionId: string;
139
138
  declaration: {};
139
+ annotation: {};
140
140
  eventId: string;
141
141
  content: {
142
142
  reason: string;
143
143
  };
144
144
  };
145
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
145
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber'>>) => {
146
+ keepAssignment?: boolean | undefined;
147
+ registrationNumber?: string | undefined;
148
+ type: "REGISTER";
146
149
  transactionId: string;
147
150
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
148
151
  annotation: {};
149
- registrationNumber?: string | undefined;
150
- keepAssignment?: boolean | undefined;
151
- type: "REGISTER";
152
152
  eventId: string;
153
153
  };
154
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
155
- transactionId: string;
156
- annotation: {};
154
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
157
155
  keepAssignment?: boolean | undefined;
158
156
  type: "PRINT_CERTIFICATE";
157
+ transactionId: string;
159
158
  declaration: {};
159
+ annotation: {};
160
160
  eventId: string;
161
161
  };
162
162
  correction: {
163
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
163
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
164
164
  type: "REQUEST_CORRECTION";
165
165
  transactionId: string;
166
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
166
+ declaration: import("lodash").Omit<Record<string, import("./FieldValue").FieldUpdateValue>, "applicant.email" | "applicant.image">;
167
167
  annotation: {};
168
168
  eventId: string;
169
169
  keepAssignment: boolean | undefined;
170
170
  };
171
- approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
171
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
172
172
  type: "APPROVE_CORRECTION";
173
173
  transactionId: string;
174
174
  declaration: {};
@@ -177,7 +177,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
177
177
  requestId: string;
178
178
  keepAssignment: boolean | undefined;
179
179
  };
180
- reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "content">>) => {
180
+ reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'content'>>) => {
181
181
  type: "REJECT_CORRECTION";
182
182
  transactionId: string;
183
183
  declaration: {};
@@ -191,7 +191,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
191
191
  };
192
192
  };
193
193
  duplicate: {
194
- markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
194
+ markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
195
195
  type: "MARK_AS_DUPLICATE";
196
196
  transactionId: string;
197
197
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
@@ -199,7 +199,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
199
199
  eventId: string;
200
200
  keepAssignment: boolean | undefined;
201
201
  };
202
- markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
202
+ markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
203
203
  type: "MARK_AS_NOT_DUPLICATE";
204
204
  transactionId: string;
205
205
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;