@opencrvs/toolkit 2.1.0-rc.05eb1de → 2.1.0-rc.06707c1

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 (58) hide show
  1. package/dist/application-config/index.js +2 -1
  2. package/dist/cli.js +0 -48
  3. package/dist/commons/api/router.d.ts +3293 -3310
  4. package/dist/commons/application-config/index.d.ts +6 -6
  5. package/dist/commons/conditionals/conditionals.d.ts +259 -2102
  6. package/dist/commons/events/ActionConfig.d.ts +112 -105
  7. package/dist/commons/events/ActionDocument.d.ts +119 -119
  8. package/dist/commons/events/ActionInput.d.ts +0 -6
  9. package/dist/commons/events/ActionType.d.ts +62 -62
  10. package/dist/commons/events/AdvancedSearchConfig.d.ts +507 -507
  11. package/dist/commons/events/AuditLog.d.ts +43 -43
  12. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  13. package/dist/commons/events/Conditional.d.ts +3 -3
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
  15. package/dist/commons/events/Draft.d.ts +37 -37
  16. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  17. package/dist/commons/events/EventConfig.d.ts +5 -5
  18. package/dist/commons/events/EventDocument.d.ts +48 -48
  19. package/dist/commons/events/EventIndex.d.ts +62 -62
  20. package/dist/commons/events/EventMetadata.d.ts +40 -40
  21. package/dist/commons/events/FieldConfig.d.ts +336 -336
  22. package/dist/commons/events/FieldType.d.ts +51 -51
  23. package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
  24. package/dist/commons/events/FieldValue.d.ts +12 -12
  25. package/dist/commons/events/Flag.d.ts +15 -15
  26. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  27. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  28. package/dist/commons/events/WorkqueueConfig.d.ts +826 -826
  29. package/dist/commons/events/deduplication.d.ts +1 -1
  30. package/dist/commons/events/event.d.ts +2 -2
  31. package/dist/commons/events/field.d.ts +78 -895
  32. package/dist/commons/events/locations.d.ts +96 -6
  33. package/dist/commons/events/mocks.test.utils.d.ts +18 -4
  34. package/dist/commons/events/scopes.d.ts +4 -4
  35. package/dist/commons/events/state/index.d.ts +17 -17
  36. package/dist/commons/events/state/utils.d.ts +7 -7
  37. package/dist/commons/events/test.utils.d.ts +40 -43
  38. package/dist/commons/events/utils.d.ts +122 -114
  39. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  40. package/dist/environment/derived-variables.d.ts +119 -131
  41. package/dist/environment/derived-variables.d.ts.map +1 -1
  42. package/dist/environment/derived-variables.js +0 -14
  43. package/dist/environment/logger.d.ts.map +1 -1
  44. package/dist/environment/questions.d.ts +75 -74
  45. package/dist/environment/questions.d.ts.map +1 -1
  46. package/dist/environment/setup-environment.js +8 -28
  47. package/dist/environment/utils.d.ts +1 -1
  48. package/dist/events/deduplication.d.ts +1 -1
  49. package/dist/events/index.js +91 -70
  50. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  51. package/dist/notification/index.js +63 -68
  52. package/dist/scopes/index.d.ts +146 -146
  53. package/dist/templates/charts-values/dependencies/values.yaml +0 -3
  54. package/dist/templates/charts-values/opencrvs-services/values.yaml +0 -4
  55. package/opencrvs-toolkit-2.1.0-rc.06707c1.tgz +0 -0
  56. package/package.json +5 -5
  57. package/tsconfig.tsbuildinfo +1 -1
  58. package/opencrvs-toolkit-2.1.0-rc.05eb1de.tgz +0 -0
