UNPKG

amocrm-client

Version:
27 lines (23 loc) 1.2 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 { CatalogElementCriteria, ICatalogElementAttributes } from "../../interfaces/catalog"; import { CatalogElementDTO } from "../../dto/catalog.dto"; import { ICatalogElementFactory } from "../factories/CatalogElementFactory"; export interface ICatalogElement extends IResourceEntity<ICatalogElementFactory>, ICatalogElementAttributes { create(options?: IRequestOptions): Promise<ICatalogElement>; update(options?: IRequestOptions): Promise<ICatalogElement>; save(options?: IRequestOptions): Promise<ICatalogElement>; fetch(criteria?: CatalogElementCriteria, options?: IRequestOptions): Promise<ICatalogElement>; } export const CatalogElement: TConstructor<ICatalogElement> = applyMixins(CatalogElementDTO, [ hasCreate, hasUpdate, hasSave, hasFetch ]);