@timeax/digital-service-engine 0.2.6 → 0.2.7
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/core/index.cjs +17 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +17 -7
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.cjs +17 -7
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +17 -7
- package/dist/react/index.js.map +1 -1
- package/dist/workspace/index.cjs +17 -7
- package/dist/workspace/index.cjs.map +1 -1
- package/dist/workspace/index.js +17 -7
- package/dist/workspace/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1187,10 +1187,19 @@ function validateOrderKinds(v) {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
// src/core/validate/steps/service-vs-input.ts
|
|
1190
|
+
function hasButtonTriggerMap(v, fieldId) {
|
|
1191
|
+
var _a, _b;
|
|
1192
|
+
const includes = (_a = v.props.includes_for_buttons) == null ? void 0 : _a[fieldId];
|
|
1193
|
+
const excludes = (_b = v.props.excludes_for_buttons) == null ? void 0 : _b[fieldId];
|
|
1194
|
+
return Array.isArray(includes) && includes.length > 0 || Array.isArray(excludes) && excludes.length > 0;
|
|
1195
|
+
}
|
|
1190
1196
|
function validateServiceVsUserInput(v) {
|
|
1191
1197
|
for (const f of v.fields) {
|
|
1192
1198
|
const anySvc = hasAnyServiceOption(f);
|
|
1193
1199
|
const hasName = !!(f.name && f.name.trim());
|
|
1200
|
+
const isButton2 = f.button === true;
|
|
1201
|
+
const hasFieldService = f.service_id !== void 0 && f.service_id !== null;
|
|
1202
|
+
const hasTriggerMap = isButton2 && hasButtonTriggerMap(v, f.id);
|
|
1194
1203
|
if (f.type === "custom" && anySvc) {
|
|
1195
1204
|
v.errors.push({
|
|
1196
1205
|
code: "user_input_field_has_service_option",
|
|
@@ -1201,14 +1210,15 @@ function validateServiceVsUserInput(v) {
|
|
|
1201
1210
|
});
|
|
1202
1211
|
}
|
|
1203
1212
|
if (!hasName) {
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1206
|
-
code: "service_field_missing_service_id",
|
|
1207
|
-
severity: "error",
|
|
1208
|
-
message: `Service-backed field "${f.id}" has no "name" and must provide at least one option with a service_id.`,
|
|
1209
|
-
nodeId: f.id
|
|
1210
|
-
});
|
|
1213
|
+
if (hasFieldService || anySvc || hasTriggerMap) {
|
|
1214
|
+
continue;
|
|
1211
1215
|
}
|
|
1216
|
+
v.errors.push({
|
|
1217
|
+
code: "service_field_missing_service_id",
|
|
1218
|
+
severity: "error",
|
|
1219
|
+
message: isButton2 ? `Button field "${f.id}" has no "name", no "service_id", and no includes/excludes trigger map. Add a name, attach a service_id, or configure includes_for_buttons/excludes_for_buttons.` : `Service-backed field "${f.id}" has no "name" and must provide at least one option with a service_id.`,
|
|
1220
|
+
nodeId: f.id
|
|
1221
|
+
});
|
|
1212
1222
|
} else {
|
|
1213
1223
|
if (anySvc) {
|
|
1214
1224
|
v.errors.push({
|