瀏覽代碼

update build

adam 3 年之前
父節點
當前提交
ecc7f2fe57
共有 33 個文件被更改,包括 2510 次插入1212 次删除
  1. 920
    46
      package-lock.json
  2. 8
    2
      package.json
  3. 434
    422
      packages/cts-api/dist/cjs/WebSocketClient.js
  4. 184
    184
      packages/cts-api/dist/cjs/api/WsApi.js
  5. 6
    6
      packages/cts-api/dist/cjs/index.js
  6. 2
    2
      packages/cts-api/dist/cjs/messages.js
  7. 84
    74
      packages/cts-api/dist/cjs/meta.js
  8. 31
    31
      packages/cts-api/dist/cjs/protocol/AttachmentMsg.js
  9. 31
    31
      packages/cts-api/dist/cjs/protocol/CmdMsg.js
  10. 55
    55
      packages/cts-api/dist/cjs/protocol/MediaMsg.js
  11. 21
    21
      packages/cts-api/dist/cjs/protocol/MsgBase.js
  12. 31
    31
      packages/cts-api/dist/cjs/protocol/TextMsg.js
  13. 0
    4
      packages/cts-api/dist/cjs/utils/uuid.js
  14. 3
    3
      packages/cts-api/dist/index.js
  15. 96
    92
      packages/cts-api/dist/types/WebSocketClient.d.ts
  16. 33
    33
      packages/cts-api/dist/types/api/WsApi.d.ts
  17. 3
    2
      packages/cts-api/dist/types/index.d.ts
  18. 28
    28
      packages/cts-api/dist/types/messages.d.ts
  19. 8
    8
      packages/cts-api/dist/types/meta.d.ts
  20. 6
    6
      packages/cts-api/dist/types/protocol/AttachmentMsg.d.ts
  21. 7
    7
      packages/cts-api/dist/types/protocol/CmdMsg.d.ts
  22. 10
    10
      packages/cts-api/dist/types/protocol/MediaMsg.d.ts
  23. 12
    21
      packages/cts-api/dist/types/protocol/MsgBase.d.ts
  24. 6
    6
      packages/cts-api/dist/types/protocol/TextMsg.d.ts
  25. 0
    1
      packages/cts-api/dist/types/utils/uuid.d.ts
  26. 2
    2
      packages/cts-api/package.json
  27. 5
    5
      packages/cts-api/scripts/webpack/webpack.config.dev.js
  28. 3
    3
      packages/cts-api/scripts/webpack/webpack.config.umd.js
  29. 15
    2
      packages/cts-api/src/WebSocketClient.ts
  30. 6
    2
      packages/cts-api/src/protocol/MsgBase.ts
  31. 0
    3
      packages/cts-api/src/utils/uuid.ts
  32. 18
    18
      scripts/webpack/webpack.config.prod.js
  33. 442
    51
      yarn.lock

+ 920
- 46
package-lock.json
文件差異過大導致無法顯示
查看文件


+ 8
- 2
package.json 查看文件

@@ -48,7 +48,10 @@
48 48
     "@types/react-dom": "^16.8.4",
49 49
     "autoprefixer": "9.5.1",
50 50
     "awesome-typescript-loader": "^5.2.1",
51
-    "copy-webpack-plugin": "^5.0.3",
51
+    "babel-core": "^6.26.3",
52
+    "copy-webpack-plugin": "^9.0.1",
53
+    "copyfiles": "^2.4.1",
54
+    "cross-env": "^7.0.3",
52 55
     "css-loader": "2.1.1",
53 56
     "enzyme": "^3.9.0",
54 57
     "file-loader": "3.0.1",
@@ -83,9 +86,12 @@
83 86
     "webpack-cli": "3.3.2",
84 87
     "webpack-dashboard": "3.0.5",
85 88
     "webpack-dev-server": "^3.3.1",
89
+    "webpack-merge": "^5.8.0",
86 90
     "workerize-loader": "^1.0.4"
87 91
   },
88 92
   "dependencies": {
89
-    "ts-linker-sdk": "^1.0.7"
93
+    "@types/uuid": "^8.3.1",
94
+    "ts-linker-sdk": "^1.0.7",
95
+    "uuid": "^8.3.2"
90 96
   }
91 97
 }

+ 434
- 422
packages/cts-api/dist/cjs/WebSocketClient.js 查看文件

