@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 +294 -400
- package/dist/index.d.ts +294 -400
- package/dist/index.js +167 -381
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +167 -381
- package/dist/index.mjs.map +1 -1
- package/llms.txt +12 -22
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1269,8 +1269,8 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1269
1269
|
}
|
|
1270
1270
|
|
|
1271
1271
|
// src/version.ts
|
|
1272
|
-
var SDK_VERSION = "0.6.
|
|
1273
|
-
var DEFAULT_API_VERSION = "2026-03-
|
|
1272
|
+
var SDK_VERSION = "0.6.3";
|
|
1273
|
+
var DEFAULT_API_VERSION = "2026-03-11";
|
|
1274
1274
|
|
|
1275
1275
|
// src/base-client.ts
|
|
1276
1276
|
function generateUUID() {
|
|
@@ -1838,15 +1838,6 @@ var getApplicationsCurrent = (options) => (options.client ?? client).get({
|
|
|
1838
1838
|
url: "/applications/current",
|
|
1839
1839
|
...options
|
|
1840
1840
|
});
|
|
1841
|
-
var patchWorkspaceMembershipsByWorkspaceIdByUserIdProfile = (options) => (options.client ?? client).patch({
|
|
1842
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1843
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}/profile",
|
|
1844
|
-
...options,
|
|
1845
|
-
headers: {
|
|
1846
|
-
"Content-Type": "application/vnd.api+json",
|
|
1847
|
-
...options.headers
|
|
1848
|
-
}
|
|
1849
|
-
});
|
|
1850
1841
|
var postInvitationsAcceptByToken = (options) => (options.client ?? client).post({
|
|
1851
1842
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1852
1843
|
url: "/invitations/accept-by-token",
|
|
@@ -2747,6 +2738,11 @@ var getSocialMetricsAccountBySocialAccountId = (options) => (options.client ?? c
|
|
|
2747
2738
|
url: "/social/metrics/account/{social_account_id}",
|
|
2748
2739
|
...options
|
|
2749
2740
|
});
|
|
2741
|
+
var getPermissionsMeta = (options) => (options.client ?? client).get({
|
|
2742
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2743
|
+
url: "/permissions/meta",
|
|
2744
|
+
...options
|
|
2745
|
+
});
|
|
2750
2746
|
var getEmailMarketingGeneratedEmailsById = (options) => (options.client ?? client).get({
|
|
2751
2747
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2752
2748
|
url: "/email-marketing/generated-emails/{id}",
|
|
@@ -3133,20 +3129,6 @@ var getSchedulingBookingsById = (options) => (options.client ?? client).get({
|
|
|
3133
3129
|
url: "/scheduling/bookings/{id}",
|
|
3134
3130
|
...options
|
|
3135
3131
|
});
|
|
3136
|
-
var getTenantMemberships = (options) => (options.client ?? client).get({
|
|
3137
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
3138
|
-
url: "/tenant-memberships",
|
|
3139
|
-
...options
|
|
3140
|
-
});
|
|
3141
|
-
var postTenantMemberships = (options) => (options.client ?? client).post({
|
|
3142
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
3143
|
-
url: "/tenant-memberships",
|
|
3144
|
-
...options,
|
|
3145
|
-
headers: {
|
|
3146
|
-
"Content-Type": "application/vnd.api+json",
|
|
3147
|
-
...options.headers
|
|
3148
|
-
}
|
|
3149
|
-
});
|
|
3150
3132
|
var getLlmAnalytics = (options) => (options.client ?? client).get({
|
|
3151
3133
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3152
3134
|
url: "/llm-analytics",
|
|
@@ -3586,6 +3568,20 @@ var patchVoiceSessionsByIdFinalize = (options) => (options.client ?? client).pat
|
|
|
3586
3568
|
...options.headers
|
|
3587
3569
|
}
|
|
3588
3570
|
});
|
|
3571
|
+
var getRoles = (options) => (options.client ?? client).get({
|
|
3572
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3573
|
+
url: "/roles",
|
|
3574
|
+
...options
|
|
3575
|
+
});
|
|
3576
|
+
var postRoles = (options) => (options.client ?? client).post({
|
|
3577
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3578
|
+
url: "/roles",
|
|
3579
|
+
...options,
|
|
3580
|
+
headers: {
|
|
3581
|
+
"Content-Type": "application/vnd.api+json",
|
|
3582
|
+
...options.headers
|
|
3583
|
+
}
|
|
3584
|
+
});
|
|
3589
3585
|
var deleteProcessingActivitiesById = (options) => (options.client ?? client).delete({
|
|
3590
3586
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3591
3587
|
url: "/processing-activities/{id}",
|
|
@@ -4515,6 +4511,11 @@ var getWalletSeats = (options) => (options.client ?? client).get({
|
|
|
4515
4511
|
url: "/wallet/seats",
|
|
4516
4512
|
...options
|
|
4517
4513
|
});
|
|
4514
|
+
var getPermissions = (options) => (options.client ?? client).get({
|
|
4515
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4516
|
+
url: "/permissions",
|
|
4517
|
+
...options
|
|
4518
|
+
});
|
|
4518
4519
|
var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ?? client).patch({
|
|
4519
4520
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4520
4521
|
url: "/email/outbound-emails/{id}/cancel-schedule",
|
|
@@ -4787,20 +4788,6 @@ var patchConnectorsById = (options) => (options.client ?? client).patch({
|
|
|
4787
4788
|
...options.headers
|
|
4788
4789
|
}
|
|
4789
4790
|
});
|
|
4790
|
-
var getWorkspaceMemberships = (options) => (options.client ?? client).get({
|
|
4791
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
4792
|
-
url: "/workspace-memberships",
|
|
4793
|
-
...options
|
|
4794
|
-
});
|
|
4795
|
-
var postWorkspaceMemberships = (options) => (options.client ?? client).post({
|
|
4796
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
4797
|
-
url: "/workspace-memberships",
|
|
4798
|
-
...options,
|
|
4799
|
-
headers: {
|
|
4800
|
-
"Content-Type": "application/vnd.api+json",
|
|
4801
|
-
...options.headers
|
|
4802
|
-
}
|
|
4803
|
-
});
|
|
4804
4791
|
var getTenantsByTenantIdDocumentStats = (options) => (options.client ?? client).get({
|
|
4805
4792
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4806
4793
|
url: "/tenants/{tenant_id}/document_stats",
|
|
@@ -4830,6 +4817,16 @@ var patchVoiceTranscriptionResultsById = (options) => (options.client ?? client)
|
|
|
4830
4817
|
...options.headers
|
|
4831
4818
|
}
|
|
4832
4819
|
});
|
|
4820
|
+
var getPermissionsPresetsById = (options) => (options.client ?? client).get({
|
|
4821
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4822
|
+
url: "/permissions/presets/{id}",
|
|
4823
|
+
...options
|
|
4824
|
+
});
|
|
4825
|
+
var getPermissionsPresets = (options) => (options.client ?? client).get({
|
|
4826
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4827
|
+
url: "/permissions/presets",
|
|
4828
|
+
...options
|
|
4829
|
+
});
|
|
4833
4830
|
var deleteFieldTemplatesById = (options) => (options.client ?? client).delete({
|
|
4834
4831
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4835
4832
|
url: "/field-templates/{id}",
|
|
@@ -4915,6 +4912,11 @@ var patchApiKeysByIdSetBudget = (options) => (options.client ?? client).patch({
|
|
|
4915
4912
|
...options.headers
|
|
4916
4913
|
}
|
|
4917
4914
|
});
|
|
4915
|
+
var getPermissionsById = (options) => (options.client ?? client).get({
|
|
4916
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4917
|
+
url: "/permissions/{id}",
|
|
4918
|
+
...options
|
|
4919
|
+
});
|
|
4918
4920
|
var getExtractionDocumentsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
|
|
4919
4921
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4920
4922
|
url: "/extraction/documents/workspace/{workspace_id}",
|
|
@@ -5059,20 +5061,6 @@ var patchCrawlerSchedulesByIdEnable = (options) => (options.client ?? client).pa
|
|
|
5059
5061
|
...options.headers
|
|
5060
5062
|
}
|
|
5061
5063
|
});
|
|
5062
|
-
var deleteTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).delete({
|
|
5063
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5064
|
-
url: "/tenant-memberships/{tenant_id}/{user_id}",
|
|
5065
|
-
...options
|
|
5066
|
-
});
|
|
5067
|
-
var patchTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).patch({
|
|
5068
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5069
|
-
url: "/tenant-memberships/{tenant_id}/{user_id}",
|
|
5070
|
-
...options,
|
|
5071
|
-
headers: {
|
|
5072
|
-
"Content-Type": "application/vnd.api+json",
|
|
5073
|
-
...options.headers
|
|
5074
|
-
}
|
|
5075
|
-
});
|
|
5076
5064
|
var getEmailInboundReceivedById = (options) => (options.client ?? client).get({
|
|
5077
5065
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5078
5066
|
url: "/email/inbound/received/{id}",
|
|
@@ -5149,6 +5137,20 @@ var postAiMessages = (options) => (options.client ?? client).post({
|
|
|
5149
5137
|
...options.headers
|
|
5150
5138
|
}
|
|
5151
5139
|
});
|
|
5140
|
+
var deleteRolesById = (options) => (options.client ?? client).delete({
|
|
5141
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5142
|
+
url: "/roles/{id}",
|
|
5143
|
+
...options
|
|
5144
|
+
});
|
|
5145
|
+
var patchRolesById = (options) => (options.client ?? client).patch({
|
|
5146
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5147
|
+
url: "/roles/{id}",
|
|
5148
|
+
...options,
|
|
5149
|
+
headers: {
|
|
5150
|
+
"Content-Type": "application/vnd.api+json",
|
|
5151
|
+
...options.headers
|
|
5152
|
+
}
|
|
5153
|
+
});
|
|
5152
5154
|
var getWatcherEvents = (options) => (options.client ?? client).get({
|
|
5153
5155
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5154
5156
|
url: "/watcher/events",
|
|
@@ -5617,25 +5619,6 @@ var getAgentVersionRevisions = (options) => (options.client ?? client).get({
|
|
|
5617
5619
|
url: "/agent-version-revisions",
|
|
5618
5620
|
...options
|
|
5619
5621
|
});
|
|
5620
|
-
var deleteWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).delete({
|
|
5621
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5622
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}",
|
|
5623
|
-
...options
|
|
5624
|
-
});
|
|
5625
|
-
var getWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).get({
|
|
5626
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5627
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}",
|
|
5628
|
-
...options
|
|
5629
|
-
});
|
|
5630
|
-
var patchWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).patch({
|
|
5631
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5632
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}",
|
|
5633
|
-
...options,
|
|
5634
|
-
headers: {
|
|
5635
|
-
"Content-Type": "application/vnd.api+json",
|
|
5636
|
-
...options.headers
|
|
5637
|
-
}
|
|
5638
|
-
});
|
|
5639
5622
|
var postTrainingExamplesBulkDelete = (options) => (options.client ?? client).post({
|
|
5640
5623
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5641
5624
|
url: "/training-examples/bulk-delete",
|
|
@@ -19071,246 +19054,6 @@ function createPlatformNamespace(rb) {
|
|
|
19071
19054
|
);
|
|
19072
19055
|
}
|
|
19073
19056
|
},
|
|
19074
|
-
/**
|
|
19075
|
-
* Workspace Members — membership management within a workspace.
|
|
19076
|
-
*
|
|
19077
|
-
* Controls which users have access to a workspace and with what role.
|
|
19078
|
-
* Use `create` to grant access, `update` to change role/permissions,
|
|
19079
|
-
* and `remove` to revoke access.
|
|
19080
|
-
*/
|
|
19081
|
-
workspaceMembers: {
|
|
19082
|
-
/**
|
|
19083
|
-
* List all members of a workspace.
|
|
19084
|
-
*
|
|
19085
|
-
* Returns `WorkspaceMembership` records for every user who has been
|
|
19086
|
-
* granted access to the specified workspace.
|
|
19087
|
-
*
|
|
19088
|
-
* @param workspaceId - The UUID of the workspace to list members for.
|
|
19089
|
-
* @param options - Optional page number, page size, and request options.
|
|
19090
|
-
* @returns A page of `WorkspaceMembership` records.
|
|
19091
|
-
*
|
|
19092
|
-
* @example
|
|
19093
|
-
* ```typescript
|
|
19094
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19095
|
-
* const members = await client.platform.workspaceMembers.list('ws_abc123');
|
|
19096
|
-
* members.forEach(m => console.log(m.attributes?.user_id, m.attributes?.role));
|
|
19097
|
-
* ```
|
|
19098
|
-
*/
|
|
19099
|
-
list: async (workspaceId, options) => {
|
|
19100
|
-
return rb.execute(
|
|
19101
|
-
getWorkspaceMemberships,
|
|
19102
|
-
{
|
|
19103
|
-
query: {
|
|
19104
|
-
filter: { workspace_id: workspaceId },
|
|
19105
|
-
...buildPageQuery(options?.page, options?.pageSize)?.query
|
|
19106
|
-
}
|
|
19107
|
-
},
|
|
19108
|
-
options
|
|
19109
|
-
);
|
|
19110
|
-
},
|
|
19111
|
-
/**
|
|
19112
|
-
* List workspace members with user profile data (name, email, avatar) included.
|
|
19113
|
-
*
|
|
19114
|
-
* Equivalent to `list()` with `?include=user,user.profile` appended. Each
|
|
19115
|
-
* membership in the response will have `relationships.user` and nested
|
|
19116
|
-
* `user.relationships.profile` populated in the JSON:API `included` array.
|
|
19117
|
-
*
|
|
19118
|
-
* The `RequestBuilder` flattens included relationships automatically, so
|
|
19119
|
-
* each membership object will have `user` and `user.profile` accessible.
|
|
19120
|
-
*
|
|
19121
|
-
* @param workspaceId - The UUID of the workspace to list members for.
|
|
19122
|
-
* @param options - Optional page number, page size, and request options.
|
|
19123
|
-
* @returns A page of `WorkspaceMembership` records with embedded user + profile.
|
|
19124
|
-
*
|
|
19125
|
-
* @example
|
|
19126
|
-
* ```typescript
|
|
19127
|
-
* const members = await client.platform.workspaceMembers.listWithProfiles('ws_abc123');
|
|
19128
|
-
* members.forEach(m => {
|
|
19129
|
-
* console.log(m.attributes?.user_id, m.attributes?.role);
|
|
19130
|
-
* // Profile fields come from included relationships
|
|
19131
|
-
* });
|
|
19132
|
-
* ```
|
|
19133
|
-
*/
|
|
19134
|
-
listWithProfiles: async (workspaceId, options) => {
|
|
19135
|
-
return rb.execute(
|
|
19136
|
-
getWorkspaceMemberships,
|
|
19137
|
-
{
|
|
19138
|
-
query: {
|
|
19139
|
-
filter: { workspace_id: workspaceId },
|
|
19140
|
-
include: "user,user.profile",
|
|
19141
|
-
...buildPageQuery(options?.page, options?.pageSize)?.query
|
|
19142
|
-
}
|
|
19143
|
-
},
|
|
19144
|
-
options
|
|
19145
|
-
);
|
|
19146
|
-
},
|
|
19147
|
-
/**
|
|
19148
|
-
* Retrieve the membership record for a specific user within a workspace.
|
|
19149
|
-
*
|
|
19150
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19151
|
-
* @param memberId - The UUID of the user (member) to look up.
|
|
19152
|
-
* @param options - Optional request options.
|
|
19153
|
-
* @returns The matching `WorkspaceMembership` record.
|
|
19154
|
-
*
|
|
19155
|
-
* @example
|
|
19156
|
-
* ```typescript
|
|
19157
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19158
|
-
* const membership = await client.platform.workspaceMembers.get(
|
|
19159
|
-
* 'ws_abc123',
|
|
19160
|
-
* 'user_xyz',
|
|
19161
|
-
* );
|
|
19162
|
-
* console.log(membership.attributes?.role);
|
|
19163
|
-
* ```
|
|
19164
|
-
*/
|
|
19165
|
-
get: async (workspaceId, memberId, options) => {
|
|
19166
|
-
return rb.execute(
|
|
19167
|
-
getWorkspaceMembershipsByWorkspaceIdByUserId,
|
|
19168
|
-
{ path: { workspace_id: workspaceId, user_id: memberId } },
|
|
19169
|
-
options
|
|
19170
|
-
);
|
|
19171
|
-
},
|
|
19172
|
-
/**
|
|
19173
|
-
* Add a user to a workspace.
|
|
19174
|
-
*
|
|
19175
|
-
* Grants the specified user access to the workspace with the given role.
|
|
19176
|
-
* Typical attrs: `user_id`, `role` (e.g., `"member"`, `"admin"`).
|
|
19177
|
-
*
|
|
19178
|
-
* @param workspaceId - The UUID of the workspace to add the user to.
|
|
19179
|
-
* @param attrs - Membership attributes including `user_id` and `role`.
|
|
19180
|
-
* @param options - Optional request options.
|
|
19181
|
-
* @returns The newly created `WorkspaceMembership`.
|
|
19182
|
-
*
|
|
19183
|
-
* @example
|
|
19184
|
-
* ```typescript
|
|
19185
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19186
|
-
* const membership = await client.platform.workspaceMembers.create(
|
|
19187
|
-
* 'ws_abc123',
|
|
19188
|
-
* { user_id: 'user_xyz', role: 'member' },
|
|
19189
|
-
* );
|
|
19190
|
-
* console.log('Member added:', membership.id);
|
|
19191
|
-
* ```
|
|
19192
|
-
*/
|
|
19193
|
-
create: async (workspaceId, attrs, options) => {
|
|
19194
|
-
return rb.execute(
|
|
19195
|
-
postWorkspaceMemberships,
|
|
19196
|
-
{
|
|
19197
|
-
body: {
|
|
19198
|
-
data: {
|
|
19199
|
-
type: "workspace-membership",
|
|
19200
|
-
attributes: { workspace_id: workspaceId, ...attrs }
|
|
19201
|
-
}
|
|
19202
|
-
}
|
|
19203
|
-
},
|
|
19204
|
-
options
|
|
19205
|
-
);
|
|
19206
|
-
},
|
|
19207
|
-
/**
|
|
19208
|
-
* Update a workspace member's role or permissions.
|
|
19209
|
-
*
|
|
19210
|
-
* Changes the member's role within the workspace (e.g., promote to
|
|
19211
|
-
* `"admin"` or demote to `"member"`). Also used to update any other
|
|
19212
|
-
* membership-level settings.
|
|
19213
|
-
*
|
|
19214
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19215
|
-
* @param memberId - The UUID of the user whose membership to update.
|
|
19216
|
-
* @param attrs - Attribute map of fields to change, typically `{ role }`.
|
|
19217
|
-
* @param options - Optional request options.
|
|
19218
|
-
* @returns The updated `WorkspaceMembership`.
|
|
19219
|
-
*
|
|
19220
|
-
* @example
|
|
19221
|
-
* ```typescript
|
|
19222
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19223
|
-
* const membership = await client.platform.workspaceMembers.update(
|
|
19224
|
-
* 'ws_abc123',
|
|
19225
|
-
* 'user_xyz',
|
|
19226
|
-
* { role: 'admin' },
|
|
19227
|
-
* );
|
|
19228
|
-
* ```
|
|
19229
|
-
*/
|
|
19230
|
-
update: async (workspaceId, memberId, attrs, options) => {
|
|
19231
|
-
return rb.execute(
|
|
19232
|
-
patchWorkspaceMembershipsByWorkspaceIdByUserId,
|
|
19233
|
-
{
|
|
19234
|
-
path: { workspace_id: workspaceId, user_id: memberId },
|
|
19235
|
-
body: {
|
|
19236
|
-
data: {
|
|
19237
|
-
id: memberId,
|
|
19238
|
-
type: "workspace-membership",
|
|
19239
|
-
attributes: attrs
|
|
19240
|
-
}
|
|
19241
|
-
}
|
|
19242
|
-
},
|
|
19243
|
-
options
|
|
19244
|
-
);
|
|
19245
|
-
},
|
|
19246
|
-
/**
|
|
19247
|
-
* Update a workspace member's profile attributes.
|
|
19248
|
-
*
|
|
19249
|
-
* Sets per-member profile data within the workspace context (e.g.,
|
|
19250
|
-
* display name, avatar URL, specialty, or other ISV-defined profile fields).
|
|
19251
|
-
* Profile attributes are stored in a JSONB column and are distinct from
|
|
19252
|
-
* role/permission settings.
|
|
19253
|
-
*
|
|
19254
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19255
|
-
* @param memberId - The UUID of the user whose profile to update.
|
|
19256
|
-
* @param profileAttrs - Key-value pairs to merge into the member's profile.
|
|
19257
|
-
* @param options - Optional request options.
|
|
19258
|
-
* @returns The updated `WorkspaceMembership` with new profile data.
|
|
19259
|
-
*
|
|
19260
|
-
* @example
|
|
19261
|
-
* ```typescript
|
|
19262
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19263
|
-
* const membership = await client.platform.workspaceMembers.updateProfile(
|
|
19264
|
-
* 'ws_abc123',
|
|
19265
|
-
* 'user_xyz',
|
|
19266
|
-
* {
|
|
19267
|
-
* display_name: 'Dr. Jane Smith',
|
|
19268
|
-
* specialty: 'Cardiology',
|
|
19269
|
-
* },
|
|
19270
|
-
* );
|
|
19271
|
-
* ```
|
|
19272
|
-
*/
|
|
19273
|
-
updateProfile: async (workspaceId, memberId, profileAttrs, options) => {
|
|
19274
|
-
return rb.execute(
|
|
19275
|
-
patchWorkspaceMembershipsByWorkspaceIdByUserIdProfile,
|
|
19276
|
-
{
|
|
19277
|
-
path: { workspace_id: workspaceId, user_id: memberId },
|
|
19278
|
-
body: {
|
|
19279
|
-
data: {
|
|
19280
|
-
type: "workspace-membership",
|
|
19281
|
-
attributes: { profile_attributes: profileAttrs }
|
|
19282
|
-
}
|
|
19283
|
-
}
|
|
19284
|
-
},
|
|
19285
|
-
options
|
|
19286
|
-
);
|
|
19287
|
-
},
|
|
19288
|
-
/**
|
|
19289
|
-
* Remove a user from a workspace.
|
|
19290
|
-
*
|
|
19291
|
-
* Revokes the user's access to the workspace by deleting their membership
|
|
19292
|
-
* record. The user's data within the workspace is not deleted; only their
|
|
19293
|
-
* access is removed.
|
|
19294
|
-
*
|
|
19295
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19296
|
-
* @param memberId - The UUID of the user to remove from the workspace.
|
|
19297
|
-
* @param options - Optional request options.
|
|
19298
|
-
* @returns `true` on successful removal.
|
|
19299
|
-
*
|
|
19300
|
-
* @example
|
|
19301
|
-
* ```typescript
|
|
19302
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19303
|
-
* await client.platform.workspaceMembers.remove('ws_abc123', 'user_xyz');
|
|
19304
|
-
* ```
|
|
19305
|
-
*/
|
|
19306
|
-
remove: async (workspaceId, memberId, options) => {
|
|
19307
|
-
return rb.executeDelete(
|
|
19308
|
-
deleteWorkspaceMembershipsByWorkspaceIdByUserId,
|
|
19309
|
-
{ path: { workspace_id: workspaceId, user_id: memberId } },
|
|
19310
|
-
options
|
|
19311
|
-
);
|
|
19312
|
-
}
|
|
19313
|
-
},
|
|
19314
19057
|
/**
|
|
19315
19058
|
* Configs — application-level configuration key-value entries.
|
|
19316
19059
|
*
|
|
@@ -19398,92 +19141,135 @@ function createPlatformNamespace(rb) {
|
|
|
19398
19141
|
}
|
|
19399
19142
|
},
|
|
19400
19143
|
/**
|
|
19401
|
-
*
|
|
19144
|
+
* Roles — named permission bundles for workspace access control.
|
|
19402
19145
|
*
|
|
19403
|
-
*
|
|
19404
|
-
* Roles are either `"admin"` or `"member"`.
|
|
19146
|
+
* Access via `client.platform.roles`.
|
|
19405
19147
|
*/
|
|
19406
|
-
|
|
19148
|
+
roles: {
|
|
19407
19149
|
/**
|
|
19408
|
-
* List
|
|
19150
|
+
* List all roles for the current application.
|
|
19409
19151
|
*
|
|
19410
|
-
* @
|
|
19411
|
-
* @
|
|
19412
|
-
*
|
|
19152
|
+
* @returns Paginated list of roles
|
|
19153
|
+
* @example
|
|
19154
|
+
* const roles = await client.platform.roles.list();
|
|
19413
19155
|
*/
|
|
19414
|
-
list: async (
|
|
19415
|
-
return rb.execute(
|
|
19416
|
-
getTenantMemberships,
|
|
19417
|
-
{
|
|
19418
|
-
query: {
|
|
19419
|
-
filter: { tenant_id: tenantId },
|
|
19420
|
-
...buildPageQuery(options?.page, options?.pageSize).query
|
|
19421
|
-
}
|
|
19422
|
-
},
|
|
19423
|
-
options
|
|
19424
|
-
);
|
|
19156
|
+
list: async () => {
|
|
19157
|
+
return rb.execute(getRoles, {});
|
|
19425
19158
|
},
|
|
19426
19159
|
/**
|
|
19427
|
-
*
|
|
19160
|
+
* Create a new role with a set of permissions.
|
|
19428
19161
|
*
|
|
19429
|
-
* @param
|
|
19430
|
-
* @param
|
|
19431
|
-
* @
|
|
19432
|
-
* @
|
|
19433
|
-
*
|
|
19162
|
+
* @param name - Human-readable role name
|
|
19163
|
+
* @param permissions - List of permission strings (e.g. "extract:document:read:all")
|
|
19164
|
+
* @returns The created role
|
|
19165
|
+
* @example
|
|
19166
|
+
* const role = await client.platform.roles.create("Editor", ["extract:document:read:all"]);
|
|
19434
19167
|
*/
|
|
19435
|
-
create: async (
|
|
19436
|
-
return rb.execute(
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
body: {
|
|
19440
|
-
data: {
|
|
19441
|
-
type: "tenant_membership",
|
|
19442
|
-
attributes: { tenant_id: tenantId, user_id: userId, role }
|
|
19443
|
-
}
|
|
19444
|
-
}
|
|
19445
|
-
},
|
|
19446
|
-
options
|
|
19447
|
-
);
|
|
19168
|
+
create: async (name, permissions) => {
|
|
19169
|
+
return rb.execute(postRoles, {
|
|
19170
|
+
body: { data: { type: "role", attributes: { name, permissions } } }
|
|
19171
|
+
});
|
|
19448
19172
|
},
|
|
19449
19173
|
/**
|
|
19450
|
-
*
|
|
19174
|
+
* Update an existing role.
|
|
19451
19175
|
*
|
|
19452
|
-
* @param
|
|
19453
|
-
* @param
|
|
19454
|
-
* @
|
|
19455
|
-
* @
|
|
19456
|
-
*
|
|
19176
|
+
* @param id - Role UUID
|
|
19177
|
+
* @param attributes - Attributes to update (name, permissions)
|
|
19178
|
+
* @returns The updated role
|
|
19179
|
+
* @example
|
|
19180
|
+
* const updated = await client.platform.roles.update("role-uuid", { name: "Senior Editor" });
|
|
19457
19181
|
*/
|
|
19458
|
-
|
|
19459
|
-
return rb.execute(
|
|
19460
|
-
|
|
19461
|
-
{
|
|
19462
|
-
|
|
19463
|
-
body: {
|
|
19464
|
-
data: {
|
|
19465
|
-
type: "tenant_membership",
|
|
19466
|
-
attributes: { role }
|
|
19467
|
-
}
|
|
19468
|
-
}
|
|
19469
|
-
},
|
|
19470
|
-
options
|
|
19471
|
-
);
|
|
19182
|
+
update: async (id, attributes) => {
|
|
19183
|
+
return rb.execute(patchRolesById, {
|
|
19184
|
+
path: { id },
|
|
19185
|
+
body: { data: { type: "role", id, attributes } }
|
|
19186
|
+
});
|
|
19472
19187
|
},
|
|
19473
19188
|
/**
|
|
19474
|
-
*
|
|
19189
|
+
* Delete a role.
|
|
19475
19190
|
*
|
|
19476
|
-
* @param
|
|
19477
|
-
* @
|
|
19478
|
-
*
|
|
19479
|
-
* @returns `true` on success.
|
|
19191
|
+
* @param id - Role UUID
|
|
19192
|
+
* @example
|
|
19193
|
+
* await client.platform.roles.destroy("role-uuid");
|
|
19480
19194
|
*/
|
|
19481
|
-
|
|
19482
|
-
return rb.
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19195
|
+
destroy: async (id) => {
|
|
19196
|
+
return rb.execute(deleteRolesById, { path: { id } });
|
|
19197
|
+
}
|
|
19198
|
+
},
|
|
19199
|
+
/**
|
|
19200
|
+
* Permissions — permission registry, presets, and metadata.
|
|
19201
|
+
*
|
|
19202
|
+
* Access via `client.platform.permissions`.
|
|
19203
|
+
*/
|
|
19204
|
+
permissions: {
|
|
19205
|
+
/**
|
|
19206
|
+
* List all available permissions for the current application context.
|
|
19207
|
+
*
|
|
19208
|
+
* @param params - Optional filter parameters (context, app, category)
|
|
19209
|
+
* @returns List of permissions
|
|
19210
|
+
* @example
|
|
19211
|
+
* const perms = await client.platform.permissions.list();
|
|
19212
|
+
*/
|
|
19213
|
+
list: async (params) => {
|
|
19214
|
+
return rb.execute(getPermissions, {
|
|
19215
|
+
query: params
|
|
19216
|
+
});
|
|
19217
|
+
},
|
|
19218
|
+
/**
|
|
19219
|
+
* Get a single permission by ID.
|
|
19220
|
+
*
|
|
19221
|
+
* @param id - Permission ID string
|
|
19222
|
+
* @returns The permission record
|
|
19223
|
+
* @example
|
|
19224
|
+
* const perm = await client.platform.permissions.get("extract:document:read:all");
|
|
19225
|
+
*/
|
|
19226
|
+
get: async (id) => {
|
|
19227
|
+
return rb.execute(getPermissionsById, {
|
|
19228
|
+
path: { id }
|
|
19229
|
+
});
|
|
19230
|
+
},
|
|
19231
|
+
/**
|
|
19232
|
+
* Get permission metadata (available contexts, apps, and categories).
|
|
19233
|
+
*
|
|
19234
|
+
* @returns Permission metadata
|
|
19235
|
+
* @example
|
|
19236
|
+
* const meta = await client.platform.permissions.meta();
|
|
19237
|
+
*/
|
|
19238
|
+
meta: async () => {
|
|
19239
|
+
return rb.execute(getPermissionsMeta, {});
|
|
19240
|
+
},
|
|
19241
|
+
/**
|
|
19242
|
+
* Permission presets — pre-built permission sets per role type.
|
|
19243
|
+
*/
|
|
19244
|
+
presets: {
|
|
19245
|
+
/**
|
|
19246
|
+
* List all permission presets, optionally filtered by context or app.
|
|
19247
|
+
*
|
|
19248
|
+
* @param params - Optional filter parameters (context, app)
|
|
19249
|
+
* @returns List of permission presets
|
|
19250
|
+
* @example
|
|
19251
|
+
* const presets = await client.platform.permissions.presets.list({ context: "workspace" });
|
|
19252
|
+
*/
|
|
19253
|
+
list: async (params) => {
|
|
19254
|
+
return rb.execute(
|
|
19255
|
+
getPermissionsPresets,
|
|
19256
|
+
{ query: params }
|
|
19257
|
+
);
|
|
19258
|
+
},
|
|
19259
|
+
/**
|
|
19260
|
+
* Get a single permission preset by ID.
|
|
19261
|
+
*
|
|
19262
|
+
* @param id - Preset ID string
|
|
19263
|
+
* @returns The permission preset
|
|
19264
|
+
* @example
|
|
19265
|
+
* const preset = await client.platform.permissions.presets.get("workspace_editor");
|
|
19266
|
+
*/
|
|
19267
|
+
get: async (id) => {
|
|
19268
|
+
return rb.execute(
|
|
19269
|
+
getPermissionsPresetsById,
|
|
19270
|
+
{ path: { id } }
|
|
19271
|
+
);
|
|
19272
|
+
}
|
|
19487
19273
|
}
|
|
19488
19274
|
}
|
|
19489
19275
|
};
|