@getpara/user-management-client 2.0.0-alpha.67 → 2.0.0-alpha.69

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.
@@ -147,11 +147,15 @@ class Client {
147
147
  });
148
148
  this.loginExternalWallet = (_0) => __async(this, [_0], function* ({
149
149
  externalWallet,
150
- shouldTrackUser
150
+ shouldTrackUser,
151
+ chainId,
152
+ uri
151
153
  }) {
152
154
  const res = yield this.baseRequest.post(`/users/external-wallets/login/v2`, {
153
155
  externalWallet,
154
- shouldTrackUser
156
+ shouldTrackUser,
157
+ chainId,
158
+ uri
155
159
  });
156
160
  return res.data;
157
161
  });
@@ -273,6 +277,11 @@ class Client {
273
277
  const res = yield this.baseRequest.post(`/touch?regenerate=${!!regenerate}`);
274
278
  return res.data;
275
279
  });
280
+ // POST /sessions/portal-verification
281
+ this.sessionAddPortalVerification = () => __async(this, null, function* () {
282
+ const res = yield this.baseRequest.post(`/sessions/portal-verification`);
283
+ return res.data;
284
+ });
276
285
  // GET /sessions/:sessionLookupId/origin
277
286
  this.sessionOrigin = (sessionLookupId) => __async(this, null, function* () {
278
287
  const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
@@ -293,6 +302,11 @@ class Client {
293
302
  const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth`);
294
303
  return res.data;
295
304
  });
305
+ // GET /sessions/:sessionLookupId/siwe-message
306
+ this.sessionSIWEMessage = (sessionLookupId) => __async(this, null, function* () {
307
+ const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/siwe-message`);
308
+ return res.data;
309
+ });
296
310
  // POST /biometrics/verify
297
311
  this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
298
312
  const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
@@ -485,8 +499,11 @@ class Client {
485
499
  * Persist encrypted key shares to the enclave
486
500
  * @param encryptedPayload JSON string containing the encrypted ECIES payload
487
501
  */
488
- this.persistEnclaveShares = (encryptedPayload) => __async(this, null, function* () {
489
- const body = { encryptedPayload };
502
+ this.persistEnclaveShares = (_0) => __async(this, [_0], function* ({
503
+ encryptedPayload,
504
+ hasNoShares
505
+ }) {
506
+ const body = { encryptedPayload, hasNoShares };
490
507
  const res = yield this.baseRequest.post("/enclave/key-shares", body);
491
508
  return res.data;
492
509
  });
@@ -508,6 +525,14 @@ class Client {
508
525
  const res = yield this.baseRequest.post(`/enclave/jwt/refresh`, { encryptedPayload });
509
526
  return res.data;
510
527
  });
528
+ this.getUserPreferences = (userId) => __async(this, null, function* () {
529
+ const res = yield this.baseRequest.get(`/users/${userId}/preferences`);
530
+ return res.data;
531
+ });
532
+ this.updateUserPreferences = (userId, preferences) => __async(this, null, function* () {
533
+ const res = yield this.baseRequest.patch(`/users/${userId}/preferences`, { preferences });
534
+ return res.data;
535
+ });
511
536
  const headers = __spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId });
512
537
  const axiosConfig = {
513
538
  baseURL: userManagementHost,
@@ -70,11 +70,15 @@ class Client {
70
70
  });
71
71
  this.loginExternalWallet = (_0) => __async(this, [_0], function* ({
72
72
  externalWallet,
73
- shouldTrackUser
73
+ shouldTrackUser,
74
+ chainId,
75
+ uri
74
76
  }) {
75
77
  const res = yield this.baseRequest.post(`/users/external-wallets/login/v2`, {
76
78
  externalWallet,
77
- shouldTrackUser
79
+ shouldTrackUser,
80
+ chainId,
81
+ uri
78
82
  });
79
83
  return res.data;
80
84
  });
@@ -196,6 +200,11 @@ class Client {
196
200
  const res = yield this.baseRequest.post(`/touch?regenerate=${!!regenerate}`);
197
201
  return res.data;
198
202
  });