@@ -1,422 +1,434 @@
1
-"use strict";
2
-var __assign = (this && this.__assign) || function () {
3
-    __assign = Object.assign || function(t) {
4
-        for (var s, i = 1, n = arguments.length; i < n; i++) {
5
-            s = arguments[i];
6
-            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
-                t[p] = s[p];
8
-        }
9
-        return t;
10
-    };
11
-    return __assign.apply(this, arguments);
12
-};
13
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
-    return new (P || (P = Promise))(function (resolve, reject) {
15
-        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
-        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
-        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
18
-        step((generator = generator.apply(thisArg, _arguments || [])).next());
19
-    });
20
-};
21
-var __generator = (this && this.__generator) || function (thisArg, body) {
22
-    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
-    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
-    function verb(n) { return function (v) { return step([n, v]); }; }
25
-    function step(op) {
26
-        if (f) throw new TypeError("Generator is already executing.");
27
-        while (_) try {
28
-            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
-            if (y = 0, t) op = [op[0] & 2, t.value];
30
-            switch (op[0]) {
31
-                case 0: case 1: t = op; break;
32
-                case 4: _.label++; return { value: op[1], done: false };
33
-                case 5: _.label++; y = op[1]; op = [0]; continue;
34
-                case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
-                default:
36
-                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
-                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
-                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
-                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
-                    if (t[2]) _.ops.pop();
41
-                    _.trys.pop(); continue;
42
-            }
43
-            op = body.call(thisArg, _);
44
-        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
-        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
-    }
47
-};
48
-Object.defineProperty(exports, "__esModule", { value: true });
49
-var ts_linker_sdk_1 = require("ts-linker-sdk");
50
-var meta_1 = require("./meta");
51
-var meta = meta_1.getMetaData();
52
-var PING_INTERVAL = 50 * 1000;
53
-var WebSocketClient = (function () {
54
-    function WebSocketClient(wsUrl, token, sid, chatToken) {
55
-        this.status = {
56
-            created: false,
57
-            connected: false,
58
-            login: false
59
-        };
60
-        this.wsUrl = wsUrl;
61
-        this.token = token;
62
-        this.chatToken = chatToken;
63
-        this.sid = sid;
64
-    }
65
-    WebSocketClient.prototype.init = function () {
66
-        return __awaiter(this, void 0, void 0, function () {
67
-            return __generator(this, function (_a) {
68
-                return [2, this.create()];
69
-            });
70
-        });
71
-    };
72
-    WebSocketClient.prototype.getStatus = function () {
73
-        return this.status;
74
-    };
75
-    WebSocketClient.prototype.create = function () {
76
-        return __awaiter(this, void 0, void 0, function () {
77
-            var url;
78
-            var _this = this;
79
-            return __generator(this, function (_a) {
80
-                url = this.wsUrl;
81
-                return [2, new Promise(function (resolve, reject) {
82
-                        if (!url) {
83
-                            throw new Error('websocket url is required.');
84
-                        }
85
-                        _this.client = ts_linker_sdk_1.Client.getInstance(url, {
86
-                            onOpen: function () { return __awaiter(_this, void 0, void 0, function () {
87
-                                var data;
88
-                                var _this = this;
89
-                                return __generator(this, function (_a) {
90
-                                    switch (_a.label) {
91
-                                        case 0:
92
-                                            try {
93
-                                                this.ping();
94
-                                                this.interval = setInterval(function () {
95
-                                                    _this.ping();
96
-                                                }, PING_INTERVAL);
97
-                                            }
98
-                                            catch (err) {
99
-                                                console.error(err);
100
-                                                reject(err);
101
-                                            }
102
-                                            return [4, this.connect()];
103
-                                        case 1:
104
-                                            data = _a.sent();
105
-                                            return [4, this.authentication()];
106
-                                        case 2:
107
-                                            _a.sent();
108
-                                            resolve(data.value);
109
-                                            return [2];
110
-                                    }
111
-                                });
112
-                            }); },
113
-                            onError: function () {
114
-                                resolve(false);
115
-                            },
116
-                            onClose: function () {
117
-                                clearInterval(_this.interval);
118
-                            }
119
-                        });
120
-                    })];
121
-            });
122
-        });
123
-    };
124
-    WebSocketClient.prototype.on = function (url, callback) {
125
-        if (!url) {
126
-            throw new Error('url is required.');
127
-        }
128
-        this.client.addMessageListener(url, callback);
129
-    };
130
-    WebSocketClient.prototype.off = function (url) {
131
-        this.client.removeMessageListener(url);
132
-    };
133
-    WebSocketClient.prototype.request = function (url, data) {
134
-        return __awaiter(this, void 0, void 0, function () {
135
-            return __generator(this, function (_a) {
136
-                return [2, this.client.request(url, data)];
137
-            });
138
-        });
139
-    };
140
-    WebSocketClient.prototype.connect = function () {
141
-        return __awaiter(this, void 0, void 0, function () {
142
-            var sid, data, id;
143
-            return __generator(this, function (_a) {
144
-                switch (_a.label) {
145
-                    case 0:
146
-                        sid = this.sid;
147
-                        if (sid) {
148
-                            this.client.setRequestProperty('sid', sid);
149
-                        }
150
-                        return [4, this.request('/v1/session/start', __assign({}, this.chatToken, meta))];
151
-                    case 1:
152
-                        data = _a.sent();
153
-                        if (data && data.value) {
154
-                            id = data.value;
155
-                            this.sid = id;
156
-                            this.client.setRequestProperty('sid', id);
157
-                        }
158
-                        return [2, data || true];
159
-                }
160
-            });
161
-        });
162
-    };
163
-    WebSocketClient.prototype.ping = function () {
164
-        return this.client.ping({});
165
-    };
166
-    WebSocketClient.prototype.authentication = function () {
167
-        return __awaiter(this, void 0, void 0, function () {
168
-            var tk, data;
169
-            return __generator(this, function (_a) {
170
-                switch (_a.label) {
171
-                    case 0:
172
-                        tk = this.token;
173
-                        return [4, this.request('/v1/session/bind/uid/by/token', { token: tk })];
174
-                    case 1:
175
-                        data = _a.sent();
176
-                        return [2, data || true];
177
-                }
178
-            });
179
-        });
180
-    };
181
-    WebSocketClient.prototype.onMessage = function (callback) {
182
-        return __awaiter(this, void 0, void 0, function () {
183
-            return __generator(this, function (_a) {
184
-                this.on('/v1/message/listener', callback);
185
-                return [2];
186
-            });
187
-        });
188
-    };
189
-    WebSocketClient.prototype.sendMessage = function (data) {
190
-        return __awaiter(this, void 0, void 0, function () {
191
-            return __generator(this, function (_a) {
192
-                return [2, this.request('/v1/send/message', data)];
193
-            });
194
-        });
195
-    };
196
-    WebSocketClient.prototype.markServiced = function (data) {
197
-        return __awaiter(this, void 0, void 0, function () {
198
-            return __generator(this, function (_a) {
199
-                return [2, this.request('/v1/mark/message/serviced', data)];
200
-            });
201
-        });
202
-    };
203
-    WebSocketClient.prototype.getHistoryMessage = function (data) {
204
-        return __awaiter(this, void 0, void 0, function () {
205
-            return __generator(this, function (_a) {
206
-                return [2, this.request('/v1/history/message', data)];
207
-            });
208
-        });
209
-    };
210
-    WebSocketClient.prototype.updateStatus = function (data) {
211
-        return __awaiter(this, void 0, void 0, function () {
212
-            return __generator(this, function (_a) {
213
-                return [2, this.request('/v1/session/status', data)];
214
-            });
215
-        });
216
-    };
217
-    WebSocketClient.prototype.getSessionLists = function () {
218
-        return __awaiter(this, void 0, void 0, function () {
219
-            return __generator(this, function (_a) {
220
-                return [2, this.request('/v1/session/lists', {})];
221
-            });
222
-        });
223
-    };
224
-    WebSocketClient.prototype.getAllConversations = function (data) {
225
-        return __awaiter(this, void 0, void 0, function () {
226
-            return __generator(this, function (_a) {
227
-                return [2, this.request('/v1/get/all/conversation', data)];
228
-            });
229
-        });
230
-    };
231
-    WebSocketClient.prototype.getAllContact = function (data) {
232
-        return __awaiter(this, void 0, void 0, function () {
233
-            return __generator(this, function (_a) {
234
-                return [2, this.request('/v1/get/all/contact', data)];
235
-            });
236
-        });
237
-    };
238
-    WebSocketClient.prototype.addContact = function (data) {
239
-        return __awaiter(this, void 0, void 0, function () {
240
-            return __generator(this, function (_a) {
241
-                return [2, this.request('/v1/add/contact', data)];
242
-            });
243
-        });
244
-    };
245
-    WebSocketClient.prototype.deleteContact = function (data) {
246
-        return __awaiter(this, void 0, void 0, function () {
247
-            return __generator(this, function (_a) {
248
-                return [2, this.request('/v1/delete/contact', data)];
249
-            });
250
-        });
251
-    };
252
-    WebSocketClient.prototype.maskingContact = function (data) {
253
-        return __awaiter(this, void 0, void 0, function () {
254
-            return __generator(this, function (_a) {
255
-                return [2, this.request('/v1/add/contact/masking', data)];
256
-            });
257
-        });
258
-    };
259
-    WebSocketClient.prototype.removeMaskingContact = function (data) {
260
-        return __awaiter(this, void 0, void 0, function () {
261
-            return __generator(this, function (_a) {
262
-                return [2, this.request('/v1/remove/contact/masking', data)];
263
-            });
264
-        });
265
-    };
266
-    WebSocketClient.prototype.stickingContact = function (data) {
267
-        return __awaiter(this, void 0, void 0, function () {
268
-            return __generator(this, function (_a) {
269
-                return [2, this.request('/v1/add/contact/stick', data)];
270
-            });
271
-        });
272
-    };
273
-    WebSocketClient.prototype.removeStickContact = function (data) {
274
-        return __awaiter(this, void 0, void 0, function () {
275
-            return __generator(this, function (_a) {
276
-                return [2, this.request('/v1/remove/contact/stick', data)];
277
-            });
278
-        });
279
-    };
280
-    WebSocketClient.prototype.setNoDisturbing = function (data) {
281
-        return __awaiter(this, void 0, void 0, function () {
282
-            return __generator(this, function (_a) {
283
-                return [2, this.request('/v1/add/contact/no/disturbing', data)];
284
-            });
285
-        });
286
-    };
287
-    WebSocketClient.prototype.removeNoDisturbing = function (data) {
288
-        return __awaiter(this, void 0, void 0, function () {
289
-            return __generator(this, function (_a) {
290
-                return [2, this.request('/v1/remove/contact/no/disturbing', data)];
291
-            });
292
-        });
293
-    };
294
-    WebSocketClient.prototype.agreeAddContact = function (data) {
295
-        return __awaiter(this, void 0, void 0, function () {
296
-            return __generator(this, function (_a) {
297
-                return [2, this.request('/v1/add/contact/agree', data)];
298
-            });
299
-        });
300
-    };
301
-    WebSocketClient.prototype.rejectAddContact = function (data) {
302
-        return __awaiter(this, void 0, void 0, function () {
303
-            return __generator(this, function (_a) {
304
-                return [2, this.request('/v1/add/contact/reject', data)];
305
-            });
306
-        });
307
-    };
308
-    WebSocketClient.prototype.addContactServiced = function (data) {
309
-        return __awaiter(this, void 0, void 0, function () {
310
-            return __generator(this, function (_a) {
311
-                return [2, this.request('/v1/add/contact/serviced', data)];
312
-            });
313
-        });
314
-    };
315
-    WebSocketClient.prototype.createChatroom = function (data) {
316
-        return __awaiter(this, void 0, void 0, function () {
317
-            return __generator(this, function (_a) {
318
-                return [2, this.request('/v1/create/chatroom', data)];
319
-            });
320
-        });
321
-    };
322
-    WebSocketClient.prototype.destroyChatroom = function (data) {
323
-        return __awaiter(this, void 0, void 0, function () {
324
-            return __generator(this, function (_a) {
325
-                return [2, this.request('/v1/destroy/chatroom', data)];
326
-            });
327
-        });
328
-    };
329
-    WebSocketClient.prototype.leaveChatroom = function (data) {
330
-        return __awaiter(this, void 0, void 0, function () {
331
-            return __generator(this, function (_a) {
332
-                return [2, this.request('/v1/leave/chatroom', data)];
333
-            });
334
-        });
335
-    };
336
-    WebSocketClient.prototype.getChatroomProfile = function (data) {
337
-        return __awaiter(this, void 0, void 0, function () {
338
-            return __generator(this, function (_a) {
339
-                return [2, this.request('/v1/get/chatroom/profile', data)];
340
-            });
341
-        });
342
-    };
343
-    WebSocketClient.prototype.updateChatroomSubject = function (data) {
344
-        return __awaiter(this, void 0, void 0, function () {
345
-            return __generator(this, function (_a) {
346
-                return [2, this.request('/v1/update/chatroom/subject', data)];
347
-            });
348
-        });
349
-    };
350
-    WebSocketClient.prototype.updateChatroomDescription = function (data) {
351
-        return __awaiter(this, void 0, void 0, function () {
352
-            return __generator(this, function (_a) {
353
-                return [2, this.request('/v1/update/chatroom/description', data)];
354
-            });
355
-        });
356
-    };
357
-    WebSocketClient.prototype.addChatroomAdmin = function (data) {
358
-        return __awaiter(this, void 0, void 0, function () {
359
-            return __generator(this, function (_a) {
360
-                return [2, this.request('/v1/add/chatroom/admin', data)];
361
-            });
362
-        });
363
-    };
364
-    WebSocketClient.prototype.removeChatroomAdmin = function (data) {
365
-        return __awaiter(this, void 0, void 0, function () {
366
-            return __generator(this, function (_a) {
367
-                return [2, this.request('/v1/remove/chatroom/admin', data)];
368
-            });
369
-        });
370
-    };
371
-    WebSocketClient.prototype.addChatroomAdmins = function (data) {
372
-        return __awaiter(this, void 0, void 0, function () {
373
-            return __generator(this, function (_a) {
374
-                return [2, this.request('/v1/add/chatroom/admins', data)];
375
-            });
376
-        });
377
-    };
378
-    WebSocketClient.prototype.removeChatroomAdmins = function (data) {
379
-        return __awaiter(this, void 0, void 0, function () {
380
-            return __generator(this, function (_a) {
381
-                return [2, this.request('/v1/remove/chatroom/admins', data)];
382
-            });
383
-        });
384
-    };
385
-    WebSocketClient.prototype.joinChatroom = function (data) {
386
-        return __awaiter(this, void 0, void 0, function () {
387
-            return __generator(this, function (_a) {
388
-                return [2, this.request('/v1/join/chatroom', data)];
389
-            });
390
-        });
391
-    };
392
-    WebSocketClient.prototype.removeChatroomMember = function (data) {
393
-        return __awaiter(this, void 0, void 0, function () {
394
-            return __generator(this, function (_a) {
395
-                return [2, this.request('/v1/remove/chatroom/member', data)];
396
-            });
397
-        });
398
-    };
399
-    WebSocketClient.prototype.fetchStickChatroom = function (data) {
400
-        return __awaiter(this, void 0, void 0, function () {
401
-            return __generator(this, function (_a) {
402
-                return [2, this.request('/v1/fetch/stick/chatroom', data)];
403
-            });
404
-        });
405
-    };
406
-    WebSocketClient.prototype.fetchChatroomMembers = function (data) {
407
-        return __awaiter(this, void 0, void 0, function () {
408
-            return __generator(this, function (_a) {
409
-                return [2, this.request('/v1/fetch/chatroom/members', data)];
410
-            });
411
-        });
412
-    };
413
-    WebSocketClient.prototype.searchHistoryMessage = function (data) {
414
-        return __awaiter(this, void 0, void 0, function () {
415
-            return __generator(this, function (_a) {
416
-                return [2, this.request('/v1/search/history/message', data)];
417
-            });
418
-        });
419
-    };
420
-    return WebSocketClient;
421
-}());
422
-exports.WebSocketClient = WebSocketClient;
1
+"use strict";
2
+var __assign = (this && this.__assign) || function () {
3
+    __assign = Object.assign || function(t) {
4
+        for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+            s = arguments[i];
6
+            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+                t[p] = s[p];
8
+        }
9
+        return t;
10
+    };
11
+    return __assign.apply(this, arguments);
12
+};
13
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+    return new (P || (P = Promise))(function (resolve, reject) {
15
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
18
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+    });
20
+};
21
+var __generator = (this && this.__generator) || function (thisArg, body) {
22
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+    function verb(n) { return function (v) { return step([n, v]); }; }
25
+    function step(op) {
26
+        if (f) throw new TypeError("Generator is already executing.");
27
+        while (_) try {
28
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+            if (y = 0, t) op = [op[0] & 2, t.value];
30
+            switch (op[0]) {
31
+                case 0: case 1: t = op; break;
32
+                case 4: _.label++; return { value: op[1], done: false };
33
+                case 5: _.label++; y = op[1]; op = [0]; continue;
34
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+                default:
36
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+                    if (t[2]) _.ops.pop();
41
+                    _.trys.pop(); continue;
42
+            }
43
+            op = body.call(thisArg, _);
44
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+    }
47
+};
48
+Object.defineProperty(exports, "__esModule", { value: true });
49
+var ts_linker_sdk_1 = require("ts-linker-sdk");
50
+var meta_1 = require("./meta");
51
+var meta = meta_1.getMetaData();
52
+var PING_INTERVAL = 50 * 1000;
53
+var WebSocketClient = (function () {
54
+    function WebSocketClient(wsUrl, token, sid, chatToken, extendOpts) {
55
+        this.status = {
56
+            created: false,
57
+            connected: false,
58
+            login: false
59
+        };
60
+        this.wsUrl = wsUrl;
61
+        this.token = token;
62
+        this.chatToken = chatToken;
63
+        this.sid = sid;
64
+        this.extendOpts = extendOpts;
65
+    }
66
+    WebSocketClient.prototype.init = function () {
67
+        return __awaiter(this, void 0, void 0, function () {
68
+            return __generator(this, function (_a) {
69
+                return [2, this.create()];
70
+            });
71
+        });
72
+    };
73
+    WebSocketClient.prototype.getStatus = function () {
74
+        return this.status;
75
+    };
76
+    WebSocketClient.prototype.create = function () {
77
+        return __awaiter(this, void 0, void 0, function () {
78
+            var url;
79
+            var _this = this;
80
+            return __generator(this, function (_a) {
81
+                url = this.wsUrl;
82
+                return [2, new Promise(function (resolve, reject) {
83
+                        if (!url) {
84
+                            throw new Error('websocket url is required.');
85
+                        }
86
+                        _this.client = ts_linker_sdk_1.Client.getInstance(url, {
87
+                            onOpen: function () { return __awaiter(_this, void 0, void 0, function () {
88
+                                var data;
89
+                                var _this = this;
90
+                                return __generator(this, function (_a) {
91
+                                    switch (_a.label) {
92
+                                        case 0:
93
+                                            try {
94
+                                                this.ping();
95
+                                                this.interval = setInterval(function () {
96
+                                                    _this.ping();
97
+                                                }, PING_INTERVAL);
98
+                                            }
99
+                                            catch (err) {
100
+                                                console.error(err);
101
+                                                reject(err);
102
+                                            }
103
+                                            return [4, this.connect()];
104
+                                        case 1:
105
+                                            data = _a.sent();
106
+                                            return [4, this.authentication()];
107
+                                        case 2:
108
+                                            _a.sent();
109
+                                            resolve(data.value);
110
+                                            return [2];
111
+                                    }
112
+                                });
113
+                            }); },
114
+                            onError: function () {
115
+                                resolve(false);
116
+                            },
117
+                            onClose: function () {
118
+                                clearInterval(_this.interval);
119
+                            }
120
+                        });
121
+                    })];
122
+            });
123
+        });
124
+    };
125
+    WebSocketClient.prototype.on = function (url, callback) {
126
+        if (!url) {
127
+            throw new Error('url is required.');
128
+        }
129
+        this.client.addMessageListener(url, callback);
130
+    };
131
+    WebSocketClient.prototype.off = function (url) {
132
+        this.client.removeMessageListener(url);
133
+    };
134
+    WebSocketClient.prototype.request = function (url, data) {
135
+        return __awaiter(this, void 0, void 0, function () {
136
+            return __generator(this, function (_a) {
137
+                return [2, this.client.request(url, data)];
138
+            });
139
+        });
140
+    };
141
+    WebSocketClient.prototype.connect = function () {
142
+        return __awaiter(this, void 0, void 0, function () {
143
+            var sid, param, data, id;
144
+            return __generator(this, function (_a) {
145
+                switch (_a.label) {
146
+                    case 0:
147
+                        sid = this.sid;
148
+                        if (sid) {
149
+                            this.client.setRequestProperty('sid', sid);
150
+                        }
151
+                        param = __assign({}, this.chatToken, meta);
152
+                        if (this.extendOpts && this.extendOpts.connectOptions) {
153
+                            param = __assign({}, param, this.extendOpts.connectOptions);
154
+                        }
155
+                        return [4, this.request('/v1/session/start', __assign({}, this.chatToken, meta))];
156
+                    case 1:
157
+                        data = _a.sent();
158
+                        if (data && data.value) {
159
+                            id = data.value;
160
+                            this.sid = id;
161
+                            this.client.setRequestProperty('sid', id);
162
+                        }
163
+                        return [2, data || true];
164
+                }
165
+            });
166
+        });
167
+    };
168
+    WebSocketClient.prototype.ping = function () {
169
+        return this.client.ping({});
170
+    };
171
+    WebSocketClient.prototype.authentication = function () {
172
+        return __awaiter(this, void 0, void 0, function () {
173
+            var tk, data;
174
+            return __generator(this, function (_a) {
175
+                switch (_a.label) {
176
+                    case 0:
177
+                        tk = this.token;
178
+                        return [4, this.request('/v1/session/bind/uid/by/token', { token: tk })];
179
+                    case 1:
180
+                        data = _a.sent();
181
+                        return [2, data || true];
182
+                }
183
+            });
184
+        });
185
+    };
186
+    WebSocketClient.prototype.onMessage = function (callback) {
187
+        return __awaiter(this, void 0, void 0, function () {
188
+            return __generator(this, function (_a) {
189
+                this.on('/v1/message/listener', callback);
190
+                return [2];
191
+            });
192
+        });
193
+    };
194
+    WebSocketClient.prototype.sendMessage = function (data) {
195
+        return __awaiter(this, void 0, void 0, function () {
196
+            return __generator(this, function (_a) {
197
+                return [2, this.request('/v1/send/message', data)];
198
+            });
199
+        });
200
+    };
201
+    WebSocketClient.prototype.markServiced = function (data) {
202
+        return __awaiter(this, void 0, void 0, function () {
203
+            return __generator(this, function (_a) {
204
+                return [2, this.request('/v1/mark/message/serviced', data)];
205
+            });
206
+        });
207
+    };
208
+    WebSocketClient.prototype.messageReaded = function (data) {
209
+        return __awaiter(this, void 0, void 0, function () {
210
+            return __generator(this, function (_a) {
211
+                return [2, this.request('/v1/mark/messages/read', data)];
212
+            });
213
+        });
214
+    };
215
+    WebSocketClient.prototype.getHistoryMessage = function (data) {
216
+        return __awaiter(this, void 0, void 0, function () {
217
+            return __generator(this, function (_a) {
218
+                return [2, this.request('/v1/history/message', data)];
219
+            });
220
+        });
221
+    };
222
+    WebSocketClient.prototype.updateStatus = function (data) {
223
+        return __awaiter(this, void 0, void 0, function () {
224
+            return __generator(this, function (_a) {
225
+                return [2, this.request('/v1/session/status', data)];
226
+            });
227
+        });
228
+    };
229
+    WebSocketClient.prototype.getSessionLists = function () {
230
+        return __awaiter(this, void 0, void 0, function () {
231
+            return __generator(this, function (_a) {
232
+                return [2, this.request('/v1/session/lists', {})];
233
+            });
234
+        });
235
+    };
236
+    WebSocketClient.prototype.getAllConversations = function (data) {
237
+        return __awaiter(this, void 0, void 0, function () {
238
+            return __generator(this, function (_a) {
239
+                return [2, this.request('/v1/get/all/conversation', data)];
240
+            });
241
+        });
242
+    };
243
+    WebSocketClient.prototype.getAllContact = function (data) {
244
+        return __awaiter(this, void 0, void 0, function () {
245
+            return __generator(this, function (_a) {
246
+                return [2, this.request('/v1/get/all/contact', data)];
247
+            });
248
+        });
249
+    };
250
+    WebSocketClient.prototype.addContact = function (data) {
251
+        return __awaiter(this, void 0, void 0, function () {
252
+            return __generator(this, function (_a) {
253
+                return [2, this.request('/v1/add/contact', data)];
254
+            });
255
+        });
256
+    };
257
+    WebSocketClient.prototype.deleteContact = function (data) {
258
+        return __awaiter(this, void 0, void 0, function () {
259
+            return __generator(this, function (_a) {
260
+                return [2, this.request('/v1/delete/contact', data)];
261
+            });
262
+        });
263
+    };
264
+    WebSocketClient.prototype.maskingContact = function (data) {
265
+        return __awaiter(this, void 0, void 0, function () {
266
+            return __generator(this, function (_a) {
267
+                return [2, this.request('/v1/add/contact/masking', data)];
268
+            });
269
+        });
270
+    };
271
+    WebSocketClient.prototype.removeMaskingContact = function (data) {
272
+        return __awaiter(this, void 0, void 0, function () {
273
+            return __generator(this, function (_a) {
274
+                return [2, this.request('/v1/remove/contact/masking', data)];
275
+            });
276
+        });
277
+    };
278
+    WebSocketClient.prototype.stickingContact = function (data) {
279
+        return __awaiter(this, void 0, void 0, function () {
280
+            return __generator(this, function (_a) {
281
+                return [2, this.request('/v1/add/contact/stick', data)];
282
+            });
283
+        });
284
+    };
285
+    WebSocketClient.prototype.removeStickContact = function (data) {
286
+        return __awaiter(this, void 0, void 0, function () {
287
+            return __generator(this, function (_a) {
288
+                return [2, this.request('/v1/remove/contact/stick', data)];
289
+            });
290
+        });
291
+    };
292
+    WebSocketClient.prototype.setNoDisturbing = function (data) {
293
+        return __awaiter(this, void 0, void 0, function () {
294
+            return __generator(this, function (_a) {
295
+                return [2, this.request('/v1/add/contact/no/disturbing', data)];
296
+            });
297
+        });
298
+    };
299
+    WebSocketClient.prototype.removeNoDisturbing = function (data) {
300
+        return __awaiter(this, void 0, void 0, function () {
301
+            return __generator(this, function (_a) {
302
+                return [2, this.request('/v1/remove/contact/no/disturbing', data)];
303
+            });
304
+        });
305
+    };
306
+    WebSocketClient.prototype.agreeAddContact = function (data) {
307
+        return __awaiter(this, void 0, void 0, function () {
308
+            return __generator(this, function (_a) {
309
+                return [2, this.request('/v1/add/contact/agree', data)];
310
+            });
311
+        });
312
+    };
313
+    WebSocketClient.prototype.rejectAddContact = function (data) {
314
+        return __awaiter(this, void 0, void 0, function () {
315
+            return __generator(this, function (_a) {
316
+                return [2, this.request('/v1/add/contact/reject', data)];
317
+            });
318
+        });
319
+    };
320
+    WebSocketClient.prototype.addContactServiced = function (data) {
321
+        return __awaiter(this, void 0, void 0, function () {
322
+            return __generator(this, function (_a) {
323
+                return [2, this.request('/v1/add/contact/serviced', data)];
324
+            });
325
+        });
326
+    };
327
+    WebSocketClient.prototype.createChatroom = function (data) {
328
+        return __awaiter(this, void 0, void 0, function () {
329
+            return __generator(this, function (_a) {
330
+                return [2, this.request('/v1/create/chatroom', data)];
331
+            });
332
+        });
333
+    };
334
+    WebSocketClient.prototype.destroyChatroom = function (data) {
335
+        return __awaiter(this, void 0, void 0, function () {
336
+            return __generator(this, function (_a) {
337
+                return [2, this.request('/v1/destroy/chatroom', data)];
338
+            });
339
+        });
340
+    };
341
+    WebSocketClient.prototype.leaveChatroom = function (data) {
342
+        return __awaiter(this, void 0, void 0, function () {
343
+            return __generator(this, function (_a) {
344
+                return [2, this.request('/v1/leave/chatroom', data)];
345
+            });
346
+        });
347
+    };
348
+    WebSocketClient.prototype.getChatroomProfile = function (data) {
349
+        return __awaiter(this, void 0, void 0, function () {
350
+            return __generator(this, function (_a) {
351
+                return [2, this.request('/v1/get/chatroom/profile', data)];
352
+            });
353
+        });
354
+    };
355
+    WebSocketClient.prototype.updateChatroomSubject = function (data) {
356
+        return __awaiter(this, void 0, void 0, function () {
357
+            return __generator(this, function (_a) {
358
+                return [2, this.request('/v1/update/chatroom/subject', data)];
359
+            });
360
+        });
361
+    };
362
+    WebSocketClient.prototype.updateChatroomDescription = function (data) {
363
+        return __awaiter(this, void 0, void 0, function () {
364
+            return __generator(this, function (_a) {
365
+                return [2, this.request('/v1/update/chatroom/description', data)];
366
+            });
367
+        });
368
+    };
369
+    WebSocketClient.prototype.addChatroomAdmin = function (data) {
370
+        return __awaiter(this, void 0, void 0, function () {
371
+            return __generator(this, function (_a) {
372
+                return [2, this.request('/v1/add/chatroom/admin', data)];
373
+            });
374
+        });
375
+    };
376
+    WebSocketClient.prototype.removeChatroomAdmin = function (data) {
377
+        return __awaiter(this, void 0, void 0, function () {
378
+            return __generator(this, function (_a) {
379
+                return [2, this.request('/v1/remove/chatroom/admin', data)];
380
+            });
381
+        });
382
+    };
383
+    WebSocketClient.prototype.addChatroomAdmins = function (data) {
384
+        return __awaiter(this, void 0, void 0, function () {
385
+            return __generator(this, function (_a) {
386
+                return [2, this.request('/v1/add/chatroom/admins', data)];
387
+            });
388
+        });
389
+    };
390
+    WebSocketClient.prototype.removeChatroomAdmins = function (data) {
391
+        return __awaiter(this, void 0, void 0, function () {
392
+            return __generator(this, function (_a) {
393
+                return [2, this.request('/v1/remove/chatroom/admins', data)];
394
+            });
395
+        });
396
+    };
397
+    WebSocketClient.prototype.joinChatroom = function (data) {
398
+        return __awaiter(this, void 0, void 0, function () {
399
+            return __generator(this, function (_a) {
400
+                return [2, this.request('/v1/join/chatroom', data)];
401
+            });
402
+        });
403
+    };
404
+    WebSocketClient.prototype.removeChatroomMember = function (data) {
405
+        return __awaiter(this, void 0, void 0, function () {
406
+            return __generator(this, function (_a) {
407
+                return [2, this.request('/v1/remove/chatroom/member', data)];
408
+            });
409
+        });
410
+    };
411
+    WebSocketClient.prototype.fetchStickChatroom = function (data) {
412
+        return __awaiter(this, void 0, void 0, function () {
413
+            return __generator(this, function (_a) {
414
+                return [2, this.request('/v1/fetch/stick/chatroom', data)];
415
+            });
416
+        });
417
+    };
418
+    WebSocketClient.prototype.fetchChatroomMembers = function (data) {
419
+        return __awaiter(this, void 0, void 0, function () {
420
+            return __generator(this, function (_a) {
421
+                return [2, this.request('/v1/fetch/chatroom/members', data)];
422
+            });
423
+        });
424
+    };
425
+    WebSocketClient.prototype.searchHistoryMessage = function (data) {
426
+        return __awaiter(this, void 0, void 0, function () {
427
+            return __generator(this, function (_a) {
428
+                return [2, this.request('/v1/search/history/message', data)];
429
+            });
430
+        });
431
+    };
432
+    return WebSocketClient;
433
+}());
434
+exports.WebSocketClient = WebSocketClient;

+ 184
- 184
packages/cts-api/dist/cjs/api/WsApi.js 查看文件

@@ -1,184 +1,184 @@
1
-"use strict";
2
-var __extends = (this && this.__extends) || (function () {
3
-    var extendStatics = function (d, b) {
4
-        extendStatics = Object.setPrototypeOf ||
5
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
-        return extendStatics(d, b);
8
-    };
9
-    return function (d, b) {
10
-        extendStatics(d, b);
11
-        function __() { this.constructor = d; }
12
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
-    };
14
-})();
15
-var __assign = (this && this.__assign) || function () {
16
-    __assign = Object.assign || function(t) {
17
-        for (var s, i = 1, n = arguments.length; i < n; i++) {
18
-            s = arguments[i];
19
-            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
-                t[p] = s[p];
21
-        }
22
-        return t;
23
-    };
24
-    return __assign.apply(this, arguments);
25
-};
26
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
-    return new (P || (P = Promise))(function (resolve, reject) {
28
-        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
-        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
-        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
31
-        step((generator = generator.apply(thisArg, _arguments || [])).next());
32
-    });
33
-};
34
-var __generator = (this && this.__generator) || function (thisArg, body) {
35
-    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
-    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
-    function verb(n) { return function (v) { return step([n, v]); }; }
38
-    function step(op) {
39
-        if (f) throw new TypeError("Generator is already executing.");
40
-        while (_) try {
41
-            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
-            if (y = 0, t) op = [op[0] & 2, t.value];
43
-            switch (op[0]) {
44
-                case 0: case 1: t = op; break;
45
-                case 4: _.label++; return { value: op[1], done: false };
46
-                case 5: _.label++; y = op[1]; op = [0]; continue;
47
-                case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
-                default:
49
-                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
-                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
-                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
-                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
-                    if (t[2]) _.ops.pop();
54
-                    _.trys.pop(); continue;
55
-            }
56
-            op = body.call(thisArg, _);
57
-        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
-        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
-    }
60
-};
61
-Object.defineProperty(exports, "__esModule", { value: true });
62
-var WebSocketClient_1 = require("./../WebSocketClient");
63
-var CmdMsg_1 = require("../protocol/CmdMsg");
64
-var WsApi = (function (_super) {
65
-    __extends(WsApi, _super);
66
-    function WsApi() {
67
-        return _super !== null && _super.apply(this, arguments) || this;
68
-    }
69
-    WsApi.prototype.sendMsg = function (msg) {
70
-        return __awaiter(this, void 0, void 0, function () {
71
-            return __generator(this, function (_a) {
72
-                return [2, this.sendMessage(msg)];
73
-            });
74
-        });
75
-    };
76
-    WsApi.prototype.sendGetCmdMsg = function (action, extra) {
77
-        if (extra === void 0) { extra = {}; }
78
-        return __awaiter(this, void 0, void 0, function () {
79
-            var msg;
80
-            return __generator(this, function (_a) {
81
-                msg = CmdMsg_1.CmdMsg.createMsg(__assign({ from: this.from, action: action }, extra));
82
-                return [2, this.sendMsg(msg)];
83
-            });
84
-        });
85
-    };
86
-    WsApi.prototype.sendPostCmdMsg = function (action, userIds, extra) {
87
-        if (extra === void 0) { extra = {}; }
88
-        return __awaiter(this, void 0, void 0, function () {
89
-            var msg;
90
-            return __generator(this, function (_a) {
91
-                msg = CmdMsg_1.CmdMsg.createMsg(__assign({ from: this.from, to: (userIds || []).join(','), action: action }, extra));
92
-                return [2, this.sendMsg(msg)];
93
-            });
94
-        });
95
-    };
96
-    WsApi.prototype.getRoster = function () {
97
-        return this.sendGetCmdMsg('getRoster');
98
-    };
99
-    WsApi.prototype.addFriends = function (userIds) {
100
-        return this.sendPostCmdMsg('addFriends', userIds);
101
-    };
102
-    WsApi.prototype.agreeFriends = function (userIds) {
103
-        return this.sendPostCmdMsg('agreeFriends', userIds);
104
-    };
105
-    WsApi.prototype.rejectFriends = function (userIds) {
106
-        return this.sendPostCmdMsg('rejectFriends', userIds);
107
-    };
108
-    WsApi.prototype.removeFriends = function (userIds) {
109
-        return this.sendPostCmdMsg('removeFriends', userIds);
110
-    };
111
-    WsApi.prototype.getBlacklist = function () {
112
-        return this.sendGetCmdMsg('getBlacklist');
113
-    };
114
-    WsApi.prototype.addToBlackList = function (userIds) {
115
-        return this.sendPostCmdMsg('addToBlackList', userIds);
116
-    };
117
-    WsApi.prototype.removeBlackList = function (userIds) {
118
-        return this.sendPostCmdMsg('removeBlackList', userIds);
119
-    };
120
-    WsApi.prototype.deleteConversation = function (contactId, deleteMessage) {
121
-        if (deleteMessage === void 0) { deleteMessage = false; }
122
-        return this.request('/v1/delete/conversation', {
123
-            contact: contactId,
124
-            delete_message: deleteMessage
125
-        });
126
-    };
127
-    WsApi.prototype.markMessageRead = function (contactId) {
128
-        return this.request('/v1/mark/messages/read', {
129
-            contact: contactId
130
-        });
131
-    };
132
-    WsApi.prototype.listGroups = function () {
133
-        return this.sendGetCmdMsg('listGroups');
134
-    };
135
-    WsApi.prototype.queryGroupInfo = function (roomId) {
136
-        return this.sendGetCmdMsg('queryGroupInfo', { to: roomId });
137
-    };
138
-    WsApi.prototype.queryRoomMember = function (roomId) {
139
-        return this.sendGetCmdMsg('queryRoomMember', { to: roomId });
140
-    };
141
-    WsApi.prototype.getGroupBlackList = function (roomId) {
142
-        return this.sendGetCmdMsg('getGroupBlackList', { to: roomId });
143
-    };
144
-    WsApi.prototype.createGroup = function (groupOption) {
145
-        return this.sendPostCmdMsg('createGroup', null, { ext: groupOption });
146
-    };
147
-    WsApi.prototype.changeGroupInfo = function (groupOption) {
148
-        return this.sendPostCmdMsg('changeGroupInfo', null, { ext: groupOption });
149
-    };
150
-    WsApi.prototype.addGroupMembers = function (roomId, userIds) {
151
-        return this.sendPostCmdMsg('addGroupMembers', [roomId], {
152
-            ext: {
153
-                members: userIds
154
-            }
155
-        });
156
-    };
157
-    WsApi.prototype.addToGroupBlackList = function (roomId, userIds) {
158
-        return this.sendPostCmdMsg('addToGroupBlackList', [roomId], {
159
-            ext: {
160
-                members: userIds
161
-            }
162
-        });
163
-    };
164
-    WsApi.prototype.destroyGroup = function (roomId) {
165
-        return this.sendPostCmdMsg('destroyGroup', [roomId]);
166
-    };
167
-    WsApi.prototype.leaveGroup = function (roomId) {
168
-        return this.sendPostCmdMsg('leaveGroup', [roomId]);
169
-    };
170
-    WsApi.prototype.createRoom = function (groupOption) {
171
-        return this.sendPostCmdMsg('createGroup', null, { ext: groupOption });
172
-    };
173
-    WsApi.prototype.listRooms = function () {
174
-        return this.sendGetCmdMsg('listRooms');
175
-    };
176
-    WsApi.prototype.joinRoom = function (roomId) {
177
-        return this.sendPostCmdMsg('joinRoom', [roomId]);
178
-    };
179
-    WsApi.prototype.quitRoom = function (roomId) {
180
-        return this.sendPostCmdMsg('quitRoom', [roomId]);
181
-    };
182
-    return WsApi;
183
-}(WebSocketClient_1.WebSocketClient));
184
-exports.WsApi = WsApi;
1
+"use strict";
2
+var __extends = (this && this.__extends) || (function () {
3
+    var extendStatics = function (d, b) {
4
+        extendStatics = Object.setPrototypeOf ||
5
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+        return extendStatics(d, b);
8
+    };
9
+    return function (d, b) {
10
+        extendStatics(d, b);
11
+        function __() { this.constructor = d; }
12
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+    };
14
+})();
15
+var __assign = (this && this.__assign) || function () {
16
+    __assign = Object.assign || function(t) {
17
+        for (var s, i = 1, n = arguments.length; i < n; i++) {
18
+            s = arguments[i];
19
+            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
+                t[p] = s[p];
21
+        }
22
+        return t;
23
+    };
24
+    return __assign.apply(this, arguments);
25
+};
26
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+    return new (P || (P = Promise))(function (resolve, reject) {
28
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
31
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+    });
33
+};
34
+var __generator = (this && this.__generator) || function (thisArg, body) {
35
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+    function verb(n) { return function (v) { return step([n, v]); }; }
38
+    function step(op) {
39
+        if (f) throw new TypeError("Generator is already executing.");
40
+        while (_) try {
41
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+            if (y = 0, t) op = [op[0] & 2, t.value];
43
+            switch (op[0]) {
44
+                case 0: case 1: t = op; break;
45
+                case 4: _.label++; return { value: op[1], done: false };
46
+                case 5: _.label++; y = op[1]; op = [0]; continue;
47
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+                default:
49
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+                    if (t[2]) _.ops.pop();
54
+                    _.trys.pop(); continue;
55
+            }
56
+            op = body.call(thisArg, _);
57
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+    }
60
+};
61
+Object.defineProperty(exports, "__esModule", { value: true });
62
+var WebSocketClient_1 = require("./../WebSocketClient");
63
+var CmdMsg_1 = require("../protocol/CmdMsg");
64
+var WsApi = (function (_super) {
65
+    __extends(WsApi, _super);
66
+    function WsApi() {
67
+        return _super !== null && _super.apply(this, arguments) || this;
68
+    }
69
+    WsApi.prototype.sendMsg = function (msg) {
70
+        return __awaiter(this, void 0, void 0, function () {
71
+            return __generator(this, function (_a) {
72
+                return [2, this.sendMessage(msg)];
73
+            });
74
+        });
75
+    };
76
+    WsApi.prototype.sendGetCmdMsg = function (action, extra) {
77
+        if (extra === void 0) { extra = {}; }
78
+        return __awaiter(this, void 0, void 0, function () {
79
+            var msg;
80
+            return __generator(this, function (_a) {
81
+                msg = CmdMsg_1.CmdMsg.createMsg(__assign({ from: this.from, action: action }, extra));
82
+                return [2, this.sendMsg(msg)];
83
+            });
84
+        });
85
+    };
86
+    WsApi.prototype.sendPostCmdMsg = function (action, userIds, extra) {
87
+        if (extra === void 0) { extra = {}; }
88
+        return __awaiter(this, void 0, void 0, function () {
89
+            var msg;
90
+            return __generator(this, function (_a) {
91
+                msg = CmdMsg_1.CmdMsg.createMsg(__assign({ from: this.from, to: (userIds || []).join(','), action: action }, extra));
92
+                return [2, this.sendMsg(msg)];
93
+            });
94
+        });
95
+    };
96
+    WsApi.prototype.getRoster = function () {
97
+        return this.sendGetCmdMsg('getRoster');
98
+    };
99
+    WsApi.prototype.addFriends = function (userIds) {
100
+        return this.sendPostCmdMsg('addFriends', userIds);
101
+    };
102
+    WsApi.prototype.agreeFriends = function (userIds) {
103
+        return this.sendPostCmdMsg('agreeFriends', userIds);
104
+    };
105
+    WsApi.prototype.rejectFriends = function (userIds) {
106
+        return this.sendPostCmdMsg('rejectFriends', userIds);
107
+    };
108
+    WsApi.prototype.removeFriends = function (userIds) {
109
+        return this.sendPostCmdMsg('removeFriends', userIds);
110
+    };
111
+    WsApi.prototype.getBlacklist = function () {
112
+        return this.sendGetCmdMsg('getBlacklist');
113
+    };
114
+    WsApi.prototype.addToBlackList = function (userIds) {
115
+        return this.sendPostCmdMsg('addToBlackList', userIds);
116
+    };
117
+    WsApi.prototype.removeBlackList = function (userIds) {
118
+        return this.sendPostCmdMsg('removeBlackList', userIds);
119
+    };
120
+    WsApi.prototype.deleteConversation = function (contactId, deleteMessage) {
121
+        if (deleteMessage === void 0) { deleteMessage = false; }
122
+        return this.request('/v1/delete/conversation', {
123
+            contact: contactId,
124
+            delete_message: deleteMessage
125
+        });
126
+    };
127
+    WsApi.prototype.markMessageRead = function (contactId) {
128
+        return this.request('/v1/mark/messages/read', {
129
+            contact: contactId
130
+        });
131
+    };
132
+    WsApi.prototype.listGroups = function () {
133
+        return this.sendGetCmdMsg('listGroups');
134
+    };
135
+    WsApi.prototype.queryGroupInfo = function (roomId) {
136
+        return this.sendGetCmdMsg('queryGroupInfo', { to: roomId });
137
+    };
138
+    WsApi.prototype.queryRoomMember = function (roomId) {
139
+        return this.sendGetCmdMsg('queryRoomMember', { to: roomId });
140
+    };
141
+    WsApi.prototype.getGroupBlackList = function (roomId) {
142
+        return this.sendGetCmdMsg('getGroupBlackList', { to: roomId });
143
+    };
144
+    WsApi.prototype.createGroup = function (groupOption) {
145
+        return this.sendPostCmdMsg('createGroup', null, { ext: groupOption });
146
+    };
147
+    WsApi.prototype.changeGroupInfo = function (groupOption) {
148
+        return this.sendPostCmdMsg('changeGroupInfo', null, { ext: groupOption });
149
+    };
150
+    WsApi.prototype.addGroupMembers = function (roomId, userIds) {
151
+        return this.sendPostCmdMsg('addGroupMembers', [roomId], {
152
+            ext: {
153
+                members: userIds
154
+            }
155
+        });
156
+    };
157
+    WsApi.prototype.addToGroupBlackList = function (roomId, userIds) {
158
+        return this.sendPostCmdMsg('addToGroupBlackList', [roomId], {
159
+            ext: {
160
+                members: userIds
161
+            }
162
+        });
163
+    };
164
+    WsApi.prototype.destroyGroup = function (roomId) {
165
+        return this.sendPostCmdMsg('destroyGroup', [roomId]);
166
+    };
167
+    WsApi.prototype.leaveGroup = function (roomId) {
168
+        return this.sendPostCmdMsg('leaveGroup', [roomId]);
169
+    };
170
+    WsApi.prototype.createRoom = function (groupOption) {
171
+        return this.sendPostCmdMsg('createGroup', null, { ext: groupOption });
172
+    };
173
+    WsApi.prototype.listRooms = function () {
174
+        return this.sendGetCmdMsg('listRooms');
175
+    };
176
+    WsApi.prototype.joinRoom = function (roomId) {
177
+        return this.sendPostCmdMsg('joinRoom', [roomId]);
178
+    };
179
+    WsApi.prototype.quitRoom = function (roomId) {
180
+        return this.sendPostCmdMsg('quitRoom', [roomId]);
181
+    };
182
+    return WsApi;
183
+}(WebSocketClient_1.WebSocketClient));
184
+exports.WsApi = WsApi;

+ 6
- 6
packages/cts-api/dist/cjs/index.js 查看文件

@@ -1,6 +1,6 @@
1
-"use strict";
2
-Object.defineProperty(exports, "__esModule", { value: true });
3
-var WsApi_1 = require("./api/WsApi");
4
-exports.WsApi = WsApi_1.WsApi;
5
-var WebSocketClient_1 = require("./WebSocketClient");
6
-exports.WebSocketClient = WebSocketClient_1.WebSocketClient;
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+var WsApi_1 = require("./api/WsApi");
4
+exports.WsApi = WsApi_1.WsApi;
5
+var WebSocketClient_1 = require("./WebSocketClient");
6
+exports.WebSocketClient = WebSocketClient_1.WebSocketClient;

+ 2
- 2
packages/cts-api/dist/cjs/messages.js 查看文件

@@ -1,2 +1,2 @@
1
-"use strict";
2
-Object.defineProperty(exports, "__esModule", { value: true });
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });

