@zjw-jszn/shared-imsdk 1.0.9 → 1.0.10

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.
@@ -8,6 +8,7 @@ export interface IMSDKConfig {
8
8
  };
9
9
  api?: {
10
10
  baseURL?: string;
11
+ resourceBaseURL?: string;
11
12
  prefix?: string;
12
13
  uploadURL?: string;
13
14
  signKey?: string;
@@ -18,8 +19,25 @@ export interface IMSDKConfig {
18
19
  userType?: number;
19
20
  };
20
21
  ws?: {
22
+ url?: string;
21
23
  controller?: string;
22
24
  platform?: string;
25
+ reconnectInterval?: number;
26
+ heartbeatInterval?: number;
27
+ maxReconnectAttempts?: number;
28
+ connectTimeout?: number;
29
+ traceEnabled?: boolean;
30
+ protocol?: {
31
+ controller?: string;
32
+ action?: {
33
+ send?: string;
34
+ msgRead?: string;
35
+ onConnect?: string;
36
+ offLine?: string;
37
+ heartbeat?: string;
38
+ };
39
+ heartbeatSignals?: string[];
40
+ };
23
41
  };
24
42
  sound?: {
25
43
  enabled: boolean;
@@ -28,6 +46,9 @@ export interface IMSDKConfig {
28
46
  auth?: {
29
47
  authorizationPayload?: Record<string, unknown>;
30
48
  };
49
+ chat?: {
50
+ platformServicePhone?: string;
51
+ };
31
52
  runtimeApi?: {
32
53
  getChatConfig?: () => Promise<{
33
54
  quick_receive?: string[] | string;
@@ -19,6 +19,7 @@ declare class WebSocketClient {
19
19
  private status;
20
20
  private heartbeatTimer;
21
21
  private reconnectTimer;
22
+ private connectTimeoutTimer;
22
23
  private reconnectCount;
23
24
  private messageQueue;
24
25
  private listeners;
@@ -30,9 +31,17 @@ declare class WebSocketClient {
30
31
  private siteId;
31
32
  private presenceAction;
32
33
  private isConnected;
33
- private wsUrl;
34
+ private wsUrlOverride;
34
35
  private readonly logPrefix;
35
36
  constructor(config?: WebSocketConfig);
37
+ private toPositiveInt;
38
+ private getHeartbeatInterval;
39
+ private getReconnectInterval;
40
+ private getMaxReconnectCount;
41
+ private getConnectTimeout;
42
+ private trace;
43
+ private resolveProtocolAction;
44
+ private stopConnectTimeout;
36
45
  /**
37
46
  * 连接 WebSocket
38
47
  * @param {string} token - 用户token
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zjw-jszn/shared-imsdk",
3
3
  "type": "module",
4
- "version": "1.0.9",
4
+ "version": "1.0.10",
5
5
  "sideEffects": [
6
6
  "./index.js",
7
7
  "./dist/shared-imsdk.css",