@ai-matrx/records 0.99.14 → 0.99.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 +6 -0
- package/dist/core/index.cjs +6 -6
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +6 -6
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +6 -6
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +6 -6
- package/dist/data/index.js.map +1 -1
- package/dist/react/index.cjs +20 -20
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +18 -18
- package/dist/react/index.js.map +1 -1
- package/dist/scopes/index.cjs +2 -2
- package/dist/scopes/index.cjs.map +1 -1
- package/dist/scopes/index.js +2 -2
- package/dist/scopes/index.js.map +1 -1
- package/dist/setup/index.cjs +8 -8
- package/dist/setup/index.cjs.map +1 -1
- package/dist/setup/index.js +8 -8
- package/dist/setup/index.js.map +1 -1
- package/dist/typed-table/index.cjs +3 -3
- package/dist/typed-table/index.cjs.map +1 -1
- package/dist/typed-table/index.js +3 -3
- package/dist/typed-table/index.js.map +1 -1
- package/package.json +4 -4
package/dist/data/index.js
CHANGED
|
@@ -631,6 +631,7 @@ var defaultOpLedger = ledgerOver(globalSlot2("ai-matrx.records.op-ledger", () =>
|
|
|
631
631
|
var SYSTEM_CONTEXT_TYPE_ID = "__system__";
|
|
632
632
|
|
|
633
633
|
// src/scopes/codec.ts
|
|
634
|
+
import { isUuidShape as isUuidShape4 } from "@ai-matrx/kit/uuid";
|
|
634
635
|
var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
|
|
635
636
|
var strOrNull = (v) => typeof v === "string" ? v : null;
|
|
636
637
|
var num = (v, fallback = 0) => {
|
|
@@ -846,7 +847,6 @@ function systemContextFieldFromStore(row, index) {
|
|
|
846
847
|
item_class: strOrNull(row.item_class)
|
|
847
848
|
};
|
|
848
849
|
}
|
|
849
|
-
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
850
850
|
function referencesOf(row) {
|
|
851
851
|
const v = row.value;
|
|
852
852
|
const list = Array.isArray(v) ? v : v == null ? [] : [v];
|
|
@@ -856,7 +856,7 @@ function referencesOf(row) {
|
|
|
856
856
|
const out = [];
|
|
857
857
|
for (const el of list) {
|
|
858
858
|
let ref = null;
|
|
859
|
-
if (typeof el === "string" &&
|
|
859
|
+
if (typeof el === "string" && isUuidShape4(el)) ref = { id: el, type: toFile ? "file" : "scope" };
|
|
860
860
|
else if (el && typeof el === "object" && typeof el.id === "string") {
|
|
861
861
|
const token = String(el.token ?? "");
|
|
862
862
|
const own = el.label;
|
|
@@ -7172,7 +7172,7 @@ function clientIn(client, organizationId) {
|
|
|
7172
7172
|
}
|
|
7173
7173
|
|
|
7174
7174
|
// src/data/table-port.ts
|
|
7175
|
-
import { isUuidShape as
|
|
7175
|
+
import { isUuidShape as isUuidShape5 } from "@ai-matrx/kit/uuid";
|
|
7176
7176
|
var DATA_PAGE_CEILING = 500;
|
|
7177
7177
|
var DATA_PAGE_DEFAULT = 50;
|
|
7178
7178
|
var ARCHIVED_CURSOR = "archived:";
|
|
@@ -7191,7 +7191,7 @@ function entityRefsOf2(value, kinds) {
|
|
|
7191
7191
|
const out = [];
|
|
7192
7192
|
for (const item of items) {
|
|
7193
7193
|
const id = typeof item === "string" ? item : item && typeof item === "object" ? item.id : null;
|
|
7194
|
-
if (typeof id !== "string" || !
|
|
7194
|
+
if (typeof id !== "string" || !isUuidShape5(id)) continue;
|
|
7195
7195
|
const raw = item && typeof item === "object" ? item.token : null;
|
|
7196
7196
|
const token = typeof raw === "string" && raw && raw !== CUSTOM_ROW_TOKEN ? raw : kinds[0];
|
|
7197
7197
|
if (token) out.push({ token, id });
|
|
@@ -7203,7 +7203,7 @@ function relationIdsOf(value) {
|
|
|
7203
7203
|
const out = [];
|
|
7204
7204
|
for (const item of items) {
|
|
7205
7205
|
const id = typeof item === "string" ? item : item && typeof item === "object" ? item.id : null;
|
|
7206
|
-
if (typeof id === "string" &&
|
|
7206
|
+
if (typeof id === "string" && isUuidShape5(id)) out.push(id);
|
|
7207
7207
|
}
|
|
7208
7208
|
return out;
|
|
7209
7209
|
}
|
|
@@ -7300,7 +7300,7 @@ function createTableDataPort({ client, aliases }) {
|
|
|
7300
7300
|
async function getRow(alias, id) {
|
|
7301
7301
|
const binding = bindingOf(alias);
|
|
7302
7302
|
if (!binding) return noSuchAlias(alias);
|
|
7303
|
-
if (!
|
|
7303
|
+
if (!isUuidShape5(id)) return refuse2("invalid_argument", `"${String(id)}" is not a row id.`);
|
|
7304
7304
|
const shape = await shapeOf(alias, binding);
|
|
7305
7305
|
if (!shape.ok) return shape;
|
|
7306
7306
|
const read = await readByIds(binding, [id]);
|