@riocrypto/common-server 1.0.2703 → 1.0.2705

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.
@@ -92,6 +92,10 @@ declare class ClusterClient {
92
92
  hasAuthenticatorEnabled: boolean;
93
93
  }>;
94
94
  verifyCode(phoneNumber: string, code?: string, authenticatorCode?: string): Promise<void>;
95
+ sendEmailVerificationCode(email: string): Promise<{
96
+ hasAuthenticatorEnabled: boolean;
97
+ }>;
98
+ verifyEmailCode(email: string, code: string): Promise<void>;
95
99
  sendVerificationEmail(userId: string, country?: Country): Promise<void>;
96
100
  registerFXTrade(orderId: string, provider: FXProvider, amount: number, price: number): Promise<void>;
97
101
  generateInvoice(orderId: string): Promise<void>;
@@ -302,6 +302,25 @@ class ClusterClient {
302
302
  });
303
303
  });
304
304
  }
305
+ sendEmailVerificationCode(email) {
306
+ return __awaiter(this, void 0, void 0, function* () {
307
+ const response = yield this.axios.post(`${this.baseUrl}/api/auth/email/send-verification`, { email }, {
308
+ headers: {
309
+ "x-cluster-api-key": this.clusterApiKey,
310
+ },
311
+ });
312
+ return response.data;
313
+ });
314
+ }
315
+ verifyEmailCode(email, code) {
316
+ return __awaiter(this, void 0, void 0, function* () {
317
+ yield this.axios.post(`${this.baseUrl}/api/auth/email/verify`, { email, code }, {
318
+ headers: {
319
+ "x-cluster-api-key": this.clusterApiKey,
320
+ },
321
+ });
322
+ });
323
+ }
305
324
  sendVerificationEmail(userId, country) {
306
325
  return __awaiter(this, void 0, void 0, function* () {
307
326
  yield this.axios.post(`${this.baseUrl}/api/kyc/email`, {
@@ -10,6 +10,7 @@ interface TelegramSessionAttrs {
10
10
  state: string;
11
11
  authId?: string;
12
12
  hasAuthenticatorEnabled?: boolean;
13
+ isEmailAuth?: boolean;
13
14
  quoteInputs?: {
14
15
  fiat?: Fiat;
15
16
  crypto?: Crypto;
@@ -38,6 +39,7 @@ interface TelegramSessionDoc extends mongoose.Document {
38
39
  state: string;
39
40
  authId?: string;
40
41
  hasAuthenticatorEnabled?: boolean;
42
+ isEmailAuth?: boolean;
41
43
  quoteInputs?: {
42
44
  fiat?: Fiat;
43
45
  crypto?: Crypto;
@@ -20,6 +20,9 @@ const buildTelegramSession = (mongoose) => {
20
20
  hasAuthenticatorEnabled: {
21
21
  type: Boolean,
22
22
  },
23
+ isEmailAuth: {
24
+ type: Boolean,
25
+ },
23
26
  telegramUsername: {
24
27
  type: String,
25
28
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2703",
3
+ "version": "1.0.2705",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",