@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.cjs
CHANGED
|
@@ -10974,10 +10974,14 @@ function relationIdsOf(value) {
|
|
|
10974
10974
|
}
|
|
10975
10975
|
return out;
|
|
10976
10976
|
}
|
|
10977
|
-
var
|
|
10978
|
-
function
|
|
10979
|
-
|
|
10980
|
-
|
|
10977
|
+
var FREE_WORD_TYPES = /* @__PURE__ */ new Set(["text", "long", "long_text", "rich_text", "markdown"]);
|
|
10978
|
+
function hasPatternRule(field2) {
|
|
10979
|
+
return Array.isArray(field2?.rules) && field2.rules.some((rule) => rule?.kind === "pattern");
|
|
10980
|
+
}
|
|
10981
|
+
function blankToNull(type, value, field2) {
|
|
10982
|
+
if (typeof value !== "string" || value.trim() !== "") return value;
|
|
10983
|
+
if (!FREE_WORD_TYPES.has(type)) return null;
|
|
10984
|
+
return hasPatternRule(field2) ? null : value;
|
|
10981
10985
|
}
|
|
10982
10986
|
function createTableDataPort({ client, aliases }) {
|
|
10983
10987
|
const shapes = /* @__PURE__ */ new Map();
|
|
@@ -11052,7 +11056,7 @@ function createTableDataPort({ client, aliases }) {
|
|
|
11052
11056
|
if (!column) return refuse2("invalid_argument", `This table has no column "${key}".`, "Ask columns() for the keys this table has now. Nothing was saved.");
|
|
11053
11057
|
if (column.readOnly) return refuse2("invalid_argument", `"${column.label}" is worked out by the table, so it cannot be written.`, "Nothing was saved.");
|
|
11054
11058
|
const kinds = column.type === "relation" ? entityKindsOf(shape.fields.get(key)) : [];
|
|
11055
|
-
out[key] = kinds.length ? entityRefsOf2(value, kinds) : column.type === "relation" ? relationIdsOf(value) : blankToNull(column.type, value);
|
|
11059
|
+
out[key] = kinds.length ? entityRefsOf2(value, kinds) : column.type === "relation" ? relationIdsOf(value) : blankToNull(column.type, value, shape.fields.get(key));
|
|
11056
11060
|
}
|
|
11057
11061
|
return { ok: true, data: out };
|
|
11058
11062
|
}
|