@wabot-dev/framework 0.2.0-beta.12 → 0.2.0-beta.13

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.
@@ -11,7 +11,6 @@ const chatIdPath = '.cmd-channel/id.json';
11
11
  const authInfoPath = '.cmd-channel/auth-info.json';
12
12
  let CmdChannel = CmdChannel_1 = class CmdChannel {
13
13
  auth;
14
- authInfo = undefined;
15
14
  chatId = undefined;
16
15
  rl = readline.createInterface({
17
16
  input: process.stdin,
@@ -49,8 +48,11 @@ let CmdChannel = CmdChannel_1 = class CmdChannel {
49
48
  };
50
49
  if (!this.callBack)
51
50
  return;
52
- if (this.authInfo === undefined) {
53
- this.authInfo = readJsonFromFile(authInfoPath);
51
+ if (!this.auth.isAssigned()) {
52
+ const authInfo = readJsonFromFile(authInfoPath);
53
+ if (authInfo) {
54
+ this.auth.assign(authInfo);
55
+ }
54
56
  }
55
57
  this.callBack({
56
58
  chatConnection,
@@ -1263,7 +1263,6 @@ declare function cmd(): (target: object, propertyKey: string | symbol) => void;
1263
1263
 
1264
1264
  declare class CmdChannel implements IChatChannel {
1265
1265
  private auth;
1266
- private authInfo;
1267
1266
  private chatId;
1268
1267
  private rl;
1269
1268
  private callBack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wabot-dev/framework",
3
- "version": "0.2.0-beta.12",
3
+ "version": "0.2.0-beta.13",
4
4
  "description": "Framework for IA Chat Bots",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",