@opencrvs/toolkit 2.1.0-rc.c498f10 → 2.1.0-rc.c500a81
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.
- package/README.md +3 -12
- package/build.sh +12 -4
- package/create-countryconfig/index.js +441 -59
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +348 -283
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +751 -0
- package/dist/cli.js +3011 -1226
- package/dist/commons/api/router.d.ts +758 -128
- package/dist/commons/application-config/index.d.ts +0 -2
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +16 -5
- package/dist/commons/events/ActionConfig.d.ts +4 -0
- package/dist/commons/events/ActionDocument.d.ts +35 -15
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +36 -12
- package/dist/commons/events/AuditLog.d.ts +147 -0
- package/dist/commons/events/EventConfig.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +472 -4
- package/dist/commons/events/EventIndex.d.ts +3 -26
- package/dist/commons/events/EventMetadata.d.ts +1 -11
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +99 -63
- package/dist/commons/events/FieldTypeMapping.d.ts +27 -27
- package/dist/commons/events/FieldValue.d.ts +3 -2
- package/dist/commons/events/Flag.d.ts +42 -0
- package/dist/commons/events/FormConfig.d.ts +6 -0
- package/dist/commons/events/PageConfig.d.ts +4 -0
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +17 -14
- package/dist/commons/events/event.d.ts +12 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +246 -13
- package/dist/commons/events/mocks.test.utils.d.ts +46 -2
- package/dist/commons/events/test.utils.d.ts +77 -22
- package/dist/commons/events/utils.d.ts +34 -4
- package/dist/commons/notification/UserNotifications.d.ts +28 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +335 -64
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +12 -1
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.d.ts +1 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +587 -562
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +5 -9
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +21 -5
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.js +11 -13
- package/dist/environment/utils.d.ts +0 -12
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/index.js +7709 -7146
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +3 -10
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +149 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +455 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1223 -0
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts +3 -0
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +1 -0
- package/dist/migrations/v2.1/rename-trigger-paths.js +216 -0
- package/dist/notification/index.js +1878 -1465
- package/dist/scopes/index.d.ts +435 -36
- package/dist/scopes/index.js +336 -64
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +43 -0
- package/dist/templates/charts-values/dependencies/values.yaml +2 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +102 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/template.d.ts +11 -0
- package/dist/translations/template.d.ts.map +1 -0
- package/dist/translations/template.js +100 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +510 -0
- package/opencrvs-toolkit-2.1.0-rc.c500a81.tgz +0 -0
- package/package.json +13 -6
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/templates/inventory/production.example.yml +0 -77
- package/dist/templates/inventory/qa.example.yml +0 -48
- package/opencrvs-toolkit-2.1.0-rc.c498f10.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UUID } from '../uuid';
|
|
2
2
|
import { ActionDocument, ActionUpdate } from './ActionDocument';
|
|
3
|
+
import { ValidatorContext } from '../conditionals/validate';
|
|
3
4
|
import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnarchiveActionInput, UnassignActionInput } from './ActionInput';
|
|
4
5
|
import { ActionType } from './ActionType';
|
|
5
6
|
import { Draft } from './Draft';
|
|
@@ -9,7 +10,7 @@ import { EventIndex } from './EventIndex';
|
|
|
9
10
|
import { EventInput } from './EventInput';
|
|
10
11
|
import { TranslationConfig } from './TranslationConfig';
|
|
11
12
|
import { FieldConfig } from './FieldConfig';
|
|
12
|
-
import {
|
|
13
|
+
import { LocationVersion, SetLocationPayload, SetAdministrativeAreaPayload, ClientAdministrativeArea } from './locations';
|
|
13
14
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
|
14
15
|
import * as z from 'zod/v4';
|
|
15
16
|
import { DocumentPath } from '../documents';
|
|
@@ -43,21 +44,28 @@ export declare function generateUuid(rng?: () => number): UUID;
|
|
|
43
44
|
export declare function generateTrackingId(rng: () => number): string;
|
|
44
45
|
export declare function generateRegistrationNumber(rng: () => number): string;
|
|
45
46
|
export declare function generateRandomSignature(rng: () => number): DocumentPath;
|
|
47
|
+
/**
|
|
48
|
+
* Builds one element of a location / administrative area `versions` history.
|
|
49
|
+
* Every field is defaulted so a call names only what its assertion is about —
|
|
50
|
+
* an `effectiveFrom`, a `name`, or an explicit `versionId` when the test needs
|
|
51
|
+
* to control version identity.
|
|
52
|
+
*/
|
|
53
|
+
export declare function locationVersion(overrides?: Partial<LocationVersion>, rng?: () => number): LocationVersion;
|
|
46
54
|
export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng: () => number,
|
|
47
55
|
/**
|
|
48
56
|
* Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
|
|
49
57
|
*/
|
|
50
58
|
administrativeHierarchy?: {
|
|
51
|
-
administrativeAreas:
|
|
52
|
-
locations:
|
|
59
|
+
administrativeAreas: SetAdministrativeAreaPayload[];
|
|
60
|
+
locations: SetLocationPayload[];
|
|
53
61
|
}): ActionUpdate;
|
|
54
62
|
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: ActionUpdate,
|
|
55
63
|
/**
|
|
56
64
|
* Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
|
|
57
65
|
*/
|
|
58
66
|
administrativeHierarchy?: {
|
|
59
|
-
administrativeAreas:
|
|
60
|
-
locations:
|
|
67
|
+
administrativeAreas: SetAdministrativeAreaPayload[];
|
|
68
|
+
locations: SetLocationPayload[];
|
|
61
69
|
}): ActionUpdate;
|
|
62
70
|
export declare function generateActionDuplicateDeclarationInput(...args: Parameters<typeof generateActionDeclarationInput>): ReturnType<typeof generateActionDeclarationInput>;
|
|
63
71
|
export declare function eventPayloadGenerator(rng: () => number, configuration?: EventConfig): {
|
|
@@ -77,8 +85,11 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
77
85
|
omitFields?: string[];
|
|
78
86
|
}, input?: Partial<Draft>) => Draft;
|
|
79
87
|
actions: {
|
|
80
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
88
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
81
89
|
keepAssignment?: boolean | undefined;
|
|
90
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
91
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
92
|
+
waitFor?: boolean | undefined;
|
|
82
93
|
type: "DECLARE";
|
|
83
94
|
transactionId: string;
|
|
84
95
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
@@ -88,56 +99,69 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
88
99
|
/**
|
|
89
100
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
|
90
101
|
*/
|
|
91
|
-
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
|
|
102
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
92
103
|
type: "NOTIFY";
|
|
93
104
|
transactionId: string;
|
|
94
105
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
95
106
|
eventId: string;
|
|
96
107
|
keepAssignment: boolean | undefined;
|
|
108
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
109
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
97
110
|
};
|
|
98
|
-
edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
111
|
+
edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
99
112
|
keepAssignment?: boolean | undefined;
|
|
113
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
114
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
115
|
+
waitFor?: boolean | undefined;
|
|
100
116
|
type: "EDIT";
|
|
101
117
|
transactionId: string;
|
|
102
118
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
103
119
|
annotation: {};
|
|
104
120
|
eventId: string;
|
|
105
121
|
};
|
|
106
|
-
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo'>>) => {
|
|
122
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo' | 'waitFor'>>) => {
|
|
107
123
|
type: "ASSIGN";
|
|
108
124
|
transactionId: string;
|
|
109
125
|
declaration: {};
|
|
110
126
|
assignedTo: string;
|
|
111
127
|
eventId: string;
|
|
128
|
+
waitFor: boolean | undefined;
|
|
112
129
|
};
|
|
113
|
-
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId'>>) => {
|
|
130
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId' | 'waitFor'>>) => {
|
|
114
131
|
type: "UNASSIGN";
|
|
115
132
|
transactionId: string;
|
|
116
133
|
declaration: {};
|
|
117
134
|
assignedTo: null;
|
|
118
135
|
eventId: string;
|
|
136
|
+
waitFor: boolean | undefined;
|
|
119
137
|
};
|
|
120
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
|
|
138
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
121
139
|
keepAssignment?: boolean | undefined;
|
|
140
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
141
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
142
|
+
waitFor?: boolean | undefined;
|
|
122
143
|
type: "ARCHIVE";
|
|
123
144
|
transactionId: string;
|
|
124
145
|
declaration: {};
|
|
125
146
|
annotation: {};
|
|
126
147
|
eventId: string;
|
|
127
|
-
content: {
|
|
128
|
-
reason: string;
|
|
129
|
-
};
|
|
130
148
|
};
|
|
131
|
-
unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
|
|
149
|
+
unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
132
150
|
keepAssignment?: boolean | undefined;
|
|
151
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
152
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
153
|
+
waitFor?: boolean | undefined;
|
|
133
154
|
type: "UNARCHIVE";
|
|
134
155
|
transactionId: string;
|
|
135
156
|
declaration: {};
|
|
136
157
|
annotation: {};
|
|
137
158
|
eventId: string;
|
|
138
159
|
};
|
|
139
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
|
|
160
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
140
161
|
keepAssignment?: boolean | undefined;
|
|
162
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
163
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
164
|
+
waitFor?: boolean | undefined;
|
|
141
165
|
type: "REJECT";
|
|
142
166
|
transactionId: string;
|
|
143
167
|
declaration: {};
|
|
@@ -147,8 +171,11 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
147
171
|
reason: string;
|
|
148
172
|
};
|
|
149
173
|
};
|
|
150
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber'>>) => {
|
|
174
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
151
175
|
keepAssignment?: boolean | undefined;
|
|
176
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
177
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
178
|
+
waitFor?: boolean | undefined;
|
|
152
179
|
registrationNumber?: string | undefined;
|
|
153
180
|
type: "REGISTER";
|
|
154
181
|
transactionId: string;
|
|
@@ -156,8 +183,11 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
156
183
|
annotation: {};
|
|
157
184
|
eventId: string;
|
|
158
185
|
};
|
|
159
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
|
|
186
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
160
187
|
keepAssignment?: boolean | undefined;
|
|
188
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
189
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
190
|
+
waitFor?: boolean | undefined;
|
|
161
191
|
type: "PRINT_CERTIFICATE";
|
|
162
192
|
transactionId: string;
|
|
163
193
|
declaration: {};
|
|
@@ -165,15 +195,18 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
165
195
|
eventId: string;
|
|
166
196
|
};
|
|
167
197
|
correction: {
|
|
168
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
198
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
169
199
|
type: "REQUEST_CORRECTION";
|
|
170
200
|
transactionId: string;
|
|
171
201
|
declaration: import("lodash").Omit<Record<string, import("./FieldValue").FieldUpdateValue>, "applicant.email" | "applicant.image">;
|
|
172
202
|
annotation: {};
|
|
173
203
|
eventId: string;
|
|
174
204
|
keepAssignment: boolean | undefined;
|
|
205
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
206
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
207
|
+
waitFor: boolean | undefined;
|
|
175
208
|
};
|
|
176
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
|
|
209
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
177
210
|
type: "APPROVE_CORRECTION";
|
|
178
211
|
transactionId: string;
|
|
179
212
|
declaration: {};
|
|
@@ -181,18 +214,24 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
181
214
|
eventId: string;
|
|
182
215
|
requestId: string;
|
|
183
216
|
keepAssignment: boolean | undefined;
|
|
217
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
218
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
219
|
+
waitFor: boolean | undefined;
|
|
184
220
|
};
|
|
185
|
-
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | '
|
|
221
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'content' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
186
222
|
type: "REJECT_CORRECTION";
|
|
187
223
|
transactionId: string;
|
|
188
224
|
declaration: {};
|
|
189
225
|
annotation: {};
|
|
190
226
|
eventId: string;
|
|
191
227
|
requestId: string;
|
|
192
|
-
keepAssignment: boolean | undefined;
|
|
193
228
|
content: {
|
|
194
229
|
reason: string;
|
|
195
230
|
};
|
|
231
|
+
keepAssignment: boolean | undefined;
|
|
232
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
233
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
234
|
+
waitFor: boolean | undefined;
|
|
196
235
|
};
|
|
197
236
|
};
|
|
198
237
|
duplicate: {
|
|
@@ -291,4 +330,20 @@ export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfE
|
|
|
291
330
|
placeOfEventId?: string;
|
|
292
331
|
dateOfEventId?: string;
|
|
293
332
|
}) => EventConfig;
|
|
333
|
+
/**
|
|
334
|
+
* Get the leaf administrative area IDs from a list of administrative areas.
|
|
335
|
+
*
|
|
336
|
+
* A leaf administrative area is defined as an administrative area that does not have any children in the provided list.
|
|
337
|
+
* AdministrativeArea might have a CRVS_OFFICE as children, but is still considered to be a leaf administrative area.
|
|
338
|
+
*
|
|
339
|
+
* @param administrativeAreas - The list of administrative areas to search.
|
|
340
|
+
* @returns The list of leaf administrative area IDs.
|
|
341
|
+
*/
|
|
342
|
+
export declare function getLeafAdministrativeAreaIds(administrativeAreas: Map<UUID, ClientAdministrativeArea>): Array<{
|
|
343
|
+
id: UUID;
|
|
344
|
+
}>;
|
|
345
|
+
export declare function generateTestValidatorContext(userRole?: TestUserRole, eventWithConfig?: {
|
|
346
|
+
event: EventDocument;
|
|
347
|
+
eventConfig: EventConfig;
|
|
348
|
+
}): ValidatorContext;
|
|
294
349
|
//# sourceMappingURL=test.utils.d.ts.map
|
|
@@ -10,6 +10,7 @@ import { UUID } from '../uuid';
|
|
|
10
10
|
import { ActionConfig, ActionConfigTypes } from './ActionConfig';
|
|
11
11
|
import { FormConfig } from './FormConfig';
|
|
12
12
|
import { PlainDate, SelectDateRangeValue } from './FieldValue';
|
|
13
|
+
import { EventIndex } from './EventIndex';
|
|
13
14
|
export declare function ageToDate(age: number, asOfDate: PlainDate): string & import("zod").$brand<"PlainDate">;
|
|
14
15
|
export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
|
|
15
16
|
export declare function getDeclarationPages(configuration: EventConfig): {
|
|
@@ -20,6 +21,7 @@ export declare function getDeclarationPages(configuration: EventConfig): {
|
|
|
20
21
|
description: string;
|
|
21
22
|
};
|
|
22
23
|
requireCompletionToContinue: boolean;
|
|
24
|
+
showClearButton?: boolean | undefined;
|
|
23
25
|
fields: FieldConfig[];
|
|
24
26
|
conditional?: any;
|
|
25
27
|
type: "FORM";
|
|
@@ -38,6 +40,7 @@ export declare function getDeclaration(configuration: EventConfig): {
|
|
|
38
40
|
description: string;
|
|
39
41
|
};
|
|
40
42
|
requireCompletionToContinue: boolean;
|
|
43
|
+
showClearButton?: boolean | undefined;
|
|
41
44
|
fields: FieldConfig[];
|
|
42
45
|
conditional?: any;
|
|
43
46
|
type: "FORM";
|
|
@@ -66,6 +69,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
|
|
|
66
69
|
description: string;
|
|
67
70
|
};
|
|
68
71
|
requireCompletionToContinue: boolean;
|
|
72
|
+
showClearButton?: boolean | undefined;
|
|
69
73
|
fields: FieldConfig[];
|
|
70
74
|
conditional?: any;
|
|
71
75
|
type: "FORM";
|
|
@@ -77,6 +81,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
|
|
|
77
81
|
description: string;
|
|
78
82
|
};
|
|
79
83
|
requireCompletionToContinue: boolean;
|
|
84
|
+
showClearButton?: boolean | undefined;
|
|
80
85
|
fields: FieldConfig[];
|
|
81
86
|
conditional?: any;
|
|
82
87
|
type: "VERIFICATION";
|
|
@@ -255,9 +260,9 @@ export declare function findLastAssignmentAction(actions: Action[]): {
|
|
|
255
260
|
status: "Accepted" | "Rejected" | "Requested";
|
|
256
261
|
originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
257
262
|
type: "ARCHIVE";
|
|
258
|
-
content
|
|
263
|
+
content?: {
|
|
259
264
|
reason: string;
|
|
260
|
-
};
|
|
265
|
+
} | undefined;
|
|
261
266
|
} | {
|
|
262
267
|
id: string & import("zod").$brand<"UUID">;
|
|
263
268
|
transactionId: string;
|
|
@@ -358,7 +363,7 @@ export declare function findLastAssignmentAction(actions: Action[]): {
|
|
|
358
363
|
status: "Accepted" | "Rejected" | "Requested";
|
|
359
364
|
originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
360
365
|
type: "APPROVE_CORRECTION";
|
|
361
|
-
requestId: string
|
|
366
|
+
requestId: string & import("zod").$brand<"UUID">;
|
|
362
367
|
content?: {
|
|
363
368
|
immediateCorrection?: boolean | undefined;
|
|
364
369
|
} | undefined;
|
|
@@ -376,7 +381,7 @@ export declare function findLastAssignmentAction(actions: Action[]): {
|
|
|
376
381
|
status: "Accepted" | "Rejected" | "Requested";
|
|
377
382
|
originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
378
383
|
type: "REJECT_CORRECTION";
|
|
379
|
-
requestId: string
|
|
384
|
+
requestId: string & import("zod").$brand<"UUID">;
|
|
380
385
|
content: {
|
|
381
386
|
reason: string;
|
|
382
387
|
};
|
|
@@ -596,5 +601,30 @@ export declare function getCompleteActionContent(event: EventDocument, action: A
|
|
|
596
601
|
export declare function getCompleteActionDeclaration<T extends EventState | ActionUpdate>(declaration: T, event: EventDocument, action: ActionDocument): T;
|
|
597
602
|
export declare function getAcceptedActions(event: EventDocument): ActionDocument[];
|
|
598
603
|
export declare function aggregateActionDeclarations(event: EventDocument): EventState;
|
|
604
|
+
/**
|
|
605
|
+
* Returns the event's declaration state as it will be once the single pending
|
|
606
|
+
* action is accepted — i.e. the aggregate of all accepted declarations with the
|
|
607
|
+
* pending action's changes applied on top.
|
|
608
|
+
*
|
|
609
|
+
* Country configuration confirmation handlers (and notifications) need the
|
|
610
|
+
* up-to-date declaration at confirmation time, before core has accepted the
|
|
611
|
+
* action. Reaching for `aggregateActionDeclarations` alone is not enough for
|
|
612
|
+
* corrections: when confirming an APPROVE_CORRECTION the changed fields live on
|
|
613
|
+
* the linked REQUEST_CORRECTION, not on the pending action's own (empty)
|
|
614
|
+
* declaration. This helper applies the same correction-aware merge that
|
|
615
|
+
* `aggregateActionDeclarations` uses for already-accepted approvals, so callers
|
|
616
|
+
* do not have to reimplement the `requestId`/`originalActionId` resolution.
|
|
617
|
+
*/
|
|
618
|
+
export declare function getDeclarationWithPendingAction(event: EventDocument): EventState;
|
|
599
619
|
export declare function aggregateActionAnnotations(event: EventDocument): EventState;
|
|
620
|
+
/**
|
|
621
|
+
* 2.1. onwards secured fields have accepted conditionals.
|
|
622
|
+
* Secured fields are not present in EventIndex payload.
|
|
623
|
+
* When we derive @see EventIndex from @see EventDocument, we will have all the fields present.
|
|
624
|
+
*
|
|
625
|
+
* To keep the views consistent, and not to change if event.get gets triggered, we need to clean out the secured fields.
|
|
626
|
+
*
|
|
627
|
+
* @returns EventIndex without values that evaluate to secured: true.
|
|
628
|
+
*/
|
|
629
|
+
export declare function dropSecuredDeclarationFields(eventConfig: EventConfig, eventIndex: EventIndex, validatorContext: ValidatorContext): EventIndex;
|
|
600
630
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -5,6 +5,8 @@ export declare const TriggerEvent: {
|
|
|
5
5
|
readonly USERNAME_REMINDER: 'username-reminder';
|
|
6
6
|
readonly RESET_PASSWORD: 'reset-password';
|
|
7
7
|
readonly RESET_PASSWORD_BY_ADMIN: 'reset-password-by-admin';
|
|
8
|
+
readonly PASSWORD_RESET_LINK: 'password-reset-link';
|
|
9
|
+
readonly USERNAME_REMINDER_LINK: 'username-reminder-link';
|
|
8
10
|
readonly RESEND_INVITE: 'resend-invite';
|
|
9
11
|
readonly TWO_FA: '2fa';
|
|
10
12
|
readonly ALL_USER_NOTIFICATION: 'all-user-notification';
|
|
@@ -113,6 +115,32 @@ export declare const TriggerPayload: {
|
|
|
113
115
|
role: z.ZodString;
|
|
114
116
|
}, z.core.$strip>;
|
|
115
117
|
}, z.core.$strip>;
|
|
118
|
+
readonly "password-reset-link": z.ZodObject<{
|
|
119
|
+
recipient: z.ZodObject<{
|
|
120
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
firstname: z.ZodString;
|
|
122
|
+
surname: z.ZodString;
|
|
123
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
mobile: z.ZodOptional<z.ZodString>;
|
|
126
|
+
email: z.ZodOptional<z.ZodString>;
|
|
127
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
token: z.ZodString;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
readonly "username-reminder-link": z.ZodObject<{
|
|
132
|
+
recipient: z.ZodObject<{
|
|
133
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
firstname: z.ZodString;
|
|
135
|
+
surname: z.ZodString;
|
|
136
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
mobile: z.ZodOptional<z.ZodString>;
|
|
139
|
+
email: z.ZodOptional<z.ZodString>;
|
|
140
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
token: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
116
144
|
readonly "resend-invite": z.ZodObject<{
|
|
117
145
|
recipient: z.ZodObject<{
|
|
118
146
|
name: z.ZodOptional<z.ZodObject<{
|
|
@@ -184,18 +212,5 @@ export declare const TriggerPayload: {
|
|
|
184
212
|
export type TriggerPayload = {
|
|
185
213
|
[K in TriggerEvent]: z.infer<(typeof TriggerPayload)[K]>;
|
|
186
214
|
};
|
|
187
|
-
export declare function triggerUserEventNotification(args: {
|
|
188
|
-
event: typeof TriggerEvent.ALL_USER_NOTIFICATION;
|
|
189
|
-
payload: TriggerPayload[typeof TriggerEvent.ALL_USER_NOTIFICATION];
|
|
190
|
-
countryConfigUrl: string;
|
|
191
|
-
}): Promise<Response>;
|
|
192
|
-
export declare function triggerUserEventNotification<T extends Exclude<TriggerEvent, typeof TriggerEvent.ALL_USER_NOTIFICATION>>(args: {
|
|
193
|
-
event: T;
|
|
194
|
-
payload: TriggerPayload[T];
|
|
195
|
-
countryConfigUrl: string;
|
|
196
|
-
authHeader: {
|
|
197
|
-
Authorization: string;
|
|
198
|
-
};
|
|
199
|
-
}): Promise<Response>;
|
|
200
215
|
export declare function parseUserEventTrigger<T extends TriggerEvent>(event: T, body: unknown): TriggerPayload[T];
|
|
201
216
|
//# sourceMappingURL=UserNotifications.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TriggerEvent, TriggerPayload } from './UserNotifications';
|
|
2
|
+
export declare function triggerUserEventNotification<T extends TriggerEvent>({ event, payload, countryConfigUrl, authHeader }: {
|
|
3
|
+
event: T;
|
|
4
|
+
payload: TriggerPayload[T];
|
|
5
|
+
countryConfigUrl: string;
|
|
6
|
+
authHeader: {
|
|
7
|
+
Authorization: string;
|
|
8
|
+
};
|
|
9
|
+
}): Promise<Response>;
|
|
10
|
+
//# sourceMappingURL=dispatch.d.ts.map
|