203
+ // POST /sessions/portal-verification
204
+ this.sessionAddPortalVerification = () => __async(this, null, function* () {
205
+ const res = yield this.baseRequest.post(`/sessions/portal-verification`);
206
+ return res.data;
207
+ });
199
208
  // GET /sessions/:sessionLookupId/origin
200
209
  this.sessionOrigin = (sessionLookupId) => __async(this, null, function* () {
201
210
  const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
@@ -216,6 +225,11 @@ class Client {
216
225
  const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth`);
217
226
  return res.data;
218
227
  });
228
+ // GET /sessions/:sessionLookupId/siwe-message
229
+ this.sessionSIWEMessage = (sessionLookupId) => __async(this, null, function* () {
230
+ const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/siwe-message`);
231
+ return res.data;
232
+ });
219
233
  // POST /biometrics/verify
220
234
  this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
221
235
  const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
@@ -408,8 +422,11 @@ class Client {
408
422
  * Persist encrypted key shares to the enclave
409
423
  * @param encryptedPayload JSON string containing the encrypted ECIES payload
410
424
  */
411
- this.persistEnclaveShares = (encryptedPayload) => __async(this, null, function* () {
412
- const body = { encryptedPayload };
425
+ this.persistEnclaveShares = (_0) => __async(this, [_0], function* ({
426
+ encryptedPayload,
427
+ hasNoShares
428
+ }) {
429
+ const body = { encryptedPayload, hasNoShares };
413
430
  const res = yield this.baseRequest.post("/enclave/key-shares", body);
414
431
  return res.data;
415
432
  });
@@ -431,6 +448,14 @@ class Client {
431
448
  const res = yield this.baseRequest.post(`/enclave/jwt/refresh`, { encryptedPayload });
432
449
  return res.data;
433
450
  });
451
+ this.getUserPreferences = (userId) => __async(this, null, function* () {
452
+ const res = yield this.baseRequest.get(`/users/${userId}/preferences`);
453
+ return res.data;
454
+ });
455
+ this.updateUserPreferences = (userId, preferences) => __async(this, null, function* () {
456
+ const res = yield this.baseRequest.patch(`/users/${userId}/preferences`, { preferences });
457
+ return res.data;
458
+ });
434
459
  const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
435
460
  const axiosConfig = {
436
461
  baseURL: userManagementHost,
@@ -1,5 +1,5 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, AuthMethodStatus, PregenIds, PrimaryAuth, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse, LinkAccountParams, LinkedAccounts, ResendVerificationCodeParams, AssetMetadataIndexed, GetProfileBalanceParams, ProfileBalance, LegacyAuthMethod, PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateDone } from '@getpara/shared';
2
+ import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, AuthMethodStatus, PregenIds, PrimaryAuth, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse, LinkAccountParams, LinkedAccounts, ResendVerificationCodeParams, AssetMetadataIndexed, GetProfileBalanceParams, ProfileBalance, LegacyAuthMethod, PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateDone, UserPreferences } from '@getpara/shared';
3
3
  interface ConfigOpts {
4
4
  useFetchAdapter?: boolean;
5
5
  }
@@ -156,9 +156,11 @@ declare class Client {
156
156
  sessionLookupId?: string;
157
157
  }) => Promise<VerifyTelegramResponse>;
158
158
  verifyOAuth: () => Promise<VerifyThirdPartyAuth | null>;
