@opencrvs/toolkit 1.8.1-rc.38ac682 → 1.8.1-rc.3a45fd9

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 (40) hide show
  1. package/build.sh +5 -0
  2. package/dist/commons/api/router.d.ts +409 -392
  3. package/dist/commons/conditionals/validate.d.ts +11 -2
  4. package/dist/commons/events/ActionConfig.d.ts +3441 -5805
  5. package/dist/commons/events/ActionDocument.d.ts +1252 -716
  6. package/dist/commons/events/ActionInput.d.ts +626 -600
  7. package/dist/commons/events/AdvancedSearchConfig.d.ts +83 -65
  8. package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
  9. package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
  10. package/dist/commons/events/Draft.d.ts +48 -48
  11. package/dist/commons/events/EventConfig.d.ts +1401 -2663
  12. package/dist/commons/events/EventDocument.d.ts +451 -432
  13. package/dist/commons/events/EventIndex.d.ts +184 -62
  14. package/dist/commons/events/EventMetadata.d.ts +9 -9
  15. package/dist/commons/events/FieldConfig.d.ts +254 -343
  16. package/dist/commons/events/FieldType.d.ts +1 -2
  17. package/dist/commons/events/FieldTypeMapping.d.ts +18 -25
  18. package/dist/commons/events/FieldValue.d.ts +12 -12
  19. package/dist/commons/events/FormConfig.d.ts +1296 -2388
  20. package/dist/commons/events/PageConfig.d.ts +264 -508
  21. package/dist/commons/events/WorkqueueConfig.d.ts +288 -164
  22. package/dist/commons/events/defineConfig.d.ts +129 -309
  23. package/dist/commons/events/event.d.ts +68 -6
  24. package/dist/commons/events/field.d.ts +14 -0
  25. package/dist/commons/events/test.utils.d.ts +12 -12
  26. package/dist/commons/events/utils.d.ts +248 -568
  27. package/dist/commons/notification/UserNotifications.d.ts +543 -0
  28. package/dist/commons/notification/index.d.ts +2 -0
  29. package/dist/conditionals/index.js +3 -2
  30. package/dist/events/index.js +258 -114
  31. package/dist/notification/index.d.ts +2 -0
  32. package/dist/notification/index.d.ts.map +1 -0
  33. package/dist/notification/index.js +5354 -0
  34. package/package.json +1 -1
  35. package/tsconfig.json +3 -2
  36. package/tsconfig.tsbuildinfo +1 -1
  37. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  38. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  39. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  40. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,5 +1,5 @@
1
1
  import { ActionType } from './ActionType';
2
- import { EventFieldId } from './AdvancedSearchConfig';
2
+ import { EventFieldIdInput } from './AdvancedSearchConfig';
3
3
  import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
4
4
  /**
5
5
  * Creates a function that acts like a callable + static method container.
@@ -8,9 +8,9 @@ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConf
8
8
  * event('status') // → returns search config
9
9
  * event.hasAction('CLICKED') // → returns conditional
10
10
  */
