@uappi/public-sdk 1.1.30 → 1.1.32

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 } from "../types";
4
4
 
5
5
  export function sendMfa(payload: RequestSendMFA) {
6
6
  return usePublicApi<true>({
@@ -12,7 +12,15 @@ export function sendMfa(payload: RequestSendMFA) {
12
12
 
13
13
  export function confirmMfa(payload: RequestConfirmMFA) {
14
14
  return usePublicApi<true>({
15
- endpoint: '/customer/login/mfa/send',
15
+ endpoint: '/customer/mfa/app/confirm',
16
+ method: 'POST',
17
+ payload
18
+ });
19
+ }
20
+
21
+ export function loginMfa(payload: RequestLoginMFA) {
22
+ return usePublicApi<true>({
23
+ endpoint: '/customer/login/mfa',
16
24
  method: 'POST',
17
25
  payload
18
26
  });
@@ -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 = {
@@ -16,6 +16,13 @@ export interface MFAOption {
16
16
  settings: MFAAPPSettings | MFAEmailSettings | MFAPhoneSettings;
17
17
  }
18
18
 
19
+ export interface RequestLoginMFA {
20
+ mfaOptionId: number;
21
+ mfaToken: string;
22
+ code: string;
23
+ secretKey: string;
24
+ }
25
+
19
26
  export interface MFAAPPSettings {
20
27
  otpauth: string;
21
28
  qrCode: string;
@@ -237,7 +237,7 @@ 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 { MFAOption, RequestSendMFA, RequestConfirmMFA, MFAAPPSettings, MFAEmailSettings, MFAPhoneSettings, RequestLoginMFA } from './endpoints/mfa/mfa.interfaces'
241
241
  export type {
242
242
  // Config da useApi
243
243
  ApiResponse,
@@ -464,6 +464,7 @@ export type {
464
464
  MFAAPPSettings,
465
465
  MFAEmailSettings,
466
466
  MFAPhoneSettings,
467
+ RequestLoginMFA,
467
468
 
468
469
  // Order
469
470
  Order,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {