@simpleapps-com/augur-hooks 1.0.7 → 1.0.8

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.
@@ -1,6 +1,6 @@
1
1
  import * as _simpleapps_com_augur_utils from '@simpleapps-com/augur-utils';
2
2
  import { TPriceData, TItemDetails, TInvMastDoc, TCategory, TAttribute, TItemsFilters, TJoomlaContent, TJoomlaContentFilters, TMenuFilters, MenuItem, TProductCategory, TProductItem } from '@simpleapps-com/augur-utils';
3
- import { InfiniteScrollPage, AugurAuthContext, CacheConfig } from '@simpleapps-com/augur-core';
3
+ import { InfiniteScrollPage, AugurAuthContext, CacheConfig, AugurSiteConfig } from '@simpleapps-com/augur-core';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ReactNode } from 'react';
@@ -196,6 +196,8 @@ interface AugurHooksProviderProps {
196
196
  auth?: AugurAuthContext;
197
197
  /** Optional cache configuration — controls edge and Redis caching per tier. */
198
198
  cache?: CacheConfig;
199
+ /** Optional site configuration — hooks read defaults and formatting from this. */
200
+ site?: AugurSiteConfig;
199
201
  children: ReactNode;
200
202
  }
201
203
  /**
@@ -213,7 +215,7 @@ interface AugurHooksProviderProps {
213
215
  * const { data } = useQuery(q.items.invMast.get(42));
214
216
  * ```
215
217
  */
216
- declare function AugurHooksProvider({ api, callbacks, auth, cache, children, }: AugurHooksProviderProps): react_jsx_runtime.JSX.Element;
218
+ declare function AugurHooksProvider({ api, callbacks, auth, cache, site, children, }: AugurHooksProviderProps): react_jsx_runtime.JSX.Element;
217
219
  /**
218
220
  * Returns the deep proxy for creating TanStack Query options.
219
221
  *
@@ -255,6 +257,11 @@ declare function useAugurAuth(): AugurAuthContext | undefined;
255
257
  * Used internally by hooks to enable edge/Redis caching.
256
258
  */
257
259
  declare function useAugurCache(): CacheConfig | undefined;
260
+ /**
261
+ * Returns the site configuration from the nearest `AugurHooksProvider`.
262
+ * Returns `undefined` when no `site` prop is provided.
263
+ */
264
+ declare function useAugurSite(): AugurSiteConfig | undefined;
258
265
 
259
266
  /**
260
267
  * Generates a consistent query key for item price queries.
@@ -575,4 +582,4 @@ declare const getCustomerQuotesKey: (customerId: number | string | undefined, pa
575
582
  /** @deprecated Use `useAugurOptions()` or `createAugurOptions()` instead — query keys are derived automatically. Will be removed in the next major version. */
576
583
  declare const getCustomerQuoteDetailKey: (customerId: number | string | undefined, quoteNo: number | string | undefined) => readonly ["customerQuoteDetail", string | number | undefined, string | number | undefined];
577
584
 
