UNPKG

pancake-client-sdk

Version:
76 lines (75 loc) 2.16 kB
import { CRMTable, CRMRecord, CreateTableRequest, UpdateTableRequest, CreateRecordRequest, UpdateRecordRequest, CRMProfile, CRMRecordHistory, CRMListParams, CRMRecordComment, CreateCommentRequest } from '../types/crm'; import { BaseResource } from './base'; export declare class CRMResource extends BaseResource { /** * Get list of CRM tables */ listTables(): Promise<{ data: CRMTable[]; }>; /** * Get table by ID */ getTable(tableId: string): Promise<CRMTable>; /** * Create new table */ createTable(data: CreateTableRequest): Promise<CRMTable>; /** * Update table */ updateTable(tableId: string, data: UpdateTableRequest): Promise<CRMTable>; /** * Delete table */ deleteTable(tableId: string): Promise<void>; /** * Get list of records in a table */ listRecords(tableId: string, params?: CRMListParams): Promise<{ data: CRMRecord[]; total: number; }>; /** * Get record by ID */ getRecord(tableId: string, recordId: string): Promise<CRMRecord>; /** * Create new record */ createRecord(tableId: string, data: CreateRecordRequest): Promise<CRMRecord>; /** * Update record */ updateRecord(tableId: string, recordId: string, data: UpdateRecordRequest): Promise<CRMRecord>; /** * Delete record */ deleteRecord(tableId: string, recordId: string): Promise<void>; /** * Get list of CRM profiles */ listProfiles(): Promise<{ data: CRMProfile[]; }>; /** * Get record history */ getRecordHistory(tableId: string, recordId: string): Promise<{ data: CRMRecordHistory[]; }>; /** * Get record comments */ listComments(tableId: string, recordId: string): Promise<{ data: CRMRecordComment[]; }>; /** * Add comment to record */ createComment(tableId: string, recordId: string, data: CreateCommentRequest): Promise<CRMRecordComment>; /** * Delete comment */ deleteComment(tableId: string, recordId: string, commentId: string): Promise<void>; }