@ai-matrx/records 0.87.14 → 0.87.16
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/dist/react/index.js
CHANGED
|
@@ -10666,10 +10666,14 @@ function relationIdsOf(value) {
|
|
|
10666
10666
|
}
|
|
10667
10667
|
return out;
|
|
10668
10668
|
}
|
|
10669
|
-
var
|
|
10670
|
-
function
|
|
10671
|
-
|
|
10672
|
-
|
|
10669
|
+
var FREE_WORD_TYPES = /* @__PURE__ */ new Set(["text", "long", "long_text", "rich_text", "markdown"]);
|
|
10670
|
+
function hasPatternRule(field2) {
|
|
10671
|
+
return Array.isArray(field2?.rules) && field2.rules.some((rule) => rule?.kind === "pattern");
|
|
10672
|
+
}
|
|
10673
|
+
function blankToNull(type, value, field2) {
|
|
10674
|
+
if (typeof value !== "string" || value.trim() !== "") return value;
|
|
10675
|
+
if (!FREE_WORD_TYPES.has(type)) return null;
|
|
10676
|
+
return hasPatternRule(field2) ? null : value;
|
|
10673
10677
|
}
|
|
10674
10678
|
function createTableDataPort({ client, aliases }) {
|
|
10675
10679
|
const shapes = /* @__PURE__ */ new Map();
|
|
@@ -10744,7 +10748,7 @@ function createTableDataPort({ client, aliases }) {
|
|
|
10744
10748
|
if (!column) return refuse2("invalid_argument", `This table has no column "${key}".`, "Ask columns() for the keys this table has now. Nothing was saved.");
|
|
10745
10749
|
if (column.readOnly) return refuse2("invalid_argument", `"${column.label}" is worked out by the table, so it cannot be written.`, "Nothing was saved.");
|
|
10746
10750
|
const kinds = column.type === "relation" ? entityKindsOf(shape.fields.get(key)) : [];
|
|
10747
|
-
out[key] = kinds.length ? entityRefsOf2(value, kinds) : column.type === "relation" ? relationIdsOf(value) : blankToNull(column.type, value);
|
|
10751
|
+
out[key] = kinds.length ? entityRefsOf2(value, kinds) : column.type === "relation" ? relationIdsOf(value) : blankToNull(column.type, value, shape.fields.get(key));
|
|
10748
10752
|
}
|
|
10749
10753
|
return { ok: true, data: out };
|
|
10750
10754
|
}
|