@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
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
|
|
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 LayoutService, _ as Lead, $ as ListMeta, a0 as MeilisearchService, a1 as Member, a2 as Menu, a3 as MenuItem, a4 as MenuService, a5 as MenuSummary, a6 as Money, a7 as NewsletterService, a8 as Offer, a9 as Order, aa as OrderLine, ab as OrderService, ac as PageService, ad as PaymentIntent, ae as PaymentMethodService, af as Plugin, ag as PluginService, ag as PluginsService, ah as PopularSearchService, ai as PopularityService, aj as Product, ak as ProductOption, al as ProductService, am as ProfileService, an as Quote, ao as REDIRECT_GATEWAYS, ap as ReelsService, aq as RegionService, ar as RejectedLine, as as Review, at as ReviewPage, au as ReviewService, av as SearchDoc, aw as SearchResult, ax as SearchService, ay as SettingService, ay as SettingsService, az as ShippingRate, aA as StateService, aB as StoreProfile, aC as StoreService, aD as StorefrontCategory, aE as StorefrontMenu, aF as StorefrontOrder, aG as StorefrontProduct, aH as UploadService, aI as UserService, aJ as Variant, aK as VariantImage, aL as VariantService, aM as VarniCustomDesignService, aN as VarniCustomProductService, aO as Vendor, aP as VendorService, aQ as WarrantyService, aR as Wishlist, aS as WishlistItem, 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, b6 as currencyExponent, b7 as currencyService, b8 as dealService, b9 as demoRequestService, ba as emptyCart, bb as emptyPage, bc as enquiryService, bd as faqService, be as feedbackService, bf as fromEngineAddress, bg as fromIdentityAddress, bh as fromSearchDoc, bi as galleryService, bj as homeService, bk as initService, bl as layoutService, bm as mediaUrl, bn as meilisearchService, bo as menuService, bp as minorToMajor, 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, bz as priceOf, bA as productImages, 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, bP as toCart, bQ as toCartLine, bR as toCategory, bS as toCmsPage, bT as toCollection, bU as toEngineAddress, bV as toIdentityAddress, bW as toMajor, bX as toMinor, bY as toOrder, bZ as toPage, b_ as toProduct, b$ as toRating, c0 as toUser, c1 as toVariant, c2 as toVendor, 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';
|
|
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
|
|
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 LayoutService, _ as Lead, $ as ListMeta, a0 as MeilisearchService, a1 as Member, a2 as Menu, a3 as MenuItem, a4 as MenuService, a5 as MenuSummary, a6 as Money, a7 as NewsletterService, a8 as Offer, a9 as Order, aa as OrderLine, ab as OrderService, ac as PageService, ad as PaymentIntent, ae as PaymentMethodService, af as Plugin, ag as PluginService, ag as PluginsService, ah as PopularSearchService, ai as PopularityService, aj as Product, ak as ProductOption, al as ProductService, am as ProfileService, an as Quote, ao as REDIRECT_GATEWAYS, ap as ReelsService, aq as RegionService, ar as RejectedLine, as as Review, at as ReviewPage, au as ReviewService, av as SearchDoc, aw as SearchResult, ax as SearchService, ay as SettingService, ay as SettingsService, az as ShippingRate, aA as StateService, aB as StoreProfile, aC as StoreService, aD as StorefrontCategory, aE as StorefrontMenu, aF as StorefrontOrder, aG as StorefrontProduct, aH as UploadService, aI as UserService, aJ as Variant, aK as VariantImage, aL as VariantService, aM as VarniCustomDesignService, aN as VarniCustomProductService, aO as Vendor, aP as VendorService, aQ as WarrantyService, aR as Wishlist, aS as WishlistItem, 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, b6 as currencyExponent, b7 as currencyService, b8 as dealService, b9 as demoRequestService, ba as emptyCart, bb as emptyPage, bc as enquiryService, bd as faqService, be as feedbackService, bf as fromEngineAddress, bg as fromIdentityAddress, bh as fromSearchDoc, bi as galleryService, bj as homeService, bk as initService, bl as layoutService, bm as mediaUrl, bn as meilisearchService, bo as menuService, bp as minorToMajor, 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, bz as priceOf, bA as productImages, 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, bP as toCart, bQ as toCartLine, bR as toCategory, bS as toCmsPage, bT as toCollection, bU as toEngineAddress, bV as toIdentityAddress, bW as toMajor, bX as toMinor, bY as toOrder, bZ as toPage, b_ as toProduct, b$ as toRating, c0 as toUser, c1 as toVariant, c2 as toVendor, 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';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two ways a call through this connector fails.
|
package/dist/index.js
CHANGED
|
@@ -2264,11 +2264,16 @@ var AuthService = class extends UserService {
|
|
|
2264
2264
|
return { errorCode: err.code ?? "invalid_token", message: err.message };
|
|
2265
2265
|
}
|
|
2266
2266
|
}
|
|
2267
|
-
/**
|
|
2268
|
-
|
|
2267
|
+
/**
|
|
2268
|
+
* Texts a 4-digit sign-in code to `phone`, which needs its country code. `domain`, the page's
|
|
2269
|
+
* host and in the browser read from it, lets the engine end the text "@domain #code" when the
|
|
2270
|
+
* host is the store's own, which Chrome on Android reads to fill the code in (D124).
|
|
2271
|
+
*/
|
|
2272
|
+
async getOtp({ phone, domain }) {
|
|
2273
|
+
const site = domain ?? (typeof window !== "undefined" ? window.location?.hostname : void 0);
|
|
2269
2274
|
const res = await this.account("/x/identity/otp", {
|
|
2270
2275
|
method: "POST",
|
|
2271
|
-
body: { phone: String(phone ?? "").trim() }
|
|
2276
|
+
body: { phone: String(phone ?? "").trim(), ...site ? { domain: site } : {} }
|
|
2272
2277
|
});
|
|
2273
2278
|
return { expiresInMinutes: res?.expires_in_minutes ?? 10 };
|
|
2274
2279
|
}
|
|
@@ -2725,6 +2730,40 @@ var FaqService = class extends BaseService {
|
|
|
2725
2730
|
var pageService = new PageService();
|
|
2726
2731
|
var faqService = new FaqService();
|
|
2727
2732
|
|
|
2733
|
+
// src/services/layout-service.ts
|
|
2734
|
+
var IMAGE_KEYS = ["image", "mobile_image"];
|
|
2735
|
+
var LayoutService = class extends BaseService {
|
|
2736
|
+
async getHomeLayout({ preview } = {}) {
|
|
2737
|
+
let layout;
|
|
2738
|
+
try {
|
|
2739
|
+
layout = await this.data("/x/layouts/home", {
|
|
2740
|
+
query: { preview: preview?.trim() || void 0 }
|
|
2741
|
+
});
|
|
2742
|
+
} catch (err) {
|
|
2743
|
+
if (err instanceof GoCommerceError && err.status === 404) return null;
|
|
2744
|
+
throw err;
|
|
2745
|
+
}
|
|
2746
|
+
if (!layout) return null;
|
|
2747
|
+
return {
|
|
2748
|
+
page: layout.page,
|
|
2749
|
+
theme: layout.theme,
|
|
2750
|
+
revision: layout.revision,
|
|
2751
|
+
preview: !!layout.preview,
|
|
2752
|
+
sections: (layout.sections ?? []).map(toSection)
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
function toSection(s) {
|
|
2757
|
+
const settings = { ...s.settings ?? {} };
|
|
2758
|
+
for (const key of IMAGE_KEYS) {
|
|
2759
|
+
if (typeof settings[key] === "string") settings[key] = mediaUrl(settings[key]);
|
|
2760
|
+
}
|
|
2761
|
+
const out = { id: s.id, type: s.type, settings };
|
|
2762
|
+
if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
|
|
2763
|
+
return out;
|
|
2764
|
+
}
|
|
2765
|
+
var layoutService = new LayoutService();
|
|
2766
|
+
|
|
2728
2767
|
// src/services/vendor-service.ts
|
|
2729
2768
|
var VendorService = class extends BaseService {
|
|
2730
2769
|
async list({
|
|
@@ -3258,6 +3297,6 @@ function attemptKey(request) {
|
|
|
3258
3297
|
}
|
|
3259
3298
|
var b2bService = new B2bService();
|
|
3260
3299
|
|
|
3261
|
-
export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, GoCommerceError, HomeService, InitService, MeilisearchService, MenuService, NewsletterService, NotSupportedError, 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, forgetAll as clearStoreCache, collectionService, connectorName, contactService, countryService, couponService, currencyExponent, currencyService, dealService, demoRequestService, emptyCart, emptyPage, enquiryService, faqService, feedbackService, fromEngineAddress, fromIdentityAddress, fromSearchDoc, galleryService, hasStaticStore, homeService, initService, mediaUrl, meilisearchService, menuService, minorToMajor, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, priceOf, productImages, productService, profileService, qs, readStaticStore, reelsService, regionService, reviewService, searchService, serveRestLocally, setRequestHost, setStaticStore, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toCart, toCartLine, toCategory, toCmsPage, toCollection, toEngineAddress, toIdentityAddress, toMajor, toMinor, toOrder, toPage, toProduct, toRating, toUser, toVariant, toVendor, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
|
|
3300
|
+
export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, GoCommerceError, HomeService, InitService, LayoutService, MeilisearchService, MenuService, NewsletterService, NotSupportedError, 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, forgetAll as clearStoreCache, collectionService, connectorName, contactService, countryService, couponService, currencyExponent, currencyService, dealService, demoRequestService, emptyCart, emptyPage, enquiryService, faqService, feedbackService, fromEngineAddress, fromIdentityAddress, fromSearchDoc, galleryService, hasStaticStore, homeService, initService, layoutService, mediaUrl, meilisearchService, menuService, minorToMajor, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, priceOf, productImages, productService, profileService, qs, readStaticStore, reelsService, regionService, reviewService, searchService, serveRestLocally, setRequestHost, setStaticStore, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toCart, toCartLine, toCategory, toCmsPage, toCollection, toEngineAddress, toIdentityAddress, toMajor, toMinor, toOrder, toPage, toProduct, toRating, toUser, toVariant, toVendor, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
|
|
3262
3301
|
//# sourceMappingURL=index.js.map
|
|
3263
3302
|
//# sourceMappingURL=index.js.map
|