64 lines
3.1 KiB
TypeScript
64 lines
3.1 KiB
TypeScript
import { GET, POST, PUT, DELETE } from '@/web/common/api/request';
|
|
import { UpdateClbPermissionProps } from '@fastgpt/global/support/permission/collaborator';
|
|
import {
|
|
CreateTeamProps,
|
|
InviteMemberProps,
|
|
InviteMemberResponse,
|
|
UpdateInviteProps,
|
|
UpdateTeamProps
|
|
} from '@fastgpt/global/support/user/team/controller.d';
|
|
import type { TeamTagItemType, TeamTagSchema } from '@fastgpt/global/support/user/team/type';
|
|
import {
|
|
TeamTmbItemType,
|
|
TeamMemberItemType,
|
|
TeamMemberSchema
|
|
} from '@fastgpt/global/support/user/team/type.d';
|
|
import { FeTeamPlanStatusType, TeamSubSchema } from '@fastgpt/global/support/wallet/sub/type';
|
|
|
|
/* --------------- team ---------------- */
|
|
export const getTeamList = (status: `${TeamMemberSchema['status']}`) =>
|
|
GET<TeamTmbItemType[]>(`/proApi/support/user/team/list`, { status });
|
|
export const postCreateTeam = (data: CreateTeamProps) =>
|
|
POST<string>(`/proApi/support/user/team/create`, data);
|
|
export const putUpdateTeam = (data: UpdateTeamProps) => PUT(`/support/user/team/update`, data);
|
|
export const putSwitchTeam = (teamId: string) =>
|
|
PUT<string>(`/proApi/support/user/team/switch`, { teamId });
|
|
|
|
/* --------------- team member ---------------- */
|
|
export const getTeamMembers = () =>
|
|
GET<TeamMemberItemType[]>(`/proApi/support/user/team/member/list`);
|
|
export const postInviteTeamMember = (data: InviteMemberProps) =>
|
|
POST<InviteMemberResponse>(`/proApi/support/user/team/member/invite`, data);
|
|
export const putUpdateMemberName = (name: string) =>
|
|
PUT(`/proApi/support/user/team/member/updateName`, { name });
|
|
export const delRemoveMember = (tmbId: string) =>
|
|
DELETE(`/proApi/support/user/team/member/delete`, { tmbId });
|
|
export const updateInviteResult = (data: UpdateInviteProps) =>
|
|
PUT('/proApi/support/user/team/member/updateInvite', data);
|
|
export const delLeaveTeam = (teamId: string) =>
|
|
DELETE('/proApi/support/user/team/member/leave', { teamId });
|
|
|
|
/* -------------- team collaborator -------------------- */
|
|
export const updateMemberPermission = (data: UpdateClbPermissionProps) =>
|
|
PUT('/proApi/support/user/team/collaborator/update', data);
|
|
export const delMemberPermission = (tmbId: string) =>
|
|
DELETE('/proApi/support/user/team/collaborator/delete', { tmbId });
|
|
|
|
/* --------------- team tags ---------------- */
|
|
export const getTeamsTags = () => GET<TeamTagSchema[]>(`/proApi/support/user/team/tag/list`);
|
|
export const loadTeamTagsByDomain = (domain: string) =>
|
|
GET<TeamTagItemType[]>(`/proApi/support/user/team/tag/async`, { domain });
|
|
|
|
/* team limit */
|
|
export const checkTeamExportDatasetLimit = (datasetId: string) =>
|
|
GET(`/support/user/team/limit/exportDatasetLimit`, { datasetId });
|
|
export const checkTeamWebSyncLimit = () => GET(`/support/user/team/limit/webSyncLimit`);
|
|
export const checkTeamDatasetSizeLimit = (size: number) =>
|
|
GET(`/support/user/team/limit/datasetSizeLimit`, { size });
|
|
|
|
/* plans */
|
|
export const getTeamPlanStatus = () =>
|
|
GET<FeTeamPlanStatusType>(`/support/user/team/plan/getTeamPlanStatus`, { maxQuantity: 1 });
|
|
export const getTeamPlans = () =>
|
|
GET<TeamSubSchema[]>(`/proApi/support/user/team/plan/getTeamPlans`);
|