@getpara/user-management-client 2.0.0-alpha.7 → 2.0.0-alpha.70
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 +201 -34
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/utils.js +12 -0
- package/dist/esm/client.js +202 -35
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils.js +11 -0
- package/dist/types/client.d.ts +152 -19
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils.d.ts +2 -3
- package/package.json +22 -21
- package/dist/cjs/types/auth.js +0 -98
- package/dist/cjs/types/email.js +0 -31
- package/dist/cjs/types/index.js +0 -29
- package/dist/cjs/types/onRamp.js +0 -62
- package/dist/cjs/types/partner.js +0 -15
- package/dist/cjs/types/wallet.js +0 -85
- package/dist/esm/types/auth.js +0 -68
- package/dist/esm/types/email.js +0 -9
- package/dist/esm/types/index.js +0 -5
- package/dist/esm/types/onRamp.js +0 -37
- package/dist/esm/types/partner.js +0 -0
- package/dist/esm/types/wallet.js +0 -56
- package/dist/types/types/auth.d.ts +0 -215
- package/dist/types/types/email.d.ts +0 -22
- package/dist/types/types/index.d.ts +0 -5
- package/dist/types/types/onRamp.d.ts +0 -68
- package/dist/types/types/partner.d.ts +0 -20
- package/dist/types/types/wallet.d.ts +0 -73
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,
|
|
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
|
}
|
|
@@ -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;
|
|
@@ -26,7 +27,7 @@ interface getWebChallengeRes {
|
|
|
26
27
|
interface sessionPublicKeyBody {
|
|
27
28
|
publicKey?: string;
|
|
28
29
|
sigDerivedPublicKey?: string;
|
|
29
|
-
status?:
|
|
30
|
+
status?: AuthMethodStatus;
|
|
30
31
|
type?: PublicKeyType;
|
|
31
32
|
cosePublicKey?: string;
|
|
32
33
|
clientDataJSON?: string;
|
|
@@ -64,9 +65,10 @@ interface GetWalletsRes {
|
|
|
64
65
|
interface PasswordEntity {
|
|
65
66
|
id: string;
|
|
66
67
|
userId: string;
|
|
67
|
-
status:
|
|
68
|
+
status: AuthMethodStatus;
|
|
68
69
|
sigDerivedPublicKey: string;
|
|
69
70
|
salt: string;
|
|
71
|
+
isPIN?: boolean;
|
|
70
72
|
}
|
|
71
73
|
interface createWalletBody {
|
|
72
74
|
useTwoSigners?: boolean;
|
|
@@ -99,22 +101,33 @@ interface claimPreGenWalletsBody {
|
|
|
99
101
|
interface signTransactionBody {
|
|
100
102
|
transaction: string;
|
|
101
103
|
chainId: string;
|
|
104
|
+
protocolId?: string;
|
|
102
105
|
}
|
|
103
106
|
interface sendTransactionBody {
|
|
104
107
|
transaction: string;
|
|
105
108
|
chain?: Chain;
|
|
106
109
|
chainId?: string;
|
|
110
|
+
protocolId?: string;
|
|
107
111
|
}
|
|
108
112
|
interface AcceptScopesBody {
|
|
109
113
|
scopeIds: string[];
|
|
110
114
|
partnerId: string;
|
|
111
115
|
}
|
|
112
116
|
interface sessionPasswordBody {
|
|
113
|
-
status?:
|
|
117
|
+
status?: AuthMethodStatus;
|
|
114
118
|
sigDerivedPublicKey?: string;
|
|
115
119
|
salt?: string;
|
|
116
120
|
encryptedWalletPrivateKey?: string;
|
|
117
121
|
encryptionKeyHash?: string;
|
|
122
|
+
isPIN?: boolean;
|
|
123
|
+
}
|
|
124
|
+
interface EncryptedWalletPrivateKey {
|
|
125
|
+
id: string;
|
|
126
|
+
userId: string;
|
|
127
|
+
encryptedPrivateKey: string;
|
|
128
|
+
encryptionKeyHash: string;
|
|
129
|
+
biometricPublicKey?: string;
|
|
130
|
+
passwordId?: string;
|
|
118
131
|
}
|
|
119
132
|
export type SDKType = 'WEB' | 'SERVER' | 'BRIDGE' | 'REACT_NATIVE';
|
|
120
133
|
export type VerifyTelegramRes = {
|
|
@@ -138,13 +151,49 @@ declare class Client {
|
|
|
138
151
|
*/
|
|
139
152
|
createUser: (body: VerifiedAuth & VerificationEmailProps) => Promise<createUserIdRes>;
|
|
140
153
|
checkUserExists: (auth: VerifiedAuth) => Promise<any>;
|
|
141
|
-
verifyTelegram: (authObject
|
|
154
|
+
verifyTelegram: ({ authObject, sessionLookupId, }: {
|
|
155
|
+
authObject: TelegramAuthResponse;
|
|
156
|
+
sessionLookupId?: string;
|
|
157
|
+
}) => Promise<VerifyTelegramResponse>;
|
|
142
158
|
verifyOAuth: () => Promise<VerifyThirdPartyAuth | null>;
|
|
143
|
-
loginExternalWallet: ({ externalWallet, shouldTrackUser, }: {
|
|
159
|
+
loginExternalWallet: ({ externalWallet, shouldTrackUser, chainId, uri, }: {
|
|
144
160
|
externalWallet: ExternalWalletInfo;
|
|
145
161
|
shouldTrackUser?: boolean;
|
|
162
|
+
chainId?: string;
|
|
163
|
+
uri?: string;
|
|
146
164
|
}) => Promise<LoginExternalWalletResponse>;
|
|
147
|
-
|
|
165
|
+
verifyAccount: (userId: string, body: verifyBody) => Promise<ServerAuthStateSignup | ServerAuthStateLogin | ServerAuthStateDone>;
|
|
166
|
+
sendLoginVerificationCode: (auth: PrimaryAuthInfo, isRecovery?: boolean) => Promise<{
|
|
167
|
+
userId: string;
|
|
168
|
+
}>;
|
|
169
|
+
getLinkedAccounts: ({ userId, withMetadata, }: {
|
|
170
|
+
userId: string;
|
|
171
|
+
withMetadata?: boolean;
|
|
172
|
+
}) => Promise<{
|
|
173
|
+
accounts: LinkedAccounts;
|
|
174
|
+
}>;
|
|
175
|
+
linkAccount: ({ userId, ...opts }: LinkAccountParams & {
|
|
176
|
+
userId: string;
|
|
177
|
+
}) => Promise<{
|
|
178
|
+
linkedAccountId: string;
|
|
179
|
+
signatureVerificationMessage?: string;
|
|
180
|
+
} | {
|
|
181
|
+
isConflict: true;
|
|
182
|
+
}>;
|
|
183
|
+
verifyLink: ({ linkedAccountId, userId, ...opts }: {
|
|
184
|
+
linkedAccountId: string;
|
|
185
|
+
userId: string;
|
|
186
|
+
telegramAuthResponse?: TelegramAuthResponse;
|
|
187
|
+
verificationCode?: string;
|
|
188
|
+
} & Partial<VerifyExternalWalletParams>) => Promise<{
|
|
189
|
+
accounts: LinkedAccounts;
|
|
190
|
+
} | {
|
|
191
|
+
isConflict: true;
|
|
192
|
+
}>;
|
|
193
|
+
unlinkAccount: ({ linkedAccountId, userId }: {
|
|
194
|
+
linkedAccountId: string;
|
|
195
|
+
userId: string;
|
|
196
|
+
}) => Promise<LinkedAccounts>;
|
|
148
197
|
/**
|
|
149
198
|
* @deprecated
|
|
150
199
|
*/
|
|
@@ -153,7 +202,7 @@ declare class Client {
|
|
|
153
202
|
* @deprecated
|
|
154
203
|
*/
|
|
155
204
|
verifyPhone: (userId: string, body: verifyBody) => Promise<any>;
|
|
156
|
-
verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup>;
|
|
205
|
+
verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup | ServerAuthStateLogin | ServerAuthStateDone>;
|
|
157
206
|
addSessionPublicKey: (userId: string, body: sessionPublicKeyBody) => Promise<any>;
|
|
158
207
|
getSessionPublicKeys: (userId: string) => Promise<any>;
|
|
159
208
|
getBiometricLocationHints: (auth: PrimaryAuth) => Promise<BiometricLocationHint[]>;
|
|
@@ -161,9 +210,31 @@ declare class Client {
|
|
|
161
210
|
patchSessionPublicKey: (partnerId: string, userId: string, biometricId: string, body: sessionPublicKeyBody) => Promise<any>;
|
|
162
211
|
getWebChallenge: (auth?: PrimaryAuth | Auth<"userId">) => Promise<getWebChallengeRes>;
|
|
163
212
|
touchSession: (regenerate?: boolean) => Promise<SessionInfo>;
|
|
213
|
+
sessionAddPortalVerification: () => Promise<{
|
|
214
|
+
success: boolean;
|
|
215
|
+
}>;
|
|
164
216
|
sessionOrigin: (sessionLookupId: string) => Promise<{
|
|
165
217
|
origin?: string;
|
|
166
218
|
}>;
|
|
219
|
+
sessionLoginMethod: (sessionLookupId: string) => Promise<{
|
|
220
|
+
loginMethod?: string;
|
|
221
|
+
}>;
|
|
222
|
+
sessionAuthVerified: (sessionLookupId: string) => Promise<{
|
|
223
|
+
authVerified?: boolean;
|
|
224
|
+
}>;
|
|
225
|
+
sessionAuth: (sessionLookupId: string) => Promise<{
|
|
226
|
+
userId: string;
|
|
227
|
+
authVerified?: boolean;
|
|
228
|
+
loginAuthMethods: {
|
|
229
|
+
methods: AuthMethod[];
|
|
230
|
+
};
|
|
231
|
+
auth: PrimaryAuth;
|
|
232
|
+
isNewUser: boolean;
|
|
233
|
+
}>;
|
|
234
|
+
sessionSIWEMessage: (sessionLookupId: string) => Promise<{
|
|
235
|
+
message?: string;
|
|
236
|
+
code?: string;
|
|
237
|
+
}>;
|
|
167
238
|
verifyWebChallenge: (partnerId: string, body: verifyWebChallengeBody) => Promise<any>;
|
|
168
239
|
getSessionChallenge: (userId: string) => Promise<any>;
|
|
169
240
|
verifySessionChallenge: (userId: string, body: verifySessionChallengeBody) => Promise<any>;
|
|
@@ -189,7 +260,7 @@ declare class Client {
|
|
|
189
260
|
logout: () => Promise<any>;
|
|
190
261
|
recoveryVerification: (email: string, verificationCode: string) => Promise<any>;
|
|
191
262
|
recoveryInit: (email: string) => Promise<any>;
|
|
192
|
-
preSignMessage: (userId: string, walletId: string, message: string, scheme?: TWalletScheme, cosmosSignDoc?: string) => Promise<any>;
|
|
263
|
+
preSignMessage: (userId: string, walletId: string, message: string, scheme?: TWalletScheme, cosmosSignDoc?: string, protocolId?: string) => Promise<any>;
|
|
193
264
|
deleteSelf: (userId: string) => Promise<any>;
|
|
194
265
|
uploadKeyshares(userId: string, walletId: string, encryptedKeyshares: EncryptedKeyShare[]): Promise<any>;
|
|
195
266
|
uploadUserKeyShares(userId: string, encryptedKeyshares: (EncryptedKeyShare & {
|
|
@@ -207,9 +278,7 @@ declare class Client {
|
|
|
207
278
|
getTransmissionKeyshares(userId: string, sessionLookupId: string): Promise<any>;
|
|
208
279
|
getParaShare: (userId: string, walletId: string) => Promise<string>;
|
|
209
280
|
getBackupKit: (userId: string, walletId: string) => Promise<any>;
|
|
210
|
-
resendVerificationCode({ userId, ...rest }:
|
|
211
|
-
userId: string;
|
|
212
|
-
} & VerificationEmailProps): Promise<AxiosResponse<any, any>>;
|
|
281
|
+
resendVerificationCode({ userId, ...rest }: ResendVerificationCodeParams): Promise<AxiosResponse<any, any>>;
|
|
213
282
|
resendVerificationCodeByPhone({ userId, ...rest }: {
|
|
214
283
|
userId: string;
|
|
215
284
|
} & VerificationEmailProps): Promise<AxiosResponse<any, any>>;
|
|
@@ -218,8 +287,12 @@ declare class Client {
|
|
|
218
287
|
enable2FA(userId: string, verificationCode: string): Promise<AxiosResponse<any, any>>;
|
|
219
288
|
setup2FA(userId: string): Promise<Setup2faResponse>;
|
|
220
289
|
initializeRecovery(email: string): Promise<AxiosResponse<any, any>>;
|
|
221
|
-
initializeFarcasterLogin(
|
|
222
|
-
|
|
290
|
+
initializeFarcasterLogin({ appScheme }?: {
|
|
291
|
+
appScheme?: string;
|
|
292
|
+
}): Promise<any>;
|
|
293
|
+
getFarcasterAuthStatus({ sessionLookupId }?: {
|
|
294
|
+
sessionLookupId?: string;
|
|
295
|
+
}): Promise<VerifyFarcasterResponse>;
|
|
223
296
|
initializeRecoveryForPhone(phone: string, countryCode: string): Promise<AxiosResponse<any, any>>;
|
|
224
297
|
finalizeRecovery(userId: string, walletId: string): Promise<AxiosResponse<any, any>>;
|
|
225
298
|
recoverUserShares(userId: string, walletId: string): Promise<AxiosResponse<{
|
|
@@ -262,7 +335,7 @@ declare class Client {
|
|
|
262
335
|
getOnRampPurchase({ userId, purchaseId, ...params }: {
|
|
263
336
|
userId: string;
|
|
264
337
|
purchaseId: string;
|
|
265
|
-
} & WalletParams): Promise<AxiosResponse<
|
|
338
|
+
} & WalletParams): Promise<AxiosResponse<import("@getpara/shared").IOnRampPurchase, any>>;
|
|
266
339
|
signMoonPayUrl(userId: string, { url, type, cosmosPrefix, testMode, walletId, externalWalletAddress, }: {
|
|
267
340
|
url: string;
|
|
268
341
|
type: TWalletType;
|
|
@@ -317,8 +390,12 @@ declare class Client {
|
|
|
317
390
|
publicKey: string;
|
|
318
391
|
}[];
|
|
319
392
|
}>;
|
|
320
|
-
uploadEncryptedWalletPrivateKey(userId: string, encryptedWalletPrivateKey: string, encryptionKeyHash: string, biometricPublicKey?: string, passwordId?: string): Promise<
|
|
321
|
-
|
|
393
|
+
uploadEncryptedWalletPrivateKey(userId: string, encryptedWalletPrivateKey: string, encryptionKeyHash: string, biometricPublicKey?: string, passwordId?: string): Promise<{
|
|
394
|
+
encryptedWalletPrivateKey: EncryptedWalletPrivateKey;
|
|
395
|
+
}>;
|
|
396
|
+
getEncryptedWalletPrivateKeys(userId: string, encryptionKeyHash: string): Promise<{
|
|
397
|
+
encryptedPrivateKeys: EncryptedWalletPrivateKey[];
|
|
398
|
+
}>;
|
|
322
399
|
getConversionRate(chainId: string, symbol: string, currency: string): Promise<any>;
|
|
323
400
|
getGasEstimate(chainId: string, totalGasPrice: string): Promise<any>;
|
|
324
401
|
getGasOracle(chainId: string): Promise<any>;
|
|
@@ -328,10 +405,20 @@ declare class Client {
|
|
|
328
405
|
deletePendingTransaction(userId: string, pendingTransactionId: string): Promise<any>;
|
|
329
406
|
addSessionPasswordPublicKey(userId: string, body: sessionPasswordBody): Promise<any>;
|
|
330
407
|
patchSessionPassword: (partnerId: string, userId: string, passwordId: string, body: sessionPasswordBody) => Promise<any>;
|
|
331
|
-
getSupportedAuthMethods(auth: Auth): Promise<
|
|
408
|
+
getSupportedAuthMethods(auth: Auth): Promise<{
|
|
409
|
+
supportedAuthMethods: LegacyAuthMethod[];
|
|
410
|
+
}>;
|
|
411
|
+
getSupportedAuthMethodsV2(auth: Auth): Promise<{
|
|
412
|
+
supportedAuthMethods: AuthMethod[];
|
|
413
|
+
hasPasswordWithoutPIN: boolean;
|
|
414
|
+
}>;
|
|
332
415
|
getPasswords(auth: Auth): Promise<PasswordEntity[]>;
|
|
333
416
|
verifyPasswordChallenge(partnerId: string, body: verifyPasswordChallengeBody): Promise<any>;
|
|
334
|
-
getEncryptedWalletPrivateKey(passwordId: string): Promise<
|
|
417
|
+
getEncryptedWalletPrivateKey(passwordId: string, sessionLookupId: string): Promise<{
|
|
418
|
+
data: {
|
|
419
|
+
encryptedWalletPrivateKey: EncryptedWalletPrivateKey;
|
|
420
|
+
};
|
|
421
|
+
}>;
|
|
335
422
|
getUser(userId: string): Promise<any>;
|
|
336
423
|
getAccountMetadata(userId: string, partnerId: string): Promise<{
|
|
337
424
|
accountMetadata: AccountMetadata;
|
|
@@ -340,6 +427,13 @@ declare class Client {
|
|
|
340
427
|
walletId: string;
|
|
341
428
|
rpcUrl?: string;
|
|
342
429
|
}) => Promise<GetWalletBalanceRes>;
|
|
430
|
+
issueJwt: ({ keyIndex }?: IssueJwtParams) => Promise<IssueJwtResponse>;
|
|
431
|
+
getProfileBalance: ({ config, wallets, refetch, }: GetProfileBalanceParams) => Promise<{
|
|
432
|
+
balance: ProfileBalance;
|
|
433
|
+
}>;
|
|
434
|
+
getAssetInfo: () => Promise<{
|
|
435
|
+
assets: AssetMetadataIndexed;
|
|
436
|
+
}>;
|
|
343
437
|
trackError: (opts: {
|
|
344
438
|
methodName: string;
|
|
345
439
|
error: {
|
|
@@ -349,5 +443,44 @@ declare class Client {
|
|
|
349
443
|
sdkType: SDKType;
|
|
350
444
|
userId: string;
|
|
351
445
|
}) => Promise<void>;
|
|
446
|
+
trackReactSdkAnalytics: (opts: {
|
|
447
|
+
props: object;
|
|
448
|
+
reactSdkVersion: string;
|
|
449
|
+
}) => Promise<void>;
|
|
450
|
+
/**
|
|
451
|
+
* Get the enclave's public key for encryption
|
|
452
|
+
*/
|
|
453
|
+
getEnclavePublicKey: () => Promise<{
|
|
454
|
+
publicKey: string;
|
|
455
|
+
keyFingerprint: string;
|
|
456
|
+
generatedAt: string;
|
|
457
|
+
}>;
|
|
458
|
+
/**
|
|
459
|
+
* Persist encrypted key shares to the enclave
|
|
460
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES payload
|
|
461
|
+
*/
|
|
462
|
+
persistEnclaveShares: ({ encryptedPayload, hasNoShares, }: {
|
|
463
|
+
encryptedPayload?: string;
|
|
464
|
+
hasNoShares?: boolean;
|
|
465
|
+
}) => Promise<{
|
|
466
|
+
payload: any;
|
|
467
|
+
}>;
|
|
468
|
+
/**
|
|
469
|
+
* Retrieve encrypted key shares from the enclave
|
|
470
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES query
|
|
471
|
+
*/
|
|
472
|
+
retrieveEnclaveShares: (encryptedPayload: string) => Promise<{
|
|
473
|
+
payload: any;
|
|
474
|
+
}>;
|
|
475
|
+
issueEnclaveJwt: (encryptedPayload: string) => Promise<{
|
|
476
|
+
payload: string;
|
|
477
|
+
}>;
|
|
478
|
+
refreshEnclaveJwt: (encryptedPayload: string) => Promise<{
|
|
479
|
+
payload: string;
|
|
480
|
+
}>;
|
|
481
|
+
getUserPreferences: (userId: string) => Promise<{
|
|
482
|
+
preferences: UserPreferences;
|
|
483
|
+
}>;
|
|
484
|
+
updateUserPreferences: (userId: string, preferences: Partial<UserPreferences>) => Promise<UserPreferences>;
|
|
352
485
|
}
|
|
353
486
|
export default Client;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Auth, AuthInfo, AuthParams, PrimaryAuth, PrimaryAuthInfo, VerifiedAuth, WalletParams, WalletRef } from '
|
|
2
|
-
import { AccountMetadata, AccountMetadataKey, PregenAuth, PregenAuthInfo, PregenOrGuestAuth } from './types/auth.js';
|
|
3
|
-
import { PregenIds, TPregenIdentifierType } from './types/wallet.js';
|
|
1
|
+
import { Auth, AuthInfo, AuthParams, PrimaryAuth, PrimaryAuthInfo, VerifiedAuth, WalletParams, WalletRef, AccountMetadata, AccountMetadataKey, LinkedAccounts, PregenAuth, PregenAuthInfo, PregenOrGuestAuth, PregenIds, TPregenIdentifierType } from '@getpara/shared';
|
|
4
2
|
export declare function isWalletId(params: WalletParams): params is {
|
|
5
3
|
walletId: string;
|
|
6
4
|
};
|
|
@@ -55,4 +53,5 @@ export declare function fromAccountMetadata(obj: Partial<Record<AccountMetadataK
|
|
|
55
53
|
date: string;
|
|
56
54
|
metadata: object;
|
|
57
55
|
}>> | undefined): AccountMetadata;
|
|
56
|
+
export declare function fromLinkedAccounts({ primary, linked }: LinkedAccounts<string>): LinkedAccounts<Date>;
|
|
58
57
|
export {};
|
package/package.json
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
4
|
-
"main": "dist/cjs/index.js",
|
|
5
|
-
"module": "dist/esm/index.js",
|
|
6
|
-
"types": "dist/types/index.d.ts",
|
|
7
|
-
"typings": "dist/types/index.d.ts",
|
|
8
|
-
"sideEffects": false,
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
|
|
11
|
-
"old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
|
|
12
|
-
"build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
13
|
-
"build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
|
|
14
|
-
"build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
|
|
15
|
-
"test": "vitest run --coverage"
|
|
16
|
-
},
|
|
3
|
+
"version": "2.0.0-alpha.70",
|
|
17
4
|
"dependencies": {
|
|
5
|
+
"@getpara/shared": "1.7.0",
|
|
18
6
|
"axios": "^1.8.4",
|
|
19
|
-
"libphonenumber-js": "1.11.
|
|
7
|
+
"libphonenumber-js": "^1.11.7"
|
|
20
8
|
},
|
|
21
9
|
"devDependencies": {
|
|
22
|
-
"typescript": "^5.
|
|
10
|
+
"typescript": "^5.8.3"
|
|
23
11
|
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist",
|
|
26
|
-
"package.json"
|
|
27
|
-
],
|
|
28
12
|
"exports": {
|
|
29
13
|
".": {
|
|
30
14
|
"types": "./dist/types/index.d.ts",
|
|
@@ -32,5 +16,22 @@
|
|
|
32
16
|
"require": "./dist/cjs/index.js"
|
|
33
17
|
}
|
|
34
18
|
},
|
|
35
|
-
"
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"package.json"
|
|
22
|
+
],
|
|
23
|
+
"gitHead": "99d44cff3c68c07dc1cd8c2709b6ca4cd57dca61",
|
|
24
|
+
"main": "dist/cjs/index.js",
|
|
25
|
+
"module": "dist/esm/index.js",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
|
|
28
|
+
"build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
29
|
+
"build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
|
|
30
|
+
"build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
|
|
31
|
+
"old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
|
|
32
|
+
"test": "vitest run --coverage"
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"types": "dist/types/index.d.ts",
|
|
36
|
+
"typings": "dist/types/index.d.ts"
|
|
36
37
|
}
|
package/dist/cjs/types/auth.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var auth_exports = {};
|
|
19
|
-
__export(auth_exports, {
|
|
20
|
-
AUTH_TYPES: () => AUTH_TYPES,
|
|
21
|
-
AuthMethod: () => AuthMethod,
|
|
22
|
-
EncryptorType: () => EncryptorType,
|
|
23
|
-
KeyShareType: () => KeyShareType,
|
|
24
|
-
OAUTH_METHODS: () => OAUTH_METHODS,
|
|
25
|
-
OAuthMethod: () => OAuthMethod,
|
|
26
|
-
PasswordStatus: () => PasswordStatus,
|
|
27
|
-
PublicKeyStatus: () => PublicKeyStatus,
|
|
28
|
-
PublicKeyType: () => PublicKeyType
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(auth_exports);
|
|
31
|
-
const AUTH_TYPES = [
|
|
32
|
-
"email",
|
|
33
|
-
"phone",
|
|
34
|
-
"phoneLegacy",
|
|
35
|
-
"farcaster",
|
|
36
|
-
"telegram",
|
|
37
|
-
"userId",
|
|
38
|
-
"externalWallet",
|
|
39
|
-
"discord",
|
|
40
|
-
"x",
|
|
41
|
-
"customId",
|
|
42
|
-
"guestId"
|
|
43
|
-
];
|
|
44
|
-
var EncryptorType = /* @__PURE__ */ ((EncryptorType2) => {
|
|
45
|
-
EncryptorType2["USER"] = "USER";
|
|
46
|
-
EncryptorType2["RECOVERY"] = "RECOVERY";
|
|
47
|
-
EncryptorType2["BIOMETRICS"] = "BIOMETRICS";
|
|
48
|
-
EncryptorType2["PASSWORD"] = "PASSWORD";
|
|
49
|
-
return EncryptorType2;
|
|
50
|
-
})(EncryptorType || {});
|
|
51
|
-
var KeyShareType = /* @__PURE__ */ ((KeyShareType2) => {
|
|
52
|
-
KeyShareType2["USER"] = "USER";
|
|
53
|
-
KeyShareType2["RECOVERY"] = "RECOVERY";
|
|
54
|
-
return KeyShareType2;
|
|
55
|
-
})(KeyShareType || {});
|
|
56
|
-
var PasswordStatus = /* @__PURE__ */ ((PasswordStatus2) => {
|
|
57
|
-
PasswordStatus2["PENDING"] = "PENDING";
|
|
58
|
-
PasswordStatus2["COMPLETE"] = "COMPLETE";
|
|
59
|
-
return PasswordStatus2;
|
|
60
|
-
})(PasswordStatus || {});
|
|
61
|
-
var PublicKeyStatus = /* @__PURE__ */ ((PublicKeyStatus2) => {
|
|
62
|
-
PublicKeyStatus2["PENDING"] = "PENDING";
|
|
63
|
-
PublicKeyStatus2["COMPLETE"] = "COMPLETE";
|
|
64
|
-
return PublicKeyStatus2;
|
|
65
|
-
})(PublicKeyStatus || {});
|
|
66
|
-
var PublicKeyType = /* @__PURE__ */ ((PublicKeyType2) => {
|
|
67
|
-
PublicKeyType2["MOBILE"] = "MOBILE";
|
|
68
|
-
PublicKeyType2["WEB"] = "WEB";
|
|
69
|
-
return PublicKeyType2;
|
|
70
|
-
})(PublicKeyType || {});
|
|
71
|
-
var OAuthMethod = /* @__PURE__ */ ((OAuthMethod2) => {
|
|
72
|
-
OAuthMethod2["GOOGLE"] = "GOOGLE";
|
|
73
|
-
OAuthMethod2["TWITTER"] = "TWITTER";
|
|
74
|
-
OAuthMethod2["APPLE"] = "APPLE";
|
|
75
|
-
OAuthMethod2["DISCORD"] = "DISCORD";
|
|
76
|
-
OAuthMethod2["FACEBOOK"] = "FACEBOOK";
|
|
77
|
-
OAuthMethod2["FARCASTER"] = "FARCASTER";
|
|
78
|
-
OAuthMethod2["TELEGRAM"] = "TELEGRAM";
|
|
79
|
-
return OAuthMethod2;
|
|
80
|
-
})(OAuthMethod || {});
|
|
81
|
-
const OAUTH_METHODS = ["GOOGLE", "TWITTER", "APPLE", "DISCORD", "FACEBOOK", "FARCASTER", "TELEGRAM"];
|
|
82
|
-
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
83
|
-
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
84
|
-
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
85
|
-
return AuthMethod2;
|
|
86
|
-
})(AuthMethod || {});
|
|
87
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
-
0 && (module.exports = {
|
|
89
|
-
AUTH_TYPES,
|
|
90
|
-
AuthMethod,
|
|
91
|
-
EncryptorType,
|
|
92
|
-
KeyShareType,
|
|
93
|
-
OAUTH_METHODS,
|
|
94
|
-
OAuthMethod,
|
|
95
|
-
PasswordStatus,
|
|
96
|
-
PublicKeyStatus,
|
|
97
|
-
PublicKeyType
|
|
98
|
-
});
|
package/dist/cjs/types/email.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var email_exports = {};
|
|
19
|
-
__export(email_exports, {
|
|
20
|
-
EmailTheme: () => EmailTheme
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(email_exports);
|
|
23
|
-
var EmailTheme = /* @__PURE__ */ ((EmailTheme2) => {
|
|
24
|
-
EmailTheme2["LIGHT"] = "light";
|
|
25
|
-
EmailTheme2["DARK"] = "dark";
|
|
26
|
-
return EmailTheme2;
|
|
27
|
-
})(EmailTheme || {});
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
EmailTheme
|
|
31
|
-
});
|
package/dist/cjs/types/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
|
17
|
-
__reExport(types_exports, require("./auth.js"), module.exports);
|
|
18
|
-
__reExport(types_exports, require("./email.js"), module.exports);
|
|
19
|
-
__reExport(types_exports, require("./onRamp.js"), module.exports);
|
|
20
|
-
__reExport(types_exports, require("./partner.js"), module.exports);
|
|
21
|
-
__reExport(types_exports, require("./wallet.js"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("./auth.js"),
|
|
25
|
-
...require("./email.js"),
|
|
26
|
-
...require("./onRamp.js"),
|
|
27
|
-
...require("./partner.js"),
|
|
28
|
-
...require("./wallet.js")
|
|
29
|
-
});
|
package/dist/cjs/types/onRamp.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var onRamp_exports = {};
|
|
19
|
-
__export(onRamp_exports, {
|
|
20
|
-
OnRampAsset: () => OnRampAsset,
|
|
21
|
-
OnRampProvider: () => OnRampProvider,
|
|
22
|
-
OnRampPurchaseStatus: () => OnRampPurchaseStatus,
|
|
23
|
-
OnRampPurchaseType: () => OnRampPurchaseType
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(onRamp_exports);
|
|
26
|
-
var OnRampProvider = /* @__PURE__ */ ((OnRampProvider2) => {
|
|
27
|
-
OnRampProvider2["RAMP"] = "RAMP";
|
|
28
|
-
OnRampProvider2["STRIPE"] = "STRIPE";
|
|
29
|
-
OnRampProvider2["MOONPAY"] = "MOONPAY";
|
|
30
|
-
return OnRampProvider2;
|
|
31
|
-
})(OnRampProvider || {});
|
|
32
|
-
var OnRampAsset = /* @__PURE__ */ ((OnRampAsset2) => {
|
|
33
|
-
OnRampAsset2["ETHEREUM"] = "ETHEREUM";
|
|
34
|
-
OnRampAsset2["USDC"] = "USDC";
|
|
35
|
-
OnRampAsset2["TETHER"] = "TETHER";
|
|
36
|
-
OnRampAsset2["POLYGON"] = "POLYGON";
|
|
37
|
-
OnRampAsset2["SOLANA"] = "SOLANA";
|
|
38
|
-
OnRampAsset2["ATOM"] = "ATOM";
|
|
39
|
-
OnRampAsset2["CELO"] = "CELO";
|
|
40
|
-
OnRampAsset2["CUSD"] = "CUSD";
|
|
41
|
-
OnRampAsset2["CEUR"] = "CEUR";
|
|
42
|
-
OnRampAsset2["CREAL"] = "CREAL";
|
|
43
|
-
return OnRampAsset2;
|
|
44
|
-
})(OnRampAsset || {});
|
|
45
|
-
var OnRampPurchaseStatus = /* @__PURE__ */ ((OnRampPurchaseStatus2) => {
|
|
46
|
-
OnRampPurchaseStatus2["INITIATED"] = "INITIATED";
|
|
47
|
-
OnRampPurchaseStatus2["FINISHED"] = "FINISHED";
|
|
48
|
-
OnRampPurchaseStatus2["CANCELLED"] = "CANCELLED";
|
|
49
|
-
return OnRampPurchaseStatus2;
|
|
50
|
-
})(OnRampPurchaseStatus || {});
|
|
51
|
-
var OnRampPurchaseType = /* @__PURE__ */ ((OnRampPurchaseType2) => {
|
|
52
|
-
OnRampPurchaseType2["BUY"] = "BUY";
|
|
53
|
-
OnRampPurchaseType2["SELL"] = "SELL";
|
|
54
|
-
return OnRampPurchaseType2;
|
|
55
|
-
})(OnRampPurchaseType || {});
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
OnRampAsset,
|
|
59
|
-
OnRampProvider,
|
|
60
|
-
OnRampPurchaseStatus,
|
|
61
|
-
OnRampPurchaseType
|
|
62
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
-
var partner_exports = {};
|
|
15
|
-
module.exports = __toCommonJS(partner_exports);
|