@opencrvs/toolkit 1.8.0-rc.feef45c → 1.8.0-rc.ff0a1b5
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 +679 -332
- package/dist/commons/events/ActionConfig.d.ts +4879 -1232
- package/dist/commons/events/ActionDocument.d.ts +433 -413
- package/dist/commons/events/ActionInput.d.ts +180 -180
- package/dist/commons/events/AdvancedSearchConfig.d.ts +34 -36
- package/dist/commons/events/Draft.d.ts +24 -26
- package/dist/commons/events/EventConfig.d.ts +2711 -967
- package/dist/commons/events/EventDocument.d.ts +241 -312
- package/dist/commons/events/EventIndex.d.ts +817 -279
- package/dist/commons/events/EventMetadata.d.ts +263 -11
- package/dist/commons/events/FieldConfig.d.ts +267 -3
- package/dist/commons/events/FieldType.d.ts +3 -2
- package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
- package/dist/commons/events/FieldValue.d.ts +6 -3
- package/dist/commons/events/FormConfig.d.ts +2279 -629
- package/dist/commons/events/PageConfig.d.ts +406 -0
- package/dist/commons/events/SummaryConfig.d.ts +17 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +1222 -8
- package/dist/commons/events/defineConfig.d.ts +283 -2
- package/dist/commons/events/event.d.ts +3 -1
- package/dist/commons/events/field.d.ts +3 -3
- package/dist/commons/events/test.utils.d.ts +7 -7
- package/dist/commons/events/utils.d.ts +193 -21
- package/dist/events/index.js +1141 -774
- package/dist/scopes/index.d.ts +70 -1
- package/dist/scopes/index.js +130 -0
- package/package.json +1 -1
@@ -217,6 +217,34 @@ export declare function getDeclarationPages(configuration: EventConfig): {
|
|
217
217
|
configuration?: {
|
218
218
|
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
219
219
|
} | undefined;
|
220
|
+
} | {
|
221
|
+
type: "DATE_RANGE";
|
222
|
+
id: string;
|
223
|
+
label: import("./TranslationConfig").TranslationConfig;
|
224
|
+
parent?: {
|
225
|
+
_fieldId?: string | undefined;
|
226
|
+
} | undefined;
|
227
|
+
validation?: {
|
228
|
+
message: import("./TranslationConfig").TranslationConfig;
|
229
|
+
validator: import(".").JSONSchema;
|
230
|
+
}[] | undefined;
|
231
|
+
required?: boolean | undefined;
|
232
|
+
defaultValue?: string | [string, string] | undefined;
|
233
|
+
conditionals?: ({
|
234
|
+
type: "SHOW";
|
235
|
+
conditional: import(".").JSONSchema;
|
236
|
+
} | {
|
237
|
+
type: "ENABLE";
|
238
|
+
conditional: import(".").JSONSchema;
|
239
|
+
} | {
|
240
|
+
type: "DISPLAY_ON_REVIEW";
|
241
|
+
conditional: import(".").JSONSchema;
|
242
|
+
})[] | undefined;
|
243
|
+
placeholder?: import("./TranslationConfig").TranslationConfig | undefined;
|
244
|
+
hideLabel?: boolean | undefined;
|
245
|
+
configuration?: {
|
246
|
+
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
247
|
+
} | undefined;
|
220
248
|
} | {
|
221
249
|
type: "PARAGRAPH";
|
222
250
|
id: string;
|
@@ -889,6 +917,34 @@ export declare function getDeclaration(configuration: EventConfig): {
|
|
889
917
|
configuration?: {
|
890
918
|
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
891
919
|
} | undefined;
|
920
|
+
} | {
|
921
|
+
type: "DATE_RANGE";
|
922
|
+
id: string;
|
923
|
+
label: import("./TranslationConfig").TranslationConfig;
|
924
|
+
parent?: {
|
925
|
+
_fieldId?: string | undefined;
|
926
|
+
} | undefined;
|
927
|
+
validation?: {
|
928
|
+
message: import("./TranslationConfig").TranslationConfig;
|
929
|
+
validator: import(".").JSONSchema;
|
930
|
+
}[] | undefined;
|
931
|
+
required?: boolean | undefined;
|
932
|
+
defaultValue?: string | [string, string] | undefined;
|
933
|
+
conditionals?: ({
|
934
|
+
type: "SHOW";
|
935
|
+
conditional: import(".").JSONSchema;
|
936
|
+
} | {
|
937
|
+
type: "ENABLE";
|
938
|
+
conditional: import(".").JSONSchema;
|
939
|
+
} | {
|
940
|
+
type: "DISPLAY_ON_REVIEW";
|
941
|
+
conditional: import(".").JSONSchema;
|
942
|
+
})[] | undefined;
|
943
|
+
placeholder?: import("./TranslationConfig").TranslationConfig | undefined;
|
944
|
+
hideLabel?: boolean | undefined;
|
945
|
+
configuration?: {
|
946
|
+
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
947
|
+
} | undefined;
|
892
948
|
} | {
|
893
949
|
type: "PARAGRAPH";
|
894
950
|
id: string;
|
@@ -1556,6 +1612,34 @@ export declare const getActionAnnotationFields: (actionConfig: ActionConfig) =>
|
|
1556
1612
|
configuration?: {
|
1557
1613
|
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
1558
1614
|
} | undefined;
|
1615
|
+
} | {
|
1616
|
+
type: "DATE_RANGE";
|
1617
|
+
id: string;
|
1618
|
+
label: import("./TranslationConfig").TranslationConfig;
|
1619
|
+
parent?: {
|
1620
|
+
_fieldId?: string | undefined;
|
1621
|
+
} | undefined;
|
1622
|
+
validation?: {
|
1623
|
+
message: import("./TranslationConfig").TranslationConfig;
|
1624
|
+
validator: import(".").JSONSchema;
|
1625
|
+
}[] | undefined;
|
1626
|
+
required?: boolean | undefined;
|
1627
|
+
defaultValue?: string | [string, string] | undefined;
|
1628
|
+
conditionals?: ({
|
1629
|
+
type: "SHOW";
|
1630
|
+
conditional: import(".").JSONSchema;
|
1631
|
+
} | {
|
1632
|
+
type: "ENABLE";
|
1633
|
+
conditional: import(".").JSONSchema;
|
1634
|
+
} | {
|
1635
|
+
type: "DISPLAY_ON_REVIEW";
|
1636
|
+
conditional: import(".").JSONSchema;
|
1637
|
+
})[] | undefined;
|
1638
|
+
placeholder?: import("./TranslationConfig").TranslationConfig | undefined;
|
1639
|
+
hideLabel?: boolean | undefined;
|
1640
|
+
configuration?: {
|
1641
|
+
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
1642
|
+
} | undefined;
|
1559
1643
|
} | {
|
1560
1644
|
type: "PARAGRAPH";
|
1561
1645
|
id: string;
|
@@ -2226,6 +2310,34 @@ export declare function getActionReview(configuration: EventConfig, actionType:
|
|
2226
2310
|
configuration?: {
|
2227
2311
|
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
2228
2312
|
} | undefined;
|
2313
|
+
} | {
|
2314
|
+
type: "DATE_RANGE";
|
2315
|
+
id: string;
|
2316
|
+
label: import("./TranslationConfig").TranslationConfig;
|
2317
|
+
parent?: {
|
2318
|
+
_fieldId?: string | undefined;
|
2319
|
+
} | undefined;
|
2320
|
+
validation?: {
|
2321
|
+
message: import("./TranslationConfig").TranslationConfig;
|
2322
|
+
validator: import(".").JSONSchema;
|
2323
|
+
}[] | undefined;
|
2324
|
+
required?: boolean | undefined;
|
2325
|
+
defaultValue?: string | [string, string] | undefined;
|
2326
|
+
conditionals?: ({
|
2327
|
+
type: "SHOW";
|
2328
|
+
conditional: import(".").JSONSchema;
|
2329
|
+
} | {
|
2330
|
+
type: "ENABLE";
|
2331
|
+
conditional: import(".").JSONSchema;
|
2332
|
+
} | {
|
2333
|
+
type: "DISPLAY_ON_REVIEW";
|
2334
|
+
conditional: import(".").JSONSchema;
|
2335
|
+
})[] | undefined;
|
2336
|
+
placeholder?: import("./TranslationConfig").TranslationConfig | undefined;
|
2337
|
+
hideLabel?: boolean | undefined;
|
2338
|
+
configuration?: {
|
2339
|
+
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
2340
|
+
} | undefined;
|
2229
2341
|
} | {
|
2230
2342
|
type: "PARAGRAPH";
|
2231
2343
|
id: string;
|
@@ -2891,6 +3003,34 @@ export declare function getActionReviewFields(configuration: EventConfig, action
|
|
2891
3003
|
configuration?: {
|
2892
3004
|
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
2893
3005
|
} | undefined;
|
3006
|
+
} | {
|
3007
|
+
type: "DATE_RANGE";
|
3008
|
+
id: string;
|
3009
|
+
label: import("./TranslationConfig").TranslationConfig;
|
3010
|
+
parent?: {
|
3011
|
+
_fieldId?: string | undefined;
|
3012
|
+
} | undefined;
|
3013
|
+
validation?: {
|
3014
|
+
message: import("./TranslationConfig").TranslationConfig;
|
3015
|
+
validator: import(".").JSONSchema;
|
3016
|
+
}[] | undefined;
|
3017
|
+
required?: boolean | undefined;
|
3018
|
+
defaultValue?: string | [string, string] | undefined;
|
3019
|
+
conditionals?: ({
|
3020
|
+
type: "SHOW";
|
3021
|
+
conditional: import(".").JSONSchema;
|
3022
|
+
} | {
|
3023
|
+
type: "ENABLE";
|
3024
|
+
conditional: import(".").JSONSchema;
|
3025
|
+
} | {
|
3026
|
+
type: "DISPLAY_ON_REVIEW";
|
3027
|
+
conditional: import(".").JSONSchema;
|
3028
|
+
})[] | undefined;
|
3029
|
+
placeholder?: import("./TranslationConfig").TranslationConfig | undefined;
|
3030
|
+
hideLabel?: boolean | undefined;
|
3031
|
+
configuration?: {
|
3032
|
+
notice?: import("./TranslationConfig").TranslationConfig | undefined;
|
3033
|
+
} | undefined;
|
2894
3034
|
} | {
|
2895
3035
|
type: "PARAGRAPH";
|
2896
3036
|
id: string;
|
@@ -3352,7 +3492,44 @@ export declare function getActionReviewFields(configuration: EventConfig, action
|
|
3352
3492
|
})[];
|
3353
3493
|
export declare function isPageVisible(page: PageConfig, formValues: ActionUpdate): boolean;
|
3354
3494
|
export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], values: T, visibleVerificationPageIds?: string[]): Partial<T>;
|
3355
|
-
export declare function omitHiddenPaginatedFields(formConfig: FormConfig, declaration: EventState): Partial<
|
3495
|
+
export declare function omitHiddenPaginatedFields(formConfig: FormConfig, declaration: EventState): Partial<Record<string, string | number | boolean | {
|
3496
|
+
type: string;
|
3497
|
+
filename: string;
|
3498
|
+
originalFilename: string;
|
3499
|
+
} | {
|
3500
|
+
country: string;
|
3501
|
+
district: string;
|
3502
|
+
addressType: "DOMESTIC";
|
3503
|
+
province: string;
|
3504
|
+
urbanOrRural: "URBAN";
|
3505
|
+
number?: string | undefined;
|
3506
|
+
town?: string | undefined;
|
3507
|
+
residentialArea?: string | undefined;
|
3508
|
+
street?: string | undefined;
|
3509
|
+
zipCode?: string | undefined;
|
3510
|
+
} | {
|
3511
|
+
country: string;
|
3512
|
+
district: string;
|
3513
|
+
addressType: "DOMESTIC";
|
3514
|
+
province: string;
|
3515
|
+
urbanOrRural: "RURAL";
|
3516
|
+
village?: string | undefined;
|
3517
|
+
} | {
|
3518
|
+
country: string;
|
3519
|
+
state: string;
|
3520
|
+
addressType: "INTERNATIONAL";
|
3521
|
+
district2: string;
|
3522
|
+
cityOrTown?: string | undefined;
|
3523
|
+
addressLine1?: string | undefined;
|
3524
|
+
addressLine2?: string | undefined;
|
3525
|
+
addressLine3?: string | undefined;
|
3526
|
+
postcodeOrZip?: string | undefined;
|
3527
|
+
} | {
|
3528
|
+
type: string;
|
3529
|
+
option: string;
|
3530
|
+
filename: string;
|
3531
|
+
originalFilename: string;
|
3532
|
+
}[] | [string, string] | undefined>>;
|
3356
3533
|
export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]): {
|
3357
3534
|
id: string;
|
3358
3535
|
transactionId: string;
|
@@ -3402,7 +3579,8 @@ export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]):
|
|
3402
3579
|
option: string;
|
3403
3580
|
filename: string;
|
3404
3581
|
originalFilename: string;
|
3405
|
-
}[] | undefined>;
|
3582
|
+
}[] | [string, string] | undefined>;
|
3583
|
+
createdAtLocation: string;
|
3406
3584
|
annotation?: Record<string, string | number | boolean | {
|
3407
3585
|
type: string;
|
3408
3586
|
filename: string;
|
@@ -3440,26 +3618,11 @@ export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]):
|
|
3440
3618
|
option: string;
|
3441
3619
|
filename: string;
|
3442
3620
|
originalFilename: string;
|
3443
|
-
}[] | undefined> | undefined;
|
3444
|
-
createdAtLocation?: string | undefined;
|
3445
|
-
updatedAtLocation?: string | undefined;
|
3621
|
+
}[] | [string, string] | undefined> | undefined;
|
3446
3622
|
originalActionId?: string | undefined;
|
3447
3623
|
};
|
3448
3624
|
}[];
|
3449
|
-
export declare function createEmptyDraft(eventId: string, draftId: string, actionType: ActionType):
|
3450
|
-
id: string;
|
3451
|
-
eventId: string;
|
3452
|
-
createdAt: string;
|
3453
|
-
transactionId: import("../uuid").UUID;
|
3454
|
-
action: {
|
3455
|
-
type: ActionType;
|
3456
|
-
declaration: {};
|
3457
|
-
annotation: {};
|
3458
|
-
createdAt: string;
|
3459
|
-
createdBy: string;
|
3460
|
-
createdAtLocation: string;
|
3461
|
-
};
|
3462
|
-
};
|
3625
|
+
export declare function createEmptyDraft(eventId: string, draftId: string, actionType: ActionType): Draft;
|
3463
3626
|
export declare function isVerificationPage(page: PageConfig): page is VerificationPageConfig;
|
3464
3627
|
export declare function getVisibleVerificationPageIds(pages: PageConfig[], annotation: ActionUpdate): string[];
|
3465
3628
|
export declare function getActionVerificationPageIds(actionConfig: ActionConfig, annotation: ActionUpdate): string[];
|
@@ -3529,9 +3692,9 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
|
|
3529
3692
|
option: string;
|
3530
3693
|
filename: string;
|
3531
3694
|
originalFilename: string;
|
3532
|
-
}[] | undefined;
|
3695
|
+
}[] | [string, string] | undefined;
|
3533
3696
|
}>;
|
3534
|
-
export declare function deepMerge<T extends Record<string, unknown>>(currentDocument: T, actionDocument:
|
3697
|
+
export declare function deepMerge<T extends Record<string, unknown>, K extends Record<string, unknown>>(currentDocument: T, actionDocument: K): T & K;
|
3535
3698
|
export declare function findLastAssignmentAction(actions: Action[]): Action | undefined;
|
3536
3699
|
/** Tell compiler that accessing record with arbitrary key might result to undefined
|
3537
3700
|
* Use when you **cannot guarantee** that key exists in the record
|
@@ -3544,4 +3707,13 @@ export declare function isWriteAction(actionType: ActionType): boolean;
|
|
3544
3707
|
* @returns All the fields in the event configuration.
|
3545
3708
|
*/
|
3546
3709
|
export declare const findAllFields: (config: EventConfig) => FieldConfig[];
|
3710
|
+
/**
|
3711
|
+
* Returns the value of the object at the given path with the ability of resolving mixed paths. See examples.
|
3712
|
+
*
|
3713
|
+
* @param obj Entity we want to get the value from
|
3714
|
+
* @param path property path e.g. `a.b.c`
|
3715
|
+
* @param defaultValue
|
3716
|
+
* @returns the value of the object at the given path.
|
3717
|
+
*/
|
3718
|
+
export declare function getMixedPath<T = unknown>(obj: Record<string, unknown>, path: string, defaultValue?: T | undefined): T | undefined;
|
3547
3719
|
//# sourceMappingURL=utils.d.ts.map
|