@opencrvs/toolkit 1.8.1-rc.008155b → 1.8.1-rc.020858b

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.
@@ -1,13 +1,62 @@
1
1
  import { ConditionalParameters, JSONSchema } from './conditionals';
2
- import { EventState, ActionUpdate } from '../events/ActionDocument';
2
+ import { ActionUpdate, EventState } from '../events/ActionDocument';
3
+ import { FieldConditional } from '../events/Conditional';
3
4
  import { FieldConfig } from '../events/FieldConfig';
4
5
  import { FieldUpdateValue } from '../events/FieldValue';
5
6
  import { TranslationConfig } from '../events/TranslationConfig';
6
- import { FieldConditional } from '../events/Conditional';
7
7
  export declare function validate(schema: JSONSchema, data: ConditionalParameters): boolean;
8
8
  export declare function isConditionMet(conditional: JSONSchema, values: Record<string, unknown>): boolean;
9
9
  export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, unknown>): boolean;
10
10
  export declare function isFieldVisible(field: FieldConfig, form: ActionUpdate | EventState): boolean;
11
+ export declare function getOnlyVisibleFormValues(field: FieldConfig[], form: EventState): Record<string, string | number | boolean | {
12
+ type: string;
13
+ path: string;
14
+ originalFilename: string;
15
+ } | {
16
+ country: string;
17
+ district: string;
18
+ addressType: "DOMESTIC";
19
+ province: string;
20
+ urbanOrRural: "URBAN";
21
+ number?: string | undefined;
22
+ town?: string | undefined;
23
+ residentialArea?: string | undefined;
24
+ street?: string | undefined;
25
+ zipCode?: string | undefined;
26
+ } | {
27
+ country: string;
28
+ district: string;
29
+ addressType: "DOMESTIC";
30
+ province: string;
31
+ urbanOrRural: "RURAL";
32
+ village?: string | undefined;
33
+ } | {
34
+ firstname: string;
35
+ surname: string;
36
+ middlename?: string | undefined;
37
+ } | {
38
+ firstname: string;
39
+ surname: string;
40
+ middlename?: string | null | undefined;
41
+ } | {
42
+ country: string;
43
+ state: string;
44
+ addressType: "INTERNATIONAL";
45
+ district2: string;
46
+ cityOrTown?: string | undefined;
47
+ addressLine1?: string | undefined;
48
+ addressLine2?: string | undefined;
49
+ addressLine3?: string | undefined;
50
+ postcodeOrZip?: string | undefined;
51
+ } | {
52
+ type: string;
53
+ option: string;
54
+ path: string;
55
+ originalFilename: string;
56
+ }[] | {
57
+ start: string;
58
+ end: string;
59
+ } | null | undefined>;
11
60
  export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState): boolean;
12
61
  export declare function isFieldDisplayedOnReview(field: FieldConfig, form: ActionUpdate | EventState): boolean;
13
62
  export declare const errorMessages: {
@@ -68,6 +117,14 @@ export declare function validateFieldInput({ field, value }: {
68
117
  }): {
69
118
  message: TranslationConfig;
70
119
  }[];
120
+ export declare function runStructuralValidations({ field, values }: {
121
+ field: FieldConfig;
122
+ values: ActionUpdate;
123
+ }): {
124
+ errors: {
125
+ message: TranslationConfig;
126
+ }[];
127
+ };
71
128
  export declare function runFieldValidations({ field, values }: {
72
129
  field: FieldConfig;
73
130
  values: ActionUpdate;
@@ -77,4 +134,5 @@ export declare function runFieldValidations({ field, values }: {
77
134
  }[];
78
135
  };
79
136
  export declare function getValidatorsForField(fieldId: FieldConfig['id'], validations: NonNullable<FieldConfig['validation']>): NonNullable<FieldConfig['validation']>;
137
+ export declare function areCertificateConditionsMet(conditions: FieldConditional[], values: Record<string, unknown>): boolean;
80
138
  //# sourceMappingURL=validate.d.ts.map