@ai-matrx/records 0.79.0 → 0.80.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 +13 -0
- package/dist/app-table/index.cjs +26 -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 +26 -6
- package/dist/app-table/index.js.map +1 -1
- package/dist/{client-SM21Erad.d.ts → client-BcVOYKL1.d.ts} +1 -1
- package/dist/{client-BKXt18rw.d.cts → client-DHoI0qvP.d.cts} +1 -1
- package/dist/core/index.cjs +36 -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 +36 -6
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +26 -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 +26 -6
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-CRPC4uku.d.ts → declareTable-CDKHwyrF.d.ts} +2 -2
- package/dist/{declareTable-DVbm7Rck.d.cts → declareTable-DM9mPkSc.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 +26 -6
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +21 -1
- package/dist/react/index.d.ts +21 -1
- package/dist/react/index.js +26 -6
- package/dist/react/index.js.map +1 -1
- package/dist/{table-kind-CJ_K3E1F.d.ts → table-kind-Ct-nhoCZ.d.ts} +21 -1
- package/dist/{table-kind-DoSFfQDe.d.cts → table-kind-wYO_qjK1.d.cts} +21 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as NewFieldSpec } from '../declareTable-
|
|
1
|
+
import { N as NewFieldSpec } from '../declareTable-DM9mPkSc.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-DHoI0qvP.cjs';
|
|
4
|
+
import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-wYO_qjK1.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-CDKHwyrF.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-BcVOYKL1.js';
|
|
4
|
+
import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-Ct-nhoCZ.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,19 @@ 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 primed = /* @__PURE__ */ new Map();
|
|
365
|
+
var primedKey = (organizationId, tableId, viewId) => `${organizationId}|${tableId}|${viewId ?? ""}`;
|
|
366
|
+
function takePrimedTablePageBundle(organizationId, tableId, viewId) {
|
|
367
|
+
if (!organizationId) return null;
|
|
368
|
+
const key = primedKey(organizationId, tableId, viewId);
|
|
369
|
+
const held = primed.get(key);
|
|
370
|
+
if (!held) return null;
|
|
371
|
+
primed.delete(key);
|
|
372
|
+
return Date.now() - held.at < PRIMED_TTL_MS ? held.answer : null;
|
|
373
|
+
}
|
|
374
|
+
|
|
362
375
|
// src/archive.ts
|
|
363
376
|
var DEFAULT_ARCHIVE_LANE = "org";
|
|
364
377
|
|
|
@@ -2700,13 +2713,20 @@ function createRecordsClient(given) {
|
|
|
2700
2713
|
}
|
|
2701
2714
|
async function fillBundle(tableId, viewId) {
|
|
2702
2715
|
try {
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
)
|
|
2716
|
+
const view = typeof viewId === "string" ? viewId : null;
|
|
2717
|
+
const usable = (r) => r !== null && !r.error && r.data !== null && typeof r.data === "object" && Array.isArray(r.data.parts);
|
|
2718
|
+
const primedAnswer = takePrimedTablePageBundle(org, tableId, view);
|
|
2719
|
+
let response = primedAnswer ? await primedAnswer : null;
|
|
2720
|
+
if (!usable(response)) {
|
|
2721
|
+
response = await config.dataSource.rpc(
|
|
2722
|
+
"table_page_bundle",
|
|
2723
|
+
{ p_organization_id: org, p_table_id: tableId, p_view_id: view },
|
|
2724
|
+
{ schema }
|
|
2725
|
+
);
|
|
2726
|
+
}
|
|
2727
|
+
if (!usable(response)) return;
|
|
2708
2728
|
const answer = response.data;
|
|
2709
|
-
if (
|
|
2729
|
+
if (!answer || !Array.isArray(answer.parts)) return;
|
|
2710
2730
|
const now = Date.now();
|
|
2711
2731
|
for (const part of answer.parts) {
|
|
2712
2732
|
if (part.error !== void 0 || part.data === void 0) continue;
|