@ujet/websdk-headless 3.4.3 → 3.5.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 +30 -2
- package/dist/index.js +52 -52
- package/dist/index.mjs +4385 -4316
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -135,6 +135,7 @@ interface MenuItem {
|
|
|
135
135
|
enabled: boolean;
|
|
136
136
|
type: string;
|
|
137
137
|
};
|
|
138
|
+
hidden: boolean;
|
|
138
139
|
}
|
|
139
140
|
interface MenuResponse {
|
|
140
141
|
menus: MenuItem[];
|
|
@@ -186,6 +187,9 @@ interface ChatResponse {
|
|
|
186
187
|
external_agent?: VirtualAgent;
|
|
187
188
|
all_agents: HumanAgent[];
|
|
188
189
|
all_virtual_agents: VirtualAgent[];
|
|
190
|
+
post_session_required?: boolean;
|
|
191
|
+
post_session_opt_in_required?: boolean;
|
|
192
|
+
post_session_transfer_status?: string;
|
|
189
193
|
}
|
|
190
194
|
interface ChatDeflectionResponse {
|
|
191
195
|
enabled: boolean;
|
|
@@ -207,6 +211,11 @@ interface MessageResponse {
|
|
|
207
211
|
content?: string;
|
|
208
212
|
event?: string;
|
|
209
213
|
file?: File;
|
|
214
|
+
media_id?: number;
|
|
215
|
+
groupMessageId?: number;
|
|
216
|
+
document?: {
|
|
217
|
+
url: string;
|
|
218
|
+
};
|
|
210
219
|
[key: string]: unknown;
|
|
211
220
|
}
|
|
212
221
|
interface CallResponse {
|
|
@@ -284,6 +293,7 @@ interface TriggerItem {
|
|
|
284
293
|
messages: TriggerMessage[];
|
|
285
294
|
visitor_type: string;
|
|
286
295
|
page_visit_count: number;
|
|
296
|
+
lang?: string;
|
|
287
297
|
keywords_included?: string[];
|
|
288
298
|
keywords_excluded?: string[];
|
|
289
299
|
}
|
|
@@ -382,6 +392,13 @@ interface CobrowseOption {
|
|
|
382
392
|
unredactedViews?: string[];
|
|
383
393
|
}
|
|
384
394
|
|
|
395
|
+
declare enum PostSessionStatus {
|
|
396
|
+
WAITING = "waiting",
|
|
397
|
+
READY = "ready",
|
|
398
|
+
IN_PROGRESS = "in_progress",
|
|
399
|
+
FINISHED = "finished"
|
|
400
|
+
}
|
|
401
|
+
|
|
385
402
|
declare class EventManager {
|
|
386
403
|
private handlers;
|
|
387
404
|
addEventListener(eventName: string, handler: EventHandler): void;
|
|
@@ -407,6 +424,8 @@ declare class Chat {
|
|
|
407
424
|
get channelId(): string;
|
|
408
425
|
get lang(): string;
|
|
409
426
|
get virtual(): boolean;
|
|
427
|
+
get muted(): boolean;
|
|
428
|
+
set muted(muted: boolean);
|
|
410
429
|
get agent(): VirtualAgent | HumanAgent;
|
|
411
430
|
get allAgents(): {
|
|
412
431
|
virtual: VirtualAgent[];
|
|
@@ -414,6 +433,7 @@ declare class Chat {
|
|
|
414
433
|
};
|
|
415
434
|
get userIdentity(): string;
|
|
416
435
|
get status(): string;
|
|
436
|
+
get postSessionStatus(): string;
|
|
417
437
|
get statusText(): string;
|
|
418
438
|
get cobrowsable(): boolean;
|
|
419
439
|
get ongoing(): boolean;
|
|
@@ -424,6 +444,9 @@ declare class Chat {
|
|
|
424
444
|
get createdAt(): string;
|
|
425
445
|
get inTask(): boolean;
|
|
426
446
|
get feedbackType(): 'survey' | 'rate' | 'none';
|
|
447
|
+
get optInRequired(): boolean;
|
|
448
|
+
get postSessionRequired(): boolean;
|
|
449
|
+
get postSessionInProgress(): boolean;
|
|
427
450
|
update(state: ChatResponse): void;
|
|
428
451
|
on(eventName: string, handler: EventHandler): void;
|
|
429
452
|
off(eventName: string, handler: EventHandler): void;
|
|
@@ -434,8 +457,10 @@ declare class Chat {
|
|
|
434
457
|
fetchMessages(): Promise<MessageResponse[]>;
|
|
435
458
|
startTyping(): void;
|
|
436
459
|
stopTyping(): void;
|
|
460
|
+
saveMedia(index: number, file: File): void;
|
|
437
461
|
destroy(): Promise<void>;
|
|
438
462
|
clearMediaStore(): Promise<void>;
|
|
463
|
+
_handleChatEndedEvent(message: MessageResponse): void;
|
|
439
464
|
private triggerEvent;
|
|
440
465
|
private registerMessageEvents;
|
|
441
466
|
}
|
|
@@ -480,7 +505,7 @@ declare class Client {
|
|
|
480
505
|
off(eventName: string, handler: EventHandler): void;
|
|
481
506
|
_triggerEvent(eventName: string, data?: any): void;
|
|
482
507
|
getCompany(): Promise<CompanyResponse>;
|
|
483
|
-
runTrigger(cb: (trigger: TriggerItem) => void
|
|
508
|
+
runTrigger(cb: (trigger: TriggerItem) => void): Promise<void>;
|
|
484
509
|
trackClientEvents(events: ClientEvent[]): Promise<RequestReturn>;
|
|
485
510
|
getProhibitedFileTypes(): Promise<FileTypeItem[]>;
|
|
486
511
|
getMenus(key?: string, lang?: string): Promise<MenuResponse>;
|
|
@@ -497,6 +522,7 @@ declare class Client {
|
|
|
497
522
|
resumeChat(chatId: number | string): Promise<Chat>;
|
|
498
523
|
loadOngoingChat(): Promise<Chat>;
|
|
499
524
|
finishChat(): Promise<void>;
|
|
525
|
+
updatePostSession(postSessionStatus: PostSessionStatus): Promise<void>;
|
|
500
526
|
destroyChat(): Promise<void>;
|
|
501
527
|
getChatDeflection(): Promise<ChatDeflectionResponse | null>;
|
|
502
528
|
sendChatTranscripts(emails: string[]): Promise<RequestReturn>;
|
|
@@ -514,6 +540,7 @@ declare class Client {
|
|
|
514
540
|
sendTextMessage(content: string): Promise<number>;
|
|
515
541
|
createCobrowseCode(lang?: string, customData?: Record<string, string>): Promise<string>;
|
|
516
542
|
startCobrowse(from?: string): Promise<void>;
|
|
543
|
+
getMessageAttachment(message: MessageResponse): Promise<File>;
|
|
517
544
|
private initializeCobrowse;
|
|
518
545
|
private registerOngoingChat;
|
|
519
546
|
}
|
|
@@ -526,6 +553,7 @@ declare abstract class BaseProvider {
|
|
|
526
553
|
channelId: string;
|
|
527
554
|
region?: string;
|
|
528
555
|
inTask: boolean;
|
|
556
|
+
muted: boolean;
|
|
529
557
|
events: EventManager;
|
|
530
558
|
constructor(events: EventManager, state: ChatResponse, issueChatToken: IssueChatTokenMethod);
|
|
531
559
|
ping(): void;
|
|
@@ -590,4 +618,4 @@ declare const OPTIONS: {
|
|
|
590
618
|
version: string;
|
|
591
619
|
};
|
|
592
620
|
|
|
593
|
-
export { BaseProvider, type CallRequest, type CallResponse, Chat, type ChatDeflectionResponse, type ChatEndUserEventRequest, type ChatHistoryItem, type ChatHistoryResponse, 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 EscalateRequest, type EventHandler, EventManager, type FileTypeItem, type FormData, 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 QuestionItem, type RateRequest, type RequestMethod, type RequestReturn, type SurveyAnswers, type TokenResponse, type TriggerItem, type TriggerMessage, type UserProfile, VERSION, type VirtualAgent, type WaitTimeResponse, addProviderType, consoleLoggerHandler };
|
|
621
|
+
export { BaseProvider, type CallRequest, type CallResponse, Chat, type ChatDeflectionResponse, type ChatEndUserEventRequest, type ChatHistoryItem, type ChatHistoryResponse, 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 EscalateRequest, type EventHandler, EventManager, type FileTypeItem, type FormData, 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, 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 };
|