@ikas/storefront 2.0.32 → 2.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_virtual/index.js_commonjs-proxy3.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy4.js +1 -1
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/ikas.js +1 -1
- package/build/api/brand/index.js +1 -1
- package/build/api/category/index.js +1 -1
- package/build/api/checkout/index.js +1 -1
- package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +1 -1
- package/build/api/customer/index.js +1 -1
- package/build/api/customer-review/index.js +1 -1
- package/build/api/customer-review-summary/__generated__/listCustomerReviewSummary.d.ts +56 -0
- package/build/api/customer-review-summary/index.d.ts +22 -0
- package/build/api/customer-review-summary/index.js +1 -0
- package/build/api/favorite-product/index.js +1 -1
- package/build/api/html-meta-data/index.js +1 -1
- package/build/api/index.d.ts +1 -0
- package/build/api/merchant/index.js +1 -1
- package/build/api/product-search/index.js +1 -1
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/ikas.js +7 -7
- package/build/index.js +1 -1
- package/build/models/data/customer-review-summary/index.d.ts +16 -0
- package/build/models/data/customer-review-summary/index.js +1 -0
- package/build/models/data/index.d.ts +1 -0
- package/build/models/data/product/variant/index.js +1 -1
- package/build/models/data/storefront/theme-localization/index.js +1 -1
- package/build/models/theme/page/component/prop-value/product-list.js +1 -1
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/blog-list/index.js +1 -1
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/index.js +1 -1
- package/build/models/ui/customer-review-summary-list/index.d.ts +43 -0
- package/build/models/ui/customer-review-summary-list/index.js +1 -0
- package/build/models/ui/index.d.ts +1 -0
- package/build/models/ui/product-detail/index.d.ts +2 -1
- package/build/models/ui/product-detail/index.js +1 -1
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/index.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/pages/404.js +1 -1
- package/build/pages/_slug_/index.js +1 -1
- package/build/pages/account/addresses.js +1 -1
- package/build/pages/account/favorite-products.js +1 -1
- package/build/pages/account/forgot-password.js +1 -1
- package/build/pages/account/index.js +1 -1
- package/build/pages/account/login.js +1 -1
- package/build/pages/account/orders/_id_.js +1 -1
- package/build/pages/account/orders/index.js +1 -1
- package/build/pages/account/raffles.js +1 -1
- package/build/pages/account/recover-password.js +1 -1
- package/build/pages/account/register.js +1 -1
- package/build/pages/blog/_slug_.js +1 -1
- package/build/pages/blog/index.js +1 -1
- package/build/pages/cart.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/pages/home.js +1 -1
- package/build/pages/pages/_slug_.js +1 -1
- package/build/pages/raffle/_slug_.js +1 -1
- package/build/pages/raffle/index.js +1 -1
- package/build/pages/search.js +1 -1
- package/build/providers/helpers/raffles.js +1 -1
- package/build/providers/page-data-get.js +1 -1
- package/build/providers/page-data-init.js +1 -1
- package/build/providers/page-data-next.js +1 -1
- package/build/providers/placeholders.js +1 -1
- package/build/providers/prop-value/attribute-list.js +1 -1
- package/build/providers/prop-value/attribute.js +1 -1
- package/build/providers/prop-value/blog-category-list.js +1 -1
- package/build/providers/prop-value/blog-category.js +1 -1
- package/build/providers/prop-value/blog-list.js +1 -1
- package/build/providers/prop-value/blog.js +1 -1
- package/build/providers/prop-value/brand-list.js +1 -1
- package/build/providers/prop-value/brand.js +1 -1
- package/build/providers/prop-value/category-list.js +1 -1
- package/build/providers/prop-value/category.js +1 -1
- package/build/providers/prop-value/custom.js +1 -1
- package/build/providers/prop-value/image-list.js +1 -1
- package/build/providers/prop-value/image.js +1 -1
- package/build/providers/prop-value/link.js +1 -1
- package/build/providers/prop-value/product-detail.js +1 -1
- package/build/providers/prop-value/product-list.js +1 -1
- package/build/providers/prop-value/raffle-list.js +1 -1
- package/build/providers/prop-value/raffle.js +1 -1
- package/build/scripts/generators/types/index.js +1 -1
- package/build/store/base.js +1 -1
- package/build/store/cart.js +1 -1
- package/build/store/customer.js +1 -1
- package/package.json +1 -1
|
@@ -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"../../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"mobx";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 c}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/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as u}from"../../storefront/index.js";var m,l,p,g,f,y,h,v,N,I,b,k,x,L,$,S,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,c,u,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 }\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 }\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 c=e.sent(),u=c.data,(l=c.errors)&&l.length&&console.log(l),u&&u.customerLogin?[2,t(t({},u.customerLogin),{customer:new s(u.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,c,u;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 }\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 }\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,(c=o.errors)&&c.length&&console.log(c),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,c,m,l){return n(this,void 0,void 0,(function(){var n,g,f,y,h;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 ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 }\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 ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 }\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:c,lastName:m,isAcceptMarketing:l,locale:u.getCurrentLocale()}})];case 2:return g=e.sent(),f=g.data,(y=g.errors)&&y.length&&console.log(y),f&&f.registerCustomer?[2,t(t({},f.registerCustomer),{customer:new s(f.registerCustomer.customer)})]:[3,4];case 3:return h=e.sent(),console.log(h),[3,4];case 4:return[2]}}))}))},C.refreshToken=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(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 c=e.sent(),console.log(c),[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:u.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,c,u;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(),(c=d.errors)&&c.length?(console.log(c),[2,!1]):[3,4];case 3:return u=e.sent(),console.log(u),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=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(h||(h=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 c=e.sent(),console.log(c),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=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 }\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 }\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 c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=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 accountStatus\n email\n firstName\n customerGroupIds\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 accountStatus\n email\n firstName\n customerGroupIds\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}}})];case 2:return o=e.sent(),d=o.data,(c=o.errors)&&c.length&&console.log(c),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=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,(c=s.errors)&&c.length&&console.log(c),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=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 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 c(n)}))];case 3:return u=e.sent(),console.log(u),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=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,(c=s.errors)&&c.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return u=e.sent(),console.log(u),[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(x||(x=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,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=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,(c=o.errors)&&c.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return u=e.sent(),console.log(u),[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($||($=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,c;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=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:u.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 c=e.sent(),console.log(c),[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 c}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/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 u}from"../../storefront/index.js";var m,l,p,g,f,y,h,v,N,I,b,k,x,L,$,S,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,c,u,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 }\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 }\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 c=e.sent(),u=c.data,(l=c.errors)&&l.length&&console.log(l),u&&u.customerLogin?[2,t(t({},u.customerLogin),{customer:new s(u.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,c,u;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 }\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 }\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,(c=o.errors)&&c.length&&console.log(c),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,c,m,l){return n(this,void 0,void 0,(function(){var n,g,f,y,h;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 ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 }\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 ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 }\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:c,lastName:m,isAcceptMarketing:l,locale:u.getCurrentLocale()}})];case 2:return g=e.sent(),f=g.data,(y=g.errors)&&y.length&&console.log(y),f&&f.registerCustomer?[2,t(t({},f.registerCustomer),{customer:new s(f.registerCustomer.customer)})]:[3,4];case 3:return h=e.sent(),console.log(h),[3,4];case 4:return[2]}}))}))},C.refreshToken=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(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 c=e.sent(),console.log(c),[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:u.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,c,u;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(),(c=d.errors)&&c.length?(console.log(c),[2,!1]):[3,4];case 3:return u=e.sent(),console.log(u),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=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(h||(h=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 c=e.sent(),console.log(c),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=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 }\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 }\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 c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=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 accountStatus\n email\n firstName\n customerGroupIds\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 accountStatus\n email\n firstName\n customerGroupIds\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}}})];case 2:return o=e.sent(),d=o.data,(c=o.errors)&&c.length&&console.log(c),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=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,(c=s.errors)&&c.length&&console.log(c),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=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 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 c(n)}))];case 3:return u=e.sent(),console.log(u),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=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,(c=s.errors)&&c.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return u=e.sent(),console.log(u),[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(x||(x=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,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=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,(c=o.errors)&&c.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return u=e.sent(),console.log(u),[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($||($=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,c;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=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:u.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 c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__makeTemplateObject as i,__assign as o}from'../../ext/tslib/tslib.es6.js';import n from'../../ext/graphql-tag/src/index.js';import{apollo as r}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"../../models/data/customer/index.js";import{IkasCustomerReview as s}from"../../models/data/customer-review/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as e,__makeTemplateObject as i,__assign as o}from'../../ext/tslib/tslib.es6.js';import n from'../../ext/graphql-tag/src/index.js';import{apollo as r}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"../../models/data/customer/index.js";import{IkasCustomerReview as s}from"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var a,d,m=function(){function m(){}return m.listCustomerReviews=function(o){return t(this,void 0,void 0,(function(){var t,d,m,u,l;return e(this,(function(e){switch(e.label){case 0:t=n(a||(a=i(["\n query listCustomerReviews(\n $input: ListCustomerReviewInput!\n $productId: String\n $pagination: PaginationInput\n ) {\n listCustomerReviews(\n input: $input\n productId: $productId\n pagination: $pagination\n ) {\n count\n data {\n comment\n createdAt\n id\n star\n title\n imageIds\n }\n hasNext\n limit\n page\n }\n }\n "],["\n query listCustomerReviews(\n $input: ListCustomerReviewInput!\n $productId: String\n $pagination: PaginationInput\n ) {\n listCustomerReviews(\n input: $input\n productId: $productId\n pagination: $pagination\n ) {\n count\n data {\n comment\n createdAt\n id\n star\n title\n imageIds\n }\n hasNext\n limit\n page\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().query({query:t,variables:{input:{salesChannelId:o.salesChannelId},productId:o.productId,pagination:{page:o.page,limit:o.limit}}})];case 2:return d=e.sent(),m=d.data,(u=d.errors)&&u.length?[2,{data:[],count:0}]:[2,{data:m.listCustomerReviews.data.map((function(t){return new s(t)})),count:m.listCustomerReviews.count}];case 3:return l=e.sent(),console.log(l),[2,{data:[],count:0}];case 4:return[2]}}))}))},m.createCustomerReview=function(s){return t(this,void 0,void 0,(function(){var t,a,m,u,l;return e(this,(function(e){switch(e.label){case 0:t=n(d||(d=i(["\n mutation createCustomerReview($input: CreateCustomerReviewInput!) {\n createCustomerReview(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerReview($input: CreateCustomerReviewInput!) {\n createCustomerReview(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().mutate({mutation:t,variables:{input:o({},s)}})];case 2:return a=e.sent(),m=a.data,(u=a.errors)&&u.length?[2,!1]:[2,null==m?void 0:m.createCustomerReview];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},m}();export{m as IkasCustomerReviewAPI};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PaginationInput, StringFilterInput } from "./../../../__generated__/global-types";
|
|
2
|
+
export interface listCustomerReviewSummary_listCustomerReviewSummary_data_stars {
|
|
3
|
+
__typename: "CustomerReviewSummaryStar";
|
|
4
|
+
count: number;
|
|
5
|
+
star: number;
|
|
6
|
+
}
|
|
7
|
+
export interface listCustomerReviewSummary_listCustomerReviewSummary_data {
|
|
8
|
+
__typename: "CustomerReviewSummary";
|
|
9
|
+
averageStar: number;
|
|
10
|
+
createdAt: any | null;
|
|
11
|
+
deleted: boolean | null;
|
|
12
|
+
id: string;
|
|
13
|
+
productId: string;
|
|
14
|
+
stars: listCustomerReviewSummary_listCustomerReviewSummary_data_stars[];
|
|
15
|
+
totalReview: number;
|
|
16
|
+
updatedAt: any | null;
|
|
17
|
+
}
|
|
18
|
+
export interface listCustomerReviewSummary_listCustomerReviewSummary {
|
|
19
|
+
__typename: "CustomerReviewSummaryPaginationResponse";
|
|
20
|
+
/**
|
|
21
|
+
* Returns the first three records of each page in the records returned as a response.
|
|
22
|
+
* For example, **let's say page = 3, limit = 30, count = 3.**
|
|
23
|
+
* The records that will return as a response are the records **between 60-62.**
|
|
24
|
+
*/
|
|
25
|
+
count: number;
|
|
26
|
+
data: listCustomerReviewSummary_listCustomerReviewSummary_data[];
|
|
27
|
+
/**
|
|
28
|
+
* In the records returned as Response, it shows whether there are any more records or not. For example, let's say our page field is three and our limit field is thirty. Records between 60 and 90 will be returned. If hasNext is `true` despite these records, **it means there are more records.** If hasNext is `false`, it means there are a total of **90 records.**
|
|
29
|
+
*/
|
|
30
|
+
hasNext: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The maximum number of data you want to see on a page in the records returned as a response.
|
|
33
|
+
* For example, if the limit is **20**, the data will be displayed ** as 20 each. **
|
|
34
|
+
* :::note
|
|
35
|
+
* min 1, max 200 values can be given. If no value is entered, default 50 is accepted.
|
|
36
|
+
* :::
|
|
37
|
+
*/
|
|
38
|
+
limit: number;
|
|
39
|
+
/**
|
|
40
|
+
* The number of the page you want to see in the records that return as response.
|
|
41
|
+
* For example: We entered the page field as **3**.And let our limit field be **30**.
|
|
42
|
+
* The records that will return as a response are the records **between 60-90.**
|
|
43
|
+
* :::note
|
|
44
|
+
* If no value is entered, default 1 is accepted.
|
|
45
|
+
* :::
|
|
46
|
+
*/
|
|
47
|
+
page: number;
|
|
48
|
+
}
|
|
49
|
+
export interface listCustomerReviewSummary {
|
|
50
|
+
listCustomerReviewSummary: listCustomerReviewSummary_listCustomerReviewSummary;
|
|
51
|
+
}
|
|
52
|
+
export interface listCustomerReviewSummaryVariables {
|
|
53
|
+
includeDeleted?: boolean | null;
|
|
54
|
+
pagination?: PaginationInput | null;
|
|
55
|
+
productId?: StringFilterInput | null;
|
|
56
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IkasCustomerReviewSummary } from "src/models";
|
|
2
|
+
export declare class IkasCustomerReviewSummaryAPI {
|
|
3
|
+
static listCustomerReviewSummary(params: ListCustomerReviewSummaryInput): Promise<{
|
|
4
|
+
data: IkasCustomerReviewSummary[];
|
|
5
|
+
count: number;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
declare type ListCustomerReviewSummaryInput = {
|
|
9
|
+
includeDeleted?: boolean;
|
|
10
|
+
productId?: StringFilterInput;
|
|
11
|
+
pagination?: PaginationInput;
|
|
12
|
+
};
|
|
13
|
+
declare type StringFilterInput = {
|
|
14
|
+
eq?: string;
|
|
15
|
+
in?: string[];
|
|
16
|
+
like?: string;
|
|
17
|
+
};
|
|
18
|
+
declare type PaginationInput = {
|
|
19
|
+
limit: number;
|
|
20
|
+
page: number;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as e,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import o from'../../ext/graphql-tag/src/index.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import{IkasCustomerReviewSummary as d}from"../../models/data/customer-review-summary/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"mobx";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{apollo as r}from"../apollo.js";var n,a=function(){function a(){}return a.listCustomerReviewSummary=function(a){var s,m;return t(this,void 0,void 0,(function(){var t,l,u,p,c;return e(this,(function(e){switch(e.label){case 0:t=o(n||(n=i(["\n query listCustomerReviewSummary(\n $includeDeleted: Boolean\n $pagination: PaginationInput\n $productId: StringFilterInput\n ) {\n listCustomerReviewSummary(\n includeDeleted: $includeDeleted\n pagination: $pagination\n productId: $productId\n ) {\n count\n data {\n averageStar\n createdAt\n deleted\n id\n productId\n stars {\n count\n star\n }\n totalReview\n updatedAt\n }\n hasNext\n limit\n page\n }\n }\n "],["\n query listCustomerReviewSummary(\n $includeDeleted: Boolean\n $pagination: PaginationInput\n $productId: StringFilterInput\n ) {\n listCustomerReviewSummary(\n includeDeleted: $includeDeleted\n pagination: $pagination\n productId: $productId\n ) {\n count\n data {\n averageStar\n createdAt\n deleted\n id\n productId\n stars {\n count\n star\n }\n totalReview\n updatedAt\n }\n hasNext\n limit\n page\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().query({query:t,variables:{includeDeleted:a.includeDeleted,productId:a.productId,pagination:a.pagination?{page:null===(s=a.pagination)||void 0===s?void 0:s.page,limit:null===(m=a.pagination)||void 0===m?void 0:m.limit}:void 0}})];case 2:return l=e.sent(),u=l.data,(p=l.errors)&&p.length?[2,{data:[],count:0}]:[2,{data:u.listCustomerReviewSummary.data.map((function(t){return new d(t)})),count:u.listCustomerReviewSummary.count}];case 3:return c=e.sent(),console.log(c),[2,{data:[],count:0}];case 4:return[2]}}))}))},a}();export{a as IkasCustomerReviewSummaryAPI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as o,__makeTemplateObject as e}from'../../ext/tslib/tslib.es6.js';import r 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"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as o,__makeTemplateObject as e}from'../../ext/tslib/tslib.es6.js';import r 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"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../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{IkasFavoriteProduct as d}from"../../models/data/favorite-product/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var s,a,n,m=function(){function m(){}return m.listFavoriteProducts=function(){return t(this,void 0,void 0,(function(){var t,a,n,m,u;return o(this,(function(o){switch(o.label){case 0:t=r(s||(s=e(["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "],["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "]))),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,i.getClient().query({query:t})];case 2:return a=o.sent(),n=a.data,(m=a.errors)&&m.length?[2,[]]:[2,n.listFavoriteProducts.map((function(t){return new d(t)}))];case 3:return u=o.sent(),console.log(u),[3,4];case 4:return[2,[]]}}))}))},m.isFavoriteProduct=function(d){return t(this,void 0,void 0,(function(){var t,s,n,m,u;return o(this,(function(o){switch(o.label){case 0:t=r(a||(a=e(["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "],["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "]))),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,i.getClient().query({query:t,variables:{productId:d}})];case 2:return s=o.sent(),n=s.data,(m=s.errors)&&m.length?[2,!1]:[2,n.isFavoriteProduct];case 3:return u=o.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},m.saveFavoriteProduct=function(d,s){return t(this,void 0,void 0,(function(){var t,a,m,u,l;return o(this,(function(o){switch(o.label){case 0:t=r(n||(n=e(["\n mutation saveFavoriteProduct($isFavorite: Boolean!, $productId: String!) {\n saveFavoriteProduct(isFavorite: $isFavorite, productId: $productId)\n }\n "],["\n mutation saveFavoriteProduct($isFavorite: Boolean!, $productId: String!) {\n saveFavoriteProduct(isFavorite: $isFavorite, productId: $productId)\n }\n "]))),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:t,variables:{isFavorite:d,productId:s}})];case 2:return a=o.sent(),m=a.data,(u=a.errors)&&u.length?[2,!1]:[2,(null==m?void 0:m.saveFavoriteProduct)||!0];case 3:return l=o.sent(),console.log(l),[3,4];case 4:return[2,!1]}}))}))},m}();export{m as IkasFavoriteProductAPI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import o from'../../ext/graphql-tag/src/index.js';import{apollo as r}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"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import{IkasHTMLMetaData as a}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as e,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import o from'../../ext/graphql-tag/src/index.js';import{apollo as r}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"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import{IkasHTMLMetaData as a}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var n,d=function(){function d(){}return d.listHTMLMetaData=function(d,s,m,l,p){return void 0===l&&(l=1),void 0===p&&(p=200),t(this,void 0,void 0,(function(){var t,u,g,c,j;return e(this,(function(e){switch(e.label){case 0:t=o(n||(n=i(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n $pagination: PaginationInput\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n pagination: $pagination\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n }\n "],["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n $pagination: PaginationInput\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n pagination: $pagination\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().query({query:t,variables:{slug:d?{eq:d}:void 0,targetId:s?{in:s}:void 0,targetType:m?{in:m}:void 0,pagination:{page:l,limit:p}}})];case 2:return u=e.sent(),g=u.data,(c=u.errors)&&c.length?[2,[]]:[2,g.listHTMLMetaData.map((function(t){return new a(t)}))];case 3:return j=e.sent(),console.log(j),[2,[]];case 4:return[2]}}))}))},d}();export{d as IkasHTMLMetaDataAPI};
|
package/build/api/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { IkasCityAPI } from "./city";
|
|
|
7
7
|
export { IkasCountryAPI } from "./country";
|
|
8
8
|
export { IkasCustomerAPI } from "./customer";
|
|
9
9
|
export { IkasCustomerReviewAPI } from "./customer-review";
|
|
10
|
+
export { IkasCustomerReviewSummaryAPI } from "./customer-review-summary";
|
|
10
11
|
export { IkasDistrictAPI } from "./district";
|
|
11
12
|
export { IkasHTMLMetaDataAPI } from "./html-meta-data";
|
|
12
13
|
export { IkasMerchantAPI } from "./merchant";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__makeTemplateObject as o}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as r}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"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasMerchantSettings as s}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as e,__makeTemplateObject as o}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as r}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"../../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{IkasMerchantSettings as s}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var d,m=function(){function m(){}return m.listMerchantSettings=function(){return t(this,void 0,void 0,(function(){var t,m,a,n;return e(this,(function(e){switch(e.label){case 0:t=i(d||(d=o(["\n query listMerchantSettings {\n listMerchantSettings {\n id\n logoId\n merchantName\n }\n }\n "],["\n query listMerchantSettings {\n listMerchantSettings {\n id\n logoId\n merchantName\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().query({query:t})];case 2:return m=e.sent(),a=m.data,(n=m.errors)&&n.length||!a||!a.listMerchantSettings.length?[2]:[2,new s(a.listMerchantSettings[0])];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},m}();export{m as IkasMerchantAPI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as n,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import r from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as d,IkasCategoryPath as s,IkasFilterCategory as l}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import{IkasHTMLMetaData as u}from"../../models/data/html-meta-data/index.js";import{IkasImage as c}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"mobx";import"../product-option-file/index.js";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductVariantType as p}from"../../models/data/product/variant-type/index.js";import{IkasProductVariant as v}from"../../models/data/product/variant/index.js";import{IkasProductPrice as g}from"../../models/data/product/variant/price/index.js";import{IkasProductAttribute as y}from"../../models/data/product-attribute/index.js";import{IkasProductAttributeValue as f}from"../../models/data/product/attribute-value/index.js";import{IkasProductFilter as I,IkasApplicableProductFilterValue as b,IkasProductFilterSettings as h}from"../../models/data/product-filter/index.js";import{IkasVariantType as j}from"../../models/data/variant-type/index.js";import{IkasVariantValue as x}from"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasThemeStockPreference as $}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasProductTag as C}from"../../models/data/product-tag/index.js";import{IkasStorefrontConfig as w}from"../../storefront/index.js";import{IkasProductAttributeTableTemplate as S}from"../../models/data/product-attribute/product-attribute-table-template/index.js";var T,A,P,D=function(){function a(){}return a.searchProducts=function(a,d){var s;return void 0===d&&(d=!1),t(this,void 0,void 0,(function(){var t,l,u,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(T||(T=i(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "],["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{input:n(n({},a),{showStockOption:d?w.stockPreference:$.SHOW_ALL,locale:w.getCurrentLocale(),dynamicCurrencySettings:(null===(s=w.getCurrentRouting())||void 0===s?void 0:s.dynamicCurrencySettings)||null})}})];case 1:return l=e.sent(),u=l.data,(c=l.errors)&&c.length?(console.log(c),[2]):[2,n(n({},u.searchProducts),{data:u.searchProducts.data.map((function(t){return L(t)}))})];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},a.getProductFilterData=function(a){return t(this,void 0,void 0,(function(){var t,d,s,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(A||(A=i(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{categoryId:a||null,locale:w.getCurrentLocale()}})];case 1:return d=e.sent(),s=d.data,(u=d.errors)&&u.length?(console.log(u),[2]):[2,{filters:s.getProductFilterData.filters.map((function(t){var e;return new I(n(n({},t),{displayType:t.displayType,type:t.type,values:null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new b(t)})),settings:t.settings?new h(n(n({},t.settings),{sortType:t.settings.sortType})):null}))})),categories:s.getProductFilterData.categories?s.getProductFilterData.categories.map((function(t){var e;return new l({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})):null}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a.getRelatedProducts=function(a){var d;return t(this,void 0,void 0,(function(){var t,s,l,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(P||(P=i(["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "],["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "]))),[4,o.getClient().query({query:t,variables:n(n({},a),{limit:a.limit?a.limit:20,tagIds:a.tagIds?a.tagIds:null,dynamicCurrencySettings:(null===(d=w.getCurrentRouting())||void 0===d?void 0:d.dynamicCurrencySettings)||null})})];case 1:return s=e.sent(),l=s.data,(u=s.errors)&&u.length?(console.log(u),[2]):[2,{data:l.getRelatedProducts.map((function(t){return L(t)})),count:l.getRelatedProducts.length,facets:null,limit:20,page:1,totalCount:l.getRelatedProducts.length}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a}();function L(t){var e,n,i,r,o,l,I="local"===process.env.NEXT_PUBLIC_ENV;return new m({id:t.id,attributes:null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),brand:new a({id:null===(n=t.brand)||void 0===n?void 0:n.id,name:null===(i=t.brand)||void 0===i?void 0:i.name,metaData:new u({slug:(null===(r=t.brand)||void 0===r?void 0:r.slug)||""})}),categories:null===(o=t.categories)||void 0===o?void 0:o.map((function(t){return new d({id:t.id,name:t.name,path:t.path.map((function(t){return new s(t)})),metaData:new u({slug:t.slug||""})})})),tags:null===(l=t.tags)||void 0===l?void 0:l.map((function(t){return new C({id:t.id,name:t.name})})),description:t.description||void 0,metaData:new u(t.metaData||void 0),name:t.name,shortDescription:t.shortDescription||void 0,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return new p({variantType:new j({id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return new x({id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id})})).filter((function(e){return t.variantValueIds.includes(e.id)}))}),variantValueIds:t.variantValueIds})})),variants:t.variants.map((function(e){var n,i,r,o;return new v({id:e.id,productId:t.id,attributes:null===(n=e.attributes)||void 0===n?void 0:n.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),sku:e.sku,barcodeList:e.barcodeList||void 0,images:null===(i=e.images)||void 0===i?void 0:i.map((function(t){return new c(t.id)})),price:new g(null===(r=e.prices)||void 0===r?void 0:r.find((function(t){return w.priceListId?t.priceListId===w.priceListId:null===t.priceListId}))),stock:e.stocks.filter((function(t){var e;return I||w.isEditor||(null===(e=w.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0)||0,variantValues:null===(o=e.variantValues)||void 0===o?void 0:o.map((function(e){var n=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),i=null==n?void 0:n.variantType.values.find((function(t){return t.id===e.variantValueId}));return new x({id:e.variantValueId,name:null==i?void 0:i.name,colorCode:null==i?void 0:i.colorCode,thumbnailImageId:null==i?void 0:i.thumbnailImageId,variantTypeId:null==n?void 0:n.variantType.id})})),isActive:e.isActive})}))})}export{D as IkasProductSearchAPI};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as n,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import r from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as d,IkasCategoryPath as s,IkasFilterCategory as l}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import{IkasHTMLMetaData as u}from"../../models/data/html-meta-data/index.js";import{IkasImage as c}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductVariantType as p}from"../../models/data/product/variant-type/index.js";import{IkasProductVariant as v}from"../../models/data/product/variant/index.js";import{IkasProductPrice as g}from"../../models/data/product/variant/price/index.js";import{IkasProductAttribute as y}from"../../models/data/product-attribute/index.js";import{IkasProductAttributeValue as f}from"../../models/data/product/attribute-value/index.js";import{IkasProductFilter as I,IkasApplicableProductFilterValue as b,IkasProductFilterSettings as j}from"../../models/data/product-filter/index.js";import{IkasVariantType as h}from"../../models/data/variant-type/index.js";import{IkasVariantValue as x}from"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasThemeStockPreference as $}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasProductTag as C}from"../../models/data/product-tag/index.js";import{IkasStorefrontConfig as w}from"../../storefront/index.js";import{IkasProductAttributeTableTemplate as S}from"../../models/data/product-attribute/product-attribute-table-template/index.js";var T,A,P,D=function(){function a(){}return a.searchProducts=function(a,d){var s;return void 0===d&&(d=!1),t(this,void 0,void 0,(function(){var t,l,u,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(T||(T=i(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "],["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{input:n(n({},a),{showStockOption:d?w.stockPreference:$.SHOW_ALL,locale:w.getCurrentLocale(),dynamicCurrencySettings:(null===(s=w.getCurrentRouting())||void 0===s?void 0:s.dynamicCurrencySettings)||null})}})];case 1:return l=e.sent(),u=l.data,(c=l.errors)&&c.length?(console.log(c),[2]):[2,n(n({},u.searchProducts),{data:u.searchProducts.data.map((function(t){return L(t)}))})];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},a.getProductFilterData=function(a){return t(this,void 0,void 0,(function(){var t,d,s,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(A||(A=i(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{categoryId:a||null,locale:w.getCurrentLocale()}})];case 1:return d=e.sent(),s=d.data,(u=d.errors)&&u.length?(console.log(u),[2]):[2,{filters:s.getProductFilterData.filters.map((function(t){var e;return new I(n(n({},t),{displayType:t.displayType,type:t.type,values:null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new b(t)})),settings:t.settings?new j(n(n({},t.settings),{sortType:t.settings.sortType})):null}))})),categories:s.getProductFilterData.categories?s.getProductFilterData.categories.map((function(t){var e;return new l({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})):null}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a.getRelatedProducts=function(a){var d;return t(this,void 0,void 0,(function(){var t,s,l,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(P||(P=i(["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "],["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "]))),[4,o.getClient().query({query:t,variables:n(n({},a),{limit:a.limit?a.limit:20,tagIds:a.tagIds?a.tagIds:null,dynamicCurrencySettings:(null===(d=w.getCurrentRouting())||void 0===d?void 0:d.dynamicCurrencySettings)||null})})];case 1:return s=e.sent(),l=s.data,(u=s.errors)&&u.length?(console.log(u),[2]):[2,{data:l.getRelatedProducts.map((function(t){return L(t)})),count:l.getRelatedProducts.length,facets:null,limit:20,page:1,totalCount:l.getRelatedProducts.length}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a}();function L(t){var e,n,i,r,o,l,I="local"===process.env.NEXT_PUBLIC_ENV;return new m({id:t.id,attributes:null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),brand:new a({id:null===(n=t.brand)||void 0===n?void 0:n.id,name:null===(i=t.brand)||void 0===i?void 0:i.name,metaData:new u({slug:(null===(r=t.brand)||void 0===r?void 0:r.slug)||""})}),categories:null===(o=t.categories)||void 0===o?void 0:o.map((function(t){return new d({id:t.id,name:t.name,path:t.path.map((function(t){return new s(t)})),metaData:new u({slug:t.slug||""})})})),tags:null===(l=t.tags)||void 0===l?void 0:l.map((function(t){return new C({id:t.id,name:t.name})})),description:t.description||void 0,metaData:new u(t.metaData||void 0),name:t.name,shortDescription:t.shortDescription||void 0,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return new p({variantType:new h({id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return new x({id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id})})).filter((function(e){return t.variantValueIds.includes(e.id)}))}),variantValueIds:t.variantValueIds})})),variants:t.variants.map((function(e){var n,i,r,o;return new v({id:e.id,productId:t.id,attributes:null===(n=e.attributes)||void 0===n?void 0:n.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),sku:e.sku,barcodeList:e.barcodeList||void 0,images:null===(i=e.images)||void 0===i?void 0:i.map((function(t){return new c(t.id)})),price:new g(null===(r=e.prices)||void 0===r?void 0:r.find((function(t){return w.priceListId?t.priceListId===w.priceListId:null===t.priceListId}))),stock:e.stocks.filter((function(t){var e;return I||w.isEditor||(null===(e=w.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0)||0,variantValues:null===(o=e.variantValues)||void 0===o?void 0:o.map((function(e){var n=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),i=null==n?void 0:n.variantType.values.find((function(t){return t.id===e.variantValueId}));return new x({id:e.variantValueId,name:null==i?void 0:i.name,colorCode:null==i?void 0:i.colorCode,thumbnailImageId:null==i?void 0:i.thumbnailImageId,variantTypeId:null==n?void 0:n.variantType.id})})),isActive:e.isActive})}))})}export{D as IkasProductSearchAPI};
|