@opencrvs/toolkit 1.8.0-rc.fef85f2 → 1.8.0-rc.ff0b26c
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 +10585 -4200
- package/dist/commons/conditionals/conditionals.d.ts +9 -6
- package/dist/commons/events/ActionConfig.d.ts +97080 -1720
- package/dist/commons/events/ActionDocument.d.ts +542 -211
- package/dist/commons/events/ActionInput.d.ts +248 -240
- package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
- package/dist/commons/events/Draft.d.ts +33 -20
- package/dist/commons/events/EventConfig.d.ts +46237 -1398
- package/dist/commons/events/EventDocument.d.ts +337 -159
- package/dist/commons/events/EventIndex.d.ts +1735 -16
- package/dist/commons/events/EventInput.d.ts +13 -0
- package/dist/commons/events/EventMetadata.d.ts +274 -14
- package/dist/commons/events/FieldConfig.d.ts +4229 -744
- package/dist/commons/events/FieldType.d.ts +3 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
- package/dist/commons/events/FieldValue.d.ts +7 -4
- package/dist/commons/events/FormConfig.d.ts +43591 -439
- package/dist/commons/events/PageConfig.d.ts +10860 -204
- package/dist/commons/events/SummaryConfig.d.ts +17 -47
- package/dist/commons/events/WorkqueueConfig.d.ts +1549 -19
- package/dist/commons/events/defineConfig.d.ts +7199 -27
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +82 -0
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/scopes.d.ts +21 -1
- package/dist/commons/events/test.utils.d.ts +10 -47
- package/dist/commons/events/utils.d.ts +3665 -67
- package/dist/conditionals/index.js +36 -33
- package/dist/events/index.js +1771 -966
- package/dist/scopes/index.d.ts +158 -1
- package/dist/scopes/index.js +152 -1
- package/package.json +3 -2
@@ -22,10 +22,10 @@ var conditionals_exports = {};
|
|
22
22
|
__export(conditionals_exports, {
|
23
23
|
alwaysTrue: () => alwaysTrue,
|
24
24
|
and: () => and,
|
25
|
+
createEventConditionals: () => createEventConditionals,
|
26
|
+
createFieldConditionals: () => createFieldConditionals,
|
25
27
|
defineConditional: () => defineConditional,
|
26
28
|
defineFormConditional: () => defineFormConditional,
|
27
|
-
event: () => event,
|
28
|
-
field: () => field,
|
29
29
|
never: () => never,
|
30
30
|
not: () => not,
|
31
31
|
or: () => or,
|
@@ -95,32 +95,38 @@ var user = {
|
|
95
95
|
required: ["$user"]
|
96
96
|
})
|
97
97
|
};
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
98
|
+
function createEventConditionals() {
|
99
|
+
return {
|
100
|
+
/**
|
101
|
+
* Checks if the event contains a specific action type.
|
102
|
+
* @param action - The action type to check for.
|
103
|
+
*/
|
104
|
+
hasAction: (action) => defineConditional({
|
105
|
+
type: "object",
|
106
|
+
properties: {
|
107
|
+
$event: {
|
108
|
+
type: "object",
|
109
|
+
properties: {
|
110
|
+
actions: {
|
111
|
+
type: "array",
|
112
|
+
contains: {
|
113
|
+
type: "object",
|
114
|
+
properties: {
|
115
|
+
type: {
|
116
|
+
const: action
|
117
|
+
}
|
118
|
+
},
|
119
|
+
required: ["type"]
|
120
|
+
}
|
115
121
|
}
|
116
|
-
}
|
117
|
-
|
118
|
-
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
}
|
123
|
-
}
|
122
|
+
},
|
123
|
+
required: ["actions"]
|
124
|
+
}
|
125
|
+
},
|
126
|
+
required: ["$event"]
|
127
|
+
})
|
128
|
+
};
|
129
|
+
}
|
124
130
|
function getDateFromNow(days) {
|
125
131
|
return new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString().split("T")[0];
|
126
132
|
}
|
@@ -141,7 +147,7 @@ function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
|
|
141
147
|
function isFieldReference(value) {
|
142
148
|
return typeof value === "object" && value !== null && "_fieldId" in value;
|
143
149
|
}
|
144
|
-
function
|
150
|
+
function createFieldConditionals(fieldId) {
|
145
151
|
const getDateRange = (date, clause) => ({
|
146
152
|
type: "object",
|
147
153
|
properties: {
|
@@ -154,10 +160,6 @@ function field(fieldId) {
|
|
154
160
|
required: [fieldId]
|
155
161
|
});
|
156
162
|
return {
|
157
|
-
/**
|
158
|
-
* @private Internal property used for field reference tracking.
|
159
|
-
*/
|
160
|
-
_fieldId: fieldId,
|
161
163
|
isAfter: () => ({
|
162
164
|
days: (days) => ({
|
163
165
|
inPast: () => defineFormConditional(
|
@@ -324,6 +326,7 @@ function field(fieldId) {
|
|
324
326
|
}
|
325
327
|
},
|
326
328
|
required: [fieldId]
|
327
|
-
})
|
329
|
+
}),
|
330
|
+
getId: () => ({ fieldId })
|
328
331
|
};
|
329
332
|
}
|