@ai-matrx/records 0.93.6 → 0.94.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 +14 -0
- package/dist/data/index.cjs +17 -0
- 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 +17 -0
- package/dist/data/index.js.map +1 -1
- package/dist/data/react.cjs +16 -3
- package/dist/data/react.cjs.map +1 -1
- package/dist/data/react.d.cts +10 -0
- package/dist/data/react.d.ts +10 -0
- package/dist/data/react.js +16 -3
- package/dist/data/react.js.map +1 -1
- package/dist/entity/index.cjs +1 -1
- package/dist/entity/index.cjs.map +1 -1
- package/dist/entity/index.d.cts +3 -3
- package/dist/entity/index.d.ts +3 -3
- package/dist/entity/index.js +1 -1
- package/dist/entity/index.js.map +1 -1
- package/dist/entity/react.cjs +1 -1
- package/dist/entity/react.cjs.map +1 -1
- package/dist/entity/react.d.cts +10 -0
- package/dist/entity/react.d.ts +10 -0
- package/dist/entity/react.js +1 -1
- package/dist/entity/react.js.map +1 -1
- package/dist/first-page/index.d.cts +6 -0
- package/dist/first-page/index.d.ts +6 -0
- package/dist/{port-DyZ0GfxE.d.ts → port-BNXXJINy.d.ts} +1 -1
- package/dist/{port-B3UeC536.d.cts → port-CEf9hsW4.d.cts} +1 -1
- package/dist/react/index.cjs +17 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +17 -0
- package/dist/react/index.js.map +1 -1
- package/dist/setup/index.cjs +1 -1
- package/dist/setup/index.cjs.map +1 -1
- package/dist/setup/index.d.cts +2 -2
- package/dist/setup/index.d.ts +2 -2
- package/dist/setup/index.js +1 -1
- package/dist/setup/index.js.map +1 -1
- package/dist/{types-DB4J-zIt.d.ts → types-Du4Q9Rvi.d.ts} +10 -0
- package/dist/{types-Bg1q6qwq.d.cts → types-Dxc8Pt7Y.d.cts} +10 -0
- package/package.json +4 -4
package/dist/react/index.js
CHANGED
|
@@ -10705,6 +10705,7 @@ var CUSTOM_ROW_TOKEN = "record";
|
|
|
10705
10705
|
// src/data/table-port.ts
|
|
10706
10706
|
var DATA_PAGE_CEILING = 500;
|
|
10707
10707
|
var DATA_PAGE_DEFAULT = 50;
|
|
10708
|
+
var ARCHIVED_CURSOR = "archived:";
|
|
10708
10709
|
function refuse2(code, message, hint) {
|
|
10709
10710
|
return { ok: false, error: { code, message, ...hint ? { hint } : {} } };
|
|
10710
10711
|
}
|
|
@@ -10843,6 +10844,21 @@ function createTableDataPort({ client, aliases }) {
|
|
|
10843
10844
|
if (!got.data) return refuse2("not_found", "The change was saved, but this row can no longer be read with your access.", "Ask the table's owner if you should still see it.");
|
|
10844
10845
|
return { ok: true, data: got.data };
|
|
10845
10846
|
}
|
|
10847
|
+
async function listArchived(binding, shape, q, cursor) {
|
|
10848
|
+
const limit = Math.max(1, Math.min(Math.floor(q.pageSize ?? DATA_PAGE_DEFAULT), DATA_PAGE_CEILING));
|
|
10849
|
+
const at = cursor?.startsWith(ARCHIVED_CURSOR) ? Number(cursor.slice(ARCHIVED_CURSOR.length)) : 0;
|
|
10850
|
+
const offset = Number.isInteger(at) && at > 0 ? at : 0;
|
|
10851
|
+
const page2 = await seat(binding).listArchived({ table_id: binding.tableId, lane: "org", limit, offset });
|
|
10852
|
+
if (!page2.ok) return page2;
|
|
10853
|
+
const read = page2.data.rows.map((r) => ({ ...r, version: 0, organization_id: binding.organizationId }));
|
|
10854
|
+
const rows = await toRows(binding, shape, read);
|
|
10855
|
+
page2.data.rows.forEach((r, i) => {
|
|
10856
|
+
rows[i]._archived_at = r.archivedAt;
|
|
10857
|
+
rows[i]._archived_by_name = r.archivedByName;
|
|
10858
|
+
});
|
|
10859
|
+
const cursorOut = page2.data.rows.length < limit ? null : `${ARCHIVED_CURSOR}${offset + page2.data.rows.length}`;
|
|
10860
|
+
return { ok: true, data: { rows, total: page2.data.total, cursor: cursorOut } };
|
|
10861
|
+
}
|
|
10846
10862
|
return {
|
|
10847
10863
|
async sources() {
|
|
10848
10864
|
const out = [];
|
|
@@ -10884,6 +10900,7 @@ function createTableDataPort({ client, aliases }) {
|
|
|
10884
10900
|
}
|
|
10885
10901
|
const shape = await shapeOf(alias, binding);
|
|
10886
10902
|
if (!shape.ok) return shape;
|
|
10903
|
+
if (q.archived === true) return listArchived(binding, shape.data, q, cursor);
|
|
10887
10904
|
const filter = compileWhere(q.where, shape.data);
|
|
10888
10905
|
if (!filter.ok) return filter;
|
|
10889
10906
|
const sort = compileSort(q.sort, shape.data);
|