@ikas/storefront-next 4.0.0-alpha.8 → 4.0.0-alpha.80

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.
Files changed (187) hide show
  1. package/build/api/getComponentDirs.d.ts +3 -0
  2. package/build/api/getComponentDirs.js +1 -0
  3. package/build/api/getTheme.d.ts +3 -0
  4. package/build/api/getTheme.js +1 -0
  5. package/{src/api/index.ts → build/api/index.d.ts} +11 -14
  6. package/build/api/index.js +1 -0
  7. package/build/api/middleware.d.ts +3 -0
  8. package/build/api/middleware.js +1 -0
  9. package/build/api/updateTheme.d.ts +9 -0
  10. package/build/api/updateTheme.js +1 -0
  11. package/build/api/uploadTheme.d.ts +3 -0
  12. package/build/api/uploadTheme.js +1 -0
  13. package/build/ext/tslib/tslib.es6.js +1 -0
  14. package/{src/index.ts → build/index.d.ts} +4 -4
  15. package/build/index.js +1 -0
  16. package/build/packages/cmd/build/_virtual/_cloneBuffer.js +1 -0
  17. package/build/packages/cmd/build/_virtual/_commonjsHelpers.js +1 -0
  18. package/build/packages/cmd/build/_virtual/_nodeUtil.js +1 -0
  19. package/build/packages/cmd/build/_virtual/isBuffer.js +1 -0
  20. package/build/packages/cmd/build/ext/lodash/_DataView.js +1 -0
  21. package/build/packages/cmd/build/ext/lodash/_Hash.js +1 -0
  22. package/build/packages/cmd/build/ext/lodash/_ListCache.js +1 -0
  23. package/build/packages/cmd/build/ext/lodash/_Map.js +1 -0
  24. package/build/packages/cmd/build/ext/lodash/_MapCache.js +1 -0
  25. package/build/packages/cmd/build/ext/lodash/_Promise.js +1 -0
  26. package/build/packages/cmd/build/ext/lodash/_Set.js +1 -0
  27. package/build/packages/cmd/build/ext/lodash/_SetCache.js +1 -0
  28. package/build/packages/cmd/build/ext/lodash/_Symbol.js +1 -0
  29. package/build/packages/cmd/build/ext/lodash/_Uint8Array.js +1 -0
  30. package/build/packages/cmd/build/ext/lodash/_WeakMap.js +1 -0
  31. package/build/packages/cmd/build/ext/lodash/_arrayIncludes.js +1 -0
  32. package/build/packages/cmd/build/ext/lodash/_arrayIncludesWith.js +1 -0
  33. package/build/packages/cmd/build/ext/lodash/_arrayLikeKeys.js +1 -0
  34. package/build/packages/cmd/build/ext/lodash/_assocIndexOf.js +1 -0
  35. package/build/packages/cmd/build/ext/lodash/_baseClone.js +1 -0
  36. package/build/packages/cmd/build/ext/lodash/_baseFindIndex.js +1 -0
  37. package/build/packages/cmd/build/ext/lodash/_baseGetTag.js +1 -0
  38. package/build/packages/cmd/build/ext/lodash/_baseIndexOf.js +1 -0
  39. package/build/packages/cmd/build/ext/lodash/_baseIsArguments.js +1 -0
  40. package/build/packages/cmd/build/ext/lodash/_baseIsNaN.js +1 -0
  41. package/build/packages/cmd/build/ext/lodash/_baseIsNative.js +1 -0
  42. package/build/packages/cmd/build/ext/lodash/_baseUniq.js +1 -0
  43. package/build/packages/cmd/build/ext/lodash/_cacheHas.js +1 -0
  44. package/build/packages/cmd/build/ext/lodash/_cloneBuffer.js +1 -0
  45. package/build/packages/cmd/build/ext/lodash/_cloneSymbol.js +1 -0
  46. package/build/packages/cmd/build/ext/lodash/_coreJsData.js +1 -0
  47. package/build/packages/cmd/build/ext/lodash/_createSet.js +1 -0
  48. package/build/packages/cmd/build/ext/lodash/_defineProperty.js +1 -0
  49. package/build/packages/cmd/build/ext/lodash/_freeGlobal.js +1 -0
  50. package/build/packages/cmd/build/ext/lodash/_getMapData.js +1 -0
  51. package/build/packages/cmd/build/ext/lodash/_getNative.js +1 -0
  52. package/build/packages/cmd/build/ext/lodash/_getRawTag.js +1 -0
  53. package/build/packages/cmd/build/ext/lodash/_getTag.js +1 -0
  54. package/build/packages/cmd/build/ext/lodash/_getValue.js +1 -0
  55. package/build/packages/cmd/build/ext/lodash/_hashClear.js +1 -0
  56. package/build/packages/cmd/build/ext/lodash/_hashDelete.js +1 -0
  57. package/build/packages/cmd/build/ext/lodash/_hashGet.js +1 -0
  58. package/build/packages/cmd/build/ext/lodash/_hashHas.js +1 -0
  59. package/build/packages/cmd/build/ext/lodash/_hashSet.js +1 -0
  60. package/build/packages/cmd/build/ext/lodash/_isKeyable.js +1 -0
  61. package/build/packages/cmd/build/ext/lodash/_isMasked.js +1 -0
  62. package/build/packages/cmd/build/ext/lodash/_listCacheClear.js +1 -0
  63. package/build/packages/cmd/build/ext/lodash/_listCacheDelete.js +1 -0
  64. package/build/packages/cmd/build/ext/lodash/_listCacheGet.js +1 -0
  65. package/build/packages/cmd/build/ext/lodash/_listCacheHas.js +1 -0
  66. package/build/packages/cmd/build/ext/lodash/_listCacheSet.js +1 -0
  67. package/build/packages/cmd/build/ext/lodash/_mapCacheClear.js +1 -0
  68. package/build/packages/cmd/build/ext/lodash/_mapCacheDelete.js +1 -0
  69. package/build/packages/cmd/build/ext/lodash/_mapCacheGet.js +1 -0
  70. package/build/packages/cmd/build/ext/lodash/_mapCacheHas.js +1 -0
  71. package/build/packages/cmd/build/ext/lodash/_mapCacheSet.js +1 -0
  72. package/build/packages/cmd/build/ext/lodash/_nativeCreate.js +1 -0
  73. package/build/packages/cmd/build/ext/lodash/_nodeUtil.js +1 -0
  74. package/build/packages/cmd/build/ext/lodash/_objectToString.js +1 -0
  75. package/build/packages/cmd/build/ext/lodash/_root.js +1 -0
  76. package/build/packages/cmd/build/ext/lodash/_setCacheAdd.js +1 -0
  77. package/build/packages/cmd/build/ext/lodash/_setCacheHas.js +1 -0
  78. package/build/packages/cmd/build/ext/lodash/_setToArray.js +1 -0
  79. package/build/packages/cmd/build/ext/lodash/_strictIndexOf.js +1 -0
  80. package/build/packages/cmd/build/ext/lodash/_toSource.js +1 -0
  81. package/build/packages/cmd/build/ext/lodash/eq.js +1 -0
  82. package/build/packages/cmd/build/ext/lodash/isArguments.js +1 -0
  83. package/build/packages/cmd/build/ext/lodash/isBuffer.js +1 -0
  84. package/build/packages/cmd/build/ext/lodash/isFunction.js +1 -0
  85. package/build/packages/cmd/build/ext/lodash/isMap.js +1 -0
  86. package/build/packages/cmd/build/ext/lodash/isObject.js +1 -0
  87. package/build/packages/cmd/build/ext/lodash/isObjectLike.js +1 -0
  88. package/build/packages/cmd/build/ext/lodash/isSet.js +1 -0
  89. package/build/packages/cmd/build/ext/lodash/isTypedArray.js +1 -0
  90. package/build/packages/cmd/build/ext/lodash/noop.js +1 -0
  91. package/build/packages/cmd/build/ext/lodash/stubFalse.js +1 -0
  92. package/build/packages/cmd/build/ext/lodash/uniq.js +1 -0
  93. package/build/packages/cmd/build/ext/tslib/tslib.es6.js +1 -0
  94. package/build/packages/cmd/build/scripts/generators/api/index.js +1 -0
  95. package/build/packages/cmd/build/scripts/generators/api/info.js +1 -0
  96. package/build/packages/cmd/build/scripts/generators/components/index.js +1 -0
  97. package/build/packages/cmd/build/scripts/generators/pages/index.js +1 -0
  98. package/build/packages/cmd/build/scripts/generators/pages/info.js +1 -0
  99. package/build/packages/cmd/build/scripts/generators/theme/index.js +1 -0
  100. package/build/packages/cmd/build/scripts/generators/types/index.js +1 -0
  101. package/build/packages/cmd/build/utils/fs.js +1 -0
  102. package/build/packages/cmd/build/utils/helper.js +1 -0
  103. package/build/pages/404.d.ts +2 -0
  104. package/build/pages/404.js +1 -0
  105. package/build/pages/[slug]/index.d.ts +3 -0
  106. package/build/pages/_slug_/index.js +1 -0
  107. package/build/pages/account/addresses.d.ts +2 -0
  108. package/build/pages/account/addresses.js +1 -0
  109. package/build/pages/account/favorite-products.d.ts +2 -0
  110. package/build/pages/account/favorite-products.js +1 -0
  111. package/build/pages/account/forgot-password.d.ts +2 -0
  112. package/build/pages/account/forgot-password.js +1 -0
  113. package/build/pages/account/index.d.ts +2 -0
  114. package/build/pages/account/index.js +1 -0
  115. package/build/pages/account/login.d.ts +2 -0
  116. package/build/pages/account/login.js +1 -0
  117. package/build/pages/account/orders/[id].d.ts +2 -0
  118. package/build/pages/account/orders/_id_.js +1 -0
  119. package/build/pages/account/orders/index.d.ts +2 -0
  120. package/build/pages/account/orders/index.js +1 -0
  121. package/build/pages/account/raffles.d.ts +2 -0
  122. package/build/pages/account/raffles.js +1 -0
  123. package/build/pages/account/recover-password.d.ts +2 -0
  124. package/build/pages/account/recover-password.js +1 -0
  125. package/build/pages/account/register.d.ts +2 -0
  126. package/build/pages/account/register.js +1 -0
  127. package/build/pages/blog/[slug].d.ts +3 -0
  128. package/build/pages/blog/_slug_.js +1 -0
  129. package/build/pages/blog/index.d.ts +2 -0
  130. package/build/pages/blog/index.js +1 -0
  131. package/build/pages/cart.d.ts +2 -0
  132. package/build/pages/cart.js +1 -0
  133. package/build/pages/checkout.d.ts +2 -0
  134. package/build/pages/checkout.js +1 -0
  135. package/build/pages/editor.d.ts +2 -0
  136. package/build/pages/editor.js +1 -0
  137. package/build/pages/home.d.ts +2 -0
  138. package/build/pages/home.js +1 -0
  139. package/{src/pages/index.ts → build/pages/index.d.ts} +22 -22
  140. package/build/pages/pages/[slug].d.ts +3 -0
  141. package/build/pages/pages/_slug_.js +1 -0
  142. package/build/pages/raffle/[slug].d.ts +3 -0
  143. package/build/pages/raffle/_slug_.js +1 -0
  144. package/build/pages/raffle/index.d.ts +2 -0
  145. package/build/pages/raffle/index.js +1 -0
  146. package/build/pages/search.d.ts +2 -0
  147. package/build/pages/search.js +1 -0
  148. package/build/provider/page-data-next.d.ts +94 -0
  149. package/build/provider/page-data-next.js +1 -0
  150. package/build/utils/fs.d.ts +28 -0
  151. package/build/utils/fs.js +1 -0
  152. package/build/utils/google-fonts.d.ts +2 -0
  153. package/build/utils/google-fonts.js +1 -0
  154. package/build/utils/i18n.d.ts +9 -0
  155. package/build/utils/i18n.js +1 -0
  156. package/package.json +18 -17
  157. package/src/api/getComponentDirs.ts +0 -39
  158. package/src/api/getTheme.ts +0 -22
  159. package/src/api/middleware.ts +0 -24
  160. package/src/api/updateTheme.ts +0 -33
  161. package/src/api/uploadTheme.ts +0 -307
  162. package/src/pages/404.tsx +0 -18
  163. package/src/pages/[slug]/index.tsx +0 -18
  164. package/src/pages/account/addresses.tsx +0 -10
  165. package/src/pages/account/favorite-products.tsx +0 -10
  166. package/src/pages/account/forgot-password.tsx +0 -10
  167. package/src/pages/account/index.tsx +0 -10
  168. package/src/pages/account/login.tsx +0 -10
  169. package/src/pages/account/orders/[id].tsx +0 -10
  170. package/src/pages/account/orders/index.tsx +0 -10
  171. package/src/pages/account/raffles.tsx +0 -10
  172. package/src/pages/account/recover-password.tsx +0 -10
  173. package/src/pages/account/register.tsx +0 -10
  174. package/src/pages/blog/[slug].tsx +0 -17
  175. package/src/pages/blog/index.tsx +0 -10
  176. package/src/pages/cart.tsx +0 -10
  177. package/src/pages/checkout.tsx +0 -10
  178. package/src/pages/editor.tsx +0 -11
  179. package/src/pages/home.tsx +0 -10
  180. package/src/pages/pages/[slug].tsx +0 -72
  181. package/src/pages/raffle/[slug].tsx +0 -17
  182. package/src/pages/raffle/index.tsx +0 -10
  183. package/src/pages/search.tsx +0 -10
  184. package/src/provider/page-data-next.ts +0 -618
  185. package/src/utils/fs.ts +0 -93
  186. package/src/utils/google-fonts.ts +0 -52
  187. package/src/utils/i18n.ts +0 -80
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.ORDERS)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.RAFFLE_ACCOUNT)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.RECOVER_PASSWORD)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.REGISTER)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,3 @@
1
+ import { GetStaticPaths, GetStaticProps } from "next";
2
+ export declare const getStaticPaths: GetStaticPaths;
3
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import{IkasNextPageDataProvider as i}from"../../provider/page-data-next.js";var n=function(){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{paths:[],fallback:"blocking"}]}))}))},e=function(n){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,i.getStaticProps(n,void 0,[r.BLOG,r.BLOG_CATEGORY])];case 1:return[2,t.sent()]}}))}))};export{n as getStaticPaths,e as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.BLOG_INDEX)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.CART)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.CHECKOUT)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../ext/tslib/tslib.es6.js';import{IkasNextPageDataProvider as r}from"../provider/page-data-next.js";var e=function(e){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,r.getStaticProps(e,void 0,void 0,!0)];case 1:return[2,t.sent()]}}))}))};export{e as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.INDEX)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -1,22 +1,22 @@
1
- export * as IndexPage from "./home";
2
- export * as SlugPage from "./[slug]";
3
- export * as CustomPage from "./pages/[slug]";
4
- export * as CheckoutPage from "./checkout";
5
- export * as AccountPage from "./account/index";
6
- export * as AddressesPage from "./account/addresses";
7
- export * as OrdersPage from "./account/orders";
8
- export * as OrderDetailPage from "./account/orders/[id]";
9
- export * as LoginPage from "./account/login";
10
- export * as RegisterPage from "./account/register";
11
- export * as ForgotPasswordPage from "./account/forgot-password";
12
- export * as RecoverPasswordPage from "./account/recover-password";
13
- export * as CartPage from "./cart";
14
- export * as EditorPage from "./editor";
15
- export * as FavoriteProductsPage from "./account/favorite-products";
16
- export * as SearchPage from "./search";
17
- export * as NotFoundPage from "./404";
18
- export * as BlogPage from "./blog";
19
- export * as BlogSlugPage from "./blog/[slug]";
20
- export * as RafflePage from "./raffle/[slug]";
21
- export * as RafflesPage from "./raffle/index";
22
- export * as AccountRafflesPage from "./account/raffles";
1
+ export * as IndexPage from "./home";
2
+ export * as SlugPage from "./[slug]";
3
+ export * as CustomPage from "./pages/[slug]";
4
+ export * as CheckoutPage from "./checkout";
5
+ export * as AccountPage from "./account/index";
6
+ export * as AddressesPage from "./account/addresses";
7
+ export * as OrdersPage from "./account/orders";
8
+ export * as OrderDetailPage from "./account/orders/[id]";
9
+ export * as LoginPage from "./account/login";
10
+ export * as RegisterPage from "./account/register";
11
+ export * as ForgotPasswordPage from "./account/forgot-password";
12
+ export * as RecoverPasswordPage from "./account/recover-password";
13
+ export * as CartPage from "./cart";
14
+ export * as EditorPage from "./editor";
15
+ export * as FavoriteProductsPage from "./account/favorite-products";
16
+ export * as SearchPage from "./search";
17
+ export * as NotFoundPage from "./404";
18
+ export * as BlogPage from "./blog";
19
+ export * as BlogSlugPage from "./blog/[slug]";
20
+ export * as RafflePage from "./raffle/[slug]";
21
+ export * as RafflesPage from "./raffle/index";
22
+ export * as AccountRafflesPage from "./account/raffles";
@@ -0,0 +1,3 @@
1
+ import { GetStaticProps, GetStaticPaths } from "next";
2
+ export declare const getStaticPaths: GetStaticPaths;
3
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../provider/page-data-next.js";var n=function(n){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return n.locales?[4,Promise.all(n.locales.map((function(t){return e.getSettings(t)})))]:[2,{paths:[],fallback:"blocking"}];case 1:return t=r.sent(),a=[],t.forEach((function(t){var r=t.themeLocalization,e=t.routing;r&&r.themeJson.pages.filter((function(t){return t.type===o.CUSTOM})).forEach((function(t){t.slug&&!a.some((function(r){return r.params.slug===t.slug}))&&("local"===process.env.NEXT_PUBLIC_ENV?a.push({params:{slug:t.slug}}):a.push({params:{slug:t.slug},locale:e.path||e.id}))}))})),[2,{paths:a.map((function(t){return{params:t.params,locale:t.locale}})),fallback:"blocking"}]}}))}))},a=function(n){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(n,o.CUSTOM)];case 1:return[2,t.sent()]}}))}))};export{n as getStaticPaths,a as getStaticProps};
@@ -0,0 +1,3 @@
1
+ import { GetStaticProps, GetStaticPaths } from "next";
2
+ export declare const getStaticPaths: GetStaticPaths;
3
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import{IkasNextPageDataProvider as i}from"../../provider/page-data-next.js";var n=function(){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{paths:[],fallback:"blocking"}]}))}))},e=function(n){return t(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,i.getStaticProps(n,r.RAFFLE_DETAIL)];case 1:return[2,t.sent()]}}))}))};export{n as getStaticPaths,e as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.RAFFLE)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,2 @@
1
+ import { GetStaticProps } from "next";
2
+ export declare const getStaticProps: GetStaticProps;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as r}from'./../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import{IkasNextPageDataProvider as e}from"../provider/page-data-next.js";var i=function(i){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.getStaticProps(i,o.SEARCH)];case 1:return[2,t.sent()]}}))}))};export{i as getStaticProps};
@@ -0,0 +1,94 @@
1
+ /// <reference types="node" />
2
+ import { GetServerSidePropsContext, GetStaticPropsContext } from "next";
3
+ import { ParsedUrlQuery } from "querystring";
4
+ import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannel, IkasStorefront, IkasStorefrontRouting, IkasStorefrontThemeLocalization, IkasThemeJson, IkasThemeJsonFavicon, IkasThemeJsonPageType, IkasThemeJsonSettings, IkasThemeJsonStockPreference } from "@ikas/storefront-models";
5
+ import { IkasPageDataProvider } from "@ikas/storefront-providers";
6
+ import { IkasStorefrontSettings } from "@ikas/storefront-api";
7
+ export declare class IkasNextPageDataProvider {
8
+ static startTime: number;
9
+ static readLocalTheme(): Promise<IkasThemeJson>;
10
+ static readSettingsFile(): Promise<SettingsData | null>;
11
+ static cacheLocalSettingsFile(settings: IkasStorefrontSettings): Promise<void>;
12
+ static readLocalSettingsFile(): any;
13
+ static getLocalSettings(locale: string): Promise<SettingsData | null>;
14
+ static getProdSettings(locale: string): Promise<SettingsData | null>;
15
+ static getSettings(locale: string): Promise<SettingsData | null>;
16
+ static setStorefrontConfig(settings: SettingsData): Promise<void>;
17
+ static setTranslations(settings: SettingsData, componentIds: string[], pageType?: IkasThemeJsonPageType, isEditor?: boolean): Promise<void>;
18
+ static getExtraProps(settings: SettingsData, provider: IkasPageDataProvider, pageType?: IkasThemeJsonPageType): Promise<Record<string, any>>;
19
+ static getPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, isServer: boolean, pageType?: IkasThemeJsonPageType, possiblePageTypes?: IkasThemeJsonPageType[], isEditor?: boolean): Promise<{
20
+ props: {};
21
+ notFound: boolean;
22
+ revalidate?: undefined;
23
+ } | {
24
+ props: any;
25
+ notFound?: undefined;
26
+ revalidate?: undefined;
27
+ } | {
28
+ props: any;
29
+ revalidate: number;
30
+ notFound?: undefined;
31
+ }>;
32
+ static getStaticProps(context: GetStaticPropsContext<ParsedUrlQuery>, pageType?: IkasThemeJsonPageType, possiblePageTypes?: IkasThemeJsonPageType[], isEditor?: boolean): Promise<{
33
+ props: {};
34
+ notFound: boolean;
35
+ revalidate?: undefined;
36
+ } | {
37
+ props: any;
38
+ notFound?: undefined;
39
+ revalidate?: undefined;
40
+ } | {
41
+ props: any;
42
+ revalidate: number;
43
+ notFound?: undefined;
44
+ }>;
45
+ static getServerSideProps(context: GetServerSidePropsContext<ParsedUrlQuery>, pageType?: IkasThemeJsonPageType): Promise<{
46
+ props: {};
47
+ notFound: boolean;
48
+ revalidate?: undefined;
49
+ } | {
50
+ props: any;
51
+ notFound?: undefined;
52
+ revalidate?: undefined;
53
+ } | {
54
+ props: any;
55
+ revalidate: number;
56
+ notFound?: undefined;
57
+ }>;
58
+ static createColorScript(settings: IkasThemeJsonSettings): string | undefined;
59
+ static createFontScript(settings: IkasThemeJsonSettings): string | undefined;
60
+ }
61
+ export declare type SettingsData = {
62
+ storefront: IkasStorefront;
63
+ themeLocalization: IkasStorefrontThemeLocalization;
64
+ salesChannel: IkasSalesChannel;
65
+ routing: IkasStorefrontRouting;
66
+ localizationMap?: Record<string, any>;
67
+ favicon: IkasThemeJsonFavicon;
68
+ stockPreference: IkasThemeJsonStockPreference;
69
+ storefrontJSScripts: string[];
70
+ domain: string;
71
+ productBackInStockSettings: IkasProductBackInStockSettings | null;
72
+ customerReviewSettings: IkasCustomerReviewSettings | null;
73
+ merchantSettings: IkasMerchantSettings;
74
+ customerSettings?: IkasCustomerSettings;
75
+ };
76
+ export declare type IkasCheckoutCustomizationProps = {
77
+ showTax?: boolean;
78
+ buttonBgColor?: string;
79
+ buttonTextColor?: string;
80
+ buttonDisabledBgColor?: string;
81
+ buttonDisabledTextColor?: string;
82
+ primaryTextColor?: string;
83
+ secondaryTextColor?: string;
84
+ primaryBgColor?: string;
85
+ secondaryBgColor?: string;
86
+ borderColor?: string;
87
+ cardBgColor?: string;
88
+ errorColor?: string;
89
+ errorLightColor?: string;
90
+ warningColor?: string;
91
+ warningLightColor?: string;
92
+ successColor?: string;
93
+ successLightColor?: string;
94
+ };
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e,__spreadArray as r,__assign as n}from'./../ext/tslib/tslib.es6.js';import o from"fs";import i from"next/config.js";import{IkasThemeJsonPageType as s}from"@ikas/storefront-models";import{IkasPageDataProvider as c}from"@ikas/storefront-providers";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";import{getStorefrontSettings as u,listMerchantSettings as l,setAPIClientConfig as p,listCheckoutSettings as d}from"@ikas/storefront-api";import{getGoogleFontHref as g}from"../utils/google-fonts.js";import{I18NFileReader as f}from"../utils/i18n.js";import{createFile as m,deleteDirContent as h}from"../utils/fs.js";var S=function(){function S(){}return S.readLocalTheme=function(){return new Promise((function(t,e){o.readFile("./src/theme.json",{flag:"a+"},(function(r,n){if(r)return e(r);var o=n.length?JSON.parse(n.toString()):{};t(o)}))}))},S.readSettingsFile=function(){return new Promise((function(t){var e=i().serverRuntimeConfig.SETTINGS;o.readFile(e,{flag:"a+"},(function(e,r){if(e)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(e),t(null);var n=r.length?JSON.parse(r.toString()):{};t(n)}))}))},S.cacheLocalSettingsFile=function(r){return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return[4,h(t=".ikas")];case 1:return e.sent(),n="settings-".concat(this.startTime,".json"),[4,m(t,n,JSON.stringify(r,null,2))];case 2:return e.sent(),[2]}}))}))},S.readLocalSettingsFile=function(){try{var t=o.readFileSync(".ikas/settings-".concat(this.startTime,".json"));if(t&&t.length)return JSON.parse(t.toString())}catch(t){}},S.getLocalSettings=function(r){return t(this,void 0,void 0,(function(){var t,n,o,i,s,c,a,l,p,d;return e(this,(function(e){switch(e.label){case 0:return[4,S.readLocalSettingsFile()];case 1:return(t=e.sent())?[3,4]:[4,u()];case 2:return(n=e.sent()).isSuccess&&n.data?(t=n.data,[4,this.cacheLocalSettingsFile(t)]):(console.error("Storefront settings fetch failed!"),console.error(n),[2,null]);case 3:e.sent(),e.label=4;case 4:return o=t.storefront,i=t.salesChannel,s=[],c=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,a=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,[4,S.readLocalTheme()];case 5:return l=e.sent(),p=S.createColorScript(l.settings),d=S.createFontScript(l.settings),p&&s.push(p),d&&s.push(d),[2,{storefront:o,themeLocalization:{id:"",locale:"en",privacyPolicy:null,returnPolicy:null,storefrontId:o.id,storefrontThemeId:"",termsOfService:null,imprint:null,shippingPolicy:null,themeJson:l},salesChannel:i,routing:o.routings.length?o.routings.find((function(t){return t.locale===r||t.id===r}))||o.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,domain:"localhost:3333",productBackInStockSettings:c,customerReviewSettings:a,merchantSettings:t.merchantSettings,customerSettings:t.customerSettings}]}}))}))},S.getProdSettings=function(r){return t(this,void 0,void 0,(function(){var n=this;return e(this,(function(i){return[2,new Promise((function(i){return t(n,void 0,void 0,(function(){var t,n,s,c,a,u,p,d,g,f,m,h;return e(this,(function(e){switch(e.label){case 0:return[4,S.readSettingsFile()];case 1:return(t=e.sent())&&t.localizationMap?(n=t.storefront,s=t.salesChannel,c=t.localizationMap,a=t.storefrontJSScripts||[],u=t.domain,p=t.productBackInStockSettings?{customerLoginRequired:t.productBackInStockSettings.customerLoginRequired}:null,d=t.customerReviewSettings?{customerLoginRequired:t.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:t.customerReviewSettings.customerPurchaseRequired||!1}:null,(g=t.merchantSettings)?[3,3]:[4,l({})]):[2,i(null)];case 2:if(!(f=e.sent()).isSuccess||!f.data)return console.error("MERCHANT SETTINGS FETCH FAILED!"),[2,i(null)];g=f.data,e.label=3;case 3:return m=c[r],h=n.routings.find((function(t){return t.id===r||t.path===r})),m&&h?(o.readFile(m,{flag:"a+"},(function(e,r){if(e)return console.error("THEME LOCALIZATION FILE READ ERROR!!!"),console.error(e),i(null);var o=r.length?JSON.parse(r.toString()):{},c=o.themeJson.settings.favicon,l=o.themeJson.settings.stockPreference;if(o.themeJson.settings){var f=S.createColorScript(o.themeJson.settings),m=S.createFontScript(o.themeJson.settings);f&&a.push(f),m&&a.push(m)}var v=t.customerSettings;i({storefront:n,themeLocalization:o,salesChannel:s,routing:h,favicon:c,stockPreference:l,storefrontJSScripts:a,domain:u,productBackInStockSettings:p,customerReviewSettings:d,merchantSettings:g,customerSettings:v})})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,i(null)])}}))}))}))]}))}))},S.getSettings=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(r)]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return[4,this.getProdSettings(r)]}}))}))},S.setStorefrontConfig=function(r){var n;return t(this,void 0,void 0,(function(){var t,o,i,s,c,u,l,d,g,f,m;return e(this,(function(e){return t=r.storefront,o=r.salesChannel,i=r.routing,s=r.favicon,c=r.stockPreference,u=r.storefrontJSScripts,l=r.domain,d=r.productBackInStockSettings,g=r.customerReviewSettings,f=r.merchantSettings,m=r.customerSettings,a.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,adminApiUrl:process.env.NEXT_PUBLIC_UPLOAD_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_IMG_BASE_URL,storefrontId:t.id,storefrontRoutingId:i.id,storefrontThemeId:t.mainStorefrontThemeId,salesChannelId:t.salesChannelId,priceListId:i.priceListId||void 0,stockLocationIds:null===(n=o.stockLocations)||void 0===n?void 0:n.map((function(t){return t.id})),routings:t.routings,paymentGateways:o.paymentGateways||[],gtmId:t.gtmId||void 0,fbpId:t.fbpId||void 0,analytics4Id:t.analytics4Id||void 0,universalAnalyticsId:t.universalAnalyticsId||void 0,tiktokPixelId:t.tiktokPixelId||void 0,favicon:s||null,pickUpStockLocationIds:t.pickUpStockLocationIds&&t.pickUpStockLocationIds.length?t.pickUpStockLocationIds:null,stockPreference:c||null,storefrontJSScripts:u||[],domain:l,productBackInStockSettings:d,customerReviewSettings:g,merchantSettings:f,customerSettings:m,metaTemplates:t.metaTemplates||null}),p(),[2]}))}))},S.setTranslations=function(n,o,c,u){return t(this,void 0,void 0,(function(){var t,l,p,d,g,m,h,S;return e(this,(function(e){switch(e.label){case 0:return t=i().serverRuntimeConfig,l=n.routing,p="local"===process.env.NEXT_PUBLIC_ENV,d=n.themeLocalization.themeJson.components.filter((function(t){return u||o.includes(t.id)})),g=r(["common"],d.map((function(t){return t.dir})),!0),(c===s.CHECKOUT||u)&&g.push("checkout-page"),m=t.nextI18nConf,h=l.locale,[4,new f(h,g,p?void 0:m.localePath).read()];case 1:return S=e.sent(),a.init({translations:S}),[2]}}))}))},S.getExtraProps=function(r,n,o){var i,c,a;return t(this,void 0,void 0,(function(){var t,u,l,p,g;return e(this,(function(e){switch(e.label){case 0:return t={},u=r.themeLocalization,o!==s.CHECKOUT?[3,2]:(l=null===(i=n.page)||void 0===i?void 0:i.components[0])?[4,d({})]:[3,2];case 1:p=e.sent(),g={showTax:null===(c=l.propValues.showTax)||void 0===c||c,buttonBgColor:l.propValues.buttonBgColor,buttonTextColor:l.propValues.buttonTextColor,buttonDisabledBgColor:l.propValues.buttonDisabledBgColor,buttonDisabledTextColor:l.propValues.buttonDisabledTextColor,primaryTextColor:l.propValues.primaryTextColor,secondaryTextColor:l.propValues.secondaryTextColor,primaryBgColor:l.propValues.primaryBgColor,secondaryBgColor:l.propValues.secondaryBgColor,borderColor:l.propValues.borderColor,cardBgColor:l.propValues.cardBgColor,errorColor:l.propValues.errorColor,errorLightColor:l.propValues.errorLightColor,warningColor:l.propValues.warningColor,warningLightColor:l.propValues.warningLightColor,successColor:l.propValues.successColor,successLightColor:l.propValues.successLightColor},t.customizationProps=g,t.returnPolicy=u.returnPolicy,t.privacyPolicy=u.privacyPolicy,t.termsOfService=u.termsOfService,t.imprint=u.imprint,t.shippingPolicy=u.shippingPolicy,t.checkoutSettings=(null===(a=null==p?void 0:p.data)||void 0===a?void 0:a.length)?p.data[0]:null,e.label=2;case 2:return[2,t]}}))}))},S.getPageData=function(r,o,i,s,u){var l;return t(this,void 0,void 0,(function(){var t,d,g,f,m,h,v,C;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,d=!t&&u,a.init({apiUrl:process.env.NEXT_PUBLIC_GQL_URL,adminApiUrl:process.env.NEXT_PUBLIC_UPLOAD_GQL_URL,cdnUrl:process.env.NEXT_PUBLIC_IMG_BASE_URL}),p(),d?[3,7]:(g=r.locale)?[4,S.getSettings(g)]:[2,{props:{},notFound:!0}];case 1:return(f=e.sent())&&f.storefront.mainStorefrontThemeId&&f.storefront.salesChannelId?[4,this.setStorefrontConfig(f)]:[2,{props:{},notFound:!0}];case 2:return e.sent(),m=f.themeLocalization,(h=new c(m.themeJson,r.params,i)).possiblePageTypes=s||(i?[i]:[]),u?[3,4]:[4,h.getPageData()];case 3:if(e.sent(),!h.page)return[2,{props:{},notFound:!0}];e.label=4;case 4:return v=u?h.theme.components.map((function(t){return t.id})):(null===(l=h.page)||void 0===l?void 0:l.components.map((function(t){return t.componentId})))||[],[4,this.setTranslations(f,v,i,u)];case 5:return e.sent(),[4,this.getExtraProps(f,h,i)];case 6:return C=e.sent(),o?[2,{props:n(n({},h.nextPageData.props),C)}]:[2,{props:n(n({},h.nextPageData.props),C),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},S.getStaticProps=function(r,n,o,i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,S.getPageData(r,!1,n,o,i)];case 1:return[2,t.sent()]}}))}))},S.getServerSideProps=function(r,n){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,S.getPageData(r,!0,n)];case 1:return[2,t.sent()]}}))}))},S.createColorScript=function(t){if(t.colors)return"<script>".concat(t.colors.map((function(t){return'document.documentElement.style.setProperty("'.concat(t.key,'","').concat(t.color,'");')})).join("\r\n"),"<\/script> \n ")},S.createFontScript=function(t){var e=g(t.fontFamily);if(e)return'<link id="ikas-font" rel="stylesheet" href="'.concat(e,"\"> \n <style>\n body { \n font-family: '").concat(t.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n </style>')},S.startTime=Date.now(),S}();export{S as IkasNextPageDataProvider};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Divides the given filePath string into directory part and fileName part
3
+ * @param path Path for the file
4
+ */
5
+ export declare function getFilePathParts(path: string): {
6
+ dirParts: string[];
7
+ filePart: string;
8
+ } | {
9
+ filePart: string;
10
+ dirParts?: undefined;
11
+ };
12
+ /**
13
+ * Deletes the contents of the given directory, exluding the ignoreFiles
14
+ * @param dirPath Path for the directory
15
+ * @param ignoreFiles List of files to keep in directory. Does not accept recursive paths, only first level files
16
+ *
17
+ * @returns true for successfull operation, false otherwise
18
+ */
19
+ export declare function deleteDirContent(dirPath: string, ignoreFiles?: string[]): Promise<boolean>;
20
+ /**
21
+ * Creates the given file and directories for the filePath
22
+ * @param basePath Base directory path for the file
23
+ * @param fileSubPath Filename or the sub directory path for the file to write
24
+ * @param fileStr File contents
25
+ *
26
+ * @returns true for successfull operation, false otherwise
27
+ */
28
+ export declare function createFile(basePath: string, fileSubPath: string, fileStr: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ import{__awaiter as r,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.js';import i from"fs";import e from"path";function o(r){var t=r.split("/");return t.length>1?{dirParts:t.slice(0,t.length-1),filePart:t[t.length-1]}:{filePart:r}}function u(n,o){return r(this,void 0,void 0,(function(){return t(this,(function(r){try{return i.readdirSync(n).forEach((function(r){(null==o?void 0:o.includes(r))||i.unlinkSync(e.join(n,r))})),[2,!0]}catch(r){return[2,!1]}return[2]}))}))}function c(u,c,l){var s;return r(this,void 0,void 0,(function(){var r,d,f;return t(this,(function(t){try{return r=u,d=o(c),(null===(s=d.dirParts)||void 0===s?void 0:s.length)&&(r=e.join.apply(e,n([r],d.dirParts,!1))),i.existsSync(r)||i.mkdirSync(r,{recursive:!0}),f=e.join(r,d.filePart),i.writeFileSync(f,l),[2,!0]}catch(r){return console.error(r),[2,!1]}return[2]}))}))}export{c as createFile,u as deleteDirContent,o as getFilePathParts};
@@ -0,0 +1,2 @@
1
+ import { IkasThemeJsonFontFamily } from "@ikas/storefront-models";
2
+ export declare const getGoogleFontHref: (fontFamily: IkasThemeJsonFontFamily) => string | undefined;
@@ -0,0 +1 @@
1
+ var a=function(a){if(a.name){var t=a.name.replace(/ /g,"+"),e="";if(a.variants){e+=":";var r=a.variants.some((function(a){return"italic"===a}));if(r&&(e+="ital,"),e+="wght@",r){var n=new RegExp("italic","i");e+=a.variants.reduce((function(a,t){return n.test(t)?a:a+"0,".concat(t.replace("regular","400"),";")}),""),e+=a.variants.reduce((function(a,t){return n.test(t)?a+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):a}),"")}else e+=a.variants.reduce((function(a,t){return a+"".concat(t.replace("regular","400"),";")}),"");e=e.substring(0,e.length-1),e+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(t).concat(e)}};export{a as getGoogleFontHref};
@@ -0,0 +1,9 @@
1
+ export declare const CHECKOUT_TRANSLATION_NAMESPACE = "checkout-page";
2
+ export declare class I18NFileReader {
3
+ locale: string;
4
+ namespaces: string[];
5
+ localePath?: string;
6
+ constructor(locale: string, namespaces: string[], localePath?: string);
7
+ read(): Promise<Record<string, any>>;
8
+ private readLocaleFile;
9
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as t}from'./../ext/tslib/tslib.es6.js';import s from"fs";import r from"path";var o="checkout-page",n=function(){function o(e,t,s){this.locale=e,this.namespaces=t,this.localePath=s}return o.prototype.read=function(){return e(this,void 0,void 0,(function(){var e,o,n,a,c,i,l,u,h;return t(this,(function(t){switch(t.label){case 0:e={},o=0,n=this.namespaces,t.label=1;case 1:if(!(o<n.length))return[3,14];a=n[o],t.label=2;case 2:return t.trys.push([2,12,,13]),c=this.localePath?r.join(this.localePath,this.locale,a+".json"):r.join(process.cwd(),"public","locales",this.locale,a+".json"),s.existsSync(c)?[4,this.readLocaleFile(c)]:[3,4];case 3:return i=t.sent(),e[a]=i,[3,11];case 4:return"checkout-page"!==a?[3,11]:(l={},"tr"!==this.locale?[3,6]:[4,import("@ikas/storefront-assets/checkout/tr.js")]);case 5:return u=t.sent(),l=u.default,[3,10];case 6:return"de"!==this.locale?[3,8]:[4,import("@ikas/storefront-assets/checkout/de.js")];case 7:return u=t.sent(),l=u.default,[3,10];case 8:return[4,import("@ikas/storefront-assets/checkout/en.js")];case 9:u=t.sent(),l=u.default,t.label=10;case 10:e[a]=l,t.label=11;case 11:return[3,13];case 12:return h=t.sent(),console.error(h),[3,13];case 13:return o++,[3,1];case 14:return[2,e]}}))}))},o.prototype.readLocaleFile=function(r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return[2,new Promise((function(e,t){s.readFile(r,{flag:"r"},(function(s,r){if(s)return t(s);var o=r.length?JSON.parse(r.toString()):{};e(o)}))}))]}))}))},o}();export{o as CHECKOUT_TRANSLATION_NAMESPACE,n as I18NFileReader};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ikas/storefront-next",
3
- "version": "4.0.0-alpha.8",
3
+ "version": "4.0.0-alpha.80",
4
4
  "description": "Next.js specific functions for ikas storefront themes.",
