@opencrvs/toolkit 2.1.0-rc.b59ffae → 2.1.0-rc.b632d41

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 (66) hide show
  1. package/dist/application-config/index.js +1 -3
  2. package/dist/commons/api/router.d.ts +1643 -1711
  3. package/dist/commons/application-config/index.d.ts +6 -6
  4. package/dist/commons/conditionals/conditionals.d.ts +323 -32
  5. package/dist/commons/events/ActionConfig.d.ts +105 -105
  6. package/dist/commons/events/ActionDocument.d.ts +119 -119
  7. package/dist/commons/events/ActionInput.d.ts +6 -0
  8. package/dist/commons/events/ActionType.d.ts +62 -62
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +507 -513
  10. package/dist/commons/events/AuditLog.d.ts +42 -79
  11. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  12. package/dist/commons/events/Conditional.d.ts +3 -3
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
  14. package/dist/commons/events/Draft.d.ts +37 -37
  15. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  16. package/dist/commons/events/EventConfig.d.ts +5 -5
  17. package/dist/commons/events/EventDocument.d.ts +48 -48
  18. package/dist/commons/events/EventIndex.d.ts +62 -62
  19. package/dist/commons/events/EventMetadata.d.ts +40 -40
  20. package/dist/commons/events/FieldConfig.d.ts +337 -342
  21. package/dist/commons/events/FieldType.d.ts +51 -51
  22. package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
  23. package/dist/commons/events/FieldValue.d.ts +12 -12
  24. package/dist/commons/events/Flag.d.ts +15 -15
  25. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  26. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  27. package/dist/commons/events/WorkqueueConfig.d.ts +820 -820
  28. package/dist/commons/events/deduplication.d.ts +1 -1
  29. package/dist/commons/events/event.d.ts +2 -2
  30. package/dist/commons/events/field.d.ts +198 -69
  31. package/dist/commons/events/index.d.ts +0 -1
  32. package/dist/commons/events/locations.d.ts +6 -103
  33. package/dist/commons/events/mocks.test.utils.d.ts +4 -18
  34. package/dist/commons/events/scopes.d.ts +4 -4
  35. package/dist/commons/events/state/index.d.ts +17 -17
  36. package/dist/commons/events/state/utils.d.ts +7 -7
  37. package/dist/commons/events/test.utils.d.ts +43 -40
  38. package/dist/commons/events/utils.d.ts +114 -114
  39. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  40. package/dist/conditionals/index.js +0 -1
  41. package/dist/environment/derived-variables.d.ts +119 -119
  42. package/dist/environment/derived-variables.d.ts.map +1 -1
  43. package/dist/environment/logger.d.ts +12 -3
  44. package/dist/environment/logger.d.ts.map +1 -1
  45. package/dist/environment/manage-users.js +7 -17
  46. package/dist/environment/questions.d.ts +74 -75
  47. package/dist/environment/questions.d.ts.map +1 -1
  48. package/dist/environment/setup-environment.js +14 -8
  49. package/dist/environment/swarm-to-k8s.js +7 -17
  50. package/dist/environment/update-workflows.js +7 -17
  51. package/dist/environment/users.js +7 -17
  52. package/dist/environment/utils.d.ts +1 -1
  53. package/dist/environment/utils.js +7 -17
  54. package/dist/events/deduplication.d.ts +1 -1
  55. package/dist/events/index.js +58 -150
  56. package/dist/migrations/v2.0/convert-config-files-to-ts.js +7 -17
  57. package/dist/migrations/v2.0/migrate-application-config-url.js +3 -4
  58. package/dist/migrations/v2.0/remove-hearth-migrations.js +7 -17
  59. package/dist/notification/index.js +82 -147
  60. package/dist/scopes/index.d.ts +146 -148
  61. package/dist/scopes/index.js +0 -1
  62. package/opencrvs-toolkit-2.1.0-rc.b632d41.tgz +0 -0
  63. package/package.json +5 -5
  64. package/tsconfig.tsbuildinfo +1 -1
  65. package/dist/commons/events/locationPayloads.d.ts +0 -95
  66. package/opencrvs-toolkit-2.1.0-rc.b59ffae.tgz +0 -0
