@ai-matrx/records 0.84.4 → 0.84.6
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 +14 -0
- package/dist/app-table/index.cjs +51 -2
- package/dist/app-table/index.cjs.map +1 -1
- package/dist/app-table/index.d.cts +3 -3
- package/dist/app-table/index.d.ts +3 -3
- package/dist/app-table/index.js +51 -2
- package/dist/app-table/index.js.map +1 -1
- package/dist/{client-TU-nvgcF.d.ts → client-Cx2JV38-.d.ts} +7 -1
- package/dist/{client-CesQciPd.d.cts → client-xErw4ZgF.d.cts} +7 -1
- package/dist/core/index.cjs +59 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +12 -5
- package/dist/core/index.d.ts +12 -5
- package/dist/core/index.js +59 -4
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +51 -2
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +2 -2
- package/dist/data/index.d.ts +2 -2
- package/dist/data/index.js +51 -2
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-COXYIOiT.d.ts → declareTable-CYzGWD5K.d.ts} +2 -2
- package/dist/{declareTable-B9sr2E0h.d.cts → declareTable-G-H3AK48.d.cts} +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +66 -5
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +16 -1
- package/dist/react/index.d.ts +16 -1
- package/dist/react/index.js +66 -5
- package/dist/react/index.js.map +1 -1
- package/dist/{table-kind-C5T-DOdc.d.ts → table-kind-B_qYmQJG.d.ts} +10 -1
- package/dist/{table-kind-B4vIKJVM.d.cts → table-kind-KMjVs-rk.d.cts} +10 -1
- package/package.json +2 -2
package/dist/data/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bL as EntityRefWithWords } from '../table-kind-KMjVs-rk.cjs';
|
|
2
2
|
import { U as Uuid, h as RecordsResult, n as RecordPageSort, m as ReadRow } from '../record-1yDCn169.cjs';
|
|
3
|
-
import { R as RecordsClient } from '../client-
|
|
3
|
+
import { R as RecordsClient } from '../client-xErw4ZgF.cjs';
|
|
4
4
|
import { b as Field } from '../field-snQG2jMq.cjs';
|
|
5
5
|
import { u as RuleExpression } from '../subscription-B_WaT-kr.cjs';
|
|
6
6
|
import '../ports-y1QNfM80.cjs';
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bL as EntityRefWithWords } from '../table-kind-B_qYmQJG.js';
|
|
2
2
|
import { U as Uuid, h as RecordsResult, n as RecordPageSort, m as ReadRow } from '../record-1yDCn169.js';
|
|
3
|
-
import { R as RecordsClient } from '../client-
|
|
3
|
+
import { R as RecordsClient } from '../client-Cx2JV38-.js';
|
|
4
4
|
import { b as Field } from '../field-BIJiFPc0.js';
|
|
5
5
|
import { u as RuleExpression } from '../subscription-CUok1vAm.js';
|
|
6
6
|
import '../ports-Y5gLbCXe.js';
|
package/dist/data/index.js
CHANGED
|
@@ -239,6 +239,13 @@ function announceRecordChanged(recordId) {
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
+
var removed = /* @__PURE__ */ new Set();
|
|
243
|
+
function markRecordRemoved(recordId) {
|
|
244
|
+
removed.add(recordId);
|
|
245
|
+
}
|
|
246
|
+
function markRecordRestored(recordId) {
|
|
247
|
+
removed.delete(recordId);
|
|
248
|
+
}
|
|
242
249
|
function onRecordChanged(listener) {
|
|
243
250
|
listeners.add(listener);
|
|
244
251
|
return () => listeners.delete(listener);
|
|
@@ -1768,6 +1775,10 @@ var OWED_BY = {
|
|
|
1768
1775
|
// clone; they reach the main database when the chair applies them, after
|
|
1769
1776
|
// visionreach_w4_a_the_store_asks_before_an_agent_changes_a_table.sql (its field_declare body).
|
|
1770
1777
|
reverse_columns: "VIEWS-AND-FIELDS BL \u2014 matrx-frontend migrations/campaign/viewsfields_bl_a_link_shows_on_both_tables.sql (chair's production apply)",
|
|
1778
|
+
// SEED-ENTITY (2026-10-08): the same links through SEVERAL reverse columns in one call; applied to production
|
|
1779
|
+
// through the ledgered runner. Until `pnpm records:generate` lists it, `reverseLinksFields` asks it as an owed door
|
|
1780
|
+
// and a store without it answers `door_absent` (the caller falls back to one call per column).
|
|
1781
|
+
reverse_links_many_fields: "SEED-ENTITY \u2014 matrx-frontend migrations/campaign/seedentity_reverse_links_many_fields.sql (applied 2026-10-08)",
|
|
1771
1782
|
reverse_links_many: "VIEWS-AND-FIELDS BL \u2014 matrx-frontend migrations/campaign/viewsfields_bl_a_link_shows_on_both_tables.sql (chair's production apply)",
|
|
1772
1783
|
// Live on Matrx Main since 2026-10-06 (applied through the Supabase MCP); STORE_DOORS lists it at the
|
|
1773
1784
|
// next `pnpm records:generate`, until then `listKeyset` asks it as an owed door.
|
|
@@ -2008,6 +2019,7 @@ var DOORS = {
|
|
|
2008
2019
|
// links through one of them. Called through `owedDoor` until `pnpm records:generate` lists them.
|
|
2009
2020
|
reverseColumns: "reverse_columns",
|
|
2010
2021
|
reverseLinksMany: "reverse_links_many",
|
|
2022
|
+
reverseLinksManyFields: "reverse_links_many_fields",
|
|
2011
2023
|
homeAdd: "home_add",
|
|
2012
2024
|
recordReparent: "record_reparent",
|
|
2013
2025
|
containmentChain: "containment_chain",
|
|
@@ -3068,7 +3080,10 @@ function createRecordsClient(given) {
|
|
|
3068
3080
|
{ p_organization_id: org, p_record_id: record_id },
|
|
3069
3081
|
"recordDelete"
|
|
3070
3082
|
);
|
|
3071
|
-
if (result.ok)
|
|
3083
|
+
if (result.ok) {
|
|
3084
|
+
markRecordRemoved(record_id);
|
|
3085
|
+
announceRecordChanged(record_id);
|
|
3086
|
+
}
|
|
3072
3087
|
return result;
|
|
3073
3088
|
},
|
|
3074
3089
|
async recordRestore({ record_id }) {
|
|
@@ -3077,7 +3092,10 @@ function createRecordsClient(given) {
|
|
|
3077
3092
|
{ p_organization_id: org, p_record_id: record_id },
|
|
3078
3093
|
"recordRestore"
|
|
3079
3094
|
);
|
|
3080
|
-
if (result.ok)
|
|
3095
|
+
if (result.ok) {
|
|
3096
|
+
markRecordRestored(record_id);
|
|
3097
|
+
announceRecordChanged(record_id);
|
|
3098
|
+
}
|
|
3081
3099
|
return result;
|
|
3082
3100
|
},
|
|
3083
3101
|
async tableArchive({ table_id, chunk, includeTable }) {
|
|
@@ -3878,6 +3896,37 @@ function createRecordsClient(given) {
|
|
|
3878
3896
|
}
|
|
3879
3897
|
return ok(out);
|
|
3880
3898
|
},
|
|
3899
|
+
async reverseLinksFields(args) {
|
|
3900
|
+
const ids = [...new Set(args.record_ids.filter((id) => typeof id === "string" && id.length > 0))];
|
|
3901
|
+
const fieldIds = [...new Set(args.source_field_ids)];
|
|
3902
|
+
const out = Object.fromEntries(fieldIds.map((id) => [id, {}]));
|
|
3903
|
+
for (let f = 0; f < fieldIds.length || f === 0; f += 20) {
|
|
3904
|
+
for (let at = 0; at < ids.length; at += REVERSE_LINKS_RECORDS_PER_CALL) {
|
|
3905
|
+
const result = await owedDoor(
|
|
3906
|
+
DOORS.reverseLinksManyFields,
|
|
3907
|
+
{
|
|
3908
|
+
p_organization_id: org,
|
|
3909
|
+
p_table_id: args.table_id,
|
|
3910
|
+
p_field_ids: fieldIds.slice(f, f + 20),
|
|
3911
|
+
p_record_ids: ids.slice(at, at + REVERSE_LINKS_RECORDS_PER_CALL),
|
|
3912
|
+
p_limit: args.limit ?? 10,
|
|
3913
|
+
p_offset: args.offset ?? 0
|
|
3914
|
+
},
|
|
3915
|
+
"reverseLinksFields"
|
|
3916
|
+
);
|
|
3917
|
+
if (!result.ok) return result;
|
|
3918
|
+
for (const row of result.data ?? []) {
|
|
3919
|
+
if (!row?.record_id || !row.field_id) continue;
|
|
3920
|
+
(out[row.field_id] ??= {})[row.record_id] = {
|
|
3921
|
+
total: typeof row.total === "number" ? row.total : 0,
|
|
3922
|
+
links: Array.isArray(row.links) ? row.links : []
|
|
3923
|
+
};
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
if (fieldIds.length === 0) break;
|
|
3927
|
+
}
|
|
3928
|
+
return ok(out);
|
|
3929
|
+
},
|
|
3881
3930
|
async relationNamesMatch(args) {
|
|
3882
3931
|
const distinct = [];
|
|
3883
3932
|
const seen = /* @__PURE__ */ new Set();
|