@opencrvs/toolkit 1.8.0-rc.ff0a1b5 → 1.8.0-rc.ff0b26c
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 +2923 -7
- package/dist/commons/events/ActionConfig.d.ts +8022 -1007
- package/dist/commons/events/AdvancedSearchConfig.d.ts +603 -12
- package/dist/commons/events/EventConfig.d.ts +3622 -113
- package/dist/commons/events/EventIndex.d.ts +318 -45
- package/dist/commons/events/EventMetadata.d.ts +1 -0
- package/dist/commons/events/FieldConfig.d.ts +517 -0
- package/dist/commons/events/FormConfig.d.ts +3641 -467
- package/dist/commons/events/PageConfig.d.ts +782 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +344 -52
- package/dist/commons/events/defineConfig.d.ts +253 -1
- package/dist/commons/events/event.d.ts +35 -8
- package/dist/commons/events/field.d.ts +21 -7
- package/dist/commons/events/scopes.d.ts +20 -1
- package/dist/commons/events/test.utils.d.ts +3 -3
- package/dist/commons/events/utils.d.ts +115 -0
- package/dist/events/index.js +429 -121
- package/dist/scopes/index.d.ts +94 -6
- package/dist/scopes/index.js +42 -21
- package/package.json +1 -1
@@ -9,15 +9,42 @@ import { SelectOption } from './FieldConfig';
|
|
9
9
|
* event.hasAction('CLICKED') // → returns conditional
|
10
10
|
*/
|
11
11
|
declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
+
};
|
19
47
|
};
|
20
|
-
fieldType: "event";
|
21
48
|
};
|
22
49
|
declare const event: typeof eventFn & {
|
23
50
|
field(field: EventMetadataKeys): EventMetadataParameter;
|
@@ -1,29 +1,43 @@
|
|
1
|
+
import { FieldConditional } from './Conditional';
|
2
|
+
import { TranslationConfig } from './TranslationConfig';
|
1
3
|
/**
|
2
4
|
* Entry point for defining conditional logic or configuration for a form field.
|
3
5
|
* @param fieldId - The ID of the field to define rules or config for.
|
4
6
|
* @returns An object combining conditional methods and configuration builders.
|
5
7
|
*/
|
6
|
-
export declare function field(fieldId: string
|
8
|
+
export declare function field(fieldId: string, options?: {
|
9
|
+
conditionals?: FieldConditional[];
|
10
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
|
+
}): {
|
7
12
|
range: () => {
|
13
|
+
conditionals?: FieldConditional[];
|
14
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
15
|
+
fieldId: string;
|
16
|
+
fieldType: "field";
|
17
|
+
} & {
|
8
18
|
config: {
|
9
19
|
type: "range";
|
10
20
|
};
|
11
|
-
fieldId: string;
|
12
|
-
fieldType: "field";
|
13
21
|
};
|
14
22
|
exact: () => {
|
23
|
+
conditionals?: FieldConditional[];
|
24
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
|
+
fieldId: string;
|
26
|
+
fieldType: "field";
|
27
|
+
} & {
|
15
28
|
config: {
|
16
29
|
type: "exact";
|
17
30
|
};
|
18
|
-
fieldId: string;
|
19
|
-
fieldType: "field";
|
20
31
|
};
|
21
32
|
fuzzy: () => {
|
33
|
+
conditionals?: FieldConditional[];
|
34
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
35
|
+
fieldId: string;
|
36
|
+
fieldType: "field";
|
37
|
+
} & {
|
22
38
|
config: {
|
23
39
|
type: "fuzzy";
|
24
40
|
};
|
25
|
-
fieldId: string;
|
26
|
-
fieldType: "field";
|
27
41
|
};
|
28
42
|
isAfter: () => {
|
29
43
|
days: (days: number) => {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { Scope } from '../scopes';
|
2
2
|
import { ActionType } from './ActionType';
|
3
|
-
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
4
3
|
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"];
|
5
4
|
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")[];
|
6
5
|
export declare const ACTION_ALLOWED_SCOPES: {
|
@@ -22,5 +21,25 @@ export declare const ACTION_ALLOWED_SCOPES: {
|
|
22
21
|
UNASSIGN: null;
|
23
22
|
DETECT_DUPLICATE: [];
|
24
23
|
};
|
24
|
+
export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
25
|
+
READ: never[];
|
26
|
+
CREATE: "record.notify"[];
|
27
|
+
NOTIFY: "record.notify"[];
|
28
|
+
DECLARE: never[];
|
29
|
+
DELETE: never[];
|
30
|
+
VALIDATE: never[];
|
31
|
+
REGISTER: never[];
|
32
|
+
PRINT_CERTIFICATE: never[];
|
33
|
+
REQUEST_CORRECTION: never[];
|
34
|
+
REJECT_CORRECTION: never[];
|
35
|
+
APPROVE_CORRECTION: never[];
|
36
|
+
MARKED_AS_DUPLICATE: never[];
|
37
|
+
ARCHIVE: never[];
|
38
|
+
REJECT: never[];
|
39
|
+
ASSIGN: never[];
|
40
|
+
UNASSIGN: never[];
|
41
|
+
DETECT_DUPLICATE: never[];
|
42
|
+
};
|
43
|
+
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
25
44
|
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
26
45
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -6,7 +6,6 @@ import { EventConfig } from './EventConfig';
|
|
6
6
|
import { EventDocument } from './EventDocument';
|
7
7
|
import { EventIndex } from './EventIndex';
|
8
8
|
import { EventInput } from './EventInput';
|
9
|
-
import { FieldValue } from './FieldValue';
|
10
9
|
import { TranslationConfig } from './TranslationConfig';
|
11
10
|
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): EventState;
|
12
11
|
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
|
@@ -319,7 +318,8 @@ export declare function generateEventDocument({ configuration, actions }: {
|
|
319
318
|
configuration: EventConfig;
|
320
319
|
actions: ActionType[];
|
321
320
|
}): EventDocument;
|
322
|
-
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?:
|
323
|
-
export declare
|
321
|
+
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: EventState): Draft;
|
322
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
323
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
324
324
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
325
325
|
//# sourceMappingURL=test.utils.d.ts.map
|