cmd-control-client-lib 3.0.15 → 3.0.19

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.
@@ -293,6 +293,49 @@ export declare class CMDP_UPDATECHANNEL_RESPONSE extends CMDP_UPDATECHANNEL impl
293
293
  values: IKeyMaybeValue;
294
294
  payload?: unknown;
295
295
  }
296
+ /**
297
+ * channel summary info
298
+ */
299
+ export declare type channelSummaryInfo = {
300
+ [key: string]: string;
301
+ /** your business id */
302
+ usrId: string;
303
+ /** usrKey of your user */
304
+ usrKey: string;
305
+ /** number of channel */
306
+ channels: string;
307
+ /** number of unseen messages */
308
+ unseen: string;
309
+ /** number of unseen messages */
310
+ unseenWithoutArchived: string;
311
+ /** number of unanswered channels */
312
+ unanswered: string;
313
+ /** last time of incoming message */
314
+ lastTimeIn: string;
315
+ /** last time of outgoing message */
316
+ lastTimeOut: string;
317
+ /** number of archived channels */
318
+ archived: string;
319
+ /** number of advertised channels */
320
+ advertised: string;
321
+ /** number of regular channels */
322
+ regular: string;
323
+ /** number of pinned channels */
324
+ pinned: string;
325
+ /** number of muted channels */
326
+ muted: string;
327
+ /** number of banned channels */
328
+ banned: string;
329
+ /** number of vip channels */
330
+ vip: string;
331
+ };
332
+ /**
333
+ * channel summary
334
+ */
335
+ export declare class CMDC_CHANNELSUMMARY implements ICOMMAND {
336
+ action: ACTION;
337
+ params: channelSummaryInfo;
338
+ }
296
339
  /**
297
340
  * Query the summary info about all channels
298
341
  */
@@ -308,36 +351,5 @@ export declare class CMDP_CHANNELSSUMMARY_RESPONSE extends CMDP_CHANNELSSUMMARY
308
351
  /** unused */
309
352
  commands: ICOMMAND[];
310
353
  /** the summary info */
311
- values: {
312
- /** your business id */
313
- usrId: string;
314
- /** usrKey of your user */
315
- usrKey: string;
316
- /** number of channel */
317
- channels: string;
318
- /** number of unseen messages */
319
- unseen: string;
320
- /** number of unseen messages */
321
- unseenWithoutArchived: string;
322
- /** number of unanswered channels */
323
- unanswered: string;
324
- /** last time of incoming message */
325
- lastTimeIn: string;
326
- /** last time of outgoing message */
327
- lastTimeOut: string;
328
- /** number of archived channels */
329
- archived: string;
330
- /** number of advertised channels */
331
- advertised: string;
332
- /** number of regular channels */
333
- regular: string;
334
- /** number of pinned channels */
335
- pinned: string;
336
- /** number of muted channels */
337
- muted: string;
338
- /** number of banned channels */
339
- banned: string;
340
- /** number of vip channels */
341
- vip: string;
342
- };
354
+ values: channelSummaryInfo;
343
355
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cmd-control-client-lib",
3
3
  "description": "Cmd-Client-Library",
4
- "version": "3.0.15",
4
+ "version": "3.0.19",
5
5
  "directories": {
6
6
  "lib": "./dist"
7
7
  },
@@ -47,7 +47,7 @@ describe("WebSocket connection", () => {
47
47
  expect(setTimeout).toHaveBeenCalledTimes(1);
48
48
  expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 15000);
49
49
 
50
- const firstError = new CustomEvent("connection-error", { detail: { reconnectionTimeout: 15000 } });
50
+ const firstError = { reConnectionTimeout: 15000 };
51
51
  expect(connectionConfig.onError).toHaveBeenCalledWith(firstError);
52
52
  jest.runOnlyPendingTimers();
53
53
  expect(logger.log).toHaveBeenCalledWith("CMDP. retry connect in 15000 ms");
@@ -58,7 +58,7 @@ describe("WebSocket connection", () => {
58
58
  CMDConnection._socket.onerror();
59
59
  CMDConnection._socket.onclose();
60
60
 
61
- const secondError = new CustomEvent("connection-error", { detail: { reconnectionTimeout: 30000 } });
61
+ const secondError = { reConnectionTimeout: 30000 };
62
62
  expect(setTimeout).toHaveBeenCalledTimes(2);
63
63
  expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 30000);
64
64
  expect(connectionConfig.onError).toHaveBeenCalledWith(secondError);
@@ -71,7 +71,7 @@ describe("WebSocket connection", () => {
71
71
  CMDConnection._socket.onerror();
72
72
  CMDConnection._socket.onclose();
73
73
 
74
- const thirdError = new CustomEvent("connection-error", { detail: { reconnectionTimeout: 45000 } });
74
+ const thirdError = { reConnectionTimeout: 45000 };
75
75
  expect(setTimeout).toHaveBeenCalledTimes(3);
76
76
  expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 45000);
77
77
  expect(connectionConfig.onError).toHaveBeenCalledWith(thirdError);
@@ -84,7 +84,7 @@ describe("WebSocket connection", () => {
84
84
  CMDConnection._socket.onerror();
85
85
  CMDConnection._socket.onclose();
86
86
 
87
- const fourthError = new CustomEvent("connection-error", { detail: { reconnectionTimeout: 60000 } });
87
+ const fourthError = { reConnectionTimeout: 60000 };
88
88
  expect(setTimeout).toHaveBeenCalledTimes(4);
89
89
  expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 60000);
90
90
  expect(connectionConfig.onError).toHaveBeenCalledWith(fourthError);
@@ -97,7 +97,7 @@ describe("WebSocket connection", () => {
97
97
  CMDConnection._socket.onerror();
98
98
  CMDConnection._socket.onclose();
99
99
 
100
- const fifthError = new CustomEvent("connection-error", { detail: { reconnectionTimeout: 75000 } });
100
+ const fifthError = { reConnectionTimeout: 75000 };
101
101
  expect(setTimeout).toHaveBeenCalledTimes(5);
102
102
  expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 75000);
103
103
  expect(connectionConfig.onError).toHaveBeenCalledWith(fifthError);
@@ -108,7 +108,7 @@ describe("WebSocket connection", () => {
108
108
  CMDConnection._socket.onerror();
109
109
  CMDConnection._socket.onclose();
110
110
 
111
- const fatalError = new CustomEvent("connection-error", { detail: { isFatal: true } });
111
+ const fatalError = { isFatal: true };
112
112
  expect(connectionConfig.onError).toHaveBeenCalledWith(fatalError);
113
113
  //No more setTimeout was called
114
114
  expect(setTimeout).toHaveBeenCalledTimes(5);