@ai-matrx/records 0.79.1 → 0.80.1
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 +31 -6
- 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 +31 -6
- package/dist/app-table/index.js.map +1 -1
- package/dist/{client-BcVOYKL1.d.ts → client-BbLzOf08.d.ts} +1 -1
- package/dist/{client-DHoI0qvP.d.cts → client-GhSH0bR7.d.cts} +1 -1
- package/dist/core/index.cjs +41 -6
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +26 -5
- package/dist/core/index.d.ts +26 -5
- package/dist/core/index.js +41 -6
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +31 -6
- 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 +31 -6
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-DM9mPkSc.d.cts → declareTable-Bb0eUtPF.d.cts} +2 -2
- package/dist/{declareTable-CDKHwyrF.d.ts → declareTable-D6mB7Va8.d.ts} +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 +31 -6
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +6 -2
- package/dist/react/index.d.ts +6 -2
- package/dist/react/index.js +31 -6
- package/dist/react/index.js.map +1 -1
- package/dist/{table-kind-wYO_qjK1.d.cts → table-kind-DptSVo_4.d.cts} +6 -2
- package/dist/{table-kind-Ct-nhoCZ.d.ts → table-kind-lHVdMZGy.d.ts} +6 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as NewFieldSpec } from '../declareTable-
|
|
1
|
+
import { N as NewFieldSpec } from '../declareTable-Bb0eUtPF.cjs';
|
|
2
2
|
import { U as Uuid, h as RecordsResult, n as RecordPageSort } from '../record-DCaOJbhA.cjs';
|
|
3
|
-
import { R as RecordsClient } from '../client-
|
|
4
|
-
import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-
|
|
3
|
+
import { R as RecordsClient } from '../client-GhSH0bR7.cjs';
|
|
4
|
+
import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-DptSVo_4.cjs';
|
|
5
5
|
import '../field-DCXU6k9i.cjs';
|
|
6
6
|
import '../subscription-C_hNjbaR.cjs';
|
|
7
7
|
import '../ports-DaHUjVg7.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as NewFieldSpec } from '../declareTable-
|
|
1
|
+
import { N as NewFieldSpec } from '../declareTable-D6mB7Va8.js';
|
|
2
2
|
import { U as Uuid, h as RecordsResult, n as RecordPageSort } from '../record-DCaOJbhA.js';
|
|
3
|
-
import { R as RecordsClient } from '../client-
|
|
4
|
-
import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-
|
|
3
|
+
import { R as RecordsClient } from '../client-BbLzOf08.js';
|
|
4
|
+
import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-lHVdMZGy.js';
|
|
5
5
|
import '../field-DJAvDExi.js';
|
|
6
6
|
import '../subscription-B9znK2dw.js';
|
|
7
7
|
import '../ports-Kpc-RihV.js';
|
package/dist/app-table/index.js
CHANGED
|
@@ -359,6 +359,24 @@ function sha256Hex(text2) {
|
|
|
359
359
|
return Array.from(h, (x) => x.toString(16).padStart(8, "0")).join("");
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
+
// src/core/primedBundle.ts
|
|
363
|
+
var PRIMED_TTL_MS = 15e3;
|
|
364
|
+
var REGISTRY = /* @__PURE__ */ Symbol.for("@ai-matrx/records/primed-table-page-bundles");
|
|
365
|
+
function registry() {
|
|
366
|
+
const g = globalThis;
|
|
367
|
+
return g[REGISTRY] ??= /* @__PURE__ */ new Map();
|
|
368
|
+
}
|
|
369
|
+
var primedKey = (organizationId, tableId, viewId) => `${organizationId}|${tableId}|${viewId ?? ""}`;
|
|
370
|
+
function takePrimedTablePageBundle(organizationId, tableId, viewId) {
|
|
371
|
+
if (!organizationId) return null;
|
|
372
|
+
const key = primedKey(organizationId, tableId, viewId);
|
|
373
|
+
const primed = registry();
|
|
374
|
+
const held = primed.get(key);
|
|
375
|
+
if (!held) return null;
|
|
376
|
+
primed.delete(key);
|
|
377
|
+
return Date.now() - held.at < PRIMED_TTL_MS ? held.answer : null;
|
|
378
|
+
}
|
|
379
|
+
|
|
362
380
|
// src/archive.ts
|
|
363
381
|
var DEFAULT_ARCHIVE_LANE = "org";
|
|
364
382
|
|
|
@@ -2700,13 +2718,20 @@ function createRecordsClient(given) {
|
|
|
2700
2718
|
}
|
|
2701
2719
|
async function fillBundle(tableId, viewId) {
|
|
2702
2720
|
try {
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
)
|
|
2721
|
+
const view = typeof viewId === "string" ? viewId : null;
|
|
2722
|
+
const usable = (r) => r !== null && !r.error && r.data !== null && typeof r.data === "object" && Array.isArray(r.data.parts);
|
|
2723
|
+
const primedAnswer = takePrimedTablePageBundle(org, tableId, view);
|
|
2724
|
+
let response = primedAnswer ? await primedAnswer : null;
|
|
2725
|
+
if (!usable(response)) {
|
|
2726
|
+
response = await config.dataSource.rpc(
|
|
2727
|
+
"table_page_bundle",
|
|
2728
|
+
{ p_organization_id: org, p_table_id: tableId, p_view_id: view },
|
|
2729
|
+
{ schema }
|
|
2730
|
+
);
|
|
2731
|
+
}
|
|
2732
|
+
if (!usable(response)) return;
|
|
2708
2733
|
const answer = response.data;
|
|
2709
|
-
if (
|
|
2734
|
+
if (!answer || !Array.isArray(answer.parts)) return;
|
|
2710
2735
|
const now = Date.now();
|
|
2711
2736
|
for (const part of answer.parts) {
|
|
2712
2737
|
if (part.error !== void 0 || part.data === void 0) continue;
|