@onehat/data 1.19.21 → 1.19.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.19.21",
3
+ "version": "1.19.22",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,6 +1,7 @@
1
1
  /** @module Repository */
2
2
 
3
3
  import LocalStorageRepository from '@onehat/data/src/Integration/Browser/Repository/LocalStorage';
4
+ import CryptoJS from 'crypto-js';
4
5
  import AES from 'crypto-js/aes';
5
6
  import _ from 'lodash';
6
7
 
@@ -31,7 +32,7 @@ class SecureLocalStorageRepository extends LocalStorageRepository {
31
32
  // BEGIN MOD
32
33
  let result = this._store(name);
33
34
  if (!_.isEmpty(result)) {
34
- result = AES.decrypt(result, this.passphrase);
35
+ result = AES.decrypt(result, this.passphrase).toString(CryptoJS.enc.Utf8);
35
36
  }
36
37
  // END MOD
37
38
 
@@ -66,7 +67,7 @@ class SecureLocalStorageRepository extends LocalStorageRepository {
66
67
  value = JSON.stringify(value);
67
68
  }
68
69
 
69
- value = AES.encrypt(value, this.passphrase); // MOD
70
+ value = AES.encrypt(value, this.passphrase).toString(); // MOD
70
71
 
71
72
  return this._store(name, value);
72
73
 
@@ -1,6 +1,7 @@
1
1
  /** @module Repository */
2
2
 
3
3
  import SessionStorageRepository from '@onehat/data/src/Integration/Browser/Repository/SessionStorage';
4
+ import CryptoJS from 'crypto-js';
4
5
  import AES from 'crypto-js/aes';
5
6
  import _ from 'lodash';
6
7
 
@@ -26,7 +27,7 @@ class SecureSessionStorageRepository extends SessionStorageRepository {
26
27
  // BEGIN MOD
27
28
  let result = this._store.session(name);
28
29
  if (!_.isEmpty(result)) {
29
- result = AES.decrypt(result, this.passphrase);
30
+ result = AES.decrypt(result, this.passphrase).toString(CryptoJS.enc.Utf8);
30
31
  }
31
32
  // END MOD
32
33
 
@@ -45,7 +46,7 @@ class SecureSessionStorageRepository extends SessionStorageRepository {
45
46
  value = JSON.stringify(value);
46
47
  }
47
48
 
48
- value = AES.encrypt(value, this.passphrase); // MOD
49
+ value = AES.encrypt(value, this.passphrase).toString(); // MOD
49
50
 
50
51
  return this._store.session(name, value);
51
52
  }
@@ -324,7 +324,7 @@ class OneBuildRepository extends AjaxRepository {
324
324
  const data = _.merge(params, this._baseParams);
325
325
 
326
326
  if (this.debugMode) {
327
- console.log('Sending ' + url, options);
327
+ console.log('getSingleEntityFromServer', options);
328
328
  }
329
329
 
330
330
  return this._send(this.methods.get, this.api.get, data)