@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,258 @@
|
|
|
1
|
+
type AppNotificationType = "system" | "entity-comment" | "comment-reply" | "entity-mention" | "comment-mention" | "entity-upvote" | "comment-upvote" | "entity-reaction" | "comment-reaction" | "entity-reaction-milestone-specific" | "entity-reaction-milestone-total" | "comment-reaction-milestone-specific" | "comment-reaction-milestone-total" | "new-follow" | "connection-request" | "connection-accepted" | "space-membership-approved";
|
|
2
|
+
interface BaseAppNotification {
|
|
3
|
+
id: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
type: AppNotificationType;
|
|
6
|
+
isRead: boolean;
|
|
7
|
+
metadata: Record<string, any>;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SystemNotification extends BaseAppNotification {
|
|
11
|
+
type: "system";
|
|
12
|
+
action: string;
|
|
13
|
+
metadata: {
|
|
14
|
+
title?: string;
|
|
15
|
+
content?: string;
|
|
16
|
+
buttonData: {
|
|
17
|
+
text: string;
|
|
18
|
+
url: string;
|
|
19
|
+
} | null;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface EntityCommentNotification extends BaseAppNotification {
|
|
23
|
+
type: "entity-comment";
|
|
24
|
+
action: "open-comment";
|
|
25
|
+
metadata: {
|
|
26
|
+
entityId: string;
|
|
27
|
+
entityShortId: string;
|
|
28
|
+
entityTitle: string | null | undefined;
|
|
29
|
+
entityContent: string | null | undefined;
|
|
30
|
+
commentId: string;
|
|
31
|
+
commentContent: string | null | undefined;
|
|
32
|
+
initiatorId: string;
|
|
33
|
+
initiatorName: string | null | undefined;
|
|
34
|
+
initiatorUsername: string | null | undefined;
|
|
35
|
+
initiatorAvatar: string | null | undefined;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface CommentReplyNotification extends BaseAppNotification {
|
|
39
|
+
type: "comment-reply";
|
|
40
|
+
action: "open-comment";
|
|
41
|
+
metadata: {
|
|
42
|
+
entityId: string;
|
|
43
|
+
entityShortId: string;
|
|
44
|
+
entityTitle: string | null | undefined;
|
|
45
|
+
entityContent: string | null | undefined;
|
|
46
|
+
commentId: string;
|
|
47
|
+
commentContent: string | null | undefined;
|
|
48
|
+
replyId: string;
|
|
49
|
+
replyContent: string | null | undefined;
|
|
50
|
+
initiatorId: string;
|
|
51
|
+
initiatorName: string | null | undefined;
|
|
52
|
+
initiatorUsername: string | null | undefined;
|
|
53
|
+
initiatorAvatar: string | null | undefined;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface EntityMentionNotification extends BaseAppNotification {
|
|
57
|
+
type: "entity-mention";
|
|
58
|
+
action: "open-entity";
|
|
59
|
+
metadata: {
|
|
60
|
+
entityId: string;
|
|
61
|
+
entityShortId: string;
|
|
62
|
+
entityTitle: string | null | undefined;
|
|
63
|
+
entityContent: string | null | undefined;
|
|
64
|
+
initiatorId: string;
|
|
65
|
+
initiatorName: string | null | undefined;
|
|
66
|
+
initiatorUsername: string | null | undefined;
|
|
67
|
+
initiatorAvatar: string | null | undefined;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface CommentMentionNotification extends BaseAppNotification {
|
|
71
|
+
type: "comment-mention";
|
|
72
|
+
action: "open-comment";
|
|
73
|
+
metadata: {
|
|
74
|
+
entityId: string;
|
|
75
|
+
entityShortId: string;
|
|
76
|
+
entityTitle: string | null | undefined;
|
|
77
|
+
entityContent: string | null | undefined;
|
|
78
|
+
commentId: string;
|
|
79
|
+
commentContent: string | null | undefined;
|
|
80
|
+
initiatorId: string;
|
|
81
|
+
initiatorName: string | null | undefined;
|
|
82
|
+
initiatorUsername: string | null | undefined;
|
|
83
|
+
initiatorAvatar: string | null | undefined;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export interface EntityUpvoteNotification extends BaseAppNotification {
|
|
87
|
+
type: "entity-upvote";
|
|
88
|
+
action: "open-entity";
|
|
89
|
+
metadata: {
|
|
90
|
+
entityId: string;
|
|
91
|
+
entityShortId: string;
|
|
92
|
+
entityTitle: string | null | undefined;
|
|
93
|
+
entityContent: string | null | undefined;
|
|
94
|
+
initiatorId: string;
|
|
95
|
+
initiatorName: string | null | undefined;
|
|
96
|
+
initiatorUsername: string | null | undefined;
|
|
97
|
+
initiatorAvatar: string | null | undefined;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface CommentUpvoteNotification extends BaseAppNotification {
|
|
101
|
+
type: "comment-upvote";
|
|
102
|
+
action: "open-comment";
|
|
103
|
+
metadata: {
|
|
104
|
+
entityId: string;
|
|
105
|
+
entityShortId: string;
|
|
106
|
+
entityTitle: string | null | undefined;
|
|
107
|
+
entityContent: string | null | undefined;
|
|
108
|
+
commentId: string;
|
|
109
|
+
commentContent: string | null | undefined;
|
|
110
|
+
initiatorId: string;
|
|
111
|
+
initiatorName: string | null | undefined;
|
|
112
|
+
initiatorUsername: string | null | undefined;
|
|
113
|
+
initiatorAvatar: string | null | undefined;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export interface EntityReactionNotification extends BaseAppNotification {
|
|
117
|
+
type: "entity-reaction";
|
|
118
|
+
action: "open-entity";
|
|
119
|
+
metadata: {
|
|
120
|
+
entityId: string;
|
|
121
|
+
entityShortId: string;
|
|
122
|
+
entityTitle: string | null | undefined;
|
|
123
|
+
entityContent: string | null | undefined;
|
|
124
|
+
reactionType: string;
|
|
125
|
+
initiatorId: string;
|
|
126
|
+
initiatorName: string | null | undefined;
|
|
127
|
+
initiatorUsername: string | null | undefined;
|
|
128
|
+
initiatorAvatar: string | null | undefined;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export interface CommentReactionNotification extends BaseAppNotification {
|
|
132
|
+
type: "comment-reaction";
|
|
133
|
+
action: "open-comment";
|
|
134
|
+
metadata: {
|
|
135
|
+
entityId: string;
|
|
136
|
+
entityShortId: string;
|
|
137
|
+
entityTitle: string | null | undefined;
|
|
138
|
+
entityContent: string | null | undefined;
|
|
139
|
+
commentId: string;
|
|
140
|
+
commentContent: string | null | undefined;
|
|
141
|
+
reactionType: string;
|
|
142
|
+
initiatorId: string;
|
|
143
|
+
initiatorName: string | null | undefined;
|
|
144
|
+
initiatorUsername: string | null | undefined;
|
|
145
|
+
initiatorAvatar: string | null | undefined;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
interface MilestoneUser {
|
|
149
|
+
id: string;
|
|
150
|
+
name: string | null | undefined;
|
|
151
|
+
username: string | null | undefined;
|
|
152
|
+
avatar: string | null | undefined;
|
|
153
|
+
}
|
|
154
|
+
export interface EntityReactionMilestoneSpecificNotification extends BaseAppNotification {
|
|
155
|
+
type: "entity-reaction-milestone-specific";
|
|
156
|
+
action: "open-entity";
|
|
157
|
+
metadata: {
|
|
158
|
+
entityId: string;
|
|
159
|
+
entityShortId: string;
|
|
160
|
+
entityTitle: string | null | undefined;
|
|
161
|
+
entityContent: string | null | undefined;
|
|
162
|
+
reactionType: string;
|
|
163
|
+
milestoneCount: number;
|
|
164
|
+
lastThreeUsers: MilestoneUser[];
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export interface EntityReactionMilestoneTotalNotification extends BaseAppNotification {
|
|
168
|
+
type: "entity-reaction-milestone-total";
|
|
169
|
+
action: "open-entity";
|
|
170
|
+
metadata: {
|
|
171
|
+
entityId: string;
|
|
172
|
+
entityShortId: string;
|
|
173
|
+
entityTitle: string | null | undefined;
|
|
174
|
+
entityContent: string | null | undefined;
|
|
175
|
+
milestoneCount: number;
|
|
176
|
+
reactionCounts: Record<string, number>;
|
|
177
|
+
lastThreeUsers: MilestoneUser[];
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
export interface CommentReactionMilestoneSpecificNotification extends BaseAppNotification {
|
|
181
|
+
type: "comment-reaction-milestone-specific";
|
|
182
|
+
action: "open-comment";
|
|
183
|
+
metadata: {
|
|
184
|
+
entityId: string;
|
|
185
|
+
entityShortId: string;
|
|
186
|
+
entityTitle: string | null | undefined;
|
|
187
|
+
entityContent: string | null | undefined;
|
|
188
|
+
commentId: string;
|
|
189
|
+
commentContent: string | null | undefined;
|
|
190
|
+
reactionType: string;
|
|
191
|
+
milestoneCount: number;
|
|
192
|
+
lastThreeUsers: MilestoneUser[];
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export interface CommentReactionMilestoneTotalNotification extends BaseAppNotification {
|
|
196
|
+
type: "comment-reaction-milestone-total";
|
|
197
|
+
action: "open-comment";
|
|
198
|
+
metadata: {
|
|
199
|
+
entityId: string;
|
|
200
|
+
entityShortId: string;
|
|
201
|
+
entityTitle: string | null | undefined;
|
|
202
|
+
entityContent: string | null | undefined;
|
|
203
|
+
commentId: string;
|
|
204
|
+
commentContent: string | null | undefined;
|
|
205
|
+
milestoneCount: number;
|
|
206
|
+
reactionCounts: Record<string, number>;
|
|
207
|
+
lastThreeUsers: MilestoneUser[];
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
export interface SpaceMembershipApprovedNotification extends BaseAppNotification {
|
|
211
|
+
type: "space-membership-approved";
|
|
212
|
+
action: "open-space";
|
|
213
|
+
metadata: {
|
|
214
|
+
spaceId: string;
|
|
215
|
+
spaceName: string;
|
|
216
|
+
spaceShortId: string;
|
|
217
|
+
spaceSlug: string | null | undefined;
|
|
218
|
+
spaceAvatar: string | null | undefined;
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
export interface NewFollowNotification extends BaseAppNotification {
|
|
222
|
+
type: "new-follow";
|
|
223
|
+
action: "open-profile";
|
|
224
|
+
metadata: {
|
|
225
|
+
initiatorId: string;
|
|
226
|
+
initiatorName: string | null | undefined;
|
|
227
|
+
initiatorUsername: string | null | undefined;
|
|
228
|
+
initiatorAvatar: string | null | undefined;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export interface ConnectionRequestNotification extends BaseAppNotification {
|
|
232
|
+
type: "connection-request";
|
|
233
|
+
action: "open-profile";
|
|
234
|
+
metadata: {
|
|
235
|
+
connectionId: string;
|
|
236
|
+
initiatorId: string;
|
|
237
|
+
initiatorName: string | null | undefined;
|
|
238
|
+
initiatorUsername: string | null | undefined;
|
|
239
|
+
initiatorAvatar: string | null | undefined;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export interface ConnectionAcceptedNotification extends BaseAppNotification {
|
|
243
|
+
type: "connection-accepted";
|
|
244
|
+
action: "open-profile";
|
|
245
|
+
metadata: {
|
|
246
|
+
connectionId: string;
|
|
247
|
+
initiatorId: string;
|
|
248
|
+
initiatorName: string | null | undefined;
|
|
249
|
+
initiatorUsername: string | null | undefined;
|
|
250
|
+
initiatorAvatar: string | null | undefined;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
export type UnifiedAppNotification = SystemNotification | EntityCommentNotification | CommentReplyNotification | EntityMentionNotification | CommentMentionNotification | EntityUpvoteNotification | CommentUpvoteNotification | EntityReactionNotification | CommentReactionNotification | EntityReactionMilestoneSpecificNotification | EntityReactionMilestoneTotalNotification | CommentReactionMilestoneSpecificNotification | CommentReactionMilestoneTotalNotification | NewFollowNotification | ConnectionRequestNotification | ConnectionAcceptedNotification | SpaceMembershipApprovedNotification;
|
|
254
|
+
export type PotentiallyPopulatedUnifiedAppNotification = UnifiedAppNotification & {
|
|
255
|
+
title?: string;
|
|
256
|
+
content?: string;
|
|
257
|
+
};
|
|
258
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GifData } from "./Comment";
|
|
2
|
+
import { File } from "./File";
|
|
3
|
+
import { Mention } from "./Mention";
|
|
4
|
+
import { User } from "./User";
|
|
5
|
+
export interface ChatMessage {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
conversationId: string;
|
|
9
|
+
userId: string | null;
|
|
10
|
+
content: string | null;
|
|
11
|
+
gif: GifData | null;
|
|
12
|
+
mentions: Mention[];
|
|
13
|
+
files?: File[];
|
|
14
|
+
metadata: Record<string, any>;
|
|
15
|
+
parentMessageId: string | null;
|
|
16
|
+
quotedMessageId: string | null;
|
|
17
|
+
threadReplyCount: number;
|
|
18
|
+
reactionCounts: Record<string, number>;
|
|
19
|
+
userReactions: string[];
|
|
20
|
+
editedAt: string | null;
|
|
21
|
+
userDeletedAt: string | null;
|
|
22
|
+
moderationStatus: "approved" | "removed" | null;
|
|
23
|
+
moderatedAt: string | null;
|
|
24
|
+
moderatedById: string | null;
|
|
25
|
+
moderatedByType: "client" | "user" | null;
|
|
26
|
+
moderationReason: string | null;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
user: User | null;
|
|
30
|
+
quotedMessage?: ChatMessage | null;
|
|
31
|
+
parentMessage?: ChatMessage | null;
|
|
32
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Entity } from "./Entity";
|
|
2
|
+
import { Mention } from "./Mention";
|
|
3
|
+
import { User } from "./User";
|
|
4
|
+
import { ReactionCounts, ReactionType } from "./Reaction";
|
|
5
|
+
export interface GifData {
|
|
6
|
+
id: string;
|
|
7
|
+
url: string;
|
|
8
|
+
gifUrl: string;
|
|
9
|
+
gifPreviewUrl: string;
|
|
10
|
+
altText: string;
|
|
11
|
+
aspectRatio: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Comment {
|
|
14
|
+
id: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
foreignId: string | null;
|
|
17
|
+
entityId: string;
|
|
18
|
+
entity?: Entity;
|
|
19
|
+
userId: string;
|
|
20
|
+
user?: User;
|
|
21
|
+
parentId: string | null;
|
|
22
|
+
parentComment?: Comment;
|
|
23
|
+
content: string | null;
|
|
24
|
+
gif: GifData | null;
|
|
25
|
+
mentions: Mention[];
|
|
26
|
+
upvotes: string[];
|
|
27
|
+
downvotes: string[];
|
|
28
|
+
reactionCounts: ReactionCounts;
|
|
29
|
+
userReaction?: ReactionType | null;
|
|
30
|
+
repliesCount: number;
|
|
31
|
+
metadata: Record<string, any>;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
deletedAt: string | null;
|
|
35
|
+
parentDeletedAt: string | null;
|
|
36
|
+
userDeletedAt: string | null;
|
|
37
|
+
moderationStatus: "approved" | "removed" | null;
|
|
38
|
+
moderatedAt: string | null;
|
|
39
|
+
moderatedById: string | null;
|
|
40
|
+
moderatedByType: "client" | "user" | null;
|
|
41
|
+
moderationReason: string | null;
|
|
42
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { User } from "./User";
|
|
2
|
+
export interface Connection {
|
|
3
|
+
id: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
}
|
|
7
|
+
/** Returned by `POST /users/:userId/connection` (requestConnection). */
|
|
8
|
+
export interface ConnectionRequestResponse {
|
|
9
|
+
id: string;
|
|
10
|
+
status: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface EstablishedConnection {
|
|
14
|
+
id: string;
|
|
15
|
+
connectedUser: User;
|
|
16
|
+
connectedAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PendingConnection extends Connection {
|
|
19
|
+
user: User;
|
|
20
|
+
type: "received" | "sent";
|
|
21
|
+
}
|
|
22
|
+
export interface ConnectionRequestParams {
|
|
23
|
+
userId: string;
|
|
24
|
+
message?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ConnectionActionResponse {
|
|
27
|
+
id: string;
|
|
28
|
+
status: string;
|
|
29
|
+
createdAt?: string;
|
|
30
|
+
respondedAt?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ConnectionWithdrawResponse {
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ConnectionCountResponse {
|
|
36
|
+
count: number;
|
|
37
|
+
}
|
|
38
|
+
export interface RemoveConnectionByUserIdResponse {
|
|
39
|
+
id?: string;
|
|
40
|
+
status?: string;
|
|
41
|
+
respondedAt?: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
action?: "withdraw" | "disconnect" | "decline";
|
|
44
|
+
}
|
|
45
|
+
export interface ConnectionStatusNone {
|
|
46
|
+
status: "none";
|
|
47
|
+
}
|
|
48
|
+
export interface ConnectionStatusPending {
|
|
49
|
+
status: "pending";
|
|
50
|
+
type: "sent" | "received";
|
|
51
|
+
connectionId: string;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ConnectionStatusConnected {
|
|
55
|
+
status: "connected";
|
|
56
|
+
connectionId: string;
|
|
57
|
+
connectedAt: string;
|
|
58
|
+
requestedAt: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ConnectionStatusDeclined {
|
|
61
|
+
status: "declined";
|
|
62
|
+
type: "sent" | "received";
|
|
63
|
+
connectionId: string;
|
|
64
|
+
respondedAt: string;
|
|
65
|
+
}
|
|
66
|
+
export type ConnectionStatusResponse = ConnectionStatusNone | ConnectionStatusPending | ConnectionStatusConnected | ConnectionStatusDeclined;
|
|
67
|
+
export type ConnectionStatus = "none" | "pending-sent" | "pending-received" | "connected" | "declined-sent" | "declined-received";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { File } from "./File";
|
|
2
|
+
import { ChatMessage } from "./ChatMessage";
|
|
3
|
+
import { ConversationMember } from "./ConversationMember";
|
|
4
|
+
export interface Conversation {
|
|
5
|
+
id: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
type: "direct" | "group" | "space";
|
|
8
|
+
name: string | null;
|
|
9
|
+
description: string | null;
|
|
10
|
+
spaceId: string | null;
|
|
11
|
+
createdById: string | null;
|
|
12
|
+
avatarFileId: string | null;
|
|
13
|
+
lastMessageAt: string | null;
|
|
14
|
+
postingPermission: "members" | "admins" | null;
|
|
15
|
+
metadata: Record<string, any>;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
memberCount?: number;
|
|
19
|
+
currentMember?: ConversationMember;
|
|
20
|
+
avatarFile?: File;
|
|
21
|
+
}
|
|
22
|
+
export interface ConversationPreview extends Conversation {
|
|
23
|
+
unreadCount: number;
|
|
24
|
+
lastMessage: ChatMessage | null;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { User } from "./User";
|
|
2
|
+
export type ConversationMemberRole = "admin" | "member";
|
|
3
|
+
export interface ConversationMember {
|
|
4
|
+
id: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
conversationId: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
role: ConversationMemberRole | null;
|
|
9
|
+
lastReadAt: string | null;
|
|
10
|
+
mutedUntil: string | null;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
leftAt: string | null;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
user?: User;
|
|
16
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Mention } from "./Mention";
|
|
2
|
+
import { User } from "./User";
|
|
3
|
+
import { Space } from "./Space";
|
|
4
|
+
import { ReactionCounts, ReactionType } from "./Reaction";
|
|
5
|
+
import { File } from "./File";
|
|
6
|
+
export interface TopComment {
|
|
7
|
+
id: string;
|
|
8
|
+
user: User;
|
|
9
|
+
upvotesCount: number;
|
|
10
|
+
content: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Entity {
|
|
14
|
+
id: string;
|
|
15
|
+
foreignId: string | null;
|
|
16
|
+
shortId: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
sourceId: string | null;
|
|
19
|
+
spaceId: string | null;
|
|
20
|
+
space?: Space | null;
|
|
21
|
+
userId: string | null;
|
|
22
|
+
user?: User | null;
|
|
23
|
+
title: string | null;
|
|
24
|
+
content: string | null;
|
|
25
|
+
mentions: Mention[];
|
|
26
|
+
attachments: Record<string, any>[];
|
|
27
|
+
files?: File[];
|
|
28
|
+
keywords: string[];
|
|
29
|
+
upvotes: string[];
|
|
30
|
+
downvotes: string[];
|
|
31
|
+
reactionCounts: ReactionCounts;
|
|
32
|
+
userReaction?: ReactionType | null;
|
|
33
|
+
repliesCount: number;
|
|
34
|
+
views: number;
|
|
35
|
+
score: number;
|
|
36
|
+
scoreUpdatedAt: string;
|
|
37
|
+
location: {
|
|
38
|
+
type: "Point";
|
|
39
|
+
coordinates: [number, number];
|
|
40
|
+
} | null;
|
|
41
|
+
metadata: Record<string, any>;
|
|
42
|
+
topComment: TopComment | null;
|
|
43
|
+
isSaved?: boolean;
|
|
44
|
+
isDraft: boolean | null;
|
|
45
|
+
moderationStatus: "approved" | "removed" | null;
|
|
46
|
+
moderatedAt: string | null;
|
|
47
|
+
moderatedById: string | null;
|
|
48
|
+
moderatedByType: "client" | "user" | null;
|
|
49
|
+
moderationReason: string | null;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
deletedAt: string | null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface FileImageVariant {
|
|
2
|
+
path: string;
|
|
3
|
+
publicPath: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
size: number;
|
|
7
|
+
format: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FileImage {
|
|
10
|
+
fileId: string;
|
|
11
|
+
originalWidth: number;
|
|
12
|
+
originalHeight: number;
|
|
13
|
+
variants: Record<string, FileImageVariant>;
|
|
14
|
+
processingStatus: "completed" | "failed";
|
|
15
|
+
processingError: string | null;
|
|
16
|
+
format: string;
|
|
17
|
+
quality: number;
|
|
18
|
+
exifStripped: boolean;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface File {
|
|
23
|
+
id: string;
|
|
24
|
+
projectId: string;
|
|
25
|
+
userId: string | null;
|
|
26
|
+
entityId: string | null;
|
|
27
|
+
commentId: string | null;
|
|
28
|
+
chatMessageId: string | null;
|
|
29
|
+
spaceId: string | null;
|
|
30
|
+
type: "image" | "video" | "document" | "other";
|
|
31
|
+
originalPath: string;
|
|
32
|
+
originalSize: number;
|
|
33
|
+
originalMimeType: string;
|
|
34
|
+
position: number;
|
|
35
|
+
metadata: Record<string, any>;
|
|
36
|
+
image?: FileImage;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { User } from "./User";
|
|
2
|
+
export interface Follow {
|
|
3
|
+
id: string;
|
|
4
|
+
projectId: string;
|
|
5
|
+
followerId: string;
|
|
6
|
+
followedId: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An entry in a follower/following list. The list endpoints
|
|
11
|
+
* (`/follows/(followers|following)` and `/users/:userId/(followers|following)`)
|
|
12
|
+
* return the follow id, the populated other user, and when the follow happened
|
|
13
|
+
* — NOT the raw {@link Follow} row.
|
|
14
|
+
*/
|
|
15
|
+
export interface FollowListItem {
|
|
16
|
+
followId: string;
|
|
17
|
+
user: User;
|
|
18
|
+
followedAt: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type ImageFit = "cover" | "contain" | "inside" | "outside";
|
|
2
|
+
export type ImageFormat = "webp" | "jpeg" | "png" | "original";
|
|
3
|
+
interface BaseImageOptions {
|
|
4
|
+
/** 1–100. Output quality. */
|
|
5
|
+
quality?: number;
|
|
6
|
+
format?: ImageFormat;
|
|
7
|
+
stripExif?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Mode 1 — explicit width/height per named variant. */
|
|
10
|
+
export interface ExactDimensionsOptions extends BaseImageOptions {
|
|
11
|
+
mode: "exact-dimensions";
|
|
12
|
+
/** Keyed by variant name, e.g. `{ thumbnail: { width, height } }`. 50–10000. */
|
|
13
|
+
dimensions: Record<string, {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}>;
|
|
17
|
+
fit?: ImageFit;
|
|
18
|
+
}
|
|
19
|
+
/** Mode 2a — fixed aspect ratio, sized by width per variant. */
|
|
20
|
+
export interface AspectRatioWidthOptions extends BaseImageOptions {
|
|
21
|
+
mode: "aspect-ratio-width-based";
|
|
22
|
+
aspectRatio: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
/** Keyed by variant name → target width (50–10000). */
|
|
27
|
+
widths: Record<string, number>;
|
|
28
|
+
fit?: ImageFit;
|
|
29
|
+
}
|
|
30
|
+
/** Mode 2b — fixed aspect ratio, sized by height per variant. */
|
|
31
|
+
export interface AspectRatioHeightOptions extends BaseImageOptions {
|
|
32
|
+
mode: "aspect-ratio-height-based";
|
|
33
|
+
aspectRatio: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
};
|
|
37
|
+
/** Keyed by variant name → target height (50–10000). */
|
|
38
|
+
heights: Record<string, number>;
|
|
39
|
+
fit?: ImageFit;
|
|
40
|
+
}
|
|
41
|
+
/** Mode 3 — preserve the source aspect ratio, bounded per variant. */
|
|
42
|
+
export interface OriginalAspectOptions extends BaseImageOptions {
|
|
43
|
+
mode: "original-aspect";
|
|
44
|
+
/** Keyed by variant name → bounding size (50–10000). */
|
|
45
|
+
sizes: Record<string, number>;
|
|
46
|
+
/** Server restricts this mode to `inside` | `outside`. */
|
|
47
|
+
fit?: "inside" | "outside";
|
|
48
|
+
}
|
|
49
|
+
/** Mode 4 — multiple aspect ratios, sized per variant. */
|
|
50
|
+
export interface MultiAspectRatioOptions extends BaseImageOptions {
|
|
51
|
+
mode: "multi-aspect-ratio";
|
|
52
|
+
/** 1–10 aspect ratios. */
|
|
53
|
+
aspectRatios: {
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
}[];
|
|
57
|
+
/** Keyed by variant name → target size (50–10000). */
|
|
58
|
+
sizes: Record<string, number>;
|
|
59
|
+
fit?: ImageFit;
|
|
60
|
+
}
|
|
61
|
+
export type ImageOptions = ExactDimensionsOptions | AspectRatioWidthOptions | AspectRatioHeightOptions | OriginalAspectOptions | MultiAspectRatioOptions;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface OAuthIdentity {
|
|
2
|
+
id: string;
|
|
3
|
+
provider: string;
|
|
4
|
+
providerAccountId: string;
|
|
5
|
+
email: string | null;
|
|
6
|
+
name: string | null;
|
|
7
|
+
avatar: string | null;
|
|
8
|
+
isVerified: boolean;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ListIdentitiesResponse {
|
|
12
|
+
identities: OAuthIdentity[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Project {
|
|
2
|
+
id: string;
|
|
3
|
+
clientId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
integrations: {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
data: Record<string, any>;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|