brainerce 1.0.1 → 1.1.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
@@ -1969,6 +1969,31 @@ interface SetShippingAddressResponse {
1969
1969
  checkout: Checkout;
1970
1970
  rates: ShippingRate[];
1971
1971
  }
1972
+ /**
1973
+ * Available shipping destinations for a store.
1974
+ *
1975
+ * Use `getShippingDestinations()` to populate country/region `<select>` elements
1976
+ * in your checkout form instead of free-text fields.
1977
+ *
1978
+ * - If `worldwide` is true, the store ships to all countries (use a full country list).
1979
+ * - `countries` contains the specific country codes/names the store ships to.
1980
+ * - `regions` contains region restrictions per country. If a country has no entry,
1981
+ * all regions within it are available.
1982
+ */
1983
+ interface ShippingDestinations {
1984
+ /** Whether the store ships worldwide (has a zone covering all countries) */
1985
+ worldwide: boolean;
1986
+ /** Countries the store ships to */
1987
+ countries: Array<{
1988
+ code: string;
1989
+ name: string;
1990
+ }>;
1991
+ /** Region restrictions per country code. Empty object means no region restrictions. */
1992
+ regions: Record<string, Array<{
1993
+ code: string;
1994
+ name: string;
1995
+ }>>;
1996
+ }
1972
1997
  interface CompleteCheckoutResponse {
1973
1998
  orderId: string;
1974
1999
  }
