@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/setup/index.js
CHANGED
|
@@ -427,6 +427,7 @@ var defaultOpLedger = ledgerOver(globalSlot2("ai-matrx.records.op-ledger", () =>
|
|
|
427
427
|
var SYSTEM_CONTEXT_TYPE_ID = "__system__";
|
|
428
428
|
|
|
429
429
|
// src/scopes/codec.ts
|
|
430
|
+
import { isUuidShape as isUuidShape2 } from "@ai-matrx/kit/uuid";
|
|
430
431
|
var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
|
|
431
432
|
var strOrNull = (v) => typeof v === "string" ? v : null;
|
|
432
433
|
var num = (v, fallback = 0) => {
|
|
@@ -642,7 +643,6 @@ function systemContextFieldFromStore(row, index) {
|
|
|
642
643
|
item_class: strOrNull(row.item_class)
|
|
643
644
|
};
|
|
644
645
|
}
|
|
645
|
-
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
646
646
|
function referencesOf(row) {
|
|
647
647
|
const v = row.value;
|
|
648
648
|
const list = Array.isArray(v) ? v : v == null ? [] : [v];
|
|
@@ -652,7 +652,7 @@ function referencesOf(row) {
|
|
|
652
652
|
const out = [];
|
|
653
653
|
for (const el of list) {
|
|
654
654
|
let ref = null;
|
|
655
|
-
if (typeof el === "string" &&
|
|
655
|
+
if (typeof el === "string" && isUuidShape2(el)) ref = { id: el, type: toFile ? "file" : "scope" };
|
|
656
656
|
else if (el && typeof el === "object" && typeof el.id === "string") {
|
|
657
657
|
const token = String(el.token ?? "");
|
|
658
658
|
const own = el.label;
|
|
@@ -1139,7 +1139,7 @@ function createScopeDoors(call) {
|
|
|
1139
1139
|
}
|
|
1140
1140
|
|
|
1141
1141
|
// src/choice.ts
|
|
1142
|
-
import { isUuidShape as
|
|
1142
|
+
import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
|
|
1143
1143
|
var CHOICE_NUDGES = ["ask", "always_add", "never_add"];
|
|
1144
1144
|
function asChoiceNudge(value) {
|
|
1145
1145
|
return typeof value === "string" && CHOICE_NUDGES.includes(value) ? value : "ask";
|
|
@@ -7086,7 +7086,7 @@ function opHeader(opId) {
|
|
|
7086
7086
|
}
|
|
7087
7087
|
|
|
7088
7088
|
// src/entity/port/port.ts
|
|
7089
|
-
import { isUuidShape as
|
|
7089
|
+
import { isUuidShape as isUuidShape4 } from "@ai-matrx/kit/uuid";
|
|
7090
7090
|
|
|
7091
7091
|
// src/entity/core/realtime.ts
|
|
7092
7092
|
import {
|
|
@@ -7415,7 +7415,7 @@ function createEntityDataPort(options) {
|
|
|
7415
7415
|
async get(alias, id) {
|
|
7416
7416
|
const binding = bindingOf(alias);
|
|
7417
7417
|
if (!binding) return noSuchAlias(alias);
|
|
7418
|
-
if (!
|
|
7418
|
+
if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
|
|
7419
7419
|
return getCoalesced(alias, binding.token, id);
|
|
7420
7420
|
},
|
|
7421
7421
|
async create(alias, values) {
|
|
@@ -7435,20 +7435,20 @@ function createEntityDataPort(options) {
|
|
|
7435
7435
|
async update(alias, id, patch, baseVersion) {
|
|
7436
7436
|
const binding = bindingOf(alias);
|
|
7437
7437
|
if (!binding) return noSuchAlias(alias);
|
|
7438
|
-
if (!
|
|
7438
|
+
if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
|
|
7439
7439
|
const answer = await client.update({ token: binding.token, id, baseVersion, patch: toWireValues(patch), opId: ledger.mint() });
|
|
7440
7440
|
return readBack(alias, answer, "The change");
|
|
7441
7441
|
},
|
|
7442
7442
|
async archive(alias, id) {
|
|
7443
7443
|
const binding = bindingOf(alias);
|
|
7444
7444
|
if (!binding) return noSuchAlias(alias);
|
|
7445
|
-
if (!
|
|
7445
|
+
if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
|
|
7446
7446
|
return done(await client.archive({ token: binding.token, ids: [id], opId: ledger.mint() }));
|
|
7447
7447
|
},
|
|
7448
7448
|
async restore(alias, id) {
|
|
7449
7449
|
const binding = bindingOf(alias);
|
|
7450
7450
|
if (!binding) return noSuchAlias(alias);
|
|
7451
|
-
if (!
|
|
7451
|
+
if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
|
|
7452
7452
|
return done(await client.unarchive({ token: binding.token, ids: [id], opId: ledger.mint() }));
|
|
7453
7453
|
},
|
|
7454
7454
|
subscribe(event, listener) {
|