@opencrvs/toolkit 1.9.12-rc.eae3bc3 → 1.9.12-rc.eec1bae
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 +8 -0
- package/dist/application-config/index.js +47 -36
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2422 -0
- package/dist/commons/api/router.d.ts +320 -108
- package/dist/commons/application-config/index.d.ts +7 -12
- package/dist/commons/conditionals/conditionals.d.ts +8 -8
- package/dist/commons/events/ActionDocument.d.ts +196 -196
- package/dist/commons/events/ActionInput.d.ts +113 -113
- package/dist/commons/events/AdvancedSearchConfig.d.ts +16 -10
- package/dist/commons/events/AuditLog.d.ts +345 -163
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/CountryConfigQueryInput.d.ts +331 -60
- package/dist/commons/events/Draft.d.ts +13 -13
- package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
- package/dist/commons/events/EventConfig.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +80 -80
- package/dist/commons/events/EventIndex.d.ts +20 -12
- package/dist/commons/events/EventInput.d.ts +1 -1
- package/dist/commons/events/EventMetadata.d.ts +18 -18
- package/dist/commons/events/FieldConfig.d.ts +267 -47
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +96 -70
- package/dist/commons/events/FieldValue.d.ts +54 -26
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +16 -16
- package/dist/commons/events/WorkqueueConfig.d.ts +340 -96
- package/dist/commons/events/defineConfig.d.ts +0 -4
- package/dist/commons/events/locations.d.ts +4 -4
- package/dist/commons/events/scopes.d.ts +3 -2
- package/dist/commons/events/state/utils.d.ts +2 -2
- package/dist/commons/events/test.utils.d.ts +2 -2
- package/dist/commons/events/utils.d.ts +4 -176
- package/dist/commons/notification/UserNotifications.d.ts +6 -1
- package/dist/conditionals/index.js +74 -359
- package/dist/events/index.js +1197 -1260
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +753 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
- package/dist/migrations/v2.0/index.d.ts +7 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -0
- package/dist/migrations/v2.0/index.js +2361 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-scopes.js +281 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-api-paths.js +188 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
- package/dist/notification/index.js +1001 -1128
- package/dist/scopes/index.d.ts +389 -152
- package/dist/scopes/index.js +128 -322
- package/opencrvs-toolkit-1.9.12-rc.eec1bae.tgz +0 -0
- package/package.json +11 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-1.9.12-rc.eae3bc3.tgz +0 -0
|
@@ -38,7 +38,7 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var
|
|
41
|
+
var z45 = __toESM(require("zod/v4"));
|
|
42
42
|
|
|
43
43
|
// ../commons/src/url.ts
|
|
44
44
|
function joinUrl(base, path) {
|
|
@@ -47,111 +47,231 @@ function joinUrl(base, path) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// ../commons/src/events/AuditLog.ts
|
|
50
|
+
var z5 = __toESM(require("zod/v4"));
|
|
51
|
+
|
|
52
|
+
// ../commons/src/authentication.ts
|
|
53
|
+
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
54
|
+
var z3 = __toESM(require("zod/v4"));
|
|
55
|
+
|
|
56
|
+
// ../commons/src/scopes.ts
|
|
57
|
+
var z2 = __toESM(require("zod/v4"));
|
|
58
|
+
var qs = __toESM(require("qs"));
|
|
59
|
+
|
|
60
|
+
// ../commons/src/uuid.ts
|
|
61
|
+
var import_uuid = require("uuid");
|
|
50
62
|
var z = __toESM(require("zod/v4"));
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
63
|
+
var UUID = z.uuid().brand("UUID");
|
|
64
|
+
function getUUID() {
|
|
65
|
+
return (0, import_uuid.v4)();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ../commons/src/scopes.ts
|
|
69
|
+
var JurisdictionFilter = z2.enum(["administrativeArea", "location", "all"]).describe(
|
|
70
|
+
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
71
|
+
);
|
|
72
|
+
var UserFilter = z2.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
73
|
+
var RecordScopeTypeV2 = z2.enum([
|
|
74
|
+
"record.search",
|
|
75
|
+
"record.create",
|
|
76
|
+
"record.read",
|
|
77
|
+
"record.declare",
|
|
78
|
+
"record.notify",
|
|
79
|
+
"record.edit",
|
|
80
|
+
"record.reject",
|
|
81
|
+
"record.archive",
|
|
82
|
+
"record.review-duplicates",
|
|
83
|
+
"record.register",
|
|
84
|
+
"record.print-certified-copies",
|
|
85
|
+
"record.request-correction",
|
|
86
|
+
"record.correct",
|
|
87
|
+
"record.unassign-others",
|
|
88
|
+
"record.custom-action"
|
|
89
|
+
]);
|
|
90
|
+
var PlainScopeType = z2.enum([
|
|
91
|
+
// Misc. system scopes
|
|
92
|
+
"bypassratelimit",
|
|
93
|
+
"record.reindex",
|
|
94
|
+
"user.data-seeding",
|
|
95
|
+
"integration.create",
|
|
96
|
+
"record.import",
|
|
97
|
+
"config.update-all",
|
|
98
|
+
"attachment.upload",
|
|
99
|
+
"profile.electronic-signature",
|
|
100
|
+
"user.read-only-my-audit",
|
|
101
|
+
// Performance dashboard
|
|
102
|
+
"performance.read",
|
|
103
|
+
"performance.read-dashboards",
|
|
104
|
+
"performance.vital-statistics-export",
|
|
105
|
+
// Scopes used exclusively by countryconfig integration token
|
|
106
|
+
"record.confirm-registration",
|
|
107
|
+
"record.reject-registration"
|
|
108
|
+
]);
|
|
109
|
+
var scopeByEvent = z2.preprocess(
|
|
110
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
111
|
+
z2.array(z2.string()).optional()
|
|
112
|
+
).describe("Event type, e.g. birth, death");
|
|
113
|
+
var scopeOptionsPlaceEvent = z2.object({
|
|
114
|
+
event: scopeByEvent,
|
|
115
|
+
placeOfEvent: JurisdictionFilter.optional()
|
|
116
|
+
}).describe("Options applicable to all record scopes.");
|
|
117
|
+
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
118
|
+
declaredIn: JurisdictionFilter.optional(),
|
|
119
|
+
declaredBy: UserFilter.optional()
|
|
120
|
+
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
121
|
+
var AllRecordScopeOptions = scopeOptionsDeclared.extend({
|
|
122
|
+
registeredIn: JurisdictionFilter.optional(),
|
|
123
|
+
registeredBy: UserFilter.optional()
|
|
124
|
+
}).describe(
|
|
125
|
+
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
126
|
+
);
|
|
127
|
+
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
128
|
+
customActionTypes: z2.preprocess(
|
|
129
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
130
|
+
z2.array(z2.string()).optional()
|
|
131
|
+
).describe("Allowed custom action types")
|
|
132
|
+
});
|
|
133
|
+
var AccessLevelOptions = z2.object({
|
|
134
|
+
accessLevel: JurisdictionFilter.optional()
|
|
135
|
+
});
|
|
136
|
+
var WorkqueueOrDashboardOptions = z2.object({
|
|
137
|
+
ids: z2.preprocess(
|
|
138
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
139
|
+
z2.array(z2.string())
|
|
140
|
+
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
141
|
+
});
|
|
142
|
+
var AllScopeOptions = z2.object({
|
|
143
|
+
...AllRecordScopeOptions.shape,
|
|
144
|
+
...AccessLevelOptions.shape,
|
|
145
|
+
...WorkqueueOrDashboardOptions.shape
|
|
146
|
+
});
|
|
147
|
+
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
148
|
+
var ResolvedScopeOptionsPlaceEvent = z2.object({
|
|
149
|
+
event: scopeByEvent,
|
|
150
|
+
placeOfEvent: UUID.nullish()
|
|
151
|
+
}).describe(
|
|
152
|
+
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
153
|
+
);
|
|
154
|
+
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
155
|
+
declaredIn: UUID.nullish(),
|
|
156
|
+
declaredBy: z2.string().optional()
|
|
157
|
+
}).describe(
|
|
158
|
+
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
159
|
+
);
|
|
160
|
+
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
161
|
+
registeredIn: UUID.nullish(),
|
|
162
|
+
registeredBy: z2.string().optional()
|
|
163
|
+
}).describe(
|
|
164
|
+
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
165
|
+
);
|
|
166
|
+
var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
|
|
167
|
+
"record.create",
|
|
168
|
+
"record.declare",
|
|
169
|
+
"record.notify"
|
|
170
|
+
]);
|
|
171
|
+
var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
172
|
+
"record.edit",
|
|
173
|
+
"record.reject",
|
|
174
|
+
"record.archive",
|
|
175
|
+
"record.review-duplicates",
|
|
176
|
+
"record.register"
|
|
177
|
+
]);
|
|
178
|
+
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
179
|
+
"record.search",
|
|
180
|
+
"record.read",
|
|
181
|
+
"record.request-correction",
|
|
182
|
+
"record.correct",
|
|
183
|
+
"record.unassign-others"
|
|
184
|
+
]);
|
|
185
|
+
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
186
|
+
templates: z2.preprocess(
|
|
187
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
188
|
+
z2.array(z2.string()).optional()
|
|
189
|
+
).describe(
|
|
190
|
+
"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."
|
|
191
|
+
)
|
|
192
|
+
});
|
|
193
|
+
var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
194
|
+
z2.object({
|
|
195
|
+
type: ScopesWithPlaceEventOptions,
|
|
196
|
+
options: scopeOptionsPlaceEvent.optional()
|
|
88
197
|
}),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
responseSummary: z.object({})
|
|
198
|
+
z2.object({
|
|
199
|
+
type: ScopesWithDeclaredOptions,
|
|
200
|
+
options: scopeOptionsDeclared.optional()
|
|
93
201
|
}),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
responseSummary: z.object({})
|
|
202
|
+
z2.object({
|
|
203
|
+
type: ScopesWithFullOptions,
|
|
204
|
+
options: AllRecordScopeOptions.optional()
|
|
98
205
|
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
responseSummary: z.object({})
|
|
206
|
+
z2.object({
|
|
207
|
+
type: z2.literal("record.custom-action"),
|
|
208
|
+
options: CustomActionScopeOptions.optional()
|
|
103
209
|
}),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
210
|
+
z2.object({
|
|
211
|
+
type: z2.literal("record.print-certified-copies"),
|
|
212
|
+
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
213
|
+
})
|
|
214
|
+
]).describe(
|
|
215
|
+
"Scopes used to check user's permission to perform actions on a record."
|
|
216
|
+
);
|
|
217
|
+
var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
|
|
218
|
+
z2.object({
|
|
219
|
+
type: ScopesWithPlaceEventOptions,
|
|
220
|
+
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
108
221
|
}),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
responseSummary: z.object({})
|
|
222
|
+
z2.object({
|
|
223
|
+
type: ScopesWithDeclaredOptions,
|
|
224
|
+
options: ResolvedScopeOptionsDeclared.optional()
|
|
113
225
|
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
responseSummary: z.object({ phoneNumber: z.string() })
|
|
226
|
+
z2.object({
|
|
227
|
+
type: ScopesWithFullOptions,
|
|
228
|
+
options: ResolvedScopeOptionsFull.optional()
|
|
118
229
|
}),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
230
|
+
z2.object({
|
|
231
|
+
type: z2.literal("record.print-certified-copies"),
|
|
232
|
+
options: ResolvedScopeOptionsFull.extend({
|
|
233
|
+
templates: z2.array(z2.string()).optional()
|
|
234
|
+
}).optional()
|
|
235
|
+
})
|
|
236
|
+
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
237
|
+
var SystemScopeType = z2.enum([
|
|
238
|
+
"organisation.read-locations",
|
|
239
|
+
"user.read",
|
|
240
|
+
"user.create",
|
|
241
|
+
"user.edit"
|
|
242
|
+
]);
|
|
243
|
+
var Scope = z2.discriminatedUnion("type", [
|
|
244
|
+
z2.object({ type: PlainScopeType }),
|
|
245
|
+
...RecordScopeV2.options,
|
|
246
|
+
z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
247
|
+
z2.object({
|
|
248
|
+
type: z2.literal("workqueue"),
|
|
249
|
+
options: WorkqueueOrDashboardOptions
|
|
123
250
|
}),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
responseSummary: z.object({})
|
|
251
|
+
z2.object({
|
|
252
|
+
type: z2.literal("dashboard.view"),
|
|
253
|
+
options: WorkqueueOrDashboardOptions
|
|
128
254
|
})
|
|
129
255
|
]);
|
|
256
|
+
var ScopeType = z2.enum([
|
|
257
|
+
...SystemScopeType.options,
|
|
258
|
+
...RecordScopeTypeV2.options,
|
|
259
|
+
...PlainScopeType.options,
|
|
260
|
+
"workqueue",
|
|
261
|
+
"dashboard.view"
|
|
262
|
+
]);
|
|
263
|
+
var EncodedScope = z2.string().brand("EncodedScope");
|
|
264
|
+
var DEFAULT_SCOPE_OPTIONS = {
|
|
265
|
+
placeOfEvent: JurisdictionFilter.enum.all,
|
|
266
|
+
accessLevel: JurisdictionFilter.enum.all
|
|
267
|
+
};
|
|
130
268
|
|
|
131
|
-
// ../commons/src/
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
// ../commons/src/events/ActionConfig.ts
|
|
136
|
-
var z25 = __toESM(require("zod/v4"));
|
|
137
|
-
|
|
138
|
-
// ../commons/src/events/TranslationConfig.ts
|
|
139
|
-
var z2 = __toESM(require("zod/v4"));
|
|
140
|
-
var TranslationConfig = z2.object({
|
|
141
|
-
id: z2.string().describe(
|
|
142
|
-
"The identifier of the translation referred in translation CSV files"
|
|
143
|
-
),
|
|
144
|
-
defaultMessage: z2.string().describe("Default translation message"),
|
|
145
|
-
description: z2.string().describe(
|
|
146
|
-
"Describe the translation for a translator to be able to identify it."
|
|
147
|
-
)
|
|
148
|
-
}).meta({
|
|
149
|
-
description: "Translation configuration",
|
|
150
|
-
id: "TranslationConfig"
|
|
151
|
-
});
|
|
269
|
+
// ../commons/src/authentication.ts
|
|
270
|
+
var TokenUserType = z3.enum(["user", "system"]);
|
|
271
|
+
var TokenWithBearer = z3.string().regex(/^Bearer\s/);
|
|
152
272
|
|
|
153
273
|
// ../commons/src/events/ActionType.ts
|
|
154
|
-
var
|
|
274
|
+
var z4 = __toESM(require("zod/v4"));
|
|
155
275
|
var ActionType = {
|
|
156
276
|
// Pre-declaration actions
|
|
157
277
|
DELETE: "DELETE",
|
|
@@ -193,7 +313,7 @@ var ConfirmableActions = [
|
|
|
193
313
|
ActionType.REJECT_CORRECTION,
|
|
194
314
|
ActionType.CUSTOM
|
|
195
315
|
];
|
|
196
|
-
var ActionTypes =
|
|
316
|
+
var ActionTypes = z4.enum([
|
|
197
317
|
"DELETE",
|
|
198
318
|
"CREATE",
|
|
199
319
|
"NOTIFY",
|
|
@@ -257,12 +377,225 @@ var META_ACTIONS = [
|
|
|
257
377
|
ActionType.READ
|
|
258
378
|
];
|
|
259
379
|
|
|
380
|
+
// ../commons/src/events/AuditLog.ts
|
|
381
|
+
var AuditLogEntryBase = z5.object({
|
|
382
|
+
id: z5.string(),
|
|
383
|
+
clientId: z5.string(),
|
|
384
|
+
clientType: TokenUserType,
|
|
385
|
+
createdAt: z5.string()
|
|
386
|
+
});
|
|
387
|
+
var EventCreateEntrySchema = AuditLogEntryBase.extend({
|
|
388
|
+
operation: z5.literal("event.create"),
|
|
389
|
+
requestData: z5.object({
|
|
390
|
+
transactionId: z5.string(),
|
|
391
|
+
type: z5.string(),
|
|
392
|
+
createdAtLocation: z5.string().nullable()
|
|
393
|
+
}),
|
|
394
|
+
responseSummary: z5.object({
|
|
395
|
+
eventId: z5.string(),
|
|
396
|
+
trackingId: z5.string()
|
|
397
|
+
})
|
|
398
|
+
});
|
|
399
|
+
var EventGetEntrySchema = AuditLogEntryBase.extend({
|
|
400
|
+
operation: z5.literal("event.get"),
|
|
401
|
+
requestData: z5.object({ eventId: z5.string() }),
|
|
402
|
+
responseSummary: z5.object({
|
|
403
|
+
eventType: z5.string(),
|
|
404
|
+
trackingId: z5.string()
|
|
405
|
+
})
|
|
406
|
+
});
|
|
407
|
+
var EventSearchEntrySchema = AuditLogEntryBase.extend({
|
|
408
|
+
operation: z5.literal("event.search"),
|
|
409
|
+
clientType: z5.literal("system"),
|
|
410
|
+
requestData: z5.object({
|
|
411
|
+
query: z5.record(z5.string(), z5.unknown()).nullable(),
|
|
412
|
+
limit: z5.number().nullable(),
|
|
413
|
+
offset: z5.number().nullable()
|
|
414
|
+
}),
|
|
415
|
+
responseSummary: z5.object({
|
|
416
|
+
total: z5.number(),
|
|
417
|
+
eventIds: z5.array(z5.string())
|
|
418
|
+
})
|
|
419
|
+
});
|
|
420
|
+
var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
421
|
+
operation: z5.enum([
|
|
422
|
+
"event.actions.notify.request",
|
|
423
|
+
"event.actions.declare.request",
|
|
424
|
+
"event.actions.register.request",
|
|
425
|
+
"event.actions.reject.request",
|
|
426
|
+
"event.actions.validate.request",
|
|
427
|
+
"event.actions.edit.request",
|
|
428
|
+
"event.actions.assign.request",
|
|
429
|
+
"event.actions.unassign.request",
|
|
430
|
+
"event.actions.read.request",
|
|
431
|
+
"event.actions.archive.request",
|
|
432
|
+
"event.actions.reinstate.request",
|
|
433
|
+
"event.actions.print_certificate.request",
|
|
434
|
+
"event.actions.correction.request.request",
|
|
435
|
+
"event.actions.correction.approve.request",
|
|
436
|
+
"event.actions.correction.reject.request",
|
|
437
|
+
"event.actions.mark_as_duplicate.request",
|
|
438
|
+
"event.actions.mark_as_not_duplicate.request"
|
|
439
|
+
]),
|
|
440
|
+
requestData: z5.object({
|
|
441
|
+
eventId: z5.string(),
|
|
442
|
+
actionType: z5.string(),
|
|
443
|
+
eventType: z5.string(),
|
|
444
|
+
trackingId: z5.string(),
|
|
445
|
+
transactionId: z5.string()
|
|
446
|
+
})
|
|
447
|
+
});
|
|
448
|
+
var EventCustomActionEntrySchema = AuditLogEntryBase.extend({
|
|
449
|
+
operation: z5.literal("event.actions.custom.request"),
|
|
450
|
+
requestData: z5.object({
|
|
451
|
+
eventId: z5.string(),
|
|
452
|
+
actionType: z5.literal(ActionType.CUSTOM),
|
|
453
|
+
customAction: z5.string(),
|
|
454
|
+
eventType: z5.string(),
|
|
455
|
+
trackingId: z5.string(),
|
|
456
|
+
transactionId: z5.string()
|
|
457
|
+
})
|
|
458
|
+
});
|
|
459
|
+
var IntegrationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
460
|
+
operation: z5.literal("integrations.create"),
|
|
461
|
+
requestData: z5.object({ name: z5.string(), scopes: z5.array(z5.string()) }),
|
|
462
|
+
responseSummary: z5.object({ clientId: z5.string() })
|
|
463
|
+
});
|
|
464
|
+
var IntegrationRefreshTokenEntrySchema = AuditLogEntryBase.extend({
|
|
465
|
+
operation: z5.literal("integrations.refreshToken"),
|
|
466
|
+
requestData: z5.object({ clientId: z5.string() }),
|
|
467
|
+
responseSummary: z5.object({ clientId: z5.string() })
|
|
468
|
+
});
|
|
469
|
+
var IntegrationDeactivateEntrySchema = AuditLogEntryBase.extend({
|
|
470
|
+
operation: z5.literal("integrations.deactivate"),
|
|
471
|
+
requestData: z5.object({ id: z5.string() }),
|
|
472
|
+
responseSummary: z5.object({ id: z5.string(), status: z5.string() })
|
|
473
|
+
});
|
|
474
|
+
var IntegrationActivateEntrySchema = AuditLogEntryBase.extend({
|
|
475
|
+
operation: z5.literal("integrations.activate"),
|
|
476
|
+
requestData: z5.object({ id: z5.string() }),
|
|
477
|
+
responseSummary: z5.object({ id: z5.string(), status: z5.string() })
|
|
478
|
+
});
|
|
479
|
+
var IntegrationDeleteEntrySchema = AuditLogEntryBase.extend({
|
|
480
|
+
operation: z5.literal("integrations.delete"),
|
|
481
|
+
requestData: z5.object({ id: z5.string() }),
|
|
482
|
+
responseSummary: z5.object({ id: z5.string(), name: z5.string() })
|
|
483
|
+
});
|
|
484
|
+
var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
485
|
+
operation: z5.literal("integrations.refreshSecret"),
|
|
486
|
+
requestData: z5.object({ id: z5.string() }),
|
|
487
|
+
responseSummary: z5.object({ clientId: z5.string() })
|
|
488
|
+
});
|
|
489
|
+
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
490
|
+
operation: z5.literal("attachments.upload"),
|
|
491
|
+
requestData: z5.object({
|
|
492
|
+
transactionId: z5.string(),
|
|
493
|
+
path: z5.string().nullable()
|
|
494
|
+
}),
|
|
495
|
+
responseSummary: z5.object({ fileUrl: z5.string() })
|
|
496
|
+
});
|
|
497
|
+
var subjectOnly = z5.object({ subjectId: z5.string() });
|
|
498
|
+
var subjectWithReason = z5.object({
|
|
499
|
+
subjectId: z5.string(),
|
|
500
|
+
reason: z5.string(),
|
|
501
|
+
comment: z5.string().optional()
|
|
502
|
+
});
|
|
503
|
+
var UserCreateEntrySchema = AuditLogEntryBase.extend({
|
|
504
|
+
operation: z5.literal("user.create_user"),
|
|
505
|
+
requestData: z5.object({
|
|
506
|
+
subjectId: z5.string(),
|
|
507
|
+
role: z5.string(),
|
|
508
|
+
primaryOfficeId: z5.string()
|
|
509
|
+
})
|
|
510
|
+
});
|
|
511
|
+
var UserReasonEntrySchema = AuditLogEntryBase.extend({
|
|
512
|
+
operation: z5.enum(["user.deactivate", "user.reactivate"]),
|
|
513
|
+
requestData: subjectWithReason
|
|
514
|
+
});
|
|
515
|
+
var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
516
|
+
operation: z5.enum([
|
|
517
|
+
"user.edit_user",
|
|
518
|
+
"user.logged_in",
|
|
519
|
+
"user.logged_out",
|
|
520
|
+
"user.password_changed",
|
|
521
|
+
"user.password_reset",
|
|
522
|
+
"user.password_reset_by_admin",
|
|
523
|
+
"user.username_reminder",
|
|
524
|
+
"user.username_reminder_by_admin"
|
|
525
|
+
]),
|
|
526
|
+
requestData: subjectOnly
|
|
527
|
+
});
|
|
528
|
+
var UserEmailChangedEntrySchema = AuditLogEntryBase.extend({
|
|
529
|
+
operation: z5.literal("user.email_address_changed"),
|
|
530
|
+
requestData: subjectOnly,
|
|
531
|
+
responseSummary: z5.object({ email: z5.string() })
|
|
532
|
+
});
|
|
533
|
+
var UserPhoneChangedEntrySchema = AuditLogEntryBase.extend({
|
|
534
|
+
operation: z5.literal("user.phone_number_changed"),
|
|
535
|
+
requestData: subjectOnly,
|
|
536
|
+
responseSummary: z5.object({ phoneNumber: z5.string() })
|
|
537
|
+
});
|
|
538
|
+
var userBaseOmit = {
|
|
539
|
+
id: true,
|
|
540
|
+
clientId: true,
|
|
541
|
+
clientType: true,
|
|
542
|
+
createdAt: true
|
|
543
|
+
};
|
|
544
|
+
var UserAuditRecordInput = z5.discriminatedUnion("operation", [
|
|
545
|
+
UserCreateEntrySchema.omit(userBaseOmit),
|
|
546
|
+
UserReasonEntrySchema.omit(userBaseOmit),
|
|
547
|
+
UserSubjectOnlyEntrySchema.omit(userBaseOmit),
|
|
548
|
+
UserEmailChangedEntrySchema.omit(userBaseOmit),
|
|
549
|
+
UserPhoneChangedEntrySchema.omit(userBaseOmit)
|
|
550
|
+
]);
|
|
551
|
+
var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
|
|
552
|
+
EventCreateEntrySchema,
|
|
553
|
+
EventGetEntrySchema,
|
|
554
|
+
EventSearchEntrySchema,
|
|
555
|
+
EventActionEntrySchema,
|
|
556
|
+
EventCustomActionEntrySchema,
|
|
557
|
+
IntegrationCreateEntrySchema,
|
|
558
|
+
IntegrationRefreshTokenEntrySchema,
|
|
559
|
+
IntegrationDeactivateEntrySchema,
|
|
560
|
+
IntegrationActivateEntrySchema,
|
|
561
|
+
IntegrationDeleteEntrySchema,
|
|
562
|
+
IntegrationRefreshSecretEntrySchema,
|
|
563
|
+
AttachmentUploadEntrySchema,
|
|
564
|
+
UserCreateEntrySchema,
|
|
565
|
+
UserReasonEntrySchema,
|
|
566
|
+
UserSubjectOnlyEntrySchema,
|
|
567
|
+
UserEmailChangedEntrySchema,
|
|
568
|
+
UserPhoneChangedEntrySchema
|
|
569
|
+
]);
|
|
570
|
+
|
|
571
|
+
// ../commons/src/events/Constants.ts
|
|
572
|
+
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
573
|
+
var CHILD_ONBOARDING_EVENT = "child-onboarding";
|
|
574
|
+
|
|
575
|
+
// ../commons/src/events/ActionConfig.ts
|
|
576
|
+
var z24 = __toESM(require("zod/v4"));
|
|
577
|
+
|
|
578
|
+
// ../commons/src/events/TranslationConfig.ts
|
|
579
|
+
var z6 = __toESM(require("zod/v4"));
|
|
580
|
+
var TranslationConfig = z6.object({
|
|
581
|
+
id: z6.string().describe(
|
|
582
|
+
"The identifier of the translation referred in translation CSV files"
|
|
583
|
+
),
|
|
584
|
+
defaultMessage: z6.string().describe("Default translation message"),
|
|
585
|
+
description: z6.string().describe(
|
|
586
|
+
"Describe the translation for a translator to be able to identify it."
|
|
587
|
+
)
|
|
588
|
+
}).meta({
|
|
589
|
+
description: "Translation configuration",
|
|
590
|
+
id: "TranslationConfig"
|
|
591
|
+
});
|
|
592
|
+
|
|
260
593
|
// ../commons/src/events/FieldConfig.ts
|
|
261
594
|
var import_v43 = __toESM(require("zod/v4"));
|
|
262
595
|
|
|
263
596
|
// ../commons/src/events/Conditional.ts
|
|
264
|
-
var
|
|
265
|
-
var Conditional =
|
|
597
|
+
var z7 = __toESM(require("zod/v4"));
|
|
598
|
+
var Conditional = z7.any().describe("JSONSchema").meta({
|
|
266
599
|
description: "JSON schema conditional configuration",
|
|
267
600
|
id: "Conditional"
|
|
268
601
|
});
|
|
@@ -271,31 +604,31 @@ var ConditionalType = {
|
|
|
271
604
|
ENABLE: "ENABLE",
|
|
272
605
|
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
273
606
|
};
|
|
274
|
-
var ShowConditional =
|
|
275
|
-
type:
|
|
607
|
+
var ShowConditional = z7.object({
|
|
608
|
+
type: z7.literal(ConditionalType.SHOW),
|
|
276
609
|
conditional: Conditional
|
|
277
610
|
}).describe(
|
|
278
611
|
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
279
612
|
);
|
|
280
|
-
var EnableConditional =
|
|
281
|
-
type:
|
|
613
|
+
var EnableConditional = z7.object({
|
|
614
|
+
type: z7.literal(ConditionalType.ENABLE),
|
|
282
615
|
conditional: Conditional
|
|
283
616
|
}).describe(
|
|
284
617
|
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
285
618
|
);
|
|
286
|
-
var ActionConditional =
|
|
619
|
+
var ActionConditional = z7.discriminatedUnion("type", [
|
|
287
620
|
// Action can be shown / hidden
|
|
288
621
|
ShowConditional,
|
|
289
622
|
// Action can be shown to the user in the list but as disabled
|
|
290
623
|
EnableConditional
|
|
291
624
|
]);
|
|
292
|
-
var DisplayOnReviewConditional =
|
|
293
|
-
type:
|
|
625
|
+
var DisplayOnReviewConditional = z7.object({
|
|
626
|
+
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
294
627
|
conditional: Conditional
|
|
295
628
|
}).describe(
|
|
296
629
|
"If 'DISPLAY_ON_REVIEW' conditional is defined, the component is shown on the review page only if both the 'DISPLAY_ON_REVIEW' and 'SHOW' conditions are met. This should only be used for fields within declaration forms, as they are the only ones with review pages."
|
|
297
630
|
);
|
|
298
|
-
var FieldConditional =
|
|
631
|
+
var FieldConditional = z7.discriminatedUnion("type", [
|
|
299
632
|
// Field input can be shown / hidden
|
|
300
633
|
ShowConditional,
|
|
301
634
|
// Field input can be shown to the user but as disabled
|
|
@@ -308,7 +641,7 @@ var FieldConditional = z4.discriminatedUnion("type", [
|
|
|
308
641
|
});
|
|
309
642
|
|
|
310
643
|
// ../commons/src/events/FieldType.ts
|
|
311
|
-
var
|
|
644
|
+
var z8 = __toESM(require("zod/v4"));
|
|
312
645
|
var FieldType = {
|
|
313
646
|
NAME: "NAME",
|
|
314
647
|
PHONE: "PHONE",
|
|
@@ -348,6 +681,7 @@ var FieldType = {
|
|
|
348
681
|
SIGNATURE: "SIGNATURE",
|
|
349
682
|
DATA: "DATA",
|
|
350
683
|
BUTTON: "BUTTON",
|
|
684
|
+
AUTOCOMPLETE: "AUTOCOMPLETE",
|
|
351
685
|
SEARCH: "SEARCH",
|
|
352
686
|
ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON",
|
|
353
687
|
HTTP: "HTTP",
|
|
@@ -371,7 +705,7 @@ var FieldType = {
|
|
|
371
705
|
*/
|
|
372
706
|
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
373
707
|
};
|
|
374
|
-
var FileFieldType =
|
|
708
|
+
var FileFieldType = z8.enum([
|
|
375
709
|
FieldType.FILE,
|
|
376
710
|
FieldType.FILE_WITH_OPTIONS,
|
|
377
711
|
FieldType.SIGNATURE
|
|
@@ -402,154 +736,159 @@ var FieldTypesToHideInReview = [
|
|
|
402
736
|
];
|
|
403
737
|
|
|
404
738
|
// ../commons/src/events/FieldValue.ts
|
|
405
|
-
var
|
|
739
|
+
var z12 = __toESM(require("zod/v4"));
|
|
406
740
|
|
|
407
741
|
// ../commons/src/documents.ts
|
|
408
|
-
var
|
|
409
|
-
var FullDocumentUrl =
|
|
742
|
+
var z9 = __toESM(require("zod/v4"));
|
|
743
|
+
var FullDocumentUrl = z9.string().brand("FullDocumentUrl").describe(
|
|
410
744
|
"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"
|
|
411
745
|
);
|
|
412
|
-
var FullDocumentPath =
|
|
746
|
+
var FullDocumentPath = z9.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
413
747
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
414
748
|
);
|
|
415
|
-
var DocumentPath =
|
|
749
|
+
var DocumentPath = z9.string().brand("DocumentPath").describe(
|
|
416
750
|
"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."
|
|
417
751
|
);
|
|
418
752
|
|
|
419
753
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
420
|
-
var
|
|
754
|
+
var z10 = __toESM(require("zod/v4"));
|
|
421
755
|
var AddressType = {
|
|
422
756
|
DOMESTIC: "DOMESTIC",
|
|
423
757
|
INTERNATIONAL: "INTERNATIONAL"
|
|
424
758
|
};
|
|
425
|
-
var FileFieldValue =
|
|
759
|
+
var FileFieldValue = z10.object({
|
|
426
760
|
path: DocumentPath,
|
|
427
|
-
originalFilename:
|
|
428
|
-
type:
|
|
429
|
-
});
|
|
430
|
-
var NameFieldValue =
|
|
431
|
-
firstname:
|
|
432
|
-
surname:
|
|
433
|
-
middlename:
|
|
434
|
-
});
|
|
435
|
-
var NameFieldUpdateValue =
|
|
436
|
-
firstname:
|
|
437
|
-
surname:
|
|
438
|
-
middlename:
|
|
439
|
-
}).or(
|
|
440
|
-
var StreetLevelDetailsValue =
|
|
441
|
-
var StreetLevelDetailsUpdateValue =
|
|
442
|
-
var BaseAddressFieldValue =
|
|
443
|
-
country:
|
|
761
|
+
originalFilename: z10.string(),
|
|
762
|
+
type: z10.string()
|
|
763
|
+
});
|
|
764
|
+
var NameFieldValue = z10.object({
|
|
765
|
+
firstname: z10.string(),
|
|
766
|
+
surname: z10.string(),
|
|
767
|
+
middlename: z10.string().optional()
|
|
768
|
+
});
|
|
769
|
+
var NameFieldUpdateValue = z10.object({
|
|
770
|
+
firstname: z10.string().nullish(),
|
|
771
|
+
surname: z10.string().nullish(),
|
|
772
|
+
middlename: z10.string().nullish()
|
|
773
|
+
}).or(z10.null()).or(z10.undefined());
|
|
774
|
+
var StreetLevelDetailsValue = z10.record(z10.string(), z10.string()).optional();
|
|
775
|
+
var StreetLevelDetailsUpdateValue = z10.record(z10.string(), z10.string().nullable()).nullish();
|
|
776
|
+
var BaseAddressFieldValue = z10.object({
|
|
777
|
+
country: z10.string(),
|
|
444
778
|
streetLevelDetails: StreetLevelDetailsValue
|
|
445
779
|
});
|
|
446
|
-
var BaseAddressFieldUpdateValue =
|
|
447
|
-
country:
|
|
780
|
+
var BaseAddressFieldUpdateValue = z10.object({
|
|
781
|
+
country: z10.string().nullish(),
|
|
448
782
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
449
783
|
});
|
|
450
784
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
451
|
-
addressType:
|
|
452
|
-
administrativeArea:
|
|
785
|
+
addressType: z10.literal(AddressType.DOMESTIC),
|
|
786
|
+
administrativeArea: z10.string().uuid()
|
|
453
787
|
});
|
|
454
788
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
455
|
-
addressType:
|
|
789
|
+
addressType: z10.literal(AddressType.INTERNATIONAL)
|
|
456
790
|
});
|
|
457
|
-
var AddressFieldValue =
|
|
791
|
+
var AddressFieldValue = z10.discriminatedUnion("addressType", [
|
|
458
792
|
DomesticAddressFieldValue,
|
|
459
793
|
InternationalAddressFieldValue
|
|
460
794
|
]);
|
|
461
795
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
462
|
-
addressType:
|
|
463
|
-
administrativeArea:
|
|
796
|
+
addressType: z10.literal(AddressType.DOMESTIC),
|
|
797
|
+
administrativeArea: z10.string().uuid().nullish()
|
|
464
798
|
/* Leaf level admin structure */
|
|
465
799
|
});
|
|
466
800
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
467
801
|
{
|
|
468
|
-
addressType:
|
|
802
|
+
addressType: z10.literal(AddressType.INTERNATIONAL)
|
|
469
803
|
}
|
|
470
804
|
);
|
|
471
|
-
var AddressFieldUpdateValue =
|
|
805
|
+
var AddressFieldUpdateValue = z10.discriminatedUnion("addressType", [
|
|
472
806
|
DomesticAddressUpdateFieldValue,
|
|
473
807
|
InternationalAddressUpdateFieldValue
|
|
474
808
|
]).nullish();
|
|
475
|
-
var FileFieldValueWithOption =
|
|
809
|
+
var FileFieldValueWithOption = z10.object({
|
|
476
810
|
path: DocumentPath,
|
|
477
|
-
originalFilename:
|
|
478
|
-
type:
|
|
479
|
-
option:
|
|
480
|
-
});
|
|
481
|
-
var FileFieldWithOptionValue =
|
|
482
|
-
var HttpFieldValue =
|
|
483
|
-
loading:
|
|
484
|
-
error:
|
|
485
|
-
data:
|
|
486
|
-
});
|
|
487
|
-
var HttpFieldUpdateValue =
|
|
488
|
-
loading:
|
|
489
|
-
error:
|
|
490
|
-
data:
|
|
491
|
-
}).or(
|
|
492
|
-
var QueryParamReaderFieldValue =
|
|
493
|
-
data:
|
|
494
|
-
updatedAt:
|
|
811
|
+
originalFilename: z10.string(),
|
|
812
|
+
type: z10.string(),
|
|
813
|
+
option: z10.string()
|
|
814
|
+
});
|
|
815
|
+
var FileFieldWithOptionValue = z10.array(FileFieldValueWithOption);
|
|
816
|
+
var HttpFieldValue = z10.object({
|
|
817
|
+
loading: z10.boolean(),
|
|
818
|
+
error: z10.object({ statusCode: z10.number(), message: z10.string() }).nullish(),
|
|
819
|
+
data: z10.any()
|
|
820
|
+
});
|
|
821
|
+
var HttpFieldUpdateValue = z10.object({
|
|
822
|
+
loading: z10.boolean().nullish(),
|
|
823
|
+
error: z10.object({ statusCode: z10.number(), message: z10.string() }).nullish(),
|
|
824
|
+
data: z10.any().nullish()
|
|
825
|
+
}).or(z10.null()).or(z10.undefined());
|
|
826
|
+
var QueryParamReaderFieldValue = z10.object({
|
|
827
|
+
data: z10.record(z10.string(), z10.string()),
|
|
828
|
+
updatedAt: z10.iso.datetime()
|
|
495
829
|
}).nullish();
|
|
496
|
-
var QueryParamReaderFieldUpdateValue =
|
|
497
|
-
data:
|
|
830
|
+
var QueryParamReaderFieldUpdateValue = z10.object({
|
|
831
|
+
data: z10.record(z10.string(), z10.string())
|
|
498
832
|
});
|
|
499
|
-
var ReadDataValue =
|
|
500
|
-
data:
|
|
833
|
+
var ReadDataValue = z10.object({
|
|
834
|
+
data: z10.any()
|
|
501
835
|
});
|
|
502
836
|
var QrReaderFieldValue = ReadDataValue;
|
|
503
837
|
var IdReaderFieldValue = ReadDataValue;
|
|
504
|
-
var NumberWithUnitFieldValue =
|
|
505
|
-
numericValue:
|
|
506
|
-
unit:
|
|
838
|
+
var NumberWithUnitFieldValue = z10.object({
|
|
839
|
+
numericValue: z10.number(),
|
|
840
|
+
unit: z10.string()
|
|
507
841
|
});
|
|
508
|
-
var NumberWithUnitFieldUpdateValue =
|
|
509
|
-
numericValue:
|
|
510
|
-
unit:
|
|
842
|
+
var NumberWithUnitFieldUpdateValue = z10.object({
|
|
843
|
+
numericValue: z10.number().optional(),
|
|
844
|
+
unit: z10.string().optional()
|
|
511
845
|
});
|
|
512
|
-
var CustomFieldValue =
|
|
846
|
+
var CustomFieldValue = z10.unknown().brand("CustomFieldValue");
|
|
513
847
|
|
|
514
848
|
// ../commons/src/events/PlainDate.ts
|
|
515
849
|
var import_zod = require("zod");
|
|
516
850
|
var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
|
|
517
851
|
|
|
518
852
|
// ../commons/src/events/FieldValue.ts
|
|
519
|
-
var TextValue =
|
|
520
|
-
var HiddenFieldValue =
|
|
853
|
+
var TextValue = z12.string();
|
|
854
|
+
var HiddenFieldValue = z12.string();
|
|
521
855
|
var NonEmptyTextValue = TextValue.min(1);
|
|
522
|
-
var DateValue =
|
|
523
|
-
var AgeValue =
|
|
524
|
-
age:
|
|
525
|
-
asOfDateRef:
|
|
856
|
+
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
857
|
+
var AgeValue = z12.object({
|
|
858
|
+
age: z12.number(),
|
|
859
|
+
asOfDateRef: z12.string()
|
|
526
860
|
});
|
|
527
861
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
528
|
-
var
|
|
529
|
-
|
|
530
|
-
|
|
862
|
+
var AutocompleteValue = z12.object({
|
|
863
|
+
label: z12.string(),
|
|
864
|
+
value: z12.string()
|
|
865
|
+
});
|
|
866
|
+
var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
|
|
867
|
+
var TimeValue = z12.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
868
|
+
var DatetimeValue = z12.iso.datetime();
|
|
869
|
+
var SelectDateRangeValue = z12.enum([
|
|
531
870
|
"last7Days",
|
|
532
871
|
"last30Days",
|
|
533
872
|
"last90Days",
|
|
534
873
|
"last365Days"
|
|
535
874
|
]);
|
|
536
|
-
var DateRangeFieldValue =
|
|
875
|
+
var DateRangeFieldValue = z12.object({
|
|
537
876
|
start: PlainDate,
|
|
538
877
|
end: PlainDate
|
|
539
878
|
}).or(PlainDate).describe(
|
|
540
879
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
541
880
|
);
|
|
542
|
-
var EmailValue =
|
|
543
|
-
var CheckboxFieldValue =
|
|
544
|
-
var NumberFieldValue =
|
|
545
|
-
var ButtonFieldValue =
|
|
546
|
-
var VerificationStatusValue =
|
|
881
|
+
var EmailValue = z12.email();
|
|
882
|
+
var CheckboxFieldValue = z12.boolean();
|
|
883
|
+
var NumberFieldValue = z12.number();
|
|
884
|
+
var ButtonFieldValue = z12.number();
|
|
885
|
+
var VerificationStatusValue = z12.enum([
|
|
547
886
|
"verified",
|
|
548
887
|
"authenticated",
|
|
549
888
|
"failed",
|
|
550
889
|
"pending"
|
|
551
890
|
]);
|
|
552
|
-
var LeafFieldValues =
|
|
891
|
+
var LeafFieldValues = z12.union([
|
|
553
892
|
AddressFieldValue,
|
|
554
893
|
TextValue,
|
|
555
894
|
PlainDate,
|
|
@@ -571,13 +910,15 @@ var LeafFieldValues = z9.union([
|
|
|
571
910
|
IdReaderFieldValue,
|
|
572
911
|
NumberWithUnitFieldValue,
|
|
573
912
|
NumberWithUnitFieldUpdateValue,
|
|
574
|
-
CustomFieldValue
|
|
913
|
+
CustomFieldValue,
|
|
914
|
+
AutocompleteValue,
|
|
915
|
+
AutocompleteUpdateValue
|
|
575
916
|
]);
|
|
576
|
-
var FieldGroupValue =
|
|
577
|
-
var DataFieldValue =
|
|
578
|
-
data:
|
|
917
|
+
var FieldGroupValue = z12.record(z12.string(), LeafFieldValues);
|
|
918
|
+
var DataFieldValue = z12.object({
|
|
919
|
+
data: z12.record(z12.string(), LeafFieldValues)
|
|
579
920
|
}).nullish();
|
|
580
|
-
var FieldValue =
|
|
921
|
+
var FieldValue = z12.union([
|
|
581
922
|
LeafFieldValues,
|
|
582
923
|
DataFieldValue,
|
|
583
924
|
FieldGroupValue
|
|
@@ -608,7 +949,7 @@ function schemaPriority(schema) {
|
|
|
608
949
|
return idx === -1 ? 9999 : idx;
|
|
609
950
|
}
|
|
610
951
|
function safeUnion(schemas) {
|
|
611
|
-
return
|
|
952
|
+
return z12.any().superRefine((val, ctx) => {
|
|
612
953
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
613
954
|
if (successful.length === 1) {
|
|
614
955
|
return;
|
|
@@ -653,21 +994,14 @@ var FieldUpdateValue = safeUnion([
|
|
|
653
994
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
654
995
|
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
655
996
|
CustomFieldValue.describe("CustomFieldValue"),
|
|
656
|
-
HiddenFieldValue.describe("HiddenFieldValue")
|
|
997
|
+
HiddenFieldValue.describe("HiddenFieldValue"),
|
|
998
|
+
AutocompleteUpdateValue.describe("AutocompleteUpdateValue")
|
|
657
999
|
]);
|
|
658
1000
|
|
|
659
|
-
// ../commons/src/uuid.ts
|
|
660
|
-
var import_uuid = require("uuid");
|
|
661
|
-
var z10 = __toESM(require("zod/v4"));
|
|
662
|
-
var UUID = z10.uuid().brand("UUID");
|
|
663
|
-
function getUUID() {
|
|
664
|
-
return (0, import_uuid.v4)();
|
|
665
|
-
}
|
|
666
|
-
|
|
667
1001
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
668
|
-
var
|
|
669
|
-
var SerializedUserField =
|
|
670
|
-
$userField:
|
|
1002
|
+
var z13 = __toESM(require("zod/v4"));
|
|
1003
|
+
var SerializedUserField = z13.object({
|
|
1004
|
+
$userField: z13.enum([
|
|
671
1005
|
"id",
|
|
672
1006
|
"name",
|
|
673
1007
|
"role",
|
|
@@ -681,7 +1015,7 @@ var SerializedUserField = z11.object({
|
|
|
681
1015
|
"primaryOfficeId",
|
|
682
1016
|
"administrativeAreaId"
|
|
683
1017
|
]),
|
|
684
|
-
$location:
|
|
1018
|
+
$location: z13.string().optional()
|
|
685
1019
|
});
|
|
686
1020
|
function userSerializer(userField) {
|
|
687
1021
|
return {
|
|
@@ -704,514 +1038,14 @@ function userSerializer(userField) {
|
|
|
704
1038
|
var import_v4 = require("zod/v4");
|
|
705
1039
|
|
|
706
1040
|
// ../commons/src/events/EventMetadata.ts
|
|
707
|
-
var
|
|
1041
|
+
var z16 = __toESM(require("zod/v4"));
|
|
708
1042
|
|
|
709
1043
|
// ../commons/src/events/ActionDocument.ts
|
|
710
|
-
var z15 = __toESM(require("zod/v4"));
|
|
711
|
-
|
|
712
|
-
// ../commons/src/authentication.ts
|
|
713
|
-
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
714
1044
|
var z14 = __toESM(require("zod/v4"));
|
|
715
|
-
|
|
716
|
-
// ../commons/src/scopes.ts
|
|
717
|
-
var z13 = __toESM(require("zod/v4"));
|
|
718
|
-
var qs = __toESM(require("qs"));
|
|
719
|
-
|
|
720
|
-
// ../commons/src/scopes.deprecated.do-not-use.ts
|
|
721
|
-
var z12 = __toESM(require("zod/v4"));
|
|
722
|
-
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
723
|
-
var rawConfigurableScope = z12.string().regex(rawConfigurableScopeRegex);
|
|
724
|
-
var SearchScope = z12.object({
|
|
725
|
-
type: z12.literal("search"),
|
|
726
|
-
options: z12.object({
|
|
727
|
-
event: z12.array(z12.string()).length(1),
|
|
728
|
-
access: z12.array(z12.enum(["my-jurisdiction", "all"])).length(1)
|
|
729
|
-
})
|
|
730
|
-
});
|
|
731
|
-
var CreateUserScope = z12.object({
|
|
732
|
-
type: z12.literal("user.create"),
|
|
733
|
-
options: z12.object({
|
|
734
|
-
role: z12.array(z12.string())
|
|
735
|
-
})
|
|
736
|
-
});
|
|
737
|
-
var EditUserScope = z12.object({
|
|
738
|
-
type: z12.literal("user.edit"),
|
|
739
|
-
options: z12.object({
|
|
740
|
-
role: z12.array(z12.string())
|
|
741
|
-
})
|
|
742
|
-
});
|
|
743
|
-
var WorkqueueScope = z12.object({
|
|
744
|
-
type: z12.literal("workqueue"),
|
|
745
|
-
options: z12.object({
|
|
746
|
-
id: z12.array(z12.string())
|
|
747
|
-
})
|
|
748
|
-
});
|
|
749
|
-
var PrintCertifiedCopiesScope = z12.object({
|
|
750
|
-
type: z12.literal("record.registered.print-certified-copies"),
|
|
751
|
-
options: z12.object({
|
|
752
|
-
event: z12.array(z12.string()).describe("Event type, e.g. birth, death"),
|
|
753
|
-
templates: z12.array(z12.string()).optional().describe(
|
|
754
|
-
"Template IDs for certified copies. If not provided, all templates will be used."
|
|
755
|
-
)
|
|
756
|
-
})
|
|
757
|
-
});
|
|
758
|
-
var LegacyRecordScope = z12.object({
|
|
759
|
-
type: z12.enum([
|
|
760
|
-
"record.create",
|
|
761
|
-
"record.read",
|
|
762
|
-
"record.declare",
|
|
763
|
-
"record.notify",
|
|
764
|
-
"record.declared.edit",
|
|
765
|
-
"record.declared.validate",
|
|
766
|
-
"record.declared.reject",
|
|
767
|
-
"record.declared.archive",
|
|
768
|
-
"record.declared.review-duplicates",
|
|
769
|
-
"record.register",
|
|
770
|
-
"record.registered.request-correction",
|
|
771
|
-
"record.registered.correct",
|
|
772
|
-
"record.unassign-others"
|
|
773
|
-
]),
|
|
774
|
-
options: z12.object({
|
|
775
|
-
event: z12.array(z12.string()).describe("Event type, e.g. birth, death")
|
|
776
|
-
})
|
|
777
|
-
}).describe(
|
|
778
|
-
"Scopes used to check user's permission to perform actions on a record."
|
|
779
|
-
);
|
|
780
|
-
var ConfigurableRawScopes = z12.discriminatedUnion("type", [
|
|
781
|
-
SearchScope,
|
|
782
|
-
LegacyRecordScope,
|
|
783
|
-
PrintCertifiedCopiesScope,
|
|
784
|
-
CreateUserScope,
|
|
785
|
-
EditUserScope,
|
|
786
|
-
WorkqueueScope
|
|
787
|
-
]);
|
|
788
|
-
|
|
789
|
-
// ../commons/src/scopes.ts
|
|
790
|
-
var SCOPES = {
|
|
791
|
-
// TODO v1.8 legacy scopes
|
|
792
|
-
BYPASSRATELIMIT: "bypassratelimit",
|
|
793
|
-
REGISTER: "register",
|
|
794
|
-
DEMO: "demo",
|
|
795
|
-
CONFIG: "config",
|
|
796
|
-
// systems / integrations
|
|
797
|
-
WEBHOOK: "webhook",
|
|
798
|
-
NATIONALID: "nationalId",
|
|
799
|
-
NOTIFICATION_API: "notification-api",
|
|
800
|
-
RECORDSEARCH: "recordsearch",
|
|
801
|
-
RECORD_IMPORT: "record.import",
|
|
802
|
-
RECORD_EXPORT: "record.export",
|
|
803
|
-
RECORD_REINDEX: "record.reindex",
|
|
804
|
-
INTEGRATION_CREATE: "integration.create",
|
|
805
|
-
// declare
|
|
806
|
-
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
807
|
-
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
808
|
-
RECORD_DECLARE_DEATH: "record.declare-death",
|
|
809
|
-
RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction",
|
|
810
|
-
RECORD_DECLARE_MARRIAGE: "record.declare-marriage",
|
|
811
|
-
RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction",
|
|
812
|
-
RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete",
|
|
813
|
-
// @todo: should this record be removed from events v2?
|
|
814
|
-
RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review",
|
|
815
|
-
RECORD_UNASSIGN_OTHERS: "record.unassign-others",
|
|
816
|
-
// validate
|
|
817
|
-
RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval",
|
|
818
|
-
RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates",
|
|
819
|
-
RECORD_DECLARATION_EDIT: "record.declaration-edit",
|
|
820
|
-
RECORD_REVIEW_DUPLICATES: "record.review-duplicates",
|
|
821
|
-
RECORD_DECLARATION_ARCHIVE: "record.declaration-archive",
|
|
822
|
-
RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate",
|
|
823
|
-
// register
|
|
824
|
-
RECORD_REGISTER: "record.register",
|
|
825
|
-
/**
|
|
826
|
-
* This scope is used to **print and **issue certified copies of a record
|
|
827
|
-
* after it has been registered. Previously Registrars had this permission.
|
|
828
|
-
*/
|
|
829
|
-
RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies",
|
|
830
|
-
// correct
|
|
831
|
-
RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction",
|
|
832
|
-
RECORD_REGISTRATION_CORRECT: "record.registration-correct",
|
|
833
|
-
RECORD_CONFIRM_REGISTRATION: "record.confirm-registration",
|
|
834
|
-
RECORD_REJECT_REGISTRATION: "record.reject-registration",
|
|
835
|
-
// search
|
|
836
|
-
SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction",
|
|
837
|
-
SEARCH_BIRTH: "search.birth",
|
|
838
|
-
SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction",
|
|
839
|
-
SEARCH_DEATH: "search.death",
|
|
840
|
-
SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction",
|
|
841
|
-
SEARCH_MARRIAGE: "search.marriage",
|
|
842
|
-
// audit v1.8
|
|
843
|
-
RECORD_READ: "record.read",
|
|
844
|
-
// profile
|
|
845
|
-
PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature",
|
|
846
|
-
// performance
|
|
847
|
-
PERFORMANCE_READ: "performance.read",
|
|
848
|
-
PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards",
|
|
849
|
-
PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export",
|
|
850
|
-
// organisation
|
|
851
|
-
ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all",
|
|
852
|
-
ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office",
|
|
853
|
-
ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction",
|
|
854
|
-
// user
|
|
855
|
-
USER_READ: "user.read:all",
|
|
856
|
-
USER_READ_MY_OFFICE: "user.read:my-office",
|
|
857
|
-
USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction",
|
|
858
|
-
USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit",
|
|
859
|
-
//v1.8
|
|
860
|
-
USER_CREATE: "user.create:all",
|
|
861
|
-
USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction",
|
|
862
|
-
USER_UPDATE: "user.update:all",
|
|
863
|
-
USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction",
|
|
864
|
-
// config
|
|
865
|
-
CONFIG_UPDATE_ALL: "config.update:all",
|
|
866
|
-
// data seeding
|
|
867
|
-
USER_DATA_SEEDING: "user.data-seeding",
|
|
868
|
-
// attachment
|
|
869
|
-
ATTACHMENT_UPLOAD: "attachment.upload"
|
|
870
|
-
};
|
|
871
|
-
var LegacyScopes = z13.union([
|
|
872
|
-
z13.literal(SCOPES.BYPASSRATELIMIT),
|
|
873
|
-
z13.literal(SCOPES.REGISTER),
|
|
874
|
-
z13.literal(SCOPES.DEMO),
|
|
875
|
-
z13.literal(SCOPES.CONFIG)
|
|
876
|
-
]);
|
|
877
|
-
var IntegrationScopes = z13.union([
|
|
878
|
-
z13.literal(SCOPES.WEBHOOK),
|
|
879
|
-
z13.literal(SCOPES.NATIONALID),
|
|
880
|
-
z13.literal(SCOPES.NOTIFICATION_API),
|
|
881
|
-
z13.literal(SCOPES.RECORDSEARCH),
|
|
882
|
-
z13.literal(SCOPES.INTEGRATION_CREATE)
|
|
883
|
-
]);
|
|
884
|
-
var InternalOperationsScopes = z13.union([
|
|
885
|
-
z13.literal(SCOPES.RECORD_REINDEX),
|
|
886
|
-
z13.literal(SCOPES.RECORD_IMPORT)
|
|
887
|
-
]);
|
|
888
|
-
var PerformanceScopes = z13.union([
|
|
889
|
-
z13.literal(SCOPES.PERFORMANCE_READ),
|
|
890
|
-
z13.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
891
|
-
z13.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
892
|
-
]);
|
|
893
|
-
var OrganisationScopes = z13.union([
|
|
894
|
-
z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
895
|
-
z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
896
|
-
z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
897
|
-
]);
|
|
898
|
-
var UserScopes = z13.union([
|
|
899
|
-
z13.literal(SCOPES.USER_READ),
|
|
900
|
-
z13.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
901
|
-
z13.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
902
|
-
z13.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
903
|
-
z13.literal(SCOPES.USER_CREATE),
|
|
904
|
-
z13.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
905
|
-
z13.literal(SCOPES.USER_UPDATE),
|
|
906
|
-
z13.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
907
|
-
]);
|
|
908
|
-
var ConfigScope = z13.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
909
|
-
var DataSeedingScope = z13.literal(SCOPES.USER_DATA_SEEDING);
|
|
910
|
-
var AttachmentScope = z13.literal(SCOPES.ATTACHMENT_UPLOAD);
|
|
911
|
-
var LiteralScopes = z13.union([
|
|
912
|
-
LegacyScopes,
|
|
913
|
-
IntegrationScopes,
|
|
914
|
-
z13.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
915
|
-
z13.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
916
|
-
PerformanceScopes,
|
|
917
|
-
OrganisationScopes,
|
|
918
|
-
UserScopes,
|
|
919
|
-
ConfigScope,
|
|
920
|
-
DataSeedingScope,
|
|
921
|
-
InternalOperationsScopes,
|
|
922
|
-
AttachmentScope
|
|
923
|
-
]);
|
|
924
|
-
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
925
|
-
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
926
|
-
);
|
|
927
|
-
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
928
|
-
var RecordScopeTypeV2 = z13.enum([
|
|
929
|
-
"record.search",
|
|
930
|
-
"record.create",
|
|
931
|
-
"record.read",
|
|
932
|
-
"record.declare",
|
|
933
|
-
"record.notify",
|
|
934
|
-
"record.edit",
|
|
935
|
-
"record.reject",
|
|
936
|
-
"record.archive",
|
|
937
|
-
"record.review-duplicates",
|
|
938
|
-
"record.register",
|
|
939
|
-
"record.print-certified-copies",
|
|
940
|
-
"record.request-correction",
|
|
941
|
-
"record.correct",
|
|
942
|
-
"record.unassign-others",
|
|
943
|
-
"record.custom-action"
|
|
944
|
-
]);
|
|
945
|
-
var scopeByEvent = z13.preprocess(
|
|
946
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
947
|
-
z13.array(z13.string()).optional()
|
|
948
|
-
).describe("Event type, e.g. birth, death");
|
|
949
|
-
var scopeOptionsPlaceEvent = z13.object({
|
|
950
|
-
event: scopeByEvent,
|
|
951
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
952
|
-
}).describe("Options applicable to all record scopes.");
|
|
953
|
-
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
954
|
-
declaredIn: JurisdictionFilter.optional(),
|
|
955
|
-
declaredBy: UserFilter.optional()
|
|
956
|
-
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
957
|
-
var ScopeOptionsFull = scopeOptionsDeclared.extend({
|
|
958
|
-
registeredIn: JurisdictionFilter.optional(),
|
|
959
|
-
registeredBy: UserFilter.optional()
|
|
960
|
-
}).describe(
|
|
961
|
-
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
962
|
-
);
|
|
963
|
-
var CustomActionScopeOptions = ScopeOptionsFull.extend({
|
|
964
|
-
customActionTypes: z13.preprocess(
|
|
965
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
966
|
-
z13.array(z13.string()).optional()
|
|
967
|
-
).describe("Allowed custom action types")
|
|
968
|
-
});
|
|
969
|
-
var ScopeOptionKey = ScopeOptionsFull.keyof();
|
|
970
|
-
var ResolvedScopeOptionsPlaceEvent = z13.object({
|
|
971
|
-
event: scopeByEvent,
|
|
972
|
-
placeOfEvent: UUID.nullish()
|
|
973
|
-
}).describe(
|
|
974
|
-
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
975
|
-
);
|
|
976
|
-
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
977
|
-
declaredIn: UUID.nullish(),
|
|
978
|
-
declaredBy: z13.string().optional()
|
|
979
|
-
}).describe(
|
|
980
|
-
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
981
|
-
);
|
|
982
|
-
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
983
|
-
registeredIn: UUID.nullish(),
|
|
984
|
-
registeredBy: z13.string().optional()
|
|
985
|
-
}).describe(
|
|
986
|
-
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
987
|
-
);
|
|
988
|
-
var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
|
|
989
|
-
"record.create",
|
|
990
|
-
"record.declare",
|
|
991
|
-
"record.notify"
|
|
992
|
-
]);
|
|
993
|
-
var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
994
|
-
"record.edit",
|
|
995
|
-
"record.reject",
|
|
996
|
-
"record.archive",
|
|
997
|
-
"record.review-duplicates",
|
|
998
|
-
"record.register"
|
|
999
|
-
]);
|
|
1000
|
-
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
1001
|
-
"record.search",
|
|
1002
|
-
"record.read",
|
|
1003
|
-
"record.request-correction",
|
|
1004
|
-
"record.correct",
|
|
1005
|
-
"record.unassign-others"
|
|
1006
|
-
]);
|
|
1007
|
-
var ScopeOptionsPrintCertifiedCopies = ScopeOptionsFull.extend({
|
|
1008
|
-
templates: z13.preprocess(
|
|
1009
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
1010
|
-
z13.array(z13.string()).optional()
|
|
1011
|
-
).describe(
|
|
1012
|
-
"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."
|
|
1013
|
-
)
|
|
1014
|
-
});
|
|
1015
|
-
var RecordScopeV2 = z13.discriminatedUnion("type", [
|
|
1016
|
-
z13.object({
|
|
1017
|
-
type: ScopesWithPlaceEventOptions,
|
|
1018
|
-
options: scopeOptionsPlaceEvent.optional()
|
|
1019
|
-
}),
|
|
1020
|
-
z13.object({
|
|
1021
|
-
type: ScopesWithDeclaredOptions,
|
|
1022
|
-
options: scopeOptionsDeclared.optional()
|
|
1023
|
-
}),
|
|
1024
|
-
z13.object({
|
|
1025
|
-
type: ScopesWithFullOptions,
|
|
1026
|
-
options: ScopeOptionsFull.optional()
|
|
1027
|
-
}),
|
|
1028
|
-
z13.object({
|
|
1029
|
-
type: z13.literal("record.custom-action"),
|
|
1030
|
-
options: CustomActionScopeOptions.optional()
|
|
1031
|
-
}),
|
|
1032
|
-
z13.object({
|
|
1033
|
-
type: z13.literal("record.print-certified-copies"),
|
|
1034
|
-
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
1035
|
-
})
|
|
1036
|
-
]).describe(
|
|
1037
|
-
"Scopes used to check user's permission to perform actions on a record."
|
|
1038
|
-
);
|
|
1039
|
-
var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
|
|
1040
|
-
z13.object({
|
|
1041
|
-
type: ScopesWithPlaceEventOptions,
|
|
1042
|
-
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
1043
|
-
}),
|
|
1044
|
-
z13.object({
|
|
1045
|
-
type: ScopesWithDeclaredOptions,
|
|
1046
|
-
options: ResolvedScopeOptionsDeclared.optional()
|
|
1047
|
-
}),
|
|
1048
|
-
z13.object({
|
|
1049
|
-
type: ScopesWithFullOptions,
|
|
1050
|
-
options: ResolvedScopeOptionsFull.optional()
|
|
1051
|
-
}),
|
|
1052
|
-
z13.object({
|
|
1053
|
-
type: z13.literal("record.print-certified-copies"),
|
|
1054
|
-
options: ResolvedScopeOptionsFull.extend({
|
|
1055
|
-
templates: z13.array(z13.string()).optional()
|
|
1056
|
-
}).optional()
|
|
1057
|
-
})
|
|
1058
|
-
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
1059
|
-
var flattenScope = (scope) => ({
|
|
1060
|
-
type: scope.type,
|
|
1061
|
-
...scope.options
|
|
1062
|
-
});
|
|
1063
|
-
var encodeScope = (scope) => {
|
|
1064
|
-
const flattened = flattenScope(scope);
|
|
1065
|
-
return qs.stringify(flattened, {
|
|
1066
|
-
arrayFormat: "comma",
|
|
1067
|
-
allowDots: true,
|
|
1068
|
-
addQueryPrefix: false,
|
|
1069
|
-
encode: false
|
|
1070
|
-
});
|
|
1071
|
-
};
|
|
1072
|
-
var DEFAULT_SCOPE_OPTIONS = {
|
|
1073
|
-
placeOfEvent: JurisdictionFilter.enum.all
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
// ../commons/src/authentication.ts
|
|
1077
|
-
var DEFAULT_ROLES_DEFINITION = [
|
|
1078
|
-
{
|
|
1079
|
-
id: "FIELD_AGENT",
|
|
1080
|
-
label: {
|
|
1081
|
-
defaultMessage: "Field Agent",
|
|
1082
|
-
description: "Name for user role Field Agent",
|
|
1083
|
-
id: "userRole.fieldAgent"
|
|
1084
|
-
},
|
|
1085
|
-
scopes: [
|
|
1086
|
-
encodeScope({
|
|
1087
|
-
type: "record.create",
|
|
1088
|
-
options: {
|
|
1089
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1090
|
-
}
|
|
1091
|
-
}),
|
|
1092
|
-
encodeScope({
|
|
1093
|
-
type: "record.declare",
|
|
1094
|
-
options: {
|
|
1095
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1096
|
-
}
|
|
1097
|
-
})
|
|
1098
|
-
]
|
|
1099
|
-
},
|
|
1100
|
-
{
|
|
1101
|
-
id: "REGISTRATION_AGENT",
|
|
1102
|
-
label: {
|
|
1103
|
-
defaultMessage: "Registration Agent",
|
|
1104
|
-
description: "Name for user role Registration Agent",
|
|
1105
|
-
id: "userRole.registrationAgent"
|
|
1106
|
-
},
|
|
1107
|
-
scopes: [
|
|
1108
|
-
encodeScope({
|
|
1109
|
-
type: "record.create",
|
|
1110
|
-
options: {
|
|
1111
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1112
|
-
}
|
|
1113
|
-
}),
|
|
1114
|
-
encodeScope({
|
|
1115
|
-
type: "record.declare",
|
|
1116
|
-
options: {
|
|
1117
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1118
|
-
}
|
|
1119
|
-
}),
|
|
1120
|
-
SCOPES.PERFORMANCE_READ,
|
|
1121
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1122
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1123
|
-
SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
|
|
1124
|
-
]
|
|
1125
|
-
},
|
|
1126
|
-
{
|
|
1127
|
-
id: "LOCAL_REGISTRAR",
|
|
1128
|
-
label: {
|
|
1129
|
-
defaultMessage: "Local Registrar",
|
|
1130
|
-
description: "Name for user role Local Registrar",
|
|
1131
|
-
id: "userRole.localRegistrar"
|
|
1132
|
-
},
|
|
1133
|
-
scopes: [
|
|
1134
|
-
encodeScope({
|
|
1135
|
-
type: "record.create",
|
|
1136
|
-
options: {
|
|
1137
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1138
|
-
}
|
|
1139
|
-
}),
|
|
1140
|
-
encodeScope({
|
|
1141
|
-
type: "record.declare",
|
|
1142
|
-
options: {
|
|
1143
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1144
|
-
}
|
|
1145
|
-
}),
|
|
1146
|
-
encodeScope({
|
|
1147
|
-
type: "record.review-duplicates",
|
|
1148
|
-
options: {
|
|
1149
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1150
|
-
}
|
|
1151
|
-
}),
|
|
1152
|
-
SCOPES.PERFORMANCE_READ,
|
|
1153
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1154
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1155
|
-
SCOPES.PROFILE_ELECTRONIC_SIGNATURE,
|
|
1156
|
-
SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
|
|
1157
|
-
]
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
id: "LOCAL_SYSTEM_ADMIN",
|
|
1161
|
-
label: {
|
|
1162
|
-
defaultMessage: "Local System Admin",
|
|
1163
|
-
description: "Name for user role Local System Admin",
|
|
1164
|
-
id: "userRole.localSystemAdmin"
|
|
1165
|
-
},
|
|
1166
|
-
scopes: [
|
|
1167
|
-
SCOPES.USER_READ_MY_OFFICE,
|
|
1168
|
-
SCOPES.USER_CREATE_MY_JURISDICTION,
|
|
1169
|
-
SCOPES.USER_UPDATE_MY_JURISDICTION,
|
|
1170
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1171
|
-
SCOPES.PERFORMANCE_READ,
|
|
1172
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1173
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
1174
|
-
]
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
id: "NATIONAL_SYSTEM_ADMIN",
|
|
1178
|
-
label: {
|
|
1179
|
-
defaultMessage: "National System Admin",
|
|
1180
|
-
description: "Name for user role National System Admin",
|
|
1181
|
-
id: "userRole.nationalSystemAdmin"
|
|
1182
|
-
},
|
|
1183
|
-
scopes: [
|
|
1184
|
-
SCOPES.USER_CREATE,
|
|
1185
|
-
SCOPES.USER_READ,
|
|
1186
|
-
SCOPES.USER_UPDATE,
|
|
1187
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1188
|
-
SCOPES.PERFORMANCE_READ,
|
|
1189
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1190
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
1191
|
-
]
|
|
1192
|
-
},
|
|
1193
|
-
{
|
|
1194
|
-
id: "PERFORMANCE_MANAGER",
|
|
1195
|
-
label: {
|
|
1196
|
-
defaultMessage: "Performance Manager",
|
|
1197
|
-
description: "Name for user role Performance Manager",
|
|
1198
|
-
id: "userRole.performanceManager"
|
|
1199
|
-
},
|
|
1200
|
-
scopes: [
|
|
1201
|
-
SCOPES.PERFORMANCE_READ,
|
|
1202
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1203
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
1204
|
-
]
|
|
1205
|
-
}
|
|
1206
|
-
];
|
|
1207
|
-
var TokenUserType = z14.enum(["user", "system"]);
|
|
1208
|
-
var TokenWithBearer = z14.string().regex(/^Bearer\s/);
|
|
1209
|
-
|
|
1210
|
-
// ../commons/src/events/ActionDocument.ts
|
|
1211
|
-
var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
|
|
1045
|
+
var ActionUpdate = z14.record(z14.string(), FieldUpdateValue).describe(
|
|
1212
1046
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1213
1047
|
);
|
|
1214
|
-
var EventState =
|
|
1048
|
+
var EventState = z14.record(z14.string(), FieldValue).describe(
|
|
1215
1049
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1216
1050
|
);
|
|
1217
1051
|
var ActionStatus = {
|
|
@@ -1219,15 +1053,15 @@ var ActionStatus = {
|
|
|
1219
1053
|
Accepted: "Accepted",
|
|
1220
1054
|
Rejected: "Rejected"
|
|
1221
1055
|
};
|
|
1222
|
-
var ActionBase =
|
|
1056
|
+
var ActionBase = z14.object({
|
|
1223
1057
|
id: UUID.describe("Unique identifier of the action."),
|
|
1224
|
-
transactionId:
|
|
1058
|
+
transactionId: z14.string().describe("Unique identifier of the transaction."),
|
|
1225
1059
|
createdByUserType: TokenUserType.describe(
|
|
1226
1060
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1227
1061
|
),
|
|
1228
|
-
createdAt:
|
|
1229
|
-
createdBy:
|
|
1230
|
-
createdByRole:
|
|
1062
|
+
createdAt: z14.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1063
|
+
createdBy: z14.string().describe("Identifier of the user who created the action."),
|
|
1064
|
+
createdByRole: z14.string().optional().describe("Role of the user who created the action."),
|
|
1231
1065
|
createdBySignature: DocumentPath.nullish().describe(
|
|
1232
1066
|
"Reference to the signature of the user who created the action."
|
|
1233
1067
|
),
|
|
@@ -1239,7 +1073,7 @@ var ActionBase = z15.object({
|
|
|
1239
1073
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1240
1074
|
),
|
|
1241
1075
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1242
|
-
status:
|
|
1076
|
+
status: z14.enum([
|
|
1243
1077
|
ActionStatus.Requested,
|
|
1244
1078
|
ActionStatus.Accepted,
|
|
1245
1079
|
ActionStatus.Rejected
|
|
@@ -1251,132 +1085,132 @@ var ActionBase = z15.object({
|
|
|
1251
1085
|
)
|
|
1252
1086
|
});
|
|
1253
1087
|
var AssignedAction = ActionBase.extend(
|
|
1254
|
-
|
|
1255
|
-
type:
|
|
1256
|
-
assignedTo:
|
|
1088
|
+
z14.object({
|
|
1089
|
+
type: z14.literal(ActionType.ASSIGN),
|
|
1090
|
+
assignedTo: z14.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1257
1091
|
// TODO move into 'content' property
|
|
1258
1092
|
}).shape
|
|
1259
1093
|
);
|
|
1260
1094
|
var UnassignedAction = ActionBase.extend(
|
|
1261
|
-
|
|
1262
|
-
type:
|
|
1095
|
+
z14.object({
|
|
1096
|
+
type: z14.literal(ActionType.UNASSIGN)
|
|
1263
1097
|
}).shape
|
|
1264
1098
|
);
|
|
1265
1099
|
var RegisterAction = ActionBase.extend(
|
|
1266
|
-
|
|
1267
|
-
type:
|
|
1268
|
-
registrationNumber:
|
|
1100
|
+
z14.object({
|
|
1101
|
+
type: z14.literal(ActionType.REGISTER),
|
|
1102
|
+
registrationNumber: z14.string().optional().describe(
|
|
1269
1103
|
"Registration number of the event. Always present for accepted registrations."
|
|
1270
1104
|
)
|
|
1271
1105
|
// TODO move into 'content' property
|
|
1272
1106
|
}).shape
|
|
1273
1107
|
);
|
|
1274
1108
|
var DeclareAction = ActionBase.extend(
|
|
1275
|
-
|
|
1276
|
-
type:
|
|
1109
|
+
z14.object({
|
|
1110
|
+
type: z14.literal(ActionType.DECLARE)
|
|
1277
1111
|
}).shape
|
|
1278
1112
|
);
|
|
1279
|
-
var ReasonContent =
|
|
1280
|
-
reason:
|
|
1113
|
+
var ReasonContent = z14.object({
|
|
1114
|
+
reason: z14.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1281
1115
|
"Message describing the reason for rejecting or archiving the event."
|
|
1282
1116
|
)
|
|
1283
1117
|
});
|
|
1284
1118
|
var RejectAction = ActionBase.extend(
|
|
1285
|
-
|
|
1286
|
-
type:
|
|
1119
|
+
z14.object({
|
|
1120
|
+
type: z14.literal(ActionType.REJECT),
|
|
1287
1121
|
content: ReasonContent
|
|
1288
1122
|
}).shape
|
|
1289
1123
|
);
|
|
1290
|
-
var PotentialDuplicate =
|
|
1124
|
+
var PotentialDuplicate = z14.object({
|
|
1291
1125
|
id: UUID,
|
|
1292
|
-
trackingId:
|
|
1126
|
+
trackingId: z14.string()
|
|
1293
1127
|
});
|
|
1294
1128
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
1295
|
-
|
|
1296
|
-
type:
|
|
1297
|
-
content:
|
|
1298
|
-
duplicates:
|
|
1129
|
+
z14.object({
|
|
1130
|
+
type: z14.literal(ActionType.DUPLICATE_DETECTED),
|
|
1131
|
+
content: z14.object({
|
|
1132
|
+
duplicates: z14.array(PotentialDuplicate)
|
|
1299
1133
|
})
|
|
1300
1134
|
}).shape
|
|
1301
1135
|
);
|
|
1302
1136
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1303
|
-
|
|
1304
|
-
type:
|
|
1137
|
+
z14.object({
|
|
1138
|
+
type: z14.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1305
1139
|
}).shape
|
|
1306
1140
|
);
|
|
1307
1141
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1308
|
-
|
|
1309
|
-
type:
|
|
1310
|
-
content:
|
|
1142
|
+
z14.object({
|
|
1143
|
+
type: z14.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1144
|
+
content: z14.object({
|
|
1311
1145
|
duplicateOf: UUID
|
|
1312
1146
|
}).optional()
|
|
1313
1147
|
}).shape
|
|
1314
1148
|
);
|
|
1315
1149
|
var ArchiveAction = ActionBase.extend(
|
|
1316
|
-
|
|
1317
|
-
type:
|
|
1150
|
+
z14.object({
|
|
1151
|
+
type: z14.literal(ActionType.ARCHIVE),
|
|
1318
1152
|
content: ReasonContent
|
|
1319
1153
|
}).shape
|
|
1320
1154
|
);
|
|
1321
1155
|
var CreatedAction = ActionBase.extend(
|
|
1322
|
-
|
|
1323
|
-
type:
|
|
1156
|
+
z14.object({
|
|
1157
|
+
type: z14.literal(ActionType.CREATE)
|
|
1324
1158
|
}).shape
|
|
1325
1159
|
);
|
|
1326
1160
|
var NotifiedAction = ActionBase.extend(
|
|
1327
|
-
|
|
1328
|
-
type:
|
|
1161
|
+
z14.object({
|
|
1162
|
+
type: z14.literal(ActionType.NOTIFY)
|
|
1329
1163
|
}).shape
|
|
1330
1164
|
);
|
|
1331
1165
|
var EditAction = ActionBase.extend(
|
|
1332
|
-
|
|
1333
|
-
type:
|
|
1334
|
-
content:
|
|
1335
|
-
comment:
|
|
1166
|
+
z14.object({
|
|
1167
|
+
type: z14.literal(ActionType.EDIT),
|
|
1168
|
+
content: z14.object({
|
|
1169
|
+
comment: z14.string().describe("Comment for the edit action.").optional()
|
|
1336
1170
|
})
|
|
1337
1171
|
}).shape
|
|
1338
1172
|
);
|
|
1339
|
-
var PrintContent =
|
|
1340
|
-
templateId:
|
|
1173
|
+
var PrintContent = z14.object({
|
|
1174
|
+
templateId: z14.string().optional()
|
|
1341
1175
|
});
|
|
1342
1176
|
var PrintCertificateAction = ActionBase.extend(
|
|
1343
|
-
|
|
1344
|
-
type:
|
|
1177
|
+
z14.object({
|
|
1178
|
+
type: z14.literal(ActionType.PRINT_CERTIFICATE),
|
|
1345
1179
|
content: PrintContent.optional().nullable()
|
|
1346
1180
|
}).shape
|
|
1347
1181
|
);
|
|
1348
1182
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1349
|
-
|
|
1350
|
-
type:
|
|
1183
|
+
z14.object({
|
|
1184
|
+
type: z14.literal(ActionType.REQUEST_CORRECTION)
|
|
1351
1185
|
}).shape
|
|
1352
1186
|
);
|
|
1353
1187
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1354
|
-
|
|
1355
|
-
type:
|
|
1356
|
-
requestId:
|
|
1188
|
+
z14.object({
|
|
1189
|
+
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1190
|
+
requestId: z14.string()
|
|
1357
1191
|
// TODO move into 'content' property
|
|
1358
1192
|
}).shape
|
|
1359
1193
|
);
|
|
1360
1194
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1361
|
-
|
|
1362
|
-
type:
|
|
1363
|
-
requestId:
|
|
1195
|
+
z14.object({
|
|
1196
|
+
type: z14.literal(ActionType.REJECT_CORRECTION),
|
|
1197
|
+
requestId: z14.string(),
|
|
1364
1198
|
// TODO move into 'content' property
|
|
1365
1199
|
content: ReasonContent
|
|
1366
1200
|
}).shape
|
|
1367
1201
|
);
|
|
1368
1202
|
var ReadAction = ActionBase.extend(
|
|
1369
|
-
|
|
1370
|
-
type:
|
|
1203
|
+
z14.object({
|
|
1204
|
+
type: z14.literal(ActionType.READ)
|
|
1371
1205
|
}).shape
|
|
1372
1206
|
);
|
|
1373
1207
|
var CustomAction = ActionBase.merge(
|
|
1374
|
-
|
|
1375
|
-
type:
|
|
1376
|
-
customActionType:
|
|
1208
|
+
z14.object({
|
|
1209
|
+
type: z14.literal(ActionType.CUSTOM),
|
|
1210
|
+
customActionType: z14.string()
|
|
1377
1211
|
})
|
|
1378
1212
|
);
|
|
1379
|
-
var ActionDocument =
|
|
1213
|
+
var ActionDocument = z14.discriminatedUnion("type", [
|
|
1380
1214
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1381
1215
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1382
1216
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1402,15 +1236,15 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1402
1236
|
declaration: true,
|
|
1403
1237
|
annotation: true
|
|
1404
1238
|
}).extend(
|
|
1405
|
-
|
|
1406
|
-
type:
|
|
1407
|
-
status:
|
|
1239
|
+
z14.object({
|
|
1240
|
+
type: z14.enum(ConfirmableActions),
|
|
1241
|
+
status: z14.literal(ActionStatus.Rejected)
|
|
1408
1242
|
}).shape
|
|
1409
1243
|
);
|
|
1410
|
-
var Action =
|
|
1244
|
+
var Action = z14.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1411
1245
|
|
|
1412
1246
|
// ../commons/src/events/Flag.ts
|
|
1413
|
-
var
|
|
1247
|
+
var z15 = __toESM(require("zod/v4"));
|
|
1414
1248
|
var InherentFlags = {
|
|
1415
1249
|
INCOMPLETE: "incomplete",
|
|
1416
1250
|
REJECTED: "rejected",
|
|
@@ -1424,7 +1258,7 @@ var InherentFlags = {
|
|
|
1424
1258
|
*/
|
|
1425
1259
|
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1426
1260
|
};
|
|
1427
|
-
var ActionFlag =
|
|
1261
|
+
var ActionFlag = z15.string().regex(
|
|
1428
1262
|
new RegExp(
|
|
1429
1263
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1430
1264
|
ActionStatus
|
|
@@ -1432,73 +1266,73 @@ var ActionFlag = z16.string().regex(
|
|
|
1432
1266
|
),
|
|
1433
1267
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1434
1268
|
);
|
|
1435
|
-
var CustomFlag =
|
|
1269
|
+
var CustomFlag = z15.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1436
1270
|
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1437
1271
|
InherentFlags
|
|
1438
1272
|
).join(", ")}`
|
|
1439
1273
|
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1440
1274
|
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1441
1275
|
}).describe("Custom flag identifier defined by the country config.");
|
|
1442
|
-
var Flag = ActionFlag.or(
|
|
1443
|
-
var FlagConfig =
|
|
1276
|
+
var Flag = ActionFlag.or(z15.enum(InherentFlags)).or(CustomFlag);
|
|
1277
|
+
var FlagConfig = z15.object({
|
|
1444
1278
|
id: CustomFlag,
|
|
1445
|
-
requiresAction:
|
|
1279
|
+
requiresAction: z15.boolean().describe(
|
|
1446
1280
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1447
1281
|
),
|
|
1448
1282
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1449
1283
|
});
|
|
1450
|
-
var ActionFlagConfig =
|
|
1284
|
+
var ActionFlagConfig = z15.object({
|
|
1451
1285
|
id: Flag,
|
|
1452
|
-
operation:
|
|
1286
|
+
operation: z15.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1453
1287
|
conditional: Conditional.optional().describe(
|
|
1454
1288
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1455
1289
|
)
|
|
1456
1290
|
});
|
|
1457
1291
|
|
|
1458
1292
|
// ../commons/src/events/EventMetadata.ts
|
|
1459
|
-
var EventStatus =
|
|
1293
|
+
var EventStatus = z16.enum([
|
|
1460
1294
|
"CREATED",
|
|
1461
1295
|
"NOTIFIED",
|
|
1462
1296
|
"DECLARED",
|
|
1463
1297
|
"REGISTERED",
|
|
1464
1298
|
"ARCHIVED"
|
|
1465
1299
|
]);
|
|
1466
|
-
var ZodDate =
|
|
1467
|
-
var ZodDateTime =
|
|
1468
|
-
var ActionCreationMetadata =
|
|
1469
|
-
createdAt:
|
|
1470
|
-
createdBy:
|
|
1300
|
+
var ZodDate = z16.iso.date();
|
|
1301
|
+
var ZodDateTime = z16.string().datetime();
|
|
1302
|
+
var ActionCreationMetadata = z16.object({
|
|
1303
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1304
|
+
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1471
1305
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1472
1306
|
createdAtLocation: UUID.nullish().describe(
|
|
1473
1307
|
"Location of the user who created the action request."
|
|
1474
1308
|
),
|
|
1475
|
-
createdByUserType:
|
|
1476
|
-
acceptedAt:
|
|
1477
|
-
createdByRole:
|
|
1478
|
-
createdBySignature:
|
|
1309
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1310
|
+
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1311
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation."),
|
|
1312
|
+
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1479
1313
|
});
|
|
1480
1314
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1481
|
-
registrationNumber:
|
|
1315
|
+
registrationNumber: z16.string().describe(
|
|
1482
1316
|
"Registration number of the event. Always present for accepted registrations."
|
|
1483
1317
|
)
|
|
1484
1318
|
});
|
|
1485
|
-
var LegalStatuses =
|
|
1319
|
+
var LegalStatuses = z16.object({
|
|
1486
1320
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1487
1321
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1488
1322
|
});
|
|
1489
|
-
var EventMetadata =
|
|
1323
|
+
var EventMetadata = z16.object({
|
|
1490
1324
|
id: UUID,
|
|
1491
|
-
type:
|
|
1325
|
+
type: z16.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1492
1326
|
status: EventStatus,
|
|
1493
1327
|
legalStatuses: LegalStatuses.describe(
|
|
1494
1328
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1495
1329
|
),
|
|
1496
|
-
createdAt:
|
|
1330
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1497
1331
|
dateOfEvent: ZodDate.nullish(),
|
|
1498
1332
|
placeOfEvent: UUID.nullish(),
|
|
1499
|
-
createdBy:
|
|
1500
|
-
createdByUserType:
|
|
1501
|
-
updatedByUserRole:
|
|
1333
|
+
createdBy: z16.string().describe("ID of the user who created the event."),
|
|
1334
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1335
|
+
updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
|
|
1502
1336
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1503
1337
|
createdAtLocation: UUID.nullish().describe(
|
|
1504
1338
|
"Location of the user who created the event."
|
|
@@ -1509,18 +1343,18 @@ var EventMetadata = z17.object({
|
|
|
1509
1343
|
updatedAtLocation: UUID.nullish().describe(
|
|
1510
1344
|
"Location of the user who last changed the status."
|
|
1511
1345
|
),
|
|
1512
|
-
updatedAt:
|
|
1346
|
+
updatedAt: z16.iso.datetime().describe(
|
|
1513
1347
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1514
1348
|
),
|
|
1515
|
-
assignedTo:
|
|
1516
|
-
updatedBy:
|
|
1517
|
-
trackingId:
|
|
1349
|
+
assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1350
|
+
updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
|
|
1351
|
+
trackingId: z16.string().describe(
|
|
1518
1352
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1519
1353
|
),
|
|
1520
|
-
potentialDuplicates:
|
|
1354
|
+
potentialDuplicates: z16.array(PotentialDuplicate).describe(
|
|
1521
1355
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1522
1356
|
),
|
|
1523
|
-
flags:
|
|
1357
|
+
flags: z16.array(Flag)
|
|
1524
1358
|
});
|
|
1525
1359
|
var EventMetadataKeysArray = [
|
|
1526
1360
|
"id",
|
|
@@ -1541,8 +1375,8 @@ var EventMetadataKeysArray = [
|
|
|
1541
1375
|
"legalStatuses",
|
|
1542
1376
|
"flags"
|
|
1543
1377
|
];
|
|
1544
|
-
var EventMetadataKeys =
|
|
1545
|
-
var EventMetadataDateFieldIdInput =
|
|
1378
|
+
var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
1379
|
+
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1546
1380
|
"createdAt",
|
|
1547
1381
|
"updatedAt",
|
|
1548
1382
|
"legalStatuses.DECLARED.createdAt",
|
|
@@ -1550,7 +1384,7 @@ var EventMetadataDateFieldIdInput = z17.enum([
|
|
|
1550
1384
|
"legalStatuses.REGISTERED.createdAt",
|
|
1551
1385
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1552
1386
|
]);
|
|
1553
|
-
var EventMetadataDateFieldId =
|
|
1387
|
+
var EventMetadataDateFieldId = z16.enum([
|
|
1554
1388
|
"event.createdAt",
|
|
1555
1389
|
"event.updatedAt",
|
|
1556
1390
|
"event.legalStatuses.DECLARED.createdAt",
|
|
@@ -1658,8 +1492,8 @@ var QueryExpression = import_v4.z.object({
|
|
|
1658
1492
|
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1659
1493
|
"legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
|
|
1660
1494
|
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1661
|
-
createdAtLocation: import_v4.z.optional(Within),
|
|
1662
|
-
updatedAtLocation: import_v4.z.optional(Within),
|
|
1495
|
+
createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1496
|
+
updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1663
1497
|
assignedTo: import_v4.z.optional(Exact),
|
|
1664
1498
|
createdByUserType: import_v4.z.optional(ExactUserType),
|
|
1665
1499
|
updatedByUserRole: import_v4.z.optional(Exact),
|
|
@@ -1752,7 +1586,7 @@ function todayDateTimeValueSerializer() {
|
|
|
1752
1586
|
// ../commons/src/users/userReferences.ts
|
|
1753
1587
|
var import_v42 = __toESM(require("zod/v4"));
|
|
1754
1588
|
var ScopeOptionReference = import_v42.default.object({
|
|
1755
|
-
$scope:
|
|
1589
|
+
$scope: ScopeType,
|
|
1756
1590
|
$option: ScopeOptionKey
|
|
1757
1591
|
});
|
|
1758
1592
|
var JurisdictionReference = import_v42.default.object({
|
|
@@ -2238,16 +2072,32 @@ var DataField = BaseField.extend({
|
|
|
2238
2072
|
data: import_v43.default.array(DataEntry)
|
|
2239
2073
|
})
|
|
2240
2074
|
}).describe("Data field for displaying read-only data");
|
|
2075
|
+
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2076
|
+
var ButtonType = import_v43.default.enum([
|
|
2077
|
+
"primary",
|
|
2078
|
+
"secondary",
|
|
2079
|
+
"tertiary",
|
|
2080
|
+
"positive",
|
|
2081
|
+
"negative",
|
|
2082
|
+
"secondaryNegative",
|
|
2083
|
+
"icon",
|
|
2084
|
+
"iconPrimary"
|
|
2085
|
+
]);
|
|
2086
|
+
var TextColor = import_v43.default.enum(["primary", "copy"]);
|
|
2087
|
+
var TextVariant = import_v43.default.enum(["bold14", "reg14"]);
|
|
2088
|
+
var ButtonConfiguration = import_v43.default.object({
|
|
2089
|
+
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit."),
|
|
2090
|
+
loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2091
|
+
buttonSize: ButtonSize.optional().describe("Size of the button."),
|
|
2092
|
+
buttonType: ButtonType.optional().describe("Type of the button."),
|
|
2093
|
+
textColor: TextColor.optional().describe("Color of the text."),
|
|
2094
|
+
textVariant: TextVariant.optional().describe("Variant of the text."),
|
|
2095
|
+
text: TranslationConfig.describe("Text to display on the button")
|
|
2096
|
+
});
|
|
2241
2097
|
var ButtonField = BaseField.extend({
|
|
2242
2098
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2243
2099
|
defaultValue: ButtonFieldValue.optional(),
|
|
2244
|
-
configuration:
|
|
2245
|
-
icon: import_v43.default.string().optional().describe(
|
|
2246
|
-
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
2247
|
-
),
|
|
2248
|
-
loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2249
|
-
text: TranslationConfig.describe("Text to display on the button")
|
|
2250
|
-
})
|
|
2100
|
+
configuration: ButtonConfiguration
|
|
2251
2101
|
}).describe("Generic button without any built-in functionality");
|
|
2252
2102
|
var FieldGroup = BaseField.extend({
|
|
2253
2103
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
@@ -2279,6 +2129,19 @@ var HttpField = BaseField.extend({
|
|
|
2279
2129
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2280
2130
|
})
|
|
2281
2131
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
2132
|
+
var AutocompleteField = BaseField.extend({
|
|
2133
|
+
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2134
|
+
configuration: import_v43.default.object({
|
|
2135
|
+
url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
|
|
2136
|
+
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2137
|
+
defaultOptions: import_v43.default.array(
|
|
2138
|
+
import_v43.default.object({
|
|
2139
|
+
label: import_v43.default.string(),
|
|
2140
|
+
value: import_v43.default.string()
|
|
2141
|
+
})
|
|
2142
|
+
).optional()
|
|
2143
|
+
})
|
|
2144
|
+
}).describe("Autocomplete input field");
|
|
2282
2145
|
var SearchField = HttpField.extend({
|
|
2283
2146
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2284
2147
|
configuration: SearchQuery.pick({
|
|
@@ -2364,8 +2227,11 @@ var CustomField = BaseField.extend({
|
|
|
2364
2227
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2365
2228
|
configuration: import_v43.default.unknown().optional()
|
|
2366
2229
|
});
|
|
2230
|
+
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2367
2231
|
var LoaderField = BaseField.extend({
|
|
2368
2232
|
type: import_v43.default.literal(FieldType.LOADER),
|
|
2233
|
+
variant: FieldStyleVariant.default("default").optional(),
|
|
2234
|
+
hideLabel: import_v43.default.boolean().default(true).optional().describe("Loader field does not show a label by default"),
|
|
2369
2235
|
configuration: import_v43.default.object({
|
|
2370
2236
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2371
2237
|
})
|
|
@@ -2422,6 +2288,7 @@ var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
|
2422
2288
|
ButtonField,
|
|
2423
2289
|
AlphaPrintButton,
|
|
2424
2290
|
HttpField,
|
|
2291
|
+
AutocompleteField,
|
|
2425
2292
|
LinkButtonField,
|
|
2426
2293
|
VerificationStatus,
|
|
2427
2294
|
QrReaderField,
|
|
@@ -2443,18 +2310,18 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2443
2310
|
]);
|
|
2444
2311
|
|
|
2445
2312
|
// ../commons/src/events/FormConfig.ts
|
|
2446
|
-
var
|
|
2313
|
+
var z22 = __toESM(require("zod/v4"));
|
|
2447
2314
|
|
|
2448
2315
|
// ../commons/src/events/PageConfig.ts
|
|
2449
|
-
var
|
|
2450
|
-
var PageTypes =
|
|
2451
|
-
var PageConfigBase =
|
|
2452
|
-
id:
|
|
2316
|
+
var z21 = __toESM(require("zod/v4"));
|
|
2317
|
+
var PageTypes = z21.enum(["FORM", "VERIFICATION"]);
|
|
2318
|
+
var PageConfigBase = z21.object({
|
|
2319
|
+
id: z21.string().describe("Unique identifier for the page"),
|
|
2453
2320
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2454
|
-
requireCompletionToContinue:
|
|
2321
|
+
requireCompletionToContinue: z21.boolean().default(false).describe(
|
|
2455
2322
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2456
2323
|
),
|
|
2457
|
-
fields:
|
|
2324
|
+
fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2458
2325
|
conditional: Conditional.optional().describe(
|
|
2459
2326
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2460
2327
|
)
|
|
@@ -2463,13 +2330,13 @@ var PageConfigBase = z22.object({
|
|
|
2463
2330
|
id: "FormPageConfig"
|
|
2464
2331
|
});
|
|
2465
2332
|
var FormPageConfig = PageConfigBase.extend({
|
|
2466
|
-
type:
|
|
2333
|
+
type: z21.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2467
2334
|
});
|
|
2468
|
-
var VerificationActionConfig =
|
|
2469
|
-
verify:
|
|
2470
|
-
cancel:
|
|
2335
|
+
var VerificationActionConfig = z21.object({
|
|
2336
|
+
verify: z21.object({ label: TranslationConfig }),
|
|
2337
|
+
cancel: z21.object({
|
|
2471
2338
|
label: TranslationConfig,
|
|
2472
|
-
confirmation:
|
|
2339
|
+
confirmation: z21.object({
|
|
2473
2340
|
title: TranslationConfig,
|
|
2474
2341
|
body: TranslationConfig
|
|
2475
2342
|
})
|
|
@@ -2479,31 +2346,31 @@ var VerificationActionConfig = z22.object({
|
|
|
2479
2346
|
id: "VerificationActionConfig"
|
|
2480
2347
|
});
|
|
2481
2348
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2482
|
-
type:
|
|
2349
|
+
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2483
2350
|
actions: VerificationActionConfig
|
|
2484
2351
|
});
|
|
2485
|
-
var PageConfig =
|
|
2352
|
+
var PageConfig = z21.discriminatedUnion("type", [
|
|
2486
2353
|
FormPageConfig,
|
|
2487
2354
|
VerificationPageConfig
|
|
2488
2355
|
]);
|
|
2489
2356
|
|
|
2490
2357
|
// ../commons/src/events/FormConfig.ts
|
|
2491
|
-
var DeclarationFormConfig =
|
|
2358
|
+
var DeclarationFormConfig = z22.object({
|
|
2492
2359
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2493
|
-
pages:
|
|
2360
|
+
pages: z22.array(FormPageConfig)
|
|
2494
2361
|
}).describe("Configuration of the declaration form.");
|
|
2495
|
-
var ActionFormConfig =
|
|
2362
|
+
var ActionFormConfig = z22.object({
|
|
2496
2363
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2497
|
-
pages:
|
|
2364
|
+
pages: z22.array(PageConfig)
|
|
2498
2365
|
}).describe(
|
|
2499
2366
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2500
2367
|
);
|
|
2501
|
-
var FormConfig =
|
|
2368
|
+
var FormConfig = z22.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2502
2369
|
|
|
2503
2370
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2504
|
-
var
|
|
2505
|
-
var FieldReference2 =
|
|
2506
|
-
var Matcher =
|
|
2371
|
+
var z23 = __toESM(require("zod/v4"));
|
|
2372
|
+
var FieldReference2 = z23.string();
|
|
2373
|
+
var Matcher = z23.object({
|
|
2507
2374
|
/**
|
|
2508
2375
|
* Reference to the field used in matching.
|
|
2509
2376
|
*
|
|
@@ -2511,23 +2378,23 @@ var Matcher = z24.object({
|
|
|
2511
2378
|
* be used as the origin date to calculate the distance from.
|
|
2512
2379
|
*/
|
|
2513
2380
|
fieldId: FieldReference2,
|
|
2514
|
-
options:
|
|
2515
|
-
boost:
|
|
2381
|
+
options: z23.object({
|
|
2382
|
+
boost: z23.number().optional(),
|
|
2516
2383
|
matchAgainst: FieldReference2.optional()
|
|
2517
2384
|
}).optional().default({
|
|
2518
2385
|
boost: 1
|
|
2519
2386
|
})
|
|
2520
2387
|
});
|
|
2521
2388
|
var FuzzyMatcher = Matcher.extend({
|
|
2522
|
-
type:
|
|
2523
|
-
options:
|
|
2389
|
+
type: z23.literal("fuzzy"),
|
|
2390
|
+
options: z23.object({
|
|
2524
2391
|
/**
|
|
2525
2392
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2526
2393
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2527
2394
|
* Names of length >7 characters = 2 edits allowed
|
|
2528
2395
|
*/
|
|
2529
|
-
fuzziness:
|
|
2530
|
-
boost:
|
|
2396
|
+
fuzziness: z23.union([z23.string(), z23.number()]).optional().default("AUTO:4,7"),
|
|
2397
|
+
boost: z23.number().optional().default(1),
|
|
2531
2398
|
matchAgainst: FieldReference2.optional()
|
|
2532
2399
|
}).optional().default({
|
|
2533
2400
|
fuzziness: "AUTO:4,7",
|
|
@@ -2535,48 +2402,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
2535
2402
|
})
|
|
2536
2403
|
});
|
|
2537
2404
|
var StrictMatcher = Matcher.extend({
|
|
2538
|
-
type:
|
|
2539
|
-
options:
|
|
2540
|
-
boost:
|
|
2405
|
+
type: z23.literal("strict"),
|
|
2406
|
+
options: z23.object({
|
|
2407
|
+
boost: z23.number().optional().default(1),
|
|
2541
2408
|
/**
|
|
2542
2409
|
* The constant value to be present in the field for both records
|
|
2543
2410
|
*/
|
|
2544
|
-
value:
|
|
2411
|
+
value: z23.string().optional(),
|
|
2545
2412
|
matchAgainst: FieldReference2.optional()
|
|
2546
2413
|
}).optional().default({
|
|
2547
2414
|
boost: 1
|
|
2548
2415
|
})
|
|
2549
2416
|
});
|
|
2550
2417
|
var DateRangeMatcher = Matcher.extend({
|
|
2551
|
-
type:
|
|
2552
|
-
options:
|
|
2418
|
+
type: z23.literal("dateRange"),
|
|
2419
|
+
options: z23.object({
|
|
2553
2420
|
/**
|
|
2554
2421
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2555
2422
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2556
2423
|
*/
|
|
2557
|
-
pivot:
|
|
2558
|
-
days:
|
|
2559
|
-
boost:
|
|
2424
|
+
pivot: z23.number().optional(),
|
|
2425
|
+
days: z23.number(),
|
|
2426
|
+
boost: z23.number().optional().default(1),
|
|
2560
2427
|
matchAgainst: FieldReference2.optional()
|
|
2561
2428
|
})
|
|
2562
2429
|
});
|
|
2563
|
-
var Not =
|
|
2564
|
-
type:
|
|
2430
|
+
var Not = z23.object({
|
|
2431
|
+
type: z23.literal("not"),
|
|
2565
2432
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2566
|
-
clause:
|
|
2433
|
+
clause: z23.lazy(() => Clause)
|
|
2567
2434
|
});
|
|
2568
|
-
var And =
|
|
2569
|
-
type:
|
|
2435
|
+
var And = z23.object({
|
|
2436
|
+
type: z23.literal("and"),
|
|
2570
2437
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2571
|
-
clauses:
|
|
2438
|
+
clauses: z23.lazy(() => Clause.array())
|
|
2572
2439
|
});
|
|
2573
|
-
var Or =
|
|
2574
|
-
type:
|
|
2440
|
+
var Or = z23.object({
|
|
2441
|
+
type: z23.literal("or"),
|
|
2575
2442
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2576
|
-
clauses:
|
|
2443
|
+
clauses: z23.lazy(() => Clause.array())
|
|
2577
2444
|
});
|
|
2578
|
-
var Clause =
|
|
2579
|
-
() =>
|
|
2445
|
+
var Clause = z23.lazy(
|
|
2446
|
+
() => z23.discriminatedUnion("type", [
|
|
2580
2447
|
Not,
|
|
2581
2448
|
And,
|
|
2582
2449
|
Or,
|
|
@@ -2587,22 +2454,22 @@ var Clause = z24.lazy(
|
|
|
2587
2454
|
).meta({
|
|
2588
2455
|
id: "Clause"
|
|
2589
2456
|
});
|
|
2590
|
-
var DeduplicationConfig =
|
|
2591
|
-
id:
|
|
2457
|
+
var DeduplicationConfig = z23.object({
|
|
2458
|
+
id: z23.string(),
|
|
2592
2459
|
label: TranslationConfig,
|
|
2593
2460
|
query: Clause
|
|
2594
2461
|
});
|
|
2595
2462
|
|
|
2596
2463
|
// ../commons/src/events/ActionConfig.ts
|
|
2597
|
-
var DeclarationReviewConfig =
|
|
2464
|
+
var DeclarationReviewConfig = z24.object({
|
|
2598
2465
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2599
|
-
fields:
|
|
2466
|
+
fields: z24.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2600
2467
|
}).describe(
|
|
2601
2468
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2602
2469
|
);
|
|
2603
|
-
var ActionConfigBase =
|
|
2470
|
+
var ActionConfigBase = z24.object({
|
|
2604
2471
|
label: TranslationConfig.describe("Human readable description of the action"),
|
|
2605
|
-
flags:
|
|
2472
|
+
flags: z24.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2606
2473
|
supportingCopy: TranslationConfig.optional().describe(
|
|
2607
2474
|
"Text displayed on the confirmation dialog"
|
|
2608
2475
|
),
|
|
@@ -2613,28 +2480,28 @@ var ActionConfigBase = z25.object({
|
|
|
2613
2480
|
* "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."
|
|
2614
2481
|
* for EventConfig.d.ts.
|
|
2615
2482
|
*/
|
|
2616
|
-
icon:
|
|
2617
|
-
conditionals:
|
|
2483
|
+
icon: z24.string().describe("Icon representing the action").optional(),
|
|
2484
|
+
conditionals: z24.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2618
2485
|
});
|
|
2619
2486
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2620
2487
|
deduplication: DeduplicationConfig.optional()
|
|
2621
2488
|
});
|
|
2622
2489
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2623
|
-
|
|
2624
|
-
type:
|
|
2490
|
+
z24.object({
|
|
2491
|
+
type: z24.literal(ActionType.READ),
|
|
2625
2492
|
review: DeclarationReviewConfig.describe(
|
|
2626
2493
|
"Configuration of the review page for read-only view."
|
|
2627
2494
|
),
|
|
2628
|
-
conditionals:
|
|
2495
|
+
conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2629
2496
|
}).shape
|
|
2630
2497
|
);
|
|
2631
2498
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2632
|
-
|
|
2633
|
-
type:
|
|
2499
|
+
z24.object({
|
|
2500
|
+
type: z24.literal(ActionType.DECLARE),
|
|
2634
2501
|
review: DeclarationReviewConfig.describe(
|
|
2635
2502
|
"Configuration of the review page fields."
|
|
2636
2503
|
),
|
|
2637
|
-
dialogCopy:
|
|
2504
|
+
dialogCopy: z24.object({
|
|
2638
2505
|
notify: TranslationConfig.describe(
|
|
2639
2506
|
"Confirmation text for the notify action"
|
|
2640
2507
|
),
|
|
@@ -2648,14 +2515,14 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2648
2515
|
}).shape
|
|
2649
2516
|
);
|
|
2650
2517
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2651
|
-
|
|
2652
|
-
type:
|
|
2518
|
+
z24.object({
|
|
2519
|
+
type: z24.literal(ActionType.ARCHIVE)
|
|
2653
2520
|
}).shape
|
|
2654
2521
|
);
|
|
2655
2522
|
var EditActionConfig = ActionConfigBase.extend(
|
|
2656
|
-
|
|
2657
|
-
type:
|
|
2658
|
-
dialogCopy:
|
|
2523
|
+
z24.object({
|
|
2524
|
+
type: z24.literal(ActionType.EDIT),
|
|
2525
|
+
dialogCopy: z24.object({
|
|
2659
2526
|
notify: TranslationConfig.describe(
|
|
2660
2527
|
"Confirmation text for the notify with edits action"
|
|
2661
2528
|
),
|
|
@@ -2669,33 +2536,33 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2669
2536
|
}).shape
|
|
2670
2537
|
);
|
|
2671
2538
|
var RejectConfig = ActionConfigBase.extend(
|
|
2672
|
-
|
|
2673
|
-
type:
|
|
2539
|
+
z24.object({
|
|
2540
|
+
type: z24.literal(ActionType.REJECT)
|
|
2674
2541
|
}).shape
|
|
2675
2542
|
);
|
|
2676
2543
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2677
|
-
|
|
2678
|
-
type:
|
|
2544
|
+
z24.object({
|
|
2545
|
+
type: z24.literal(ActionType.REGISTER)
|
|
2679
2546
|
}).shape
|
|
2680
2547
|
);
|
|
2681
2548
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
2682
|
-
|
|
2683
|
-
type:
|
|
2549
|
+
z24.object({
|
|
2550
|
+
type: z24.literal(ActionType.PRINT_CERTIFICATE),
|
|
2684
2551
|
printForm: ActionFormConfig
|
|
2685
2552
|
}).shape
|
|
2686
2553
|
);
|
|
2687
2554
|
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
2688
|
-
|
|
2689
|
-
type:
|
|
2555
|
+
z24.object({
|
|
2556
|
+
type: z24.literal(ActionType.REQUEST_CORRECTION),
|
|
2690
2557
|
correctionForm: ActionFormConfig
|
|
2691
2558
|
}).shape
|
|
2692
2559
|
);
|
|
2693
2560
|
var CustomActionConfig = ActionConfigBase.merge(
|
|
2694
|
-
|
|
2695
|
-
type:
|
|
2696
|
-
customActionType:
|
|
2561
|
+
z24.object({
|
|
2562
|
+
type: z24.literal(ActionType.CUSTOM),
|
|
2563
|
+
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
2697
2564
|
/** 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. */
|
|
2698
|
-
form:
|
|
2565
|
+
form: z24.array(FieldConfig).describe(
|
|
2699
2566
|
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2700
2567
|
),
|
|
2701
2568
|
auditHistoryLabel: TranslationConfig.describe(
|
|
@@ -2703,7 +2570,7 @@ var CustomActionConfig = ActionConfigBase.merge(
|
|
|
2703
2570
|
)
|
|
2704
2571
|
})
|
|
2705
2572
|
);
|
|
2706
|
-
var ActionConfig =
|
|
2573
|
+
var ActionConfig = z24.discriminatedUnion("type", [
|
|
2707
2574
|
/*
|
|
2708
2575
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2709
2576
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2725,86 +2592,86 @@ var ActionConfig = z25.discriminatedUnion("type", [
|
|
|
2725
2592
|
var actionConfigTypes = new Set(
|
|
2726
2593
|
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2727
2594
|
);
|
|
2728
|
-
var DeclarationActionConfig =
|
|
2595
|
+
var DeclarationActionConfig = z24.discriminatedUnion("type", [
|
|
2729
2596
|
DeclareConfig,
|
|
2730
2597
|
RegisterConfig
|
|
2731
2598
|
]);
|
|
2732
2599
|
|
|
2733
2600
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2734
|
-
var
|
|
2735
|
-
var FontFamily =
|
|
2736
|
-
normal:
|
|
2737
|
-
bold:
|
|
2738
|
-
italics:
|
|
2739
|
-
bolditalics:
|
|
2740
|
-
});
|
|
2741
|
-
var CertificateConfig =
|
|
2742
|
-
id:
|
|
2743
|
-
event:
|
|
2744
|
-
isV2Template:
|
|
2601
|
+
var z25 = __toESM(require("zod/v4"));
|
|
2602
|
+
var FontFamily = z25.object({
|
|
2603
|
+
normal: z25.string(),
|
|
2604
|
+
bold: z25.string(),
|
|
2605
|
+
italics: z25.string(),
|
|
2606
|
+
bolditalics: z25.string()
|
|
2607
|
+
});
|
|
2608
|
+
var CertificateConfig = z25.object({
|
|
2609
|
+
id: z25.string(),
|
|
2610
|
+
event: z25.string(),
|
|
2611
|
+
isV2Template: z25.boolean().optional(),
|
|
2745
2612
|
label: TranslationConfig,
|
|
2746
|
-
isDefault:
|
|
2747
|
-
fee:
|
|
2748
|
-
onTime:
|
|
2749
|
-
late:
|
|
2750
|
-
delayed:
|
|
2613
|
+
isDefault: z25.boolean(),
|
|
2614
|
+
fee: z25.object({
|
|
2615
|
+
onTime: z25.number(),
|
|
2616
|
+
late: z25.number(),
|
|
2617
|
+
delayed: z25.number()
|
|
2751
2618
|
}),
|
|
2752
|
-
svgUrl:
|
|
2753
|
-
fonts:
|
|
2754
|
-
conditionals:
|
|
2619
|
+
svgUrl: z25.string(),
|
|
2620
|
+
fonts: z25.record(z25.string(), FontFamily).optional(),
|
|
2621
|
+
conditionals: z25.array(ShowConditional).optional()
|
|
2755
2622
|
});
|
|
2756
2623
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2757
|
-
hash:
|
|
2758
|
-
svg:
|
|
2624
|
+
hash: z25.string().optional(),
|
|
2625
|
+
svg: z25.string()
|
|
2759
2626
|
});
|
|
2760
2627
|
|
|
2761
2628
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2762
|
-
var
|
|
2763
|
-
var LanguageConfig =
|
|
2764
|
-
lang:
|
|
2629
|
+
var z26 = __toESM(require("zod/v4"));
|
|
2630
|
+
var LanguageConfig = z26.object({
|
|
2631
|
+
lang: z26.string(),
|
|
2765
2632
|
/**
|
|
2766
2633
|
* client.csv contents
|
|
2767
2634
|
*/
|
|
2768
|
-
messages:
|
|
2635
|
+
messages: z26.record(z26.string(), z26.string())
|
|
2769
2636
|
});
|
|
2770
2637
|
|
|
2771
2638
|
// ../commons/src/events/EventConfig.ts
|
|
2772
|
-
var
|
|
2639
|
+
var z33 = __toESM(require("zod/v4"));
|
|
2773
2640
|
|
|
2774
2641
|
// ../commons/src/events/SummaryConfig.ts
|
|
2775
|
-
var
|
|
2776
|
-
var BaseField2 =
|
|
2642
|
+
var z27 = __toESM(require("zod/v4"));
|
|
2643
|
+
var BaseField2 = z27.object({
|
|
2777
2644
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2778
2645
|
"Default message displayed when the field value is empty."
|
|
2779
2646
|
),
|
|
2780
|
-
conditionals:
|
|
2647
|
+
conditionals: z27.array(ShowConditional).default([]).optional()
|
|
2781
2648
|
});
|
|
2782
2649
|
var ReferenceField = BaseField2.extend({
|
|
2783
|
-
fieldId:
|
|
2650
|
+
fieldId: z27.string(),
|
|
2784
2651
|
label: TranslationConfig.optional().describe(
|
|
2785
2652
|
"Overrides the default label from the referenced field when provided."
|
|
2786
2653
|
)
|
|
2787
2654
|
}).describe("Field referencing existing event data by field ID.");
|
|
2788
2655
|
var Field = BaseField2.extend({
|
|
2789
|
-
id:
|
|
2656
|
+
id: z27.string().describe("Identifier of the summary field."),
|
|
2790
2657
|
value: TranslationConfig.describe(
|
|
2791
2658
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2792
2659
|
),
|
|
2793
2660
|
label: TranslationConfig
|
|
2794
2661
|
}).describe("Custom field defined for the summary view.");
|
|
2795
|
-
var SummaryConfig =
|
|
2796
|
-
fields:
|
|
2662
|
+
var SummaryConfig = z27.object({
|
|
2663
|
+
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2797
2664
|
}).describe("Configuration of the event summary section.");
|
|
2798
2665
|
|
|
2799
2666
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2800
|
-
var
|
|
2801
|
-
var MatchType =
|
|
2802
|
-
var BaseField3 =
|
|
2803
|
-
config:
|
|
2667
|
+
var z28 = __toESM(require("zod/v4"));
|
|
2668
|
+
var MatchType = z28.enum(["fuzzy", "exact", "range", "within"]);
|
|
2669
|
+
var BaseField3 = z28.object({
|
|
2670
|
+
config: z28.object({
|
|
2804
2671
|
type: MatchType.describe(
|
|
2805
2672
|
"Determines the search type of field. How to match value."
|
|
2806
2673
|
),
|
|
2807
|
-
searchFields:
|
|
2674
|
+
searchFields: z28.array(z28.string()).optional().describe(
|
|
2808
2675
|
`
|
|
2809
2676
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2810
2677
|
All specified fields will be combined using OR logic.
|
|
@@ -2814,7 +2681,7 @@ var BaseField3 = z29.object({
|
|
|
2814
2681
|
`
|
|
2815
2682
|
)
|
|
2816
2683
|
}),
|
|
2817
|
-
type:
|
|
2684
|
+
type: z28.nativeEnum(FieldType).optional().describe(
|
|
2818
2685
|
`
|
|
2819
2686
|
Explicitly specify the field type for searchFields.
|
|
2820
2687
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2828,7 +2695,7 @@ var BaseField3 = z29.object({
|
|
|
2828
2695
|
This is required when searchFields is defined.
|
|
2829
2696
|
`
|
|
2830
2697
|
),
|
|
2831
|
-
options:
|
|
2698
|
+
options: z28.array(SelectOption).optional(),
|
|
2832
2699
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2833
2700
|
`
|
|
2834
2701
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2849,7 +2716,7 @@ var BaseField3 = z29.object({
|
|
|
2849
2716
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2850
2717
|
`
|
|
2851
2718
|
),
|
|
2852
|
-
conditionals:
|
|
2719
|
+
conditionals: z28.array(FieldConditional).optional().describe(
|
|
2853
2720
|
`
|
|
2854
2721
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2855
2722
|
|
|
@@ -2863,20 +2730,20 @@ var BaseField3 = z29.object({
|
|
|
2863
2730
|
are always rendered in the advanced search form.
|
|
2864
2731
|
`
|
|
2865
2732
|
),
|
|
2866
|
-
validations:
|
|
2733
|
+
validations: z28.array(ValidationConfig).optional().describe(
|
|
2867
2734
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2868
2735
|
)
|
|
2869
2736
|
});
|
|
2870
|
-
var SearchQueryParams =
|
|
2871
|
-
eventType:
|
|
2737
|
+
var SearchQueryParams = z28.object({
|
|
2738
|
+
eventType: z28.string().optional().describe(
|
|
2872
2739
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2873
2740
|
)
|
|
2874
2741
|
}).catchall(FieldValue);
|
|
2875
2742
|
var FieldConfigSchema = BaseField3.extend({
|
|
2876
|
-
fieldId:
|
|
2877
|
-
fieldType:
|
|
2743
|
+
fieldId: z28.string(),
|
|
2744
|
+
fieldType: z28.literal("field")
|
|
2878
2745
|
});
|
|
2879
|
-
var EventFieldIdInput =
|
|
2746
|
+
var EventFieldIdInput = z28.enum([
|
|
2880
2747
|
"trackingId",
|
|
2881
2748
|
"status",
|
|
2882
2749
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2885,7 +2752,7 @@ var EventFieldIdInput = z29.enum([
|
|
|
2885
2752
|
"updatedAt"
|
|
2886
2753
|
]);
|
|
2887
2754
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2888
|
-
var EventFieldId =
|
|
2755
|
+
var EventFieldId = z28.enum([
|
|
2889
2756
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2890
2757
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2891
2758
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2895,29 +2762,29 @@ var EventFieldId = z29.enum([
|
|
|
2895
2762
|
]);
|
|
2896
2763
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2897
2764
|
fieldId: EventFieldId,
|
|
2898
|
-
fieldType:
|
|
2765
|
+
fieldType: z28.literal("event")
|
|
2899
2766
|
});
|
|
2900
|
-
var AdvancedSearchField =
|
|
2767
|
+
var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2901
2768
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2902
2769
|
if (!data.label) {
|
|
2903
2770
|
ctx.addIssue({
|
|
2904
|
-
code:
|
|
2771
|
+
code: z28.ZodIssueCode.custom,
|
|
2905
2772
|
message: "label is required when config.searchFields is defined.",
|
|
2906
2773
|
path: ["label"]
|
|
2907
2774
|
});
|
|
2908
2775
|
}
|
|
2909
2776
|
if (!data.type) {
|
|
2910
2777
|
ctx.addIssue({
|
|
2911
|
-
code:
|
|
2778
|
+
code: z28.ZodIssueCode.custom,
|
|
2912
2779
|
message: "type is required when config.searchFields is defined.",
|
|
2913
2780
|
path: ["type"]
|
|
2914
2781
|
});
|
|
2915
2782
|
}
|
|
2916
2783
|
}
|
|
2917
2784
|
});
|
|
2918
|
-
var AdvancedSearchConfig =
|
|
2785
|
+
var AdvancedSearchConfig = z28.object({
|
|
2919
2786
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2920
|
-
fields:
|
|
2787
|
+
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2921
2788
|
});
|
|
2922
2789
|
|
|
2923
2790
|
// ../commons/src/events/utils.ts
|
|
@@ -2926,14 +2793,14 @@ var import_lodash = require("lodash");
|
|
|
2926
2793
|
// ../commons/src/conditionals/validate.ts
|
|
2927
2794
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2928
2795
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2929
|
-
var
|
|
2796
|
+
var z31 = __toESM(require("zod/v4"));
|
|
2930
2797
|
var import_date_fns = require("date-fns");
|
|
2931
2798
|
|
|
2932
2799
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
2933
|
-
var
|
|
2800
|
+
var z30 = __toESM(require("zod/v4"));
|
|
2934
2801
|
|
|
2935
2802
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2936
|
-
var
|
|
2803
|
+
var z29 = __toESM(require("zod/v4"));
|
|
2937
2804
|
|
|
2938
2805
|
// ../commons/src/conditionals/validate.ts
|
|
2939
2806
|
var ajv = new import__.default({
|
|
@@ -2942,9 +2809,9 @@ var ajv = new import__.default({
|
|
|
2942
2809
|
strict: false
|
|
2943
2810
|
// Allow minContains and other newer features
|
|
2944
2811
|
});
|
|
2945
|
-
var DataContext =
|
|
2946
|
-
rootData:
|
|
2947
|
-
$leafAdminStructureLocationIds:
|
|
2812
|
+
var DataContext = z31.object({
|
|
2813
|
+
rootData: z31.object({
|
|
2814
|
+
$leafAdminStructureLocationIds: z31.array(z31.object({ id: UUID }))
|
|
2948
2815
|
})
|
|
2949
2816
|
});
|
|
2950
2817
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -3021,13 +2888,13 @@ ajv.addKeyword({
|
|
|
3021
2888
|
});
|
|
3022
2889
|
|
|
3023
2890
|
// ../commons/src/utils.ts
|
|
3024
|
-
var
|
|
2891
|
+
var z32 = __toESM(require("zod/v4"));
|
|
3025
2892
|
var _ = __toESM(require("lodash"));
|
|
3026
|
-
var FullNameV1 =
|
|
3027
|
-
|
|
3028
|
-
use:
|
|
3029
|
-
family:
|
|
3030
|
-
given:
|
|
2893
|
+
var FullNameV1 = z32.array(
|
|
2894
|
+
z32.object({
|
|
2895
|
+
use: z32.string(),
|
|
2896
|
+
family: z32.string(),
|
|
2897
|
+
given: z32.array(z32.string())
|
|
3031
2898
|
})
|
|
3032
2899
|
);
|
|
3033
2900
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -3761,11 +3628,11 @@ function validateActionOrder(event2, ctx) {
|
|
|
3761
3628
|
}
|
|
3762
3629
|
|
|
3763
3630
|
// ../commons/src/events/EventConfig.ts
|
|
3764
|
-
var EventFieldReference =
|
|
3631
|
+
var EventFieldReference = z33.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
3765
3632
|
"Reference to a field defined in the event metadata, using the field id."
|
|
3766
3633
|
);
|
|
3767
|
-
var _EventConfigBase =
|
|
3768
|
-
id:
|
|
3634
|
+
var _EventConfigBase = z33.object({
|
|
3635
|
+
id: z33.string().describe(
|
|
3769
3636
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
3770
3637
|
),
|
|
3771
3638
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -3784,19 +3651,19 @@ var _EventConfigBase = z34.object({
|
|
|
3784
3651
|
"Summary information displayed in the event overview."
|
|
3785
3652
|
),
|
|
3786
3653
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3787
|
-
actions:
|
|
3654
|
+
actions: z33.array(ActionConfig).describe(
|
|
3788
3655
|
"Configuration of system-defined actions associated with the event."
|
|
3789
3656
|
),
|
|
3790
|
-
actionOrder:
|
|
3657
|
+
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3791
3658
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
3792
3659
|
),
|
|
3793
3660
|
declaration: DeclarationFormConfig.describe(
|
|
3794
3661
|
"Configuration of the form used to gather event data."
|
|
3795
3662
|
),
|
|
3796
|
-
advancedSearch:
|
|
3663
|
+
advancedSearch: z33.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
3797
3664
|
"Configuration of fields available in the advanced search feature."
|
|
3798
3665
|
),
|
|
3799
|
-
flags:
|
|
3666
|
+
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3800
3667
|
"Configuration of flags associated with the actions of this event type."
|
|
3801
3668
|
)
|
|
3802
3669
|
});
|
|
@@ -3816,7 +3683,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
3816
3683
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
3817
3684
|
|
|
3818
3685
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3819
|
-
var
|
|
3686
|
+
var z37 = __toESM(require("zod/v4"));
|
|
3820
3687
|
|
|
3821
3688
|
// ../commons/src/searchConfigs.ts
|
|
3822
3689
|
function createSearchConfig(baseField) {
|
|
@@ -4017,17 +3884,17 @@ var event = Object.assign(eventFn, {
|
|
|
4017
3884
|
});
|
|
4018
3885
|
|
|
4019
3886
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
4020
|
-
var
|
|
3887
|
+
var z34 = __toESM(require("zod/v4"));
|
|
4021
3888
|
var WorkqueueColumnKeysArray = [
|
|
4022
3889
|
...EventMetadataKeysArray,
|
|
4023
3890
|
"title",
|
|
4024
3891
|
"outbox"
|
|
4025
3892
|
];
|
|
4026
|
-
var WorkqueueColumnKeys =
|
|
4027
|
-
var WorkqueueColumnValue =
|
|
3893
|
+
var WorkqueueColumnKeys = z34.enum(WorkqueueColumnKeysArray);
|
|
3894
|
+
var WorkqueueColumnValue = z34.object({
|
|
4028
3895
|
$event: WorkqueueColumnKeys
|
|
4029
3896
|
});
|
|
4030
|
-
var WorkqueueColumn =
|
|
3897
|
+
var WorkqueueColumn = z34.object({
|
|
4031
3898
|
label: TranslationConfig,
|
|
4032
3899
|
value: WorkqueueColumnValue
|
|
4033
3900
|
});
|
|
@@ -4038,55 +3905,59 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
4038
3905
|
}
|
|
4039
3906
|
|
|
4040
3907
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
4041
|
-
var
|
|
4042
|
-
var SerializableExact =
|
|
4043
|
-
type:
|
|
4044
|
-
term:
|
|
4045
|
-
});
|
|
4046
|
-
var SerializableWithin =
|
|
4047
|
-
type:
|
|
4048
|
-
location:
|
|
4049
|
-
});
|
|
4050
|
-
var SerializedQueryExpression =
|
|
4051
|
-
eventType:
|
|
4052
|
-
status:
|
|
4053
|
-
createdAt:
|
|
4054
|
-
updatedAt:
|
|
4055
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
4056
|
-
"legalStatuses.DECLARED.createdByRole":
|
|
4057
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
4058
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
4059
|
-
"legalStatuses.REGISTERED.createdByRole":
|
|
4060
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
4061
|
-
createdAtLocation:
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
3908
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3909
|
+
var SerializableExact = z35.object({
|
|
3910
|
+
type: z35.literal("exact"),
|
|
3911
|
+
term: z35.union([z35.string(), SerializedUserField])
|
|
3912
|
+
});
|
|
3913
|
+
var SerializableWithin = z35.object({
|
|
3914
|
+
type: z35.literal("within"),
|
|
3915
|
+
location: z35.union([z35.string(), SerializedUserField])
|
|
3916
|
+
});
|
|
3917
|
+
var SerializedQueryExpression = z35.object({
|
|
3918
|
+
eventType: z35.string(),
|
|
3919
|
+
status: z35.optional(z35.union([AnyOfStatus, ExactStatus])),
|
|
3920
|
+
createdAt: z35.optional(DateCondition),
|
|
3921
|
+
updatedAt: z35.optional(DateCondition),
|
|
3922
|
+
"legalStatuses.DECLARED.createdAtLocation": z35.optional(SerializableWithin),
|
|
3923
|
+
"legalStatuses.DECLARED.createdByRole": z35.optional(AnyOf),
|
|
3924
|
+
"legalStatuses.REGISTERED.createdAt": z35.optional(DateCondition),
|
|
3925
|
+
"legalStatuses.REGISTERED.createdAtLocation": z35.optional(SerializableWithin),
|
|
3926
|
+
"legalStatuses.REGISTERED.createdByRole": z35.optional(AnyOf),
|
|
3927
|
+
"legalStatuses.REGISTERED.registrationNumber": z35.optional(Exact),
|
|
3928
|
+
createdAtLocation: z35.optional(
|
|
3929
|
+
z35.union([SerializableWithin, SerializableExact])
|
|
3930
|
+
),
|
|
3931
|
+
updatedAtLocation: z35.optional(
|
|
3932
|
+
z35.union([SerializableWithin, SerializableExact])
|
|
3933
|
+
),
|
|
3934
|
+
updatedByUserRole: z35.optional(SerializableExact),
|
|
3935
|
+
assignedTo: z35.optional(SerializableExact),
|
|
3936
|
+
createdBy: z35.optional(SerializableExact),
|
|
4066
3937
|
createdByUserType: ExactUserType,
|
|
4067
|
-
updatedBy:
|
|
4068
|
-
trackingId:
|
|
4069
|
-
flags:
|
|
3938
|
+
updatedBy: z35.optional(SerializableExact),
|
|
3939
|
+
trackingId: z35.optional(Exact),
|
|
3940
|
+
flags: z35.optional(ContainsFlags),
|
|
4070
3941
|
data: QueryInput
|
|
4071
3942
|
}).partial();
|
|
4072
|
-
var Or2 =
|
|
4073
|
-
type:
|
|
4074
|
-
clauses:
|
|
3943
|
+
var Or2 = z35.object({
|
|
3944
|
+
type: z35.literal("or"),
|
|
3945
|
+
clauses: z35.array(SerializedQueryExpression)
|
|
4075
3946
|
});
|
|
4076
|
-
var And2 =
|
|
4077
|
-
type:
|
|
4078
|
-
clauses:
|
|
3947
|
+
var And2 = z35.object({
|
|
3948
|
+
type: z35.literal("and"),
|
|
3949
|
+
clauses: z35.array(SerializedQueryExpression)
|
|
4079
3950
|
});
|
|
4080
|
-
var CountryConfigQueryType =
|
|
4081
|
-
var CountryConfigQueryInputType =
|
|
3951
|
+
var CountryConfigQueryType = z35.discriminatedUnion("type", [And2, Or2]);
|
|
3952
|
+
var CountryConfigQueryInputType = z35.union([
|
|
4082
3953
|
SerializedQueryExpression,
|
|
4083
3954
|
And2,
|
|
4084
3955
|
Or2
|
|
4085
3956
|
]);
|
|
4086
3957
|
|
|
4087
3958
|
// ../commons/src/icons.ts
|
|
4088
|
-
var
|
|
4089
|
-
var AvailableIcons =
|
|
3959
|
+
var z36 = __toESM(require("zod/v4"));
|
|
3960
|
+
var AvailableIcons = z36.enum([
|
|
4090
3961
|
"Archived",
|
|
4091
3962
|
"Assigned",
|
|
4092
3963
|
"Briefcase",
|
|
@@ -4211,16 +4082,16 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
4211
4082
|
value: event.field("updatedAt")
|
|
4212
4083
|
}
|
|
4213
4084
|
]);
|
|
4214
|
-
var WorkqueueConfig =
|
|
4215
|
-
slug:
|
|
4085
|
+
var WorkqueueConfig = z37.object({
|
|
4086
|
+
slug: z37.string().describe("Determines the url of the workqueue."),
|
|
4216
4087
|
name: TranslationConfig.describe(
|
|
4217
4088
|
"Title of the workflow (both in navigation and on the page)"
|
|
4218
4089
|
),
|
|
4219
4090
|
query: CountryConfigQueryType,
|
|
4220
|
-
action:
|
|
4091
|
+
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4221
4092
|
"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."
|
|
4222
4093
|
),
|
|
4223
|
-
columns:
|
|
4094
|
+
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4224
4095
|
icon: AvailableIcons,
|
|
4225
4096
|
emptyMessage: TranslationConfig.optional()
|
|
4226
4097
|
}).describe("Configuration for workqueue.");
|
|
@@ -4228,23 +4099,23 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4228
4099
|
query: true,
|
|
4229
4100
|
columns: true
|
|
4230
4101
|
});
|
|
4231
|
-
var WorkqueueConfigInput =
|
|
4232
|
-
slug:
|
|
4102
|
+
var WorkqueueConfigInput = z37.object({
|
|
4103
|
+
slug: z37.string().describe("Determines the url of the workqueue."),
|
|
4233
4104
|
name: TranslationConfig.describe(
|
|
4234
4105
|
"Title of the workflow (both in navigation and on the page)"
|
|
4235
4106
|
),
|
|
4236
4107
|
query: CountryConfigQueryInputType,
|
|
4237
|
-
action:
|
|
4108
|
+
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4238
4109
|
"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."
|
|
4239
4110
|
),
|
|
4240
|
-
columns:
|
|
4111
|
+
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4241
4112
|
icon: AvailableIcons,
|
|
4242
4113
|
emptyMessage: TranslationConfig.optional()
|
|
4243
4114
|
});
|
|
4244
|
-
var WorkqueueCountInput =
|
|
4245
|
-
|
|
4115
|
+
var WorkqueueCountInput = z37.array(
|
|
4116
|
+
z37.object({ slug: z37.string(), query: QueryType })
|
|
4246
4117
|
);
|
|
4247
|
-
var WorkqueueCountOutput =
|
|
4118
|
+
var WorkqueueCountOutput = z37.record(z37.string(), z37.number());
|
|
4248
4119
|
|
|
4249
4120
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
4250
4121
|
var defaultWorkqueueColumns = [
|
|
@@ -4267,18 +4138,18 @@ var defaultWorkqueueColumns = [
|
|
|
4267
4138
|
];
|
|
4268
4139
|
|
|
4269
4140
|
// ../commons/src/events/Draft.ts
|
|
4270
|
-
var
|
|
4141
|
+
var z39 = __toESM(require("zod/v4"));
|
|
4271
4142
|
|
|
4272
4143
|
// ../commons/src/events/ActionInput.ts
|
|
4273
|
-
var
|
|
4274
|
-
var BaseActionInput =
|
|
4144
|
+
var z38 = __toESM(require("zod/v4"));
|
|
4145
|
+
var BaseActionInput = z38.object({
|
|
4275
4146
|
eventId: UUID,
|
|
4276
|
-
transactionId:
|
|
4147
|
+
transactionId: z38.string(),
|
|
4277
4148
|
declaration: ActionUpdate.default({}),
|
|
4278
4149
|
annotation: ActionUpdate.optional(),
|
|
4279
4150
|
originalActionId: UUID.optional(),
|
|
4280
4151
|
// should not be part of base action.
|
|
4281
|
-
keepAssignment:
|
|
4152
|
+
keepAssignment: z38.boolean().optional(),
|
|
4282
4153
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4283
4154
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4284
4155
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4286,8 +4157,8 @@ var BaseActionInput = z39.object({
|
|
|
4286
4157
|
)
|
|
4287
4158
|
});
|
|
4288
4159
|
var CreateActionInput = BaseActionInput.extend(
|
|
4289
|
-
|
|
4290
|
-
type:
|
|
4160
|
+
z38.object({
|
|
4161
|
+
type: z38.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
4291
4162
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4292
4163
|
createdAtLocation: UUID.nullish().describe(
|
|
4293
4164
|
"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."
|
|
@@ -4295,14 +4166,14 @@ var CreateActionInput = BaseActionInput.extend(
|
|
|
4295
4166
|
}).shape
|
|
4296
4167
|
);
|
|
4297
4168
|
var RegisterActionInput = BaseActionInput.extend(
|
|
4298
|
-
|
|
4299
|
-
type:
|
|
4300
|
-
registrationNumber:
|
|
4169
|
+
z38.strictObject({
|
|
4170
|
+
type: z38.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
4171
|
+
registrationNumber: z38.string().optional()
|
|
4301
4172
|
}).shape
|
|
4302
4173
|
);
|
|
4303
4174
|
var NotifyActionInput = BaseActionInput.extend(
|
|
4304
|
-
|
|
4305
|
-
type:
|
|
4175
|
+
z38.object({
|
|
4176
|
+
type: z38.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
|
|
4306
4177
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4307
4178
|
createdAtLocation: UUID.nullish().describe(
|
|
4308
4179
|
"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."
|
|
@@ -4318,100 +4189,100 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
4318
4189
|
}
|
|
4319
4190
|
});
|
|
4320
4191
|
var DeclareActionInput = BaseActionInput.extend(
|
|
4321
|
-
|
|
4322
|
-
type:
|
|
4192
|
+
z38.object({
|
|
4193
|
+
type: z38.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
4323
4194
|
}).shape
|
|
4324
4195
|
);
|
|
4325
4196
|
var EditActionInput = BaseActionInput.extend(
|
|
4326
|
-
|
|
4327
|
-
type:
|
|
4328
|
-
content:
|
|
4329
|
-
comment:
|
|
4197
|
+
z38.object({
|
|
4198
|
+
type: z38.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
4199
|
+
content: z38.object({
|
|
4200
|
+
comment: z38.string().describe("Comment for the edit action.").optional()
|
|
4330
4201
|
})
|
|
4331
4202
|
}).shape
|
|
4332
4203
|
);
|
|
4333
4204
|
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
4334
|
-
|
|
4335
|
-
type:
|
|
4205
|
+
z38.object({
|
|
4206
|
+
type: z38.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
4336
4207
|
content: PrintContent.optional()
|
|
4337
4208
|
}).shape
|
|
4338
4209
|
);
|
|
4339
4210
|
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
4340
|
-
|
|
4341
|
-
type:
|
|
4211
|
+
z38.object({
|
|
4212
|
+
type: z38.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
4342
4213
|
content: ReasonContent
|
|
4343
4214
|
}).shape
|
|
4344
4215
|
);
|
|
4345
4216
|
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
4346
|
-
|
|
4347
|
-
type:
|
|
4348
|
-
content:
|
|
4349
|
-
duplicates:
|
|
4217
|
+
z38.object({
|
|
4218
|
+
type: z38.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
4219
|
+
content: z38.object({
|
|
4220
|
+
duplicates: z38.array(PotentialDuplicate)
|
|
4350
4221
|
})
|
|
4351
4222
|
}).shape
|
|
4352
4223
|
);
|
|
4353
4224
|
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
4354
|
-
|
|
4355
|
-
type:
|
|
4356
|
-
content:
|
|
4225
|
+
z38.object({
|
|
4226
|
+
type: z38.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
4227
|
+
content: z38.object({
|
|
4357
4228
|
duplicateOf: UUID
|
|
4358
4229
|
}).optional()
|
|
4359
4230
|
}).shape
|
|
4360
4231
|
);
|
|
4361
4232
|
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
4362
|
-
|
|
4363
|
-
type:
|
|
4233
|
+
z38.object({
|
|
4234
|
+
type: z38.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
4364
4235
|
}).shape
|
|
4365
4236
|
);
|
|
4366
4237
|
var ArchiveActionInput = BaseActionInput.extend(
|
|
4367
|
-
|
|
4368
|
-
type:
|
|
4238
|
+
z38.object({
|
|
4239
|
+
type: z38.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
4369
4240
|
content: ReasonContent
|
|
4370
4241
|
}).shape
|
|
4371
4242
|
);
|
|
4372
4243
|
var AssignActionInput = BaseActionInput.extend(
|
|
4373
|
-
|
|
4374
|
-
type:
|
|
4375
|
-
assignedTo:
|
|
4244
|
+
z38.object({
|
|
4245
|
+
type: z38.literal(ActionType.ASSIGN),
|
|
4246
|
+
assignedTo: z38.string()
|
|
4376
4247
|
}).shape
|
|
4377
4248
|
);
|
|
4378
4249
|
var UnassignActionInput = BaseActionInput.extend(
|
|
4379
|
-
|
|
4380
|
-
type:
|
|
4381
|
-
assignedTo:
|
|
4250
|
+
z38.object({
|
|
4251
|
+
type: z38.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
4252
|
+
assignedTo: z38.literal(null).default(null)
|
|
4382
4253
|
}).shape
|
|
4383
4254
|
);
|
|
4384
4255
|
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
4385
|
-
|
|
4386
|
-
type:
|
|
4256
|
+
z38.object({
|
|
4257
|
+
type: z38.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
4387
4258
|
}).shape
|
|
4388
4259
|
);
|
|
4389
4260
|
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
4390
|
-
|
|
4391
|
-
requestId:
|
|
4392
|
-
type:
|
|
4261
|
+
z38.object({
|
|
4262
|
+
requestId: z38.string(),
|
|
4263
|
+
type: z38.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
4393
4264
|
content: ReasonContent
|
|
4394
4265
|
}).shape
|
|
4395
4266
|
);
|
|
4396
4267
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4397
|
-
|
|
4398
|
-
requestId:
|
|
4399
|
-
type:
|
|
4268
|
+
z38.object({
|
|
4269
|
+
requestId: z38.string(),
|
|
4270
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4400
4271
|
}).shape
|
|
4401
4272
|
);
|
|
4402
4273
|
var ReadActionInput = BaseActionInput.extend(
|
|
4403
|
-
|
|
4404
|
-
type:
|
|
4274
|
+
z38.object({
|
|
4275
|
+
type: z38.literal(ActionType.READ).default(ActionType.READ)
|
|
4405
4276
|
}).shape
|
|
4406
4277
|
);
|
|
4407
|
-
var DeleteActionInput =
|
|
4278
|
+
var DeleteActionInput = z38.object({ eventId: UUID });
|
|
4408
4279
|
var CustomActionInput = BaseActionInput.extend(
|
|
4409
|
-
|
|
4410
|
-
type:
|
|
4411
|
-
customActionType:
|
|
4280
|
+
z38.object({
|
|
4281
|
+
type: z38.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
4282
|
+
customActionType: z38.string().describe("Name of the custom action.")
|
|
4412
4283
|
}).shape
|
|
4413
4284
|
);
|
|
4414
|
-
var ActionInput =
|
|
4285
|
+
var ActionInput = z38.discriminatedUnion("type", [
|
|
4415
4286
|
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
4416
4287
|
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
4417
4288
|
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
@@ -4447,11 +4318,11 @@ var ActionInput = z39.discriminatedUnion("type", [
|
|
|
4447
4318
|
});
|
|
4448
4319
|
|
|
4449
4320
|
// ../commons/src/events/Draft.ts
|
|
4450
|
-
var Draft =
|
|
4321
|
+
var Draft = z39.object({
|
|
4451
4322
|
id: UUID,
|
|
4452
4323
|
eventId: UUID,
|
|
4453
|
-
transactionId:
|
|
4454
|
-
createdAt:
|
|
4324
|
+
transactionId: z39.string(),
|
|
4325
|
+
createdAt: z39.string().datetime(),
|
|
4455
4326
|
action: ActionBase.extend({
|
|
4456
4327
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
4457
4328
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -4460,7 +4331,7 @@ var Draft = z40.object({
|
|
|
4460
4331
|
);
|
|
4461
4332
|
var DraftInput = BaseActionInput.extend({
|
|
4462
4333
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4463
|
-
status:
|
|
4334
|
+
status: z39.enum([
|
|
4464
4335
|
ActionStatus.Requested,
|
|
4465
4336
|
ActionStatus.Accepted,
|
|
4466
4337
|
ActionStatus.Rejected
|
|
@@ -4468,27 +4339,27 @@ var DraftInput = BaseActionInput.extend({
|
|
|
4468
4339
|
});
|
|
4469
4340
|
|
|
4470
4341
|
// ../commons/src/events/EventInput.ts
|
|
4471
|
-
var
|
|
4342
|
+
var z40 = __toESM(require("zod/v4"));
|
|
4472
4343
|
var import_uuid10 = require("uuid");
|
|
4473
|
-
var EventInput =
|
|
4474
|
-
transactionId:
|
|
4475
|
-
type:
|
|
4344
|
+
var EventInput = z40.object({
|
|
4345
|
+
transactionId: z40.string(),
|
|
4346
|
+
type: z40.string(),
|
|
4476
4347
|
createdAtLocation: UUID.nullish().describe(
|
|
4477
4348
|
"Location where the event occurred. Required for system users."
|
|
4478
4349
|
)
|
|
4479
4350
|
}).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
4480
4351
|
|
|
4481
4352
|
// ../commons/src/events/EventDocument.ts
|
|
4482
|
-
var
|
|
4483
|
-
var EventDocument =
|
|
4353
|
+
var z41 = __toESM(require("zod/v4"));
|
|
4354
|
+
var EventDocument = z41.object({
|
|
4484
4355
|
id: UUID.describe("Unique identifier of the event."),
|
|
4485
|
-
type:
|
|
4486
|
-
createdAt:
|
|
4487
|
-
updatedAt:
|
|
4356
|
+
type: z41.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
4357
|
+
createdAt: z41.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
4358
|
+
updatedAt: z41.string().datetime().describe(
|
|
4488
4359
|
"Timestamp of the last update, excluding changes from actions."
|
|
4489
4360
|
),
|
|
4490
|
-
actions:
|
|
4491
|
-
trackingId:
|
|
4361
|
+
actions: z41.array(Action).describe("Ordered list of actions associated with the event."),
|
|
4362
|
+
trackingId: z41.string().describe(
|
|
4492
4363
|
"System-generated tracking identifier used to look up the event."
|
|
4493
4364
|
)
|
|
4494
4365
|
}).meta({ id: "EventDocument" });
|
|
@@ -4501,6 +4372,7 @@ var import_lodash2 = require("lodash");
|
|
|
4501
4372
|
var updateActions = ActionTypes.extract([
|
|
4502
4373
|
ActionType.CREATE,
|
|
4503
4374
|
ActionType.NOTIFY,
|
|
4375
|
+
ActionType.EDIT,
|
|
4504
4376
|
ActionType.DECLARE,
|
|
4505
4377
|
ActionType.REGISTER,
|
|
4506
4378
|
ActionType.REJECT,
|
|
@@ -4520,7 +4392,8 @@ var IGNORED_EVENT_TYPES = [
|
|
|
4520
4392
|
"tennis-club-membership",
|
|
4521
4393
|
"library-membership",
|
|
4522
4394
|
"child-onboarding",
|
|
4523
|
-
"digital-identity"
|
|
4395
|
+
"digital-identity",
|
|
4396
|
+
"event-with-optional-address"
|
|
4524
4397
|
];
|
|
4525
4398
|
function warnOnConfigurationIssues(config) {
|
|
4526
4399
|
const eventId = config.id;
|
|
@@ -6932,8 +6805,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6932
6805
|
});
|
|
6933
6806
|
|
|
6934
6807
|
// ../commons/src/events/test.utils.ts
|
|
6935
|
-
var
|
|
6936
|
-
var TestUserRole =
|
|
6808
|
+
var z42 = __toESM(require("zod/v4"));
|
|
6809
|
+
var TestUserRole = z42.enum([
|
|
6937
6810
|
"FIELD_AGENT",
|
|
6938
6811
|
"LOCAL_REGISTRAR",
|
|
6939
6812
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6949,26 +6822,26 @@ var TestUserRole = z43.enum([
|
|
|
6949
6822
|
var import_lodash6 = require("lodash");
|
|
6950
6823
|
|
|
6951
6824
|
// ../commons/src/events/locations.ts
|
|
6952
|
-
var
|
|
6953
|
-
var LocationTypeV1 =
|
|
6825
|
+
var z43 = __toESM(require("zod/v4"));
|
|
6826
|
+
var LocationTypeV1 = z43.enum([
|
|
6954
6827
|
"ADMIN_STRUCTURE",
|
|
6955
6828
|
"CRVS_OFFICE",
|
|
6956
6829
|
"HEALTH_FACILITY"
|
|
6957
6830
|
]);
|
|
6958
|
-
var AdministrativeArea =
|
|
6831
|
+
var AdministrativeArea = z43.object({
|
|
6959
6832
|
id: UUID,
|
|
6960
|
-
name:
|
|
6961
|
-
externalId:
|
|
6833
|
+
name: z43.string(),
|
|
6834
|
+
externalId: z43.string().nullish(),
|
|
6962
6835
|
parentId: UUID.nullable(),
|
|
6963
|
-
validUntil:
|
|
6836
|
+
validUntil: z43.iso.datetime().nullable()
|
|
6964
6837
|
});
|
|
6965
|
-
var Location =
|
|
6838
|
+
var Location = z43.object({
|
|
6966
6839
|
id: UUID,
|
|
6967
|
-
name:
|
|
6968
|
-
externalId:
|
|
6840
|
+
name: z43.string(),
|
|
6841
|
+
externalId: z43.string().nullish(),
|
|
6969
6842
|
administrativeAreaId: UUID.nullable(),
|
|
6970
|
-
validUntil:
|
|
6971
|
-
locationType:
|
|
6843
|
+
validUntil: z43.iso.datetime().nullable(),
|
|
6844
|
+
locationType: z43.string().nullable()
|
|
6972
6845
|
});
|
|
6973
6846
|
|
|
6974
6847
|
// ../commons/src/events/scopes.ts
|
|
@@ -7055,7 +6928,7 @@ var ACTION_FILTERS = {
|
|
|
7055
6928
|
var import_lodash7 = require("lodash");
|
|
7056
6929
|
|
|
7057
6930
|
// ../commons/src/notification/UserNotifications.ts
|
|
7058
|
-
var
|
|
6931
|
+
var z44 = __toESM(require("zod/v4"));
|
|
7059
6932
|
var TriggerEvent = {
|
|
7060
6933
|
USER_CREATED: "user-created",
|
|
7061
6934
|
USER_UPDATED: "user-updated",
|
|
@@ -7067,50 +6940,50 @@ var TriggerEvent = {
|
|
|
7067
6940
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
7068
6941
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
7069
6942
|
};
|
|
7070
|
-
var Recipient =
|
|
6943
|
+
var Recipient = z44.object({
|
|
7071
6944
|
name: NameFieldValue.optional(),
|
|
7072
|
-
mobile:
|
|
7073
|
-
email:
|
|
7074
|
-
bcc:
|
|
6945
|
+
mobile: z44.string().optional(),
|
|
6946
|
+
email: z44.string().optional(),
|
|
6947
|
+
bcc: z44.array(z44.string()).optional()
|
|
7075
6948
|
});
|
|
7076
|
-
var BasePayload =
|
|
6949
|
+
var BasePayload = z44.object({
|
|
7077
6950
|
recipient: Recipient
|
|
7078
6951
|
});
|
|
7079
6952
|
var TriggerPayload = {
|
|
7080
6953
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
7081
|
-
username:
|
|
7082
|
-
temporaryPassword:
|
|
6954
|
+
username: z44.string(),
|
|
6955
|
+
temporaryPassword: z44.string()
|
|
7083
6956
|
}),
|
|
7084
6957
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
7085
|
-
oldUsername:
|
|
7086
|
-
newUsername:
|
|
6958
|
+
oldUsername: z44.string(),
|
|
6959
|
+
newUsername: z44.string()
|
|
7087
6960
|
}),
|
|
7088
6961
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
7089
|
-
username:
|
|
6962
|
+
username: z44.string()
|
|
7090
6963
|
}),
|
|
7091
6964
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
7092
|
-
code:
|
|
6965
|
+
code: z44.string()
|
|
7093
6966
|
}),
|
|
7094
6967
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
7095
|
-
temporaryPassword:
|
|
7096
|
-
admin:
|
|
7097
|
-
id:
|
|
6968
|
+
temporaryPassword: z44.string(),
|
|
6969
|
+
admin: z44.object({
|
|
6970
|
+
id: z44.string(),
|
|
7098
6971
|
name: NameFieldValue,
|
|
7099
|
-
role:
|
|
6972
|
+
role: z44.string()
|
|
7100
6973
|
})
|
|
7101
6974
|
}),
|
|
7102
6975
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
7103
|
-
code:
|
|
6976
|
+
code: z44.string()
|
|
7104
6977
|
}),
|
|
7105
6978
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
7106
|
-
subject:
|
|
7107
|
-
body:
|
|
6979
|
+
subject: z44.string(),
|
|
6980
|
+
body: z44.string()
|
|
7108
6981
|
}),
|
|
7109
6982
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
7110
|
-
code:
|
|
6983
|
+
code: z44.string()
|
|
7111
6984
|
}),
|
|
7112
6985
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
7113
|
-
code:
|
|
6986
|
+
code: z44.string()
|
|
7114
6987
|
})
|
|
7115
6988
|
};
|
|
7116
6989
|
async function triggerUserEventNotification({
|
|
@@ -7134,4 +7007,4 @@ function parseUserEventTrigger(event2, body) {
|
|
|
7134
7007
|
}
|
|
7135
7008
|
|
|
7136
7009
|
// src/notification/index.ts
|
|
7137
|
-
|
|
7010
|
+
z45.globalRegistry.clear();
|