marketplacepos 3.15.0 → 3.15.1
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/Marketplace/{chunk-L33MFTTM.js → chunk-2NRYBLX2.js} +1 -1
- package/Marketplace/{chunk-EI3KPHG7.js → chunk-3I25MNEJ.js} +2 -2
- package/Marketplace/{chunk-Q4FOBI47.js → chunk-4HOIRUEO.js} +1 -1
- package/Marketplace/{chunk-ZUTKRQCG.js → chunk-5NDG3SUM.js} +1 -1
- package/Marketplace/{chunk-B4RTU5A6.js → chunk-AMUX4WZH.js} +1 -1
- package/Marketplace/{chunk-6UPC6ZHH.js → chunk-B4SCNDB5.js} +1 -1
- package/Marketplace/{chunk-MS7TDJGD.js → chunk-BV6WKJBP.js} +1 -1
- package/Marketplace/{chunk-BIWUQMY6.js → chunk-G7GU37FJ.js} +1 -1
- package/Marketplace/{chunk-IQJZLNR7.js → chunk-GOR2LPT5.js} +1 -1
- package/Marketplace/{chunk-ZXDRQ5NO.js → chunk-IG2LDANH.js} +1 -1
- package/Marketplace/{chunk-WUOENHV6.js → chunk-JQZFTRSI.js} +1 -1
- package/Marketplace/{chunk-BCZNQVP7.js → chunk-JSPMPN5T.js} +4 -4
- package/Marketplace/{chunk-PHVJKT43.js → chunk-K4IJAE56.js} +1 -1
- package/Marketplace/{chunk-OKITFWXZ.js → chunk-OCG3HG72.js} +1 -1
- package/Marketplace/{chunk-PDMFRPES.js → chunk-OR4XOUSV.js} +1 -1
- package/Marketplace/{chunk-LIUFDNS2.js → chunk-PUC6ODUE.js} +3 -3
- package/Marketplace/{chunk-UYUDVWKN.js → chunk-PYCM3S43.js} +1 -1
- package/Marketplace/{chunk-TAUCMC6B.js → chunk-QITW54IW.js} +1 -1
- package/Marketplace/{chunk-ETN6PAVE.js → chunk-RER2OLD4.js} +1 -1
- package/Marketplace/{chunk-UYBM65IV.js → chunk-TLKDYQBN.js} +1 -1
- package/Marketplace/{chunk-UJNV7X2C.js → chunk-TRGFX3AD.js} +1 -1
- package/Marketplace/{chunk-MTGMHTUM.js → chunk-UJL2GLHS.js} +1 -1
- package/Marketplace/{chunk-EZZU5A4W.js → chunk-W5TR3NDM.js} +1 -1
- package/Marketplace/{chunk-K76GF3AP.js → chunk-WDY3SIUY.js} +1 -1
- package/Marketplace/{chunk-GMIPFSK2.js → chunk-WRS54BQ7.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-AHDSMQXN.js → main-XF2FUSJ6.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-EEOWKNSQ.js";import{g as j}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-EEOWKNSQ.js";import{g as j}from"./chunk-QITW54IW.js";import{b as S,e as d}from"./chunk-AAFEUTPF.js";import{b as a,c as g}from"./chunk-2AMEIUWK.js";import{$ as l,B as C,E as u,Ua as U,Wc as w,d as P,da as c,n,q as A,w as I}from"./chunk-HSFUKC7R.js";var R=(()=>{let r=class r{constructor(){this.httpService=c(d)}getAttributes(o,t){return this.httpService.get("api/product/shopee/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/shopee/AddProduct",o).pipe(u(e=>n(null)))}generateAttribute(o){return o.map(t=>({attribute_id:t.attribute_id,attribute_value_list:t.attribute_value_list.map(e=>({value_id:e.value_id,original_value_name:e.original_value_name}))})),o}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var D=(()=>{let r=class r{constructor(){this.httpService=c(d)}getCategories(o){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tiktok/AddProduct",o).pipe(u(e=>n(null)))}generateAttribute(o){let t;return o.map(e=>(e.type=="PRODUCT_PROPERTY"?t={id:e.id,name:e.name,type:e.type,values:e.values}:t={id:e.id,name:e.values[0].id,type:e.type},t))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var H=(()=>{let r=class r{constructor(){this.httpService=c(d)}getAttributes(o,t){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/lazada/AddProduct",o).pipe(u(e=>n(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var T=(()=>{let r=class r{constructor(){this.httpService=c(d)}getAttributes(o,t){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/woo/AddProduct",o).pipe(u(e=>n(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var y=class{};var b=class{};var F=(()=>{let r=class r{constructor(){this.httpService=c(d)}getCategories(o){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tokopedia/AddProduct",o).pipe(u(e=>n(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var x=(()=>{let r=class r{constructor(){this.toastrService=c(S)}showToastrUploadMultiple(o){let t=[],e=[],s=this.getResponseList(o);if(o.filter(p=>g.IsNotEmpty(p)).forEach(p=>{typeof p?.Response=="string"?e=[...e,s.length>1?this.setHtmlli(p.Response):this.setHtmlli(p.Response,!1)]:(p?.Response?.Success_list.forEach(f=>{t=[...t,s.length>1?this.setHtmlli(`Product ${f.Name} was <b>successfully</b> uploaded to ${p.Channel}`):this.setHtmlli(`Product ${f.Name} was <b>successfully</b> uploaded to ${p.Channel}`,!1)]}),p?.Response.Fail_list.forEach(f=>{e=[...e,s.length>1?this.setHtmlli(f.Message):this.setHtmlli(f.Message,!1)]}))}),e.length>0&&t.length>0){let p=[...t,...e];this.toastrService.warning(this.concatMessage(p),"Warning!",{enableHtml:!0})}else t.length>0&&e.length==0?this.toastrService.success(this.concatMessage(t),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(e),"Error",{enableHtml:!0})}concatMessage(o=[]){let t="";return o.forEach(e=>{t+=e}),o.length>1?`<ol>${t}</ol>`:t}getResponseList(o){let t=[];return o.filter(e=>g.IsNotEmpty(e)).forEach(e=>{typeof e.Response=="string"?t=[...t,e.Response]:(e?.Response.Success_list.forEach(s=>{t=[...t,s.Name]}),e?.Response.Fail_list.forEach(s=>{t=[...t,s.Message]}))}),t}setHtmlli(o,t=!0){return t?`<li>${o}</li>`:o}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var M=(()=>{let r=class r{constructor(){this.httpService=c(d)}uploadProduct(o){return this.httpService.post("api/product/shopify/AddProduct",o).pipe(u(e=>n(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var zt=(()=>{let r=class r{constructor(){this.authService=c(j),this.productService=c(E),this.shoppeUploadService=c(R),this.tiktokUploadService=c(D),this.lazadaUploadService=c(H),this.tokopediaUploadService=c(F),this.wooUploadService=c(T),this.shopifyUploadService=c(M),this.toastrHandlingService=c(x),this.toastr=c(S),this.router=c(w),this._channels=this.authService.getChannels(),this._selectedProduct=new P(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(o=>o&&o.length>0))}get channels(){return this._channels}getStoredProducts(){let o=localStorage.getItem("productsUpload");if(o){let t=JSON.parse(o);return t&&t.length>0?t:[]}else return[]}setSelectedProduct(o){localStorage.setItem("productsUpload",JSON.stringify(o)),this._selectedProduct.next(o)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let o=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(o,this.channels)}get channelProductUpload(){let o=this.getUnselectedChannels();return U(o.map(e=>{let s=new y;return s.id=e.ID,s.name=e.Name,s.type=e.TypeID,s.categoryId=null,s.attributes=[],s.selected=!1,s}))}onUploadProduct(o){let t=o.filter(e=>e.selected&&e.attributes.length>0&&e.type==a.Shopee||e.selected&&g.IsNotEmpty(e.categoryId)&&e.type!=a.Shopee);if(t.length>0){let e=this.generateDataForUpload(t);this.uploadProduct(e)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(o){let t=this.generateObservableForUpload(o);I(t).pipe(A(e=>{let s=[];return e.forEach(p=>{s=[...s,...p]}),s})).subscribe({next:(e=[])=>{g.IsNotEmpty(e)&&this.toastrHandlingService.showToastrUploadMultiple(e),this.hasSuccessRes(e)&&this.onSuccessUpload()}})}hasSuccessRes(o){let t=!1;return o.forEach(e=>{e?.Response.Success_list?.length>0&&g.IsNotEmpty(e)&&(t=!0)}),t}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(o){let t=[],e=[],s=[],p=[],f=[],k=[];o.forEach(h=>{switch(h.ChannelType){case a.Shopee:e.push(h);break;case a.Tiktok:t.push(h);break;case a.Lazada:s.push(h);break;case a.Tokopedia:p.push(h);break;case a.WooCommerce:f.push(h);break;case a.Shopify:k.push(h);break}});let m=[];return[{type:a.Shopee,data:e},{type:a.Tiktok,data:t},{type:a.Lazada,data:s},{type:a.Tokopedia,data:p},{type:a.WooCommerce,data:f},{type:a.Shopify,data:k}].filter(h=>h.data.length>0).forEach(h=>{switch(h.type){case a.Shopee:m.push(this.shoppeUploadService.uploadProduct(e));break;case a.Tiktok:m.push(this.tiktokUploadService.uploadProduct(t));break;case a.Lazada:m.push(this.lazadaUploadService.uploadProduct(s));break;case a.Tokopedia:m.push(this.tokopediaUploadService.uploadProduct(p));break;case a.WooCommerce:m.push(this.wooUploadService.uploadProduct(f));break;case a.Shopify:m.push(this.shopifyUploadService.uploadProduct(k));break}}),m}generateDataForUpload(o){let t=[];return o.forEach(e=>{let s=new b;s.ChannelID=e.id,s.ChannelType=e.type,s.Products=this._selectedProduct.getValue(),e.type==a.Shopify?delete s.CategoryID:s.CategoryID=e.categoryId,e.type==a.WooCommerce||e.type==a.Shopify?s.Attribute=e.attributes[0]:s.Attributes=this.formatAttributes(e.type,e.attributes),t.push(s)}),t}formatAttributes(o,t){let e;switch(o){case a.Shopee:e=this.shoppeUploadService.generateAttribute(t);break;case a.Tiktok:e=this.tiktokUploadService.generateAttribute(t);break;case a.WooCommerce:e=this.tiktokUploadService.generateAttribute(t);break;case a.Tokopedia:e=t;break;case a.Shopify:e=t;break;default:e=[];break}return e}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();export{R as a,D as b,H as c,F as d,T as e,zt as f};
|