@misiki/gocommerce-connector 0.7.0 → 0.8.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.
@@ -1 +1 @@
1
- export { a as AddressService, c as Approval, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, m as CartService, n as CatalogService, p as CategoryService, q as ChatService, t as CheckoutService, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, G as Credit, H as CurrencyService, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, P as FaqService, Q as FeedbackService, S as GalleryService, T as HomeLayout, U as HomeLayoutSection, V as HomeService, X as InitService, Y as Invitation, Z as LayoutService, _ as Lead, a0 as MeilisearchService, a1 as Member, a4 as MenuService, a7 as NewsletterService, ab as OrderService, ac as PageService, ae as PaymentMethodService, ag as PluginService, ag as PluginsService, ah as PopularSearchService, ai as PopularityService, al as ProductService, am as ProfileService, an as Quote, ao as REDIRECT_GATEWAYS, ap as ReelsService, aq as RegionService, ar as RejectedLine, au as ReviewService, ax as SearchService, ay as SettingService, ay as SettingsService, aA as StateService, aC as StoreService, aE as StorefrontMenu, aH as UploadService, aI as UserService, aL as VariantService, aM as VarniCustomDesignService, aN as VarniCustomProductService, aP as VendorService, aQ as WarrantyService, aT as WishlistService, aU as addressService, aV as authService, aW as autocompleteService, aX as b2bService, aY as bannerService, aZ as blogService, a_ as cartService, a$ as categoryService, b0 as chatService, b1 as checkoutService, b2 as collectionService, b3 as contactService, b4 as countryService, b5 as couponService, b7 as currencyService, b8 as dealService, b9 as demoRequestService, bb as emptyPage, bc as enquiryService, bd as faqService, be as feedbackService, bi as galleryService, bj as homeService, bk as initService, bl as layoutService, bm as mediaUrl, bn as meilisearchService, bo as menuService, bq as newsletterService, br as orderService, bs as ownDomain, bt as pageService, bu as paymentMethodService, bv as pluginService, bw as pluginsService, bx as popularSearchService, by as popularityService, bB as productService, bC as profileService, bD as qs, bE as reelsService, bF as regionService, bG as reviewService, bH as searchService, bI as setRequestHost, bJ as settingService, bK as settingsService, bL as stateService, bM as staticStore, bN as storeForHost, bO as storeService, bZ as toPage, c3 as uploadService, c4 as userService, c5 as variantService, c6 as varniCustomDesignService, c7 as varniCustomProductService, c8 as vendorService, c9 as warrantyService, ca as wishlistService } from '../index-D-hnd6-D.cjs';
1
+ export { a as AddressService, c as Approval, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, m as CartService, n as CatalogService, p as CategoryService, q as ChatService, t as CheckoutService, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, G as Credit, H as CurrencyService, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, P as FaqService, Q as FeedbackService, S as GalleryService, T as HomeLayout, U as HomeLayoutSection, V as HomeService, X as InitService, Y as Invitation, Z as LayoutCollection, _ as LayoutService, $ as Lead, a1 as MeilisearchService, a2 as Member, a5 as MenuService, a8 as NewsletterService, ac as OrderService, ad as PageService, af as PaymentMethodService, ah as PluginService, ah as PluginsService, ai as PopularSearchService, aj as PopularityService, am as ProductService, an as ProfileService, ao as Quote, ap as REDIRECT_GATEWAYS, aq as ReelsService, ar as RegionService, as as RejectedLine, av as ReviewService, ay as SearchService, az as SettingService, az as SettingsService, aB as StateService, aD as StoreService, aF as StorefrontMenu, aI as ThemeSettings, aJ as ThemeSettingsResult, aK as UploadService, aL as UserService, aO as VariantService, aP as VarniCustomDesignService, aQ as VarniCustomProductService, aS as VendorService, aT as WarrantyService, aW as WishlistService, aX as addressService, aY as authService, aZ as autocompleteService, a_ as b2bService, a$ as bannerService, b0 as blogService, b1 as cartService, b2 as categoryService, b3 as chatService, b4 as checkoutService, b5 as collectionService, b6 as contactService, b7 as countryService, b8 as couponService, ba as currencyService, bb as dealService, bc as demoRequestService, be as emptyPage, bf as enquiryService, bg as faqService, bh as feedbackService, bl as galleryService, bm as homeService, bn as initService, bo as layoutService, bp as mediaUrl, bq as meilisearchService, br as menuService, bt as newsletterService, bu as orderService, bv as ownDomain, bw as pageService, bx as paymentMethodService, by as pluginService, bz as pluginsService, bA as popularSearchService, bB as popularityService, bE as productService, bF as profileService, bG as qs, bH as reelsService, bI as regionService, bJ as reviewService, bK as searchService, bL as setRequestHost, bM as settingService, bN as settingsService, bO as stateService, bP as staticStore, bQ as storeForHost, bR as storeService, c0 as toPage, c6 as uploadService, c7 as userService, c8 as variantService, c9 as varniCustomDesignService, ca as varniCustomProductService, cb as vendorService, cc as warrantyService, cd as wishlistService } from '../index-inrM-B0Z.cjs';
@@ -1 +1 @@
1
- export { a as AddressService, c as Approval, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, m as CartService, n as CatalogService, p as CategoryService, q as ChatService, t as CheckoutService, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, G as Credit, H as CurrencyService, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, P as FaqService, Q as FeedbackService, S as GalleryService, T as HomeLayout, U as HomeLayoutSection, V as HomeService, X as InitService, Y as Invitation, Z as LayoutService, _ as Lead, a0 as MeilisearchService, a1 as Member, a4 as MenuService, a7 as NewsletterService, ab as OrderService, ac as PageService, ae as PaymentMethodService, ag as PluginService, ag as PluginsService, ah as PopularSearchService, ai as PopularityService, al as ProductService, am as ProfileService, an as Quote, ao as REDIRECT_GATEWAYS, ap as ReelsService, aq as RegionService, ar as RejectedLine, au as ReviewService, ax as SearchService, ay as SettingService, ay as SettingsService, aA as StateService, aC as StoreService, aE as StorefrontMenu, aH as UploadService, aI as UserService, aL as VariantService, aM as VarniCustomDesignService, aN as VarniCustomProductService, aP as VendorService, aQ as WarrantyService, aT as WishlistService, aU as addressService, aV as authService, aW as autocompleteService, aX as b2bService, aY as bannerService, aZ as blogService, a_ as cartService, a$ as categoryService, b0 as chatService, b1 as checkoutService, b2 as collectionService, b3 as contactService, b4 as countryService, b5 as couponService, b7 as currencyService, b8 as dealService, b9 as demoRequestService, bb as emptyPage, bc as enquiryService, bd as faqService, be as feedbackService, bi as galleryService, bj as homeService, bk as initService, bl as layoutService, bm as mediaUrl, bn as meilisearchService, bo as menuService, bq as newsletterService, br as orderService, bs as ownDomain, bt as pageService, bu as paymentMethodService, bv as pluginService, bw as pluginsService, bx as popularSearchService, by as popularityService, bB as productService, bC as profileService, bD as qs, bE as reelsService, bF as regionService, bG as reviewService, bH as searchService, bI as setRequestHost, bJ as settingService, bK as settingsService, bL as stateService, bM as staticStore, bN as storeForHost, bO as storeService, bZ as toPage, c3 as uploadService, c4 as userService, c5 as variantService, c6 as varniCustomDesignService, c7 as varniCustomProductService, c8 as vendorService, c9 as warrantyService, ca as wishlistService } from '../index-D-hnd6-D.js';
1
+ export { a as AddressService, c as Approval, e as AuthService, f as AutocompleteService, B as B2bPlaced, g as B2bRole, h as B2bService, i as BannerService, j as BaseService, k as BlogService, m as CartService, n as CatalogService, p as CategoryService, q as ChatService, t as CheckoutService, w as CollectionService, x as Company, y as CompanyOrder, z as ContactService, D as CountryService, E as CouponService, G as Credit, H as CurrencyService, J as DealService, K as DemoRequestService, L as EngineRequest, M as EnquiryService, P as FaqService, Q as FeedbackService, S as GalleryService, T as HomeLayout, U as HomeLayoutSection, V as HomeService, X as InitService, Y as Invitation, Z as LayoutCollection, _ as LayoutService, $ as Lead, a1 as MeilisearchService, a2 as Member, a5 as MenuService, a8 as NewsletterService, ac as OrderService, ad as PageService, af as PaymentMethodService, ah as PluginService, ah as PluginsService, ai as PopularSearchService, aj as PopularityService, am as ProductService, an as ProfileService, ao as Quote, ap as REDIRECT_GATEWAYS, aq as ReelsService, ar as RegionService, as as RejectedLine, av as ReviewService, ay as SearchService, az as SettingService, az as SettingsService, aB as StateService, aD as StoreService, aF as StorefrontMenu, aI as ThemeSettings, aJ as ThemeSettingsResult, aK as UploadService, aL as UserService, aO as VariantService, aP as VarniCustomDesignService, aQ as VarniCustomProductService, aS as VendorService, aT as WarrantyService, aW as WishlistService, aX as addressService, aY as authService, aZ as autocompleteService, a_ as b2bService, a$ as bannerService, b0 as blogService, b1 as cartService, b2 as categoryService, b3 as chatService, b4 as checkoutService, b5 as collectionService, b6 as contactService, b7 as countryService, b8 as couponService, ba as currencyService, bb as dealService, bc as demoRequestService, be as emptyPage, bf as enquiryService, bg as faqService, bh as feedbackService, bl as galleryService, bm as homeService, bn as initService, bo as layoutService, bp as mediaUrl, bq as meilisearchService, br as menuService, bt as newsletterService, bu as orderService, bv as ownDomain, bw as pageService, bx as paymentMethodService, by as pluginService, bz as pluginsService, bA as popularSearchService, bB as popularityService, bE as productService, bF as profileService, bG as qs, bH as reelsService, bI as regionService, bJ as reviewService, bK as searchService, bL as setRequestHost, bM as settingService, bN as settingsService, bO as stateService, bP as staticStore, bQ as storeForHost, bR as storeService, c0 as toPage, c6 as uploadService, c7 as userService, c8 as variantService, c9 as varniCustomDesignService, ca as varniCustomProductService, cb as vendorService, cc as warrantyService, cd as wishlistService } from '../index-inrM-B0Z.js';
@@ -2740,7 +2740,7 @@ var pageService = new PageService();
2740
2740
  var faqService = new FaqService();
