ysyt-agent-sdk 1.0.119 → 1.0.121

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.
@@ -14,7 +14,6 @@ export declare class SIPClient {
14
14
  private maxReconnectAttempts;
15
15
  private reconnectTimer;
16
16
  private isOffline;
17
- private autoAnswerTimer;
18
17
  private isManuallyStopped;
19
18
  private registerIntervalTimer;
20
19
  private registerInterval;
@@ -22,7 +22,7 @@ declare class YSYTAgentSdk {
22
22
  * @param enableBrowserAlert 是否开启浏览器通知
23
23
  * @param logBuiltinEnabled 是否开启日志
24
24
  */
25
- init({ actionNodeParams, enableBrowserAlert, logBuiltinEnabled, browserAlertTime }: InitInfoType): Promise<void>;
25
+ init({ actionNodeParams, enableBrowserAlert, logBuiltinEnabled, browserAlertTime, initialState, initDevice, }: InitInfoType): Promise<void>;
26
26
  on<K extends keyof Events>(event: K, handler: (data: Events[K]) => void): this;
27
27
  off<K extends keyof Events>(event: K, listener: (msg: Events[K]) => void): void;
28
28
  offAll(): void;
@@ -6,6 +6,7 @@ type InternalState = {
6
6
  sessionId: string;
7
7
  enableBrowserAlert: boolean;
8
8
  autoStateTimer: any;
9
+ autoAnswerTimer: any;
9
10
  logBuiltinEnabled: boolean;
10
11
  browserAlertTime: number;
11
12
  stateObject?: {
@@ -46,6 +46,8 @@ export interface InitInfoType {
46
46
  enableBrowserAlert?: boolean;
47
47
  browserAlertTime?: number;
48
48
  logBuiltinEnabled?: boolean;
49
+ initialState?: AgentStatus.IDLE | AgentStatus.BUSY;
50
+ initDevice?: 1 | 3;
49
51
  actionNodeParams?: {
50
52
  viewHtmlElement?: HTMLElement;
51
53
  rttHTML?: HTMLElement;
@@ -1,3 +1,4 @@
1
+ import { SIPClient } from '@/core/sip-client';
1
2
  type WsResType = {
2
3
  type: number;
3
4
  data: any;
@@ -10,11 +11,16 @@ export declare class ReconnectingWebSocket {
10
11
  private reconnectDelay;
11
12
  private manualClose;
12
13
  private apiClient;
14
+ sipClient: SIPClient | null;
13
15
  private outNumber;
14
16
  private pendingMessages;
15
17
  private constructor();
16
- static getInstance(url?: string): ReconnectingWebSocket;
18
+ static getInstance({ url, sipClient }: {
19
+ url?: string;
20
+ sipClient: SIPClient;
21
+ }): ReconnectingWebSocket;
17
22
  private stateIdleChange;
23
+ inCallAutoAnswer(): void;
18
24
  private getCustomerInfo;
19
25
  private putAgentState;
20
26
  private initWebSocket;