159
- loginExternalWallet: ({ externalWallet, shouldTrackUser, }: {
159
+ loginExternalWallet: ({ externalWallet, shouldTrackUser, chainId, uri, }: {
160
160
  externalWallet: ExternalWalletInfo;
161
161
  shouldTrackUser?: boolean;
162
+ chainId?: string;
163
+ uri?: string;
162
164
  }) => Promise<LoginExternalWalletResponse>;
163
165
  verifyAccount: (userId: string, body: verifyBody) => Promise<ServerAuthStateSignup | ServerAuthStateLogin | ServerAuthStateDone>;
164
166
  sendLoginVerificationCode: (auth: PrimaryAuthInfo, isRecovery?: boolean) => Promise<{
@@ -200,7 +202,7 @@ declare class Client {
200
202
  * @deprecated
201
203
  */
202
204
  verifyPhone: (userId: string, body: verifyBody) => Promise<any>;
203
- verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup | ServerAuthStateLogin>;
205
+ verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup | ServerAuthStateLogin | ServerAuthStateDone>;
204
206
  addSessionPublicKey: (userId: string, body: sessionPublicKeyBody) => Promise<any>;
205
207
  getSessionPublicKeys: (userId: string) => Promise<any>;
206
208
  getBiometricLocationHints: (auth: PrimaryAuth) => Promise<BiometricLocationHint[]>;
@@ -208,6 +210,9 @@ declare class Client {
208
210
  patchSessionPublicKey: (partnerId: string, userId: string, biometricId: string, body: sessionPublicKeyBody) => Promise<any>;
209
211
  getWebChallenge: (auth?: PrimaryAuth | Auth<"userId">) => Promise<getWebChallengeRes>;
210
212
  touchSession: (regenerate?: boolean) => Promise<SessionInfo>;
213
+ sessionAddPortalVerification: () => Promise<{
214
+ success: boolean;
215
+ }>;
211
216
  sessionOrigin: (sessionLookupId: string) => Promise<{
212
217
  origin?: string;
213
218
  }>;
@@ -226,6 +231,10 @@ declare class Client {
226
231
  auth: PrimaryAuth;
227
232
  isNewUser: boolean;
228
233
  }>;
234
+ sessionSIWEMessage: (sessionLookupId: string) => Promise<{
235
+ message?: string;
236
+ code?: string;
237
+ }>;
229
238
  verifyWebChallenge: (partnerId: string, body: verifyWebChallengeBody) => Promise<any>;
230
239
  getSessionChallenge: (userId: string) => Promise<any>;
231
240
  verifySessionChallenge: (userId: string, body: verifySessionChallengeBody) => Promise<any>;
@@ -450,7 +459,10 @@ declare class Client {
450
459
  * Persist encrypted key shares to the enclave
451
460
  * @param encryptedPayload JSON string containing the encrypted ECIES payload
452
461
  */
453
- persistEnclaveShares: (encryptedPayload: string) => Promise<{
462
+ persistEnclaveShares: ({ encryptedPayload, hasNoShares, }: {
463
+ encryptedPayload?: string;
464
+ hasNoShares?: boolean;
465
+ }) => Promise<{
454
466
  payload: any;
455
467
  }>;
456
468
  /**
@@ -466,5 +478,9 @@ declare class Client {
466
478
  refreshEnclaveJwt: (encryptedPayload: string) => Promise<{
467
479
  payload: string;
468
480
  }>;
481
+ getUserPreferences: (userId: string) => Promise<{
482
+ preferences: UserPreferences;
483
+ }>;
484
+ updateUserPreferences: (userId: string, preferences: Partial<UserPreferences>) => Promise<UserPreferences>;
469
485
  }
470
486
  export default Client;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@getpara/user-management-client",
3
- "version": "2.0.0-alpha.67",
3
+ "version": "2.0.0-alpha.69",
4
4
  "dependencies": {
5
- "@getpara/shared": "1.4.0",
5
+ "@getpara/shared": "1.5.0",
6
6
  "axios": "^1.8.4",
7
7
  "libphonenumber-js": "^1.11.7"
8
8
  },
@@ -20,7 +20,7 @@
20
20
  "dist",
21
21
  "package.json"
22
22
  ],
23
- "gitHead": "0266cc49e978575fed0b12c9bb0c832651e140eb",
23
+ "gitHead": "956310e0ff58cc8e2736625d221245ab68304855",
24
24
  "main": "dist/cjs/index.js",
25
25
  "module": "dist/esm/index.js",
26
26
  "scripts": {