@indra.ai/deva 1.6.61 → 1.6.62
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 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2200,27 +2200,31 @@ 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
2212
|
const {write} = client.profile; // set write string.
|
|
2213
2213
|
|
|
2214
|
+
const packet_hash = this.lib.hash(packet, 'sha256');
|
|
2214
2215
|
const token = this.lib.hash(`${key} client:${client.profile.id} fullname:${client.profile.fullname} transport:${transport}`, 'sha256');
|
|
2215
2216
|
|
|
2216
2217
|
// build the main data packet.
|
|
2217
2218
|
const data = {
|
|
2218
2219
|
id,
|
|
2220
|
+
key,
|
|
2221
|
+
method,
|
|
2222
|
+
opts,
|
|
2219
2223
|
text,
|
|
2220
2224
|
time,
|
|
2221
2225
|
container,
|
|
2222
2226
|
write,
|
|
2223
|
-
|
|
2227
|
+
client: {
|
|
2224
2228
|
key: client.key,
|
|
2225
2229
|
name: client.profile.name,
|
|
2226
2230
|
fullname: client.profile.fullname,
|
|
@@ -2236,6 +2240,7 @@ class Deva {
|
|
|
2236
2240
|
name: agent.profile.name,
|
|
2237
2241
|
sha256: agent.sha256,
|
|
2238
2242
|
},
|
|
2243
|
+
packet: packet_hash,
|
|
2239
2244
|
created,
|
|
2240
2245
|
warning: client.warning || agent.warning || 'none',
|
|
2241
2246
|
copyright: client.profile.copyright || agent.profile.copyright,
|