@ikas/storefront-providers 4.5.0-beta.5 → 4.5.0-beta.7

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 (109) hide show
  1. package/build/ext/tslib/tslib.es6.js +1 -0
  2. package/build/index.d.ts +20 -0
  3. package/build/index.js +1 -0
  4. package/build/models/prop-value/attribute-list.d.ts +6 -0
  5. package/build/models/prop-value/attribute.d.ts +6 -0
  6. package/build/models/prop-value/blog-category-list.d.ts +6 -0
  7. package/build/models/prop-value/blog-category.d.ts +4 -0
  8. package/build/models/prop-value/blog-list.d.ts +8 -0
  9. package/build/models/prop-value/blog.d.ts +4 -0
  10. package/build/models/prop-value/brand-list.d.ts +8 -0
  11. package/build/models/prop-value/brand.d.ts +4 -0
  12. package/build/models/prop-value/brand.js +1 -0
  13. package/build/models/prop-value/category-list.d.ts +8 -0
  14. package/build/models/prop-value/category.d.ts +4 -0
  15. package/build/models/prop-value/image.d.ts +4 -0
  16. package/build/models/prop-value/link.d.ts +18 -0
  17. package/build/models/prop-value/link.js +1 -0
  18. package/build/models/prop-value/product-list.d.ts +17 -0
  19. package/build/models/prop-value/product.d.ts +5 -0
  20. package/build/models/prop-value/raffle-list.d.ts +4 -0
  21. package/build/models/prop-value/raffle.d.ts +4 -0
  22. package/build/models/ui/blog-category-list/index.d.ts +17 -0
  23. package/build/models/ui/blog-category-list/index.js +1 -0
  24. package/build/models/ui/blog-category-list/init.d.ts +2 -0
  25. package/build/models/ui/blog-category-list/init.js +1 -0
  26. package/build/models/ui/blog-list/index.d.ts +19 -0
  27. package/build/models/ui/blog-list/index.js +1 -0
  28. package/build/models/ui/blog-list/init.d.ts +2 -0
  29. package/build/models/ui/blog-list/init.js +1 -0
  30. package/build/models/ui/brand-list/index.d.ts +22 -0
  31. package/build/models/ui/brand-list/index.js +1 -0
  32. package/build/models/ui/brand-list/init.d.ts +2 -0
  33. package/build/models/ui/brand-list/init.js +1 -0
  34. package/build/models/ui/category-list/index.d.ts +22 -0
  35. package/build/models/ui/category-list/index.js +1 -0
  36. package/build/models/ui/category-list/init.d.ts +2 -0
  37. package/build/models/ui/category-list/init.js +1 -0
  38. package/build/models/ui/component-renderer/index.d.ts +6 -0
  39. package/build/models/ui/customer-review-list/index.d.ts +11 -0
  40. package/build/models/ui/customer-review-list/init.d.ts +2 -0
  41. package/build/models/ui/customer-review-summary-list/index.d.ts +11 -0
  42. package/build/models/ui/customer-review-summary-list/init.d.ts +2 -0
  43. package/build/models/ui/index.d.ts +12 -0
  44. package/build/models/ui/navigation-link/index.d.ts +7 -0
  45. package/build/models/ui/product-attribute-detail/index.d.ts +6 -0
  46. package/build/models/ui/product-attribute-list/index.d.ts +6 -0
  47. package/build/models/ui/product-list/index.d.ts +66 -0
  48. package/build/models/ui/product-list/index.js +1 -0
  49. package/build/models/ui/product-list/init.d.ts +2 -0
  50. package/build/models/ui/product-list/init.js +1 -0
  51. package/build/models/ui/raffle-list/index.d.ts +16 -0
  52. package/build/models/ui/raffle-list/init.d.ts +2 -0
  53. package/build/models/ui/raffle-list/init.js +1 -0
  54. package/build/providers/helpers/raffle.d.ts +3 -0
  55. package/build/providers/helpers/raffle.js +1 -0
  56. package/build/providers/page-data-get.d.ts +32 -0
  57. package/build/providers/page-data-get.js +1 -0
  58. package/build/providers/placeholders.d.ts +7 -0
  59. package/build/providers/placeholders.js +1 -0
  60. package/build/providers/prop-value/attribute-list.d.ts +8 -0
  61. package/build/providers/prop-value/attribute-list.js +1 -0
  62. package/build/providers/prop-value/attribute.d.ts +8 -0
  63. package/build/providers/prop-value/attribute.js +1 -0
  64. package/build/providers/prop-value/blog-category-list.d.ts +8 -0
  65. package/build/providers/prop-value/blog-category-list.js +1 -0
  66. package/build/providers/prop-value/blog-category.d.ts +8 -0
  67. package/build/providers/prop-value/blog-category.js +1 -0
  68. package/build/providers/prop-value/blog-list.d.ts +11 -0
  69. package/build/providers/prop-value/blog-list.js +1 -0
  70. package/build/providers/prop-value/blog.d.ts +8 -0
  71. package/build/providers/prop-value/blog.js +1 -0
  72. package/build/providers/prop-value/boolean.d.ts +6 -0
  73. package/build/providers/prop-value/boolean.js +1 -0
  74. package/build/providers/prop-value/brand-list.d.ts +8 -0
  75. package/build/providers/prop-value/brand-list.js +1 -0
  76. package/build/providers/prop-value/brand.d.ts +8 -0
  77. package/build/providers/prop-value/brand.js +1 -0
  78. package/build/providers/prop-value/category-list.d.ts +8 -0
  79. package/build/providers/prop-value/category-list.js +1 -0
  80. package/build/providers/prop-value/category.d.ts +8 -0
  81. package/build/providers/prop-value/category.js +1 -0
  82. package/build/providers/prop-value/color.d.ts +6 -0
  83. package/build/providers/prop-value/color.js +1 -0
  84. package/build/providers/prop-value/custom.d.ts +42 -0
  85. package/build/providers/prop-value/custom.js +1 -0
  86. package/build/providers/prop-value/image-list.d.ts +8 -0
  87. package/build/providers/prop-value/image-list.js +1 -0
  88. package/build/providers/prop-value/image.d.ts +9 -0
  89. package/build/providers/prop-value/image.js +1 -0
  90. package/build/providers/prop-value/index.d.ts +3 -0
  91. package/build/providers/prop-value/link.d.ts +26 -0
  92. package/build/providers/prop-value/link.js +1 -0
  93. package/build/providers/prop-value/product-detail.d.ts +8 -0
  94. package/build/providers/prop-value/product-detail.js +1 -0
  95. package/build/providers/prop-value/product-list.d.ts +21 -0
  96. package/build/providers/prop-value/product-list.js +1 -0
  97. package/build/providers/prop-value/raffle-list.d.ts +5 -0
  98. package/build/providers/prop-value/raffle-list.js +1 -0
  99. package/build/providers/prop-value/raffle.d.ts +8 -0
  100. package/build/providers/prop-value/raffle.js +1 -0
  101. package/build/providers/prop-value/rich-text.d.ts +6 -0
  102. package/build/providers/prop-value/rich-text.js +1 -0
  103. package/build/providers/prop-value/slider.d.ts +7 -0
  104. package/build/providers/prop-value/slider.js +1 -0
  105. package/build/providers/prop-value/text.d.ts +6 -0
  106. package/build/providers/prop-value/text.js +1 -0
  107. package/build/providers/types.d.ts +66 -0
  108. package/build/providers/types.js +1 -0
  109. package/package.json +12 -12
