@opencrvs/toolkit 1.8.0-rc.fd754eb → 1.8.0-rc.fd936ab
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 +4205 -7695
- package/dist/commons/conditionals/conditionals.d.ts +6 -9
- package/dist/commons/conditionals/validate.d.ts +6 -4
- package/dist/commons/events/ActionConfig.d.ts +1680 -90025
- package/dist/commons/events/ActionDocument.d.ts +211 -542
- package/dist/commons/events/ActionInput.d.ts +240 -248
- package/dist/commons/events/AdvancedSearchConfig.d.ts +25 -369
- package/dist/commons/events/CompositeFieldValue.d.ts +0 -3
- package/dist/commons/events/Draft.d.ts +20 -33
- package/dist/commons/events/EventConfig.d.ts +1344 -42812
- package/dist/commons/events/EventDocument.d.ts +156 -337
- package/dist/commons/events/EventIndex.d.ts +13 -1346
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +11 -273
- package/dist/commons/events/FieldConfig.d.ts +724 -3733
- package/dist/commons/events/FieldType.d.ts +3 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +4 -11
- package/dist/commons/events/FieldValue.d.ts +4 -7
- package/dist/commons/events/FormConfig.d.ts +441 -40419
- package/dist/commons/events/PageConfig.d.ts +194 -10068
- package/dist/commons/events/SummaryConfig.d.ts +39 -95
- package/dist/commons/events/User.d.ts +0 -5
- package/dist/commons/events/WorkqueueConfig.d.ts +19 -1135
- package/dist/commons/events/defineConfig.d.ts +35 -6966
- package/dist/commons/events/index.d.ts +0 -3
- package/dist/commons/events/test.utils.d.ts +44 -7
- package/dist/commons/events/utils.d.ts +67 -3550
- package/dist/conditionals/index.js +33 -36
- package/dist/events/index.js +977 -1672
- package/package.json +2 -3
- package/dist/commons/events/event.d.ts +0 -27
- package/dist/commons/events/field.d.ts +0 -68
- package/dist/commons/events/scopes.d.ts +0 -26
@@ -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,
|
27
25
|
defineConditional: () => defineConditional,
|
28
26
|
defineFormConditional: () => defineFormConditional,
|
27
|
+
event: () => event,
|
28
|
+
field: () => field,
|
29
29
|
never: () => never,
|
30
30
|
not: () => not,
|
31
31
|
or: () => or,
|
@@ -95,38 +95,32 @@ 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
|
-
|
115
|
-
type: {
|
116
|
-
const: action
|
117
|
-
}
|
118
|
-
},
|
119
|
-
required: ["type"]
|
120
|
-
}
|
98
|
+
var event = {
|
99
|
+
hasAction: (action) => defineConditional({
|
100
|
+
type: "object",
|
101
|
+
properties: {
|
102
|
+
$event: {
|
103
|
+
type: "object",
|
104
|
+
properties: {
|
105
|
+
actions: {
|
106
|
+
type: "array",
|
107
|
+
contains: {
|
108
|
+
type: "object",
|
109
|
+
properties: {
|
110
|
+
type: {
|
111
|
+
const: action
|
112
|
+
}
|
113
|
+
},
|
114
|
+
required: ["type"]
|
121
115
|
}
|
122
|
-
}
|
123
|
-
|
124
|
-
|
125
|
-
}
|
126
|
-
|
127
|
-
|
128
|
-
}
|
129
|
-
}
|
116
|
+
}
|
117
|
+
},
|
118
|
+
required: ["actions"]
|
119
|
+
}
|
120
|
+
},
|
121
|
+
required: ["$event"]
|
122
|
+
})
|
123
|
+
};
|
130
124
|
function getDateFromNow(days) {
|
131
125
|
return new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString().split("T")[0];
|
132
126
|
}
|
@@ -147,7 +141,7 @@ function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
|
|
147
141
|
function isFieldReference(value) {
|
148
142
|
return typeof value === "object" && value !== null && "_fieldId" in value;
|
149
143
|
}
|
150
|
-
function
|
144
|
+
function field(fieldId) {
|
151
145
|
const getDateRange = (date, clause) => ({
|
152
146
|
type: "object",
|
153
147
|
properties: {
|
@@ -160,6 +154,10 @@ function createFieldConditionals(fieldId) {
|
|
160
154
|
required: [fieldId]
|
161
155
|
});
|
162
156
|
return {
|
157
|
+
/**
|
158
|
+
* @private Internal property used for field reference tracking.
|
159
|
+
*/
|
160
|
+
_fieldId: fieldId,
|
163
161
|
isAfter: () => ({
|
164
162
|
days: (days) => ({
|
165
163
|
inPast: () => defineFormConditional(
|
@@ -326,7 +324,6 @@ function createFieldConditionals(fieldId) {
|
|
326
324
|
}
|
327
325
|
},
|
328
326
|
required: [fieldId]
|
329
|
-
})
|
330
|
-
getId: () => ({ fieldId })
|
327
|
+
})
|
331
328
|
};
|
332
329
|
}
|