@opencrvs/toolkit 1.8.0-rc.f876361 → 1.8.0-rc.f89fbcb
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 +8398 -831
- package/dist/commons/conditionals/conditionals.d.ts +26 -11
- package/dist/commons/conditionals/validate.d.ts +18 -17
- package/dist/commons/events/ActionConfig.d.ts +120018 -1729
- package/dist/commons/events/ActionDocument.d.ts +2581 -554
- package/dist/commons/events/ActionInput.d.ts +2674 -499
- package/dist/commons/events/ActionType.d.ts +9 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1255 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +31 -0
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +3730 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +172 -46
- package/dist/commons/events/EventConfig.d.ts +57845 -1354
- package/dist/commons/events/EventDocument.d.ts +1635 -391
- package/dist/commons/events/EventIndex.d.ts +2007 -27
- package/dist/commons/events/EventMetadata.d.ts +343 -45
- package/dist/commons/events/FieldConfig.d.ts +5780 -1066
- package/dist/commons/events/FieldType.d.ts +6 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
- package/dist/commons/events/FieldValue.d.ts +49 -8
- package/dist/commons/events/FormConfig.d.ts +50248 -514
- package/dist/commons/events/PageConfig.d.ts +12472 -234
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- package/dist/commons/events/User.d.ts +31 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +7300 -20
- package/dist/commons/events/defineConfig.d.ts +9289 -58
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +94 -0
- package/dist/commons/events/index.d.ts +8 -0
- package/dist/commons/events/scopes.d.ts +44 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +157 -157
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13799 -78
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +208 -185
- package/dist/events/index.js +4843 -2050
- package/dist/scopes/index.d.ts +161 -1
- package/dist/scopes/index.js +202 -1
- package/package.json +4 -3
@@ -0,0 +1,54 @@
|
|
1
|
+
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
+
import { SelectOption } from './FieldConfig';
|
3
|
+
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
|
+
/**
|
5
|
+
* Creates a function that acts like a callable + static method container.
|
6
|
+
*
|
7
|
+
* @example
|
8
|
+
* event('status') // → returns search config
|
9
|
+
* event.hasAction('CLICKED') // → returns conditional
|
10
|
+
*/
|
11
|
+
declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
12
|
+
range: () => {
|
13
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
|
14
|
+
options: {
|
15
|
+
value: string;
|
16
|
+
label: import("./TranslationConfig").TranslationConfig;
|
17
|
+
}[] | undefined;
|
18
|
+
fieldType: "event";
|
19
|
+
} & {
|
20
|
+
config: {
|
21
|
+
type: "range";
|
22
|
+
};
|
23
|
+
};
|
24
|
+
exact: () => {
|
25
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
|
26
|
+
options: {
|
27
|
+
value: string;
|
28
|
+
label: import("./TranslationConfig").TranslationConfig;
|
29
|
+
}[] | undefined;
|
30
|
+
fieldType: "event";
|
31
|
+
} & {
|
32
|
+
config: {
|
33
|
+
type: "exact";
|
34
|
+
};
|
35
|
+
};
|
36
|
+
fuzzy: () => {
|
37
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
|
38
|
+
options: {
|
39
|
+
value: string;
|
40
|
+
label: import("./TranslationConfig").TranslationConfig;
|
41
|
+
}[] | undefined;
|
42
|
+
fieldType: "event";
|
43
|
+
} & {
|
44
|
+
config: {
|
45
|
+
type: "fuzzy";
|
46
|
+
};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
declare const event: typeof eventFn & {
|
50
|
+
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
51
|
+
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
52
|
+
};
|
53
|
+
export { event };
|
54
|
+
//# sourceMappingURL=event.d.ts.map
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import { FieldConditional } from './Conditional';
|
2
|
+
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
import { SelectOption, ValidationConfig } from './FieldConfig';
|
4
|
+
/**
|
5
|
+
* Entry point for defining conditional logic or configuration for a form field.
|
6
|
+
* @param fieldId - The ID of the field to define rules or config for.
|
7
|
+
* @returns An object combining conditional methods and configuration builders.
|
8
|
+
*/
|
9
|
+
export declare function field(fieldId: string, options?: {
|
10
|
+
options?: SelectOption[];
|
11
|
+
excludeInSearchQuery?: boolean;
|
12
|
+
alternateFieldIds?: string[];
|
13
|
+
conditionals?: FieldConditional[];
|
14
|
+
validations?: ValidationConfig[];
|
15
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
16
|
+
}): {
|
17
|
+
range: () => {
|
18
|
+
options?: SelectOption[];
|
19
|
+
excludeInSearchQuery?: boolean;
|
20
|
+
alternateFieldIds?: string[];
|
21
|
+
conditionals?: FieldConditional[];
|
22
|
+
validations?: ValidationConfig[];
|
23
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
24
|
+
fieldId: string;
|
25
|
+
fieldType: "field";
|
26
|
+
} & {
|
27
|
+
config: {
|
28
|
+
type: "range";
|
29
|
+
};
|
30
|
+
};
|
31
|
+
exact: () => {
|
32
|
+
options?: SelectOption[];
|
33
|
+
excludeInSearchQuery?: boolean;
|
34
|
+
alternateFieldIds?: string[];
|
35
|
+
conditionals?: FieldConditional[];
|
36
|
+
validations?: ValidationConfig[];
|
37
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
38
|
+
fieldId: string;
|
39
|
+
fieldType: "field";
|
40
|
+
} & {
|
41
|
+
config: {
|
42
|
+
type: "exact";
|
43
|
+
};
|
44
|
+
};
|
45
|
+
fuzzy: () => {
|
46
|
+
options?: SelectOption[];
|
47
|
+
excludeInSearchQuery?: boolean;
|
48
|
+
alternateFieldIds?: string[];
|
49
|
+
conditionals?: FieldConditional[];
|
50
|
+
validations?: ValidationConfig[];
|
51
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
52
|
+
fieldId: string;
|
53
|
+
fieldType: "field";
|
54
|
+
} & {
|
55
|
+
config: {
|
56
|
+
type: "fuzzy";
|
57
|
+
};
|
58
|
+
};
|
59
|
+
$$field: string;
|
60
|
+
isAfter: () => {
|
61
|
+
days: (days: number) => {
|
62
|
+
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
63
|
+
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
64
|
+
};
|
65
|
+
date: (date: string | {
|
66
|
+
$$field: string;
|
67
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
68
|
+
now: () => import("../conditionals/conditionals").JSONSchema;
|
69
|
+
};
|
70
|
+
isBefore: () => {
|
71
|
+
days: (days: number) => {
|
72
|
+
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
73
|
+
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
74
|
+
};
|
75
|
+
date: (date: string | {
|
76
|
+
$$field: string;
|
77
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
78
|
+
now: () => import("../conditionals/conditionals").JSONSchema;
|
79
|
+
};
|
80
|
+
isEqualTo: (value: string | boolean | {
|
81
|
+
$$field: string;
|
82
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
83
|
+
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
84
|
+
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
85
|
+
inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
|
86
|
+
isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
|
87
|
+
matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
|
88
|
+
isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
|
89
|
+
getId: () => {
|
90
|
+
fieldId: string;
|
91
|
+
};
|
92
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
93
|
+
};
|
94
|
+
//# sourceMappingURL=field.d.ts.map
|
@@ -1,3 +1,4 @@
|
|
1
|
+
export * from './Constants';
|
1
2
|
export * from './ActionConfig';
|
2
3
|
export * from './offline';
|
3
4
|
export * from './EventConfig';
|
@@ -6,6 +7,8 @@ export * from './FieldConfig';
|
|
6
7
|
export * from './PageConfig';
|
7
8
|
export * from './SummaryConfig';
|
8
9
|
export * from './WorkqueueConfig';
|
10
|
+
export * from './WorkqueueColumnConfig';
|
11
|
+
export * from './workqueueDefaultColumns';
|
9
12
|
export * from './Draft';
|
10
13
|
export * from './EventMetadata';
|
11
14
|
export * from './EventInput';
|
@@ -30,6 +33,11 @@ export * from './Conditional';
|
|
30
33
|
export * from './AdvancedSearchConfig';
|
31
34
|
export * from './test.utils';
|
32
35
|
export * from './TemplateConfig';
|
36
|
+
export * from './scopes';
|
37
|
+
export * from './serializer';
|
38
|
+
export * from './state/availableActions';
|
33
39
|
export * from '../conditionals/conditionals';
|
34
40
|
export * from '../conditionals/validate';
|
41
|
+
export * from './field';
|
42
|
+
export * from './event';
|
35
43
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { Scope } from '../scopes';
|
2
|
+
export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"];
|
3
|
+
export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[];
|
4
|
+
export declare const ACTION_ALLOWED_SCOPES: {
|
5
|
+
READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
|
6
|
+
CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
|
7
|
+
NOTIFY: ["record.declaration-submit-incomplete"];
|
8
|
+
DECLARE: ["record.declare-birth", "record.declaration-submit-for-approval", "record.register"];
|
9
|
+
DELETE: ["record.declare-birth"];
|
10
|
+
VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
|
11
|
+
REGISTER: ["record.register"];
|
12
|
+
PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
|
13
|
+
REQUEST_CORRECTION: ["record.registration-request-correction"];
|
14
|
+
REJECT_CORRECTION: ["record.registration-correct"];
|
15
|
+
APPROVE_CORRECTION: ["record.registration-correct"];
|
16
|
+
MARKED_AS_DUPLICATE: ["record.declaration-archive"];
|
17
|
+
ARCHIVE: ["record.declaration-archive"];
|
18
|
+
REJECT: ["record.declaration-submit-for-updates"];
|
19
|
+
ASSIGN: null;
|
20
|
+
UNASSIGN: null;
|
21
|
+
DETECT_DUPLICATE: [];
|
22
|
+
};
|
23
|
+
export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
24
|
+
READ: never[];
|
25
|
+
CREATE: "record.notify"[];
|
26
|
+
NOTIFY: "record.notify"[];
|
27
|
+
DECLARE: never[];
|
28
|
+
DELETE: never[];
|
29
|
+
VALIDATE: never[];
|
30
|
+
REGISTER: never[];
|
31
|
+
PRINT_CERTIFICATE: never[];
|
32
|
+
REQUEST_CORRECTION: never[];
|
33
|
+
REJECT_CORRECTION: never[];
|
34
|
+
APPROVE_CORRECTION: never[];
|
35
|
+
MARKED_AS_DUPLICATE: never[];
|
36
|
+
ARCHIVE: never[];
|
37
|
+
REJECT: never[];
|
38
|
+
ASSIGN: never[];
|
39
|
+
UNASSIGN: never[];
|
40
|
+
DETECT_DUPLICATE: never[];
|
41
|
+
};
|
42
|
+
export declare const WRITE_ACTION_SCOPES: ("record.declare-birth" | "record.declaration-submit-for-approval" | "record.register" | "record.registration-print&issue-certified-copies")[];
|
43
|
+
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
44
|
+
//# sourceMappingURL=scopes.d.ts.map
|