+ 84
- 74
packages/cts-api/dist/cjs/meta.js 查看文件

@@ -1,74 +1,84 @@
1
-"use strict";
2
-Object.defineProperty(exports, "__esModule", { value: true });
3
-function getMetaData() {
4
-    var nAgt = navigator.userAgent;
5
-    var browserName = navigator.appName;
6
-    var fullVersion = "" + parseFloat(navigator.appVersion);
7
-    var majorVersion = parseInt(navigator.appVersion, 10);
8
-    var nameOffset;
9
-    var verOffset;
10
-    var ix;
11
-    if ((verOffset = nAgt.indexOf('Opera')) !== -1) {
12
-        browserName = 'Opera';
13
-        fullVersion = nAgt.substring(verOffset + 6);
14
-        if ((verOffset = nAgt.indexOf('Version')) !== -1)
15
-            fullVersion = nAgt.substring(verOffset + 8);
16
-    }
17
-    else if ((verOffset = nAgt.indexOf('MSIE')) !== -1) {
18
-        browserName = 'Microsoft Internet Explorer';
19
-        fullVersion = nAgt.substring(verOffset + 5);
20
-    }
21
-    else if ((verOffset = nAgt.indexOf('Chrome')) !== -1) {
22
-        browserName = 'Chrome';
23
-        fullVersion = nAgt.substring(verOffset + 7);
24
-    }
25
-    else if ((verOffset = nAgt.indexOf('Safari')) !== -1) {
26
-        browserName = 'Safari';
27
-        fullVersion = nAgt.substring(verOffset + 7);
28
-        if ((verOffset = nAgt.indexOf('Version')) !== -1)
29
-            fullVersion = nAgt.substring(verOffset + 8);
30
-    }
31
-    else if ((verOffset = nAgt.indexOf('Firefox')) !== -1) {
32
-        browserName = 'Firefox';
33
-        fullVersion = nAgt.substring(verOffset + 8);
34
-    }
35
-    else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
36
-        browserName = nAgt.substring(nameOffset, verOffset);
37
-        fullVersion = nAgt.substring(verOffset + 1);
38
-        if (browserName.toLowerCase() === browserName.toUpperCase()) {
39
-            browserName = navigator.appName;
40
-        }
41
-    }
42
-    if ((ix = fullVersion.indexOf(';')) !== -1)
43
-        fullVersion = fullVersion.substring(0, ix);
44
-    if ((ix = fullVersion.indexOf(' ')) !== -1)
45
-        fullVersion = fullVersion.substring(0, ix);
46
-    majorVersion = parseInt("" + fullVersion, 10);
47
-    if (isNaN(majorVersion)) {
48
-        fullVersion = "" + parseFloat(navigator.appVersion);
49
-        majorVersion = parseInt(navigator.appVersion, 10);
50
-    }
51
-    var OSName = 'Unknown OS';
52
-    if (navigator.appVersion.indexOf('Win') !== -1)
53
-        OSName = 'Windows';
54
-    if (navigator.appVersion.indexOf('Mac') !== -1)
55
-        OSName = 'MacOS';
56
-    if (navigator.appVersion.indexOf('X11') !== -1)
57
-        OSName = 'UNIX';
58
-    if (navigator.appVersion.indexOf('Linux') !== -1)
59
-        OSName = 'Linux';
60
-    var isMobile = false;
61
-    if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) ||
62
-        /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))) {
63
-        isMobile = true;
64
-    }
65
-    return {
66
-        device: isMobile ? 'mobile' : 'pc',
67
-        os: OSName,
68
-        os_version: '',
69
-        app: 'WebLiveClient',
70
-        app_version: fullVersion,
71
-        tag: {}
72
-    };
73
-}
74
-exports.getMetaData = getMetaData;
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+function getMetaData() {
4
+    var nAgt = navigator.userAgent;
5
+    if (!nAgt) {
6
+        return {
7
+            device: 'app',
8
+            os: 'app',
9
+            os_version: '',
10
+            app: 'WebLiveClient',
11
+            app_version: '',
12
+            tag: {}
13
+        };
14
+    }
15
+    var browserName = navigator.appName;
16
+    var fullVersion = "" + parseFloat(navigator.appVersion);
17
+    var majorVersion = parseInt(navigator.appVersion, 10);
18
+    var nameOffset;
19
+    var verOffset;
20
+    var ix;
21
+    if ((verOffset = nAgt.indexOf('Opera')) !== -1) {
22
+        browserName = 'Opera';
23
+        fullVersion = nAgt.substring(verOffset + 6);
24
+        if ((verOffset = nAgt.indexOf('Version')) !== -1)
25
+            fullVersion = nAgt.substring(verOffset + 8);
26
+    }
27
+    else if ((verOffset = nAgt.indexOf('MSIE')) !== -1) {
28
+        browserName = 'Microsoft Internet Explorer';
29
+        fullVersion = nAgt.substring(verOffset + 5);
30
+    }
31
+    else if ((verOffset = nAgt.indexOf('Chrome')) !== -1) {
32
+        browserName = 'Chrome';
33
+        fullVersion = nAgt.substring(verOffset + 7);
34
+    }
35
+    else if ((verOffset = nAgt.indexOf('Safari')) !== -1) {
36
+        browserName = 'Safari';
37
+        fullVersion = nAgt.substring(verOffset + 7);
38
+        if ((verOffset = nAgt.indexOf('Version')) !== -1)
39
+            fullVersion = nAgt.substring(verOffset + 8);
40
+    }
41
+    else if ((verOffset = nAgt.indexOf('Firefox')) !== -1) {
42
+        browserName = 'Firefox';
43
+        fullVersion = nAgt.substring(verOffset + 8);
44
+    }
45
+    else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
46
+        browserName = nAgt.substring(nameOffset, verOffset);
47
+        fullVersion = nAgt.substring(verOffset + 1);
48
+        if (browserName.toLowerCase() === browserName.toUpperCase()) {
49
+            browserName = navigator.appName;
50
+        }
51
+    }
52
+    if ((ix = fullVersion.indexOf(';')) !== -1)
53
+        fullVersion = fullVersion.substring(0, ix);
54
+    if ((ix = fullVersion.indexOf(' ')) !== -1)
55
+        fullVersion = fullVersion.substring(0, ix);
56
+    majorVersion = parseInt("" + fullVersion, 10);
57
+    if (isNaN(majorVersion)) {
58
+        fullVersion = "" + parseFloat(navigator.appVersion);
59
+        majorVersion = parseInt(navigator.appVersion, 10);
60
+    }
61
+    var OSName = 'Unknown OS';
62
+    if (navigator.appVersion.indexOf('Win') !== -1)
63
+        OSName = 'Windows';
64
+    if (navigator.appVersion.indexOf('Mac') !== -1)
65
+        OSName = 'MacOS';
66
+    if (navigator.appVersion.indexOf('X11') !== -1)
67
+        OSName = 'UNIX';
68
+    if (navigator.appVersion.indexOf('Linux') !== -1)
69
+        OSName = 'Linux';
70
+    var isMobile = false;
71
+    if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) ||
72
+        /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))) {
73
+        isMobile = true;
74
+    }
75
+    return {
76
+        device: isMobile ? 'mobile' : 'pc',
77
+        os: OSName,
78
+        os_version: '',
79
+        app: 'WebLiveClient',
80
+        app_version: fullVersion,
81
+        tag: {}
82
+    };
83
+}
84
+exports.getMetaData = getMetaData;

