@genesislcap/foundation-comms 14.225.3-alpha-15b094e.0 → 14.225.3-alpha-31011b5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,6 +70,7 @@ export declare class DefaultKVStorage implements KVStorage {
70
70
  */
71
71
  get<T = KVValue>(): Promise<KeyValueTransfer<T>[]>;
72
72
  get<T = KVValue>(key: string): Promise<KeyValueTransfer<T>>;
73
+ private getDecodedValue;
73
74
  /**
74
75
  * Lists all keys for the user.
75
76
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"kv.service.d.ts","sourceRoot":"","sources":["../../../../src/storage/kv/kv.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAMpD,OAAO,EAAgB,OAAO,EAA0B,MAAM,eAAe,CAAC;AAE9E,OAAO,EAA0B,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,sBAAsB,EAGvB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,GAAG,sBAAsB,CAAC,CAAC;IAC/D,GAAG,CAAC,CAAC,GAAG,OAAO,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACnD,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,GAAG,sBAAsB,CAAC,CAAC;CACvE;AAED;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,SAAS;IAErC,OAAO,CAAC,OA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AE,GAAG,OAAO,CAAC,IAAI,GAAG,sBAAsB,CAAC;CAoB5E;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,iEAAsE,CAAC;AAE7F;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC"}
@@ -72,21 +72,9 @@ let DefaultKVStorage = class DefaultKVStorage {
72
72
  const result = yield this.connect.request(KVMessageType.REQ_KEY_VALUE_READ, params);
73
73
  if (result && result.REPLY && result.REPLY.length > 0) {
74
74
  const kvs = result.REPLY.map((kv) => {
75
- // For backwards compatibility, we need a prefix
76
- if (!kv.VALUE.startsWith('str:') && !kv.VALUE.startsWith('bin:')) {
77
- kv.VALUE = `str:${kv.VALUE}`;
78
- }
79
- let decoded = decodeFromBase64WithPrefix(kv.VALUE);
80
- // TODO: \/ \/ The bit below only applies if `put` was called with `base64: true`
81
- if (typeof decoded === 'string' && decoded.startsWith('str:')) {
82
- decoded = decodeFromBase64WithPrefix(decoded);
83
- }
84
- if (typeof decoded === 'string' && decoded.startsWith('bin:')) {
85
- decoded = decodeFromBase64WithPrefix(decoded);
86
- }
87
- // TODO: /\ /\ The bit above only applies if `put` was called with `base64: true`
75
+ const decodedValue = this.getDecodedValue(kv.VALUE);
88
76
  return {
89
- kv: { key: kv.KEY, value: decoded },
77
+ kv: { key: kv.KEY, value: decodedValue },
90
78
  };
91
79
  });
92
80
  return key ? kvs[0] : kvs;
@@ -96,6 +84,21 @@ let DefaultKVStorage = class DefaultKVStorage {
96
84
  }
97
85
  });
98
86
  }
87
+ getDecodedValue(value) {
88
+ // For backwards compatibility, we need a prefix
89
+ if (!value.startsWith('str:') && !value.startsWith('bin:')) {
90
+ value = `str:${value}`;
91
+ }
92
+ let decodedValue = decodeFromBase64WithPrefix(value);
93
+ // These checks below only apply if `put` was called with `base64: true`
94
+ if (typeof decodedValue === 'string' && decodedValue.startsWith('str:')) {
95
+ decodedValue = decodeFromBase64WithPrefix(decodedValue);
96
+ }
97
+ if (typeof decodedValue === 'string' && decodedValue.startsWith('bin:')) {
98
+ decodedValue = decodeFromBase64WithPrefix(decodedValue);
99
+ }
100
+ return decodedValue;
101
+ }
99
102
  /**
100
103
  * Lists all keys for the user.
101
104
  * @alpha
@@ -151,7 +154,6 @@ let DefaultKVStorage = class DefaultKVStorage {
151
154
  }),
152
155
  },
153
156
  };
154
- debugger;
155
157
  const result = yield this.connect.commitEvent(KVEventMessageType.EVENT_KEY_VALUE_PUT, params);
156
158
  if (result && result.MESSAGE_TYPE === 'EVENT_ACK') {
157
159
  return true;
@@ -2030,6 +2030,7 @@ export declare class DefaultKVStorage implements KVStorage {
2030
2030
  */
2031
2031
  get<T = KVValue>(): Promise<KeyValueTransfer<T>[]>;
2032
2032
  get<T = KVValue>(key: string): Promise<KeyValueTransfer<T>>;
2033
+ private getDecodedValue;
2033
2034
  /**
2034
2035
  * Lists all keys for the user.
2035
2036
  * @alpha
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-comms",
3
3
  "description": "Genesis Foundation UI Comms",
4
- "version": "14.225.3-alpha-15b094e.0",
4
+ "version": "14.225.3-alpha-31011b5.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -75,23 +75,23 @@
75
75
  }
76
76
  },
77
77
  "devDependencies": {
78
- "@genesislcap/foundation-testing": "14.225.3-alpha-15b094e.0",
79
- "@genesislcap/genx": "14.225.3-alpha-15b094e.0",
80
- "@genesislcap/rollup-builder": "14.225.3-alpha-15b094e.0",
81
- "@genesislcap/ts-builder": "14.225.3-alpha-15b094e.0",
82
- "@genesislcap/uvu-playwright-builder": "14.225.3-alpha-15b094e.0",
83
- "@genesislcap/vite-builder": "14.225.3-alpha-15b094e.0",
84
- "@genesislcap/webpack-builder": "14.225.3-alpha-15b094e.0",
78
+ "@genesislcap/foundation-testing": "14.225.3-alpha-31011b5.0",
79
+ "@genesislcap/genx": "14.225.3-alpha-31011b5.0",
80
+ "@genesislcap/rollup-builder": "14.225.3-alpha-31011b5.0",
81
+ "@genesislcap/ts-builder": "14.225.3-alpha-31011b5.0",
82
+ "@genesislcap/uvu-playwright-builder": "14.225.3-alpha-31011b5.0",
83
+ "@genesislcap/vite-builder": "14.225.3-alpha-31011b5.0",
84
+ "@genesislcap/webpack-builder": "14.225.3-alpha-31011b5.0",
85
85
  "@types/js-cookie": "^3.0.2",
86
86
  "@types/json-schema": "^7.0.11",
87
87
  "@types/webappsec-credential-management": "^0.6.2",
88
88
  "rimraf": "^5.0.0"
89
89
  },
90
90
  "dependencies": {
91
- "@genesislcap/foundation-broadcast-channel": "14.225.3-alpha-15b094e.0",
92
- "@genesislcap/foundation-logger": "14.225.3-alpha-15b094e.0",
93
- "@genesislcap/foundation-user": "14.225.3-alpha-15b094e.0",
94
- "@genesislcap/foundation-utils": "14.225.3-alpha-15b094e.0",
91
+ "@genesislcap/foundation-broadcast-channel": "14.225.3-alpha-31011b5.0",
92
+ "@genesislcap/foundation-logger": "14.225.3-alpha-31011b5.0",
93
+ "@genesislcap/foundation-user": "14.225.3-alpha-31011b5.0",
94
+ "@genesislcap/foundation-utils": "14.225.3-alpha-31011b5.0",
95
95
  "@microsoft/fast-element": "1.14.0",
96
96
  "@microsoft/fast-foundation": "2.49.6",
97
97
  "analytics": "^0.8.0",
@@ -111,5 +111,5 @@
111
111
  "publishConfig": {
112
112
  "access": "public"
113
113
  },
114
- "gitHead": "042f1b051fd4a57c332966e1d13d7944e211d1a5"
114
+ "gitHead": "f1788c08a867b80f77c1a9fe5e13d8692ceb085d"
115
115
  }