@objectstack/plugin-approvals 12.6.0 → 13.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @objectstack/plugin-approvals@12.6.0 build /home/runner/work/framework/framework/packages/plugins/plugin-approvals
2
+ > @objectstack/plugin-approvals@13.0.0 build /home/runner/work/framework/framework/packages/plugins/plugin-approvals
3
3
  > tsup --config ../../../tsup.config.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 120.29 KB
14
- ESM dist/index.mjs.map 215.92 KB
15
- ESM ⚡️ Build success in 284ms
16
- CJS dist/index.js 121.96 KB
17
- CJS dist/index.js.map 217.12 KB
18
- CJS ⚡️ Build success in 285ms
13
+ ESM dist/index.mjs 120.30 KB
14
+ ESM dist/index.mjs.map 215.93 KB
15
+ ESM ⚡️ Build success in 318ms
16
+ CJS dist/index.js 121.97 KB
17
+ CJS dist/index.js.map 217.13 KB
18
+ CJS ⚡️ Build success in 321ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 24925ms
21
- DTS dist/index.d.mts 381.04 KB
22
- DTS dist/index.d.ts 381.04 KB
20
+ DTS ⚡️ Build success in 17165ms
21
+ DTS dist/index.d.mts 381.76 KB
22
+ DTS dist/index.d.ts 381.76 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @objectstack/plugin-approvals
2
2
 
3
+ ## 13.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6d83431]
8
+ - Updated dependencies [01917c2]
9
+ - Updated dependencies [b271691]
10
+ - Updated dependencies [a5a1e41]
11
+ - Updated dependencies [466adf6]
12
+ - Updated dependencies [5be00c3]
13
+ - Updated dependencies [466adf6]
14
+ - Updated dependencies [2bee609]
15
+ - Updated dependencies [9fa84f9]
16
+ - Updated dependencies [fc7e7f7]
17
+ - @objectstack/spec@13.0.0
18
+ - @objectstack/core@13.0.0
19
+ - @objectstack/formula@13.0.0
20
+ - @objectstack/platform-objects@13.0.0
21
+ - @objectstack/metadata-core@13.0.0
22
+
3
23
  ## 12.6.0
4
24
 
5
25
  ### Patch Changes
@@ -355,8 +375,8 @@
355
375
  ADR-0057 — ERP authorization core. Adds permission-grant access DEPTH
356
376
  (`own`/`own_and_reports`/`unit`/`unit_and_below`/`org`), renames `sys_department`
357
377
  → `sys_business_unit` (no aliases — see BREAKING above), introduces the platform-owned
