@ikas/storefront 5.0.84 → 5.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/analytics/facebookPixel.js +1 -1
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
- package/build/components/checkout/components/checkout-load-failed/index.d.ts +14 -0
- package/build/components/checkout/components/checkout-load-failed/index.js +1 -0
- package/build/components/checkout/components/checkout-load-failed/style.module.scss.js +1 -0
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/svg/refresh.d.ts +6 -0
- package/build/components/checkout/components/svg/refresh.js +1 -0
- package/build/components/checkout/components/tkpay/index.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +64 -1
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-info/style.module.scss.js +1 -0
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/index.d.ts +7 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/login-required.d.ts +6 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/login-required.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/page/widgets/loyaltyWidget.js +1 -1
- package/build/index.js +1 -1
- package/build/models/data/index.d.ts +5 -0
- package/build/models/data/order/index.d.ts +16 -2
- package/build/models/data/order/index.js +1 -1
- package/build/models/data/order/line-item/index.d.ts +5 -1
- package/build/models/data/order/line-item/index.js +1 -1
- package/build/models/data/order/refund/reason/index.d.ts +8 -0
- package/build/models/data/order/refund/reason/index.js +1 -0
- package/build/models/data/order/refund/reason/translation/index.d.ts +6 -0
- package/build/models/data/order/refund/reason/translation/index.js +1 -0
- package/build/models/data/order/refund/refundable-line/index.d.ts +10 -0
- package/build/models/data/order/refund/refundable-line/index.js +1 -0
- package/build/models/data/order/refund/refundable-lines/index.d.ts +10 -0
- package/build/models/data/order/refund/refundable-lines/index.js +1 -0
- package/build/models/data/order/refund/settings/translation/index.d.ts +6 -0
- package/build/models/data/order/refund/settings/translation/index.js +1 -0
- package/build/models/data/payment-gateway/index.d.ts +1 -2
- package/build/models/data/payment-gateway/index.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/store/customer/api.d.ts +14 -11
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +39 -3
- package/build/store/customer/index.js +1 -1
- package/build/store/index.d.ts +1 -0
- package/build/utils/miles-smiles.d.ts +19 -0
- package/build/utils/miles-smiles.js +1 -0
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasOrderAddress as t}from"./address/index.js";import{IkasOrderShippingLine as n}from"./shipping-line/index.js";import{IkasOrderLineItem as r}from"./line-item/index.js";import{IkasOrderCustomer as i}from"./customer/index.js";import{IkasOrderGiftPackageLine as o}from"./gift-line/index.js";import{IkasInvoice as l}from"./invoice/index.js";import{IkasOrderPaymentMethod as u}from"./payment-method/index.js";import{IkasOrderAdjustment as a}from"./adjustment/index.js";import{IkasOrderPackage as s}from"./package/index.js";import{IkasOrderTaxLine as d}from"./tax-line/index.js";import{IkasBaseModel as c}from"../base/index.js";import{IkasOrderLineItemStatus as m,IkasCampaignType as f,IkasOrderShippingMethod as p,IkasOrderStatus as g}from"@ikas/storefront-models";export{IkasOrderCancelReason,IkasOrderPackageStatus,IkasOrderPaymentStatus,IkasOrderShippingMethod,IkasOrderStatus}from"@ikas/storefront-models";import{makeObservable as y,observable as b,computed as P}from"mobx";import{IkasOrderFunctions as h}from"@ikas/storefront-model-functions";import{formatCurrency as j}from"../../../utils/currency.js";import{IkasOrderGiftCardLine as v}from"./gift-card-line/index.js";import{IkasOrderLoyaltyLine as A}from"./loyalty-line/index.js";var k=function(c){function k(e,m){var f,h,j,k,I,O,S,C,L,x,T,F,N,w=this;(w=c.call(this,e)||this).billingAddress=null,w.cancelReason=null,w.cancelledAt=null,w.currencySymbol=null,w.customer=null,w.customerId=null,w.edited=null,w.giftPackageLines=null,w.giftPackageNote=null,w.invoices=null,w.isGiftPackage=null,w.loyaltyLines=null,w.note=null,w.orderAdjustments=null,w.orderNumber=null,w.orderPackageStatus=null,w.orderPackages=null,w.orderPaymentStatus=null,w.orderedAt=null,w.priceListId=null,w.paymentMethods=null,w.shippingAddress=null,w.shippingLines=null,w.taxLines=null,w.netTotalFinalPrice=null,w.billingAddress=e.billingAddress?new t(e.billingAddress):null,w.cancelReason=e.cancelReason||null,w.cancelledAt=e.cancelledAt||null,w.currencyCode=e.currencyCode||"",w.currencySymbol=e.currencySymbol||null,w.customer=e.customer?new i(e.customer):null,w.customerId=e.customerId||null,w.edited=e.edited||null,w.giftCardLines=(null===(f=e.giftCardLines)||void 0===f?void 0:f.map((function(e){return new v(e)})))||null,w.giftPackageLines=(null===(h=e.giftPackageLines)||void 0===h?void 0:h.map((function(e){return new o(e)})))||null,w.giftPackageNote=e.giftPackageNote||null,w.invoices=(null===(j=e.invoices)||void 0===j?void 0:j.map((function(e){return new l(e)})))||null,w.isGiftPackage=e.isGiftPackage||null,w.loyaltyLines=(null===(k=e.loyaltyLines)||void 0===k?void 0:k.map((function(e){return new A(e)})))||null,w.note=e.note||null,w.orderAdjustments=(null===(I=e.orderAdjustments)||void 0===I?void 0:I.map((function(e){return new a(e)})))||null,w.orderLineItems=(null===(O=e.orderLineItems)||void 0===O?void 0:O.map((function(e){return new r(e)})).filter((function(e){return!e.deleted})))||[],w.orderNumber=e.orderNumber||null,w.orderPackageStatus=e.orderPackageStatus||null,w.orderPackages=(null===(S=e.orderPackages)||void 0===S?void 0:S.map((function(e){return new s(e)})))||null,w.orderPaymentStatus=e.orderPaymentStatus||null,w.orderedAt=e.orderedAt||null,w.priceListId=e.priceListId||null,w.paymentMethods=(null===(C=e.paymentMethods)||void 0===C?void 0:C.map((function(e){return new u(e)})))||null,w.shippingAddress=e.shippingAddress?new t(e.shippingAddress):null,w.shippingLines=(null===(L=e.shippingLines)||void 0===L?void 0:L.map((function(e){return new n(e)})))||null,w.shippingMethod=e.shippingMethod||p.SHIPMENT,w.status=e.status||g.CREATED,w.taxLines=(null===(x=e.taxLines)||void 0===x?void 0:x.map((function(e){return new d(e)})))||null,w.netTotalFinalPrice=null!==(T=e.netTotalFinalPrice)&&void 0!==T?T:null,w.totalFinalPrice=null!==(F=e.totalFinalPrice)&&void 0!==F?F:0,w.totalPrice=null!==(N=e.totalPrice)&&void 0!==N?N:0,w.refundSettings=e.refundSettings;var E={billingAddress:b,cancelReason:b,cancelledAt:b,currencyCode:b,currencySymbol:b,customer:b,customerId:b,edited:b,giftCardLines:b,giftPackageLines:b,giftPackageNote:b,invoices:b,isGiftPackage:b,loyaltyLines:b,note:b,orderAdjustments:b,orderLineItems:b,orderNumber:b,orderPackageStatus:b,orderPackages:b,orderPaymentStatus:b,orderedAt:b,paymentMethods:b,shippingAddress:b,shippingLines:b,shippingMethod:b,status:b,taxLines:b,netTotalFinalPrice:b,totalFinalPrice:b,totalPrice:b,refundSettings:b,items:P,itemCount:P,refundableItems:P,unfullfilledItems:P,refundedItems:P,totalTax:P,formattedTotalTax:P,shippingTotal:P,formattedShippingTotal:P,formattedTotalFinalPrice:P,formattedTotalPrice:P,hasCustomer:P,hasValidCustomerEmail:P,customerFullName:P,formattedDate:P,couponAdjustment:P,nonCouponAdjustments:P,orderProductFileIds:P};return m&&(delete E.billingAddress,delete E.shippingAddress),y(w,E),w}return e(k,c),Object.defineProperty(k.prototype,"items",{get:function(){return this.orderLineItems.filter((function(e){return e.status!==m.CANCELLED}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"itemCount",{get:function(){var e;return(null===(e=this.items)||void 0===e?void 0:e.length)||0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"itemQuantity",{get:function(){return this.items.reduce((function(e,t){return e+t.quantity}),0)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"refundableItems",{get:function(){return this.refundSettings?h.getRefundableItems(this,this.refundSettings):[]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"displayedPackages",{get:function(){return h.getDisplayedPackages(this).map((function(e){return new s(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"unfullfilledItems",{get:function(){return h.getUnfullfilledItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"refundedItems",{get:function(){return h.getRefundedItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"totalTax",{get:function(){return h.getTotalTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedTotalTax",{get:function(){return j(this.totalTax,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"shippingTotal",{get:function(){return h.getShippingTotal(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedShippingTotal",{get:function(){return j(this.shippingTotal,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedTotalFinalPrice",{get:function(){return j(this.totalFinalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedTotalPrice",{get:function(){return j(this.totalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"hasCustomer",{get:function(){return h.hasCustomer(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"hasValidCustomerEmail",{get:function(){return h.hasValidCustomerEmail(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"customerFullName",{get:function(){return h.getCustomerFullName(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedDate",{get:function(){return h.getFormattedDate(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"couponAdjustment",{get:function(){return h.getCouponAdjustment(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"nonCouponAdjustments",{get:function(){return h.getNonCouponAdjustments(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRefundEnabled",{get:function(){return this.refundableItems.some((function(e){return null!==e.refundQuantity}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"displayedOrderAdjustments",{get:function(){var e;return null===(e=this.orderAdjustments)||void 0===e?void 0:e.filter((function(e){return e.campaignType!==f.FREE_SHIPPING}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"orderProductFileIds",{get:function(){return h.getOrderProductFiles(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"giftCardTotalPrice",{get:function(){var e;return(null===(e=this.giftCardLines)||void 0===e?void 0:e.reduce((function(e,t){return e+t.amount}),0))||0},enumerable:!1,configurable:!0}),k}(c);export{k as IkasOrder};
|
|
1
|
+
import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasOrderAddress as t}from"./address/index.js";import{IkasOrderShippingLine as n}from"./shipping-line/index.js";import{IkasOrderLineItem as r}from"./line-item/index.js";import{IkasRefundableLines as i}from"./refund/refundable-lines/index.js";import{IkasOrderCustomer as o}from"./customer/index.js";import{IkasOrderGiftPackageLine as l}from"./gift-line/index.js";import{IkasInvoice as u}from"./invoice/index.js";import{IkasOrderPaymentMethod as a}from"./payment-method/index.js";import{IkasOrderAdjustment as s}from"./adjustment/index.js";import{IkasOrderPackage as d}from"./package/index.js";import{IkasOrderTaxLine as c}from"./tax-line/index.js";import{IkasBaseModel as f}from"../base/index.js";import{IkasOrderLineItemStatus as m,IkasCampaignType as p,IkasOrderShippingMethod as g,IkasOrderStatus as b}from"@ikas/storefront-models";export{IkasOrderCancelReason,IkasOrderPackageStatus,IkasOrderPaymentStatus,IkasOrderShippingMethod,IkasOrderStatus}from"@ikas/storefront-models";import{makeObservable as y,observable as h,computed as P,action as v}from"mobx";import{IkasOrderFunctions as j}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as I}from"@ikas/storefront-config";import{formatCurrency as L}from"../../../utils/currency.js";import{IkasOrderGiftCardLine as A}from"./gift-card-line/index.js";import{IkasOrderLoyaltyLine as O}from"./loyalty-line/index.js";var k=function(f){function k(e,i){var m,p,j,I,L,k,C,R,T,S,x,w,F,_=this;(_=f.call(this,e)||this).billingAddress=null,_.cancelReason=null,_.cancelledAt=null,_.currencySymbol=null,_.customer=null,_.customerId=null,_.edited=null,_.giftPackageLines=null,_.giftPackageNote=null,_.invoices=null,_.isGiftPackage=null,_.loyaltyLines=null,_.note=null,_.orderAdjustments=null,_.orderNumber=null,_.orderPackageStatus=null,_.orderPackages=null,_.orderPaymentStatus=null,_.orderedAt=null,_.priceListId=null,_.paymentMethods=null,_.shippingAddress=null,_.shippingLines=null,_.taxLines=null,_.netTotalFinalPrice=null,_.refundableLineItems=null,_._refundReasonId=null,_._refundReason=null,_._refundReasons=null,_._refundTranslations=null,_.billingAddress=e.billingAddress?new t(e.billingAddress):null,_.cancelReason=e.cancelReason||null,_.cancelledAt=e.cancelledAt||null,_.currencyCode=e.currencyCode||"",_.currencySymbol=e.currencySymbol||null,_.customer=e.customer?new o(e.customer):null,_.customerId=e.customerId||null,_.edited=e.edited||null,_.giftCardLines=(null===(m=e.giftCardLines)||void 0===m?void 0:m.map((function(e){return new A(e)})))||null,_.giftPackageLines=(null===(p=e.giftPackageLines)||void 0===p?void 0:p.map((function(e){return new l(e)})))||null,_.giftPackageNote=e.giftPackageNote||null,_.invoices=(null===(j=e.invoices)||void 0===j?void 0:j.map((function(e){return new u(e)})))||null,_.isGiftPackage=e.isGiftPackage||null,_.loyaltyLines=(null===(I=e.loyaltyLines)||void 0===I?void 0:I.map((function(e){return new O(e)})))||null,_.note=e.note||null,_.orderAdjustments=(null===(L=e.orderAdjustments)||void 0===L?void 0:L.map((function(e){return new s(e)})))||null,_.orderLineItems=(null===(k=e.orderLineItems)||void 0===k?void 0:k.map((function(e){return new r(e)})).filter((function(e){return!e.deleted})))||[],_.orderNumber=e.orderNumber||null,_.orderPackageStatus=e.orderPackageStatus||null,_.orderPackages=(null===(C=e.orderPackages)||void 0===C?void 0:C.map((function(e){return new d(e)})))||null,_.orderPaymentStatus=e.orderPaymentStatus||null,_.orderedAt=e.orderedAt||null,_.priceListId=e.priceListId||null,_.paymentMethods=(null===(R=e.paymentMethods)||void 0===R?void 0:R.map((function(e){return new a(e)})))||null,_.shippingAddress=e.shippingAddress?new t(e.shippingAddress):null,_.shippingLines=(null===(T=e.shippingLines)||void 0===T?void 0:T.map((function(e){return new n(e)})))||null,_.shippingMethod=e.shippingMethod||g.SHIPMENT,_.status=e.status||b.CREATED,_.taxLines=(null===(S=e.taxLines)||void 0===S?void 0:S.map((function(e){return new c(e)})))||null,_.netTotalFinalPrice=null!==(x=e.netTotalFinalPrice)&&void 0!==x?x:null,_.totalFinalPrice=null!==(w=e.totalFinalPrice)&&void 0!==w?w:0,_.totalPrice=null!==(F=e.totalPrice)&&void 0!==F?F:0,_.refundSettings=e.refundSettings;var N={billingAddress:h,cancelReason:h,cancelledAt:h,currencyCode:h,currencySymbol:h,customer:h,customerId:h,edited:h,giftCardLines:h,giftPackageLines:h,giftPackageNote:h,invoices:h,isGiftPackage:h,loyaltyLines:h,note:h,orderAdjustments:h,orderLineItems:h,orderNumber:h,orderPackageStatus:h,orderPackages:h,orderPaymentStatus:h,orderedAt:h,paymentMethods:h,shippingAddress:h,shippingLines:h,shippingMethod:h,status:h,taxLines:h,netTotalFinalPrice:h,totalFinalPrice:h,totalPrice:h,refundSettings:h,refundableLineItems:h,_refundReasonId:h,_refundReason:h,_refundReasons:h,_refundTranslations:h,items:P,itemCount:P,refundableItems:P,refundReasonId:P,reason:P,refundReasons:P,returnMethodDescription:P,isRefundEnabled:P,unfullfilledItems:P,refundedItems:P,totalTax:P,formattedTotalTax:P,shippingTotal:P,formattedShippingTotal:P,formattedTotalFinalPrice:P,formattedTotalPrice:P,hasCustomer:P,hasValidCustomerEmail:P,customerFullName:P,formattedDate:P,couponAdjustment:P,nonCouponAdjustments:P,orderProductFileIds:P,applyRefundableLines:v};return i&&(delete N.billingAddress,delete N.shippingAddress),y(_,N),_}return e(k,f),Object.defineProperty(k.prototype,"items",{get:function(){return this.orderLineItems.filter((function(e){return e.status!==m.CANCELLED}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"itemCount",{get:function(){var e;return(null===(e=this.items)||void 0===e?void 0:e.length)||0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"itemQuantity",{get:function(){return this.items.reduce((function(e,t){return e+t.quantity}),0)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"refundableItems",{get:function(){if(!this.refundableLineItems)return[];var e=new Set(this.refundableLineItems.filter((function(e){return e.isRefundable})).map((function(e){return e.orderLineItemId})));return this.orderLineItems.filter((function(t){return e.has(t.id)}))},enumerable:!1,configurable:!0}),k.prototype.applyRefundableLines=function(e){var t=new i(e);this.refundableLineItems=t.orderLineItems,this._refundReasons=t.refundReasons,this._refundTranslations=t.translations;var n=new Map(this.refundableLineItems.map((function(e){return[e.orderLineItemId,e]})));this.orderLineItems.forEach((function(e){var t,r,i,o,l=n.get(e.id);e.flow=null!==(t=null==l?void 0:l.flow)&&void 0!==t?t:null,e.autoApprove=null!==(r=null==l?void 0:l.autoApprove)&&void 0!==r&&r,e.isCancellable=null!==(i=null==l?void 0:l.isCancellable)&&void 0!==i&&i,e.isRefundable=null!==(o=null==l?void 0:l.isRefundable)&&void 0!==o&&o}))},Object.defineProperty(k.prototype,"refundReasonId",{get:function(){return this._refundReasonId},set:function(e){this._refundReasonId=e||null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"reason",{get:function(){return this._refundReason},set:function(e){this._refundReason=e||null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"refundReasons",{get:function(){var e=I.getCurrentLocale();return(this._refundReasons||[]).map((function(t){var n,r;return{id:t.id,title:(null===(r=null===(n=t.translations)||void 0===n?void 0:n.find((function(t){return t.locale===e})))||void 0===r?void 0:r.title)||t.title}}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"returnMethodDescription",{get:function(){var e,t,n=I.getCurrentLocale();return(null===(t=null===(e=this._refundTranslations)||void 0===e?void 0:e.find((function(e){return e.locale===n})))||void 0===t?void 0:t.returnMethodDescription)||null},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"displayedPackages",{get:function(){return j.getDisplayedPackages(this).map((function(e){return new d(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"unfullfilledItems",{get:function(){return j.getUnfullfilledItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"refundedItems",{get:function(){return j.getRefundedItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"totalTax",{get:function(){return j.getTotalTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedTotalTax",{get:function(){return L(this.totalTax,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"shippingTotal",{get:function(){return j.getShippingTotal(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedShippingTotal",{get:function(){return L(this.shippingTotal,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedTotalFinalPrice",{get:function(){return L(this.totalFinalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedTotalPrice",{get:function(){return L(this.totalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"hasCustomer",{get:function(){return j.hasCustomer(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"hasValidCustomerEmail",{get:function(){return j.hasValidCustomerEmail(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"customerFullName",{get:function(){return j.getCustomerFullName(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"formattedDate",{get:function(){return j.getFormattedDate(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"couponAdjustment",{get:function(){return j.getCouponAdjustment(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"nonCouponAdjustments",{get:function(){return j.getNonCouponAdjustments(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRefundEnabled",{get:function(){return this.refundableItems.some((function(e){return null!==e.refundQuantity}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"displayedOrderAdjustments",{get:function(){var e;return null===(e=this.orderAdjustments)||void 0===e?void 0:e.filter((function(e){return e.campaignType!==p.FREE_SHIPPING}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"orderProductFileIds",{get:function(){return j.getOrderProductFiles(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"giftCardTotalPrice",{get:function(){var e;return(null===(e=this.giftCardLines)||void 0===e?void 0:e.reduce((function(e,t){return e+t.amount}),0))||0},enumerable:!1,configurable:!0}),k}(f);export{k as IkasOrder};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IkasOrderLineItem as IOrderLineItem, IkasOrderLineItemStatus } from "@ikas/storefront-models";
|
|
1
|
+
import { IkasOrderLineItem as IOrderLineItem, IkasOrderLineItemStatus, IkasOrderRefundFlow } from "@ikas/storefront-models";
|
|
2
2
|
import { IkasOrderLineDiscount } from "./discount";
|
|
3
3
|
import { IkasOrderLineVariant } from "./variant";
|
|
4
4
|
import { IkasOrderLineItemOption } from "./option";
|
|
@@ -29,6 +29,10 @@ export declare class IkasOrderLineItem extends IkasBaseModel implements IOrderLi
|
|
|
29
29
|
orderedAt: number;
|
|
30
30
|
subscriptionPlan: IkasOrderLineItemSubscriptionPlan | null;
|
|
31
31
|
private _refundQuantity;
|
|
32
|
+
flow: IkasOrderRefundFlow | null;
|
|
33
|
+
autoApprove: boolean;
|
|
34
|
+
isCancellable: boolean;
|
|
35
|
+
isRefundable: boolean;
|
|
32
36
|
constructor(data: IOrderLineItemConstructorParams);
|
|
33
37
|
get priceWithQuantity(): number;
|
|
34
38
|
get formattedPriceWithQuantity(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as t}from'./../../../../ext/tslib/tslib.es6.js';export{IkasOrderLineItemStatus}from"@ikas/storefront-models";import{IkasOrderLineDiscount as e}from"./discount/index.js";import{IkasOrderLineVariant as i}from"./variant/index.js";import{IkasOrderLineItemOption as n}from"./option/index.js";import{IkasOrderLineBundleProductSettings as r}from"./bundle-product-settings/index.js";import{IkasBaseModel as o}from"../../base/index.js";import{makeObservable as u,observable as c,computed as a,action as l}from"mobx";import{IkasOrderLineItemFunctions as d}from"@ikas/storefront-model-functions";import{formatCurrency as s}from"../../../../utils/currency.js";import{IkasBaseStore as f}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{IkasOrderLineItemSubscriptionPlan as y}from"./order-line-item-subscription-plan/index.js";var p=function(o){function p(t){var d,s,f,p,m,b=this;return(b=o.call(this,t)||this).bundleProductSettings=null,b.currencyCode=null,b.discount=null,b.discountPrice=null,b.finalPrice=null,b.options=null,b.originalOrderLineItemId=null,b.statusUpdatedAt=null,b.stockLocationId=null,b.taxValue=null,b.subscriptionPlan=null,b._refundQuantity=null,b.bundleProductSettings=t.bundleProductSettings?new r(t.bundleProductSettings):null,b.currencyCode=t.currencyCode||null,b.currencySymbol=t.currencySymbol||null,b.discount=t.discount?new e(t.discount):null,b.discountPrice=null!==(d=t.discountPrice)&&void 0!==d?d:null,b.finalPrice=null!==(s=t.finalPrice)&&void 0!==s?s:null,b.finalUnitPrice=null!==(f=t.finalUnitPrice)&&void 0!==f?f:null,b.options=(null===(p=t.options)||void 0===p?void 0:p.map((function(t){return new n(t)})))||null,b.originalOrderLineItemId=t.originalOrderLineItemId||null,b.price=t.price,b.quantity=t.quantity,b.status=t.status,b.statusUpdatedAt=t.statusUpdatedAt,b.stockLocationId=t.stockLocationId,b.taxValue=t.taxValue,b.unitPrice=null!==(m=t.unitPrice)&&void 0!==m?m:null,b.variant=new i(t.variant),b.orderedAt=t.orderedAt,b.subscriptionPlan=t.subscriptionPlan?new y(t.subscriptionPlan):null,b.refundQuantity=t.refundQuantity,u(b,{bundleProductSettings:c,currencyCode:c,currencySymbol:c,discount:c,discountPrice:c,finalPrice:c,finalUnitPrice:c,options:c,originalOrderLineItemId:c,price:c,quantity:c,status:c,statusUpdatedAt:c,stockLocationId:c,taxValue:c,unitPrice:c,variant:c,orderedAt:c,subscriptionPlan:c,_refundQuantity:c,priceWithQuantity:a,formattedPriceWithQuantity:a,overridenPriceWithQuantity:a,formattedOverridenPriceWithQuantity:a,formattedFinalPrice:a,formattedUnitPrice:a,formattedFinalUnitPrice:a,formattedDiscountPrice:a,finalPriceWithQuantity:a,formattedFinalPriceWithQuantity:a,tax:a,formattedTax:a,refundQuantity:a,editLineItem:l.bound}),b}return t(p,o),Object.defineProperty(p.prototype,"priceWithQuantity",{get:function(){return d.getPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedPriceWithQuantity",{get:function(){return s(this.priceWithQuantity,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"overridenPriceWithQuantity",{get:function(){return d.getOverridenPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedOverridenPriceWithQuantity",{get:function(){return s(this.overridenPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedFinalPrice",{get:function(){return s(this.finalPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedUnitPrice",{get:function(){return s(this.unitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedFinalUnitPrice",{get:function(){return s(this.finalUnitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"unitPriceText",{get:function(){var t,e,i,n;if(null!==this.finalUnitPrice){var r=null===(t=this.variant.baseUnit)||void 0===t?void 0:t.baseAmount,o=(null===(i=null===(e=this.variant.baseUnit)||void 0===e?void 0:e.unit)||void 0===i?void 0:i.name)||(null===(n=this.variant.baseUnit)||void 0===n?void 0:n.type);return"".concat(s(this.finalUnitPrice,this.currencyCode||"",this.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(o)}},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedDiscountPrice",{get:function(){return s(this.discountPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"finalPriceWithQuantity",{get:function(){return d.getFinalPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedFinalPriceWithQuantity",{get:function(){return s(this.finalPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"tax",{get:function(){return d.getTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedTax",{get:function(){return s(this.tax,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"hasDiscount",{get:function(){return d.hasDiscount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"refundQuantity",{get:function(){return this._refundQuantity},set:function(t){t?(t>this.quantity&&(t=this.quantity),t<=0&&(t=null),this._refundQuantity=t):this._refundQuantity=null},enumerable:!1,configurable:!0}),p.prototype.editLineItem=function(){var t,e=this.variant.href||"";e=e.includes("?")?e+"&editLineID="+this.id:e+"?editLineID="+this.id,null===(t=f.getInstance().router)||void 0===t||t.push(e)},p}(o);export{p as IkasOrderLineItem};
|
|
1
|
+
import{__extends as t}from'./../../../../ext/tslib/tslib.es6.js';export{IkasOrderLineItemStatus}from"@ikas/storefront-models";import{IkasOrderLineDiscount as e}from"./discount/index.js";import{IkasOrderLineVariant as i}from"./variant/index.js";import{IkasOrderLineItemOption as n}from"./option/index.js";import{IkasOrderLineBundleProductSettings as r}from"./bundle-product-settings/index.js";import{IkasBaseModel as o}from"../../base/index.js";import{makeObservable as u,observable as c,computed as a,action as l}from"mobx";import{IkasOrderLineItemFunctions as d}from"@ikas/storefront-model-functions";import{formatCurrency as s}from"../../../../utils/currency.js";import{IkasBaseStore as f}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{IkasOrderLineItemSubscriptionPlan as y}from"./order-line-item-subscription-plan/index.js";var p=function(o){function p(t){var d,s,f,p,m,b=this;return(b=o.call(this,t)||this).bundleProductSettings=null,b.currencyCode=null,b.discount=null,b.discountPrice=null,b.finalPrice=null,b.options=null,b.originalOrderLineItemId=null,b.statusUpdatedAt=null,b.stockLocationId=null,b.taxValue=null,b.subscriptionPlan=null,b._refundQuantity=null,b.flow=null,b.autoApprove=!1,b.isCancellable=!1,b.isRefundable=!1,b.bundleProductSettings=t.bundleProductSettings?new r(t.bundleProductSettings):null,b.currencyCode=t.currencyCode||null,b.currencySymbol=t.currencySymbol||null,b.discount=t.discount?new e(t.discount):null,b.discountPrice=null!==(d=t.discountPrice)&&void 0!==d?d:null,b.finalPrice=null!==(s=t.finalPrice)&&void 0!==s?s:null,b.finalUnitPrice=null!==(f=t.finalUnitPrice)&&void 0!==f?f:null,b.options=(null===(p=t.options)||void 0===p?void 0:p.map((function(t){return new n(t)})))||null,b.originalOrderLineItemId=t.originalOrderLineItemId||null,b.price=t.price,b.quantity=t.quantity,b.status=t.status,b.statusUpdatedAt=t.statusUpdatedAt,b.stockLocationId=t.stockLocationId,b.taxValue=t.taxValue,b.unitPrice=null!==(m=t.unitPrice)&&void 0!==m?m:null,b.variant=new i(t.variant),b.orderedAt=t.orderedAt,b.subscriptionPlan=t.subscriptionPlan?new y(t.subscriptionPlan):null,b.refundQuantity=t.refundQuantity,u(b,{bundleProductSettings:c,currencyCode:c,currencySymbol:c,discount:c,discountPrice:c,finalPrice:c,finalUnitPrice:c,options:c,originalOrderLineItemId:c,price:c,quantity:c,status:c,statusUpdatedAt:c,stockLocationId:c,taxValue:c,unitPrice:c,variant:c,orderedAt:c,subscriptionPlan:c,flow:c,autoApprove:c,isCancellable:c,isRefundable:c,_refundQuantity:c,priceWithQuantity:a,formattedPriceWithQuantity:a,overridenPriceWithQuantity:a,formattedOverridenPriceWithQuantity:a,formattedFinalPrice:a,formattedUnitPrice:a,formattedFinalUnitPrice:a,formattedDiscountPrice:a,finalPriceWithQuantity:a,formattedFinalPriceWithQuantity:a,tax:a,formattedTax:a,refundQuantity:a,editLineItem:l.bound}),b}return t(p,o),Object.defineProperty(p.prototype,"priceWithQuantity",{get:function(){return d.getPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedPriceWithQuantity",{get:function(){return s(this.priceWithQuantity,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"overridenPriceWithQuantity",{get:function(){return d.getOverridenPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedOverridenPriceWithQuantity",{get:function(){return s(this.overridenPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedFinalPrice",{get:function(){return s(this.finalPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedUnitPrice",{get:function(){return s(this.unitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedFinalUnitPrice",{get:function(){return s(this.finalUnitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"unitPriceText",{get:function(){var t,e,i,n;if(null!==this.finalUnitPrice){var r=null===(t=this.variant.baseUnit)||void 0===t?void 0:t.baseAmount,o=(null===(i=null===(e=this.variant.baseUnit)||void 0===e?void 0:e.unit)||void 0===i?void 0:i.name)||(null===(n=this.variant.baseUnit)||void 0===n?void 0:n.type);return"".concat(s(this.finalUnitPrice,this.currencyCode||"",this.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(o)}},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedDiscountPrice",{get:function(){return s(this.discountPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"finalPriceWithQuantity",{get:function(){return d.getFinalPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedFinalPriceWithQuantity",{get:function(){return s(this.finalPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"tax",{get:function(){return d.getTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"formattedTax",{get:function(){return s(this.tax,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"hasDiscount",{get:function(){return d.hasDiscount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"refundQuantity",{get:function(){return this._refundQuantity},set:function(t){t?(t>this.quantity&&(t=this.quantity),t<=0&&(t=null),this._refundQuantity=t):this._refundQuantity=null},enumerable:!1,configurable:!0}),p.prototype.editLineItem=function(){var t,e=this.variant.href||"";e=e.includes("?")?e+"&editLineID="+this.id:e+"?editLineID="+this.id,null===(t=f.getInstance().router)||void 0===t||t.push(e)},p}(o);export{p as IkasOrderLineItem};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IkasOrderRefundReason as IOrderRefundReason } from "@ikas/storefront-models";
|
|
2
|
+
import { IkasOrderRefundReasonTranslation } from "./translation";
|
|
3
|
+
export declare class IkasOrderRefundReason implements IOrderRefundReason {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
translations: IkasOrderRefundReasonTranslation[] | null;
|
|
7
|
+
constructor(data?: Partial<IOrderRefundReason>);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{IkasOrderRefundReasonTranslation as t}from"./translation/index.js";var i=function(i){void 0===i&&(i={}),this.id=i.id||"",this.title=i.title||"",this.translations=i.translations?i.translations.map((function(i){return new t(i)})):null};export{i as IkasOrderRefundReason};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IkasOrderRefundReasonTranslation as IOrderRefundReasonTranslation } from "@ikas/storefront-models";
|
|
2
|
+
export declare class IkasOrderRefundReasonTranslation implements IOrderRefundReasonTranslation {
|
|
3
|
+
locale: string;
|
|
4
|
+
title: string | null;
|
|
5
|
+
constructor(data?: Partial<IOrderRefundReasonTranslation>);
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeAutoObservable as t}from"mobx";var i=function(i){void 0===i&&(i={}),this.locale=i.locale||"",this.title=i.title||null,t(this)};export{i as IkasOrderRefundReasonTranslation};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IkasOrderRefundFlow, IkasRefundableLine as IRefundableLine } from "@ikas/storefront-models";
|
|
2
|
+
export declare class IkasRefundableLine implements IRefundableLine {
|
|
3
|
+
autoApprove: boolean;
|
|
4
|
+
flow: IkasOrderRefundFlow | null;
|
|
5
|
+
isCancellable: boolean;
|
|
6
|
+
isRefundable: boolean;
|
|
7
|
+
orderLineItemId: string;
|
|
8
|
+
constructor(data: IRefundableLine);
|
|
9
|
+
}
|
|
10
|
+
export { IkasOrderRefundFlow };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{IkasOrderRefundFlow}from"@ikas/storefront-models";import{makeAutoObservable as e}from"mobx";var o=function(o){this.autoApprove=o.autoApprove||!1,this.flow=o.flow||null,this.isCancellable=o.isCancellable||!1,this.isRefundable=o.isRefundable||!1,this.orderLineItemId=o.orderLineItemId||"",e(this)};export{o as IkasRefundableLine};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IkasRefundableLines as IRefundableLines } from "@ikas/storefront-models";
|
|
2
|
+
import { IkasRefundableLine } from "../refundable-line";
|
|
3
|
+
import { IkasOrderRefundReason } from "../reason";
|
|
4
|
+
import { IkasOrderRefundSettingsTranslation } from "../settings/translation";
|
|
5
|
+
export declare class IkasRefundableLines implements IRefundableLines {
|
|
6
|
+
orderLineItems: IkasRefundableLine[];
|
|
7
|
+
refundReasons: IkasOrderRefundReason[];
|
|
8
|
+
translations: IkasOrderRefundSettingsTranslation[];
|
|
9
|
+
constructor(data: IRefundableLines);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeAutoObservable as n}from"mobx";import{IkasRefundableLine as r}from"../refundable-line/index.js";import{IkasOrderRefundReason as e}from"../reason/index.js";import{IkasOrderRefundSettingsTranslation as t}from"../settings/translation/index.js";var s=function(s){this.orderLineItems=s.orderLineItems?s.orderLineItems.map((function(n){return new r(n)})):[],this.refundReasons=s.refundReasons?s.refundReasons.map((function(n){return new e(n)})):[],this.translations=s.translations?s.translations.map((function(n){return new t(n)})):[],n(this)};export{s as IkasRefundableLines};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IkasOrderRefundSettingsTranslation as IOrderRefundSettingsTranslation } from "@ikas/storefront-models";
|
|
2
|
+
export declare class IkasOrderRefundSettingsTranslation implements IOrderRefundSettingsTranslation {
|
|
3
|
+
locale: string;
|
|
4
|
+
returnMethodDescription: string | null;
|
|
5
|
+
constructor(data?: Partial<IOrderRefundSettingsTranslation>);
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeAutoObservable as o}from"mobx";var t=function(t){void 0===t&&(t={}),this.locale=t.locale||"",this.returnMethodDescription=t.returnMethodDescription||null,o(this)};export{t as IkasOrderRefundSettingsTranslation};
|
|
@@ -3,7 +3,6 @@ import { IkasBaseModel } from "../base";
|
|
|
3
3
|
import { IkasPaymentGatewayTranslation } from "./translation";
|
|
4
4
|
import { IkasPaymentGatewaySettings } from "./settings";
|
|
5
5
|
import { IkasPaymentGatewayType, IkasPaymentMethod, IkasPaymentMethodType, IkasPaymentGateway as IPaymentGateway } from "@ikas/storefront-models";
|
|
6
|
-
import { RewardSourceEnum } from "@ikas/storefront-api";
|
|
7
6
|
export declare class IkasPaymentGateway extends IkasBaseModel implements IPaymentGateway {
|
|
8
7
|
additionalPrices: IkasPaymentGatewayAdditionalPrice[] | null;
|
|
9
8
|
availableCountries: string[] | null;
|
|
@@ -20,7 +19,7 @@ export declare class IkasPaymentGateway extends IkasBaseModel implements IPaymen
|
|
|
20
19
|
paymentMethodType: IkasPaymentMethodType;
|
|
21
20
|
settings?: IkasPaymentGatewaySettings[] | null;
|
|
22
21
|
translations?: IkasPaymentGatewayTranslation[] | null;
|
|
23
|
-
|
|
22
|
+
milesSmilesEnabled: boolean | null;
|
|
24
23
|
constructor(data: IPaymentGateway);
|
|
25
24
|
}
|
|
26
25
|
export { IkasPaymentGatewayType, IkasPaymentMethodType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasPaymentGatewayAdditionalPrice as t}from"./additional-price/index.js";import{IkasBaseModel as n}from"../base/index.js";import{IkasPaymentGatewaySettings as
|
|
1
|
+
import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasPaymentGatewayAdditionalPrice as t}from"./additional-price/index.js";import{IkasBaseModel as n}from"../base/index.js";import{IkasPaymentGatewaySettings as i}from"./settings/index.js";import{IkasPaymentGatewayType as o,IkasPaymentMethodType as s}from"@ikas/storefront-models";export{IkasPaymentGatewayType,IkasPaymentMethodType}from"@ikas/storefront-models";import{makeObservable as a,observable as r}from"mobx";var l=function(n){function l(e){var l,d,m,p=this;return(p=n.call(this,e)||this).additionalPrices=(null===(l=e.additionalPrices)||void 0===l?void 0:l.map((function(e){return new t(e)})))||null,p.availableCountries=e.availableCountries||[],p.code=e.code||"",p.description=e.description||null,p.logoUrl=e.logoUrl||null,p.masterPassClientId=e.masterPassClientId||null,p.name=e.name||"",p.paymentGatewayProviderId=e.paymentGatewayProviderId||null,p.supportedCurrencies=e.supportedCurrencies||[],p.testMode=e.testMode||null,p.type=e.type||o.INTERNAL,p.paymentMethods=e.paymentMethods||[],p.paymentMethodType=e.paymentMethodType||s.OTHER,p.settings=(null===(d=e.settings)||void 0===d?void 0:d.map((function(e){return new i(e)})))||null,p.translations=e.translations||null,p.milesSmilesEnabled=null!==(m=e.milesSmilesEnabled)&&void 0!==m?m:null,a(p,{additionalPrices:r,availableCountries:r,code:r,description:r,logoUrl:r,masterPassClientId:r,name:r,paymentGatewayProviderId:r,supportedCurrencies:r,testMode:r,type:r,paymentMethods:r,paymentMethodType:r,settings:r,translations:r,milesSmilesEnabled:r}),p}return e(l,n),l}(n);export{l as IkasPaymentGateway};
|
package/build/pages/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as m}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c,CampaignOfferTargetPageTypeEnum as u}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as j}from"../store/base.js";import"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as g}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as f}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import{LocalizedAddressConfig as x}from"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as y}from"../analytics/events.js";import{APIErrorCode as v}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import h from"../store/checkout/index.js";var C=i((function(i){var C=i.customizationProps,E=i.configJson,b=o(i,["customizationProps","configJson"]),k=n(),F=s.useState(),P=F[0],w=F[1],_=s.useState(b.checkoutSettings),B=_[0],T=_[1];p.init(E),x.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad"),document.documentElement.style.lineHeight="1.5"}(C)}),[C]),s.useEffect((function(){j.getInstance().checkLocalization(),S(),y()}),[]);var S=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,a,l,x,y,C,E,b,F,P,_,S,I;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),s=o.get("lines"),i=o.get("couponCode"),!s)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(d=j.getInstance().cartStore).removeCart(),n=s.split(","),a=n.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),l={variantLines:a,couponCode:i||void 0},[4,d.createCart(l)];case 2:return(x=t.sent()).success&&(y=p.getCurrentRouting(),C=(null==y?void 0:y.path)?"/".concat(y.path):"",window.location.href="".concat(C,"/checkout?id=").concat(null===(S=x.response.data)||void 0===S?void 0:S.id,"&step=info")),[3,4];case 3:return E=t.sent(),console.error("Error creating cart:",E),[3,4];case 4:return[2];case 5:return e?(b=!1,r&&r===m.SUCCESS&&(b=!0),[4,c({id:e,getCompletedCart:b,targetPageType:u.CHECKOUT})]):[2,k.replace("/")];case 6:return F=t.sent(),B?[3,8]:[4,h.listCheckoutSettings({})];case 7:(P=t.sent()).isSuccess&&(null===(I=P.data)||void 0===I?void 0:I.length)?T(P.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(P),console.error(P.graphQLErrors),console.error(P.errorCodes)),t.label=8;case 8:return F.isSuccess&&F.data?(_=F.data,w(new f(_)),j.getInstance().cartStore.setCart(new g(_))):F.errorCodes.some((function(o){return o===v.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return P&&B?s.createElement(d,r({checkout:P,customizationProps:C},b,{checkoutSettings:B})):s.createElement(a,null)}));export{C as default};
|
|
1
|
+
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as s}from"mobx-react-lite";import n from"../components/checkout/index.js";import{useRouter as d}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutLoadFailed as m,getCheckoutHomeHref as c}from"../components/checkout/components/checkout-load-failed/index.js";import{CheckoutStep as l}from"../components/checkout/model.js";import{setAPIClientConfig as u,getCartById as p,CampaignOfferTargetPageTypeEnum as f}from"@ikas/storefront-api";import{IkasStorefrontConfig as j}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as g}from"../store/base.js";import"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as x}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as y}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import{LocalizedAddressConfig as v}from"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as h}from"../analytics/events.js";import{APIErrorCode as E}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import C from"../store/checkout/index.js";var k=s((function(s){var k=s.customizationProps,b=s.configJson,P=o(s,["customizationProps","configJson"]),F=d(),w=i.useState(),_=w[0],T=w[1],S=i.useState(P.checkoutSettings),B=S[0],O=S[1],I=i.useState(!1),D=I[0],L=I[1];j.init(b),v.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),u(),i.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad"),document.documentElement.style.lineHeight="1.5"}(k)}),[k]),i.useEffect((function(){g.getInstance().checkLocalization(),U(),h()}),[]);var U=i.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,i,s,n,d,a,m,c,u,v,h,k,b,P,w,_,S,I;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),i=o.get("lines"),s=o.get("couponCode"),!i)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(n=g.getInstance().cartStore).removeCart(),d=i.split(","),a=d.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),m={variantLines:a,couponCode:s||void 0},[4,n.createCart(m)];case 2:return(c=t.sent()).success&&(u=j.getCurrentRouting(),v=(null==u?void 0:u.path)?"/".concat(u.path):"",window.location.href="".concat(v,"/checkout?id=").concat(null===(S=c.response.data)||void 0===S?void 0:S.id,"&step=info")),[3,4];case 3:return h=t.sent(),console.error("Error creating cart:",h),[3,4];case 4:return[2];case 5:return e?(k=!1,r&&r===l.SUCCESS&&(k=!0),[4,p({id:e,getCompletedCart:k,targetPageType:f.CHECKOUT})]):[2,F.replace("/")];case 6:if(b=t.sent(),B)return[3,10];t.label=7;case 7:return t.trys.push([7,9,,10]),[4,Promise.race([C.listCheckoutSettings({}),new Promise((function(o,e){return setTimeout((function(){return e(new Error("timeout"))}),1e4)}))])];case 8:return(P=t.sent()).isSuccess&&(null===(I=P.data)||void 0===I?void 0:I.length)?(O(P.data[0]),[3,10]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),L(!0),[2]);case 9:return w=t.sent(),console.error("CHECKOUT SETTINGS FETCH FAILED!",w),L(!0),[2];case 10:return b.isSuccess&&b.data?(_=b.data,T(new y(_)),g.getInstance().cartStore.setCart(new x(_))):b.errorCodes.some((function(o){return o===E.LOGIN_REQUIRED}))?F.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):F.replace("/"),[2]}}))}))}),[]);if(D){var N=j.getMerchantSettings();return i.createElement(m,{logo:(null==k?void 0:k.logo)||(null==N?void 0:N.logo),merchantName:null==N?void 0:N.merchantName,backHref:c(),returnPolicy:P.returnPolicy,privacyPolicy:P.privacyPolicy,termsOfService:P.termsOfService,imprint:P.imprint,shippingPolicy:P.shippingPolicy})}return _&&B?i.createElement(n,r({checkout:_,customizationProps:k},P,{checkoutSettings:B})):i.createElement(a,null)}));export{k as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIResponse } from "@ikas/fe-api-client";
|
|
2
|
-
import { CheckCustomerEmailQueryParams, SubscribeToMarketingNotificationsQueryParams, CreateCustomerReviewQueryParams, CreateOrderRefundRequestQueryParams, CustomerForgotPasswordQueryParams, CustomerLoginQueryParams, CustomerRecoverPasswordQueryParams, CustomerRefreshTokenQueryParams, CustomerSocialLoginQueryParams, GetCustomerOrdersQueryParams, GetLastViewedProductsQueryParams, GetOrderByEmailQueryParams, IsFavoriteProductQueryParams, ListCustomerReviewsQueryParams, ListCustomerReviewSummaryQueryParams, ListOrderRefundSettingsQueryParams, ListOrderTransactionsQueryParams, ListOrderTransactionsWithPricesQueryParams, RegisterCustomerQueryParams, SaveFavoriteProductQueryParams, SaveLastViewedProductsQueryParams, SaveMyCustomerQueryParams, SendContactFormToMerchantQueryParams, ActivateCustomerQueryParams, ResendCustomerActivationMailQueryParams, ValidateCustomerPhoneVerificationCodeQueryParams, SaveCustomerFormDataQueryParams, CustomerDeactiveQueryParams, ValidateOTPCodeQueryParams, GetLoyaltyCustomerInfoQueryParams, ListLoyaltyProgramPointHistoryQueryParams, ListSpendingMethodsByCartIdQueryParams, UseLoyaltyPointsQueryParams } from "@ikas/storefront-api";
|
|
3
|
-
import { IkasCustomer, IkasCustomerAttribute, IkasCustomerReview, IkasCustomerReviewSummary, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrder, IkasOrderRefundSettings, IkasOrderTransaction, IkasOrderTransactionWithPrices } from "../../models/data";
|
|
2
|
+
import { GetExternalAccountLinkQueryParams, UnlinkExternalAccountQueryParams, CheckCustomerEmailQueryParams, SubscribeToMarketingNotificationsQueryParams, CreateCustomerReviewQueryParams, CreateOrderRefundRequestQueryParams, GetRefundableLinesQueryParams, CustomerForgotPasswordQueryParams, CustomerLoginQueryParams, CustomerRecoverPasswordQueryParams, CustomerRefreshTokenQueryParams, CustomerSocialLoginQueryParams, GetCustomerOrdersQueryParams, GetLastViewedProductsQueryParams, GetOrderByEmailQueryParams, IsFavoriteProductQueryParams, ListCustomerReviewsQueryParams, ListCustomerReviewSummaryQueryParams, ListOrderRefundSettingsQueryParams, ListOrderTransactionsQueryParams, ListOrderTransactionsWithPricesQueryParams, RegisterCustomerQueryParams, SaveFavoriteProductQueryParams, SaveLastViewedProductsQueryParams, SaveMyCustomerQueryParams, SendContactFormToMerchantQueryParams, ActivateCustomerQueryParams, ResendCustomerActivationMailQueryParams, ValidateCustomerPhoneVerificationCodeQueryParams, SaveCustomerFormDataQueryParams, CustomerDeactiveQueryParams, ValidateOTPCodeQueryParams, GetLoyaltyCustomerInfoQueryParams, ListLoyaltyProgramPointHistoryQueryParams, ListSpendingMethodsByCartIdQueryParams, UseLoyaltyPointsQueryParams } from "@ikas/storefront-api";
|
|
3
|
+
import { IkasCustomer, IkasCustomerAttribute, IkasCustomerReview, IkasCustomerReviewSummary, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrder, IkasOrderRefundSettings, IkasOrderTransaction, IkasOrderTransactionWithPrices, IkasRefundableLines } from "../../models/data";
|
|
4
4
|
export default class CustomerStoreAPI {
|
|
5
5
|
static login(params: CustomerLoginQueryParams): Promise<APIResponse<{
|
|
6
6
|
customer: IkasCustomer | null;
|
|
@@ -9,6 +9,8 @@ export default class CustomerStoreAPI {
|
|
|
9
9
|
token: string;
|
|
10
10
|
tokenExpiry: number;
|
|
11
11
|
} | null>>;
|
|
12
|
+
static getExternalAccountLink(params?: GetExternalAccountLinkQueryParams): Promise<APIResponse<import("@ikas/storefront-api").ExternalAccountLink | null>>;
|
|
13
|
+
static unlinkExternalAccount(params?: UnlinkExternalAccountQueryParams): Promise<APIResponse<boolean>>;
|
|
12
14
|
static socialLogin(params: CustomerSocialLoginQueryParams): Promise<APIResponse<{
|
|
13
15
|
customer: IkasCustomer | null;
|
|
14
16
|
flowId: string | null;
|
|
@@ -24,8 +26,8 @@ export default class CustomerStoreAPI {
|
|
|
24
26
|
tokenExpiry: number;
|
|
25
27
|
} | null>>;
|
|
26
28
|
static refreshToken(params: CustomerRefreshTokenQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").CustomerRefreshTokenResponse>>;
|
|
27
|
-
static forgotPassword(params: CustomerForgotPasswordQueryParams): Promise<APIResponse<
|
|
28
|
-
static recoverPassword(params: CustomerRecoverPasswordQueryParams): Promise<APIResponse<
|
|
29
|
+
static forgotPassword(params: CustomerForgotPasswordQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
30
|
+
static recoverPassword(params: CustomerRecoverPasswordQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
29
31
|
static checkEmail(params: CheckCustomerEmailQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").CustomerCheckResponse>>;
|
|
30
32
|
static getCustomer(): Promise<APIResponse<IkasCustomer | null>>;
|
|
31
33
|
static saveCustomer(params: SaveMyCustomerQueryParams): Promise<APIResponse<IkasCustomer | null>>;
|
|
@@ -33,15 +35,16 @@ export default class CustomerStoreAPI {
|
|
|
33
35
|
static getOrderByEmail(params: GetOrderByEmailQueryParams): Promise<APIResponse<IkasOrder | null>>;
|
|
34
36
|
static listOrderTransactions(params: ListOrderTransactionsQueryParams): Promise<APIResponse<IkasOrderTransaction[]>>;
|
|
35
37
|
static listOrderTransactionsWithPrices(params: ListOrderTransactionsWithPricesQueryParams): Promise<APIResponse<IkasOrderTransactionWithPrices | null>>;
|
|
38
|
+
static getRefundableLines(params: GetRefundableLinesQueryParams): Promise<APIResponse<IkasRefundableLines | null>>;
|
|
36
39
|
static createOrderRefundRequest(params: CreateOrderRefundRequestQueryParams): Promise<APIResponse<IkasOrder | null>>;
|
|
37
|
-
static subscribeToMarketingNotifications(params: SubscribeToMarketingNotificationsQueryParams): Promise<APIResponse<
|
|
40
|
+
static subscribeToMarketingNotifications(params: SubscribeToMarketingNotificationsQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
38
41
|
static getLastViewedProducts(params: GetLastViewedProductsQueryParams): Promise<APIResponse<IkasLastViewedProduct[]>>;
|
|
39
42
|
static saveLastViewedProducts(params: SaveLastViewedProductsQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").ProductLastViewed>>;
|
|
40
43
|
static listOrderRefundSettings(params: ListOrderRefundSettingsQueryParams): Promise<APIResponse<IkasOrderRefundSettings[]>>;
|
|
41
|
-
static sendContactFormToMerchant(params: SendContactFormToMerchantQueryParams): Promise<APIResponse<
|
|
44
|
+
static sendContactFormToMerchant(params: SendContactFormToMerchantQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
42
45
|
static listFavoriteProducts(): Promise<APIResponse<IkasFavoriteProduct[]>>;
|
|
43
|
-
static saveFavoriteProduct(params: SaveFavoriteProductQueryParams): Promise<APIResponse<
|
|
44
|
-
static isFavoriteProduct(params: IsFavoriteProductQueryParams): Promise<APIResponse<
|
|
46
|
+
static saveFavoriteProduct(params: SaveFavoriteProductQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
47
|
+
static isFavoriteProduct(params: IsFavoriteProductQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
45
48
|
static createCustomerReview(params: CreateCustomerReviewQueryParams): Promise<APIResponse<IkasCustomerReview | null>>;
|
|
46
49
|
static listCustomerReviews(params: ListCustomerReviewsQueryParams): Promise<APIResponse<{
|
|
47
50
|
data: IkasCustomerReview[];
|
|
@@ -59,7 +62,7 @@ export default class CustomerStoreAPI {
|
|
|
59
62
|
}>>;
|
|
60
63
|
static listCustomerAttribute(): Promise<APIResponse<IkasCustomerAttribute[]>>;
|
|
61
64
|
static activateCustomer(params: ActivateCustomerQueryParams): Promise<APIResponse<undefined> | APIResponse<string>>;
|
|
62
|
-
static resendCustomerActivationMail(params: ResendCustomerActivationMailQueryParams): Promise<APIResponse<
|
|
65
|
+
static resendCustomerActivationMail(params: ResendCustomerActivationMailQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
63
66
|
static resendCustomerPhoneVerificationCode(): Promise<APIResponse<boolean>>;
|
|
64
67
|
static validateCustomerPhoneVerificationCode(params: ValidateCustomerPhoneVerificationCodeQueryParams): Promise<APIResponse<boolean>>;
|
|
65
68
|
static validateOTPCode(params: ValidateOTPCodeQueryParams): Promise<APIResponse<{
|
|
@@ -69,9 +72,9 @@ export default class CustomerStoreAPI {
|
|
|
69
72
|
token: string;
|
|
70
73
|
tokenExpiry: number;
|
|
71
74
|
} | null>>;
|
|
72
|
-
static saveCustomerFormData(params: SaveCustomerFormDataQueryParams): Promise<APIResponse<
|
|
75
|
+
static saveCustomerFormData(params: SaveCustomerFormDataQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
73
76
|
static exportCustomerPersonelData(): Promise<APIResponse<undefined> | APIResponse<string>>;
|
|
74
|
-
static deactivateCustomer(params: CustomerDeactiveQueryParams): Promise<APIResponse<
|
|
77
|
+
static deactivateCustomer(params: CustomerDeactiveQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
|
|
75
78
|
static getLoyaltyCustomerInfo(params: GetLoyaltyCustomerInfoQueryParams): Promise<APIResponse<import("@ikas/storefront-api").LoyaltyCustomerInfo>>;
|
|
76
79
|
static listLoyaltyProgramPointHistory(params: ListLoyaltyProgramPointHistoryQueryParams): Promise<APIResponse<import("@ikas/storefront-api").LoyaltyProgramPointHistory[]>>;
|
|
77
80
|
static listLoyaltyProgramTiers(): Promise<APIResponse<import("@ikas/storefront-api").LoyaltyProgramTier[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as s,refreshToken as a,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as f,getOrderByEmail as h,listOrderTransactions as p,listOrderTransactionsWithPrices as v,createOrderRefundRequest as w,subscribeToMarketingNotifications as j,getLastViewedProducts as x,saveLastViewedProducts as b,listOrderRefundSettings as g,sendContactFormToMerchant as y,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as C,createCustomerReview as P,listCustomerReviews as Q,listCustomerReviewSummary as k,listCustomerAttribute as _,activateCustomer as T,resendCustomerActivationMail as O,resendCustomerPhoneVerificationCode as R,validateCustomerPhoneVerificationCode as F,validateOTPCode as I,saveCustomerFormData as M,exportCustomerPersonelData as S,deactivateCustomer as V,getLoyaltyCustomerInfo as z,listLoyaltyProgramPointHistory as A,listLoyaltyProgramTiers as B,listEarningMethods as D,listSpendingMethodsByCartId as q,useLoyaltyPoints as G}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import{IkasCustomerAttribute as H}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as N}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as W}from"../../models/data/customer/review/index.js";import{IkasCustomer as J}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as K}from"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasLastViewedProduct as U}from"../../models/data/last-viewed-product/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderTransactionWithPrices as X}from"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import{IkasOrderRefundSettings as Y}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as Z}from"../../models/data/order/transaction/index.js";import{IkasOrder as $}from"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var tt=function(){function tt(){}return tt.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a(r)];case 1:return[2,t.sent()]}}))}))},tt.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},tt.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},tt.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},tt.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new J(t.data):null,t.graphQLErrors)]}}))}))},tt.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new J(t.data):null,t.graphQLErrors)]}}))}))},tt.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new $(t)})),t.graphQLErrors)]}}))}))},tt.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new $(t.data):null,t.graphQLErrors)]}}))}))},tt.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new Z(t)})),t.graphQLErrors)]}}))}))},tt.listOrderTransactionsWithPrices=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(t.data?new X(t.data):null,t.graphQLErrors)]}}))}))},tt.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,w(r)];case 1:return t=e.sent(),[2,new n(t.data?new $(t.data):null,t.graphQLErrors)]}}))}))},tt.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,j(r)];case 1:return[2,t.sent()]}}))}))},tt.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,x(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new U(t)})),t.graphQLErrors)]}}))}))},tt.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},tt.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new Y(t)})),t.graphQLErrors)]}}))}))},tt.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,y(r)];case 1:return[2,t.sent()]}}))}))},tt.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new K(t)})),t.graphQLErrors)]}}))}))},tt.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},tt.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,C({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},tt.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P(r)];case 1:return t=e.sent(),[2,new n(t.data?new W(t.data):null,t.graphQLErrors)]}}))}))},tt.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new W(t)}))}):null,t.graphQLErrors)]}}))}))},tt.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,k(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new N(t)}))}),t.graphQLErrors)]}}))}))},tt.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,_()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new H(t)}),t.graphQLErrors))]}}))}))},tt.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,T(r)];case 1:return[2,t.sent()]}}))}))},tt.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,O(r)];case 1:return[2,t.sent()]}}))}))},tt.resendCustomerPhoneVerificationCode=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R()];case 1:return[2,t.sent()]}}))}))},tt.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},tt.validateOTPCode=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,I(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,M(r)];case 1:return[2,t.sent()]}}))}))},tt.exportCustomerPersonelData=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,S()];case 1:return[2,t.sent()]}}))}))},tt.deactivateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,V(r)];case 1:return[2,t.sent()]}}))}))},tt.getLoyaltyCustomerInfo=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,z(r)];case 1:return[2,t.sent()]}}))}))},tt.listLoyaltyProgramPointHistory=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,A(r)];case 1:return[2,t.sent()]}}))}))},tt.listLoyaltyProgramTiers=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,B()];case 1:return[2,t.sent()]}}))}))},tt.listEarningMethods=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,D()];case 1:return[2,t.sent()]}}))}))},tt.listSpendingMethodsByCartId=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,q(r)];case 1:return[2,t.sent()]}}))}))},tt.useLoyaltyPoints=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,G(r)];case 1:return[2,t.sent()]}}))}))},tt}();export{tt as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,getExternalAccountLink as o,unlinkExternalAccount as s,socialLogin as a,register as d,refreshToken as u,forgotPassword as c,recoverPassword as l,checkEmail as m,getCustomer as f,saveCustomer as h,getOrders as p,getOrderByEmail as v,listOrderTransactions as w,listOrderTransactionsWithPrices as j,getRefundableLines as x,createOrderRefundRequest as b,subscribeToMarketingNotifications as g,getLastViewedProducts as L,saveLastViewedProducts as y,listOrderRefundSettings as E,sendContactFormToMerchant as Q,listFavoriteProducts as C,saveFavoriteProduct as P,isFavoriteProduct as k,createCustomerReview as _,listCustomerReviews as T,listCustomerReviewSummary as R,listCustomerAttribute as O,activateCustomer as A,resendCustomerActivationMail as F,resendCustomerPhoneVerificationCode as I,validateCustomerPhoneVerificationCode as M,validateOTPCode as S,saveCustomerFormData as V,exportCustomerPersonelData as z,deactivateCustomer as B,getLoyaltyCustomerInfo as D,listLoyaltyProgramPointHistory as q,listLoyaltyProgramTiers as G,listEarningMethods as H,listSpendingMethodsByCartId as N,useLoyaltyPoints as W}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import{IkasCustomerAttribute as J}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as K}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as U}from"../../models/data/customer/review/index.js";import{IkasCustomer as X}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as Y}from"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasLastViewedProduct as Z}from"../../models/data/last-viewed-product/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderTransactionWithPrices as $}from"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import{IkasRefundableLines as tt}from"../../models/data/order/refund/refundable-lines/index.js";import{IkasOrderRefundSettings as et}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as rt}from"../../models/data/order/transaction/index.js";import{IkasOrder as nt}from"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var it=function(){function it(){}return it.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new X(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},it.getExternalAccountLink=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(r)];case 1:return t=e.sent(),[2,new n(null!==(i=t.data)&&void 0!==i?i:null,t.graphQLErrors)]}}))}))},it.unlinkExternalAccount=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(r)];case 1:return t=e.sent(),[2,new n(!!t.data,t.graphQLErrors)]}}))}))},it.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new X(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},it.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,d(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new X(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},it.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},it.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},it.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,l(r)];case 1:return[2,t.sent()]}}))}))},it.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,m(r)];case 1:return[2,t.sent()]}}))}))},it.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f()];case 1:return t=e.sent(),[2,new n(t.data?new X(t.data):null,t.graphQLErrors)]}}))}))},it.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new X(t.data):null,t.graphQLErrors)]}}))}))},it.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new nt(t)})),t.graphQLErrors)]}}))}))},it.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(t.data?new nt(t.data):null,t.graphQLErrors)]}}))}))},it.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,w(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new rt(t)})),t.graphQLErrors)]}}))}))},it.listOrderTransactionsWithPrices=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(t.data?new $(t.data):null,t.graphQLErrors)]}}))}))},it.getRefundableLines=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,x(r)];case 1:return t=e.sent(),[2,new n(t.data?new tt(t.data):null,t.graphQLErrors)]}}))}))},it.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,b(r)];case 1:return t=e.sent(),[2,new n(t.data?new nt(t.data):null,t.graphQLErrors)]}}))}))},it.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,g(r)];case 1:return[2,t.sent()]}}))}))},it.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new Z(t)})),t.graphQLErrors)]}}))}))},it.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,y(r)];case 1:return[2,t.sent()]}}))}))},it.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,E(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new et(t)})),t.graphQLErrors)]}}))}))},it.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,Q(r)];case 1:return[2,t.sent()]}}))}))},it.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new Y(t)})),t.graphQLErrors)]}}))}))},it.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,P(r)];case 1:return[2,t.sent()]}}))}))},it.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,k({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},it.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,_(r)];case 1:return t=e.sent(),[2,new n(t.data?new U(t.data):null,t.graphQLErrors)]}}))}))},it.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,T(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new U(t)}))}):null,t.graphQLErrors)]}}))}))},it.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,R(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new K(t)}))}),t.graphQLErrors)]}}))}))},it.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,O()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new J(t)}),t.graphQLErrors))]}}))}))},it.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,A(r)];case 1:return[2,t.sent()]}}))}))},it.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},it.resendCustomerPhoneVerificationCode=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,I()];case 1:return[2,t.sent()]}}))}))},it.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,M(r)];case 1:return[2,t.sent()]}}))}))},it.validateOTPCode=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,S(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new X(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},it.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,V(r)];case 1:return[2,t.sent()]}}))}))},it.exportCustomerPersonelData=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,z()];case 1:return[2,t.sent()]}}))}))},it.deactivateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,B(r)];case 1:return[2,t.sent()]}}))}))},it.getLoyaltyCustomerInfo=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,D(r)];case 1:return[2,t.sent()]}}))}))},it.listLoyaltyProgramPointHistory=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,q(r)];case 1:return[2,t.sent()]}}))}))},it.listLoyaltyProgramTiers=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,G()];case 1:return[2,t.sent()]}}))}))},it.listEarningMethods=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,H()];case 1:return[2,t.sent()]}}))}))},it.listSpendingMethodsByCartId=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,N(r)];case 1:return[2,t.sent()]}}))}))},it.useLoyaltyPoints=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,W(r)];case 1:return[2,t.sent()]}}))}))},it}();export{it as default};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { IkasContactForm, IkasCustomer, IkasCustomerAttributeValue, IkasFavoriteProduct, IkasOrderTransaction, IkasOrderTransactionWithPrices, IkasProduct, IkasOrder, IkasRaffleParticipant, IkasProductFile } from "../../models/data";
|
|
2
2
|
import { APIResponse } from "@ikas/fe-api-client";
|
|
3
|
-
import { IkasLoginError, IkasRegisterError } from "@ikas/storefront-api";
|
|
3
|
+
import { ExternalAccountLink, IkasLoginError, IkasRefundRequestError, IkasRegisterError } from "@ikas/storefront-api";
|
|
4
4
|
import { IkasBaseStore } from "../base";
|
|
5
5
|
import { AddLoyaltyToCartInput, SaveCustomerFormDataInput } from "@ikas/storefront-api/src/__api/types";
|
|
6
6
|
export declare type SocialLoginProvider = "facebook" | "google" | "twitch" | "apple";
|
|
7
|
+
export declare type MilesSmilesBindResult = {
|
|
8
|
+
isSuccess: boolean;
|
|
9
|
+
/** Error code from the bind flow (e.g. AUTHORIZATION_REQUIRED). */
|
|
10
|
+
errorCode?: string | null;
|
|
11
|
+
};
|
|
7
12
|
export declare class IkasCustomerStore {
|
|
8
13
|
customer?: IkasCustomer | null;
|
|
9
14
|
private token?;
|
|
@@ -26,7 +31,27 @@ export declare class IkasCustomerStore {
|
|
|
26
31
|
private toAnalyticsCustomer;
|
|
27
32
|
socialLogin(provider: SocialLoginProvider): Promise<void>;
|
|
28
33
|
socialLoginToken(token: string): Promise<boolean>;
|
|
29
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Starts the Miles&Smiles account bind flow for the logged-in customer.
|
|
36
|
+
* The THY login page opens in a popup; once THY confirms, the token payload
|
|
37
|
+
* is posted to the ikas bind callback and the browser lands on `redirect`
|
|
38
|
+
* with `milesSmilesStatus` query params (see `readMilesSmilesBindResult`).
|
|
39
|
+
* Falls back to a full redirect when the popup is blocked.
|
|
40
|
+
*
|
|
41
|
+
* @param redirect Relative store path to land on after bind (e.g. "/checkout?id=..").
|
|
42
|
+
*/
|
|
43
|
+
startMilesSmilesBind(redirect?: string | null): Promise<MilesSmilesBindResult>;
|
|
44
|
+
/** Durable Miles&Smiles link for the logged-in customer, or null when not linked. */
|
|
45
|
+
getMilesSmilesLink(): Promise<APIResponse<ExternalAccountLink | null>>;
|
|
46
|
+
/** Removes the Miles&Smiles link and the server-side checkout session token. */
|
|
47
|
+
unlinkMilesSmiles(): Promise<APIResponse<boolean>>;
|
|
48
|
+
createRefundRequest(order: IkasOrder, params?: {
|
|
49
|
+
email?: string | null;
|
|
50
|
+
}): Promise<IkasRefundRequestResult>;
|
|
51
|
+
refundOrder(order: IkasOrder, email?: string | null): Promise<{
|
|
52
|
+
isSuccess: boolean;
|
|
53
|
+
errorCode: IkasRefundRequestError | undefined;
|
|
54
|
+
}>;
|
|
30
55
|
/**
|
|
31
56
|
* @deprecated Use customerLogin instead.
|
|
32
57
|
*/
|
|
@@ -105,7 +130,7 @@ export declare class IkasCustomerStore {
|
|
|
105
130
|
createEmailSubscription: (email: string) => Promise<boolean>;
|
|
106
131
|
saveCustomerFormData: (input: SaveCustomerFormDataInput) => Promise<boolean>;
|
|
107
132
|
sendReview: (input: IkasCustomerReviewForm) => Promise<import("../../models/data").IkasCustomerReview | null | undefined>;
|
|
108
|
-
deactivateCustomer: (password?: string) => Promise<APIResponse<
|
|
133
|
+
deactivateCustomer: (password?: string) => Promise<APIResponse<boolean> | APIResponse<undefined> | undefined>;
|
|
109
134
|
exportCustomerPersonalData: () => Promise<APIResponse<undefined> | APIResponse<string> | undefined>;
|
|
110
135
|
onCustomerConsentGrant: () => void;
|
|
111
136
|
waitUntilInitialized: () => Promise<unknown>;
|
|
@@ -120,6 +145,7 @@ export declare class IkasCustomerStore {
|
|
|
120
145
|
formattedAmount: string;
|
|
121
146
|
}>;
|
|
122
147
|
private init;
|
|
148
|
+
private attachRefundableLines;
|
|
123
149
|
private getOrderRefundSettings;
|
|
124
150
|
private routeChangeInit;
|
|
125
151
|
private getCustomer;
|
|
@@ -144,6 +170,16 @@ export declare class IkasCustomerStore {
|
|
|
144
170
|
private setCaptchaToken;
|
|
145
171
|
private getCaptcha;
|
|
146
172
|
}
|
|
173
|
+
export { IkasRefundRequestError };
|
|
174
|
+
export declare type IkasRefundNotAllowedLine = {
|
|
175
|
+
orderLineItemId: string;
|
|
176
|
+
reason: string;
|
|
177
|
+
};
|
|
178
|
+
export declare type IkasRefundRequestResult = {
|
|
179
|
+
isSuccess: boolean;
|
|
180
|
+
errorCode?: IkasRefundRequestError;
|
|
181
|
+
lines?: IkasRefundNotAllowedLine[];
|
|
182
|
+
};
|
|
147
183
|
export declare type IkasCustomerReviewForm = {
|
|
148
184
|
comment?: string;
|
|
149
185
|
productId: string;
|