@indra.ai/deva 1.6.61 → 1.6.63
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 +8 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2200,27 +2200,29 @@ class Deva {
|
|
|
2200
2200
|
const {meta, text} = q;
|
|
2201
2201
|
const {key, method, params} = meta;
|
|
2202
2202
|
const opts = this.lib.copy(params); // copy the params and set as opts.
|
|
2203
|
-
|
|
2203
|
+
const command = opts.shift();
|
|
2204
|
+
|
|
2204
2205
|
const {invalid_agent,invalid_client} = config.messages;
|
|
2205
2206
|
|
|
2206
2207
|
const agent_hash = agent.sha256 === packet.q.agent.sha256 ? agent.sha256 : invalid_agent;
|
|
2207
2208
|
const client_hash = client.sha256 === packet.q.client.sha256 ? client.sha256 : invalid_client;
|
|
2208
|
-
|
|
2209
2209
|
const created = this.lib.formatDate(time, 'long', true); // Formatted created date.
|
|
2210
2210
|
|
|
2211
2211
|
const container = `OM:O:${key.toUpperCase()}:${transport}`; // set container string.
|
|
2212
|
-
const {write} = client.profile; // set write string.
|
|
2213
2212
|
|
|
2213
|
+
const packet_hash = this.lib.hash(packet, 'sha256');
|
|
2214
2214
|
const token = this.lib.hash(`${key} client:${client.profile.id} fullname:${client.profile.fullname} transport:${transport}`, 'sha256');
|
|
2215
2215
|
|
|
2216
2216
|
// build the main data packet.
|
|
2217
2217
|
const data = {
|
|
2218
2218
|
id,
|
|
2219
|
+
key,
|
|
2220
|
+
method,
|
|
2221
|
+
opts,
|
|
2219
2222
|
text,
|
|
2220
2223
|
time,
|
|
2221
2224
|
container,
|
|
2222
|
-
|
|
2223
|
-
cient: {
|
|
2225
|
+
client: {
|
|
2224
2226
|
key: client.key,
|
|
2225
2227
|
name: client.profile.name,
|
|
2226
2228
|
fullname: client.profile.fullname,
|
|
@@ -2236,6 +2238,7 @@ class Deva {
|
|
|
2236
2238
|
name: agent.profile.name,
|
|
2237
2239
|
sha256: agent.sha256,
|
|
2238
2240
|
},
|
|
2241
|
+
packet: packet_hash,
|
|
2239
2242
|
created,
|
|
2240
2243
|
warning: client.warning || agent.warning || 'none',
|
|
2241
2244
|
copyright: client.profile.copyright || agent.profile.copyright,
|