@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.
@@ -419,6 +419,13 @@ function announceRecordChanged(recordId) {
419
419
  }
420
420
  }
421
421
  }
422
+ var removed = /* @__PURE__ */ new Set();
423
+ function markRecordRemoved(recordId) {
424
+ removed.add(recordId);
425
+ }
426
+ function markRecordRestored(recordId) {
427
+ removed.delete(recordId);
428
+ }
422
429
  function onRecordChanged(listener) {
423
430
  listeners.add(listener);
424
431
  return () => listeners.delete(listener);
@@ -3224,7 +3231,10 @@ function createRecordsClient(given) {
3224
3231
  { p_organization_id: org, p_record_id: record_id },
3225
3232
  "recordDelete"
3226
3233
  );
3227
- if (result.ok) announceRecordChanged(record_id);
3234
+ if (result.ok) {
3235
+ markRecordRemoved(record_id);
3236
+ announceRecordChanged(record_id);
3237
+ }
3228
3238
  return result;
3229
3239
  },
3230
3240
  async recordRestore({ record_id }) {
@@ -3233,7 +3243,10 @@ function createRecordsClient(given) {
3233
3243
  { p_organization_id: org, p_record_id: record_id },
3234
3244
  "recordRestore"
3235
3245
  );
3236
- if (result.ok) announceRecordChanged(record_id);
3246
+ if (result.ok) {
3247
+ markRecordRestored(record_id);
3248
+ announceRecordChanged(record_id);
3249
+ }
3237
3250
  return result;
3238
3251
  },
3239
3252
  async tableArchive({ table_id, chunk, includeTable }) {