@misiki/gocommerce-connector 0.14.0 → 0.16.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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as HeaderSettings, Z as HomeLayout, _ as HomeLayoutSection, $ as HomeService, a0 as IdentityAddress, a1 as InitService, a2 as Invitation, a3 as LayoutCollection, a4 as LayoutPage, a5 as LayoutService, a6 as Lead, a7 as ListMeta, a8 as MeilisearchService, a9 as Member, aa as Menu, ab as MenuItem, ac as MenuService, ad as MenuSummary, ae as Money, af as NewsletterService, ag as Offer, ah as Order, ai as OrderLine, aj as OrderService, ak as PageLayout, al as PageService, am as PaymentIntent, an as PaymentMethodService, ao as Plugin, ap as PluginService, ap as PluginsService, aq as PopularSearchService, ar as PopularityService, as as Postcode, at as Product, au as ProductFacets, av as ProductOption, aw as ProductService, ax as ProfileService, ay as Quote, az as REDIRECT_GATEWAYS, aA as ReelsService, aB as RegionService, aC as RejectedLine, aD as Review, aE as ReviewPage, aF as ReviewService, aG as SearchDoc, aH as SearchResult, aI as SearchService, aJ as SettingService, aJ as SettingsService, aK as ShippingRate, aL as SiteChrome, aM as SiteFooter, aN as SiteHeader, aO as SocialLink, aP as StateService, aQ as StoreProfile, aR as StoreService, aS as StorefrontCategory, aT as StorefrontMenu, aU as StorefrontOrder, aV as StorefrontProduct, aW as ThemeSettings, aX as ThemeSettingsResult, aY as UploadService, aZ as UserService, a_ as Variant, a$ as VariantImage, b0 as VariantService, b1 as VarniCustomDesignService, b2 as VarniCustomProductService, b3 as Vendor, b4 as VendorService, b5 as WarrantyService, b6 as Wishlist, b7 as WishlistItem, b8 as WishlistService, b9 as addressService, ba as authService, bb as autocompleteService, bc as b2bService, bd as bannerService, be as blogService, bf as cartService, bg as categoryService, bh as chatService, bi as checkoutService, bj as collectionService, bk as contactService, bl as countryService, bm as couponService, bn as currencyExponent, bo as currencyService, bp as dealService, bq as demoRequestService, br as emptyCart, bs as emptyPage, bt as enquiryService, bu as faqService, bv as feedbackService, bw as fromEngineAddress, bx as fromIdentityAddress, by as fromSearchDoc, bz as galleryService, bA as homeService, bB as initService, bC as layoutService, bD as mediaUrl, bE as meilisearchService, bF as menuService, bG as minorToMajor, bH as newsletterService, bI as orderService, bJ as ownDomain, bK as pageService, bL as paymentMethodService, bM as pluginService, bN as pluginsService, bO as popularSearchService, bP as popularityService, bQ as priceOf, bR as productImages, bS as productService, bT as productVideos, bU as profileService, bV as qs, bW as reelsService, bX as regionService, bY as reviewService, bZ as searchService, b_ as setRequestHost, b$ as settingService, c0 as settingsService, c1 as stateService, c2 as staticStore, c3 as storeForHost, c4 as storeService, c5 as toAddOn, c6 as toCart, c7 as toCartLine, c8 as toCartOffer, c9 as toCategory, ca as toCmsPage, cb as toCollection, cc as toEngineAddress, cd as toFreeShipping, ce as toIdentityAddress, cf as toMajor, cg as toMinor, ch as toOrder, ci as toPage, cj as toProduct, ck as toRating, cl as toStorefrontFacets, cm as toUser, cn as toVariant, co as toVendor, cp as uploadService, cq as userService, cr as variantService, cs as varniCustomDesignService, ct as varniCustomProductService, cu as vendorService, cv as warrantyService, cw as wishlistService } from './index-C0CR05Q4.cjs';
1
+ export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as HeaderSettings, Z as HomeLayout, _ as HomeLayoutSection, $ as HomeService, a0 as IdentityAddress, a1 as InitService, a2 as Invitation, a3 as LayoutCollection, a4 as LayoutPage, a5 as LayoutService, a6 as Lead, a7 as ListMeta, a8 as MeilisearchService, a9 as Member, aa as Menu, ab as MenuItem, ac as MenuService, ad as MenuSummary, ae as Money, af as NewsletterService, ag as Offer, ah as OpeningHours, ai as Order, aj as OrderLine, ak as OrderService, al as PageLayout, am as PageService, an as PaymentIntent, ao as PaymentMethodService, ap as Plugin, aq as PluginService, aq as PluginsService, ar as PopularSearchService, as as PopularityService, at as Postcode, au as Product, av as ProductFacets, aw as ProductOption, ax as ProductService, ay as ProfileService, az as Quote, aA as REDIRECT_GATEWAYS, aB as ReelsService, aC as RegionService, aD as RejectedLine, aE as Review, aF as ReviewPage, aG as ReviewService, aH as SearchDoc, aI as SearchResult, aJ as SearchService, aK as SettingService, aK as SettingsService, aL as ShippingRate, aM as SiteChrome, aN as SiteFooter, aO as SiteHeader, aP as SocialLink, aQ as StateService, aR as StoreProfile, aS as StoreService, aT as StorefrontCategory, aU as StorefrontMenu, aV as StorefrontOrder, aW as StorefrontProduct, aX as ThemeSettings, aY as ThemeSettingsResult, aZ as UploadService, a_ as UserService, a$ as Variant, b0 as VariantImage, b1 as VariantService, b2 as VarniCustomDesignService, b3 as VarniCustomProductService, b4 as Vendor, b5 as VendorService, b6 as WarrantyService, b7 as Wishlist, b8 as WishlistItem, b9 as WishlistService, ba as addressService, bb as authService, bc as autocompleteService, bd as b2bService, be as bannerService, bf as blogService, bg as cartService, bh as categoryService, bi as chatService, bj as checkoutService, bk as collectionService, bl as contactService, bm as countryService, bn as couponService, bo as currencyExponent, bp as currencyService, bq as dealService, br as demoRequestService, bs as emptyCart, bt as emptyPage, bu as enquiryService, bv as faqService, bw as feedbackService, bx as fromEngineAddress, by as fromIdentityAddress, bz as fromSearchDoc, bA as galleryService, bB as homeService, bC as initService, bD as layoutService, bE as mediaUrl, bF as meilisearchService, bG as menuService, bH as minorToMajor, bI as newsletterService, bJ as orderService, bK as ownDomain, bL as pageService, bM as paymentMethodService, bN as pluginService, bO as pluginsService, bP as popularSearchService, bQ as popularityService, bR as priceOf, bS as productImages, bT as productService, bU as productVideos, bV as profileService, bW as qs, bX as reelsService, bY as regionService, bZ as reviewService, b_ as searchService, b$ as setRequestHost, c0 as settingService, c1 as settingsService, c2 as stateService, c3 as staticStore, c4 as storeForHost, c5 as storeService, c6 as toAddOn, c7 as toCart, c8 as toCartLine, c9 as toCartOffer, ca as toCategory, cb as toCmsPage, cc as toCollection, cd as toEngineAddress, ce as toFreeShipping, cf as toIdentityAddress, cg as toMajor, ch as toMinor, ci as toOrder, cj as toPage, ck as toProduct, cl as toRating, cm as toStorefrontFacets, cn as toUser, co as toVariant, cp as toVendor, cq as uploadService, cr as userService, cs as variantService, ct as varniCustomDesignService, cu as varniCustomProductService, cv as vendorService, cw as warrantyService, cx as wishlistService } from './index-Dm_1E1ai.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 AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as HeaderSettings, Z as HomeLayout, _ as HomeLayoutSection, $ as HomeService, a0 as IdentityAddress, a1 as InitService, a2 as Invitation, a3 as LayoutCollection, a4 as LayoutPage, a5 as LayoutService, a6 as Lead, a7 as ListMeta, a8 as MeilisearchService, a9 as Member, aa as Menu, ab as MenuItem, ac as MenuService, ad as MenuSummary, ae as Money, af as NewsletterService, ag as Offer, ah as Order, ai as OrderLine, aj as OrderService, ak as PageLayout, al as PageService, am as PaymentIntent, an as PaymentMethodService, ao as Plugin, ap as PluginService, ap as PluginsService, aq as PopularSearchService, ar as PopularityService, as as Postcode, at as Product, au as ProductFacets, av as ProductOption, aw as ProductService, ax as ProfileService, ay as Quote, az as REDIRECT_GATEWAYS, aA as ReelsService, aB as RegionService, aC as RejectedLine, aD as Review, aE as ReviewPage, aF as ReviewService, aG as SearchDoc, aH as SearchResult, aI as SearchService, aJ as SettingService, aJ as SettingsService, aK as ShippingRate, aL as SiteChrome, aM as SiteFooter, aN as SiteHeader, aO as SocialLink, aP as StateService, aQ as StoreProfile, aR as StoreService, aS as StorefrontCategory, aT as StorefrontMenu, aU as StorefrontOrder, aV as StorefrontProduct, aW as ThemeSettings, aX as ThemeSettingsResult, aY as UploadService, aZ as UserService, a_ as Variant, a$ as VariantImage, b0 as VariantService, b1 as VarniCustomDesignService, b2 as VarniCustomProductService, b3 as Vendor, b4 as VendorService, b5 as WarrantyService, b6 as Wishlist, b7 as WishlistItem, b8 as WishlistService, b9 as addressService, ba as authService, bb as autocompleteService, bc as b2bService, bd as bannerService, be as blogService, bf as cartService, bg as categoryService, bh as chatService, bi as checkoutService, bj as collectionService, bk as contactService, bl as countryService, bm as couponService, bn as currencyExponent, bo as currencyService, bp as dealService, bq as demoRequestService, br as emptyCart, bs as emptyPage, bt as enquiryService, bu as faqService, bv as feedbackService, bw as fromEngineAddress, bx as fromIdentityAddress, by as fromSearchDoc, bz as galleryService, bA as homeService, bB as initService, bC as layoutService, bD as mediaUrl, bE as meilisearchService, bF as menuService, bG as minorToMajor, bH as newsletterService, bI as orderService, bJ as ownDomain, bK as pageService, bL as paymentMethodService, bM as pluginService, bN as pluginsService, bO as popularSearchService, bP as popularityService, bQ as priceOf, bR as productImages, bS as productService, bT as productVideos, bU as profileService, bV as qs, bW as reelsService, bX as regionService, bY as reviewService, bZ as searchService, b_ as setRequestHost, b$ as settingService, c0 as settingsService, c1 as stateService, c2 as staticStore, c3 as storeForHost, c4 as storeService, c5 as toAddOn, c6 as toCart, c7 as toCartLine, c8 as toCartOffer, c9 as toCategory, ca as toCmsPage, cb as toCollection, cc as toEngineAddress, cd as toFreeShipping, ce as toIdentityAddress, cf as toMajor, cg as toMinor, ch as toOrder, ci as toPage, cj as toProduct, ck as toRating, cl as toStorefrontFacets, cm as toUser, cn as toVariant, co as toVendor, cp as uploadService, cq as userService, cr as variantService, cs as varniCustomDesignService, ct as varniCustomProductService, cu as vendorService, cv as warrantyService, cw as wishlistService } from './index-C0CR05Q4.js';
1
+ export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as HeaderSettings, Z as HomeLayout, _ as HomeLayoutSection, $ as HomeService, a0 as IdentityAddress, a1 as InitService, a2 as Invitation, a3 as LayoutCollection, a4 as LayoutPage, a5 as LayoutService, a6 as Lead, a7 as ListMeta, a8 as MeilisearchService, a9 as Member, aa as Menu, ab as MenuItem, ac as MenuService, ad as MenuSummary, ae as Money, af as NewsletterService, ag as Offer, ah as OpeningHours, ai as Order, aj as OrderLine, ak as OrderService, al as PageLayout, am as PageService, an as PaymentIntent, ao as PaymentMethodService, ap as Plugin, aq as PluginService, aq as PluginsService, ar as PopularSearchService, as as PopularityService, at as Postcode, au as Product, av as ProductFacets, aw as ProductOption, ax as ProductService, ay as ProfileService, az as Quote, aA as REDIRECT_GATEWAYS, aB as ReelsService, aC as RegionService, aD as RejectedLine, aE as Review, aF as ReviewPage, aG as ReviewService, aH as SearchDoc, aI as SearchResult, aJ as SearchService, aK as SettingService, aK as SettingsService, aL as ShippingRate, aM as SiteChrome, aN as SiteFooter, aO as SiteHeader, aP as SocialLink, aQ as StateService, aR as StoreProfile, aS as StoreService, aT as StorefrontCategory, aU as StorefrontMenu, aV as StorefrontOrder, aW as StorefrontProduct, aX as ThemeSettings, aY as ThemeSettingsResult, aZ as UploadService, a_ as UserService, a$ as Variant, b0 as VariantImage, b1 as VariantService, b2 as VarniCustomDesignService, b3 as VarniCustomProductService, b4 as Vendor, b5 as VendorService, b6 as WarrantyService, b7 as Wishlist, b8 as WishlistItem, b9 as WishlistService, ba as addressService, bb as authService, bc as autocompleteService, bd as b2bService, be as bannerService, bf as blogService, bg as cartService, bh as categoryService, bi as chatService, bj as checkoutService, bk as collectionService, bl as contactService, bm as countryService, bn as couponService, bo as currencyExponent, bp as currencyService, bq as dealService, br as demoRequestService, bs as emptyCart, bt as emptyPage, bu as enquiryService, bv as faqService, bw as feedbackService, bx as fromEngineAddress, by as fromIdentityAddress, bz as fromSearchDoc, bA as galleryService, bB as homeService, bC as initService, bD as layoutService, bE as mediaUrl, bF as meilisearchService, bG as menuService, bH as minorToMajor, bI as newsletterService, bJ as orderService, bK as ownDomain, bL as pageService, bM as paymentMethodService, bN as pluginService, bO as pluginsService, bP as popularSearchService, bQ as popularityService, bR as priceOf, bS as productImages, bT as productService, bU as productVideos, bV as profileService, bW as qs, bX as reelsService, bY as regionService, bZ as reviewService, b_ as searchService, b$ as setRequestHost, c0 as settingService, c1 as settingsService, c2 as stateService, c3 as staticStore, c4 as storeForHost, c5 as storeService, c6 as toAddOn, c7 as toCart, c8 as toCartLine, c9 as toCartOffer, ca as toCategory, cb as toCmsPage, cc as toCollection, cd as toEngineAddress, ce as toFreeShipping, cf as toIdentityAddress, cg as toMajor, ch as toMinor, ci as toOrder, cj as toPage, ck as toProduct, cl as toRating, cm as toStorefrontFacets, cn as toUser, co as toVariant, cp as toVendor, cq as uploadService, cr as userService, cs as variantService, ct as varniCustomDesignService, cu as varniCustomProductService, cv as vendorService, cw as warrantyService, cx as wishlistService } from './index-Dm_1E1ai.js';
2
2
 
