@inixiative/json-rules 3.5.3 → 3.6.0

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/README.md CHANGED
@@ -875,7 +875,7 @@ const lens = composeLens('delegate-7', { user, 'org-acme': orgAcme, 'delegate-7'
875
875
  ### Operator Catalog
876
876
 
877
877
  What a rule builder can offer for a field. The catalog's constants are `FieldKind`,
878
- `RuleTarget`, `ValueShape`, `NUMERIC_KINDS` and `ALL_KINDS`; `getValueShape(operator, family)` takes an
878
+ `RuleTarget`, `ValueShape`, `ConditionShape`, `NUMERIC_KINDS` and `ALL_KINDS`; `getValueShape(operator, family)` takes an
879
879
  `OperatorFamily` (`'field' | 'date' | 'array'`).
880
880
 
881
881
  ```ts
@@ -902,6 +902,7 @@ getValueShape('between', 'date'); // 'dateRange'
902
902
  | `getArrayOperators(target?)` | The array operators, narrowed to one target when given. |
903
903
  | `getAggregateOperators()` | The comparisons an aggregate rule takes. Every target compiles all of them. |
904
904
  | `getValueShape(operator, family)` | The operand an operator takes (`'scalar'`, `'range'`, `'dayList'`, …). `family` is `'field'`, `'date'` or `'array'`, since `between` is both a field and a date operator. Throws on an operator the family doesn't have. |
905
+ | `getConditionShapeKeys(shape)` | `{ required, optional }`: the keys a node of a `ConditionShape` (`'all'`, `'any'`, `'if'`, `'field'`, `'aggregate'`, `'array'`, `'date'`) must have and the keys it may. A literal `true` / `false` is a condition too. |
905
906
 
906
907
  To ask whether a whole rule runs on a target (windows, scope refs and operators together), use
907
908
  `validateRule(rule, { target })`.