@indra.ai/deva.license 0.0.41 → 0.0.42
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 +10 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,6 +17,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
17
17
|
|
|
18
18
|
const info = {
|
|
19
19
|
id: pkg.id,
|
|
20
|
+
license: pkg.license,
|
|
21
|
+
VLA: pkg.VLA,
|
|
20
22
|
name: pkg.name,
|
|
21
23
|
describe: pkg.description,
|
|
22
24
|
version: pkg.version,
|
|
@@ -25,7 +27,6 @@ const info = {
|
|
|
25
27
|
git: pkg.repository.url,
|
|
26
28
|
bugs: pkg.bugs.url,
|
|
27
29
|
author: pkg.author,
|
|
28
|
-
license: pkg.license,
|
|
29
30
|
copyright: pkg.copyright,
|
|
30
31
|
};
|
|
31
32
|
|
|
@@ -213,8 +214,16 @@ const LICENSE = new Deva({
|
|
|
213
214
|
});
|
|
214
215
|
},
|
|
215
216
|
},
|
|
217
|
+
onInit(data, resolve) {
|
|
218
|
+
const {personal} = this.license(); // get the license config
|
|
219
|
+
const agent_license = this.info().VLA; // get agent license
|
|
220
|
+
const license_check = this.license_check(personal, agent_license); // check license
|
|
221
|
+
// return this.start if license_check passes otherwise stop.
|
|
222
|
+
return license_check ? this.start(data, resolve) : this.stop(data, resolve);
|
|
223
|
+
},
|
|
216
224
|
async onReady(data, resolve) {
|
|
217
225
|
const {concerns, global} = this.license(); // get the license config
|
|
226
|
+
|
|
218
227
|
|
|
219
228
|
const {uri,database} = global.mongo; // set the datase
|
|
220
229
|
|