@misiki/gocommerce-connector 0.25.0 → 0.27.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-BWg1KptA.d.cts → index-BY0qUnNO.d.cts} +34 -0
- package/dist/{index-BWg1KptA.d.ts → index-BY0qUnNO.d.ts} +34 -0
- package/dist/index.cjs +13 -5
- 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 +13 -5
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +13 -5
- 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 +13 -5
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,9 +130,9 @@ down stays best-effort: the storefront renders from its static record.
|
|
|
130
130
|
| collections | `/api/collections`, `/api/collections/{slug}` |
|
|
131
131
|
| featured / trending shelves | the collection with slug `featured` / `trending`; newest products when there is none |
|
|
132
132
|
| product page extras | on the product from `/api/products/slug/{slug}` (D134): `highlights` and `freeGift` from the product's own metadata, `soldAtLeast` when the shop shows sold counts (null otherwise, never zero), and the product's videos after its pictures in `images` (and alone in `videos`), so the gallery plays them |
|
|
133
|
-
| bag | `/api/carts…`, `/api/carts/{token}/discount` |
|
|
133
|
+
| bag | `/api/carts…`, `/api/carts/{token}/discount`. When the engine answers an add with `cart_not_found` or `cart_checked_out`, the line goes to a fresh cart. An older engine without those codes is read by its words |
|
|
134
134
|
| Complete the set (add-ons) | `/api/add-ons?product_id=` — `productService.listAddOns({ product })`, each at the price ticking it adds (`price`) beside its own (`regularPrice`); `cartService.addAddOn({ addOnId })` after the product is in the bag. The engine keeps the offer price only while the product is in the bag, one for each |
|
|
135
|
-
| product customizer (D162) | `/x/customizer/products/{id}` — `customizerService.setup(productId)`: the product's design editor (mockup, overlay, print area and print size, tools, fonts, stickers, smallest sharp photo, consent line), with every picture through the proxy path so a canvas that draws it can still be exported. Null while ext/customizer is off (read from `/api/plugins`, so no request is made per product), for a product that cannot be designed, and on any failure. `/x/customizer/uploads` — `customizerService.upload(file)`: a photo, preview or print file, sent as the multipart field `file`; a refusal (413, 415, 422, 429, 501) is thrown with the engine's message. `/x/customizer/designs` — `customizerService.saveDesign({ productId, variantId, previewUploadId, printUploadId, document })`, with the version 1 document sent as the engine keeps it on the order. `cartService.addToCart({ variantId, designId })` puts the design in the bag on a line of its own; cart and order lines carry `designId` and `designPreview`, both null on a line sold as it is |
|
|
135
|
+
| product customizer (D162) | `/x/customizer/products/{id}` — `customizerService.setup(productId)`: the product's design editor (mockup, overlay, print area and print size, tools, fonts, stickers, smallest sharp photo, consent line), with every picture through the proxy path so a canvas that draws it can still be exported. Null while ext/customizer is off (read from `/api/plugins`, so no request is made per product), for a product that cannot be designed, and on any failure. `/x/customizer/uploads` — `customizerService.upload(file)`: a photo, preview or print file, sent as the multipart field `file`; a refusal (413, 415, 422, 429, 501) is thrown with the engine's message. `/x/customizer/designs` — `customizerService.saveDesign({ productId, variantId, previewUploadId, printUploadId, document })`, with the version 1 document sent as the engine keeps it on the order. `cartService.addToCart({ variantId, designId })` puts the design in the bag on a line of its own; cart and order lines carry `designId` and `designPreview`, both null on a line sold as it is, and an `orderService.buyAgain()` line carries its `designId` and its product's `designable`. Every product, in a listing and a search hit too, carries `designable`: true when it is sold only made to a design (open the editor, offer no quick add), false for a plain product (skip `setup`), and undefined when the engine does not say, from an older engine or a search index built before GoCommerce #215 (ask `setup`). For a plain line of a designable product, `cartService.addToCart` throws a `GoCommerceError` with `code` `design_required` and status 409, and a bag that is still open stays as it was |
|
|
136
136
|
| You may also like | `/api/cross-sells?product_id=` — `productService.listCrossSells({ product })`, curated only; the bag's `/api/carts/{token}/cross-sells` — `cartService.listCrossSells()`, which includes the collection the shop chose for every basket (D134), falling back to the first item's related products |
|
|
137
137
|
| the bag's offers and free delivery | `/api/carts/{token}/offers` — `cartService.getOffers()` and the coupon drawer's `couponService.listCoupons()`: only the codes the shop chose to show; `/api/carts/{token}/free-shipping` — `cartService.getFreeShipping()`, from the store's own rates, null when it cannot say |
|
|
138
138
|
| delivery options | `/api/checkout/rates` |
|
|
@@ -205,6 +205,8 @@ type Product = {
|
|
|
205
205
|
media?: VariantImage[];
|
|
206
206
|
/** The sold count rounded down; absent unless the shop shows counts and it passed the threshold (D134). */
|
|
207
207
|
sold_at_least?: number;
|
|
208
|
+
/** Sold only made to a shopper's design (D174); absent from an engine that predates the flag. */
|
|
209
|
+
designable?: boolean;
|
|
208
210
|
options: ProductOption[] | null;
|
|
209
211
|
variants: Variant[] | null;
|
|
210
212
|
collections: {
|
|
@@ -384,6 +386,8 @@ type Order = {
|
|
|
384
386
|
shipping: Money;
|
|
385
387
|
shipping_method?: string;
|
|
386
388
|
discount: Money;
|
|
389
|
+
/** What the payment method added (D165): cash on delivery's extra charge. Absent on an engine before it. */
|
|
390
|
+
payment_fee?: Money;
|
|
387
391
|
tax: Money;
|
|
388
392
|
tax_inclusive: boolean;
|
|
389
393
|
total: Money;
|
|
@@ -411,9 +415,11 @@ type CheckoutResult = {
|
|
|
411
415
|
};
|
|
412
416
|
type CheckoutOptions = {
|
|
413
417
|
payment_methods: string[];
|
|
418
|
+
/** `fee` is what choosing the method adds to the order (D165); absent, it adds nothing. */
|
|
414
419
|
methods: {
|
|
415
420
|
code: string;
|
|
416
421
|
name: string;
|
|
422
|
+
fee?: Money;
|
|
417
423
|
}[];
|
|
418
424
|
currency: string;
|
|
419
425
|
};
|
|
@@ -556,6 +562,8 @@ type StoreProfile = {
|
|
|
556
562
|
phone: string;
|
|
557
563
|
support_url: string;
|
|
558
564
|
language: string;
|
|
565
|
+
/** Whether the store's prices include tax (D177); absent on an engine before it. */
|
|
566
|
+
prices_include_tax?: boolean;
|
|
559
567
|
/** Where the engine serves this store's pictures resized (D139); absent on an engine before it. */
|
|
560
568
|
images_path?: string;
|
|
561
569
|
/** The store's logo, logo for dark backgrounds and square icon (D148); empty or absent when it has none. */
|
|
@@ -730,6 +738,8 @@ type SearchDoc = {
|
|
|
730
738
|
price_max_minor: number;
|
|
731
739
|
in_stock: boolean;
|
|
732
740
|
skus: string[] | null;
|
|
741
|
+
/** As on the product (D174), as of its last change or reindex; absent from an index built before the flag. */
|
|
742
|
+
designable?: boolean;
|
|
733
743
|
updated_at: number;
|
|
734
744
|
};
|
|
735
745
|
type SearchResult = {
|
|
@@ -899,6 +909,7 @@ declare function toProduct(p: Product, extra?: {
|
|
|
899
909
|
highlights: string[];
|
|
900
910
|
freeGift: string | null;
|
|
901
911
|
soldAtLeast: number | null;
|
|
912
|
+
designable: boolean | undefined;
|
|
902
913
|
manageInventory: boolean;
|
|
903
914
|
allowBackorder: boolean;
|
|
904
915
|
stock: number;
|
|
@@ -1001,6 +1012,7 @@ declare function fromSearchDoc(d: SearchDoc): {
|
|
|
1001
1012
|
hasStock: boolean;
|
|
1002
1013
|
manageInventory: boolean;
|
|
1003
1014
|
allowBackorder: boolean;
|
|
1015
|
+
designable: boolean | undefined;
|
|
1004
1016
|
productTags: string;
|
|
1005
1017
|
category: {
|
|
1006
1018
|
name: string;
|
|
@@ -1724,6 +1736,7 @@ declare class ProductService extends CatalogService {
|
|
|
1724
1736
|
highlights: string[];
|
|
1725
1737
|
freeGift: string | null;
|
|
1726
1738
|
soldAtLeast: number | null;
|
|
1739
|
+
designable: boolean | undefined;
|
|
1727
1740
|
manageInventory: boolean;
|
|
1728
1741
|
allowBackorder: boolean;
|
|
1729
1742
|
stock: number;
|
|
@@ -1841,6 +1854,7 @@ declare class ProductService extends CatalogService {
|
|
|
1841
1854
|
highlights: string[];
|
|
1842
1855
|
freeGift: string | null;
|
|
1843
1856
|
soldAtLeast: number | null;
|
|
1857
|
+
designable: boolean | undefined;
|
|
1844
1858
|
manageInventory: boolean;
|
|
1845
1859
|
allowBackorder: boolean;
|
|
1846
1860
|
stock: number;
|
|
@@ -1941,6 +1955,7 @@ declare class ProductService extends CatalogService {
|
|
|
1941
1955
|
hasStock: boolean;
|
|
1942
1956
|
manageInventory: boolean;
|
|
1943
1957
|
allowBackorder: boolean;
|
|
1958
|
+
designable: boolean | undefined;
|
|
1944
1959
|
productTags: string;
|
|
1945
1960
|
category: {
|
|
1946
1961
|
name: string;
|
|
@@ -1993,6 +2008,7 @@ declare class ProductService extends CatalogService {
|
|
|
1993
2008
|
highlights: string[];
|
|
1994
2009
|
freeGift: string | null;
|
|
1995
2010
|
soldAtLeast: number | null;
|
|
2011
|
+
designable: boolean | undefined;
|
|
1996
2012
|
manageInventory: boolean;
|
|
1997
2013
|
allowBackorder: boolean;
|
|
1998
2014
|
stock: number;
|
|
@@ -2093,6 +2109,7 @@ declare class ProductService extends CatalogService {
|
|
|
2093
2109
|
hasStock: boolean;
|
|
2094
2110
|
manageInventory: boolean;
|
|
2095
2111
|
allowBackorder: boolean;
|
|
2112
|
+
designable: boolean | undefined;
|
|
2096
2113
|
productTags: string;
|
|
2097
2114
|
category: {
|
|
2098
2115
|
name: string;
|
|
@@ -2144,6 +2161,7 @@ declare class ProductService extends CatalogService {
|
|
|
2144
2161
|
highlights: string[];
|
|
2145
2162
|
freeGift: string | null;
|
|
2146
2163
|
soldAtLeast: number | null;
|
|
2164
|
+
designable: boolean | undefined;
|
|
2147
2165
|
manageInventory: boolean;
|
|
2148
2166
|
allowBackorder: boolean;
|
|
2149
2167
|
stock: number;
|
|
@@ -2244,6 +2262,7 @@ declare class ProductService extends CatalogService {
|
|
|
2244
2262
|
hasStock: boolean;
|
|
2245
2263
|
manageInventory: boolean;
|
|
2246
2264
|
allowBackorder: boolean;
|
|
2265
|
+
designable: boolean | undefined;
|
|
2247
2266
|
productTags: string;
|
|
2248
2267
|
category: {
|
|
2249
2268
|
name: string;
|
|
@@ -2342,6 +2361,7 @@ declare class ProductService extends CatalogService {
|
|
|
2342
2361
|
highlights: string[];
|
|
2343
2362
|
freeGift: string | null;
|
|
2344
2363
|
soldAtLeast: number | null;
|
|
2364
|
+
designable: boolean | undefined;
|
|
2345
2365
|
manageInventory: boolean;
|
|
2346
2366
|
allowBackorder: boolean;
|
|
2347
2367
|
stock: number;
|
|
@@ -2566,6 +2586,7 @@ declare class SearchService extends CatalogService {
|
|
|
2566
2586
|
highlights: string[];
|
|
2567
2587
|
freeGift: string | null;
|
|
2568
2588
|
soldAtLeast: number | null;
|
|
2589
|
+
designable: boolean | undefined;
|
|
2569
2590
|
manageInventory: boolean;
|
|
2570
2591
|
allowBackorder: boolean;
|
|
2571
2592
|
stock: number;
|
|
@@ -2666,6 +2687,7 @@ declare class SearchService extends CatalogService {
|
|
|
2666
2687
|
hasStock: boolean;
|
|
2667
2688
|
manageInventory: boolean;
|
|
2668
2689
|
allowBackorder: boolean;
|
|
2690
|
+
designable: boolean | undefined;
|
|
2669
2691
|
productTags: string;
|
|
2670
2692
|
category: {
|
|
2671
2693
|
name: string;
|
|
@@ -2755,6 +2777,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2755
2777
|
highlights: string[];
|
|
2756
2778
|
freeGift: string | null;
|
|
2757
2779
|
soldAtLeast: number | null;
|
|
2780
|
+
designable: boolean | undefined;
|
|
2758
2781
|
manageInventory: boolean;
|
|
2759
2782
|
allowBackorder: boolean;
|
|
2760
2783
|
stock: number;
|
|
@@ -2855,6 +2878,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2855
2878
|
hasStock: boolean;
|
|
2856
2879
|
manageInventory: boolean;
|
|
2857
2880
|
allowBackorder: boolean;
|
|
2881
|
+
designable: boolean | undefined;
|
|
2858
2882
|
productTags: string;
|
|
2859
2883
|
category: {
|
|
2860
2884
|
name: string;
|
|
@@ -2913,6 +2937,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2913
2937
|
highlights: string[];
|
|
2914
2938
|
freeGift: string | null;
|
|
2915
2939
|
soldAtLeast: number | null;
|
|
2940
|
+
designable: boolean | undefined;
|
|
2916
2941
|
manageInventory: boolean;
|
|
2917
2942
|
allowBackorder: boolean;
|
|
2918
2943
|
stock: number;
|
|
@@ -3013,6 +3038,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
3013
3038
|
hasStock: boolean;
|
|
3014
3039
|
manageInventory: boolean;
|
|
3015
3040
|
allowBackorder: boolean;
|
|
3041
|
+
designable: boolean | undefined;
|
|
3016
3042
|
productTags: string;
|
|
3017
3043
|
category: {
|
|
3018
3044
|
name: string;
|
|
@@ -3137,6 +3163,7 @@ declare class CollectionService extends BaseService {
|
|
|
3137
3163
|
highlights: string[];
|
|
3138
3164
|
freeGift: string | null;
|
|
3139
3165
|
soldAtLeast: number | null;
|
|
3166
|
+
designable: boolean | undefined;
|
|
3140
3167
|
manageInventory: boolean;
|
|
3141
3168
|
allowBackorder: boolean;
|
|
3142
3169
|
stock: number;
|
|
@@ -3249,6 +3276,7 @@ declare class CollectionService extends BaseService {
|
|
|
3249
3276
|
highlights: string[];
|
|
3250
3277
|
freeGift: string | null;
|
|
3251
3278
|
soldAtLeast: number | null;
|
|
3279
|
+
designable: boolean | undefined;
|
|
3252
3280
|
manageInventory: boolean;
|
|
3253
3281
|
allowBackorder: boolean;
|
|
3254
3282
|
stock: number;
|
|
@@ -4852,6 +4880,7 @@ declare class PaymentMethodService extends BaseService {
|
|
|
4852
4880
|
title: string;
|
|
4853
4881
|
description: string;
|
|
4854
4882
|
img: string | null;
|
|
4883
|
+
fee: number;
|
|
4855
4884
|
rank: number;
|
|
4856
4885
|
active: boolean;
|
|
4857
4886
|
isActive: boolean;
|
|
@@ -5233,10 +5262,12 @@ declare class OrderService extends BaseService {
|
|
|
5233
5262
|
productId: string;
|
|
5234
5263
|
variantId: string;
|
|
5235
5264
|
slug: string;
|
|
5265
|
+
designable: boolean | undefined;
|
|
5236
5266
|
title: string;
|
|
5237
5267
|
img: string | null;
|
|
5238
5268
|
price: number;
|
|
5239
5269
|
qty: number;
|
|
5270
|
+
designId: string | null;
|
|
5240
5271
|
}[]>;
|
|
5241
5272
|
/** The "someone just bought" popup would publish other shoppers' purchases; the engine offers none. */
|
|
5242
5273
|
listPublic(_args?: Record<string, unknown>): Promise<{
|
|
@@ -6210,6 +6241,7 @@ declare class WishlistService extends BaseService {
|
|
|
6210
6241
|
highlights: string[];
|
|
6211
6242
|
freeGift: string | null;
|
|
6212
6243
|
soldAtLeast: number | null;
|
|
6244
|
+
designable: boolean | undefined;
|
|
6213
6245
|
manageInventory: boolean;
|
|
6214
6246
|
allowBackorder: boolean;
|
|
6215
6247
|
stock: number;
|
|
@@ -6995,6 +7027,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
6995
7027
|
highlights: string[];
|
|
6996
7028
|
freeGift: string | null;
|
|
6997
7029
|
soldAtLeast: number | null;
|
|
7030
|
+
designable: boolean | undefined;
|
|
6998
7031
|
manageInventory: boolean;
|
|
6999
7032
|
allowBackorder: boolean;
|
|
7000
7033
|
stock: number;
|
|
@@ -7095,6 +7128,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
7095
7128
|
hasStock: boolean;
|
|
7096
7129
|
manageInventory: boolean;
|
|
7097
7130
|
allowBackorder: boolean;
|
|
7131
|
+
designable: boolean | undefined;
|
|
7098
7132
|
productTags: string;
|
|
7099
7133
|
category: {
|
|
7100
7134
|
name: string;
|
|
@@ -205,6 +205,8 @@ type Product = {
|
|
|
205
205
|
media?: VariantImage[];
|
|
206
206
|
/** The sold count rounded down; absent unless the shop shows counts and it passed the threshold (D134). */
|
|
207
207
|
sold_at_least?: number;
|
|
208
|
+
/** Sold only made to a shopper's design (D174); absent from an engine that predates the flag. */
|
|
209
|
+
designable?: boolean;
|
|
208
210
|
options: ProductOption[] | null;
|
|
209
211
|
variants: Variant[] | null;
|
|
210
212
|
collections: {
|
|
@@ -384,6 +386,8 @@ type Order = {
|
|
|
384
386
|
shipping: Money;
|
|
385
387
|
shipping_method?: string;
|
|
386
388
|
discount: Money;
|
|
389
|
+
/** What the payment method added (D165): cash on delivery's extra charge. Absent on an engine before it. */
|
|
390
|
+
payment_fee?: Money;
|
|
387
391
|
tax: Money;
|
|
388
392
|
tax_inclusive: boolean;
|
|
389
393
|
total: Money;
|
|
@@ -411,9 +415,11 @@ type CheckoutResult = {
|
|
|
411
415
|
};
|
|
412
416
|
type CheckoutOptions = {
|
|
413
417
|
payment_methods: string[];
|
|
418
|
+
/** `fee` is what choosing the method adds to the order (D165); absent, it adds nothing. */
|
|
414
419
|
methods: {
|
|
415
420
|
code: string;
|
|
416
421
|
name: string;
|
|
422
|
+
fee?: Money;
|
|
417
423
|
}[];
|
|
418
424
|
currency: string;
|
|
419
425
|
};
|
|
@@ -556,6 +562,8 @@ type StoreProfile = {
|
|
|
556
562
|
phone: string;
|
|
557
563
|
support_url: string;
|
|
558
564
|
language: string;
|
|
565
|
+
/** Whether the store's prices include tax (D177); absent on an engine before it. */
|
|
566
|
+
prices_include_tax?: boolean;
|
|
559
567
|
/** Where the engine serves this store's pictures resized (D139); absent on an engine before it. */
|
|
560
568
|
images_path?: string;
|
|
561
569
|
/** The store's logo, logo for dark backgrounds and square icon (D148); empty or absent when it has none. */
|
|
@@ -730,6 +738,8 @@ type SearchDoc = {
|
|
|
730
738
|
price_max_minor: number;
|
|
731
739
|
in_stock: boolean;
|
|
732
740
|
skus: string[] | null;
|
|
741
|
+
/** As on the product (D174), as of its last change or reindex; absent from an index built before the flag. */
|
|
742
|
+
designable?: boolean;
|
|
733
743
|
updated_at: number;
|
|
734
744
|
};
|
|
735
745
|
type SearchResult = {
|
|
@@ -899,6 +909,7 @@ declare function toProduct(p: Product, extra?: {
|
|
|
899
909
|
highlights: string[];
|
|
900
910
|
freeGift: string | null;
|
|
901
911
|
soldAtLeast: number | null;
|
|
912
|
+
designable: boolean | undefined;
|
|
902
913
|
manageInventory: boolean;
|
|
903
914
|
allowBackorder: boolean;
|
|
904
915
|
stock: number;
|
|
@@ -1001,6 +1012,7 @@ declare function fromSearchDoc(d: SearchDoc): {
|
|
|
1001
1012
|
hasStock: boolean;
|
|
1002
1013
|
manageInventory: boolean;
|
|
1003
1014
|
allowBackorder: boolean;
|
|
1015
|
+
designable: boolean | undefined;
|
|
1004
1016
|
productTags: string;
|
|
1005
1017
|
category: {
|
|
1006
1018
|
name: string;
|
|
@@ -1724,6 +1736,7 @@ declare class ProductService extends CatalogService {
|
|
|
1724
1736
|
highlights: string[];
|
|
1725
1737
|
freeGift: string | null;
|
|
1726
1738
|
soldAtLeast: number | null;
|
|
1739
|
+
designable: boolean | undefined;
|
|
1727
1740
|
manageInventory: boolean;
|
|
1728
1741
|
allowBackorder: boolean;
|
|
1729
1742
|
stock: number;
|
|
@@ -1841,6 +1854,7 @@ declare class ProductService extends CatalogService {
|
|
|
1841
1854
|
highlights: string[];
|
|
1842
1855
|
freeGift: string | null;
|
|
1843
1856
|
soldAtLeast: number | null;
|
|
1857
|
+
designable: boolean | undefined;
|
|
1844
1858
|
manageInventory: boolean;
|
|
1845
1859
|
allowBackorder: boolean;
|
|
1846
1860
|
stock: number;
|
|
@@ -1941,6 +1955,7 @@ declare class ProductService extends CatalogService {
|
|
|
1941
1955
|
hasStock: boolean;
|
|
1942
1956
|
manageInventory: boolean;
|
|
1943
1957
|
allowBackorder: boolean;
|
|
1958
|
+
designable: boolean | undefined;
|
|
1944
1959
|
productTags: string;
|
|
1945
1960
|
category: {
|
|
1946
1961
|
name: string;
|
|
@@ -1993,6 +2008,7 @@ declare class ProductService extends CatalogService {
|
|
|
1993
2008
|
highlights: string[];
|
|
1994
2009
|
freeGift: string | null;
|
|
1995
2010
|
soldAtLeast: number | null;
|
|
2011
|
+
designable: boolean | undefined;
|
|
1996
2012
|
manageInventory: boolean;
|
|
1997
2013
|
allowBackorder: boolean;
|
|
1998
2014
|
stock: number;
|
|
@@ -2093,6 +2109,7 @@ declare class ProductService extends CatalogService {
|
|
|
2093
2109
|
hasStock: boolean;
|
|
2094
2110
|
manageInventory: boolean;
|
|
2095
2111
|
allowBackorder: boolean;
|
|
2112
|
+
designable: boolean | undefined;
|
|
2096
2113
|
productTags: string;
|
|
2097
2114
|
category: {
|
|
2098
2115
|
name: string;
|
|
@@ -2144,6 +2161,7 @@ declare class ProductService extends CatalogService {
|
|
|
2144
2161
|
highlights: string[];
|
|
2145
2162
|
freeGift: string | null;
|
|
2146
2163
|
soldAtLeast: number | null;
|
|
2164
|
+
designable: boolean | undefined;
|
|
2147
2165
|
manageInventory: boolean;
|
|
2148
2166
|
allowBackorder: boolean;
|
|
2149
2167
|
stock: number;
|
|
@@ -2244,6 +2262,7 @@ declare class ProductService extends CatalogService {
|
|
|
2244
2262
|
hasStock: boolean;
|
|
2245
2263
|
manageInventory: boolean;
|
|
2246
2264
|
allowBackorder: boolean;
|
|
2265
|
+
designable: boolean | undefined;
|
|
2247
2266
|
productTags: string;
|
|
2248
2267
|
category: {
|
|
2249
2268
|
name: string;
|
|
@@ -2342,6 +2361,7 @@ declare class ProductService extends CatalogService {
|
|
|
2342
2361
|
highlights: string[];
|
|
2343
2362
|
freeGift: string | null;
|
|
2344
2363
|
soldAtLeast: number | null;
|
|
2364
|
+
designable: boolean | undefined;
|
|
2345
2365
|
manageInventory: boolean;
|
|
2346
2366
|
allowBackorder: boolean;
|
|
2347
2367
|
stock: number;
|
|
@@ -2566,6 +2586,7 @@ declare class SearchService extends CatalogService {
|
|
|
2566
2586
|
highlights: string[];
|
|
2567
2587
|
freeGift: string | null;
|
|
2568
2588
|
soldAtLeast: number | null;
|
|
2589
|
+
designable: boolean | undefined;
|
|
2569
2590
|
manageInventory: boolean;
|
|
2570
2591
|
allowBackorder: boolean;
|
|
2571
2592
|
stock: number;
|
|
@@ -2666,6 +2687,7 @@ declare class SearchService extends CatalogService {
|
|
|
2666
2687
|
hasStock: boolean;
|
|
2667
2688
|
manageInventory: boolean;
|
|
2668
2689
|
allowBackorder: boolean;
|
|
2690
|
+
designable: boolean | undefined;
|
|
2669
2691
|
productTags: string;
|
|
2670
2692
|
category: {
|
|
2671
2693
|
name: string;
|
|
@@ -2755,6 +2777,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2755
2777
|
highlights: string[];
|
|
2756
2778
|
freeGift: string | null;
|
|
2757
2779
|
soldAtLeast: number | null;
|
|
2780
|
+
designable: boolean | undefined;
|
|
2758
2781
|
manageInventory: boolean;
|
|
2759
2782
|
allowBackorder: boolean;
|
|
2760
2783
|
stock: number;
|
|
@@ -2855,6 +2878,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2855
2878
|
hasStock: boolean;
|
|
2856
2879
|
manageInventory: boolean;
|
|
2857
2880
|
allowBackorder: boolean;
|
|
2881
|
+
designable: boolean | undefined;
|
|
2858
2882
|
productTags: string;
|
|
2859
2883
|
category: {
|
|
2860
2884
|
name: string;
|
|
@@ -2913,6 +2937,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2913
2937
|
highlights: string[];
|
|
2914
2938
|
freeGift: string | null;
|
|
2915
2939
|
soldAtLeast: number | null;
|
|
2940
|
+
designable: boolean | undefined;
|
|
2916
2941
|
manageInventory: boolean;
|
|
2917
2942
|
allowBackorder: boolean;
|
|
2918
2943
|
stock: number;
|
|
@@ -3013,6 +3038,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
3013
3038
|
hasStock: boolean;
|
|
3014
3039
|
manageInventory: boolean;
|
|
3015
3040
|
allowBackorder: boolean;
|
|
3041
|
+
designable: boolean | undefined;
|
|
3016
3042
|
productTags: string;
|
|
3017
3043
|
category: {
|
|
3018
3044
|
name: string;
|
|
@@ -3137,6 +3163,7 @@ declare class CollectionService extends BaseService {
|
|
|
3137
3163
|
highlights: string[];
|
|
3138
3164
|
freeGift: string | null;
|
|
3139
3165
|
soldAtLeast: number | null;
|
|
3166
|
+
designable: boolean | undefined;
|
|
3140
3167
|
manageInventory: boolean;
|
|
3141
3168
|
allowBackorder: boolean;
|
|
3142
3169
|
stock: number;
|
|
@@ -3249,6 +3276,7 @@ declare class CollectionService extends BaseService {
|
|
|
3249
3276
|
highlights: string[];
|
|
3250
3277
|
freeGift: string | null;
|
|
3251
3278
|
soldAtLeast: number | null;
|
|
3279
|
+
designable: boolean | undefined;
|
|
3252
3280
|
manageInventory: boolean;
|
|
3253
3281
|
allowBackorder: boolean;
|
|
3254
3282
|
stock: number;
|
|
@@ -4852,6 +4880,7 @@ declare class PaymentMethodService extends BaseService {
|
|
|
4852
4880
|
title: string;
|
|
4853
4881
|
description: string;
|
|
4854
4882
|
img: string | null;
|
|
4883
|
+
fee: number;
|
|
4855
4884
|
rank: number;
|
|
4856
4885
|
active: boolean;
|
|
4857
4886
|
isActive: boolean;
|
|
@@ -5233,10 +5262,12 @@ declare class OrderService extends BaseService {
|
|
|
5233
5262
|
productId: string;
|
|
5234
5263
|
variantId: string;
|
|
5235
5264
|
slug: string;
|
|
5265
|
+
designable: boolean | undefined;
|
|
5236
5266
|
title: string;
|
|
5237
5267
|
img: string | null;
|
|
5238
5268
|
price: number;
|
|
5239
5269
|
qty: number;
|
|
5270
|
+
designId: string | null;
|
|
5240
5271
|
}[]>;
|
|
5241
5272
|
/** The "someone just bought" popup would publish other shoppers' purchases; the engine offers none. */
|
|
5242
5273
|
listPublic(_args?: Record<string, unknown>): Promise<{
|
|
@@ -6210,6 +6241,7 @@ declare class WishlistService extends BaseService {
|
|
|
6210
6241
|
highlights: string[];
|
|
6211
6242
|
freeGift: string | null;
|
|
6212
6243
|
soldAtLeast: number | null;
|
|
6244
|
+
designable: boolean | undefined;
|
|
6213
6245
|
manageInventory: boolean;
|
|
6214
6246
|
allowBackorder: boolean;
|
|
6215
6247
|
stock: number;
|
|
@@ -6995,6 +7027,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
6995
7027
|
highlights: string[];
|
|
6996
7028
|
freeGift: string | null;
|
|
6997
7029
|
soldAtLeast: number | null;
|
|
7030
|
+
designable: boolean | undefined;
|
|
6998
7031
|
manageInventory: boolean;
|
|
6999
7032
|
allowBackorder: boolean;
|
|
7000
7033
|
stock: number;
|
|
@@ -7095,6 +7128,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
7095
7128
|
hasStock: boolean;
|
|
7096
7129
|
manageInventory: boolean;
|
|
7097
7130
|
allowBackorder: boolean;
|
|
7131
|
+
designable: boolean | undefined;
|
|
7098
7132
|
productTags: string;
|
|
7099
7133
|
category: {
|
|
7100
7134
|
name: string;
|
package/dist/index.cjs
CHANGED
|
@@ -648,6 +648,7 @@ function toProduct(p, extra = {}) {
|
|
|
648
648
|
freeGift: freeGiftOf(p),
|
|
649
649
|
// Counted by the engine, rounded down, and absent rather than zero.
|
|
650
650
|
soldAtLeast: typeof p.sold_at_least === "number" && p.sold_at_least > 0 ? p.sold_at_least : null,
|
|
651
|
+
designable: typeof p.designable === "boolean" ? p.designable : void 0,
|
|
651
652
|
// Product-level stock is what a card shows before a variant is picked:
|
|
652
653
|
// buyable when any live variant is, counted only where counting means
|
|
653
654
|
// something.
|
|
@@ -708,6 +709,7 @@ function fromSearchDoc(d) {
|
|
|
708
709
|
// built from it must not claim to count.
|
|
709
710
|
manageInventory: false,
|
|
710
711
|
allowBackorder: false,
|
|
712
|
+
designable: typeof d.designable === "boolean" ? d.designable : void 0,
|
|
711
713
|
productTags: arr(d.tags).join(","),
|
|
712
714
|
category: d.category ? { name: d.category.split(" / ").pop() ?? d.category, slug: "" } : null,
|
|
713
715
|
vendor: d.vendor ? { businessName: d.vendor } : null,
|
|
@@ -991,7 +993,7 @@ function toOrder(o) {
|
|
|
991
993
|
taxIncluded: o.tax_inclusive,
|
|
992
994
|
total: toMajor(o.total),
|
|
993
995
|
refunded: toMajor(o.refunded),
|
|
994
|
-
codCharges:
|
|
996
|
+
codCharges: toMajor(o.payment_fee),
|
|
995
997
|
coupon: code ? { code } : null,
|
|
996
998
|
userEmail: o.email,
|
|
997
999
|
email: o.email,
|
|
@@ -1810,7 +1812,7 @@ var CartService = class extends BaseService {
|
|
|
1810
1812
|
await this.data(`/api/carts/${encodeURIComponent(id2)}/line-items`, { method: "POST", body })
|
|
1811
1813
|
);
|
|
1812
1814
|
} catch (err) {
|
|
1813
|
-
if (
|
|
1815
|
+
if (cartGone(err)) {
|
|
1814
1816
|
const fresh = await this.open();
|
|
1815
1817
|
return this.present(
|
|
1816
1818
|
await this.data(`/api/carts/${encodeURIComponent(fresh)}/line-items`, { method: "POST", body })
|
|
@@ -2048,6 +2050,8 @@ var CartService = class extends BaseService {
|
|
|
2048
2050
|
}
|
|
2049
2051
|
};
|
|
2050
2052
|
var clean = (id2) => id2 && id2 !== "undefined" && id2 !== "null" ? id2 : null;
|
|
2053
|
+
var cartGone = (err) => err instanceof GoCommerceError && (err.code === "cart_not_found" || err.code === "cart_checked_out" || cartGoneOnOlderEngine(err));
|
|
2054
|
+
var cartGoneOnOlderEngine = (err) => err.code === "not_found" && err.message === "cart not found" || err.code === "conflict" && err.message === "this cart has already been checked out";
|
|
2051
2055
|
var cartService = new CartService();
|
|
2052
2056
|
|
|
2053
2057
|
// src/services/customizer-service.ts
|
|
@@ -2380,6 +2384,7 @@ var PaymentMethodService = class extends BaseService {
|
|
|
2380
2384
|
title: m.name,
|
|
2381
2385
|
description: "",
|
|
2382
2386
|
img: drive(m.code).img ?? null,
|
|
2387
|
+
fee: toMajor(m.fee),
|
|
2383
2388
|
rank: i,
|
|
2384
2389
|
active: true,
|
|
2385
2390
|
isActive: true
|
|
@@ -2469,7 +2474,8 @@ var OrderService = class extends BaseService {
|
|
|
2469
2474
|
title: l.title,
|
|
2470
2475
|
img: mediaUrl(l.image_url),
|
|
2471
2476
|
price: toMajor(l.unit_price),
|
|
2472
|
-
qty: l.quantity
|
|
2477
|
+
qty: l.quantity,
|
|
2478
|
+
designId: l.metadata?.design?.id ?? null
|
|
2473
2479
|
});
|
|
2474
2480
|
}
|
|
2475
2481
|
}
|
|
@@ -2479,7 +2485,8 @@ var OrderService = class extends BaseService {
|
|
|
2479
2485
|
return lines.flatMap((l, i) => {
|
|
2480
2486
|
const p = live[i];
|
|
2481
2487
|
if (!p) return [];
|
|
2482
|
-
|
|
2488
|
+
const designable = typeof p.designable === "boolean" ? p.designable : void 0;
|
|
2489
|
+
return [{ ...l, productId: String(l.productId), variantId: String(l.variantId), slug: p.slug, designable }];
|
|
2483
2490
|
});
|
|
2484
2491
|
}
|
|
2485
2492
|
/** The "someone just bought" popup would publish other shoppers' purchases; the engine offers none. */
|
|
@@ -3242,7 +3249,8 @@ var StoreService = class extends BaseService {
|
|
|
3242
3249
|
currency: {
|
|
3243
3250
|
...base.currency ?? {},
|
|
3244
3251
|
code,
|
|
3245
|
-
symbol: sameCurrency ? base.currency?.symbol ?? symbolFor(code) : symbolFor(code)
|
|
3252
|
+
symbol: sameCurrency ? base.currency?.symbol ?? symbolFor(code) : symbolFor(code),
|
|
3253
|
+
includesTax: profile?.prices_include_tax
|
|
3246
3254
|
},
|
|
3247
3255
|
language: ready.language,
|
|
3248
3256
|
plugins: {
|