@opencrvs/toolkit 2.0.0-rc.65195ed → 2.0.0-rc.654a81d

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.
@@ -2622,6 +2622,9 @@ var DeduplicationConfig = z23.object({
2622
2622
  id: z23.string(),
2623
2623
  label: TranslationConfig,
2624
2624
  query: Clause
2625
+ }).meta({
2626
+ id: "DeduplicationConfig",
2627
+ description: "Configuration for duplicate detection on a declare or register action. The query is built from fuzzy / strict / date-range matchers combined with and/or/not."
2625
2628
  });
2626
2629
 
2627
2630
  // ../commons/src/events/ActionConfig.ts
@@ -2850,7 +2853,10 @@ var Field = BaseField2.extend({
2850
2853
  }).describe("Custom field defined for the summary view.");
2851
2854
  var SummaryConfig = z27.object({
2852
2855
  fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2853
- }).describe("Configuration of the event summary section.");
2856
+ }).meta({
2857
+ id: "SummaryConfig",
2858
+ description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
2859
+ });
2854
2860
 
2855
2861
  // ../commons/src/events/AdvancedSearchConfig.ts
2856
2862
  var z28 = __toESM(require("zod/v4"));
@@ -2974,6 +2980,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
2974
2980
  var AdvancedSearchConfig = z28.object({
2975
2981
  title: TranslationConfig.describe("Advanced search tab title"),
2976
2982
  fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2983
+ }).meta({
2984
+ id: "AdvancedSearchConfig",
2985
+ description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
2977
2986
  });
2978
2987
 
2979
2988
  // ../commons/src/events/utils.ts