358
- `sys_user_role` assignment, and seeds stack-declared `roles`/`sharingRules` into
359
- `sys_role`/`sys_sharing_rule` at boot (closes #2077). Hierarchy-relative scopes are
378
+ `sys_user_position` assignment, and seeds stack-declared `roles`/`sharingRules` into
379
+ `sys_position`/`sys_sharing_rule` at boot (closes #2077). Hierarchy-relative scopes are
360
380
  delegated to a pluggable `IHierarchyScopeResolver` (open edition fails closed to
361
381
  owner-only; `defineStack` errors without `requires: ['hierarchy-security']`). Also
362
382
  fixes a latent over-grant where `engine.find({ filter })` was ignored (driver reads
@@ -765,8 +785,8 @@
765
785
  `i18n.loadTranslations` (the i18n service is optional — load is best-effort).
766
786
  - `plugin-webhooks` ← `sys_webhook`, `sys_webhook_delivery`
767
787
  - `plugin-approvals` ← `sys_approval_request`, `sys_approval_action`
768
- - `plugin-security` ← `sys_role`, `sys_permission_set`,
769
- `sys_user_permission_set`, `sys_role_permission_set`
788
+ - `plugin-security` ← `sys_position`, `sys_permission_set`,
789
+ `sys_user_permission_set`, `sys_position_permission_set`
770
790
  - `plugin-sharing` ← `sys_record_share`, `sys_sharing_rule`, `sys_share_link`
771
791
  - `@objectstack/platform-objects` translation bundles are regenerated to drop
772
792
  those objects' keys (its extract config already excluded them); all other
package/dist/index.d.mts CHANGED
@@ -320,7 +320,12 @@ declare const SysApprovalRequest: Omit<{
320
320
  access?: {
321
321
  default: "public" | "private";
322
322
  } | undefined;
323
- requiredPermissions?: string[] | undefined;
323
+ requiredPermissions?: string[] | {
324
+ read?: string[] | undefined;
325
+ create?: string[] | undefined;
326
+ update?: string[] | undefined;
327
+ delete?: string[] | undefined;
328
+ } | undefined;
324
329
  softDelete?: {
325
330
  enabled: boolean;
326
331
  field: string;
@@ -666,9 +671,10 @@ declare const SysApprovalRequest: Omit<{
666
671
  trash: boolean;
667
672
  mru: boolean;
668
673
  clone: boolean;
669
- apiMethods?: ("search" | "create" | "import" | "delete" | "get" | "update" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
674
+ apiMethods?: ("search" | "create" | "import" | "delete" | "update" | "get" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
670
675
  } | undefined;
671
- sharingModel?: "full" | "private" | "read" | "public_read" | "public_read_write" | "controlled_by_parent" | "read_write" | undefined;
676
+ sharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
677
+ externalSharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
672
678
  publicSharing?: {
673
679
  enabled: boolean;
674
680
  allowedAudiences?: ("email" | "public" | "link_only" | "signed_in")[] | undefined;
@@ -4507,7 +4513,12 @@ declare const SysApprovalAction: Omit<{
4507
4513
  access?: {
4508
4514
  default: "public" | "private";
4509
4515
  } | undefined;
4510
- requiredPermissions?: string[] | undefined;
4516
+ requiredPermissions?: string[] | {
4517
+ read?: string[] | undefined;
4518
+ create?: string[] | undefined;
4519
+ update?: string[] | undefined;
4520
+ delete?: string[] | undefined;
4521
+ } | undefined;
4511
4522
  softDelete?: {
4512
4523
  enabled: boolean;
4513
4524
  field: string;
@@ -4853,9 +4864,10 @@ declare const SysApprovalAction: Omit<{
4853
4864
  trash: boolean;
4854
4865
  mru: boolean;
4855
4866
  clone: boolean;
4856
- apiMethods?: ("search" | "create" | "import" | "delete" | "get" | "update" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
4867
+ apiMethods?: ("search" | "create" | "import" | "delete" | "update" | "get" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
4857
4868
  } | undefined;
4858
- sharingModel?: "full" | "private" | "read" | "public_read" | "public_read_write" | "controlled_by_parent" | "read_write" | undefined;
4869
+ sharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
4870
+ externalSharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
4859
4871
  publicSharing?: {
4860
4872
  enabled: boolean;
4861
4873
  allowedAudiences?: ("email" | "public" | "link_only" | "signed_in")[] | undefined;
@@ -7028,7 +7040,12 @@ declare const SysApprovalApprover: Omit<{
7028
7040
  access?: {
7029
7041
  default: "public" | "private";
7030
7042
  } | undefined;
7031
- requiredPermissions?: string[] | undefined;
7043
+ requiredPermissions?: string[] | {
7044
+ read?: string[] | undefined;
7045
+ create?: string[] | undefined;
7046
+ update?: string[] | undefined;
7047
+ delete?: string[] | undefined;
7048
+ } | undefined;
7032
7049
  softDelete?: {
7033
7050
  enabled: boolean;
7034
7051
  field: string;
@@ -7374,9 +7391,10 @@ declare const SysApprovalApprover: Omit<{
7374
7391
  trash: boolean;
7375
7392
  mru: boolean;
7376
7393
  clone: boolean;
7377
- apiMethods?: ("search" | "create" | "import" | "delete" | "get" | "update" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
7394
+ apiMethods?: ("search" | "create" | "import" | "delete" | "update" | "get" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
7378
7395
  } | undefined;
7379
- sharingModel?: "full" | "private" | "read" | "public_read" | "public_read_write" | "controlled_by_parent" | "read_write" | undefined;
7396
+ sharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
7397
+ externalSharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
7380
7398
  publicSharing?: {
7381
7399
  enabled: boolean;
7382
7400
  allowedAudiences?: ("email" | "public" | "link_only" | "signed_in")[] | undefined;
package/dist/index.d.ts CHANGED
@@ -320,7 +320,12 @@ declare const SysApprovalRequest: Omit<{
320
320
  access?: {
321
321
  default: "public" | "private";
322
322
  } | undefined;
323
- requiredPermissions?: string[] | undefined;
323
+ requiredPermissions?: string[] | {
324
+ read?: string[] | undefined;
325
+ create?: string[] | undefined;
326
+ update?: string[] | undefined;
327
+ delete?: string[] | undefined;
328
+ } | undefined;
324
329
  softDelete?: {
325
330
  enabled: boolean;
326
331
  field: string;
@@ -666,9 +671,10 @@ declare const SysApprovalRequest: Omit<{
666
671
  trash: boolean;
667
672
  mru: boolean;
668
673
  clone: boolean;
669
- apiMethods?: ("search" | "create" | "import" | "delete" | "get" | "update" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
674
+ apiMethods?: ("search" | "create" | "import" | "delete" | "update" | "get" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
670
675
  } | undefined;
671
- sharingModel?: "full" | "private" | "read" | "public_read" | "public_read_write" | "controlled_by_parent" | "read_write" | undefined;
676
+ sharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
677
+ externalSharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
672
678
  publicSharing?: {
673
679
  enabled: boolean;
674
680
  allowedAudiences?: ("email" | "public" | "link_only" | "signed_in")[] | undefined;
@@ -4507,7 +4513,12 @@ declare const SysApprovalAction: Omit<{
4507
4513
  access?: {
4508
4514
  default: "public" | "private";
4509
4515
  } | undefined;
4510
- requiredPermissions?: string[] | undefined;
4516
+ requiredPermissions?: string[] | {
4517
+ read?: string[] | undefined;
4518
+ create?: string[] | undefined;
4519
+ update?: string[] | undefined;
4520
+ delete?: string[] | undefined;
4521
+ } | undefined;
4511
4522
  softDelete?: {
4512
4523
  enabled: boolean;
4513
4524
  field: string;
@@ -4853,9 +4864,10 @@ declare const SysApprovalAction: Omit<{
4853
4864
  trash: boolean;
4854
4865
  mru: boolean;
4855
4866
  clone: boolean;
4856
- apiMethods?: ("search" | "create" | "import" | "delete" | "get" | "update" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
4867
+ apiMethods?: ("search" | "create" | "import" | "delete" | "update" | "get" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
4857
4868
  } | undefined;
4858
- sharingModel?: "full" | "private" | "read" | "public_read" | "public_read_write" | "controlled_by_parent" | "read_write" | undefined;
4869
+ sharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
4870
+ externalSharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
4859
4871
  publicSharing?: {
4860
4872
  enabled: boolean;
4861
4873
  allowedAudiences?: ("email" | "public" | "link_only" | "signed_in")[] | undefined;
@@ -7028,7 +7040,12 @@ declare const SysApprovalApprover: Omit<{
7028
7040
  access?: {
7029
7041
  default: "public" | "private";
7030
7042
  } | undefined;
7031
- requiredPermissions?: string[] | undefined;
7043
+ requiredPermissions?: string[] | {
7044
+ read?: string[] | undefined;
7045
+ create?: string[] | undefined;
7046
+ update?: string[] | undefined;
7047
+ delete?: string[] | undefined;
7048
+ } | undefined;
7032
7049
  softDelete?: {
7033
7050
  enabled: boolean;
7034
7051
  field: string;
@@ -7374,9 +7391,10 @@ declare const SysApprovalApprover: Omit<{
7374
7391
  trash: boolean;
7375
7392
  mru: boolean;
7376
7393
  clone: boolean;
7377
- apiMethods?: ("search" | "create" | "import" | "delete" | "get" | "update" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
7394
+ apiMethods?: ("search" | "create" | "import" | "delete" | "update" | "get" | "upsert" | "list" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "export")[] | undefined;
7378
7395
  } | undefined;
7379
- sharingModel?: "full" | "private" | "read" | "public_read" | "public_read_write" | "controlled_by_parent" | "read_write" | undefined;
7396
+ sharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
7397
+ externalSharingModel?: "private" | "public_read" | "public_read_write" | "controlled_by_parent" | undefined;
7380
7398
  publicSharing?: {
7381
7399
  enabled: boolean;
7382
7400
  allowedAudiences?: ("email" | "public" | "link_only" | "signed_in")[] | undefined;
package/dist/index.js CHANGED
@@ -1029,7 +1029,7 @@ var ESCALATION_JOB_NAME = "approvals-sla-escalation";
1029
1029
  var ESCALATION_SCAN_INTERVAL_MS = 5 * 60 * 1e3;
1030
1030
  var SLA_ACTOR_ID = "system:sla";
1031
1031
  var ACTION_TOKEN_TTL_MS = 72 * 60 * 60 * 1e3;
1032
- var SYSTEM_CTX = { isSystem: true, roles: [], permissions: [] };
1032
+ var SYSTEM_CTX = { isSystem: true, positions: [], permissions: [] };
1033
1033
  function uid(prefix) {
1034
1034
  const g = globalThis;
1035
1035
  if (g.crypto?.randomUUID) return `${prefix}_${g.crypto.randomUUID()}`;
@@ -2937,7 +2937,7 @@ function unbindAllHooks(engine) {
2937
2937
 
2938
2938
  // src/approval-node.ts
2939
2939
  var import_automation2 = require("@objectstack/spec/automation");
2940
- var SYSTEM_CTX2 = { isSystem: true, roles: [], permissions: [] };
2940
+ var SYSTEM_CTX2 = { isSystem: true, positions: [], permissions: [] };
2941
2941
  function registerApprovalNode(automation, service, logger) {
2942
2942
  automation.registerNodeExecutor({
2943
2943
  type: import_automation2.APPROVAL_NODE_TYPE,