@misiki/gocommerce-connector 0.9.1 → 0.10.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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Address, a as AddressService, b as AppliedDiscount, c as Approval, d as AuthResponse, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, C as Cart, l as CartLine, m as CartService, n as CatalogService, o as Category, p as CategoryService, q as ChatService, r as CheckoutOptions, s as CheckoutResult, t as CheckoutService, u as CmsPage, v as Collection, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, F as Credentials, G as Credit, H as CurrencyService, I as Customer, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, N as Envelope, O as Faq, P as FaqService, Q as FeedbackService, R as Fulfillment, S as GalleryService, T as HomeLayout, U as HomeLayoutSection, V as HomeService, W as IdentityAddress, X as InitService, Y as Invitation, Z as LayoutCollection, _ as LayoutPage, $ as LayoutService, a0 as Lead, a1 as ListMeta, a2 as MeilisearchService, a3 as Member, a4 as Menu, a5 as MenuItem, a6 as MenuService, a7 as MenuSummary, a8 as Money, a9 as NewsletterService, aa as Offer, ab as Order, ac as OrderLine, ad as OrderService, ae as PageLayout, af as PageService, ag as PaymentIntent, ah as PaymentMethodService, ai as Plugin, aj as PluginService, aj as PluginsService, ak as PopularSearchService, al as PopularityService, am as Product, an as ProductOption, ao as ProductService, ap as ProfileService, aq as Quote, ar as REDIRECT_GATEWAYS, as as ReelsService, at as RegionService, au as RejectedLine, av as Review, aw as ReviewPage, ax as ReviewService, ay as SearchDoc, az as SearchResult, aA as SearchService, aB as SettingService, aB as SettingsService, aC as ShippingRate, aD as StateService, aE as StoreProfile, aF as StoreService, aG as StorefrontCategory, aH as StorefrontMenu, aI as StorefrontOrder, aJ as StorefrontProduct, aK as ThemeSettings, aL as ThemeSettingsResult, aM as UploadService, aN as UserService, aO as Variant, aP as VariantImage, aQ as VariantService, aR as VarniCustomDesignService, aS as VarniCustomProductService, aT as Vendor, aU as VendorService, aV as WarrantyService, aW as Wishlist, aX as WishlistItem, aY as WishlistService, aZ as addressService, a_ as authService, a$ as autocompleteService, b0 as b2bService, b1 as bannerService, b2 as blogService, b3 as cartService, b4 as categoryService, b5 as chatService, b6 as checkoutService, b7 as collectionService, b8 as contactService, b9 as countryService, ba as couponService, bb as currencyExponent, bc as currencyService, bd as dealService, be as demoRequestService, bf as emptyCart, bg as emptyPage, bh as enquiryService, bi as faqService, bj as feedbackService, bk as fromEngineAddress, bl as fromIdentityAddress, bm as fromSearchDoc, bn as galleryService, bo as homeService, bp as initService, bq as layoutService, br as mediaUrl, bs as meilisearchService, bt as menuService, bu as minorToMajor, bv as newsletterService, bw as orderService, bx as ownDomain, by as pageService, bz as paymentMethodService, bA as pluginService, bB as pluginsService, bC as popularSearchService, bD as popularityService, bE as priceOf, bF as productImages, bG as productService, bH as profileService, bI as qs, bJ as reelsService, bK as regionService, bL as reviewService, bM as searchService, bN as setRequestHost, bO as settingService, bP as settingsService, bQ as stateService, bR as staticStore, bS as storeForHost, bT as storeService, bU as toCart, bV as toCartLine, bW as toCategory, bX as toCmsPage, bY as toCollection, bZ as toEngineAddress, b_ as toIdentityAddress, b$ as toMajor, c0 as toMinor, c1 as toOrder, c2 as toPage, c3 as toProduct, c4 as toRating, c5 as toUser, c6 as toVariant, c7 as toVendor, c8 as uploadService, c9 as userService, ca as variantService, cb as varniCustomDesignService, cc as varniCustomProductService, cd as vendorService, ce as warrantyService, cf as wishlistService } from './index-DSvV8FbK.cjs';
1
+ export { A as Address, a as AddressService, b as AppliedDiscount, c as Approval, d as AuthResponse, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, C as Cart, l as CartLine, m as CartService, n as CatalogService, o as Category, p as CategoryService, q as ChatService, r as CheckoutOptions, s as CheckoutResult, t as CheckoutService, u as CmsPage, v as Collection, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, F as Credentials, G as Credit, H as CurrencyService, I as Customer, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, N as Envelope, O as FacetValue, P as Faq, Q as FaqService, R as FeedbackService, S as Fulfillment, T as GalleryService, U as HomeLayout, V as HomeLayoutSection, W as HomeService, X as IdentityAddress, Y as InitService, Z as Invitation, _ as LayoutCollection, $ as LayoutPage, a0 as LayoutService, a1 as Lead, a2 as ListMeta, a3 as MeilisearchService, a4 as Member, a5 as Menu, a6 as MenuItem, a7 as MenuService, a8 as MenuSummary, a9 as Money, aa as NewsletterService, ab as Offer, ac as Order, ad as OrderLine, ae as OrderService, af as PageLayout, ag as PageService, ah as PaymentIntent, ai as PaymentMethodService, aj as Plugin, ak as PluginService, ak as PluginsService, al as PopularSearchService, am as PopularityService, an as Product, ao as ProductFacets, ap as ProductOption, aq as ProductService, ar as ProfileService, as as Quote, at as REDIRECT_GATEWAYS, au as ReelsService, av as RegionService, aw as RejectedLine, ax as Review, ay as ReviewPage, az as ReviewService, aA as SearchDoc, aB as SearchResult, aC as SearchService, aD as SettingService, aD as SettingsService, aE as ShippingRate, aF as StateService, aG as StoreProfile, aH as StoreService, aI as StorefrontCategory, aJ as StorefrontMenu, aK as StorefrontOrder, aL as StorefrontProduct, aM as ThemeSettings, aN as ThemeSettingsResult, aO as UploadService, aP as UserService, aQ as Variant, aR as VariantImage, aS as VariantService, aT as VarniCustomDesignService, aU as VarniCustomProductService, aV as Vendor, aW as VendorService, aX as WarrantyService, aY as Wishlist, aZ as WishlistItem, a_ as WishlistService, a$ as addressService, b0 as authService, b1 as autocompleteService, b2 as b2bService, b3 as bannerService, b4 as blogService, b5 as cartService, b6 as categoryService, b7 as chatService, b8 as checkoutService, b9 as collectionService, ba as contactService, bb as countryService, bc as couponService, bd as currencyExponent, be as currencyService, bf as dealService, bg as demoRequestService, bh as emptyCart, bi as emptyPage, bj as enquiryService, bk as faqService, bl as feedbackService, bm as fromEngineAddress, bn as fromIdentityAddress, bo as fromSearchDoc, bp as galleryService, bq as homeService, br as initService, bs as layoutService, bt as mediaUrl, bu as meilisearchService, bv as menuService, bw as minorToMajor, bx as newsletterService, by as orderService, bz as ownDomain, bA as pageService, bB as paymentMethodService, bC as pluginService, bD as pluginsService, bE as popularSearchService, bF as popularityService, bG as priceOf, bH as productImages, bI as productService, bJ as profileService, bK as qs, bL as reelsService, bM as regionService, bN as reviewService, bO as searchService, bP as setRequestHost, bQ as settingService, bR as settingsService, bS as stateService, bT as staticStore, bU as storeForHost, bV as storeService, bW as toCart, bX as toCartLine, bY as toCategory, bZ as toCmsPage, b_ as toCollection, b$ as toEngineAddress, c0 as toIdentityAddress, c1 as toMajor, c2 as toMinor, c3 as toOrder, c4 as toPage, c5 as toProduct, c6 as toRating, c7 as toStorefrontFacets, c8 as toUser, c9 as toVariant, ca as toVendor, cb as uploadService, cc as userService, cd as variantService, ce as varniCustomDesignService, cf as varniCustomProductService, cg as vendorService, ch as warrantyService, ci as wishlistService } from './index-mqcHZ96i.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 Address, a as AddressService, b as AppliedDiscount, c as Approval, d as AuthResponse, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, C as Cart, l as CartLine, m as CartService, n as CatalogService, o as Category, p as CategoryService, q as ChatService, r as CheckoutOptions, s as CheckoutResult, t as CheckoutService, u as CmsPage, v as Collection, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, F as Credentials, G as Credit, H as CurrencyService, I as Customer, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, N as Envelope, O as Faq, P as FaqService, Q as FeedbackService, R as Fulfillment, S as GalleryService, T as HomeLayout, U as HomeLayoutSection, V as HomeService, W as IdentityAddress, X as InitService, Y as Invitation, Z as LayoutCollection, _ as LayoutPage, $ as LayoutService, a0 as Lead, a1 as ListMeta, a2 as MeilisearchService, a3 as Member, a4 as Menu, a5 as MenuItem, a6 as MenuService, a7 as MenuSummary, a8 as Money, a9 as NewsletterService, aa as Offer, ab as Order, ac as OrderLine, ad as OrderService, ae as PageLayout, af as PageService, ag as PaymentIntent, ah as PaymentMethodService, ai as Plugin, aj as PluginService, aj as PluginsService, ak as PopularSearchService, al as PopularityService, am as Product, an as ProductOption, ao as ProductService, ap as ProfileService, aq as Quote, ar as REDIRECT_GATEWAYS, as as ReelsService, at as RegionService, au as RejectedLine, av as Review, aw as ReviewPage, ax as ReviewService, ay as SearchDoc, az as SearchResult, aA as SearchService, aB as SettingService, aB as SettingsService, aC as ShippingRate, aD as StateService, aE as StoreProfile, aF as StoreService, aG as StorefrontCategory, aH as StorefrontMenu, aI as StorefrontOrder, aJ as StorefrontProduct, aK as ThemeSettings, aL as ThemeSettingsResult, aM as UploadService, aN as UserService, aO as Variant, aP as VariantImage, aQ as VariantService, aR as VarniCustomDesignService, aS as VarniCustomProductService, aT as Vendor, aU as VendorService, aV as WarrantyService, aW as Wishlist, aX as WishlistItem, aY as WishlistService, aZ as addressService, a_ as authService, a$ as autocompleteService, b0 as b2bService, b1 as bannerService, b2 as blogService, b3 as cartService, b4 as categoryService, b5 as chatService, b6 as checkoutService, b7 as collectionService, b8 as contactService, b9 as countryService, ba as couponService, bb as currencyExponent, bc as currencyService, bd as dealService, be as demoRequestService, bf as emptyCart, bg as emptyPage, bh as enquiryService, bi as faqService, bj as feedbackService, bk as fromEngineAddress, bl as fromIdentityAddress, bm as fromSearchDoc, bn as galleryService, bo as homeService, bp as initService, bq as layoutService, br as mediaUrl, bs as meilisearchService, bt as menuService, bu as minorToMajor, bv as newsletterService, bw as orderService, bx as ownDomain, by as pageService, bz as paymentMethodService, bA as pluginService, bB as pluginsService, bC as popularSearchService, bD as popularityService, bE as priceOf, bF as productImages, bG as productService, bH as profileService, bI as qs, bJ as reelsService, bK as regionService, bL as reviewService, bM as searchService, bN as setRequestHost, bO as settingService, bP as settingsService, bQ as stateService, bR as staticStore, bS as storeForHost, bT as storeService, bU as toCart, bV as toCartLine, bW as toCategory, bX as toCmsPage, bY as toCollection, bZ as toEngineAddress, b_ as toIdentityAddress, b$ as toMajor, c0 as toMinor, c1 as toOrder, c2 as toPage, c3 as toProduct, c4 as toRating, c5 as toUser, c6 as toVariant, c7 as toVendor, c8 as uploadService, c9 as userService, ca as variantService, cb as varniCustomDesignService, cc as varniCustomProductService, cd as vendorService, ce as warrantyService, cf as wishlistService } from './index-DSvV8FbK.js';
1
+ export { A as Address, a as AddressService, b as AppliedDiscount, c as Approval, d as AuthResponse, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, C as Cart, l as CartLine, m as CartService, n as CatalogService, o as Category, p as CategoryService, q as ChatService, r as CheckoutOptions, s as CheckoutResult, t as CheckoutService, u as CmsPage, v as Collection, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, F as Credentials, G as Credit, H as CurrencyService, I as Customer, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, N as Envelope, O as FacetValue, P as Faq, Q as FaqService, R as FeedbackService, S as Fulfillment, T as GalleryService, U as HomeLayout, V as HomeLayoutSection, W as HomeService, X as IdentityAddress, Y as InitService, Z as Invitation, _ as LayoutCollection, $ as LayoutPage, a0 as LayoutService, a1 as Lead, a2 as ListMeta, a3 as MeilisearchService, a4 as Member, a5 as Menu, a6 as MenuItem, a7 as MenuService, a8 as MenuSummary, a9 as Money, aa as NewsletterService, ab as Offer, ac as Order, ad as OrderLine, ae as OrderService, af as PageLayout, ag as PageService, ah as PaymentIntent, ai as PaymentMethodService, aj as Plugin, ak as PluginService, ak as PluginsService, al as PopularSearchService, am as PopularityService, an as Product, ao as ProductFacets, ap as ProductOption, aq as ProductService, ar as ProfileService, as as Quote, at as REDIRECT_GATEWAYS, au as ReelsService, av as RegionService, aw as RejectedLine, ax as Review, ay as ReviewPage, az as ReviewService, aA as SearchDoc, aB as SearchResult, aC as SearchService, aD as SettingService, aD as SettingsService, aE as ShippingRate, aF as StateService, aG as StoreProfile, aH as StoreService, aI as StorefrontCategory, aJ as StorefrontMenu, aK as StorefrontOrder, aL as StorefrontProduct, aM as ThemeSettings, aN as ThemeSettingsResult, aO as UploadService, aP as UserService, aQ as Variant, aR as VariantImage, aS as VariantService, aT as VarniCustomDesignService, aU as VarniCustomProductService, aV as Vendor, aW as VendorService, aX as WarrantyService, aY as Wishlist, aZ as WishlistItem, a_ as WishlistService, a$ as addressService, b0 as authService, b1 as autocompleteService, b2 as b2bService, b3 as bannerService, b4 as blogService, b5 as cartService, b6 as categoryService, b7 as chatService, b8 as checkoutService, b9 as collectionService, ba as contactService, bb as countryService, bc as couponService, bd as currencyExponent, be as currencyService, bf as dealService, bg as demoRequestService, bh as emptyCart, bi as emptyPage, bj as enquiryService, bk as faqService, bl as feedbackService, bm as fromEngineAddress, bn as fromIdentityAddress, bo as fromSearchDoc, bp as galleryService, bq as homeService, br as initService, bs as layoutService, bt as mediaUrl, bu as meilisearchService, bv as menuService, bw as minorToMajor, bx as newsletterService, by as orderService, bz as ownDomain, bA as pageService, bB as paymentMethodService, bC as pluginService, bD as pluginsService, bE as popularSearchService, bF as popularityService, bG as priceOf, bH as productImages, bI as productService, bJ as profileService, bK as qs, bL as reelsService, bM as regionService, bN as reviewService, bO as searchService, bP as setRequestHost, bQ as settingService, bR as settingsService, bS as stateService, bT as staticStore, bU as storeForHost, bV as storeService, bW as toCart, bX as toCartLine, bY as toCategory, bZ as toCmsPage, b_ as toCollection, b$ as toEngineAddress, c0 as toIdentityAddress, c1 as toMajor, c2 as toMinor, c3 as toOrder, c4 as toPage, c5 as toProduct, c6 as toRating, c7 as toStorefrontFacets, c8 as toUser, c9 as toVariant, ca as toVendor, cb as uploadService, cc as userService, cd as variantService, ce as varniCustomDesignService, cf as varniCustomProductService, cg as vendorService, ch as warrantyService, ci as wishlistService } from './index-mqcHZ96i.js';
2
2
 
3
3
  /**
4
4
  * The two ways a call through this connector fails.
package/dist/index.js CHANGED
@@ -1084,11 +1084,14 @@ var StoreFacts = class extends BaseService {
1084
1084
 
1085
1085
  // src/services/catalog.ts
1086
1086
  var PAGE_SIZE = 24;
1087
- function indexSort(sort) {
1088
- if (!sort) return void 0;
1087
+ function sortParts(sort) {
1089
1088
  const s = sort.trim();
1090
1089
  const [field, dir] = s.startsWith("-") ? [s.slice(1), "desc"] : s.includes(":") ? s.split(":") : [s, "asc"];
1091
- const d = dir === "desc" ? "desc" : "asc";
1090
+ return [field, dir === "desc" ? "desc" : "asc"];
1091
+ }
1092
+ function indexSort(sort) {
1093
+ if (!sort) return void 0;
1094
+ const [field, d] = sortParts(sort);
1092
1095
  switch (field) {
1093
1096
  case "price":
1094
1097
  return `price_minor:${d}`;
@@ -1104,6 +1107,20 @@ function indexSort(sort) {
1104
1107
  return void 0;
1105
1108
  }
1106
1109
  }
1110
+ function engineSort(sort) {
1111
+ if (!sort || NATURAL.has(sort)) return {};
1112
+ const [field, order] = sortParts(sort);
1113
+ const key = {
1114
+ price: "price",
1115
+ createdAt: "created_at",
1116
+ created_at: "created_at",
1117
+ updatedAt: "updated_at",
1118
+ updated_at: "updated_at",
1119
+ title: "title",
1120
+ name: "title"
1121
+ }[field];
1122
+ return key ? { sort: key, order } : {};
1123
+ }
1107
1124
  var NATURAL = /* @__PURE__ */ new Set([
1108
1125
  "-createdAt",
1109
1126
  "createdAt:desc",
@@ -1113,6 +1130,7 @@ var NATURAL = /* @__PURE__ */ new Set([
1113
1130
  "popularity:desc"
1114
1131
  ]);
1115
1132
  var quote = (s) => `"${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
1133
+ var legacyListing = /* @__PURE__ */ new Set();
1116
1134
  var CatalogService = class extends BaseService {
1117
1135
  facts = new StoreFacts(this._fetch);
1118
1136
  async queryCatalog(q) {
@@ -1122,6 +1140,39 @@ var CatalogService = class extends BaseService {
1122
1140
  const wantsRange = Number.isFinite(q.priceFrom) || Number.isFinite(q.priceTo);
1123
1141
  const sortKey = q.sort && !NATURAL.has(q.sort) ? indexSort(q.sort) : void 0;
1124
1142
  const hierarchy = q.category ? await this.facts.hierarchy(q.category) : [];
1143
+ const attr = Object.entries(q.attributes ?? {}).flatMap(
1144
+ ([handle, values]) => values.filter(Boolean).map((v) => `${handle}:${v}`)
1145
+ );
1146
+ if (q.facets && !legacyListing.has(this.engineBase())) {
1147
+ const { currency } = await this.facts.ready();
1148
+ const minor = (n) => Number.isFinite(n) ? Math.max(0, toMinor(n, currency)) : void 0;
1149
+ const env2 = await this.engine("/api/products", {
1150
+ query: {
1151
+ q: search,
1152
+ page,
1153
+ limit,
1154
+ channel: this.creds.channel,
1155
+ category: q.category,
1156
+ tag: q.tags,
1157
+ vendor: q.vendors,
1158
+ product_type: q.productTypes,
1159
+ attr,
1160
+ price_min: minor(q.priceFrom),
1161
+ price_max: minor(q.priceTo),
1162
+ ...engineSort(q.sort),
1163
+ facets: 1
1164
+ }
1165
+ });
1166
+ if (env2.meta?.facets) {
1167
+ return {
1168
+ ...toPage(env2, (p) => toProduct(p)),
1169
+ categoryHierarchy: hierarchy,
1170
+ sorted: true,
1171
+ facets: env2.meta.facets
1172
+ };
1173
+ }
1174
+ legacyListing.add(this.engineBase());
1175
+ }
1125
1176
  if ((sortKey || wantsRange) && await this.facts.pluginOn("meilisearch")) {
1126
1177
  const filters = [];
1127
1178
  if (q.category) {
@@ -1169,9 +1220,6 @@ var CatalogService = class extends BaseService {
1169
1220
  sorted
1170
1221
  };
1171
1222
  }
1172
- const attr = Object.entries(q.attributes ?? {}).flatMap(
1173
- ([handle, values]) => values.filter(Boolean).map((v) => `${handle}:${v}`)
1174
- );
1175
1223
  const env = await this.engine("/api/products", {
1176
1224
  query: { q: search, page, limit, channel: this.creds.channel, attr }
1177
1225
  });
@@ -1337,16 +1385,44 @@ var num = (v) => {
1337
1385
  const n = Number(v);
1338
1386
  return Number.isFinite(n) ? n : void 0;
1339
1387
  };
1388
+ function decodeOnce(v) {
1389
+ try {
1390
+ return decodeURIComponent(v);
1391
+ } catch {
1392
+ return v;
1393
+ }
1394
+ }
1395
+ function listParam(p, key) {
1396
+ const out = p.getAll(key).flatMap((v) => decodeOnce(v).split(",")).map((v) => v.trim()).filter(Boolean);
1397
+ return out.length ? out : void 0;
1398
+ }
1340
1399
  function attributesFrom(p) {
1341
1400
  const out = {};
1342
- for (const [key, value] of p) {
1401
+ for (const key of new Set(p.keys())) {
1343
1402
  if (!key.startsWith("attributes.")) continue;
1344
1403
  const handle = key.slice("attributes.".length);
1345
- const values = value.split(",").map((v) => decodeURIComponent(v).trim()).filter(Boolean);
1346
- if (handle && values.length) out[handle] = [...out[handle] ?? [], ...values];
1404
+ const values = listParam(p, key);
1405
+ if (handle && values) out[handle] = values;
1347
1406
  }
1348
1407
  return Object.keys(out).length ? out : void 0;
1349
1408
  }
1409
+ var counts = (values) => Object.fromEntries((values ?? []).map((v) => [v.value, v.count]));
1410
+ function toStorefrontFacets(f) {
1411
+ if (!f) return { priceStat: {}, categories: [], tags: [], allFilters: {} };
1412
+ const allFilters = {};
1413
+ const group = (key, values) => {
1414
+ if (values?.length) allFilters[key] = counts(values);
1415
+ };
1416
+ group("vendor", f.vendors);
1417
+ group("product_type", f.product_types);
1418
+ for (const [handle, values] of Object.entries(f.attributes ?? {})) group(`attributes.${handle}`, values);
1419
+ return {
1420
+ priceStat: f.price ? { min: toMajor(f.price.min), max: toMajor(f.price.max) } : {},
1421
+ categories: (f.categories ?? []).map((c) => ({ name: c.title, slug: c.slug, count: c.count })),
1422
+ tags: (f.tags ?? []).map((t) => ({ name: t.value, count: t.count })),
1423
+ allFilters
1424
+ };
1425
+ }
1350
1426
  var SearchService = class extends CatalogService {
1351
1427
  emptyResult() {
1352
1428
  return {
@@ -1354,7 +1430,7 @@ var SearchService = class extends CatalogService {
1354
1430
  count: 0,
1355
1431
  totalPages: 0,
1356
1432
  categoryHierarchy: [],
1357
- facets: { priceStat: {}, categories: [], tags: [], allFilters: {} }
1433
+ facets: toStorefrontFacets()
1358
1434
  };
1359
1435
  }
1360
1436
  async searchWithUrl(url, slug) {
@@ -1369,7 +1445,11 @@ var SearchService = class extends CatalogService {
1369
1445
  category: slug || p.get("categories")?.split(",")[0] || void 0,
1370
1446
  priceFrom: num(p.get("priceFrom")) ?? num(from ?? null),
1371
1447
  priceTo: num(p.get("priceTo")) ?? num(to ?? null),
1372
- attributes: attributesFrom(p)
1448
+ attributes: attributesFrom(p),
1449
+ tags: listParam(p, "tags"),
1450
+ vendors: listParam(p, "vendor"),
1451
+ productTypes: listParam(p, "product_type"),
1452
+ facets: true
1373
1453
  });
1374
1454
  return {
1375
1455
  data: res.data,
@@ -1377,7 +1457,7 @@ var SearchService = class extends CatalogService {
1377
1457
  totalPages: res.noOfPage,
1378
1458
  page: res.page,
1379
1459
  categoryHierarchy: res.categoryHierarchy,
1380
- facets: { priceStat: {}, categories: [], tags: [], allFilters: {} }
1460
+ facets: toStorefrontFacets(res.facets)
1381
1461
  };
1382
1462
  } catch (err) {
1383
1463
  if (err?.status === 404) return this.emptyResult();
@@ -3403,6 +3483,6 @@ function attemptKey(request) {
3403
3483
  }
3404
3484
  var b2bService = new B2bService();
3405
3485
 
3406
- export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, GoCommerceError, HomeService, InitService, LayoutService, MeilisearchService, MenuService, NewsletterService, NotSupportedError, OrderService, PageService, PaymentMethodService, PluginService, PluginService as PluginsService, PopularSearchService, PopularityService, ProductService, ProfileService, REDIRECT_GATEWAYS, ReelsService, RegionService, ReviewService, SearchService, SettingService, SettingService as SettingsService, StateService, StoreService, UploadService, UserService, VariantService, VarniCustomDesignService, VarniCustomProductService, VendorService, WarrantyService, WishlistService, addressService, authService, autocompleteService, b2bService, bannerService, blogService, cartService, categoryService, chatService, checkoutService, forgetAll as clearStoreCache, collectionService, connectorName, contactService, countryService, couponService, currencyExponent, currencyService, dealService, demoRequestService, emptyCart, emptyPage, enquiryService, faqService, feedbackService, fromEngineAddress, fromIdentityAddress, fromSearchDoc, galleryService, hasStaticStore, homeService, initService, layoutService, mediaUrl, meilisearchService, menuService, minorToMajor, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, priceOf, productImages, productService, profileService, qs, readStaticStore, reelsService, regionService, reviewService, searchService, serveRestLocally, setRequestHost, setStaticStore, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toCart, toCartLine, toCategory, toCmsPage, toCollection, toEngineAddress, toIdentityAddress, toMajor, toMinor, toOrder, toPage, toProduct, toRating, toUser, toVariant, toVendor, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
3486
+ export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, GoCommerceError, HomeService, InitService, LayoutService, MeilisearchService, MenuService, NewsletterService, NotSupportedError, OrderService, PageService, PaymentMethodService, PluginService, PluginService as PluginsService, PopularSearchService, PopularityService, ProductService, ProfileService, REDIRECT_GATEWAYS, ReelsService, RegionService, ReviewService, SearchService, SettingService, SettingService as SettingsService, StateService, StoreService, UploadService, UserService, VariantService, VarniCustomDesignService, VarniCustomProductService, VendorService, WarrantyService, WishlistService, addressService, authService, autocompleteService, b2bService, bannerService, blogService, cartService, categoryService, chatService, checkoutService, forgetAll as clearStoreCache, collectionService, connectorName, contactService, countryService, couponService, currencyExponent, currencyService, dealService, demoRequestService, emptyCart, emptyPage, enquiryService, faqService, feedbackService, fromEngineAddress, fromIdentityAddress, fromSearchDoc, galleryService, hasStaticStore, homeService, initService, layoutService, mediaUrl, meilisearchService, menuService, minorToMajor, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, priceOf, productImages, productService, profileService, qs, readStaticStore, reelsService, regionService, reviewService, searchService, serveRestLocally, setRequestHost, setStaticStore, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toCart, toCartLine, toCategory, toCmsPage, toCollection, toEngineAddress, toIdentityAddress, toMajor, toMinor, toOrder, toPage, toProduct, toRating, toStorefrontFacets, toUser, toVariant, toVendor, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
3407
3487
  //# sourceMappingURL=index.js.map
3408
3488
  //# sourceMappingURL=index.js.map