@inixiative/json-rules 3.14.0 → 3.15.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.
package/README.md CHANGED
@@ -646,7 +646,7 @@ null`.
646
646
 
647
647
  ## Engine Globals
648
648
 
649
- `engineGlobals` holds process-wide defaults. Keys are dotted paths into one state object.
649
+ `engineGlobals` holds process-wide defaults. Keys are dotted paths into one state object, and `set` / `get` are typed per path (`EngineGlobalPath`, `EngineGlobalValues`): each path takes only its own values.
650
650
 
651
651
  | Key | Default | Governs |
652
652
  | --- | --- | --- |
@@ -654,7 +654,7 @@ null`.
654
654
  | `string.fuzzy` | `false` | Default for a rule's `fuzzy` (`true` or a `FuzzyConfig` `{ maxDistance?, maxRatio? }`): typo-tolerant `contains` / `notContains` on strings. A rule's own flag wins. The compilers have no fuzzy form: they refuse `contains` / `notContains` whenever fuzzy is on, by the rule or by this default. |
655
655
  | `prismaOptions.datasource.provider` | `'postgresql'` | The Prisma connector. `toPrisma()` emits `mode: 'insensitive'` only for `postgresql`, `cockroachdb` and `mongodb`; the others are case-insensitive by collation and reject it. `toPrisma(rule, { datasource: { provider } })` overrides it per call. |
656
656
  | `prismaOptions.anyNull` | your `@prisma/client`'s | Prisma's `AnyNull` for Json null checks (see above); set it only to use another client's. |
657
- | `clock.finestUnit` | `'second'` | The finest clock unit a rule may read (one of `CLOCK_UNITS`). A rule reading a finer one fails to evaluate: `check`, `toPrisma` and `toSql` throw and `validateRule` reports `clock_unit_below_floor`. Under `'hour'`, `{ ago: { minutes: 30 } }` and `{ this: 'minute' }` fail; offsets on a column compare read no clock and are unaffected. A caller whose finest tick is an hour sets it once at boot. |
657
+ | `clock.finestUnit` | `'second'` | The finest unit a date rule may name: one of `CLOCK_UNITS`, or its plural (`'hours'` reads as `'hour'`); anything else throws when a date rule is evaluated. Every unit a date rule names counts, in its value (a relative date, either end of a range) and in its offset, whatever it compares against: a relative date, an absolute one or another column. A finer one fails: `check`, `toPrisma` and `toSql` throw and `validateRule` reports `clock_unit_below_floor`. The rule decides as written, so an amount read from the row or a binding (`{ minutes: { path } }`, a null one too) fails the same, and a bound whole expression is held to it once bound. Under `'hour'`, `{ ago: { minutes: 30 } }`, `{ this: 'minute' }`, and any compare offset by `{ ago: { minutes: 5 } }` fail. A caller whose finest tick is an hour sets it once at boot. |
658
658
 
659
659
  ```ts
660
660
  import { engineGlobals } from '@inixiative/json-rules';