@misiki/gocommerce-connector 0.4.0 → 0.4.2

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/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 HomeService, U as IdentityAddress, V as InitService, W as Invitation, X as Lead, Y as ListMeta, Z as MeilisearchService, _ as Member, $ as Menu, a0 as MenuItem, a1 as MenuService, a2 as MenuSummary, a3 as Money, a4 as NewsletterService, a5 as Offer, a6 as Order, a7 as OrderLine, a8 as OrderService, a9 as PageService, aa as PaymentIntent, ab as PaymentMethodService, ac as Plugin, ad as PluginService, ad as PluginsService, ae as PopularSearchService, af as PopularityService, ag as Product, ah as ProductOption, ai as ProductService, aj as ProfileService, ak as Quote, al as REDIRECT_GATEWAYS, am as ReelsService, an as RegionService, ao as RejectedLine, ap as Review, aq as ReviewPage, ar as ReviewService, as as SearchDoc, at as SearchResult, au as SearchService, av as SettingService, av as SettingsService, aw as ShippingRate, ax as StateService, ay as StoreService, az as StorefrontCategory, aA as StorefrontMenu, aB as StorefrontOrder, aC as StorefrontProduct, aD as UploadService, aE as UserService, aF as Variant, aG as VariantImage, aH as VariantService, aI as VarniCustomDesignService, aJ as VarniCustomProductService, aK as Vendor, aL as VendorService, aM as WarrantyService, aN as Wishlist, aO as WishlistItem, aP as WishlistService, aQ as addressService, aR as authService, aS as autocompleteService, aT as b2bService, aU as bannerService, aV as blogService, aW as cartService, aX as categoryService, aY as chatService, aZ as checkoutService, a_ as collectionService, a$ as contactService, b0 as countryService, b1 as couponService, b2 as currencyExponent, b3 as currencyService, b4 as dealService, b5 as demoRequestService, b6 as emptyCart, b7 as emptyPage, b8 as enquiryService, b9 as faqService, ba as feedbackService, bb as fromEngineAddress, bc as fromIdentityAddress, bd as fromSearchDoc, be as galleryService, bf as homeService, bg as initService, bh as mediaUrl, bi as meilisearchService, bj as menuService, bk as minorToMajor, bl as newsletterService, bm as orderService, bn as pageService, bo as paymentMethodService, bp as pluginService, bq as pluginsService, br as popularSearchService, bs as popularityService, bt as priceOf, bu as productImages, bv as productService, bw as profileService, bx as qs, by as reelsService, bz as regionService, bA as reviewService, bB as searchService, bC as setRequestHost, bD as settingService, bE as settingsService, bF as stateService, bG as staticStore, bH as storeForHost, bI as storeService, bJ as toCart, bK as toCartLine, bL as toCategory, bM as toCmsPage, bN as toCollection, bO as toEngineAddress, bP as toIdentityAddress, bQ as toMajor, bR as toMinor, bS as toOrder, bT as toPage, bU as toProduct, bV as toRating, bW as toUser, bX as toVariant, bY as toVendor, bZ as uploadService, b_ as userService, b$ as variantService, c0 as varniCustomDesignService, c1 as varniCustomProductService, c2 as vendorService, c3 as warrantyService, c4 as wishlistService } from './index-iPG0fxzc.cjs';
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 HomeService, U as IdentityAddress, V as InitService, W as Invitation, X as Lead, Y as ListMeta, Z as MeilisearchService, _ as Member, $ as Menu, a0 as MenuItem, a1 as MenuService, a2 as MenuSummary, a3 as Money, a4 as NewsletterService, a5 as Offer, a6 as Order, a7 as OrderLine, a8 as OrderService, a9 as PageService, aa as PaymentIntent, ab as PaymentMethodService, ac as Plugin, ad as PluginService, ad as PluginsService, ae as PopularSearchService, af as PopularityService, ag as Product, ah as ProductOption, ai as ProductService, aj as ProfileService, ak as Quote, al as REDIRECT_GATEWAYS, am as ReelsService, an as RegionService, ao as RejectedLine, ap as Review, aq as ReviewPage, ar as ReviewService, as as SearchDoc, at as SearchResult, au as SearchService, av as SettingService, av as SettingsService, aw as ShippingRate, ax as StateService, ay as StoreProfile, az as StoreService, aA as StorefrontCategory, aB as StorefrontMenu, aC as StorefrontOrder, aD as StorefrontProduct, aE as UploadService, aF as UserService, aG as Variant, aH as VariantImage, aI as VariantService, aJ as VarniCustomDesignService, aK as VarniCustomProductService, aL as Vendor, aM as VendorService, aN as WarrantyService, aO as Wishlist, aP as WishlistItem, aQ as WishlistService, aR as addressService, aS as authService, aT as autocompleteService, aU as b2bService, aV as bannerService, aW as blogService, aX as cartService, aY as categoryService, aZ as chatService, a_ as checkoutService, a$ as collectionService, b0 as contactService, b1 as countryService, b2 as couponService, b3 as currencyExponent, b4 as currencyService, b5 as dealService, b6 as demoRequestService, b7 as emptyCart, b8 as emptyPage, b9 as enquiryService, ba as faqService, bb as feedbackService, bc as fromEngineAddress, bd as fromIdentityAddress, be as fromSearchDoc, bf as galleryService, bg as homeService, bh as initService, bi as mediaUrl, bj as meilisearchService, bk as menuService, bl as minorToMajor, bm as newsletterService, bn as orderService, bo as pageService, bp as paymentMethodService, bq as pluginService, br as pluginsService, bs as popularSearchService, bt as popularityService, bu as priceOf, bv as productImages, bw as productService, bx as profileService, by as qs, bz as reelsService, bA as regionService, bB as reviewService, bC as searchService, bD as setRequestHost, bE as settingService, bF as settingsService, bG as stateService, bH as staticStore, bI as storeForHost, bJ as storeService, bK as toCart, bL as toCartLine, bM as toCategory, bN as toCmsPage, bO as toCollection, bP as toEngineAddress, bQ as toIdentityAddress, bR as toMajor, bS as toMinor, bT as toOrder, bU as toPage, bV as toProduct, bW as toRating, bX as toUser, bY as toVariant, bZ as toVendor, b_ as uploadService, b$ as userService, c0 as variantService, c1 as varniCustomDesignService, c2 as varniCustomProductService, c3 as vendorService, c4 as warrantyService, c5 as wishlistService } from './index-CIjHKuHK.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 HomeService, U as IdentityAddress, V as InitService, W as Invitation, X as Lead, Y as ListMeta, Z as MeilisearchService, _ as Member, $ as Menu, a0 as MenuItem, a1 as MenuService, a2 as MenuSummary, a3 as Money, a4 as NewsletterService, a5 as Offer, a6 as Order, a7 as OrderLine, a8 as OrderService, a9 as PageService, aa as PaymentIntent, ab as PaymentMethodService, ac as Plugin, ad as PluginService, ad as PluginsService, ae as PopularSearchService, af as PopularityService, ag as Product, ah as ProductOption, ai as ProductService, aj as ProfileService, ak as Quote, al as REDIRECT_GATEWAYS, am as ReelsService, an as RegionService, ao as RejectedLine, ap as Review, aq as ReviewPage, ar as ReviewService, as as SearchDoc, at as SearchResult, au as SearchService, av as SettingService, av as SettingsService, aw as ShippingRate, ax as StateService, ay as StoreService, az as StorefrontCategory, aA as StorefrontMenu, aB as StorefrontOrder, aC as StorefrontProduct, aD as UploadService, aE as UserService, aF as Variant, aG as VariantImage, aH as VariantService, aI as VarniCustomDesignService, aJ as VarniCustomProductService, aK as Vendor, aL as VendorService, aM as WarrantyService, aN as Wishlist, aO as WishlistItem, aP as WishlistService, aQ as addressService, aR as authService, aS as autocompleteService, aT as b2bService, aU as bannerService, aV as blogService, aW as cartService, aX as categoryService, aY as chatService, aZ as checkoutService, a_ as collectionService, a$ as contactService, b0 as countryService, b1 as couponService, b2 as currencyExponent, b3 as currencyService, b4 as dealService, b5 as demoRequestService, b6 as emptyCart, b7 as emptyPage, b8 as enquiryService, b9 as faqService, ba as feedbackService, bb as fromEngineAddress, bc as fromIdentityAddress, bd as fromSearchDoc, be as galleryService, bf as homeService, bg as initService, bh as mediaUrl, bi as meilisearchService, bj as menuService, bk as minorToMajor, bl as newsletterService, bm as orderService, bn as pageService, bo as paymentMethodService, bp as pluginService, bq as pluginsService, br as popularSearchService, bs as popularityService, bt as priceOf, bu as productImages, bv as productService, bw as profileService, bx as qs, by as reelsService, bz as regionService, bA as reviewService, bB as searchService, bC as setRequestHost, bD as settingService, bE as settingsService, bF as stateService, bG as staticStore, bH as storeForHost, bI as storeService, bJ as toCart, bK as toCartLine, bL as toCategory, bM as toCmsPage, bN as toCollection, bO as toEngineAddress, bP as toIdentityAddress, bQ as toMajor, bR as toMinor, bS as toOrder, bT as toPage, bU as toProduct, bV as toRating, bW as toUser, bX as toVariant, bY as toVendor, bZ as uploadService, b_ as userService, b$ as variantService, c0 as varniCustomDesignService, c1 as varniCustomProductService, c2 as vendorService, c3 as warrantyService, c4 as wishlistService } from './index-iPG0fxzc.js';
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 HomeService, U as IdentityAddress, V as InitService, W as Invitation, X as Lead, Y as ListMeta, Z as MeilisearchService, _ as Member, $ as Menu, a0 as MenuItem, a1 as MenuService, a2 as MenuSummary, a3 as Money, a4 as NewsletterService, a5 as Offer, a6 as Order, a7 as OrderLine, a8 as OrderService, a9 as PageService, aa as PaymentIntent, ab as PaymentMethodService, ac as Plugin, ad as PluginService, ad as PluginsService, ae as PopularSearchService, af as PopularityService, ag as Product, ah as ProductOption, ai as ProductService, aj as ProfileService, ak as Quote, al as REDIRECT_GATEWAYS, am as ReelsService, an as RegionService, ao as RejectedLine, ap as Review, aq as ReviewPage, ar as ReviewService, as as SearchDoc, at as SearchResult, au as SearchService, av as SettingService, av as SettingsService, aw as ShippingRate, ax as StateService, ay as StoreProfile, az as StoreService, aA as StorefrontCategory, aB as StorefrontMenu, aC as StorefrontOrder, aD as StorefrontProduct, aE as UploadService, aF as UserService, aG as Variant, aH as VariantImage, aI as VariantService, aJ as VarniCustomDesignService, aK as VarniCustomProductService, aL as Vendor, aM as VendorService, aN as WarrantyService, aO as Wishlist, aP as WishlistItem, aQ as WishlistService, aR as addressService, aS as authService, aT as autocompleteService, aU as b2bService, aV as bannerService, aW as blogService, aX as cartService, aY as categoryService, aZ as chatService, a_ as checkoutService, a$ as collectionService, b0 as contactService, b1 as countryService, b2 as couponService, b3 as currencyExponent, b4 as currencyService, b5 as dealService, b6 as demoRequestService, b7 as emptyCart, b8 as emptyPage, b9 as enquiryService, ba as faqService, bb as feedbackService, bc as fromEngineAddress, bd as fromIdentityAddress, be as fromSearchDoc, bf as galleryService, bg as homeService, bh as initService, bi as mediaUrl, bj as meilisearchService, bk as menuService, bl as minorToMajor, bm as newsletterService, bn as orderService, bo as pageService, bp as paymentMethodService, bq as pluginService, br as pluginsService, bs as popularSearchService, bt as popularityService, bu as priceOf, bv as productImages, bw as productService, bx as profileService, by as qs, bz as reelsService, bA as regionService, bB as reviewService, bC as searchService, bD as setRequestHost, bE as settingService, bF as settingsService, bG as stateService, bH as staticStore, bI as storeForHost, bJ as storeService, bK as toCart, bL as toCartLine, bM as toCategory, bN as toCmsPage, bO as toCollection, bP as toEngineAddress, bQ as toIdentityAddress, bR as toMajor, bS as toMinor, bT as toOrder, bU as toPage, bV as toProduct, bW as toRating, bX as toUser, bY as toVariant, bZ as toVendor, b_ as uploadService, b$ as userService, c0 as variantService, c1 as varniCustomDesignService, c2 as varniCustomProductService, c3 as vendorService, c4 as warrantyService, c5 as wishlistService } from './index-CIjHKuHK.js';
2
2
 
