@indra.ai/deva 1.4.5 → 1.4.7
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.json +1 -2
- package/index.js +15 -17
- package/package.json +1 -1
package/config.json
CHANGED
|
@@ -157,7 +157,6 @@
|
|
|
157
157
|
"method": "❤️🔥 Method",
|
|
158
158
|
"list": "📋 List",
|
|
159
159
|
"reply": "📮 Reply",
|
|
160
|
-
"write": "️📝 Write",
|
|
161
160
|
"set": "🍽️ Set",
|
|
162
161
|
"get": "🤔 Get",
|
|
163
162
|
"send": "🚀 Send",
|
|
@@ -200,7 +199,7 @@
|
|
|
200
199
|
"audio": "👂 Audio",
|
|
201
200
|
"text": "📕 Text",
|
|
202
201
|
"image": "🌄 Image",
|
|
203
|
-
"
|
|
202
|
+
"video": "📽️ Video",
|
|
204
203
|
"signature": "✍️ Signature",
|
|
205
204
|
"orders": "🪖 Orders",
|
|
206
205
|
"law": "🔏 Law",
|
package/index.js
CHANGED
|
@@ -238,7 +238,7 @@ class Deva {
|
|
|
238
238
|
const data = features[feature]; // make a copy the clinet data.
|
|
239
239
|
this.state('set', feature);
|
|
240
240
|
this[_fe] = { // set this_security with data
|
|
241
|
-
id: this.lib.uid(
|
|
241
|
+
id: this.lib.uid(), // uuid of the security feature
|
|
242
242
|
client_id: id, // client id for reference
|
|
243
243
|
client_name: profile.name, // client name for personalization
|
|
244
244
|
concerns: data.concerns, // any concerns for client
|
|
@@ -677,7 +677,7 @@ class Deva {
|
|
|
677
677
|
const agent = this.agent();
|
|
678
678
|
|
|
679
679
|
const _data = {
|
|
680
|
-
id: this.lib.uid(
|
|
680
|
+
id: this.lib.uid(),
|
|
681
681
|
key: 'init',
|
|
682
682
|
value: agent.key,
|
|
683
683
|
agent,
|
|
@@ -902,8 +902,7 @@ class Deva {
|
|
|
902
902
|
params:
|
|
903
903
|
- msg: hte message from the caller incase need to use in calls
|
|
904
904
|
describe:
|
|
905
|
-
The exit state function is triggered when the Deva is exiting
|
|
906
|
-
status and setting the state to exit for things like security check.
|
|
905
|
+
The exit state function is triggered when the Deva is exiting.
|
|
907
906
|
|
|
908
907
|
The return will check for a custom onExit function or run the done
|
|
909
908
|
function.
|
|
@@ -916,7 +915,7 @@ class Deva {
|
|
|
916
915
|
|
|
917
916
|
this.action('exit');
|
|
918
917
|
const data = {
|
|
919
|
-
id: this.lib.uid(
|
|
918
|
+
id: this.lib.uid(),
|
|
920
919
|
key: 'exit',
|
|
921
920
|
value: this._messages.exit,
|
|
922
921
|
agent,
|
|
@@ -983,7 +982,7 @@ class Deva {
|
|
|
983
982
|
this.action('func', 'states');
|
|
984
983
|
this.state('return', 'states');
|
|
985
984
|
return {
|
|
986
|
-
id: this.lib.uid(
|
|
985
|
+
id: this.lib.uid(),
|
|
987
986
|
key: 'states',
|
|
988
987
|
value: this._states,
|
|
989
988
|
created: Date.now(),
|
|
@@ -1029,7 +1028,7 @@ class Deva {
|
|
|
1029
1028
|
this.action('func', 'zones');
|
|
1030
1029
|
this.state('return', 'zones');
|
|
1031
1030
|
return {
|
|
1032
|
-
id: this.lib.uid(
|
|
1031
|
+
id: this.lib.uid(), // set the uuid of the data
|
|
1033
1032
|
agent: this.agent(), // set the agent value
|
|
1034
1033
|
cleint: this.client(), // set the client value
|
|
1035
1034
|
key: 'zones', // set the key return value
|
|
@@ -1056,7 +1055,7 @@ class Deva {
|
|
|
1056
1055
|
const msg = msg_action || action; // set the correct message
|
|
1057
1056
|
const text = extra ? `${msg} ${extra}` : msg; // set the text of the action
|
|
1058
1057
|
const data = { // build the data object for the action.
|
|
1059
|
-
id: this.lib.uid(
|
|
1058
|
+
id: this.lib.uid(), // generate a guid for the action transmitssion.
|
|
1060
1059
|
agent: this.agent(), // the agent data to send with the action
|
|
1061
1060
|
client: this.client(), // the client data to send with the action
|
|
1062
1061
|
key: 'action', // the key for event to transmit action type
|
|
@@ -1081,7 +1080,7 @@ class Deva {
|
|
|
1081
1080
|
this.action('func', 'actions');
|
|
1082
1081
|
this.state('return', 'actions');
|
|
1083
1082
|
return {
|
|
1084
|
-
id: this.lib.uid(
|
|
1083
|
+
id: this.lib.uid(), // set the id with a uuid
|
|
1085
1084
|
agent: this.agent(), // set the agent value
|
|
1086
1085
|
client: this.client(), // set the client value
|
|
1087
1086
|
key: 'actions', // set the data key
|
|
@@ -1105,7 +1104,7 @@ class Deva {
|
|
|
1105
1104
|
const text = extra ? `${lookup} ${extra}` : lookup; // set the text value
|
|
1106
1105
|
|
|
1107
1106
|
const data = { // build data object
|
|
1108
|
-
id: this.lib.uid(
|
|
1107
|
+
id: this.lib.uid(), // set the id
|
|
1109
1108
|
agent: this.agent(), // set the agent transporting the packet.
|
|
1110
1109
|
key: 'feature', // set the key for transport
|
|
1111
1110
|
value, // set the value of the key
|
|
@@ -1128,7 +1127,7 @@ class Deva {
|
|
|
1128
1127
|
features() {
|
|
1129
1128
|
this.state('return', 'features');
|
|
1130
1129
|
return { // return the data object
|
|
1131
|
-
id: this.lib.uid(
|
|
1130
|
+
id: this.lib.uid(), // set the object id
|
|
1132
1131
|
agent: this.agent(), // set the agent value.
|
|
1133
1132
|
client: this.client(), // set the client value.
|
|
1134
1133
|
key: 'features', // set the key
|
|
@@ -1152,7 +1151,7 @@ class Deva {
|
|
|
1152
1151
|
const text = extra ? `${lookup} ${extra}` : lookup;
|
|
1153
1152
|
|
|
1154
1153
|
const data = {
|
|
1155
|
-
id: this.lib.uid(
|
|
1154
|
+
id: this.lib.uid(),
|
|
1156
1155
|
agent: this.agent(),
|
|
1157
1156
|
client: this.client(),
|
|
1158
1157
|
key: 'context',
|
|
@@ -1173,7 +1172,7 @@ class Deva {
|
|
|
1173
1172
|
if (!this._active) return this._messages.offline; // check the active status
|
|
1174
1173
|
this.state('return', 'contexts');
|
|
1175
1174
|
return {
|
|
1176
|
-
id: this.lib.uid(
|
|
1175
|
+
id: this.lib.uid(),
|
|
1177
1176
|
agent: this.agent(),
|
|
1178
1177
|
client: this.client(),
|
|
1179
1178
|
key: 'contexts',
|
|
@@ -1420,7 +1419,7 @@ class Deva {
|
|
|
1420
1419
|
const agent = this.agent();
|
|
1421
1420
|
const client = this.client();
|
|
1422
1421
|
const _data = {
|
|
1423
|
-
id: this.lib.uid(
|
|
1422
|
+
id: this.lib.uid(),
|
|
1424
1423
|
key: 'prompt',
|
|
1425
1424
|
value: agent.key,
|
|
1426
1425
|
agent,
|
|
@@ -1506,17 +1505,16 @@ class Deva {
|
|
|
1506
1505
|
- data: Any additional data associated with the error
|
|
1507
1506
|
- reject: An associated promise reject if the caller requires.
|
|
1508
1507
|
describe:
|
|
1509
|
-
The
|
|
1508
|
+
The error function provides the consistent error manage of the system.
|
|
1510
1509
|
usage: this.error(err, data, reject);
|
|
1511
1510
|
***************/
|
|
1512
1511
|
error(err,data=false,reject=false) {
|
|
1513
1512
|
this.zone('error');
|
|
1514
|
-
|
|
1515
1513
|
this.action('error')
|
|
1516
1514
|
const agent = this.agent();
|
|
1517
1515
|
const client = this.client();
|
|
1518
1516
|
const _data = {
|
|
1519
|
-
id: this.lib.uid(
|
|
1517
|
+
id: this.lib.uid(),
|
|
1520
1518
|
key: 'error',
|
|
1521
1519
|
value: agent.key,
|
|
1522
1520
|
agent,
|