@opencrvs/toolkit 2.1.0-rc.ecb508d → 2.1.0-rc.f383722
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/.nx/cache/file-map.json +360 -0
- package/.nx/cache/project-graph.json +6 -0
- package/dist/application-config/index.js +1 -0
- package/dist/commons/api/router.d.ts +85 -0
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/AuditLog.d.ts +37 -0
- package/dist/commons/events/EventIndex.d.ts +2 -2
- package/dist/commons/events/FieldConfig.d.ts +6 -1
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +7 -0
- package/dist/conditionals/index.js +1 -0
- package/dist/environment/logger.d.ts +12 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/events/index.js +88 -0
- package/dist/notification/index.js +99 -25
- package/dist/scopes/index.d.ts +28 -26
- package/dist/scopes/index.js +1 -0
- package/opencrvs-toolkit-2.1.0-rc.f383722.tgz +0 -0
- package/package.json +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.ecb508d.tgz +0 -0
|
@@ -45,6 +45,7 @@ export * from './field';
|
|
|
45
45
|
export * from './Flag';
|
|
46
46
|
export * from './event';
|
|
47
47
|
export * from './locations';
|
|
48
|
+
export * from './locationPayloads';
|
|
48
49
|
export { UUID } from '../uuid';
|
|
49
50
|
export { DocumentPath } from '../documents';
|
|
50
51
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* Input payload for creating a location: the identity fields (parent and
|
|
4
|
+
* locationType are set once, immutable thereafter) plus the first version.
|
|
5
|
+
* `id` and `versionId` may be supplied by the caller for idempotent retries.
|
|
6
|
+
* `effectiveFrom` defaults to the beginning-of-time sentinel on the server.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CreateLocationPayload: z.ZodObject<{
|
|
9
|
+
id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
10
|
+
versionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
14
|
+
locationType: z.ZodNullable<z.ZodString>;
|
|
15
|
+
effectiveFrom: z.ZodOptional<z.ZodISODate>;
|
|
16
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
17
|
+
active: "active";
|
|
18
|
+
inactive: "inactive";
|
|
19
|
+
}>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type CreateLocationPayload = z.infer<typeof CreateLocationPayload>;
|
|
22
|
+
/**
|
|
23
|
+
* Input payload for appending a new version to a location. A full snapshot of
|
|
24
|
+
* every versioned field is required — omitted does not mean unchanged. The
|
|
25
|
+
* schema is strict: identity fields (`administrativeAreaId`, `locationType`)
|
|
26
|
+
* are rejected rather than ignored, as they cannot change. `lastVersionId`
|
|
27
|
+
* is the optimistic-concurrency check: it must be the id of the last element
|
|
28
|
+
* the caller observed. `effectiveFrom` defaults to today on the server;
|
|
29
|
+
* supply it explicitly for idempotent retries.
|
|
30
|
+
*/
|
|
31
|
+
export declare const UpdateLocationPayload: z.ZodObject<{
|
|
32
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
33
|
+
versionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
status: z.ZodEnum<{
|
|
37
|
+
active: "active";
|
|
38
|
+
inactive: "inactive";
|
|
39
|
+
}>;
|
|
40
|
+
effectiveFrom: z.ZodOptional<z.ZodISODate>;
|
|
41
|
+
lastVersionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export type UpdateLocationPayload = z.infer<typeof UpdateLocationPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Input payload for withdrawing a pending (future-dated) version element.
|
|
46
|
+
* Only elements whose `effectiveFrom` has not yet passed can be withdrawn.
|
|
47
|
+
*/
|
|
48
|
+
export declare const WithdrawLocationVersionPayload: z.ZodObject<{
|
|
49
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
50
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type WithdrawLocationVersionPayload = z.infer<typeof WithdrawLocationVersionPayload>;
|
|
53
|
+
/**
|
|
54
|
+
* Administrative-area twin of {@link CreateLocationPayload}: `parentId`
|
|
55
|
+
* instead of `administrativeAreaId`, no `locationType`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const CreateAdministrativeAreaPayload: z.ZodObject<{
|
|
58
|
+
id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
59
|
+
versionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
63
|
+
effectiveFrom: z.ZodOptional<z.ZodISODate>;
|
|
64
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
65
|
+
active: "active";
|
|
66
|
+
inactive: "inactive";
|
|
67
|
+
}>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type CreateAdministrativeAreaPayload = z.infer<typeof CreateAdministrativeAreaPayload>;
|
|
70
|
+
/**
|
|
71
|
+
* Administrative-area twin of {@link UpdateLocationPayload} — strict for the
|
|
72
|
+
* same reason: the identity field (`parentId`) is rejected, not ignored.
|
|
73
|
+
*/
|
|
74
|
+
export declare const UpdateAdministrativeAreaPayload: z.ZodObject<{
|
|
75
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
76
|
+
versionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
status: z.ZodEnum<{
|
|
80
|
+
active: "active";
|
|
81
|
+
inactive: "inactive";
|
|
82
|
+
}>;
|
|
83
|
+
effectiveFrom: z.ZodOptional<z.ZodISODate>;
|
|
84
|
+
lastVersionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export type UpdateAdministrativeAreaPayload = z.infer<typeof UpdateAdministrativeAreaPayload>;
|
|
87
|
+
/**
|
|
88
|
+
* Administrative-area twin of {@link WithdrawLocationVersionPayload}.
|
|
89
|
+
*/
|
|
90
|
+
export declare const WithdrawAdministrativeAreaVersionPayload: z.ZodObject<{
|
|
91
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
92
|
+
versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export type WithdrawAdministrativeAreaVersionPayload = z.infer<typeof WithdrawAdministrativeAreaVersionPayload>;
|
|
95
|
+
//# sourceMappingURL=locationPayloads.d.ts.map
|
|
@@ -111,6 +111,13 @@ export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaP
|
|
|
111
111
|
export declare function resolveVersion<T extends {
|
|
112
112
|
effectiveFrom: string;
|
|
113
113
|
}>(versions: T[], anchor: string): T;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the entity holds the given externalId with active status at the
|
|
116
|
+
* anchor date or at any point after it. Used for point-in-time uniqueness of
|
|
117
|
+
* external codes: a new holder starting at `anchor` collides when an existing
|
|
118
|
+
* holder is (or is scheduled to be) active with the code from then on.
|
|
119
|
+
*/
|
|
120
|
+
export declare function hasActiveExternalIdOnOrAfter(versions: LocationVersion[], externalId: string, anchor: string): boolean;
|
|
114
121
|
type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
|
|
115
122
|
/**
|
|
116
123
|
* For type T, convert fields K to arrays. If field is string, convert to string[].
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
export declare const log:
|
|
2
|
-
|
|
1
|
+
export declare const log: {
|
|
2
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
3
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
4
|
+
};
|
|
5
|
+
export declare const warn: {
|
|
6
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
7
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
8
|
+
};
|
|
3
9
|
export declare const success: (...args: any[]) => void;
|
|
4
|
-
export declare const info:
|
|
10
|
+
export declare const info: {
|
|
11
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
12
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
13
|
+
};
|
|
5
14
|
export declare const error: (...args: any[]) => void;
|
|
6
15
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/environment/logger.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/environment/logger.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,GAAG;;;CAAc,CAAA;AAC9B,eAAO,MAAM,IAAI;;;CAAe,CAAA;AAChC,eAAO,MAAM,OAAO,YAAa,GAAG,EAAE,SACI,CAAA;AAC1C,eAAO,MAAM,IAAI;;;CAAe,CAAA;AAChC,eAAO,MAAM,KAAK,YAAa,GAAG,EAAE,SAA2C,CAAA"}
|
package/dist/events/index.js
CHANGED
|
@@ -80,6 +80,8 @@ __export(events_exports, {
|
|
|
80
80
|
ConditionalType: () => ConditionalType,
|
|
81
81
|
ConfirmableActions: () => ConfirmableActions,
|
|
82
82
|
ContainsFlags: () => ContainsFlags,
|
|
83
|
+
CreateAdministrativeAreaPayload: () => CreateAdministrativeAreaPayload,
|
|
84
|
+
CreateLocationPayload: () => CreateLocationPayload,
|
|
83
85
|
CustomActionInput: () => CustomActionInput,
|
|
84
86
|
CustomFieldValue: () => CustomFieldValue,
|
|
85
87
|
CustomFlag: () => CustomFlag,
|
|
@@ -220,6 +222,8 @@ __export(events_exports, {
|
|
|
220
222
|
UUID: () => UUID,
|
|
221
223
|
UnarchiveActionInput: () => UnarchiveActionInput,
|
|
222
224
|
UnassignActionInput: () => UnassignActionInput,
|
|
225
|
+
UpdateAdministrativeAreaPayload: () => UpdateAdministrativeAreaPayload,
|
|
226
|
+
UpdateLocationPayload: () => UpdateLocationPayload,
|
|
223
227
|
UserAuditRecordInput: () => UserAuditRecordInput,
|
|
224
228
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS,
|
|
225
229
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP,
|
|
@@ -229,6 +233,8 @@ __export(events_exports, {
|
|
|
229
233
|
VerificationActionConfig: () => VerificationActionConfig,
|
|
230
234
|
VerificationPageConfig: () => VerificationPageConfig,
|
|
231
235
|
VerificationStatusValue: () => VerificationStatusValue,
|
|
236
|
+
WithdrawAdministrativeAreaVersionPayload: () => WithdrawAdministrativeAreaVersionPayload,
|
|
237
|
+
WithdrawLocationVersionPayload: () => WithdrawLocationVersionPayload,
|
|
232
238
|
Within: () => Within,
|
|
233
239
|
WorkqueueActionType: () => WorkqueueActionType,
|
|
234
240
|
WorkqueueColumn: () => WorkqueueColumn,
|
|
@@ -347,6 +353,7 @@ __export(events_exports, {
|
|
|
347
353
|
getStatusFromActions: () => getStatusFromActions,
|
|
348
354
|
getValidatorsForField: () => getValidatorsForField,
|
|
349
355
|
getVisibleVerificationPageIds: () => getVisibleVerificationPageIds,
|
|
356
|
+
hasActiveExternalIdOnOrAfter: () => hasActiveExternalIdOnOrAfter,
|
|
350
357
|
hasAnyOfScopes: () => hasAnyOfScopes,
|
|
351
358
|
isActionAvailable: () => isActionAvailable,
|
|
352
359
|
isActionConfigType: () => isActionConfigType,
|
|
@@ -505,6 +512,7 @@ var PlainScopeType = z2.enum([
|
|
|
505
512
|
"integration.create",
|
|
506
513
|
"record.import",
|
|
507
514
|
"config.update-all",
|
|
515
|
+
"location.edit",
|
|
508
516
|
"attachment.upload",
|
|
509
517
|
"profile.electronic-signature",
|
|
510
518
|
"user.read-only-my-audit",
|
|
@@ -987,6 +995,29 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
|
987
995
|
requestData: z5.object({ id: z5.string() }),
|
|
988
996
|
responseSummary: z5.object({ clientId: z5.string() })
|
|
989
997
|
});
|
|
998
|
+
var createdVersionFields = {
|
|
999
|
+
id: z5.string(),
|
|
1000
|
+
versionId: z5.string(),
|
|
1001
|
+
name: z5.string(),
|
|
1002
|
+
externalId: z5.string().nullish(),
|
|
1003
|
+
effectiveFrom: z5.string(),
|
|
1004
|
+
status: z5.string()
|
|
1005
|
+
};
|
|
1006
|
+
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1007
|
+
operation: z5.literal("locations.create"),
|
|
1008
|
+
requestData: z5.object({
|
|
1009
|
+
...createdVersionFields,
|
|
1010
|
+
administrativeAreaId: z5.string().nullish(),
|
|
1011
|
+
locationType: z5.string().nullish()
|
|
1012
|
+
})
|
|
1013
|
+
});
|
|
1014
|
+
var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1015
|
+
operation: z5.literal("administrativeAreas.create"),
|
|
1016
|
+
requestData: z5.object({
|
|
1017
|
+
...createdVersionFields,
|
|
1018
|
+
parentId: z5.string().nullish()
|
|
1019
|
+
})
|
|
1020
|
+
});
|
|
990
1021
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
991
1022
|
operation: z5.literal("attachments.upload"),
|
|
992
1023
|
requestData: z5.object({
|
|
@@ -1062,6 +1093,8 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
|
|
|
1062
1093
|
IntegrationActivateEntrySchema,
|
|
1063
1094
|
IntegrationDeleteEntrySchema,
|
|
1064
1095
|
IntegrationRefreshSecretEntrySchema,
|
|
1096
|
+
LocationCreateEntrySchema,
|
|
1097
|
+
AdministrativeAreaCreateEntrySchema,
|
|
1065
1098
|
AttachmentUploadEntrySchema,
|
|
1066
1099
|
UserCreateEntrySchema,
|
|
1067
1100
|
UserReasonEntrySchema,
|
|
@@ -10518,6 +10551,13 @@ function resolveVersion(versions, anchor) {
|
|
|
10518
10551
|
}
|
|
10519
10552
|
return resolved;
|
|
10520
10553
|
}
|
|
10554
|
+
function hasActiveExternalIdOnOrAfter(versions, externalId, anchor) {
|
|
10555
|
+
const inEffectAtAnchor = resolveVersion(versions, anchor);
|
|
10556
|
+
const laterVersions = versions.filter((v) => v.effectiveFrom > anchor);
|
|
10557
|
+
return [inEffectAtAnchor, ...laterVersions].some(
|
|
10558
|
+
(v) => v.externalId === externalId && v.status === "active"
|
|
10559
|
+
);
|
|
10560
|
+
}
|
|
10521
10561
|
function matchesJurisdictionFilter(locationIds, filter, user2) {
|
|
10522
10562
|
if (!locationIds) {
|
|
10523
10563
|
return false;
|
|
@@ -11328,3 +11368,51 @@ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
|
11328
11368
|
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
11329
11369
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
11330
11370
|
);
|
|
11371
|
+
|
|
11372
|
+
// ../commons/src/events/locationPayloads.ts
|
|
11373
|
+
var z44 = __toESM(require("zod/v4"));
|
|
11374
|
+
var CreateLocationPayload = z44.object({
|
|
11375
|
+
id: UUID.optional(),
|
|
11376
|
+
versionId: UUID.optional(),
|
|
11377
|
+
name: z44.string(),
|
|
11378
|
+
externalId: z44.string().nullish(),
|
|
11379
|
+
administrativeAreaId: UUID.nullable(),
|
|
11380
|
+
locationType: z44.string().nullable(),
|
|
11381
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
11382
|
+
status: LocationStatus.default("active")
|
|
11383
|
+
});
|
|
11384
|
+
var UpdateLocationPayload = z44.strictObject({
|
|
11385
|
+
id: UUID,
|
|
11386
|
+
versionId: UUID.optional(),
|
|
11387
|
+
name: z44.string(),
|
|
11388
|
+
externalId: z44.string().nullish(),
|
|
11389
|
+
status: LocationStatus,
|
|
11390
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
11391
|
+
lastVersionId: UUID
|
|
11392
|
+
});
|
|
11393
|
+
var WithdrawLocationVersionPayload = z44.object({
|
|
11394
|
+
id: UUID,
|
|
11395
|
+
versionId: UUID
|
|
11396
|
+
});
|
|
11397
|
+
var CreateAdministrativeAreaPayload = z44.object({
|
|
11398
|
+
id: UUID.optional(),
|
|
11399
|
+
versionId: UUID.optional(),
|
|
11400
|
+
name: z44.string(),
|
|
11401
|
+
externalId: z44.string().nullish(),
|
|
11402
|
+
parentId: UUID.nullable(),
|
|
11403
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
11404
|
+
status: LocationStatus.default("active")
|
|
11405
|
+
});
|
|
11406
|
+
var UpdateAdministrativeAreaPayload = z44.strictObject({
|
|
11407
|
+
id: UUID,
|
|
11408
|
+
versionId: UUID.optional(),
|
|
11409
|
+
name: z44.string(),
|
|
11410
|
+
externalId: z44.string().nullish(),
|
|
11411
|
+
status: LocationStatus,
|
|
11412
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
11413
|
+
lastVersionId: UUID
|
|
11414
|
+
});
|
|
11415
|
+
var WithdrawAdministrativeAreaVersionPayload = z44.object({
|
|
11416
|
+
id: UUID,
|
|
11417
|
+
versionId: UUID
|
|
11418
|
+
});
|
|
@@ -38,7 +38,7 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var
|
|
41
|
+
var z46 = __toESM(require("zod/v4"));
|
|
42
42
|
|
|
43
43
|
// ../commons/src/url.ts
|
|
44
44
|
function joinUrl(base, path) {
|
|
@@ -96,6 +96,7 @@ var PlainScopeType = z2.enum([
|
|
|
96
96
|
"integration.create",
|
|
97
97
|
"record.import",
|
|
98
98
|
"config.update-all",
|
|
99
|
+
"location.edit",
|
|
99
100
|
"attachment.upload",
|
|
100
101
|
"profile.electronic-signature",
|
|
101
102
|
"user.read-only-my-audit",
|
|
@@ -530,6 +531,29 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
|
530
531
|
requestData: z5.object({ id: z5.string() }),
|
|
531
532
|
responseSummary: z5.object({ clientId: z5.string() })
|
|
532
533
|
});
|
|
534
|
+
var createdVersionFields = {
|
|
535
|
+
id: z5.string(),
|
|
536
|
+
versionId: z5.string(),
|
|
537
|
+
name: z5.string(),
|
|
538
|
+
externalId: z5.string().nullish(),
|
|
539
|
+
effectiveFrom: z5.string(),
|
|
540
|
+
status: z5.string()
|
|
541
|
+
};
|
|
542
|
+
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
543
|
+
operation: z5.literal("locations.create"),
|
|
544
|
+
requestData: z5.object({
|
|
545
|
+
...createdVersionFields,
|
|
546
|
+
administrativeAreaId: z5.string().nullish(),
|
|
547
|
+
locationType: z5.string().nullish()
|
|
548
|
+
})
|
|
549
|
+
});
|
|
550
|
+
var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
|
|
551
|
+
operation: z5.literal("administrativeAreas.create"),
|
|
552
|
+
requestData: z5.object({
|
|
553
|
+
...createdVersionFields,
|
|
554
|
+
parentId: z5.string().nullish()
|
|
555
|
+
})
|
|
556
|
+
});
|
|
533
557
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
534
558
|
operation: z5.literal("attachments.upload"),
|
|
535
559
|
requestData: z5.object({
|
|
@@ -605,6 +629,8 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
|
|
|
605
629
|
IntegrationActivateEntrySchema,
|
|
606
630
|
IntegrationDeleteEntrySchema,
|
|
607
631
|
IntegrationRefreshSecretEntrySchema,
|
|
632
|
+
LocationCreateEntrySchema,
|
|
633
|
+
AdministrativeAreaCreateEntrySchema,
|
|
608
634
|
AttachmentUploadEntrySchema,
|
|
609
635
|
UserCreateEntrySchema,
|
|
610
636
|
UserReasonEntrySchema,
|
|
@@ -7827,8 +7853,56 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
|
7827
7853
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7828
7854
|
);
|
|
7829
7855
|
|
|
7830
|
-
// ../commons/src/
|
|
7856
|
+
// ../commons/src/events/locationPayloads.ts
|
|
7831
7857
|
var z44 = __toESM(require("zod/v4"));
|
|
7858
|
+
var CreateLocationPayload = z44.object({
|
|
7859
|
+
id: UUID.optional(),
|
|
7860
|
+
versionId: UUID.optional(),
|
|
7861
|
+
name: z44.string(),
|
|
7862
|
+
externalId: z44.string().nullish(),
|
|
7863
|
+
administrativeAreaId: UUID.nullable(),
|
|
7864
|
+
locationType: z44.string().nullable(),
|
|
7865
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7866
|
+
status: LocationStatus.default("active")
|
|
7867
|
+
});
|
|
7868
|
+
var UpdateLocationPayload = z44.strictObject({
|
|
7869
|
+
id: UUID,
|
|
7870
|
+
versionId: UUID.optional(),
|
|
7871
|
+
name: z44.string(),
|
|
7872
|
+
externalId: z44.string().nullish(),
|
|
7873
|
+
status: LocationStatus,
|
|
7874
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7875
|
+
lastVersionId: UUID
|
|
7876
|
+
});
|
|
7877
|
+
var WithdrawLocationVersionPayload = z44.object({
|
|
7878
|
+
id: UUID,
|
|
7879
|
+
versionId: UUID
|
|
7880
|
+
});
|
|
7881
|
+
var CreateAdministrativeAreaPayload = z44.object({
|
|
7882
|
+
id: UUID.optional(),
|
|
7883
|
+
versionId: UUID.optional(),
|
|
7884
|
+
name: z44.string(),
|
|
7885
|
+
externalId: z44.string().nullish(),
|
|
7886
|
+
parentId: UUID.nullable(),
|
|
7887
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7888
|
+
status: LocationStatus.default("active")
|
|
7889
|
+
});
|
|
7890
|
+
var UpdateAdministrativeAreaPayload = z44.strictObject({
|
|
7891
|
+
id: UUID,
|
|
7892
|
+
versionId: UUID.optional(),
|
|
7893
|
+
name: z44.string(),
|
|
7894
|
+
externalId: z44.string().nullish(),
|
|
7895
|
+
status: LocationStatus,
|
|
7896
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7897
|
+
lastVersionId: UUID
|
|
7898
|
+
});
|
|
7899
|
+
var WithdrawAdministrativeAreaVersionPayload = z44.object({
|
|
7900
|
+
id: UUID,
|
|
7901
|
+
versionId: UUID
|
|
7902
|
+
});
|
|
7903
|
+
|
|
7904
|
+
// ../commons/src/notification/UserNotifications.ts
|
|
7905
|
+
var z45 = __toESM(require("zod/v4"));
|
|
7832
7906
|
var TriggerEvent = {
|
|
7833
7907
|
USER_CREATED: "user-created",
|
|
7834
7908
|
USER_UPDATED: "user-updated",
|
|
@@ -7841,54 +7915,54 @@ var TriggerEvent = {
|
|
|
7841
7915
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
7842
7916
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
7843
7917
|
};
|
|
7844
|
-
var Recipient =
|
|
7918
|
+
var Recipient = z45.object({
|
|
7845
7919
|
name: NameFieldValue.optional(),
|
|
7846
|
-
mobile:
|
|
7847
|
-
email:
|
|
7848
|
-
bcc:
|
|
7920
|
+
mobile: z45.string().optional(),
|
|
7921
|
+
email: z45.string().optional(),
|
|
7922
|
+
bcc: z45.array(z45.string()).optional()
|
|
7849
7923
|
});
|
|
7850
|
-
var BasePayload =
|
|
7924
|
+
var BasePayload = z45.object({
|
|
7851
7925
|
recipient: Recipient
|
|
7852
7926
|
});
|
|
7853
7927
|
var TriggerPayload = {
|
|
7854
7928
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
7855
|
-
username:
|
|
7856
|
-
temporaryPassword:
|
|
7929
|
+
username: z45.string(),
|
|
7930
|
+
temporaryPassword: z45.string()
|
|
7857
7931
|
}),
|
|
7858
7932
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
7859
|
-
oldUsername:
|
|
7860
|
-
newUsername:
|
|
7933
|
+
oldUsername: z45.string(),
|
|
7934
|
+
newUsername: z45.string()
|
|
7861
7935
|
}),
|
|
7862
7936
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
7863
|
-
username:
|
|
7937
|
+
username: z45.string()
|
|
7864
7938
|
}),
|
|
7865
7939
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
7866
|
-
code:
|
|
7940
|
+
code: z45.string()
|
|
7867
7941
|
}),
|
|
7868
7942
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
7869
|
-
temporaryPassword:
|
|
7870
|
-
admin:
|
|
7871
|
-
id:
|
|
7943
|
+
temporaryPassword: z45.string(),
|
|
7944
|
+
admin: z45.object({
|
|
7945
|
+
id: z45.string(),
|
|
7872
7946
|
name: NameFieldValue,
|
|
7873
|
-
role:
|
|
7947
|
+
role: z45.string()
|
|
7874
7948
|
})
|
|
7875
7949
|
}),
|
|
7876
7950
|
[TriggerEvent.RESEND_INVITE]: BasePayload.extend({
|
|
7877
|
-
username:
|
|
7878
|
-
temporaryPassword:
|
|
7951
|
+
username: z45.string(),
|
|
7952
|
+
temporaryPassword: z45.string()
|
|
7879
7953
|
}),
|
|
7880
7954
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
7881
|
-
code:
|
|
7955
|
+
code: z45.string()
|
|
7882
7956
|
}),
|
|
7883
7957
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
7884
|
-
subject:
|
|
7885
|
-
body:
|
|
7958
|
+
subject: z45.string(),
|
|
7959
|
+
body: z45.string()
|
|
7886
7960
|
}),
|
|
7887
7961
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
7888
|
-
code:
|
|
7962
|
+
code: z45.string()
|
|
7889
7963
|
}),
|
|
7890
7964
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
7891
|
-
code:
|
|
7965
|
+
code: z45.string()
|
|
7892
7966
|
})
|
|
7893
7967
|
};
|
|
7894
7968
|
async function triggerUserEventNotification({
|
|
@@ -7912,4 +7986,4 @@ function parseUserEventTrigger(event2, body) {
|
|
|
7912
7986
|
}
|
|
7913
7987
|
|
|
7914
7988
|
// src/notification/index.ts
|
|
7915
|
-
|
|
7989
|
+
z46.globalRegistry.clear();
|