@basedone/core 0.2.3 → 0.2.5

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.
@@ -851,6 +851,35 @@ var CustomerEcommerceClient = class extends BaseEcommerceClient {
851
851
  const queryString = params ? buildQueryString(params) : "";
852
852
  return this.get(`/api/marketplace/flash-sales/active${queryString}`);
853
853
  }
854
+ /**
855
+ * Get flash sale allowance
856
+ *
857
+ * Fetches user's remaining purchase allowance for flash sale items.
858
+ * Used to enforce per-customer purchase limits.
859
+ *
860
+ * @param params - Request params with product IDs
861
+ * @returns Allowance info for each product
862
+ *
863
+ * @example
864
+ * ```typescript
865
+ * const result = await client.getFlashSaleAllowance({
866
+ * productIds: ["prod_123", "prod_456"]
867
+ * });
868
+ *
869
+ * Object.entries(result.allowances).forEach(([productId, info]) => {
870
+ * if (info.limitPerCustomer !== null) {
871
+ * console.log(`Product ${productId}:`);
872
+ * console.log(` Limit: ${info.limitPerCustomer} per customer`);
873
+ * console.log(` You've purchased: ${info.purchased}`);
874
+ * console.log(` You can buy: ${info.remaining} more`);
875
+ * }
876
+ * });
877
+ * ```
878
+ */
879
+ async getFlashSaleAllowance(params) {
880
+ const queryString = buildQueryString({ productIds: params.productIds.join(",") });
881
+ return this.get(`/api/marketplace/flash-sales/allowance${queryString}`);
882
+ }
854
883
  // ============================================================================
855
884
  // Merchant Storefront API
856
885
  // ============================================================================
