@sublay/js 5.0.0 → 7.0.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/README.md +33 -4
- package/dist/core/client.d.ts +58 -2
- package/dist/core/multipart.d.ts +22 -0
- package/dist/index.d.mts +2508 -42
- package/dist/index.d.ts +29 -2
- package/dist/index.js +1746 -37
- package/dist/index.mjs +1746 -37
- package/dist/interfaces/AppNotification.d.ts +258 -0
- package/dist/interfaces/ChatMessage.d.ts +32 -0
- package/dist/interfaces/Collection.d.ts +10 -0
- package/dist/interfaces/Comment.d.ts +42 -0
- package/dist/interfaces/Connection.d.ts +67 -0
- package/dist/interfaces/Conversation.d.ts +25 -0
- package/dist/interfaces/ConversationMember.d.ts +16 -0
- package/dist/interfaces/Entity.d.ts +53 -0
- package/dist/interfaces/File.d.ts +39 -0
- package/dist/interfaces/Follow.d.ts +19 -0
- package/dist/interfaces/HostedApp.d.ts +11 -0
- package/dist/interfaces/ImageProcessing.d.ts +62 -0
- package/dist/interfaces/Mention.d.ts +12 -0
- package/dist/interfaces/OAuthIdentity.d.ts +13 -0
- package/dist/interfaces/Project.d.ts +14 -0
- package/dist/interfaces/Reaction.d.ts +23 -0
- package/dist/interfaces/Report.d.ts +32 -0
- package/dist/interfaces/Rule.d.ts +22 -0
- package/dist/interfaces/Space.d.ts +141 -0
- package/dist/interfaces/SpaceMember.d.ts +29 -0
- package/dist/interfaces/User.d.ts +39 -0
- package/dist/modules/app-notifications/countUnreadNotifications.d.ts +2 -0
- package/dist/modules/app-notifications/fetchNotifications.d.ts +8 -0
- package/dist/modules/app-notifications/index.d.ts +4 -0
- package/dist/modules/app-notifications/markAllNotificationsAsRead.d.ts +5 -0
- package/dist/modules/app-notifications/markNotificationAsRead.d.ts +5 -0
- package/dist/modules/auth/changePassword.d.ts +11 -0
- package/dist/modules/auth/index.d.ts +10 -0
- package/dist/modules/auth/requestNewAccessToken.d.ts +16 -0
- package/dist/modules/auth/requestPasswordReset.d.ts +5 -0
- package/dist/modules/auth/resetPassword.d.ts +6 -0
- package/dist/modules/auth/sendVerificationEmail.d.ts +13 -0
- package/dist/modules/auth/signIn.d.ts +12 -0
- package/dist/modules/auth/signOut.d.ts +9 -0
- package/dist/modules/auth/signUp.d.ts +24 -0
- package/dist/modules/auth/verifyEmail.d.ts +5 -0
- package/dist/modules/auth/verifyExternalUser.d.ts +11 -0
- package/dist/modules/chat/addMember.d.ts +8 -0
- package/dist/modules/chat/changeMemberRole.d.ts +9 -0
- package/dist/modules/chat/createDirectConversation.d.ts +7 -0
- package/dist/modules/chat/createGroupConversation.d.ts +10 -0
- package/dist/modules/chat/deleteConversation.d.ts +8 -0
- package/dist/modules/chat/deleteMessage.d.ts +11 -0
- package/dist/modules/chat/editMessage.d.ts +13 -0
- package/dist/modules/chat/getConversation.d.ts +6 -0
- package/dist/modules/chat/getMessage.d.ts +7 -0
- package/dist/modules/chat/getUnreadCount.d.ts +6 -0
- package/dist/modules/chat/index.d.ts +21 -0
- package/dist/modules/chat/leaveConversation.d.ts +7 -0
- package/dist/modules/chat/listConversations.d.ts +17 -0
- package/dist/modules/chat/listMembers.d.ts +10 -0
- package/dist/modules/chat/listMessages.d.ts +23 -0
- package/dist/modules/chat/listReactions.d.ts +23 -0
- package/dist/modules/chat/markAsRead.d.ts +9 -0
- package/dist/modules/chat/removeMember.d.ts +9 -0
- package/dist/modules/chat/reportMessage.d.ts +12 -0
- package/dist/modules/chat/sendMessage.d.ts +21 -0
- package/dist/modules/chat/toggleReaction.d.ts +16 -0
- package/dist/modules/chat/updateConversation.d.ts +12 -0
- package/dist/modules/collections/addEntityToCollection.d.ts +13 -0
- package/dist/modules/collections/createNewCollection.d.ts +8 -0
- package/dist/modules/collections/deleteCollection.d.ts +5 -0
- package/dist/modules/collections/fetchCollectionEntities.d.ts +13 -0
- package/dist/modules/collections/fetchRootCollection.d.ts +3 -0
- package/dist/modules/collections/fetchSubCollections.d.ts +6 -0
- package/dist/modules/collections/index.d.ts +8 -0
- package/dist/modules/collections/removeEntityFromCollection.d.ts +7 -0
- package/dist/modules/collections/updateCollection.d.ts +7 -0
- package/dist/modules/comments/addReaction.d.ts +8 -0
- package/dist/modules/comments/createComment.d.ts +15 -0
- package/dist/modules/comments/deleteComment.d.ts +5 -0
- package/dist/modules/comments/fetchComment.d.ts +3 -1
- package/dist/modules/comments/fetchCommentByForeignId.d.ts +3 -1
- package/dist/modules/comments/fetchManyComments.d.ts +14 -0
- package/dist/modules/comments/fetchReactions.d.ts +15 -0
- package/dist/modules/comments/getUserReaction.d.ts +9 -0
- package/dist/modules/comments/index.d.ts +10 -3
- package/dist/modules/comments/removeReaction.d.ts +6 -0
- package/dist/modules/comments/updateComment.d.ts +7 -0
- package/dist/modules/connections/acceptConnection.d.ts +6 -0
- package/dist/modules/connections/declineConnection.d.ts +6 -0
- package/dist/modules/connections/fetchConnections.d.ts +8 -0
- package/dist/modules/connections/fetchConnectionsCount.d.ts +3 -0
- package/dist/modules/connections/fetchReceivedPendingConnections.d.ts +8 -0
- package/dist/modules/connections/fetchSentPendingConnections.d.ts +8 -0
- package/dist/modules/connections/index.d.ts +7 -0
- package/dist/modules/connections/removeConnection.d.ts +5 -0
- package/dist/modules/entities/addReaction.d.ts +8 -0
- package/dist/modules/entities/createEntity.d.ts +7 -2
- package/dist/modules/entities/deleteEntity.d.ts +1 -1
- package/dist/modules/entities/fetchDrafts.d.ts +11 -0
- package/dist/modules/entities/fetchEntity.d.ts +3 -1
- package/dist/modules/entities/fetchEntityByForeignId.d.ts +3 -1
- package/dist/modules/entities/fetchEntityByShortId.d.ts +3 -1
- package/dist/modules/entities/fetchManyEntities.d.ts +11 -3
- package/dist/modules/entities/fetchReactions.d.ts +15 -0
- package/dist/modules/entities/fetchTopComment.d.ts +6 -0
- package/dist/modules/entities/getUserReaction.d.ts +9 -0
- package/dist/modules/entities/index.d.ts +15 -8
- package/dist/modules/entities/isEntitySaved.d.ts +12 -0
- package/dist/modules/entities/publishDraft.d.ts +6 -0
- package/dist/modules/entities/removeReaction.d.ts +6 -0
- package/dist/modules/entities/updateEntity.d.ts +6 -7
- package/dist/modules/follows/deleteFollow.d.ts +5 -0
- package/dist/modules/follows/fetchFollowers.d.ts +8 -0
- package/dist/modules/follows/fetchFollowersCount.d.ts +5 -0
- package/dist/modules/follows/fetchFollowing.d.ts +8 -0
- package/dist/modules/follows/fetchFollowingCount.d.ts +5 -0
- package/dist/modules/follows/index.d.ts +5 -0
- package/dist/modules/oauth/authorize.d.ts +25 -0
- package/dist/modules/oauth/index.d.ts +4 -0
- package/dist/modules/oauth/linkIdentity.d.ts +14 -0
- package/dist/modules/oauth/listIdentities.d.ts +4 -0
- package/dist/modules/oauth/unlinkIdentity.d.ts +12 -0
- package/dist/modules/reports/createReport.d.ts +9 -0
- package/dist/modules/reports/fetchModeratedReports.d.ts +12 -0
- package/dist/modules/reports/index.d.ts +2 -0
- package/dist/modules/search/askContent.d.ts +51 -0
- package/dist/modules/search/index.d.ts +4 -0
- package/dist/modules/search/searchContent.d.ts +17 -0
- package/dist/modules/search/searchSpaces.d.ts +11 -0
- package/dist/modules/search/searchUsers.d.ts +11 -0
- package/dist/modules/spaces/approveMembership.d.ts +7 -0
- package/dist/modules/spaces/banMember.d.ts +13 -0
- package/dist/modules/spaces/checkMyMembership.d.ts +6 -0
- package/dist/modules/spaces/checkSlugAvailability.d.ts +8 -0
- package/dist/modules/spaces/createRule.d.ts +8 -0
- package/dist/modules/spaces/createSpace.d.ts +13 -0
- package/dist/modules/spaces/declineMembership.d.ts +7 -0
- package/dist/modules/spaces/deleteRule.d.ts +7 -0
- package/dist/modules/spaces/deleteSpace.d.ts +6 -0
- package/dist/modules/spaces/fetchChildSpaces.d.ts +11 -0
- package/dist/modules/spaces/fetchDigestConfig.d.ts +6 -0
- package/dist/modules/spaces/fetchManyRules.d.ts +6 -0
- package/dist/modules/spaces/fetchManySpaces.d.ts +16 -0
- package/dist/modules/spaces/fetchRule.d.ts +7 -0
- package/dist/modules/spaces/fetchSpace.d.ts +6 -0
- package/dist/modules/spaces/fetchSpaceBreadcrumb.d.ts +6 -0
- package/dist/modules/spaces/fetchSpaceByShortId.d.ts +6 -0
- package/dist/modules/spaces/fetchSpaceBySlug.d.ts +6 -0
- package/dist/modules/spaces/fetchSpaceMembers.d.ts +10 -0
- package/dist/modules/spaces/fetchSpaceTeam.d.ts +6 -0
- package/dist/modules/spaces/fetchUserSpaces.d.ts +11 -0
- package/dist/modules/spaces/getSpaceConversation.d.ts +6 -0
- package/dist/modules/spaces/handleCommentReport.d.ts +14 -0
- package/dist/modules/spaces/handleEntityReport.d.ts +17 -0
- package/dist/modules/spaces/handleSpaceChatReport.d.ts +18 -0
- package/dist/modules/spaces/index.d.ts +36 -0
- package/dist/modules/spaces/joinSpace.d.ts +6 -0
- package/dist/modules/spaces/leaveSpace.d.ts +6 -0
- package/dist/modules/spaces/moderateSpaceChatMessage.d.ts +12 -0
- package/dist/modules/spaces/moderateSpaceComment.d.ts +9 -0
- package/dist/modules/spaces/moderateSpaceEntity.d.ts +12 -0
- package/dist/modules/spaces/reorderRules.d.ts +7 -0
- package/dist/modules/spaces/unbanMember.d.ts +13 -0
- package/dist/modules/spaces/updateDigestConfig.d.ts +11 -0
- package/dist/modules/spaces/updateMemberRole.d.ts +8 -0
- package/dist/modules/spaces/updateRule.d.ts +9 -0
- package/dist/modules/spaces/updateSpace.d.ts +12 -0
- package/dist/modules/storage/deleteFile.d.ts +5 -0
- package/dist/modules/storage/getFile.d.ts +34 -0
- package/dist/modules/storage/index.d.ts +4 -0
- package/dist/modules/storage/uploadFile.d.ts +30 -0
- package/dist/modules/storage/uploadImage.d.ts +41 -0
- package/dist/modules/users/checkUsernameAvailability.d.ts +8 -0
- package/dist/modules/users/createFollow.d.ts +7 -0
- package/dist/modules/users/deleteFollow.d.ts +6 -0
- package/dist/modules/users/fetchConnectionStatus.d.ts +10 -0
- package/dist/modules/users/fetchConnectionsByUserId.d.ts +9 -0
- package/dist/modules/users/fetchConnectionsCountByUserId.d.ts +6 -0
- package/dist/modules/users/fetchFollowStatus.d.ts +14 -0
- package/dist/modules/users/fetchFollowersByUserId.d.ts +9 -0
- package/dist/modules/users/fetchFollowersCountByUserId.d.ts +8 -0
- package/dist/modules/users/fetchFollowingByUserId.d.ts +9 -0
- package/dist/modules/users/fetchFollowingCountByUserId.d.ts +8 -0
- package/dist/modules/users/fetchUserByForeignId.d.ts +3 -7
- package/dist/modules/users/fetchUserById.d.ts +3 -1
- package/dist/modules/users/fetchUserByUsername.d.ts +7 -0
- package/dist/modules/users/fetchUserSuggestions.d.ts +6 -0
- package/dist/modules/users/index.d.ts +18 -3
- package/dist/modules/users/removeConnectionByUserId.d.ts +10 -0
- package/dist/modules/users/requestConnection.d.ts +11 -0
- package/dist/modules/users/updateUser.d.ts +32 -0
- package/package.json +10 -7
- package/CLAUDE.md +0 -339
- package/pnpm-workspace.yaml +0 -2
- package/src/core/client.ts +0 -15
- package/src/index.ts +0 -45
- package/src/interfaces/IPaginatedResponse.ts +0 -12
- package/src/modules/comments/fetchComment.ts +0 -14
- package/src/modules/comments/fetchCommentByForeignId.ts +0 -14
- package/src/modules/comments/index.ts +0 -4
- package/src/modules/entities/createEntity.ts +0 -27
- package/src/modules/entities/deleteEntity.ts +0 -14
- package/src/modules/entities/fetchEntity.ts +0 -14
- package/src/modules/entities/fetchEntityByForeignId.ts +0 -15
- package/src/modules/entities/fetchEntityByShortId.ts +0 -14
- package/src/modules/entities/fetchManyEntities.ts +0 -79
- package/src/modules/entities/index.ts +0 -17
- package/src/modules/entities/updateEntity.ts +0 -28
- package/src/modules/users/fetchUserByForeignId.ts +0 -40
- package/src/modules/users/fetchUserById.ts +0 -15
- package/src/modules/users/index.ts +0 -4
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { User } from "../../interfaces/User";
|
|
3
|
+
import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface ListReactionsProps {
|
|
5
|
+
conversationId: string;
|
|
6
|
+
messageId: string;
|
|
7
|
+
/** The reaction emoji to list reactors for (required). */
|
|
8
|
+
emoji: string;
|
|
9
|
+
/** Page number (default 1). */
|
|
10
|
+
page?: number;
|
|
11
|
+
/** Page size (default 50, max 100). */
|
|
12
|
+
limit?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface MessageReaction {
|
|
15
|
+
user: User;
|
|
16
|
+
emoji: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
}
|
|
19
|
+
export interface ListReactionsResponse {
|
|
20
|
+
data: MessageReaction[];
|
|
21
|
+
pagination: PaginationMetadata;
|
|
22
|
+
}
|
|
23
|
+
export declare function listReactions(client: SublayHttpClient, data: ListReactionsProps): Promise<ListReactionsResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface MarkAsReadProps {
|
|
3
|
+
conversationId: string;
|
|
4
|
+
/** The message up to which the conversation is marked read (uuid, required). */
|
|
5
|
+
messageId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function markAsRead(client: SublayHttpClient, data: MarkAsReadProps): Promise<{
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface RemoveMemberProps {
|
|
3
|
+
conversationId: string;
|
|
4
|
+
/** The member to remove (the target). */
|
|
5
|
+
userId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function removeMember(client: SublayHttpClient, data: RemoveMemberProps): Promise<{
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface ReportMessageProps {
|
|
3
|
+
conversationId: string;
|
|
4
|
+
messageId: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
details?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ReportMessageResponse {
|
|
9
|
+
message: string;
|
|
10
|
+
code: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function reportMessage(client: SublayHttpClient, data: ReportMessageProps): Promise<ReportMessageResponse>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 SendMessageProps {
|
|
6
|
+
conversationId: string;
|
|
7
|
+
content?: string;
|
|
8
|
+
gif?: GifData | null;
|
|
9
|
+
mentions?: Mention[];
|
|
10
|
+
parentMessageId?: string;
|
|
11
|
+
quotedMessageId?: string;
|
|
12
|
+
metadata?: Record<string, any>;
|
|
13
|
+
/** Client-generated id echoed back on the created message (not stored). */
|
|
14
|
+
localId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional file attachments (browser `File`/`Blob`), up to 10. When present
|
|
17
|
+
* the request is sent as `multipart/form-data`; otherwise it's a JSON body.
|
|
18
|
+
*/
|
|
19
|
+
files?: (Blob | File)[];
|
|
20
|
+
}
|
|
21
|
+
export declare function sendMessage(client: SublayHttpClient, data: SendMessageProps): Promise<ChatMessage>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface ToggleReactionProps {
|
|
3
|
+
conversationId: string;
|
|
4
|
+
messageId: string;
|
|
5
|
+
/** The reaction emoji (required, 1–10 chars). */
|
|
6
|
+
emoji: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ToggleReactionResponse {
|
|
9
|
+
/** Updated emoji → count map for the message. */
|
|
10
|
+
reactionCounts: Record<string, number>;
|
|
11
|
+
/** Emojis the acting user has reacted with after the toggle. */
|
|
12
|
+
userReactions: string[];
|
|
13
|
+
/** +1 if the reaction was added, -1 if it was removed. */
|
|
14
|
+
delta: 1 | -1;
|
|
15
|
+
}
|
|
16
|
+
export declare function toggleReaction(client: SublayHttpClient, data: ToggleReactionProps): Promise<ToggleReactionResponse>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Conversation } from "../../interfaces/Conversation";
|
|
3
|
+
export interface UpdateConversationProps {
|
|
4
|
+
conversationId: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/** File id for the conversation avatar, or null to clear it. */
|
|
8
|
+
avatarFileId?: string | null;
|
|
9
|
+
/** Space conversations only: who may post. */
|
|
10
|
+
postingPermission?: "members" | "admins";
|
|
11
|
+
}
|
|
12
|
+
export declare function updateConversation(client: SublayHttpClient, data: UpdateConversationProps): Promise<Conversation>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface AddEntityToCollectionProps {
|
|
3
|
+
collectionId: string;
|
|
4
|
+
entityId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CollectionEntityMutationResponse {
|
|
7
|
+
success: boolean;
|
|
8
|
+
collection: {
|
|
9
|
+
id: string;
|
|
10
|
+
entityCount: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function addEntityToCollection(client: SublayHttpClient, data: AddEntityToCollectionProps): Promise<CollectionEntityMutationResponse>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Collection } from "../../interfaces/Collection";
|
|
3
|
+
export interface CreateNewCollectionProps {
|
|
4
|
+
/** The parent collection under which to create the sub-collection. */
|
|
5
|
+
collectionId: string;
|
|
6
|
+
collectionName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createNewCollection(client: SublayHttpClient, data: CreateNewCollectionProps): Promise<Collection>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchCollectionEntitiesProps {
|
|
5
|
+
collectionId: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
sortBy?: "new" | "added" | "top" | "hot";
|
|
9
|
+
sortDir?: "asc" | "desc";
|
|
10
|
+
/** Comma-separated list of associations to populate, e.g. "user". */
|
|
11
|
+
include?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function fetchCollectionEntities(client: SublayHttpClient, data: FetchCollectionEntitiesProps): Promise<PaginatedResponse<Entity>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Collection } from "../../interfaces/Collection";
|
|
3
|
+
export interface FetchSubCollectionsProps {
|
|
4
|
+
collectionId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function fetchSubCollections(client: SublayHttpClient, data: FetchSubCollectionsProps): Promise<Collection[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { fetchRootCollection } from "./fetchRootCollection";
|
|
2
|
+
export { fetchSubCollections } from "./fetchSubCollections";
|
|
3
|
+
export { createNewCollection } from "./createNewCollection";
|
|
4
|
+
export { fetchCollectionEntities } from "./fetchCollectionEntities";
|
|
5
|
+
export { addEntityToCollection } from "./addEntityToCollection";
|
|
6
|
+
export { removeEntityFromCollection } from "./removeEntityFromCollection";
|
|
7
|
+
export { updateCollection } from "./updateCollection";
|
|
8
|
+
export { deleteCollection } from "./deleteCollection";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { CollectionEntityMutationResponse } from "./addEntityToCollection";
|
|
3
|
+
export interface RemoveEntityFromCollectionProps {
|
|
4
|
+
collectionId: string;
|
|
5
|
+
entityId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function removeEntityFromCollection(client: SublayHttpClient, data: RemoveEntityFromCollectionProps): Promise<CollectionEntityMutationResponse>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Collection } from "../../interfaces/Collection";
|
|
3
|
+
export interface UpdateCollectionProps {
|
|
4
|
+
collectionId: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function updateCollection(client: SublayHttpClient, data: UpdateCollectionProps): Promise<Collection>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ReactionType } from "../../interfaces/Reaction";
|
|
3
|
+
import { Comment } from "../../interfaces/Comment";
|
|
4
|
+
export interface AddCommentReactionProps {
|
|
5
|
+
commentId: string;
|
|
6
|
+
reactionType: ReactionType;
|
|
7
|
+
}
|
|
8
|
+
export declare function addReaction(client: SublayHttpClient, data: AddCommentReactionProps): Promise<Comment>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Comment, GifData } from "../../interfaces/Comment";
|
|
3
|
+
import { Mention } from "../../interfaces/Mention";
|
|
4
|
+
export interface CreateCommentProps {
|
|
5
|
+
entityId: string;
|
|
6
|
+
foreignId?: string;
|
|
7
|
+
content?: string;
|
|
8
|
+
gif?: GifData | null;
|
|
9
|
+
mentions?: Mention[];
|
|
10
|
+
parentId?: string | null;
|
|
11
|
+
referencedCommentId?: string;
|
|
12
|
+
attachments?: Record<string, any>[];
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createComment(client: SublayHttpClient, data: CreateCommentProps): Promise<Comment>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Comment } from "../../interfaces/Comment";
|
|
2
3
|
export interface FetchCommentProps {
|
|
3
4
|
commentId: string;
|
|
5
|
+
include?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function fetchComment(client: SublayHttpClient, data: FetchCommentProps): Promise<
|
|
7
|
+
export declare function fetchComment(client: SublayHttpClient, data: FetchCommentProps): Promise<Comment>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Comment } from "../../interfaces/Comment";
|
|
2
3
|
export interface FetchCommentByForeignIdProps {
|
|
3
4
|
foreignId: string;
|
|
5
|
+
include?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function fetchCommentByForeignId(client: SublayHttpClient, data: FetchCommentByForeignIdProps): Promise<
|
|
7
|
+
export declare function fetchCommentByForeignId(client: SublayHttpClient, data: FetchCommentByForeignIdProps): Promise<Comment>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Comment } from "../../interfaces/Comment";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchManyCommentsProps {
|
|
5
|
+
entityId?: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
parentId?: string;
|
|
8
|
+
page?: number;
|
|
9
|
+
limit?: number;
|
|
10
|
+
sortBy?: "new" | "old" | "top" | "controversial";
|
|
11
|
+
include?: string;
|
|
12
|
+
sourceId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function fetchManyComments(client: SublayHttpClient, data: FetchManyCommentsProps): Promise<PaginatedResponse<Comment>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Reaction, ReactionType } from "../../interfaces/Reaction";
|
|
3
|
+
import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchCommentReactionsProps {
|
|
5
|
+
commentId: string;
|
|
6
|
+
reactionType?: ReactionType;
|
|
7
|
+
page?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
sortDir?: "asc" | "desc";
|
|
10
|
+
}
|
|
11
|
+
export interface FetchCommentReactionsResponse {
|
|
12
|
+
data: Reaction[];
|
|
13
|
+
pagination: PaginationMetadata;
|
|
14
|
+
}
|
|
15
|
+
export declare function fetchReactions(client: SublayHttpClient, data: FetchCommentReactionsProps): Promise<FetchCommentReactionsResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ReactionType } from "../../interfaces/Reaction";
|
|
3
|
+
export interface GetUserCommentReactionProps {
|
|
4
|
+
commentId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UserCommentReactionResponse {
|
|
7
|
+
reactionType: ReactionType | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function getUserReaction(client: SublayHttpClient, data: GetUserCommentReactionProps): Promise<UserCommentReactionResponse>;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export { createComment } from "./createComment";
|
|
2
|
+
export { fetchComment } from "./fetchComment";
|
|
3
|
+
export { fetchCommentByForeignId } from "./fetchCommentByForeignId";
|
|
4
|
+
export { updateComment } from "./updateComment";
|
|
5
|
+
export { deleteComment } from "./deleteComment";
|
|
6
|
+
export { fetchManyComments } from "./fetchManyComments";
|
|
7
|
+
export { addReaction } from "./addReaction";
|
|
8
|
+
export { removeReaction } from "./removeReaction";
|
|
9
|
+
export { fetchReactions } from "./fetchReactions";
|
|
10
|
+
export { getUserReaction } from "./getUserReaction";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Comment } from "../../interfaces/Comment";
|
|
3
|
+
export interface RemoveCommentReactionProps {
|
|
4
|
+
commentId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function removeReaction(client: SublayHttpClient, data: RemoveCommentReactionProps): Promise<Comment>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Comment } from "../../interfaces/Comment";
|
|
3
|
+
export interface UpdateCommentProps {
|
|
4
|
+
commentId: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function updateComment(client: SublayHttpClient, data: UpdateCommentProps): Promise<Comment>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ConnectionActionResponse } from "../../interfaces/Connection";
|
|
3
|
+
export interface AcceptConnectionProps {
|
|
4
|
+
connectionId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function acceptConnection(client: SublayHttpClient, data: AcceptConnectionProps): Promise<ConnectionActionResponse>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ConnectionActionResponse } from "../../interfaces/Connection";
|
|
3
|
+
export interface DeclineConnectionProps {
|
|
4
|
+
connectionId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function declineConnection(client: SublayHttpClient, data: DeclineConnectionProps): Promise<ConnectionActionResponse>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { EstablishedConnection } from "../../interfaces/Connection";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchConnectionsProps {
|
|
5
|
+
page?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function fetchConnections(client: SublayHttpClient, data: FetchConnectionsProps): Promise<PaginatedResponse<EstablishedConnection>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { PendingConnection } from "../../interfaces/Connection";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchReceivedPendingConnectionsProps {
|
|
5
|
+
page?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function fetchReceivedPendingConnections(client: SublayHttpClient, data: FetchReceivedPendingConnectionsProps): Promise<PaginatedResponse<PendingConnection>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { PendingConnection } from "../../interfaces/Connection";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchSentPendingConnectionsProps {
|
|
5
|
+
page?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function fetchSentPendingConnections(client: SublayHttpClient, data: FetchSentPendingConnectionsProps): Promise<PaginatedResponse<PendingConnection>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { fetchConnections } from "./fetchConnections";
|
|
2
|
+
export { fetchConnectionsCount } from "./fetchConnectionsCount";
|
|
3
|
+
export { fetchSentPendingConnections } from "./fetchSentPendingConnections";
|
|
4
|
+
export { fetchReceivedPendingConnections } from "./fetchReceivedPendingConnections";
|
|
5
|
+
export { acceptConnection } from "./acceptConnection";
|
|
6
|
+
export { declineConnection } from "./declineConnection";
|
|
7
|
+
export { removeConnection } from "./removeConnection";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
3
|
+
import { ReactionType } from "../../interfaces/Reaction";
|
|
4
|
+
export interface AddEntityReactionProps {
|
|
5
|
+
entityId: string;
|
|
6
|
+
reactionType: ReactionType;
|
|
7
|
+
}
|
|
8
|
+
export declare function addReaction(client: SublayHttpClient, data: AddEntityReactionProps): Promise<Entity>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
3
|
+
import { Mention } from "../../interfaces/Mention";
|
|
2
4
|
export interface CreateEntityProps {
|
|
3
5
|
foreignId?: string;
|
|
4
6
|
sourceId?: string;
|
|
@@ -7,11 +9,14 @@ export interface CreateEntityProps {
|
|
|
7
9
|
content?: string;
|
|
8
10
|
attachments?: Record<string, any>[];
|
|
9
11
|
keywords?: string[];
|
|
12
|
+
mentions?: Mention[];
|
|
10
13
|
location?: {
|
|
11
14
|
latitude: number;
|
|
12
15
|
longitude: number;
|
|
13
16
|
};
|
|
14
17
|
metadata?: Record<string, any>;
|
|
15
|
-
|
|
18
|
+
isDraft?: boolean;
|
|
19
|
+
/** Create the entity without attributing it to the logged-in user (authorless). */
|
|
20
|
+
excludeUserId?: boolean;
|
|
16
21
|
}
|
|
17
|
-
export declare function createEntity(client: SublayHttpClient, data: CreateEntityProps): Promise<
|
|
22
|
+
export declare function createEntity(client: SublayHttpClient, data: CreateEntityProps): Promise<Entity>;
|
|
@@ -2,4 +2,4 @@ import { SublayHttpClient } from "../../core/client";
|
|
|
2
2
|
export interface DeleteEntityProps {
|
|
3
3
|
entityId: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function deleteEntity(client: SublayHttpClient, data: DeleteEntityProps): Promise<
|
|
5
|
+
export declare function deleteEntity(client: SublayHttpClient, data: DeleteEntityProps): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchDraftsProps {
|
|
5
|
+
page?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
sourceId?: string;
|
|
8
|
+
spaceId?: string;
|
|
9
|
+
include?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function fetchDrafts(client: SublayHttpClient, data: FetchDraftsProps): Promise<PaginatedResponse<Entity>>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
2
3
|
export interface FetchEntityProps {
|
|
3
4
|
entityId: string;
|
|
5
|
+
include?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function fetchEntity(client: SublayHttpClient, data: FetchEntityProps): Promise<
|
|
7
|
+
export declare function fetchEntity(client: SublayHttpClient, data: FetchEntityProps): Promise<Entity>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
2
3
|
export interface FetchEntityByForeignIdProps {
|
|
3
4
|
foreignId: string;
|
|
4
5
|
createIfNotFound?: boolean;
|
|
6
|
+
include?: string;
|
|
5
7
|
}
|
|
6
|
-
export declare function fetchEntityByForeignId(client: SublayHttpClient, data: FetchEntityByForeignIdProps): Promise<
|
|
8
|
+
export declare function fetchEntityByForeignId(client: SublayHttpClient, data: FetchEntityByForeignIdProps): Promise<Entity>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
2
3
|
export interface FetchEntityByShortIdProps {
|
|
3
4
|
shortId: string;
|
|
5
|
+
include?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function fetchEntityByShortId(client: SublayHttpClient, data: FetchEntityByShortIdProps): Promise<
|
|
7
|
+
export declare function fetchEntityByShortId(client: SublayHttpClient, data: FetchEntityByShortIdProps): Promise<Entity>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Entity } from "../../interfaces/Entity";
|
|
2
3
|
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
3
4
|
export interface KeywordsFilters {
|
|
4
5
|
includes?: string[];
|
|
@@ -8,6 +9,9 @@ export interface MetadataFilters {
|
|
|
8
9
|
includes?: {
|
|
9
10
|
[key: string]: any;
|
|
10
11
|
};
|
|
12
|
+
includesAny?: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}[];
|
|
11
15
|
doesNotInclude?: {
|
|
12
16
|
[key: string]: any;
|
|
13
17
|
};
|
|
@@ -30,12 +34,16 @@ export interface LocationFilters {
|
|
|
30
34
|
export interface FetchManyEntitiesProps {
|
|
31
35
|
sourceId?: string;
|
|
32
36
|
spaceId?: string;
|
|
33
|
-
sortBy?: "hot" | "top" | "controversial";
|
|
37
|
+
sortBy?: "new" | "hot" | "top" | "controversial" | (string & {});
|
|
38
|
+
sortDir?: "asc" | "desc";
|
|
39
|
+
sortType?: "auto" | "numeric" | "text" | "boolean" | "timestamp";
|
|
40
|
+
sortByReaction?: "upvote" | "downvote" | "like" | "love" | "wow" | "sad" | "angry" | "funny";
|
|
34
41
|
page?: number;
|
|
35
42
|
limit?: number;
|
|
43
|
+
include?: string;
|
|
36
44
|
timeFrame?: "hour" | "day" | "week" | "month" | "year";
|
|
37
45
|
userId?: string;
|
|
38
|
-
followedOnly?: "true";
|
|
46
|
+
followedOnly?: "true" | "false";
|
|
39
47
|
keywordsFilters?: KeywordsFilters;
|
|
40
48
|
metadataFilters?: MetadataFilters;
|
|
41
49
|
titleFilters?: TextFilters;
|
|
@@ -47,4 +55,4 @@ export interface FetchManyEntitiesProps {
|
|
|
47
55
|
attachmentsFilters?: AttachmentsFilters;
|
|
48
56
|
locationFilters?: LocationFilters;
|
|
49
57
|
}
|
|
50
|
-
export declare function fetchManyEntities(client: SublayHttpClient, data: FetchManyEntitiesProps): Promise<PaginatedResponse<
|
|
58
|
+
export declare function fetchManyEntities(client: SublayHttpClient, data: FetchManyEntitiesProps): Promise<PaginatedResponse<Entity>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Reaction, ReactionType } from "../../interfaces/Reaction";
|
|
3
|
+
import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchEntityReactionsProps {
|
|
5
|
+
entityId: string;
|
|
6
|
+
reactionType?: ReactionType;
|
|
7
|
+
page?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
sortDir?: "asc" | "desc";
|
|
10
|
+
}
|
|
11
|
+
export interface FetchEntityReactionsResponse {
|
|
12
|
+
data: Reaction[];
|
|
13
|
+
pagination: PaginationMetadata;
|
|
14
|
+
}
|
|
15
|
+
export declare function fetchReactions(client: SublayHttpClient, data: FetchEntityReactionsProps): Promise<FetchEntityReactionsResponse>;
|
|
@@ -0,0 +1,6 @@
|
|
|
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>;
|
|
@@ -0,0 +1,9 @@
|
|
|
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,8 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
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";
|
|
@@ -0,0 +1,12 @@
|
|
|
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>;
|
|
@@ -0,0 +1,6 @@
|
|
|
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>;
|
|
@@ -0,0 +1,6 @@
|
|
|
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>;
|