@ai-matrx/records 0.87.23 → 0.87.24

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.
@@ -1,7 +1,7 @@
1
- import { N as NewFieldSpec } from '../declareTable-DNhNDvh9.cjs';
1
+ import { N as NewFieldSpec } from '../declareTable-BK3zufr7.cjs';
2
2
  import { U as Uuid, i as RecordsResult, o as RecordPageSort } from '../record-DpB2QgAZ.cjs';
3
- import { R as RecordsClient } from '../client-xyH0cLVd.cjs';
4
- import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-1aiKFy1k.cjs';
3
+ import { R as RecordsClient } from '../client-C3ZZNfGH.cjs';
4
+ import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-BZu8mtND.cjs';
5
5
  import '../field-BanTVGK2.cjs';
6
6
  import '../subscription-BD9DnJxX.cjs';
7
7
  import '../ports-D8-iuY1P.cjs';
@@ -368,6 +368,10 @@ interface AppAutomationSpec {
368
368
  author: true;
369
369
  };
370
370
  text: string;
371
+ /** The notice's subject line (in-app and email); defaults to the automation's name. Same `{{key}}` words as `text`. */
372
+ subject?: string;
373
+ /** Where the notice opens: a path (`/hr/performance/{{record_id}}?org={{organization_id}}`) or a URL field's `{{key}}`. */
374
+ link?: string;
371
375
  }>;
372
376
  }
373
377
  /**
@@ -1,7 +1,7 @@
1
- import { N as NewFieldSpec } from '../declareTable-CVzk6RVH.js';
1
+ import { N as NewFieldSpec } from '../declareTable-B12XybRp.js';
2
2
  import { U as Uuid, i as RecordsResult, o as RecordPageSort } from '../record-DpB2QgAZ.js';
3
- import { R as RecordsClient } from '../client-Bvk0ymIs.js';
4
- import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-ClSGi6ze.js';
3
+ import { R as RecordsClient } from '../client-E0VQ0NPO.js';
4
+ import { F as FieldDrift, T as TableArchiveProgress } from '../table-kind-xKxTHtrV.js';
5
5
  import '../field-BPABOJ2Y.js';
6
6
  import '../subscription-D7KQBHXN.js';
7
7
  import '../ports-TMWX-t9l.js';
@@ -368,6 +368,10 @@ interface AppAutomationSpec {
368
368
  author: true;
369
369
  };
370
370
  text: string;
371
+ /** The notice's subject line (in-app and email); defaults to the automation's name. Same `{{key}}` words as `text`. */
372
+ subject?: string;
373
+ /** Where the notice opens: a path (`/hr/performance/{{record_id}}?org={{organization_id}}`) or a URL field's `{{key}}`. */
374
+ link?: string;
371
375
  }>;
372
376
  }
373
377
  /**
@@ -6738,7 +6738,14 @@ async function ensureAppAutomations(client, def, specs, options = {}) {
6738
6738
  if (a.do === "set") actions.push({ do: "set", values: keyed(a.values, own.data, own.data, def.name) });
6739
6739
  else if (a.do === "notify") {
6740
6740
  const to = "field" in a.to ? { field: byId(own.data, a.to.field, def.name) } : a.to;
6741
- actions.push({ do: "notify", to, text: a.text.replace(/\{\{(\w+)\}\}/g, (_m, k) => `{{${byId(own.data, k, def.name)}}}`) });
6741
+ const words = (t) => t.replace(/\{\{(\w+)\}\}/g, (m, k) => k === "record_id" || k === "organization_id" ? m : `{{${byId(own.data, k, def.name)}}}`);
6742
+ actions.push({
6743
+ do: "notify",
6744
+ to,
6745
+ text: words(a.text),
6746
+ ...a.subject ? { subject: words(a.subject) } : {},
6747
+ ...a.link ? { link: words(a.link) } : {}
6748
+ });
6742
6749
  } else {
6743
6750
  const other = await ensureTypedTable(client, a.table, { organizationId: org.data });
6744
6751
  if (!other.ok) return other;