ysyt-agent-sdk 1.0.83 → 1.0.84

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.
@@ -27,4 +27,9 @@ export declare class ApiClient {
27
27
  setAgentExplicit(params: RequestBodyType<{
28
28
  number: string;
29
29
  }>): Promise<void>;
30
+ checkAgentLogin(params: RequestBodyType<{
31
+ agent_no: string;
32
+ }, {
33
+ is_login: boolean;
34
+ }>): Promise<void>;
30
35
  }
@@ -33,6 +33,7 @@ export declare class PhoneView {
33
33
  customerInfo: CallCrmObject;
34
34
  transferType: string;
35
35
  selectNumber: string;
36
+ isLoad: boolean;
36
37
  constructor({ container, rttHTML, statusParams }: Props, VoiceSDKInstance: YSYTAgentSdk, callApi: CallApi);
37
38
  private play;
38
39
  private playFromStart;
@@ -7,7 +7,12 @@ declare class YSYTAgentSdk {
7
7
  private constructor();
8
8
  static get instance(): YSYTAgentSdk;
9
9
  static destroyInstance(): Promise<void>;
10
- static getInstance(): YSYTAgentSdk;
10
+ static getInstance({ url, appKey, appSecret, agentNo, }: {
11
+ url?: string;
12
+ appKey: string;
13
+ appSecret: string;
14
+ agentNo: string;
15
+ }): YSYTAgentSdk;
11
16
  getInit(): boolean;
12
17
  initWebRtc(): Promise<void>;
13
18
  /**
@@ -20,7 +25,7 @@ declare class YSYTAgentSdk {
20
25
  * @param enableBrowserAlert 是否开启浏览器通知
21
26
  * @param logBuiltinEnabled 是否开启日志
22
27
  */
23
- init({ actionNodeParams, url, appKey, appSecret, agentNo, enableBrowserAlert, logBuiltinEnabled, }: InitInfoType): Promise<void>;
28
+ init({ actionNodeParams, enableBrowserAlert, logBuiltinEnabled }: InitInfoType): Promise<void>;
24
29
  on<K extends keyof Events>(event: K, handler: (data: Events[K]) => void): this;
25
30
  off<K extends keyof Events>(event: K, listener: (msg: Events[K]) => void): void;
26
31
  offAll(): void;
@@ -57,6 +62,11 @@ declare class YSYTAgentSdk {
57
62
  setAgentExplicit: (params: RequestBodyType<{
58
63
  number: string;
59
64
  }>) => Promise<void>;
65
+ checkAgentLogin: (params: RequestBodyType<{
66
+ agent_no: string;
67
+ }, {
68
+ is_login: boolean;
69
+ }>) => Promise<void>;
60
70
  };
61
71
  getAgentData(): AgentDataType;
62
72
  }
@@ -103,7 +103,8 @@ export declare enum WebsocketTypeEnum {
103
103
  TRANSFER_FAILED = 128,
104
104
  TRANSFER_INCOMING_CALL = 129,
105
105
  TRANSFER_OFF_HOOK = 130,
106
- AGENT_HANGUP = 131
106
+ AGENT_HANGUP = 131,
107
+ KICK_OFFLINE = 132
107
108
  }
108
109
  export declare enum EventName {
109
110
  EVENT_ALL = "event_all",
@@ -113,7 +114,8 @@ export declare enum EventName {
113
114
  AGENT_INIT_STATUS = "agent_init_status",
114
115
  WEBSITE_DELAY = "website_delay",
115
116
  SELECT_EXTERNAL_NUMBER = "select_external_number",
116
- FAIL_NOTIFICATION = "fail_notification"
117
+ FAIL_NOTIFICATION = "fail_notification",
118
+ KICK_OFF = "kick_off"
117
119
  }
118
120
  export declare enum DisplayTextEnum {
119
121
  RINGING = "\u5BA2\u6237\u632F\u94C3",
@@ -35,10 +35,6 @@ export interface CallInfoType {
35
35
  selectOutNumber: string;
36
36
  }
37
37
  export interface InitInfoType {
38
- url?: string;
39
- appKey: string;
40
- appSecret: string;
41
- agentNo: string;
42
38
  enableBrowserAlert?: boolean;
43
39
  logBuiltinEnabled?: boolean;
44
40
  actionNodeParams?: {
@@ -164,6 +160,7 @@ type EventObject<T> = {
164
160
  };
165
161
  export interface Events {
166
162
  [EventName.AGENT_INIT_STATUS]: boolean;
163
+ [EventName.KICK_OFF]: unknown;
167
164
  [CallSipCallEvent.CALL_PROGRESS]: string;
168
165
  [WebRtcCallSipEventEnum.WEB_RTC_CONNECTING]: unknown;
169
166
  [WebRtcCallSipEventEnum.WEB_RTC_CONNECTED]: unknown;
@@ -23,3 +23,6 @@ export declare const setOutNumber: (params: {
23
23
  agent_id: number;
24
24
  out_display_number: string;
25
25
  }) => Promise<any>;
26
+ export declare const queryIsLogin: (params: {
27
+ agent_no: string;
28
+ }) => Promise<any>;
@@ -8,9 +8,11 @@ export declare const AGENT_CCS_SERVER = "/v1/aicc/ccs";
8
8
  export declare let YS_URL: string;
9
9
  export declare let YS_APP_KEY: string;
10
10
  export declare let YS_APP_SECRET: string;
11
+ export declare let YS_AGENT_NO: string;
11
12
  export declare function SET_URL(newUrl: string): void;
12
13
  export declare function SET_APP_KEY(newAppId: string): void;
13
14
  export declare function SET_APP_SECRET(newAppSecret: string): void;
15
+ export declare function SET_AGENT_NO(newAgentNo: string): void;
14
16
  /**
15
17
  * POST 请求封装
16
18
  * @param url 相对接口路径,如 /user/login