@misiki/gocommerce-connector 0.15.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/README.md +2 -2
- package/dist/{index-GdjWgh5b.d.cts → index-Dm_1E1ai.d.cts} +27 -2
- package/dist/{index-GdjWgh5b.d.ts → index-Dm_1E1ai.d.ts} +27 -2
- package/dist/index.cjs +29 -2
- 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 +29 -2
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +29 -2
- 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 +29 -2
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -152,9 +152,9 @@ down stays best-effort: the storefront renders from its static record.
|
|
|
152
152
|
| product specs table | the product's category attribute answers |
|
|
153
153
|
| attribute filters (`?attributes.color=Red`) | `/api/products?attr=color:Red` |
|
|
154
154
|
| newsletter box | `/x/newsletter/subscribe` |
|
|
155
|
-
| contact form, product enquiries | `/x/contact/messages` |
|
|
155
|
+
| contact form, product enquiries | `/x/contact/messages`, with the form's hidden `website` honeypot passed on so the engine drops what a bot filled in |
|
|
156
156
|
| search words, type-ahead (plugin on) | `/x/meilisearch/search`, falling back to the engine's own search when it is off or down |
|
|
157
|
-
| store record | the storefront's own config, with the engine's currency, menus and module switches over it; the store's own logo, dark logo and icon (`logo_url`, `logo_dark_url`, `icon_url` from `/api/store`, D148) replace `logo`, `logoDark` and `favicon` when it has them |
|
|
157
|
+
| store record | the storefront's own config, with the engine's currency, menus and module switches over it; the store's own logo, dark logo and icon (`logo_url`, `logo_dark_url`, `icon_url` from `/api/store`, D148) replace `logo`, `logoDark` and `favicon` when it has them; for the contact page (D156), the address once the store shows it (as `address: { street, city, state, pincode, country }`), `mapLocation` and `openingHours` when set, `businessCountry` (the store's ISO country, for the phone's country code), and the `whatsapp-chat` plugin's number as `plugins.whatsappChatButton` |
|
|
158
158
|
| resized product pictures | `/images/{store}/cdn-cgi/image/width=…/…` — the store record's `plugins.imageCdn` is turned on with provider `cloudflare` and the engine's `images_path` (from `/api/store`, D139) after `PUBLIC_GOCOMMERCE_API_URL`, so the storefront's srcset asks the engine for each width; an engine without it leaves the static record's setting |
|
|
159
159
|
|
|
160
160
|
Blogs, banners, reels, chat, warranties, deals and uploads have no engine
|
|
@@ -431,6 +431,29 @@ type StoreProfile = {
|
|
|
431
431
|
logo_url?: string;
|
|
432
432
|
logo_dark_url?: string;
|
|
433
433
|
icon_url?: string;
|
|
434
|
+
/**
|
|
435
|
+
* For a contact page (D156); absent on an engine before it. The address is
|
|
436
|
+
* null unless the store chose to show it; the map location is a Google Maps
|
|
437
|
+
* link or "lat,long"; the hours are one range per open day, Monday first.
|
|
438
|
+
* The country (ISO alpha-2) is public on its own, for the phone's country code.
|
|
439
|
+
*/
|
|
440
|
+
country?: string;
|
|
441
|
+
address?: {
|
|
442
|
+
line1: string;
|
|
443
|
+
line2: string;
|
|
444
|
+
city: string;
|
|
445
|
+
state: string;
|
|
446
|
+
postal_code: string;
|
|
447
|
+
country: string;
|
|
448
|
+
} | null;
|
|
449
|
+
map_location?: string;
|
|
450
|
+
opening_hours?: OpeningHours[];
|
|
451
|
+
};
|
|
452
|
+
/** When the shop is open on one day: `day` is mon…sun, the times 24-hour HH:MM. */
|
|
453
|
+
type OpeningHours = {
|
|
454
|
+
day: string;
|
|
455
|
+
opens: string;
|
|
456
|
+
closes: string;
|
|
434
457
|
};
|
|
435
458
|
type Vendor = {
|
|
436
459
|
id: number;
|
|
@@ -6507,12 +6530,14 @@ declare const vendorService: VendorService;
|
|
|
6507
6530
|
|
|
6508
6531
|
/** The storefront's contact form and product enquiries, through ext/contact's inbox. */
|
|
6509
6532
|
declare class ContactService extends BaseService {
|
|
6510
|
-
submitContactUsForm({ name, email, phone, message, subject, }: {
|
|
6533
|
+
submitContactUsForm({ name, email, phone, message, subject, website, }: {
|
|
6511
6534
|
name: string;
|
|
6512
6535
|
email: string;
|
|
6513
6536
|
phone?: string;
|
|
6514
6537
|
message: string;
|
|
6515
6538
|
subject?: string;
|
|
6539
|
+
/** The form's hidden honeypot, passed on so the engine drops what a bot filled in. */
|
|
6540
|
+
website?: string;
|
|
6516
6541
|
}): Promise<{
|
|
6517
6542
|
status: string;
|
|
6518
6543
|
}>;
|
|
@@ -7584,4 +7609,4 @@ declare class B2bService extends BaseService {
|
|
|
7584
7609
|
}
|
|
7585
7610
|
declare const b2bService: B2bService;
|
|
7586
7611
|
|
|
7587
|
-
export { HomeService as $, type AddOn as A, type B2bPlaced as B, type Cart as C, type CompanyOrder as D, ContactService as E, CountryService as F, CouponService as G, type Credentials as H, type Credit as I, CurrencyService as J, type Customer as K, DealService as L, DemoRequestService as M, type EngineRequest as N, EnquiryService as O, type Envelope as P, type FacetValue as Q, type Faq as R, FaqService as S, FeedbackService as T, type FooterSettings as U, type FreeShipping as V, type Fulfillment as W, GalleryService as X, type HeaderSettings as Y, type HomeLayout as Z, type HomeLayoutSection as _, type Address as a, type
|
|
7612
|
+
export { HomeService as $, type AddOn as A, type B2bPlaced as B, type Cart as C, type CompanyOrder as D, ContactService as E, CountryService as F, CouponService as G, type Credentials as H, type Credit as I, CurrencyService as J, type Customer as K, DealService as L, DemoRequestService as M, type EngineRequest as N, EnquiryService as O, type Envelope as P, type FacetValue as Q, type Faq as R, FaqService as S, FeedbackService as T, type FooterSettings as U, type FreeShipping as V, type Fulfillment as W, GalleryService as X, type HeaderSettings as Y, type HomeLayout as Z, type HomeLayoutSection as _, type Address as a, type Variant as a$, type IdentityAddress as a0, InitService as a1, type Invitation as a2, type LayoutCollection as a3, type LayoutPage as a4, LayoutService as a5, type Lead as a6, type ListMeta as a7, MeilisearchService as a8, type Member as a9, REDIRECT_GATEWAYS as aA, ReelsService as aB, RegionService as aC, type RejectedLine as aD, type Review as aE, type ReviewPage as aF, ReviewService as aG, type SearchDoc as aH, type SearchResult as aI, SearchService as aJ, SettingService as aK, type ShippingRate as aL, type SiteChrome as aM, type SiteFooter as aN, type SiteHeader as aO, type SocialLink as aP, StateService as aQ, type StoreProfile as aR, StoreService as aS, type StorefrontCategory as aT, type StorefrontMenu as aU, type StorefrontOrder as aV, type StorefrontProduct as aW, type ThemeSettings as aX, type ThemeSettingsResult as aY, UploadService as aZ, UserService as a_, type Menu as aa, type MenuItem as ab, MenuService as ac, type MenuSummary as ad, type Money as ae, NewsletterService as af, type Offer as ag, type OpeningHours as ah, type Order as ai, type OrderLine as aj, OrderService as ak, type PageLayout as al, PageService as am, type PaymentIntent as an, PaymentMethodService as ao, type Plugin as ap, PluginService as aq, PopularSearchService as ar, PopularityService as as, type Postcode as at, type Product as au, type ProductFacets as av, type ProductOption as aw, ProductService as ax, ProfileService as ay, type Quote as az, AddressService as b, setRequestHost as b$, type VariantImage as b0, VariantService as b1, VarniCustomDesignService as b2, VarniCustomProductService as b3, type Vendor as b4, VendorService as b5, WarrantyService as b6, type Wishlist as b7, type WishlistItem as b8, WishlistService as b9, galleryService as bA, homeService as bB, initService as bC, layoutService as bD, mediaUrl as bE, meilisearchService as bF, menuService as bG, minorToMajor as bH, newsletterService as bI, orderService as bJ, ownDomain as bK, pageService as bL, paymentMethodService as bM, pluginService as bN, pluginsService as bO, popularSearchService as bP, popularityService as bQ, priceOf as bR, productImages as bS, productService as bT, productVideos as bU, profileService as bV, qs as bW, reelsService as bX, regionService as bY, reviewService as bZ, searchService as b_, addressService as ba, authService as bb, autocompleteService as bc, b2bService as bd, bannerService as be, blogService as bf, cartService as bg, categoryService as bh, chatService as bi, checkoutService as bj, collectionService as bk, contactService as bl, countryService as bm, couponService as bn, currencyExponent as bo, currencyService as bp, dealService as bq, demoRequestService as br, emptyCart as bs, emptyPage as bt, enquiryService as bu, faqService as bv, feedbackService as bw, fromEngineAddress as bx, fromIdentityAddress as by, fromSearchDoc as bz, type AppliedDiscount as c, settingService as c0, settingsService as c1, stateService as c2, staticStore as c3, storeForHost as c4, storeService as c5, toAddOn as c6, toCart as c7, toCartLine as c8, toCartOffer as c9, toCategory as ca, toCmsPage as cb, toCollection as cc, toEngineAddress as cd, toFreeShipping as ce, toIdentityAddress as cf, toMajor as cg, toMinor as ch, toOrder as ci, toPage as cj, toProduct as ck, toRating as cl, toStorefrontFacets as cm, toUser as cn, toVariant as co, toVendor as cp, uploadService as cq, userService as cr, variantService as cs, varniCustomDesignService as ct, varniCustomProductService as cu, vendorService as cv, warrantyService as cw, wishlistService as cx, type Approval as d, type AuthResponse as e, AuthService as f, AutocompleteService as g, type B2bRole as h, B2bService as i, BannerService as j, BaseService as k, BlogService as l, type CartLine as m, type CartOffer as n, CartService as o, CatalogService as p, type Category as q, CategoryService as r, ChatService as s, type CheckoutOptions as t, type CheckoutResult as u, CheckoutService as v, type CmsPage as w, type Collection as x, CollectionService as y, type Company as z };
|
|
@@ -431,6 +431,29 @@ type StoreProfile = {
|
|
|
431
431
|
logo_url?: string;
|
|
432
432
|
logo_dark_url?: string;
|
|
433
433
|
icon_url?: string;
|
|
434
|
+
/**
|
|
435
|
+
* For a contact page (D156); absent on an engine before it. The address is
|
|
436
|
+
* null unless the store chose to show it; the map location is a Google Maps
|
|
437
|
+
* link or "lat,long"; the hours are one range per open day, Monday first.
|
|
438
|
+
* The country (ISO alpha-2) is public on its own, for the phone's country code.
|
|
439
|
+
*/
|
|
440
|
+
country?: string;
|
|
441
|
+
address?: {
|
|
442
|
+
line1: string;
|
|
443
|
+
line2: string;
|
|
444
|
+
city: string;
|
|
445
|
+
state: string;
|
|
446
|
+
postal_code: string;
|
|
447
|
+
country: string;
|
|
448
|
+
} | null;
|
|
449
|
+
map_location?: string;
|
|
450
|
+
opening_hours?: OpeningHours[];
|
|
451
|
+
};
|
|
452
|
+
/** When the shop is open on one day: `day` is mon…sun, the times 24-hour HH:MM. */
|
|
453
|
+
type OpeningHours = {
|
|
454
|
+
day: string;
|
|
455
|
+
opens: string;
|
|
456
|
+
closes: string;
|
|
434
457
|
};
|
|
435
458
|
type Vendor = {
|
|
436
459
|
id: number;
|
|
@@ -6507,12 +6530,14 @@ declare const vendorService: VendorService;
|
|
|
6507
6530
|
|
|
6508
6531
|
/** The storefront's contact form and product enquiries, through ext/contact's inbox. */
|
|
6509
6532
|
declare class ContactService extends BaseService {
|
|
6510
|
-
submitContactUsForm({ name, email, phone, message, subject, }: {
|
|
6533
|
+
submitContactUsForm({ name, email, phone, message, subject, website, }: {
|
|
6511
6534
|
name: string;
|
|
6512
6535
|
email: string;
|
|
6513
6536
|
phone?: string;
|
|
6514
6537
|
message: string;
|
|
6515
6538
|
subject?: string;
|
|
6539
|
+
/** The form's hidden honeypot, passed on so the engine drops what a bot filled in. */
|
|
6540
|
+
website?: string;
|
|
6516
6541
|
}): Promise<{
|
|
6517
6542
|
status: string;
|
|
6518
6543
|
}>;
|
|
@@ -7584,4 +7609,4 @@ declare class B2bService extends BaseService {
|
|
|
7584
7609
|
}
|
|
7585
7610
|
declare const b2bService: B2bService;
|
|
7586
7611
|
|
|
7587
|
-
export { HomeService as $, type AddOn as A, type B2bPlaced as B, type Cart as C, type CompanyOrder as D, ContactService as E, CountryService as F, CouponService as G, type Credentials as H, type Credit as I, CurrencyService as J, type Customer as K, DealService as L, DemoRequestService as M, type EngineRequest as N, EnquiryService as O, type Envelope as P, type FacetValue as Q, type Faq as R, FaqService as S, FeedbackService as T, type FooterSettings as U, type FreeShipping as V, type Fulfillment as W, GalleryService as X, type HeaderSettings as Y, type HomeLayout as Z, type HomeLayoutSection as _, type Address as a, type
|
|
7612
|
+
export { HomeService as $, type AddOn as A, type B2bPlaced as B, type Cart as C, type CompanyOrder as D, ContactService as E, CountryService as F, CouponService as G, type Credentials as H, type Credit as I, CurrencyService as J, type Customer as K, DealService as L, DemoRequestService as M, type EngineRequest as N, EnquiryService as O, type Envelope as P, type FacetValue as Q, type Faq as R, FaqService as S, FeedbackService as T, type FooterSettings as U, type FreeShipping as V, type Fulfillment as W, GalleryService as X, type HeaderSettings as Y, type HomeLayout as Z, type HomeLayoutSection as _, type Address as a, type Variant as a$, type IdentityAddress as a0, InitService as a1, type Invitation as a2, type LayoutCollection as a3, type LayoutPage as a4, LayoutService as a5, type Lead as a6, type ListMeta as a7, MeilisearchService as a8, type Member as a9, REDIRECT_GATEWAYS as aA, ReelsService as aB, RegionService as aC, type RejectedLine as aD, type Review as aE, type ReviewPage as aF, ReviewService as aG, type SearchDoc as aH, type SearchResult as aI, SearchService as aJ, SettingService as aK, type ShippingRate as aL, type SiteChrome as aM, type SiteFooter as aN, type SiteHeader as aO, type SocialLink as aP, StateService as aQ, type StoreProfile as aR, StoreService as aS, type StorefrontCategory as aT, type StorefrontMenu as aU, type StorefrontOrder as aV, type StorefrontProduct as aW, type ThemeSettings as aX, type ThemeSettingsResult as aY, UploadService as aZ, UserService as a_, type Menu as aa, type MenuItem as ab, MenuService as ac, type MenuSummary as ad, type Money as ae, NewsletterService as af, type Offer as ag, type OpeningHours as ah, type Order as ai, type OrderLine as aj, OrderService as ak, type PageLayout as al, PageService as am, type PaymentIntent as an, PaymentMethodService as ao, type Plugin as ap, PluginService as aq, PopularSearchService as ar, PopularityService as as, type Postcode as at, type Product as au, type ProductFacets as av, type ProductOption as aw, ProductService as ax, ProfileService as ay, type Quote as az, AddressService as b, setRequestHost as b$, type VariantImage as b0, VariantService as b1, VarniCustomDesignService as b2, VarniCustomProductService as b3, type Vendor as b4, VendorService as b5, WarrantyService as b6, type Wishlist as b7, type WishlistItem as b8, WishlistService as b9, galleryService as bA, homeService as bB, initService as bC, layoutService as bD, mediaUrl as bE, meilisearchService as bF, menuService as bG, minorToMajor as bH, newsletterService as bI, orderService as bJ, ownDomain as bK, pageService as bL, paymentMethodService as bM, pluginService as bN, pluginsService as bO, popularSearchService as bP, popularityService as bQ, priceOf as bR, productImages as bS, productService as bT, productVideos as bU, profileService as bV, qs as bW, reelsService as bX, regionService as bY, reviewService as bZ, searchService as b_, addressService as ba, authService as bb, autocompleteService as bc, b2bService as bd, bannerService as be, blogService as bf, cartService as bg, categoryService as bh, chatService as bi, checkoutService as bj, collectionService as bk, contactService as bl, countryService as bm, couponService as bn, currencyExponent as bo, currencyService as bp, dealService as bq, demoRequestService as br, emptyCart as bs, emptyPage as bt, enquiryService as bu, faqService as bv, feedbackService as bw, fromEngineAddress as bx, fromIdentityAddress as by, fromSearchDoc as bz, type AppliedDiscount as c, settingService as c0, settingsService as c1, stateService as c2, staticStore as c3, storeForHost as c4, storeService as c5, toAddOn as c6, toCart as c7, toCartLine as c8, toCartOffer as c9, toCategory as ca, toCmsPage as cb, toCollection as cc, toEngineAddress as cd, toFreeShipping as ce, toIdentityAddress as cf, toMajor as cg, toMinor as ch, toOrder as ci, toPage as cj, toProduct as ck, toRating as cl, toStorefrontFacets as cm, toUser as cn, toVariant as co, toVendor as cp, uploadService as cq, userService as cr, variantService as cs, varniCustomDesignService as ct, varniCustomProductService as cu, vendorService as cv, warrantyService as cw, wishlistService as cx, type Approval as d, type AuthResponse as e, AuthService as f, AutocompleteService as g, type B2bRole as h, B2bService as i, BannerService as j, BaseService as k, BlogService as l, type CartLine as m, type CartOffer as n, CartService as o, CatalogService as p, type Category as q, CategoryService as r, ChatService as s, type CheckoutOptions as t, type CheckoutResult as u, CheckoutService as v, type CmsPage as w, type Collection as x, CollectionService as y, type Company as z };
|
package/dist/index.cjs
CHANGED
|
@@ -3049,6 +3049,21 @@ var StoreService = class extends BaseService {
|
|
|
3049
3049
|
...profile?.logo_url ? { logo: mediaUrl(profile.logo_url), logoDark: void 0 } : {},
|
|
3050
3050
|
...profile?.logo_dark_url ? { logoDark: mediaUrl(profile.logo_dark_url) } : {},
|
|
3051
3051
|
...profile?.icon_url ? { favicon: mediaUrl(profile.icon_url) } : {},
|
|
3052
|
+
// What the contact page shows (D156), only what the store published. The address
|
|
3053
|
+
// in the shape the storefront's contact page and home-page JSON-LD already read. The
|
|
3054
|
+
// country beside it, not over `country`: that is the address form's default country.
|
|
3055
|
+
...profile?.country ? { businessCountry: profile.country } : {},
|
|
3056
|
+
...profile?.address ? {
|
|
3057
|
+
address: {
|
|
3058
|
+
street: [profile.address.line1, profile.address.line2].filter(Boolean).join(", "),
|
|
3059
|
+
city: profile.address.city,
|
|
3060
|
+
state: profile.address.state,
|
|
3061
|
+
pincode: profile.address.postal_code,
|
|
3062
|
+
country: profile.address.country
|
|
3063
|
+
}
|
|
3064
|
+
} : {},
|
|
3065
|
+
...profile?.map_location ? { mapLocation: profile.map_location } : {},
|
|
3066
|
+
...profile?.opening_hours?.length ? { openingHours: profile.opening_hours } : {},
|
|
3052
3067
|
currencyCode: code,
|
|
3053
3068
|
currencySymbol: sameCurrency ? base.currencySymbol ?? symbolFor(code) : symbolFor(code),
|
|
3054
3069
|
currency: {
|
|
@@ -3062,6 +3077,16 @@ var StoreService = class extends BaseService {
|
|
|
3062
3077
|
// Features this connector serves from a module: on exactly when the
|
|
3063
3078
|
// module is installed and switched on, whatever the static record says.
|
|
3064
3079
|
isWishlist: { ...basePlugins.isWishlist, ...flag(plugins.has("wishlist")) },
|
|
3080
|
+
// The corner button and the contact page's WhatsApp card read the number from
|
|
3081
|
+
// here; the engine's plugin holds it, in international digits.
|
|
3082
|
+
whatsappChatButton: {
|
|
3083
|
+
...basePlugins.whatsappChatButton,
|
|
3084
|
+
...flag(plugins.has("whatsapp-chat")),
|
|
3085
|
+
...plugins.has("whatsapp-chat") ? {
|
|
3086
|
+
phone: String(plugins.get("whatsapp-chat")?.settings?.phone ?? ""),
|
|
3087
|
+
message: String(plugins.get("whatsapp-chat")?.settings?.message ?? "")
|
|
3088
|
+
} : {}
|
|
3089
|
+
},
|
|
3065
3090
|
isProductReviewsAndRatings: {
|
|
3066
3091
|
...basePlugins.isProductReviewsAndRatings,
|
|
3067
3092
|
...flag(plugins.has("product-reviews"))
|
|
@@ -3288,7 +3313,8 @@ var ContactService = class extends BaseService {
|
|
|
3288
3313
|
email,
|
|
3289
3314
|
phone,
|
|
3290
3315
|
message,
|
|
3291
|
-
subject
|
|
3316
|
+
subject,
|
|
3317
|
+
website
|
|
3292
3318
|
}) {
|
|
3293
3319
|
return this.data("/x/contact/messages", {
|
|
3294
3320
|
method: "POST",
|
|
@@ -3297,7 +3323,8 @@ var ContactService = class extends BaseService {
|
|
|
3297
3323
|
email: String(email ?? ""),
|
|
3298
3324
|
...phone ? { phone: String(phone) } : {},
|
|
3299
3325
|
...subject ? { subject: String(subject) } : {},
|
|
3300
|
-
body: String(message ?? "")
|
|
3326
|
+
body: String(message ?? ""),
|
|
3327
|
+
...website ? { website: String(website) } : {}
|
|
3301
3328
|
}
|
|
3302
3329
|
});
|
|
3303
3330
|
}
|