@@ -14,17 +14,17 @@ import { Action } from '../ActionDocument';
14
14
  export declare function getActionUpdateMetadata(actions: Action[]): Pick<{
15
15
  id: string & import("zod").$brand<"UUID">;
16
16
  transactionId: string;
17
- createdByUserType: "system" | "user";
17
+ createdByUserType: "user" | "system";
18
18
  createdAt: string;
19
19
  createdBy: string;
20
+ declaration: Record<string, import("..").FieldUpdateValue>;
21
+ status: "Requested" | "Accepted" | "Rejected";
20
22
  createdByRole?: string | undefined;
21
23
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
22
24
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
23
- declaration: Record<string, import("..").FieldUpdateValue>;
24
25
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
25
- status: "Accepted" | "Rejected" | "Requested";
26
26
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
27
- }, "createdAt" | "createdAtLocation" | "createdBy" | "createdByRole" | "createdByUserType">;
27
+ }, "createdByUserType" | "createdAt" | "createdBy" | "createdByRole" | "createdAtLocation">;
28
28
  /**
29
29
  * @returns the legal statuses of the event. Event is considered legal if it has been accepted.
30
30
  * @see EventIndex for the description of the returned object.
@@ -33,7 +33,7 @@ export declare function getLegalStatuses(actions: Action[]): {
33
33
  NOTIFIED: {
34
34
  createdAt: string;
35
35
  createdBy: string;
36
- createdByUserType: "system" | "user";
36
+ createdByUserType: "user" | "system";
37
37
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
38
38
  acceptedAt: string;
39
39
  createdByRole: string | undefined;
@@ -42,7 +42,7 @@ export declare function getLegalStatuses(actions: Action[]): {
42
42
  DECLARED: {
43
43
  createdAt: string;
44
44
  createdBy: string;
45
- createdByUserType: "system" | "user";
45
+ createdByUserType: "user" | "system";
46
46
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
47
47
  acceptedAt: string;
48
48
  createdByRole: string | undefined;
@@ -51,7 +51,7 @@ export declare function getLegalStatuses(actions: Action[]): {
51
51
  REGISTERED: {
52
52
  createdAt: string;
53
53
  createdBy: string;
54
- createdByUserType: "system" | "user";
54
+ createdByUserType: "user" | "system";
55
55
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
56
56
  acceptedAt: string;
57
57
  createdByRole: string | undefined;
@@ -9,7 +9,7 @@ import { EventIndex } from './EventIndex';
9
9
  import { EventInput } from './EventInput';
10
10
  import { TranslationConfig } from './TranslationConfig';
11
11
  import { FieldConfig } from './FieldConfig';
12
- import { SetLocationPayload, SetAdministrativeAreaPayload } from './locations';
12
+ import { Location, AdministrativeArea } from './locations';
13
13
  import { WorkqueueConfig } from './WorkqueueConfig';
14
14
  import * as z from 'zod/v4';
15
15
  import { DocumentPath } from '../documents';
@@ -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";
27
26
  FIELD_AGENT: "FIELD_AGENT";
28
27
  LOCAL_REGISTRAR: "LOCAL_REGISTRAR";
29
28
  LOCAL_SYSTEM_ADMIN: "LOCAL_SYSTEM_ADMIN";
30
29
  NATIONAL_REGISTRAR: "NATIONAL_REGISTRAR";
31
- NATIONAL_SYSTEM_ADMIN: "NATIONAL_SYSTEM_ADMIN";
32
- PROVINCIAL_REGISTRAR: "PROVINCIAL_REGISTRAR";
33
30
  REGISTRATION_AGENT: "REGISTRATION_AGENT";
31
+ NATIONAL_SYSTEM_ADMIN: "NATIONAL_SYSTEM_ADMIN";
34
32
  SOCIAL_WORKER: "SOCIAL_WORKER";
33
+ COMMUNITY_LEADER: "COMMUNITY_LEADER";
34
+ PROVINCIAL_REGISTRAR: "PROVINCIAL_REGISTRAR";
35
35
  }>;
36
36
  export type TestUserRole = z.infer<typeof TestUserRole>;
37
37
  export declare function pickRandom<T>(rng: () => number, items: T[]): T;
@@ -48,16 +48,16 @@ export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng:
48
48
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
49
49
  */
50
50
  administrativeHierarchy?: {
51
- administrativeAreas: SetAdministrativeAreaPayload[];
52
- locations: SetLocationPayload[];
51
+ administrativeAreas: AdministrativeArea[];
52
+ locations: Location[];
53
53
  }): ActionUpdate;
54
54
  export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: ActionUpdate,
55
55
  /**
56
56
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
57
57
  */
58
58
  administrativeHierarchy?: {
59
- administrativeAreas: SetAdministrativeAreaPayload[];
60
- locations: SetLocationPayload[];
59
+ administrativeAreas: AdministrativeArea[];
60
+ locations: Location[];
61
61
  }): ActionUpdate;
