@opencrvs/toolkit 1.8.0-rc.f7e4aad → 1.8.0-rc.f807e0d
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/dist/commons/api/router.d.ts +1822 -10136
- package/dist/commons/conditionals/conditionals.d.ts +1 -12
- package/dist/commons/conditionals/validate.d.ts +8 -0
- package/dist/commons/events/ActionConfig.d.ts +15960 -3820
- package/dist/commons/events/ActionDocument.d.ts +1951 -904
- package/dist/commons/events/ActionInput.d.ts +1680 -780
- package/dist/commons/events/ActionType.d.ts +0 -2
- package/dist/commons/events/AdvancedSearchConfig.d.ts +113 -68
- package/dist/commons/events/CompositeFieldValue.d.ts +9 -9
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1215 -813
- package/dist/commons/events/Draft.d.ts +144 -72
- package/dist/commons/events/EventConfig.d.ts +6459 -1250
- package/dist/commons/events/EventDocument.d.ts +1236 -588
- package/dist/commons/events/EventIndex.d.ts +609 -268
- package/dist/commons/events/EventMetadata.d.ts +9 -7
- package/dist/commons/events/FieldConfig.d.ts +1635 -67
- package/dist/commons/events/FieldType.d.ts +7 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +57 -25
- package/dist/commons/events/FieldValue.d.ts +45 -16
- package/dist/commons/events/FormConfig.d.ts +6488 -1370
- package/dist/commons/events/PageConfig.d.ts +1380 -70
- package/dist/commons/events/User.d.ts +9 -3
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +7 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +2459 -1519
- package/dist/commons/events/defineConfig.d.ts +971 -58
- package/dist/commons/events/event.d.ts +19 -19
- package/dist/commons/events/field.d.ts +17 -1
- package/dist/commons/events/test.utils.d.ts +45 -20
- package/dist/commons/events/utils.d.ts +3323 -267
- package/dist/conditionals/index.js +23 -39
- package/dist/events/index.js +1208 -928
- package/dist/scopes/index.d.ts +92 -6
- package/dist/scopes/index.js +38 -9
- package/package.json +6 -4
- package/tsconfig.json +1 -1
- package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
- package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
- package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,7 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __create = Object.create;
|
2
3
|
var __defProp = Object.defineProperty;
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
8
|
var __export = (target, all) => {
|
7
9
|
for (var name in all)
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
15
17
|
}
|
16
18
|
return to;
|
17
19
|
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
29
|
|
20
30
|
// src/conditionals/index.ts
|
@@ -22,7 +32,6 @@ var conditionals_exports = {};
|
|
22
32
|
__export(conditionals_exports, {
|
23
33
|
alwaysTrue: () => alwaysTrue,
|
24
34
|
and: () => and,
|
25
|
-
createEventConditionals: () => createEventConditionals,
|
26
35
|
createFieldConditionals: () => createFieldConditionals,
|
27
36
|
defineConditional: () => defineConditional,
|
28
37
|
defineFormConditional: () => defineFormConditional,
|
@@ -33,6 +42,9 @@ __export(conditionals_exports, {
|
|
33
42
|
});
|
34
43
|
module.exports = __toCommonJS(conditionals_exports);
|
35
44
|
|
45
|
+
// ../commons/src/conditionals/conditionals.ts
|
46
|
+
var objectHash = __toESM(require("object-hash"));
|
47
|
+
|
36
48
|
// ../commons/src/events/serializers/user/serializer.ts
|
37
49
|
var import_zod = require("zod");
|
38
50
|
var SerializedUserField = import_zod.z.object({
|
@@ -40,7 +52,8 @@ var SerializedUserField = import_zod.z.object({
|
|
40
52
|
"id",
|
41
53
|
"name",
|
42
54
|
"role",
|
43
|
-
"
|
55
|
+
"signature",
|
56
|
+
"avatar",
|
44
57
|
"primaryOfficeId"
|
45
58
|
])
|
46
59
|
});
|
@@ -52,7 +65,10 @@ function userSerializer(userField) {
|
|
52
65
|
|
53
66
|
// ../commons/src/conditionals/conditionals.ts
|
54
67
|
function defineConditional(schema) {
|
55
|
-
return
|
68
|
+
return {
|
69
|
+
$id: `https://opencrvs.org/conditionals/${objectHash.sha1(schema)}`,
|
70
|
+
...schema
|
71
|
+
};
|
56
72
|
}
|
57
73
|
function defineFormConditional(schema) {
|
58
74
|
const schemaWithForm = {
|
@@ -112,38 +128,6 @@ var user = Object.assign(userSerializer, {
|
|
112
128
|
required: ["$user"]
|
113
129
|
})
|
114
130
|
});
|
115
|
-
function createEventConditionals() {
|
116
|
-
return {
|
117
|
-
/**
|
118
|
-
* Checks if the event contains a specific action type.
|
119
|
-
* @param action - The action type to check for.
|
120
|
-
*/
|
121
|
-
hasAction: (action) => defineConditional({
|
122
|
-
type: "object",
|
123
|
-
properties: {
|
124
|
-
$event: {
|
125
|
-
type: "object",
|
126
|
-
properties: {
|
127
|
-
actions: {
|
128
|
-
type: "array",
|
129
|
-
contains: {
|
130
|
-
type: "object",
|
131
|
-
properties: {
|
132
|
-
type: {
|
133
|
-
const: action
|
134
|
-
}
|
135
|
-
},
|
136
|
-
required: ["type"]
|
137
|
-
}
|
138
|
-
}
|
139
|
-
},
|
140
|
-
required: ["actions"]
|
141
|
-
}
|
142
|
-
},
|
143
|
-
required: ["$event"]
|
144
|
-
})
|
145
|
-
};
|
146
|
-
}
|
147
131
|
function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
|
148
132
|
return {
|
149
133
|
type: "object",
|
@@ -319,11 +303,11 @@ function createFieldConditionals(fieldId) {
|
|
319
303
|
properties: {
|
320
304
|
[fieldId]: {
|
321
305
|
type: "string",
|
322
|
-
|
323
|
-
|
306
|
+
minLength: 1,
|
307
|
+
pattern: "^[\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*( [\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*)*$",
|
308
|
+
description: "Name must contain only letters, numbers, and allowed special characters ('.-). No double spaces."
|
324
309
|
}
|
325
|
-
}
|
326
|
-
required: [fieldId]
|
310
|
+
}
|
327
311
|
}),
|
328
312
|
/**
|
329
313
|
* Checks if the field value matches a given regular expression pattern.
|