UNPKG

amocrm-client

Version:
26 lines (23 loc) 1.04 kB
import { TConstructor } from "../../types"; import { IRequestOptions } from "../../interfaces/common"; import { IResourceEntity } from "../../interfaces/api"; import { applyMixins } from "../../util"; import { hasSave } from "./mixins/hasSave"; import { hasFetch } from "./mixins/hasFetch"; import { hasCreate } from "./mixins/hasCreate"; import { hasUpdate } from "./mixins/hasUpdate"; import { IUserFactory } from "../factories/UserFactory"; import { IUserAttributes, UserCriteria } from "../../interfaces/user"; import { UserDTO } from "../../dto/user.dto"; export interface IUser extends IResourceEntity<IUserFactory>, IUserAttributes { create(options?: IRequestOptions): Promise<IUser>; update(options?: IRequestOptions): Promise<IUser>; save(options?: IRequestOptions): Promise<IUser>; fetch(criteria?: Partial<UserCriteria>, options?: IRequestOptions): Promise<IUser>; } export const User: TConstructor<IUser> = applyMixins(UserDTO, [ hasCreate, hasUpdate, hasSave, hasFetch ]);