@ptkl/sdk 1.13.0 → 1.15.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.
@@ -19550,11 +19550,32 @@ class Users extends PlatformBaseClient {
19550
19550
  }
19551
19551
  // Permissions & Roles
19552
19552
  /**
19553
- * Get user permissions
19553
+ * Get the current token's permissions.
19554
+ *
19555
+ * Returns the resolved permission set carried by the calling token. For a
19556
+ * forge actor token this is the scoped intersection minted at launch time —
19557
+ * see `getPrincipalPermissions()` for the underlying user's full set.
19554
19558
  */
19555
19559
  async getPermissions() {
19556
19560
  return await this.client.get("/v1/user/role/permissions");
19557
19561
  }
19562
+ /**
19563
+ * Get the FULL permissions of the user the current token is acting on behalf
19564
+ * of (the "principal").
19565
+ *
19566
+ * When a forge app runs under an actor token, `getPermissions()` returns only
19567
+ * the token's scoped permissions — the intersection of the app's declared
19568
+ * runtime permissions and the user's permissions. This instead returns the
19569
+ * complete permission set of the underlying user, so the app can check what
19570
+ * that user is actually allowed to do, independent of what the app itself was
19571
+ * granted. The token scope is unchanged: this exposes knowledge, not capability.
19572
+ *
19573
+ * For a normal user session (no actor token) it returns the caller's own
19574
+ * permissions, identical to `getPermissions()`'s scope.
19575
+ */
19576
+ async getPrincipalPermissions() {
19577
+ return await this.client.get("/v1/user/role/principal-permissions");
19578
+ }
19558
19579
  /**
19559
19580
  * Get list of available permissions
19560
19581
  */
@@ -581,11 +581,32 @@ class Users extends PlatformBaseClient {
581
581
  }
582
582
  // Permissions & Roles
583
583
  /**
584
- * Get user permissions
584
+ * Get the current token's permissions.
585
+ *
586
+ * Returns the resolved permission set carried by the calling token. For a
587
+ * forge actor token this is the scoped intersection minted at launch time —
588
+ * see `getPrincipalPermissions()` for the underlying user's full set.
585
589
  */
586
590
  async getPermissions() {
587
591
  return await this.client.get("/v1/user/role/permissions");
588
592
  }
593
+ /**
594
+ * Get the FULL permissions of the user the current token is acting on behalf
595
+ * of (the "principal").
596
+ *
597
+ * When a forge app runs under an actor token, `getPermissions()` returns only
598
+ * the token's scoped permissions — the intersection of the app's declared
599
+ * runtime permissions and the user's permissions. This instead returns the
600
+ * complete permission set of the underlying user, so the app can check what
601
+ * that user is actually allowed to do, independent of what the app itself was
602
+ * granted. The token scope is unchanged: this exposes knowledge, not capability.
603
+ *
604
+ * For a normal user session (no actor token) it returns the caller's own
605
+ * permissions, identical to `getPermissions()`'s scope.
606
+ */
607
+ async getPrincipalPermissions() {
608
+ return await this.client.get("/v1/user/role/principal-permissions");
609
+ }
589
610
  /**
590
611
  * Get list of available permissions
591
612
  */
@@ -409,6 +409,7 @@ type SetupData = {
409
409
  is_public?: boolean;
410
410
  icon?: string;
411
411
  settings?: Settings;
412
+ force_override?: boolean;
412
413
  };
413
414
  type ComponentCreateResponse = ComponentListItem;
414
415
  export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, UpdateOperators, UpdateAggregate, ModelUpdateData, ComponentOptions, ComponentListResponse, ComponentListItem, ComponentLabel, ComponentWorkspace, StreamCallback, StreamHandler, AggregateChainable, UpdateManyOptions, CreateManyOptions, Settings, SettingsField, FieldRoles, FieldConstraints, Context, Preset, PresetContext, Filters, Function, Extension, Policy, FieldAccessConfig, TemplatesDist, SetupData, ComponentCreateResponse, };
@@ -65,3 +65,13 @@ export interface Permission {
65
65
  action: string;
66
66
  role_uuid: string;
67
67
  }
68
+ /**
69
+ * Resolved RBAC permission set for a user on the current project.
70
+ * Matches the dashboard `models.Permissions` response shape returned by
71
+ * `GET /v1/user/role/permissions` and `GET /v1/user/role/principal-permissions`.
72
+ */
73
+ export interface Permissions {
74
+ is_admin: boolean;
75
+ roles: string[];
76
+ permissions: string[];
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",