@sublay/js 7.9.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 (272) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +9 -0
  3. package/README.md +23 -14
  4. package/dist/index.d.mts +38 -7
  5. package/dist/index.d.ts +4363 -35
  6. package/dist/index.js +1 -1
  7. package/dist/index.mjs +1 -1
  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 -40
  14. package/dist/interfaces/Collection.d.ts +0 -10
  15. package/dist/interfaces/Comment.d.ts +0 -50
  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 -63
  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/ReputationGrant.d.ts +0 -85
  33. package/dist/interfaces/Rule.d.ts +0 -22
  34. package/dist/interfaces/Space.d.ts +0 -130
  35. package/dist/interfaces/SpaceMember.d.ts +0 -29
  36. package/dist/interfaces/SpaceReputation.d.ts +0 -100
  37. package/dist/interfaces/Table.d.ts +0 -63
  38. package/dist/interfaces/User.d.ts +0 -46
  39. package/dist/interfaces/UserSearch.d.ts +0 -13
  40. package/dist/interfaces/Workspace.d.ts +0 -178
  41. package/dist/modules/app-notifications/countUnreadNotifications.d.ts +0 -2
  42. package/dist/modules/app-notifications/fetchNotifications.d.ts +0 -8
  43. package/dist/modules/app-notifications/index.d.ts +0 -4
  44. package/dist/modules/app-notifications/markAllNotificationsAsRead.d.ts +0 -5
  45. package/dist/modules/app-notifications/markNotificationAsRead.d.ts +0 -5
  46. package/dist/modules/auth/changePassword.d.ts +0 -34
  47. package/dist/modules/auth/confirmAccountDeletion.d.ts +0 -11
  48. package/dist/modules/auth/index.d.ts +0 -13
  49. package/dist/modules/auth/requestAccountDeletion.d.ts +0 -14
  50. package/dist/modules/auth/requestNewAccessToken.d.ts +0 -16
  51. package/dist/modules/auth/requestPasswordReset.d.ts +0 -5
  52. package/dist/modules/auth/resetPassword.d.ts +0 -6
  53. package/dist/modules/auth/sendVerificationEmail.d.ts +0 -13
  54. package/dist/modules/auth/setPassword.d.ts +0 -9
  55. package/dist/modules/auth/signIn.d.ts +0 -12
  56. package/dist/modules/auth/signOut.d.ts +0 -103
  57. package/dist/modules/auth/signUp.d.ts +0 -24
  58. package/dist/modules/auth/verifyEmail.d.ts +0 -5
  59. package/dist/modules/auth/verifyExternalUser.d.ts +0 -11
  60. package/dist/modules/chat/addMember.d.ts +0 -8
  61. package/dist/modules/chat/changeMemberRole.d.ts +0 -9
  62. package/dist/modules/chat/createDirectConversation.d.ts +0 -7
  63. package/dist/modules/chat/createGroupConversation.d.ts +0 -10
  64. package/dist/modules/chat/deleteConversation.d.ts +0 -8
  65. package/dist/modules/chat/deleteMessage.d.ts +0 -11
  66. package/dist/modules/chat/editMessage.d.ts +0 -14
  67. package/dist/modules/chat/getConversation.d.ts +0 -6
  68. package/dist/modules/chat/getMessage.d.ts +0 -13
  69. package/dist/modules/chat/getUnreadCount.d.ts +0 -6
  70. package/dist/modules/chat/index.d.ts +0 -21
  71. package/dist/modules/chat/leaveConversation.d.ts +0 -7
  72. package/dist/modules/chat/listConversations.d.ts +0 -17
  73. package/dist/modules/chat/listMembers.d.ts +0 -11
  74. package/dist/modules/chat/listMessages.d.ts +0 -44
  75. package/dist/modules/chat/listReactions.d.ts +0 -24
  76. package/dist/modules/chat/markAsRead.d.ts +0 -9
  77. package/dist/modules/chat/muteConversation.d.ts +0 -23
  78. package/dist/modules/chat/removeMember.d.ts +0 -9
  79. package/dist/modules/chat/reportMessage.d.ts +0 -12
  80. package/dist/modules/chat/sendMessage.d.ts +0 -22
  81. package/dist/modules/chat/toggleReaction.d.ts +0 -16
  82. package/dist/modules/chat/updateConversation.d.ts +0 -12
  83. package/dist/modules/collections/addEntityToCollection.d.ts +0 -13
  84. package/dist/modules/collections/createNewCollection.d.ts +0 -8
  85. package/dist/modules/collections/deleteCollection.d.ts +0 -5
  86. package/dist/modules/collections/fetchCollectionEntities.d.ts +0 -13
  87. package/dist/modules/collections/fetchRootCollection.d.ts +0 -3
  88. package/dist/modules/collections/fetchSubCollections.d.ts +0 -6
  89. package/dist/modules/collections/index.d.ts +0 -8
  90. package/dist/modules/collections/removeEntityFromCollection.d.ts +0 -7
  91. package/dist/modules/collections/updateCollection.d.ts +0 -7
  92. package/dist/modules/comments/addReaction.d.ts +0 -8
  93. package/dist/modules/comments/createComment.d.ts +0 -15
  94. package/dist/modules/comments/deleteComment.d.ts +0 -5
  95. package/dist/modules/comments/fetchComment.d.ts +0 -8
  96. package/dist/modules/comments/fetchCommentByForeignId.d.ts +0 -7
  97. package/dist/modules/comments/fetchManyComments.d.ts +0 -26
  98. package/dist/modules/comments/fetchReactions.d.ts +0 -16
  99. package/dist/modules/comments/getUserReaction.d.ts +0 -9
  100. package/dist/modules/comments/index.d.ts +0 -10
  101. package/dist/modules/comments/removeReaction.d.ts +0 -6
  102. package/dist/modules/comments/updateComment.d.ts +0 -10
  103. package/dist/modules/connections/acceptConnection.d.ts +0 -6
  104. package/dist/modules/connections/declineConnection.d.ts +0 -6
  105. package/dist/modules/connections/fetchConnections.d.ts +0 -9
  106. package/dist/modules/connections/fetchConnectionsCount.d.ts +0 -3
  107. package/dist/modules/connections/fetchReceivedPendingConnections.d.ts +0 -8
  108. package/dist/modules/connections/fetchSentPendingConnections.d.ts +0 -8
  109. package/dist/modules/connections/index.d.ts +0 -7
  110. package/dist/modules/connections/removeConnection.d.ts +0 -5
  111. package/dist/modules/entities/addReaction.d.ts +0 -8
  112. package/dist/modules/entities/createEntity.d.ts +0 -23
  113. package/dist/modules/entities/deleteEntity.d.ts +0 -5
  114. package/dist/modules/entities/fetchDrafts.d.ts +0 -11
  115. package/dist/modules/entities/fetchEntity.d.ts +0 -8
  116. package/dist/modules/entities/fetchEntityByForeignId.d.ts +0 -8
  117. package/dist/modules/entities/fetchEntityByShortId.d.ts +0 -7
  118. package/dist/modules/entities/fetchManyEntities.d.ts +0 -65
  119. package/dist/modules/entities/fetchReactions.d.ts +0 -16
  120. package/dist/modules/entities/fetchTopComment.d.ts +0 -6
  121. package/dist/modules/entities/getUserReaction.d.ts +0 -9
  122. package/dist/modules/entities/index.d.ts +0 -15
  123. package/dist/modules/entities/isEntitySaved.d.ts +0 -12
  124. package/dist/modules/entities/publishDraft.d.ts +0 -6
  125. package/dist/modules/entities/removeReaction.d.ts +0 -6
  126. package/dist/modules/entities/updateEntity.d.ts +0 -18
  127. package/dist/modules/events/addHost.d.ts +0 -8
  128. package/dist/modules/events/addInvite.d.ts +0 -8
  129. package/dist/modules/events/cancelEvent.d.ts +0 -6
  130. package/dist/modules/events/createEvent.d.ts +0 -49
  131. package/dist/modules/events/deleteEvent.d.ts +0 -5
  132. package/dist/modules/events/fetchEvent.d.ts +0 -8
  133. package/dist/modules/events/fetchEventRsvps.d.ts +0 -19
  134. package/dist/modules/events/fetchInvitees.d.ts +0 -12
  135. package/dist/modules/events/fetchManyEvents.d.ts +0 -42
  136. package/dist/modules/events/index.d.ts +0 -14
  137. package/dist/modules/events/removeHost.d.ts +0 -8
  138. package/dist/modules/events/removeInvite.d.ts +0 -8
  139. package/dist/modules/events/setRsvp.d.ts +0 -7
  140. package/dist/modules/events/updateEvent.d.ts +0 -43
  141. package/dist/modules/events/withdrawRsvp.d.ts +0 -6
  142. package/dist/modules/follows/deleteFollow.d.ts +0 -5
  143. package/dist/modules/follows/fetchFollowers.d.ts +0 -9
  144. package/dist/modules/follows/fetchFollowersCount.d.ts +0 -5
  145. package/dist/modules/follows/fetchFollowing.d.ts +0 -9
  146. package/dist/modules/follows/fetchFollowingCount.d.ts +0 -5
  147. package/dist/modules/follows/index.d.ts +0 -5
  148. package/dist/modules/oauth/authorize.d.ts +0 -25
  149. package/dist/modules/oauth/index.d.ts +0 -4
  150. package/dist/modules/oauth/linkIdentity.d.ts +0 -14
  151. package/dist/modules/oauth/listIdentities.d.ts +0 -4
  152. package/dist/modules/oauth/unlinkIdentity.d.ts +0 -12
  153. package/dist/modules/push/getNotificationPreferences.d.ts +0 -11
  154. package/dist/modules/push/index.d.ts +0 -2
  155. package/dist/modules/push/updateNotificationPreferences.d.ts +0 -16
  156. package/dist/modules/reports/createReport.d.ts +0 -9
  157. package/dist/modules/reports/fetchModeratedReports.d.ts +0 -13
  158. package/dist/modules/reports/index.d.ts +0 -2
  159. package/dist/modules/reputation/createGrant.d.ts +0 -45
  160. package/dist/modules/reputation/index.d.ts +0 -2
  161. package/dist/modules/reputation/listGrants.d.ts +0 -45
  162. package/dist/modules/search/askContent.d.ts +0 -58
  163. package/dist/modules/search/index.d.ts +0 -5
  164. package/dist/modules/search/matchUsers.d.ts +0 -36
  165. package/dist/modules/search/searchContent.d.ts +0 -24
  166. package/dist/modules/search/searchSpaces.d.ts +0 -11
  167. package/dist/modules/search/searchUsers.d.ts +0 -11
  168. package/dist/modules/spaces/approveMembership.d.ts +0 -7
  169. package/dist/modules/spaces/banMember.d.ts +0 -13
  170. package/dist/modules/spaces/checkMyMembership.d.ts +0 -6
  171. package/dist/modules/spaces/checkSlugAvailability.d.ts +0 -8
  172. package/dist/modules/spaces/createRule.d.ts +0 -8
  173. package/dist/modules/spaces/createSpace.d.ts +0 -29
  174. package/dist/modules/spaces/declineMembership.d.ts +0 -7
  175. package/dist/modules/spaces/deleteRule.d.ts +0 -7
  176. package/dist/modules/spaces/deleteSpace.d.ts +0 -6
  177. package/dist/modules/spaces/fetchChildSpaces.d.ts +0 -11
  178. package/dist/modules/spaces/fetchDigestConfig.d.ts +0 -6
  179. package/dist/modules/spaces/fetchManyRules.d.ts +0 -6
  180. package/dist/modules/spaces/fetchManySpaces.d.ts +0 -17
  181. package/dist/modules/spaces/fetchMutualSpaces.d.ts +0 -11
  182. package/dist/modules/spaces/fetchRule.d.ts +0 -7
  183. package/dist/modules/spaces/fetchSpace.d.ts +0 -6
  184. package/dist/modules/spaces/fetchSpaceBreadcrumb.d.ts +0 -6
  185. package/dist/modules/spaces/fetchSpaceByShortId.d.ts +0 -6
  186. package/dist/modules/spaces/fetchSpaceBySlug.d.ts +0 -6
  187. package/dist/modules/spaces/fetchSpaceMembers.d.ts +0 -11
  188. package/dist/modules/spaces/fetchSpaceTeam.d.ts +0 -7
  189. package/dist/modules/spaces/fetchUserSpaces.d.ts +0 -17
  190. package/dist/modules/spaces/getSpaceConversation.d.ts +0 -6
  191. package/dist/modules/spaces/handleCommentReport.d.ts +0 -14
  192. package/dist/modules/spaces/handleEntityReport.d.ts +0 -17
  193. package/dist/modules/spaces/handleSpaceChatReport.d.ts +0 -18
  194. package/dist/modules/spaces/index.d.ts +0 -36
  195. package/dist/modules/spaces/joinSpace.d.ts +0 -6
  196. package/dist/modules/spaces/leaveSpace.d.ts +0 -6
  197. package/dist/modules/spaces/moderateSpaceChatMessage.d.ts +0 -12
  198. package/dist/modules/spaces/moderateSpaceComment.d.ts +0 -9
  199. package/dist/modules/spaces/moderateSpaceEntity.d.ts +0 -12
  200. package/dist/modules/spaces/reorderRules.d.ts +0 -7
  201. package/dist/modules/spaces/setSpaceEntityNsfw.d.ts +0 -16
  202. package/dist/modules/spaces/unbanMember.d.ts +0 -13
  203. package/dist/modules/spaces/updateDigestConfig.d.ts +0 -11
  204. package/dist/modules/spaces/updateMemberRole.d.ts +0 -8
  205. package/dist/modules/spaces/updateRule.d.ts +0 -9
  206. package/dist/modules/spaces/updateSpace.d.ts +0 -22
  207. package/dist/modules/storage/deleteFile.d.ts +0 -5
  208. package/dist/modules/storage/getFile.d.ts +0 -34
  209. package/dist/modules/storage/index.d.ts +0 -4
  210. package/dist/modules/storage/uploadFile.d.ts +0 -30
  211. package/dist/modules/storage/uploadImage.d.ts +0 -42
  212. package/dist/modules/tables/bulkCreate.d.ts +0 -4
  213. package/dist/modules/tables/bulkDelete.d.ts +0 -7
  214. package/dist/modules/tables/create.d.ts +0 -4
  215. package/dist/modules/tables/createTableAccessor.d.ts +0 -9
  216. package/dist/modules/tables/deleteRow.d.ts +0 -9
  217. package/dist/modules/tables/find.d.ts +0 -8
  218. package/dist/modules/tables/findOne.d.ts +0 -7
  219. package/dist/modules/tables/index.d.ts +0 -9
  220. package/dist/modules/tables/restore.d.ts +0 -6
  221. package/dist/modules/tables/update.d.ts +0 -4
  222. package/dist/modules/users/checkUsernameAvailability.d.ts +0 -8
  223. package/dist/modules/users/createBlock.d.ts +0 -19
  224. package/dist/modules/users/createFollow.d.ts +0 -7
  225. package/dist/modules/users/deleteBlock.d.ts +0 -13
  226. package/dist/modules/users/deleteFollow.d.ts +0 -6
  227. package/dist/modules/users/fetchBlockStatus.d.ts +0 -23
  228. package/dist/modules/users/fetchBlockedUsers.d.ts +0 -19
  229. package/dist/modules/users/fetchConnectionStatus.d.ts +0 -10
  230. package/dist/modules/users/fetchConnectionsByUserId.d.ts +0 -11
  231. package/dist/modules/users/fetchConnectionsCountByUserId.d.ts +0 -6
  232. package/dist/modules/users/fetchFollowStatus.d.ts +0 -14
  233. package/dist/modules/users/fetchFollowersByUserId.d.ts +0 -11
  234. package/dist/modules/users/fetchFollowersCountByUserId.d.ts +0 -8
  235. package/dist/modules/users/fetchFollowingByUserId.d.ts +0 -11
  236. package/dist/modules/users/fetchFollowingCountByUserId.d.ts +0 -8
  237. package/dist/modules/users/fetchUserByForeignId.d.ts +0 -8
  238. package/dist/modules/users/fetchUserById.d.ts +0 -8
  239. package/dist/modules/users/fetchUserByUsername.d.ts +0 -8
  240. package/dist/modules/users/fetchUserSuggestions.d.ts +0 -7
  241. package/dist/modules/users/index.d.ts +0 -22
  242. package/dist/modules/users/removeConnectionByUserId.d.ts +0 -10
  243. package/dist/modules/users/requestConnection.d.ts +0 -11
  244. package/dist/modules/users/updateUser.d.ts +0 -32
  245. package/dist/modules/workspaces/acceptInvite.d.ts +0 -13
  246. package/dist/modules/workspaces/acceptWorkspaceInvite.d.ts +0 -13
  247. package/dist/modules/workspaces/createInvite.d.ts +0 -17
  248. package/dist/modules/workspaces/createWorkspace.d.ts +0 -12
  249. package/dist/modules/workspaces/createWorkspaceInvite.d.ts +0 -66
  250. package/dist/modules/workspaces/declineInvite.d.ts +0 -12
  251. package/dist/modules/workspaces/declineWorkspaceInvite.d.ts +0 -14
  252. package/dist/modules/workspaces/deleteWorkspace.d.ts +0 -13
  253. package/dist/modules/workspaces/fetchManyWorkspaces.d.ts +0 -17
  254. package/dist/modules/workspaces/fetchMembers.d.ts +0 -13
  255. package/dist/modules/workspaces/fetchMyInvites.d.ts +0 -11
  256. package/dist/modules/workspaces/fetchMyWorkspaceInvites.d.ts +0 -15
  257. package/dist/modules/workspaces/fetchWorkspace.d.ts +0 -7
  258. package/dist/modules/workspaces/fetchWorkspaceAuthority.d.ts +0 -16
  259. package/dist/modules/workspaces/fetchWorkspaceInvites.d.ts +0 -17
  260. package/dist/modules/workspaces/fetchWorkspaceMemberStanding.d.ts +0 -15
  261. package/dist/modules/workspaces/fetchWorkspaceMembers.d.ts +0 -18
  262. package/dist/modules/workspaces/getAuthority.d.ts +0 -11
  263. package/dist/modules/workspaces/index.d.ts +0 -21
  264. package/dist/modules/workspaces/leaveWorkspace.d.ts +0 -12
  265. package/dist/modules/workspaces/removeWorkspaceMember.d.ts +0 -12
  266. package/dist/modules/workspaces/removeWorkspaceMemberFromSubtree.d.ts +0 -16
  267. package/dist/modules/workspaces/resendWorkspaceInvite.d.ts +0 -12
  268. package/dist/modules/workspaces/revokeWorkspaceInvite.d.ts +0 -13
  269. package/dist/modules/workspaces/transferWorkspaceOwnership.d.ts +0 -15
  270. package/dist/modules/workspaces/updateWorkspace.d.ts +0 -12
  271. package/dist/modules/workspaces/updateWorkspaceInheritFlag.d.ts +0 -13
  272. package/dist/modules/workspaces/updateWorkspaceMember.d.ts +0 -35
