@simpleapps-com/augur-hooks 2.0.3 → 2.0.4

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.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { G as GetItemCategoryApiOptions, B as BatchInvMastDocParam, P as PageData, S as SearchSuggestionsResponse, a as SearchSuggestion, A as AugurCallbacks, b as AugurApiClient, c as PersistenceConfig } from './customer-quotes-DIpZNjT1.cjs';
2
- export { d as AugurHooksProvider, e as BatchQueryConfig, f as executeBatchQuery, g as getBatchInvMastDocKey, h as getBatchInvMastDocOptions, i as getCartPricingQueryOptions, j as getCategoryItemsInfiniteKey, k as getCategoryItemsInfiniteOptions, l as getCustomerInvoiceDetailKey, m as getCustomerInvoicesKey, n as getCustomerOrderDetailKey, o as getCustomerOrdersKey, p as getCustomerQuoteDetailKey, q as getCustomerQuotesKey, r as getInvMastDocKey, s as getInvMastDocOptions, t as getInvMastKey, u as getInvMastOptions, v as getInvMastStockKey, w as getInvMastStockOptions, x as getItemAttributesKey, y as getItemAttributesOptions, z as getItemCategoryKey, C as getItemCategoryOptions, D as getItemDetailsKey, E as getItemDetailsOptions, F as getItemPriceKey, H as getItemPriceOptions, I as getItemSearchInfiniteKey, J as getItemSearchInfiniteOptions, K as getJoomlaContentKey, L as getJoomlaContentListKey, M as getJoomlaContentListOptions, N as getJoomlaContentOptions, O as getJoomlaMenuDocKey, Q as getJoomlaMenuDocOptions, R as getJoomlaMenuKey, T as getJoomlaMenuOptions, U as getProductCategoryKey, V as getProductCategoryOptions, W as getProductSearchKey, X as getProductSearchOptions, Y as getSearchSuggestionsKey, Z as getSearchSuggestionsOptions, _ as getStockKey, $ as getStockOptions, a0 as useAugurApi, a1 as useAugurApiOptional, a2 as useAugurAuth, a3 as useAugurCache, a4 as useAugurOptions, a5 as useAugurSite } from './customer-quotes-DIpZNjT1.cjs';
3
- import { InfiniteScrollPage, CacheConfig, AugurAuthContext } from '@simpleapps-com/augur-core';
1
+ import { G as GetItemCategoryApiOptions, B as BatchInvMastDocParam, P as PageData, A as AugurCallbacks, a as AugurApiClient, b as PersistenceConfig } from './customer-quotes-iSzQcffc.cjs';
2
+ export { c as AugurHooksProvider, d as BatchQueryConfig, e as executeBatchQuery, g as getBatchInvMastDocKey, f as getBatchInvMastDocOptions, h as getCartPricingQueryOptions, i as getCategoryItemsInfiniteKey, j as getCategoryItemsInfiniteOptions, k as getCustomerInvoiceDetailKey, l as getCustomerInvoicesKey, m as getCustomerOrderDetailKey, n as getCustomerOrdersKey, o as getCustomerQuoteDetailKey, p as getCustomerQuotesKey, q as getInvMastDocKey, r as getInvMastDocOptions, s as getInvMastKey, t as getInvMastOptions, u as getInvMastStockKey, v as getInvMastStockOptions, w as getItemAttributesKey, x as getItemAttributesOptions, y as getItemCategoryKey, z as getItemCategoryOptions, C as getItemDetailsKey, D as getItemDetailsOptions, E as getItemPriceKey, F as getItemPriceOptions, H as getItemSearchInfiniteKey, I as getItemSearchInfiniteOptions, J as getJoomlaContentKey, K as getJoomlaContentListKey, L as getJoomlaContentListOptions, M as getJoomlaContentOptions, N as getJoomlaMenuDocKey, O as getJoomlaMenuDocOptions, Q as getJoomlaMenuKey, R as getJoomlaMenuOptions, S as getProductCategoryKey, T as getProductCategoryOptions, U as getProductSearchKey, V as getProductSearchOptions, W as getSearchSuggestionsKey, X as getSearchSuggestionsOptions, Y as getStockKey, Z as getStockOptions, _ as useAugurApi, $ as useAugurApiOptional, a0 as useAugurAuth, a1 as useAugurCache, a2 as useAugurOptions, a3 as useAugurSite } from './customer-quotes-iSzQcffc.cjs';
3
+ import { InfiniteScrollPage, ListResult, CacheConfig, AugurAuthContext } from '@simpleapps-com/augur-core';
4
4
  export { AugurAuthContext, AugurSiteConfig, AugurSiteDefaults, AugurSiteFormatting, CacheConfig, CacheProvider, CacheTierConfig, DeepQueryOptions, EdgeCacheValue, InfiniteScrollPage, ProxyMutationOptions, ProxyQueryOptions } from '@simpleapps-com/augur-core';
