@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,148 +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
- capabilities?: WorkspaceCapability[];
64
- permissions?: string[];
65
- title?: string | null;
66
- metadata?: Record<string, any>;
67
- viaWorkspaceId?: string;
68
- workspaceId?: string;
69
- }
70
- export interface WorkspaceRosterEntry {
71
- user: User;
72
- reasons: WorkspaceRosterReason[];
73
- }
74
- export interface WorkspaceRosterResponse {
75
- data: WorkspaceRosterEntry[];
76
- total: number;
77
- }
78
- export interface WorkspaceRosterCountsResponse {
79
- counts: {
80
- owner: number;
81
- member: number;
82
- ancestorOwner: number;
83
- reachHolder: number;
84
- descendantMember: number;
85
- };
86
- total: number;
87
- distinctUsers: number;
88
- }
89
- /**
90
- * The `user` carried by a standing read. Normally the full user record, but the
91
- * server falls back to `{ id }` alone when the user row is gone (a deleted user
92
- * with a lingering membership row is a reachable case), so every field except
93
- * `id` may be absent.
94
- */
95
- export type WorkspaceStandingUser = Pick<User, "id"> & Partial<Omit<User, "id">>;
96
- export interface WorkspaceMemberStanding {
97
- user: WorkspaceStandingUser;
98
- reasons: WorkspaceAuthorityReasonDetail[];
99
- capabilities?: WorkspaceCapability[];
100
- permissions?: string[];
101
- rank?: number | null;
102
- title: string | null;
103
- metadata: Record<string, any>;
104
- }
105
- export interface WorkspaceAuthority {
106
- reasons: WorkspaceAuthorityReasonDetail[];
107
- capabilities: WorkspaceCapability[];
108
- permissions: string[];
109
- rank: number | null;
110
- }
111
- /**
112
- * One descendant the subtree sweep did NOT clear, where the target user still
113
- * holds a direct membership.
114
- *
115
- * `id` / `name` are masked TOGETHER: an entry the acting user may see carries
116
- * both, and one they may not carries `null` for both — the sweep reports THAT a
117
- * membership survived without disclosing the existence or name of a sealed
118
- * sub-workspace the actor has no authority over (the same sealing fence the
119
- * descendant roster read applies). Modelled as a discriminated union so a
120
- * `null` check on `id` narrows `name` too.
121
- */
122
- export type SkippedWorkspace = {
123
- id: string;
124
- name: string;
125
- /** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
126
- reason: "out-of-reach";
127
- } | {
128
- id: null;
129
- name: null;
130
- /** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
131
- reason: "out-of-reach";
132
- };
133
- export interface RemoveWorkspaceMemberFromSubtreeResponse {
134
- removedCount: number;
135
- removed: {
136
- workspaceId: string;
137
- userId: string;
138
- }[];
139
- /**
140
- * How many descendant memberships the target RETAINED because the sweep could
141
- * not reach them. Always `0` for an owner / ancestor-owner / privileged key.
142
- * A non-zero value means the offboarding is PARTIAL — never conclude a user is
143
- * fully removed from `removedCount` alone.
144
- */
145
- skippedCount: number;
146
- /** One entry per retained membership; `skippedCount === skipped.length`. */
147
- skipped: SkippedWorkspace[];
148
- }
@@ -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>;
@@ -1,16 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface RequestNewAccessTokenProps {
3
- /** Defaults to the SDK's stored refresh token (SDK-managed mode). */
4
- refreshToken?: string;
5
- }
6
- export interface RequestNewAccessTokenResponse {
7
- accessToken: string;
8
- /** The server rotates the refresh token on every refresh and returns the new one. */
9
- refreshToken?: string;
10
- }
11
- /**
12
- * Manually rotate the access token. The SDK auto-refreshes on 403 in
13
- * SDK-managed mode, so this is rarely needed directly; it's exposed for parity
14
- * and for host-managed callers that own their own refresh flow.
15
- */
16
- export declare function requestNewAccessToken(client: SublayHttpClient, data?: RequestNewAccessTokenProps): Promise<RequestNewAccessTokenResponse>;
@@ -1,5 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface RequestPasswordResetProps {
3
- email: string;
4
- }
5
- export declare function requestPasswordReset(client: SublayHttpClient, data: RequestPasswordResetProps): Promise<void>;
@@ -1,6 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface ResetPasswordProps {
3
- token: string;
4
- newPassword: string;
5
- }
6
- export declare function resetPassword(client: SublayHttpClient, data: ResetPasswordProps): Promise<void>;
@@ -1,13 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface SendVerificationEmailProps {
3
- /** "code" emails a short token; "link" emails a verification URL. Defaults to "code". */
4
- mode?: "code" | "link";
5
- tokenFormat?: "hex" | "numeric" | "alpha" | "alphanumeric";
6
- tokenLength?: number;
7
- /** For mode "link": where to send the user after the link is verified. */
8
- redirectUrl?: string;
9
- }
10
- export interface SendVerificationEmailResponse {
11
- success: boolean;
12
- }
13
- export declare function sendVerificationEmail(client: SublayHttpClient, data?: SendVerificationEmailProps): Promise<SendVerificationEmailResponse>;
@@ -1,9 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface SetPasswordProps {
3
- newPassword: string;
4
- }
5
- export interface SetPasswordResponse {
6
- success: boolean;
7
- message: string;
8
- }
9
- export declare function setPassword(client: SublayHttpClient, data: SetPasswordProps): Promise<SetPasswordResponse>;
@@ -1,12 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { AuthUser } from "../../interfaces/User";
3
- export interface SignInProps {
4
- email: string;
5
- password: string;
6
- }
7
- export interface SignInResponse {
8
- user: AuthUser;
9
- accessToken: string;
10
- refreshToken: string;
11
- }
12
- export declare function signIn(client: SublayHttpClient, data: SignInProps): Promise<SignInResponse>;
@@ -1,103 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { PushDeviceIdentifier } from "../../interfaces/Push";
3
- export interface SignOutProps {
4
- /**
5
- * Defaults to the SDK's stored refresh token (SDK-managed mode). Pass it
6
- * explicitly in host-managed mode, where the SDK holds no refresh token.
7
- */
8
- refreshToken?: string;
9
- /**
10
- * Optional. When supplied — and the project has the `push` bundle — the
11
- * server deletes this user's push binding for that device in the SAME
12
- * transaction as the token-family destroy: signing out unbinds the device's
13
- * push, or nothing happens at all.
14
- *
15
- * **Needs a refresh token to have any effect.** The unbind is scoped to the
16
- * `sub` of the refresh token, which is what stops one account removing
17
- * another account's binding on a shared device — so with no token there is no
18
- * user to scope it to and the server answers `204` before it ever looks at
19
- * `pushDevice`. When none can be resolved the field is DROPPED from the
20
- * request rather than sent into that silent no-op, the sign-out proceeds
21
- * normally, and the returned `pushUnbindSkipped` says so. Watch for it in
22
- * **host-managed mode**: such a client is built with `getToken` and no
23
- * `initialTokens`, and its `setTokens` is inert, so it starts with no refresh
24
- * token and can never acquire one. Pass `refreshToken` explicitly alongside
25
- * `pushDevice` there.
26
- *
27
- * If the unbind fails the request fails (HTTP 500, code
28
- * `auth/device-deregistration-failed` or `auth/sign-out-failed`) and NOTHING
29
- * is committed — the session survives so the caller can retry, and this call
30
- * rethrows WITHOUT clearing the SDK's local tokens, so the credential that
31
- * retry needs is still there.
32
- *
33
- * That is the ONLY failure that leaves you signed in. Every other one — a
34
- * `429` from the rate limiter or a quota gate, a `423`, a `503`, a `400` on
35
- * the body, a dropped connection — never touched a push binding, so it
36
- * clears the local tokens and RESOLVES: a user must always be able to sign
37
- * out. See `UNBIND_FAILURE_CODES`.
38
- *
39
- * Omit it and the request is byte-identical to before this field existed.
40
- */
41
- pushDevice?: PushDeviceIdentifier;
42
- }
43
- /**
44
- * Why the unbind did not happen. Present only when `pushUnbindSkipped` is
45
- * `true`, and it exists because THE TWO SKIPS ARE RECOVERED DIFFERENTLY — a
46
- * caller that cannot tell them apart can only ever pick the wrong remedy for
47
- * one of them:
48
- *
49
- * - `no-refresh-token` — this SDK never asked. Nothing was destroyed either:
50
- * with no token the server has no session to end, so the account, its
51
- * credential and its binding are all still there. **Retryable**: re-issue
52
- * the sign-out with an explicit `refreshToken` and the unbind happens.
53
- * - `push-unbind-status-unknown` — the server was asked and could not answer.
54
- * The sign-out itself DID commit, so the credential that would have driven a
55
- * retry is gone; re-issuing achieves nothing. The binding clears when that
56
- * account next registers on this device, or when the server prunes the token
57
- * as undeliverable.
58
- */
59
- export type PushUnbindSkipReason = "no-refresh-token" | "push-unbind-status-unknown";
60
- export interface SignOutResult {
61
- /**
62
- * `true` whenever a `pushDevice` was supplied and the unbind did NOT happen,
63
- * so this device's push binding for that account may still be live. Either
64
- * the SDK declined to ask (no refresh token to scope the unbind to) or the
65
- * server could not answer whether a binding exists; `pushUnbindSkipReason`
66
- * says which, and the two are recovered differently.
67
- *
68
- * `false` means NO SKIP WAS REPORTED — by this SDK or by the server. It is
69
- * not a promise that no skip happened, and the difference is not academic:
70
- * the server declines the unbind for several reasons it answers with a plain
71
- * `204`, and every one of them reads `false` here.
72
- *
73
- * - The refresh token is authentic but expired beyond the server's unbind
74
- * window (90 days past `exp`), so there is no subject to scope the unbind
75
- * to. Reachable from this SDK by passing an old `refreshToken` explicitly
76
- * alongside `pushDevice`.
77
- * - The refresh token is malformed or fails signature verification.
78
- * - The project has no `push` bundle, so no binding can exist.
79
- * - The unbind ran and matched zero rows — the binding was already gone, or
80
- * was never registered under this device key.
81
- *
82
- * The server logs each of those under its own reason; only the case where it
83
- * could not determine whether a binding exists is reported in the response,
84
- * because that is the one where the binding may still be LIVE and nobody
85
- * looked. The rest either prove there was nothing to remove or leave a device
86
- * key the server cannot attribute to a user, and neither gives the caller
87
- * anything to act on beyond what it already knows.
88
- *
89
- * A request that failed short of an unbind attempt reads `false` too — a
90
- * gate's `429` or `423`, a `503`, a `400`, a dropped connection. Those clear
91
- * the local tokens and resolve rather than reject (see `UNBIND_FAILURE_CODES`
92
- * for why), and none of them is a REPORTED skip; they are logged with a
93
- * warning instead.
94
- *
95
- * The sign-out itself is unaffected by the flag in both directions: a user
96
- * must always be able to sign out, so a skipped unbind never fails the call
97
- * and never leaves the local tokens in place.
98
- */
99
- pushUnbindSkipped: boolean;
100
- /** Set only when `pushUnbindSkipped` is `true`. See `PushUnbindSkipReason`. */
101
- pushUnbindSkipReason?: PushUnbindSkipReason;
102
- }
103
- export declare function signOut(client: SublayHttpClient, data?: SignOutProps): Promise<SignOutResult>;
@@ -1,24 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { AuthUser } from "../../interfaces/User";
3
- export interface SignUpProps {
4
- email: string;
5
- password: string;
6
- name?: string;
7
- username?: string;
8
- avatar?: string;
9
- bio?: string;
10
- location?: {
11
- latitude: number;
12
- longitude: number;
13
- };
14
- /** ISO 8601 datetime string. */
15
- birthdate?: string;
16
- metadata?: Record<string, any>;
17
- secureMetadata?: Record<string, any>;
18
- }
19
- export interface SignUpResponse {
20
- user: AuthUser;
21
- accessToken: string;
22
- refreshToken: string;
23
- }
24
- export declare function signUp(client: SublayHttpClient, data: SignUpProps): Promise<SignUpResponse>;
@@ -1,5 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface VerifyEmailProps {
3
- token: string;
4
- }
5
- export declare function verifyEmail(client: SublayHttpClient, data: VerifyEmailProps): Promise<void>;
@@ -1,11 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { AuthUser } from "../../interfaces/User";
3
- export interface VerifyExternalUserProps {
4
- userJwt: string;
5
- }
6
- export interface VerifyExternalUserResponse {
7
- user: AuthUser;
8
- accessToken: string;
9
- refreshToken: string;
10
- }
11
- export declare function verifyExternalUser(client: SublayHttpClient, data: VerifyExternalUserProps): Promise<VerifyExternalUserResponse>;
@@ -1,8 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { ConversationMember } from "../../interfaces/ConversationMember";
3
- export interface AddMemberProps {
4
- conversationId: string;
5
- /** The member to add (the target). */
6
- userId: string;
7
- }
8
- export declare function addMember(client: SublayHttpClient, data: AddMemberProps): Promise<ConversationMember>;
@@ -1,9 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { ConversationMember, ConversationMemberRole } from "../../interfaces/ConversationMember";
3
- export interface ChangeMemberRoleProps {
4
- conversationId: string;
5
- /** The member whose role changes (the target). */
6
- userId: string;
7
- role: ConversationMemberRole;
8
- }
9
- export declare function changeMemberRole(client: SublayHttpClient, data: ChangeMemberRoleProps): Promise<ConversationMember>;
@@ -1,7 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { Conversation } from "../../interfaces/Conversation";
3
- export interface CreateDirectConversationProps {
4
- /** The other participant (the target). */
5
- userId: string;
6
- }
7
- export declare function createDirectConversation(client: SublayHttpClient, data: CreateDirectConversationProps): Promise<Conversation>;
@@ -1,10 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { Conversation } from "../../interfaces/Conversation";
3
- export interface CreateGroupConversationProps {
4
- name?: string;
5
- description?: string;
6
- /** Member user IDs to add to the group. Defaults to []. */
7
- memberIds?: string[];
8
- metadata?: Record<string, any>;
9
- }
10
- export declare function createGroupConversation(client: SublayHttpClient, data: CreateGroupConversationProps): Promise<Conversation>;
@@ -1,8 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface DeleteConversationProps {
3
- conversationId: string;
4
- }
5
- export interface DeleteConversationResponse {
6
- message: string;
7
- }
8
- export declare function deleteConversation(client: SublayHttpClient, data: DeleteConversationProps): Promise<DeleteConversationResponse>;
@@ -1,11 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface DeleteMessageProps {
3
- conversationId: string;
4
- messageId: string;
5
- }
6
- export interface DeleteMessageResponse {
7
- message: string;
8
- /** Present when the author soft-deletes their own message. */
9
- userDeletedAt?: string;
10
- }
11
- export declare function deleteMessage(client: SublayHttpClient, data: DeleteMessageProps): Promise<DeleteMessageResponse>;
@@ -1,14 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { ChatMessage } from "../../interfaces/ChatMessage";
3
- import { GifData } from "../../interfaces/Comment";
4
- import { Mention } from "../../interfaces/Mention";
5
- export interface EditMessageProps {
6
- conversationId: string;
7
- messageId: string;
8
- content?: string;
9
- /** A GIF attachment, or null to clear it. */
10
- gif?: GifData | null;
11
- mentions?: Mention[];
12
- metadata?: Record<string, any> | null;
13
- }
14
- export declare function editMessage(client: SublayHttpClient, data: EditMessageProps): Promise<ChatMessage>;
@@ -1,6 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { Conversation } from "../../interfaces/Conversation";
3
- export interface GetConversationProps {
4
- conversationId: string;
5
- }
6
- export declare function getConversation(client: SublayHttpClient, data: GetConversationProps): Promise<Conversation>;
@@ -1,8 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { ChatMessage } from "../../interfaces/ChatMessage";
3
- import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
- export interface GetMessageProps extends SpaceReputationContextParams {
5
- conversationId: string;
6
- messageId: string;
7
- }
8
- export declare function getMessage(client: SublayHttpClient, data: GetMessageProps): Promise<ChatMessage>;
@@ -1,6 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface UnreadCountResponse {
3
- totalUnread: number;
4
- unreadConversationCount: number;
5
- }
6
- export declare function getUnreadCount(client: SublayHttpClient): Promise<UnreadCountResponse>;
@@ -1,21 +0,0 @@
1
- export { listConversations } from "./listConversations";
2
- export { createGroupConversation } from "./createGroupConversation";
3
- export { createDirectConversation } from "./createDirectConversation";
4
- export { getConversation } from "./getConversation";
5
- export { updateConversation } from "./updateConversation";
6
- export { deleteConversation } from "./deleteConversation";
7
- export { getUnreadCount } from "./getUnreadCount";
8
- export { listMembers } from "./listMembers";
9
- export { addMember } from "./addMember";
10
- export { removeMember } from "./removeMember";
11
- export { leaveConversation } from "./leaveConversation";
12
- export { changeMemberRole } from "./changeMemberRole";
13
- export { listMessages } from "./listMessages";
14
- export { sendMessage } from "./sendMessage";
15
- export { getMessage } from "./getMessage";
16
- export { editMessage } from "./editMessage";
17
- export { deleteMessage } from "./deleteMessage";
18
- export { toggleReaction } from "./toggleReaction";
19
- export { listReactions } from "./listReactions";
20
- export { markAsRead } from "./markAsRead";
21
- export { muteConversation } from "./muteConversation";
@@ -1,7 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- export interface LeaveConversationProps {
3
- conversationId: string;
4
- }
5
- export declare function leaveConversation(client: SublayHttpClient, data: LeaveConversationProps): Promise<{
6
- message: string;
7
- }>;
@@ -1,17 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { ConversationPreview } from "../../interfaces/Conversation";
3
- export interface ListConversationsProps {
4
- /** Comma-separated conversation types, e.g. "direct,group,space". */
5
- types?: string;
6
- /** Cursor for keyset pagination: the `lastMessageAt` of the last item from the previous page (ISO datetime). */
7
- cursor?: string;
8
- /** Tie-breaker cursor: the `createdAt` of the last item from the previous page (ISO datetime). */
9
- cursorCreatedAt?: string;
10
- /** Default 20, max 50. */
11
- limit?: number;
12
- }
13
- export interface ListConversationsResponse {
14
- conversations: ConversationPreview[];
15
- hasMore: boolean;
16
- }
17
- export declare function listConversations(client: SublayHttpClient, data?: ListConversationsProps): Promise<ListConversationsResponse>;
@@ -1,11 +0,0 @@
1
- import { SublayHttpClient } from "../../core/client";
2
- import { ConversationMember } from "../../interfaces/ConversationMember";
3
- import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
- export interface ListMembersProps extends SpaceReputationContextParams {
6
- conversationId: string;
7
- page?: number;
8
- limit?: number;
9
- role?: "admin" | "member";
10
- }
11
- export declare function listMembers(client: SublayHttpClient, data: ListMembersProps): Promise<PaginatedResponse<ConversationMember>>;