@misiki/gocommerce-connector 0.28.0 → 0.29.0
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/README.md +5 -0
- package/dist/{index-BaFtBtaA.d.cts → index-DOlNI60Y.d.cts} +11 -21
- package/dist/{index-BaFtBtaA.d.ts → index-DOlNI60Y.d.ts} +11 -21
- package/dist/index.cjs +20 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +20 -3
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +20 -3
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as CustomizerDesign, M as CustomizerDocument, N as CustomizerEditor, O as CustomizerFile, P as CustomizerLayer, Q as CustomizerSavedDesign, R as CustomizerService, S as CustomizerSetup, T as CustomizerUpload, U as DealService, V as DemoRequestService, W as EngineRequest, X as EnquiryService, Y as Envelope, Z as FacetValue, _ as Faq, $ as FaqService, a0 as FeedbackService, a1 as FooterSettings, a2 as FreeShipping, a3 as Fulfillment, a4 as GalleryService, a5 as GooglePlace, a6 as GoogleReview, a7 as GoogleReviewService, a8 as GoogleReviews, a9 as GoogleSurvey, aa as HeaderSettings, ab as HomeLayout, ac as HomeLayoutSection, ad as HomeService, ae as IdentityAddress, af as InitService, ag as Invitation, ah as LayoutCollection, ai as LayoutPage, aj as LayoutService, ak as Lead, al as ListMeta, am as MeilisearchService, an as Member, ao as Menu, ap as MenuItem, aq as MenuService, ar as MenuSummary, as as Money, at as NewsletterService, au as Offer, av as OpeningHours, aw as Order, ax as OrderLine, ay as OrderService, az as PageLayout, aA as PageService, aB as PaymentIntent, aC as PaymentMethodService, aD as Plugin, aE as PluginService, aE as PluginsService, aF as PopularSearchService, aG as PopularityService, aH as Postcode, aI as Product, aJ as ProductFacets, aK as ProductOption, aL as ProductService, aM as ProfileService, aN as Quote, aO as REDIRECT_GATEWAYS, aP as ReelsService, aQ as RegionService, aR as RejectedLine, aS as Review, aT as ReviewPage, aU as ReviewService, aV as SearchDoc, aW as SearchResult, aX as SearchService, aY as SettingService, aY as SettingsService, aZ as ShippingRate, a_ as SiteChrome, a$ as SiteFooter, b0 as SiteHeader, b1 as SocialLink, b2 as StateService, b3 as StoreProfile, b4 as StoreService, b5 as StorefrontCategory, b6 as StorefrontMenu, b7 as StorefrontOrder, b8 as StorefrontProduct, b9 as ThemeSettings, ba as ThemeSettingsResult, bb as UploadService, bc as UserService, bd as Variant, be as VariantImage, bf as VariantService, bg as VarniCustomDesignService, bh as VarniCustomProductService, bi as Vendor, bj as VendorService, bk as WarrantyService, bl as WhatsappConsent, bm as WhatsappConsentOffer, bn as WhatsappService, bo as Wishlist, bp as WishlistItem, bq as WishlistService, br as addressService, bs as authService, bt as autocompleteService, bu as b2bService, bv as bannerService, bw as blogService, bx as cartService, by as categoryService, bz as chatService, bA as checkoutService, bB as collectionService, bC as contactService, bD as countryService, bE as couponService, bF as currencyExponent, bG as currencyService, bH as customizerService, bI as dealService, bJ as demoRequestService, bK as emptyCart, bL as emptyPage, bM as enquiryService, bN as faqService, bO as feedbackService, bP as fromEngineAddress, bQ as fromIdentityAddress, bR as fromSearchDoc, bS as galleryService, bT as googleReviewService, bU as homeService, bV as initService, bW as layoutService, bX as mediaUrl, bY as meilisearchService, bZ as menuService, b_ as minorToMajor, b$ as newsletterService, c0 as orderService, c1 as ownDomain, c2 as pageService, c3 as paymentMethodService, c4 as pluginService, c5 as pluginsService, c6 as popularSearchService, c7 as popularityService, c8 as priceOf, c9 as productImages, ca as productService, cb as productVideos, cc as profileService, cd as qs, ce as reelsService, cf as regionService, cg as reviewService, ch as searchService, ci as setRequestHost, cj as settingService, ck as settingsService, cl as stateService, cm as staticStore, cn as storeForHost, co as storeService, cp as toAddOn, cq as toCart, cr as toCartLine, cs as toCartOffer, ct as toCategory, cu as toCmsPage, cv as toCollection, cw as toEngineAddress, cx as toFreeShipping, cy as toIdentityAddress, cz as toMajor, cA as toMinor, cB as toOrder, cC as toPage, cD as toProduct, cE as toRating, cF as toStorefrontFacets, cG as toUser, cH as toVariant, cI as toVendor, cJ as uploadService, cK as userService, cL as variantService, cM as varniCustomDesignService, cN as varniCustomProductService, cO as vendorService, cP as warrantyService, cQ as whatsappService, cR as wishlistService } from './index-
|
|
1
|
+
export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as CustomizerDesign, M as CustomizerDocument, N as CustomizerEditor, O as CustomizerFile, P as CustomizerLayer, Q as CustomizerSavedDesign, R as CustomizerService, S as CustomizerSetup, T as CustomizerUpload, U as DealService, V as DemoRequestService, W as EngineRequest, X as EnquiryService, Y as Envelope, Z as FacetValue, _ as Faq, $ as FaqService, a0 as FeedbackService, a1 as FooterSettings, a2 as FreeShipping, a3 as Fulfillment, a4 as GalleryService, a5 as GooglePlace, a6 as GoogleReview, a7 as GoogleReviewService, a8 as GoogleReviews, a9 as GoogleSurvey, aa as HeaderSettings, ab as HomeLayout, ac as HomeLayoutSection, ad as HomeService, ae as IdentityAddress, af as InitService, ag as Invitation, ah as LayoutCollection, ai as LayoutPage, aj as LayoutService, ak as Lead, al as ListMeta, am as MeilisearchService, an as Member, ao as Menu, ap as MenuItem, aq as MenuService, ar as MenuSummary, as as Money, at as NewsletterService, au as Offer, av as OpeningHours, aw as Order, ax as OrderLine, ay as OrderService, az as PageLayout, aA as PageService, aB as PaymentIntent, aC as PaymentMethodService, aD as Plugin, aE as PluginService, aE as PluginsService, aF as PopularSearchService, aG as PopularityService, aH as Postcode, aI as Product, aJ as ProductFacets, aK as ProductOption, aL as ProductService, aM as ProfileService, aN as Quote, aO as REDIRECT_GATEWAYS, aP as ReelsService, aQ as RegionService, aR as RejectedLine, aS as Review, aT as ReviewPage, aU as ReviewService, aV as SearchDoc, aW as SearchResult, aX as SearchService, aY as SettingService, aY as SettingsService, aZ as ShippingRate, a_ as SiteChrome, a$ as SiteFooter, b0 as SiteHeader, b1 as SocialLink, b2 as StateService, b3 as StoreProfile, b4 as StoreService, b5 as StorefrontCategory, b6 as StorefrontMenu, b7 as StorefrontOrder, b8 as StorefrontProduct, b9 as ThemeSettings, ba as ThemeSettingsResult, bb as UploadService, bc as UserService, bd as Variant, be as VariantImage, bf as VariantService, bg as VarniCustomDesignService, bh as VarniCustomProductService, bi as Vendor, bj as VendorService, bk as WarrantyService, bl as WhatsappConsent, bm as WhatsappConsentOffer, bn as WhatsappService, bo as Wishlist, bp as WishlistItem, bq as WishlistService, br as addressService, bs as authService, bt as autocompleteService, bu as b2bService, bv as bannerService, bw as blogService, bx as cartService, by as categoryService, bz as chatService, bA as checkoutService, bB as collectionService, bC as contactService, bD as countryService, bE as couponService, bF as currencyExponent, bG as currencyService, bH as customizerService, bI as dealService, bJ as demoRequestService, bK as emptyCart, bL as emptyPage, bM as enquiryService, bN as faqService, bO as feedbackService, bP as fromEngineAddress, bQ as fromIdentityAddress, bR as fromSearchDoc, bS as galleryService, bT as googleReviewService, bU as homeService, bV as initService, bW as layoutService, bX as mediaUrl, bY as meilisearchService, bZ as menuService, b_ as minorToMajor, b$ as newsletterService, c0 as orderService, c1 as ownDomain, c2 as pageService, c3 as paymentMethodService, c4 as pluginService, c5 as pluginsService, c6 as popularSearchService, c7 as popularityService, c8 as priceOf, c9 as productImages, ca as productService, cb as productVideos, cc as profileService, cd as qs, ce as reelsService, cf as regionService, cg as reviewService, ch as searchService, ci as setRequestHost, cj as settingService, ck as settingsService, cl as stateService, cm as staticStore, cn as storeForHost, co as storeService, cp as toAddOn, cq as toCart, cr as toCartLine, cs as toCartOffer, ct as toCategory, cu as toCmsPage, cv as toCollection, cw as toEngineAddress, cx as toFreeShipping, cy as toIdentityAddress, cz as toMajor, cA as toMinor, cB as toOrder, cC as toPage, cD as toProduct, cE as toRating, cF as toStorefrontFacets, cG as toUser, cH as toVariant, cI as toVendor, cJ as uploadService, cK as userService, cL as variantService, cM as varniCustomDesignService, cN as varniCustomProductService, cO as vendorService, cP as warrantyService, cQ as whatsappService, cR as wishlistService } from './index-DOlNI60Y.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two ways a call through this connector fails.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as CustomizerDesign, M as CustomizerDocument, N as CustomizerEditor, O as CustomizerFile, P as CustomizerLayer, Q as CustomizerSavedDesign, R as CustomizerService, S as CustomizerSetup, T as CustomizerUpload, U as DealService, V as DemoRequestService, W as EngineRequest, X as EnquiryService, Y as Envelope, Z as FacetValue, _ as Faq, $ as FaqService, a0 as FeedbackService, a1 as FooterSettings, a2 as FreeShipping, a3 as Fulfillment, a4 as GalleryService, a5 as GooglePlace, a6 as GoogleReview, a7 as GoogleReviewService, a8 as GoogleReviews, a9 as GoogleSurvey, aa as HeaderSettings, ab as HomeLayout, ac as HomeLayoutSection, ad as HomeService, ae as IdentityAddress, af as InitService, ag as Invitation, ah as LayoutCollection, ai as LayoutPage, aj as LayoutService, ak as Lead, al as ListMeta, am as MeilisearchService, an as Member, ao as Menu, ap as MenuItem, aq as MenuService, ar as MenuSummary, as as Money, at as NewsletterService, au as Offer, av as OpeningHours, aw as Order, ax as OrderLine, ay as OrderService, az as PageLayout, aA as PageService, aB as PaymentIntent, aC as PaymentMethodService, aD as Plugin, aE as PluginService, aE as PluginsService, aF as PopularSearchService, aG as PopularityService, aH as Postcode, aI as Product, aJ as ProductFacets, aK as ProductOption, aL as ProductService, aM as ProfileService, aN as Quote, aO as REDIRECT_GATEWAYS, aP as ReelsService, aQ as RegionService, aR as RejectedLine, aS as Review, aT as ReviewPage, aU as ReviewService, aV as SearchDoc, aW as SearchResult, aX as SearchService, aY as SettingService, aY as SettingsService, aZ as ShippingRate, a_ as SiteChrome, a$ as SiteFooter, b0 as SiteHeader, b1 as SocialLink, b2 as StateService, b3 as StoreProfile, b4 as StoreService, b5 as StorefrontCategory, b6 as StorefrontMenu, b7 as StorefrontOrder, b8 as StorefrontProduct, b9 as ThemeSettings, ba as ThemeSettingsResult, bb as UploadService, bc as UserService, bd as Variant, be as VariantImage, bf as VariantService, bg as VarniCustomDesignService, bh as VarniCustomProductService, bi as Vendor, bj as VendorService, bk as WarrantyService, bl as WhatsappConsent, bm as WhatsappConsentOffer, bn as WhatsappService, bo as Wishlist, bp as WishlistItem, bq as WishlistService, br as addressService, bs as authService, bt as autocompleteService, bu as b2bService, bv as bannerService, bw as blogService, bx as cartService, by as categoryService, bz as chatService, bA as checkoutService, bB as collectionService, bC as contactService, bD as countryService, bE as couponService, bF as currencyExponent, bG as currencyService, bH as customizerService, bI as dealService, bJ as demoRequestService, bK as emptyCart, bL as emptyPage, bM as enquiryService, bN as faqService, bO as feedbackService, bP as fromEngineAddress, bQ as fromIdentityAddress, bR as fromSearchDoc, bS as galleryService, bT as googleReviewService, bU as homeService, bV as initService, bW as layoutService, bX as mediaUrl, bY as meilisearchService, bZ as menuService, b_ as minorToMajor, b$ as newsletterService, c0 as orderService, c1 as ownDomain, c2 as pageService, c3 as paymentMethodService, c4 as pluginService, c5 as pluginsService, c6 as popularSearchService, c7 as popularityService, c8 as priceOf, c9 as productImages, ca as productService, cb as productVideos, cc as profileService, cd as qs, ce as reelsService, cf as regionService, cg as reviewService, ch as searchService, ci as setRequestHost, cj as settingService, ck as settingsService, cl as stateService, cm as staticStore, cn as storeForHost, co as storeService, cp as toAddOn, cq as toCart, cr as toCartLine, cs as toCartOffer, ct as toCategory, cu as toCmsPage, cv as toCollection, cw as toEngineAddress, cx as toFreeShipping, cy as toIdentityAddress, cz as toMajor, cA as toMinor, cB as toOrder, cC as toPage, cD as toProduct, cE as toRating, cF as toStorefrontFacets, cG as toUser, cH as toVariant, cI as toVendor, cJ as uploadService, cK as userService, cL as variantService, cM as varniCustomDesignService, cN as varniCustomProductService, cO as vendorService, cP as warrantyService, cQ as whatsappService, cR as wishlistService } from './index-
|
|
1
|
+
export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as CustomizerDesign, M as CustomizerDocument, N as CustomizerEditor, O as CustomizerFile, P as CustomizerLayer, Q as CustomizerSavedDesign, R as CustomizerService, S as CustomizerSetup, T as CustomizerUpload, U as DealService, V as DemoRequestService, W as EngineRequest, X as EnquiryService, Y as Envelope, Z as FacetValue, _ as Faq, $ as FaqService, a0 as FeedbackService, a1 as FooterSettings, a2 as FreeShipping, a3 as Fulfillment, a4 as GalleryService, a5 as GooglePlace, a6 as GoogleReview, a7 as GoogleReviewService, a8 as GoogleReviews, a9 as GoogleSurvey, aa as HeaderSettings, ab as HomeLayout, ac as HomeLayoutSection, ad as HomeService, ae as IdentityAddress, af as InitService, ag as Invitation, ah as LayoutCollection, ai as LayoutPage, aj as LayoutService, ak as Lead, al as ListMeta, am as MeilisearchService, an as Member, ao as Menu, ap as MenuItem, aq as MenuService, ar as MenuSummary, as as Money, at as NewsletterService, au as Offer, av as OpeningHours, aw as Order, ax as OrderLine, ay as OrderService, az as PageLayout, aA as PageService, aB as PaymentIntent, aC as PaymentMethodService, aD as Plugin, aE as PluginService, aE as PluginsService, aF as PopularSearchService, aG as PopularityService, aH as Postcode, aI as Product, aJ as ProductFacets, aK as ProductOption, aL as ProductService, aM as ProfileService, aN as Quote, aO as REDIRECT_GATEWAYS, aP as ReelsService, aQ as RegionService, aR as RejectedLine, aS as Review, aT as ReviewPage, aU as ReviewService, aV as SearchDoc, aW as SearchResult, aX as SearchService, aY as SettingService, aY as SettingsService, aZ as ShippingRate, a_ as SiteChrome, a$ as SiteFooter, b0 as SiteHeader, b1 as SocialLink, b2 as StateService, b3 as StoreProfile, b4 as StoreService, b5 as StorefrontCategory, b6 as StorefrontMenu, b7 as StorefrontOrder, b8 as StorefrontProduct, b9 as ThemeSettings, ba as ThemeSettingsResult, bb as UploadService, bc as UserService, bd as Variant, be as VariantImage, bf as VariantService, bg as VarniCustomDesignService, bh as VarniCustomProductService, bi as Vendor, bj as VendorService, bk as WarrantyService, bl as WhatsappConsent, bm as WhatsappConsentOffer, bn as WhatsappService, bo as Wishlist, bp as WishlistItem, bq as WishlistService, br as addressService, bs as authService, bt as autocompleteService, bu as b2bService, bv as bannerService, bw as blogService, bx as cartService, by as categoryService, bz as chatService, bA as checkoutService, bB as collectionService, bC as contactService, bD as countryService, bE as couponService, bF as currencyExponent, bG as currencyService, bH as customizerService, bI as dealService, bJ as demoRequestService, bK as emptyCart, bL as emptyPage, bM as enquiryService, bN as faqService, bO as feedbackService, bP as fromEngineAddress, bQ as fromIdentityAddress, bR as fromSearchDoc, bS as galleryService, bT as googleReviewService, bU as homeService, bV as initService, bW as layoutService, bX as mediaUrl, bY as meilisearchService, bZ as menuService, b_ as minorToMajor, b$ as newsletterService, c0 as orderService, c1 as ownDomain, c2 as pageService, c3 as paymentMethodService, c4 as pluginService, c5 as pluginsService, c6 as popularSearchService, c7 as popularityService, c8 as priceOf, c9 as productImages, ca as productService, cb as productVideos, cc as profileService, cd as qs, ce as reelsService, cf as regionService, cg as reviewService, ch as searchService, ci as setRequestHost, cj as settingService, ck as settingsService, cl as stateService, cm as staticStore, cn as storeForHost, co as storeService, cp as toAddOn, cq as toCart, cr as toCartLine, cs as toCartOffer, ct as toCategory, cu as toCmsPage, cv as toCollection, cw as toEngineAddress, cx as toFreeShipping, cy as toIdentityAddress, cz as toMajor, cA as toMinor, cB as toOrder, cC as toPage, cD as toProduct, cE as toRating, cF as toStorefrontFacets, cG as toUser, cH as toVariant, cI as toVendor, cJ as uploadService, cK as userService, cL as variantService, cM as varniCustomDesignService, cN as varniCustomProductService, cO as vendorService, cP as warrantyService, cQ as whatsappService, cR as wishlistService } from './index-DOlNI60Y.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two ways a call through this connector fails.
|
package/dist/index.js
CHANGED
|
@@ -1591,7 +1591,23 @@ function attributesFrom(p) {
|
|
|
1591
1591
|
return Object.keys(out).length ? out : void 0;
|
|
1592
1592
|
}
|
|
1593
1593
|
var counts = (values) => Object.fromEntries((values ?? []).map((v) => [v.value, v.count]));
|
|
1594
|
-
function
|
|
1594
|
+
function categoryFacets(counted, tree) {
|
|
1595
|
+
const byId = new Map(tree.map((c) => [c.id, c]));
|
|
1596
|
+
const totals = /* @__PURE__ */ new Map();
|
|
1597
|
+
for (const { id: id2, count } of counted) {
|
|
1598
|
+
for (let c = byId.get(id2); c; c = c.parent_id === null ? void 0 : byId.get(c.parent_id)) {
|
|
1599
|
+
totals.set(c.id, (totals.get(c.id) ?? 0) + count);
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
const kept = tree.filter((c) => totals.has(c.id)).sort((a, b) => a.position - b.position || a.id - b.id);
|
|
1603
|
+
const parentOf = (c) => c.parent_id !== null && byId.has(c.parent_id) ? c.parent_id : null;
|
|
1604
|
+
const under = (parent) => kept.filter((c) => parentOf(c) === parent).flatMap((c) => [{ name: c.title, slug: c.slug, count: totals.get(c.id), depth: c.depth }, ...under(c.id)]);
|
|
1605
|
+
return [
|
|
1606
|
+
...under(null),
|
|
1607
|
+
...counted.filter((c) => !byId.has(c.id)).map((c) => ({ name: c.title, slug: c.slug, count: c.count, depth: 0 }))
|
|
1608
|
+
];
|
|
1609
|
+
}
|
|
1610
|
+
function toStorefrontFacets(f, tree = []) {
|
|
1595
1611
|
if (!f) return { priceStat: {}, categories: [], tags: [], allFilters: {} };
|
|
1596
1612
|
const allFilters = {};
|
|
1597
1613
|
const group = (key, values) => {
|
|
@@ -1602,7 +1618,7 @@ function toStorefrontFacets(f) {
|
|
|
1602
1618
|
for (const [handle, values] of Object.entries(f.attributes ?? {})) group(`attributes.${handle}`, values);
|
|
1603
1619
|
return {
|
|
1604
1620
|
priceStat: f.price ? { min: toMajor(f.price.min), max: toMajor(f.price.max) } : {},
|
|
1605
|
-
categories: (f.categories ?? []
|
|
1621
|
+
categories: categoryFacets(f.categories ?? [], tree),
|
|
1606
1622
|
tags: (f.tags ?? []).map((t) => ({ name: t.value, count: t.count })),
|
|
1607
1623
|
allFilters
|
|
1608
1624
|
};
|
|
@@ -1635,13 +1651,14 @@ var SearchService = class extends CatalogService {
|
|
|
1635
1651
|
productTypes: listParam(p, "product_type"),
|
|
1636
1652
|
facets: true
|
|
1637
1653
|
});
|
|
1654
|
+
const tree = res.facets?.categories?.length ? await this.facts.categories().catch(() => []) : [];
|
|
1638
1655
|
return {
|
|
1639
1656
|
data: res.data,
|
|
1640
1657
|
count: res.count,
|
|
1641
1658
|
totalPages: res.noOfPage,
|
|
1642
1659
|
page: res.page,
|
|
1643
1660
|
categoryHierarchy: res.categoryHierarchy,
|
|
1644
|
-
facets: toStorefrontFacets(res.facets)
|
|
1661
|
+
facets: toStorefrontFacets(res.facets, tree)
|
|
1645
1662
|
};
|
|
1646
1663
|
} catch (err) {
|
|
1647
1664
|
if (err?.status === 404) return this.emptyResult();
|