@opencrvs/toolkit 1.8.0-rc.fcd89ec → 1.8.0-rc.fcf7cb3

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 (48) hide show
  1. package/dist/commons/api/router.d.ts +8046 -8610
  2. package/dist/commons/conditionals/conditionals.d.ts +8 -15
  3. package/dist/commons/conditionals/validate.d.ts +14 -0
  4. package/dist/commons/events/ActionConfig.d.ts +68541 -36072
  5. package/dist/commons/events/ActionDocument.d.ts +3961 -1227
  6. package/dist/commons/events/ActionInput.d.ts +3138 -966
  7. package/dist/commons/events/ActionType.d.ts +4 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +414 -71
  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 +4132 -0
  12. package/dist/commons/events/CreatedAtLocation.d.ts +1 -2
  13. package/dist/commons/events/Draft.d.ts +271 -93
  14. package/dist/commons/events/EventConfig.d.ts +33783 -18386
  15. package/dist/commons/events/EventDocument.d.ts +2522 -816
  16. package/dist/commons/events/EventIndex.d.ts +1411 -313
  17. package/dist/commons/events/EventInput.d.ts +0 -13
  18. package/dist/commons/events/EventMetadata.d.ts +113 -76
  19. package/dist/commons/events/FieldConfig.d.ts +4017 -1558
  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 +18663 -8055
  24. package/dist/commons/events/PageConfig.d.ts +4601 -1945
  25. package/dist/commons/events/SummaryConfig.d.ts +0 -5
  26. package/dist/commons/events/User.d.ts +34 -7
  27. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  28. package/dist/commons/events/WorkqueueConfig.d.ts +7802 -308
  29. package/dist/commons/events/defineConfig.d.ts +3535 -860
  30. package/dist/commons/events/event.d.ts +21 -21
  31. package/dist/commons/events/field.d.ts +36 -10
  32. package/dist/commons/events/index.d.ts +5 -0
  33. package/dist/commons/events/scopes.d.ts +1 -2
  34. package/dist/commons/events/serializer.d.ts +2 -0
  35. package/dist/commons/events/test.utils.d.ts +206 -52
  36. package/dist/commons/events/transactions.d.ts +1 -1
  37. package/dist/commons/events/utils.d.ts +14324 -1570
  38. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  39. package/dist/conditionals/index.js +70 -62
  40. package/dist/events/index.js +3527 -1656
  41. package/dist/scopes/index.d.ts +96 -7
  42. package/dist/scopes/index.js +105 -26
  43. package/package.json +3 -3
  44. package/tsconfig.json +1 -1
  45. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  46. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  47. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  48. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,8 +1,8 @@
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';
5
+ import { userSerializer } from '../events/serializers/user/serializer';
6
6
  /** @knipignore */
7
7
  export type JSONSchema = {
8
8
  readonly __nominal__type: 'JSONSchema';
@@ -58,23 +58,11 @@ export declare function never(): JSONSchema;
58
58
  *
59
59
  * Generate conditional rules for user.
60
60
  */
61
- export declare const user: {
61
+ export declare const user: typeof userSerializer & {
62
62
  hasScope: (scope: Scope) => JSONSchema;
63
63
  };
64
- /**
65
- *
66
- * Generate conditional rules for event.
67
- */
68
- export declare function createEventConditionals(): {
69
- /**
70
- * Checks if the event contains a specific action type.
71
- * @param action - The action type to check for.
72
- */
73
- hasAction: (action: ActionType) => JSONSchema;
74
- };
75
64
  type FieldReference = {
76
- _fieldId: string;
77
- [key: string]: unknown;
65
+ $$field: string;
78
66
  };
79
67
  /**
80
68
  * Generate conditional rules for a form field.
@@ -85,6 +73,10 @@ type FieldReference = {
85
73
  *
86
74
  */
87
75
  export declare function createFieldConditionals(fieldId: string): {
76
+ /**
77
+ * @private Internal property used for field reference tracking.
78
+ */
79
+ $$field: string;
88
80
  isAfter: () => {
89
81
  days: (days: number) => {
90
82
  inPast: () => JSONSchema;
@@ -124,6 +116,7 @@ export declare function createFieldConditionals(fieldId: string): {
124
116
  getId: () => {
125
117
  fieldId: string;
126
118
  };
119
+ object: (options: Record<string, any>) => JSONSchema;
127
120
  };
128
121
  export {};
129
122
  //# 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