@indra.ai/deva.license 0.0.8 → 0.0.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.
- package/index.js +13 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -214,9 +214,19 @@ const LICENSE = new Deva({
|
|
|
214
214
|
});
|
|
215
215
|
},
|
|
216
216
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
async onInit(data, resolve) {
|
|
218
|
+
// check license
|
|
219
|
+
const {personal} = this.license(); // get the license config
|
|
220
|
+
this.vars.license = await this.methods.license_check(personal, pkg.VLA);
|
|
221
|
+
if (this.vars.license) {
|
|
222
|
+
return this.start(data, resolve); // start load if license valid
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
return this.stop(data, resolve); // stop load if license is invalid.
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
async onReady(data, resolve) {
|
|
229
|
+
const {concerns, global} = this.license(); // get the license config
|
|
220
230
|
|
|
221
231
|
const {uri,database} = global.mongo; // set the datase
|
|
222
232
|
|