62
62
  export declare function generateActionDuplicateDeclarationInput(...args: Parameters<typeof generateActionDeclarationInput>): ReturnType<typeof generateActionDeclarationInput>;
63
63
  export declare function eventPayloadGenerator(rng: () => number, configuration?: EventConfig): {
@@ -72,108 +72,111 @@ 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'>>) => {
81
- keepAssignment?: boolean | undefined;
82
- type: "DECLARE";
80
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
83
81
  transactionId: string;
84
82
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
85
83
  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
- keepAssignment?: boolean | undefined;
100
- type: "EDIT";
98
+ edit: (eventId: string, input?: Partial<Pick<EditActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
101
99
  transactionId: string;
102
100
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
103
101
  annotation: {};
102
+ keepAssignment?: boolean | undefined;
103
+ type: "EDIT";
104
+ content: {
105
+ comment: string;
106
+ };
104
107
  eventId: string;
105
108
  };
106
- assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo'>>) => {
109
+ assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
107
110
  type: "ASSIGN";
108
111
  transactionId: string;
109
112
  declaration: {};
110
113
  assignedTo: string;
111
114
  eventId: string;
112
115
  };
113
- unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId'>>) => {
116
+ unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
114
117
  type: "UNASSIGN";
115
118
  transactionId: string;
116
119
  declaration: {};
117
120
  assignedTo: null;
118
121
  eventId: string;
119
122
  };
120
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
123
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
124
+ transactionId: string;
125
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
121
126
  keepAssignment?: boolean | undefined;
122
127
  type: "ARCHIVE";
123
- transactionId: string;
124
- declaration: {};
125
128
  annotation: {};
126
129
  eventId: string;
127
130
  content: {
128
131
  reason: string;
129
132
  };
130
133
  };
131
- unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
134
+ unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
135
+ transactionId: string;
136
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
132
137
  keepAssignment?: boolean | undefined;
133
138
  type: "UNARCHIVE";
134
- transactionId: string;
135
- declaration: {};
136
139
  annotation: {};
137
140
  eventId: string;
138
141
  };
139
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
142
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
143
+ transactionId: string;
144
+ annotation: {};
140
145
  keepAssignment?: boolean | undefined;
141
146
  type: "REJECT";
142
- transactionId: string;
143
147
  declaration: {};
144
- annotation: {};
145
148
  eventId: string;
146
149
  content: {
147
150
  reason: string;
148
151
  };
149
152
  };
150
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber'>>) => {
151
- keepAssignment?: boolean | undefined;
152
- registrationNumber?: string | undefined;
153
- type: "REGISTER";
153
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
154
154
  transactionId: string;
155
155
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
156
156
  annotation: {};
157
+ registrationNumber?: string | undefined;
158
+ keepAssignment?: boolean | undefined;
159
+ type: "REGISTER";
157
160
  eventId: string;
158
161
  };
159
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
162
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
163
+ transactionId: string;
164
+ annotation: {};
160
165
  keepAssignment?: boolean | undefined;
161
166
  type: "PRINT_CERTIFICATE";
162
- transactionId: string;
163
167
  declaration: {};
164
- annotation: {};
165
168
  eventId: string;
166
169
  };
167
170
  correction: {
168
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
171
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
169
172
  type: "REQUEST_CORRECTION";
170
173
  transactionId: string;
171
- declaration: import("lodash").Omit<Record<string, import("./FieldValue").FieldUpdateValue>, "applicant.email" | "applicant.image">;
174
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
172
175
  annotation: {};
173
176
  eventId: string;
174
177
  keepAssignment: boolean | undefined;
175
178
  };
176
- approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
179
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
177
180
  type: "APPROVE_CORRECTION";
178
181
  transactionId: string;
179
182
  declaration: {};
@@ -182,7 +185,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
182
185
  requestId: string;
183
186
  keepAssignment: boolean | undefined;
184
187
  };
185
- reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'content'>>) => {
188
+ reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "content">>) => {
186
189
  type: "REJECT_CORRECTION";
187
190
  transactionId: string;
188
191
  declaration: {};
@@ -196,7 +199,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
196
199
  };
197
200
  };
198
201
  duplicate: {
199
- markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
202
+ markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
200
203
  type: "MARK_AS_DUPLICATE";
201
204
  transactionId: string;
202
205
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
@@ -204,7 +207,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
204
207
  eventId: string;
205
208
  keepAssignment: boolean | undefined;
206
209
  };
207
- markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
210
+ markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
208
211
  type: "MARK_AS_NOT_DUPLICATE";
209
212
  transactionId: string;
210
213
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;