@getpara/user-management-client 2.0.0-alpha.66 → 2.0.0-alpha.68
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/client.js +24 -2
- package/dist/esm/client.js +24 -2
- package/dist/types/client.d.ts +16 -3
- package/package.json +3 -3
package/dist/cjs/client.js
CHANGED
|
@@ -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, {
|
|
@@ -508,6 +522,14 @@ class Client {
|
|
|
508
522
|
const res = yield this.baseRequest.post(`/enclave/jwt/refresh`, { encryptedPayload });
|
|
509
523
|
return res.data;
|
|
510
524
|
});
|
|
525
|
+
this.getUserPreferences = (userId) => __async(this, null, function* () {
|
|
526
|
+
const res = yield this.baseRequest.get(`/users/${userId}/preferences`);
|
|
527
|
+
return res.data;
|
|
528
|
+
});
|
|
529
|
+
this.updateUserPreferences = (userId, preferences) => __async(this, null, function* () {
|
|
530
|
+
const res = yield this.baseRequest.patch(`/users/${userId}/preferences`, { preferences });
|
|
531
|
+
return res.data;
|
|
532
|
+
});
|
|
511
533
|
const headers = __spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId });
|
|
512
534
|
const axiosConfig = {
|
|
513
535
|
baseURL: userManagementHost,
|
package/dist/esm/client.js
CHANGED
|
@@ -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, {
|
|
@@ -431,6 +445,14 @@ class Client {
|
|
|
431
445
|
const res = yield this.baseRequest.post(`/enclave/jwt/refresh`, { encryptedPayload });
|
|
432
446
|
return res.data;
|
|
433
447
|
});
|
|
448
|
+
this.getUserPreferences = (userId) => __async(this, null, function* () {
|
|
449
|
+
const res = yield this.baseRequest.get(`/users/${userId}/preferences`);
|
|
450
|
+
return res.data;
|
|
451
|
+
});
|
|
452
|
+
this.updateUserPreferences = (userId, preferences) => __async(this, null, function* () {
|
|
453
|
+
const res = yield this.baseRequest.patch(`/users/${userId}/preferences`, { preferences });
|
|
454
|
+
return res.data;
|
|
455
|
+
});
|
|
434
456
|
const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
|
|
435
457
|
const axiosConfig = {
|
|
436
458
|
baseURL: userManagementHost,
|
package/dist/types/client.d.ts
CHANGED
|
@@ -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>;
|
|
@@ -466,5 +475,9 @@ declare class Client {
|
|
|
466
475
|
refreshEnclaveJwt: (encryptedPayload: string) => Promise<{
|
|
467
476
|
payload: string;
|
|
468
477
|
}>;
|
|
478
|
+
getUserPreferences: (userId: string) => Promise<{
|
|
479
|
+
preferences: UserPreferences;
|
|
480
|
+
}>;
|
|
481
|
+
updateUserPreferences: (userId: string, preferences: Partial<UserPreferences>) => Promise<UserPreferences>;
|
|
469
482
|
}
|
|
470
483
|
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.
|
|
3
|
+
"version": "2.0.0-alpha.68",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/shared": "1.
|
|
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": "
|
|
23
|
+
"gitHead": "98955203281606201609bb4674f5984acb63d3bf",
|
|
24
24
|
"main": "dist/cjs/index.js",
|
|
25
25
|
"module": "dist/esm/index.js",
|
|
26
26
|
"scripts": {
|