@indra.ai/deva 1.3.11 → 1.3.12
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 +28 -52
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -24,8 +24,7 @@ class Deva {
|
|
|
24
24
|
this._networks = false; // inherited Systems features.
|
|
25
25
|
this._legal = false; // inherited Legal features.
|
|
26
26
|
this._justice = false; // inherited Justice features.
|
|
27
|
-
this._authority = false; // inherited
|
|
28
|
-
this._defense = false; // inherited Defense features.
|
|
27
|
+
this._authority = false; // inherited Justice features.
|
|
29
28
|
this.events = opts.events || new EventEmitter({}); // Event Bus
|
|
30
29
|
this.lib = new lib({}); // used for loading library functions
|
|
31
30
|
this.utils = opts.utils || {}; // parse function
|
|
@@ -343,17 +342,6 @@ class Deva {
|
|
|
343
342
|
return this.Feature('authority', resolve, reject);
|
|
344
343
|
}
|
|
345
344
|
|
|
346
|
-
/**************
|
|
347
|
-
func: Defense
|
|
348
|
-
params: client: false
|
|
349
|
-
describe:
|
|
350
|
-
The Defense feature sets the correct variables and necessary rules for the
|
|
351
|
-
client presented data.
|
|
352
|
-
***************/
|
|
353
|
-
Defense(resolve, reject) {
|
|
354
|
-
return this.Feature('defense', resolve, reject);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
345
|
/**************
|
|
358
346
|
func: Done
|
|
359
347
|
params: none
|
|
@@ -694,26 +682,50 @@ class Deva {
|
|
|
694
682
|
}).then(() => {
|
|
695
683
|
return this._assignListeners();
|
|
696
684
|
}).then(() => {
|
|
685
|
+
this.feature('init');
|
|
686
|
+
this.zone('init');
|
|
687
|
+
this.action('init');
|
|
688
|
+
this.state('init');
|
|
697
689
|
return this.Client(client, resolve, reject);
|
|
698
690
|
}).then(part => {
|
|
691
|
+
this.state('done', 'client');
|
|
692
|
+
this.action('done', 'client');
|
|
699
693
|
return this.Security(resolve, reject);
|
|
700
694
|
}).then(part => {
|
|
695
|
+
this.state('done', 'security');
|
|
696
|
+
this.action('done', 'security');
|
|
701
697
|
return this.Support(resolve, reject);
|
|
702
698
|
}).then(() => {
|
|
699
|
+
this.state('done', 'support');
|
|
700
|
+
this.action('done', 'support');
|
|
703
701
|
return this.Services(resolve, reject);
|
|
704
702
|
}).then(() => {
|
|
703
|
+
this.state('done', 'services');
|
|
704
|
+
this.action('done', 'services');
|
|
705
705
|
return this.Systems(resolve, reject);
|
|
706
706
|
}).then(() => {
|
|
707
|
+
this.state('done', 'systems');
|
|
708
|
+
this.action('done', 'systems');
|
|
707
709
|
return this.Networks(resolve, reject);
|
|
708
710
|
}).then(() => {
|
|
711
|
+
this.state('done', 'networks');
|
|
712
|
+
this.action('done', 'networks');
|
|
709
713
|
return this.Legal(resolve, reject);
|
|
710
714
|
}).then(() => {
|
|
715
|
+
this.state('done', 'legal');
|
|
716
|
+
this.action('done', 'legal');
|
|
711
717
|
return this.Authority(resolve, reject);
|
|
712
718
|
}).then(() => {
|
|
719
|
+
this.state('done', 'authority');
|
|
720
|
+
this.action('done', 'authority');
|
|
713
721
|
return this.Justice(resolve, reject);
|
|
714
722
|
}).then(() => {
|
|
723
|
+
this.state('done', 'justice');
|
|
724
|
+
this.action('done', 'justice');
|
|
715
725
|
return this.Defense(resolve, reject);
|
|
716
726
|
}).then(() => {
|
|
727
|
+
this.state('done', 'defense');
|
|
728
|
+
this.action('done', 'defense');
|
|
717
729
|
return this.Done(resolve, reject);
|
|
718
730
|
}).then(() => {
|
|
719
731
|
const hasOnInit = this.onInit && typeof this.onInit === 'function';
|
|
@@ -1274,29 +1286,11 @@ class Deva {
|
|
|
1274
1286
|
}
|
|
1275
1287
|
}
|
|
1276
1288
|
|
|
1277
|
-
/**************
|
|
1278
|
-
func: networks
|
|
1279
|
-
params: none
|
|
1280
|
-
describe: basic networks features available in a Deva.
|
|
1281
|
-
usage: this.networks()
|
|
1282
|
-
***************/
|
|
1283
|
-
networks() {
|
|
1284
|
-
if (!this._active) return this._messages.offline; // check the active status
|
|
1285
|
-
this.zone('networks');
|
|
1286
|
-
this.feature('networks'); // set the support state
|
|
1287
|
-
try {
|
|
1288
|
-
this.state('return', 'networks'); // set the networks state
|
|
1289
|
-
return this.lib.copy(this._networks); // return the systems feature
|
|
1290
|
-
} catch (e) {
|
|
1291
|
-
return this.error(e); // return this.error when error catch
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
1289
|
/**************
|
|
1296
1290
|
func: legal
|
|
1297
1291
|
params: none
|
|
1298
1292
|
describe: basic legal features available in a Deva.
|
|
1299
|
-
usage: this.
|
|
1293
|
+
usage: this.systems()
|
|
1300
1294
|
***************/
|
|
1301
1295
|
legal() {
|
|
1302
1296
|
if (!this._active) return this._messages.offline; // check the active status
|
|
@@ -1314,7 +1308,7 @@ class Deva {
|
|
|
1314
1308
|
func: justice
|
|
1315
1309
|
params: none
|
|
1316
1310
|
describe: basic justice features available in a Deva.
|
|
1317
|
-
usage: this.
|
|
1311
|
+
usage: this.systems()
|
|
1318
1312
|
***************/
|
|
1319
1313
|
justice() {
|
|
1320
1314
|
if (!this._active) return this._messages.offline; // check the active status
|
|
@@ -1332,7 +1326,7 @@ class Deva {
|
|
|
1332
1326
|
func: authority
|
|
1333
1327
|
params: none
|
|
1334
1328
|
describe: basic authority features available in a Deva.
|
|
1335
|
-
usage: this.
|
|
1329
|
+
usage: this.systems()
|
|
1336
1330
|
***************/
|
|
1337
1331
|
authority() {
|
|
1338
1332
|
if (!this._active) return this._messages.offline; // check the active status
|
|
@@ -1346,24 +1340,6 @@ class Deva {
|
|
|
1346
1340
|
}
|
|
1347
1341
|
}
|
|
1348
1342
|
|
|
1349
|
-
/**************
|
|
1350
|
-
func: defense
|
|
1351
|
-
params: none
|
|
1352
|
-
describe: basic defense features available in a Deva.
|
|
1353
|
-
usage: this.defense()
|
|
1354
|
-
***************/
|
|
1355
|
-
defense() {
|
|
1356
|
-
if (!this._active) return this._messages.offline; // check the active status
|
|
1357
|
-
this.zone('defense');
|
|
1358
|
-
this.feature('defense'); // set the support state
|
|
1359
|
-
try {
|
|
1360
|
-
this.state('return', 'defense'); // set the systems state
|
|
1361
|
-
return this.lib.copy(this._defense); // return the systems feature
|
|
1362
|
-
} catch (e) {
|
|
1363
|
-
return this.error(e); // return this.error when error catch
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
1343
|
/**************
|
|
1368
1344
|
func: load
|
|
1369
1345
|
params:
|