ysyt-agent-sdk 1.0.71 → 1.0.73

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.
@@ -3,7 +3,9 @@ export type * from './types';
3
3
  export * from './types/Enum';
4
4
  declare class YSYTAgentSdk {
5
5
  #private;
6
- constructor();
6
+ private static _instance;
7
+ private constructor();
8
+ static getInstance(): YSYTAgentSdk;
7
9
  initWebRtc(): Promise<void>;
8
10
  /**
9
11
  * 初始化SDK
@@ -13,8 +15,9 @@ declare class YSYTAgentSdk {
13
15
  * @param appSecret
14
16
  * @param agentNo 坐席工号
15
17
  * @param enableBrowserAlert 是否开启浏览器通知
18
+ * @param logBuiltinEnabled 是否开启日志
16
19
  */
17
- init({ actionNodeParams, url, appKey, appSecret, agentNo, enableBrowserAlert }: InitInfoType): Promise<void>;
20
+ init({ actionNodeParams, url, appKey, appSecret, agentNo, enableBrowserAlert, logBuiltinEnabled, }: InitInfoType): Promise<void>;
18
21
  on<K extends keyof Events>(event: K, handler: (data: Events[K]) => void): this;
19
22
  off<K extends keyof Events>(event: K, listener: (msg: Events[K]) => void): void;
20
23
  offAll(): void;
@@ -6,6 +6,7 @@ type InternalState = {
6
6
  sessionId: string;
7
7
  enableBrowserAlert: boolean;
8
8
  autoStateTimer: any;
9
+ logBuiltinEnabled: boolean;
9
10
  stateObject?: {
10
11
  state: AgentStatus;
11
12
  state_name: string;
@@ -40,6 +40,7 @@ export interface InitInfoType {
40
40
  appSecret: string;
41
41
  agentNo: string;
42
42
  enableBrowserAlert?: boolean;
43
+ logBuiltinEnabled?: boolean;
43
44
  actionNodeParams?: {
44
45
  viewHtmlElement?: HTMLElement;
45
46
  rttHTML?: HTMLElement;
@@ -0,0 +1,9 @@
1
+ type LogFunction = (...args: unknown[]) => void;
2
+ interface Logger {
3
+ log: LogFunction;
4
+ info: LogFunction;
5
+ warn: LogFunction;
6
+ error: LogFunction;
7
+ }
8
+ declare const logger: Logger;
9
+ export default logger;