@sublay/js 5.0.0 → 7.0.0

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 (211) hide show
  1. package/README.md +33 -4
  2. package/dist/core/client.d.ts +58 -2
  3. package/dist/core/multipart.d.ts +22 -0
  4. package/dist/index.d.mts +2525 -42
  5. package/dist/index.d.ts +29 -2
  6. package/dist/index.js +1746 -37
  7. package/dist/index.mjs +1746 -37
  8. package/dist/interfaces/AppNotification.d.ts +258 -0
  9. package/dist/interfaces/ChatMessage.d.ts +32 -0
  10. package/dist/interfaces/Collection.d.ts +10 -0
  11. package/dist/interfaces/Comment.d.ts +42 -0
  12. package/dist/interfaces/Connection.d.ts +67 -0
  13. package/dist/interfaces/Conversation.d.ts +25 -0
  14. package/dist/interfaces/ConversationMember.d.ts +16 -0
  15. package/dist/interfaces/Entity.d.ts +53 -0
  16. package/dist/interfaces/File.d.ts +39 -0
  17. package/dist/interfaces/Follow.d.ts +19 -0
  18. package/dist/interfaces/HostedApp.d.ts +11 -0
  19. package/dist/interfaces/ImageProcessing.d.ts +62 -0
  20. package/dist/interfaces/Mention.d.ts +12 -0
  21. package/dist/interfaces/OAuthIdentity.d.ts +13 -0
  22. package/dist/interfaces/Project.d.ts +14 -0
  23. package/dist/interfaces/Reaction.d.ts +23 -0
  24. package/dist/interfaces/Report.d.ts +32 -0
  25. package/dist/interfaces/Rule.d.ts +22 -0
  26. package/dist/interfaces/Space.d.ts +141 -0
  27. package/dist/interfaces/SpaceMember.d.ts +29 -0
  28. package/dist/interfaces/User.d.ts +39 -0
  29. package/dist/modules/app-notifications/countUnreadNotifications.d.ts +2 -0
  30. package/dist/modules/app-notifications/fetchNotifications.d.ts +8 -0
  31. package/dist/modules/app-notifications/index.d.ts +4 -0
  32. package/dist/modules/app-notifications/markAllNotificationsAsRead.d.ts +5 -0
  33. package/dist/modules/app-notifications/markNotificationAsRead.d.ts +5 -0
  34. package/dist/modules/auth/changePassword.d.ts +11 -0
  35. package/dist/modules/auth/index.d.ts +10 -0
  36. package/dist/modules/auth/requestNewAccessToken.d.ts +16 -0
  37. package/dist/modules/auth/requestPasswordReset.d.ts +5 -0
  38. package/dist/modules/auth/resetPassword.d.ts +6 -0
  39. package/dist/modules/auth/sendVerificationEmail.d.ts +13 -0
  40. package/dist/modules/auth/signIn.d.ts +12 -0
  41. package/dist/modules/auth/signOut.d.ts +9 -0
  42. package/dist/modules/auth/signUp.d.ts +24 -0
  43. package/dist/modules/auth/verifyEmail.d.ts +5 -0
  44. package/dist/modules/auth/verifyExternalUser.d.ts +11 -0
  45. package/dist/modules/chat/addMember.d.ts +8 -0
  46. package/dist/modules/chat/changeMemberRole.d.ts +9 -0
  47. package/dist/modules/chat/createDirectConversation.d.ts +7 -0
  48. package/dist/modules/chat/createGroupConversation.d.ts +10 -0
  49. package/dist/modules/chat/deleteConversation.d.ts +8 -0
  50. package/dist/modules/chat/deleteMessage.d.ts +11 -0
  51. package/dist/modules/chat/editMessage.d.ts +13 -0
  52. package/dist/modules/chat/getConversation.d.ts +6 -0
  53. package/dist/modules/chat/getMessage.d.ts +7 -0
  54. package/dist/modules/chat/getUnreadCount.d.ts +6 -0
  55. package/dist/modules/chat/index.d.ts +21 -0
  56. package/dist/modules/chat/leaveConversation.d.ts +7 -0
  57. package/dist/modules/chat/listConversations.d.ts +17 -0
  58. package/dist/modules/chat/listMembers.d.ts +10 -0
  59. package/dist/modules/chat/listMessages.d.ts +23 -0
  60. package/dist/modules/chat/listReactions.d.ts +27 -0
  61. package/dist/modules/chat/markAsRead.d.ts +9 -0
  62. package/dist/modules/chat/removeMember.d.ts +9 -0
  63. package/dist/modules/chat/reportMessage.d.ts +12 -0
  64. package/dist/modules/chat/sendMessage.d.ts +21 -0
  65. package/dist/modules/chat/toggleReaction.d.ts +16 -0
  66. package/dist/modules/chat/updateConversation.d.ts +12 -0
  67. package/dist/modules/collections/addEntityToCollection.d.ts +13 -0
  68. package/dist/modules/collections/createNewCollection.d.ts +8 -0
  69. package/dist/modules/collections/deleteCollection.d.ts +5 -0
  70. package/dist/modules/collections/fetchCollectionEntities.d.ts +13 -0
  71. package/dist/modules/collections/fetchRootCollection.d.ts +3 -0
  72. package/dist/modules/collections/fetchSubCollections.d.ts +6 -0
  73. package/dist/modules/collections/index.d.ts +8 -0
  74. package/dist/modules/collections/removeEntityFromCollection.d.ts +7 -0
  75. package/dist/modules/collections/updateCollection.d.ts +7 -0
  76. package/dist/modules/comments/addReaction.d.ts +8 -0
  77. package/dist/modules/comments/createComment.d.ts +15 -0
  78. package/dist/modules/comments/deleteComment.d.ts +5 -0
  79. package/dist/modules/comments/fetchComment.d.ts +3 -1
  80. package/dist/modules/comments/fetchCommentByForeignId.d.ts +3 -1
  81. package/dist/modules/comments/fetchManyComments.d.ts +14 -0
  82. package/dist/modules/comments/fetchReactions.d.ts +20 -0
  83. package/dist/modules/comments/getUserReaction.d.ts +9 -0
  84. package/dist/modules/comments/index.d.ts +10 -3
  85. package/dist/modules/comments/removeReaction.d.ts +6 -0
  86. package/dist/modules/comments/updateComment.d.ts +7 -0
  87. package/dist/modules/connections/acceptConnection.d.ts +6 -0
  88. package/dist/modules/connections/declineConnection.d.ts +6 -0
  89. package/dist/modules/connections/fetchConnections.d.ts +8 -0
  90. package/dist/modules/connections/fetchConnectionsCount.d.ts +3 -0
  91. package/dist/modules/connections/fetchReceivedPendingConnections.d.ts +8 -0
  92. package/dist/modules/connections/fetchSentPendingConnections.d.ts +8 -0
  93. package/dist/modules/connections/index.d.ts +7 -0
  94. package/dist/modules/connections/removeConnection.d.ts +5 -0
  95. package/dist/modules/entities/addReaction.d.ts +8 -0
  96. package/dist/modules/entities/createEntity.d.ts +7 -2
  97. package/dist/modules/entities/deleteEntity.d.ts +1 -1
  98. package/dist/modules/entities/fetchDrafts.d.ts +11 -0
  99. package/dist/modules/entities/fetchEntity.d.ts +3 -1
  100. package/dist/modules/entities/fetchEntityByForeignId.d.ts +3 -1
  101. package/dist/modules/entities/fetchEntityByShortId.d.ts +3 -1
  102. package/dist/modules/entities/fetchManyEntities.d.ts +11 -3
  103. package/dist/modules/entities/fetchReactions.d.ts +20 -0
  104. package/dist/modules/entities/fetchTopComment.d.ts +6 -0
  105. package/dist/modules/entities/getUserReaction.d.ts +9 -0
  106. package/dist/modules/entities/index.d.ts +15 -8
  107. package/dist/modules/entities/isEntitySaved.d.ts +12 -0
  108. package/dist/modules/entities/publishDraft.d.ts +6 -0
  109. package/dist/modules/entities/removeReaction.d.ts +6 -0
  110. package/dist/modules/entities/updateEntity.d.ts +6 -7
  111. package/dist/modules/follows/deleteFollow.d.ts +5 -0
  112. package/dist/modules/follows/fetchFollowers.d.ts +8 -0
  113. package/dist/modules/follows/fetchFollowersCount.d.ts +5 -0
  114. package/dist/modules/follows/fetchFollowing.d.ts +8 -0
  115. package/dist/modules/follows/fetchFollowingCount.d.ts +5 -0
  116. package/dist/modules/follows/index.d.ts +5 -0
  117. package/dist/modules/oauth/authorize.d.ts +25 -0
  118. package/dist/modules/oauth/index.d.ts +4 -0
  119. package/dist/modules/oauth/linkIdentity.d.ts +14 -0
  120. package/dist/modules/oauth/listIdentities.d.ts +4 -0
  121. package/dist/modules/oauth/unlinkIdentity.d.ts +12 -0
  122. package/dist/modules/reports/createReport.d.ts +9 -0
  123. package/dist/modules/reports/fetchModeratedReports.d.ts +12 -0
  124. package/dist/modules/reports/index.d.ts +2 -0
  125. package/dist/modules/search/askContent.d.ts +51 -0
  126. package/dist/modules/search/index.d.ts +4 -0
  127. package/dist/modules/search/searchContent.d.ts +17 -0
  128. package/dist/modules/search/searchSpaces.d.ts +11 -0
  129. package/dist/modules/search/searchUsers.d.ts +11 -0
  130. package/dist/modules/spaces/approveMembership.d.ts +7 -0
  131. package/dist/modules/spaces/banMember.d.ts +13 -0
  132. package/dist/modules/spaces/checkMyMembership.d.ts +6 -0
  133. package/dist/modules/spaces/checkSlugAvailability.d.ts +8 -0
  134. package/dist/modules/spaces/createRule.d.ts +8 -0
  135. package/dist/modules/spaces/createSpace.d.ts +13 -0
  136. package/dist/modules/spaces/declineMembership.d.ts +7 -0
  137. package/dist/modules/spaces/deleteRule.d.ts +7 -0
  138. package/dist/modules/spaces/deleteSpace.d.ts +6 -0
  139. package/dist/modules/spaces/fetchChildSpaces.d.ts +11 -0
  140. package/dist/modules/spaces/fetchDigestConfig.d.ts +6 -0
  141. package/dist/modules/spaces/fetchManyRules.d.ts +6 -0
  142. package/dist/modules/spaces/fetchManySpaces.d.ts +16 -0
  143. package/dist/modules/spaces/fetchRule.d.ts +7 -0
  144. package/dist/modules/spaces/fetchSpace.d.ts +6 -0
  145. package/dist/modules/spaces/fetchSpaceBreadcrumb.d.ts +6 -0
  146. package/dist/modules/spaces/fetchSpaceByShortId.d.ts +6 -0
  147. package/dist/modules/spaces/fetchSpaceBySlug.d.ts +6 -0
  148. package/dist/modules/spaces/fetchSpaceMembers.d.ts +10 -0
  149. package/dist/modules/spaces/fetchSpaceTeam.d.ts +6 -0
  150. package/dist/modules/spaces/fetchUserSpaces.d.ts +11 -0
  151. package/dist/modules/spaces/getSpaceConversation.d.ts +6 -0
  152. package/dist/modules/spaces/handleCommentReport.d.ts +14 -0
  153. package/dist/modules/spaces/handleEntityReport.d.ts +17 -0
  154. package/dist/modules/spaces/handleSpaceChatReport.d.ts +18 -0
  155. package/dist/modules/spaces/index.d.ts +36 -0
  156. package/dist/modules/spaces/joinSpace.d.ts +6 -0
  157. package/dist/modules/spaces/leaveSpace.d.ts +6 -0
  158. package/dist/modules/spaces/moderateSpaceChatMessage.d.ts +12 -0
  159. package/dist/modules/spaces/moderateSpaceComment.d.ts +9 -0
  160. package/dist/modules/spaces/moderateSpaceEntity.d.ts +12 -0
  161. package/dist/modules/spaces/reorderRules.d.ts +7 -0
  162. package/dist/modules/spaces/unbanMember.d.ts +13 -0
  163. package/dist/modules/spaces/updateDigestConfig.d.ts +11 -0
  164. package/dist/modules/spaces/updateMemberRole.d.ts +8 -0
  165. package/dist/modules/spaces/updateRule.d.ts +9 -0
  166. package/dist/modules/spaces/updateSpace.d.ts +12 -0
  167. package/dist/modules/storage/deleteFile.d.ts +5 -0
  168. package/dist/modules/storage/getFile.d.ts +34 -0
  169. package/dist/modules/storage/index.d.ts +4 -0
  170. package/dist/modules/storage/uploadFile.d.ts +30 -0
  171. package/dist/modules/storage/uploadImage.d.ts +41 -0
  172. package/dist/modules/users/checkUsernameAvailability.d.ts +8 -0
  173. package/dist/modules/users/createFollow.d.ts +7 -0
  174. package/dist/modules/users/deleteFollow.d.ts +6 -0
  175. package/dist/modules/users/fetchConnectionStatus.d.ts +10 -0
  176. package/dist/modules/users/fetchConnectionsByUserId.d.ts +9 -0
  177. package/dist/modules/users/fetchConnectionsCountByUserId.d.ts +6 -0
  178. package/dist/modules/users/fetchFollowStatus.d.ts +14 -0
  179. package/dist/modules/users/fetchFollowersByUserId.d.ts +9 -0
  180. package/dist/modules/users/fetchFollowersCountByUserId.d.ts +8 -0
  181. package/dist/modules/users/fetchFollowingByUserId.d.ts +9 -0
  182. package/dist/modules/users/fetchFollowingCountByUserId.d.ts +8 -0
  183. package/dist/modules/users/fetchUserByForeignId.d.ts +3 -7
  184. package/dist/modules/users/fetchUserById.d.ts +3 -1
  185. package/dist/modules/users/fetchUserByUsername.d.ts +7 -0
  186. package/dist/modules/users/fetchUserSuggestions.d.ts +6 -0
  187. package/dist/modules/users/index.d.ts +18 -3
  188. package/dist/modules/users/removeConnectionByUserId.d.ts +10 -0
  189. package/dist/modules/users/requestConnection.d.ts +11 -0
  190. package/dist/modules/users/updateUser.d.ts +32 -0
  191. package/package.json +6 -3
  192. package/CLAUDE.md +0 -339
  193. package/pnpm-workspace.yaml +0 -2
  194. package/src/core/client.ts +0 -15
  195. package/src/index.ts +0 -45
  196. package/src/interfaces/IPaginatedResponse.ts +0 -12
  197. package/src/modules/comments/fetchComment.ts +0 -14
  198. package/src/modules/comments/fetchCommentByForeignId.ts +0 -14
  199. package/src/modules/comments/index.ts +0 -4
  200. package/src/modules/entities/createEntity.ts +0 -27
  201. package/src/modules/entities/deleteEntity.ts +0 -14
  202. package/src/modules/entities/fetchEntity.ts +0 -14
  203. package/src/modules/entities/fetchEntityByForeignId.ts +0 -15
  204. package/src/modules/entities/fetchEntityByShortId.ts +0 -14
  205. package/src/modules/entities/fetchManyEntities.ts +0 -79
  206. package/src/modules/entities/index.ts +0 -17
  207. package/src/modules/entities/updateEntity.ts +0 -28
  208. package/src/modules/users/fetchUserByForeignId.ts +0 -40
  209. package/src/modules/users/fetchUserById.ts +0 -15
  210. package/src/modules/users/index.ts +0 -4
  211. package/tsconfig.json +0 -14
