@misiki/gocommerce-connector 0.22.0 → 0.24.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 +4 -1
- package/dist/{index-CIhSE2qR.d.cts → index-BWg1KptA.d.cts} +278 -3
- package/dist/{index-CIhSE2qR.d.ts → index-BWg1KptA.d.ts} +278 -3
- package/dist/index.cjs +113 -13
- 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 +110 -14
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +113 -13
- 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 +110 -14
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,8 @@ Each is optional. Without `-identity` there is no sign-in (guest checkout
|
|
|
47
47
|
always works); without `-reviews` products show no stars; and so on. Add
|
|
48
48
|
`-meilisearch` (with `MEILI_HOST` and keys) for typo-tolerant search once a store
|
|
49
49
|
switches the Meilisearch plugin on,
|
|
50
|
-
`-newsletter` and `-contact` for the signup box and contact form,
|
|
50
|
+
`-newsletter` and `-contact` for the signup box and contact form,
|
|
51
|
+
`-whatsapp` for WhatsApp order updates, and `-b2b` for
|
|
51
52
|
business buyers (see "Beyond the storefront's screens").
|
|
52
53
|
|
|
53
54
|
### The browser and CORS
|
|
@@ -131,6 +132,7 @@ down stays best-effort: the storefront renders from its static record.
|
|
|
131
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 |
|
|
132
133
|
| bag | `/api/carts…`, `/api/carts/{token}/discount` |
|
|
133
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 |
|
|
134
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 |
|
|
135
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 |
|
|
136
138
|
| delivery options | `/api/checkout/rates` |
|
|
@@ -153,6 +155,7 @@ down stays best-effort: the storefront renders from its static record.
|
|
|
153
155
|
| product specs table | the product's category attribute answers |
|
|
154
156
|
| attribute filters (`?attributes.color=Red`) | `/api/products?attr=color:Red` |
|
|
155
157
|
| newsletter box | `/x/newsletter/subscribe` |
|
|
158
|
+
| WhatsApp order updates at checkout | `/x/notify-whatsapp/consent` — `whatsappService.consentOffer()`: `{ enabled, marketing }`, whether to show the order-updates box and the offers-and-reminders box; both false when ext/notify-whatsapp is not in the engine or does not answer, so checkout never waits on it. `whatsappService.setConsent({ cartId, phone, orderUpdates, marketing })` (PUT) records both answers for the phone, an unticked box as `false`; with `marketing` the engine keeps the phone on the bag for basket reminders. It throws the engine's 400 (`validation_failed`) when the phone is not a WhatsApp number for the store's country |
|
|
156
159
|
| 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 |
|
|
157
160
|
| search words, type-ahead (plugin on) | `/x/meilisearch/search`, falling back to the engine's own search when it is off or down |
|
|
158
161
|
| 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), the `whatsapp-chat` plugin's number as `plugins.whatsappChatButton`, and Google Customer Reviews (ext/google-reviews) as `plugins.googleReviewsOptIn` (`active` while the survey is on) and `plugins.googleStoreWidget` (`{ active, position: 'RIGHT_BOTTOM' \| 'LEFT_BOTTOM' }`, off without the survey) |
|
|
@@ -257,6 +257,9 @@ type CartLine = {
|
|
|
257
257
|
/** The add-on this line was bought as (D133), and the product it is offered with. */
|
|
258
258
|
add_on_id?: number;
|
|
259
259
|
add_on_for?: number;
|
|
260
|
+
/** The shopper's own design this line is made to (D162), and its picture. */
|
|
261
|
+
design_id?: string;
|
|
262
|
+
design_preview_url?: string;
|
|
260
263
|
compare_at_price?: Money;
|
|
261
264
|
};
|
|
262
265
|
/** A variant offered with a product, optionally at an offer price (D133). */
|
|
@@ -346,6 +349,13 @@ type OrderLine = {
|
|
|
346
349
|
shipped_quantity: number;
|
|
347
350
|
unit_price: Money;
|
|
348
351
|
total: Money;
|
|
352
|
+
/** `design` is a copy of the design a line was made to (D162), kept whatever later happens to it. */
|
|
353
|
+
metadata?: {
|
|
354
|
+
design?: {
|
|
355
|
+
id: string;
|
|
356
|
+
preview_url: string;
|
|
357
|
+
};
|
|
358
|
+
} & Record<string, unknown>;
|
|
349
359
|
};
|
|
350
360
|
type Fulfillment = {
|
|
351
361
|
id: number;
|
|
@@ -448,6 +458,97 @@ type GoogleSurvey = {
|
|
|
448
458
|
estimated_delivery_date: string;
|
|
449
459
|
opt_in_style?: string;
|
|
450
460
|
};
|
|
461
|
+
/** `GET /x/customizer/products/{id}` (ext/customizer, D162): a product's design editor, in the mockup's pixels. */
|
|
462
|
+
type CustomizerSetup = {
|
|
463
|
+
product_id: number;
|
|
464
|
+
mockup: {
|
|
465
|
+
url: string;
|
|
466
|
+
width: number;
|
|
467
|
+
height: number;
|
|
468
|
+
};
|
|
469
|
+
overlay_url: string | null;
|
|
470
|
+
print_area: {
|
|
471
|
+
x: number;
|
|
472
|
+
y: number;
|
|
473
|
+
width: number;
|
|
474
|
+
height: number;
|
|
475
|
+
radius: number;
|
|
476
|
+
};
|
|
477
|
+
print_size: {
|
|
478
|
+
width_mm: number;
|
|
479
|
+
height_mm: number;
|
|
480
|
+
dpi: number;
|
|
481
|
+
};
|
|
482
|
+
tools: {
|
|
483
|
+
upload: boolean;
|
|
484
|
+
text: boolean;
|
|
485
|
+
shapes: boolean;
|
|
486
|
+
background: boolean;
|
|
487
|
+
stickers: boolean;
|
|
488
|
+
};
|
|
489
|
+
fonts: {
|
|
490
|
+
key: string;
|
|
491
|
+
family: string;
|
|
492
|
+
}[];
|
|
493
|
+
stickers: {
|
|
494
|
+
id: number;
|
|
495
|
+
url: string;
|
|
496
|
+
width: number;
|
|
497
|
+
height: number;
|
|
498
|
+
}[];
|
|
499
|
+
min_photo_px: number;
|
|
500
|
+
consent: string;
|
|
501
|
+
};
|
|
502
|
+
/** `POST /x/customizer/uploads`: the file as the engine kept it, turned upright, so its size is as seen. */
|
|
503
|
+
type CustomizerUpload = {
|
|
504
|
+
upload_id: string;
|
|
505
|
+
url: string;
|
|
506
|
+
width: number;
|
|
507
|
+
height: number;
|
|
508
|
+
};
|
|
509
|
+
/** `POST /x/customizer/designs`. */
|
|
510
|
+
type CustomizerDesign = {
|
|
511
|
+
design_id: string;
|
|
512
|
+
preview_url: string;
|
|
513
|
+
};
|
|
514
|
+
/**
|
|
515
|
+
* A design, version 1, as the engine checks it and stores it on the order:
|
|
516
|
+
* coordinates in the mockup's pixels from the print area's top left corner,
|
|
517
|
+
* layers drawn first to last. The engine refuses a field a layer's type does
|
|
518
|
+
* not carry.
|
|
519
|
+
*/
|
|
520
|
+
type CustomizerDocument = {
|
|
521
|
+
version: 1;
|
|
522
|
+
background?: string | null;
|
|
523
|
+
layers: CustomizerLayer[];
|
|
524
|
+
};
|
|
525
|
+
type CustomizerLayer = {
|
|
526
|
+
id: string;
|
|
527
|
+
x: number;
|
|
528
|
+
y: number;
|
|
529
|
+
width: number;
|
|
530
|
+
height: number;
|
|
531
|
+
/** Degrees clockwise about the box's centre. */
|
|
532
|
+
rotation: number;
|
|
533
|
+
opacity: number;
|
|
534
|
+
} & ({
|
|
535
|
+
type: 'image';
|
|
536
|
+
upload_id: string;
|
|
537
|
+
} | {
|
|
538
|
+
type: 'text';
|
|
539
|
+
text: string;
|
|
540
|
+
font: string;
|
|
541
|
+
color: string;
|
|
542
|
+
font_size: number;
|
|
543
|
+
align?: 'left' | 'center' | 'right';
|
|
544
|
+
} | {
|
|
545
|
+
type: 'shape';
|
|
546
|
+
shape: 'rect' | 'circle' | 'heart' | 'star';
|
|
547
|
+
color: string;
|
|
548
|
+
} | {
|
|
549
|
+
type: 'sticker';
|
|
550
|
+
sticker_media_id: number;
|
|
551
|
+
});
|
|
451
552
|
/** `GET /api/store`: what anyone may read about the shop. */
|
|
452
553
|
type StoreProfile = {
|
|
453
554
|
name: string;
|
|
@@ -1021,6 +1122,9 @@ declare function toCartLine(l: CartLine, extra?: {
|
|
|
1021
1122
|
/** The add-on this line was bought as (D133), or null on an ordinary line. */
|
|
1022
1123
|
addOnId: string | null;
|
|
1023
1124
|
addOnFor: string | null;
|
|
1125
|
+
/** The shopper's own design this line is made to (D162) and its picture, or null on a line sold as it is. */
|
|
1126
|
+
designId: string | null;
|
|
1127
|
+
designPreview: string | null;
|
|
1024
1128
|
subtotal: number;
|
|
1025
1129
|
total: number;
|
|
1026
1130
|
inStock: boolean;
|
|
@@ -1072,6 +1176,9 @@ declare function toCart(c: Cart, extras?: CartExtras, lineExtra?: (l: CartLine)
|
|
|
1072
1176
|
/** The add-on this line was bought as (D133), or null on an ordinary line. */
|
|
1073
1177
|
addOnId: string | null;
|
|
1074
1178
|
addOnFor: string | null;
|
|
1179
|
+
/** The shopper's own design this line is made to (D162) and its picture, or null on a line sold as it is. */
|
|
1180
|
+
designId: string | null;
|
|
1181
|
+
designPreview: string | null;
|
|
1075
1182
|
subtotal: number;
|
|
1076
1183
|
total: number;
|
|
1077
1184
|
inStock: boolean;
|
|
@@ -1214,6 +1321,8 @@ declare function toOrder(o: Order): {
|
|
|
1214
1321
|
total: number;
|
|
1215
1322
|
currencyCode: string;
|
|
1216
1323
|
status: string;
|
|
1324
|
+
designId: string | null;
|
|
1325
|
+
designPreview: string | null;
|
|
1217
1326
|
files: never[];
|
|
1218
1327
|
usedOptions: never[];
|
|
1219
1328
|
}[];
|
|
@@ -3282,6 +3391,8 @@ declare class CartService extends BaseService {
|
|
|
3282
3391
|
mrp: number;
|
|
3283
3392
|
addOnId: string | null;
|
|
3284
3393
|
addOnFor: string | null;
|
|
3394
|
+
designId: string | null;
|
|
3395
|
+
designPreview: string | null;
|
|
3285
3396
|
subtotal: number;
|
|
3286
3397
|
total: number;
|
|
3287
3398
|
inStock: boolean;
|
|
@@ -3368,6 +3479,8 @@ declare class CartService extends BaseService {
|
|
|
3368
3479
|
mrp: number;
|
|
3369
3480
|
addOnId: string | null;
|
|
3370
3481
|
addOnFor: string | null;
|
|
3482
|
+
designId: string | null;
|
|
3483
|
+
designPreview: string | null;
|
|
3371
3484
|
subtotal: number;
|
|
3372
3485
|
total: number;
|
|
3373
3486
|
inStock: boolean;
|
|
@@ -3459,6 +3572,8 @@ declare class CartService extends BaseService {
|
|
|
3459
3572
|
mrp: number;
|
|
3460
3573
|
addOnId: string | null;
|
|
3461
3574
|
addOnFor: string | null;
|
|
3575
|
+
designId: string | null;
|
|
3576
|
+
designPreview: string | null;
|
|
3462
3577
|
subtotal: number;
|
|
3463
3578
|
total: number;
|
|
3464
3579
|
inStock: boolean;
|
|
@@ -3526,14 +3641,17 @@ declare class CartService extends BaseService {
|
|
|
3526
3641
|
}>;
|
|
3527
3642
|
/**
|
|
3528
3643
|
* `qty` is a change, not a total: +1 from a product page, −1 from a card's
|
|
3529
|
-
* minus button. With no cart yet, one is opened and remembered.
|
|
3644
|
+
* minus button. With no cart yet, one is opened and remembered. A
|
|
3645
|
+
* `designId` from `customizerService.saveDesign` makes the variant to the
|
|
3646
|
+
* shopper's design, on a line of its own.
|
|
3530
3647
|
*/
|
|
3531
|
-
addToCart({ cartId, lineId, qty, variantId, }: {
|
|
3648
|
+
addToCart({ cartId, lineId, qty, variantId, designId, }: {
|
|
3532
3649
|
cartId?: string | null;
|
|
3533
3650
|
lineId?: string | null;
|
|
3534
3651
|
qty?: number;
|
|
3535
3652
|
productId?: string;
|
|
3536
3653
|
variantId?: string;
|
|
3654
|
+
designId?: string;
|
|
3537
3655
|
}): Promise<{
|
|
3538
3656
|
id: string;
|
|
3539
3657
|
status: "open" | "converted" | "abandoned";
|
|
@@ -3555,6 +3673,8 @@ declare class CartService extends BaseService {
|
|
|
3555
3673
|
mrp: number;
|
|
3556
3674
|
addOnId: string | null;
|
|
3557
3675
|
addOnFor: string | null;
|
|
3676
|
+
designId: string | null;
|
|
3677
|
+
designPreview: string | null;
|
|
3558
3678
|
subtotal: number;
|
|
3559
3679
|
total: number;
|
|
3560
3680
|
inStock: boolean;
|
|
@@ -3651,6 +3771,8 @@ declare class CartService extends BaseService {
|
|
|
3651
3771
|
mrp: number;
|
|
3652
3772
|
addOnId: string | null;
|
|
3653
3773
|
addOnFor: string | null;
|
|
3774
|
+
designId: string | null;
|
|
3775
|
+
designPreview: string | null;
|
|
3654
3776
|
subtotal: number;
|
|
3655
3777
|
total: number;
|
|
3656
3778
|
inStock: boolean;
|
|
@@ -3768,6 +3890,8 @@ declare class CartService extends BaseService {
|
|
|
3768
3890
|
mrp: number;
|
|
3769
3891
|
addOnId: string | null;
|
|
3770
3892
|
addOnFor: string | null;
|
|
3893
|
+
designId: string | null;
|
|
3894
|
+
designPreview: string | null;
|
|
3771
3895
|
subtotal: number;
|
|
3772
3896
|
total: number;
|
|
3773
3897
|
inStock: boolean;
|
|
@@ -3857,6 +3981,8 @@ declare class CartService extends BaseService {
|
|
|
3857
3981
|
mrp: number;
|
|
3858
3982
|
addOnId: string | null;
|
|
3859
3983
|
addOnFor: string | null;
|
|
3984
|
+
designId: string | null;
|
|
3985
|
+
designPreview: string | null;
|
|
3860
3986
|
subtotal: number;
|
|
3861
3987
|
total: number;
|
|
3862
3988
|
inStock: boolean;
|
|
@@ -3955,6 +4081,8 @@ declare class CartService extends BaseService {
|
|
|
3955
4081
|
mrp: number;
|
|
3956
4082
|
addOnId: string | null;
|
|
3957
4083
|
addOnFor: string | null;
|
|
4084
|
+
designId: string | null;
|
|
4085
|
+
designPreview: string | null;
|
|
3958
4086
|
subtotal: number;
|
|
3959
4087
|
total: number;
|
|
3960
4088
|
inStock: boolean;
|
|
@@ -4049,6 +4177,8 @@ declare class CartService extends BaseService {
|
|
|
4049
4177
|
mrp: number;
|
|
4050
4178
|
addOnId: string | null;
|
|
4051
4179
|
addOnFor: string | null;
|
|
4180
|
+
designId: string | null;
|
|
4181
|
+
designPreview: string | null;
|
|
4052
4182
|
subtotal: number;
|
|
4053
4183
|
total: number;
|
|
4054
4184
|
inStock: boolean;
|
|
@@ -4116,6 +4246,8 @@ declare class CartService extends BaseService {
|
|
|
4116
4246
|
mrp: number;
|
|
4117
4247
|
addOnId: string | null;
|
|
4118
4248
|
addOnFor: string | null;
|
|
4249
|
+
designId: string | null;
|
|
4250
|
+
designPreview: string | null;
|
|
4119
4251
|
subtotal: number;
|
|
4120
4252
|
total: number;
|
|
4121
4253
|
inStock: boolean;
|
|
@@ -4206,6 +4338,8 @@ declare class CartService extends BaseService {
|
|
|
4206
4338
|
mrp: number;
|
|
4207
4339
|
addOnId: string | null;
|
|
4208
4340
|
addOnFor: string | null;
|
|
4341
|
+
designId: string | null;
|
|
4342
|
+
designPreview: string | null;
|
|
4209
4343
|
subtotal: number;
|
|
4210
4344
|
total: number;
|
|
4211
4345
|
inStock: boolean;
|
|
@@ -4296,6 +4430,8 @@ declare class CartService extends BaseService {
|
|
|
4296
4430
|
mrp: number;
|
|
4297
4431
|
addOnId: string | null;
|
|
4298
4432
|
addOnFor: string | null;
|
|
4433
|
+
designId: string | null;
|
|
4434
|
+
designPreview: string | null;
|
|
4299
4435
|
subtotal: number;
|
|
4300
4436
|
total: number;
|
|
4301
4437
|
inStock: boolean;
|
|
@@ -4372,6 +4508,82 @@ declare class CartService extends BaseService {
|
|
|
4372
4508
|
}
|
|
4373
4509
|
declare const cartService: CartService;
|
|
4374
4510
|
|
|
4511
|
+
/** What a product's design editor draws and offers, in the mockup's pixels. */
|
|
4512
|
+
type CustomizerEditor = {
|
|
4513
|
+
productId: string;
|
|
4514
|
+
mockup: {
|
|
4515
|
+
url: string;
|
|
4516
|
+
width: number;
|
|
4517
|
+
height: number;
|
|
4518
|
+
};
|
|
4519
|
+
/** Drawn above the design: the camera cut-out, the case's edges. */
|
|
4520
|
+
overlayUrl: string | null;
|
|
4521
|
+
printArea: {
|
|
4522
|
+
x: number;
|
|
4523
|
+
y: number;
|
|
4524
|
+
width: number;
|
|
4525
|
+
height: number;
|
|
4526
|
+
radius: number;
|
|
4527
|
+
};
|
|
4528
|
+
printSize: {
|
|
4529
|
+
widthMm: number;
|
|
4530
|
+
heightMm: number;
|
|
4531
|
+
dpi: number;
|
|
4532
|
+
};
|
|
4533
|
+
tools: {
|
|
4534
|
+
upload: boolean;
|
|
4535
|
+
text: boolean;
|
|
4536
|
+
shapes: boolean;
|
|
4537
|
+
background: boolean;
|
|
4538
|
+
stickers: boolean;
|
|
4539
|
+
};
|
|
4540
|
+
fonts: {
|
|
4541
|
+
key: string;
|
|
4542
|
+
family: string;
|
|
4543
|
+
}[];
|
|
4544
|
+
stickers: {
|
|
4545
|
+
id: number;
|
|
4546
|
+
url: string;
|
|
4547
|
+
width: number;
|
|
4548
|
+
height: number;
|
|
4549
|
+
}[];
|
|
4550
|
+
/** A photo whose shorter side is below this is likely to print soft: warn, the engine still takes it. */
|
|
4551
|
+
minPhotoPx: number;
|
|
4552
|
+
/** Shown before the shopper chooses a photo. */
|
|
4553
|
+
consent: string;
|
|
4554
|
+
};
|
|
4555
|
+
type CustomizerFile = {
|
|
4556
|
+
uploadId: string;
|
|
4557
|
+
url: string;
|
|
4558
|
+
width: number;
|
|
4559
|
+
height: number;
|
|
4560
|
+
};
|
|
4561
|
+
type CustomizerSavedDesign = {
|
|
4562
|
+
designId: string;
|
|
4563
|
+
previewUrl: string;
|
|
4564
|
+
};
|
|
4565
|
+
/**
|
|
4566
|
+
* A shopper's own design on a product (ext/customizer, D162). Every URL goes
|
|
4567
|
+
* through the proxy path when one is set, so it is same-origin and a canvas
|
|
4568
|
+
* that draws it can still be exported.
|
|
4569
|
+
*/
|
|
4570
|
+
declare class CustomizerService extends BaseService {
|
|
4571
|
+
private readonly facts;
|
|
4572
|
+
/** Null when the product cannot be designed, or on any failure: the page draws without the editor. */
|
|
4573
|
+
setup(productId: string | number): Promise<CustomizerEditor | null>;
|
|
4574
|
+
/** A photo, or the finished preview or print file. The engine's refusal is thrown with its message. */
|
|
4575
|
+
upload(file: Blob, filename?: string): Promise<CustomizerFile>;
|
|
4576
|
+
/** The document goes as it is: the order keeps it, and whatever renders the print reads it there. */
|
|
4577
|
+
saveDesign(design: {
|
|
4578
|
+
productId: string | number;
|
|
4579
|
+
variantId: string | number;
|
|
4580
|
+
previewUploadId: string;
|
|
4581
|
+
printUploadId: string;
|
|
4582
|
+
document: CustomizerDocument;
|
|
4583
|
+
}): Promise<CustomizerSavedDesign>;
|
|
4584
|
+
}
|
|
4585
|
+
declare const customizerService: CustomizerService;
|
|
4586
|
+
|
|
4375
4587
|
/**
|
|
4376
4588
|
* Placing an order.
|
|
4377
4589
|
*
|
|
@@ -4571,6 +4783,8 @@ declare class CheckoutService extends BaseService {
|
|
|
4571
4783
|
total: number;
|
|
4572
4784
|
currencyCode: string;
|
|
4573
4785
|
status: string;
|
|
4786
|
+
designId: string | null;
|
|
4787
|
+
designPreview: string | null;
|
|
4574
4788
|
files: never[];
|
|
4575
4789
|
usedOptions: never[];
|
|
4576
4790
|
}[];
|
|
@@ -4780,6 +4994,8 @@ declare class OrderService extends BaseService {
|
|
|
4780
4994
|
total: number;
|
|
4781
4995
|
currencyCode: string;
|
|
4782
4996
|
status: string;
|
|
4997
|
+
designId: string | null;
|
|
4998
|
+
designPreview: string | null;
|
|
4783
4999
|
files: never[];
|
|
4784
5000
|
usedOptions: never[];
|
|
4785
5001
|
}[];
|
|
@@ -4884,6 +5100,8 @@ declare class OrderService extends BaseService {
|
|
|
4884
5100
|
total: number;
|
|
4885
5101
|
currencyCode: string;
|
|
4886
5102
|
status: string;
|
|
5103
|
+
designId: string | null;
|
|
5104
|
+
designPreview: string | null;
|
|
4887
5105
|
files: never[];
|
|
4888
5106
|
usedOptions: never[];
|
|
4889
5107
|
}[];
|
|
@@ -4986,6 +5204,8 @@ declare class OrderService extends BaseService {
|
|
|
4986
5204
|
total: number;
|
|
4987
5205
|
currencyCode: string;
|
|
4988
5206
|
status: string;
|
|
5207
|
+
designId: string | null;
|
|
5208
|
+
designPreview: string | null;
|
|
4989
5209
|
files: never[];
|
|
4990
5210
|
usedOptions: never[];
|
|
4991
5211
|
}[];
|
|
@@ -5110,6 +5330,8 @@ declare class OrderService extends BaseService {
|
|
|
5110
5330
|
total: number;
|
|
5111
5331
|
currencyCode: string;
|
|
5112
5332
|
status: string;
|
|
5333
|
+
designId: string | null;
|
|
5334
|
+
designPreview: string | null;
|
|
5113
5335
|
files: never[];
|
|
5114
5336
|
usedOptions: never[];
|
|
5115
5337
|
}[];
|
|
@@ -5216,6 +5438,8 @@ declare class OrderService extends BaseService {
|
|
|
5216
5438
|
total: number;
|
|
5217
5439
|
currencyCode: string;
|
|
5218
5440
|
status: string;
|
|
5441
|
+
designId: string | null;
|
|
5442
|
+
designPreview: string | null;
|
|
5219
5443
|
files: never[];
|
|
5220
5444
|
usedOptions: never[];
|
|
5221
5445
|
}[];
|
|
@@ -5334,6 +5558,8 @@ declare class OrderService extends BaseService {
|
|
|
5334
5558
|
total: number;
|
|
5335
5559
|
currencyCode: string;
|
|
5336
5560
|
status: string;
|
|
5561
|
+
designId: string | null;
|
|
5562
|
+
designPreview: string | null;
|
|
5337
5563
|
files: never[];
|
|
5338
5564
|
usedOptions: never[];
|
|
5339
5565
|
}[];
|
|
@@ -5593,6 +5819,8 @@ declare class UserService extends BaseService {
|
|
|
5593
5819
|
total: number;
|
|
5594
5820
|
currencyCode: string;
|
|
5595
5821
|
status: string;
|
|
5822
|
+
designId: string | null;
|
|
5823
|
+
designPreview: string | null;
|
|
5596
5824
|
files: never[];
|
|
5597
5825
|
usedOptions: never[];
|
|
5598
5826
|
}[];
|
|
@@ -7151,6 +7379,47 @@ declare class NewsletterService extends BaseService {
|
|
|
7151
7379
|
}
|
|
7152
7380
|
declare const newsletterService: NewsletterService;
|
|
7153
7381
|
|
|
7382
|
+
/** Which WhatsApp boxes checkout shows. */
|
|
7383
|
+
type WhatsappConsentOffer = {
|
|
7384
|
+
/** The store sends order updates on WhatsApp: show the opt-in. */
|
|
7385
|
+
enabled: boolean;
|
|
7386
|
+
/** It sends basket reminders too: show the marketing box as well. */
|
|
7387
|
+
marketing: boolean;
|
|
7388
|
+
};
|
|
7389
|
+
/** What the engine kept for a phone: the number as it reads it, in E.164. */
|
|
7390
|
+
type WhatsappConsent = {
|
|
7391
|
+
phone: string;
|
|
7392
|
+
orderUpdates: boolean;
|
|
7393
|
+
marketing: boolean;
|
|
7394
|
+
};
|
|
7395
|
+
/**
|
|
7396
|
+
* The shopper's WhatsApp opt-in at checkout (ext/notify-whatsapp).
|
|
7397
|
+
*
|
|
7398
|
+
* The engine keeps the latest answer per phone, so an unticked box is sent as
|
|
7399
|
+
* `false` rather than left out: it is how a shopper who said yes last time
|
|
7400
|
+
* says no now.
|
|
7401
|
+
*/
|
|
7402
|
+
declare class WhatsappService extends BaseService {
|
|
7403
|
+
/**
|
|
7404
|
+
* Whether to show the boxes. Never throws: an engine without the module, or
|
|
7405
|
+
* one that fails, answers both off, because checkout must not depend on it.
|
|
7406
|
+
*/
|
|
7407
|
+
consentOffer(): Promise<WhatsappConsentOffer>;
|
|
7408
|
+
/**
|
|
7409
|
+
* Records both answers for the phone as typed, against the bag (with
|
|
7410
|
+
* `marketing`, the engine keeps the phone on it for basket reminders). Throws
|
|
7411
|
+
* the engine's 400 (`validation_failed`) when the phone is not a WhatsApp
|
|
7412
|
+
* number for the store's country.
|
|
7413
|
+
*/
|
|
7414
|
+
setConsent({ cartId, phone, orderUpdates, marketing, }: {
|
|
7415
|
+
cartId?: string | null;
|
|
7416
|
+
phone: string;
|
|
7417
|
+
orderUpdates: boolean;
|
|
7418
|
+
marketing: boolean;
|
|
7419
|
+
}): Promise<WhatsappConsent>;
|
|
7420
|
+
}
|
|
7421
|
+
declare const whatsappService: WhatsappService;
|
|
7422
|
+
|
|
7154
7423
|
type B2bRole = 'admin' | 'approver' | 'buyer';
|
|
7155
7424
|
type Company = {
|
|
7156
7425
|
id: number;
|
|
@@ -7392,6 +7661,8 @@ declare class B2bService extends BaseService {
|
|
|
7392
7661
|
mrp: number;
|
|
7393
7662
|
addOnId: string | null;
|
|
7394
7663
|
addOnFor: string | null;
|
|
7664
|
+
designId: string | null;
|
|
7665
|
+
designPreview: string | null;
|
|
7395
7666
|
subtotal: number;
|
|
7396
7667
|
total: number;
|
|
7397
7668
|
inStock: boolean;
|
|
@@ -7463,6 +7734,8 @@ declare class B2bService extends BaseService {
|
|
|
7463
7734
|
mrp: number;
|
|
7464
7735
|
addOnId: string | null;
|
|
7465
7736
|
addOnFor: string | null;
|
|
7737
|
+
designId: string | null;
|
|
7738
|
+
designPreview: string | null;
|
|
7466
7739
|
subtotal: number;
|
|
7467
7740
|
total: number;
|
|
7468
7741
|
inStock: boolean;
|
|
@@ -7622,6 +7895,8 @@ declare class B2bService extends BaseService {
|
|
|
7622
7895
|
total: number;
|
|
7623
7896
|
currencyCode: string;
|
|
7624
7897
|
status: string;
|
|
7898
|
+
designId: string | null;
|
|
7899
|
+
designPreview: string | null;
|
|
7625
7900
|
files: never[];
|
|
7626
7901
|
usedOptions: never[];
|
|
7627
7902
|
}[];
|
|
@@ -7698,4 +7973,4 @@ declare class B2bService extends BaseService {
|
|
|
7698
7973
|
}
|
|
7699
7974
|
declare const b2bService: B2bService;
|
|
7700
7975
|
|
|
7701
|
-
export {
|
|
7976
|
+
export { FaqService 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, type CustomizerDesign as L, type CustomizerDocument as M, type CustomizerEditor as N, type CustomizerFile as O, type CustomizerLayer as P, type CustomizerSavedDesign as Q, CustomizerService as R, type CustomizerSetup as S, type CustomizerUpload as T, DealService as U, DemoRequestService as V, type EngineRequest as W, EnquiryService as X, type Envelope as Y, type FacetValue as Z, type Faq as _, type Address as a, type SiteFooter as a$, FeedbackService as a0, type FooterSettings as a1, type FreeShipping as a2, type Fulfillment as a3, GalleryService as a4, type GooglePlace as a5, type GoogleReview as a6, GoogleReviewService as a7, type GoogleReviews as a8, type GoogleSurvey as a9, PageService as aA, type PaymentIntent as aB, PaymentMethodService as aC, type Plugin as aD, PluginService as aE, PopularSearchService as aF, PopularityService as aG, type Postcode as aH, type Product as aI, type ProductFacets 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 SiteChrome as a_, type HeaderSettings as aa, type HomeLayout as ab, type HomeLayoutSection as ac, HomeService as ad, type IdentityAddress as ae, InitService as af, type Invitation as ag, type LayoutCollection as ah, type LayoutPage as ai, LayoutService as aj, type Lead as ak, type ListMeta as al, MeilisearchService as am, type Member as an, type Menu as ao, type MenuItem as ap, MenuService as aq, type MenuSummary as ar, type Money as as, NewsletterService as at, type Offer as au, type OpeningHours as av, type Order as aw, type OrderLine as ax, OrderService as ay, type PageLayout as az, AddressService as b, newsletterService as b$, type SiteHeader as b0, type SocialLink as b1, StateService as b2, type StoreProfile as b3, StoreService as b4, type StorefrontCategory as b5, type StorefrontMenu as b6, type StorefrontOrder as b7, type StorefrontProduct as b8, type ThemeSettings as b9, checkoutService as bA, collectionService as bB, contactService as bC, countryService as bD, couponService as bE, currencyExponent as bF, currencyService as bG, customizerService as bH, dealService as bI, demoRequestService as bJ, emptyCart as bK, emptyPage as bL, enquiryService as bM, faqService as bN, feedbackService as bO, fromEngineAddress as bP, fromIdentityAddress as bQ, fromSearchDoc as bR, galleryService as bS, googleReviewService as bT, homeService as bU, initService as bV, layoutService as bW, mediaUrl as bX, meilisearchService as bY, menuService as bZ, minorToMajor as b_, type ThemeSettingsResult as ba, UploadService as bb, UserService as bc, type Variant as bd, type VariantImage as be, VariantService as bf, VarniCustomDesignService as bg, VarniCustomProductService as bh, type Vendor as bi, VendorService as bj, WarrantyService as bk, type WhatsappConsent as bl, type WhatsappConsentOffer as bm, WhatsappService as bn, type Wishlist as bo, type WishlistItem as bp, WishlistService as bq, addressService as br, authService as bs, autocompleteService as bt, b2bService as bu, bannerService as bv, blogService as bw, cartService as bx, categoryService as by, chatService as bz, type AppliedDiscount as c, orderService as c0, ownDomain as c1, pageService as c2, paymentMethodService as c3, pluginService as c4, pluginsService as c5, popularSearchService as c6, popularityService as c7, priceOf as c8, productImages as c9, toMinor as cA, toOrder as cB, toPage as cC, toProduct as cD, toRating as cE, toStorefrontFacets as cF, toUser as cG, toVariant as cH, toVendor as cI, uploadService as cJ, userService as cK, variantService as cL, varniCustomDesignService as cM, varniCustomProductService as cN, vendorService as cO, warrantyService as cP, whatsappService as cQ, wishlistService as cR, productService as ca, productVideos as cb, profileService as cc, qs as cd, reelsService as ce, regionService as cf, reviewService as cg, searchService as ch, setRequestHost as ci, settingService as cj, settingsService as ck, stateService as cl, staticStore as cm, storeForHost as cn, storeService as co, toAddOn as cp, toCart as cq, toCartLine as cr, toCartOffer as cs, toCategory as ct, toCmsPage as cu, toCollection as cv, toEngineAddress as cw, toFreeShipping as cx, toIdentityAddress as cy, toMajor as cz, 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 };
|