@objectstack/plugin-approvals 11.1.0 → 11.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/plugin-approvals",
3
- "version": "11.1.0",
3
+ "version": "11.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Multi-step approval engine for ObjectStack — sys_approval_process + sys_approval_request + sys_approval_action + IApprovalService.",
6
6
  "main": "dist/index.js",
@@ -13,17 +13,17 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@objectstack/core": "11.1.0",
17
- "@objectstack/formula": "11.1.0",
18
- "@objectstack/metadata-core": "11.1.0",
19
- "@objectstack/platform-objects": "11.1.0",
20
- "@objectstack/spec": "11.1.0"
16
+ "@objectstack/core": "11.3.0",
17
+ "@objectstack/formula": "11.3.0",
18
+ "@objectstack/metadata-core": "11.3.0",
19
+ "@objectstack/platform-objects": "11.3.0",
20
+ "@objectstack/spec": "11.3.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@types/node": "^26.0.0",
23
+ "@types/node": "^26.0.1",
24
24
  "typescript": "^6.0.3",
25
25
  "vitest": "^4.1.9",
26
- "@objectstack/service-automation": "11.1.0"
26
+ "@objectstack/service-automation": "11.3.0"
27
27
  },
28
28
  "keywords": [
29
29
  "objectstack",
@@ -1419,7 +1419,9 @@ export class ApprovalService implements IApprovalService {
1419
1419
  try {
1420
1420
  const schema: any = (this.engine as any).getSchema?.(object);
1421
1421
  const fields = schema?.fields ?? {};
1422
- const declared = schema?.displayNameField;
1422
+ // [ADR-0079] `nameField` is the canonical primary-title pointer;
1423
+ // `displayNameField` is the deprecated alias (still honored).
1424
+ const declared = schema?.nameField ?? schema?.displayNameField;
1423
1425
  if (declared && declared !== 'id' && fields[declared]) return declared;
1424
1426
  for (const cand of ['name', 'title', 'subject', 'label']) {
1425
1427
  if (fields[cand]) return cand;
@@ -22,6 +22,7 @@ export const SysApprovalAction = ObjectSchema.create({
22
22
  managedBy: 'append-only',
23
23
  description: 'Append-only audit trail for approval actions',
24
24
  displayNameField: 'id',
25
+ nameField: 'id', // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
25
26
  titleFormat: '{action} · {step_name}',
26
27
  compactLayout: ['request_id', 'step_name', 'action', 'actor_id', 'created_at'],
27
28
 
@@ -33,6 +33,7 @@ export const SysApprovalApprover = ObjectSchema.create({
33
33
  managedBy: 'system',
34
34
  description: 'Normalized pending-approver rows for indexed inbox queries',
35
35
  displayNameField: 'id',
36
+ nameField: 'id', // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
36
37
  titleFormat: '{approver} · {request_id}',
37
38
  compactLayout: ['request_id', 'approver', 'created_at'],
38
39
 
@@ -31,6 +31,7 @@ export const SysApprovalRequest = ObjectSchema.create({
31
31
  managedBy: 'system',
32
32
  description: 'Live approval instance tracked per submission',
33
33
  displayNameField: 'id',
34
+ nameField: 'id', // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
34
35
  titleFormat: '{process_name} · {record_id}',
35
36
  compactLayout: ['process_name', 'object_name', 'record_id', 'status', 'current_step', 'submitter_id', 'updated_at'],
36
37
 
@@ -22,6 +22,7 @@ export const SysApprovalToken = ObjectSchema.create({
22
22
  managedBy: 'system',
23
23
  description: 'Single-use tokens behind actionable approval links',
24
24
  displayNameField: 'id',
25
+ nameField: 'id', // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
25
26
 
26
27
  fields: {
27
28
  id: Field.text({ label: 'Token ID', required: true, readonly: true, group: 'System' }),