@opencrvs/toolkit 1.8.0-rc.ff0b26c → 1.8.0-rc.ff1f8e0

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 (34) hide show
  1. package/dist/commons/api/router.d.ts +2356 -1097
  2. package/dist/commons/conditionals/conditionals.d.ts +7 -6
  3. package/dist/commons/events/ActionConfig.d.ts +15774 -7797
  4. package/dist/commons/events/ActionDocument.d.ts +533 -346
  5. package/dist/commons/events/ActionInput.d.ts +197 -125
  6. package/dist/commons/events/Constants.d.ts +2 -0
  7. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  8. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  9. package/dist/commons/events/Draft.d.ts +29 -24
  10. package/dist/commons/events/EventConfig.d.ts +13649 -9488
  11. package/dist/commons/events/EventDocument.d.ts +386 -267
  12. package/dist/commons/events/EventIndex.d.ts +209 -605
  13. package/dist/commons/events/EventInput.d.ts +0 -13
  14. package/dist/commons/events/EventMetadata.d.ts +71 -48
  15. package/dist/commons/events/FieldConfig.d.ts +486 -440
  16. package/dist/commons/events/FieldTypeMapping.d.ts +5 -2
  17. package/dist/commons/events/FieldValue.d.ts +2 -0
  18. package/dist/commons/events/FormConfig.d.ts +3346 -3052
  19. package/dist/commons/events/PageConfig.d.ts +750 -680
  20. package/dist/commons/events/User.d.ts +31 -7
  21. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  22. package/dist/commons/events/WorkqueueConfig.d.ts +3460 -485
  23. package/dist/commons/events/defineConfig.d.ts +1381 -575
  24. package/dist/commons/events/event.d.ts +2 -2
  25. package/dist/commons/events/field.d.ts +4 -13
  26. package/dist/commons/events/index.d.ts +4 -0
  27. package/dist/commons/events/serializer.d.ts +2 -0
  28. package/dist/commons/events/test.utils.d.ts +26 -5
  29. package/dist/commons/events/transactions.d.ts +1 -1
  30. package/dist/commons/events/utils.d.ts +333 -296
  31. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  32. package/dist/conditionals/index.js +28 -8
  33. package/dist/events/index.js +1564 -584
  34. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { EventFieldId } from './AdvancedSearchConfig';
2
- import { EventMetadataKeys, EventMetadataParameter } from './EventMetadata';
3
2
  import { SelectOption } from './FieldConfig';
3
+ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
4
4
  /**
5
5
  * Creates a function that acts like a callable + static method container.
6
6
  *
@@ -47,7 +47,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
47
47
  };
48
48
  };
49
49
  declare const event: typeof eventFn & {
50
- field(field: EventMetadataKeys): EventMetadataParameter;
50
+ field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
51
51
  hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
52
52
  };
53
53
  export { event };
@@ -39,14 +39,14 @@ export declare function field(fieldId: string, options?: {
39
39
  type: "fuzzy";
40
40
  };
41
41
  };
42
+ $$field: string;
42
43
  isAfter: () => {
43
44
  days: (days: number) => {
44
45
  inPast: () => import("../conditionals/conditionals").JSONSchema;
45
46
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
46
47
  };
47
48
  date: (date: string | {
48
- [key: string]: unknown;
49
- _fieldId: string;
49
+ $$field: string;
50
50
  }) => import("../conditionals/conditionals").JSONSchema;
51
51
  now: () => import("../conditionals/conditionals").JSONSchema;
52
52
  };
@@ -56,14 +56,12 @@ export declare function field(fieldId: string, options?: {
56
56
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
57
57
  };
58
58
  date: (date: string | {
59
- [key: string]: unknown;
60
- _fieldId: string;
59
+ $$field: string;
61
60
  }) => import("../conditionals/conditionals").JSONSchema;
62
61
  now: () => import("../conditionals/conditionals").JSONSchema;
63
62
  };
64
63
  isEqualTo: (value: string | boolean | {
65
- [key: string]: unknown;
66
- _fieldId: string;
64
+ $$field: string;
67
65
  }) => import("../conditionals/conditionals").JSONSchema;
68
66
  isFalsy: () => import("../conditionals/conditionals").JSONSchema;
69
67
  isUndefined: () => import("../conditionals/conditionals").JSONSchema;
@@ -71,12 +69,5 @@ export declare function field(fieldId: string, options?: {
71
69
  isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
72
70
  matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
73
71
  isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
74
- getId: () => {
75
- fieldId: string;
76
- };
77
- /**
78
- * @private Internal property used for field reference tracking.
79
- */
80
- _fieldId: string;
81
72
  };
