@opencrvs/toolkit 1.9.12-rc.c1f8f26 → 1.9.12-rc.c4d2a9f

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 (99) hide show
  1. package/build.sh +4 -0
  2. package/dist/application-config/index.js +2045 -41
  3. package/dist/cli.js +3573 -4
  4. package/dist/commons/api/router.d.ts +106 -75
  5. package/dist/commons/application-config/index.d.ts +13 -16
  6. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  7. package/dist/commons/events/ActionDocument.d.ts +198 -198
  8. package/dist/commons/events/ActionInput.d.ts +113 -113
  9. package/dist/commons/events/ActionType.d.ts +3 -3
  10. package/dist/commons/events/AdvancedSearchConfig.d.ts +16 -10
  11. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +443 -172
  13. package/dist/commons/events/Draft.d.ts +15 -15
  14. package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
  15. package/dist/commons/events/EventConfig.d.ts +4 -2
  16. package/dist/commons/events/EventDocument.d.ts +81 -81
  17. package/dist/commons/events/EventIndex.d.ts +35 -27
  18. package/dist/commons/events/EventInput.d.ts +1 -1
  19. package/dist/commons/events/EventMetadata.d.ts +24 -24
  20. package/dist/commons/events/FieldConfig.d.ts +155 -44
  21. package/dist/commons/events/FieldType.d.ts +2 -1
  22. package/dist/commons/events/FieldTypeMapping.d.ts +98 -72
  23. package/dist/commons/events/FieldValue.d.ts +54 -26
  24. package/dist/commons/events/PlainDate.d.ts +1 -1
  25. package/dist/commons/events/WorkqueueColumnConfig.d.ts +16 -16
  26. package/dist/commons/events/WorkqueueConfig.d.ts +438 -194
  27. package/dist/commons/events/defineConfig.d.ts +0 -4
  28. package/dist/commons/events/locations.d.ts +4 -4
  29. package/dist/commons/events/scopes.d.ts +1 -1
  30. package/dist/commons/events/state/index.d.ts +2 -2
  31. package/dist/commons/events/state/utils.d.ts +3 -3
  32. package/dist/commons/events/utils.d.ts +5 -177
  33. package/dist/conditionals/index.js +13 -5
  34. package/dist/events/index.js +156 -35
  35. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
  36. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
  37. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
  38. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +3 -0
  39. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -0
  40. package/dist/migrations/v2.0/checkout-upstream-files.js +143 -0
  41. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
  42. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
  43. package/dist/migrations/v2.0/convert-config-files-to-ts.js +829 -0
  44. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
  45. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
  46. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
  47. package/dist/migrations/v2.0/create-events-index.d.ts +3 -0
  48. package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -0
  49. package/dist/migrations/v2.0/create-events-index.js +326 -0
  50. package/dist/migrations/v2.0/index.d.ts +7 -0
  51. package/dist/migrations/v2.0/index.d.ts.map +1 -0
  52. package/dist/migrations/v2.0/index.js +3572 -0
  53. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
  54. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
  55. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
  56. package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
  57. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
  58. package/dist/migrations/v2.0/migrate-scopes.js +282 -0
  59. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
  60. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
  61. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
  62. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
  63. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
  64. package/dist/migrations/v2.0/migrate-workqueue-configs.js +237 -0
  65. package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
  66. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
  67. package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
  68. package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
  69. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
  70. package/dist/migrations/v2.0/remove-demo-scope.js +75 -0
  71. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
  72. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
  73. package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
  74. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
  75. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
  76. package/dist/migrations/v2.0/remove-hearth-migrations.js +78 -0
  77. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
  78. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
  79. package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
  80. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
  81. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
  82. package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
  83. package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
  84. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
  85. package/dist/migrations/v2.0/rename-api-paths.js +188 -0
  86. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
  87. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
  88. package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
  89. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +3 -0
  90. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -0
  91. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +196 -0
  92. package/dist/notification/index.js +77 -24
  93. package/dist/scopes/index.d.ts +31 -10
  94. package/dist/scopes/index.js +17 -5
  95. package/opencrvs-toolkit-1.9.12-rc.c4d2a9f.tgz +0 -0
  96. package/package.json +8 -7
  97. package/tsconfig.json +3 -0
  98. package/tsconfig.tsbuildinfo +1 -1
  99. package/opencrvs-toolkit-1.9.12-rc.c1f8f26.tgz +0 -0
