@misiki/gocommerce-connector 0.25.0 → 0.26.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-BWwh1d1q.d.cts} +27 -0
- package/dist/{index-BWg1KptA.d.ts → index-BWwh1d1q.d.ts} +27 -0
- package/dist/index.cjs +9 -3
- 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 +9 -3
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +9 -3
- 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 +9 -3
- 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: {
|
|
@@ -730,6 +732,8 @@ type SearchDoc = {
|
|
|
730
732
|
price_max_minor: number;
|
|
731
733
|
in_stock: boolean;
|
|
732
734
|
skus: string[] | null;
|
|
735
|
+
/** As on the product (D174), as of its last change or reindex; absent from an index built before the flag. */
|
|
736
|
+
designable?: boolean;
|
|
733
737
|
updated_at: number;
|
|
734
738
|
};
|
|
735
739
|
type SearchResult = {
|
|
@@ -899,6 +903,7 @@ declare function toProduct(p: Product, extra?: {
|
|
|
899
903
|
highlights: string[];
|
|
900
904
|
freeGift: string | null;
|
|
901
905
|
soldAtLeast: number | null;
|
|
906
|
+
designable: boolean | undefined;
|
|
902
907
|
manageInventory: boolean;
|
|
903
908
|
allowBackorder: boolean;
|
|
904
909
|
stock: number;
|
|
@@ -1001,6 +1006,7 @@ declare function fromSearchDoc(d: SearchDoc): {
|
|
|
1001
1006
|
hasStock: boolean;
|
|
1002
1007
|
manageInventory: boolean;
|
|
1003
1008
|
allowBackorder: boolean;
|
|
1009
|
+
designable: boolean | undefined;
|
|
1004
1010
|
productTags: string;
|
|
1005
1011
|
category: {
|
|
1006
1012
|
name: string;
|
|
@@ -1724,6 +1730,7 @@ declare class ProductService extends CatalogService {
|
|
|
1724
1730
|
highlights: string[];
|
|
1725
1731
|
freeGift: string | null;
|
|
1726
1732
|
soldAtLeast: number | null;
|
|
1733
|
+
designable: boolean | undefined;
|
|
1727
1734
|
manageInventory: boolean;
|
|
1728
1735
|
allowBackorder: boolean;
|
|
1729
1736
|
stock: number;
|
|
@@ -1841,6 +1848,7 @@ declare class ProductService extends CatalogService {
|
|
|
1841
1848
|
highlights: string[];
|
|
1842
1849
|
freeGift: string | null;
|
|
1843
1850
|
soldAtLeast: number | null;
|
|
1851
|
+
designable: boolean | undefined;
|
|
1844
1852
|
manageInventory: boolean;
|
|
1845
1853
|
allowBackorder: boolean;
|
|
1846
1854
|
stock: number;
|
|
@@ -1941,6 +1949,7 @@ declare class ProductService extends CatalogService {
|
|
|
1941
1949
|
hasStock: boolean;
|
|
1942
1950
|
manageInventory: boolean;
|
|
1943
1951
|
allowBackorder: boolean;
|
|
1952
|
+
designable: boolean | undefined;
|
|
1944
1953
|
productTags: string;
|
|
1945
1954
|
category: {
|
|
1946
1955
|
name: string;
|
|
@@ -1993,6 +2002,7 @@ declare class ProductService extends CatalogService {
|
|
|
1993
2002
|
highlights: string[];
|
|
1994
2003
|
freeGift: string | null;
|
|
1995
2004
|
soldAtLeast: number | null;
|
|
2005
|
+
designable: boolean | undefined;
|
|
1996
2006
|
manageInventory: boolean;
|
|
1997
2007
|
allowBackorder: boolean;
|
|
1998
2008
|
stock: number;
|
|
@@ -2093,6 +2103,7 @@ declare class ProductService extends CatalogService {
|
|
|
2093
2103
|
hasStock: boolean;
|
|
2094
2104
|
manageInventory: boolean;
|
|
2095
2105
|
allowBackorder: boolean;
|
|
2106
|
+
designable: boolean | undefined;
|
|
2096
2107
|
productTags: string;
|
|
2097
2108
|
category: {
|
|
2098
2109
|
name: string;
|
|
@@ -2144,6 +2155,7 @@ declare class ProductService extends CatalogService {
|
|
|
2144
2155
|
highlights: string[];
|
|
2145
2156
|
freeGift: string | null;
|
|
2146
2157
|
soldAtLeast: number | null;
|
|
2158
|
+
designable: boolean | undefined;
|
|
2147
2159
|
manageInventory: boolean;
|
|
2148
2160
|
allowBackorder: boolean;
|
|
2149
2161
|
stock: number;
|
|
@@ -2244,6 +2256,7 @@ declare class ProductService extends CatalogService {
|
|
|
2244
2256
|
hasStock: boolean;
|
|
2245
2257
|
manageInventory: boolean;
|
|
2246
2258
|
allowBackorder: boolean;
|
|
2259
|
+
designable: boolean | undefined;
|
|
2247
2260
|
productTags: string;
|
|
2248
2261
|
category: {
|
|
2249
2262
|
name: string;
|
|
@@ -2342,6 +2355,7 @@ declare class ProductService extends CatalogService {
|
|
|
2342
2355
|
highlights: string[];
|
|
2343
2356
|
freeGift: string | null;
|
|
2344
2357
|
soldAtLeast: number | null;
|
|
2358
|
+
designable: boolean | undefined;
|
|
2345
2359
|
manageInventory: boolean;
|
|
2346
2360
|
allowBackorder: boolean;
|
|
2347
2361
|
stock: number;
|
|
@@ -2566,6 +2580,7 @@ declare class SearchService extends CatalogService {
|
|
|
2566
2580
|
highlights: string[];
|
|
2567
2581
|
freeGift: string | null;
|
|
2568
2582
|
soldAtLeast: number | null;
|
|
2583
|
+
designable: boolean | undefined;
|
|
2569
2584
|
manageInventory: boolean;
|
|
2570
2585
|
allowBackorder: boolean;
|
|
2571
2586
|
stock: number;
|
|
@@ -2666,6 +2681,7 @@ declare class SearchService extends CatalogService {
|
|
|
2666
2681
|
hasStock: boolean;
|
|
2667
2682
|
manageInventory: boolean;
|
|
2668
2683
|
allowBackorder: boolean;
|
|
2684
|
+
designable: boolean | undefined;
|
|
2669
2685
|
productTags: string;
|
|
2670
2686
|
category: {
|
|
2671
2687
|
name: string;
|
|
@@ -2755,6 +2771,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2755
2771
|
highlights: string[];
|
|
2756
2772
|
freeGift: string | null;
|
|
2757
2773
|
soldAtLeast: number | null;
|
|
2774
|
+
designable: boolean | undefined;
|
|
2758
2775
|
manageInventory: boolean;
|
|
2759
2776
|
allowBackorder: boolean;
|
|
2760
2777
|
stock: number;
|
|
@@ -2855,6 +2872,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2855
2872
|
hasStock: boolean;
|
|
2856
2873
|
manageInventory: boolean;
|
|
2857
2874
|
allowBackorder: boolean;
|
|
2875
|
+
designable: boolean | undefined;
|
|
2858
2876
|
productTags: string;
|
|
2859
2877
|
category: {
|
|
2860
2878
|
name: string;
|
|
@@ -2913,6 +2931,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2913
2931
|
highlights: string[];
|
|
2914
2932
|
freeGift: string | null;
|
|
2915
2933
|
soldAtLeast: number | null;
|
|
2934
|
+
designable: boolean | undefined;
|
|
2916
2935
|
manageInventory: boolean;
|
|
2917
2936
|
allowBackorder: boolean;
|
|
2918
2937
|
stock: number;
|
|
@@ -3013,6 +3032,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
3013
3032
|
hasStock: boolean;
|
|
3014
3033
|
manageInventory: boolean;
|
|
3015
3034
|
allowBackorder: boolean;
|
|
3035
|
+
designable: boolean | undefined;
|
|
3016
3036
|
productTags: string;
|
|
3017
3037
|
category: {
|
|
3018
3038
|
name: string;
|
|
@@ -3137,6 +3157,7 @@ declare class CollectionService extends BaseService {
|
|
|
3137
3157
|
highlights: string[];
|
|
3138
3158
|
freeGift: string | null;
|
|
3139
3159
|
soldAtLeast: number | null;
|
|
3160
|
+
designable: boolean | undefined;
|
|
3140
3161
|
manageInventory: boolean;
|
|
3141
3162
|
allowBackorder: boolean;
|
|
3142
3163
|
stock: number;
|
|
@@ -3249,6 +3270,7 @@ declare class CollectionService extends BaseService {
|
|
|
3249
3270
|
highlights: string[];
|
|
3250
3271
|
freeGift: string | null;
|
|
3251
3272
|
soldAtLeast: number | null;
|
|
3273
|
+
designable: boolean | undefined;
|
|
3252
3274
|
manageInventory: boolean;
|
|
3253
3275
|
allowBackorder: boolean;
|
|
3254
3276
|
stock: number;
|
|
@@ -5233,10 +5255,12 @@ declare class OrderService extends BaseService {
|
|
|
5233
5255
|
productId: string;
|
|
5234
5256
|
variantId: string;
|
|
5235
5257
|
slug: string;
|
|
5258
|
+
designable: boolean | undefined;
|
|
5236
5259
|
title: string;
|
|
5237
5260
|
img: string | null;
|
|
5238
5261
|
price: number;
|
|
5239
5262
|
qty: number;
|
|
5263
|
+
designId: string | null;
|
|
5240
5264
|
}[]>;
|
|
5241
5265
|
/** The "someone just bought" popup would publish other shoppers' purchases; the engine offers none. */
|
|
5242
5266
|
listPublic(_args?: Record<string, unknown>): Promise<{
|
|
@@ -6210,6 +6234,7 @@ declare class WishlistService extends BaseService {
|
|
|
6210
6234
|
highlights: string[];
|
|
6211
6235
|
freeGift: string | null;
|
|
6212
6236
|
soldAtLeast: number | null;
|
|
6237
|
+
designable: boolean | undefined;
|
|
6213
6238
|
manageInventory: boolean;
|
|
6214
6239
|
allowBackorder: boolean;
|
|
6215
6240
|
stock: number;
|
|
@@ -6995,6 +7020,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
6995
7020
|
highlights: string[];
|
|
6996
7021
|
freeGift: string | null;
|
|
6997
7022
|
soldAtLeast: number | null;
|
|
7023
|
+
designable: boolean | undefined;
|
|
6998
7024
|
manageInventory: boolean;
|
|
6999
7025
|
allowBackorder: boolean;
|
|
7000
7026
|
stock: number;
|
|
@@ -7095,6 +7121,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
7095
7121
|
hasStock: boolean;
|
|
7096
7122
|
manageInventory: boolean;
|
|
7097
7123
|
allowBackorder: boolean;
|
|
7124
|
+
designable: boolean | undefined;
|
|
7098
7125
|
productTags: string;
|
|
7099
7126
|
category: {
|
|
7100
7127
|
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: {
|
|
@@ -730,6 +732,8 @@ type SearchDoc = {
|
|
|
730
732
|
price_max_minor: number;
|
|
731
733
|
in_stock: boolean;
|
|
732
734
|
skus: string[] | null;
|
|
735
|
+
/** As on the product (D174), as of its last change or reindex; absent from an index built before the flag. */
|
|
736
|
+
designable?: boolean;
|
|
733
737
|
updated_at: number;
|
|
734
738
|
};
|
|
735
739
|
type SearchResult = {
|
|
@@ -899,6 +903,7 @@ declare function toProduct(p: Product, extra?: {
|
|
|
899
903
|
highlights: string[];
|
|
900
904
|
freeGift: string | null;
|
|
901
905
|
soldAtLeast: number | null;
|
|
906
|
+
designable: boolean | undefined;
|
|
902
907
|
manageInventory: boolean;
|
|
903
908
|
allowBackorder: boolean;
|
|
904
909
|
stock: number;
|
|
@@ -1001,6 +1006,7 @@ declare function fromSearchDoc(d: SearchDoc): {
|
|
|
1001
1006
|
hasStock: boolean;
|
|
1002
1007
|
manageInventory: boolean;
|
|
1003
1008
|
allowBackorder: boolean;
|
|
1009
|
+
designable: boolean | undefined;
|
|
1004
1010
|
productTags: string;
|
|
1005
1011
|
category: {
|
|
1006
1012
|
name: string;
|
|
@@ -1724,6 +1730,7 @@ declare class ProductService extends CatalogService {
|
|
|
1724
1730
|
highlights: string[];
|
|
1725
1731
|
freeGift: string | null;
|
|
1726
1732
|
soldAtLeast: number | null;
|
|
1733
|
+
designable: boolean | undefined;
|
|
1727
1734
|
manageInventory: boolean;
|
|
1728
1735
|
allowBackorder: boolean;
|
|
1729
1736
|
stock: number;
|
|
@@ -1841,6 +1848,7 @@ declare class ProductService extends CatalogService {
|
|
|
1841
1848
|
highlights: string[];
|
|
1842
1849
|
freeGift: string | null;
|
|
1843
1850
|
soldAtLeast: number | null;
|
|
1851
|
+
designable: boolean | undefined;
|
|
1844
1852
|
manageInventory: boolean;
|
|
1845
1853
|
allowBackorder: boolean;
|
|
1846
1854
|
stock: number;
|
|
@@ -1941,6 +1949,7 @@ declare class ProductService extends CatalogService {
|
|
|
1941
1949
|
hasStock: boolean;
|
|
1942
1950
|
manageInventory: boolean;
|
|
1943
1951
|
allowBackorder: boolean;
|
|
1952
|
+
designable: boolean | undefined;
|
|
1944
1953
|
productTags: string;
|
|
1945
1954
|
category: {
|
|
1946
1955
|
name: string;
|
|
@@ -1993,6 +2002,7 @@ declare class ProductService extends CatalogService {
|
|
|
1993
2002
|
highlights: string[];
|
|
1994
2003
|
freeGift: string | null;
|
|
1995
2004
|
soldAtLeast: number | null;
|
|
2005
|
+
designable: boolean | undefined;
|
|
1996
2006
|
manageInventory: boolean;
|
|
1997
2007
|
allowBackorder: boolean;
|
|
1998
2008
|
stock: number;
|
|
@@ -2093,6 +2103,7 @@ declare class ProductService extends CatalogService {
|
|
|
2093
2103
|
hasStock: boolean;
|
|
2094
2104
|
manageInventory: boolean;
|
|
2095
2105
|
allowBackorder: boolean;
|
|
2106
|
+
designable: boolean | undefined;
|
|
2096
2107
|
productTags: string;
|
|
2097
2108
|
category: {
|
|
2098
2109
|
name: string;
|
|
@@ -2144,6 +2155,7 @@ declare class ProductService extends CatalogService {
|
|
|
2144
2155
|
highlights: string[];
|
|
2145
2156
|
freeGift: string | null;
|
|
2146
2157
|
soldAtLeast: number | null;
|
|
2158
|
+
designable: boolean | undefined;
|
|
2147
2159
|
manageInventory: boolean;
|
|
2148
2160
|
allowBackorder: boolean;
|
|
2149
2161
|
stock: number;
|
|
@@ -2244,6 +2256,7 @@ declare class ProductService extends CatalogService {
|
|
|
2244
2256
|
hasStock: boolean;
|
|
2245
2257
|
manageInventory: boolean;
|
|
2246
2258
|
allowBackorder: boolean;
|
|
2259
|
+
designable: boolean | undefined;
|
|
2247
2260
|
productTags: string;
|
|
2248
2261
|
category: {
|
|
2249
2262
|
name: string;
|
|
@@ -2342,6 +2355,7 @@ declare class ProductService extends CatalogService {
|
|
|
2342
2355
|
highlights: string[];
|
|
2343
2356
|
freeGift: string | null;
|
|
2344
2357
|
soldAtLeast: number | null;
|
|
2358
|
+
designable: boolean | undefined;
|
|
2345
2359
|
manageInventory: boolean;
|
|
2346
2360
|
allowBackorder: boolean;
|
|
2347
2361
|
stock: number;
|
|
@@ -2566,6 +2580,7 @@ declare class SearchService extends CatalogService {
|
|
|
2566
2580
|
highlights: string[];
|
|
2567
2581
|
freeGift: string | null;
|
|
2568
2582
|
soldAtLeast: number | null;
|
|
2583
|
+
designable: boolean | undefined;
|
|
2569
2584
|
manageInventory: boolean;
|
|
2570
2585
|
allowBackorder: boolean;
|
|
2571
2586
|
stock: number;
|
|
@@ -2666,6 +2681,7 @@ declare class SearchService extends CatalogService {
|
|
|
2666
2681
|
hasStock: boolean;
|
|
2667
2682
|
manageInventory: boolean;
|
|
2668
2683
|
allowBackorder: boolean;
|
|
2684
|
+
designable: boolean | undefined;
|
|
2669
2685
|
productTags: string;
|
|
2670
2686
|
category: {
|
|
2671
2687
|
name: string;
|
|
@@ -2755,6 +2771,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2755
2771
|
highlights: string[];
|
|
2756
2772
|
freeGift: string | null;
|
|
2757
2773
|
soldAtLeast: number | null;
|
|
2774
|
+
designable: boolean | undefined;
|
|
2758
2775
|
manageInventory: boolean;
|
|
2759
2776
|
allowBackorder: boolean;
|
|
2760
2777
|
stock: number;
|
|
@@ -2855,6 +2872,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2855
2872
|
hasStock: boolean;
|
|
2856
2873
|
manageInventory: boolean;
|
|
2857
2874
|
allowBackorder: boolean;
|
|
2875
|
+
designable: boolean | undefined;
|
|
2858
2876
|
productTags: string;
|
|
2859
2877
|
category: {
|
|
2860
2878
|
name: string;
|
|
@@ -2913,6 +2931,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
2913
2931
|
highlights: string[];
|
|
2914
2932
|
freeGift: string | null;
|
|
2915
2933
|
soldAtLeast: number | null;
|
|
2934
|
+
designable: boolean | undefined;
|
|
2916
2935
|
manageInventory: boolean;
|
|
2917
2936
|
allowBackorder: boolean;
|
|
2918
2937
|
stock: number;
|
|
@@ -3013,6 +3032,7 @@ declare class MeilisearchService extends CatalogService {
|
|
|
3013
3032
|
hasStock: boolean;
|
|
3014
3033
|
manageInventory: boolean;
|
|
3015
3034
|
allowBackorder: boolean;
|
|
3035
|
+
designable: boolean | undefined;
|
|
3016
3036
|
productTags: string;
|
|
3017
3037
|
category: {
|
|
3018
3038
|
name: string;
|
|
@@ -3137,6 +3157,7 @@ declare class CollectionService extends BaseService {
|
|
|
3137
3157
|
highlights: string[];
|
|
3138
3158
|
freeGift: string | null;
|
|
3139
3159
|
soldAtLeast: number | null;
|
|
3160
|
+
designable: boolean | undefined;
|
|
3140
3161
|
manageInventory: boolean;
|
|
3141
3162
|
allowBackorder: boolean;
|
|
3142
3163
|
stock: number;
|
|
@@ -3249,6 +3270,7 @@ declare class CollectionService extends BaseService {
|
|
|
3249
3270
|
highlights: string[];
|
|
3250
3271
|
freeGift: string | null;
|
|
3251
3272
|
soldAtLeast: number | null;
|
|
3273
|
+
designable: boolean | undefined;
|
|
3252
3274
|
manageInventory: boolean;
|
|
3253
3275
|
allowBackorder: boolean;
|
|
3254
3276
|
stock: number;
|
|
@@ -5233,10 +5255,12 @@ declare class OrderService extends BaseService {
|
|
|
5233
5255
|
productId: string;
|
|
5234
5256
|
variantId: string;
|
|
5235
5257
|
slug: string;
|
|
5258
|
+
designable: boolean | undefined;
|
|
5236
5259
|
title: string;
|
|
5237
5260
|
img: string | null;
|
|
5238
5261
|
price: number;
|
|
5239
5262
|
qty: number;
|
|
5263
|
+
designId: string | null;
|
|
5240
5264
|
}[]>;
|
|
5241
5265
|
/** The "someone just bought" popup would publish other shoppers' purchases; the engine offers none. */
|
|
5242
5266
|
listPublic(_args?: Record<string, unknown>): Promise<{
|
|
@@ -6210,6 +6234,7 @@ declare class WishlistService extends BaseService {
|
|
|
6210
6234
|
highlights: string[];
|
|
6211
6235
|
freeGift: string | null;
|
|
6212
6236
|
soldAtLeast: number | null;
|
|
6237
|
+
designable: boolean | undefined;
|
|
6213
6238
|
manageInventory: boolean;
|
|
6214
6239
|
allowBackorder: boolean;
|
|
6215
6240
|
stock: number;
|
|
@@ -6995,6 +7020,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
6995
7020
|
highlights: string[];
|
|
6996
7021
|
freeGift: string | null;
|
|
6997
7022
|
soldAtLeast: number | null;
|
|
7023
|
+
designable: boolean | undefined;
|
|
6998
7024
|
manageInventory: boolean;
|
|
6999
7025
|
allowBackorder: boolean;
|
|
7000
7026
|
stock: number;
|
|
@@ -7095,6 +7121,7 @@ declare class AutocompleteService extends MeilisearchService {
|
|
|
7095
7121
|
hasStock: boolean;
|
|
7096
7122
|
manageInventory: boolean;
|
|
7097
7123
|
allowBackorder: boolean;
|
|
7124
|
+
designable: boolean | undefined;
|
|
7098
7125
|
productTags: string;
|
|
7099
7126
|
category: {
|
|
7100
7127
|
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,
|
|
@@ -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
|
|
@@ -2469,7 +2473,8 @@ var OrderService = class extends BaseService {
|
|
|
2469
2473
|
title: l.title,
|
|
2470
2474
|
img: mediaUrl(l.image_url),
|
|
2471
2475
|
price: toMajor(l.unit_price),
|
|
2472
|
-
qty: l.quantity
|
|
2476
|
+
qty: l.quantity,
|
|
2477
|
+
designId: l.metadata?.design?.id ?? null
|
|
2473
2478
|
});
|
|
2474
2479
|
}
|
|
2475
2480
|
}
|
|
@@ -2479,7 +2484,8 @@ var OrderService = class extends BaseService {
|
|
|
2479
2484
|
return lines.flatMap((l, i) => {
|
|
2480
2485
|
const p = live[i];
|
|
2481
2486
|
if (!p) return [];
|
|
2482
|
-
|
|
2487
|
+
const designable = typeof p.designable === "boolean" ? p.designable : void 0;
|
|
2488
|
+
return [{ ...l, productId: String(l.productId), variantId: String(l.variantId), slug: p.slug, designable }];
|
|
2483
2489
|
});
|
|
2484
2490
|
}
|
|
2485
2491
|
/** The "someone just bought" popup would publish other shoppers' purchases; the engine offers none. */
|