@objectstack/plugin-approvals 11.1.0 → 11.2.0

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/dist/index.mjs CHANGED
@@ -662,6 +662,8 @@ var SysApprovalRequest = ObjectSchema.create({
662
662
  managedBy: "system",
663
663
  description: "Live approval instance tracked per submission",
664
664
  displayNameField: "id",
665
+ nameField: "id",
666
+ // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
665
667
  titleFormat: "{process_name} \xB7 {record_id}",
666
668
  compactLayout: ["process_name", "object_name", "record_id", "status", "current_step", "submitter_id", "updated_at"],
667
669
  // Curated built-in list views — render as segmented tabs in the console.
@@ -852,6 +854,8 @@ var SysApprovalAction = ObjectSchema2.create({
852
854
  managedBy: "append-only",
853
855
  description: "Append-only audit trail for approval actions",
854
856
  displayNameField: "id",
857
+ nameField: "id",
858
+ // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
855
859
  titleFormat: "{action} \xB7 {step_name}",
856
860
  compactLayout: ["request_id", "step_name", "action", "actor_id", "created_at"],
857
861
  listViews: {
@@ -953,6 +957,8 @@ var SysApprovalApprover = ObjectSchema3.create({
953
957
  managedBy: "system",
954
958
  description: "Normalized pending-approver rows for indexed inbox queries",
955
959
  displayNameField: "id",
960
+ nameField: "id",
961
+ // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
956
962
  titleFormat: "{approver} \xB7 {request_id}",
957
963
  compactLayout: ["request_id", "approver", "created_at"],
958
964
  fields: {
@@ -2243,7 +2249,7 @@ var _ApprovalService = class _ApprovalService {
2243
2249
  try {
2244
2250
  const schema = this.engine.getSchema?.(object);
2245
2251
  const fields = schema?.fields ?? {};
2246
- const declared = schema?.displayNameField;
2252
+ const declared = schema?.nameField ?? schema?.displayNameField;
2247
2253
  if (declared && declared !== "id" && fields[declared]) return declared;
2248
2254
  for (const cand of ["name", "title", "subject", "label"]) {
2249
2255
  if (fields[cand]) return cand;
@@ -2719,6 +2725,8 @@ var SysApprovalToken = ObjectSchema4.create({
2719
2725
  managedBy: "system",
2720
2726
  description: "Single-use tokens behind actionable approval links",
2721
2727
  displayNameField: "id",
2728
+ nameField: "id",
2729
+ // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
2722
2730
  fields: {
2723
2731
  id: Field4.text({ label: "Token ID", required: true, readonly: true, group: "System" }),
2724
2732
  organization_id: Field4.lookup("sys_organization", {