@@ -0,0 +1 @@
1
+ var n=function(){return n=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},n.apply(this,arguments)};function t(n,t,e,r){return new(e||(e=Promise))((function(o,a){function u(n){try{c(r.next(n))}catch(n){a(n)}}function l(n){try{c(r.throw(n))}catch(n){a(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,l)}c((r=r.apply(n,t||[])).next())}))}function e(n,t){var e,r,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(n,u)}catch(n){a=[6,n],r=0}finally{e=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}export{n as __assign,t as __awaiter,e as __generator};
@@ -0,0 +1,20 @@
1
+ export * from "./models/prop-value/attribute";
2
+ export * from "./models/prop-value/attribute-list";
3
+ export * from "./models/prop-value/blog-category-list";
4
+ export * from "./models/prop-value/blog-category";
5
+ export * from "./models/prop-value/blog-list";
6
+ export * from "./models/prop-value/blog";
7
+ export * from "./models/prop-value/brand-list";
8
+ export * from "./models/prop-value/brand";
9
+ export * from "./models/prop-value/category-list";
10
+ export * from "./models/prop-value/category";
11
+ export * from "./models/prop-value/link";
12
+ export * from "./models/prop-value/product-list";
13
+ export * from "./models/prop-value/product";
14
+ export * from "./models/prop-value/raffle-list";
15
+ export * from "./models/prop-value/raffle";
16
+ export * from "./models/ui";
17
+ export { IkasPageDataProvider } from "./providers/page-data-get";
18
+ export * from "./providers/types";
19
+ export * from "./providers/placeholders";
20
+ export * from "./providers/helpers/raffle";
package/build/index.js ADDED
@@ -0,0 +1 @@
1
+ export{IkasBrandPropValue}from"./models/prop-value/brand.js";export{IkasLinkType}from"./models/prop-value/link.js";export{IkasBlogCategoryListType}from"./models/ui/blog-category-list/index.js";export{IkasBlogListType}from"./models/ui/blog-list/index.js";export{IkasBrandListSortType,IkasBrandListType}from"./models/ui/brand-list/index.js";export{IkasCategoryListSortType,IkasCategoryListType}from"./models/ui/category-list/index.js";export{IkasProductListSortType,IkasProductListType,IkasProductSearchShowStockOption,IkasRelatedProductsType}from"./models/ui/product-list/index.js";export{IkasPageDataProvider}from"./providers/page-data-get.js";export{IkasPageComponentPropValue}from"./providers/types.js";export{getPlaceholderBlog,getPlaceholderBlogCategory,getPlaceholderBrand,getPlaceholderCategory,getPlaceholderProduct,getPlaceholderRaffle}from"./providers/placeholders.js";export{populateRaffleParticipantProducts,populateRaffleProducts}from"./providers/helpers/raffle.js";
@@ -0,0 +1,6 @@
1
+ export declare type IkasAttributeListPropValue = {
2
+ attributeIds?: string[] | null;
3
+ productId?: string | null;
4
+ variantId?: string | null;
5
+ usePageData?: boolean | null;
6
+ };
@@ -0,0 +1,6 @@
1
+ export declare type IkasAttributePropValue = {
2
+ attributeId?: string | null;
3
+ productId?: string | null;
4
+ variantId?: string | null;
5
+ usePageData?: boolean | null;
6
+ };
@@ -0,0 +1,6 @@
1
+ import { IkasBlogCategoryListType } from "../ui";
2
+ export declare type IkasBlogCategoryListPropValue = {
3
+ blogCategoryListType: IkasBlogCategoryListType;
4
+ initialLimit?: number | null;
5
+ blogCategoryIds?: string[] | null;
6
+ };
@@ -0,0 +1,4 @@
1
+ export declare type IkasBlogCategoryPropValue = {
2
+ blogCategoryId?: string | null;
3
+ usePageData?: boolean | null;
4
+ };
@@ -0,0 +1,8 @@
1
+ import { IkasBlogListType } from "../ui";
2
+ export declare type IkasBlogListPropValue = {
3
+ blogListType: IkasBlogListType;
4
+ initialLimit?: number | null;
5
+ blogIds?: string[] | null;
6
+ categoryId: string | null;
7
+ usePageFilter?: boolean | null;
8
+ };
@@ -0,0 +1,4 @@
1
+ export declare type IkasBlogPropValue = {
2
+ blogId?: string | null;
3
+ usePageData?: boolean | null;
4
+ };
@@ -0,0 +1,8 @@
1
+ import { IkasBrandListSortType, IkasBrandListType } from "../ui";
2
+ export declare type IkasBrandListPropValue = {
3
+ brandListType: IkasBrandListType;
4
+ initialSort?: IkasBrandListSortType | null;
5
+ initialLimit?: number | null;
6
+ brandCount?: number | null;
7
+ brandIds?: string[] | null;
8
+ };
@@ -0,0 +1,4 @@
1
+ export declare class IkasBrandPropValue {
2
+ brandId?: string | null;
3
+ usePageData?: boolean | null;
4
+ }
@@ -0,0 +1 @@
1
+ var n=function(){};export{n as IkasBrandPropValue};
@@ -0,0 +1,8 @@
1
+ import { IkasCategoryListSortType, IkasCategoryListType } from "../ui";
2
+ export declare type IkasCategoryListPropValue = {
3
+ categoryListType: IkasCategoryListType;
4
+ initialSort?: IkasCategoryListSortType | null;
5
+ initialLimit?: number | null;
6
+ categoryCount?: number | null;
7
+ categoryIds?: string[] | null;
8
+ };
@@ -0,0 +1,4 @@
1
+ export declare type IkasCategoryPropValue = {
2
+ categoryId?: string | null;
3
+ usePageData?: boolean | null;
4
+ };
@@ -0,0 +1,4 @@
1
+ export declare type IkasImagePropValue = {
2
+ id: string;
3
+ altText: string | null;
4
+ };
@@ -0,0 +1,18 @@
1
+ import { IkasThemeJsonPageType } from "@ikas/storefront-models";
2
+ export declare type IkasLinkPropValue = {
3
+ id?: string | null;
4
+ linkType?: IkasLinkType | null;
5
+ label?: string | null;
6
+ pageId?: string | null;
7
+ pageType?: IkasThemeJsonPageType | null;
8
+ itemId?: string | null;
9
+ externalLink?: string | null;
10
+ fileUrl?: string | null;
11
+ pageComponentId?: string | null;
12
+ subLinks: IkasLinkPropValue[];
13
+ };
14
+ export declare enum IkasLinkType {
15
+ PAGE = "PAGE",
16
+ EXTERNAL = "EXTERNAL",
17
+ FILE = "FILE"
18
+ }
@@ -0,0 +1 @@
1
+ var E;!function(E){E.PAGE="PAGE",E.EXTERNAL="EXTERNAL",E.FILE="FILE"}(E||(E={}));export{E as IkasLinkType};
@@ -0,0 +1,17 @@
1
+ import { IkasProductListSortType, IkasProductListType, IkasRelatedProductsType } from "../ui";
2
+ export declare type IkasProductListPropValue = {
3
+ id: string;
4
+ productListType: IkasProductListType;
5
+ initialSort?: IkasProductListSortType | null;
6
+ initialLimit?: number | null;
7
+ productCount?: number | null;
8
+ productIds?: IkasProductVariantId[] | null;
9
+ usePageFilter?: boolean | null;
10
+ category?: string | null;
11
+ relatedProductsType?: IkasRelatedProductsType | null;
12
+ };
13
+ declare type IkasProductVariantId = {
14
+ productId: string;
15
+ variantId: string;
16
+ };
17
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare type IkasProductPropValue = {
2
+ productId?: string | null;
3
+ variantId?: string | null;
4
+ usePageData?: boolean | null;
5
+ };
@@ -0,0 +1,4 @@
1
+ export declare type IkasRaffleListPropValue = {
2
+ initialLimit?: number | null;
3
+ raffleIds?: string[] | null;
4
+ };
@@ -0,0 +1,4 @@
1
+ export declare type IkasRafflePropValue = {
2
+ raffleId?: string | null;
3
+ usePageData?: boolean | null;
4
+ };
@@ -0,0 +1,17 @@
1
+ import { IkasBlogCategory } from "@ikas/storefront-models";
2
+ import { IkasBlogCategoryListPropValue } from "../../prop-value/blog-category-list";
3
+ export declare type IkasBlogCategoryList = {
4
+ data: IkasBlogCategory[];
5
+ type: IkasBlogCategoryListType;
6
+ limit: number;
7
+ page: number;
8
+ count: number;
9
+ initialized?: boolean;
10
+ minPage?: number | null;
11
+ blogCategoryListPropValue: IkasBlogCategoryListPropValue;
12
+ isLoading?: boolean;
13
+ };
14
+ export declare enum IkasBlogCategoryListType {
15
+ ALL = "ALL",
16
+ STATIC = "STATIC"
17
+ }
@@ -0,0 +1 @@
1
+ var A;!function(A){A.ALL="ALL",A.STATIC="STATIC"}(A||(A={}));export{A as IkasBlogCategoryListType};
@@ -0,0 +1,2 @@
1
+ import { IkasBlogCategoryList } from ".";
2
+ export declare function getInitial(list: IkasBlogCategoryList): Promise<void>;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../../ext/tslib/tslib.es6.js';import{listBlogCategory as i}from"@ikas/storefront-api";import{IkasBlogCategoryListType as r}from"./index.js";function n(i){var r,n,u,l;return t(this,void 0,void 0,(function(){var t,d;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,a(i,e(i)?1:i.page,e(i)?(null===(r=i.blogCategoryListPropValue.blogCategoryIds)||void 0===r?void 0:r.length)||10:i.limit)];case 1:return t=o.sent(),e(i)?i.data=(null===(n=i.blogCategoryListPropValue.blogCategoryIds)||void 0===n?void 0:n.map((function(o){var i,r;return null===(r=null===(i=t.data)||void 0===i?void 0:i.data)||void 0===r?void 0:r.find((function(t){return t.id===o}))})).filter((function(t){return!!t})))||[]:i.data=(null===(u=t.data)||void 0===u?void 0:u.data)||[],i.count=(null===(l=t.data)||void 0===l?void 0:l.count)||0,i.initialized=!0,i.minPage=i.page,[3,3];case 2:return d=o.sent(),console.error(d),[3,3];case 3:return[2]}}))}))}function e(t){return t.type===r.STATIC}function a(r,n,a){return t(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,i({id:e(r)&&r.blogCategoryListPropValue.blogCategoryIds?{in:r.blogCategoryListPropValue.blogCategoryIds}:void 0,pagination:{page:n,limit:a}})];case 1:return[2,t.sent()]}}))}))}export{n as getInitial};
@@ -0,0 +1,19 @@
1
+ import { IkasBlog } from "@ikas/storefront-models";
2
+ import { IkasBlogListPropValue } from "../../prop-value/blog-list";
3
+ export declare type IkasBlogList = {
4
+ data: IkasBlog[];
5
+ type: IkasBlogListType;
6
+ limit: number;
7
+ page: number;
8
+ count: number;
9
+ initialized?: boolean;
10
+ minPage?: number | null;
11
+ blogListPropValue: IkasBlogListPropValue;
12
+ filterCategoryId: string | null;
13
+ isLoading?: boolean;
14
+ };
15
+ export declare enum IkasBlogListType {
16
+ ALL = "ALL",
17
+ STATIC = "STATIC",
18
+ CATEGORY = "CATEGORY"
19
+ }
@@ -0,0 +1 @@
1
+ var A;!function(A){A.ALL="ALL",A.STATIC="STATIC",A.CATEGORY="CATEGORY"}(A||(A={}));export{A as IkasBlogListType};
@@ -0,0 +1,2 @@
1
+ import { IkasBlogList } from ".";
2
+ export declare function getInitial(list: IkasBlogList): Promise<void>;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{listBlog as o}from"@ikas/storefront-api";import{IkasBlogListType as n}from"./index.js";function r(o){var n,r,d,u;return t(this,void 0,void 0,(function(){var t,l;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,a(o,e(o)?1:o.page,e(o)?(null===(n=o.blogListPropValue.blogIds)||void 0===n?void 0:n.length)||10:o.limit)];case 1:return t=i.sent(),e(o)?o.data=(null===(r=o.blogListPropValue.blogIds)||void 0===r?void 0:r.map((function(i){var o,n;return null===(n=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.find((function(t){return t.id===i}))})).filter((function(t){return!!t})))||[]:o.data=(null===(d=t.data)||void 0===d?void 0:d.data)||[],o.count=(null===(u=t.data)||void 0===u?void 0:u.count)||0,o.initialized=!0,o.minPage=o.page,[3,3];case 2:return l=i.sent(),console.error(l),[3,3];case 3:return[2]}}))}))}function e(t){return t.type===n.STATIC}function a(n,r,a){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,o({id:e(n)?{in:n.blogListPropValue.blogIds}:void 0,pagination:{page:r,limit:a},categoryId:n.filterCategoryId?{eq:n.filterCategoryId}:void 0})];case 1:return[2,t.sent()]}}))}))}export{r as getInitial};
@@ -0,0 +1,22 @@
1
+ import { IkasBrand } from "@ikas/storefront-models";
2
+ import { IkasBrandListPropValue } from "../../prop-value/brand-list";
3
+ export declare type IkasBrandList = {
4
+ data: IkasBrand[];
5
+ type: IkasBrandListType;
6
+ sort: IkasBrandListSortType;
7
+ limit: number;
8
+ page: number;
9
+ count: number;
10
+ initialized?: boolean;
11
+ minPage?: number | null;
12
+ brandListPropValue: IkasBrandListPropValue;
13
+ isLoading?: boolean;
14
+ };
15
+ export declare enum IkasBrandListType {
16
+ ALL = "ALL",
17
+ STATIC = "STATIC"
18
+ }
19
+ export declare enum IkasBrandListSortType {
20
+ A_Z = "A_Z",
21
+ Z_A = "Z_A"
22
+ }
@@ -0,0 +1 @@
1
+ var A,n;!function(A){A.ALL="ALL",A.STATIC="STATIC"}(A||(A={})),function(A){A.A_Z="A_Z",A.Z_A="Z_A"}(n||(n={}));export{n as IkasBrandListSortType,A as IkasBrandListType};
@@ -0,0 +1,2 @@
1
+ import { IkasBrandList } from ".";
2
+ export declare function getInitial(list: IkasBrandList): Promise<void>;
@@ -0,0 +1 @@
1
+ import{__awaiter as n,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{listProductBrand as t}from"@ikas/storefront-api";import{IkasBrandListType as r,IkasBrandListSortType as o}from"./index.js";function a(o){var a,d,u;return n(this,void 0,void 0,(function(){var n,s,l;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=function(n){return n.type===r.STATIC}(o),[4,t({id:n&&o.brandListPropValue.brandIds?{in:o.brandListPropValue.brandIds}:void 0,pagination:{page:n?void 0:o.page,limit:n?void 0:o.limit},sort:e(o)})];case 1:return s=i.sent(),o.data=n?(null===(a=o.brandListPropValue.brandIds)||void 0===a?void 0:a.map((function(n){var i,t;return null===(t=null===(i=s.data)||void 0===i?void 0:i.data)||void 0===t?void 0:t.find((function(i){return i.id===n}))})).filter((function(n){return!!n})))||[]:(null===(d=s.data)||void 0===d?void 0:d.data)||[],o.count=(null===(u=s.data)||void 0===u?void 0:u.count)||0,o.initialized=!0,o.minPage=o.page,[3,3];case 2:return l=i.sent(),console.error(l),[3,3];case 3:return[2]}}))}))}function e(n){return n.sort===o.A_Z?"name":"-name"}export{a as getInitial};
@@ -0,0 +1,22 @@
1
+ import { IkasCategory } from "@ikas/storefront-models";
2
+ import { IkasCategoryListPropValue } from "../../prop-value/category-list";
3
+ export declare type IkasCategoryList = {
4
+ data: IkasCategory[];
5
+ type: IkasCategoryListType;
6
+ sort: IkasCategoryListSortType;
7
+ limit: number;
8
+ page: number;
9
+ count: number;
10
+ initialized?: boolean;
11
+ minPage?: number | null;
12
+ categoryListPropValue: IkasCategoryListPropValue;
13
+ isLoading?: boolean;
14
+ };
15
+ export declare enum IkasCategoryListType {
16
+ ALL = "ALL",
17
+ STATIC = "STATIC"
18
+ }
19
+ export declare enum IkasCategoryListSortType {
20
+ A_Z = "A_Z",
21
+ Z_A = "Z_A"
22
+ }
@@ -0,0 +1 @@
1
+ var A,n;!function(A){A.ALL="ALL",A.STATIC="STATIC"}(A||(A={})),function(A){A.A_Z="A_Z",A.Z_A="Z_A"}(n||(n={}));export{n as IkasCategoryListSortType,A as IkasCategoryListType};
@@ -0,0 +1,2 @@
1
+ import { IkasCategoryList } from ".";
2
+ export declare function getInitial(list: IkasCategoryList): Promise<void>;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{listCategory as o}from"@ikas/storefront-api";import{IkasCategoryListType as r,IkasCategoryListSortType as n}from"./index.js";function e(r){var n,e,u;return t(this,void 0,void 0,(function(){var t,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,o({id:a(r)&&r.categoryListPropValue.categoryIds?{in:r.categoryListPropValue.categoryIds}:void 0,pagination:{page:a(r)?void 0:r.page,limit:a(r)?void 0:r.limit},sort:d(r)})];case 1:return t=i.sent(),a(r)?r.data=(null===(n=r.categoryListPropValue.categoryIds)||void 0===n?void 0:n.map((function(i){var o,r;return null===(r=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===r?void 0:r.find((function(t){return t.id===i}))})).filter((function(t){return!!t})))||[]:r.data=(null===(e=t.data)||void 0===e?void 0:e.data)||[],r.count=(null===(u=t.data)||void 0===u?void 0:u.count)||0,r.initialized=!0,r.minPage=r.page,[3,3];case 2:return s=i.sent(),console.error(s),[3,3];case 3:return[2]}}))}))}function a(t){return t.type===r.STATIC}function d(t){return t.sort===n.A_Z?"name":"-name"}export{e as getInitial};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare type RenderFunction = () => React.ReactNode;
3
+ export declare type IkasComponentRenderer = {
4
+ render: RenderFunction;
5
+ };
6
+ export {};
@@ -0,0 +1,11 @@
1
+ import { IkasCustomerReview } from "@ikas/storefront-models";
2
+ export declare type IkasCustomerReviewList = {
3
+ data: IkasCustomerReview[];
4
+ limit: number;
5
+ page: number;
6
+ count: number;
7
+ initialized?: boolean;
8
+ minPage?: number | null;
9
+ productId: string;
10
+ isLoading?: boolean;
11
+ };
@@ -0,0 +1,2 @@
1
+ import { IkasCustomerReviewList } from ".";
2
+ export declare function getInitial(list: IkasCustomerReviewList): Promise<void>;
@@ -0,0 +1,11 @@
1
+ import { IkasCustomerReviewSummary } from "@ikas/storefront-models";
2
+ export declare type IkasCustomerReviewSummaryList = {
3
+ data: IkasCustomerReviewSummary[];
4
+ limit: number;
5
+ page: number;
6
+ count: number;
7
+ initialized?: boolean;
8
+ minPage?: number | null;
9
+ productId: string;
10
+ isLoading?: boolean;
11
+ };
@@ -0,0 +1,2 @@
1
+ import { IkasCustomerReviewSummaryList } from ".";
2
+ export declare function getInitial(list: IkasCustomerReviewSummaryList): Promise<void>;
@@ -0,0 +1,12 @@
1
+ export * from "./blog-category-list";
2
+ export * from "./blog-list";
3
+ export * from "./brand-list";
4
+ export * from "./category-list";
5
+ export * from "./component-renderer";
6
+ export * from "./customer-review-list";
7
+ export * from "./customer-review-summary-list";
8
+ export * from "./navigation-link";
9
+ export * from "./product-attribute-detail";
10
+ export * from "./product-attribute-list";
11
+ export * from "./product-list";
12
+ export * from "./raffle-list";
@@ -0,0 +1,7 @@
1
+ export declare type IkasNavigationLink = {
2
+ href: string;
3
+ label: string;
4
+ subLinks: IkasNavigationLink[];
5
+ isExternal?: boolean | null;
6
+ itemId?: string;
7
+ };
@@ -0,0 +1,6 @@
1
+ import { IkasProduct } from "@ikas/storefront-models";
2
+ import { IkasAttributePropValue } from "../../prop-value/attribute";
3
+ export declare type IkasProductAttributeDetail = {
4
+ productDetail: IkasProduct | null;
5
+ attributePropValue: IkasAttributePropValue;
6
+ };
@@ -0,0 +1,6 @@
1
+ import { IkasProduct } from "@ikas/storefront-models";
2
+ import { IkasAttributeListPropValue } from "../../prop-value/attribute-list";
3
+ export declare type IkasAttributeList = {
4
+ productDetail: IkasProduct | null;
5
+ attributeListPropValue: IkasAttributeListPropValue;
6
+ };
@@ -0,0 +1,66 @@
1
+ import { IkasBrand, IkasCategory, IkasFilterCategory, IkasProduct, IkasProductFilter, IkasThemeJsonPageType } from "@ikas/storefront-models";
2
+ import { IkasRelatedProductProps, IkasViewedTogetherProductProps } from "../../../providers/prop-value/product-list";
3
+ import { IkasProductListPropValue } from "../../prop-value/product-list";
4
+ export declare type IkasProductList = {
5
+ data: IkasProduct[];
6
+ filters: IkasProductFilter[] | null;
7
+ filterCategories?: IkasFilterCategory[] | null;
8
+ type: IkasProductListType;
9
+ pageType: IkasThemeJsonPageType;
10
+ sort: IkasProductListSortType;
11
+ limit: number;
12
+ page: number;
13
+ infiniteScrollPage: number | null;
14
+ count: number;
15
+ searchKeyword?: string;
16
+ initialized?: boolean;
17
+ minPage?: number | null;
18
+ productListPropValue: IkasProductListPropValue;
19
+ filterBrandId?: string | null;
20
+ filterCategoryId?: string | null;
21
+ relatedProductData?: IkasRelatedProductProps | null;
22
+ viewedTogetherProductData?: IkasViewedTogetherProductProps | null;
23
+ pageSpecificData: IkasCategory | IkasBrand | null;
24
+ recommendFor?: string | null;
25
+ isLoading?: boolean;
26
+ fetchRequestTime?: number;
27
+ };
28
+ export declare enum IkasProductListType {
29
+ ALL = "ALL",
30
+ STATIC = "STATIC",
31
+ DISCOUNTED = "DISCOUNTED",
32
+ RECOMMENDED = "RECOMMENDED",
33
+ CATEGORY = "CATEGORY",
34
+ SEARCH = "SEARCH",
35
+ LAST_VIEWED = "LAST_VIEWED",
36
+ RELATED_PRODUCTS = "RELATED_PRODUCTS",
37
+ VIEWED_TOGETHER = "VIEWED_TOGETHER"
38
+ }
39
+ export declare enum IkasProductListSortType {
40
+ INCREASING_PRICE = "INCREASING_PRICE",
41
+ DECREASING_PRICE = "DECREASING_PRICE",
42
+ LAST_ADDED = "LAST_ADDED",
43
+ FIRST_ADDED = "FIRST_ADDED",
44
+ INCREASING_DISCOUNT = "INCREASING_DISCOUNT",
45
+ DECRASING_DISCOUNT = "DECRASING_DISCOUNT",
46
+ FEATURED = "FEATURED",
47
+ DEFAULT = "DEFAULT"
48
+ }
49
+ export declare enum IkasRelatedProductsType {
50
+ CATEGORY = "CATEGORY",
51
+ BRAND = "BRAND"
52
+ }
53
+ export declare enum IkasProductSearchShowStockOption {
54
+ HIDE_OUT_OF_STOCK = "HIDE_OUT_OF_STOCK",
55
+ SHOW_ALL = "SHOW_ALL",
56
+ SHOW_OUT_OF_STOCK_AT_END = "SHOW_OUT_OF_STOCK_AT_END"
57
+ }
58
+ export declare type Facet = {
59
+ id: string;
60
+ values: FacetValue[];
61
+ };
62
+ export declare type FacetValue = {
63
+ id: string;
64
+ count: number;
65
+ };
66
+ export type { IkasRelatedProductProps, IkasViewedTogetherProductProps };
@@ -0,0 +1 @@
1
+ var E,D,T,A;!function(E){E.ALL="ALL",E.STATIC="STATIC",E.DISCOUNTED="DISCOUNTED",E.RECOMMENDED="RECOMMENDED",E.CATEGORY="CATEGORY",E.SEARCH="SEARCH",E.LAST_VIEWED="LAST_VIEWED",E.RELATED_PRODUCTS="RELATED_PRODUCTS",E.VIEWED_TOGETHER="VIEWED_TOGETHER"}(E||(E={})),function(E){E.INCREASING_PRICE="INCREASING_PRICE",E.DECREASING_PRICE="DECREASING_PRICE",E.LAST_ADDED="LAST_ADDED",E.FIRST_ADDED="FIRST_ADDED",E.INCREASING_DISCOUNT="INCREASING_DISCOUNT",E.DECRASING_DISCOUNT="DECRASING_DISCOUNT",E.FEATURED="FEATURED",E.DEFAULT="DEFAULT"}(D||(D={})),function(E){E.CATEGORY="CATEGORY",E.BRAND="BRAND"}(T||(T={})),function(E){E.HIDE_OUT_OF_STOCK="HIDE_OUT_OF_STOCK",E.SHOW_ALL="SHOW_ALL",E.SHOW_OUT_OF_STOCK_AT_END="SHOW_OUT_OF_STOCK_AT_END"}(A||(A={}));export{D as IkasProductListSortType,E as IkasProductListType,A as IkasProductSearchShowStockOption,T as IkasRelatedProductsType};
@@ -0,0 +1,2 @@
1
+ import { IkasProductList } from "../product-list";
2
+ export declare function getInitial(list: IkasProductList, isInfiteScrollReturn?: boolean): Promise<true | undefined>;
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as t,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as i,IkasCategoryProductsOrderType as n}from"@ikas/storefront-models";import{IkasProductListType as a,IkasProductSearchShowStockOption as o,IkasProductListSortType as u}from"./index.js";import{IkasProductFilterFunctions as d}from"@ikas/storefront-model-functions";import{searchProducts as s,getSuggestedProducts as l,GetSuggestedProductsMethodEnum as c,getProductFilterData as f,SortByDirectionEnum as v,SortByTypeEnum as p}from"@ikas/storefront-api";import{IkasStorefrontConfig as I}from"@ikas/storefront-config";import"../blog-category-list/index.js";import"../blog-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";function C(i,o){var s,l,c,f;return e(this,void 0,void 0,(function(){var e,v,p,I,C,A,y;return t(this,(function(t){switch(t.label){case 0:!function(e){var t;if((null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&[a.ALL].includes(e.type))switch(e.pageSpecificData.orderType){case n.HIGHEST_DISCOUNT_RATIO:e.sort=u.DECRASING_DISCOUNT;break;case n.LOWEST_DISCOUNT_RATIO:e.sort=u.INCREASING_DISCOUNT;break;case n.HIGHEST_PRICE:e.sort=u.DECREASING_PRICE;break;case n.LOWEST_PRICE:e.sort=u.INCREASING_PRICE;break;case n.NEWEST:e.sort=u.LAST_ADDED;break;case n.OLDEST:e.sort=u.FIRST_ADDED;break;case n.MANUALLY:e.sort=u.FEATURED}}(i),i.isLoading=!0,e=Date.now(),i.fetchRequestTime=e,t.label=1;case 1:return t.trys.push([1,5,,6]),v=o?i.page:1,p=i.limit,!function(e){return e.type===a.ALL||e.type===a.CATEGORY}(i)||i.filters?[3,3]:[4,g(i)];case 2:t.sent(),t.label=3;case 3:if(D(i))return i.data=[],i.page=1,i.minPage=1,i.count=0,i.initialized=!0,[2,!0];if(void 0,E(i))v=void 0,p=200;else if(function(e){return e.type===a.DISCOUNTED}(i))v=1,p=10;else if(function(e){return e.type===a.RECOMMENDED}(i))v=1,p=10;else if(T(i))return[2];return[4,S(i,v||1,p||10,undefined)];case 4:return(I=t.sent())&&i.fetchRequestTime===e?(C=[],T(i)?[2]:(E(i)?(A=i.productListPropValue.productIds||[],C=(null==A?void 0:A.map((function(e){var t,i,n=null===(i=null===(t=I.data)||void 0===t?void 0:t.data)||void 0===i?void 0:i.find((function(t){return t.id===e.productId})),a=null==n?void 0:n.variants.find((function(t){return t.id===e.variantId}));if((null==a?void 0:a.isActive)||(a=null==n?void 0:n.variants.find((function(e){return e.isActive}))),n&&a)return r(r({},n),{selectedVariantValues:a.variantValues})})).filter((function(e){return!!e})))||[]):C=(null===(l=null===(s=I.data)||void 0===s?void 0:s.data)||void 0===l?void 0:l.map((function(e){var t=e.variants.find((function(e){return e.isActive}));return r(r({},e),{selectedVariantValues:(t||e.variants[0]).variantValues})})))||[],function(e,t){var r,i,n=d.isCustomValueFilter;null===(r=e.filters)||void 0===r||r.forEach((function(e){var r,i,a,o=null==t?void 0:t.find((function(t){return t.id===e.id}));o?null===(r=e.values)||void 0===r||r.forEach((function(t){var r=o.values.find((function(e){return e.id===t.id}));r?t.resultCount=r.count:n(e)?t.resultCount=null:t.resultCount=0})):n(e)?null===(i=e.values)||void 0===i||i.forEach((function(e){return e.resultCount=null})):null===(a=e.values)||void 0===a||a.forEach((function(e){return e.resultCount=0}))}));var a=null==t?void 0:t.find((function(e){return"category"===e.id}));a&&(null===(i=e.filterCategories)||void 0===i||i.forEach((function(e){var t=a.values.find((function(t){return t.id===e.id}));e.resultCount=t?t.count:0})))}(i,null===(c=I.data)||void 0===c?void 0:c.facets),i.data=C,i.count=(null===(f=I.data)||void 0===f?void 0:f.count)||0,i.initialized=!0,i.page=v||1,i.minPage=i.page,[2,!0])):[2];case 5:return y=t.sent(),console.error(y),[3,6];case 6:return[2]}}))}))}function E(e){return e.type===a.STATIC}function T(e){return e.type===a.LAST_VIEWED}function D(e){return e.type===a.SEARCH}function S(r,n,f,C){var T,S,g;return e(this,void 0,void 0,(function(){var e,A,y,R,h;return t(this,(function(t){switch(t.label){case 0:return e=[],A=[],y=d.getValueList,null===(T=r.filters)||void 0===T||T.forEach((function(t){var r=y(t);r.length&&e.push({id:t.id,type:t.type,displayType:t.displayType,valueList:r}),t.isFacetFilter&&A.push({id:t.id,type:t.type,displayType:t.displayType})})),R=null===(S=r.filterCategories)||void 0===S?void 0:S.filter((function(e){return e.isSelected})).map((function(e){return e.id})),h=function(e){var t,r;switch(e.sort){case u.INCREASING_PRICE:t=v.ASC,r=p.PRICE;break;case u.DECREASING_PRICE:t=v.DESC,r=p.PRICE;break;case u.FIRST_ADDED:t=v.ASC,r=p.CREATED_AT;break;case u.LAST_ADDED:t=v.DESC,r=p.CREATED_AT;break;case u.INCREASING_DISCOUNT:t=v.ASC,r=p.DISCOUNT_RATIO;break;case u.DECRASING_DISCOUNT:t=v.DESC,r=p.DISCOUNT_RATIO;break;case u.FEATURED:if(D(e))return;t=v.ASC,r=p.MANUAL_SORT;break;case u.DEFAULT:t=void 0,r=void 0}if(t&&r)return{direction:t,type:r}}(r),function(e){return e.type===a.RELATED_PRODUCTS}(r)&&r.relatedProductData?[4,l({priceListId:I.getPriceListId(),salesChannelId:I.getSalesChannelId(),productId:r.relatedProductData.productId,brandIds:r.relatedProductData.brandIds,categoryIds:r.relatedProductData.categoryIds,locale:I.getCurrentLocale()})]:[3,2];case 1:case 3:case 5:return[2,t.sent()];case 2:return function(e){return e.type===a.VIEWED_TOGETHER}(r)&&r.viewedTogetherProductData?[4,l({priceListId:I.getPriceListId(),salesChannelId:I.getSalesChannelId(),method:c.VIEWED_TOGETHER,productIds:r.viewedTogetherProductData.productIds,locale:I.getCurrentLocale()})]:[3,4];case 4:return[4,s({input:{page:n,perPage:f,productIdList:E(r)?null===(g=r.productListPropValue.productIds)||void 0===g?void 0:g.map((function(e){return e.productId})):C,filterList:e,facetList:A,brandId:r.pageType===i.BRAND&&r.type!==a.SEARCH?r.filterBrandId:void 0,categoryIdList:R&&R.length?R:r.filterCategoryId?[r.filterCategoryId]:void 0,priceListId:I.getPriceListId(),salesChannelId:I.getSalesChannelId(),query:r.searchKeyword,order:r.type===a.SEARCH?[]:h?[h]:[],showStockOption:I.getStockPreference()||o.SHOW_ALL}})]}}))}))}function g(r){var n,a,o;return e(this,void 0,void 0,(function(){var e,u;return t(this,(function(t){switch(t.label){case 0:return[4,f({categoryId:r.filterCategoryId?r.filterCategoryId:void 0,locale:I.getCurrentLocale()})];case 1:return e=t.sent(),r.filters=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.filters)||null,r.filterCategories=(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.categories)||null,r.pageType!==i.CATEGORY&&r.filterCategoryId&&(u=null===(o=r.filterCategories)||void 0===o?void 0:o.find((function(e){return e.id===r.filterCategoryId})))&&(u.isSelected=!0),r.filters&&r.filters.sort((function(e,t){return e.order>t.order?1:-1})),[2]}}))}))}export{C as getInitial};
@@ -0,0 +1,16 @@
1
+ import { IkasRaffle } from "@ikas/storefront-models";
2
+ export declare type IkasRaffleList = {
3
+ data: IkasRaffle[];
4
+ limit: number;
5
+ page: number;
6
+ count: number;
7
+ initialized?: boolean;
8
+ minPage?: number | null;
9
+ start?: number | null;
10
+ end?: number | null;
11
+ includeDeleted?: boolean | null;
12
+ name?: string | null;
13
+ search?: string | null;
14
+ id?: string | null;
15
+ isLoading?: boolean;
16
+ };
@@ -0,0 +1,2 @@
1
+ import { IkasRaffleList } from ".";
2
+ export declare function getInitial(list: IkasRaffleList): Promise<void>;
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as t}from'./../../../ext/tslib/tslib.es6.js';import{listStorefrontRaffle as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as r}from"@ikas/storefront-config";import{initIkasRaffle as n}from"@ikas/storefront-models";import{populateRaffleProducts as o}from"../../../providers/helpers/raffle.js";function a(i){var r,n;return e(this,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:if(i.isLoading)return[2];i.isLoading=!0,t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,s(i,i.page,i.limit)];case 2:return e=t.sent(),i.data=(null===(r=e.data)||void 0===r?void 0:r.data)||[],i.count=(null===(n=e.data)||void 0===n?void 0:n.count)||0,i.initialized=!0,i.minPage=i.page,[3,5];case 3:return o=t.sent(),console.log(o),[3,5];case 4:return i.isLoading=!1,[7];case 5:return[2]}}))}))}function s(a,s,d){var u;return e(this,void 0,void 0,(function(){var e,l;return t(this,(function(t){switch(t.label){case 0:return[4,i({start:a.start?{eq:a.start}:void 0,end:a.end?{eq:a.end}:void 0,includeDeleted:a.includeDeleted||!1,name:a.name?{eq:a.name}:void 0,id:a.id?{eq:a.id}:void 0,search:a.search||void 0,pagination:{limit:d,page:s}})];case 1:return e=t.sent(),l=null===(u=e.data)||void 0===u?void 0:u.data,[4,o(l||[])];case 2:return t.sent(),null==l||l.forEach((function(e){return n(e,r.getCurrentLocale())})),[2,e]}}))}))}export{a as getInitial};
@@ -0,0 +1,3 @@
1
+ import { IkasRaffle, IkasRaffleParticipant } from "@ikas/storefront-models";
2
+ export declare const populateRaffleProducts: (raffles: IkasRaffle[]) => Promise<void>;
3
+ export declare const populateRaffleParticipantProducts: (raffleParticipants: IkasRaffleParticipant[]) => Promise<void>;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';import{listProductOptionSet as r,searchProducts as i}from"@ikas/storefront-api";var u=function(u){return t(void 0,void 0,void 0,(function(){var t,d,o,a,e,c,f,s,l,p,v;return n(this,(function(n){switch(n.label){case 0:for(t=[],d=0,o=u;d<o.length;d++)a=o[d],null===(p=a.variants)||void 0===p||p.forEach((function(n){t.find((function(t){return t===n.productId}))||t.push(n.productId)}));return[4,i({input:{productIdList:t}})];case 1:return(e=n.sent()).isSuccess&&(c=(null===(v=e.data)||void 0===v?void 0:v.data)||[]).length?(f=c.map((function(t){return t.productOptionSetId})).filter((function(t){return!!t})),[4,r({id:{in:f}})]):[3,3];case 2:s=n.sent(),l=s.data,u.forEach((function(t){var n;null===(n=t.variants)||void 0===n||n.forEach((function(n){var r,i=c.find((function(t){return n.productId===t.id}));if(i){i.productOptionSet=null==l?void 0:l.find((function(t){return t.id===i.productOptionSetId}));var u=i.variants.find((function(t){return t.isActive&&n.variantId===t.id}))||i.variants[0];(null===(r=t.products)||void 0===r?void 0:r.find((function(t){return t.id===i.id})))||(i.selectedVariantValues=u.variantValues,i.variants=i.variants.filter((function(n){var r;return null===(r=t.variants)||void 0===r?void 0:r.find((function(t){return t.variantId===n.id}))})),t.products||(t.products=[]),t.products.push(i))}}))})),n.label=3;case 3:return[2]}}))}))},d=function(u){return t(void 0,void 0,void 0,(function(){var t,d,o,a,e,c,f;return n(this,(function(n){switch(n.label){case 0:return(t=u.filter((function(t){return!!t.appliedProduct.productId})).map((function(t){return t.appliedProduct.productId})))&&t.length?[4,i({input:{productIdList:t}})]:[3,3];case 1:return(d=n.sent())&&((o=null===(f=d.data)||void 0===f?void 0:f.data)&&o&&o.length)?(a=o.map((function(t){return t.productOptionSetId})).filter((function(t){return!!t})),[4,r({id:{in:a}})]):[3,3];case 2:e=n.sent(),c=e.data,u.forEach((function(t){var n=o.find((function(n){return n.id===t.appliedProduct.productId})),r=(null==n?void 0:n.variants.find((function(n){return n.isActive&&t.appliedProduct.variantId===n.id})))||(null==n?void 0:n.variants[0]);n&&r&&(n.productOptionSet=null==c?void 0:c.find((function(t){return t.id===n.productOptionSetId})),n.selectedVariantValues=r.variantValues,t.raffle&&(t.raffle.products?t.raffle.products.push(n):t.raffle.products=[n]))})),n.label=3;case 3:return[2]}}))}))};export{d as populateRaffleParticipantProducts,u as populateRaffleProducts};
@@ -0,0 +1,32 @@
1
+ import { IkasThemeJson, IkasThemeJsonPageType, IkasThemeJsonPageComponent, IkasThemeJsonComponentProp, IkasThemeJsonPage, IkasMerchantSettings, IkasCustomerReviewSummary, IkasThemeJsonPageSpecification } from "@ikas/storefront-models";
2
+ import { IkasLinkMetaDataTargetId } from "./prop-value/link";
3
+ import { IkasPageComponentPropValue } from "./types";
4
+ export declare class IkasPageDataProvider {
5
+ theme: IkasThemeJson;
6
+ pageType?: IkasThemeJsonPageType | null;
7
+ pageParams: Record<string, any>;
8
+ private pageComponentPropValues;
9
+ pageSpecificData?: any | null;
10
+ merchantSettings?: IkasMerchantSettings | null;
11
+ possiblePageTypes?: IkasThemeJsonPageType[];
12
+ linkMetaDataTargetIds: IkasLinkMetaDataTargetId[];
13
+ productReviewSummary: IkasCustomerReviewSummary | null;
14
+ constructor(theme: IkasThemeJson, pageParams?: Record<string, any>, pageType?: IkasThemeJsonPageType);
15
+ get page(): IkasThemeJsonPage | undefined;
16
+ get nextPageData(): {
17
+ props: any;
18
+ };
19
+ get specification(): IkasThemeJsonPageSpecification | undefined;
20
+ get pageComponents(): IkasThemeJsonPageComponent[];
21
+ get $pageComponentPropValues(): IkasPageComponentPropValue[];
22
+ getMerchantSettings(): Promise<void>;
23
+ getPageData(): Promise<void>;
24
+ getProductReviewSummary(): Promise<void>;
25
+ getPageSpecificData(): Promise<void>;
26
+ getPageComponentPropValues(pageComponent: IkasThemeJsonPageComponent): Promise<IkasPageComponentPropValue>;
27
+ getPageComponentPropValue(pageComponent: IkasThemeJsonPageComponent, prop: IkasThemeJsonComponentProp): Promise<any>;
28
+ private setPageMetaData;
29
+ setLinkSlugs(): Promise<[void, void, void]>;
30
+ private getLinkSlugs;
31
+ private getFlatCustomData;
32
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as t,__assign as a}from'./../ext/tslib/tslib.es6.js';import r from"lodash/uniq";import n from"lodash/flatten";import{makeAutoObservable as i}from"mobx";import{IkasThemeJsonPageType as s,IkasRaffleMetadataTargetType as o,IkasBlogMetaDataTargetType as u,IkasHTMLMetaDataTargetType as c,IkasThemeJsonComponentPropType as p}from"@ikas/storefront-models";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{IkasProductFunctions as d}from"@ikas/storefront-model-functions";import{IkasProductListPropValueProvider as h}from"./prop-value/product-list.js";import{IkasProductPropValueProvider as g}from"./prop-value/product-detail.js";import{IkasBrandListPropValueProvider as f}from"./prop-value/brand-list.js";import{IkasBrandPropValueProvider as v}from"./prop-value/brand.js";import{IkasLinkPropValueProvider as m}from"./prop-value/link.js";import{IkasImageListPropValueProvider as T}from"./prop-value/image-list.js";import{IkasTextPropValueProvider as S}from"./prop-value/text.js";import{IkasColorPropValueProvider as y}from"./prop-value/color.js";import{IkasBooleanPropValueProvider as D}from"./prop-value/boolean.js";import{IkasImagePropValueProvider as L}from"./prop-value/image.js";import{IkasCategoryPropValueProvider as O}from"./prop-value/category.js";import{IkasCategoryListPropValueProvider as P}from"./prop-value/category-list.js";import{IkasCustomPropValueProvider as b}from"./prop-value/custom.js";import{IkasSliderPropValueProvider as I}from"./prop-value/slider.js";import{IkasRichTextPropValueProvider as w}from"./prop-value/rich-text.js";import{IkasBlogPropValueProvider as C}from"./prop-value/blog.js";import{IkasBlogListPropValueProvider as R}from"./prop-value/blog-list.js";import{IkasAttributePropValueProvider as E}from"./prop-value/attribute.js";import{IkasAttributeListPropValueProvider as A}from"./prop-value/attribute-list.js";import{IkasBlogCategoryPropValueProvider as V}from"./prop-value/blog-category.js";import{IkasBlogCategoryListPropValueProvider as j}from"./prop-value/blog-category-list.js";import{IkasRafflePropValueProvider as G}from"./prop-value/raffle.js";import{IkasRaffleListPropValueProvider as F}from"./prop-value/raffle-list.js";import{listMerchantSettings as _,listCustomerReviewSummary as B,listProductOptionSet as M,searchProducts as k,listProductBrand as U,listCategory as N,listBlog as q,listBlogCategory as Y,listStorefrontRaffle as x,listHTMLMetaData as J,listRaffleMetaData as K,listBlogMetaData as X}from"@ikas/storefront-api";import{populateRaffleProducts as H}from"./helpers/raffle.js";var $=function(){function $(e,t,a){this.pageType=null,this.pageParams={},this.pageComponentPropValues=[],this.pageSpecificData=null,this.merchantSettings=null,this.possiblePageTypes=[],this.linkMetaDataTargetIds=[],this.productReviewSummary=null,this.theme=e,this.pageParams=t||{},this.pageType=a,i(this)}return Object.defineProperty($.prototype,"page",{get:function(){var e=this;if(this.pageType===s.CUSTOM){var t=this.pageParams.slug;return this.theme.pages.find((function(e){return e.type===s.CUSTOM&&e.slug===t}))}return this.theme.pages.find((function(t){return t.type===e.pageType}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"nextPageData",{get:function(){var e,t,r,n,i,o=[],u=[];return this.pageComponentPropValues.forEach((function(e){if(u.push({pageComponent:{id:e.pageComponent.id,componentId:e.pageComponent.componentId},propValues:e.propValues}),!o.find((function(t){return t.id===e.component.id}))){var t=a({},e.component);t.props.forEach((function(e){delete e.description,delete e.displayName,delete e.translations,delete e.groupId})),delete t.translations,delete t.defaultPropValues,delete t.displayName,delete t.description,delete t.dir,o.push(t)}})),{props:JSON.parse(JSON.stringify({propValues:u,themeJsonComponents:o,customDataList:this.theme.customData,pageSpecificData:this.pageSpecificData||null,pageType:(null===(e=this.page)||void 0===e?void 0:e.type)||s.CUSTOM,pageTitle:(null===(t=this.page)||void 0===t?void 0:t.pageTitle)||null,pageDescription:(null===(r=this.page)||void 0===r?void 0:r.description)||null,canonicals:(null===(n=this.page)||void 0===n?void 0:n.canonicals)||null,disableIndex:(null===(i=this.page)||void 0===i?void 0:i.disableIndex)||null,settings:this.theme.settings||{},productReviewSummary:this.productReviewSummary,configJson:l.toJSON(),merchantSettings:this.getMerchantSettings()}))}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"specification",{get:function(){var e,t,a=this,r=this.page;return(null==r?void 0:r.type)===s.PRODUCT?null===(e=r.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=a.pageSpecificData)||void 0===t?void 0:t.id)})):null===(t=null==r?void 0:r.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=a.pageSpecificData)||void 0===t?void 0:t.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"$pageComponentPropValues",{get:function(){return this.pageComponentPropValues},enumerable:!1,configurable:!0}),$.prototype.getMerchantSettings=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,_({})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.merchantSettings=e.data),[2]}}))}))},$.prototype.getPageData=function(){return e(this,void 0,void 0,(function(){var e,a=this;return t(this,(function(t){switch(t.label){case 0:return this.pageSpecificData?[3,2]:[4,this.getPageSpecificData()];case 1:t.sent(),t.label=2;case 2:return this.page?[4,this.getMerchantSettings()]:[2];case 3:return t.sent(),e=this,[4,Promise.all(this.pageComponents.map((function(e){return a.getPageComponentPropValues(e)})))];case 4:return e.pageComponentPropValues=t.sent(),[4,this.setLinkSlugs()];case 5:return t.sent(),[4,this.getProductReviewSummary()];case 6:return t.sent(),[2]}}))}))},$.prototype.getProductReviewSummary=function(){var a,r,n;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageType!==s.PRODUCT?[3,2]:[4,B({productId:{eq:null===(a=this.pageSpecificData)||void 0===a?void 0:a.id}})];case 1:(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)&&(this.productReviewSummary=e.data.data[0]),t.label=2;case 2:return[2]}}))}))},$.prototype.getPageSpecificData=function(){var a,r,n,i;return e(this,void 0,void 0,(function(){var p,h,g,f,v,m,T,S,y,D,L=this;return t(this,(function(O){switch(O.label){case 0:return this.pageType&&![s.BRAND,s.PRODUCT,s.CATEGORY,s.BLOG,s.BLOG_CATEGORY,s.RAFFLE_DETAIL].includes(this.pageType)?[2]:(p=this.pageParams.slug)?(h=[],(null===(a=this.possiblePageTypes)||void 0===a?void 0:a.includes(s.BLOG))||(null===(r=this.possiblePageTypes)||void 0===r?void 0:r.includes(s.BLOG_CATEGORY))?[4,X({slug:{eq:p}})]:[3,2]):[2];case 1:return g=O.sent(),(h=(null===(n=g.data)||void 0===n?void 0:n.data)||[]).length?[3,6]:[2];case 2:return(null===(i=this.possiblePageTypes)||void 0===i?void 0:i.includes(s.RAFFLE_DETAIL))?[4,K({slug:{eq:p}})]:[3,4];case 3:return g=O.sent(),(h=g.data||[]).length?[3,6]:[2];case 4:return[4,J({slug:{eq:p}})];case 5:if(g=O.sent(),!(h=g.data||[])||!h.length)return[2];O.label=6;case 6:if(!(f=h[0]).targetId)return[2];switch(v=function(){return e(L,void 0,void 0,(function(){var e,a,r,n,i,o,u,c,p,h,g;return t(this,(function(t){switch(t.label){case 0:return[4,k({input:{productIdList:[f.targetId],priceListId:l.getPriceListId(),salesChannelId:l.getSalesChannelId()}})];case 1:return e=t.sent(),(null===(h=null===(p=null==e?void 0:e.data)||void 0===p?void 0:p.data)||void 0===h?void 0:h.length)?(a=e.data.data[0]).productOptionSetId?[4,M({id:{eq:a.productOptionSetId}})]:[3,3]:[2];case 2:(r=t.sent()).isSuccess&&(null===(g=null==r?void 0:r.data)||void 0===g?void 0:g.length)&&(a.productOptionSet=r.data[0]),t.label=3;case 3:return(n=a.variants.find((function(e){return e.isActive})))?(a.selectedVariantValues=n.variantValues,i=d.getDisplayedVariantTypes,this.pageSpecificData=a,(o=i(this.pageSpecificData,a.selectedVariantValues)).length&&(u=o[0]).displayedVariantValues.length&&(c=u.displayedVariantValues.find((function(e){return e.hasStock})))&&(this.pageSpecificData.selectedVariantValues=c.variant.variantValues),this.pageType=s.PRODUCT,this.setPageMetaData(f),[2]):[2]}}))}))},m=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,U({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BRAND,this.setPageMetaData(f),[2]):[2]}}))}))},T=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,N({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},S=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,q({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BLOG,this.setPageMetaData(f),[2]):[2]}}))}))},y=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,Y({id:{eq:f.targetId},pagination:{page:1,limit:1}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BLOG_CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},D=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,x({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],[4,H([a])]):[2];case 2:return t.sent(),this.pageSpecificData=a,this.pageType=s.RAFFLE_DETAIL,this.setPageMetaData(f),[2]}}))}))},f.targetType){case c.BRAND:return[3,7];case c.CATEGORY:return[3,9];case c.PRODUCT:return[3,11];case u.BLOG:return[3,13];case u.BLOG_CATEGORY:return[3,15];case o.RAFFLE:return[3,17]}return[3,19];case 7:return[4,m()];case 8:return[2,O.sent()];case 9:return[4,T()];case 10:return[2,O.sent()];case 11:return[4,v()];case 12:return[2,O.sent()];case 13:return[4,S()];case 14:return[2,O.sent()];case 15:return[4,y()];case 16:return[2,O.sent()];case 17:return[4,D()];case 18:return[2,O.sent()];case 19:return[3,20];case 20:return[2]}}))}))},$.prototype.getPageComponentPropValues=function(a){return e(this,void 0,void 0,(function(){var r,n,i,s=this;return t(this,(function(o){switch(o.label){case 0:return r=this.theme.components.find((function(e){return e.id===a.componentId})),n={pageComponent:a,component:r,propValues:{}},i=function(r){return e(s,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return e=n.propValues,i=r.name,[4,this.getPageComponentPropValue(a,r)];case 1:return e[i]=t.sent(),[2]}}))}))},[4,Promise.all(r.props.map(i))];case 1:return o.sent(),[2,n]}}))}))},$.prototype.getPageComponentPropValue=function(a,r){return e(this,void 0,void 0,(function(){var e,n,i,s,o,u=this;return t(this,(function(t){switch(t.label){case 0:if(n=a.propValues[r.name],i=[p.RAFFLE_LIST],null==n&&!i.includes(r.type))return[2,null];switch(r.type){case p.TEXT:return[3,1];case p.RICH_TEXT:return[3,2];case p.BOOLEAN:return[3,3];case p.IMAGE:return[3,4];case p.IMAGE_LIST:return[3,5];case p.BRAND:return[3,6];case p.BRAND_LIST:return[3,7];case p.PRODUCT_LIST:return[3,8];case p.PRODUCT_DETAIL:return[3,9];case p.PRODUCT_ATTRIBUTE:return[3,10];case p.PRODUCT_ATTRIBUTE_LIST:return[3,11];case p.CATEGORY:return[3,12];case p.CATEGORY_LIST:return[3,13];case p.LINK:case p.LIST_OF_LINK:return[3,14];case p.COLOR:return[3,15];case p.CUSTOM:return[3,16];case p.COMPONENT:case p.COMPONENT_LIST:return[3,17];case p.BLOG:return[3,19];case p.BLOG_LIST:return[3,20];case p.BLOG_CATEGORY:return[3,21];case p.BLOG_CATEGORY_LIST:return[3,22];case p.RAFFLE:return[3,23];case p.RAFFLE_LIST:return[3,24];case p.SLIDER:return[3,25]}return[3,26];case 1:return e=new S(n),[3,27];case 2:return e=new w(n),[3,27];case 3:return e=new D(n),[3,27];case 4:return e=new L(n),[3,27];case 5:return e=new T(n),[3,27];case 6:return e=new v(n),[3,27];case 7:return e=new f(n),[3,27];case 8:return e=new h(this.pageType,n,this.pageSpecificData),[3,27];case 9:return e=new g(n),[3,27];case 10:return e=new E(n),[3,27];case 11:return e=new A(n),[3,27];case 12:return e=new O(n),[3,27];case 13:return e=new P(n),[3,27];case 14:return e=new m(n,this.theme,this.linkMetaDataTargetIds),[3,27];case 15:return e=new y(n),[3,27];case 16:return(s=this.theme.customData.find((function(e){return e.id===r.customDataId})))?(e=new b(n,s,this.theme,this.pageType,this,this.pageSpecificData,this.pageParams),[3,27]):[2];case 17:return o=n,[4,Promise.all(o.map((function(e){return u.getPageComponentPropValues(e)})))];case 18:case 28:return[2,t.sent()];case 19:return e=new C(n),[3,27];case 20:return e=new R(this.pageType,n,this.pageSpecificData),[3,27];case 21:return e=new V(n),[3,27];case 22:return e=new j(n),[3,27];case 23:return e=new G(n),[3,27];case 24:return e=new F,[3,27];case 25:return e=new I(n),[3,27];case 26:return[3,27];case 27:return[4,null==e?void 0:e.getValue()]}}))}))},$.prototype.setPageMetaData=function(e){this.page&&(this.page.pageTitle=e.pageTitle||null,this.page.description=e.description||null,this.page.canonicals=e.canonicals||null,this.page.disableIndex=e.disableIndex||null)},$.prototype.setLinkSlugs=function(){return e(this,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=[],a=[],r=[],this.linkMetaDataTargetIds.forEach((function(t){switch(t.type){case"DEFAULT":e.push(t);break;case"BLOG":a.push(t);break;case"RAFFLE":r.push(t)}})),[4,Promise.all([this.getLinkSlugs(e,"DEFAULT"),this.getLinkSlugs(a,"BLOG"),this.getLinkSlugs(r,"RAFFLE")])];case 1:return[2,t.sent()]}}))}))},$.prototype.getLinkSlugs=function(a,n){return e(this,void 0,void 0,(function(){var i,s,o=this;return t(this,(function(u){switch(u.label){case 0:return i=r(a.map((function(e){return e.id}))),s=[],i.length?[4,function(){return e(o,void 0,void 0,(function(){var e,a,r,o,u;return t(this,(function(t){switch(t.label){case 0:switch(e=[],n){case"DEFAULT":return[3,1];case"BLOG":return[3,3];case"RAFFLE":return[3,5]}return[3,7];case 1:return[4,J({targetId:{in:i}})];case 2:return a=t.sent(),e=a.data||[],[3,8];case 3:return[4,X({targetId:{in:i}})];case 4:return r=t.sent(),e=(null===(u=r.data)||void 0===u?void 0:u.data)||[],[3,8];case 5:return[4,K({targetId:{in:i}})];case 6:return o=t.sent(),e=o.data||[],[3,8];case 7:return[3,8];case 8:return e.length&&(s=e),[2]}}))}))}()]:[2];case 1:return u.sent(),a.forEach((function(e){var t=s.find((function(t){return t.targetId===e.id}));t&&(e.navigationLink.href+=t.slug)})),[2]}}))}))},$.prototype.getFlatCustomData=function(e){var t=this;if(!e.nestedData||!e.nestedData.length)return[e];var a=n(e.nestedData.map((function(e){return t.getFlatCustomData(e)}))),r=[];return r.push(e),r=r.concat(a)},$}();export{$ as IkasPageDataProvider};
@@ -0,0 +1,7 @@
1
+ import { IkasBlog, IkasBlogCategory, IkasBrand, IkasCategory, IkasProduct, IkasRaffle } from "@ikas/storefront-models";
2
+ export declare function getPlaceholderProduct(): IkasProduct;
3
+ export declare function getPlaceholderCategory(): IkasCategory;
4
+ export declare function getPlaceholderBrand(): IkasBrand;
5
+ export declare function getPlaceholderBlog(): IkasBlog;
6
+ export declare function getPlaceholderBlogCategory(): IkasBlogCategory;
7
+ export declare function getPlaceholderRaffle(): IkasRaffle;