5
5
  import * as zustand from 'zustand';
6
6
  import * as _simpleapps_com_augur_utils from '@simpleapps-com/augur-utils';
7
- import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TStock, TAttribute, TJoomlaContent, TJoomlaContentFilters, MenuItem, TMenuFilters, ImageConfig, ImageUrlOptions } from '@simpleapps-com/augur-utils';
8
- export { DerivePriceInput, DerivedPrice, ResolveStockInput, ResolvedStock } from '@simpleapps-com/augur-utils';
7
+ import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TStock, TAttribute, TSearchSuggestionsResponse, TJoomlaContent, TJoomlaContentFilters, MenuItem, TMenuFilters, ImageConfig, ImageUrlOptions } from '@simpleapps-com/augur-utils';
8
+ export { DerivePriceInput, DerivedPrice, ResolveStockInput, ResolvedStock, TSearchSuggestion as SearchSuggestion, TSearchSuggestionsResponse as SearchSuggestionsResponse } from '@simpleapps-com/augur-utils';
9
9
  import * as _tanstack_react_query from '@tanstack/react-query';
10
10
  import { QueryKey } from '@tanstack/react-query';
11
11
  import { ReactNode, createElement } from 'react';
@@ -484,6 +484,7 @@ interface UseProductSearchOptions {
484
484
  declare function useProductSearch(pageData: PageData, options?: UseProductSearchOptions): {
485
485
  productItems: unknown[] | null;
486
486
  total: number;
487
+ result: ProductSearchResponse | undefined;
487
488
  loading: boolean;
488
489
  error: Error | null;
489
490
  };
@@ -493,7 +494,7 @@ interface UseSearchSuggestionsOptions {
493
494
  limit?: number;
494
495
  offset?: number;
495
496
  /** Override the default queryFn (e.g. with a cached server action). */
496
- queryFn?: () => Promise<SearchSuggestionsResponse>;
497
+ queryFn?: () => Promise<TSearchSuggestionsResponse>;
497
498
  }
498
499
  /**
499
500
  * @deprecated Use `useQuery(q.opensearch.suggestions.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
@@ -502,8 +503,13 @@ interface UseSearchSuggestionsOptions {
502
503
  * Replaces the ampro-online pattern of fetching from a Next.js API route.
503
504
  */
504
505
  declare function useSearchSuggestions(query: string, options?: UseSearchSuggestionsOptions): {
505
- suggestions: SearchSuggestion[];
506
+ suggestions: _simpleapps_com_augur_utils.TSearchSuggestion[];
506
507
  total: number;
508
+ count: number | undefined;
509
+ totalResults: number | undefined;
510
+ message: string | undefined;
511
+ status: number | undefined;
512
+ result: TSearchSuggestionsResponse | undefined;
507
513
  isLoading: boolean;
508
514
  error: Error | null;
509
515
  };
@@ -735,25 +741,37 @@ declare function useJoomlaContent(articleId: number | string | undefined, option
735
741
 
736
742
  interface UseJoomlaContentListOptions {
737
743
  enabled?: boolean;
738
- queryFn?: () => Promise<TJoomlaContent[]>;
744
+ queryFn?: () => Promise<ListResult<TJoomlaContent>>;
739
745
  filters?: Partial<TJoomlaContentFilters>;
740
746
  }
741
747
  /** @deprecated Use `useQuery(q.joomla.content.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version. */
742
748
  declare function useJoomlaContentList(categoryId: number | string | undefined, options?: UseJoomlaContentListOptions): {
743
749
  articles: TJoomlaContent[];
744
- isLoading: boolean;
750
+ total: number;
751
+ count: number | undefined;
752
+ totalResults: number | undefined;
753
+ message: string | undefined;
754
+ status: number | undefined;
755
+ result: ListResult<TJoomlaContent>;
756
+ isLoading: false;
745
757
  error: Error | null;
746
758
  };
747
759
 
748
760
  interface UseJoomlaMenuOptions {
749
761
  enabled?: boolean;
750
- queryFn?: () => Promise<MenuItem[]>;
762
+ queryFn?: () => Promise<ListResult<MenuItem>>;
751
763
  filters?: Partial<TMenuFilters>;
752
764
  }
753
765
  /** @deprecated Use `useQuery(q.joomla.menu.list(id))` with `useAugurOptions()` instead. Will be removed in the next major version. */
754
766
  declare function useJoomlaMenu(options?: UseJoomlaMenuOptions): {
755
767
  menuItems: MenuItem[];
756
- isLoading: boolean;
768
+ total: number;
769
+ count: number | undefined;
770
+ totalResults: number | undefined;
771
+ message: string | undefined;
772
+ status: number | undefined;
773
+ result: ListResult<MenuItem>;
774
+ isLoading: false;
757
775
  error: Error | null;
758
776
  };
759
777
 
@@ -768,18 +786,19 @@ declare function useJoomlaMenuDoc(menuId: number | string | undefined, options?:
768
786
  error: Error | null;
769
787
  };
770
788
 
771
- interface CustomerListResult$2 {
772
- data: unknown[];
773
- total: number;
774
- }
775
789
  interface UseCustomerOrdersOptions {
776
790
  enabled?: boolean;
777
- queryFn?: () => Promise<CustomerListResult$2>;
791
+ queryFn?: () => Promise<ListResult>;
778
792
  }
779
793
  /** @deprecated Use `useQuery(q.customers.customer.orders.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
780
794
  declare function useCustomerOrders(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerOrdersOptions): {
781
795
  orders: unknown[];
782
796
  total: number;
797
+ count: number | undefined;
798
+ totalResults: number | undefined;
799
+ message: string | undefined;
800
+ status: number | undefined;
801
+ result: ListResult;
783
802
  isLoading: boolean;
784
803
  error: Error | null;
785
804
  };
@@ -794,18 +813,19 @@ declare function useOrderDetail(customerId?: number | string, orderId?: number |
794
813
  error: Error | null;
795
814
  };
796
815
 
797
- interface CustomerListResult$1 {
798
- data: unknown[];
799
- total: number;
800
- }
801
816
  interface UseCustomerInvoicesOptions {
802
817
  enabled?: boolean;
803
- queryFn?: () => Promise<CustomerListResult$1>;
818
+ queryFn?: () => Promise<ListResult>;
804
819
  }
805
820
  /** @deprecated Use `useQuery(q.customers.customer.invoices.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
806
821
  declare function useCustomerInvoices(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerInvoicesOptions): {
807
822
  invoices: unknown[];
808
823
  total: number;
824
+ count: number | undefined;
825
+ totalResults: number | undefined;
826
+ message: string | undefined;
827
+ status: number | undefined;
828
+ result: ListResult;
809
829
  isLoading: boolean;
810
830
  error: Error | null;
811
831
  };
@@ -820,18 +840,19 @@ declare function useInvoiceDetail(customerId?: number | string, invoiceNo?: numb
820
840
  error: Error | null;
821
841
  };
822
842
 
823
- interface CustomerListResult {
824
- data: unknown[];
825
- total: number;
826
- }
827
843
  interface UseCustomerQuotesOptions {
828
844
  enabled?: boolean;
829
- queryFn?: () => Promise<CustomerListResult>;
845
+ queryFn?: () => Promise<ListResult>;
830
846
  }
831
847
  /** @deprecated Use `useQuery(q.customers.customer.quotes.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
832
848
  declare function useCustomerQuotes(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerQuotesOptions): {
833
849
  quotes: unknown[];
834
850
  total: number;
851
+ count: number | undefined;
852
+ totalResults: number | undefined;
853
+ message: string | undefined;
854
+ status: number | undefined;
855
+ result: ListResult;
835
856
  isLoading: boolean;
836
857
  error: Error | null;
837
858
  };
@@ -858,7 +879,7 @@ declare function useQuoteDetail(customerId?: number | string, quoteNo?: number |
858
879
  *
859
880
  * export const augur = createSiteHooks({
860
881
  * callbacks: { getItemPrice, getItemCategory },
861
- * defaultCustomerId: process.env.NEXT_PUBLIC_DEFAULT_CUSTOMER_ID,
882
+ * // defaultCustomerId falls back to DEFAULT_CUSTOMER_ID env var automatically
862
883
  * });
863
884
  *
864
885
  * // app/layout.tsx
@@ -982,4 +1003,4 @@ declare function useAugurPersistence(config: PersistenceConfig): {
982
1003
  };
983
1004
  };
984
1005
 
985
- export { AugurApiClient, AugurCallbacks, BatchInvMastDocParam, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, type FormatPriceCallOptions, GetItemCategoryApiOptions, PageData, PersistenceConfig, SearchSuggestion, SearchSuggestionsResponse, type UseFormatPriceOptions, type UseStockOptions, createSiteHooks, useAugurPersistence, useBatchInvMastDoc, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useCustomerInvoices, useCustomerOrders, useCustomerQuotes, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useInvoiceDetail, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, useJoomlaMenu, useJoomlaMenuDoc, useOrderDetail, usePaginationPrefetch, useProductCategory, useProductSearch, useQuoteDetail, useSearchSuggestions, useSetCartHdrUid, useSetCartLines, useStock };
1006
+ export { AugurApiClient, AugurCallbacks, BatchInvMastDocParam, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, type FormatPriceCallOptions, GetItemCategoryApiOptions, PageData, PersistenceConfig, type UseFormatPriceOptions, type UseStockOptions, createSiteHooks, useAugurPersistence, useBatchInvMastDoc, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useCustomerInvoices, useCustomerOrders, useCustomerQuotes, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useInvoiceDetail, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, useJoomlaMenu, useJoomlaMenuDoc, useOrderDetail, usePaginationPrefetch, useProductCategory, useProductSearch, useQuoteDetail, useSearchSuggestions, useSetCartHdrUid, useSetCartLines, useStock };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { G as GetItemCategoryApiOptions, B as BatchInvMastDocParam, P as PageData, S as SearchSuggestionsResponse, a as SearchSuggestion, A as AugurCallbacks, b as AugurApiClient, c as PersistenceConfig } from './customer-quotes-DIpZNjT1.js';
2
- export { d as AugurHooksProvider, e as BatchQueryConfig, f as executeBatchQuery, g as getBatchInvMastDocKey, h as getBatchInvMastDocOptions, i as getCartPricingQueryOptions, j as getCategoryItemsInfiniteKey, k as getCategoryItemsInfiniteOptions, l as getCustomerInvoiceDetailKey, m as getCustomerInvoicesKey, n as getCustomerOrderDetailKey, o as getCustomerOrdersKey, p as getCustomerQuoteDetailKey, q as getCustomerQuotesKey, r as getInvMastDocKey, s as getInvMastDocOptions, t as getInvMastKey, u as getInvMastOptions, v as getInvMastStockKey, w as getInvMastStockOptions, x as getItemAttributesKey, y as getItemAttributesOptions, z as getItemCategoryKey, C as getItemCategoryOptions, D as getItemDetailsKey, E as getItemDetailsOptions, F as getItemPriceKey, H as getItemPriceOptions, I as getItemSearchInfiniteKey, J as getItemSearchInfiniteOptions, K as getJoomlaContentKey, L as getJoomlaContentListKey, M as getJoomlaContentListOptions, N as getJoomlaContentOptions, O as getJoomlaMenuDocKey, Q as getJoomlaMenuDocOptions, R as getJoomlaMenuKey, T as getJoomlaMenuOptions, U as getProductCategoryKey, V as getProductCategoryOptions, W as getProductSearchKey, X as getProductSearchOptions, Y as getSearchSuggestionsKey, Z as getSearchSuggestionsOptions, _ as getStockKey, $ as getStockOptions, a0 as useAugurApi, a1 as useAugurApiOptional, a2 as useAugurAuth, a3 as useAugurCache, a4 as useAugurOptions, a5 as useAugurSite } from './customer-quotes-DIpZNjT1.js';
3
- import { InfiniteScrollPage, CacheConfig, AugurAuthContext } from '@simpleapps-com/augur-core';
1
+ import { G as GetItemCategoryApiOptions, B as BatchInvMastDocParam, P as PageData, A as AugurCallbacks, a as AugurApiClient, b as PersistenceConfig } from './customer-quotes-iSzQcffc.js';
2
+ export { c as AugurHooksProvider, d as BatchQueryConfig, e as executeBatchQuery, g as getBatchInvMastDocKey, f as getBatchInvMastDocOptions, h as getCartPricingQueryOptions, i as getCategoryItemsInfiniteKey, j as getCategoryItemsInfiniteOptions, k as getCustomerInvoiceDetailKey, l as getCustomerInvoicesKey, m as getCustomerOrderDetailKey, n as getCustomerOrdersKey, o as getCustomerQuoteDetailKey, p as getCustomerQuotesKey, q as getInvMastDocKey, r as getInvMastDocOptions, s as getInvMastKey, t as getInvMastOptions, u as getInvMastStockKey, v as getInvMastStockOptions, w as getItemAttributesKey, x as getItemAttributesOptions, y as getItemCategoryKey, z as getItemCategoryOptions, C as getItemDetailsKey, D as getItemDetailsOptions, E as getItemPriceKey, F as getItemPriceOptions, H as getItemSearchInfiniteKey, I as getItemSearchInfiniteOptions, J as getJoomlaContentKey, K as getJoomlaContentListKey, L as getJoomlaContentListOptions, M as getJoomlaContentOptions, N as getJoomlaMenuDocKey, O as getJoomlaMenuDocOptions, Q as getJoomlaMenuKey, R as getJoomlaMenuOptions, S as getProductCategoryKey, T as getProductCategoryOptions, U as getProductSearchKey, V as getProductSearchOptions, W as getSearchSuggestionsKey, X as getSearchSuggestionsOptions, Y as getStockKey, Z as getStockOptions, _ as useAugurApi, $ as useAugurApiOptional, a0 as useAugurAuth, a1 as useAugurCache, a2 as useAugurOptions, a3 as useAugurSite } from './customer-quotes-iSzQcffc.js';
3
+ import { InfiniteScrollPage, ListResult, CacheConfig, AugurAuthContext } from '@simpleapps-com/augur-core';
4
4
  export { AugurAuthContext, AugurSiteConfig, AugurSiteDefaults, AugurSiteFormatting, CacheConfig, CacheProvider, CacheTierConfig, DeepQueryOptions, EdgeCacheValue, InfiniteScrollPage, ProxyMutationOptions, ProxyQueryOptions } from '@simpleapps-com/augur-core';
5
5
  import * as zustand from 'zustand';
6
6
  import * as _simpleapps_com_augur_utils from '@simpleapps-com/augur-utils';
7
- import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TStock, TAttribute, TJoomlaContent, TJoomlaContentFilters, MenuItem, TMenuFilters, ImageConfig, ImageUrlOptions } from '@simpleapps-com/augur-utils';
8
- export { DerivePriceInput, DerivedPrice, ResolveStockInput, ResolvedStock } from '@simpleapps-com/augur-utils';
7
+ import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TStock, TAttribute, TSearchSuggestionsResponse, TJoomlaContent, TJoomlaContentFilters, MenuItem, TMenuFilters, ImageConfig, ImageUrlOptions } from '@simpleapps-com/augur-utils';
8
+ export { DerivePriceInput, DerivedPrice, ResolveStockInput, ResolvedStock, TSearchSuggestion as SearchSuggestion, TSearchSuggestionsResponse as SearchSuggestionsResponse } from '@simpleapps-com/augur-utils';
9
9
  import * as _tanstack_react_query from '@tanstack/react-query';
10
10
  import { QueryKey } from '@tanstack/react-query';
11
11
  import { ReactNode, createElement } from 'react';
@@ -484,6 +484,7 @@ interface UseProductSearchOptions {
484
484
  declare function useProductSearch(pageData: PageData, options?: UseProductSearchOptions): {
485
485
  productItems: unknown[] | null;
486
486
  total: number;
487
+ result: ProductSearchResponse | undefined;
487
488
  loading: boolean;
488
489
  error: Error | null;
489
490
  };
@@ -493,7 +494,7 @@ interface UseSearchSuggestionsOptions {
493
494
  limit?: number;
494
495
  offset?: number;
495
496
  /** Override the default queryFn (e.g. with a cached server action). */
496
- queryFn?: () => Promise<SearchSuggestionsResponse>;
497
+ queryFn?: () => Promise<TSearchSuggestionsResponse>;
497
498
  }
498
499
  /**
499
500
  * @deprecated Use `useQuery(q.opensearch.suggestions.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
@@ -502,8 +503,13 @@ interface UseSearchSuggestionsOptions {
502
503
  * Replaces the ampro-online pattern of fetching from a Next.js API route.
503
504
  */
504
505
  declare function useSearchSuggestions(query: string, options?: UseSearchSuggestionsOptions): {
505
- suggestions: SearchSuggestion[];
506
+ suggestions: _simpleapps_com_augur_utils.TSearchSuggestion[];
506
507
  total: number;
508
+ count: number | undefined;
509
+ totalResults: number | undefined;
510
+ message: string | undefined;
511
+ status: number | undefined;
512
+ result: TSearchSuggestionsResponse | undefined;
507
513
  isLoading: boolean;
508
514
  error: Error | null;
509
515
  };
@@ -735,25 +741,37 @@ declare function useJoomlaContent(articleId: number | string | undefined, option
735
741
 
736
742
  interface UseJoomlaContentListOptions {
737
743
  enabled?: boolean;
738
- queryFn?: () => Promise<TJoomlaContent[]>;
744
+ queryFn?: () => Promise<ListResult<TJoomlaContent>>;
739
745
  filters?: Partial<TJoomlaContentFilters>;
740
746
  }
741
747
  /** @deprecated Use `useQuery(q.joomla.content.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version. */
742
748
  declare function useJoomlaContentList(categoryId: number | string | undefined, options?: UseJoomlaContentListOptions): {
743
749
  articles: TJoomlaContent[];
744
- isLoading: boolean;
750
+ total: number;
751
+ count: number | undefined;
752
+ totalResults: number | undefined;
753
+ message: string | undefined;
754
+ status: number | undefined;
755
+ result: ListResult<TJoomlaContent>;
756
+ isLoading: false;
745
757
  error: Error | null;
746
758
  };
747
759
 
748
760
  interface UseJoomlaMenuOptions {
749
761
  enabled?: boolean;
750
- queryFn?: () => Promise<MenuItem[]>;
762
+ queryFn?: () => Promise<ListResult<MenuItem>>;
751
763
  filters?: Partial<TMenuFilters>;
752
764
  }
753
765
  /** @deprecated Use `useQuery(q.joomla.menu.list(id))` with `useAugurOptions()` instead. Will be removed in the next major version. */
754
766
  declare function useJoomlaMenu(options?: UseJoomlaMenuOptions): {
755
767
  menuItems: MenuItem[];
756
- isLoading: boolean;
768
+ total: number;
769
+ count: number | undefined;
770
+ totalResults: number | undefined;
771
+ message: string | undefined;
772
+ status: number | undefined;
773
+ result: ListResult<MenuItem>;
774
+ isLoading: false;
757
775
  error: Error | null;
758
776
  };
759
777
 
@@ -768,18 +786,19 @@ declare function useJoomlaMenuDoc(menuId: number | string | undefined, options?:
768
786
  error: Error | null;
769
787
  };
770
788
 
771
- interface CustomerListResult$2 {
772
- data: unknown[];
773
- total: number;
774
- }
775
789
  interface UseCustomerOrdersOptions {
776
790
  enabled?: boolean;
777
- queryFn?: () => Promise<CustomerListResult$2>;
791
+ queryFn?: () => Promise<ListResult>;
778
792
  }
779
793
  /** @deprecated Use `useQuery(q.customers.customer.orders.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
780
794
  declare function useCustomerOrders(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerOrdersOptions): {
781
795
  orders: unknown[];
782
796
  total: number;
797
+ count: number | undefined;
798
+ totalResults: number | undefined;
799
+ message: string | undefined;
800
+ status: number | undefined;
801
+ result: ListResult;
783
802
  isLoading: boolean;
784
803
  error: Error | null;
785
804
  };
@@ -794,18 +813,19 @@ declare function useOrderDetail(customerId?: number | string, orderId?: number |
794
813
  error: Error | null;
795
814
  };
796
815
 
797
- interface CustomerListResult$1 {
798
- data: unknown[];
799
- total: number;
800
- }
801
816
  interface UseCustomerInvoicesOptions {
802
817
  enabled?: boolean;
803
- queryFn?: () => Promise<CustomerListResult$1>;
818
+ queryFn?: () => Promise<ListResult>;
804
819
  }
805
820
  /** @deprecated Use `useQuery(q.customers.customer.invoices.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
806
821
  declare function useCustomerInvoices(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerInvoicesOptions): {
807
822
  invoices: unknown[];
808
823
  total: number;
824
+ count: number | undefined;
825
+ totalResults: number | undefined;
826
+ message: string | undefined;
827
+ status: number | undefined;
828
+ result: ListResult;
809
829
  isLoading: boolean;
810
830
  error: Error | null;
811
831
  };
@@ -820,18 +840,19 @@ declare function useInvoiceDetail(customerId?: number | string, invoiceNo?: numb
820
840
  error: Error | null;
821
841
  };
822
842
 
823
- interface CustomerListResult {
824
- data: unknown[];
825
- total: number;
826
- }
827
843
  interface UseCustomerQuotesOptions {
828
844
  enabled?: boolean;
829
- queryFn?: () => Promise<CustomerListResult>;
845
+ queryFn?: () => Promise<ListResult>;
830
846
  }
831
847
  /** @deprecated Use `useQuery(q.customers.customer.quotes.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
832
848
  declare function useCustomerQuotes(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerQuotesOptions): {
833
849
  quotes: unknown[];
834
850
  total: number;
851
+ count: number | undefined;
852
+ totalResults: number | undefined;
853
+ message: string | undefined;
854
+ status: number | undefined;
855
+ result: ListResult;
835
856
  isLoading: boolean;
836
857
  error: Error | null;
837
858
  };
@@ -858,7 +879,7 @@ declare function useQuoteDetail(customerId?: number | string, quoteNo?: number |
858
879
  *
859
880
  * export const augur = createSiteHooks({
860
881
  * callbacks: { getItemPrice, getItemCategory },
861
- * defaultCustomerId: process.env.NEXT_PUBLIC_DEFAULT_CUSTOMER_ID,
882
+ * // defaultCustomerId falls back to DEFAULT_CUSTOMER_ID env var automatically
862
883
  * });
863
884
  *
864
885
  * // app/layout.tsx
@@ -982,4 +1003,4 @@ declare function useAugurPersistence(config: PersistenceConfig): {
982
1003
  };
983
1004
  };
984
1005
 
985
- export { AugurApiClient, AugurCallbacks, BatchInvMastDocParam, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, type FormatPriceCallOptions, GetItemCategoryApiOptions, PageData, PersistenceConfig, SearchSuggestion, SearchSuggestionsResponse, type UseFormatPriceOptions, type UseStockOptions, createSiteHooks, useAugurPersistence, useBatchInvMastDoc, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useCustomerInvoices, useCustomerOrders, useCustomerQuotes, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useInvoiceDetail, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, useJoomlaMenu, useJoomlaMenuDoc, useOrderDetail, usePaginationPrefetch, useProductCategory, useProductSearch, useQuoteDetail, useSearchSuggestions, useSetCartHdrUid, useSetCartLines, useStock };
1006
+ export { AugurApiClient, AugurCallbacks, BatchInvMastDocParam, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, type FormatPriceCallOptions, GetItemCategoryApiOptions, PageData, PersistenceConfig, type UseFormatPriceOptions, type UseStockOptions, createSiteHooks, useAugurPersistence, useBatchInvMastDoc, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useCustomerInvoices, useCustomerOrders, useCustomerQuotes, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useInvoiceDetail, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, useJoomlaMenu, useJoomlaMenuDoc, useOrderDetail, usePaginationPrefetch, useProductCategory, useProductSearch, useQuoteDetail, useSearchSuggestions, useSetCartHdrUid, useSetCartLines, useStock };
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  getSearchSuggestionsOptions,
44
44
  getStockKey,
45
45
  getStockOptions
46
- } from "./chunk-4RSFZ6WY.js";
46
+ } from "./chunk-PP74YBNR.js";
47
47
  import {
48
48
  useImageWithFallback
49
49
  } from "./chunk-LTBEP4MC.js";
@@ -515,6 +515,7 @@ function useProductSearch(pageData, options = {}) {
515
515
  return {
516
516
  productItems: data?.items ?? null,
517
517
  total: data?.totalResults ?? 0,
518
+ result: data,
518
519
  loading: isLoading,
519
520
  error
520
521
  };
@@ -538,6 +539,11 @@ function useSearchSuggestions(query, options = {}) {
538
539
  return {
539
540
  suggestions: data?.data ?? [],
540
541
  total: data?.total ?? 0,
542
+ count: data?.count,
543
+ totalResults: data?.totalResults,
544
+ message: data?.message,
545
+ status: data?.status,
546
+ result: data,
541
547
  isLoading,
542
548
  error
543
549
  };
@@ -1019,6 +1025,7 @@ function useJoomlaContent(articleId, options = {}) {
1019
1025
 
1020
1026
  // src/hooks/use-joomla-content-list.ts
1021
1027
  import { useQuery as useQuery15 } from "@tanstack/react-query";
1028
+ var EMPTY_LIST = { data: [], total: 0 };
1022
1029
  function useJoomlaContentList(categoryId, options = {}) {
1023
1030
  const api = useAugurApiOptional();
1024
1031
  const callbacks = useAugurCallbacks();
@@ -1033,9 +1040,17 @@ function useJoomlaContentList(categoryId, options = {}) {
1033
1040
  queryFn: options.queryFn ?? (() => callbacks.getJoomlaContentList(categoryId, options.filters))
1034
1041
  } : {},
1035
1042
  enabled: (options.enabled ?? true) && !!categoryId
1043
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1036
1044
  });
1045
+ const result = data || EMPTY_LIST;
1037
1046
  return {
1038
- articles: data ?? [],
1047
+ articles: result.data,
1048
+ total: result.total,
1049
+ count: result.count,
1050
+ totalResults: result.totalResults,
1051
+ message: result.message,
1052
+ status: result.status,
1053
+ result,
1039
1054
  isLoading,
1040
1055
  error
1041
1056
  };
@@ -1043,6 +1058,7 @@ function useJoomlaContentList(categoryId, options = {}) {
1043
1058
 
1044
1059
  // src/hooks/use-joomla-menu.ts
1045
1060
  import { useQuery as useQuery16 } from "@tanstack/react-query";
1061
+ var EMPTY_LIST2 = { data: [], total: 0 };
1046
1062
  function useJoomlaMenu(options = {}) {
1047
1063
  const api = useAugurApiOptional();
1048
1064
  const callbacks = useAugurCallbacks();
@@ -1053,9 +1069,17 @@ function useJoomlaMenu(options = {}) {
1053
1069
  queryFn: options.queryFn ?? (() => callbacks.getJoomlaMenu(options.filters))
1054
1070
  } : {},
1055
1071
  enabled: options.enabled ?? true
1072
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1056
1073
  });
1074
+ const result = data || EMPTY_LIST2;
1057
1075
  return {
1058
- menuItems: data ?? [],
1076
+ menuItems: result.data,
1077
+ total: result.total,
1078
+ count: result.count,
1079
+ totalResults: result.totalResults,
1080
+ message: result.message,
1081
+ status: result.status,
1082
+ result,
1059
1083
  isLoading,
1060
1084
  error
1061
1085
  };
@@ -1085,7 +1109,7 @@ function useJoomlaMenuDoc(menuId, options = {}) {
1085
1109
 
1086
1110
  // src/hooks/use-customer-orders.ts
1087
1111
  import { useQuery as useQuery18 } from "@tanstack/react-query";
1088
- var EMPTY_LIST = { data: [], total: 0 };
1112
+ var EMPTY_LIST3 = { data: [], total: 0 };
1089
1113
  function useCustomerOrders(customerId, params, options = {}) {
1090
1114
  const callbacks = useAugurCallbacks();
1091
1115
  const auth = useAugurAuth();
@@ -1098,10 +1122,15 @@ function useCustomerOrders(customerId, params, options = {}) {
1098
1122
  queryFn: resolvedQueryFn,
1099
1123
  enabled
1100
1124
  });
1101
- const result = data || EMPTY_LIST;
1125
+ const result = data || EMPTY_LIST3;
1102
1126
  return {
1103
1127
  orders: result.data,
1104
1128
  total: result.total,
1129
+ count: result.count,
1130
+ totalResults: result.totalResults,
1131
+ message: result.message,
1132
+ status: result.status,
1133
+ result,
1105
1134
  isLoading,
1106
1135
  error
1107
1136
  };
@@ -1127,7 +1156,7 @@ function useOrderDetail(customerId, orderId, options = {}) {
1127
1156
 
1128
1157
  // src/hooks/use-customer-invoices.ts
1129
1158
  import { useQuery as useQuery19 } from "@tanstack/react-query";
1130
- var EMPTY_LIST2 = { data: [], total: 0 };
1159
+ var EMPTY_LIST4 = { data: [], total: 0 };
1131
1160
  function useCustomerInvoices(customerId, params, options = {}) {
1132
1161
  const callbacks = useAugurCallbacks();
1133
1162
  const auth = useAugurAuth();
@@ -1140,10 +1169,15 @@ function useCustomerInvoices(customerId, params, options = {}) {
1140
1169
  queryFn: resolvedQueryFn,
1141
1170
  enabled
1142
1171
  });
1143
- const result = data || EMPTY_LIST2;
1172
+ const result = data || EMPTY_LIST4;
1144
1173
  return {
1145
1174
  invoices: result.data,
1146
1175
  total: result.total,
1176
+ count: result.count,
1177
+ totalResults: result.totalResults,
1178
+ message: result.message,
1179
+ status: result.status,
1180
+ result,
1147
1181
  isLoading,
1148
1182
  error
1149
1183
  };
@@ -1169,7 +1203,7 @@ function useInvoiceDetail(customerId, invoiceNo, options = {}) {
1169
1203
 
1170
1204
  // src/hooks/use-customer-quotes.ts
1171
1205
  import { useQuery as useQuery20 } from "@tanstack/react-query";
1172
- var EMPTY_LIST3 = { data: [], total: 0 };
1206
+ var EMPTY_LIST5 = { data: [], total: 0 };
1173
1207
  function useCustomerQuotes(customerId, params, options = {}) {
1174
1208
  const callbacks = useAugurCallbacks();
1175
1209
  const auth = useAugurAuth();
@@ -1182,10 +1216,15 @@ function useCustomerQuotes(customerId, params, options = {}) {
1182
1216
  queryFn: resolvedQueryFn,
1183
1217
  enabled
1184
1218
  });
1185
- const result = data || EMPTY_LIST3;
1219
+ const result = data || EMPTY_LIST5;
1186
1220
  return {
1187
1221
  quotes: result.data,
1188
1222
  total: result.total,
1223
+ count: result.count,
1224
+ totalResults: result.totalResults,
1225
+ message: result.message,
1226
+ status: result.status,
1227
+ result,
1189
1228
  isLoading,
1190
1229
  error
1191
1230
  };