@ikas/storefront-next 6.1.0-beta.380 → 6.1.0-beta.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.js";import n from"path";import{deleteDirContent as r,createFile as a}from"../../../utils/fs.js";import{PAGE_INFO as o,CHECKOUT_PAGE_CONTENT as s,EDITOR_PAGE_CONTENT as c}from"./info.js";var i=function(){function i(){}return i.generate=function(a
|
|
1
|
+
import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.js";import n from"path";import{deleteDirContent as r,createFile as a}from"../../../utils/fs.js";import{PAGE_INFO as o,CHECKOUT_PAGE_CONTENT as s,EDITOR_PAGE_CONTENT as c}from"./info.js";var i=function(){function i(){}return i.generate=function(a){return e(this,void 0,void 0,(function(){var e,s,c,p,u,f,g,m,l,h,d,P;return t(this,(function(t){switch(t.label){case 0:return e=n.join(a||process.cwd(),"src","pages"),[4,r(e,["_app.tsx","_document.tsx","api"])];case 1:t.sent(),s=!0,c=0,p=o,t.label=2;case 2:return c<p.length?(u=p[c],(f=s)?[4,i.generatePageWithInfo(u,a)]:[3,4]):[3,6];case 3:f=t.sent(),t.label=4;case 4:s=f,t.label=5;case 5:return c++,[3,2];case 6:return g=o.find((function(e){return e.isCheckout})),m=o.find((function(e){return e.isEditor})),g?[4,i.generatePageWithInfo(g,a)]:[3,8];case 7:return h=t.sent(),[3,9];case 8:h=!1,t.label=9;case 9:return l=h,m?[4,i.generatePageWithInfo(m,a)]:[3,11];case 10:return P=t.sent(),[3,12];case 11:P=!1,t.label=12;case 12:return d=P,[2,s&&l&&d]}}))}))},i.generatePageWithInfo=function(r,o){return e(this,void 0,void 0,(function(){var e,i,p,u,f,g,m,l,h;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e="",r.isCheckout?e=s:r.isEditor?e=c:(i=r.pageComponentName+"Next",p="import { ".concat(r.pageComponentName,' } from "@ikas/storefront";\r\n'),u="import { ".concat(r.pageComponentName," as ").concat(i,' } from "@ikas/storefront-next";\r\n'),f='import Components from "src/components/__generated__/pages/'.concat(r.path.replace(".tsx",""),'";\r\n'),g="\nconst PageComponent = ".concat(r.pageComponentName,".default;\n\nconst Page = (props: any) => {\n return <PageComponent components={Components} {...props} />;\n};\n\nexport default Page;\r\n"),m=r.isDynamicSSG?"export const getStaticPaths = ".concat(i,".getStaticPaths;\r\n"):"",l=r.isSSR?"export const getServerSideProps = ".concat(i,".getServerSideProps;\r\n"):"export const getStaticProps = ".concat(i,".getStaticProps;\r\n"),e=p+u+f+g+m+l),[4,a(n.join(o||process.cwd(),"src","pages"),r.path,e)];case 1:return[2,t.sent()];case 2:return h=t.sent(),console.error(h),[2,!1];case 3:return[2]}}))}))},i.generatePageWithType=function(n){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return(e=o.find((function(e){return e.pageTypes.includes(n)})))?[4,i.generatePageWithInfo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,!1]}}))}))},i}();export{i as PageGenerator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasThemeJsonPageType as e}from"@ikas/storefront-models";var a="checkout",t=[{path:"[slug]/index.tsx",pageComponentName:"SlugPage",pageTypes:[e.PRODUCT,e.CATEGORY,e.BRAND],isDynamicSSG:!0},{path:"account/orders/[id].tsx",pageComponentName:"OrderDetailPage",pageTypes:[e.ORDER_DETAIL],isSSR:!0},{path:"account/orders/index.tsx",pageComponentName:"OrdersPage",pageTypes:[e.ORDERS]},{path:"account/addresses.tsx",pageComponentName:"AddressesPage",pageTypes:[e.ADDRESSES]},{path:"account/favorite-products.tsx",pageComponentName:"FavoriteProductsPage",pageTypes:[e.FAVORITE_PRODUCTS]},{path:"account/forgot-password.tsx",pageComponentName:"ForgotPasswordPage",pageTypes:[e.FORGOT_PASSWORD]},{path:"account/activate.tsx",pageComponentName:"ActivateCustomerPage",pageTypes:[e.ACTIVATE_CUSTOMER]},{path:"account/index.tsx",pageComponentName:"AccountPage",pageTypes:[e.ACCOUNT]},{path:"account/login.tsx",pageComponentName:"LoginPage",pageTypes:[e.LOGIN]},{path:"account/raffles.tsx",pageComponentName:"AccountRafflesPage",pageTypes:[e.RAFFLE_ACCOUNT]},{path:"account/recover-password.tsx",pageComponentName:"RecoverPasswordPage",pageTypes:[e.RECOVER_PASSWORD]},{path:"account/register.tsx",pageComponentName:"RegisterPage",pageTypes:[e.REGISTER]},{path:"blog/[slug].tsx",pageComponentName:"BlogSlugPage",pageTypes:[e.BLOG,e.BLOG_CATEGORY],isDynamicSSG:!0},{path:"blog/index.tsx",pageComponentName:"BlogPage",pageTypes:[e.BLOG_INDEX]},{path:"pages/[slug].tsx",pageComponentName:"CustomPage",pageTypes:[e.CUSTOM],isDynamicSSG:!0},{path:"raffle/[slug].tsx",pageComponentName:"RafflePage",pageTypes:[e.RAFFLE_DETAIL],isDynamicSSG:!0},{path:"raffle/index.tsx",pageComponentName:"RafflesPage",pageTypes:[e.RAFFLE]},{path:"404.tsx",pageComponentName:"NotFoundPage",pageTypes:[e.NOT_FOUND]},{path:"cart.tsx",pageComponentName:"CartPage",pageTypes:[e.CART]},{path:"index.tsx",pageComponentName:"IndexPage",pageTypes:[e.INDEX]},{path:"search.tsx",pageComponentName:"SearchPage",pageTypes:[e.SEARCH]},{path:"checkout.tsx",pageComponentName:"CheckoutPage",pageTypes:[],isCheckout:!0},{path:"editor.tsx",pageComponentName:"EditorPage",pageTypes:[],isEditor:!0}],o='import { CheckoutPage } from "@ikas/storefront";\nimport { CheckoutPage as CheckoutPageNext } from "@ikas/storefront-next";\n\nexport default CheckoutPage.default;\nexport const
|
|
1
|
+
import{IkasThemeJsonPageType as e}from"@ikas/storefront-models";var a="checkout",t=[{path:"[slug]/index.tsx",pageComponentName:"SlugPage",pageTypes:[e.PRODUCT,e.CATEGORY,e.BRAND],isDynamicSSG:!0},{path:"account/orders/[id].tsx",pageComponentName:"OrderDetailPage",pageTypes:[e.ORDER_DETAIL],isSSR:!0},{path:"account/orders/index.tsx",pageComponentName:"OrdersPage",pageTypes:[e.ORDERS]},{path:"account/addresses.tsx",pageComponentName:"AddressesPage",pageTypes:[e.ADDRESSES]},{path:"account/favorite-products.tsx",pageComponentName:"FavoriteProductsPage",pageTypes:[e.FAVORITE_PRODUCTS]},{path:"account/forgot-password.tsx",pageComponentName:"ForgotPasswordPage",pageTypes:[e.FORGOT_PASSWORD]},{path:"account/activate.tsx",pageComponentName:"ActivateCustomerPage",pageTypes:[e.ACTIVATE_CUSTOMER]},{path:"account/index.tsx",pageComponentName:"AccountPage",pageTypes:[e.ACCOUNT]},{path:"account/login.tsx",pageComponentName:"LoginPage",pageTypes:[e.LOGIN]},{path:"account/raffles.tsx",pageComponentName:"AccountRafflesPage",pageTypes:[e.RAFFLE_ACCOUNT]},{path:"account/recover-password.tsx",pageComponentName:"RecoverPasswordPage",pageTypes:[e.RECOVER_PASSWORD]},{path:"account/register.tsx",pageComponentName:"RegisterPage",pageTypes:[e.REGISTER]},{path:"blog/[slug].tsx",pageComponentName:"BlogSlugPage",pageTypes:[e.BLOG,e.BLOG_CATEGORY],isDynamicSSG:!0},{path:"blog/index.tsx",pageComponentName:"BlogPage",pageTypes:[e.BLOG_INDEX]},{path:"pages/[slug].tsx",pageComponentName:"CustomPage",pageTypes:[e.CUSTOM],isDynamicSSG:!0},{path:"raffle/[slug].tsx",pageComponentName:"RafflePage",pageTypes:[e.RAFFLE_DETAIL],isDynamicSSG:!0},{path:"raffle/index.tsx",pageComponentName:"RafflesPage",pageTypes:[e.RAFFLE]},{path:"404.tsx",pageComponentName:"NotFoundPage",pageTypes:[e.NOT_FOUND]},{path:"cart.tsx",pageComponentName:"CartPage",pageTypes:[e.CART]},{path:"index.tsx",pageComponentName:"IndexPage",pageTypes:[e.INDEX]},{path:"search.tsx",pageComponentName:"SearchPage",pageTypes:[e.SEARCH]},{path:"checkout.tsx",pageComponentName:"CheckoutPage",pageTypes:[],isCheckout:!0},{path:"editor.tsx",pageComponentName:"EditorPage",pageTypes:[],isEditor:!0}],o='import { CheckoutPage } from "@ikas/storefront";\nimport { CheckoutPage as CheckoutPageNext } from "@ikas/storefront-next";\n\nexport default CheckoutPage.default;\nexport const getStaticProps = CheckoutPageNext.getStaticProps;\n',p='import { EditorPage } from "@ikas/storefront";\nimport { EditorPage as EditorPageNext } from "@ikas/storefront-next";\nimport Components from "../components/__generated__/editor";\n\nconst PageComponent = EditorPage.default;\n\nconst Page = (props: any) => {\n return <PageComponent components={Components} {...props} />;\n};\n\nexport default Page;\nexport const getStaticProps = EditorPageNext.getStaticProps;\n';export{a as CHECKOUT_COMPONENT_ID,o as CHECKOUT_PAGE_CONTENT,p as EDITOR_PAGE_CONTENT,t as PAGE_INFO};
|
|
@@ -26,7 +26,9 @@ export declare class IkasNextPageDataProvider {
|
|
|
26
26
|
static setStorefrontConfig(settings: SettingsData): Promise<void>;
|
|
27
27
|
static applyStorefrontConfig(settings: SettingsData, isStandalone?: boolean): void;
|
|
28
28
|
static setTranslations(settings: SettingsData, componentIds: string[], pageType?: IkasThemeJsonPageType, isEditor?: boolean, contextLocale?: string): Promise<void>;
|
|
29
|
+
static getLocaleJsonNamespace(localeJson: unknown, namespace: string): Record<string, any> | undefined;
|
|
29
30
|
static loadStandaloneCheckoutTranslations(settings: SettingsData): Promise<Record<string, any>>;
|
|
31
|
+
static mergeTranslations(defaults: Record<string, any>, overrides: Record<string, any>): Record<string, any>;
|
|
30
32
|
static getExtraProps(settings: SettingsData, provider: IkasPageDataProvider, pageType?: IkasThemeJsonPageType): Promise<Record<string, any>>;
|
|
31
33
|
static buildCheckoutExtraProps(settings: SettingsData, provider: IkasPageDataProvider, checkoutSettings: Awaited<ReturnType<typeof listCheckoutSettings>>): Record<string, any>;
|
|
32
34
|
static getPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, isServer: boolean, pageType?: IkasThemeJsonPageType, possiblePageTypes?: IkasThemeJsonPageType[], isEditor?: boolean): Promise<{
|
|
@@ -46,6 +48,7 @@ export declare class IkasNextPageDataProvider {
|
|
|
46
48
|
} | {
|
|
47
49
|
props: any;
|
|
48
50
|
}>;
|
|
51
|
+
static omitPaymentStepScripts<T extends Record<string, any>>(props: T, context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>): T;
|
|
49
52
|
static getStaticProps(context: GetStaticPropsContext<ParsedUrlQuery>, pageType?: IkasThemeJsonPageType, possiblePageTypes?: IkasThemeJsonPageType[], isEditor?: boolean): Promise<{
|
|
50
53
|
props: any;
|
|
51
54
|
} | {
|
|
@@ -100,6 +103,7 @@ export declare type SettingsData = {
|
|
|
100
103
|
favicon: IkasThemeJsonFavicon;
|
|
101
104
|
stockPreference: IkasThemeJsonStockPreference;
|
|
102
105
|
storefrontJSScripts: string[];
|
|
106
|
+
themeStyleScripts?: string[];
|
|
103
107
|
highPriorityStoreFrontJSScripts: string[];
|
|
104
108
|
domain: string;
|
|
105
109
|
productBackInStockSettings: IkasProductBackInStockSettings | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t,__awaiter as o,__generator as n}from'./../ext/tslib/tslib.es6.js';import r from"fs";import i from"path";import s from"next/config.js";import{IkasThemeJsonPageType as a,IkasThemeJsonStockPreference as c}from"@ikas/storefront-models";import{IkasPageDataProvider as l}from"@ikas/storefront-providers";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import{setAPIClientConfig as p,getStorefrontSettings as d,listMerchantSettings as g,listCheckoutSettings as f}from"@ikas/storefront-api";import{getGoogleFontHref as h}from"../utils/google-fonts.js";import{I18NFileReader as m,CHECKOUT_TRANSLATION_NAMESPACE as S,readDefaultCheckoutTranslations as v}from"../utils/i18n.js";import{createFile as C,deleteDirContent as y}from"../utils/fs.js";var P,I=function(){function I(){}return I.getStandaloneCheckoutRequest=function(e){var t,o=e.req,n=null===(t=null==o?void 0:o.headers)||void 0===t?void 0:t["x-settings-path"];if(!n||"string"!=typeof n)return null;var r=function(e){var t=o.headers[e];return"string"==typeof t&&t?t:void 0},i=r("x-storefront-type");return{requestPath:I.getRequestPath(o)||"",settingsPath:n,projectJsonPath:r("x-project-json-path"),deployDir:r("x-deploy-dir"),host:r("x-host"),storefrontType:i===P.HEADLESS?P.HEADLESS:P.STUDIO}},I.getRequestPath=function(e){var t;try{var o=null===(t=e[Object.getOwnPropertySymbols(e).find((function(e){return"Symbol(NextRequestMeta)"===e.toString()}))])||void 0===t?void 0:t.__NEXT_INIT_URL;if(!o)return e.url;var n=new URL(o,"http://localhost");return n.pathname+n.search}catch(t){return e.url}},I.readJsonFile=function(e){return JSON.parse(r.readFileSync(e,"utf8"))},I.ensureCheckoutPage=function(o){var n=o.components||[],r=o.pages||[],i=n.some((function(e){return"checkout"===e.id})),s=r.some((function(e){return e.type===a.CHECKOUT}));return i&&s?o:e(e({},o),{components:i?n:t(t([],n,!0),[{id:"checkout",dir:"",displayName:"Checkout",props:[],isHeader:!1,isFooter:!1,defaultPropValuesTranslations:{}}],!1),pages:s?r:t(t([],r,!0),[{id:"checkout",name:"Checkout",type:a.CHECKOUT,slug:null,pageTitle:null,description:null,components:[{id:"checkout",componentId:"checkout",propValues:{}}],specifications:null,canonicals:null,disableIndex:null}],!1)})},I.getCheckoutThemeJson=function(e){return e.storefrontType===P.STUDIO?e.projectJson.checkoutThemeJson:e.themeLocalization.themeJson},I.getHeadlessRouting=function(e,t,o){var n=null==o?void 0:o.toLowerCase(),r=n?e.find((function(e){var t;return(null===(t=e.domain)||void 0===t?void 0:t.toLowerCase())===n})):void 0;if(r)return r;var i=t.split("?")[0].split("/")[1],s=i?e.find((function(e){return e.path===i})):void 0;return s||(e.find((function(e){return!e.domain&&!e.path}))||e[0])},I.getStudioRouting=function(e,t){var o=t.split("?")[0].split("/")[1];return o="checkout"===o?null:o,e.find((function(e){return o?e.path===o:!e.path}))},I.getHeadlessLocalizationPath=function(e,t,o){var n=i.join(e,"localizations"),s=i.join(n,"".concat(t.mainStorefrontThemeId,"_").concat(o,".json"));if(r.existsSync(s))return s;try{var a=r.readdirSync(n).filter((function(e){return e.endsWith("_".concat(o,".json"))}));if(1===a.length)return i.join(n,a[0])}catch(e){}},I.getStandaloneApiConfig=function(e,t,o){return{URL:process.env.INTERNAL_GQL_URL||process.env.NEXT_PUBLIC_GQL_URL||"",HEADERS:{"x-api-key":e||"","x-sfid":t,"x-sfrid":o,"x-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||""}}},I.getStandaloneCheckoutSettings=function(e){var r,i;return o(this,void 0,void 0,(function(){var o,s,a,l,u,p,d,f,h,m,S,v,C,y,T,k,L,R,w,O,E,b,D,B;return n(this,(function(n){switch(n.label){case 0:o=e.requestPath,s=e.settingsPath,a=e.projectJsonPath,l=e.deployDir,u=e.host,p=e.storefrontType,d=p===P.STUDIO,n.label=1;case 1:if(n.trys.push([1,11,,12]),!d&&!l)return console.error("[checkout] Deploy dir missing for headless"),[2,null];if(!(null==(f=I.readJsonFile(s))?void 0:f.storefront))return console.error("[checkout] Settings missing"),[2,null];if(h=void 0,d){if(!a)return console.error("[checkout] Project json path missing for studio"),[2,null];h=I.readJsonFile(a)}return m=f.storefront,S=d?I.getStudioRouting(m.routings,o):I.getHeadlessRouting(m.routings,o,u),(v=S?d?null===(r=f.localizationMap)||void 0===r?void 0:r[S.id]:I.getHeadlessLocalizationPath(l,m,S.locale):void 0)&&S?(C=f.merchantSettings)?[3,3]:[4,g({},I.getStandaloneApiConfig(f.apiKey,m.id,S.id))]:(console.error("[checkout] Theme localization path or routing missing"),[2,null]);case 2:if(!(y=n.sent()).isSuccess||!y.data)return console.error("[checkout] Merchant settings fetch failed"),[2,null];C=y.data,n.label=3;case 3:return C.address=null,delete C.merchantAddress,T=I.readJsonFile(v),k=t([],f.storefrontJSScripts||[],!0),L=void 0,R=void 0,d?(h.checkoutThemeJson=I.ensureCheckoutPage(h.checkoutThemeJson||{}),w=null===(i=m.indexPageSeoSettings)||void 0===i?void 0:i.find((function(e){return e.locale===S.locale})),L={id:(null==w?void 0:w.favIcon)||null},R=c.SHOW_ALL,[3,10]):[3,4];case 4:if(T.themeJson=I.ensureCheckoutPage(T.themeJson),O=T.themeJson.settings,L=null==O?void 0:O.favicon,R=null==O?void 0:O.stockPreference,!O)return[3,10];E=I.createColorStyle(O),b=void 0,n.label=5;case 5:return n.trys.push([5,8,,9]),O.fontFamily?[4,I.getCachedFontScript(O)]:[3,7];case 6:b=n.sent(),n.label=7;case 7:return[3,9];case 8:return D=n.sent(),console.error("[checkout] Font fetch failed",D),[3,9];case 9:E&&k.push(E),b&&k.push(b),n.label=10;case 10:return[2,{storefrontType:p,storefront:m,themeLocalization:T,salesChannel:f.salesChannel,routing:S,favicon:L,stockPreference:R,storefrontJSScripts:k,highPriorityStoreFrontJSScripts:f.highPriorityStoreFrontJSScripts||[],domain:f.domain,productBackInStockSettings:f.productBackInStockSettings?{customerLoginRequired:f.productBackInStockSettings.customerLoginRequired}:null,customerReviewSettings:f.customerReviewSettings?{customerLoginRequired:f.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:f.customerReviewSettings.customerPurchaseRequired||!1}:null,merchantSettings:C,customerSettings:f.customerSettings,custom:f.custom,storefrontPopups:f.storefrontPopups||[],loyaltyPrograms:f.loyaltyPrograms||[],payWithIkasUrl:f.payWithIkasUrl,projectJson:h,deployDir:l,apiKey:f.apiKey}];case 11:return B=n.sent(),console.error("[checkout] Settings read error",B),[2,null];case 12:return[2]}}))}))},I.readLocalTheme=function(){return new Promise((function(e,t){r.readFile("./src/theme.json",{flag:"a+"},(function(o,n){if(o)return t(o);var r=n.length?JSON.parse(n.toString()):{};e(r)}))}))},I.readSettingsFile=function(){return new Promise((function(e){var t,o,n=null===(o=null===(t=s())||void 0===t?void 0:t.serverRuntimeConfig)||void 0===o?void 0:o.SETTINGS;if(!n)return console.error("SETTINGS PATH MISSING!!!"),e(null);r.readFile(n,{flag:"a+"},(function(t,o){if(t)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(t),e(null);var n=o.length?JSON.parse(o.toString()):{};e(n)}))}))},I.cacheLocalSettingsFile=function(e){return o(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return[4,y(t=".ikas")];case 1:return n.sent(),o="settings-".concat(this.startTime,".json"),[4,C(t,o,JSON.stringify(e,null,2))];case 2:return n.sent(),[2]}}))}))},I.readLocalSettingsFile=function(){try{var e=r.readFileSync(".ikas/settings-".concat(this.startTime,".json"));if(e&&e.length)return JSON.parse(e.toString())}catch(e){}},I.getLocalSettings=function(e){return o(this,void 0,void 0,(function(){var t,o,r,i,s,a,c,l,u,p;return n(this,(function(n){switch(n.label){case 0:return[4,I.readLocalSettingsFile()];case 1:return(t=n.sent())?[3,4]:[4,d()];case 2:return(o=n.sent()).isSuccess&&o.data?(t=o.data,[4,this.cacheLocalSettingsFile(t)]):(console.error("Storefront settings fetch failed!"),console.error(o),[2,null]);case 3:n.sent(),n.label=4;case 4:return r=t.storefront,i=t.salesChannel,s=[],a=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,c=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,[4,I.readLocalTheme()];case 5:return l=n.sent(),u=I.createColorScript(l.settings),[4,I.createFontScript(l.settings)];case 6:return p=n.sent(),u&&s.push(u),p&&s.push(p),[2,{storefrontType:P.HEADLESS,storefront:r,themeLocalization:{id:"",locale:"en",privacyPolicy:null,returnPolicy:null,storefrontId:r.id,storefrontThemeId:"",termsOfService:null,imprint:null,shippingPolicy:null,themeJson:l},salesChannel:i,routing:r.routings.length?r.routings.find((function(t){return t.locale===e||t.id===e}))||r.routings[0]:{countryCodes:[],domain:"",dynamicCurrencySettings:{roundingFormat:null,targetCurrencyCode:""},id:"",locale:"en",path:null,priceListId:null,currencyCode:"USD",currencySymbol:"$"},favicon:l.settings.favicon,stockPreference:l.settings.stockPreference,storefrontJSScripts:s,highPriorityStoreFrontJSScripts:[],domain:"localhost:3333",productBackInStockSettings:a,customerReviewSettings:c,merchantSettings:t.merchantSettings,customerSettings:t.customerSettings,storefrontPopups:t.storefrontPopups,loyaltyPrograms:t.loyaltyPrograms}]}}))}))},I.getProdSettings=function(e){return o(this,void 0,void 0,(function(){var t=this;return n(this,(function(i){return[2,new Promise((function(i){return o(t,void 0,void 0,(function(){var t,s,a,c,l,u,p,d,f,h,m,S,v;return n(this,(function(C){switch(C.label){case 0:return[4,I.readSettingsFile()];case 1:return(t=C.sent())&&t.localizationMap?(s=t.storefront,a=t.salesChannel,c=t.localizationMap,l=t.storefrontJSScripts||[],u=t.highPriorityStoreFrontJSScripts||[],p=t.domain,d=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,f=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,(h=t.merchantSettings)?[3,3]:[4,g({})]):[2,i(null)];case 2:if(!(m=C.sent()).isSuccess||!m.data)return console.error("MERCHANT SETTINGS FETCH FAILED!"),[2,i(null)];h=m.data,C.label=3;case 3:return h&&(h.address=null,delete h.merchantAddress),S=c[e],v=s.routings.find((function(t){return t.id===e||t.path===e})),S&&v?(r.readFile(S,{flag:"a+"},(function(e,r){return o(this,void 0,void 0,(function(){var o,c,g,m,S,C,y;return n(this,(function(n){switch(n.label){case 0:return e?(console.error("THEME LOCALIZATION FILE READ ERROR!!!"),console.error(e),[2,i(null)]):(o=r.length?JSON.parse(r.toString()):{},g=(c=o).themeJson.settings.favicon,m=c.themeJson.settings.stockPreference,c.themeJson.settings?(S=I.createColorScript(c.themeJson.settings),[4,I.createFontScript(c.themeJson.settings)]):[3,2]);case 1:C=n.sent(),S&&l.push(S),C&&l.push(C),n.label=2;case 2:return y=t.customerSettings,i({storefrontType:P.HEADLESS,storefront:s,themeLocalization:c,salesChannel:a,routing:v,favicon:g,stockPreference:m,storefrontJSScripts:l,highPriorityStoreFrontJSScripts:u,domain:p,productBackInStockSettings:d,customerReviewSettings:f,merchantSettings:h,customerSettings:y,custom:t.custom,storefrontPopups:t.storefrontPopups,loyaltyPrograms:t.loyaltyPrograms,payWithIkasUrl:t.payWithIkasUrl}),[2]}}))}))})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,i(null)])}}))}))}))]}))}))},I.getSettings=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(e)]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return[4,this.getProdSettings(e)]}}))}))},I.setStorefrontConfig=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){return I.applyStorefrontConfig(e),[2]}))}))},I.applyStorefrontConfig=function(t,o){var n,r;void 0===o&&(o=!1);var i=t.storefront,s=t.salesChannel,a=t.routing,c=t.favicon,l=t.stockPreference,d=t.storefrontJSScripts,g=t.highPriorityStoreFrontJSScripts,f=t.domain,h=t.productBackInStockSettings,m=t.customerReviewSettings,S=t.merchantSettings,v=t.customerSettings,C=t.custom,y=t.storefrontPopups,P=t.loyaltyPrograms,I=t.payWithIkasUrl,T=t.apiKey;o&&u.clear(),u.init(e(e({},T?{apiKey:T}:{}),{apiUrl:process.env.INTERNAL_GQL_URL||process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL,storefrontId:i.id,storefrontRoutingId:a.id,storefrontThemeId:i.mainStorefrontThemeId,storefrontB2BSettings:i.b2bSettings||void 0,storefrontType:i.type,salesChannelId:i.salesChannelId,priceListId:a.priceListId||void 0,stockLocationIds:null===(n=s.stockLocations)||void 0===n?void 0:n.map((function(e){return e.id})),routings:i.routings,paymentGateways:s.paymentGateways||[],gtmId:i.gtmId||void 0,fbpId:i.fbpId||void 0,analytics4Id:i.analytics4Id||void 0,universalAnalyticsId:i.universalAnalyticsId||void 0,tiktokPixelId:i.tiktokPixelId||void 0,openAiPixelId:i.openAiPixelId||void 0,favicon:c||null,pickUpStockLocationIds:i.pickUpStockLocationIds&&i.pickUpStockLocationIds.length?i.pickUpStockLocationIds:null,stockPreference:l||null,storefrontJSScripts:d||[],highPriorityStoreFrontJSScripts:g||[],domain:f,productBackInStockSettings:h,customerReviewSettings:m,merchantSettings:S,customerSettings:v,metaTemplates:i.metaTemplates||null,custom:C||null,indexPageSeoSettings:i.indexPageSeoSettings,storefrontPopups:y,loyaltyPrograms:P,payWithIkasUrl:I,milesSmilesSettings:(null===(r=i.socialLoginSettings)||void 0===r?void 0:r.find((function(e){return"miles_smiles"===e.provider})))||null})),p()},I.setTranslations=function(e,r,i,c,l){return o(this,void 0,void 0,(function(){var o,p,d,g,f,h,S,v;return n(this,(function(n){switch(n.label){case 0:return o=s().serverRuntimeConfig,p=e.routing,d="local"===process.env.NEXT_PUBLIC_ENV,g=e.themeLocalization.themeJson.components.filter((function(e){return c||r.includes(e.id)})),f=t(["common"],g.map((function(e){return e.dir})),!0),(i===a.CHECKOUT||c)&&f.push("checkout-page"),h=o.nextI18nConf,S=d&&l?l:p.locale,[4,new m(S,f,d?void 0:h.localePath).read()];case 1:return v=n.sent(),u.init({translations:v}),[2]}}))}))},I.loadStandaloneCheckoutTranslations=function(e){var t,s,a;return o(this,void 0,void 0,(function(){var o,c,l,u,p,d;return n(this,(function(n){switch(n.label){case 0:o=e.routing.locale;try{e.storefrontType===P.STUDIO?c=null===(a=null===(s=null===(t=e.projectJson)||void 0===t?void 0:t.i18nTranslations)||void 0===s?void 0:s[o])||void 0===a?void 0:a.checkout_page:e.deployDir&&(l=i.join(e.deployDir,"public","locales",o,"checkout.json"),r.existsSync(l)&&(c=I.readJsonFile(l)))}catch(e){console.error("[checkout] Translations read error",e)}return d={},u=S,(p=c)?[3,2]:[4,v(o)];case 1:p=n.sent(),n.label=2;case 2:return[2,(d[u]=p,d)]}}))}))},I.getExtraProps=function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o;return n(this,(function(n){switch(n.label){case 0:return r===a.CHECKOUT&&(null===(i=t.page)||void 0===i?void 0:i.components[0])?[4,f({})]:[2,{}];case 1:return o=n.sent(),[2,I.buildCheckoutExtraProps(e,t,o)]}}))}))},I.buildCheckoutExtraProps=function(e,t,o){var n,r,i,s,a,c,l,u,p,d,g,f,h,m,S,v,C,y,P,I,T,k,L,R,w={},O=e.themeLocalization,E=null===(n=t.page)||void 0===n?void 0:n.components[0];if(E){o.isSuccess||(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(o.graphQLErrors),console.error(o.errorCodes));var b={logo:null!==(r=E.propValues.logo)&&void 0!==r?r:null,showTax:null===(i=E.propValues.showTax)||void 0===i||i,showLoyaltyPoints:null!==(s=E.propValues.showLoyaltyPoints)&&void 0!==s&&s,showCampaignOffersDesign:null!==(a=E.propValues.showCampaignOffersDesign)&&void 0!==a&&a,showCampaignIsBiggerImage:null!==(c=E.propValues.showCampaignIsBiggerImage)&&void 0!==c&&c,campaignOfferIsSmallDesign:null!==(l=E.propValues.campaignOfferIsSmallDesign)&&void 0!==l&&l,showCampaignHideDiscountBadge:null!==(u=E.propValues.showCampaignHideDiscountBadge)&&void 0!==u&&u,campaignOfferCountdownStyleIsLine:null!==(p=E.propValues.campaignOfferCountdownStyleIsLine)&&void 0!==p&&p,campaignOfferCountdownStyleIsLineSuccessPage:null!==(d=E.propValues.campaignOfferCountdownStyleIsLineSuccessPage)&&void 0!==d&&d,campaignOffersEnableMiddlePhase:null!==(g=E.propValues.campaignOffersEnableMiddlePhase)&&void 0!==g&&g,campaignOffersTitleColor:null!==(f=E.propValues.campaignOffersTitleColor)&&void 0!==f?f:null,campaignOffersDescriptionColor:null!==(h=E.propValues.campaignOffersDescriptionColor)&&void 0!==h?h:null,campaignOffersContainerBgColor:null!==(m=E.propValues.campaignOffersContainerBgColor)&&void 0!==m?m:null,campaignOffersDiscountPercentageColor:null!==(S=E.propValues.campaignOffersDiscountPercentageColor)&&void 0!==S?S:null,campaignOffersDiscountPercentageBgColor:null!==(v=E.propValues.campaignOffersDiscountPercentageBgColor)&&void 0!==v?v:null,campaignOffersCountdownTextColor:null!==(C=E.propValues.campaignOffersCountdownTextColor)&&void 0!==C?C:null,campaignOffersCountdownTimeColor:null!==(y=E.propValues.campaignOffersCountdownTimeColor)&&void 0!==y?y:null,campaignOffersCountdownBgColor:null!==(P=E.propValues.campaignOffersCountdownBgColor)&&void 0!==P?P:null,campaignOffersMiddlePhaseOverlayColor:null!==(I=E.propValues.campaignOffersMiddlePhaseOverlayColor)&&void 0!==I?I:null,buttonBgColor:E.propValues.buttonBgColor,buttonTextColor:E.propValues.buttonTextColor,buttonDisabledBgColor:E.propValues.buttonDisabledBgColor,buttonDisabledTextColor:E.propValues.buttonDisabledTextColor,primaryTextColor:E.propValues.primaryTextColor,secondaryTextColor:E.propValues.secondaryTextColor,primaryBgColor:E.propValues.primaryBgColor,secondaryBgColor:E.propValues.secondaryBgColor,borderColor:E.propValues.borderColor,cardBgColor:E.propValues.cardBgColor,errorColor:E.propValues.errorColor,errorLightColor:E.propValues.errorLightColor,warningColor:E.propValues.warningColor,warningLightColor:E.propValues.warningLightColor,successColor:E.propValues.successColor,successLightColor:E.propValues.successLightColor,secondaryButtonBgColor:null!==(T=E.propValues.secondaryButtonBgColor)&&void 0!==T?T:null,secondaryButtonTextColor:null!==(k=E.propValues.secondaryButtonTextColor)&&void 0!==k?k:null,secondaryButtonBorderColor:null!==(L=E.propValues.secondaryButtonBorderColor)&&void 0!==L?L:null};w.customizationProps=b,w.returnPolicy=O.returnPolicy,w.privacyPolicy=O.privacyPolicy,w.termsOfService=O.termsOfService,w.imprint=O.imprint,w.shippingPolicy=O.shippingPolicy,w.checkoutSettings=(null===(R=null==o?void 0:o.data)||void 0===R?void 0:R.length)?o.data[0]:null}return w},I.getPageData=function(t,r,i,s,c){var d;return o(this,void 0,void 0,(function(){var o,g,f,h,m,S,v,C,y;return n(this,(function(n){switch(n.label){case 0:return(o=i===a.CHECKOUT?I.getStandaloneCheckoutRequest(t):null)?[2,I.getStandaloneCheckoutPageData(t,o)]:(g="local"===process.env.NEXT_PUBLIC_ENV,f=!g&&c,u.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL}),p(),f?[3,7]:(h=t.locale)?[4,I.getSettings(h)]:[2,{props:{},notFound:!0}]);case 1:return(m=n.sent())&&m.storefront.mainStorefrontThemeId&&m.storefront.salesChannelId?[4,this.setStorefrontConfig(m)]:[2,{props:{},notFound:!0}];case 2:return n.sent(),S=m.themeLocalization,(v=new l(S.themeJson,t.params,i,m.merchantSettings)).possiblePageTypes=s||(i?[i]:[]),c?[3,4]:[4,v.getPageData()];case 3:if(n.sent(),!v.page)return[2,{props:{},notFound:!0}];n.label=4;case 4:return C=c?v.theme.components.map((function(e){return e.id})):(null===(d=v.page)||void 0===d?void 0:d.components.map((function(e){return e.componentId})))||[],[4,this.setTranslations(m,C,i,c,h)];case 5:return n.sent(),[4,this.getExtraProps(m,v,i)];case 6:return y=n.sent(),r?[2,{props:e(e({},v.nextPageData.props),y)}]:[2,{props:e(e({},v.nextPageData.props),y),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},I.getStandaloneCheckoutPageData=function(t,r){var i,s;return o(this,void 0,void 0,(function(){var o,c,p,d,g,h,m,S;return n(this,(function(n){switch(n.label){case 0:return o={props:{},notFound:!0},t.locale?[4,I.getStandaloneCheckoutSettings(r)]:[2,o];case 1:return(c=n.sent())&&c.storefront.mainStorefrontThemeId&&c.storefront.salesChannelId?((p=new l(I.getCheckoutThemeJson(c),t.params,a.CHECKOUT,c.merchantSettings)).possiblePageTypes=[a.CHECKOUT],[4,p.getPageData()]):[2,o];case 2:return n.sent(),p.page?(d=I.getStandaloneApiConfig(c.apiKey,c.storefront.id,c.routing.id),[4,Promise.all([f({},d),I.loadStandaloneCheckoutTranslations(c)])]):[2,o];case 3:return g=n.sent(),h=g[0],m=g[1],I.applyStorefrontConfig(c,!0),u.init({translations:m}),S=e(e({},p.nextPageData.props),I.buildCheckoutExtraProps(c,p,h)),(null===(i=S.configJson)||void 0===i?void 0:i.storefrontId)!==c.storefront.id?(console.error("[checkout] CONFIG STOREFRONT MISMATCH",{expected:c.storefront.id,actual:null===(s=S.configJson)||void 0===s?void 0:s.storefrontId}),[2,o]):[2,{props:S}]}}))}))},I.getStaticProps=function(e,t,r,i){return o(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,I.getPageData(e,!1,t,r,i)];case 1:return[2,o.sent()]}}))}))},I.getServerSideProps=function(e,t){return o(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,I.getPageData(e,!0,t)];case 1:return[2,o.sent()]}}))}))},I.createColorStyle=function(e){var t;if(null===(t=e.colors)||void 0===t?void 0:t.length){var o=function(e){return"".concat(e).replace(/[<>{};]/g,"")};return"<style>:root{".concat(e.colors.map((function(e){return"".concat(o(e.key),":").concat(o(e.color),";")})).join(""),"}</style>")}},I.createColorScript=function(e){if(e.colors)return"<script>".concat(e.colors.map((function(e){return'document.documentElement.style.setProperty("'.concat(e.key,'","').concat(e.color,'");')})).join("\r\n"),"<\/script> \n ")},I.getCachedFontScript=function(e){return o(this,void 0,void 0,(function(){var t,o,r,i;return n(this,(function(n){switch(n.label){case 0:return(t=h(e.fontFamily))?(o="".concat(t,"|").concat(e.fontFamily.name),(r=I.fontScriptCache.get(o))&&r.expiresAt>Date.now()?[2,r.script]:[4,I.createFontScript(e)]):[2];case 1:return(i=n.sent())&&I.fontScriptCache.set(o,{script:i,expiresAt:Date.now()+864e5}),[2,i]}}))}))},I.createFontScript=function(e){return o(this,void 0,void 0,(function(){var t,o,r;return n(this,(function(n){switch(n.label){case 0:return(t=h(e.fontFamily))?[4,fetch(t,{headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"}})]:[3,3];case 1:return[4,n.sent().text()];case 2:return o=n.sent(),r=o.replace(new RegExp("fonts.gstatic.com","g"),"fonts.myikas.com"),[2,"<style>\n ".concat(r,"\n\n body { \n font-family: '").concat(e.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n\n </style>')];case 3:return[2]}}))}))},I.startTime=Date.now(),I.fontScriptCache=new Map,I}();!function(e){e.STUDIO="studio",e.HEADLESS="headless"}(P||(P={}));export{P as CheckoutStorefrontType,I as IkasNextPageDataProvider};
|
|
1
|
+
import{__assign as e,__spreadArray as t,__awaiter as o,__generator as n}from'./../ext/tslib/tslib.es6.js';import r from"fs";import i from"path";import s from"next/config.js";import{IkasThemeJsonPageType as a,IkasThemeJsonStockPreference as c}from"@ikas/storefront-models";import{IkasPageDataProvider as l}from"@ikas/storefront-providers";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import{setAPIClientConfig as p,getStorefrontSettings as d,listMerchantSettings as f,listCheckoutSettings as g}from"@ikas/storefront-api";import{getGoogleFontHref as h}from"../utils/google-fonts.js";import{I18NFileReader as m,CHECKOUT_TRANSLATION_NAMESPACE as S,readDefaultCheckoutTranslations as v}from"../utils/i18n.js";import{createFile as y,deleteDirContent as C}from"../utils/fs.js";var P,T=function(){function T(){}return T.getStandaloneCheckoutRequest=function(e){var t,o=e.req,n=null===(t=null==o?void 0:o.headers)||void 0===t?void 0:t["x-settings-path"];if(!n||"string"!=typeof n)return null;var r=function(e){var t=o.headers[e];return"string"==typeof t&&t?t:void 0},i=r("x-storefront-type");return{requestPath:T.getRequestPath(o)||"",settingsPath:n,projectJsonPath:r("x-project-json-path"),deployDir:r("x-deploy-dir"),host:r("x-host"),storefrontType:i===P.HEADLESS?P.HEADLESS:P.STUDIO}},T.getRequestPath=function(e){var t;try{var o=null===(t=e[Object.getOwnPropertySymbols(e).find((function(e){return"Symbol(NextRequestMeta)"===e.toString()}))])||void 0===t?void 0:t.__NEXT_INIT_URL;if(!o)return e.url;var n=new URL(o,"http://localhost");return n.pathname+n.search}catch(t){return e.url}},T.readJsonFile=function(e){return JSON.parse(r.readFileSync(e,"utf8"))},T.ensureCheckoutPage=function(o){var n=o.components||[],r=o.pages||[],i=n.some((function(e){return"checkout"===e.id})),s=r.some((function(e){return e.type===a.CHECKOUT}));return i&&s?o:e(e({},o),{components:i?n:t(t([],n,!0),[{id:"checkout",dir:"",displayName:"Checkout",props:[],isHeader:!1,isFooter:!1,defaultPropValuesTranslations:{}}],!1),pages:s?r:t(t([],r,!0),[{id:"checkout",name:"Checkout",type:a.CHECKOUT,slug:null,pageTitle:null,description:null,components:[{id:"checkout",componentId:"checkout",propValues:{}}],specifications:null,canonicals:null,disableIndex:null}],!1)})},T.getCheckoutThemeJson=function(e){return e.storefrontType===P.STUDIO?e.projectJson.checkoutThemeJson:e.themeLocalization.themeJson},T.getHeadlessRouting=function(e,t,o){var n=null==o?void 0:o.toLowerCase(),r=n?e.find((function(e){var t;return(null===(t=e.domain)||void 0===t?void 0:t.toLowerCase())===n})):void 0;if(r)return r;var i=t.split("?")[0].split("/")[1],s=i?e.find((function(e){return e.path===i})):void 0;return s||(e.find((function(e){return!e.domain&&!e.path}))||e[0])},T.getStudioRouting=function(e,t){var o=t.split("?")[0].split("/")[1];return o="checkout"===o?null:o,e.find((function(e){return o?e.path===o:!e.path}))},T.getHeadlessLocalizationPath=function(e,t,o){var n=i.join(e,"localizations"),s=i.join(n,"".concat(t.mainStorefrontThemeId,"_").concat(o,".json"));if(r.existsSync(s))return s;try{var a=r.readdirSync(n).filter((function(e){return e.endsWith("_".concat(o,".json"))}));if(1===a.length)return i.join(n,a[0])}catch(e){}},T.getStandaloneApiConfig=function(e,t,o){return{URL:process.env.INTERNAL_GQL_URL||process.env.NEXT_PUBLIC_GQL_URL||"",HEADERS:{"x-api-key":e||"","x-sfid":t,"x-sfrid":o,"x-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||""}}},T.getStandaloneCheckoutSettings=function(e){var r,i;return o(this,void 0,void 0,(function(){var o,s,a,l,u,p,d,g,h,m,S,v,y,C,I,k,L,R,w,O,E,b,J,D,B;return n(this,(function(n){switch(n.label){case 0:o=e.requestPath,s=e.settingsPath,a=e.projectJsonPath,l=e.deployDir,u=e.host,p=e.storefrontType,d=p===P.STUDIO,n.label=1;case 1:if(n.trys.push([1,11,,12]),!d&&!l)return console.error("[checkout] Deploy dir missing for headless"),[2,null];if(!(null==(g=T.readJsonFile(s))?void 0:g.storefront))return console.error("[checkout] Settings missing"),[2,null];if(h=void 0,d){if(!a)return console.error("[checkout] Project json path missing for studio"),[2,null];h=T.readJsonFile(a)}return m=g.storefront,S=d?T.getStudioRouting(m.routings,o):T.getHeadlessRouting(m.routings,o,u),(v=S?d?null===(r=g.localizationMap)||void 0===r?void 0:r[S.id]:T.getHeadlessLocalizationPath(l,m,S.locale):void 0)&&S?(y=g.merchantSettings)?[3,3]:[4,f({},T.getStandaloneApiConfig(g.apiKey,m.id,S.id))]:(console.error("[checkout] Theme localization path or routing missing"),[2,null]);case 2:if(!(C=n.sent()).isSuccess||!C.data)return console.error("[checkout] Merchant settings fetch failed"),[2,null];y=C.data,n.label=3;case 3:return y.address=null,delete y.merchantAddress,I=T.readJsonFile(v),k=t([],g.storefrontJSScripts||[],!0),L=[],R=void 0,w=void 0,d?(h.checkoutThemeJson=T.ensureCheckoutPage(h.checkoutThemeJson||{}),O=null===(i=m.indexPageSeoSettings)||void 0===i?void 0:i.find((function(e){return e.locale===S.locale})),R={id:(null==O?void 0:O.favIcon)||null},w=c.SHOW_ALL,[3,10]):[3,4];case 4:if(I.themeJson=T.ensureCheckoutPage(I.themeJson),E=I.themeJson.settings,R=null==E?void 0:E.favicon,w=null==E?void 0:E.stockPreference,!E)return[3,10];b=T.createColorStyle(E),J=void 0,n.label=5;case 5:return n.trys.push([5,8,,9]),E.fontFamily?[4,T.getCachedFontScript(E)]:[3,7];case 6:J=n.sent(),n.label=7;case 7:return[3,9];case 8:return D=n.sent(),console.error("[checkout] Font fetch failed",D),[3,9];case 9:b&&L.push(b),J&&L.push(J),n.label=10;case 10:return[2,{storefrontType:p,storefront:m,themeLocalization:I,salesChannel:g.salesChannel,routing:S,favicon:R,stockPreference:w,storefrontJSScripts:k,themeStyleScripts:L,highPriorityStoreFrontJSScripts:g.highPriorityStoreFrontJSScripts||[],domain:g.domain,productBackInStockSettings:g.productBackInStockSettings?{customerLoginRequired:g.productBackInStockSettings.customerLoginRequired}:null,customerReviewSettings:g.customerReviewSettings?{customerLoginRequired:g.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:g.customerReviewSettings.customerPurchaseRequired||!1}:null,merchantSettings:y,customerSettings:g.customerSettings,custom:g.custom,storefrontPopups:g.storefrontPopups||[],loyaltyPrograms:g.loyaltyPrograms||[],payWithIkasUrl:g.payWithIkasUrl,projectJson:h,deployDir:l,apiKey:g.apiKey}];case 11:return B=n.sent(),console.error("[checkout] Settings read error",B),[2,null];case 12:return[2]}}))}))},T.readLocalTheme=function(){return new Promise((function(e,t){r.readFile("./src/theme.json",{flag:"a+"},(function(o,n){if(o)return t(o);var r=n.length?JSON.parse(n.toString()):{};e(r)}))}))},T.readSettingsFile=function(){return new Promise((function(e){var t,o,n=null===(o=null===(t=s())||void 0===t?void 0:t.serverRuntimeConfig)||void 0===o?void 0:o.SETTINGS;if(!n)return console.error("SETTINGS PATH MISSING!!!"),e(null);r.readFile(n,{flag:"a+"},(function(t,o){if(t)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(t),e(null);var n=o.length?JSON.parse(o.toString()):{};e(n)}))}))},T.cacheLocalSettingsFile=function(e){return o(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return[4,C(t=".ikas")];case 1:return n.sent(),o="settings-".concat(this.startTime,".json"),[4,y(t,o,JSON.stringify(e,null,2))];case 2:return n.sent(),[2]}}))}))},T.readLocalSettingsFile=function(){try{var e=r.readFileSync(".ikas/settings-".concat(this.startTime,".json"));if(e&&e.length)return JSON.parse(e.toString())}catch(e){}},T.getLocalSettings=function(e){return o(this,void 0,void 0,(function(){var t,o,r,i,s,a,c,l,u,p,f;return n(this,(function(n){switch(n.label){case 0:return[4,T.readLocalSettingsFile()];case 1:return(t=n.sent())?[3,4]:[4,d()];case 2:return(o=n.sent()).isSuccess&&o.data?(t=o.data,[4,this.cacheLocalSettingsFile(t)]):(console.error("Storefront settings fetch failed!"),console.error(o),[2,null]);case 3:n.sent(),n.label=4;case 4:return r=t.storefront,i=t.salesChannel,s=[],a=[],c=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,l=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,[4,T.readLocalTheme()];case 5:return u=n.sent(),p=T.createColorScript(u.settings),[4,T.createFontScript(u.settings)];case 6:return f=n.sent(),p&&a.push(p),f&&a.push(f),[2,{storefrontType:P.HEADLESS,storefront:r,themeLocalization:{id:"",locale:"en",privacyPolicy:null,returnPolicy:null,storefrontId:r.id,storefrontThemeId:"",termsOfService:null,imprint:null,shippingPolicy:null,themeJson:u},salesChannel:i,routing:r.routings.length?r.routings.find((function(t){return t.locale===e||t.id===e}))||r.routings[0]:{countryCodes:[],domain:"",dynamicCurrencySettings:{roundingFormat:null,targetCurrencyCode:""},id:"",locale:"en",path:null,priceListId:null,currencyCode:"USD",currencySymbol:"$"},favicon:u.settings.favicon,stockPreference:u.settings.stockPreference,storefrontJSScripts:s,themeStyleScripts:a,highPriorityStoreFrontJSScripts:[],domain:"localhost:3333",productBackInStockSettings:c,customerReviewSettings:l,merchantSettings:t.merchantSettings,customerSettings:t.customerSettings,storefrontPopups:t.storefrontPopups,loyaltyPrograms:t.loyaltyPrograms}]}}))}))},T.getProdSettings=function(e){return o(this,void 0,void 0,(function(){var t=this;return n(this,(function(i){return[2,new Promise((function(i){return o(t,void 0,void 0,(function(){var t,s,a,c,l,u,p,d,g,h,m,S,v,y;return n(this,(function(C){switch(C.label){case 0:return[4,T.readSettingsFile()];case 1:return(t=C.sent())&&t.localizationMap?(s=t.storefront,a=t.salesChannel,c=t.localizationMap,l=t.storefrontJSScripts||[],u=[],p=t.highPriorityStoreFrontJSScripts||[],d=t.domain,g=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,h=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,(m=t.merchantSettings)?[3,3]:[4,f({})]):[2,i(null)];case 2:if(!(S=C.sent()).isSuccess||!S.data)return console.error("MERCHANT SETTINGS FETCH FAILED!"),[2,i(null)];m=S.data,C.label=3;case 3:return m&&(m.address=null,delete m.merchantAddress),v=c[e],y=s.routings.find((function(t){return t.id===e||t.path===e})),v&&y?(r.readFile(v,{flag:"a+"},(function(e,r){return o(this,void 0,void 0,(function(){var o,c,f,S,v,C,I;return n(this,(function(n){switch(n.label){case 0:return e?(console.error("THEME LOCALIZATION FILE READ ERROR!!!"),console.error(e),[2,i(null)]):(o=r.length?JSON.parse(r.toString()):{},f=(c=o).themeJson.settings.favicon,S=c.themeJson.settings.stockPreference,c.themeJson.settings?(v=T.createColorScript(c.themeJson.settings),[4,T.createFontScript(c.themeJson.settings)]):[3,2]);case 1:C=n.sent(),v&&u.push(v),C&&u.push(C),n.label=2;case 2:return I=t.customerSettings,i({storefrontType:P.HEADLESS,storefront:s,themeLocalization:c,salesChannel:a,routing:y,favicon:f,stockPreference:S,storefrontJSScripts:l,themeStyleScripts:u,highPriorityStoreFrontJSScripts:p,domain:d,productBackInStockSettings:g,customerReviewSettings:h,merchantSettings:m,customerSettings:I,custom:t.custom,storefrontPopups:t.storefrontPopups,loyaltyPrograms:t.loyaltyPrograms,payWithIkasUrl:t.payWithIkasUrl}),[2]}}))}))})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,i(null)])}}))}))}))]}))}))},T.getSettings=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(e)]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return[4,this.getProdSettings(e)]}}))}))},T.setStorefrontConfig=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){return T.applyStorefrontConfig(e),[2]}))}))},T.applyStorefrontConfig=function(t,o){var n,r;void 0===o&&(o=!1);var i=t.storefront,s=t.salesChannel,a=t.routing,c=t.favicon,l=t.stockPreference,d=t.storefrontJSScripts,f=t.themeStyleScripts,g=t.highPriorityStoreFrontJSScripts,h=t.domain,m=t.productBackInStockSettings,S=t.customerReviewSettings,v=t.merchantSettings,y=t.customerSettings,C=t.custom,P=t.storefrontPopups,T=t.loyaltyPrograms,I=t.payWithIkasUrl,k=t.apiKey;o&&u.clear(),u.init(e(e({},k?{apiKey:k}:{}),{apiUrl:process.env.INTERNAL_GQL_URL||process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL,storefrontId:i.id,storefrontRoutingId:a.id,storefrontThemeId:i.mainStorefrontThemeId,storefrontB2BSettings:i.b2bSettings||void 0,storefrontType:i.type,salesChannelId:i.salesChannelId,priceListId:a.priceListId||void 0,stockLocationIds:null===(n=s.stockLocations)||void 0===n?void 0:n.map((function(e){return e.id})),routings:i.routings,paymentGateways:s.paymentGateways||[],gtmId:i.gtmId||void 0,fbpId:i.fbpId||void 0,analytics4Id:i.analytics4Id||void 0,universalAnalyticsId:i.universalAnalyticsId||void 0,tiktokPixelId:i.tiktokPixelId||void 0,openAiPixelId:i.openAiPixelId||void 0,favicon:c||null,pickUpStockLocationIds:i.pickUpStockLocationIds&&i.pickUpStockLocationIds.length?i.pickUpStockLocationIds:null,stockPreference:l||null,storefrontJSScripts:d||[],themeStyleScripts:f||[],highPriorityStoreFrontJSScripts:g||[],domain:h,productBackInStockSettings:m,customerReviewSettings:S,merchantSettings:v,customerSettings:y,metaTemplates:i.metaTemplates||null,custom:C||null,indexPageSeoSettings:i.indexPageSeoSettings,storefrontPopups:P,loyaltyPrograms:T,payWithIkasUrl:I,milesSmilesSettings:(null===(r=i.socialLoginSettings)||void 0===r?void 0:r.find((function(e){return"miles_smiles"===e.provider})))||null})),p()},T.setTranslations=function(e,r,i,c,l){return o(this,void 0,void 0,(function(){var o,p,d,f,g,h,S,v;return n(this,(function(n){switch(n.label){case 0:return o=s().serverRuntimeConfig,p=e.routing,d="local"===process.env.NEXT_PUBLIC_ENV,f=e.themeLocalization.themeJson.components.filter((function(e){return c||r.includes(e.id)})),g=t(["common"],f.map((function(e){return e.dir})),!0),(i===a.CHECKOUT||c)&&g.push("checkout-page"),h=o.nextI18nConf,S=d&&l?l:p.locale,[4,new m(S,g,d?void 0:h.localePath).read()];case 1:return v=n.sent(),u.init({translations:v}),[2]}}))}))},T.getLocaleJsonNamespace=function(e,t){try{var o="string"==typeof e?JSON.parse(e):e,n=null==o?void 0:o[t];return n&&"object"==typeof n?n:void 0}catch(e){return void console.error("[checkout] localeJson parse error",e)}},T.loadStandaloneCheckoutTranslations=function(e){var t,s,a,c;return o(this,void 0,void 0,(function(){var o,l,u,p,d,f,g;return n(this,(function(n){switch(n.label){case 0:o=e.routing.locale;try{e.storefrontType===P.STUDIO?l=null===(a=null===(s=null===(t=e.projectJson)||void 0===t?void 0:t.i18nTranslations)||void 0===s?void 0:s[o])||void 0===a?void 0:a.checkout_page:!(l=T.getLocaleJsonNamespace(null===(c=e.themeLocalization)||void 0===c?void 0:c.localeJson,S))&&e.deployDir&&(u=i.join(e.deployDir,"public","locales",o),(p=["".concat(S,".json"),"checkout.json"].map((function(e){return i.join(u,e)})).find((function(e){return r.existsSync(e)})))&&(l=T.readJsonFile(p)))}catch(e){console.error("[checkout] Translations read error",e)}n.label=1;case 1:return n.trys.push([1,3,,4]),[4,v(o)];case 2:return d=n.sent(),[3,4];case 3:if(f=n.sent(),console.error("[checkout] Default translations read error",f),!l)throw f;return[3,4];case 4:return[2,(g={},g[S]=l?T.mergeTranslations(d||{},l):d,g)]}}))}))},T.mergeTranslations=function(t,o){var n=e({},t);return Object.entries(o).forEach((function(e){var o=e[0],r=e[1],i=null==t?void 0:t[o];r&&"object"==typeof r&&!Array.isArray(r)?n[o]=i&&"object"==typeof i&&!Array.isArray(i)?T.mergeTranslations(i,r):r:("string"==typeof r&&""!==r||void 0===i&&void 0!==r)&&(n[o]=r)})),n},T.getExtraProps=function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o;return n(this,(function(n){switch(n.label){case 0:return r===a.CHECKOUT&&(null===(i=t.page)||void 0===i?void 0:i.components[0])?[4,g({})]:[2,{}];case 1:return o=n.sent(),[2,T.buildCheckoutExtraProps(e,t,o)]}}))}))},T.buildCheckoutExtraProps=function(e,t,o){var n,r,i,s,a,c,l,u,p,d,f,g,h,m,S,v,y,C,P,T,I,k,L,R,w={},O=e.themeLocalization,E=null===(n=t.page)||void 0===n?void 0:n.components[0];if(E){o.isSuccess||(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(o.graphQLErrors),console.error(o.errorCodes));var b={logo:null!==(r=E.propValues.logo)&&void 0!==r?r:null,showTax:null===(i=E.propValues.showTax)||void 0===i||i,showLoyaltyPoints:null!==(s=E.propValues.showLoyaltyPoints)&&void 0!==s&&s,showCampaignOffersDesign:null!==(a=E.propValues.showCampaignOffersDesign)&&void 0!==a&&a,showCampaignIsBiggerImage:null!==(c=E.propValues.showCampaignIsBiggerImage)&&void 0!==c&&c,campaignOfferIsSmallDesign:null!==(l=E.propValues.campaignOfferIsSmallDesign)&&void 0!==l&&l,showCampaignHideDiscountBadge:null!==(u=E.propValues.showCampaignHideDiscountBadge)&&void 0!==u&&u,campaignOfferCountdownStyleIsLine:null!==(p=E.propValues.campaignOfferCountdownStyleIsLine)&&void 0!==p&&p,campaignOfferCountdownStyleIsLineSuccessPage:null!==(d=E.propValues.campaignOfferCountdownStyleIsLineSuccessPage)&&void 0!==d&&d,campaignOffersEnableMiddlePhase:null!==(f=E.propValues.campaignOffersEnableMiddlePhase)&&void 0!==f&&f,campaignOffersTitleColor:null!==(g=E.propValues.campaignOffersTitleColor)&&void 0!==g?g:null,campaignOffersDescriptionColor:null!==(h=E.propValues.campaignOffersDescriptionColor)&&void 0!==h?h:null,campaignOffersContainerBgColor:null!==(m=E.propValues.campaignOffersContainerBgColor)&&void 0!==m?m:null,campaignOffersDiscountPercentageColor:null!==(S=E.propValues.campaignOffersDiscountPercentageColor)&&void 0!==S?S:null,campaignOffersDiscountPercentageBgColor:null!==(v=E.propValues.campaignOffersDiscountPercentageBgColor)&&void 0!==v?v:null,campaignOffersCountdownTextColor:null!==(y=E.propValues.campaignOffersCountdownTextColor)&&void 0!==y?y:null,campaignOffersCountdownTimeColor:null!==(C=E.propValues.campaignOffersCountdownTimeColor)&&void 0!==C?C:null,campaignOffersCountdownBgColor:null!==(P=E.propValues.campaignOffersCountdownBgColor)&&void 0!==P?P:null,campaignOffersMiddlePhaseOverlayColor:null!==(T=E.propValues.campaignOffersMiddlePhaseOverlayColor)&&void 0!==T?T:null,buttonBgColor:E.propValues.buttonBgColor,buttonTextColor:E.propValues.buttonTextColor,buttonDisabledBgColor:E.propValues.buttonDisabledBgColor,buttonDisabledTextColor:E.propValues.buttonDisabledTextColor,primaryTextColor:E.propValues.primaryTextColor,secondaryTextColor:E.propValues.secondaryTextColor,primaryBgColor:E.propValues.primaryBgColor,secondaryBgColor:E.propValues.secondaryBgColor,borderColor:E.propValues.borderColor,cardBgColor:E.propValues.cardBgColor,errorColor:E.propValues.errorColor,errorLightColor:E.propValues.errorLightColor,warningColor:E.propValues.warningColor,warningLightColor:E.propValues.warningLightColor,successColor:E.propValues.successColor,successLightColor:E.propValues.successLightColor,secondaryButtonBgColor:null!==(I=E.propValues.secondaryButtonBgColor)&&void 0!==I?I:null,secondaryButtonTextColor:null!==(k=E.propValues.secondaryButtonTextColor)&&void 0!==k?k:null,secondaryButtonBorderColor:null!==(L=E.propValues.secondaryButtonBorderColor)&&void 0!==L?L:null};w.customizationProps=b,w.returnPolicy=O.returnPolicy,w.privacyPolicy=O.privacyPolicy,w.termsOfService=O.termsOfService,w.imprint=O.imprint,w.shippingPolicy=O.shippingPolicy,w.checkoutSettings=(null===(R=null==o?void 0:o.data)||void 0===R?void 0:R.length)?o.data[0]:null}return w},T.getPageData=function(t,r,i,s,c){var d;return o(this,void 0,void 0,(function(){var o,f,g,h,m,S,v,y,C;return n(this,(function(n){switch(n.label){case 0:return(o=i===a.CHECKOUT?T.getStandaloneCheckoutRequest(t):null)?[2,T.getStandaloneCheckoutPageData(t,o)]:(f="local"===process.env.NEXT_PUBLIC_ENV,g=!f&&c,u.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_CDN_URL}),p(),g?[3,7]:(h=t.locale)?[4,T.getSettings(h)]:[2,{props:{},notFound:!0}]);case 1:return(m=n.sent())&&m.storefront.mainStorefrontThemeId&&m.storefront.salesChannelId?[4,this.setStorefrontConfig(m)]:[2,{props:{},notFound:!0}];case 2:return n.sent(),S=m.themeLocalization,(v=new l(S.themeJson,t.params,i,m.merchantSettings)).possiblePageTypes=s||(i?[i]:[]),c?[3,4]:[4,v.getPageData()];case 3:if(n.sent(),!v.page)return[2,{props:{},notFound:!0}];n.label=4;case 4:return y=c?v.theme.components.map((function(e){return e.id})):(null===(d=v.page)||void 0===d?void 0:d.components.map((function(e){return e.componentId})))||[],[4,this.setTranslations(m,y,i,c,h)];case 5:return n.sent(),[4,this.getExtraProps(m,v,i)];case 6:return C=n.sent(),r?[2,{props:T.omitPaymentStepScripts(e(e({},v.nextPageData.props),C),t)}]:[2,{props:e(e({},v.nextPageData.props),C),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},T.getStandaloneCheckoutPageData=function(t,r){var i,s;return o(this,void 0,void 0,(function(){var o,c,p,d,f,h,m,S;return n(this,(function(n){switch(n.label){case 0:return o={props:{},notFound:!0},t.locale?[4,T.getStandaloneCheckoutSettings(r)]:[2,o];case 1:return(c=n.sent())&&c.storefront.mainStorefrontThemeId&&c.storefront.salesChannelId?((p=new l(T.getCheckoutThemeJson(c),t.params,a.CHECKOUT,c.merchantSettings)).possiblePageTypes=[a.CHECKOUT],[4,p.getPageData()]):[2,o];case 2:return n.sent(),p.page?(d=T.getStandaloneApiConfig(c.apiKey,c.storefront.id,c.routing.id),[4,Promise.all([g({},d),T.loadStandaloneCheckoutTranslations(c)])]):[2,o];case 3:return f=n.sent(),h=f[0],m=f[1],T.applyStorefrontConfig(c,!0),u.init({translations:m}),S=e(e({},p.nextPageData.props),T.buildCheckoutExtraProps(c,p,h)),(null===(i=S.configJson)||void 0===i?void 0:i.storefrontId)!==c.storefront.id?(console.error("[checkout] CONFIG STOREFRONT MISMATCH",{expected:c.storefront.id,actual:null===(s=S.configJson)||void 0===s?void 0:s.storefrontId}),[2,o]):[2,{props:T.omitPaymentStepScripts(S,t)}]}}))}))},T.omitPaymentStepScripts=function(t,o){var n="query"in o?o.query.step:void 0;return"true"===process.env.NEXT_PUBLIC_RESTRICT_PAYMENT_SCRIPTS&&"payment"===n&&t.configJson?e(e({},t),{configJson:e(e({},t.configJson),{storefrontJSScripts:[],highPriorityStoreFrontJSScripts:[]})}):t},T.getStaticProps=function(e,t,r,i){return o(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,T.getPageData(e,!1,t,r,i)];case 1:return[2,o.sent()]}}))}))},T.getServerSideProps=function(e,t){return o(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,T.getPageData(e,!0,t)];case 1:return[2,o.sent()]}}))}))},T.createColorStyle=function(e){var t;if(null===(t=e.colors)||void 0===t?void 0:t.length){var o=function(e){return"".concat(e).replace(/[<>{};]/g,"")};return"<style>:root{".concat(e.colors.map((function(e){return"".concat(o(e.key),":").concat(o(e.color),";")})).join(""),"}</style>")}},T.createColorScript=function(e){if(e.colors)return"<script>".concat(e.colors.map((function(e){return'document.documentElement.style.setProperty("'.concat(e.key,'","').concat(e.color,'");')})).join("\r\n"),"<\/script> \n ")},T.getCachedFontScript=function(e){return o(this,void 0,void 0,(function(){var t,o,r,i;return n(this,(function(n){switch(n.label){case 0:return(t=h(e.fontFamily))?(o="".concat(t,"|").concat(e.fontFamily.name),(r=T.fontScriptCache.get(o))&&r.expiresAt>Date.now()?[2,r.script]:[4,T.createFontScript(e)]):[2];case 1:return(i=n.sent())&&T.fontScriptCache.set(o,{script:i,expiresAt:Date.now()+864e5}),[2,i]}}))}))},T.createFontScript=function(e){return o(this,void 0,void 0,(function(){var t,o,r;return n(this,(function(n){switch(n.label){case 0:return(t=h(e.fontFamily))?[4,fetch(t,{headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"}})]:[3,3];case 1:return[4,n.sent().text()];case 2:return o=n.sent(),r=o.replace(new RegExp("fonts.gstatic.com","g"),"fonts.myikas.com"),[2,"<style>\n ".concat(r,"\n\n body { \n font-family: '").concat(e.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n\n </style>')];case 3:return[2]}}))}))},T.startTime=Date.now(),T.fontScriptCache=new Map,T}();!function(e){e.STUDIO="studio",e.HEADLESS="headless"}(P||(P={}));export{P as CheckoutStorefrontType,T as IkasNextPageDataProvider};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-next",
|
|
3
|
-
"version": "6.1.0-beta.
|
|
3
|
+
"version": "6.1.0-beta.381",
|
|
4
4
|
"description": "Next.js specific functions for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"next": "12.2.0",
|
|
20
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
21
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
22
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
23
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
24
|
-
"@ikas/storefront-assets": "^6.1.0-beta.
|
|
20
|
+
"@ikas/storefront-config": "^6.1.0-beta.381",
|
|
21
|
+
"@ikas/storefront-providers": "^6.1.0-beta.381",
|
|
22
|
+
"@ikas/storefront-models": "^6.1.0-beta.381",
|
|
23
|
+
"@ikas/storefront-api": "^6.1.0-beta.381",
|
|
24
|
+
"@ikas/storefront-assets": "^6.1.0-beta.381",
|
|
25
25
|
"axios": "^0.26.0",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
27
|
"cors": "^2.8.5",
|
|
28
28
|
"adm-zip": "^0.5.9"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@ikas/storefront-cmd": "^6.1.0-beta.
|
|
32
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
33
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
34
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
35
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
36
|
-
"@ikas/storefront-assets": "^6.1.0-beta.
|
|
31
|
+
"@ikas/storefront-cmd": "^6.1.0-beta.381",
|
|
32
|
+
"@ikas/storefront-config": "^6.1.0-beta.381",
|
|
33
|
+
"@ikas/storefront-providers": "^6.1.0-beta.381",
|
|
34
|
+
"@ikas/storefront-models": "^6.1.0-beta.381",
|
|
35
|
+
"@ikas/storefront-api": "^6.1.0-beta.381",
|
|
36
|
+
"@ikas/storefront-assets": "^6.1.0-beta.381",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
38
38
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
39
39
|
"@rollup/plugin-json": "^4.1.0",
|