@ikas/storefront 2.0.33-alpha.1 → 2.0.33

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.
Files changed (98) hide show
  1. package/build/analytics/analytics.js +1 -1
  2. package/build/analytics/googleTagManager.js +1 -1
  3. package/build/analytics/ikas.js +1 -1
  4. package/build/api/brand/index.js +1 -1
  5. package/build/api/category/index.js +1 -1
  6. package/build/api/checkout/index.js +1 -1
  7. package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +1 -1
  8. package/build/api/customer/index.js +1 -1
  9. package/build/api/customer-review/index.js +1 -1
  10. package/build/api/customer-review-summary/__generated__/listCustomerReviewSummary.d.ts +56 -0
  11. package/build/api/customer-review-summary/index.d.ts +22 -0
  12. package/build/api/customer-review-summary/index.js +1 -0
  13. package/build/api/favorite-product/index.js +1 -1
  14. package/build/api/html-meta-data/index.js +1 -1
  15. package/build/api/index.d.ts +1 -0
  16. package/build/api/merchant/index.js +1 -1
  17. package/build/api/product-search/index.js +1 -1
  18. package/build/components/checkout/components/address-form/model.js +1 -1
  19. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  20. package/build/components/checkout/components/credit-card-form/index.js +1 -1
  21. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  22. package/build/components/checkout/index.js +1 -1
  23. package/build/components/checkout/model.js +1 -1
  24. package/build/components/checkout/steps/step-success/index.js +1 -1
  25. package/build/components/page/head.js +1 -1
  26. package/build/components/page/index.js +1 -1
  27. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  28. package/build/components/page-editor/model.js +1 -1
  29. package/build/ikas.js +7 -7
  30. package/build/index.js +1 -1
  31. package/build/models/data/customer-review-summary/index.d.ts +16 -0
  32. package/build/models/data/customer-review-summary/index.js +1 -0
  33. package/build/models/data/index.d.ts +1 -0
  34. package/build/models/data/product/variant/index.js +1 -1
  35. package/build/models/data/storefront/theme-localization/index.js +1 -1
  36. package/build/models/theme/page/component/prop-value/product-list.js +1 -1
  37. package/build/models/ui/blog-category-list/index.js +1 -1
  38. package/build/models/ui/blog-list/index.js +1 -1
  39. package/build/models/ui/brand-list/index.js +1 -1
  40. package/build/models/ui/category-list/index.js +1 -1
  41. package/build/models/ui/customer-review-list/index.js +1 -1
  42. package/build/models/ui/customer-review-summary-list/index.d.ts +43 -0
  43. package/build/models/ui/customer-review-summary-list/index.js +1 -0
  44. package/build/models/ui/index.d.ts +1 -0
  45. package/build/models/ui/product-detail/index.d.ts +2 -1
  46. package/build/models/ui/product-detail/index.js +1 -1
  47. package/build/models/ui/product-list/index.js +1 -1
  48. package/build/models/ui/raffle-list/index.js +1 -1
  49. package/build/models/ui/validator/form/address.js +1 -1
  50. package/build/pages/404.js +1 -1
  51. package/build/pages/_slug_/index.js +1 -1
  52. package/build/pages/account/addresses.js +1 -1
  53. package/build/pages/account/favorite-products.js +1 -1
  54. package/build/pages/account/forgot-password.js +1 -1
  55. package/build/pages/account/index.js +1 -1
  56. package/build/pages/account/login.js +1 -1
  57. package/build/pages/account/orders/_id_.js +1 -1
  58. package/build/pages/account/orders/index.js +1 -1
  59. package/build/pages/account/raffles.js +1 -1
  60. package/build/pages/account/recover-password.js +1 -1
  61. package/build/pages/account/register.js +1 -1
  62. package/build/pages/blog/_slug_.js +1 -1
  63. package/build/pages/blog/index.js +1 -1
  64. package/build/pages/cart.js +1 -1
  65. package/build/pages/checkout.js +1 -1
  66. package/build/pages/home.js +1 -1
  67. package/build/pages/pages/_slug_.js +1 -1
  68. package/build/pages/raffle/_slug_.js +1 -1
  69. package/build/pages/raffle/index.js +1 -1
  70. package/build/pages/search.js +1 -1
  71. package/build/providers/helpers/raffles.js +1 -1
  72. package/build/providers/page-data-get.js +1 -1
  73. package/build/providers/page-data-init.js +1 -1
  74. package/build/providers/page-data-next.js +1 -1
  75. package/build/providers/placeholders.js +1 -1
  76. package/build/providers/prop-value/attribute-list.js +1 -1
  77. package/build/providers/prop-value/attribute.js +1 -1
  78. package/build/providers/prop-value/blog-category-list.js +1 -1
  79. package/build/providers/prop-value/blog-category.js +1 -1
  80. package/build/providers/prop-value/blog-list.js +1 -1
  81. package/build/providers/prop-value/blog.js +1 -1
  82. package/build/providers/prop-value/brand-list.js +1 -1
  83. package/build/providers/prop-value/brand.js +1 -1
  84. package/build/providers/prop-value/category-list.js +1 -1
  85. package/build/providers/prop-value/category.js +1 -1
  86. package/build/providers/prop-value/custom.js +1 -1
  87. package/build/providers/prop-value/image-list.js +1 -1
  88. package/build/providers/prop-value/image.js +1 -1
  89. package/build/providers/prop-value/link.js +1 -1
  90. package/build/providers/prop-value/product-detail.js +1 -1
  91. package/build/providers/prop-value/product-list.js +1 -1
  92. package/build/providers/prop-value/raffle-list.js +1 -1
  93. package/build/providers/prop-value/raffle.js +1 -1
  94. package/build/scripts/generators/types/index.js +1 -1
  95. package/build/store/base.js +1 -1
  96. package/build/store/cart.js +1 -1
  97. package/build/store/customer.js +1 -1
  98. package/package.json +1 -1
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import{IkasCategory as s}from"../models/data/category/index.js";import{IkasCheckout as a}from"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/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/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/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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as d}from"./googleTagManager.js";import{IkasCart as u}from"../models/data/cart/index.js";import{IkasEventType as l}from"./events.js";import{IkasStorefrontConfig as m}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";var h=function(){function h(){o(this)}return h.getCustomerInfo=function(){return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,(t=m.store).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},h.pageView=function(r){return t(this,void 0,void 0,(function(){var t,o,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=window.location.href,[4,h.getCustomerInfo()];case 1:return o=e.sent(),d.pageView(t),f.pageView(r),b(h.subscribers,(function(e){e.callback({type:l.PAGE_VIEW,data:{url:t,pageType:r,customer:o}})})),[3,3];case 2:return i=e.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},h.productView=function(t){try{if(n.productView(t),d.productView(t),f.productView(t),h.subscribers.length){var e=p(t),r=new c(e.product,e.selectedVariantValues);b(h.subscribers,(function(t){t.callback({type:l.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(t){console.error(t)}},h.addToCart=function(t,e,r,o){try{if(n.addToCart(t,e,r),d.addToCart(t,e),f.addToCart(t,e,o),h.subscribers.length){var i=p(t),s=new u(p(o));b(h.subscribers,(function(t){t.callback({type:l.ADD_TO_CART,data:{item:i,quantity:e,cart:s}})}))}}catch(t){console.error(t)}},h.removeFromCart=function(t,e,r){try{if(d.removeFromCart(t,e),h.subscribers.length){var o=p(t),i=new u(p(r));b(h.subscribers,(function(t){t.callback({type:l.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},h.beginCheckout=function(t){try{var e=localStorage.getItem("gtmBeginCheckout");if(e&&t.id===e)return;if(localStorage.setItem("gtmBeginCheckout",t.id),n.beginCheckout(t),d.beginCheckout(t),f.beginCheckout(t),h.subscribers.length){var r=new a(p(t));b(h.subscribers,(function(t){t.callback({type:l.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(t){console.error(t)}},h.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(t,e.id||""),d.purchase(t,e.id||""),f.orderSuccess(t),h.subscribers.length){var r=new a(p(t)),o=p(e);b(h.subscribers,(function(t){t.callback({type:l.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},h.checkoutStep=function(t,e){try{if(d.checkoutStep(t,e),f.checkoutStep(t,e),h.subscribers.length){var r=new a(p(t));b(h.subscribers,(function(t){t.callback({type:l.CHECKOUT_STEP,data:{checkout:r,step:e}})}))}}catch(t){console.error(t)}},h.disableHTML=function(){try{d.disableHTML()}catch(t){console.error(t)}},h.addToWishlist=function(t){try{n.addToWishlist(t),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},h.search=function(t){try{n.search(t),d.search(t),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},h.completeRegistration=function(t,e){try{n.completeRegistration(),d.completeRegistration(),f.customerRegister(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_REGISTER,data:{email:t}})}))}catch(t){console.error(t)}},h.customerLogin=function(){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]),[4,h.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(d.customerLogin(t.email),f.customerLogin(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_LOGIN,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},h.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{h.subscribers.length&&b(h.subscribers,(function(t){t.callback({type:l.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},h.customerVisit=function(){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]),[4,h.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(d.customerVisit(t.email),f.customerVisit(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_VISIT,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},h.viewCart=function(t){try{if(t&&(n.viewCart(t),f.viewCart(t),h.subscribers.length)){var e=new u(p(t));b(h.subscribers,(function(t){t.callback({type:l.VIEW_CART,data:{cart:e}})}))}}catch(t){console.error(t)}},h.viewCategory=function(t,e){try{if(n.viewCategory(t),d.viewCategory(e,t),f.viewCategory(e),h.subscribers.length){var r=new s(p(e));b(h.subscribers,(function(e){e.callback({type:l.VIEW_CATEGORY,data:{categoryPath:t,category:r}})}))}}catch(t){console.error(t)}},h.viewBrand=function(t){try{if(f.viewBrand(t),h.subscribers.length){var e=new i(p(t));b(h.subscribers,(function(t){t.callback({type:l.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},h.viewSearchResults=function(t,e){try{if(h.subscribers.length){var r=p(e).map((function(t){return new c(t.product,t.selectedVariantValues)}));b(h.subscribers,(function(e){e.callback({type:l.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},h.viewListing=function(t){try{if(h.subscribers.length){var e=p(t).map((function(t){return new c(t.product,t.selectedVariantValues)}));b(h.subscribers,(function(t){t.callback({type:l.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},h.contactForm=function(t){try{if(n.contactForm(),h.subscribers.length){var e=p(t);b(h.subscribers,(function(t){t.callback({type:l.CONTACT_FORM,data:{form:e}})}))}}catch(t){console.error(t)}},h.subscribers=[],h}();export{h as Analytics};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import{IkasCategory as s}from"../models/data/category/index.js";import{IkasCheckout as a}from"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/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/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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as d}from"./googleTagManager.js";import{IkasCart as u}from"../models/data/cart/index.js";import{IkasEventType as l}from"./events.js";import{IkasStorefrontConfig as m}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";var h=function(){function h(){o(this)}return h.getCustomerInfo=function(){return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,(t=m.store).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},h.pageView=function(r){return t(this,void 0,void 0,(function(){var t,o,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=window.location.href,[4,h.getCustomerInfo()];case 1:return o=e.sent(),d.pageView(t),f.pageView(r),b(h.subscribers,(function(e){e.callback({type:l.PAGE_VIEW,data:{url:t,pageType:r,customer:o}})})),[3,3];case 2:return i=e.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},h.productView=function(t){try{if(n.productView(t),d.productView(t),f.productView(t),h.subscribers.length){var e=p(t),r=new c(e.product,e.selectedVariantValues);b(h.subscribers,(function(t){t.callback({type:l.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(t){console.error(t)}},h.addToCart=function(t,e,r,o){try{if(n.addToCart(t,e,r),d.addToCart(t,e),f.addToCart(t,e,o),h.subscribers.length){var i=p(t),s=new u(p(o));b(h.subscribers,(function(t){t.callback({type:l.ADD_TO_CART,data:{item:i,quantity:e,cart:s}})}))}}catch(t){console.error(t)}},h.removeFromCart=function(t,e,r){try{if(d.removeFromCart(t,e),h.subscribers.length){var o=p(t),i=new u(p(r));b(h.subscribers,(function(t){t.callback({type:l.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},h.beginCheckout=function(t){try{var e=localStorage.getItem("gtmBeginCheckout");if(e&&t.id===e)return;if(localStorage.setItem("gtmBeginCheckout",t.id),n.beginCheckout(t),d.beginCheckout(t),f.beginCheckout(t),h.subscribers.length){var r=new a(p(t));b(h.subscribers,(function(t){t.callback({type:l.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(t){console.error(t)}},h.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(t,e.id||""),d.purchase(t,e.id||""),f.orderSuccess(t),h.subscribers.length){var r=new a(p(t)),o=p(e);b(h.subscribers,(function(t){t.callback({type:l.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},h.checkoutStep=function(t,e){try{if(d.checkoutStep(t,e),f.checkoutStep(t,e),h.subscribers.length){var r=new a(p(t));b(h.subscribers,(function(t){t.callback({type:l.CHECKOUT_STEP,data:{checkout:r,step:e}})}))}}catch(t){console.error(t)}},h.disableHTML=function(){try{d.disableHTML()}catch(t){console.error(t)}},h.addToWishlist=function(t){try{n.addToWishlist(t),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},h.search=function(t){try{n.search(t),d.search(t),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},h.completeRegistration=function(t,e){try{n.completeRegistration(),d.completeRegistration(),f.customerRegister(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_REGISTER,data:{email:t}})}))}catch(t){console.error(t)}},h.customerLogin=function(){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]),[4,h.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(d.customerLogin(t.email),f.customerLogin(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_LOGIN,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},h.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{h.subscribers.length&&b(h.subscribers,(function(t){t.callback({type:l.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},h.customerVisit=function(){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]),[4,h.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(d.customerVisit(t.email),f.customerVisit(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_VISIT,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},h.viewCart=function(t){try{if(t&&(n.viewCart(t),f.viewCart(t),h.subscribers.length)){var e=new u(p(t));b(h.subscribers,(function(t){t.callback({type:l.VIEW_CART,data:{cart:e}})}))}}catch(t){console.error(t)}},h.viewCategory=function(t,e){try{if(n.viewCategory(t),d.viewCategory(e,t),f.viewCategory(e),h.subscribers.length){var r=new s(p(e));b(h.subscribers,(function(e){e.callback({type:l.VIEW_CATEGORY,data:{categoryPath:t,category:r}})}))}}catch(t){console.error(t)}},h.viewBrand=function(t){try{if(f.viewBrand(t),h.subscribers.length){var e=new i(p(t));b(h.subscribers,(function(t){t.callback({type:l.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},h.viewSearchResults=function(t,e){try{if(h.subscribers.length){var r=p(e).map((function(t){return new c(t.product,t.selectedVariantValues)}));b(h.subscribers,(function(e){e.callback({type:l.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},h.viewListing=function(t){try{if(h.subscribers.length){var e=p(t).map((function(t){return new c(t.product,t.selectedVariantValues)}));b(h.subscribers,(function(t){t.callback({type:l.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},h.contactForm=function(t){try{if(n.contactForm(),h.subscribers.length){var e=p(t);b(h.subscribers,(function(t){t.callback({type:l.CONTACT_FORM,data:{form:e}})}))}}catch(t){console.error(t)}},h.subscribers=[],h}();export{h as Analytics};
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/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/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/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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as o}from"../components/checkout/model.js";var r="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view",page:e};return!r&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.productView=function(e){var t;try{var o={event:"view_item",ecommerce:{items:[a(e)],extraParams:{parent_id:e.product.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.src)||""}}};return!r&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},i.addToCart=function(e,o){try{var i={event:"add_to_cart",ecommerce:{items:[e instanceof t?a(e,o):n(e,o)]}};return!r&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},i.removeFromCart=function(e,o){try{var i={event:"remove_from_cart",ecommerce:{items:[e instanceof t?a(e,o):n(e,o)]}};return!r&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},i.beginCheckout=function(e){var t;try{var o={event:"begin_checkout",ecommerce:{items:null===(t=e.cart)||void 0===t?void 0:t.items.map((function(e){return n(e,e.quantity)}))}};return!r&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},i.purchase=function(e,t){var o,i,a;try{var d={event:"purchase",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(o=e.cart)||void 0===o?void 0:o.totalTax),shipping:""+e.shippingTotal,currency:null===(i=e.cart)||void 0===i?void 0:i.currencyCode,coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}}};return!r&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var i,a="";t===o.INFO?a="checkout_info":t===o.SHIPPING?a="checkout_shipping":t===o.PAYMENT?a="checkout_payment":t===o.SUCCESS&&(a="checkout_success");try{var d={event:a,ecommerce:{items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return n(e,e.quantity)}))}};return!r&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},i.disableHTML=function(){try{!r&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},i.completeRegistration=function(){try{var e={event:"customer_register"};return!r&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},i.search=function(e){try{var t={event:"search",search_string:e};return!r&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.viewCategory=function(e,t){try{var o={event:"view_category",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!r&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},i.customerLogin=function(e){try{var t={event:"customer_login",email:e};return!r&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.customerVisit=function(e){try{var t={event:"customer_visit",email:e};return!r&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function a(e,t){var o;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.product.brand)||void 0===o?void 0:o.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function n(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{i as GoogleTagManager};
1
+ import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/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/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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";var o="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view",page:e};return!o&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.productView=function(e){var t;try{var r={event:"view_item",ecommerce:{items:[a(e)],extraParams:{parent_id:e.product.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.src)||""}}};return!o&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.addToCart=function(e,r){try{var i={event:"add_to_cart",ecommerce:{items:[e instanceof t?a(e,r):n(e,r)]}};return!o&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},i.removeFromCart=function(e,r){try{var i={event:"remove_from_cart",ecommerce:{items:[e instanceof t?a(e,r):n(e,r)]}};return!o&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},i.beginCheckout=function(e){var t;try{var r={event:"begin_checkout",ecommerce:{items:null===(t=e.cart)||void 0===t?void 0:t.items.map((function(e){return n(e,e.quantity)}))}};return!o&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.purchase=function(e,t){var r,i,a;try{var d={event:"purchase",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(r=e.cart)||void 0===r?void 0:r.totalTax),shipping:""+e.shippingTotal,currency:null===(i=e.cart)||void 0===i?void 0:i.currencyCode,coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}}};return!o&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var i,a="";t===r.INFO?a="checkout_info":t===r.SHIPPING?a="checkout_shipping":t===r.PAYMENT?a="checkout_payment":t===r.SUCCESS&&(a="checkout_success");try{var d={event:a,ecommerce:{items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return n(e,e.quantity)}))}};return!o&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},i.disableHTML=function(){try{!o&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},i.completeRegistration=function(){try{var e={event:"customer_register"};return!o&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},i.search=function(e){try{var t={event:"search",search_string:e};return!o&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.viewCategory=function(e,t){try{var r={event:"view_category",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!o&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.customerLogin=function(e){try{var t={event:"customer_login",email:e};return!o&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.customerVisit=function(e){try{var t={event:"customer_visit",email:e};return!o&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function a(e,t){var r;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(r=e.product.brand)||void 0===r?void 0:r.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function n(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{i as GoogleTagManager};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as s}from'../ext/tslib/tslib.es6.js';import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"mobx";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/theme/theme.js";import{IkasThemePageType as i}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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/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/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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefrontConfig as r}from"../storefront/index.js";import n from'../ext/uuid/dist/esm-browser/v4.js';var o,a;!function(t){t[t.SESSION_START=1]="SESSION_START",t[t.PAGE_VIEW=2]="PAGE_VIEW",t[t.PRODUCT_VIEW=3]="PRODUCT_VIEW",t[t.ADD_TO_CART=4]="ADD_TO_CART",t[t.VIEW_CART=5]="VIEW_CART",t[t.ORDER_SUCCESS=6]="ORDER_SUCCESS",t[t.BEGIN_CHECKOUT=7]="BEGIN_CHECKOUT",t[t.CHECKOUT_STEP=8]="CHECKOUT_STEP",t[t.CUSTOMER_REGISTER=9]="CUSTOMER_REGISTER",t[t.CUSTOMER_VISIT=10]="CUSTOMER_VISIT",t[t.CUSTOMER_LOGIN=11]="CUSTOMER_LOGIN",t[t.BRAND_VIEW=12]="BRAND_VIEW",t[t.CATEGORY_VIEW=13]="CATEGORY_VIEW"}(o||(o={})),function(t){t[t.INDEX=1]="INDEX",t[t.CATEGORY=2]="CATEGORY",t[t.BRAND=3]="BRAND",t[t.PRODUCT=4]="PRODUCT",t[t.CUSTOM=5]="CUSTOM",t[t.ACCOUNT=6]="ACCOUNT",t[t.ADDRESSES=7]="ADDRESSES",t[t.ORDERS=8]="ORDERS",t[t.ORDER_DETAIL=9]="ORDER_DETAIL",t[t.LOGIN=10]="LOGIN",t[t.REGISTER=11]="REGISTER",t[t.FORGOT_PASSWORD=12]="FORGOT_PASSWORD",t[t.RECOVER_PASSWORD=13]="RECOVER_PASSWORD",t[t.CART=14]="CART",t[t.FAVORITE_PRODUCTS=15]="FAVORITE_PRODUCTS",t[t.SEARCH=16]="SEARCH",t[t.NOT_FOUND=17]="NOT_FOUND",t[t.BLOG=18]="BLOG",t[t.BLOG_INDEX=19]="BLOG_INDEX",t[t.BLOG_CATEGORY=20]="BLOG_CATEGORY",t[t.CHECKOUT=21]="CHECKOUT"}(a||(a={}));var d=process.env.NEXT_PUBLIC_ANALYTICS_URL?"".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL,"/sendEvent"):"https://0.myikas.com/sendEvent",c=function(){function c(){}return c.createSessionId=function(){return t(this,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t={id:n(),expiry:Date.now()+this.EXPIRY_LENGTH},localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(t)),this.sessionId=t.id,[4,this.sessionStart()];case 1:return e.sent(),[3,3];case 2:return s=e.sent(),console.error(s),[3,3];case 3:return[2]}}))}))},c.checkSessionId=function(){return t(this,void 0,void 0,(function(){var t,s,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),(t=localStorage.getItem(this.SESSION_ID_KEY))?(s=JSON.parse(t)).expiry<Date.now()?[4,this.createSessionId()]:[3,2]:[3,4];case 1:return e.sent(),[3,3];case 2:s.expiry=Date.now()+this.EXPIRY_LENGTH,localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(s)),this.sessionId=s.id,e.label=3;case 3:return[3,6];case 4:return[4,this.createSessionId()];case 5:e.sent(),e.label=6;case 6:return[3,8];case 7:return i=e.sent(),console.error(i),[3,8];case 8:return[2]}}))}))},c.checkVisitorId=function(){try{var t=localStorage.getItem(this.VISITOR_ID_KEY);t?this.visitorId=t:(this.visitorId=n(),localStorage.setItem(this.VISITOR_ID_KEY,this.visitorId))}catch(t){console.error(t)}},c.getPageType=function(t){switch(t){case i.INDEX:return a.INDEX;case i.CATEGORY:return a.CATEGORY;case i.BRAND:return a.BRAND;case i.PRODUCT:return a.PRODUCT;case i.CUSTOM:return a.CUSTOM;case i.ACCOUNT:return a.ACCOUNT;case i.ADDRESSES:return a.ADDRESSES;case i.ORDERS:return a.ORDERS;case i.ORDER_DETAIL:return a.ORDER_DETAIL;case i.LOGIN:return a.LOGIN;case i.REGISTER:return a.REGISTER;case i.FORGOT_PASSWORD:return a.FORGOT_PASSWORD;case i.RECOVER_PASSWORD:return a.RECOVER_PASSWORD;case i.CART:return a.CART;case i.FAVORITE_PRODUCTS:return a.FAVORITE_PRODUCTS;case i.SEARCH:return a.SEARCH;case i.NOT_FOUND:return a.NOT_FOUND;case i.BLOG:return a.BLOG;case i.BLOG_INDEX:return a.BLOG_INDEX;case i.BLOG_CATEGORY:return a.BLOG_CATEGORY;case i.CHECKOUT:return a.CHECKOUT}},c.getCustomerData=function(){var t=r.store.customerStore.customer;return{id:null==t?void 0:t.id,e:null==t?void 0:t.email,c:r.store.customerStore.customerConsentGranted}},c.getCommonEventData=function(){return{u:window.location.href,r:document.referrer,pt:r.store.currentPageType?this.getPageType(r.store.currentPageType):void 0}},c.sendEvents=function(s){var i;return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.checkSessionId()];case 1:return e.sent(),this.checkVisitorId(),t={e:s,scid:r.salesChannelId,sfid:r.storefrontId,sid:this.sessionId,vid:this.visitorId,cid:null===(i=r.store.customerStore.customer)||void 0===i?void 0:i.id},[4,fetch(d,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json","x-api-key":r.config.apiKey}})];case 2:return e.sent(),[3,4];case 3:return n=e.sent(),console.error(n),[3,4];case 4:return[2]}}))}))},c.sessionStart=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.SESSION_START,ts:Date.now(),d:s({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.pageView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PAGE_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{pt:this.getPageType(i)})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.productView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PRODUCT_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{pr:{id:i.product.id,vid:i.selectedVariant.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.addToCart=function(i,r,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ADD_TO_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:n.id,c:n.itemCount},crtItm:{id:i.id,c:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewCart=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.VIEW_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:i.id,c:i.itemCount}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.orderSuccess=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ORDER_SUCCESS,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:"success"}}})},[4,this.sendEvents([t])];case 1:return e.sent(),this.createSessionId(),[2]}}))}))},c.beginCheckout=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BEGIN_CHECKOUT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.checkoutStep=function(i,r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CHECKOUT_STEP,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerRegister=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_REGISTER,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerLogin=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_LOGIN,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerVisit=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_VISIT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewBrand=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BRAND_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),br:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewCategory=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CATEGORY_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),ctg:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.SESSION_ID_KEY="ikas_session_id",c.VISITOR_ID_KEY="ikas_visitor_id",c.EXPIRY_LENGTH=18e5,c}();export{c as default};
1
+ import{__awaiter as t,__generator as e,__assign as s}from'../ext/tslib/tslib.es6.js';import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"mobx";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/theme/theme.js";import{IkasThemePageType as i}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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/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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefrontConfig as r}from"../storefront/index.js";import n from'../ext/uuid/dist/esm-browser/v4.js';var o,a;!function(t){t[t.SESSION_START=1]="SESSION_START",t[t.PAGE_VIEW=2]="PAGE_VIEW",t[t.PRODUCT_VIEW=3]="PRODUCT_VIEW",t[t.ADD_TO_CART=4]="ADD_TO_CART",t[t.VIEW_CART=5]="VIEW_CART",t[t.ORDER_SUCCESS=6]="ORDER_SUCCESS",t[t.BEGIN_CHECKOUT=7]="BEGIN_CHECKOUT",t[t.CHECKOUT_STEP=8]="CHECKOUT_STEP",t[t.CUSTOMER_REGISTER=9]="CUSTOMER_REGISTER",t[t.CUSTOMER_VISIT=10]="CUSTOMER_VISIT",t[t.CUSTOMER_LOGIN=11]="CUSTOMER_LOGIN",t[t.BRAND_VIEW=12]="BRAND_VIEW",t[t.CATEGORY_VIEW=13]="CATEGORY_VIEW"}(o||(o={})),function(t){t[t.INDEX=1]="INDEX",t[t.CATEGORY=2]="CATEGORY",t[t.BRAND=3]="BRAND",t[t.PRODUCT=4]="PRODUCT",t[t.CUSTOM=5]="CUSTOM",t[t.ACCOUNT=6]="ACCOUNT",t[t.ADDRESSES=7]="ADDRESSES",t[t.ORDERS=8]="ORDERS",t[t.ORDER_DETAIL=9]="ORDER_DETAIL",t[t.LOGIN=10]="LOGIN",t[t.REGISTER=11]="REGISTER",t[t.FORGOT_PASSWORD=12]="FORGOT_PASSWORD",t[t.RECOVER_PASSWORD=13]="RECOVER_PASSWORD",t[t.CART=14]="CART",t[t.FAVORITE_PRODUCTS=15]="FAVORITE_PRODUCTS",t[t.SEARCH=16]="SEARCH",t[t.NOT_FOUND=17]="NOT_FOUND",t[t.BLOG=18]="BLOG",t[t.BLOG_INDEX=19]="BLOG_INDEX",t[t.BLOG_CATEGORY=20]="BLOG_CATEGORY",t[t.CHECKOUT=21]="CHECKOUT"}(a||(a={}));var d=process.env.NEXT_PUBLIC_ANALYTICS_URL?"".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL,"/sendEvent"):"https://0.myikas.com/sendEvent",c=function(){function c(){}return c.createSessionId=function(){return t(this,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t={id:n(),expiry:Date.now()+this.EXPIRY_LENGTH},localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(t)),this.sessionId=t.id,[4,this.sessionStart()];case 1:return e.sent(),[3,3];case 2:return s=e.sent(),console.error(s),[3,3];case 3:return[2]}}))}))},c.checkSessionId=function(){return t(this,void 0,void 0,(function(){var t,s,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),(t=localStorage.getItem(this.SESSION_ID_KEY))?(s=JSON.parse(t)).expiry<Date.now()?[4,this.createSessionId()]:[3,2]:[3,4];case 1:return e.sent(),[3,3];case 2:s.expiry=Date.now()+this.EXPIRY_LENGTH,localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(s)),this.sessionId=s.id,e.label=3;case 3:return[3,6];case 4:return[4,this.createSessionId()];case 5:e.sent(),e.label=6;case 6:return[3,8];case 7:return i=e.sent(),console.error(i),[3,8];case 8:return[2]}}))}))},c.checkVisitorId=function(){try{var t=localStorage.getItem(this.VISITOR_ID_KEY);t?this.visitorId=t:(this.visitorId=n(),localStorage.setItem(this.VISITOR_ID_KEY,this.visitorId))}catch(t){console.error(t)}},c.getPageType=function(t){switch(t){case i.INDEX:return a.INDEX;case i.CATEGORY:return a.CATEGORY;case i.BRAND:return a.BRAND;case i.PRODUCT:return a.PRODUCT;case i.CUSTOM:return a.CUSTOM;case i.ACCOUNT:return a.ACCOUNT;case i.ADDRESSES:return a.ADDRESSES;case i.ORDERS:return a.ORDERS;case i.ORDER_DETAIL:return a.ORDER_DETAIL;case i.LOGIN:return a.LOGIN;case i.REGISTER:return a.REGISTER;case i.FORGOT_PASSWORD:return a.FORGOT_PASSWORD;case i.RECOVER_PASSWORD:return a.RECOVER_PASSWORD;case i.CART:return a.CART;case i.FAVORITE_PRODUCTS:return a.FAVORITE_PRODUCTS;case i.SEARCH:return a.SEARCH;case i.NOT_FOUND:return a.NOT_FOUND;case i.BLOG:return a.BLOG;case i.BLOG_INDEX:return a.BLOG_INDEX;case i.BLOG_CATEGORY:return a.BLOG_CATEGORY;case i.CHECKOUT:return a.CHECKOUT}},c.getCustomerData=function(){var t=r.store.customerStore.customer;return{id:null==t?void 0:t.id,e:null==t?void 0:t.email,c:r.store.customerStore.customerConsentGranted}},c.getCommonEventData=function(){return{u:window.location.href,r:document.referrer,pt:r.store.currentPageType?this.getPageType(r.store.currentPageType):void 0}},c.sendEvents=function(s){var i;return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.checkSessionId()];case 1:return e.sent(),this.checkVisitorId(),t={e:s,scid:r.salesChannelId,sfid:r.storefrontId,sid:this.sessionId,vid:this.visitorId,cid:null===(i=r.store.customerStore.customer)||void 0===i?void 0:i.id},[4,fetch(d,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json","x-api-key":r.config.apiKey}})];case 2:return e.sent(),[3,4];case 3:return n=e.sent(),console.error(n),[3,4];case 4:return[2]}}))}))},c.sessionStart=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.SESSION_START,ts:Date.now(),d:s({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.pageView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PAGE_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{pt:this.getPageType(i)})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.productView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PRODUCT_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{pr:{id:i.product.id,vid:i.selectedVariant.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.addToCart=function(i,r,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ADD_TO_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:n.id,c:n.itemCount},crtItm:{id:i.id,c:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewCart=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.VIEW_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:i.id,c:i.itemCount}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.orderSuccess=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ORDER_SUCCESS,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:"success"}}})},[4,this.sendEvents([t])];case 1:return e.sent(),this.createSessionId(),[2]}}))}))},c.beginCheckout=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BEGIN_CHECKOUT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.checkoutStep=function(i,r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CHECKOUT_STEP,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerRegister=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_REGISTER,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerLogin=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_LOGIN,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerVisit=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_VISIT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewBrand=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BRAND_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),br:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewCategory=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CATEGORY_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),ctg:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.SESSION_ID_KEY="ikas_session_id",c.VISITOR_ID_KEY="ikas_visitor_id",c.EXPIRY_LENGTH=18e5,c}();export{c as default};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i,__makeTemplateObject as o}from'../../ext/tslib/tslib.es6.js';import e from'../../ext/graphql-tag/src/index.js';import{apollo as n}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as r}from"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/html-meta-data/index.js";import{IkasImage as a}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"mobx";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var d,s=function(){function s(){}return s.listBrands=function(s){return t(this,void 0,void 0,(function(){var t,m,l,p,u,c;return i(this,(function(i){switch(i.label){case 0:t=e(d||(d=o(["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "],["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "]))),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.getClient().query({query:t,variables:{id:(null==s?void 0:s.idList)&&s.idList.length?{in:s.idList}:void 0,pagination:(null==s?void 0:s.page)?{page:s.page,limit:s.limit||10}:void 0,search:null==s?void 0:s.search,sort:(null==s?void 0:s.sort)||null}})];case 2:return m=i.sent(),l=m.data,(p=m.errors)&&p.length?(console.log(p),[2,{brands:[],count:0}]):(u=l.listProductBrand.count,[2,{brands:l.listProductBrand.data.map((function(t){return new r({id:t.id,name:t.name,description:t.description,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new a(t.imageId):void 0,orderType:t.orderType})})),count:u}]);case 3:return c=i.sent(),console.log(c),[2,{brands:[],count:0}];case 4:return[2]}}))}))},s}();export{s as IkasBrandAPI};
1
+ import{__awaiter as t,__generator as i,__makeTemplateObject as o}from'../../ext/tslib/tslib.es6.js';import e from'../../ext/graphql-tag/src/index.js';import{apollo as n}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as r}from"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import{IkasImage as a}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var d,s=function(){function s(){}return s.listBrands=function(s){return t(this,void 0,void 0,(function(){var t,m,l,p,u,c;return i(this,(function(i){switch(i.label){case 0:t=e(d||(d=o(["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "],["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "]))),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.getClient().query({query:t,variables:{id:(null==s?void 0:s.idList)&&s.idList.length?{in:s.idList}:void 0,pagination:(null==s?void 0:s.page)?{page:s.page,limit:s.limit||10}:void 0,search:null==s?void 0:s.search,sort:(null==s?void 0:s.sort)||null}})];case 2:return m=i.sent(),l=m.data,(p=m.errors)&&p.length?(console.log(p),[2,{brands:[],count:0}]):(u=l.listProductBrand.count,[2,{brands:l.listProductBrand.data.map((function(t){return new r({id:t.id,name:t.name,description:t.description,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new a(t.imageId):void 0,orderType:t.orderType})})),count:u}]);case 3:return c=i.sent(),console.log(c),[2,{brands:[],count:0}];case 4:return[2]}}))}))},s}();export{s as IkasBrandAPI};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__makeTemplateObject as n}from'../../ext/tslib/tslib.es6.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCategory as i,IkasCategoryPath as a}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/html-meta-data/index.js";import{IkasImage as o}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"mobx";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import r from'../../ext/graphql-tag/src/index.js';import{apollo as s}from"../apollo.js";var d,l,m=function(){function m(){}return m.listCategories=function(a){return t(this,void 0,void 0,(function(){var t,l,m,p,u,c,g,j,h,v,f;return e(this,(function(x){switch(x.label){case 0:t=r(d||(d=n(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "],["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "]))),x.label=1;case 1:return x.trys.push([1,10,,11]),[4,s.getClient().query({query:t,variables:{id:(null==a?void 0:a.idList)&&a.idList.length?{in:a.idList}:void 0,pagination:(null==a?void 0:a.page)?{page:a.page,limit:a.limit||10}:void 0,search:null==a?void 0:a.search,sort:(null==a?void 0:a.sort)||null}})];case 2:if(l=x.sent(),m=l.data,(p=l.errors)&&p.length)return[2,{categories:[],count:0}];u=m.listCategory.count,c=m.listCategory.data.map((function(t){return new i({id:t.id,name:t.name,description:t.description,parentId:t.parentId,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new o(t.imageId):void 0,orderType:t.orderType})})),x.label=3;case 3:x.trys.push([3,8,,9]),g=function(t){var n,i,a;return e(this,(function(e){switch(e.label){case 0:return(n=m.listCategory.data[t].categoryPath)&&n.length?(i=[],[4,j.listCategoryPaths({idList:n})]):[3,2];case 1:a=e.sent(),n.forEach((function(t){var e=a.find((function(e){return e.id===t}));e&&i.push(e)})),c[t].path=i,e.label=2;case 2:return[2]}}))},j=this,h=0,x.label=4;case 4:return h<m.listCategory.data.length?[5,g(h)]:[3,7];case 5:x.sent(),x.label=6;case 6:return h++,[3,4];case 7:return[3,9];case 8:return v=x.sent(),console.log(v),[3,9];case 9:return[2,{categories:c,count:u}];case 10:return f=x.sent(),console.log(f),[2,{categories:[],count:0}];case 11:return[2]}}))}))},m.listCategoryPaths=function(i){return t(this,void 0,void 0,(function(){var t,o,d,m,p,u;return e(this,(function(e){switch(e.label){case 0:t=r(l||(l=n(["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.getClient().query({query:t,variables:{id:(null==i?void 0:i.idList)&&i.idList.length?{in:i.idList}:void 0,pagination:(null==i?void 0:i.page)?{page:i.page,limit:i.limit||10}:void 0,search:null==i?void 0:i.search}})];case 2:return o=e.sent(),d=o.data,(m=o.errors)&&m.length?[2,[]]:(p=d.listCategory.data.map((function(t){var e;return new a({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})),[2,p]);case 3:return u=e.sent(),console.log(u),[2,[]];case 4:return[2]}}))}))},m}();export{m as IkasCategoryAPI};
1
+ import{__awaiter as t,__generator as e,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCategory as n,IkasCategoryPath as a}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import{IkasImage as r}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import o from'../../ext/graphql-tag/src/index.js';import{apollo as s}from"../apollo.js";var d,l,m=function(){function m(){}return m.listCategories=function(a){return t(this,void 0,void 0,(function(){var t,l,m,p,u,c,g,j,h,v,x;return e(this,(function(f){switch(f.label){case 0:t=o(d||(d=i(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "],["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "]))),f.label=1;case 1:return f.trys.push([1,10,,11]),[4,s.getClient().query({query:t,variables:{id:(null==a?void 0:a.idList)&&a.idList.length?{in:a.idList}:void 0,pagination:(null==a?void 0:a.page)?{page:a.page,limit:a.limit||10}:void 0,search:null==a?void 0:a.search,sort:(null==a?void 0:a.sort)||null}})];case 2:if(l=f.sent(),m=l.data,(p=l.errors)&&p.length)return[2,{categories:[],count:0}];u=m.listCategory.count,c=m.listCategory.data.map((function(t){return new n({id:t.id,name:t.name,description:t.description,parentId:t.parentId,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new r(t.imageId):void 0,orderType:t.orderType})})),f.label=3;case 3:f.trys.push([3,8,,9]),g=function(t){var i,n,a;return e(this,(function(e){switch(e.label){case 0:return(i=m.listCategory.data[t].categoryPath)&&i.length?(n=[],[4,j.listCategoryPaths({idList:i})]):[3,2];case 1:a=e.sent(),i.forEach((function(t){var e=a.find((function(e){return e.id===t}));e&&n.push(e)})),c[t].path=n,e.label=2;case 2:return[2]}}))},j=this,h=0,f.label=4;case 4:return h<m.listCategory.data.length?[5,g(h)]:[3,7];case 5:f.sent(),f.label=6;case 6:return h++,[3,4];case 7:return[3,9];case 8:return v=f.sent(),console.log(v),[3,9];case 9:return[2,{categories:c,count:u}];case 10:return x=f.sent(),console.log(x),[2,{categories:[],count:0}];case 11:return[2]}}))}))},m.listCategoryPaths=function(n){return t(this,void 0,void 0,(function(){var t,r,d,m,p,u;return e(this,(function(e){switch(e.label){case 0:t=o(l||(l=i(["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.getClient().query({query:t,variables:{id:(null==n?void 0:n.idList)&&n.idList.length?{in:n.idList}:void 0,pagination:(null==n?void 0:n.page)?{page:n.page,limit:n.limit||10}:void 0,search:null==n?void 0:n.search}})];case 2:return r=e.sent(),d=r.data,(m=r.errors)&&m.length?[2,[]]:(p=d.listCategory.data.map((function(t){var e;return new a({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})),[2,p]);case 3:return u=e.sent(),console.log(u),[2,[]];case 4:return[2]}}))}))},m}();export{m as IkasCategoryAPI};
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as r}from"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"mobx";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPaymentGateway as d}from"../../models/data/payment-gateway/index.js";import{IkasStorefrontConfig as s}from"../../storefront/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";var u,l,m,p,g,h,y,I,f,v,C=function(){function C(){}return C.getCheckoutId=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(u||(u=t(["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "],["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{cartId:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.getCheckoutByCartId.id]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getCheckoutById=function(o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(l||(l=t(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "],["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:o}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,new r(s.getCheckoutById)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrder=function(r){return n(this,void 0,void 0,(function(){var n,d,s;return e(this,(function(e){switch(e.label){case 0:n=i(m||(m=t(["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{orderId:r}})];case 2:return d=e.sent(),(s=d.data)&&s.getOrder?[2,new o(s.getOrder)]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C.saveCheckout=function(r){var o,d,s,c;return n(this,void 0,void 0,(function(){var n,u,l,m,g;return e(this,(function(e){switch(e.label){case 0:n=i(p||(p=t(["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "],["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{id:r.id,cartId:r.cartId,shippingMethod:r.shippingMethod,shippingSettingsId:r.shippingSettingsId,shippingZoneRateId:r.shippingZoneRateId,billingAddress:r.billingAddress&&r.billingAddress.addressLine1?{id:r.billingAddress.id,addressLine1:r.billingAddress.addressLine1||"",addressLine2:r.billingAddress.addressLine2||null,city:r.billingAddress.city,country:r.billingAddress.country,state:r.billingAddress.state,district:r.billingAddress.district||null,firstName:r.billingAddress.firstName,lastName:r.billingAddress.lastName,postalCode:r.billingAddress.postalCode,company:r.billingAddress.company||null,phone:r.billingAddress.phone||null,taxNumber:r.billingAddress.taxNumber||null,taxOffice:r.billingAddress.taxOffice||null,isDefault:r.billingAddress.isDefault||!1,identityNumber:r.billingAddress.identityNumber||null}:null,shippingAddress:r.shippingAddress&&r.shippingAddress.addressLine1?{id:r.shippingAddress.id,addressLine1:r.shippingAddress.addressLine1||"",addressLine2:r.shippingAddress.addressLine2||null,city:r.shippingAddress.city,country:r.shippingAddress.country,state:r.shippingAddress.state,district:r.shippingAddress.district||null,firstName:r.shippingAddress.firstName,lastName:r.shippingAddress.lastName,postalCode:r.shippingAddress.postalCode,company:r.shippingAddress.company||null,phone:r.shippingAddress.phone||null,taxNumber:r.shippingAddress.taxNumber||null,taxOffice:r.shippingAddress.taxOffice||null,isDefault:r.shippingAddress.isDefault||!1,identityNumber:r.shippingAddress.identityNumber||null}:null,couponCode:r.couponCode||null,customer:r.customer?{id:null===(o=r.customer)||void 0===o?void 0:o.id,email:null===(d=r.customer)||void 0===d?void 0:d.email,firstName:null===(s=r.customer)||void 0===s?void 0:s.firstName,lastName:null===(c=r.customer)||void 0===c?void 0:c.lastName,notificationsAccepted:r.customer.notificationsAccepted||!1}:null,note:r.note,isGiftPackage:r.isGiftPackage,giftPackageNote:r.giftPackageNote}}})];case 2:return u=e.sent(),l=u.data,m=u.errors,[2,{data:(null==l?void 0:l.saveCheckout.id)||void 0,errors:m}];case 3:return g=e.sent(),console.log(g),g&&g.graphQLErrors?[2,{data:void 0,errors:g.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C.createSaleTransactionWithCheckout=function(r,o,d){return n(this,void 0,void 0,(function(){var n,s,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(g||(g=t(["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "],["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{checkoutId:r,paymentGatewayId:o,paymentMethodDetail:d}}})];case 2:return s=e.sent(),c=s.data,(u=s.errors)&&u.length?[2]:c?[2,c.createSaleTransactionWithCheckout]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.listPaymentGateway=function(r){return n(this,void 0,void 0,(function(){var n,o,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(h||(h=t(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "],["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:r?{in:r}:void 0,locale:s.getCurrentLocale()}})];case 2:return o=e.sent(),c=o.data,(u=o.errors)&&u.length&&console.log(u),c?[2,c.listPaymentGateway.map((function(n){return new d(n)}))]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.retrieveInstallmentInfo=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(y||(y=t(["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "],["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.retrieveInstallmentInfo]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.checkStocks=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(I||(I=t(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "],["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{lines:r,stockLocationIdList:o.length?o:null}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,s.checkStocks]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.listCheckoutSettings=function(){return n(this,void 0,void 0,(function(){var n,r,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=i(f||(f=t(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "],["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{storefrontId:{eq:s.storefrontId}}})];case 2:return r=e.sent(),o=r.data,(d=r.errors)&&d.length&&console.log(d),o?[2,o.listCheckoutSettings.map((function(n){return new c(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.addCouponCodeToCheckout=function(r,o){return n(this,void 0,void 0,(function(){var n,d;return e(this,(function(e){switch(e.label){case 0:n=i(v||(v=t(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "],["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{checkoutId:r,couponCode:o}})];case 2:return(d=e.sent().data)&&d.addCouponCodeToCheckout.id?[2,!0]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCheckoutAPI};
1
+ import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as r}from"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPaymentGateway as d}from"../../models/data/payment-gateway/index.js";import{IkasStorefrontConfig as s}from"../../storefront/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";var u,l,m,p,g,h,y,I,f,v,C=function(){function C(){}return C.getCheckoutId=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(u||(u=t(["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "],["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{cartId:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.getCheckoutByCartId.id]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getCheckoutById=function(o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(l||(l=t(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "],["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:o}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,new r(s.getCheckoutById)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrder=function(r){return n(this,void 0,void 0,(function(){var n,d,s;return e(this,(function(e){switch(e.label){case 0:n=i(m||(m=t(["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{orderId:r}})];case 2:return d=e.sent(),(s=d.data)&&s.getOrder?[2,new o(s.getOrder)]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C.saveCheckout=function(r){var o,d,s,c;return n(this,void 0,void 0,(function(){var n,u,l,m,g;return e(this,(function(e){switch(e.label){case 0:n=i(p||(p=t(["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "],["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{id:r.id,cartId:r.cartId,shippingMethod:r.shippingMethod,shippingSettingsId:r.shippingSettingsId,shippingZoneRateId:r.shippingZoneRateId,billingAddress:r.billingAddress&&r.billingAddress.addressLine1?{id:r.billingAddress.id,addressLine1:r.billingAddress.addressLine1||"",addressLine2:r.billingAddress.addressLine2||null,city:r.billingAddress.city,country:r.billingAddress.country,state:r.billingAddress.state,district:r.billingAddress.district||null,firstName:r.billingAddress.firstName,lastName:r.billingAddress.lastName,postalCode:r.billingAddress.postalCode,company:r.billingAddress.company||null,phone:r.billingAddress.phone||null,taxNumber:r.billingAddress.taxNumber||null,taxOffice:r.billingAddress.taxOffice||null,isDefault:r.billingAddress.isDefault||!1,identityNumber:r.billingAddress.identityNumber||null}:null,shippingAddress:r.shippingAddress&&r.shippingAddress.addressLine1?{id:r.shippingAddress.id,addressLine1:r.shippingAddress.addressLine1||"",addressLine2:r.shippingAddress.addressLine2||null,city:r.shippingAddress.city,country:r.shippingAddress.country,state:r.shippingAddress.state,district:r.shippingAddress.district||null,firstName:r.shippingAddress.firstName,lastName:r.shippingAddress.lastName,postalCode:r.shippingAddress.postalCode,company:r.shippingAddress.company||null,phone:r.shippingAddress.phone||null,taxNumber:r.shippingAddress.taxNumber||null,taxOffice:r.shippingAddress.taxOffice||null,isDefault:r.shippingAddress.isDefault||!1,identityNumber:r.shippingAddress.identityNumber||null}:null,couponCode:r.couponCode||null,customer:r.customer?{id:null===(o=r.customer)||void 0===o?void 0:o.id,email:null===(d=r.customer)||void 0===d?void 0:d.email,firstName:null===(s=r.customer)||void 0===s?void 0:s.firstName,lastName:null===(c=r.customer)||void 0===c?void 0:c.lastName,notificationsAccepted:r.customer.notificationsAccepted||!1}:null,note:r.note,isGiftPackage:r.isGiftPackage,giftPackageNote:r.giftPackageNote}}})];case 2:return u=e.sent(),l=u.data,m=u.errors,[2,{data:(null==l?void 0:l.saveCheckout.id)||void 0,errors:m}];case 3:return g=e.sent(),console.log(g),g&&g.graphQLErrors?[2,{data:void 0,errors:g.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C.createSaleTransactionWithCheckout=function(r,o,d){return n(this,void 0,void 0,(function(){var n,s,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(g||(g=t(["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "],["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{checkoutId:r,paymentGatewayId:o,paymentMethodDetail:d}}})];case 2:return s=e.sent(),c=s.data,(u=s.errors)&&u.length?[2]:c?[2,c.createSaleTransactionWithCheckout]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.listPaymentGateway=function(r){return n(this,void 0,void 0,(function(){var n,o,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(h||(h=t(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "],["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:r?{in:r}:void 0,locale:s.getCurrentLocale()}})];case 2:return o=e.sent(),c=o.data,(u=o.errors)&&u.length&&console.log(u),c?[2,c.listPaymentGateway.map((function(n){return new d(n)}))]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.retrieveInstallmentInfo=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(y||(y=t(["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "],["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.retrieveInstallmentInfo]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.checkStocks=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(I||(I=t(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "],["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{lines:r,stockLocationIdList:o.length?o:null}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,s.checkStocks]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.listCheckoutSettings=function(){return n(this,void 0,void 0,(function(){var n,r,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=i(f||(f=t(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "],["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{storefrontId:{eq:s.storefrontId}}})];case 2:return r=e.sent(),o=r.data,(d=r.errors)&&d.length&&console.log(d),o?[2,o.listCheckoutSettings.map((function(n){return new c(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.addCouponCodeToCheckout=function(r,o){return n(this,void 0,void 0,(function(){var n,d;return e(this,(function(e){switch(e.label){case 0:n=i(v||(v=t(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "],["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{checkoutId:r,couponCode:o}})];case 2:return(d=e.sent().data)&&d.addCouponCodeToCheckout.id?[2,!0]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCheckoutAPI};
@@ -577,7 +577,7 @@ export interface createOrderRefundRequest_createOrderRefundRequest {
577
577
  updatedAt: any | null;
578
578
  }
579
579
  export interface createOrderRefundRequest {
580
- createOrderRefundRequest: createOrderRefundRequest_createOrderRefundRequest;
580
+ createOrderRefundRequest: createOrderRefundRequest_createOrderRefundRequest | null;
581
581
  }
582
582
  export interface createOrderRefundRequestVariables {
583
583
  input: OrderRefundRequestInput;