3
3
  /**
4
4
  * The two ways a call through this connector fails.
package/dist/index.js CHANGED
@@ -1005,9 +1005,20 @@ var StoreFacts = class extends BaseService {
1005
1005
  return false;
1006
1006
  }
1007
1007
  }
1008
- /** The store's settlement currency and default language. */
1008
+ /**
1009
+ * The store's settlement currency and default language, from routes bound
1010
+ * to the store: `/health/ready` answers for the install, so on a shared
1011
+ * engine every store read as the install's currency.
1012
+ */
1009
1013
  ready() {
1010
- return remember(this.key("ready"), () => this.data("/health/ready"));
1014
+ return remember(this.key("ready"), async () => {
1015
+ const [{ currency }, { language }] = await Promise.all([this.checkoutOptions(), this.profile()]);
1016
+ return { currency, language };
1017
+ });
1018
+ }
1019
+ /** The store's own name and how a buyer reaches it, as set in its panel. */
1020
+ profile() {
1021
+ return remember(this.key("profile"), () => this.data("/api/store"));
1011
1022
  }
1012
1023
  checkoutOptions() {
1013
1024
  return remember(this.key("checkout"), () => this.data("/api/checkout"));
@@ -2511,17 +2522,22 @@ var StoreService = class extends BaseService {
2511
2522
  return super.post(path, data);
2512
2523
  }
2513
2524
  async live() {
2514
- const [ready, plugins, menus, base] = await Promise.all([
2525
+ const [ready, plugins, menus, base, profile] = await Promise.all([
2515
2526
  this.facts.ready(),
2516
2527
  this.facts.plugins().catch(() => /* @__PURE__ */ new Map()),
2517
2528
  new MenuService(this._fetch).engineMenus(),
2518
- readStaticStore()
2529
+ readStaticStore(),
2530
+ this.facts.profile().catch(() => null)
2519
2531
  ]);
2520
2532
  const code = ready.currency;
2521
2533
  const sameCurrency = (base.currency?.code ?? base.currencyCode) === code;
2522
2534
  const flag = (on) => ({ ...on ? { active: true } : { active: false } });
2523
2535
  const basePlugins = base.plugins ?? {};
2524
2536
  return {
2537
+ // Only what the owner filled in: an empty name keeps the static one.
2538
+ ...profile?.name ? { name: profile.name } : {},
2539
+ ...profile?.email ? { businessEmail: profile.email } : {},
2540
+ ...profile?.phone ? { businessPhone: profile.phone } : {},
2525
2541
  currencyCode: code,
2526
2542
  currencySymbol: sameCurrency ? base.currencySymbol ?? symbolFor(code) : symbolFor(code),
2527
2543
  currency: {