feat: stabilize social backend contracts
هذا الالتزام موجود في:
@@ -13,6 +13,28 @@ export const apiEndpoints = {
|
||||
revokeSuperAdminSession: (sessionId: string) => `/auth/superadmin/sessions/${sessionId}/revoke`,
|
||||
},
|
||||
users: {
|
||||
meProfileSetup: "/users/me/profile-setup",
|
||||
meMusicSetup: "/users/me/music-setup",
|
||||
me: "/users/me",
|
||||
publicList: "/users",
|
||||
publicById: (userId: string) => `/users/${userId}`,
|
||||
publicDiscover: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/discover?${toQueryString(params)}`,
|
||||
publicProfileOverview: (userId: string) => `/users/${userId}/profile-overview`,
|
||||
publicPresence: (userId: string) => `/users/${userId}/presence`,
|
||||
publicPosts: (userId: string, params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/${userId}/posts?${toQueryString(params)}`,
|
||||
follow: (userId: string) => `/users/${userId}/follow`,
|
||||
unfollow: (userId: string) => `/users/${userId}/follow`,
|
||||
followStatus: (userId: string) => `/users/${userId}/follow-status`,
|
||||
followers: (userId: string, params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/${userId}/followers?${toQueryString(params)}`,
|
||||
following: (userId: string, params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/${userId}/following?${toQueryString(params)}`,
|
||||
myFollowers: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/me/followers?${toQueryString(params)}`,
|
||||
myFollowing: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/me/following?${toQueryString(params)}`,
|
||||
all: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/users/admin?${toQueryString(params)}`,
|
||||
byId: (userId: string) => `/users/admin/${userId}`,
|
||||
@@ -31,6 +53,24 @@ export const apiEndpoints = {
|
||||
profileOverview: (userId: string) => `/users/admin/${userId}/profile-overview`,
|
||||
},
|
||||
posts: {
|
||||
create: "/posts",
|
||||
reelsCreate: "/posts/reels",
|
||||
reels: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/posts/reels?${toQueryString(params)}`,
|
||||
byId: (postId: string) => `/posts/${postId}`,
|
||||
byUser: (userId: string, params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/posts/user/${userId}?${toQueryString(params)}`,
|
||||
update: (postId: string) => `/posts/${postId}`,
|
||||
repost: (postId: string) => `/posts/${postId}/repost`,
|
||||
commentSettings: (postId: string) => `/posts/${postId}/comment-settings`,
|
||||
pinProfile: (postId: string) => `/posts/${postId}/pin-profile`,
|
||||
unpinProfile: (postId: string) => `/posts/${postId}/unpin-profile`,
|
||||
archive: (postId: string) => `/posts/${postId}/archive`,
|
||||
restoreArchive: (postId: string) => `/posts/${postId}/restore-archive`,
|
||||
remove: (postId: string) => `/posts/${postId}`,
|
||||
view: (postId: string) => `/posts/${postId}/view`,
|
||||
play: (postId: string) => `/posts/${postId}/play`,
|
||||
share: (postId: string) => `/posts/${postId}/share`,
|
||||
moderation: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/posts/admin/moderation?${toQueryString(params)}`,
|
||||
adminDelete: (postId: string) => `/posts/admin/${postId}`,
|
||||
@@ -41,9 +81,39 @@ export const apiEndpoints = {
|
||||
adminDelete: (commentId: string) => `/comments/admin/${commentId}`,
|
||||
},
|
||||
notifications: {
|
||||
mine: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/notifications?${toQueryString(params)}`,
|
||||
unreadCount: "/notifications/unread-count",
|
||||
markRead: (notificationId: string) => `/notifications/${notificationId}/read`,
|
||||
markAllRead: "/notifications/read-all",
|
||||
superAdmin: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/notifications/superadmin?${toQueryString(params)}`,
|
||||
},
|
||||
follows: {
|
||||
toggle: "/follows/toggle",
|
||||
followers: (userId: string, params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/follows/followers/${userId}?${toQueryString(params)}`,
|
||||
following: (userId: string, params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/follows/following/${userId}?${toQueryString(params)}`,
|
||||
status: (targetUserId: string) => `/follows/status/${targetUserId}`,
|
||||
suggestions: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/follows/suggestions?${toQueryString(params)}`,
|
||||
requests: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/follows/requests?${toQueryString(params)}`,
|
||||
approveRequest: (requestId: string) => `/follows/requests/${requestId}/approve`,
|
||||
rejectRequest: (requestId: string) => `/follows/requests/${requestId}/reject`,
|
||||
},
|
||||
devices: {
|
||||
register: "/devices/register",
|
||||
unregister: "/devices/unregister",
|
||||
},
|
||||
collaborationRequests: {
|
||||
create: (postId: string) => `/posts/${postId}/collaboration-requests`,
|
||||
list: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/collaboration-requests?${toQueryString(params)}`,
|
||||
approve: (requestId: string) => `/collaboration-requests/${requestId}/approve`,
|
||||
reject: (requestId: string) => `/collaboration-requests/${requestId}/reject`,
|
||||
},
|
||||
reports: {
|
||||
superAdmin: (params: Record<string, string | number | boolean | null | undefined> = {}) =>
|
||||
`/reports/superadmin?${toQueryString(params)}`,
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم