@indra.ai/deva 1.1.111 → 1.1.112
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 +2 -2
- package/index.js +9 -9
- package/package.json +1 -1
package/config.json
CHANGED
package/index.js
CHANGED
|
@@ -29,6 +29,7 @@ class Deva {
|
|
|
29
29
|
this._artist = false; // inherited artist features.
|
|
30
30
|
this.events = opts.events || new EventEmitter({}); // Event Bus
|
|
31
31
|
this.lib = opts.lib || {}; // used for loading library functions
|
|
32
|
+
this.utils = opts.util || {}; // parse function
|
|
32
33
|
this.devas = opts.devas || {}; // Devas which are loaded
|
|
33
34
|
this.vars = opts.vars || {}; // Variables object
|
|
34
35
|
this.listeners = opts.listeners || {}; // local Listeners
|
|
@@ -95,15 +96,6 @@ class Deva {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
|
-
// bind translate
|
|
99
|
-
const translate = this._agent && this._agent.translate && typeof this._agent.translate === 'function';
|
|
100
|
-
if (translate) this._agent.translate = this._agent.translate.bind(this);
|
|
101
|
-
// bind parser
|
|
102
|
-
const parse = this._agent && this._agent.parse && typeof this._agent.parse === 'function';
|
|
103
|
-
if (parse) this._agent.parse = this._agent.parse.bind(this);
|
|
104
|
-
// bind process
|
|
105
|
-
const process = this._agent && this._agent.process && typeof this._agent.process === 'function';
|
|
106
|
-
if (process) this._agent.process = this._agent.process.bind(this);
|
|
107
99
|
}
|
|
108
100
|
catch (e) {
|
|
109
101
|
return this.error(e, false, reject); // trigger the this.error for errors
|
|
@@ -308,6 +300,14 @@ class Deva {
|
|
|
308
300
|
global: services.global, // the global policies for client
|
|
309
301
|
personal: services.devas[this._agent.key], // Client personal features and rules.
|
|
310
302
|
};
|
|
303
|
+
|
|
304
|
+
// setup any global methods from the services feature
|
|
305
|
+
for (const x in this._services.global) {
|
|
306
|
+
console.log('SETTING UP GLOBA SERVICE FUNCTIONS', x);
|
|
307
|
+
const isFunc = typeof this._services.global[x] === 'function' ? true :false;
|
|
308
|
+
if (isFunc) this.methods[x] = this._services.global[x].bind(this);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
311
|
delete this._client.features.services // delete the services key for isolation
|
|
312
312
|
return this.Systems() // go to Systems when done
|
|
313
313
|
}
|