@opencrvs/toolkit 2.1.0-rc.f29a266 → 2.1.0-rc.f5ea803
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.
- package/build.sh +9 -1
- package/create-countryconfig/index.js +176 -2
- package/dist/application-config/index.js +211 -201
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +1587 -69
- package/dist/commons/api/router.d.ts +4 -4
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/EventDocument.d.ts +468 -0
- package/dist/commons/events/EventMetadata.d.ts +1 -11
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +5 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +15 -15
- package/dist/commons/events/locations.d.ts +2 -2
- package/dist/commons/notification/UserNotifications.d.ts +0 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +74 -57
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/events/index.js +760 -743
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1058 -0
- package/dist/notification/index.js +855 -815
- package/dist/scopes/index.d.ts +74 -6
- package/dist/scopes/index.js +74 -57
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- package/dist/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +345 -0
- package/opencrvs-toolkit-2.1.0-rc.f5ea803.tgz +0 -0
- package/package.json +8 -3
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/opencrvs-toolkit-2.1.0-rc.f29a266.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -38,23 +38,17 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
// ../commons/src/url.ts
|
|
44
|
-
function joinUrl(base, path) {
|
|
45
|
-
const baseWithSlash = base.endsWith("/") ? base : base + "/";
|
|
46
|
-
return new URL(path, baseWithSlash);
|
|
47
|
-
}
|
|
41
|
+
var z47 = __toESM(require("zod/v4"));
|
|
48
42
|
|
|
49
43
|
// ../commons/src/events/AuditLog.ts
|
|
50
|
-
var
|
|
44
|
+
var z9 = __toESM(require("zod/v4"));
|
|
51
45
|
|
|
52
46
|
// ../commons/src/authentication.ts
|
|
53
47
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
54
|
-
var
|
|
48
|
+
var z8 = __toESM(require("zod/v4"));
|
|
55
49
|
|
|
56
50
|
// ../commons/src/scopes.ts
|
|
57
|
-
var
|
|
51
|
+
var z7 = __toESM(require("zod/v4"));
|
|
58
52
|
var qs = __toESM(require("qs"));
|
|
59
53
|
|
|
60
54
|
// ../commons/src/uuid.ts
|
|
@@ -313,12 +307,22 @@ var ActionFlagConfig = z5.object({
|
|
|
313
307
|
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
314
308
|
});
|
|
315
309
|
|
|
310
|
+
// ../commons/src/events/EventStatus.ts
|
|
311
|
+
var z6 = __toESM(require("zod/v4"));
|
|
312
|
+
var EventStatus = z6.enum([
|
|
313
|
+
"CREATED",
|
|
314
|
+
"NOTIFIED",
|
|
315
|
+
"DECLARED",
|
|
316
|
+
"REGISTERED",
|
|
317
|
+
"ARCHIVED"
|
|
318
|
+
]);
|
|
319
|
+
|
|
316
320
|
// ../commons/src/scopes.ts
|
|
317
|
-
var JurisdictionFilter =
|
|
321
|
+
var JurisdictionFilter = z7.enum(["administrativeArea", "location", "all"]).describe(
|
|
318
322
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
319
323
|
);
|
|
320
|
-
var UserFilter =
|
|
321
|
-
var RecordScopeTypeV2 =
|
|
324
|
+
var UserFilter = z7.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
325
|
+
var RecordScopeTypeV2 = z7.enum([
|
|
322
326
|
"record.search",
|
|
323
327
|
"record.create",
|
|
324
328
|
"record.read",
|
|
@@ -336,7 +340,7 @@ var RecordScopeTypeV2 = z6.enum([
|
|
|
336
340
|
"record.unassign-others",
|
|
337
341
|
"record.custom-action"
|
|
338
342
|
]);
|
|
339
|
-
var PlainScopeType =
|
|
343
|
+
var PlainScopeType = z7.enum([
|
|
340
344
|
// Misc. system scopes
|
|
341
345
|
"bypassratelimit",
|
|
342
346
|
"record.reindex",
|
|
@@ -361,15 +365,21 @@ var PlainScopeType = z6.enum([
|
|
|
361
365
|
"record.confirm-registration",
|
|
362
366
|
"record.reject-registration"
|
|
363
367
|
]);
|
|
364
|
-
var scopeByEvent =
|
|
368
|
+
var scopeByEvent = z7.preprocess(
|
|
365
369
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
366
|
-
|
|
370
|
+
z7.array(z7.string()).optional()
|
|
367
371
|
).describe("Event type, e.g. birth, death");
|
|
368
|
-
var
|
|
372
|
+
var scopeByStatus = z7.preprocess(
|
|
373
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
374
|
+
z7.array(EventStatus).optional()
|
|
375
|
+
).describe(
|
|
376
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
377
|
+
);
|
|
378
|
+
var userRole = z7.preprocess(
|
|
369
379
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
370
|
-
|
|
380
|
+
z7.array(z7.string()).optional()
|
|
371
381
|
).describe("User role, e.g. admin, field agent");
|
|
372
|
-
var scopeOptionsPlaceEvent =
|
|
382
|
+
var scopeOptionsPlaceEvent = z7.object({
|
|
373
383
|
event: scopeByEvent,
|
|
374
384
|
placeOfEvent: JurisdictionFilter.optional()
|
|
375
385
|
}).describe("Options applicable to all record scopes.");
|
|
@@ -377,7 +387,8 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
|
377
387
|
notifiedIn: JurisdictionFilter.optional(),
|
|
378
388
|
notifiedBy: UserFilter.optional(),
|
|
379
389
|
declaredIn: JurisdictionFilter.optional(),
|
|
380
|
-
declaredBy: UserFilter.optional()
|
|
390
|
+
declaredBy: UserFilter.optional(),
|
|
391
|
+
status: scopeByStatus
|
|
381
392
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
382
393
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
383
394
|
registeredIn: JurisdictionFilter.optional(),
|
|
@@ -387,31 +398,31 @@ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
|
387
398
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
388
399
|
);
|
|
389
400
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
390
|
-
customActionTypes:
|
|
401
|
+
customActionTypes: z7.preprocess(
|
|
391
402
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
392
|
-
|
|
403
|
+
z7.array(z7.string()).optional()
|
|
393
404
|
).describe("Allowed custom action types")
|
|
394
405
|
});
|
|
395
|
-
var AccessLevelOptions =
|
|
406
|
+
var AccessLevelOptions = z7.object({
|
|
396
407
|
accessLevel: JurisdictionFilter.optional()
|
|
397
408
|
});
|
|
398
409
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
399
410
|
role: userRole.optional()
|
|
400
411
|
});
|
|
401
|
-
var WorkqueueOrDashboardOptions =
|
|
402
|
-
ids:
|
|
412
|
+
var WorkqueueOrDashboardOptions = z7.object({
|
|
413
|
+
ids: z7.preprocess(
|
|
403
414
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
404
|
-
|
|
415
|
+
z7.array(z7.string())
|
|
405
416
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
406
417
|
});
|
|
407
|
-
var AllScopeOptions =
|
|
418
|
+
var AllScopeOptions = z7.object({
|
|
408
419
|
...AllRecordScopeOptions.shape,
|
|
409
420
|
...AccessLevelOptions.shape,
|
|
410
421
|
...AllUserScopeOptions.shape,
|
|
411
422
|
...WorkqueueOrDashboardOptions.shape
|
|
412
423
|
});
|
|
413
424
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
414
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
425
|
+
var ResolvedScopeOptionsPlaceEvent = z7.object({
|
|
415
426
|
event: scopeByEvent,
|
|
416
427
|
placeOfEvent: UUID.nullish()
|
|
417
428
|
}).describe(
|
|
@@ -419,15 +430,15 @@ var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
|
419
430
|
);
|
|
420
431
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
421
432
|
notifiedIn: UUID.nullish(),
|
|
422
|
-
notifiedBy:
|
|
433
|
+
notifiedBy: z7.string().optional(),
|
|
423
434
|
declaredIn: UUID.nullish(),
|
|
424
|
-
declaredBy:
|
|
435
|
+
declaredBy: z7.string().optional()
|
|
425
436
|
}).describe(
|
|
426
437
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
427
438
|
);
|
|
428
439
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
429
440
|
registeredIn: UUID.nullish(),
|
|
430
|
-
registeredBy:
|
|
441
|
+
registeredBy: z7.string().optional(),
|
|
431
442
|
flags: ContainsFlags.optional()
|
|
432
443
|
}).describe(
|
|
433
444
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
@@ -442,7 +453,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
442
453
|
"record.reject",
|
|
443
454
|
"record.archive",
|
|
444
455
|
"record.unarchive",
|
|
445
|
-
"record.review-duplicates",
|
|
446
456
|
"record.register"
|
|
447
457
|
]);
|
|
448
458
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -450,41 +460,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
450
460
|
"record.read",
|
|
451
461
|
"record.request-correction",
|
|
452
462
|
"record.correct",
|
|
453
|
-
"record.unassign-others"
|
|
463
|
+
"record.unassign-others",
|
|
464
|
+
"record.review-duplicates"
|
|
454
465
|
]);
|
|
455
466
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
456
|
-
templates:
|
|
467
|
+
templates: z7.preprocess(
|
|
457
468
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
458
|
-
|
|
469
|
+
z7.array(z7.string()).optional()
|
|
459
470
|
).describe(
|
|
460
471
|
"Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
|
|
461
472
|
)
|
|
462
473
|
});
|
|
463
|
-
var RecordScopeV2 =
|
|
464
|
-
|
|
474
|
+
var RecordScopeV2 = z7.discriminatedUnion("type", [
|
|
475
|
+
z7.object({
|
|
465
476
|
type: ScopesWithPlaceEventOptions,
|
|
466
477
|
options: scopeOptionsPlaceEvent.optional()
|
|
467
478
|
}),
|
|
468
|
-
|
|
479
|
+
z7.object({
|
|
469
480
|
type: ScopesWithDeclaredOptions,
|
|
470
481
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
471
482
|
}),
|
|
472
|
-
|
|
483
|
+
z7.object({
|
|
473
484
|
type: ScopesWithFullOptions,
|
|
474
485
|
options: AllRecordScopeOptions.optional()
|
|
475
486
|
}),
|
|
476
|
-
|
|
477
|
-
type:
|
|
487
|
+
z7.object({
|
|
488
|
+
type: z7.literal("record.custom-action"),
|
|
478
489
|
options: CustomActionScopeOptions.optional()
|
|
479
490
|
}),
|
|
480
|
-
|
|
481
|
-
type:
|
|
491
|
+
z7.object({
|
|
492
|
+
type: z7.literal("record.print-certified-copies"),
|
|
482
493
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
483
494
|
})
|
|
484
495
|
]).describe(
|
|
485
496
|
"Scopes used to check user's permission to perform actions on a record."
|
|
486
497
|
);
|
|
487
|
-
var SystemScopeType =
|
|
498
|
+
var SystemScopeType = z7.enum([
|
|
488
499
|
"organisation.read-locations",
|
|
489
500
|
"user.read",
|
|
490
501
|
"user.create",
|
|
@@ -498,61 +509,61 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
498
509
|
"user.search"
|
|
499
510
|
]);
|
|
500
511
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
501
|
-
var UserScopeV2 =
|
|
502
|
-
|
|
512
|
+
var UserScopeV2 = z7.discriminatedUnion("type", [
|
|
513
|
+
z7.object({
|
|
503
514
|
type: ScopesWithRoleOption,
|
|
504
515
|
options: AllUserScopeOptions.optional()
|
|
505
516
|
}),
|
|
506
|
-
|
|
517
|
+
z7.object({
|
|
507
518
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
508
519
|
options: AccessLevelOptions.optional()
|
|
509
520
|
})
|
|
510
521
|
]);
|
|
511
|
-
var ResolvedRecordScopeV2 =
|
|
512
|
-
|
|
522
|
+
var ResolvedRecordScopeV2 = z7.discriminatedUnion("type", [
|
|
523
|
+
z7.object({
|
|
513
524
|
type: ScopesWithPlaceEventOptions,
|
|
514
525
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
515
526
|
}),
|
|
516
|
-
|
|
527
|
+
z7.object({
|
|
517
528
|
type: ScopesWithDeclaredOptions,
|
|
518
529
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
519
530
|
}),
|
|
520
|
-
|
|
531
|
+
z7.object({
|
|
521
532
|
type: ScopesWithFullOptions,
|
|
522
533
|
options: ResolvedScopeOptionsFull.optional()
|
|
523
534
|
}),
|
|
524
|
-
|
|
525
|
-
type:
|
|
535
|
+
z7.object({
|
|
536
|
+
type: z7.literal("record.print-certified-copies"),
|
|
526
537
|
options: ResolvedScopeOptionsFull.extend({
|
|
527
|
-
templates:
|
|
538
|
+
templates: z7.array(z7.string()).optional()
|
|
528
539
|
}).optional()
|
|
529
540
|
})
|
|
530
541
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
531
|
-
var Scope =
|
|
532
|
-
|
|
542
|
+
var Scope = z7.discriminatedUnion("type", [
|
|
543
|
+
z7.object({ type: PlainScopeType }),
|
|
533
544
|
...RecordScopeV2.options,
|
|
534
545
|
...UserScopeV2.options,
|
|
535
|
-
|
|
536
|
-
type:
|
|
546
|
+
z7.object({
|
|
547
|
+
type: z7.literal("organisation.read-locations"),
|
|
537
548
|
options: AccessLevelOptions.optional()
|
|
538
549
|
}),
|
|
539
|
-
|
|
540
|
-
type:
|
|
550
|
+
z7.object({
|
|
551
|
+
type: z7.literal("workqueue"),
|
|
541
552
|
options: WorkqueueOrDashboardOptions
|
|
542
553
|
}),
|
|
543
|
-
|
|
544
|
-
type:
|
|
554
|
+
z7.object({
|
|
555
|
+
type: z7.literal("dashboard.view"),
|
|
545
556
|
options: WorkqueueOrDashboardOptions
|
|
546
557
|
})
|
|
547
558
|
]);
|
|
548
|
-
var ScopeType =
|
|
559
|
+
var ScopeType = z7.enum([
|
|
549
560
|
...SystemScopeType.options,
|
|
550
561
|
...RecordScopeTypeV2.options,
|
|
551
562
|
...PlainScopeType.options,
|
|
552
563
|
"workqueue",
|
|
553
564
|
"dashboard.view"
|
|
554
565
|
]);
|
|
555
|
-
var EncodedScope =
|
|
566
|
+
var EncodedScope = z7.string().brand("EncodedScope");
|
|
556
567
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
557
568
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
558
569
|
accessLevel: JurisdictionFilter.enum.all,
|
|
@@ -562,51 +573,51 @@ var DEFAULT_SCOPE_OPTIONS = {
|
|
|
562
573
|
};
|
|
563
574
|
|
|
564
575
|
// ../commons/src/authentication.ts
|
|
565
|
-
var TokenUserType =
|
|
566
|
-
var TokenWithBearer =
|
|
576
|
+
var TokenUserType = z8.enum(["user", "system"]);
|
|
577
|
+
var TokenWithBearer = z8.string().regex(/^Bearer\s/);
|
|
567
578
|
|
|
568
579
|
// ../commons/src/events/AuditLog.ts
|
|
569
|
-
var AuditLogEntryBase =
|
|
570
|
-
id:
|
|
571
|
-
clientId:
|
|
580
|
+
var AuditLogEntryBase = z9.object({
|
|
581
|
+
id: z9.string(),
|
|
582
|
+
clientId: z9.string(),
|
|
572
583
|
clientType: TokenUserType,
|
|
573
|
-
createdAt:
|
|
584
|
+
createdAt: z9.string()
|
|
574
585
|
});
|
|
575
586
|
var EventCreateEntrySchema = AuditLogEntryBase.extend({
|
|
576
|
-
operation:
|
|
577
|
-
requestData:
|
|
578
|
-
transactionId:
|
|
579
|
-
type:
|
|
580
|
-
createdAtLocation:
|
|
587
|
+
operation: z9.literal("event.create"),
|
|
588
|
+
requestData: z9.object({
|
|
589
|
+
transactionId: z9.string(),
|
|
590
|
+
type: z9.string(),
|
|
591
|
+
createdAtLocation: z9.string().nullable()
|
|
581
592
|
}),
|
|
582
|
-
responseSummary:
|
|
583
|
-
eventId:
|
|
584
|
-
trackingId:
|
|
593
|
+
responseSummary: z9.object({
|
|
594
|
+
eventId: z9.string(),
|
|
595
|
+
trackingId: z9.string()
|
|
585
596
|
})
|
|
586
597
|
});
|
|
587
598
|
var EventGetEntrySchema = AuditLogEntryBase.extend({
|
|
588
|
-
operation:
|
|
589
|
-
requestData:
|
|
590
|
-
responseSummary:
|
|
591
|
-
eventType:
|
|
592
|
-
trackingId:
|
|
599
|
+
operation: z9.literal("event.get"),
|
|
600
|
+
requestData: z9.object({ eventId: z9.string() }),
|
|
601
|
+
responseSummary: z9.object({
|
|
602
|
+
eventType: z9.string(),
|
|
603
|
+
trackingId: z9.string()
|
|
593
604
|
})
|
|
594
605
|
});
|
|
595
606
|
var EventSearchEntrySchema = AuditLogEntryBase.extend({
|
|
596
|
-
operation:
|
|
597
|
-
clientType:
|
|
598
|
-
requestData:
|
|
599
|
-
query:
|
|
600
|
-
limit:
|
|
601
|
-
offset:
|
|
607
|
+
operation: z9.literal("event.search"),
|
|
608
|
+
clientType: z9.literal("system"),
|
|
609
|
+
requestData: z9.object({
|
|
610
|
+
query: z9.record(z9.string(), z9.unknown()).nullable(),
|
|
611
|
+
limit: z9.number().nullable(),
|
|
612
|
+
offset: z9.number().nullable()
|
|
602
613
|
}),
|
|
603
|
-
responseSummary:
|
|
604
|
-
total:
|
|
605
|
-
eventIds:
|
|
614
|
+
responseSummary: z9.object({
|
|
615
|
+
total: z9.number(),
|
|
616
|
+
eventIds: z9.array(z9.string())
|
|
606
617
|
})
|
|
607
618
|
});
|
|
608
619
|
var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
609
|
-
operation:
|
|
620
|
+
operation: z9.enum([
|
|
610
621
|
"event.actions.notify.request",
|
|
611
622
|
"event.actions.declare.request",
|
|
612
623
|
"event.actions.register.request",
|
|
@@ -626,159 +637,159 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
|
626
637
|
"event.actions.mark_as_duplicate.request",
|
|
627
638
|
"event.actions.mark_as_not_duplicate.request"
|
|
628
639
|
]),
|
|
629
|
-
requestData:
|
|
630
|
-
eventId:
|
|
631
|
-
actionType:
|
|
632
|
-
eventType:
|
|
633
|
-
trackingId:
|
|
634
|
-
transactionId:
|
|
640
|
+
requestData: z9.object({
|
|
641
|
+
eventId: z9.string(),
|
|
642
|
+
actionType: z9.string(),
|
|
643
|
+
eventType: z9.string(),
|
|
644
|
+
trackingId: z9.string(),
|
|
645
|
+
transactionId: z9.string()
|
|
635
646
|
})
|
|
636
647
|
});
|
|
637
648
|
var EventCustomActionEntrySchema = AuditLogEntryBase.extend({
|
|
638
|
-
operation:
|
|
639
|
-
requestData:
|
|
640
|
-
eventId:
|
|
641
|
-
actionType:
|
|
642
|
-
customAction:
|
|
643
|
-
eventType:
|
|
644
|
-
trackingId:
|
|
645
|
-
transactionId:
|
|
649
|
+
operation: z9.literal("event.actions.custom.request"),
|
|
650
|
+
requestData: z9.object({
|
|
651
|
+
eventId: z9.string(),
|
|
652
|
+
actionType: z9.literal(ActionType.CUSTOM),
|
|
653
|
+
customAction: z9.string(),
|
|
654
|
+
eventType: z9.string(),
|
|
655
|
+
trackingId: z9.string(),
|
|
656
|
+
transactionId: z9.string()
|
|
646
657
|
})
|
|
647
658
|
});
|
|
648
659
|
var IntegrationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
649
|
-
operation:
|
|
650
|
-
requestData:
|
|
651
|
-
responseSummary:
|
|
660
|
+
operation: z9.literal("integrations.create"),
|
|
661
|
+
requestData: z9.object({ name: z9.string(), scopes: z9.array(z9.string()) }),
|
|
662
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
652
663
|
});
|
|
653
664
|
var IntegrationRefreshTokenEntrySchema = AuditLogEntryBase.extend({
|
|
654
|
-
operation:
|
|
655
|
-
requestData:
|
|
656
|
-
responseSummary:
|
|
665
|
+
operation: z9.literal("integrations.refreshToken"),
|
|
666
|
+
requestData: z9.object({ clientId: z9.string() }),
|
|
667
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
657
668
|
});
|
|
658
669
|
var IntegrationDeactivateEntrySchema = AuditLogEntryBase.extend({
|
|
659
|
-
operation:
|
|
660
|
-
requestData:
|
|
661
|
-
responseSummary:
|
|
670
|
+
operation: z9.literal("integrations.deactivate"),
|
|
671
|
+
requestData: z9.object({ id: z9.string() }),
|
|
672
|
+
responseSummary: z9.object({ id: z9.string(), status: z9.string() })
|
|
662
673
|
});
|
|
663
674
|
var IntegrationActivateEntrySchema = AuditLogEntryBase.extend({
|
|
664
|
-
operation:
|
|
665
|
-
requestData:
|
|
666
|
-
responseSummary:
|
|
675
|
+
operation: z9.literal("integrations.activate"),
|
|
676
|
+
requestData: z9.object({ id: z9.string() }),
|
|
677
|
+
responseSummary: z9.object({ id: z9.string(), status: z9.string() })
|
|
667
678
|
});
|
|
668
679
|
var IntegrationDeleteEntrySchema = AuditLogEntryBase.extend({
|
|
669
|
-
operation:
|
|
670
|
-
requestData:
|
|
671
|
-
responseSummary:
|
|
680
|
+
operation: z9.literal("integrations.delete"),
|
|
681
|
+
requestData: z9.object({ id: z9.string() }),
|
|
682
|
+
responseSummary: z9.object({ id: z9.string(), name: z9.string() })
|
|
672
683
|
});
|
|
673
684
|
var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
674
|
-
operation:
|
|
675
|
-
requestData:
|
|
676
|
-
responseSummary:
|
|
685
|
+
operation: z9.literal("integrations.refreshSecret"),
|
|
686
|
+
requestData: z9.object({ id: z9.string() }),
|
|
687
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
677
688
|
});
|
|
678
689
|
var createdVersionFields = {
|
|
679
|
-
id:
|
|
680
|
-
versionId:
|
|
681
|
-
name:
|
|
682
|
-
externalId:
|
|
683
|
-
effectiveFrom:
|
|
684
|
-
status:
|
|
690
|
+
id: z9.string(),
|
|
691
|
+
versionId: z9.string(),
|
|
692
|
+
name: z9.string(),
|
|
693
|
+
externalId: z9.string().nullish(),
|
|
694
|
+
effectiveFrom: z9.string(),
|
|
695
|
+
status: z9.string()
|
|
685
696
|
};
|
|
686
697
|
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
687
|
-
operation:
|
|
688
|
-
requestData:
|
|
698
|
+
operation: z9.literal("locations.create"),
|
|
699
|
+
requestData: z9.object({
|
|
689
700
|
...createdVersionFields,
|
|
690
|
-
administrativeAreaId:
|
|
691
|
-
locationType:
|
|
701
|
+
administrativeAreaId: z9.string().nullish(),
|
|
702
|
+
locationType: z9.string().nullish()
|
|
692
703
|
})
|
|
693
704
|
});
|
|
694
705
|
var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
|
|
695
|
-
operation:
|
|
696
|
-
requestData:
|
|
706
|
+
operation: z9.literal("administrativeAreas.create"),
|
|
707
|
+
requestData: z9.object({
|
|
697
708
|
...createdVersionFields,
|
|
698
|
-
parentId:
|
|
709
|
+
parentId: z9.string().nullish()
|
|
699
710
|
})
|
|
700
711
|
});
|
|
701
|
-
var ChangedStringField =
|
|
702
|
-
var ChangedNullableStringField =
|
|
703
|
-
from:
|
|
704
|
-
to:
|
|
705
|
-
});
|
|
706
|
-
var updatedVersionRequestData =
|
|
707
|
-
id:
|
|
708
|
-
versionId:
|
|
709
|
-
name:
|
|
710
|
-
externalId:
|
|
711
|
-
status:
|
|
712
|
-
effectiveFrom:
|
|
713
|
-
lastVersionId:
|
|
714
|
-
});
|
|
715
|
-
var updatedVersionResponseSummary =
|
|
716
|
-
previousVersionId:
|
|
717
|
-
versionId:
|
|
718
|
-
changed:
|
|
712
|
+
var ChangedStringField = z9.object({ from: z9.string(), to: z9.string() });
|
|
713
|
+
var ChangedNullableStringField = z9.object({
|
|
714
|
+
from: z9.string().nullable(),
|
|
715
|
+
to: z9.string().nullable()
|
|
716
|
+
});
|
|
717
|
+
var updatedVersionRequestData = z9.object({
|
|
718
|
+
id: z9.string(),
|
|
719
|
+
versionId: z9.string(),
|
|
720
|
+
name: z9.string(),
|
|
721
|
+
externalId: z9.string().nullish(),
|
|
722
|
+
status: z9.string(),
|
|
723
|
+
effectiveFrom: z9.string(),
|
|
724
|
+
lastVersionId: z9.string()
|
|
725
|
+
});
|
|
726
|
+
var updatedVersionResponseSummary = z9.object({
|
|
727
|
+
previousVersionId: z9.string(),
|
|
728
|
+
versionId: z9.string(),
|
|
729
|
+
changed: z9.object({
|
|
719
730
|
name: ChangedStringField.optional(),
|
|
720
731
|
externalId: ChangedNullableStringField.optional(),
|
|
721
732
|
status: ChangedStringField.optional()
|
|
722
733
|
})
|
|
723
734
|
});
|
|
724
735
|
var LocationUpdateEntrySchema = AuditLogEntryBase.extend({
|
|
725
|
-
operation:
|
|
736
|
+
operation: z9.literal("locations.update"),
|
|
726
737
|
requestData: updatedVersionRequestData,
|
|
727
738
|
responseSummary: updatedVersionResponseSummary
|
|
728
739
|
});
|
|
729
740
|
var AdministrativeAreaUpdateEntrySchema = AuditLogEntryBase.extend({
|
|
730
|
-
operation:
|
|
741
|
+
operation: z9.literal("administrativeAreas.update"),
|
|
731
742
|
requestData: updatedVersionRequestData,
|
|
732
743
|
responseSummary: updatedVersionResponseSummary
|
|
733
744
|
});
|
|
734
|
-
var withdrawVersionRequestData =
|
|
735
|
-
id:
|
|
736
|
-
versionId:
|
|
745
|
+
var withdrawVersionRequestData = z9.object({
|
|
746
|
+
id: z9.string(),
|
|
747
|
+
versionId: z9.string()
|
|
737
748
|
});
|
|
738
|
-
var withdrawVersionResponseSummary =
|
|
739
|
-
effectiveFrom:
|
|
740
|
-
name:
|
|
741
|
-
externalId:
|
|
742
|
-
status:
|
|
749
|
+
var withdrawVersionResponseSummary = z9.object({
|
|
750
|
+
effectiveFrom: z9.string(),
|
|
751
|
+
name: z9.string(),
|
|
752
|
+
externalId: z9.string().nullish(),
|
|
753
|
+
status: z9.string()
|
|
743
754
|
});
|
|
744
755
|
var LocationWithdrawEntrySchema = AuditLogEntryBase.extend({
|
|
745
|
-
operation:
|
|
756
|
+
operation: z9.literal("locations.withdrawVersion"),
|
|
746
757
|
requestData: withdrawVersionRequestData,
|
|
747
758
|
responseSummary: withdrawVersionResponseSummary
|
|
748
759
|
});
|
|
749
760
|
var AdministrativeAreaWithdrawEntrySchema = AuditLogEntryBase.extend({
|
|
750
|
-
operation:
|
|
761
|
+
operation: z9.literal("administrativeAreas.withdrawVersion"),
|
|
751
762
|
requestData: withdrawVersionRequestData,
|
|
752
763
|
responseSummary: withdrawVersionResponseSummary
|
|
753
764
|
});
|
|
754
765
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
755
|
-
operation:
|
|
756
|
-
requestData:
|
|
757
|
-
transactionId:
|
|
758
|
-
path:
|
|
766
|
+
operation: z9.literal("attachments.upload"),
|
|
767
|
+
requestData: z9.object({
|
|
768
|
+
transactionId: z9.string(),
|
|
769
|
+
path: z9.string().nullable()
|
|
759
770
|
}),
|
|
760
|
-
responseSummary:
|
|
771
|
+
responseSummary: z9.object({ fileUrl: z9.string() })
|
|
761
772
|
});
|
|
762
|
-
var subjectOnly =
|
|
763
|
-
var subjectWithReason =
|
|
764
|
-
subjectId:
|
|
765
|
-
reason:
|
|
766
|
-
comment:
|
|
773
|
+
var subjectOnly = z9.object({ subjectId: z9.string() });
|
|
774
|
+
var subjectWithReason = z9.object({
|
|
775
|
+
subjectId: z9.string(),
|
|
776
|
+
reason: z9.string(),
|
|
777
|
+
comment: z9.string().optional()
|
|
767
778
|
});
|
|
768
779
|
var UserCreateEntrySchema = AuditLogEntryBase.extend({
|
|
769
|
-
operation:
|
|
770
|
-
requestData:
|
|
771
|
-
subjectId:
|
|
772
|
-
role:
|
|
773
|
-
primaryOfficeId:
|
|
780
|
+
operation: z9.literal("user.create_user"),
|
|
781
|
+
requestData: z9.object({
|
|
782
|
+
subjectId: z9.string(),
|
|
783
|
+
role: z9.string(),
|
|
784
|
+
primaryOfficeId: z9.string()
|
|
774
785
|
})
|
|
775
786
|
});
|
|
776
787
|
var UserReasonEntrySchema = AuditLogEntryBase.extend({
|
|
777
|
-
operation:
|
|
788
|
+
operation: z9.enum(["user.deactivate", "user.reactivate"]),
|
|
778
789
|
requestData: subjectWithReason
|
|
779
790
|
});
|
|
780
791
|
var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
781
|
-
operation:
|
|
792
|
+
operation: z9.enum([
|
|
782
793
|
"user.edit_user",
|
|
783
794
|
"user.logged_in",
|
|
784
795
|
"user.logged_out",
|
|
@@ -792,14 +803,14 @@ var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
|
792
803
|
requestData: subjectOnly
|
|
793
804
|
});
|
|
794
805
|
var UserEmailChangedEntrySchema = AuditLogEntryBase.extend({
|
|
795
|
-
operation:
|
|
806
|
+
operation: z9.literal("user.email_address_changed"),
|
|
796
807
|
requestData: subjectOnly,
|
|
797
|
-
responseSummary:
|
|
808
|
+
responseSummary: z9.object({ email: z9.string() })
|
|
798
809
|
});
|
|
799
810
|
var UserPhoneChangedEntrySchema = AuditLogEntryBase.extend({
|
|
800
|
-
operation:
|
|
811
|
+
operation: z9.literal("user.phone_number_changed"),
|
|
801
812
|
requestData: subjectOnly,
|
|
802
|
-
responseSummary:
|
|
813
|
+
responseSummary: z9.object({ phoneNumber: z9.string() })
|
|
803
814
|
});
|
|
804
815
|
var userBaseOmit = {
|
|
805
816
|
id: true,
|
|
@@ -807,14 +818,14 @@ var userBaseOmit = {
|
|
|
807
818
|
clientType: true,
|
|
808
819
|
createdAt: true
|
|
809
820
|
};
|
|
810
|
-
var UserAuditRecordInput =
|
|
821
|
+
var UserAuditRecordInput = z9.discriminatedUnion("operation", [
|
|
811
822
|
UserCreateEntrySchema.omit(userBaseOmit),
|
|
812
823
|
UserReasonEntrySchema.omit(userBaseOmit),
|
|
813
824
|
UserSubjectOnlyEntrySchema.omit(userBaseOmit),
|
|
814
825
|
UserEmailChangedEntrySchema.omit(userBaseOmit),
|
|
815
826
|
UserPhoneChangedEntrySchema.omit(userBaseOmit)
|
|
816
827
|
]);
|
|
817
|
-
var AuditLogEntrySchema =
|
|
828
|
+
var AuditLogEntrySchema = z9.discriminatedUnion("operation", [
|
|
818
829
|
EventCreateEntrySchema,
|
|
819
830
|
EventGetEntrySchema,
|
|
820
831
|
EventSearchEntrySchema,
|
|
@@ -845,13 +856,13 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
845
856
|
var CHILD_ONBOARDING_EVENT = "child-onboarding";
|
|
846
857
|
|
|
847
858
|
// ../commons/src/events/ActionConfig.ts
|
|
848
|
-
var
|
|
859
|
+
var z25 = __toESM(require("zod/v4"));
|
|
849
860
|
|
|
850
861
|
// ../commons/src/events/FieldConfig.ts
|
|
851
862
|
var import_v43 = __toESM(require("zod/v4"));
|
|
852
863
|
|
|
853
864
|
// ../commons/src/events/FieldType.ts
|
|
854
|
-
var
|
|
865
|
+
var z10 = __toESM(require("zod/v4"));
|
|
855
866
|
var FieldType = {
|
|
856
867
|
NAME: "NAME",
|
|
857
868
|
PHONE: "PHONE",
|
|
@@ -915,7 +926,7 @@ var FieldType = {
|
|
|
915
926
|
*/
|
|
916
927
|
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
917
928
|
};
|
|
918
|
-
var FileFieldType =
|
|
929
|
+
var FileFieldType = z10.enum([
|
|
919
930
|
FieldType.FILE,
|
|
920
931
|
FieldType.FILE_WITH_OPTIONS,
|
|
921
932
|
FieldType.SIGNATURE
|
|
@@ -951,160 +962,160 @@ var HiddenFieldTypes = [
|
|
|
951
962
|
];
|
|
952
963
|
|
|
953
964
|
// ../commons/src/events/FieldValue.ts
|
|
954
|
-
var
|
|
965
|
+
var z14 = __toESM(require("zod/v4"));
|
|
955
966
|
|
|
956
967
|
// ../commons/src/documents.ts
|
|
957
|
-
var
|
|
958
|
-
var FullDocumentUrl =
|
|
968
|
+
var z11 = __toESM(require("zod/v4"));
|
|
969
|
+
var FullDocumentUrl = z11.string().brand("FullDocumentUrl").describe(
|
|
959
970
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
|
|
960
971
|
);
|
|
961
|
-
var FullDocumentPath =
|
|
972
|
+
var FullDocumentPath = z11.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
962
973
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
963
974
|
);
|
|
964
|
-
var DocumentPath =
|
|
975
|
+
var DocumentPath = z11.string().brand("DocumentPath").describe(
|
|
965
976
|
"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
|
|
966
977
|
);
|
|
967
978
|
|
|
968
979
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
969
|
-
var
|
|
980
|
+
var z12 = __toESM(require("zod/v4"));
|
|
970
981
|
var AddressType = {
|
|
971
982
|
DOMESTIC: "DOMESTIC",
|
|
972
983
|
INTERNATIONAL: "INTERNATIONAL"
|
|
973
984
|
};
|
|
974
|
-
var FileFieldValue =
|
|
985
|
+
var FileFieldValue = z12.object({
|
|
975
986
|
path: DocumentPath,
|
|
976
|
-
originalFilename:
|
|
977
|
-
type:
|
|
978
|
-
});
|
|
979
|
-
var NameFieldValue =
|
|
980
|
-
firstname:
|
|
981
|
-
surname:
|
|
982
|
-
middlename:
|
|
983
|
-
});
|
|
984
|
-
var NameFieldUpdateValue =
|
|
985
|
-
firstname:
|
|
986
|
-
surname:
|
|
987
|
-
middlename:
|
|
988
|
-
}).or(
|
|
989
|
-
var StreetLevelDetailsValue =
|
|
990
|
-
var StreetLevelDetailsUpdateValue =
|
|
991
|
-
var BaseAddressFieldValue =
|
|
992
|
-
country:
|
|
987
|
+
originalFilename: z12.string(),
|
|
988
|
+
type: z12.string()
|
|
989
|
+
});
|
|
990
|
+
var NameFieldValue = z12.object({
|
|
991
|
+
firstname: z12.string(),
|
|
992
|
+
surname: z12.string(),
|
|
993
|
+
middlename: z12.string().optional()
|
|
994
|
+
});
|
|
995
|
+
var NameFieldUpdateValue = z12.object({
|
|
996
|
+
firstname: z12.string().nullish(),
|
|
997
|
+
surname: z12.string().nullish(),
|
|
998
|
+
middlename: z12.string().nullish()
|
|
999
|
+
}).or(z12.null()).or(z12.undefined());
|
|
1000
|
+
var StreetLevelDetailsValue = z12.record(z12.string(), z12.string()).optional();
|
|
1001
|
+
var StreetLevelDetailsUpdateValue = z12.record(z12.string(), z12.string().nullable()).nullish();
|
|
1002
|
+
var BaseAddressFieldValue = z12.object({
|
|
1003
|
+
country: z12.string(),
|
|
993
1004
|
streetLevelDetails: StreetLevelDetailsValue
|
|
994
1005
|
});
|
|
995
|
-
var BaseAddressFieldUpdateValue =
|
|
996
|
-
country:
|
|
1006
|
+
var BaseAddressFieldUpdateValue = z12.object({
|
|
1007
|
+
country: z12.string().nullish(),
|
|
997
1008
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
998
1009
|
});
|
|
999
1010
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
1000
|
-
addressType:
|
|
1001
|
-
administrativeArea:
|
|
1011
|
+
addressType: z12.literal(AddressType.DOMESTIC),
|
|
1012
|
+
administrativeArea: z12.string().uuid()
|
|
1002
1013
|
});
|
|
1003
1014
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
1004
|
-
addressType:
|
|
1015
|
+
addressType: z12.literal(AddressType.INTERNATIONAL)
|
|
1005
1016
|
});
|
|
1006
|
-
var AddressFieldValue =
|
|
1017
|
+
var AddressFieldValue = z12.discriminatedUnion("addressType", [
|
|
1007
1018
|
DomesticAddressFieldValue,
|
|
1008
1019
|
InternationalAddressFieldValue
|
|
1009
1020
|
]);
|
|
1010
1021
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
1011
|
-
addressType:
|
|
1012
|
-
administrativeArea:
|
|
1022
|
+
addressType: z12.literal(AddressType.DOMESTIC),
|
|
1023
|
+
administrativeArea: z12.string().uuid().nullish()
|
|
1013
1024
|
/* Leaf level admin structure */
|
|
1014
1025
|
});
|
|
1015
1026
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
1016
1027
|
{
|
|
1017
|
-
addressType:
|
|
1028
|
+
addressType: z12.literal(AddressType.INTERNATIONAL)
|
|
1018
1029
|
}
|
|
1019
1030
|
);
|
|
1020
|
-
var AddressFieldUpdateValue =
|
|
1031
|
+
var AddressFieldUpdateValue = z12.discriminatedUnion("addressType", [
|
|
1021
1032
|
DomesticAddressUpdateFieldValue,
|
|
1022
1033
|
InternationalAddressUpdateFieldValue
|
|
1023
1034
|
]).nullish();
|
|
1024
|
-
var FileFieldValueWithOption =
|
|
1035
|
+
var FileFieldValueWithOption = z12.object({
|
|
1025
1036
|
path: DocumentPath,
|
|
1026
|
-
originalFilename:
|
|
1027
|
-
type:
|
|
1028
|
-
option:
|
|
1029
|
-
});
|
|
1030
|
-
var FileFieldWithOptionValue =
|
|
1031
|
-
var HttpFieldValue =
|
|
1032
|
-
loading:
|
|
1033
|
-
error:
|
|
1034
|
-
data:
|
|
1035
|
-
});
|
|
1036
|
-
var HttpFieldUpdateValue =
|
|
1037
|
-
loading:
|
|
1038
|
-
error:
|
|
1039
|
-
data:
|
|
1040
|
-
}).or(
|
|
1041
|
-
var QueryParamReaderFieldValue =
|
|
1042
|
-
data:
|
|
1043
|
-
updatedAt:
|
|
1037
|
+
originalFilename: z12.string(),
|
|
1038
|
+
type: z12.string(),
|
|
1039
|
+
option: z12.string()
|
|
1040
|
+
});
|
|
1041
|
+
var FileFieldWithOptionValue = z12.array(FileFieldValueWithOption);
|
|
1042
|
+
var HttpFieldValue = z12.object({
|
|
1043
|
+
loading: z12.boolean(),
|
|
1044
|
+
error: z12.object({ statusCode: z12.number(), message: z12.string() }).nullish(),
|
|
1045
|
+
data: z12.any()
|
|
1046
|
+
});
|
|
1047
|
+
var HttpFieldUpdateValue = z12.object({
|
|
1048
|
+
loading: z12.boolean().nullish(),
|
|
1049
|
+
error: z12.object({ statusCode: z12.number(), message: z12.string() }).nullish(),
|
|
1050
|
+
data: z12.any().nullish()
|
|
1051
|
+
}).or(z12.null()).or(z12.undefined());
|
|
1052
|
+
var QueryParamReaderFieldValue = z12.object({
|
|
1053
|
+
data: z12.record(z12.string(), z12.string()),
|
|
1054
|
+
updatedAt: z12.iso.datetime()
|
|
1044
1055
|
}).nullish();
|
|
1045
|
-
var QueryParamReaderFieldUpdateValue =
|
|
1046
|
-
data:
|
|
1056
|
+
var QueryParamReaderFieldUpdateValue = z12.object({
|
|
1057
|
+
data: z12.record(z12.string(), z12.string())
|
|
1047
1058
|
});
|
|
1048
|
-
var ReadDataValue =
|
|
1049
|
-
data:
|
|
1059
|
+
var ReadDataValue = z12.object({
|
|
1060
|
+
data: z12.any()
|
|
1050
1061
|
});
|
|
1051
1062
|
var QrReaderFieldValue = ReadDataValue;
|
|
1052
1063
|
var IdReaderFieldValue = ReadDataValue;
|
|
1053
|
-
var NumberWithUnitFieldValue =
|
|
1054
|
-
numericValue:
|
|
1055
|
-
unit:
|
|
1064
|
+
var NumberWithUnitFieldValue = z12.object({
|
|
1065
|
+
numericValue: z12.number(),
|
|
1066
|
+
unit: z12.string()
|
|
1056
1067
|
});
|
|
1057
|
-
var NumberWithUnitFieldUpdateValue =
|
|
1058
|
-
numericValue:
|
|
1059
|
-
unit:
|
|
1068
|
+
var NumberWithUnitFieldUpdateValue = z12.object({
|
|
1069
|
+
numericValue: z12.number().optional(),
|
|
1070
|
+
unit: z12.string().optional()
|
|
1060
1071
|
});
|
|
1061
|
-
var CustomFieldValue =
|
|
1072
|
+
var CustomFieldValue = z12.unknown().brand("CustomFieldValue");
|
|
1062
1073
|
|
|
1063
1074
|
// ../commons/src/events/PlainDate.ts
|
|
1064
1075
|
var import_zod = require("zod");
|
|
1065
1076
|
var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
|
|
1066
1077
|
|
|
1067
1078
|
// ../commons/src/events/FieldValue.ts
|
|
1068
|
-
var TextValue =
|
|
1069
|
-
var HiddenFieldValue =
|
|
1070
|
-
var NonEmptyTextValue =
|
|
1071
|
-
var DateValue =
|
|
1072
|
-
var AgeValue =
|
|
1073
|
-
age:
|
|
1074
|
-
asOfDateRef:
|
|
1079
|
+
var TextValue = z14.string();
|
|
1080
|
+
var HiddenFieldValue = z14.string();
|
|
1081
|
+
var NonEmptyTextValue = z14.string().trim().min(1);
|
|
1082
|
+
var DateValue = z14.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
1083
|
+
var AgeValue = z14.object({
|
|
1084
|
+
age: z14.number(),
|
|
1085
|
+
asOfDateRef: z14.string()
|
|
1075
1086
|
});
|
|
1076
1087
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
1077
|
-
var AutocompleteValue =
|
|
1078
|
-
label:
|
|
1079
|
-
value:
|
|
1088
|
+
var AutocompleteValue = z14.object({
|
|
1089
|
+
label: z14.string(),
|
|
1090
|
+
value: z14.string()
|
|
1080
1091
|
});
|
|
1081
1092
|
var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
|
|
1082
|
-
var TimeValue =
|
|
1083
|
-
var DatetimeValue =
|
|
1084
|
-
var SelectDateRangeValue =
|
|
1093
|
+
var TimeValue = z14.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
1094
|
+
var DatetimeValue = z14.iso.datetime();
|
|
1095
|
+
var SelectDateRangeValue = z14.enum([
|
|
1085
1096
|
"last7Days",
|
|
1086
1097
|
"last30Days",
|
|
1087
1098
|
"last90Days",
|
|
1088
1099
|
"last365Days"
|
|
1089
1100
|
]);
|
|
1090
|
-
var DateRangeFieldValue =
|
|
1101
|
+
var DateRangeFieldValue = z14.object({
|
|
1091
1102
|
start: PlainDate,
|
|
1092
1103
|
end: PlainDate
|
|
1093
1104
|
}).or(PlainDate).describe(
|
|
1094
1105
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
1095
1106
|
);
|
|
1096
|
-
var EmailValue =
|
|
1097
|
-
var CheckboxFieldValue =
|
|
1098
|
-
var NumberFieldValue =
|
|
1107
|
+
var EmailValue = z14.email();
|
|
1108
|
+
var CheckboxFieldValue = z14.boolean();
|
|
1109
|
+
var NumberFieldValue = z14.number();
|
|
1099
1110
|
var SignatureFieldValue = FileFieldValue;
|
|
1100
|
-
var ButtonFieldValue =
|
|
1101
|
-
var VerificationStatusValue =
|
|
1111
|
+
var ButtonFieldValue = z14.number();
|
|
1112
|
+
var VerificationStatusValue = z14.enum([
|
|
1102
1113
|
"verified",
|
|
1103
1114
|
"authenticated",
|
|
1104
1115
|
"failed",
|
|
1105
1116
|
"pending"
|
|
1106
1117
|
]);
|
|
1107
|
-
var LeafFieldValues =
|
|
1118
|
+
var LeafFieldValues = z14.union([
|
|
1108
1119
|
AddressFieldValue,
|
|
1109
1120
|
TextValue,
|
|
1110
1121
|
PlainDate,
|
|
@@ -1130,11 +1141,11 @@ var LeafFieldValues = z13.union([
|
|
|
1130
1141
|
AutocompleteValue,
|
|
1131
1142
|
AutocompleteUpdateValue
|
|
1132
1143
|
]);
|
|
1133
|
-
var FieldGroupValue =
|
|
1134
|
-
var DataFieldValue =
|
|
1135
|
-
data:
|
|
1144
|
+
var FieldGroupValue = z14.record(z14.string(), LeafFieldValues);
|
|
1145
|
+
var DataFieldValue = z14.object({
|
|
1146
|
+
data: z14.record(z14.string(), LeafFieldValues)
|
|
1136
1147
|
}).nullish();
|
|
1137
|
-
var FieldValue =
|
|
1148
|
+
var FieldValue = z14.union([
|
|
1138
1149
|
LeafFieldValues,
|
|
1139
1150
|
DataFieldValue,
|
|
1140
1151
|
FieldGroupValue
|
|
@@ -1168,7 +1179,7 @@ function safeUnion(schemas) {
|
|
|
1168
1179
|
const sortedSchemas = [...schemas].sort(
|
|
1169
1180
|
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
1170
1181
|
);
|
|
1171
|
-
return
|
|
1182
|
+
return z14.any().superRefine((val, ctx) => {
|
|
1172
1183
|
for (const schema of sortedSchemas) {
|
|
1173
1184
|
if (schema.safeParse(val).success) {
|
|
1174
1185
|
return;
|
|
@@ -1207,9 +1218,9 @@ var FieldUpdateValue = safeUnion([
|
|
|
1207
1218
|
]);
|
|
1208
1219
|
|
|
1209
1220
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
1210
|
-
var
|
|
1211
|
-
var SerializedUserField =
|
|
1212
|
-
$userField:
|
|
1221
|
+
var z15 = __toESM(require("zod/v4"));
|
|
1222
|
+
var SerializedUserField = z15.object({
|
|
1223
|
+
$userField: z15.enum([
|
|
1213
1224
|
"id",
|
|
1214
1225
|
"name",
|
|
1215
1226
|
"role",
|
|
@@ -1223,7 +1234,7 @@ var SerializedUserField = z14.object({
|
|
|
1223
1234
|
"primaryOfficeId",
|
|
1224
1235
|
"administrativeAreaId"
|
|
1225
1236
|
]),
|
|
1226
|
-
$location:
|
|
1237
|
+
$location: z15.string().optional()
|
|
1227
1238
|
});
|
|
1228
1239
|
function userSerializer(userField) {
|
|
1229
1240
|
return {
|
|
@@ -1246,25 +1257,25 @@ function userSerializer(userField) {
|
|
|
1246
1257
|
var import_v4 = require("zod/v4");
|
|
1247
1258
|
|
|
1248
1259
|
// ../commons/src/events/EventMetadata.ts
|
|
1249
|
-
var
|
|
1260
|
+
var z17 = __toESM(require("zod/v4"));
|
|
1250
1261
|
|
|
1251
1262
|
// ../commons/src/events/ActionDocument.ts
|
|
1252
|
-
var
|
|
1253
|
-
var ActionUpdate =
|
|
1263
|
+
var z16 = __toESM(require("zod/v4"));
|
|
1264
|
+
var ActionUpdate = z16.record(z16.string(), FieldUpdateValue).describe(
|
|
1254
1265
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1255
1266
|
);
|
|
1256
|
-
var EventState =
|
|
1267
|
+
var EventState = z16.record(z16.string(), FieldValue).describe(
|
|
1257
1268
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1258
1269
|
);
|
|
1259
|
-
var ActionBase =
|
|
1270
|
+
var ActionBase = z16.object({
|
|
1260
1271
|
id: UUID.describe("Unique identifier of the action."),
|
|
1261
|
-
transactionId:
|
|
1272
|
+
transactionId: z16.string().describe("Unique identifier of the transaction."),
|
|
1262
1273
|
createdByUserType: TokenUserType.describe(
|
|
1263
1274
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1264
1275
|
),
|
|
1265
|
-
createdAt:
|
|
1266
|
-
createdBy:
|
|
1267
|
-
createdByRole:
|
|
1276
|
+
createdAt: z16.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1277
|
+
createdBy: z16.string().describe("Identifier of the user who created the action."),
|
|
1278
|
+
createdByRole: z16.string().optional().describe("Role of the user who created the action."),
|
|
1268
1279
|
createdBySignature: DocumentPath.nullish().describe(
|
|
1269
1280
|
"Reference to the signature of the user who created the action."
|
|
1270
1281
|
),
|
|
@@ -1276,7 +1287,7 @@ var ActionBase = z15.object({
|
|
|
1276
1287
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1277
1288
|
),
|
|
1278
1289
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1279
|
-
status:
|
|
1290
|
+
status: z16.enum([
|
|
1280
1291
|
ActionStatus.Requested,
|
|
1281
1292
|
ActionStatus.Accepted,
|
|
1282
1293
|
ActionStatus.Rejected
|
|
@@ -1288,70 +1299,70 @@ var ActionBase = z15.object({
|
|
|
1288
1299
|
)
|
|
1289
1300
|
});
|
|
1290
1301
|
var AssignedAction = ActionBase.extend(
|
|
1291
|
-
|
|
1292
|
-
type:
|
|
1293
|
-
assignedTo:
|
|
1302
|
+
z16.object({
|
|
1303
|
+
type: z16.literal(ActionType.ASSIGN),
|
|
1304
|
+
assignedTo: z16.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1294
1305
|
// TODO move into 'content' property
|
|
1295
1306
|
}).shape
|
|
1296
1307
|
);
|
|
1297
1308
|
var UnassignedAction = ActionBase.extend(
|
|
1298
|
-
|
|
1299
|
-
type:
|
|
1309
|
+
z16.object({
|
|
1310
|
+
type: z16.literal(ActionType.UNASSIGN)
|
|
1300
1311
|
}).shape
|
|
1301
1312
|
);
|
|
1302
1313
|
var RegisterAction = ActionBase.extend(
|
|
1303
|
-
|
|
1304
|
-
type:
|
|
1305
|
-
registrationNumber:
|
|
1314
|
+
z16.object({
|
|
1315
|
+
type: z16.literal(ActionType.REGISTER),
|
|
1316
|
+
registrationNumber: z16.string().optional().describe(
|
|
1306
1317
|
"Registration number of the event. Always present for accepted registrations."
|
|
1307
1318
|
)
|
|
1308
1319
|
// TODO move into 'content' property
|
|
1309
1320
|
}).shape
|
|
1310
1321
|
);
|
|
1311
1322
|
var DeclareAction = ActionBase.extend(
|
|
1312
|
-
|
|
1313
|
-
type:
|
|
1323
|
+
z16.object({
|
|
1324
|
+
type: z16.literal(ActionType.DECLARE)
|
|
1314
1325
|
}).shape
|
|
1315
1326
|
);
|
|
1316
|
-
var ReasonContent =
|
|
1317
|
-
reason:
|
|
1327
|
+
var ReasonContent = z16.object({
|
|
1328
|
+
reason: z16.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1318
1329
|
"Message describing the reason for rejecting or archiving the event."
|
|
1319
1330
|
)
|
|
1320
1331
|
});
|
|
1321
1332
|
var RejectAction = ActionBase.extend(
|
|
1322
|
-
|
|
1323
|
-
type:
|
|
1333
|
+
z16.object({
|
|
1334
|
+
type: z16.literal(ActionType.REJECT),
|
|
1324
1335
|
content: ReasonContent
|
|
1325
1336
|
}).shape
|
|
1326
1337
|
);
|
|
1327
|
-
var PotentialDuplicate =
|
|
1338
|
+
var PotentialDuplicate = z16.object({
|
|
1328
1339
|
id: UUID,
|
|
1329
|
-
trackingId:
|
|
1340
|
+
trackingId: z16.string()
|
|
1330
1341
|
});
|
|
1331
1342
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
1332
|
-
|
|
1333
|
-
type:
|
|
1334
|
-
content:
|
|
1335
|
-
duplicates:
|
|
1343
|
+
z16.object({
|
|
1344
|
+
type: z16.literal(ActionType.DUPLICATE_DETECTED),
|
|
1345
|
+
content: z16.object({
|
|
1346
|
+
duplicates: z16.array(PotentialDuplicate)
|
|
1336
1347
|
})
|
|
1337
1348
|
}).shape
|
|
1338
1349
|
);
|
|
1339
1350
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1340
|
-
|
|
1341
|
-
type:
|
|
1351
|
+
z16.object({
|
|
1352
|
+
type: z16.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1342
1353
|
}).shape
|
|
1343
1354
|
);
|
|
1344
1355
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1345
|
-
|
|
1346
|
-
type:
|
|
1347
|
-
content:
|
|
1356
|
+
z16.object({
|
|
1357
|
+
type: z16.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1358
|
+
content: z16.object({
|
|
1348
1359
|
duplicateOf: UUID
|
|
1349
1360
|
}).optional()
|
|
1350
1361
|
}).shape
|
|
1351
1362
|
);
|
|
1352
1363
|
var ArchiveAction = ActionBase.extend(
|
|
1353
|
-
|
|
1354
|
-
type:
|
|
1364
|
+
z16.object({
|
|
1365
|
+
type: z16.literal(ActionType.ARCHIVE),
|
|
1355
1366
|
/**
|
|
1356
1367
|
* Archiving does not collect a reason on its own. Only the
|
|
1357
1368
|
* "mark as duplicate" flow archives with a reason attached.
|
|
@@ -1360,71 +1371,71 @@ var ArchiveAction = ActionBase.extend(
|
|
|
1360
1371
|
}).shape
|
|
1361
1372
|
);
|
|
1362
1373
|
var UnarchiveAction = ActionBase.extend(
|
|
1363
|
-
|
|
1364
|
-
type:
|
|
1374
|
+
z16.object({
|
|
1375
|
+
type: z16.literal(ActionType.UNARCHIVE)
|
|
1365
1376
|
}).shape
|
|
1366
1377
|
);
|
|
1367
1378
|
var CreatedAction = ActionBase.extend(
|
|
1368
|
-
|
|
1369
|
-
type:
|
|
1379
|
+
z16.object({
|
|
1380
|
+
type: z16.literal(ActionType.CREATE)
|
|
1370
1381
|
}).shape
|
|
1371
1382
|
);
|
|
1372
1383
|
var NotifiedAction = ActionBase.extend(
|
|
1373
|
-
|
|
1374
|
-
type:
|
|
1384
|
+
z16.object({
|
|
1385
|
+
type: z16.literal(ActionType.NOTIFY)
|
|
1375
1386
|
}).shape
|
|
1376
1387
|
);
|
|
1377
1388
|
var EditAction = ActionBase.extend(
|
|
1378
|
-
|
|
1379
|
-
type:
|
|
1389
|
+
z16.object({
|
|
1390
|
+
type: z16.literal(ActionType.EDIT),
|
|
1380
1391
|
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
1381
|
-
content:
|
|
1382
|
-
comment:
|
|
1392
|
+
content: z16.object({
|
|
1393
|
+
comment: z16.string().describe("Comment for the edit action.").optional()
|
|
1383
1394
|
}).optional()
|
|
1384
1395
|
}).shape
|
|
1385
1396
|
);
|
|
1386
|
-
var PrintContent =
|
|
1387
|
-
templateId:
|
|
1397
|
+
var PrintContent = z16.object({
|
|
1398
|
+
templateId: z16.string().optional()
|
|
1388
1399
|
});
|
|
1389
1400
|
var PrintCertificateAction = ActionBase.extend(
|
|
1390
|
-
|
|
1391
|
-
type:
|
|
1401
|
+
z16.object({
|
|
1402
|
+
type: z16.literal(ActionType.PRINT_CERTIFICATE),
|
|
1392
1403
|
content: PrintContent.optional().nullable()
|
|
1393
1404
|
}).shape
|
|
1394
1405
|
);
|
|
1395
1406
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1396
|
-
|
|
1397
|
-
type:
|
|
1407
|
+
z16.object({
|
|
1408
|
+
type: z16.literal(ActionType.REQUEST_CORRECTION)
|
|
1398
1409
|
}).shape
|
|
1399
1410
|
);
|
|
1400
1411
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1401
|
-
|
|
1402
|
-
type:
|
|
1403
|
-
requestId:
|
|
1412
|
+
z16.object({
|
|
1413
|
+
type: z16.literal(ActionType.APPROVE_CORRECTION),
|
|
1414
|
+
requestId: z16.string(),
|
|
1404
1415
|
// TODO move into 'content' property
|
|
1405
|
-
content:
|
|
1416
|
+
content: z16.object({ immediateCorrection: z16.boolean().optional() }).optional()
|
|
1406
1417
|
}).shape
|
|
1407
1418
|
);
|
|
1408
1419
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1409
|
-
|
|
1410
|
-
type:
|
|
1411
|
-
requestId:
|
|
1420
|
+
z16.object({
|
|
1421
|
+
type: z16.literal(ActionType.REJECT_CORRECTION),
|
|
1422
|
+
requestId: z16.string(),
|
|
1412
1423
|
// TODO move into 'content' property
|
|
1413
1424
|
content: ReasonContent
|
|
1414
1425
|
}).shape
|
|
1415
1426
|
);
|
|
1416
1427
|
var ReadAction = ActionBase.extend(
|
|
1417
|
-
|
|
1418
|
-
type:
|
|
1428
|
+
z16.object({
|
|
1429
|
+
type: z16.literal(ActionType.READ)
|
|
1419
1430
|
}).shape
|
|
1420
1431
|
);
|
|
1421
1432
|
var CustomAction = ActionBase.merge(
|
|
1422
|
-
|
|
1423
|
-
type:
|
|
1424
|
-
customActionType:
|
|
1433
|
+
z16.object({
|
|
1434
|
+
type: z16.literal(ActionType.CUSTOM),
|
|
1435
|
+
customActionType: z16.string()
|
|
1425
1436
|
})
|
|
1426
1437
|
);
|
|
1427
|
-
var ActionDocument =
|
|
1438
|
+
var ActionDocument = z16.discriminatedUnion("type", [
|
|
1428
1439
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1429
1440
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1430
1441
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1451,57 +1462,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1451
1462
|
declaration: true,
|
|
1452
1463
|
annotation: true
|
|
1453
1464
|
}).extend(
|
|
1454
|
-
|
|
1455
|
-
type:
|
|
1456
|
-
status:
|
|
1465
|
+
z16.object({
|
|
1466
|
+
type: z16.enum(ConfirmableActions),
|
|
1467
|
+
status: z16.literal(ActionStatus.Rejected)
|
|
1457
1468
|
}).shape
|
|
1458
1469
|
);
|
|
1459
|
-
var Action =
|
|
1470
|
+
var Action = z16.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1460
1471
|
|
|
1461
1472
|
// ../commons/src/events/EventMetadata.ts
|
|
1462
|
-
var
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
"
|
|
1466
|
-
"
|
|
1467
|
-
"ARCHIVED"
|
|
1468
|
-
]);
|
|
1469
|
-
var ZodDate = z16.iso.date();
|
|
1470
|
-
var ZodDateTime = z16.string().datetime();
|
|
1471
|
-
var ActionCreationMetadata = z16.object({
|
|
1472
|
-
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1473
|
-
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1473
|
+
var ZodDate = z17.iso.date();
|
|
1474
|
+
var ZodDateTime = z17.string().datetime();
|
|
1475
|
+
var ActionCreationMetadata = z17.object({
|
|
1476
|
+
createdAt: z17.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1477
|
+
createdBy: z17.string().describe("ID of the user who created the action request."),
|
|
1474
1478
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1475
1479
|
createdAtLocation: UUID.nullish().describe(
|
|
1476
1480
|
"Location of the user who created the action request."
|
|
1477
1481
|
),
|
|
1478
|
-
createdByUserType:
|
|
1479
|
-
acceptedAt:
|
|
1480
|
-
createdByRole:
|
|
1482
|
+
createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1483
|
+
acceptedAt: z17.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1484
|
+
createdByRole: z17.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1481
1485
|
});
|
|
1482
1486
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1483
|
-
registrationNumber:
|
|
1487
|
+
registrationNumber: z17.string().describe(
|
|
1484
1488
|
"Registration number of the event. Always present for accepted registrations."
|
|
1485
1489
|
)
|
|
1486
1490
|
});
|
|
1487
|
-
var LegalStatuses =
|
|
1491
|
+
var LegalStatuses = z17.object({
|
|
1488
1492
|
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1489
1493
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1490
1494
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1491
1495
|
});
|
|
1492
|
-
var EventMetadata =
|
|
1496
|
+
var EventMetadata = z17.object({
|
|
1493
1497
|
id: UUID,
|
|
1494
|
-
type:
|
|
1498
|
+
type: z17.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1495
1499
|
status: EventStatus,
|
|
1496
1500
|
legalStatuses: LegalStatuses.describe(
|
|
1497
1501
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1498
1502
|
),
|
|
1499
|
-
createdAt:
|
|
1503
|
+
createdAt: z17.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1500
1504
|
dateOfEvent: ZodDate.nullish(),
|
|
1501
1505
|
placeOfEvent: UUID.nullish(),
|
|
1502
|
-
createdBy:
|
|
1503
|
-
createdByUserType:
|
|
1504
|
-
updatedByUserRole:
|
|
1506
|
+
createdBy: z17.string().describe("ID of the user who created the event."),
|
|
1507
|
+
createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1508
|
+
updatedByUserRole: z17.string().nullish().describe("Role of the user who last changed the status."),
|
|
1505
1509
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1506
1510
|
createdAtLocation: UUID.nullish().describe(
|
|
1507
1511
|
"Location of the user who created the event."
|
|
@@ -1509,18 +1513,18 @@ var EventMetadata = z16.object({
|
|
|
1509
1513
|
updatedAtLocation: UUID.nullish().describe(
|
|
1510
1514
|
"Location of the user who last changed the status."
|
|
1511
1515
|
),
|
|
1512
|
-
updatedAt:
|
|
1516
|
+
updatedAt: z17.iso.datetime().describe(
|
|
1513
1517
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1514
1518
|
),
|
|
1515
|
-
assignedTo:
|
|
1516
|
-
updatedBy:
|
|
1517
|
-
trackingId:
|
|
1519
|
+
assignedTo: z17.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1520
|
+
updatedBy: z17.string().nullish().describe("ID of the user who last changed the status."),
|
|
1521
|
+
trackingId: z17.string().describe(
|
|
1518
1522
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1519
1523
|
),
|
|
1520
|
-
potentialDuplicates:
|
|
1524
|
+
potentialDuplicates: z17.array(PotentialDuplicate).describe(
|
|
1521
1525
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1522
1526
|
),
|
|
1523
|
-
flags:
|
|
1527
|
+
flags: z17.array(Flag)
|
|
1524
1528
|
});
|
|
1525
1529
|
var EventMetadataKeysArray = [
|
|
1526
1530
|
"id",
|
|
@@ -1541,8 +1545,8 @@ var EventMetadataKeysArray = [
|
|
|
1541
1545
|
"legalStatuses",
|
|
1542
1546
|
"flags"
|
|
1543
1547
|
];
|
|
1544
|
-
var EventMetadataKeys =
|
|
1545
|
-
var EventMetadataDateFieldIdInput =
|
|
1548
|
+
var EventMetadataKeys = z17.enum(EventMetadataKeysArray);
|
|
1549
|
+
var EventMetadataDateFieldIdInput = z17.enum([
|
|
1546
1550
|
"createdAt",
|
|
1547
1551
|
"updatedAt",
|
|
1548
1552
|
"legalStatuses.NOTIFIED.createdAt",
|
|
@@ -1552,7 +1556,7 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
1552
1556
|
"legalStatuses.REGISTERED.createdAt",
|
|
1553
1557
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1554
1558
|
]);
|
|
1555
|
-
var EventMetadataDateFieldId =
|
|
1559
|
+
var EventMetadataDateFieldId = z17.enum([
|
|
1556
1560
|
"event.createdAt",
|
|
1557
1561
|
"event.updatedAt",
|
|
1558
1562
|
"event.legalStatuses.NOTIFIED.createdAt",
|
|
@@ -2652,18 +2656,18 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2652
2656
|
]);
|
|
2653
2657
|
|
|
2654
2658
|
// ../commons/src/events/FormConfig.ts
|
|
2655
|
-
var
|
|
2659
|
+
var z23 = __toESM(require("zod/v4"));
|
|
2656
2660
|
|
|
2657
2661
|
// ../commons/src/events/PageConfig.ts
|
|
2658
|
-
var
|
|
2659
|
-
var PageTypes =
|
|
2660
|
-
var PageConfigBase =
|
|
2661
|
-
id:
|
|
2662
|
+
var z22 = __toESM(require("zod/v4"));
|
|
2663
|
+
var PageTypes = z22.enum(["FORM", "VERIFICATION"]);
|
|
2664
|
+
var PageConfigBase = z22.object({
|
|
2665
|
+
id: z22.string().describe("Unique identifier for the page"),
|
|
2662
2666
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2663
|
-
requireCompletionToContinue:
|
|
2667
|
+
requireCompletionToContinue: z22.boolean().default(false).describe(
|
|
2664
2668
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2665
2669
|
),
|
|
2666
|
-
fields:
|
|
2670
|
+
fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2667
2671
|
conditional: Conditional.optional().describe(
|
|
2668
2672
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2669
2673
|
)
|
|
@@ -2672,13 +2676,13 @@ var PageConfigBase = z21.object({
|
|
|
2672
2676
|
id: "FormPageConfig"
|
|
2673
2677
|
});
|
|
2674
2678
|
var FormPageConfig = PageConfigBase.extend({
|
|
2675
|
-
type:
|
|
2679
|
+
type: z22.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2676
2680
|
});
|
|
2677
|
-
var VerificationActionConfig =
|
|
2678
|
-
verify:
|
|
2679
|
-
cancel:
|
|
2681
|
+
var VerificationActionConfig = z22.object({
|
|
2682
|
+
verify: z22.object({ label: TranslationConfig }),
|
|
2683
|
+
cancel: z22.object({
|
|
2680
2684
|
label: TranslationConfig,
|
|
2681
|
-
confirmation:
|
|
2685
|
+
confirmation: z22.object({
|
|
2682
2686
|
title: TranslationConfig,
|
|
2683
2687
|
body: TranslationConfig
|
|
2684
2688
|
})
|
|
@@ -2688,34 +2692,34 @@ var VerificationActionConfig = z21.object({
|
|
|
2688
2692
|
id: "VerificationActionConfig"
|
|
2689
2693
|
});
|
|
2690
2694
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2691
|
-
type:
|
|
2695
|
+
type: z22.literal(PageTypes.enum.VERIFICATION),
|
|
2692
2696
|
actions: VerificationActionConfig
|
|
2693
2697
|
});
|
|
2694
|
-
var PageConfig =
|
|
2698
|
+
var PageConfig = z22.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2695
2699
|
id: "PageConfig",
|
|
2696
2700
|
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
2697
2701
|
});
|
|
2698
2702
|
|
|
2699
2703
|
// ../commons/src/events/FormConfig.ts
|
|
2700
|
-
var DeclarationFormConfig =
|
|
2704
|
+
var DeclarationFormConfig = z23.object({
|
|
2701
2705
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2702
|
-
pages:
|
|
2706
|
+
pages: z23.array(FormPageConfig)
|
|
2703
2707
|
}).meta({
|
|
2704
2708
|
id: "DeclarationFormConfig",
|
|
2705
2709
|
description: "Configuration of the declaration form."
|
|
2706
2710
|
});
|
|
2707
|
-
var ActionFormConfig =
|
|
2711
|
+
var ActionFormConfig = z23.object({
|
|
2708
2712
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2709
|
-
pages:
|
|
2713
|
+
pages: z23.array(PageConfig)
|
|
2710
2714
|
}).describe(
|
|
2711
2715
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2712
2716
|
);
|
|
2713
|
-
var FormConfig =
|
|
2717
|
+
var FormConfig = z23.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2714
2718
|
|
|
2715
2719
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2716
|
-
var
|
|
2717
|
-
var FieldReference2 =
|
|
2718
|
-
var Matcher =
|
|
2720
|
+
var z24 = __toESM(require("zod/v4"));
|
|
2721
|
+
var FieldReference2 = z24.string();
|
|
2722
|
+
var Matcher = z24.object({
|
|
2719
2723
|
/**
|
|
2720
2724
|
* Reference to the field used in matching.
|
|
2721
2725
|
*
|
|
@@ -2723,23 +2727,23 @@ var Matcher = z23.object({
|
|
|
2723
2727
|
* be used as the origin date to calculate the distance from.
|
|
2724
2728
|
*/
|
|
2725
2729
|
fieldId: FieldReference2,
|
|
2726
|
-
options:
|
|
2727
|
-
boost:
|
|
2730
|
+
options: z24.object({
|
|
2731
|
+
boost: z24.number().optional(),
|
|
2728
2732
|
matchAgainst: FieldReference2.optional()
|
|
2729
2733
|
}).optional().default({
|
|
2730
2734
|
boost: 1
|
|
2731
2735
|
})
|
|
2732
2736
|
});
|
|
2733
2737
|
var FuzzyMatcher = Matcher.extend({
|
|
2734
|
-
type:
|
|
2735
|
-
options:
|
|
2738
|
+
type: z24.literal("fuzzy"),
|
|
2739
|
+
options: z24.object({
|
|
2736
2740
|
/**
|
|
2737
2741
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2738
2742
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2739
2743
|
* Names of length >7 characters = 2 edits allowed
|
|
2740
2744
|
*/
|
|
2741
|
-
fuzziness:
|
|
2742
|
-
boost:
|
|
2745
|
+
fuzziness: z24.union([z24.string(), z24.number()]).optional().default("AUTO:4,7"),
|
|
2746
|
+
boost: z24.number().optional().default(1),
|
|
2743
2747
|
matchAgainst: FieldReference2.optional()
|
|
2744
2748
|
}).optional().default({
|
|
2745
2749
|
fuzziness: "AUTO:4,7",
|
|
@@ -2747,48 +2751,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
2747
2751
|
})
|
|
2748
2752
|
});
|
|
2749
2753
|
var StrictMatcher = Matcher.extend({
|
|
2750
|
-
type:
|
|
2751
|
-
options:
|
|
2752
|
-
boost:
|
|
2754
|
+
type: z24.literal("strict"),
|
|
2755
|
+
options: z24.object({
|
|
2756
|
+
boost: z24.number().optional().default(1),
|
|
2753
2757
|
/**
|
|
2754
2758
|
* The constant value to be present in the field for both records
|
|
2755
2759
|
*/
|
|
2756
|
-
value:
|
|
2760
|
+
value: z24.string().optional(),
|
|
2757
2761
|
matchAgainst: FieldReference2.optional()
|
|
2758
2762
|
}).optional().default({
|
|
2759
2763
|
boost: 1
|
|
2760
2764
|
})
|
|
2761
2765
|
});
|
|
2762
2766
|
var DateRangeMatcher = Matcher.extend({
|
|
2763
|
-
type:
|
|
2764
|
-
options:
|
|
2767
|
+
type: z24.literal("dateRange"),
|
|
2768
|
+
options: z24.object({
|
|
2765
2769
|
/**
|
|
2766
2770
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2767
2771
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2768
2772
|
*/
|
|
2769
|
-
pivot:
|
|
2770
|
-
days:
|
|
2771
|
-
boost:
|
|
2773
|
+
pivot: z24.number().optional(),
|
|
2774
|
+
days: z24.number(),
|
|
2775
|
+
boost: z24.number().optional().default(1),
|
|
2772
2776
|
matchAgainst: FieldReference2.optional()
|
|
2773
2777
|
})
|
|
2774
2778
|
});
|
|
2775
|
-
var Not =
|
|
2776
|
-
type:
|
|
2779
|
+
var Not = z24.object({
|
|
2780
|
+
type: z24.literal("not"),
|
|
2777
2781
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2778
|
-
clause:
|
|
2782
|
+
clause: z24.lazy(() => Clause)
|
|
2779
2783
|
});
|
|
2780
|
-
var And =
|
|
2781
|
-
type:
|
|
2784
|
+
var And = z24.object({
|
|
2785
|
+
type: z24.literal("and"),
|
|
2782
2786
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2783
|
-
clauses:
|
|
2787
|
+
clauses: z24.lazy(() => Clause.array())
|
|
2784
2788
|
});
|
|
2785
|
-
var Or =
|
|
2786
|
-
type:
|
|
2789
|
+
var Or = z24.object({
|
|
2790
|
+
type: z24.literal("or"),
|
|
2787
2791
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2788
|
-
clauses:
|
|
2792
|
+
clauses: z24.lazy(() => Clause.array())
|
|
2789
2793
|
});
|
|
2790
|
-
var Clause =
|
|
2791
|
-
() =>
|
|
2794
|
+
var Clause = z24.lazy(
|
|
2795
|
+
() => z24.discriminatedUnion("type", [
|
|
2792
2796
|
Not,
|
|
2793
2797
|
And,
|
|
2794
2798
|
Or,
|
|
@@ -2799,8 +2803,8 @@ var Clause = z23.lazy(
|
|
|
2799
2803
|
).meta({
|
|
2800
2804
|
id: "Clause"
|
|
2801
2805
|
});
|
|
2802
|
-
var DeduplicationConfig =
|
|
2803
|
-
id:
|
|
2806
|
+
var DeduplicationConfig = z24.object({
|
|
2807
|
+
id: z24.string(),
|
|
2804
2808
|
label: TranslationConfig,
|
|
2805
2809
|
query: Clause
|
|
2806
2810
|
}).meta({
|
|
@@ -2809,15 +2813,15 @@ var DeduplicationConfig = z23.object({
|
|
|
2809
2813
|
});
|
|
2810
2814
|
|
|
2811
2815
|
// ../commons/src/events/ActionConfig.ts
|
|
2812
|
-
var DeclarationReviewConfig =
|
|
2816
|
+
var DeclarationReviewConfig = z25.object({
|
|
2813
2817
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2814
|
-
fields:
|
|
2818
|
+
fields: z25.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2815
2819
|
}).describe(
|
|
2816
2820
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2817
2821
|
);
|
|
2818
|
-
var ActionConfigBase =
|
|
2822
|
+
var ActionConfigBase = z25.object({
|
|
2819
2823
|
label: TranslationConfig.describe("Human readable description of the action"),
|
|
2820
|
-
flags:
|
|
2824
|
+
flags: z25.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2821
2825
|
supportingCopy: TranslationConfig.optional().describe(
|
|
2822
2826
|
"Text displayed on the confirmation dialog"
|
|
2823
2827
|
),
|
|
@@ -2828,84 +2832,84 @@ var ActionConfigBase = z24.object({
|
|
|
2828
2832
|
* "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."
|
|
2829
2833
|
* for EventConfig.d.ts.
|
|
2830
2834
|
*/
|
|
2831
|
-
icon:
|
|
2832
|
-
conditionals:
|
|
2835
|
+
icon: z25.string().describe("Icon representing the action").optional(),
|
|
2836
|
+
conditionals: z25.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2833
2837
|
});
|
|
2834
2838
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2835
2839
|
deduplication: DeduplicationConfig.optional()
|
|
2836
2840
|
});
|
|
2837
|
-
var actionConfirmationForm =
|
|
2841
|
+
var actionConfirmationForm = z25.array(FieldConfig).optional().describe(
|
|
2838
2842
|
"Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
|
|
2839
2843
|
);
|
|
2840
2844
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2841
|
-
|
|
2842
|
-
type:
|
|
2845
|
+
z25.object({
|
|
2846
|
+
type: z25.literal(ActionType.READ),
|
|
2843
2847
|
review: DeclarationReviewConfig.describe(
|
|
2844
2848
|
"Configuration of the review page for read-only view."
|
|
2845
2849
|
),
|
|
2846
|
-
conditionals:
|
|
2850
|
+
conditionals: z25.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2847
2851
|
}).shape
|
|
2848
2852
|
);
|
|
2849
2853
|
var NotifyConfig = ActionConfigBase.extend(
|
|
2850
|
-
|
|
2851
|
-
type:
|
|
2854
|
+
z25.object({
|
|
2855
|
+
type: z25.literal(ActionType.NOTIFY),
|
|
2852
2856
|
form: actionConfirmationForm
|
|
2853
2857
|
}).shape
|
|
2854
2858
|
);
|
|
2855
2859
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
2856
|
-
|
|
2857
|
-
type:
|
|
2858
|
-
label:
|
|
2860
|
+
z25.object({
|
|
2861
|
+
type: z25.literal(ActionType.DUPLICATE_DETECTED),
|
|
2862
|
+
label: z25.never().optional().describe(
|
|
2859
2863
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
2860
2864
|
),
|
|
2861
|
-
supportingCopy:
|
|
2862
|
-
icon:
|
|
2865
|
+
supportingCopy: z25.never().optional(),
|
|
2866
|
+
icon: z25.never().optional().describe(
|
|
2863
2867
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
2864
2868
|
),
|
|
2865
|
-
conditionals:
|
|
2869
|
+
conditionals: z25.never().optional().describe(
|
|
2866
2870
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
2867
2871
|
)
|
|
2868
2872
|
}).shape
|
|
2869
2873
|
);
|
|
2870
2874
|
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
2871
|
-
|
|
2872
|
-
type:
|
|
2875
|
+
z25.object({
|
|
2876
|
+
type: z25.literal(ActionType.MARK_AS_DUPLICATE)
|
|
2873
2877
|
}).shape
|
|
2874
2878
|
);
|
|
2875
2879
|
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
2876
|
-
|
|
2877
|
-
type:
|
|
2880
|
+
z25.object({
|
|
2881
|
+
type: z25.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
2878
2882
|
}).shape
|
|
2879
2883
|
);
|
|
2880
2884
|
var AssignConfig = ActionConfigBase.extend(
|
|
2881
|
-
|
|
2882
|
-
type:
|
|
2883
|
-
flags:
|
|
2885
|
+
z25.object({
|
|
2886
|
+
type: z25.literal(ActionType.ASSIGN),
|
|
2887
|
+
flags: z25.never().optional().describe(
|
|
2884
2888
|
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2885
2889
|
)
|
|
2886
2890
|
}).shape
|
|
2887
2891
|
);
|
|
2888
2892
|
var UnassignConfig = ActionConfigBase.extend(
|
|
2889
|
-
|
|
2890
|
-
type:
|
|
2891
|
-
flags:
|
|
2893
|
+
z25.object({
|
|
2894
|
+
type: z25.literal(ActionType.UNASSIGN),
|
|
2895
|
+
flags: z25.never().optional().describe(
|
|
2892
2896
|
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2893
2897
|
)
|
|
2894
2898
|
}).shape
|
|
2895
2899
|
);
|
|
2896
2900
|
var DeleteConfig = ActionConfigBase.extend(
|
|
2897
|
-
|
|
2898
|
-
type:
|
|
2901
|
+
z25.object({
|
|
2902
|
+
type: z25.literal(ActionType.DELETE)
|
|
2899
2903
|
}).shape
|
|
2900
2904
|
);
|
|
2901
2905
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2902
|
-
|
|
2903
|
-
type:
|
|
2906
|
+
z25.object({
|
|
2907
|
+
type: z25.literal(ActionType.DECLARE),
|
|
2904
2908
|
review: DeclarationReviewConfig.describe(
|
|
2905
2909
|
"Configuration of the review page fields."
|
|
2906
2910
|
),
|
|
2907
2911
|
form: actionConfirmationForm,
|
|
2908
|
-
dialogCopy:
|
|
2912
|
+
dialogCopy: z25.object({
|
|
2909
2913
|
notify: TranslationConfig.describe(
|
|
2910
2914
|
"Confirmation text for the notify action"
|
|
2911
2915
|
),
|
|
@@ -2919,20 +2923,20 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2919
2923
|
}).shape
|
|
2920
2924
|
);
|
|
2921
2925
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2922
|
-
|
|
2923
|
-
type:
|
|
2926
|
+
z25.object({
|
|
2927
|
+
type: z25.literal(ActionType.ARCHIVE),
|
|
2924
2928
|
form: actionConfirmationForm
|
|
2925
2929
|
}).shape
|
|
2926
2930
|
);
|
|
2927
2931
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
2928
|
-
|
|
2929
|
-
type:
|
|
2932
|
+
z25.object({
|
|
2933
|
+
type: z25.literal(ActionType.UNARCHIVE)
|
|
2930
2934
|
}).shape
|
|
2931
2935
|
);
|
|
2932
2936
|
var EditActionConfig = ActionConfigBase.extend(
|
|
2933
|
-
|
|
2934
|
-
type:
|
|
2935
|
-
dialogCopy:
|
|
2937
|
+
z25.object({
|
|
2938
|
+
type: z25.literal(ActionType.EDIT),
|
|
2939
|
+
dialogCopy: z25.object({
|
|
2936
2940
|
notify: TranslationConfig.describe(
|
|
2937
2941
|
"Confirmation text for the notify with edits action"
|
|
2938
2942
|
),
|
|
@@ -2946,45 +2950,45 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2946
2950
|
}).shape
|
|
2947
2951
|
);
|
|
2948
2952
|
var RejectConfig = ActionConfigBase.extend(
|
|
2949
|
-
|
|
2950
|
-
type:
|
|
2953
|
+
z25.object({
|
|
2954
|
+
type: z25.literal(ActionType.REJECT),
|
|
2951
2955
|
form: actionConfirmationForm
|
|
2952
2956
|
}).shape
|
|
2953
2957
|
);
|
|
2954
2958
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2955
|
-
|
|
2956
|
-
type:
|
|
2959
|
+
z25.object({
|
|
2960
|
+
type: z25.literal(ActionType.REGISTER),
|
|
2957
2961
|
form: actionConfirmationForm
|
|
2958
2962
|
}).shape
|
|
2959
2963
|
);
|
|
2960
2964
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
2961
|
-
|
|
2962
|
-
type:
|
|
2965
|
+
z25.object({
|
|
2966
|
+
type: z25.literal(ActionType.PRINT_CERTIFICATE),
|
|
2963
2967
|
printForm: ActionFormConfig
|
|
2964
2968
|
}).shape
|
|
2965
2969
|
);
|
|
2966
2970
|
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
2967
|
-
|
|
2968
|
-
type:
|
|
2971
|
+
z25.object({
|
|
2972
|
+
type: z25.literal(ActionType.REQUEST_CORRECTION),
|
|
2969
2973
|
correctionForm: ActionFormConfig
|
|
2970
2974
|
}).shape
|
|
2971
2975
|
);
|
|
2972
2976
|
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
2973
|
-
|
|
2974
|
-
type:
|
|
2977
|
+
z25.object({
|
|
2978
|
+
type: z25.literal(ActionType.APPROVE_CORRECTION)
|
|
2975
2979
|
}).shape
|
|
2976
2980
|
);
|
|
2977
2981
|
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
2978
|
-
|
|
2979
|
-
type:
|
|
2982
|
+
z25.object({
|
|
2983
|
+
type: z25.literal(ActionType.REJECT_CORRECTION)
|
|
2980
2984
|
}).shape
|
|
2981
2985
|
);
|
|
2982
2986
|
var CustomActionConfig = ActionConfigBase.extend(
|
|
2983
|
-
|
|
2984
|
-
type:
|
|
2985
|
-
customActionType:
|
|
2987
|
+
z25.object({
|
|
2988
|
+
type: z25.literal(ActionType.CUSTOM),
|
|
2989
|
+
customActionType: z25.string().describe("Type identifier of the custom action."),
|
|
2986
2990
|
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
2987
|
-
form:
|
|
2991
|
+
form: z25.array(FieldConfig).describe(
|
|
2988
2992
|
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2989
2993
|
),
|
|
2990
2994
|
auditHistoryLabel: TranslationConfig.describe(
|
|
@@ -2992,7 +2996,7 @@ var CustomActionConfig = ActionConfigBase.extend(
|
|
|
2992
2996
|
)
|
|
2993
2997
|
}).shape
|
|
2994
2998
|
);
|
|
2995
|
-
var ActionConfig =
|
|
2999
|
+
var ActionConfig = z25.discriminatedUnion("type", [
|
|
2996
3000
|
/*
|
|
2997
3001
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2998
3002
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -3079,58 +3083,58 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3079
3083
|
var actionConfigTypes = new Set(
|
|
3080
3084
|
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
3081
3085
|
);
|
|
3082
|
-
var DeclarationActionConfig =
|
|
3086
|
+
var DeclarationActionConfig = z25.discriminatedUnion("type", [
|
|
3083
3087
|
DeclareConfig,
|
|
3084
3088
|
RegisterConfig
|
|
3085
3089
|
]);
|
|
3086
3090
|
|
|
3087
3091
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
3088
|
-
var
|
|
3089
|
-
var FontFamily =
|
|
3090
|
-
normal:
|
|
3091
|
-
bold:
|
|
3092
|
-
italics:
|
|
3093
|
-
bolditalics:
|
|
3094
|
-
});
|
|
3095
|
-
var CertificateConfig =
|
|
3096
|
-
id:
|
|
3097
|
-
event:
|
|
3098
|
-
isV2Template:
|
|
3092
|
+
var z26 = __toESM(require("zod/v4"));
|
|
3093
|
+
var FontFamily = z26.object({
|
|
3094
|
+
normal: z26.string(),
|
|
3095
|
+
bold: z26.string(),
|
|
3096
|
+
italics: z26.string(),
|
|
3097
|
+
bolditalics: z26.string()
|
|
3098
|
+
});
|
|
3099
|
+
var CertificateConfig = z26.object({
|
|
3100
|
+
id: z26.string(),
|
|
3101
|
+
event: z26.string(),
|
|
3102
|
+
isV2Template: z26.boolean().optional(),
|
|
3099
3103
|
label: TranslationConfig,
|
|
3100
|
-
isDefault:
|
|
3101
|
-
fee:
|
|
3102
|
-
onTime:
|
|
3103
|
-
late:
|
|
3104
|
-
delayed:
|
|
3104
|
+
isDefault: z26.boolean(),
|
|
3105
|
+
fee: z26.object({
|
|
3106
|
+
onTime: z26.number(),
|
|
3107
|
+
late: z26.number(),
|
|
3108
|
+
delayed: z26.number()
|
|
3105
3109
|
}),
|
|
3106
|
-
svgUrl:
|
|
3107
|
-
fonts:
|
|
3108
|
-
conditionals:
|
|
3110
|
+
svgUrl: z26.string(),
|
|
3111
|
+
fonts: z26.record(z26.string(), FontFamily).optional(),
|
|
3112
|
+
conditionals: z26.array(ShowConditional).optional()
|
|
3109
3113
|
});
|
|
3110
3114
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
3111
|
-
hash:
|
|
3112
|
-
svg:
|
|
3115
|
+
hash: z26.string().optional(),
|
|
3116
|
+
svg: z26.string()
|
|
3113
3117
|
});
|
|
3114
3118
|
|
|
3115
3119
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
3116
|
-
var
|
|
3117
|
-
var LanguageConfig =
|
|
3118
|
-
lang:
|
|
3120
|
+
var z27 = __toESM(require("zod/v4"));
|
|
3121
|
+
var LanguageConfig = z27.object({
|
|
3122
|
+
lang: z27.string(),
|
|
3119
3123
|
/**
|
|
3120
3124
|
* client.csv contents
|
|
3121
3125
|
*/
|
|
3122
|
-
messages:
|
|
3126
|
+
messages: z27.record(z27.string(), z27.string())
|
|
3123
3127
|
});
|
|
3124
3128
|
|
|
3125
3129
|
// ../commons/src/events/EventConfig.ts
|
|
3126
|
-
var
|
|
3130
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3127
3131
|
|
|
3128
3132
|
// ../commons/src/events/SummaryConfig.ts
|
|
3129
|
-
var
|
|
3133
|
+
var z29 = __toESM(require("zod/v4"));
|
|
3130
3134
|
|
|
3131
3135
|
// ../commons/src/icons.ts
|
|
3132
|
-
var
|
|
3133
|
-
var AvailableIcons =
|
|
3136
|
+
var z28 = __toESM(require("zod/v4"));
|
|
3137
|
+
var AvailableIcons = z28.enum([
|
|
3134
3138
|
"Archived",
|
|
3135
3139
|
"Assigned",
|
|
3136
3140
|
"Briefcase",
|
|
@@ -3238,11 +3242,11 @@ var AvailableIcons = z27.enum([
|
|
|
3238
3242
|
]);
|
|
3239
3243
|
|
|
3240
3244
|
// ../commons/src/events/SummaryConfig.ts
|
|
3241
|
-
var InfoBox =
|
|
3242
|
-
type:
|
|
3245
|
+
var InfoBox = z29.object({
|
|
3246
|
+
type: z29.enum(["info", "positive", "warning", "negative"]).describe(
|
|
3243
3247
|
"Semantic tint of the icon block: info (blue), positive (green), warning (orange), negative (red)."
|
|
3244
3248
|
),
|
|
3245
|
-
background:
|
|
3249
|
+
background: z29.enum(["tinted", "white"]).default("tinted").optional().describe(
|
|
3246
3250
|
"tinted reads as a recessed empty state; white reads as a standalone card."
|
|
3247
3251
|
),
|
|
3248
3252
|
icon: AvailableIcons.optional().describe(
|
|
@@ -3254,50 +3258,50 @@ var InfoBox = z28.object({
|
|
|
3254
3258
|
description: TranslationConfig.optional().describe(
|
|
3255
3259
|
"Secondary copy displayed below the heading, typically a suggested next step."
|
|
3256
3260
|
),
|
|
3257
|
-
conditionals:
|
|
3261
|
+
conditionals: z29.array(ShowConditional).default([]).optional().describe(
|
|
3258
3262
|
"Conditions under which the info box is shown. When omitted, it is always shown."
|
|
3259
3263
|
)
|
|
3260
3264
|
}).describe(
|
|
3261
3265
|
"A compact icon-block + heading + description block displayed above the summary fields in the event overview."
|
|
3262
3266
|
);
|
|
3263
|
-
var BaseField2 =
|
|
3267
|
+
var BaseField2 = z29.object({
|
|
3264
3268
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
3265
3269
|
"Default message displayed when the field value is empty."
|
|
3266
3270
|
),
|
|
3267
|
-
conditionals:
|
|
3271
|
+
conditionals: z29.array(ShowConditional).default([]).optional()
|
|
3268
3272
|
});
|
|
3269
3273
|
var ReferenceField = BaseField2.extend({
|
|
3270
|
-
fieldId:
|
|
3274
|
+
fieldId: z29.string(),
|
|
3271
3275
|
label: TranslationConfig.optional().describe(
|
|
3272
3276
|
"Overrides the default label from the referenced field when provided."
|
|
3273
3277
|
)
|
|
3274
3278
|
}).describe("Field referencing existing event data by field ID.");
|
|
3275
3279
|
var Field = BaseField2.extend({
|
|
3276
|
-
id:
|
|
3280
|
+
id: z29.string().describe("Identifier of the summary field."),
|
|
3277
3281
|
value: TranslationConfig.describe(
|
|
3278
3282
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
3279
3283
|
),
|
|
3280
3284
|
label: TranslationConfig
|
|
3281
3285
|
}).describe("Custom field defined for the summary view.");
|
|
3282
|
-
var SummaryConfig =
|
|
3283
|
-
banners:
|
|
3286
|
+
var SummaryConfig = z29.object({
|
|
3287
|
+
banners: z29.array(InfoBox).default([]).optional().describe(
|
|
3284
3288
|
"Info boxes displayed above the summary fields in the event overview."
|
|
3285
3289
|
),
|
|
3286
|
-
fields:
|
|
3290
|
+
fields: z29.array(z29.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3287
3291
|
}).meta({
|
|
3288
3292
|
id: "SummaryConfig",
|
|
3289
3293
|
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."
|
|
3290
3294
|
});
|
|
3291
3295
|
|
|
3292
3296
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3293
|
-
var
|
|
3294
|
-
var MatchType =
|
|
3295
|
-
var BaseField3 =
|
|
3296
|
-
config:
|
|
3297
|
+
var z30 = __toESM(require("zod/v4"));
|
|
3298
|
+
var MatchType = z30.enum(["fuzzy", "exact", "range", "within"]);
|
|
3299
|
+
var BaseField3 = z30.object({
|
|
3300
|
+
config: z30.object({
|
|
3297
3301
|
type: MatchType.describe(
|
|
3298
3302
|
"Determines the search type of field. How to match value."
|
|
3299
3303
|
),
|
|
3300
|
-
searchFields:
|
|
3304
|
+
searchFields: z30.array(z30.string()).optional().describe(
|
|
3301
3305
|
`
|
|
3302
3306
|
Defines multiple form fields that should be searched when this field has a value.
|
|
3303
3307
|
All specified fields will be combined using OR logic.
|
|
@@ -3307,7 +3311,7 @@ var BaseField3 = z29.object({
|
|
|
3307
3311
|
`
|
|
3308
3312
|
)
|
|
3309
3313
|
}),
|
|
3310
|
-
type:
|
|
3314
|
+
type: z30.nativeEnum(FieldType).optional().describe(
|
|
3311
3315
|
`
|
|
3312
3316
|
Explicitly specify the field type for searchFields.
|
|
3313
3317
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -3321,7 +3325,7 @@ var BaseField3 = z29.object({
|
|
|
3321
3325
|
This is required when searchFields is defined.
|
|
3322
3326
|
`
|
|
3323
3327
|
),
|
|
3324
|
-
options:
|
|
3328
|
+
options: z30.array(SelectOption).optional(),
|
|
3325
3329
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
3326
3330
|
`
|
|
3327
3331
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -3342,7 +3346,7 @@ var BaseField3 = z29.object({
|
|
|
3342
3346
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
3343
3347
|
`
|
|
3344
3348
|
),
|
|
3345
|
-
conditionals:
|
|
3349
|
+
conditionals: z30.array(FieldConditional).optional().describe(
|
|
3346
3350
|
`
|
|
3347
3351
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
3348
3352
|
|
|
@@ -3356,23 +3360,23 @@ var BaseField3 = z29.object({
|
|
|
3356
3360
|
are always rendered in the advanced search form.
|
|
3357
3361
|
`
|
|
3358
3362
|
),
|
|
3359
|
-
validations:
|
|
3363
|
+
validations: z30.array(ValidationConfig).optional().describe(
|
|
3360
3364
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
3361
3365
|
),
|
|
3362
3366
|
allowedLocations: JurisdictionReference.optional().describe(
|
|
3363
3367
|
`Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
|
|
3364
3368
|
)
|
|
3365
3369
|
});
|
|
3366
|
-
var SearchQueryParams =
|
|
3367
|
-
eventType:
|
|
3370
|
+
var SearchQueryParams = z30.object({
|
|
3371
|
+
eventType: z30.string().optional().describe(
|
|
3368
3372
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
3369
3373
|
)
|
|
3370
3374
|
}).catchall(FieldValue);
|
|
3371
3375
|
var FieldConfigSchema = BaseField3.extend({
|
|
3372
|
-
fieldId:
|
|
3373
|
-
fieldType:
|
|
3376
|
+
fieldId: z30.string(),
|
|
3377
|
+
fieldType: z30.literal("field")
|
|
3374
3378
|
});
|
|
3375
|
-
var EventFieldIdInput =
|
|
3379
|
+
var EventFieldIdInput = z30.enum([
|
|
3376
3380
|
"trackingId",
|
|
3377
3381
|
"status",
|
|
3378
3382
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -3381,7 +3385,7 @@ var EventFieldIdInput = z29.enum([
|
|
|
3381
3385
|
"updatedAt"
|
|
3382
3386
|
]);
|
|
3383
3387
|
var METADATA_FIELD_PREFIX = "event.";
|
|
3384
|
-
var EventFieldId =
|
|
3388
|
+
var EventFieldId = z30.enum([
|
|
3385
3389
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
3386
3390
|
`${METADATA_FIELD_PREFIX}status`,
|
|
3387
3391
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -3391,29 +3395,29 @@ var EventFieldId = z29.enum([
|
|
|
3391
3395
|
]);
|
|
3392
3396
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
3393
3397
|
fieldId: EventFieldId,
|
|
3394
|
-
fieldType:
|
|
3398
|
+
fieldType: z30.literal("event")
|
|
3395
3399
|
});
|
|
3396
|
-
var AdvancedSearchField =
|
|
3400
|
+
var AdvancedSearchField = z30.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
3397
3401
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
3398
3402
|
if (!data.label) {
|
|
3399
3403
|
ctx.addIssue({
|
|
3400
|
-
code:
|
|
3404
|
+
code: z30.ZodIssueCode.custom,
|
|
3401
3405
|
message: "label is required when config.searchFields is defined.",
|
|
3402
3406
|
path: ["label"]
|
|
3403
3407
|
});
|
|
3404
3408
|
}
|
|
3405
3409
|
if (!data.type) {
|
|
3406
3410
|
ctx.addIssue({
|
|
3407
|
-
code:
|
|
3411
|
+
code: z30.ZodIssueCode.custom,
|
|
3408
3412
|
message: "type is required when config.searchFields is defined.",
|
|
3409
3413
|
path: ["type"]
|
|
3410
3414
|
});
|
|
3411
3415
|
}
|
|
3412
3416
|
}
|
|
3413
3417
|
});
|
|
3414
|
-
var AdvancedSearchConfig =
|
|
3418
|
+
var AdvancedSearchConfig = z30.object({
|
|
3415
3419
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3416
|
-
fields:
|
|
3420
|
+
fields: z30.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3417
3421
|
}).meta({
|
|
3418
3422
|
id: "AdvancedSearchConfig",
|
|
3419
3423
|
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()`)."
|
|
@@ -3425,26 +3429,26 @@ var import_lodash4 = require("lodash");
|
|
|
3425
3429
|
// ../commons/src/conditionals/validate.ts
|
|
3426
3430
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
3427
3431
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
3428
|
-
var
|
|
3432
|
+
var z34 = __toESM(require("zod/v4"));
|
|
3429
3433
|
var import_date_fns2 = require("date-fns");
|
|
3430
3434
|
|
|
3431
3435
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
3432
|
-
var
|
|
3436
|
+
var z32 = __toESM(require("zod/v4"));
|
|
3433
3437
|
|
|
3434
3438
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
3435
|
-
var
|
|
3439
|
+
var z31 = __toESM(require("zod/v4"));
|
|
3436
3440
|
|
|
3437
3441
|
// ../commons/src/events/state/index.ts
|
|
3438
3442
|
var import_lodash3 = require("lodash");
|
|
3439
3443
|
|
|
3440
3444
|
// ../commons/src/utils.ts
|
|
3441
|
-
var
|
|
3445
|
+
var z33 = __toESM(require("zod/v4"));
|
|
3442
3446
|
var _ = __toESM(require("lodash"));
|
|
3443
|
-
var FullNameV1 =
|
|
3444
|
-
|
|
3445
|
-
use:
|
|
3446
|
-
family:
|
|
3447
|
-
given:
|
|
3447
|
+
var FullNameV1 = z33.array(
|
|
3448
|
+
z33.object({
|
|
3449
|
+
use: z33.string(),
|
|
3450
|
+
family: z33.string(),
|
|
3451
|
+
given: z33.array(z33.string())
|
|
3448
3452
|
})
|
|
3449
3453
|
);
|
|
3450
3454
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -4162,9 +4166,9 @@ var ajv = new import__.default({
|
|
|
4162
4166
|
strict: false
|
|
4163
4167
|
// Allow minContains and other newer features
|
|
4164
4168
|
});
|
|
4165
|
-
var DataContext =
|
|
4166
|
-
rootData:
|
|
4167
|
-
$leafAdminStructureLocationIds:
|
|
4169
|
+
var DataContext = z34.object({
|
|
4170
|
+
rootData: z34.object({
|
|
4171
|
+
$leafAdminStructureLocationIds: z34.array(z34.object({ id: UUID }))
|
|
4168
4172
|
})
|
|
4169
4173
|
});
|
|
4170
4174
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -4445,11 +4449,11 @@ function validateActionOrder(event2, ctx) {
|
|
|
4445
4449
|
}
|
|
4446
4450
|
|
|
4447
4451
|
// ../commons/src/events/EventConfig.ts
|
|
4448
|
-
var EventFieldReference =
|
|
4452
|
+
var EventFieldReference = z35.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
4449
4453
|
"Reference to a field defined in the event metadata, using the field id."
|
|
4450
4454
|
);
|
|
4451
|
-
var _EventConfigBase =
|
|
4452
|
-
id:
|
|
4455
|
+
var _EventConfigBase = z35.object({
|
|
4456
|
+
id: z35.string().describe(
|
|
4453
4457
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
4454
4458
|
),
|
|
4455
4459
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -4468,25 +4472,25 @@ var _EventConfigBase = z34.object({
|
|
|
4468
4472
|
"Summary information displayed in the event overview."
|
|
4469
4473
|
),
|
|
4470
4474
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
4471
|
-
actions:
|
|
4475
|
+
actions: z35.array(ActionConfig).describe(
|
|
4472
4476
|
"Configuration of core and custom actions associated with the event."
|
|
4473
4477
|
),
|
|
4474
|
-
actionOrder:
|
|
4478
|
+
actionOrder: z35.array(z35.string()).optional().describe(
|
|
4475
4479
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
4476
4480
|
),
|
|
4477
4481
|
declaration: DeclarationFormConfig.describe(
|
|
4478
4482
|
"Configuration of the form used to gather event data."
|
|
4479
4483
|
),
|
|
4480
|
-
advancedSearch:
|
|
4484
|
+
advancedSearch: z35.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
4481
4485
|
"Configuration of fields available in the advanced search feature."
|
|
4482
4486
|
),
|
|
4483
|
-
flags:
|
|
4487
|
+
flags: z35.array(FlagConfig).optional().default([]).describe(
|
|
4484
4488
|
"Configuration of custom flags associated with the actions of this event type."
|
|
4485
4489
|
),
|
|
4486
|
-
analytics:
|
|
4490
|
+
analytics: z35.boolean().optional().default(true).describe(
|
|
4487
4491
|
"Indicates whether the records of this event type are included in analytics"
|
|
4488
4492
|
),
|
|
4489
|
-
icon:
|
|
4493
|
+
icon: z35.partialRecord(AvailableIcons, Conditional).optional().describe(
|
|
4490
4494
|
'Maps an icon name to a conditional. The icon of the first entry (in definition order) whose conditional matches the event is used when rendering it (e.g. in the "iconWithName"/"iconWithNameEvent" workqueue columns). Falls back to the default status-based icon when unset or when no conditional matches.'
|
|
4491
4495
|
)
|
|
4492
4496
|
});
|
|
@@ -4507,7 +4511,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
4507
4511
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
4508
4512
|
|
|
4509
4513
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
4510
|
-
var
|
|
4514
|
+
var z38 = __toESM(require("zod/v4"));
|
|
4511
4515
|
|
|
4512
4516
|
// ../commons/src/searchConfigs.ts
|
|
4513
4517
|
function createSearchConfig(baseField) {
|
|
@@ -4718,17 +4722,17 @@ var event = Object.assign(eventFn, {
|
|
|
4718
4722
|
});
|
|
4719
4723
|
|
|
4720
4724
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
4721
|
-
var
|
|
4725
|
+
var z36 = __toESM(require("zod/v4"));
|
|
4722
4726
|
var WorkqueueColumnKeysArray = [
|
|
4723
4727
|
...EventMetadataKeysArray,
|
|
4724
4728
|
"title",
|
|
4725
4729
|
"outbox"
|
|
4726
4730
|
];
|
|
4727
|
-
var WorkqueueColumnKeys =
|
|
4728
|
-
var WorkqueueColumnValue =
|
|
4731
|
+
var WorkqueueColumnKeys = z36.enum(WorkqueueColumnKeysArray);
|
|
4732
|
+
var WorkqueueColumnValue = z36.object({
|
|
4729
4733
|
$event: WorkqueueColumnKeys
|
|
4730
4734
|
});
|
|
4731
|
-
var WorkqueueColumn =
|
|
4735
|
+
var WorkqueueColumn = z36.object({
|
|
4732
4736
|
label: TranslationConfig,
|
|
4733
4737
|
value: WorkqueueColumnValue
|
|
4734
4738
|
}).meta({
|
|
@@ -4742,51 +4746,51 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
4742
4746
|
}
|
|
4743
4747
|
|
|
4744
4748
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
4745
|
-
var
|
|
4746
|
-
var SerializableExact =
|
|
4747
|
-
type:
|
|
4748
|
-
term:
|
|
4749
|
-
});
|
|
4750
|
-
var SerializableWithin =
|
|
4751
|
-
type:
|
|
4752
|
-
location:
|
|
4753
|
-
});
|
|
4754
|
-
var SerializedQueryExpression =
|
|
4755
|
-
eventType:
|
|
4756
|
-
status:
|
|
4757
|
-
createdAt:
|
|
4758
|
-
updatedAt:
|
|
4759
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
4760
|
-
"legalStatuses.DECLARED.createdByRole":
|
|
4761
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
4762
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
4763
|
-
"legalStatuses.REGISTERED.createdByRole":
|
|
4764
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
4765
|
-
createdAtLocation:
|
|
4766
|
-
|
|
4749
|
+
var z37 = __toESM(require("zod/v4"));
|
|
4750
|
+
var SerializableExact = z37.object({
|
|
4751
|
+
type: z37.literal("exact"),
|
|
4752
|
+
term: z37.union([z37.string(), SerializedUserField])
|
|
4753
|
+
});
|
|
4754
|
+
var SerializableWithin = z37.object({
|
|
4755
|
+
type: z37.literal("within"),
|
|
4756
|
+
location: z37.union([z37.string(), SerializedUserField])
|
|
4757
|
+
});
|
|
4758
|
+
var SerializedQueryExpression = z37.object({
|
|
4759
|
+
eventType: z37.string(),
|
|
4760
|
+
status: z37.optional(z37.union([AnyOfStatus, ExactStatus])),
|
|
4761
|
+
createdAt: z37.optional(DateCondition),
|
|
4762
|
+
updatedAt: z37.optional(DateCondition),
|
|
4763
|
+
"legalStatuses.DECLARED.createdAtLocation": z37.optional(SerializableWithin),
|
|
4764
|
+
"legalStatuses.DECLARED.createdByRole": z37.optional(AnyOf),
|
|
4765
|
+
"legalStatuses.REGISTERED.createdAt": z37.optional(DateCondition),
|
|
4766
|
+
"legalStatuses.REGISTERED.createdAtLocation": z37.optional(SerializableWithin),
|
|
4767
|
+
"legalStatuses.REGISTERED.createdByRole": z37.optional(AnyOf),
|
|
4768
|
+
"legalStatuses.REGISTERED.registrationNumber": z37.optional(Exact),
|
|
4769
|
+
createdAtLocation: z37.optional(
|
|
4770
|
+
z37.union([SerializableWithin, SerializableExact])
|
|
4767
4771
|
),
|
|
4768
|
-
updatedAtLocation:
|
|
4769
|
-
|
|
4772
|
+
updatedAtLocation: z37.optional(
|
|
4773
|
+
z37.union([SerializableWithin, SerializableExact])
|
|
4770
4774
|
),
|
|
4771
|
-
updatedByUserRole:
|
|
4772
|
-
assignedTo:
|
|
4773
|
-
createdBy:
|
|
4775
|
+
updatedByUserRole: z37.optional(SerializableExact),
|
|
4776
|
+
assignedTo: z37.optional(SerializableExact),
|
|
4777
|
+
createdBy: z37.optional(SerializableExact),
|
|
4774
4778
|
createdByUserType: ExactUserType,
|
|
4775
|
-
updatedBy:
|
|
4776
|
-
trackingId:
|
|
4777
|
-
flags:
|
|
4779
|
+
updatedBy: z37.optional(SerializableExact),
|
|
4780
|
+
trackingId: z37.optional(Exact),
|
|
4781
|
+
flags: z37.optional(ContainsFlags),
|
|
4778
4782
|
data: QueryInput
|
|
4779
4783
|
}).partial();
|
|
4780
|
-
var Or2 =
|
|
4781
|
-
type:
|
|
4782
|
-
clauses:
|
|
4784
|
+
var Or2 = z37.object({
|
|
4785
|
+
type: z37.literal("or"),
|
|
4786
|
+
clauses: z37.array(SerializedQueryExpression)
|
|
4783
4787
|
});
|
|
4784
|
-
var And2 =
|
|
4785
|
-
type:
|
|
4786
|
-
clauses:
|
|
4788
|
+
var And2 = z37.object({
|
|
4789
|
+
type: z37.literal("and"),
|
|
4790
|
+
clauses: z37.array(SerializedQueryExpression)
|
|
4787
4791
|
});
|
|
4788
|
-
var CountryConfigQueryType =
|
|
4789
|
-
var CountryConfigQueryInputType =
|
|
4792
|
+
var CountryConfigQueryType = z37.discriminatedUnion("type", [And2, Or2]);
|
|
4793
|
+
var CountryConfigQueryInputType = z37.union([
|
|
4790
4794
|
SerializedQueryExpression,
|
|
4791
4795
|
And2,
|
|
4792
4796
|
Or2
|
|
@@ -4811,16 +4815,16 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
4811
4815
|
value: event.field("updatedAt")
|
|
4812
4816
|
}
|
|
4813
4817
|
]);
|
|
4814
|
-
var WorkqueueConfig =
|
|
4815
|
-
slug:
|
|
4818
|
+
var WorkqueueConfig = z38.object({
|
|
4819
|
+
slug: z38.string().describe("Determines the url of the workqueue."),
|
|
4816
4820
|
name: TranslationConfig.describe(
|
|
4817
4821
|
"Title of the workflow (both in navigation and on the page)"
|
|
4818
4822
|
),
|
|
4819
4823
|
query: CountryConfigQueryType,
|
|
4820
|
-
action:
|
|
4824
|
+
action: z38.object({ type: WorkqueueActionType }).optional().describe(
|
|
4821
4825
|
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
4822
4826
|
),
|
|
4823
|
-
columns:
|
|
4827
|
+
columns: z38.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4824
4828
|
icon: AvailableIcons,
|
|
4825
4829
|
emptyMessage: TranslationConfig.optional()
|
|
4826
4830
|
}).describe("Configuration for workqueue.");
|
|
@@ -4834,10 +4838,10 @@ var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
|
4834
4838
|
id: "WorkqueueConfig",
|
|
4835
4839
|
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."
|
|
4836
4840
|
});
|
|
4837
|
-
var WorkqueueCountInput =
|
|
4838
|
-
|
|
4841
|
+
var WorkqueueCountInput = z38.array(
|
|
4842
|
+
z38.object({ slug: z38.string(), query: QueryType })
|
|
4839
4843
|
);
|
|
4840
|
-
var WorkqueueCountOutput =
|
|
4844
|
+
var WorkqueueCountOutput = z38.record(z38.string(), z38.number());
|
|
4841
4845
|
|
|
4842
4846
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
4843
4847
|
var defaultWorkqueueColumns = [
|
|
@@ -4860,21 +4864,21 @@ var defaultWorkqueueColumns = [
|
|
|
4860
4864
|
];
|
|
4861
4865
|
|
|
4862
4866
|
// ../commons/src/events/Draft.ts
|
|
4863
|
-
var
|
|
4867
|
+
var z40 = __toESM(require("zod/v4"));
|
|
4864
4868
|
|
|
4865
4869
|
// ../commons/src/events/ActionInput.ts
|
|
4866
|
-
var
|
|
4867
|
-
var BaseActionInput =
|
|
4870
|
+
var z39 = __toESM(require("zod/v4"));
|
|
4871
|
+
var BaseActionInput = z39.object({
|
|
4868
4872
|
eventId: UUID,
|
|
4869
|
-
transactionId:
|
|
4873
|
+
transactionId: z39.string(),
|
|
4870
4874
|
declaration: ActionUpdate.default({}),
|
|
4871
4875
|
annotation: ActionUpdate.optional(),
|
|
4872
4876
|
originalActionId: UUID.optional(),
|
|
4873
4877
|
// should not be part of base action.
|
|
4874
|
-
keepAssignment:
|
|
4875
|
-
keepAssignmentIfAccepted:
|
|
4876
|
-
keepAssignmentIfRejected:
|
|
4877
|
-
waitFor:
|
|
4878
|
+
keepAssignment: z39.boolean().optional(),
|
|
4879
|
+
keepAssignmentIfAccepted: z39.boolean().optional(),
|
|
4880
|
+
keepAssignmentIfRejected: z39.boolean().optional(),
|
|
4881
|
+
waitFor: z39.boolean().default(true).describe(
|
|
4878
4882
|
"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."
|
|
4879
4883
|
),
|
|
4880
4884
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
@@ -4884,8 +4888,8 @@ var BaseActionInput = z38.object({
|
|
|
4884
4888
|
)
|
|
4885
4889
|
});
|
|
4886
4890
|
var CreateActionInput = BaseActionInput.extend(
|
|
4887
|
-
|
|
4888
|
-
type:
|
|
4891
|
+
z39.object({
|
|
4892
|
+
type: z39.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
4889
4893
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4890
4894
|
createdAtLocation: UUID.nullish().describe(
|
|
4891
4895
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
@@ -4893,14 +4897,14 @@ var CreateActionInput = BaseActionInput.extend(
|
|
|
4893
4897
|
}).shape
|
|
4894
4898
|
);
|
|
4895
4899
|
var RegisterActionInput = BaseActionInput.extend(
|
|
4896
|
-
|
|
4897
|
-
type:
|
|
4898
|
-
registrationNumber:
|
|
4900
|
+
z39.strictObject({
|
|
4901
|
+
type: z39.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
4902
|
+
registrationNumber: z39.string().optional()
|
|
4899
4903
|
}).shape
|
|
4900
4904
|
);
|
|
4901
4905
|
var NotifyActionInput = BaseActionInput.extend(
|
|
4902
|
-
|
|
4903
|
-
type:
|
|
4906
|
+
z39.object({
|
|
4907
|
+
type: z39.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
|
|
4904
4908
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4905
4909
|
createdAtLocation: UUID.nullish().describe(
|
|
4906
4910
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
@@ -4916,51 +4920,51 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
4916
4920
|
}
|
|
4917
4921
|
});
|
|
4918
4922
|
var DeclareActionInput = BaseActionInput.extend(
|
|
4919
|
-
|
|
4920
|
-
type:
|
|
4923
|
+
z39.object({
|
|
4924
|
+
type: z39.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
4921
4925
|
}).shape
|
|
4922
4926
|
);
|
|
4923
4927
|
var EditActionInput = BaseActionInput.extend(
|
|
4924
|
-
|
|
4925
|
-
type:
|
|
4928
|
+
z39.object({
|
|
4929
|
+
type: z39.literal(ActionType.EDIT).default(ActionType.EDIT)
|
|
4926
4930
|
}).shape
|
|
4927
4931
|
);
|
|
4928
4932
|
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
4929
|
-
|
|
4930
|
-
type:
|
|
4933
|
+
z39.object({
|
|
4934
|
+
type: z39.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
4931
4935
|
content: PrintContent.optional()
|
|
4932
4936
|
}).shape
|
|
4933
4937
|
);
|
|
4934
4938
|
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
4935
|
-
|
|
4936
|
-
type:
|
|
4939
|
+
z39.object({
|
|
4940
|
+
type: z39.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
4937
4941
|
content: ReasonContent
|
|
4938
4942
|
}).shape
|
|
4939
4943
|
);
|
|
4940
4944
|
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
4941
|
-
|
|
4942
|
-
type:
|
|
4943
|
-
content:
|
|
4944
|
-
duplicates:
|
|
4945
|
+
z39.object({
|
|
4946
|
+
type: z39.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
4947
|
+
content: z39.object({
|
|
4948
|
+
duplicates: z39.array(PotentialDuplicate)
|
|
4945
4949
|
})
|
|
4946
4950
|
}).shape
|
|
4947
4951
|
);
|
|
4948
4952
|
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
4949
|
-
|
|
4950
|
-
type:
|
|
4951
|
-
content:
|
|
4953
|
+
z39.object({
|
|
4954
|
+
type: z39.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
4955
|
+
content: z39.object({
|
|
4952
4956
|
duplicateOf: UUID
|
|
4953
4957
|
}).optional()
|
|
4954
4958
|
}).shape
|
|
4955
4959
|
);
|
|
4956
4960
|
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
4957
|
-
|
|
4958
|
-
type:
|
|
4961
|
+
z39.object({
|
|
4962
|
+
type: z39.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
4959
4963
|
}).shape
|
|
4960
4964
|
);
|
|
4961
4965
|
var ArchiveActionInput = BaseActionInput.extend(
|
|
4962
|
-
|
|
4963
|
-
type:
|
|
4966
|
+
z39.object({
|
|
4967
|
+
type: z39.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
4964
4968
|
/**
|
|
4965
4969
|
* Archiving does not collect a reason on its own. Only the
|
|
4966
4970
|
* "mark as duplicate" flow archives with a reason attached.
|
|
@@ -4969,54 +4973,54 @@ var ArchiveActionInput = BaseActionInput.extend(
|
|
|
4969
4973
|
}).shape
|
|
4970
4974
|
);
|
|
4971
4975
|
var UnarchiveActionInput = BaseActionInput.extend(
|
|
4972
|
-
|
|
4973
|
-
type:
|
|
4976
|
+
z39.object({
|
|
4977
|
+
type: z39.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
|
|
4974
4978
|
}).shape
|
|
4975
4979
|
);
|
|
4976
4980
|
var AssignActionInput = BaseActionInput.extend(
|
|
4977
|
-
|
|
4978
|
-
type:
|
|
4979
|
-
assignedTo:
|
|
4981
|
+
z39.object({
|
|
4982
|
+
type: z39.literal(ActionType.ASSIGN),
|
|
4983
|
+
assignedTo: z39.string()
|
|
4980
4984
|
}).shape
|
|
4981
4985
|
);
|
|
4982
4986
|
var UnassignActionInput = BaseActionInput.extend(
|
|
4983
|
-
|
|
4984
|
-
type:
|
|
4985
|
-
assignedTo:
|
|
4987
|
+
z39.object({
|
|
4988
|
+
type: z39.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
4989
|
+
assignedTo: z39.literal(null).default(null)
|
|
4986
4990
|
}).shape
|
|
4987
4991
|
);
|
|
4988
4992
|
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
4989
|
-
|
|
4990
|
-
type:
|
|
4993
|
+
z39.object({
|
|
4994
|
+
type: z39.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
4991
4995
|
}).shape
|
|
4992
4996
|
);
|
|
4993
4997
|
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
4994
|
-
|
|
4995
|
-
requestId:
|
|
4996
|
-
type:
|
|
4998
|
+
z39.object({
|
|
4999
|
+
requestId: z39.string(),
|
|
5000
|
+
type: z39.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
4997
5001
|
content: ReasonContent
|
|
4998
5002
|
}).shape
|
|
4999
5003
|
);
|
|
5000
5004
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
5001
|
-
|
|
5002
|
-
requestId:
|
|
5003
|
-
type:
|
|
5004
|
-
content:
|
|
5005
|
+
z39.object({
|
|
5006
|
+
requestId: z39.string(),
|
|
5007
|
+
type: z39.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
5008
|
+
content: z39.object({ immediateCorrection: z39.boolean().optional() }).optional()
|
|
5005
5009
|
}).shape
|
|
5006
5010
|
);
|
|
5007
5011
|
var ReadActionInput = BaseActionInput.extend(
|
|
5008
|
-
|
|
5009
|
-
type:
|
|
5012
|
+
z39.object({
|
|
5013
|
+
type: z39.literal(ActionType.READ).default(ActionType.READ)
|
|
5010
5014
|
}).shape
|
|
5011
5015
|
);
|
|
5012
|
-
var DeleteActionInput =
|
|
5016
|
+
var DeleteActionInput = z39.object({ eventId: UUID });
|
|
5013
5017
|
var CustomActionInput = BaseActionInput.extend(
|
|
5014
|
-
|
|
5015
|
-
type:
|
|
5016
|
-
customActionType:
|
|
5018
|
+
z39.object({
|
|
5019
|
+
type: z39.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
5020
|
+
customActionType: z39.string().describe("Name of the custom action.")
|
|
5017
5021
|
}).shape
|
|
5018
5022
|
);
|
|
5019
|
-
var ActionInput =
|
|
5023
|
+
var ActionInput = z39.discriminatedUnion("type", [
|
|
5020
5024
|
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
5021
5025
|
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
5022
5026
|
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
@@ -5053,11 +5057,11 @@ var ActionInput = z38.discriminatedUnion("type", [
|
|
|
5053
5057
|
});
|
|
5054
5058
|
|
|
5055
5059
|
// ../commons/src/events/Draft.ts
|
|
5056
|
-
var Draft =
|
|
5060
|
+
var Draft = z40.object({
|
|
5057
5061
|
id: UUID,
|
|
5058
5062
|
eventId: UUID,
|
|
5059
|
-
transactionId:
|
|
5060
|
-
createdAt:
|
|
5063
|
+
transactionId: z40.string(),
|
|
5064
|
+
createdAt: z40.string().datetime(),
|
|
5061
5065
|
action: ActionBase.extend({
|
|
5062
5066
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
5063
5067
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -5066,7 +5070,7 @@ var Draft = z39.object({
|
|
|
5066
5070
|
);
|
|
5067
5071
|
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
5068
5072
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
5069
|
-
status:
|
|
5073
|
+
status: z40.enum([
|
|
5070
5074
|
ActionStatus.Requested,
|
|
5071
5075
|
ActionStatus.Accepted,
|
|
5072
5076
|
ActionStatus.Rejected
|
|
@@ -5074,30 +5078,33 @@ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
|
5074
5078
|
});
|
|
5075
5079
|
|
|
5076
5080
|
// ../commons/src/events/EventInput.ts
|
|
5077
|
-
var
|
|
5081
|
+
var z41 = __toESM(require("zod/v4"));
|
|
5078
5082
|
var import_uuid11 = require("uuid");
|
|
5079
|
-
var EventInput =
|
|
5080
|
-
transactionId:
|
|
5081
|
-
type:
|
|
5083
|
+
var EventInput = z41.object({
|
|
5084
|
+
transactionId: z41.string(),
|
|
5085
|
+
type: z41.string(),
|
|
5082
5086
|
createdAtLocation: UUID.nullish().describe(
|
|
5083
5087
|
"Location where the event occurred. Required for system users."
|
|
5084
5088
|
)
|
|
5085
5089
|
}).meta({ default: { transactionId: (0, import_uuid11.v4)(), type: "birth" } });
|
|
5086
5090
|
|
|
5087
5091
|
// ../commons/src/events/EventDocument.ts
|
|
5088
|
-
var
|
|
5089
|
-
var EventDocument =
|
|
5092
|
+
var z42 = __toESM(require("zod/v4"));
|
|
5093
|
+
var EventDocument = z42.object({
|
|
5090
5094
|
id: UUID.describe("Unique identifier of the event."),
|
|
5091
|
-
type:
|
|
5092
|
-
createdAt:
|
|
5093
|
-
updatedAt:
|
|
5095
|
+
type: z42.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
5096
|
+
createdAt: z42.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
5097
|
+
updatedAt: z42.string().datetime().describe(
|
|
5094
5098
|
"Timestamp of the last update, excluding changes from actions."
|
|
5095
5099
|
),
|
|
5096
|
-
actions:
|
|
5097
|
-
trackingId:
|
|
5100
|
+
actions: z42.array(Action).describe("Ordered list of actions associated with the event."),
|
|
5101
|
+
trackingId: z42.string().describe(
|
|
5098
5102
|
"System-generated tracking identifier used to look up the event."
|
|
5099
5103
|
)
|
|
5100
5104
|
}).meta({ id: "EventDocument" });
|
|
5105
|
+
var EventDocumentOnlyLastAction = EventDocument.extend({
|
|
5106
|
+
actions: z42.array(Action).max(1).describe("Only the last action associated with the event.")
|
|
5107
|
+
}).brand("EventDocumentOnlyLastAction");
|
|
5101
5108
|
|
|
5102
5109
|
// ../commons/src/events/defineConfig.ts
|
|
5103
5110
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -7548,8 +7555,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
7548
7555
|
});
|
|
7549
7556
|
|
|
7550
7557
|
// ../commons/src/events/test.utils.ts
|
|
7551
|
-
var
|
|
7552
|
-
var TestUserRole =
|
|
7558
|
+
var z43 = __toESM(require("zod/v4"));
|
|
7559
|
+
var TestUserRole = z43.enum([
|
|
7553
7560
|
"FIELD_AGENT",
|
|
7554
7561
|
"LOCAL_REGISTRAR",
|
|
7555
7562
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -7565,36 +7572,36 @@ var TestUserRole = z42.enum([
|
|
|
7565
7572
|
var import_lodash6 = require("lodash");
|
|
7566
7573
|
|
|
7567
7574
|
// ../commons/src/events/locations.ts
|
|
7568
|
-
var
|
|
7569
|
-
var LocationTypeV1 =
|
|
7575
|
+
var z44 = __toESM(require("zod/v4"));
|
|
7576
|
+
var LocationTypeV1 = z44.enum([
|
|
7570
7577
|
"ADMIN_STRUCTURE",
|
|
7571
7578
|
"CRVS_OFFICE",
|
|
7572
7579
|
"HEALTH_FACILITY"
|
|
7573
7580
|
]);
|
|
7574
|
-
var LocationStatus =
|
|
7575
|
-
var LocationVersion =
|
|
7581
|
+
var LocationStatus = z44.enum(["active", "inactive"]);
|
|
7582
|
+
var LocationVersion = z44.object({
|
|
7576
7583
|
versionId: UUID,
|
|
7577
|
-
effectiveFrom:
|
|
7578
|
-
name:
|
|
7579
|
-
externalId:
|
|
7584
|
+
effectiveFrom: z44.iso.date(),
|
|
7585
|
+
name: z44.string(),
|
|
7586
|
+
externalId: z44.string().nullish(),
|
|
7580
7587
|
status: LocationStatus
|
|
7581
7588
|
});
|
|
7582
|
-
var AdministrativeArea =
|
|
7589
|
+
var AdministrativeArea = z44.object({
|
|
7583
7590
|
id: UUID,
|
|
7584
|
-
name:
|
|
7585
|
-
externalId:
|
|
7591
|
+
name: z44.string(),
|
|
7592
|
+
externalId: z44.string().nullish(),
|
|
7586
7593
|
parentId: UUID.nullable(),
|
|
7587
7594
|
status: LocationStatus,
|
|
7588
|
-
versions:
|
|
7595
|
+
versions: z44.array(LocationVersion)
|
|
7589
7596
|
});
|
|
7590
|
-
var Location =
|
|
7597
|
+
var Location = z44.object({
|
|
7591
7598
|
id: UUID,
|
|
7592
|
-
name:
|
|
7593
|
-
externalId:
|
|
7599
|
+
name: z44.string(),
|
|
7600
|
+
externalId: z44.string().nullish(),
|
|
7594
7601
|
administrativeAreaId: UUID.nullable(),
|
|
7595
|
-
locationType:
|
|
7602
|
+
locationType: z44.string().nullable(),
|
|
7596
7603
|
status: LocationStatus,
|
|
7597
|
-
versions:
|
|
7604
|
+
versions: z44.array(LocationVersion)
|
|
7598
7605
|
});
|
|
7599
7606
|
var ClientAdministrativeArea = AdministrativeArea.omit({
|
|
7600
7607
|
name: true,
|
|
@@ -7635,22 +7642,22 @@ function validateUniqueIds(versions, ctx) {
|
|
|
7635
7642
|
ctx.addIssue("versions must not repeat a versionId");
|
|
7636
7643
|
}
|
|
7637
7644
|
}
|
|
7638
|
-
var SeededLocationVersions =
|
|
7645
|
+
var SeededLocationVersions = z44.array(LocationVersion).min(1).superRefine((versions, ctx) => {
|
|
7639
7646
|
validateAscendingDates(versions, ctx);
|
|
7640
7647
|
validateUniqueIds(versions, ctx);
|
|
7641
7648
|
});
|
|
7642
|
-
var SetLocationPayload =
|
|
7649
|
+
var SetLocationPayload = z44.object({
|
|
7643
7650
|
id: UUID,
|
|
7644
|
-
name:
|
|
7645
|
-
externalId:
|
|
7651
|
+
name: z44.string(),
|
|
7652
|
+
externalId: z44.string().nullish(),
|
|
7646
7653
|
administrativeAreaId: UUID.nullable(),
|
|
7647
|
-
locationType:
|
|
7654
|
+
locationType: z44.string().nullable(),
|
|
7648
7655
|
versions: SeededLocationVersions.optional()
|
|
7649
7656
|
});
|
|
7650
|
-
var SetAdministrativeAreaPayload =
|
|
7657
|
+
var SetAdministrativeAreaPayload = z44.object({
|
|
7651
7658
|
id: UUID,
|
|
7652
|
-
name:
|
|
7653
|
-
externalId:
|
|
7659
|
+
name: z44.string(),
|
|
7660
|
+
externalId: z44.string().nullish(),
|
|
7654
7661
|
parentId: UUID.nullable(),
|
|
7655
7662
|
versions: SeededLocationVersions.optional()
|
|
7656
7663
|
});
|
|
@@ -8093,92 +8100,55 @@ var V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
|
8093
8100
|
);
|
|
8094
8101
|
|
|
8095
8102
|
// ../commons/src/events/locationPayloads.ts
|
|
8096
|
-
var
|
|
8097
|
-
var CreateLocationPayload =
|
|
8103
|
+
var z45 = __toESM(require("zod/v4"));
|
|
8104
|
+
var CreateLocationPayload = z45.object({
|
|
8098
8105
|
id: UUID.optional(),
|
|
8099
8106
|
versionId: UUID.optional(),
|
|
8100
|
-
name:
|
|
8101
|
-
externalId:
|
|
8107
|
+
name: z45.string(),
|
|
8108
|
+
externalId: z45.string().nullish(),
|
|
8102
8109
|
administrativeAreaId: UUID.nullable(),
|
|
8103
|
-
locationType:
|
|
8104
|
-
effectiveFrom:
|
|
8110
|
+
locationType: z45.string().nullable(),
|
|
8111
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
8105
8112
|
status: LocationStatus.default("active")
|
|
8106
8113
|
});
|
|
8107
|
-
var UpdateLocationPayload =
|
|
8114
|
+
var UpdateLocationPayload = z45.strictObject({
|
|
8108
8115
|
id: UUID,
|
|
8109
8116
|
versionId: UUID.optional(),
|
|
8110
|
-
name:
|
|
8111
|
-
externalId:
|
|
8117
|
+
name: z45.string(),
|
|
8118
|
+
externalId: z45.string().nullish(),
|
|
8112
8119
|
status: LocationStatus,
|
|
8113
|
-
effectiveFrom:
|
|
8120
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
8114
8121
|
lastVersionId: UUID
|
|
8115
8122
|
});
|
|
8116
|
-
var WithdrawLocationVersionPayload =
|
|
8123
|
+
var WithdrawLocationVersionPayload = z45.object({
|
|
8117
8124
|
id: UUID,
|
|
8118
8125
|
versionId: UUID
|
|
8119
8126
|
});
|
|
8120
|
-
var CreateAdministrativeAreaPayload =
|
|
8127
|
+
var CreateAdministrativeAreaPayload = z45.object({
|
|
8121
8128
|
id: UUID.optional(),
|
|
8122
8129
|
versionId: UUID.optional(),
|
|
8123
|
-
name:
|
|
8124
|
-
externalId:
|
|
8130
|
+
name: z45.string(),
|
|
8131
|
+
externalId: z45.string().nullish(),
|
|
8125
8132
|
parentId: UUID.nullable(),
|
|
8126
|
-
effectiveFrom:
|
|
8133
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
8127
8134
|
status: LocationStatus.default("active")
|
|
8128
8135
|
});
|
|
8129
|
-
var UpdateAdministrativeAreaPayload =
|
|
8136
|
+
var UpdateAdministrativeAreaPayload = z45.strictObject({
|
|
8130
8137
|
id: UUID,
|
|
8131
8138
|
versionId: UUID.optional(),
|
|
8132
|
-
name:
|
|
8133
|
-
externalId:
|
|
8139
|
+
name: z45.string(),
|
|
8140
|
+
externalId: z45.string().nullish(),
|
|
8134
8141
|
status: LocationStatus,
|
|
8135
|
-
effectiveFrom:
|
|
8142
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
8136
8143
|
lastVersionId: UUID
|
|
8137
8144
|
});
|
|
8138
|
-
var WithdrawAdministrativeAreaVersionPayload =
|
|
8145
|
+
var WithdrawAdministrativeAreaVersionPayload = z45.object({
|
|
8139
8146
|
id: UUID,
|
|
8140
8147
|
versionId: UUID
|
|
8141
8148
|
});
|
|
8142
8149
|
|
|
8143
|
-
// ../commons/src/logger.ts
|
|
8144
|
-
var import_pino = __toESM(require("pino"));
|
|
8145
|
-
function filterHealthCheckLogs(args, method) {
|
|
8146
|
-
const logger2 = this;
|
|
8147
|
-
for (const arg of args) {
|
|
8148
|
-
if (typeof arg === "string" && arg.includes("get /ping 200")) {
|
|
8149
|
-
if (logger2.debug) {
|
|
8150
|
-
return logger2.debug(...args);
|
|
8151
|
-
}
|
|
8152
|
-
}
|
|
8153
|
-
}
|
|
8154
|
-
return method.apply(this, args);
|
|
8155
|
-
}
|
|
8156
|
-
var logger = false ? (0, import_pino.default)({
|
|
8157
|
-
level: "info",
|
|
8158
|
-
redact: [
|
|
8159
|
-
"req.headers.authorization",
|
|
8160
|
-
"req.remoteAddress",
|
|
8161
|
-
"req.headers['x-real-ip']"
|
|
8162
|
-
],
|
|
8163
|
-
hooks: { logMethod: filterHealthCheckLogs }
|
|
8164
|
-
}) : (0, import_pino.default)({
|
|
8165
|
-
level: "debug",
|
|
8166
|
-
transport: {
|
|
8167
|
-
target: "pino-pretty",
|
|
8168
|
-
options: {
|
|
8169
|
-
colorize: true,
|
|
8170
|
-
ignore: "pid,hostname"
|
|
8171
|
-
}
|
|
8172
|
-
},
|
|
8173
|
-
hooks: { logMethod: filterHealthCheckLogs }
|
|
8174
|
-
});
|
|
8175
|
-
var level = false ? "silent" : process.env.LOG_LEVEL;
|
|
8176
|
-
if (level) {
|
|
8177
|
-
logger.level = level;
|
|
8178
|
-
}
|
|
8179
|
-
|
|
8180
8150
|
// ../commons/src/notification/UserNotifications.ts
|
|
8181
|
-
var
|
|
8151
|
+
var z46 = __toESM(require("zod/v4"));
|
|
8182
8152
|
var TriggerEvent = {
|
|
8183
8153
|
USER_CREATED: "user-created",
|
|
8184
8154
|
USER_UPDATED: "user-updated",
|
|
@@ -8193,62 +8163,136 @@ var TriggerEvent = {
|
|
|
8193
8163
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
8194
8164
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
8195
8165
|
};
|
|
8196
|
-
var Recipient =
|
|
8166
|
+
var Recipient = z46.object({
|
|
8197
8167
|
name: NameFieldValue.optional(),
|
|
8198
|
-
mobile:
|
|
8199
|
-
email:
|
|
8200
|
-
bcc:
|
|
8168
|
+
mobile: z46.string().optional(),
|
|
8169
|
+
email: z46.string().optional(),
|
|
8170
|
+
bcc: z46.array(z46.string()).optional()
|
|
8201
8171
|
});
|
|
8202
|
-
var BasePayload =
|
|
8172
|
+
var BasePayload = z46.object({
|
|
8203
8173
|
recipient: Recipient
|
|
8204
8174
|
});
|
|
8205
8175
|
var TriggerPayload = {
|
|
8206
8176
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
8207
|
-
username:
|
|
8208
|
-
temporaryPassword:
|
|
8177
|
+
username: z46.string(),
|
|
8178
|
+
temporaryPassword: z46.string()
|
|
8209
8179
|
}),
|
|
8210
8180
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
8211
|
-
oldUsername:
|
|
8212
|
-
newUsername:
|
|
8181
|
+
oldUsername: z46.string(),
|
|
8182
|
+
newUsername: z46.string()
|
|
8213
8183
|
}),
|
|
8214
8184
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
8215
|
-
username:
|
|
8185
|
+
username: z46.string()
|
|
8216
8186
|
}),
|
|
8217
8187
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
8218
|
-
code:
|
|
8188
|
+
code: z46.string()
|
|
8219
8189
|
}),
|
|
8220
8190
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
8221
|
-
temporaryPassword:
|
|
8222
|
-
admin:
|
|
8223
|
-
id:
|
|
8191
|
+
temporaryPassword: z46.string(),
|
|
8192
|
+
admin: z46.object({
|
|
8193
|
+
id: z46.string(),
|
|
8224
8194
|
name: NameFieldValue,
|
|
8225
|
-
role:
|
|
8195
|
+
role: z46.string()
|
|
8226
8196
|
})
|
|
8227
8197
|
}),
|
|
8228
8198
|
[TriggerEvent.PASSWORD_RESET_LINK]: BasePayload.extend({
|
|
8229
|
-
token:
|
|
8199
|
+
token: z46.string()
|
|
8230
8200
|
}),
|
|
8231
8201
|
[TriggerEvent.USERNAME_REMINDER_LINK]: BasePayload.extend({
|
|
8232
|
-
token:
|
|
8202
|
+
token: z46.string()
|
|
8233
8203
|
}),
|
|
8234
8204
|
[TriggerEvent.RESEND_INVITE]: BasePayload.extend({
|
|
8235
|
-
username:
|
|
8236
|
-
temporaryPassword:
|
|
8205
|
+
username: z46.string(),
|
|
8206
|
+
temporaryPassword: z46.string()
|
|
8237
8207
|
}),
|
|
8238
8208
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
8239
|
-
code:
|
|
8209
|
+
code: z46.string()
|
|
8240
8210
|
}),
|
|
8241
8211
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
8242
|
-
subject:
|
|
8243
|
-
body:
|
|
8212
|
+
subject: z46.string(),
|
|
8213
|
+
body: z46.string()
|
|
8244
8214
|
}),
|
|
8245
8215
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
8246
|
-
code:
|
|
8216
|
+
code: z46.string()
|
|
8247
8217
|
}),
|
|
8248
8218
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
8249
|
-
code:
|
|
8219
|
+
code: z46.string()
|
|
8250
8220
|
})
|
|
8251
8221
|
};
|
|
8222
|
+
function parseUserEventTrigger(event2, body) {
|
|
8223
|
+
const schema = TriggerPayload[event2];
|
|
8224
|
+
return schema.parse(body);
|
|
8225
|
+
}
|
|
8226
|
+
|
|
8227
|
+
// ../commons/src/url.ts
|
|
8228
|
+
function joinUrl(base, path) {
|
|
8229
|
+
const baseWithSlash = base.endsWith("/") ? base : base + "/";
|
|
8230
|
+
return new URL(path, baseWithSlash);
|
|
8231
|
+
}
|
|
8232
|
+
|
|
8233
|
+
// ../commons/src/logger.ts
|
|
8234
|
+
var import_pino = __toESM(require("pino"));
|
|
8235
|
+
function normalizeLogArgs(args) {
|
|
8236
|
+
const [first, ...rest] = args;
|
|
8237
|
+
if (typeof first !== "string" || rest.length === 0) {
|
|
8238
|
+
return args;
|
|
8239
|
+
}
|
|
8240
|
+
const mergingObject = {};
|
|
8241
|
+
const primitives = [];
|
|
8242
|
+
for (const arg of rest) {
|
|
8243
|
+
if (arg instanceof Error) {
|
|
8244
|
+
mergingObject.err = import_pino.default.stdSerializers.err(arg);
|
|
8245
|
+
} else if (arg !== null && typeof arg === "object") {
|
|
8246
|
+
Object.assign(mergingObject, arg);
|
|
8247
|
+
} else {
|
|
8248
|
+
primitives.push(arg);
|
|
8249
|
+
}
|
|
8250
|
+
}
|
|
8251
|
+
const message = primitives.length ? `${first} ${primitives.join(" ")}` : first;
|
|
8252
|
+
return Object.keys(mergingObject).length ? [mergingObject, message] : [message];
|
|
8253
|
+
}
|
|
8254
|
+
function filterHealthCheckLogs(args, method) {
|
|
8255
|
+
const logger2 = this;
|
|
8256
|
+
for (const arg of args) {
|
|
8257
|
+
if (typeof arg === "string" && arg.includes("get /ping 200")) {
|
|
8258
|
+
if (logger2.debug) {
|
|
8259
|
+
return logger2.debug(...args);
|
|
8260
|
+
}
|
|
8261
|
+
}
|
|
8262
|
+
}
|
|
8263
|
+
return method.apply(this, normalizeLogArgs(args));
|
|
8264
|
+
}
|
|
8265
|
+
function buildLoggerOptions() {
|
|
8266
|
+
return {
|
|
8267
|
+
serializers: { err: import_pino.default.stdSerializers.err },
|
|
8268
|
+
hooks: { logMethod: filterHealthCheckLogs }
|
|
8269
|
+
};
|
|
8270
|
+
}
|
|
8271
|
+
var logger = false ? (0, import_pino.default)({
|
|
8272
|
+
level: "info",
|
|
8273
|
+
redact: [
|
|
8274
|
+
"req.headers.authorization",
|
|
8275
|
+
"req.remoteAddress",
|
|
8276
|
+
"req.headers['x-real-ip']"
|
|
8277
|
+
],
|
|
8278
|
+
...buildLoggerOptions()
|
|
8279
|
+
}) : (0, import_pino.default)({
|
|
8280
|
+
level: "debug",
|
|
8281
|
+
transport: {
|
|
8282
|
+
target: "pino-pretty",
|
|
8283
|
+
options: {
|
|
8284
|
+
colorize: true,
|
|
8285
|
+
ignore: "pid,hostname"
|
|
8286
|
+
}
|
|
8287
|
+
},
|
|
8288
|
+
...buildLoggerOptions()
|
|
8289
|
+
});
|
|
8290
|
+
var level = false ? "silent" : process.env.LOG_LEVEL;
|
|
8291
|
+
if (level) {
|
|
8292
|
+
logger.level = level;
|
|
8293
|
+
}
|
|
8294
|
+
|
|
8295
|
+
// ../commons/src/notification/dispatch.ts
|
|
8252
8296
|
async function triggerUserEventNotification({
|
|
8253
8297
|
event: event2,
|
|
8254
8298
|
payload,
|
|
@@ -8273,10 +8317,6 @@ async function triggerUserEventNotification({
|
|
|
8273
8317
|
}
|
|
8274
8318
|
return response;
|
|
8275
8319
|
}
|
|
8276
|
-
function parseUserEventTrigger(event2, body) {
|
|
8277
|
-
const schema = TriggerPayload[event2];
|
|
8278
|
-
return schema.parse(body);
|
|
8279
|
-
}
|
|
8280
8320
|
|
|
8281
8321
|
// src/notification/index.ts
|
|
8282
|
-
|
|
8322
|
+
z47.globalRegistry.clear();
|