@indra.ai/deva 1.4.11 → 1.4.13
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 +17 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -182,6 +182,23 @@ class Deva {
|
|
|
182
182
|
return packet;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
_feature(key, value) {
|
|
186
|
+
if (!this._active) return this._messages.offline; // check the active status
|
|
187
|
+
this.zone(key);
|
|
188
|
+
this.feature(key); // set the security state
|
|
189
|
+
try {
|
|
190
|
+
const data = this.lib.copy(value);
|
|
191
|
+
data.id = this.lib.uid();
|
|
192
|
+
data.hash = this.lib.hash(value);
|
|
193
|
+
data.created = Date.now();
|
|
194
|
+
this.state('return', key); // set the security state
|
|
195
|
+
return data; // return the security feature
|
|
196
|
+
} catch (e) {
|
|
197
|
+
return this.error(e);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
185
202
|
/**************
|
|
186
203
|
func: Client
|
|
187
204
|
params: client - client provided data.
|
|
@@ -1211,20 +1228,6 @@ class Deva {
|
|
|
1211
1228
|
return agent_copy; // return the copy of the agent data.
|
|
1212
1229
|
}
|
|
1213
1230
|
|
|
1214
|
-
_feature(key, value) {
|
|
1215
|
-
if (!this._active) return this._messages.offline; // check the active status
|
|
1216
|
-
this.zone(key);
|
|
1217
|
-
this.feature(key); // set the security state
|
|
1218
|
-
try {
|
|
1219
|
-
const data = this.lib.copy(value);
|
|
1220
|
-
data.hash = this.lib.hash(value);
|
|
1221
|
-
data.created = Date.now();
|
|
1222
|
-
this.state('return', key); // set the security state
|
|
1223
|
-
return data; // return the security feature
|
|
1224
|
-
} catch (e) {
|
|
1225
|
-
return this.error(e);
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
1231
|
// FEATURE FUNCTIONS
|
|
1229
1232
|
/**************
|
|
1230
1233
|
func: security
|