@usecapsule/user-management-client
Advanced tools
Comparing version 1.6.0 to 1.7.0-dev.0
@@ -75,4 +75,4 @@ "use strict"; | ||
}); | ||
this.checkUserExists = (email) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/exists?email=${encodeURIComponent(email)}`); | ||
this.checkUserExists = (email, phone, countryCode) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/exists?email=${encodeURIComponent(email)}&phone=${encodeURIComponent(phone)}&countryCode=${encodeURIComponent(countryCode)}`); | ||
return res; | ||
@@ -85,2 +85,6 @@ }); | ||
}); | ||
this.verifyPhone = (userId, body) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/verify-identifier`, body); | ||
return res; | ||
}); | ||
// POST /users/:userId/biometrics/key | ||
@@ -111,3 +115,3 @@ this.addSessionPublicKey = (userId, body) => __awaiter(this, void 0, void 0, function* () { | ||
// GET /biometrics/challenge?email&publicKey | ||
this.getWebChallenge = (email, publicKey) => __awaiter(this, void 0, void 0, function* () { | ||
this.getWebChallenge = (email, phone, countryCode, publicKey) => __awaiter(this, void 0, void 0, function* () { | ||
const queryParams = {}; | ||
@@ -117,2 +121,8 @@ if (email) { | ||
} | ||
if (phone) { | ||
queryParams['phone'] = phone; | ||
} | ||
if (countryCode) { | ||
queryParams['countryCode'] = countryCode; | ||
} | ||
if (publicKey) { | ||
@@ -356,2 +366,10 @@ queryParams['publicKey'] = publicKey; | ||
} | ||
// POST '/users/:userId/resend-verification-code-by-phone | ||
resendVerificationCodeByPhone(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest); | ||
return res; | ||
}); | ||
} | ||
// POST recovery/cancel | ||
@@ -392,2 +410,9 @@ cancelRecoveryAttempt(email) { | ||
} | ||
// POST /recovery/init | ||
initializeRecoveryForPhone(phone, countryCode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/recovery/init`, { phone, countryCode }); | ||
return res; | ||
}); | ||
} | ||
// POST /recovery/users/:userId/wallets/:walletId/finish | ||
@@ -415,2 +440,10 @@ finalizeRecovery(userId, walletId) { | ||
} | ||
// POST /recovery/verify-identifier | ||
verifyPhoneForRecovery(phone, countryCode, verificationCode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const body = { phone, countryCode, verificationCode }; | ||
const res = yield this.baseRequest.post(`/recovery/verify-identifier`, body); | ||
return res; | ||
}); | ||
} | ||
// POST /2fa/verify | ||
@@ -424,2 +457,10 @@ verify2FA(email, verificationCode) { | ||
} | ||
// POST /2fa/phone/verify | ||
verify2FAForPhone(phone, countryCode, verificationCode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const body = { phone, countryCode, verificationCode }; | ||
const res = yield this.baseRequest.post('/2fa/verify', body); | ||
return res; | ||
}); | ||
} | ||
tempTrasmissionInit(message, userId) { | ||
@@ -426,0 +467,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -69,4 +69,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}); | ||
this.checkUserExists = (email) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/exists?email=${encodeURIComponent(email)}`); | ||
this.checkUserExists = (email, phone, countryCode) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/exists?email=${encodeURIComponent(email)}&phone=${encodeURIComponent(phone)}&countryCode=${encodeURIComponent(countryCode)}`); | ||
return res; | ||
@@ -79,2 +79,6 @@ }); | ||
}); | ||
this.verifyPhone = (userId, body) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/verify-identifier`, body); | ||
return res; | ||
}); | ||
// POST /users/:userId/biometrics/key | ||
@@ -105,3 +109,3 @@ this.addSessionPublicKey = (userId, body) => __awaiter(this, void 0, void 0, function* () { | ||
// GET /biometrics/challenge?email&publicKey | ||
this.getWebChallenge = (email, publicKey) => __awaiter(this, void 0, void 0, function* () { | ||
this.getWebChallenge = (email, phone, countryCode, publicKey) => __awaiter(this, void 0, void 0, function* () { | ||
const queryParams = {}; | ||
@@ -111,2 +115,8 @@ if (email) { | ||
} | ||
if (phone) { | ||
queryParams['phone'] = phone; | ||
} | ||
if (countryCode) { | ||
queryParams['countryCode'] = countryCode; | ||
} | ||
if (publicKey) { | ||
@@ -350,2 +360,10 @@ queryParams['publicKey'] = publicKey; | ||
} | ||
// POST '/users/:userId/resend-verification-code-by-phone | ||
resendVerificationCodeByPhone(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest); | ||
return res; | ||
}); | ||
} | ||
// POST recovery/cancel | ||
@@ -386,2 +404,9 @@ cancelRecoveryAttempt(email) { | ||
} | ||
// POST /recovery/init | ||
initializeRecoveryForPhone(phone, countryCode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/recovery/init`, { phone, countryCode }); | ||
return res; | ||
}); | ||
} | ||
// POST /recovery/users/:userId/wallets/:walletId/finish | ||
@@ -409,2 +434,10 @@ finalizeRecovery(userId, walletId) { | ||
} | ||
// POST /recovery/verify-identifier | ||
verifyPhoneForRecovery(phone, countryCode, verificationCode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const body = { phone, countryCode, verificationCode }; | ||
const res = yield this.baseRequest.post(`/recovery/verify-identifier`, body); | ||
return res; | ||
}); | ||
} | ||
// POST /2fa/verify | ||
@@ -418,2 +451,10 @@ verify2FA(email, verificationCode) { | ||
} | ||
// POST /2fa/phone/verify | ||
verify2FAForPhone(phone, countryCode, verificationCode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const body = { phone, countryCode, verificationCode }; | ||
const res = yield this.baseRequest.post('/2fa/verify', body); | ||
return res; | ||
}); | ||
} | ||
tempTrasmissionInit(message, userId) { | ||
@@ -420,0 +461,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -39,2 +39,6 @@ export declare const USER_NOT_VERIFIED = "user must verify biometrics"; | ||
} | ||
export interface createUserBodyForPhone { | ||
phone: string; | ||
countryCode: string; | ||
} | ||
export interface createUserIdRes { | ||
@@ -44,3 +48,3 @@ protocolId: string; | ||
} | ||
export interface verifyEmailBody { | ||
export interface verifyBody { | ||
verificationCode: string; | ||
@@ -83,2 +87,4 @@ } | ||
email?: string; | ||
phone?: string; | ||
countryCode?: string; | ||
sessionLookupId?: string; | ||
@@ -169,5 +175,6 @@ signature: WebSignature; | ||
constructor({ userManagementHost, apiKey, opts, retrieveSessionCookie, persistSessionCookie }: ClientConfig); | ||
createUser: (body: createUserBody & VerificationEmailProps) => Promise<createUserIdRes>; | ||
checkUserExists: (email: string) => Promise<any>; | ||
verifyEmail: (userId: string, body: verifyEmailBody) => Promise<any>; | ||
createUser: (body: (createUserBody | createUserBodyForPhone) & VerificationEmailProps) => Promise<createUserIdRes>; | ||
checkUserExists: (email: string, phone: string, countryCode: string) => Promise<any>; | ||
verifyEmail: (userId: string, body: verifyBody) => Promise<any>; | ||
verifyPhone: (userId: string, body: verifyBody) => Promise<any>; | ||
addSessionPublicKey: (userId: string, body: sessionPublicKeyBody) => Promise<any>; | ||
@@ -177,3 +184,3 @@ getSessionPublicKeys: (userId: string) => Promise<any>; | ||
patchSessionPublicKey: (partnerId: string, userId: string, biometricId: string, body: sessionPublicKeyBody) => Promise<any>; | ||
getWebChallenge: (email?: string, publicKey?: string) => Promise<getWebChallengeRes>; | ||
getWebChallenge: (email?: string, phone?: string, countryCode?: string, publicKey?: string) => Promise<getWebChallengeRes>; | ||
touchSession: (regenerate?: boolean) => Promise<any>; | ||
@@ -219,2 +226,5 @@ verifyWebChallenge: (partnerId: string, body: verifyWebChallengeBody) => Promise<any>; | ||
} & VerificationEmailProps): Promise<import("axios").AxiosResponse<any, any>>; | ||
resendVerificationCodeByPhone({ userId, ...rest }: { | ||
userId: string; | ||
} & VerificationEmailProps): Promise<import("axios").AxiosResponse<any, any>>; | ||
cancelRecoveryAttempt(email: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
@@ -225,6 +235,9 @@ check2FAStatus(userId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
initializeRecovery(email: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
initializeRecoveryForPhone(phone: string, countryCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
finalizeRecovery(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
recoverUserShare(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verifyEmailForRecovery(email: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verifyPhoneForRecovery(phone: string, countryCode: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verify2FA(email: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verify2FAForPhone(phone: string, countryCode: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
tempTrasmissionInit(message: string, userId?: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
@@ -231,0 +244,0 @@ tempTrasmission(id: string): Promise<import("axios").AxiosResponse<any, any>>; |
{ | ||
"name": "@usecapsule/user-management-client", | ||
"version": "1.6.0", | ||
"version": "1.7.0-dev.0", | ||
"main": "dist/cjs/index.js", | ||
@@ -32,4 +32,3 @@ "module": "dist/esm/index.js", | ||
} | ||
}, | ||
"gitHead": "9f19a2e9224958e127ed0cdfa3550d1b832b6361" | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
60904
1326
2