brainerce 1.15.0 → 1.16.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 +4447 -4334
- package/dist/index.d.mts +253 -10
- package/dist/index.d.ts +253 -10
- package/dist/index.js +224 -25
- package/dist/index.mjs +223 -25
- package/package.json +76 -76
package/dist/index.d.mts
CHANGED
|
@@ -137,6 +137,17 @@ interface StoreInfo {
|
|
|
137
137
|
requireEmailVerification?: boolean;
|
|
138
138
|
/** Upsell feature settings (storefront mode) */
|
|
139
139
|
upsell?: UpsellSettings;
|
|
140
|
+
/** Multi-language / i18n settings */
|
|
141
|
+
i18n?: I18nSettings;
|
|
142
|
+
}
|
|
143
|
+
/** Multi-language configuration exposed to the storefront */
|
|
144
|
+
interface I18nSettings {
|
|
145
|
+
/** Whether multi-language is enabled for this store */
|
|
146
|
+
enabled: boolean;
|
|
147
|
+
/** The store's default locale (content language) */
|
|
148
|
+
defaultLocale: string;
|
|
149
|
+
/** All supported locales */
|
|
150
|
+
supportedLocales: string[];
|
|
140
151
|
}
|
|
141
152
|
/** Upsell feature configuration exposed to the storefront */
|
|
142
153
|
interface UpsellSettings {
|
|
@@ -228,6 +239,8 @@ interface Product {
|
|
|
228
239
|
/** Array of attribute option IDs for global assignments (admin mode only) */
|
|
229
240
|
attributes?: string[];
|
|
230
241
|
metafields?: ProductMetafield[];
|
|
242
|
+
/** Customer-facing input fields assigned to this product (storefront/vibe-coded mode) */
|
|
243
|
+
customizationFields?: ProductCustomizationField[];
|
|
231
244
|
channels?: Record<string, Record<string, unknown>>;
|
|
232
245
|
/** Whether product needs sync to platforms. Always returned by backend. */
|
|
233
246
|
needsSync: boolean;
|
|
@@ -247,6 +260,7 @@ interface Product {
|
|
|
247
260
|
id: string;
|
|
248
261
|
name: string;
|
|
249
262
|
displayType?: string;
|
|
263
|
+
translations?: Record<string, Record<string, string>> | null;
|
|
250
264
|
} | null;
|
|
251
265
|
attributeOption: {
|
|
252
266
|
id: string;
|
|
@@ -255,6 +269,7 @@ interface Product {
|
|
|
255
269
|
swatchColor?: string | null;
|
|
256
270
|
swatchColor2?: string | null;
|
|
257
271
|
swatchImageUrl?: string | null;
|
|
272
|
+
translations?: Record<string, Record<string, string>> | null;
|
|
258
273
|
} | null;
|
|
259
274
|
}>;
|
|
260
275
|
/** Vibe-coded sites this product is published to (admin mode only) */
|
|
@@ -695,6 +710,11 @@ declare function getProductMetafieldValue(product: Pick<Product, 'metafields'>,
|
|
|
695
710
|
* Filter metafields by type.
|
|
696
711
|
*/
|
|
697
712
|
declare function getProductMetafieldsByType(product: Pick<Product, 'metafields'>, type: string): ProductMetafield[];
|
|
713
|
+
/**
|
|
714
|
+
* Get customer-facing customization fields assigned to a product.
|
|
715
|
+
* These fields should be rendered as inputs on the product page.
|
|
716
|
+
*/
|
|
717
|
+
declare function getProductCustomizationFields(product: Pick<Product, 'customizationFields'>): ProductCustomizationField[];
|
|
698
718
|
interface ProductQueryParams {
|
|
699
719
|
page?: number;
|
|
700
720
|
limit?: number;
|
|
@@ -713,6 +733,8 @@ interface ProductQueryParams {
|
|
|
713
733
|
/** Sort by field (default: menuOrder) */
|
|
714
734
|
sortBy?: 'name' | 'price' | 'createdAt';
|
|
715
735
|
sortOrder?: 'asc' | 'desc';
|
|
736
|
+
/** Locale for translated content (e.g., "he", "es"). Falls back to store default. */
|
|
737
|
+
locale?: string;
|
|
716
738
|
type?: 'SIMPLE' | 'VARIABLE';
|
|
717
739
|
isDownloadable?: boolean;
|
|
718
740
|
}
|
|
@@ -939,6 +961,12 @@ interface OrderItem {
|
|
|
939
961
|
totalPrice?: string;
|
|
940
962
|
/** Product image URL (flat, not nested under product object) */
|
|
941
963
|
image?: string;
|
|
964
|
+
/** Customer input field values captured at checkout (e.g., cake text, uploaded logo) */
|
|
965
|
+
customizations?: Record<string, {
|
|
966
|
+
label: string;
|
|
967
|
+
value: string;
|
|
968
|
+
type: string;
|
|
969
|
+
}>;
|
|
942
970
|
}
|
|
943
971
|
/** A downloadable file attached to a product */
|
|
944
972
|
interface DownloadFile {
|
|
@@ -1151,9 +1179,10 @@ interface Customer {
|
|
|
1151
1179
|
totalOrders: number;
|
|
1152
1180
|
lastOrderAt?: string;
|
|
1153
1181
|
metadata?: Record<string, unknown>;
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1182
|
+
platformConnections?: Array<{
|
|
1183
|
+
platformCode: string;
|
|
1184
|
+
externalId: string;
|
|
1185
|
+
}>;
|
|
1157
1186
|
addresses: CustomerAddress[];
|
|
1158
1187
|
createdAt: string;
|
|
1159
1188
|
updatedAt: string;
|
|
@@ -1843,6 +1872,10 @@ interface CheckoutLineItem {
|
|
|
1843
1872
|
sku?: string | null;
|
|
1844
1873
|
image?: ProductImage | string | null;
|
|
1845
1874
|
} | null;
|
|
1875
|
+
/** Item-level notes (e.g., gift message) */
|
|
1876
|
+
notes?: string | null;
|
|
1877
|
+
/** Custom metadata including customer input field values */
|
|
1878
|
+
metadata?: Record<string, unknown> | null;
|
|
1846
1879
|
}
|
|
1847
1880
|
/**
|
|
1848
1881
|
* Represents an available shipping rate/method for checkout.
|
|
@@ -2040,6 +2073,17 @@ interface Checkout {
|
|
|
2040
2073
|
taxBreakdown?: TaxBreakdown | null;
|
|
2041
2074
|
/** Total amount as string - use parseFloat() */
|
|
2042
2075
|
total: string;
|
|
2076
|
+
/** Surcharge amount from checkout custom fields as string - use parseFloat() */
|
|
2077
|
+
surchargeAmount: string;
|
|
2078
|
+
/** Applied surcharges breakdown from checkout custom fields */
|
|
2079
|
+
appliedSurcharges?: Array<{
|
|
2080
|
+
key: string;
|
|
2081
|
+
name: string;
|
|
2082
|
+
value: unknown;
|
|
2083
|
+
amount: string;
|
|
2084
|
+
}> | null;
|
|
2085
|
+
/** Customer-provided values for checkout custom fields */
|
|
2086
|
+
customFieldValues?: Record<string, unknown> | null;
|
|
2043
2087
|
/** Applied coupon code */
|
|
2044
2088
|
couponCode?: string | null;
|
|
2045
2089
|
/** Line items with nested product/variant data */
|
|
@@ -3147,7 +3191,32 @@ interface PublicMetafieldDefinition {
|
|
|
3147
3191
|
description?: string | null;
|
|
3148
3192
|
type: MetafieldType;
|
|
3149
3193
|
required: boolean;
|
|
3194
|
+
isCustomerInput?: boolean;
|
|
3195
|
+
enumValues?: string[];
|
|
3196
|
+
minLength?: number | null;
|
|
3197
|
+
maxLength?: number | null;
|
|
3198
|
+
minValue?: number | null;
|
|
3199
|
+
maxValue?: number | null;
|
|
3200
|
+
defaultValue?: string | null;
|
|
3201
|
+
position: number;
|
|
3202
|
+
}
|
|
3203
|
+
/**
|
|
3204
|
+
* Customer-facing input field definition assigned to a specific product.
|
|
3205
|
+
* Returned in product responses to tell the storefront which input fields to render.
|
|
3206
|
+
*/
|
|
3207
|
+
interface ProductCustomizationField {
|
|
3208
|
+
definitionId: string;
|
|
3209
|
+
name: string;
|
|
3210
|
+
key: string;
|
|
3211
|
+
description?: string | null;
|
|
3212
|
+
type: MetafieldType;
|
|
3213
|
+
required: boolean;
|
|
3214
|
+
minLength?: number | null;
|
|
3215
|
+
maxLength?: number | null;
|
|
3216
|
+
minValue?: number | null;
|
|
3217
|
+
maxValue?: number | null;
|
|
3150
3218
|
enumValues?: string[];
|
|
3219
|
+
defaultValue?: string | null;
|
|
3151
3220
|
position: number;
|
|
3152
3221
|
}
|
|
3153
3222
|
/**
|
|
@@ -3553,6 +3622,18 @@ interface CartNudge {
|
|
|
3553
3622
|
quantityNeeded?: number;
|
|
3554
3623
|
}
|
|
3555
3624
|
type ProductRelationType = 'CROSS_SELL' | 'UPSELL' | 'RELATED';
|
|
3625
|
+
interface RecommendationVariant {
|
|
3626
|
+
id: string;
|
|
3627
|
+
name?: string | null;
|
|
3628
|
+
price?: string | null;
|
|
3629
|
+
salePrice?: string | null;
|
|
3630
|
+
attributes?: Record<string, string> | null;
|
|
3631
|
+
image?: ProductImage | string | null;
|
|
3632
|
+
inventory?: {
|
|
3633
|
+
available: number;
|
|
3634
|
+
trackingMode: string;
|
|
3635
|
+
} | null;
|
|
3636
|
+
}
|
|
3556
3637
|
interface ProductRecommendation {
|
|
3557
3638
|
id: string;
|
|
3558
3639
|
name: string;
|
|
@@ -3563,6 +3644,7 @@ interface ProductRecommendation {
|
|
|
3563
3644
|
type: 'SIMPLE' | 'VARIABLE';
|
|
3564
3645
|
inventory?: InventoryInfo | null;
|
|
3565
3646
|
relationType: ProductRelationType;
|
|
3647
|
+
variants?: RecommendationVariant[];
|
|
3566
3648
|
}
|
|
3567
3649
|
interface ProductRecommendationsResponse {
|
|
3568
3650
|
crossSells: ProductRecommendation[];
|
|
@@ -3581,6 +3663,11 @@ interface CartUpgradeSuggestion {
|
|
|
3581
3663
|
interface CartUpgradesResponse {
|
|
3582
3664
|
upgrades: Record<string, CartUpgradeSuggestion>;
|
|
3583
3665
|
}
|
|
3666
|
+
interface LockedVariant {
|
|
3667
|
+
id: string;
|
|
3668
|
+
name?: string | null;
|
|
3669
|
+
attributes?: Record<string, string> | null;
|
|
3670
|
+
}
|
|
3584
3671
|
interface CartBundleOffer {
|
|
3585
3672
|
id: string;
|
|
3586
3673
|
name: string;
|
|
@@ -3588,6 +3675,8 @@ interface CartBundleOffer {
|
|
|
3588
3675
|
sourceProductId: string;
|
|
3589
3676
|
bundleProduct: ProductRecommendation;
|
|
3590
3677
|
bundleVariantId: string | null;
|
|
3678
|
+
requiresVariantSelection: boolean;
|
|
3679
|
+
lockedVariant?: LockedVariant | null;
|
|
3591
3680
|
discountType: 'PERCENTAGE' | 'FIXED_AMOUNT';
|
|
3592
3681
|
discountValue: string;
|
|
3593
3682
|
originalPrice: string;
|
|
@@ -3602,6 +3691,8 @@ interface OrderBump {
|
|
|
3602
3691
|
description: string | null;
|
|
3603
3692
|
bumpProduct: ProductRecommendation;
|
|
3604
3693
|
bumpVariantId: string | null;
|
|
3694
|
+
requiresVariantSelection: boolean;
|
|
3695
|
+
lockedVariant?: LockedVariant | null;
|
|
3605
3696
|
originalPrice: string;
|
|
3606
3697
|
discountedPrice: string | null;
|
|
3607
3698
|
discountType: string | null;
|
|
@@ -3610,6 +3701,61 @@ interface OrderBump {
|
|
|
3610
3701
|
interface CheckoutBumpsResponse {
|
|
3611
3702
|
bumps: OrderBump[];
|
|
3612
3703
|
}
|
|
3704
|
+
/**
|
|
3705
|
+
* Checkout-level custom field definition with optional pricing (surcharges).
|
|
3706
|
+
* Store owners define these; customers fill them in during checkout.
|
|
3707
|
+
*/
|
|
3708
|
+
interface CheckoutCustomFieldDefinition {
|
|
3709
|
+
id: string;
|
|
3710
|
+
key: string;
|
|
3711
|
+
name: string;
|
|
3712
|
+
description?: string | null;
|
|
3713
|
+
type: 'TEXT' | 'TEXTAREA' | 'NUMBER' | 'BOOLEAN' | 'SELECT' | 'DATE';
|
|
3714
|
+
required: boolean;
|
|
3715
|
+
position: number;
|
|
3716
|
+
visibility: CheckoutFieldVisibility;
|
|
3717
|
+
pricing: CheckoutFieldPricing;
|
|
3718
|
+
options?: Array<{
|
|
3719
|
+
value: string;
|
|
3720
|
+
label: string;
|
|
3721
|
+
}> | null;
|
|
3722
|
+
minLength?: number | null;
|
|
3723
|
+
maxLength?: number | null;
|
|
3724
|
+
minValue?: number | null;
|
|
3725
|
+
maxValue?: number | null;
|
|
3726
|
+
translations?: Record<string, Record<string, string>> | null;
|
|
3727
|
+
}
|
|
3728
|
+
interface CheckoutFieldVisibility {
|
|
3729
|
+
show: 'always' | 'shipping' | 'pickup' | 'products';
|
|
3730
|
+
productIds?: string[];
|
|
3731
|
+
categoryIds?: string[];
|
|
3732
|
+
}
|
|
3733
|
+
type CheckoutFieldPricing = {
|
|
3734
|
+
type: 'none';
|
|
3735
|
+
} | {
|
|
3736
|
+
type: 'fixed';
|
|
3737
|
+
amount: number;
|
|
3738
|
+
} | {
|
|
3739
|
+
type: 'boolean_checked';
|
|
3740
|
+
amount: number;
|
|
3741
|
+
} | {
|
|
3742
|
+
type: 'per_option';
|
|
3743
|
+
options: Array<{
|
|
3744
|
+
value: string;
|
|
3745
|
+
label: string;
|
|
3746
|
+
price: number;
|
|
3747
|
+
}>;
|
|
3748
|
+
} | {
|
|
3749
|
+
type: 'conditional';
|
|
3750
|
+
condition: {
|
|
3751
|
+
operator: string;
|
|
3752
|
+
threshold: number;
|
|
3753
|
+
amount: number;
|
|
3754
|
+
};
|
|
3755
|
+
};
|
|
3756
|
+
interface SetCheckoutCustomFieldsDto {
|
|
3757
|
+
fields: Record<string, unknown>;
|
|
3758
|
+
}
|
|
3613
3759
|
interface BrainerceApiError {
|
|
3614
3760
|
statusCode: number;
|
|
3615
3761
|
message: string;
|
|
@@ -3667,7 +3813,33 @@ declare class BrainerceClient {
|
|
|
3667
3813
|
private readonly origin?;
|
|
3668
3814
|
private readonly proxyMode;
|
|
3669
3815
|
private readonly onAuthError?;
|
|
3816
|
+
/** Active locale for content translation. When set, content endpoints return translated data. */
|
|
3817
|
+
private locale?;
|
|
3670
3818
|
constructor(options: BrainerceClientOptions);
|
|
3819
|
+
/**
|
|
3820
|
+
* Set the active locale for content translation.
|
|
3821
|
+
* When set, all content endpoints (products, categories, brands) will return
|
|
3822
|
+
* translated content for this locale, falling back to the store's default language.
|
|
3823
|
+
*
|
|
3824
|
+
* @param locale - Locale code (e.g., "he", "es", "fr") or undefined to clear
|
|
3825
|
+
*/
|
|
3826
|
+
setLocale(locale: string | undefined): void;
|
|
3827
|
+
/**
|
|
3828
|
+
* Get the currently active locale.
|
|
3829
|
+
*/
|
|
3830
|
+
getLocale(): string | undefined;
|
|
3831
|
+
/**
|
|
3832
|
+
* Get the supported locales for this store.
|
|
3833
|
+
* Fetches store info and returns the i18n config.
|
|
3834
|
+
* Returns `[storeLanguage]` if multi-language is not enabled.
|
|
3835
|
+
*
|
|
3836
|
+
* @example
|
|
3837
|
+
* ```typescript
|
|
3838
|
+
* const locales = await client.getSupportedLocales();
|
|
3839
|
+
* // ["en", "he", "es"]
|
|
3840
|
+
* ```
|
|
3841
|
+
*/
|
|
3842
|
+
getSupportedLocales(): Promise<string[]>;
|
|
3671
3843
|
/**
|
|
3672
3844
|
* Apply dev guards to returned objects (when enabled via enableDevGuards()).
|
|
3673
3845
|
* Handles both sync values and Promises.
|
|
@@ -3757,7 +3929,9 @@ declare class BrainerceClient {
|
|
|
3757
3929
|
* Get a single product by ID
|
|
3758
3930
|
* Works in vibe-coded, storefront (public), and admin mode
|
|
3759
3931
|
*/
|
|
3760
|
-
getProduct(productId: string
|
|
3932
|
+
getProduct(productId: string, options?: {
|
|
3933
|
+
locale?: string;
|
|
3934
|
+
}): Promise<Product>;
|
|
3761
3935
|
/**
|
|
3762
3936
|
* Get a single product by slug
|
|
3763
3937
|
* Works in vibe-coded, storefront (public), and admin mode
|
|
@@ -3768,7 +3942,9 @@ declare class BrainerceClient {
|
|
|
3768
3942
|
* const product = await client.getProductBySlug('awesome-product-name');
|
|
3769
3943
|
* ```
|
|
3770
3944
|
*/
|
|
3771
|
-
getProductBySlug(slug: string
|
|
3945
|
+
getProductBySlug(slug: string, options?: {
|
|
3946
|
+
locale?: string;
|
|
3947
|
+
}): Promise<Product>;
|
|
3772
3948
|
/**
|
|
3773
3949
|
* Get available categories for filtering products
|
|
3774
3950
|
* Works in vibe-coded mode
|
|
@@ -3779,7 +3955,9 @@ declare class BrainerceClient {
|
|
|
3779
3955
|
* // categories is a tree structure with children
|
|
3780
3956
|
* ```
|
|
3781
3957
|
*/
|
|
3782
|
-
getCategories(
|
|
3958
|
+
getCategories(options?: {
|
|
3959
|
+
locale?: string;
|
|
3960
|
+
}): Promise<{
|
|
3783
3961
|
categories: CategoryNode[];
|
|
3784
3962
|
}>;
|
|
3785
3963
|
/**
|
|
@@ -3792,7 +3970,9 @@ declare class BrainerceClient {
|
|
|
3792
3970
|
* // Use brand IDs in getProducts({ brands: ['brand_id'] })
|
|
3793
3971
|
* ```
|
|
3794
3972
|
*/
|
|
3795
|
-
getBrands(
|
|
3973
|
+
getBrands(options?: {
|
|
3974
|
+
locale?: string;
|
|
3975
|
+
}): Promise<{
|
|
3796
3976
|
brands: Array<{
|
|
3797
3977
|
id: string;
|
|
3798
3978
|
name: string;
|
|
@@ -3834,6 +4014,22 @@ declare class BrainerceClient {
|
|
|
3834
4014
|
* const suggestions = await client.getSearchSuggestions('dress', 3);
|
|
3835
4015
|
* ```
|
|
3836
4016
|
*/
|
|
4017
|
+
/**
|
|
4018
|
+
* Get locale alternates for a product (for SEO hreflang tags).
|
|
4019
|
+
* Returns the slug for each available locale.
|
|
4020
|
+
*
|
|
4021
|
+
* @example
|
|
4022
|
+
* ```typescript
|
|
4023
|
+
* const { alternates } = await client.getProductAlternates('product_id');
|
|
4024
|
+
* // alternates = [{ locale: "en", slug: "running-shoes" }, { locale: "he", slug: "נעלי-ריצה" }]
|
|
4025
|
+
* ```
|
|
4026
|
+
*/
|
|
4027
|
+
getProductAlternates(productId: string): Promise<{
|
|
4028
|
+
alternates: Array<{
|
|
4029
|
+
locale: string;
|
|
4030
|
+
slug: string;
|
|
4031
|
+
}>;
|
|
4032
|
+
}>;
|
|
3837
4033
|
getSearchSuggestions(query: string, limit?: number): Promise<SearchSuggestions>;
|
|
3838
4034
|
/**
|
|
3839
4035
|
* Create a new product
|
|
@@ -4917,9 +5113,10 @@ declare class BrainerceClient {
|
|
|
4917
5113
|
*
|
|
4918
5114
|
* @param cartId - Cart ID
|
|
4919
5115
|
* @param bumpConfigId - Order bump config ID
|
|
5116
|
+
* @param variantId - Optional variant ID (required when bump product has variants and no admin-locked variant)
|
|
4920
5117
|
* @returns Updated cart
|
|
4921
5118
|
*/
|
|
4922
|
-
addOrderBump(cartId: string, bumpConfigId: string): Promise<Cart>;
|
|
5119
|
+
addOrderBump(cartId: string, bumpConfigId: string, variantId?: string): Promise<Cart>;
|
|
4923
5120
|
/**
|
|
4924
5121
|
* Remove an order bump from the cart.
|
|
4925
5122
|
*
|
|
@@ -4933,15 +5130,19 @@ declare class BrainerceClient {
|
|
|
4933
5130
|
*
|
|
4934
5131
|
* @param cartId - Cart ID
|
|
4935
5132
|
* @param bundleOfferId - Bundle offer ID
|
|
5133
|
+
* @param variantId - Optional variant ID (required when bundle product has variants and no admin-locked variant)
|
|
4936
5134
|
* @returns Updated cart
|
|
4937
5135
|
*
|
|
4938
5136
|
* @example
|
|
4939
5137
|
* ```typescript
|
|
4940
5138
|
* const { bundles } = await client.getCartBundles('cart_123');
|
|
5139
|
+
* // Simple product or locked variant:
|
|
4941
5140
|
* const cart = await client.addBundleToCart('cart_123', bundles[0].id);
|
|
5141
|
+
* // Product with variants (customer selects):
|
|
5142
|
+
* const cart = await client.addBundleToCart('cart_123', bundles[0].id, selectedVariantId);
|
|
4942
5143
|
* ```
|
|
4943
5144
|
*/
|
|
4944
|
-
addBundleToCart(cartId: string, bundleOfferId: string): Promise<Cart>;
|
|
5145
|
+
addBundleToCart(cartId: string, bundleOfferId: string, variantId?: string): Promise<Cart>;
|
|
4945
5146
|
/**
|
|
4946
5147
|
* Remove a bundle offer product from the cart.
|
|
4947
5148
|
*
|
|
@@ -5329,6 +5530,28 @@ declare class BrainerceClient {
|
|
|
5329
5530
|
* ```
|
|
5330
5531
|
*/
|
|
5331
5532
|
completeCheckout(checkoutId: string): Promise<CompleteCheckoutResponse>;
|
|
5533
|
+
/**
|
|
5534
|
+
* Get applicable custom field definitions for a checkout.
|
|
5535
|
+
* Returns fields filtered by visibility conditions (delivery type, products in cart).
|
|
5536
|
+
* Use these to render dynamic input fields in the checkout flow.
|
|
5537
|
+
*/
|
|
5538
|
+
getCheckoutCustomFields(checkoutId: string): Promise<CheckoutCustomFieldDefinition[]>;
|
|
5539
|
+
/**
|
|
5540
|
+
* Set checkout custom field values and recalculate surcharges.
|
|
5541
|
+
* The checkout total is automatically updated to include surcharges.
|
|
5542
|
+
*
|
|
5543
|
+
* @example
|
|
5544
|
+
* ```typescript
|
|
5545
|
+
* const checkout = await client.setCheckoutCustomFields(checkoutId, {
|
|
5546
|
+
* gift_wrapping: 'premium', // SELECT field
|
|
5547
|
+
* floor_number: 5, // NUMBER field
|
|
5548
|
+
* installation: true, // BOOLEAN field
|
|
5549
|
+
* });
|
|
5550
|
+
* // checkout.surchargeAmount reflects the new surcharges
|
|
5551
|
+
* // checkout.total is recalculated
|
|
5552
|
+
* ```
|
|
5553
|
+
*/
|
|
5554
|
+
setCheckoutCustomFields(checkoutId: string, fields: Record<string, unknown>): Promise<Checkout>;
|
|
5332
5555
|
/**
|
|
5333
5556
|
* Delete a checkout session. Releases inventory reservations and removes
|
|
5334
5557
|
* payment records not yet linked to an order.
|
|
@@ -6425,6 +6648,26 @@ declare class BrainerceClient {
|
|
|
6425
6648
|
* Requires Admin mode (apiKey)
|
|
6426
6649
|
*/
|
|
6427
6650
|
deleteProductMetafield(productId: string, definitionId: string): Promise<void>;
|
|
6651
|
+
/**
|
|
6652
|
+
* Get customization fields assigned to a product.
|
|
6653
|
+
* Requires Admin mode (apiKey).
|
|
6654
|
+
*/
|
|
6655
|
+
getProductCustomizationFields(productId: string): Promise<ProductCustomizationField[]>;
|
|
6656
|
+
/**
|
|
6657
|
+
* Set customization fields for a product (replaces all existing assignments).
|
|
6658
|
+
* Only definitions marked as `isCustomerInput: true` can be assigned.
|
|
6659
|
+
* Requires Admin mode (apiKey).
|
|
6660
|
+
*/
|
|
6661
|
+
setProductCustomizationFields(productId: string, definitionIds: string[]): Promise<ProductCustomizationField[]>;
|
|
6662
|
+
/**
|
|
6663
|
+
* Upload a file for product customization (e.g., customer logo for printing).
|
|
6664
|
+
* Available in storefront and vibe-coded modes.
|
|
6665
|
+
* Returns the uploaded file URL and key.
|
|
6666
|
+
*/
|
|
6667
|
+
uploadCustomizationFile(file: File | Blob): Promise<{
|
|
6668
|
+
url: string;
|
|
6669
|
+
key: string;
|
|
6670
|
+
}>;
|
|
6428
6671
|
/**
|
|
6429
6672
|
* @deprecated Use `getStoreTeam(storeId)` instead.
|
|
6430
6673
|
*/
|
|
@@ -6744,4 +6987,4 @@ declare function enableDevGuards(options?: {
|
|
|
6744
6987
|
force?: boolean;
|
|
6745
6988
|
}): void;
|
|
6746
6989
|
|
|
6747
|
-
export { type AddToCartDto, type AppliedDiscount, type ApplyCouponDto, type Attribute, type AttributeOption, type AttributeSource, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartItem, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type Category, type CategoryNode, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, 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 CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, 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 DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailVerificationResponse, type ExtendReservationResponse, type FormatPriceOptions, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type LocalCart, type LocalCartItem, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldPlatformMapping, type MetafieldType, 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 PaginatedResponse, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PickupLocation, type PlatformCouponCapabilities, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, type ReconcileInventoryResponse, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomerDto, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingZone, type ShippingZoneQueryParams, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, 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 UpdateAddressDto, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, 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 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, createWebhookHandler, enableDevGuards, formatPrice, getCartItemImage, getCartItemName, getCartTotals, getDescriptionContent, formatPrice as getPriceDisplay, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isCouponApplicableToProduct, isHtmlDescription, isWebhookEventType, parseWebhookEvent, verifyWebhook };
|
|
6990
|
+
export { type AddToCartDto, type AppliedDiscount, type ApplyCouponDto, type Attribute, type AttributeOption, type AttributeSource, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartItem, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type Category, type CategoryNode, 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 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 CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, 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 DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailVerificationResponse, type ExtendReservationResponse, type FormatPriceOptions, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type LocalCart, type LocalCartItem, type LockedVariant, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldPlatformMapping, type MetafieldType, 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 PaginatedResponse, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PickupLocation, type PlatformCouponCapabilities, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, type RecommendationVariant, type ReconcileInventoryResponse, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingZone, type ShippingZoneQueryParams, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, 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 UpdateAddressDto, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, 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 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, createWebhookHandler, enableDevGuards, formatPrice, getCartItemImage, getCartItemName, getCartTotals, getDescriptionContent, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isCouponApplicableToProduct, isHtmlDescription, isWebhookEventType, parseWebhookEvent, verifyWebhook };
|