@ujet/websdk-headless 3.38.4 → 3.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +90 -78
- package/dist/index.js +128 -91
- package/dist/index.mjs +15431 -14491
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -200,90 +200,88 @@ interface ChatResponse {
|
|
|
200
200
|
post_session_opt_in_required?: boolean;
|
|
201
201
|
post_session_transfer_status?: string;
|
|
202
202
|
}
|
|
203
|
+
interface CallResponse {
|
|
204
|
+
created_at: string;
|
|
205
|
+
id: number;
|
|
206
|
+
lang: string;
|
|
207
|
+
menu_id: number;
|
|
208
|
+
menus: {
|
|
209
|
+
id: number;
|
|
210
|
+
name: string;
|
|
211
|
+
}[];
|
|
212
|
+
recording_permitted: boolean;
|
|
213
|
+
scheduled_at?: string;
|
|
214
|
+
status: string;
|
|
215
|
+
survey_enabled: boolean;
|
|
216
|
+
type: string;
|
|
217
|
+
}
|
|
203
218
|
interface ChatDeflectionResponse {
|
|
204
|
-
enabled: boolean;
|
|
205
|
-
threshold: number;
|
|
206
219
|
email: boolean;
|
|
207
|
-
|
|
220
|
+
enabled: boolean;
|
|
208
221
|
external_deflection_links: {
|
|
209
222
|
enabled: boolean;
|
|
210
223
|
ids: number[];
|
|
211
224
|
};
|
|
225
|
+
keep_waiting: boolean;
|
|
226
|
+
threshold: number;
|
|
227
|
+
}
|
|
228
|
+
interface EmailResponse {
|
|
229
|
+
attachment_count: number;
|
|
230
|
+
id: number;
|
|
231
|
+
fail_reason: string;
|
|
232
|
+
status: string;
|
|
233
|
+
type: string;
|
|
234
|
+
}
|
|
235
|
+
interface FileTypeItem {
|
|
236
|
+
description: string;
|
|
237
|
+
extension: string;
|
|
238
|
+
}
|
|
239
|
+
interface GenerateTranscriptResponse {
|
|
240
|
+
chat_transcript_id: number;
|
|
241
|
+
status: string;
|
|
212
242
|
}
|
|
213
243
|
interface MessageResponse {
|
|
214
244
|
$index: number;
|
|
215
245
|
$sid: string;
|
|
216
246
|
$timestamp: Date;
|
|
217
|
-
$userType: string;
|
|
218
247
|
$userId: number;
|
|
219
|
-
|
|
248
|
+
$userType: string;
|
|
249
|
+
buttons?: {
|
|
250
|
+
title: string;
|
|
251
|
+
}[];
|
|
220
252
|
content?: string;
|
|
221
|
-
event?: string;
|
|
222
|
-
file?: File;
|
|
223
|
-
media_id?: number;
|
|
224
|
-
groupMessageId?: number;
|
|
225
253
|
document?: {
|
|
226
254
|
url: string;
|
|
227
255
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
256
|
+
event?: string;
|
|
257
|
+
file?: File;
|
|
258
|
+
groupMessageId?: number;
|
|
259
|
+
media_id?: number;
|
|
232
260
|
message?: {
|
|
233
261
|
messages: string[];
|
|
234
262
|
type: any;
|
|
235
263
|
};
|
|
264
|
+
type: string;
|
|
265
|
+
unredacted?: string;
|
|
236
266
|
[key: string]: unknown;
|
|
237
267
|
}
|
|
238
|
-
interface
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
menu_id: number;
|
|
268
|
+
interface PdfStatusResponse {
|
|
269
|
+
body?: File;
|
|
270
|
+
failed_reason?: string;
|
|
242
271
|
status: string;
|
|
243
|
-
type: string;
|
|
244
|
-
scheduled_at?: string;
|
|
245
|
-
recording_permitted: boolean;
|
|
246
|
-
survey_enabled: boolean;
|
|
247
|
-
created_at: string;
|
|
248
|
-
menus: {
|
|
249
|
-
id: number;
|
|
250
|
-
name: string;
|
|
251
|
-
}[];
|
|
252
|
-
}
|
|
253
|
-
interface FileTypeItem {
|
|
254
|
-
description: string;
|
|
255
|
-
extension: string;
|
|
256
|
-
}
|
|
257
|
-
interface QuestionItem {
|
|
258
|
-
id: number;
|
|
259
|
-
type: 'csat' | 'star' | 'free-form' | 'scale' | 'enumeration';
|
|
260
|
-
display_text: string;
|
|
261
|
-
name?: string;
|
|
262
|
-
is_csat?: boolean;
|
|
263
|
-
position?: number;
|
|
264
|
-
valid_answers?: {
|
|
265
|
-
key: string;
|
|
266
|
-
value: string;
|
|
267
|
-
}[];
|
|
268
|
-
}
|
|
269
|
-
interface ChatSurveyResponse {
|
|
270
|
-
id?: number;
|
|
271
|
-
lang?: string;
|
|
272
|
-
sign_off_display_text: string;
|
|
273
|
-
questions: QuestionItem[];
|
|
274
272
|
}
|
|
275
273
|
interface ChatTaskMessageResponse {
|
|
274
|
+
content: any;
|
|
276
275
|
id: number;
|
|
277
|
-
task_va_id: number;
|
|
278
276
|
participant_id: number;
|
|
279
|
-
|
|
277
|
+
task_va_id: number;
|
|
280
278
|
}
|
|
281
279
|
interface ChatHistoryItem {
|
|
282
|
-
comm_id: number;
|
|
283
280
|
assigned_at: string;
|
|
281
|
+
comm_id: number;
|
|
284
282
|
comm_type: string;
|
|
285
|
-
timezone: string;
|
|
286
283
|
entries: MessageResponse[];
|
|
284
|
+
timezone: string;
|
|
287
285
|
[key: string]: unknown;
|
|
288
286
|
}
|
|
289
287
|
interface ChatHistoryResponse {
|
|
@@ -295,9 +293,9 @@ interface ChatHistoryResponse {
|
|
|
295
293
|
};
|
|
296
294
|
}
|
|
297
295
|
interface UserProfile {
|
|
296
|
+
email?: string;
|
|
298
297
|
identifier?: string;
|
|
299
298
|
name?: string;
|
|
300
|
-
email?: string;
|
|
301
299
|
}
|
|
302
300
|
interface TriggerMessage {
|
|
303
301
|
lang: string;
|
|
@@ -305,20 +303,34 @@ interface TriggerMessage {
|
|
|
305
303
|
}
|
|
306
304
|
interface TriggerItem {
|
|
307
305
|
id: number;
|
|
306
|
+
keywords_excluded?: string[];
|
|
307
|
+
keywords_excluded_or?: string[][];
|
|
308
|
+
keywords_included?: string[];
|
|
309
|
+
keywords_included_or?: string[][];
|
|
310
|
+
lang?: string;
|
|
308
311
|
menu_id: number;
|
|
309
|
-
stay_time: number;
|
|
310
312
|
messages: TriggerMessage[];
|
|
311
|
-
visitor_type: string;
|
|
312
313
|
page_visit_count: number;
|
|
314
|
+
stay_time: number;
|
|
315
|
+
visitor_type: string;
|
|
316
|
+
}
|
|
317
|
+
interface ChatSurveyResponse {
|
|
318
|
+
id?: number;
|
|
313
319
|
lang?: string;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
keywords_included_or?: string[][];
|
|
317
|
-
keywords_excluded_or?: string[][];
|
|
320
|
+
questions: QuestionItem[];
|
|
321
|
+
sign_off_display_text: string;
|
|
318
322
|
}
|
|
319
|
-
interface
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
interface QuestionItem {
|
|
324
|
+
display_text: string;
|
|
325
|
+
id: number;
|
|
326
|
+
is_csat?: boolean;
|
|
327
|
+
name?: string;
|
|
328
|
+
position?: number;
|
|
329
|
+
type: 'csat' | 'star' | 'free-form' | 'scale' | 'enumeration';
|
|
330
|
+
valid_answers?: {
|
|
331
|
+
key: string;
|
|
332
|
+
value: string;
|
|
333
|
+
}[];
|
|
322
334
|
}
|
|
323
335
|
|
|
324
336
|
type RequestMethod = (url: string, options: RequestInit | Record<string, any>) => Promise<RequestReturn>;
|
|
@@ -519,7 +531,7 @@ declare class Client {
|
|
|
519
531
|
private events;
|
|
520
532
|
request: RequestMethod;
|
|
521
533
|
chat: Chat;
|
|
522
|
-
cobrowse: Cobrowse;
|
|
534
|
+
cobrowse: Cobrowse | null;
|
|
523
535
|
constructor(options: ClientOption);
|
|
524
536
|
get deviceId(): string;
|
|
525
537
|
get user(): UserProfile;
|
|
@@ -530,35 +542,35 @@ declare class Client {
|
|
|
530
542
|
off(eventName: string, handler: EventHandler): void;
|
|
531
543
|
getCompany(): Promise<CompanyResponse>;
|
|
532
544
|
runTrigger(cb: (trigger: TriggerItem) => void): Promise<void>;
|
|
533
|
-
trackClientEvents(events: ClientEvent[]): Promise<
|
|
545
|
+
trackClientEvents(events: ClientEvent[]): Promise<void>;
|
|
534
546
|
getProhibitedFileTypes(): Promise<FileTypeItem[]>;
|
|
535
547
|
getMenus(key?: string, lang?: string): Promise<MenuResponse>;
|
|
536
548
|
getAfterHourMessage(lang?: string): Promise<string>;
|
|
537
549
|
getTimeSlots(menuId: number | string, lang?: string): Promise<string[]>;
|
|
538
|
-
getWaitTimes(menuId: number | string, lang?: string): Promise<WaitTimeResponse>;
|
|
550
|
+
getWaitTimes(menuId: number | string, lang?: string): Promise<WaitTimeResponse | null>;
|
|
539
551
|
verifyForm(data: FormData): Promise<boolean>;
|
|
540
552
|
createCall(menuId: number | string, data: CallRequest): Promise<CallResponse>;
|
|
541
553
|
loadCall(callId: number | string): Promise<CallResponse>;
|
|
542
554
|
cancelCall(callId: number | string): Promise<CallResponse>;
|
|
543
|
-
createEmail(menuId: number | string, data: EmailRequest): Promise<
|
|
555
|
+
createEmail(menuId: number | string, data: EmailRequest): Promise<EmailResponse>;
|
|
544
556
|
createChat(menuId: number | string, data?: ChatRequest): Promise<Chat>;
|
|
545
557
|
loadChat(chatId: number | string): Promise<Chat>;
|
|
546
558
|
resumeChat(chatId: number | string): Promise<Chat>;
|
|
547
|
-
loadOngoingChat(): Promise<Chat>;
|
|
559
|
+
loadOngoingChat(): Promise<Chat | null>;
|
|
548
560
|
finishChat(): Promise<void>;
|
|
549
561
|
updatePostSession(postSessionStatus: PostSessionStatus): Promise<void>;
|
|
550
562
|
destroyChat(): Promise<void>;
|
|
551
563
|
getChatDeflection(): Promise<ChatDeflectionResponse | null>;
|
|
552
|
-
sendChatTranscripts(emails: string[]): void
|
|
553
|
-
downloadChatTranscript(): Promise<
|
|
564
|
+
sendChatTranscripts(emails: string[]): Promise<void>;
|
|
565
|
+
downloadChatTranscript(): Promise<GenerateTranscriptResponse>;
|
|
554
566
|
getPdfStatus(id: number): Promise<RequestReturn>;
|
|
555
|
-
getChatSurvey(): Promise<ChatSurveyResponse>;
|
|
556
|
-
sendChatSurvey(answers: SurveyAnswers): void
|
|
557
|
-
sendChatRate(data: RateRequest): void
|
|
558
|
-
escalateChat(data?: EscalateRequest): void
|
|
559
|
-
trackChatEscalation(escalationId: number, channel: string): void
|
|
560
|
-
trackChatEndUserEvent(data: ChatEndUserEventRequest): void
|
|
561
|
-
getChatHistory(page?: number): Promise<ChatHistoryResponse>;
|
|
567
|
+
getChatSurvey(): Promise<ChatSurveyResponse | null>;
|
|
568
|
+
sendChatSurvey(answers: SurveyAnswers): Promise<void>;
|
|
569
|
+
sendChatRate(data: RateRequest): Promise<void>;
|
|
570
|
+
escalateChat(data?: EscalateRequest): Promise<void>;
|
|
571
|
+
trackChatEscalation(escalationId: number, channel: string): Promise<void>;
|
|
572
|
+
trackChatEndUserEvent(data: ChatEndUserEventRequest): Promise<void>;
|
|
573
|
+
getChatHistory(page?: number): Promise<ChatHistoryResponse | null>;
|
|
562
574
|
fetchMessages(): Promise<MessageResponse[]>;
|
|
563
575
|
sendFileMessage(file: File): Promise<number>;
|
|
564
576
|
sendTextMessage(rawContent: string): Promise<void>;
|
|
@@ -566,7 +578,7 @@ declare class Client {
|
|
|
566
578
|
private isRedactionAgentEnabled;
|
|
567
579
|
createCobrowseCode(lang?: string, customData?: Record<string, string>): Promise<string>;
|
|
568
580
|
startCobrowse(from?: string): Promise<void>;
|
|
569
|
-
getMessageAttachment(message: MessageResponse): Promise<File>;
|
|
581
|
+
getMessageAttachment(message: MessageResponse): Promise<File | null>;
|
|
570
582
|
private initializeCobrowse;
|
|
571
583
|
private registerOngoingChat;
|
|
572
584
|
private getCobrowseScript;
|
|
@@ -647,4 +659,4 @@ declare const OPTIONS: {
|
|
|
647
659
|
version: string;
|
|
648
660
|
};
|
|
649
661
|
|
|
650
|
-
export { BaseProvider, type CallRequest, type CallResponse, Chat, type ChatDeflectionResponse, type ChatEndUserEventRequest, type ChatHistoryItem, type ChatHistoryResponse, type ChatMessageRequest, type
|
|
662
|
+
export { BaseProvider, type CallRequest, type CallResponse, Chat, type ChatDeflectionResponse, type ChatEndUserEventRequest, type ChatHistoryItem, type ChatHistoryResponse, type ChatMessageRequest, type ChatRequest, type ChatResponse, type ChatSurveyResponse, type ChatTaskMessageResponse, Client, type ClientEvent, type ClientOption, type CobrowseMessages, type CobrowseOption, type CobrowseRequest, type CompanyResponse, type ConnectCallback, type ConnectOption, type ConnectRequest, type ConnectResult, ENVIRONMENT, type EmailRequest, type EmailResponse, type EscalateRequest, type EventHandler, EventManager, type FileTypeItem, type FormData, type GenerateTranscriptResponse, type GetServerMessage, type HumanAgent, type IssueChatTokenMethod, type LanguageOption, type LogData, Logger, type LoggerHandler, MediaStore, type MenuChannel, type MenuItem, type MenuResponse, type MessageRequest, type MessageResponse, OPTIONS, type PdfStatusResponse, PostSessionStatus, type QuestionItem, type RateRequest, type RequestMethod, type RequestReturn, type SurveyAnswers, type TokenResponse, type TriggerItem, type TriggerMessage, type UserProfile, VERSION, type VirtualAgent, type WaitTimeResponse, addProviderType, consoleLoggerHandler };
|