import { Subject } from "rxjs"; import { Vnd } from "@dawntech/dwntbots-models/vnd"; import { PartiallyOptional, PartiallyRequiredStrict } from "@dawntech/dwntbots-utils/types"; import { BlipTransport, BlipTransportConfig } from "./BlipTransport"; export interface DateInterval { from?: Date; to: Date; } export interface BlipServiceConfig extends BlipTransportConfig { auto_get: boolean; } export declare type BlipWebhookType = "eventtrackings" | "contacts" | "messages"; export declare class BlipService { private transport; private auto_get; constructor(transport: BlipTransport, config?: Partial); static withHttp(BOT_URL: string, BOT_KEY: string, config?: Partial): BlipService; static withWs(ws$: Subject, config?: Partial): BlipService; static normalizePhoneNumber(phone: string): string; with(config?: Partial): BlipService; withAuthorization(bot_key: string): BlipService; ping(): Promise>; updateContact(contact: PartiallyRequiredStrict, method: Vnd.Lime.Method): Promise>; getContact(identity: string): Promise; getContactContext(identity: string, key?: string | null): Promise>; setContactContext(identity: string, key: string, value: string): Promise; getFlowIdOf(botId: string): Promise; getFlowId(): Promise; getResource(id: string): Promise; updateResource>(id: string, resource: T, type?: string): Promise; getBucket(id: string): Promise; updateBucket>(id: string, resource: T): Promise; changeContactBot(contactIdentity: string, botIdentity: string): Promise; changeContactBotState(contactIdentity: string, botFlowId: string, botStateId?: string): Promise; sendMessage(message: PartiallyOptional, "id" | "to" | "from">, confirmation?: boolean): Promise; createEvent(category: string, action: string, identity?: string, extras?: any): Promise; refreshMedia(url: string): Promise; getAllEvents(interval: DateInterval): Promise>; getEventCategories(interval: DateInterval, skip?: number, take?: number): Promise>; getEventCounters(category: string, interval: DateInterval, skip?: number, take?: number): Promise>; getEventDetails(category: string, action: string, interval: DateInterval, skip?: number, take?: number): Promise>; createIndividualCampaign(name: string, masterState: string, flowId: string, stateId: string, scheduled?: string | null): Promise; createAudianceOnCampaign(campaignId: string, phoneNumber: string, parameters: Array, contact?: { [key: string]: string; }): Promise; setTemplateOnCampaign(campaignId: string, templateName: string, templateLanguage: string, parameters: Array): Promise; dispatchCampaign(campaignId: string): Promise; getCampaignAudienceSummary(campaignId: string): Promise; setWebhookConfig(url: string, active: boolean, types?: Array, headers?: Record): Promise; getTicket(id: string): Promise; getUserMetrics(ISOdate: string, monthly?: boolean): Promise<{ date: string; dau: number; mau: number; deu: number; meu: number; }>; getMessageMetrics(ISOdate: string, monthly?: boolean): Promise<{ date: string; total: number; sent: number; received: number; }>; getBasicMetrics(start: Date, end: Date): Promise<{ dateRange: { start: Date; end: Date; }; contacts: number; messages: { total: number; sent: number; received: number; }; }>; getTicketMetrics(ISOdate: string): Promise<{ date: string; waiting: number; open: number; closed: number; closedAttendant: number; closedClient: number; transferred: number; missed: number; inAttendance: number; }>; jumpToState(identity: string, def: JumpToStateDefinition): Promise; } export interface JumpToStateDefinition { context?: Record; contact?: Partial; message?: { type: string; content: string | Record; }; botIds?: Array; target: { botId: string; stateId: string; }; } export default BlipService;