@@ -988,6 +1017,148 @@ var CustomerEcommerceClient = class extends BaseEcommerceClient {
988
1017
  async getPaymentMethods() {
989
1018
  return this.get("/api/marketplace/payments/methods");
990
1019
  }
1020
+ // ============================================================================
1021
+ // GEM System API
1022
+ // ============================================================================
1023
+ /**
1024
+ * Get user's gem balance
1025
+ *
1026
+ * Returns the current gem balance including total gems, available gems,
1027
+ * and gems expiring soon. Gems are earned at 100 per $1 of revenue.
1028
+ *
1029
+ * @returns Current gem balance with USD equivalent
1030
+ *
1031
+ * @example
1032
+ * ```typescript
1033
+ * const balance = await client.getGemBalance();
1034
+ * console.log(`You have ${balance.totalGems} gems (${balance.usdEquivalent} USD)`);
1035
+ * console.log(`${balance.expiringSoon} gems expiring soon`);
1036
+ * ```
1037
+ */
1038
+ async getGemBalance() {
1039
+ return this.get("/api/gems/balance");
1040
+ }
1041
+ /**
1042
+ * Get gem transaction history
1043
+ *
1044
+ * Returns paginated history of gem transactions including earning,
1045
+ * spending, and expiration events.
1046
+ *
1047
+ * @param params - Query parameters for filtering and pagination
1048
+ * @returns Paginated gem history
1049
+ *
1050
+ * @example
1051
+ * ```typescript
1052
+ * // Get all history
1053
+ * const history = await client.getGemHistory({ limit: 20, offset: 0 });
1054
+ *
1055
+ * // Get only earned gems
1056
+ * const earned = await client.getGemHistory({ type: "earn", limit: 10 });
1057
+ *
1058
+ * // Get only spent gems
1059
+ * const spent = await client.getGemHistory({ type: "spend", limit: 10 });
1060
+ *
1061
+ * history.items.forEach(item => {
1062
+ * console.log(`${item.type}: ${item.amount} gems - ${item.createdAt}`);
1063
+ * });
1064
+ * ```
1065
+ */
1066
+ async getGemHistory(params) {
1067
+ const queryString = params ? buildQueryString(params) : "";
1068
+ return this.get(`/api/gems/history${queryString}`);
1069
+ }
1070
+ /**
1071
+ * Get gems that are expiring soon
1072
+ *
1073
+ * Returns gem batches that will expire within the specified number of days.
1074
+ * Useful for prompting users to spend gems before they expire.
1075
+ *
1076
+ * @param params - Query parameters (days: default 30, max 180)
1077
+ * @returns Expiring gem batches with countdown info
1078
+ *
1079
+ * @example
1080
+ * ```typescript
1081
+ * // Get gems expiring in next 30 days (default)
1082
+ * const expiring = await client.getExpiringGems();
1083
+ *
1084
+ * // Get gems expiring in next 7 days
1085
+ * const urgent = await client.getExpiringGems({ days: 7 });
1086
+ *
1087
+ * if (expiring.totalExpiring > 0) {
1088
+ * console.log(`${expiring.totalExpiring} gems expiring soon!`);
1089
+ * expiring.batches.forEach(batch => {
1090
+ * console.log(`${batch.amount} gems expire in ${batch.daysUntilExpiry} days`);
1091
+ * });
1092
+ * }
1093
+ * ```
1094
+ */
1095
+ async getExpiringGems(params) {
1096
+ const queryString = params ? buildQueryString(params) : "";
1097
+ return this.get(`/api/gems/expiring${queryString}`);
1098
+ }
1099
+ // ============================================================================
1100
+ // Browsing Location API
1101
+ // ============================================================================
1102
+ /**
1103
+ * Get user's browsing location
1104
+ *
1105
+ * Returns the user's saved delivery location for geo-based product filtering.
1106
+ * This location is used to show products from merchants that ship to the area.
1107
+ *
1108
+ * @returns Current browsing location or null if not set
1109
+ *
1110
+ * @example
1111
+ * ```typescript
1112
+ * const result = await client.getBrowsingLocation();
1113
+ * if (result.location) {
1114
+ * console.log(`Delivery to: ${result.location.city}, ${result.location.country}`);
1115
+ * }
1116
+ * ```
1117
+ */
1118
+ async getBrowsingLocation() {
1119
+ return this.get("/api/user/browsing-location");
1120
+ }
1121
+ /**
1122
+ * Save user's browsing location
1123
+ *
1124
+ * Sets the user's delivery location for geo-based product filtering.
1125
+ * Products will be filtered to show only items from merchants that ship to this location.
1126
+ *
1127
+ * @param request - Location data from Google Places or manual input
1128
+ * @returns The saved location
1129
+ *
1130
+ * @example
1131
+ * ```typescript
1132
+ * const result = await client.saveBrowsingLocation({
1133
+ * formattedAddress: "Singapore, Singapore",
1134
+ * city: "Singapore",
1135
+ * country: "SG",
1136
+ * latitude: 1.3521,
1137
+ * longitude: 103.8198
1138
+ * });
1139
+ * console.log(`Location saved: ${result.location.formattedAddress}`);
1140
+ * ```
1141
+ */
1142
+ async saveBrowsingLocation(request) {
1143
+ return this.post("/api/user/browsing-location", request);
1144
+ }
1145
+ /**
1146
+ * Clear user's browsing location
1147
+ *
1148
+ * Removes the user's saved delivery location. Products will no longer
1149
+ * be filtered by shipping destination.
1150
+ *
1151
+ * @returns Success response
1152
+ *
1153
+ * @example
1154
+ * ```typescript
1155
+ * await client.clearBrowsingLocation();
1156
+ * console.log("Location cleared - showing all products");
1157
+ * ```
1158
+ */
1159
+ async clearBrowsingLocation() {
1160
+ return this.delete("/api/user/browsing-location");
1161
+ }
991
1162
  };
992
1163
 
993
1164
  // lib/ecommerce/client/merchant.ts
@@ -2651,6 +2822,7 @@ var ProductSortBy = /* @__PURE__ */ ((ProductSortBy2) => {
2651
2822
  ProductSortBy2["PRICE_DESC"] = "price_desc";
2652
2823
  ProductSortBy2["POPULAR"] = "popular";
2653
2824
  ProductSortBy2["FEATURED"] = "featured";
2825
+ ProductSortBy2["NEARBY"] = "nearby";
2654
2826
  return ProductSortBy2;
2655
2827
  })(ProductSortBy || {});
