@saysimple/node-sdk
Version:
The official SaySimple Node SDK. Want to use our awesome customer conversations platform? Please visit: https://saysimple.com
103 lines (102 loc) • 4.77 kB
TypeScript
import { Domain } from "../domain";
import { HttpClientInterface } from "../../types/base/http-client-interface";
import { MetricDataResponseInterface } from "../../types/responses/intelligence/metric-data-response-interface";
import { Response } from "../../base/response";
import { AgentList } from "../../types/responses/intelligence/list-agents-response";
import { TagList } from "../../types/responses/intelligence/list-tags-response";
import { ListChannelsResponseInterface } from "../../types/responses/intelligence/list-channels-response";
export declare class Intelligence extends Domain {
readonly VERSION: string;
constructor(httpClient: HttpClientInterface);
addMessage(opts?: AddMessageParametersInterface): Promise<Response<{
statusCode: 201;
body: "";
}>>;
private getData;
getMessagesSummed(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getActiveContactsSummed(opts?: MetricConversationParametersInterface): Promise<MetricDataResponseInterface>;
getActiveContactsDistribution(opts?: MetricConversationParametersInterface): Promise<MetricDataResponseInterface>;
getSentPaidTemplatesSummed(opts?: MetricParametersInterface): Promise<MetricDataResponseInterface>;
getAgents(): Promise<Response<AgentList>>;
getChannels(): Promise<Response<ListChannelsResponseInterface[]>>;
getTags(): Promise<Response<TagList>>;
getTeams(): Promise<Response<TagList>>;
getMessageDistribution(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsResolved(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsUnique(opts?: MetricUniqueConversationParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsResolveTimesAverage(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsResolveTimesMedian(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
resolveConversation(opts?: ResolveConversationInterface): Promise<Response<{
statusCode: 201;
body: "";
}>>;
getConversationsFirstReplyTimesAverage(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsFirstReplyTimesMedian(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsFirstReplyTimesBusinessHoursAverage(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsFirstReplyTimesBusinessHoursMedian(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsMessagesAverage(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getConversationsTagsUsed(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
getMessagesResponseTimesAverage(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>;
}
interface MetricParametersInterface {
between?: Date | string;
and?: Date | string;
agent?: "*" | string[];
channel?: "*" | string[];
tag?: "*" | string[];
provider?: "*" | string[];
identifier?: "*" | string[];
conversation?: "*" | string[];
}
export interface MetricMessageParametersInterface extends MetricParametersInterface {
direction?: "IN" | "in" | "OUT" | "out" | "ALL" | "all";
}
export interface MetricConversationParametersInterface extends MetricParametersInterface {
unique?: boolean;
}
export interface MetricUniqueConversationParametersInterface extends MetricParametersInterface {
initiatedBy?: "USER" | "BUSINESS" | "user" | "business";
}
interface mediaMessage {
type: "IMAGE" | "VIDEO" | "AUDIO" | "DOCUMENT" | "OTHER";
url: string;
[metaData: string]: any;
}
export interface AddMessageParametersInterface {
tenant: string;
direction: "IN" | "OUT" | "in" | "out";
channel: string;
tenantChannelIdentifier: string;
customerChannelIdentifier: string;
message: {
textContent?: string;
media?: mediaMessage[];
[metaData: string]: any;
};
time?: Date | string;
provider: string;
actor?: string;
agent?: string;
tags?: string[];
conversation?: string;
businessHours?: {
0: string[];
1: string[];
2: string[];
3: string[];
4: string[];
5: string[];
6: string[];
};
timeZone?: string;
}
export interface ResolveConversationInterface {
channel: string;
tenantChannelIdentifier: string;
provider: string;
agent?: string;
tags?: string[];
time: Date | string;
conversation: string;
}
export {};