@objectstack/plugin-approvals 15.1.1 → 16.0.0-rc.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +105 -0
- package/dist/index.d.mts +2999 -2410
- package/dist/index.d.ts +2999 -2410
- package/dist/index.js +849 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +850 -95
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/scripts/i18n-extract.config.ts +2 -1
- package/src/approval-service.test.ts +437 -1
- package/src/approval-service.ts +403 -58
- package/src/approvals-plugin.ts +9 -3
- package/src/index.ts +1 -0
- package/src/lifecycle-hooks.ts +64 -0
- package/src/nav-contribution.test.ts +2 -0
- package/src/sys-approval-action.object.ts +17 -2
- package/src/sys-approval-approver.object.ts +6 -0
- package/src/sys-approval-delegation.object.ts +142 -0
- package/src/sys-approval-request.object.test.ts +94 -0
- package/src/sys-approval-request.object.ts +160 -0
- package/src/sys-approval-token.object.ts +6 -0
- package/src/translations/en.objects.generated.ts +49 -0
- package/src/translations/es-ES.objects.generated.ts +49 -0
- package/src/translations/ja-JP.objects.generated.ts +49 -0
- package/src/translations/zh-CN.objects.generated.ts +49 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/plugin-approvals@
|
|
2
|
+
> @objectstack/plugin-approvals@16.0.0-rc.0 build /home/runner/work/framework/framework/packages/plugins/plugin-approvals
|
|
3
3
|
> tsup --config ../../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
14
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
16
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
17
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m157.00 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m274.68 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 322ms
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m155.17 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m273.43 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 327ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 26515ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m417.29 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m417.29 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# @objectstack/plugin-approvals
|
|
2
2
|
|
|
3
|
+
## 16.0.0-rc.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3a18b60: feat(approvals): rename the `role` approver type to `org_membership_level` (#3133)
|
|
8
|
+
|
|
9
|
+
`ApproverType.role` was the last platform surface projecting the reserved word
|
|
10
|
+
"role" (ADR-0090 D3). It is not covered by D3's better-auth exception: that
|
|
11
|
+
exception protects better-auth's own `sys_member.role` **column**, which we do
|
|
12
|
+
not own — `ApproverType` is our own enum, an authoring surface, and D3 mandates
|
|
13
|
+
that the projection of that concept is spelled `org_membership_level` and
|
|
14
|
+
labelled "organization membership", **never "role"**.
|
|
15
|
+
|
|
16
|
+
The sentence licensing the leak was also false: ADR-0090 D3 claims
|
|
17
|
+
`sys_member.role` is "already relabelled `org_membership_level` in the platform
|
|
18
|
+
projection", but `org_membership_level` existed nowhere in the codebase and
|
|
19
|
+
ADR-0057 D7 lists that relabel under "Deferred (evidence-gated, P4)". The
|
|
20
|
+
projection never landed, so the word reached authors.
|
|
21
|
+
|
|
22
|
+
The name manufactured a real, silent failure — "hotcrm class": every other
|
|
23
|
+
surface renamed to `position` (`sys_role`, `ShareRecipientType.role`,
|
|
24
|
+
`ctx.roles[]`), so `{ type: 'role', value: 'sales_manager' }` reads as the
|
|
25
|
+
legacy spelling of a position. It resolves against the membership tier, finds
|
|
26
|
+
no member row, falls back to an inert `role:sales_manager` literal, and the
|
|
27
|
+
request waits forever on an approver that cannot exist.
|
|
28
|
+
|
|
29
|
+
- **spec**: `ApproverType` gains `org_membership_level`; `role` stays as a
|
|
30
|
+
deprecated alias for one window (a published 15.x flow keeps loading) with
|
|
31
|
+
`DEPRECATED_APPROVER_TYPES` + `canonicalApproverType()` as the single source
|
|
32
|
+
for the mapping. Removed in the next major.
|
|
33
|
+
- **plugin-approvals**: resolves on the canonical type and warns on the
|
|
34
|
+
deprecated spelling. The `type:value` fallback literal keeps the **authored**
|
|
35
|
+
spelling — stored `sys_approval_approver` rows and `pending_approvers` slots
|
|
36
|
+
from 15.x carry `role:<v>`, and rewriting it would orphan them.
|
|
37
|
+
- **lint**: `approval-role-not-membership-tier` → `approval-approver-not-membership-tier`
|
|
38
|
+
(the rule id carried the reserved word too), plus a new
|
|
39
|
+
`approval-approver-type-deprecated`. The two are mutually exclusive: a bad
|
|
40
|
+
_value_ wins, because prescribing `org_membership_level` for a position name
|
|
41
|
+
would be wrong advice — the fix there is `position`.
|
|
42
|
+
|
|
43
|
+
Authoring `type: 'role'` keeps working and now says so out loud. Rewrite it as
|
|
44
|
+
`org_membership_level`; if the value is an org position, the fix is `position`.
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- 22013aa: **Split the overloaded `managedBy: 'system'` bucket into engine-owned vs. admin-writable, and enforce engine-owned writes (ADR-0103, #3220).** The `system` bucket conflated two incompatible write policies: rows a platform service owns end to end (never user-written), and platform-defined schema whose rows are legitimately admin/user-writable. It carried the same all-false affordance row as `better-auth`/`append-only` but, unlike `better-auth`, had no engine enforcement — a wildcard admin could raw-write these rows through the generic data API (ADR-0049 gap).
|
|
49
|
+
|
|
50
|
+
Rather than add a new `managedBy` enum value (which would fall through to fully-editable `platform` defaults on already-deployed Console clients), the write policy is now the **resolved affordance** (`resolveCrudAffordances` = bucket default + `userActions`), and _engine-owned_ is defined as a `system`/`append-only` object that grants no write:
|
|
51
|
+
|
|
52
|
+
- **Writable set declares `userActions`** — the RBAC link tables (`sys_user_position`, `sys_user_permission_set`, `sys_position_permission_set`), `sys_user_preference`, `sys_approval_delegation`, and the messaging config grids (`sys_notification_preference` / `…_subscription` / `…_template`) now declare `userActions: { create, edit, delete: true }`. The affordance is a declaration only — the `DelegatedAdminGate` / RLS / permission sets remain the authz.
|
|
53
|
+
- **Engine-owned objects locked to reads** — `apiMethods: ['get','list']` added where absent (jobs, notifications, approval request/approver/token/action, `sys_record_share`, `sys_automation_run`, mail/settings/secret audit, the messaging delivery pipeline). `sys_secret` is explicitly read-locked (an empty `apiMethods` array fails open).
|
|
54
|
+
- **`sys_import_job`** stays engine-owned: the REST import route now writes its job rows `isSystem`-elevated (attribution preserved via the explicit `created_by` stamp) and the object is locked to `['get','list']`.
|
|
55
|
+
- **New engine write guard** (`assertEngineOwnedWriteAllowed`, plugin-security) fail-closed rejects user-context generic writes to engine-owned `system`/`append-only` objects, keyed off the resolved affordance; `isSystem` and context-less engine/service writes bypass by construction. Wired into the security middleware alongside the other data-layer gates.
|
|
56
|
+
- **`reconcileManagedApiMethods`** (objectql registry) now runs for **every** managed bucket, not just `better-auth`: any advertised write verb an object's resolved affordances forbid is stripped at registration with a warning (the drift backstop, ADR-0049).
|
|
57
|
+
- **`/me/permissions` clamp** (plugin-hono-server) now clamps `system`/`append-only` as well as `better-auth`, so the client hint reflects `permission ∩ guard`.
|
|
58
|
+
|
|
59
|
+
**Potentially breaking:** a downstream/third-party `system` object that advertised generic write verbs relying on today's fail-open behaviour will have those verbs stripped (with a warning) and user-context generic writes to it rejected. Declare `userActions` opening the verbs the object legitimately takes from a user context. `better-auth` keeps plugin-auth's identity write guard unchanged; the row-level `managed_by` provenance vocabulary (ADR-0066) is a different axis and is untouched.
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [f972574]
|
|
62
|
+
- Updated dependencies [22013aa]
|
|
63
|
+
- Updated dependencies [3ad3dd5]
|
|
64
|
+
- Updated dependencies [3a18b60]
|
|
65
|
+
- Updated dependencies [a8aa34c]
|
|
66
|
+
- Updated dependencies [e057f42]
|
|
67
|
+
- Updated dependencies [a3823b2]
|
|
68
|
+
- Updated dependencies [bc65105]
|
|
69
|
+
- Updated dependencies [43a3efb]
|
|
70
|
+
- Updated dependencies [524696a]
|
|
71
|
+
- Updated dependencies [6b51346]
|
|
72
|
+
- Updated dependencies [80273c8]
|
|
73
|
+
- Updated dependencies [5e3301d]
|
|
74
|
+
- Updated dependencies [dd9f223]
|
|
75
|
+
- Updated dependencies [46e876c]
|
|
76
|
+
- Updated dependencies [5f05de2]
|
|
77
|
+
- Updated dependencies [021ba4c]
|
|
78
|
+
- Updated dependencies [158aa14]
|
|
79
|
+
- Updated dependencies [d2723e2]
|
|
80
|
+
- Updated dependencies [fefcd54]
|
|
81
|
+
- Updated dependencies [beaf2de]
|
|
82
|
+
- Updated dependencies [06cb319]
|
|
83
|
+
- Updated dependencies [369eb6e]
|
|
84
|
+
- Updated dependencies [b659111]
|
|
85
|
+
- Updated dependencies [5754a23]
|
|
86
|
+
- Updated dependencies [6c270a6]
|
|
87
|
+
- Updated dependencies [290e2f0]
|
|
88
|
+
- Updated dependencies [668dd17]
|
|
89
|
+
- Updated dependencies [8abf133]
|
|
90
|
+
- Updated dependencies [e0859b1]
|
|
91
|
+
- Updated dependencies [04ecd4e]
|
|
92
|
+
- Updated dependencies [4d5a892]
|
|
93
|
+
- Updated dependencies [16cebeb]
|
|
94
|
+
- Updated dependencies [86d30af]
|
|
95
|
+
- Updated dependencies [8923843]
|
|
96
|
+
- Updated dependencies [ea32ec7]
|
|
97
|
+
- Updated dependencies [a2795f6]
|
|
98
|
+
- Updated dependencies [f16b492]
|
|
99
|
+
- Updated dependencies [4b6fde8]
|
|
100
|
+
- Updated dependencies [2018df9]
|
|
101
|
+
- Updated dependencies [fc5a3a2]
|
|
102
|
+
- @objectstack/spec@16.0.0-rc.0
|
|
103
|
+
- @objectstack/platform-objects@16.0.0-rc.0
|
|
104
|
+
- @objectstack/core@16.0.0-rc.0
|
|
105
|
+
- @objectstack/formula@16.0.0-rc.0
|
|
106
|
+
- @objectstack/metadata-core@16.0.0-rc.0
|
|
107
|
+
|
|
3
108
|
## 15.1.1
|
|
4
109
|
|
|
5
110
|
### Patch Changes
|