@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.js
CHANGED
|
@@ -1333,8 +1333,8 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
1335
|
// src/version.ts
|
|
1336
|
-
var SDK_VERSION = "0.6.
|
|
1337
|
-
var DEFAULT_API_VERSION = "2026-03-
|
|
1336
|
+
var SDK_VERSION = "0.6.3";
|
|
1337
|
+
var DEFAULT_API_VERSION = "2026-03-11";
|
|
1338
1338
|
|
|
1339
1339
|
// src/base-client.ts
|
|
1340
1340
|
function generateUUID() {
|
|
@@ -1902,15 +1902,6 @@ var getApplicationsCurrent = (options) => (options.client ?? client).get({
|
|
|
1902
1902
|
url: "/applications/current",
|
|
1903
1903
|
...options
|
|
1904
1904
|
});
|
|
1905
|
-
var patchWorkspaceMembershipsByWorkspaceIdByUserIdProfile = (options) => (options.client ?? client).patch({
|
|
1906
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1907
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}/profile",
|
|
1908
|
-
...options,
|
|
1909
|
-
headers: {
|
|
1910
|
-
"Content-Type": "application/vnd.api+json",
|
|
1911
|
-
...options.headers
|
|
1912
|
-
}
|
|
1913
|
-
});
|
|
1914
1905
|
var postInvitationsAcceptByToken = (options) => (options.client ?? client).post({
|
|
1915
1906
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1916
1907
|
url: "/invitations/accept-by-token",
|
|
@@ -2811,6 +2802,11 @@ var getSocialMetricsAccountBySocialAccountId = (options) => (options.client ?? c
|
|
|
2811
2802
|
url: "/social/metrics/account/{social_account_id}",
|
|
2812
2803
|
...options
|
|
2813
2804
|
});
|
|
2805
|
+
var getPermissionsMeta = (options) => (options.client ?? client).get({
|
|
2806
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2807
|
+
url: "/permissions/meta",
|
|
2808
|
+
...options
|
|
2809
|
+
});
|
|
2814
2810
|
var getEmailMarketingGeneratedEmailsById = (options) => (options.client ?? client).get({
|
|
2815
2811
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2816
2812
|
url: "/email-marketing/generated-emails/{id}",
|
|
@@ -3197,20 +3193,6 @@ var getSchedulingBookingsById = (options) => (options.client ?? client).get({
|
|
|
3197
3193
|
url: "/scheduling/bookings/{id}",
|
|
3198
3194
|
...options
|
|
3199
3195
|
});
|
|
3200
|
-
var getTenantMemberships = (options) => (options.client ?? client).get({
|
|
3201
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
3202
|
-
url: "/tenant-memberships",
|
|
3203
|
-
...options
|
|
3204
|
-
});
|
|
3205
|
-
var postTenantMemberships = (options) => (options.client ?? client).post({
|
|
3206
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
3207
|
-
url: "/tenant-memberships",
|
|
3208
|
-
...options,
|
|
3209
|
-
headers: {
|
|
3210
|
-
"Content-Type": "application/vnd.api+json",
|
|
3211
|
-
...options.headers
|
|
3212
|
-
}
|
|
3213
|
-
});
|
|
3214
3196
|
var getLlmAnalytics = (options) => (options.client ?? client).get({
|
|
3215
3197
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3216
3198
|
url: "/llm-analytics",
|
|
@@ -3650,6 +3632,20 @@ var patchVoiceSessionsByIdFinalize = (options) => (options.client ?? client).pat
|
|
|
3650
3632
|
...options.headers
|
|
3651
3633
|
}
|
|
3652
3634
|
});
|
|
3635
|
+
var getRoles = (options) => (options.client ?? client).get({
|
|
3636
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3637
|
+
url: "/roles",
|
|
3638
|
+
...options
|
|
3639
|
+
});
|
|
3640
|
+
var postRoles = (options) => (options.client ?? client).post({
|
|
3641
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3642
|
+
url: "/roles",
|
|
3643
|
+
...options,
|
|
3644
|
+
headers: {
|
|
3645
|
+
"Content-Type": "application/vnd.api+json",
|
|
3646
|
+
...options.headers
|
|
3647
|
+
}
|
|
3648
|
+
});
|
|
3653
3649
|
var deleteProcessingActivitiesById = (options) => (options.client ?? client).delete({
|
|
3654
3650
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3655
3651
|
url: "/processing-activities/{id}",
|
|
@@ -4579,6 +4575,11 @@ var getWalletSeats = (options) => (options.client ?? client).get({
|
|
|
4579
4575
|
url: "/wallet/seats",
|
|
4580
4576
|
...options
|
|
4581
4577
|
});
|
|
4578
|
+
var getPermissions = (options) => (options.client ?? client).get({
|
|
4579
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4580
|
+
url: "/permissions",
|
|
4581
|
+
...options
|
|
4582
|
+
});
|
|
4582
4583
|
var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ?? client).patch({
|
|
4583
4584
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4584
4585
|
url: "/email/outbound-emails/{id}/cancel-schedule",
|
|
@@ -4851,20 +4852,6 @@ var patchConnectorsById = (options) => (options.client ?? client).patch({
|
|
|
4851
4852
|
...options.headers
|
|
4852
4853
|
}
|
|
4853
4854
|
});
|
|
4854
|
-
var getWorkspaceMemberships = (options) => (options.client ?? client).get({
|
|
4855
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
4856
|
-
url: "/workspace-memberships",
|
|
4857
|
-
...options
|
|
4858
|
-
});
|
|
4859
|
-
var postWorkspaceMemberships = (options) => (options.client ?? client).post({
|
|
4860
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
4861
|
-
url: "/workspace-memberships",
|
|
4862
|
-
...options,
|
|
4863
|
-
headers: {
|
|
4864
|
-
"Content-Type": "application/vnd.api+json",
|
|
4865
|
-
...options.headers
|
|
4866
|
-
}
|
|
4867
|
-
});
|
|
4868
4855
|
var getTenantsByTenantIdDocumentStats = (options) => (options.client ?? client).get({
|
|
4869
4856
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4870
4857
|
url: "/tenants/{tenant_id}/document_stats",
|
|
@@ -4894,6 +4881,16 @@ var patchVoiceTranscriptionResultsById = (options) => (options.client ?? client)
|
|
|
4894
4881
|
...options.headers
|
|
4895
4882
|
}
|
|
4896
4883
|
});
|
|
4884
|
+
var getPermissionsPresetsById = (options) => (options.client ?? client).get({
|
|
4885
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4886
|
+
url: "/permissions/presets/{id}",
|
|
4887
|
+
...options
|
|
4888
|
+
});
|
|
4889
|
+
var getPermissionsPresets = (options) => (options.client ?? client).get({
|
|
4890
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4891
|
+
url: "/permissions/presets",
|
|
4892
|
+
...options
|
|
4893
|
+
});
|
|
4897
4894
|
var deleteFieldTemplatesById = (options) => (options.client ?? client).delete({
|
|
4898
4895
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4899
4896
|
url: "/field-templates/{id}",
|
|
@@ -4979,6 +4976,11 @@ var patchApiKeysByIdSetBudget = (options) => (options.client ?? client).patch({
|
|
|
4979
4976
|
...options.headers
|
|
4980
4977
|
}
|
|
4981
4978
|
});
|
|
4979
|
+
var getPermissionsById = (options) => (options.client ?? client).get({
|
|
4980
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4981
|
+
url: "/permissions/{id}",
|
|
4982
|
+
...options
|
|
4983
|
+
});
|
|
4982
4984
|
var getExtractionDocumentsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
|
|
4983
4985
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4984
4986
|
url: "/extraction/documents/workspace/{workspace_id}",
|
|
@@ -5123,20 +5125,6 @@ var patchCrawlerSchedulesByIdEnable = (options) => (options.client ?? client).pa
|
|
|
5123
5125
|
...options.headers
|
|
5124
5126
|
}
|
|
5125
5127
|
});
|
|
5126
|
-
var deleteTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).delete({
|
|
5127
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5128
|
-
url: "/tenant-memberships/{tenant_id}/{user_id}",
|
|
5129
|
-
...options
|
|
5130
|
-
});
|
|
5131
|
-
var patchTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).patch({
|
|
5132
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5133
|
-
url: "/tenant-memberships/{tenant_id}/{user_id}",
|
|
5134
|
-
...options,
|
|
5135
|
-
headers: {
|
|
5136
|
-
"Content-Type": "application/vnd.api+json",
|
|
5137
|
-
...options.headers
|
|
5138
|
-
}
|
|
5139
|
-
});
|
|
5140
5128
|
var getEmailInboundReceivedById = (options) => (options.client ?? client).get({
|
|
5141
5129
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5142
5130
|
url: "/email/inbound/received/{id}",
|
|
@@ -5213,6 +5201,20 @@ var postAiMessages = (options) => (options.client ?? client).post({
|
|
|
5213
5201
|
...options.headers
|
|
5214
5202
|
}
|
|
5215
5203
|
});
|
|
5204
|
+
var deleteRolesById = (options) => (options.client ?? client).delete({
|
|
5205
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5206
|
+
url: "/roles/{id}",
|
|
5207
|
+
...options
|
|
5208
|
+
});
|
|
5209
|
+
var patchRolesById = (options) => (options.client ?? client).patch({
|
|
5210
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5211
|
+
url: "/roles/{id}",
|
|
5212
|
+
...options,
|
|
5213
|
+
headers: {
|
|
5214
|
+
"Content-Type": "application/vnd.api+json",
|
|
5215
|
+
...options.headers
|
|
5216
|
+
}
|
|
5217
|
+
});
|
|
5216
5218
|
var getWatcherEvents = (options) => (options.client ?? client).get({
|
|
5217
5219
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5218
5220
|
url: "/watcher/events",
|
|
@@ -5681,25 +5683,6 @@ var getAgentVersionRevisions = (options) => (options.client ?? client).get({
|
|
|
5681
5683
|
url: "/agent-version-revisions",
|
|
5682
5684
|
...options
|
|
5683
5685
|
});
|
|
5684
|
-
var deleteWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).delete({
|
|
5685
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5686
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}",
|
|
5687
|
-
...options
|
|
5688
|
-
});
|
|
5689
|
-
var getWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).get({
|
|
5690
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5691
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}",
|
|
5692
|
-
...options
|
|
5693
|
-
});
|
|
5694
|
-
var patchWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).patch({
|
|
5695
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
5696
|
-
url: "/workspace-memberships/{workspace_id}/{user_id}",
|
|
5697
|
-
...options,
|
|
5698
|
-
headers: {
|
|
5699
|
-
"Content-Type": "application/vnd.api+json",
|
|
5700
|
-
...options.headers
|
|
5701
|
-
}
|
|
5702
|
-
});
|
|
5703
5686
|
var postTrainingExamplesBulkDelete = (options) => (options.client ?? client).post({
|
|
5704
5687
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5705
5688
|
url: "/training-examples/bulk-delete",
|
|
@@ -19135,246 +19118,6 @@ function createPlatformNamespace(rb) {
|
|
|
19135
19118
|
);
|
|
19136
19119
|
}
|
|
19137
19120
|
},
|
|
19138
|
-
/**
|
|
19139
|
-
* Workspace Members — membership management within a workspace.
|
|
19140
|
-
*
|
|
19141
|
-
* Controls which users have access to a workspace and with what role.
|
|
19142
|
-
* Use `create` to grant access, `update` to change role/permissions,
|
|
19143
|
-
* and `remove` to revoke access.
|
|
19144
|
-
*/
|
|
19145
|
-
workspaceMembers: {
|
|
19146
|
-
/**
|
|
19147
|
-
* List all members of a workspace.
|
|
19148
|
-
*
|
|
19149
|
-
* Returns `WorkspaceMembership` records for every user who has been
|
|
19150
|
-
* granted access to the specified workspace.
|
|
19151
|
-
*
|
|
19152
|
-
* @param workspaceId - The UUID of the workspace to list members for.
|
|
19153
|
-
* @param options - Optional page number, page size, and request options.
|
|
19154
|
-
* @returns A page of `WorkspaceMembership` records.
|
|
19155
|
-
*
|
|
19156
|
-
* @example
|
|
19157
|
-
* ```typescript
|
|
19158
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19159
|
-
* const members = await client.platform.workspaceMembers.list('ws_abc123');
|
|
19160
|
-
* members.forEach(m => console.log(m.attributes?.user_id, m.attributes?.role));
|
|
19161
|
-
* ```
|
|
19162
|
-
*/
|
|
19163
|
-
list: async (workspaceId, options) => {
|
|
19164
|
-
return rb.execute(
|
|
19165
|
-
getWorkspaceMemberships,
|
|
19166
|
-
{
|
|
19167
|
-
query: {
|
|
19168
|
-
filter: { workspace_id: workspaceId },
|
|
19169
|
-
...buildPageQuery(options?.page, options?.pageSize)?.query
|
|
19170
|
-
}
|
|
19171
|
-
},
|
|
19172
|
-
options
|
|
19173
|
-
);
|
|
19174
|
-
},
|
|
19175
|
-
/**
|
|
19176
|
-
* List workspace members with user profile data (name, email, avatar) included.
|
|
19177
|
-
*
|
|
19178
|
-
* Equivalent to `list()` with `?include=user,user.profile` appended. Each
|
|
19179
|
-
* membership in the response will have `relationships.user` and nested
|
|
19180
|
-
* `user.relationships.profile` populated in the JSON:API `included` array.
|
|
19181
|
-
*
|
|
19182
|
-
* The `RequestBuilder` flattens included relationships automatically, so
|
|
19183
|
-
* each membership object will have `user` and `user.profile` accessible.
|
|
19184
|
-
*
|
|
19185
|
-
* @param workspaceId - The UUID of the workspace to list members for.
|
|
19186
|
-
* @param options - Optional page number, page size, and request options.
|
|
19187
|
-
* @returns A page of `WorkspaceMembership` records with embedded user + profile.
|
|
19188
|
-
*
|
|
19189
|
-
* @example
|
|
19190
|
-
* ```typescript
|
|
19191
|
-
* const members = await client.platform.workspaceMembers.listWithProfiles('ws_abc123');
|
|
19192
|
-
* members.forEach(m => {
|
|
19193
|
-
* console.log(m.attributes?.user_id, m.attributes?.role);
|
|
19194
|
-
* // Profile fields come from included relationships
|
|
19195
|
-
* });
|
|
19196
|
-
* ```
|
|
19197
|
-
*/
|
|
19198
|
-
listWithProfiles: async (workspaceId, options) => {
|
|
19199
|
-
return rb.execute(
|
|
19200
|
-
getWorkspaceMemberships,
|
|
19201
|
-
{
|
|
19202
|
-
query: {
|
|
19203
|
-
filter: { workspace_id: workspaceId },
|
|
19204
|
-
include: "user,user.profile",
|
|
19205
|
-
...buildPageQuery(options?.page, options?.pageSize)?.query
|
|
19206
|
-
}
|
|
19207
|
-
},
|
|
19208
|
-
options
|
|
19209
|
-
);
|
|
19210
|
-
},
|
|
19211
|
-
/**
|
|
19212
|
-
* Retrieve the membership record for a specific user within a workspace.
|
|
19213
|
-
*
|
|
19214
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19215
|
-
* @param memberId - The UUID of the user (member) to look up.
|
|
19216
|
-
* @param options - Optional request options.
|
|
19217
|
-
* @returns The matching `WorkspaceMembership` record.
|
|
19218
|
-
*
|
|
19219
|
-
* @example
|
|
19220
|
-
* ```typescript
|
|
19221
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19222
|
-
* const membership = await client.platform.workspaceMembers.get(
|
|
19223
|
-
* 'ws_abc123',
|
|
19224
|
-
* 'user_xyz',
|
|
19225
|
-
* );
|
|
19226
|
-
* console.log(membership.attributes?.role);
|
|
19227
|
-
* ```
|
|
19228
|
-
*/
|
|
19229
|
-
get: async (workspaceId, memberId, options) => {
|
|
19230
|
-
return rb.execute(
|
|
19231
|
-
getWorkspaceMembershipsByWorkspaceIdByUserId,
|
|
19232
|
-
{ path: { workspace_id: workspaceId, user_id: memberId } },
|
|
19233
|
-
options
|
|
19234
|
-
);
|
|
19235
|
-
},
|
|
19236
|
-
/**
|
|
19237
|
-
* Add a user to a workspace.
|
|
19238
|
-
*
|
|
19239
|
-
* Grants the specified user access to the workspace with the given role.
|
|
19240
|
-
* Typical attrs: `user_id`, `role` (e.g., `"member"`, `"admin"`).
|
|
19241
|
-
*
|
|
19242
|
-
* @param workspaceId - The UUID of the workspace to add the user to.
|
|
19243
|
-
* @param attrs - Membership attributes including `user_id` and `role`.
|
|
19244
|
-
* @param options - Optional request options.
|
|
19245
|
-
* @returns The newly created `WorkspaceMembership`.
|
|
19246
|
-
*
|
|
19247
|
-
* @example
|
|
19248
|
-
* ```typescript
|
|
19249
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19250
|
-
* const membership = await client.platform.workspaceMembers.create(
|
|
19251
|
-
* 'ws_abc123',
|
|
19252
|
-
* { user_id: 'user_xyz', role: 'member' },
|
|
19253
|
-
* );
|
|
19254
|
-
* console.log('Member added:', membership.id);
|
|
19255
|
-
* ```
|
|
19256
|
-
*/
|
|
19257
|
-
create: async (workspaceId, attrs, options) => {
|
|
19258
|
-
return rb.execute(
|
|
19259
|
-
postWorkspaceMemberships,
|
|
19260
|
-
{
|
|
19261
|
-
body: {
|
|
19262
|
-
data: {
|
|
19263
|
-
type: "workspace-membership",
|
|
19264
|
-
attributes: { workspace_id: workspaceId, ...attrs }
|
|
19265
|
-
}
|
|
19266
|
-
}
|
|
19267
|
-
},
|
|
19268
|
-
options
|
|
19269
|
-
);
|
|
19270
|
-
},
|
|
19271
|
-
/**
|
|
19272
|
-
* Update a workspace member's role or permissions.
|
|
19273
|
-
*
|
|
19274
|
-
* Changes the member's role within the workspace (e.g., promote to
|
|
19275
|
-
* `"admin"` or demote to `"member"`). Also used to update any other
|
|
19276
|
-
* membership-level settings.
|
|
19277
|
-
*
|
|
19278
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19279
|
-
* @param memberId - The UUID of the user whose membership to update.
|
|
19280
|
-
* @param attrs - Attribute map of fields to change, typically `{ role }`.
|
|
19281
|
-
* @param options - Optional request options.
|
|
19282
|
-
* @returns The updated `WorkspaceMembership`.
|
|
19283
|
-
*
|
|
19284
|
-
* @example
|
|
19285
|
-
* ```typescript
|
|
19286
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19287
|
-
* const membership = await client.platform.workspaceMembers.update(
|
|
19288
|
-
* 'ws_abc123',
|
|
19289
|
-
* 'user_xyz',
|
|
19290
|
-
* { role: 'admin' },
|
|
19291
|
-
* );
|
|
19292
|
-
* ```
|
|
19293
|
-
*/
|
|
19294
|
-
update: async (workspaceId, memberId, attrs, options) => {
|
|
19295
|
-
return rb.execute(
|
|
19296
|
-
patchWorkspaceMembershipsByWorkspaceIdByUserId,
|
|
19297
|
-
{
|
|
19298
|
-
path: { workspace_id: workspaceId, user_id: memberId },
|
|
19299
|
-
body: {
|
|
19300
|
-
data: {
|
|
19301
|
-
id: memberId,
|
|
19302
|
-
type: "workspace-membership",
|
|
19303
|
-
attributes: attrs
|
|
19304
|
-
}
|
|
19305
|
-
}
|
|
19306
|
-
},
|
|
19307
|
-
options
|
|
19308
|
-
);
|
|
19309
|
-
},
|
|
19310
|
-
/**
|
|
19311
|
-
* Update a workspace member's profile attributes.
|
|
19312
|
-
*
|
|
19313
|
-
* Sets per-member profile data within the workspace context (e.g.,
|
|
19314
|
-
* display name, avatar URL, specialty, or other ISV-defined profile fields).
|
|
19315
|
-
* Profile attributes are stored in a JSONB column and are distinct from
|
|
19316
|
-
* role/permission settings.
|
|
19317
|
-
*
|
|
19318
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19319
|
-
* @param memberId - The UUID of the user whose profile to update.
|
|
19320
|
-
* @param profileAttrs - Key-value pairs to merge into the member's profile.
|
|
19321
|
-
* @param options - Optional request options.
|
|
19322
|
-
* @returns The updated `WorkspaceMembership` with new profile data.
|
|
19323
|
-
*
|
|
19324
|
-
* @example
|
|
19325
|
-
* ```typescript
|
|
19326
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19327
|
-
* const membership = await client.platform.workspaceMembers.updateProfile(
|
|
19328
|
-
* 'ws_abc123',
|
|
19329
|
-
* 'user_xyz',
|
|
19330
|
-
* {
|
|
19331
|
-
* display_name: 'Dr. Jane Smith',
|
|
19332
|
-
* specialty: 'Cardiology',
|
|
19333
|
-
* },
|
|
19334
|
-
* );
|
|
19335
|
-
* ```
|
|
19336
|
-
*/
|
|
19337
|
-
updateProfile: async (workspaceId, memberId, profileAttrs, options) => {
|
|
19338
|
-
return rb.execute(
|
|
19339
|
-
patchWorkspaceMembershipsByWorkspaceIdByUserIdProfile,
|
|
19340
|
-
{
|
|
19341
|
-
path: { workspace_id: workspaceId, user_id: memberId },
|
|
19342
|
-
body: {
|
|
19343
|
-
data: {
|
|
19344
|
-
type: "workspace-membership",
|
|
19345
|
-
attributes: { profile_attributes: profileAttrs }
|
|
19346
|
-
}
|
|
19347
|
-
}
|
|
19348
|
-
},
|
|
19349
|
-
options
|
|
19350
|
-
);
|
|
19351
|
-
},
|
|
19352
|
-
/**
|
|
19353
|
-
* Remove a user from a workspace.
|
|
19354
|
-
*
|
|
19355
|
-
* Revokes the user's access to the workspace by deleting their membership
|
|
19356
|
-
* record. The user's data within the workspace is not deleted; only their
|
|
19357
|
-
* access is removed.
|
|
19358
|
-
*
|
|
19359
|
-
* @param workspaceId - The UUID of the workspace.
|
|
19360
|
-
* @param memberId - The UUID of the user to remove from the workspace.
|
|
19361
|
-
* @param options - Optional request options.
|
|
19362
|
-
* @returns `true` on successful removal.
|
|
19363
|
-
*
|
|
19364
|
-
* @example
|
|
19365
|
-
* ```typescript
|
|
19366
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
19367
|
-
* await client.platform.workspaceMembers.remove('ws_abc123', 'user_xyz');
|
|
19368
|
-
* ```
|
|
19369
|
-
*/
|
|
19370
|
-
remove: async (workspaceId, memberId, options) => {
|
|
19371
|
-
return rb.executeDelete(
|
|
19372
|
-
deleteWorkspaceMembershipsByWorkspaceIdByUserId,
|
|
19373
|
-
{ path: { workspace_id: workspaceId, user_id: memberId } },
|
|
19374
|
-
options
|
|
19375
|
-
);
|
|
19376
|
-
}
|
|
19377
|
-
},
|
|
19378
19121
|
/**
|
|
19379
19122
|
* Configs — application-level configuration key-value entries.
|
|
19380
19123
|
*
|
|
@@ -19462,92 +19205,135 @@ function createPlatformNamespace(rb) {
|
|
|
19462
19205
|
}
|
|
19463
19206
|
},
|
|
19464
19207
|
/**
|
|
19465
|
-
*
|
|
19208
|
+
* Roles — named permission bundles for workspace access control.
|
|
19466
19209
|
*
|
|
19467
|
-
*
|
|
19468
|
-
* Roles are either `"admin"` or `"member"`.
|
|
19210
|
+
* Access via `client.platform.roles`.
|
|
19469
19211
|
*/
|
|
19470
|
-
|
|
19212
|
+
roles: {
|
|
19471
19213
|
/**
|
|
19472
|
-
* List
|
|
19214
|
+
* List all roles for the current application.
|
|
19473
19215
|
*
|
|
19474
|
-
* @
|
|
19475
|
-
* @
|
|
19476
|
-
*
|
|
19216
|
+
* @returns Paginated list of roles
|
|
19217
|
+
* @example
|
|
19218
|
+
* const roles = await client.platform.roles.list();
|
|
19477
19219
|
*/
|
|
19478
|
-
list: async (
|
|
19479
|
-
return rb.execute(
|
|
19480
|
-
getTenantMemberships,
|
|
19481
|
-
{
|
|
19482
|
-
query: {
|
|
19483
|
-
filter: { tenant_id: tenantId },
|
|
19484
|
-
...buildPageQuery(options?.page, options?.pageSize).query
|
|
19485
|
-
}
|
|
19486
|
-
},
|
|
19487
|
-
options
|
|
19488
|
-
);
|
|
19220
|
+
list: async () => {
|
|
19221
|
+
return rb.execute(getRoles, {});
|
|
19489
19222
|
},
|
|
19490
19223
|
/**
|
|
19491
|
-
*
|
|
19224
|
+
* Create a new role with a set of permissions.
|
|
19492
19225
|
*
|
|
19493
|
-
* @param
|
|
19494
|
-
* @param
|
|
19495
|
-
* @
|
|
19496
|
-
* @
|
|
19497
|
-
*
|
|
19226
|
+
* @param name - Human-readable role name
|
|
19227
|
+
* @param permissions - List of permission strings (e.g. "extract:document:read:all")
|
|
19228
|
+
* @returns The created role
|
|
19229
|
+
* @example
|
|
19230
|
+
* const role = await client.platform.roles.create("Editor", ["extract:document:read:all"]);
|
|
19498
19231
|
*/
|
|
19499
|
-
create: async (
|
|
19500
|
-
return rb.execute(
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
body: {
|
|
19504
|
-
data: {
|
|
19505
|
-
type: "tenant_membership",
|
|
19506
|
-
attributes: { tenant_id: tenantId, user_id: userId, role }
|
|
19507
|
-
}
|
|
19508
|
-
}
|
|
19509
|
-
},
|
|
19510
|
-
options
|
|
19511
|
-
);
|
|
19232
|
+
create: async (name, permissions) => {
|
|
19233
|
+
return rb.execute(postRoles, {
|
|
19234
|
+
body: { data: { type: "role", attributes: { name, permissions } } }
|
|
19235
|
+
});
|
|
19512
19236
|
},
|
|
19513
19237
|
/**
|
|
19514
|
-
*
|
|
19238
|
+
* Update an existing role.
|
|
19515
19239
|
*
|
|
19516
|
-
* @param
|
|
19517
|
-
* @param
|
|
19518
|
-
* @
|
|
19519
|
-
* @
|
|
19520
|
-
*
|
|
19240
|
+
* @param id - Role UUID
|
|
19241
|
+
* @param attributes - Attributes to update (name, permissions)
|
|
19242
|
+
* @returns The updated role
|
|
19243
|
+
* @example
|
|
19244
|
+
* const updated = await client.platform.roles.update("role-uuid", { name: "Senior Editor" });
|
|
19521
19245
|
*/
|
|
19522
|
-
|
|
19523
|
-
return rb.execute(
|
|
19524
|
-
|
|
19525
|
-
{
|
|
19526
|
-
|
|
19527
|
-
body: {
|
|
19528
|
-
data: {
|
|
19529
|
-
type: "tenant_membership",
|
|
19530
|
-
attributes: { role }
|
|
19531
|
-
}
|
|
19532
|
-
}
|
|
19533
|
-
},
|
|
19534
|
-
options
|
|
19535
|
-
);
|
|
19246
|
+
update: async (id, attributes) => {
|
|
19247
|
+
return rb.execute(patchRolesById, {
|
|
19248
|
+
path: { id },
|
|
19249
|
+
body: { data: { type: "role", id, attributes } }
|
|
19250
|
+
});
|
|
19536
19251
|
},
|
|
19537
19252
|
/**
|
|
19538
|
-
*
|
|
19253
|
+
* Delete a role.
|
|
19539
19254
|
*
|
|
19540
|
-
* @param
|
|
19541
|
-
* @
|
|
19542
|
-
*
|
|
19543
|
-
* @returns `true` on success.
|
|
19255
|
+
* @param id - Role UUID
|
|
19256
|
+
* @example
|
|
19257
|
+
* await client.platform.roles.destroy("role-uuid");
|
|
19544
19258
|
*/
|
|
19545
|
-
|
|
19546
|
-
return rb.
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19259
|
+
destroy: async (id) => {
|
|
19260
|
+
return rb.execute(deleteRolesById, { path: { id } });
|
|
19261
|
+
}
|
|
19262
|
+
},
|
|
19263
|
+
/**
|
|
19264
|
+
* Permissions — permission registry, presets, and metadata.
|
|
19265
|
+
*
|
|
19266
|
+
* Access via `client.platform.permissions`.
|
|
19267
|
+
*/
|
|
19268
|
+
permissions: {
|
|
19269
|
+
/**
|
|
19270
|
+
* List all available permissions for the current application context.
|
|
19271
|
+
*
|
|
19272
|
+
* @param params - Optional filter parameters (context, app, category)
|
|
19273
|
+
* @returns List of permissions
|
|
19274
|
+
* @example
|
|
19275
|
+
* const perms = await client.platform.permissions.list();
|
|
19276
|
+
*/
|
|
19277
|
+
list: async (params) => {
|
|
19278
|
+
return rb.execute(getPermissions, {
|
|
19279
|
+
query: params
|
|
19280
|
+
});
|
|
19281
|
+
},
|
|
19282
|
+
/**
|
|
19283
|
+
* Get a single permission by ID.
|
|
19284
|
+
*
|
|
19285
|
+
* @param id - Permission ID string
|
|
19286
|
+
* @returns The permission record
|
|
19287
|
+
* @example
|
|
19288
|
+
* const perm = await client.platform.permissions.get("extract:document:read:all");
|
|
19289
|
+
*/
|
|
19290
|
+
get: async (id) => {
|
|
19291
|
+
return rb.execute(getPermissionsById, {
|
|
19292
|
+
path: { id }
|
|
19293
|
+
});
|
|
19294
|
+
},
|
|
19295
|
+
/**
|
|
19296
|
+
* Get permission metadata (available contexts, apps, and categories).
|
|
19297
|
+
*
|
|
19298
|
+
* @returns Permission metadata
|
|
19299
|
+
* @example
|
|
19300
|
+
* const meta = await client.platform.permissions.meta();
|
|
19301
|
+
*/
|
|
19302
|
+
meta: async () => {
|
|
19303
|
+
return rb.execute(getPermissionsMeta, {});
|
|
19304
|
+
},
|
|
19305
|
+
/**
|
|
19306
|
+
* Permission presets — pre-built permission sets per role type.
|
|
19307
|
+
*/
|
|
19308
|
+
presets: {
|
|
19309
|
+
/**
|
|
19310
|
+
* List all permission presets, optionally filtered by context or app.
|
|
19311
|
+
*
|
|
19312
|
+
* @param params - Optional filter parameters (context, app)
|
|
19313
|
+
* @returns List of permission presets
|
|
19314
|
+
* @example
|
|
19315
|
+
* const presets = await client.platform.permissions.presets.list({ context: "workspace" });
|
|
19316
|
+
*/
|
|
19317
|
+
list: async (params) => {
|
|
19318
|
+
return rb.execute(
|
|
19319
|
+
getPermissionsPresets,
|
|
19320
|
+
{ query: params }
|
|
19321
|
+
);
|
|
19322
|
+
},
|
|
19323
|
+
/**
|
|
19324
|
+
* Get a single permission preset by ID.
|
|
19325
|
+
*
|
|
19326
|
+
* @param id - Preset ID string
|
|
19327
|
+
* @returns The permission preset
|
|
19328
|
+
* @example
|
|
19329
|
+
* const preset = await client.platform.permissions.presets.get("workspace_editor");
|
|
19330
|
+
*/
|
|
19331
|
+
get: async (id) => {
|
|
19332
|
+
return rb.execute(
|
|
19333
|
+
getPermissionsPresetsById,
|
|
19334
|
+
{ path: { id } }
|
|
19335
|
+
);
|
|
19336
|
+
}
|
|
19551
19337
|
}
|
|
19552
19338
|
}
|
|
19553
19339
|
};
|