@ikas/storefront 2.0.51-alpha.1 → 2.0.51
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'../ext/
|
|
1
|
+
import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as n,__generator as e,__assign as t,__makeTemplateObject as r}from'../../ext/tslib/tslib.es6.js';import a from'../../ext/graphql-tag/src/index.js';import{apollo as i}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import{IkasCustomer as s}from"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderRefundSettings as d}from"../../models/data/order/refund/settings.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import{IkasOrderTransaction as u}from"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";var m,l,p,g,f,y,b,I,h,N,v,k,L,A,x,S,$,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,u,c,l,p;return e(this,(function(e){switch(e.label){case 0:n=a(m||(m=r(["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d}})];case 2:return u=e.sent(),c=u.data,(l=u.errors)&&l.length&&console.log(l),c&&c.customerLogin?[2,t(t({},c.customerLogin),{customer:new s(c.customerLogin.customer)})]:[3,4];case 3:return p=e.sent(),console.log(p),[3,4];case 4:return[2]}}))}))},C.socialLogin=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(l||(l=r(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{code:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,u,m,l,g){return n(this,void 0,void 0,(function(){var n,f,y,b,I;return e(this,(function(e){switch(e.label){case 0:n=a(p||(p=r(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d,firstName:u,lastName:m,isAcceptMarketing:l,locale:c.getCurrentLocale(),attributes:g}})];case 2:return f=e.sent(),y=f.data,(b=f.errors)&&b.length&&console.log(b),y&&y.registerCustomer?[2,t(t({},y.registerCustomer),{customer:new s(y.registerCustomer.customer)})]:[3,4];case 3:return I=e.sent(),console.log(I),[3,4];case 4:return[2]}}))}))},C.refreshToken=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(g||(g=r(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "],["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{token:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o?[2,o.customerRefreshToken]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.forgotPassword=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d;return e(this,(function(e){switch(e.label){case 0:n=a(f||(f=r(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "],["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:t,locale:c.getCurrentLocale()}})];case 2:return s=e.sent(),(o=s.errors)&&o.length?(console.log(o),[2,!1]):[3,4];case 3:return d=e.sent(),console.log(d),[3,4];case 4:return[2,!0]}}))}))},C.recoverPassword=function(t,s,o){return n(this,void 0,void 0,(function(){var n,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(y||(y=r(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "],["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{password:t,passwordAgain:s,token:o}})];case 2:return d=e.sent(),(u=d.errors)&&u.length?(console.log(u),[2,!1]):[3,4];case 3:return c=e.sent(),console.log(c),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(b||(b=r(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "],["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o&&o.checkCustomerEmail?[2,o.checkCustomerEmail.exists]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=r(["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n})];case 2:return t=e.sent(),o=t.data,(d=t.errors)&&d.length&&console.log(d),o&&o.getMyCustomer?[2,new s(o.getMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(h||(h=r(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{firstName:t.firstName,lastName:t.lastName,addresses:t.addresses,phone:t.phone,subscriptionStatus:t.subscriptionStatus,attributes:t.attributes.map((function(n){return{value:n.value,customerAttributeId:n.customerAttributeId,customerAttributeOptionId:n.customerAttributeOptionId}}))}}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=r(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:t?{orderId:t}:{}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length&&console.log(u),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrderByEmail=function(t,s){return n(this,void 0,void 0,(function(){var n,d,u,c,m;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=r(["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t,orderNumber:s}})];case 2:return d=e.sent(),u=d.data,(c=d.errors)&&c.length&&console.log(c),u&&u.getOrderByEmail?[2,new o(u.getOrderByEmail)]:[3,4];case 3:return m=e.sent(),console.log(m),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=r(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "],["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{checkoutId:(null==t?void 0:t.checkoutId)?{eq:t.checkoutId}:void 0,id:(null==t?void 0:t.id)?{eq:t.id}:void 0,orderId:(null==t?void 0:t.orderId)?{eq:t.orderId}:void 0}})];case 2:return s=e.sent(),o=s.data,d=s.errors,Array.isArray(d)&&d.length?[2,[]]:[2,o.listOrderTransactions.map((function(n){return new u(n)}))];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=r(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.createCustomerEmailSubscription=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(A||(A=r(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{email:t}}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getLastViewedProducts=function(t){var s;return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(x||(x=r(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "],["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{customerId:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveLastViewedProducts=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=r(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "],["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getOrderRefundSettings=function(){return n(this,void 0,void 0,(function(){var n,t,s,o,u;return e(this,(function(e){switch(e.label){case 0:n=a($||($=r(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "],["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{storefrontId:{eq:c.storefrontId}}})];case 2:return t=e.sent(),s=t.data,(o=t.errors)&&o.length&&console.log(o),s&&s.listOrderRefundSettings.length?[2,new d(s.listOrderRefundSettings[0])]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
|
|
1
|
+
import{__awaiter as n,__generator as e,__assign as t,__makeTemplateObject as r}from'../../ext/tslib/tslib.es6.js';import a from'../../ext/graphql-tag/src/index.js';import{apollo as i}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import{IkasCustomer as s}from"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderRefundSettings as d}from"../../models/data/order/refund/settings.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import{IkasOrderTransaction as u}from"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";var m,l,p,g,f,y,b,I,h,N,v,k,L,A,x,S,$,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,u,c,l,p;return e(this,(function(e){switch(e.label){case 0:n=a(m||(m=r(["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d}})];case 2:return u=e.sent(),c=u.data,(l=u.errors)&&l.length&&console.log(l),c&&c.customerLogin?[2,t(t({},c.customerLogin),{customer:new s(c.customerLogin.customer)})]:[3,4];case 3:return p=e.sent(),console.log(p),[3,4];case 4:return[2]}}))}))},C.socialLogin=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(l||(l=r(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{code:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,u,m,l,g){return n(this,void 0,void 0,(function(){var n,f,y,b,I;return e(this,(function(e){switch(e.label){case 0:n=a(p||(p=r(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d,firstName:u,lastName:m,isAcceptMarketing:l,locale:c.getCurrentLocale(),attributes:g}})];case 2:return f=e.sent(),y=f.data,(b=f.errors)&&b.length&&console.log(b),y&&y.registerCustomer?[2,t(t({},y.registerCustomer),{customer:new s(y.registerCustomer.customer)})]:[3,4];case 3:return I=e.sent(),console.log(I),[3,4];case 4:return[2]}}))}))},C.refreshToken=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(g||(g=r(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "],["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{token:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o?[2,o.customerRefreshToken]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.forgotPassword=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d;return e(this,(function(e){switch(e.label){case 0:n=a(f||(f=r(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "],["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:t,locale:c.getCurrentLocale()}})];case 2:return s=e.sent(),(o=s.errors)&&o.length?(console.log(o),[2,!1]):[3,4];case 3:return d=e.sent(),console.log(d),[3,4];case 4:return[2,!0]}}))}))},C.recoverPassword=function(t,s,o){return n(this,void 0,void 0,(function(){var n,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(y||(y=r(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "],["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{password:t,passwordAgain:s,token:o}})];case 2:return d=e.sent(),(u=d.errors)&&u.length?(console.log(u),[2,!1]):[3,4];case 3:return c=e.sent(),console.log(c),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(b||(b=r(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "],["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o&&o.checkCustomerEmail?[2,o.checkCustomerEmail.exists]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=r(["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n})];case 2:return t=e.sent(),o=t.data,(d=t.errors)&&d.length&&console.log(d),o&&o.getMyCustomer?[2,new s(o.getMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(h||(h=r(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{firstName:t.firstName,lastName:t.lastName,addresses:t.addresses,phone:t.phone,subscriptionStatus:t.subscriptionStatus,attributes:t.attributes.map((function(n){return{value:n.value,customerAttributeId:n.customerAttributeId,customerAttributeOptionId:n.customerAttributeOptionId}}))}}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=r(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:t?{orderId:t}:{}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length&&console.log(u),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrderByEmail=function(t,s){return n(this,void 0,void 0,(function(){var n,d,u,c,m;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=r(["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t,orderNumber:s}})];case 2:return d=e.sent(),u=d.data,(c=d.errors)&&c.length&&console.log(c),u&&u.getOrderByEmail?[2,new o(u.getOrderByEmail)]:[3,4];case 3:return m=e.sent(),console.log(m),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=r(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "],["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{checkoutId:(null==t?void 0:t.checkoutId)?{eq:t.checkoutId}:void 0,id:(null==t?void 0:t.id)?{eq:t.id}:void 0,orderId:(null==t?void 0:t.orderId)?{eq:t.orderId}:void 0}})];case 2:return s=e.sent(),o=s.data,d=s.errors,Array.isArray(d)&&d.length?[2,[]]:[2,o.listOrderTransactions.map((function(n){return new u(n)}))];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=r(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.createCustomerEmailSubscription=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(A||(A=r(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{email:t}}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getLastViewedProducts=function(t){var s;return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(x||(x=r(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "],["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{customerId:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveLastViewedProducts=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=r(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "],["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getOrderRefundSettings=function(){return n(this,void 0,void 0,(function(){var n,t,s,o,u;return e(this,(function(e){switch(e.label){case 0:n=a($||($=r(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "],["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{storefrontId:{eq:c.storefrontId}}})];case 2:return t=e.sent(),s=t.data,(o=t.errors)&&o.length&&console.log(o),s&&s.listOrderRefundSettings.length?[2,new d(s.listOrderRefundSettings[0])]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
|