@opencrvs/toolkit 2.0.0-rc.a6818b0 → 2.0.0-rc.a6b3d72

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.
@@ -206,6 +206,11 @@ var FieldTypesToHideInReview = [
206
206
  FieldType.ALPHA_PRINT_BUTTON,
207
207
  FieldType.ALPHA_HIDDEN
208
208
  ];
209
+ var HiddenFieldTypes = [
210
+ FieldType.HTTP,
211
+ FieldType.QUERY_PARAM_READER,
212
+ FieldType.ALPHA_HIDDEN
213
+ ];
209
214
 
210
215
  // ../commons/src/events/FieldValue.ts
211
216
  var z7 = __toESM(require("zod/v4"));
@@ -1495,6 +1500,7 @@ var NumberField = BaseField.extend({
1495
1500
  configuration: import_v43.default.object({
1496
1501
  min: import_v43.default.number().optional().describe("Minimum value"),
1497
1502
  max: import_v43.default.number().optional().describe("Maximum value"),
1503
+ integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
1498
1504
  prefix: TranslationConfig.optional(),
1499
1505
  postfix: TranslationConfig.optional()
1500
1506
  }).optional()
@@ -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;
@@ -267,6 +267,7 @@ declare const NumberField: z.ZodObject<{
267
267
  configuration: z.ZodOptional<z.ZodObject<{
268
268
  min: z.ZodOptional<z.ZodNumber>;
269
269
  max: z.ZodOptional<z.ZodNumber>;
270
+ integer: z.ZodOptional<z.ZodBoolean>;
270
271
  prefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
271
272
  postfix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
272
273
  }, z.core.$strip>>;
@@ -75,4 +75,5 @@ export type FieldType = (typeof fieldTypes)[number];
75
75
  */
76
76
  export declare const compositeFieldTypes: ("NAME" | "ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS" | "DATA" | "ID_READER")[];
77
77
  export declare const FieldTypesToHideInReview: ("IMAGE_VIEW" | "PARAGRAPH" | "PAGE_HEADER" | "BULLET_LIST" | "DIVIDER" | "DATA" | "ALPHA_PRINT_BUTTON" | "HTTP" | "QUERY_PARAM_READER" | "ID_READER" | "LOADER" | "ALPHA_HIDDEN")[];
78
+ export declare const HiddenFieldTypes: ("HTTP" | "QUERY_PARAM_READER" | "ALPHA_HIDDEN")[];
78
79
  //# sourceMappingURL=FieldType.d.ts.map
@@ -151,6 +151,7 @@ __export(events_exports, {
151
151
  FormPageConfig: () => FormPageConfig,
152
152
  Fuzzy: () => Fuzzy,
153
153
  GeographicalArea: () => GeographicalArea,
154
+ HiddenFieldTypes: () => HiddenFieldTypes,
154
155
  HiddenFieldValue: () => HiddenFieldValue,
155
156
  HttpFieldUpdateValue: () => HttpFieldUpdateValue,
156
157
  HttpFieldValue: () => HttpFieldValue,
@@ -1219,6 +1220,11 @@ var FieldTypesToHideInReview = [
1219
1220
  FieldType.ALPHA_PRINT_BUTTON,
1220
1221
  FieldType.ALPHA_HIDDEN
1221
1222
  ];
1223
+ var HiddenFieldTypes = [
1224
+ FieldType.HTTP,
1225
+ FieldType.QUERY_PARAM_READER,
1226
+ FieldType.ALPHA_HIDDEN
1227
+ ];
1222
1228
 
1223
1229
  // ../commons/src/events/FieldValue.ts
1224
1230
  var z12 = __toESM(require("zod/v4"));
@@ -2292,6 +2298,7 @@ var NumberField = BaseField.extend({
2292
2298
  configuration: import_v43.default.object({
2293
2299
  min: import_v43.default.number().optional().describe("Minimum value"),
2294
2300
  max: import_v43.default.number().optional().describe("Maximum value"),
2301
+ integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
2295
2302
  prefix: TranslationConfig.optional(),
2296
2303
  postfix: TranslationConfig.optional()
2297
2304
  }).optional()
@@ -10623,18 +10630,19 @@ var ACTION_FILTERS = {
10623
10630
  function filterActionsByFlags(actions, flags) {
10624
10631
  return actions.filter((action) => ACTION_FILTERS[action]?.(flags) ?? true);
10625
10632
  }
10633
+ var REJECTED_ACTIONS = [
10634
+ ActionType.READ,
10635
+ ActionType.NOTIFY,
10636
+ ActionType.CUSTOM,
10637
+ ActionType.EDIT,
10638
+ ActionType.ARCHIVE
10639
+ ];
10626
10640
  function getAvailableActionsWithoutFlagFilters(status2, flags) {
10627
10641
  if (flags.includes(InherentFlags.EDIT_IN_PROGRESS)) {
10628
10642
  return [ActionType.NOTIFY, ActionType.DECLARE, ActionType.REGISTER];
10629
10643
  }
10630
- if (flags.includes(InherentFlags.REJECTED)) {
10631
- return [
10632
- ActionType.READ,
10633
- ActionType.NOTIFY,
10634
- ActionType.CUSTOM,
10635
- ActionType.EDIT,
10636
- ActionType.ARCHIVE
10637
- ];
10644
+ if (flags.includes(InherentFlags.REJECTED) && status2 !== EventStatus.enum.ARCHIVED) {
10645
+ return REJECTED_ACTIONS;
10638
10646
  }
10639
10647
  return AVAILABLE_ACTIONS_BY_EVENT_STATUS[status2];
10640
10648
  }
@@ -770,6 +770,11 @@ var FieldTypesToHideInReview = [
770
770
  FieldType.ALPHA_PRINT_BUTTON,
771
771
  FieldType.ALPHA_HIDDEN
772
772
  ];
773
+ var HiddenFieldTypes = [
774
+ FieldType.HTTP,
775
+ FieldType.QUERY_PARAM_READER,
776
+ FieldType.ALPHA_HIDDEN
777
+ ];
773
778
 
774
779
  // ../commons/src/events/FieldValue.ts
775
780
  var z12 = __toESM(require("zod/v4"));
@@ -1750,6 +1755,7 @@ var NumberField = BaseField.extend({
1750
1755
  configuration: import_v43.default.object({
1751
1756
  min: import_v43.default.number().optional().describe("Minimum value"),
1752
1757
  max: import_v43.default.number().optional().describe("Maximum value"),
1758
+ integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
1753
1759
  prefix: TranslationConfig.optional(),
1754
1760
  postfix: TranslationConfig.optional()
1755
1761
  }).optional()
@@ -7241,6 +7247,13 @@ var ACTION_FILTERS = {
7241
7247
  [ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
7242
7248
  [ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
7243
7249
  };
7250
+ var REJECTED_ACTIONS = [
7251
+ ActionType.READ,
7252
+ ActionType.NOTIFY,
7253
+ ActionType.CUSTOM,
7254
+ ActionType.EDIT,
7255
+ ActionType.ARCHIVE
7256
+ ];
7244
7257
 
7245
7258
  // ../commons/src/events/FileUtils.ts
7246
7259
  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.a6818b0",
3
+ "version": "2.0.0-rc.a6b3d72",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "bin": {