@ikas/storefront-api 4.0.0-beta.1 → 4.0.0-beta.11
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/__api/models/SearchInput.d.ts +1 -0
- package/build/__api/types/index.d.ts +1 -0
- package/build/api/category/index.d.ts +1 -1
- package/build/api/category/index.js +1 -1
- package/build/api/product/index.d.ts +7 -7
- package/build/api/product/index.js +1 -1
- package/build/api/raffle/index.d.ts +2 -2
- package/build/api/raffle/index.js +1 -1
- package/package.json +5 -5
|
@@ -22,6 +22,7 @@ export declare class SearchInputData {
|
|
|
22
22
|
salesChannelId: string | null;
|
|
23
23
|
showStockOption: ProductSearchShowStockOptionEnum | null;
|
|
24
24
|
slug: string | null;
|
|
25
|
+
storefrontId: string | null;
|
|
25
26
|
tagIdList: string[] | null;
|
|
26
27
|
vendorIdList: string[] | null;
|
|
27
28
|
constructor(data?: Partial<SearchInputData>);
|
|
@@ -2845,6 +2845,7 @@ export interface SearchInput {
|
|
|
2845
2845
|
salesChannelId?: string | null;
|
|
2846
2846
|
showStockOption?: ProductSearchShowStockOptionEnum | null;
|
|
2847
2847
|
slug?: string | null;
|
|
2848
|
+
storefrontId?: string | null;
|
|
2848
2849
|
tagIdList?: string[] | null;
|
|
2849
2850
|
vendorIdList?: string[] | null;
|
|
2850
2851
|
}
|
|
@@ -3,7 +3,7 @@ import { IkasCategory } from "@ikas/storefront-models";
|
|
|
3
3
|
import { QueryParams as ListCategoryQueryParams } from "../../__api/queries/listCategory";
|
|
4
4
|
export type { ListCategoryQueryParams };
|
|
5
5
|
export declare function listCategory(params: ListCategoryQueryParams): Promise<APIResponse<{
|
|
6
|
-
data: IkasCategory[];
|
|
6
|
+
data: IkasCategory[] | undefined;
|
|
7
7
|
count?: number | undefined;
|
|
8
8
|
hasNext?: boolean | undefined;
|
|
9
9
|
limit?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as r,__generator as t,__assign as o}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as e}from"@ikas/fe-api-client";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{initIkasCategory as
|
|
1
|
+
import{__awaiter as r,__generator as t,__assign as o}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as e}from"@ikas/fe-api-client";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{initIkasCategory as n}from"@ikas/storefront-models";function a(a){var s;return r(this,void 0,void 0,(function(){var r,u;return t(this,(function(t){switch(t.label){case 0:return[4,import("../../__api/queries/listCategory.js")];case 1:return[4,(0,t.sent().default)(a)];case 2:return r=t.sent(),null==(u=null===(s=r.data)||void 0===s?void 0:s.data)||u.forEach((function(r){return n(r,i.getCurrentLocale())})),[2,new e(o(o({},r.data),{data:u}),r.graphQLErrors)]}}))}))}export{a as listCategory};
|
|
@@ -15,13 +15,13 @@ export declare function listProductBackInStockRemind(params: ListProductBackInSt
|
|
|
15
15
|
export declare function saveProductBackInStockRemind(params: SaveProductBackInStockRemindQueryParams): Promise<APIResponse<undefined> | APIResponse<import("../../__api/types").ProductBackInStockRemind>>;
|
|
16
16
|
export declare function searchProducts(params: SearchProductsQueryParams): Promise<APIResponse<{
|
|
17
17
|
data: IkasProduct[] | undefined;
|
|
18
|
-
count
|
|
19
|
-
facets
|
|
20
|
-
limit
|
|
21
|
-
page
|
|
22
|
-
results
|
|
23
|
-
totalCount
|
|
24
|
-
}>>;
|
|
18
|
+
count: number;
|
|
19
|
+
facets: import("../../__api/types").ProductFacetCount[] | null;
|
|
20
|
+
limit: number;
|
|
21
|
+
page: number;
|
|
22
|
+
results: SearchProduct[];
|
|
23
|
+
totalCount: number;
|
|
24
|
+
} | null>>;
|
|
25
25
|
export declare function getProductFilterData(params: GetProductFilterDataQueryParams): Promise<APIResponse<{
|
|
26
26
|
filters: IkasProductFilter[];
|
|
27
27
|
categories: IkasFilterCategory[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from"@ikas/fe-api-client";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{initIkasProduct as a,IkasBrandOrderType as u,IkasCategoryProductsOrderType as o,initIkasProductAttribute as d,initIkasProductOptionSet as l}from"@ikas/storefront-models";function s(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,import("../../__api/queries/listProductBackInStockRemind.js")];case 1:return[4,(0,t.sent().default)(r)];case 2:return[2,t.sent()]}}))}))}function c(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,import("../../__api/mutations/saveProductBackInStockRemind.js")];case 1:return[4,(0,t.sent().default)(r)];case 2:return[2,t.sent()]}}))}))}function p(u){var o;return t(this,void 0,void 0,(function(){var t,d,l,s,c;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/searchProducts.js")];case 1:return t=e.sent().default,l=t,s=[u],[4,A()];case 2:return[4,l.apply(void 0,s.concat([e.sent()]))];case 3:return d=e.sent(),null==(c=null===(o=d.data)||void 0===o?void 0:o.results.map(I))||c.forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(d.data?r(r({},d.data),{data:c}):null,d.graphQLErrors)]}}))}))}function v(r){var i,a;return t(this,void 0,void 0,(function(){var t,u,o;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getProductFilterData.js")];case 1:return[4,(0,e.sent().default)(r)];case 2:return t=e.sent(),u=null===(i=t.data)||void 0===i?void 0:i.filters,o=(null===(a=t.data)||void 0===a?void 0:a.categories)||null,[2,new n(t.data?{filters:u,categories:o}:null,t.graphQLErrors)]}}))}))}function f(r){var u;return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getRelatedProducts.js")];case 1:return[4,(0,e.sent().default)(r)];case 2:return t=e.sent(),(o=(null===(u=null==t?void 0:t.data)||void 0===u?void 0:u.map((function(t){return I(t)})))||[]).forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(t.data?{data:o,count:t.data.length,facets:null,limit:20,page:1,totalCount:t.data.length}:null,t.graphQLErrors)]}}))}))}function m(r){return t(this,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/listProductAttribute.js")];case 1:return[4,(0,e.sent().default)(r)];case 2:return t=e.sent(),null==(a=t.data)||a.forEach((function(t){return d(t,i.getCurrentLocale())})),[2,new n(a,t.graphQLErrors)]}}))}))}function b(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getProductCampaigns.js")];case 1:return[4,(0,e.sent().default)(r)];case 2:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return t})),t.graphQLErrors)]}}))}))}function g(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,import("../../__api/mutations/getOrderLineFile.js")];case 1:return[4,(0,t.sent().default)(r)];case 2:return[2,t.sent()]}}))}))}function h(r){return t(this,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/listProductOptionSet.js")];case 1:return[4,(0,e.sent().default)(r)];case 2:return t=e.sent(),null==(a=t.data)||a.forEach((function(t){return l(t,i.getCurrentLocale())})),[2,new n(a,t.graphQLErrors)]}}))}))}function A(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/searchProducts.js")];case 1:return t=e.sent().ResponseField,r=["DATA"],[2,Object.entries(t).filter((function(t){var e=t[0];return!r.includes(e)})).map((function(t){return t[1]}))]}}))}))}function I(t){var e,n,a,d="local"===process.env.NEXT_PUBLIC_ENV;return{id:t.id,type:t.type,attributes:(null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,a,u,o;return r(r({},t),{value:t.value,productAttributeId:(null===(e=t.productAttribute)||void 0===e?void 0:e.id)||null,productAttributeOptionId:(null===(n=t.productAttributeOption)||void 0===n?void 0:n.id)||null,productAttribute:{id:(null===(i=t.productAttribute)||void 0===i?void 0:i.id)||"",name:(null===(a=t.productAttribute)||void 0===a?void 0:a.name)||"",description:null,type:null===(u=t.productAttribute)||void 0===u?void 0:u.type,tableTemplate:(null===(o=t.productAttribute)||void 0===o?void 0:o.tableTemplate)?t.productAttribute.tableTemplate:null,options:null},productAttributeOption:t.productAttributeOption})})))||[],brand:t.brand?r(r({},t.brand),{id:t.brand.id,name:t.brand.name,createdAt:0,updatedAt:0,description:null,imageId:null,orderType:u.BEST_SELLER,metaData:{id:"",createdAt:0,updatedAt:0,slug:t.brand.slug||""}}):null,categories:(null===(n=t.categories)||void 0===n?void 0:n.map((function(t){return r(r({},t),{categoryPath:t.path.map((function(t){return t.name})),description:null,imageId:null,parentId:null,metaData:t.slug?{id:"",createdAt:0,updatedAt:0,name:t.name||"",slug:t.slug}:null,categoryPathItems:t.path.map((function(t){return{metaData:{id:"",createdAt:0,updatedAt:0,name:t.name||"",slug:t.slug||""},description:null,name:t.name,translations:t.translations,imageId:null,id:t.id,createdAt:0,updatedAt:0}})),createdAt:0,updatedAt:0,orderType:o.BEST_SELLER})})))||[],tags:t.tags||[],description:t.description||"",averageRating:t.averageRating,reviewCount:t.reviewCount,baseUnit:t.baseUnit,metaData:r(r({},t.metaData),{id:"",createdAt:0,updatedAt:0,slug:(null===(a=t.metaData)||void 0===a?void 0:a.slug)||""})||null,name:t.name,shortDescription:t.shortDescription||"",productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return{order:t.order,variantType:{id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return{id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id}})).filter((function(e){return t.variantValueIds.includes(e.id)}))},variantValueIds:t.variantValueIds}})),variants:t.variants.map((function(e){var n,a,u,o,l;return r(r({},e),{id:e.id,productId:t.id,images:(null===(n=e.images)||void 0===n?void 0:n.map((function(t){return{imageId:t.id,isMain:t.isMain||!1,isVideo:t.isVideo,order:t.order}})))||null,sellIfOutOfStock:e.sellIfOutOfStock||!1,unit:e.unit,attributes:(null===(a=e.attributes)||void 0===a?void 0:a.map((function(t){var e,n,i,a,u,o;return r(r({},t),{value:t.value,productAttributeId:(null===(e=t.productAttribute)||void 0===e?void 0:e.id)||null,productAttributeOptionId:(null===(n=t.productAttributeOption)||void 0===n?void 0:n.id)||null,productAttribute:{id:(null===(i=t.productAttribute)||void 0===i?void 0:i.id)||"",name:(null===(a=t.productAttribute)||void 0===a?void 0:a.name)||"",description:"",type:null===(u=t.productAttribute)||void 0===u?void 0:u.type,tableTemplate:(null===(o=t.productAttribute)||void 0===o?void 0:o.tableTemplate)?t.productAttribute.tableTemplate:null,options:null},productAttributeOption:t.productAttributeOption})})))||[],sku:e.sku,barcodeList:e.barcodeList||null,price:null===(u=e.prices)||void 0===u?void 0:u.find((function(t){return i.getPriceListId()?t.priceListId===i.getPriceListId():null===t.priceListId})),stock:(null===(o=e.stocks)||void 0===o?void 0:o.filter((function(t){var e;return d||i.getIsEditor()||(null===(e=i.getStockLocationIds())||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0))||0,variantValues:(null===(l=e.variantValues)||void 0===l?void 0:l.map((function(e){var r=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),n=null==r?void 0:r.variantType.values.find((function(t){return t.id===e.variantValueId}));return{id:e.variantValueId,name:(null==n?void 0:n.name)||"",colorCode:(null==n?void 0:n.colorCode)||"",thumbnailImageId:(null==n?void 0:n.thumbnailImageId)||"",variantTypeId:(null==r?void 0:r.variantType.id)||""}})))||[],isActive:e.isActive||!1})}))}}export{g as getOrderLineFile,b as getProductCampaigns,v as getProductFilterData,f as getRelatedProducts,m as listProductAttribute,s as listProductBackInStockRemind,h as listProductOptionSet,c as saveProductBackInStockRemind,p as searchProducts};
|
|
@@ -5,7 +5,7 @@ import { QueryParams as SaveRaffleParticipantQueryParams } from "../../__api/mut
|
|
|
5
5
|
import { QueryParams as ListRaffleMetadataQueryParams } from "../../__api/queries/listRaffleMetadata";
|
|
6
6
|
export type { ListStorefrontRaffleParams, SaveRaffleParticipantQueryParams, ListRaffleMetadataQueryParams, };
|
|
7
7
|
export declare function listStorefrontRaffle(params: ListStorefrontRaffleParams): Promise<APIResponse<{
|
|
8
|
-
data: IkasRaffle[]
|
|
8
|
+
data: IkasRaffle[];
|
|
9
9
|
count?: number | undefined;
|
|
10
10
|
hasNext?: boolean | undefined;
|
|
11
11
|
limit?: number | undefined;
|
|
@@ -13,4 +13,4 @@ export declare function listStorefrontRaffle(params: ListStorefrontRaffleParams)
|
|
|
13
13
|
}>>;
|
|
14
14
|
export declare function saveRaffleParticipant(params: SaveRaffleParticipantQueryParams): Promise<APIResponse<IkasRaffleParticipant | null>>;
|
|
15
15
|
export declare function listRaffleMetaData(params: ListRaffleMetadataQueryParams): Promise<APIResponse<IkasRaffleMetaData[]>>;
|
|
16
|
-
export declare function listRaffleParticipants(): Promise<APIResponse<
|
|
16
|
+
export declare function listRaffleParticipants(): Promise<APIResponse<IkasRaffleParticipant[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as r,__assign as e}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from"@ikas/fe-api-client";import{initIkasRaffle as a}from"@ikas/storefront-models";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";function s(
|
|
1
|
+
import{__awaiter as t,__generator as r,__assign as e}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from"@ikas/fe-api-client";import{initIkasRaffle as a}from"@ikas/storefront-models";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";function s(a){var i;return t(this,void 0,void 0,(function(){var t,s;return r(this,(function(r){switch(r.label){case 0:return[4,import("../../__api/queries/listStorefrontRaffle.js")];case 1:return[4,(0,r.sent().default)(a)];case 2:return t=r.sent(),s=null===(i=t.data)||void 0===i?void 0:i.data,[2,new n(e(e({},t.data),{data:s}),t.graphQLErrors)]}}))}))}function o(e){return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,import("../../__api/mutations/saveRaffleParticipant.js")];case 1:return[4,(0,r.sent().default)(e)];case 2:return t=r.sent(),[2,new n(t.data?t.data:null,t.graphQLErrors)]}}))}))}function u(e){var a;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,import("../../__api/queries/listRaffleMetadata.js")];case 1:return[4,(0,r.sent().default)(e)];case 2:return t=r.sent(),[2,new n(null===(a=t.data)||void 0===a?void 0:a.map((function(t){return t})),t.graphQLErrors)]}}))}))}function f(){return t(this,void 0,void 0,(function(){var t,e;return r(this,(function(r){switch(r.label){case 0:return[4,import("../../__api/queries/listRaffleParticipants.js")];case 1:return[4,(0,r.sent().default)()];case 2:return t=r.sent(),null==(e=t.data)||e.forEach((function(t){t.raffle&&a(t.raffle,i.getCurrentLocale())})),[2,new n(e,t.graphQLErrors)]}}))}))}export{u as listRaffleMetaData,f as listRaffleParticipants,s as listStorefrontRaffle,o as saveRaffleParticipant};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-api",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.11",
|
|
4
4
|
"author": "ikas",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "API functions that returns models from the ikas-storefront-models package.",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
20
|
-
"@ikas/storefront-config": "^4.0.0-beta.
|
|
21
|
-
"@ikas/storefront-models": "^4.0.0-beta.
|
|
20
|
+
"@ikas/storefront-config": "^4.0.0-beta.11",
|
|
21
|
+
"@ikas/storefront-models": "^4.0.0-beta.11",
|
|
22
22
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
23
23
|
"rollup-plugin-rename-node-modules": "^1.2.0",
|
|
24
24
|
"prettier": "^2.2.1",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@ikas/fe-api-client": "^1.0.16"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@ikas/storefront-config": "^4.0.0-beta.
|
|
38
|
-
"@ikas/storefront-models": "^4.0.0-beta.
|
|
37
|
+
"@ikas/storefront-config": "^4.0.0-beta.11",
|
|
38
|
+
"@ikas/storefront-models": "^4.0.0-beta.11",
|
|
39
39
|
"@ikas/fe-api-client": "^1.0.16",
|
|
40
40
|
"axios": "^0.26.0",
|
|
41
41
|
"ts-essentials": "^7.0.1"
|