@misiki/gocommerce-connector 0.4.9 → 0.7.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-oCv5Dabq.d.cts → index-D-hnd6-D.d.cts} +248 -1
- package/dist/{index-oCv5Dabq.d.ts → index-D-hnd6-D.d.ts} +248 -1
- package/dist/index.cjs +61 -0
- 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 +60 -1
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +61 -0
- 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 +60 -1
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,6 +129,7 @@ down stays best-effort: the storefront renders from its static record.
|
|
|
129
129
|
| reviews | `/x/reviews` |
|
|
130
130
|
| content pages (`/p/…`, legal pages) | `/x/cms/pages` |
|
|
131
131
|
| FAQ | `/x/faq` |
|
|
132
|
+
| composed home page | `/x/layouts/home` (`?preview=` for a draft) — `layoutService.getHomeLayout()`, null when the store has none |
|
|
132
133
|
| menus | `/x/navigation/menus/{header,footer}`, laid over `store.menu`; any menu by handle |
|
|
133
134
|
| product specs table | the product's category attribute answers |
|
|
134
135
|
| attribute filters (`?attributes.color=Red`) | `/api/products?attr=color:Red` |
|
|
@@ -4542,6 +4542,219 @@ declare class OrderService extends BaseService {
|
|
|
4542
4542
|
noOfPage: number;
|
|
4543
4543
|
page: number;
|
|
4544
4544
|
}>;
|
|
4545
|
+
/**
|
|
4546
|
+
* Opens an order with its number and the email or phone on it, no code. The
|
|
4547
|
+
* engine answers one 404 for an unknown number and a wrong contact. The
|
|
4548
|
+
* token it answers is kept like an order placed in this browser, so the
|
|
4549
|
+
* order page and `getOrder` read it again.
|
|
4550
|
+
*/
|
|
4551
|
+
openOrder({ orderNo, contact }: {
|
|
4552
|
+
orderNo: string;
|
|
4553
|
+
contact: string;
|
|
4554
|
+
}): Promise<{
|
|
4555
|
+
data: {
|
|
4556
|
+
id: string;
|
|
4557
|
+
orderNo: string;
|
|
4558
|
+
orderNumber: string;
|
|
4559
|
+
number: string;
|
|
4560
|
+
parentOrderNo: string;
|
|
4561
|
+
status: string;
|
|
4562
|
+
engineStatus: string;
|
|
4563
|
+
paymentStatus: string;
|
|
4564
|
+
paymentMethod: string;
|
|
4565
|
+
currencyCode: string;
|
|
4566
|
+
subtotal: number;
|
|
4567
|
+
shippingCharges: number;
|
|
4568
|
+
discount: number;
|
|
4569
|
+
tax: number;
|
|
4570
|
+
taxIncluded: boolean;
|
|
4571
|
+
total: number;
|
|
4572
|
+
refunded: number;
|
|
4573
|
+
codCharges: number;
|
|
4574
|
+
coupon: {
|
|
4575
|
+
code: string;
|
|
4576
|
+
} | null;
|
|
4577
|
+
userEmail: string;
|
|
4578
|
+
email: string;
|
|
4579
|
+
phone: string | null;
|
|
4580
|
+
shippingAddress: {
|
|
4581
|
+
firstName: string;
|
|
4582
|
+
lastName: string;
|
|
4583
|
+
email: string | null;
|
|
4584
|
+
phone: string | null;
|
|
4585
|
+
address_1: string;
|
|
4586
|
+
address_2: string;
|
|
4587
|
+
city: string;
|
|
4588
|
+
state: string;
|
|
4589
|
+
zip: string;
|
|
4590
|
+
country: string;
|
|
4591
|
+
countryCode: string;
|
|
4592
|
+
} | null;
|
|
4593
|
+
billingAddress: {
|
|
4594
|
+
firstName: string;
|
|
4595
|
+
lastName: string;
|
|
4596
|
+
email: string | null;
|
|
4597
|
+
phone: string | null;
|
|
4598
|
+
address_1: string;
|
|
4599
|
+
address_2: string;
|
|
4600
|
+
city: string;
|
|
4601
|
+
state: string;
|
|
4602
|
+
zip: string;
|
|
4603
|
+
country: string;
|
|
4604
|
+
countryCode: string;
|
|
4605
|
+
} | null;
|
|
4606
|
+
shippingMethod: string | null;
|
|
4607
|
+
shippingRate: {
|
|
4608
|
+
name: string;
|
|
4609
|
+
} | null;
|
|
4610
|
+
lineItems: {
|
|
4611
|
+
id: string;
|
|
4612
|
+
productId: string;
|
|
4613
|
+
variantId: string;
|
|
4614
|
+
sku: string;
|
|
4615
|
+
title: string;
|
|
4616
|
+
name: string;
|
|
4617
|
+
slug: string;
|
|
4618
|
+
thumbnail: string | null;
|
|
4619
|
+
img: string | null;
|
|
4620
|
+
variantTitle: string;
|
|
4621
|
+
qty: number;
|
|
4622
|
+
shippedQty: number;
|
|
4623
|
+
price: number;
|
|
4624
|
+
mrp: number;
|
|
4625
|
+
subtotal: number;
|
|
4626
|
+
total: number;
|
|
4627
|
+
currencyCode: string;
|
|
4628
|
+
status: string;
|
|
4629
|
+
files: never[];
|
|
4630
|
+
usedOptions: never[];
|
|
4631
|
+
}[];
|
|
4632
|
+
fulfillments: {
|
|
4633
|
+
id: string;
|
|
4634
|
+
status: string;
|
|
4635
|
+
carrier: string;
|
|
4636
|
+
trackingNumber: string | null;
|
|
4637
|
+
trackingUrl: string | null;
|
|
4638
|
+
lineItems: {
|
|
4639
|
+
id: string;
|
|
4640
|
+
title: string;
|
|
4641
|
+
qty: number;
|
|
4642
|
+
}[];
|
|
4643
|
+
createdAt: string;
|
|
4644
|
+
}[];
|
|
4645
|
+
tracking: never[];
|
|
4646
|
+
orderHistory: never[];
|
|
4647
|
+
isReplaceOrReturn: boolean;
|
|
4648
|
+
createdAt: string;
|
|
4649
|
+
updatedAt: string;
|
|
4650
|
+
}[];
|
|
4651
|
+
}>;
|
|
4652
|
+
/**
|
|
4653
|
+
* Opens an order from the link in its emails, which carries the order's key
|
|
4654
|
+
* (`/order-tracking?order=…&key=…`). The key is kept like an order placed in
|
|
4655
|
+
* this browser, so the page can drop it from the address bar.
|
|
4656
|
+
*/
|
|
4657
|
+
openOrderWithKey({ orderNo, key }: {
|
|
4658
|
+
orderNo: string;
|
|
4659
|
+
key: string;
|
|
4660
|
+
}): Promise<{
|
|
4661
|
+
data: {
|
|
4662
|
+
id: string;
|
|
4663
|
+
orderNo: string;
|
|
4664
|
+
orderNumber: string;
|
|
4665
|
+
number: string;
|
|
4666
|
+
parentOrderNo: string;
|
|
4667
|
+
status: string;
|
|
4668
|
+
engineStatus: string;
|
|
4669
|
+
paymentStatus: string;
|
|
4670
|
+
paymentMethod: string;
|
|
4671
|
+
currencyCode: string;
|
|
4672
|
+
subtotal: number;
|
|
4673
|
+
shippingCharges: number;
|
|
4674
|
+
discount: number;
|
|
4675
|
+
tax: number;
|
|
4676
|
+
taxIncluded: boolean;
|
|
4677
|
+
total: number;
|
|
4678
|
+
refunded: number;
|
|
4679
|
+
codCharges: number;
|
|
4680
|
+
coupon: {
|
|
4681
|
+
code: string;
|
|
4682
|
+
} | null;
|
|
4683
|
+
userEmail: string;
|
|
4684
|
+
email: string;
|
|
4685
|
+
phone: string | null;
|
|
4686
|
+
shippingAddress: {
|
|
4687
|
+
firstName: string;
|
|
4688
|
+
lastName: string;
|
|
4689
|
+
email: string | null;
|
|
4690
|
+
phone: string | null;
|
|
4691
|
+
address_1: string;
|
|
4692
|
+
address_2: string;
|
|
4693
|
+
city: string;
|
|
4694
|
+
state: string;
|
|
4695
|
+
zip: string;
|
|
4696
|
+
country: string;
|
|
4697
|
+
countryCode: string;
|
|
4698
|
+
} | null;
|
|
4699
|
+
billingAddress: {
|
|
4700
|
+
firstName: string;
|
|
4701
|
+
lastName: string;
|
|
4702
|
+
email: string | null;
|
|
4703
|
+
phone: string | null;
|
|
4704
|
+
address_1: string;
|
|
4705
|
+
address_2: string;
|
|
4706
|
+
city: string;
|
|
4707
|
+
state: string;
|
|
4708
|
+
zip: string;
|
|
4709
|
+
country: string;
|
|
4710
|
+
countryCode: string;
|
|
4711
|
+
} | null;
|
|
4712
|
+
shippingMethod: string | null;
|
|
4713
|
+
shippingRate: {
|
|
4714
|
+
name: string;
|
|
4715
|
+
} | null;
|
|
4716
|
+
lineItems: {
|
|
4717
|
+
id: string;
|
|
4718
|
+
productId: string;
|
|
4719
|
+
variantId: string;
|
|
4720
|
+
sku: string;
|
|
4721
|
+
title: string;
|
|
4722
|
+
name: string;
|
|
4723
|
+
slug: string;
|
|
4724
|
+
thumbnail: string | null;
|
|
4725
|
+
img: string | null;
|
|
4726
|
+
variantTitle: string;
|
|
4727
|
+
qty: number;
|
|
4728
|
+
shippedQty: number;
|
|
4729
|
+
price: number;
|
|
4730
|
+
mrp: number;
|
|
4731
|
+
subtotal: number;
|
|
4732
|
+
total: number;
|
|
4733
|
+
currencyCode: string;
|
|
4734
|
+
status: string;
|
|
4735
|
+
files: never[];
|
|
4736
|
+
usedOptions: never[];
|
|
4737
|
+
}[];
|
|
4738
|
+
fulfillments: {
|
|
4739
|
+
id: string;
|
|
4740
|
+
status: string;
|
|
4741
|
+
carrier: string;
|
|
4742
|
+
trackingNumber: string | null;
|
|
4743
|
+
trackingUrl: string | null;
|
|
4744
|
+
lineItems: {
|
|
4745
|
+
id: string;
|
|
4746
|
+
title: string;
|
|
4747
|
+
qty: number;
|
|
4748
|
+
}[];
|
|
4749
|
+
createdAt: string;
|
|
4750
|
+
}[];
|
|
4751
|
+
tracking: never[];
|
|
4752
|
+
orderHistory: never[];
|
|
4753
|
+
isReplaceOrReturn: boolean;
|
|
4754
|
+
createdAt: string;
|
|
4755
|
+
updatedAt: string;
|
|
4756
|
+
}[];
|
|
4757
|
+
}>;
|
|
4545
4758
|
/**
|
|
4546
4759
|
* Sends a 4-digit code to the email or phone on the order, when `contact`
|
|
4547
4760
|
* is that email or phone. The engine answers the same either way, so this
|
|
@@ -5619,6 +5832,40 @@ declare class FaqService extends BaseService {
|
|
|
5619
5832
|
declare const pageService: PageService;
|
|
5620
5833
|
declare const faqService: FaqService;
|
|
5621
5834
|
|
|
5835
|
+
/**
|
|
5836
|
+
* One section of a composed page. `settings` is the merchant's, as validated
|
|
5837
|
+
* by the engine: plain text (never HTML) and links that are `/path` or
|
|
5838
|
+
* `http(s)://`. A product grid also carries its products, resolved live and
|
|
5839
|
+
* mapped like any other product the storefront renders.
|
|
5840
|
+
*/
|
|
5841
|
+
type HomeLayoutSection = {
|
|
5842
|
+
id: string;
|
|
5843
|
+
type: string;
|
|
5844
|
+
settings: Record<string, unknown>;
|
|
5845
|
+
products?: StorefrontProduct[];
|
|
5846
|
+
};
|
|
5847
|
+
type HomeLayout = {
|
|
5848
|
+
page: string;
|
|
5849
|
+
theme: string;
|
|
5850
|
+
/** The published revision this is; absent on a preview. */
|
|
5851
|
+
revision?: number;
|
|
5852
|
+
/** True when this is the saved draft shown through a preview key. */
|
|
5853
|
+
preview: boolean;
|
|
5854
|
+
sections: HomeLayoutSection[];
|
|
5855
|
+
};
|
|
5856
|
+
/**
|
|
5857
|
+
* Composed pages from ext/layouts. A store without one — the plugin off,
|
|
5858
|
+
* nothing published, an engine built without the module, or a preview key
|
|
5859
|
+
* that is wrong or expired — answers null, and the storefront renders its
|
|
5860
|
+
* built-in page.
|
|
5861
|
+
*/
|
|
5862
|
+
declare class LayoutService extends BaseService {
|
|
5863
|
+
getHomeLayout({ preview }?: {
|
|
5864
|
+
preview?: string | null;
|
|
5865
|
+
}): Promise<HomeLayout | null>;
|
|
5866
|
+
}
|
|
5867
|
+
declare const layoutService: LayoutService;
|
|
5868
|
+
|
|
5622
5869
|
/** The marketplace's sellers: approved vendors only. */
|
|
5623
5870
|
declare class VendorService extends BaseService {
|
|
5624
5871
|
list({ page, limit, q, search, }?: {
|
|
@@ -6759,4 +7006,4 @@ declare class B2bService extends BaseService {
|
|
|
6759
7006
|
}
|
|
6760
7007
|
declare const b2bService: B2bService;
|
|
6761
7008
|
|
|
6762
|
-
export { type
|
|
7009
|
+
export { type ListMeta as $, type Address as A, type B2bPlaced as B, type Cart as C, CountryService as D, CouponService as E, type Credentials as F, type Credit as G, CurrencyService as H, type Customer as I, DealService as J, DemoRequestService as K, type EngineRequest as L, EnquiryService as M, type Envelope as N, type Faq as O, FaqService as P, FeedbackService as Q, type Fulfillment as R, GalleryService as S, type HomeLayout as T, type HomeLayoutSection as U, HomeService as V, type IdentityAddress as W, InitService as X, type Invitation as Y, LayoutService as Z, type Lead as _, AddressService as a, categoryService as a$, MeilisearchService as a0, type Member as a1, type Menu as a2, type MenuItem as a3, MenuService as a4, type MenuSummary as a5, type Money as a6, NewsletterService as a7, type Offer as a8, type Order as a9, StateService as aA, type StoreProfile as aB, StoreService as aC, type StorefrontCategory as aD, type StorefrontMenu as aE, type StorefrontOrder as aF, type StorefrontProduct as aG, UploadService as aH, UserService as aI, type Variant as aJ, type VariantImage as aK, VariantService as aL, VarniCustomDesignService as aM, VarniCustomProductService as aN, type Vendor as aO, VendorService as aP, WarrantyService as aQ, type Wishlist as aR, type WishlistItem as aS, WishlistService as aT, addressService as aU, authService as aV, autocompleteService as aW, b2bService as aX, bannerService as aY, blogService as aZ, cartService as a_, type OrderLine as aa, OrderService as ab, PageService as ac, type PaymentIntent as ad, PaymentMethodService as ae, type Plugin as af, PluginService as ag, PopularSearchService as ah, PopularityService as ai, type Product as aj, type ProductOption as ak, ProductService as al, ProfileService as am, type Quote as an, REDIRECT_GATEWAYS as ao, ReelsService as ap, RegionService as aq, type RejectedLine as ar, type Review as as, type ReviewPage as at, ReviewService as au, type SearchDoc as av, type SearchResult as aw, SearchService as ax, SettingService as ay, type ShippingRate as az, type AppliedDiscount as b, toRating as b$, chatService as b0, checkoutService as b1, collectionService as b2, contactService as b3, countryService as b4, couponService as b5, currencyExponent as b6, currencyService as b7, dealService as b8, demoRequestService as b9, productImages as bA, productService as bB, profileService as bC, qs as bD, reelsService as bE, regionService as bF, reviewService as bG, searchService as bH, setRequestHost as bI, settingService as bJ, settingsService as bK, stateService as bL, staticStore as bM, storeForHost as bN, storeService as bO, toCart as bP, toCartLine as bQ, toCategory as bR, toCmsPage as bS, toCollection as bT, toEngineAddress as bU, toIdentityAddress as bV, toMajor as bW, toMinor as bX, toOrder as bY, toPage as bZ, toProduct as b_, emptyCart as ba, emptyPage as bb, enquiryService as bc, faqService as bd, feedbackService as be, fromEngineAddress as bf, fromIdentityAddress as bg, fromSearchDoc as bh, galleryService as bi, homeService as bj, initService as bk, layoutService as bl, mediaUrl as bm, meilisearchService as bn, menuService as bo, minorToMajor as bp, newsletterService as bq, orderService as br, ownDomain as bs, pageService as bt, paymentMethodService as bu, pluginService as bv, pluginsService as bw, popularSearchService as bx, popularityService as by, priceOf as bz, type Approval as c, toUser as c0, toVariant as c1, toVendor as c2, uploadService as c3, userService as c4, variantService as c5, varniCustomDesignService as c6, varniCustomProductService as c7, vendorService as c8, warrantyService as c9, wishlistService as ca, type AuthResponse as d, AuthService as e, AutocompleteService as f, type B2bRole as g, B2bService as h, BannerService as i, BaseService as j, BlogService as k, type CartLine as l, CartService as m, CatalogService as n, type Category as o, CategoryService as p, ChatService as q, type CheckoutOptions as r, type CheckoutResult as s, CheckoutService as t, type CmsPage as u, type Collection as v, CollectionService as w, type Company as x, type CompanyOrder as y, ContactService as z };
|
|
@@ -4542,6 +4542,219 @@ declare class OrderService extends BaseService {
|
|
|
4542
4542
|
noOfPage: number;
|
|
4543
4543
|
page: number;
|
|
4544
4544
|
}>;
|
|
4545
|
+
/**
|
|
4546
|
+
* Opens an order with its number and the email or phone on it, no code. The
|
|
4547
|
+
* engine answers one 404 for an unknown number and a wrong contact. The
|
|
4548
|
+
* token it answers is kept like an order placed in this browser, so the
|
|
4549
|
+
* order page and `getOrder` read it again.
|
|
4550
|
+
*/
|
|
4551
|
+
openOrder({ orderNo, contact }: {
|
|
4552
|
+
orderNo: string;
|
|
4553
|
+
contact: string;
|
|
4554
|
+
}): Promise<{
|
|
4555
|
+
data: {
|
|
4556
|
+
id: string;
|
|
4557
|
+
orderNo: string;
|
|
4558
|
+
orderNumber: string;
|
|
4559
|
+
number: string;
|
|
4560
|
+
parentOrderNo: string;
|
|
4561
|
+
status: string;
|
|
4562
|
+
engineStatus: string;
|
|
4563
|
+
paymentStatus: string;
|
|
4564
|
+
paymentMethod: string;
|
|
4565
|
+
currencyCode: string;
|
|
4566
|
+
subtotal: number;
|
|
4567
|
+
shippingCharges: number;
|
|
4568
|
+
discount: number;
|
|
4569
|
+
tax: number;
|
|
4570
|
+
taxIncluded: boolean;
|
|
4571
|
+
total: number;
|
|
4572
|
+
refunded: number;
|
|
4573
|
+
codCharges: number;
|
|
4574
|
+
coupon: {
|
|
4575
|
+
code: string;
|
|
4576
|
+
} | null;
|
|
4577
|
+
userEmail: string;
|
|
4578
|
+
email: string;
|
|
4579
|
+
phone: string | null;
|
|
4580
|
+
shippingAddress: {
|
|
4581
|
+
firstName: string;
|
|
4582
|
+
lastName: string;
|
|
4583
|
+
email: string | null;
|
|
4584
|
+
phone: string | null;
|
|
4585
|
+
address_1: string;
|
|
4586
|
+
address_2: string;
|
|
4587
|
+
city: string;
|
|
4588
|
+
state: string;
|
|
4589
|
+
zip: string;
|
|
4590
|
+
country: string;
|
|
4591
|
+
countryCode: string;
|
|
4592
|
+
} | null;
|
|
4593
|
+
billingAddress: {
|
|
4594
|
+
firstName: string;
|
|
4595
|
+
lastName: string;
|
|
4596
|
+
email: string | null;
|
|
4597
|
+
phone: string | null;
|
|
4598
|
+
address_1: string;
|
|
4599
|
+
address_2: string;
|
|
4600
|
+
city: string;
|
|
4601
|
+
state: string;
|
|
4602
|
+
zip: string;
|
|
4603
|
+
country: string;
|
|
4604
|
+
countryCode: string;
|
|
4605
|
+
} | null;
|
|
4606
|
+
shippingMethod: string | null;
|
|
4607
|
+
shippingRate: {
|
|
4608
|
+
name: string;
|
|
4609
|
+
} | null;
|
|
4610
|
+
lineItems: {
|
|
4611
|
+
id: string;
|
|
4612
|
+
productId: string;
|
|
4613
|
+
variantId: string;
|
|
4614
|
+
sku: string;
|
|
4615
|
+
title: string;
|
|
4616
|
+
name: string;
|
|
4617
|
+
slug: string;
|
|
4618
|
+
thumbnail: string | null;
|
|
4619
|
+
img: string | null;
|
|
4620
|
+
variantTitle: string;
|
|
4621
|
+
qty: number;
|
|
4622
|
+
shippedQty: number;
|
|
4623
|
+
price: number;
|
|
4624
|
+
mrp: number;
|
|
4625
|
+
subtotal: number;
|
|
4626
|
+
total: number;
|
|
4627
|
+
currencyCode: string;
|
|
4628
|
+
status: string;
|
|
4629
|
+
files: never[];
|
|
4630
|
+
usedOptions: never[];
|
|
4631
|
+
}[];
|
|
4632
|
+
fulfillments: {
|
|
4633
|
+
id: string;
|
|
4634
|
+
status: string;
|
|
4635
|
+
carrier: string;
|
|
4636
|
+
trackingNumber: string | null;
|
|
4637
|
+
trackingUrl: string | null;
|
|
4638
|
+
lineItems: {
|
|
4639
|
+
id: string;
|
|
4640
|
+
title: string;
|
|
4641
|
+
qty: number;
|
|
4642
|
+
}[];
|
|
4643
|
+
createdAt: string;
|
|
4644
|
+
}[];
|
|
4645
|
+
tracking: never[];
|
|
4646
|
+
orderHistory: never[];
|
|
4647
|
+
isReplaceOrReturn: boolean;
|
|
4648
|
+
createdAt: string;
|
|
4649
|
+
updatedAt: string;
|
|
4650
|
+
}[];
|
|
4651
|
+
}>;
|
|
4652
|
+
/**
|
|
4653
|
+
* Opens an order from the link in its emails, which carries the order's key
|
|
4654
|
+
* (`/order-tracking?order=…&key=…`). The key is kept like an order placed in
|
|
4655
|
+
* this browser, so the page can drop it from the address bar.
|
|
4656
|
+
*/
|
|
4657
|
+
openOrderWithKey({ orderNo, key }: {
|
|
4658
|
+
orderNo: string;
|
|
4659
|
+
key: string;
|
|
4660
|
+
}): Promise<{
|
|
4661
|
+
data: {
|
|
4662
|
+
id: string;
|
|
4663
|
+
orderNo: string;
|
|
4664
|
+
orderNumber: string;
|
|
4665
|
+
number: string;
|
|
4666
|
+
parentOrderNo: string;
|
|
4667
|
+
status: string;
|
|
4668
|
+
engineStatus: string;
|
|
4669
|
+
paymentStatus: string;
|
|
4670
|
+
paymentMethod: string;
|
|
4671
|
+
currencyCode: string;
|
|
4672
|
+
subtotal: number;
|
|
4673
|
+
shippingCharges: number;
|
|
4674
|
+
discount: number;
|
|
4675
|
+
tax: number;
|
|
4676
|
+
taxIncluded: boolean;
|
|
4677
|
+
total: number;
|
|
4678
|
+
refunded: number;
|
|
4679
|
+
codCharges: number;
|
|
4680
|
+
coupon: {
|
|
4681
|
+
code: string;
|
|
4682
|
+
} | null;
|
|
4683
|
+
userEmail: string;
|
|
4684
|
+
email: string;
|
|
4685
|
+
phone: string | null;
|
|
4686
|
+
shippingAddress: {
|
|
4687
|
+
firstName: string;
|
|
4688
|
+
lastName: string;
|
|
4689
|
+
email: string | null;
|
|
4690
|
+
phone: string | null;
|
|
4691
|
+
address_1: string;
|
|
4692
|
+
address_2: string;
|
|
4693
|
+
city: string;
|
|
4694
|
+
state: string;
|
|
4695
|
+
zip: string;
|
|
4696
|
+
country: string;
|
|
4697
|
+
countryCode: string;
|
|
4698
|
+
} | null;
|
|
4699
|
+
billingAddress: {
|
|
4700
|
+
firstName: string;
|
|
4701
|
+
lastName: string;
|
|
4702
|
+
email: string | null;
|
|
4703
|
+
phone: string | null;
|
|
4704
|
+
address_1: string;
|
|
4705
|
+
address_2: string;
|
|
4706
|
+
city: string;
|
|
4707
|
+
state: string;
|
|
4708
|
+
zip: string;
|
|
4709
|
+
country: string;
|
|
4710
|
+
countryCode: string;
|
|
4711
|
+
} | null;
|
|
4712
|
+
shippingMethod: string | null;
|
|
4713
|
+
shippingRate: {
|
|
4714
|
+
name: string;
|
|
4715
|
+
} | null;
|
|
4716
|
+
lineItems: {
|
|
4717
|
+
id: string;
|
|
4718
|
+
productId: string;
|
|
4719
|
+
variantId: string;
|
|
4720
|
+
sku: string;
|
|
4721
|
+
title: string;
|
|
4722
|
+
name: string;
|
|
4723
|
+
slug: string;
|
|
4724
|
+
thumbnail: string | null;
|
|
4725
|
+
img: string | null;
|
|
4726
|
+
variantTitle: string;
|
|
4727
|
+
qty: number;
|
|
4728
|
+
shippedQty: number;
|
|
4729
|
+
price: number;
|
|
4730
|
+
mrp: number;
|
|
4731
|
+
subtotal: number;
|
|
4732
|
+
total: number;
|
|
4733
|
+
currencyCode: string;
|
|
4734
|
+
status: string;
|
|
4735
|
+
files: never[];
|
|
4736
|
+
usedOptions: never[];
|
|
4737
|
+
}[];
|
|
4738
|
+
fulfillments: {
|
|
4739
|
+
id: string;
|
|
4740
|
+
status: string;
|
|
4741
|
+
carrier: string;
|
|
4742
|
+
trackingNumber: string | null;
|
|
4743
|
+
trackingUrl: string | null;
|
|
4744
|
+
lineItems: {
|
|
4745
|
+
id: string;
|
|
4746
|
+
title: string;
|
|
4747
|
+
qty: number;
|
|
4748
|
+
}[];
|
|
4749
|
+
createdAt: string;
|
|
4750
|
+
}[];
|
|
4751
|
+
tracking: never[];
|
|
4752
|
+
orderHistory: never[];
|
|
4753
|
+
isReplaceOrReturn: boolean;
|
|
4754
|
+
createdAt: string;
|
|
4755
|
+
updatedAt: string;
|
|
4756
|
+
}[];
|
|
4757
|
+
}>;
|
|
4545
4758
|
/**
|
|
4546
4759
|
* Sends a 4-digit code to the email or phone on the order, when `contact`
|
|
4547
4760
|
* is that email or phone. The engine answers the same either way, so this
|
|
@@ -5619,6 +5832,40 @@ declare class FaqService extends BaseService {
|
|
|
5619
5832
|
declare const pageService: PageService;
|
|
5620
5833
|
declare const faqService: FaqService;
|
|
5621
5834
|
|
|
5835
|
+
/**
|
|
5836
|
+
* One section of a composed page. `settings` is the merchant's, as validated
|
|
5837
|
+
* by the engine: plain text (never HTML) and links that are `/path` or
|
|
5838
|
+
* `http(s)://`. A product grid also carries its products, resolved live and
|
|
5839
|
+
* mapped like any other product the storefront renders.
|
|
5840
|
+
*/
|
|
5841
|
+
type HomeLayoutSection = {
|
|
5842
|
+
id: string;
|
|
5843
|
+
type: string;
|
|
5844
|
+
settings: Record<string, unknown>;
|
|
5845
|
+
products?: StorefrontProduct[];
|
|
5846
|
+
};
|
|
5847
|
+
type HomeLayout = {
|
|
5848
|
+
page: string;
|
|
5849
|
+
theme: string;
|
|
5850
|
+
/** The published revision this is; absent on a preview. */
|
|
5851
|
+
revision?: number;
|
|
5852
|
+
/** True when this is the saved draft shown through a preview key. */
|
|
5853
|
+
preview: boolean;
|
|
5854
|
+
sections: HomeLayoutSection[];
|
|
5855
|
+
};
|
|
5856
|
+
/**
|
|
5857
|
+
* Composed pages from ext/layouts. A store without one — the plugin off,
|
|
5858
|
+
* nothing published, an engine built without the module, or a preview key
|
|
5859
|
+
* that is wrong or expired — answers null, and the storefront renders its
|
|
5860
|
+
* built-in page.
|
|
5861
|
+
*/
|
|
5862
|
+
declare class LayoutService extends BaseService {
|
|
5863
|
+
getHomeLayout({ preview }?: {
|
|
5864
|
+
preview?: string | null;
|
|
5865
|
+
}): Promise<HomeLayout | null>;
|
|
5866
|
+
}
|
|
5867
|
+
declare const layoutService: LayoutService;
|
|
5868
|
+
|
|
5622
5869
|
/** The marketplace's sellers: approved vendors only. */
|
|
5623
5870
|
declare class VendorService extends BaseService {
|
|
5624
5871
|
list({ page, limit, q, search, }?: {
|
|
@@ -6759,4 +7006,4 @@ declare class B2bService extends BaseService {
|
|
|
6759
7006
|
}
|
|
6760
7007
|
declare const b2bService: B2bService;
|
|
6761
7008
|
|
|
6762
|
-
export { type
|
|
7009
|
+
export { type ListMeta as $, type Address as A, type B2bPlaced as B, type Cart as C, CountryService as D, CouponService as E, type Credentials as F, type Credit as G, CurrencyService as H, type Customer as I, DealService as J, DemoRequestService as K, type EngineRequest as L, EnquiryService as M, type Envelope as N, type Faq as O, FaqService as P, FeedbackService as Q, type Fulfillment as R, GalleryService as S, type HomeLayout as T, type HomeLayoutSection as U, HomeService as V, type IdentityAddress as W, InitService as X, type Invitation as Y, LayoutService as Z, type Lead as _, AddressService as a, categoryService as a$, MeilisearchService as a0, type Member as a1, type Menu as a2, type MenuItem as a3, MenuService as a4, type MenuSummary as a5, type Money as a6, NewsletterService as a7, type Offer as a8, type Order as a9, StateService as aA, type StoreProfile as aB, StoreService as aC, type StorefrontCategory as aD, type StorefrontMenu as aE, type StorefrontOrder as aF, type StorefrontProduct as aG, UploadService as aH, UserService as aI, type Variant as aJ, type VariantImage as aK, VariantService as aL, VarniCustomDesignService as aM, VarniCustomProductService as aN, type Vendor as aO, VendorService as aP, WarrantyService as aQ, type Wishlist as aR, type WishlistItem as aS, WishlistService as aT, addressService as aU, authService as aV, autocompleteService as aW, b2bService as aX, bannerService as aY, blogService as aZ, cartService as a_, type OrderLine as aa, OrderService as ab, PageService as ac, type PaymentIntent as ad, PaymentMethodService as ae, type Plugin as af, PluginService as ag, PopularSearchService as ah, PopularityService as ai, type Product as aj, type ProductOption as ak, ProductService as al, ProfileService as am, type Quote as an, REDIRECT_GATEWAYS as ao, ReelsService as ap, RegionService as aq, type RejectedLine as ar, type Review as as, type ReviewPage as at, ReviewService as au, type SearchDoc as av, type SearchResult as aw, SearchService as ax, SettingService as ay, type ShippingRate as az, type AppliedDiscount as b, toRating as b$, chatService as b0, checkoutService as b1, collectionService as b2, contactService as b3, countryService as b4, couponService as b5, currencyExponent as b6, currencyService as b7, dealService as b8, demoRequestService as b9, productImages as bA, productService as bB, profileService as bC, qs as bD, reelsService as bE, regionService as bF, reviewService as bG, searchService as bH, setRequestHost as bI, settingService as bJ, settingsService as bK, stateService as bL, staticStore as bM, storeForHost as bN, storeService as bO, toCart as bP, toCartLine as bQ, toCategory as bR, toCmsPage as bS, toCollection as bT, toEngineAddress as bU, toIdentityAddress as bV, toMajor as bW, toMinor as bX, toOrder as bY, toPage as bZ, toProduct as b_, emptyCart as ba, emptyPage as bb, enquiryService as bc, faqService as bd, feedbackService as be, fromEngineAddress as bf, fromIdentityAddress as bg, fromSearchDoc as bh, galleryService as bi, homeService as bj, initService as bk, layoutService as bl, mediaUrl as bm, meilisearchService as bn, menuService as bo, minorToMajor as bp, newsletterService as bq, orderService as br, ownDomain as bs, pageService as bt, paymentMethodService as bu, pluginService as bv, pluginsService as bw, popularSearchService as bx, popularityService as by, priceOf as bz, type Approval as c, toUser as c0, toVariant as c1, toVendor as c2, uploadService as c3, userService as c4, variantService as c5, varniCustomDesignService as c6, varniCustomProductService as c7, vendorService as c8, warrantyService as c9, wishlistService as ca, type AuthResponse as d, AuthService as e, AutocompleteService as f, type B2bRole as g, B2bService as h, BannerService as i, BaseService as j, BlogService as k, type CartLine as l, CartService as m, CatalogService as n, type Category as o, CategoryService as p, ChatService as q, type CheckoutOptions as r, type CheckoutResult as s, CheckoutService as t, type CmsPage as u, type Collection as v, CollectionService as w, type Company as x, type CompanyOrder as y, ContactService as z };
|
package/dist/index.cjs
CHANGED
|
@@ -2053,6 +2053,31 @@ var OrderService = class extends BaseService {
|
|
|
2053
2053
|
async listPublic(_args = {}) {
|
|
2054
2054
|
return emptyPage();
|
|
2055
2055
|
}
|
|
2056
|
+
/**
|
|
2057
|
+
* Opens an order with its number and the email or phone on it, no code. The
|
|
2058
|
+
* engine answers one 404 for an unknown number and a wrong contact. The
|
|
2059
|
+
* token it answers is kept like an order placed in this browser, so the
|
|
2060
|
+
* order page and `getOrder` read it again.
|
|
2061
|
+
*/
|
|
2062
|
+
async openOrder({ orderNo, contact }) {
|
|
2063
|
+
const res = await this.data(
|
|
2064
|
+
`/api/orders/${encodeURIComponent(orderNo.trim())}/open`,
|
|
2065
|
+
{ method: "POST", body: { contact: contact.trim() } }
|
|
2066
|
+
);
|
|
2067
|
+
rememberOrder({ number: res.order.number, token: res.access_token, cartId: "" });
|
|
2068
|
+
return { data: [toOrder(res.order)] };
|
|
2069
|
+
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Opens an order from the link in its emails, which carries the order's key
|
|
2072
|
+
* (`/order-tracking?order=…&key=…`). The key is kept like an order placed in
|
|
2073
|
+
* this browser, so the page can drop it from the address bar.
|
|
2074
|
+
*/
|
|
2075
|
+
async openOrderWithKey({ orderNo, key }) {
|
|
2076
|
+
const number = orderNo.trim();
|
|
2077
|
+
const order = await this.data(`/api/orders/${encodeURIComponent(number)}`, { query: { token: key.trim() } });
|
|
2078
|
+
rememberOrder({ number: order.number, token: key.trim(), cartId: "" });
|
|
2079
|
+
return { data: [toOrder(order)] };
|
|
2080
|
+
}
|
|
2056
2081
|
/**
|
|
2057
2082
|
* Sends a 4-digit code to the email or phone on the order, when `contact`
|
|
2058
2083
|
* is that email or phone. The engine answers the same either way, so this
|
|
@@ -2732,6 +2757,40 @@ var FaqService = class extends BaseService {
|
|
|
2732
2757
|
var pageService = new PageService();
|
|
2733
2758
|
var faqService = new FaqService();
|
|
2734
2759
|
|
|
2760
|
+
// src/services/layout-service.ts
|
|
2761
|
+
var IMAGE_KEYS = ["image", "mobile_image"];
|
|
2762
|
+
var LayoutService = class extends BaseService {
|
|
2763
|
+
async getHomeLayout({ preview } = {}) {
|
|
2764
|
+
let layout;
|
|
2765
|
+
try {
|
|
2766
|
+
layout = await this.data("/x/layouts/home", {
|
|
2767
|
+
query: { preview: preview?.trim() || void 0 }
|
|
2768
|
+
});
|
|
2769
|
+
} catch (err) {
|
|
2770
|
+
if (err instanceof GoCommerceError && err.status === 404) return null;
|
|
2771
|
+
throw err;
|
|
2772
|
+
}
|
|
2773
|
+
if (!layout) return null;
|
|
2774
|
+
return {
|
|
2775
|
+
page: layout.page,
|
|
2776
|
+
theme: layout.theme,
|
|
2777
|
+
revision: layout.revision,
|
|
2778
|
+
preview: !!layout.preview,
|
|
2779
|
+
sections: (layout.sections ?? []).map(toSection)
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
function toSection(s) {
|
|
2784
|
+
const settings = { ...s.settings ?? {} };
|
|
2785
|
+
for (const key of IMAGE_KEYS) {
|
|
2786
|
+
if (typeof settings[key] === "string") settings[key] = mediaUrl(settings[key]);
|
|
2787
|
+
}
|
|
2788
|
+
const out = { id: s.id, type: s.type, settings };
|
|
2789
|
+
if (s.type === "product-grid") out.products = (s.products ?? []).map((p) => toProduct(p));
|
|
2790
|
+
return out;
|
|
2791
|
+
}
|
|
2792
|
+
var layoutService = new LayoutService();
|
|
2793
|
+
|
|
2735
2794
|
// src/services/vendor-service.ts
|
|
2736
2795
|
var VendorService = class extends BaseService {
|
|
2737
2796
|
async list({
|
|
@@ -3291,6 +3350,7 @@ exports.GalleryService = GalleryService;
|
|
|
3291
3350
|
exports.GoCommerceError = GoCommerceError;
|
|
3292
3351
|
exports.HomeService = HomeService;
|
|
3293
3352
|
exports.InitService = InitService;
|
|
3353
|
+
exports.LayoutService = LayoutService;
|
|
3294
3354
|
exports.MeilisearchService = MeilisearchService;
|
|
3295
3355
|
exports.MenuService = MenuService;
|
|
3296
3356
|
exports.NewsletterService = NewsletterService;
|
|
@@ -3353,6 +3413,7 @@ exports.galleryService = galleryService;
|
|
|
3353
3413
|
exports.hasStaticStore = hasStaticStore;
|
|
3354
3414
|
exports.homeService = homeService;
|
|
3355
3415
|
exports.initService = initService;
|
|
3416
|
+
exports.layoutService = layoutService;
|
|
3356
3417
|
exports.mediaUrl = mediaUrl;
|
|
3357
3418
|
exports.meilisearchService = meilisearchService;
|
|
3358
3419
|
exports.menuService = menuService;
|