@ai-matrx/records 0.99.28 → 0.99.30
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 +18 -0
- package/dist/{client-B7LYr-aE.d.cts → client-B7KEs9hi.d.cts} +10 -0
- package/dist/{client-m4soDpHA.d.ts → client-Dthx26hr.d.ts} +10 -0
- package/dist/core/index.cjs +76 -10
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +76 -10
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +12 -1
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +12 -1
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-D5Zs-SjU.d.ts → declareTable-CvBu5dTJ.d.ts} +1 -1
- package/dist/{declareTable-Bnrzv-Bg.d.cts → declareTable-enQs2N0E.d.cts} +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.js +1 -1
- package/dist/entity/react.js.map +1 -1
- package/dist/first-page/index.d.cts +2 -0
- package/dist/first-page/index.d.ts +2 -0
- package/dist/index.cjs +64 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +64 -9
- package/dist/index.js.map +1 -1
- package/dist/{port-DWHLj_Sa.d.ts → port-Bk7TG0aE.d.ts} +3 -3
- package/dist/{port-BbWB9Pgq.d.cts → port-rqQEGhew.d.cts} +3 -3
- package/dist/questions/index.d.cts +1 -1
- package/dist/questions/index.d.ts +1 -1
- package/dist/react/index.cjs +82 -128
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +37 -2
- package/dist/react/index.d.ts +37 -2
- package/dist/react/index.js +81 -127
- package/dist/react/index.js.map +1 -1
- package/dist/realtime/index.cjs +1 -1
- package/dist/realtime/index.cjs.map +1 -1
- package/dist/realtime/index.d.cts +4 -4
- package/dist/realtime/index.d.ts +4 -4
- package/dist/realtime/index.js +1 -1
- package/dist/realtime/index.js.map +1 -1
- package/dist/setup/index.cjs +15 -4
- package/dist/setup/index.cjs.map +1 -1
- package/dist/setup/index.d.cts +3 -3
- package/dist/setup/index.d.ts +3 -3
- package/dist/setup/index.js +15 -4
- package/dist/setup/index.js.map +1 -1
- package/dist/typed-table/index.cjs +16 -117
- package/dist/typed-table/index.cjs.map +1 -1
- package/dist/typed-table/index.d.cts +3 -4
- package/dist/typed-table/index.d.ts +3 -4
- package/dist/typed-table/index.js +15 -116
- package/dist/typed-table/index.js.map +1 -1
- package/dist/views/index.d.cts +1 -1
- package/dist/views/index.d.ts +1 -1
- package/package.json +7 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as NewFieldSpec } from '../declareTable-
|
|
1
|
+
import { N as NewFieldSpec } from '../declareTable-enQs2N0E.cjs';
|
|
2
2
|
import { U as Uuid, R as RecordsResult, k as RecordPageSort } from '../record-C8q21jjB.cjs';
|
|
3
|
-
import { F as FieldDrift, R as RecordsClient, T as TableArchiveProgress } from '../client-
|
|
3
|
+
import { F as FieldDrift, R as RecordsClient, T as TableArchiveProgress } from '../client-B7KEs9hi.cjs';
|
|
4
4
|
import '../field-ppX29ddi.cjs';
|
|
5
5
|
import '../subscription-Ba8RKtPA.cjs';
|
|
6
6
|
import '../rule-BQwUtKk5.cjs';
|
|
@@ -275,7 +275,6 @@ type InsertOf<D extends AnyTypedTableDef> = Simplify<{
|
|
|
275
275
|
* token, a `key` that is not a unique field, no fields.
|
|
276
276
|
*/
|
|
277
277
|
declare function defineTypedTable<F extends AppFields, K extends UniqueKeys<F> = never>(input: TypedTableInput<F, K>): TypedTableDef<F, K>;
|
|
278
|
-
declare function sha256Hex(text: string): string;
|
|
279
278
|
|
|
280
279
|
interface TypedTableEnsured {
|
|
281
280
|
table: Uuid;
|
|
@@ -514,4 +513,4 @@ declare function updateTableRow<T extends AnyStoreTable>(client: RecordsClient,
|
|
|
514
513
|
/** Archive one row (the store's soft delete; restorable from the archive). */
|
|
515
514
|
declare function archiveTableRow<T extends AnyStoreTable>(client: RecordsClient, table: T, rowId: Uuid): Promise<RecordsResult<string>>;
|
|
516
515
|
|
|
517
|
-
export { APP_ROWS_CEILING, type AnyStoreTable, type AnyTypedTableDef, type AppAutomationSpec, type AppField, type AppFields, type AppRows, type AppUpsertOptions, type ArchiveDeliberatelyArgs, type ConfidentialRequest, type ConfidentialState, type FieldOptions, GRADUATION_BASE_COLUMNS, type GraduatedRelation, type GraduatedRow, type InsertOf, type ListTableRowsOptions, type RowOf, STORE_ROWS_CEILING, type StoreInsertOf, type StoreRowOf, type StoreRowSnapshot, type StoreTable, type StoreTableColumn, type StoreTableRows, type StoreTableSort, type StoreTableWhere, TO_ASSOCIATION, TO_CUSTOM_FIELDS, type TypedTableChecked, type TypedTableConfidential, type TypedTableDef, type TypedTableEnsured, type TypedTableGraduation, type TypedTableInput, type TypedTableOrgOptions, type TypedTableReader, type TypedTableScope, type TypedTableStatus, type UniqueKeys, archiveTableRow, archiveTypedTableDeliberately, checkTypedTable, confidentialGate, confidentialRefusal, confidentialRequest, confidentialState, defineTypedTable, ensureAppAutomations, ensureTypedTable, f, graduatedRow, graduationProblems, listAppRows, listTableRows, readersMatch, removeAppRow, rowFromDocument,
|
|
516
|
+
export { APP_ROWS_CEILING, type AnyStoreTable, type AnyTypedTableDef, type AppAutomationSpec, type AppField, type AppFields, type AppRows, type AppUpsertOptions, type ArchiveDeliberatelyArgs, type ConfidentialRequest, type ConfidentialState, type FieldOptions, GRADUATION_BASE_COLUMNS, type GraduatedRelation, type GraduatedRow, type InsertOf, type ListTableRowsOptions, type RowOf, STORE_ROWS_CEILING, type StoreInsertOf, type StoreRowOf, type StoreRowSnapshot, type StoreTable, type StoreTableColumn, type StoreTableRows, type StoreTableSort, type StoreTableWhere, TO_ASSOCIATION, TO_CUSTOM_FIELDS, type TypedTableChecked, type TypedTableConfidential, type TypedTableDef, type TypedTableEnsured, type TypedTableGraduation, type TypedTableInput, type TypedTableOrgOptions, type TypedTableReader, type TypedTableScope, type TypedTableStatus, type UniqueKeys, archiveTableRow, archiveTypedTableDeliberately, checkTypedTable, confidentialGate, confidentialRefusal, confidentialRequest, confidentialState, defineTypedTable, ensureAppAutomations, ensureTypedTable, f, graduatedRow, graduationProblems, listAppRows, listTableRows, readersMatch, removeAppRow, rowFromDocument, storeTable, updateTableRow, upsertAppRow, writeTableRow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as NewFieldSpec } from '../declareTable-
|
|
1
|
+
import { N as NewFieldSpec } from '../declareTable-CvBu5dTJ.js';
|
|
2
2
|
import { U as Uuid, R as RecordsResult, k as RecordPageSort } from '../record-C8q21jjB.js';
|
|
3
|
-
import { F as FieldDrift, R as RecordsClient, T as TableArchiveProgress } from '../client-
|
|
3
|
+
import { F as FieldDrift, R as RecordsClient, T as TableArchiveProgress } from '../client-Dthx26hr.js';
|
|
4
4
|
import '../field-BHlhq24W.js';
|
|
5
5
|
import '../subscription-eNzL9scc.js';
|
|
6
6
|
import '../rule-cGqclk_0.js';
|
|
@@ -275,7 +275,6 @@ type InsertOf<D extends AnyTypedTableDef> = Simplify<{
|
|
|
275
275
|
* token, a `key` that is not a unique field, no fields.
|
|
276
276
|
*/
|
|
277
277
|
declare function defineTypedTable<F extends AppFields, K extends UniqueKeys<F> = never>(input: TypedTableInput<F, K>): TypedTableDef<F, K>;
|
|
278
|
-
declare function sha256Hex(text: string): string;
|
|
279
278
|
|
|
280
279
|
interface TypedTableEnsured {
|
|
281
280
|
table: Uuid;
|
|
@@ -514,4 +513,4 @@ declare function updateTableRow<T extends AnyStoreTable>(client: RecordsClient,
|
|
|
514
513
|
/** Archive one row (the store's soft delete; restorable from the archive). */
|
|
515
514
|
declare function archiveTableRow<T extends AnyStoreTable>(client: RecordsClient, table: T, rowId: Uuid): Promise<RecordsResult<string>>;
|
|
516
515
|
|
|
517
|
-
export { APP_ROWS_CEILING, type AnyStoreTable, type AnyTypedTableDef, type AppAutomationSpec, type AppField, type AppFields, type AppRows, type AppUpsertOptions, type ArchiveDeliberatelyArgs, type ConfidentialRequest, type ConfidentialState, type FieldOptions, GRADUATION_BASE_COLUMNS, type GraduatedRelation, type GraduatedRow, type InsertOf, type ListTableRowsOptions, type RowOf, STORE_ROWS_CEILING, type StoreInsertOf, type StoreRowOf, type StoreRowSnapshot, type StoreTable, type StoreTableColumn, type StoreTableRows, type StoreTableSort, type StoreTableWhere, TO_ASSOCIATION, TO_CUSTOM_FIELDS, type TypedTableChecked, type TypedTableConfidential, type TypedTableDef, type TypedTableEnsured, type TypedTableGraduation, type TypedTableInput, type TypedTableOrgOptions, type TypedTableReader, type TypedTableScope, type TypedTableStatus, type UniqueKeys, archiveTableRow, archiveTypedTableDeliberately, checkTypedTable, confidentialGate, confidentialRefusal, confidentialRequest, confidentialState, defineTypedTable, ensureAppAutomations, ensureTypedTable, f, graduatedRow, graduationProblems, listAppRows, listTableRows, readersMatch, removeAppRow, rowFromDocument,
|
|
516
|
+
export { APP_ROWS_CEILING, type AnyStoreTable, type AnyTypedTableDef, type AppAutomationSpec, type AppField, type AppFields, type AppRows, type AppUpsertOptions, type ArchiveDeliberatelyArgs, type ConfidentialRequest, type ConfidentialState, type FieldOptions, GRADUATION_BASE_COLUMNS, type GraduatedRelation, type GraduatedRow, type InsertOf, type ListTableRowsOptions, type RowOf, STORE_ROWS_CEILING, type StoreInsertOf, type StoreRowOf, type StoreRowSnapshot, type StoreTable, type StoreTableColumn, type StoreTableRows, type StoreTableSort, type StoreTableWhere, TO_ASSOCIATION, TO_CUSTOM_FIELDS, type TypedTableChecked, type TypedTableConfidential, type TypedTableDef, type TypedTableEnsured, type TypedTableGraduation, type TypedTableInput, type TypedTableOrgOptions, type TypedTableReader, type TypedTableScope, type TypedTableStatus, type UniqueKeys, archiveTableRow, archiveTypedTableDeliberately, checkTypedTable, confidentialGate, confidentialRefusal, confidentialRequest, confidentialState, defineTypedTable, ensureAppAutomations, ensureTypedTable, f, graduatedRow, graduationProblems, listAppRows, listTableRows, readersMatch, removeAppRow, rowFromDocument, storeTable, updateTableRow, upsertAppRow, writeTableRow };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/typed-table/define.ts
|
|
2
|
+
import { sha256Hex } from "@ai-matrx/kit/sha256";
|
|
3
|
+
|
|
1
4
|
// src/typed-table/graduate.ts
|
|
2
5
|
import { isUuidShape } from "@ai-matrx/kit/uuid";
|
|
3
6
|
var TO_CUSTOM_FIELDS = "custom_fields";
|
|
@@ -272,120 +275,6 @@ function defineTypedTable(input) {
|
|
|
272
275
|
} : null
|
|
273
276
|
});
|
|
274
277
|
}
|
|
275
|
-
var K256 = new Uint32Array([
|
|
276
|
-
1116352408,
|
|
277
|
-
1899447441,
|
|
278
|
-
3049323471,
|
|
279
|
-
3921009573,
|
|
280
|
-
961987163,
|
|
281
|
-
1508970993,
|
|
282
|
-
2453635748,
|
|
283
|
-
2870763221,
|
|
284
|
-
3624381080,
|
|
285
|
-
310598401,
|
|
286
|
-
607225278,
|
|
287
|
-
1426881987,
|
|
288
|
-
1925078388,
|
|
289
|
-
2162078206,
|
|
290
|
-
2614888103,
|
|
291
|
-
3248222580,
|
|
292
|
-
3835390401,
|
|
293
|
-
4022224774,
|
|
294
|
-
264347078,
|
|
295
|
-
604807628,
|
|
296
|
-
770255983,
|
|
297
|
-
1249150122,
|
|
298
|
-
1555081692,
|
|
299
|
-
1996064986,
|
|
300
|
-
2554220882,
|
|
301
|
-
2821834349,
|
|
302
|
-
2952996808,
|
|
303
|
-
3210313671,
|
|
304
|
-
3336571891,
|
|
305
|
-
3584528711,
|
|
306
|
-
113926993,
|
|
307
|
-
338241895,
|
|
308
|
-
666307205,
|
|
309
|
-
773529912,
|
|
310
|
-
1294757372,
|
|
311
|
-
1396182291,
|
|
312
|
-
1695183700,
|
|
313
|
-
1986661051,
|
|
314
|
-
2177026350,
|
|
315
|
-
2456956037,
|
|
316
|
-
2730485921,
|
|
317
|
-
2820302411,
|
|
318
|
-
3259730800,
|
|
319
|
-
3345764771,
|
|
320
|
-
3516065817,
|
|
321
|
-
3600352804,
|
|
322
|
-
4094571909,
|
|
323
|
-
275423344,
|
|
324
|
-
430227734,
|
|
325
|
-
506948616,
|
|
326
|
-
659060556,
|
|
327
|
-
883997877,
|
|
328
|
-
958139571,
|
|
329
|
-
1322822218,
|
|
330
|
-
1537002063,
|
|
331
|
-
1747873779,
|
|
332
|
-
1955562222,
|
|
333
|
-
2024104815,
|
|
334
|
-
2227730452,
|
|
335
|
-
2361852424,
|
|
336
|
-
2428436474,
|
|
337
|
-
2756734187,
|
|
338
|
-
3204031479,
|
|
339
|
-
3329325298
|
|
340
|
-
]);
|
|
341
|
-
function sha256Hex(text2) {
|
|
342
|
-
const bytes = new TextEncoder().encode(text2);
|
|
343
|
-
const bitLength = bytes.length * 8;
|
|
344
|
-
const padded = new Uint8Array(bytes.length + 9 + 63 >> 6 << 6);
|
|
345
|
-
padded.set(bytes);
|
|
346
|
-
padded[bytes.length] = 128;
|
|
347
|
-
const view = new DataView(padded.buffer);
|
|
348
|
-
view.setUint32(padded.length - 8, Math.floor(bitLength / 4294967296));
|
|
349
|
-
view.setUint32(padded.length - 4, bitLength >>> 0);
|
|
350
|
-
const h = new Uint32Array([1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]);
|
|
351
|
-
const w = new Uint32Array(64);
|
|
352
|
-
const rotr = (x, n) => x >>> n | x << 32 - n;
|
|
353
|
-
for (let off = 0; off < padded.length; off += 64) {
|
|
354
|
-
for (let i = 0; i < 16; i++) w[i] = view.getUint32(off + i * 4);
|
|
355
|
-
for (let i = 16; i < 64; i++) {
|
|
356
|
-
const a2 = w[i - 15], b2 = w[i - 2];
|
|
357
|
-
const s0 = rotr(a2, 7) ^ rotr(a2, 18) ^ a2 >>> 3;
|
|
358
|
-
const s1 = rotr(b2, 17) ^ rotr(b2, 19) ^ b2 >>> 10;
|
|
359
|
-
w[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;
|
|
360
|
-
}
|
|
361
|
-
let a = h[0], b = h[1], c = h[2], d = h[3], e = h[4], f2 = h[5], g = h[6], hh = h[7];
|
|
362
|
-
for (let i = 0; i < 64; i++) {
|
|
363
|
-
const S1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
|
|
364
|
-
const ch = e & f2 ^ ~e & g;
|
|
365
|
-
const t1 = hh + S1 + ch + K256[i] + w[i] >>> 0;
|
|
366
|
-
const S0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);
|
|
367
|
-
const maj = a & b ^ a & c ^ b & c;
|
|
368
|
-
const t2 = S0 + maj >>> 0;
|
|
369
|
-
hh = g;
|
|
370
|
-
g = f2;
|
|
371
|
-
f2 = e;
|
|
372
|
-
e = d + t1 >>> 0;
|
|
373
|
-
d = c;
|
|
374
|
-
c = b;
|
|
375
|
-
b = a;
|
|
376
|
-
a = t1 + t2 >>> 0;
|
|
377
|
-
}
|
|
378
|
-
h[0] = h[0] + a >>> 0;
|
|
379
|
-
h[1] = h[1] + b >>> 0;
|
|
380
|
-
h[2] = h[2] + c >>> 0;
|
|
381
|
-
h[3] = h[3] + d >>> 0;
|
|
382
|
-
h[4] = h[4] + e >>> 0;
|
|
383
|
-
h[5] = h[5] + f2 >>> 0;
|
|
384
|
-
h[6] = h[6] + g >>> 0;
|
|
385
|
-
h[7] = h[7] + hh >>> 0;
|
|
386
|
-
}
|
|
387
|
-
return Array.from(h, (x) => x.toString(16).padStart(8, "0")).join("");
|
|
388
|
-
}
|
|
389
278
|
|
|
390
279
|
// src/core/primedBundle.ts
|
|
391
280
|
var PRIMED_TTL_MS = 15e3;
|
|
@@ -4167,6 +4056,15 @@ function createRecordsClient(given) {
|
|
|
4167
4056
|
}
|
|
4168
4057
|
return result;
|
|
4169
4058
|
},
|
|
4059
|
+
async recordReparent({ record_id, parent_id }) {
|
|
4060
|
+
const result = await callDoor(
|
|
4061
|
+
DOORS.recordReparent,
|
|
4062
|
+
{ p_organization_id: org, p_record_id: record_id, p_parent_id: parent_id },
|
|
4063
|
+
"recordReparent"
|
|
4064
|
+
);
|
|
4065
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
4066
|
+
return result;
|
|
4067
|
+
},
|
|
4170
4068
|
async recordRestore({ record_id }) {
|
|
4171
4069
|
const result = await callDoor(
|
|
4172
4070
|
DOORS.recordRestore,
|
|
@@ -4714,7 +4612,9 @@ function createRecordsClient(given) {
|
|
|
4714
4612
|
}
|
|
4715
4613
|
const tables = read.map((row) => {
|
|
4716
4614
|
const { document } = unfold(row.document);
|
|
4717
|
-
|
|
4615
|
+
const doc = document;
|
|
4616
|
+
const home = typeof doc.home_id === "string" ? doc.home_id : typeof doc.parent_id === "string" ? doc.parent_id : null;
|
|
4617
|
+
return { ...doc, home_id: home, id: row.id, organization_id: org };
|
|
4718
4618
|
});
|
|
4719
4619
|
tables.sort((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
4720
4620
|
return ok(tables);
|
|
@@ -8103,7 +8003,6 @@ export {
|
|
|
8103
8003
|
readersMatch,
|
|
8104
8004
|
removeAppRow,
|
|
8105
8005
|
rowFromDocument,
|
|
8106
|
-
sha256Hex,
|
|
8107
8006
|
storeTable,
|
|
8108
8007
|
updateTableRow,
|
|
8109
8008
|
upsertAppRow,
|