@heseya/advanced-ui-modules-sdk
Advanced tools
Comparing version 1.0.0-dev.85 to 1.0.0-dev.86
@@ -1,2 +0,2 @@ | ||
// Advanced UI Modules SDK v1.0.0-dev.85 Copyright (c) 2024 Heseya and contributors | ||
// Advanced UI Modules SDK v1.0.0-dev.86 Copyright (c) 2024 Heseya and contributors | ||
import { stringifyQueryParams } from '@heseya/store-core'; | ||
@@ -194,2 +194,22 @@ import { __awaiter } from 'tslib'; | ||
/** | ||
* Direct proxy from the Heseya API | ||
*/ | ||
const createProductSetsApiService = (axios) => { | ||
return { | ||
get: (params) => { | ||
const queryParams = stringifyQueryParams(params || {}); | ||
return axios.get(`/product-sets?${queryParams}`); | ||
}, | ||
getOneBySlug: (slug, params) => { | ||
const queryParams = stringifyQueryParams(params || {}); | ||
return axios.get(`/product-sets/${slug}?${queryParams}`); | ||
}, | ||
getOne: (id, params) => { | ||
const queryParams = stringifyQueryParams(params || {}); | ||
return axios.get(`/product-sets/id:${id}?${queryParams}`); | ||
}, | ||
}; | ||
}; | ||
/** | ||
* Factory to create Advanced UI Modules API service | ||
@@ -216,2 +236,3 @@ * | ||
Pages: createPagesApiService(axios), | ||
ProductSets: createProductSetsApiService(axios), | ||
Config: createConfigApiService(axios), | ||
@@ -218,0 +239,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@heseya/store-core"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","@heseya/store-core","tslib"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["advanced-ui-modules-sdk"]={},e.storeCore,e.tslib)}(this,(function(e,t,r){"use strict";var a,i,o,n,d,s;e.ModuleType=void 0,(a=e.ModuleType||(e.ModuleType={})).Banner="banner",a.TextAndPhoto="textAndPhoto",a.OneToOne="oneToOne",a.Images="images",a.TextAndIcons="textAndIcons",a.Links="links",a.ProductSlider="productSlider",a.Blog="blog",a.ProductsShowcase="productsShowcase",a.BrandsSlider="brandsSlider",a.NotificationBar="notificationBar",a.Specification="specification",a.ProductHeader="productHeader",a.ProductTextWithIcons="productTextWithIcons",a.ProductVariantSelection="productVariantSelection",a.ProductTextWithImage="productTextWithImage",a.ProductTopImageBanner="productTopImageBanner",a.ProductDetails="productDetails",a.ProductGrid="productGrid",a.PackageContents="packageContents",a.Tabs="tabs",a.CategorySlider="categorySlider",a.IframeLink="iframeLink",a.Contact="contact",a.Timeline="timeline",a.BranchFinder="branchFinder",a.ReviewsSlider="reviewsSlider",a.SmallBanner="smallBanner",a.JobOffers="jobOffers",a.Text="text",a.Faq="faq",a.CategoriesGroups="categoriesGroups",a.Search="search",a.TextOnImage="textOnImage",a.ProductGallery="productGallery",a.ThreeSixty="threeSixty",a.OurBrands="ourBrands",a.DoubleImageSlider="doubleImageSlider",a.CatchyClaim="catchyClaim",a.SpecificationWithImage="specificationWithImage",e.BlogTypes=void 0,(i=e.BlogTypes||(e.BlogTypes={})).Slider="slider",i.Grid="grid",e.ArticleVariant=void 0,(o=e.ArticleVariant||(e.ArticleVariant={})).INSIDE="inside",o.OUTSIDE="outside",e.SectionDirection=void 0,(n=e.SectionDirection||(e.SectionDirection={})).ROW="row",n.COLUMN="column",e.ImagesMasonryTypes=void 0,(d=e.ImagesMasonryTypes||(e.ImagesMasonryTypes={})).equal="equal",d.oneToTwo="oneToTwo",d.oneToThree="oneToThree",d.simpleMasonry="simpleMasonry",d.masonry="masonry",e.CategorySlideVariant=void 0,(s=e.CategorySlideVariant||(e.CategorySlideVariant={})).WIDE="wide",s.NARROW="narrow";const c=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/languages?${a}`)}}),u=e=>({create:t=>r.__awaiter(void 0,void 0,void 0,(function*(){const a=yield r.__awaiter(void 0,void 0,void 0,(function*(){return"undefined"==typeof window?new(yield require("form-data")):new FormData}));a.append("file",t.file,"media"),t.alt&&a.append("alt",t.alt),t.slug&&a.append("slug",t.slug),t.metadata&&Object.entries(t.metadata).forEach((([e,t])=>a.append(`metadata.${e}`,t))),t.metadata_private&&Object.entries(t.metadata_private).forEach((([e,t])=>a.append(`metadata_private.${e}`,t)));const{data:i}=yield e.post("/media",a);return i.data})),update:(t,a)=>r.__awaiter(void 0,void 0,void 0,(function*(){return(yield e.post(`/media/id:${t}`,a)).data}))}),l=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/pages?${a}`)},getOneBySlug:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/pages/${r}?${i}`)},getOne:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/pages/id:${r}?${i}`)}}),g=e=>({get:(t,a)=>r.__awaiter(void 0,void 0,void 0,(function*(){const{data:r}=yield e.get(`/modules/${t}/${a}`);return r})),update:(t,a,i)=>r.__awaiter(void 0,void 0,void 0,(function*(){const{data:r}=yield e.patch(`/modules/${t}/${a}`,i);return r}))}),p=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/products?${a}`)},getOneBySlug:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/products/${r}?${i}`)},getOne:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/products/id:${r}?${i}`)}}),y=e=>({get:()=>e.get("/config")});e.createAdvancedUiModulesApiService=e=>{if(!e)throw new Error("Axios instance is required, but it was not provided");return{Modules:g(e),Media:u(e),Languages:c(e),Products:p(e),Pages:l(e),Config:y(e)}},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@heseya/store-core"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","@heseya/store-core","tslib"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["advanced-ui-modules-sdk"]={},e.storeCore,e.tslib)}(this,(function(e,t,r){"use strict";var a,i,o,n,d,s;e.ModuleType=void 0,(a=e.ModuleType||(e.ModuleType={})).Banner="banner",a.TextAndPhoto="textAndPhoto",a.OneToOne="oneToOne",a.Images="images",a.TextAndIcons="textAndIcons",a.Links="links",a.ProductSlider="productSlider",a.Blog="blog",a.ProductsShowcase="productsShowcase",a.BrandsSlider="brandsSlider",a.NotificationBar="notificationBar",a.Specification="specification",a.ProductHeader="productHeader",a.ProductTextWithIcons="productTextWithIcons",a.ProductVariantSelection="productVariantSelection",a.ProductTextWithImage="productTextWithImage",a.ProductTopImageBanner="productTopImageBanner",a.ProductDetails="productDetails",a.ProductGrid="productGrid",a.PackageContents="packageContents",a.Tabs="tabs",a.CategorySlider="categorySlider",a.IframeLink="iframeLink",a.Contact="contact",a.Timeline="timeline",a.BranchFinder="branchFinder",a.ReviewsSlider="reviewsSlider",a.SmallBanner="smallBanner",a.JobOffers="jobOffers",a.Text="text",a.Faq="faq",a.CategoriesGroups="categoriesGroups",a.Search="search",a.TextOnImage="textOnImage",a.ProductGallery="productGallery",a.ThreeSixty="threeSixty",a.OurBrands="ourBrands",a.DoubleImageSlider="doubleImageSlider",a.CatchyClaim="catchyClaim",a.SpecificationWithImage="specificationWithImage",e.BlogTypes=void 0,(i=e.BlogTypes||(e.BlogTypes={})).Slider="slider",i.Grid="grid",e.ArticleVariant=void 0,(o=e.ArticleVariant||(e.ArticleVariant={})).INSIDE="inside",o.OUTSIDE="outside",e.SectionDirection=void 0,(n=e.SectionDirection||(e.SectionDirection={})).ROW="row",n.COLUMN="column",e.ImagesMasonryTypes=void 0,(d=e.ImagesMasonryTypes||(e.ImagesMasonryTypes={})).equal="equal",d.oneToTwo="oneToTwo",d.oneToThree="oneToThree",d.simpleMasonry="simpleMasonry",d.masonry="masonry",e.CategorySlideVariant=void 0,(s=e.CategorySlideVariant||(e.CategorySlideVariant={})).WIDE="wide",s.NARROW="narrow";const c=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/languages?${a}`)}}),u=e=>({create:t=>r.__awaiter(void 0,void 0,void 0,(function*(){const a=yield r.__awaiter(void 0,void 0,void 0,(function*(){return"undefined"==typeof window?new(yield require("form-data")):new FormData}));a.append("file",t.file,"media"),t.alt&&a.append("alt",t.alt),t.slug&&a.append("slug",t.slug),t.metadata&&Object.entries(t.metadata).forEach((([e,t])=>a.append(`metadata.${e}`,t))),t.metadata_private&&Object.entries(t.metadata_private).forEach((([e,t])=>a.append(`metadata_private.${e}`,t)));const{data:i}=yield e.post("/media",a);return i.data})),update:(t,a)=>r.__awaiter(void 0,void 0,void 0,(function*(){return(yield e.post(`/media/id:${t}`,a)).data}))}),l=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/pages?${a}`)},getOneBySlug:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/pages/${r}?${i}`)},getOne:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/pages/id:${r}?${i}`)}}),g=e=>({get:(t,a)=>r.__awaiter(void 0,void 0,void 0,(function*(){const{data:r}=yield e.get(`/modules/${t}/${a}`);return r})),update:(t,a,i)=>r.__awaiter(void 0,void 0,void 0,(function*(){const{data:r}=yield e.patch(`/modules/${t}/${a}`,i);return r}))}),p=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/products?${a}`)},getOneBySlug:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/products/${r}?${i}`)},getOne:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/products/id:${r}?${i}`)}}),y=e=>({get:()=>e.get("/config")}),m=e=>({get:r=>{const a=t.stringifyQueryParams(r||{});return e.get(`/product-sets?${a}`)},getOneBySlug:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/product-sets/${r}?${i}`)},getOne:(r,a)=>{const i=t.stringifyQueryParams(a||{});return e.get(`/product-sets/id:${r}?${i}`)}});e.createAdvancedUiModulesApiService=e=>{if(!e)throw new Error("Axios instance is required, but it was not provided");return{Modules:g(e),Media:u(e),Languages:c(e),Products:p(e),Pages:l(e),ProductSets:m(e),Config:y(e)}},Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,2 +0,2 @@ | ||
// Advanced UI Modules SDK v1.0.0-dev.85 Copyright (c) 2024 Heseya and contributors | ||
// Advanced UI Modules SDK v1.0.0-dev.86 Copyright (c) 2024 Heseya and contributors | ||
(function (global, factory) { | ||
@@ -197,2 +197,22 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@heseya/store-core'), require('tslib')) : | ||
/** | ||
* Direct proxy from the Heseya API | ||
*/ | ||
const createProductSetsApiService = (axios) => { | ||
return { | ||
get: (params) => { | ||
const queryParams = storeCore.stringifyQueryParams(params || {}); | ||
return axios.get(`/product-sets?${queryParams}`); | ||
}, | ||
getOneBySlug: (slug, params) => { | ||
const queryParams = storeCore.stringifyQueryParams(params || {}); | ||
return axios.get(`/product-sets/${slug}?${queryParams}`); | ||
}, | ||
getOne: (id, params) => { | ||
const queryParams = storeCore.stringifyQueryParams(params || {}); | ||
return axios.get(`/product-sets/id:${id}?${queryParams}`); | ||
}, | ||
}; | ||
}; | ||
/** | ||
* Factory to create Advanced UI Modules API service | ||
@@ -219,2 +239,3 @@ * | ||
Pages: createPagesApiService(axios), | ||
ProductSets: createProductSetsApiService(axios), | ||
Config: createConfigApiService(axios), | ||
@@ -221,0 +242,0 @@ }; |
@@ -44,2 +44,10 @@ import { AxiosInstance } from 'axios'; | ||
}; | ||
ProductSets: { | ||
get: (params?: ({ | ||
page?: number | undefined; | ||
search?: string | undefined; | ||
} & Record<string, unknown>) | undefined) => Promise<import("axios").AxiosResponse<import("@heseya/store-core").ListResponse<import("@heseya/store-core").ProductSetList>, any>>; | ||
getOneBySlug: (slug: string, params?: Record<string, unknown> | undefined) => Promise<import("axios").AxiosResponse<import("@heseya/store-core").ProductSet, any>>; | ||
getOne: (id: string, params?: Record<string, unknown> | undefined) => Promise<import("axios").AxiosResponse<import("@heseya/store-core").ProductSet, any>>; | ||
}; | ||
Config: { | ||
@@ -46,0 +54,0 @@ get: () => Promise<import("axios").AxiosResponse<import("@heseya/store-core").AppConfigField[], any>>; |
import { Link } from '../modules/'; | ||
import { Media } from './Media'; | ||
export type ModelType = 'product' | 'page' | 'homepage'; | ||
export type ModelType = 'product' | 'product-set' | 'page' | 'homepage'; | ||
export declare enum ModuleType { | ||
@@ -5,0 +5,0 @@ Banner = "banner", |
{ | ||
"name": "@heseya/advanced-ui-modules-sdk", | ||
"version": "1.0.0-dev.85", | ||
"version": "1.0.0-dev.86", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Heseya" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
129378
68
1805