@ai-matrx/records 0.87.14 → 0.87.15
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 +17 -2
- package/dist/data/index.cjs +9 -5
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +9 -5
- package/dist/data/index.js.map +1 -1
- package/dist/react/index.cjs +9 -5
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +9 -5
- package/dist/react/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
-
## 0.87.
|
|
3
|
+
## 0.87.15
|
|
4
|
+
### lane AO: a blank format-checked field is no value (0.87.14)
|
|
5
|
+
|
|
6
|
+
From the final live test of the Applet builder (v0.4.3018, 2026-10-08): Brand form, only the name filled,
|
|
7
|
+
Save → `record_write` 400 / 23514 "Contact Email is not written the way this field expects". The table data
|
|
8
|
+
port kept "" for email / url / phone as "words", but every one of them carries a `pattern` Rule (measured live
|
|
9
|
+
on `custom.field`: email 1209/1209, phone 999/999, url 236/236) and the store's pattern Rule refuses "".
|
|
10
|
+
- `blankToNull(type, value, field?)` (`./data`): "" is kept ONLY for free text (`text`, `long`, `long_text`,
|
|
11
|
+
`rich_text`, `markdown`) whose Field carries no pattern Rule; every other column — every format the store
|
|
12
|
+
checks (email, url, phone, address, color, date, time, json, tags, signature, array) and every typed one —
|
|
13
|
+
writes a blank as null. `createTableDataPort` passes the column's Field.
|
|
14
|
+
- Tests: `a-blank-format-checked-field-is-no-value.test.ts` — the Brands field rows captured live, through the
|
|
15
|
+
real `readTableShape` + `createTableDataPort`, judged by a mirror of `custom.validate_values` (red before).
|
|
16
|
+
- **Consumer action:** none. An Applet's blank optional email / link / phone now saves.
|
|
17
|
+
|
|
18
|
+
## 0.87.13
|
|
4
19
|
|
|
5
20
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
-
`git diff npm/records/v0.87.
|
|
21
|
+
`git diff npm/records/v0.87.12..npm/records/v0.87.13 -- apps/shared/records`).
|
|
7
22
|
No source changes intended and no consumer action required.
|
|
8
23
|
|
|
9
24
|
## 0.87.11
|
package/dist/data/index.cjs
CHANGED
|
@@ -6330,10 +6330,14 @@ function relationIdsOf(value) {
|
|
|
6330
6330
|
}
|
|
6331
6331
|
return out;
|
|
6332
6332
|
}
|
|
6333
|
-
var
|
|
6334
|
-
function
|
|
6335
|
-
|
|
6336
|
-
|
|
6333
|
+
var FREE_WORD_TYPES = /* @__PURE__ */ new Set(["text", "long", "long_text", "rich_text", "markdown"]);
|
|
6334
|
+
function hasPatternRule(field) {
|
|
6335
|
+
return Array.isArray(field?.rules) && field.rules.some((rule) => rule?.kind === "pattern");
|
|
6336
|
+
}
|
|
6337
|
+
function blankToNull(type, value, field) {
|
|
6338
|
+
if (typeof value !== "string" || value.trim() !== "") return value;
|
|
6339
|
+
if (!FREE_WORD_TYPES.has(type)) return null;
|
|
6340
|
+
return hasPatternRule(field) ? null : value;
|
|
6337
6341
|
}
|
|
6338
6342
|
function createTableDataPort({ client, aliases }) {
|
|
6339
6343
|
const shapes = /* @__PURE__ */ new Map();
|
|
@@ -6408,7 +6412,7 @@ function createTableDataPort({ client, aliases }) {
|
|
|
6408
6412
|
if (!column) return refuse2("invalid_argument", `This table has no column "${key}".`, "Ask columns() for the keys this table has now. Nothing was saved.");
|
|
6409
6413
|
if (column.readOnly) return refuse2("invalid_argument", `"${column.label}" is worked out by the table, so it cannot be written.`, "Nothing was saved.");
|
|
6410
6414
|
const kinds = column.type === "relation" ? entityKindsOf(shape.fields.get(key)) : [];
|
|
6411
|
-
out[key] = kinds.length ? entityRefsOf2(value, kinds) : column.type === "relation" ? relationIdsOf(value) : blankToNull(column.type, value);
|
|
6415
|
+
out[key] = kinds.length ? entityRefsOf2(value, kinds) : column.type === "relation" ? relationIdsOf(value) : blankToNull(column.type, value, shape.fields.get(key));
|
|
6412
6416
|
}
|
|
6413
6417
|
return { ok: true, data: out };
|
|
6414
6418
|
}
|