@opencrvs/toolkit 1.8.0-rc.fd1df48 → 1.8.0-rc.fd49b3a

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 (30) hide show
  1. package/dist/commons/api/router.d.ts +1806 -922
  2. package/dist/commons/conditionals/conditionals.d.ts +0 -12
  3. package/dist/commons/events/ActionConfig.d.ts +7830 -2014
  4. package/dist/commons/events/ActionDocument.d.ts +1948 -904
  5. package/dist/commons/events/ActionInput.d.ts +1680 -780
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +82 -33
  7. package/dist/commons/events/CompositeFieldValue.d.ts +9 -9
  8. package/dist/commons/events/CountryConfigQueryInput.d.ts +1086 -684
  9. package/dist/commons/events/Draft.d.ts +142 -70
  10. package/dist/commons/events/EventConfig.d.ts +3649 -935
  11. package/dist/commons/events/EventDocument.d.ts +1236 -588
  12. package/dist/commons/events/EventIndex.d.ts +339 -120
  13. package/dist/commons/events/FieldConfig.d.ts +455 -30
  14. package/dist/commons/events/FieldType.d.ts +2 -1
  15. package/dist/commons/events/FieldTypeMapping.d.ts +57 -25
  16. package/dist/commons/events/FieldValue.d.ts +45 -16
  17. package/dist/commons/events/FormConfig.d.ts +3005 -557
  18. package/dist/commons/events/PageConfig.d.ts +646 -38
  19. package/dist/commons/events/User.d.ts +6 -3
  20. package/dist/commons/events/WorkqueueConfig.d.ts +1990 -1174
  21. package/dist/commons/events/defineConfig.d.ts +498 -34
  22. package/dist/commons/events/event.d.ts +10 -18
  23. package/dist/commons/events/field.d.ts +13 -1
  24. package/dist/commons/events/test.utils.d.ts +43 -19
  25. package/dist/commons/events/utils.d.ts +2543 -77
  26. package/dist/conditionals/index.js +2 -34
  27. package/dist/events/index.js +963 -801
  28. package/dist/scopes/index.d.ts +92 -6
  29. package/dist/scopes/index.js +38 -9
  30. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
+ import { ActionType } from './ActionType';
1
2
  import { EventFieldId } from './AdvancedSearchConfig';
2
- import { SelectOption } from './FieldConfig';
3
3
  import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
4
4
  /**
5
5
  * Creates a function that acts like a callable + static method container.
@@ -8,13 +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, options?: SelectOption[]): {
11
+ declare function eventFn(fieldId: EventFieldId): {
12
12
  range: () => {
13
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
14
- options: {
15
- value: string;
16
- label: import("./TranslationConfig").TranslationConfig;
17
- }[] | undefined;
13
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
18
14
  fieldType: "event";
19
15
  } & {
20
16
  config: {
@@ -22,11 +18,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
22
18
  };
23
19
  };
24
20
  exact: () => {
25
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
26
- options: {
27
- value: string;
28
- label: import("./TranslationConfig").TranslationConfig;
29
- }[] | undefined;
21
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
30
22
  fieldType: "event";
31
23
  } & {
32
24
  config: {
@@ -34,11 +26,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
34
26
  };
35
27
  };
36
28
  fuzzy: () => {
37
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
38
- options: {
39
- value: string;
40
- label: import("./TranslationConfig").TranslationConfig;
41
- }[] | undefined;
29
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
42
30
  fieldType: "event";
43
31
  } & {
44
32
  config: {
@@ -47,8 +35,12 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
47
35
  };
48
36
  };
49
37
  declare const event: typeof eventFn & {
38
+ /**
39
+ * Checks if the event contains a specific action type.
40
+ * @param action - The action type to check for.
41
+ */
42
+ hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
50
43
  field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
51
- hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
52
44
  };
53
45
  export { event };
54
46
  //# sourceMappingURL=event.d.ts.map
