@simpleapps-com/augur-hooks 0.5.1 → 1.0.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/server.cjs CHANGED
@@ -42,11 +42,12 @@
42
42
 
43
43
 
44
44
 
45
- var _chunkFKM6A6QWcjs = require('./chunk-FKM6A6QW.cjs');
45
+ var _chunk6MD7RJZ2cjs = require('./chunk-6MD7RJZ2.cjs');
46
46
 
47
47
  // src/server.ts
48
48
  var _react = require('react');
49
49
  var _reactquery = require('@tanstack/react-query');
50
+ var _augurcore = require('@simpleapps-com/augur-core');
50
51
  var getQueryClient = _react.cache.call(void 0,
51
52
  () => new (0, _reactquery.QueryClient)({
52
53
  defaultOptions: {
@@ -57,6 +58,10 @@ var getQueryClient = _react.cache.call(void 0,
57
58
  }
58
59
  })
59
60
  );
61
+ function createAugurOptions(api, cacheConfig) {
62
+ const proxyConfig = cacheConfig ? { cache: { static: cacheConfig.static, semiStatic: cacheConfig.semiStatic } } : void 0;
63
+ return _augurcore.createOptionsProxy.call(void 0, api, proxyConfig);
64
+ }
60
65
 
61
66
 
62
67
 
@@ -102,5 +107,6 @@ var getQueryClient = _react.cache.call(void 0,
102
107
 
103
108
 
104
109
 
105
- exports.executeBatchQuery = _chunkFKM6A6QWcjs.executeBatchQuery; exports.getBatchInvMastDocKey = _chunkFKM6A6QWcjs.getBatchInvMastDocKey; exports.getBatchInvMastDocOptions = _chunkFKM6A6QWcjs.getBatchInvMastDocOptions; exports.getCartPricingQueryOptions = _chunkFKM6A6QWcjs.getCartPricingQueryOptions; exports.getCategoryItemsInfiniteKey = _chunkFKM6A6QWcjs.getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = _chunkFKM6A6QWcjs.getCategoryItemsInfiniteOptions; exports.getCustomerInvoiceDetailKey = _chunkFKM6A6QWcjs.getCustomerInvoiceDetailKey; exports.getCustomerInvoicesKey = _chunkFKM6A6QWcjs.getCustomerInvoicesKey; exports.getCustomerOrderDetailKey = _chunkFKM6A6QWcjs.getCustomerOrderDetailKey; exports.getCustomerOrdersKey = _chunkFKM6A6QWcjs.getCustomerOrdersKey; exports.getCustomerQuoteDetailKey = _chunkFKM6A6QWcjs.getCustomerQuoteDetailKey; exports.getCustomerQuotesKey = _chunkFKM6A6QWcjs.getCustomerQuotesKey; exports.getInvMastDocKey = _chunkFKM6A6QWcjs.getInvMastDocKey; exports.getInvMastDocOptions = _chunkFKM6A6QWcjs.getInvMastDocOptions; exports.getInvMastKey = _chunkFKM6A6QWcjs.getInvMastKey; exports.getInvMastOptions = _chunkFKM6A6QWcjs.getInvMastOptions; exports.getInvMastStockKey = _chunkFKM6A6QWcjs.getInvMastStockKey; exports.getInvMastStockOptions = _chunkFKM6A6QWcjs.getInvMastStockOptions; exports.getItemAttributesKey = _chunkFKM6A6QWcjs.getItemAttributesKey; exports.getItemAttributesOptions = _chunkFKM6A6QWcjs.getItemAttributesOptions; exports.getItemCategoryKey = _chunkFKM6A6QWcjs.getItemCategoryKey; exports.getItemCategoryOptions = _chunkFKM6A6QWcjs.getItemCategoryOptions; exports.getItemDetailsKey = _chunkFKM6A6QWcjs.getItemDetailsKey; exports.getItemDetailsOptions = _chunkFKM6A6QWcjs.getItemDetailsOptions; exports.getItemPriceKey = _chunkFKM6A6QWcjs.getItemPriceKey; exports.getItemPriceOptions = _chunkFKM6A6QWcjs.getItemPriceOptions; exports.getItemSearchInfiniteKey = _chunkFKM6A6QWcjs.getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = _chunkFKM6A6QWcjs.getItemSearchInfiniteOptions; exports.getJoomlaContentKey = _chunkFKM6A6QWcjs.getJoomlaContentKey; exports.getJoomlaContentListKey = _chunkFKM6A6QWcjs.getJoomlaContentListKey; exports.getJoomlaContentListOptions = _chunkFKM6A6QWcjs.getJoomlaContentListOptions; exports.getJoomlaContentOptions = _chunkFKM6A6QWcjs.getJoomlaContentOptions; exports.getJoomlaMenuDocKey = _chunkFKM6A6QWcjs.getJoomlaMenuDocKey; exports.getJoomlaMenuDocOptions = _chunkFKM6A6QWcjs.getJoomlaMenuDocOptions; exports.getJoomlaMenuKey = _chunkFKM6A6QWcjs.getJoomlaMenuKey; exports.getJoomlaMenuOptions = _chunkFKM6A6QWcjs.getJoomlaMenuOptions; exports.getProductCategoryKey = _chunkFKM6A6QWcjs.getProductCategoryKey; exports.getProductCategoryOptions = _chunkFKM6A6QWcjs.getProductCategoryOptions; exports.getProductSearchKey = _chunkFKM6A6QWcjs.getProductSearchKey; exports.getProductSearchOptions = _chunkFKM6A6QWcjs.getProductSearchOptions; exports.getQueryClient = getQueryClient; exports.getSearchSuggestionsKey = _chunkFKM6A6QWcjs.getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = _chunkFKM6A6QWcjs.getSearchSuggestionsOptions; exports.stableStringify = _chunkFKM6A6QWcjs.stableStringify;
110
+
111
+ exports.createAugurOptions = createAugurOptions; exports.executeBatchQuery = _chunk6MD7RJZ2cjs.executeBatchQuery; exports.getBatchInvMastDocKey = _chunk6MD7RJZ2cjs.getBatchInvMastDocKey; exports.getBatchInvMastDocOptions = _chunk6MD7RJZ2cjs.getBatchInvMastDocOptions; exports.getCartPricingQueryOptions = _chunk6MD7RJZ2cjs.getCartPricingQueryOptions; exports.getCategoryItemsInfiniteKey = _chunk6MD7RJZ2cjs.getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = _chunk6MD7RJZ2cjs.getCategoryItemsInfiniteOptions; exports.getCustomerInvoiceDetailKey = _chunk6MD7RJZ2cjs.getCustomerInvoiceDetailKey; exports.getCustomerInvoicesKey = _chunk6MD7RJZ2cjs.getCustomerInvoicesKey; exports.getCustomerOrderDetailKey = _chunk6MD7RJZ2cjs.getCustomerOrderDetailKey; exports.getCustomerOrdersKey = _chunk6MD7RJZ2cjs.getCustomerOrdersKey; exports.getCustomerQuoteDetailKey = _chunk6MD7RJZ2cjs.getCustomerQuoteDetailKey; exports.getCustomerQuotesKey = _chunk6MD7RJZ2cjs.getCustomerQuotesKey; exports.getInvMastDocKey = _chunk6MD7RJZ2cjs.getInvMastDocKey; exports.getInvMastDocOptions = _chunk6MD7RJZ2cjs.getInvMastDocOptions; exports.getInvMastKey = _chunk6MD7RJZ2cjs.getInvMastKey; exports.getInvMastOptions = _chunk6MD7RJZ2cjs.getInvMastOptions; exports.getInvMastStockKey = _chunk6MD7RJZ2cjs.getInvMastStockKey; exports.getInvMastStockOptions = _chunk6MD7RJZ2cjs.getInvMastStockOptions; exports.getItemAttributesKey = _chunk6MD7RJZ2cjs.getItemAttributesKey; exports.getItemAttributesOptions = _chunk6MD7RJZ2cjs.getItemAttributesOptions; exports.getItemCategoryKey = _chunk6MD7RJZ2cjs.getItemCategoryKey; exports.getItemCategoryOptions = _chunk6MD7RJZ2cjs.getItemCategoryOptions; exports.getItemDetailsKey = _chunk6MD7RJZ2cjs.getItemDetailsKey; exports.getItemDetailsOptions = _chunk6MD7RJZ2cjs.getItemDetailsOptions; exports.getItemPriceKey = _chunk6MD7RJZ2cjs.getItemPriceKey; exports.getItemPriceOptions = _chunk6MD7RJZ2cjs.getItemPriceOptions; exports.getItemSearchInfiniteKey = _chunk6MD7RJZ2cjs.getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = _chunk6MD7RJZ2cjs.getItemSearchInfiniteOptions; exports.getJoomlaContentKey = _chunk6MD7RJZ2cjs.getJoomlaContentKey; exports.getJoomlaContentListKey = _chunk6MD7RJZ2cjs.getJoomlaContentListKey; exports.getJoomlaContentListOptions = _chunk6MD7RJZ2cjs.getJoomlaContentListOptions; exports.getJoomlaContentOptions = _chunk6MD7RJZ2cjs.getJoomlaContentOptions; exports.getJoomlaMenuDocKey = _chunk6MD7RJZ2cjs.getJoomlaMenuDocKey; exports.getJoomlaMenuDocOptions = _chunk6MD7RJZ2cjs.getJoomlaMenuDocOptions; exports.getJoomlaMenuKey = _chunk6MD7RJZ2cjs.getJoomlaMenuKey; exports.getJoomlaMenuOptions = _chunk6MD7RJZ2cjs.getJoomlaMenuOptions; exports.getProductCategoryKey = _chunk6MD7RJZ2cjs.getProductCategoryKey; exports.getProductCategoryOptions = _chunk6MD7RJZ2cjs.getProductCategoryOptions; exports.getProductSearchKey = _chunk6MD7RJZ2cjs.getProductSearchKey; exports.getProductSearchOptions = _chunk6MD7RJZ2cjs.getProductSearchOptions; exports.getQueryClient = getQueryClient; exports.getSearchSuggestionsKey = _chunk6MD7RJZ2cjs.getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = _chunk6MD7RJZ2cjs.getSearchSuggestionsOptions; exports.stableStringify = _chunk6MD7RJZ2cjs.stableStringify;
106
112
  //# sourceMappingURL=server.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/server.cjs","../src/server.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AC3CA,8BAAsB;AACtB,mDAA4B;AASrB,IAAM,eAAA,EAAiB,0BAAA;AAAA,EAC5B,CAAA,EAAA,GACE,IAAI,4BAAA,CAAY;AAAA,IACd,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS;AAAA,QACP,SAAA,EAAW,GAAA,EAAK,GAAA;AAAA,QAChB,oBAAA,EAAsB;AAAA,MACxB;AAAA,IACF;AAAA,EACF,CAAC;AACL,CAAA;ADoCA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,mpGAAC","file":"/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/server.cjs","sourcesContent":[null,"// @simpleapps-com/augur-hooks/server\n// Query options, keys, and utilities for server-side prefetching in Next.js App Router.\n\nimport { cache } from \"react\";\nimport { QueryClient } from \"@tanstack/react-query\";\n\n/**\n * Returns a per-request singleton QueryClient for React Server Components.\n *\n * React's `cache()` deduplicates calls within a single server request,\n * so layout, page, and header all share the same prefetch cache without\n * leaking state between requests.\n */\nexport const getQueryClient = cache(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n refetchOnWindowFocus: false,\n },\n },\n }),\n);\n\n// All pure query options and keys\nexport * from \"./queries\";\n\n// Callback and auth types for provider-level configuration\nexport type { AugurCallbacks, InfiniteScrollPage, AugurAuthContext } from \"./callbacks\";\n\n// Types needed for server-side usage (type-only, erased at compile time)\nexport type { AugurApiClient } from \"./provider\";\nexport type { PageData, CacheConfig } from \"./types\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/server.cjs","../src/server.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AC3CA,8BAAsB;AACtB,mDAA4B;AAC5B,uDAAmC;AAU5B,IAAM,eAAA,EAAiB,0BAAA;AAAA,EAC5B,CAAA,EAAA,GACE,IAAI,4BAAA,CAAY;AAAA,IACd,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS;AAAA,QACP,SAAA,EAAW,GAAA,EAAK,GAAA;AAAA,QAChB,oBAAA,EAAsB;AAAA,MACxB;AAAA,IACF;AAAA,EACF,CAAC;AACL,CAAA;AAgBO,SAAS,kBAAA,CACd,GAAA,EACA,WAAA,EAC6C;AAC7C,EAAA,MAAM,YAAA,EAA8C,YAAA,EAChD,EAAE,KAAA,EAAO,EAAE,MAAA,EAAQ,WAAA,CAAY,MAAA,EAAQ,UAAA,EAAY,WAAA,CAAY,WAAW,EAAE,EAAA,EAC5E,KAAA,CAAA;AACJ,EAAA,OAAO,2CAAA,GAAmB,EAAK,WAAW,CAAA;AAC5C;ADeA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,osGAAC","file":"/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/server.cjs","sourcesContent":[null,"// @simpleapps-com/augur-hooks/server\n// Query options, keys, and utilities for server-side prefetching in Next.js App Router.\n\nimport { cache } from \"react\";\nimport { QueryClient } from \"@tanstack/react-query\";\nimport { createOptionsProxy } from \"@simpleapps-com/augur-core\";\nimport type { OptionsProxyConfig, CacheConfig } from \"@simpleapps-com/augur-core\";\n\n/**\n * Returns a per-request singleton QueryClient for React Server Components.\n *\n * React's `cache()` deduplicates calls within a single server request,\n * so layout, page, and header all share the same prefetch cache without\n * leaking state between requests.\n */\nexport const getQueryClient = cache(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n refetchOnWindowFocus: false,\n },\n },\n }),\n);\n\n/**\n * Creates server-side query options proxy for prefetching.\n *\n * Uses the same augur-core proxy as `useAugurOptions()`, so query keys\n * are identical on server and client — SSR hydration is automatic.\n *\n * @example\n * ```ts\n * import { createAugurOptions } from \"@simpleapps-com/augur-hooks/server\";\n *\n * const q = createAugurOptions(api, cacheConfig);\n * await queryClient.prefetchQuery(q.items.invMast.doc.get(params.id));\n * ```\n */\nexport function createAugurOptions<TApi extends object>(\n api: TApi,\n cacheConfig?: CacheConfig,\n): ReturnType<typeof createOptionsProxy<TApi>> {\n const proxyConfig: OptionsProxyConfig | undefined = cacheConfig\n ? { cache: { static: cacheConfig.static, semiStatic: cacheConfig.semiStatic } }\n : undefined;\n return createOptionsProxy(api, proxyConfig);\n}\n\n// All pure query options and keys (legacy)\nexport * from \"./queries\";\n\n// Callback and auth types for provider-level configuration\nexport type { AugurCallbacks } from \"./callbacks\";\n\n// Re-export shared types from augur-core\nexport type { AugurAuthContext, InfiniteScrollPage, CacheConfig } from \"@simpleapps-com/augur-core\";\n\n// Types needed for server-side usage (type-only, erased at compile time)\nexport type { AugurApiClient } from \"./provider\";\nexport type { PageData } from \"./types\";\n"]}
package/dist/server.d.cts CHANGED
@@ -1,15 +1,11 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
- export { b as AugurApiClient, c as AugurAuthContext, A as AugurCallbacks, B as BatchInvMastDocParam, f as BatchQueryConfig, C as CacheConfig, I as InfiniteScrollPage, P as PageData, i as executeBatchQuery, j as getBatchInvMastDocKey, k as getBatchInvMastDocOptions, l as getCartPricingQueryOptions, m as getCategoryItemsInfiniteKey, n as getCategoryItemsInfiniteOptions, o as getCustomerInvoiceDetailKey, p as getCustomerInvoicesKey, q as getCustomerOrderDetailKey, r as getCustomerOrdersKey, s as getCustomerQuoteDetailKey, t as getCustomerQuotesKey, u as getInvMastDocKey, v as getInvMastDocOptions, w as getInvMastKey, x as getInvMastOptions, y as getInvMastStockKey, z as getInvMastStockOptions, D as getItemAttributesKey, E as getItemAttributesOptions, F as getItemCategoryKey, H as getItemCategoryOptions, J as getItemDetailsKey, K as getItemDetailsOptions, L as getItemPriceKey, M as getItemPriceOptions, N as getItemSearchInfiniteKey, O as getItemSearchInfiniteOptions, Q as getJoomlaContentKey, R as getJoomlaContentListKey, T as getJoomlaContentListOptions, U as getJoomlaContentOptions, V as getJoomlaMenuDocKey, W as getJoomlaMenuDocOptions, X as getJoomlaMenuKey, Y as getJoomlaMenuOptions, Z as getProductCategoryKey, _ as getProductCategoryOptions, $ as getProductSearchKey, a0 as getProductSearchOptions, a1 as getSearchSuggestionsKey, a2 as getSearchSuggestionsOptions } from './customer-quotes-DjCgi3z3.cjs';
2
+ import { CacheConfig, createOptionsProxy } from '@simpleapps-com/augur-core';
3
+ export { AugurAuthContext, CacheConfig, InfiniteScrollPage, stableStringify } from '@simpleapps-com/augur-core';
4
+ export { b as AugurApiClient, A as AugurCallbacks, B as BatchInvMastDocParam, e as BatchQueryConfig, P as PageData, 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 } from './customer-quotes-ji9iHUmo.cjs';
3
5
  import '@simpleapps-com/augur-utils';
4
6
  import 'react/jsx-runtime';
5
7
  import 'react';
6
8
 
7
- /**
8
- * JSON.stringify with sorted object keys for deterministic cache keys.
9
- * Ensures { a: 1, b: 2 } and { b: 2, a: 1 } produce the same string.
10
- */
11
- declare function stableStringify(value: unknown): string;
12
-
13
9
  /**
14
10
  * Returns a per-request singleton QueryClient for React Server Components.
15
11
  *
@@ -18,5 +14,20 @@ declare function stableStringify(value: unknown): string;
18
14
  * leaking state between requests.
19
15
  */
20
16
  declare const getQueryClient: () => QueryClient;
17
+ /**
18
+ * Creates server-side query options proxy for prefetching.
19
+ *
20
+ * Uses the same augur-core proxy as `useAugurOptions()`, so query keys
21
+ * are identical on server and client — SSR hydration is automatic.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { createAugurOptions } from "@simpleapps-com/augur-hooks/server";
26
+ *
27
+ * const q = createAugurOptions(api, cacheConfig);
28
+ * await queryClient.prefetchQuery(q.items.invMast.doc.get(params.id));
29
+ * ```
30
+ */
31
+ declare function createAugurOptions<TApi extends object>(api: TApi, cacheConfig?: CacheConfig): ReturnType<typeof createOptionsProxy<TApi>>;
21
32
 
22
- export { getQueryClient, stableStringify };
33
+ export { createAugurOptions, getQueryClient };
package/dist/server.d.ts CHANGED
@@ -1,15 +1,11 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
- export { b as AugurApiClient, c as AugurAuthContext, A as AugurCallbacks, B as BatchInvMastDocParam, f as BatchQueryConfig, C as CacheConfig, I as InfiniteScrollPage, P as PageData, i as executeBatchQuery, j as getBatchInvMastDocKey, k as getBatchInvMastDocOptions, l as getCartPricingQueryOptions, m as getCategoryItemsInfiniteKey, n as getCategoryItemsInfiniteOptions, o as getCustomerInvoiceDetailKey, p as getCustomerInvoicesKey, q as getCustomerOrderDetailKey, r as getCustomerOrdersKey, s as getCustomerQuoteDetailKey, t as getCustomerQuotesKey, u as getInvMastDocKey, v as getInvMastDocOptions, w as getInvMastKey, x as getInvMastOptions, y as getInvMastStockKey, z as getInvMastStockOptions, D as getItemAttributesKey, E as getItemAttributesOptions, F as getItemCategoryKey, H as getItemCategoryOptions, J as getItemDetailsKey, K as getItemDetailsOptions, L as getItemPriceKey, M as getItemPriceOptions, N as getItemSearchInfiniteKey, O as getItemSearchInfiniteOptions, Q as getJoomlaContentKey, R as getJoomlaContentListKey, T as getJoomlaContentListOptions, U as getJoomlaContentOptions, V as getJoomlaMenuDocKey, W as getJoomlaMenuDocOptions, X as getJoomlaMenuKey, Y as getJoomlaMenuOptions, Z as getProductCategoryKey, _ as getProductCategoryOptions, $ as getProductSearchKey, a0 as getProductSearchOptions, a1 as getSearchSuggestionsKey, a2 as getSearchSuggestionsOptions } from './customer-quotes-DjCgi3z3.js';
2
+ import { CacheConfig, createOptionsProxy } from '@simpleapps-com/augur-core';
3
+ export { AugurAuthContext, CacheConfig, InfiniteScrollPage, stableStringify } from '@simpleapps-com/augur-core';
4
+ export { b as AugurApiClient, A as AugurCallbacks, B as BatchInvMastDocParam, e as BatchQueryConfig, P as PageData, 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 } from './customer-quotes-ji9iHUmo.js';
3
5
  import '@simpleapps-com/augur-utils';
4
6
  import 'react/jsx-runtime';
5
7
  import 'react';
6
8
 
7
- /**
8
- * JSON.stringify with sorted object keys for deterministic cache keys.
9
- * Ensures { a: 1, b: 2 } and { b: 2, a: 1 } produce the same string.
10
- */
11
- declare function stableStringify(value: unknown): string;
12
-
13
9
  /**
14
10
  * Returns a per-request singleton QueryClient for React Server Components.
15
11
  *
@@ -18,5 +14,20 @@ declare function stableStringify(value: unknown): string;
18
14
  * leaking state between requests.
19
15
  */
20
16
  declare const getQueryClient: () => QueryClient;
17
+ /**
18
+ * Creates server-side query options proxy for prefetching.
19
+ *
20
+ * Uses the same augur-core proxy as `useAugurOptions()`, so query keys
21
+ * are identical on server and client — SSR hydration is automatic.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { createAugurOptions } from "@simpleapps-com/augur-hooks/server";
26
+ *
27
+ * const q = createAugurOptions(api, cacheConfig);
28
+ * await queryClient.prefetchQuery(q.items.invMast.doc.get(params.id));
29
+ * ```
30
+ */
31
+ declare function createAugurOptions<TApi extends object>(api: TApi, cacheConfig?: CacheConfig): ReturnType<typeof createOptionsProxy<TApi>>;
21
32
 
22
- export { getQueryClient, stableStringify };
33
+ export { createAugurOptions, getQueryClient };
package/dist/server.js CHANGED
@@ -42,11 +42,12 @@ import {
42
42
  getSearchSuggestionsKey,
43
43
  getSearchSuggestionsOptions,
44
44
  stableStringify
45
- } from "./chunk-PZK7QARW.js";
45
+ } from "./chunk-6DSOHS3R.js";
46
46
 
47
47
  // src/server.ts
48
48
  import { cache } from "react";
49
49
  import { QueryClient } from "@tanstack/react-query";
50
+ import { createOptionsProxy } from "@simpleapps-com/augur-core";
50
51
  var getQueryClient = cache(
51
52
  () => new QueryClient({
52
53
  defaultOptions: {
@@ -57,7 +58,12 @@ var getQueryClient = cache(
57
58
  }
58
59
  })
59
60
  );
61
+ function createAugurOptions(api, cacheConfig) {
62
+ const proxyConfig = cacheConfig ? { cache: { static: cacheConfig.static, semiStatic: cacheConfig.semiStatic } } : void 0;
63
+ return createOptionsProxy(api, proxyConfig);
64
+ }
60
65
  export {
66
+ createAugurOptions,
61
67
  executeBatchQuery,
62
68
  getBatchInvMastDocKey,
63
69
  getBatchInvMastDocOptions,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.ts"],"sourcesContent":["// @simpleapps-com/augur-hooks/server\n// Query options, keys, and utilities for server-side prefetching in Next.js App Router.\n\nimport { cache } from \"react\";\nimport { QueryClient } from \"@tanstack/react-query\";\n\n/**\n * Returns a per-request singleton QueryClient for React Server Components.\n *\n * React's `cache()` deduplicates calls within a single server request,\n * so layout, page, and header all share the same prefetch cache without\n * leaking state between requests.\n */\nexport const getQueryClient = cache(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n refetchOnWindowFocus: false,\n },\n },\n }),\n);\n\n// All pure query options and keys\nexport * from \"./queries\";\n\n// Callback and auth types for provider-level configuration\nexport type { AugurCallbacks, InfiniteScrollPage, AugurAuthContext } from \"./callbacks\";\n\n// Types needed for server-side usage (type-only, erased at compile time)\nexport type { AugurApiClient } from \"./provider\";\nexport type { PageData, CacheConfig } from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AASrB,IAAM,iBAAiB;AAAA,EAC5B,MACE,IAAI,YAAY;AAAA,IACd,gBAAgB;AAAA,MACd,SAAS;AAAA,QACP,WAAW,KAAK;AAAA,QAChB,sBAAsB;AAAA,MACxB;AAAA,IACF;AAAA,EACF,CAAC;AACL;","names":[]}
1
+ {"version":3,"sources":["../src/server.ts"],"sourcesContent":["// @simpleapps-com/augur-hooks/server\n// Query options, keys, and utilities for server-side prefetching in Next.js App Router.\n\nimport { cache } from \"react\";\nimport { QueryClient } from \"@tanstack/react-query\";\nimport { createOptionsProxy } from \"@simpleapps-com/augur-core\";\nimport type { OptionsProxyConfig, CacheConfig } from \"@simpleapps-com/augur-core\";\n\n/**\n * Returns a per-request singleton QueryClient for React Server Components.\n *\n * React's `cache()` deduplicates calls within a single server request,\n * so layout, page, and header all share the same prefetch cache without\n * leaking state between requests.\n */\nexport const getQueryClient = cache(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n refetchOnWindowFocus: false,\n },\n },\n }),\n);\n\n/**\n * Creates server-side query options proxy for prefetching.\n *\n * Uses the same augur-core proxy as `useAugurOptions()`, so query keys\n * are identical on server and client — SSR hydration is automatic.\n *\n * @example\n * ```ts\n * import { createAugurOptions } from \"@simpleapps-com/augur-hooks/server\";\n *\n * const q = createAugurOptions(api, cacheConfig);\n * await queryClient.prefetchQuery(q.items.invMast.doc.get(params.id));\n * ```\n */\nexport function createAugurOptions<TApi extends object>(\n api: TApi,\n cacheConfig?: CacheConfig,\n): ReturnType<typeof createOptionsProxy<TApi>> {\n const proxyConfig: OptionsProxyConfig | undefined = cacheConfig\n ? { cache: { static: cacheConfig.static, semiStatic: cacheConfig.semiStatic } }\n : undefined;\n return createOptionsProxy(api, proxyConfig);\n}\n\n// All pure query options and keys (legacy)\nexport * from \"./queries\";\n\n// Callback and auth types for provider-level configuration\nexport type { AugurCallbacks } from \"./callbacks\";\n\n// Re-export shared types from augur-core\nexport type { AugurAuthContext, InfiniteScrollPage, CacheConfig } from \"@simpleapps-com/augur-core\";\n\n// Types needed for server-side usage (type-only, erased at compile time)\nexport type { AugurApiClient } from \"./provider\";\nexport type { PageData } from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AAU5B,IAAM,iBAAiB;AAAA,EAC5B,MACE,IAAI,YAAY;AAAA,IACd,gBAAgB;AAAA,MACd,SAAS;AAAA,QACP,WAAW,KAAK;AAAA,QAChB,sBAAsB;AAAA,MACxB;AAAA,IACF;AAAA,EACF,CAAC;AACL;AAgBO,SAAS,mBACd,KACA,aAC6C;AAC7C,QAAM,cAA8C,cAChD,EAAE,OAAO,EAAE,QAAQ,YAAY,QAAQ,YAAY,YAAY,WAAW,EAAE,IAC5E;AACJ,SAAO,mBAAmB,KAAK,WAAW;AAC5C;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleapps-com/augur-hooks",
3
- "version": "0.5.1",
3
+ "version": "1.0.0",
4
4
  "description": "Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,10 +31,11 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@simpleapps-com/augur-utils": "0.5.1"
34
+ "@simpleapps-com/augur-core": "1.0.0",
35
+ "@simpleapps-com/augur-utils": "1.0.0"
35
36
  },
36
37
  "peerDependencies": {
37
- "@simpleapps-com/augur-api": "^0.9.11",
38
+ "@simpleapps-com/augur-api": "^0.9.12",
38
39
  "@tanstack/react-query": "^5.80.0",
39
40
  "@tanstack/react-query-persist-client": "^5.80.0",
40
41
  "react": "^19.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/chunk-FKM6A6QW.cjs","../src/queries/stable-stringify.ts","../src/queries/cache-helper.ts","../src/queries/item-price.ts","../src/queries/inv-mast-doc.ts","../src/queries/item-category.ts","../src/queries/inv-mast.ts","../src/queries/inv-mast-stock.ts","../src/queries/batch-inv-mast-doc.ts","../src/queries/batch-query.ts","../src/queries/product-category.ts","../src/queries/item-details.ts","../src/queries/item-attributes.ts","../src/queries/product-search.ts","../src/queries/search-suggestions.ts","../src/queries/cart-pricing.ts","../src/queries/category-items-infinite.ts","../src/queries/item-search-infinite.ts","../src/queries/joomla-content.ts","../src/queries/joomla-content-list.ts","../src/queries/joomla-menu.ts","../src/queries/joomla-menu-doc.ts","../src/queries/customer-orders.ts","../src/queries/customer-invoices.ts","../src/queries/customer-quotes.ts"],"names":[],"mappings":"AAAA;ACIO,SAAS,eAAA,CAAgB,KAAA,EAAwB;AACtD,EAAA,GAAA,CAAI,MAAA,IAAU,KAAA,GAAQ,MAAA,IAAU,KAAA,CAAA,EAAW,OAAO,IAAA,CAAK,SAAA,CAAU,KAAK,CAAA;AACtE,EAAA,GAAA,CAAI,OAAO,MAAA,IAAU,QAAA,EAAU,OAAO,IAAA,CAAK,SAAA,CAAU,KAAK,CAAA;AAC1D,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,OAAO,CAAA,CAAA,EAAI,KAAA,CAAM,GAAA,CAAI,eAAe,CAAA,CAAE,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAA;AAAA,EACjD;AACA,EAAA,MAAM,IAAA,EAAM,KAAA;AACZ,EAAA,MAAM,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,GAAG,CAAA,CAAE,IAAA,CAAK,CAAA;AACnC,EAAA,MAAM,QAAA,EAAU,IAAA,CAAK,GAAA;AAAA,IACnB,CAAC,GAAA,EAAA,GAAQ,CAAA,EAAA;AACX,EAAA;AACW,EAAA;AACb;ADFc;AACA;AETL;AACC,EAAA;AACC,EAAA;AACE,IAAA;AACA,IAAA;AACX,EAAA;AACQ,EAAA;AACV;AAeA;AAOQ,EAAA;AACD,EAAA;AAEO,EAAA;AAER,EAAA;AACI,IAAA;AACF,IAAA;AACE,EAAA;AAER,EAAA;AAEM,EAAA;AAEF,EAAA;AACO,IAAA;AAAyD,IAAA;AAC5D,EAAA;AAER,EAAA;AAEO,EAAA;AACT;AFfc;AACA;AGjCD;AAKH,EAAA;AACV;AAMa;AAOL,EAAA;AACC,EAAA;AACK,IAAA;AACD,IAAA;AACD,MAAA;AACC,MAAA;AACL,wBAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACE,UAAA;AACE,YAAA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;AACA,IAAA;AACQ,IAAA;AACV,EAAA;AACF;ArBunBc;AACA;AsB5pBD;AAIH,EAAA;AACV;AAEa;AAIH,EAAA;AACV;AtBupBc;AACA;AuBpqBD;AAIH,EAAA;AACV;AAEa;AAIH,EAAA;AACV;AvB+pBc;AACA;AwB5qBD;AAIH,EAAA;AACV;AAEa;AAIH,EAAA;AACV;AxBuqBc;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/chunk-FKM6A6QW.cjs","sourcesContent":[null,"/**\n * JSON.stringify with sorted object keys for deterministic cache keys.\n * Ensures { a: 1, b: 2 } and { b: 2, a: 1 } produce the same string.\n */\nexport function stableStringify(value: unknown): string {\n if (value === null || value === undefined) return JSON.stringify(value);\n if (typeof value !== \"object\") return JSON.stringify(value);\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(\",\")}]`;\n }\n const obj = value as Record<string, unknown>;\n const keys = Object.keys(obj).sort();\n const entries = keys.map(\n (key) => `${JSON.stringify(key)}:${stableStringify(obj[key])}`,\n );\n return `{${entries.join(\",\")}}`;\n}\n","import type { CacheProvider, CacheTierConfig } from \"../types\";\nimport { stableStringify } from \"./stable-stringify\";\n\n/**\n * FNV-1a 32-bit hash. Fast, cross-platform (no Node crypto needed).\n */\nfunction fnv1a(str: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < str.length; i++) {\n h ^= str.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(16).padStart(8, \"0\");\n}\n\n/**\n * Wraps an async function with optional Redis caching.\n *\n * - When `provider` and `tier.redis` are both set, checks Redis before\n * calling `fn`, then caches the result on miss.\n * - When either is missing, calls `fn` directly (no-op passthrough).\n *\n * @param provider Redis-compatible get/set + prefix. Undefined = skip Redis.\n * @param tier Cache tier config. Undefined or missing `redis` = skip Redis.\n * @param methodPath Dot-separated SDK method path (used as cache key segment).\n * @param fn The async function to cache (typically the SDK call).\n * @param keyArgs Values to hash for the cache key (e.g. query params).\n */\nexport async function withCache<T>(\n provider: CacheProvider | undefined,\n tier: CacheTierConfig | undefined,\n methodPath: string,\n fn: () => Promise<T>,\n ...keyArgs: unknown[]\n): Promise<T> {\n const redisTtl = tier?.redis;\n if (!provider || !redisTtl) return fn();\n\n const key = `${provider.prefix}sdk:${methodPath}:${fnv1a(stableStringify(keyArgs))}`;\n\n try {\n const cached = await provider.get(key);\n if (cached != null) return JSON.parse(cached) as T;\n } catch {\n /* Redis read error — fall through to SDK call */\n }\n\n const result = await fn();\n\n try {\n provider.set(key, JSON.stringify(result), redisTtl).catch(() => {});\n } catch {\n /* Non-serializable or write error — skip caching */\n }\n\n return result;\n}\n","import type { TPriceData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\n/**\n * Generates a consistent query key for item price queries.\n * Usable in both client hooks and server-side prefetch.\n */\nexport const getItemPriceKey = (\n itemId: string | undefined,\n customerId: string | number | undefined,\n quantity: number = 1,\n) => {\n return [\"price\", itemId?.toUpperCase() || \"\", customerId, quantity] as const;\n};\n\n/**\n * Query options for item price. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getItemPriceOptions = (\n api: AugurApiClient,\n itemId: string | undefined,\n customerId: string | number | undefined,\n quantity: number = 1,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getItemPriceKey(itemId, customerId, quantity),\n queryFn: async (): Promise<TPriceData> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"pricing.priceEngine.get\",\n async () => {\n const response = await api.pricing.priceEngine.get({\n itemId: itemId?.toUpperCase() || \"\",\n customerId: Number(customerId),\n quantity,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n itemId, customerId, quantity,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n refetchOnReconnect: true,\n refetchOnWindowFocus: false,\n meta: { persist: true },\n };\n};\n","import type { TInvMastDoc } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\n/**\n * Generates a consistent query key for inv mast doc queries.\n * Usable in both client hooks and server-side prefetch.\n */\nexport const getInvMastDocKey = (\n invMastUid: number,\n itemId: string,\n includePricing: \"Y\" | \"N\",\n) => {\n return [\n \"invMastDoc\",\n invMastUid,\n itemId.toUpperCase(),\n includePricing,\n ] as const;\n};\n\n/**\n * Query options for inv mast doc. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getInvMastDocOptions = (\n api: AugurApiClient,\n invMastUid: number,\n itemId: string,\n includePricing: \"Y\" | \"N\",\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getInvMastDocKey(invMastUid, itemId, includePricing),\n queryFn: async (): Promise<TInvMastDoc> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.doc.list\",\n async () => {\n const response = await api.items.invMast.doc.list(invMastUid, {\n itemId: itemId.toUpperCase(),\n includePricing,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n invMastUid,\n itemId,\n includePricing,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig, GetItemCategoryApiOptions } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\ntype ItemCategoryQueryKey = readonly [\n \"itemCategory\",\n number,\n GetItemCategoryApiOptions | undefined,\n];\n\n/**\n * Generates a consistent query key for item category queries.\n * Usable in both client hooks and server-side prefetch.\n */\nexport const getItemCategoryKey = (\n itemCategoryUid: number,\n apiOptions?: GetItemCategoryApiOptions,\n): ItemCategoryQueryKey => {\n return [\"itemCategory\", itemCategoryUid, apiOptions] as const;\n};\n\n/**\n * Query options for item category. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getItemCategoryOptions = (\n api: AugurApiClient,\n itemCategoryUid: number,\n apiOptions?: GetItemCategoryApiOptions,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getItemCategoryKey(itemCategoryUid, apiOptions),\n queryFn: async (): Promise<TCategory> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.categories.get\",\n async () => {\n const response = await api.items.categories.get(\n itemCategoryUid,\n { ...apiOptions, ...(edgeCache != null ? { edgeCache } : {}) },\n );\n if (!response.data) throw new Error(\"Item category not found\");\n return response.data;\n },\n itemCategoryUid,\n apiOptions,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getInvMastKey = (invMastUid: number, itemId: string) => {\n return [\"invMast\", invMastUid, itemId.toUpperCase()] as const;\n};\n\nexport const getInvMastOptions = (\n api: AugurApiClient,\n invMastUid: number,\n itemId: string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getInvMastKey(invMastUid, itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.get\",\n async () => {\n const response = await api.items.invMast.get(invMastUid, {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n invMastUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TStockData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getInvMastStockKey = (invMastUid: number | string) => {\n return [\"invMastStock\", invMastUid] as const;\n};\n\nexport const getInvMastStockOptions = (\n api: AugurApiClient,\n invMastUid: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getInvMastStockKey(invMastUid),\n queryFn: async (): Promise<number> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.stock.list\",\n async () => {\n const response = await api.items.invMast.stock.list(Number(invMastUid), {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n const stockData: TStockData[] = response.data?.stockData ?? [];\n return stockData.reduce(\n (qty: number, stock: TStockData) => qty + stock.qtyOnHand,\n 0,\n );\n },\n invMastUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TInvMastDoc } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { getInvMastDocOptions } from \"./inv-mast-doc\";\nimport { stableStringify } from \"./stable-stringify\";\n\nexport interface BatchInvMastDocParam {\n invMastUid: number;\n itemId: string;\n}\n\n/**\n * Generates a deterministic query key for a batch inv mast doc query.\n * Params are sorted by uppercased itemId to ensure stable keys\n * regardless of input order.\n */\nexport const getBatchInvMastDocKey = (\n params: BatchInvMastDocParam[],\n includePricing: \"Y\" | \"N\",\n) => {\n const sorted = [...params].sort((a, b) =>\n a.itemId.toUpperCase().localeCompare(b.itemId.toUpperCase()),\n );\n return [\n \"batchInvMastDoc\",\n stableStringify(sorted.map((p) => ({ invMastUid: p.invMastUid, itemId: p.itemId.toUpperCase() }))),\n includePricing,\n ] as const;\n};\n\n/**\n * Server-side query options for batch inv mast doc.\n * Uses Promise.all over individual getInvMastDocOptions queryFns\n * since queryClient is not available server-side.\n * Failed items are silently excluded from the result.\n */\nexport const getBatchInvMastDocOptions = (\n api: AugurApiClient,\n params: BatchInvMastDocParam[],\n includePricing: \"Y\" | \"N\",\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getBatchInvMastDocKey(params, includePricing),\n queryFn: async (): Promise<Record<string, TInvMastDoc>> => {\n const results: Record<string, TInvMastDoc> = {};\n const settled = await Promise.allSettled(\n params.map(async (p) => {\n const opts = getInvMastDocOptions(\n api,\n p.invMastUid,\n p.itemId,\n includePricing,\n cache,\n );\n const data = await opts.queryFn();\n return { key: p.itemId.toUpperCase(), data };\n }),\n );\n for (const entry of settled) {\n if (entry.status === \"fulfilled\") {\n results[entry.value.key] = entry.value.data;\n }\n }\n return results;\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { QueryClient } from \"@tanstack/react-query\";\n\nexport interface BatchQueryConfig<TParam, TData> {\n params: TParam[];\n queryClient: QueryClient;\n /** Build individual cache key for a single param. */\n getItemKey: (param: TParam) => readonly unknown[];\n /** Build the string key for the result Record from a param. */\n getResultKey: (param: TParam) => string;\n /** Fetch only uncached items, return keyed Record. */\n fetchItems: (uncached: TParam[]) => Promise<Record<string, TData>>;\n /** Extract individual cache key from a fetched result entry (for seeding). */\n getSeedKey: (resultKey: string, data: TData) => readonly unknown[];\n}\n\n/**\n * Generic batch query executor.\n *\n * 1. Checks queryClient cache for each param\n * 2. Fetches only uncached items in a single batch call\n * 3. Seeds individual cache entries from the response\n * 4. Returns merged cached + fetched record\n */\nexport async function executeBatchQuery<TParam, TData>(\n config: BatchQueryConfig<TParam, TData>,\n): Promise<Record<string, TData>> {\n const { params, queryClient, getItemKey, getResultKey, fetchItems, getSeedKey } = config;\n\n if (params.length === 0) {\n return {};\n }\n\n const cached: Record<string, TData> = {};\n const uncached: TParam[] = [];\n\n for (const param of params) {\n const existing = queryClient.getQueryData<TData>(getItemKey(param));\n if (existing !== undefined) {\n cached[getResultKey(param)] = existing;\n } else {\n uncached.push(param);\n }\n }\n\n if (uncached.length === 0) {\n return cached;\n }\n\n const fetched = await fetchItems(uncached);\n\n for (const [key, data] of Object.entries(fetched)) {\n queryClient.setQueryData(getSeedKey(key, data as TData), data);\n }\n\n return { ...cached, ...fetched };\n}\n","import type { TProductCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\ntype ProductCategoryResponse = {\n itemCategoryDesc: string;\n childrenTotal: number;\n children: TProductCategory[];\n categoryImage: string | null;\n};\n\nexport const getProductCategoryKey = (\n itemCategoryUid: number | string | null,\n) => {\n return [\"productCategory\", itemCategoryUid] as const;\n};\n\nexport const getProductCategoryOptions = (\n api: AugurApiClient,\n itemCategoryUid: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getProductCategoryKey(itemCategoryUid),\n queryFn: async (): Promise<ProductCategoryResponse> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.categories.get\",\n async () => {\n const response = await api.items.categories.get(Number(itemCategoryUid), {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n itemCategoryUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getItemDetailsKey = (itemId: number | string) => {\n const normalizedId = typeof itemId === \"string\" ? itemId.toUpperCase() : itemId;\n return [\"itemDetails\", normalizedId] as const;\n};\n\nexport const getItemDetailsOptions = (\n api: AugurApiClient,\n itemId: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getItemDetailsKey(itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.doc.list\",\n async () => {\n const response = await api.items.invMast.doc.list(Number(itemId), {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n itemId,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getItemAttributesKey = (\n itemCategoryUid: number | string | null,\n) => {\n return [\"itemAttributes\", itemCategoryUid] as const;\n};\n\nexport const getItemAttributesOptions = (\n api: AugurApiClient,\n itemCategoryUid: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getItemAttributesKey(itemCategoryUid),\n queryFn: async () => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.attributes.list\",\n async () => {\n const response = await api.openSearch.itemSearch.attributes.list({\n q: \"\",\n searchType: \"query\",\n classId5List: String(itemCategoryUid),\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n itemCategoryUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TProductItem } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig, PageData } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\ntype ProductSearchResponse = {\n items: TProductItem[];\n totalResults: number;\n};\n\n/**\n * Generates a consistent query key for product search queries.\n */\nexport const getProductSearchKey = (pageData: PageData) => {\n return [\n \"productSearch\",\n pageData.q,\n pageData.limit,\n pageData.offset,\n pageData.sortBy,\n pageData.itemCategoryUid,\n ] as const;\n};\n\n/**\n * Query options for product search. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getProductSearchOptions = (\n api: AugurApiClient,\n pageData: PageData,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getProductSearchKey(pageData),\n queryFn: async (): Promise<ProductSearchResponse> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.list\",\n async () => {\n const response = await api.openSearch.itemSearch.list({\n q: pageData.q,\n searchType: \"query\",\n size: pageData.limit,\n from: pageData.offset,\n classId5List: pageData.itemCategoryUid\n ? String(pageData.itemCategoryUid)\n : undefined,\n filters: pageData.filters\n ? JSON.stringify(pageData.filters)\n : undefined,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n pageData,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig, SearchSuggestionsResponse } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\n/**\n * Generates a consistent query key for search suggestion queries.\n */\nexport const getSearchSuggestionsKey = (\n query: string,\n limit: number,\n offset: number,\n) => {\n return [\"searchSuggestions\", query, limit, offset] as const;\n};\n\n/**\n * Query options for search suggestions. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getSearchSuggestionsOptions = (\n api: AugurApiClient,\n query: string,\n limit: number = 10,\n offset: number = 0,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getSearchSuggestionsKey(query, limit, offset),\n queryFn: async (): Promise<SearchSuggestionsResponse> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.suggestions.suggest.list\",\n async () => {\n const response = await api.openSearch.suggestions.suggest.list({\n q: query,\n size: limit,\n from: offset,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n query,\n limit,\n offset,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { getItemPriceOptions } from \"./item-price\";\n\n/**\n * Get cart pricing query options for prefetching or parent components.\n */\nexport function getCartPricingQueryOptions(\n api: AugurApiClient,\n cartLines: Array<{ itemId: string; quantity: number }>,\n customerId: string | number | undefined,\n cache?: CacheConfig,\n) {\n return cartLines.map((line) => ({\n ...getItemPriceOptions(api, line.itemId, customerId, line.quantity, cache),\n enabled: !!customerId && !!line.itemId,\n }));\n}\n","import {\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nimport { stableStringify } from \"./stable-stringify\";\n\nexport const getCategoryItemsInfiniteKey = (\n itemCategoryUid: number,\n itemsFilters: TItemsFilters,\n) => {\n return [\n \"categoryItemsInfinite\",\n itemCategoryUid,\n stableStringify(itemsFilters),\n ] as const;\n};\n\n/**\n * Full infinite query options for category items.\n * Usable for server-side prefetch with `queryClient.prefetchInfiniteQuery()`.\n */\nexport const getCategoryItemsInfiniteOptions = (\n api: AugurApiClient,\n itemCategoryUid: number,\n itemsFilters: TItemsFilters,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getCategoryItemsInfiniteKey(itemCategoryUid, itemsFilters),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.list\",\n async () => {\n const response = await api.openSearch.itemSearch.list({\n q: itemsFilters.q || \"\",\n searchType: \"query\",\n size: itemsFilters.limit,\n from: pageParam as number,\n classId5List: String(itemCategoryUid),\n filters: itemsFilters.filters?.length\n ? JSON.stringify(itemsFilters.filters)\n : undefined,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n const items: TProductItem[] = response.data?.items ?? [];\n const total: number = response.data?.totalResults ?? 0;\n const nextOffset = (pageParam as number) + itemsFilters.limit;\n return {\n data: items,\n total,\n nextCursor: nextOffset < total ? nextOffset : undefined,\n };\n },\n itemCategoryUid, itemsFilters, pageParam,\n );\n },\n initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import {\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nimport { stableStringify } from \"./stable-stringify\";\n\nexport const getItemSearchInfiniteKey = (\n itemsFilters: TItemsFilters,\n itemCategoryUid?: number | string,\n) => {\n return [\n \"itemSearchInfinite\",\n stableStringify(itemsFilters),\n itemCategoryUid,\n ] as const;\n};\n\n/**\n * Full infinite query options for item search.\n * Usable for server-side prefetch with `queryClient.prefetchInfiniteQuery()`.\n */\nexport const getItemSearchInfiniteOptions = (\n api: AugurApiClient,\n itemsFilters: TItemsFilters,\n itemCategoryUid?: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getItemSearchInfiniteKey(itemsFilters, itemCategoryUid),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.list\",\n async () => {\n const response = await api.openSearch.itemSearch.list({\n q: itemsFilters.q,\n searchType: \"query\",\n size: itemsFilters.limit,\n from: pageParam as number,\n classId5List: itemCategoryUid ? String(itemCategoryUid) : undefined,\n filters: itemsFilters.filters?.length\n ? JSON.stringify(itemsFilters.filters)\n : undefined,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n const items: TProductItem[] = response.data?.items ?? [];\n const total: number = response.data?.totalResults ?? 0;\n const nextOffset = (pageParam as number) + itemsFilters.limit;\n return {\n data: items,\n total,\n nextCursor: nextOffset < total ? nextOffset : undefined,\n };\n },\n itemsFilters, itemCategoryUid, pageParam,\n );\n },\n initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n meta: { persist: true },\n };\n};\n","import type { TJoomlaContent } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaContentKey = (articleId: number | string) => {\n return [\"joomlaContent\", articleId] as const;\n};\n\nexport const getJoomlaContentOptions = (\n api: AugurApiClient,\n articleId: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getJoomlaContentKey(articleId),\n queryFn: async (): Promise<TJoomlaContent> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.content.doc.get\",\n async () => {\n const response = await api.joomla.content.doc.get(articleId, {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Article not found\");\n return response.data;\n },\n articleId,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import {\n type TJoomlaContent,\n type TJoomlaContentFilters,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaContentListKey = (\n categoryId: number | string,\n filters?: Partial<TJoomlaContentFilters>,\n) => {\n return [\"joomlaContentList\", categoryId, filters] as const;\n};\n\nexport const getJoomlaContentListOptions = (\n api: AugurApiClient,\n categoryId: number | string,\n filters?: Partial<TJoomlaContentFilters>,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getJoomlaContentListKey(categoryId, filters),\n queryFn: async (): Promise<TJoomlaContent[]> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.content.list\",\n async () => {\n const response = await api.joomla.content.list({\n catid: categoryId,\n ...filters,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data ?? [];\n },\n categoryId, filters,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { MenuItem, TMenuFilters } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaMenuKey = (\n filters?: Partial<TMenuFilters>,\n) => {\n return [\"joomlaMenu\", filters] as const;\n};\n\nexport const getJoomlaMenuOptions = (\n api: AugurApiClient,\n filters?: Partial<TMenuFilters>,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getJoomlaMenuKey(filters),\n queryFn: async (): Promise<MenuItem[]> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.menu.list\",\n async () => {\n const response = await api.joomla.menu.list({\n ...filters,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data ?? [];\n },\n filters,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { MenuItem } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaMenuDocKey = (menuId: number | string) => {\n return [\"joomlaMenuDoc\", menuId] as const;\n};\n\nexport const getJoomlaMenuDocOptions = (\n api: AugurApiClient,\n menuId: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getJoomlaMenuDocKey(menuId),\n queryFn: async (): Promise<MenuItem> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.menu.doc.get\",\n async () => {\n const response = await api.joomla.menu.doc.get(menuId, {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Menu item not found\");\n return response.data;\n },\n menuId,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","export const getCustomerOrdersKey = (\n customerId: number | string | undefined,\n params?: Record<string, unknown>,\n) => {\n return [\"customerOrders\", customerId, params] as const;\n};\n\nexport const getCustomerOrderDetailKey = (\n customerId: number | string | undefined,\n orderId: number | string | undefined,\n) => {\n return [\"customerOrderDetail\", customerId, orderId] as const;\n};\n","export const getCustomerInvoicesKey = (\n customerId: number | string | undefined,\n params?: Record<string, unknown>,\n) => {\n return [\"customerInvoices\", customerId, params] as const;\n};\n\nexport const getCustomerInvoiceDetailKey = (\n customerId: number | string | undefined,\n invoiceNo: number | string | undefined,\n) => {\n return [\"customerInvoiceDetail\", customerId, invoiceNo] as const;\n};\n","export const getCustomerQuotesKey = (\n customerId: number | string | undefined,\n params?: Record<string, unknown>,\n) => {\n return [\"customerQuotes\", customerId, params] as const;\n};\n\nexport const getCustomerQuoteDetailKey = (\n customerId: number | string | undefined,\n quoteNo: number | string | undefined,\n) => {\n return [\"customerQuoteDetail\", customerId, quoteNo] as const;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/queries/stable-stringify.ts","../src/queries/cache-helper.ts","../src/queries/item-price.ts","../src/queries/inv-mast-doc.ts","../src/queries/item-category.ts","../src/queries/inv-mast.ts","../src/queries/inv-mast-stock.ts","../src/queries/batch-inv-mast-doc.ts","../src/queries/batch-query.ts","../src/queries/product-category.ts","../src/queries/item-details.ts","../src/queries/item-attributes.ts","../src/queries/product-search.ts","../src/queries/search-suggestions.ts","../src/queries/cart-pricing.ts","../src/queries/category-items-infinite.ts","../src/queries/item-search-infinite.ts","../src/queries/joomla-content.ts","../src/queries/joomla-content-list.ts","../src/queries/joomla-menu.ts","../src/queries/joomla-menu-doc.ts","../src/queries/customer-orders.ts","../src/queries/customer-invoices.ts","../src/queries/customer-quotes.ts"],"sourcesContent":["/**\n * JSON.stringify with sorted object keys for deterministic cache keys.\n * Ensures { a: 1, b: 2 } and { b: 2, a: 1 } produce the same string.\n */\nexport function stableStringify(value: unknown): string {\n if (value === null || value === undefined) return JSON.stringify(value);\n if (typeof value !== \"object\") return JSON.stringify(value);\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(\",\")}]`;\n }\n const obj = value as Record<string, unknown>;\n const keys = Object.keys(obj).sort();\n const entries = keys.map(\n (key) => `${JSON.stringify(key)}:${stableStringify(obj[key])}`,\n );\n return `{${entries.join(\",\")}}`;\n}\n","import type { CacheProvider, CacheTierConfig } from \"../types\";\nimport { stableStringify } from \"./stable-stringify\";\n\n/**\n * FNV-1a 32-bit hash. Fast, cross-platform (no Node crypto needed).\n */\nfunction fnv1a(str: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < str.length; i++) {\n h ^= str.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(16).padStart(8, \"0\");\n}\n\n/**\n * Wraps an async function with optional Redis caching.\n *\n * - When `provider` and `tier.redis` are both set, checks Redis before\n * calling `fn`, then caches the result on miss.\n * - When either is missing, calls `fn` directly (no-op passthrough).\n *\n * @param provider Redis-compatible get/set + prefix. Undefined = skip Redis.\n * @param tier Cache tier config. Undefined or missing `redis` = skip Redis.\n * @param methodPath Dot-separated SDK method path (used as cache key segment).\n * @param fn The async function to cache (typically the SDK call).\n * @param keyArgs Values to hash for the cache key (e.g. query params).\n */\nexport async function withCache<T>(\n provider: CacheProvider | undefined,\n tier: CacheTierConfig | undefined,\n methodPath: string,\n fn: () => Promise<T>,\n ...keyArgs: unknown[]\n): Promise<T> {\n const redisTtl = tier?.redis;\n if (!provider || !redisTtl) return fn();\n\n const key = `${provider.prefix}sdk:${methodPath}:${fnv1a(stableStringify(keyArgs))}`;\n\n try {\n const cached = await provider.get(key);\n if (cached != null) return JSON.parse(cached) as T;\n } catch {\n /* Redis read error — fall through to SDK call */\n }\n\n const result = await fn();\n\n try {\n provider.set(key, JSON.stringify(result), redisTtl).catch(() => {});\n } catch {\n /* Non-serializable or write error — skip caching */\n }\n\n return result;\n}\n","import type { TPriceData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\n/**\n * Generates a consistent query key for item price queries.\n * Usable in both client hooks and server-side prefetch.\n */\nexport const getItemPriceKey = (\n itemId: string | undefined,\n customerId: string | number | undefined,\n quantity: number = 1,\n) => {\n return [\"price\", itemId?.toUpperCase() || \"\", customerId, quantity] as const;\n};\n\n/**\n * Query options for item price. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getItemPriceOptions = (\n api: AugurApiClient,\n itemId: string | undefined,\n customerId: string | number | undefined,\n quantity: number = 1,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getItemPriceKey(itemId, customerId, quantity),\n queryFn: async (): Promise<TPriceData> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"pricing.priceEngine.get\",\n async () => {\n const response = await api.pricing.priceEngine.get({\n itemId: itemId?.toUpperCase() || \"\",\n customerId: Number(customerId),\n quantity,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n itemId, customerId, quantity,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n refetchOnReconnect: true,\n refetchOnWindowFocus: false,\n meta: { persist: true },\n };\n};\n","import type { TInvMastDoc } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\n/**\n * Generates a consistent query key for inv mast doc queries.\n * Usable in both client hooks and server-side prefetch.\n */\nexport const getInvMastDocKey = (\n invMastUid: number,\n itemId: string,\n includePricing: \"Y\" | \"N\",\n) => {\n return [\n \"invMastDoc\",\n invMastUid,\n itemId.toUpperCase(),\n includePricing,\n ] as const;\n};\n\n/**\n * Query options for inv mast doc. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getInvMastDocOptions = (\n api: AugurApiClient,\n invMastUid: number,\n itemId: string,\n includePricing: \"Y\" | \"N\",\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getInvMastDocKey(invMastUid, itemId, includePricing),\n queryFn: async (): Promise<TInvMastDoc> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.doc.list\",\n async () => {\n const response = await api.items.invMast.doc.list(invMastUid, {\n itemId: itemId.toUpperCase(),\n includePricing,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n invMastUid,\n itemId,\n includePricing,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig, GetItemCategoryApiOptions } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\ntype ItemCategoryQueryKey = readonly [\n \"itemCategory\",\n number,\n GetItemCategoryApiOptions | undefined,\n];\n\n/**\n * Generates a consistent query key for item category queries.\n * Usable in both client hooks and server-side prefetch.\n */\nexport const getItemCategoryKey = (\n itemCategoryUid: number,\n apiOptions?: GetItemCategoryApiOptions,\n): ItemCategoryQueryKey => {\n return [\"itemCategory\", itemCategoryUid, apiOptions] as const;\n};\n\n/**\n * Query options for item category. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getItemCategoryOptions = (\n api: AugurApiClient,\n itemCategoryUid: number,\n apiOptions?: GetItemCategoryApiOptions,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getItemCategoryKey(itemCategoryUid, apiOptions),\n queryFn: async (): Promise<TCategory> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.categories.get\",\n async () => {\n const response = await api.items.categories.get(\n itemCategoryUid,\n { ...apiOptions, ...(edgeCache != null ? { edgeCache } : {}) },\n );\n if (!response.data) throw new Error(\"Item category not found\");\n return response.data;\n },\n itemCategoryUid,\n apiOptions,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getInvMastKey = (invMastUid: number, itemId: string) => {\n return [\"invMast\", invMastUid, itemId.toUpperCase()] as const;\n};\n\nexport const getInvMastOptions = (\n api: AugurApiClient,\n invMastUid: number,\n itemId: string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getInvMastKey(invMastUid, itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.get\",\n async () => {\n const response = await api.items.invMast.get(invMastUid, {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n invMastUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TStockData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getInvMastStockKey = (invMastUid: number | string) => {\n return [\"invMastStock\", invMastUid] as const;\n};\n\nexport const getInvMastStockOptions = (\n api: AugurApiClient,\n invMastUid: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getInvMastStockKey(invMastUid),\n queryFn: async (): Promise<number> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.stock.list\",\n async () => {\n const response = await api.items.invMast.stock.list(Number(invMastUid), {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n const stockData: TStockData[] = response.data?.stockData ?? [];\n return stockData.reduce(\n (qty: number, stock: TStockData) => qty + stock.qtyOnHand,\n 0,\n );\n },\n invMastUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TInvMastDoc } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { getInvMastDocOptions } from \"./inv-mast-doc\";\nimport { stableStringify } from \"./stable-stringify\";\n\nexport interface BatchInvMastDocParam {\n invMastUid: number;\n itemId: string;\n}\n\n/**\n * Generates a deterministic query key for a batch inv mast doc query.\n * Params are sorted by uppercased itemId to ensure stable keys\n * regardless of input order.\n */\nexport const getBatchInvMastDocKey = (\n params: BatchInvMastDocParam[],\n includePricing: \"Y\" | \"N\",\n) => {\n const sorted = [...params].sort((a, b) =>\n a.itemId.toUpperCase().localeCompare(b.itemId.toUpperCase()),\n );\n return [\n \"batchInvMastDoc\",\n stableStringify(sorted.map((p) => ({ invMastUid: p.invMastUid, itemId: p.itemId.toUpperCase() }))),\n includePricing,\n ] as const;\n};\n\n/**\n * Server-side query options for batch inv mast doc.\n * Uses Promise.all over individual getInvMastDocOptions queryFns\n * since queryClient is not available server-side.\n * Failed items are silently excluded from the result.\n */\nexport const getBatchInvMastDocOptions = (\n api: AugurApiClient,\n params: BatchInvMastDocParam[],\n includePricing: \"Y\" | \"N\",\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getBatchInvMastDocKey(params, includePricing),\n queryFn: async (): Promise<Record<string, TInvMastDoc>> => {\n const results: Record<string, TInvMastDoc> = {};\n const settled = await Promise.allSettled(\n params.map(async (p) => {\n const opts = getInvMastDocOptions(\n api,\n p.invMastUid,\n p.itemId,\n includePricing,\n cache,\n );\n const data = await opts.queryFn();\n return { key: p.itemId.toUpperCase(), data };\n }),\n );\n for (const entry of settled) {\n if (entry.status === \"fulfilled\") {\n results[entry.value.key] = entry.value.data;\n }\n }\n return results;\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { QueryClient } from \"@tanstack/react-query\";\n\nexport interface BatchQueryConfig<TParam, TData> {\n params: TParam[];\n queryClient: QueryClient;\n /** Build individual cache key for a single param. */\n getItemKey: (param: TParam) => readonly unknown[];\n /** Build the string key for the result Record from a param. */\n getResultKey: (param: TParam) => string;\n /** Fetch only uncached items, return keyed Record. */\n fetchItems: (uncached: TParam[]) => Promise<Record<string, TData>>;\n /** Extract individual cache key from a fetched result entry (for seeding). */\n getSeedKey: (resultKey: string, data: TData) => readonly unknown[];\n}\n\n/**\n * Generic batch query executor.\n *\n * 1. Checks queryClient cache for each param\n * 2. Fetches only uncached items in a single batch call\n * 3. Seeds individual cache entries from the response\n * 4. Returns merged cached + fetched record\n */\nexport async function executeBatchQuery<TParam, TData>(\n config: BatchQueryConfig<TParam, TData>,\n): Promise<Record<string, TData>> {\n const { params, queryClient, getItemKey, getResultKey, fetchItems, getSeedKey } = config;\n\n if (params.length === 0) {\n return {};\n }\n\n const cached: Record<string, TData> = {};\n const uncached: TParam[] = [];\n\n for (const param of params) {\n const existing = queryClient.getQueryData<TData>(getItemKey(param));\n if (existing !== undefined) {\n cached[getResultKey(param)] = existing;\n } else {\n uncached.push(param);\n }\n }\n\n if (uncached.length === 0) {\n return cached;\n }\n\n const fetched = await fetchItems(uncached);\n\n for (const [key, data] of Object.entries(fetched)) {\n queryClient.setQueryData(getSeedKey(key, data as TData), data);\n }\n\n return { ...cached, ...fetched };\n}\n","import type { TProductCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\ntype ProductCategoryResponse = {\n itemCategoryDesc: string;\n childrenTotal: number;\n children: TProductCategory[];\n categoryImage: string | null;\n};\n\nexport const getProductCategoryKey = (\n itemCategoryUid: number | string | null,\n) => {\n return [\"productCategory\", itemCategoryUid] as const;\n};\n\nexport const getProductCategoryOptions = (\n api: AugurApiClient,\n itemCategoryUid: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getProductCategoryKey(itemCategoryUid),\n queryFn: async (): Promise<ProductCategoryResponse> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.categories.get\",\n async () => {\n const response = await api.items.categories.get(Number(itemCategoryUid), {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n itemCategoryUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getItemDetailsKey = (itemId: number | string) => {\n const normalizedId = typeof itemId === \"string\" ? itemId.toUpperCase() : itemId;\n return [\"itemDetails\", normalizedId] as const;\n};\n\nexport const getItemDetailsOptions = (\n api: AugurApiClient,\n itemId: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getItemDetailsKey(itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"items.invMast.doc.list\",\n async () => {\n const response = await api.items.invMast.doc.list(Number(itemId), {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n itemId,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getItemAttributesKey = (\n itemCategoryUid: number | string | null,\n) => {\n return [\"itemAttributes\", itemCategoryUid] as const;\n};\n\nexport const getItemAttributesOptions = (\n api: AugurApiClient,\n itemCategoryUid: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getItemAttributesKey(itemCategoryUid),\n queryFn: async () => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.attributes.list\",\n async () => {\n const response = await api.openSearch.itemSearch.attributes.list({\n q: \"\",\n searchType: \"query\",\n classId5List: String(itemCategoryUid),\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n itemCategoryUid,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { TProductItem } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig, PageData } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\ntype ProductSearchResponse = {\n items: TProductItem[];\n totalResults: number;\n};\n\n/**\n * Generates a consistent query key for product search queries.\n */\nexport const getProductSearchKey = (pageData: PageData) => {\n return [\n \"productSearch\",\n pageData.q,\n pageData.limit,\n pageData.offset,\n pageData.sortBy,\n pageData.itemCategoryUid,\n ] as const;\n};\n\n/**\n * Query options for product search. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getProductSearchOptions = (\n api: AugurApiClient,\n pageData: PageData,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getProductSearchKey(pageData),\n queryFn: async (): Promise<ProductSearchResponse> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.list\",\n async () => {\n const response = await api.openSearch.itemSearch.list({\n q: pageData.q,\n searchType: \"query\",\n size: pageData.limit,\n from: pageData.offset,\n classId5List: pageData.itemCategoryUid\n ? String(pageData.itemCategoryUid)\n : undefined,\n filters: pageData.filters\n ? JSON.stringify(pageData.filters)\n : undefined,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n pageData,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig, SearchSuggestionsResponse } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\n/**\n * Generates a consistent query key for search suggestion queries.\n */\nexport const getSearchSuggestionsKey = (\n query: string,\n limit: number,\n offset: number,\n) => {\n return [\"searchSuggestions\", query, limit, offset] as const;\n};\n\n/**\n * Query options for search suggestions. Accepts the SDK instance so it works\n * in both client (via provider) and server (via direct construction).\n */\nexport const getSearchSuggestionsOptions = (\n api: AugurApiClient,\n query: string,\n limit: number = 10,\n offset: number = 0,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getSearchSuggestionsKey(query, limit, offset),\n queryFn: async (): Promise<SearchSuggestionsResponse> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.suggestions.suggest.list\",\n async () => {\n const response = await api.openSearch.suggestions.suggest.list({\n q: query,\n size: limit,\n from: offset,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data;\n },\n query,\n limit,\n offset,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { getItemPriceOptions } from \"./item-price\";\n\n/**\n * Get cart pricing query options for prefetching or parent components.\n */\nexport function getCartPricingQueryOptions(\n api: AugurApiClient,\n cartLines: Array<{ itemId: string; quantity: number }>,\n customerId: string | number | undefined,\n cache?: CacheConfig,\n) {\n return cartLines.map((line) => ({\n ...getItemPriceOptions(api, line.itemId, customerId, line.quantity, cache),\n enabled: !!customerId && !!line.itemId,\n }));\n}\n","import {\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nimport { stableStringify } from \"./stable-stringify\";\n\nexport const getCategoryItemsInfiniteKey = (\n itemCategoryUid: number,\n itemsFilters: TItemsFilters,\n) => {\n return [\n \"categoryItemsInfinite\",\n itemCategoryUid,\n stableStringify(itemsFilters),\n ] as const;\n};\n\n/**\n * Full infinite query options for category items.\n * Usable for server-side prefetch with `queryClient.prefetchInfiniteQuery()`.\n */\nexport const getCategoryItemsInfiniteOptions = (\n api: AugurApiClient,\n itemCategoryUid: number,\n itemsFilters: TItemsFilters,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getCategoryItemsInfiniteKey(itemCategoryUid, itemsFilters),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.list\",\n async () => {\n const response = await api.openSearch.itemSearch.list({\n q: itemsFilters.q || \"\",\n searchType: \"query\",\n size: itemsFilters.limit,\n from: pageParam as number,\n classId5List: String(itemCategoryUid),\n filters: itemsFilters.filters?.length\n ? JSON.stringify(itemsFilters.filters)\n : undefined,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n const items: TProductItem[] = response.data?.items ?? [];\n const total: number = response.data?.totalResults ?? 0;\n const nextOffset = (pageParam as number) + itemsFilters.limit;\n return {\n data: items,\n total,\n nextCursor: nextOffset < total ? nextOffset : undefined,\n };\n },\n itemCategoryUid, itemsFilters, pageParam,\n );\n },\n initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import {\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nimport { stableStringify } from \"./stable-stringify\";\n\nexport const getItemSearchInfiniteKey = (\n itemsFilters: TItemsFilters,\n itemCategoryUid?: number | string,\n) => {\n return [\n \"itemSearchInfinite\",\n stableStringify(itemsFilters),\n itemCategoryUid,\n ] as const;\n};\n\n/**\n * Full infinite query options for item search.\n * Usable for server-side prefetch with `queryClient.prefetchInfiniteQuery()`.\n */\nexport const getItemSearchInfiniteOptions = (\n api: AugurApiClient,\n itemsFilters: TItemsFilters,\n itemCategoryUid?: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getItemSearchInfiniteKey(itemsFilters, itemCategoryUid),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"openSearch.itemSearch.list\",\n async () => {\n const response = await api.openSearch.itemSearch.list({\n q: itemsFilters.q,\n searchType: \"query\",\n size: itemsFilters.limit,\n from: pageParam as number,\n classId5List: itemCategoryUid ? String(itemCategoryUid) : undefined,\n filters: itemsFilters.filters?.length\n ? JSON.stringify(itemsFilters.filters)\n : undefined,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n const items: TProductItem[] = response.data?.items ?? [];\n const total: number = response.data?.totalResults ?? 0;\n const nextOffset = (pageParam as number) + itemsFilters.limit;\n return {\n data: items,\n total,\n nextCursor: nextOffset < total ? nextOffset : undefined,\n };\n },\n itemsFilters, itemCategoryUid, pageParam,\n );\n },\n initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n meta: { persist: true },\n };\n};\n","import type { TJoomlaContent } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaContentKey = (articleId: number | string) => {\n return [\"joomlaContent\", articleId] as const;\n};\n\nexport const getJoomlaContentOptions = (\n api: AugurApiClient,\n articleId: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getJoomlaContentKey(articleId),\n queryFn: async (): Promise<TJoomlaContent> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.content.doc.get\",\n async () => {\n const response = await api.joomla.content.doc.get(articleId, {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Article not found\");\n return response.data;\n },\n articleId,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import {\n type TJoomlaContent,\n type TJoomlaContentFilters,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaContentListKey = (\n categoryId: number | string,\n filters?: Partial<TJoomlaContentFilters>,\n) => {\n return [\"joomlaContentList\", categoryId, filters] as const;\n};\n\nexport const getJoomlaContentListOptions = (\n api: AugurApiClient,\n categoryId: number | string,\n filters?: Partial<TJoomlaContentFilters>,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getJoomlaContentListKey(categoryId, filters),\n queryFn: async (): Promise<TJoomlaContent[]> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.content.list\",\n async () => {\n const response = await api.joomla.content.list({\n catid: categoryId,\n ...filters,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data ?? [];\n },\n categoryId, filters,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { MenuItem, TMenuFilters } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaMenuKey = (\n filters?: Partial<TMenuFilters>,\n) => {\n return [\"joomlaMenu\", filters] as const;\n};\n\nexport const getJoomlaMenuOptions = (\n api: AugurApiClient,\n filters?: Partial<TMenuFilters>,\n cache?: CacheConfig,\n) => {\n const tier = cache?.semiStatic;\n return {\n queryKey: getJoomlaMenuKey(filters),\n queryFn: async (): Promise<MenuItem[]> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.menu.list\",\n async () => {\n const response = await api.joomla.menu.list({\n ...filters,\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n return response.data ?? [];\n },\n filters,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","import type { MenuItem } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { CacheConfig } from \"../types\";\nimport { withCache } from \"./cache-helper\";\n\nexport const getJoomlaMenuDocKey = (menuId: number | string) => {\n return [\"joomlaMenuDoc\", menuId] as const;\n};\n\nexport const getJoomlaMenuDocOptions = (\n api: AugurApiClient,\n menuId: number | string,\n cache?: CacheConfig,\n) => {\n const tier = cache?.static;\n return {\n queryKey: getJoomlaMenuDocKey(menuId),\n queryFn: async (): Promise<MenuItem> => {\n const edgeCache = tier?.edgeCache;\n return withCache(\n cache?.provider,\n tier,\n \"joomla.menu.doc.get\",\n async () => {\n const response = await api.joomla.menu.doc.get(menuId, {\n ...(edgeCache != null ? { edgeCache } : {}),\n });\n if (!response.data) throw new Error(\"Menu item not found\");\n return response.data;\n },\n menuId,\n );\n },\n staleTime: tier?.staleTime,\n gcTime: tier?.gcTime,\n };\n};\n","export const getCustomerOrdersKey = (\n customerId: number | string | undefined,\n params?: Record<string, unknown>,\n) => {\n return [\"customerOrders\", customerId, params] as const;\n};\n\nexport const getCustomerOrderDetailKey = (\n customerId: number | string | undefined,\n orderId: number | string | undefined,\n) => {\n return [\"customerOrderDetail\", customerId, orderId] as const;\n};\n","export const getCustomerInvoicesKey = (\n customerId: number | string | undefined,\n params?: Record<string, unknown>,\n) => {\n return [\"customerInvoices\", customerId, params] as const;\n};\n\nexport const getCustomerInvoiceDetailKey = (\n customerId: number | string | undefined,\n invoiceNo: number | string | undefined,\n) => {\n return [\"customerInvoiceDetail\", customerId, invoiceNo] as const;\n};\n","export const getCustomerQuotesKey = (\n customerId: number | string | undefined,\n params?: Record<string, unknown>,\n) => {\n return [\"customerQuotes\", customerId, params] as const;\n};\n\nexport const getCustomerQuoteDetailKey = (\n customerId: number | string | undefined,\n quoteNo: number | string | undefined,\n) => {\n return [\"customerQuoteDetail\", customerId, quoteNo] as const;\n};\n"],"mappings":";AAIO,SAAS,gBAAgB,OAAwB;AACtD,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO,KAAK,UAAU,KAAK;AACtE,MAAI,OAAO,UAAU,SAAU,QAAO,KAAK,UAAU,KAAK;AAC1D,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,IAAI,MAAM,IAAI,eAAe,EAAE,KAAK,GAAG,CAAC;AAAA,EACjD;AACA,QAAM,MAAM;AACZ,QAAM,OAAO,OAAO,KAAK,GAAG,EAAE,KAAK;AACnC,QAAM,UAAU,KAAK;AAAA,IACnB,CAAC,QAAQ,GAAG,KAAK,UAAU,GAAG,CAAC,IAAI,gBAAgB,IAAI,GAAG,CAAC,CAAC;AAAA,EAC9D;AACA,SAAO,IAAI,QAAQ,KAAK,GAAG,CAAC;AAC9B;;;ACVA,SAAS,MAAM,KAAqB;AAClC,MAAI,IAAI;AACR,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,SAAK,IAAI,WAAW,CAAC;AACrB,QAAI,KAAK,KAAK,GAAG,QAAU;AAAA,EAC7B;AACA,UAAQ,MAAM,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAC/C;AAeA,eAAsB,UACpB,UACA,MACA,YACA,OACG,SACS;AACZ,QAAM,WAAW,M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