@ai-matrx/records 0.58.6 → 0.58.7

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.
@@ -2304,6 +2304,8 @@ __export(react_exports, {
2304
2304
  portalTitleTypedBack: () => portalTitleTypedBack,
2305
2305
  publicFormPath: () => publicFormPath,
2306
2306
  recordChangeTrigger: () => recordChangeTrigger,
2307
+ recordSourceKey: () => recordSourceKey,
2308
+ recordSourceTable: () => recordSourceTable,
2307
2309
  rememberedOpCount: () => rememberedOpCount,
2308
2310
  sameDocument: () => sameDocument,
2309
2311
  scopeChip: () => scopeChip,
@@ -2661,10 +2663,18 @@ async function exportPageXlsx(page, labels = {}, sheetLabel = "Records") {
2661
2663
  }
2662
2664
  return XLSX.write(workbook, { type: "array", bookType: "xlsx", compression: true });
2663
2665
  }
2666
+ function recordSourceKey(tableId) {
2667
+ return `record:${tableId}`;
2668
+ }
2669
+ var SOURCE_KEY = /^(record|custom_record):([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
2670
+ function recordSourceTable(key) {
2671
+ const m = key ? SOURCE_KEY.exec(key) : null;
2672
+ return m ? m[2] : null;
2673
+ }
2664
2674
  function recordChangeTrigger(tableId, options = {}) {
2665
2675
  return {
2666
2676
  type: "event",
2667
- entity_type: `custom_record:${tableId}`,
2677
+ entity_type: recordSourceKey(tableId),
2668
2678
  table_id: tableId,
2669
2679
  ...options.actions && options.actions.length > 0 ? { actions: options.actions } : {},
2670
2680
  ...options.changedFields && options.changedFields.length > 0 ? { changed_fields: options.changedFields } : {}