@indra.ai/deva.license 0.0.2 → 0.0.4

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.
Files changed (2) hide show
  1. package/index.js +13 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -40,10 +40,11 @@ const LICENSE = new Deva({
40
40
  },
41
41
  listeners: {
42
42
  'devacore:question'(packet) {
43
- const echo = this.methods.echo(agent.key, 'q', packet);
43
+ console.log('agent', packet.q.agent.key);
44
+ this.methods.echo(agent.key, 'q', packet);
44
45
  },
45
46
  'devacore:answer'(packet) {
46
- const echo = this.methods.echo(agent.key, 'a', packet);
47
+ this.methods.echo(agent.key, 'a', packet);
47
48
  }
48
49
  },
49
50
  modules: {
@@ -175,7 +176,7 @@ const LICENSE = new Deva({
175
176
  });
176
177
  },
177
178
  /**************
178
- method: searck
179
+ method: search
179
180
  params: packet
180
181
  describe: get history
181
182
  ***************/
@@ -214,12 +215,15 @@ const LICENSE = new Deva({
214
215
  },
215
216
  },
216
217
  onReady(data, resolve) {
217
- console.log(this.license());
218
- const {uri,database} = this.license().personal.mongo;
219
- this.modules.client = new MongoClient(uri);
220
- this.vars.database = database;
221
- this.prompt(this.vars.messages.ready);
222
- return resolve(data);
218
+ const {concerns, global, personal} = this.license(); // get the license config
219
+ this.vars.license = personal || false; // set the license into local vars
220
+
221
+ const {uri,database} = global.mongo; // set the datase
222
+
223
+ this.modules.client = new MongoClient(uri); // set the client module for the database.
224
+ this.vars.database = database; // set the database into the local vars
225
+ this.prompt(this.vars.messages.ready); // prompt message ready
226
+ return resolve(data); // resolve data.
223
227
  },
224
228
  onError(err, data) {
225
229
  this.prompt(this.vars.messages.error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "41840925813499570000",
3
3
  "name": "@indra.ai/deva.license",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "license": "VLA:20758568792947085964 LICENSE.md",
6
6
  "VLA": {
7
7
  "uid": "20758568792947085964",