@@ -1,18 +1,17 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
+ import { Entity } from "../../interfaces/Entity";
3
+ import { Mention } from "../../interfaces/Mention";
2
4
  export interface UpdateEntityProps {
3
5
  entityId: string;
4
6
  title?: string;
5
7
  content?: string;
6
8
  attachments?: Record<string, any>[];
7
9
  keywords?: string[];
10
+ mentions?: Mention[];
8
11
  location?: {
9
- type: "Point";
10
- coordinates: [number, number];
12
+ latitude: number;
13
+ longitude: number;
11
14
  };
12
15
  metadata?: Record<string, any>;
13
- mentions?: {
14
- id: string;
15
- username: string;
16
- }[];
17
16
  }
18
- export declare function updateEntity(client: SublayHttpClient, data: UpdateEntityProps): Promise<any>;
17
+ export declare function updateEntity(client: SublayHttpClient, data: UpdateEntityProps): Promise<Entity>;
@@ -0,0 +1,5 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface DeleteFollowByIdProps {
3
+ followId: string;
4
+ }
5
+ export declare function deleteFollow(client: SublayHttpClient, data: DeleteFollowByIdProps): Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { FollowListItem } from "../../interfaces/Follow";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchFollowersProps {
5
+ page?: number;
6
+ limit?: number;
7
+ }
8
+ export declare function fetchFollowers(client: SublayHttpClient, data: FetchFollowersProps): Promise<PaginatedResponse<FollowListItem>>;
@@ -0,0 +1,5 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface FollowersCountResponse {
3
+ count: number;
4
+ }
5
+ export declare function fetchFollowersCount(client: SublayHttpClient): Promise<FollowersCountResponse>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { FollowListItem } from "../../interfaces/Follow";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchFollowingProps {
5
+ page?: number;
6
+ limit?: number;
7
+ }
8
+ export declare function fetchFollowing(client: SublayHttpClient, data: FetchFollowingProps): Promise<PaginatedResponse<FollowListItem>>;
@@ -0,0 +1,5 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface FollowingCountResponse {
3
+ count: number;
4
+ }
5
+ export declare function fetchFollowingCount(client: SublayHttpClient): Promise<FollowingCountResponse>;
@@ -0,0 +1,5 @@
1
+ export { fetchFollowing } from "./fetchFollowing";
2
+ export { fetchFollowers } from "./fetchFollowers";
3
+ export { fetchFollowingCount } from "./fetchFollowingCount";
4
+ export { fetchFollowersCount } from "./fetchFollowersCount";
5
+ export { deleteFollow } from "./deleteFollow";
@@ -0,0 +1,25 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ /** Providers the server supports (mirrors the server's `oauthProviderSchema`). */
3
+ export type OAuthProvider = "google" | "github" | "apple" | "facebook";
4
+ export interface AuthorizeProps {
5
+ provider: OAuthProvider;
6
+ /**
7
+ * Where the server should send the browser back to once auth completes. Must
8
+ * be one of the project's allowed redirect URIs (configured in the dashboard).
9
+ */
10
+ redirectAfterAuth: string;
11
+ }
12
+ export interface AuthorizeResponse {
13
+ /**
14
+ * The provider's authorization URL. The host app redirects the browser here;
15
+ * the provider then bounces to the server's `/oauth/callback`, which finishes
16
+ * auth and redirects back to `redirectAfterAuth` with the session.
17
+ */
18
+ authorizationUrl: string;
19
+ }
20
+ /**
21
+ * Begin an OAuth sign-in / sign-up flow (unauthenticated). Returns the
22
+ * `authorizationUrl` for the host to redirect to — it does NOT return tokens;
23
+ * the server's callback establishes the session.
24
+ */
25
+ export declare function authorize(client: SublayHttpClient, data: AuthorizeProps): Promise<AuthorizeResponse>;
@@ -0,0 +1,4 @@
1
+ export { authorize } from "./authorize";
2
+ export { linkIdentity } from "./linkIdentity";
3
+ export { listIdentities } from "./listIdentities";
4
+ export { unlinkIdentity } from "./unlinkIdentity";
@@ -0,0 +1,14 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { AuthorizeResponse, OAuthProvider } from "./authorize";
3
+ export interface LinkIdentityProps {
4
+ provider: OAuthProvider;
5
+ /** Allowed redirect URI to return the browser to after linking completes. */
6
+ redirectAfterAuth: string;
7
+ }
8
+ /**
9
+ * Link a new OAuth provider to the **current** user (authenticated). Same
10
+ * redirect contract as {@link authorize}: returns the `authorizationUrl` for the
11
+ * host to redirect to. The current user is taken from the auth token, never the
12
+ * body.
13
+ */
14
+ export declare function linkIdentity(client: SublayHttpClient, data: LinkIdentityProps): Promise<AuthorizeResponse>;
@@ -0,0 +1,4 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { ListIdentitiesResponse } from "../../interfaces/OAuthIdentity";
3
+ /** List the current user's linked OAuth identities (authenticated). */
4
+ export declare function listIdentities(client: SublayHttpClient): Promise<ListIdentitiesResponse>;
@@ -0,0 +1,12 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface UnlinkIdentityProps {
3
+ identityId: string;
4
+ }
5
+ export interface UnlinkIdentityResponse {
6
+ success: boolean;
7
+ }
8
+ /**
9
+ * Unlink one of the current user's OAuth identities (authenticated). The server
10
+ * refuses to remove the last identity if the user has no password set.
11
+ */
12
+ export declare function unlinkIdentity(client: SublayHttpClient, data: UnlinkIdentityProps): Promise<UnlinkIdentityResponse>;
@@ -0,0 +1,9 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { CreateReportResponse, ReportTargetType } from "../../interfaces/Report";
3
+ export interface CreateReportProps {
4
+ targetType: ReportTargetType;
5
+ targetId: string;
6
+ reason: string;
7
+ details?: string;
8
+ }
9
+ export declare function createReport(client: SublayHttpClient, data: CreateReportProps): Promise<CreateReportResponse>;
@@ -0,0 +1,12 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Report, ReportStatus, ReportTargetType } from "../../interfaces/Report";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchModeratedReportsProps {
5
+ spaceId?: string;
6
+ targetType?: ReportTargetType;
7
+ status?: ReportStatus;
8
+ sortBy?: "new" | "old";
9
+ page?: number;
10
+ limit?: number;
11
+ }
12
+ export declare function fetchModeratedReports(client: SublayHttpClient, data: FetchModeratedReportsProps): Promise<PaginatedResponse<Report>>;
@@ -0,0 +1,2 @@
1
+ export { createReport } from "./createReport";
2
+ export { fetchModeratedReports } from "./fetchModeratedReports";
@@ -0,0 +1,51 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { ContentSearchResult } from "./searchContent";
3
+ export interface AskContentProps {
4
+ query: string;
5
+ sourceTypes?: ("entity" | "comment" | "message")[];
6
+ spaceId?: string;
7
+ conversationId?: string;
8
+ limit?: number;
9
+ /** Abort the in-flight stream (e.g. when the user navigates away). */
10
+ signal?: AbortSignal;
11
+ }
12
+ /**
13
+ * A single Server-Sent Event from the `askContent` stream.
14
+ * - `token` — an incremental chunk of the answer text.
15
+ * - `sources` — the hydrated source records, emitted once after the answer.
16
+ * - `done` — the stream finished successfully.
17
+ * - `error` — the server reported an error (the stream ends after this).
18
+ */
19
+ export type AskContentEvent = {
20
+ type: "token";
21
+ content: string;
22
+ } | {
23
+ type: "sources";
24
+ sources: ContentSearchResult[];
25
+ } | {
26
+ type: "done";
27
+ } | {
28
+ type: "error";
29
+ error: string;
30
+ };
31
+ /**
32
+ * Ask a question over your project's content (semantic RAG). The server answers
33
+ * by streaming Server-Sent Events, so this is an **async generator**: iterate it
34
+ * to consume the answer as it arrives.
35
+ *
36
+ * ```ts
37
+ * let answer = "";
38
+ * for await (const ev of client.search.askContent({ query: "How do refunds work?" })) {
39
+ * if (ev.type === "token") answer += ev.content;
40
+ * else if (ev.type === "sources") console.log("sources:", ev.sources);
41
+ * else if (ev.type === "error") throw new Error(ev.error);
42
+ * }
43
+ * ```
44
+ *
45
+ * Cancel by passing an `AbortSignal`, or by `break`ing out of the loop.
46
+ *
47
+ * Note: this request uses `fetch` (not the axios instance), so it does not get
48
+ * the automatic 403→refresh retry. The token is read fresh at call time via the
49
+ * client's active auth mode.
50
+ */
51
+ export declare function askContent(client: SublayHttpClient, data: AskContentProps): AsyncGenerator<AskContentEvent, void, unknown>;
@@ -0,0 +1,4 @@
1
+ export { searchContent } from "./searchContent";
2
+ export { searchUsers } from "./searchUsers";
3
+ export { searchSpaces } from "./searchSpaces";
4
+ export { askContent } from "./askContent";
@@ -0,0 +1,17 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Entity } from "../../interfaces/Entity";
3
+ import { Comment } from "../../interfaces/Comment";
4
+ import { ChatMessage } from "../../interfaces/ChatMessage";
5
+ export interface SearchContentProps {
6
+ query: string;
7
+ sourceTypes?: ("entity" | "comment" | "message")[];
8
+ spaceId?: string;
9
+ conversationId?: string;
10
+ limit?: number;
11
+ }
12
+ export interface ContentSearchResult {
13
+ sourceType: "entity" | "comment" | "message";
14
+ similarity: number;
15
+ record: Entity | Comment | ChatMessage;
16
+ }
17
+ export declare function searchContent(client: SublayHttpClient, data: SearchContentProps): Promise<ContentSearchResult[]>;
@@ -0,0 +1,11 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Space } from "../../interfaces/Space";
3
+ export interface SearchSpacesProps {
4
+ query: string;
5
+ limit?: number;
6
+ }
7
+ export interface SpaceSearchResult {
8
+ similarity: number;
9
+ record: Space;
10
+ }
11
+ export declare function searchSpaces(client: SublayHttpClient, data: SearchSpacesProps): Promise<SpaceSearchResult[]>;
@@ -0,0 +1,11 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { User } from "../../interfaces/User";
3
+ export interface SearchUsersProps {
4
+ query: string;
5
+ limit?: number;
6
+ }
7
+ export interface UserSearchResult {
8
+ similarity: number;
9
+ record: User;
10
+ }
11
+ export declare function searchUsers(client: SublayHttpClient, data: SearchUsersProps): Promise<UserSearchResult[]>;
@@ -0,0 +1,7 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { ApproveMemberResponse } from "../../interfaces/Space";
3
+ export interface ApproveMembershipProps {
4
+ spaceId: string;
5
+ memberId: string;
6
+ }
7
+ export declare function approveMembership(client: SublayHttpClient, data: ApproveMembershipProps): Promise<ApproveMemberResponse>;
@@ -0,0 +1,13 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface BanMemberProps {
3
+ spaceId: string;
4
+ memberId: string;
5
+ }
6
+ export interface BanMemberResponse {
7
+ message: string;
8
+ membership: {
9
+ id: string;
10
+ status: "banned";
11
+ };
12
+ }
13
+ export declare function banMember(client: SublayHttpClient, data: BanMemberProps): Promise<BanMemberResponse>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { CheckMyMembershipResponse } from "../../interfaces/Space";
3
+ export interface CheckMyMembershipProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function checkMyMembership(client: SublayHttpClient, data: CheckMyMembershipProps): Promise<CheckMyMembershipResponse>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface CheckSlugAvailabilityProps {
3
+ slug: string;
4
+ }
5
+ export interface CheckSlugAvailabilityResponse {
6
+ available: boolean;
7
+ }
8
+ export declare function checkSlugAvailability(client: SublayHttpClient, data: CheckSlugAvailabilityProps): Promise<CheckSlugAvailabilityResponse>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Rule } from "../../interfaces/Rule";
3
+ export interface CreateRuleProps {
4
+ spaceId: string;
5
+ title: string;
6
+ description?: string;
7
+ }
8
+ export declare function createRule(client: SublayHttpClient, data: CreateRuleProps): Promise<Rule>;
@@ -0,0 +1,13 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Space, ReadingPermission, PostingPermission } from "../../interfaces/Space";
3
+ export interface CreateSpaceProps {
4
+ name: string;
5
+ slug?: string;
6
+ description?: string;
7
+ readingPermission?: ReadingPermission;
8
+ postingPermission?: PostingPermission;
9
+ requireJoinApproval?: boolean;
10
+ parentSpaceId?: string;
11
+ metadata?: Record<string, any>;
12
+ }
13
+ export declare function createSpace(client: SublayHttpClient, data: CreateSpaceProps): Promise<Space>;
@@ -0,0 +1,7 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { DeclineMemberResponse } from "../../interfaces/Space";
3
+ export interface DeclineMembershipProps {
4
+ spaceId: string;
5
+ memberId: string;
6
+ }
7
+ export declare function declineMembership(client: SublayHttpClient, data: DeclineMembershipProps): Promise<DeclineMemberResponse>;
@@ -0,0 +1,7 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { DeleteRuleResponse } from "../../interfaces/Rule";
3
+ export interface DeleteRuleProps {
4
+ spaceId: string;
5
+ ruleId: string;
6
+ }
7
+ export declare function deleteRule(client: SublayHttpClient, data: DeleteRuleProps): Promise<DeleteRuleResponse>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { DeleteSpaceResponse } from "../../interfaces/Space";
3
+ export interface DeleteSpaceProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function deleteSpace(client: SublayHttpClient, data: DeleteSpaceProps): Promise<DeleteSpaceResponse>;
@@ -0,0 +1,11 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Space } from "../../interfaces/Space";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchChildSpacesProps {
5
+ spaceId: string;
6
+ page?: number;
7
+ limit?: number;
8
+ sortBy?: "alphabetical" | "newest" | "members";
9
+ include?: string;
10
+ }
11
+ export declare function fetchChildSpaces(client: SublayHttpClient, data: FetchChildSpacesProps): Promise<PaginatedResponse<Space>>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { DigestConfig } from "../../interfaces/Space";
3
+ export interface FetchDigestConfigProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function fetchDigestConfig(client: SublayHttpClient, data: FetchDigestConfigProps): Promise<DigestConfig>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { FetchManyRulesResponse } from "../../interfaces/Rule";
3
+ export interface FetchManyRulesProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function fetchManyRules(client: SublayHttpClient, data: FetchManyRulesProps): Promise<FetchManyRulesResponse>;
@@ -0,0 +1,16 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Space } from "../../interfaces/Space";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchManySpacesProps {
5
+ page?: number;
6
+ limit?: number;
7
+ sortBy?: "alphabetical" | "newest" | "members";
8
+ searchSlug?: string;
9
+ searchName?: string;
10
+ searchDescription?: string;
11
+ searchAny?: string;
12
+ memberOf?: "true";
13
+ parentSpaceId?: string | "null";
14
+ include?: string;
15
+ }
16
+ export declare function fetchManySpaces(client: SublayHttpClient, data: FetchManySpacesProps): Promise<PaginatedResponse<Space>>;
@@ -0,0 +1,7 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Rule } from "../../interfaces/Rule";
3
+ export interface FetchRuleProps {
4
+ spaceId: string;
5
+ ruleId: string;
6
+ }
7
+ export declare function fetchRule(client: SublayHttpClient, data: FetchRuleProps): Promise<Rule>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { SpaceDetailed } from "../../interfaces/Space";
3
+ export interface FetchSpaceProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function fetchSpace(client: SublayHttpClient, data: FetchSpaceProps): Promise<SpaceDetailed>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { SpaceBreadcrumb } from "../../interfaces/Space";
3
+ export interface FetchSpaceBreadcrumbProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function fetchSpaceBreadcrumb(client: SublayHttpClient, data: FetchSpaceBreadcrumbProps): Promise<SpaceBreadcrumb>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { SpaceDetailed } from "../../interfaces/Space";
3
+ export interface FetchSpaceByShortIdProps {
4
+ shortId: string;
5
+ }
6
+ export declare function fetchSpaceByShortId(client: SublayHttpClient, data: FetchSpaceByShortIdProps): Promise<SpaceDetailed>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { SpaceDetailed } from "../../interfaces/Space";
3
+ export interface FetchSpaceBySlugProps {
4
+ slug: string;
5
+ }
6
+ export declare function fetchSpaceBySlug(client: SublayHttpClient, data: FetchSpaceBySlugProps): Promise<SpaceDetailed>;
@@ -0,0 +1,10 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { SpaceMembersResponse } from "../../interfaces/SpaceMember";
3
+ export interface FetchSpaceMembersProps {
4
+ spaceId: string;
5
+ page?: number;
6
+ limit?: number;
7
+ role?: "admin" | "moderator" | "member";
8
+ status?: "pending" | "active" | "banned" | "rejected";
9
+ }
10
+ export declare function fetchSpaceMembers(client: SublayHttpClient, data: FetchSpaceMembersProps): Promise<SpaceMembersResponse>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { SpaceTeamResponse } from "../../interfaces/SpaceMember";
3
+ export interface FetchSpaceTeamProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function fetchSpaceTeam(client: SublayHttpClient, data: FetchSpaceTeamProps): Promise<SpaceTeamResponse>;
@@ -0,0 +1,11 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { UserSpacesResponse } from "../../interfaces/Space";
3
+ export interface FetchUserSpacesProps {
4
+ page?: number;
5
+ limit?: number;
6
+ sortBy?: "alphabetical" | "newest" | "members";
7
+ include?: string;
8
+ role?: string;
9
+ all?: "true" | "false";
10
+ }
11
+ export declare function fetchUserSpaces(client: SublayHttpClient, data: FetchUserSpacesProps): Promise<UserSpacesResponse>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Conversation } from "../../interfaces/Conversation";
3
+ export interface GetSpaceConversationProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function getSpaceConversation(client: SublayHttpClient, data: GetSpaceConversationProps): Promise<Conversation>;
@@ -0,0 +1,14 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { HandleReportResponse } from "./handleEntityReport";
3
+ export type CommentReportAction = "remove-comment" | "ban-user" | "dismiss";
4
+ export interface HandleCommentReportProps {
5
+ spaceId: string;
6
+ reportId: string;
7
+ commentId: string;
8
+ actions: CommentReportAction[];
9
+ summary?: string;
10
+ reason?: string;
11
+ /** The user to ban (target), required when actions include "ban-user". */
12
+ userId?: string;
13
+ }
14
+ export declare function handleCommentReport(client: SublayHttpClient, data: HandleCommentReportProps): Promise<HandleReportResponse>;
@@ -0,0 +1,17 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export type EntityReportAction = "remove-entity" | "ban-user" | "dismiss";
3
+ export interface HandleEntityReportProps {
4
+ spaceId: string;
5
+ reportId: string;
6
+ entityId: string;
7
+ actions: EntityReportAction[];
8
+ summary?: string;
9
+ reason?: string;
10
+ /** The user to ban (target), required when actions include "ban-user". */
11
+ userId?: string;
12
+ }
13
+ export interface HandleReportResponse {
14
+ message: string;
15
+ code: string;
16
+ }
17
+ export declare function handleEntityReport(client: SublayHttpClient, data: HandleEntityReportProps): Promise<HandleReportResponse>;
@@ -0,0 +1,18 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export type SpaceChatReportAction = "remove-message" | "ban-user" | "dismiss";
3
+ export interface HandleSpaceChatReportProps {
4
+ spaceId: string;
5
+ reportId: string;
6
+ actions: SpaceChatReportAction[];
7
+ summary?: string;
8
+ /** The user to ban (target), required when actions include "ban-user". */
9
+ userId?: string;
10
+ reason?: string;
11
+ /** The message to remove, required when actions include "remove-message". */
12
+ messageId?: string;
13
+ }
14
+ export interface HandleSpaceChatReportResponse {
15
+ message: string;
16
+ code: string;
17
+ }
18
+ export declare function handleSpaceChatReport(client: SublayHttpClient, data: HandleSpaceChatReportProps): Promise<HandleSpaceChatReportResponse>;
@@ -0,0 +1,36 @@
1
+ export { createSpace } from "./createSpace";
2
+ export { fetchManySpaces } from "./fetchManySpaces";
3
+ export { fetchSpace } from "./fetchSpace";
4
+ export { fetchSpaceByShortId } from "./fetchSpaceByShortId";
5
+ export { fetchSpaceBySlug } from "./fetchSpaceBySlug";
6
+ export { fetchUserSpaces } from "./fetchUserSpaces";
7
+ export { checkSlugAvailability } from "./checkSlugAvailability";
8
+ export { updateSpace } from "./updateSpace";
9
+ export { deleteSpace } from "./deleteSpace";
10
+ export { fetchChildSpaces } from "./fetchChildSpaces";
11
+ export { fetchSpaceBreadcrumb } from "./fetchSpaceBreadcrumb";
12
+ export { joinSpace } from "./joinSpace";
13
+ export { leaveSpace } from "./leaveSpace";
14
+ export { checkMyMembership } from "./checkMyMembership";
15
+ export { fetchSpaceMembers } from "./fetchSpaceMembers";
16
+ export { fetchSpaceTeam } from "./fetchSpaceTeam";
17
+ export { updateMemberRole } from "./updateMemberRole";
18
+ export { approveMembership } from "./approveMembership";
19
+ export { declineMembership } from "./declineMembership";
20
+ export { banMember } from "./banMember";
21
+ export { unbanMember } from "./unbanMember";
22
+ export { fetchManyRules } from "./fetchManyRules";
23
+ export { fetchRule } from "./fetchRule";
24
+ export { createRule } from "./createRule";
25
+ export { updateRule } from "./updateRule";
26
+ export { deleteRule } from "./deleteRule";
27
+ export { reorderRules } from "./reorderRules";
28
+ export { handleEntityReport } from "./handleEntityReport";
29
+ export { handleCommentReport } from "./handleCommentReport";
30
+ export { moderateSpaceEntity } from "./moderateSpaceEntity";
31
+ export { moderateSpaceComment } from "./moderateSpaceComment";
32
+ export { fetchDigestConfig } from "./fetchDigestConfig";
33
+ export { updateDigestConfig } from "./updateDigestConfig";
34
+ export { getSpaceConversation } from "./getSpaceConversation";
35
+ export { moderateSpaceChatMessage } from "./moderateSpaceChatMessage";
36
+ export { handleSpaceChatReport } from "./handleSpaceChatReport";
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { JoinSpaceResponse } from "../../interfaces/Space";
3
+ export interface JoinSpaceProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function joinSpace(client: SublayHttpClient, data: JoinSpaceProps): Promise<JoinSpaceResponse>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { LeaveSpaceResponse } from "../../interfaces/Space";
3
+ export interface LeaveSpaceProps {
4
+ spaceId: string;
5
+ }
6
+ export declare function leaveSpace(client: SublayHttpClient, data: LeaveSpaceProps): Promise<LeaveSpaceResponse>;
@@ -0,0 +1,12 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface ModerateSpaceChatMessageProps {
3
+ spaceId: string;
4
+ messageId: string;
5
+ moderationStatus: "removed";
6
+ moderationReason?: string;
7
+ }
8
+ export interface ModerateSpaceChatMessageResponse {
9
+ message: string;
10
+ moderationStatus: string;
11
+ }
12
+ export declare function moderateSpaceChatMessage(client: SublayHttpClient, data: ModerateSpaceChatMessageProps): Promise<ModerateSpaceChatMessageResponse>;
@@ -0,0 +1,9 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { ModerationResponse } from "./moderateSpaceEntity";
3
+ export interface ModerateSpaceCommentProps {
4
+ spaceId: string;
5
+ commentId: string;
6
+ action: "approve" | "remove";
7
+ reason?: string;
8
+ }
9
+ export declare function moderateSpaceComment(client: SublayHttpClient, data: ModerateSpaceCommentProps): Promise<ModerationResponse>;