@getpara/user-management-client 2.19.0 → 2.21.0

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.
@@ -514,6 +514,21 @@ class Client {
514
514
  const res = yield this.baseRequest.post("/enclave/key-shares", body);
515
515
  return res.data;
516
516
  });
517
+ /**
518
+ * Migrate a wallet share by sending an ECIES-encrypted payload to the backend
519
+ * @param walletId The wallet whose share is being migrated
520
+ * @param encryptedPayload JSON string containing the encrypted ECIES payload
521
+ */
522
+ this.migrateWalletShare = (walletId, encryptedPayload, secretApiKey) => __async(this, null, function* () {
523
+ const res = yield this.baseRequest.post(
524
+ `/v1/wallets/${walletId}/migrate-share`,
525
+ { encryptedPayload },
526
+ // X-API-Key: consumed by restKeyHeaderAdapter for secret key auth.
527
+ // Null out X-External-API-Key to prevent the default non-secret key from leaking.
528
+ { headers: { "X-API-Key": secretApiKey, [import_consts.API_KEY_HEADER_NAME]: null } }
529
+ );
530
+ return res.data;
531
+ });
517
532
  /**
518
533
  * Retrieve encrypted key shares from the enclave
519
534
  * @param encryptedPayload JSON string containing the encrypted ECIES query
@@ -442,6 +442,21 @@ class Client {
442
442
  const res = yield this.baseRequest.post("/enclave/key-shares", body);
443
443
  return res.data;
444
444
  });
445
+ /**
446
+ * Migrate a wallet share by sending an ECIES-encrypted payload to the backend
447
+ * @param walletId The wallet whose share is being migrated
448
+ * @param encryptedPayload JSON string containing the encrypted ECIES payload
449
+ */
450
+ this.migrateWalletShare = (walletId, encryptedPayload, secretApiKey) => __async(this, null, function* () {
451
+ const res = yield this.baseRequest.post(
452
+ `/v1/wallets/${walletId}/migrate-share`,
453
+ { encryptedPayload },
454
+ // X-API-Key: consumed by restKeyHeaderAdapter for secret key auth.
455
+ // Null out X-External-API-Key to prevent the default non-secret key from leaking.
456
+ { headers: { "X-API-Key": secretApiKey, [API_KEY_HEADER_NAME]: null } }
457
+ );
458
+ return res.data;
459
+ });
445
460
  /**
446
461
  * Retrieve encrypted key shares from the enclave
447
462
  * @param encryptedPayload JSON string containing the encrypted ECIES query
@@ -472,6 +472,12 @@ declare class Client {
472
472
  }) => Promise<{
473
473
  payload: any;
474
474
  }>;
475
+ /**
476
+ * Migrate a wallet share by sending an ECIES-encrypted payload to the backend
477
+ * @param walletId The wallet whose share is being migrated
478
+ * @param encryptedPayload JSON string containing the encrypted ECIES payload
479
+ */
480
+ migrateWalletShare: (walletId: string, encryptedPayload: string, secretApiKey: string) => Promise<any>;
475
481
  /**
476
482
  * Retrieve encrypted key shares from the enclave
477
483
  * @param encryptedPayload JSON string containing the encrypted ECIES query
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@getpara/user-management-client",
3
- "version": "2.19.0",
3
+ "version": "2.21.0",
4
4
  "dependencies": {
5
- "@getpara/shared": "^1.12.0",
5
+ "@getpara/shared": "^1.14.0",
6
6
  "axios": "^1.8.4",
7
7
  "axios-retry": "^4.5.0",
8
8
  "libphonenumber-js": "^1.11.7"
@@ -21,7 +21,7 @@
21
21
  "dist",
22
22
  "package.json"
23
23
  ],
24
- "gitHead": "7dc9400777adb653c0cc28e0d9236424eb384467",
24
+ "gitHead": "61f68bb1344dcec458f9016db39f631bb630b8f4",
25
25
  "main": "dist/cjs/index.js",
26
26
  "module": "dist/esm/index.js",
27
27
  "scripts": {