2656
2828
  var ReviewSortBy = /* @__PURE__ */ ((ReviewSortBy2) => {
@@ -410,7 +410,9 @@ declare enum ProductSortBy {
410
410
  /** Sort by popularity */
411
411
  POPULAR = "popular",
412
412
  /** Sort by featured status */
413
- FEATURED = "featured"
413
+ FEATURED = "featured",
414
+ /** Sort by proximity to user location (requires lat/lng) */
415
+ NEARBY = "nearby"
414
416
  }
415
417
  /**
416
418
  * Review sort by enum
@@ -1292,6 +1294,12 @@ interface ListProductsParams extends PaginationParams {
1292
1294
  sortBy?: ProductSortBy;
1293
1295
  /** Filter by active status */
1294
1296
  isActive?: boolean;
1297
+ /** Filter by destination country (ISO 2-letter code) - only show products from merchants that ship here */
1298
+ country?: string;
1299
+ /** User latitude for proximity sorting (used with sortBy=nearby) */
1300
+ lat?: number;
1301
+ /** User longitude for proximity sorting (used with sortBy=nearby) */
1302
+ lng?: number;
1295
1303
  }
1296
1304
  /**
1297
1305
  * Create product request
@@ -1746,6 +1754,14 @@ interface ListActiveFlashSalesParams {
1746
1754
  /** Filter by merchant ID */
1747
1755
  merchantId?: string;
1748
1756
  }
1757
+ /**
1758
+ * Get flash sale allowance request
1759
+ * Get user's remaining purchase allowance for flash sale items
1760
+ */
1761
+ interface GetFlashSaleAllowanceParams {
1762
+ /** Comma-separated list of product IDs */
1763
+ productIds: string[];
1764
+ }
1749
1765
  /**
1750
1766
  * Flash sale item input
1751
1767
  */
@@ -1893,6 +1909,41 @@ interface CalculateShippingRequest {
1893
1909
  /** Order subtotal in USDC */
1894
1910
  orderSubtotal: number;
1895
1911
  }
1912
+ /**
1913
+ * Gem history type filter
1914
+ */
1915
+ type GemHistoryTypeFilter = "earn" | "spend" | "all";
1916
+ /**
1917
+ * Get gem history parameters
1918
+ */
1919
+ interface GetGemHistoryParams extends PaginationParams {
1920
+ /** Filter by transaction type */
1921
+ type?: GemHistoryTypeFilter;
1922
+ }
1923
+ /**
1924
+ * Get expiring gems parameters
1925
+ */
1926
+ interface GetExpiringGemsParams {
1927
+ /** Number of days ahead to check (default: 30, max: 180) */
1928
+ days?: number;
1929
+ }
1930
+ /**
1931
+ * Save browsing location request
1932
+ */
1933
+ interface SaveBrowsingLocationRequest {
1934
+ /** Full display address from Google Places */
1935
+ formattedAddress: string;
1936
+ /** City name */
1937
+ city: string;
1938
+ /** State/Province (optional) */
1939
+ stateProvince?: string;
1940
+ /** ISO 2-letter country code (e.g., "SG", "US") */
1941
+ country: string;
1942
+ /** Latitude coordinate */
1943
+ latitude: number;
1944
+ /** Longitude coordinate */
1945
+ longitude: number;
1946
+ }
1896
1947
 
1897
1948
  /**
1898
1949
  * Ecommerce API Response Types
@@ -2758,6 +2809,34 @@ interface ActiveFlashSalesResponse {
2758
2809
  /** Server time (for client-side sync) */
2759
2810
  serverTime: string;
2760
2811
  }
2812
+ /**
2813
+ * Flash sale allowance info for a single product
2814
+ */
2815
+ interface FlashSaleAllowanceInfo {
2816
+ /** Flash sale ID */
2817
+ flashSaleId: string;
2818
+ /** Limit per customer (null = no limit) */
2819
+ limitPerCustomer: number | null;
2820
+ /** Quantity already purchased by user */
2821
+ purchased: number;
2822
+ /** Remaining quantity user can purchase (null = no limit) */
2823
+ remaining: number | null;
2824
+ /** Current sale price */
2825
+ salePrice: string;
2826
+ /** Maximum quantity available in flash sale (null = unlimited) */
2827
+ maxQuantity: number | null;
2828
+ /** Remaining quantity in flash sale (null = unlimited) */
2829
+ remainingQuantity: number | null;
2830
+ }
2831
+ /**
2832
+ * Get flash sale allowance response
2833
+ */
2834
+ interface GetFlashSaleAllowanceResponse {
2835
+ /** Allowances by product ID */
2836
+ allowances: Record<string, FlashSaleAllowanceInfo>;
2837
+ /** Whether user is authenticated */
2838
+ authenticated: boolean;
2839
+ }
2761
2840
 
