@opencrvs/toolkit 1.8.0-rc.ffe24c3 → 1.8.1-rc.1e3e9b5
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/dist/commons/api/router.d.ts +1742 -14918
- package/dist/commons/conditionals/conditionals.d.ts +0 -12
- package/dist/commons/conditionals/validate.d.ts +5 -0
- package/dist/commons/events/ActionConfig.d.ts +37041 -35133
- package/dist/commons/events/ActionDocument.d.ts +3159 -1626
- package/dist/commons/events/ActionInput.d.ts +2280 -1380
- package/dist/commons/events/ActionType.d.ts +7 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +100 -51
- package/dist/commons/events/CompositeFieldValue.d.ts +15 -15
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1162 -760
- package/dist/commons/events/Draft.d.ts +190 -118
- package/dist/commons/events/EventConfig.d.ts +20824 -22965
- package/dist/commons/events/EventDocument.d.ts +1669 -1021
- package/dist/commons/events/EventIndex.d.ts +394 -175
- package/dist/commons/events/EventMetadata.d.ts +6 -4
- package/dist/commons/events/FieldConfig.d.ts +1528 -449
- package/dist/commons/events/FieldType.d.ts +3 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +80 -41
- package/dist/commons/events/FieldValue.d.ts +58 -28
- package/dist/commons/events/FormConfig.d.ts +9263 -2657
- package/dist/commons/events/PageConfig.d.ts +3642 -2028
- package/dist/commons/events/SummaryConfig.d.ts +10 -10
- package/dist/commons/events/User.d.ts +6 -3
- package/dist/commons/events/WorkqueueConfig.d.ts +2153 -1337
- package/dist/commons/events/defineConfig.d.ts +2759 -3250
- package/dist/commons/events/event.d.ts +10 -18
- package/dist/commons/events/field.d.ts +13 -1
- package/dist/commons/events/scopes.d.ts +2 -1
- package/dist/commons/events/test.utils.d.ts +58 -34
- package/dist/commons/events/utils.d.ts +8848 -6794
- package/dist/conditionals/index.js +23 -53
- package/dist/events/index.js +1594 -1341
- package/dist/scopes/index.d.ts +92 -6
- package/dist/scopes/index.js +38 -9
- package/package.json +3 -3
@@ -1,5 +1,5 @@
|
|
1
|
+
import { ActionType } from './ActionType';
|
1
2
|
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
-
import { SelectOption } from './FieldConfig';
|
3
3
|
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
4
|
/**
|
5
5
|
* Creates a function that acts like a callable + static method container.
|
@@ -8,13 +8,9 @@ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConf
|
|
8
8
|
* event('status') // → returns search config
|
9
9
|
* event.hasAction('CLICKED') // → returns conditional
|
10
10
|
*/
|
11
|
-
declare function eventFn(fieldId: EventFieldId
|
11
|
+
declare function eventFn(fieldId: EventFieldId): {
|
12
12
|
range: () => {
|
13
|
-
fieldId: "status" | "updatedAt" | "trackingId" | "
|
14
|
-
options: {
|
15
|
-
value: string;
|
16
|
-
label: import("./TranslationConfig").TranslationConfig;
|
17
|
-
}[] | undefined;
|
13
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
|
18
14
|
fieldType: "event";
|
19
15
|
} & {
|
20
16
|
config: {
|
@@ -22,11 +18,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
22
18
|
};
|
23
19
|
};
|
24
20
|
exact: () => {
|
25
|
-
fieldId: "status" | "updatedAt" | "trackingId" | "
|
26
|
-
options: {
|
27
|
-
value: string;
|
28
|
-
label: import("./TranslationConfig").TranslationConfig;
|
29
|
-
}[] | undefined;
|
21
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
|
30
22
|
fieldType: "event";
|
31
23
|
} & {
|
32
24
|
config: {
|
@@ -34,11 +26,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
34
26
|
};
|
35
27
|
};
|
36
28
|
fuzzy: () => {
|
37
|
-
fieldId: "status" | "updatedAt" | "trackingId" | "
|
38
|
-
options: {
|
39
|
-
value: string;
|
40
|
-
label: import("./TranslationConfig").TranslationConfig;
|
41
|
-
}[] | undefined;
|
29
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
|
42
30
|
fieldType: "event";
|
43
31
|
} & {
|
44
32
|
config: {
|
@@ -47,8 +35,12 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
47
35
|
};
|
48
36
|
};
|
49
37
|
declare const event: typeof eventFn & {
|
38
|
+
/**
|
39
|
+
* Checks if the event contains a specific action type.
|
40
|
+
* @param action - The action type to check for.
|
41
|
+
*/
|
42
|
+
hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
|
50
43
|
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
51
|
-
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
52
44
|
};
|
53
45
|
export { event };
|
54
46
|
//# sourceMappingURL=event.d.ts.map
|
@@ -1,17 +1,23 @@
|
|
1
1
|
import { FieldConditional } from './Conditional';
|
2
2
|
import { TranslationConfig } from './TranslationConfig';
|
3
|
-
import { ValidationConfig } from './FieldConfig';
|
3
|
+
import { SelectOption, ValidationConfig } from './FieldConfig';
|
4
4
|
/**
|
5
5
|
* Entry point for defining conditional logic or configuration for a form field.
|
6
6
|
* @param fieldId - The ID of the field to define rules or config for.
|
7
7
|
* @returns An object combining conditional methods and configuration builders.
|
8
8
|
*/
|
9
9
|
export declare function field(fieldId: string, options?: {
|
10
|
+
options?: SelectOption[];
|
11
|
+
excludeInSearchQuery?: boolean;
|
12
|
+
alternateFieldIds?: string[];
|
10
13
|
conditionals?: FieldConditional[];
|
11
14
|
validations?: ValidationConfig[];
|
12
15
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
13
16
|
}): {
|
14
17
|
range: () => {
|
18
|
+
options?: SelectOption[];
|
19
|
+
excludeInSearchQuery?: boolean;
|
20
|
+
alternateFieldIds?: string[];
|
15
21
|
conditionals?: FieldConditional[];
|
16
22
|
validations?: ValidationConfig[];
|
17
23
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
@@ -23,6 +29,9 @@ export declare function field(fieldId: string, options?: {
|
|
23
29
|
};
|
24
30
|
};
|
25
31
|
exact: () => {
|
32
|
+
options?: SelectOption[];
|
33
|
+
excludeInSearchQuery?: boolean;
|
34
|
+
alternateFieldIds?: string[];
|
26
35
|
conditionals?: FieldConditional[];
|
27
36
|
validations?: ValidationConfig[];
|
28
37
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
@@ -34,6 +43,9 @@ export declare function field(fieldId: string, options?: {
|
|
34
43
|
};
|
35
44
|
};
|
36
45
|
fuzzy: () => {
|
46
|
+
options?: SelectOption[];
|
47
|
+
excludeInSearchQuery?: boolean;
|
48
|
+
alternateFieldIds?: string[];
|
37
49
|
conditionals?: FieldConditional[];
|
38
50
|
validations?: ValidationConfig[];
|
39
51
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
@@ -10,7 +10,8 @@ export declare const ACTION_ALLOWED_SCOPES: {
|
|
10
10
|
VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
|
11
11
|
REGISTER: ["record.register"];
|
12
12
|
PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
|
13
|
-
REQUEST_CORRECTION: ["record.registration-request-correction"];
|
13
|
+
REQUEST_CORRECTION: ["record.registration-request-correction", "record.registration-correct"];
|
14
|
+
REVIEW_CORRECTION_REQUEST: ["record.registration-correct"];
|
14
15
|
REJECT_CORRECTION: ["record.registration-correct"];
|
15
16
|
APPROVE_CORRECTION: ["record.registration-correct"];
|
16
17
|
MARKED_AS_DUPLICATE: ["record.declaration-archive"];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { UUID } from '../uuid';
|
2
2
|
import { ActionDocument, EventState } from './ActionDocument';
|
3
|
-
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
3
|
+
import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
4
4
|
import { ActionType } from './ActionType';
|
5
5
|
import { Draft } from './Draft';
|
6
6
|
import { EventConfig } from './EventConfig';
|
@@ -12,6 +12,11 @@ import { FieldConfig } from './FieldConfig';
|
|
12
12
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
13
13
|
import { FieldValue } from './FieldValue';
|
14
14
|
import { z } from 'zod';
|
15
|
+
/**
|
16
|
+
* IANA timezone used in testing. Used for queries that expect similar results independent of the users location (e.g. when event was registered.)
|
17
|
+
* Since we query by range, providing UTC offset will result to different results when DST changes during the range.
|
18
|
+
*/
|
19
|
+
export declare const TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
15
20
|
/**
|
16
21
|
* In real application, the roles are defined in the countryconfig.
|
17
22
|
* These are just for testing purposes to generate realistic mock data.
|
@@ -38,16 +43,17 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
38
43
|
type: string;
|
39
44
|
id: string;
|
40
45
|
};
|
41
|
-
draft: ({ eventId, actionType }: {
|
46
|
+
draft: ({ eventId, actionType, annotation }: {
|
42
47
|
eventId: UUID;
|
43
48
|
actionType: ActionType;
|
49
|
+
annotation?: Record<string, any>;
|
44
50
|
}, input?: Partial<Draft>) => Draft;
|
45
51
|
actions: {
|
46
52
|
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
47
53
|
transactionId: string;
|
48
54
|
declaration: Record<string, string | number | boolean | {
|
49
55
|
type: string;
|
50
|
-
|
56
|
+
path: string;
|
51
57
|
originalFilename: string;
|
52
58
|
} | {
|
53
59
|
country: string;
|
@@ -61,8 +67,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
61
67
|
street?: string | null | undefined;
|
62
68
|
zipCode?: string | null | undefined;
|
63
69
|
} | {
|
64
|
-
firstname
|
65
|
-
surname
|
70
|
+
firstname?: string | null | undefined;
|
71
|
+
surname?: string | null | undefined;
|
66
72
|
middlename?: string | null | undefined;
|
67
73
|
} | {
|
68
74
|
country: string;
|
@@ -84,9 +90,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
84
90
|
} | {
|
85
91
|
type: string;
|
86
92
|
option: string;
|
87
|
-
|
93
|
+
path: string;
|
88
94
|
originalFilename: string;
|
89
|
-
}[] |
|
95
|
+
}[] | {
|
96
|
+
start: string;
|
97
|
+
end: string;
|
98
|
+
} | null | undefined>;
|
90
99
|
annotation: {};
|
91
100
|
keepAssignment?: boolean | undefined;
|
92
101
|
type: "DECLARE";
|
@@ -100,7 +109,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
100
109
|
transactionId: string;
|
101
110
|
declaration: Record<string, string | number | boolean | {
|
102
111
|
type: string;
|
103
|
-
|
112
|
+
path: string;
|
104
113
|
originalFilename: string;
|
105
114
|
} | {
|
106
115
|
country: string;
|
@@ -114,8 +123,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
114
123
|
street?: string | null | undefined;
|
115
124
|
zipCode?: string | null | undefined;
|
116
125
|
} | {
|
117
|
-
firstname
|
118
|
-
surname
|
126
|
+
firstname?: string | null | undefined;
|
127
|
+
surname?: string | null | undefined;
|
119
128
|
middlename?: string | null | undefined;
|
120
129
|
} | {
|
121
130
|
country: string;
|
@@ -137,9 +146,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
137
146
|
} | {
|
138
147
|
type: string;
|
139
148
|
option: string;
|
140
|
-
|
149
|
+
path: string;
|
141
150
|
originalFilename: string;
|
142
|
-
}[] |
|
151
|
+
}[] | {
|
152
|
+
start: string;
|
153
|
+
end: string;
|
154
|
+
} | null | undefined>;
|
143
155
|
eventId: string;
|
144
156
|
keepAssignment: boolean | undefined;
|
145
157
|
};
|
@@ -147,7 +159,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
147
159
|
transactionId: string;
|
148
160
|
declaration: Record<string, string | number | boolean | {
|
149
161
|
type: string;
|
150
|
-
|
162
|
+
path: string;
|
151
163
|
originalFilename: string;
|
152
164
|
} | {
|
153
165
|
country: string;
|
@@ -161,8 +173,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
161
173
|
street?: string | null | undefined;
|
162
174
|
zipCode?: string | null | undefined;
|
163
175
|
} | {
|
164
|
-
firstname
|
165
|
-
surname
|
176
|
+
firstname?: string | null | undefined;
|
177
|
+
surname?: string | null | undefined;
|
166
178
|
middlename?: string | null | undefined;
|
167
179
|
} | {
|
168
180
|
country: string;
|
@@ -184,9 +196,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
184
196
|
} | {
|
185
197
|
type: string;
|
186
198
|
option: string;
|
187
|
-
|
199
|
+
path: string;
|
188
200
|
originalFilename: string;
|
189
|
-
}[] |
|
201
|
+
}[] | {
|
202
|
+
start: string;
|
203
|
+
end: string;
|
204
|
+
} | null | undefined>;
|
190
205
|
annotation: {};
|
191
206
|
keepAssignment?: boolean | undefined;
|
192
207
|
type: "VALIDATE";
|
@@ -211,7 +226,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
211
226
|
transactionId: string;
|
212
227
|
declaration: Record<string, string | number | boolean | {
|
213
228
|
type: string;
|
214
|
-
|
229
|
+
path: string;
|
215
230
|
originalFilename: string;
|
216
231
|
} | {
|
217
232
|
country: string;
|
@@ -225,8 +240,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
225
240
|
street?: string | null | undefined;
|
226
241
|
zipCode?: string | null | undefined;
|
227
242
|
} | {
|
228
|
-
firstname
|
229
|
-
surname
|
243
|
+
firstname?: string | null | undefined;
|
244
|
+
surname?: string | null | undefined;
|
230
245
|
middlename?: string | null | undefined;
|
231
246
|
} | {
|
232
247
|
country: string;
|
@@ -248,9 +263,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
248
263
|
} | {
|
249
264
|
type: string;
|
250
265
|
option: string;
|
251
|
-
|
266
|
+
path: string;
|
252
267
|
originalFilename: string;
|
253
|
-
}[] |
|
268
|
+
}[] | {
|
269
|
+
start: string;
|
270
|
+
end: string;
|
271
|
+
} | null | undefined>;
|
254
272
|
keepAssignment?: boolean | undefined;
|
255
273
|
type: "ARCHIVE";
|
256
274
|
annotation: {};
|
@@ -277,7 +295,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
277
295
|
transactionId: string;
|
278
296
|
declaration: Record<string, string | number | boolean | {
|
279
297
|
type: string;
|
280
|
-
|
298
|
+
path: string;
|
281
299
|
originalFilename: string;
|
282
300
|
} | {
|
283
301
|
country: string;
|
@@ -291,8 +309,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
291
309
|
street?: string | null | undefined;
|
292
310
|
zipCode?: string | null | undefined;
|
293
311
|
} | {
|
294
|
-
firstname
|
295
|
-
surname
|
312
|
+
firstname?: string | null | undefined;
|
313
|
+
surname?: string | null | undefined;
|
296
314
|
middlename?: string | null | undefined;
|
297
315
|
} | {
|
298
316
|
country: string;
|
@@ -314,9 +332,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
314
332
|
} | {
|
315
333
|
type: string;
|
316
334
|
option: string;
|
317
|
-
|
335
|
+
path: string;
|
318
336
|
originalFilename: string;
|
319
|
-
}[] |
|
337
|
+
}[] | {
|
338
|
+
start: string;
|
339
|
+
end: string;
|
340
|
+
} | null | undefined>;
|
320
341
|
annotation: {};
|
321
342
|
registrationNumber?: string | undefined;
|
322
343
|
keepAssignment?: boolean | undefined;
|
@@ -337,7 +358,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
337
358
|
transactionId: string;
|
338
359
|
declaration: Record<string, string | number | boolean | {
|
339
360
|
type: string;
|
340
|
-
|
361
|
+
path: string;
|
341
362
|
originalFilename: string;
|
342
363
|
} | {
|
343
364
|
country: string;
|
@@ -351,8 +372,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
351
372
|
street?: string | null | undefined;
|
352
373
|
zipCode?: string | null | undefined;
|
353
374
|
} | {
|
354
|
-
firstname
|
355
|
-
surname
|
375
|
+
firstname?: string | null | undefined;
|
376
|
+
surname?: string | null | undefined;
|
356
377
|
middlename?: string | null | undefined;
|
357
378
|
} | {
|
358
379
|
country: string;
|
@@ -374,14 +395,17 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
374
395
|
} | {
|
375
396
|
type: string;
|
376
397
|
option: string;
|
377
|
-
|
398
|
+
path: string;
|
378
399
|
originalFilename: string;
|
379
|
-
}[] |
|
400
|
+
}[] | {
|
401
|
+
start: string;
|
402
|
+
end: string;
|
403
|
+
} | null | undefined>;
|
380
404
|
annotation: {};
|
381
405
|
eventId: string;
|
382
406
|
keepAssignment: boolean | undefined;
|
383
407
|
};
|
384
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<
|
408
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
385
409
|
type: "APPROVE_CORRECTION";
|
386
410
|
transactionId: string;
|
387
411
|
declaration: {};
|
@@ -390,7 +414,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
390
414
|
requestId: string;
|
391
415
|
keepAssignment: boolean | undefined;
|
392
416
|
};
|
393
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<
|
417
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
394
418
|
type: "REJECT_CORRECTION";
|
395
419
|
transactionId: string;
|
396
420
|
declaration: {};
|