@opencrvs/toolkit 1.9.13-rc.72233cd → 1.9.13-rc.73a1d40
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 +0 -13
- package/dist/api/index.d.ts.map +1 -1
- package/dist/commons/api/router.d.ts +4561 -3370
- package/dist/commons/conditionals/conditionals.d.ts +3 -27
- package/dist/commons/conditionals/validate.d.ts +3 -13
- package/dist/commons/events/ActionConfig.d.ts +1555 -415
- package/dist/commons/events/ActionDocument.d.ts +1941 -888
- package/dist/commons/events/ActionInput.d.ts +1277 -277
- package/dist/commons/events/ActionType.d.ts +11 -91
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1496 -294
- package/dist/commons/events/CompositeFieldValue.d.ts +190 -30
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4471 -1592
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +171 -15
- package/dist/commons/events/Draft.d.ts +113 -72
- package/dist/commons/events/DynamicFieldValue.d.ts +78 -12
- package/dist/commons/events/EventConfig.d.ts +2420 -35
- package/dist/commons/events/EventConfigInput.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +1366 -354
- package/dist/commons/events/EventIndex.d.ts +1010 -212
- package/dist/commons/events/EventInput.d.ts +8 -3
- package/dist/commons/events/EventMetadata.d.ts +357 -130
- package/dist/commons/events/FieldConfig.d.ts +12890 -2890
- package/dist/commons/events/FieldType.d.ts +4 -26
- package/dist/commons/events/FieldTypeMapping.d.ts +906 -314
- package/dist/commons/events/FieldValue.d.ts +527 -149
- package/dist/commons/events/FileUtils.d.ts +2 -2
- package/dist/commons/events/FormConfig.d.ts +721 -54
- package/dist/commons/events/PageConfig.d.ts +320 -58
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -2
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7480 -2135
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +247 -2
- package/dist/commons/events/index.d.ts +0 -3
- package/dist/commons/events/locations.d.ts +20 -57
- package/dist/commons/events/scopes.d.ts +34 -35
- package/dist/commons/events/state/availableActions.d.ts +2 -7
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +27 -30
- package/dist/commons/events/state/utils.d.ts +172 -190
- package/dist/commons/events/test.utils.d.ts +11 -52
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +273 -373
- package/dist/commons/notification/UserNotifications.d.ts +637 -61
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +14 -302
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2114 -2844
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1769 -2073
- package/dist/scopes/index.d.ts +353 -640
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +300 -340
- package/package.json +3 -13
- package/tsconfig.json +2 -12
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/application-config/index.d.ts +0 -2
- package/dist/application-config/index.d.ts.map +0 -1
- package/dist/application-config/index.js +0 -2128
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -3237
- package/dist/commons/application-config/index.d.ts +0 -84
- package/dist/commons/events/AuditLog.d.ts +0 -405
- package/dist/commons/events/Flag.d.ts +0 -67
- package/dist/commons/events/eventConfigValidation.d.ts +0 -8
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -405
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -829
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -159
- package/dist/migrations/v2.0/index.d.ts +0 -7
- package/dist/migrations/v2.0/index.d.ts.map +0 -1
- package/dist/migrations/v2.0/index.js +0 -3176
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -344
- package/dist/migrations/v2.0/migrate-scopes.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-scopes.js +0 -282
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -268
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -237
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +0 -157
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +0 -75
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -97
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -78
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -110
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -164
- package/dist/migrations/v2.0/rename-api-paths.d.ts +0 -3
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-api-paths.js +0 -188
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +0 -181
- package/opencrvs-toolkit-1.9.13-rc.72233cd.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conditionals/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conditionals/index.ts"],"names":[],"mappings":"AAUA,cAAc,gCAAgC,CAAA"}
|
|
@@ -35,26 +35,23 @@ __export(conditionals_exports, {
|
|
|
35
35
|
createFieldConditionals: () => createFieldConditionals,
|
|
36
36
|
defineConditional: () => defineConditional,
|
|
37
37
|
defineFormConditional: () => defineFormConditional,
|
|
38
|
-
flag: () => flag,
|
|
39
38
|
isEventFieldReference: () => isEventFieldReference,
|
|
40
39
|
isFieldReference: () => isFieldReference,
|
|
41
40
|
never: () => never,
|
|
42
41
|
not: () => not,
|
|
43
42
|
now: () => now,
|
|
44
43
|
or: () => or,
|
|
45
|
-
status: () => status,
|
|
46
44
|
user: () => user
|
|
47
45
|
});
|
|
48
46
|
module.exports = __toCommonJS(conditionals_exports);
|
|
49
|
-
var z8 = __toESM(require("zod/v4"));
|
|
50
47
|
|
|
51
48
|
// ../commons/src/conditionals/conditionals.ts
|
|
52
49
|
var objectHash = __toESM(require("object-hash"));
|
|
53
50
|
|
|
54
51
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
55
|
-
var
|
|
56
|
-
var SerializedUserField = z.object({
|
|
57
|
-
$userField: z.enum([
|
|
52
|
+
var import_zod = require("zod");
|
|
53
|
+
var SerializedUserField = import_zod.z.object({
|
|
54
|
+
$userField: import_zod.z.enum([
|
|
58
55
|
"id",
|
|
59
56
|
"name",
|
|
60
57
|
"role",
|
|
@@ -63,12 +60,11 @@ var SerializedUserField = z.object({
|
|
|
63
60
|
"firstname",
|
|
64
61
|
"middlename",
|
|
65
62
|
"surname",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"primaryOfficeId"
|
|
69
|
-
"administrativeAreaId"
|
|
63
|
+
"district",
|
|
64
|
+
"province",
|
|
65
|
+
"primaryOfficeId"
|
|
70
66
|
]),
|
|
71
|
-
$location: z.string().optional()
|
|
67
|
+
$location: import_zod.z.string().optional()
|
|
72
68
|
});
|
|
73
69
|
function userSerializer(userField) {
|
|
74
70
|
return {
|
|
@@ -88,7 +84,7 @@ function userSerializer(userField) {
|
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
// ../commons/src/utils.ts
|
|
91
|
-
var z2 = __toESM(require("zod
|
|
87
|
+
var z2 = __toESM(require("zod"));
|
|
92
88
|
var _ = __toESM(require("lodash"));
|
|
93
89
|
var FullNameV1 = z2.array(
|
|
94
90
|
z2.object({
|
|
@@ -114,269 +110,14 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
114
110
|
}
|
|
115
111
|
|
|
116
112
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
117
|
-
var
|
|
118
|
-
var SerializedNowDateTime =
|
|
119
|
-
$$now:
|
|
113
|
+
var import_zod2 = require("zod");
|
|
114
|
+
var SerializedNowDateTime = import_zod2.z.object({
|
|
115
|
+
$$now: import_zod2.z.literal(true)
|
|
120
116
|
});
|
|
121
117
|
function todayDateTimeValueSerializer() {
|
|
122
118
|
return { $$now: true };
|
|
123
119
|
}
|
|
124
120
|
|
|
125
|
-
// ../commons/src/scopes.ts
|
|
126
|
-
var z6 = __toESM(require("zod/v4"));
|
|
127
|
-
var qs = __toESM(require("qs"));
|
|
128
|
-
|
|
129
|
-
// ../commons/src/uuid.ts
|
|
130
|
-
var import_uuid = require("uuid");
|
|
131
|
-
var z4 = __toESM(require("zod/v4"));
|
|
132
|
-
var UUID = z4.uuid().brand("UUID");
|
|
133
|
-
|
|
134
|
-
// ../commons/src/authentication.ts
|
|
135
|
-
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
136
|
-
var z5 = __toESM(require("zod/v4"));
|
|
137
|
-
var TokenUserType = z5.enum(["user", "system"]);
|
|
138
|
-
var TokenWithBearer = z5.string().regex(/^Bearer\s/);
|
|
139
|
-
|
|
140
|
-
// ../commons/src/scopes.ts
|
|
141
|
-
var JurisdictionFilter = z6.enum(["administrativeArea", "location", "all"]).describe(
|
|
142
|
-
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
143
|
-
);
|
|
144
|
-
var UserFilter = z6.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
145
|
-
var RecordScopeTypeV2 = z6.enum([
|
|
146
|
-
"record.search",
|
|
147
|
-
"record.create",
|
|
148
|
-
"record.read",
|
|
149
|
-
"record.declare",
|
|
150
|
-
"record.notify",
|
|
151
|
-
"record.edit",
|
|
152
|
-
"record.reject",
|
|
153
|
-
"record.archive",
|
|
154
|
-
"record.review-duplicates",
|
|
155
|
-
"record.register",
|
|
156
|
-
"record.print-certified-copies",
|
|
157
|
-
"record.request-correction",
|
|
158
|
-
"record.correct",
|
|
159
|
-
"record.unassign-others",
|
|
160
|
-
"record.custom-action"
|
|
161
|
-
]);
|
|
162
|
-
var PlainScopeType = z6.enum([
|
|
163
|
-
// Misc. system scopes
|
|
164
|
-
"bypassratelimit",
|
|
165
|
-
"record.reindex",
|
|
166
|
-
"user.data-seeding",
|
|
167
|
-
"integration.create",
|
|
168
|
-
"record.import",
|
|
169
|
-
"config.update-all",
|
|
170
|
-
"attachment.upload",
|
|
171
|
-
"profile.electronic-signature",
|
|
172
|
-
"user.read-only-my-audit",
|
|
173
|
-
// Performance dashboard
|
|
174
|
-
"performance.read",
|
|
175
|
-
"performance.read-dashboards",
|
|
176
|
-
"performance.vital-statistics-export",
|
|
177
|
-
// Scopes used exclusively by countryconfig integration token
|
|
178
|
-
"record.confirm-registration",
|
|
179
|
-
"record.reject-registration"
|
|
180
|
-
]);
|
|
181
|
-
var scopeByEvent = z6.preprocess(
|
|
182
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
183
|
-
z6.array(z6.string()).optional()
|
|
184
|
-
).describe("Event type, e.g. birth, death");
|
|
185
|
-
var scopeOptionsPlaceEvent = z6.object({
|
|
186
|
-
event: scopeByEvent,
|
|
187
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
188
|
-
}).describe("Options applicable to all record scopes.");
|
|
189
|
-
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
190
|
-
declaredIn: JurisdictionFilter.optional(),
|
|
191
|
-
declaredBy: UserFilter.optional()
|
|
192
|
-
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
193
|
-
var AllRecordScopeOptions = scopeOptionsDeclared.extend({
|
|
194
|
-
registeredIn: JurisdictionFilter.optional(),
|
|
195
|
-
registeredBy: UserFilter.optional()
|
|
196
|
-
}).describe(
|
|
197
|
-
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
198
|
-
);
|
|
199
|
-
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
200
|
-
customActionTypes: z6.preprocess(
|
|
201
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
202
|
-
z6.array(z6.string()).optional()
|
|
203
|
-
).describe("Allowed custom action types")
|
|
204
|
-
});
|
|
205
|
-
var AccessLevelOptions = z6.object({
|
|
206
|
-
accessLevel: JurisdictionFilter.optional()
|
|
207
|
-
});
|
|
208
|
-
var WorkqueueOrDashboardOptions = z6.object({
|
|
209
|
-
ids: z6.preprocess(
|
|
210
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
211
|
-
z6.array(z6.string())
|
|
212
|
-
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
213
|
-
});
|
|
214
|
-
var AllScopeOptions = z6.object({
|
|
215
|
-
...AllRecordScopeOptions.shape,
|
|
216
|
-
...AccessLevelOptions.shape,
|
|
217
|
-
...WorkqueueOrDashboardOptions.shape
|
|
218
|
-
});
|
|
219
|
-
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
220
|
-
var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
221
|
-
event: scopeByEvent,
|
|
222
|
-
placeOfEvent: UUID.nullish()
|
|
223
|
-
}).describe(
|
|
224
|
-
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
225
|
-
);
|
|
226
|
-
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
227
|
-
declaredIn: UUID.nullish(),
|
|
228
|
-
declaredBy: z6.string().optional()
|
|
229
|
-
}).describe(
|
|
230
|
-
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
231
|
-
);
|
|
232
|
-
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
233
|
-
registeredIn: UUID.nullish(),
|
|
234
|
-
registeredBy: z6.string().optional()
|
|
235
|
-
}).describe(
|
|
236
|
-
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
237
|
-
);
|
|
238
|
-
var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
|
|
239
|
-
"record.create",
|
|
240
|
-
"record.declare",
|
|
241
|
-
"record.notify"
|
|
242
|
-
]);
|
|
243
|
-
var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
244
|
-
"record.edit",
|
|
245
|
-
"record.reject",
|
|
246
|
-
"record.archive",
|
|
247
|
-
"record.review-duplicates",
|
|
248
|
-
"record.register"
|
|
249
|
-
]);
|
|
250
|
-
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
251
|
-
"record.search",
|
|
252
|
-
"record.read",
|
|
253
|
-
"record.request-correction",
|
|
254
|
-
"record.correct",
|
|
255
|
-
"record.unassign-others"
|
|
256
|
-
]);
|
|
257
|
-
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
258
|
-
templates: z6.preprocess(
|
|
259
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
260
|
-
z6.array(z6.string()).optional()
|
|
261
|
-
).describe(
|
|
262
|
-
"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."
|
|
263
|
-
)
|
|
264
|
-
});
|
|
265
|
-
var RecordScopeV2 = z6.discriminatedUnion("type", [
|
|
266
|
-
z6.object({
|
|
267
|
-
type: ScopesWithPlaceEventOptions,
|
|
268
|
-
options: scopeOptionsPlaceEvent.optional()
|
|
269
|
-
}),
|
|
270
|
-
z6.object({
|
|
271
|
-
type: ScopesWithDeclaredOptions,
|
|
272
|
-
options: scopeOptionsDeclared.optional()
|
|
273
|
-
}),
|
|
274
|
-
z6.object({
|
|
275
|
-
type: ScopesWithFullOptions,
|
|
276
|
-
options: AllRecordScopeOptions.optional()
|
|
277
|
-
}),
|
|
278
|
-
z6.object({
|
|
279
|
-
type: z6.literal("record.custom-action"),
|
|
280
|
-
options: CustomActionScopeOptions.optional()
|
|
281
|
-
}),
|
|
282
|
-
z6.object({
|
|
283
|
-
type: z6.literal("record.print-certified-copies"),
|
|
284
|
-
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
285
|
-
})
|
|
286
|
-
]).describe(
|
|
287
|
-
"Scopes used to check user's permission to perform actions on a record."
|
|
288
|
-
);
|
|
289
|
-
var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
290
|
-
z6.object({
|
|
291
|
-
type: ScopesWithPlaceEventOptions,
|
|
292
|
-
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
293
|
-
}),
|
|
294
|
-
z6.object({
|
|
295
|
-
type: ScopesWithDeclaredOptions,
|
|
296
|
-
options: ResolvedScopeOptionsDeclared.optional()
|
|
297
|
-
}),
|
|
298
|
-
z6.object({
|
|
299
|
-
type: ScopesWithFullOptions,
|
|
300
|
-
options: ResolvedScopeOptionsFull.optional()
|
|
301
|
-
}),
|
|
302
|
-
z6.object({
|
|
303
|
-
type: z6.literal("record.print-certified-copies"),
|
|
304
|
-
options: ResolvedScopeOptionsFull.extend({
|
|
305
|
-
templates: z6.array(z6.string()).optional()
|
|
306
|
-
}).optional()
|
|
307
|
-
})
|
|
308
|
-
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
309
|
-
var SystemScopeType = z6.enum([
|
|
310
|
-
"organisation.read-locations",
|
|
311
|
-
"user.read",
|
|
312
|
-
"user.create",
|
|
313
|
-
"user.edit"
|
|
314
|
-
]);
|
|
315
|
-
var Scope2 = z6.discriminatedUnion("type", [
|
|
316
|
-
z6.object({ type: PlainScopeType }),
|
|
317
|
-
...RecordScopeV2.options,
|
|
318
|
-
z6.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
319
|
-
z6.object({
|
|
320
|
-
type: z6.literal("workqueue"),
|
|
321
|
-
options: WorkqueueOrDashboardOptions
|
|
322
|
-
}),
|
|
323
|
-
z6.object({
|
|
324
|
-
type: z6.literal("dashboard.view"),
|
|
325
|
-
options: WorkqueueOrDashboardOptions
|
|
326
|
-
})
|
|
327
|
-
]);
|
|
328
|
-
var ScopeType2 = z6.enum([
|
|
329
|
-
...SystemScopeType.options,
|
|
330
|
-
...RecordScopeTypeV2.options,
|
|
331
|
-
...PlainScopeType.options,
|
|
332
|
-
"workqueue",
|
|
333
|
-
"dashboard.view"
|
|
334
|
-
]);
|
|
335
|
-
var EncodedScope2 = z6.string().brand("EncodedScope");
|
|
336
|
-
var DEFAULT_SCOPE_OPTIONS = {
|
|
337
|
-
placeOfEvent: JurisdictionFilter.enum.all,
|
|
338
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
// ../commons/src/users/userReferences.ts
|
|
342
|
-
var import_v4 = __toESM(require("zod/v4"));
|
|
343
|
-
var ScopeOptionReference = import_v4.default.object({
|
|
344
|
-
$scope: ScopeType2,
|
|
345
|
-
$option: ScopeOptionKey
|
|
346
|
-
});
|
|
347
|
-
var JurisdictionReference = import_v4.default.object({
|
|
348
|
-
$jurisdiction: JurisdictionFilter.or(ScopeOptionReference)
|
|
349
|
-
});
|
|
350
|
-
var userReferenceFunctions = {
|
|
351
|
-
scope: (scope) => ({
|
|
352
|
-
/**
|
|
353
|
-
* user.scope().attribute() is used to create a scope option reference.
|
|
354
|
-
*
|
|
355
|
-
* E.g.: user.scope('record.create').attribute('placeOfEvent')
|
|
356
|
-
*
|
|
357
|
-
* @param option - The option to create a reference for.
|
|
358
|
-
* @returns A scope option reference.
|
|
359
|
-
*/
|
|
360
|
-
attribute: (option) => ({
|
|
361
|
-
$scope: scope,
|
|
362
|
-
$option: option
|
|
363
|
-
})
|
|
364
|
-
}),
|
|
365
|
-
/**
|
|
366
|
-
* user.jurisdicton() accepts two different kinds of parameters, either:
|
|
367
|
-
*
|
|
368
|
-
* 1. a plain jurisdiction filter: user.jurisdiction('administrativeArea')
|
|
369
|
-
* 2. a scope option reference: user.jurisdiction(user.scope('record.create').attribute('placeOfEvent'))
|
|
370
|
-
*
|
|
371
|
-
* These will be resolved during runtime.
|
|
372
|
-
*
|
|
373
|
-
* @param jurisdiction - The jurisdiction to resolve.
|
|
374
|
-
*/
|
|
375
|
-
jurisdiction: (jurisdiction) => ({
|
|
376
|
-
$jurisdiction: jurisdiction
|
|
377
|
-
})
|
|
378
|
-
};
|
|
379
|
-
|
|
380
121
|
// ../commons/src/conditionals/conditionals.ts
|
|
381
122
|
function defineConditional(schema) {
|
|
382
123
|
const schemaWithooutIDRef = omitKeyDeep(schema, "$id");
|
|
@@ -452,7 +193,6 @@ function wrapToPathOptional(condition, path) {
|
|
|
452
193
|
}
|
|
453
194
|
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
454
195
|
var user = Object.assign(userSerializer, {
|
|
455
|
-
...userReferenceFunctions,
|
|
456
196
|
hasScope: (scope) => defineConditional({
|
|
457
197
|
type: "object",
|
|
458
198
|
properties: {
|
|
@@ -499,7 +239,9 @@ var user = Object.assign(userSerializer, {
|
|
|
499
239
|
required: ["$online"]
|
|
500
240
|
}),
|
|
501
241
|
locationLevel: (adminLevelId) => ({
|
|
502
|
-
$user: {
|
|
242
|
+
$user: {
|
|
243
|
+
$location: adminLevelId
|
|
244
|
+
}
|
|
503
245
|
})
|
|
504
246
|
});
|
|
505
247
|
function isFieldReference(value) {
|
|
@@ -592,33 +334,6 @@ function defineComparison(field, value, keyword) {
|
|
|
592
334
|
required: [field.$$field]
|
|
593
335
|
});
|
|
594
336
|
}
|
|
595
|
-
function flag(flagvalue) {
|
|
596
|
-
return defineConditional({
|
|
597
|
-
type: "object",
|
|
598
|
-
properties: {
|
|
599
|
-
$flags: {
|
|
600
|
-
type: "array",
|
|
601
|
-
contains: {
|
|
602
|
-
type: "string",
|
|
603
|
-
const: flagvalue
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
},
|
|
607
|
-
required: ["$flags"]
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
function status(statusValue) {
|
|
611
|
-
return defineConditional({
|
|
612
|
-
type: "object",
|
|
613
|
-
properties: {
|
|
614
|
-
$status: {
|
|
615
|
-
type: "string",
|
|
616
|
-
const: statusValue
|
|
617
|
-
}
|
|
618
|
-
},
|
|
619
|
-
required: ["$status"]
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
337
|
function createFieldConditionals(fieldId) {
|
|
623
338
|
const getDayRange = (field, days, clause, referenceDate) => ({
|
|
624
339
|
type: "object",
|
|
@@ -972,6 +687,3 @@ function createFieldConditionals(fieldId) {
|
|
|
972
687
|
})
|
|
973
688
|
};
|
|
974
689
|
}
|
|
975
|
-
|
|
976
|
-
// src/conditionals/index.ts
|
|
977
|
-
z8.globalRegistry.clear();
|
|
@@ -7,17 +7,17 @@ export declare function field(fieldId: string): {
|
|
|
7
7
|
fieldId: string;
|
|
8
8
|
type: "fuzzy";
|
|
9
9
|
options: {
|
|
10
|
-
fuzziness?: string | number | undefined;
|
|
11
10
|
boost?: number | undefined;
|
|
12
11
|
matchAgainst?: string | undefined;
|
|
12
|
+
fuzziness?: string | number | undefined;
|
|
13
13
|
} | undefined;
|
|
14
14
|
};
|
|
15
15
|
strictMatches: (options?: StrictMatcherOptions) => {
|
|
16
16
|
fieldId: string;
|
|
17
17
|
type: "strict";
|
|
18
18
|
options: {
|
|
19
|
-
boost?: number | undefined;
|
|
20
19
|
value?: string | undefined;
|
|
20
|
+
boost?: number | undefined;
|
|
21
21
|
matchAgainst?: string | undefined;
|
|
22
22
|
} | undefined;
|
|
23
23
|
};
|
|
@@ -60,9 +60,9 @@ export declare function field(fieldId: string): {
|
|
|
60
60
|
type: "dateRange";
|
|
61
61
|
options: {
|
|
62
62
|
days: number;
|
|
63
|
-
pivot?: number | undefined;
|
|
64
63
|
boost?: number | undefined;
|
|
65
64
|
matchAgainst?: string | undefined;
|
|
65
|
+
pivot?: number | undefined;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
};
|