@riocrypto/common-server 1.0.1378 → 1.0.1380

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.
@@ -26,7 +26,7 @@ declare class ClusterClient {
26
26
  sendVerificationCode(phoneNumber: string): Promise<{
27
27
  hasAuthenticatorEnabled: boolean;
28
28
  }>;
29
- verifySMSCode(phoneNumber: string, code: string): Promise<void>;
29
+ verifyCode(phoneNumber: string, code?: string, authenticatorCode?: string): Promise<void>;
30
30
  }
31
31
  export declare const buildClusterClient: () => Promise<ClusterClient>;
32
32
  export {};
@@ -204,9 +204,13 @@ class ClusterClient {
204
204
  return response.data;
205
205
  });
206
206
  }
207
- verifySMSCode(phoneNumber, code) {
207
+ verifyCode(phoneNumber, code, authenticatorCode) {
208
208
  return __awaiter(this, void 0, void 0, function* () {
209
- yield this.axios.post(`${this.baseUrl}/api/auth/verify-code`, { phoneNumber, code }, {
209
+ yield this.axios.post(`${this.baseUrl}/api/auth/verify-code`, {
210
+ phoneNumber,
211
+ code: code ? code : undefined,
212
+ authenticatorCode: authenticatorCode ? authenticatorCode : undefined,
213
+ }, {
210
214
  headers: {
211
215
  "x-cluster-api-key": this.clusterApiKey,
212
216
  },
@@ -7,6 +7,7 @@ interface TelegramSessionAttrs {
7
7
  isVerified: boolean;
8
8
  state: string;
9
9
  authId?: string;
10
+ hasAuthenticatorEnabled?: boolean;
10
11
  quoteInputs?: {
11
12
  fiat?: Fiat;
12
13
  crypto?: Crypto;
@@ -30,6 +31,7 @@ interface TelegramSessionDoc extends mongoose.Document {
30
31
  isVerified: boolean;
31
32
  state: string;
32
33
  authId?: string;
34
+ hasAuthenticatorEnabled?: boolean;
33
35
  quoteInputs?: {
34
36
  fiat?: Fiat;
35
37
  crypto?: Crypto;
@@ -14,6 +14,9 @@ const buildTelegramSession = (mongoose) => {
14
14
  authId: {
15
15
  type: String,
16
16
  },
17
+ hasAuthenticatorEnabled: {
18
+ type: Boolean,
19
+ },
17
20
  telegramUsername: {
18
21
  type: String,
19
22
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1378",
3
+ "version": "1.0.1380",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",