brainerce 1.58.1 → 1.63.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 +534 -125
- package/dist/index.d.mts +623 -43
- package/dist/index.d.ts +623 -43
- package/dist/index.js +359 -41
- package/dist/index.mjs +358 -41
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -216,6 +216,14 @@ interface StoreInfo {
|
|
|
216
216
|
ordersWriteEnabled?: boolean;
|
|
217
217
|
/** Whether guest checkout is tracked (sales-channel mode only) */
|
|
218
218
|
guestCheckoutTracking?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Whether the merchant has back-in-stock alerts switched on for this
|
|
221
|
+
* storefront (sales-channel mode only). When false, do not render the
|
|
222
|
+
* "email me when this is back" affordance at all — `stockAlerts.subscribe()`
|
|
223
|
+
* still answers `{ ok: true }` and records nothing, so a button left up looks
|
|
224
|
+
* like it worked and quietly does nothing.
|
|
225
|
+
*/
|
|
226
|
+
stockAlertsEnabled?: boolean;
|
|
219
227
|
/**
|
|
220
228
|
* Whether new customer registrations require email verification.
|
|
221
229
|
* If true, your site MUST implement an email verification flow:
|
|
@@ -224,6 +232,17 @@ interface StoreInfo {
|
|
|
224
232
|
* 3. Call verifyEmail(code) with the code they received via email
|
|
225
233
|
*/
|
|
226
234
|
requireEmailVerification?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Whether the merchant requires a birthday at registration on this channel.
|
|
237
|
+
* When true, `registerCustomer()` is rejected with HTTP 400 unless the call
|
|
238
|
+
* carries both `birthMonth` and `birthDay`, so render the two fields on the
|
|
239
|
+
* signup form and validate them before you submit.
|
|
240
|
+
*
|
|
241
|
+
* Sales-channel mode only, because the flag lives on the sales channel: a
|
|
242
|
+
* `storeId`-mode storefront never receives it and its register route never
|
|
243
|
+
* enforces it. Absent (an older API build) means the same as false.
|
|
244
|
+
*/
|
|
245
|
+
requireBirthday?: boolean;
|
|
227
246
|
/** Upsell feature settings (storefront mode) */
|
|
228
247
|
upsell?: UpsellSettings;
|
|
229
248
|
/** Multi-language / i18n settings */
|
|
@@ -404,6 +423,14 @@ interface CustomerProfile {
|
|
|
404
423
|
acceptsMarketing: boolean;
|
|
405
424
|
/** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. Admin-set only, never customer-editable. */
|
|
406
425
|
role?: string;
|
|
426
|
+
/**
|
|
427
|
+
* Birthday month (1-12) the customer saved on their profile. Month and day
|
|
428
|
+
* only, never a year. Returned together with `birthDay` or not at all, so a
|
|
429
|
+
* form can test one field and trust the other.
|
|
430
|
+
*/
|
|
431
|
+
birthMonth?: number;
|
|
432
|
+
/** Birthday day of the month (1-31). Returned together with `birthMonth` or not at all. */
|
|
433
|
+
birthDay?: number;
|
|
407
434
|
addresses: CustomerAddress[];
|
|
408
435
|
createdAt: string;
|
|
409
436
|
updatedAt: string;
|
|
@@ -787,6 +814,30 @@ interface Product {
|
|
|
787
814
|
createdAt: string;
|
|
788
815
|
updatedAt: string;
|
|
789
816
|
}
|
|
817
|
+
/**
|
|
818
|
+
* A customer-uploaded photo on a review, as shoppers see it.
|
|
819
|
+
* `width`/`height` are the intrinsic pixel size — set them on your `<img>` so the
|
|
820
|
+
* gallery reserves space instead of shifting layout as photos load.
|
|
821
|
+
*/
|
|
822
|
+
interface ProductReviewImage {
|
|
823
|
+
id: string;
|
|
824
|
+
url: string;
|
|
825
|
+
thumbnailUrl: string | null;
|
|
826
|
+
width: number | null;
|
|
827
|
+
height: number | null;
|
|
828
|
+
position: number;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Moderation view of a photo — adds the two states a shopper never sees.
|
|
832
|
+
* `approvedAt: null` means the photo is waiting on the merchant, which only ever
|
|
833
|
+
* happens on stores that opted into review-photo approval.
|
|
834
|
+
*/
|
|
835
|
+
interface ProductReviewImageAdmin extends ProductReviewImage {
|
|
836
|
+
assetKey: string;
|
|
837
|
+
approvedAt: string | null;
|
|
838
|
+
hiddenAt: string | null;
|
|
839
|
+
createdAt: string;
|
|
840
|
+
}
|
|
790
841
|
/**
|
|
791
842
|
* Product review submitted by a customer.
|
|
792
843
|
* Reviews publish immediately (no PENDING state). Merchants hide via the admin
|
|
@@ -802,13 +853,17 @@ interface ProductReview {
|
|
|
802
853
|
/** Only present in admin responses; null on storefront responses. */
|
|
803
854
|
hiddenAt?: string | null;
|
|
804
855
|
createdAt: string;
|
|
856
|
+
/** Visible photos, in display order. Always an array; empty when there are none. */
|
|
857
|
+
images: ProductReviewImage[];
|
|
805
858
|
}
|
|
806
859
|
/** Admin-mode review with full PII. Returned by `client.adminReviews.*`. */
|
|
807
|
-
interface ProductReviewAdmin extends ProductReview {
|
|
860
|
+
interface ProductReviewAdmin extends Omit<ProductReview, 'images'> {
|
|
808
861
|
customerId: string | null;
|
|
809
862
|
authorEmail: string | null;
|
|
810
863
|
orderId: string | null;
|
|
811
864
|
updatedAt: string;
|
|
865
|
+
/** ALL photos, including pending and hidden — this is the moderation surface. */
|
|
866
|
+
images: ProductReviewImageAdmin[];
|
|
812
867
|
}
|
|
813
868
|
/**
|
|
814
869
|
* Body for customer-authenticated submit / update.
|
|
@@ -817,6 +872,16 @@ interface ProductReviewAdmin extends ProductReview {
|
|
|
817
872
|
interface WriteProductReviewInput {
|
|
818
873
|
rating: number;
|
|
819
874
|
body?: string;
|
|
875
|
+
/**
|
|
876
|
+
* Storage keys from `uploadReviewPhoto()`, in display order. Keys, not URLs —
|
|
877
|
+
* the server resolves each one against the store's own assets and rejects
|
|
878
|
+
* anything that is not a review photo.
|
|
879
|
+
*
|
|
880
|
+
* On update this REPLACES the photo set, so pass the keys you want to keep.
|
|
881
|
+
* OMITTING the field leaves the existing photos untouched; passing `[]` removes
|
|
882
|
+
* them all.
|
|
883
|
+
*/
|
|
884
|
+
imageKeys?: string[];
|
|
820
885
|
}
|
|
821
886
|
/**
|
|
822
887
|
* @deprecated Use `WriteProductReviewInput`. Customers no longer pass author info
|
|
@@ -826,6 +891,15 @@ interface SubmitProductReviewInput extends WriteProductReviewInput {
|
|
|
826
891
|
authorName?: string;
|
|
827
892
|
authorEmail?: string;
|
|
828
893
|
}
|
|
894
|
+
/** What `uploadReviewPhoto()` gives back. Pass `key` to the submit/update call. */
|
|
895
|
+
interface ReviewPhotoUpload {
|
|
896
|
+
/** The value to put in `imageKeys`. */
|
|
897
|
+
key: string;
|
|
898
|
+
/** For rendering a local preview before submitting. Not what you send back. */
|
|
899
|
+
url: string;
|
|
900
|
+
width: number | null;
|
|
901
|
+
height: number | null;
|
|
902
|
+
}
|
|
829
903
|
/**
|
|
830
904
|
* Returned by `client.getMyProductReview(productId)`. Tells the storefront which
|
|
831
905
|
* UI to render: sign-in / not-eligible / submit / edit.
|
|
@@ -836,6 +910,24 @@ interface MyProductReview {
|
|
|
836
910
|
reason: 'no_eligible_order' | 'reviews_disabled' | 'product_not_found' | null;
|
|
837
911
|
/** The customer's existing review for this product, or null. */
|
|
838
912
|
myReview: ProductReview | null;
|
|
913
|
+
/**
|
|
914
|
+
* The store's photo policy. Read this instead of hard-coding limits: render the
|
|
915
|
+
* picker only when `enabled`, cap selection at `maxPerReview`, reject oversized
|
|
916
|
+
* files client-side at `maxBytes`, and when `requiresApproval` is true tell the
|
|
917
|
+
* customer their photo waits for the merchant before it appears.
|
|
918
|
+
*/
|
|
919
|
+
photos: {
|
|
920
|
+
enabled: boolean;
|
|
921
|
+
maxPerReview: number;
|
|
922
|
+
maxBytes: number;
|
|
923
|
+
requiresApproval: boolean;
|
|
924
|
+
};
|
|
925
|
+
/**
|
|
926
|
+
* The customer's OWN photos including any still pending, so you can show them
|
|
927
|
+
* their upload sitting in the queue rather than looking like it failed. Note
|
|
928
|
+
* `myReview.images` carries only the publicly visible subset.
|
|
929
|
+
*/
|
|
930
|
+
myImages: ProductReviewImageAdmin[];
|
|
839
931
|
}
|
|
840
932
|
interface ProductImage {
|
|
841
933
|
url: string;
|
|
@@ -940,6 +1032,18 @@ interface InventoryInfo {
|
|
|
940
1032
|
* false if trackingMode is DISABLED or if out of stock.
|
|
941
1033
|
*/
|
|
942
1034
|
canPurchase: boolean;
|
|
1035
|
+
/**
|
|
1036
|
+
* Whether the merchant lets this item be ordered while out of stock.
|
|
1037
|
+
* Present on `TRACKED` items only — the one mode where it means anything.
|
|
1038
|
+
*
|
|
1039
|
+
* Use it to decide where a back-in-stock alert belongs: an alert on a
|
|
1040
|
+
* backorderable item tells someone to come back and do what they can already
|
|
1041
|
+
* do, so `stockAlerts.subscribe()` silently discards those requests. The gate
|
|
1042
|
+
* is `!canPurchase && trackingMode === 'TRACKED' && backorderMode === 'NONE'`.
|
|
1043
|
+
*
|
|
1044
|
+
* Absent on older backends — treat `undefined` as `'NONE'`.
|
|
1045
|
+
*/
|
|
1046
|
+
backorderMode?: 'NONE' | 'ALLOW' | 'NOTIFY';
|
|
943
1047
|
/** Last inventory sync timestamp (admin mode only) */
|
|
944
1048
|
lastInventorySyncAt?: string | null;
|
|
945
1049
|
}
|
|
@@ -1725,7 +1829,14 @@ interface Order {
|
|
|
1725
1829
|
notes?: string | null;
|
|
1726
1830
|
/** Payment method used (e.g., "card", "paypal", "cash_on_delivery"). */
|
|
1727
1831
|
paymentMethod?: string | null;
|
|
1728
|
-
/**
|
|
1832
|
+
/**
|
|
1833
|
+
* Financial status: "pending", "authorized", "partially_paid", "paid",
|
|
1834
|
+
* "partially_refunded", "refunded", "voided".
|
|
1835
|
+
*
|
|
1836
|
+
* `"paid"` does not imply a payment provider was involved — a merchant can
|
|
1837
|
+
* record an out-of-band payment (cash on delivery, bank transfer) and the
|
|
1838
|
+
* order reads `"paid"` with no provider behind it.
|
|
1839
|
+
*/
|
|
1729
1840
|
financialStatus?: string | null;
|
|
1730
1841
|
/** Fulfillment status: "unfulfilled", "partial", "fulfilled". */
|
|
1731
1842
|
fulfillmentStatus?: string | null;
|
|
@@ -2114,9 +2225,32 @@ interface Customer {
|
|
|
2114
2225
|
hasAccount: boolean;
|
|
2115
2226
|
emailVerified: boolean;
|
|
2116
2227
|
acceptsMarketing: boolean;
|
|
2228
|
+
/**
|
|
2229
|
+
* Whether a marketing campaign can actually REACH this address — a different
|
|
2230
|
+
* question from `acceptsMarketing`. Audience resolution drops a recipient on
|
|
2231
|
+
* either the consent flag or a suppression row, and the suppression row wins:
|
|
2232
|
+
* an address whose consent box was re-ticked in the dashboard still reads
|
|
2233
|
+
* `'UNSUBSCRIBED'`, because only the recipient's own confirmed opt-in clears
|
|
2234
|
+
* it. `'BLOCKED'` cannot be cleared at all. Only `'SUBSCRIBED'` is mailable.
|
|
2235
|
+
*
|
|
2236
|
+
* Returned by the single-customer read (`GET /api/v1/customers/{id}`) and by
|
|
2237
|
+
* the customer list. Optional because it is computed, not stored: responses
|
|
2238
|
+
* that never compute it (create, update, register) omit it rather than
|
|
2239
|
+
* guessing, and an older API build omits it everywhere. Fall back to
|
|
2240
|
+
* `acceptsMarketing` when it is absent.
|
|
2241
|
+
*/
|
|
2242
|
+
marketingStatus?: 'SUBSCRIBED' | 'NOT_SUBSCRIBED' | 'UNSUBSCRIBED' | 'BOUNCED' | 'COMPLAINED' | 'BLOCKED';
|
|
2117
2243
|
tags: string[];
|
|
2118
2244
|
/** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. Admin-set only, never customer-editable. */
|
|
2119
2245
|
role?: string;
|
|
2246
|
+
/**
|
|
2247
|
+
* Birthday month (1-12) the customer saved. Month and day only, never a
|
|
2248
|
+
* year. Returned together with `birthDay` or not at all, so a form can test
|
|
2249
|
+
* one field and trust the other.
|
|
2250
|
+
*/
|
|
2251
|
+
birthMonth?: number;
|
|
2252
|
+
/** Birthday day of the month (1-31). Returned together with `birthMonth` or not at all. */
|
|
2253
|
+
birthDay?: number;
|
|
2120
2254
|
totalOrders: number;
|
|
2121
2255
|
lastOrderAt?: string;
|
|
2122
2256
|
metadata?: Record<string, unknown>;
|
|
@@ -2217,6 +2351,13 @@ interface CheckoutPrefillData {
|
|
|
2217
2351
|
lastName?: string;
|
|
2218
2352
|
phone?: string;
|
|
2219
2353
|
emailVerified: boolean;
|
|
2354
|
+
/**
|
|
2355
|
+
* Birthday month (1-12). Month and day only, never a year. Returned
|
|
2356
|
+
* together with `birthDay` or not at all.
|
|
2357
|
+
*/
|
|
2358
|
+
birthMonth?: number;
|
|
2359
|
+
/** Birthday day of the month (1-31). Returned together with `birthMonth` or not at all. */
|
|
2360
|
+
birthDay?: number;
|
|
2220
2361
|
};
|
|
2221
2362
|
/** Customer's default address (if any) */
|
|
2222
2363
|
defaultAddress: CustomerAddress | null;
|
|
@@ -2249,6 +2390,15 @@ interface CreateCustomerDto {
|
|
|
2249
2390
|
tags?: string[];
|
|
2250
2391
|
/** Free-form merchant-set segment (e.g. "wholesale", "vip"), max 50 chars. */
|
|
2251
2392
|
role?: string;
|
|
2393
|
+
/**
|
|
2394
|
+
* Birthday month (1-12). Month and day only, never a year, so there is no
|
|
2395
|
+
* age to store. Send `birthMonth` and `birthDay` together: one without the
|
|
2396
|
+
* other is rejected with HTTP 400, and so is a day the month does not have
|
|
2397
|
+
* (February has no 31st).
|
|
2398
|
+
*/
|
|
2399
|
+
birthMonth?: number;
|
|
2400
|
+
/** Birthday day of the month (1-31). Send it together with `birthMonth`. */
|
|
2401
|
+
birthDay?: number;
|
|
2252
2402
|
/**
|
|
2253
2403
|
* Explicit FIRST-TOUCH channel (internal SalesChannel id or public `vc_*`).
|
|
2254
2404
|
* Creating a customer through the API is not itself a channel sighting, so
|
|
@@ -2388,6 +2538,19 @@ interface RegisterCustomerDto {
|
|
|
2388
2538
|
lastName?: string;
|
|
2389
2539
|
phone?: string;
|
|
2390
2540
|
acceptsMarketing?: boolean;
|
|
2541
|
+
/**
|
|
2542
|
+
* Birthday month (1-12). Month and day only, never a year, so there is no
|
|
2543
|
+
* age to store. Send `birthMonth` and `birthDay` together: one without the
|
|
2544
|
+
* other is rejected with HTTP 400, and so is a day the month does not have.
|
|
2545
|
+
*
|
|
2546
|
+
* Optional by default. A merchant can make the birthday mandatory at
|
|
2547
|
+
* registration on a sales channel, which surfaces as `requireBirthday` on
|
|
2548
|
+
* `getStoreInfo()`; on such a channel a register call that omits the two
|
|
2549
|
+
* fields is rejected with HTTP 400.
|
|
2550
|
+
*/
|
|
2551
|
+
birthMonth?: number;
|
|
2552
|
+
/** Birthday day of the month (1-31). Send it together with `birthMonth`. */
|
|
2553
|
+
birthDay?: number;
|
|
2391
2554
|
/**
|
|
2392
2555
|
* Loyalty referral share code (REF-XXXXXXXX) from a referrer's link.
|
|
2393
2556
|
* Validated asynchronously after registration — an invalid code never fails
|
|
@@ -2665,7 +2828,8 @@ interface AddToCartDto {
|
|
|
2665
2828
|
* Modifier-group selections for restaurant / customizable products
|
|
2666
2829
|
* (e.g., toppings, sauces, sides). The server validates against effective
|
|
2667
2830
|
* group rules and rejects invalid payloads with a `MODIFIER_VALIDATION_FAILED`
|
|
2668
|
-
* envelope
|
|
2831
|
+
* envelope, readable at `BrainerceError.details` — see
|
|
2832
|
+
* {@link ModifierValidationFailedError}.
|
|
2669
2833
|
*/
|
|
2670
2834
|
selections?: ModifierSelection[];
|
|
2671
2835
|
/**
|
|
@@ -3889,19 +4053,99 @@ interface StockAvailabilityResponse {
|
|
|
3889
4053
|
allAvailable: boolean;
|
|
3890
4054
|
results: StockAvailabilityResult[];
|
|
3891
4055
|
}
|
|
4056
|
+
/**
|
|
4057
|
+
* Body of a `409`/`400` stock rejection, as it actually arrives on the wire.
|
|
4058
|
+
*
|
|
4059
|
+
* This is the shape of `BrainerceError.details` — the SDK puts the **whole
|
|
4060
|
+
* parsed response body** there, so you read `err.details.code` and the
|
|
4061
|
+
* quantities under `err.details.details`:
|
|
4062
|
+
*
|
|
4063
|
+
* ```typescript
|
|
4064
|
+
* try {
|
|
4065
|
+
* await client.addToCart(cartId, { productId, quantity: 5 });
|
|
4066
|
+
* } catch (err) {
|
|
4067
|
+
* const body = (err as BrainerceError).details as InsufficientStockError;
|
|
4068
|
+
* if (body?.code === 'INSUFFICIENT_STOCK') {
|
|
4069
|
+
* // single-line rejection (add-to-cart, reservation)
|
|
4070
|
+
* console.log(body.details.available, body.details.requested);
|
|
4071
|
+
* // multi-line rejection (checkout) — every offending line
|
|
4072
|
+
* body.details.items?.forEach((i) => console.log(i.productId, i.available));
|
|
4073
|
+
* }
|
|
4074
|
+
* }
|
|
4075
|
+
* ```
|
|
4076
|
+
*
|
|
4077
|
+
* Which keys are populated depends on where the error came from:
|
|
4078
|
+
* - Cart add/update and inventory reservation reject **one** line, so they
|
|
4079
|
+
* send `available` + `requested`.
|
|
4080
|
+
* - Checkout validates the **whole** cart, so it sends `items[]`.
|
|
4081
|
+
* Treat every key as optional and branch on what is present.
|
|
4082
|
+
*/
|
|
3892
4083
|
interface InsufficientStockError {
|
|
3893
4084
|
code: 'INSUFFICIENT_STOCK';
|
|
3894
4085
|
message: string;
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
productId
|
|
3901
|
-
variantId?: string;
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
4086
|
+
details: {
|
|
4087
|
+
/** Units actually purchasable. Single-line rejections only. */
|
|
4088
|
+
available?: number;
|
|
4089
|
+
/** Units the request asked for. Single-line rejections only. */
|
|
4090
|
+
requested?: number;
|
|
4091
|
+
productId?: string;
|
|
4092
|
+
variantId?: string | null;
|
|
4093
|
+
/** Per-line breakdown. Checkout-time rejections only. */
|
|
4094
|
+
items?: Array<{
|
|
4095
|
+
productId: string;
|
|
4096
|
+
variantId?: string | null;
|
|
4097
|
+
available?: number;
|
|
4098
|
+
requested?: number;
|
|
4099
|
+
}>;
|
|
4100
|
+
};
|
|
4101
|
+
}
|
|
4102
|
+
/**
|
|
4103
|
+
* Body of a `400` modifier-selection rejection (`MODIFIER_VALIDATION_FAILED`).
|
|
4104
|
+
*
|
|
4105
|
+
* Like every error body, this is what lands in `BrainerceError.details`, so
|
|
4106
|
+
* the issue list is `err.details.details.errors`. Render each entry inline
|
|
4107
|
+
* next to the group or modifier it names.
|
|
4108
|
+
*/
|
|
4109
|
+
interface ModifierValidationFailedError {
|
|
4110
|
+
code: 'MODIFIER_VALIDATION_FAILED';
|
|
4111
|
+
message: string;
|
|
4112
|
+
details: {
|
|
4113
|
+
errors: ModifierValidationError[];
|
|
4114
|
+
};
|
|
4115
|
+
}
|
|
4116
|
+
/**
|
|
4117
|
+
* Body of a `400` price-drift rejection (`PRICE_DRIFT`), raised by
|
|
4118
|
+
* `createCheckout` when a cart line's snapshot price no longer matches the
|
|
4119
|
+
* live price. Recover with `refreshCartSnapshots()` or by removing the lines.
|
|
4120
|
+
*/
|
|
4121
|
+
interface PriceDriftError {
|
|
4122
|
+
code: 'PRICE_DRIFT';
|
|
4123
|
+
message: string;
|
|
4124
|
+
details: {
|
|
4125
|
+
items: Array<{
|
|
4126
|
+
itemId: string;
|
|
4127
|
+
productId: string;
|
|
4128
|
+
variantId?: string | null;
|
|
4129
|
+
oldUnitPrice: string;
|
|
4130
|
+
newUnitPrice: string;
|
|
4131
|
+
delta: string;
|
|
4132
|
+
direction: 'increased' | 'decreased';
|
|
4133
|
+
}>;
|
|
4134
|
+
};
|
|
4135
|
+
}
|
|
4136
|
+
/**
|
|
4137
|
+
* Body of a `400` `PRODUCT_UNAVAILABLE` rejection — a line's product was
|
|
4138
|
+
* deleted, unpublished, or has inventory tracking disabled.
|
|
4139
|
+
*/
|
|
4140
|
+
interface ProductUnavailableError {
|
|
4141
|
+
code: 'PRODUCT_UNAVAILABLE';
|
|
4142
|
+
message: string;
|
|
4143
|
+
details?: {
|
|
4144
|
+
items?: Array<{
|
|
4145
|
+
productId: string;
|
|
4146
|
+
variantId?: string | null;
|
|
4147
|
+
}>;
|
|
4148
|
+
};
|
|
3905
4149
|
}
|
|
3906
4150
|
interface PublishProductResponse {
|
|
3907
4151
|
productId: string;
|
|
@@ -4682,7 +4926,8 @@ interface ShippingRateConfig {
|
|
|
4682
4926
|
minDeliveryDays?: number | null;
|
|
4683
4927
|
maxDeliveryDays?: number | null;
|
|
4684
4928
|
handlingTime?: number | null;
|
|
4685
|
-
|
|
4929
|
+
/** Whether the delivery charge itself is taxed. `NONE` leaves postage untaxed; omitted (or `TAXABLE`) taxes it at the store's standard rate. */
|
|
4930
|
+
taxStatus: 'TAXABLE' | 'NONE';
|
|
4686
4931
|
minOrderAmount?: number | null;
|
|
4687
4932
|
maxCost?: number | null;
|
|
4688
4933
|
isActive: boolean;
|
|
@@ -4732,7 +4977,8 @@ interface CreateShippingRateDto {
|
|
|
4732
4977
|
minDeliveryDays?: number;
|
|
4733
4978
|
maxDeliveryDays?: number;
|
|
4734
4979
|
handlingTime?: number;
|
|
4735
|
-
|
|
4980
|
+
/** Whether the delivery charge itself is taxed. `NONE` leaves postage untaxed; omitted (or `TAXABLE`) taxes it at the store's standard rate. */
|
|
4981
|
+
taxStatus?: 'TAXABLE' | 'NONE';
|
|
4736
4982
|
minOrderAmount?: number;
|
|
4737
4983
|
maxCost?: number;
|
|
4738
4984
|
isActive?: boolean;
|
|
@@ -4745,7 +4991,8 @@ interface UpdateShippingRateDto {
|
|
|
4745
4991
|
minDeliveryDays?: number | null;
|
|
4746
4992
|
maxDeliveryDays?: number | null;
|
|
4747
4993
|
handlingTime?: number | null;
|
|
4748
|
-
|
|
4994
|
+
/** Whether the delivery charge itself is taxed. `NONE` leaves postage untaxed; omitted (or `TAXABLE`) taxes it at the store's standard rate. */
|
|
4995
|
+
taxStatus?: 'TAXABLE' | 'NONE';
|
|
4749
4996
|
minOrderAmount?: number | null;
|
|
4750
4997
|
maxCost?: number | null;
|
|
4751
4998
|
isActive?: boolean;
|
|
@@ -4767,16 +5014,29 @@ interface TaxRate {
|
|
|
4767
5014
|
accountId: string;
|
|
4768
5015
|
storeId: string;
|
|
4769
5016
|
name: string;
|
|
4770
|
-
/**
|
|
5017
|
+
/**
|
|
5018
|
+
* Tax rate as a **percentage**, e.g. `"8.5"` for 8.5%. Range 0–100.
|
|
5019
|
+
*
|
|
5020
|
+
* Note this differs from {@link TaxBreakdownItem.rate}, which is a decimal
|
|
5021
|
+
* fraction (`0.085`) because it is computed rather than stored.
|
|
5022
|
+
*/
|
|
4771
5023
|
rate: string;
|
|
4772
5024
|
/** ISO country code */
|
|
4773
5025
|
country?: string | null;
|
|
4774
5026
|
/** Region/state code */
|
|
4775
5027
|
region?: string | null;
|
|
4776
|
-
/**
|
|
5028
|
+
/**
|
|
5029
|
+
* Postal code, matched **exactly** (case-insensitive, spaces and hyphens
|
|
5030
|
+
* ignored). Wildcards, prefixes and ranges are NOT supported — `941*` and
|
|
5031
|
+
* `94100-94199` match nothing.
|
|
5032
|
+
*/
|
|
4777
5033
|
postalCode?: string | null;
|
|
4778
5034
|
taxType: string;
|
|
4779
|
-
/**
|
|
5035
|
+
/**
|
|
5036
|
+
* @deprecated Not implemented. There is no `isCompound` column, nothing
|
|
5037
|
+
* reads this value, and rates never compound. Sending it on a create or
|
|
5038
|
+
* update request is rejected with a 400.
|
|
5039
|
+
*/
|
|
4780
5040
|
isCompound: boolean;
|
|
4781
5041
|
/** Whether tax is included in prices */
|
|
4782
5042
|
isInclusive: boolean;
|
|
@@ -4791,11 +5051,17 @@ interface TaxRate {
|
|
|
4791
5051
|
}
|
|
4792
5052
|
interface CreateTaxRateDto {
|
|
4793
5053
|
name: string;
|
|
5054
|
+
/** Tax rate as a **percentage**, e.g. `8.5` for 8.5%. Range 0–100. */
|
|
4794
5055
|
rate: number;
|
|
4795
5056
|
country?: string;
|
|
4796
5057
|
region?: string;
|
|
5058
|
+
/** Matched exactly — wildcards, prefixes and ranges are NOT supported. */
|
|
4797
5059
|
postalCode?: string;
|
|
4798
5060
|
taxType?: string;
|
|
5061
|
+
/**
|
|
5062
|
+
* @deprecated Not implemented — the backend rejects this field with a 400.
|
|
5063
|
+
* Rates never compound. Omit it.
|
|
5064
|
+
*/
|
|
4799
5065
|
isCompound?: boolean;
|
|
4800
5066
|
isInclusive?: boolean;
|
|
4801
5067
|
/** Tax class this rate applies to. Omit/null = Standard. */
|
|
@@ -4806,11 +5072,17 @@ interface CreateTaxRateDto {
|
|
|
4806
5072
|
}
|
|
4807
5073
|
interface UpdateTaxRateDto {
|
|
4808
5074
|
name?: string;
|
|
5075
|
+
/** Tax rate as a **percentage**, e.g. `8.5` for 8.5%. Range 0–100. */
|
|
4809
5076
|
rate?: number;
|
|
4810
5077
|
country?: string | null;
|
|
4811
5078
|
region?: string | null;
|
|
5079
|
+
/** Matched exactly — wildcards, prefixes and ranges are NOT supported. */
|
|
4812
5080
|
postalCode?: string | null;
|
|
4813
5081
|
taxType?: string;
|
|
5082
|
+
/**
|
|
5083
|
+
* @deprecated Not implemented — the backend rejects this field with a 400.
|
|
5084
|
+
* Rates never compound. Omit it.
|
|
5085
|
+
*/
|
|
4814
5086
|
isCompound?: boolean;
|
|
4815
5087
|
isInclusive?: boolean;
|
|
4816
5088
|
priority?: number;
|
|
@@ -5015,6 +5287,25 @@ interface DateAvailabilityConstraints {
|
|
|
5015
5287
|
minDate?: string;
|
|
5016
5288
|
/** "YYYY-MM-DD", inclusive. */
|
|
5017
5289
|
maxDate?: string;
|
|
5290
|
+
/**
|
|
5291
|
+
* Preparation time in minutes. The earliest bookable moment is
|
|
5292
|
+
* `now + leadTimeMinutes`, re-resolved on every call. This is the thing
|
|
5293
|
+
* `minDate` cannot express: an absolute date authored to mean "tomorrow"
|
|
5294
|
+
* is wrong by the following morning and goes on being wrong.
|
|
5295
|
+
*/
|
|
5296
|
+
leadTimeMinutes?: number;
|
|
5297
|
+
/**
|
|
5298
|
+
* Rolling ceiling in days, counted from today store-local. Stands to
|
|
5299
|
+
* `leadTimeMinutes` as `maxDate` stands to `minDate`, without the rot.
|
|
5300
|
+
* Both may be set at once; whichever ceiling falls earlier wins.
|
|
5301
|
+
*/
|
|
5302
|
+
maxDaysAhead?: number;
|
|
5303
|
+
/**
|
|
5304
|
+
* Daily order deadline, store-local "HH:mm". At or past it, the earliest
|
|
5305
|
+
* bookable date moves on by a further day. This is the rule that keeps new
|
|
5306
|
+
* orders out of a day whose picking run has already been planned.
|
|
5307
|
+
*/
|
|
5308
|
+
cutoffTime?: string;
|
|
5018
5309
|
/** Subset of 0-6; any weekday(s) fully blocked regardless of date. */
|
|
5019
5310
|
blockedWeekdays?: number[];
|
|
5020
5311
|
/** Specific blocked calendar dates, e.g. holidays: ["2026-12-25"]. */
|
|
@@ -6125,6 +6416,72 @@ interface ContactFormSummary {
|
|
|
6125
6416
|
name: string;
|
|
6126
6417
|
isDefault: boolean;
|
|
6127
6418
|
}
|
|
6419
|
+
interface SubscribeMarketingInput {
|
|
6420
|
+
/** Address to subscribe. Lowercased and trimmed server-side. */
|
|
6421
|
+
email: string;
|
|
6422
|
+
/** Given name, when the form collects one — greets them in the confirmation email. */
|
|
6423
|
+
firstName?: string;
|
|
6424
|
+
/** Family name, when the form collects one. */
|
|
6425
|
+
lastName?: string;
|
|
6426
|
+
/**
|
|
6427
|
+
* Storefront locale at submission time, e.g. `"he"`. Picks the language of
|
|
6428
|
+
* the confirmation email. Falls back to the store language when omitted —
|
|
6429
|
+
* pass it on a multi-language storefront or Hebrew shoppers get English.
|
|
6430
|
+
*/
|
|
6431
|
+
locale?: string;
|
|
6432
|
+
/** Where the signup came from — `"popup"`, `"footer"`, `"exit-intent"`. Free-form. */
|
|
6433
|
+
source?: string;
|
|
6434
|
+
/** Arbitrary provenance: referrer, UTM params, the page the popup fired on. */
|
|
6435
|
+
sourceMetadata?: Record<string, unknown>;
|
|
6436
|
+
/**
|
|
6437
|
+
* Anti-bot honeypot. Render a hidden input and pass whatever it holds; a
|
|
6438
|
+
* non-empty value rejects the request. Bots fill every text input.
|
|
6439
|
+
*/
|
|
6440
|
+
honeypot?: string;
|
|
6441
|
+
}
|
|
6442
|
+
/**
|
|
6443
|
+
* Deliberately uniform — identical for a brand-new address, one that already
|
|
6444
|
+
* confirmed, and one suppressed for a hard bounce. The endpoint cannot be used
|
|
6445
|
+
* to test whether somebody is a customer of the store, so there is nothing here
|
|
6446
|
+
* to branch on: show one "check your email" message for every success.
|
|
6447
|
+
*/
|
|
6448
|
+
interface SubscribeMarketingResponse {
|
|
6449
|
+
ok: true;
|
|
6450
|
+
}
|
|
6451
|
+
interface CreateStockAlertInput {
|
|
6452
|
+
/** Address to notify. Lowercased and trimmed server-side. */
|
|
6453
|
+
email: string;
|
|
6454
|
+
/** Product the shopper is waiting for. */
|
|
6455
|
+
productId: string;
|
|
6456
|
+
/**
|
|
6457
|
+
* Specific variant, when the product has them. An alert on the blue medium
|
|
6458
|
+
* fires only when the blue medium is back, never when another size returns —
|
|
6459
|
+
* so pass this on any variable product, or shoppers get alerts for stock they
|
|
6460
|
+
* cannot use.
|
|
6461
|
+
*/
|
|
6462
|
+
variantId?: string;
|
|
6463
|
+
/**
|
|
6464
|
+
* Storefront locale at submission time, e.g. `"he"`. Sets the language of the
|
|
6465
|
+
* alert email. Falls back to the store language when omitted, so pass it on a
|
|
6466
|
+
* multi-language storefront or Hebrew shoppers get English.
|
|
6467
|
+
*/
|
|
6468
|
+
locale?: string;
|
|
6469
|
+
/**
|
|
6470
|
+
* Anti-bot honeypot. Render a hidden input and pass whatever it holds; a
|
|
6471
|
+
* non-empty value rejects the request. Bots fill every text input.
|
|
6472
|
+
*/
|
|
6473
|
+
honeypot?: string;
|
|
6474
|
+
}
|
|
6475
|
+
/**
|
|
6476
|
+
* Deliberately uniform — identical for a new request, a duplicate, an unknown
|
|
6477
|
+
* product, an item that is already in stock, and an address that has bounced
|
|
6478
|
+
* before. The endpoint cannot be used to read a store's stock levels or
|
|
6479
|
+
* customer list, so there is nothing here to branch on: show one "we will email
|
|
6480
|
+
* you" message for every success.
|
|
6481
|
+
*/
|
|
6482
|
+
interface StockAlertResponse {
|
|
6483
|
+
ok: true;
|
|
6484
|
+
}
|
|
6128
6485
|
type ContentType = 'FAQ' | 'FOOTER' | 'HEADER' | 'ANNOUNCEMENT' | 'RICH_TEXT' | 'PAGE';
|
|
6129
6486
|
type ContentStatus = 'DRAFT' | 'PUBLISHED';
|
|
6130
6487
|
interface FaqItem {
|
|
@@ -6637,11 +6994,13 @@ declare function getDirectionForLocale(locale: string | undefined | null): 'ltr'
|
|
|
6637
6994
|
*
|
|
6638
6995
|
* Three modes of operation:
|
|
6639
6996
|
*
|
|
6640
|
-
* **
|
|
6997
|
+
* **Sales-Channel Mode (Simplest)** - Use salesChannelId for vibe-coded sites:
|
|
6641
6998
|
* ```typescript
|
|
6642
|
-
* const client = new BrainerceClient({
|
|
6999
|
+
* const client = new BrainerceClient({ salesChannelId: 'vc_abc123...' });
|
|
6643
7000
|
* const products = await client.getProducts();
|
|
6644
7001
|
* ```
|
|
7002
|
+
* (`connectionId` is a deprecated alias of `salesChannelId`. It still works but
|
|
7003
|
+
* logs a deprecation warning on every construction and is removed in SDK 2.0.)
|
|
6645
7004
|
*
|
|
6646
7005
|
* **Storefront Mode (Frontend)** - Use storeId for public access:
|
|
6647
7006
|
* ```typescript
|
|
@@ -8104,6 +8463,11 @@ declare class BrainerceClient {
|
|
|
8104
8463
|
* Register a new customer with password (creates account)
|
|
8105
8464
|
* Works in vibe-coded, storefront, and admin mode
|
|
8106
8465
|
*
|
|
8466
|
+
* `birthMonth`/`birthDay` are optional and must be sent together. When
|
|
8467
|
+
* `getStoreInfo().requireBirthday` is true the merchant made the birthday
|
|
8468
|
+
* mandatory on that sales channel, and a call without both fields is
|
|
8469
|
+
* rejected with HTTP 400.
|
|
8470
|
+
*
|
|
8107
8471
|
* @example
|
|
8108
8472
|
* ```typescript
|
|
8109
8473
|
* const auth = await client.registerCustomer({
|
|
@@ -8111,6 +8475,8 @@ declare class BrainerceClient {
|
|
|
8111
8475
|
* password: 'securepassword123',
|
|
8112
8476
|
* firstName: 'Jane',
|
|
8113
8477
|
* lastName: 'Doe',
|
|
8478
|
+
* birthMonth: 4, // optional, unless the channel requires a birthday
|
|
8479
|
+
* birthDay: 17,
|
|
8114
8480
|
* });
|
|
8115
8481
|
* ```
|
|
8116
8482
|
*/
|
|
@@ -8484,6 +8850,67 @@ declare class BrainerceClient {
|
|
|
8484
8850
|
*/
|
|
8485
8851
|
get: (formKey?: string, locale?: string) => Promise<ContactFormPublic>;
|
|
8486
8852
|
};
|
|
8853
|
+
/**
|
|
8854
|
+
* Email marketing signup for a storefront — a newsletter popup, a footer
|
|
8855
|
+
* capture bar, an exit-intent modal.
|
|
8856
|
+
*
|
|
8857
|
+
* **Confirmed opt-in, always.** `subscribe()` creates the contact and mails
|
|
8858
|
+
* them a confirmation link. The address is NOT subscribed and CANNOT receive
|
|
8859
|
+
* a campaign until the recipient clicks that link. This is not a setting:
|
|
8860
|
+
* consent has to come from the mailbox, or anyone could subscribe anyone.
|
|
8861
|
+
*
|
|
8862
|
+
* So do not render "You're subscribed!" on success — render "Check your
|
|
8863
|
+
* email to confirm." The one is a lie until the click lands.
|
|
8864
|
+
*
|
|
8865
|
+
* The response is identical for a brand-new address, one that is already
|
|
8866
|
+
* subscribed, and one suppressed after a bounce, so the form can't be used to
|
|
8867
|
+
* probe who shops here. Show the same message for every success.
|
|
8868
|
+
*
|
|
8869
|
+
* Storefront (public) and vibe-coded modes only. Rate-limited server-side to
|
|
8870
|
+
* 3 requests / 60s per IP, plus one confirmation email per address per 24h.
|
|
8871
|
+
*
|
|
8872
|
+
* **Where the discount goes.** A "10% off your first order" popup needs a
|
|
8873
|
+
* coupon from the dashboard — create one with the `customer_first_order`
|
|
8874
|
+
* condition and show the code after a successful call. Subscribing does not
|
|
8875
|
+
* mint a code on its own.
|
|
8876
|
+
*
|
|
8877
|
+
* @example
|
|
8878
|
+
* ```typescript
|
|
8879
|
+
* // Newsletter popup — hidden honeypot input, Hebrew storefront
|
|
8880
|
+
* await brainerce.marketing.subscribe({
|
|
8881
|
+
* email: 'jane@example.com',
|
|
8882
|
+
* locale: 'he',
|
|
8883
|
+
* source: 'popup',
|
|
8884
|
+
* honeypot: hiddenFieldValue,
|
|
8885
|
+
* });
|
|
8886
|
+
* // → show "בדקו את המייל שלכם כדי לאשר" — NOT "נרשמת בהצלחה"
|
|
8887
|
+
* ```
|
|
8888
|
+
*/
|
|
8889
|
+
marketing: {
|
|
8890
|
+
subscribe: (input: SubscribeMarketingInput) => Promise<SubscribeMarketingResponse>;
|
|
8891
|
+
};
|
|
8892
|
+
/**
|
|
8893
|
+
* "Email me when this is back."
|
|
8894
|
+
*
|
|
8895
|
+
* ⛔ Not a newsletter signup, and must not be worded as one. It grants no
|
|
8896
|
+
* marketing consent, creates no customer account, and the person is never
|
|
8897
|
+
* mailed anything else as a result — exactly one message, about this item,
|
|
8898
|
+
* with a link that stops it. Someone who unsubscribed from marketing can
|
|
8899
|
+
* still use this, so do not gate it on consent.
|
|
8900
|
+
*
|
|
8901
|
+
* Show the affordance only on an item that is out of stock AND cannot be
|
|
8902
|
+
* backordered. Every other case is silently ignored server-side — the
|
|
8903
|
+
* response is uniform on purpose, so it cannot be used to read stock levels
|
|
8904
|
+
* or test who is a customer — which means a button on an in-stock item looks
|
|
8905
|
+
* like it worked and does nothing.
|
|
8906
|
+
*
|
|
8907
|
+
* Pass `variantId` on any product with variants. Without it the alert waits
|
|
8908
|
+
* on the product as a whole, and a shopper who wanted the medium hears when
|
|
8909
|
+
* the small comes back.
|
|
8910
|
+
*/
|
|
8911
|
+
stockAlerts: {
|
|
8912
|
+
subscribe: (input: CreateStockAlertInput) => Promise<StockAlertResponse>;
|
|
8913
|
+
};
|
|
8487
8914
|
/**
|
|
8488
8915
|
* Typed merchant content store: FAQ, Footer, Header, Announcement,
|
|
8489
8916
|
* Rich Text, and Page.
|
|
@@ -8852,7 +9279,9 @@ declare class BrainerceClient {
|
|
|
8852
9279
|
* try {
|
|
8853
9280
|
* await client.createCheckout(cartId);
|
|
8854
9281
|
* } catch (err) {
|
|
8855
|
-
*
|
|
9282
|
+
* // BrainerceError.details is the whole response body — the code lives
|
|
9283
|
+
* // there, NOT on the error object itself.
|
|
9284
|
+
* if ((err as BrainerceError).details?.code === 'PRICE_DRIFT') {
|
|
8856
9285
|
* // ask user to confirm new prices, then:
|
|
8857
9286
|
* await client.refreshCartSnapshots(cartId);
|
|
8858
9287
|
* await client.createCheckout(cartId);
|
|
@@ -8956,15 +9385,26 @@ declare class BrainerceClient {
|
|
|
8956
9385
|
* List visible reviews for a product (storefront / sales-channel modes).
|
|
8957
9386
|
* Reviews that the merchant has hidden are excluded.
|
|
8958
9387
|
*
|
|
9388
|
+
* Each review carries `images` — the photos its author attached, already
|
|
9389
|
+
* filtered to the ones shoppers are allowed to see. Always an array.
|
|
9390
|
+
*
|
|
9391
|
+
* Ordering defaults to `photos_first`: reviews carrying photos lead, newest-first
|
|
9392
|
+
* within each group. Pass `sort: 'newest'` for plain chronological order. On a
|
|
9393
|
+
* store with no review photos the two are identical.
|
|
9394
|
+
*
|
|
8959
9395
|
* @example
|
|
8960
9396
|
* ```typescript
|
|
8961
9397
|
* const { data, meta } = await client.listProductReviews('prod_123', { page: 1, limit: 20 });
|
|
8962
|
-
* data.forEach(r =>
|
|
9398
|
+
* data.forEach(r => {
|
|
9399
|
+
* console.log(r.rating, r.body, r.verifiedPurchase);
|
|
9400
|
+
* r.images.forEach(img => console.log(img.thumbnailUrl ?? img.url));
|
|
9401
|
+
* });
|
|
8963
9402
|
* ```
|
|
8964
9403
|
*/
|
|
8965
9404
|
listProductReviews(productId: string, params?: {
|
|
8966
9405
|
page?: number;
|
|
8967
9406
|
limit?: number;
|
|
9407
|
+
sort?: 'photos_first' | 'newest';
|
|
8968
9408
|
}): Promise<PaginatedResponse<ProductReview>>;
|
|
8969
9409
|
/**
|
|
8970
9410
|
* Get the current customer's review state for a product (storefront / sales-channel modes).
|
|
@@ -9023,6 +9463,17 @@ declare class BrainerceClient {
|
|
|
9023
9463
|
}): Promise<PaginatedResponse<ProductReviewAdmin>>;
|
|
9024
9464
|
/** Admin: hide a review (sets hiddenAt). */
|
|
9025
9465
|
hideProductReview(reviewId: string, storeId?: string): Promise<ProductReviewAdmin>;
|
|
9466
|
+
/**
|
|
9467
|
+
* Admin: hide ONE photo on a review, leaving the review and its other photos
|
|
9468
|
+
* visible. Requires an API key with `reviews:write`.
|
|
9469
|
+
*/
|
|
9470
|
+
hideProductReviewImage(imageId: string, storeId?: string): Promise<ProductReviewImageAdmin>;
|
|
9471
|
+
/**
|
|
9472
|
+
* Admin: show one review photo. This is also the approve action — a photo that
|
|
9473
|
+
* has never been approved carries no `approvedAt`, and showing it stamps one, so
|
|
9474
|
+
* stores using review-photo approval need no separate verb.
|
|
9475
|
+
*/
|
|
9476
|
+
showProductReviewImage(imageId: string, storeId?: string): Promise<ProductReviewImageAdmin>;
|
|
9026
9477
|
/** Admin: unhide a previously hidden review. */
|
|
9027
9478
|
showProductReview(reviewId: string, storeId?: string): Promise<ProductReviewAdmin>;
|
|
9028
9479
|
/**
|
|
@@ -9633,12 +10084,18 @@ declare class BrainerceClient {
|
|
|
9633
10084
|
* Get applicable custom field definitions for a checkout.
|
|
9634
10085
|
* Returns fields filtered by visibility conditions (delivery type, products in cart).
|
|
9635
10086
|
* Use these to render dynamic input fields in the checkout flow.
|
|
10087
|
+
*
|
|
10088
|
+
* **Vibe-coded or storefront mode only.** There is no checkout custom-field
|
|
10089
|
+
* route on the API-key `/v1` surface; in admin mode this throws.
|
|
9636
10090
|
*/
|
|
9637
10091
|
getCheckoutCustomFields(checkoutId: string): Promise<CheckoutCustomFieldDefinition[]>;
|
|
9638
10092
|
/**
|
|
9639
10093
|
* Set checkout custom field values and recalculate surcharges.
|
|
9640
10094
|
* The checkout total is automatically updated to include surcharges.
|
|
9641
10095
|
*
|
|
10096
|
+
* **Vibe-coded or storefront mode only.** There is no checkout custom-field
|
|
10097
|
+
* route on the API-key `/v1` surface; in admin mode this throws.
|
|
10098
|
+
*
|
|
9642
10099
|
* @example
|
|
9643
10100
|
* ```typescript
|
|
9644
10101
|
* const checkout = await client.setCheckoutCustomFields(checkoutId, {
|
|
@@ -10238,19 +10695,28 @@ declare class BrainerceClient {
|
|
|
10238
10695
|
*/
|
|
10239
10696
|
getCheckoutPrefillData(): Promise<CheckoutPrefillData>;
|
|
10240
10697
|
/**
|
|
10241
|
-
* Update the current customer's profile (requires customerToken)
|
|
10242
|
-
* Only available in storefront mode
|
|
10698
|
+
* Update the current customer's profile (requires customerToken).
|
|
10699
|
+
* Only available in storefront and vibe-coded mode.
|
|
10700
|
+
*
|
|
10701
|
+
* `birthMonth`/`birthDay` (1-12 / 1-31) power the loyalty birthday gift.
|
|
10702
|
+
* Month and day only, never a year, for privacy. Send both or neither, and
|
|
10703
|
+
* the day has to exist in the month: anything else is rejected with HTTP 400.
|
|
10704
|
+
* Send `null` for both to REMOVE a stored birthday. Leaving the keys out is a
|
|
10705
|
+
* different request and keeps the stored value, so a profile form whose
|
|
10706
|
+
* fields the shopper cleared has to send nulls, not omit them.
|
|
10243
10707
|
*
|
|
10244
|
-
*
|
|
10245
|
-
*
|
|
10708
|
+
* The saved values now come back on the returned `CustomerProfile`, on
|
|
10709
|
+
* `getMyProfile()` and on every customer read type, so a profile form can
|
|
10710
|
+
* re-render the birthday it just saved. Before this, no API returned the two
|
|
10711
|
+
* fields at all and the form always came back blank.
|
|
10246
10712
|
*/
|
|
10247
10713
|
updateMyProfile(data: {
|
|
10248
10714
|
firstName?: string;
|
|
10249
10715
|
lastName?: string;
|
|
10250
10716
|
phone?: string;
|
|
10251
10717
|
acceptsMarketing?: boolean;
|
|
10252
|
-
birthMonth?: number;
|
|
10253
|
-
birthDay?: number;
|
|
10718
|
+
birthMonth?: number | null;
|
|
10719
|
+
birthDay?: number | null;
|
|
10254
10720
|
}): Promise<CustomerProfile>;
|
|
10255
10721
|
/**
|
|
10256
10722
|
* Get the logged-in customer's loyalty status: enrollment, points balance,
|
|
@@ -11414,31 +11880,82 @@ declare class BrainerceClient {
|
|
|
11414
11880
|
key: string;
|
|
11415
11881
|
}>;
|
|
11416
11882
|
/**
|
|
11417
|
-
*
|
|
11883
|
+
* Upload one photo to attach to a product review.
|
|
11884
|
+
*
|
|
11885
|
+
* Available in storefront and vibe-coded modes, and — unlike
|
|
11886
|
+
* `uploadCustomizationFile` — it REQUIRES a logged-in customer who has actually
|
|
11887
|
+
* bought the product. Call `setCustomerToken(...)` first. That is the same bar as
|
|
11888
|
+
* writing the review itself, checked here so an ineligible shopper is told before
|
|
11889
|
+
* they wait for the upload rather than after.
|
|
11890
|
+
*
|
|
11891
|
+
* Returns a storage `key`. Collect the keys and pass them as `imageKeys` when you
|
|
11892
|
+
* submit or update the review — the `url` is for a local preview only, and sending
|
|
11893
|
+
* it back instead of the key will be rejected.
|
|
11894
|
+
*
|
|
11895
|
+
* Server rules:
|
|
11896
|
+
* - `image/jpeg|png|webp|gif` only, cross-checked against the file's real bytes.
|
|
11897
|
+
* - Max 5 MB and 40 megapixels per file.
|
|
11898
|
+
* - Throttled to 10 uploads / minute → HTTP 429.
|
|
11899
|
+
* - 403 when the store has review photos turned off, or the customer has not
|
|
11900
|
+
* bought the product; 400 once the review is already at its photo cap.
|
|
11901
|
+
* - EXIF is stripped (so GPS coordinates never reach the storefront) while the
|
|
11902
|
+
* orientation tag is applied first, so phone photos stay upright.
|
|
11903
|
+
* - A photo uploaded but never attached to a submitted review is reclaimed after
|
|
11904
|
+
* 7 days.
|
|
11905
|
+
*
|
|
11906
|
+
* Read `photos` from `getMyProductReview()` for the store's live limits rather
|
|
11907
|
+
* than hard-coding them.
|
|
11908
|
+
*
|
|
11909
|
+
* @example
|
|
11910
|
+
* ```ts
|
|
11911
|
+
* const { photos } = await client.getMyProductReview(productId);
|
|
11912
|
+
* if (photos.enabled) {
|
|
11913
|
+
* const uploads = await Promise.all(
|
|
11914
|
+
* [...fileInput.files].slice(0, photos.maxPerReview)
|
|
11915
|
+
* .map(f => client.uploadReviewPhoto(productId, f))
|
|
11916
|
+
* );
|
|
11917
|
+
* await client.submitProductReview(productId, {
|
|
11918
|
+
* rating: 5,
|
|
11919
|
+
* body: 'Arrived beautifully wrapped.',
|
|
11920
|
+
* imageKeys: uploads.map(u => u.key),
|
|
11921
|
+
* });
|
|
11922
|
+
* }
|
|
11923
|
+
* ```
|
|
11924
|
+
*/
|
|
11925
|
+
uploadReviewPhoto(productId: string, file: File | Blob): Promise<ReviewPhotoUpload>;
|
|
11926
|
+
/**
|
|
11927
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `getStoreTeam`
|
|
11928
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11418
11929
|
*/
|
|
11419
11930
|
getTeamMembers(): Promise<TeamMembersResponse>;
|
|
11420
11931
|
/**
|
|
11421
|
-
* @deprecated
|
|
11932
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `getStoreTeam`
|
|
11933
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11422
11934
|
*/
|
|
11423
11935
|
getTeamInvitations(): Promise<TeamInvitationsResponse>;
|
|
11424
11936
|
/**
|
|
11425
|
-
* @deprecated
|
|
11937
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `inviteStoreMember`
|
|
11938
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11426
11939
|
*/
|
|
11427
11940
|
inviteTeamMember(data: InviteMemberDto): Promise<TeamInvitation>;
|
|
11428
11941
|
/**
|
|
11429
|
-
* @deprecated
|
|
11942
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `resendStoreInvitation`
|
|
11943
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11430
11944
|
*/
|
|
11431
11945
|
resendTeamInvitation(invitationId: string): Promise<TeamInvitation>;
|
|
11432
11946
|
/**
|
|
11433
|
-
* @deprecated
|
|
11947
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `revokeStoreInvitation`
|
|
11948
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11434
11949
|
*/
|
|
11435
11950
|
revokeTeamInvitation(invitationId: string): Promise<void>;
|
|
11436
11951
|
/**
|
|
11437
|
-
* @deprecated
|
|
11952
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `updateStoreMember`
|
|
11953
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11438
11954
|
*/
|
|
11439
11955
|
updateTeamMemberRole(memberId: string, data: UpdateMemberRoleDto): Promise<TeamMember>;
|
|
11440
11956
|
/**
|
|
11441
|
-
* @deprecated
|
|
11957
|
+
* @deprecated Retiring, but there is no API-key replacement yet: `removeStoreMember`
|
|
11958
|
+
* is dashboard-only (403 for api_key). Keep using this until one ships.
|
|
11442
11959
|
*/
|
|
11443
11960
|
removeTeamMember(memberId: string): Promise<void>;
|
|
11444
11961
|
/**
|
|
@@ -11715,7 +12232,7 @@ declare class BrainerceError extends Error {
|
|
|
11715
12232
|
constructor(message: string, statusCode: number, details?: unknown);
|
|
11716
12233
|
}
|
|
11717
12234
|
|
|
11718
|
-
declare const SDK_VERSION = "1.
|
|
12235
|
+
declare const SDK_VERSION = "1.60.0";
|
|
11719
12236
|
|
|
11720
12237
|
/**
|
|
11721
12238
|
* Verify a webhook signature from Brainerce
|
|
@@ -11861,7 +12378,20 @@ declare function formatMoney(amount: number, currency: string, locale?: string):
|
|
|
11861
12378
|
* generally need this (only admins author the config), but it's exposed for
|
|
11862
12379
|
* any storefront building its own admin-like UI on top of the SDK.
|
|
11863
12380
|
*/
|
|
11864
|
-
|
|
12381
|
+
/**
|
|
12382
|
+
* Which definition family a config belongs to. It matters because the relative
|
|
12383
|
+
* bounds are answers to "how long before the requested date must the ORDER
|
|
12384
|
+
* arrive", and only the checkout surface has an order arriving.
|
|
12385
|
+
*
|
|
12386
|
+
* A product metafield and an order custom field are both written by an admin,
|
|
12387
|
+
* often long after the fact: a merchant correcting yesterday's delivery date
|
|
12388
|
+
* would be refused against a lead time measured from today. So those two
|
|
12389
|
+
* surfaces reject the relative keys outright, the same way a DATE field
|
|
12390
|
+
* already rejects `businessHours`. `minDate`/`maxDate`/`blockedDates` stay
|
|
12391
|
+
* available everywhere.
|
|
12392
|
+
*/
|
|
12393
|
+
type DateAvailabilitySurface = 'checkout' | 'product' | 'order';
|
|
12394
|
+
declare function validateDateAvailabilityConfig(config: DateAvailabilityConstraints | null | undefined, fieldType: 'DATE' | 'DATETIME', surface?: DateAvailabilitySurface): string[];
|
|
11865
12395
|
interface StoreLocalParts {
|
|
11866
12396
|
/** "YYYY-MM-DD" in the given timezone. */
|
|
11867
12397
|
dateYYYYMMDD: string;
|
|
@@ -11878,6 +12408,56 @@ interface StoreLocalParts {
|
|
|
11878
12408
|
* Falls back to UTC parts on an invalid IANA timezone string — never throws.
|
|
11879
12409
|
*/
|
|
11880
12410
|
declare function resolveStoreLocalParts(instant: Date, timezone: string): StoreLocalParts;
|
|
12411
|
+
/**
|
|
12412
|
+
* The "when is now" half of a relative constraint. `leadTimeMinutes`,
|
|
12413
|
+
* `cutoffTime` and `maxDaysAhead` cannot be resolved from the config alone,
|
|
12414
|
+
* so every function that honours them accepts one of these.
|
|
12415
|
+
*
|
|
12416
|
+
* Leaving it out is allowed and means "skip the relative bounds"; the
|
|
12417
|
+
* absolute ones (min/max date, blocked days, business hours) still apply.
|
|
12418
|
+
* That degradation is deliberate and safe in exactly one direction: a picker
|
|
12419
|
+
* built without a clock offers MORE dates than the server will accept, never
|
|
12420
|
+
* fewer. The server always passes one, so this is never the enforcement path.
|
|
12421
|
+
*/
|
|
12422
|
+
interface AvailabilityClock {
|
|
12423
|
+
/** IANA timezone of the store: `getStoreInfo().timezone`, never the buyer's. */
|
|
12424
|
+
timezone: string;
|
|
12425
|
+
/** Defaults to the current instant. Pass it explicitly to keep tests deterministic. */
|
|
12426
|
+
now?: Date;
|
|
12427
|
+
}
|
|
12428
|
+
/** The concrete dates the relative constraints resolve to at one moment in time. */
|
|
12429
|
+
interface RelativeDateBounds {
|
|
12430
|
+
/** Earliest bookable calendar date, "YYYY-MM-DD" store-local. Absent = no relative floor. */
|
|
12431
|
+
earliestDate?: string;
|
|
12432
|
+
/** Latest bookable calendar date, "YYYY-MM-DD" store-local. Absent = no relative ceiling. */
|
|
12433
|
+
latestDate?: string;
|
|
12434
|
+
/**
|
|
12435
|
+
* Earliest bookable instant, from `leadTimeMinutes` alone. Finer-grained
|
|
12436
|
+
* than `earliestDate`: on the boundary day this is what rules out the slots
|
|
12437
|
+
* that have already gone past, without ruling out the whole date.
|
|
12438
|
+
*/
|
|
12439
|
+
earliestInstant?: Date;
|
|
12440
|
+
}
|
|
12441
|
+
/**
|
|
12442
|
+
* Resolves the relative constraints into the concrete dates they mean right now.
|
|
12443
|
+
*
|
|
12444
|
+
* `minDate`/`maxDate` are absolute strings compared lexically, so a merchant
|
|
12445
|
+
* who means "earliest is tomorrow" watches that answer rot overnight and go on
|
|
12446
|
+
* rotting. These three keys are the relative counterparts, re-resolved on
|
|
12447
|
+
* every call:
|
|
12448
|
+
*
|
|
12449
|
+
* - `leadTimeMinutes` — preparation time. The floor is `now + leadTime`.
|
|
12450
|
+
* - `cutoffTime` — the daily order deadline, store-local "HH:mm". Once the
|
|
12451
|
+
* store-local clock reaches it, the floor moves on by a further day. This is
|
|
12452
|
+
* the rule that stops orders pouring in for a day whose picking run is
|
|
12453
|
+
* already planned, which is where a holiday-eve backlog actually starts.
|
|
12454
|
+
* - `maxDaysAhead` — a rolling ceiling measured from today rather than from a
|
|
12455
|
+
* fixed calendar date.
|
|
12456
|
+
*
|
|
12457
|
+
* Returns an empty object when no relative key is set or no clock was given,
|
|
12458
|
+
* which is what lets every caller take `clock` as an optional argument.
|
|
12459
|
+
*/
|
|
12460
|
+
declare function resolveRelativeBounds(config: DateAvailabilityConstraints | null | undefined, clock: AvailabilityClock | null | undefined): RelativeDateBounds;
|
|
11881
12461
|
interface ParsedDateFieldValue {
|
|
11882
12462
|
/**
|
|
11883
12463
|
* The absolute instant the value denotes. For a DATE field this is UTC
|
|
@@ -11926,7 +12506,7 @@ type DateFieldParseResult = {
|
|
|
11926
12506
|
*/
|
|
11927
12507
|
declare function parseDateFieldValue(raw: unknown, fieldType: 'DATE' | 'DATETIME', timezone: string): DateFieldParseResult;
|
|
11928
12508
|
/** Day-level gate: minDate/maxDate/blockedWeekdays/blockedDates only (no time-of-day). */
|
|
11929
|
-
declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailabilityConstraints | null | undefined): boolean;
|
|
12509
|
+
declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailabilityConstraints | null | undefined, clock?: AvailabilityClock | null): boolean;
|
|
11930
12510
|
/**
|
|
11931
12511
|
* Discrete slot starts ("HH:mm", store-local) for one calendar date. Empty
|
|
11932
12512
|
* array if: the date fails `isCalendarDateAllowed`, no `businessHours` window
|
|
@@ -11943,7 +12523,7 @@ declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailab
|
|
|
11943
12523
|
* const slots = computeAvailableSlots(deliveryField?.dateAvailability, local.dateYYYYMMDD);
|
|
11944
12524
|
* ```
|
|
11945
12525
|
*/
|
|
11946
|
-
declare function computeAvailableSlots(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string): string[];
|
|
12526
|
+
declare function computeAvailableSlots(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string, clock?: AvailabilityClock | null): string[];
|
|
11947
12527
|
/**
|
|
11948
12528
|
* The open/close windows that apply on one calendar date — `[]` when the date
|
|
11949
12529
|
* is blocked outright or the weekday has no window (which, per
|
|
@@ -11956,14 +12536,14 @@ declare function computeAvailableSlots(config: DateAvailabilityConstraints | nul
|
|
|
11956
12536
|
* time input by these windows", which is exactly what `isDateValueAllowed`
|
|
11957
12537
|
* enforces on the way back in.
|
|
11958
12538
|
*/
|
|
11959
|
-
declare function getBusinessHoursForDate(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string): BusinessHoursWindow[];
|
|
12539
|
+
declare function getBusinessHoursForDate(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string, clock?: AvailabilityClock | null): BusinessHoursWindow[];
|
|
11960
12540
|
/**
|
|
11961
12541
|
* Full value validation for a candidate date/datetime a shopper is about to
|
|
11962
12542
|
* submit — use this to disable a "Continue" button client-side before the
|
|
11963
12543
|
* backend's own (authoritative) rejection would otherwise surface as an
|
|
11964
12544
|
* error after a round trip.
|
|
11965
12545
|
*/
|
|
11966
|
-
declare function isDateValueAllowed(instant: Date, config: DateAvailabilityConstraints | null | undefined, fieldType: 'DATE' | 'DATETIME', timezone: string): {
|
|
12546
|
+
declare function isDateValueAllowed(instant: Date, config: DateAvailabilityConstraints | null | undefined, fieldType: 'DATE' | 'DATETIME', timezone: string, now?: Date): {
|
|
11967
12547
|
allowed: boolean;
|
|
11968
12548
|
reason?: string;
|
|
11969
12549
|
};
|
|
@@ -12153,4 +12733,4 @@ interface CategorySitemapOptions {
|
|
|
12153
12733
|
*/
|
|
12154
12734
|
declare function getCategorySitemapEntries(client: BrainerceClient, opts: CategorySitemapOptions): Promise<SitemapEntry[]>;
|
|
12155
12735
|
|
|
12156
|
-
export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BlogPost, type BlogPostListParams, type BlogPostListResponse, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkCreateProductsDto, type BulkCreateProductsError, type BulkCreateProductsJob, type BulkCreateProductsStatus, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryDetail, type CategoryNode, type CategorySitemapOptions, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DateAvailabilityConstraints, type DateFieldParseResult, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FormatProductPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type MyProductReview, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type ParsedDateFieldValue, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductReview, type ProductReviewAdmin, type ProductSitemapOptions, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type StoreTracking, type SubmitProductReviewInput, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type TrackingEventItem, type TrackingEventName, type TrackingEventPayload, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductFaqJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getBusinessHoursForDate, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSitemapEntries, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseDateFieldValue, parseWebhookEvent, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };
|
|
12736
|
+
export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type AvailabilityClock, type BlogPost, type BlogPostListParams, type BlogPostListResponse, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkCreateProductsDto, type BulkCreateProductsError, type BulkCreateProductsJob, type BulkCreateProductsStatus, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryDetail, type CategoryNode, type CategorySitemapOptions, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DateAvailabilityConstraints, type DateAvailabilitySurface, type DateFieldParseResult, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FormatProductPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type ModifierValidationFailedError, type MyProductReview, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type ParsedDateFieldValue, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type PriceDriftError, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductReview, type ProductReviewAdmin, type ProductSitemapOptions, type ProductSuggestion, type ProductUnavailableError, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type RelativeDateBounds, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type StoreTracking, type SubmitProductReviewInput, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type TrackingEventItem, type TrackingEventName, type TrackingEventPayload, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductFaqJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getBusinessHoursForDate, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSitemapEntries, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseDateFieldValue, parseWebhookEvent, resolveRelativeBounds, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };
|