@instockng/api-client 1.0.42 → 1.0.43

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.
@@ -5081,7 +5081,7 @@ export declare function initiateCheckout(cartId: string, data: {
5081
5081
  * @param cartId - Cart UUID
5082
5082
  * @returns Array of cart items with their discounted add-on products
5083
5083
  */
5084
- export declare function fetchCartUpsellAddons(cartId: string): Promise<{
5084
+ export declare function fetchCartUpsellAddons(cartId: string, limit?: number): Promise<{
5085
5085
  error: {
5086
5086
  code: string;
5087
5087
  message: string;
@@ -196,10 +196,12 @@ export async function initiateCheckout(cartId, data) {
196
196
  * @param cartId - Cart UUID
197
197
  * @returns Array of cart items with their discounted add-on products
198
198
  */
199
- export async function fetchCartUpsellAddons(cartId) {
199
+ export async function fetchCartUpsellAddons(cartId, limit) {
200
200
  const clients = createRpcClients(API_URL);
201
201
  const res = await clients.carts[':id']['upsell-addons'].$get({
202
202
  param: { id: cartId },
203
+ // @ts-ignore - Hono RPC type inference issue with query parameters
204
+ query: limit ? { limit: String(limit) } : {},
203
205
  });
204
206
  if (!res.ok) {
205
207
  throw new Error(`Failed to fetch upsell add-ons: ${res.statusText}`);
@@ -5685,7 +5685,7 @@ export declare function useGetCartRecommendations(cartId: string | null | undefi
5685
5685
  * @param cartId - Cart UUID
5686
5686
  * @param options - React Query options
5687
5687
  */
5688
- export declare function useGetCartUpsellAddons(cartId: string | null | undefined, options?: Omit<UseQueryOptions<Awaited<ReturnType<typeof fetchCartUpsellAddons>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
5688
+ export declare function useGetCartUpsellAddons(cartId: string | null | undefined, limit?: number, options?: Omit<UseQueryOptions<Awaited<ReturnType<typeof fetchCartUpsellAddons>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
5689
5689
  productId: string;
5690
5690
  productName: string;
5691
5691
  productThumbnailUrl: string | null;
@@ -267,10 +267,10 @@ export function useGetCartRecommendations(cartId, limit, options) {
267
267
  * @param cartId - Cart UUID
268
268
  * @param options - React Query options
269
269
  */
270
- export function useGetCartUpsellAddons(cartId, options) {
270
+ export function useGetCartUpsellAddons(cartId, limit, options) {
271
271
  return useQueryUnwrapped({
272
272
  queryKey: cartId ? queryKeys.public.carts.upsellAddons(cartId) : ['public', 'carts', 'upsell-addons'],
273
- queryFn: () => fetchCartUpsellAddons(cartId),
273
+ queryFn: () => fetchCartUpsellAddons(cartId, limit),
274
274
  enabled: !!cartId,
275
275
  ...options,
276
276
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instockng/api-client",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "React Query hooks for OMS API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",