@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.
- package/README.md +18 -8
- package/dist/{index-D-hnd6-D.d.cts → index-inrM-B0Z.d.cts} +37 -2
- package/dist/{index-D-hnd6-D.d.ts → index-inrM-B0Z.d.ts} +37 -2
- package/dist/index.cjs +41 -5
- 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 +41 -5
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +41 -5
- 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 +41 -5
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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';
|
package/dist/services/index.d.ts
CHANGED
|
@@ -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
|
|
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';
|
package/dist/services/index.js
CHANGED
|
@@ -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
|
|
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
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
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();
|