@ai-matrx/records 0.82.0 → 0.83.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/CHANGELOG.md +19 -1
- package/dist/memory/index.cjs +2 -0
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.js +2 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/templates/index.cjs +428 -139
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +9 -5
- package/dist/templates/index.d.ts +9 -5
- package/dist/templates/index.js +428 -139
- package/dist/templates/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
## 0.83.0 — the gate parses with the one formula language
|
|
5
|
+
|
|
6
|
+
- The template gate parses formulas with `@ai-matrx/kit/formula` (one parser, the store's 35
|
|
7
|
+
functions) and keeps only its exact-fraction evaluator (`evalFormula`, numbers read from the digits as
|
|
8
|
+
typed). `parseFormula` is renamed `parseGateFormula`; the function list is
|
|
9
|
+
`FORMULA_FUNCTION_NAMES` (from kit). An unknown function now reads "There is no function called
|
|
10
|
+
`FOO`. A column goes in braces, like {FOO}." (architecture D6).
|
|
11
|
+
|
|
12
|
+
Consumer action: `parseFormula` / `FORMULA_FUNCTIONS` from `@ai-matrx/records` → `parseGateFormula` /
|
|
13
|
+
`FORMULA_FUNCTION_NAMES` (no consumer imports them).
|
|
14
|
+
|
|
15
|
+
## 0.82.1
|
|
16
|
+
### lane DESCRIBE-BENCH2 (sweep): the mechanical wrong shapes are read, not refused
|
|
17
|
+
|
|
18
|
+
- `autofixDescribeSpec` also rewrites, each with an auto-fix note and only when unambiguous: view `filters` written as a list of `{field, op, value}` (→ the store's map; several values → `anyOf`; a condition the store cannot express is dropped and SAID), `sort`/`orderBy` → `sorts`, `group_by`/`date_field`/… → `groupBy`/`dateField`/…, an exact duplicate view dropped; a field typed with `kind`/`type` (or by a plain label) → `parityType`; a formula over bare field names → `{Label}`; a relationship `inverseKey` that is already a field of the target (the store then read the rollup's link as a plain formula) renamed; a rollup named for a status with no filter → the filter when exactly one far-side choice/tick box is that word; a real-looking phone → a fictional one; a copy of the shared team_member block → an ordinary table (name, role, notes).
|
|
19
|
+
- `describeVocabulary()` gains `view_filters_shape`, `field_shape`, `formula_shape`, `relationship_shape`, `phone_rule`, `team_rule`.
|
|
20
|
+
|
|
21
|
+
## Earlier in this release — a rollup or lookup in the wrong shape is read, not refused
|
|
4
22
|
|
|
5
23
|
- `autofixDescribeSpec` (so `describeCheck` and the live box) rewrites a rollup or lookup written as `{rollup:{relation,field,fn}}`, `{lookup:{relationField,targetField}}`, `rollupVia/rollupField/rollupFn`, `through/aggregate` and ~20 other spellings into the validator's `via` / `pick` / `agg`, with an auto-fix note, when the relation field, the far field and the aggregate word are unambiguous (sum/total, count, avg/average/mean, min, max …). A rollup through a single link makes that link a list (and its relationship `many`). An unknown relation or aggregate is left for the check to name — nothing is invented.
|
|
6
24
|
- `describeVocabulary()` gains `rollup_shape` and `lookup_shape`: the rule in one sentence and one tiny example in the validator's keys, handed to every describe arm.
|
package/dist/memory/index.cjs
CHANGED
|
@@ -695,6 +695,7 @@ var SHARED_BLOCK_IDS = Object.keys(SHARED_BLOCKS);
|
|
|
695
695
|
|
|
696
696
|
// src/templates/validate.ts
|
|
697
697
|
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
698
|
+
var import_formula = require("@ai-matrx/kit/formula");
|
|
698
699
|
|
|
699
700
|
// src/templates/confidential.ts
|
|
700
701
|
var TABLE_KERNEL_ID = "11111111-0000-4000-8000-000000000001";
|
|
@@ -1776,6 +1777,7 @@ function resolveDateToken(token, today, timeZone) {
|
|
|
1776
1777
|
const local = `${day}T${m[6]}:${m[7]}`;
|
|
1777
1778
|
return `${local}:00${zoneOffset(local, timeZone)}`;
|
|
1778
1779
|
}
|
|
1780
|
+
var FORMULA_FUNCTION_NAMES = new Set(import_formula.FORMULA_FUNCTIONS.map((f) => f.name));
|
|
1779
1781
|
var BEHAVIOR_OF = new Map([
|
|
1780
1782
|
...PARITY_FIELD_TYPES.map((t) => [t.parity_type, t.behavior]),
|
|
1781
1783
|
...DECLARABLE_FIELD_KINDS.map((k) => [k.kind, k.behavior]),
|