+ 31
- 31
packages/cts-api/dist/cjs/protocol/AttachmentMsg.js 查看文件

@@ -1,31 +1,31 @@
1
-"use strict";
2
-var __extends = (this && this.__extends) || (function () {
3
-    var extendStatics = function (d, b) {
4
-        extendStatics = Object.setPrototypeOf ||
5
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
-        return extendStatics(d, b);
8
-    };
9
-    return function (d, b) {
10
-        extendStatics(d, b);
11
-        function __() { this.constructor = d; }
12
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
-    };
14
-})();
15
-Object.defineProperty(exports, "__esModule", { value: true });
16
-var MsgBase_1 = require("./MsgBase");
17
-var AttachmentMsg = (function (_super) {
18
-    __extends(AttachmentMsg, _super);
19
-    function AttachmentMsg() {
20
-        var _this = _super !== null && _super.apply(this, arguments) || this;
21
-        _this.type = 'attachment';
22
-        return _this;
23
-    }
24
-    AttachmentMsg.createMsg = function (baseMsg) {
25
-        var msg = new AttachmentMsg();
26
-        Object.assign(msg, baseMsg);
27
-        return msg;
28
-    };
29
-    return AttachmentMsg;
30
-}(MsgBase_1.MsgBase));
31
-exports.AttachmentMsg = AttachmentMsg;
1
+"use strict";
2
+var __extends = (this && this.__extends) || (function () {
3
+    var extendStatics = function (d, b) {
4
+        extendStatics = Object.setPrototypeOf ||
5
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+        return extendStatics(d, b);
8
+    };
9
+    return function (d, b) {
10
+        extendStatics(d, b);
11
+        function __() { this.constructor = d; }
12
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+    };
14
+})();
15
+Object.defineProperty(exports, "__esModule", { value: true });
16
+var MsgBase_1 = require("./MsgBase");
17
+var AttachmentMsg = (function (_super) {
18
+    __extends(AttachmentMsg, _super);
19
+    function AttachmentMsg() {
20
+        var _this = _super !== null && _super.apply(this, arguments) || this;
21
+        _this.msgType = 'attachment';
22
+        return _this;
23
+    }
24
+    AttachmentMsg.createMsg = function (baseMsg) {
25
+        var msg = new AttachmentMsg();
26
+        Object.assign(msg, baseMsg);
27
+        return msg;
28
+    };
29
+    return AttachmentMsg;
30
+}(MsgBase_1.MsgBase));
31
+exports.AttachmentMsg = AttachmentMsg;

+ 31
- 31
packages/cts-api/dist/cjs/protocol/CmdMsg.js 查看文件

@@ -1,31 +1,31 @@
1
-"use strict";
2
-var __extends = (this && this.__extends) || (function () {
3
-    var extendStatics = function (d, b) {
4
-        extendStatics = Object.setPrototypeOf ||
5
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
-        return extendStatics(d, b);
8
-    };
9
-    return function (d, b) {
10
-        extendStatics(d, b);
11
-        function __() { this.constructor = d; }
12
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
-    };
14
-})();
15
-Object.defineProperty(exports, "__esModule", { value: true });
16
-var MsgBase_1 = require("./MsgBase");
17
-var CmdMsg = (function (_super) {
18
-    __extends(CmdMsg, _super);
19
-    function CmdMsg() {
20
-        var _this = _super !== null && _super.apply(this, arguments) || this;
21
-        _this.type = 'cmd';
22
-        return _this;
23
-    }
24
-    CmdMsg.createMsg = function (baseMsg) {
25
-        var msg = new CmdMsg();
26
-        Object.assign(msg, baseMsg);
27
-        return msg;
28
-    };
29
-    return CmdMsg;
30
-}(MsgBase_1.MsgBase));
31
-exports.CmdMsg = CmdMsg;
1
+"use strict";
2
+var __extends = (this && this.__extends) || (function () {
3
+    var extendStatics = function (d, b) {
4
+        extendStatics = Object.setPrototypeOf ||
5
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+        return extendStatics(d, b);
8
+    };
9
+    return function (d, b) {
10
+        extendStatics(d, b);
11
+        function __() { this.constructor = d; }
12
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+    };
14
+})();
15
+Object.defineProperty(exports, "__esModule", { value: true });
16
+var MsgBase_1 = require("./MsgBase");
17
+var CmdMsg = (function (_super) {
18
+    __extends(CmdMsg, _super);
19
+    function CmdMsg() {
20
+        var _this = _super !== null && _super.apply(this, arguments) || this;
21
+        _this.msgType = 'cmd';
22
+        return _this;
23
+    }
24
+    CmdMsg.createMsg = function (baseMsg) {
25
+        var msg = new CmdMsg();
26
+        Object.assign(msg, baseMsg);
27
+        return msg;
28
+    };
29
+    return CmdMsg;
30
+}(MsgBase_1.MsgBase));
31
+exports.CmdMsg = CmdMsg;

+ 55
- 55
packages/cts-api/dist/cjs/protocol/MediaMsg.js 查看文件

@@ -1,55 +1,55 @@
1
-"use strict";
2
-var __extends = (this && this.__extends) || (function () {
3
-    var extendStatics = function (d, b) {
4
-        extendStatics = Object.setPrototypeOf ||
5
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
-        return extendStatics(d, b);
8
-    };
9
-    return function (d, b) {
10
-        extendStatics(d, b);
11
-        function __() { this.constructor = d; }
12
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
-    };
14
-})();
15
-var __assign = (this && this.__assign) || function () {
16
-    __assign = Object.assign || function(t) {
17
-        for (var s, i = 1, n = arguments.length; i < n; i++) {
18
-            s = arguments[i];
19
-            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
-                t[p] = s[p];
21
-        }
22
-        return t;
23
-    };
24
-    return __assign.apply(this, arguments);
25
-};
26
-Object.defineProperty(exports, "__esModule", { value: true });
27
-var MsgBase_1 = require("./MsgBase");
28
-var MediaMsg = (function (_super) {
29
-    __extends(MediaMsg, _super);
30
-    function MediaMsg() {
31
-        var _this = _super !== null && _super.apply(this, arguments) || this;
32
-        _this.type = 'media';
33
-        return _this;
34
-    }
35
-    MediaMsg.createMsg = function (baseMsg) {
36
-        var msg = new MediaMsg();
37
-        Object.assign(msg, baseMsg);
38
-        return msg;
39
-    };
40
-    MediaMsg.createFromClipboard = function (baseMsg, clipboardData) {
41
-        if (clipboardData && clipboardData.types) {
42
-            if (clipboardData.items.length > 0) {
43
-                var blob = clipboardData.items[0].getAsFile();
44
-                var url = window.URL.createObjectURL(blob);
45
-                return MediaMsg.createMsg(__assign({}, baseMsg, { file: {
46
-                        data: blob,
47
-                        url: url
48
-                    } }));
49
-            }
50
-        }
51
-        return null;
52
-    };
53
-    return MediaMsg;
54
-}(MsgBase_1.MsgBase));
55
-exports.MediaMsg = MediaMsg;
1
+"use strict";
2
+var __extends = (this && this.__extends) || (function () {
3
+    var extendStatics = function (d, b) {
4
+        extendStatics = Object.setPrototypeOf ||
5
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+        return extendStatics(d, b);
8
+    };
9
+    return function (d, b) {
10
+        extendStatics(d, b);
11
+        function __() { this.constructor = d; }
12
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+    };
14
+})();
15
+var __assign = (this && this.__assign) || function () {
16
+    __assign = Object.assign || function(t) {
17
+        for (var s, i = 1, n = arguments.length; i < n; i++) {
18
+            s = arguments[i];
19
+            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
+                t[p] = s[p];
21
+        }
22
+        return t;
23
+    };
24
+    return __assign.apply(this, arguments);
25
+};
26
+Object.defineProperty(exports, "__esModule", { value: true });
27
+var MsgBase_1 = require("./MsgBase");
28
+var MediaMsg = (function (_super) {
29
+    __extends(MediaMsg, _super);
30
+    function MediaMsg() {
31
+        var _this = _super !== null && _super.apply(this, arguments) || this;
32
+        _this.msgType = 'audio';
33
+        return _this;
34
+    }
35
+    MediaMsg.createMsg = function (baseMsg) {
36
+        var msg = new MediaMsg();
37
+        Object.assign(msg, baseMsg);
38
+        return msg;
39
+    };
40
+    MediaMsg.createFromClipboard = function (baseMsg, clipboardData) {
41
+        if (clipboardData && clipboardData.types) {
42
+            if (clipboardData.items.length > 0) {
43
+                var blob = clipboardData.items[0].getAsFile();
44
+                var url = window.URL.createObjectURL(blob);
45
+                return MediaMsg.createMsg(__assign({}, baseMsg, { file: {
46
+                        data: blob,
47
+                        url: url
48
+                    } }));
49
+            }
50
+        }
51
+        return null;
52
+    };
53
+    return MediaMsg;
54
+}(MsgBase_1.MsgBase));
55
+exports.MediaMsg = MediaMsg;

+ 21
- 21
packages/cts-api/dist/cjs/protocol/MsgBase.js 查看文件

@@ -1,21 +1,21 @@
1
-"use strict";
2
-Object.defineProperty(exports, "__esModule", { value: true });
3
-var uuid_1 = require("../utils/uuid");
4
-var MsgBase = (function () {
5
-    function MsgBase() {
6
-        this.id = uuid_1.uuid();
7
-    }
8
-    MsgBase.prototype.isValid = function () {
9
-        if (!this.from || !this.to) {
10
-            return false;
11
-        }
12
-        return true;
13
-    };
14
-    MsgBase.createMsg = function (baseMsg) {
15
-        var msg = new MsgBase();
16
-        Object.assign(msg, baseMsg);
17
-        return msg;
18
-    };
19
-    return MsgBase;
20
-}());
21
-exports.MsgBase = MsgBase;
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+var uuid_1 = require("uuid");
4
+var MsgBase = (function () {
5
+    function MsgBase() {
6
+        this.id = uuid_1.v1();
7
+    }
8
+    MsgBase.prototype.isValid = function () {
9
+        if (!this.from || !this.to) {
10
+            return false;
11
+        }
12
+        return true;
13
+    };
14
+    MsgBase.createMsg = function (baseMsg) {
15
+        var msg = new MsgBase();
16
+        Object.assign(msg, baseMsg);
17
+        return msg;
18
+    };
19
+    return MsgBase;
20
+}());
21
+exports.MsgBase = MsgBase;

+ 31
- 31
packages/cts-api/dist/cjs/protocol/TextMsg.js 查看文件

@@ -1,31 +1,31 @@
1
-"use strict";
2
-var __extends = (this && this.__extends) || (function () {
3
-    var extendStatics = function (d, b) {
4
-        extendStatics = Object.setPrototypeOf ||
5
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
-        return extendStatics(d, b);
8
-    };
9
-    return function (d, b) {
10
-        extendStatics(d, b);
11
-        function __() { this.constructor = d; }
12
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
-    };
14
-})();
15
-Object.defineProperty(exports, "__esModule", { value: true });
16
-var MsgBase_1 = require("./MsgBase");
17
-var TextMsg = (function (_super) {
18
-    __extends(TextMsg, _super);
19
-    function TextMsg() {
20
-        var _this = _super !== null && _super.apply(this, arguments) || this;
21
-        _this.type = 'text';
22
-        return _this;
23
-    }
24
-    TextMsg.createMsg = function (baseMsg) {
25
-        var msg = new TextMsg();
26
-        Object.assign(msg, baseMsg);
27
-        return msg;
28
-    };
29
-    return TextMsg;
30
-}(MsgBase_1.MsgBase));
31
-exports.TextMsg = TextMsg;
1
+"use strict";
2
+var __extends = (this && this.__extends) || (function () {
3
+    var extendStatics = function (d, b) {
4
+        extendStatics = Object.setPrototypeOf ||
5
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+        return extendStatics(d, b);
8
+    };
9
+    return function (d, b) {
10
+        extendStatics(d, b);
11
+        function __() { this.constructor = d; }
12
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+    };
14
+})();
15
+Object.defineProperty(exports, "__esModule", { value: true });
16
+var MsgBase_1 = require("./MsgBase");
17
+var TextMsg = (function (_super) {
18
+    __extends(TextMsg, _super);
19
+    function TextMsg() {
20
+        var _this = _super !== null && _super.apply(this, arguments) || this;
21
+        _this.msgType = 'text';
22
+        return _this;
23
+    }
24
+    TextMsg.createMsg = function (baseMsg) {
25
+        var msg = new TextMsg();
26
+        Object.assign(msg, baseMsg);
27
+        return msg;
28
+    };
29
+    return TextMsg;
30
+}(MsgBase_1.MsgBase));
31
+exports.TextMsg = TextMsg;

+ 0
- 4
packages/cts-api/dist/cjs/utils/uuid.js 查看文件

@@ -1,4 +0,0 @@
1
-"use strict";
2
-Object.defineProperty(exports, "__esModule", { value: true });
3
-var uuidV1 = require("uuid/v1");
4
-exports.uuid = uuidV1;

+ 3
- 3
packages/cts-api/dist/index.js
文件差異過大導致無法顯示
查看文件


+ 96
- 92
packages/cts-api/dist/types/WebSocketClient.d.ts 查看文件