2741
2741
 
2742
2742
  // src/services/layout-service.ts
2743
- var IMAGE_KEYS = ["image", "mobile_image"];
2743
+ var MEDIA_KEYS = /* @__PURE__ */ new Set(["image", "mobile_image", "poster", "video_file"]);
2744
2744
  var LayoutService = class extends BaseService {
2745
2745
  async getHomeLayout({ preview } = {}) {
2746
2746
  let layout;
@@ -2758,17 +2758,53 @@ var LayoutService = class extends BaseService {
2758
2758
  theme: layout.theme,
2759
2759
  revision: layout.revision,
2760
2760
  preview: !!layout.preview,
2761
+ themeSettings: tokens(layout.theme_settings),
2761
2762
  sections: (layout.sections ?? []).map(toSection)
2762
2763
  };
2763
2764
  }
2765
+ /**
2766
+ * The store's design tokens, for a page other than the home page: the
2767
+ * published ones, or a preview key's draft. Null when there are none to
2768
+ * apply — nothing published, the editor off, an engine without the
2769
+ * module — and on any failure too: a missing look must never cost the
2770
+ * page.
2771
+ */
2772
+ async getThemeSettings({ preview } = {}) {
2773
+ try {
2774
+ const out = await this.data("/x/layouts/theme", {
2775
+ query: { preview: preview?.trim() || void 0 }
2776
+ });
2777
+ if (!out) return null;
2778
+ return { revision: out.revision, preview: !!out.preview, settings: tokens(out.settings) ?? {} };
2779
+ } catch {
2780
+ return null;
2781
+ }
2782
+ }
2764
2783
  };
