@misiki/gocommerce-connector 0.7.0 → 0.9.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 +19 -8
- package/dist/{index-D-hnd6-D.d.cts → index-72kQMxjZ.d.cts} +63 -2
- package/dist/{index-D-hnd6-D.d.ts → index-72kQMxjZ.d.ts} +63 -2
- package/dist/index.cjs +58 -6
- 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 +58 -6
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +58 -6
- 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 +58 -6
- 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 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
|
|
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-72kQMxjZ.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
|
|
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-72kQMxjZ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two ways a call through this connector fails.
|
package/dist/index.js
CHANGED
|
@@ -2756,12 +2756,28 @@ var pageService = new PageService();
|
|
|
2756
2756
|
var faqService = new FaqService();
|
|
2757
2757
|
|
|
2758
2758
|
// src/services/layout-service.ts
|
|
2759
|
-
var
|
|
2759
|
+
var MEDIA_KEYS = /* @__PURE__ */ new Set(["image", "mobile_image", "poster", "video_file"]);
|
|
2760
2760
|
var LayoutService = class extends BaseService {
|
|
2761
2761
|
async getHomeLayout({ preview } = {}) {
|
|
2762
|
+
return this.getPageLayout("home", { preview });
|
|
2763
|
+
}
|
|
2764
|
+
/**
|
|
2765
|
+
* The template every product page is drawn in: the sections around the
|
|
2766
|
+
* product's core (`main-product`). Null when none is published, so the
|
|
2767
|
+
* product page draws exactly as it did before templates existed.
|
|
2768
|
+
*/
|
|
2769
|
+
async getProductLayout({ preview } = {}) {
|
|
2770
|
+
return this.getPageLayout("product", { preview });
|
|
2771
|
+
}
|
|
2772
|
+
/** The template every collection page is drawn in, around its grid (`main-collection`). */
|
|
2773
|
+
async getCollectionLayout({ preview } = {}) {
|
|
2774
|
+
return this.getPageLayout("collection", { preview });
|
|
2775
|
+
}
|
|
2776
|
+
/** Any arranged page by its key; null for none, as the three above. */
|
|
2777
|
+
async getPageLayout(page, { preview } = {}) {
|
|
2762
2778
|
let layout;
|
|
2763
2779
|
try {
|
|
2764
|
-
layout = await this.data(
|
|
2780
|
+
layout = await this.data(`/x/layouts/${encodeURIComponent(page)}`, {
|
|
2765
2781
|
query: { preview: preview?.trim() || void 0 }
|
|
2766
2782
|
});
|
|
2767
2783
|
} catch (err) {
|
|
@@ -2774,17 +2790,53 @@ var LayoutService = class extends BaseService {
|
|
|
2774
2790
|
theme: layout.theme,
|
|
2775
2791
|
revision: layout.revision,
|
|
2776
2792
|
preview: !!layout.preview,
|
|
2793
|
+
themeSettings: tokens(layout.theme_settings),
|
|
2777
2794
|
sections: (layout.sections ?? []).map(toSection)
|
|
2778
2795
|
};
|
|
2779
2796
|
}
|
|
2797
|
+
/**
|
|
2798
|
+
* The store's design tokens, for a page other than the home page: the
|
|
2799
|
+
* published ones, or a preview key's draft. Null when there are none to
|
|
2800
|
+
* apply — nothing published, the editor off, an engine without the
|
|
2801
|
+
* module — and on any failure too: a missing look must never cost the
|
|
2802
|
+
* page.
|
|
2803
|
+
*/
|
|
2804
|
+
async getThemeSettings({ preview } = {}) {
|
|
2805
|
+
try {
|
|
2806
|
+
const out = await this.data("/x/layouts/theme", {
|
|
2807
|
+
query: { preview: preview?.trim() || void 0 }
|
|
2808
|
+
});
|
|
2809
|
+
if (!out) return null;
|
|
2810
|
+
return { revision: out.revision, preview: !!out.preview, settings: tokens(out.settings) ?? {} };
|
|
2811
|
+
} catch {
|
|
2812
|
+
return null;
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2780
2815
|
};
|
|
2781
|
-
function
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2816
|
+
function tokens(v) {
|
|
2817
|
+
return v && typeof v === "object" && !Array.isArray(v) && Object.keys(v).length ? { ...v } : null;
|
|
2818
|
+
}
|
|
2819
|
+
function withMedia(value, key) {
|
|
2820
|
+
if (Array.isArray(value)) return value.map((x) => withMedia(x, null));
|
|
2821
|
+
if (value && typeof value === "object") {
|
|
2822
|
+
return Object.fromEntries(Object.entries(value).map(([k, x]) => [k, withMedia(x, k)]));
|
|
2785
2823
|
}
|
|
2824
|
+
if (key && MEDIA_KEYS.has(key) && typeof value === "string") return mediaUrl(value);
|
|
2825
|
+
return value;
|
|
2826
|
+
}
|
|
2827
|
+
function toSection(s) {
|
|
2828
|
+
const settings = withMedia(s.settings ?? {}, null);
|
|
2786
2829
|
const out = { id: s.id, type: s.type, settings };
|
|
2787
2830
|
if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
|
|
2831
|
+
if (s.type === "collection-list") {
|
|
2832
|
+
out.collections = (s.collections ?? []).map((c) => ({
|
|
2833
|
+
id: String(c.id),
|
|
2834
|
+
title: c.title,
|
|
2835
|
+
slug: c.slug,
|
|
2836
|
+
link: `/collections/${c.slug}`,
|
|
2837
|
+
image: mediaUrl(c.image) ?? null
|
|
2838
|
+
}));
|
|
2839
|
+
}
|
|
2788
2840
|
return out;
|
|
2789
2841
|
}
|
|
2790
2842
|
var layoutService = new LayoutService();
|