11
- declare function eventFn(fieldId: EventFieldId): {
11
+ declare function eventFn(fieldId: EventFieldIdInput): {
12
12
  range: () => {
13
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
13
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
14
14
  fieldType: "event";
15
15
  } & {
16
16
  config: {
@@ -18,7 +18,7 @@ declare function eventFn(fieldId: EventFieldId): {
18
18
  };
19
19
  };
20
20
  exact: () => {
21
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
21
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
22
22
  fieldType: "event";
23
23
  } & {
24
24
  config: {
@@ -26,20 +26,82 @@ declare function eventFn(fieldId: EventFieldId): {
26
26
  };
27
27
  };
28
28
  fuzzy: () => {
29
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
29
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
30
30
  fieldType: "event";
31
31
  } & {
32
32
  config: {
33
33
  type: "fuzzy";
34
34
  };
35
35
  };
36
+ within: () => {
37
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
38
+ fieldType: "event";
39
+ } & {
40
+ config: {
41
+ type: "within";
42
+ };
43
+ };
36
44
  };
37
45
  declare const event: typeof eventFn & {
38
46
  /**
39
47
  * Checks if the event contains a specific action type.
48
+ * Can be used directly as a conditional or chained with additional methods.
40
49
  * @param action - The action type to check for.
41
50
  */
42
- hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
51
+ hasAction: (action: ActionType) => {
52
+ /**
53
+ * Creates a conditional that checks if the event contains a specific action type
54
+ * with a minimum count of occurrences.
55
+ *
56
+ * @param minCount - The minimum number of actions required.
57
+ */
58
+ minCount: (minCount: number) => import("../conditionals/conditionals").JSONSchema;
59
+ /**
60
+ * Builds a conditional that sets a maximum count for the number of actions.
61
+ * This is useful for limiting the number of actions of a specific type in a single event.
62
+ */
63
+ maxCount: (maxCount: number) => import("../conditionals/conditionals").JSONSchema;
64
+ /**
65
+ * Adds additional field constraints to the action matching.
66
+ *
67
+ * @param fields - Object containing additional fields to match on the action.
68
+ */
69
+ withFields: (fields: Record<string, unknown>) => {
70
+ /**
71
+ * Creates a conditional that checks if the event contains a specific action type
72
+ * with a minimum count of occurrences.
73
+ *
74
+ * @param minCount - The minimum number of actions required.
75
+ */
76
+ minCount: (minCount: number) => import("../conditionals/conditionals").JSONSchema;
77
+ /**
78
+ * Builds a conditional that sets a maximum count for the number of actions.
79
+ * This is useful for limiting the number of actions of a specific type in a single event.
80
+ */
81
+ maxCount: (maxCount: number) => import("../conditionals/conditionals").JSONSchema;
82
+ };
83
+ /**
84
+ * Adds template ID constraint to the action matching.
85
+ * This is a convenience method that adds content.templateId to the fields.
86
+ *
87
+ * @param id - The template ID to match against.
88
+ */
89
+ withTemplate: (id: string) => {
90
+ /**
91
+ * Creates a conditional that checks if the event contains a specific action type
92
+ * with a minimum count of occurrences.
93
+ *
94
+ * @param minCount - The minimum number of actions required.
95
+ */
96
+ minCount: (minCount: number) => import("../conditionals/conditionals").JSONSchema;
97
+ /**
98
+ * Builds a conditional that sets a maximum count for the number of actions.
99
+ * This is useful for limiting the number of actions of a specific type in a single event.
100
+ */
101
+ maxCount: (maxCount: number) => import("../conditionals/conditionals").JSONSchema;
102
+ };
103
+ __nominal__type: "JSONSchema";
104
+ };
43
105
  field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
44
106
  };
45
107
  export { event };
@@ -56,6 +56,20 @@ export declare function field(fieldId: string, options?: {
56
56
  type: "fuzzy";
57
57
  };
58
58
  };
59
+ within: () => {
60
+ options?: SelectOption[];
61
+ excludeInSearchQuery?: boolean;
62
+ alternateFieldIds?: string[];
63
+ conditionals?: FieldConditional[];
64
+ validations?: ValidationConfig[];
65
+ searchCriteriaLabelPrefix?: TranslationConfig;
66
+ fieldId: string;
67
+ fieldType: "field";
68
+ } & {
69
+ config: {
70
+ type: "within";
71
+ };
72
+ };
59
73
  $$field: string;
60
74
  isAfter: () => {
61
75
  days: (days: number) => {
@@ -67,8 +67,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
67
67
  street?: string | null | undefined;
68
68
  zipCode?: string | null | undefined;
69
69
  } | {
70
- firstname?: string | null | undefined;
71
- surname?: string | null | undefined;
70
+ firstname: string;
71
+ surname: string;
72
72
  middlename?: string | null | undefined;
73
73
  } | {
74
74
  country: string;
@@ -123,8 +123,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
123
123
  street?: string | null | undefined;
124
124
  zipCode?: string | null | undefined;
125
125
  } | {
126
- firstname?: string | null | undefined;
127
- surname?: string | null | undefined;
126
+ firstname: string;
127
+ surname: string;
128
128
  middlename?: string | null | undefined;
129
129
  } | {
130
130
  country: string;
@@ -173,8 +173,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
173
173
  street?: string | null | undefined;
174
174
  zipCode?: string | null | undefined;
175
175
  } | {
176
- firstname?: string | null | undefined;
177
- surname?: string | null | undefined;
176
+ firstname: string;
177
+ surname: string;
178
178
  middlename?: string | null | undefined;
179
179
  } | {
180
180
  country: string;
@@ -240,8 +240,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
240
240
  street?: string | null | undefined;
241
241
  zipCode?: string | null | undefined;
242
242
  } | {
243
- firstname?: string | null | undefined;
244
- surname?: string | null | undefined;
243
+ firstname: string;
244
+ surname: string;
245
245
  middlename?: string | null | undefined;
246
246
  } | {
247
247
  country: string;
@@ -309,8 +309,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
309
309
  street?: string | null | undefined;
310
310
  zipCode?: string | null | undefined;
311
311
  } | {
312
- firstname?: string | null | undefined;
313
- surname?: string | null | undefined;
312
+ firstname: string;
313
+ surname: string;
314
314
  middlename?: string | null | undefined;
315
315
  } | {
316
316
  country: string;
@@ -372,8 +372,8 @@ export declare function eventPayloadGenerator(rng: () => number): {
372
372
  street?: string | null | undefined;
373
373
  zipCode?: string | null | undefined;
374
374
  } | {
375
- firstname?: string | null | undefined;
376
- surname?: string | null | undefined;
375
+ firstname: string;
376
+ surname: string;
377
377
  middlename?: string | null | undefined;
378
378
  } | {
379
379
  country: string;