2765
- function toSection(s) {
2766
- const settings = { ...s.settings ?? {} };
2767
- for (const key of IMAGE_KEYS) {
2768
- if (typeof settings[key] === "string") settings[key] = mediaUrl(settings[key]);
2784
+ function tokens(v) {
2785
+ return v && typeof v === "object" && !Array.isArray(v) && Object.keys(v).length ? { ...v } : null;
2786
+ }
2787
+ function withMedia(value, key) {
2788
+ if (Array.isArray(value)) return value.map((x) => withMedia(x, null));
2789
+ if (value && typeof value === "object") {
2790
+ return Object.fromEntries(Object.entries(value).map(([k, x]) => [k, withMedia(x, k)]));
2769
2791
  }
2792
+ if (key && MEDIA_KEYS.has(key) && typeof value === "string") return mediaUrl(value);
2793
+ return value;
2794
+ }
2795
+ function toSection(s) {
2796
+ const settings = withMedia(s.settings ?? {}, null);
2770
2797
  const out = { id: s.id, type: s.type, settings };
2771
2798
  if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
2799
+ if (s.type === "collection-list") {
2800
+ out.collections = (s.collections ?? []).map((c) => ({
2801
+ id: String(c.id),
2802
+ title: c.title,
2803
+ slug: c.slug,
2804
+ link: `/collections/${c.slug}`,
2805
+ image: mediaUrl(c.image) ?? null
2806
+ }));
2807
+ }
2772
2808
  return out;
2773
2809
  }
2774
2810
  var layoutService = new LayoutService();