@ujet/websdk-headless 3.37.4 → 3.39.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/README.md +7 -851
- package/dist/index.d.ts +98 -85
- package/dist/index.js +128 -91
- package/dist/index.mjs +16881 -15958
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -200,89 +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
|
-
|
|
256
|
+
event?: string;
|
|
257
|
+
file?: File;
|
|
258
|
+
groupMessageId?: number;
|
|
259
|
+
media_id?: number;
|
|
231
260
|
message?: {
|
|
232
261
|
messages: string[];
|
|
233
262
|
type: any;
|
|
234
263
|
};
|
|
264
|
+
type: string;
|
|
265
|
+
unredacted?: string;
|
|
235
266
|
[key: string]: unknown;
|
|
236
267
|
}
|
|
237
|
-
interface
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
menu_id: number;
|
|
268
|
+
interface PdfStatusResponse {
|
|
269
|
+
body?: File;
|
|
270
|
+
failed_reason?: string;
|
|
241
271
|
status: string;
|
|
242
|
-
type: string;
|
|
243
|
-
scheduled_at?: string;
|
|
244
|
-
recording_permitted: boolean;
|
|
245
|
-
survey_enabled: boolean;
|
|
246
|
-
created_at: string;
|
|
247
|
-
menus: {
|
|
248
|
-
id: number;
|
|
249
|
-
name: string;
|
|
250
|
-
}[];
|
|
251
|
-
}
|
|
252
|
-
interface FileTypeItem {
|
|
253
|
-
description: string;
|
|
254
|
-
extension: string;
|
|
255
|
-
}
|
|
256
|
-
interface QuestionItem {
|
|
257
|
-
id: number;
|
|
258
|
-
type: 'csat' | 'star' | 'free-form' | 'scale' | 'enumeration';
|
|
259
|
-
display_text: string;
|
|
260
|
-
name?: string;
|
|
261
|
-
is_csat?: boolean;
|
|
262
|
-
position?: number;
|
|
263
|
-
valid_answers?: {
|
|
264
|
-
key: string;
|
|
265
|
-
value: string;
|
|
266
|
-
}[];
|
|
267
|
-
}
|
|
268
|
-
interface ChatSurveyResponse {
|
|
269
|
-
id?: number;
|
|
270
|
-
lang?: string;
|
|
271
|
-
sign_off_display_text: string;
|
|
272
|
-
questions: QuestionItem[];
|
|
273
272
|
}
|
|
274
273
|
interface ChatTaskMessageResponse {
|
|
274
|
+
content: any;
|
|
275
275
|
id: number;
|
|
276
|
-
task_va_id: number;
|
|
277
276
|
participant_id: number;
|
|
278
|
-
|
|
277
|
+
task_va_id: number;
|
|
279
278
|
}
|
|
280
279
|
interface ChatHistoryItem {
|
|
281
|
-
comm_id: number;
|
|
282
280
|
assigned_at: string;
|
|
281
|
+
comm_id: number;
|
|
283
282
|
comm_type: string;
|
|
284
|
-
timezone: string;
|
|
285
283
|
entries: MessageResponse[];
|
|
284
|
+
timezone: string;
|
|
286
285
|
[key: string]: unknown;
|
|
287
286
|
}
|
|
288
287
|
interface ChatHistoryResponse {
|
|
@@ -294,9 +293,9 @@ interface ChatHistoryResponse {
|
|
|
294
293
|
};
|
|
295
294
|
}
|
|
296
295
|
interface UserProfile {
|
|
296
|
+
email?: string;
|
|
297
297
|
identifier?: string;
|
|
298
298
|
name?: string;
|
|
299
|
-
email?: string;
|
|
300
299
|
}
|
|
301
300
|
interface TriggerMessage {
|
|
302
301
|
lang: string;
|
|
@@ -304,20 +303,34 @@ interface TriggerMessage {
|
|
|
304
303
|
}
|
|
305
304
|
interface TriggerItem {
|
|
306
305
|
id: number;
|
|
306
|
+
keywords_excluded?: string[];
|
|
307
|
+
keywords_excluded_or?: string[][];
|
|
308
|
+
keywords_included?: string[];
|
|
309
|
+
keywords_included_or?: string[][];
|
|
310
|
+
lang?: string;
|
|
307
311
|
menu_id: number;
|
|
308
|
-
stay_time: number;
|
|
309
312
|
messages: TriggerMessage[];
|
|
310
|
-
visitor_type: string;
|
|
311
313
|
page_visit_count: number;
|
|
314
|
+
stay_time: number;
|
|
315
|
+
visitor_type: string;
|
|
316
|
+
}
|
|
317
|
+
interface ChatSurveyResponse {
|
|
318
|
+
id?: number;
|
|
312
319
|
lang?: string;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
keywords_included_or?: string[][];
|
|
316
|
-
keywords_excluded_or?: string[][];
|
|
320
|
+
questions: QuestionItem[];
|
|
321
|
+
sign_off_display_text: string;
|
|
317
322
|
}
|
|
318
|
-
interface
|
|
319
|
-
|
|
320
|
-
|
|
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
|
+
}[];
|
|
321
334
|
}
|
|
322
335
|
|
|
323
336
|
type RequestMethod = (url: string, options: RequestInit | Record<string, any>) => Promise<RequestReturn>;
|
|
@@ -414,13 +427,6 @@ interface CobrowseOption {
|
|
|
414
427
|
unredactedViews?: string[];
|
|
415
428
|
}
|
|
416
429
|
|
|
417
|
-
declare enum PostSessionStatus {
|
|
418
|
-
WAITING = "waiting",
|
|
419
|
-
READY = "ready",
|
|
420
|
-
IN_PROGRESS = "in_progress",
|
|
421
|
-
FINISHED = "finished"
|
|
422
|
-
}
|
|
423
|
-
|
|
424
430
|
declare class EventManager {
|
|
425
431
|
private handlers;
|
|
426
432
|
addEventListener(eventName: string, handler: EventHandler): void;
|
|
@@ -488,6 +494,13 @@ declare class Chat {
|
|
|
488
494
|
private registerMessageEvents;
|
|
489
495
|
}
|
|
490
496
|
|
|
497
|
+
declare enum PostSessionStatus {
|
|
498
|
+
WAITING = "waiting",
|
|
499
|
+
READY = "ready",
|
|
500
|
+
IN_PROGRESS = "in_progress",
|
|
501
|
+
FINISHED = "finished"
|
|
502
|
+
}
|
|
503
|
+
|
|
491
504
|
declare class Cobrowse {
|
|
492
505
|
private _cobrowse;
|
|
493
506
|
private _options;
|
|
@@ -518,7 +531,7 @@ declare class Client {
|
|
|
518
531
|
private events;
|
|
519
532
|
request: RequestMethod;
|
|
520
533
|
chat: Chat;
|
|
521
|
-
cobrowse: Cobrowse;
|
|
534
|
+
cobrowse: Cobrowse | null;
|
|
522
535
|
constructor(options: ClientOption);
|
|
523
536
|
get deviceId(): string;
|
|
524
537
|
get user(): UserProfile;
|
|
@@ -527,38 +540,37 @@ declare class Client {
|
|
|
527
540
|
destroy(): void;
|
|
528
541
|
on(eventName: string, handler: EventHandler): void;
|
|
529
542
|
off(eventName: string, handler: EventHandler): void;
|
|
530
|
-
_triggerEvent(eventName: string, data?: any): 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[]): Promise<
|
|
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): Promise<
|
|
557
|
-
sendChatRate(data: RateRequest): Promise<
|
|
558
|
-
escalateChat(data?: EscalateRequest): Promise<
|
|
559
|
-
trackChatEscalation(escalationId: number, channel: string): Promise<
|
|
560
|
-
trackChatEndUserEvent(data: ChatEndUserEventRequest): Promise<
|
|
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,10 +578,11 @@ 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;
|
|
585
|
+
_triggerEvent(eventName: string, data?: any): void;
|
|
573
586
|
}
|
|
574
587
|
|
|
575
588
|
declare abstract class BaseProvider {
|
|
@@ -646,4 +659,4 @@ declare const OPTIONS: {
|
|
|
646
659
|
version: string;
|
|
647
660
|
};
|
|
648
661
|
|
|
649
|
-
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 };
|