@misiki/gocommerce-connector 0.4.8 → 0.6.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-Bjx8kR8G.d.cts → index-1Tr-Urb_.d.cts} +42 -3
- package/dist/{index-Bjx8kR8G.d.ts → index-1Tr-Urb_.d.ts} +42 -3
- package/dist/index.cjs +44 -3
- 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 +43 -4
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +44 -3
- 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 +43 -4
- 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-1Tr-Urb_.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-1Tr-Urb_.js';
|
package/dist/services/index.js
CHANGED
|
@@ -2245,11 +2245,16 @@ var AuthService = class extends UserService {
|
|
|
2245
2245
|
return { errorCode: err.code ?? "invalid_token", message: err.message };
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
|
-
/**
|
|
2249
|
-
|
|
2248
|
+
/**
|
|
2249
|
+
* Texts a 4-digit sign-in code to `phone`, which needs its country code. `domain`, the page's
|
|
2250
|
+
* host and in the browser read from it, lets the engine end the text "@domain #code" when the
|
|
2251
|
+
* host is the store's own, which Chrome on Android reads to fill the code in (D124).
|
|
2252
|
+
*/
|
|
2253
|
+
async getOtp({ phone, domain }) {
|
|
2254
|
+
const site = domain ?? (typeof window !== "undefined" ? window.location?.hostname : void 0);
|
|
2250
2255
|
const res = await this.account("/x/identity/otp", {
|
|
2251
2256
|
method: "POST",
|
|
2252
|
-
body: { phone: String(phone ?? "").trim() }
|
|
2257
|
+
body: { phone: String(phone ?? "").trim(), ...site ? { domain: site } : {} }
|
|
2253
2258
|
});
|
|
2254
2259
|
return { expiresInMinutes: res?.expires_in_minutes ?? 10 };
|
|
2255
2260
|
}
|
|
@@ -2709,6 +2714,40 @@ var FaqService = class extends BaseService {
|
|
|
2709
2714
|
var pageService = new PageService();
|
|
2710
2715
|
var faqService = new FaqService();
|
|
2711
2716
|
|
|
2717
|
+
// src/services/layout-service.ts
|
|
2718
|
+
var IMAGE_KEYS = ["image", "mobile_image"];
|
|
2719
|
+
var LayoutService = class extends BaseService {
|
|
2720
|
+
async getHomeLayout({ preview } = {}) {
|
|
2721
|
+
let layout;
|
|
2722
|
+
try {
|
|
2723
|
+
layout = await this.data("/x/layouts/home", {
|
|
2724
|
+
query: { preview: preview?.trim() || void 0 }
|
|
2725
|
+
});
|
|
2726
|
+
} catch (err) {
|
|
2727
|
+
if (err instanceof GoCommerceError && err.status === 404) return null;
|
|
2728
|
+
throw err;
|
|
2729
|
+
}
|
|
2730
|
+
if (!layout) return null;
|
|
2731
|
+
return {
|
|
2732
|
+
page: layout.page,
|
|
2733
|
+
theme: layout.theme,
|
|
2734
|
+
revision: layout.revision,
|
|
2735
|
+
preview: !!layout.preview,
|
|
2736
|
+
sections: (layout.sections ?? []).map(toSection)
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
function toSection(s) {
|
|
2741
|
+
const settings = { ...s.settings ?? {} };
|
|
2742
|
+
for (const key of IMAGE_KEYS) {
|
|
2743
|
+
if (typeof settings[key] === "string") settings[key] = mediaUrl(settings[key]);
|
|
2744
|
+
}
|
|
2745
|
+
const out = { id: s.id, type: s.type, settings };
|
|
2746
|
+
if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
|
|
2747
|
+
return out;
|
|
2748
|
+
}
|
|
2749
|
+
var layoutService = new LayoutService();
|
|
2750
|
+
|
|
2712
2751
|
// src/services/vendor-service.ts
|
|
2713
2752
|
var VendorService = class extends BaseService {
|
|
2714
2753
|
async list({
|
|
@@ -3242,6 +3281,6 @@ function attemptKey(request) {
|
|
|
3242
3281
|
}
|
|
3243
3282
|
var b2bService = new B2bService();
|
|
3244
3283
|
|
|
3245
|
-
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 };
|
|
3284
|
+
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 };
|
|
3246
3285
|
//# sourceMappingURL=index.js.map
|
|
3247
3286
|
//# sourceMappingURL=index.js.map
|