@misiki/gocommerce-connector 0.4.9 → 0.7.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 +1 -0
- package/dist/{index-oCv5Dabq.d.cts → index-D-hnd6-D.d.cts} +248 -1
- package/dist/{index-oCv5Dabq.d.ts → index-D-hnd6-D.d.ts} +248 -1
- package/dist/index.cjs +61 -0
- 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 +60 -1
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +61 -0
- 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 +60 -1
- 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
|
|
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';
|
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
|
|
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';
|
package/dist/services/index.js
CHANGED
|
@@ -2032,6 +2032,31 @@ var OrderService = class extends BaseService {
|
|
|
2032
2032
|
async listPublic(_args = {}) {
|
|
2033
2033
|
return emptyPage();
|
|
2034
2034
|
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Opens an order with its number and the email or phone on it, no code. The
|
|
2037
|
+
* engine answers one 404 for an unknown number and a wrong contact. The
|
|
2038
|
+
* token it answers is kept like an order placed in this browser, so the
|
|
2039
|
+
* order page and `getOrder` read it again.
|
|
2040
|
+
*/
|
|
2041
|
+
async openOrder({ orderNo, contact }) {
|
|
2042
|
+
const res = await this.data(
|
|
2043
|
+
`/api/orders/${encodeURIComponent(orderNo.trim())}/open`,
|
|
2044
|
+
{ method: "POST", body: { contact: contact.trim() } }
|
|
2045
|
+
);
|
|
2046
|
+
rememberOrder({ number: res.order.number, token: res.access_token, cartId: "" });
|
|
2047
|
+
return { data: [toOrder(res.order)] };
|
|
2048
|
+
}
|
|
2049
|
+
/**
|
|
2050
|
+
* Opens an order from the link in its emails, which carries the order's key
|
|
2051
|
+
* (`/order-tracking?order=…&key=…`). The key is kept like an order placed in
|
|
2052
|
+
* this browser, so the page can drop it from the address bar.
|
|
2053
|
+
*/
|
|
2054
|
+
async openOrderWithKey({ orderNo, key }) {
|
|
2055
|
+
const number = orderNo.trim();
|
|
2056
|
+
const order = await this.data(`/api/orders/${encodeURIComponent(number)}`, { query: { token: key.trim() } });
|
|
2057
|
+
rememberOrder({ number: order.number, token: key.trim(), cartId: "" });
|
|
2058
|
+
return { data: [toOrder(order)] };
|
|
2059
|
+
}
|
|
2035
2060
|
/**
|
|
2036
2061
|
* Sends a 4-digit code to the email or phone on the order, when `contact`
|
|
2037
2062
|
* is that email or phone. The engine answers the same either way, so this
|
|
@@ -2714,6 +2739,40 @@ var FaqService = class extends BaseService {
|
|
|
2714
2739
|
var pageService = new PageService();
|
|
2715
2740
|
var faqService = new FaqService();
|
|
2716
2741
|
|
|
2742
|
+
// src/services/layout-service.ts
|
|
2743
|
+
var IMAGE_KEYS = ["image", "mobile_image"];
|
|
2744
|
+
var LayoutService = class extends BaseService {
|
|
2745
|
+
async getHomeLayout({ preview } = {}) {
|
|
2746
|
+
let layout;
|
|
2747
|
+
try {
|
|
2748
|
+
layout = await this.data("/x/layouts/home", {
|
|
2749
|
+
query: { preview: preview?.trim() || void 0 }
|
|
2750
|
+
});
|
|
2751
|
+
} catch (err) {
|
|
2752
|
+
if (err instanceof GoCommerceError && err.status === 404) return null;
|
|
2753
|
+
throw err;
|
|
2754
|
+
}
|
|
2755
|
+
if (!layout) return null;
|
|
2756
|
+
return {
|
|
2757
|
+
page: layout.page,
|
|
2758
|
+
theme: layout.theme,
|
|
2759
|
+
revision: layout.revision,
|
|
2760
|
+
preview: !!layout.preview,
|
|
2761
|
+
sections: (layout.sections ?? []).map(toSection)
|
|
2762
|
+
};
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
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]);
|
|
2769
|
+
}
|
|
2770
|
+
const out = { id: s.id, type: s.type, settings };
|
|
2771
|
+
if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
|
|
2772
|
+
return out;
|
|
2773
|
+
}
|
|
2774
|
+
var layoutService = new LayoutService();
|
|
2775
|
+
|
|
2717
2776
|
// src/services/vendor-service.ts
|
|
2718
2777
|
var VendorService = class extends BaseService {
|
|
2719
2778
|
async list({
|
|
@@ -3247,6 +3306,6 @@ function attemptKey(request) {
|
|
|
3247
3306
|
}
|
|
3248
3307
|
var b2bService = new B2bService();
|
|
3249
3308
|
|
|
3250
|
-
export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, HomeService, InitService, MeilisearchService, MenuService, NewsletterService, 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, collectionService, contactService, countryService, couponService, currencyService, dealService, demoRequestService, emptyPage, enquiryService, faqService, feedbackService, galleryService, homeService, initService, mediaUrl, meilisearchService, menuService, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, productService, profileService, qs, reelsService, regionService, reviewService, searchService, setRequestHost, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toPage, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
|
|
3309
|
+
export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, HomeService, InitService, LayoutService, MeilisearchService, MenuService, NewsletterService, 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, collectionService, contactService, countryService, couponService, currencyService, dealService, demoRequestService, emptyPage, enquiryService, faqService, feedbackService, galleryService, homeService, initService, layoutService, mediaUrl, meilisearchService, menuService, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, productService, profileService, qs, reelsService, regionService, reviewService, searchService, setRequestHost, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toPage, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
|
|
3251
3310
|
//# sourceMappingURL=index.js.map
|
|
3252
3311
|
//# sourceMappingURL=index.js.map
|