@opencrvs/toolkit 1.8.0-rc.fb4793a → 1.8.0-rc.fbb40d1

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.
@@ -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 };
@@ -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,7 +325,9 @@ 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;
322
- export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex;
328
+ export declare function generateEventDraftDocument(eventId: UUID, actionType?: ActionType, declaration?: EventState): Draft;
329
+ export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
330
+ export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
323
331
  export declare const generateTranslationConfig: (message: string) => TranslationConfig;
332
+ export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
324
333
  //# 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
@@ -5,6 +5,7 @@ import { Action, ActionUpdate, EventState } from './ActionDocument';
5
5
  import { PageConfig, VerificationPageConfig } from './PageConfig';
6
6
  import { Draft } from './Draft';
7
7
  import { EventDocument } from './EventDocument';
8
+ import { UUID } from '../uuid';
8
9
  import { ActionConfig } from './ActionConfig';
9
10
  import { FormConfig } from './FormConfig';
10
11
  export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
@@ -3646,10 +3647,10 @@ export declare function omitHiddenPaginatedFields(formConfig: FormConfig, declar
3646
3647
  originalFilename: string;
3647
3648
  }[] | [string, string] | undefined>>;
3648
3649
  export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]): {
3649
- id: string;
3650
+ id: string & import("zod").BRAND<"UUID">;
3650
3651
  transactionId: string;
3651
3652
  createdAt: string;
3652
- eventId: string;
3653
+ eventId: string & import("zod").BRAND<"UUID">;
3653
3654
  action: {
3654
3655
  type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
3655
3656
  status: "Rejected" | "Requested" | "Accepted";
@@ -3695,7 +3696,7 @@ export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]):
3695
3696
  filename: string;
3696
3697
  originalFilename: string;
3697
3698
  }[] | [string, string] | undefined>;
3698
- createdAtLocation: string;
3699
+ createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
3699
3700
  annotation?: Record<string, string | number | boolean | {
3700
3701
  type: string;
3701
3702
  filename: string;
@@ -3733,11 +3734,11 @@ export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]):
3733
3734
  option: string;
3734
3735
  filename: string;
3735
3736
  originalFilename: string;
3736
- }[] | [string, string] | undefined> | undefined;
3737
- originalActionId?: string | undefined;
3737
+ }[] | [string, string] | undefined> | null | undefined;
3738
+ originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
3738
3739
  };
3739
3740
  }[];
3740
- export declare function createEmptyDraft(eventId: string, draftId: string, actionType: ActionType): Draft;
3741
+ export declare function createEmptyDraft(eventId: UUID, draftId: UUID, actionType: ActionType): Draft;
3741
3742
  export declare function isVerificationPage(page: PageConfig): page is VerificationPageConfig;
3742
3743
  export declare function getVisibleVerificationPageIds(pages: PageConfig[], annotation: ActionUpdate): string[];
3743
3744
  export declare function getActionVerificationPageIds(actionConfig: ActionConfig, annotation: ActionUpdate): string[];
@@ -0,0 +1,3 @@
1
+ import { WorkqueueColumn } from './WorkqueueColumnConfig';
2
+ export declare const defaultWorkqueueColumns: WorkqueueColumn[];
3
+ //# sourceMappingURL=workqueueDefaultColumns.d.ts.map
@@ -33,6 +33,23 @@ __export(conditionals_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(conditionals_exports);
35
35
 
36
+ // ../commons/src/events/serializers/user/serializer.ts
37
+ var import_zod = require("zod");
38
+ var SerializedUserField = import_zod.z.object({
39
+ $userField: import_zod.z.enum([
40
+ "id",
41
+ "name",
42
+ "role",
43
+ "signatureFilename",
44
+ "primaryOfficeId"
45
+ ])
46
+ });
47
+ function userSerializer(userField) {
48
+ return {
49
+ $userField: userField
50
+ };
51
+ }
52
+
36
53
  // ../commons/src/conditionals/conditionals.ts
37
54
  function defineConditional(schema) {
38
55
  return schema;
@@ -74,7 +91,7 @@ function not(condition) {
74
91
  function never() {
75
92
  return not(alwaysTrue());
76
93
  }
77
- var user = {
94
+ var user = Object.assign(userSerializer, {
78
95
  hasScope: (scope) => defineConditional({
79
96
  type: "object",
80
97
  properties: {
@@ -94,7 +111,7 @@ var user = {
94
111
  },
95
112
  required: ["$user"]
96
113
  })
97
- };
114
+ });
98
115
  function createEventConditionals() {
99
116
  return {
100
117
  /**