UNPKG

amocrm-client

Version:
27 lines (23 loc) 1.11 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 { CatalogCriteria, ICatalogAttributes } from "../../interfaces/catalog"; import { CatalogElementDTO } from "../../dto/catalog.dto"; import { ICatalogFactory } from "../factories/CatalogFactory"; export interface ICatalog extends IResourceEntity<ICatalogFactory>, ICatalogAttributes { create(options?: IRequestOptions): Promise<ICatalog>; update(options?: IRequestOptions): Promise<ICatalog>; save(options?: IRequestOptions): Promise<ICatalog>; fetch(criteria?: CatalogCriteria, options?: IRequestOptions): Promise<ICatalog>; } export const Catalog: TConstructor<ICatalog> = applyMixins(CatalogElementDTO, [ hasCreate, hasUpdate, hasSave, hasFetch ]);