import { getDefaultClient } from '../../factory' import type { UserProfileRespVO, UserProfileUpdateReqVO, UserProfileUpdateRespVO, UpdateAvatarReqVO, UpdateAvatarRespVO, AuthChannelsRespVO, ChangePasswordReqVO, ChangePasswordRespVO, FetchUserTokenRespVO } from '../../types' // @endpoint GET /user-profile // @controller UserAction.UserProfile export async function getUserProfile(): Promise { return getDefaultClient().get('/user-profile') } // @endpoint PUT /user-profile // @controller UserAction.UserProfileUpdate export async function updateUserProfile( data: UserProfileUpdateReqVO ): Promise { return getDefaultClient().put('/user-profile', data) } // @endpoint PUT /user-profile/update-avatar // @controller UserAction.UpdateAvatar export async function updateUserAvatar( data: UpdateAvatarReqVO ): Promise { return getDefaultClient().put('/user-profile/update-avatar', data) } // @endpoint GET /user-profile/auth-channels // @controller UserAction.AuthChannels export async function getUserAuthChannels(): Promise { return getDefaultClient().get('/user-profile/auth-channels') } // @endpoint POST /user-profile/change-password // @controller UserAction.ChangePassword export async function changeUserPassword( data: ChangePasswordReqVO ): Promise { return getDefaultClient().post('/user-profile/change-password', data) } // @endpoint POST /entity/:app_id/:entity_id/user-token // @controller UserAction.FetchUserToken export async function fetchEntityUserToken( appId: string, entityId: string ): Promise { return getDefaultClient().post(`/entity/${appId}/${entityId}/user-token`) }