@usecapsule/user-management-client
Advanced tools
Comparing version 1.36.0 to 1.37.0
@@ -184,3 +184,3 @@ "use strict"; | ||
const res = yield this.baseRequest.get('/biometrics/challenge', { | ||
params: Object.assign({}, auth), | ||
params: Object.assign({}, (auth || {})), | ||
}); | ||
@@ -666,3 +666,3 @@ return res.data; | ||
generateOffRampTx(userId_1, _a) { | ||
return __awaiter(this, arguments, void 0, function* (userId, { provider, chainId, contractAddress, testMode, walletId, walletType, destinationAddress, assetQuantity, }) { | ||
return __awaiter(this, arguments, void 0, function* (userId, { provider, chainId, contractAddress, testMode, walletId, walletType, destinationAddress, sourceAddress, assetQuantity, }) { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-generate`, { | ||
@@ -676,2 +676,3 @@ provider, | ||
destinationAddress, | ||
sourceAddress, | ||
assetQuantity, | ||
@@ -809,2 +810,9 @@ }); | ||
} | ||
// GET /users/:userId | ||
getUser(userId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}`); | ||
return res.data; | ||
}); | ||
} | ||
} | ||
@@ -811,0 +819,0 @@ exports.default = Client; |
@@ -63,3 +63,11 @@ "use strict"; | ||
function extractAuth(obj, opts = {}) { | ||
return extractAuthInfo(obj, opts).auth; | ||
try { | ||
return extractAuthInfo(obj, { allowUserId: opts.allowUserId || false }).auth; | ||
} | ||
catch (e) { | ||
if (opts.optional) { | ||
return undefined; | ||
} | ||
throw e; | ||
} | ||
} | ||
@@ -66,0 +74,0 @@ var OAuthMethod; |
@@ -178,3 +178,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const res = yield this.baseRequest.get('/biometrics/challenge', { | ||
params: Object.assign({}, auth), | ||
params: Object.assign({}, (auth || {})), | ||
}); | ||
@@ -660,3 +660,3 @@ return res.data; | ||
generateOffRampTx(userId_1, _a) { | ||
return __awaiter(this, arguments, void 0, function* (userId, { provider, chainId, contractAddress, testMode, walletId, walletType, destinationAddress, assetQuantity, }) { | ||
return __awaiter(this, arguments, void 0, function* (userId, { provider, chainId, contractAddress, testMode, walletId, walletType, destinationAddress, sourceAddress, assetQuantity, }) { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-generate`, { | ||
@@ -670,2 +670,3 @@ provider, | ||
destinationAddress, | ||
sourceAddress, | ||
assetQuantity, | ||
@@ -803,2 +804,9 @@ }); | ||
} | ||
// GET /users/:userId | ||
getUser(userId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}`); | ||
return res.data; | ||
}); | ||
} | ||
} | ||
@@ -805,0 +813,0 @@ export default Client; |
@@ -51,3 +51,11 @@ export function isWalletId(params) { | ||
export function extractAuth(obj, opts = {}) { | ||
return extractAuthInfo(obj, opts).auth; | ||
try { | ||
return extractAuthInfo(obj, { allowUserId: opts.allowUserId || false }).auth; | ||
} | ||
catch (e) { | ||
if (opts.optional) { | ||
return undefined; | ||
} | ||
throw e; | ||
} | ||
} | ||
@@ -54,0 +62,0 @@ export var OAuthMethod; |
@@ -332,3 +332,3 @@ import { AxiosResponse } from 'axios'; | ||
patchSessionPublicKey: (partnerId: string, userId: string, biometricId: string, body: sessionPublicKeyBody) => Promise<any>; | ||
getWebChallenge: (auth: Auth) => Promise<getWebChallengeRes>; | ||
getWebChallenge: (auth?: Auth) => Promise<getWebChallengeRes>; | ||
touchSession: (regenerate?: boolean) => Promise<any>; | ||
@@ -448,3 +448,3 @@ sessionOrigin: (sessionLookupId: string) => Promise<{ | ||
network: Network; | ||
}>(userId: string, { provider, chainId, contractAddress, testMode, walletId, walletType, destinationAddress, assetQuantity, }: { | ||
}>(userId: string, { provider, chainId, contractAddress, testMode, walletId, walletType, destinationAddress, sourceAddress, assetQuantity, }: { | ||
provider: OnRampProvider; | ||
@@ -457,2 +457,3 @@ chainId: string; | ||
destinationAddress: string; | ||
sourceAddress?: string; | ||
assetQuantity: string | number; | ||
@@ -502,3 +503,4 @@ }): Promise<ReturnType>; | ||
getEncryptedWalletPrivateKey(passwordId: string): Promise<any>; | ||
getUser(userId: string): Promise<any>; | ||
} | ||
export default Client; |
@@ -47,3 +47,5 @@ type WalletRef = 'walletId' | 'externalWalletAddress'; | ||
}): ExtractAuth; | ||
export declare function extractAuth(obj: AuthParams, opts?: Parameters<typeof extractAuthInfo>[1]): Auth; | ||
export declare function extractAuth(obj: AuthParams, opts?: Parameters<typeof extractAuthInfo>[1] & { | ||
optional?: boolean; | ||
}): Auth | undefined; | ||
export declare enum OAuthMethod { | ||
@@ -50,0 +52,0 @@ GOOGLE = "GOOGLE", |
{ | ||
"name": "@usecapsule/user-management-client", | ||
"version": "1.36.0", | ||
"version": "1.37.0", | ||
"main": "dist/cjs/index.js", | ||
@@ -34,3 +34,3 @@ "module": "dist/esm/index.js", | ||
}, | ||
"gitHead": "e9ff30292736bf99ee7115c458443832f0b08082" | ||
"gitHead": "de5cb1938bad269345fa5a4b2887618e81a851e5" | ||
} |
104689
2391