@heseya/advanced-ui-modules-sdk
Advanced tools
Comparing version 1.0.0-dev.5 to 1.0.0-dev.6
@@ -1,2 +0,2 @@ | ||
// Advanced UI Modules SDK v1.0.0-dev.5 Copyright (c) 2023 Heseya and contributors | ||
// Advanced UI Modules SDK v1.0.0-dev.6 Copyright (c) 2023 Heseya and contributors | ||
import { stringifyQueryParams } from '@heseya/store-core'; | ||
@@ -130,2 +130,14 @@ import { __awaiter } from 'tslib'; | ||
/** | ||
* Direct proxy from the Heseya API | ||
*/ | ||
const createProductsApiService = (axios) => { | ||
return { | ||
get: (params) => { | ||
const queryParams = stringifyQueryParams(params || {}); | ||
return axios.get(`/products?${queryParams}`); | ||
}, | ||
}; | ||
}; | ||
/** | ||
* Factory to create Advanced UI Modules API service | ||
@@ -150,3 +162,3 @@ * | ||
Languages: createLanguagesApiService(axios), | ||
Products: createLanguagesApiService(axios), | ||
Products: createProductsApiService(axios), | ||
Pages: createPagesApiService(axios), | ||
@@ -153,0 +165,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,o){"use strict";var i,a,n,r,d;e.ModuleType=void 0,(i=e.ModuleType||(e.ModuleType={})).Banner="banner",i.TextAndPhoto="textAndPhoto",i.OneToOne="oneToOne",i.Images="images",i.TextAndIcons="textAndIcons",i.Links="links",i.ProductSlider="productSlider",i.Blog="blog",i.ProductsShowcase="productsShowcase",i.BrandsSlider="brandsSlider",i.NotificationBar="notificationBar",i.Specification="specification",i.ProductHeader="productHeader",i.ProductTextWithIcons="productTextWithIcons",i.ProductVariantSelection="productVariantSelection",i.ProductTextWithImage="productTextWithImage",i.ProductDetails="productDetails",i.PackageContents="packageContents",i.Tabs="tabs",e.BlogTypes=void 0,(a=e.BlogTypes||(e.BlogTypes={})).Slider="slider",a.Grid="grid",e.ArticleVariant=void 0,(n=e.ArticleVariant||(e.ArticleVariant={})).INSIDE="inside",n.OUTSIDE="outside",n.HIGH_INSIDE="highInside",n.HIGH_OUTSIDE="highOutside",e.SectionDirection=void 0,(r=e.SectionDirection||(e.SectionDirection={})).ROW="row",r.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";const s=e=>({get:o=>{const i=t.stringifyQueryParams(o||{});return e.get(`/languages?${i}`)}}),c=e=>({create:t=>o.__awaiter(void 0,void 0,void 0,(function*(){const i=yield o.__awaiter(void 0,void 0,void 0,(function*(){return"undefined"==typeof window?new(yield require("form-data")):new FormData}));i.append("file",t.file,"media"),t.alt&&i.append("alt",t.alt),t.slug&&i.append("slug",t.slug),t.metadata&&Object.entries(t.metadata).forEach((([e,t])=>i.append(`metadata.${e}`,t))),t.metadata_private&&Object.entries(t.metadata_private).forEach((([e,t])=>i.append(`metadata_private.${e}`,t)));const{data:a}=yield e.post("/media",i);return a.data})),update:(t,i)=>o.__awaiter(void 0,void 0,void 0,(function*(){return(yield e.post(`/media/id:${t}`,i)).data}))}),u=e=>({get:o=>{const i=t.stringifyQueryParams(o||{});return e.get(`/pages?${i}`)}}),l=e=>({get:(t,i)=>o.__awaiter(void 0,void 0,void 0,(function*(){const{data:o}=yield e.get(`/modules/${t}/${i}`);return o})),update:(t,i,a)=>o.__awaiter(void 0,void 0,void 0,(function*(){const{data:o}=yield e.patch(`/modules/${t}/${i}`,a);return o}))});e.createAdvancedUiModulesApiService=e=>{if(!e)throw new Error("Axios instance is required, but it was not provided");return{Modules:l(e),Media:c(e),Languages:s(e),Products:s(e),Pages:u(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,o){"use strict";var i,a,r,n,d;e.ModuleType=void 0,(i=e.ModuleType||(e.ModuleType={})).Banner="banner",i.TextAndPhoto="textAndPhoto",i.OneToOne="oneToOne",i.Images="images",i.TextAndIcons="textAndIcons",i.Links="links",i.ProductSlider="productSlider",i.Blog="blog",i.ProductsShowcase="productsShowcase",i.BrandsSlider="brandsSlider",i.NotificationBar="notificationBar",i.Specification="specification",i.ProductHeader="productHeader",i.ProductTextWithIcons="productTextWithIcons",i.ProductVariantSelection="productVariantSelection",i.ProductTextWithImage="productTextWithImage",i.ProductDetails="productDetails",i.PackageContents="packageContents",i.Tabs="tabs",e.BlogTypes=void 0,(a=e.BlogTypes||(e.BlogTypes={})).Slider="slider",a.Grid="grid",e.ArticleVariant=void 0,(r=e.ArticleVariant||(e.ArticleVariant={})).INSIDE="inside",r.OUTSIDE="outside",r.HIGH_INSIDE="highInside",r.HIGH_OUTSIDE="highOutside",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";const s=e=>({get:o=>{const i=t.stringifyQueryParams(o||{});return e.get(`/languages?${i}`)}}),c=e=>({create:t=>o.__awaiter(void 0,void 0,void 0,(function*(){const i=yield o.__awaiter(void 0,void 0,void 0,(function*(){return"undefined"==typeof window?new(yield require("form-data")):new FormData}));i.append("file",t.file,"media"),t.alt&&i.append("alt",t.alt),t.slug&&i.append("slug",t.slug),t.metadata&&Object.entries(t.metadata).forEach((([e,t])=>i.append(`metadata.${e}`,t))),t.metadata_private&&Object.entries(t.metadata_private).forEach((([e,t])=>i.append(`metadata_private.${e}`,t)));const{data:a}=yield e.post("/media",i);return a.data})),update:(t,i)=>o.__awaiter(void 0,void 0,void 0,(function*(){return(yield e.post(`/media/id:${t}`,i)).data}))}),u=e=>({get:o=>{const i=t.stringifyQueryParams(o||{});return e.get(`/pages?${i}`)}}),l=e=>({get:(t,i)=>o.__awaiter(void 0,void 0,void 0,(function*(){const{data:o}=yield e.get(`/modules/${t}/${i}`);return o})),update:(t,i,a)=>o.__awaiter(void 0,void 0,void 0,(function*(){const{data:o}=yield e.patch(`/modules/${t}/${i}`,a);return o}))}),p=e=>({get:o=>{const i=t.stringifyQueryParams(o||{});return e.get(`/products?${i}`)}});e.createAdvancedUiModulesApiService=e=>{if(!e)throw new Error("Axios instance is required, but it was not provided");return{Modules:l(e),Media:c(e),Languages:s(e),Products:p(e),Pages:u(e)}},Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,2 +0,2 @@ | ||
// Advanced UI Modules SDK v1.0.0-dev.5 Copyright (c) 2023 Heseya and contributors | ||
// Advanced UI Modules SDK v1.0.0-dev.6 Copyright (c) 2023 Heseya and contributors | ||
(function (global, factory) { | ||
@@ -133,2 +133,14 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@heseya/store-core'), require('tslib')) : | ||
/** | ||
* Direct proxy from the Heseya API | ||
*/ | ||
const createProductsApiService = (axios) => { | ||
return { | ||
get: (params) => { | ||
const queryParams = storeCore.stringifyQueryParams(params || {}); | ||
return axios.get(`/products?${queryParams}`); | ||
}, | ||
}; | ||
}; | ||
/** | ||
* Factory to create Advanced UI Modules API service | ||
@@ -153,3 +165,3 @@ * | ||
Languages: createLanguagesApiService(axios), | ||
Products: createLanguagesApiService(axios), | ||
Products: createProductsApiService(axios), | ||
Pages: createPagesApiService(axios), | ||
@@ -156,0 +168,0 @@ }; |
@@ -30,5 +30,6 @@ import { AxiosInstance } from 'axios'; | ||
Products: { | ||
get: (params?: (import("@heseya/store-core/dist/src/services/api/types/DefaultParams").MetadataParams & import("@heseya/store-core/dist/src/services/api/types/DefaultParams").PaginationParams & { | ||
ids?: string[] | undefined; | ||
}) | undefined) => Promise<import("axios").AxiosResponse<import("@heseya/store-core").HeseyaPaginatedResponse<import("@heseya/store-core").Language[]>, any>>; | ||
get: (params?: { | ||
page?: number | undefined; | ||
search?: string | undefined; | ||
} | undefined) => Promise<import("axios").AxiosResponse<import("@heseya/store-core").HeseyaPaginatedResponse<import("@heseya/store-core").ProductList[]>, any>>; | ||
}; | ||
@@ -35,0 +36,0 @@ Pages: { |
import { AxiosInstance } from 'axios'; | ||
import { HeseyaApiService, HeseyaPaginatedResponse, ProductList } from '@heseya/store-core'; | ||
import { ParamTypesFromMethod } from '../../../types/Params'; | ||
type ProductsParams = ParamTypesFromMethod<HeseyaApiService['Products']['get']>; | ||
import { HeseyaPaginatedResponse, ProductList } from '@heseya/store-core'; | ||
type ProductsParams = { | ||
page?: number; | ||
search?: string; | ||
}; | ||
/** | ||
@@ -6,0 +8,0 @@ * Direct proxy from the Heseya API |
{ | ||
"name": "@heseya/advanced-ui-modules-sdk", | ||
"version": "1.0.0-dev.5", | ||
"version": "1.0.0-dev.6", | ||
"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
79709
985