@ai-matrx/records 0.84.4 → 0.84.5
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 +8 -0
- package/dist/app-table/index.cjs +15 -2
- package/dist/app-table/index.cjs.map +1 -1
- package/dist/app-table/index.js +15 -2
- package/dist/app-table/index.js.map +1 -1
- package/dist/core/index.cjs +23 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +7 -1
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.js +23 -4
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +15 -2
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +15 -2
- package/dist/data/index.js.map +1 -1
- package/dist/react/index.cjs +20 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +20 -4
- package/dist/react/index.js.map +1 -1
- package/package.json +3 -3
package/dist/core/index.d.cts
CHANGED
|
@@ -337,6 +337,12 @@ declare function doorCensus(): {
|
|
|
337
337
|
type Listener = (recordId: string) => void;
|
|
338
338
|
/** Called by the client after a write door answered yes. */
|
|
339
339
|
declare function announceRecordChanged(recordId: string): void;
|
|
340
|
+
/** Called by the client after `record_delete` answered yes (before it announces the change). */
|
|
341
|
+
declare function markRecordRemoved(recordId: string): void;
|
|
342
|
+
/** Called by the client after `record_restore` answered yes (before it announces the change). */
|
|
343
|
+
declare function markRecordRestored(recordId: string): void;
|
|
344
|
+
/** Whether this page archived the record and has not brought it back. */
|
|
345
|
+
declare function isRecordRemoved(recordId: string): boolean;
|
|
340
346
|
/** Hear every record this page writes. Returns the unsubscribe. */
|
|
341
347
|
declare function onRecordChanged(listener: Listener): () => void;
|
|
342
348
|
type TableListener = (tableId: string | null) => void;
|
|
@@ -722,4 +728,4 @@ declare function seededDataSource(index: Map<string, unknown>): {
|
|
|
722
728
|
missed: () => boolean;
|
|
723
729
|
};
|
|
724
730
|
|
|
725
|
-
export { type BlockOutcome, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_VALUE_MAX_BYTES, DOORS, type DoorKey, type ExportRow, Field, LANDING_SOURCE_TYPE, LANDING_TARGET_TYPES, type Landing, type LandingBlock, type LandingOutcomes, type LandingState, type LandingStore, MAPPED_SQLSTATES, type MirrorLimits, OUTPUT_KEPT_KEY, PRIMED_DOOR_TTL_MS, PRODUCED_BY_LABEL, type ParsedImport, PgError, PredictedRefusal, type PrimedBundleAnswer, type ReadFileText, ReadValue, RecordDocument, RecordsDataSource, RecordsError, RecordsResult, type RecordsSeed, type RecordsSeedAnswer, StaleWriteDetail, type SupabaseLike, TableKindFacts, Uuid, WHOLE_VALUE_SOURCE_KIND, type WholeValuePointer, announceRecordChanged, announceTableStructureChanged, asRecordsDataSource, blockLandedInStore, cellText, doorAbsent, doorCensus, doorExists, doorReady, dropPrimedDoorAnswers, exportCellText, exportCsv, exportXlsx, forgetPrimedTablePageBundles, importCsv, importXlsx, landingOutcomesFor, mapPgError, onRecordChanged, onTableStructureChanged, outcomeForBlock, outputIsKept, parseCsv, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, primeDoorAnswer, primeRecordPageBundle, primeTablePageBundle, recordingDataSource, seedIndex, seedKey, seededDataSource, staleWriteDetail, supabaseDataSource, tableKindFacts, takePrimedTablePageBundle, toAoa, valuesAreUnconfirmed, wholeValueNotRead, wholeValueOf, wholeValueOfRead, wholeValueSize, withWholeValues };
|
|
731
|
+
export { type BlockOutcome, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_VALUE_MAX_BYTES, DOORS, type DoorKey, type ExportRow, Field, LANDING_SOURCE_TYPE, LANDING_TARGET_TYPES, type Landing, type LandingBlock, type LandingOutcomes, type LandingState, type LandingStore, MAPPED_SQLSTATES, type MirrorLimits, OUTPUT_KEPT_KEY, PRIMED_DOOR_TTL_MS, PRODUCED_BY_LABEL, type ParsedImport, PgError, PredictedRefusal, type PrimedBundleAnswer, type ReadFileText, ReadValue, RecordDocument, RecordsDataSource, RecordsError, RecordsResult, type RecordsSeed, type RecordsSeedAnswer, StaleWriteDetail, type SupabaseLike, TableKindFacts, Uuid, WHOLE_VALUE_SOURCE_KIND, type WholeValuePointer, announceRecordChanged, announceTableStructureChanged, asRecordsDataSource, blockLandedInStore, cellText, doorAbsent, doorCensus, doorExists, doorReady, dropPrimedDoorAnswers, exportCellText, exportCsv, exportXlsx, forgetPrimedTablePageBundles, importCsv, importXlsx, isRecordRemoved, landingOutcomesFor, mapPgError, markRecordRemoved, markRecordRestored, onRecordChanged, onTableStructureChanged, outcomeForBlock, outputIsKept, parseCsv, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, primeDoorAnswer, primeRecordPageBundle, primeTablePageBundle, recordingDataSource, seedIndex, seedKey, seededDataSource, staleWriteDetail, supabaseDataSource, tableKindFacts, takePrimedTablePageBundle, toAoa, valuesAreUnconfirmed, wholeValueNotRead, wholeValueOf, wholeValueOfRead, wholeValueSize, withWholeValues };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -337,6 +337,12 @@ declare function doorCensus(): {
|
|
|
337
337
|
type Listener = (recordId: string) => void;
|
|
338
338
|
/** Called by the client after a write door answered yes. */
|
|
339
339
|
declare function announceRecordChanged(recordId: string): void;
|
|
340
|
+
/** Called by the client after `record_delete` answered yes (before it announces the change). */
|
|
341
|
+
declare function markRecordRemoved(recordId: string): void;
|
|
342
|
+
/** Called by the client after `record_restore` answered yes (before it announces the change). */
|
|
343
|
+
declare function markRecordRestored(recordId: string): void;
|
|
344
|
+
/** Whether this page archived the record and has not brought it back. */
|
|
345
|
+
declare function isRecordRemoved(recordId: string): boolean;
|
|
340
346
|
/** Hear every record this page writes. Returns the unsubscribe. */
|
|
341
347
|
declare function onRecordChanged(listener: Listener): () => void;
|
|
342
348
|
type TableListener = (tableId: string | null) => void;
|
|
@@ -722,4 +728,4 @@ declare function seededDataSource(index: Map<string, unknown>): {
|
|
|
722
728
|
missed: () => boolean;
|
|
723
729
|
};
|
|
724
730
|
|
|
725
|
-
export { type BlockOutcome, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_VALUE_MAX_BYTES, DOORS, type DoorKey, type ExportRow, Field, LANDING_SOURCE_TYPE, LANDING_TARGET_TYPES, type Landing, type LandingBlock, type LandingOutcomes, type LandingState, type LandingStore, MAPPED_SQLSTATES, type MirrorLimits, OUTPUT_KEPT_KEY, PRIMED_DOOR_TTL_MS, PRODUCED_BY_LABEL, type ParsedImport, PgError, PredictedRefusal, type PrimedBundleAnswer, type ReadFileText, ReadValue, RecordDocument, RecordsDataSource, RecordsError, RecordsResult, type RecordsSeed, type RecordsSeedAnswer, StaleWriteDetail, type SupabaseLike, TableKindFacts, Uuid, WHOLE_VALUE_SOURCE_KIND, type WholeValuePointer, announceRecordChanged, announceTableStructureChanged, asRecordsDataSource, blockLandedInStore, cellText, doorAbsent, doorCensus, doorExists, doorReady, dropPrimedDoorAnswers, exportCellText, exportCsv, exportXlsx, forgetPrimedTablePageBundles, importCsv, importXlsx, landingOutcomesFor, mapPgError, onRecordChanged, onTableStructureChanged, outcomeForBlock, outputIsKept, parseCsv, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, primeDoorAnswer, primeRecordPageBundle, primeTablePageBundle, recordingDataSource, seedIndex, seedKey, seededDataSource, staleWriteDetail, supabaseDataSource, tableKindFacts, takePrimedTablePageBundle, toAoa, valuesAreUnconfirmed, wholeValueNotRead, wholeValueOf, wholeValueOfRead, wholeValueSize, withWholeValues };
|
|
731
|
+
export { type BlockOutcome, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_VALUE_MAX_BYTES, DOORS, type DoorKey, type ExportRow, Field, LANDING_SOURCE_TYPE, LANDING_TARGET_TYPES, type Landing, type LandingBlock, type LandingOutcomes, type LandingState, type LandingStore, MAPPED_SQLSTATES, type MirrorLimits, OUTPUT_KEPT_KEY, PRIMED_DOOR_TTL_MS, PRODUCED_BY_LABEL, type ParsedImport, PgError, PredictedRefusal, type PrimedBundleAnswer, type ReadFileText, ReadValue, RecordDocument, RecordsDataSource, RecordsError, RecordsResult, type RecordsSeed, type RecordsSeedAnswer, StaleWriteDetail, type SupabaseLike, TableKindFacts, Uuid, WHOLE_VALUE_SOURCE_KIND, type WholeValuePointer, announceRecordChanged, announceTableStructureChanged, asRecordsDataSource, blockLandedInStore, cellText, doorAbsent, doorCensus, doorExists, doorReady, dropPrimedDoorAnswers, exportCellText, exportCsv, exportXlsx, forgetPrimedTablePageBundles, importCsv, importXlsx, isRecordRemoved, landingOutcomesFor, mapPgError, markRecordRemoved, markRecordRestored, onRecordChanged, onTableStructureChanged, outcomeForBlock, outputIsKept, parseCsv, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, primeDoorAnswer, primeRecordPageBundle, primeTablePageBundle, recordingDataSource, seedIndex, seedKey, seededDataSource, staleWriteDetail, supabaseDataSource, tableKindFacts, takePrimedTablePageBundle, toAoa, valuesAreUnconfirmed, wholeValueNotRead, wholeValueOf, wholeValueOfRead, wholeValueSize, withWholeValues };
|
package/dist/core/index.js
CHANGED
|
@@ -4922,6 +4922,16 @@ function announceRecordChanged(recordId) {
|
|
|
4922
4922
|
}
|
|
4923
4923
|
}
|
|
4924
4924
|
}
|
|
4925
|
+
var removed = /* @__PURE__ */ new Set();
|
|
4926
|
+
function markRecordRemoved(recordId) {
|
|
4927
|
+
removed.add(recordId);
|
|
4928
|
+
}
|
|
4929
|
+
function markRecordRestored(recordId) {
|
|
4930
|
+
removed.delete(recordId);
|
|
4931
|
+
}
|
|
4932
|
+
function isRecordRemoved(recordId) {
|
|
4933
|
+
return removed.has(recordId);
|
|
4934
|
+
}
|
|
4925
4935
|
function onRecordChanged(listener) {
|
|
4926
4936
|
listeners.add(listener);
|
|
4927
4937
|
return () => listeners.delete(listener);
|
|
@@ -6326,7 +6336,10 @@ function createRecordsClient(given) {
|
|
|
6326
6336
|
{ p_organization_id: org, p_record_id: record_id },
|
|
6327
6337
|
"recordDelete"
|
|
6328
6338
|
);
|
|
6329
|
-
if (result.ok)
|
|
6339
|
+
if (result.ok) {
|
|
6340
|
+
markRecordRemoved(record_id);
|
|
6341
|
+
announceRecordChanged(record_id);
|
|
6342
|
+
}
|
|
6330
6343
|
return result;
|
|
6331
6344
|
},
|
|
6332
6345
|
async recordRestore({ record_id }) {
|
|
@@ -6335,7 +6348,10 @@ function createRecordsClient(given) {
|
|
|
6335
6348
|
{ p_organization_id: org, p_record_id: record_id },
|
|
6336
6349
|
"recordRestore"
|
|
6337
6350
|
);
|
|
6338
|
-
if (result.ok)
|
|
6351
|
+
if (result.ok) {
|
|
6352
|
+
markRecordRestored(record_id);
|
|
6353
|
+
announceRecordChanged(record_id);
|
|
6354
|
+
}
|
|
6339
6355
|
return result;
|
|
6340
6356
|
},
|
|
6341
6357
|
async tableArchive({ table_id, chunk, includeTable }) {
|
|
@@ -9404,8 +9420,8 @@ async function declareTable(client, spec) {
|
|
|
9404
9420
|
return { ok: true, data: table.data, homeId: home.data };
|
|
9405
9421
|
}
|
|
9406
9422
|
async function undo(client, tableId, homeId, name, refusal) {
|
|
9407
|
-
const
|
|
9408
|
-
if (
|
|
9423
|
+
const removed2 = await client.recordDelete({ record_id: tableId });
|
|
9424
|
+
if (removed2.ok) {
|
|
9409
9425
|
await client.recordDelete({ record_id: homeId });
|
|
9410
9426
|
return { ok: false, error: refusal };
|
|
9411
9427
|
}
|
|
@@ -10263,6 +10279,7 @@ export {
|
|
|
10263
10279
|
isPersonStamp,
|
|
10264
10280
|
isPortalAccent,
|
|
10265
10281
|
isPortalArchiveFilter,
|
|
10282
|
+
isRecordRemoved,
|
|
10266
10283
|
isRecordsErr,
|
|
10267
10284
|
isRuleFilter,
|
|
10268
10285
|
isShownTo,
|
|
@@ -10276,6 +10293,8 @@ export {
|
|
|
10276
10293
|
localeDateOrder,
|
|
10277
10294
|
looksLikeAnId,
|
|
10278
10295
|
mapPgError,
|
|
10296
|
+
markRecordRemoved,
|
|
10297
|
+
markRecordRestored,
|
|
10279
10298
|
mayDrag,
|
|
10280
10299
|
measureKey,
|
|
10281
10300
|
memoryStore,
|