2762
2841
  /**
2763
2842
  * Get shipping settings response
@@ -2882,6 +2961,147 @@ interface ProcessPaymentResponse {
2882
2961
  /** Error code */
2883
2962
  errorCode?: string;
2884
2963
  }
2964
+ /**
2965
+ * Gem source type - how gems were earned
2966
+ */
2967
+ type GemSource = "BUILDER_CODE" | "PREDICTION" | "CARD_SPEND" | "MALL_SPEND" | "ADMIN" | "REFUND";
2968
+ /**
2969
+ * Get gem balance response
2970
+ */
2971
+ interface GetGemBalanceResponse {
2972
+ /** User ID */
2973
+ userId: string;
2974
+ /** Total gems owned */
2975
+ totalGems: number;
2976
+ /** Available gems (not reserved) */
2977
+ availableGems: number;
2978
+ /** Gems expiring within 30 days */
2979
+ expiringSoon: number;
2980
+ /** Last balance update timestamp */
2981
+ lastUpdated: string;
2982
+ /** USD equivalent (totalGems / 100) */
2983
+ usdEquivalent: number;
2984
+ /** Conversion rate (gems per $1) */
2985
+ conversionRate: number;
2986
+ }
2987
+ /**
2988
+ * Gem history item type
2989
+ */
2990
+ type GemHistoryType = "earn" | "spend" | "expire";
2991
+ /**
2992
+ * Gem history item
2993
+ */
2994
+ interface GemHistoryItem {
2995
+ /** Transaction ID */
2996
+ id: string;
2997
+ /** Type of transaction */
2998
+ type: GemHistoryType;
2999
+ /** Amount of gems (positive for earn, negative for spend) */
3000
+ amount: number;
3001
+ /** Source type (for earn transactions) */
3002
+ source?: GemSource;
3003
+ /** Reason description (for spend transactions) */
3004
+ reason?: string;
3005
+ /** When the transaction occurred */
3006
+ createdAt: string;
3007
+ /** When the gems expire (for earn transactions) */
3008
+ expiresAt?: string;
3009
+ }
3010
+ /**
3011
+ * Get gem history response
3012
+ */
3013
+ interface GetGemHistoryResponse {
3014
+ /** History items */
3015
+ items: GemHistoryItem[];
3016
+ /** Total count of items */
3017
+ total: number;
3018
+ /** Pagination info */
3019
+ pagination: {
3020
+ /** Items per page */
3021
+ limit: number;
3022
+ /** Current offset */
3023
+ offset: number;
3024
+ /** Whether more items exist */
3025
+ hasMore: boolean;
3026
+ };
3027
+ }
3028
+ /**
3029
+ * Expiring gem batch
3030
+ */
3031
+ interface ExpiringGemBatch {
3032
+ /** Batch ID */
3033
+ id: string;
3034
+ /** Remaining gems in batch */
3035
+ amount: number;
3036
+ /** How the gems were earned */
3037
+ source: GemSource;
3038
+ /** When the batch expires */
3039
+ expiresAt: string;
3040
+ /** When the batch was created */
3041
+ createdAt: string;
3042
+ /** Days until expiry */
3043
+ daysUntilExpiry: number;
3044
+ }
3045
+ /**
3046
+ * Get expiring gems response
3047
+ */
3048
+ interface GetExpiringGemsResponse {
3049
+ /** Total gems expiring within the query period */
3050
+ totalExpiring: number;
3051
+ /** Expiring batches */
3052
+ batches: ExpiringGemBatch[];
3053
+ /** Query parameters used */
3054
+ queryParams: {
3055
+ /** Days ahead that were queried */
3056
+ days: number;
3057
+ };
3058
+ }
3059
+ /**
3060
+ * User's browsing location for geo-based product filtering
3061
+ */
3062
+ interface BrowsingLocation {
3063
+ /** Location ID */
3064
+ id: string;
3065
+ /** Full display address */
3066
+ formattedAddress: string;
3067
+ /** City name */
3068
+ city: string;
3069
+ /** State/Province (if applicable) */
3070
+ stateProvince?: string | null;
3071
+ /** ISO 2-letter country code */
3072
+ country: string;
3073
+ /** Latitude coordinate */
3074
+ latitude: number;
3075
+ /** Longitude coordinate */
3076
+ longitude: number;
3077
+ /** Last updated timestamp */
3078
+ updatedAt: string;
3079
+ }
3080
+ /**
3081
+ * Get browsing location response
3082
+ */
3083
+ interface GetBrowsingLocationResponse {
3084
+ /** User's saved browsing location (null if not set) */
3085
+ location: BrowsingLocation | null;
3086
+ }
3087
+ /**
3088
+ * Save browsing location response
3089
+ */
3090
+ interface SaveBrowsingLocationResponse {
3091
+ /** Whether the operation was successful */
3092
+ success: boolean;
3093
+ /** The saved location */
3094
+ location: BrowsingLocation;
3095
+ }
3096
+ /**
3097
+ * Delete browsing location response
3098
+ */
3099
+ interface DeleteBrowsingLocationResponse {
3100
+ /** Whether the operation was successful */
3101
+ success: boolean;
3102
+ /** Success message */
3103
+ message: string;
3104
+ }
2885
3105
 