@@ -4090,6 +4099,9 @@ var WorkqueueColumnValue = z34.object({
4090
4099
  var WorkqueueColumn = z34.object({
4091
4100
  label: TranslationConfig,
4092
4101
  value: WorkqueueColumnValue
4102
+ }).meta({
4103
+ id: "WorkqueueColumn",
4104
+ description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
4093
4105
  });
4094
4106
  function defineWorkqueuesColumns(workqueueColumns) {
4095
4107
  return workqueueColumns.map(
@@ -4295,8 +4307,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
4295
4307
  var WorkqueueConfigInput = WorkqueueConfig.extend({
4296
4308
  query: CountryConfigQueryInputType
4297
4309
  }).meta({
4298
- description: "Workqueue configuration",
4299
- id: "WorkqueueConfig"
4310
+ id: "WorkqueueConfig",
4311
+ description: "Configuration for a single workqueue. Defines the filter applied to the event index, the quick-action button, the columns shown on each row, and the message rendered when the queue is empty."
4300
4312
  });
4301
4313
  var WorkqueueCountInput = z37.array(
4302
4314
  z37.object({ slug: z37.string(), query: QueryType })
@@ -4338,7 +4350,9 @@ var BaseActionInput = z38.object({
4338
4350
  keepAssignment: z38.boolean().optional(),
4339
4351
  keepAssignmentIfAccepted: z38.boolean().optional(),
4340
4352
  keepAssignmentIfRejected: z38.boolean().optional(),
4341
- waitFor: z38.boolean().optional(),
4353
+ waitFor: z38.boolean().default(true).describe(
4354
+ "Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
4355
+ ),
4342
4356
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4343
4357
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
4344
4358
  createdAtLocation: UUID.nullish().describe(
@@ -4519,7 +4533,7 @@ var Draft = z39.object({
4519
4533
  }).describe(
4520
4534
  "A temporary storage for an action. Stored with details of the event, creator and creation time."
4521
4535
  );
4522
- var DraftInput = BaseActionInput.extend({
4536
+ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
4523
4537
  type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
4524
4538
  status: z39.enum([
4525
4539
  ActionStatus.Requested,
@@ -7117,6 +7131,369 @@ var ACTION_FILTERS = {
7117
7131
  // ../commons/src/events/FileUtils.ts
7118
7132
  var import_lodash7 = require("lodash");
7119
7133
 
7134
+ // ../commons/src/events/mocks.test.utils.ts
7135
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7136
+ {
7137
+ id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7138
+ name: "Central",
7139
+ parentId: null,
7140
+ validUntil: null,
7141
+ externalId: "ydyJb1RAy4U1"
7142
+ },
7143
+ {
7144
+ id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7145
+ name: "Sulaka",
7146
+ parentId: null,
7147
+ validUntil: null,
7148
+ externalId: "pQ8nGxWmZ2Q3"
7149
+ },
7150
+ {
7151
+ id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
7152
+ name: "Pualula",
7153
+ parentId: null,
7154
+ validUntil: null,
7155
+ externalId: "Aq91DweLmT8k"
7156
+ },
7157
+ {
7158
+ id: "6d1a59df-988c-4021-a846-ccbc021931a7",
7159
+ name: "Chuminga",
7160
+ parentId: null,
7161
+ validUntil: null,
7162
+ externalId: "Rw0fYNh2Xk9a"
7163
+ },
7164
+ {
7165
+ id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7166
+ name: "Ibombo",
7167
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7168
+ validUntil: null,
7169
+ externalId: "k7DsP4vbN1Qe"
7170
+ },
7171
+ {
7172
+ id: "27160bbd-32d1-4625-812f-860226bfb92a",
7173
+ name: "Isango",
7174
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7175
+ validUntil: null,
7176
+ externalId: "Gm3Z9eQpHw4L"
7177
+ },
7178
+ {
7179
+ id: "967032fd-3f81-478a-826c-30cb8fe121bd",
7180
+ name: "Isamba",
7181
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7182
+ validUntil: null,
7183
+ externalId: "sT0xVu1KqJ7r"
7184
+ },
7185
+ {
7186
+ id: "89a33893-b17d-481d-a26d-6461e7ac1651",
7187
+ name: "Itambo",
7188
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7189
+ validUntil: null,
7190
+ externalId: "Nq6Bv2HpL9Te"
7191
+ },
7192
+ {
7193
+ id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
7194
+ name: "Ezhi",
7195
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7196
+ validUntil: null,
7197
+ externalId: "xK8cQ0ZRy5Wd"
7198
+ },
7199
+ {
7200
+ id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7201
+ name: "Ilanga",
7202
+ parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7203
+ validUntil: null,
7204
+ externalId: "Cq4Jm1XvN8Ls"
7205
+ },
7206
+ // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
7207
+ {
7208
+ id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7209
+ name: "Klow",
7210
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7211
+ validUntil: null,
7212
+ externalId: "IkYcYBUcyY2"
7213
+ },
7214
+ {
7215
+ id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
7216
+ name: "Mbondo",
7217
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7218
+ validUntil: null,
7219
+ externalId: "Qhvv5hvo3mY"
7220
+ },
7221
+ {
7222
+ id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
7223
+ name: "Ndara",
7224
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7225
+ validUntil: null,
7226
+ externalId: "crXh068O9TR"
7227
+ },
7228
+ {
7229
+ id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
7230
+ name: "Olani",
7231
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7232
+ validUntil: null,
7233
+ externalId: "r00It8Tvvp7"
7234
+ },
7235
+ {
7236
+ id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
7237
+ name: "Pemba",
7238
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7239
+ validUntil: null,
7240
+ externalId: "ZnUWsbONIaH"
7241
+ },
7242
+ {
7243
+ id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
7244
+ name: "Quanza",
7245
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7246
+ validUntil: null,
7247
+ externalId: "fDZycvQTa7l"
7248
+ },
7249
+ {
7250
+ id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
7251
+ name: "Rivka",
7252
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7253
+ validUntil: null,
7254
+ externalId: "KqswxCGTELa"
7255
+ },
7256
+ // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
7257
+ {
7258
+ id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
7259
+ name: "Mbula",
7260
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7261
+ validUntil: null,
7262
+ externalId: "osEbKjRc9Kg"
7263
+ },
7264
+ {
7265
+ id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
7266
+ name: "Ndoki",
7267
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7268
+ validUntil: null,
7269
+ externalId: "aq4daBUAGr3"
7270
+ },
7271
+ {
7272
+ id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
7273
+ name: "Tsanga",
7274
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7275
+ validUntil: null,
7276
+ externalId: "cqis6Y8trbJ"
7277
+ },
7278
+ {
7279
+ id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
7280
+ name: "Waziri",
7281
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7282
+ validUntil: null,
7283
+ externalId: "LMijHPyyx6d"
7284
+ },
7285
+ {
7286
+ id: "2c5d6e7f-8a9b-4423-8def-456789012345",
7287
+ name: "Zimbi",
7288
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7289
+ validUntil: null,
7290
+ externalId: "pcQYbPuKGZ7"
7291
+ },
7292
+ // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
7293
+ {
7294
+ id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
7295
+ name: "Felani",
7296
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7297
+ validUntil: null,
7298
+ externalId: "gSqpoCGdMXp"
7299
+ },
7300
+ {
7301
+ id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
7302
+ name: "Goroma",
7303
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7304
+ validUntil: null,
7305
+ externalId: "KvAAIaNqVrp"
7306
+ },
7307
+ {
7308
+ id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
7309
+ name: "Halifu",
7310
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7311
+ validUntil: null,
7312
+ externalId: "qe4UnEVt1hv"
7313
+ },
7314
+ {
7315
+ id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
7316
+ name: "Jabari",
7317
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7318
+ validUntil: null,
7319
+ externalId: "yHH9Nz4rLOt"
7320
+ },
7321
+ {
7322
+ id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
7323
+ name: "Kifani",
7324
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7325
+ validUntil: null,
7326
+ externalId: "eSWmXIGeu1I"
7327
+ },
7328
+ {
7329
+ id: "8c1d2e3f-4a5b-4089-8def-012345678901",
7330
+ name: "Lumela",
7331
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7332
+ validUntil: null,
7333
+ externalId: "bh0b3aI1uP3"
7334
+ }
7335
+ ];
7336
+ var V2_DEFAULT_MOCK_LOCATIONS = [
7337
+ {
7338
+ id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
7339
+ name: "Central Provincial Office",
7340
+ locationType: "CRVS_OFFICE",
7341
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7342
+ validUntil: null,
7343
+ externalId: "Xr3Df8WpK6Ys"
7344
+ },
7345
+ {
7346
+ id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
7347
+ name: "Central Health Post",
7348
+ locationType: "HEALTH_FACILITY",
7349
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7350
+ validUntil: null
7351
+ },
7352
+ {
7353
+ id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
7354
+ name: "Ibombo District Office",
7355
+ locationType: "CRVS_OFFICE",
7356
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7357
+ validUntil: null,
7358
+ externalId: "Sm4Nw7GrD2Vy"
7359
+ },
7360
+ {
7361
+ id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
7362
+ name: "Isamba District Office",
7363
+ locationType: "CRVS_OFFICE",
7364
+ administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7365
+ validUntil: null,
7366
+ externalId: "Vg1Bq5XeH9Lt"
7367
+ },
7368
+ {
7369
+ id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
7370
+ name: "Isango District Office",
7371
+ locationType: "CRVS_OFFICE",
7372
+ administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
7373
+ validUntil: null,
7374
+ externalId: "Je7Lm2XqN9Vz"
7375
+ },
7376
+ {
7377
+ id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
7378
+ name: "Sulaka Provincial Office",
7379
+ locationType: "CRVS_OFFICE",
7380
+ administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7381
+ validUntil: null,
7382
+ externalId: "Ht2Wp9KcX5Qv"
7383
+ },
7384
+ {
7385
+ id: "030358c6-54af-44be-821b-8e4af963a49c",
7386
+ name: "Ilanga District Office",
7387
+ locationType: "CRVS_OFFICE",
7388
+ administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7389
+ validUntil: null,
7390
+ externalId: "Yp6Ds1WqN3Xz"
7391
+ },
7392
+ {
7393
+ id: "423d000f-101b-47c0-8b86-21a908067cee",
7394
+ name: "Chamakubi Health Post",
7395
+ locationType: "HEALTH_FACILITY",
7396
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7397
+ validUntil: null,
7398
+ externalId: "M1nFr8LbC2Qy"
7399
+ },
7400
+ {
7401
+ id: "4d3279be-d026-420c-88f7-f0a4ae986973",
7402
+ name: "Ibombo Rural Health Centre",
7403
+ locationType: "HEALTH_FACILITY",
7404
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7405
+ validUntil: null,
7406
+ externalId: "bT7pV6YrW0Xc"
7407
+ },
7408
+ {
7409
+ id: "190902f4-1d77-476a-8947-41145af1db7d",
7410
+ name: "Chikobo Rural Health Centre",
7411
+ locationType: "HEALTH_FACILITY",
7412
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7413
+ validUntil: null,
7414
+ externalId: "zE4qPn2SgJ5d"
7415
+ },
7416
+ {
7417
+ id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
7418
+ name: "Chilochabalenje Health Post",
7419
+ locationType: "HEALTH_FACILITY",
7420
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7421
+ validUntil: null,
7422
+ externalId: "H8vDs1MqR4Uf"
7423
+ },
7424
+ {
7425
+ id: "dbfc178f-7295-4b90-b28d-111c95b03127",
7426
+ name: "Chipeso Rural Health Centre",
7427
+ locationType: "HEALTH_FACILITY",
7428
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7429
+ validUntil: null,
7430
+ externalId: "Qw3uZ9KfX6Lm"
7431
+ },
7432
+ {
7433
+ id: "09862bfe-c7ac-46cd-987b-668681533c80",
7434
+ name: "Chisamba Rural Health Centre",
7435
+ locationType: "HEALTH_FACILITY",
7436
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7437
+ validUntil: null,
7438
+ externalId: "Yr0pCg8LdM2s"
7439
+ },
7440
+ {
7441
+ id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
7442
+ name: "Chitanda Rural Health Centre",
7443
+ locationType: "HEALTH_FACILITY",
7444
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7445
+ validUntil: null,
7446
+ externalId: "tS9gJ4PwB1Qx"
7447
+ },
7448
+ {
7449
+ id: "0431c433-6062-4a4c-aee9-25271aec61ee",
7450
+ name: "Golden Valley Rural Health Centre",
7451
+ locationType: "HEALTH_FACILITY",
7452
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7453
+ validUntil: null,
7454
+ externalId: "Ld7Qm3XsA8Vr"
7455
+ },
7456
+ {
7457
+ id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
7458
+ name: "Ipongo Rural Health Centre",
7459
+ locationType: "HEALTH_FACILITY",
7460
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7461
+ validUntil: null,
7462
+ externalId: "kF2sW9DmH0Bt"
7463
+ },
7464
+ {
7465
+ id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
7466
+ name: "Itumbwe Health Post",
7467
+ locationType: "HEALTH_FACILITY",
7468
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7469
+ validUntil: null,
7470
+ externalId: "Ue5Xb3VaC7Pq"
7471
+ },
7472
+ {
7473
+ id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
7474
+ name: "Kabangalala Rural Health Centre",
7475
+ locationType: "HEALTH_FACILITY",
7476
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7477
+ validUntil: null,
7478
+ externalId: "Pz8Kc1TqH6Jn"
7479
+ },
7480
+ // Village offices
7481
+ {
7482
+ id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
7483
+ name: "Klow Village Office",
7484
+ locationType: "CRVS_OFFICE",
7485
+ administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7486
+ validUntil: null,
7487
+ externalId: "PmAyxAJkxiJ"
7488
+ }
7489
+ ];
7490
+ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
7491
+ V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
7492
+ );
7493
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
7494
+ V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
7495
+ );
7496
+
7120
7497
  // ../commons/src/notification/UserNotifications.ts
7121
7498
  var z44 = __toESM(require("zod/v4"));
7122
7499
  var TriggerEvent = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "2.0.0-rc.65195ed",
3
+ "version": "2.0.0-rc.654a81d",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  "jwt-decode": "^3.0.0",
34
34
  "lodash": "^4.17.10",
35
35
  "object-hash": "^3.0.0",
36
- "qs": "6.14.0",
36
+ "qs": "6.15.2",
37
37
  "superjson": "1.9.0-0",
38
38
  "ts-morph": "^27.0.2",
39
39
  "uuid": "^9.0.0",