@uappi/public-sdk 1.1.36 → 1.1.38
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, RequestLoginMFA, RequestSendMFA } from "../types";
|
|
3
|
+
import { RequestConfirmMFA, RequestLoginMFA, RequestSendMFA, ResponseMFASetup } from "../types";
|
|
4
4
|
|
|
5
5
|
export function sendMfa(payload: RequestSendMFA) {
|
|
6
6
|
return usePublicApi<true>({
|
|
@@ -25,3 +25,20 @@ export function loginMfa(payload: RequestLoginMFA) {
|
|
|
25
25
|
payload
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
export function mfaSetup(force: boolean) {
|
|
30
|
+
return usePublicApi<ResponseMFASetup>({
|
|
31
|
+
endpoint: '/customer/mfa/app/setup',
|
|
32
|
+
method: 'GET',
|
|
33
|
+
payload: {
|
|
34
|
+
force
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function deleteMFA() {
|
|
40
|
+
return usePublicApi<ResponseMFASetup>({
|
|
41
|
+
endpoint: '/customer/mfa/app/setup',
|
|
42
|
+
method: 'DELETE'
|
|
43
|
+
});
|
|
44
|
+
}
|
package/modules/Api/index.ts
CHANGED
|
@@ -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, loginMfa } from './endpoints/MFAComposable';
|
|
84
|
+
import { sendMfa, confirmMfa, loginMfa, deleteMFA, mfaSetup } from './endpoints/MFAComposable';
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
import { usePublicApi } from './usePublicApi';
|
|
@@ -134,7 +134,9 @@ const customer = {
|
|
|
134
134
|
removeProductToWishlist,
|
|
135
135
|
sendMfa,
|
|
136
136
|
confirmMfa,
|
|
137
|
-
loginMfa
|
|
137
|
+
loginMfa,
|
|
138
|
+
deleteMFA,
|
|
139
|
+
mfaSetup
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
const cart = {
|
|
@@ -23,7 +23,7 @@ export interface RequestLoginMFA {
|
|
|
23
23
|
secretKey?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export type CustomerMFAErrorCode = 'UAPPI_STORE_CUSTOMER_MFA_CODE_INVALID' | 'UAPPI_STORE_CUSTOMER_MFA_CODE_ATTEMPTS_EXCEEDED'
|
|
26
|
+
export type CustomerMFAErrorCode = 'UAPPI_STORE_CUSTOMER_MFA_CODE_INVALID' | 'UAPPI_STORE_CUSTOMER_MFA_CODE_ATTEMPTS_EXCEEDED' | 'UAPPI_STORE_CUSTOMER_MFA_APP_SETUP_DISABLED';
|
|
27
27
|
|
|
28
28
|
export interface MFAAPPSettings {
|
|
29
29
|
otpauth: string;
|
|
@@ -38,3 +38,13 @@ export interface MFAEmailSettings {
|
|
|
38
38
|
export interface MFAPhoneSettings {
|
|
39
39
|
phone: string;
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export interface RequestMFASetup {
|
|
44
|
+
force: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ResponseMFASetup {
|
|
48
|
+
mfaToken: string;
|
|
49
|
+
options: Array<MFAOption>;
|
|
50
|
+
}
|
|
@@ -245,7 +245,9 @@ import type {
|
|
|
245
245
|
MFAEmailSettings,
|
|
246
246
|
MFAPhoneSettings,
|
|
247
247
|
RequestLoginMFA,
|
|
248
|
-
CustomerMFAErrorCode
|
|
248
|
+
CustomerMFAErrorCode,
|
|
249
|
+
RequestMFASetup,
|
|
250
|
+
ResponseMFASetup
|
|
249
251
|
} from './endpoints/mfa/mfa.interfaces';
|
|
250
252
|
|
|
251
253
|
export type {
|
|
@@ -476,6 +478,8 @@ export type {
|
|
|
476
478
|
MFAPhoneSettings,
|
|
477
479
|
RequestLoginMFA,
|
|
478
480
|
CustomerMFAErrorCode,
|
|
481
|
+
RequestMFASetup,
|
|
482
|
+
ResponseMFASetup,
|
|
479
483
|
|
|
480
484
|
// Order
|
|
481
485
|
Order,
|