@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/data/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Column, Q as Query, A as AliasBinding, H as HostDataPort } from '../types-
|
|
2
|
-
export { a as AnyAlias, b as CUSTOM_ROW_TOKEN, D as DataEvents, c as DataPort, d as DataPortEventName, e as DataSource, E as EntityAlias, f as EntityRef, L as Lane, P as Page, R as Row, g as RowsEvent, T as TableAlias, V as Values, W as WhereClause, h as WhereOp } from '../types-
|
|
1
|
+
import { C as Column, Q as Query, A as AliasBinding, H as HostDataPort } from '../types-Dxc8Pt7Y.cjs';
|
|
2
|
+
export { a as AnyAlias, b as CUSTOM_ROW_TOKEN, D as DataEvents, c as DataPort, d as DataPortEventName, e as DataSource, E as EntityAlias, f as EntityRef, L as Lane, P as Page, R as Row, g as RowsEvent, T as TableAlias, V as Values, W as WhereClause, h as WhereOp } from '../types-Dxc8Pt7Y.cjs';
|
|
3
3
|
import { R as RecordsClient } from '../client-CEX4WdvX.cjs';
|
|
4
4
|
import { F as Field } from '../field-DjS7iId2.cjs';
|
|
5
5
|
import { U as Uuid, R as RecordsResult, r as RecordPageSort, q as ReadRow } from '../record-zwSBU5PQ.cjs';
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Column, Q as Query, A as AliasBinding, H as HostDataPort } from '../types-
|
|
2
|
-
export { a as AnyAlias, b as CUSTOM_ROW_TOKEN, D as DataEvents, c as DataPort, d as DataPortEventName, e as DataSource, E as EntityAlias, f as EntityRef, L as Lane, P as Page, R as Row, g as RowsEvent, T as TableAlias, V as Values, W as WhereClause, h as WhereOp } from '../types-
|
|
1
|
+
import { C as Column, Q as Query, A as AliasBinding, H as HostDataPort } from '../types-Du4Q9Rvi.js';
|
|
2
|
+
export { a as AnyAlias, b as CUSTOM_ROW_TOKEN, D as DataEvents, c as DataPort, d as DataPortEventName, e as DataSource, E as EntityAlias, f as EntityRef, L as Lane, P as Page, R as Row, g as RowsEvent, T as TableAlias, V as Values, W as WhereClause, h as WhereOp } from '../types-Du4Q9Rvi.js';
|
|
3
3
|
import { R as RecordsClient } from '../client-DQWdJeFM.js';
|
|
4
4
|
import { F as Field } from '../field-D-1OKy5r.js';
|
|
5
5
|
import { U as Uuid, R as RecordsResult, r as RecordPageSort, q as ReadRow } from '../record-zwSBU5PQ.js';
|
package/dist/data/index.js
CHANGED
|
@@ -6295,6 +6295,7 @@ function clientIn(client, organizationId) {
|
|
|
6295
6295
|
import { isUuidShape as isUuidShape4 } from "@ai-matrx/kit/uuid";
|
|
6296
6296
|
var DATA_PAGE_CEILING = 500;
|
|
6297
6297
|
var DATA_PAGE_DEFAULT = 50;
|
|
6298
|
+
var ARCHIVED_CURSOR = "archived:";
|
|
6298
6299
|
function refuse2(code, message, hint) {
|
|
6299
6300
|
return { ok: false, error: { code, message, ...hint ? { hint } : {} } };
|
|
6300
6301
|
}
|
|
@@ -6433,6 +6434,21 @@ function createTableDataPort({ client, aliases }) {
|
|
|
6433
6434
|
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.");
|
|
6434
6435
|
return { ok: true, data: got.data };
|
|
6435
6436
|
}
|
|
6437
|
+
async function listArchived(binding, shape, q, cursor) {
|
|
6438
|
+
const limit = Math.max(1, Math.min(Math.floor(q.pageSize ?? DATA_PAGE_DEFAULT), DATA_PAGE_CEILING));
|
|
6439
|
+
const at = cursor?.startsWith(ARCHIVED_CURSOR) ? Number(cursor.slice(ARCHIVED_CURSOR.length)) : 0;
|
|
6440
|
+
const offset = Number.isInteger(at) && at > 0 ? at : 0;
|
|
6441
|
+
const page2 = await seat(binding).listArchived({ table_id: binding.tableId, lane: "org", limit, offset });
|
|
6442
|
+
if (!page2.ok) return page2;
|
|
6443
|
+
const read = page2.data.rows.map((r) => ({ ...r, version: 0, organization_id: binding.organizationId }));
|
|
6444
|
+
const rows = await toRows(binding, shape, read);
|
|
6445
|
+
page2.data.rows.forEach((r, i) => {
|
|
6446
|
+
rows[i]._archived_at = r.archivedAt;
|
|
6447
|
+
rows[i]._archived_by_name = r.archivedByName;
|
|
6448
|
+
});
|
|
6449
|
+
const cursorOut = page2.data.rows.length < limit ? null : `${ARCHIVED_CURSOR}${offset + page2.data.rows.length}`;
|
|
6450
|
+
return { ok: true, data: { rows, total: page2.data.total, cursor: cursorOut } };
|
|
6451
|
+
}
|
|
6436
6452
|
return {
|
|
6437
6453
|
async sources() {
|
|
6438
6454
|
const out = [];
|
|
@@ -6474,6 +6490,7 @@ function createTableDataPort({ client, aliases }) {
|
|
|
6474
6490
|
}
|
|
6475
6491
|
const shape = await shapeOf(alias, binding);
|
|
6476
6492
|
if (!shape.ok) return shape;
|
|
6493
|
+
if (q.archived === true) return listArchived(binding, shape.data, q, cursor);
|
|
6477
6494
|
const filter = compileWhere(q.where, shape.data);
|
|
6478
6495
|
if (!filter.ok) return filter;
|
|
6479
6496
|
const sort = compileSort(q.sort, shape.data);
|