@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.
- 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 +2525 -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 +27 -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 +20 -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 +20 -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 +6 -3
- 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,12 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface ModerateSpaceEntityProps {
|
|
3
|
+
spaceId: string;
|
|
4
|
+
entityId: string;
|
|
5
|
+
action: "approve" | "remove";
|
|
6
|
+
reason?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ModerationResponse {
|
|
9
|
+
message: string;
|
|
10
|
+
moderationStatus: "approved" | "removed";
|
|
11
|
+
}
|
|
12
|
+
export declare function moderateSpaceEntity(client: SublayHttpClient, data: ModerateSpaceEntityProps): Promise<ModerationResponse>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Rule } from "../../interfaces/Rule";
|
|
3
|
+
export interface ReorderRulesProps {
|
|
4
|
+
spaceId: string;
|
|
5
|
+
ruleIds: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function reorderRules(client: SublayHttpClient, data: ReorderRulesProps): Promise<Rule[]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface UnbanMemberProps {
|
|
3
|
+
spaceId: string;
|
|
4
|
+
memberId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UnbanMemberResponse {
|
|
7
|
+
message: string;
|
|
8
|
+
membership: {
|
|
9
|
+
id: string;
|
|
10
|
+
status: "active";
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function unbanMember(client: SublayHttpClient, data: UnbanMemberProps): Promise<UnbanMemberResponse>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { DigestConfig } from "../../interfaces/Space";
|
|
3
|
+
export interface UpdateDigestConfigProps {
|
|
4
|
+
spaceId: string;
|
|
5
|
+
digestEnabled?: boolean;
|
|
6
|
+
digestWebhookUrl?: string;
|
|
7
|
+
digestWebhookSecret?: string;
|
|
8
|
+
digestScheduleHour?: number;
|
|
9
|
+
digestTimezone?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function updateDigestConfig(client: SublayHttpClient, data: UpdateDigestConfigProps): Promise<DigestConfig>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { UpdateMemberRoleResponse, SpaceMemberRole } from "../../interfaces/Space";
|
|
3
|
+
export interface UpdateMemberRoleProps {
|
|
4
|
+
spaceId: string;
|
|
5
|
+
memberId: string;
|
|
6
|
+
role: SpaceMemberRole;
|
|
7
|
+
}
|
|
8
|
+
export declare function updateMemberRole(client: SublayHttpClient, data: UpdateMemberRoleProps): Promise<UpdateMemberRoleResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Rule } from "../../interfaces/Rule";
|
|
3
|
+
export interface UpdateRuleProps {
|
|
4
|
+
spaceId: string;
|
|
5
|
+
ruleId: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function updateRule(client: SublayHttpClient, data: UpdateRuleProps): Promise<Rule>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Space, ReadingPermission, PostingPermission } from "../../interfaces/Space";
|
|
3
|
+
export interface UpdateSpaceProps {
|
|
4
|
+
spaceId: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
slug?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
readingPermission?: ReadingPermission;
|
|
9
|
+
postingPermission?: PostingPermission;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export declare function updateSpace(client: SublayHttpClient, data: UpdateSpaceProps): Promise<Space>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { UploadedImageVariant } from "./uploadImage";
|
|
3
|
+
export interface GetFileImage {
|
|
4
|
+
originalWidth: number;
|
|
5
|
+
originalHeight: number;
|
|
6
|
+
variants: Record<string, UploadedImageVariant>;
|
|
7
|
+
processingStatus: "completed" | "failed";
|
|
8
|
+
format: string;
|
|
9
|
+
quality: number;
|
|
10
|
+
exifStripped: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Shape returned by `GET /storage/:fileId` (a flat projection, not the populated `File` model). */
|
|
13
|
+
export interface GetFileResponse {
|
|
14
|
+
fileId: string;
|
|
15
|
+
type: string;
|
|
16
|
+
originalPath: string;
|
|
17
|
+
originalSize: number;
|
|
18
|
+
originalMimeType: string;
|
|
19
|
+
position: number | null;
|
|
20
|
+
metadata: Record<string, any> | null;
|
|
21
|
+
/** ISO-8601 timestamp. */
|
|
22
|
+
createdAt: string;
|
|
23
|
+
/** ISO-8601 timestamp. */
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
userId?: string;
|
|
26
|
+
entityId?: string;
|
|
27
|
+
commentId?: string;
|
|
28
|
+
spaceId?: string;
|
|
29
|
+
image?: GetFileImage;
|
|
30
|
+
}
|
|
31
|
+
export interface GetFileProps {
|
|
32
|
+
fileId: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function getFile(client: SublayHttpClient, data: GetFileProps): Promise<GetFileResponse>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface UploadFileResponse {
|
|
3
|
+
fileId: string;
|
|
4
|
+
type: string;
|
|
5
|
+
relativePath: string;
|
|
6
|
+
publicPath: string;
|
|
7
|
+
size: number;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
/** ISO-8601 timestamp. */
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface UploadFileProps {
|
|
13
|
+
/** The file to upload, as a browser `File` or `Blob`. */
|
|
14
|
+
file: Blob | File;
|
|
15
|
+
/** Optional filename for the multipart part (defaults to the `File.name` or `"upload"`). */
|
|
16
|
+
filename?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Storage path segments for the file, e.g. ["avatars", userId]. Required by
|
|
19
|
+
* the server (`uploadFileBodySchema.pathParts`).
|
|
20
|
+
*/
|
|
21
|
+
pathParts: string[];
|
|
22
|
+
/** Ordering within the associated entity/comment/space. */
|
|
23
|
+
position?: number;
|
|
24
|
+
metadata?: Record<string, any>;
|
|
25
|
+
/** Only one of entityId/commentId/spaceId may be set. */
|
|
26
|
+
entityId?: string;
|
|
27
|
+
commentId?: string;
|
|
28
|
+
spaceId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function uploadFile(client: SublayHttpClient, data: UploadFileProps): Promise<UploadFileResponse>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ImageOptions } from "../../interfaces/ImageProcessing";
|
|
3
|
+
export interface UploadedImageVariant {
|
|
4
|
+
path: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
size: number;
|
|
8
|
+
format: string;
|
|
9
|
+
publicPath: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UploadImageResponse {
|
|
12
|
+
fileId: string;
|
|
13
|
+
type: "image";
|
|
14
|
+
originalPath: string;
|
|
15
|
+
originalSize: number;
|
|
16
|
+
originalWidth: number;
|
|
17
|
+
originalHeight: number;
|
|
18
|
+
variants: Record<string, UploadedImageVariant>;
|
|
19
|
+
format: string;
|
|
20
|
+
quality: number;
|
|
21
|
+
/** ISO-8601 timestamp. */
|
|
22
|
+
createdAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface UploadImageProps {
|
|
25
|
+
/** The image to upload, as a browser `File` or `Blob`. */
|
|
26
|
+
file: Blob | File;
|
|
27
|
+
/** Optional filename for the multipart part (defaults to the `File.name` or `"upload"`). */
|
|
28
|
+
filename?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Image-processing configuration. A discriminated union on `mode` mirroring
|
|
31
|
+
* the server's `uploadImageBodySchema` — see {@link ImageOptions}.
|
|
32
|
+
*/
|
|
33
|
+
imageOptions: ImageOptions;
|
|
34
|
+
/** Storage path segments, e.g. ["spaces", spaceId, "banner"]. */
|
|
35
|
+
pathParts?: string[];
|
|
36
|
+
/** Only one of entityId/commentId/spaceId may be set. */
|
|
37
|
+
entityId?: string;
|
|
38
|
+
commentId?: string;
|
|
39
|
+
spaceId?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function uploadImage(client: SublayHttpClient, data: UploadImageProps): Promise<UploadImageResponse>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface CheckUsernameAvailabilityProps {
|
|
3
|
+
username: string;
|
|
4
|
+
}
|
|
5
|
+
export interface CheckUsernameAvailabilityResponse {
|
|
6
|
+
available: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function checkUsernameAvailability(client: SublayHttpClient, data: CheckUsernameAvailabilityProps): Promise<CheckUsernameAvailabilityResponse>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { Follow } from "../../interfaces/Follow";
|
|
3
|
+
export interface CreateFollowProps {
|
|
4
|
+
/** The user being followed (the target). The follower is the token holder. */
|
|
5
|
+
userId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createFollow(client: SublayHttpClient, data: CreateFollowProps): Promise<Follow>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface DeleteFollowProps {
|
|
3
|
+
/** The user being unfollowed (the target). The follower is the token holder. */
|
|
4
|
+
userId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function deleteFollow(client: SublayHttpClient, data: DeleteFollowProps): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ConnectionStatusResponse } from "../../interfaces/Connection";
|
|
3
|
+
export interface FetchConnectionStatusProps {
|
|
4
|
+
/**
|
|
5
|
+
* The other user in the connection (the target). The status is from the
|
|
6
|
+
* perspective of the token holder.
|
|
7
|
+
*/
|
|
8
|
+
userId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function fetchConnectionStatus(client: SublayHttpClient, data: FetchConnectionStatusProps): Promise<ConnectionStatusResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { EstablishedConnection } from "../../interfaces/Connection";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchConnectionsByUserIdProps {
|
|
5
|
+
userId: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function fetchConnectionsByUserId(client: SublayHttpClient, data: FetchConnectionsByUserIdProps): Promise<PaginatedResponse<EstablishedConnection>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ConnectionCountResponse } from "../../interfaces/Connection";
|
|
3
|
+
export interface FetchConnectionsCountByUserIdProps {
|
|
4
|
+
userId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function fetchConnectionsCountByUserId(client: SublayHttpClient, data: FetchConnectionsCountByUserIdProps): Promise<ConnectionCountResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface FetchFollowStatusProps {
|
|
3
|
+
/**
|
|
4
|
+
* The user whose follow relationship is being checked (the target). The
|
|
5
|
+
* status is from the perspective of the token holder.
|
|
6
|
+
*/
|
|
7
|
+
userId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FollowStatusResponse {
|
|
10
|
+
isFollowing: boolean;
|
|
11
|
+
followId?: string;
|
|
12
|
+
followedAt?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function fetchFollowStatus(client: SublayHttpClient, data: FetchFollowStatusProps): Promise<FollowStatusResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { FollowListItem } from "../../interfaces/Follow";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchFollowersByUserIdProps {
|
|
5
|
+
userId: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function fetchFollowersByUserId(client: SublayHttpClient, data: FetchFollowersByUserIdProps): Promise<PaginatedResponse<FollowListItem>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface FetchFollowersCountByUserIdProps {
|
|
3
|
+
userId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FollowersCountResponse {
|
|
6
|
+
count: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function fetchFollowersCountByUserId(client: SublayHttpClient, data: FetchFollowersCountByUserIdProps): Promise<FollowersCountResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { FollowListItem } from "../../interfaces/Follow";
|
|
3
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
4
|
+
export interface FetchFollowingByUserIdProps {
|
|
5
|
+
userId: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function fetchFollowingByUserId(client: SublayHttpClient, data: FetchFollowingByUserIdProps): Promise<PaginatedResponse<FollowListItem>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
export interface FetchFollowingCountByUserIdProps {
|
|
3
|
+
userId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FollowingCountResponse {
|
|
6
|
+
count: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function fetchFollowingCountByUserId(client: SublayHttpClient, data: FetchFollowingCountByUserIdProps): Promise<FollowingCountResponse>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { User } from "../../interfaces/User";
|
|
2
3
|
export interface FetchUserByForeignIdProps {
|
|
3
4
|
foreignId: string;
|
|
4
|
-
|
|
5
|
-
username?: string;
|
|
6
|
-
avatar?: string;
|
|
7
|
-
bio?: string;
|
|
8
|
-
metadata?: Record<string, any>;
|
|
9
|
-
secureMetadata?: Record<string, any>;
|
|
5
|
+
include?: string;
|
|
10
6
|
}
|
|
11
|
-
export declare function fetchUserByForeignId(client: SublayHttpClient, data: FetchUserByForeignIdProps): Promise<
|
|
7
|
+
export declare function fetchUserByForeignId(client: SublayHttpClient, data: FetchUserByForeignIdProps): Promise<User>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { User } from "../../interfaces/User";
|
|
2
3
|
export interface FetchUserByIdProps {
|
|
3
4
|
userId: string;
|
|
5
|
+
include?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function fetchUserById(client: SublayHttpClient, data: FetchUserByIdProps): Promise<
|
|
7
|
+
export declare function fetchUserById(client: SublayHttpClient, data: FetchUserByIdProps): Promise<User>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { User } from "../../interfaces/User";
|
|
3
|
+
export interface FetchUserByUsernameProps {
|
|
4
|
+
username: string;
|
|
5
|
+
include?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function fetchUserByUsername(client: SublayHttpClient, data: FetchUserByUsernameProps): Promise<User>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { User } from "../../interfaces/User";
|
|
3
|
+
export interface FetchUserSuggestionsProps {
|
|
4
|
+
query: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function fetchUserSuggestions(client: SublayHttpClient, data: FetchUserSuggestionsProps): Promise<User[]>;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export { fetchUserById } from "./fetchUserById";
|
|
2
|
+
export { fetchUserByForeignId } from "./fetchUserByForeignId";
|
|
3
|
+
export { fetchUserByUsername } from "./fetchUserByUsername";
|
|
4
|
+
export { fetchUserSuggestions } from "./fetchUserSuggestions";
|
|
5
|
+
export { checkUsernameAvailability } from "./checkUsernameAvailability";
|
|
6
|
+
export { updateUser } from "./updateUser";
|
|
7
|
+
export { fetchFollowersByUserId } from "./fetchFollowersByUserId";
|
|
8
|
+
export { fetchFollowersCountByUserId } from "./fetchFollowersCountByUserId";
|
|
9
|
+
export { fetchFollowingByUserId } from "./fetchFollowingByUserId";
|
|
10
|
+
export { fetchFollowingCountByUserId } from "./fetchFollowingCountByUserId";
|
|
11
|
+
export { fetchConnectionsByUserId } from "./fetchConnectionsByUserId";
|
|
12
|
+
export { fetchConnectionsCountByUserId } from "./fetchConnectionsCountByUserId";
|
|
13
|
+
export { createFollow } from "./createFollow";
|
|
14
|
+
export { deleteFollow } from "./deleteFollow";
|
|
15
|
+
export { fetchFollowStatus } from "./fetchFollowStatus";
|
|
16
|
+
export { requestConnection } from "./requestConnection";
|
|
17
|
+
export { fetchConnectionStatus } from "./fetchConnectionStatus";
|
|
18
|
+
export { removeConnectionByUserId } from "./removeConnectionByUserId";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { RemoveConnectionByUserIdResponse } from "../../interfaces/Connection";
|
|
3
|
+
export interface RemoveConnectionByUserIdProps {
|
|
4
|
+
/**
|
|
5
|
+
* The other user in the connection (the target). The token holder is the
|
|
6
|
+
* user withdrawing/declining/disconnecting.
|
|
7
|
+
*/
|
|
8
|
+
userId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function removeConnectionByUserId(client: SublayHttpClient, data: RemoveConnectionByUserIdProps): Promise<RemoveConnectionByUserIdResponse>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { ConnectionRequestResponse } from "../../interfaces/Connection";
|
|
3
|
+
export interface RequestConnectionProps {
|
|
4
|
+
/**
|
|
5
|
+
* The user the connection is requested with (the target). The requester is
|
|
6
|
+
* the token holder.
|
|
7
|
+
*/
|
|
8
|
+
userId: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function requestConnection(client: SublayHttpClient, data: RequestConnectionProps): Promise<ConnectionRequestResponse>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SublayHttpClient } from "../../core/client";
|
|
2
|
+
import { AuthUser } from "../../interfaces/User";
|
|
3
|
+
import { ImageOptions } from "../../interfaces/ImageProcessing";
|
|
4
|
+
/** A file plus the image-processing options the server requires alongside it. */
|
|
5
|
+
export interface UserImageUpload {
|
|
6
|
+
file: Blob | File;
|
|
7
|
+
/** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
|
|
8
|
+
options: ImageOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface UpdateUserProps {
|
|
11
|
+
/** The user to update (the target). A user token may only update itself. */
|
|
12
|
+
userId: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
username?: string;
|
|
15
|
+
avatar?: string;
|
|
16
|
+
bio?: string;
|
|
17
|
+
birthdate?: string;
|
|
18
|
+
location?: {
|
|
19
|
+
latitude: number;
|
|
20
|
+
longitude: number;
|
|
21
|
+
} | null;
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
secureMetadata?: Record<string, any>;
|
|
24
|
+
/**
|
|
25
|
+
* New avatar image. When present the request is sent as `multipart/form-data`.
|
|
26
|
+
* The server processes the image per `options` and replaces the old avatar.
|
|
27
|
+
*/
|
|
28
|
+
avatarFile?: UserImageUpload;
|
|
29
|
+
/** New banner image; same contract as {@link UpdateUserProps.avatarFile}. */
|
|
30
|
+
bannerFile?: UserImageUpload;
|
|
31
|
+
}
|
|
32
|
+
export declare function updateUser(client: SublayHttpClient, data: UpdateUserProps): Promise<AuthUser>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sublay/js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
6
9
|
"description": "Official JavaScript SDK for Sublay",
|
|
7
10
|
"author": "Sublay team",
|
|
8
11
|
"license": "ISC",
|
|
@@ -11,9 +14,9 @@
|
|
|
11
14
|
},
|
|
12
15
|
"exports": {
|
|
13
16
|
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
14
18
|
"import": "./dist/index.js",
|
|
15
|
-
"require": "./dist/index.js"
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
19
|
+
"require": "./dist/index.js"
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
22
|
"dependencies": {
|