@@ -1,17 +1,23 @@
1
1
  import { FieldConditional } from './Conditional';
2
2
  import { TranslationConfig } from './TranslationConfig';
3
- import { ValidationConfig } from './FieldConfig';
3
+ import { SelectOption, ValidationConfig } from './FieldConfig';
4
4
  /**
5
5
  * Entry point for defining conditional logic or configuration for a form field.
6
6
  * @param fieldId - The ID of the field to define rules or config for.
7
7
  * @returns An object combining conditional methods and configuration builders.
8
8
  */
9
9
  export declare function field(fieldId: string, options?: {
10
+ options?: SelectOption[];
11
+ excludeInSearchQuery?: boolean;
12
+ alternateFieldIds?: string[];
10
13
  conditionals?: FieldConditional[];
11
14
  validations?: ValidationConfig[];
12
15
  searchCriteriaLabelPrefix?: TranslationConfig;
13
16
  }): {
14
17
  range: () => {
18
+ options?: SelectOption[];
19
+ excludeInSearchQuery?: boolean;
20
+ alternateFieldIds?: string[];
15
21
  conditionals?: FieldConditional[];
16
22
  validations?: ValidationConfig[];
17
23
  searchCriteriaLabelPrefix?: TranslationConfig;
@@ -23,6 +29,9 @@ export declare function field(fieldId: string, options?: {
23
29
  };
24
30
  };
25
31
  exact: () => {
32
+ options?: SelectOption[];
33
+ excludeInSearchQuery?: boolean;
34
+ alternateFieldIds?: string[];
26
35
  conditionals?: FieldConditional[];
27
36
  validations?: ValidationConfig[];
28
37
  searchCriteriaLabelPrefix?: TranslationConfig;
@@ -34,6 +43,9 @@ export declare function field(fieldId: string, options?: {
34
43
  };
35
44
  };
36
45
  fuzzy: () => {
46
+ options?: SelectOption[];
47
+ excludeInSearchQuery?: boolean;
48
+ alternateFieldIds?: string[];
37
49
  conditionals?: FieldConditional[];
38
50
  validations?: ValidationConfig[];
39
51
  searchCriteriaLabelPrefix?: TranslationConfig;
@@ -12,6 +12,11 @@ import { FieldConfig } from './FieldConfig';
12
12
  import { WorkqueueConfig } from './WorkqueueConfig';
13
13
  import { FieldValue } from './FieldValue';
14
14
  import { z } from 'zod';
15
+ /**
16
+ * IANA timezone used in testing. Used for queries that expect similar results independent of the users location (e.g. when event was registered.)
17
+ * Since we query by range, providing UTC offset will result to different results when DST changes during the range.
18
+ */
19
+ export declare const TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
15
20
  /**
16
21
  * In real application, the roles are defined in the countryconfig.
17
22
  * These are just for testing purposes to generate realistic mock data.
@@ -38,16 +43,17 @@ export declare function eventPayloadGenerator(rng: () => number): {
38
43
  type: string;
39
44
  id: string;
40
45
  };
41
- draft: ({ eventId, actionType }: {
46
+ draft: ({ eventId, actionType, annotation }: {
42
47
  eventId: UUID;
43
48
  actionType: ActionType;
49
+ annotation?: Record<string, any>;
44
50
  }, input?: Partial<Draft>) => Draft;
45
51
  actions: {
46
52
  declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
47
53
  transactionId: string;
48
54
  declaration: Record<string, string | number | boolean | {
49
55
  type: string;
50
- filename: string;
56
+ path: string;
51
57
  originalFilename: string;
52
58
  } | {
53
59
  country: string;
@@ -84,9 +90,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
84
90
  } | {
85
91
  type: string;
86
92
  option: string;
87
- filename: string;
93
+ path: string;
88
94
  originalFilename: string;
89
- }[] | [string, string] | null | undefined>;
95
+ }[] | {
96
+ start: string;
97
+ end: string;
98
+ } | null | undefined>;
90
99
  annotation: {};
91
100
  keepAssignment?: boolean | undefined;
92
101
  type: "DECLARE";
@@ -100,7 +109,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
100
109
  transactionId: string;
101
110
  declaration: Record<string, string | number | boolean | {
102
111
  type: string;
103
- filename: string;
112
+ path: string;
104
113
  originalFilename: string;
105
114
  } | {
106
115
  country: string;
@@ -137,9 +146,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
137
146
  } | {
138
147
  type: string;
139
148
  option: string;
140
- filename: string;
149
+ path: string;
141
150
  originalFilename: string;
142
- }[] | [string, string] | null | undefined>;
151
+ }[] | {
152
+ start: string;
153
+ end: string;
154
+ } | null | undefined>;
143
155
  eventId: string;
144
156
  keepAssignment: boolean | undefined;
145
157
  };
@@ -147,7 +159,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
147
159
  transactionId: string;
148
160
  declaration: Record<string, string | number | boolean | {
149
161
  type: string;
150
- filename: string;
162
+ path: string;
151
163
  originalFilename: string;
152
164
  } | {
153
165
  country: string;
@@ -184,9 +196,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
184
196
  } | {
185
197
  type: string;
186
198
  option: string;
187
- filename: string;
199
+ path: string;
188
200
  originalFilename: string;
189
- }[] | [string, string] | null | undefined>;
201
+ }[] | {
202
+ start: string;
203
+ end: string;
204
+ } | null | undefined>;
190
205
  annotation: {};
191
206
  keepAssignment?: boolean | undefined;
192
207
  type: "VALIDATE";
@@ -211,7 +226,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
211
226
  transactionId: string;
212
227
  declaration: Record<string, string | number | boolean | {
213
228
  type: string;
214
- filename: string;
229
+ path: string;
215
230
  originalFilename: string;
216
231
  } | {
217
232
  country: string;
@@ -248,9 +263,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
248
263
  } | {
249
264
  type: string;
250
265
  option: string;
251
- filename: string;
266
+ path: string;
252
267
  originalFilename: string;
253
- }[] | [string, string] | null | undefined>;
268
+ }[] | {
269
+ start: string;
270
+ end: string;
271
+ } | null | undefined>;
254
272
  keepAssignment?: boolean | undefined;
255
273
  type: "ARCHIVE";
256
274
  annotation: {};
@@ -277,7 +295,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
277
295
  transactionId: string;
278
296
  declaration: Record<string, string | number | boolean | {
279
297
  type: string;
280
- filename: string;
298
+ path: string;
281
299
  originalFilename: string;
282
300
  } | {
283
301
  country: string;
@@ -314,9 +332,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
314
332
  } | {
315
333
  type: string;
316
334
  option: string;
317
- filename: string;
335
+ path: string;
318
336
  originalFilename: string;
319
- }[] | [string, string] | null | undefined>;
337
+ }[] | {
338
+ start: string;
339
+ end: string;
340
+ } | null | undefined>;
320
341
  annotation: {};
321
342
  registrationNumber?: string | undefined;
322
343
  keepAssignment?: boolean | undefined;
@@ -337,7 +358,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
337
358
  transactionId: string;
338
359
  declaration: Record<string, string | number | boolean | {
339
360
  type: string;
340
- filename: string;
361
+ path: string;
341
362
  originalFilename: string;
342
363
  } | {
343
364
  country: string;
@@ -374,9 +395,12 @@ export declare function eventPayloadGenerator(rng: () => number): {
374
395
  } | {
375
396
  type: string;
376
397
  option: string;
377
- filename: string;
398
+ path: string;
378
399
  originalFilename: string;
379
- }[] | [string, string] | null | undefined>;
400
+ }[] | {
401
+ start: string;
402
+ end: string;
403
+ } | null | undefined>;
380
404
  annotation: {};
381
405
  eventId: string;
382
406
  keepAssignment: boolean | undefined;