@ikas/storefront-providers 4.0.0-alpha.75 → 4.0.0-alpha.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1 +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{populateRaffleProducts}from"./providers/helpers/raffle.js";
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";
@@ -1,2 +1,3 @@
1
- import { IkasRaffle } from "@ikas/storefront-models";
1
+ import { IkasRaffle, IkasRaffleParticipant } from "@ikas/storefront-models";
2
2
  export declare const populateRaffleProducts: (raffles: IkasRaffle[]) => Promise<void>;
3
+ export declare const populateRaffleParticipantProducts: (raffleParticipants: IkasRaffleParticipant[]) => Promise<void>;
@@ -1 +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";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";var a=function(a){return t(void 0,void 0,void 0,(function(){var t,u,d,e,c,s,f,l,v,p,h;return n(this,(function(n){switch(n.label){case 0:for(t=[],u=0,d=a;u<d.length;u++)e=d[u],null===(p=e.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,locale:o.getCurrentLocale()}})];case 1:return(c=n.sent()).isSuccess&&(s=(null===(h=c.data)||void 0===h?void 0:h.data)||[]).length?(f=s.map((function(t){return t.productOptionSetId})).filter((function(t){return!!t})),[4,r({id:{in:f}})]):[3,3];case 2:l=n.sent(),v=l.data,a.forEach((function(t){var n;null===(n=t.variants)||void 0===n||n.forEach((function(n){var r=s.find((function(t){return n.productId===t.id}));if(r){r.productOptionSet=null==v?void 0:v.find((function(t){return t.id===r.productOptionSetId}));var i=r.variants.find((function(t){return t.isActive&&n.variantId===t.id}))||r.variants[0];t.products.find((function(t){return t.id===r.id}))||(r.selectedVariantValues=i.variantValues,r.variants=r.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.push(r))}}))})),n.label=3;case 3:return[2]}}))}))};export{a as populateRaffleProducts};
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";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";var o=function(o){return t(void 0,void 0,void 0,(function(){var t,d,a,e,c,f,s,l,p,v,h;return n(this,(function(n){switch(n.label){case 0:for(t=[],d=0,a=o;d<a.length;d++)e=a[d],null===(v=e.variants)||void 0===v||v.forEach((function(n){t.find((function(t){return t===n.productId}))||t.push(n.productId)}));return[4,i({input:{productIdList:t,locale:u.getCurrentLocale()}})];case 1:return(c=n.sent()).isSuccess&&(f=(null===(h=c.data)||void 0===h?void 0:h.data)||[]).length?(s=f.map((function(t){return t.productOptionSetId})).filter((function(t){return!!t})),[4,r({id:{in:s}})]):[3,3];case 2:l=n.sent(),p=l.data,o.forEach((function(t){var n;null===(n=t.variants)||void 0===n||n.forEach((function(n){var r=f.find((function(t){return n.productId===t.id}));if(r){r.productOptionSet=null==p?void 0:p.find((function(t){return t.id===r.productOptionSetId}));var i=r.variants.find((function(t){return t.isActive&&n.variantId===t.id}))||r.variants[0];t.products.find((function(t){return t.id===r.id}))||(r.selectedVariantValues=i.variantValues,r.variants=r.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.push(r))}}))})),n.label=3;case 3:return[2]}}))}))},d=function(u){return t(void 0,void 0,void 0,(function(){var t,o,d,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(o=n.sent())&&((d=null===(f=o.data)||void 0===f?void 0:f.data)&&d&&d.length)?(a=d.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=d.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})),product.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,o as populateRaffleProducts};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront-providers",
3
- "version": "4.0.0-alpha.75",
3
+ "version": "4.0.0-alpha.77",
4
4
  "description": "Data providers for ikas storefront theme components.",
5
5
  "author": "Umut Ozan Yıldırım",
6
6
  "license": "ISC",
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@rollup/plugin-commonjs": "^22.0.0",
20
- "@ikas/storefront-api": "^4.0.0-alpha.75",
21
- "@ikas/storefront-config": "^4.0.0-alpha.75",
22
- "@ikas/storefront-model-functions": "^4.0.0-alpha.75",
23
- "@ikas/storefront-models": "^4.0.0-alpha.75",
20
+ "@ikas/storefront-api": "^4.0.0-alpha.77",
21
+ "@ikas/storefront-config": "^4.0.0-alpha.77",
22
+ "@ikas/storefront-model-functions": "^4.0.0-alpha.77",
23
+ "@ikas/storefront-models": "^4.0.0-alpha.77",
24
24
  "@rollup/plugin-node-resolve": "^13.3.0",
25
25
  "rollup-plugin-rename-node-modules": "^1.2.0",
26
26
  "@types/lodash": "^4.14.168",
@@ -38,10 +38,10 @@
38
38
  },
39
39
  "peerDependencies": {
40
40
  "mobx": "^6.1.3",
41
- "@ikas/storefront-api": "^4.0.0-alpha.75",
42
- "@ikas/storefront-config": "^4.0.0-alpha.75",
43
- "@ikas/storefront-model-functions": "^4.0.0-alpha.75",
44
- "@ikas/storefront-models": "^4.0.0-alpha.75",
41
+ "@ikas/storefront-api": "^4.0.0-alpha.77",
42
+ "@ikas/storefront-config": "^4.0.0-alpha.77",
43
+ "@ikas/storefront-model-functions": "^4.0.0-alpha.77",
44
+ "@ikas/storefront-models": "^4.0.0-alpha.77",
45
45
  "lodash": "^4.17.20"
46
46
  }
47
47
  }