@opencrvs/toolkit 1.9.6-rc.5746ef3 → 1.9.6-rc.5cd504e

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.
@@ -31023,7 +31023,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
31023
31023
  }[];
31024
31024
  };
31025
31025
  actions: {
31026
- type: "DELETE" | "READ" | "DECLARE" | "REJECT" | "REGISTER" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "EDIT" | "ARCHIVE" | "MARK_AS_DUPLICATE" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
31026
+ type: "DELETE" | "READ" | "DECLARE" | "REJECT" | "REGISTER" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "EDIT" | "ARCHIVE" | "MARK_AS_DUPLICATE" | "ASSIGN" | "UNASSIGN";
31027
31027
  }[];
31028
31028
  columns: {
31029
31029
  label: {
@@ -9,7 +9,8 @@ export declare const mandatoryColumns: {
9
9
  $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "placeOfEvent" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
10
10
  };
11
11
  }[];
12
- export declare const WorkqueueActionsWithDefault: z.ZodEnum<{
12
+ /** Workqueue Call-to-action -button action type */
13
+ export declare const CtaActionType: z.ZodEnum<{
13
14
  DELETE: "DELETE";
14
15
  DECLARE: "DECLARE";
15
16
  REGISTER: "REGISTER";
@@ -22,9 +23,8 @@ export declare const WorkqueueActionsWithDefault: z.ZodEnum<{
22
23
  READ: "READ";
23
24
  ASSIGN: "ASSIGN";
24
25
  UNASSIGN: "UNASSIGN";
25
- DEFAULT: "DEFAULT";
26
26
  }>;
27
- export type WorkqueueActionsWithDefault = z.infer<typeof WorkqueueActionsWithDefault>;
27
+ export type CtaActionType = z.infer<typeof CtaActionType>;
28
28
  /**
29
29
  * Configuration for workqueue. Workqueues are used to display a list of events.
30
30
  */
@@ -534,7 +534,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
534
534
  READ: "READ";
535
535
  ASSIGN: "ASSIGN";
536
536
  UNASSIGN: "UNASSIGN";
537
- DEFAULT: "DEFAULT";
538
537
  }>;
539
538
  }, z.core.$strip>>;
540
539
  columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -791,7 +790,6 @@ export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
791
790
  READ: "READ";
792
791
  ASSIGN: "ASSIGN";
793
792
  UNASSIGN: "UNASSIGN";
794
- DEFAULT: "DEFAULT";
795
793
  }>;
796
794
  }, z.core.$strip>>;
797
795
  slug: z.ZodString;
@@ -1544,7 +1542,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1544
1542
  READ: "READ";
1545
1543
  ASSIGN: "ASSIGN";
1546
1544
  UNASSIGN: "UNASSIGN";
1547
- DEFAULT: "DEFAULT";
1548
1545
  }>;
1549
1546
  }, z.core.$strip>>;
1550
1547
  columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1914,7 +1911,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
1914
1911
  }[];
1915
1912
  };
1916
1913
  actions: {
1917
- type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
1914
+ type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
1918
1915
  }[];
1919
1916
  columns: {
1920
1917
  label: {
@@ -2164,7 +2161,7 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInput[]): {
2164
2161
  }[];
2165
2162
  };
2166
2163
  actions: {
2167
- type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
2164
+ type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
2168
2165
  }[];
