@opencrvs/toolkit 1.8.0-rc.fc43738 → 1.8.0-rc.feaeeb7
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 +2498 -2498
- package/dist/commons/conditionals/conditionals.d.ts +2 -2
- package/dist/commons/conditionals/validate.d.ts +6 -6
- package/dist/commons/events/ActionDocument.d.ts +1117 -1110
- package/dist/commons/events/ActionInput.d.ts +1664 -1664
- package/dist/commons/events/CompositeFieldValue.d.ts +264 -0
- package/dist/commons/events/Draft.d.ts +152 -152
- package/dist/commons/events/EventDocument.d.ts +1320 -1320
- package/dist/commons/events/EventIndex.d.ts +3 -3
- package/dist/commons/events/EventMetadata.d.ts +3 -3
- package/dist/commons/events/FieldConfig.d.ts +2 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +122 -38
- package/dist/commons/events/FieldValue.d.ts +62 -65
- package/dist/commons/events/TemplateConfig.d.ts +18 -0
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +72 -66
- package/dist/commons/events/utils.d.ts +2 -3
- package/dist/events/index.js +517 -414
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { EventDocument } from '../events/EventDocument';
|
2
|
-
import {
|
2
|
+
import { EventState } from '../events/ActionDocument';
|
3
3
|
import { ITokenPayload as TokenPayload, Scope } from '../authentication';
|
4
4
|
import { ActionType } from '../events/ActionType';
|
5
5
|
import { PartialSchema as AjvJSONSchemaType } from 'ajv/dist/types/json-schema';
|
@@ -18,7 +18,7 @@ export type EventConditionalParameters = {
|
|
18
18
|
};
|
19
19
|
export type FormConditionalParameters = {
|
20
20
|
$now: string;
|
21
|
-
$form:
|
21
|
+
$form: EventState | Record<string, any>;
|
22
22
|
};
|
23
23
|
export type ConditionalParameters = UserConditionalParameters | EventConditionalParameters | FormConditionalParameters;
|
24
24
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { ConditionalParameters, JSONSchema } from './conditionals';
|
2
|
-
import {
|
2
|
+
import { EventState, ActionUpdate } from '../events/ActionDocument';
|
3
3
|
import { FieldConfig } from '../events/FieldConfig';
|
4
|
-
import {
|
4
|
+
import { FieldUpdateValue } from '../events/FieldValue';
|
5
5
|
import { TranslationConfig } from '../events/TranslationConfig';
|
6
6
|
export declare function validate(schema: JSONSchema, data: ConditionalParameters): boolean;
|
7
|
-
export declare function isFieldVisible(field: FieldConfig, form:
|
8
|
-
export declare function isFieldEnabled(field: FieldConfig, form:
|
7
|
+
export declare function isFieldVisible(field: FieldConfig, form: ActionUpdate | EventState): boolean;
|
8
|
+
export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState): boolean;
|
9
9
|
/**
|
10
10
|
* Custom error map for Zod to override the default error messages in intl-formik format.
|
11
11
|
*/
|
@@ -23,7 +23,7 @@ export type CustomZodToIntlErrorMap = {
|
|
23
23
|
*/
|
24
24
|
export declare function getFieldValidationErrors({ field, values }: {
|
25
25
|
field: FieldConfig;
|
26
|
-
values:
|
26
|
+
values: ActionUpdate;
|
27
27
|
}): {
|
28
28
|
errors: {
|
29
29
|
message: {
|
@@ -40,7 +40,7 @@ export declare function getFieldValidationErrors({ field, values }: {
|
|
40
40
|
*/
|
41
41
|
export declare function validateFieldInput({ field, value }: {
|
42
42
|
field: FieldConfig;
|
43
|
-
value:
|
43
|
+
value: FieldUpdateValue;
|
44
44
|
}): {
|
45
45
|
message: TranslationConfig;
|
46
46
|
}[];
|