@indra.ai/deva.security 0.0.34 → 0.0.36

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.
Files changed (2) hide show
  1. package/feature/methods.js +32 -8
  2. package/package.json +1 -1
@@ -61,13 +61,29 @@ export default {
61
61
  },
62
62
 
63
63
  /**************
64
- method: md5 hash
64
+ method: md5, sha256, sha512 hash
65
65
  params: packet
66
- describe: Return system md5 hash for the based deva.
66
+ describe: Return system md5, sha256, sha512 hash from value.
67
67
  ***************/
68
68
  hash(packet) {
69
- this.feature('security');
70
- const hash = this.lib.hash(packet.q.text, 'md5');
69
+ const transport = packet.id;
70
+ this.zone('security', `hash:${transport}`);
71
+ this.feature('security', `hash:${transport}`);
72
+ this.action('method', `hash:${transport}`);
73
+
74
+ this.state('set', `meta:${transport}`); //set the meta state for the proxy
75
+ const {meta} = packet.q; // set the meta information from the packet question.
76
+
77
+ this.state('set', `params:${transport}`); //set the meta state for the proxy
78
+ const {params} = meta; // set params from the meta information.
79
+
80
+ this.state('set', `algo:${transport}`); //set the meta state for the proxy
81
+ const algo = params[1] ? params[1] : 'md5'
82
+
83
+ this.state('set', `hash:${transport}`); //set the meta state for the proxy
84
+ const hash = this.lib.hash(packet.q.text, algo);
85
+
86
+ this.state('return', `hash:${transport}`);
71
87
  return Promise.resolve(hash);
72
88
  },
73
89
 
@@ -89,8 +105,13 @@ export default {
89
105
  describe: Return system date for today.
90
106
  ***************/
91
107
  today(packet) {
92
- this.feature('security');
108
+ const transport = packet.id;
109
+ this.zone('security', `today:${transport}`);
110
+ this.feature('security', `today:${transport}`);
111
+ this.action('method', `today:${transport}`);
112
+ this.state('get', `today:${transport}`);
93
113
  const theDate = this.lib.formatDate(Date.now(), 'long', true);
114
+ this.state('get', `today:${transport}`);
94
115
  return Promise.resolve(theDate);
95
116
  },
96
117
  /**************
@@ -99,10 +120,13 @@ export default {
99
120
  describe: Return system date for today.
100
121
  ***************/
101
122
  time(packet) {
102
- this.feature('security');
103
- this.action('method', 'time')
104
- this.state('get', 'time')
123
+ const transport = packet.id;
124
+ this.zone('security', `time:${transport}`);
125
+ this.feature('security', `time:${transport}`);
126
+ this.action('method', `time:${transport}`);
127
+ this.state('get', `time:${transport}`);
105
128
  const theTime = Date.now();
129
+ this.state('return', `time:${transport}`);
106
130
  return Promise.resolve(theTime);
107
131
  },
108
132
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": 6507120243760,
3
3
  "name": "@indra.ai/deva.security",
4
- "version": "0.0.34",
4
+ "version": "0.0.36",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",