diff --git a/packages/frontend-core/src/api/user.ts b/packages/frontend-core/src/api/user.ts index a03c986a61..84ec68644d 100644 --- a/packages/frontend-core/src/api/user.ts +++ b/packages/frontend-core/src/api/user.ts @@ -5,9 +5,16 @@ import { BulkUserDeleted, BulkUserRequest, BulkUserResponse, + CheckInviteResponse, + CountUserResponse, CreateAdminUserRequest, CreateAdminUserResponse, DeleteInviteUsersRequest, + DeleteInviteUsersResponse, + DeleteUserResponse, + FetchUsersResponse, + FindUserResponse, + GetUserInvitesResponse, InviteUsersRequest, InviteUsersResponse, LookupAccountHolderResponse, @@ -23,8 +30,8 @@ import { import { BaseAPIClient } from "./types" export interface UserEndpoints { - getUsers: () => Promise - getUser: (userId: string) => Promise + getUsers: () => Promise + getUser: (userId: string) => Promise updateOwnMetadata: ( metadata: UpdateSelfMetadataRequest ) => Promise @@ -32,7 +39,7 @@ export interface UserEndpoints { user: CreateAdminUserRequest ) => Promise saveUser: (user: User) => Promise - deleteUser: (userId: string) => Promise<{ message: string }> + deleteUser: (userId: string) => Promise deleteUsers: ( users: Array<{ userId: string @@ -40,21 +47,16 @@ export interface UserEndpoints { }> ) => Promise onboardUsers: (data: InviteUsersRequest) => Promise - getUserInvite: (code: string) => Promise<{ email: string }> - getUserInvites: () => Promise + getUserInvite: (code: string) => Promise + getUserInvites: () => Promise inviteUsers: (users: InviteUsersRequest) => Promise removeUserInvites: ( data: DeleteInviteUsersRequest - ) => Promise<{ message: string }> + ) => Promise acceptInvite: ( data: AcceptUserInviteRequest ) => Promise getUserCountByApp: (appId: string) => Promise - addAppBuilder: (userId: string, appId: string) => Promise<{ message: string }> - removeAppBuilder: ( - userId: string, - appId: string - ) => Promise<{ message: string }> getAccountHolder: () => Promise searchUsers: (data: SearchUsersRequest) => Promise createUsers: ( @@ -65,6 +67,13 @@ export interface UserEndpoints { code: string, data: UpdateInviteRequest ) => Promise + + // Missing request or response types + addAppBuilder: (userId: string, appId: string) => Promise<{ message: string }> + removeAppBuilder: ( + userId: string, + appId: string + ) => Promise<{ message: string }> } export const buildUserEndpoints = (API: BaseAPIClient): UserEndpoints => ({ @@ -248,7 +257,7 @@ export const buildUserEndpoints = (API: BaseAPIClient): UserEndpoints => ({ * Counts the number of users in an app */ getUserCountByApp: async appId => { - const res = await API.get<{ userCount: number }>({ + const res = await API.get({ url: `/api/global/users/count/${appId}`, }) return res.userCount