@indra.ai/deva 1.5.30 → 1.5.31
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 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1193,6 +1193,7 @@ class Deva {
|
|
|
1193
1193
|
describe: return a list of features that are available to the system.
|
|
1194
1194
|
***************/
|
|
1195
1195
|
features() {
|
|
1196
|
+
if (!this._active) return this._messages.offline; // check the active status
|
|
1196
1197
|
const id = this.lib.uid();
|
|
1197
1198
|
this.action('features', id);
|
|
1198
1199
|
const data = {
|
|
@@ -1216,6 +1217,7 @@ class Deva {
|
|
|
1216
1217
|
describe
|
|
1217
1218
|
***************/
|
|
1218
1219
|
context(value=false, extra=false) {
|
|
1220
|
+
if (!this._active) return this._messages.offline; // check the active status
|
|
1219
1221
|
const id = this.lib.uid();
|
|
1220
1222
|
try {
|
|
1221
1223
|
if (!value) return;
|
|
@@ -1242,6 +1244,7 @@ class Deva {
|
|
|
1242
1244
|
}
|
|
1243
1245
|
|
|
1244
1246
|
contexts() {
|
|
1247
|
+
if (!this._active) return this._messages.offline; // check the active status
|
|
1245
1248
|
const id = this.lib.uid();
|
|
1246
1249
|
this.action('contexts', id);
|
|
1247
1250
|
if (!this._active) return this._messages.offline; // check the active status
|
|
@@ -1458,9 +1461,9 @@ class Deva {
|
|
|
1458
1461
|
describe: return core data.
|
|
1459
1462
|
***************/
|
|
1460
1463
|
core() {
|
|
1464
|
+
if (!this._active) return this._messages.offline;
|
|
1461
1465
|
const id = this.lib.uid();
|
|
1462
1466
|
this.action('core', id);
|
|
1463
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1464
1467
|
|
|
1465
1468
|
// check the active status
|
|
1466
1469
|
const data = this.lib.copy(this._core);
|
|
@@ -1477,9 +1480,9 @@ class Deva {
|
|
|
1477
1480
|
describe: return info data.
|
|
1478
1481
|
***************/
|
|
1479
1482
|
info() {
|
|
1483
|
+
if (!this._active) return this._messages.offline;
|
|
1480
1484
|
const id = this.lib.uid();
|
|
1481
1485
|
this.action('info', id);
|
|
1482
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1483
1486
|
|
|
1484
1487
|
const data = this.lib.copy(this._info);
|
|
1485
1488
|
data.id = id;
|
|
@@ -1501,10 +1504,10 @@ class Deva {
|
|
|
1501
1504
|
usage: this.status('msg')
|
|
1502
1505
|
***************/
|
|
1503
1506
|
status() {
|
|
1507
|
+
if (!this._active) return this._messages.offline;
|
|
1504
1508
|
const id = this.lib.uid();
|
|
1505
1509
|
this.action('status', id);
|
|
1506
1510
|
// check the active status
|
|
1507
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1508
1511
|
|
|
1509
1512
|
// format the date since active for output.
|
|
1510
1513
|
const dateFormat = this.lib.formatDate(this._active, 'long', true);
|
|
@@ -1525,13 +1528,13 @@ class Deva {
|
|
|
1525
1528
|
***************/
|
|
1526
1529
|
help(msg, help_dir) {
|
|
1527
1530
|
return new Promise((resolve, reject) => {
|
|
1528
|
-
const id = this.lib.uid();
|
|
1529
|
-
this.context('help', id);
|
|
1530
1531
|
this.zone('help', id);
|
|
1532
|
+
if (!this._active) return resolve(this._messages.offline);
|
|
1533
|
+
const id = this.lib.uid();
|
|
1531
1534
|
this.feature('help', id);
|
|
1532
1535
|
this.action('help', id);
|
|
1533
1536
|
this.state('help', id);
|
|
1534
|
-
|
|
1537
|
+
this.context('help', id);
|
|
1535
1538
|
const params = msg.split(' '); // split the msg into an array by spaces.
|
|
1536
1539
|
let helpFile = 'main'; // set default help file
|
|
1537
1540
|
if (params[0]) helpFile = params[0]; // check the msg for a help file
|
|
@@ -1568,10 +1571,10 @@ class Deva {
|
|
|
1568
1571
|
***************/
|
|
1569
1572
|
error(err,data=false,reject=false) {
|
|
1570
1573
|
const id = this.lib.uid();
|
|
1571
|
-
this.context('error', id);
|
|
1572
1574
|
this.zone('error', id);
|
|
1573
1575
|
this.action('error', id);
|
|
1574
1576
|
this.state('error', id);
|
|
1577
|
+
this.context('error', id);
|
|
1575
1578
|
|
|
1576
1579
|
const agent = this.agent();
|
|
1577
1580
|
const client = this.client();
|