@gpt-platform/client 0.6.1 → 0.6.3

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.d.mts CHANGED
@@ -606,9 +606,9 @@ declare class BrowserApiKeyError extends Error {
606
606
  }
607
607
 
608
608
  /** SDK version — updated automatically by mix update.sdks */
609
- declare const SDK_VERSION = "0.6.1";
609
+ declare const SDK_VERSION = "0.6.3";
610
610
  /** Default API version sent in every request — updated automatically by mix update.sdks */
611
- declare const DEFAULT_API_VERSION = "2026-03-09";
611
+ declare const DEFAULT_API_VERSION = "2026-03-11";
612
612
 
613
613
  /** Security configuration options */
614
614
  interface SecurityConfig {
@@ -3330,6 +3330,61 @@ type CrmRelationship = {
3330
3330
  };
3331
3331
  type: string;
3332
3332
  };
3333
+ /**
3334
+ * A "Resource object" representing a access-grant
3335
+ */
3336
+ type AccessGrant = {
3337
+ /**
3338
+ * An attributes object for a access-grant
3339
+ */
3340
+ attributes?: {
3341
+ /**
3342
+ * Permissions granted by this relation. Auto-populated from PermissionRegistry unless overridden. Field included by default.
3343
+ */
3344
+ custom_permissions: Array<string>;
3345
+ /**
3346
+ * Field included by default.
3347
+ */
3348
+ expires_at?: string | null | unknown;
3349
+ /**
3350
+ * Field included by default.
3351
+ */
3352
+ granted_by_id?: string | null | unknown;
3353
+ is_expired?: boolean | null | unknown;
3354
+ /**
3355
+ * Field included by default.
3356
+ */
3357
+ join_source: "manual" | "invitation" | "domain_whitelist" | "sso_oidc" | "sso_saml" | "scim";
3358
+ /**
3359
+ * Field included by default.
3360
+ */
3361
+ object_id: string;
3362
+ /**
3363
+ * Field included by default.
3364
+ */
3365
+ object_type: "tenant" | "workspace";
3366
+ /**
3367
+ * Field included by default.
3368
+ */
3369
+ relation: "tenant_admin" | "tenant_member" | "workspace_admin" | "workspace_editor" | "workspace_viewer";
3370
+ /**
3371
+ * Field included by default.
3372
+ */
3373
+ subject_id: string;
3374
+ /**
3375
+ * Field included by default.
3376
+ */
3377
+ subject_type: "user" | "application";
3378
+ };
3379
+ id: string;
3380
+ /**
3381
+ * A relationships object for a access-grant
3382
+ */
3383
+ relationships?: {
3384
+ [key: string]: never;
3385
+ };
3386
+ type: string;
3387
+ };
3333
3388
  /**
3334
3389
  * A "Resource object" representing a support_tag
3335
3390
  */
@@ -3948,6 +4003,97 @@ type BreachIncident = {
3948
4003
  };
3949
4004
  type: string;
3950
4005
  };
4006
+ /**
4007
+ * A "Resource object" representing a role
4008
+ */
4009
+ type Role = {
4010
+ /**
4011
+ * An attributes object for a role
4012
+ */
4013
+ attributes?: {
4014
+ /**
4015
+ * Field included by default.
4016
+ */
4017
+ application_id?: string | null | unknown;
4018
+ /**
4019
+ * Field included by default.
4020
+ */
4021
+ description?: string | null | unknown;
4022
+ /**
4023
+ * Field included by default.
4024
+ */
4025
+ is_system_default: boolean;
4026
+ /**
4027
+ * Field included by default.
4028
+ */
4029
+ name: string;
4030
+ /**
4031
+ * Field included by default.
4032
+ */
4033
+ permissions?: Array<string> | null | unknown;
4034
+ };
4035
+ id: string;
4036
+ /**
4037
+ * A relationships object for a role
4038
+ */
4039
+ relationships?: {
4040
+ application?: {
4041
+ /**
4042
+ * An identifier for application
4043
+ */
4044
+ data?: {
4045
+ id: string;
4046
+ meta?: {
4047
+ [key: string]: unknown;
4048
+ };
4049
+ type: string;
4050
+ } | null;
4051
+ };
4052
+ };
4053
+ type: string;
4054
+ };
4055
+ /**
4056
+ * A "Resource object" representing a permission
4057
+ */
4058
+ type Permission = {
4059
+ /**
4060
+ * An attributes object for a permission
4061
+ */
4062
+ attributes?: {
4063
+ /**
4064
+ * Field included by default.
4065
+ */
4066
+ category?: string | null | unknown;
4067
+ /**
4068
+ * Field included by default.
4069
+ */
4070
+ context: "tenant" | "workspace";
4071
+ /**
4072
+ * Field included by default.
4073
+ */
4074
+ description: string;
4075
+ /**
4076
+ * Field included by default.
4077
+ */
4078
+ label: string;
4079
+ /**
4080
+ * Field included by default.
4081
+ */
4082
+ permissions?: Array<string> | null | unknown;
4083
+ /**
4084
+ * Field included by default.
4085
+ */
4086
+ role?: string | null | unknown;
4087
+ };
4088
+ id: string;
4089
+ /**
4090
+ * A relationships object for a permission
4091
+ */
4092
+ relationships?: {
4093
+ [key: string]: never;
4094
+ };
4095
+ type: string;
4096
+ };
3951
4097
  /**
3952
4098
  * A "Resource object" representing a crm_custom_entity
3953
4099
  */