578
- export { useAugurApiOptional as $, type AugurCallbacks as A, type BatchInvMastDocParam as B, getItemCategoryOptions as C, getItemDetailsKey as D, getItemDetailsOptions as E, getItemPriceKey as F, type GetItemCategoryApiOptions as G, getItemPriceOptions as H, getItemSearchInfiniteKey as I, getItemSearchInfiniteOptions as J, getJoomlaContentKey as K, getJoomlaContentListKey as L, getJoomlaContentListOptions as M, getJoomlaContentOptions as N, getJoomlaMenuDocKey as O, type PageData as P, getJoomlaMenuDocOptions as Q, getJoomlaMenuKey as R, type SearchSuggestionsResponse as S, getJoomlaMenuOptions as T, getProductCategoryKey as U, getProductCategoryOptions as V, getProductSearchKey as W, getProductSearchOptions as X, getSearchSuggestionsKey as Y, getSearchSuggestionsOptions as Z, useAugurApi as _, type SearchSuggestion as a, useAugurAuth as a0, useAugurCache as a1, useAugurOptions as a2, type AugurApiClient as b, type PersistenceConfig as c, AugurHooksProvider as d, type BatchQueryConfig as e, executeBatchQuery as f, getBatchInvMastDocKey as g, getBatchInvMastDocOptions as h, getCartPricingQueryOptions as i, getCategoryItemsInfiniteKey as j, getCategoryItemsInfiniteOptions as k, getCustomerInvoiceDetailKey as l, getCustomerInvoicesKey as m, getCustomerOrderDetailKey as n, getCustomerOrdersKey as o, getCustomerQuoteDetailKey as p, getCustomerQuotesKey as q, getInvMastDocKey as r, getInvMastDocOptions as s, getInvMastKey as t, getInvMastOptions as u, getInvMastStockKey as v, getInvMastStockOptions as w, getItemAttributesKey as x, getItemAttributesOptions as y, getItemCategoryKey as z };
585
+ export { useAugurApiOptional as $, type AugurCallbacks as A, type BatchInvMastDocParam as B, getItemCategoryOptions as C, getItemDetailsKey as D, getItemDetailsOptions as E, getItemPriceKey as F, type GetItemCategoryApiOptions as G, getItemPriceOptions as H, getItemSearchInfiniteKey as I, getItemSearchInfiniteOptions as J, getJoomlaContentKey as K, getJoomlaContentListKey as L, getJoomlaContentListOptions as M, getJoomlaContentOptions as N, getJoomlaMenuDocKey as O, type PageData as P, getJoomlaMenuDocOptions as Q, getJoomlaMenuKey as R, type SearchSuggestionsResponse as S, getJoomlaMenuOptions as T, getProductCategoryKey as U, getProductCategoryOptions as V, getProductSearchKey as W, getProductSearchOptions as X, getSearchSuggestionsKey as Y, getSearchSuggestionsOptions as Z, useAugurApi as _, type SearchSuggestion as a, useAugurAuth as a0, useAugurCache as a1, useAugurOptions as a2, useAugurSite as a3, type AugurApiClient as b, type PersistenceConfig as c, AugurHooksProvider as d, type BatchQueryConfig as e, executeBatchQuery as f, getBatchInvMastDocKey as g, getBatchInvMastDocOptions as h, getCartPricingQueryOptions as i, getCategoryItemsInfiniteKey as j, getCategoryItemsInfiniteOptions as k, getCustomerInvoiceDetailKey as l, getCustomerInvoicesKey as m, getCustomerOrderDetailKey as n, getCustomerOrdersKey as o, getCustomerQuoteDetailKey as p, getCustomerQuotesKey as q, getInvMastDocKey as r, getInvMastDocOptions as s, getInvMastKey as t, getInvMastOptions as u, getInvMastStockKey as v, getInvMastStockOptions as w, getItemAttributesKey as x, getItemAttributesOptions as y, getItemCategoryKey as z };
@@ -1,6 +1,6 @@
1
1
  import * as _simpleapps_com_augur_utils from '@simpleapps-com/augur-utils';
2
2
  import { TPriceData, TItemDetails, TInvMastDoc, TCategory, TAttribute, TItemsFilters, TJoomlaContent, TJoomlaContentFilters, TMenuFilters, MenuItem, TProductCategory, TProductItem } from '@simpleapps-com/augur-utils';
3
- import { InfiniteScrollPage, AugurAuthContext, CacheConfig } from '@simpleapps-com/augur-core';
3
+ import { InfiniteScrollPage, AugurAuthContext, CacheConfig, AugurSiteConfig } from '@simpleapps-com/augur-core';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ReactNode } from 'react';
@@ -196,6 +196,8 @@ interface AugurHooksProviderProps {
196
196
  auth?: AugurAuthContext;
197
197
  /** Optional cache configuration — controls edge and Redis caching per tier. */
198
198
  cache?: CacheConfig;
199
+ /** Optional site configuration — hooks read defaults and formatting from this. */
200
+ site?: AugurSiteConfig;
199
201
  children: ReactNode;
200
202
  }
201
203
  /**
@@ -213,7 +215,7 @@ interface AugurHooksProviderProps {
213
215
  * const { data } = useQuery(q.items.invMast.get(42));
214
216
  * ```
215
217
  */
216
- declare function AugurHooksProvider({ api, callbacks, auth, cache, children, }: AugurHooksProviderProps): react_jsx_runtime.JSX.Element;
218
+ declare function AugurHooksProvider({ api, callbacks, auth, cache, site, children, }: AugurHooksProviderProps): react_jsx_runtime.JSX.Element;
217
219
  /**
218
220
  * Returns the deep proxy for creating TanStack Query options.
219
221
  *
@@ -255,6 +257,11 @@ declare function useAugurAuth(): AugurAuthContext | undefined;
255
257
  * Used internally by hooks to enable edge/Redis caching.
256
258
  */
257
259
  declare function useAugurCache(): CacheConfig | undefined;
260
+ /**
261
+ * Returns the site configuration from the nearest `AugurHooksProvider`.
262
+ * Returns `undefined` when no `site` prop is provided.
263
+ */
264
+ declare function useAugurSite(): AugurSiteConfig | undefined;
258
265
 
