@uappi/public-sdk 1.0.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/.editorconfig +6 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +7 -0
- package/components/Animations/ExpandTransition.ts +89 -0
- package/components/Animations/index.ts +1 -0
- package/components/Themes/CustomTheme.ts +77 -0
- package/components/Themes/index.ts +1 -0
- package/main.ts +16 -0
- package/modules/Api/README.md +469 -0
- package/modules/Api/endpoints/BannerComposable.ts +31 -0
- package/modules/Api/endpoints/BrandComposable.ts +21 -0
- package/modules/Api/endpoints/CartComposable.ts +121 -0
- package/modules/Api/endpoints/CommonComposable.ts +24 -0
- package/modules/Api/endpoints/CouponComposable.ts +18 -0
- package/modules/Api/endpoints/CustomerComposable.ts +255 -0
- package/modules/Api/endpoints/InterestComposable.ts +11 -0
- package/modules/Api/endpoints/LoggoutComposable.ts +8 -0
- package/modules/Api/endpoints/MenuComposable.ts +25 -0
- package/modules/Api/endpoints/PairOfferComposable.ts +14 -0
- package/modules/Api/endpoints/PaymentComposable.ts +14 -0
- package/modules/Api/endpoints/ProductCommentComposable.ts +51 -0
- package/modules/Api/endpoints/ProductQuoteShipment.ts +20 -0
- package/modules/Api/endpoints/PublicComposable.ts +9 -0
- package/modules/Api/endpoints/ReviewComposable.ts +64 -0
- package/modules/Api/endpoints/SearchComposable.ts +27 -0
- package/modules/Api/endpoints/ShowcaseComposable.ts +45 -0
- package/modules/Api/endpoints/TemplateComposable.ts +8 -0
- package/modules/Api/endpoints/ThirdPartyComposable.ts +14 -0
- package/modules/Api/endpoints/UpsellComposable.ts +18 -0
- package/modules/Api/endpoints/UrlComposable.ts +26 -0
- package/modules/Api/endpoints/VariationComposable.ts +36 -0
- package/modules/Api/endpoints/WalletComposable.ts +36 -0
- package/modules/Api/endpoints/ZipcodeComposable.ts +10 -0
- package/modules/Api/index.ts +194 -0
- package/modules/Api/paramsSerializer/encodeWafNormalizer.ts +7 -0
- package/modules/Api/types/context/api-config.types.ts +68 -0
- package/modules/Api/types/context/api-params.types.ts +74 -0
- package/modules/Api/types/endpoints/attribute/attribute.interfaces.ts +42 -0
- package/modules/Api/types/endpoints/banner/banner.interfaces.ts +45 -0
- package/modules/Api/types/endpoints/brand/brand-field.types.ts +3 -0
- package/modules/Api/types/endpoints/brand/brand.interfaces.ts +23 -0
- package/modules/Api/types/endpoints/cart/cart.interfaces.ts +161 -0
- package/modules/Api/types/endpoints/cart/cart.types.ts +27 -0
- package/modules/Api/types/endpoints/common/common.interfaces.ts +21 -0
- package/modules/Api/types/endpoints/context/context.types.ts +1 -0
- package/modules/Api/types/endpoints/country/country.types.ts +7502 -0
- package/modules/Api/types/endpoints/coupon/coupon.interfaces.ts +13 -0
- package/modules/Api/types/endpoints/customer/customer-erros.ts +13 -0
- package/modules/Api/types/endpoints/customer/customer-obsearch.ts +103 -0
- package/modules/Api/types/endpoints/customer/customer.interfaces.ts +448 -0
- package/modules/Api/types/endpoints/customer/customer.types.ts +3 -0
- package/modules/Api/types/endpoints/description/description.interfaces.ts +30 -0
- package/modules/Api/types/endpoints/discounts/discounts.interfaces.ts +9 -0
- package/modules/Api/types/endpoints/discounts/discounts.types.ts +5 -0
- package/modules/Api/types/endpoints/filters/filter.type.ts +1 -0
- package/modules/Api/types/endpoints/filters/filters.interfaces.ts +26 -0
- package/modules/Api/types/endpoints/interest/interest.interfaces.ts +22 -0
- package/modules/Api/types/endpoints/media/media.interfaces.ts +13 -0
- package/modules/Api/types/endpoints/menu/menu.enums.ts +8 -0
- package/modules/Api/types/endpoints/menu/menu.interfaces.ts +26 -0
- package/modules/Api/types/endpoints/order/order.interfaces.ts +63 -0
- package/modules/Api/types/endpoints/page/page.interfaces.ts +15 -0
- package/modules/Api/types/endpoints/pagination/pagination.interfaces.ts +6 -0
- package/modules/Api/types/endpoints/pair-offer/pair-offer.interfaces.ts +19 -0
- package/modules/Api/types/endpoints/payment/payment.interfaces.ts +103 -0
- package/modules/Api/types/endpoints/payment/payment.types.ts +27 -0
- package/modules/Api/types/endpoints/price/price.interfaces.ts +22 -0
- package/modules/Api/types/endpoints/product/product-obsearch.types.ts +63 -0
- package/modules/Api/types/endpoints/product/product.interfaces.ts +109 -0
- package/modules/Api/types/endpoints/product/product.types.ts +3 -0
- package/modules/Api/types/endpoints/product-comment/product-comment-obsearch.types.ts +24 -0
- package/modules/Api/types/endpoints/product-comment/product-comment.interfaces.ts +32 -0
- package/modules/Api/types/endpoints/redirect/redirect.interfaces.ts +7 -0
- package/modules/Api/types/endpoints/review/review-obsearch.types.ts +18 -0
- package/modules/Api/types/endpoints/review/review.interfaces.ts +34 -0
- package/modules/Api/types/endpoints/seal/seal.interfaces.ts +21 -0
- package/modules/Api/types/endpoints/seal/seal.types.ts +3 -0
- package/modules/Api/types/endpoints/search/search.interfaces.ts +11 -0
- package/modules/Api/types/endpoints/seo/seo.interfaces.ts +11 -0
- package/modules/Api/types/endpoints/shipment/shipment.interfaces.ts +137 -0
- package/modules/Api/types/endpoints/showcase/showcase.enums.ts +8 -0
- package/modules/Api/types/endpoints/showcase/showcase.interfaces.ts +10 -0
- package/modules/Api/types/endpoints/simple-product/simple-product.interfaces.ts +15 -0
- package/modules/Api/types/endpoints/storage/storage.interfaces.ts +16 -0
- package/modules/Api/types/endpoints/template/template.interfaces.ts +30 -0
- package/modules/Api/types/endpoints/third-party/oauth.interfaces.ts +6 -0
- package/modules/Api/types/endpoints/upsell/upsell.interfaces.ts +13 -0
- package/modules/Api/types/endpoints/url/url.interfaces.ts +85 -0
- package/modules/Api/types/endpoints/wallet/wallet-obsearch.ts +8 -0
- package/modules/Api/types/endpoints/wallet/wallet.interfaces.ts +57 -0
- package/modules/Api/types/endpoints/zipcode/zipcode.interfaces.ts +23 -0
- package/modules/Api/types/index.ts +459 -0
- package/modules/Api/usePublicApi.ts +68 -0
- package/modules/Tracking/endpoints/BannerComposable.ts +33 -0
- package/modules/Tracking/endpoints/CartComposable.ts +75 -0
- package/modules/Tracking/endpoints/CustomerComposable.ts +68 -0
- package/modules/Tracking/endpoints/ProductQuoteShipment.ts +14 -0
- package/modules/Tracking/endpoints/SearchComposable.ts +32 -0
- package/modules/Tracking/endpoints/ShowcaseComposable.ts +54 -0
- package/modules/Tracking/endpoints/UrlComposable.ts +41 -0
- package/modules/Tracking/endpoints/types.ts +11 -0
- package/modules/Tracking/events/actions/addPaymentInfo.ts +31 -0
- package/modules/Tracking/events/actions/addShippingInfo.ts +27 -0
- package/modules/Tracking/events/actions/addToCart.ts +35 -0
- package/modules/Tracking/events/actions/beginCheckout.ts +28 -0
- package/modules/Tracking/events/actions/customerProfile.ts +36 -0
- package/modules/Tracking/events/actions/generateLead.ts +12 -0
- package/modules/Tracking/events/actions/login.ts +8 -0
- package/modules/Tracking/events/actions/purchase.ts +42 -0
- package/modules/Tracking/events/actions/removeFromCart.ts +52 -0
- package/modules/Tracking/events/actions/search.ts +8 -0
- package/modules/Tracking/events/actions/selectItem.ts +64 -0
- package/modules/Tracking/events/actions/selectPromotion.ts +24 -0
- package/modules/Tracking/events/actions/shippingCalculation.ts +7 -0
- package/modules/Tracking/events/actions/signup.ts +8 -0
- package/modules/Tracking/events/actions/upsertToCart.ts +62 -0
- package/modules/Tracking/events/views/viewCart.ts +28 -0
- package/modules/Tracking/events/views/viewHome.ts +5 -0
- package/modules/Tracking/events/views/viewItem.ts +31 -0
- package/modules/Tracking/events/views/viewItemList.ts +65 -0
- package/modules/Tracking/events/views/viewNotFound.ts +5 -0
- package/modules/Tracking/events/views/viewOther.ts +5 -0
- package/modules/Tracking/events/views/viewPayment.ts +7 -0
- package/modules/Tracking/events/views/viewPromotion.ts +28 -0
- package/modules/Tracking/events/views/viewShipping.ts +7 -0
- package/modules/Tracking/index.ts +84 -0
- package/modules/Tracking/publicApiTracking.ts +36 -0
- package/modules/Tracking/types/actions/add-payment-info.interfaces.ts +12 -0
- package/modules/Tracking/types/actions/add-shipping-info.interfaces.ts +11 -0
- package/modules/Tracking/types/actions/add-to-cart.interfaces.ts +10 -0
- package/modules/Tracking/types/actions/begin-checkout.interfaces.ts +12 -0
- package/modules/Tracking/types/actions/customer-profile.interfaces.ts +19 -0
- package/modules/Tracking/types/actions/file-download.interfaces.ts +4 -0
- package/modules/Tracking/types/actions/generate-lead.interfaces.ts +12 -0
- package/modules/Tracking/types/actions/login.interfaces.ts +4 -0
- package/modules/Tracking/types/actions/purchase.interfaces.ts +18 -0
- package/modules/Tracking/types/actions/remove-from-cart.interfaces.ts +10 -0
- package/modules/Tracking/types/actions/search.interfaces.ts +4 -0
- package/modules/Tracking/types/actions/select-item.interfaces.ts +16 -0
- package/modules/Tracking/types/actions/select-promotion.interfaces.ts +8 -0
- package/modules/Tracking/types/actions/share.interfaces.ts +4 -0
- package/modules/Tracking/types/actions/shipping-calculation.interfaces.ts +3 -0
- package/modules/Tracking/types/actions/signup.interfaces.ts +4 -0
- package/modules/Tracking/types/event.types.ts +54 -0
- package/modules/Tracking/types/index.ts +37 -0
- package/modules/Tracking/types/item.interfaces.ts +30 -0
- package/modules/Tracking/types/views/view-cart.interfaces.ts +11 -0
- package/modules/Tracking/types/views/view-home.interfaces.ts +3 -0
- package/modules/Tracking/types/views/view-item-list.interfaces.ts +11 -0
- package/modules/Tracking/types/views/view-item.interfaces.ts +15 -0
- package/modules/Tracking/types/views/view-not-found.interfaces.ts +3 -0
- package/modules/Tracking/types/views/view-other.interfaces.ts +3 -0
- package/modules/Tracking/types/views/view-payment.interfaces.ts +3 -0
- package/modules/Tracking/types/views/view-promotion.interfaces.ts +8 -0
- package/modules/Tracking/types/views/view-shipping.interfaces.ts +3 -0
- package/modules/Tracking/utils/cart.ts +100 -0
- package/modules/Tracking/utils/pushDatalayer.ts +7 -0
- package/package.json +27 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getVariant } from '../../utils/cart';
|
|
2
|
+
import { pushDatalayer } from '../../utils/pushDatalayer';
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
Showcase,
|
|
6
|
+
UrlBrand,
|
|
7
|
+
UrlListing,
|
|
8
|
+
Search,
|
|
9
|
+
} from '../../api/types';
|
|
10
|
+
|
|
11
|
+
export function viewItemList(page: UrlBrand | UrlListing | Search): void;
|
|
12
|
+
export function viewItemList(page: Array<Showcase>): void;
|
|
13
|
+
|
|
14
|
+
export function viewItemList(
|
|
15
|
+
page: UrlBrand | UrlListing | Array<Showcase> | Search,
|
|
16
|
+
) {
|
|
17
|
+
if (Array.isArray(page)) {
|
|
18
|
+
page.map(showcase => {
|
|
19
|
+
pushDatalayer({
|
|
20
|
+
event: 'view_item_list',
|
|
21
|
+
ecommerce: {
|
|
22
|
+
currency: 'BRL',
|
|
23
|
+
item_list_id: showcase.name,
|
|
24
|
+
item_list_name: showcase.name,
|
|
25
|
+
items: showcase.products.map(showcaseProduct => {
|
|
26
|
+
return {
|
|
27
|
+
coupon: '',
|
|
28
|
+
item_brand: showcaseProduct.brand?.name || '',
|
|
29
|
+
item_category: showcaseProduct.mainCategory?.name || '',
|
|
30
|
+
item_id: showcaseProduct.id,
|
|
31
|
+
item_name: showcaseProduct.name,
|
|
32
|
+
item_variant: getVariant(showcaseProduct),
|
|
33
|
+
price: showcaseProduct.price?.salePrice || 0,
|
|
34
|
+
quantity: 1,
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
pushDatalayer({
|
|
44
|
+
event: 'view_item_list',
|
|
45
|
+
ecommerce: {
|
|
46
|
+
currency: 'BRL',
|
|
47
|
+
item_list_id:
|
|
48
|
+
page.type === 'search' ? 'Search Results' : page.entity.name,
|
|
49
|
+
item_list_name:
|
|
50
|
+
page.type === 'search' ? 'Search Results' : page.entity.name,
|
|
51
|
+
items: page.content.registers.map(pageItem => {
|
|
52
|
+
return {
|
|
53
|
+
coupon: '',
|
|
54
|
+
item_brand: pageItem.brand?.name || '',
|
|
55
|
+
item_category: pageItem.mainCategory?.name || '',
|
|
56
|
+
item_id: pageItem.id,
|
|
57
|
+
item_name: pageItem.name,
|
|
58
|
+
item_variant: getVariant(pageItem),
|
|
59
|
+
price: pageItem.price?.salePrice || 0,
|
|
60
|
+
quantity: 1,
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { pushDatalayer } from '../../utils/pushDatalayer';
|
|
2
|
+
|
|
3
|
+
import type { ViewPromotion } from '../../types';
|
|
4
|
+
import type { Banners } from '../../api/types';
|
|
5
|
+
|
|
6
|
+
export function viewPromotion<AdditionalParameters>(
|
|
7
|
+
bannerGroups: Array<Banners<AdditionalParameters>>,
|
|
8
|
+
) {
|
|
9
|
+
bannerGroups.forEach(bannerGroup => {
|
|
10
|
+
pushDatalayer({
|
|
11
|
+
event: 'view_promotion',
|
|
12
|
+
ecommerce: {
|
|
13
|
+
items: [
|
|
14
|
+
...bannerGroup.banners.map((banner, bannerIndex) => {
|
|
15
|
+
return {
|
|
16
|
+
promotion_id: banner.id,
|
|
17
|
+
promotion_name:
|
|
18
|
+
'Banners' as ViewPromotion['ecommerce']['items'][0]['promotion_name'],
|
|
19
|
+
creative_name: `${banner.scheduling?.startDate.slice(0, 10)}-${banner.name.replaceAll(' ', '-')}`,
|
|
20
|
+
creative_slot: bannerIndex + 1,
|
|
21
|
+
index: bannerIndex + 1,
|
|
22
|
+
};
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { listBanners } from './endpoints/BannerComposable';
|
|
2
|
+
import {
|
|
3
|
+
addProduct,
|
|
4
|
+
deleteProduct,
|
|
5
|
+
selectShipment,
|
|
6
|
+
shipmentQuote,
|
|
7
|
+
upsertProduct,
|
|
8
|
+
buy,
|
|
9
|
+
listDetail,
|
|
10
|
+
} from './endpoints/CartComposable';
|
|
11
|
+
import {
|
|
12
|
+
detail,
|
|
13
|
+
signinByDocument,
|
|
14
|
+
signinByEmail,
|
|
15
|
+
signup,
|
|
16
|
+
addNewsletter,
|
|
17
|
+
} from './endpoints/CustomerComposable';
|
|
18
|
+
import { listShipmentQuoteProduct } from './endpoints/ProductQuoteShipment';
|
|
19
|
+
import { getSearch } from './endpoints/SearchComposable';
|
|
20
|
+
import { listShowcase } from './endpoints/ShowcaseComposable';
|
|
21
|
+
import { getUrl } from './endpoints/UrlComposable';
|
|
22
|
+
import { addPaymentInfoAction as addPaymentInfo } from './events/actions/addPaymentInfo';
|
|
23
|
+
import { beginCheckoutAction as beginCheckout } from './events/actions/beginCheckout';
|
|
24
|
+
import { searchAction as search } from './events/actions/search';
|
|
25
|
+
import { selectItemAction as selectItem } from './events/actions/selectItem';
|
|
26
|
+
import { selectPromotionAction as selectPromotion } from './events/actions/selectPromotion';
|
|
27
|
+
import { viewHome } from './events/views/viewHome';
|
|
28
|
+
import { viewNotFound } from './events/views/viewNotFound';
|
|
29
|
+
import { viewOther } from './events/views/viewOther';
|
|
30
|
+
import { viewPayment } from './events/views/viewPayment';
|
|
31
|
+
import { viewShipping } from './events/views/viewShipping';
|
|
32
|
+
import publicApiTracking from './publicApiTracking';
|
|
33
|
+
|
|
34
|
+
const view = {
|
|
35
|
+
viewHome,
|
|
36
|
+
viewShipping,
|
|
37
|
+
viewPayment,
|
|
38
|
+
viewOther,
|
|
39
|
+
viewNotFound,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const cart = {
|
|
43
|
+
listDetail,
|
|
44
|
+
addProduct,
|
|
45
|
+
deleteProduct,
|
|
46
|
+
selectShipment,
|
|
47
|
+
shipmentQuote,
|
|
48
|
+
upsertProduct,
|
|
49
|
+
beginCheckout,
|
|
50
|
+
addPaymentInfo,
|
|
51
|
+
buy,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const customer = {
|
|
55
|
+
detail,
|
|
56
|
+
signinByDocument,
|
|
57
|
+
signinByEmail,
|
|
58
|
+
signup,
|
|
59
|
+
addNewsletter,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const product = {
|
|
63
|
+
listShipmentQuoteProduct,
|
|
64
|
+
getUrl,
|
|
65
|
+
search,
|
|
66
|
+
selectItem,
|
|
67
|
+
getSearch,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const customization = {
|
|
71
|
+
listShowcase,
|
|
72
|
+
listBanners,
|
|
73
|
+
selectPromotion,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { publicApiTracking, cart, customer, product, view, customization };
|
|
77
|
+
export default {
|
|
78
|
+
publicApiTracking,
|
|
79
|
+
view,
|
|
80
|
+
cart,
|
|
81
|
+
customer,
|
|
82
|
+
product,
|
|
83
|
+
customization,
|
|
84
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import usePublicApi from '../Api';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
// eslint-disable-next-line
|
|
6
|
+
dataLayer: Array<Record<string, any>>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
async install() {
|
|
12
|
+
if (import.meta.env.PROD) return;
|
|
13
|
+
|
|
14
|
+
await usePublicApi.customization
|
|
15
|
+
.listTemplateSettings(import.meta.env.VITE_BASE)
|
|
16
|
+
.then(data => {
|
|
17
|
+
const gtmApp = data.apps.find(app => app.code === 'google-tag-manager');
|
|
18
|
+
if (!gtmApp) return;
|
|
19
|
+
|
|
20
|
+
this.createGtm(gtmApp.settings['google-tag-manager-id']);
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
createGtm(tagId: string) {
|
|
25
|
+
const gtmTag = document.createElement('script');
|
|
26
|
+
gtmTag.innerHTML = `
|
|
27
|
+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
28
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
29
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
30
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
31
|
+
})(window,document,'script','dataLayer','${tagId}');
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
document.head.appendChild(gtmTag);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CustomerAddressResponse,
|
|
3
|
+
CustomerGender,
|
|
4
|
+
CustomerResponse,
|
|
5
|
+
} from '../../api/types';
|
|
6
|
+
|
|
7
|
+
export interface CustomerProfile {
|
|
8
|
+
event: 'customer_profile';
|
|
9
|
+
customer: {
|
|
10
|
+
id: number;
|
|
11
|
+
email: string;
|
|
12
|
+
name: string;
|
|
13
|
+
gender: CustomerGender;
|
|
14
|
+
birthdate: string;
|
|
15
|
+
address: null | Array<CustomerAddressResponse>;
|
|
16
|
+
flags: CustomerResponse['flags'];
|
|
17
|
+
loginStatus: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Item } from '../item.interfaces';
|
|
2
|
+
|
|
3
|
+
export interface Purchase {
|
|
4
|
+
event: 'purchase';
|
|
5
|
+
ecommerce: {
|
|
6
|
+
transaction_id: string;
|
|
7
|
+
affiliation: string;
|
|
8
|
+
value: number;
|
|
9
|
+
tax: number;
|
|
10
|
+
shipping: number;
|
|
11
|
+
currency: 'BRL';
|
|
12
|
+
coupon: string;
|
|
13
|
+
payment_type: string;
|
|
14
|
+
payment_status: string;
|
|
15
|
+
shipping_tier: string;
|
|
16
|
+
items: Array<Item>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Item } from '../item.interfaces';
|
|
2
|
+
|
|
3
|
+
interface SelectedItem extends Item {
|
|
4
|
+
item_list_id: string;
|
|
5
|
+
item_list_name: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface SelectItem {
|
|
9
|
+
event: 'select_item';
|
|
10
|
+
ecommerce: {
|
|
11
|
+
item_list_id: string;
|
|
12
|
+
item_list_name: string;
|
|
13
|
+
currency: 'BRL';
|
|
14
|
+
items: Array<SelectedItem>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AddToCart,
|
|
3
|
+
CustomerProfile,
|
|
4
|
+
Login,
|
|
5
|
+
RemoveFromCart,
|
|
6
|
+
Signup,
|
|
7
|
+
BeginCheckout,
|
|
8
|
+
AddShippingInfo,
|
|
9
|
+
AddPaymentInfo,
|
|
10
|
+
ShippingCalculation,
|
|
11
|
+
ViewPayment,
|
|
12
|
+
ViewShipping,
|
|
13
|
+
Purchase,
|
|
14
|
+
ViewCart,
|
|
15
|
+
ViewHome,
|
|
16
|
+
ViewItem,
|
|
17
|
+
ViewItemList,
|
|
18
|
+
ViewOther,
|
|
19
|
+
ViewNotFound,
|
|
20
|
+
Search,
|
|
21
|
+
GenerateLead,
|
|
22
|
+
ViewPromotion,
|
|
23
|
+
SelectPromotion,
|
|
24
|
+
FileDownload,
|
|
25
|
+
Share,
|
|
26
|
+
SelectItem,
|
|
27
|
+
} from '.';
|
|
28
|
+
|
|
29
|
+
export type Event =
|
|
30
|
+
| AddToCart
|
|
31
|
+
| RemoveFromCart
|
|
32
|
+
| ViewCart
|
|
33
|
+
| ViewPayment
|
|
34
|
+
| ViewShipping
|
|
35
|
+
| BeginCheckout
|
|
36
|
+
| CustomerProfile
|
|
37
|
+
| Login
|
|
38
|
+
| Signup
|
|
39
|
+
| AddShippingInfo
|
|
40
|
+
| AddPaymentInfo
|
|
41
|
+
| ShippingCalculation
|
|
42
|
+
| Purchase
|
|
43
|
+
| ViewHome
|
|
44
|
+
| ViewItem
|
|
45
|
+
| ViewItemList
|
|
46
|
+
| ViewOther
|
|
47
|
+
| ViewNotFound
|
|
48
|
+
| Search
|
|
49
|
+
| GenerateLead
|
|
50
|
+
| ViewPromotion
|
|
51
|
+
| SelectPromotion
|
|
52
|
+
| FileDownload
|
|
53
|
+
| Share
|
|
54
|
+
| SelectItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type { Event } from './event.types';
|
|
2
|
+
export type {
|
|
3
|
+
Item,
|
|
4
|
+
UpsertTrackingCartItem,
|
|
5
|
+
UpsertTrackingCartRequest,
|
|
6
|
+
BannerItem,
|
|
7
|
+
} from './item.interfaces';
|
|
8
|
+
|
|
9
|
+
export type { Purchase } from './actions/purchase.interfaces';
|
|
10
|
+
export type { AddToCart } from './actions/add-to-cart.interfaces';
|
|
11
|
+
export type { RemoveFromCart } from './actions/remove-from-cart.interfaces';
|
|
12
|
+
export type { Login } from './actions/login.interfaces';
|
|
13
|
+
export type { Signup } from './actions/signup.interfaces';
|
|
14
|
+
export type { CustomerProfile } from './actions/customer-profile.interfaces';
|
|
15
|
+
export type { BeginCheckout } from './actions/begin-checkout.interfaces';
|
|
16
|
+
export type { AddShippingInfo } from './actions/add-shipping-info.interfaces';
|
|
17
|
+
export type { AddPaymentInfo } from './actions/add-payment-info.interfaces';
|
|
18
|
+
export type { ShippingCalculation } from './actions/shipping-calculation.interfaces';
|
|
19
|
+
export type { Search } from './actions/search.interfaces';
|
|
20
|
+
export type {
|
|
21
|
+
CustomerLead,
|
|
22
|
+
GenerateLead,
|
|
23
|
+
} from './actions/generate-lead.interfaces';
|
|
24
|
+
export type { FileDownload } from './actions/file-download.interfaces';
|
|
25
|
+
export type { Share } from './actions/share.interfaces';
|
|
26
|
+
export type { SelectPromotion } from './actions/select-promotion.interfaces';
|
|
27
|
+
export type { SelectItem } from './actions/select-item.interfaces';
|
|
28
|
+
|
|
29
|
+
export type { ViewCart } from './views/view-cart.interfaces';
|
|
30
|
+
export type { ViewPayment } from './views/view-payment.interfaces';
|
|
31
|
+
export type { ViewShipping } from './views/view-shipping.interfaces';
|
|
32
|
+
export type { ViewHome } from './views/view-home.interfaces';
|
|
33
|
+
export type { ViewItemList } from './views/view-item-list.interfaces';
|
|
34
|
+
export type { ViewItem } from './views/view-item.interfaces';
|
|
35
|
+
export type { ViewOther } from './views/view-other.interfaces';
|
|
36
|
+
export type { ViewNotFound } from './views/view-not-found.interfaces';
|
|
37
|
+
export type { ViewPromotion } from './views/view-promotion.interfaces';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UpsertCartItem } from '../../Api/types';
|
|
2
|
+
|
|
3
|
+
export interface Item {
|
|
4
|
+
coupon?: string;
|
|
5
|
+
item_id: number;
|
|
6
|
+
item_name: string;
|
|
7
|
+
price: number;
|
|
8
|
+
quantity?: number;
|
|
9
|
+
item_brand: string;
|
|
10
|
+
item_category: string;
|
|
11
|
+
item_variant: string;
|
|
12
|
+
index?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface UpsertTrackingCartItem
|
|
16
|
+
extends Omit<UpsertCartItem, 'quantity'> {
|
|
17
|
+
oldQuantity?: number;
|
|
18
|
+
quantity?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface UpsertTrackingCartRequest {
|
|
21
|
+
items: Array<UpsertTrackingCartItem>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BannerItem {
|
|
25
|
+
promotion_id: number;
|
|
26
|
+
promotion_name: 'Banners';
|
|
27
|
+
creative_name: string;
|
|
28
|
+
creative_slot: number;
|
|
29
|
+
index: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Item } from '..';
|
|
2
|
+
|
|
3
|
+
export interface ViewItem {
|
|
4
|
+
event: 'view_item';
|
|
5
|
+
google_tag_params: {
|
|
6
|
+
ecomm_prodid: number;
|
|
7
|
+
ecomm_pagetype: 'product';
|
|
8
|
+
ecomm_totalvalue: number;
|
|
9
|
+
ecomm_category: string;
|
|
10
|
+
};
|
|
11
|
+
ecommerce: {
|
|
12
|
+
currency: 'BRL';
|
|
13
|
+
items: Array<Item>;
|
|
14
|
+
};
|
|
15
|
+
}
|