@ai-matrx/records 0.96.2 → 0.96.4
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 +18 -0
- package/dist/memory/index.cjs +21 -3
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +21 -3
- package/dist/memory/index.js.map +1 -1
- package/dist/templates/index.cjs +21 -3
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +21 -3
- package/dist/templates/index.js.map +1 -1
- package/dist/{types-BhGs3f8s.d.cts → types-KdeN9-5L.d.cts} +11 -3
- package/dist/{types-DAruHh1G.d.ts → types-qvGJwpw3.d.ts} +11 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
+
## 0.96.4
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records/v0.96.3..npm/records/v0.96.4 -- apps/shared/records`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.96.3
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/records/v0.96.2..npm/records/v0.96.3 -- apps/shared/records`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.96.2
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
18
|
`git diff npm/records/v0.96.1..npm/records/v0.96.2 -- apps/shared/records`).
|
|
7
19
|
No source changes intended and no consumer action required.
|
|
8
20
|
|
|
21
|
+
## 0.96.1
|
|
22
|
+
|
|
23
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
24
|
+
`git diff npm/records/v0.96.0..npm/records/v0.96.1 -- apps/shared/records`).
|
|
25
|
+
No source changes intended and no consumer action required.
|
|
26
|
+
|
|
9
27
|
## 0.96.0 — the organization's calendar can be asked (lane NOTION-SMALL-4)
|
|
10
28
|
|
|
11
29
|
- **`client.aggCalendar()`** answers `{ time_zone, week_start }` from `custom.agg_calendar`, the same door the relative date filters and
|
package/dist/memory/index.cjs
CHANGED
|
@@ -1878,11 +1878,28 @@ function compileInstallPlan(written) {
|
|
|
1878
1878
|
const spec = tokenizeValues({ ...written, attachments: void 0 }, attachmentKeys);
|
|
1879
1879
|
const bound = new Map(allTables(spec).filter((t) => t.bindsTo?.tableId).map((t) => [t.token, t.bindsTo]));
|
|
1880
1880
|
const has = (token, key) => bound.get(token)?.fields.includes(key) ?? false;
|
|
1881
|
+
const resolves = (target, v) => {
|
|
1882
|
+
const b = bound.get(target);
|
|
1883
|
+
return !b || !!b.seedRows || typeof v === "string" && !!b.rowIds?.[v];
|
|
1884
|
+
};
|
|
1881
1885
|
const tables = allTables(spec).map((t) => {
|
|
1882
|
-
if (bound.has(t.token)) return { ...t, rows: [] };
|
|
1883
|
-
const toBound = t.fields.filter((f) => f.parityType === "relation" && f.relationTarget && bound.has(f.relationTarget))
|
|
1886
|
+
if (bound.has(t.token)) return bound.get(t.token).seedRows ? t : { ...t, rows: [] };
|
|
1887
|
+
const toBound = t.fields.filter((f) => f.parityType === "relation" && f.relationTarget && bound.has(f.relationTarget));
|
|
1884
1888
|
if (!toBound.length) return t;
|
|
1885
|
-
|
|
1889
|
+
const lost = /* @__PURE__ */ new Set();
|
|
1890
|
+
const rows = t.rows.map((r) => {
|
|
1891
|
+
const values = { ...r.values ?? {} };
|
|
1892
|
+
for (const f of toBound) {
|
|
1893
|
+
const v = values[f.key];
|
|
1894
|
+
if (v === null || v === void 0) continue;
|
|
1895
|
+
const keep = Array.isArray(v) ? v.filter((x) => resolves(f.relationTarget, x)) : resolves(f.relationTarget, v) ? v : null;
|
|
1896
|
+
if (Array.isArray(keep) ? keep.length < v.length : keep === null) lost.add(f.key);
|
|
1897
|
+
if (keep === null || Array.isArray(keep) && !keep.length) delete values[f.key];
|
|
1898
|
+
else values[f.key] = keep;
|
|
1899
|
+
}
|
|
1900
|
+
return { ...r, values };
|
|
1901
|
+
});
|
|
1902
|
+
return { ...t, rows, fields: t.fields.map((f) => lost.has(f.key) && f.required ? { ...f, required: false } : f) };
|
|
1886
1903
|
});
|
|
1887
1904
|
const steps = [];
|
|
1888
1905
|
const tableRef = (token) => {
|
|
@@ -1958,6 +1975,7 @@ function compileInstallPlan(written) {
|
|
|
1958
1975
|
}
|
|
1959
1976
|
const rowIds = /* @__PURE__ */ new Map();
|
|
1960
1977
|
for (const t of tables) for (const r of t.rows) rowIds.set(`${t.token}.${r.key}`, minted(`row.${t.token}.${r.key}`));
|
|
1978
|
+
for (const [token, b] of bound) if (!b.seedRows) for (const [key, id] of Object.entries(b.rowIds ?? {})) rowIds.set(`${token}.${key}`, id);
|
|
1961
1979
|
const deferred = deferredRelations(tables);
|
|
1962
1980
|
for (const level of rowLevels(tables)) {
|
|
1963
1981
|
for (const t of level) {
|