@opencrvs/toolkit 1.8.0-rc.f97f8f2 → 1.8.0-rc.f988670

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.
Files changed (46) hide show
  1. package/dist/commons/api/router.d.ts +10613 -8753
  2. package/dist/commons/conditionals/conditionals.d.ts +7 -14
  3. package/dist/commons/conditionals/validate.d.ts +14 -0
  4. package/dist/commons/events/ActionConfig.d.ts +82300 -42816
  5. package/dist/commons/events/ActionDocument.d.ts +3996 -1262
  6. package/dist/commons/events/ActionInput.d.ts +3139 -967
  7. package/dist/commons/events/ActionType.d.ts +4 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +981 -47
  9. package/dist/commons/events/CompositeFieldValue.d.ts +37 -9
  10. package/dist/commons/events/Constants.d.ts +3 -0
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +3069 -443
  12. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  13. package/dist/commons/events/Draft.d.ts +273 -95
  14. package/dist/commons/events/EventConfig.d.ts +33357 -14451
  15. package/dist/commons/events/EventDocument.d.ts +2554 -848
  16. package/dist/commons/events/EventIndex.d.ts +1281 -495
  17. package/dist/commons/events/EventInput.d.ts +0 -13
  18. package/dist/commons/events/EventMetadata.d.ts +126 -92
  19. package/dist/commons/events/FieldConfig.d.ts +4564 -1588
  20. package/dist/commons/events/FieldType.d.ts +10 -1
  21. package/dist/commons/events/FieldTypeMapping.d.ts +149 -75
  22. package/dist/commons/events/FieldValue.d.ts +87 -20
  23. package/dist/commons/events/FormConfig.d.ts +22178 -8396
  24. package/dist/commons/events/PageConfig.d.ts +5525 -2087
  25. package/dist/commons/events/SummaryConfig.d.ts +0 -5
  26. package/dist/commons/events/User.d.ts +6 -3
  27. package/dist/commons/events/WorkqueueColumnConfig.d.ts +18 -7
  28. package/dist/commons/events/WorkqueueConfig.d.ts +6406 -1001
  29. package/dist/commons/events/defineConfig.d.ts +3797 -870
  30. package/dist/commons/events/event.d.ts +41 -14
  31. package/dist/commons/events/field.d.ts +55 -15
  32. package/dist/commons/events/index.d.ts +2 -0
  33. package/dist/commons/events/scopes.d.ts +21 -3
  34. package/dist/commons/events/test.utils.d.ts +208 -54
  35. package/dist/commons/events/transactions.d.ts +1 -1
  36. package/dist/commons/events/utils.d.ts +14039 -1170
  37. package/dist/conditionals/index.js +69 -62
  38. package/dist/events/index.js +3836 -1956
  39. package/dist/scopes/index.d.ts +147 -5
  40. package/dist/scopes/index.js +133 -43
  41. package/package.json +3 -3
  42. package/tsconfig.json +1 -1
  43. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  44. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  45. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  46. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,11 +1,11 @@
1
1
  import { EventDocument } from '../events/EventDocument';
2
2
  import { EventState } from '../events/ActionDocument';
3
3
  import { ITokenPayload as TokenPayload, Scope } from '../authentication';
4
- import { ActionType } from '../events/ActionType';
5
4
  import { PartialSchema as AjvJSONSchemaType } from 'ajv/dist/types/json-schema';
6
5
  import { userSerializer } from '../events/serializers/user/serializer';
7
6
  /** @knipignore */
8
7
  export type JSONSchema = {
8
+ $id: string;
9
9
  readonly __nominal__type: 'JSONSchema';
10
10
  };
11
11
  export declare function defineConditional(schema: any): JSONSchema;
@@ -62,20 +62,8 @@ export declare function never(): JSONSchema;
62
62
  export declare const user: typeof userSerializer & {
63
63
  hasScope: (scope: Scope) => JSONSchema;
64
64
  };
65
- /**
66
- *
67
- * Generate conditional rules for event.
68
- */
69
- export declare function createEventConditionals(): {
70
- /**
71
- * Checks if the event contains a specific action type.
72
- * @param action - The action type to check for.
73
- */
74
- hasAction: (action: ActionType) => JSONSchema;
75
- };
76
65
  type FieldReference = {
77
- _fieldId: string;
78
- [key: string]: unknown;
66
+ $$field: string;
79
67
  };
80
68
  /**
81
69
  * Generate conditional rules for a form field.
@@ -86,6 +74,10 @@ type FieldReference = {
86
74
  *
87
75
  */
88
76
  export declare function createFieldConditionals(fieldId: string): {
77
+ /**
78
+ * @private Internal property used for field reference tracking.
79
+ */
80
+ $$field: string;
89
81
  isAfter: () => {
90
82
  days: (days: number) => {
91
83
  inPast: () => JSONSchema;
@@ -125,6 +117,7 @@ export declare function createFieldConditionals(fieldId: string): {
125
117
  getId: () => {
126
118
  fieldId: string;
127
119
  };
120
+ object: (options: Record<string, any>) => JSONSchema;
128
121
  };
129
122
  export {};
130
123
  //# sourceMappingURL=conditionals.d.ts.map
@@ -36,6 +36,11 @@ export declare const errorMessages: {
36
36
  description: string;
37
37
  id: string;
38
38
  };
39
+ unexpectedField: {
40
+ defaultMessage: string;
41
+ description: string;
42
+ id: string;
43
+ };
39
44
  };
40
45
  /**
41
46
  * Custom error map for Zod to override the default error messages in intl-formik format.
@@ -58,6 +63,14 @@ export declare function validateFieldInput({ field, value }: {
58
63
  }): {
59
64
  message: TranslationConfig;
60
65
  }[];
66
+ export declare function runStructuralValidations({ field, values }: {
67
+ field: FieldConfig;
68
+ values: ActionUpdate;
69
+ }): {
70
+ errors: {
71
+ message: TranslationConfig;
72
+ }[];
73
+ };
61
74
  export declare function runFieldValidations({ field, values }: {
62
75
  field: FieldConfig;
63
76
  values: ActionUpdate;
@@ -66,4 +79,5 @@ export declare function runFieldValidations({ field, values }: {
66
79
  message: TranslationConfig;
67
80
  }[];
68
81
  };
82
+ export declare function getValidatorsForField(fieldId: FieldConfig['id'], validations: NonNullable<FieldConfig['validation']>): NonNullable<FieldConfig['validation']>;
69
83
  //# sourceMappingURL=validate.d.ts.map