5
5
  "author": "Umut Ozan Yıldırım",
6
6
  "license": "ISC",
7
- "main": "./src/index.ts",
8
- "module": "./src/index.ts",
7
+ "main": "./build/index.js",
8
+ "module": "./build/index.js",
9
9
  "files": [
10
- "./src"
10
+ "./build"
11
11
  ],
12
12
  "type": "module",
13
13
  "scripts": {
@@ -16,33 +16,34 @@
16
16
  "build": "rm -rf build && rollup -c"
17
17
  },
18
18
  "peerDependencies": {
19
- "next": "canary",
20
- "@ikas/storefront-config": "^4.0.0-alpha.8",
21
- "@ikas/storefront-providers": "^4.0.0-alpha.8",
22
- "@ikas/storefront-models": "^4.0.0-alpha.8",
23
- "@ikas/storefront-api": "^4.0.0-alpha.8",
24
- "@ikas/storefront-assets": "^4.0.0-alpha.8",
19
+ "next": "12.2.0",
20
+ "@ikas/storefront-config": "^4.0.0-alpha.80",
21
+ "@ikas/storefront-providers": "^4.0.0-alpha.80",
22
+ "@ikas/storefront-models": "^4.0.0-alpha.80",
23
+ "@ikas/storefront-api": "^4.0.0-alpha.80",
24
+ "@ikas/storefront-assets": "^4.0.0-alpha.80",
25
25
  "axios": "^0.21.0",
26
26
  "lodash": "^4.17.21",
27
27
  "archiver": "^5.3.0",
28
28
  "cors": "^2.8.5"
29
29
  },
