export type UserDTO = {activated?: boolean | undefined, authorities?: Array | undefined, clubCode?: number | undefined, clubType?: ('AYRIA' | 'PERSEPOLIS' | 'KARAFARIN' | 'BIMEHKHAVARMIYANE') | undefined, createdBy?: string | undefined, createdDate?: string | undefined, email?: string | undefined, firstName?: string | undefined, gender?: ('MALE' | 'FEMALE') | undefined, id?: number | undefined, imageUrl?: string | undefined, langKey?: string | undefined, lastModifiedBy?: string | undefined, lastModifiedDate?: string | undefined, lastName?: string | undefined, locked?: boolean | undefined, login?: string | undefined, mobile?: string | undefined, nickname?: string | undefined, plan?: ('BASIC' | 'GOLD' | 'STAR' | 'GALAXY') | undefined}; export type CreateApiApiUsersArgs = {body: UserDTO}; export type CreateApiApiUsersOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * createUser * * POST /api/users */ export const createApiApiUsers = async (args: CreateApiApiUsersArgs, options: CreateApiApiUsersOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/users${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };