@ikas/storefront-api 4.2.0-beta.3 → 4.2.0-beta.5
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,6 +1,6 @@
|
|
|
1
1
|
import { ConfigType, APIResponse } from "@ikas/fe-api-client";
|
|
2
2
|
import { GetVariantStockLocationListResponse } from "../types";
|
|
3
|
-
declare const getVariantStockLocations: (variables: QueryParams, fields?: string[], config?: ConfigType) => Promise<APIResponse<
|
|
3
|
+
declare const getVariantStockLocations: (variables: QueryParams, fields?: string[], config?: ConfigType) => Promise<APIResponse<GetVariantStockLocationListResponse> | APIResponse<undefined>>;
|
|
4
4
|
export default getVariantStockLocations;
|
|
5
5
|
export declare type QueryParams = {
|
|
6
6
|
stockLocationIdList?: string[] | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import{handleAPIError as _,APIResponse as s,fetchQuery as c}from"@ikas/fe-api-client";var O,a=function(O,a,i){return t(void 0,void 0,void 0,(function(){var t,S,T,C;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,c({operationName:"getVariantStockLocations",config:i,variables:O,allReturnFields:n,fields:a,query:function(t){return"\n\t\t\t\tquery getVariantStockLocations (\n\t\t\t\t\t$stockLocationIdList: [String!],\n\t\t\t\t\t$variantIds: [String!]!,\n\t\t\t\t) {\n\t\t\t\t\tgetVariantStockLocations (\n\t\t\t\t\t\tstockLocationIdList: $stockLocationIdList,\n\t\t\t\t\t\tvariantIds: $variantIds,\n\t\t\t\t\t) ".concat(t,"\n\t\t\t\t}\n\t\t\t")}})];case 1:return t=o.sent(),S=t.data,T=t.errors,[2,new s(null==S?void 0:S.getVariantStockLocations,T)];case 2:return C=o.sent(),[2,_(C)];case 3:return[2]}}))}))},n="{stockLocations {stockCount stockLocation {address {address city {code id name } country {code id name } district {code id name } phone postalCode state {code id name } } id name type } variantId } }";!function(t){t.STOCK_LOCATIONS__STOCK_COUNT="stockLocations.stockCount",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__ADDRESS="stockLocations.stockLocation.address.address",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__CITY__CODE="stockLocations.stockLocation.address.city.code",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__CITY__ID="stockLocations.stockLocation.address.city.id",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__CITY__NAME="stockLocations.stockLocation.address.city.name",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__COUNTRY__CODE="stockLocations.stockLocation.address.country.code",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__COUNTRY__ID="stockLocations.stockLocation.address.country.id",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__COUNTRY__NAME="stockLocations.stockLocation.address.country.name",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__DISTRICT__CODE="stockLocations.stockLocation.address.district.code",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__DISTRICT__ID="stockLocations.stockLocation.address.district.id",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__DISTRICT__NAME="stockLocations.stockLocation.address.district.name",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__PHONE="stockLocations.stockLocation.address.phone",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__POSTAL_CODE="stockLocations.stockLocation.address.postalCode",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__STATE__CODE="stockLocations.stockLocation.address.state.code",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__STATE__ID="stockLocations.stockLocation.address.state.id",t.STOCK_LOCATIONS__STOCK_LOCATION__ADDRESS__STATE__NAME="stockLocations.stockLocation.address.state.name",t.STOCK_LOCATIONS__STOCK_LOCATION__ID="stockLocations.stockLocation.id",t.STOCK_LOCATIONS__STOCK_LOCATION__NAME="stockLocations.stockLocation.name",t.STOCK_LOCATIONS__STOCK_LOCATION__TYPE="stockLocations.stockLocation.type",t.STOCK_LOCATIONS__VARIANT_ID="stockLocations.variantId"}(O||(O={}));export{O as ResponseField,a as default};
|
|
@@ -10,8 +10,9 @@ import { QueryParams as GetProductCampaignsQueryParams } from "../../__api/queri
|
|
|
10
10
|
import { QueryParams as GetOrderLineFileQueryParams } from "../../__api/mutations/getOrderLineFile";
|
|
11
11
|
import { QueryParams as ListProductOptionSetQueryParams } from "../../__api/queries/listProductOptionSet";
|
|
12
12
|
import { QueryParams as SaveProductBackInStockRemindQueryParams } from "../../__api/mutations/saveProductBackInStockRemind";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import { QueryParams as GetVariantStockLocationsQueryParams } from "../../__api/queries/getVariantStockLocations";
|
|
14
|
+
import { IkasFilterCategory, IkasProduct, IkasProductAttribute, IkasProductCampaign, IkasProductFilter, IkasProductOptionSet, IkasProductStockLocations } from "@ikas/storefront-models";
|
|
15
|
+
export type { ListProductBackInStockRemindQueryParams, SearchProductsQueryParams, GetProductFilterDataQueryParams, GetRelatedProductsQueryParams, GetSuggestedProductsQueryParams, ListProductAttributeQueryParams, GetProductCampaignsQueryParams, GetOrderLineFileQueryParams, ListProductOptionSetQueryParams, SaveProductBackInStockRemindQueryParams, GetVariantStockLocationsQueryParams, };
|
|
15
16
|
export declare function listProductBackInStockRemind(params: ListProductBackInStockRemindQueryParams): Promise<APIResponse<import("../../__api/types").ProductBackInStockRemind[]> | APIResponse<undefined>>;
|
|
16
17
|
export declare function saveProductBackInStockRemind(params: SaveProductBackInStockRemindQueryParams): Promise<APIResponse<undefined> | APIResponse<import("../../__api/types").ProductBackInStockRemind>>;
|
|
17
18
|
export declare function searchProducts(params: SearchProductsQueryParams): Promise<APIResponse<{
|
|
@@ -45,5 +46,6 @@ export declare function getSuggestedProducts(params: GetSuggestedProductsQueryPa
|
|
|
45
46
|
} | null>>;
|
|
46
47
|
export declare function listProductAttribute(params: ListProductAttributeQueryParams): Promise<APIResponse<IkasProductAttribute[]>>;
|
|
47
48
|
export declare function getProductCampaigns(params: GetProductCampaignsQueryParams): Promise<APIResponse<IkasProductCampaign[]>>;
|
|
49
|
+
export declare function getVariantStockLocations(data: GetVariantStockLocationsQueryParams): Promise<APIResponse<IkasProductStockLocations[]>>;
|
|
48
50
|
export declare function getOrderLineFile(params: GetOrderLineFileQueryParams): Promise<APIResponse<undefined> | APIResponse<string>>;
|
|
49
51
|
export declare function listProductOptionSet(params: ListProductOptionSetQueryParams): Promise<APIResponse<IkasProductOptionSet[]>>;
|
|
@@ -1 +1 @@
|
|
|
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 c(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 s(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,d;return t(this,void 0,void 0,(function(){var t,l,c,s,p,v;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=null===(o=i.getCurrentRouting())||void 0===o?void 0:o.dynamicCurrencySettings,s=t,p=[{input:r({locale:i.getCurrentLocale(),dynamicCurrencySettings:l?{roundingFormat:l.roundingFormat,targetCurrencyCode:l.targetCurrencyCode}:void 0},u.input)}],[4,A()];case 2:return[4,s.apply(void 0,p.concat([e.sent()]))];case 3:return c=e.sent(),null==(v=null===(d=c.data)||void 0===d?void 0:d.results.map(I))||v.forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(c.data?r(r({},c.data),{data:v}):null,c.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 m(u){var o,d;return t(this,void 0,void 0,(function(){var t,l,c,s;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getRelatedProducts.js")];case 1:return t=e.sent().default,l=null===(o=i.getCurrentRouting())||void 0===o?void 0:o.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:l?{roundingFormat:l.roundingFormat,targetCurrencyCode:l.targetCurrencyCode}:void 0},u))];case 2:return c=e.sent(),(s=(null===(d=null==c?void 0:c.data)||void 0===d?void 0:d.map((function(t){return I(t)})))||[]).forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(c.data?{data:s,count:c.data.length,facets:null,limit:20,page:1,totalCount:c.data.length}:null,c.graphQLErrors)]}}))}))}function f(u){var o,d;return t(this,void 0,void 0,(function(){var t,l,c,s;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getSuggestedProducts.js")];case 1:return t=e.sent().default,l=null===(o=i.getCurrentRouting())||void 0===o?void 0:o.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:l?{roundingFormat:l.roundingFormat,targetCurrencyCode:l.targetCurrencyCode}:void 0},u))];case 2:return c=e.sent(),(s=(null===(d=null==c?void 0:c.data)||void 0===d?void 0:d.map((function(t){return I(t)})))||[]).forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(c.data?{data:s,count:c.data.length,facets:null,limit:20,page:1,totalCount:c.data.length}:null,c.graphQLErrors)]}}))}))}function g(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 h(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 y(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,groupVariantsByVariantTypeId:t.groupVariantsByVariantTypeId,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{h as getOrderLineFile,b as getProductCampaigns,v as getProductFilterData,m as getRelatedProducts,f as getSuggestedProducts,g as listProductAttribute,c as listProductBackInStockRemind,y as listProductOptionSet,s as saveProductBackInStockRemind,p as searchProducts};
|
|
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 c(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 s(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,d;return t(this,void 0,void 0,(function(){var t,l,c,s,p,v;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=null===(o=i.getCurrentRouting())||void 0===o?void 0:o.dynamicCurrencySettings,s=t,p=[{input:r({locale:i.getCurrentLocale(),dynamicCurrencySettings:l?{roundingFormat:l.roundingFormat,targetCurrencyCode:l.targetCurrencyCode}:void 0},u.input)}],[4,I()];case 2:return[4,s.apply(void 0,p.concat([e.sent()]))];case 3:return c=e.sent(),null==(v=null===(d=c.data)||void 0===d?void 0:d.results.map(C))||v.forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(c.data?r(r({},c.data),{data:v}):null,c.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 m(u){var o,d;return t(this,void 0,void 0,(function(){var t,l,c,s;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getRelatedProducts.js")];case 1:return t=e.sent().default,l=null===(o=i.getCurrentRouting())||void 0===o?void 0:o.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:l?{roundingFormat:l.roundingFormat,targetCurrencyCode:l.targetCurrencyCode}:void 0},u))];case 2:return c=e.sent(),(s=(null===(d=null==c?void 0:c.data)||void 0===d?void 0:d.map((function(t){return C(t)})))||[]).forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(c.data?{data:s,count:c.data.length,facets:null,limit:20,page:1,totalCount:c.data.length}:null,c.graphQLErrors)]}}))}))}function f(u){var o,d;return t(this,void 0,void 0,(function(){var t,l,c,s;return e(this,(function(e){switch(e.label){case 0:return[4,import("../../__api/queries/getSuggestedProducts.js")];case 1:return t=e.sent().default,l=null===(o=i.getCurrentRouting())||void 0===o?void 0:o.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:l?{roundingFormat:l.roundingFormat,targetCurrencyCode:l.targetCurrencyCode}:void 0},u))];case 2:return c=e.sent(),(s=(null===(d=null==c?void 0:c.data)||void 0===d?void 0:d.map((function(t){return C(t)})))||[]).forEach((function(t){return a(t,i.getCurrentLocale())})),[2,new n(c.data?{data:s,count:c.data.length,facets:null,limit:20,page:1,totalCount:c.data.length}:null,c.graphQLErrors)]}}))}))}function g(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 h(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 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/getVariantStockLocations.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.stockLocations.map((function(t){return t})),t.graphQLErrors)]}}))}))}function y(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 A(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 I(){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 C(t){var e,n,a,d="local"===process.env.NEXT_PUBLIC_ENV;return{id:t.id,type:t.type,groupVariantsByVariantTypeId:t.groupVariantsByVariantTypeId,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{y as getOrderLineFile,h as getProductCampaigns,v as getProductFilterData,m as getRelatedProducts,f as getSuggestedProducts,b as getVariantStockLocations,g as listProductAttribute,c as listProductBackInStockRemind,A as listProductOptionSet,s as saveProductBackInStockRemind,p as searchProducts};
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{setAPIClientConfig}from"./index2.js";export{SaveMyCustomerInput}from"./__api/models/SaveMyCustomerInput.js";export{SaveCartInput}from"./__api/models/SaveCartInput.js";export{CheckStocksLineInput}from"./__api/models/CheckStocksLineInput.js";export{MasterPassOperationTypeEnum,SortByDirectionEnum,SortByTypeEnum}from"./__api/types/index.js";export{APIResponse,Config as IkasAPIClientConfig}from"@ikas/fe-api-client";export{listBlog,listBlogCategory,listBlogMetaData}from"./api/blog/index.js";export{listProductBrand}from"./api/brand/index.js";export{addItemToCart,getCartById,saveCart,saveCartCouponCode,updateCartCampaignOffer}from"./api/cart/index.js";export{listCategory}from"./api/category/index.js";export{checkStocks,createKlarnaClientToken,createSaleTransactionWithCart,createStripePaymentIntent,getAvailableShippingCountries,getAvailableStockLocations,listCheckoutSettings,listPaymentGateway,listStockLocations,retrieveInstallmentInfo}from"./api/checkout/index.js";export{checkEmail,createCustomerReview,createOrderRefundRequest,forgotPassword,getCustomer,getLastViewedProducts,getOrderByEmail,getOrders,isFavoriteProduct,listCustomerAttribute,listCustomerReviewSummary,listCustomerReviews,listCustomerSettings,listFavoriteProducts,listOrderRefundSettings,listOrderTransactions,login,recoverPassword,refreshToken,register,saveCustomer,saveFavoriteProduct,saveLastViewedProducts,sendContactFormToMerchant,socialLogin,subscribeToMarketingNotifications}from"./api/customer/index.js";export{getProductOptionFileUrl,uploadFile}from"./api/file-upload/index.js";export{listHTMLMetaData}from"./api/html-meta-data/index.js";export{getMyCountry,listCity,listCountry,listDistrict,listState}from"./api/location/index.js";export{getMasterPassRequestToken}from"./api/masterpass/index.js";export{listMerchantSettings}from"./api/merchant/index.js";export{getOrderLineFile,getProductCampaigns,getProductFilterData,getRelatedProducts,getSuggestedProducts,listProductAttribute,listProductBackInStockRemind,listProductOptionSet,saveProductBackInStockRemind,searchProducts}from"./api/product/index.js";export{listRaffleMetaData,listRaffleParticipants,listStorefrontRaffle,saveRaffleParticipant}from"./api/raffle/index.js";export{getStorefrontSettings}from"./api/storefront/index.js";
|
|
1
|
+
export{setAPIClientConfig}from"./index2.js";export{SaveMyCustomerInput}from"./__api/models/SaveMyCustomerInput.js";export{SaveCartInput}from"./__api/models/SaveCartInput.js";export{CheckStocksLineInput}from"./__api/models/CheckStocksLineInput.js";export{MasterPassOperationTypeEnum,SortByDirectionEnum,SortByTypeEnum}from"./__api/types/index.js";export{APIResponse,Config as IkasAPIClientConfig}from"@ikas/fe-api-client";export{listBlog,listBlogCategory,listBlogMetaData}from"./api/blog/index.js";export{listProductBrand}from"./api/brand/index.js";export{addItemToCart,getCartById,saveCart,saveCartCouponCode,updateCartCampaignOffer}from"./api/cart/index.js";export{listCategory}from"./api/category/index.js";export{checkStocks,createKlarnaClientToken,createSaleTransactionWithCart,createStripePaymentIntent,getAvailableShippingCountries,getAvailableStockLocations,listCheckoutSettings,listPaymentGateway,listStockLocations,retrieveInstallmentInfo}from"./api/checkout/index.js";export{checkEmail,createCustomerReview,createOrderRefundRequest,forgotPassword,getCustomer,getLastViewedProducts,getOrderByEmail,getOrders,isFavoriteProduct,listCustomerAttribute,listCustomerReviewSummary,listCustomerReviews,listCustomerSettings,listFavoriteProducts,listOrderRefundSettings,listOrderTransactions,login,recoverPassword,refreshToken,register,saveCustomer,saveFavoriteProduct,saveLastViewedProducts,sendContactFormToMerchant,socialLogin,subscribeToMarketingNotifications}from"./api/customer/index.js";export{getProductOptionFileUrl,uploadFile}from"./api/file-upload/index.js";export{listHTMLMetaData}from"./api/html-meta-data/index.js";export{getMyCountry,listCity,listCountry,listDistrict,listState}from"./api/location/index.js";export{getMasterPassRequestToken}from"./api/masterpass/index.js";export{listMerchantSettings}from"./api/merchant/index.js";export{getOrderLineFile,getProductCampaigns,getProductFilterData,getRelatedProducts,getSuggestedProducts,getVariantStockLocations,listProductAttribute,listProductBackInStockRemind,listProductOptionSet,saveProductBackInStockRemind,searchProducts}from"./api/product/index.js";export{listRaffleMetaData,listRaffleParticipants,listStorefrontRaffle,saveRaffleParticipant}from"./api/raffle/index.js";export{getStorefrontSettings}from"./api/storefront/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-api",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.5",
|
|
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.2.0-beta.
|
|
21
|
-
"@ikas/storefront-models": "^4.2.0-beta.
|
|
20
|
+
"@ikas/storefront-config": "^4.2.0-beta.5",
|
|
21
|
+
"@ikas/storefront-models": "^4.2.0-beta.5",
|
|
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.19"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@ikas/storefront-config": "^4.2.0-beta.
|
|
38
|
-
"@ikas/storefront-models": "^4.2.0-beta.
|
|
37
|
+
"@ikas/storefront-config": "^4.2.0-beta.5",
|
|
38
|
+
"@ikas/storefront-models": "^4.2.0-beta.5",
|
|
39
39
|
"@ikas/fe-api-client": "^1.0.18",
|
|
40
40
|
"axios": "^0.26.0",
|
|
41
41
|
"ts-essentials": "^7.0.1"
|