2169
2166
  columns: {
2170
2167
  label: {
@@ -75,6 +75,7 @@ __export(events_exports, {
75
75
  ConditionalType: () => ConditionalType,
76
76
  ConfirmableActions: () => ConfirmableActions,
77
77
  ContainsFlags: () => ContainsFlags,
78
+ CtaActionType: () => CtaActionType,
78
79
  CustomActionInput: () => CustomActionInput,
79
80
  CustomFieldValue: () => CustomFieldValue,
80
81
  CustomFlag: () => CustomFlag,
@@ -210,7 +211,6 @@ __export(events_exports, {
210
211
  VerificationPageConfig: () => VerificationPageConfig,
211
212
  VerificationStatusValue: () => VerificationStatusValue,
212
213
  Within: () => Within,
213
- WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
214
214
  WorkqueueColumn: () => WorkqueueColumn,
215
215
  WorkqueueColumnKeys: () => WorkqueueColumnKeys,
216
216
  WorkqueueColumnKeysArray: () => WorkqueueColumnKeysArray,
@@ -4009,6 +4009,9 @@ var getActionAnnotationFields = (actionConfig) => {
4009
4009
  if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
4010
4010
  return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
4011
4011
  }
4012
+ if (actionConfig.type === ActionType.CUSTOM) {
4013
+ return actionConfig.form;
4014
+ }
4012
4015
  if ("review" in actionConfig) {
4013
4016
  return actionConfig.review.fields;
4014
4017
  }
@@ -5342,11 +5345,7 @@ var mandatoryColumns = defineWorkqueuesColumns([
5342
5345
  value: event.field("updatedAt")
5343
5346
  }
5344
5347
  ]);
5345
- var WorkqueueActionsWithDefault = z33.enum([
5346
- ...workqueueActions.options,
5347
- "DEFAULT",
5348
- ActionType.READ
5349
- ]);
5348
+ var CtaActionType = z33.enum([...workqueueActions.options, ActionType.READ]);
5350
5349
  var WorkqueueConfig = z33.object({
5351
5350
  slug: z33.string().describe("Determines the url of the workqueue."),
5352
5351
  name: TranslationConfig.describe(
@@ -5355,7 +5354,7 @@ var WorkqueueConfig = z33.object({
5355
5354
  query: CountryConfigQueryType,
5356
5355
  /** This action object used to contain a conditionals option, but it was not used anywhere.
5357
5356
  * It's also debatable whether it should be an array, or just a single action. */
5358
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
5357
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
5359
5358
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
5360
5359
  icon: AvailableIcons,
5361
5360
  emptyMessage: TranslationConfig.optional()
@@ -5370,7 +5369,7 @@ var WorkqueueConfigInput = z33.object({
5370
5369
  "Title of the workflow (both in navigation and on the page)"
5371
5370
  ),
5372
5371
  query: CountryConfigQueryInputType,
5373
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
5372
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
5374
5373
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
5375
5374
  icon: AvailableIcons,
5376
5375
  emptyMessage: TranslationConfig.optional()
@@ -9160,7 +9159,7 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
9160
9159
  type: "and",
9161
9160
  clauses: [{ eventType: tennisClubMembershipEvent.id }]
9162
9161
  },
9163
- actions: [{ type: "DEFAULT" }],
9162
+ actions: [{ type: ActionType.READ }],
9164
9163
  icon: "Draft"
9165
9164
  }
9166
9165
  ]);
@@ -2805,6 +2805,9 @@ var getActionAnnotationFields = (actionConfig) => {
2805
2805
  if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
2806
2806
  return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
2807
2807
  }
2808
+ if (actionConfig.type === ActionType.CUSTOM) {
2809
+ return actionConfig.form;
2810
+ }
2808
2811
  if ("review" in actionConfig) {
2809
2812
  return actionConfig.review.fields;
2810
2813
  }
@@ -3816,11 +3819,7 @@ var mandatoryColumns = defineWorkqueuesColumns([
3816
3819
  value: event.field("updatedAt")
3817
3820
  }
3818
3821
  ]);
3819
- var WorkqueueActionsWithDefault = z33.enum([
3820
- ...workqueueActions.options,
3821
- "DEFAULT",
3822
- ActionType.READ
3823
- ]);
3822
+ var CtaActionType = z33.enum([...workqueueActions.options, ActionType.READ]);
3824
3823
  var WorkqueueConfig = z33.object({
3825
3824
  slug: z33.string().describe("Determines the url of the workqueue."),
3826
3825
  name: TranslationConfig.describe(
@@ -3829,7 +3828,7 @@ var WorkqueueConfig = z33.object({
3829
3828
  query: CountryConfigQueryType,
3830
3829
  /** This action object used to contain a conditionals option, but it was not used anywhere.
3831
3830
  * It's also debatable whether it should be an array, or just a single action. */
3832
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3831
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
3833
3832
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3834
3833
  icon: AvailableIcons,
3835
3834
  emptyMessage: TranslationConfig.optional()
@@ -3844,7 +3843,7 @@ var WorkqueueConfigInput = z33.object({
3844
3843
  "Title of the workflow (both in navigation and on the page)"
3845
3844
  ),
3846
3845
  query: CountryConfigQueryInputType,
3847
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3846
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
3848
3847
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3849
3848
  icon: AvailableIcons,
3850
3849
  emptyMessage: TranslationConfig.optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.6-rc.5746ef3",
3
+ "version": "1.9.6-rc.5cd504e",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {