@ujet/websdk-headless 3.4.2 → 3.5.0

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