@ikas/storefront 5.0.0-beta.2 → 5.0.0-beta.20
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/build/analytics/analytics.d.ts +32 -37
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/events.js +1 -1
- package/build/analytics/facebookPixel.d.ts +11 -15
- package/build/analytics/facebookPixel.js +1 -1
- package/build/analytics/googleAnalytics.d.ts +10 -13
- package/build/analytics/googleAnalytics.js +1 -1
- package/build/analytics/googleTagManager.d.ts +188 -191
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/googleUniversal.d.ts +5 -8
- package/build/analytics/googleUniversal.js +1 -1
- package/build/analytics/head/index.js +1 -1
- package/build/analytics/ikas.d.ts +33 -40
- package/build/analytics/ikas.js +1 -1
- package/build/analytics/index.d.ts +1 -1
- package/build/analytics/tiktokPixel.d.ts +9 -12
- package/build/analytics/tiktokPixel.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +6 -6
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.d.ts +4 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/delivery-methods/index.js +1 -1
- package/build/components/checkout/components/epaykolay-button/index.d.ts +5 -0
- package/build/components/checkout/components/epaykolay-button/index.js +1 -0
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -0
- package/build/components/checkout/components/error/customer-login-required-error/index.js +1 -1
- package/build/components/checkout/components/error/index.js +1 -1
- package/build/components/checkout/components/error/no-shipping-error/index.js +1 -1
- package/build/components/checkout/components/error/payment-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/payment-error/index.js +1 -1
- package/build/components/checkout/components/error/stock-error/index.d.ts +2 -1
- package/build/components/checkout/components/error/stock-error/index.js +1 -1
- package/build/components/checkout/components/error/unknown-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/unknown-error/index.js +1 -1
- package/build/components/checkout/components/expandable-section/index.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/klarna/index.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/master-pass/link-card-to-client/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
- package/build/components/checkout/components/offer-product/index.d.ts +2 -1
- package/build/components/checkout/components/offer-product/index.js +1 -1
- package/build/components/checkout/components/paypal/index.d.ts +7 -0
- package/build/components/checkout/components/paypal/index.js +1 -0
- package/build/components/checkout/components/paypal/style.module.scss.js +1 -0
- package/build/components/checkout/components/quick-registration/completed.js +1 -1
- package/build/components/checkout/components/quick-registration/index.js +1 -1
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/components/svg/epaykolay.d.ts +6 -0
- package/build/components/checkout/components/svg/epaykolay.js +1 -0
- package/build/components/checkout/index.d.ts +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +22 -44
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.d.ts +13 -23
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.js +1 -1
- package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-shipping/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/checkout/types.d.ts +29 -0
- package/build/components/checkout/types.js +1 -0
- package/build/components/google-captcha/index.js +1 -1
- package/build/components/image/index.d.ts +1 -1
- package/build/components/image/index.js +1 -1
- package/build/components/link/index.js +1 -1
- package/build/components/page/ThemeComponent.js +1 -1
- package/build/components/page/functions.d.ts +3 -0
- package/build/components/page/functions.js +1 -0
- package/build/components/page/head.d.ts +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.d.ts +4 -3
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/index.js +1 -1
- package/build/components/page-editor/model.d.ts +5 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/ext/@ikas/fe-api-client/build/utils/api.js +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/useCustomerReviews.d.ts +2 -3
- package/build/hooks/useCustomerReviews.js +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/model-helpers/index.d.ts +5 -0
- package/build/model-helpers/order/line-item/option/value/functions.d.ts +3 -0
- package/build/model-helpers/order/line-item/option/value/functions.js +1 -0
- package/build/model-helpers/product/attribute-value/functions.d.ts +2 -0
- package/build/model-helpers/product/attribute-value/functions.js +1 -0
- package/build/model-helpers/product/functions.d.ts +10 -0
- package/build/model-helpers/product/functions.js +1 -0
- package/build/model-helpers/product/option-set/option/functions.d.ts +2 -0
- package/build/model-helpers/product/option-set/option/functions.js +1 -0
- package/build/model-helpers/product/variant/functions.d.ts +2 -0
- package/build/model-helpers/product/variant/functions.js +1 -0
- package/build/models/data/checkout/index.d.ts +4 -21
- package/build/models/data/index.d.ts +7 -138
- package/build/models/data/localized-customer-address/functions.d.ts +65 -0
- package/build/models/data/localized-customer-address/functions.js +1 -0
- package/build/models/data/localized-customer-address/index.d.ts +6 -0
- package/build/models/data/localized-order-address/functions.d.ts +63 -0
- package/build/models/data/localized-order-address/functions.js +1 -0
- package/build/models/data/localized-order-address/index.d.ts +6 -0
- package/build/models/data/review-form/index.d.ts +6 -0
- package/build/models/data/theme-json/component/index.d.ts +1 -0
- package/build/models/data/theme-json/component/index.js +1 -1
- package/build/models/data/theme-json/custom-data/index.d.ts +1 -2
- package/build/models/data/theme-json/custom-data/index.js +1 -1
- package/build/models/data/theme-json/settings/color/index.js +1 -1
- package/build/models/index.d.ts +1 -0
- package/build/models/ui/blog-category-list/functions.d.ts +6 -0
- package/build/models/ui/blog-category-list/functions.js +1 -0
- package/build/models/ui/blog-category-list/index.d.ts +8 -42
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/blog-list/functions.d.ts +6 -0
- package/build/models/ui/blog-list/functions.js +1 -0
- package/build/models/ui/blog-list/index.d.ts +9 -45
- package/build/models/ui/blog-list/index.js +1 -1
- package/build/models/ui/brand-list/functions.d.ts +8 -0
- package/build/models/ui/brand-list/functions.js +1 -0
- package/build/models/ui/brand-list/index.d.ts +9 -48
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/functions.d.ts +8 -0
- package/build/models/ui/category-list/functions.js +1 -0
- package/build/models/ui/category-list/index.d.ts +9 -48
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/functions.d.ts +7 -0
- package/build/models/ui/customer-review-list/functions.js +1 -0
- package/build/models/ui/customer-review-list/index.d.ts +8 -40
- package/build/models/ui/customer-review-summary-list/functions.d.ts +7 -0
- package/build/models/ui/customer-review-summary-list/functions.js +1 -0
- package/build/models/ui/customer-review-summary-list/index.d.ts +7 -39
- package/build/models/ui/index.d.ts +17 -10
- package/build/models/ui/list-commons/index.d.ts +13 -0
- package/build/models/ui/list-commons/index.js +1 -0
- package/build/models/ui/navigation-link/index.d.ts +3 -3
- package/build/models/ui/navigation-link/index.js +1 -1
- package/build/models/ui/product-attribute-detail/index.d.ts +1 -1
- package/build/models/ui/product-attribute-detail/index.js +1 -1
- package/build/models/ui/product-attribute-list/index.js +1 -1
- package/build/models/ui/product-list/functions.d.ts +32 -0
- package/build/models/ui/product-list/functions.js +1 -0
- package/build/models/ui/product-list/index.d.ts +18 -110
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/functions.d.ts +6 -0
- package/build/models/ui/raffle-list/functions.js +1 -0
- package/build/models/ui/raffle-list/index.d.ts +14 -50
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/models/ui/validator/form/contact-form.js +1 -1
- package/build/models/ui/validator/form/customer-review.js +1 -1
- package/build/models/ui/validator/form/forgot-password.js +1 -1
- package/build/models/ui/validator/form/ikas-address.d.ts +32 -20
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/models/ui/validator/form/login.js +1 -1
- package/build/models/ui/validator/form/raffle-form.js +1 -1
- package/build/models/ui/validator/form/recover-password.js +1 -1
- package/build/models/ui/validator/form/register.d.ts +10 -1
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/page-data-init/index.d.ts +7 -18
- package/build/page-data-init/index.js +1 -1
- package/build/pages/account/activate.d.ts +4 -0
- package/build/pages/account/activate.js +1 -0
- package/build/pages/checkout.js +1 -1
- package/build/pages/index.d.ts +1 -0
- package/build/store/analytics/index.d.ts +9 -0
- package/build/store/analytics/index.js +1 -0
- package/build/store/base/functions.d.ts +7 -0
- package/build/store/base/functions.js +1 -0
- package/build/store/{base.d.ts → base/index.d.ts} +7 -17
- package/build/store/base/index.js +1 -0
- package/build/store/base/public.d.ts +1 -0
- package/build/store/base/public.js +1 -0
- package/build/store/cart/functions.d.ts +24 -0
- package/build/store/cart/functions.js +1 -0
- package/build/store/cart/index.d.ts +7 -28
- package/build/store/cart/index.js +1 -1
- package/build/store/cart/public.d.ts +1 -0
- package/build/store/cart/public.js +1 -0
- package/build/store/customer/account-auth/data.d.ts +4 -0
- package/build/store/customer/account-auth/data.js +1 -0
- package/build/store/customer/account-auth/functions.d.ts +24 -0
- package/build/store/customer/account-auth/functions.js +1 -0
- package/build/store/customer/account-auth/public.d.ts +1 -0
- package/build/store/customer/captcha/data.d.ts +3 -0
- package/build/store/customer/captcha/data.js +1 -0
- package/build/store/customer/captcha/functions.d.ts +5 -0
- package/build/store/customer/captcha/functions.js +1 -0
- package/build/store/customer/captcha/public.d.ts +1 -0
- package/build/store/customer/consent/data.d.ts +3 -0
- package/build/store/customer/consent/data.js +1 -0
- package/build/store/customer/consent/functions.d.ts +6 -0
- package/build/store/customer/consent/functions.js +1 -0
- package/build/store/customer/consent/public.d.ts +1 -0
- package/build/store/customer/functions.d.ts +4 -0
- package/build/store/customer/functions.js +1 -0
- package/build/store/customer/index.d.ts +8 -82
- package/build/store/customer/index.js +1 -1
- package/build/store/customer/marketing/data.d.ts +3 -0
- package/build/store/customer/marketing/data.js +1 -0
- package/build/store/customer/marketing/functions.d.ts +5 -0
- package/build/store/customer/marketing/functions.js +1 -0
- package/build/store/customer/marketing/public.d.ts +1 -0
- package/build/store/customer/order/data.d.ts +4 -0
- package/build/store/customer/order/data.js +1 -0
- package/build/store/customer/order/functions.d.ts +11 -0
- package/build/store/customer/order/functions.js +1 -0
- package/build/store/customer/order/public.d.ts +1 -0
- package/build/store/customer/product/data.d.ts +17 -0
- package/build/store/customer/product/data.js +1 -0
- package/build/store/customer/product/functions.d.ts +20 -0
- package/build/store/customer/product/functions.js +1 -0
- package/build/store/customer/product/public.d.ts +1 -0
- package/build/store/customer/public.d.ts +8 -0
- package/build/store/customer/public.js +1 -0
- package/build/store/customer/raffle/functions.d.ts +1 -0
- package/build/store/customer/raffle/functions.js +1 -0
- package/build/store/customer/raffle/public.d.ts +1 -0
- package/build/store/index.d.ts +9 -4
- package/build/utils/constants.js +1 -1
- package/build/utils/helper.d.ts +1 -1
- package/build/utils/helper.js +1 -1
- package/build/utils/index.d.ts +1 -2
- package/package.json +17 -13
- package/build/ext/@builder.io/partytown/integration/index.mjs.js +0 -1
- package/build/ext/@builder.io/partytown/react/index.mjs.js +0 -1
- package/build/hooks/useStore.d.ts +0 -2
- package/build/hooks/useStore.js +0 -1
- package/build/models/data/base/index.d.ts +0 -8
- package/build/models/data/base/index.js +0 -1
- package/build/models/data/blog/category/index.d.ts +0 -12
- package/build/models/data/blog/category/index.js +0 -1
- package/build/models/data/blog/content/index.d.ts +0 -6
- package/build/models/data/blog/content/index.js +0 -1
- package/build/models/data/blog/index.d.ts +0 -27
- package/build/models/data/blog/index.js +0 -1
- package/build/models/data/blog/meta-data/index.d.ts +0 -16
- package/build/models/data/blog/meta-data/index.js +0 -1
- package/build/models/data/blog/tag/index.d.ts +0 -6
- package/build/models/data/blog/tag/index.js +0 -1
- package/build/models/data/blog/writer/index.d.ts +0 -6
- package/build/models/data/blog/writer/index.js +0 -1
- package/build/models/data/brand/index.d.ts +0 -26
- package/build/models/data/brand/index.js +0 -1
- package/build/models/data/brand/translation/index.d.ts +0 -7
- package/build/models/data/brand/translation/index.js +0 -1
- package/build/models/data/campaign-offer/index.d.ts +0 -21
- package/build/models/data/campaign-offer/index.js +0 -1
- package/build/models/data/campaign-offer/product/index.d.ts +0 -25
- package/build/models/data/campaign-offer/product/index.js +0 -1
- package/build/models/data/cart/available-shipping-method/index.d.ts +0 -10
- package/build/models/data/cart/available-shipping-method/index.js +0 -1
- package/build/models/data/cart/campaign-offer/index.d.ts +0 -16
- package/build/models/data/cart/campaign-offer/index.js +0 -1
- package/build/models/data/cart/index.d.ts +0 -14
- package/build/models/data/cart/index.js +0 -1
- package/build/models/data/category/index.d.ts +0 -22
- package/build/models/data/category/index.js +0 -1
- package/build/models/data/category/path-item/index.d.ts +0 -14
- package/build/models/data/category/path-item/index.js +0 -1
- package/build/models/data/category/translations/index.d.ts +0 -7
- package/build/models/data/category/translations/index.js +0 -1
- package/build/models/data/checkout/country-settings-model.d.ts +0 -141
- package/build/models/data/checkout/country-settings-model.js +0 -1
- package/build/models/data/checkout/index.js +0 -1
- package/build/models/data/checkout-settings/index.d.ts +0 -21
- package/build/models/data/checkout-settings/index.js +0 -1
- package/build/models/data/checkout-settings/option/index.d.ts +0 -6
- package/build/models/data/checkout-settings/option/index.js +0 -1
- package/build/models/data/checkout-settings/price/index.d.ts +0 -7
- package/build/models/data/checkout-settings/price/index.js +0 -1
- package/build/models/data/city/index.d.ts +0 -12
- package/build/models/data/city/index.js +0 -1
- package/build/models/data/contact-form/index.d.ts +0 -9
- package/build/models/data/contact-form/index.js +0 -1
- package/build/models/data/country/index.d.ts +0 -18
- package/build/models/data/country/index.js +0 -1
- package/build/models/data/country/location-translations/index.d.ts +0 -7
- package/build/models/data/customer/address/city/index.d.ts +0 -7
- package/build/models/data/customer/address/city/index.js +0 -1
- package/build/models/data/customer/address/country/index.d.ts +0 -9
- package/build/models/data/customer/address/country/index.js +0 -1
- package/build/models/data/customer/address/district/index.d.ts +0 -7
- package/build/models/data/customer/address/district/index.js +0 -1
- package/build/models/data/customer/address/ikas-localized-customer-address.d.ts +0 -50
- package/build/models/data/customer/address/ikas-localized-customer-address.js +0 -1
- package/build/models/data/customer/address/index.d.ts +0 -40
- package/build/models/data/customer/address/index.js +0 -1
- package/build/models/data/customer/address/state/index.d.ts +0 -7
- package/build/models/data/customer/address/state/index.js +0 -1
- package/build/models/data/customer/attribute/index.d.ts +0 -18
- package/build/models/data/customer/attribute/index.js +0 -1
- package/build/models/data/customer/attribute/option/index.d.ts +0 -9
- package/build/models/data/customer/attribute/option/index.js +0 -1
- package/build/models/data/customer/attribute/sales-channel/index.d.ts +0 -8
- package/build/models/data/customer/attribute/sales-channel/index.js +0 -1
- package/build/models/data/customer/attribute/translation/index.d.ts +0 -9
- package/build/models/data/customer/attribute/translation/index.js +0 -1
- package/build/models/data/customer/attribute/translation/option/index.d.ts +0 -6
- package/build/models/data/customer/attribute/translation/option/index.js +0 -1
- package/build/models/data/customer/attribute/value/index.d.ts +0 -11
- package/build/models/data/customer/attribute/value/index.js +0 -1
- package/build/models/data/customer/index.d.ts +0 -38
- package/build/models/data/customer/index.js +0 -1
- package/build/models/data/customer/review/index.d.ts +0 -24
- package/build/models/data/customer/review/index.js +0 -1
- package/build/models/data/customer/review/settings/index.d.ts +0 -6
- package/build/models/data/customer/review/settings/index.js +0 -1
- package/build/models/data/customer/review/summary/index.d.ts +0 -10
- package/build/models/data/customer/review/summary/index.js +0 -1
- package/build/models/data/customer/review/summary/star/index.d.ts +0 -6
- package/build/models/data/customer/review/summary/star/index.js +0 -1
- package/build/models/data/district/index.d.ts +0 -12
- package/build/models/data/district/index.js +0 -1
- package/build/models/data/favorite-product/index.d.ts +0 -7
- package/build/models/data/favorite-product/index.js +0 -1
- package/build/models/data/filter-category/index.d.ts +0 -12
- package/build/models/data/filter-category/index.js +0 -1
- package/build/models/data/html-meta-data/index.d.ts +0 -28
- package/build/models/data/html-meta-data/index.js +0 -1
- package/build/models/data/html-meta-data/translations/index.d.ts +0 -7
- package/build/models/data/html-meta-data/translations/index.js +0 -1
- package/build/models/data/image/index.d.ts +0 -10
- package/build/models/data/image/index.js +0 -1
- package/build/models/data/last-viewed-product/index.d.ts +0 -6
- package/build/models/data/last-viewed-product/index.js +0 -1
- package/build/models/data/merchant-settings/index.d.ts +0 -12
- package/build/models/data/merchant-settings/index.js +0 -1
- package/build/models/data/order/address/city/index.d.ts +0 -7
- package/build/models/data/order/address/city/index.js +0 -1
- package/build/models/data/order/address/country/index.d.ts +0 -9
- package/build/models/data/order/address/country/index.js +0 -1
- package/build/models/data/order/address/district/index.d.ts +0 -7
- package/build/models/data/order/address/district/index.js +0 -1
- package/build/models/data/order/address/ikas-localized-order-address.d.ts +0 -32
- package/build/models/data/order/address/ikas-localized-order-address.js +0 -1
- package/build/models/data/order/address/index.d.ts +0 -37
- package/build/models/data/order/address/index.js +0 -1
- package/build/models/data/order/address/state/index.d.ts +0 -7
- package/build/models/data/order/address/state/index.js +0 -1
- package/build/models/data/order/adjustment/applied-order-line/index.d.ts +0 -8
- package/build/models/data/order/adjustment/applied-order-line/index.js +0 -1
- package/build/models/data/order/adjustment/index.d.ts +0 -15
- package/build/models/data/order/adjustment/index.js +0 -1
- package/build/models/data/order/customer/index.d.ts +0 -11
- package/build/models/data/order/customer/index.js +0 -1
- package/build/models/data/order/gift-line/index.d.ts +0 -6
- package/build/models/data/order/gift-line/index.js +0 -1
- package/build/models/data/order/index.d.ts +0 -69
- package/build/models/data/order/index.js +0 -1
- package/build/models/data/order/invoice/index.d.ts +0 -12
- package/build/models/data/order/invoice/index.js +0 -1
- package/build/models/data/order/line-item/base-unit/index.d.ts +0 -9
- package/build/models/data/order/line-item/base-unit/index.js +0 -1
- package/build/models/data/order/line-item/base-unit/unit-type/index.d.ts +0 -6
- package/build/models/data/order/line-item/base-unit/unit-type/index.js +0 -1
- package/build/models/data/order/line-item/discount/index.d.ts +0 -11
- package/build/models/data/order/line-item/discount/index.js +0 -1
- package/build/models/data/order/line-item/index.d.ts +0 -46
- package/build/models/data/order/line-item/index.js +0 -1
- package/build/models/data/order/line-item/option/index.d.ts +0 -10
- package/build/models/data/order/line-item/option/index.js +0 -1
- package/build/models/data/order/line-item/option/value/index.d.ts +0 -9
- package/build/models/data/order/line-item/option/value/index.js +0 -1
- package/build/models/data/order/line-item/variant/brand/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/brand/index.js +0 -1
- package/build/models/data/order/line-item/variant/category/index.d.ts +0 -12
- package/build/models/data/order/line-item/variant/category/index.js +0 -1
- package/build/models/data/order/line-item/variant/index.d.ts +0 -32
- package/build/models/data/order/line-item/variant/index.js +0 -1
- package/build/models/data/order/line-item/variant/price/index.d.ts +0 -10
- package/build/models/data/order/line-item/variant/price/index.js +0 -1
- package/build/models/data/order/line-item/variant/tag/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/tag/index.js +0 -1
- package/build/models/data/order/line-item/variant/unit/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/unit/index.js +0 -1
- package/build/models/data/order/line-item/variant/value/index.d.ts +0 -11
- package/build/models/data/order/line-item/variant/value/index.js +0 -1
- package/build/models/data/order/package/index.d.ts +0 -16
- package/build/models/data/order/package/index.js +0 -1
- package/build/models/data/order/package/tracking-info/index.d.ts +0 -9
- package/build/models/data/order/package/tracking-info/index.js +0 -1
- package/build/models/data/order/payment-method/index.d.ts +0 -9
- package/build/models/data/order/payment-method/index.js +0 -1
- package/build/models/data/order/refund/index.d.ts +0 -7
- package/build/models/data/order/refund/index.js +0 -1
- package/build/models/data/order/refund/line-item/index.d.ts +0 -6
- package/build/models/data/order/refund/line-item/index.js +0 -1
- package/build/models/data/order/refund/settings/index.d.ts +0 -7
- package/build/models/data/order/refund/settings/index.js +0 -1
- package/build/models/data/order/shipping-line/index.d.ts +0 -12
- package/build/models/data/order/shipping-line/index.js +0 -1
- package/build/models/data/order/tax-line/index.d.ts +0 -6
- package/build/models/data/order/tax-line/index.js +0 -1
- package/build/models/data/order/transaction/error/index.d.ts +0 -7
- package/build/models/data/order/transaction/error/index.js +0 -1
- package/build/models/data/order/transaction/index.d.ts +0 -26
- package/build/models/data/order/transaction/index.js +0 -1
- package/build/models/data/order/transaction/payment-method-detail/index.d.ts +0 -13
- package/build/models/data/order/transaction/payment-method-detail/index.js +0 -1
- package/build/models/data/order/transaction/payment-method-detail/installment-price/index.d.ts +0 -9
- package/build/models/data/order/transaction/payment-method-detail/installment-price/index.js +0 -1
- package/build/models/data/payment-gateway/additional-price/index.d.ts +0 -9
- package/build/models/data/payment-gateway/additional-price/index.js +0 -1
- package/build/models/data/payment-gateway/index.d.ts +0 -31
- package/build/models/data/payment-gateway/index.js +0 -1
- package/build/models/data/payment-gateway/settings/index.d.ts +0 -10
- package/build/models/data/payment-gateway/settings/index.js +0 -1
- package/build/models/data/payment-gateway/translation/index.d.ts +0 -7
- package/build/models/data/payment-gateway/translation/index.js +0 -1
- package/build/models/data/product/attribute/index.d.ts +0 -15
- package/build/models/data/product/attribute/index.js +0 -1
- package/build/models/data/product/attribute/option/index.d.ts +0 -6
- package/build/models/data/product/attribute/option/index.js +0 -1
- package/build/models/data/product/attribute/table-cell/index.d.ts +0 -6
- package/build/models/data/product/attribute/table-cell/index.js +0 -1
- package/build/models/data/product/attribute/table-template/index.d.ts +0 -7
- package/build/models/data/product/attribute/table-template/index.js +0 -1
- package/build/models/data/product/attribute/translation/index.d.ts +0 -13
- package/build/models/data/product/attribute/translation/index.js +0 -1
- package/build/models/data/product/attribute-value/index.d.ts +0 -28
- package/build/models/data/product/attribute-value/index.js +0 -1
- package/build/models/data/product/back-in-stock-settings/index.d.ts +0 -5
- package/build/models/data/product/back-in-stock-settings/index.js +0 -1
- package/build/models/data/product/base-unit/index.d.ts +0 -12
- package/build/models/data/product/base-unit/index.js +0 -1
- package/build/models/data/product/campaign/data/index.d.ts +0 -27
- package/build/models/data/product/campaign/data/index.js +0 -1
- package/build/models/data/product/campaign/filter/index.d.ts +0 -7
- package/build/models/data/product/campaign/filter/index.js +0 -1
- package/build/models/data/product/campaign/index.d.ts +0 -7
- package/build/models/data/product/campaign/index.js +0 -1
- package/build/models/data/product/campaign/product-buyx-then-gety/index.d.ts +0 -20
- package/build/models/data/product/campaign/product-buyx-then-gety/index.js +0 -1
- package/build/models/data/product/campaign/product-campaign-date-range-field/index.d.ts +0 -6
- package/build/models/data/product/campaign/product-campaign-date-range-field/index.js +0 -1
- package/build/models/data/product/campaign/product-fixed-discount/index.d.ts +0 -14
- package/build/models/data/product/campaign/product-fixed-discount/index.js +0 -1
- package/build/models/data/product/filter/index.d.ts +0 -82
- package/build/models/data/product/filter/index.js +0 -1
- package/build/models/data/product/image/index.d.ts +0 -10
- package/build/models/data/product/image/index.js +0 -1
- package/build/models/data/product/index.d.ts +0 -77
- package/build/models/data/product/index.js +0 -1
- package/build/models/data/product/option-set/index.d.ts +0 -29
- package/build/models/data/product/option-set/index.js +0 -1
- package/build/models/data/product/option-set/option/index.d.ts +0 -70
- package/build/models/data/product/option-set/option/index.js +0 -1
- package/build/models/data/product/star/index.d.ts +0 -6
- package/build/models/data/product/star/index.js +0 -1
- package/build/models/data/product/stock-location/index.d.ts +0 -8
- package/build/models/data/product/stock-location/index.js +0 -1
- package/build/models/data/product/tag/index.d.ts +0 -6
- package/build/models/data/product/tag/index.js +0 -1
- package/build/models/data/product/variant/index.d.ts +0 -31
- package/build/models/data/product/variant/index.js +0 -1
- package/build/models/data/product/variant/price/index.d.ts +0 -19
- package/build/models/data/product/variant/price/index.js +0 -1
- package/build/models/data/product/variant/unit/index.d.ts +0 -6
- package/build/models/data/product/variant/unit/index.js +0 -1
- package/build/models/data/product/variant-type/index.d.ts +0 -8
- package/build/models/data/product/variant-type/index.js +0 -1
- package/build/models/data/raffle/index.d.ts +0 -63
- package/build/models/data/raffle/index.js +0 -1
- package/build/models/data/sales-channel/index.d.ts +0 -19
- package/build/models/data/sales-channel/index.js +0 -1
- package/build/models/data/state/index.d.ts +0 -11
- package/build/models/data/state/index.js +0 -1
- package/build/models/data/state/location-translations/index.d.ts +0 -7
- package/build/models/data/stock-location/address/city/index.d.ts +0 -7
- package/build/models/data/stock-location/address/city/index.js +0 -1
- package/build/models/data/stock-location/address/country/index.d.ts +0 -7
- package/build/models/data/stock-location/address/country/index.js +0 -1
- package/build/models/data/stock-location/address/district/index.d.ts +0 -7
- package/build/models/data/stock-location/address/district/index.js +0 -1
- package/build/models/data/stock-location/address/index.d.ts +0 -15
- package/build/models/data/stock-location/address/index.js +0 -1
- package/build/models/data/stock-location/address/state/index.d.ts +0 -7
- package/build/models/data/stock-location/address/state/index.js +0 -1
- package/build/models/data/stock-location/available/index.d.ts +0 -10
- package/build/models/data/stock-location/available/index.js +0 -1
- package/build/models/data/stock-location/index.d.ts +0 -14
- package/build/models/data/stock-location/index.js +0 -1
- package/build/models/data/storefront/domain/index.d.ts +0 -9
- package/build/models/data/storefront/domain/index.js +0 -1
- package/build/models/data/storefront/index.d.ts +0 -30
- package/build/models/data/storefront/index.js +0 -1
- package/build/models/data/storefront/localization/index.d.ts +0 -8
- package/build/models/data/storefront/localization/index.js +0 -1
- package/build/models/data/storefront/meta-templates/index.d.ts +0 -8
- package/build/models/data/storefront/meta-templates/index.js +0 -1
- package/build/models/data/storefront/routing/dynamic-currency/index.d.ts +0 -6
- package/build/models/data/storefront/routing/dynamic-currency/index.js +0 -1
- package/build/models/data/storefront/routing/index.d.ts +0 -14
- package/build/models/data/storefront/routing/index.js +0 -1
- package/build/models/data/storefront/theme/index.d.ts +0 -10
- package/build/models/data/storefront/theme/index.js +0 -1
- package/build/models/data/storefront/theme-localization/index.d.ts +0 -15
- package/build/models/data/storefront/theme-localization/index.js +0 -1
- package/build/models/data/variant-type/index.d.ts +0 -13
- package/build/models/data/variant-type/index.js +0 -1
- package/build/models/data/variant-type/variant-value/index.d.ts +0 -12
- package/build/models/data/variant-type/variant-value/index.js +0 -1
- package/build/models/ui/customer-review-list/index.js +0 -1
- package/build/models/ui/customer-review-summary-list/index.js +0 -1
- package/build/models/ui/raffle-list/index.js +0 -1
- package/build/store/base.js +0 -1
- package/build/store/blog/index.d.ts +0 -26
- package/build/store/blog/index.js +0 -1
- package/build/store/brand/index.d.ts +0 -12
- package/build/store/brand/index.js +0 -1
- package/build/store/cart/api.d.ts +0 -10
- package/build/store/cart/api.js +0 -1
- package/build/store/category/index.d.ts +0 -12
- package/build/store/category/index.js +0 -1
- package/build/store/checkout/index.d.ts +0 -16
- package/build/store/checkout/index.js +0 -1
- package/build/store/customer/api.d.ts +0 -54
- package/build/store/customer/api.js +0 -1
- package/build/store/html-meta-data/index.d.ts +0 -6
- package/build/store/html-meta-data/index.js +0 -1
- package/build/store/location/index.d.ts +0 -9
- package/build/store/location/index.js +0 -1
- package/build/store/merchant/index.d.ts +0 -6
- package/build/store/product/index.d.ts +0 -47
- package/build/store/product/index.js +0 -1
- package/build/store/raffle/index.d.ts +0 -15
- package/build/store/raffle/index.js +0 -1
- package/build/store/storefront/index.d.ts +0 -5
- package/build/utils/currency.d.ts +0 -7
- package/build/utils/currency.js +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IkasCustomerAttributeValue, IkasCustomer } from "../../../models/data";
|
|
2
|
+
import { IkasRegisterError } from "@ikas/storefront-api";
|
|
3
|
+
export declare const LS_TOKEN_KEY = "customerToken";
|
|
4
|
+
export declare const LS_TOKEN_EXPIRY = "customerTokenExpiry";
|
|
5
|
+
export declare function saveCustomer(customer: IkasCustomer): Promise<boolean>;
|
|
6
|
+
export declare function socialLogin(provider: "facebook" | "google"): Promise<void>;
|
|
7
|
+
export declare function socialLoginToken(token: string): Promise<boolean>;
|
|
8
|
+
export declare function login(email: string, password: string): Promise<boolean>;
|
|
9
|
+
export declare function logout(): void;
|
|
10
|
+
export declare function register(firstName: string, lastName: string, email: string, password: string, isMarketingAccepted?: boolean, attributes?: IkasCustomerAttributeValue[], phone?: string | null): Promise<{
|
|
11
|
+
isSuccess: boolean;
|
|
12
|
+
errorCodes: IkasRegisterError[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function activateCustomer(): Promise<boolean>;
|
|
15
|
+
export declare function resendCustomerActivationMail(email: string): Promise<boolean>;
|
|
16
|
+
export declare function checkEmail(email: string): Promise<boolean>;
|
|
17
|
+
export declare function forgotPassword(email: string): Promise<boolean>;
|
|
18
|
+
export declare function recoverPassword(password: string, passwordAgain: string, token: string): Promise<boolean>;
|
|
19
|
+
export declare function refreshToken(): Promise<void>;
|
|
20
|
+
export declare function getCustomerAttributes(): Promise<import("@ikas/storefront-models/build-cjs/models/customer/attribute").IkasCustomerAttribute[]>;
|
|
21
|
+
export declare function setToken(token: string, tokenExpiry: number): void;
|
|
22
|
+
export declare function loadToken(): void;
|
|
23
|
+
export declare function clearLocalTokenData(): void;
|
|
24
|
+
export declare function clearLocalData(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as n}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as r}from"@ikas/storefront-config";import{IkasCustomerConsentData as o}from"../consent/data.js";import{customerLogout as s,completeRegistration as i,customerLogin as a}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{getCaptcha as c,clearCaptchaToken as u}from"../captcha/functions.js";import{IkasCustomerCaptchaData as d}from"../captcha/data.js";import{saveLocalLastViewedProducts as l}from"../product/functions.js";import{isServer as m}from"../../../utils/helper.js";import{IkasCustomerAuthData as f}from"./data.js";import{saveCustomer as p,SaveMyCustomerInput as h,socialLogin as v,login as k,IkasRegisterError as b,register as w,activateCustomer as T,resendCustomerActivationMail as g,checkEmail as x,forgotPassword as S,recoverPassword as j,refreshToken as y,listCustomerAttribute as E}from"@ikas/storefront-api";import'./../../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../../ext/axios/index.js';import'./../../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{setCustomer as _,useCustomerStore as I}from"../index.js";import{removeCart as A}from"../../cart/functions.js";var C="customerToken",P="customerTokenExpiry";function U(n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p({input:new h(n)})];case 1:return(t=e.sent()).isSuccess&&t.data?(_(t.data),[2,!0]):[2,!1]}}))}))}function L(n){return t(this,void 0,void 0,(function(){var t,o,s;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",o="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(n,"/login/authenticate?redirect=").concat(t),[4,fetch(o,{headers:{"x-api-key":r.getApiKey()||"","x-sfid":r.getStorefrontId()||"","x-sfrid":r.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return s=e.sent(),window.location.href=s.redirectUrl,[2]}}))}))}function N(n){var r;return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return t=I(),[4,v({code:n})];case 1:return(null==(o=e.sent())?void 0:o.isSuccess)&&(null===(r=o.data)||void 0===r?void 0:r.customer)?(D(o.data.token,o.data.tokenExpiry),_(o.data.customer),t.customer&&a(),[2,!0]):[2,!1]}}))}))}function O(n,r){return t(this,void 0,void 0,(function(){var t,o,s;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),t=I(),[4,k({email:n,password:r,captchaToken:d.captchaToken})];case 2:return o=e.sent(),u(),o&&o.isSuccess&&o.data?(D((s=o.data).token,s.tokenExpiry),s.customer&&_(s.customer),t.customer&&a(),l(),[2,!0]):[2,!1]}}))}))}function R(){J(),A(),s()}function G(r,s,a,m,f,p,h){var v;return t(this,void 0,void 0,(function(){var t,k;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),t=I(),[4,w({email:a,password:m,firstName:r,lastName:s,isAcceptMarketing:f,attributes:p,captchaToken:d.captchaToken,phone:h})];case 2:return k=e.sent(),u(),k&&k.isSuccess&&(null===(v=k.data)||void 0===v?void 0:v.customer)?(D(k.data.token,k.data.tokenExpiry),_(k.data.customer),l(),i((T=t.customer,n(n({},T),{consentGranted:o.customerConsentGranted}))),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:k.errorCodes.map((function(t){return Object.values(b).includes(t)?t:b.UNKOWN}))}]}var T}))}))}function B(){return t(this,void 0,void 0,(function(){var t,n,r;return e(this,(function(e){switch(e.label){case 0:return t=new URLSearchParams(window.location.search),(n=t.get("token"))?[4,c()]:[3,3];case 1:return e.sent(),[4,T({token:n,captchaToken:d.captchaToken})];case 2:return r=e.sent(),u(),[2,r.isSuccess];case 3:return[2,!1]}}))}))}function K(n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return n?[4,c()]:[3,3];case 1:return e.sent(),[4,g({email:n,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,t.isSuccess];case 3:return[2,!1]}}))}))}function M(n){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),[4,x({email:n,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,!!t.isSuccess&&!!(null===(r=t.data)||void 0===r?void 0:r.exists)]}}))}))}function W(n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),[4,S({email:n,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,t.isSuccess]}}))}))}function X(n,r,o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),[4,j({password:n,passwordAgain:r,token:o,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,t.isSuccess]}}))}))}function q(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return f.token?[4,y({token:f.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?D(t.data.token,t.data.tokenExpiry):(f.token=null,f.tokenExpiry=null,J()),[2]}}))}))}function z(){var n;return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,E()];case 1:return t=e.sent(),(r=I()).customer&&(null===(n=r.customer.attributes)||void 0===n||n.forEach((function(e){var n,r,o;e.customerAttribute=(null===(n=t.data)||void 0===n?void 0:n.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(o=null===(r=e.customerAttribute)||void 0===r?void 0:r.options)||void 0===o?void 0:o.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))}function D(t,e){m()||(f.token=t,f.tokenExpiry=e,localStorage.setItem("customerToken",t),localStorage.setItem("customerTokenExpiry",e+""),r.init({customerToken:t}))}function F(){if(!m()){var t=localStorage.getItem("customerToken"),e=localStorage.getItem("customerTokenExpiry");t&&e?D(t,parseInt(e)):H()}}function H(){localStorage.removeItem("customerToken"),localStorage.removeItem("customerTokenExpiry"),f.token=null,f.tokenExpiry=null}function J(){H(),I().customer=void 0,r.init({customerToken:""}),u()}export{P as LS_TOKEN_EXPIRY,C as LS_TOKEN_KEY,B as activateCustomer,M as checkEmail,J as clearLocalData,H as clearLocalTokenData,W as forgotPassword,z as getCustomerAttributes,F as loadToken,O as login,R as logout,X as recoverPassword,q as refreshToken,G as register,K as resendCustomerActivationMail,U as saveCustomer,D as setToken,L as socialLogin,N as socialLoginToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { saveCustomer, socialLogin, socialLoginToken, login, logout, register, activateCustomer, resendCustomerActivationMail, checkEmail, forgotPassword, recoverPassword, getCustomerAttributes, } from "./functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=function(){function n(){}return n.captchaToken=null,n}();export{n as IkasCustomerCaptchaData};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function isCaptchaRequired(): boolean;
|
|
2
|
+
export declare function waitUntilCaptchaTokenInitialized(): Promise<unknown>;
|
|
3
|
+
export declare function clearCaptchaToken(): void;
|
|
4
|
+
export declare function setCaptchaToken(token: string): void;
|
|
5
|
+
export declare function getCaptcha(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasCustomerCaptchaData as r}from"./data.js";function o(){var t;return(null===(t=n.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1}function a(){return new Promise((function(t){var e=setInterval((function(){r.captchaToken&&(clearInterval(e),t(null))}),100)}))}function c(){r.captchaToken=null}function i(t){r.captchaToken=t}function s(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),o()?(window.grecaptcha.execute(),[4,a()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))}export{c as clearCaptchaToken,s as getCaptcha,o as isCaptchaRequired,i as setCaptchaToken,a as waitUntilCaptchaTokenInitialized};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isCaptchaRequired } from "./functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=function(){function n(){}return n.customerConsentGranted=!1,n}();export{n as IkasCustomerConsentData};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const LS_CUSTOMER_CONSENT = "customerConsent";
|
|
2
|
+
export declare function isCustomerConsentGranted(): boolean;
|
|
3
|
+
export declare function onCustomerConsentGrant(): void;
|
|
4
|
+
export declare function saveCustomerConsent(): void;
|
|
5
|
+
export declare function loadCustomerConsent(): void;
|
|
6
|
+
export declare function removeCustomerConsent(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isServer as t}from"../../../utils/helper.js";import{IkasCustomerConsentData as o}from"./data.js";var e="customerConsent";function n(){return o.customerConsentGranted}function r(){s()}function s(){t()||(o.customerConsentGranted=!0,window.localStorage.setItem("customerConsent","true"))}function u(){t()||(o.customerConsentGranted=!!window.localStorage.getItem("customerConsent"))}export{e as LS_CUSTOMER_CONSENT,n as isCustomerConsentGranted,u as loadCustomerConsent,r as onCustomerConsentGrant,s as saveCustomerConsent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isCustomerConsentGranted, onCustomerConsentGrant } from "./functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';import{customerVisit as r}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{isServer as o}from"../../utils/helper.js";import{IkasCustomerAuthData as i}from"./account-auth/data.js";import{loadToken as e,refreshToken as s,clearLocalData as u}from"./account-auth/functions.js";import{loadLastViewedProducts as a}from"./product/functions.js";import{loadCustomerConsent as c}from"./consent/functions.js";import{getCustomer as m}from"@ikas/storefront-api";import{IkasCustomerStore as f,setCustomer as l}from"./index.js";function d(){return new Promise((function(t){var n=setInterval((function(){f.initialized&&(clearInterval(n),t(null))}),100)}))}function p(){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e(),a(),c(),[4,s()];case 1:return t.sent(),[4,j()];case 2:return t.sent(),f.initialized=!0,f.customer&&r(),[2]}}))}))}function h(){e(),!i.token&&f.customer&&u(),i.token&&!f.customer&&j()}function j(){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return o()||!i.token?[2]:[4,m()];case 1:return(t=n.sent()).data&&l(t.data),[2]}}))}))}export{j as getCustomer,p as initCustomerStore,h as routeChangeInit,d as waitForCustomerStoreInit};
|
|
@@ -1,84 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
1
|
+
import { IkasCustomer } from "../../models/data";
|
|
2
|
+
import { IkasRegisterError } from "@ikas/storefront-api";
|
|
3
|
+
export type { IkasRegisterError as RegisterResponseErrorCode };
|
|
4
|
+
export declare type IkasCustomerStoreData = {
|
|
4
5
|
customer?: IkasCustomer | null;
|
|
5
|
-
|
|
6
|
-
private tokenExpiry?;
|
|
7
|
-
private baseStore?;
|
|
8
|
-
private _initialized;
|
|
9
|
-
private _visitorSubscribedEmail;
|
|
10
|
-
private _lastViewedProducts;
|
|
11
|
-
private _customerConsentGranted;
|
|
12
|
-
private _refundSettings?;
|
|
13
|
-
private _captchaToken;
|
|
14
|
-
private _savedLastViewedProducts;
|
|
15
|
-
private _savedLastViewedProductsResponse;
|
|
16
|
-
constructor(baseStore?: IkasBaseStore);
|
|
17
|
-
get initialized(): boolean;
|
|
18
|
-
get canCreateEmailSubscription(): boolean;
|
|
19
|
-
get customerConsentGranted(): boolean;
|
|
20
|
-
get isCaptchaRequired(): boolean;
|
|
21
|
-
private get useLastViewedProductResponse();
|
|
22
|
-
private toAnalyticsCustomer;
|
|
23
|
-
socialLogin(provider: "facebook" | "google"): Promise<void>;
|
|
24
|
-
socialLoginToken(token: string): Promise<boolean>;
|
|
25
|
-
refundOrder(order: IkasOrder): Promise<boolean>;
|
|
26
|
-
login: (email: string, password: string) => Promise<boolean>;
|
|
27
|
-
logout: () => void;
|
|
28
|
-
register: (firstName: string, lastName: string, email: string, password: string, isMarketingAccepted?: boolean, attributes?: IkasCustomerAttributeValue[]) => Promise<boolean>;
|
|
29
|
-
saveContactForm: (input: IkasContactForm) => Promise<boolean>;
|
|
30
|
-
checkEmail: (email: string) => Promise<boolean>;
|
|
31
|
-
forgotPassword: (email: string) => Promise<boolean>;
|
|
32
|
-
recoverPassword: (password: string, passwordAgain: string, token: string) => Promise<boolean>;
|
|
33
|
-
saveCustomer: (customer: IkasCustomer) => Promise<boolean>;
|
|
34
|
-
getOrders: () => Promise<IkasOrder[]>;
|
|
35
|
-
getOrder: (id: string) => Promise<IkasOrder | null>;
|
|
36
|
-
getOrderByEmail: (email: string, orderNumber: string) => Promise<IkasOrder | null>;
|
|
37
|
-
getOrderTransactions: (params?: {
|
|
38
|
-
checkoutId?: string;
|
|
39
|
-
id?: string;
|
|
40
|
-
orderId?: string;
|
|
41
|
-
}) => Promise<IkasOrderTransaction[]>;
|
|
42
|
-
getFavoriteProductsIds: () => Promise<IkasFavoriteProduct[]>;
|
|
43
|
-
getFavoriteProducts: () => Promise<IkasProduct[]>;
|
|
44
|
-
addProductToFavorites: (productId: string) => Promise<boolean>;
|
|
45
|
-
removeProductFromFavorites: (productId: string) => Promise<boolean>;
|
|
46
|
-
isProductFavorite: (productId: string) => Promise<boolean>;
|
|
47
|
-
createEmailSubscription: (email: string) => Promise<boolean>;
|
|
48
|
-
sendReview: (input: IkasCustomerReviewForm) => Promise<import("../../models/data").IkasCustomerReview | null | undefined>;
|
|
49
|
-
onCustomerConsentGrant: () => void;
|
|
50
|
-
waitUntilInitialized: () => Promise<unknown>;
|
|
51
|
-
waitUntilCaptchaTokenInitialized: () => Promise<unknown>;
|
|
52
|
-
getRaffles: () => Promise<IkasRaffleParticipant[] | undefined>;
|
|
53
|
-
getCustomerAttributes: () => Promise<import("../../models/data").IkasCustomerAttribute[]>;
|
|
54
|
-
private init;
|
|
55
|
-
private getOrderRefundSettings;
|
|
56
|
-
private routeChangeInit;
|
|
57
|
-
private getCustomer;
|
|
58
|
-
private refreshToken;
|
|
59
|
-
private setCustomer;
|
|
60
|
-
private setSavedLastViewedProductsResponse;
|
|
61
|
-
private getLastViewedProducts;
|
|
62
|
-
private saveLastViewedProducts;
|
|
63
|
-
private loadLastViewedProducts;
|
|
64
|
-
private getLocalLastViewedProducts;
|
|
65
|
-
private removeLastViewedProducts;
|
|
66
|
-
private onProductView;
|
|
67
|
-
private saveLocalLastViewedProducts;
|
|
68
|
-
private saveCustomerConsent;
|
|
69
|
-
private loadCustomerConsent;
|
|
70
|
-
private removeCustomerConsent;
|
|
71
|
-
private setToken;
|
|
72
|
-
private loadToken;
|
|
73
|
-
private clearLocalTokenData;
|
|
74
|
-
private clearLocalData;
|
|
75
|
-
private clearCaptchaToken;
|
|
76
|
-
private setCaptchaToken;
|
|
77
|
-
private getCaptcha;
|
|
78
|
-
}
|
|
79
|
-
export declare type IkasCustomerReviewForm = {
|
|
80
|
-
comment?: string;
|
|
81
|
-
productId: string;
|
|
82
|
-
star: number;
|
|
83
|
-
title?: string;
|
|
6
|
+
initialized: boolean;
|
|
84
7
|
};
|
|
8
|
+
export declare const IkasCustomerStore: IkasCustomerStoreData;
|
|
9
|
+
export declare function useCustomerStore(): IkasCustomerStoreData;
|
|
10
|
+
export declare function setCustomer(newCustomer: IkasCustomer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import o from"lodash/xorBy";import s from"lodash/cloneDeep";import n from"./api.js";import{IkasCustomer as a}from"../../models/data/customer/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as c}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import{IkasRaffleParticipant as d}from"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import u from"../raffle/index.js";import'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import l from"../product/index.js";import{Analytics as h}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{SaveMyCustomerInput as p}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as f}from"@ikas/storefront-providers";var v="undefined"==typeof localStorage,g=function(){function g(o){var a=this;this.customer=null,this.token=null,this.tokenExpiry=null,this.baseStore=null,this._initialized=!1,this._visitorSubscribedEmail=!1,this._lastViewedProducts=[],this._customerConsentGranted=!1,this._refundSettings=null,this._captchaToken=null,this._savedLastViewedProducts=[],this._savedLastViewedProductsResponse=null,this.toAnalyticsCustomer=function(t){return i(i({},t),{consentGranted:a._customerConsentGranted})},this.login=function(i,r){return t(a,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:i,password:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(o=t.data,this.setToken(o.token,o.tokenExpiry),o.customer&&this.setCustomer(o.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,!0]):[2,!1]}}))}))},this.logout=function(){var t;a.clearLocalData(),null===(t=a.baseStore)||void 0===t||t.cartStore.removeCart(),h.customerLogout()},this.register=function(i,r,o,s,c,d){return t(a,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.register({email:o,password:s,firstName:i,lastName:r,isAcceptMarketing:c,attributes:d,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&(null===(a=t.data)||void 0===a?void 0:a.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.saveLocalLastViewedProducts(),h.completeRegistration(this.toAnalyticsCustomer(this.customer)),[2,!0]):[2,!1]}}))}))},this.saveContactForm=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return h.contactForm(r),[4,this.getCaptcha()];case 1:return e.sent(),[4,n.sendContactFormToMerchant(i(i({},r),{captchaToken:this._captchaToken}))];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.checkEmail=function(i){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.checkEmail({email:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&!!(null===(r=t.data)||void 0===r?void 0:r.exists)]}}))}))},this.forgotPassword=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.forgotPassword({email:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.recoverPassword=function(i,r,o){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.recoverPassword({password:i,passwordAgain:r,token:o,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.saveCustomer=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.saveCustomer({input:new p(i)})];case 1:return(t=e.sent()).isSuccess&&t.data?(this.setCustomer(t.data),[2,!0]):[2,!1]}}))}))},this.getOrders=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.getOrders({})];case 1:return[2,t.sent().data||[]]}}))}))},this.getOrder=function(i){return t(a,void 0,void 0,(function(){var t,r,o;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrders({orderId:i})];case 1:return(t=e.sent()).isSuccess&&(null===(o=t.data)||void 0===o?void 0:o.length)?(r=t.data[0],[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),r.refundSettings=this._refundSettings,[2,r]}}))}))},this.getOrderByEmail=function(i,r){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.getOrderByEmail({email:i,orderNumber:r})];case 1:return[2,t.sent().data||null]}}))}))},this.getOrderTransactions=function(i){return void 0===i&&(i={}),t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.listOrderTransactions({checkoutId:{eq:i.checkoutId},id:{eq:i.checkoutId},orderId:{eq:i.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProductsIds=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProducts=function(){return t(a,void 0,void 0,(function(){var t,i,r,o,s,a;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)?[4,l.searchProducts({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:m.getPriceListId(),salesChannelId:m.getSalesChannelId()}})]:[2,[]];case 2:return i=e.sent(),null===(s=null===(o=i.data)||void 0===o?void 0:o.data)||void 0===s||s.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(a=null==i?void 0:i.data)||void 0===a?void 0:a.data)||[]]}}))}))},this.addProductToFavorites=function(i){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:if(!(null===(r=this.customer)||void 0===r?void 0:r.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!0,productId:i})];case 1:return t=e.sent(),h.addToWishlist(i),[2,t.data||!1]}}))}))},this.removeProductFromFavorites=function(i){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:if(!(null===(r=this.customer)||void 0===r?void 0:r.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!1,productId:i})];case 1:return t=e.sent(),h.addToWishlist(i),[2,t.data||!1]}}))}))},this.isProductFavorite=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(t=this.customer)||void 0===t?void 0:t.id))throw Error("Unauthorized");return[4,n.isFavoriteProduct({productId:i})];case 1:return[2,e.sent().data||!1]}}))}))},this.createEmailSubscription=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.subscribeToMarketingNotifications({input:{email:i,captchaToken:this._captchaToken}})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(i)),[2,t.isSuccess]}}))}))},this.sendReview=function(r){return t(a,void 0,void 0,(function(){var t,o,s,a;return e(this,(function(e){switch(e.label){case 0:if(t=m.getCustomerReviewSettings(),o=m.getSalesChannelId(),!t)return[2];if(!(s=null===(a=this.customer)||void 0===a?void 0:a.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,n.createCustomerReview({input:i(i({},r),{customerId:t.customerLoginRequired?s:void 0,salesChannelId:o||""})})];case 1:return[2,e.sent().data]}}))}))},this.onCustomerConsentGrant=function(){a.saveCustomerConsent()},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a.initialized&&(clearInterval(e),t(null))}),100)}))},this.waitUntilCaptchaTokenInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a._captchaToken&&(clearInterval(e),t(null))}),100)}))},this.getRaffles=function(){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,u.listRaffleParticipants()];case 1:return(t=e.sent())&&t.data?[4,f(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2,null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new d(t)}))]}}))}))},this.getCustomerAttributes=function(){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,n.listCustomerAttribute()];case 1:return t=e.sent(),this.customer&&(null===(i=this.customer.attributes)||void 0===i||i.forEach((function(e){var i,r,o;e.customerAttribute=(null===(i=t.data)||void 0===i?void 0:i.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(o=null===(r=e.customerAttribute)||void 0===r?void 0:r.options)||void 0===o?void 0:o.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))},this.getOrderRefundSettings=function(){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this._refundSettings?[3,2]:[4,n.listOrderRefundSettings({})];case 1:(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)&&(this._refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))},this.setSavedLastViewedProductsResponse=function(t){a._savedLastViewedProducts=s(a._lastViewedProducts),a._savedLastViewedProductsResponse=t},this.setCaptchaToken=function(t){a._captchaToken=t},this.baseStore=o,r(this)}return Object.defineProperty(g.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"canCreateEmailSubscription",{get:function(){var t;return!((null===(t=this.customer)||void 0===t?void 0:t.isSubscribed)||v||this._visitorSubscribedEmail)&&!window.localStorage.getItem("customerEmailSubscription")},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"customerConsentGranted",{get:function(){return this._customerConsentGranted},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"isCaptchaRequired",{get:function(){var t;return(null===(t=m.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"useLastViewedProductResponse",{get:function(){var t;return(null===(t=this._savedLastViewedProducts)||void 0===t?void 0:t.length)&&this._savedLastViewedProductsResponse&&0===o(this._lastViewedProducts,this._savedLastViewedProducts,"productId").length},enumerable:!1,configurable:!0}),g.prototype.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t,r,o;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",r="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(i,"/login/authenticate?redirect=").concat(t),[4,fetch(r,{headers:{"x-api-key":m.getApiKey()||"","x-sfid":m.getStorefrontId()||"","x-sfrid":m.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return o=e.sent(),window.location.href=o.redirectUrl,[2]}}))}))},g.prototype.socialLoginToken=function(i){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.socialLogin({code:i})];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(r=t.data)||void 0===r?void 0:r.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.customer&&h.customerLogin(),[2,!0]):[2,!1]}}))}))},g.prototype.refundOrder=function(i){return t(this,void 0,void 0,(function(){var t,r,o=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],i.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,n.createOrderRefundRequest({input:{orderId:i.id,orderLineItems:t}})];case 1:return(r=e.sent()).isSuccess&&r.data?(Object.entries(r.data).forEach((function(t){var e=t[0],i=t[1];o[e]=i})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))},g.prototype.init=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.loadToken(),this.loadLastViewedProducts(),this.loadCustomerConsent(),[4,this.refreshToken()];case 1:return t.sent(),[4,this.getCustomer()];case 2:return t.sent(),this._initialized=!0,this.customer&&h.customerVisit(),[2]}}))}))},g.prototype.routeChangeInit=function(){this.loadToken(),!this.token&&this.customer&&this.clearLocalData(),this.token&&!this.customer&&this.getCustomer()},g.prototype.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return v||!this.token?[2]:[4,n.getCustomer()];case 1:return(t=e.sent()).data&&this.setCustomer(t.data),[2]}}))}))},g.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.token?[4,n.refreshToken({token:this.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?this.setToken(t.data.token,t.data.tokenExpiry):(this.token=null,this.tokenExpiry=null,this.clearLocalData()),[2]}}))}))},g.prototype.setCustomer=function(t){this.customer=new a(t)},g.prototype.getLastViewedProducts=function(){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.getLastViewedProducts({customerId:this.customer.id})]:[3,2];case 1:return t=e.sent(),this._lastViewedProducts=(null===(i=s(t.data))||void 0===i?void 0:i.reverse())||[],[3,3];case 2:this.loadLastViewedProducts(),e.label=3;case 3:return[2,this._lastViewedProducts]}}))}))},g.prototype.saveLastViewedProducts=function(){v||window.localStorage.setItem("lastViewedProducts",JSON.stringify(this._lastViewedProducts))},g.prototype.loadLastViewedProducts=function(){v||(this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=s(this._lastViewedProducts).reverse())},g.prototype.getLocalLastViewedProducts=function(){if(v)return[];try{var t=window.localStorage.getItem("lastViewedProducts");if(t)return JSON.parse(t)}catch(t){}return[]},g.prototype.removeLastViewedProducts=function(){v||window.localStorage.removeItem("lastViewedProducts")},g.prototype.onProductView=function(i,r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?this._lastViewedProducts.find((function(t){return t.productId===i}))?[2]:[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:[{productId:i,variantId:r}]}})]:[3,2];case 1:return t.sent()&&this._lastViewedProducts.push({productId:i,variantId:r}),[3,3];case 2:this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=this._lastViewedProducts.filter((function(t){return t.productId!==i})),this._lastViewedProducts.push({productId:i,variantId:r}),this._lastViewedProducts=this._lastViewedProducts.slice(-20),this.saveLastViewedProducts(),t.label=3;case 3:return[2]}}))}))},g.prototype.saveLocalLastViewedProducts=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(v)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),(t=this.getLocalLastViewedProducts()).length?[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:t}})]:[3,3];case 2:e.sent()&&this.removeLastViewedProducts(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},g.prototype.saveCustomerConsent=function(){v||(this._customerConsentGranted=!0,window.localStorage.setItem("customerConsent","true"))},g.prototype.loadCustomerConsent=function(){v||(this._customerConsentGranted=!!window.localStorage.getItem("customerConsent"))},g.prototype.removeCustomerConsent=function(){v||window.localStorage.removeItem("customerConsent")},g.prototype.setToken=function(t,e){v||(this.token=t,this.tokenExpiry=e,localStorage.setItem("customerToken",t),localStorage.setItem("customerTokenExpiry",e+""),m.init({customerToken:t}))},g.prototype.loadToken=function(){if(!v){var t=localStorage.getItem("customerToken"),e=localStorage.getItem("customerTokenExpiry");t&&e?this.setToken(t,parseInt(e)):this.clearLocalTokenData()}},g.prototype.clearLocalTokenData=function(){localStorage.removeItem("customerToken"),localStorage.removeItem("customerTokenExpiry"),this.token=void 0,this.tokenExpiry=void 0},g.prototype.clearLocalData=function(){this.clearLocalTokenData(),this.customer=void 0,m.init({customerToken:""}),this.clearCaptchaToken()},g.prototype.clearCaptchaToken=function(){this._captchaToken=null},g.prototype.getCaptcha=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.isCaptchaRequired?(window.grecaptcha.execute(),[4,this.waitUntilCaptchaTokenInitialized()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))},g}();export{g as IkasCustomerStore};
|
|
1
|
+
import{observable as o}from"mobx";import"@ikas/storefront-api";var r=o({customer:null,initialized:!1}),t=r;function i(){return t}function n(t){r.customer=o(t)}export{t as IkasCustomerStore,n as setCustomer,i as useCustomerStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=function(){function i(){}return i.visitorSubscribedEmail=!1,i}();export{i as IkasCustomerMarketingData};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IkasContactForm } from "../../../models/data";
|
|
2
|
+
export declare const LS_CUSTOMER_SUB_KEY = "customerEmailSubscription";
|
|
3
|
+
export declare function canCreateEmailSubscription(): boolean;
|
|
4
|
+
export declare function saveContactForm(input: IkasContactForm): Promise<boolean>;
|
|
5
|
+
export declare function createEmailSubscription(email: string): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as r,__assign as s}from'./../../../ext/tslib/tslib.es6.js';import{sendContactFormToMerchant as i,subscribeToMarketingNotifications as o}from"@ikas/storefront-api";import{IkasCustomerFunctions as e}from"@ikas/storefront-model-functions";import{IkasCustomerStore as c}from"../index.js";import{contactForm as a,createEmailSubscripition as n}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasCustomerEmailSubscriptionStatus as u}from"@ikas/storefront-models";import"@ikas/localized-address";import{isServer as m}from"../../../utils/helper.js";import{IkasCustomerCaptchaData as l}from"../captcha/data.js";import{clearCaptchaToken as p,getCaptcha as f}from"../captcha/functions.js";import{IkasCustomerMarketingData as d}from"./data.js";var b="customerEmailSubscription";function h(){var t=c,r=e.isCustomerSubscribedToEmails;return!(t.customer&&r(t.customer)||m()||d.visitorSubscribedEmail)&&!window.localStorage.getItem("customerEmailSubscription")}function S(o){return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return a(o),[4,f()];case 1:return r.sent(),[4,i(s(s({},o),{captchaToken:l.captchaToken}))];case 2:return t=r.sent(),p(),[2,t.isSuccess]}}))}))}function v(s){return t(this,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return[4,f()];case 1:return r.sent(),t=c,[4,o({input:{email:s,captchaToken:l.captchaToken}})];case 2:return(i=r.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),t.customer?(t.customer.subscriptionStatus,u.SUBSCRIBED):d.visitorSubscribedEmail=!0,n(s)),[2,i.isSuccess]}}))}))}export{b as LS_CUSTOMER_SUB_KEY,h as canCreateEmailSubscription,v as createEmailSubscription,S as saveContactForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { canCreateEmailSubscription, saveContactForm, createEmailSubscription, } from "./functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=function(){function n(){}return n.refundSettings=null,n}();export{n as IkasCustomerOrderData};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IkasOrderTransaction, IkasOrder } from "../../../models/data";
|
|
2
|
+
export declare function getOrders(): Promise<IkasOrder[]>;
|
|
3
|
+
export declare function getOrder(id: string): Promise<IkasOrder | null>;
|
|
4
|
+
export declare function getOrderByEmail(email: string, orderNumber: string): Promise<IkasOrder | null>;
|
|
5
|
+
export declare function getOrderTransactions(params?: {
|
|
6
|
+
checkoutId?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
orderId?: string;
|
|
9
|
+
}): Promise<IkasOrderTransaction[]>;
|
|
10
|
+
export declare function refundOrder(order: IkasOrder): Promise<boolean>;
|
|
11
|
+
export declare function getOrderRefundSettings(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import{getOrders as n,listOrderRefundSettings as r,getOrderByEmail as i,listOrderTransactions as u,createOrderRefundRequest as s}from"@ikas/storefront-api";import{IkasCustomerOrderData as a}from"./data.js";function o(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n({})];case 1:return[2,t.sent().data||[]]}}))}))}function d(r){var i;return t(this,void 0,void 0,(function(){var t,u;return e(this,(function(e){switch(e.label){case 0:return[4,n({orderId:r})];case 1:return(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?(u=t.data[0],[4,h()]):[2,null];case 2:return e.sent(),u.refundSettings=a.refundSettings,[2,u]}}))}))}function c(n,r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,i({email:n,orderNumber:r})];case 1:return[2,t.sent().data||null]}}))}))}function l(n){return void 0===n&&(n={}),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u({checkoutId:{eq:n.checkoutId},id:{eq:n.checkoutId},orderId:{eq:n.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))}function f(n){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],n.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,s({input:{orderId:n.id,orderLineItems:t}})];case 1:return(r=e.sent()).isSuccess&&r.data?(Object.entries(r.data).forEach((function(t){var e=t[0],r=t[1];n[e]=r})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))}function h(){var n;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return a.refundSettings?[3,2]:[4,r({})];case 1:(t=e.sent()).isSuccess&&(null===(n=t.data)||void 0===n?void 0:n.length)&&(a.refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))}export{d as getOrder,c as getOrderByEmail,h as getOrderRefundSettings,l as getOrderTransactions,o as getOrders,f as refundOrder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getOrders, getOrder, getOrderByEmail, getOrderTransactions, refundOrder, } from "./functions";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IkasLastViewedProduct, IkasProduct } from "../../../models/data";
|
|
2
|
+
import { APIResponse } from "@ikas/fe-api-client";
|
|
3
|
+
import { ProductFacetCount, SearchProduct } from "@ikas/storefront-api/src/__api/types";
|
|
4
|
+
export declare class IkasCustomerProductData {
|
|
5
|
+
static lastViewedProducts: IkasLastViewedProduct[];
|
|
6
|
+
static savedLastViewedProducts: IkasLastViewedProduct[];
|
|
7
|
+
static savedLastViewedProductsResponse: APIResponse<{
|
|
8
|
+
data: IkasProduct[] | undefined;
|
|
9
|
+
count?: number | undefined;
|
|
10
|
+
facets?: ProductFacetCount[] | null | undefined;
|
|
11
|
+
limit?: number | undefined;
|
|
12
|
+
page?: number | undefined;
|
|
13
|
+
results?: SearchProduct[] | undefined;
|
|
14
|
+
totalCount?: number | undefined;
|
|
15
|
+
locale: string;
|
|
16
|
+
}> | null;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=function(){function e(){}return e.lastViewedProducts=[],e.savedLastViewedProducts=[],e.savedLastViewedProductsResponse=null,e}();export{e as IkasCustomerProductData};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IkasFavoriteProduct, IkasProduct, IkasCustomerReviewForm } from "../../../models/data";
|
|
2
|
+
import { APIResponse } from "@ikas/storefront-api";
|
|
3
|
+
export declare const LS_LAST_VIEWED_PRODUCTS_KEY = "lastViewedProducts";
|
|
4
|
+
export declare function getFavoriteProductsIds(): Promise<IkasFavoriteProduct[]>;
|
|
5
|
+
export declare function getFavoriteProducts(): Promise<IkasProduct[]>;
|
|
6
|
+
export declare function addProductToFavorites(productId: string): Promise<boolean>;
|
|
7
|
+
export declare function removeProductFromFavorites(productId: string): Promise<boolean>;
|
|
8
|
+
export declare function isProductFavorite(productId: string): Promise<boolean>;
|
|
9
|
+
export declare function sendReview(input: IkasCustomerReviewForm): Promise<import("@ikas/storefront-models/build-cjs/models/customer/review").IkasCustomerReview | undefined>;
|
|
10
|
+
export declare function shouldUseLastViewedProductResponse(): boolean;
|
|
11
|
+
export declare function handleProductViewEvent(productId: string, variantId: string): Promise<void>;
|
|
12
|
+
export declare function getLastViewedProducts(): Promise<import("@ikas/storefront-models/build-cjs/models/last-viewed-product").IkasLastViewedProduct[]>;
|
|
13
|
+
export declare function setSavedLastViewedProductsResponse(response: APIResponse<any>): void;
|
|
14
|
+
export declare function saveLastViewedProducts(): void;
|
|
15
|
+
export declare function loadLastViewedProducts(): void;
|
|
16
|
+
export declare function getLocalLastViewedProducts(): any;
|
|
17
|
+
export declare function removeLastViewedProducts(): void;
|
|
18
|
+
export declare function saveLocalLastViewedProducts(): Promise<void>;
|
|
19
|
+
export declare function isBackInStockEnabled(): boolean;
|
|
20
|
+
export declare function isBackInStockCustomerLoginRequired(): boolean | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{addToWishlist as s}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasCustomerProductData as n}from"./data.js";import{isServer as o}from"../../../utils/helper.js";import u from"lodash/xorBy";import d from"lodash/cloneDeep";import{IkasCustomerStore as a}from"../index.js";import{listFavoriteProducts as c,searchProducts as l,saveFavoriteProduct as v,isFavoriteProduct as f,createCustomerReview as h,saveLastViewedProducts as w,getLastViewedProducts as m}from"@ikas/storefront-api";var p="lastViewedProducts";function V(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return a.customer?[4,c()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))}function I(){var r,s,n,o;return t(this,void 0,void 0,(function(){var t,u;return e(this,(function(e){switch(e.label){case 0:return a.customer?[4,c()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)?[4,l({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})]:[2,[]];case 2:return u=e.sent(),null===(n=null===(s=u.data)||void 0===s?void 0:s.data)||void 0===n||n.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(o=null==u?void 0:u.data)||void 0===o?void 0:o.data)||[]]}}))}))}function P(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=a.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,v({isFavorite:!0,productId:r})];case 1:return t=e.sent(),s(r),[2,t.data||!1]}}))}))}function g(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=a.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,v({isFavorite:!1,productId:r})];case 1:return t=e.sent(),s(r),[2,t.data||!1]}}))}))}function b(r){var i;return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:if(!(null===(i=a.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,f({productId:r})];case 1:return[2,t.sent().data||!1]}}))}))}function L(s){var n;return t(this,void 0,void 0,(function(){var t,o,u,d;return e(this,(function(e){switch(e.label){case 0:if(t=i.getCustomerReviewSettings(),o=i.getSalesChannelId(),u=a,!t)return[2];if(!(d=null===(n=u.customer)||void 0===n?void 0:n.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,h({input:r(r({},s),{customerId:t.customerLoginRequired?d:void 0,salesChannelId:o||""})})];case 1:return[2,e.sent().data]}}))}))}function S(){var t;return!!(null===(t=n.savedLastViewedProducts)||void 0===t?void 0:t.length)&&!!n.savedLastViewedProductsResponse&&0===u(n.lastViewedProducts,n.savedLastViewedProducts,"productId").length}function y(r,i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return(t=a).customer?n.lastViewedProducts.find((function(t){return t.productId===r}))?[2]:[4,w({input:{customerId:t.customer.id,products:[{productId:r,variantId:i}]}})]:[3,2];case 1:return e.sent()&&n.lastViewedProducts.push({productId:r,variantId:i}),[3,3];case 2:n.lastViewedProducts=R(),n.lastViewedProducts=n.lastViewedProducts.filter((function(t){return t.productId!==r})),n.lastViewedProducts.push({productId:r,variantId:i}),n.lastViewedProducts=n.lastViewedProducts.slice(-20),C(),e.label=3;case 3:return[2]}}))}))}function j(){var r;return t(this,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return(t=a).customer?[4,m({customerId:t.customer.id})]:[3,2];case 1:return i=e.sent(),n.lastViewedProducts=(null===(r=i.data)||void 0===r?void 0:r.reverse())||[],[3,3];case 2:E(),e.label=3;case 3:return[2,n.lastViewedProducts]}}))}))}function k(t){n.savedLastViewedProducts=d(n.lastViewedProducts),n.savedLastViewedProductsResponse=t}function C(){o()||window.localStorage.setItem("lastViewedProducts",JSON.stringify(n.lastViewedProducts))}function E(){o()||(n.lastViewedProducts=R(),n.lastViewedProducts=d(n.lastViewedProducts).reverse())}function R(){if(o())return[];try{var t=window.localStorage.getItem("lastViewedProducts");if(t)return JSON.parse(t)}catch(t){}return[]}function x(){o()||window.localStorage.removeItem("lastViewedProducts")}function z(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:if(o())return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),t=a,(r=R()).length?[4,w({input:{customerId:t.customer.id,products:r}})]:[3,3];case 2:e.sent()&&x(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))}function U(){return i.isBackInStockEnabled()}function q(){return i.isCustomerLoginRequiredForBackInStock()}export{p as LS_LAST_VIEWED_PRODUCTS_KEY,P as addProductToFavorites,I as getFavoriteProducts,V as getFavoriteProductsIds,j as getLastViewedProducts,R as getLocalLastViewedProducts,y as handleProductViewEvent,q as isBackInStockCustomerLoginRequired,U as isBackInStockEnabled,b as isProductFavorite,E as loadLastViewedProducts,x as removeLastViewedProducts,g as removeProductFromFavorites,C as saveLastViewedProducts,z as saveLocalLastViewedProducts,L as sendReview,k as setSavedLastViewedProductsResponse,S as shouldUseLastViewedProductResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getFavoriteProductsIds, getFavoriteProducts, addProductToFavorites, removeProductFromFavorites, isProductFavorite, sendReview, isBackInStockCustomerLoginRequired, isBackInStockEnabled, } from "./functions";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { waitForCustomerStoreInit as waitUntilInitialized } from "./functions";
|
|
2
|
+
export * from "./account-auth/functions";
|
|
3
|
+
export * from "./captcha/public";
|
|
4
|
+
export * from "./consent/public";
|
|
5
|
+
export * from "./marketing/public";
|
|
6
|
+
export * from "./order/public";
|
|
7
|
+
export * from "./product/public";
|
|
8
|
+
export * from "./raffle/public";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{waitForCustomerStoreInit as waitUntilInitialized}from"./functions.js";export{LS_TOKEN_EXPIRY,LS_TOKEN_KEY,activateCustomer,checkEmail,clearLocalData,clearLocalTokenData,forgotPassword,getCustomerAttributes,loadToken,login,logout,recoverPassword,refreshToken,register,resendCustomerActivationMail,saveCustomer,setToken,socialLogin,socialLoginToken}from"./account-auth/functions.js";export{isCaptchaRequired}from"./captcha/functions.js";export{isCustomerConsentGranted,onCustomerConsentGrant}from"./consent/functions.js";export{canCreateEmailSubscription,createEmailSubscription,saveContactForm}from"./marketing/functions.js";export{getOrder,getOrderByEmail,getOrderTransactions,getOrders,refundOrder}from"./order/functions.js";export{addProductToFavorites,getFavoriteProducts,getFavoriteProductsIds,isBackInStockCustomerLoginRequired,isBackInStockEnabled,isProductFavorite,removeProductFromFavorites,sendReview}from"./product/functions.js";export{getRaffles}from"./raffle/functions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getRaffles(): Promise<import("@ikas/storefront-models").IkasRaffleParticipant[] | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.js';import{listRaffleParticipants as e}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as o}from"@ikas/storefront-providers";function s(){return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,e()];case 1:return(t=r.sent())&&t.data?[4,o(t.data)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2,t.data]}}))}))}export{s as getRaffles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getRaffles } from "./functions";
|
package/build/store/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export { IkasBaseStore } from "./base";
|
|
2
|
-
export type { IkasLocaleOption } from "./base";
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
1
|
+
export { useBaseStore, IkasBaseStore } from "./base";
|
|
2
|
+
export type { IkasLocaleOption, IkasLanguageOption } from "./base";
|
|
3
|
+
export * as IkasBaseStoreFunctions from "./base/public";
|
|
4
|
+
export { useCustomerStore, IkasCustomerStore } from "./customer";
|
|
5
|
+
export type { IkasCustomerStoreData, RegisterResponseErrorCode, } from "./customer";
|
|
6
|
+
export * as IkasCustomerStoreFunctions from "./customer/public";
|
|
7
|
+
export { useCartStore, IkasCartStore } from "./cart";
|
|
8
|
+
export type { IkasCartOperationResult, IkasCartOperationValidationError, } from "./cart";
|
|
9
|
+
export * as IkasCartStoreFunctions from "./cart/public";
|
package/build/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var r=["DE","US","AT"],
|
|
1
|
+
var r=["DE","US","AT"],S=["US"];export{S as DISTRICT_HIDDEN_COUNTRY_LIST,r as FREE_TEXT_CITY_COUNTRY_LIST};
|
package/build/utils/helper.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export declare function findAllIndexes(str: string, pattern: string): number[];
|
|
|
2
2
|
export declare function stringSorter(atitle: string, btitle: string): number;
|
|
3
3
|
export declare function capitalize(value: string): string;
|
|
4
4
|
export declare function tryForEach(items: Array<any>, callback: (item: any, index: number) => void, printErrors?: boolean): void;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function isServer(): boolean;
|
package/build/utils/helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasStorefrontConfig as r}from"@ikas/storefront-config";function e(r,e){var n=[];if(!r||!e)return[];for(var t=0;t<r.length;){var o=r.indexOf(e,t);if(-1===o)break;t=o+1,n.push(o)}return n}function n(r,e){var n="0123456789AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz",t=r||"",o=e||"";if(0===t.length||0===o.length)return t.length-o.length;for(var
|
|
1
|
+
import{IkasStorefrontConfig as r}from"@ikas/storefront-config";function e(r,e){var n=[];if(!r||!e)return[];for(var t=0;t<r.length;){var o=r.indexOf(e,t);if(-1===o)break;t=o+1,n.push(o)}return n}function n(r,e){var n="0123456789AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz",t=r||"",o=e||"";if(0===t.length||0===o.length)return t.length-o.length;for(var f=0;f<t.length&&f<o.length;f++){var a=n.indexOf(t[f].toUpperCase()),i=n.indexOf(o[f].toUpperCase());if(a!==i)return a-i}return 0}function t(e){var n=e.toLocaleLowerCase(r.getCurrentLocale());return n.charAt(0).toLocaleUpperCase(r.getCurrentLocale())+n.slice(1)}function o(r,e,n){void 0===n&&(n=!1),r.forEach((function(r,t){try{e(r,t)}catch(r){n&&console.error(r)}}))}function f(){return"undefined"==typeof window}export{t as capitalize,e as findAllIndexes,f as isServer,n as stringSorter,o as tryForEach};
|
package/build/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.20",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^5.0.0-beta.
|
|
21
|
-
"@ikas/storefront-config": "^5.0.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^5.0.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
24
|
-
"@ikas/storefront-providers": "^5.0.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^5.0.0-beta.20",
|
|
21
|
+
"@ikas/storefront-config": "^5.0.0-beta.20",
|
|
22
|
+
"@ikas/storefront-model-functions": "^5.0.0-beta.20",
|
|
23
|
+
"@ikas/storefront-models": "^5.0.0-beta.20",
|
|
24
|
+
"@ikas/storefront-providers": "^5.0.0-beta.20",
|
|
25
|
+
"@ikas/localized-address": "^1.0.0-beta.2",
|
|
25
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
26
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
27
28
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -49,14 +50,16 @@
|
|
|
49
50
|
"@stripe/react-stripe-js": "^1.10.0",
|
|
50
51
|
"@stripe/stripe-js": "^1.29.0",
|
|
51
52
|
"react-tooltip": "^4.2.21",
|
|
52
|
-
"libphonenumber-js": "^1.10.6"
|
|
53
|
+
"libphonenumber-js": "^1.10.6",
|
|
54
|
+
"@paypal/react-paypal-js": "^7.8.2"
|
|
53
55
|
},
|
|
54
56
|
"peerDependencies": {
|
|
55
|
-
"@ikas/
|
|
56
|
-
"@ikas/storefront-
|
|
57
|
-
"@ikas/storefront-
|
|
58
|
-
"@ikas/storefront-
|
|
59
|
-
"@ikas/storefront-
|
|
57
|
+
"@ikas/localized-address": "^1.0.0-beta.2",
|
|
58
|
+
"@ikas/storefront-api": "^5.0.0-beta.20",
|
|
59
|
+
"@ikas/storefront-config": "^5.0.0-beta.20",
|
|
60
|
+
"@ikas/storefront-model-functions": "^5.0.0-beta.20",
|
|
61
|
+
"@ikas/storefront-models": "^5.0.0-beta.20",
|
|
62
|
+
"@ikas/storefront-providers": "^5.0.0-beta.20",
|
|
60
63
|
"mobx": "^6.1.3",
|
|
61
64
|
"mobx-react-lite": "^3.1.5",
|
|
62
65
|
"next": "12.2.0",
|
|
@@ -69,6 +72,7 @@
|
|
|
69
72
|
"@stripe/stripe-js": "^1.29.0",
|
|
70
73
|
"react-tooltip": "^4.2.21",
|
|
71
74
|
"libphonenumber-js": "^1.10.6",
|
|
72
|
-
"@adyen/adyen-web": "^5.28.2"
|
|
75
|
+
"@adyen/adyen-web": "^5.28.2",
|
|
76
|
+
"@paypal/react-paypal-js": "^7.8.2"
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=t=>((t,e)=>{const{forward:n=[],...i}=t||{},o=JSON.stringify(i,((t,e)=>("function"==typeof e&&(e=String(e)).startsWith(t+"(")&&(e="function "+e),e)));return["!(function(w,p,f,c){",Object.keys(i).length>0?`c=w[p]=Object.assign(w[p]||{},${o});`:"c=w[p]=w[p]||{};","c[f]=(c[f]||[])",n.length>0?`.concat(${JSON.stringify(n)})`:"","})(window,'partytown','forward');",e].join("")})(t,'/* Partytown 0.7.3 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,"/"==(a=(o.lib||"/~partytown/")+(o.debug?"debug/":""))[0]&&(s=e.querySelectorAll(\'script[type="text/partytown"]\'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener("pt0",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.7.3":"sandbox-sw.html?"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement("script")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(".").map((function(e,n,i){p=p[i[n]]=n+1<i.length?"push"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),"complete"==e.readyState?u():(t.addEventListener("DOMContentLoaded",u),t.addEventListener("load",u))}(window,document,navigator,top,window.crossOriginIsolated);');export{t as partytownSnippet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"react";import{partytownSnippet as e}from"../integration/index.mjs.js";const n=(n={})=>{if("undefined"!=typeof document&&!document._partytown){if(!document.querySelector("script[data-partytown]")){const t=document.createElement("script");t.dataset.partytown="",t.innerHTML=e(n),document.head.appendChild(t)}document._partytown=!0}const r=e(n)+'document.currentScript.dataset.partytown="";';return t.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r}})};export{n as Partytown};
|
package/build/hooks/useStore.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout/country-settings-model.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import{IkasBaseStore as o}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";function t(){return o.getInstance()}export{t as useStore};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=function(t){this.id=t.id,this.createdAt=t.createdAt,this.updatedAt=t.updatedAt,this.deleted=t.deleted};export{t as IkasBaseModel};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IkasBaseModel } from "../../base";
|
|
2
|
-
import { IkasBlogMetaData } from "../meta-data";
|
|
3
|
-
import { IkasBlogCategory as IBlogCategory } from "@ikas/storefront-models";
|
|
4
|
-
import { IkasImage } from "../../image";
|
|
5
|
-
export declare class IkasBlogCategory extends IkasBaseModel implements IBlogCategory {
|
|
6
|
-
imageId: string;
|
|
7
|
-
metadata: IkasBlogMetaData;
|
|
8
|
-
name: string;
|
|
9
|
-
image?: IkasImage | null;
|
|
10
|
-
constructor(data: IBlogCategory);
|
|
11
|
-
get href(): string;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__extends as e}from'./../../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as t}from"../../base/index.js";import{IkasBlogMetaData as i}from"../meta-data/index.js";import{IkasImage as r}from"../../image/index.js";import{IkasBlogCategoryFunctions as a}from"@ikas/storefront-model-functions";var o=function(t){function o(e){var a=t.call(this,e)||this;return a.imageId=e.imageId,a.metadata=new i(e.metadata),a.name=e.name,a.image=e.image?new r(e.image):e.imageId?new r({id:e.imageId,isVideo:!1}):null,a}return e(o,t),Object.defineProperty(o.prototype,"href",{get:function(){return a.getIkasBlogCategoryHref(this)},enumerable:!1,configurable:!0}),o}(t);export{o as IkasBlogCategory};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__extends as t}from'./../../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as n}from"../../base/index.js";var o=function(n){function o(t){var o=n.call(this,t)||this;return o.content=t.content,o}return t(o,n),o}(n);export{o as IkasBlogContent};
|