@roundtable-bb/sdk 0.1.34 → 0.1.36

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.
@@ -14,6 +14,10 @@ export class RoundtableClient {
14
14
  countNotifications(options) {
15
15
  return request(this.opts, 'GET', '/notifications/count', { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
16
16
  }
17
+ /** Count unread private messages */
18
+ countUnreadMessages(options) {
19
+ return request(this.opts, 'GET', '/messages/count', { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
20
+ }
17
21
  /** Create a platform-scoped API key (returned once in full) */
18
22
  createApiKey(body, options) {
19
23
  return request(this.opts, 'POST', '/platform/api-keys', { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
@@ -58,6 +62,10 @@ export class RoundtableClient {
58
62
  deleteGroup(params, options) {
59
63
  return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/groups/${params.groupId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
60
64
  }
65
+ /** Delete a private message */
66
+ deleteMessage(params, options) {
67
+ return request(this.opts, 'DELETE', `/messages/${params.messageId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
68
+ }
61
69
  /** Delete a notification */
62
70
  deleteNotification(params, options) {
63
71
  return request(this.opts, 'DELETE', `/notifications/${params.notificationId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
@@ -66,6 +74,10 @@ export class RoundtableClient {
66
74
  deletePost(params, options) {
67
75
  return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/posts/${params.postId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
68
76
  }
77
+ /** Permanently delete a tenant and all its data (platform owners only) */
78
+ deleteTenant(params, options) {
79
+ return request(this.opts, 'DELETE', `/tenants/${params.tenantId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
80
+ }
69
81
  /** Delete a thread */
70
82
  deleteThread(params, options) {
71
83
  return request(this.opts, 'DELETE', `/tenants/${params.tenantId}/threads/${params.threadId}`, { ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
@@ -126,6 +138,14 @@ export class RoundtableClient {
126
138
  listCategories(params, options) {
127
139
  return request(this.opts, 'GET', `/tenants/${params.tenantId}/categories`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
128
140
  }
141
+ /** List messages exchanged with a specific user */
142
+ listConversationMessages(params, query, options) {
143
+ return request(this.opts, 'GET', `/messages/conversations/${params.userId}`, { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
144
+ }
145
+ /** List conversations for the current user */
146
+ listConversations(options) {
147
+ return request(this.opts, 'GET', '/messages/conversations', { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
148
+ }
129
149
  /** List visible forums for the requesting user */
130
150
  listForums(params, options) {
131
151
  return request(this.opts, 'GET', `/tenants/${params.tenantId}/forums`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
@@ -166,6 +186,14 @@ export class RoundtableClient {
166
186
  markAllNotificationRead(options) {
167
187
  return request(this.opts, 'POST', '/notifications/read-all', { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
168
188
  }
189
+ /** Mark all messages from a user as read */
190
+ markConversationRead(params, options) {
191
+ return request(this.opts, 'PATCH', `/messages/conversations/${params.userId}/read`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
192
+ }
193
+ /** Mark a message as read */
194
+ markMessageRead(params, options) {
195
+ return request(this.opts, 'PATCH', `/messages/${params.messageId}/read`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
196
+ }
169
197
  /** Mark a notification as read */
170
198
  markNotificationRead(params, options) {
171
199
  return request(this.opts, 'PATCH', `/notifications/${params.notificationId}/read`, { ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
@@ -202,6 +230,10 @@ export class RoundtableClient {
202
230
  searchUsers(query, options) {
203
231
  return request(this.opts, 'GET', '/users/search', { ...options, query, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
204
232
  }
233
+ /** Send a private message to another user */
234
+ sendMessage(body, options) {
235
+ return request(this.opts, 'POST', '/messages', { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true, acceptsTenantJwt: true } });
236
+ }
205
237
  /** Set forum visibility for a group (requires group.manage or group.manage_protected permission) */
206
238
  setGroupForums(params, body, options) {
207
239
  return request(this.opts, 'PUT', `/tenants/${params.tenantId}/groups/${params.groupId}/forums`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
@@ -210,10 +242,6 @@ export class RoundtableClient {
210
242
  setGroupPermissions(params, body, options) {
211
243
  return request(this.opts, 'PUT', `/tenants/${params.tenantId}/groups/${params.groupId}/permissions`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
212
244
  }
213
- /** Set or remove the custom domain for a tenant */
214
- setTenantCustomDomain(params, body, options) {
215
- return request(this.opts, 'PUT', `/tenants/${params.tenantId}/custom-domain`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
216
- }
217
245
  /** Mark a thread as read up to a given post */
218
246
  setThreadReadStatus(params, body, options) {
219
247
  return request(this.opts, 'PUT', `/tenants/${params.tenantId}/threads/${params.threadId}/read-status`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
@@ -258,6 +286,10 @@ export class RoundtableClient {
258
286
  updatePost(params, body, options) {
259
287
  return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/posts/${params.postId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
260
288
  }
289
+ /** Update a tenant's name, slug, or custom domain (tenant owner or platform owner) */
290
+ updateTenant(params, body, options) {
291
+ return request(this.opts, 'PATCH', `/tenants/${params.tenantId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsBetterAuth: true } });
292
+ }
261
293
  /** Update a thread (title, pin, lock, move) */
262
294
  updateThread(params, body, options) {
263
295
  return request(this.opts, 'PATCH', `/tenants/${params.tenantId}/threads/${params.threadId}`, { body, ...options, routeAuth: { acceptsApiKey: true, acceptsTenantJwt: true } });
package/dist/index.d.ts CHANGED
@@ -389,6 +389,7 @@ declare const MessageCountSchema: z.ZodObject<{
389
389
  type Message = z.infer<typeof MessageSchema>;
390
390
  type SendMessageBody = z.infer<typeof SendMessageBodySchema>;
391
391
  type ConversationSummary = z.infer<typeof ConversationSummarySchema>;
392
+ type MessageCount = z.infer<typeof MessageCountSchema>;
392
393
 
393
394
  declare const ApiKeySchema: z.ZodObject<{
394
395
  id: z.ZodUUID;
@@ -473,9 +474,6 @@ declare const UpdateTenantSchema: z.ZodObject<{
473
474
  slug: z.ZodOptional<z.ZodString>;
474
475
  customDomain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
475
476
  }, z.core.$strip>;
476
- declare const SetCustomDomainSchema: z.ZodObject<{
477
- domain: z.ZodNullable<z.ZodString>;
478
- }, z.core.$strip>;
479
477
  declare const OwnedTenantSchema: z.ZodObject<{
480
478
  id: z.ZodNumber;
481
479
  name: z.ZodString;
@@ -504,7 +502,6 @@ type OwnedTenant = z.infer<typeof OwnedTenantSchema>;
504
502
  type Tenant = z.infer<typeof TenantSchema>;
505
503
  type CreateTenant = z.infer<typeof CreateTenantSchema>;
506
504
  type UpdateTenant = z.infer<typeof UpdateTenantSchema>;
507
- type SetCustomDomain = z.infer<typeof SetCustomDomainSchema>;
508
505
  type TenantToken = z.infer<typeof TenantTokenSchema>;
509
506
  type TenantOptions = z.infer<typeof TenantOptionsSchema>;
510
507
  type SetTenantOptions = z.infer<typeof SetTenantOptionsSchema>;
@@ -798,6 +795,10 @@ declare class RoundtableClient {
798
795
  countNotifications(options?: {
799
796
  authMethod?: AuthMethod;
800
797
  }): Promise<NotificationCount>;
798
+ /** Count unread private messages */
799
+ countUnreadMessages(options?: {
800
+ authMethod?: AuthMethod;
801
+ }): Promise<MessageCount>;
801
802
  /** Create a platform-scoped API key (returned once in full) */
802
803
  createApiKey(body: CreateApiKey, options?: {
803
804
  authMethod?: AuthMethod;
@@ -865,6 +866,12 @@ declare class RoundtableClient {
865
866
  }, options?: {
866
867
  authMethod?: AuthMethod;
867
868
  }): Promise<void>;
869
+ /** Delete a private message */
870
+ deleteMessage(params: {
871
+ messageId: string;
872
+ }, options?: {
873
+ authMethod?: AuthMethod;
874
+ }): Promise<void>;
868
875
  /** Delete a notification */
869
876
  deleteNotification(params: {
870
877
  notificationId: string;
@@ -878,6 +885,12 @@ declare class RoundtableClient {
878
885
  }, options?: {
879
886
  authMethod?: AuthMethod;
880
887
  }): Promise<void>;
888
+ /** Permanently delete a tenant and all its data (platform owners only) */
889
+ deleteTenant(params: {
890
+ tenantId: string;
891
+ }, options?: {
892
+ authMethod?: AuthMethod;
893
+ }): Promise<void>;
881
894
  /** Delete a thread */
882
895
  deleteThread(params: {
883
896
  tenantId: string;
@@ -967,6 +980,19 @@ declare class RoundtableClient {
967
980
  }, options?: {
968
981
  authMethod?: AuthMethod;
969
982
  }): Promise<Category[]>;
983
+ /** List messages exchanged with a specific user */
984
+ listConversationMessages(params: {
985
+ userId: string;
986
+ }, query?: {
987
+ cursor?: Id;
988
+ limit?: number;
989
+ }, options?: {
990
+ authMethod?: AuthMethod;
991
+ }): Promise<PaginatedResponse<Message>>;
992
+ /** List conversations for the current user */
993
+ listConversations(options?: {
994
+ authMethod?: AuthMethod;
995
+ }): Promise<ConversationSummary[]>;
970
996
  /** List visible forums for the requesting user */
971
997
  listForums(params: {
972
998
  tenantId: string;
@@ -1033,6 +1059,18 @@ declare class RoundtableClient {
1033
1059
  markAllNotificationRead(options?: {
1034
1060
  authMethod?: AuthMethod;
1035
1061
  }): Promise<void>;
1062
+ /** Mark all messages from a user as read */
1063
+ markConversationRead(params: {
1064
+ userId: string;
1065
+ }, options?: {
1066
+ authMethod?: AuthMethod;
1067
+ }): Promise<void>;
1068
+ /** Mark a message as read */
1069
+ markMessageRead(params: {
1070
+ messageId: string;
1071
+ }, options?: {
1072
+ authMethod?: AuthMethod;
1073
+ }): Promise<Message>;
1036
1074
  /** Mark a notification as read */
1037
1075
  markNotificationRead(params: {
1038
1076
  notificationId: string;
@@ -1092,6 +1130,10 @@ declare class RoundtableClient {
1092
1130
  }, options?: {
1093
1131
  authMethod?: AuthMethod;
1094
1132
  }): Promise<UserSearchResult[]>;
1133
+ /** Send a private message to another user */
1134
+ sendMessage(body: SendMessageBody, options?: {
1135
+ authMethod?: AuthMethod;
1136
+ }): Promise<Message>;
1095
1137
  /** Set forum visibility for a group (requires group.manage or group.manage_protected permission) */
1096
1138
  setGroupForums(params: {
1097
1139
  tenantId: string;
@@ -1106,12 +1148,6 @@ declare class RoundtableClient {
1106
1148
  }, body: SetGroupPermissions, options?: {
1107
1149
  authMethod?: AuthMethod;
1108
1150
  }): Promise<Group>;
1109
- /** Set or remove the custom domain for a tenant */
1110
- setTenantCustomDomain(params: {
1111
- tenantId: string;
1112
- }, body: SetCustomDomain, options?: {
1113
- authMethod?: AuthMethod;
1114
- }): Promise<void>;
1115
1151
  /** Mark a thread as read up to a given post */
1116
1152
  setThreadReadStatus(params: {
1117
1153
  tenantId: string;
@@ -1184,6 +1220,12 @@ declare class RoundtableClient {
1184
1220
  }, body: CreatePost, options?: {
1185
1221
  authMethod?: AuthMethod;
1186
1222
  }): Promise<Post>;
1223
+ /** Update a tenant's name, slug, or custom domain (tenant owner or platform owner) */
1224
+ updateTenant(params: {
1225
+ tenantId: string;
1226
+ }, body: UpdateTenant, options?: {
1227
+ authMethod?: AuthMethod;
1228
+ }): Promise<Tenant>;
1187
1229
  /** Update a thread (title, pin, lock, move) */
1188
1230
  updateThread(params: {
1189
1231
  tenantId: string;
@@ -1193,5 +1235,5 @@ declare class RoundtableClient {
1193
1235
  }): Promise<Thread>;
1194
1236
  }
1195
1237
 
1196
- export { ApiKeySchema, AssignablePermissionSchema, BackupPayloadSchema, BackupQuerySchema, CategorySchema, ConversationSummarySchema, CreateApiKeySchema, CreateCategorySchema, CreateForumSchema, CreateGroupSchema, CreatePostSchema, CreateTenantSchema, CreateThreadSchema, CreatedApiKeySchema, ErrorSchema, ForumSchema, GrantPlatformOwnerSchema, GroupMemberSchema, GroupSchema, IdSchema, KeyIdParamsSchema, MessageCountSchema, MessageIdParamsSchema, MessageSchema, NotificationCountSchema, NotificationIdParamsSchema, NotificationSchema, NotificationTypeSchema, OwnedTenantSchema, PERMISSIONS, PaginatedResponseSchema, PaginationQuerySchema, PermissionSchema, PlatformSettingKeyParamsSchema, PlatformSettingSchema, PostSchema, PostsQuerySchema, ReorderCategorySchema, ReorderForumSchema, ReorderGroupSchema, RestoreErrorSchema, RestoreTenantResponseSchema, RestoreTenantSchema, RoundtableClient, SearchQuerySchema, SearchResponseSchema, SearchResultSchema, SearchResultTypeSchema, SendMessageBodySchema, SetCustomDomainSchema, SetGroupForumsSchema, SetGroupPermissionsSchema, SetTenantOptionsSchema, SetThreadReadStatusSchema, SetUserGroupsSchema, TenantBackupSchema, TenantCategoryIdParamsSchema, TenantForumIdParamsSchema, TenantGroupIdParamsSchema, TenantIdParamsSchema, TenantOptionsSchema, TenantOwnerSchema, TenantPostIdParamsSchema, TenantSchema, TenantThreadIdParamsSchema, TenantThreadPostIdParamsSchema, TenantTokenSchema, TenantUserIdParamsSchema, ThreadReadStatusSchema, ThreadSchema, TransferTenantOwnerSchema, UpdateCategorySchema, UpdateForumSchema, UpdateGroupSchema, UpdatePlatformSettingSchema, UpdatePostSchema, UpdateTenantSchema, UpdateThreadSchema, UpdateUserProfileSchema, UserIdParamsSchema, UserMembershipSchema, UserProfileSchema, UserSearchResultSchema, UserSummarySchema };
1197
- export type { ApiError, ApiKey, BackupCategory, BackupData, BackupGroup, BackupMembership, BackupPayload, BackupPost, BackupQuery, BackupSettings, BackupThread, Category, ConversationSummary, CreateApiKey, CreateCategory, CreateForum, CreateGroup, CreatePost, CreateTenant, CreateThread, CreatedApiKey, Forum, GrantPlatformOwner, Group, GroupMember, Id, KeyIdParams, Message, MessageIdParams, Notification, NotificationCount, NotificationIdParams, NotificationType, OwnedTenant, PaginatedResponse, PaginationQuery, Permission, PlatformSetting, PlatformSettingKeyParams, Post, PostsQuery, ReorderCategory, ReorderForum, ReorderGroup, RestoreError, RestoreTenant, RestoreTenantResponse, RoundtableClientOpts, SearchQuery, SearchResponse, SearchResult, SearchResultType, SendMessageBody, SetCustomDomain, SetGroupForums, SetGroupPermissions, SetTenantOptions, SetThreadReadStatus, SetUserGroups, Tenant, TenantBackup, TenantCategoryIdParams, TenantForumIdParams, TenantGroupIdParams, TenantIdParams, TenantOptions, TenantOwner, TenantPostIdParams, TenantThreadIdParams, TenantThreadPostIdParams, TenantToken, TenantUserIdParams, Thread, ThreadReadStatus, TransferTenantOwner, UpdateCategory, UpdateForum, UpdateGroup, UpdatePlatformSetting, UpdatePost, UpdateTenant, UpdateThread, UpdateUserProfile, UserIdParams, UserMembership, UserProfile, UserSearchResult, UserSummary };
1238
+ export { ApiKeySchema, AssignablePermissionSchema, BackupPayloadSchema, BackupQuerySchema, CategorySchema, ConversationSummarySchema, CreateApiKeySchema, CreateCategorySchema, CreateForumSchema, CreateGroupSchema, CreatePostSchema, CreateTenantSchema, CreateThreadSchema, CreatedApiKeySchema, ErrorSchema, ForumSchema, GrantPlatformOwnerSchema, GroupMemberSchema, GroupSchema, IdSchema, KeyIdParamsSchema, MessageCountSchema, MessageIdParamsSchema, MessageSchema, NotificationCountSchema, NotificationIdParamsSchema, NotificationSchema, NotificationTypeSchema, OwnedTenantSchema, PERMISSIONS, PaginatedResponseSchema, PaginationQuerySchema, PermissionSchema, PlatformSettingKeyParamsSchema, PlatformSettingSchema, PostSchema, PostsQuerySchema, ReorderCategorySchema, ReorderForumSchema, ReorderGroupSchema, RestoreErrorSchema, RestoreTenantResponseSchema, RestoreTenantSchema, RoundtableClient, SearchQuerySchema, SearchResponseSchema, SearchResultSchema, SearchResultTypeSchema, SendMessageBodySchema, SetGroupForumsSchema, SetGroupPermissionsSchema, SetTenantOptionsSchema, SetThreadReadStatusSchema, SetUserGroupsSchema, TenantBackupSchema, TenantCategoryIdParamsSchema, TenantForumIdParamsSchema, TenantGroupIdParamsSchema, TenantIdParamsSchema, TenantOptionsSchema, TenantOwnerSchema, TenantPostIdParamsSchema, TenantSchema, TenantThreadIdParamsSchema, TenantThreadPostIdParamsSchema, TenantTokenSchema, TenantUserIdParamsSchema, ThreadReadStatusSchema, ThreadSchema, TransferTenantOwnerSchema, UpdateCategorySchema, UpdateForumSchema, UpdateGroupSchema, UpdatePlatformSettingSchema, UpdatePostSchema, UpdateTenantSchema, UpdateThreadSchema, UpdateUserProfileSchema, UserIdParamsSchema, UserMembershipSchema, UserProfileSchema, UserSearchResultSchema, UserSummarySchema };
1239
+ export type { ApiError, ApiKey, BackupCategory, BackupData, BackupGroup, BackupMembership, BackupPayload, BackupPost, BackupQuery, BackupSettings, BackupThread, Category, ConversationSummary, CreateApiKey, CreateCategory, CreateForum, CreateGroup, CreatePost, CreateTenant, CreateThread, CreatedApiKey, Forum, GrantPlatformOwner, Group, GroupMember, Id, KeyIdParams, Message, MessageCount, MessageIdParams, Notification, NotificationCount, NotificationIdParams, NotificationType, OwnedTenant, PaginatedResponse, PaginationQuery, Permission, PlatformSetting, PlatformSettingKeyParams, Post, PostsQuery, ReorderCategory, ReorderForum, ReorderGroup, RestoreError, RestoreTenant, RestoreTenantResponse, RoundtableClientOpts, SearchQuery, SearchResponse, SearchResult, SearchResultType, SendMessageBody, SetGroupForums, SetGroupPermissions, SetTenantOptions, SetThreadReadStatus, SetUserGroups, Tenant, TenantBackup, TenantCategoryIdParams, TenantForumIdParams, TenantGroupIdParams, TenantIdParams, TenantOptions, TenantOwner, TenantPostIdParams, TenantThreadIdParams, TenantThreadPostIdParams, TenantToken, TenantUserIdParams, Thread, ThreadReadStatus, TransferTenantOwner, UpdateCategory, UpdateForum, UpdateGroup, UpdatePlatformSetting, UpdatePost, UpdateTenant, UpdateThread, UpdateUserProfile, UserIdParams, UserMembership, UserProfile, UserSearchResult, UserSummary };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roundtable-bb/sdk",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"