@objectstack/plugin-approvals 17.0.0-rc.4 → 17.0.0-rc.6

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
@@ -51,11 +51,11 @@ var init_en_objects_generated = __esm({
51
51
  label: "Status",
52
52
  help: "Lifecycle state of the request",
53
53
  options: {
54
- pending: "pending",
55
- approved: "approved",
56
- rejected: "rejected",
57
- recalled: "recalled",
58
- returned: "returned"
54
+ pending: "Pending",
55
+ approved: "Approved",
56
+ rejected: "Rejected",
57
+ recalled: "Recalled",
58
+ returned: "Returned"
59
59
  }
60
60
  },
61
61
  current_step: {
@@ -372,7 +372,7 @@ var init_zh_CN_objects_generated = __esm({
372
372
  label: "\u72B6\u6001",
373
373
  help: "\u8BF7\u6C42\u7684\u751F\u547D\u5468\u671F\u72B6\u6001",
374
374
  options: {
375
- pending: "\u5F85\u5904\u7406",
375
+ pending: "\u5F85\u5BA1\u6279",
376
376
  approved: "\u5DF2\u6279\u51C6",
377
377
  rejected: "\u5DF2\u62D2\u7EDD",
378
378
  recalled: "\u5DF2\u64A4\u56DE",
@@ -418,9 +418,9 @@ var init_zh_CN_objects_generated = __esm({
418
418
  },
419
419
  _views: {
420
420
  my_pending: {
421
- label: "\u6211\u7684\u5F85\u529E",
421
+ label: "\u5F85\u6211\u5BA1\u6279",
422
422
  emptyState: {
423
- title: "\u6682\u65E0\u5F85\u529E\u5BA1\u6279",
423
+ title: "\u6682\u65E0\u5F85\u5BA1\u6279\u7684\u8BF7\u6C42",
424
424
  message: "\u5168\u90E8\u5904\u7406\u5B8C\u6BD5\uFF0C\u6CA1\u6709\u7B49\u5F85\u4F60\u5BA1\u6279\u7684\u8BF7\u6C42\u3002"
425
425
  }
426
426
  },
@@ -739,7 +739,7 @@ var init_ja_JP_objects_generated = __esm({
739
739
  },
740
740
  _views: {
741
741
  my_pending: {
742
- label: "\u81EA\u5206\u306E\u4FDD\u7559\u4E2D",
742
+ label: "\u627F\u8A8D\u5F85\u3061",
743
743
  emptyState: {
744
744
  title: "\u627F\u8A8D\u5F85\u3061\u306F\u3042\u308A\u307E\u305B\u3093",
745
745
  message: "\u3059\u3079\u3066\u51E6\u7406\u6E08\u307F\u3067\u3059\u3002\u3042\u306A\u305F\u306E\u627F\u8A8D\u3092\u5F85\u3064\u30EA\u30AF\u30A8\u30B9\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\u3002"
@@ -1060,7 +1060,7 @@ var init_es_ES_objects_generated = __esm({
1060
1060
  },
1061
1061
  _views: {
1062
1062
  my_pending: {
1063
- label: "Mis pendientes",
1063
+ label: "Aprobaciones pendientes",
1064
1064
  emptyState: {
1065
1065
  title: "Sin aprobaciones pendientes",
1066
1066
  message: "Est\xE1s al d\xEDa: nada espera tu aprobaci\xF3n."
@@ -5749,7 +5749,7 @@ function registerApprovalReviseNode(automation, logger) {
5749
5749
  paradigms: ["flow"],
5750
5750
  source: "plugin",
5751
5751
  supportsPause: true,
5752
- isAsync: true,
5752
+ // (`isAsync` stood here — retired in #6748, ADR-0049: nothing read it)
5753
5753
  // #3823 / amended ADR-0044: THE point of this node type. The revise
5754
5754
  // window is a service-owned continuation, so the #3801 gate must refuse
5755
5755
  // a raw resume of it — which it does for any node type declaring this.
@@ -5801,7 +5801,7 @@ function registerApprovalNode(automation, service, logger) {
5801
5801
  source: "plugin",
5802
5802
  // Human decision: the run suspends here awaiting an external reply.
5803
5803
  supportsPause: true,
5804
- isAsync: true,
5804
+ // (`isAsync` stood here — retired in #6748, ADR-0049: nothing read it)
5805
5805
  // #3801: this pause is NOT resumable through the generic run-resume
5806
5806
  // route. Continuing an approval is a side effect of a DECISION, and the
5807
5807
  // decision is the thing that must be authorized (the approver slate),
@@ -5852,6 +5852,17 @@ function registerApprovalNode(automation, service, logger) {
5852
5852
  }, {
5853
5853
  ...SYSTEM_CTX4,
5854
5854
  userId: context?.userId,
5855
+ // [#7135] ⚠️ This assertion SURVIVES the annotation widening, and it
5856
+ // is `as ExecutionContext` rather than the `as unknown as
5857
+ // SharingExecutionContext` double cast it replaces. The sole reason
5858
+ // a cast is still needed is `organizationId`, which is not a field
5859
+ // of the envelope at ALL — that spelling has its own history (#5858
5860
+ // / `check:org-identifier`) and was explicitly held out of this
5861
+ // change (#7070), so removing the key here would be a RUNTIME change
5862
+ // belonging to that card. Dropping the second hop matters: `as
5863
+ // unknown as` erases the value entirely, while a single assertion
5864
+ // still requires the literal to be comparable to the envelope, so a
5865
+ // `userId: 42` here is once again a compile error.
5855
5866
  organizationId: context?.organizationId,
5856
5867
  tenantId: context?.tenantId
5857
5868
  });
@@ -5903,12 +5914,23 @@ var ApprovalsServicePlugin = class {
5903
5914
  // ADR-0029 D7 — contribute the Approvals entries into the Setup app's
5904
5915
  // `group_approvals` slot. This plugin owns these objects (K2.b), so it
5905
5916
  // ships their menu too; when the plugin isn't installed the slot is empty.
5917
+ //
5918
+ // #7234 — order inside the slot is ARRAY ORDER: `applyNavContributions`
5919
+ // does `group.children.push(...c.items)` per contribution (sorted by
5920
+ // `priority`), so the inbox being first in this array is what puts it
5921
+ // above the raw tables. Do not reorder without meaning to.
5922
+ //
5923
+ // The inbox entry is the working surface (decision actions, node
5924
+ // progress, drawer); the three object entries below stay as the
5925
+ // admin/diagnostic view of the engine's own tables — reachable only here,
5926
+ // behind `group_approvals`' `manage_platform_settings` gate.
5906
5927
  navigationContributions: [
5907
5928
  {
5908
5929
  app: "setup",
5909
5930
  group: "group_approvals",
5910
5931
  priority: 100,
5911
5932
  items: [
5933
+ { id: "nav_approvals_inbox", type: "component", label: "Approvals Inbox", componentRef: "approvals:inbox", icon: "list-checks" },
5912
5934
  { id: "nav_approval_requests", type: "object", label: "Requests", objectName: "sys_approval_request", icon: "inbox", requiresObject: "sys_approval_request" },
5913
5935
  { id: "nav_approval_actions", type: "object", label: "Action History", objectName: "sys_approval_action", icon: "history", requiresObject: "sys_approval_action" },
5914
5936
  { id: "nav_approval_delegations", type: "object", label: "Delegations (OOO)", objectName: "sys_approval_delegation", icon: "user-clock", requiresObject: "sys_approval_delegation" }
@@ -6021,7 +6043,14 @@ var ApprovalsServicePlugin = class {
6021
6043
  };
6022
6044
  const mountActionPages = async () => {
6023
6045
  try {
6024
- const http = ctx.getService("http-server");
6046
+ const readServer = (name) => {
6047
+ try {
6048
+ return ctx.getService(name);
6049
+ } catch {
6050
+ return void 0;
6051
+ }
6052
+ };
6053
+ const http = readServer("http.server") ?? readServer("http-server");
6025
6054
  const rawApp = http && typeof http.getRawApp === "function" ? http.getRawApp() : null;
6026
6055
  if (!rawApp || !this.service) return;
6027
6056
  const svc = this.service;