@opencrvs/toolkit 1.9.4-rc.793f834 → 1.9.4-rc.f09603b
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 +28204 -2149
- package/dist/commons/conditionals/conditionals.d.ts +10 -1
- package/dist/commons/conditionals/validate.d.ts +11 -4
- package/dist/commons/events/ActionConfig.d.ts +23416 -1552
- package/dist/commons/events/ActionDocument.d.ts +803 -1856
- package/dist/commons/events/ActionInput.d.ts +277 -1073
- package/dist/commons/events/ActionType.d.ts +86 -9
- package/dist/commons/events/AdvancedSearchConfig.d.ts +228 -1238
- package/dist/commons/events/CompositeFieldValue.d.ts +27 -176
- package/dist/commons/events/Conditional.d.ts +26 -38
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +931 -4169
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
- package/dist/commons/events/Draft.d.ts +70 -105
- package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
- package/dist/commons/events/EventConfig.d.ts +18663 -2120
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +320 -1332
- package/dist/commons/events/EventIndex.d.ts +197 -967
- package/dist/commons/events/EventInput.d.ts +2 -8
- package/dist/commons/events/EventMetadata.d.ts +106 -346
- package/dist/commons/events/FieldConfig.d.ts +4267 -11782
- package/dist/commons/events/FieldType.d.ts +20 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +181 -813
- package/dist/commons/events/FieldValue.d.ts +83 -356
- package/dist/commons/events/Flag.d.ts +70 -0
- package/dist/commons/events/FormConfig.d.ts +13140 -721
- package/dist/commons/events/PageConfig.d.ts +8780 -319
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +3 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +1691 -7156
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +25626 -150
- package/dist/commons/events/event.d.ts +4 -4
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locations.d.ts +15 -19
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/availableActions.d.ts +2 -1
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +23 -19
- package/dist/commons/events/state/utils.d.ts +130 -112
- package/dist/commons/events/test.utils.d.ts +17 -8
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +51339 -362
- package/dist/commons/notification/UserNotifications.d.ts +55 -636
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +38 -5
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1810 -1550
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1430 -1412
- package/dist/scopes/index.d.ts +167 -132
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +133 -94
- package/package.json +5 -5
|
@@ -4,6 +4,7 @@ import { ITokenPayload as TokenPayload, Scope } from '../authentication';
|
|
|
4
4
|
import { PartialSchema as AjvJSONSchemaType } from 'ajv/dist/types/json-schema';
|
|
5
5
|
import { userSerializer } from '../events/serializers/user/serializer';
|
|
6
6
|
import { UUID } from '../uuid';
|
|
7
|
+
import { EventStatus } from '../events/EventMetadata';
|
|
7
8
|
/** @knipignore */
|
|
8
9
|
export type JSONSchema = {
|
|
9
10
|
$id: string;
|
|
@@ -27,7 +28,11 @@ export type FormConditionalParameters = CommonConditionalParameters & {
|
|
|
27
28
|
id: UUID;
|
|
28
29
|
}>;
|
|
29
30
|
};
|
|
30
|
-
export type
|
|
31
|
+
export type EventStateConditionalParameters = CommonConditionalParameters & {
|
|
32
|
+
$flags: string[];
|
|
33
|
+
$status: EventStatus;
|
|
34
|
+
};
|
|
35
|
+
export type ConditionalParameters = UserConditionalParameters | EventConditionalParameters | FormConditionalParameters | EventStateConditionalParameters;
|
|
31
36
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
32
37
|
type AjvJSONSchema = AjvJSONSchemaType<UnionToIntersection<ConditionalParameters>>;
|
|
33
38
|
/**
|
|
@@ -79,6 +84,10 @@ export declare const user: typeof userSerializer & {
|
|
|
79
84
|
};
|
|
80
85
|
};
|
|
81
86
|
export declare function isFieldReference(value: unknown): value is FieldReference;
|
|
87
|
+
/** Check if an event flag is present */
|
|
88
|
+
export declare function flag(flagvalue: string): JSONSchema;
|
|
89
|
+
/** Check if an event flag is present */
|
|
90
|
+
export declare function status(statusValue: EventStatus): JSONSchema;
|
|
82
91
|
/**
|
|
83
92
|
* Generate conditional rules for a form field.
|
|
84
93
|
*
|
|
@@ -6,12 +6,12 @@ import { FieldUpdateValue, FieldValue } from '../events/FieldValue';
|
|
|
6
6
|
import { TranslationConfig } from '../events/TranslationConfig';
|
|
7
7
|
import { ITokenPayload } from '../authentication';
|
|
8
8
|
import { UUID } from '../uuid';
|
|
9
|
-
import { ActionType, EventDocument } from '../client';
|
|
9
|
+
import { ActionConfig, ActionType, EventIndex, EventDocument } from '../client';
|
|
10
10
|
export declare function validate(schema: JSONSchema, data: ConditionalParameters): boolean;
|
|
11
11
|
export declare function validateValue(schema: JSONSchema, data: unknown): boolean;
|
|
12
12
|
export declare function isOnline(): boolean;
|
|
13
|
-
export declare function isConditionMet(conditional: JSONSchema, values: EventState | ActionUpdate, context: ValidatorContext): boolean;
|
|
14
|
-
export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, FieldValue>, context: ValidatorContext): boolean;
|
|
13
|
+
export declare function isConditionMet(conditional: JSONSchema, values: EventState | ActionUpdate, context: ValidatorContext, eventIndex?: EventIndex): boolean;
|
|
14
|
+
export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, FieldValue>, context: ValidatorContext, event: EventIndex): boolean;
|
|
15
15
|
export type ValidatorContext = {
|
|
16
16
|
user?: ITokenPayload;
|
|
17
17
|
leafAdminStructureLocationIds?: Array<{
|
|
@@ -22,6 +22,9 @@ export type ValidatorContext = {
|
|
|
22
22
|
export declare function isFieldVisible(field: FieldConfig, form: Partial<ActionUpdate | EventState>, context: ValidatorContext): boolean;
|
|
23
23
|
export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
|
|
24
24
|
export declare function isFieldDisplayedOnReview(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
|
|
25
|
+
export declare function isActionEnabled(actionConfig: ActionConfig, event: EventIndex, context: ValidatorContext): boolean;
|
|
26
|
+
export declare function isActionVisible(actionConfig: ActionConfig, event: EventIndex, context: ValidatorContext): boolean;
|
|
27
|
+
export declare function isActionAvailable(actionConfig: ActionConfig, event: EventIndex, context: ValidatorContext): boolean;
|
|
25
28
|
export declare const errorMessages: {
|
|
26
29
|
hiddenField: {
|
|
27
30
|
id: string;
|
|
@@ -94,7 +97,11 @@ export declare function runFieldValidations({ field, values, context }: {
|
|
|
94
97
|
values: ActionUpdate;
|
|
95
98
|
context: ValidatorContext;
|
|
96
99
|
}): {
|
|
97
|
-
message:
|
|
100
|
+
message: {
|
|
101
|
+
id: string;
|
|
102
|
+
defaultMessage: string;
|
|
103
|
+
description: string;
|
|
104
|
+
};
|
|
98
105
|
}[];
|
|
99
106
|
export declare function getValidatorsForField(fieldId: FieldConfig['id'], validations: NonNullable<FieldConfig['validation']>): NonNullable<FieldConfig['validation']>;
|
|
100
107
|
export declare function areCertificateConditionsMet(conditions: FieldConditional[], values: ConditionalParameters): boolean;
|