@roundtable-bb/sdk 0.1.37 → 0.1.40
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.ts +21 -0
- package/dist/index.js +30 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -302,6 +302,9 @@ declare const GroupSchema: z.ZodObject<{
|
|
|
302
302
|
"group.manage_protected": "group.manage_protected";
|
|
303
303
|
}>>;
|
|
304
304
|
visibleForumIds: z.ZodArray<z.ZodUUID>;
|
|
305
|
+
minMembers: z.ZodNullable<z.ZodNumber>;
|
|
306
|
+
maxMembers: z.ZodNullable<z.ZodNumber>;
|
|
307
|
+
memberCount: z.ZodNumber;
|
|
305
308
|
}, z.core.$strip>;
|
|
306
309
|
declare const CreateGroupSchema: z.ZodObject<{
|
|
307
310
|
name: z.ZodString;
|
|
@@ -993,6 +996,24 @@ declare class RoundtableClient {
|
|
|
993
996
|
listConversations(options?: {
|
|
994
997
|
authMethod?: AuthMethod;
|
|
995
998
|
}): Promise<ConversationSummary[]>;
|
|
999
|
+
/** List latest posts across all visible forums */
|
|
1000
|
+
listFeedPosts(params: {
|
|
1001
|
+
tenantId: string;
|
|
1002
|
+
}, query?: {
|
|
1003
|
+
cursor?: Id;
|
|
1004
|
+
limit?: number;
|
|
1005
|
+
}, options?: {
|
|
1006
|
+
authMethod?: AuthMethod;
|
|
1007
|
+
}): Promise<PaginatedResponse<Post>>;
|
|
1008
|
+
/** List latest threads across all visible forums */
|
|
1009
|
+
listFeedThreads(params: {
|
|
1010
|
+
tenantId: string;
|
|
1011
|
+
}, query?: {
|
|
1012
|
+
cursor?: Id;
|
|
1013
|
+
limit?: number;
|
|
1014
|
+
}, options?: {
|
|
1015
|
+
authMethod?: AuthMethod;
|
|
1016
|
+
}): Promise<PaginatedResponse<Thread>>;
|
|
996
1017
|
/** List visible forums for the requesting user */
|
|
997
1018
|
listForums(params: {
|
|
998
1019
|
tenantId: string;
|
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ class RoundtableClient {
|
|
|
94
94
|
}
|
|
95
95
|
/** Create a post in a thread */
|
|
96
96
|
createPost(params, body, options) {
|
|
97
|
-
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
97
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
98
98
|
}
|
|
99
99
|
/** Create a new tenant (requires allow_tenant_creation platform setting or platform owner) */
|
|
100
100
|
createTenant(body, options) {
|
|
@@ -102,7 +102,7 @@ class RoundtableClient {
|
|
|
102
102
|
}
|
|
103
103
|
/** Create a thread (and its first post) */
|
|
104
104
|
createThread(params, body, options) {
|
|
105
|
-
return request(this.opts, 'POST', `/tenants/${params.tenantId}/forums/${params.forumId}/threads`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
105
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/forums/${params.forumId}/threads`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
106
106
|
}
|
|
107
107
|
/** Delete a platform-scoped API key */
|
|
108
108
|
deleteApiKey(params, options) {
|
|
@@ -130,7 +130,7 @@ class RoundtableClient {
|
|
|
130
130
|
}
|
|
131
131
|
/** Soft-delete a post */
|
|
132
132
|
deletePost(params, options) {
|
|
133
|
-
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/posts/${params.postId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
133
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/posts/${params.postId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
134
134
|
}
|
|
135
135
|
/** Permanently delete a tenant and all its data (platform owners only) */
|
|
136
136
|
deleteTenant(params, options) {
|
|
@@ -138,7 +138,7 @@ class RoundtableClient {
|
|
|
138
138
|
}
|
|
139
139
|
/** Delete a thread */
|
|
140
140
|
deleteThread(params, options) {
|
|
141
|
-
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
141
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
142
142
|
}
|
|
143
143
|
/** Exchange session cookie for a short-lived tenant JWT */
|
|
144
144
|
exchangeTenantToken(options) {
|
|
@@ -146,15 +146,15 @@ class RoundtableClient {
|
|
|
146
146
|
}
|
|
147
147
|
/** Get a single category */
|
|
148
148
|
getCategory(params, options) {
|
|
149
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories/${params.categoryId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
149
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories/${params.categoryId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
150
150
|
}
|
|
151
151
|
/** Get a single forum */
|
|
152
152
|
getForum(params, options) {
|
|
153
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/forums/${params.forumId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
153
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/forums/${params.forumId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
154
154
|
}
|
|
155
155
|
/** Get a group */
|
|
156
156
|
getGroup(params, options) {
|
|
157
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups/${params.groupId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
157
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/groups/${params.groupId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
158
158
|
}
|
|
159
159
|
/** Get own profile */
|
|
160
160
|
getMe(options) {
|
|
@@ -170,19 +170,19 @@ class RoundtableClient {
|
|
|
170
170
|
}
|
|
171
171
|
/** Get a single thread */
|
|
172
172
|
getThread(params, options) {
|
|
173
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
173
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
174
174
|
}
|
|
175
175
|
/** Get read status for the current user in a thread */
|
|
176
176
|
getThreadReadStatus(params, options) {
|
|
177
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
177
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
178
178
|
}
|
|
179
179
|
/** Get a user profile by ID */
|
|
180
180
|
getUser(params, options) {
|
|
181
|
-
return request(this.opts, 'GET', `/users/${params.userId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
181
|
+
return request(this.opts, 'GET', `/users/${params.userId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
182
182
|
}
|
|
183
183
|
/** Get user group memberships in the current tenant */
|
|
184
184
|
getUserMembership(params, options) {
|
|
185
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/users/${params.userId}/membership`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
185
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/users/${params.userId}/membership`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
186
186
|
}
|
|
187
187
|
/** Grant platform owner status to a user (platform owners only) */
|
|
188
188
|
grantPlatformOwner(body, options) {
|
|
@@ -204,6 +204,14 @@ class RoundtableClient {
|
|
|
204
204
|
listConversations(options) {
|
|
205
205
|
return request(this.opts, 'GET', '/messages/conversations', { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
206
206
|
}
|
|
207
|
+
/** List latest posts across all visible forums */
|
|
208
|
+
listFeedPosts(params, query, options) {
|
|
209
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/feed/posts`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
210
|
+
}
|
|
211
|
+
/** List latest threads across all visible forums */
|
|
212
|
+
listFeedThreads(params, query, options) {
|
|
213
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/feed/threads`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
214
|
+
}
|
|
207
215
|
/** List visible forums for the requesting user */
|
|
208
216
|
listForums(params, options) {
|
|
209
217
|
return request(this.opts, 'GET', `/tenants/${params.tenantId}/forums`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
@@ -230,7 +238,7 @@ class RoundtableClient {
|
|
|
230
238
|
}
|
|
231
239
|
/** List posts in a thread — cursor pagination or anchor via ?from=postId */
|
|
232
240
|
listPosts(params, query, options) {
|
|
233
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
241
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/threads/${params.threadId}/posts`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
234
242
|
}
|
|
235
243
|
/** List tenants owned by the current user (platform owners see all) */
|
|
236
244
|
listTenants(query, options) {
|
|
@@ -238,7 +246,7 @@ class RoundtableClient {
|
|
|
238
246
|
}
|
|
239
247
|
/** List threads in a forum */
|
|
240
248
|
listThreads(params, query, options) {
|
|
241
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/forums/${params.forumId}/threads`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
249
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/forums/${params.forumId}/threads`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
242
250
|
}
|
|
243
251
|
/** Mark all notifications as read */
|
|
244
252
|
markAllNotificationRead(options) {
|
|
@@ -282,7 +290,7 @@ class RoundtableClient {
|
|
|
282
290
|
}
|
|
283
291
|
/** Full-text search across threads and posts (visible categories only) */
|
|
284
292
|
search(params, query, options) {
|
|
285
|
-
return request(this.opts, 'GET', `/tenants/${params.tenantId}/search`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
293
|
+
return request(this.opts, 'GET', `/tenants/${params.tenantId}/search`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
286
294
|
}
|
|
287
295
|
/** Search users by display name or email (case-insensitive) */
|
|
288
296
|
searchUsers(query, options) {
|
|
@@ -302,7 +310,7 @@ class RoundtableClient {
|
|
|
302
310
|
}
|
|
303
311
|
/** Mark a thread as read up to a given post */
|
|
304
312
|
setThreadReadStatus(params, body, options) {
|
|
305
|
-
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
313
|
+
return request(this.opts, 'PUT', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
306
314
|
}
|
|
307
315
|
/** Replace user group assignments in the current tenant (requires group.manage permission) */
|
|
308
316
|
setUserGroups(params, body, options) {
|
|
@@ -310,7 +318,7 @@ class RoundtableClient {
|
|
|
310
318
|
}
|
|
311
319
|
/** Subscribe to a thread */
|
|
312
320
|
subscribeThread(params, options) {
|
|
313
|
-
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
321
|
+
return request(this.opts, 'POST', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
314
322
|
}
|
|
315
323
|
/** Transfer tenant ownership to another existing user (only the current owner can do this) */
|
|
316
324
|
transferTenantOwner(params, body, options) {
|
|
@@ -318,7 +326,7 @@ class RoundtableClient {
|
|
|
318
326
|
}
|
|
319
327
|
/** Unsubscribe from a thread */
|
|
320
328
|
unsubscribeThread(params, options) {
|
|
321
|
-
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
329
|
+
return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}/subscribe`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
322
330
|
}
|
|
323
331
|
/** Update a category (requires category.manage permission) */
|
|
324
332
|
updateCategory(params, body, options) {
|
|
@@ -342,7 +350,7 @@ class RoundtableClient {
|
|
|
342
350
|
}
|
|
343
351
|
/** Edit a post (author or post.edit permission) */
|
|
344
352
|
updatePost(params, body, options) {
|
|
345
|
-
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/posts/${params.postId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
353
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/posts/${params.postId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
346
354
|
}
|
|
347
355
|
/** Update a tenant's name, slug, or custom domain (tenant owner or platform owner) */
|
|
348
356
|
updateTenant(params, body, options) {
|
|
@@ -350,7 +358,7 @@ class RoundtableClient {
|
|
|
350
358
|
}
|
|
351
359
|
/** Update a thread (title, pin, lock, move) */
|
|
352
360
|
updateThread(params, body, options) {
|
|
353
|
-
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/threads/${params.threadId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
|
|
361
|
+
return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/threads/${params.threadId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
|
|
354
362
|
}
|
|
355
363
|
}
|
|
356
364
|
|
|
@@ -560,6 +568,9 @@ const GroupSchema = z.object({
|
|
|
560
568
|
isProtected: z.boolean(),
|
|
561
569
|
permissions: z.array(PermissionSchema),
|
|
562
570
|
visibleForumIds: z.array(IdSchema),
|
|
571
|
+
minMembers: z.number().int().nullable(),
|
|
572
|
+
maxMembers: z.number().int().nullable(),
|
|
573
|
+
memberCount: z.number().int(),
|
|
563
574
|
});
|
|
564
575
|
const CreateGroupSchema = z.object({
|
|
565
576
|
name: z.string().min(1).max(100),
|