@opencrvs/toolkit 2.1.0-rc.30bcbde → 2.1.0-rc.312fbd1
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 +362 -284
- package/dist/authentication/index.d.ts +66 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +765 -0
- package/dist/cli.js +3347 -1229
- package/dist/commons/api/router.d.ts +3942 -3310
- package/dist/commons/application-config/index.d.ts +6 -8
- package/dist/commons/conditionals/conditionals.d.ts +259 -2102
- package/dist/commons/conditionals/validate.d.ts +34 -8
- package/dist/commons/events/ActionConfig.d.ts +105 -114
- package/dist/commons/events/ActionDocument.d.ts +145 -125
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +62 -62
- package/dist/commons/events/AdvancedSearchConfig.d.ts +549 -513
- package/dist/commons/events/AuditLog.d.ts +190 -42
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
- package/dist/commons/events/Draft.d.ts +27 -47
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +8 -5
- package/dist/commons/events/EventDocument.d.ts +518 -50
- package/dist/commons/events/EventIndex.d.ts +49 -72
- package/dist/commons/events/EventMetadata.d.ts +39 -49
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +440 -394
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +89 -89
- package/dist/commons/events/FieldValue.d.ts +15 -14
- package/dist/commons/events/Flag.d.ts +57 -15
- 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/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +817 -814
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +14 -2
- package/dist/commons/events/field.d.ts +78 -895
- 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 +247 -14
- package/dist/commons/events/mocks.test.utils.d.ts +48 -4
- package/dist/commons/events/scopes.d.ts +25 -5
- package/dist/commons/events/state/index.d.ts +17 -17
- package/dist/commons/events/state/utils.d.ts +7 -7
- package/dist/commons/events/test.utils.d.ts +104 -46
- package/dist/commons/events/utils.d.ts +149 -114
- package/dist/commons/notification/UserNotifications.d.ts +38 -23
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +349 -65
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/derived-variables.d.ts +119 -119
- package/dist/environment/derived-variables.d.ts.map +1 -1
- 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 +75 -74
- 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 +589 -570
- 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 +1 -13
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +5910 -5301
- 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.0/migrate-application-config-url.js +4 -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 +1556 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +2 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.js +161 -0
- package/dist/migrations/v2.1/remove-sentry.d.ts +3 -0
- package/dist/migrations/v2.1/remove-sentry.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-sentry.js +354 -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 +1904 -1492
- package/dist/scopes/index.d.ts +736 -158
- package/dist/scopes/index.js +351 -65
- 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 +8 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +10 -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.312fbd1.tgz +0 -0
- package/package.json +13 -7
- 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.30bcbde.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
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';
|
|
6
|
-
import { EventConfig } from './EventConfig';
|
|
7
|
+
import { EventConfig, EventConfigInput } from './EventConfig';
|
|
7
8
|
import { EventDocument } from './EventDocument';
|
|
8
9
|
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';
|
|
@@ -23,15 +24,15 @@ export declare const TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
|
|
23
24
|
* These are just for testing purposes to generate realistic mock data.
|
|
24
25
|
*/
|
|
25
26
|
export declare const TestUserRole: z.ZodEnum<{
|
|
27
|
+
COMMUNITY_LEADER: "COMMUNITY_LEADER";
|
|
26
28
|
FIELD_AGENT: "FIELD_AGENT";
|
|
27
29
|
LOCAL_REGISTRAR: "LOCAL_REGISTRAR";
|
|
28
30
|
LOCAL_SYSTEM_ADMIN: "LOCAL_SYSTEM_ADMIN";
|
|
29
31
|
NATIONAL_REGISTRAR: "NATIONAL_REGISTRAR";
|
|
30
|
-
REGISTRATION_AGENT: "REGISTRATION_AGENT";
|
|
31
32
|
NATIONAL_SYSTEM_ADMIN: "NATIONAL_SYSTEM_ADMIN";
|
|
32
|
-
SOCIAL_WORKER: "SOCIAL_WORKER";
|
|
33
|
-
COMMUNITY_LEADER: "COMMUNITY_LEADER";
|
|
34
33
|
PROVINCIAL_REGISTRAR: "PROVINCIAL_REGISTRAR";
|
|
34
|
+
REGISTRATION_AGENT: "REGISTRATION_AGENT";
|
|
35
|
+
SOCIAL_WORKER: "SOCIAL_WORKER";
|
|
35
36
|
}>;
|
|
36
37
|
export type TestUserRole = z.infer<typeof TestUserRole>;
|
|
37
38
|
export declare function pickRandom<T>(rng: () => number, items: T[]): T;
|
|
@@ -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): {
|
|
@@ -72,108 +80,134 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
72
80
|
};
|
|
73
81
|
draft: ({ eventId, actionType, annotation, omitFields }: {
|
|
74
82
|
eventId: UUID;
|
|
75
|
-
actionType: Draft[
|
|
83
|
+
actionType: Draft['action']['type'];
|
|
76
84
|
annotation?: Record<string, any>;
|
|
77
85
|
omitFields?: string[];
|
|
78
86
|
}, input?: Partial<Draft>) => Draft;
|
|
79
87
|
actions: {
|
|
80
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput,
|
|
88
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
89
|
+
keepAssignment?: boolean | undefined;
|
|
90
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
91
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
92
|
+
waitFor?: boolean | undefined;
|
|
93
|
+
type: "DECLARE";
|
|
81
94
|
transactionId: string;
|
|
82
95
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
83
96
|
annotation: {};
|
|
84
|
-
keepAssignment?: boolean | undefined;
|
|
85
|
-
type: "DECLARE";
|
|
86
97
|
eventId: string;
|
|
87
98
|
};
|
|
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,
|
|
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;
|
|
110
|
+
waitFor: boolean | undefined;
|
|
97
111
|
};
|
|
98
|
-
edit: (eventId: string, input?: Partial<Pick<EditActionInput,
|
|
112
|
+
edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
113
|
+
keepAssignment?: boolean | undefined;
|
|
114
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
115
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
116
|
+
waitFor?: boolean | undefined;
|
|
117
|
+
type: "EDIT";
|
|
99
118
|
transactionId: string;
|
|
100
119
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
101
120
|
annotation: {};
|
|
102
|
-
keepAssignment?: boolean | undefined;
|
|
103
|
-
type: "EDIT";
|
|
104
121
|
eventId: string;
|
|
105
122
|
};
|
|
106
|
-
assign: (eventId: string, input?: Partial<Pick<AssignActionInput,
|
|
123
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo' | 'waitFor'>>) => {
|
|
107
124
|
type: "ASSIGN";
|
|
108
125
|
transactionId: string;
|
|
109
126
|
declaration: {};
|
|
110
127
|
assignedTo: string;
|
|
111
128
|
eventId: string;
|
|
129
|
+
waitFor: boolean | undefined;
|
|
112
130
|
};
|
|
113
|
-
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput,
|
|
131
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId' | 'waitFor'>>) => {
|
|
114
132
|
type: "UNASSIGN";
|
|
115
133
|
transactionId: string;
|
|
116
134
|
declaration: {};
|
|
117
135
|
assignedTo: null;
|
|
118
136
|
eventId: string;
|
|
137
|
+
waitFor: boolean | undefined;
|
|
119
138
|
};
|
|
120
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput,
|
|
121
|
-
transactionId: string;
|
|
122
|
-
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
139
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
123
140
|
keepAssignment?: boolean | undefined;
|
|
141
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
142
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
143
|
+
waitFor?: boolean | undefined;
|
|
124
144
|
type: "ARCHIVE";
|
|
145
|
+
transactionId: string;
|
|
146
|
+
declaration: {};
|
|
125
147
|
annotation: {};
|
|
126
148
|
eventId: string;
|
|
127
|
-
content: {
|
|
128
|
-
reason: string;
|
|
129
|
-
};
|
|
130
149
|
};
|
|
131
|
-
unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput,
|
|
132
|
-
transactionId: string;
|
|
133
|
-
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
150
|
+
unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
134
151
|
keepAssignment?: boolean | undefined;
|
|
152
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
153
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
154
|
+
waitFor?: boolean | undefined;
|
|
135
155
|
type: "UNARCHIVE";
|
|
156
|
+
transactionId: string;
|
|
157
|
+
declaration: {};
|
|
136
158
|
annotation: {};
|
|
137
159
|
eventId: string;
|
|
138
160
|
};
|
|
139
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput,
|
|
140
|
-
transactionId: string;
|
|
141
|
-
annotation: {};
|
|
161
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
142
162
|
keepAssignment?: boolean | undefined;
|
|
163
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
164
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
165
|
+
waitFor?: boolean | undefined;
|
|
143
166
|
type: "REJECT";
|
|
167
|
+
transactionId: string;
|
|
144
168
|
declaration: {};
|
|
169
|
+
annotation: {};
|
|
145
170
|
eventId: string;
|
|
146
171
|
content: {
|
|
147
172
|
reason: string;
|
|
148
173
|
};
|
|
149
174
|
};
|
|
150
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput,
|
|
175
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
|
|
176
|
+
keepAssignment?: boolean | undefined;
|
|
177
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
178
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
179
|
+
waitFor?: boolean | undefined;
|
|
180
|
+
registrationNumber?: string | undefined;
|
|
181
|
+
type: "REGISTER";
|
|
151
182
|
transactionId: string;
|
|
152
183
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
153
184
|
annotation: {};
|
|
154
|
-
registrationNumber?: string | undefined;
|
|
155
|
-
keepAssignment?: boolean | undefined;
|
|
156
|
-
type: "REGISTER";
|
|
157
185
|
eventId: string;
|
|
158
186
|
};
|
|
159
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput,
|
|
160
|
-
transactionId: string;
|
|
161
|
-
annotation: {};
|
|
187
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
162
188
|
keepAssignment?: boolean | undefined;
|
|
189
|
+
keepAssignmentIfAccepted?: boolean | undefined;
|
|
190
|
+
keepAssignmentIfRejected?: boolean | undefined;
|
|
191
|
+
waitFor?: boolean | undefined;
|
|
163
192
|
type: "PRINT_CERTIFICATE";
|
|
193
|
+
transactionId: string;
|
|
164
194
|
declaration: {};
|
|
195
|
+
annotation: {};
|
|
165
196
|
eventId: string;
|
|
166
197
|
};
|
|
167
198
|
correction: {
|
|
168
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput,
|
|
199
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
169
200
|
type: "REQUEST_CORRECTION";
|
|
170
201
|
transactionId: string;
|
|
171
|
-
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
202
|
+
declaration: import("lodash").Omit<Record<string, import("./FieldValue").FieldUpdateValue>, "applicant.email" | "applicant.image">;
|
|
172
203
|
annotation: {};
|
|
173
204
|
eventId: string;
|
|
174
205
|
keepAssignment: boolean | undefined;
|
|
206
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
207
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
208
|
+
waitFor: boolean | undefined;
|
|
175
209
|
};
|
|
176
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput,
|
|
210
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
177
211
|
type: "APPROVE_CORRECTION";
|
|
178
212
|
transactionId: string;
|
|
179
213
|
declaration: {};
|
|
@@ -181,22 +215,28 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
181
215
|
eventId: string;
|
|
182
216
|
requestId: string;
|
|
183
217
|
keepAssignment: boolean | undefined;
|
|
218
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
219
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
220
|
+
waitFor: boolean | undefined;
|
|
184
221
|
};
|
|
185
|
-
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput,
|
|
222
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'content' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
|
|
186
223
|
type: "REJECT_CORRECTION";
|
|
187
224
|
transactionId: string;
|
|
188
225
|
declaration: {};
|
|
189
226
|
annotation: {};
|
|
190
227
|
eventId: string;
|
|
191
228
|
requestId: string;
|
|
192
|
-
keepAssignment: boolean | undefined;
|
|
193
229
|
content: {
|
|
194
230
|
reason: string;
|
|
195
231
|
};
|
|
232
|
+
keepAssignment: boolean | undefined;
|
|
233
|
+
keepAssignmentIfAccepted: boolean | undefined;
|
|
234
|
+
keepAssignmentIfRejected: boolean | undefined;
|
|
235
|
+
waitFor: boolean | undefined;
|
|
196
236
|
};
|
|
197
237
|
};
|
|
198
238
|
duplicate: {
|
|
199
|
-
markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput,
|
|
239
|
+
markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
200
240
|
type: "MARK_AS_DUPLICATE";
|
|
201
241
|
transactionId: string;
|
|
202
242
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
@@ -204,7 +244,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
204
244
|
eventId: string;
|
|
205
245
|
keepAssignment: boolean | undefined;
|
|
206
246
|
};
|
|
207
|
-
markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput,
|
|
247
|
+
markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
208
248
|
type: "MARK_AS_NOT_DUPLICATE";
|
|
209
249
|
transactionId: string;
|
|
210
250
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
@@ -285,10 +325,28 @@ export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
|
|
285
325
|
* @param placeOfEventId - Optional place of event field id.
|
|
286
326
|
* @param dateOfEventId - Optional date of event field id.
|
|
287
327
|
*/
|
|
288
|
-
export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfEventId }: {
|
|
328
|
+
export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfEventId, actions }: {
|
|
289
329
|
id: string;
|
|
290
330
|
fields: FieldConfig[];
|
|
291
331
|
placeOfEventId?: string;
|
|
292
332
|
dateOfEventId?: string;
|
|
333
|
+
/** Extra actions appended to the default READ + DECLARE pair, e.g. a REQUEST_CORRECTION action with its own correctionForm. */
|
|
334
|
+
actions?: EventConfigInput['actions'];
|
|
293
335
|
}) => EventConfig;
|
|
336
|
+
/**
|
|
337
|
+
* Get the leaf administrative area IDs from a list of administrative areas.
|
|
338
|
+
*
|
|
339
|
+
* A leaf administrative area is defined as an administrative area that does not have any children in the provided list.
|
|
340
|
+
* AdministrativeArea might have a CRVS_OFFICE as children, but is still considered to be a leaf administrative area.
|
|
341
|
+
*
|
|
342
|
+
* @param administrativeAreas - The list of administrative areas to search.
|
|
343
|
+
* @returns The list of leaf administrative area IDs.
|
|
344
|
+
*/
|
|
345
|
+
export declare function getLeafAdministrativeAreaIds(administrativeAreas: Map<UUID, ClientAdministrativeArea>): Array<{
|
|
346
|
+
id: UUID;
|
|
347
|
+
}>;
|
|
348
|
+
export declare function generateTestValidatorContext(userRole?: TestUserRole, eventWithConfig?: {
|
|
349
|
+
event: EventDocument;
|
|
350
|
+
eventConfig: EventConfig;
|
|
351
|
+
}): ValidatorContext;
|
|
294
352
|
//# sourceMappingURL=test.utils.d.ts.map
|