@sublay/js 7.8.0 → 7.9.1

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 (268) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +9 -0
  3. package/README.md +23 -14
  4. package/dist/index.d.mts +374 -21
  5. package/dist/index.d.ts +4364 -31
  6. package/dist/index.js +53 -19
  7. package/dist/index.mjs +53 -19
  8. package/package.json +29 -18
  9. package/dist/core/client.d.ts +0 -64
  10. package/dist/core/multipart.d.ts +0 -22
  11. package/dist/core/spaceReputationParams.d.ts +0 -57
  12. package/dist/interfaces/AppNotification.d.ts +0 -258
  13. package/dist/interfaces/ChatMessage.d.ts +0 -32
  14. package/dist/interfaces/Collection.d.ts +0 -10
  15. package/dist/interfaces/Comment.d.ts +0 -42
  16. package/dist/interfaces/Connection.d.ts +0 -67
  17. package/dist/interfaces/Conversation.d.ts +0 -27
  18. package/dist/interfaces/ConversationMember.d.ts +0 -17
  19. package/dist/interfaces/Entity.d.ts +0 -55
  20. package/dist/interfaces/Event.d.ts +0 -66
  21. package/dist/interfaces/File.d.ts +0 -39
  22. package/dist/interfaces/Follow.d.ts +0 -19
  23. package/dist/interfaces/HostedApp.d.ts +0 -11
  24. package/dist/interfaces/IPaginatedResponse.d.ts +0 -11
  25. package/dist/interfaces/ImageProcessing.d.ts +0 -62
  26. package/dist/interfaces/Mention.d.ts +0 -12
  27. package/dist/interfaces/OAuthIdentity.d.ts +0 -14
  28. package/dist/interfaces/Project.d.ts +0 -14
  29. package/dist/interfaces/Push.d.ts +0 -74
  30. package/dist/interfaces/Reaction.d.ts +0 -23
  31. package/dist/interfaces/Report.d.ts +0 -38
  32. package/dist/interfaces/Rule.d.ts +0 -22
  33. package/dist/interfaces/Space.d.ts +0 -130
  34. package/dist/interfaces/SpaceMember.d.ts +0 -29
  35. package/dist/interfaces/SpaceReputation.d.ts +0 -100
  36. package/dist/interfaces/Table.d.ts +0 -63
  37. package/dist/interfaces/User.d.ts +0 -46
  38. package/dist/interfaces/UserSearch.d.ts +0 -13
  39. package/dist/interfaces/Workspace.d.ts +0 -148
  40. package/dist/modules/app-notifications/countUnreadNotifications.d.ts +0 -2
  41. package/dist/modules/app-notifications/fetchNotifications.d.ts +0 -8
  42. package/dist/modules/app-notifications/index.d.ts +0 -4
  43. package/dist/modules/app-notifications/markAllNotificationsAsRead.d.ts +0 -5
  44. package/dist/modules/app-notifications/markNotificationAsRead.d.ts +0 -5
  45. package/dist/modules/auth/changePassword.d.ts +0 -34
  46. package/dist/modules/auth/confirmAccountDeletion.d.ts +0 -11
  47. package/dist/modules/auth/index.d.ts +0 -13
  48. package/dist/modules/auth/requestAccountDeletion.d.ts +0 -14
  49. package/dist/modules/auth/requestNewAccessToken.d.ts +0 -16
  50. package/dist/modules/auth/requestPasswordReset.d.ts +0 -5
  51. package/dist/modules/auth/resetPassword.d.ts +0 -6
  52. package/dist/modules/auth/sendVerificationEmail.d.ts +0 -13
  53. package/dist/modules/auth/setPassword.d.ts +0 -9
  54. package/dist/modules/auth/signIn.d.ts +0 -12
  55. package/dist/modules/auth/signOut.d.ts +0 -103
  56. package/dist/modules/auth/signUp.d.ts +0 -24
  57. package/dist/modules/auth/verifyEmail.d.ts +0 -5
  58. package/dist/modules/auth/verifyExternalUser.d.ts +0 -11
  59. package/dist/modules/chat/addMember.d.ts +0 -8
  60. package/dist/modules/chat/changeMemberRole.d.ts +0 -9
  61. package/dist/modules/chat/createDirectConversation.d.ts +0 -7
  62. package/dist/modules/chat/createGroupConversation.d.ts +0 -10
  63. package/dist/modules/chat/deleteConversation.d.ts +0 -8
  64. package/dist/modules/chat/deleteMessage.d.ts +0 -11
  65. package/dist/modules/chat/editMessage.d.ts +0 -14
  66. package/dist/modules/chat/getConversation.d.ts +0 -6
  67. package/dist/modules/chat/getMessage.d.ts +0 -8
  68. package/dist/modules/chat/getUnreadCount.d.ts +0 -6
  69. package/dist/modules/chat/index.d.ts +0 -21
  70. package/dist/modules/chat/leaveConversation.d.ts +0 -7
  71. package/dist/modules/chat/listConversations.d.ts +0 -17
  72. package/dist/modules/chat/listMembers.d.ts +0 -11
  73. package/dist/modules/chat/listMessages.d.ts +0 -40
  74. package/dist/modules/chat/listReactions.d.ts +0 -24
  75. package/dist/modules/chat/markAsRead.d.ts +0 -9
  76. package/dist/modules/chat/muteConversation.d.ts +0 -23
  77. package/dist/modules/chat/removeMember.d.ts +0 -9
  78. package/dist/modules/chat/reportMessage.d.ts +0 -12
  79. package/dist/modules/chat/sendMessage.d.ts +0 -22
  80. package/dist/modules/chat/toggleReaction.d.ts +0 -16
  81. package/dist/modules/chat/updateConversation.d.ts +0 -12
  82. package/dist/modules/collections/addEntityToCollection.d.ts +0 -13
  83. package/dist/modules/collections/createNewCollection.d.ts +0 -8
  84. package/dist/modules/collections/deleteCollection.d.ts +0 -5
  85. package/dist/modules/collections/fetchCollectionEntities.d.ts +0 -13
  86. package/dist/modules/collections/fetchRootCollection.d.ts +0 -3
  87. package/dist/modules/collections/fetchSubCollections.d.ts +0 -6
  88. package/dist/modules/collections/index.d.ts +0 -8
  89. package/dist/modules/collections/removeEntityFromCollection.d.ts +0 -7
  90. package/dist/modules/collections/updateCollection.d.ts +0 -7
  91. package/dist/modules/comments/addReaction.d.ts +0 -8
  92. package/dist/modules/comments/createComment.d.ts +0 -15
  93. package/dist/modules/comments/deleteComment.d.ts +0 -5
  94. package/dist/modules/comments/fetchComment.d.ts +0 -8
  95. package/dist/modules/comments/fetchCommentByForeignId.d.ts +0 -7
  96. package/dist/modules/comments/fetchManyComments.d.ts +0 -26
  97. package/dist/modules/comments/fetchReactions.d.ts +0 -16
  98. package/dist/modules/comments/getUserReaction.d.ts +0 -9
  99. package/dist/modules/comments/index.d.ts +0 -10
  100. package/dist/modules/comments/removeReaction.d.ts +0 -6
  101. package/dist/modules/comments/updateComment.d.ts +0 -10
  102. package/dist/modules/connections/acceptConnection.d.ts +0 -6
  103. package/dist/modules/connections/declineConnection.d.ts +0 -6
  104. package/dist/modules/connections/fetchConnections.d.ts +0 -9
  105. package/dist/modules/connections/fetchConnectionsCount.d.ts +0 -3
  106. package/dist/modules/connections/fetchReceivedPendingConnections.d.ts +0 -8
  107. package/dist/modules/connections/fetchSentPendingConnections.d.ts +0 -8
  108. package/dist/modules/connections/index.d.ts +0 -7
  109. package/dist/modules/connections/removeConnection.d.ts +0 -5
  110. package/dist/modules/entities/addReaction.d.ts +0 -8
  111. package/dist/modules/entities/createEntity.d.ts +0 -23
  112. package/dist/modules/entities/deleteEntity.d.ts +0 -5
  113. package/dist/modules/entities/fetchDrafts.d.ts +0 -11
  114. package/dist/modules/entities/fetchEntity.d.ts +0 -8
  115. package/dist/modules/entities/fetchEntityByForeignId.d.ts +0 -8
  116. package/dist/modules/entities/fetchEntityByShortId.d.ts +0 -7
  117. package/dist/modules/entities/fetchManyEntities.d.ts +0 -65
  118. package/dist/modules/entities/fetchReactions.d.ts +0 -16
  119. package/dist/modules/entities/fetchTopComment.d.ts +0 -6
  120. package/dist/modules/entities/getUserReaction.d.ts +0 -9
  121. package/dist/modules/entities/index.d.ts +0 -15
  122. package/dist/modules/entities/isEntitySaved.d.ts +0 -12
  123. package/dist/modules/entities/publishDraft.d.ts +0 -6
  124. package/dist/modules/entities/removeReaction.d.ts +0 -6
  125. package/dist/modules/entities/updateEntity.d.ts +0 -18
  126. package/dist/modules/events/addHost.d.ts +0 -8
  127. package/dist/modules/events/addInvite.d.ts +0 -8
  128. package/dist/modules/events/cancelEvent.d.ts +0 -6
  129. package/dist/modules/events/createEvent.d.ts +0 -49
  130. package/dist/modules/events/deleteEvent.d.ts +0 -5
  131. package/dist/modules/events/fetchEvent.d.ts +0 -8
  132. package/dist/modules/events/fetchEventRsvps.d.ts +0 -19
  133. package/dist/modules/events/fetchInvitees.d.ts +0 -12
  134. package/dist/modules/events/fetchManyEvents.d.ts +0 -42
  135. package/dist/modules/events/index.d.ts +0 -14
  136. package/dist/modules/events/removeHost.d.ts +0 -8
  137. package/dist/modules/events/removeInvite.d.ts +0 -8
  138. package/dist/modules/events/setRsvp.d.ts +0 -7
  139. package/dist/modules/events/updateEvent.d.ts +0 -43
  140. package/dist/modules/events/withdrawRsvp.d.ts +0 -6
  141. package/dist/modules/follows/deleteFollow.d.ts +0 -5
  142. package/dist/modules/follows/fetchFollowers.d.ts +0 -9
  143. package/dist/modules/follows/fetchFollowersCount.d.ts +0 -5
  144. package/dist/modules/follows/fetchFollowing.d.ts +0 -9
  145. package/dist/modules/follows/fetchFollowingCount.d.ts +0 -5
  146. package/dist/modules/follows/index.d.ts +0 -5
  147. package/dist/modules/oauth/authorize.d.ts +0 -25
  148. package/dist/modules/oauth/index.d.ts +0 -4
  149. package/dist/modules/oauth/linkIdentity.d.ts +0 -14
  150. package/dist/modules/oauth/listIdentities.d.ts +0 -4
  151. package/dist/modules/oauth/unlinkIdentity.d.ts +0 -12
  152. package/dist/modules/push/getNotificationPreferences.d.ts +0 -11
  153. package/dist/modules/push/index.d.ts +0 -2
  154. package/dist/modules/push/updateNotificationPreferences.d.ts +0 -16
  155. package/dist/modules/reports/createReport.d.ts +0 -9
  156. package/dist/modules/reports/fetchModeratedReports.d.ts +0 -13
  157. package/dist/modules/reports/index.d.ts +0 -2
  158. package/dist/modules/search/askContent.d.ts +0 -58
  159. package/dist/modules/search/index.d.ts +0 -5
  160. package/dist/modules/search/matchUsers.d.ts +0 -36
  161. package/dist/modules/search/searchContent.d.ts +0 -24
  162. package/dist/modules/search/searchSpaces.d.ts +0 -11
  163. package/dist/modules/search/searchUsers.d.ts +0 -11
  164. package/dist/modules/spaces/approveMembership.d.ts +0 -7
  165. package/dist/modules/spaces/banMember.d.ts +0 -13
  166. package/dist/modules/spaces/checkMyMembership.d.ts +0 -6
  167. package/dist/modules/spaces/checkSlugAvailability.d.ts +0 -8
  168. package/dist/modules/spaces/createRule.d.ts +0 -8
  169. package/dist/modules/spaces/createSpace.d.ts +0 -29
  170. package/dist/modules/spaces/declineMembership.d.ts +0 -7
  171. package/dist/modules/spaces/deleteRule.d.ts +0 -7
  172. package/dist/modules/spaces/deleteSpace.d.ts +0 -6
  173. package/dist/modules/spaces/fetchChildSpaces.d.ts +0 -11
  174. package/dist/modules/spaces/fetchDigestConfig.d.ts +0 -6
  175. package/dist/modules/spaces/fetchManyRules.d.ts +0 -6
  176. package/dist/modules/spaces/fetchManySpaces.d.ts +0 -17
  177. package/dist/modules/spaces/fetchMutualSpaces.d.ts +0 -11
  178. package/dist/modules/spaces/fetchRule.d.ts +0 -7
  179. package/dist/modules/spaces/fetchSpace.d.ts +0 -6
  180. package/dist/modules/spaces/fetchSpaceBreadcrumb.d.ts +0 -6
  181. package/dist/modules/spaces/fetchSpaceByShortId.d.ts +0 -6
  182. package/dist/modules/spaces/fetchSpaceBySlug.d.ts +0 -6
  183. package/dist/modules/spaces/fetchSpaceMembers.d.ts +0 -11
  184. package/dist/modules/spaces/fetchSpaceTeam.d.ts +0 -7
  185. package/dist/modules/spaces/fetchUserSpaces.d.ts +0 -17
  186. package/dist/modules/spaces/getSpaceConversation.d.ts +0 -6
  187. package/dist/modules/spaces/handleCommentReport.d.ts +0 -14
  188. package/dist/modules/spaces/handleEntityReport.d.ts +0 -17
  189. package/dist/modules/spaces/handleSpaceChatReport.d.ts +0 -18
  190. package/dist/modules/spaces/index.d.ts +0 -36
  191. package/dist/modules/spaces/joinSpace.d.ts +0 -6
  192. package/dist/modules/spaces/leaveSpace.d.ts +0 -6
  193. package/dist/modules/spaces/moderateSpaceChatMessage.d.ts +0 -12
  194. package/dist/modules/spaces/moderateSpaceComment.d.ts +0 -9
  195. package/dist/modules/spaces/moderateSpaceEntity.d.ts +0 -12
  196. package/dist/modules/spaces/reorderRules.d.ts +0 -7
  197. package/dist/modules/spaces/setSpaceEntityNsfw.d.ts +0 -16
  198. package/dist/modules/spaces/unbanMember.d.ts +0 -13
  199. package/dist/modules/spaces/updateDigestConfig.d.ts +0 -11
  200. package/dist/modules/spaces/updateMemberRole.d.ts +0 -8
  201. package/dist/modules/spaces/updateRule.d.ts +0 -9
  202. package/dist/modules/spaces/updateSpace.d.ts +0 -22
  203. package/dist/modules/storage/deleteFile.d.ts +0 -5
  204. package/dist/modules/storage/getFile.d.ts +0 -34
  205. package/dist/modules/storage/index.d.ts +0 -4
  206. package/dist/modules/storage/uploadFile.d.ts +0 -30
  207. package/dist/modules/storage/uploadImage.d.ts +0 -42
  208. package/dist/modules/tables/bulkCreate.d.ts +0 -4
  209. package/dist/modules/tables/bulkDelete.d.ts +0 -7
  210. package/dist/modules/tables/create.d.ts +0 -4
  211. package/dist/modules/tables/createTableAccessor.d.ts +0 -9
  212. package/dist/modules/tables/deleteRow.d.ts +0 -9
  213. package/dist/modules/tables/find.d.ts +0 -8
  214. package/dist/modules/tables/findOne.d.ts +0 -7
  215. package/dist/modules/tables/index.d.ts +0 -9
  216. package/dist/modules/tables/restore.d.ts +0 -6
  217. package/dist/modules/tables/update.d.ts +0 -4
  218. package/dist/modules/users/checkUsernameAvailability.d.ts +0 -8
  219. package/dist/modules/users/createBlock.d.ts +0 -19
  220. package/dist/modules/users/createFollow.d.ts +0 -7
  221. package/dist/modules/users/deleteBlock.d.ts +0 -13
  222. package/dist/modules/users/deleteFollow.d.ts +0 -6
  223. package/dist/modules/users/fetchBlockStatus.d.ts +0 -23
  224. package/dist/modules/users/fetchBlockedUsers.d.ts +0 -19
  225. package/dist/modules/users/fetchConnectionStatus.d.ts +0 -10
  226. package/dist/modules/users/fetchConnectionsByUserId.d.ts +0 -11
  227. package/dist/modules/users/fetchConnectionsCountByUserId.d.ts +0 -6
  228. package/dist/modules/users/fetchFollowStatus.d.ts +0 -14
  229. package/dist/modules/users/fetchFollowersByUserId.d.ts +0 -11
  230. package/dist/modules/users/fetchFollowersCountByUserId.d.ts +0 -8
  231. package/dist/modules/users/fetchFollowingByUserId.d.ts +0 -11
  232. package/dist/modules/users/fetchFollowingCountByUserId.d.ts +0 -8
  233. package/dist/modules/users/fetchUserByForeignId.d.ts +0 -8
  234. package/dist/modules/users/fetchUserById.d.ts +0 -8
  235. package/dist/modules/users/fetchUserByUsername.d.ts +0 -8
  236. package/dist/modules/users/fetchUserSuggestions.d.ts +0 -7
  237. package/dist/modules/users/index.d.ts +0 -22
  238. package/dist/modules/users/removeConnectionByUserId.d.ts +0 -10
  239. package/dist/modules/users/requestConnection.d.ts +0 -11
  240. package/dist/modules/users/updateUser.d.ts +0 -32
  241. package/dist/modules/workspaces/acceptInvite.d.ts +0 -13
  242. package/dist/modules/workspaces/acceptWorkspaceInvite.d.ts +0 -13
  243. package/dist/modules/workspaces/createInvite.d.ts +0 -17
  244. package/dist/modules/workspaces/createWorkspace.d.ts +0 -12
  245. package/dist/modules/workspaces/createWorkspaceInvite.d.ts +0 -17
  246. package/dist/modules/workspaces/declineInvite.d.ts +0 -12
  247. package/dist/modules/workspaces/declineWorkspaceInvite.d.ts +0 -14
  248. package/dist/modules/workspaces/deleteWorkspace.d.ts +0 -13
  249. package/dist/modules/workspaces/fetchManyWorkspaces.d.ts +0 -13
  250. package/dist/modules/workspaces/fetchMembers.d.ts +0 -13
  251. package/dist/modules/workspaces/fetchMyInvites.d.ts +0 -11
  252. package/dist/modules/workspaces/fetchMyWorkspaceInvites.d.ts +0 -15
  253. package/dist/modules/workspaces/fetchWorkspace.d.ts +0 -7
  254. package/dist/modules/workspaces/fetchWorkspaceAuthority.d.ts +0 -11
  255. package/dist/modules/workspaces/fetchWorkspaceInvites.d.ts +0 -17
  256. package/dist/modules/workspaces/fetchWorkspaceMemberStanding.d.ts +0 -11
  257. package/dist/modules/workspaces/fetchWorkspaceMembers.d.ts +0 -13
  258. package/dist/modules/workspaces/getAuthority.d.ts +0 -11
  259. package/dist/modules/workspaces/index.d.ts +0 -21
  260. package/dist/modules/workspaces/leaveWorkspace.d.ts +0 -11
  261. package/dist/modules/workspaces/removeWorkspaceMember.d.ts +0 -12
  262. package/dist/modules/workspaces/removeWorkspaceMemberFromSubtree.d.ts +0 -16
  263. package/dist/modules/workspaces/resendWorkspaceInvite.d.ts +0 -12
  264. package/dist/modules/workspaces/revokeWorkspaceInvite.d.ts +0 -13
  265. package/dist/modules/workspaces/transferWorkspaceOwnership.d.ts +0 -15
  266. package/dist/modules/workspaces/updateWorkspace.d.ts +0 -12
  267. package/dist/modules/workspaces/updateWorkspaceInheritFlag.d.ts +0 -13
  268. package/dist/modules/workspaces/updateWorkspaceMember.d.ts +0 -17