259
266
  /**
260
267
  * Generates a consistent query key for item price queries.
@@ -575,4 +582,4 @@ declare const getCustomerQuotesKey: (customerId: number | string | undefined, pa
575
582
  /** @deprecated Use `useAugurOptions()` or `createAugurOptions()` instead — query keys are derived automatically. Will be removed in the next major version. */
576
583
  declare const getCustomerQuoteDetailKey: (customerId: number | string | undefined, quoteNo: number | string | undefined) => readonly ["customerQuoteDetail", string | number | undefined, string | number | undefined];
577
584
 
578
- export { useAugurApiOptional as $, type AugurCallbacks as A, type BatchInvMastDocParam as B, getItemCategoryOptions as C, getItemDetailsKey as D, getItemDetailsOptions as E, getItemPriceKey as F, type GetItemCategoryApiOptions as G, getItemPriceOptions as H, getItemSearchInfiniteKey as I, getItemSearchInfiniteOptions as J, getJoomlaContentKey as K, getJoomlaContentListKey as L, getJoomlaContentListOptions as M, getJoomlaContentOptions as N, getJoomlaMenuDocKey as O, type PageData as P, getJoomlaMenuDocOptions as Q, getJoomlaMenuKey as R, type SearchSuggestionsResponse as S, getJoomlaMenuOptions as T, getProductCategoryKey as U, getProductCategoryOptions as V, getProductSearchKey as W, getProductSearchOptions as X, getSearchSuggestionsKey as Y, getSearchSuggestionsOptions as Z, useAugurApi as _, type SearchSuggestion as a, useAugurAuth as a0, useAugurCache as a1, useAugurOptions as a2, type AugurApiClient as b, type PersistenceConfig as c, AugurHooksProvider as d, type BatchQueryConfig as e, executeBatchQuery as f, getBatchInvMastDocKey as g, getBatchInvMastDocOptions as h, getCartPricingQueryOptions as i, getCategoryItemsInfiniteKey as j, getCategoryItemsInfiniteOptions as k, getCustomerInvoiceDetailKey as l, getCustomerInvoicesKey as m, getCustomerOrderDetailKey as n, getCustomerOrdersKey as o, getCustomerQuoteDetailKey as p, getCustomerQuotesKey as q, getInvMastDocKey as r, getInvMastDocOptions as s, getInvMastKey as t, getInvMastOptions as u, getInvMastStockKey as v, getInvMastStockOptions as w, getItemAttributesKey as x, getItemAttributesOptions as y, getItemCategoryKey as z };
585
+ export { useAugurApiOptional as $, type AugurCallbacks as A, type BatchInvMastDocParam as B, getItemCategoryOptions as C, getItemDetailsKey as D, getItemDetailsOptions as E, getItemPriceKey as F, type GetItemCategoryApiOptions as G, getItemPriceOptions as H, getItemSearchInfiniteKey as I, getItemSearchInfiniteOptions as J, getJoomlaContentKey as K, getJoomlaContentListKey as L, getJoomlaContentListOptions as M, getJoomlaContentOptions as N, getJoomlaMenuDocKey as O, type PageData as P, getJoomlaMenuDocOptions as Q, getJoomlaMenuKey as R, type SearchSuggestionsResponse as S, getJoomlaMenuOptions as T, getProductCategoryKey as U, getProductCategoryOptions as V, getProductSearchKey as W, getProductSearchOptions as X, getSearchSuggestionsKey as Y, getSearchSuggestionsOptions as Z, useAugurApi as _, type SearchSuggestion as a, useAugurAuth as a0, useAugurCache as a1, useAugurOptions as a2, useAugurSite as a3, type AugurApiClient as b, type PersistenceConfig as c, AugurHooksProvider as d, type BatchQueryConfig as e, executeBatchQuery as f, getBatchInvMastDocKey as g, getBatchInvMastDocOptions as h, getCartPricingQueryOptions as i, getCategoryItemsInfiniteKey as j, getCategoryItemsInfiniteOptions as k, getCustomerInvoiceDetailKey as l, getCustomerInvoicesKey as m, getCustomerOrderDetailKey as n, getCustomerOrdersKey as o, getCustomerQuoteDetailKey as p, getCustomerQuotesKey as q, getInvMastDocKey as r, getInvMastDocOptions as s, getInvMastKey as t, getInvMastOptions as u, getInvMastStockKey as v, getInvMastStockOptions as w, getItemAttributesKey as x, getItemAttributesOptions as y, getItemCategoryKey as z };