@ikas/storefront 2.0.36 → 2.0.37-alpha.4
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/__generated__/global-types.d.ts +27 -0
- package/build/__generated__/global-types.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy2.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy3.js +1 -1
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/googleAnalytics.d.ts +13 -0
- package/build/analytics/googleAnalytics.js +1 -0
- package/build/analytics/googleTagManager.d.ts +2 -0
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/googleUniversal.d.ts +8 -0
- package/build/analytics/googleUniversal.js +1 -0
- package/build/analytics/head/index.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__/customerLogin.d.ts +7 -0
- package/build/api/customer/__generated__/customerSocialLogin.d.ts +7 -0
- package/build/api/customer/__generated__/getMyCustomer.d.ts +7 -0
- package/build/api/customer/__generated__/getOrderByEmail.d.ts +615 -0
- package/build/api/customer/__generated__/registerCustomer.d.ts +9 -1
- package/build/api/customer/__generated__/saveMyCustomer.d.ts +7 -0
- package/build/api/customer/index.d.ts +3 -1
- package/build/api/customer/index.js +1 -1
- package/build/api/customer-attribute/__generated__/listCustomerAttribute.d.ts +44 -0
- package/build/api/customer-attribute/index.d.ts +4 -0
- package/build/api/customer-attribute/index.js +1 -0
- package/build/api/customer-review/index.js +1 -1
- package/build/api/customer-review-summary/index.js +1 -1
- package/build/api/favorite-product/index.js +1 -1
- package/build/api/html-meta-data/index.js +1 -1
- package/build/api/merchant/index.js +1 -1
- package/build/api/product-search/index.js +1 -1
- package/build/api/storefront/__generated__/getStorefront.d.ts +2 -0
- package/build/api/storefront/index.js +1 -1
- package/build/components/checkout/components/address-form/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/components/form-item/style.module.scss.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-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-shipping/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/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 +5 -5
- package/build/index.js +1 -1
- package/build/models/data/checkout/index.js +1 -1
- package/build/models/data/customer/attribute-value/index.d.ts +9 -0
- package/build/models/data/customer/attribute-value/index.js +1 -0
- package/build/models/data/customer/index.d.ts +2 -0
- package/build/models/data/customer/index.js +1 -1
- package/build/models/data/customer-attribute/customer-attribute-option/index.d.ts +5 -0
- package/build/models/data/customer-attribute/customer-attribute-option/index.js +1 -0
- package/build/models/data/customer-attribute/customer-attribute-sales-channel/index.d.ts +17 -0
- package/build/models/data/customer-attribute/customer-attribute-sales-channel/index.js +1 -0
- package/build/models/data/customer-attribute/index.d.ts +35 -0
- package/build/models/data/customer-attribute/index.js +1 -0
- package/build/models/data/index.d.ts +4 -0
- package/build/models/data/product/variant/index.js +1 -1
- package/build/models/data/storefront/index.d.ts +2 -0
- package/build/models/data/storefront/index.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.js +1 -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/models/ui/validator/form/raffle-form.js +1 -1
- package/build/models/ui/validator/form/register.d.ts +4 -0
- package/build/models/ui/validator/form/register.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.d.ts +2 -0
- package/build/providers/page-data-get.js +1 -1
- package/build/providers/page-data-init.js +1 -1
- package/build/providers/page-data-next.d.ts +12 -0
- 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.d.ts +4 -1
- package/build/store/customer.js +1 -1
- package/build/storefront/index.d.ts +4 -0
- package/build/storefront/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as r}from"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPaymentGateway as d}from"../../models/data/payment-gateway/index.js";import{IkasStorefrontConfig as s}from"../../storefront/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";var u,l,m,p,g,h,y,I,f,v,C=function(){function C(){}return C.getCheckoutId=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(u||(u=t(["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "],["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{cartId:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.getCheckoutByCartId.id]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getCheckoutById=function(o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(l||(l=t(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "],["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:o}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,new r(s.getCheckoutById)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrder=function(r){return n(this,void 0,void 0,(function(){var n,d,s;return e(this,(function(e){switch(e.label){case 0:n=i(m||(m=t(["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{orderId:r}})];case 2:return d=e.sent(),(s=d.data)&&s.getOrder?[2,new o(s.getOrder)]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C.saveCheckout=function(r){var o,d,s,c;return n(this,void 0,void 0,(function(){var n,u,l,m,g;return e(this,(function(e){switch(e.label){case 0:n=i(p||(p=t(["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "],["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{id:r.id,cartId:r.cartId,shippingMethod:r.shippingMethod,shippingSettingsId:r.shippingSettingsId,shippingZoneRateId:r.shippingZoneRateId,billingAddress:r.billingAddress&&r.billingAddress.addressLine1?{id:r.billingAddress.id,addressLine1:r.billingAddress.addressLine1||"",addressLine2:r.billingAddress.addressLine2||null,city:r.billingAddress.city,country:r.billingAddress.country,state:r.billingAddress.state,district:r.billingAddress.district||null,firstName:r.billingAddress.firstName,lastName:r.billingAddress.lastName,postalCode:r.billingAddress.postalCode,company:r.billingAddress.company||null,phone:r.billingAddress.phone||null,taxNumber:r.billingAddress.taxNumber||null,taxOffice:r.billingAddress.taxOffice||null,isDefault:r.billingAddress.isDefault||!1,identityNumber:r.billingAddress.identityNumber||null}:null,shippingAddress:r.shippingAddress&&r.shippingAddress.addressLine1?{id:r.shippingAddress.id,addressLine1:r.shippingAddress.addressLine1||"",addressLine2:r.shippingAddress.addressLine2||null,city:r.shippingAddress.city,country:r.shippingAddress.country,state:r.shippingAddress.state,district:r.shippingAddress.district||null,firstName:r.shippingAddress.firstName,lastName:r.shippingAddress.lastName,postalCode:r.shippingAddress.postalCode,company:r.shippingAddress.company||null,phone:r.shippingAddress.phone||null,taxNumber:r.shippingAddress.taxNumber||null,taxOffice:r.shippingAddress.taxOffice||null,isDefault:r.shippingAddress.isDefault||!1,identityNumber:r.shippingAddress.identityNumber||null}:null,couponCode:r.couponCode||null,customer:r.customer?{id:null===(o=r.customer)||void 0===o?void 0:o.id,email:null===(d=r.customer)||void 0===d?void 0:d.email,firstName:null===(s=r.customer)||void 0===s?void 0:s.firstName,lastName:null===(c=r.customer)||void 0===c?void 0:c.lastName,notificationsAccepted:r.customer.notificationsAccepted||!1}:null,note:r.note,isGiftPackage:r.isGiftPackage,giftPackageNote:r.giftPackageNote}}})];case 2:return u=e.sent(),l=u.data,m=u.errors,[2,{data:(null==l?void 0:l.saveCheckout.id)||void 0,errors:m}];case 3:return g=e.sent(),console.log(g),g&&g.graphQLErrors?[2,{data:void 0,errors:g.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C.createSaleTransactionWithCheckout=function(r,o,d){return n(this,void 0,void 0,(function(){var n,s,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(g||(g=t(["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "],["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{checkoutId:r,paymentGatewayId:o,paymentMethodDetail:d}}})];case 2:return s=e.sent(),c=s.data,(u=s.errors)&&u.length?[2]:c?[2,c.createSaleTransactionWithCheckout]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.listPaymentGateway=function(r){return n(this,void 0,void 0,(function(){var n,o,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(h||(h=t(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "],["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:r?{in:r}:void 0,locale:s.getCurrentLocale()}})];case 2:return o=e.sent(),c=o.data,(u=o.errors)&&u.length&&console.log(u),c?[2,c.listPaymentGateway.map((function(n){return new d(n)}))]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.retrieveInstallmentInfo=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(y||(y=t(["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "],["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.retrieveInstallmentInfo]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.checkStocks=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(I||(I=t(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "],["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{lines:r,stockLocationIdList:o.length?o:null}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,s.checkStocks]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.listCheckoutSettings=function(){return n(this,void 0,void 0,(function(){var n,r,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=i(f||(f=t(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "],["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{storefrontId:{eq:s.storefrontId}}})];case 2:return r=e.sent(),o=r.data,(d=r.errors)&&d.length&&console.log(d),o?[2,o.listCheckoutSettings.map((function(n){return new c(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.addCouponCodeToCheckout=function(r,o){return n(this,void 0,void 0,(function(){var n,d;return e(this,(function(e){switch(e.label){case 0:n=i(v||(v=t(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "],["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{checkoutId:r,couponCode:o}})];case 2:return(d=e.sent().data)&&d.addCouponCodeToCheckout.id?[2,!0]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCheckoutAPI};
|
|
1
|
+
import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as r}from"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPaymentGateway as d}from"../../models/data/payment-gateway/index.js";import{IkasStorefrontConfig as s}from"../../storefront/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";var u,l,m,p,g,h,y,I,f,v,C=function(){function C(){}return C.getCheckoutId=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(u||(u=t(["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "],["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{cartId:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.getCheckoutByCartId.id]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getCheckoutById=function(o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(l||(l=t(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "],["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:o}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,new r(s.getCheckoutById)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrder=function(r){return n(this,void 0,void 0,(function(){var n,d,s;return e(this,(function(e){switch(e.label){case 0:n=i(m||(m=t(["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{orderId:r}})];case 2:return d=e.sent(),(s=d.data)&&s.getOrder?[2,new o(s.getOrder)]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C.saveCheckout=function(r){var o,d,s,c;return n(this,void 0,void 0,(function(){var n,u,l,m,g;return e(this,(function(e){switch(e.label){case 0:n=i(p||(p=t(["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "],["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{id:r.id,cartId:r.cartId,shippingMethod:r.shippingMethod,shippingSettingsId:r.shippingSettingsId,shippingZoneRateId:r.shippingZoneRateId,billingAddress:r.billingAddress&&r.billingAddress.addressLine1?{id:r.billingAddress.id,addressLine1:r.billingAddress.addressLine1||"",addressLine2:r.billingAddress.addressLine2||null,city:r.billingAddress.city,country:r.billingAddress.country,state:r.billingAddress.state,district:r.billingAddress.district||null,firstName:r.billingAddress.firstName,lastName:r.billingAddress.lastName,postalCode:r.billingAddress.postalCode,company:r.billingAddress.company||null,phone:r.billingAddress.phone||null,taxNumber:r.billingAddress.taxNumber||null,taxOffice:r.billingAddress.taxOffice||null,isDefault:r.billingAddress.isDefault||!1,identityNumber:r.billingAddress.identityNumber||null}:null,shippingAddress:r.shippingAddress&&r.shippingAddress.addressLine1?{id:r.shippingAddress.id,addressLine1:r.shippingAddress.addressLine1||"",addressLine2:r.shippingAddress.addressLine2||null,city:r.shippingAddress.city,country:r.shippingAddress.country,state:r.shippingAddress.state,district:r.shippingAddress.district||null,firstName:r.shippingAddress.firstName,lastName:r.shippingAddress.lastName,postalCode:r.shippingAddress.postalCode,company:r.shippingAddress.company||null,phone:r.shippingAddress.phone||null,taxNumber:r.shippingAddress.taxNumber||null,taxOffice:r.shippingAddress.taxOffice||null,isDefault:r.shippingAddress.isDefault||!1,identityNumber:r.shippingAddress.identityNumber||null}:null,couponCode:r.couponCode||null,customer:r.customer?{id:null===(o=r.customer)||void 0===o?void 0:o.id,email:null===(d=r.customer)||void 0===d?void 0:d.email,firstName:null===(s=r.customer)||void 0===s?void 0:s.firstName,lastName:null===(c=r.customer)||void 0===c?void 0:c.lastName,notificationsAccepted:r.customer.notificationsAccepted||!1}:null,note:r.note,isGiftPackage:r.isGiftPackage,giftPackageNote:r.giftPackageNote}}})];case 2:return u=e.sent(),l=u.data,m=u.errors,[2,{data:(null==l?void 0:l.saveCheckout.id)||void 0,errors:m}];case 3:return g=e.sent(),console.log(g),g&&g.graphQLErrors?[2,{data:void 0,errors:g.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C.createSaleTransactionWithCheckout=function(r,o,d){return n(this,void 0,void 0,(function(){var n,s,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(g||(g=t(["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "],["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{checkoutId:r,paymentGatewayId:o,paymentMethodDetail:d}}})];case 2:return s=e.sent(),c=s.data,(u=s.errors)&&u.length?[2]:c?[2,c.createSaleTransactionWithCheckout]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.listPaymentGateway=function(r){return n(this,void 0,void 0,(function(){var n,o,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(h||(h=t(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "],["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:r?{in:r}:void 0,locale:s.getCurrentLocale()}})];case 2:return o=e.sent(),c=o.data,(u=o.errors)&&u.length&&console.log(u),c?[2,c.listPaymentGateway.map((function(n){return new d(n)}))]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.retrieveInstallmentInfo=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(y||(y=t(["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "],["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.retrieveInstallmentInfo]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.checkStocks=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(I||(I=t(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "],["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{lines:r,stockLocationIdList:o.length?o:null}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,s.checkStocks]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.listCheckoutSettings=function(){return n(this,void 0,void 0,(function(){var n,r,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=i(f||(f=t(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "],["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{storefrontId:{eq:s.storefrontId}}})];case 2:return r=e.sent(),o=r.data,(d=r.errors)&&d.length&&console.log(d),o?[2,o.listCheckoutSettings.map((function(n){return new c(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.addCouponCodeToCheckout=function(r,o){return n(this,void 0,void 0,(function(){var n,d;return e(this,(function(e){switch(e.label){case 0:n=i(v||(v=t(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "],["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{checkoutId:r,couponCode:o}})];case 2:return(d=e.sent().data)&&d.addCouponCodeToCheckout.id?[2,!0]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCheckoutAPI};
|
|
@@ -107,6 +107,12 @@ export interface customerLogin_customerLogin_customer_addresses {
|
|
|
107
107
|
taxOffice: string | null;
|
|
108
108
|
title: string;
|
|
109
109
|
}
|
|
110
|
+
export interface customerLogin_customerLogin_customer_attributes {
|
|
111
|
+
__typename: "CustomerAttributeValue";
|
|
112
|
+
customerAttributeId: string | null;
|
|
113
|
+
customerAttributeOptionId: string | null;
|
|
114
|
+
value: string | null;
|
|
115
|
+
}
|
|
110
116
|
export interface customerLogin_customerLogin_customer {
|
|
111
117
|
__typename: "Customer";
|
|
112
118
|
id: string;
|
|
@@ -150,6 +156,7 @@ export interface customerLogin_customerLogin_customer {
|
|
|
150
156
|
* Groups that the store owner attaches to the customer.
|
|
151
157
|
*/
|
|
152
158
|
customerGroupIds: string[] | null;
|
|
159
|
+
attributes: customerLogin_customerLogin_customer_attributes[] | null;
|
|
153
160
|
}
|
|
154
161
|
export interface customerLogin_customerLogin {
|
|
155
162
|
__typename: "CustomerLoginResponse";
|
|
@@ -107,6 +107,12 @@ export interface customerSocialLogin_customerSocialLogin_customer_addresses {
|
|
|
107
107
|
taxOffice: string | null;
|
|
108
108
|
title: string;
|
|
109
109
|
}
|
|
110
|
+
export interface customerSocialLogin_customerSocialLogin_customer_attributes {
|
|
111
|
+
__typename: "CustomerAttributeValue";
|
|
112
|
+
customerAttributeId: string | null;
|
|
113
|
+
customerAttributeOptionId: string | null;
|
|
114
|
+
value: string | null;
|
|
115
|
+
}
|
|
110
116
|
export interface customerSocialLogin_customerSocialLogin_customer {
|
|
111
117
|
__typename: "Customer";
|
|
112
118
|
id: string;
|
|
@@ -150,6 +156,7 @@ export interface customerSocialLogin_customerSocialLogin_customer {
|
|
|
150
156
|
* Groups that the store owner attaches to the customer.
|
|
151
157
|
*/
|
|
152
158
|
customerGroupIds: string[] | null;
|
|
159
|
+
attributes: customerSocialLogin_customerSocialLogin_customer_attributes[] | null;
|
|
153
160
|
}
|
|
154
161
|
export interface customerSocialLogin_customerSocialLogin {
|
|
155
162
|
__typename: "CustomerLoginResponse";
|
|
@@ -99,6 +99,12 @@ export interface getMyCustomer_getMyCustomer_addresses {
|
|
|
99
99
|
*/
|
|
100
100
|
phone: string | null;
|
|
101
101
|
}
|
|
102
|
+
export interface getMyCustomer_getMyCustomer_attributes {
|
|
103
|
+
__typename: "CustomerAttributeValue";
|
|
104
|
+
customerAttributeId: string | null;
|
|
105
|
+
customerAttributeOptionId: string | null;
|
|
106
|
+
value: string | null;
|
|
107
|
+
}
|
|
102
108
|
export interface getMyCustomer_getMyCustomer {
|
|
103
109
|
__typename: "Customer";
|
|
104
110
|
id: string;
|
|
@@ -138,6 +144,7 @@ export interface getMyCustomer_getMyCustomer {
|
|
|
138
144
|
* Groups that the store owner attaches to the customer.
|
|
139
145
|
*/
|
|
140
146
|
customerGroupIds: string[] | null;
|
|
147
|
+
attributes: getMyCustomer_getMyCustomer_attributes[] | null;
|
|
141
148
|
}
|
|
142
149
|
export interface getMyCustomer {
|
|
143
150
|
getMyCustomer: getMyCustomer_getMyCustomer;
|