@opencrvs/toolkit 1.8.1-rc.4fba37a → 1.8.1-rc.5130256

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 (33) hide show
  1. package/dist/commons/api/router.d.ts +395 -412
  2. package/dist/commons/conditionals/conditionals.test.d.ts +2 -0
  3. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  4. package/dist/commons/conditionals/validate.d.ts +2 -11
  5. package/dist/commons/conditionals/validate.test.d.ts +2 -0
  6. package/dist/commons/events/ActionConfig.d.ts +9396 -8676
  7. package/dist/commons/events/ActionDocument.d.ts +716 -1252
  8. package/dist/commons/events/ActionInput.d.ts +600 -626
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +65 -83
  10. package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
  12. package/dist/commons/events/Draft.d.ts +56 -56
  13. package/dist/commons/events/EventConfig.d.ts +2213 -1443
  14. package/dist/commons/events/EventDocument.d.ts +432 -451
  15. package/dist/commons/events/EventIndex.d.ts +62 -184
  16. package/dist/commons/events/EventMetadata.d.ts +9 -9
  17. package/dist/commons/events/FieldConfig.d.ts +251 -944
  18. package/dist/commons/events/FieldType.d.ts +2 -6
  19. package/dist/commons/events/FieldTypeMapping.d.ts +25 -18
  20. package/dist/commons/events/FieldValue.d.ts +12 -12
  21. package/dist/commons/events/FormConfig.d.ts +3874 -3574
  22. package/dist/commons/events/PageConfig.d.ts +544 -524
  23. package/dist/commons/events/WorkqueueConfig.d.ts +164 -288
  24. package/dist/commons/events/defineConfig.d.ts +327 -183
  25. package/dist/commons/events/event.d.ts +6 -68
  26. package/dist/commons/events/field.d.ts +0 -14
  27. package/dist/commons/events/test.utils.d.ts +13 -14
  28. package/dist/commons/events/utils.d.ts +701 -351
  29. package/dist/commons/events/utils.test.d.ts +2 -0
  30. package/dist/conditionals/index.js +2 -3
  31. package/dist/events/index.js +881 -1101
  32. package/package.json +1 -1
  33. package/tsconfig.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { ActionType } from './ActionType';
2
- import { EventFieldIdInput } from './AdvancedSearchConfig';
2
+ import { EventFieldId } 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: EventFieldIdInput): {
11
+ declare function eventFn(fieldId: EventFieldId): {
12
12
  range: () => {
13
- fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
13
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
14
14
  fieldType: "event";
15
15
  } & {
16
16
  config: {
@@ -18,7 +18,7 @@ declare function eventFn(fieldId: EventFieldIdInput): {
18
18
  };
19
19
  };
20
20
  exact: () => {
21
- fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
21
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
22
22
  fieldType: "event";
23
23
  } & {
24
24
  config: {
@@ -26,82 +26,20 @@ declare function eventFn(fieldId: EventFieldIdInput): {
26
26
  };
27
27
  };
28
28
  fuzzy: () => {
29
- fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
29
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "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
- };
44
36
  };
45
37
  declare const event: typeof eventFn & {
46
38
  /**
47
39
  * Checks if the event contains a specific action type.
48
- * Can be used directly as a conditional or chained with additional methods.
49
40
  * @param action - The action type to check for.
50
41
  */
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
- };
42
+ hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
105
43
  field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
106
44
  };
107
45
  export { event };
@@ -56,20 +56,6 @@ 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
- };
73
59
  $$field: string;
74
60
  isAfter: () => {
75
61
  days: (days: number) => {
@@ -45,7 +45,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
45
45
  };
46
46
  draft: ({ eventId, actionType, annotation }: {
47
47
  eventId: UUID;
48
- actionType: Draft["action"]["type"];
48
+ actionType: ActionType;
49
49
  annotation?: Record<string, any>;
50
50
  }, input?: Partial<Draft>) => Draft;
51
51
  actions: {
@@ -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;
71
- surname: string;
70
+ firstname?: string | null | undefined;
71
+ surname?: string | null | undefined;
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;
127
- surname: string;
126
+ firstname?: string | null | undefined;
127
+ surname?: string | null | undefined;
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;
177
- surname: string;
176
+ firstname?: string | null | undefined;
177
+ surname?: string | null | undefined;
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;
244
- surname: string;
243
+ firstname?: string | null | undefined;
244
+ surname?: string | null | undefined;
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;
313
- surname: string;
312
+ firstname?: string | null | undefined;
313
+ surname?: string | null | undefined;
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;
376
- surname: string;
375
+ firstname?: string | null | undefined;
376
+ surname?: string | null | undefined;
377
377
  middlename?: string | null | undefined;
378
378
  } | {
379
379
  country: string;
@@ -458,7 +458,6 @@ export declare function generateEventDraftDocument({ eventId, actionType, rng, d
458
458
  actionType: ActionType;
459
459
  rng?: () => number;
460
460
  declaration?: EventState;
461
- annotation?: EventState;
462
461
  }): Draft;
463
462
  export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
464
463
  export declare function getRandomDate(rng: () => number, start: string, end: string): string;