@indra.ai/deva 1.17.1 → 1.17.2
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 +15 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2420,10 +2420,10 @@ class Deva {
|
|
|
2420
2420
|
***************/
|
|
2421
2421
|
sign(packet) {
|
|
2422
2422
|
const time = Date.now();
|
|
2423
|
+
const id = this.uid();
|
|
2423
2424
|
const client = this.client();
|
|
2424
2425
|
const agent = this.agent();
|
|
2425
|
-
const {q
|
|
2426
|
-
const transport = id.uid; // set the transport id from the packet id.
|
|
2426
|
+
const {q} = packet;
|
|
2427
2427
|
|
|
2428
2428
|
const {meta, text} = q;
|
|
2429
2429
|
const {key, method, params} = meta;
|
|
@@ -2436,10 +2436,10 @@ class Deva {
|
|
|
2436
2436
|
const client_hash = client.sha256 === packet.q.client.sha256 ? client.sha256 : invalid_client;
|
|
2437
2437
|
const created = this.lib.formatDate(time, 'long', true); // Formatted created date.
|
|
2438
2438
|
|
|
2439
|
-
const container = `OM:O:${key.toUpperCase()}:${
|
|
2439
|
+
const container = `OM:O:${key.toUpperCase()}:${id.uid}`; // set container string.
|
|
2440
2440
|
|
|
2441
2441
|
const packet_hash = this.hash(packet, 'sha256');
|
|
2442
|
-
const token = this.hash(`${key} client:${client.profile.id} fullname:${client.profile.fullname}
|
|
2442
|
+
const token = this.hash(`${key} client:${client.profile.id} fullname:${client.profile.fullname} uid:${id.uid}`, 'sha256');
|
|
2443
2443
|
|
|
2444
2444
|
// build the main data packet.
|
|
2445
2445
|
const data = {
|
|
@@ -2456,7 +2456,7 @@ class Deva {
|
|
|
2456
2456
|
fullname: client.profile.fullname,
|
|
2457
2457
|
emojis: client.profile.emojis,
|
|
2458
2458
|
company: client.profile.company,
|
|
2459
|
-
expires: client.expires ? time + client.expires : 'none',
|
|
2459
|
+
expires: client.profile.expires ? time + client.profile.expires : 'none',
|
|
2460
2460
|
caseid: client.profile.caseid || 'none',
|
|
2461
2461
|
token,
|
|
2462
2462
|
sha256: client.sha256,
|
|
@@ -2468,13 +2468,21 @@ class Deva {
|
|
|
2468
2468
|
},
|
|
2469
2469
|
packet: packet_hash,
|
|
2470
2470
|
created,
|
|
2471
|
-
warning:
|
|
2471
|
+
warning: agent.profile.warning || 'none',
|
|
2472
2472
|
copyright: agent.profile.copyright || this._core.copyright,
|
|
2473
2473
|
};
|
|
2474
|
+
|
|
2475
|
+
this.action('hash', `${data.key}:sign:md5:${data.id.uid}`);
|
|
2474
2476
|
data.md5 = this.hash(data, 'md5'); // hash data packet into md5 and inert into data.
|
|
2477
|
+
|
|
2478
|
+
this.action('hash', `${data.key}:sign:sha256:${data.id.uid}`);
|
|
2475
2479
|
data.sha256 = this.hash(data, 'sha256'); // hash data into sha 256 then set in data.
|
|
2480
|
+
|
|
2481
|
+
this.action('hash', `${data.key}:sign:sha512:${data.id.uid}`);
|
|
2476
2482
|
data.sha512 = this.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
2477
|
-
|
|
2483
|
+
|
|
2484
|
+
this.action('return', `${data.key}:sign:${data.id.uid}`);
|
|
2485
|
+
this.intent('good', `${data.key}:sign:${data.id.uid}`);
|
|
2478
2486
|
return data;
|
|
2479
2487
|
}
|
|
2480
2488
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "44091450722329207445",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.17.
|
|
4
|
+
"version": "1.17.2",
|
|
5
5
|
"description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "VLA:44091450722329207445 LICENSE.md",
|