@@ -5636,95 +5782,6 @@ type LlmAnalytics = {
5636
5782
  };
5637
5783
  type: string;
5638
5784
  };
5639
- /**
5640
- * A "Resource object" representing a tenant-membership
5641
- */
5642
- type TenantMembership = {
5643
- /**
5644
- * An attributes object for a tenant-membership
5645
- */
5646
- attributes?: {
5647
- /**
5648
- * Derived role based on permissions
5649
- */
5650
- effective_role?: "admin" | "member" | "custom" | unknown;
5651
- /**
5652
- * True if permissions differ from the role preset
5653
- */
5654
- is_customized?: boolean | null | unknown;
5655
- /**
5656
- * True if this member is the tenant owner
5657
- */
5658
- is_owner?: boolean | null | unknown;
5659
- /**
5660
- * How the member joined this tenant. Field included by default.
5661
- */
5662
- join_source: "manual" | "invitation" | "domain_whitelist" | "sso_oidc" | "sso_saml" | "scim";
5663
- /**
5664
- * Org-level permissions in format {app}:{resource}:{action}:{scope}. Field included by default.
5665
- */
5666
- permissions: Array<string>;
5667
- /**
5668
- * Role preset. Note: Owner is determined by tenant.owner_id, not this field. Field included by default.
5669
- */
5670
- role: "admin" | "member";
5671
- /**
5672
- * Field included by default.
5673
- */
5674
- role_id?: string | null | unknown;
5675
- /**
5676
- * Field included by default.
5677
- */
5678
- tenant_id: string;
5679
- /**
5680
- * Field included by default.
5681
- */
5682
- user_id: string;
5683
- };
5684
- id: string;
5685
- /**
5686
- * A relationships object for a tenant-membership
5687
- */
5688
- relationships?: {
5689
- assigned_role?: {
5690
- /**
5691
- * An identifier for assigned_role
5692
- */
5693
- data?: {
5694
- id: string;
5695
- meta?: {
5696
- [key: string]: unknown;
5697
- };
5698
- type: string;
5699
- } | null;
5700
- };
5701
- tenant?: {
5702
- /**
5703
- * An identifier for tenant
5704
- */
5705
- data?: {
5706
- id: string;
5707
- meta?: {
5708
- [key: string]: unknown;
5709
- };
5710
- type: string;
5711
- } | null;
5712
- };
5713
- user?: {
5714
- /**
5715
- * An identifier for user
5716
- */
5717
- data?: {
5718
- id: string;
5719
- meta?: {
5720
- [key: string]: unknown;
5721
- };
5722
- type: string;
5723
- } | null;
5724
- };
5725
- };
5726
- type: string;
5727
- };
5728
5785
  /**
5729
5786
  * A "Resource object" representing a audit-log
5730
5787
  */
@@ -6556,86 +6613,44 @@ type LegalDocument = {
6556
6613
  type: string;
6557
6614
  };
6558
6615
  /**
6559
- * A "Resource object" representing a workspace-membership
6616
+ * A "Resource object" representing a permission_preset
6560
6617
  */
