@ikas/storefront-providers 4.0.0-beta.5 → 4.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as
|
|
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};
|
|
@@ -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 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(
|
|
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,i=f.find((function(t){return n.productId===t.id}));if(i){i.productOptionSet=null==p?void 0:p.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,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-beta.
|
|
3
|
+
"version": "4.0.0-beta.6",
|
|
4
4
|
"description": "Data providers for ikas storefront theme components.",
|
|
5
5
|
"author": "ikas",
|
|
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-beta.
|
|
21
|
-
"@ikas/storefront-config": "^4.0.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.0.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^4.0.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^4.0.0-beta.6",
|
|
21
|
+
"@ikas/storefront-config": "^4.0.0-beta.6",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.0.0-beta.6",
|
|
23
|
+
"@ikas/storefront-models": "^4.0.0-beta.6",
|
|
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-beta.
|
|
42
|
-
"@ikas/storefront-config": "^4.0.0-beta.
|
|
43
|
-
"@ikas/storefront-model-functions": "^4.0.0-beta.
|
|
44
|
-
"@ikas/storefront-models": "^4.0.0-beta.
|
|
41
|
+
"@ikas/storefront-api": "^4.0.0-beta.6",
|
|
42
|
+
"@ikas/storefront-config": "^4.0.0-beta.6",
|
|
43
|
+
"@ikas/storefront-model-functions": "^4.0.0-beta.6",
|
|
44
|
+
"@ikas/storefront-models": "^4.0.0-beta.6",
|
|
45
45
|
"lodash": "^4.17.21"
|
|
46
46
|
}
|
|
47
47
|
}
|