@opencrvs/toolkit 1.8.0-rc.fe4d9d5 → 1.8.0-rc.fe7c504
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 +1335 -10468
- package/dist/commons/events/ActionConfig.d.ts +2600 -0
- package/dist/commons/events/ActionDocument.d.ts +1081 -1087
- package/dist/commons/events/ActionInput.d.ts +726 -726
- package/dist/commons/events/ActionType.d.ts +0 -2
- package/dist/commons/events/AdvancedSearchConfig.d.ts +222 -18
- package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1234 -572
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -2
- package/dist/commons/events/Draft.d.ts +77 -77
- package/dist/commons/events/EventConfig.d.ts +1458 -0
- package/dist/commons/events/EventDocument.d.ts +706 -711
- package/dist/commons/events/EventIndex.d.ts +135 -151
- package/dist/commons/events/EventMetadata.d.ts +38 -29
- package/dist/commons/events/FieldConfig.d.ts +178 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/FormConfig.d.ts +1092 -0
- package/dist/commons/events/PageConfig.d.ts +260 -0
- package/dist/commons/events/User.d.ts +6 -3
- package/dist/commons/events/WorkqueueConfig.d.ts +2043 -1033
- package/dist/commons/events/defineConfig.d.ts +294 -0
- package/dist/commons/events/field.d.ts +5 -0
- package/dist/commons/events/test.utils.d.ts +30 -19
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +440 -15
- package/dist/conditionals/index.js +22 -18
- package/dist/events/index.js +303 -185
- package/dist/scopes/index.d.ts +92 -6
- package/dist/scopes/index.js +38 -9
- package/package.json +3 -3
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FieldConditional } from './Conditional';
|
2
2
|
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
import { ValidationConfig } from './FieldConfig';
|
3
4
|
/**
|
4
5
|
* Entry point for defining conditional logic or configuration for a form field.
|
5
6
|
* @param fieldId - The ID of the field to define rules or config for.
|
@@ -7,10 +8,12 @@ import { TranslationConfig } from './TranslationConfig';
|
|
7
8
|
*/
|
8
9
|
export declare function field(fieldId: string, options?: {
|
9
10
|
conditionals?: FieldConditional[];
|
11
|
+
validations?: ValidationConfig[];
|
10
12
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
13
|
}): {
|
12
14
|
range: () => {
|
13
15
|
conditionals?: FieldConditional[];
|
16
|
+
validations?: ValidationConfig[];
|
14
17
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
15
18
|
fieldId: string;
|
16
19
|
fieldType: "field";
|
@@ -21,6 +24,7 @@ export declare function field(fieldId: string, options?: {
|
|
21
24
|
};
|
22
25
|
exact: () => {
|
23
26
|
conditionals?: FieldConditional[];
|
27
|
+
validations?: ValidationConfig[];
|
24
28
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
29
|
fieldId: string;
|
26
30
|
fieldType: "field";
|
@@ -31,6 +35,7 @@ export declare function field(fieldId: string, options?: {
|
|
31
35
|
};
|
32
36
|
fuzzy: () => {
|
33
37
|
conditionals?: FieldConditional[];
|
38
|
+
validations?: ValidationConfig[];
|
34
39
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
35
40
|
fieldId: string;
|
36
41
|
fieldType: "field";
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { UUID } from '../uuid';
|
1
2
|
import { ActionDocument, EventState } from './ActionDocument';
|
2
3
|
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
3
4
|
import { ActionType } from './ActionType';
|
@@ -37,9 +38,10 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
37
38
|
type: string;
|
38
39
|
id: string;
|
39
40
|
};
|
40
|
-
draft: ({ eventId, actionType }: {
|
41
|
-
eventId:
|
41
|
+
draft: ({ eventId, actionType, annotation }: {
|
42
|
+
eventId: UUID;
|
42
43
|
actionType: ActionType;
|
44
|
+
annotation?: Record<string, any>;
|
43
45
|
}, input?: Partial<Draft>) => Draft;
|
44
46
|
actions: {
|
45
47
|
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
@@ -60,8 +62,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
60
62
|
street?: string | null | undefined;
|
61
63
|
zipCode?: string | null | undefined;
|
62
64
|
} | {
|
63
|
-
firstname
|
64
|
-
surname
|
65
|
+
firstname?: string | null | undefined;
|
66
|
+
surname?: string | null | undefined;
|
65
67
|
middlename?: string | null | undefined;
|
66
68
|
} | {
|
67
69
|
country: string;
|
@@ -113,8 +115,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
113
115
|
street?: string | null | undefined;
|
114
116
|
zipCode?: string | null | undefined;
|
115
117
|
} | {
|
116
|
-
firstname
|
117
|
-
surname
|
118
|
+
firstname?: string | null | undefined;
|
119
|
+
surname?: string | null | undefined;
|
118
120
|
middlename?: string | null | undefined;
|
119
121
|
} | {
|
120
122
|
country: string;
|
@@ -160,8 +162,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
160
162
|
street?: string | null | undefined;
|
161
163
|
zipCode?: string | null | undefined;
|
162
164
|
} | {
|
163
|
-
firstname
|
164
|
-
surname
|
165
|
+
firstname?: string | null | undefined;
|
166
|
+
surname?: string | null | undefined;
|
165
167
|
middlename?: string | null | undefined;
|
166
168
|
} | {
|
167
169
|
country: string;
|
@@ -224,8 +226,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
224
226
|
street?: string | null | undefined;
|
225
227
|
zipCode?: string | null | undefined;
|
226
228
|
} | {
|
227
|
-
firstname
|
228
|
-
surname
|
229
|
+
firstname?: string | null | undefined;
|
230
|
+
surname?: string | null | undefined;
|
229
231
|
middlename?: string | null | undefined;
|
230
232
|
} | {
|
231
233
|
country: string;
|
@@ -272,7 +274,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
272
274
|
message: string;
|
273
275
|
};
|
274
276
|
};
|
275
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
277
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
276
278
|
transactionId: string;
|
277
279
|
declaration: Record<string, string | number | boolean | {
|
278
280
|
type: string;
|
@@ -290,8 +292,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
290
292
|
street?: string | null | undefined;
|
291
293
|
zipCode?: string | null | undefined;
|
292
294
|
} | {
|
293
|
-
firstname
|
294
|
-
surname
|
295
|
+
firstname?: string | null | undefined;
|
296
|
+
surname?: string | null | undefined;
|
295
297
|
middlename?: string | null | undefined;
|
296
298
|
} | {
|
297
299
|
country: string;
|
@@ -317,6 +319,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
317
319
|
originalFilename: string;
|
318
320
|
}[] | [string, string] | null | undefined>;
|
319
321
|
annotation: {};
|
322
|
+
registrationNumber?: string | undefined;
|
320
323
|
keepAssignment?: boolean | undefined;
|
321
324
|
type: "REGISTER";
|
322
325
|
eventId: string;
|
@@ -349,8 +352,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
349
352
|
street?: string | null | undefined;
|
350
353
|
zipCode?: string | null | undefined;
|
351
354
|
} | {
|
352
|
-
firstname
|
353
|
-
surname
|
355
|
+
firstname?: string | null | undefined;
|
356
|
+
surname?: string | null | undefined;
|
354
357
|
middlename?: string | null | undefined;
|
355
358
|
} | {
|
356
359
|
country: string;
|
@@ -400,25 +403,31 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
400
403
|
};
|
401
404
|
};
|
402
405
|
};
|
403
|
-
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
406
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
404
407
|
configuration: EventConfig;
|
405
408
|
action: ActionType;
|
406
409
|
rng?: () => number;
|
407
410
|
defaults?: Partial<ActionDocument>;
|
408
411
|
user?: Partial<{
|
409
412
|
signature: string;
|
410
|
-
primaryOfficeId:
|
413
|
+
primaryOfficeId: UUID;
|
411
414
|
role: TestUserRole;
|
412
415
|
id: string;
|
413
416
|
}>;
|
414
417
|
}): ActionDocument;
|
415
|
-
export declare function generateEventDocument({ configuration, actions, rng }: {
|
418
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
416
419
|
configuration: EventConfig;
|
417
420
|
actions: ActionType[];
|
418
421
|
rng?: () => number;
|
422
|
+
user?: Partial<{
|
423
|
+
signature: string;
|
424
|
+
primaryOfficeId: UUID;
|
425
|
+
role: TestUserRole;
|
426
|
+
id: string;
|
427
|
+
}>;
|
419
428
|
}): EventDocument;
|
420
429
|
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
421
|
-
eventId:
|
430
|
+
eventId: UUID;
|
422
431
|
actionType: ActionType;
|
423
432
|
rng?: () => number;
|
424
433
|
declaration?: EventState;
|
@@ -432,6 +441,8 @@ export declare function getRandomDate(rng: () => number, start: string, end: str
|
|
432
441
|
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
433
442
|
*/
|
434
443
|
export declare function createPrng(seed: number): () => number;
|
444
|
+
export declare function generateUuid(rng?: () => number): UUID;
|
445
|
+
export declare function generateRegistrationNumber(rng: () => number): string;
|
435
446
|
export declare function generateRandomSignature(rng: () => number): string;
|
436
447
|
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
437
448
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare function generateTransactionId(): import("
|
1
|
+
export declare function generateTransactionId(): string & import("zod").BRAND<"UUID">;
|
2
2
|
//# sourceMappingURL=transactions.d.ts.map
|