6561
- type WorkspaceMembership = {
6618
+ type PermissionPreset = {
6562
6619
  /**
6563
- * An attributes object for a workspace-membership
6620
+ * An attributes object for a permission_preset
6564
6621
  */
6565
6622
  attributes?: {
6566
6623
  /**
6567
6624
  * Field included by default.
6568
6625
  */
6569
- created_at: unknown;
6570
- /**
6571
- * For inherited members, describes the org role
6572
- */
6573
- inherited_from?: string | null | unknown;
6574
- /**
6575
- * Last time user accessed this workspace. Field included by default.
6576
- */
6577
- last_visited_at?: unknown;
6578
- /**
6579
- * Workspace permissions in format {app}:{resource}:{action}:{scope}. Field included by default.
6580
- */
6581
- permissions: Array<string>;
6582
- /**
6583
- * ISV-defined member profile data (NPI, credentials, etc.). Field included by default.
6584
- */
6585
- profile_attributes?: {
6586
- [key: string]: unknown;
6587
- } | null | unknown;
6626
+ app: string;
6588
6627
  /**
6589
- * Effective role: admin, editor, or viewer
6628
+ * Field included by default.
6590
6629
  */
6591
- role?: string | null | unknown;
6592
- role_label?: string | null | unknown;
6630
+ context: string;
6593
6631
  /**
6594
- * How user got access: :direct (explicit invite) or :inherited (org role)
6632
+ * Field included by default.
6595
6633
  */
6596
- source?: string | null | unknown;
6634
+ description: string;
6597
6635
  /**
6598
6636
  * Field included by default.
6599
6637
  */
6600
- updated_at: unknown;
6638
+ name: string;
6601
6639
  /**
6602
6640
  * Field included by default.
6603
6641
  */
6604
- user_id: string;
6642
+ permissions: Array<string>;
6605
6643
  /**
6606
6644
  * Field included by default.
6607
6645
  */
6608
- workspace_id: string;
6646
+ role: string;
6609
6647
  };
6610
6648
  id: string;
6611
6649
  /**
6612
- * A relationships object for a workspace-membership
6650
+ * A relationships object for a permission_preset
6613
6651
  */
6614
6652
  relationships?: {
6615
- user?: {
6616
- /**
6617
- * An identifier for user
6618
- */
6619
- data?: {
6620
- id: string;
6621
- meta?: {
6622
- [key: string]: unknown;
6623
- };
6624
- type: string;
6625
- } | null;
6626
- };
6627
- workspace?: {
6628
- /**
6629
- * An identifier for workspace
6630
- */
6631
- data?: {
6632
- id: string;
6633
- meta?: {
6634
- [key: string]: unknown;
6635
- };
6636
- type: string;
6637
- } | null;
6638
- };
6653
+ [key: string]: never;
6639
6654
  };
6640
6655
  type: string;
6641
6656
  };
@@ -7546,18 +7561,6 @@ type Workspace = {
7546
7561
  * A relationships object for a workspace
7547
7562
  */
7548
7563
  relationships?: {
7549
- memberships?: {
7550
- /**
7551
- * Relationship data for memberships
7552
- */
7553
- data?: Array<{
7554
- id: string;
7555
- meta?: {
7556
- [key: string]: unknown;
7557
- };
7558
- type: string;
7559
- }>;
7560
- };
7561
7564
  tenant?: {
7562
7565
  /**
7563
7566
  * An identifier for tenant
@@ -7596,7 +7599,7 @@ type Invitation = {
7596
7599
  /**
7597
7600
  * Field included by default.
7598
7601
  */
7599
- inviter_id: string;
7602
+ inviter_id?: string | null | unknown;
7600
7603
  /**
7601
7604
  * Permissions to grant on acceptance. Field included by default.
7602
7605
  */
@@ -10831,22 +10834,6 @@ type CreateInvitationAttributes = {
10831
10834
  role?: string;
10832
10835
  [key: string]: unknown;
10833
10836
  };
10834
- /** Attributes accepted when creating a workspace membership. */
10835
- type CreateWorkspaceMembershipAttributes = {
10836
- user_id: string;
10837
- role?: string;
10838
- [key: string]: unknown;
10839
- };
10840
- /** Attributes accepted when updating a workspace membership (PATCH semantics). */
10841
- type UpdateWorkspaceMembershipAttributes = {
10842
- role?: string;
10843
- [key: string]: unknown;
10844
- };
10845
- /** Attributes accepted when updating a workspace member's profile. */
10846
- type UpdateMemberProfileAttributes = {
10847
- display_name?: string;
10848
- [key: string]: unknown;
10849
- };
10850
10837
  /** Attributes accepted when creating a config entry. */
10851
10838
  type CreateConfigAttributes = {
10852
10839
  key: string;
@@ -11581,175 +11568,6 @@ declare function createPlatformNamespace(rb: RequestBuilder): {
11581
11568
  */
11582
11569
  acceptByToken: (token: string, options?: RequestOptions) => Promise<Invitation>;
11583
11570
  };
11584
- /**
11585
- * Workspace Members — membership management within a workspace.
11586
- *
11587
- * Controls which users have access to a workspace and with what role.
11588
- * Use `create` to grant access, `update` to change role/permissions,
11589
- * and `remove` to revoke access.
11590
- */
11591
- workspaceMembers: {
11592
- /**
11593
- * List all members of a workspace.
11594
- *
11595
- * Returns `WorkspaceMembership` records for every user who has been
11596
- * granted access to the specified workspace.
11597
- *
11598
- * @param workspaceId - The UUID of the workspace to list members for.
11599
- * @param options - Optional page number, page size, and request options.
11600
- * @returns A page of `WorkspaceMembership` records.
11601
- *
11602
- * @example
11603
- * ```typescript
11604
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11605
- * const members = await client.platform.workspaceMembers.list('ws_abc123');
11606
- * members.forEach(m => console.log(m.attributes?.user_id, m.attributes?.role));
11607
- * ```
11608
- */
11609
- list: (workspaceId: string, options?: {
11610
- page?: number;
11611
- pageSize?: number;
11612
- } & RequestOptions) => Promise<WorkspaceMembership[]>;
11613
- /**
11614
- * List workspace members with user profile data (name, email, avatar) included.
11615
- *
11616
- * Equivalent to `list()` with `?include=user,user.profile` appended. Each
11617
- * membership in the response will have `relationships.user` and nested
11618
- * `user.relationships.profile` populated in the JSON:API `included` array.
11619
- *
11620
- * The `RequestBuilder` flattens included relationships automatically, so
11621
- * each membership object will have `user` and `user.profile` accessible.
11622
- *
11623
- * @param workspaceId - The UUID of the workspace to list members for.
11624
- * @param options - Optional page number, page size, and request options.
11625
- * @returns A page of `WorkspaceMembership` records with embedded user + profile.
11626
- *
11627
- * @example
11628
- * ```typescript
11629
- * const members = await client.platform.workspaceMembers.listWithProfiles('ws_abc123');
11630
- * members.forEach(m => {
11631
- * console.log(m.attributes?.user_id, m.attributes?.role);
11632
- * // Profile fields come from included relationships
11633
- * });
11634
- * ```
11635
- */
11636
- listWithProfiles: (workspaceId: string, options?: {
11637
- page?: number;
11638
- pageSize?: number;
11639
- } & RequestOptions) => Promise<WorkspaceMembership[]>;
11640
- /**
11641
- * Retrieve the membership record for a specific user within a workspace.
11642
- *
11643
- * @param workspaceId - The UUID of the workspace.
11644
- * @param memberId - The UUID of the user (member) to look up.
11645
- * @param options - Optional request options.
11646
- * @returns The matching `WorkspaceMembership` record.
11647
- *
11648
- * @example
11649
- * ```typescript
11650
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11651
- * const membership = await client.platform.workspaceMembers.get(
11652
- * 'ws_abc123',
11653
- * 'user_xyz',
11654
- * );
11655
- * console.log(membership.attributes?.role);
11656
- * ```
11657
- */
11658
- get: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<WorkspaceMembership>;
11659
- /**
11660
- * Add a user to a workspace.
11661
- *
11662
- * Grants the specified user access to the workspace with the given role.
11663
- * Typical attrs: `user_id`, `role` (e.g., `"member"`, `"admin"`).
11664
- *
11665
- * @param workspaceId - The UUID of the workspace to add the user to.
11666
- * @param attrs - Membership attributes including `user_id` and `role`.
11667
- * @param options - Optional request options.
11668
- * @returns The newly created `WorkspaceMembership`.
11669
- *
11670
- * @example
11671
- * ```typescript
11672
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11673
- * const membership = await client.platform.workspaceMembers.create(
11674
- * 'ws_abc123',
11675
- * { user_id: 'user_xyz', role: 'member' },
11676
- * );
11677
- * console.log('Member added:', membership.id);
11678
- * ```
11679
- */
11680
- create: (workspaceId: string, attrs: CreateWorkspaceMembershipAttributes, options?: RequestOptions) => Promise<WorkspaceMembership>;
11681
- /**
11682
- * Update a workspace member's role or permissions.
11683
- *
11684
- * Changes the member's role within the workspace (e.g., promote to
11685
- * `"admin"` or demote to `"member"`). Also used to update any other
11686
- * membership-level settings.
11687
- *
11688
- * @param workspaceId - The UUID of the workspace.
11689
- * @param memberId - The UUID of the user whose membership to update.
11690
- * @param attrs - Attribute map of fields to change, typically `{ role }`.
11691
- * @param options - Optional request options.
11692
- * @returns The updated `WorkspaceMembership`.
11693
- *
11694
- * @example
11695
- * ```typescript
11696
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11697
- * const membership = await client.platform.workspaceMembers.update(
11698
- * 'ws_abc123',
11699
- * 'user_xyz',
11700
- * { role: 'admin' },
11701
- * );
11702
- * ```
11703
- */
11704
- update: (workspaceId: string, memberId: string, attrs: UpdateWorkspaceMembershipAttributes, options?: RequestOptions) => Promise<WorkspaceMembership>;
11705
- /**
11706
- * Update a workspace member's profile attributes.
11707
- *
11708
- * Sets per-member profile data within the workspace context (e.g.,
11709
- * display name, avatar URL, specialty, or other ISV-defined profile fields).
11710
- * Profile attributes are stored in a JSONB column and are distinct from
11711
- * role/permission settings.
11712
- *
11713
- * @param workspaceId - The UUID of the workspace.
11714
- * @param memberId - The UUID of the user whose profile to update.
11715
- * @param profileAttrs - Key-value pairs to merge into the member's profile.
11716
- * @param options - Optional request options.
11717
- * @returns The updated `WorkspaceMembership` with new profile data.
11718
- *
11719
- * @example
11720
- * ```typescript
11721
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11722
- * const membership = await client.platform.workspaceMembers.updateProfile(
11723
- * 'ws_abc123',
11724
- * 'user_xyz',
11725
- * {
11726
- * display_name: 'Dr. Jane Smith',
11727
- * specialty: 'Cardiology',
11728
- * },
11729
- * );
11730
- * ```
11731
- */
11732
- updateProfile: (workspaceId: string, memberId: string, profileAttrs: UpdateMemberProfileAttributes, options?: RequestOptions) => Promise<WorkspaceMembership>;
11733
- /**
11734
- * Remove a user from a workspace.
11735
- *
11736
- * Revokes the user's access to the workspace by deleting their membership
11737
- * record. The user's data within the workspace is not deleted; only their
11738
- * access is removed.
11739
- *
11740
- * @param workspaceId - The UUID of the workspace.
11741
- * @param memberId - The UUID of the user to remove from the workspace.
11742
- * @param options - Optional request options.
11743
- * @returns `true` on successful removal.
11744
- *
11745
- * @example
11746
- * ```typescript
11747
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11748
- * await client.platform.workspaceMembers.remove('ws_abc123', 'user_xyz');
11749
- * ```
11750
- */
11751
- remove: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<true>;
11752
- };
11753
11571
  /**
11754
11572
  * Configs — application-level configuration key-value entries.
11755
11573
  *
@@ -11819,52 +11637,120 @@ declare function createPlatformNamespace(rb: RequestBuilder): {
11819
11637
  update: (key: string, attributes: UpdateConfigAttributes, options?: RequestOptions) => Promise<Config>;
11820
11638
  };
11821
11639
  /**
11822
- * Tenant Members manage tenant-level membership (org roles).
11640
+ * Rolesnamed permission bundles for workspace access control.
11823
11641
  *
11824
- * TenantMembership records represent a user's role within a tenant.
11825
- * Roles are either `"admin"` or `"member"`.
11642
+ * Access via `client.platform.roles`.
11826
11643
  */
11827
- tenantMembers: {
11644
+ roles: {
11828
11645
  /**
11829
- * List members of a tenant (paginated).
11646
+ * List all roles for the current application.
11830
11647
  *
11831
- * @param tenantId - The UUID of the tenant.
11832
- * @param options - Optional page number, page size, and request options.
11833
- * @returns A page of `TenantMembership` records.
11648
+ * @returns Paginated list of roles
11649
+ * @example
11650
+ * const roles = await client.platform.roles.list();
11834
11651
  */
11835
- list: (tenantId: string, options?: {
11836
- page?: number;
11837
- pageSize?: number;
11838
- } & RequestOptions) => Promise<TenantMembership[]>;
11652
+ list: () => Promise<{
11653
+ data?: Array<Role>;
11654
+ }>;
11839
11655
  /**
11840
- * Add a user to a tenant with the given role.
11656
+ * Create a new role with a set of permissions.
11841
11657
  *
11842
- * @param tenantId - The UUID of the tenant.
11843
- * @param userId - The UUID of the user to add.
11844
- * @param role - The role to assign (`"admin"` or `"member"`).
11845
- * @param options - Optional request options.
11846
- * @returns The created `TenantMembership`.
11658
+ * @param name - Human-readable role name
11659
+ * @param permissions - List of permission strings (e.g. "extract:document:read:all")
11660
+ * @returns The created role
11661
+ * @example
11662
+ * const role = await client.platform.roles.create("Editor", ["extract:document:read:all"]);
11847
11663
  */
11848
- create: (tenantId: string, userId: string, role: string, options?: RequestOptions) => Promise<TenantMembership>;
11664
+ create: (name: string, permissions: string[]) => Promise<{
11665
+ data?: Role;
11666
+ }>;
11849
11667
  /**
11850
- * Change a member's role within a tenant.
11668
+ * Update an existing role.
11851
11669
  *
11852
- * @param tenantId - The UUID of the tenant.
11853
- * @param userId - The UUID of the user.
11854
- * @param role - The new role (`"admin"` or `"member"`).
11855
- * @param options - Optional request options.
11856
- * @returns The updated `TenantMembership`.
11670
+ * @param id - Role UUID
11671
+ * @param attributes - Attributes to update (name, permissions)
11672
+ * @returns The updated role
11673
+ * @example
11674
+ * const updated = await client.platform.roles.update("role-uuid", { name: "Senior Editor" });
11675
+ */
11676
+ update: (id: string, attributes: Partial<{
11677
+ name: string;
11678
+ permissions: string[];
11679
+ }>) => Promise<{
11680
+ data?: Role;
11681
+ }>;
11682
+ /**
11683
+ * Delete a role.
11684
+ *
11685
+ * @param id - Role UUID
11686
+ * @example
11687
+ * await client.platform.roles.destroy("role-uuid");
11857
11688
  */
11858
- updateRole: (tenantId: string, userId: string, role: string, options?: RequestOptions) => Promise<TenantMembership>;
11689
+ destroy: (id: string) => Promise<void>;
11690
+ };
11691
+ /**
11692
+ * Permissions — permission registry, presets, and metadata.
11693
+ *
11694
+ * Access via `client.platform.permissions`.
11695
+ */
11696
+ permissions: {
11859
11697
  /**
11860
- * Remove a user from a tenant.
11698
+ * List all available permissions for the current application context.
11861
11699
  *
11862
- * @param tenantId - The UUID of the tenant.
11863
- * @param userId - The UUID of the user to remove.
11864
- * @param options - Optional request options.
11865
- * @returns `true` on success.
11700
+ * @param params - Optional filter parameters (context, app, category)
11701
+ * @returns List of permissions
11702
+ * @example
11703
+ * const perms = await client.platform.permissions.list();
11704
+ */
11705
+ list: (params?: Record<string, string>) => Promise<{
11706
+ data?: Array<Permission>;
11707
+ }>;
11708
+ /**
11709
+ * Get a single permission by ID.
11710
+ *
11711
+ * @param id - Permission ID string
11712
+ * @returns The permission record
11713
+ * @example
11714
+ * const perm = await client.platform.permissions.get("extract:document:read:all");
11866
11715
  */
11867
- remove: (tenantId: string, userId: string, options?: RequestOptions) => Promise<true>;
11716
+ get: (id: string) => Promise<{
11717
+ data?: Permission;
11718
+ }>;
11719
+ /**
11720
+ * Get permission metadata (available contexts, apps, and categories).
11721
+ *
11722
+ * @returns Permission metadata
11723
+ * @example
11724
+ * const meta = await client.platform.permissions.meta();
11725
+ */
11726
+ meta: () => Promise<unknown>;
11727
+ /**
11728
+ * Permission presets — pre-built permission sets per role type.
11729
+ */
11730
+ presets: {
11731
+ /**
11732
+ * List all permission presets, optionally filtered by context or app.
11733
+ *
11734
+ * @param params - Optional filter parameters (context, app)
11735
+ * @returns List of permission presets
11736
+ * @example
11737
+ * const presets = await client.platform.permissions.presets.list({ context: "workspace" });
11738
+ */
11739
+ list: (params?: Record<string, string>) => Promise<{
11740
+ data?: Array<PermissionPreset>;
11741
+ }>;
11742
+ /**
11743
+ * Get a single permission preset by ID.
11744
+ *
11745
+ * @param id - Preset ID string
11746
+ * @returns The permission preset
11747
+ * @example
11748
+ * const preset = await client.platform.permissions.presets.get("workspace_editor");
11749
+ */
11750
+ get: (id: string) => Promise<{
11751
+ data?: PermissionPreset;
11752
+ }>;
11753
+ };
11868
11754
  };
11869
11755
  };
11870
11756
 
@@ -19364,21 +19250,6 @@ declare class GptClient extends BaseClient {
19364
19250
  consumeByToken: (token: string, options?: RequestOptions) => Promise<Invitation | null>;
19365
19251
  acceptByToken: (token: string, options?: RequestOptions) => Promise<Invitation>;
19366
19252
  };
19367
- workspaceMembers: {
19368
- list: (workspaceId: string, options?: {
19369
- page?: number;
19370
- pageSize?: number;
19371
- } & RequestOptions) => Promise<WorkspaceMembership[]>;
19372
- listWithProfiles: (workspaceId: string, options?: {
19373
- page?: number;
19374
- pageSize?: number;
19375
- } & RequestOptions) => Promise<WorkspaceMembership[]>;
19376
- get: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<WorkspaceMembership>;
19377
- create: (workspaceId: string, attrs: CreateWorkspaceMembershipAttributes, options?: RequestOptions) => Promise<WorkspaceMembership>;
19378
- update: (workspaceId: string, memberId: string, attrs: UpdateWorkspaceMembershipAttributes, options?: RequestOptions) => Promise<WorkspaceMembership>;
19379
- updateProfile: (workspaceId: string, memberId: string, profileAttrs: UpdateMemberProfileAttributes, options?: RequestOptions) => Promise<WorkspaceMembership>;
19380
- remove: (workspaceId: string, memberId: string, options?: RequestOptions) => Promise<true>;
19381
- };
19382
19253
  configs: {
19383
19254
  list: (options?: {
19384
19255
  page?: number;
@@ -19387,14 +19258,37 @@ declare class GptClient extends BaseClient {
19387
19258
  create: (attributes: CreateConfigAttributes, options?: RequestOptions) => Promise<Config>;
19388
19259
  update: (key: string, attributes: UpdateConfigAttributes, options?: RequestOptions) => Promise<Config>;
19389
19260
  };
19390
- tenantMembers: {
19391
- list: (tenantId: string, options?: {
19392
- page?: number;
19393
- pageSize?: number;
19394
- } & RequestOptions) => Promise<TenantMembership[]>;
19395
- create: (tenantId: string, userId: string, role: string, options?: RequestOptions) => Promise<TenantMembership>;
19396
- updateRole: (tenantId: string, userId: string, role: string, options?: RequestOptions) => Promise<TenantMembership>;
19397
- remove: (tenantId: string, userId: string, options?: RequestOptions) => Promise<true>;
19261
+ roles: {
19262
+ list: () => Promise<{
19263
+ data?: Array<Role>;
19264
+ }>;
19265
+ create: (name: string, permissions: string[]) => Promise<{
19266
+ data?: Role;
19267
+ }>;
19268
+ update: (id: string, attributes: Partial<{
19269
+ name: string;
19270
+ permissions: string[];
19271
+ }>) => Promise<{
19272
+ data?: Role;
19273
+ }>;
19274
+ destroy: (id: string) => Promise<void>;
19275
+ };
19276
+ permissions: {
19277
+ list: (params?: Record<string, string>) => Promise<{
19278
+ data?: Array<Permission>;
19279
+ }>;
19280
+ get: (id: string) => Promise<{
19281
+ data?: Permission;
19282
+ }>;
19283
+ meta: () => Promise<unknown>;
19284
+ presets: {
19285
+ list: (params?: Record<string, string>) => Promise<{
19286
+ data?: Array<PermissionPreset>;
19287
+ }>;
19288
+ get: (id: string) => Promise<{
19289
+ data?: PermissionPreset;
19290
+ }>;
19291
+ };
19398
19292
  };
19399
19293
  };
19400
19294
  /** Event types, scheduled events, bookings, participants, and calendar sync */
@@ -19958,4 +19852,4 @@ type SchedulingAPI = ReturnType<typeof createSchedulingNamespace>;
19958
19852
  type VoiceAPI = ReturnType<typeof createVoiceNamespace>;
19959
19853
  type ModelsAPI = ReturnType<typeof createModelsNamespace>;
19960
19854
 
19961
- export { API_KEY_PREFIXES, type AgentsAPI, type AiAPI, type ApiKey, type AppInfo, type ApprovalRequiredEvent, type AttributeFilter$1 as AttributeFilter, AuthenticationError, AuthorizationError, type BaseClientConfig, type BillingAPI, type BillingAccount, BrowserApiKeyError, type BuyAddonAttributes, type CampaignsAPI, CardDeclinedError, type CommunicationAPI, type ComposeWithAiAttributes, ConflictError, type CreditPackage, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DoneEvent, type EmailAPI, type ErrorEvent, type Execution, type ExecutionEvent, type ExtractionAPI, type ExtractionRowQueryParams, type ExtractionRowQueryResult, type FeatureDefinition, type FeatureUsage, GptClient, GptCoreError, type IdentityAPI, InsecureConnectionError, type Invitation, type Invoice, type IterationCompleteEvent, LOG_LEVELS, type ListModelsOptions, type LogLevel, type Logger, type MjmlCompileResult, type ModelInfo, type ModelTier, type ModelsAPI, NetworkError, NotFoundError, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PaymentMethod, type PaymentMethodCreateAttributes, type PaymentMethodTokenizeAttributes, type PaymentMethodUpdateAttributes, PaymentRequiredError, type Plan, type PlanFeatureAllocation, type PlatformAPI, RateLimitError, RequestBuilder, type RequestOptions, type RetryConfig, RetryTimeoutError, SDK_VERSION, type SchedulingAPI, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SeatInfo, type SecurityConfig, ServerError, type SessionNoteType, type SessionNoteValue, type StorageAPI, type StreamMessageChunk, type StreamOptions, SubscriptionConflictError, type TemplateVariableSchema, type TemplateVersion, type Tenant, type TenantMembership, type ThreadsAPI, TimeoutError, type TokenDeltaEvent, type ToolCallEvent, type ToolResultEvent, type Transaction, type TriggerPipelineAttributes, type UpdateFeatureDefinitionAttributes, type UsageHistoryEntry, type User, type UserProfile, ValidationError, type VoiceAPI, type VoiceFinalizeOptions, type VoiceRecording, type VoiceSession, type VoiceSessionStart, type VoiceStartOptions, type VoiceTranscribeOptions, type VoiceTranscribeResult, type VoiceTranscriptionResult, type Wallet, type WalletPaymentMethod, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, type Workspace, type WorkspaceMembership, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
19855
+ export { API_KEY_PREFIXES, type AccessGrant, type AgentsAPI, type AiAPI, type ApiKey, type AppInfo, type ApprovalRequiredEvent, type AttributeFilter$1 as AttributeFilter, AuthenticationError, AuthorizationError, type BaseClientConfig, type BillingAPI, type BillingAccount, BrowserApiKeyError, type BuyAddonAttributes, type CampaignsAPI, CardDeclinedError, type CommunicationAPI, type ComposeWithAiAttributes, ConflictError, type CreditPackage, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DoneEvent, type EmailAPI, type ErrorEvent, type Execution, type ExecutionEvent, type ExtractionAPI, type ExtractionRowQueryParams, type ExtractionRowQueryResult, type FeatureDefinition, type FeatureUsage, GptClient, GptCoreError, type IdentityAPI, InsecureConnectionError, type Invitation, type Invoice, type IterationCompleteEvent, LOG_LEVELS, type ListModelsOptions, type LogLevel, type Logger, type MjmlCompileResult, type ModelInfo, type ModelTier, type ModelsAPI, NetworkError, NotFoundError, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PaymentMethod, type PaymentMethodCreateAttributes, type PaymentMethodTokenizeAttributes, type PaymentMethodUpdateAttributes, PaymentRequiredError, type Plan, type PlanFeatureAllocation, type PlatformAPI, RateLimitError, RequestBuilder, type RequestOptions, type RetryConfig, RetryTimeoutError, SDK_VERSION, type SchedulingAPI, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SeatInfo, type SecurityConfig, ServerError, type SessionNoteType, type SessionNoteValue, type StorageAPI, type StreamMessageChunk, type StreamOptions, SubscriptionConflictError, type TemplateVariableSchema, type TemplateVersion, type Tenant, type ThreadsAPI, TimeoutError, type TokenDeltaEvent, type ToolCallEvent, type ToolResultEvent, type Transaction, type TriggerPipelineAttributes, type UpdateFeatureDefinitionAttributes, type UsageHistoryEntry, type User, type UserProfile, ValidationError, type VoiceAPI, type VoiceFinalizeOptions, type VoiceRecording, type VoiceSession, type VoiceSessionStart, type VoiceStartOptions, type VoiceTranscribeOptions, type VoiceTranscribeResult, type VoiceTranscriptionResult, type Wallet, type WalletPaymentMethod, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, type Workspace, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };