UNPKG

crisp-api

Version:

Crisp API wrapper for Node - official, maintained by Crisp

71 lines (70 loc) 2.19 kB
/************************************************************************** * IMPORTS ***************************************************************************/ import BaseResource from "./BaseResource"; /************************************************************************** * TYPES ***************************************************************************/ export type WebsiteInbox = { inbox_id?: string; name?: string; emoji?: string; order?: number; operators?: string[]; conditions?: WebsiteInboxCondition[]; created_at?: number; updated_at?: number; }; export type WebsiteInboxCondition = { model?: "session"; criterion?: string; operator?: "eq" | "neq" | "gte" | "lte" | "gt" | "lt"; query?: string[]; }; export type WebsiteInboxOrders = { orders?: WebsiteInboxOrder[]; }; export type WebsiteInboxOrder = { inbox_id?: string; order?: number; }; /************************************************************************** * CLASSES ***************************************************************************/ /** * Crisp WebsiteInbox Resource */ declare class WebsiteInboxService extends BaseResource { /** * List Inboxes */ listInboxes(websiteID: string, pageNumber?: number): Promise<WebsiteInbox[]>; /** * Batch Order Inboxes */ batchOrderInboxes(websiteID: string, orders: WebsiteInboxOrders): Promise<any>; /** * Create A New Inbox */ createNewInbox(websiteID: string, inbox: WebsiteInbox): Promise<any>; /** * Check If Inbox Exists */ checkInboxExists(websiteID: string, inboxID: string): Promise<any>; /** * Get Inbox */ getInbox(websiteID: string, inboxID: string): Promise<WebsiteInbox>; /** * Save Inbox */ saveInbox(websiteID: string, inboxID: string, inbox: WebsiteInbox): Promise<any>; /** * Delete Inbox */ deleteInbox(websiteID: string, inboxID: string): Promise<any>; } /************************************************************************** * EXPORTS ***************************************************************************/ export default WebsiteInboxService;