@indra.ai/deva 1.6.43 → 1.6.45
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 +2 -2
- package/lib/index.js +6 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1126,8 +1126,8 @@ class Deva {
|
|
|
1126
1126
|
data.sha256 = this.lib.hash(data, 'sha256');
|
|
1127
1127
|
data.sha512 = this.lib.hash(data, 'sha512');
|
|
1128
1128
|
|
|
1129
|
-
|
|
1130
|
-
this.lib.
|
|
1129
|
+
this.lib.setClient(this.client());
|
|
1130
|
+
this.lib.setAgent(this.agent());
|
|
1131
1131
|
|
|
1132
1132
|
this.state('ready', data.id.uid);
|
|
1133
1133
|
this.talk(config.events.ready, data);
|
package/lib/index.js
CHANGED
|
@@ -18,7 +18,7 @@ class Node {
|
|
|
18
18
|
class LIB {
|
|
19
19
|
constructor(opts) {
|
|
20
20
|
this.pkg = opts.pkg || {};
|
|
21
|
-
this.agent =
|
|
21
|
+
this.agent = false;
|
|
22
22
|
this.client = false;
|
|
23
23
|
this.lang = opts.lang || 'en';
|
|
24
24
|
this.locale = opts.locale || 'US';
|
|
@@ -32,16 +32,13 @@ class LIB {
|
|
|
32
32
|
|
|
33
33
|
setClient(client) {
|
|
34
34
|
if (this.client) return;
|
|
35
|
+
console.log('SET CLIENT', client);
|
|
35
36
|
this.client = client;
|
|
36
|
-
this.hashAgent();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
this.agent.md5 = this.hash(this.agent, 'md5');
|
|
43
|
-
this.agent.sha256 = this.hash(this.agent, 'sha256');
|
|
44
|
-
this.agent.sha512 = this.hash(this.agent, 'sha512');
|
|
39
|
+
setAgent(agent) {
|
|
40
|
+
if (this.agent) return;
|
|
41
|
+
this.agent = agent;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
help(msg, help_dir) {
|
|
@@ -92,12 +89,11 @@ class LIB {
|
|
|
92
89
|
const machine_hash = this.hash(machine, 'sha256');
|
|
93
90
|
const pkg_hash = this.hash(this.pkg, 'sha256');
|
|
94
91
|
|
|
95
|
-
|
|
96
92
|
const data = {
|
|
97
93
|
uid: false,
|
|
98
94
|
time,
|
|
99
95
|
date,
|
|
100
|
-
client: this.client,
|
|
96
|
+
client: this.client.sha256,
|
|
101
97
|
agent: this.agent.sha256,
|
|
102
98
|
pkg: pkg_hash,
|
|
103
99
|
machine: machine_hash,
|