@simpleapps-com/augur-hooks 0.1.8 → 0.1.9

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.
@@ -37,6 +37,7 @@ var getInvMastDocOptions = (api, invMastUid, itemId, includePricing) => ({
37
37
  queryKey: getInvMastDocKey(invMastUid, itemId, includePricing),
38
38
  queryFn: async () => {
39
39
  const response = await api.items.invMast.doc.list(invMastUid, {
40
+ itemId: itemId.toUpperCase(),
40
41
  includePricing
41
42
  });
42
43
  if (!response.data) throw new Error("Item not found");
@@ -186,7 +187,9 @@ var getSearchSuggestionsOptions = (api, query, limit = 10, offset = 0) => ({
186
187
  queryKey: getSearchSuggestionsKey(query, limit, offset),
187
188
  queryFn: async () => {
188
189
  const response = await api.openSearch.suggestions.suggest.list({
189
- q: query
190
+ q: query,
191
+ size: limit,
192
+ from: offset
190
193
  });
191
194
  return response.data;
192
195
  },
@@ -293,6 +296,48 @@ var getItemSearchInfiniteOptions = (api, itemsFilters, itemCategoryUid) => ({
293
296
  meta: { persist: true }
294
297
  });
295
298
 
299
+ // src/queries/joomla-content.ts
300
+
301
+ var JOOMLA_CONTENT_CACHE_OPTIONS = _augurutils.CACHE_CONFIG.STATIC;
302
+ var getJoomlaContentKey = (articleId) => {
303
+ return ["joomlaContent", articleId];
304
+ };
305
+ var getJoomlaContentOptions = (api, articleId) => ({
306
+ queryKey: getJoomlaContentKey(articleId),
307
+ queryFn: async () => {
308
+ const response = await api.joomla.content.doc.get(articleId);
309
+ if (!response.data) throw new Error("Article not found");
310
+ return response.data;
311
+ },
312
+ ...JOOMLA_CONTENT_CACHE_OPTIONS
313
+ });
314
+
315
+ // src/queries/joomla-content-list.ts
316
+
317
+
318
+
319
+ var JOOMLA_CONTENT_LIST_CACHE_OPTIONS = _augurutils.CACHE_CONFIG.SEMI_STATIC;
320
+ var getJoomlaContentListKey = (categoryId, filters) => {
321
+ return ["joomlaContentList", categoryId, filters];
322
+ };
323
+ var getJoomlaContentListOptions = (api, categoryId, filters) => ({
324
+ queryKey: getJoomlaContentListKey(categoryId, filters),
325
+ queryFn: async () => {
326
+ const response = await api.joomla.content.list({
327
+ catid: categoryId,
328
+ ...filters
329
+ });
330
+ return _nullishCoalesce(response.data, () => ( []));
331
+ },
332
+ ...JOOMLA_CONTENT_LIST_CACHE_OPTIONS
333
+ });
334
+
335
+
336
+
337
+
338
+
339
+
340
+
296
341
 
297
342
 
298
343
 
@@ -325,5 +370,5 @@ var getItemSearchInfiniteOptions = (api, itemsFilters, itemCategoryUid) => ({
325
370
 
326
371
 
327
372
 
328
- exports.PRICE_CACHE_OPTIONS = PRICE_CACHE_OPTIONS; exports.getItemPriceKey = getItemPriceKey; exports.getItemPriceOptions = getItemPriceOptions; exports.INV_MAST_DOC_CACHE_OPTIONS = INV_MAST_DOC_CACHE_OPTIONS; exports.getInvMastDocKey = getInvMastDocKey; exports.getInvMastDocOptions = getInvMastDocOptions; exports.CATEGORY_CACHE_OPTIONS = CATEGORY_CACHE_OPTIONS; exports.getItemCategoryKey = getItemCategoryKey; exports.getItemCategoryOptions = getItemCategoryOptions; exports.INV_MAST_CACHE_OPTIONS = INV_MAST_CACHE_OPTIONS; exports.getInvMastKey = getInvMastKey; exports.getInvMastOptions = getInvMastOptions; exports.getInvMastStockKey = getInvMastStockKey; exports.getInvMastStockOptions = getInvMastStockOptions; exports.getProductCategoryKey = getProductCategoryKey; exports.getProductCategoryOptions = getProductCategoryOptions; exports.getItemDetailsKey = getItemDetailsKey; exports.getItemDetailsOptions = getItemDetailsOptions; exports.getItemAttributesKey = getItemAttributesKey; exports.getItemAttributesOptions = getItemAttributesOptions; exports.getProductSearchKey = getProductSearchKey; exports.getProductSearchOptions = getProductSearchOptions; exports.SEARCH_SUGGESTIONS_CACHE_OPTIONS = SEARCH_SUGGESTIONS_CACHE_OPTIONS; exports.getSearchSuggestionsKey = getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = getSearchSuggestionsOptions; exports.getCartPricingQueryOptions = getCartPricingQueryOptions; exports.stableStringify = stableStringify; exports.getCategoryItemsInfiniteKey = getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = getCategoryItemsInfiniteOptions; exports.getItemSearchInfiniteKey = getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = getItemSearchInfiniteOptions;
329
- //# sourceMappingURL=chunk-XTEAAXJ4.cjs.map
373
+ exports.PRICE_CACHE_OPTIONS = PRICE_CACHE_OPTIONS; exports.getItemPriceKey = getItemPriceKey; exports.getItemPriceOptions = getItemPriceOptions; exports.INV_MAST_DOC_CACHE_OPTIONS = INV_MAST_DOC_CACHE_OPTIONS; exports.getInvMastDocKey = getInvMastDocKey; exports.getInvMastDocOptions = getInvMastDocOptions; exports.CATEGORY_CACHE_OPTIONS = CATEGORY_CACHE_OPTIONS; exports.getItemCategoryKey = getItemCategoryKey; exports.getItemCategoryOptions = getItemCategoryOptions; exports.INV_MAST_CACHE_OPTIONS = INV_MAST_CACHE_OPTIONS; exports.getInvMastKey = getInvMastKey; exports.getInvMastOptions = getInvMastOptions; exports.getInvMastStockKey = getInvMastStockKey; exports.getInvMastStockOptions = getInvMastStockOptions; exports.getProductCategoryKey = getProductCategoryKey; exports.getProductCategoryOptions = getProductCategoryOptions; exports.getItemDetailsKey = getItemDetailsKey; exports.getItemDetailsOptions = getItemDetailsOptions; exports.getItemAttributesKey = getItemAttributesKey; exports.getItemAttributesOptions = getItemAttributesOptions; exports.getProductSearchKey = getProductSearchKey; exports.getProductSearchOptions = getProductSearchOptions; exports.SEARCH_SUGGESTIONS_CACHE_OPTIONS = SEARCH_SUGGESTIONS_CACHE_OPTIONS; exports.getSearchSuggestionsKey = getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = getSearchSuggestionsOptions; exports.getCartPricingQueryOptions = getCartPricingQueryOptions; exports.stableStringify = stableStringify; exports.getCategoryItemsInfiniteKey = getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = getCategoryItemsInfiniteOptions; exports.getItemSearchInfiniteKey = getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = getItemSearchInfiniteOptions; exports.JOOMLA_CONTENT_CACHE_OPTIONS = JOOMLA_CONTENT_CACHE_OPTIONS; exports.getJoomlaContentKey = getJoomlaContentKey; exports.getJoomlaContentOptions = getJoomlaContentOptions; exports.JOOMLA_CONTENT_LIST_CACHE_OPTIONS = JOOMLA_CONTENT_LIST_CACHE_OPTIONS; exports.getJoomlaContentListKey = getJoomlaContentListKey; exports.getJoomlaContentListOptions = getJoomlaContentListOptions;
374
+ //# sourceMappingURL=chunk-ENELW5AU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/augur-packages/augur-packages/packages/augur-hooks/dist/chunk-ENELW5AU.cjs","../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/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/stable-stringify.ts","../src/queries/category-items-infinite.ts","../src/queries/item-search-infinite.ts","../src/queries/joomla-content.ts","../src/queries/joomla-content-list.ts"],"names":["CACHE_CONFIG"],"mappings":"AAAA;ACAA,yDAA8C;AAGvC,IAAM,oBAAA,EAAsB;AAAA,EACjC,GAAG,wBAAA,CAAa,WAAA;AAAA,EAChB,kBAAA,EAAoB,IAAA;AAAA,EACpB,oBAAA,EAAsB,KAAA;AAAA,EACtB,IAAA,EAAM,EAAE,OAAA,EAAS,KAAK;AACxB,CAAA;AAMO,IAAM,gBAAA,EAAkB,CAC7B,MAAA,EACA,UAAA,EACA,SAAA,EAAmB,CAAA,EAAA,GAChB;AACH,EAAA,OAAO,CAAC,OAAA,kBAAS,MAAA,2BAAQ,WAAA,mBAAY,IAAA,GAAK,EAAA,EAAI,UAAA,EAAY,QAAQ,CAAA;AACpE,CAAA;AAMO,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GA,EAAAA;AACL;AbyMc;AACA;AcnQd;AACE;AAGK;AAKM;AAIJ,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACF,EAAA;AACF;AAMa;AAKD,EAAA;AACD,EAAA;AACP,IAAA;AAGiC,EAAA;AAC3B,IAAA;AACD,MAAA;AACH,MAAA;AACM,MAAA;AACA,MAAA;AACN,MAAA;AACA,MAAA;AAGD,IAAA;AACK,IAAA;AACA,IAAA;AACA,IAAA;AACC,IAAA;AACC,MAAA;AACN,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AACA,EAAA;AACA,EAAA;AACGA,EAAAA;AACK,EAAA;AACV;Ad+Oc;AACA;Ae1SL;AAGI;AAEA;AACH,EAAA;AACV;AAEa;AAID,EAAA;AACD,EAAA;AACD,IAAA;AACD,IAAA;AACE,IAAA;AACT,EAAA;AACG,EAAA;AACL;AfqSc;AACA;AgB1Td;AACE;AAGK;AAGM;AAEA;AAIH,EAAA;AACV;AAEa;AAKD,EAAA;AACD,EAAA;AACD,IAAA;AACG,MAAA;AACJ,MAAA;AACJ,IAAA;AACM,IAAA;AACT,EAAA;AACG,EAAA;AACL;AhB+Sc;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-ENELW5AU.cjs","sourcesContent":[null,"import { CACHE_CONFIG, type TPriceData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const PRICE_CACHE_OPTIONS = {\n ...CACHE_CONFIG.SEMI_STATIC,\n refetchOnReconnect: true,\n refetchOnWindowFocus: false,\n meta: { persist: true },\n} as const;\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) => ({\n queryKey: getItemPriceKey(itemId, customerId, quantity),\n queryFn: async (): Promise<TPriceData> => {\n const response = await api.pricing.priceEngine.get({\n itemId: itemId?.toUpperCase() || \"\",\n customerId: Number(customerId),\n quantity,\n });\n return response.data;\n },\n ...PRICE_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TInvMastDoc } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const INV_MAST_DOC_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getInvMastDocKey(invMastUid, itemId, includePricing),\n queryFn: async (): Promise<TInvMastDoc> => {\n const response = await api.items.invMast.doc.list(invMastUid, {\n itemId: itemId.toUpperCase(),\n includePricing,\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n ...INV_MAST_DOC_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { GetItemCategoryApiOptions } from \"../types\";\n\nexport const CATEGORY_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getItemCategoryKey(itemCategoryUid, apiOptions),\n queryFn: async (): Promise<TCategory> => {\n const response = await api.items.itemCategory.get(\n itemCategoryUid,\n apiOptions,\n );\n if (!response.data) throw new Error(\"Item category not found\");\n return response.data;\n },\n ...CATEGORY_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const INV_MAST_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getInvMastKey(invMastUid, itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const response = await api.items.invMast.get(invMastUid);\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n ...INV_MAST_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TStockData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getInvMastStockKey(invMastUid),\n queryFn: async (): Promise<number> => {\n const response = await api.items.invMast.stock.list(Number(invMastUid));\n const stockData: TStockData[] = response.data?.stockData ?? [];\n return stockData.reduce(\n (qty: number, stock: TStockData) => qty + stock.qtyOnHand,\n 0,\n );\n },\n ...CACHE_CONFIG.SEMI_STATIC,\n});\n","import { CACHE_CONFIG, type TProductCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getProductCategoryKey(itemCategoryUid),\n queryFn: async (): Promise<ProductCategoryResponse> => {\n const response = await api.items.itemCategory.get(\n Number(itemCategoryUid),\n );\n return response.data;\n },\n ...CACHE_CONFIG.STATIC,\n});\n","import { CACHE_CONFIG, type TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getItemDetailsKey(itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const response = await api.items.invMast.doc.list(Number(itemId));\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n ...CACHE_CONFIG.STATIC,\n});\n","import { CACHE_CONFIG } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getItemAttributesKey(itemCategoryUid),\n queryFn: async () => {\n const response = await api.openSearch.itemSearch.attributes.list({\n q: \"\",\n searchType: \"query\",\n classId5List: String(itemCategoryUid),\n });\n return response.data;\n },\n ...CACHE_CONFIG.STATIC,\n});\n","import { CACHE_CONFIG, type TProductItem } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { PageData } from \"../types\";\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) => ({\n queryKey: getProductSearchKey(pageData),\n queryFn: async (): Promise<ProductSearchResponse> => {\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 });\n return response.data;\n },\n ...CACHE_CONFIG.SEMI_STATIC,\n});\n","import { CACHE_CONFIG } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { SearchSuggestionsResponse } from \"../types\";\n\nexport const SEARCH_SUGGESTIONS_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getSearchSuggestionsKey(query, limit, offset),\n queryFn: async (): Promise<SearchSuggestionsResponse> => {\n const response = await api.openSearch.suggestions.suggest.list({\n q: query,\n size: limit,\n from: offset,\n });\n return response.data;\n },\n ...SEARCH_SUGGESTIONS_CACHE_OPTIONS,\n});\n","import type { AugurApiClient } from \"../provider\";\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) {\n return cartLines.map((line) => ({\n ...getItemPriceOptions(api, line.itemId, customerId, line.quantity),\n enabled: !!customerId && !!line.itemId,\n }));\n}\n","/**\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 {\n CACHE_CONFIG,\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\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) => ({\n queryKey: getCategoryItemsInfiniteKey(itemCategoryUid, itemsFilters),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\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 });\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 initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n ...CACHE_CONFIG.SEMI_STATIC,\n});\n","import {\n CACHE_CONFIG,\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\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) => ({\n queryKey: getItemSearchInfiniteKey(itemsFilters, itemCategoryUid),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\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 });\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 initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n ...CACHE_CONFIG.SEMI_STATIC,\n meta: { persist: true },\n});\n","import { CACHE_CONFIG, type TJoomlaContent } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const JOOMLA_CONTENT_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getJoomlaContentKey(articleId),\n queryFn: async (): Promise<TJoomlaContent> => {\n const response = await api.joomla.content.doc.get(articleId);\n if (!response.data) throw new Error(\"Article not found\");\n return response.data;\n },\n ...JOOMLA_CONTENT_CACHE_OPTIONS,\n});\n","import {\n CACHE_CONFIG,\n type TJoomlaContent,\n type TJoomlaContentFilters,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const JOOMLA_CONTENT_LIST_CACHE_OPTIONS = CACHE_CONFIG.SEMI_STATIC;\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) => ({\n queryKey: getJoomlaContentListKey(categoryId, filters),\n queryFn: async (): Promise<TJoomlaContent[]> => {\n const response = await api.joomla.content.list({\n catid: categoryId,\n ...filters,\n });\n return response.data ?? [];\n },\n ...JOOMLA_CONTENT_LIST_CACHE_OPTIONS,\n});\n"]}
@@ -37,6 +37,7 @@ var getInvMastDocOptions = (api, invMastUid, itemId, includePricing) => ({
37
37
  queryKey: getInvMastDocKey(invMastUid, itemId, includePricing),
38
38
  queryFn: async () => {
39
39
  const response = await api.items.invMast.doc.list(invMastUid, {
40
+ itemId: itemId.toUpperCase(),
40
41
  includePricing
41
42
  });
42
43
  if (!response.data) throw new Error("Item not found");
@@ -186,7 +187,9 @@ var getSearchSuggestionsOptions = (api, query, limit = 10, offset = 0) => ({
186
187
  queryKey: getSearchSuggestionsKey(query, limit, offset),
187
188
  queryFn: async () => {
188
189
  const response = await api.openSearch.suggestions.suggest.list({
189
- q: query
190
+ q: query,
191
+ size: limit,
192
+ from: offset
190
193
  });
191
194
  return response.data;
192
195
  },
@@ -293,6 +296,42 @@ var getItemSearchInfiniteOptions = (api, itemsFilters, itemCategoryUid) => ({
293
296
  meta: { persist: true }
294
297
  });
295
298
 
299
+ // src/queries/joomla-content.ts
300
+ import { CACHE_CONFIG as CACHE_CONFIG13 } from "@simpleapps-com/augur-utils";
301
+ var JOOMLA_CONTENT_CACHE_OPTIONS = CACHE_CONFIG13.STATIC;
302
+ var getJoomlaContentKey = (articleId) => {
303
+ return ["joomlaContent", articleId];
304
+ };
305
+ var getJoomlaContentOptions = (api, articleId) => ({
306
+ queryKey: getJoomlaContentKey(articleId),
307
+ queryFn: async () => {
308
+ const response = await api.joomla.content.doc.get(articleId);
309
+ if (!response.data) throw new Error("Article not found");
310
+ return response.data;
311
+ },
312
+ ...JOOMLA_CONTENT_CACHE_OPTIONS
313
+ });
314
+
315
+ // src/queries/joomla-content-list.ts
316
+ import {
317
+ CACHE_CONFIG as CACHE_CONFIG14
318
+ } from "@simpleapps-com/augur-utils";
319
+ var JOOMLA_CONTENT_LIST_CACHE_OPTIONS = CACHE_CONFIG14.SEMI_STATIC;
320
+ var getJoomlaContentListKey = (categoryId, filters) => {
321
+ return ["joomlaContentList", categoryId, filters];
322
+ };
323
+ var getJoomlaContentListOptions = (api, categoryId, filters) => ({
324
+ queryKey: getJoomlaContentListKey(categoryId, filters),
325
+ queryFn: async () => {
326
+ const response = await api.joomla.content.list({
327
+ catid: categoryId,
328
+ ...filters
329
+ });
330
+ return response.data ?? [];
331
+ },
332
+ ...JOOMLA_CONTENT_LIST_CACHE_OPTIONS
333
+ });
334
+
296
335
  export {
297
336
  PRICE_CACHE_OPTIONS,
298
337
  getItemPriceKey,
@@ -324,6 +363,12 @@ export {
324
363
  getCategoryItemsInfiniteKey,
325
364
  getCategoryItemsInfiniteOptions,
326
365
  getItemSearchInfiniteKey,
327
- getItemSearchInfiniteOptions
366
+ getItemSearchInfiniteOptions,
367
+ JOOMLA_CONTENT_CACHE_OPTIONS,
368
+ getJoomlaContentKey,
369
+ getJoomlaContentOptions,
370
+ JOOMLA_CONTENT_LIST_CACHE_OPTIONS,
371
+ getJoomlaContentListKey,
372
+ getJoomlaContentListOptions
328
373
  };
329
- //# sourceMappingURL=chunk-IGWLRQ6Y.js.map
374
+ //# sourceMappingURL=chunk-TUNAYTS6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../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/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/stable-stringify.ts","../src/queries/category-items-infinite.ts","../src/queries/item-search-infinite.ts","../src/queries/joomla-content.ts","../src/queries/joomla-content-list.ts"],"sourcesContent":["import { CACHE_CONFIG, type TPriceData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const PRICE_CACHE_OPTIONS = {\n ...CACHE_CONFIG.SEMI_STATIC,\n refetchOnReconnect: true,\n refetchOnWindowFocus: false,\n meta: { persist: true },\n} as const;\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) => ({\n queryKey: getItemPriceKey(itemId, customerId, quantity),\n queryFn: async (): Promise<TPriceData> => {\n const response = await api.pricing.priceEngine.get({\n itemId: itemId?.toUpperCase() || \"\",\n customerId: Number(customerId),\n quantity,\n });\n return response.data;\n },\n ...PRICE_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TInvMastDoc } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const INV_MAST_DOC_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getInvMastDocKey(invMastUid, itemId, includePricing),\n queryFn: async (): Promise<TInvMastDoc> => {\n const response = await api.items.invMast.doc.list(invMastUid, {\n itemId: itemId.toUpperCase(),\n includePricing,\n });\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n ...INV_MAST_DOC_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { GetItemCategoryApiOptions } from \"../types\";\n\nexport const CATEGORY_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getItemCategoryKey(itemCategoryUid, apiOptions),\n queryFn: async (): Promise<TCategory> => {\n const response = await api.items.itemCategory.get(\n itemCategoryUid,\n apiOptions,\n );\n if (!response.data) throw new Error(\"Item category not found\");\n return response.data;\n },\n ...CATEGORY_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const INV_MAST_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getInvMastKey(invMastUid, itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const response = await api.items.invMast.get(invMastUid);\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n ...INV_MAST_CACHE_OPTIONS,\n});\n","import { CACHE_CONFIG, type TStockData } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getInvMastStockKey(invMastUid),\n queryFn: async (): Promise<number> => {\n const response = await api.items.invMast.stock.list(Number(invMastUid));\n const stockData: TStockData[] = response.data?.stockData ?? [];\n return stockData.reduce(\n (qty: number, stock: TStockData) => qty + stock.qtyOnHand,\n 0,\n );\n },\n ...CACHE_CONFIG.SEMI_STATIC,\n});\n","import { CACHE_CONFIG, type TProductCategory } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getProductCategoryKey(itemCategoryUid),\n queryFn: async (): Promise<ProductCategoryResponse> => {\n const response = await api.items.itemCategory.get(\n Number(itemCategoryUid),\n );\n return response.data;\n },\n ...CACHE_CONFIG.STATIC,\n});\n","import { CACHE_CONFIG, type TItemDetails } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getItemDetailsKey(itemId),\n queryFn: async (): Promise<TItemDetails> => {\n const response = await api.items.invMast.doc.list(Number(itemId));\n if (!response.data) throw new Error(\"Item not found\");\n return response.data;\n },\n ...CACHE_CONFIG.STATIC,\n});\n","import { CACHE_CONFIG } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\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) => ({\n queryKey: getItemAttributesKey(itemCategoryUid),\n queryFn: async () => {\n const response = await api.openSearch.itemSearch.attributes.list({\n q: \"\",\n searchType: \"query\",\n classId5List: String(itemCategoryUid),\n });\n return response.data;\n },\n ...CACHE_CONFIG.STATIC,\n});\n","import { CACHE_CONFIG, type TProductItem } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { PageData } from \"../types\";\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) => ({\n queryKey: getProductSearchKey(pageData),\n queryFn: async (): Promise<ProductSearchResponse> => {\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 });\n return response.data;\n },\n ...CACHE_CONFIG.SEMI_STATIC,\n});\n","import { CACHE_CONFIG } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { SearchSuggestionsResponse } from \"../types\";\n\nexport const SEARCH_SUGGESTIONS_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getSearchSuggestionsKey(query, limit, offset),\n queryFn: async (): Promise<SearchSuggestionsResponse> => {\n const response = await api.openSearch.suggestions.suggest.list({\n q: query,\n size: limit,\n from: offset,\n });\n return response.data;\n },\n ...SEARCH_SUGGESTIONS_CACHE_OPTIONS,\n});\n","import type { AugurApiClient } from \"../provider\";\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) {\n return cartLines.map((line) => ({\n ...getItemPriceOptions(api, line.itemId, customerId, line.quantity),\n enabled: !!customerId && !!line.itemId,\n }));\n}\n","/**\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 {\n CACHE_CONFIG,\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\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) => ({\n queryKey: getCategoryItemsInfiniteKey(itemCategoryUid, itemsFilters),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\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 });\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 initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n ...CACHE_CONFIG.SEMI_STATIC,\n});\n","import {\n CACHE_CONFIG,\n type TItemsFilters,\n type TProductItem,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\nimport type { InfiniteScrollPage } from \"../callbacks\";\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) => ({\n queryKey: getItemSearchInfiniteKey(itemsFilters, itemCategoryUid),\n queryFn: async ({\n pageParam = 0,\n }: {\n pageParam?: unknown;\n }): Promise<InfiniteScrollPage> => {\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 });\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 initialPageParam: 0,\n getNextPageParam: (lastPage: InfiniteScrollPage) => lastPage.nextCursor,\n ...CACHE_CONFIG.SEMI_STATIC,\n meta: { persist: true },\n});\n","import { CACHE_CONFIG, type TJoomlaContent } from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const JOOMLA_CONTENT_CACHE_OPTIONS = CACHE_CONFIG.STATIC;\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) => ({\n queryKey: getJoomlaContentKey(articleId),\n queryFn: async (): Promise<TJoomlaContent> => {\n const response = await api.joomla.content.doc.get(articleId);\n if (!response.data) throw new Error(\"Article not found\");\n return response.data;\n },\n ...JOOMLA_CONTENT_CACHE_OPTIONS,\n});\n","import {\n CACHE_CONFIG,\n type TJoomlaContent,\n type TJoomlaContentFilters,\n} from \"@simpleapps-com/augur-utils\";\nimport type { AugurApiClient } from \"../provider\";\n\nexport const JOOMLA_CONTENT_LIST_CACHE_OPTIONS = CACHE_CONFIG.SEMI_STATIC;\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) => ({\n queryKey: getJoomlaContentListKey(categoryId, filters),\n queryFn: async (): Promise<TJoomlaContent[]> => {\n const response = await api.joomla.content.list({\n catid: categoryId,\n ...filters,\n });\n return response.data ?? [];\n },\n ...JOOMLA_CONTENT_LIST_CACHE_OPTIONS,\n});\n"],"mappings":";AAAA,SAAS,oBAAqC;AAGvC,IAAM,sBAAsB;AAAA,EACjC,GAAG,aAAa;AAAA,EAChB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,MAAM,EAAE,SAAS,KAAK;AACxB;AAMO,IAAM,kBAAkB,CAC7B,QACA,YACA,WAAmB,MAChB;AACH,SAAO,CAAC,SAAS,QAAQ,YAAY,KAAK,IAAI,YAAY,QAAQ;AACpE;AAMO,IAAM,sBAAsB,CACjC,KACA,QACA,YACA,WAAmB,OACf;AAAA,EACJ,UAAU,gBAAgB,QAAQ,YAAY,QAAQ;AAAA,EACtD,SAAS,YAAiC;AACxC,UAAM,WAAW,MAAM,IAAI,QAAQ,YAAY,IAAI;AAAA,MACjD,QAAQ,QAAQ,YAAY,KAAK;AAAA,MACjC,YAAY,OAAO,UAAU;AAAA,MAC7B;AAAA,IACF,CAAC;AACD,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,GAAG;AACL;;;AC1CA,SAAS,gBAAAA,qBAAsC;AAGxC,IAAM,6BAA6BA,cAAa;AAMhD,IAAM,mBAAmB,CAC9B,YACA,QACA,mBACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO,YAAY;AAAA,IACnB;AAAA,EACF;AACF;AAMO,IAAM,uBAAuB,CAClC,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MACN;AAAA,MACA,YAAY,aAAa,QAAQ,aAAa;AAAA,IAChD;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,EAClB,kBAAkB,CAAC,aAAiC,SAAS;AAAA,EAC7D,GAAGC,eAAa;AAAA,EAChB,MAAM,EAAE,SAAS,KAAK;AACxB;;;AC1DA,SAAS,gBAAAC,sBAAyC;AAG3C,IAAM,+BAA+BA,eAAa;AAElD,IAAM,sBAAsB,CAAC,cAA+B;AACjE,SAAO,CAAC,iBAAiB,SAAS;AACpC;AAEO,IAAM,0BAA0B,CACrC,KACA,eACI;AAAA,EACJ,UAAU,oBAAoB,SAAS;AAAA,EACvC,SAAS,YAAqC;AAC5C,UAAM,WAAW,MAAM,IAAI,OAAO,QAAQ,IAAI,IAAI,SAAS;AAC3D,QAAI,CAAC,SAAS,KAAM,OAAM,IAAI,MAAM,mBAAmB;AACvD,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,GAAG;AACL;;;ACpBA;AAAA,EACE,gBAAAC;AAAA,OAGK;AAGA,IAAM,oCAAoCA,eAAa;AAEvD,IAAM,0BAA0B,CACrC,YACA,YACG;AACH,SAAO,CAAC,qBAAqB,YAAY,OAAO;AAClD;AAEO,IAAM,8BAA8B,CACzC,KACA,YACA,aACI;AAAA,EACJ,UAAU,wBAAwB,YAAY,OAAO;AAAA,EACrD,SAAS,YAAuC;AAC9C,UAAM,WAAW,MAAM,IAAI,OAAO,QAAQ,KAAK;AAAA,MAC7C,OAAO;AAAA,MACP,GAAG;AAAA,IACL,CAAC;AACD,WAAO,SAAS,QAAQ,CAAC;AAAA,EAC3B;AAAA,EACA,GAAG;AACL;","names":["CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG","CACHE_CONFIG"]}
package/dist/index.cjs CHANGED
@@ -29,7 +29,13 @@
29
29
 
30
30
 
31
31
 
32
- var _chunkXTEAAXJ4cjs = require('./chunk-XTEAAXJ4.cjs');
32
+
33
+
34
+
35
+
36
+
37
+
38
+ var _chunkENELW5AUcjs = require('./chunk-ENELW5AU.cjs');
33
39
 
34
40
  // src/provider.tsx
35
41
  var _react = require('react');
@@ -157,7 +163,7 @@ function useItemPrice(itemId, customerId, quantity = 1, options = {}) {
157
163
  const callbacks = useAugurCallbacks();
158
164
  const auth = useAugurAuth();
159
165
  const effectiveCustomerId = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _ => _.customerId])));
160
- const defaultOptions = _chunkXTEAAXJ4cjs.getItemPriceOptions.call(void 0, api, itemId, effectiveCustomerId, quantity);
166
+ const defaultOptions = _chunkENELW5AUcjs.getItemPriceOptions.call(void 0, api, itemId, effectiveCustomerId, quantity);
161
167
  const resolvedQueryFn = _nullishCoalesce(options.queryFn, () => ( (_optionalChain([callbacks, 'optionalAccess', _2 => _2.getItemPrice]) ? () => callbacks.getItemPrice(itemId, effectiveCustomerId, quantity) : void 0)));
162
168
  return _reactquery.useQuery.call(void 0, {
163
169
  ...defaultOptions,
@@ -172,7 +178,7 @@ function useItemPrice(itemId, customerId, quantity = 1, options = {}) {
172
178
  function useInvMastDoc(invMastUid, itemId, options = {}) {
173
179
  const api = useAugurApi();
174
180
  const callbacks = useAugurCallbacks();
175
- const queryOpts = _chunkXTEAAXJ4cjs.getInvMastDocOptions.call(void 0,
181
+ const queryOpts = _chunkENELW5AUcjs.getInvMastDocOptions.call(void 0,
176
182
  api,
177
183
  invMastUid,
178
184
  itemId,
@@ -192,7 +198,7 @@ function useInvMastDoc(invMastUid, itemId, options = {}) {
192
198
  function useItemCategory(itemCategoryUid, options = {}) {
193
199
  const api = useAugurApi();
194
200
  const callbacks = useAugurCallbacks();
195
- const queryOpts = _chunkXTEAAXJ4cjs.getItemCategoryOptions.call(void 0,
201
+ const queryOpts = _chunkENELW5AUcjs.getItemCategoryOptions.call(void 0,
196
202
  api,
197
203
  itemCategoryUid,
198
204
  options.apiOptions
@@ -210,7 +216,7 @@ function useItemCategory(itemCategoryUid, options = {}) {
210
216
  function useInvMast(invMastUid, itemId, options = {}) {
211
217
  const api = useAugurApi();
212
218
  const callbacks = useAugurCallbacks();
213
- const queryOpts = _chunkXTEAAXJ4cjs.getInvMastOptions.call(void 0, api, invMastUid, itemId);
219
+ const queryOpts = _chunkENELW5AUcjs.getInvMastOptions.call(void 0, api, invMastUid, itemId);
214
220
  const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
215
221
  ...queryOpts,
216
222
  ..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _5 => _5.getInvMast]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getInvMast(invMastUid, itemId)))) } : {},
@@ -224,7 +230,7 @@ function useInvMast(invMastUid, itemId, options = {}) {
224
230
  function useInvMastStock(invMastUid, options = {}) {
225
231
  const api = useAugurApi();
226
232
  const callbacks = useAugurCallbacks();
227
- const queryOpts = _chunkXTEAAXJ4cjs.getInvMastStockOptions.call(void 0, api, invMastUid);
233
+ const queryOpts = _chunkENELW5AUcjs.getInvMastStockOptions.call(void 0, api, invMastUid);
228
234
  const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
229
235
  ...queryOpts,
230
236
  ..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _6 => _6.getInvMastStock]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getInvMastStock(invMastUid)))) } : {},
@@ -254,8 +260,8 @@ function resolveData(data) {
254
260
  function useProductCategory(itemCategoryUid, options = {}) {
255
261
  const api = useAugurApi();
256
262
  const callbacks = useAugurCallbacks();
257
- const baseOptions = itemCategoryUid ? _chunkXTEAAXJ4cjs.getProductCategoryOptions.call(void 0, api, itemCategoryUid) : {
258
- queryKey: _chunkXTEAAXJ4cjs.getProductCategoryKey.call(void 0, null),
263
+ const baseOptions = itemCategoryUid ? _chunkENELW5AUcjs.getProductCategoryOptions.call(void 0, api, itemCategoryUid) : {
264
+ queryKey: _chunkENELW5AUcjs.getProductCategoryKey.call(void 0, null),
259
265
  /* v8 ignore next */
260
266
  queryFn: () => Promise.reject()
261
267
  };
@@ -282,8 +288,8 @@ function useItemDetails(itemId, options = {}) {
282
288
  const api = useAugurApi();
283
289
  const callbacks = useAugurCallbacks();
284
290
  const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
285
- ...itemId ? _chunkXTEAAXJ4cjs.getItemDetailsOptions.call(void 0, api, itemId) : {
286
- queryKey: _chunkXTEAAXJ4cjs.getItemDetailsKey.call(void 0, ""),
291
+ ...itemId ? _chunkENELW5AUcjs.getItemDetailsOptions.call(void 0, api, itemId) : {
292
+ queryKey: _chunkENELW5AUcjs.getItemDetailsKey.call(void 0, ""),
287
293
  /* v8 ignore next */
288
294
  queryFn: () => Promise.reject()
289
295
  },
@@ -309,8 +315,8 @@ function useItemAttributes(itemCategoryUid, options = {}) {
309
315
  const api = useAugurApi();
310
316
  const callbacks = useAugurCallbacks();
311
317
  const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
312
- ...itemCategoryUid ? _chunkXTEAAXJ4cjs.getItemAttributesOptions.call(void 0, api, itemCategoryUid) : {
313
- queryKey: _chunkXTEAAXJ4cjs.getItemAttributesKey.call(void 0, null),
318
+ ...itemCategoryUid ? _chunkENELW5AUcjs.getItemAttributesOptions.call(void 0, api, itemCategoryUid) : {
319
+ queryKey: _chunkENELW5AUcjs.getItemAttributesKey.call(void 0, null),
314
320
  /* v8 ignore next */
315
321
  queryFn: () => Promise.reject()
316
322
  },
@@ -333,7 +339,7 @@ function useItemAttributes(itemCategoryUid, options = {}) {
333
339
  function useProductSearch(pageData, options = {}) {
334
340
  const api = useAugurApi();
335
341
  const callbacks = useAugurCallbacks();
336
- const defaultOptions = _chunkXTEAAXJ4cjs.getProductSearchOptions.call(void 0, api, pageData);
342
+ const defaultOptions = _chunkENELW5AUcjs.getProductSearchOptions.call(void 0, api, pageData);
337
343
  const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
338
344
  ...defaultOptions,
339
345
  ..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _16 => _16.getProductSearch]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getProductSearch(pageData)))) } : {},
@@ -358,7 +364,7 @@ function useSearchSuggestions(query, options = {}) {
358
364
  const limit = _nullishCoalesce(options.limit, () => ( 10));
359
365
  const offset = _nullishCoalesce(options.offset, () => ( 0));
360
366
  const enabled = (_nullishCoalesce(options.enabled, () => ( true))) && query.trim().length > 0;
361
- const defaultOptions = _chunkXTEAAXJ4cjs.getSearchSuggestionsOptions.call(void 0, api, query, limit, offset);
367
+ const defaultOptions = _chunkENELW5AUcjs.getSearchSuggestionsOptions.call(void 0, api, query, limit, offset);
362
368
  const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
363
369
  ...defaultOptions,
364
370
  ..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _19 => _19.getSearchSuggestions]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getSearchSuggestions(query, limit, offset)))) } : {},
@@ -670,10 +676,10 @@ function useCartPricing(options = {}) {
670
676
  const priceQueries = _reactquery.useQueries.call(void 0, {
671
677
  queries: cartLines.map((line) => {
672
678
  const base = priceFn ? {
673
- queryKey: _chunkXTEAAXJ4cjs.getItemPriceKey.call(void 0, line.itemId, customerId, line.quantity),
679
+ queryKey: _chunkENELW5AUcjs.getItemPriceKey.call(void 0, line.itemId, customerId, line.quantity),
674
680
  queryFn: () => priceFn(line.itemId, customerId, line.quantity),
675
- ..._chunkXTEAAXJ4cjs.PRICE_CACHE_OPTIONS
676
- } : _chunkXTEAAXJ4cjs.getItemPriceOptions.call(void 0, api, line.itemId, customerId, line.quantity);
681
+ ..._chunkENELW5AUcjs.PRICE_CACHE_OPTIONS
682
+ } : _chunkENELW5AUcjs.getItemPriceOptions.call(void 0, api, line.itemId, customerId, line.quantity);
677
683
  return {
678
684
  ...base,
679
685
  enabled: !!customerId && !!line.itemId
@@ -772,7 +778,7 @@ function useCategoryItemsInfinite(itemCategoryUid, itemsFilters, options = {}) {
772
778
  const api = useAugurApi();
773
779
  const callbacks = useAugurCallbacks();
774
780
  const { enabled = true } = options;
775
- const defaultOptions = _chunkXTEAAXJ4cjs.getCategoryItemsInfiniteOptions.call(void 0,
781
+ const defaultOptions = _chunkENELW5AUcjs.getCategoryItemsInfiniteOptions.call(void 0,
776
782
  api,
777
783
  itemCategoryUid,
778
784
  itemsFilters
@@ -797,7 +803,7 @@ function useItemSearchInfinite(itemsFilters, itemCategoryUid, options = {}) {
797
803
  const api = useAugurApi();
798
804
  const callbacks = useAugurCallbacks();
799
805
  const { enabled = true } = options;
800
- const defaultOptions = _chunkXTEAAXJ4cjs.getItemSearchInfiniteOptions.call(void 0,
806
+ const defaultOptions = _chunkENELW5AUcjs.getItemSearchInfiniteOptions.call(void 0,
801
807
  api,
802
808
  itemsFilters,
803
809
  itemCategoryUid
@@ -816,6 +822,111 @@ function useItemSearchInfinite(itemsFilters, itemCategoryUid, options = {}) {
816
822
  });
817
823
  }
818
824
 
825
+ // src/hooks/use-joomla-content.ts
826
+
827
+ function useJoomlaContent(articleId, options = {}) {
828
+ const api = useAugurApi();
829
+ const callbacks = useAugurCallbacks();
830
+ const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
831
+ ...articleId ? _chunkENELW5AUcjs.getJoomlaContentOptions.call(void 0, api, articleId) : {
832
+ queryKey: _chunkENELW5AUcjs.getJoomlaContentKey.call(void 0, ""),
833
+ /* v8 ignore next */
834
+ queryFn: () => Promise.reject()
835
+ },
836
+ ..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _53 => _53.getJoomlaContent]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getJoomlaContent(articleId)))) } : {},
837
+ enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!articleId
838
+ });
839
+ return {
840
+ article: _nullishCoalesce(data, () => ( null)),
841
+ isLoading,
842
+ error
843
+ };
844
+ }
845
+
846
+ // src/hooks/use-joomla-content-list.ts
847
+
848
+ function useJoomlaContentList(categoryId, options = {}) {
849
+ const api = useAugurApi();
850
+ const callbacks = useAugurCallbacks();
851
+ const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
852
+ ...categoryId ? _chunkENELW5AUcjs.getJoomlaContentListOptions.call(void 0, api, categoryId, options.filters) : {
853
+ queryKey: _chunkENELW5AUcjs.getJoomlaContentListKey.call(void 0, ""),
854
+ /* v8 ignore next */
855
+ queryFn: () => Promise.reject()
856
+ },
857
+ ..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _54 => _54.getJoomlaContentList]))) ? {
858
+ queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getJoomlaContentList(categoryId, options.filters))))
859
+ } : {},
860
+ enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!categoryId
861
+ });
862
+ return {
863
+ articles: _nullishCoalesce(data, () => ( [])),
864
+ isLoading,
865
+ error
866
+ };
867
+ }
868
+
869
+ // src/create-site-hooks.ts
870
+
871
+ function createSiteHooks(config = {}) {
872
+ const { callbacks, defaultCustomerId } = config;
873
+ function Provider({ api, auth, children }) {
874
+ const mergedAuth = {
875
+ status: _nullishCoalesce(_optionalChain([auth, 'optionalAccess', _55 => _55.status]), () => ( "unauthenticated")),
876
+ customerId: _nullishCoalesce(_optionalChain([auth, 'optionalAccess', _56 => _56.customerId]), () => ( defaultCustomerId)),
877
+ userId: _optionalChain([auth, 'optionalAccess', _57 => _57.userId]),
878
+ cartHdrUid: _optionalChain([auth, 'optionalAccess', _58 => _58.cartHdrUid])
879
+ };
880
+ return _react.createElement.call(void 0, AugurHooksProvider, {
881
+ api,
882
+ callbacks,
883
+ auth: mergedAuth,
884
+ children
885
+ });
886
+ }
887
+ Provider.displayName = "AugurSiteProvider";
888
+ return {
889
+ Provider,
890
+ // Hooks -- pricing
891
+ useItemPrice,
892
+ useCartPricing,
893
+ // Hooks -- inventory
894
+ useInvMast,
895
+ useInvMastDoc,
896
+ useInvMastStock,
897
+ // Hooks -- items & categories
898
+ useItemCategory,
899
+ useProductCategory,
900
+ useItemDetails,
901
+ useItemAttributes,
902
+ // Hooks -- search
903
+ useProductSearch,
904
+ useSearchSuggestions,
905
+ // Hooks -- cart
906
+ useCartActions,
907
+ useCartInitialization,
908
+ // Hooks -- pagination & infinite scroll
909
+ usePaginationPrefetch,
910
+ useCategoryItemsInfinite,
911
+ useItemSearchInfinite,
912
+ // Hooks -- Joomla
913
+ useJoomlaContent,
914
+ useJoomlaContentList,
915
+ // Hooks -- utilities
916
+ useDebounce,
917
+ useFormatPrice
918
+ };
919
+ }
920
+
921
+
922
+
923
+
924
+
925
+
926
+
927
+
928
+
929
+
819
930
 
820
931
 
821
932
 
@@ -875,5 +986,5 @@ function useItemSearchInfinite(itemsFilters, itemCategoryUid, options = {}) {
875
986
 
876
987
 
877
988
 
878
- exports.AugurHooksProvider = AugurHooksProvider; exports.CATEGORY_CACHE_OPTIONS = _chunkXTEAAXJ4cjs.CATEGORY_CACHE_OPTIONS; exports.INV_MAST_CACHE_OPTIONS = _chunkXTEAAXJ4cjs.INV_MAST_CACHE_OPTIONS; exports.INV_MAST_DOC_CACHE_OPTIONS = _chunkXTEAAXJ4cjs.INV_MAST_DOC_CACHE_OPTIONS; exports.PRICE_CACHE_OPTIONS = _chunkXTEAAXJ4cjs.PRICE_CACHE_OPTIONS; exports.SEARCH_SUGGESTIONS_CACHE_OPTIONS = _chunkXTEAAXJ4cjs.SEARCH_SUGGESTIONS_CACHE_OPTIONS; exports.getCartPricingQueryOptions = _chunkXTEAAXJ4cjs.getCartPricingQueryOptions; exports.getCategoryItemsInfiniteKey = _chunkXTEAAXJ4cjs.getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = _chunkXTEAAXJ4cjs.getCategoryItemsInfiniteOptions; exports.getInvMastDocKey = _chunkXTEAAXJ4cjs.getInvMastDocKey; exports.getInvMastDocOptions = _chunkXTEAAXJ4cjs.getInvMastDocOptions; exports.getInvMastKey = _chunkXTEAAXJ4cjs.getInvMastKey; exports.getInvMastOptions = _chunkXTEAAXJ4cjs.getInvMastOptions; exports.getInvMastStockKey = _chunkXTEAAXJ4cjs.getInvMastStockKey; exports.getInvMastStockOptions = _chunkXTEAAXJ4cjs.getInvMastStockOptions; exports.getItemAttributesKey = _chunkXTEAAXJ4cjs.getItemAttributesKey; exports.getItemAttributesOptions = _chunkXTEAAXJ4cjs.getItemAttributesOptions; exports.getItemCategoryKey = _chunkXTEAAXJ4cjs.getItemCategoryKey; exports.getItemCategoryOptions = _chunkXTEAAXJ4cjs.getItemCategoryOptions; exports.getItemDetailsKey = _chunkXTEAAXJ4cjs.getItemDetailsKey; exports.getItemDetailsOptions = _chunkXTEAAXJ4cjs.getItemDetailsOptions; exports.getItemPriceKey = _chunkXTEAAXJ4cjs.getItemPriceKey; exports.getItemPriceOptions = _chunkXTEAAXJ4cjs.getItemPriceOptions; exports.getItemSearchInfiniteKey = _chunkXTEAAXJ4cjs.getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = _chunkXTEAAXJ4cjs.getItemSearchInfiniteOptions; exports.getProductCategoryKey = _chunkXTEAAXJ4cjs.getProductCategoryKey; exports.getProductCategoryOptions = _chunkXTEAAXJ4cjs.getProductCategoryOptions; exports.getProductSearchKey = _chunkXTEAAXJ4cjs.getProductSearchKey; exports.getProductSearchOptions = _chunkXTEAAXJ4cjs.getProductSearchOptions; exports.getSearchSuggestionsKey = _chunkXTEAAXJ4cjs.getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = _chunkXTEAAXJ4cjs.getSearchSuggestionsOptions; exports.useAugurApi = useAugurApi; exports.useAugurAuth = useAugurAuth; exports.useCartActions = useCartActions; exports.useCartHdrUid = useCartHdrUid; exports.useCartInitialization = useCartInitialization; exports.useCartItemCount = useCartItemCount; exports.useCartLines = useCartLines; exports.useCartPricing = useCartPricing; exports.useCartStore = useCartStore; exports.useCategoryItemsInfinite = useCategoryItemsInfinite; exports.useClearCart = useClearCart; exports.useDebounce = useDebounce; exports.useFormatPrice = useFormatPrice; exports.useInvMast = useInvMast; exports.useInvMastDoc = useInvMastDoc; exports.useInvMastStock = useInvMastStock; exports.useItemAttributes = useItemAttributes; exports.useItemCategory = useItemCategory; exports.useItemDetails = useItemDetails; exports.useItemFiltersStore = useItemFiltersStore; exports.useItemPrice = useItemPrice; exports.useItemSearchInfinite = useItemSearchInfinite; exports.usePaginationPrefetch = usePaginationPrefetch; exports.useProductCategory = useProductCategory; exports.useProductSearch = useProductSearch; exports.useSearchSuggestions = useSearchSuggestions; exports.useSetCartHdrUid = useSetCartHdrUid; exports.useSetCartLines = useSetCartLines;
989
+ exports.AugurHooksProvider = AugurHooksProvider; exports.CATEGORY_CACHE_OPTIONS = _chunkENELW5AUcjs.CATEGORY_CACHE_OPTIONS; exports.INV_MAST_CACHE_OPTIONS = _chunkENELW5AUcjs.INV_MAST_CACHE_OPTIONS; exports.INV_MAST_DOC_CACHE_OPTIONS = _chunkENELW5AUcjs.INV_MAST_DOC_CACHE_OPTIONS; exports.JOOMLA_CONTENT_CACHE_OPTIONS = _chunkENELW5AUcjs.JOOMLA_CONTENT_CACHE_OPTIONS; exports.JOOMLA_CONTENT_LIST_CACHE_OPTIONS = _chunkENELW5AUcjs.JOOMLA_CONTENT_LIST_CACHE_OPTIONS; exports.PRICE_CACHE_OPTIONS = _chunkENELW5AUcjs.PRICE_CACHE_OPTIONS; exports.SEARCH_SUGGESTIONS_CACHE_OPTIONS = _chunkENELW5AUcjs.SEARCH_SUGGESTIONS_CACHE_OPTIONS; exports.createSiteHooks = createSiteHooks; exports.getCartPricingQueryOptions = _chunkENELW5AUcjs.getCartPricingQueryOptions; exports.getCategoryItemsInfiniteKey = _chunkENELW5AUcjs.getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = _chunkENELW5AUcjs.getCategoryItemsInfiniteOptions; exports.getInvMastDocKey = _chunkENELW5AUcjs.getInvMastDocKey; exports.getInvMastDocOptions = _chunkENELW5AUcjs.getInvMastDocOptions; exports.getInvMastKey = _chunkENELW5AUcjs.getInvMastKey; exports.getInvMastOptions = _chunkENELW5AUcjs.getInvMastOptions; exports.getInvMastStockKey = _chunkENELW5AUcjs.getInvMastStockKey; exports.getInvMastStockOptions = _chunkENELW5AUcjs.getInvMastStockOptions; exports.getItemAttributesKey = _chunkENELW5AUcjs.getItemAttributesKey; exports.getItemAttributesOptions = _chunkENELW5AUcjs.getItemAttributesOptions; exports.getItemCategoryKey = _chunkENELW5AUcjs.getItemCategoryKey; exports.getItemCategoryOptions = _chunkENELW5AUcjs.getItemCategoryOptions; exports.getItemDetailsKey = _chunkENELW5AUcjs.getItemDetailsKey; exports.getItemDetailsOptions = _chunkENELW5AUcjs.getItemDetailsOptions; exports.getItemPriceKey = _chunkENELW5AUcjs.getItemPriceKey; exports.getItemPriceOptions = _chunkENELW5AUcjs.getItemPriceOptions; exports.getItemSearchInfiniteKey = _chunkENELW5AUcjs.getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = _chunkENELW5AUcjs.getItemSearchInfiniteOptions; exports.getJoomlaContentKey = _chunkENELW5AUcjs.getJoomlaContentKey; exports.getJoomlaContentListKey = _chunkENELW5AUcjs.getJoomlaContentListKey; exports.getJoomlaContentListOptions = _chunkENELW5AUcjs.getJoomlaContentListOptions; exports.getJoomlaContentOptions = _chunkENELW5AUcjs.getJoomlaContentOptions; exports.getProductCategoryKey = _chunkENELW5AUcjs.getProductCategoryKey; exports.getProductCategoryOptions = _chunkENELW5AUcjs.getProductCategoryOptions; exports.getProductSearchKey = _chunkENELW5AUcjs.getProductSearchKey; exports.getProductSearchOptions = _chunkENELW5AUcjs.getProductSearchOptions; exports.getSearchSuggestionsKey = _chunkENELW5AUcjs.getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = _chunkENELW5AUcjs.getSearchSuggestionsOptions; exports.useAugurApi = useAugurApi; exports.useAugurAuth = useAugurAuth; exports.useCartActions = useCartActions; exports.useCartHdrUid = useCartHdrUid; exports.useCartInitialization = useCartInitialization; exports.useCartItemCount = useCartItemCount; exports.useCartLines = useCartLines; exports.useCartPricing = useCartPricing; exports.useCartStore = useCartStore; exports.useCategoryItemsInfinite = useCategoryItemsInfinite; exports.useClearCart = useClearCart; exports.useDebounce = useDebounce; exports.useFormatPrice = useFormatPrice; exports.useInvMast = useInvMast; exports.useInvMastDoc = useInvMastDoc; exports.useInvMastStock = useInvMastStock; exports.useItemAttributes = useItemAttributes; exports.useItemCategory = useItemCategory; exports.useItemDetails = useItemDetails; exports.useItemFiltersStore = useItemFiltersStore; exports.useItemPrice = useItemPrice; exports.useItemSearchInfinite = useItemSearchInfinite; exports.useJoomlaContent = useJoomlaContent; exports.useJoomlaContentList = useJoomlaContentList; exports.usePaginationPrefetch = usePaginationPrefetch; exports.useProductCategory = useProductCategory; exports.useProductSearch = useProductSearch; exports.useSearchSuggestions = useSearchSuggestions; exports.useSetCartHdrUid = useSetCartHdrUid; exports.useSetCartLines = useSetCartLines;
879
990
  //# sourceMappingURL=index.cjs.map