@octaviaflow/flow-rules 0.19.0 → 0.19.1
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.
|
@@ -16,7 +16,12 @@ export interface ConditionFilter {
|
|
|
16
16
|
id: string;
|
|
17
17
|
field: string;
|
|
18
18
|
operator: ConditionOperator;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The right-hand side: a literal, a field path, or a `$` system variable.
|
|
21
|
+
* Numbers and booleans are literals in their own right — `0` and `false`
|
|
22
|
+
* are real values, not "missing" (DEV-540).
|
|
23
|
+
*/
|
|
24
|
+
value: string | number | boolean;
|
|
20
25
|
logicalOperator?: 'and' | 'or';
|
|
21
26
|
}
|
|
22
27
|
export interface ConditionConfigType {
|
package/dist/index.cjs
CHANGED
|
@@ -3384,6 +3384,9 @@ var CONDITION_OPERATORS = [
|
|
|
3384
3384
|
{ id: "is_not_null", label: "Is Not Null", needsValue: false },
|
|
3385
3385
|
{ id: "is_empty", label: "Is Empty", needsValue: false }
|
|
3386
3386
|
];
|
|
3387
|
+
function isMissingValue(value) {
|
|
3388
|
+
return value === undefined || value === null || value === "";
|
|
3389
|
+
}
|
|
3387
3390
|
var ConditionConfig = {
|
|
3388
3391
|
defaults: {
|
|
3389
3392
|
mode: "visual",
|
|
@@ -3417,7 +3420,7 @@ var ConditionConfig = {
|
|
|
3417
3420
|
if (!f.operator)
|
|
3418
3421
|
errors.push(`Filter ${i + 1}: Operator is required`);
|
|
3419
3422
|
const opDef = CONDITION_OPERATORS.find((o) => o.id === f.operator);
|
|
3420
|
-
if (opDef?.needsValue &&
|
|
3423
|
+
if (opDef?.needsValue && isMissingValue(f.value)) {
|
|
3421
3424
|
errors.push(`Filter ${i + 1}: Value is required`);
|
|
3422
3425
|
}
|
|
3423
3426
|
});
|
package/dist/index.js
CHANGED
|
@@ -3209,6 +3209,9 @@ var CONDITION_OPERATORS = [
|
|
|
3209
3209
|
{ id: "is_not_null", label: "Is Not Null", needsValue: false },
|
|
3210
3210
|
{ id: "is_empty", label: "Is Empty", needsValue: false }
|
|
3211
3211
|
];
|
|
3212
|
+
function isMissingValue(value) {
|
|
3213
|
+
return value === undefined || value === null || value === "";
|
|
3214
|
+
}
|
|
3212
3215
|
var ConditionConfig = {
|
|
3213
3216
|
defaults: {
|
|
3214
3217
|
mode: "visual",
|
|
@@ -3242,7 +3245,7 @@ var ConditionConfig = {
|
|
|
3242
3245
|
if (!f.operator)
|
|
3243
3246
|
errors.push(`Filter ${i + 1}: Operator is required`);
|
|
3244
3247
|
const opDef = CONDITION_OPERATORS.find((o) => o.id === f.operator);
|
|
3245
|
-
if (opDef?.needsValue &&
|
|
3248
|
+
if (opDef?.needsValue && isMissingValue(f.value)) {
|
|
3246
3249
|
errors.push(`Filter ${i + 1}: Value is required`);
|
|
3247
3250
|
}
|
|
3248
3251
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octaviaflow/flow-rules",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "The flow action catalog and the rules engine behind Flow Doctor — one definition of what a step accepts and what makes a flow valid, shared by the editor and the server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|