@uappi/public-sdk 1.2.9 → 1.3.0
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/.gitlab-ci.yml +43 -0
- package/.vscode/extensions.json +4 -4
- package/.vscode/settings.json +6 -6
- package/README.md +67 -0
- package/components/Animations/ExpandTransition.ts +89 -89
- package/components/Animations/index.ts +1 -1
- package/components/ColorTheme/ColorTheme.ts +80 -80
- package/components/ColorTheme/index.ts +1 -1
- package/components/ColorTheme/types.ts +18 -18
- package/components/SocialAuth/FacebookAuth/types.ts +2 -2
- package/components/SocialAuth/GoogleAuth/types.ts +2 -2
- package/components/SocialAuth/index.ts +1 -1
- package/components/index.ts +2 -2
- package/main.ts +4 -4
- package/modules/Api/README.md +479 -469
- package/modules/Api/endpoints/CategoryComposable.ts +15 -0
- package/modules/Api/endpoints/CommonComposable.ts +24 -24
- package/modules/Api/endpoints/CouponComposable.ts +18 -18
- package/modules/Api/endpoints/LoggoutComposable.ts +8 -8
- package/modules/Api/endpoints/MFAComposable.ts +43 -43
- package/modules/Api/endpoints/PaymentComposable.ts +14 -14
- package/modules/Api/endpoints/PublicComposable.ts +8 -8
- package/modules/Api/endpoints/TemplateComposable.ts +7 -7
- package/modules/Api/endpoints/ThirdPartyComposable.ts +13 -13
- package/modules/Api/endpoints/UpsellComposable.ts +17 -17
- package/modules/Api/endpoints/VerifyComposable.ts +7 -7
- package/modules/Api/endpoints/WalletComposable.ts +36 -36
- package/modules/Api/index.ts +3 -0
- package/modules/Api/paramsSerializer/encodeWafNormalizer.ts +7 -7
- package/modules/Api/types/endpoints/cart/cart.interfaces.ts +161 -161
- package/modules/Api/types/endpoints/cart/cart.types.ts +27 -27
- package/modules/Api/types/endpoints/category/category.interfaces.ts +16 -0
- package/modules/Api/types/endpoints/common/common.interfaces.ts +21 -21
- package/modules/Api/types/endpoints/country/country.types.ts +7502 -7502
- package/modules/Api/types/endpoints/coupon/coupon.interfaces.ts +13 -13
- package/modules/Api/types/endpoints/discounts/discounts.interfaces.ts +9 -9
- package/modules/Api/types/endpoints/mfa/mfa.interfaces.ts +51 -51
- package/modules/Api/types/endpoints/payment/payment.interfaces.ts +103 -103
- package/modules/Api/types/endpoints/payment/payment.types.ts +27 -27
- package/modules/Api/types/endpoints/price/price.interfaces.ts +21 -21
- package/modules/Api/types/endpoints/template/template.interfaces.ts +29 -29
- package/modules/Api/types/endpoints/third-party/oauth.interfaces.ts +5 -5
- package/modules/Api/types/endpoints/upsell/upsell.interfaces.ts +12 -12
- package/modules/Api/types/endpoints/wallet/wallet-obsearch.ts +8 -8
- package/modules/Api/types/endpoints/wallet/wallet.interfaces.ts +57 -57
- package/modules/Api/types/endpoints/zipcode/zipcode.interfaces.ts +23 -23
- package/modules/Api/types/index.ts +514 -504
- package/modules/Tracking/endpoints/CartComposable.ts +75 -75
- package/modules/Tracking/endpoints/CustomerComposable.ts +71 -71
- package/modules/Tracking/endpoints/types.ts +11 -11
- package/modules/Tracking/events/actions/addPaymentInfo.ts +31 -31
- package/modules/Tracking/events/actions/addShippingInfo.ts +27 -27
- package/modules/Tracking/events/actions/addToCart.ts +35 -35
- package/modules/Tracking/events/actions/beginCheckout.ts +28 -28
- package/modules/Tracking/events/actions/customerProfile.ts +36 -36
- package/modules/Tracking/events/actions/generateLead.ts +12 -12
- package/modules/Tracking/events/actions/login.ts +8 -8
- package/modules/Tracking/events/actions/purchase.ts +42 -42
- package/modules/Tracking/events/actions/removeFromCart.ts +52 -52
- package/modules/Tracking/events/actions/search.ts +8 -8
- package/modules/Tracking/events/actions/selectItem.ts +64 -64
- package/modules/Tracking/events/actions/selectPromotion.ts +24 -24
- package/modules/Tracking/events/actions/shippingCalculation.ts +7 -7
- package/modules/Tracking/events/actions/signup.ts +8 -8
- package/modules/Tracking/events/actions/upsertToCart.ts +62 -62
- package/modules/Tracking/events/views/viewCart.ts +28 -28
- package/modules/Tracking/events/views/viewHome.ts +5 -5
- package/modules/Tracking/events/views/viewItem.ts +31 -31
- package/modules/Tracking/events/views/viewItemList.ts +65 -65
- package/modules/Tracking/events/views/viewNotFound.ts +5 -5
- package/modules/Tracking/events/views/viewOther.ts +5 -5
- package/modules/Tracking/events/views/viewPayment.ts +7 -7
- package/modules/Tracking/events/views/viewPromotion.ts +28 -28
- package/modules/Tracking/events/views/viewShipping.ts +7 -7
- package/modules/Tracking/index.ts +84 -84
- package/modules/Tracking/publicApiTracking.ts +35 -35
- package/modules/Tracking/types/actions/add-payment-info.interfaces.ts +12 -12
- package/modules/Tracking/types/actions/add-shipping-info.interfaces.ts +11 -11
- package/modules/Tracking/types/actions/add-to-cart.interfaces.ts +10 -10
- package/modules/Tracking/types/actions/begin-checkout.interfaces.ts +12 -12
- package/modules/Tracking/types/actions/customer-profile.interfaces.ts +19 -19
- package/modules/Tracking/types/actions/file-download.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/generate-lead.interfaces.ts +12 -12
- package/modules/Tracking/types/actions/login.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/purchase.interfaces.ts +18 -18
- package/modules/Tracking/types/actions/remove-from-cart.interfaces.ts +10 -10
- package/modules/Tracking/types/actions/search.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/select-item.interfaces.ts +16 -16
- package/modules/Tracking/types/actions/select-promotion.interfaces.ts +8 -8
- package/modules/Tracking/types/actions/share.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/shipping-calculation.interfaces.ts +3 -3
- package/modules/Tracking/types/actions/signup.interfaces.ts +4 -4
- package/modules/Tracking/types/event.types.ts +54 -54
- package/modules/Tracking/types/index.ts +37 -37
- package/modules/Tracking/types/item.interfaces.ts +30 -30
- package/modules/Tracking/types/views/view-cart.interfaces.ts +11 -11
- package/modules/Tracking/types/views/view-home.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-item-list.interfaces.ts +11 -11
- package/modules/Tracking/types/views/view-item.interfaces.ts +15 -15
- package/modules/Tracking/types/views/view-not-found.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-other.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-payment.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-promotion.interfaces.ts +8 -8
- package/modules/Tracking/types/views/view-shipping.interfaces.ts +3 -3
- package/modules/Tracking/utils/cart.ts +100 -100
- package/modules/Tracking/utils/pushDatalayer.ts +7 -7
- package/modules/index.ts +1 -1
- package/package.json +2 -3
- package/scripts/release.sh +34 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type { CategoryTree, CategoryTreeItem } from '../types';
|
|
4
|
+
|
|
5
|
+
export function getCategoryTree(categoryId: number) {
|
|
6
|
+
return usePublicApi<CategoryTree>({
|
|
7
|
+
endpoint: `/publics/products/categories/${categoryId}/tree`,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function listCategoriesTree() {
|
|
12
|
+
return usePublicApi<Array<CategoryTreeItem>>({
|
|
13
|
+
endpoint: '/publics/products/categories/tree',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type { CardFlags, CountryAlpha3, CountryResponse } from '../types';
|
|
4
|
-
|
|
5
|
-
export function listContries() {
|
|
6
|
-
return usePublicApi<Array<CountryResponse>>({
|
|
7
|
-
method: 'GET',
|
|
8
|
-
endpoint: '/common/countries',
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function countryDetail(code: CountryAlpha3) {
|
|
13
|
-
return usePublicApi<CountryResponse>({
|
|
14
|
-
method: 'GET',
|
|
15
|
-
endpoint: `/common/country/${code}`,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function listCardFlags() {
|
|
20
|
-
return usePublicApi<CardFlags>({
|
|
21
|
-
method: 'GET',
|
|
22
|
-
endpoint: '/publics/payments/card-flags',
|
|
23
|
-
});
|
|
24
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type { CardFlags, CountryAlpha3, CountryResponse } from '../types';
|
|
4
|
+
|
|
5
|
+
export function listContries() {
|
|
6
|
+
return usePublicApi<Array<CountryResponse>>({
|
|
7
|
+
method: 'GET',
|
|
8
|
+
endpoint: '/common/countries',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function countryDetail(code: CountryAlpha3) {
|
|
13
|
+
return usePublicApi<CountryResponse>({
|
|
14
|
+
method: 'GET',
|
|
15
|
+
endpoint: `/common/country/${code}`,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function listCardFlags() {
|
|
20
|
+
return usePublicApi<CardFlags>({
|
|
21
|
+
method: 'GET',
|
|
22
|
+
endpoint: '/publics/payments/card-flags',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type { AddCouponRequest, CartResponse } from '../types';
|
|
4
|
-
|
|
5
|
-
export function addCoupon(payload: AddCouponRequest) {
|
|
6
|
-
return usePublicApi<CartResponse>({
|
|
7
|
-
endpoint: '/cart/promotionals/coupon',
|
|
8
|
-
method: 'PUT',
|
|
9
|
-
payload,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function deleteCoupon() {
|
|
14
|
-
return usePublicApi<CartResponse>({
|
|
15
|
-
endpoint: '/cart/promotionals/coupon',
|
|
16
|
-
method: 'DELETE',
|
|
17
|
-
});
|
|
18
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type { AddCouponRequest, CartResponse } from '../types';
|
|
4
|
+
|
|
5
|
+
export function addCoupon(payload: AddCouponRequest) {
|
|
6
|
+
return usePublicApi<CartResponse>({
|
|
7
|
+
endpoint: '/cart/promotionals/coupon',
|
|
8
|
+
method: 'PUT',
|
|
9
|
+
payload,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function deleteCoupon() {
|
|
14
|
+
return usePublicApi<CartResponse>({
|
|
15
|
+
endpoint: '/cart/promotionals/coupon',
|
|
16
|
+
method: 'DELETE',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
export function loggout() {
|
|
4
|
-
return usePublicApi<boolean>({
|
|
5
|
-
method: 'DELETE',
|
|
6
|
-
endpoint: '/logout',
|
|
7
|
-
});
|
|
8
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
export function loggout() {
|
|
4
|
+
return usePublicApi<boolean>({
|
|
5
|
+
method: 'DELETE',
|
|
6
|
+
endpoint: '/logout',
|
|
7
|
+
});
|
|
8
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type { RequestConfirmMFA, RequestLoginMFA, RequestSendMFA, ResponseMFASetup } 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/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',
|
|
24
|
-
method: 'POST',
|
|
25
|
-
payload
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function mfaSetup(force: boolean) {
|
|
30
|
-
return usePublicApi<ResponseMFASetup>({
|
|
31
|
-
endpoint: '/customer/mfa/app/setup',
|
|
32
|
-
params: {
|
|
33
|
-
force
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function deleteMFA() {
|
|
39
|
-
return usePublicApi<ResponseMFASetup>({
|
|
40
|
-
endpoint: '/customer/mfa/app/setup',
|
|
41
|
-
method: 'DELETE'
|
|
42
|
-
});
|
|
43
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type { RequestConfirmMFA, RequestLoginMFA, RequestSendMFA, ResponseMFASetup } 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/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',
|
|
24
|
+
method: 'POST',
|
|
25
|
+
payload
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function mfaSetup(force: boolean) {
|
|
30
|
+
return usePublicApi<ResponseMFASetup>({
|
|
31
|
+
endpoint: '/customer/mfa/app/setup',
|
|
32
|
+
params: {
|
|
33
|
+
force
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function deleteMFA() {
|
|
39
|
+
return usePublicApi<ResponseMFASetup>({
|
|
40
|
+
endpoint: '/customer/mfa/app/setup',
|
|
41
|
+
method: 'DELETE'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
PaymentConditionsRequest,
|
|
5
|
-
PaymentConditionsResponse,
|
|
6
|
-
} from '../types';
|
|
7
|
-
|
|
8
|
-
export function paymentConditions(payload: PaymentConditionsRequest) {
|
|
9
|
-
return usePublicApi<PaymentConditionsResponse>({
|
|
10
|
-
endpoint: '/publics/payments/conditions',
|
|
11
|
-
method: 'POST',
|
|
12
|
-
payload,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
PaymentConditionsRequest,
|
|
5
|
+
PaymentConditionsResponse,
|
|
6
|
+
} from '../types';
|
|
7
|
+
|
|
8
|
+
export function paymentConditions(payload: PaymentConditionsRequest) {
|
|
9
|
+
return usePublicApi<PaymentConditionsResponse>({
|
|
10
|
+
endpoint: '/publics/payments/conditions',
|
|
11
|
+
method: 'POST',
|
|
12
|
+
payload,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { usePublicApi } from "..";
|
|
2
|
-
|
|
3
|
-
export function contact<D>(payload: D) {
|
|
4
|
-
return usePublicApi<boolean, D>({
|
|
5
|
-
endpoint: '/publics/contact-center',
|
|
6
|
-
method: 'POST',
|
|
7
|
-
payload
|
|
8
|
-
});
|
|
1
|
+
import { usePublicApi } from "..";
|
|
2
|
+
|
|
3
|
+
export function contact<D>(payload: D) {
|
|
4
|
+
return usePublicApi<boolean, D>({
|
|
5
|
+
endpoint: '/publics/contact-center',
|
|
6
|
+
method: 'POST',
|
|
7
|
+
payload
|
|
8
|
+
});
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
import type { TemplateResponse } from "../types";
|
|
3
|
-
|
|
4
|
-
export function listTemplateSettings<Setting>(uri: string) {
|
|
5
|
-
return usePublicApi<TemplateResponse<Setting>>({
|
|
6
|
-
endpoint: `/publics/template/custom-settings?uri=${uri}`,
|
|
7
|
-
});
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
import type { TemplateResponse } from "../types";
|
|
3
|
+
|
|
4
|
+
export function listTemplateSettings<Setting>(uri: string) {
|
|
5
|
+
return usePublicApi<TemplateResponse<Setting>>({
|
|
6
|
+
endpoint: `/publics/template/custom-settings?uri=${uri}`,
|
|
7
|
+
});
|
|
8
8
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
RedirectRequest,
|
|
5
|
-
OauthType,
|
|
6
|
-
} from '../types';
|
|
7
|
-
|
|
8
|
-
export function oauthRedirect(type: OauthType, payload: RedirectRequest) {
|
|
9
|
-
return usePublicApi<string, RedirectRequest>({
|
|
10
|
-
endpoint: `/third-party/${type}/oauth/redirect`,
|
|
11
|
-
method: 'GET',
|
|
12
|
-
params: payload,
|
|
13
|
-
});
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
RedirectRequest,
|
|
5
|
+
OauthType,
|
|
6
|
+
} from '../types';
|
|
7
|
+
|
|
8
|
+
export function oauthRedirect(type: OauthType, payload: RedirectRequest) {
|
|
9
|
+
return usePublicApi<string, RedirectRequest>({
|
|
10
|
+
endpoint: `/third-party/${type}/oauth/redirect`,
|
|
11
|
+
method: 'GET',
|
|
12
|
+
params: payload,
|
|
13
|
+
});
|
|
14
14
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
ApiParams,
|
|
5
|
-
ProductFields,
|
|
6
|
-
UpsellResponse,
|
|
7
|
-
} from '../types';
|
|
8
|
-
|
|
9
|
-
export function upsells(
|
|
10
|
-
location: string,
|
|
11
|
-
options?: Pick<ApiParams<ProductFields>, 'fields'>,
|
|
12
|
-
) {
|
|
13
|
-
return usePublicApi<UpsellResponse, ProductFields>({
|
|
14
|
-
endpoint: `/cart/upsell/${location}`,
|
|
15
|
-
params: options,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ApiParams,
|
|
5
|
+
ProductFields,
|
|
6
|
+
UpsellResponse,
|
|
7
|
+
} from '../types';
|
|
8
|
+
|
|
9
|
+
export function upsells(
|
|
10
|
+
location: string,
|
|
11
|
+
options?: Pick<ApiParams<ProductFields>, 'fields'>,
|
|
12
|
+
) {
|
|
13
|
+
return usePublicApi<UpsellResponse, ProductFields>({
|
|
14
|
+
endpoint: `/cart/upsell/${location}`,
|
|
15
|
+
params: options,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
export function getVerify(path: string,) {
|
|
4
|
-
return usePublicApi<'brand' | 'category' | 'page' | 'product' | 'redirect'>({
|
|
5
|
-
endpoint: `/api/v3/publics/url/verify?url=${path}`
|
|
6
|
-
});
|
|
7
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
export function getVerify(path: string,) {
|
|
4
|
+
return usePublicApi<'brand' | 'category' | 'page' | 'product' | 'redirect'>({
|
|
5
|
+
endpoint: `/api/v3/publics/url/verify?url=${path}`
|
|
6
|
+
});
|
|
7
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { usePublicApi } from '..';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
ApiParams,
|
|
5
|
-
ClaimGiftCardRequest,
|
|
6
|
-
ClaimGiftCardResponse,
|
|
7
|
-
WalletConditionFields,
|
|
8
|
-
WalletSortFields,
|
|
9
|
-
WalletTransactionResponse,
|
|
10
|
-
} from '../types';
|
|
11
|
-
|
|
12
|
-
export function listWalletTransaction(
|
|
13
|
-
options?: Pick<
|
|
14
|
-
ApiParams<'', WalletSortFields, WalletConditionFields>,
|
|
15
|
-
'condition' | 'order' | 'limit' | 'offset'
|
|
16
|
-
>,
|
|
17
|
-
) {
|
|
18
|
-
return usePublicApi<
|
|
19
|
-
WalletTransactionResponse,
|
|
20
|
-
'',
|
|
21
|
-
WalletSortFields,
|
|
22
|
-
WalletConditionFields
|
|
23
|
-
>({
|
|
24
|
-
endpoint: '/customer/wallet/transaction',
|
|
25
|
-
method: 'GET',
|
|
26
|
-
params: options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function claimGiftCard(payload: ClaimGiftCardRequest) {
|
|
31
|
-
return usePublicApi<ClaimGiftCardResponse>({
|
|
32
|
-
endpoint: '/customer/gift-cards/link',
|
|
33
|
-
method: 'POST',
|
|
34
|
-
payload,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
1
|
+
import { usePublicApi } from '..';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ApiParams,
|
|
5
|
+
ClaimGiftCardRequest,
|
|
6
|
+
ClaimGiftCardResponse,
|
|
7
|
+
WalletConditionFields,
|
|
8
|
+
WalletSortFields,
|
|
9
|
+
WalletTransactionResponse,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
export function listWalletTransaction(
|
|
13
|
+
options?: Pick<
|
|
14
|
+
ApiParams<'', WalletSortFields, WalletConditionFields>,
|
|
15
|
+
'condition' | 'order' | 'limit' | 'offset'
|
|
16
|
+
>,
|
|
17
|
+
) {
|
|
18
|
+
return usePublicApi<
|
|
19
|
+
WalletTransactionResponse,
|
|
20
|
+
'',
|
|
21
|
+
WalletSortFields,
|
|
22
|
+
WalletConditionFields
|
|
23
|
+
>({
|
|
24
|
+
endpoint: '/customer/wallet/transaction',
|
|
25
|
+
method: 'GET',
|
|
26
|
+
params: options,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function claimGiftCard(payload: ClaimGiftCardRequest) {
|
|
31
|
+
return usePublicApi<ClaimGiftCardResponse>({
|
|
32
|
+
endpoint: '/customer/gift-cards/link',
|
|
33
|
+
method: 'POST',
|
|
34
|
+
payload,
|
|
35
|
+
});
|
|
36
|
+
}
|
package/modules/Api/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { listBanners } from './endpoints/BannerComposable';
|
|
2
2
|
import { listBrands } from './endpoints/BrandComposable';
|
|
3
|
+
import { getCategoryTree, listCategoriesTree } from './endpoints/CategoryComposable';
|
|
3
4
|
import {
|
|
4
5
|
addProduct,
|
|
5
6
|
deleteProduct,
|
|
@@ -168,6 +169,8 @@ const product = {
|
|
|
168
169
|
deleteProductComment,
|
|
169
170
|
createProductComment,
|
|
170
171
|
listProductComments,
|
|
172
|
+
getCategoryTree,
|
|
173
|
+
listCategoriesTree,
|
|
171
174
|
};
|
|
172
175
|
|
|
173
176
|
const common = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalizador de parametros/filtros para transpassar a regra EVA081 do Sucuri Web Firewall
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export function encodeWafNormalizer(param: string) {
|
|
6
|
-
return String(param).replace(/\[/g, '_:').replace(/\]/g, ':_');
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Normalizador de parametros/filtros para transpassar a regra EVA081 do Sucuri Web Firewall
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export function encodeWafNormalizer(param: string) {
|
|
6
|
+
return String(param).replace(/\[/g, '_:').replace(/\]/g, ':_');
|
|
7
|
+
}
|