@indra.ai/deva.license 0.0.2 → 0.0.3
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.
- package/index.js +13 -9
- 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
|
-
|
|
43
|
+
console.log('agent', packet.q.agent.key);
|
|
44
|
+
this.methods.echo(agent.key, 'q', packet);
|
|
44
45
|
},
|
|
45
46
|
'devacore:answer'(packet) {
|
|
46
|
-
|
|
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:
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
const {concerns, global, personal} = this.license(); // get the license config
|
|
219
|
+
this.vars.license = personal.VLA || 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);
|