@getpara/core-sdk 2.0.0-alpha.71 → 2.0.0-alpha.72
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/dist/cjs/constants.js
CHANGED
|
@@ -43,7 +43,7 @@ __export(constants_exports, {
|
|
|
43
43
|
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
|
|
44
44
|
});
|
|
45
45
|
module.exports = __toCommonJS(constants_exports);
|
|
46
|
-
const PARA_CORE_VERSION = "2.0.0-alpha.
|
|
46
|
+
const PARA_CORE_VERSION = "2.0.0-alpha.72";
|
|
47
47
|
const PREFIX = "@CAPSULE/";
|
|
48
48
|
const PARA_PREFIX = "@PARA/";
|
|
49
49
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -247,6 +247,20 @@ ${exportedAsBase64}
|
|
|
247
247
|
return decryptedData.shares;
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
+
deleteShares() {
|
|
251
|
+
return __async(this, null, function* () {
|
|
252
|
+
yield this.issueEnclaveJwt();
|
|
253
|
+
const frontendKeyPair = yield this.generateFrontendKeyPair();
|
|
254
|
+
const responsePublicKeyPEM = yield this.exportPublicKeyToPEM(frontendKeyPair.publicKey);
|
|
255
|
+
const payload = {
|
|
256
|
+
responsePublicKey: responsePublicKeyPEM,
|
|
257
|
+
jwt: this.retrieveJwt()
|
|
258
|
+
};
|
|
259
|
+
const encryptedPayload = yield this.encryptForEnclave(JSON.stringify(payload));
|
|
260
|
+
const encryptedPayloadStr = JSON.stringify(encryptedPayload);
|
|
261
|
+
yield this.userManagementClient.deleteEnclaveShares(encryptedPayloadStr);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
250
264
|
retrieveSharesWithRetry(query) {
|
|
251
265
|
return __async(this, null, function* () {
|
|
252
266
|
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
@@ -259,6 +273,13 @@ ${exportedAsBase64}
|
|
|
259
273
|
return yield this.persistShares(shares);
|
|
260
274
|
});
|
|
261
275
|
}
|
|
276
|
+
deleteSharesWithRetry() {
|
|
277
|
+
return __async(this, null, function* () {
|
|
278
|
+
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
279
|
+
return this.deleteShares();
|
|
280
|
+
}));
|
|
281
|
+
});
|
|
282
|
+
}
|
|
262
283
|
}
|
|
263
284
|
// Annotate the CommonJS export names for ESM import in node:
|
|
264
285
|
0 && (module.exports = {
|
package/dist/esm/constants.js
CHANGED
|
@@ -208,6 +208,20 @@ ${exportedAsBase64}
|
|
|
208
208
|
return decryptedData.shares;
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
+
deleteShares() {
|
|
212
|
+
return __async(this, null, function* () {
|
|
213
|
+
yield this.issueEnclaveJwt();
|
|
214
|
+
const frontendKeyPair = yield this.generateFrontendKeyPair();
|
|
215
|
+
const responsePublicKeyPEM = yield this.exportPublicKeyToPEM(frontendKeyPair.publicKey);
|
|
216
|
+
const payload = {
|
|
217
|
+
responsePublicKey: responsePublicKeyPEM,
|
|
218
|
+
jwt: this.retrieveJwt()
|
|
219
|
+
};
|
|
220
|
+
const encryptedPayload = yield this.encryptForEnclave(JSON.stringify(payload));
|
|
221
|
+
const encryptedPayloadStr = JSON.stringify(encryptedPayload);
|
|
222
|
+
yield this.userManagementClient.deleteEnclaveShares(encryptedPayloadStr);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
211
225
|
retrieveSharesWithRetry(query) {
|
|
212
226
|
return __async(this, null, function* () {
|
|
213
227
|
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
@@ -220,6 +234,13 @@ ${exportedAsBase64}
|
|
|
220
234
|
return yield this.persistShares(shares);
|
|
221
235
|
});
|
|
222
236
|
}
|
|
237
|
+
deleteSharesWithRetry() {
|
|
238
|
+
return __async(this, null, function* () {
|
|
239
|
+
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
240
|
+
return this.deleteShares();
|
|
241
|
+
}));
|
|
242
|
+
});
|
|
243
|
+
}
|
|
223
244
|
}
|
|
224
245
|
export {
|
|
225
246
|
EnclaveClient
|
|
@@ -76,6 +76,8 @@ export declare class EnclaveClient {
|
|
|
76
76
|
* @param query Query parameters for finding shares (single query or array of queries)
|
|
77
77
|
*/
|
|
78
78
|
private retrieveShares;
|
|
79
|
+
deleteShares(): Promise<void>;
|
|
79
80
|
retrieveSharesWithRetry(query: ShareQuery[]): Promise<ShareData[]>;
|
|
80
81
|
persistSharesWithRetry(shares: ShareData[]): Promise<any>;
|
|
82
|
+
deleteSharesWithRetry(): Promise<void>;
|
|
81
83
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.72",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@celo/utils": "^8.0.2",
|
|
6
6
|
"@cosmjs/encoding": "^0.32.4",
|
|
7
7
|
"@ethereumjs/util": "^9.1.0",
|
|
8
|
-
"@getpara/user-management-client": "2.0.0-alpha.
|
|
8
|
+
"@getpara/user-management-client": "2.0.0-alpha.72",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"base64url": "^3.0.1",
|
|
11
11
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist",
|
|
28
28
|
"package.json"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "abb7dbb2e789d245750db2206afbb1db10e87ff9",
|
|
31
31
|
"main": "dist/cjs/index.js",
|
|
32
32
|
"module": "dist/esm/index.js",
|
|
33
33
|
"scripts": {
|