@roundtable-bb/sdk 0.1.14 → 0.1.19

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