2886
3106
  /**
2887
3107
  * Customer/End-User Ecommerce API Client
@@ -3370,6 +3590,32 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3370
3590
  * ```
3371
3591
  */
3372
3592
  getActiveFlashSales(params?: ListActiveFlashSalesParams): Promise<ActiveFlashSalesResponse>;
3593
+ /**
3594
+ * Get flash sale allowance
3595
+ *
3596
+ * Fetches user's remaining purchase allowance for flash sale items.
3597
+ * Used to enforce per-customer purchase limits.
3598
+ *
3599
+ * @param params - Request params with product IDs
3600
+ * @returns Allowance info for each product
3601
+ *
3602
+ * @example
3603
+ * ```typescript
3604
+ * const result = await client.getFlashSaleAllowance({
3605
+ * productIds: ["prod_123", "prod_456"]
3606
+ * });
3607
+ *
3608
+ * Object.entries(result.allowances).forEach(([productId, info]) => {
3609
+ * if (info.limitPerCustomer !== null) {
3610
+ * console.log(`Product ${productId}:`);
3611
+ * console.log(` Limit: ${info.limitPerCustomer} per customer`);
3612
+ * console.log(` You've purchased: ${info.purchased}`);
3613
+ * console.log(` You can buy: ${info.remaining} more`);
3614
+ * }
3615
+ * });
3616
+ * ```
3617
+ */
3618
+ getFlashSaleAllowance(params: GetFlashSaleAllowanceParams): Promise<GetFlashSaleAllowanceResponse>;
3373
3619
  /**
3374
3620
  * Get public merchant profile
3375
3621
  *
@@ -3482,6 +3728,128 @@ declare class CustomerEcommerceClient extends BaseEcommerceClient {
3482
3728
  * ```
3483
3729
  */
3484
3730
  getPaymentMethods(): Promise<GetPaymentMethodsResponse>;
3731
+ /**
3732
+ * Get user's gem balance
3733
+ *
3734
+ * Returns the current gem balance including total gems, available gems,
3735
+ * and gems expiring soon. Gems are earned at 100 per $1 of revenue.
3736
+ *
3737
+ * @returns Current gem balance with USD equivalent
3738
+ *
3739
+ * @example
3740
+ * ```typescript
3741
+ * const balance = await client.getGemBalance();
3742
+ * console.log(`You have ${balance.totalGems} gems (${balance.usdEquivalent} USD)`);
3743
+ * console.log(`${balance.expiringSoon} gems expiring soon`);
3744
+ * ```
3745
+ */
3746
+ getGemBalance(): Promise<GetGemBalanceResponse>;
3747
+ /**
3748
+ * Get gem transaction history
3749
+ *
3750
+ * Returns paginated history of gem transactions including earning,
3751
+ * spending, and expiration events.
3752
+ *
3753
+ * @param params - Query parameters for filtering and pagination
3754
+ * @returns Paginated gem history
3755
+ *
3756
+ * @example
3757
+ * ```typescript
3758
+ * // Get all history
3759
+ * const history = await client.getGemHistory({ limit: 20, offset: 0 });
3760
+ *
3761
+ * // Get only earned gems
3762
+ * const earned = await client.getGemHistory({ type: "earn", limit: 10 });
3763
+ *
3764
+ * // Get only spent gems
3765
+ * const spent = await client.getGemHistory({ type: "spend", limit: 10 });
3766
+ *
3767
+ * history.items.forEach(item => {
3768
+ * console.log(`${item.type}: ${item.amount} gems - ${item.createdAt}`);
3769
+ * });
3770
+ * ```
3771
+ */
3772
+ getGemHistory(params?: GetGemHistoryParams): Promise<GetGemHistoryResponse>;
3773
+ /**
3774
+ * Get gems that are expiring soon
3775
+ *
3776
+ * Returns gem batches that will expire within the specified number of days.
3777
+ * Useful for prompting users to spend gems before they expire.
3778
+ *
3779
+ * @param params - Query parameters (days: default 30, max 180)
3780
+ * @returns Expiring gem batches with countdown info
3781
+ *
3782
+ * @example
3783
+ * ```typescript
3784
+ * // Get gems expiring in next 30 days (default)
3785
+ * const expiring = await client.getExpiringGems();
3786
+ *
3787
+ * // Get gems expiring in next 7 days
3788
+ * const urgent = await client.getExpiringGems({ days: 7 });
3789
+ *
3790
+ * if (expiring.totalExpiring > 0) {
3791
+ * console.log(`${expiring.totalExpiring} gems expiring soon!`);
3792
+ * expiring.batches.forEach(batch => {
3793
+ * console.log(`${batch.amount} gems expire in ${batch.daysUntilExpiry} days`);
3794
+ * });
3795
+ * }
3796
+ * ```
3797
+ */
3798
+ getExpiringGems(params?: GetExpiringGemsParams): Promise<GetExpiringGemsResponse>;
3799
+ /**
3800
+ * Get user's browsing location
3801
+ *
3802
+ * Returns the user's saved delivery location for geo-based product filtering.
3803
+ * This location is used to show products from merchants that ship to the area.
3804
+ *
3805
+ * @returns Current browsing location or null if not set
3806
+ *
3807
+ * @example
3808
+ * ```typescript
3809
+ * const result = await client.getBrowsingLocation();
3810
+ * if (result.location) {
3811
+ * console.log(`Delivery to: ${result.location.city}, ${result.location.country}`);
3812
+ * }
3813
+ * ```
3814
+ */
3815
+ getBrowsingLocation(): Promise<GetBrowsingLocationResponse>;
3816
+ /**
3817
+ * Save user's browsing location
3818
+ *
3819
+ * Sets the user's delivery location for geo-based product filtering.
3820
+ * Products will be filtered to show only items from merchants that ship to this location.
3821
+ *
3822
+ * @param request - Location data from Google Places or manual input
3823
+ * @returns The saved location
3824
+ *
3825
+ * @example
3826
+ * ```typescript
3827
+ * const result = await client.saveBrowsingLocation({
3828
+ * formattedAddress: "Singapore, Singapore",
3829
+ * city: "Singapore",
3830
+ * country: "SG",
3831
+ * latitude: 1.3521,
3832
+ * longitude: 103.8198
3833
+ * });
3834
+ * console.log(`Location saved: ${result.location.formattedAddress}`);
3835
+ * ```
3836
+ */
3837
+ saveBrowsingLocation(request: SaveBrowsingLocationRequest): Promise<SaveBrowsingLocationResponse>;
3838
+ /**
3839
+ * Clear user's browsing location
3840
+ *
3841
+ * Removes the user's saved delivery location. Products will no longer
3842
+ * be filtered by shipping destination.
3843
+ *
3844
+ * @returns Success response
3845
+ *
3846
+ * @example
3847
+ * ```typescript
3848
+ * await client.clearBrowsingLocation();
3849
+ * console.log("Location cleared - showing all products");
3850
+ * ```
3851
+ */
3852
+ clearBrowsingLocation(): Promise<DeleteBrowsingLocationResponse>;
3485
3853
  }
3486
3854
 
3487
3855
  /**
@@ -5196,4 +5564,4 @@ declare function calculateDiscountAmount(price: number, discountType: "PERCENTAG
5196
5564
  */
5197
5565
  declare function calculateFinalPrice(price: number, discountType: "PERCENTAGE" | "FIXED_AMOUNT", discountValue: number): number;
5198
5566
 
5199
- export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type FlashSale, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetCouponResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
5567
+ export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };