@ai-matrx/records 0.86.2 → 0.87.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 +30 -0
- package/dist/core/index.cjs +6 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +6 -4
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +19 -6
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +13 -0
- package/dist/data/index.d.ts +13 -0
- package/dist/data/index.js +19 -6
- package/dist/data/index.js.map +1 -1
- package/dist/data/react.d.cts +13 -0
- package/dist/data/react.d.ts +13 -0
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -34
- package/dist/index.d.ts +0 -34
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/list/index.cjs.map +1 -1
- package/dist/list/index.d.cts +5 -9
- package/dist/list/index.d.ts +5 -9
- package/dist/list/index.js.map +1 -1
- package/dist/react/index.cjs +20 -7
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -36
- package/dist/react/index.d.ts +2 -36
- package/dist/react/index.js +20 -7
- package/dist/react/index.js.map +1 -1
- package/dist/realtime/index.cjs +2 -1
- package/dist/realtime/index.cjs.map +1 -1
- package/dist/realtime/index.js +2 -1
- package/dist/realtime/index.js.map +1 -1
- package/dist/typed-table/index.cjs +7 -5
- package/dist/typed-table/index.cjs.map +1 -1
- package/dist/typed-table/index.d.cts +2 -2
- package/dist/typed-table/index.d.ts +2 -2
- package/dist/typed-table/index.js +7 -5
- package/dist/typed-table/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -139,9 +139,9 @@ declare const f: {
|
|
|
139
139
|
member: <const O extends FieldOptions = {}>(opts?: O) => AppField<string, Req<O>, false, Uniq<O>>;
|
|
140
140
|
/** A file. */
|
|
141
141
|
attachment: <const O extends FieldOptions = {}>(opts?: O) => AppField<string, Req<O>, false, Uniq<O>>;
|
|
142
|
-
/** A platform thing (`note`, `agent` …) of one of `kinds
|
|
142
|
+
/** A platform thing (`note`, `agent` …) of one of `kinds`: `{ token, id }`, the store's own shape. */
|
|
143
143
|
entityReference: <const O extends FieldOptions = {}>(kinds: readonly string[], opts?: O) => AppField<{
|
|
144
|
-
|
|
144
|
+
token: string;
|
|
145
145
|
id: Uuid;
|
|
146
146
|
}, Req<O>, false, Uniq<O>>;
|
|
147
147
|
/** Computed by the store from `formulaText` (`{Visit fee} - {Deposit taken}`); read-only. */
|
|
@@ -139,9 +139,9 @@ declare const f: {
|
|
|
139
139
|
member: <const O extends FieldOptions = {}>(opts?: O) => AppField<string, Req<O>, false, Uniq<O>>;
|
|
140
140
|
/** A file. */
|
|
141
141
|
attachment: <const O extends FieldOptions = {}>(opts?: O) => AppField<string, Req<O>, false, Uniq<O>>;
|
|
142
|
-
/** A platform thing (`note`, `agent` …) of one of `kinds
|
|
142
|
+
/** A platform thing (`note`, `agent` …) of one of `kinds`: `{ token, id }`, the store's own shape. */
|
|
143
143
|
entityReference: <const O extends FieldOptions = {}>(kinds: readonly string[], opts?: O) => AppField<{
|
|
144
|
-
|
|
144
|
+
token: string;
|
|
145
145
|
id: Uuid;
|
|
146
146
|
}, Req<O>, false, Uniq<O>>;
|
|
147
147
|
/** Computed by the store from `formulaText` (`{Visit fee} - {Deposit taken}`); read-only. */
|
|
@@ -149,7 +149,7 @@ var f = {
|
|
|
149
149
|
member: (opts) => field("member", opts),
|
|
150
150
|
/** A file. */
|
|
151
151
|
attachment: (opts) => field("attachment", opts),
|
|
152
|
-
/** A platform thing (`note`, `agent` …) of one of `kinds
|
|
152
|
+
/** A platform thing (`note`, `agent` …) of one of `kinds`: `{ token, id }`, the store's own shape. */
|
|
153
153
|
entityReference: (kinds, opts) => field("entity_reference", opts, { allowedTypes: [...kinds] }),
|
|
154
154
|
/** Computed by the store from `formulaText` (`{Visit fee} - {Deposit taken}`); read-only. */
|
|
155
155
|
formula: (formulaText, opts) => field("formula", opts, { declaration: { formula_text: formulaText, ...opts?.declaration ?? {} } }, true),
|
|
@@ -429,7 +429,8 @@ function isWritingDoor(door) {
|
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
// src/core/recordChanges.ts
|
|
432
|
-
|
|
432
|
+
import { globalSlot } from "@ai-matrx/kit/global-slot";
|
|
433
|
+
var listeners = globalSlot("ai-matrx.records.record-change-listeners", () => /* @__PURE__ */ new Set());
|
|
433
434
|
function announceRecordChanged(recordId) {
|
|
434
435
|
for (const listener of [...listeners]) {
|
|
435
436
|
try {
|
|
@@ -439,7 +440,7 @@ function announceRecordChanged(recordId) {
|
|
|
439
440
|
}
|
|
440
441
|
}
|
|
441
442
|
}
|
|
442
|
-
var removed = /* @__PURE__ */ new Set();
|
|
443
|
+
var removed = globalSlot("ai-matrx.records.removed-records", () => /* @__PURE__ */ new Set());
|
|
443
444
|
function markRecordRemoved(recordId) {
|
|
444
445
|
removed.add(recordId);
|
|
445
446
|
}
|
|
@@ -450,7 +451,7 @@ function onRecordChanged(listener) {
|
|
|
450
451
|
listeners.add(listener);
|
|
451
452
|
return () => listeners.delete(listener);
|
|
452
453
|
}
|
|
453
|
-
var tableListeners = /* @__PURE__ */ new Set();
|
|
454
|
+
var tableListeners = globalSlot("ai-matrx.records.table-structure-listeners", () => /* @__PURE__ */ new Set());
|
|
454
455
|
function announceTableStructureChanged(tableId) {
|
|
455
456
|
for (const listener of [...tableListeners]) {
|
|
456
457
|
try {
|
|
@@ -740,9 +741,10 @@ function sourceArchivedOf(value) {
|
|
|
740
741
|
}
|
|
741
742
|
|
|
742
743
|
// src/ops.ts
|
|
744
|
+
import { globalSlot as globalSlot2 } from "@ai-matrx/kit/global-slot";
|
|
743
745
|
var REMEMBER_MS = 3e4;
|
|
744
746
|
var REMEMBER_MAX = 500;
|
|
745
|
-
var ours = /* @__PURE__ */ new Map();
|
|
747
|
+
var ours = globalSlot2("ai-matrx.records.op-ledger", () => /* @__PURE__ */ new Map());
|
|
746
748
|
function trim(now) {
|
|
747
749
|
for (const [id, at] of ours) {
|
|
748
750
|
if (now - at <= REMEMBER_MS) break;
|