@opencrvs/toolkit 1.8.0-rc.f8a9481 → 1.8.0-rc.f8be155

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 (42) hide show
  1. package/dist/commons/api/router.d.ts +13997 -988
  2. package/dist/commons/conditionals/conditionals.d.ts +14 -6
  3. package/dist/commons/conditionals/validate.d.ts +6 -0
  4. package/dist/commons/events/ActionConfig.d.ts +117418 -1729
  5. package/dist/commons/events/ActionDocument.d.ts +2270 -554
  6. package/dist/commons/events/ActionInput.d.ts +1637 -365
  7. package/dist/commons/events/ActionType.d.ts +4 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
  9. package/dist/commons/events/CompositeFieldValue.d.ts +28 -0
  10. package/dist/commons/events/Constants.d.ts +3 -0
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  12. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  13. package/dist/commons/events/Draft.d.ts +143 -39
  14. package/dist/commons/events/EventConfig.d.ts +56291 -1361
  15. package/dist/commons/events/EventDocument.d.ts +1399 -394
  16. package/dist/commons/events/EventIndex.d.ts +1589 -30
  17. package/dist/commons/events/EventMetadata.d.ts +298 -48
  18. package/dist/commons/events/FieldConfig.d.ts +5414 -1057
  19. package/dist/commons/events/FieldType.d.ts +6 -3
  20. package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
  21. package/dist/commons/events/FieldValue.d.ts +49 -8
  22. package/dist/commons/events/FormConfig.d.ts +49156 -514
  23. package/dist/commons/events/PageConfig.d.ts +12206 -204
  24. package/dist/commons/events/SummaryConfig.d.ts +17 -52
  25. package/dist/commons/events/User.d.ts +31 -7
  26. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  27. package/dist/commons/events/WorkqueueConfig.d.ts +4775 -16
  28. package/dist/commons/events/defineConfig.d.ts +8981 -51
  29. package/dist/commons/events/event.d.ts +54 -0
  30. package/dist/commons/events/field.d.ts +77 -0
  31. package/dist/commons/events/index.d.ts +6 -0
  32. package/dist/commons/events/scopes.d.ts +21 -1
  33. package/dist/commons/events/serializer.d.ts +2 -0
  34. package/dist/commons/events/test.utils.d.ts +149 -79
  35. package/dist/commons/events/transactions.d.ts +1 -1
  36. package/dist/commons/events/utils.d.ts +13353 -68
  37. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  38. package/dist/conditionals/index.js +76 -36
  39. package/dist/events/index.js +3464 -1333
  40. package/dist/scopes/index.d.ts +158 -1
  41. package/dist/scopes/index.js +152 -1
  42. package/package.json +3 -2
@@ -3,6 +3,7 @@ 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';
6
+ import { userSerializer } from '../events/serializers/user/serializer';
6
7
  /** @knipignore */
7
8
  export type JSONSchema = {
8
9
  readonly __nominal__type: 'JSONSchema';
@@ -58,19 +59,22 @@ export declare function never(): JSONSchema;
58
59
  *
59
60
  * Generate conditional rules for user.
60
61
  */
61
- export declare const user: {
62
+ export declare const user: typeof userSerializer & {
62
63
  hasScope: (scope: Scope) => JSONSchema;
63
64
  };
64
65
  /**
65
66
  *
66
67
  * Generate conditional rules for event.
67
68
  */
68
- export declare const event: {
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
+ */
69
74
  hasAction: (action: ActionType) => JSONSchema;
70
75
  };
71
76
  type FieldReference = {
72
- _fieldId: string;
73
- [key: string]: unknown;
77
+ $$field: string;
74
78
  };
75
79
  /**
76
80
  * Generate conditional rules for a form field.
@@ -80,11 +84,11 @@ type FieldReference = {
80
84
  * and(field('foo').isEqualTo('bar'), field('baz').isUndefined())
81
85
  *
82
86
  */
83
- export declare function field(fieldId: string): {
87
+ export declare function createFieldConditionals(fieldId: string): {
84
88
  /**
85
89
  * @private Internal property used for field reference tracking.
86
90
  */
87
- _fieldId: string;
91
+ $$field: string;
88
92
  isAfter: () => {
89
93
  days: (days: number) => {
90
94
  inPast: () => JSONSchema;
@@ -121,6 +125,10 @@ export declare function field(fieldId: string): {
121
125
  */
122
126
  matches: (pattern: string) => JSONSchema;
123
127
  isBetween: (min: number, max: number) => JSONSchema;
128
+ getId: () => {
129
+ fieldId: string;
130
+ };
131
+ object: (options: Record<string, any>) => JSONSchema;
124
132
  };
125
133
  export {};
126
134
  //# 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.
@@ -66,4 +71,5 @@ export declare function runFieldValidations({ field, values }: {
66
71
  message: TranslationConfig;
67
72
  }[];
68
73
  };
74
+ export declare function getValidatorsForField(fieldId: FieldConfig['id'], validations: NonNullable<FieldConfig['validation']>): NonNullable<FieldConfig['validation']>;
69
75
  //# sourceMappingURL=validate.d.ts.map