@uappi/public-sdk 1.1.25 → 1.1.26
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.
- package/modules/Api/endpoints/CustomerComposable.ts +5 -3
- package/modules/Api/endpoints/MFAComposable.ts +19 -0
- package/modules/Api/index.ts +4 -1
- package/modules/Api/types/endpoints/customer/customer.interfaces.ts +2 -10
- package/modules/Api/types/endpoints/mfa/mfa.interfaces.ts +22 -0
- package/modules/Api/types/index.ts +4 -2
- package/package.json +1 -1
|
@@ -39,7 +39,8 @@ import type {
|
|
|
39
39
|
CustomerWishlistSortFields,
|
|
40
40
|
CustomerListWishlistResponse,
|
|
41
41
|
CustomerDetailWishlistResponse,
|
|
42
|
-
AddProductToWishlistRequest
|
|
42
|
+
AddProductToWishlistRequest,
|
|
43
|
+
RequestSendMFA
|
|
43
44
|
} from '../types';
|
|
44
45
|
|
|
45
46
|
export function detail(
|
|
@@ -309,8 +310,9 @@ export function addProductToWishlist(payload: AddProductToWishlistRequest) {
|
|
|
309
310
|
}
|
|
310
311
|
|
|
311
312
|
export function removeProductToWishlist(wishlistId: number, productId: number) {
|
|
312
|
-
|
|
313
|
+
return usePublicApi<true>({
|
|
313
314
|
endpoint: `/customer/wish-list/${wishlistId}/product/${productId}`,
|
|
314
315
|
method: 'DELETE'
|
|
315
316
|
});
|
|
316
|
-
}
|
|
317
|
+
}
|
|
318
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import { RequestConfirmMFA, RequestSendMFA } from "../types";
|
|
4
|
+
|
|
5
|
+
export function sendMfa(payload: RequestSendMFA) {
|
|
6
|
+
return usePublicApi<true>({
|
|
7
|
+
endpoint: '/customer/login/mfa/send',
|
|
8
|
+
method: 'POST',
|
|
9
|
+
payload
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function confirmMfa(payload: RequestConfirmMFA) {
|
|
14
|
+
return usePublicApi<true>({
|
|
15
|
+
endpoint: '/customer/login/mfa/send',
|
|
16
|
+
method: 'POST',
|
|
17
|
+
payload
|
|
18
|
+
});
|
|
19
|
+
}
|
package/modules/Api/index.ts
CHANGED
|
@@ -81,6 +81,8 @@ import { upsells } from './endpoints/UpsellComposable'
|
|
|
81
81
|
import { contact } from './endpoints/PublicComposable'
|
|
82
82
|
import { oauthRedirect } from './endpoints/ThirdPartyComposable';
|
|
83
83
|
|
|
84
|
+
import { sendMfa } from './endpoints/MFAComposable';
|
|
85
|
+
|
|
84
86
|
|
|
85
87
|
import { usePublicApi } from './usePublicApi';
|
|
86
88
|
|
|
@@ -129,7 +131,8 @@ const customer = {
|
|
|
129
131
|
listWishlist,
|
|
130
132
|
detailWishlist,
|
|
131
133
|
addProductToWishlist,
|
|
132
|
-
removeProductToWishlist
|
|
134
|
+
removeProductToWishlist,
|
|
135
|
+
sendMfa
|
|
133
136
|
};
|
|
134
137
|
|
|
135
138
|
const cart = {
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
SimpleProduct,
|
|
10
10
|
Discount,
|
|
11
11
|
Product,
|
|
12
|
+
MFAOption,
|
|
12
13
|
} from '../..';
|
|
13
14
|
import type { PickupPoint } from '../shipment/shipment.interfaces';
|
|
14
15
|
|
|
@@ -56,16 +57,7 @@ export interface SigninCustomerByDocument {
|
|
|
56
57
|
password: string;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
type: 'email' | 'sms' | 'app';
|
|
61
|
-
id: number;
|
|
62
|
-
label: string;
|
|
63
|
-
settings: Array<never> | {
|
|
64
|
-
otpauth: string;
|
|
65
|
-
qrCode: string;
|
|
66
|
-
secretKey: string;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
60
|
+
|
|
69
61
|
|
|
70
62
|
export interface ResponseSigninCustomer {
|
|
71
63
|
mfaToken?: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface RequestSendMFA {
|
|
2
|
+
mfaToken: string;
|
|
3
|
+
mfaOptionId: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface RequestConfirmMFA {
|
|
7
|
+
mfaToken: string;
|
|
8
|
+
mfaOptionId: number;
|
|
9
|
+
code: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MFAOption {
|
|
13
|
+
type: 'email' | 'sms' | 'app';
|
|
14
|
+
id: number;
|
|
15
|
+
label: string;
|
|
16
|
+
settings: Array<never> | {
|
|
17
|
+
otpauth: string;
|
|
18
|
+
qrCode: string;
|
|
19
|
+
secretKey: string;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
@@ -106,8 +106,7 @@ import type {
|
|
|
106
106
|
CustomerListWishlistResponse,
|
|
107
107
|
AddProductToWishlistRequest,
|
|
108
108
|
AfterPointSystem,
|
|
109
|
-
Wishlist
|
|
110
|
-
MFAOption
|
|
109
|
+
Wishlist
|
|
111
110
|
} from './endpoints/customer/customer.interfaces';
|
|
112
111
|
import type {
|
|
113
112
|
CustomerGender,
|
|
@@ -238,6 +237,7 @@ import type { PriceRule } from './endpoints/price/price.interfaces';
|
|
|
238
237
|
|
|
239
238
|
import type { RedirectRequest, OauthType } from './endpoints/third-party/oauth.interfaces';
|
|
240
239
|
|
|
240
|
+
import type { MFAOption, RequestSendMFA, RequestConfirmMFA } from './endpoints/mfa/mfa.interfaces'
|
|
241
241
|
export type {
|
|
242
242
|
// Config da useApi
|
|
243
243
|
ApiResponse,
|
|
@@ -459,6 +459,8 @@ export type {
|
|
|
459
459
|
AfterPointSystem,
|
|
460
460
|
Wishlist,
|
|
461
461
|
MFAOption,
|
|
462
|
+
RequestSendMFA,
|
|
463
|
+
RequestConfirmMFA,
|
|
462
464
|
|
|
463
465
|
// Order
|
|
464
466
|
Order,
|