wechaty-web-panel 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
- const wechaty = __importStar(require("wechaty"));
27
- const lib_1 = require("../lib");
3
+ const index_js_1 = require("../lib/index.js");
28
4
  const configDb_js_1 = require("../db/configDb.js");
29
- const { Friendship } = wechaty;
30
5
  /**
31
6
  * 好友添加
32
7
  */
@@ -43,12 +18,12 @@ async function onFriend(friendship) {
43
18
  case 2:
44
19
  if (config.acceptFriendKeyWords.length === 0) {
45
20
  console.log('无认证关键词,10秒后将会自动通过好友请求');
46
- await (0, lib_1.delay)(10000);
21
+ await (0, index_js_1.delay)(10000);
47
22
  await friendship.accept();
48
23
  }
49
24
  else if (config.acceptFriendKeyWords.length > 0 && config.acceptFriendKeyWords.includes(hello)) {
50
25
  console.log(`触发关键词${hello},10秒后自动通过好友请求`);
51
- await (0, lib_1.delay)(10000);
26
+ await (0, index_js_1.delay)(10000);
52
27
  await friendship.accept();
53
28
  }
54
29
  else {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const index_js_1 = require("../lib/index.js");
4
4
  const aibotk_js_1 = require("../proxy/aibotk.js");
5
5
  const userDb_js_1 = require("../db/userDb.js");
6
- const task_1 = require("../task");
6
+ const index_js_2 = require("../task/index.js");
7
7
  const mqtt_js_1 = require("../proxy/mqtt.js");
8
8
  const configDb_js_1 = require("../db/configDb.js");
9
9
  /**
@@ -22,15 +22,15 @@ async function onLogin(user) {
22
22
  const payload = user.payload || user._payload;
23
23
  const userInfo = {
24
24
  ...payload,
25
- robotId: payload.weixin || (0, lib_1.MD5)(user.name()),
25
+ robotId: payload.weixin || (0, index_js_1.MD5)(user.name()),
26
26
  };
27
27
  await (0, userDb_js_1.addUser)(userInfo); // 全局存储登录用户信息
28
28
  const file = await user.avatar();
29
29
  const base = await file.toBase64();
30
30
  const avatarUrl = await (0, aibotk_js_1.putqn)(base, userId);
31
31
  await (0, aibotk_js_1.sendRobotInfo)(avatarUrl, user.name(), userInfo.robotId); // 更新用户头像
32
- await (0, lib_1.delay)(3000);
33
- await (0, task_1.initAllSchedule)(this); // 初始化任务
32
+ await (0, index_js_1.delay)(3000);
33
+ await (0, index_js_2.initAllSchedule)(this); // 初始化任务
34
34
  await (0, mqtt_js_1.initMqtt)(this); // 初始化mqtt任务
35
35
  }
36
36
  catch (e) {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const common_1 = require("../common");
3
+ const index_js_1 = require("../common/index.js");
4
4
  const reply_js_1 = require("../common/reply.js");
5
- const lib_1 = require("../lib");
5
+ const index_js_2 = require("../lib/index.js");
6
6
  const room_async_service_js_1 = require("../service/room-async-service.js");
7
7
  const configDb_js_1 = require("../db/configDb.js");
8
8
  const aiDb_js_1 = require("../db/aiDb.js");
@@ -51,8 +51,8 @@ async function dispatchFriendFilterByMsgType(that, msg) {
51
51
  if (content.trim() && !isIgnore) {
52
52
  replys = await (0, reply_js_1.getContactTextReply)(that, contact, content.trim());
53
53
  for (let reply of replys) {
54
- await (0, lib_1.delay)(1000);
55
- await common_1.contactSay.call(that, contact, reply);
54
+ await (0, index_js_2.delay)(1000);
55
+ await index_js_1.contactSay.call(that, contact, reply);
56
56
  }
57
57
  }
58
58
  }
@@ -116,8 +116,8 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
116
116
  return;
117
117
  replys = await (0, reply_js_1.getRoomTextReply)(that, content, contactName, contactId, contactAvatar, room);
118
118
  for (let reply of replys) {
119
- await (0, lib_1.delay)(1000);
120
- await common_1.roomSay.call(that, room, contact, reply);
119
+ await (0, index_js_2.delay)(1000);
120
+ await index_js_1.roomSay.call(that, room, contact, reply);
121
121
  }
122
122
  }
123
123
  const cloudRoom = config.cloudRoom;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const common_1 = __importDefault(require("../common"));
7
- const lib_1 = require("../lib");
7
+ const index_js_1 = require("../lib/index.js");
8
8
  const aibotk_js_1 = require("../proxy/aibotk.js");
9
9
  const userDb_js_1 = require("../db/userDb.js");
10
10
  /**
@@ -16,7 +16,7 @@ async function onReady() {
16
16
  console.log(`所有数据准备完毕`);
17
17
  await (0, aibotk_js_1.sendHeartBeat)('live');
18
18
  await common_1.default.updateContactInfo(this);
19
- await (0, lib_1.delay)(5000);
19
+ await (0, index_js_1.delay)(5000);
20
20
  await common_1.default.updateRoomInfo(this);
21
21
  }
22
22
  catch (e) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const common_1 = require("../common");
3
+ const index_js_1 = require("../common/index.js");
4
4
  const configDb_js_1 = require("../db/configDb.js");
5
5
  /**
6
6
  * 判断配置中是否存在此群
@@ -31,7 +31,7 @@ async function onRoomjoin(room, inviteeList, inviter, date) {
31
31
  const { welcomes } = config.roomJoinKeywords[roomIndex];
32
32
  console.log(`群名: ${roomName} ,加入新成员: ${nameList}, 邀请人: ${inviter}`);
33
33
  for (const item of welcomes) {
34
- await (0, common_1.addRoomWelcomeSay)(room, roomName, nameList, item);
34
+ await (0, index_js_1.addRoomWelcomeSay)(room, roomName, nameList, item);
35
35
  }
36
36
  }
37
37
  }
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const common_1 = require("../common");
4
- const lib_1 = require("../lib");
3
+ const index_js_1 = require("../common/index.js");
4
+ const index_js_2 = require("../lib/index.js");
5
5
  async function onRoomtopic(room, newTopic, oldTopic, changer, date) {
6
6
  console.log(`【${oldTopic}】群名更新为:${newTopic}`);
7
- await (0, lib_1.delay)(3000);
7
+ await (0, index_js_2.delay)(3000);
8
8
  console.log('正在更新群组');
9
- await (0, common_1.updateRoomOnly)(this);
9
+ await (0, index_js_1.updateRoomOnly)(this);
10
10
  }
11
11
  exports.default = onRoomtopic;
12
12
  //# sourceMappingURL=on-roomtopic.js.map
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
7
- const lib_1 = require("../lib");
7
+ const index_js_1 = require("../lib/index.js");
8
8
  const aibotk_js_1 = require("../proxy/aibotk.js");
9
9
  /**
10
10
  * 扫描登录,显示二维码
@@ -12,7 +12,7 @@ const aibotk_js_1 = require("../proxy/aibotk.js");
12
12
  async function onScan(qrcode, status) {
13
13
  qrcode_terminal_1.default.generate(qrcode);
14
14
  console.log('扫描状态', status);
15
- (0, lib_1.throttle)((0, aibotk_js_1.setQrCode)(qrcode, status), 30000);
15
+ (0, index_js_1.throttle)((0, aibotk_js_1.setQrCode)(qrcode, status), 30000);
16
16
  const qrImgUrl = ['https://api.qrserver.com/v1/create-qr-code/?data=', encodeURIComponent(qrcode)].join('');
17
17
  console.log(qrImgUrl);
18
18
  }
@@ -6,7 +6,7 @@ exports.packageJson = void 0;
6
6
  */
7
7
  exports.packageJson = {
8
8
  "name": "wechaty-web-panel",
9
- "version": "1.1.6",
9
+ "version": "1.1.7",
10
10
  "description": "",
11
11
  "exports": {
12
12
  ".": {
@@ -1,4 +1,4 @@
1
- export const AIBOTK: "http://0.0.0.0:7002/open/v1/api";
1
+ export const AIBOTK: "https://api-bot.aibotk.com/open/v1/api";
2
2
  export const ONE: "http://wufazhuce.com/";
3
3
  export const TULING: "http://openapi.tuling123.com/openapi/api/v2";
4
4
  export const MOJI: "https://tianqi.moji.com/weather/china/";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MEINV = exports.EMOHOST = exports.TXHOST = exports.MOJI = exports.TULING = exports.ONE = exports.AIBOTK = void 0;
4
- // export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api'
5
- exports.AIBOTK = 'http://0.0.0.0:7002/open/v1/api';
4
+ exports.AIBOTK = 'https://api-bot.aibotk.com/open/v1/api';
5
+ // export const AIBOTK = 'http://0.0.0.0:7002/open/v1/api'
6
6
  exports.ONE = 'http://wufazhuce.com/';
7
7
  exports.TULING = 'http://openapi.tuling123.com/openapi/api/v2';
8
8
  exports.MOJI = 'https://tianqi.moji.com/weather/china/';
@@ -1,7 +1,5 @@
1
- import * as wechaty from 'wechaty';
2
- import { delay } from '../lib';
1
+ import { delay } from '../lib/index.js';
3
2
  import { allConfig } from '../db/configDb.js';
4
- const { Friendship } = wechaty;
5
3
  /**
6
4
  * 好友添加
7
5
  */
@@ -1,7 +1,7 @@
1
- import { delay, MD5 } from '../lib';
1
+ import { delay, MD5 } from '../lib/index.js';
2
2
  import { getConfig, sendRobotInfo, sendError, putqn, setQrCode, updatePanelVersion } from '../proxy/aibotk.js';
3
3
  import { addUser } from '../db/userDb.js';
4
- import { initAllSchedule } from '../task';
4
+ import { initAllSchedule } from '../task/index.js';
5
5
  import { initMqtt } from '../proxy/mqtt.js';
6
6
  import { allConfig } from '../db/configDb.js';
7
7
  /**
@@ -1,6 +1,6 @@
1
- import { contactSay, roomSay } from '../common';
1
+ import { contactSay, roomSay } from '../common/index.js';
2
2
  import { getContactTextReply, getRoomTextReply } from '../common/reply.js';
3
- import { delay } from '../lib';
3
+ import { delay } from '../lib/index.js';
4
4
  import { dispatchAsync } from '../service/room-async-service.js';
5
5
  import { allConfig } from '../db/configDb.js';
6
6
  import { getAibotConfig } from '../db/aiDb.js';
@@ -1,5 +1,5 @@
1
1
  import common from '../common';
2
- import { delay } from '../lib';
2
+ import { delay } from '../lib/index.js';
3
3
  import { sendHeartBeat } from '../proxy/aibotk.js';
4
4
  import { getUser } from '../db/userDb.js';
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { addRoomWelcomeSay } from '../common';
1
+ import { addRoomWelcomeSay } from '../common/index.js';
2
2
  import { allConfig } from '../db/configDb.js';
3
3
  /**
4
4
  * 判断配置中是否存在此群
@@ -1,5 +1,5 @@
1
- import { updateRoomOnly } from '../common';
2
- import { delay } from '../lib';
1
+ import { updateRoomOnly } from '../common/index.js';
2
+ import { delay } from '../lib/index.js';
3
3
  async function onRoomtopic(room, newTopic, oldTopic, changer, date) {
4
4
  console.log(`【${oldTopic}】群名更新为:${newTopic}`);
5
5
  await delay(3000);
@@ -1,5 +1,5 @@
1
1
  import Qrterminal from 'qrcode-terminal';
2
- import { throttle } from '../lib';
2
+ import { throttle } from '../lib/index.js';
3
3
  import { setQrCode } from '../proxy/aibotk.js';
4
4
  /**
5
5
  * 扫描登录,显示二维码
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.1.6",
6
+ "version": "1.1.7",
7
7
  "description": "",
8
8
  "exports": {
9
9
  ".": {
@@ -1,4 +1,4 @@
1
- export const AIBOTK: "http://0.0.0.0:7002/open/v1/api";
1
+ export const AIBOTK: "https://api-bot.aibotk.com/open/v1/api";
2
2
  export const ONE: "http://wufazhuce.com/";
3
3
  export const TULING: "http://openapi.tuling123.com/openapi/api/v2";
4
4
  export const MOJI: "https://tianqi.moji.com/weather/china/";
@@ -1,5 +1,5 @@
1
- // export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api'
2
- export const AIBOTK = 'http://0.0.0.0:7002/open/v1/api';
1
+ export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api';
2
+ // export const AIBOTK = 'http://0.0.0.0:7002/open/v1/api'
3
3
  export const ONE = 'http://wufazhuce.com/';
4
4
  export const TULING = 'http://openapi.tuling123.com/openapi/api/v2';
5
5
  export const MOJI = 'https://tianqi.moji.com/weather/china/';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wechaty-web-panel",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {