brainerce 1.11.3 → 1.12.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/dist/index.d.mts CHANGED
@@ -135,6 +135,23 @@ interface StoreInfo {
135
135
  * 3. Call verifyEmail(code) with the code they received via email
136
136
  */
137
137
  requireEmailVerification?: boolean;
138
+ /** Upsell feature settings (storefront mode) */
139
+ upsell?: UpsellSettings;
140
+ }
141
+ /** Upsell feature configuration exposed to the storefront */
142
+ interface UpsellSettings {
143
+ /** Minimum cart amount for free shipping (null = disabled) */
144
+ freeShippingThreshold: number | null;
145
+ /** Show free shipping progress bar in cart */
146
+ freeShippingBarEnabled: boolean;
147
+ /** Show "Frequently Bought Together" on product page */
148
+ frequentlyBoughtTogetherEnabled: boolean;
149
+ /** Show upgrade banner per cart item */
150
+ cartUpgradeBannerEnabled: boolean;
151
+ /** Show bundle offers in cart */
152
+ cartBundleEnabled: boolean;
153
+ /** Show order bump checkbox at checkout */
154
+ checkoutOrderBumpEnabled: boolean;
138
155
  }
139
156
  interface CustomerProfile {
140
157
  id: string;
@@ -220,7 +237,7 @@ interface Product {
220
237
  menuOrder?: number | null;
221
238
  /** Tax behavior: 'taxable' follows store setting, 'exempt' always skips tax */
222
239
  taxBehavior?: 'taxable' | 'exempt';
223
- /** Full attribute options for variant selection (admin mode only) */
240
+ /** Full attribute options for variant selection (admin, storefront, and vibe-coded modes) */
224
241
  productAttributeOptions?: Array<{
225
242
  id: string;
226
243
  attributeId: string;
@@ -3544,6 +3561,44 @@ interface ProductRecommendationsResponse {
3544
3561
  interface CartRecommendationsResponse {
3545
3562
  recommendations: ProductRecommendation[];
3546
3563
  }
3564
+ interface CartUpgradeSuggestion {
3565
+ sourceProductId: string;
3566
+ targetProduct: ProductRecommendation;
3567
+ priceDelta: string;
3568
+ deltaPercent: number;
3569
+ }
3570
+ interface CartUpgradesResponse {
3571
+ upgrades: Record<string, CartUpgradeSuggestion>;
3572
+ }
3573
+ interface CartBundleOffer {
3574
+ id: string;
3575
+ name: string;
3576
+ description: string | null;
3577
+ sourceProductId: string;
3578
+ bundleProduct: ProductRecommendation;
3579
+ bundleVariantId: string | null;
3580
+ discountType: 'PERCENTAGE' | 'FIXED_AMOUNT';
3581
+ discountValue: string;
3582
+ originalPrice: string;
3583
+ discountedPrice: string;
3584
+ }
3585
+ interface CartBundlesResponse {
3586
+ bundles: CartBundleOffer[];
3587
+ }
3588
+ interface OrderBump {
3589
+ id: string;
3590
+ title: string;
3591
+ description: string | null;
3592
+ bumpProduct: ProductRecommendation;
3593
+ bumpVariantId: string | null;
3594
+ originalPrice: string;
3595
+ discountedPrice: string | null;
3596
+ discountType: string | null;
3597
+ discountValue: string | null;
3598
+ }
3599
+ interface CheckoutBumpsResponse {
3600
+ bumps: OrderBump[];
3601
+ }
3547
3602
  interface BrainerceApiError {
3548
3603
  statusCode: number;
3549
3604
  message: string;
@@ -4807,6 +4862,61 @@ declare class BrainerceClient {
4807
4862
  * ```
4808
4863
  */
4809
4864
  getCartRecommendations(cartId: string, limit?: number): Promise<CartRecommendationsResponse>;
4865
+ /**
4866
+ * Get upgrade suggestions for cart items (upsell relations with small price delta).
4867
+ * Returns a map keyed by source product ID with the best upgrade option.
4868
+ *
4869
+ * @param cartId - Cart ID
4870
+ * @returns Map of upgrade suggestions keyed by source product ID
4871
+ *
4872
+ * @example
4873
+ * ```typescript
4874
+ * const { upgrades } = await client.getCartUpgrades('cart_123');
4875
+ * for (const [productId, suggestion] of Object.entries(upgrades)) {
4876
+ * console.log(`Upgrade from ${productId} to ${suggestion.targetProduct.name} for +$${suggestion.priceDelta}`);
4877
+ * }
4878
+ * ```
4879
+ */
4880
+ getCartUpgrades(cartId: string): Promise<CartUpgradesResponse>;
4881
+ /**
4882
+ * Get matching bundle offers for cart items.
4883
+ * Returns bundle products with discounted prices for items currently in the cart.
4884
+ *
4885
+ * @param cartId - Cart ID
4886
+ * @returns Array of bundle offers
4887
+ *
4888
+ * @example
4889
+ * ```typescript
4890
+ * const { bundles } = await client.getCartBundles('cart_123');
4891
+ * bundles.forEach(b => {
4892
+ * console.log(`Add ${b.bundleProduct.name} and save! Was ${b.originalPrice}, now ${b.discountedPrice}`);
4893
+ * });
4894
+ * ```
4895
+ */
4896
+ getCartBundles(cartId: string): Promise<CartBundlesResponse>;
4897
+ /**
4898
+ * Get matching order bumps for a checkout session.
4899
+ *
4900
+ * @param checkoutId - Checkout ID
4901
+ * @returns Array of order bumps
4902
+ */
4903
+ getCheckoutBumps(checkoutId: string): Promise<CheckoutBumpsResponse>;
4904
+ /**
4905
+ * Add an order bump to the cart.
4906
+ *
4907
+ * @param cartId - Cart ID
4908
+ * @param bumpConfigId - Order bump config ID
4909
+ * @returns Updated cart
4910
+ */
4911
+ addOrderBump(cartId: string, bumpConfigId: string): Promise<Cart>;
4912
+ /**
4913
+ * Remove an order bump from the cart.
4914
+ *
4915
+ * @param cartId - Cart ID
4916
+ * @param bumpConfigId - Order bump config ID
4917
+ * @returns Updated cart
4918
+ */
4919
+ removeOrderBump(cartId: string, bumpConfigId: string): Promise<Cart>;
4810
4920
  /**
4811
4921
  * Check if customer is currently authenticated
4812
4922
  * Used internally by smart cart methods to determine storage strategy
@@ -6601,4 +6711,4 @@ declare function enableDevGuards(options?: {
6601
6711
  force?: boolean;
6602
6712
  }): void;
6603
6713
 
6604
- 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 CartItem, type CartNudge, type CartRecommendationsResponse, type CartStatus, type Category, type CategoryNode, type CategorySuggestion, type Checkout, type CheckoutAddress, 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 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 };
6714
+ 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 };
package/dist/index.d.ts CHANGED
@@ -135,6 +135,23 @@ interface StoreInfo {
135
135
  * 3. Call verifyEmail(code) with the code they received via email
136
136
  */
137
137
  requireEmailVerification?: boolean;
138
+ /** Upsell feature settings (storefront mode) */
139
+ upsell?: UpsellSettings;
140
+ }
141
+ /** Upsell feature configuration exposed to the storefront */
142
+ interface UpsellSettings {
143
+ /** Minimum cart amount for free shipping (null = disabled) */
144
+ freeShippingThreshold: number | null;
145
+ /** Show free shipping progress bar in cart */
146
+ freeShippingBarEnabled: boolean;
147
+ /** Show "Frequently Bought Together" on product page */
148
+ frequentlyBoughtTogetherEnabled: boolean;
149
+ /** Show upgrade banner per cart item */
150
+ cartUpgradeBannerEnabled: boolean;
151
+ /** Show bundle offers in cart */
152
+ cartBundleEnabled: boolean;
153
+ /** Show order bump checkbox at checkout */
154
+ checkoutOrderBumpEnabled: boolean;
138
155
  }
139
156
  interface CustomerProfile {
140
157
  id: string;
@@ -220,7 +237,7 @@ interface Product {
220
237
  menuOrder?: number | null;
221
238
  /** Tax behavior: 'taxable' follows store setting, 'exempt' always skips tax */
222
239
  taxBehavior?: 'taxable' | 'exempt';
223
- /** Full attribute options for variant selection (admin mode only) */
240
+ /** Full attribute options for variant selection (admin, storefront, and vibe-coded modes) */
224
241
  productAttributeOptions?: Array<{
225
242
  id: string;
226
243
  attributeId: string;
@@ -3544,6 +3561,44 @@ interface ProductRecommendationsResponse {
3544
3561
  interface CartRecommendationsResponse {
3545
3562
  recommendations: ProductRecommendation[];
3546
3563
  }
3564
+ interface CartUpgradeSuggestion {
3565
+ sourceProductId: string;
3566
+ targetProduct: ProductRecommendation;
3567
+ priceDelta: string;
3568
+ deltaPercent: number;
3569
+ }
3570
+ interface CartUpgradesResponse {
3571
+ upgrades: Record<string, CartUpgradeSuggestion>;
3572
+ }
3573
+ interface CartBundleOffer {
3574
+ id: string;
3575
+ name: string;
3576
+ description: string | null;
3577
+ sourceProductId: string;
3578
+ bundleProduct: ProductRecommendation;
3579
+ bundleVariantId: string | null;
3580
+ discountType: 'PERCENTAGE' | 'FIXED_AMOUNT';
3581
+ discountValue: string;
3582
+ originalPrice: string;
3583
+ discountedPrice: string;
3584
+ }
3585
+ interface CartBundlesResponse {
3586
+ bundles: CartBundleOffer[];
3587
+ }
3588
+ interface OrderBump {
3589
+ id: string;
3590
+ title: string;
3591
+ description: string | null;
3592
+ bumpProduct: ProductRecommendation;
3593
+ bumpVariantId: string | null;
3594
+ originalPrice: string;
3595
+ discountedPrice: string | null;
3596
+ discountType: string | null;
3597
+ discountValue: string | null;
3598
+ }
3599
+ interface CheckoutBumpsResponse {
3600
+ bumps: OrderBump[];
3601
+ }
3547
3602
  interface BrainerceApiError {
3548
3603
  statusCode: number;
3549
3604
  message: string;
@@ -4807,6 +4862,61 @@ declare class BrainerceClient {
4807
4862
  * ```
4808
4863
  */
4809
4864
  getCartRecommendations(cartId: string, limit?: number): Promise<CartRecommendationsResponse>;
4865
+ /**
4866
+ * Get upgrade suggestions for cart items (upsell relations with small price delta).
4867
+ * Returns a map keyed by source product ID with the best upgrade option.
4868
+ *
4869
+ * @param cartId - Cart ID
4870
+ * @returns Map of upgrade suggestions keyed by source product ID
4871
+ *
4872
+ * @example
4873
+ * ```typescript
4874
+ * const { upgrades } = await client.getCartUpgrades('cart_123');
4875
+ * for (const [productId, suggestion] of Object.entries(upgrades)) {
4876
+ * console.log(`Upgrade from ${productId} to ${suggestion.targetProduct.name} for +$${suggestion.priceDelta}`);
4877
+ * }
4878
+ * ```
4879
+ */
4880
+ getCartUpgrades(cartId: string): Promise<CartUpgradesResponse>;
4881
+ /**
4882
+ * Get matching bundle offers for cart items.
4883
+ * Returns bundle products with discounted prices for items currently in the cart.
4884
+ *
4885
+ * @param cartId - Cart ID
4886
+ * @returns Array of bundle offers
4887
+ *
4888
+ * @example
4889
+ * ```typescript
4890
+ * const { bundles } = await client.getCartBundles('cart_123');
4891
+ * bundles.forEach(b => {
4892
+ * console.log(`Add ${b.bundleProduct.name} and save! Was ${b.originalPrice}, now ${b.discountedPrice}`);
4893
+ * });
4894
+ * ```
4895
+ */
4896
+ getCartBundles(cartId: string): Promise<CartBundlesResponse>;
4897
+ /**
4898
+ * Get matching order bumps for a checkout session.
4899
+ *
4900
+ * @param checkoutId - Checkout ID
4901
+ * @returns Array of order bumps
4902
+ */
4903
+ getCheckoutBumps(checkoutId: string): Promise<CheckoutBumpsResponse>;
4904
+ /**
4905
+ * Add an order bump to the cart.
4906
+ *
4907
+ * @param cartId - Cart ID
4908
+ * @param bumpConfigId - Order bump config ID
4909
+ * @returns Updated cart
4910
+ */
4911
+ addOrderBump(cartId: string, bumpConfigId: string): Promise<Cart>;
4912
+ /**
4913
+ * Remove an order bump from the cart.
4914
+ *
4915
+ * @param cartId - Cart ID
4916
+ * @param bumpConfigId - Order bump config ID
4917
+ * @returns Updated cart
4918
+ */
4919
+ removeOrderBump(cartId: string, bumpConfigId: string): Promise<Cart>;
4810
4920
  /**
4811
4921
  * Check if customer is currently authenticated
4812
4922
  * Used internally by smart cart methods to determine storage strategy
@@ -6601,4 +6711,4 @@ declare function enableDevGuards(options?: {
6601
6711
  force?: boolean;
6602
6712
  }): void;
6603
6713
 
6604
- 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 CartItem, type CartNudge, type CartRecommendationsResponse, type CartStatus, type Category, type CategoryNode, type CategorySuggestion, type Checkout, type CheckoutAddress, 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 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 };
6714
+ 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 };
package/dist/index.js CHANGED
@@ -2424,6 +2424,101 @@ var BrainerceClient = class {
2424
2424
  400
2425
2425
  );
2426
2426
  }
2427
+ /**
2428
+ * Get upgrade suggestions for cart items (upsell relations with small price delta).
2429
+ * Returns a map keyed by source product ID with the best upgrade option.
2430
+ *
2431
+ * @param cartId - Cart ID
2432
+ * @returns Map of upgrade suggestions keyed by source product ID
2433
+ *
2434
+ * @example
2435
+ * ```typescript
2436
+ * const { upgrades } = await client.getCartUpgrades('cart_123');
2437
+ * for (const [productId, suggestion] of Object.entries(upgrades)) {
2438
+ * console.log(`Upgrade from ${productId} to ${suggestion.targetProduct.name} for +$${suggestion.priceDelta}`);
2439
+ * }
2440
+ * ```
2441
+ */
2442
+ async getCartUpgrades(cartId) {
2443
+ if (this.isVibeCodedMode()) {
2444
+ return this.vibeCodedRequest("GET", `/cart/${cartId}/upgrades`);
2445
+ }
2446
+ if (this.storeId && !this.apiKey) {
2447
+ return this.storefrontRequest("GET", `/cart/${cartId}/upgrades`);
2448
+ }
2449
+ throw new BrainerceError("getCartUpgrades() requires vibe-coded or storefront mode", 400);
2450
+ }
2451
+ /**
2452
+ * Get matching bundle offers for cart items.
2453
+ * Returns bundle products with discounted prices for items currently in the cart.
2454
+ *
2455
+ * @param cartId - Cart ID
2456
+ * @returns Array of bundle offers
2457
+ *
2458
+ * @example
2459
+ * ```typescript
2460
+ * const { bundles } = await client.getCartBundles('cart_123');
2461
+ * bundles.forEach(b => {
2462
+ * console.log(`Add ${b.bundleProduct.name} and save! Was ${b.originalPrice}, now ${b.discountedPrice}`);
2463
+ * });
2464
+ * ```
2465
+ */
2466
+ async getCartBundles(cartId) {
2467
+ if (this.isVibeCodedMode()) {
2468
+ return this.vibeCodedRequest("GET", `/cart/${cartId}/bundles`);
2469
+ }
2470
+ if (this.storeId && !this.apiKey) {
2471
+ return this.storefrontRequest("GET", `/cart/${cartId}/bundles`);
2472
+ }
2473
+ throw new BrainerceError("getCartBundles() requires vibe-coded or storefront mode", 400);
2474
+ }
2475
+ /**
2476
+ * Get matching order bumps for a checkout session.
2477
+ *
2478
+ * @param checkoutId - Checkout ID
2479
+ * @returns Array of order bumps
2480
+ */
2481
+ async getCheckoutBumps(checkoutId) {
2482
+ if (this.isVibeCodedMode()) {
2483
+ return this.vibeCodedRequest("GET", `/checkout/${checkoutId}/bumps`);
2484
+ }
2485
+ if (this.storeId && !this.apiKey) {
2486
+ return this.storefrontRequest("GET", `/checkout/${checkoutId}/bumps`);
2487
+ }
2488
+ throw new BrainerceError("getCheckoutBumps() requires vibe-coded or storefront mode", 400);
2489
+ }
2490
+ /**
2491
+ * Add an order bump to the cart.
2492
+ *
2493
+ * @param cartId - Cart ID
2494
+ * @param bumpConfigId - Order bump config ID
2495
+ * @returns Updated cart
2496
+ */
2497
+ async addOrderBump(cartId, bumpConfigId) {
2498
+ if (this.isVibeCodedMode()) {
2499
+ return this.vibeCodedRequest("POST", `/cart/${cartId}/bump`, { bumpConfigId });
2500
+ }
2501
+ if (this.storeId && !this.apiKey) {
2502
+ return this.storefrontRequest("POST", `/cart/${cartId}/bump`, { bumpConfigId });
2503
+ }
2504
+ throw new BrainerceError("addOrderBump() requires vibe-coded or storefront mode", 400);
2505
+ }
2506
+ /**
2507
+ * Remove an order bump from the cart.
2508
+ *
2509
+ * @param cartId - Cart ID
2510
+ * @param bumpConfigId - Order bump config ID
2511
+ * @returns Updated cart
2512
+ */
2513
+ async removeOrderBump(cartId, bumpConfigId) {
2514
+ if (this.isVibeCodedMode()) {
2515
+ return this.vibeCodedRequest("DELETE", `/cart/${cartId}/bump/${bumpConfigId}`);
2516
+ }
2517
+ if (this.storeId && !this.apiKey) {
2518
+ return this.storefrontRequest("DELETE", `/cart/${cartId}/bump/${bumpConfigId}`);
2519
+ }
2520
+ throw new BrainerceError("removeOrderBump() requires vibe-coded or storefront mode", 400);
2521
+ }
2427
2522
  // -------------------- Smart Cart (Auto-sync) --------------------
2428
2523
  /**
2429
2524
  * Check if customer is currently authenticated
package/dist/index.mjs CHANGED
@@ -2364,6 +2364,101 @@ var BrainerceClient = class {
2364
2364
  400
2365
2365
  );
2366
2366
  }
2367
+ /**
2368
+ * Get upgrade suggestions for cart items (upsell relations with small price delta).
2369
+ * Returns a map keyed by source product ID with the best upgrade option.
2370
+ *
2371
+ * @param cartId - Cart ID
2372
+ * @returns Map of upgrade suggestions keyed by source product ID
2373
+ *
2374
+ * @example
2375
+ * ```typescript
2376
+ * const { upgrades } = await client.getCartUpgrades('cart_123');
2377
+ * for (const [productId, suggestion] of Object.entries(upgrades)) {
2378
+ * console.log(`Upgrade from ${productId} to ${suggestion.targetProduct.name} for +$${suggestion.priceDelta}`);
2379
+ * }
2380
+ * ```
2381
+ */
2382
+ async getCartUpgrades(cartId) {
2383
+ if (this.isVibeCodedMode()) {
2384
+ return this.vibeCodedRequest("GET", `/cart/${cartId}/upgrades`);
2385
+ }
2386
+ if (this.storeId && !this.apiKey) {
2387
+ return this.storefrontRequest("GET", `/cart/${cartId}/upgrades`);
2388
+ }
2389
+ throw new BrainerceError("getCartUpgrades() requires vibe-coded or storefront mode", 400);
2390
+ }
2391
+ /**
2392
+ * Get matching bundle offers for cart items.
2393
+ * Returns bundle products with discounted prices for items currently in the cart.
2394
+ *
2395
+ * @param cartId - Cart ID
2396
+ * @returns Array of bundle offers
2397
+ *
2398
+ * @example
2399
+ * ```typescript
2400
+ * const { bundles } = await client.getCartBundles('cart_123');
2401
+ * bundles.forEach(b => {
2402
+ * console.log(`Add ${b.bundleProduct.name} and save! Was ${b.originalPrice}, now ${b.discountedPrice}`);
2403
+ * });
2404
+ * ```
2405
+ */
2406
+ async getCartBundles(cartId) {
2407
+ if (this.isVibeCodedMode()) {
2408
+ return this.vibeCodedRequest("GET", `/cart/${cartId}/bundles`);
2409
+ }
2410
+ if (this.storeId && !this.apiKey) {
2411
+ return this.storefrontRequest("GET", `/cart/${cartId}/bundles`);
2412
+ }
2413
+ throw new BrainerceError("getCartBundles() requires vibe-coded or storefront mode", 400);
2414
+ }
2415
+ /**
2416
+ * Get matching order bumps for a checkout session.
2417
+ *
2418
+ * @param checkoutId - Checkout ID
2419
+ * @returns Array of order bumps
2420
+ */
2421
+ async getCheckoutBumps(checkoutId) {
2422
+ if (this.isVibeCodedMode()) {
2423
+ return this.vibeCodedRequest("GET", `/checkout/${checkoutId}/bumps`);
2424
+ }
2425
+ if (this.storeId && !this.apiKey) {
2426
+ return this.storefrontRequest("GET", `/checkout/${checkoutId}/bumps`);
2427
+ }
2428
+ throw new BrainerceError("getCheckoutBumps() requires vibe-coded or storefront mode", 400);
2429
+ }
2430
+ /**
2431
+ * Add an order bump to the cart.
2432
+ *
2433
+ * @param cartId - Cart ID
2434
+ * @param bumpConfigId - Order bump config ID
2435
+ * @returns Updated cart
2436
+ */
2437
+ async addOrderBump(cartId, bumpConfigId) {
2438
+ if (this.isVibeCodedMode()) {
2439
+ return this.vibeCodedRequest("POST", `/cart/${cartId}/bump`, { bumpConfigId });
2440
+ }
2441
+ if (this.storeId && !this.apiKey) {
2442
+ return this.storefrontRequest("POST", `/cart/${cartId}/bump`, { bumpConfigId });
2443
+ }
2444
+ throw new BrainerceError("addOrderBump() requires vibe-coded or storefront mode", 400);
2445
+ }
2446
+ /**
2447
+ * Remove an order bump from the cart.
2448
+ *
2449
+ * @param cartId - Cart ID
2450
+ * @param bumpConfigId - Order bump config ID
2451
+ * @returns Updated cart
2452
+ */
2453
+ async removeOrderBump(cartId, bumpConfigId) {
2454
+ if (this.isVibeCodedMode()) {
2455
+ return this.vibeCodedRequest("DELETE", `/cart/${cartId}/bump/${bumpConfigId}`);
2456
+ }
2457
+ if (this.storeId && !this.apiKey) {
2458
+ return this.storefrontRequest("DELETE", `/cart/${cartId}/bump/${bumpConfigId}`);
2459
+ }
2460
+ throw new BrainerceError("removeOrderBump() requires vibe-coded or storefront mode", 400);
2461
+ }
2367
2462
  // -------------------- Smart Cart (Auto-sync) --------------------
2368
2463
  /**
2369
2464
  * Check if customer is currently authenticated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainerce",
3
- "version": "1.11.3",
3
+ "version": "1.12.0",
4
4
  "description": "Official SDK for building e-commerce storefronts with Brainerce Platform. Perfect for vibe-coded sites, AI-built stores (Cursor, Lovable, v0), and custom storefronts.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",