@roundtable-bb/sdk 0.1.12 → 0.1.13
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/generated/client.js +78 -78
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/generated/client.ts +78 -78
package/src/generated/client.ts
CHANGED
|
@@ -9,272 +9,272 @@ export class AcpClient {
|
|
|
9
9
|
|
|
10
10
|
/** Export a signed tenant backup (platform owners only) */
|
|
11
11
|
backupTenant(params: { tenantId: string }, query?: { includeContent?: boolean }): Promise<BackupPayload> {
|
|
12
|
-
return request(this.opts, 'GET', `/
|
|
12
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/backup`, { query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/** Count read and unread notifications */
|
|
16
16
|
countNotifications(): Promise<NotificationCount> {
|
|
17
|
-
return request(this.opts, 'GET', '/
|
|
17
|
+
return request(this.opts, 'GET', '/notifications/count', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/** Create a platform-scoped API key (returned once in full) */
|
|
21
21
|
createApiKey(body: CreateApiKey): Promise<CreatedApiKey> {
|
|
22
|
-
return request(this.opts, 'POST', '/
|
|
22
|
+
return request(this.opts, 'POST', '/platform/api-keys', { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** Create a category (requires category.create permission) */
|
|
26
26
|
createCategory(params: { tenantId: string }, body: CreateCategory): Promise<Category> {
|
|
27
|
-
return request(this.opts, 'POST', `/
|
|
27
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/categories`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/** Create a group (requires group.create permission) */
|
|
31
31
|
createGroup(params: { tenantId: string }, body: CreateGroup): Promise<Group> {
|
|
32
|
-
return request(this.opts, 'POST', `/
|
|
32
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/groups`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/** Create a post in a thread */
|
|
36
36
|
createPost(params: { tenantId: string; threadId: string }, body: CreatePost): Promise<Post> {
|
|
37
|
-
return request(this.opts, 'POST', `/
|
|
37
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** Create a new tenant (requires allow_tenant_creation platform setting or platform owner) */
|
|
41
41
|
createTenant(body: CreateTenant): Promise<Tenant> {
|
|
42
|
-
return request(this.opts, 'POST', '/
|
|
42
|
+
return request(this.opts, 'POST', '/tenants', { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** Create a thread (and its first post) */
|
|
46
46
|
createThread(params: { tenantId: string; categoryId: string }, body: CreateThread): Promise<Thread> {
|
|
47
|
-
return request(this.opts, 'POST', `/
|
|
47
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/categories/${params.categoryId}/threads`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/** Delete a platform-scoped API key */
|
|
51
51
|
deleteApiKey(params: { keyId: string }): Promise<void> {
|
|
52
|
-
return request(this.opts, 'DELETE', `/
|
|
52
|
+
return request(this.opts, 'DELETE', `/platform/api-keys/${params.keyId}`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/** Delete a category (requires category.delete permission) */
|
|
56
56
|
deleteCategory(params: { tenantId: string; categoryId: string }): Promise<void> {
|
|
57
|
-
return request(this.opts, 'DELETE', `/
|
|
57
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/categories/${params.categoryId}`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/** Delete a group (requires group.delete permission) */
|
|
61
61
|
deleteGroup(params: { tenantId: string; groupId: string }): Promise<void> {
|
|
62
|
-
return request(this.opts, 'DELETE', `/
|
|
62
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/groups/${params.groupId}`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/** Delete a notification */
|
|
66
66
|
deleteNotification(params: { notificationId: string }): Promise<void> {
|
|
67
|
-
return request(this.opts, 'DELETE', `/
|
|
67
|
+
return request(this.opts, 'DELETE', `/notifications/${params.notificationId}`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/** Soft-delete a post */
|
|
71
71
|
deletePost(params: { tenantId: string; postId: string }): Promise<void> {
|
|
72
|
-
return request(this.opts, 'DELETE', `/
|
|
72
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/posts/${params.postId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/** Delete a thread */
|
|
76
76
|
deleteThread(params: { tenantId: string; threadId: string }): Promise<void> {
|
|
77
|
-
return request(this.opts, 'DELETE', `/
|
|
77
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/** Exchange session cookie for a short-lived tenant JWT */
|
|
81
81
|
exchangeTenantToken(): Promise<TenantToken> {
|
|
82
|
-
return request(this.opts, 'POST', '/
|
|
82
|
+
return request(this.opts, 'POST', '/tenant-token', { routeAuth: { acceptsBetterAuth: true } })
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/** Get a single category */
|
|
86
86
|
getCategory(params: { tenantId: string; categoryId: string }): Promise<Category> {
|
|
87
|
-
return request(this.opts, 'GET', `/
|
|
87
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories/${params.categoryId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/** Get a group */
|
|
91
91
|
getGroup(params: { tenantId: string; groupId: string }): Promise<Group> {
|
|
92
|
-
return request(this.opts, 'GET', `/
|
|
92
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups/${params.groupId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/** Get own profile */
|
|
96
96
|
getMe(): Promise<UserProfile> {
|
|
97
|
-
return request(this.opts, 'GET', '/
|
|
97
|
+
return request(this.opts, 'GET', '/users/me', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/** Get the current owner of a tenant */
|
|
101
101
|
getTenantOwner(params: { tenantId: string }): Promise<TenantOwner> {
|
|
102
|
-
return request(this.opts, 'GET', `/
|
|
102
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/owner`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/** Get a single thread */
|
|
106
106
|
getThread(params: { tenantId: string; threadId: string }): Promise<Thread> {
|
|
107
|
-
return request(this.opts, 'GET', `/
|
|
107
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/** Get read status for the current user in a thread */
|
|
111
111
|
getThreadReadStatus(params: { tenantId: string; threadId: string }): Promise<ThreadReadStatus> {
|
|
112
|
-
return request(this.opts, 'GET', `/
|
|
112
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/** Get a user profile by ID */
|
|
116
116
|
getUser(params: { userId: string }): Promise<UserProfile> {
|
|
117
|
-
return request(this.opts, 'GET', `/
|
|
117
|
+
return request(this.opts, 'GET', `/users/${params.userId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/** Get user group memberships in the current tenant */
|
|
121
121
|
getUserMembership(params: { tenantId: string; userId: string }): Promise<UserMembership> {
|
|
122
|
-
return request(this.opts, 'GET', `/
|
|
122
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/users/${params.userId}/membership`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/** Grant platform owner status to a user (platform owners only) */
|
|
126
126
|
grantPlatformOwner(body: GrantPlatformOwner): Promise<void> {
|
|
127
|
-
return request(this.opts, 'POST', '/
|
|
127
|
+
return request(this.opts, 'POST', '/platform/owners', { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/** List your platform-scoped API keys */
|
|
131
131
|
listApiKeys(): Promise<ApiKey[]> {
|
|
132
|
-
return request(this.opts, 'GET', '/
|
|
132
|
+
return request(this.opts, 'GET', '/platform/api-keys', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/** List visible categories for the requesting user */
|
|
136
136
|
listCategories(params: { tenantId: string }): Promise<Category[]> {
|
|
137
|
-
return request(this.opts, 'GET', `/
|
|
137
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/** List members of a group */
|
|
141
141
|
listGroupMembers(params: { tenantId: string; groupId: string }): Promise<GroupMember[]> {
|
|
142
|
-
return request(this.opts, 'GET', `/
|
|
142
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups/${params.groupId}/members`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/** List groups */
|
|
146
146
|
listGroups(params: { tenantId: string }): Promise<Group[]> {
|
|
147
|
-
return request(this.opts, 'GET', `/
|
|
147
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/** Get unified notification inbox */
|
|
151
151
|
listNotifications(query?: { cursor?: Id; limit?: number; unreadOnly?: boolean }): Promise<PaginatedResponse<Notification>> {
|
|
152
|
-
return request(this.opts, 'GET', '/
|
|
152
|
+
return request(this.opts, 'GET', '/notifications', { query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/** List platform owner user IDs (platform owners only) */
|
|
156
156
|
listPlatformOwners(): Promise<string[]> {
|
|
157
|
-
return request(this.opts, 'GET', '/
|
|
157
|
+
return request(this.opts, 'GET', '/platform/owners', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/** List all platform settings (platform owners only) */
|
|
161
161
|
listPlatformSettings(): Promise<PlatformSetting[]> {
|
|
162
|
-
return request(this.opts, 'GET', '/
|
|
162
|
+
return request(this.opts, 'GET', '/platform/settings', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
/** List posts in a thread — cursor pagination or anchor via ?from=postId */
|
|
166
166
|
listPosts(params: { tenantId: string; threadId: string }, query?: { cursor?: Id; limit?: number; from?: Id }): Promise<PaginatedResponse<Post>> {
|
|
167
|
-
return request(this.opts, 'GET', `/
|
|
167
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/** List tenants owned by the current user (platform owners see all) */
|
|
171
171
|
listTenants(query?: { search?: string }): Promise<OwnedTenant[]> {
|
|
172
|
-
return request(this.opts, 'GET', '/
|
|
172
|
+
return request(this.opts, 'GET', '/tenants', { query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/** List threads in a category */
|
|
176
176
|
listThreads(params: { tenantId: string; categoryId: string }, query?: { cursor?: Id; limit?: number }): Promise<PaginatedResponse<Thread>> {
|
|
177
|
-
return request(this.opts, 'GET', `/
|
|
177
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories/${params.categoryId}/threads`, { query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/** Mark a notification as read */
|
|
181
181
|
markNotificationRead(params: { notificationId: string }): Promise<Notification> {
|
|
182
|
-
return request(this.opts, 'PATCH', `/
|
|
182
|
+
return request(this.opts, 'PATCH', `/notifications/${params.notificationId}/read`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
/** Set the position of each category (requires category.edit permission) */
|
|
186
186
|
reorderCategories(params: { tenantId: string }, body: ReorderCategory): Promise<void> {
|
|
187
|
-
return request(this.opts, 'PUT', `/
|
|
187
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/categories/reorder`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
/** Set the position of each group (requires group.edit permission) */
|
|
191
191
|
reorderGroups(params: { tenantId: string }, body: ReorderCategory): Promise<void> {
|
|
192
|
-
return request(this.opts, 'PUT', `/
|
|
192
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/groups/reorder`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
/** Restore a tenant from a signed backup (platform owners only) */
|
|
196
196
|
restoreTenant(params: { tenantId: string }, body: RestoreTenant): Promise<RestoreTenantResponse> {
|
|
197
|
-
return request(this.opts, 'POST', `/
|
|
197
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/restore`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/** Revoke platform owner status from a user (platform owners only) */
|
|
201
201
|
revokePlatformOwner(params: { userId: string }): Promise<void> {
|
|
202
|
-
return request(this.opts, 'DELETE', `/
|
|
202
|
+
return request(this.opts, 'DELETE', `/platform/owners/${params.userId}`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
/** Full-text search across threads and posts (visible categories only) */
|
|
206
206
|
search(params: { tenantId: string }, query?: { q: string; type?: SearchResultType; categoryId?: Id; limit?: number }): Promise<SearchResponse> {
|
|
207
|
-
return request(this.opts, 'GET', `/
|
|
207
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/search`, { query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
/** Set category visibility for a group (requires group.edit permission) */
|
|
211
211
|
setGroupCategories(params: { tenantId: string; groupId: string }, body: SetGroupCategories): Promise<Group> {
|
|
212
|
-
return request(this.opts, 'PUT', `/
|
|
212
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/groups/${params.groupId}/categories`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/** Replace all permissions for a group (requires group.edit permission) */
|
|
216
216
|
setGroupPermissions(params: { tenantId: string; groupId: string }, body: SetGroupPermissions): Promise<Group> {
|
|
217
|
-
return request(this.opts, 'PUT', `/
|
|
217
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/groups/${params.groupId}/permissions`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
/** Set or remove the custom domain for a tenant */
|
|
221
221
|
setTenantCustomDomain(params: { tenantId: string }, body: SetCustomDomain): Promise<void> {
|
|
222
|
-
return request(this.opts, 'PUT', `/
|
|
222
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/custom-domain`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/** Mark a thread as read up to a given post */
|
|
226
226
|
setThreadReadStatus(params: { tenantId: string; threadId: string }, body: SetThreadReadStatus): Promise<void> {
|
|
227
|
-
return request(this.opts, 'PUT', `/
|
|
227
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
/** Replace user group assignments in the current tenant (requires group.assign permission) */
|
|
231
231
|
setUserGroups(params: { tenantId: string; userId: string }, body: SetUserGroups): Promise<UserMembership> {
|
|
232
|
-
return request(this.opts, 'PUT', `/
|
|
232
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/users/${params.userId}/membership`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/** Subscribe to a thread */
|
|
236
236
|
subscribeThread(params: { tenantId: string; threadId: string }): Promise<void> {
|
|
237
|
-
return request(this.opts, 'POST', `/
|
|
237
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/** Transfer tenant ownership to another existing user (only the current owner can do this) */
|
|
241
241
|
transferTenantOwner(params: { tenantId: string }, body: TransferTenantOwner): Promise<void> {
|
|
242
|
-
return request(this.opts, 'PUT', `/
|
|
242
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/owner`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/** Unsubscribe from a thread */
|
|
246
246
|
unsubscribeThread(params: { tenantId: string; threadId: string }): Promise<void> {
|
|
247
|
-
return request(this.opts, 'DELETE', `/
|
|
247
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/** Update a category (requires category.edit permission) */
|
|
251
251
|
updateCategory(params: { tenantId: string; categoryId: string }, body: UpdateCategory): Promise<Category> {
|
|
252
|
-
return request(this.opts, 'PATCH', `/
|
|
252
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/categories/${params.categoryId}`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/** Update a group (requires group.edit permission) */
|
|
256
256
|
updateGroup(params: { tenantId: string; groupId: string }, body: UpdateGroup): Promise<Group> {
|
|
257
|
-
return request(this.opts, 'PATCH', `/
|
|
257
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/groups/${params.groupId}`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
/** Update own profile */
|
|
261
261
|
updateMe(body: UpdateUserProfile): Promise<UserProfile> {
|
|
262
|
-
return request(this.opts, 'PATCH', '/
|
|
262
|
+
return request(this.opts, 'PATCH', '/users/me', { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
/** Update a platform setting (platform owners only) */
|
|
266
266
|
updatePlatformSetting(params: { key: string }, body: UpdatePlatformSetting): Promise<PlatformSetting> {
|
|
267
|
-
return request(this.opts, 'PATCH', `/
|
|
267
|
+
return request(this.opts, 'PATCH', `/platform/settings/${params.key}`, { body, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } })
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/** Edit a post (author or post.edit permission) */
|
|
271
271
|
updatePost(params: { tenantId: string; postId: string }, body: CreatePost): Promise<Post> {
|
|
272
|
-
return request(this.opts, 'PATCH', `/
|
|
272
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/posts/${params.postId}`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
/** Update a thread (title, pin, lock, move) */
|
|
276
276
|
updateThread(params: { tenantId: string; threadId: string }, body: UpdateThread): Promise<Thread> {
|
|
277
|
-
return request(this.opts, 'PATCH', `/
|
|
277
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/threads/${params.threadId}`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
|
|
@@ -283,121 +283,121 @@ export class TenantClient {
|
|
|
283
283
|
|
|
284
284
|
/** Count read and unread notifications */
|
|
285
285
|
countNotifications(): Promise<NotificationCount> {
|
|
286
|
-
return request(this.opts, 'GET', '/
|
|
286
|
+
return request(this.opts, 'GET', '/notifications/count', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/** Create a post in a thread */
|
|
290
290
|
createPost(params: { tenantId: string; threadId: string }, body: CreatePost): Promise<Post> {
|
|
291
|
-
return request(this.opts, 'POST', `/
|
|
291
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
/** Create a thread (and its first post) */
|
|
295
295
|
createThread(params: { tenantId: string; categoryId: string }, body: CreateThread): Promise<Thread> {
|
|
296
|
-
return request(this.opts, 'POST', `/
|
|
296
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/categories/${params.categoryId}/threads`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
/** Soft-delete a post */
|
|
300
300
|
deletePost(params: { tenantId: string; postId: string }): Promise<void> {
|
|
301
|
-
return request(this.opts, 'DELETE', `/
|
|
301
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/posts/${params.postId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
/** Delete a thread */
|
|
305
305
|
deleteThread(params: { tenantId: string; threadId: string }): Promise<void> {
|
|
306
|
-
return request(this.opts, 'DELETE', `/
|
|
306
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
/** Exchange session cookie for a short-lived tenant JWT */
|
|
310
310
|
exchangeTenantToken(): Promise<TenantToken> {
|
|
311
|
-
return request(this.opts, 'POST', '/
|
|
311
|
+
return request(this.opts, 'POST', '/tenant-token', { routeAuth: { acceptsBetterAuth: true, tenantUseCredentials: true } })
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
/** Get a single category */
|
|
315
315
|
getCategory(params: { tenantId: string; categoryId: string }): Promise<Category> {
|
|
316
|
-
return request(this.opts, 'GET', `/
|
|
316
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories/${params.categoryId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
/** Get a group */
|
|
320
320
|
getGroup(params: { tenantId: string; groupId: string }): Promise<Group> {
|
|
321
|
-
return request(this.opts, 'GET', `/
|
|
321
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups/${params.groupId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
/** Get own profile */
|
|
325
325
|
getMe(): Promise<UserProfile> {
|
|
326
|
-
return request(this.opts, 'GET', '/
|
|
326
|
+
return request(this.opts, 'GET', '/users/me', { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
/** Get a single thread */
|
|
330
330
|
getThread(params: { tenantId: string; threadId: string }): Promise<Thread> {
|
|
331
|
-
return request(this.opts, 'GET', `/
|
|
331
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
/** Get read status for the current user in a thread */
|
|
335
335
|
getThreadReadStatus(params: { tenantId: string; threadId: string }): Promise<ThreadReadStatus> {
|
|
336
|
-
return request(this.opts, 'GET', `/
|
|
336
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
/** Get a user profile by ID */
|
|
340
340
|
getUser(params: { userId: string }): Promise<UserProfile> {
|
|
341
|
-
return request(this.opts, 'GET', `/
|
|
341
|
+
return request(this.opts, 'GET', `/users/${params.userId}`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
/** Get user group memberships in the current tenant */
|
|
345
345
|
getUserMembership(params: { tenantId: string; userId: string }): Promise<UserMembership> {
|
|
346
|
-
return request(this.opts, 'GET', `/
|
|
346
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/users/${params.userId}/membership`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
/** List visible categories for the requesting user */
|
|
350
350
|
listCategories(params: { tenantId: string }): Promise<Category[]> {
|
|
351
|
-
return request(this.opts, 'GET', `/
|
|
351
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
/** List members of a group */
|
|
355
355
|
listGroupMembers(params: { tenantId: string; groupId: string }): Promise<GroupMember[]> {
|
|
356
|
-
return request(this.opts, 'GET', `/
|
|
356
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups/${params.groupId}/members`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
/** List groups */
|
|
360
360
|
listGroups(params: { tenantId: string }): Promise<Group[]> {
|
|
361
|
-
return request(this.opts, 'GET', `/
|
|
361
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups`, { routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } })
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
/** List posts in a thread — cursor pagination or anchor via ?from=postId */
|
|
365
365
|
listPosts(params: { tenantId: string; threadId: string }, query?: { cursor?: Id; limit?: number; from?: Id }): Promise<PaginatedResponse<Post>> {
|
|
366
|
-
return request(this.opts, 'GET', `/
|
|
366
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
/** List threads in a category */
|
|
370
370
|
listThreads(params: { tenantId: string; categoryId: string }, query?: { cursor?: Id; limit?: number }): Promise<PaginatedResponse<Thread>> {
|
|
371
|
-
return request(this.opts, 'GET', `/
|
|
371
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories/${params.categoryId}/threads`, { query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
/** Full-text search across threads and posts (visible categories only) */
|
|
375
375
|
search(params: { tenantId: string }, query?: { q: string; type?: SearchResultType; categoryId?: Id; limit?: number }): Promise<SearchResponse> {
|
|
376
|
-
return request(this.opts, 'GET', `/
|
|
376
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/search`, { query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
/** Mark a thread as read up to a given post */
|
|
380
380
|
setThreadReadStatus(params: { tenantId: string; threadId: string }, body: SetThreadReadStatus): Promise<void> {
|
|
381
|
-
return request(this.opts, 'PUT', `/
|
|
381
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
/** Subscribe to a thread */
|
|
385
385
|
subscribeThread(params: { tenantId: string; threadId: string }): Promise<void> {
|
|
386
|
-
return request(this.opts, 'POST', `/
|
|
386
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
/** Unsubscribe from a thread */
|
|
390
390
|
unsubscribeThread(params: { tenantId: string; threadId: string }): Promise<void> {
|
|
391
|
-
return request(this.opts, 'DELETE', `/
|
|
391
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
/** Edit a post (author or post.edit permission) */
|
|
395
395
|
updatePost(params: { tenantId: string; postId: string }, body: CreatePost): Promise<Post> {
|
|
396
|
-
return request(this.opts, 'PATCH', `/
|
|
396
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/posts/${params.postId}`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
/** Update a thread (title, pin, lock, move) */
|
|
400
400
|
updateThread(params: { tenantId: string; threadId: string }, body: UpdateThread): Promise<Thread> {
|
|
401
|
-
return request(this.opts, 'PATCH', `/
|
|
401
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/threads/${params.threadId}`, { body, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } })
|
|
402
402
|
}
|
|
403
403
|
}
|