@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.
@@ -283,6 +283,13 @@ function announceRecordChanged(recordId) {
283
283
  }
284
284
  }
285
285
  }
286
+ var removed = /* @__PURE__ */ new Set();
287
+ function markRecordRemoved(recordId) {
288
+ removed.add(recordId);
289
+ }
290
+ function markRecordRestored(recordId) {
291
+ removed.delete(recordId);
292
+ }
286
293
  function onRecordChanged(listener) {
287
294
  listeners.add(listener);
288
295
  return () => listeners.delete(listener);
@@ -3112,7 +3119,10 @@ function createRecordsClient(given) {
3112
3119
  { p_organization_id: org, p_record_id: record_id },
3113
3120
  "recordDelete"
3114
3121
  );
3115
- if (result.ok) announceRecordChanged(record_id);
3122
+ if (result.ok) {
3123
+ markRecordRemoved(record_id);
3124
+ announceRecordChanged(record_id);
3125
+ }
3116
3126
  return result;
3117
3127
  },
3118
3128
  async recordRestore({ record_id }) {
@@ -3121,7 +3131,10 @@ function createRecordsClient(given) {
3121
3131
  { p_organization_id: org, p_record_id: record_id },
3122
3132
  "recordRestore"
3123
3133
  );
3124
- if (result.ok) announceRecordChanged(record_id);
3134
+ if (result.ok) {
3135
+ markRecordRestored(record_id);
3136
+ announceRecordChanged(record_id);
3137
+ }
3125
3138
  return result;
3126
3139
  },
3127
3140
  async tableArchive({ table_id, chunk, includeTable }) {