82
73
  //# sourceMappingURL=field.d.ts.map
@@ -1,3 +1,4 @@
1
+ export * from './Constants';
1
2
  export * from './ActionConfig';
2
3
  export * from './offline';
3
4
  export * from './EventConfig';
@@ -6,6 +7,8 @@ export * from './FieldConfig';
6
7
  export * from './PageConfig';
7
8
  export * from './SummaryConfig';
8
9
  export * from './WorkqueueConfig';
10
+ export * from './WorkqueueColumnConfig';
11
+ export * from './workqueueDefaultColumns';
9
12
  export * from './Draft';
10
13
  export * from './EventMetadata';
11
14
  export * from './EventInput';
@@ -31,6 +34,7 @@ export * from './AdvancedSearchConfig';
31
34
  export * from './test.utils';
32
35
  export * from './TemplateConfig';
33
36
  export * from './scopes';
37
+ export * from './serializer';
34
38
  export * from '../conditionals/conditionals';
35
39
  export * from '../conditionals/validate';
36
40
  export * from './field';
@@ -0,0 +1,2 @@
1
+ export { deserializeQuery } from './serializers/user/deserializer';
2
+ //# sourceMappingURL=serializer.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { UUID } from '../uuid';
1
2
  import { ActionDocument, ActionUpdate, EventState } from './ActionDocument';
2
3
  import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
3
4
  import { ActionType } from './ActionType';
@@ -7,6 +8,7 @@ import { EventDocument } from './EventDocument';
7
8
  import { EventIndex } from './EventIndex';
8
9
  import { EventInput } from './EventInput';
9
10
  import { TranslationConfig } from './TranslationConfig';
11
+ import { WorkqueueConfig } from './WorkqueueConfig';
10
12
  export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): EventState;
11
13
  export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
12
14
  export declare const eventPayloadGenerator: {
@@ -20,7 +22,7 @@ export declare const eventPayloadGenerator: {
20
22
  id: string;
21
23
  };
22
24
  draft: ({ eventId, actionType }: {
23
- eventId: string;
25
+ eventId: UUID;
24
26
  actionType: ActionType;
25
27
  }, input?: Partial<Draft>) => Draft;
26
28
  actions: {
@@ -180,11 +182,13 @@ export declare const eventPayloadGenerator: {
180
182
  type: "ARCHIVE";
181
183
  transactionId: string;
182
184
  declaration: {};
183
- annotation: {
184
- isDuplicate: boolean;
185
- };
185
+ annotation: {};
186
186
  duplicates: never[];
187
187
  eventId: string;
188
+ reason: {
189
+ message: string;
190
+ isDuplicate: boolean;
191
+ };
188
192
  };
189
193
  reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
190
194
  type: "REJECT";
@@ -193,6 +197,9 @@ export declare const eventPayloadGenerator: {
193
197
  annotation: {};
194
198
  duplicates: never[];
195
199
  eventId: string;
200
+ reason: {
201
+ message: string;
202
+ };
196
203
  };
197
204
  register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
198
205
  type: "REGISTER";
@@ -318,8 +325,22 @@ export declare function generateEventDocument({ configuration, actions }: {
318
325
  configuration: EventConfig;
319
326
  actions: ActionType[];
320
327
  }): EventDocument;
321
- export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: EventState): Draft;
328
+ export declare function generateEventDraftDocument(eventId: UUID, actionType?: ActionType, declaration?: EventState): Draft;
322
329
  export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
330
+ /**
331
+ * Useful for testing when we need deterministic outcome.
332
+ * @param seed - Seed value for the pseudo-random number generator
333
+ *
334
+ * @returns A function that generates pseudo-random numbers between 0 and 1
335
+ */
336
+ export declare function createPseudoRandomNumberGenerator(seed: number): () => number;
337
+ export declare function generateRandomSignature(rng: () => number): string;
323
338
  export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
324
339
  export declare const generateTranslationConfig: (message: string) => TranslationConfig;
340
+ export declare const BearerTokenByUserType: {
341
+ fieldAgent: string;
342
+ registrationAgent: string;
343
+ localRegistrar: string;
344
+ };
345
+ export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
325
346
  //# sourceMappingURL=test.utils.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare function generateTransactionId(): import("../uuid").UUID;
1
+ export declare function generateTransactionId(): string & import("zod").BRAND<"UUID">;
2
2
  //# sourceMappingURL=transactions.d.ts.map