@@ -1,92 +1,96 @@
1
-import { Client } from 'ts-linker-sdk';
2
-import { ContactMsg, ContactAddMsg, ChatroomMsg } from './messages';
3
-export interface WebSocketClientStatus {
4
-    created: boolean;
5
-    connected: boolean;
6
-    login: boolean;
7
-}
8
-export interface WebSocketResp {
9
-    value: object | string;
10
-}
11
-export declare type ListenerCallback = (data: WebSocketResp) => void;
12
-export declare class WebSocketClient {
13
-    client: Client;
14
-    interval: number;
15
-    wsUrl: string;
16
-    token: string;
17
-    sid: string;
18
-    chatToken: object;
19
-    status: WebSocketClientStatus;
20
-    constructor(wsUrl: string, token: string, sid: string, chatToken: object);
21
-    init(): Promise<{}>;
22
-    getStatus(): WebSocketClientStatus;
23
-    create(): Promise<{}>;
24
-    on(url: string, callback: (data: WebSocketResp) => void): void;
25
-    off(url: string): void;
26
-    request(url: string, data: object): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
27
-    connect(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
28
-    ping(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
29
-    authentication(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
30
-    onMessage(callback: ListenerCallback): Promise<void>;
31
-    sendMessage(data: object): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
32
-    markServiced(data: {
33
-        msg_id: string;
34
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
35
-    getHistoryMessage(data: {
36
-        contact_id: string;
37
-        chat_type: string;
38
-        start_time: number;
39
-        limit: number;
40
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
41
-    updateStatus(data: {
42
-        status: 'on' | 'off' | 'busy';
43
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
44
-    getSessionLists(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
45
-    getAllConversations(data: {
46
-        last_pull: number;
47
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
48
-    getAllContact(data: {
49
-        last_pull: number;
50
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
51
-    addContact(data: {
52
-        to_add_username: string;
53
-        reason: string;
54
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
55
-    deleteContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
56
-    maskingContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
57
-    removeMaskingContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
58
-    stickingContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
59
-    removeStickContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
60
-    setNoDisturbing(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
61
-    removeNoDisturbing(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
62
-    agreeAddContact(data: ContactAddMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
63
-    rejectAddContact(data: ContactAddMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
64
-    addContactServiced(data: ContactAddMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
65
-    createChatroom(data: {
66
-        subject: string;
67
-        description: string;
68
-        welcome_message: string;
69
-        max: number;
70
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
71
-    destroyChatroom(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
72
-    leaveChatroom(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
73
-    getChatroomProfile(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
74
-    updateChatroomSubject(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
75
-    updateChatroomDescription(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
76
-    addChatroomAdmin(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
77
-    removeChatroomAdmin(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
78
-    addChatroomAdmins(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
79
-    removeChatroomAdmins(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
80
-    joinChatroom(data: {}): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
81
-    removeChatroomMember(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
82
-    fetchStickChatroom(data: {
83
-        cache_time: number;
84
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
85
-    fetchChatroomMembers(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
86
-    searchHistoryMessage(data: {
87
-        contact_id: string;
88
-        chat_type: string;
89
-        keyword: string;
90
-        limit: number;
91
-    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
92
-}
1
+import { Client } from 'ts-linker-sdk';
2
+import { ContactMsg, ContactAddMsg, ChatroomMsg } from './messages';
3
+export interface WebSocketClientStatus {
4
+    created: boolean;
5
+    connected: boolean;
6
+    login: boolean;
7
+}
8
+export interface WebSocketResp {
9
+    value: object | string;
10
+}
11
+export declare type ListenerCallback = (data: WebSocketResp) => void;
12
+export declare class WebSocketClient {
13
+    client: Client;
14
+    interval: number;
15
+    wsUrl: string;
16
+    token: string;
17
+    sid: string;
18
+    chatToken: object;
19
+    extendOpts: any;
20
+    status: WebSocketClientStatus;
21
+    constructor(wsUrl: string, token: string, sid: string, chatToken: object, extendOpts: any);
22
+    init(): Promise<{}>;
23
+    getStatus(): WebSocketClientStatus;
24
+    create(): Promise<{}>;
25
+    on(url: string, callback: (data: WebSocketResp) => void): void;
26
+    off(url: string): void;
27
+    request(url: string, data: object): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
28
+    connect(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
29
+    ping(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
30
+    authentication(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
31
+    onMessage(callback: ListenerCallback): Promise<void>;
32
+    sendMessage(data: object): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
33
+    markServiced(data: {
34
+        msg_id: string;
35
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
36
+    messageReaded(data: {
37
+        msg_id: string;
38
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
39
+    getHistoryMessage(data: {
40
+        contact_id: string;
41
+        chat_type: string;
42
+        start_time: number;
43
+        limit: number;
44
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
45
+    updateStatus(data: {
46
+        status: 'on' | 'off' | 'busy';
47
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
48
+    getSessionLists(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
49
+    getAllConversations(data: {
50
+        last_pull: number;
51
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
52
+    getAllContact(data: {
53
+        last_pull: number;
54
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
55
+    addContact(data: {
56
+        to_add_username: string;
57
+        reason: string;
58
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
59
+    deleteContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
60
+    maskingContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
61
+    removeMaskingContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
62
+    stickingContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
63
+    removeStickContact(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
64
+    setNoDisturbing(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
65
+    removeNoDisturbing(data: ContactMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
66
+    agreeAddContact(data: ContactAddMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
67
+    rejectAddContact(data: ContactAddMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
68
+    addContactServiced(data: ContactAddMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
69
+    createChatroom(data: {
70
+        subject: string;
71
+        description: string;
72
+        welcome_message: string;
73
+        max: number;
74
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
75
+    destroyChatroom(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
76
+    leaveChatroom(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
77
+    getChatroomProfile(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
78
+    updateChatroomSubject(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
79
+    updateChatroomDescription(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
80
+    addChatroomAdmin(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
81
+    removeChatroomAdmin(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
82
+    addChatroomAdmins(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
83
+    removeChatroomAdmins(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
84
+    joinChatroom(data: {}): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
85
+    removeChatroomMember(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
86
+    fetchStickChatroom(data: {
87
+        cache_time: number;
88
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
89
+    fetchChatroomMembers(data: ChatroomMsg): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
90
+    searchHistoryMessage(data: {
91
+        contact_id: string;
92
+        chat_type: string;
93
+        keyword: string;
94
+        limit: number;
95
+    }): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
96
+}

+ 33
- 33
packages/cts-api/dist/types/api/WsApi.d.ts 查看文件

@@ -1,33 +1,33 @@
1
-import { WebSocketClient } from './../WebSocketClient';
2
-import { MsgBase, GroupOption } from '../protocol/MsgBase';
3
-export declare class WsApi extends WebSocketClient {
4
-    token: string;
5
-    from: string;
6
-    sendMsg(msg: Partial<MsgBase>): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
7
-    sendGetCmdMsg(action: string, extra?: {}): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
8
-    sendPostCmdMsg(action: string, userIds: string[] | null, extra?: {}): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
9
-    getRoster(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
10
-    addFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
11
-    agreeFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
12
-    rejectFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
13
-    removeFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
14
-    getBlacklist(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
15
-    addToBlackList(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
16
-    removeBlackList(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
17
-    deleteConversation(contactId: string, deleteMessage?: boolean): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
18
-    markMessageRead(contactId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
19
-    listGroups(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
20
-    queryGroupInfo(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
21
-    queryRoomMember(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
22
-    getGroupBlackList(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
23
-    createGroup(groupOption: GroupOption): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
24
-    changeGroupInfo(groupOption: GroupOption): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
25
-    addGroupMembers(roomId: string, userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
26
-    addToGroupBlackList(roomId: string, userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
27
-    destroyGroup(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
28
-    leaveGroup(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
29
-    createRoom(groupOption: GroupOption): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
30
-    listRooms(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
31
-    joinRoom(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
32
-    quitRoom(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
33
-}
1
+import { WebSocketClient } from './../WebSocketClient';
2
+import { MsgBase, GroupOption } from '../protocol/MsgBase';
3
+export declare class WsApi extends WebSocketClient {
4
+    token: string;
5
+    from: string;
6
+    sendMsg(msg: Partial<MsgBase>): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
7
+    sendGetCmdMsg(action: string, extra?: {}): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
8
+    sendPostCmdMsg(action: string, userIds: string[] | null, extra?: {}): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
9
+    getRoster(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
10
+    addFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
11
+    agreeFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
12
+    rejectFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
13
+    removeFriends(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
14
+    getBlacklist(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
15
+    addToBlackList(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
16
+    removeBlackList(userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
17
+    deleteConversation(contactId: string, deleteMessage?: boolean): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
18
+    markMessageRead(contactId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
19
+    listGroups(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
20
+    queryGroupInfo(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
21
+    queryRoomMember(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
22
+    getGroupBlackList(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
23
+    createGroup(groupOption: GroupOption): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
24
+    changeGroupInfo(groupOption: GroupOption): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
25
+    addGroupMembers(roomId: string, userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
26
+    addToGroupBlackList(roomId: string, userIds: string[]): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
27
+    destroyGroup(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
28
+    leaveGroup(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
29
+    createRoom(groupOption: GroupOption): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
30
+    listRooms(): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
31
+    joinRoom(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
32
+    quitRoom(roomId: string): Promise<import("ts-linker-sdk/dist/types/types").WebSocketResp>;
33
+}

+ 3
- 2
packages/cts-api/dist/types/index.d.ts 查看文件

@@ -1,2 +1,3 @@
1
-export { WsApi } from './api/WsApi';
2
-export { WebSocketClient } from './WebSocketClient';
1
+export { WsApi } from './api/WsApi';
2
+export { WebSocketClient } from './WebSocketClient';
3
+export { MsgType, ChatType } from './protocol/MsgBase';

+ 28
- 28
packages/cts-api/dist/types/messages.d.ts 查看文件

@@ -1,28 +1,28 @@
1
-export interface ContactMsg {
2
-    fid: string;
3
-}
4
-export interface ContactAddMsg {
5
-    id: string;
6
-    to: string;
7
-}
8
-export interface ChatroomMsg {
9
-    room_id: string;
10
-    admin_id?: string;
11
-    admins_id?: string[];
12
-    member: string;
13
-    authority?: number;
14
-}
15
-export interface ChatMsg {
16
-    from: string;
17
-    type: 'room';
18
-    to: string;
19
-    msg: {
20
-        type: 'cmd' | 'text' | 'image';
21
-        command?: string;
22
-        action?: string;
23
-        message?: string;
24
-        msg_id?: string;
25
-    };
26
-    msg_id?: string;
27
-    ext?: Record<string, string>;
28
-}
1
+export interface ContactMsg {
2
+    fid: string;
3
+}
4
+export interface ContactAddMsg {
5
+    id: string;
6
+    to: string;
7
+}
8
+export interface ChatroomMsg {
9
+    room_id: string;
10
+    admin_id?: string;
11
+    admins_id?: string[];
12
+    member: string;
13
+    authority?: number;
14
+}
15
+export interface ChatMsg {
16
+    from: string;
17
+    type: 'room';
18
+    to: string;
19
+    msg: {
20
+        type: 'cmd' | 'text' | 'image';
21
+        command?: string;
22
+        action?: string;
23
+        message?: string;
24
+        msg_id?: string;
25
+    };
26
+    msg_id?: string;
27
+    ext?: Record<string, string>;
28
+}

+ 8
- 8
packages/cts-api/dist/types/meta.d.ts 查看文件

@@ -1,8 +1,8 @@
1
-export declare function getMetaData(): {
2
-    device: string;
3
-    os: string;
4
-    os_version: string;
5
-    app: string;
6
-    app_version: string;
7
-    tag: {};
8
-};
1
+export declare function getMetaData(): {
2
+    device: string;
3
+    os: string;
4
+    os_version: string;
5
+    app: string;
6
+    app_version: string;
7
+    tag: {};
8
+};

+ 6
- 6
packages/cts-api/dist/types/protocol/AttachmentMsg.d.ts 查看文件

@@ -1,6 +1,6 @@
1
-import { MsgBase, MsgType } from './MsgBase';
2
-export declare class AttachmentMsg extends MsgBase {
3
-    type: MsgType;
4
-    msg: string;
5
-    static createMsg(baseMsg: Partial<AttachmentMsg>): AttachmentMsg;
6
-}
1
+import { MsgBase, MsgType } from './MsgBase';
2
+export declare class AttachmentMsg extends MsgBase {
3
+    msgType: MsgType;
4
+    msg: string;
5
+    static createMsg(baseMsg: Partial<AttachmentMsg>): AttachmentMsg;
6
+}

+ 7
- 7
packages/cts-api/dist/types/protocol/CmdMsg.d.ts 查看文件

@@ -1,7 +1,7 @@
1
-import { MsgBase, MsgType } from './MsgBase';
2
-export declare class CmdMsg extends MsgBase {
3
-    type: MsgType;
4
-    msg: string;
5
-    action: string;
6
-    static createMsg(baseMsg: Partial<CmdMsg>): CmdMsg;
7
-}
1
+import { MsgBase, MsgType } from './MsgBase';
2
+export declare class CmdMsg extends MsgBase {
3
+    msgType: MsgType;
4
+    msg: string;
5
+    action: string;
6
+    static createMsg(baseMsg: Partial<CmdMsg>): CmdMsg;
7
+}

+ 10
- 10
packages/cts-api/dist/types/protocol/MediaMsg.d.ts 查看文件

@@ -1,10 +1,10 @@
1
-import { MsgBase, MsgType } from './MsgBase';
2
-export declare class MediaMsg extends MsgBase {
3
-    type: MsgType;
4
-    file: {
5
-        data: Blob | null;
6
-        url: string;
7
-    };
8
-    static createMsg(baseMsg: Partial<MediaMsg>): MediaMsg;
9
-    static createFromClipboard(baseMsg: Partial<MediaMsg>, clipboardData: DataTransfer): MediaMsg | null;
10
-}
1
+import { MsgBase, MsgType } from './MsgBase';
2
+export declare class MediaMsg extends MsgBase {
3
+    msgType: MsgType;
4
+    file: {
5
+        data: Blob | null;
6
+        url: string;
7
+    };
8
+    static createMsg(baseMsg: Partial<MediaMsg>): MediaMsg;
9
+    static createFromClipboard(baseMsg: Partial<MediaMsg>, clipboardData: DataTransfer): MediaMsg | null;
10
+}

+ 12
- 21
packages/cts-api/dist/types/protocol/MsgBase.d.ts 查看文件

@@ -1,21 +1,12 @@
1
-export declare type MsgType = 'text' | 'media' | 'cmd' | 'attachment';
2
-export declare type RoomType = 'single' | 'room';
3
-export declare type GroupOption = {
4
-    subject: string;
5
-    description: string;
6
-    members: string[];
7
-    optionsPublic: boolean;
8
-    optionsModerate: boolean;
9
-    optionsMembersOnly: boolean;
10
-    optionsAllowInvites: boolean;
11
-};
12
-export declare class MsgBase {
13
-    id: string;
14
-    from: string;
15
-    to: string;
16
-    type: MsgType;
17
-    roomType: RoomType;
18
-    ext: Record<string, string>;
19
-    isValid(): boolean;
20
-    static createMsg(baseMsg: Partial<MsgBase>): MsgBase;
21
-}
1
+export declare type MsgType = 'text' | 'audio' | 'video' | 'image' | 'cmd' | 'attachment';
2
+export declare type ChatType = 'chat' | 'room' | 'group' | 'push';
3
+export declare class MsgBase {
4
+    id: string;
5
+    from: string;
6
+    to: string;
7
+    type: ChatType;
8
+    ext: Record<string, string>;
9
+    isValid(): boolean;
10
+    static createMsg(baseMsg: Partial<MsgBase>): MsgBase;
11
+}
12
+export declare type GroupOption = {};

+ 6
- 6
packages/cts-api/dist/types/protocol/TextMsg.d.ts 查看文件

@@ -1,6 +1,6 @@
1
-import { MsgBase, MsgType } from './MsgBase';
2
-export declare class TextMsg extends MsgBase {
3
-    type: MsgType;
4
-    msg: string;
5
-    static createMsg(baseMsg: Partial<TextMsg>): TextMsg;
6
-}
1
+import { MsgBase, MsgType } from './MsgBase';
2
+export declare class TextMsg extends MsgBase {
3
+    msgType: MsgType;
4
+    msg: string;
5
+    static createMsg(baseMsg: Partial<TextMsg>): TextMsg;
6
+}

+ 0
- 1
packages/cts-api/dist/types/utils/uuid.d.ts 查看文件

@@ -1 +0,0 @@
1
-export declare const uuid: import("uuid/interfaces").v1;

+ 2
- 2
packages/cts-api/package.json 查看文件

@@ -27,9 +27,9 @@
27 27
   "scripts": {
28 28
     "build": "npm run clean && npm run build:cjs && npm run copy && npm run build:umd",
29 29
     "build:cjs": "tsc --project ./tsconfig.cjs.json && npm run copy",
30
-    "build:umd": "NODE_ENV=production webpack --config ./scripts/webpack/webpack.config.umd.js",
30
+    "build:umd": "cross-env NODE_ENV=production webpack --config ./scripts/webpack/webpack.config.umd.js",
31 31
     "clean": "rimraf dist",
32
-    "copy": "copyfiles -u 1 './src/**/*.(less|svg)' dist/cjs/",
32
+    "copy": "copyfiles -u 1 \"./src/**/*.(less|svg)\" dist/cjs/",
33 33
     "dev": "webpack-dev-server --config ./scripts/webpack/webpack.config.dev.js --hot",
34 34
     "pub": "npm run clean && npm run build && npm publish",
35 35
     "start": "npm run dev"

+ 5
- 5
packages/cts-api/scripts/webpack/webpack.config.dev.js 查看文件

@@ -5,15 +5,15 @@ const devConfig = require('../../../../scripts/webpack/webpack.config.dev');
5 5
 
6 6
 module.exports = merge(devConfig, {
7 7
   entry: {
8
-    index: path.resolve(__dirname, '../../example/index.ts')
8
+    index: path.resolve(__dirname, '../../example/index.ts'),
9 9
   },
10 10
   devServer: {
11
-    contentBase: path.resolve(__dirname, '../../public')
11
+    contentBase: path.resolve(__dirname, '../../public'),
12 12
   },
13 13
   resolve: {
14 14
     alias: {
15 15
       react: path.resolve('./node_modules/react'),
16
-      'react-dom': path.resolve('./node_modules/react-dom')
17
-    }
18
-  }
16
+      'react-dom': path.resolve('./node_modules/react-dom'),
17
+    },
18
+  },
19 19
 });

+ 3
- 3
packages/cts-api/scripts/webpack/webpack.config.umd.js 查看文件

@@ -1,10 +1,10 @@
1
-const merge = require('webpack-merge');
1
+const { merge } = require('webpack-merge');
2 2
 const path = require('path');
3 3
 
4 4
 const umdConfig = require('../../../../scripts/webpack/webpack.config.umd');
5 5
 
6 6
 module.exports = merge(umdConfig, {
7 7
   entry: {
8
-    index: path.resolve(__dirname, '../../src/index.ts')
9
-  }
8
+    index: path.resolve(__dirname, '../../src/index.ts'),
9
+  },
10 10
 });

+ 15
- 2
packages/cts-api/src/WebSocketClient.ts 查看文件

@@ -26,7 +26,8 @@ export class WebSocketClient {
26 26
   token: string;
27 27
   sid: string;
28 28
   chatToken: object;
29
-
29
+  extendOpts: any;
30
+  
30 31
   status: WebSocketClientStatus = {
31 32
     created: false,
32 33
     connected: false,
@@ -34,11 +35,12 @@ export class WebSocketClient {
34 35
   };
35 36
 
36 37
   /** 默认构造函数 */
37
-  constructor(wsUrl: string, token: string, sid: string, chatToken: object) {
38
+  constructor(wsUrl: string, token: string, sid: string, chatToken: object, extendOpts: any) {
38 39
     this.wsUrl = wsUrl;
39 40
     this.token = token;
40 41
     this.chatToken = chatToken;
41 42
     this.sid = sid;
43
+    this.extendOpts = extendOpts;
42 44
   }
43 45
 
44 46
   async init() {
@@ -103,6 +105,17 @@ export class WebSocketClient {
103 105
     if (sid) {
104 106
       this.client.setRequestProperty('sid', sid);
105 107
     }
108
+    let param = {
109
+      ...this.chatToken,
110
+      ...meta
111
+    }
112
+
113
+    if (this.extendOpts && this.extendOpts.connectOptions) {
114
+      param = {
115
+        ...param,
116
+        ...this.extendOpts.connectOptions,
117
+      }
118
+    }
106 119
 
107 120
     const data = await this.request('/v1/session/start', {
108 121
       ...this.chatToken,

+ 6
- 2
packages/cts-api/src/protocol/MsgBase.ts 查看文件

@@ -1,4 +1,4 @@
1
-import { uuid } from '../utils/uuid';
1
+import { v1 as uuidV1 } from 'uuid';
2 2
 
3 3
 export type MsgType = 'text' | 'audio' | 'video' | 'image' |'cmd' | 'attachment';
4 4
 
@@ -6,7 +6,7 @@ export type ChatType = 'chat' | 'room' | 'group' | 'push';
6 6
 
7 7
 export class MsgBase {
8 8
   // 消息编号
9
-  id: string = uuid();
9
+  id: string = uuidV1();
10 10
 
11 11
   // 消息发送方,如果是从多个人发出,则用 , 逗号分隔
12 12
   from: string;
@@ -35,3 +35,7 @@ export class MsgBase {
35 35
     return msg;
36 36
   }
37 37
 }
38
+
39
+export type GroupOption = {
40
+
41
+}

+ 0
- 3
packages/cts-api/src/utils/uuid.ts 查看文件

@@ -1,3 +0,0 @@
1
-import * as uuidV1 from 'uuid/v1';
2
-
3
-export const uuid = uuidV1;

+ 18
- 18
scripts/webpack/webpack.config.prod.js 查看文件

@@ -16,33 +16,33 @@ const config = {
16 16
   mode: 'production',
17 17
   output: {
18 18
     ...baseConfig.output,
19
-    filename: '[name].js'
19
+    filename: '[name].js',
20 20
   },
21 21
   module: {
22 22
     rules: [
23 23
       ...baseConfig.module.rules.filter(
24
-        rule => !['/\\.css$/', '/\\.less$/', '/\\.(scss|sass)$/'].includes(rule.test.toString())
24
+        (rule) => !['/\\.css$/', '/\\.less$/', '/\\.(scss|sass)$/'].includes(rule.test.toString())
25 25
       ),
26 26
       {
27 27
         test: /\.css$/,
28
-        use: ['style-loader', 'css-loader', 'postcss-loader']
28
+        use: ['style-loader', 'css-loader', 'postcss-loader'],
29 29
       },
30 30
       {
31 31
         test: /\.less$/,
32 32
         exclude: /node_modules/,
33
-        use: ['style-loader', 'css-loader', 'postcss-loader', baseConfig.extra.lessLoader]
33
+        use: ['style-loader', 'css-loader', 'postcss-loader', baseConfig.extra.lessLoader],
34 34
       },
35 35
       {
36 36
         test: /\.less$/,
37 37
         include: /node_modules/,
38
-        use: ['style-loader', 'css-loader', 'postcss-loader', baseConfig.extra.lessLoader]
39
-      }
40
-    ]
38
+        use: ['style-loader', 'css-loader', 'postcss-loader', baseConfig.extra.lessLoader],
39
+      },
40
+    ],
41 41
   },
42 42
   plugins: [
43 43
     ...baseConfig.plugins,
44 44
     new webpack.DefinePlugin({
45
-      isProd: JSON.stringify(true)
45
+      isProd: JSON.stringify(true),
46 46
     }),
47 47
 
48 48
     // 使用 Prepack 优化包体大小
@@ -54,7 +54,7 @@ const config = {
54 54
     // }),
55 55
 
56 56
     // 必须将 CopyWebpackPlugin 与 HtmlWebpackPlugin 添加到末尾
57
-    new CopyWebpackPlugin([{ from: buildEnv.public, to: buildEnv.build }]),
57
+    new CopyWebpackPlugin({ patterns: [{ from: buildEnv.public, to: buildEnv.build }] }),
58 58
     new HtmlWebpackPlugin({
59 59
       template: path.join(__dirname, '../template/template.ejs'),
60 60
       title: 'Webpack React',
@@ -65,8 +65,8 @@ const config = {
65 65
         {
66 66
           name: 'viewport',
67 67
           content:
68
-            'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no'
69
-        }
68
+            'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no',
69
+        },
70 70
       ],
71 71
       appMountIds: ['root'],
72 72
       inject: false,
@@ -80,21 +80,21 @@ const config = {
80 80
         keepClosingSlash: true,
81 81
         removeRedundantAttributes: true,
82 82
         removeEmptyAttributes: true,
83
-        removeStyleLinkTypeAttributes: true
83
+        removeStyleLinkTypeAttributes: true,
84 84
       },
85 85
       mobile: true,
86
-      scripts: ['./static.js']
87
-    })
86
+      scripts: ['./static.js'],
87
+    }),
88 88
   ],
89 89
   optimization: {
90 90
     runtimeChunk: false,
91 91
     minimizer: [
92 92
       new UglifyJsPlugin({
93
-        exclude: /.*ts-worker.*/
93
+        exclude: /.*ts-worker.*/,
94 94
       }),
95
-      new OptimizeCSSAssetsPlugin({})
96
-    ]
97
-  }
95
+      new OptimizeCSSAssetsPlugin({}),
96
+    ],
97
+  },
98 98
 };
99 99
 
100 100
 delete config.extra;

+ 442
- 51
yarn.lock 查看文件

@@ -941,10 +941,31 @@
941 941
     call-me-maybe "^1.0.1"
942 942
     glob-to-regexp "^0.3.0"
943 943
 
944
+"@nodelib/fs.scandir@2.1.5":
945
+  version "2.1.5"
946
+  resolved "https://registry.nlark.com/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
947
+  integrity sha1-dhnC6yGyVIP20WdUi0z9WnSIw9U=
948
+  dependencies:
949
+    "@nodelib/fs.stat" "2.0.5"
950
+    run-parallel "^1.1.9"
951
+
952
+"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2":
953
+  version "2.0.5"
954
+  resolved "https://registry.nlark.com/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.5.tgz?cache=0&sync_timestamp=1622792655362&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40nodelib%2Ffs.stat%2Fdownload%2F%40nodelib%2Ffs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b"
955
+  integrity sha1-W9Jir5Tp0lvR5xsF3u1Eh2oiLos=
956
+
944 957
 "@nodelib/fs.stat@^1.1.2":
945 958
   version "1.1.3"
946 959
   resolved "http://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
947 960
 
961
+"@nodelib/fs.walk@^1.2.3":
962
+  version "1.2.8"
963
+  resolved "https://registry.nlark.com/@nodelib/fs.walk/download/@nodelib/fs.walk-1.2.8.tgz?cache=0&sync_timestamp=1625769815389&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40nodelib%2Ffs.walk%2Fdownload%2F%40nodelib%2Ffs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a"
964
+  integrity sha1-6Vc36LtnRt3t9pxVaVNJTxlv5po=
965
+  dependencies:
966
+    "@nodelib/fs.scandir" "2.1.5"
967
+    fastq "^1.6.0"
968
+
948 969
 "@octokit/endpoint@^3.1.1":
949 970
   version "3.1.3"
950 971
   resolved "http://registry.npm.taobao.org/@octokit/endpoint/download/@octokit/endpoint-3.1.3.tgz#f6e9c2521b83b74367600e474b24efec2b0471c4"
@@ -1051,6 +1072,11 @@
1051 1072
   dependencies:
1052 1073
     "@types/jest-diff" "*"
1053 1074
 
1075
+"@types/json-schema@^7.0.8":
1076
+  version "7.0.9"
1077
+  resolved "https://registry.nlark.com/@types/json-schema/download/@types/json-schema-7.0.9.tgz?cache=0&sync_timestamp=1629708116786&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
1078
+  integrity sha1-l+3JA36gw4WFMgsolk3eOznkZg0=
1079
+
1054 1080
 "@types/json5@^0.0.29":
1055 1081
   version "0.0.29"
1056 1082
   resolved "http://registry.npm.taobao.org/@types/json5/download/@types/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
@@ -1088,6 +1114,11 @@
1088 1114
   version "1.0.1"
1089 1115
   resolved "http://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
1090 1116
 
1117
+"@types/uuid@^8.3.1":
1118
+  version "8.3.1"
1119
+  resolved "https://registry.nlark.com/@types/uuid/download/@types/uuid-8.3.1.tgz?cache=0&sync_timestamp=1629709602529&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fuuid%2Fdownload%2F%40types%2Fuuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f"
1120
+  integrity sha1-GjKWnPjwNks9jIr5zDVVt4Bd8U8=
1121
+
1091 1122
 "@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
1092 1123
   version "12.0.9"
1093 1124
   resolved "http://registry.npm.taobao.org/@types/yargs/download/@types/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0"
@@ -1318,6 +1349,11 @@ ajv-keywords@^3.1.0:
1318 1349
   version "3.2.0"
1319 1350
   resolved "http://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a"
1320 1351
 
1352
+ajv-keywords@^3.5.2:
1353
+  version "3.5.2"
1354
+  resolved "https://registry.nlark.com/ajv-keywords/download/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
1355
+  integrity sha1-MfKdpatuANHC0yms97WSlhTVAU0=
1356
+
1321 1357
 ajv@^6.1.0, ajv@^6.5.5:
1322 1358
   version "6.6.2"
1323 1359
   resolved "http://registry.npm.taobao.org/ajv/download/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d"
@@ -1327,6 +1363,16 @@ ajv@^6.1.0, ajv@^6.5.5:
1327 1363
     json-schema-traverse "^0.4.1"
1328 1364
     uri-js "^4.2.2"
1329 1365
 
1366
+ajv@^6.12.5:
1367
+  version "6.12.6"
1368
+  resolved "https://registry.nlark.com/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1631470871211&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fajv%2Fdownload%2Fajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
1369
+  integrity sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=
1370
+  dependencies:
1371
+    fast-deep-equal "^3.1.1"
1372
+    fast-json-stable-stringify "^2.0.0"
1373
+    json-schema-traverse "^0.4.1"
1374
+    uri-js "^4.2.2"
1375
+
1330 1376
 alphanum-sort@^1.0.0:
1331 1377
   version "1.0.2"
1332 1378
   resolved "http://registry.npm.taobao.org/alphanum-sort/download/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
@@ -1361,6 +1407,11 @@ ansi-regex@^4.0.0:
1361 1407
   version "4.0.0"
1362 1408
   resolved "http://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9"
1363 1409
 
1410
+ansi-regex@^5.0.1:
1411
+  version "5.0.1"
1412
+  resolved "https://registry.nlark.com/ansi-regex/download/ansi-regex-5.0.1.tgz?cache=0&sync_timestamp=1631634988487&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-regex%2Fdownload%2Fansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
1413
+  integrity sha1-CCyyyJyf6GWaMRpTvWpNxTAdswQ=
1414
+
1364 1415
 ansi-styles@^2.2.1:
1365 1416
   version "2.2.1"
1366 1417
   resolved "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
@@ -1371,6 +1422,13 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1:
1371 1422
   dependencies:
1372 1423
     color-convert "^1.9.0"
1373 1424
 
1425
+ansi-styles@^4.0.0:
1426
+  version "4.3.0"
1427
+  resolved "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
1428
+  integrity sha1-7dgDYornHATIWuegkG7a00tkiTc=
1429
+  dependencies:
1430
+    color-convert "^2.0.1"
1431
+
1374 1432
 anymatch@^2.0.0:
1375 1433
   version "2.0.0"
1376 1434
   resolved "http://registry.npm.taobao.org/anymatch/download/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
@@ -1449,6 +1507,11 @@ array-union@^1.0.1:
1449 1507
   dependencies:
1450 1508
     array-uniq "^1.0.1"
1451 1509
 
1510
+array-union@^2.1.0:
1511
+  version "2.1.0"
1512
+  resolved "https://registry.npm.taobao.org/array-union/download/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
1513
+  integrity sha1-t5hCCtvrHego2ErNii4j0+/oXo0=
1514
+
1452 1515
 array-uniq@^1.0.1:
1453 1516
   version "1.0.3"
1454 1517
   resolved "http://registry.npm.taobao.org/array-uniq/download/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
@@ -1777,6 +1840,13 @@ braces@^2.3.0, braces@^2.3.1, braces@^2.3.2:
1777 1840
     split-string "^3.0.2"
1778 1841
     to-regex "^3.0.1"
1779 1842
 
1843
+braces@^3.0.1:
1844
+  version "3.0.2"
1845
+  resolved "https://registry.nlark.com/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
1846
+  integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
1847
+  dependencies:
1848
+    fill-range "^7.0.1"
1849
+
1780 1850
 brorand@^1.0.1:
1781 1851
   version "1.1.0"
1782 1852
   resolved "http://registry.npm.taobao.org/brorand/download/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
@@ -2194,6 +2264,24 @@ cliui@^4.0.0:
2194 2264
     strip-ansi "^4.0.0"
2195 2265
     wrap-ansi "^2.0.0"
2196 2266
 
2267
+cliui@^7.0.2:
2268
+  version "7.0.4"
2269
+  resolved "https://registry.nlark.com/cliui/download/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
2270
+  integrity sha1-oCZe5lVHb8gHrqnfPfjfd4OAi08=
2271
+  dependencies:
2272
+    string-width "^4.2.0"
2273
+    strip-ansi "^6.0.0"
2274
+    wrap-ansi "^7.0.0"
2275
+
2276
+clone-deep@^4.0.1:
2277
+  version "4.0.1"
2278
+  resolved "https://registry.nlark.com/clone-deep/download/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387"
2279
+  integrity sha1-wZ/Zvbv4WUK0/ZechNz31fB8I4c=
2280
+  dependencies:
2281
+    is-plain-object "^2.0.4"
2282
+    kind-of "^6.0.2"
2283
+    shallow-clone "^3.0.0"
2284
+
2197 2285
 clone@^1.0.2:
2198 2286
   version "1.0.4"
2199 2287
   resolved "http://registry.npm.taobao.org/clone/download/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
@@ -2238,11 +2326,18 @@ color-convert@^1.9.0, color-convert@^1.9.1:
2238 2326
   dependencies:
2239 2327
     color-name "1.1.3"
2240 2328
 
2329
+color-convert@^2.0.1:
2330
+  version "2.0.1"
2331
+  resolved "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
2332
+  integrity sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=
2333
+  dependencies:
2334
+    color-name "~1.1.4"
2335
+
2241 2336
 color-name@1.1.3:
2242 2337
   version "1.1.3"
2243 2338
   resolved "http://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
2244 2339
 
2245
-color-name@^1.0.0:
2340
+color-name@^1.0.0, color-name@~1.1.4:
2246 2341
   version "1.1.4"
2247 2342
   resolved "http://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
2248 2343
 
@@ -2530,22 +2625,31 @@ copy-descriptor@^0.1.0:
2530 2625
   version "0.1.1"
2531 2626
   resolved "http://registry.npm.taobao.org/copy-descriptor/download/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
2532 2627
 
2533
-copy-webpack-plugin@^5.0.3:
2534
-  version "5.0.3"
2535
-  resolved "https://registry.npm.taobao.org/copy-webpack-plugin/download/copy-webpack-plugin-5.0.3.tgz#2179e3c8fd69f13afe74da338896f1f01a875b5c"
2628
+copy-webpack-plugin@^9.0.1:
2629
+  version "9.0.1"
2630
+  resolved "https://registry.nlark.com/copy-webpack-plugin/download/copy-webpack-plugin-9.0.1.tgz?cache=0&sync_timestamp=1624628567065&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcopy-webpack-plugin%2Fdownload%2Fcopy-webpack-plugin-9.0.1.tgz#b71d21991599f61a4ee00ba79087b8ba279bbb59"
2631
+  integrity sha1-tx0hmRWZ9hpO4AunkIe4uiebu1k=
2536 2632
   dependencies:
2537
-    cacache "^11.3.2"
2538
-    find-cache-dir "^2.1.0"
2539
-    glob-parent "^3.1.0"
2540
-    globby "^7.1.1"
2541
-    is-glob "^4.0.1"
2542
-    loader-utils "^1.2.3"
2543
-    minimatch "^3.0.4"
2633
+    fast-glob "^3.2.5"
2634
+    glob-parent "^6.0.0"
2635
+    globby "^11.0.3"
2544 2636
     normalize-path "^3.0.0"
2545
-    p-limit "^2.2.0"
2546
-    schema-utils "^1.0.0"
2547
-    serialize-javascript "^1.7.0"
2548
-    webpack-log "^2.0.0"
2637
+    p-limit "^3.1.0"
2638
+    schema-utils "^3.0.0"
2639
+    serialize-javascript "^6.0.0"
2640
+
2641
+copyfiles@^2.4.1:
2642
+  version "2.4.1"
2643
+  resolved "https://registry.nlark.com/copyfiles/download/copyfiles-2.4.1.tgz#d2dcff60aaad1015f09d0b66e7f0f1c5cd3c5da5"
2644
+  integrity sha1-0tz/YKqtEBXwnQtm5/Dxxc08XaU=
2645
+  dependencies:
2646
+    glob "^7.0.5"
2647
+    minimatch "^3.0.3"
2648
+    mkdirp "^1.0.4"
2649
+    noms "0.0.0"
2650
+    through2 "^2.0.1"
2651
+    untildify "^4.0.0"
2652
+    yargs "^16.1.0"
2549 2653
 
2550 2654
 core-util-is@1.0.2, core-util-is@~1.0.0:
2551 2655
   version "1.0.2"
@@ -2620,6 +2724,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
2620 2724
     safe-buffer "^5.0.1"
2621 2725
     sha.js "^2.4.8"
2622 2726
 
2727
+cross-env@^7.0.3:
2728
+  version "7.0.3"
2729
+  resolved "https://registry.nlark.com/cross-env/download/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
2730
+  integrity sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=
2731
+  dependencies:
2732
+    cross-spawn "^7.0.1"
2733
+
2623 2734
 cross-spawn@^5.0.1:
2624 2735
   version "5.1.0"
2625 2736
   resolved "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@@ -2638,6 +2749,15 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
2638 2749
     shebang-command "^1.2.0"
2639 2750
     which "^1.2.9"
2640 2751
 
2752
+cross-spawn@^7.0.1:
2753
+  version "7.0.3"
2754
+  resolved "https://registry.nlark.com/cross-spawn/download/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
2755
+  integrity sha1-9zqFudXUHQRVUcF34ogtSshXKKY=
2756
+  dependencies:
2757
+    path-key "^3.1.0"
2758
+    shebang-command "^2.0.0"
2759
+    which "^2.0.1"
2760
+
2641 2761
 crypto-browserify@^3.11.0:
2642 2762
   version "3.12.0"
2643 2763
   resolved "http://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
@@ -3074,6 +3194,13 @@ dir-glob@^2.0.0:
3074 3194
     arrify "^1.0.1"
3075 3195
     path-type "^3.0.0"
3076 3196
 
3197
+dir-glob@^3.0.1:
3198
+  version "3.0.1"
3199
+  resolved "https://registry.npm.taobao.org/dir-glob/download/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
3200
+  integrity sha1-Vtv3PZkqSpO6FYT0U0Bj/S5BcX8=
3201
+  dependencies:
3202
+    path-type "^4.0.0"
3203
+
3077 3204
 discontinuous-range@1.0.0:
3078 3205
   version "1.0.0"
3079 3206
   resolved "http://registry.npm.taobao.org/discontinuous-range/download/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a"
@@ -3222,6 +3349,11 @@ elliptic@^6.0.0:
3222 3349
     minimalistic-assert "^1.0.0"
3223 3350
     minimalistic-crypto-utils "^1.0.0"
3224 3351
 
3352
+emoji-regex@^8.0.0:
3353
+  version "8.0.0"
3354
+  resolved "https://registry.nlark.com/emoji-regex/download/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
3355
+  integrity sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=
3356
+
3225 3357
 emojis-list@^2.0.0:
3226 3358
   version "2.1.0"
3227 3359
   resolved "http://registry.npm.taobao.org/emojis-list/download/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
@@ -3392,6 +3524,11 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.1:
3392 3524
     d "1"
3393 3525
     es5-ext "~0.10.14"
3394 3526
 
3527
+escalade@^3.1.1:
3528
+  version "3.1.1"
3529
+  resolved "https://registry.nlark.com/escalade/download/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
3530
+  integrity sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=
3531
+
3395 3532
 escape-html@~1.0.3:
3396 3533
   version "1.0.3"
3397 3534
   resolved "http://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
@@ -3673,6 +3810,11 @@ fast-deep-equal@^2.0.1:
3673 3810
   version "2.0.1"
3674 3811
   resolved "http://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
3675 3812
 
3813
+fast-deep-equal@^3.1.1:
3814
+  version "3.1.3"
3815
+  resolved "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
3816
+  integrity sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=
3817
+
3676 3818
 fast-glob@^2.0.2:
3677 3819
   version "2.2.4"
3678 3820
   resolved "http://registry.npm.taobao.org/fast-glob/download/fast-glob-2.2.4.tgz#e54f4b66d378040e0e4d6a68ec36bbc5b04363c0"
@@ -3684,6 +3826,17 @@ fast-glob@^2.0.2:
3684 3826
     merge2 "^1.2.3"
3685 3827
     micromatch "^3.1.10"
3686 3828
 
3829
+fast-glob@^3.1.1, fast-glob@^3.2.5:
3830
+  version "3.2.7"
3831
+  resolved "https://registry.nlark.com/fast-glob/download/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
3832
+  integrity sha1-/Wy3otfpqnp4RhEehaGW1rL3ZqE=
3833
+  dependencies:
3834
+    "@nodelib/fs.stat" "^2.0.2"
3835
+    "@nodelib/fs.walk" "^1.2.3"
3836
+    glob-parent "^5.1.2"
3837
+    merge2 "^1.3.0"
3838
+    micromatch "^4.0.4"
3839
+
3687 3840
 fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0:
3688 3841
   version "2.0.0"
3689 3842
   resolved "http://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
@@ -3692,6 +3845,13 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.4:
3692 3845
   version "2.0.6"
3693 3846
   resolved "http://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
3694 3847
 
3848
+fastq@^1.6.0:
3849
+  version "1.13.0"
3850
+  resolved "https://registry.nlark.com/fastq/download/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c"
3851
+  integrity sha1-YWdg+Ip1Jr38WWt8q4wYk4w2uYw=
3852
+  dependencies:
3853
+    reusify "^1.0.4"
3854
+
3695 3855
 faye-websocket@^0.10.0:
3696 3856
   version "0.10.0"
3697 3857
   resolved "http://registry.npm.taobao.org/faye-websocket/download/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4"
@@ -3740,6 +3900,13 @@ fill-range@^4.0.0:
3740 3900
     repeat-string "^1.6.1"
3741 3901
     to-regex-range "^2.1.0"
3742 3902
 
3903
+fill-range@^7.0.1:
3904
+  version "7.0.1"
3905
+  resolved "https://registry.nlark.com/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
3906
+  integrity sha1-GRmmp8df44ssfHflGYU12prN2kA=
3907
+  dependencies:
3908
+    to-regex-range "^5.0.1"
3909
+
3743 3910
 finalhandler@1.1.1:
3744 3911
   version "1.1.1"
3745 3912
   resolved "http://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105"
@@ -3772,14 +3939,6 @@ find-cache-dir@^2.0.0:
3772 3939
     make-dir "^1.0.0"
3773 3940
     pkg-dir "^3.0.0"
3774 3941
 
3775
-find-cache-dir@^2.1.0:
3776
-  version "2.1.0"
3777
-  resolved "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7"
3778
-  dependencies:
3779
-    commondir "^1.0.1"
3780
-    make-dir "^2.0.0"
3781
-    pkg-dir "^3.0.0"
3782
-
3783 3942
 find-up@^1.0.0:
3784 3943
   version "1.1.2"
3785 3944
   resolved "http://registry.npm.taobao.org/find-up/download/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -3949,6 +4108,11 @@ get-caller-file@^1.0.1:
3949 4108
   version "1.0.3"
3950 4109
   resolved "http://registry.npm.taobao.org/get-caller-file/download/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
3951 4110
 
4111
+get-caller-file@^2.0.5:
4112
+  version "2.0.5"
4113
+  resolved "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
4114
+  integrity sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=
4115
+
3952 4116
 get-pkg-repo@^1.0.0:
3953 4117
   version "1.4.0"
3954 4118
   resolved "http://registry.npm.taobao.org/get-pkg-repo/download/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d"
@@ -4037,6 +4201,20 @@ glob-parent@^3.1.0:
4037 4201
     is-glob "^3.1.0"
4038 4202
     path-dirname "^1.0.0"
4039 4203
 
4204
+glob-parent@^5.1.2:
4205
+  version "5.1.2"
4206
+  resolved "https://registry.nlark.com/glob-parent/download/glob-parent-5.1.2.tgz?cache=0&sync_timestamp=1626760200164&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fglob-parent%2Fdownload%2Fglob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
4207
+  integrity sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=
4208
+  dependencies:
4209
+    is-glob "^4.0.1"
4210
+
4211
+glob-parent@^6.0.0:
4212
+  version "6.0.1"
4213
+  resolved "https://registry.nlark.com/glob-parent/download/glob-parent-6.0.1.tgz?cache=0&sync_timestamp=1626760200164&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fglob-parent%2Fdownload%2Fglob-parent-6.0.1.tgz#42054f685eb6a44e7a7d189a96efa40a54971aa7"
4214
+  integrity sha1-QgVPaF62pE56fRialu+kClSXGqc=
4215
+  dependencies:
4216
+    is-glob "^4.0.1"
4217
+
4040 4218
 glob-to-regexp@^0.3.0:
4041 4219
   version "0.3.0"
4042 4220
   resolved "http://registry.npm.taobao.org/glob-to-regexp/download/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
@@ -4052,6 +4230,18 @@ glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
4052 4230
     once "^1.3.0"
4053 4231
     path-is-absolute "^1.0.0"
4054 4232
 
4233
+glob@^7.0.5:
4234
+  version "7.2.0"
4235
+  resolved "https://registry.npmmirror.com/glob/download/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
4236
+  integrity sha1-0VU1r3cy4C6Uj0xBYovZECk/YCM=
4237
+  dependencies:
4238
+    fs.realpath "^1.0.0"
4239
+    inflight "^1.0.4"
4240
+    inherits "2"
4241
+    minimatch "^3.0.4"
4242
+    once "^1.3.0"
4243
+    path-is-absolute "^1.0.0"
4244
+
4055 4245
 global-dirs@^0.1.0:
4056 4246
   version "0.1.1"
4057 4247
   resolved "http://registry.npm.taobao.org/global-dirs/download/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445"
@@ -4087,6 +4277,18 @@ globals@^11.1.0:
4087 4277
   version "11.9.0"
4088 4278
   resolved "http://registry.npm.taobao.org/globals/download/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249"
4089 4279
 
4280
+globby@^11.0.3:
4281
+  version "11.0.4"
4282
+  resolved "https://registry.nlark.com/globby/download/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
4283
+  integrity sha1-LLr/d8Lypi5x6bKBOme5ejowAaU=
4284
+  dependencies:
4285
+    array-union "^2.1.0"
4286
+    dir-glob "^3.0.1"
4287
+    fast-glob "^3.1.1"
4288
+    ignore "^5.1.4"
4289
+    merge2 "^1.3.0"
4290
+    slash "^3.0.0"
4291
+
4090 4292
 globby@^6.1.0:
4091 4293
   version "6.1.0"
4092 4294
   resolved "http://registry.npm.taobao.org/globby/download/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
@@ -4097,17 +4299,6 @@ globby@^6.1.0:
4097 4299
     pify "^2.0.0"
4098 4300
     pinkie-promise "^2.0.0"
4099 4301
 
4100
-globby@^7.1.1:
4101
-  version "7.1.1"
4102
-  resolved "http://registry.npm.taobao.org/globby/download/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
4103
-  dependencies:
4104
-    array-union "^1.0.1"
4105
-    dir-glob "^2.0.0"
4106
-    glob "^7.1.2"
4107
-    ignore "^3.3.5"
4108
-    pify "^3.0.0"
4109
-    slash "^1.0.0"
4110
-
4111 4302
 globby@^8.0.1:
4112 4303
   version "8.0.1"
4113 4304
   resolved "http://registry.npm.taobao.org/globby/download/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50"
@@ -4491,6 +4682,11 @@ ignore@^3.3.5:
4491 4682
   version "3.3.10"
4492 4683
   resolved "http://registry.npm.taobao.org/ignore/download/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
4493 4684
 
4685
+ignore@^5.1.4:
4686
+  version "5.1.8"
4687
+  resolved "https://registry.nlark.com/ignore/download/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
4688
+  integrity sha1-8VCotQo0KJsz4i9YiavU2AFvDlc=
4689
+
4494 4690
 image-size@~0.5.0:
4495 4691
   version "0.5.5"
4496 4692
   resolved "http://registry.npm.taobao.org/image-size/download/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c"
@@ -4806,6 +5002,11 @@ is-fullwidth-code-point@^2.0.0:
4806 5002
   version "2.0.0"
4807 5003
   resolved "http://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
4808 5004
 
5005
+is-fullwidth-code-point@^3.0.0:
5006
+  version "3.0.0"
5007
+  resolved "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
5008
+  integrity sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=
5009
+
4809 5010
 is-generator-fn@^2.0.0:
4810 5011
   version "2.0.0"
4811 5012
   resolved "http://registry.npm.taobao.org/is-generator-fn/download/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e"
@@ -4849,6 +5050,11 @@ is-number@^3.0.0:
4849 5050
   dependencies:
4850 5051
     kind-of "^3.0.2"
4851 5052
 
5053
+is-number@^7.0.0:
5054
+  version "7.0.0"
5055
+  resolved "https://registry.nlark.com/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
5056
+  integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=
5057
+
4852 5058
 is-obj@^1.0.0:
4853 5059
   version "1.0.1"
4854 5060
   resolved "http://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
@@ -5836,13 +6042,6 @@ make-dir@^1.0.0, make-dir@^1.3.0:
5836 6042
   dependencies:
5837 6043
     pify "^3.0.0"
5838 6044
 
5839
-make-dir@^2.0.0:
5840
-  version "2.1.0"
5841
-  resolved "https://registry.npm.taobao.org/make-dir/download/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
5842
-  dependencies:
5843
-    pify "^4.0.1"
5844
-    semver "^5.6.0"
5845
-
5846 6045
 make-error@1.x:
5847 6046
   version "1.3.5"
5848 6047
   resolved "http://registry.npm.taobao.org/make-error/download/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8"
@@ -5977,6 +6176,11 @@ merge2@^1.2.3:
5977 6176
   version "1.2.3"
5978 6177
   resolved "http://registry.npm.taobao.org/merge2/download/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5"
5979 6178
 
6179
+merge2@^1.3.0:
6180
+  version "1.4.1"
6181
+  resolved "https://registry.npm.taobao.org/merge2/download/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
6182
+  integrity sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=
6183
+
5980 6184
 method-override@^3.0.0:
5981 6185
   version "3.0.0"
5982 6186
   resolved "http://registry.npm.taobao.org/method-override/download/method-override-3.0.0.tgz#6ab0d5d574e3208f15b0c9cf45ab52000468d7a2"
@@ -6012,6 +6216,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8, mic
6012 6216
     snapdragon "^0.8.1"
6013 6217
     to-regex "^3.0.2"
6014 6218
 
6219
+micromatch@^4.0.4:
6220
+  version "4.0.4"
6221
+  resolved "https://registry.nlark.com/micromatch/download/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
6222
+  integrity sha1-iW1Rnf6dsl/OlM63pQCRm/iB6/k=
6223
+  dependencies:
6224
+    braces "^3.0.1"
6225
+    picomatch "^2.2.3"
6226
+
6015 6227
 miller-rabin@^4.0.0:
6016 6228
   version "4.0.1"
6017 6229
   resolved "http://registry.npm.taobao.org/miller-rabin/download/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
@@ -6082,7 +6294,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
6082 6294
   version "1.0.1"
6083 6295
   resolved "http://registry.npm.taobao.org/minimalistic-crypto-utils/download/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
6084 6296
 
6085
-minimatch@^3.0.0, minimatch@^3.0.4:
6297
+minimatch@^3.0.0, minimatch@^3.0.3, minimatch@^3.0.4:
6086 6298
   version "3.0.4"
6087 6299
   resolved "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
6088 6300
   dependencies:
@@ -6148,6 +6360,11 @@ mkdirp@0.5.x, mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0
6148 6360
   dependencies:
6149 6361
     minimist "0.0.8"
6150 6362
 
6363
+mkdirp@^1.0.4:
6364
+  version "1.0.4"
6365
+  resolved "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
6366
+  integrity sha1-PrXtYmInVteaXw4qIh3+utdcL34=
6367
+
6151 6368
 modify-values@^1.0.0:
6152 6369
   version "1.0.1"
6153 6370
   resolved "http://registry.npm.taobao.org/modify-values/download/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
@@ -6424,6 +6641,14 @@ node-releases@^1.1.3:
6424 6641
   dependencies:
6425 6642
     semver "^5.3.0"
6426 6643
 
6644
+noms@0.0.0:
6645
+  version "0.0.0"
6646
+  resolved "https://registry.npm.taobao.org/noms/download/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859"
6647
+  integrity sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=
6648
+  dependencies:
6649
+    inherits "^2.0.1"
6650
+    readable-stream "~1.0.31"
6651
+
6427 6652
 "nopt@2 || 3":
6428 6653
   version "3.0.6"
6429 6654
   resolved "http://registry.npm.taobao.org/nopt/download/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
@@ -6800,11 +7025,12 @@ p-limit@^2.0.0:
6800 7025
   dependencies:
6801 7026
     p-try "^2.0.0"
6802 7027
 
6803
-p-limit@^2.2.0:
6804
-  version "2.2.0"
6805
-  resolved "https://registry.npm.taobao.org/p-limit/download/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
7028
+p-limit@^3.1.0:
7029
+  version "3.1.0"
7030
+  resolved "https://registry.nlark.com/p-limit/download/p-limit-3.1.0.tgz?cache=0&sync_timestamp=1628812721654&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fp-limit%2Fdownload%2Fp-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
7031
+  integrity sha1-4drMvnjQ0TiMoYxk/qOOPlfjcGs=
6806 7032
   dependencies:
6807
-    p-try "^2.0.0"
7033
+    yocto-queue "^0.1.0"
6808 7034
 
6809 7035
 p-locate@^2.0.0:
6810 7036
   version "2.0.0"
@@ -7034,6 +7260,11 @@ path-key@^2.0.0, path-key@^2.0.1:
7034 7260
   version "2.0.1"
7035 7261
   resolved "http://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
7036 7262
 
7263
+path-key@^3.1.0:
7264
+  version "3.1.1"
7265
+  resolved "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
7266
+  integrity sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=
7267
+
7037 7268
 path-parse@^1.0.6:
7038 7269
   version "1.0.6"
7039 7270
   resolved "http://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
@@ -7062,6 +7293,11 @@ path-type@^3.0.0:
7062 7293
   dependencies:
7063 7294
     pify "^3.0.0"
7064 7295
 
7296
+path-type@^4.0.0:
7297
+  version "4.0.0"
7298
+  resolved "https://registry.npm.taobao.org/path-type/download/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
7299
+  integrity sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=
7300
+
7065 7301
 pbkdf2@^3.0.3:
7066 7302
   version "3.0.17"
7067 7303
   resolved "http://registry.npm.taobao.org/pbkdf2/download/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6"
@@ -7076,6 +7312,11 @@ performance-now@^2.1.0:
7076 7312
   version "2.1.0"
7077 7313
   resolved "http://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
7078 7314
 
7315
+picomatch@^2.2.3:
7316
+  version "2.3.0"
7317
+  resolved "https://registry.nlark.com/picomatch/download/picomatch-2.3.0.tgz?cache=0&sync_timestamp=1621648246651&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpicomatch%2Fdownload%2Fpicomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
7318
+  integrity sha1-8fBh3o9qS/AiiS4tEoI0+5gwKXI=
7319
+
7079 7320
 pify@^2.0.0, pify@^2.3.0:
7080 7321
   version "2.3.0"
7081 7322
   resolved "http://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -7645,6 +7886,11 @@ querystringify@^2.0.0:
7645 7886
   version "2.1.0"
7646 7887
   resolved "http://registry.npm.taobao.org/querystringify/download/querystringify-2.1.0.tgz#7ded8dfbf7879dcc60d0a644ac6754b283ad17ef"
7647 7888
 
7889
+queue-microtask@^1.2.2:
7890
+  version "1.2.3"
7891
+  resolved "https://registry.nlark.com/queue-microtask/download/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
7892
+  integrity sha1-SSkii7xyTfrEPg77BYyve2z7YkM=
7893
+
7648 7894
 quick-lru@^1.0.0:
7649 7895
   version "1.1.0"
7650 7896
   resolved "http://registry.npm.taobao.org/quick-lru/download/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8"
@@ -7672,6 +7918,13 @@ randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5:
7672 7918
   dependencies:
7673 7919
     safe-buffer "^5.1.0"
7674 7920
 
7921
+randombytes@^2.1.0:
7922
+  version "2.1.0"
7923
+  resolved "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
7924
+  integrity sha1-32+ENy8CcNxlzfYpE0mrekc9Tyo=
7925
+  dependencies:
7926
+    safe-buffer "^5.1.0"
7927
+
7675 7928
 randomfill@^1.0.3:
7676 7929
   version "1.0.4"
7677 7930
   resolved "http://registry.npm.taobao.org/randomfill/download/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458"
@@ -7818,7 +8071,7 @@ read@1, read@~1.0.1:
7818 8071
     string_decoder "~1.1.1"
7819 8072
     util-deprecate "~1.0.1"
7820 8073
 
7821
-readable-stream@1.0:
8074
+readable-stream@1.0, readable-stream@~1.0.31:
7822 8075
   version "1.0.34"
7823 8076
   resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
7824 8077
   dependencies:
@@ -8048,6 +8301,11 @@ retry@^0.10.0:
8048 8301
   version "0.10.1"
8049 8302
   resolved "http://registry.npm.taobao.org/retry/download/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
8050 8303
 
8304
+reusify@^1.0.4:
8305
+  version "1.0.4"
8306
+  resolved "https://registry.nlark.com/reusify/download/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
8307
+  integrity sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=
8308
+
8051 8309
 rework-visit@1.0.0:
8052 8310
   version "1.0.0"
8053 8311
   resolved "http://registry.npm.taobao.org/rework-visit/download/rework-visit-1.0.0.tgz#9945b2803f219e2f7aca00adb8bc9f640f842c9a"
@@ -8097,6 +8355,13 @@ run-async@^2.2.0:
8097 8355
   dependencies:
8098 8356
     is-promise "^2.1.0"
8099 8357
 
8358
+run-parallel@^1.1.9:
8359
+  version "1.2.0"
8360
+  resolved "https://registry.npm.taobao.org/run-parallel/download/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
8361
+  integrity sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=
8362
+  dependencies:
8363
+    queue-microtask "^1.2.2"
8364
+
8100 8365
 run-queue@^1.0.0, run-queue@^1.0.3:
8101 8366
   version "1.0.3"
8102 8367
   resolved "http://registry.npm.taobao.org/run-queue/download/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47"
@@ -8149,6 +8414,15 @@ schema-utils@^1.0.0:
8149 8414
     ajv-errors "^1.0.0"
8150 8415
     ajv-keywords "^3.1.0"
8151 8416
 
8417
+schema-utils@^3.0.0:
8418
+  version "3.1.1"
8419
+  resolved "https://registry.nlark.com/schema-utils/download/schema-utils-3.1.1.tgz?cache=0&sync_timestamp=1626694740261&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fschema-utils%2Fdownload%2Fschema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281"
8420
+  integrity sha1-vHTEtraZXB2I92qLd76nIZ4MgoE=
8421
+  dependencies:
8422
+    "@types/json-schema" "^7.0.8"
8423
+    ajv "^6.12.5"
8424
+    ajv-keywords "^3.5.2"
8425
+
8152 8426
 select-hose@^2.0.0:
8153 8427
   version "2.0.0"
8154 8428
   resolved "http://registry.npm.taobao.org/select-hose/download/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
@@ -8221,9 +8495,12 @@ serialize-javascript@^1.4.0:
8221 8495
   version "1.6.1"
8222 8496
   resolved "http://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-1.6.1.tgz#4d1f697ec49429a847ca6f442a2a755126c4d879"
8223 8497
 
8224
-serialize-javascript@^1.7.0:
8225
-  version "1.7.0"
8226
-  resolved "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65"
8498
+serialize-javascript@^6.0.0:
8499
+  version "6.0.0"
8500
+  resolved "https://registry.nlark.com/serialize-javascript/download/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8"
8501
+  integrity sha1-765diPRdeSQUHai1w6en5mP+/rg=
8502
+  dependencies:
8503
+    randombytes "^2.1.0"
8227 8504
 
8228 8505
 serve-index@^1.9.1:
8229 8506
   version "1.9.1"
@@ -8300,6 +8577,13 @@ sha.js@^2.4.0, sha.js@^2.4.8:
8300 8577
     inherits "^2.0.1"
8301 8578
     safe-buffer "^5.0.1"
8302 8579
 
8580
+shallow-clone@^3.0.0:
8581
+  version "3.0.1"
8582
+  resolved "https://registry.nlark.com/shallow-clone/download/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"
8583
+  integrity sha1-jymBrZJTH1UDWwH7IwdppA4C76M=
8584
+  dependencies:
8585
+    kind-of "^6.0.2"
8586
+
8303 8587
 shallowequal@^1.0.2:
8304 8588
   version "1.1.0"
8305 8589
   resolved "http://registry.npm.taobao.org/shallowequal/download/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
@@ -8310,10 +8594,22 @@ shebang-command@^1.2.0:
8310 8594
   dependencies:
8311 8595
     shebang-regex "^1.0.0"
8312 8596
 
8597
+shebang-command@^2.0.0:
8598
+  version "2.0.0"
8599
+  resolved "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
8600
+  integrity sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=
8601
+  dependencies:
8602
+    shebang-regex "^3.0.0"
8603
+
8313 8604
 shebang-regex@^1.0.0:
8314 8605
   version "1.0.0"
8315 8606
   resolved "http://registry.npm.taobao.org/shebang-regex/download/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
8316 8607
 
8608
+shebang-regex@^3.0.0:
8609
+  version "3.0.0"
8610
+  resolved "https://registry.nlark.com/shebang-regex/download/shebang-regex-3.0.0.tgz?cache=0&sync_timestamp=1628896299850&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fshebang-regex%2Fdownload%2Fshebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
8611
+  integrity sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=
8612
+
8317 8613
 shellwords@^0.1.1:
8318 8614
   version "0.1.1"
8319 8615
   resolved "http://registry.npm.taobao.org/shellwords/download/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
@@ -8340,6 +8636,11 @@ slash@^2.0.0:
8340 8636
   version "2.0.0"
8341 8637
   resolved "http://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
8342 8638
 
8639
+slash@^3.0.0:
8640
+  version "3.0.0"
8641
+  resolved "https://registry.nlark.com/slash/download/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
8642
+  integrity sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=
8643
+
8343 8644
 slide@^1.1.6:
8344 8645
   version "1.1.6"
8345 8646
   resolved "http://registry.npm.taobao.org/slide/download/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707"
@@ -8664,6 +8965,15 @@ string-width@^1.0.1:
8664 8965
     is-fullwidth-code-point "^2.0.0"
8665 8966
     strip-ansi "^4.0.0"
8666 8967
 
8968
+string-width@^4.1.0, string-width@^4.2.0:
8969
+  version "4.2.3"
8970
+  resolved "https://registry.npmmirror.com/string-width/download/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
8971
+  integrity sha1-JpxxF9J7Ba0uU2gwqOyJXvnG0BA=
8972
+  dependencies:
8973
+    emoji-regex "^8.0.0"
8974
+    is-fullwidth-code-point "^3.0.0"
8975
+    strip-ansi "^6.0.1"
8976
+
8667 8977
 string.prototype.trim@^1.1.2:
8668 8978
   version "1.1.2"
8669 8979
   resolved "http://registry.npm.taobao.org/string.prototype.trim/download/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
@@ -8706,6 +9016,13 @@ strip-ansi@^5.0.0:
8706 9016
   dependencies:
8707 9017
     ansi-regex "^4.0.0"
8708 9018
 
9019
+strip-ansi@^6.0.0, strip-ansi@^6.0.1:
9020
+  version "6.0.1"
9021
+  resolved "https://registry.npmmirror.com/strip-ansi/download/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
9022
+  integrity sha1-nibGPTD1NEPpSJSVshBdN7Z6hdk=
9023
+  dependencies:
9024
+    ansi-regex "^5.0.1"
9025
+
8709 9026
 strip-bom@^2.0.0:
8710 9027
   version "2.0.0"
8711 9028
   resolved "http://registry.npm.taobao.org/strip-bom/download/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
@@ -8875,7 +9192,7 @@ throat@^4.0.0:
8875 9192
   version "4.1.0"
8876 9193
   resolved "http://registry.npm.taobao.org/throat/download/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
8877 9194
 
8878
-through2@^2.0.0, through2@^2.0.2:
9195
+through2@^2.0.0, through2@^2.0.1, through2@^2.0.2:
8879 9196
   version "2.0.5"
8880 9197
   resolved "http://registry.npm.taobao.org/through2/download/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
8881 9198
   dependencies:
@@ -8939,6 +9256,13 @@ to-regex-range@^2.1.0:
8939 9256
     is-number "^3.0.0"
8940 9257
     repeat-string "^1.6.1"
8941 9258
 
9259
+to-regex-range@^5.0.1:
9260
+  version "5.0.1"
9261
+  resolved "https://registry.nlark.com/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
9262
+  integrity sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=
9263
+  dependencies:
9264
+    is-number "^7.0.0"
9265
+
8942 9266
 to-regex@^3.0.1, to-regex@^3.0.2:
8943 9267
   version "3.0.2"
8944 9268
   resolved "http://registry.npm.taobao.org/to-regex/download/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
@@ -9216,6 +9540,11 @@ unset-value@^1.0.0:
9216 9540
     has-value "^0.3.1"
9217 9541
     isobject "^3.0.0"
9218 9542
 
9543
+untildify@^4.0.0:
9544
+  version "4.0.0"
9545
+  resolved "https://registry.nlark.com/untildify/download/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b"
9546
+  integrity sha1-K8lHuVNlJIfkYAlJ+wkeOujNkZs=
9547
+
9219 9548
 unzip-response@^2.0.1:
9220 9549
   version "2.0.1"
9221 9550
   resolved "http://registry.npm.taobao.org/unzip-response/download/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97"
@@ -9328,6 +9657,11 @@ uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2:
9328 9657
   version "3.3.2"
9329 9658
   resolved "http://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
9330 9659
 
9660
+uuid@^8.3.2:
9661
+  version "8.3.2"
9662
+  resolved "https://registry.nlark.com/uuid/download/uuid-8.3.2.tgz?cache=0&sync_timestamp=1622213136953&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fuuid%2Fdownload%2Fuuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
9663
+  integrity sha1-gNW1ztJxu5r2xEXyGhoExgbO++I=
9664
+
9331 9665
 v8-compile-cache@^2.0.2:
9332 9666
   version "2.0.2"
9333 9667
   resolved "http://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c"
@@ -9522,6 +9856,14 @@ webpack-log@^2.0.0:
9522 9856
     ansi-colors "^3.0.0"
9523 9857
     uuid "^3.3.2"
9524 9858
 
9859
+webpack-merge@^5.8.0:
9860
+  version "5.8.0"
9861
+  resolved "https://registry.nlark.com/webpack-merge/download/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61"
9862
+  integrity sha1-Kznb8ir4d3atdEw5AiNzHTCmj2E=
9863
+  dependencies:
9864
+    clone-deep "^4.0.1"
9865
+    wildcard "^2.0.0"
9866
+
9525 9867
 webpack-sources@^1.1.0, webpack-sources@^1.3.0:
9526 9868
   version "1.3.0"
9527 9869
   resolved "http://registry.npm.taobao.org/webpack-sources/download/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85"
@@ -9605,6 +9947,13 @@ which@1, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1:
9605 9947
   dependencies:
9606 9948
     isexe "^2.0.0"
9607 9949
 
9950
+which@^2.0.1:
9951
+  version "2.0.2"
9952
+  resolved "https://registry.nlark.com/which/download/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
9953
+  integrity sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=
9954
+  dependencies:
9955
+    isexe "^2.0.0"
9956
+
9608 9957
 wide-align@^1.1.0:
9609 9958
   version "1.1.3"
9610 9959
   resolved "http://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
@@ -9617,6 +9966,11 @@ widest-line@^2.0.0:
9617 9966
   dependencies:
9618 9967
     string-width "^2.1.1"
9619 9968
 
9969
+wildcard@^2.0.0:
9970
+  version "2.0.0"
9971
+  resolved "https://registry.nlark.com/wildcard/download/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec"
9972
+  integrity sha1-p30g5SAMb6qsl55LOq3Hs91/j+w=
9973
+
9620 9974
 windows-release@^3.1.0:
9621 9975
   version "3.1.0"
9622 9976
   resolved "http://registry.npm.taobao.org/windows-release/download/windows-release-3.1.0.tgz#8d4a7e266cbf5a233f6c717dac19ce00af36e12e"
@@ -9656,6 +10010,15 @@ wrap-ansi@^2.0.0:
9656 10010
     string-width "^1.0.1"
9657 10011
     strip-ansi "^3.0.1"
9658 10012
 
10013
+wrap-ansi@^7.0.0:
10014
+  version "7.0.0"
10015
+  resolved "https://registry.nlark.com/wrap-ansi/download/wrap-ansi-7.0.0.tgz?cache=0&sync_timestamp=1631557201275&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrap-ansi%2Fdownload%2Fwrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
10016
+  integrity sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=
10017
+  dependencies:
10018
+    ansi-styles "^4.0.0"
10019
+    string-width "^4.1.0"
10020
+    strip-ansi "^6.0.0"
10021
+
9659 10022
 wrappy@1:
9660 10023
   version "1.0.2"
9661 10024
   resolved "http://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -9730,6 +10093,11 @@ y18n@^3.2.1:
9730 10093
   version "4.0.0"
9731 10094
   resolved "http://registry.npm.taobao.org/y18n/download/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
9732 10095
 
10096
+y18n@^5.0.5:
10097
+  version "5.0.8"
10098
+  resolved "https://registry.nlark.com/y18n/download/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
10099
+  integrity sha1-f0k00PfKjFb5UxSTndzS3ZHOHVU=
10100
+
9733 10101
 yallist@^2.1.2:
9734 10102
   version "2.1.2"
9735 10103
   resolved "http://registry.npm.taobao.org/yallist/download/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
@@ -9751,6 +10119,11 @@ yargs-parser@^11.1.1:
9751 10119
     camelcase "^5.0.0"
9752 10120
     decamelize "^1.2.0"
9753 10121
 
10122
+yargs-parser@^20.2.2:
10123
+  version "20.2.9"
10124
+  resolved "https://registry.nlark.com/yargs-parser/download/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
10125
+  integrity sha1-LrfcOwKJcY/ClfNidThFxBoMlO4=
10126
+
9754 10127
 yargs-parser@^9.0.2:
9755 10128
   version "9.0.2"
9756 10129
   resolved "http://registry.npm.taobao.org/yargs-parser/download/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077"
@@ -9791,6 +10164,24 @@ yargs@^11.0.0:
9791 10164
     y18n "^3.2.1"
9792 10165
     yargs-parser "^9.0.2"
9793 10166
 
10167
+yargs@^16.1.0:
10168
+  version "16.2.0"
10169
+  resolved "https://registry.npmmirror.com/yargs/download/yargs-16.2.0.tgz?cache=0&sync_timestamp=1632361807583&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fyargs%2Fdownload%2Fyargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
10170
+  integrity sha1-HIK/D2tqZur85+8w43b0mhJHf2Y=
10171
+  dependencies:
10172
+    cliui "^7.0.2"
10173
+    escalade "^3.1.1"
10174
+    get-caller-file "^2.0.5"
10175
+    require-directory "^2.1.1"
10176
+    string-width "^4.2.0"
10177
+    y18n "^5.0.5"
10178
+    yargs-parser "^20.2.2"
10179
+
9794 10180
 yeast@0.1.2:
9795 10181
   version "0.1.2"
9796 10182
   resolved "http://registry.npm.taobao.org/yeast/download/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
10183
+
10184
+yocto-queue@^0.1.0:
10185
+  version "0.1.0"
10186
+  resolved "https://registry.nlark.com/yocto-queue/download/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
10187
+  integrity sha1-ApTrPe4FAo0x7hpfosVWpqrxChs=