@@ -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
- }
@@ -1,178 +0,0 @@
1
- import { User } from "./User";
2
- /**
3
- * Workspaces bundle interfaces (client subset). Mirrors the server's
4
- * `IWorkspace` / `IWorkspaceMember` / `IWorkspaceInvitation` shapes and the
5
- * workspace controller responses.
6
- *
7
- * `capabilities` is a CLOSED, Sublay-enforced vocabulary (cascades via reach);
8
- * `permissions` is opaque free-form developer strings Sublay never consumes
9
- * (per-node only, does NOT cascade).
10
- */
11
- export type WorkspaceCapability = "view" | "invite" | "remove-member" | "edit-member-access" | "edit-member-profile" | "create-sub-workspace" | "edit-workspace";
12
- export type WorkspaceInvitationStatus = "pending" | "accepted" | "declined" | "revoked";
13
- export type WorkspaceAuthorityReason = "owner" | "ancestor-owner" | "member" | "reach-holder";
14
- export type WorkspaceAuthorityReasonDetail = {
15
- type: "owner" | "member";
16
- viaWorkspaceId?: never;
17
- } | {
18
- type: "ancestor-owner" | "reach-holder";
19
- viaWorkspaceId: string;
20
- };
21
- export interface Workspace {
22
- id: string;
23
- name: string;
24
- metadata: Record<string, any>;
25
- ownerId: string;
26
- parentWorkspaceId: string | null;
27
- depth: number;
28
- inheritsFromParent: boolean;
29
- createdAt: string;
30
- updatedAt: string;
31
- memberCount?: number;
32
- }
33
- export interface WorkspaceMember {
34
- id: string;
35
- workspaceId: string;
36
- userId: string;
37
- capabilities: WorkspaceCapability[];
38
- permissions: string[];
39
- rank: number;
40
- title: string | null;
41
- metadata: Record<string, any>;
42
- joinedAt: string;
43
- createdAt: string;
44
- }
45
- export interface WorkspaceInvitation {
46
- id: string;
47
- workspaceId: string;
48
- invitedBy: string;
49
- userId: string | null;
50
- email: string | null;
51
- capabilities: WorkspaceCapability[];
52
- permissions: string[];
53
- rank: number;
54
- title: string | null;
55
- status: WorkspaceInvitationStatus;
56
- expiresAt: string;
57
- createdAt: string;
58
- updatedAt: string;
59
- }
60
- export interface WorkspaceRosterReason {
61
- type: "owner" | "member" | "ancestor-owner" | "reach-holder" | "descendant-member";
62
- rank?: number;
63
- /**
64
- * The SAME ladder position, expressed as an offset from the CALLER: `1` = one
65
- * rung below you, `0` = your peer, `-3` = three rungs above you. The caller's
66
- * own anchor is their member row on this workspace if they hold one, and apex
67
- * (one step above rank 0) if they do not — so a rank-0 member reads back as
68
- * `relativeRank: 1` for an owner.
69
- *
70
- * Authority-bearing and fenced WITH `rank`, never beside it: it is `rank`
71
- * minus a number the caller already knows, so leaking it leaks `rank` exactly.
72
- *
73
- * Present on same-node `member` reasons only. `descendant-member` entries
74
- * carry `rank` but NEVER `relativeRank` — rank is per-workspace, so an offset
75
- * measured against your standing on THIS node would be arithmetic across two
76
- * different ladders. Use their absolute `rank` there.
77
- *
78
- * Note the deliberate asymmetry with the fence described above: the FENCE is
79
- * per node (a descendant row may or may not carry `rank` depending on your
80
- * standing there), but PRESENCE of `relativeRank` is not — it is absent on
81
- * every `descendant-member` row, unconditionally, however much authority you
82
- * hold. A field that appears and disappears by who is asking is worse to
83
- * consume than one that is uniformly absent.
84
- */
85
- relativeRank?: number;
86
- capabilities?: WorkspaceCapability[];
87
- permissions?: string[];
88
- title?: string | null;
89
- metadata?: Record<string, any>;
90
- viaWorkspaceId?: string;
91
- workspaceId?: string;
92
- }
93
- export interface WorkspaceRosterEntry {
94
- user: User;
95
- reasons: WorkspaceRosterReason[];
96
- }
97
- export interface WorkspaceRosterResponse {
98
- data: WorkspaceRosterEntry[];
99
- total: number;
100
- }
101
- export interface WorkspaceRosterCountsResponse {
102
- counts: {
103
- owner: number;
104
- member: number;
105
- ancestorOwner: number;
106
- reachHolder: number;
107
- descendantMember: number;
108
- };
109
- total: number;
110
- distinctUsers: number;
111
- }
112
- /**
113
- * The `user` carried by a standing read. Normally the full user record, but the
114
- * server falls back to `{ id }` alone when the user row is gone (a deleted user
115
- * with a lingering membership row is a reachable case), so every field except
116
- * `id` may be absent.
117
- */
118
- export type WorkspaceStandingUser = Pick<User, "id"> & Partial<Omit<User, "id">>;
119
- export interface WorkspaceMemberStanding {
120
- user: WorkspaceStandingUser;
121
- reasons: WorkspaceAuthorityReasonDetail[];
122
- capabilities?: WorkspaceCapability[];
123
- permissions?: string[];
124
- rank?: number | null;
125
- /**
126
- * `rank` expressed as an offset from the CALLER (negative = senior to you).
127
- * `null` exactly when `rank` is `null` — a target with no direct member row
128
- * here sits outside the ladder and has no position to measure. Fenced with
129
- * `rank`: absent (not null) for a caller who may not see it.
130
- */
131
- relativeRank?: number | null;
132
- title: string | null;
133
- metadata: Record<string, any>;
134
- }
135
- export interface WorkspaceAuthority {
136
- reasons: WorkspaceAuthorityReasonDetail[];
137
- capabilities: WorkspaceCapability[];
138
- permissions: string[];
139
- rank: number | null;
140
- }
141
- /**
142
- * One descendant the subtree sweep did NOT clear, where the target user still
143
- * holds a direct membership.
144
- *
145
- * `id` / `name` are masked TOGETHER: an entry the acting user may see carries
146
- * both, and one they may not carries `null` for both — the sweep reports THAT a
147
- * membership survived without disclosing the existence or name of a sealed
148
- * sub-workspace the actor has no authority over (the same sealing fence the
149
- * descendant roster read applies). Modelled as a discriminated union so a
150
- * `null` check on `id` narrows `name` too.
151
- */
152
- export type SkippedWorkspace = {
153
- id: string;
154
- name: string;
155
- /** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
156
- reason: "out-of-reach";
157
- } | {
158
- id: null;
159
- name: null;
160
- /** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
161
- reason: "out-of-reach";
162
- };
163
- export interface RemoveWorkspaceMemberFromSubtreeResponse {
164
- removedCount: number;
165
- removed: {
166
- workspaceId: string;
167
- userId: string;
168
- }[];
169
- /**
170
- * How many descendant memberships the target RETAINED because the sweep could
171
- * not reach them. Always `0` for an owner / ancestor-owner / privileged key.
172
- * A non-zero value means the offboarding is PARTIAL — never conclude a user is
173
- * fully removed from `removedCount` alone.
174
- */
175
- skippedCount: number;
176
- /** One entry per retained membership; `skippedCount === skipped.length`. */
177
- skipped: SkippedWorkspace[];
178
- }
@@ -1,2 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export declare function countUnreadNotifications(client: SublayHttpClient): Promise<number>;
@@ -1,8 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { UnifiedAppNotification } from "../../interfaces/AppNotification";
3
- import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchNotificationsProps {
5
- page?: number;
6
- limit?: number;
7
- }
8
- export declare function fetchNotifications(client: SublayHttpClient, data?: FetchNotificationsProps): Promise<PaginatedResponse<UnifiedAppNotification>>;
@@ -1,4 +0,0 @@
1
- export { fetchNotifications } from "./fetchNotifications";
2
- export { countUnreadNotifications } from "./countUnreadNotifications";
3
- export { markNotificationAsRead } from "./markNotificationAsRead";
4
- export { markAllNotificationsAsRead } from "./markAllNotificationsAsRead";
@@ -1,5 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface MarkAllNotificationsAsReadResponse {
3
- markedAsRead: number;
4
- }
5
- export declare function markAllNotificationsAsRead(client: SublayHttpClient): Promise<MarkAllNotificationsAsReadResponse>;
@@ -1,5 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface MarkNotificationAsReadProps {
3
- notificationId: string;
4
- }
5
- export declare function markNotificationAsRead(client: SublayHttpClient, data: MarkNotificationAsReadProps): Promise<void>;
@@ -1,34 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { PushDeviceIdentifier } from "../../interfaces/Push";
3
- export interface ChangePasswordProps {
4
- /** The user's current password (verified before the change). */
5
- password: string;
6
- newPassword: string;
7
- /**
8
- * Optional. The physical device making this call.
9
- *
10
- * A password change also deletes every push binding the user holds, so an
11
- * intruder's device stops receiving notification content. Naming this device
12
- * keeps ITS binding — nothing re-binds a device from its live session, so
13
- * without this the handset the user just changed their password on goes
14
- * quiet until the app cold-starts or switches accounts.
15
- *
16
- * Same value passed to `push.register` / `auth.signOut`. Omit it and every
17
- * binding for the user goes, this device included.
18
- */
19
- pushDevice?: PushDeviceIdentifier;
20
- }
21
- export interface ChangePasswordResponse {
22
- success: boolean;
23
- message: string;
24
- }
25
- /**
26
- * Change the signed-in user's password.
27
- *
28
- * Ends every OTHER session for that user — every other device must sign in
29
- * again with the new password — while the session making this call survives.
30
- * The server identifies that session from the access token this request is
31
- * already authenticated with, so nothing about the caller's session has to be
32
- * sent.
33
- */
34
- export declare function changePassword(client: SublayHttpClient, data: ChangePasswordProps): Promise<ChangePasswordResponse>;
@@ -1,11 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface ConfirmAccountDeletionProps {
3
- /** The one-time code emailed by {@link requestAccountDeletion}. */
4
- code: string;
5
- }
6
- /**
7
- * Step 2 of self-service account deletion. Verifies the emailed code and then
8
- * permanently deletes the signed-in user's account (same cascade as the
9
- * admin/service delete). This is immediate and cannot be undone.
10
- */
11
- export declare function confirmAccountDeletion(client: SublayHttpClient, data: ConfirmAccountDeletionProps): Promise<void>;
@@ -1,13 +0,0 @@
1
- export { signUp } from "./signUp";
2
- export { signIn } from "./signIn";
3
- export { signOut } from "./signOut";
4
- export { requestNewAccessToken } from "./requestNewAccessToken";
5
- export { verifyExternalUser } from "./verifyExternalUser";
6
- export { requestPasswordReset } from "./requestPasswordReset";
7
- export { resetPassword } from "./resetPassword";
8
- export { changePassword } from "./changePassword";
9
- export { setPassword } from "./setPassword";
10
- export { verifyEmail } from "./verifyEmail";
11
- export { sendVerificationEmail } from "./sendVerificationEmail";
12
- export { requestAccountDeletion } from "./requestAccountDeletion";
13
- export { confirmAccountDeletion } from "./confirmAccountDeletion";
@@ -1,14 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface RequestAccountDeletionResponse {
3
- success: boolean;
4
- }
5
- /**
6
- * Step 1 of self-service account deletion. Emails the signed-in user a one-time
7
- * confirmation code. Pass that code to {@link confirmAccountDeletion} to
8
- * permanently delete the account.
9
- *
10
- * Requires the account to have an email on file — accounts without one (e.g.
11
- * anonymous or foreign-id users) must be deleted server-side with a service key
12
- * via the node SDK (`client.users.deleteUser`).
13
- */
14
- export declare function requestAccountDeletion(client: SublayHttpClient): Promise<RequestAccountDeletionResponse>;