alemonjs 2.1.9 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
1
  import { DefineResponseFunc } from '../types';
2
- export declare const lazy: (fnc: () => Promise<any>) => () => Promise<any>;
2
+ export declare const lazy: <T extends {
3
+ default: any;
4
+ }>(fnc: () => Promise<T>) => (() => Promise<T["default"]>);
3
5
  export declare const defineResponse: DefineResponseFunc;
@@ -1,5 +1,6 @@
1
1
  const lazy = (fnc) => {
2
- return async () => (await fnc()).default;
2
+ const back = async () => (await fnc()).default;
3
+ return back;
3
4
  };
4
5
  const defineResponse = responses => {
5
6
  return {
@@ -64,11 +64,6 @@ const cbpClient = (url, options = {}) => {
64
64
  global.chatbotClient.on('message', message => {
65
65
  try {
66
66
  const parsedMessage = flattedJSON.parse(message.toString());
67
- logger.debug({
68
- code: ResultCode.Ok,
69
- message: '客户端接收到消息',
70
- data: parsedMessage
71
- });
72
67
  if (parsedMessage?.activeId) {
73
68
  if (parsedMessage.active === 'sync') {
74
69
  const configs = parsedMessage.payload;
@@ -86,11 +86,6 @@ const cbpPlatform = (url, options = {
86
86
  global.chatbotPlatform.on('message', message => {
87
87
  try {
88
88
  const data = flattedJSON.parse(message.toString());
89
- logger.debug({
90
- code: ResultCode.Ok,
91
- message: '平台端接收消息',
92
- data: data
93
- });
94
89
  if (data.apiId) {
95
90
  for (const cb of apiReplys) {
96
91
  void cb(data, val => replyApi(data, val));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "alemonjs",
4
- "version": "2.1.9",
4
+ "version": "2.1.10",
5
5
  "description": "bot script",
6
6
  "author": "lemonade",
7
7
  "license": "MIT",
@@ -72,4 +72,4 @@
72
72
  "type": "git",
73
73
  "url": "https://github.com/lemonade-lab/alemonjs.git"
74
74
  }
75
- }
75
+ }