@@ -59,8 +59,8 @@ export declare function field(fieldId: string): {
59
59
  fieldId: string;
60
60
  type: "dateRange";
61
61
  options: {
62
- days: number;
63
62
  pivot?: number | undefined;
63
+ days: number;
64
64
  boost?: number | undefined;
65
65
  matchAgainst?: string | undefined;
66
66
  };
@@ -161,7 +161,9 @@ __export(events_exports, {
161
161
  LanguageConfig: () => LanguageConfig,
162
162
  LegalStatuses: () => LegalStatuses,
163
163
  Location: () => Location,
164
+ LocationStatus: () => LocationStatus,
164
165
  LocationTypeV1: () => LocationTypeV1,
166
+ LocationVersion: () => LocationVersion,
165
167
  METADATA_FIELD_PREFIX: () => METADATA_FIELD_PREFIX,
166
168
  MarkAsDuplicateActionInput: () => MarkAsDuplicateActionInput,
167
169
  MarkNotDuplicateActionInput: () => MarkNotDuplicateActionInput,
@@ -201,6 +203,8 @@ __export(events_exports, {
201
203
  SelectDateRangeOption: () => SelectDateRangeOption,
202
204
  SelectDateRangeValue: () => SelectDateRangeValue,
203
205
  SelectOption: () => SelectOption,
206
+ SetAdministrativeAreaPayload: () => SetAdministrativeAreaPayload,
207
+ SetLocationPayload: () => SetLocationPayload,
204
208
  ShowConditional: () => ShowConditional,
205
209
  SignatureFieldValue: () => SignatureFieldValue,
206
210
  StaticDataEntry: () => StaticDataEntry,
@@ -313,6 +317,7 @@ __export(events_exports, {
313
317
  getActionAnnotation: () => getActionAnnotation,
314
318
  getActionAnnotationFields: () => getActionAnnotationFields,
315
319
  getActionConfig: () => getActionConfig,
320
+ getActionFormFields: () => getActionFormFields,
316
321
  getActionReview: () => getActionReview,
317
322
  getActionReviewFields: () => getActionReviewFields,
318
323
  getAdministrativeAreaHierarchy: () => getAdministrativeAreaHierarchy,
@@ -432,6 +437,7 @@ __export(events_exports, {
432
437
  resolveDateOfEvent: () => resolveDateOfEvent,
433
438
  resolveEventCustomFlags: () => resolveEventCustomFlags,
434
439
  resolvePlaceOfEvent: () => resolvePlaceOfEvent,
440
+ resolveVersion: () => resolveVersion,
435
441
  runClientFunction: () => runClientFunction,
436
442
  runFieldValidations: () => runFieldValidations,
437
443
  runStructuralValidations: () => runStructuralValidations,
@@ -1675,9 +1681,10 @@ var NotifiedAction = ActionBase.extend(
1675
1681
  var EditAction = ActionBase.extend(
1676
1682
  z14.object({
1677
1683
  type: z14.literal(ActionType.EDIT),
1684
+ /** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
1678
1685
  content: z14.object({
1679
1686
  comment: z14.string().describe("Comment for the edit action.").optional()
1680
- })
1687
+ }).optional()
1681
1688
  }).shape
1682
1689
  );
1683
1690
  var PrintContent = z14.object({
@@ -3238,6 +3245,9 @@ var ActionConfigBase = z24.object({
3238
3245
  var DeclarationActionBase = ActionConfigBase.extend({
3239
3246
  deduplication: DeduplicationConfig.optional()
3240
3247
  });
3248
+ var actionConfirmationForm = z24.array(FieldConfig).optional().describe(
3249
+ "Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
3250
+ );
3241
3251
  var ReadActionConfig = ActionConfigBase.extend(
3242
3252
  z24.object({
3243
3253
  type: z24.literal(ActionType.READ),
@@ -3249,7 +3259,8 @@ var ReadActionConfig = ActionConfigBase.extend(
3249
3259
  );
3250
3260
  var NotifyConfig = ActionConfigBase.extend(
3251
3261
  z24.object({
3252
- type: z24.literal(ActionType.NOTIFY)
3262
+ type: z24.literal(ActionType.NOTIFY),
3263
+ form: actionConfirmationForm
3253
3264
  }).shape
3254
3265
  );
3255
3266
  var DuplicateDetectedConfig = ActionConfigBase.extend(
@@ -3304,6 +3315,7 @@ var DeclareConfig = DeclarationActionBase.extend(
3304
3315
  review: DeclarationReviewConfig.describe(
3305
3316
  "Configuration of the review page fields."
3306
3317
  ),
3318
+ form: actionConfirmationForm,
3307
3319
  dialogCopy: z24.object({
3308
3320
  notify: TranslationConfig.describe(
3309
3321
  "Confirmation text for the notify action"
@@ -3319,7 +3331,8 @@ var DeclareConfig = DeclarationActionBase.extend(
3319
3331
  );
3320
3332
  var ArchiveConfig = ActionConfigBase.extend(
3321
3333
  z24.object({
3322
- type: z24.literal(ActionType.ARCHIVE)
3334
+ type: z24.literal(ActionType.ARCHIVE),
3335
+ form: actionConfirmationForm
3323
3336
  }).shape
3324
3337
  );
3325
3338
  var UnarchiveConfig = ActionConfigBase.extend(
@@ -3345,12 +3358,14 @@ var EditActionConfig = ActionConfigBase.extend(
3345
3358
  );
3346
3359
  var RejectConfig = ActionConfigBase.extend(
3347
3360
  z24.object({
3348
- type: z24.literal(ActionType.REJECT)
3361
+ type: z24.literal(ActionType.REJECT),
3362
+ form: actionConfirmationForm
3349
3363
  }).shape
3350
3364
  );
3351
3365
  var RegisterConfig = DeclarationActionBase.extend(
3352
3366
  z24.object({
3353
- type: z24.literal(ActionType.REGISTER)
3367
+ type: z24.literal(ActionType.REGISTER),
3368
+ form: actionConfirmationForm
3354
3369
  }).shape
3355
3370
  );
3356
3371
  var PrintCertificateActionConfig = ActionConfigBase.extend(
@@ -4624,7 +4639,19 @@ function getCustomActionFields(eventConfiguration, customActionType) {
4624
4639
  customActionType,
4625
4640
  actionType: ActionType.CUSTOM
4626
4641
  });
4627
- if (!actionConfig || !("form" in actionConfig)) {
4642
+ if (!actionConfig || actionConfig.type !== ActionType.CUSTOM) {
4643
+ return [];
4644
+ }
4645
+ return actionConfig.form;
4646
+ }
4647
+ function getActionFormFields(eventConfiguration, actionType, customActionType) {
4648
+ const actionConfig = eventConfiguration.actions.find((a) => {
4649
+ if (a.type === ActionType.CUSTOM && customActionType) {
4650
+ return a.customActionType === customActionType;
4651
+ }
4652
+ return a.type === actionType;
4653
+ });
4654
+ if (!actionConfig || !("form" in actionConfig) || actionConfig.form == null) {
4628
4655
  return [];
4629
4656
  }
4630
4657
  return actionConfig.form;
@@ -4645,13 +4672,9 @@ var getActionAnnotationFields = (actionConfig) => {
4645
4672
  if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
4646
4673
  return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
4647
4674
  }
4648
- if (actionConfig.type === ActionType.CUSTOM) {
4649
- return actionConfig.form;
4650
- }
4651
- if ("review" in actionConfig && actionConfig.review != null) {
4652
- return actionConfig.review.fields;
4653
- }
4654
- return [];
4675
+ const reviewFields = "review" in actionConfig && actionConfig.review != null ? actionConfig.review.fields : [];
4676
+ const formFields = "form" in actionConfig && actionConfig.form != null ? actionConfig.form : [];
4677
+ return [...reviewFields, ...formFields];
4655
4678
  };
4656
4679
  function getAllAnnotationFields(config) {
4657
4680
  return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
@@ -6398,10 +6421,7 @@ var DeclareActionInput = BaseActionInput.extend(
6398
6421
  );
6399
6422
  var EditActionInput = BaseActionInput.extend(
6400
6423
  z38.object({
6401
- type: z38.literal(ActionType.EDIT).default(ActionType.EDIT),
6402
- content: z38.object({
6403
- comment: z38.string().describe("Comment for the edit action.").optional()
6404
- })
6424
+ type: z38.literal(ActionType.EDIT).default(ActionType.EDIT)
6405
6425
  }).shape
6406
6426
  );
6407
6427
  var PrintCertificateActionInput = BaseActionInput.extend(
@@ -9946,7 +9966,6 @@ function eventPayloadGenerator(rng, configuration = tennisClubMembershipEvent) {
9946
9966
  },
9947
9967
  edit: (eventId, input = {}) => ({
9948
9968
  type: ActionType.EDIT,
9949
- content: { comment: "Test comment" },
9950
9969
  transactionId: input.transactionId ?? getUUID(),
9951
9970
  declaration: input.declaration ?? generateActionDeclarationInput(configuration, ActionType.EDIT, rng),
9952
9971
  annotation: input.annotation ?? generateActionAnnotationInput(configuration, ActionType.EDIT, rng),
@@ -10452,21 +10471,53 @@ var LocationTypeV1 = z43.enum([
10452
10471
  "CRVS_OFFICE",
10453
10472
  "HEALTH_FACILITY"
10454
10473
  ]);
10474
+ var LocationStatus = z43.enum(["active", "inactive"]);
10475
+ var LocationVersion = z43.object({
10476
+ versionId: UUID,
10477
+ effectiveFrom: z43.iso.date(),
10478
+ name: z43.string(),
10479
+ externalId: z43.string().nullish(),
10480
+ status: LocationStatus
10481
+ });
10455
10482
  var AdministrativeArea = z43.object({
10456
10483
  id: UUID,
10457
10484
  name: z43.string(),
10458
10485
  externalId: z43.string().nullish(),
10459
10486
  parentId: UUID.nullable(),
10460
- validUntil: z43.iso.datetime().nullable()
10487
+ status: LocationStatus,
10488
+ versions: z43.array(LocationVersion)
10461
10489
  });
10462
10490
  var Location = z43.object({
10463
10491
  id: UUID,
10464
10492
  name: z43.string(),
10465
10493
  externalId: z43.string().nullish(),
10466
10494
  administrativeAreaId: UUID.nullable(),
10467
- validUntil: z43.iso.datetime().nullable(),
10495
+ locationType: z43.string().nullable(),
10496
+ status: LocationStatus,
10497
+ versions: z43.array(LocationVersion)
10498
+ });
10499
+ var SetLocationPayload = z43.object({
10500
+ id: UUID,
10501
+ name: z43.string(),
10502
+ externalId: z43.string().nullish(),
10503
+ administrativeAreaId: UUID.nullable(),
10468
10504
  locationType: z43.string().nullable()
10469
10505
  });
10506
+ var SetAdministrativeAreaPayload = z43.object({
10507
+ id: UUID,
10508
+ name: z43.string(),
10509
+ externalId: z43.string().nullish(),
10510
+ parentId: UUID.nullable()
10511
+ });
10512
+ function resolveVersion(versions, anchor) {
10513
+ let resolved = versions[0];
10514
+ for (const version of versions) {
10515
+ if (version.effectiveFrom <= anchor) {
10516
+ resolved = version;
10517
+ }
10518
+ }
10519
+ return resolved;
10520
+ }
10470
10521
  function matchesJurisdictionFilter(locationIds, filter, user2) {
10471
10522
  if (!locationIds) {
10472
10523
  return false;
@@ -10946,75 +10997,80 @@ function getFilePathsFromEvent(event2) {
10946
10997
  }
10947
10998
 
10948
10999
  // ../commons/src/events/mocks.test.utils.ts
10949
- var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
11000
+ function withVersionFields(entity) {
11001
+ return {
11002
+ ...entity,
11003
+ status: "active",
11004
+ versions: [
11005
+ {
11006
+ versionId: entity.id,
11007
+ effectiveFrom: "0001-01-01",
11008
+ name: entity.name,
11009
+ externalId: entity.externalId ?? null,
11010
+ status: "active"
11011
+ }
11012
+ ]
11013
+ };
11014
+ }
11015
+ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
10950
11016
  {
10951
11017
  id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
10952
11018
  name: "Central",
10953
11019
  parentId: null,
10954
- validUntil: null,
10955
11020
  externalId: "ydyJb1RAy4U1"
10956
11021
  },
10957
11022
  {
10958
11023
  id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
10959
11024
  name: "Sulaka",
10960
11025
  parentId: null,
10961
- validUntil: null,
10962
11026
  externalId: "pQ8nGxWmZ2Q3"
10963
11027
  },
10964
11028
  {
10965
11029
  id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
10966
11030
  name: "Pualula",
10967
11031
  parentId: null,
10968
- validUntil: null,
10969
11032
  externalId: "Aq91DweLmT8k"
10970
11033
  },
10971
11034
  {
10972
11035
  id: "6d1a59df-988c-4021-a846-ccbc021931a7",
10973
11036
  name: "Chuminga",
10974
11037
  parentId: null,
10975
- validUntil: null,
10976
11038
  externalId: "Rw0fYNh2Xk9a"
10977
11039
  },
10978
11040
  {
10979
11041
  id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
10980
11042
  name: "Ibombo",
10981
11043
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
10982
- validUntil: null,
10983
11044
  externalId: "k7DsP4vbN1Qe"
10984
11045
  },
10985
11046
  {
10986
11047
  id: "27160bbd-32d1-4625-812f-860226bfb92a",
10987
11048
  name: "Isango",
10988
11049
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
10989
- validUntil: null,
10990
11050
  externalId: "Gm3Z9eQpHw4L"
10991
11051
  },
10992
11052
  {
10993
11053
  id: "967032fd-3f81-478a-826c-30cb8fe121bd",
10994
11054
  name: "Isamba",
10995
11055
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
10996
- validUntil: null,
10997
11056
  externalId: "sT0xVu1KqJ7r"
10998
11057
  },
10999
11058
  {
11000
11059
  id: "89a33893-b17d-481d-a26d-6461e7ac1651",
11001
11060
  name: "Itambo",
11002
11061
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11003
- validUntil: null,
11004
11062
  externalId: "Nq6Bv2HpL9Te"
11005
11063
  },
11006
11064
  {
11007
11065
  id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
11008
11066
  name: "Ezhi",
11009
11067
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11010
- validUntil: null,
11011
11068
  externalId: "xK8cQ0ZRy5Wd"
11012
11069
  },
11013
11070
  {
11014
11071
  id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
11015
11072
  name: "Ilanga",
11016
11073
  parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
11017
- validUntil: null,
11018
11074
  externalId: "Cq4Jm1XvN8Ls"
11019
11075
  },
11020
11076
  // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
@@ -11022,49 +11078,42 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
11022
11078
  id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
11023
11079
  name: "Klow",
11024
11080
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11025
- validUntil: null,
11026
11081
  externalId: "IkYcYBUcyY2"
11027
11082
  },
11028
11083
  {
11029
11084
  id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
11030
11085
  name: "Mbondo",
11031
11086
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11032
- validUntil: null,
11033
11087
  externalId: "Qhvv5hvo3mY"
11034
11088
  },
11035
11089
  {
11036
11090
  id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
11037
11091
  name: "Ndara",
11038
11092
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11039
- validUntil: null,
11040
11093
  externalId: "crXh068O9TR"
11041
11094
  },
11042
11095
  {
11043
11096
  id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
11044
11097
  name: "Olani",
11045
11098
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11046
- validUntil: null,
11047
11099
  externalId: "r00It8Tvvp7"
11048
11100
  },
11049
11101
  {
11050
11102
  id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
11051
11103
  name: "Pemba",
11052
11104
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11053
- validUntil: null,
11054
11105
  externalId: "ZnUWsbONIaH"
11055
11106
  },
11056
11107
  {
11057
11108
  id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
11058
11109
  name: "Quanza",
11059
11110
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11060
- validUntil: null,
11061
11111
  externalId: "fDZycvQTa7l"
11062
11112
  },
11063
11113
  {
11064
11114
  id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
11065
11115
  name: "Rivka",
11066
11116
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11067
- validUntil: null,
11068
11117
  externalId: "KqswxCGTELa"
11069
11118
  },
11070
11119
  // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
@@ -11072,35 +11121,30 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
11072
11121
  id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
11073
11122
  name: "Mbula",
11074
11123
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11075
- validUntil: null,
11076
11124
  externalId: "osEbKjRc9Kg"
11077
11125
  },
11078
11126
  {
11079
11127
  id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
11080
11128
  name: "Ndoki",
11081
11129
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11082
- validUntil: null,
11083
11130
  externalId: "aq4daBUAGr3"
11084
11131
  },
11085
11132
  {
11086
11133
  id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
11087
11134
  name: "Tsanga",
11088
11135
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11089
- validUntil: null,
11090
11136
  externalId: "cqis6Y8trbJ"
11091
11137
  },
11092
11138
  {
11093
11139
  id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
11094
11140
  name: "Waziri",
11095
11141
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11096
- validUntil: null,
11097
11142
  externalId: "LMijHPyyx6d"
11098
11143
  },
11099
11144
  {
11100
11145
  id: "2c5d6e7f-8a9b-4423-8def-456789012345",
11101
11146
  name: "Zimbi",
11102
11147
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11103
- validUntil: null,
11104
11148
  externalId: "pcQYbPuKGZ7"
11105
11149
  },
11106
11150
  // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
@@ -11108,67 +11152,59 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
11108
11152
  id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
11109
11153
  name: "Felani",
11110
11154
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11111
- validUntil: null,
11112
11155
  externalId: "gSqpoCGdMXp"
11113
11156
  },
11114
11157
  {
11115
11158
  id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
11116
11159
  name: "Goroma",
11117
11160
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11118
- validUntil: null,
11119
11161
  externalId: "KvAAIaNqVrp"
11120
11162
  },
11121
11163
  {
11122
11164
  id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
11123
11165
  name: "Halifu",
11124
11166
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11125
- validUntil: null,
11126
11167
  externalId: "qe4UnEVt1hv"
11127
11168
  },
11128
11169
  {
11129
11170
  id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
11130
11171
  name: "Jabari",
11131
11172
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11132
- validUntil: null,
11133
11173
  externalId: "yHH9Nz4rLOt"
11134
11174
  },
11135
11175
  {
11136
11176
  id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
11137
11177
  name: "Kifani",
11138
11178
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11139
- validUntil: null,
11140
11179
  externalId: "eSWmXIGeu1I"
11141
11180
  },
11142
11181
  {
11143
11182
  id: "8c1d2e3f-4a5b-4089-8def-012345678901",
11144
11183
  name: "Lumela",
11145
11184
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11146
- validUntil: null,
11147
11185
  externalId: "bh0b3aI1uP3"
11148
11186
  }
11149
11187
  ];
11150
- var V2_DEFAULT_MOCK_LOCATIONS = [
11188
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = MOCK_ADMINISTRATIVE_AREAS_BASE.map(withVersionFields);
11189
+ var MOCK_LOCATIONS_BASE = [
11151
11190
  {
11152
11191
  id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
11153
11192
  name: "Central Provincial Office",
11154
11193
  locationType: "CRVS_OFFICE",
11155
11194
  administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11156
- validUntil: null,
11157
11195
  externalId: "Xr3Df8WpK6Ys"
11158
11196
  },
11159
11197
  {
11160
11198
  id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
11161
11199
  name: "Central Health Post",
11162
11200
  locationType: "HEALTH_FACILITY",
11163
- administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11164
- validUntil: null
11201
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
11165
11202
  },
11166
11203
  {
11167
11204
  id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
11168
11205
  name: "Ibombo District Office",
11169
11206
  locationType: "CRVS_OFFICE",
11170
11207
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11171
- validUntil: null,
11172
11208
  externalId: "Sm4Nw7GrD2Vy"
11173
11209
  },
11174
11210
  {
@@ -11176,7 +11212,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11176
11212
  name: "Isamba District Office",
11177
11213
  locationType: "CRVS_OFFICE",
11178
11214
  administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11179
- validUntil: null,
11180
11215
  externalId: "Vg1Bq5XeH9Lt"
11181
11216
  },
11182
11217
  {
@@ -11184,7 +11219,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11184
11219
  name: "Isango District Office",
11185
11220
  locationType: "CRVS_OFFICE",
11186
11221
  administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
11187
- validUntil: null,
11188
11222
  externalId: "Je7Lm2XqN9Vz"
11189
11223
  },
11190
11224
  {
@@ -11192,7 +11226,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11192
11226
  name: "Sulaka Provincial Office",
11193
11227
  locationType: "CRVS_OFFICE",
11194
11228
  administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
11195
- validUntil: null,
11196
11229
  externalId: "Ht2Wp9KcX5Qv"
11197
11230
  },
11198
11231
  {
@@ -11200,7 +11233,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11200
11233
  name: "Ilanga District Office",
11201
11234
  locationType: "CRVS_OFFICE",
11202
11235
  administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
11203
- validUntil: null,
11204
11236
  externalId: "Yp6Ds1WqN3Xz"
11205
11237
  },
11206
11238
  {
@@ -11208,7 +11240,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11208
11240
  name: "Chamakubi Health Post",
11209
11241
  locationType: "HEALTH_FACILITY",
11210
11242
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11211
- validUntil: null,
11212
11243
  externalId: "M1nFr8LbC2Qy"
11213
11244
  },
11214
11245
  {
@@ -11216,7 +11247,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11216
11247
  name: "Ibombo Rural Health Centre",
11217
11248
  locationType: "HEALTH_FACILITY",
11218
11249
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11219
- validUntil: null,
11220
11250
  externalId: "bT7pV6YrW0Xc"
11221
11251
  },
11222
11252
  {
@@ -11224,7 +11254,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11224
11254
  name: "Chikobo Rural Health Centre",
11225
11255
  locationType: "HEALTH_FACILITY",
11226
11256
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11227
- validUntil: null,
11228
11257
  externalId: "zE4qPn2SgJ5d"
11229
11258
  },
11230
11259
  {
@@ -11232,7 +11261,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11232
11261
  name: "Chilochabalenje Health Post",
11233
11262
  locationType: "HEALTH_FACILITY",
11234
11263
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11235
- validUntil: null,
11236
11264
  externalId: "H8vDs1MqR4Uf"
11237
11265
  },
11238
11266
  {
@@ -11240,7 +11268,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11240
11268
  name: "Chipeso Rural Health Centre",
11241
11269
  locationType: "HEALTH_FACILITY",
11242
11270
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11243
- validUntil: null,
11244
11271
  externalId: "Qw3uZ9KfX6Lm"
11245
11272
  },
11246
11273
  {
@@ -11248,7 +11275,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11248
11275
  name: "Chisamba Rural Health Centre",
11249
11276
  locationType: "HEALTH_FACILITY",
11250
11277
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11251
- validUntil: null,
11252
11278
  externalId: "Yr0pCg8LdM2s"
11253
11279
  },
11254
11280
  {
@@ -11256,7 +11282,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11256
11282
  name: "Chitanda Rural Health Centre",
11257
11283
  locationType: "HEALTH_FACILITY",
11258
11284
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11259
- validUntil: null,
11260
11285
  externalId: "tS9gJ4PwB1Qx"
11261
11286
  },
11262
11287
  {
@@ -11264,7 +11289,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11264
11289
  name: "Golden Valley Rural Health Centre",
11265
11290
  locationType: "HEALTH_FACILITY",
11266
11291
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11267
- validUntil: null,
11268
11292
  externalId: "Ld7Qm3XsA8Vr"
11269
11293
  },
11270
11294
  {
@@ -11272,7 +11296,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11272
11296
  name: "Ipongo Rural Health Centre",
11273
11297
  locationType: "HEALTH_FACILITY",
11274
11298
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11275
- validUntil: null,
11276
11299
  externalId: "kF2sW9DmH0Bt"
11277
11300
  },
11278
11301
  {
@@ -11280,7 +11303,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11280
11303
  name: "Itumbwe Health Post",
11281
11304
  locationType: "HEALTH_FACILITY",
11282
11305
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11283
- validUntil: null,
11284
11306
  externalId: "Ue5Xb3VaC7Pq"
11285
11307
  },
11286
11308
  {
@@ -11288,7 +11310,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11288
11310
  name: "Kabangalala Rural Health Centre",
11289
11311
  locationType: "HEALTH_FACILITY",
11290
11312
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11291
- validUntil: null,
11292
11313
  externalId: "Pz8Kc1TqH6Jn"
11293
11314
  },
11294
11315
  // Village offices
@@ -11297,10 +11318,10 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
11297
11318
  name: "Klow Village Office",
11298
11319
  locationType: "CRVS_OFFICE",
11299
11320
  administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
11300
- validUntil: null,
11301
11321
  externalId: "PmAyxAJkxiJ"
11302
11322
  }
11303
11323
  ];
11324
+ var V2_DEFAULT_MOCK_LOCATIONS = MOCK_LOCATIONS_BASE.map(withVersionFields);
11304
11325
  var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
11305
11326
  V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
11306
11327
  );
@@ -92,9 +92,10 @@ const FUNCTION_LIKE_KINDS = [
92
92
  * Falls back to `<anonymous>` when nothing useful can be derived.
93
93
  */
94
94
  function describeFunction(node) {
95
- var _a, _b, _c;
95
+ var _a;
96
+ var _b, _c;
96
97
  if (ts_morph_1.Node.isFunctionDeclaration(node) || ts_morph_1.Node.isMethodDeclaration(node)) {
97
- return (_a = node.getName()) !== null && _a !== void 0 ? _a : '<anonymous>';
98
+ return (_b = node.getName()) !== null && _b !== void 0 ? _b : '<anonymous>';
98
99
  }
99
100
  // FunctionExpression / ArrowFunction: try to pick up the assignment target.
100
101
  const parent = node.getParent();
@@ -106,7 +107,7 @@ function describeFunction(node) {
106
107
  }
107
108
  if (ts_morph_1.Node.isFunctionExpression(node) &&
108
109
  node.getNameNode() !== undefined) {
109
- return (_c = (_b = node.getNameNode()) === null || _b === void 0 ? void 0 : _b.getText()) !== null && _c !== void 0 ? _c : '<anonymous>';
110
+ return (_c = (_a = node.getNameNode()) === null || _a === void 0 ? void 0 : _a.getText()) !== null && _c !== void 0 ? _c : '<anonymous>';
110
111
  }
111
112
  return '<anonymous>';
112
113
  }