@opencrvs/toolkit 2.1.0-rc.b0003b1 → 2.1.0-rc.b263ac1
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 +1 -0
- package/build.sh +2 -2
- package/dist/application-config/index.js +244 -197
- package/dist/cli.js +347 -5220
- package/dist/commons/api/router.d.ts +3730 -2896
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +32 -323
- package/dist/commons/conditionals/validate.d.ts +11 -4
- package/dist/commons/events/ActionConfig.d.ts +279 -70
- package/dist/commons/events/ActionDocument.d.ts +153 -115
- package/dist/commons/events/ActionInput.d.ts +26 -6
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +63 -58
- package/dist/commons/events/AdvancedSearchConfig.d.ts +525 -501
- package/dist/commons/events/AuditLog.d.ts +189 -40
- 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 +37 -35
- 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 +66 -44
- package/dist/commons/events/EventIndex.d.ts +49 -72
- package/dist/commons/events/EventMetadata.d.ts +40 -40
- package/dist/commons/events/FieldConfig.d.ts +411 -384
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +90 -90
- package/dist/commons/events/FieldValue.d.ts +14 -14
- package/dist/commons/events/Flag.d.ts +57 -15
- 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 +822 -816
- 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 +69 -198
- 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 +192 -12
- package/dist/commons/events/mocks.test.utils.d.ts +48 -4
- package/dist/commons/events/scopes.d.ts +5 -4
- 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 +44 -39
- package/dist/commons/events/utils.d.ts +127 -105
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/conditionals/index.js +309 -57
- package/dist/environment/derived-variables.d.ts +119 -131
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +0 -14
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +10 -0
- package/dist/environment/logger.d.ts +3 -3
- package/dist/environment/manage-users.js +17 -7
- 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/setup-environment.js +10 -29
- package/dist/environment/swarm-to-k8s.js +17 -7
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +2 -1
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +34 -12
- 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 +28 -20
- package/dist/environment/utils.d.ts +1 -1
- package/dist/environment/utils.js +17 -7
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +3650 -3145
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/index.js +88 -5144
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +218 -0
- package/dist/notification/index.js +2019 -1072
- package/dist/scopes/index.d.ts +437 -163
- package/dist/scopes/index.js +310 -57
- package/dist/templates/charts-values/dependencies/values.yaml +0 -3
- package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -7
- package/dist/templates/charts-values/opentelemetry/values.yaml +73 -0
- package/opencrvs-toolkit-2.1.0-rc.b263ac1.tgz +0 -0
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.b0003b1.tgz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UUID } from '../uuid';
|
|
2
2
|
import { ActionDocument, ActionUpdate } from './ActionDocument';
|
|
3
|
-
import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput } from './ActionInput';
|
|
3
|
+
import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnarchiveActionInput, UnassignActionInput } from './ActionInput';
|
|
4
4
|
import { ActionType } from './ActionType';
|
|
5
5
|
import { Draft } from './Draft';
|
|
6
6
|
import { EventConfig } from './EventConfig';
|
|
@@ -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 {
|
|
12
|
+
import { SetLocationPayload, SetAdministrativeAreaPayload } 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";
|
|
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;
|
|
@@ -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:
|
|
52
|
-
locations:
|
|
51
|
+
administrativeAreas: SetAdministrativeAreaPayload[];
|
|
52
|
+
locations: SetLocationPayload[];
|
|
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:
|
|
60
|
-
locations:
|
|
59
|
+
administrativeAreas: SetAdministrativeAreaPayload[];
|
|
60
|
+
locations: SetLocationPayload[];
|
|
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,103 +72,108 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
72
72
|
};
|
|
73
73
|
draft: ({ eventId, actionType, annotation, omitFields }: {
|
|
74
74
|
eventId: UUID;
|
|
75
|
-
actionType: Draft[
|
|
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,
|
|
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,
|
|
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,
|
|
98
|
+
edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
99
|
+
keepAssignment?: boolean | undefined;
|
|
100
|
+
type: "EDIT";
|
|
99
101
|
transactionId: string;
|
|
100
102
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
101
103
|
annotation: {};
|
|
102
|
-
keepAssignment?: boolean | undefined;
|
|
103
|
-
type: "EDIT";
|
|
104
|
-
content: {
|
|
105
|
-
comment: string;
|
|
106
|
-
};
|
|
107
104
|
eventId: string;
|
|
108
105
|
};
|
|
109
|
-
assign: (eventId: string, input?: Partial<Pick<AssignActionInput,
|
|
106
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo'>>) => {
|
|
110
107
|
type: "ASSIGN";
|
|
111
108
|
transactionId: string;
|
|
112
109
|
declaration: {};
|
|
113
110
|
assignedTo: string;
|
|
114
111
|
eventId: string;
|
|
115
112
|
};
|
|
116
|
-
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput,
|
|
113
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId'>>) => {
|
|
117
114
|
type: "UNASSIGN";
|
|
118
115
|
transactionId: string;
|
|
119
116
|
declaration: {};
|
|
120
117
|
assignedTo: null;
|
|
121
118
|
eventId: string;
|
|
122
119
|
};
|
|
123
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput,
|
|
124
|
-
transactionId: string;
|
|
125
|
-
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
120
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
|
|
126
121
|
keepAssignment?: boolean | undefined;
|
|
127
122
|
type: "ARCHIVE";
|
|
123
|
+
transactionId: string;
|
|
124
|
+
declaration: {};
|
|
128
125
|
annotation: {};
|
|
129
126
|
eventId: string;
|
|
130
127
|
content: {
|
|
131
128
|
reason: string;
|
|
132
129
|
};
|
|
133
130
|
};
|
|
134
|
-
|
|
131
|
+
unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
|
|
132
|
+
keepAssignment?: boolean | undefined;
|
|
133
|
+
type: "UNARCHIVE";
|
|
135
134
|
transactionId: string;
|
|
135
|
+
declaration: {};
|
|
136
136
|
annotation: {};
|
|
137
|
+
eventId: string;
|
|
138
|
+
};
|
|
139
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
|
|
137
140
|
keepAssignment?: boolean | undefined;
|
|
138
141
|
type: "REJECT";
|
|
142
|
+
transactionId: string;
|
|
139
143
|
declaration: {};
|
|
144
|
+
annotation: {};
|
|
140
145
|
eventId: string;
|
|
141
146
|
content: {
|
|
142
147
|
reason: string;
|
|
143
148
|
};
|
|
144
149
|
};
|
|
145
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput,
|
|
150
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber'>>) => {
|
|
151
|
+
keepAssignment?: boolean | undefined;
|
|
152
|
+
registrationNumber?: string | undefined;
|
|
153
|
+
type: "REGISTER";
|
|
146
154
|
transactionId: string;
|
|
147
155
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
148
156
|
annotation: {};
|
|
149
|
-
registrationNumber?: string | undefined;
|
|
150
|
-
keepAssignment?: boolean | undefined;
|
|
151
|
-
type: "REGISTER";
|
|
152
157
|
eventId: string;
|
|
153
158
|
};
|
|
154
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput,
|
|
155
|
-
transactionId: string;
|
|
156
|
-
annotation: {};
|
|
159
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
|
|
157
160
|
keepAssignment?: boolean | undefined;
|
|
158
161
|
type: "PRINT_CERTIFICATE";
|
|
162
|
+
transactionId: string;
|
|
159
163
|
declaration: {};
|
|
164
|
+
annotation: {};
|
|
160
165
|
eventId: string;
|
|
161
166
|
};
|
|
162
167
|
correction: {
|
|
163
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput,
|
|
168
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
164
169
|
type: "REQUEST_CORRECTION";
|
|
165
170
|
transactionId: string;
|
|
166
|
-
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
171
|
+
declaration: import("lodash").Omit<Record<string, import("./FieldValue").FieldUpdateValue>, "applicant.email" | "applicant.image">;
|
|
167
172
|
annotation: {};
|
|
168
173
|
eventId: string;
|
|
169
174
|
keepAssignment: boolean | undefined;
|
|
170
175
|
};
|
|
171
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput,
|
|
176
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
|
|
172
177
|
type: "APPROVE_CORRECTION";
|
|
173
178
|
transactionId: string;
|
|
174
179
|
declaration: {};
|
|
@@ -177,7 +182,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
177
182
|
requestId: string;
|
|
178
183
|
keepAssignment: boolean | undefined;
|
|
179
184
|
};
|
|
180
|
-
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput,
|
|
185
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'content'>>) => {
|
|
181
186
|
type: "REJECT_CORRECTION";
|
|
182
187
|
transactionId: string;
|
|
183
188
|
declaration: {};
|
|
@@ -191,7 +196,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
191
196
|
};
|
|
192
197
|
};
|
|
193
198
|
duplicate: {
|
|
194
|
-
markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput,
|
|
199
|
+
markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
195
200
|
type: "MARK_AS_DUPLICATE";
|
|
196
201
|
transactionId: string;
|
|
197
202
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|
|
@@ -199,7 +204,7 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
|
|
|
199
204
|
eventId: string;
|
|
200
205
|
keepAssignment: boolean | undefined;
|
|
201
206
|
};
|
|
202
|
-
markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput,
|
|
207
|
+
markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
|
|
203
208
|
type: "MARK_AS_NOT_DUPLICATE";
|
|
204
209
|
transactionId: string;
|
|
205
210
|
declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
|