30
30
  "devDependencies": {
31
- "@ikas/storefront-cmd": "^4.0.0-alpha.8",
32
- "@ikas/storefront-config": "^4.0.0-alpha.8",
33
- "@ikas/storefront-providers": "^4.0.0-alpha.8",
34
- "@ikas/storefront-models": "^4.0.0-alpha.8",
35
- "@ikas/storefront-api": "^4.0.0-alpha.8",
36
- "@ikas/storefront-assets": "^4.0.0-alpha.8",
31
+ "@ikas/storefront-cmd": "^4.0.0-alpha.80",
32
+ "@ikas/storefront-config": "^4.0.0-alpha.80",
33
+ "@ikas/storefront-providers": "^4.0.0-alpha.80",
34
+ "@ikas/storefront-models": "^4.0.0-alpha.80",
35
+ "@ikas/storefront-api": "^4.0.0-alpha.80",
36
+ "@ikas/storefront-assets": "^4.0.0-alpha.80",
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",
40
+ "rollup-plugin-rename-node-modules": "^1.2.0",
40
41
  "@types/archiver": "^5.1.0",
41
42
  "@types/node": "^14.14.6",
42
43
  "@types/node-fetch": "^2.5.7",
43
44
  "@types/cors": "^2.8.9",
44
45
  "@types/lodash": "^4.14.168",
45
- "next": "canary",
46
+ "next": "12.2.0",
46
47
  "prettier": "^2.2.1",
47
48
  "rollup": "^2.75.6",
48
49
  "rollup-plugin-terser": "^7.0.2",
@@ -1,39 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { NextApiRequest, NextApiResponse } from "next";
4
- import { corsMiddleware } from "./middleware";
5
-
6
- export const getComponentDirs = async (
7
- req: NextApiRequest,
8
- res: NextApiResponse
9
- ) => {
10
- await corsMiddleware(req, res);
11
- const componentDirNames: string[] = await getComponentDirNames();
12
-
13
- res.statusCode = 200;
14
- res.setHeader("Content-Type", "application/json");
15
- res.json({
16
- componentDirNames: componentDirNames.filter(
17
- (name) => name !== "__generated__"
18
- ),
19
- });
20
- };
21
-
22
- export const config = {};
23
-
24
- function getComponentDirNames(): Promise<string[]> {
25
- return new Promise((resolve, reject) => {
26
- const componentsPath = path.join(process.cwd(), "src", "components");
27
-
28
- fs.readdir(componentsPath, function (err, files) {
29
- if (err) {
30
- return reject(err);
31
- }
32
- resolve(
33
- files.filter((file) =>
34
- fs.lstatSync(path.join(componentsPath, file)).isDirectory()
35
- )
36
- );
37
- });
38
- });
39
- }
@@ -1,22 +0,0 @@
1
- import { NextApiRequest, NextApiResponse } from "next";
2
- import { corsMiddleware } from "./middleware";
3
- import { ThemeJsonGenerator } from "@ikas/storefront-cmd";
4
-
5
- export const getTheme = async (req: NextApiRequest, res: NextApiResponse) => {
6
- try {
7
- await corsMiddleware(req, res);
8
- const theme = await ThemeJsonGenerator.getTheme();
9
-
10
- res.statusCode = 200;
11
- res.setHeader("Content-Type", "application/json");
12
- res.json({
13
- theme: theme || {},
14
- });
15
- } catch (err) {
16
- console.error(err);
17
- res.statusCode = 500;
18
- res.send(err);
19
- }
20
- };
21
-
22
- export const config = {};
@@ -1,24 +0,0 @@
1
- import { NextApiRequest, NextApiResponse } from "next";
2
- import Cors from "cors";
3
-
4
- const cors = Cors();
5
-
6
- export function runMiddleware(
7
- req: NextApiRequest,
8
- res: NextApiResponse,
9
- fn: any
10
- ) {
11
- return new Promise((resolve, reject) => {
12
- fn(req, res, (result: any) => {
13
- if (result instanceof Error) {
14
- return reject(result);
15
- }
16
-
17
- return resolve(result);
18
- });
19
- });
20
- }
21
-
22
- export function corsMiddleware(req: NextApiRequest, res: NextApiResponse) {
23
- return runMiddleware(req, res, cors);
24
- }
@@ -1,33 +0,0 @@
1
- import { NextApiRequest, NextApiResponse } from "next";
2
- import { corsMiddleware } from "./middleware";
3
- import { ThemeJsonGenerator } from "@ikas/storefront-cmd";
4
- import { ComponentImportsGenerator } from "@ikas/storefront-cmd";
5
- import { PageGenerator } from "@ikas/storefront-cmd";
6
- import { APIGenerator } from "@ikas/storefront-cmd";
7
- import { CustomDataTypesGenerator } from "@ikas/storefront-cmd";
8
-
9
- export const updateTheme = async (
10
- req: NextApiRequest,
11
- res: NextApiResponse
12
- ) => {
13
- await corsMiddleware(req, res);
14
- const themeJson = req.body;
15
-
16
- await ThemeJsonGenerator.generate(themeJson);
17
- await ComponentImportsGenerator.generate(themeJson);
18
- await PageGenerator.generate();
19
- await APIGenerator.generate();
20
- await CustomDataTypesGenerator.generate(themeJson);
21
-
22
- res.statusCode = 200;
23
- res.setHeader("Content-Type", "application/json");
24
- res.end();
25
- };
26
-
27
- export const config = {
28
- api: {
29
- bodyParser: {
30
- sizeLimit: "50mb",
31
- },
32
- },
33
- };