@@ -1,62 +0,0 @@
1
- export type ImageFit = "cover" | "contain" | "inside" | "outside";
2
- export type ImageFormat = "webp" | "jpeg" | "png" | "original";
3
- interface BaseImageOptions {
4
- /** 1–100. Output quality. */
5
- quality?: number;
6
- format?: ImageFormat;
7
- stripExif?: boolean;
8
- }
9
- /** Mode 1 — explicit width/height per named variant. */
10
- export interface ExactDimensionsOptions extends BaseImageOptions {
11
- mode: "exact-dimensions";
12
- /** Keyed by variant name, e.g. `{ thumbnail: { width, height } }`. 50–10000. */
13
- dimensions: Record<string, {
14
- width: number;
15
- height: number;
16
- }>;
17
- fit?: ImageFit;
18
- }
19
- /** Mode 2a — fixed aspect ratio, sized by width per variant. */
20
- export interface AspectRatioWidthOptions extends BaseImageOptions {
21
- mode: "aspect-ratio-width-based";
22
- aspectRatio: {
23
- width: number;
24
- height: number;
25
- };
26
- /** Keyed by variant name → target width (50–10000). */
27
- widths: Record<string, number>;
28
- fit?: ImageFit;
29
- }
30
- /** Mode 2b — fixed aspect ratio, sized by height per variant. */
31
- export interface AspectRatioHeightOptions extends BaseImageOptions {
32
- mode: "aspect-ratio-height-based";
33
- aspectRatio: {
34
- width: number;
35
- height: number;
36
- };
37
- /** Keyed by variant name → target height (50–10000). */
38
- heights: Record<string, number>;
39
- fit?: ImageFit;
40
- }
41
- /** Mode 3 — preserve the source aspect ratio, bounded per variant. */
42
- export interface OriginalAspectOptions extends BaseImageOptions {
43
- mode: "original-aspect";
44
- /** Keyed by variant name → bounding size (50–10000). */
45
- sizes: Record<string, number>;
46
- /** Server restricts this mode to `inside` | `outside`. */
47
- fit?: "inside" | "outside";
48
- }
49
- /** Mode 4 — multiple aspect ratios, sized per variant. */
50
- export interface MultiAspectRatioOptions extends BaseImageOptions {
51
- mode: "multi-aspect-ratio";
52
- /** 1–10 aspect ratios. */
53
- aspectRatios: {
54
- width: number;
55
- height: number;
56
- }[];
57
- /** Keyed by variant name → target size (50–10000). */
58
- sizes: Record<string, number>;
59
- fit?: ImageFit;
60
- }
61
- export type ImageOptions = ExactDimensionsOptions | AspectRatioWidthOptions | AspectRatioHeightOptions | OriginalAspectOptions | MultiAspectRatioOptions;
62
- export {};
@@ -1,12 +0,0 @@
1
- export type Mention = UserMention | SpaceMention;
2
- export interface UserMention {
3
- type: "user";
4
- id: string;
5
- foreignId?: string | null;
6
- username: string;
7
- }
8
- export interface SpaceMention {
9
- type: "space";
10
- id: string;
11
- slug: string;
12
- }
@@ -1,14 +0,0 @@
1
- export interface OAuthIdentity {
2
- id: string;
3
- provider: string;
4
- providerAccountId: string;
5
- email: string | null;
6
- name: string | null;
7
- avatar: string | null;
8
- isVerified: boolean;
9
- createdAt: string;
10
- }
11
- export interface ListIdentitiesResponse {
12
- identities: OAuthIdentity[];
13
- hasPassword: boolean;
14
- }
@@ -1,14 +0,0 @@
1
- export interface Project {
2
- id: string;
3
- clientId: string;
4
- name: string;
5
- integrations: {
6
- id: string;
7
- projectId: string;
8
- name: string;
9
- data: Record<string, any>;
10
- createdAt: string;
11
- }[];
12
- createdAt: string;
13
- updatedAt: string;
14
- }
@@ -1,74 +0,0 @@
1
- /**
2
- * Every push event type — the full app-notification type set plus the chat
3
- * `message` event (push-only). Mirrors the server's `PUSH_EVENT_TYPES` exactly
4
- * (server `src/constants/push/pushEvents.ts`); these are the only names a
5
- * `disabledTypes` set may contain.
6
- */
7
- export declare const PUSH_EVENT_TYPES: readonly ["entity-comment", "comment-reply", "entity-mention", "comment-mention", "entity-reaction", "comment-reaction", "entity-reaction-milestone-specific", "entity-reaction-milestone-total", "comment-reaction-milestone-specific", "comment-reaction-milestone-total", "new-follow", "connection-request", "connection-accepted", "space-membership-approved", "event-invite", "event-updated", "event-cancelled", "message"];
8
- export type PushEventType = (typeof PUSH_EVENT_TYPES)[number];
9
- /**
10
- * The four conversation-mute duration choices. Send the CHOICE, never a raw
11
- * timestamp — the server resolves it and represents "forever" via the explicit
12
- * `mutedForever` signal on the returned member. Mirrors the server's
13
- * `MUTE_DURATIONS` (server `src/helpers/push/muteDuration.ts`).
14
- */
15
- export declare const MUTE_DURATIONS: readonly ["8h", "24h", "1w", "forever"];
16
- export type MuteDuration = (typeof MUTE_DURATIONS)[number];
17
- /** Response of read/update notification preferences. */
18
- export interface NotificationPreferences {
19
- disabledTypes: PushEventType[];
20
- }
21
- /**
22
- * A Web Push subscription in its SERIALIZED form — the JSON the server reads,
23
- * not the live browser object.
24
- *
25
- * A `PushSubscription` straight from `PushManager.subscribe()` does NOT satisfy
26
- * this type. It exposes its keys only through `getKey(name)`; there is no `keys`
27
- * property to read, so it is not assignable here under strict TypeScript, and
28
- * passing one through a cast sends a body the server rejects.
29
- *
30
- * To produce a value of this type:
31
- *
32
- * 1. **Serialize** the subscription with `subscription.toJSON()`.
33
- * 2. **Confirm** `endpoint`, `keys.p256dh` and `keys.auth` are all present —
34
- * `PushSubscriptionJSON` types every one of them as optional, while the
35
- * server requires all three as non-empty strings and 400s otherwise.
36
- *
37
- * ```ts
38
- * const json = subscription.toJSON();
39
- * if (!json.endpoint || !json.keys?.p256dh || !json.keys?.auth) {
40
- * throw new Error("Incomplete Web Push subscription");
41
- * }
42
- * const webPushSubscription: WebPushSubscription = {
43
- * endpoint: json.endpoint,
44
- * keys: { p256dh: json.keys.p256dh, auth: json.keys.auth },
45
- * };
46
- * ```
47
- *
48
- * Mirrors the server's `webPushSubscriptionSchema`
49
- * (server `src/v7/validation/push-notifications/push-notifications.schema.ts`).
50
- */
51
- export interface WebPushSubscription {
52
- endpoint: string;
53
- keys: {
54
- p256dh: string;
55
- auth: string;
56
- };
57
- }
58
- /**
59
- * Identifies one physical device. Mirrors the server's device-identifier body
60
- * exactly (server `src/v7/validation/push-notifications/push-notifications.schema.ts`):
61
- * a provider token for `ios`/`android`, a Web Push subscription for `web`. The
62
- * union encodes the server's own cross-check — it rejects the same
63
- * combinations the server's `superRefine` rejects.
64
- *
65
- * Passed to `auth.signOut` to unbind that device's push binding in the same
66
- * transaction as the sign-out.
67
- */
68
- export type PushDeviceIdentifier = {
69
- platform: "ios" | "android";
70
- token: string;
71
- } | {
72
- platform: "web";
73
- subscription: WebPushSubscription;
74
- };
@@ -1,23 +0,0 @@
1
- import { User } from "./User";
2
- export type ReactionType = "upvote" | "downvote" | "like" | "love" | "wow" | "sad" | "angry" | "funny";
3
- export interface ReactionCounts {
4
- upvote: number;
5
- downvote: number;
6
- like: number;
7
- love: number;
8
- wow: number;
9
- sad: number;
10
- angry: number;
11
- funny: number;
12
- }
13
- export interface Reaction {
14
- id: string;
15
- projectId: string;
16
- targetType: "entity" | "comment";
17
- targetId: string;
18
- userId: string;
19
- reactionType: ReactionType;
20
- createdAt: string;
21
- updatedAt: string;
22
- user?: User;
23
- }
@@ -1,38 +0,0 @@
1
- import { Entity } from "./Entity";
2
- import { Comment } from "./Comment";
3
- import { Space } from "./Space";
4
- export type ReportTargetType = "entity" | "comment" | "message";
5
- /**
6
- * The reasons the API accepts on a report. Server-enforced — anything outside
7
- * this set is rejected with `report/invalid-body`. Use `other` plus `details`
8
- * for anything the taxonomy doesn't cover.
9
- */
10
- export type ReportReason = "spam" | "inappropriateContent" | "harassment" | "misinformation" | "hateSpeech" | "violence" | "illegalActivity" | "selfHarm" | "other";
11
- export type ReportStatus = "pending" | "on-hold" | "escalated" | "dismissed" | "actioned";
12
- export interface UserReport {
13
- id: string;
14
- projectId: string;
15
- reportId: string;
16
- userId: string;
17
- reason: string;
18
- details: string | null;
19
- createdAt: string;
20
- }
21
- export interface Report {
22
- id: string;
23
- projectId: string;
24
- spaceId: string | null;
25
- targetId: string;
26
- targetType: ReportTargetType;
27
- status: ReportStatus;
28
- reporterCount: number;
29
- createdAt: string;
30
- updatedAt: string;
31
- userReports?: UserReport[];
32
- target?: Entity | Comment | null;
33
- space?: Space | null;
34
- }
35
- export interface CreateReportResponse {
36
- message: string;
37
- code: "report/created" | "report/updated" | "report/already-reported";
38
- }
@@ -1,22 +0,0 @@
1
- export interface Rule {
2
- id: string;
3
- projectId: string;
4
- spaceId: string;
5
- title: string;
6
- description: string | null;
7
- order: number;
8
- lastApprovedBy: string | null;
9
- createdAt: string;
10
- updatedAt: string;
11
- }
12
- export interface FetchManyRulesResponse {
13
- data: Rule[];
14
- count: number;
15
- }
16
- export interface DeleteRuleResponse {
17
- message: string;
18
- deletedRule: {
19
- id: string;
20
- title: string;
21
- };
22
- }
@@ -1,130 +0,0 @@
1
- import { PaginatedResponse } from "./IPaginatedResponse";
2
- import { File } from "./File";
3
- export type ReadingPermission = "anyone" | "members";
4
- export type PostingPermission = "anyone" | "members" | "admins";
5
- export type SpaceVisibility = "public" | "unlisted" | "private";
6
- export type SpaceMemberRole = "admin" | "moderator" | "member";
7
- export type SpaceMemberStatus = "pending" | "active" | "banned" | "rejected";
8
- export interface SpaceMemberPermissions {
9
- isAdmin: boolean;
10
- isModerator: boolean;
11
- isMember: boolean;
12
- status: "pending" | "active" | "banned" | null;
13
- canPost: boolean;
14
- canModerate: boolean;
15
- canRead: boolean;
16
- }
17
- export interface SpacePreview {
18
- id: string;
19
- shortId: string;
20
- name: string;
21
- slug: string | null;
22
- avatarFileId: string | null;
23
- readingPermission?: ReadingPermission;
24
- visibility?: SpaceVisibility;
25
- parentSpaceId?: string | null;
26
- depth?: number;
27
- avatarFile?: File;
28
- }
29
- export interface Space {
30
- id: string;
31
- projectId: string;
32
- shortId: string;
33
- slug: string | null;
34
- name: string;
35
- description: string | null;
36
- avatarFileId: string | null;
37
- bannerFileId: string | null;
38
- userId: string;
39
- readingPermission: ReadingPermission;
40
- postingPermission: PostingPermission;
41
- visibility: SpaceVisibility;
42
- requireJoinApproval: boolean;
43
- nsfw: boolean;
44
- nsfwEffective: boolean;
45
- parentSpaceId: string | null;
46
- depth: number;
47
- metadata: Record<string, any>;
48
- createdAt: string;
49
- updatedAt: string;
50
- deletedAt: string | null;
51
- membersCount: number;
52
- childSpacesCount: number;
53
- isMember?: boolean;
54
- avatarFile?: File;
55
- bannerFile?: File;
56
- }
57
- export interface SpaceDetailed extends Space {
58
- memberPermissions: SpaceMemberPermissions | null;
59
- parentSpace: SpacePreview | null;
60
- childSpaces: SpacePreview[];
61
- }
62
- export interface UserSpaceItem {
63
- space: Space;
64
- membership: {
65
- membershipId: string;
66
- role: SpaceMemberRole;
67
- status: SpaceMemberStatus;
68
- joinedAt: string;
69
- };
70
- }
71
- export type UserSpacesResponse = PaginatedResponse<UserSpaceItem>;
72
- export interface JoinSpaceResponse {
73
- message: string;
74
- membership: {
75
- id: string;
76
- spaceId: string;
77
- userId: string;
78
- role: "member";
79
- status: "pending" | "active";
80
- joinedAt: string;
81
- };
82
- }
83
- export interface LeaveSpaceResponse {
84
- message: string;
85
- }
86
- export interface UpdateMemberRoleResponse {
87
- message: string;
88
- membership: {
89
- id: string;
90
- role: SpaceMemberRole;
91
- status: string;
92
- joinedAt: string;
93
- userId: string;
94
- };
95
- }
96
- export interface ApproveMemberResponse {
97
- message: string;
98
- membership: {
99
- id: string;
100
- status: "active";
101
- joinedAt: string;
102
- };
103
- }
104
- export interface DeclineMemberResponse {
105
- message: string;
106
- membership: {
107
- id: string;
108
- status: "rejected";
109
- };
110
- }
111
- export interface CheckMyMembershipResponse {
112
- isMember: boolean;
113
- role: "admin" | "moderator" | "member" | null;
114
- status: "pending" | "active" | "banned" | "rejected" | null;
115
- joinedAt: string | null;
116
- permissions: {
117
- canPost: boolean;
118
- canModerate: boolean;
119
- canRead: boolean;
120
- isAdmin: boolean;
121
- isModerator: boolean;
122
- };
123
- }
124
- export interface DeleteSpaceResponse {
125
- message: string;
126
- }
127
- export interface SpaceBreadcrumb {
128
- breadcrumb: SpacePreview[];
129
- depth: number;
130
- }
@@ -1,29 +0,0 @@
1
- import { PaginatedResponse } from "./IPaginatedResponse";
2
- import { SpaceMemberRole, SpaceMemberStatus } from "./Space";
3
- export interface SpaceMember {
4
- id: string;
5
- projectId: string;
6
- spaceId: string;
7
- userId: string;
8
- role: SpaceMemberRole;
9
- status: SpaceMemberStatus;
10
- joinedAt: string;
11
- createdAt: string;
12
- }
13
- export interface SpaceMemberWithUser {
14
- membershipId: string;
15
- role: SpaceMemberRole;
16
- status: SpaceMemberStatus;
17
- joinedAt: string;
18
- user: {
19
- id: string;
20
- username: string;
21
- displayName: string;
22
- avatar: string;
23
- metadata: object;
24
- };
25
- }
26
- export type SpaceMembersResponse = PaginatedResponse<SpaceMemberWithUser>;
27
- export interface SpaceTeamResponse {
28
- data: SpaceMemberWithUser[];
29
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * Shared optional params for opting a request into space-scoped reputation
3
- * enrichment. When set, users embedded in the response carry a
4
- * `spaceReputation` field (see {@link import("./User").UserFull}).
5
- *
6
- * Two variants exist because the server accepts a different value set per
7
- * endpoint class:
8
- * - {@link SpaceReputationContextParams} — context endpoints (entities,
9
- * comments, chat, spaces, search, reports). Accept `<uuid> | "none" |
10
- * "context"`.
11
- * - {@link SpaceReputationUserParams} — user-direct endpoints (the `users`
12
- * module). Accept `<uuid> | "none"` only; `"context"` is rejected by the
13
- * server (400).
14
- *
15
- * Both classes share the same param names and types — only the accepted
16
- * `spaceReputationId` value set (documented in JSDoc) differs.
17
- */
18
- /**
19
- * Space-reputation params for **context** endpoints.
20
- */
21
- export interface SpaceReputationContextParams {
22
- /**
23
- * Opt into space-scoped reputation enrichment. The primary form: an object
24
- * describing the space and whether to include descendants.
25
- *
26
- * - `spaceId` — a space `<uuid>` (reputation within that specific space),
27
- * `"none"` (no space context — global reputation only), or `"context"`
28
- * (derive the space from each record's own context, e.g. a feed enriches
29
- * each row's author with reputation in that row's space).
30
- * - `includeDescendants` — whether to include descendant spaces when
31
- * computing space-scoped reputation. Only honored with an explicit space
32
- * `<uuid>` (ignored for `"none"` / `"context"`).
33
- */
34
- spaceReputation?: {
35
- spaceId: string | "none" | "context";
36
- includeDescendants?: boolean;
37
- };
38
- /**
39
- * @deprecated Pass the `spaceReputation` object instead. Retained for
40
- * back-compat; removal is a later major version.
41
- *
42
- * Opt into space-scoped reputation enrichment. Accepted forms:
43
- * - a space `<uuid>` — reputation within that specific space;
44
- * - `"none"` — no space context (global reputation only);
45
- * - `"context"` — derive the space from each record's own context
46
- * (e.g. a feed enriches each row's author with reputation in that row's
47
- * space).
48
- */
49
- spaceReputationId?: string;
50
- /**
51
- * @deprecated Pass the `spaceReputation` object (`includeDescendants`)
52
- * instead. Retained for back-compat; removal is a later major version.
53
- *
54
- * Whether to include descendant spaces when computing space-scoped
55
- * reputation. Only honored with an explicit space `<uuid>` (ignored for
56
- * `"none"` / `"context"`).
57
- */
58
- spaceReputationDescendants?: boolean;
59
- }
60
- /**
61
- * Space-reputation params for **user-direct** endpoints (the `users` module).
62
- */
63
- export interface SpaceReputationUserParams {
64
- /**
65
- * Opt into space-scoped reputation enrichment. The primary form: an object
66
- * describing the space and whether to include descendants.
67
- *
68
- * - `spaceId` — a space `<uuid>` (reputation within that specific space) or
69
- * `"none"` (no space context — global reputation only). `"context"` is
70
- * **rejected by the server (400)** on user-direct endpoints — there is no
71
- * per-record context to derive a space from.
72
- * - `includeDescendants` — whether to include descendant spaces when
73
- * computing space-scoped reputation. Only honored with an explicit space
74
- * `<uuid>`.
75
- */
76
- spaceReputation?: {
77
- spaceId: string | "none";
78
- includeDescendants?: boolean;
79
- };
80
- /**
81
- * @deprecated Pass the `spaceReputation` object instead. Retained for
82
- * back-compat; removal is a later major version.
83
- *
84
- * Opt into space-scoped reputation enrichment. Accepted forms:
85
- * - a space `<uuid>` — reputation within that specific space;
86
- * - `"none"` — no space context (global reputation only).
87
- *
88
- * `"context"` is **rejected by the server (400)** on user-direct endpoints —
89
- * there is no per-record context to derive a space from.
90
- */
91
- spaceReputationId?: string;
92
- /**
93
- * @deprecated Pass the `spaceReputation` object (`includeDescendants`)
94
- * instead. Retained for back-compat; removal is a later major version.
95
- *
96
- * Whether to include descendant spaces when computing space-scoped
97
- * reputation. Only honored with an explicit space `<uuid>`.
98
- */
99
- spaceReputationDescendants?: boolean;
100
- }
@@ -1,63 +0,0 @@
1
- import { SublayHttpClient } from "../core/client";
2
- import { PaginatedResponse } from "./IPaginatedResponse";
3
- /**
4
- * Custom-table types for the `/db` surface (row ops only — the js-sdk holds no
5
- * service key, so it carries no table-management/DDL surface).
6
- *
7
- * Names mirror the server's `/db` contract exactly.
8
- */
9
- export type DbFilterOperator = "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "contains" | "like" | "isNull";
10
- export interface DbFilter {
11
- column: string;
12
- operator: DbFilterOperator;
13
- value?: unknown;
14
- }
15
- export interface TableQuery {
16
- page?: number;
17
- limit?: number;
18
- sortBy?: string;
19
- sortDir?: "asc" | "desc";
20
- /** AND-combined filter clauses. Serialized to a JSON query param. */
21
- filters?: DbFilter[];
22
- /** Surface soft-deleted rows on a paranoid table. */
23
- includeDeleted?: boolean;
24
- }
25
- /** Shape every custom-table row shares (managed columns). */
26
- export interface TableRow {
27
- id: string;
28
- createdAt?: string;
29
- updatedAt?: string;
30
- deletedAt?: string | null;
31
- [column: string]: unknown;
32
- }
33
- export interface DeleteResult {
34
- deleted: boolean;
35
- soft: boolean;
36
- }
37
- export interface BulkDeleteResult {
38
- deletedCount: number;
39
- soft: boolean;
40
- }
41
- export interface BulkDeleteProps {
42
- rowIds?: string[];
43
- filters?: DbFilter[];
44
- force?: boolean;
45
- }
46
- /**
47
- * Per-table row-operations accessor returned by `client.table<T>(name)`.
48
- * The actor is derived server-side from the user token (js-sdk Rule A) — no
49
- * actor params here. No DDL surface (no service key).
50
- */
51
- export interface TableAccessor<T = TableRow> {
52
- find(query?: TableQuery): Promise<PaginatedResponse<T>>;
53
- findOne(rowId: string): Promise<T>;
54
- create(data: Partial<T> | Record<string, unknown>): Promise<T>;
55
- bulkCreate(rows: Array<Partial<T> | Record<string, unknown>>): Promise<T[]>;
56
- update(rowId: string, data: Partial<T> | Record<string, unknown>): Promise<T>;
57
- delete(rowId: string, opts?: {
58
- force?: boolean;
59
- }): Promise<DeleteResult>;
60
- bulkDelete(params: BulkDeleteProps): Promise<BulkDeleteResult>;
61
- restore(rowId: string): Promise<T>;
62
- }
63
- export type TableAccessorFactory = <T = TableRow>(client: SublayHttpClient, tableName: string) => TableAccessor<T>;
@@ -1,46 +0,0 @@
1
- import { File } from "./File";
2
- export type UserRole = "admin" | "moderator" | "visitor";
3
- export type UserFull = {
4
- id: string;
5
- projectId: string;
6
- foreignId: string | null;
7
- role: UserRole;
8
- email: string | null;
9
- name: string | null;
10
- username: string | null;
11
- avatar: string | null;
12
- avatarFileId: string | null;
13
- bannerFileId: string | null;
14
- avatarFile?: File | null;
15
- bannerFile?: File | null;
16
- bio: string | null;
17
- birthdate: string | null;
18
- location: {
19
- type: "Point";
20
- coordinates: [number, number];
21
- } | null;
22
- metadata: Record<string, any>;
23
- secureMetadata: Record<string, any>;
24
- reputation: number;
25
- /**
26
- * Space-scoped reputation, present only when the request opted in via
27
- * `spaceReputationId` (and the project has the reputation bundle). It is the
28
- * user's reputation within the requested space context — see
29
- * {@link SpaceReputationContextParams} / {@link SpaceReputationUserParams}.
30
- */
31
- spaceReputation?: number;
32
- isVerified: boolean;
33
- isActive: boolean;
34
- lastActive: string;
35
- createdAt: string;
36
- updatedAt: string;
37
- };
38
- export type AuthUser = Omit<UserFull, "secureMetadata"> & {
39
- suspensions: {
40
- reason: string | null;
41
- startDate: string;
42
- endDate: string | null;
43
- }[];
44
- authMethods: string[];
45
- };
46
- export type User = Omit<UserFull, "email" | "secureMetadata" | "isVerified" | "isActive" | "lastActive" | "updatedAt">;
@@ -1,13 +0,0 @@
1
- /**
2
- * Shared optional params for text-searching a list of users
3
- * (followers / following / connections).
4
- *
5
- * - `query` — free-text search term. When omitted, no filtering is applied.
6
- * - `searchFields` — narrows which user field the term matches against. When
7
- * omitted, the term matches either `username` OR `name` (case-insensitive
8
- * substring). `"username"` / `"name"` restrict the match to that one field.
9
- */
10
- export interface UserSearchParams {
11
- query?: string;
12
- searchFields?: "username" | "name";
13
- }