@getpara/user-management-client 2.0.0-alpha.39 → 2.0.0-alpha.41
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 +29 -5
- package/dist/cjs/types/auth.js +8 -0
- package/dist/esm/client.js +29 -5
- package/dist/esm/types/auth.js +7 -0
- package/dist/types/client.d.ts +20 -5
- package/dist/types/types/auth.d.ts +8 -1
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -151,10 +151,15 @@ class Client {
|
|
|
151
151
|
});
|
|
152
152
|
return res.data;
|
|
153
153
|
});
|
|
154
|
-
this.
|
|
154
|
+
this.verifyAccount = (userId, body) => __async(this, null, function* () {
|
|
155
155
|
const res = yield this.baseRequest.post(`/users/${userId}/verify`, body);
|
|
156
156
|
return res.data;
|
|
157
157
|
});
|
|
158
|
+
// POST /users/send-login-code
|
|
159
|
+
this.sendLoginVerificationCode = (auth, isRecovery) => __async(this, null, function* () {
|
|
160
|
+
const res = yield this.baseRequest.post(`/users/send-login-code`, __spreadProps(__spreadValues({}, auth), { isRecovery }));
|
|
161
|
+
return res.data;
|
|
162
|
+
});
|
|
158
163
|
this.getLinkedAccounts = (_0) => __async(this, [_0], function* ({
|
|
159
164
|
userId,
|
|
160
165
|
withMetadata = false
|
|
@@ -212,7 +217,10 @@ class Client {
|
|
|
212
217
|
return res;
|
|
213
218
|
});
|
|
214
219
|
this.verifyExternalWallet = (userId, body) => __async(this, null, function* () {
|
|
215
|
-
const res = yield this.baseRequest.post(
|
|
220
|
+
const res = yield this.baseRequest.post(
|
|
221
|
+
`/users/${userId}/external-wallets/verify/v2`,
|
|
222
|
+
body
|
|
223
|
+
);
|
|
216
224
|
return res.data;
|
|
217
225
|
});
|
|
218
226
|
// POST /users/:userId/biometrics/key
|
|
@@ -258,11 +266,16 @@ class Client {
|
|
|
258
266
|
const res = yield this.baseRequest.post(`/touch?regenerate=${!!regenerate}`);
|
|
259
267
|
return res.data;
|
|
260
268
|
});
|
|
261
|
-
// GET /
|
|
269
|
+
// GET /sessions/:sessionLookupId/origin
|
|
262
270
|
this.sessionOrigin = (sessionLookupId) => __async(this, null, function* () {
|
|
263
271
|
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
|
|
264
272
|
return res.data;
|
|
265
273
|
});
|
|
274
|
+
// GET /sessions/:sessionLookupId/auth-verified
|
|
275
|
+
this.sessionAuthVerified = (sessionLookupId) => __async(this, null, function* () {
|
|
276
|
+
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth-verified`);
|
|
277
|
+
return res.data;
|
|
278
|
+
});
|
|
266
279
|
// POST /biometrics/verify
|
|
267
280
|
this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
|
|
268
281
|
const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
|
|
@@ -911,6 +924,17 @@ class Client {
|
|
|
911
924
|
return res.data;
|
|
912
925
|
});
|
|
913
926
|
}
|
|
927
|
+
getSupportedAuthMethodsV2(auth) {
|
|
928
|
+
return __async(this, null, function* () {
|
|
929
|
+
const res = yield this.baseRequest.get(
|
|
930
|
+
"/users/supported-auth-methods/v2",
|
|
931
|
+
{
|
|
932
|
+
params: __spreadValues({}, auth)
|
|
933
|
+
}
|
|
934
|
+
);
|
|
935
|
+
return res.data;
|
|
936
|
+
});
|
|
937
|
+
}
|
|
914
938
|
getPasswords(auth) {
|
|
915
939
|
return __async(this, null, function* () {
|
|
916
940
|
const res = yield this.baseRequest.get("/users/passwords", {
|
|
@@ -930,9 +954,9 @@ class Client {
|
|
|
930
954
|
return res;
|
|
931
955
|
});
|
|
932
956
|
}
|
|
933
|
-
getEncryptedWalletPrivateKey(passwordId) {
|
|
957
|
+
getEncryptedWalletPrivateKey(passwordId, sessionLookupId) {
|
|
934
958
|
return __async(this, null, function* () {
|
|
935
|
-
const query = new URLSearchParams({ passwordId }).toString();
|
|
959
|
+
const query = new URLSearchParams({ passwordId, sessionLookupId }).toString();
|
|
936
960
|
const res = yield this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
|
|
937
961
|
return res;
|
|
938
962
|
});
|
package/dist/cjs/types/auth.js
CHANGED
|
@@ -22,6 +22,7 @@ __export(auth_exports, {
|
|
|
22
22
|
EncryptorType: () => EncryptorType,
|
|
23
23
|
KeyShareType: () => KeyShareType,
|
|
24
24
|
LINKED_ACCOUNT_TYPES: () => LINKED_ACCOUNT_TYPES,
|
|
25
|
+
LegacyAuthMethod: () => LegacyAuthMethod,
|
|
25
26
|
OAUTH_METHODS: () => OAUTH_METHODS,
|
|
26
27
|
OAuthMethod: () => OAuthMethod,
|
|
27
28
|
PasswordStatus: () => PasswordStatus,
|
|
@@ -95,8 +96,14 @@ const LINKED_ACCOUNT_TYPES = [
|
|
|
95
96
|
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
96
97
|
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
97
98
|
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
99
|
+
AuthMethod2["PIN"] = "PIN";
|
|
98
100
|
return AuthMethod2;
|
|
99
101
|
})(AuthMethod || {});
|
|
102
|
+
var LegacyAuthMethod = /* @__PURE__ */ ((LegacyAuthMethod2) => {
|
|
103
|
+
LegacyAuthMethod2["PASSWORD"] = "PASSWORD";
|
|
104
|
+
LegacyAuthMethod2["BIOMETRIC"] = "BIOMETRIC";
|
|
105
|
+
return LegacyAuthMethod2;
|
|
106
|
+
})(LegacyAuthMethod || {});
|
|
100
107
|
// Annotate the CommonJS export names for ESM import in node:
|
|
101
108
|
0 && (module.exports = {
|
|
102
109
|
AUTH_TYPES,
|
|
@@ -104,6 +111,7 @@ var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
|
104
111
|
EncryptorType,
|
|
105
112
|
KeyShareType,
|
|
106
113
|
LINKED_ACCOUNT_TYPES,
|
|
114
|
+
LegacyAuthMethod,
|
|
107
115
|
OAUTH_METHODS,
|
|
108
116
|
OAuthMethod,
|
|
109
117
|
PasswordStatus,
|
package/dist/esm/client.js
CHANGED
|
@@ -74,10 +74,15 @@ class Client {
|
|
|
74
74
|
});
|
|
75
75
|
return res.data;
|
|
76
76
|
});
|
|
77
|
-
this.
|
|
77
|
+
this.verifyAccount = (userId, body) => __async(this, null, function* () {
|
|
78
78
|
const res = yield this.baseRequest.post(`/users/${userId}/verify`, body);
|
|
79
79
|
return res.data;
|
|
80
80
|
});
|
|
81
|
+
// POST /users/send-login-code
|
|
82
|
+
this.sendLoginVerificationCode = (auth, isRecovery) => __async(this, null, function* () {
|
|
83
|
+
const res = yield this.baseRequest.post(`/users/send-login-code`, __spreadProps(__spreadValues({}, auth), { isRecovery }));
|
|
84
|
+
return res.data;
|
|
85
|
+
});
|
|
81
86
|
this.getLinkedAccounts = (_0) => __async(this, [_0], function* ({
|
|
82
87
|
userId,
|
|
83
88
|
withMetadata = false
|
|
@@ -135,7 +140,10 @@ class Client {
|
|
|
135
140
|
return res;
|
|
136
141
|
});
|
|
137
142
|
this.verifyExternalWallet = (userId, body) => __async(this, null, function* () {
|
|
138
|
-
const res = yield this.baseRequest.post(
|
|
143
|
+
const res = yield this.baseRequest.post(
|
|
144
|
+
`/users/${userId}/external-wallets/verify/v2`,
|
|
145
|
+
body
|
|
146
|
+
);
|
|
139
147
|
return res.data;
|
|
140
148
|
});
|
|
141
149
|
// POST /users/:userId/biometrics/key
|
|
@@ -181,11 +189,16 @@ class Client {
|
|
|
181
189
|
const res = yield this.baseRequest.post(`/touch?regenerate=${!!regenerate}`);
|
|
182
190
|
return res.data;
|
|
183
191
|
});
|
|
184
|
-
// GET /
|
|
192
|
+
// GET /sessions/:sessionLookupId/origin
|
|
185
193
|
this.sessionOrigin = (sessionLookupId) => __async(this, null, function* () {
|
|
186
194
|
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
|
|
187
195
|
return res.data;
|
|
188
196
|
});
|
|
197
|
+
// GET /sessions/:sessionLookupId/auth-verified
|
|
198
|
+
this.sessionAuthVerified = (sessionLookupId) => __async(this, null, function* () {
|
|
199
|
+
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth-verified`);
|
|
200
|
+
return res.data;
|
|
201
|
+
});
|
|
189
202
|
// POST /biometrics/verify
|
|
190
203
|
this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
|
|
191
204
|
const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
|
|
@@ -834,6 +847,17 @@ class Client {
|
|
|
834
847
|
return res.data;
|
|
835
848
|
});
|
|
836
849
|
}
|
|
850
|
+
getSupportedAuthMethodsV2(auth) {
|
|
851
|
+
return __async(this, null, function* () {
|
|
852
|
+
const res = yield this.baseRequest.get(
|
|
853
|
+
"/users/supported-auth-methods/v2",
|
|
854
|
+
{
|
|
855
|
+
params: __spreadValues({}, auth)
|
|
856
|
+
}
|
|
857
|
+
);
|
|
858
|
+
return res.data;
|
|
859
|
+
});
|
|
860
|
+
}
|
|
837
861
|
getPasswords(auth) {
|
|
838
862
|
return __async(this, null, function* () {
|
|
839
863
|
const res = yield this.baseRequest.get("/users/passwords", {
|
|
@@ -853,9 +877,9 @@ class Client {
|
|
|
853
877
|
return res;
|
|
854
878
|
});
|
|
855
879
|
}
|
|
856
|
-
getEncryptedWalletPrivateKey(passwordId) {
|
|
880
|
+
getEncryptedWalletPrivateKey(passwordId, sessionLookupId) {
|
|
857
881
|
return __async(this, null, function* () {
|
|
858
|
-
const query = new URLSearchParams({ passwordId }).toString();
|
|
882
|
+
const query = new URLSearchParams({ passwordId, sessionLookupId }).toString();
|
|
859
883
|
const res = yield this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
|
|
860
884
|
return res;
|
|
861
885
|
});
|
package/dist/esm/types/auth.js
CHANGED
|
@@ -65,14 +65,21 @@ const LINKED_ACCOUNT_TYPES = [
|
|
|
65
65
|
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
66
66
|
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
67
67
|
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
68
|
+
AuthMethod2["PIN"] = "PIN";
|
|
68
69
|
return AuthMethod2;
|
|
69
70
|
})(AuthMethod || {});
|
|
71
|
+
var LegacyAuthMethod = /* @__PURE__ */ ((LegacyAuthMethod2) => {
|
|
72
|
+
LegacyAuthMethod2["PASSWORD"] = "PASSWORD";
|
|
73
|
+
LegacyAuthMethod2["BIOMETRIC"] = "BIOMETRIC";
|
|
74
|
+
return LegacyAuthMethod2;
|
|
75
|
+
})(LegacyAuthMethod || {});
|
|
70
76
|
export {
|
|
71
77
|
AUTH_TYPES,
|
|
72
78
|
AuthMethod,
|
|
73
79
|
EncryptorType,
|
|
74
80
|
KeyShareType,
|
|
75
81
|
LINKED_ACCOUNT_TYPES,
|
|
82
|
+
LegacyAuthMethod,
|
|
76
83
|
OAUTH_METHODS,
|
|
77
84
|
OAuthMethod,
|
|
78
85
|
PasswordStatus,
|
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, PasswordStatus, PregenIds, PrimaryAuth, PublicKeyStatus, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse, LinkAccountParams, LinkedAccounts, ResendVerificationCodeParams } from './types/index.js';
|
|
2
|
+
import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, PasswordStatus, PregenIds, PrimaryAuth, PublicKeyStatus, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse, LinkAccountParams, LinkedAccounts, ResendVerificationCodeParams, LegacyAuthMethod, PrimaryAuthInfo, ServerAuthStateLogin } from './types/index.js';
|
|
3
3
|
interface ConfigOpts {
|
|
4
4
|
useFetchAdapter?: boolean;
|
|
5
5
|
}
|
|
@@ -18,6 +18,7 @@ interface createUserIdRes {
|
|
|
18
18
|
}
|
|
19
19
|
interface verifyBody {
|
|
20
20
|
verificationCode: string;
|
|
21
|
+
sessionLookupId?: string;
|
|
21
22
|
}
|
|
22
23
|
interface getWebChallengeRes {
|
|
23
24
|
challenge: string;
|
|
@@ -67,6 +68,7 @@ interface PasswordEntity {
|
|
|
67
68
|
status: PasswordStatus;
|
|
68
69
|
sigDerivedPublicKey: string;
|
|
69
70
|
salt: string;
|
|
71
|
+
isPIN?: boolean;
|
|
70
72
|
}
|
|
71
73
|
interface createWalletBody {
|
|
72
74
|
useTwoSigners?: boolean;
|
|
@@ -117,6 +119,7 @@ interface sessionPasswordBody {
|
|
|
117
119
|
salt?: string;
|
|
118
120
|
encryptedWalletPrivateKey?: string;
|
|
119
121
|
encryptionKeyHash?: string;
|
|
122
|
+
isPIN?: boolean;
|
|
120
123
|
}
|
|
121
124
|
interface EncryptedWalletPrivateKey {
|
|
122
125
|
id: string;
|
|
@@ -154,7 +157,10 @@ declare class Client {
|
|
|
154
157
|
externalWallet: ExternalWalletInfo;
|
|
155
158
|
shouldTrackUser?: boolean;
|
|
156
159
|
}) => Promise<LoginExternalWalletResponse>;
|
|
157
|
-
|
|
160
|
+
verifyAccount: (userId: string, body: verifyBody) => Promise<ServerAuthStateSignup | ServerAuthStateLogin>;
|
|
161
|
+
sendLoginVerificationCode: (auth: PrimaryAuthInfo, isRecovery?: boolean) => Promise<{
|
|
162
|
+
userId: string;
|
|
163
|
+
}>;
|
|
158
164
|
getLinkedAccounts: ({ userId, withMetadata, }: {
|
|
159
165
|
userId: string;
|
|
160
166
|
withMetadata?: boolean;
|
|
@@ -191,7 +197,7 @@ declare class Client {
|
|
|
191
197
|
* @deprecated
|
|
192
198
|
*/
|
|
193
199
|
verifyPhone: (userId: string, body: verifyBody) => Promise<any>;
|
|
194
|
-
verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup>;
|
|
200
|
+
verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup | ServerAuthStateLogin>;
|
|
195
201
|
addSessionPublicKey: (userId: string, body: sessionPublicKeyBody) => Promise<any>;
|
|
196
202
|
getSessionPublicKeys: (userId: string) => Promise<any>;
|
|
197
203
|
getBiometricLocationHints: (auth: PrimaryAuth) => Promise<BiometricLocationHint[]>;
|
|
@@ -202,6 +208,9 @@ declare class Client {
|
|
|
202
208
|
sessionOrigin: (sessionLookupId: string) => Promise<{
|
|
203
209
|
origin?: string;
|
|
204
210
|
}>;
|
|
211
|
+
sessionAuthVerified: (sessionLookupId: string) => Promise<{
|
|
212
|
+
authVerified?: boolean;
|
|
213
|
+
}>;
|
|
205
214
|
verifyWebChallenge: (partnerId: string, body: verifyWebChallengeBody) => Promise<any>;
|
|
206
215
|
getSessionChallenge: (userId: string) => Promise<any>;
|
|
207
216
|
verifySessionChallenge: (userId: string, body: verifySessionChallengeBody) => Promise<any>;
|
|
@@ -370,10 +379,16 @@ declare class Client {
|
|
|
370
379
|
deletePendingTransaction(userId: string, pendingTransactionId: string): Promise<any>;
|
|
371
380
|
addSessionPasswordPublicKey(userId: string, body: sessionPasswordBody): Promise<any>;
|
|
372
381
|
patchSessionPassword: (partnerId: string, userId: string, passwordId: string, body: sessionPasswordBody) => Promise<any>;
|
|
373
|
-
getSupportedAuthMethods(auth: Auth): Promise<
|
|
382
|
+
getSupportedAuthMethods(auth: Auth): Promise<{
|
|
383
|
+
supportedAuthMethods: LegacyAuthMethod[];
|
|
384
|
+
}>;
|
|
385
|
+
getSupportedAuthMethodsV2(auth: Auth): Promise<{
|
|
386
|
+
supportedAuthMethods: AuthMethod[];
|
|
387
|
+
hasPasswordWithoutPIN: boolean;
|
|
388
|
+
}>;
|
|
374
389
|
getPasswords(auth: Auth): Promise<PasswordEntity[]>;
|
|
375
390
|
verifyPasswordChallenge(partnerId: string, body: verifyPasswordChallengeBody): Promise<any>;
|
|
376
|
-
getEncryptedWalletPrivateKey(passwordId: string): Promise<{
|
|
391
|
+
getEncryptedWalletPrivateKey(passwordId: string, sessionLookupId: string): Promise<{
|
|
377
392
|
data: {
|
|
378
393
|
encryptedWalletPrivateKey: EncryptedWalletPrivateKey;
|
|
379
394
|
};
|
|
@@ -117,7 +117,12 @@ export type TLinkedAccountType = (typeof LINKED_ACCOUNT_TYPES)[number] | 'EXTERN
|
|
|
117
117
|
export type SupportedAccountLinks = (TLinkedAccountType | TExternalWallet)[];
|
|
118
118
|
export declare enum AuthMethod {
|
|
119
119
|
PASSWORD = "PASSWORD",
|
|
120
|
-
PASSKEY = "PASSKEY"
|
|
120
|
+
PASSKEY = "PASSKEY",
|
|
121
|
+
PIN = "PIN"
|
|
122
|
+
}
|
|
123
|
+
export declare enum LegacyAuthMethod {
|
|
124
|
+
PASSWORD = "PASSWORD",
|
|
125
|
+
BIOMETRIC = "BIOMETRIC"
|
|
121
126
|
}
|
|
122
127
|
export type BiometricLocationHint = {
|
|
123
128
|
useragent?: string;
|
|
@@ -164,6 +169,8 @@ export type ServerAuthStateLogin = ServerAuthStateBase & {
|
|
|
164
169
|
biometricHints?: BiometricLocationHint[];
|
|
165
170
|
loginAuthMethods: AuthMethod[];
|
|
166
171
|
isWalletSelectionNeeded?: boolean;
|
|
172
|
+
hasPasswordWithoutPIN?: boolean;
|
|
173
|
+
signatureVerificationMessage?: string;
|
|
167
174
|
};
|
|
168
175
|
export type VerifyThirdPartyAuth = ServerAuthStateSignup | ServerAuthStateLogin;
|
|
169
176
|
export type ExternalWalletInfo = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.41",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"axios": "^1.8.4",
|
|
6
6
|
"libphonenumber-js": "^1.11.7"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dist",
|
|
20
20
|
"package.json"
|
|
21
21
|
],
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "1d153152b648828e13bed611ad479d48247642d1",
|
|
23
23
|
"main": "dist/cjs/index.js",
|
|
24
24
|
"module": "dist/esm/index.js",
|
|
25
25
|
"scripts": {
|