3
3
  /**
4
4
  * The two ways a call through this connector fails.
package/dist/index.js CHANGED
@@ -3041,6 +3041,27 @@ var StoreService = class extends BaseService {
3041
3041
  ...profile?.name ? { name: profile.name } : {},
3042
3042
  ...profile?.email ? { businessEmail: profile.email } : {},
3043
3043
  ...profile?.phone ? { businessPhone: profile.phone } : {},
3044
+ // The store's pictures (D148), the same: one it has not chosen keeps the static one.
3045
+ // Its own logo also replaces the static dark logo, which would be the deployment's
3046
+ // mark beside this store's; without a dark one of its own, its logo is the fallback.
3047
+ ...profile?.logo_url ? { logo: mediaUrl(profile.logo_url), logoDark: void 0 } : {},
3048
+ ...profile?.logo_dark_url ? { logoDark: mediaUrl(profile.logo_dark_url) } : {},
3049
+ ...profile?.icon_url ? { favicon: mediaUrl(profile.icon_url) } : {},
3050
+ // What the contact page shows (D156), only what the store published. The address
3051
+ // in the shape the storefront's contact page and home-page JSON-LD already read. The
3052
+ // country beside it, not over `country`: that is the address form's default country.
3053
+ ...profile?.country ? { businessCountry: profile.country } : {},
3054
+ ...profile?.address ? {
3055
+ address: {
3056
+ street: [profile.address.line1, profile.address.line2].filter(Boolean).join(", "),
3057
+ city: profile.address.city,
3058
+ state: profile.address.state,
3059
+ pincode: profile.address.postal_code,
3060
+ country: profile.address.country
3061
+ }
3062
+ } : {},
3063
+ ...profile?.map_location ? { mapLocation: profile.map_location } : {},
3064
+ ...profile?.opening_hours?.length ? { openingHours: profile.opening_hours } : {},
3044
3065
  currencyCode: code,
3045
3066
  currencySymbol: sameCurrency ? base.currencySymbol ?? symbolFor(code) : symbolFor(code),
3046
3067
  currency: {
@@ -3054,6 +3075,16 @@ var StoreService = class extends BaseService {
3054
3075
  // Features this connector serves from a module: on exactly when the
3055
3076
  // module is installed and switched on, whatever the static record says.
3056
3077
  isWishlist: { ...basePlugins.isWishlist, ...flag(plugins.has("wishlist")) },
3078
+ // The corner button and the contact page's WhatsApp card read the number from
3079
+ // here; the engine's plugin holds it, in international digits.
3080
+ whatsappChatButton: {
3081
+ ...basePlugins.whatsappChatButton,
3082
+ ...flag(plugins.has("whatsapp-chat")),
3083
+ ...plugins.has("whatsapp-chat") ? {
3084
+ phone: String(plugins.get("whatsapp-chat")?.settings?.phone ?? ""),
3085
+ message: String(plugins.get("whatsapp-chat")?.settings?.message ?? "")
3086
+ } : {}
3087
+ },
3057
3088
  isProductReviewsAndRatings: {
3058
3089
  ...basePlugins.isProductReviewsAndRatings,
3059
3090
  ...flag(plugins.has("product-reviews"))
@@ -3063,7 +3094,18 @@ var StoreService = class extends BaseService {
3063
3094
  newsletter: { ...basePlugins.newsletter, ...flag(plugins.has("newsletter")) },
3064
3095
  // Discount codes are core: every GoCommerce store takes them, so
3065
3096
  // the code box is shown whatever the static record says.
3066
- isDiscountCoupons: { ...basePlugins.isDiscountCoupons, active: true }
3097
+ isDiscountCoupons: { ...basePlugins.isDiscountCoupons, active: true },
3098
+ // The engine resizes the store's own pictures in Cloudflare's URL shape
3099
+ // (D139), so the storefront's srcset asks it for each width. Its public
3100
+ // origin, not the proxy path: an <img> needs no CORS, and the proxy would
3101
+ // put every picture through the storefront's server.
3102
+ ...profile?.images_path && this.creds.apiUrl ? {
3103
+ imageCdn: {
3104
+ provider: "cloudflare",
3105
+ url: this.creds.apiUrl.trim().replace(/\/+$/, "") + profile.images_path,
3106
+ active: true
3107
+ }
3108
+ } : {}
3067
3109
  },
3068
3110
  ...menus?.length ? { menu: menus } : {},
3069
3111
  ...deliverable(base, ships),
@@ -3269,7 +3311,8 @@ var ContactService = class extends BaseService {
3269
3311
  email,
3270
3312
  phone,
3271
3313
  message,
3272
- subject
3314
+ subject,
3315
+ website
3273
3316
  }) {
3274
3317
  return this.data("/x/contact/messages", {
3275
3318
  method: "POST",
@@ -3278,7 +3321,8 @@ var ContactService = class extends BaseService {
3278
3321
  email: String(email ?? ""),
3279
3322
  ...phone ? { phone: String(phone) } : {},
3280
3323
  ...subject ? { subject: String(subject) } : {},
3281
- body: String(message ?? "")
3324
+ body: String(message ?? ""),
3325
+ ...website ? { website: String(website) } : {}
3282
3326
  }
3283
3327
  });
3284
3328
  }