@indra.ai/deva 1.6.37 → 1.6.38
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 +4 -4
- package/lib/index.js +5 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1126,15 +1126,15 @@ class Deva {
|
|
|
1126
1126
|
data.sha512 = this.lib.hash(data, 'sha512');
|
|
1127
1127
|
|
|
1128
1128
|
const client = this.client();
|
|
1129
|
-
|
|
1130
|
-
|
|
1129
|
+
this.lib.setClient(client.sha256);
|
|
1130
|
+
const agent = this.agent();
|
|
1131
|
+
this.lib.setAgent(agent.sha256);
|
|
1132
|
+
|
|
1131
1133
|
this.state('ready', data.id.uid);
|
|
1132
1134
|
this.talk(config.events.ready, data);
|
|
1133
1135
|
return hasOnReady ? this.onReady(data, resolve) : resolve(data);
|
|
1134
1136
|
}
|
|
1135
1137
|
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
1138
|
/**************
|
|
1139
1139
|
func: finish
|
|
1140
1140
|
params:
|
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 || 'en-US';
|
|
@@ -31,9 +31,11 @@ class LIB {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
setClient(client) {
|
|
34
|
-
console.log('lib set client');
|
|
35
34
|
if (!this.client) this.client = client;
|
|
36
35
|
}
|
|
36
|
+
setAgent(agent) {
|
|
37
|
+
if (!this.agent) this.agent = agent;
|
|
38
|
+
}
|
|
37
39
|
|
|
38
40
|
help(msg, help_dir) {
|
|
39
41
|
return new Promise((resolve, reject) => {
|
|
@@ -67,7 +69,6 @@ class LIB {
|
|
|
67
69
|
uid(guid=false) {
|
|
68
70
|
const time = Date.now(); // set time to local constant
|
|
69
71
|
const date = this.formatDate(time, 'long', true); // set date to local constant
|
|
70
|
-
const agent_hash = this.hash(this.agent, 'sha256');
|
|
71
72
|
const machine = {
|
|
72
73
|
arch: os.arch(),
|
|
73
74
|
hostname: os.hostname(),
|
|
@@ -88,7 +89,7 @@ class LIB {
|
|
|
88
89
|
uid: false,
|
|
89
90
|
time,
|
|
90
91
|
date,
|
|
91
|
-
agent:
|
|
92
|
+
agent: this.agent,
|
|
92
93
|
client: this.client,
|
|
93
94
|
pkg: pkg_hash,
|
|
94
95
|
machine: machine_hash,
|