@@ -3362,9 +3387,15 @@ declare class BrainerceClient {
3362
3387
  private readonly timeout;
3363
3388
  private customerToken;
3364
3389
  private customerCartId;
3390
+ private sessionCartId;
3391
+ private sessionToken;
3392
+ private _sessionCartPromise;
3393
+ private _migrationDone;
3394
+ /** localStorage key for session cart reference (sessionToken + cartId) */
3395
+ private readonly SESSION_CART_KEY;
3365
3396
  /**
3366
3397
  * Virtual cart ID used for localStorage carts (guest users not logged in).
3367
- * When a cart has this ID, operations use localStorage instead of server API.
3398
+ * @deprecated Guest carts now use server-side sessions. Kept for backward compatibility.
3368
3399
  */
3369
3400
  private readonly VIRTUAL_LOCAL_CART_ID;
3370
3401
  /**
@@ -4585,6 +4616,64 @@ declare class BrainerceClient {
4585
4616
  * ```
4586
4617
  */
4587
4618
  isCustomerLoggedIn(): boolean;
4619
+ /**
4620
+ * Hydrate session cart state from localStorage on construction.
4621
+ * @internal
4622
+ */
4623
+ private hydrateSessionCart;
4624
+ /**
4625
+ * Persist session cart reference to localStorage.
4626
+ * @internal
4627
+ */
4628
+ private saveSessionCart;
4629
+ /**
4630
+ * Clear session cart reference from localStorage and memory.
4631
+ * @internal
4632
+ */
4633
+ private clearSessionCart;
4634
+ /**
4635
+ * Update the cached item count in the session reference.
4636
+ * @internal
4637
+ */
4638
+ private updateSessionCartItemCount;
4639
+ /**
4640
+ * Return a synthetic empty Cart object for display when no server cart exists yet.
4641
+ * Avoids creating a server cart just to show "your cart is empty."
4642
+ * @internal
4643
+ */
4644
+ private emptyCart;
4645
+ /**
4646
+ * Create a server-side cart via API. Never falls back to localStorage.
4647
+ * @internal
4648
+ */
4649
+ private createServerCart;
4650
+ /**
4651
+ * Get or create a server-side session cart for guest users.
4652
+ * Lazily creates the cart on first call (e.g., first add-to-cart).
4653
+ * Uses promise dedup lock to prevent race conditions on parallel calls.
4654
+ * @internal
4655
+ */
4656
+ private getOrCreateSessionCart;
4657
+ /** @internal */
4658
+ private _getOrCreateSessionCartImpl;
4659
+ /**
4660
+ * Migrate legacy localStorage cart to server session cart.
4661
+ * Called once, on first smart method call if migration is needed.
4662
+ * @internal
4663
+ */
4664
+ private migrateLocalCartToSession;
4665
+ /**
4666
+ * Merge the guest session cart into the customer's cart on the server.
4667
+ * Tries linkCart first (fast, single call), falls back to mergeCarts endpoint.
4668
+ * @internal
4669
+ */
4670
+ private mergeSessionCartOnLogin;
4671
+ /**
4672
+ * Get the cart item count without a full cart fetch.
4673
+ * Returns the cached count from localStorage if available, or 0.
4674
+ * For accurate counts, use smartGetCart() and read cart.itemCount.
4675
+ */
4676
+ getSmartCartItemCount(): number;
4588
4677
  /**
4589
4678
  * Get or create a server cart for the logged-in customer
4590
4679
  * Caches the cart ID for subsequent calls
@@ -4597,10 +4686,10 @@ declare class BrainerceClient {
4597
4686
  */
4598
4687
  private fetchCustomerCart;
4599
4688
  /**
4600
- * Smart add to cart - automatically uses localStorage or server based on auth state
4689
+ * Smart add to cart - automatically uses the correct cart based on auth state
4601
4690
  *
4602
- * - **Guest (not logged in)**: Stores in localStorage
4603
- * - **Logged in**: Stores on server (database)
4691
+ * - **Logged in**: Uses customer's server cart
4692
+ * - **Guest**: Uses server-side session cart (creates one if needed)
4604
4693
  *
4605
4694
  * @example
4606
4695
  * ```typescript
@@ -4608,14 +4697,20 @@ declare class BrainerceClient {
4608
4697
  * await client.smartAddToCart({
4609
4698
  * productId: 'prod_123',
4610
4699
  * quantity: 2,
4611
- * name: 'Cool Product', // Optional: for localStorage display
4612
- * price: '29.99',
4613
4700
  * });
4614
4701
  * ```
4615
4702
  */
4616
- smartAddToCart(item: Omit<LocalCartItem, 'addedAt'>): Promise<Cart | LocalCart>;
4703
+ smartAddToCart(item: {
4704
+ productId: string;
4705
+ variantId?: string;
4706
+ quantity: number;
4707
+ }): Promise<Cart>;
4617
4708
  /**
4618
- * Smart get cart - returns server cart if logged in, localStorage if guest
4709
+ * Smart get cart - returns the current cart (server-side for both guests and logged-in users)
4710
+ *
4711
+ * - **Logged in**: Returns customer's server cart
4712
+ * - **Guest with session**: Returns server-side session cart
4713
+ * - **Guest without session**: Returns empty cart (no server call, cart created lazily on add)
4619
4714
  *
4620
4715
  * @example
4621
4716
  * ```typescript
@@ -4623,7 +4718,7 @@ declare class BrainerceClient {
4623
4718
  * console.log('Items:', cart.items.length);
4624
4719
  * ```
4625
4720
  */
4626
- smartGetCart(): Promise<Cart | LocalCart>;
4721
+ smartGetCart(): Promise<Cart>;
4627
4722
  /**
4628
4723
  * Smart update cart item quantity
4629
4724
  *
@@ -4633,7 +4728,7 @@ declare class BrainerceClient {
4633
4728
  * await client.smartUpdateCartItem('prod_123', 0); // Remove item
4634
4729
  * ```
4635
4730
  */
4636
- smartUpdateCartItem(productId: string, quantity: number, variantId?: string): Promise<Cart | LocalCart>;
4731
+ smartUpdateCartItem(productId: string, quantity: number, variantId?: string): Promise<Cart>;
4637
4732
  /**
4638
4733
  * Smart remove from cart
4639
4734
  *
@@ -4643,17 +4738,15 @@ declare class BrainerceClient {
4643
4738
  * await client.smartRemoveFromCart('prod_456', 'variant_789');
4644
4739
  * ```
4645
4740
  */
4646
- smartRemoveFromCart(productId: string, variantId?: string): Promise<Cart | LocalCart>;
4741
+ smartRemoveFromCart(productId: string, variantId?: string): Promise<Cart>;
4647
4742
  /**
4648
- * Sync local cart to server on login
4743
+ * Sync guest cart to customer cart on login
4649
4744
  *
4650
4745
  * Call this AFTER setCustomerToken() when a customer logs in.
4651
4746
  * This will:
4652
- * 1. Get or create a server cart for the customer
4653
- * 2. Add all items from localStorage to the server cart (merging with existing)
4654
- * 3. Clear localStorage
4655
- *
4656
- * Items that fail to sync (e.g., out of stock) are silently skipped.
4747
+ * 1. If a server-side session cart exists, merge it into the customer cart (atomic, server-side)
4748
+ * 2. If only a legacy localStorage cart exists, sync items one by one (backward compat)
4749
+ * 3. Clear the session/localStorage after merge
4657
4750
  *
4658
4751
  * @example
4659
4752
  * ```typescript
@@ -4661,7 +4754,7 @@ declare class BrainerceClient {
4661
4754
  * const auth = await client.login(email, password);
4662
4755
  * client.setCustomerToken(auth.token);
4663
4756
  *
4664
- * // Sync their local cart to server
4757
+ * // Merge their guest cart into customer cart
4665
4758
  * const cart = await client.syncCartOnLogin();
4666
4759
  * console.log('Cart synced, items:', cart.items.length);
4667
4760
  * ```
@@ -4670,15 +4763,15 @@ declare class BrainerceClient {
4670
4763
  /**
4671
4764
  * Clear cart state on logout
4672
4765
  *
4673
- * Call this when a customer logs out to clear the cached cart ID.
4674
- * The localStorage cart remains available for the next guest session.
4766
+ * Call this when a customer logs out to clear the cached customer cart ID.
4767
+ * The session cart (if any) remains available for the next guest session.
4675
4768
  *
4676
4769
  * @example
4677
4770
  * ```typescript
4678
4771
  * client.clearCustomerToken();
4679
4772
  * client.onLogout();
4680
4773
  *
4681
- * // Now back to guest mode - cart uses localStorage
4774
+ * // Now back to guest mode - cart uses server-side session
4682
4775
  * await client.smartAddToCart({ productId: 'prod_123', quantity: 1 });
4683
4776
  * ```
4684
4777
  */
@@ -4694,7 +4787,6 @@ declare class BrainerceClient {
4694
4787
  * // After payment success
4695
4788
  * if (paymentStatus === 'succeeded') {
4696
4789
  * client.onCheckoutComplete();
4697
- * client.clearLocalCart(); // Also clear localStorage for guests
4698
4790
  * }
4699
4791
  * ```
4700
4792
  */
@@ -4744,6 +4836,32 @@ declare class BrainerceClient {
4744
4836
  * ```
4745
4837
  */
4746
4838
  setCheckoutCustomer(checkoutId: string, data: SetCheckoutCustomerDto): Promise<Checkout>;
4839
+ /**
4840
+ * Get available shipping destinations for this store.
4841
+ *
4842
+ * Returns which countries and regions the store ships to,
4843
+ * so you can populate `<select>` dropdowns in your checkout form.
4844
+ *
4845
+ * @example
4846
+ * ```typescript
4847
+ * const dest = await client.getShippingDestinations();
4848
+ *
4849
+ * if (dest.worldwide) {
4850
+ * // Store ships everywhere — use a full country list
4851
+ * } else {
4852
+ * // Only show available countries
4853
+ * dest.countries.forEach(c => console.log(c.code, c.name));
4854
+ * }
4855
+ *
4856
+ * // Check region restrictions for a country
4857
+ * const usRegions = dest.regions['US'];
4858
+ * if (usRegions) {
4859
+ * // Only these US states are available
4860
+ * usRegions.forEach(r => console.log(r.code, r.name));
4861
+ * }
4862
+ * ```
4863
+ */
4864
+ getShippingDestinations(): Promise<ShippingDestinations>;
4747
4865
  /**
4748
4866
  * Set shipping address on checkout (includes customer email).
4749
4867
  * Returns the checkout and available shipping rates for the address.
@@ -5016,14 +5134,8 @@ declare class BrainerceClient {
5016
5134
  */
5017
5135
  private isLocalStorageAvailable;
5018
5136
  /**
5019
- * Get local cart from localStorage
5020
- * Returns empty cart if none exists
5021
- *
5022
- * @example
5023
- * ```typescript
5024
- * const cart = client.getLocalCart();
5025
- * console.log('Items in cart:', cart.items.length);
5026
- * ```
5137
+ * @deprecated Use `smartGetCart()` instead. Guest carts are now stored on the server.
5138
+ * Get local cart from localStorage. Returns empty cart if none exists.
5027
5139
  */
5028
5140
  getLocalCart(): LocalCart;
5029
5141
  /**
@@ -5041,89 +5153,44 @@ declare class BrainerceClient {
5041
5153
  */
5042
5154
  private localCartToCart;
5043
5155
  /**
5044
- * Add item to local cart (NO API call)
5045
- * If item already exists, updates quantity
5046
- *
5047
- * @example
5048
- * ```typescript
5049
- * client.addToLocalCart({
5050
- * productId: 'prod_123',
5051
- * quantity: 2,
5052
- * name: 'Cool Shirt',
5053
- * price: '29.99',
5054
- * });
5055
- * ```
5156
+ * @deprecated Use `smartAddToCart()` instead. Guest carts are now stored on the server.
5157
+ * Add item to local cart (NO API call). If item already exists, updates quantity.
5056
5158
  */
5057
5159
  addToLocalCart(item: Omit<LocalCartItem, 'addedAt'>): LocalCart;
5058
5160
  /**
5059
- * Update item quantity in local cart
5060
- * Set quantity to 0 to remove item
5061
- *
5062
- * @example
5063
- * ```typescript
5064
- * client.updateLocalCartItem('prod_123', 3); // Set quantity to 3
5065
- * client.updateLocalCartItem('prod_123', 0); // Remove item
5066
- * ```
5161
+ * @deprecated Use `smartUpdateCartItem()` instead. Guest carts are now stored on the server.
5162
+ * Update item quantity in local cart. Set quantity to 0 to remove item.
5067
5163
  */
5068
5164
  updateLocalCartItem(productId: string, quantity: number, variantId?: string): LocalCart;
5069
5165
  /**
5070
- * Remove item from local cart
5071
- *
5072
- * @example
5073
- * ```typescript
5074
- * client.removeFromLocalCart('prod_123');
5075
- * client.removeFromLocalCart('prod_456', 'variant_789');
5076
- * ```
5166
+ * @deprecated Use `smartRemoveFromCart()` instead. Guest carts are now stored on the server.
5077
5167
  */
5078
5168
  removeFromLocalCart(productId: string, variantId?: string): LocalCart;
5079
5169
  /**
5080
- * Clear all items from local cart
5081
- *
5082
- * @example
5083
- * ```typescript
5084
- * client.clearLocalCart();
5085
- * ```
5170
+ * @deprecated Use `onCheckoutComplete()` instead. Guest carts are now stored on the server.
5086
5171
  */
5087
5172
  clearLocalCart(): LocalCart;
5088
5173
  /**
5089
- * Set customer info on local cart
5090
- *
5091
- * @example
5092
- * ```typescript
5093
- * client.setLocalCartCustomer({
5094
- * email: 'john@example.com',
5095
- * firstName: 'John',
5096
- * lastName: 'Doe',
5097
- * });
5098
- * ```
5174
+ * @deprecated Customer info is now set via checkout address methods.
5175
+ * Still used by `submitGuestOrder()` for backward compatibility.
5099
5176
  */
5100
5177
  setLocalCartCustomer(customer: LocalCart['customer']): LocalCart;
5101
5178
  /**
5102
- * Set shipping address on local cart
5103
- *
5104
- * @example
5105
- * ```typescript
5106
- * client.setLocalCartShippingAddress({
5107
- * firstName: 'John',
5108
- * lastName: 'Doe',
5109
- * line1: '123 Main St',
5110
- * city: 'Tel Aviv',
5111
- * postalCode: '6100000',
5112
- * country: 'IL',
5113
- * });
5114
- * ```
5179
+ * @deprecated Address is now set via `updateGuestCheckoutAddress()` after `startGuestCheckout()`.
5180
+ * Still used by `submitGuestOrder()` for backward compatibility.
5115
5181
  */
5116
5182
  setLocalCartShippingAddress(address: LocalCart['shippingAddress']): LocalCart;
5117
5183
  /**
5118
- * Set billing address on local cart
5184
+ * @deprecated Address is now set via `updateGuestCheckoutAddress()` after `startGuestCheckout()`.
5185
+ * Still used by `submitGuestOrder()` for backward compatibility.
5119
5186
  */
5120
5187
  setLocalCartBillingAddress(address: LocalCart['billingAddress']): LocalCart;
5121
5188
  /**
5122
- * Set coupon code on local cart
5189
+ * @deprecated Coupons are now applied via `applyCoupon()` on the server cart.
5123
5190
  */
5124
5191
  setLocalCartCoupon(couponCode: string | undefined): LocalCart;
5125
5192
  /**
5126
- * Get total items count in local cart
5193
+ * @deprecated Use `getSmartCartItemCount()` instead.
5127
5194
  */
5128
5195
  getLocalCartItemCount(): number;
5129
5196
  /**
@@ -5222,16 +5289,8 @@ declare class BrainerceClient {
5222
5289
  */
5223
5290
  private clearActiveCheckoutStorage;
5224
5291
  /**
5292
+ * @deprecated Partial checkout is now handled server-side via `selectedItemIds`.
5225
5293
  * Remove specific items from local cart by their indices.
5226
- * Use after partial checkout to remove only the purchased items.
5227
- *
5228
- * @param indices - Array of item indices to remove
5229
- *
5230
- * @example
5231
- * ```typescript
5232
- * // After partial checkout success, remove purchased items
5233
- * client.removeLocalCartItemsByIndex([0, 2]); // Removes items at index 0 and 2
5234
- * ```
5235
5294
  */
5236
5295
  removeLocalCartItemsByIndex(indices: number[]): void;
5237
5296
  /**
@@ -6255,4 +6314,4 @@ declare function enableDevGuards(options?: {
6255
6314
  force?: boolean;
6256
6315
  }): void;
6257
6316
 
6258
- 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 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 PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PlatformCouponCapabilities, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, 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, type SearchSuggestions, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomerDto, type SetShippingAddressDto, type SetShippingAddressResponse, 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, getStockStatus, getVariantOptions, getVariantPrice, isCouponApplicableToProduct, isHtmlDescription, isWebhookEventType, parseWebhookEvent, verifyWebhook };
6317
+ 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 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 PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PlatformCouponCapabilities, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, 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, type SearchSuggestions, 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, getStockStatus, getVariantOptions, getVariantPrice, isCouponApplicableToProduct, isHtmlDescription, isWebhookEventType, parseWebhookEvent, verifyWebhook };