@opencrvs/toolkit 2.0.0-rc.b83fa45 → 2.0.0-rc.b840409

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.
@@ -324,7 +324,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
324
324
  // ../commons/src/events/FieldValue.ts
325
325
  var TextValue = z7.string();
326
326
  var HiddenFieldValue = z7.string();
327
- var NonEmptyTextValue = TextValue.min(1);
327
+ var NonEmptyTextValue = z7.string().trim().min(1);
328
328
  var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
329
329
  var AgeValue = z7.object({
330
330
  age: z7.number(),
@@ -7374,9 +7374,13 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
7374
7374
  output: void;
7375
7375
  meta: import("trpc-to-openapi").OpenApiMeta;
7376
7376
  }>;
7377
- sendVerifyCode: import("@trpc/server").TRPCMutationProcedure<{
7377
+ requestContactChange: import("@trpc/server").TRPCMutationProcedure<{
7378
7378
  input: {
7379
- notificationEvent: "change-phone-number" | "change-email-address";
7379
+ notificationEvent: "change-email-address";
7380
+ email: string;
7381
+ } | {
7382
+ notificationEvent: "change-phone-number";
7383
+ phoneNumber: string;
7380
7384
  };
7381
7385
  output: {
7382
7386
  nonce: string;
@@ -1345,7 +1345,7 @@ function plainDateToLocalDate(date) {
1345
1345
  // ../commons/src/events/FieldValue.ts
1346
1346
  var TextValue = z12.string();
1347
1347
  var HiddenFieldValue = z12.string();
1348
- var NonEmptyTextValue = TextValue.min(1);
1348
+ var NonEmptyTextValue = z12.string().trim().min(1);
1349
1349
  var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
1350
1350
  var AgeValue = z12.object({
1351
1351
  age: z12.number(),
@@ -10623,18 +10623,19 @@ var ACTION_FILTERS = {
10623
10623
  function filterActionsByFlags(actions, flags) {
10624
10624
  return actions.filter((action) => ACTION_FILTERS[action]?.(flags) ?? true);
10625
10625
  }
10626
+ var REJECTED_ACTIONS = [
10627
+ ActionType.READ,
10628
+ ActionType.NOTIFY,
10629
+ ActionType.CUSTOM,
10630
+ ActionType.EDIT,
10631
+ ActionType.ARCHIVE
10632
+ ];
10626
10633
  function getAvailableActionsWithoutFlagFilters(status2, flags) {
10627
10634
  if (flags.includes(InherentFlags.EDIT_IN_PROGRESS)) {
10628
10635
  return [ActionType.NOTIFY, ActionType.DECLARE, ActionType.REGISTER];
10629
10636
  }
10630
- if (flags.includes(InherentFlags.REJECTED)) {
10631
- return [
10632
- ActionType.READ,
10633
- ActionType.NOTIFY,
10634
- ActionType.CUSTOM,
10635
- ActionType.EDIT,
10636
- ActionType.ARCHIVE
10637
- ];
10637
+ if (flags.includes(InherentFlags.REJECTED) && status2 !== EventStatus.enum.ARCHIVED) {
10638
+ return REJECTED_ACTIONS;
10638
10639
  }
10639
10640
  return AVAILABLE_ACTIONS_BY_EVENT_STATUS[status2];
10640
10641
  }
@@ -888,7 +888,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
888
888
  // ../commons/src/events/FieldValue.ts
889
889
  var TextValue = z12.string();
890
890
  var HiddenFieldValue = z12.string();
891
- var NonEmptyTextValue = TextValue.min(1);
891
+ var NonEmptyTextValue = z12.string().trim().min(1);
892
892
  var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
893
893
  var AgeValue = z12.object({
894
894
  age: z12.number(),
@@ -7241,6 +7241,13 @@ var ACTION_FILTERS = {
7241
7241
  [ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
7242
7242
  [ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
7243
7243
  };
7244
+ var REJECTED_ACTIONS = [
7245
+ ActionType.READ,
7246
+ ActionType.NOTIFY,
7247
+ ActionType.CUSTOM,
7248
+ ActionType.EDIT,
7249
+ ActionType.ARCHIVE
7250
+ ];
7244
7251
 
7245
7252
  // ../commons/src/events/FileUtils.ts
7246
7253
  var import_lodash7 = require("lodash");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "2.0.0-rc.b83fa45",
3
+ "version": "2.0.0-rc.b840409",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "bin": {