@ai-matrx/records 0.87.31 → 0.92.0
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 +98 -0
- package/README.md +115 -0
- package/dist/{client-E0VQ0NPO.d.ts → client-DE9Mq6YX.d.cts} +8 -5
- package/dist/{client-C3ZZNfGH.d.cts → client-vJAb7g9r.d.ts} +8 -5
- package/dist/core/index.cjs +25 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +23 -12
- package/dist/core/index.d.ts +23 -12
- package/dist/core/index.js +25 -7
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +19 -7
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +12 -142
- package/dist/data/index.d.ts +12 -142
- package/dist/data/index.js +19 -7
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-BK3zufr7.d.cts → declareTable-Btg5bql1.d.cts} +4 -4
- package/dist/{declareTable-B12XybRp.d.ts → declareTable-JKt2q34d.d.ts} +4 -4
- package/dist/entity/index.cjs +984 -0
- package/dist/entity/index.cjs.map +1 -0
- package/dist/entity/index.d.cts +36 -0
- package/dist/entity/index.d.ts +36 -0
- package/dist/entity/index.js +964 -0
- package/dist/entity/index.js.map +1 -0
- package/dist/entity/react.cjs +1024 -0
- package/dist/entity/react.cjs.map +1 -0
- package/dist/entity/react.d.cts +511 -0
- package/dist/entity/react.d.ts +511 -0
- package/dist/entity/react.js +1015 -0
- package/dist/entity/react.js.map +1 -0
- package/dist/{field-BanTVGK2.d.cts → field-BJBnTyJ0.d.cts} +1 -1
- package/dist/{field-BPABOJ2Y.d.ts → field-Ti5iAxFr.d.ts} +1 -1
- package/dist/forms/index.cjs +984 -0
- package/dist/forms/index.cjs.map +1 -0
- package/dist/forms/index.d.cts +333 -0
- package/dist/forms/index.d.ts +333 -0
- package/dist/forms/index.js +961 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/memory/index.d.cts +7 -6
- package/dist/memory/index.d.ts +7 -6
- package/dist/port-CPVBfDxS.d.cts +301 -0
- package/dist/port-D2i2o7Lg.d.ts +301 -0
- package/dist/portal-Db4CYyHe.d.ts +331 -0
- package/dist/portal-DfeY2Boy.d.cts +331 -0
- package/dist/{ports-TMWX-t9l.d.ts → ports-BWtxAnXh.d.ts} +2 -2
- package/dist/{ports-D8-iuY1P.d.cts → ports-DSU2RsR6.d.cts} +2 -2
- package/dist/react/index.cjs +55 -523
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +14 -1
- package/dist/react/index.d.ts +14 -1
- package/dist/react/index.js +52 -527
- package/dist/react/index.js.map +1 -1
- package/dist/realtime/index.d.cts +2 -2
- package/dist/realtime/index.d.ts +2 -2
- package/dist/{record-DpB2QgAZ.d.cts → record-BQi92d4-.d.cts} +7 -1
- package/dist/{record-DpB2QgAZ.d.ts → record-BQi92d4-.d.ts} +7 -1
- package/dist/relation-DMwkmzgN.d.cts +230 -0
- package/dist/relation-DlcqV_W5.d.ts +230 -0
- package/dist/rule-B8kR0l01.d.ts +250 -0
- package/dist/rule-BMViCLmW.d.cts +250 -0
- package/dist/search/index.cjs +283 -0
- package/dist/search/index.cjs.map +1 -0
- package/dist/search/index.d.cts +44 -0
- package/dist/search/index.d.ts +44 -0
- package/dist/search/index.js +260 -0
- package/dist/search/index.js.map +1 -0
- package/dist/setup/index.cjs +6854 -0
- package/dist/setup/index.cjs.map +1 -0
- package/dist/setup/index.d.cts +87 -0
- package/dist/setup/index.d.ts +87 -0
- package/dist/setup/index.js +6829 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/{subscription-D7KQBHXN.d.ts → subscription-5CLN3Jug.d.ts} +3 -249
- package/dist/{subscription-BD9DnJxX.d.cts → subscription-D-VEzvyy.d.cts} +3 -249
- package/dist/{table-kind-BZu8mtND.d.cts → table-kind-CVp43g6h.d.ts} +3 -558
- package/dist/{table-kind-xKxTHtrV.d.ts → table-kind-Cm6PXkWx.d.cts} +3 -558
- package/dist/templates/index.d.cts +10 -9
- package/dist/templates/index.d.ts +10 -9
- package/dist/typed-table/index.cjs +19 -7
- package/dist/typed-table/index.cjs.map +1 -1
- package/dist/typed-table/index.d.cts +10 -7
- package/dist/typed-table/index.d.ts +10 -7
- package/dist/typed-table/index.js +19 -7
- package/dist/typed-table/index.js.map +1 -1
- package/dist/{types-CLP5H4Wk.d.cts → types-9Q5SHRDJ.d.cts} +2 -2
- package/dist/{types-DmPkWQic.d.ts → types-CfYy-vdV.d.ts} +2 -2
- package/dist/{types-C2uspRtf.d.cts → types-Cs2MyE3u.d.cts} +2 -2
- package/dist/{types-Dv61jStB.d.ts → types-DF-dxB_l.d.ts} +2 -2
- package/dist/types-DTEGaxso.d.cts +139 -0
- package/dist/types-Dji5SpFS.d.ts +139 -0
- package/dist/use-cases/index.d.cts +5 -5
- package/dist/use-cases/index.d.ts +5 -5
- package/dist/{validate-CWVToe1T.d.ts → validate-BydKd-Le.d.ts} +1 -1
- package/dist/{validate-DEB_mn4Y.d.cts → validate-CqJakTKk.d.cts} +1 -1
- package/dist/versions/index.cjs +375 -0
- package/dist/versions/index.cjs.map +1 -0
- package/dist/versions/index.d.cts +160 -0
- package/dist/versions/index.d.ts +160 -0
- package/dist/versions/index.js +353 -0
- package/dist/versions/index.js.map +1 -0
- package/package.json +62 -2
package/dist/data/index.cjs
CHANGED
|
@@ -334,9 +334,18 @@ function stableFilterKey(filter) {
|
|
|
334
334
|
return `{${parts.join(",")}}`;
|
|
335
335
|
}
|
|
336
336
|
function liftWithheld(rows) {
|
|
337
|
+
let shared;
|
|
338
|
+
for (const row of rows) {
|
|
339
|
+
const m = (row.measures ?? {})["_withheld"];
|
|
340
|
+
if (m !== void 0 && m !== null && typeof m === "object") {
|
|
341
|
+
shared = m;
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
337
345
|
return rows.map((row) => {
|
|
338
346
|
const measures = row.measures ?? {};
|
|
339
|
-
const
|
|
347
|
+
const own = measures["_withheld"];
|
|
348
|
+
const marker = own !== void 0 && own !== null && typeof own === "object" ? own : shared;
|
|
340
349
|
const rowCount = row.row_count ?? 0;
|
|
341
350
|
if (marker === void 0 || marker === null || typeof marker !== "object") {
|
|
342
351
|
return rowCount === row.row_count ? row : { ...row, row_count: rowCount };
|
|
@@ -3278,12 +3287,15 @@ function createRecordsClient(given) {
|
|
|
3278
3287
|
() => true
|
|
3279
3288
|
);
|
|
3280
3289
|
}
|
|
3281
|
-
const door = await
|
|
3282
|
-
DOORS.readRecord,
|
|
3283
|
-
|
|
3284
|
-
"recordRead"
|
|
3285
|
-
|
|
3290
|
+
const [door, header] = await Promise.all([
|
|
3291
|
+
callDoor(DOORS.readRecord, { p_organization_id: org, p_record_id: record_id }, "recordRead"),
|
|
3292
|
+
// A version that cannot be read never takes the record away: it comes back as null.
|
|
3293
|
+
callDoor(DOORS.recordHeaders, { p_organization_id: org, p_ids: [record_id] }, "recordRead.version").catch(
|
|
3294
|
+
() => null
|
|
3295
|
+
)
|
|
3296
|
+
]);
|
|
3286
3297
|
if (!door.ok) return err(door.error);
|
|
3298
|
+
const version = header && header.ok ? header.data?.find((h) => h.id === record_id)?.version ?? null : null;
|
|
3287
3299
|
const { document, hidden } = unfold(door.data);
|
|
3288
3300
|
let computed = [];
|
|
3289
3301
|
let computedUnavailable = null;
|
|
@@ -3296,7 +3308,7 @@ function createRecordsClient(given) {
|
|
|
3296
3308
|
if (provenance.ok) computed = provenance.data ?? [];
|
|
3297
3309
|
else computedUnavailable = provenance.error;
|
|
3298
3310
|
}
|
|
3299
|
-
return ok({ record_id, document, hidden, computed, computedUnavailable });
|
|
3311
|
+
return ok({ record_id, document, hidden, computed, computedUnavailable, version });
|
|
3300
3312
|
},
|
|
3301
3313
|
async listByIds({ table_id, ids }) {
|
|
3302
3314
|
if (ids.length === 0) return ok([]);
|