@indra.ai/deva 1.32.0 → 1.33.1
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/config/beliefs.json +1 -1
- package/config/features.json +2 -1
- package/index.js +70 -38
- package/lib/index.js +3 -1
- package/package.json +1 -1
- package/tests/client.json +5 -0
package/config/beliefs.json
CHANGED
package/config/features.json
CHANGED
package/index.js
CHANGED
|
@@ -28,27 +28,24 @@ class Deva {
|
|
|
28
28
|
this._error = false; // inherited Error features.
|
|
29
29
|
this._log = false; // inherited Log features.
|
|
30
30
|
this._data = false; // inherited Data features.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
31
|
+
this._report = false; // inherited Report features.
|
|
32
|
+
this._algorithm = false; // inherited Algorithm features.
|
|
33
|
+
this._intelligence = false; // inherited Intelligence features.
|
|
34
34
|
this._automation = false; // inherited Automation features.
|
|
35
35
|
this._simulation = false; // inherited Automation features.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this._treasury = false; // inherited Vector features.
|
|
39
|
-
this._authority = false; // inherited Justice features.
|
|
36
|
+
this._communication = false; // inherited Communication features.
|
|
37
|
+
this._treasury = false; // inherited Treasury features.
|
|
40
38
|
this._justice = false; // inherited Justice features.
|
|
39
|
+
this._authority = false; // inherited Authority features.
|
|
40
|
+
this._legal = false; // inherited Legal features.
|
|
41
41
|
this._owner = false; // inherited Owner features.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this._guard = false; // inherited Guard features.
|
|
45
|
-
this._defense = false; // inherited Security features.
|
|
46
|
-
this._wall = false; // inherited Wall features.
|
|
47
|
-
this._proxy = false; // inherited Proxy features.
|
|
42
|
+
this._security = false; // inherited Security features.
|
|
43
|
+
this._medical = false; // inherited Medical features.
|
|
48
44
|
this._support = false; // inherited Support features.
|
|
49
45
|
this._services = false; // inherited Service features.
|
|
50
46
|
this._systems = false; // inherited Systems features.
|
|
51
47
|
this._networks = false; // inherited Systems features.
|
|
48
|
+
this._veda = false; // inherited Veda features.
|
|
52
49
|
|
|
53
50
|
this.events = opts.events || new EventEmitter({}); // Event Bus
|
|
54
51
|
this.lib = new lib({pkg}); // used for loading library functions
|
|
@@ -529,6 +526,17 @@ class Deva {
|
|
|
529
526
|
return this.Feature('report', resolve, reject);
|
|
530
527
|
}
|
|
531
528
|
|
|
529
|
+
/**************
|
|
530
|
+
func: Algorithm
|
|
531
|
+
params: resolve, reject
|
|
532
|
+
describe:
|
|
533
|
+
The Algorithm feature sets the correct variables and necessary rules for the
|
|
534
|
+
client presented data.
|
|
535
|
+
***************/
|
|
536
|
+
Algorithm(resolve, reject) {
|
|
537
|
+
return this.Feature('algorithm', resolve, reject);
|
|
538
|
+
}
|
|
539
|
+
|
|
532
540
|
/**************
|
|
533
541
|
func: Intelligence
|
|
534
542
|
params: resolve, reject
|
|
@@ -607,49 +615,48 @@ class Deva {
|
|
|
607
615
|
}
|
|
608
616
|
|
|
609
617
|
/**************
|
|
610
|
-
func:
|
|
618
|
+
func: Legal
|
|
611
619
|
params: resolve, reject
|
|
612
620
|
describe:
|
|
613
|
-
The
|
|
621
|
+
The Legal feature sets the correct variables and necessary rules for the
|
|
614
622
|
client presented data.
|
|
615
623
|
***************/
|
|
616
|
-
|
|
617
|
-
return this.Feature('
|
|
624
|
+
Legal(resolve, reject) {
|
|
625
|
+
return this.Feature('legal', resolve, reject);
|
|
618
626
|
}
|
|
619
|
-
|
|
627
|
+
|
|
620
628
|
/**************
|
|
621
|
-
func:
|
|
629
|
+
func: Owner
|
|
622
630
|
params: resolve, reject
|
|
623
631
|
describe:
|
|
624
|
-
The
|
|
632
|
+
The Owner feature sets the correct variables and necessary rules for the
|
|
625
633
|
client presented data.
|
|
626
634
|
***************/
|
|
627
|
-
|
|
628
|
-
return this.Feature('
|
|
635
|
+
Owner(resolve, reject) {
|
|
636
|
+
return this.Feature('owner', resolve, reject);
|
|
629
637
|
}
|
|
630
|
-
|
|
638
|
+
|
|
631
639
|
/**************
|
|
632
|
-
func:
|
|
640
|
+
func: Security
|
|
633
641
|
params: resolve, reject
|
|
634
642
|
describe:
|
|
635
|
-
The
|
|
643
|
+
The Security feature sets the correct variables and necessary rules for the
|
|
636
644
|
client presented data.
|
|
637
645
|
***************/
|
|
638
|
-
|
|
639
|
-
return this.Feature('
|
|
646
|
+
Security(resolve, reject) {
|
|
647
|
+
return this.Feature('security', resolve, reject);
|
|
640
648
|
}
|
|
641
|
-
|
|
649
|
+
|
|
642
650
|
/**************
|
|
643
|
-
func:
|
|
651
|
+
func: Medical
|
|
644
652
|
params: resolve, reject
|
|
645
653
|
describe:
|
|
646
|
-
The
|
|
654
|
+
The Medical feature sets the correct variables and necessary rules for the
|
|
647
655
|
client presented data.
|
|
648
656
|
***************/
|
|
649
|
-
|
|
650
|
-
return this.Feature('
|
|
657
|
+
Medical(resolve, reject) {
|
|
658
|
+
return this.Feature('medical', resolve, reject);
|
|
651
659
|
}
|
|
652
|
-
|
|
653
660
|
|
|
654
661
|
/**************
|
|
655
662
|
func: Support
|
|
@@ -695,6 +702,17 @@ class Deva {
|
|
|
695
702
|
return this.Feature('networks', resolve, reject);
|
|
696
703
|
}
|
|
697
704
|
|
|
705
|
+
/**************
|
|
706
|
+
func: Veda
|
|
707
|
+
params: resolve, reject
|
|
708
|
+
describe:
|
|
709
|
+
The Veda feature sets the correct variables and necessary rules for the
|
|
710
|
+
client presented data.
|
|
711
|
+
***************/
|
|
712
|
+
Veda(resolve, reject) {
|
|
713
|
+
return this.Feature('veda', resolve, reject);
|
|
714
|
+
}
|
|
715
|
+
|
|
698
716
|
/**************
|
|
699
717
|
func: Done
|
|
700
718
|
params: none
|
|
@@ -1187,6 +1205,8 @@ class Deva {
|
|
|
1187
1205
|
return this.Data(resolve, reject);
|
|
1188
1206
|
}).then(() => {
|
|
1189
1207
|
return this.Report(resolve, reject);
|
|
1208
|
+
}).then(() => {
|
|
1209
|
+
return this.Algorithm(resolve, reject);
|
|
1190
1210
|
}).then(() => {
|
|
1191
1211
|
return this.Intelligence(resolve, reject);
|
|
1192
1212
|
}).then(() => {
|
|
@@ -1201,14 +1221,14 @@ class Deva {
|
|
|
1201
1221
|
return this.Justice(resolve, reject);
|
|
1202
1222
|
}).then(() => {
|
|
1203
1223
|
return this.Authority(resolve, reject);
|
|
1204
|
-
}).then(() => {
|
|
1205
|
-
return this.Security(resolve, reject);
|
|
1206
|
-
}).then(() => {
|
|
1207
|
-
return this.Medical(resolve, reject);
|
|
1208
1224
|
}).then(() => {
|
|
1209
1225
|
return this.Legal(resolve, reject);
|
|
1210
1226
|
}).then(() => {
|
|
1211
1227
|
return this.Owner(resolve, reject);
|
|
1228
|
+
}).then(() => {
|
|
1229
|
+
return this.Security(resolve, reject);
|
|
1230
|
+
}).then(() => {
|
|
1231
|
+
return this.Medical(resolve, reject);
|
|
1212
1232
|
}).then(() => {
|
|
1213
1233
|
return this.Support(resolve, reject);
|
|
1214
1234
|
}).then(() => {
|
|
@@ -1217,6 +1237,8 @@ class Deva {
|
|
|
1217
1237
|
return this.Systems(resolve, reject);
|
|
1218
1238
|
}).then(() => {
|
|
1219
1239
|
return this.Networks(resolve, reject);
|
|
1240
|
+
}).then(() => {
|
|
1241
|
+
return this.Veda(resolve, reject);
|
|
1220
1242
|
}).then(() => {
|
|
1221
1243
|
return this.Done(resolve, reject);
|
|
1222
1244
|
}).then(() => {
|
|
@@ -1990,6 +2012,16 @@ class Deva {
|
|
|
1990
2012
|
return this._getFeature('networks', this._networks);
|
|
1991
2013
|
}
|
|
1992
2014
|
|
|
2015
|
+
/**************
|
|
2016
|
+
func: veda
|
|
2017
|
+
params: none
|
|
2018
|
+
describe: basic veda features available in a Deva.
|
|
2019
|
+
usage: this.veda()
|
|
2020
|
+
***************/
|
|
2021
|
+
veda() {
|
|
2022
|
+
return this._getFeature('veda', this._veda);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
1993
2025
|
/**************
|
|
1994
2026
|
func: load
|
|
1995
2027
|
params:
|
|
@@ -2328,7 +2360,7 @@ class Deva {
|
|
|
2328
2360
|
***************/
|
|
2329
2361
|
uid(guid=false) {
|
|
2330
2362
|
const time = Date.now(); // set time to local constant
|
|
2331
|
-
const date = this.lib.formatDate(time, '
|
|
2363
|
+
const date = this.lib.formatDate(time, 'iso', true); // set date to local constant
|
|
2332
2364
|
const license = this._info.VLA ? this._info.VLA.uid : false;
|
|
2333
2365
|
const client = this.client(); // get the client
|
|
2334
2366
|
const agent = this.agent(); // get the agent
|
package/lib/index.js
CHANGED
|
@@ -139,7 +139,9 @@ class LIB {
|
|
|
139
139
|
if (!d) d = Date.now();
|
|
140
140
|
d = new Date(d);
|
|
141
141
|
|
|
142
|
-
if (format === 'milli') return d.getTime();
|
|
142
|
+
if (format === 'milli') return d.getTime(); // return millisecond time
|
|
143
|
+
if (format === 'iso') return d.toISOString(); // return iso date
|
|
144
|
+
if (format === 'utc') return d.toUTCString(); // return utc date
|
|
143
145
|
// pre-set date formats for returning user dates.
|
|
144
146
|
const formats = {
|
|
145
147
|
long: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "71393644869653248038",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.33.1",
|
|
5
5
|
"description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "VLA:71393644869653248038 LICENSE.md",
|