@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.
- package/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +23 -14
- package/dist/index.d.mts +374 -21
- package/dist/index.d.ts +4364 -31
- package/dist/index.js +53 -19
- package/dist/index.mjs +53 -19
- package/package.json +29 -18
- package/dist/core/client.d.ts +0 -64
- package/dist/core/multipart.d.ts +0 -22
- package/dist/core/spaceReputationParams.d.ts +0 -57
- package/dist/interfaces/AppNotification.d.ts +0 -258
- package/dist/interfaces/ChatMessage.d.ts +0 -32
- package/dist/interfaces/Collection.d.ts +0 -10
- package/dist/interfaces/Comment.d.ts +0 -42
- package/dist/interfaces/Connection.d.ts +0 -67
- package/dist/interfaces/Conversation.d.ts +0 -27
- package/dist/interfaces/ConversationMember.d.ts +0 -17
- package/dist/interfaces/Entity.d.ts +0 -55
- package/dist/interfaces/Event.d.ts +0 -66
- package/dist/interfaces/File.d.ts +0 -39
- package/dist/interfaces/Follow.d.ts +0 -19
- package/dist/interfaces/HostedApp.d.ts +0 -11
- package/dist/interfaces/IPaginatedResponse.d.ts +0 -11
- package/dist/interfaces/ImageProcessing.d.ts +0 -62
- package/dist/interfaces/Mention.d.ts +0 -12
- package/dist/interfaces/OAuthIdentity.d.ts +0 -14
- package/dist/interfaces/Project.d.ts +0 -14
- package/dist/interfaces/Push.d.ts +0 -74
- package/dist/interfaces/Reaction.d.ts +0 -23
- package/dist/interfaces/Report.d.ts +0 -38
- package/dist/interfaces/Rule.d.ts +0 -22
- package/dist/interfaces/Space.d.ts +0 -130
- package/dist/interfaces/SpaceMember.d.ts +0 -29
- package/dist/interfaces/SpaceReputation.d.ts +0 -100
- package/dist/interfaces/Table.d.ts +0 -63
- package/dist/interfaces/User.d.ts +0 -46
- package/dist/interfaces/UserSearch.d.ts +0 -13
- package/dist/interfaces/Workspace.d.ts +0 -148
- package/dist/modules/app-notifications/countUnreadNotifications.d.ts +0 -2
- package/dist/modules/app-notifications/fetchNotifications.d.ts +0 -8
- package/dist/modules/app-notifications/index.d.ts +0 -4
- package/dist/modules/app-notifications/markAllNotificationsAsRead.d.ts +0 -5
- package/dist/modules/app-notifications/markNotificationAsRead.d.ts +0 -5
- package/dist/modules/auth/changePassword.d.ts +0 -34
- package/dist/modules/auth/confirmAccountDeletion.d.ts +0 -11
- package/dist/modules/auth/index.d.ts +0 -13
- package/dist/modules/auth/requestAccountDeletion.d.ts +0 -14
- package/dist/modules/auth/requestNewAccessToken.d.ts +0 -16
- package/dist/modules/auth/requestPasswordReset.d.ts +0 -5
- package/dist/modules/auth/resetPassword.d.ts +0 -6
- package/dist/modules/auth/sendVerificationEmail.d.ts +0 -13
- package/dist/modules/auth/setPassword.d.ts +0 -9
- package/dist/modules/auth/signIn.d.ts +0 -12
- package/dist/modules/auth/signOut.d.ts +0 -103
- package/dist/modules/auth/signUp.d.ts +0 -24
- package/dist/modules/auth/verifyEmail.d.ts +0 -5
- package/dist/modules/auth/verifyExternalUser.d.ts +0 -11
- package/dist/modules/chat/addMember.d.ts +0 -8
- package/dist/modules/chat/changeMemberRole.d.ts +0 -9
- package/dist/modules/chat/createDirectConversation.d.ts +0 -7
- package/dist/modules/chat/createGroupConversation.d.ts +0 -10
- package/dist/modules/chat/deleteConversation.d.ts +0 -8
- package/dist/modules/chat/deleteMessage.d.ts +0 -11
- package/dist/modules/chat/editMessage.d.ts +0 -14
- package/dist/modules/chat/getConversation.d.ts +0 -6
- package/dist/modules/chat/getMessage.d.ts +0 -8
- package/dist/modules/chat/getUnreadCount.d.ts +0 -6
- package/dist/modules/chat/index.d.ts +0 -21
- package/dist/modules/chat/leaveConversation.d.ts +0 -7
- package/dist/modules/chat/listConversations.d.ts +0 -17
- package/dist/modules/chat/listMembers.d.ts +0 -11
- package/dist/modules/chat/listMessages.d.ts +0 -40
- package/dist/modules/chat/listReactions.d.ts +0 -24
- package/dist/modules/chat/markAsRead.d.ts +0 -9
- package/dist/modules/chat/muteConversation.d.ts +0 -23
- package/dist/modules/chat/removeMember.d.ts +0 -9
- package/dist/modules/chat/reportMessage.d.ts +0 -12
- package/dist/modules/chat/sendMessage.d.ts +0 -22
- package/dist/modules/chat/toggleReaction.d.ts +0 -16
- package/dist/modules/chat/updateConversation.d.ts +0 -12
- package/dist/modules/collections/addEntityToCollection.d.ts +0 -13
- package/dist/modules/collections/createNewCollection.d.ts +0 -8
- package/dist/modules/collections/deleteCollection.d.ts +0 -5
- package/dist/modules/collections/fetchCollectionEntities.d.ts +0 -13
- package/dist/modules/collections/fetchRootCollection.d.ts +0 -3
- package/dist/modules/collections/fetchSubCollections.d.ts +0 -6
- package/dist/modules/collections/index.d.ts +0 -8
- package/dist/modules/collections/removeEntityFromCollection.d.ts +0 -7
- package/dist/modules/collections/updateCollection.d.ts +0 -7
- package/dist/modules/comments/addReaction.d.ts +0 -8
- package/dist/modules/comments/createComment.d.ts +0 -15
- package/dist/modules/comments/deleteComment.d.ts +0 -5
- package/dist/modules/comments/fetchComment.d.ts +0 -8
- package/dist/modules/comments/fetchCommentByForeignId.d.ts +0 -7
- package/dist/modules/comments/fetchManyComments.d.ts +0 -26
- package/dist/modules/comments/fetchReactions.d.ts +0 -16
- package/dist/modules/comments/getUserReaction.d.ts +0 -9
- package/dist/modules/comments/index.d.ts +0 -10
- package/dist/modules/comments/removeReaction.d.ts +0 -6
- package/dist/modules/comments/updateComment.d.ts +0 -10
- package/dist/modules/connections/acceptConnection.d.ts +0 -6
- package/dist/modules/connections/declineConnection.d.ts +0 -6
- package/dist/modules/connections/fetchConnections.d.ts +0 -9
- package/dist/modules/connections/fetchConnectionsCount.d.ts +0 -3
- package/dist/modules/connections/fetchReceivedPendingConnections.d.ts +0 -8
- package/dist/modules/connections/fetchSentPendingConnections.d.ts +0 -8
- package/dist/modules/connections/index.d.ts +0 -7
- package/dist/modules/connections/removeConnection.d.ts +0 -5
- package/dist/modules/entities/addReaction.d.ts +0 -8
- package/dist/modules/entities/createEntity.d.ts +0 -23
- package/dist/modules/entities/deleteEntity.d.ts +0 -5
- package/dist/modules/entities/fetchDrafts.d.ts +0 -11
- package/dist/modules/entities/fetchEntity.d.ts +0 -8
- package/dist/modules/entities/fetchEntityByForeignId.d.ts +0 -8
- package/dist/modules/entities/fetchEntityByShortId.d.ts +0 -7
- package/dist/modules/entities/fetchManyEntities.d.ts +0 -65
- package/dist/modules/entities/fetchReactions.d.ts +0 -16
- package/dist/modules/entities/fetchTopComment.d.ts +0 -6
- package/dist/modules/entities/getUserReaction.d.ts +0 -9
- package/dist/modules/entities/index.d.ts +0 -15
- package/dist/modules/entities/isEntitySaved.d.ts +0 -12
- package/dist/modules/entities/publishDraft.d.ts +0 -6
- package/dist/modules/entities/removeReaction.d.ts +0 -6
- package/dist/modules/entities/updateEntity.d.ts +0 -18
- package/dist/modules/events/addHost.d.ts +0 -8
- package/dist/modules/events/addInvite.d.ts +0 -8
- package/dist/modules/events/cancelEvent.d.ts +0 -6
- package/dist/modules/events/createEvent.d.ts +0 -49
- package/dist/modules/events/deleteEvent.d.ts +0 -5
- package/dist/modules/events/fetchEvent.d.ts +0 -8
- package/dist/modules/events/fetchEventRsvps.d.ts +0 -19
- package/dist/modules/events/fetchInvitees.d.ts +0 -12
- package/dist/modules/events/fetchManyEvents.d.ts +0 -42
- package/dist/modules/events/index.d.ts +0 -14
- package/dist/modules/events/removeHost.d.ts +0 -8
- package/dist/modules/events/removeInvite.d.ts +0 -8
- package/dist/modules/events/setRsvp.d.ts +0 -7
- package/dist/modules/events/updateEvent.d.ts +0 -43
- package/dist/modules/events/withdrawRsvp.d.ts +0 -6
- package/dist/modules/follows/deleteFollow.d.ts +0 -5
- package/dist/modules/follows/fetchFollowers.d.ts +0 -9
- package/dist/modules/follows/fetchFollowersCount.d.ts +0 -5
- package/dist/modules/follows/fetchFollowing.d.ts +0 -9
- package/dist/modules/follows/fetchFollowingCount.d.ts +0 -5
- package/dist/modules/follows/index.d.ts +0 -5
- package/dist/modules/oauth/authorize.d.ts +0 -25
- package/dist/modules/oauth/index.d.ts +0 -4
- package/dist/modules/oauth/linkIdentity.d.ts +0 -14
- package/dist/modules/oauth/listIdentities.d.ts +0 -4
- package/dist/modules/oauth/unlinkIdentity.d.ts +0 -12
- package/dist/modules/push/getNotificationPreferences.d.ts +0 -11
- package/dist/modules/push/index.d.ts +0 -2
- package/dist/modules/push/updateNotificationPreferences.d.ts +0 -16
- package/dist/modules/reports/createReport.d.ts +0 -9
- package/dist/modules/reports/fetchModeratedReports.d.ts +0 -13
- package/dist/modules/reports/index.d.ts +0 -2
- package/dist/modules/search/askContent.d.ts +0 -58
- package/dist/modules/search/index.d.ts +0 -5
- package/dist/modules/search/matchUsers.d.ts +0 -36
- package/dist/modules/search/searchContent.d.ts +0 -24
- package/dist/modules/search/searchSpaces.d.ts +0 -11
- package/dist/modules/search/searchUsers.d.ts +0 -11
- package/dist/modules/spaces/approveMembership.d.ts +0 -7
- package/dist/modules/spaces/banMember.d.ts +0 -13
- package/dist/modules/spaces/checkMyMembership.d.ts +0 -6
- package/dist/modules/spaces/checkSlugAvailability.d.ts +0 -8
- package/dist/modules/spaces/createRule.d.ts +0 -8
- package/dist/modules/spaces/createSpace.d.ts +0 -29
- package/dist/modules/spaces/declineMembership.d.ts +0 -7
- package/dist/modules/spaces/deleteRule.d.ts +0 -7
- package/dist/modules/spaces/deleteSpace.d.ts +0 -6
- package/dist/modules/spaces/fetchChildSpaces.d.ts +0 -11
- package/dist/modules/spaces/fetchDigestConfig.d.ts +0 -6
- package/dist/modules/spaces/fetchManyRules.d.ts +0 -6
- package/dist/modules/spaces/fetchManySpaces.d.ts +0 -17
- package/dist/modules/spaces/fetchMutualSpaces.d.ts +0 -11
- package/dist/modules/spaces/fetchRule.d.ts +0 -7
- package/dist/modules/spaces/fetchSpace.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceBreadcrumb.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceByShortId.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceBySlug.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceMembers.d.ts +0 -11
- package/dist/modules/spaces/fetchSpaceTeam.d.ts +0 -7
- package/dist/modules/spaces/fetchUserSpaces.d.ts +0 -17
- package/dist/modules/spaces/getSpaceConversation.d.ts +0 -6
- package/dist/modules/spaces/handleCommentReport.d.ts +0 -14
- package/dist/modules/spaces/handleEntityReport.d.ts +0 -17
- package/dist/modules/spaces/handleSpaceChatReport.d.ts +0 -18
- package/dist/modules/spaces/index.d.ts +0 -36
- package/dist/modules/spaces/joinSpace.d.ts +0 -6
- package/dist/modules/spaces/leaveSpace.d.ts +0 -6
- package/dist/modules/spaces/moderateSpaceChatMessage.d.ts +0 -12
- package/dist/modules/spaces/moderateSpaceComment.d.ts +0 -9
- package/dist/modules/spaces/moderateSpaceEntity.d.ts +0 -12
- package/dist/modules/spaces/reorderRules.d.ts +0 -7
- package/dist/modules/spaces/setSpaceEntityNsfw.d.ts +0 -16
- package/dist/modules/spaces/unbanMember.d.ts +0 -13
- package/dist/modules/spaces/updateDigestConfig.d.ts +0 -11
- package/dist/modules/spaces/updateMemberRole.d.ts +0 -8
- package/dist/modules/spaces/updateRule.d.ts +0 -9
- package/dist/modules/spaces/updateSpace.d.ts +0 -22
- package/dist/modules/storage/deleteFile.d.ts +0 -5
- package/dist/modules/storage/getFile.d.ts +0 -34
- package/dist/modules/storage/index.d.ts +0 -4
- package/dist/modules/storage/uploadFile.d.ts +0 -30
- package/dist/modules/storage/uploadImage.d.ts +0 -42
- package/dist/modules/tables/bulkCreate.d.ts +0 -4
- package/dist/modules/tables/bulkDelete.d.ts +0 -7
- package/dist/modules/tables/create.d.ts +0 -4
- package/dist/modules/tables/createTableAccessor.d.ts +0 -9
- package/dist/modules/tables/deleteRow.d.ts +0 -9
- package/dist/modules/tables/find.d.ts +0 -8
- package/dist/modules/tables/findOne.d.ts +0 -7
- package/dist/modules/tables/index.d.ts +0 -9
- package/dist/modules/tables/restore.d.ts +0 -6
- package/dist/modules/tables/update.d.ts +0 -4
- package/dist/modules/users/checkUsernameAvailability.d.ts +0 -8
- package/dist/modules/users/createBlock.d.ts +0 -19
- package/dist/modules/users/createFollow.d.ts +0 -7
- package/dist/modules/users/deleteBlock.d.ts +0 -13
- package/dist/modules/users/deleteFollow.d.ts +0 -6
- package/dist/modules/users/fetchBlockStatus.d.ts +0 -23
- package/dist/modules/users/fetchBlockedUsers.d.ts +0 -19
- package/dist/modules/users/fetchConnectionStatus.d.ts +0 -10
- package/dist/modules/users/fetchConnectionsByUserId.d.ts +0 -11
- package/dist/modules/users/fetchConnectionsCountByUserId.d.ts +0 -6
- package/dist/modules/users/fetchFollowStatus.d.ts +0 -14
- package/dist/modules/users/fetchFollowersByUserId.d.ts +0 -11
- package/dist/modules/users/fetchFollowersCountByUserId.d.ts +0 -8
- package/dist/modules/users/fetchFollowingByUserId.d.ts +0 -11
- package/dist/modules/users/fetchFollowingCountByUserId.d.ts +0 -8
- package/dist/modules/users/fetchUserByForeignId.d.ts +0 -8
- package/dist/modules/users/fetchUserById.d.ts +0 -8
- package/dist/modules/users/fetchUserByUsername.d.ts +0 -8
- package/dist/modules/users/fetchUserSuggestions.d.ts +0 -7
- package/dist/modules/users/index.d.ts +0 -22
- package/dist/modules/users/removeConnectionByUserId.d.ts +0 -10
- package/dist/modules/users/requestConnection.d.ts +0 -11
- package/dist/modules/users/updateUser.d.ts +0 -32
- package/dist/modules/workspaces/acceptInvite.d.ts +0 -13
- package/dist/modules/workspaces/acceptWorkspaceInvite.d.ts +0 -13
- package/dist/modules/workspaces/createInvite.d.ts +0 -17
- package/dist/modules/workspaces/createWorkspace.d.ts +0 -12
- package/dist/modules/workspaces/createWorkspaceInvite.d.ts +0 -17
- package/dist/modules/workspaces/declineInvite.d.ts +0 -12
- package/dist/modules/workspaces/declineWorkspaceInvite.d.ts +0 -14
- package/dist/modules/workspaces/deleteWorkspace.d.ts +0 -13
- package/dist/modules/workspaces/fetchManyWorkspaces.d.ts +0 -13
- package/dist/modules/workspaces/fetchMembers.d.ts +0 -13
- package/dist/modules/workspaces/fetchMyInvites.d.ts +0 -11
- package/dist/modules/workspaces/fetchMyWorkspaceInvites.d.ts +0 -15
- package/dist/modules/workspaces/fetchWorkspace.d.ts +0 -7
- package/dist/modules/workspaces/fetchWorkspaceAuthority.d.ts +0 -11
- package/dist/modules/workspaces/fetchWorkspaceInvites.d.ts +0 -17
- package/dist/modules/workspaces/fetchWorkspaceMemberStanding.d.ts +0 -11
- package/dist/modules/workspaces/fetchWorkspaceMembers.d.ts +0 -13
- package/dist/modules/workspaces/getAuthority.d.ts +0 -11
- package/dist/modules/workspaces/index.d.ts +0 -21
- package/dist/modules/workspaces/leaveWorkspace.d.ts +0 -11
- package/dist/modules/workspaces/removeWorkspaceMember.d.ts +0 -12
- package/dist/modules/workspaces/removeWorkspaceMemberFromSubtree.d.ts +0 -16
- package/dist/modules/workspaces/resendWorkspaceInvite.d.ts +0 -12
- package/dist/modules/workspaces/revokeWorkspaceInvite.d.ts +0 -13
- package/dist/modules/workspaces/transferWorkspaceOwnership.d.ts +0 -15
- package/dist/modules/workspaces/updateWorkspace.d.ts +0 -12
- package/dist/modules/workspaces/updateWorkspaceInheritFlag.d.ts +0 -13
- package/dist/modules/workspaces/updateWorkspaceMember.d.ts +0 -17
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Reaction, ReactionType } from "../../interfaces/Reaction";
|
|
3
|
-
import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
|
|
5
|
-
export interface FetchEntityReactionsProps extends SpaceReputationContextParams {
|
|
6
|
-
entityId: string;
|
|
7
|
-
reactionType?: ReactionType;
|
|
8
|
-
page?: number;
|
|
9
|
-
limit?: number;
|
|
10
|
-
sortDir?: "asc" | "desc";
|
|
11
|
-
}
|
|
12
|
-
export interface FetchEntityReactionsResponse {
|
|
13
|
-
data: Reaction[];
|
|
14
|
-
pagination: PaginationMetadata;
|
|
15
|
-
}
|
|
16
|
-
export declare function fetchReactions(client: SublayHttpClient, data: FetchEntityReactionsProps): Promise<FetchEntityReactionsResponse>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { TopComment } from "../../interfaces/Entity";
|
|
3
|
-
export interface FetchTopCommentProps {
|
|
4
|
-
entityId: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function fetchTopComment(client: SublayHttpClient, data: FetchTopCommentProps): Promise<TopComment | null>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { ReactionType } from "../../interfaces/Reaction";
|
|
3
|
-
export interface GetUserEntityReactionProps {
|
|
4
|
-
entityId: string;
|
|
5
|
-
}
|
|
6
|
-
export interface UserReactionResponse {
|
|
7
|
-
reactionType: ReactionType | null;
|
|
8
|
-
}
|
|
9
|
-
export declare function getUserReaction(client: SublayHttpClient, data: GetUserEntityReactionProps): Promise<UserReactionResponse>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { createEntity } from "./createEntity";
|
|
2
|
-
export { fetchEntity } from "./fetchEntity";
|
|
3
|
-
export { fetchEntityByForeignId } from "./fetchEntityByForeignId";
|
|
4
|
-
export { fetchEntityByShortId } from "./fetchEntityByShortId";
|
|
5
|
-
export { fetchManyEntities } from "./fetchManyEntities";
|
|
6
|
-
export { updateEntity } from "./updateEntity";
|
|
7
|
-
export { deleteEntity } from "./deleteEntity";
|
|
8
|
-
export { fetchDrafts } from "./fetchDrafts";
|
|
9
|
-
export { publishDraft } from "./publishDraft";
|
|
10
|
-
export { fetchTopComment } from "./fetchTopComment";
|
|
11
|
-
export { addReaction } from "./addReaction";
|
|
12
|
-
export { removeReaction } from "./removeReaction";
|
|
13
|
-
export { fetchReactions } from "./fetchReactions";
|
|
14
|
-
export { getUserReaction } from "./getUserReaction";
|
|
15
|
-
export { isEntitySaved } from "./isEntitySaved";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
export interface IsEntitySavedProps {
|
|
3
|
-
entityId: string;
|
|
4
|
-
}
|
|
5
|
-
export interface IsEntitySavedResponse {
|
|
6
|
-
saved: boolean;
|
|
7
|
-
collections: {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
}[];
|
|
11
|
-
}
|
|
12
|
-
export declare function isEntitySaved(client: SublayHttpClient, data: IsEntitySavedProps): Promise<IsEntitySavedResponse>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Entity } from "../../interfaces/Entity";
|
|
3
|
-
export interface PublishDraftProps {
|
|
4
|
-
entityId: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function publishDraft(client: SublayHttpClient, data: PublishDraftProps): Promise<Entity>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Entity } from "../../interfaces/Entity";
|
|
3
|
-
export interface RemoveEntityReactionProps {
|
|
4
|
-
entityId: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function removeReaction(client: SublayHttpClient, data: RemoveEntityReactionProps): Promise<Entity>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Entity } from "../../interfaces/Entity";
|
|
3
|
-
import { Mention } from "../../interfaces/Mention";
|
|
4
|
-
export interface UpdateEntityProps {
|
|
5
|
-
entityId: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
content?: string;
|
|
8
|
-
attachments?: Record<string, any>[];
|
|
9
|
-
keywords?: string[];
|
|
10
|
-
mentions?: Mention[];
|
|
11
|
-
location?: {
|
|
12
|
-
latitude: number;
|
|
13
|
-
longitude: number;
|
|
14
|
-
};
|
|
15
|
-
metadata?: Record<string, any>;
|
|
16
|
-
nsfw?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function updateEntity(client: SublayHttpClient, data: UpdateEntityProps): Promise<Entity>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event } from "../../interfaces/Event";
|
|
3
|
-
export interface AddHostProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
/** The user to grant host on the event. */
|
|
6
|
-
userId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function addHost(client: SublayHttpClient, data: AddHostProps): Promise<Event>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event } from "../../interfaces/Event";
|
|
3
|
-
export interface AddInviteProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
/** The user to invite (userId only — never a foreignId). Idempotent. */
|
|
6
|
-
userId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function addInvite(client: SublayHttpClient, data: AddInviteProps): Promise<Event>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event, EventType, EventVisibility } from "../../interfaces/Event";
|
|
3
|
-
import { ImageOptions } from "../../interfaces/ImageProcessing";
|
|
4
|
-
/** A single cover image plus its processing options (stored as Event.coverImageId). */
|
|
5
|
-
export interface EventCoverUpload {
|
|
6
|
-
file: Blob | File;
|
|
7
|
-
/** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
|
|
8
|
-
options: ImageOptions;
|
|
9
|
-
}
|
|
10
|
-
/** A gallery image set plus shared processing options (Files with eventId + position). */
|
|
11
|
-
export interface EventGalleryUpload {
|
|
12
|
-
files: (Blob | File)[];
|
|
13
|
-
/** Image-processing config applied to every gallery image — see {@link ImageOptions}. */
|
|
14
|
-
options: ImageOptions;
|
|
15
|
-
}
|
|
16
|
-
export interface CreateEventProps {
|
|
17
|
-
title: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
startTime: string;
|
|
20
|
-
endTime?: string;
|
|
21
|
-
timezone?: string;
|
|
22
|
-
type: EventType;
|
|
23
|
-
url?: string;
|
|
24
|
-
venueName?: string;
|
|
25
|
-
address?: string;
|
|
26
|
-
location?: {
|
|
27
|
-
latitude: number;
|
|
28
|
-
longitude: number;
|
|
29
|
-
};
|
|
30
|
-
spaceId?: string;
|
|
31
|
-
visibility?: EventVisibility;
|
|
32
|
-
capacity?: number;
|
|
33
|
-
allowMaybe?: boolean;
|
|
34
|
-
guestListVisible?: boolean;
|
|
35
|
-
/** Additional host user IDs (the logged-in user is auto-added as a host). */
|
|
36
|
-
hostIds?: string[];
|
|
37
|
-
metadata?: Record<string, any>;
|
|
38
|
-
/**
|
|
39
|
-
* Inline cover image (single). When present the request is sent as
|
|
40
|
-
* `multipart/form-data`. Requires the `files-images` bundle.
|
|
41
|
-
*/
|
|
42
|
-
cover?: EventCoverUpload;
|
|
43
|
-
/**
|
|
44
|
-
* Inline gallery images (multi). When present the request is sent as
|
|
45
|
-
* `multipart/form-data`. Requires the `files-images` bundle.
|
|
46
|
-
*/
|
|
47
|
-
gallery?: EventGalleryUpload;
|
|
48
|
-
}
|
|
49
|
-
export declare function createEvent(client: SublayHttpClient, data: CreateEventProps): Promise<Event>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event } from "../../interfaces/Event";
|
|
3
|
-
export interface FetchEventProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
/** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
|
|
6
|
-
include?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function fetchEvent(client: SublayHttpClient, data: FetchEventProps): Promise<Event>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { EventRsvp } from "../../interfaces/Event";
|
|
3
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
export interface FetchEventRsvpsProps {
|
|
5
|
-
eventId: string;
|
|
6
|
-
page?: number;
|
|
7
|
-
limit?: number;
|
|
8
|
-
/**
|
|
9
|
-
* Comma-separated RSVP statuses to filter by, e.g. "going,maybe". When
|
|
10
|
-
* omitted, all statuses are returned.
|
|
11
|
-
*/
|
|
12
|
-
status?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Named RSVP (guest) list. Visible to hosts always, or to any viewer when the
|
|
16
|
-
* event's `guestListVisible` is true; otherwise 403. RSVP counts themselves are
|
|
17
|
-
* public via the event's `rsvpCounts`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function fetchEventRsvps(client: SublayHttpClient, data: FetchEventRsvpsProps): Promise<PaginatedResponse<EventRsvp>>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { EventInvite } from "../../interfaces/Event";
|
|
3
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
export interface FetchInviteesProps {
|
|
5
|
-
eventId: string;
|
|
6
|
-
page?: number;
|
|
7
|
-
limit?: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Host-only invitee (guest) list. Non-hosts get 403.
|
|
11
|
-
*/
|
|
12
|
-
export declare function fetchInvitees(client: SublayHttpClient, data: FetchInviteesProps): Promise<PaginatedResponse<EventInvite>>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event, EventType, EventStatus } from "../../interfaces/Event";
|
|
3
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
export interface EventTextFilters {
|
|
5
|
-
hasTitle?: "true" | "false";
|
|
6
|
-
includes?: string | string[];
|
|
7
|
-
doesNotInclude?: string | string[];
|
|
8
|
-
}
|
|
9
|
-
export interface EventDescriptionFilters {
|
|
10
|
-
hasDescription?: "true" | "false";
|
|
11
|
-
includes?: string | string[];
|
|
12
|
-
doesNotInclude?: string | string[];
|
|
13
|
-
}
|
|
14
|
-
export interface EventLocationFilters {
|
|
15
|
-
latitude: string;
|
|
16
|
-
longitude: string;
|
|
17
|
-
radius: string;
|
|
18
|
-
}
|
|
19
|
-
export interface FetchManyEventsProps {
|
|
20
|
-
page?: number;
|
|
21
|
-
limit?: number;
|
|
22
|
-
sortBy?: "startTime" | "going";
|
|
23
|
-
sortDir?: "asc" | "desc";
|
|
24
|
-
timeWindow?: "upcoming" | "ongoing" | "past";
|
|
25
|
-
startsAfter?: string;
|
|
26
|
-
startsBefore?: string;
|
|
27
|
-
spaceId?: string;
|
|
28
|
-
hostId?: string;
|
|
29
|
-
type?: EventType;
|
|
30
|
-
status?: EventStatus;
|
|
31
|
-
/**
|
|
32
|
-
* Comma-separated RSVP statuses the logged-in user RSVP'd with, e.g.
|
|
33
|
-
* "going,maybe". Filters to events the caller has that RSVP on.
|
|
34
|
-
*/
|
|
35
|
-
myRsvp?: string;
|
|
36
|
-
locationFilters?: EventLocationFilters;
|
|
37
|
-
titleFilters?: EventTextFilters;
|
|
38
|
-
descriptionFilters?: EventDescriptionFilters;
|
|
39
|
-
/** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
|
|
40
|
-
include?: string;
|
|
41
|
-
}
|
|
42
|
-
export declare function fetchManyEvents(client: SublayHttpClient, data?: FetchManyEventsProps): Promise<PaginatedResponse<Event>>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { createEvent } from "./createEvent";
|
|
2
|
-
export { fetchEvent } from "./fetchEvent";
|
|
3
|
-
export { fetchManyEvents } from "./fetchManyEvents";
|
|
4
|
-
export { updateEvent } from "./updateEvent";
|
|
5
|
-
export { cancelEvent } from "./cancelEvent";
|
|
6
|
-
export { deleteEvent } from "./deleteEvent";
|
|
7
|
-
export { setRsvp } from "./setRsvp";
|
|
8
|
-
export { withdrawRsvp } from "./withdrawRsvp";
|
|
9
|
-
export { addHost } from "./addHost";
|
|
10
|
-
export { removeHost } from "./removeHost";
|
|
11
|
-
export { addInvite } from "./addInvite";
|
|
12
|
-
export { removeInvite } from "./removeInvite";
|
|
13
|
-
export { fetchInvitees } from "./fetchInvitees";
|
|
14
|
-
export { fetchEventRsvps } from "./fetchEventRsvps";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event } from "../../interfaces/Event";
|
|
3
|
-
export interface RemoveHostProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
/** The host to remove. Rejected if it would leave the event with no hosts. */
|
|
6
|
-
userId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function removeHost(client: SublayHttpClient, data: RemoveHostProps): Promise<Event>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event } from "../../interfaces/Event";
|
|
3
|
-
export interface RemoveInviteProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
/** The invitee to remove. Also drops their RSVP and revokes access. */
|
|
6
|
-
userId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function removeInvite(client: SublayHttpClient, data: RemoveInviteProps): Promise<Event>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event, RsvpStatus } from "../../interfaces/Event";
|
|
3
|
-
export interface SetRsvpProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
status: RsvpStatus;
|
|
6
|
-
}
|
|
7
|
-
export declare function setRsvp(client: SublayHttpClient, data: SetRsvpProps): Promise<Event>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event, EventType, EventVisibility } from "../../interfaces/Event";
|
|
3
|
-
import type { EventCoverUpload, EventGalleryUpload } from "./createEvent";
|
|
4
|
-
export interface UpdateEventProps {
|
|
5
|
-
eventId: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
startTime?: string;
|
|
9
|
-
endTime?: string;
|
|
10
|
-
timezone?: string;
|
|
11
|
-
type?: EventType;
|
|
12
|
-
url?: string;
|
|
13
|
-
venueName?: string;
|
|
14
|
-
address?: string;
|
|
15
|
-
location?: {
|
|
16
|
-
latitude: number;
|
|
17
|
-
longitude: number;
|
|
18
|
-
};
|
|
19
|
-
visibility?: EventVisibility;
|
|
20
|
-
capacity?: number;
|
|
21
|
-
allowMaybe?: boolean;
|
|
22
|
-
guestListVisible?: boolean;
|
|
23
|
-
metadata?: Record<string, any>;
|
|
24
|
-
/**
|
|
25
|
-
* File IDs of existing event images to REMOVE (gallery photos and/or the
|
|
26
|
-
* current cover). Combine with `gallery` (append) + `cover` (replace) to fully
|
|
27
|
-
* curate the image set in one update. Sent in the JSON body, or — when an
|
|
28
|
-
* image file is also attached — as a JSON-string field the server parses.
|
|
29
|
-
*/
|
|
30
|
-
removeImageIds?: string[];
|
|
31
|
-
/**
|
|
32
|
-
* New cover image (single) — REPLACES the existing cover. When present the
|
|
33
|
-
* request is sent as `multipart/form-data`. Requires the `files-images` bundle.
|
|
34
|
-
*/
|
|
35
|
-
cover?: EventCoverUpload;
|
|
36
|
-
/**
|
|
37
|
-
* Gallery images (multi) — APPENDED to the event's existing images. When
|
|
38
|
-
* present the request is sent as `multipart/form-data`. Requires the
|
|
39
|
-
* `files-images` bundle.
|
|
40
|
-
*/
|
|
41
|
-
gallery?: EventGalleryUpload;
|
|
42
|
-
}
|
|
43
|
-
export declare function updateEvent(client: SublayHttpClient, data: UpdateEventProps): Promise<Event>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Event } from "../../interfaces/Event";
|
|
3
|
-
export interface WithdrawRsvpProps {
|
|
4
|
-
eventId: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function withdrawRsvp(client: SublayHttpClient, data: WithdrawRsvpProps): Promise<Event>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { FollowListItem } from "../../interfaces/Follow";
|
|
3
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
import { UserSearchParams } from "../../interfaces/UserSearch";
|
|
5
|
-
export interface FetchFollowersProps extends UserSearchParams {
|
|
6
|
-
page?: number;
|
|
7
|
-
limit?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function fetchFollowers(client: SublayHttpClient, data: FetchFollowersProps): Promise<PaginatedResponse<FollowListItem>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { FollowListItem } from "../../interfaces/Follow";
|
|
3
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
import { UserSearchParams } from "../../interfaces/UserSearch";
|
|
5
|
-
export interface FetchFollowingProps extends UserSearchParams {
|
|
6
|
-
page?: number;
|
|
7
|
-
limit?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function fetchFollowing(client: SublayHttpClient, data: FetchFollowingProps): Promise<PaginatedResponse<FollowListItem>>;
|
|
@@ -1,5 +0,0 @@
|
|
|
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";
|
|
@@ -1,25 +0,0 @@
|
|
|
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>;
|
|
@@ -1,14 +0,0 @@
|
|
|
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>;
|
|
@@ -1,4 +0,0 @@
|
|
|
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>;
|
|
@@ -1,12 +0,0 @@
|
|
|
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>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { NotificationPreferences } from "../../interfaces/Push";
|
|
3
|
-
/**
|
|
4
|
-
* Read the logged-in user's push notification preferences (the set of event
|
|
5
|
-
* types disabled for push). Returns an empty `disabledTypes` (all-on) when no
|
|
6
|
-
* preference row exists.
|
|
7
|
-
*
|
|
8
|
-
* Mirrors `GET /:projectId/push-notifications/preferences`. The actor is derived
|
|
9
|
-
* from the user token (Rule A) — no `userId` param.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getNotificationPreferences(client: SublayHttpClient): Promise<NotificationPreferences>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { NotificationPreferences, PushEventType } from "../../interfaces/Push";
|
|
3
|
-
export interface UpdateNotificationPreferencesProps {
|
|
4
|
-
/**
|
|
5
|
-
* The set of push event types the user has opted OUT of. Server-exact type
|
|
6
|
-
* names only (unknown names are rejected server-side); duplicates collapse.
|
|
7
|
-
*/
|
|
8
|
-
disabledTypes: PushEventType[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Upsert the logged-in user's push notification preferences.
|
|
12
|
-
*
|
|
13
|
-
* Mirrors `PUT /:projectId/push-notifications/preferences`. The actor is derived
|
|
14
|
-
* from the user token (Rule A) — no `userId` param.
|
|
15
|
-
*/
|
|
16
|
-
export declare function updateNotificationPreferences(client: SublayHttpClient, data: UpdateNotificationPreferencesProps): Promise<NotificationPreferences>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { CreateReportResponse, ReportReason, ReportTargetType } from "../../interfaces/Report";
|
|
3
|
-
export interface CreateReportProps {
|
|
4
|
-
targetType: ReportTargetType;
|
|
5
|
-
targetId: string;
|
|
6
|
-
reason: ReportReason;
|
|
7
|
-
details?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function createReport(client: SublayHttpClient, data: CreateReportProps): Promise<CreateReportResponse>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { Report, ReportStatus, ReportTargetType } from "../../interfaces/Report";
|
|
3
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
-
import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
|
|
5
|
-
export interface FetchModeratedReportsProps extends SpaceReputationContextParams {
|
|
6
|
-
spaceId?: string;
|
|
7
|
-
targetType?: ReportTargetType;
|
|
8
|
-
status?: ReportStatus;
|
|
9
|
-
sortBy?: "new" | "old";
|
|
10
|
-
page?: number;
|
|
11
|
-
limit?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare function fetchModeratedReports(client: SublayHttpClient, data: FetchModeratedReportsProps): Promise<PaginatedResponse<Report>>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { ContentSearchResult } from "./searchContent";
|
|
3
|
-
import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
|
|
4
|
-
export interface AskContentProps extends SpaceReputationContextParams {
|
|
5
|
-
query: string;
|
|
6
|
-
sourceTypes?: ("entity" | "comment" | "message")[];
|
|
7
|
-
spaceId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* With a `spaceId`, also search every space nested under it (children,
|
|
10
|
-
* grandchildren — the whole subtree, any depth). Ignored without a `spaceId`.
|
|
11
|
-
* Defaults to false (exact-space search).
|
|
12
|
-
*/
|
|
13
|
-
includeChildSpaces?: boolean;
|
|
14
|
-
conversationId?: string;
|
|
15
|
-
limit?: number;
|
|
16
|
-
/** Abort the in-flight stream (e.g. when the user navigates away). */
|
|
17
|
-
signal?: AbortSignal;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A single Server-Sent Event from the `askContent` stream.
|
|
21
|
-
* - `token` — an incremental chunk of the answer text.
|
|
22
|
-
* - `sources` — the hydrated source records, emitted once after the answer.
|
|
23
|
-
* - `done` — the stream finished successfully.
|
|
24
|
-
* - `error` — the server reported an error (the stream ends after this).
|
|
25
|
-
*/
|
|
26
|
-
export type AskContentEvent = {
|
|
27
|
-
type: "token";
|
|
28
|
-
content: string;
|
|
29
|
-
} | {
|
|
30
|
-
type: "sources";
|
|
31
|
-
sources: ContentSearchResult[];
|
|
32
|
-
} | {
|
|
33
|
-
type: "done";
|
|
34
|
-
} | {
|
|
35
|
-
type: "error";
|
|
36
|
-
error: string;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Ask a question over your project's content (semantic RAG). The server answers
|
|
40
|
-
* by streaming Server-Sent Events, so this is an **async generator**: iterate it
|
|
41
|
-
* to consume the answer as it arrives.
|
|
42
|
-
*
|
|
43
|
-
* ```ts
|
|
44
|
-
* let answer = "";
|
|
45
|
-
* for await (const ev of client.search.askContent({ query: "How do refunds work?" })) {
|
|
46
|
-
* if (ev.type === "token") answer += ev.content;
|
|
47
|
-
* else if (ev.type === "sources") console.log("sources:", ev.sources);
|
|
48
|
-
* else if (ev.type === "error") throw new Error(ev.error);
|
|
49
|
-
* }
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* Cancel by passing an `AbortSignal`, or by `break`ing out of the loop.
|
|
53
|
-
*
|
|
54
|
-
* Note: this request uses `fetch` (not the axios instance), so it does not get
|
|
55
|
-
* the automatic 403→refresh retry. The token is read fresh at call time via the
|
|
56
|
-
* client's active auth mode.
|
|
57
|
-
*/
|
|
58
|
-
export declare function askContent(client: SublayHttpClient, data: AskContentProps): AsyncGenerator<AskContentEvent, void, unknown>;
|