@indra.ai/deva 1.5.7 → 1.5.8
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 +7 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -242,20 +242,20 @@ class Deva {
|
|
|
242
242
|
client presented data.
|
|
243
243
|
***************/
|
|
244
244
|
Feature(feature, resolve, reject) {
|
|
245
|
-
const
|
|
246
|
-
this.feature(feature,
|
|
247
|
-
this.zone(feature,
|
|
245
|
+
const _id = this.lib.uid();
|
|
246
|
+
this.feature(feature, _id);
|
|
247
|
+
this.zone(feature, _id);
|
|
248
248
|
const _cl = this.client(); // set local copy of client data
|
|
249
249
|
try {
|
|
250
250
|
if (!_cl.features[feature]) return resolve(); // if no security feature goto Support
|
|
251
251
|
else {
|
|
252
|
-
this.action(feature,
|
|
252
|
+
this.action(feature, _id); // set action to feature
|
|
253
253
|
const _fe = `_${feature}`;
|
|
254
254
|
const {id, profile, features} = _cl; // make a copy the clinet data.
|
|
255
255
|
const data = features[feature]; // make a copy the clinet data.
|
|
256
256
|
this.state('set', `feature:${id}`);
|
|
257
257
|
this[_fe] = { // set this_security with data
|
|
258
|
-
id, // uuid of the security feature
|
|
258
|
+
id: _id, // uuid of the security feature
|
|
259
259
|
client_id: id, // client id for reference
|
|
260
260
|
client_name: profile.name, // client name for personalization
|
|
261
261
|
concerns: data.concerns, // any concerns for client
|
|
@@ -263,11 +263,11 @@ class Deva {
|
|
|
263
263
|
personal: data.devas[this._agent.key], // Client personal features and rules.
|
|
264
264
|
};
|
|
265
265
|
delete this._client.features[feature]; // make a copy the clinet data.
|
|
266
|
-
this.state('resolve', `${feature}:${
|
|
266
|
+
this.state('resolve', `${feature}:${_id}`);
|
|
267
267
|
return resolve(feature); // resolve when done
|
|
268
268
|
}
|
|
269
269
|
} catch (e) {
|
|
270
|
-
this.state('catch', `${feature}:${
|
|
270
|
+
this.state('catch', `${feature}:${_id}`);
|
|
271
271
|
return this.error(e, feature, reject); // run error handling if an error is caught
|
|
272
272
|
}
|
|
273
273
|
}
|