@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
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 LayoutService, $ as Lead, a0 as ListMeta, a1 as MeilisearchService, a2 as Member, a3 as Menu, a4 as MenuItem, a5 as MenuService, a6 as MenuSummary, a7 as Money, a8 as NewsletterService, a9 as Offer, aa as Order, ab as OrderLine, ac as OrderService, ad as PageService, ae as PaymentIntent, af as PaymentMethodService, ag as Plugin, ah as PluginService, ah as PluginsService, ai as PopularSearchService, aj as PopularityService, ak as Product, al as ProductOption, am as ProductService, an as ProfileService, ao as Quote, ap as REDIRECT_GATEWAYS, aq as ReelsService, ar as RegionService, as as RejectedLine, at as Review, au as ReviewPage, av as ReviewService, aw as SearchDoc, ax as SearchResult, ay as SearchService, az as SettingService, az as SettingsService, aA as ShippingRate, aB as StateService, aC as StoreProfile, aD as StoreService, aE as StorefrontCategory, aF as StorefrontMenu, aG as StorefrontOrder, aH as StorefrontProduct, aI as ThemeSettings, aJ as ThemeSettingsResult, aK as UploadService, aL as UserService, aM as Variant, aN as VariantImage, aO as VariantService, aP as VarniCustomDesignService, aQ as VarniCustomProductService, aR as Vendor, aS as VendorService, aT as WarrantyService, aU as Wishlist, aV as WishlistItem, 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, b9 as currencyExponent, ba as currencyService, bb as dealService, bc as demoRequestService, bd as emptyCart, be as emptyPage, bf as enquiryService, bg as faqService, bh as feedbackService, bi as fromEngineAddress, bj as fromIdentityAddress, bk as fromSearchDoc, bl as galleryService, bm as homeService, bn as initService, bo as layoutService, bp as mediaUrl, bq as meilisearchService, br as menuService, bs as minorToMajor, 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, bC as priceOf, bD as productImages, 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, bS as toCart, bT as toCartLine, bU as toCategory, bV as toCmsPage, bW as toCollection, bX as toEngineAddress, bY as toIdentityAddress, bZ as toMajor, b_ as toMinor, b$ as toOrder, c0 as toPage, c1 as toProduct, c2 as toRating, c3 as toUser, c4 as toVariant, c5 as toVendor, 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';
|
|
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 LayoutService, $ as Lead, a0 as ListMeta, a1 as MeilisearchService, a2 as Member, a3 as Menu, a4 as MenuItem, a5 as MenuService, a6 as MenuSummary, a7 as Money, a8 as NewsletterService, a9 as Offer, aa as Order, ab as OrderLine, ac as OrderService, ad as PageService, ae as PaymentIntent, af as PaymentMethodService, ag as Plugin, ah as PluginService, ah as PluginsService, ai as PopularSearchService, aj as PopularityService, ak as Product, al as ProductOption, am as ProductService, an as ProfileService, ao as Quote, ap as REDIRECT_GATEWAYS, aq as ReelsService, ar as RegionService, as as RejectedLine, at as Review, au as ReviewPage, av as ReviewService, aw as SearchDoc, ax as SearchResult, ay as SearchService, az as SettingService, az as SettingsService, aA as ShippingRate, aB as StateService, aC as StoreProfile, aD as StoreService, aE as StorefrontCategory, aF as StorefrontMenu, aG as StorefrontOrder, aH as StorefrontProduct, aI as ThemeSettings, aJ as ThemeSettingsResult, aK as UploadService, aL as UserService, aM as Variant, aN as VariantImage, aO as VariantService, aP as VarniCustomDesignService, aQ as VarniCustomProductService, aR as Vendor, aS as VendorService, aT as WarrantyService, aU as Wishlist, aV as WishlistItem, 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, b9 as currencyExponent, ba as currencyService, bb as dealService, bc as demoRequestService, bd as emptyCart, be as emptyPage, bf as enquiryService, bg as faqService, bh as feedbackService, bi as fromEngineAddress, bj as fromIdentityAddress, bk as fromSearchDoc, bl as galleryService, bm as homeService, bn as initService, bo as layoutService, bp as mediaUrl, bq as meilisearchService, br as menuService, bs as minorToMajor, 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, bC as priceOf, bD as productImages, 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, bS as toCart, bT as toCartLine, bU as toCategory, bV as toCmsPage, bW as toCollection, bX as toEngineAddress, bY as toIdentityAddress, bZ as toMajor, b_ as toMinor, b$ as toOrder, c0 as toPage, c1 as toProduct, c2 as toRating, c3 as toUser, c4 as toVariant, c5 as toVendor, 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';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two ways a call through this connector fails.
|
package/dist/index.js
CHANGED
|
@@ -2756,7 +2756,7 @@ 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
2762
|
let layout;
|
|
@@ -2774,17 +2774,53 @@ var LayoutService = class extends BaseService {
|
|
|
2774
2774
|
theme: layout.theme,
|
|
2775
2775
|
revision: layout.revision,
|
|
2776
2776
|
preview: !!layout.preview,
|
|
2777
|
+
themeSettings: tokens(layout.theme_settings),
|
|
2777
2778
|
sections: (layout.sections ?? []).map(toSection)
|
|
2778
2779
|
};
|
|
2779
2780
|
}
|
|
2781
|
+
/**
|
|
2782
|
+
* The store's design tokens, for a page other than the home page: the
|
|
2783
|
+
* published ones, or a preview key's draft. Null when there are none to
|
|
2784
|
+
* apply — nothing published, the editor off, an engine without the
|
|
2785
|
+
* module — and on any failure too: a missing look must never cost the
|
|
2786
|
+
* page.
|
|
2787
|
+
*/
|
|
2788
|
+
async getThemeSettings({ preview } = {}) {
|
|
2789
|
+
try {
|
|
2790
|
+
const out = await this.data("/x/layouts/theme", {
|
|
2791
|
+
query: { preview: preview?.trim() || void 0 }
|
|
2792
|
+
});
|
|
2793
|
+
if (!out) return null;
|
|
2794
|
+
return { revision: out.revision, preview: !!out.preview, settings: tokens(out.settings) ?? {} };
|
|
2795
|
+
} catch {
|
|
2796
|
+
return null;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2780
2799
|
};
|
|
2781
|
-
function
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2800
|
+
function tokens(v) {
|
|
2801
|
+
return v && typeof v === "object" && !Array.isArray(v) && Object.keys(v).length ? { ...v } : null;
|
|
2802
|
+
}
|
|
2803
|
+
function withMedia(value, key) {
|
|
2804
|
+
if (Array.isArray(value)) return value.map((x) => withMedia(x, null));
|
|
2805
|
+
if (value && typeof value === "object") {
|
|
2806
|
+
return Object.fromEntries(Object.entries(value).map(([k, x]) => [k, withMedia(x, k)]));
|
|
2785
2807
|
}
|
|
2808
|
+
if (key && MEDIA_KEYS.has(key) && typeof value === "string") return mediaUrl(value);
|
|
2809
|
+
return value;
|
|
2810
|
+
}
|
|
2811
|
+
function toSection(s) {
|
|
2812
|
+
const settings = withMedia(s.settings ?? {}, null);
|
|
2786
2813
|
const out = { id: s.id, type: s.type, settings };
|
|
2787
2814
|
if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
|
|
2815
|
+
if (s.type === "collection-list") {
|
|
2816
|
+
out.collections = (s.collections ?? []).map((c) => ({
|
|
2817
|
+
id: String(c.id),
|
|
2818
|
+
title: c.title,
|
|
2819
|
+
slug: c.slug,
|
|
2820
|
+
link: `/collections/${c.slug}`,
|
|
2821
|
+
image: mediaUrl(c.image) ?? null
|
|
2822
|
+
}));
|
|
2823
|
+
}
|
|
2788
2824
|
return out;
|
|
2789
2825
|
}
|
|
2790
2826
|
var layoutService = new LayoutService();
|