@objectstack/plugin-approvals 17.0.0-rc.6 → 17.0.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
@@ -128,7 +128,7 @@ var init_en_objects_generated = __esm({
128
128
  },
129
129
  approval_reject: {
130
130
  label: "Reject",
131
- confirmText: "Reject this request? A rejection is final for every approver.",
131
+ description: "Reject this request? A rejection is final for every approver.",
132
132
  successMessage: "Rejected.",
133
133
  params: {
134
134
  comment: {
@@ -181,7 +181,7 @@ var init_en_objects_generated = __esm({
181
181
  },
182
182
  approval_recall: {
183
183
  label: "Recall",
184
- confirmText: "Recall this request? Approvers can no longer act on it and the record is unlocked.",
184
+ description: "Recall this request? Approvers can no longer act on it and the record is unlocked.",
185
185
  successMessage: "Recalled.",
186
186
  params: {
187
187
  comment: {
@@ -225,18 +225,18 @@ var init_en_objects_generated = __esm({
225
225
  action: {
226
226
  label: "Action",
227
227
  options: {
228
- submit: "submit",
229
- approve: "approve",
230
- reject: "reject",
231
- recall: "recall",
232
- escalate: "escalate",
233
- reassign: "reassign",
234
- remind: "remind",
235
- request_info: "request_info",
236
- comment: "comment",
237
- revise: "revise",
238
- resubmit: "resubmit",
239
- ooo_substitute: "ooo_substitute"
228
+ submit: "Submit",
229
+ approve: "Approve",
230
+ reject: "Reject",
231
+ recall: "Recall",
232
+ escalate: "Escalate",
233
+ reassign: "Reassign",
234
+ remind: "Remind",
235
+ request_info: "Request Info",
236
+ comment: "Comment",
237
+ revise: "Revise",
238
+ resubmit: "Resubmit",
239
+ ooo_substitute: "Out-of-Office Substitution"
240
240
  }
241
241
  },
242
242
  actor_id: {
@@ -449,7 +449,7 @@ var init_zh_CN_objects_generated = __esm({
449
449
  },
450
450
  approval_reject: {
451
451
  label: "\u62D2\u7EDD",
452
- confirmText: "\u62D2\u7EDD\u8BE5\u8BF7\u6C42\uFF1F\u62D2\u7EDD\u5BF9\u6240\u6709\u5BA1\u6279\u4EBA\u7ACB\u5373\u751F\u6548\u3002",
452
+ description: "\u62D2\u7EDD\u8BE5\u8BF7\u6C42\uFF1F\u62D2\u7EDD\u5BF9\u6240\u6709\u5BA1\u6279\u4EBA\u7ACB\u5373\u751F\u6548\u3002",
453
453
  successMessage: "\u5DF2\u62D2\u7EDD\u3002",
454
454
  params: {
455
455
  comment: {
@@ -502,7 +502,7 @@ var init_zh_CN_objects_generated = __esm({
502
502
  },
503
503
  approval_recall: {
504
504
  label: "\u64A4\u56DE",
505
- confirmText: "\u64A4\u56DE\u8BE5\u8BF7\u6C42\uFF1F\u64A4\u56DE\u540E\u5BA1\u6279\u4EBA\u5C06\u65E0\u6CD5\u7EE7\u7EED\u5904\u7406\uFF0C\u8BB0\u5F55\u968F\u5373\u89E3\u9501\u3002",
505
+ description: "\u64A4\u56DE\u8BE5\u8BF7\u6C42\uFF1F\u64A4\u56DE\u540E\u5BA1\u6279\u4EBA\u5C06\u65E0\u6CD5\u7EE7\u7EED\u5904\u7406\uFF0C\u8BB0\u5F55\u968F\u5373\u89E3\u9501\u3002",
506
506
  successMessage: "\u5DF2\u64A4\u56DE\u3002",
507
507
  params: {
508
508
  comment: {
@@ -770,7 +770,7 @@ var init_ja_JP_objects_generated = __esm({
770
770
  },
771
771
  approval_reject: {
772
772
  label: "\u5374\u4E0B",
773
- confirmText: "\u3053\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u5374\u4E0B\u3057\u307E\u3059\u304B\uFF1F\u5374\u4E0B\u306F\u3059\u3079\u3066\u306E\u627F\u8A8D\u8005\u306B\u5BFE\u3057\u3066\u6700\u7D42\u6C7A\u5B9A\u306B\u306A\u308A\u307E\u3059\u3002",
773
+ description: "\u3053\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u5374\u4E0B\u3057\u307E\u3059\u304B\uFF1F\u5374\u4E0B\u306F\u3059\u3079\u3066\u306E\u627F\u8A8D\u8005\u306B\u5BFE\u3057\u3066\u6700\u7D42\u6C7A\u5B9A\u306B\u306A\u308A\u307E\u3059\u3002",
774
774
  successMessage: "\u5374\u4E0B\u3057\u307E\u3057\u305F\u3002",
775
775
  params: {
776
776
  comment: {
@@ -823,7 +823,7 @@ var init_ja_JP_objects_generated = __esm({
823
823
  },
824
824
  approval_recall: {
825
825
  label: "\u53D6\u308A\u4E0B\u3052",
826
- confirmText: "\u3053\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u53D6\u308A\u4E0B\u3052\u307E\u3059\u304B\uFF1F\u627F\u8A8D\u8005\u306F\u64CD\u4F5C\u3067\u304D\u306A\u304F\u306A\u308A\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u30ED\u30C3\u30AF\u304C\u89E3\u9664\u3055\u308C\u307E\u3059\u3002",
826
+ description: "\u3053\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u53D6\u308A\u4E0B\u3052\u307E\u3059\u304B\uFF1F\u627F\u8A8D\u8005\u306F\u64CD\u4F5C\u3067\u304D\u306A\u304F\u306A\u308A\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u30ED\u30C3\u30AF\u304C\u89E3\u9664\u3055\u308C\u307E\u3059\u3002",
827
827
  successMessage: "\u53D6\u308A\u4E0B\u3052\u307E\u3057\u305F\u3002",
828
828
  params: {
829
829
  comment: {
@@ -1091,7 +1091,7 @@ var init_es_ES_objects_generated = __esm({
1091
1091
  },
1092
1092
  approval_reject: {
1093
1093
  label: "Rechazar",
1094
- confirmText: "\xBFRechazar esta solicitud? Un rechazo es definitivo para todos los aprobadores.",
1094
+ description: "\xBFRechazar esta solicitud? Un rechazo es definitivo para todos los aprobadores.",
1095
1095
  successMessage: "Rechazada.",
1096
1096
  params: {
1097
1097
  comment: {
@@ -1144,7 +1144,7 @@ var init_es_ES_objects_generated = __esm({
1144
1144
  },
1145
1145
  approval_recall: {
1146
1146
  label: "Retirar",
1147
- confirmText: "\xBFRetirar esta solicitud? Los aprobadores ya no podr\xE1n actuar sobre ella y el registro se desbloquear\xE1.",
1147
+ description: "\xBFRetirar esta solicitud? Los aprobadores ya no podr\xE1n actuar sobre ella y el registro se desbloquear\xE1.",
1148
1148
  successMessage: "Retirada.",
1149
1149
  params: {
1150
1150
  comment: {
@@ -1321,7 +1321,7 @@ var init_translations = __esm({
1321
1321
 
1322
1322
  // src/sys-approval-request.object.ts
1323
1323
  import { ObjectSchema, Field } from "@objectstack/spec/data";
1324
- import { APPROVAL_STATUSES } from "@objectstack/spec/contracts";
1324
+ import { APPROVAL_STATUSES, APPROVAL_STATUS_LABELS } from "@objectstack/spec/contracts";
1325
1325
  var SysApprovalRequest = ObjectSchema.create({
1326
1326
  name: "sys_approval_request",
1327
1327
  label: "Approval Request",
@@ -1420,10 +1420,13 @@ var SysApprovalRequest = ObjectSchema.create({
1420
1420
  group: "Target"
1421
1421
  }),
1422
1422
  status: Field.select(
1423
- // Spread from the contract, not re-typed (#3786). `APPROVAL_STATUSES` is
1423
+ // Derived from the contract, not re-typed (#3786). `APPROVAL_STATUSES` is
1424
1424
  // where the list and the reason for each entry live; `ApprovalStatus` is
1425
- // derived from it, so this column and the contract cannot disagree.
1426
- [...APPROVAL_STATUSES],
1425
+ // derived from it, so this column and the contract cannot disagree. The
1426
+ // authored English label per entry lives beside it in
1427
+ // `APPROVAL_STATUS_LABELS` (#8543) — mapped here, never re-typed, so the
1428
+ // `en` bundle regenerates from the contract's own text.
1429
+ APPROVAL_STATUSES.map((value) => ({ value, label: APPROVAL_STATUS_LABELS[value] })),
1427
1430
  {
1428
1431
  label: "Status",
1429
1432
  required: true,
@@ -1555,6 +1558,15 @@ var SysApprovalRequest = ObjectSchema.create({
1555
1558
  {
1556
1559
  name: "approval_reject",
1557
1560
  label: "Reject",
1561
+ // The confirm question lives HERE, not in `confirmText`: this action
1562
+ // collects params, so the console would otherwise chain a confirm dialog
1563
+ // and then the param dialog for one decision — and the first one already
1564
+ // reads as "the action ran" (#7278, maintainer ruling 2026-08-10). The
1565
+ // param dialog renders this as its description, and nothing is POSTed
1566
+ // until its own Confirm: one condition, one wording, one dialog.
1567
+ // NB: the top-level action `description` (#7367), never `ai.description`
1568
+ // — that one is the LLM-facing tool contract and is not shown to anyone.
1569
+ description: "Reject this request? A rejection is final for every approver.",
1558
1570
  icon: "x-circle",
1559
1571
  // Destructive decision — rendered in the console's danger styling so it
1560
1572
  // reads as the irreversible action it is (objectui#2762 P1-5).
@@ -1567,7 +1579,6 @@ var SysApprovalRequest = ObjectSchema.create({
1567
1579
  { name: "attachments", label: "Attachments", type: "file", multiple: true, required: false }
1568
1580
  ],
1569
1581
  visible: "record.viewer.can_act || record.viewer.can_override",
1570
- confirmText: "Reject this request? A rejection is final for every approver.",
1571
1582
  locations: ["record_section", "list_item"],
1572
1583
  successMessage: "Rejected.",
1573
1584
  refreshAfter: true
@@ -1651,6 +1662,9 @@ var SysApprovalRequest = ObjectSchema.create({
1651
1662
  {
1652
1663
  name: "approval_recall",
1653
1664
  label: "Recall",
1665
+ // Confirm question as the param dialog's description, not `confirmText`
1666
+ // — same one-decision-one-dialog rule as `approval_reject` above (#7278).
1667
+ description: "Recall this request? Approvers can no longer act on it and the record is unlocked.",
1654
1668
  icon: "undo-2",
1655
1669
  type: "api",
1656
1670
  method: "POST",
@@ -1661,7 +1675,6 @@ var SysApprovalRequest = ObjectSchema.create({
1661
1675
  // Recall applies while the request is live for the submitter — pending
1662
1676
  // (withdraw) or returned (abandon the revision instead of resubmitting).
1663
1677
  visible: '(record.status == "pending" || record.status == "returned") && record.viewer.is_submitter',
1664
- confirmText: "Recall this request? Approvers can no longer act on it and the record is unlocked.",
1665
1678
  locations: ["record_section"],
1666
1679
  successMessage: "Recalled.",
1667
1680
  refreshAfter: true
@@ -1692,7 +1705,7 @@ var SysApprovalRequest = ObjectSchema.create({
1692
1705
 
1693
1706
  // src/sys-approval-action.object.ts
1694
1707
  import { ObjectSchema as ObjectSchema2, Field as Field2 } from "@objectstack/spec/data";
1695
- import { APPROVAL_ACTION_KINDS } from "@objectstack/spec/contracts";
1708
+ import { APPROVAL_ACTION_KINDS, APPROVAL_ACTION_KIND_LABELS } from "@objectstack/spec/contracts";
1696
1709
  var SysApprovalAction = ObjectSchema2.create({
1697
1710
  name: "sys_approval_action",
1698
1711
  label: "Approval Action",
@@ -1771,11 +1784,14 @@ var SysApprovalAction = ObjectSchema2.create({
1771
1784
  group: "Target"
1772
1785
  }),
1773
1786
  action: Field2.select(
1774
- // Spread from the contract, not re-typed (#3786). `APPROVAL_ACTION_KINDS`
1787
+ // Derived from the contract, not re-typed (#3786). `APPROVAL_ACTION_KINDS`
1775
1788
  // is where the list and the per-kind notes live (which kinds move the flow
1776
1789
  // and which are thread-only); `ApprovalActionKind` is derived from it, so
1777
- // this column and the contract cannot disagree.
1778
- [...APPROVAL_ACTION_KINDS],
1790
+ // this column and the contract cannot disagree. The authored English label
1791
+ // per kind lives beside it in `APPROVAL_ACTION_KIND_LABELS` (#8580 — the
1792
+ // #7232 humanization pass missed this field) — mapped here, never
1793
+ // re-typed, so the `en` bundle regenerates from the contract's own text.
1794
+ APPROVAL_ACTION_KINDS.map((value) => ({ value, label: APPROVAL_ACTION_KIND_LABELS[value] })),
1779
1795
  {
1780
1796
  label: "Action",
1781
1797
  required: true,
@@ -4386,10 +4402,14 @@ var _ApprovalService = class _ApprovalService {
4386
4402
  * class of failure stayed silent.
4387
4403
  *
4388
4404
  * It also could not have answered the question even if it looked: its
4389
- * liveness oracle is `getRun`, which reads the execution LOG, and after a
4390
- * restart that returns `null` for a perfectly ALIVE suspended run. It treats
4391
- * `null` as alive (conservative, correct) but that means it has no way to
4392
- * say "this run is really gone".
4405
+ * liveness oracle is `getRun`, which treats both `null` and `paused` as alive
4406
+ * (conservative, correct) so it has no way to say "this run is really
4407
+ * gone". (Until #8050 that oracle was weaker still: after a restart it
4408
+ * returned `null` for a perfectly ALIVE suspended run, so "alive" and
4409
+ * "unknown" were the same answer. It now reports such a run as `paused`,
4410
+ * which does not change any branch here — both already meant "leave alone" —
4411
+ * but it is why the sweep below needs `hasSuspendedRun` as a second oracle
4412
+ * rather than a sharper reading of the first.)
4393
4413
  *
4394
4414
  * So this uses BOTH oracles, and a row must fail both to be reported:
4395
4415
  *