@@ -64,6 +64,8 @@ __export(events_exports, {
64
64
  AssignmentStatus: () => AssignmentStatus,
65
65
  AsyncRejectActionDocument: () => AsyncRejectActionDocument,
66
66
  AuditLogEntrySchema: () => AuditLogEntrySchema,
67
+ AutocompleteUpdateValue: () => AutocompleteUpdateValue,
68
+ AutocompleteValue: () => AutocompleteValue,
67
69
  BaseActionInput: () => BaseActionInput,
68
70
  BearerTokenByUserType: () => BearerTokenByUserType,
69
71
  ButtonFieldValue: () => ButtonFieldValue,
@@ -330,6 +332,7 @@ __export(events_exports, {
330
332
  isAddressFieldType: () => isAddressFieldType,
331
333
  isAdministrativeAreaFieldType: () => isAdministrativeAreaFieldType,
332
334
  isAgeFieldType: () => isAgeFieldType,
335
+ isAutocompleteFieldType: () => isAutocompleteFieldType,
333
336
  isBulletListFieldType: () => isBulletListFieldType,
334
337
  isButtonFieldType: () => isButtonFieldType,
335
338
  isCheckboxFieldType: () => isCheckboxFieldType,
@@ -509,16 +512,16 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
509
512
  var AccessLevelOptions = z2.object({
510
513
  accessLevel: JurisdictionFilter.optional()
511
514
  });
512
- var WorkqueueOptions = z2.object({
515
+ var WorkqueueOrDashboardOptions = z2.object({
513
516
  ids: z2.preprocess(
514
517
  (val) => val === void 0 ? void 0 : [val].flat(),
515
518
  z2.array(z2.string())
516
- ).describe("Must contain a list of workqueue ids.")
519
+ ).describe("Must contain a list of workqueue or dashboard ids.")
517
520
  });
518
521
  var AllScopeOptions = z2.object({
519
522
  ...AllRecordScopeOptions.shape,
520
523
  ...AccessLevelOptions.shape,
521
- ...WorkqueueOptions.shape
524
+ ...WorkqueueOrDashboardOptions.shape
522
525
  });
523
526
  var ScopeOptionKey = AllScopeOptions.keyof();
524
527
  var ResolvedScopeOptionsPlaceEvent = z2.object({
@@ -632,13 +635,21 @@ var Scope = z2.discriminatedUnion("type", [
632
635
  z2.object({ type: PlainScopeType }),
633
636
  ...RecordScopeV2.options,
634
637
  z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
635
- z2.object({ type: z2.literal("workqueue"), options: WorkqueueOptions })
638
+ z2.object({
639
+ type: z2.literal("workqueue"),
640
+ options: WorkqueueOrDashboardOptions
641
+ }),
642
+ z2.object({
643
+ type: z2.literal("dashboard.view"),
644
+ options: WorkqueueOrDashboardOptions
645
+ })
636
646
  ]);
637
647
  var ScopeType = z2.enum([
638
648
  ...SystemScopeType.options,
639
649
  ...RecordScopeTypeV2.options,
640
650
  ...PlainScopeType.options,
641
- "workqueue"
651
+ "workqueue",
652
+ "dashboard.view"
642
653
  ]);
643
654
  var unflattenScope = (input) => {
644
655
  const { type, ...options } = input;
@@ -1088,6 +1099,7 @@ var FieldType = {
1088
1099
  SIGNATURE: "SIGNATURE",
1089
1100
  DATA: "DATA",
1090
1101
  BUTTON: "BUTTON",
1102
+ AUTOCOMPLETE: "AUTOCOMPLETE",
1091
1103
  SEARCH: "SEARCH",
1092
1104
  ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON",
1093
1105
  HTTP: "HTTP",
@@ -1273,6 +1285,11 @@ var AgeValue = z12.object({
1273
1285
  asOfDateRef: z12.string()
1274
1286
  });
1275
1287
  var AgeUpdateValue = AgeValue.optional().nullable();
1288
+ var AutocompleteValue = z12.object({
1289
+ label: z12.string(),
1290
+ value: z12.string()
1291
+ });
1292
+ var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
1276
1293
  var TimeValue = z12.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
1277
1294
  var DatetimeValue = z12.iso.datetime();
1278
1295
  var SelectDateRangeValue = z12.enum([
@@ -1319,7 +1336,9 @@ var LeafFieldValues = z12.union([
1319
1336
  IdReaderFieldValue,
1320
1337
  NumberWithUnitFieldValue,
1321
1338
  NumberWithUnitFieldUpdateValue,
1322
- CustomFieldValue
1339
+ CustomFieldValue,
1340
+ AutocompleteValue,
1341
+ AutocompleteUpdateValue
1323
1342
  ]);
1324
1343
  var FieldGroupValue = z12.record(z12.string(), LeafFieldValues);
1325
1344
  var DataFieldValue = z12.object({
@@ -1401,7 +1420,8 @@ var FieldUpdateValue = safeUnion([
1401
1420
  HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
1402
1421
  QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
1403
1422
  CustomFieldValue.describe("CustomFieldValue"),
1404
- HiddenFieldValue.describe("HiddenFieldValue")
1423
+ HiddenFieldValue.describe("HiddenFieldValue"),
1424
+ AutocompleteUpdateValue.describe("AutocompleteUpdateValue")
1405
1425
  ]);
1406
1426
 
1407
1427
  // ../commons/src/events/serializers/user/serializer.ts
@@ -1980,8 +2000,8 @@ var QueryExpression = import_v4.z.object({
1980
2000
  "legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
1981
2001
  "legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
1982
2002
  "legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
1983
- createdAtLocation: import_v4.z.optional(Within),
1984
- updatedAtLocation: import_v4.z.optional(Within),
2003
+ createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
2004
+ updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
1985
2005
  assignedTo: import_v4.z.optional(Exact),
1986
2006
  createdByUserType: import_v4.z.optional(ExactUserType),
1987
2007
  updatedByUserRole: import_v4.z.optional(Exact),
@@ -2318,17 +2338,14 @@ var ImageViewField = BaseField.extend({
2318
2338
  }).describe("A read-only image component for form pages");
2319
2339
  var Paragraph = BaseField.extend({
2320
2340
  type: import_v43.default.literal(FieldType.PARAGRAPH),
2321
- defaultValue: NonEmptyTextValue.optional(),
2322
2341
  configuration: ParagraphConfiguration
2323
2342
  }).describe("A read-only HTML <p> paragraph");
2324
2343
  var Heading = BaseField.extend({
2325
2344
  type: import_v43.default.literal(FieldType.HEADING),
2326
- defaultValue: NonEmptyTextValue.optional(),
2327
2345
  configuration: HeadingConfiguration
2328
2346
  }).describe("A read-only heading component for form pages");
2329
2347
  var PageHeader = BaseField.extend({
2330
- type: import_v43.default.literal(FieldType.PAGE_HEADER),
2331
- defaultValue: NonEmptyTextValue.optional()
2348
+ type: import_v43.default.literal(FieldType.PAGE_HEADER)
2332
2349
  }).describe("A read-only header component for form pages");
2333
2350
  var File = BaseField.extend({
2334
2351
  type: import_v43.default.literal(FieldType.FILE),
@@ -2378,7 +2395,6 @@ var RadioGroup = BaseField.extend({
2378
2395
  }).describe("Grouped radio options");
2379
2396
  var BulletList = BaseField.extend({
2380
2397
  type: import_v43.default.literal(FieldType.BULLET_LIST),
2381
- defaultValue: TextValue.optional(),
2382
2398
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
2383
2399
  configuration: import_v43.default.object({
2384
2400
  styles: import_v43.default.object({
@@ -2560,16 +2576,32 @@ var DataField = BaseField.extend({
2560
2576
  data: import_v43.default.array(DataEntry)
2561
2577
  })
2562
2578
  }).describe("Data field for displaying read-only data");
2579
+ var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2580
+ var ButtonType = import_v43.default.enum([
2581
+ "primary",
2582
+ "secondary",
2583
+ "tertiary",
2584
+ "positive",
2585
+ "negative",
2586
+ "secondaryNegative",
2587
+ "icon",
2588
+ "iconPrimary"
2589
+ ]);
2590
+ var TextColor = import_v43.default.enum(["primary", "copy"]);
2591
+ var TextVariant = import_v43.default.enum(["bold14", "reg14"]);
2592
+ var ButtonConfiguration = import_v43.default.object({
2593
+ icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit."),
2594
+ loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
2595
+ buttonSize: ButtonSize.optional().describe("Size of the button."),
2596
+ buttonType: ButtonType.optional().describe("Type of the button."),
2597
+ textColor: TextColor.optional().describe("Color of the text."),
2598
+ textVariant: TextVariant.optional().describe("Variant of the text."),
2599
+ text: TranslationConfig.describe("Text to display on the button")
2600
+ });
2563
2601
  var ButtonField = BaseField.extend({
2564
2602
  type: import_v43.default.literal(FieldType.BUTTON),
2565
2603
  defaultValue: ButtonFieldValue.optional(),
2566
- configuration: import_v43.default.object({
2567
- icon: import_v43.default.string().optional().describe(
2568
- "Icon for the button. You can find icons from OpenCRVS UI-Kit."
2569
- ),
2570
- loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
2571
- text: TranslationConfig.describe("Text to display on the button")
2572
- })
2604
+ configuration: ButtonConfiguration
2573
2605
  }).describe("Generic button without any built-in functionality");
2574
2606
  var FieldGroup = BaseField.extend({
2575
2607
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
@@ -2601,6 +2633,19 @@ var HttpField = BaseField.extend({
2601
2633
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2602
2634
  })
2603
2635
  }).describe("HTTP request function triggered by a button click or other event");
2636
+ var AutocompleteField = BaseField.extend({
2637
+ type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2638
+ configuration: import_v43.default.object({
2639
+ url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2640
+ method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2641
+ defaultOptions: import_v43.default.array(
2642
+ import_v43.default.object({
2643
+ label: import_v43.default.string(),
2644
+ value: import_v43.default.string()
2645
+ })
2646
+ ).optional()
2647
+ })
2648
+ }).describe("Autocomplete input field");
2604
2649
  var SearchField = HttpField.extend({
2605
2650
  type: import_v43.default.literal(FieldType.SEARCH),
2606
2651
  configuration: SearchQuery.pick({
@@ -2686,8 +2731,11 @@ var CustomField = BaseField.extend({
2686
2731
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2687
2732
  configuration: import_v43.default.unknown().optional()
2688
2733
  });
2734
+ var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2689
2735
  var LoaderField = BaseField.extend({
2690
2736
  type: import_v43.default.literal(FieldType.LOADER),
2737
+ variant: FieldStyleVariant.default("default").optional(),
2738
+ hideLabel: import_v43.default.boolean().default(true).optional().describe("Loader field does not show a label by default"),
2691
2739
  configuration: import_v43.default.object({
2692
2740
  text: TranslationConfig.describe("Display text above the loading spinner")
2693
2741
  })
@@ -2744,6 +2792,7 @@ var FieldConfig = import_v43.default.discriminatedUnion("type", [
2744
2792
  ButtonField,
2745
2793
  AlphaPrintButton,
2746
2794
  HttpField,
2795
+ AutocompleteField,
2747
2796
  LinkButtonField,
2748
2797
  VerificationStatus,
2749
2798
  QrReaderField,
@@ -3370,6 +3419,9 @@ function mapFieldTypeToZod(field3, actionType) {
3370
3419
  case FieldType.ALPHA_PRINT_BUTTON:
3371
3420
  schema = TextValue;
3372
3421
  break;
3422
+ case FieldType.AUTOCOMPLETE:
3423
+ schema = AutocompleteValue;
3424
+ break;
3373
3425
  case FieldType.HTTP:
3374
3426
  case FieldType.SEARCH:
3375
3427
  schema = HttpFieldUpdateValue;
@@ -3430,6 +3482,7 @@ function mapFieldTypeToEmptyValue(field3) {
3430
3482
  case FieldType.BUTTON:
3431
3483
  case FieldType.ALPHA_PRINT_BUTTON:
3432
3484
  case FieldType.HTTP:
3485
+ case FieldType.AUTOCOMPLETE:
3433
3486
  case FieldType.SEARCH:
3434
3487
  case FieldType.LINK_BUTTON:
3435
3488
  case FieldType.QUERY_PARAM_READER:
@@ -3569,6 +3622,9 @@ var isPrintButtonFieldType = (field3) => {
3569
3622
  var isHttpFieldType = (field3) => {
3570
3623
  return field3.config.type === FieldType.HTTP;
3571
3624
  };
3625
+ var isAutocompleteFieldType = (field3) => {
3626
+ return field3.config.type === FieldType.AUTOCOMPLETE;
3627
+ };
3572
3628
  var isSearchFieldType = (field3) => {
3573
3629
  return field3.config.type === FieldType.SEARCH;
3574
3630
  };
@@ -4212,16 +4268,17 @@ function isPageVisible(page, formValues, context) {
4212
4268
  }
4213
4269
  return isConditionMet(page.conditional, formValues, context);
4214
4270
  }
4215
- function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false) {
4271
+ function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false, declarationContext) {
4216
4272
  const base = (0, import_lodash.cloneDeep)(formValues);
4217
4273
  function fn(prevVisibilityContext) {
4274
+ const visibilityForm = declarationContext ? { ...declarationContext, ...prevVisibilityContext } : prevVisibilityContext;
4218
4275
  const cleaned = (0, import_lodash.omitBy)(base, (value, fieldId) => {
4219
4276
  const fieldConfig = fields.filter((f) => f.id === fieldId);
4220
4277
  if (!fieldConfig.length) {
4221
4278
  return false;
4222
4279
  }
4223
4280
  const isHidden = fieldConfig.every(
4224
- (f) => !isFieldVisible(f, prevVisibilityContext, validatorContext)
4281
+ (f) => !isFieldVisible(f, visibilityForm, validatorContext)
4225
4282
  );
4226
4283
  if (!isHidden) {
4227
4284
  return false;
@@ -4288,8 +4345,10 @@ function omitHiddenAnnotationFields(actionConfig, declaration, annotation, conte
4288
4345
  const annotationFields = getActionAnnotationFields(actionConfig);
4289
4346
  return omitHiddenFields(
4290
4347
  annotationFields,
4291
- { ...declaration, ...annotation },
4292
- context
4348
+ annotation,
4349
+ context,
4350
+ false,
4351
+ declaration
4293
4352
  );
4294
4353
  }
4295
4354
  function deepMerge(currentDocument, actionDocument) {
@@ -4515,7 +4574,16 @@ function aggregateActionDeclarations(event2) {
4515
4574
  if (!requestAction) {
4516
4575
  return declaration;
4517
4576
  }
4518
- return getCompleteActionDeclaration(declaration, event2, requestAction);
4577
+ const declarationWithApprovedCorrection = getCompleteActionDeclaration(
4578
+ declaration,
4579
+ event2,
4580
+ requestAction
4581
+ );
4582
+ return getCompleteActionDeclaration(
4583
+ declarationWithApprovedCorrection,
4584
+ event2,
4585
+ action
4586
+ );
4519
4587
  }
4520
4588
  return getCompleteActionDeclaration(declaration, event2, action);
4521
4589
  }, {});
@@ -5283,6 +5351,9 @@ var _EventConfigBase = z33.object({
5283
5351
  ),
5284
5352
  flags: z33.array(FlagConfig).optional().default([]).describe(
5285
5353
  "Configuration of flags associated with the actions of this event type."
5354
+ ),
5355
+ analytics: z33.boolean().optional().default(true).describe(
5356
+ "Indicates whether the records of this event type are included in analytics"
5286
5357
  )
5287
5358
  });
5288
5359
  var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
@@ -5544,8 +5615,12 @@ var SerializedQueryExpression = z35.object({
5544
5615
  "legalStatuses.REGISTERED.createdAtLocation": z35.optional(SerializableWithin),
5545
5616
  "legalStatuses.REGISTERED.createdByRole": z35.optional(AnyOf),
5546
5617
  "legalStatuses.REGISTERED.registrationNumber": z35.optional(Exact),
5547
- createdAtLocation: z35.optional(SerializableWithin),
5548
- updatedAtLocation: z35.optional(SerializableWithin),
5618
+ createdAtLocation: z35.optional(
5619
+ z35.union([SerializableWithin, SerializableExact])
5620
+ ),
5621
+ updatedAtLocation: z35.optional(
5622
+ z35.union([SerializableWithin, SerializableExact])
5623
+ ),
5549
5624
  updatedByUserRole: z35.optional(SerializableExact),
5550
5625
  assignedTo: z35.optional(SerializableExact),
5551
5626
  createdBy: z35.optional(SerializableExact),
@@ -5732,7 +5807,20 @@ function defineWorkqueue(workqueueInput) {
5732
5807
  const query = "type" in queryInput ? queryInput : { type: "and", clauses: [queryInput] };
5733
5808
  return WorkqueueConfig.parse({ ...workqueueInput, query });
5734
5809
  }
5810
+ function warnOnConfigurationIssues(workqueue) {
5811
+ if (workqueue.actions) {
5812
+ console.warn(
5813
+ `
5814
+ ************** WARNING **************
5815
+ 'actions' property is deprecated, but used on workqueue: '${workqueue.slug}'.
5816
+ Use 'action' property instead!
5817
+ ************** WARNING **************
5818
+ `
5819
+ );
5820
+ }
5821
+ }
5735
5822
  function defineWorkqueues(workqueues) {
5823
+ workqueues.forEach(warnOnConfigurationIssues);
5736
5824
  return workqueues.map((workqueue) => defineWorkqueue(workqueue));
5737
5825
  }
5738
5826
  var WorkqueueCountInput = z37.array(
@@ -6467,7 +6555,7 @@ var IGNORED_EVENT_TYPES = [
6467
6555
  "digital-identity",
6468
6556
  "event-with-optional-address"
6469
6557
  ];
6470
- function warnOnConfigurationIssues(config) {
6558
+ function warnOnConfigurationIssues2(config) {
6471
6559
  const eventId = config.id;
6472
6560
  if (IGNORED_EVENT_TYPES.includes(eventId)) {
6473
6561
  return;
@@ -6490,7 +6578,7 @@ function warnOnConfigurationIssues(config) {
6490
6578
  }
6491
6579
  var defineConfig = (config) => {
6492
6580
  const input = EventConfig.parse(config);
6493
- warnOnConfigurationIssues(input);
6581
+ warnOnConfigurationIssues2(input);
6494
6582
  return input;
6495
6583
  };
6496
6584
 
@@ -9055,6 +9143,7 @@ function mapFieldTypeToMockValue(field3, i, rng, administrativeHierarchy) {
9055
9143
  type: "image/png"
9056
9144
  };
9057
9145
  case FieldType.SEARCH:
9146
+ case FieldType.AUTOCOMPLETE:
9058
9147
  case FieldType.HTTP:
9059
9148
  return {
9060
9149
  error: null,
@@ -9853,7 +9942,7 @@ var ACTION_SCOPE_MAP = {
9853
9942
  [ActionType.NOTIFY]: ["record.notify"],
9854
9943
  [ActionType.DECLARE]: ["record.declare", "record.register"],
9855
9944
  [ActionType.EDIT]: ["record.edit"],
9856
- [ActionType.DELETE]: ["record.declare"],
9945
+ [ActionType.DELETE]: ["record.declare", "record.notify"],
9857
9946
  [ActionType.REGISTER]: ["record.register"],
9858
9947
  [ActionType.PRINT_CERTIFICATE]: ["record.print-certified-copies"],
9859
9948
  [ActionType.REQUEST_CORRECTION]: [
@@ -9938,12 +10027,44 @@ function userDeserializer(serializedUserField, user2) {
9938
10027
  function isDefined(value) {
9939
10028
  return value !== void 0;
9940
10029
  }
10030
+ function serializeLocationField(expression, user2) {
10031
+ if (expression.type === "exact") {
10032
+ return userDeserializer(expression.term, user2);
10033
+ }
10034
+ if (expression.type === "within") {
10035
+ return userDeserializer(expression.location, user2);
10036
+ }
10037
+ return void 0;
10038
+ }
10039
+ function deserializeExpression(expression, user2) {
10040
+ if (expression.type === "exact") {
10041
+ const term = userDeserializer(expression.term, user2);
10042
+ if (!term) {
10043
+ return void 0;
10044
+ }
10045
+ return {
10046
+ ...expression,
10047
+ term
10048
+ };
10049
+ }
10050
+ if (expression.type === "within") {
10051
+ const location = userDeserializer(expression.location, user2);
10052
+ if (!location) {
10053
+ return void 0;
10054
+ }
10055
+ return {
10056
+ ...expression,
10057
+ location
10058
+ };
10059
+ }
10060
+ return void 0;
10061
+ }
9941
10062
  function deserializeQueryExpression(expression, user2) {
9942
10063
  const assignedTo = expression.assignedTo ? userDeserializer(expression.assignedTo.term, user2) : void 0;
9943
10064
  const createdBy = expression.createdBy ? userDeserializer(expression.createdBy.term, user2) : void 0;
9944
10065
  const updatedBy = expression.updatedBy ? userDeserializer(expression.updatedBy.term, user2) : void 0;
9945
- const createdAtLocation = expression.createdAtLocation ? userDeserializer(expression.createdAtLocation.location, user2) : void 0;
9946
- const updatedAtLocation = expression.updatedAtLocation ? userDeserializer(expression.updatedAtLocation.location, user2) : void 0;
10066
+ const createdAtLocation = expression.createdAtLocation ? serializeLocationField(expression.createdAtLocation, user2) : void 0;
10067
+ const updatedAtLocation = expression.updatedAtLocation ? serializeLocationField(expression.updatedAtLocation, user2) : void 0;
9947
10068
  const updatedByUserRole = expression.updatedByUserRole ? userDeserializer(expression.updatedByUserRole.term, user2) : void 0;
9948
10069
  const declaredLocation = expression["legalStatuses.DECLARED.createdAtLocation"] ? userDeserializer(
9949
10070
  expression["legalStatuses.DECLARED.createdAtLocation"].location,
@@ -9962,8 +10083,8 @@ function deserializeQueryExpression(expression, user2) {
9962
10083
  ...expression.updatedByUserRole,
9963
10084
  term: updatedByUserRole
9964
10085
  } : void 0,
9965
- createdAtLocation: expression.createdAtLocation && isDefined(createdAtLocation) ? { ...expression.createdAtLocation, location: createdAtLocation } : void 0,
9966
- updatedAtLocation: expression.updatedAtLocation && isDefined(updatedAtLocation) ? { ...expression.updatedAtLocation, location: updatedAtLocation } : void 0,
10086
+ createdAtLocation: expression.createdAtLocation && isDefined(createdAtLocation) ? deserializeExpression(expression.createdAtLocation, user2) : void 0,
10087
+ updatedAtLocation: expression.updatedAtLocation && isDefined(updatedAtLocation) ? deserializeExpression(expression.updatedAtLocation, user2) : void 0,
9967
10088
  ["legalStatuses.DECLARED.createdAtLocation"]: expression["legalStatuses.DECLARED.createdAtLocation"] && isDefined(declaredLocation) ? {
9968
10089
  ...expression["legalStatuses.DECLARED.createdAtLocation"],
9969
10090
  location: declaredLocation
@@ -0,0 +1,3 @@
1
+ declare function main(): Promise<void>;
2
+ export { main };
3
+ //# sourceMappingURL=add-birth-certificate-issuance-flag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-birth-certificate-issuance-flag.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/add-birth-certificate-issuance-flag.ts"],"names":[],"mappings":"AA6aA,iBAAe,IAAI,kBAiDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}