@uappi/public-sdk 1.1.31 → 1.1.33

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.
@@ -1,6 +1,6 @@
1
1
  import { usePublicApi } from '..';
2
2
 
3
- import { RequestConfirmMFA, RequestSendMFA } from "../types";
3
+ import { RequestConfirmMFA, RequestLoginMFA, RequestSendMFA, ResponseLoginMFA } from "../types";
4
4
 
5
5
  export function sendMfa(payload: RequestSendMFA) {
6
6
  return usePublicApi<true>({
@@ -17,3 +17,11 @@ export function confirmMfa(payload: RequestConfirmMFA) {
17
17
  payload
18
18
  });
19
19
  }
20
+
21
+ export function loginMfa(payload: RequestLoginMFA) {
22
+ return usePublicApi<ResponseLoginMFA>({
23
+ endpoint: '/customer/login/mfa',
24
+ method: 'POST',
25
+ payload
26
+ });
27
+ }
@@ -81,7 +81,7 @@ import { upsells } from './endpoints/UpsellComposable'
81
81
  import { contact } from './endpoints/PublicComposable'
82
82
  import { oauthRedirect } from './endpoints/ThirdPartyComposable';
83
83
 
84
- import { sendMfa, confirmMfa } from './endpoints/MFAComposable';
84
+ import { sendMfa, confirmMfa, loginMfa } from './endpoints/MFAComposable';
85
85
 
86
86
 
87
87
  import { usePublicApi } from './usePublicApi';
@@ -133,7 +133,8 @@ const customer = {
133
133
  addProductToWishlist,
134
134
  removeProductToWishlist,
135
135
  sendMfa,
136
- confirmMfa
136
+ confirmMfa,
137
+ loginMfa
137
138
  };
138
139
 
139
140
  const cart = {
@@ -10,17 +10,31 @@ export interface RequestConfirmMFA {
10
10
  }
11
11
 
12
12
  export interface MFAOption {
13
- type: 'email' | 'sms' | 'app';
13
+ type: "email" | "sms" | "app";
14
14
  id: number;
15
15
  label: string;
16
- settings: MFAAPPSettings | MFAEmailSettings | MFAPhoneSettings;
16
+ settings: MFAAPPSettings | MFAEmailSettings | MFAPhoneSettings;
17
+ }
18
+
19
+ export interface RequestLoginMFA {
20
+ mfaOptionId: number;
21
+ mfaToken: string;
22
+ code: string;
23
+ secretKey: string;
24
+ }
25
+
26
+ export interface ResponseLoginMFA {
27
+ code: number;
28
+ details: [];
29
+ errorCode: 'UAPPI_STORE_CUSTOMER_MFA_CODE_INVALID' | 'UAPPI_STORE_CUSTOMER_MFA_CODE_ATTEMPTS_EXCEEDED';
30
+ message: string;
17
31
  }
18
32
 
19
33
  export interface MFAAPPSettings {
20
34
  otpauth: string;
21
35
  qrCode: string;
22
36
  secretKey: string;
23
- }
37
+ }
24
38
 
25
39
  export interface MFAEmailSettings {
26
40
  email: string;
@@ -29,4 +43,3 @@ export interface MFAEmailSettings {
29
43
  export interface MFAPhoneSettings {
30
44
  phone: string;
31
45
  }
32
-
@@ -237,7 +237,17 @@ import type { PriceRule } from './endpoints/price/price.interfaces';
237
237
 
238
238
  import type { RedirectRequest, OauthType } from './endpoints/third-party/oauth.interfaces';
239
239
 
240
- import type { MFAOption, RequestSendMFA, RequestConfirmMFA, MFAAPPSettings, MFAEmailSettings, MFAPhoneSettings } from './endpoints/mfa/mfa.interfaces'
240
+ import type {
241
+ MFAOption,
242
+ RequestSendMFA,
243
+ RequestConfirmMFA,
244
+ MFAAPPSettings,
245
+ MFAEmailSettings,
246
+ MFAPhoneSettings,
247
+ RequestLoginMFA,
248
+ ResponseLoginMFA
249
+ } from './endpoints/mfa/mfa.interfaces';
250
+
241
251
  export type {
242
252
  // Config da useApi
243
253
  ApiResponse,
@@ -464,6 +474,8 @@ export type {
464
474
  MFAAPPSettings,
465
475
  MFAEmailSettings,
466
476
  MFAPhoneSettings,
477
+ RequestLoginMFA,
478
+ ResponseLoginMFA,
467
479
 
468
480
  // Order
469
481
  Order,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {