@simpleapps-com/augur-hooks 0.3.0 → 0.4.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/{chunk-XPZVNYPR.js → chunk-CL3XM5B5.js} +94 -2
- package/dist/chunk-CL3XM5B5.js.map +1 -0
- package/dist/{chunk-IYEN7NGC.cjs → chunk-I3JHJMQ6.cjs} +94 -2
- package/dist/chunk-I3JHJMQ6.cjs.map +1 -0
- package/dist/{joomla-content-list-D-DV69o0.d.cts → customer-quotes-SdLKX_-8.d.cts} +52 -2
- package/dist/{joomla-content-list-D-DV69o0.d.ts → customer-quotes-SdLKX_-8.d.ts} +52 -2
- package/dist/index.cjs +214 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -4
- package/dist/index.d.ts +105 -4
- package/dist/index.js +185 -1
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +22 -2
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +21 -1
- package/package.json +3 -3
- package/dist/chunk-IYEN7NGC.cjs.map +0 -1
- package/dist/chunk-XPZVNYPR.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GetItemCategoryApiOptions, P as PageData, S as SearchSuggestionsResponse, a as SearchSuggestion, I as InfiniteScrollPage, A as AugurCallbacks, C as CacheConfig, b as AugurApiClient, c as AugurAuthContext, d as PersistenceConfig } from './
|
|
2
|
-
export { e as AugurHooksProvider, f as CacheProvider, g as CacheTierConfig, h as getCartPricingQueryOptions, i as getCategoryItemsInfiniteKey, j as getCategoryItemsInfiniteOptions, k as
|
|
1
|
+
import { G as GetItemCategoryApiOptions, P as PageData, S as SearchSuggestionsResponse, a as SearchSuggestion, I as InfiniteScrollPage, A as AugurCallbacks, C as CacheConfig, b as AugurApiClient, c as AugurAuthContext, d as PersistenceConfig } from './customer-quotes-SdLKX_-8.cjs';
|
|
2
|
+
export { e as AugurHooksProvider, f as CacheProvider, g as CacheTierConfig, h as getCartPricingQueryOptions, i as getCategoryItemsInfiniteKey, j as getCategoryItemsInfiniteOptions, k as getCustomerInvoiceDetailKey, l as getCustomerInvoicesKey, m as getCustomerOrderDetailKey, n as getCustomerOrdersKey, o as getCustomerQuoteDetailKey, p as getCustomerQuotesKey, q as getInvMastDocKey, r as getInvMastDocOptions, s as getInvMastKey, t as getInvMastOptions, u as getInvMastStockKey, v as getInvMastStockOptions, w as getItemAttributesKey, x as getItemAttributesOptions, y as getItemCategoryKey, z as getItemCategoryOptions, B as getItemDetailsKey, D as getItemDetailsOptions, E as getItemPriceKey, F as getItemPriceOptions, H as getItemSearchInfiniteKey, J as getItemSearchInfiniteOptions, K as getJoomlaContentKey, L as getJoomlaContentListKey, M as getJoomlaContentListOptions, N as getJoomlaContentOptions, O as getJoomlaMenuDocKey, Q as getJoomlaMenuDocOptions, R as getJoomlaMenuKey, T as getJoomlaMenuOptions, U as getProductCategoryKey, V as getProductCategoryOptions, W as getProductSearchKey, X as getProductSearchOptions, Y as getSearchSuggestionsKey, Z as getSearchSuggestionsOptions, _ as useAugurApi, $ as useAugurApiOptional, a0 as useAugurAuth, a1 as useAugurCache } from './customer-quotes-SdLKX_-8.cjs';
|
|
3
3
|
import * as zustand from 'zustand';
|
|
4
|
-
import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TAttribute, TJoomlaContent, TJoomlaContentFilters } from '@simpleapps-com/augur-utils';
|
|
4
|
+
import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TAttribute, TJoomlaContent, TJoomlaContentFilters, MenuItem, TMenuFilters } from '@simpleapps-com/augur-utils';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { QueryKey } from '@tanstack/react-query';
|
|
7
7
|
import { ReactNode, createElement } from 'react';
|
|
@@ -458,6 +458,99 @@ declare function useJoomlaContentList(categoryId: number | string | undefined, o
|
|
|
458
458
|
error: Error | null;
|
|
459
459
|
};
|
|
460
460
|
|
|
461
|
+
interface UseJoomlaMenuOptions {
|
|
462
|
+
enabled?: boolean;
|
|
463
|
+
queryFn?: () => Promise<MenuItem[]>;
|
|
464
|
+
filters?: Partial<TMenuFilters>;
|
|
465
|
+
}
|
|
466
|
+
declare function useJoomlaMenu(options?: UseJoomlaMenuOptions): {
|
|
467
|
+
menuItems: MenuItem[];
|
|
468
|
+
isLoading: boolean;
|
|
469
|
+
error: Error | null;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
interface UseJoomlaMenuDocOptions {
|
|
473
|
+
enabled?: boolean;
|
|
474
|
+
queryFn?: () => Promise<MenuItem>;
|
|
475
|
+
}
|
|
476
|
+
declare function useJoomlaMenuDoc(menuId: number | string | undefined, options?: UseJoomlaMenuDocOptions): {
|
|
477
|
+
menuItem: MenuItem | null;
|
|
478
|
+
isLoading: boolean;
|
|
479
|
+
error: Error | null;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
interface CustomerListResult$2 {
|
|
483
|
+
data: unknown[];
|
|
484
|
+
total: number;
|
|
485
|
+
}
|
|
486
|
+
interface UseCustomerOrdersOptions {
|
|
487
|
+
enabled?: boolean;
|
|
488
|
+
queryFn?: () => Promise<CustomerListResult$2>;
|
|
489
|
+
}
|
|
490
|
+
declare function useCustomerOrders(customerId: number | string | undefined, params?: Record<string, unknown>, options?: UseCustomerOrdersOptions): {
|
|
491
|
+
orders: unknown[];
|
|
492
|
+
total: number;
|
|
493
|
+
isLoading: boolean;
|
|
494
|
+
error: Error | null;
|
|
495
|
+
};
|
|
496
|
+
interface UseOrderDetailOptions {
|
|
497
|
+
enabled?: boolean;
|
|
498
|
+
queryFn?: () => Promise<unknown>;
|
|
499
|
+
}
|
|
500
|
+
declare function useOrderDetail(customerId: number | string | undefined, orderId: number | string | undefined, options?: UseOrderDetailOptions): {
|
|
501
|
+
order: {} | null;
|
|
502
|
+
isLoading: boolean;
|
|
503
|
+
error: Error | null;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
interface CustomerListResult$1 {
|
|
507
|
+
data: unknown[];
|
|
508
|
+
total: number;
|
|
509
|
+
}
|
|
510
|
+
interface UseCustomerInvoicesOptions {
|
|
511
|
+
enabled?: boolean;
|
|
512
|
+
queryFn?: () => Promise<CustomerListResult$1>;
|
|
513
|
+
}
|
|
514
|
+
declare function useCustomerInvoices(customerId: number | string | undefined, params?: Record<string, unknown>, options?: UseCustomerInvoicesOptions): {
|
|
515
|
+
invoices: unknown[];
|
|
516
|
+
total: number;
|
|
517
|
+
isLoading: boolean;
|
|
518
|
+
error: Error | null;
|
|
519
|
+
};
|
|
520
|
+
interface UseInvoiceDetailOptions {
|
|
521
|
+
enabled?: boolean;
|
|
522
|
+
queryFn?: () => Promise<unknown>;
|
|
523
|
+
}
|
|
524
|
+
declare function useInvoiceDetail(customerId: number | string | undefined, invoiceNo: number | string | undefined, options?: UseInvoiceDetailOptions): {
|
|
525
|
+
invoice: {} | null;
|
|
526
|
+
isLoading: boolean;
|
|
527
|
+
error: Error | null;
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
interface CustomerListResult {
|
|
531
|
+
data: unknown[];
|
|
532
|
+
total: number;
|
|
533
|
+
}
|
|
534
|
+
interface UseCustomerQuotesOptions {
|
|
535
|
+
enabled?: boolean;
|
|
536
|
+
queryFn?: () => Promise<CustomerListResult>;
|
|
537
|
+
}
|
|
538
|
+
declare function useCustomerQuotes(customerId: number | string | undefined, params?: Record<string, unknown>, options?: UseCustomerQuotesOptions): {
|
|
539
|
+
quotes: unknown[];
|
|
540
|
+
total: number;
|
|
541
|
+
isLoading: boolean;
|
|
542
|
+
error: Error | null;
|
|
543
|
+
};
|
|
544
|
+
interface UseQuoteDetailOptions {
|
|
545
|
+
enabled?: boolean;
|
|
546
|
+
queryFn?: () => Promise<unknown>;
|
|
547
|
+
}
|
|
548
|
+
declare function useQuoteDetail(customerId: number | string | undefined, quoteNo: number | string | undefined, options?: UseQuoteDetailOptions): {
|
|
549
|
+
quote: {} | null;
|
|
550
|
+
isLoading: boolean;
|
|
551
|
+
error: Error | null;
|
|
552
|
+
};
|
|
553
|
+
|
|
461
554
|
/**
|
|
462
555
|
* Factory function that creates a pre-configured provider + hook bundle,
|
|
463
556
|
* eliminating per-hook wrapper boilerplate in consumer sites.
|
|
@@ -518,6 +611,14 @@ interface SiteHooks {
|
|
|
518
611
|
useItemSearchInfinite: typeof useItemSearchInfinite;
|
|
519
612
|
useJoomlaContent: typeof useJoomlaContent;
|
|
520
613
|
useJoomlaContentList: typeof useJoomlaContentList;
|
|
614
|
+
useJoomlaMenu: typeof useJoomlaMenu;
|
|
615
|
+
useJoomlaMenuDoc: typeof useJoomlaMenuDoc;
|
|
616
|
+
useCustomerOrders: typeof useCustomerOrders;
|
|
617
|
+
useOrderDetail: typeof useOrderDetail;
|
|
618
|
+
useCustomerInvoices: typeof useCustomerInvoices;
|
|
619
|
+
useInvoiceDetail: typeof useInvoiceDetail;
|
|
620
|
+
useCustomerQuotes: typeof useCustomerQuotes;
|
|
621
|
+
useQuoteDetail: typeof useQuoteDetail;
|
|
521
622
|
useDebounce: typeof useDebounce;
|
|
522
623
|
useFormatPrice: typeof useFormatPrice;
|
|
523
624
|
}
|
|
@@ -580,4 +681,4 @@ declare function useAugurPersistence(config: PersistenceConfig): {
|
|
|
580
681
|
};
|
|
581
682
|
};
|
|
582
683
|
|
|
583
|
-
export { AugurApiClient, AugurAuthContext, AugurCallbacks, CacheConfig, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, GetItemCategoryApiOptions, InfiniteScrollPage, PageData, PersistenceConfig, SearchSuggestion, SearchSuggestionsResponse, createSiteHooks, useAugurPersistence, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, usePaginationPrefetch, useProductCategory, useProductSearch, useSearchSuggestions, useSetCartHdrUid, useSetCartLines };
|
|
684
|
+
export { AugurApiClient, AugurAuthContext, AugurCallbacks, CacheConfig, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, GetItemCategoryApiOptions, InfiniteScrollPage, PageData, PersistenceConfig, SearchSuggestion, SearchSuggestionsResponse, createSiteHooks, useAugurPersistence, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useCustomerInvoices, useCustomerOrders, useCustomerQuotes, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useInvoiceDetail, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, useJoomlaMenu, useJoomlaMenuDoc, useOrderDetail, usePaginationPrefetch, useProductCategory, useProductSearch, useQuoteDetail, useSearchSuggestions, useSetCartHdrUid, useSetCartLines };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GetItemCategoryApiOptions, P as PageData, S as SearchSuggestionsResponse, a as SearchSuggestion, I as InfiniteScrollPage, A as AugurCallbacks, C as CacheConfig, b as AugurApiClient, c as AugurAuthContext, d as PersistenceConfig } from './
|
|
2
|
-
export { e as AugurHooksProvider, f as CacheProvider, g as CacheTierConfig, h as getCartPricingQueryOptions, i as getCategoryItemsInfiniteKey, j as getCategoryItemsInfiniteOptions, k as
|
|
1
|
+
import { G as GetItemCategoryApiOptions, P as PageData, S as SearchSuggestionsResponse, a as SearchSuggestion, I as InfiniteScrollPage, A as AugurCallbacks, C as CacheConfig, b as AugurApiClient, c as AugurAuthContext, d as PersistenceConfig } from './customer-quotes-SdLKX_-8.js';
|
|
2
|
+
export { e as AugurHooksProvider, f as CacheProvider, g as CacheTierConfig, h as getCartPricingQueryOptions, i as getCategoryItemsInfiniteKey, j as getCategoryItemsInfiniteOptions, k as getCustomerInvoiceDetailKey, l as getCustomerInvoicesKey, m as getCustomerOrderDetailKey, n as getCustomerOrdersKey, o as getCustomerQuoteDetailKey, p as getCustomerQuotesKey, q as getInvMastDocKey, r as getInvMastDocOptions, s as getInvMastKey, t as getInvMastOptions, u as getInvMastStockKey, v as getInvMastStockOptions, w as getItemAttributesKey, x as getItemAttributesOptions, y as getItemCategoryKey, z as getItemCategoryOptions, B as getItemDetailsKey, D as getItemDetailsOptions, E as getItemPriceKey, F as getItemPriceOptions, H as getItemSearchInfiniteKey, J as getItemSearchInfiniteOptions, K as getJoomlaContentKey, L as getJoomlaContentListKey, M as getJoomlaContentListOptions, N as getJoomlaContentOptions, O as getJoomlaMenuDocKey, Q as getJoomlaMenuDocOptions, R as getJoomlaMenuKey, T as getJoomlaMenuOptions, U as getProductCategoryKey, V as getProductCategoryOptions, W as getProductSearchKey, X as getProductSearchOptions, Y as getSearchSuggestionsKey, Z as getSearchSuggestionsOptions, _ as useAugurApi, $ as useAugurApiOptional, a0 as useAugurAuth, a1 as useAugurCache } from './customer-quotes-SdLKX_-8.js';
|
|
3
3
|
import * as zustand from 'zustand';
|
|
4
|
-
import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TAttribute, TJoomlaContent, TJoomlaContentFilters } from '@simpleapps-com/augur-utils';
|
|
4
|
+
import { TCartLine, TItemsFilters, TPriceData, TInvMastDoc, TCategory, TItemDetails, TAttribute, TJoomlaContent, TJoomlaContentFilters, MenuItem, TMenuFilters } from '@simpleapps-com/augur-utils';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { QueryKey } from '@tanstack/react-query';
|
|
7
7
|
import { ReactNode, createElement } from 'react';
|
|
@@ -458,6 +458,99 @@ declare function useJoomlaContentList(categoryId: number | string | undefined, o
|
|
|
458
458
|
error: Error | null;
|
|
459
459
|
};
|
|
460
460
|
|
|
461
|
+
interface UseJoomlaMenuOptions {
|
|
462
|
+
enabled?: boolean;
|
|
463
|
+
queryFn?: () => Promise<MenuItem[]>;
|
|
464
|
+
filters?: Partial<TMenuFilters>;
|
|
465
|
+
}
|
|
466
|
+
declare function useJoomlaMenu(options?: UseJoomlaMenuOptions): {
|
|
467
|
+
menuItems: MenuItem[];
|
|
468
|
+
isLoading: boolean;
|
|
469
|
+
error: Error | null;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
interface UseJoomlaMenuDocOptions {
|
|
473
|
+
enabled?: boolean;
|
|
474
|
+
queryFn?: () => Promise<MenuItem>;
|
|
475
|
+
}
|
|
476
|
+
declare function useJoomlaMenuDoc(menuId: number | string | undefined, options?: UseJoomlaMenuDocOptions): {
|
|
477
|
+
menuItem: MenuItem | null;
|
|
478
|
+
isLoading: boolean;
|
|
479
|
+
error: Error | null;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
interface CustomerListResult$2 {
|
|
483
|
+
data: unknown[];
|
|
484
|
+
total: number;
|
|
485
|
+
}
|
|
486
|
+
interface UseCustomerOrdersOptions {
|
|
487
|
+
enabled?: boolean;
|
|
488
|
+
queryFn?: () => Promise<CustomerListResult$2>;
|
|
489
|
+
}
|
|
490
|
+
declare function useCustomerOrders(customerId: number | string | undefined, params?: Record<string, unknown>, options?: UseCustomerOrdersOptions): {
|
|
491
|
+
orders: unknown[];
|
|
492
|
+
total: number;
|
|
493
|
+
isLoading: boolean;
|
|
494
|
+
error: Error | null;
|
|
495
|
+
};
|
|
496
|
+
interface UseOrderDetailOptions {
|
|
497
|
+
enabled?: boolean;
|
|
498
|
+
queryFn?: () => Promise<unknown>;
|
|
499
|
+
}
|
|
500
|
+
declare function useOrderDetail(customerId: number | string | undefined, orderId: number | string | undefined, options?: UseOrderDetailOptions): {
|
|
501
|
+
order: {} | null;
|
|
502
|
+
isLoading: boolean;
|
|
503
|
+
error: Error | null;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
interface CustomerListResult$1 {
|
|
507
|
+
data: unknown[];
|
|
508
|
+
total: number;
|
|
509
|
+
}
|
|
510
|
+
interface UseCustomerInvoicesOptions {
|
|
511
|
+
enabled?: boolean;
|
|
512
|
+
queryFn?: () => Promise<CustomerListResult$1>;
|
|
513
|
+
}
|
|
514
|
+
declare function useCustomerInvoices(customerId: number | string | undefined, params?: Record<string, unknown>, options?: UseCustomerInvoicesOptions): {
|
|
515
|
+
invoices: unknown[];
|
|
516
|
+
total: number;
|
|
517
|
+
isLoading: boolean;
|
|
518
|
+
error: Error | null;
|
|
519
|
+
};
|
|
520
|
+
interface UseInvoiceDetailOptions {
|
|
521
|
+
enabled?: boolean;
|
|
522
|
+
queryFn?: () => Promise<unknown>;
|
|
523
|
+
}
|
|
524
|
+
declare function useInvoiceDetail(customerId: number | string | undefined, invoiceNo: number | string | undefined, options?: UseInvoiceDetailOptions): {
|
|
525
|
+
invoice: {} | null;
|
|
526
|
+
isLoading: boolean;
|
|
527
|
+
error: Error | null;
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
interface CustomerListResult {
|
|
531
|
+
data: unknown[];
|
|
532
|
+
total: number;
|
|
533
|
+
}
|
|
534
|
+
interface UseCustomerQuotesOptions {
|
|
535
|
+
enabled?: boolean;
|
|
536
|
+
queryFn?: () => Promise<CustomerListResult>;
|
|
537
|
+
}
|
|
538
|
+
declare function useCustomerQuotes(customerId: number | string | undefined, params?: Record<string, unknown>, options?: UseCustomerQuotesOptions): {
|
|
539
|
+
quotes: unknown[];
|
|
540
|
+
total: number;
|
|
541
|
+
isLoading: boolean;
|
|
542
|
+
error: Error | null;
|
|
543
|
+
};
|
|
544
|
+
interface UseQuoteDetailOptions {
|
|
545
|
+
enabled?: boolean;
|
|
546
|
+
queryFn?: () => Promise<unknown>;
|
|
547
|
+
}
|
|
548
|
+
declare function useQuoteDetail(customerId: number | string | undefined, quoteNo: number | string | undefined, options?: UseQuoteDetailOptions): {
|
|
549
|
+
quote: {} | null;
|
|
550
|
+
isLoading: boolean;
|
|
551
|
+
error: Error | null;
|
|
552
|
+
};
|
|
553
|
+
|
|
461
554
|
/**
|
|
462
555
|
* Factory function that creates a pre-configured provider + hook bundle,
|
|
463
556
|
* eliminating per-hook wrapper boilerplate in consumer sites.
|
|
@@ -518,6 +611,14 @@ interface SiteHooks {
|
|
|
518
611
|
useItemSearchInfinite: typeof useItemSearchInfinite;
|
|
519
612
|
useJoomlaContent: typeof useJoomlaContent;
|
|
520
613
|
useJoomlaContentList: typeof useJoomlaContentList;
|
|
614
|
+
useJoomlaMenu: typeof useJoomlaMenu;
|
|
615
|
+
useJoomlaMenuDoc: typeof useJoomlaMenuDoc;
|
|
616
|
+
useCustomerOrders: typeof useCustomerOrders;
|
|
617
|
+
useOrderDetail: typeof useOrderDetail;
|
|
618
|
+
useCustomerInvoices: typeof useCustomerInvoices;
|
|
619
|
+
useInvoiceDetail: typeof useInvoiceDetail;
|
|
620
|
+
useCustomerQuotes: typeof useCustomerQuotes;
|
|
621
|
+
useQuoteDetail: typeof useQuoteDetail;
|
|
521
622
|
useDebounce: typeof useDebounce;
|
|
522
623
|
useFormatPrice: typeof useFormatPrice;
|
|
523
624
|
}
|
|
@@ -580,4 +681,4 @@ declare function useAugurPersistence(config: PersistenceConfig): {
|
|
|
580
681
|
};
|
|
581
682
|
};
|
|
582
683
|
|
|
583
|
-
export { AugurApiClient, AugurAuthContext, AugurCallbacks, CacheConfig, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, GetItemCategoryApiOptions, InfiniteScrollPage, PageData, PersistenceConfig, SearchSuggestion, SearchSuggestionsResponse, createSiteHooks, useAugurPersistence, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, usePaginationPrefetch, useProductCategory, useProductSearch, useSearchSuggestions, useSetCartHdrUid, useSetCartLines };
|
|
684
|
+
export { AugurApiClient, AugurAuthContext, AugurCallbacks, CacheConfig, type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type CreateSiteHooksConfig, GetItemCategoryApiOptions, InfiniteScrollPage, PageData, PersistenceConfig, SearchSuggestion, SearchSuggestionsResponse, createSiteHooks, useAugurPersistence, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useCategoryItemsInfinite, useClearCart, useCustomerInvoices, useCustomerOrders, useCustomerQuotes, useDebounce, useFormatPrice, useInvMast, useInvMastDoc, useInvMastStock, useInvoiceDetail, useItemAttributes, useItemCategory, useItemDetails, useItemFiltersStore, useItemPrice, useItemSearchInfinite, useJoomlaContent, useJoomlaContentList, useJoomlaMenu, useJoomlaMenuDoc, useOrderDetail, usePaginationPrefetch, useProductCategory, useProductSearch, useQuoteDetail, useSearchSuggestions, useSetCartHdrUid, useSetCartLines };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,12 @@ import {
|
|
|
2
2
|
getCartPricingQueryOptions,
|
|
3
3
|
getCategoryItemsInfiniteKey,
|
|
4
4
|
getCategoryItemsInfiniteOptions,
|
|
5
|
+
getCustomerInvoiceDetailKey,
|
|
6
|
+
getCustomerInvoicesKey,
|
|
7
|
+
getCustomerOrderDetailKey,
|
|
8
|
+
getCustomerOrdersKey,
|
|
9
|
+
getCustomerQuoteDetailKey,
|
|
10
|
+
getCustomerQuotesKey,
|
|
5
11
|
getInvMastDocKey,
|
|
6
12
|
getInvMastDocOptions,
|
|
7
13
|
getInvMastKey,
|
|
@@ -22,13 +28,17 @@ import {
|
|
|
22
28
|
getJoomlaContentListKey,
|
|
23
29
|
getJoomlaContentListOptions,
|
|
24
30
|
getJoomlaContentOptions,
|
|
31
|
+
getJoomlaMenuDocKey,
|
|
32
|
+
getJoomlaMenuDocOptions,
|
|
33
|
+
getJoomlaMenuKey,
|
|
34
|
+
getJoomlaMenuOptions,
|
|
25
35
|
getProductCategoryKey,
|
|
26
36
|
getProductCategoryOptions,
|
|
27
37
|
getProductSearchKey,
|
|
28
38
|
getProductSearchOptions,
|
|
29
39
|
getSearchSuggestionsKey,
|
|
30
40
|
getSearchSuggestionsOptions
|
|
31
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-CL3XM5B5.js";
|
|
32
42
|
|
|
33
43
|
// src/provider.tsx
|
|
34
44
|
import { createContext, useContext } from "react";
|
|
@@ -894,6 +904,153 @@ function useJoomlaContentList(categoryId, options = {}) {
|
|
|
894
904
|
};
|
|
895
905
|
}
|
|
896
906
|
|
|
907
|
+
// src/hooks/use-joomla-menu.ts
|
|
908
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
909
|
+
function useJoomlaMenu(options = {}) {
|
|
910
|
+
const api = useAugurApiOptional();
|
|
911
|
+
const callbacks = useAugurCallbacks();
|
|
912
|
+
const cache = useAugurCache();
|
|
913
|
+
const { data, isLoading, error } = useQuery14({
|
|
914
|
+
...getJoomlaMenuOptions(api, options.filters, cache),
|
|
915
|
+
...options.queryFn ?? callbacks?.getJoomlaMenu ? {
|
|
916
|
+
queryFn: options.queryFn ?? (() => callbacks.getJoomlaMenu(options.filters))
|
|
917
|
+
} : {},
|
|
918
|
+
enabled: options.enabled ?? true
|
|
919
|
+
});
|
|
920
|
+
return {
|
|
921
|
+
menuItems: data ?? [],
|
|
922
|
+
isLoading,
|
|
923
|
+
error
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// src/hooks/use-joomla-menu-doc.ts
|
|
928
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
929
|
+
function useJoomlaMenuDoc(menuId, options = {}) {
|
|
930
|
+
const api = useAugurApiOptional();
|
|
931
|
+
const callbacks = useAugurCallbacks();
|
|
932
|
+
const cache = useAugurCache();
|
|
933
|
+
const { data, isLoading, error } = useQuery15({
|
|
934
|
+
...menuId ? getJoomlaMenuDocOptions(api, menuId, cache) : {
|
|
935
|
+
queryKey: getJoomlaMenuDocKey(""),
|
|
936
|
+
/* v8 ignore next */
|
|
937
|
+
queryFn: () => Promise.reject()
|
|
938
|
+
},
|
|
939
|
+
...options.queryFn ?? callbacks?.getJoomlaMenuDoc ? { queryFn: options.queryFn ?? (() => callbacks.getJoomlaMenuDoc(menuId)) } : {},
|
|
940
|
+
enabled: (options.enabled ?? true) && !!menuId
|
|
941
|
+
});
|
|
942
|
+
return {
|
|
943
|
+
menuItem: data ?? null,
|
|
944
|
+
isLoading,
|
|
945
|
+
error
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// src/hooks/use-customer-orders.ts
|
|
950
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
951
|
+
function useCustomerOrders(customerId, params, options = {}) {
|
|
952
|
+
const callbacks = useAugurCallbacks();
|
|
953
|
+
const auth = useAugurAuth();
|
|
954
|
+
const effectiveCustomerId = customerId ?? auth?.customerId;
|
|
955
|
+
const { data, isLoading, error } = useQuery16({
|
|
956
|
+
queryKey: getCustomerOrdersKey(effectiveCustomerId, params),
|
|
957
|
+
queryFn: options.queryFn ?? (() => callbacks.getCustomerOrders(effectiveCustomerId, params)),
|
|
958
|
+
enabled: (options.enabled ?? true) && !!effectiveCustomerId && !!(options.queryFn ?? callbacks?.getCustomerOrders)
|
|
959
|
+
});
|
|
960
|
+
return {
|
|
961
|
+
orders: data?.data ?? [],
|
|
962
|
+
total: data?.total ?? 0,
|
|
963
|
+
isLoading,
|
|
964
|
+
error
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
function useOrderDetail(customerId, orderId, options = {}) {
|
|
968
|
+
const callbacks = useAugurCallbacks();
|
|
969
|
+
const auth = useAugurAuth();
|
|
970
|
+
const effectiveCustomerId = customerId ?? auth?.customerId;
|
|
971
|
+
const { data, isLoading, error } = useQuery16({
|
|
972
|
+
queryKey: getCustomerOrderDetailKey(effectiveCustomerId, orderId),
|
|
973
|
+
queryFn: options.queryFn ?? (() => callbacks.getCustomerOrderDetail(effectiveCustomerId, orderId)),
|
|
974
|
+
enabled: (options.enabled ?? true) && !!effectiveCustomerId && !!orderId && !!(options.queryFn ?? callbacks?.getCustomerOrderDetail)
|
|
975
|
+
});
|
|
976
|
+
return {
|
|
977
|
+
order: data ?? null,
|
|
978
|
+
isLoading,
|
|
979
|
+
error
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// src/hooks/use-customer-invoices.ts
|
|
984
|
+
import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
985
|
+
function useCustomerInvoices(customerId, params, options = {}) {
|
|
986
|
+
const callbacks = useAugurCallbacks();
|
|
987
|
+
const auth = useAugurAuth();
|
|
988
|
+
const effectiveCustomerId = customerId ?? auth?.customerId;
|
|
989
|
+
const { data, isLoading, error } = useQuery17({
|
|
990
|
+
queryKey: getCustomerInvoicesKey(effectiveCustomerId, params),
|
|
991
|
+
queryFn: options.queryFn ?? (() => callbacks.getCustomerInvoices(effectiveCustomerId, params)),
|
|
992
|
+
enabled: (options.enabled ?? true) && !!effectiveCustomerId && !!(options.queryFn ?? callbacks?.getCustomerInvoices)
|
|
993
|
+
});
|
|
994
|
+
return {
|
|
995
|
+
invoices: data?.data ?? [],
|
|
996
|
+
total: data?.total ?? 0,
|
|
997
|
+
isLoading,
|
|
998
|
+
error
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function useInvoiceDetail(customerId, invoiceNo, options = {}) {
|
|
1002
|
+
const callbacks = useAugurCallbacks();
|
|
1003
|
+
const auth = useAugurAuth();
|
|
1004
|
+
const effectiveCustomerId = customerId ?? auth?.customerId;
|
|
1005
|
+
const { data, isLoading, error } = useQuery17({
|
|
1006
|
+
queryKey: getCustomerInvoiceDetailKey(effectiveCustomerId, invoiceNo),
|
|
1007
|
+
queryFn: options.queryFn ?? (() => callbacks.getCustomerInvoiceDetail(
|
|
1008
|
+
effectiveCustomerId,
|
|
1009
|
+
invoiceNo
|
|
1010
|
+
)),
|
|
1011
|
+
enabled: (options.enabled ?? true) && !!effectiveCustomerId && !!invoiceNo && !!(options.queryFn ?? callbacks?.getCustomerInvoiceDetail)
|
|
1012
|
+
});
|
|
1013
|
+
return {
|
|
1014
|
+
invoice: data ?? null,
|
|
1015
|
+
isLoading,
|
|
1016
|
+
error
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// src/hooks/use-customer-quotes.ts
|
|
1021
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
1022
|
+
function useCustomerQuotes(customerId, params, options = {}) {
|
|
1023
|
+
const callbacks = useAugurCallbacks();
|
|
1024
|
+
const auth = useAugurAuth();
|
|
1025
|
+
const effectiveCustomerId = customerId ?? auth?.customerId;
|
|
1026
|
+
const { data, isLoading, error } = useQuery18({
|
|
1027
|
+
queryKey: getCustomerQuotesKey(effectiveCustomerId, params),
|
|
1028
|
+
queryFn: options.queryFn ?? (() => callbacks.getCustomerQuotes(effectiveCustomerId, params)),
|
|
1029
|
+
enabled: (options.enabled ?? true) && !!effectiveCustomerId && !!(options.queryFn ?? callbacks?.getCustomerQuotes)
|
|
1030
|
+
});
|
|
1031
|
+
return {
|
|
1032
|
+
quotes: data?.data ?? [],
|
|
1033
|
+
total: data?.total ?? 0,
|
|
1034
|
+
isLoading,
|
|
1035
|
+
error
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
function useQuoteDetail(customerId, quoteNo, options = {}) {
|
|
1039
|
+
const callbacks = useAugurCallbacks();
|
|
1040
|
+
const auth = useAugurAuth();
|
|
1041
|
+
const effectiveCustomerId = customerId ?? auth?.customerId;
|
|
1042
|
+
const { data, isLoading, error } = useQuery18({
|
|
1043
|
+
queryKey: getCustomerQuoteDetailKey(effectiveCustomerId, quoteNo),
|
|
1044
|
+
queryFn: options.queryFn ?? (() => callbacks.getCustomerQuoteDetail(effectiveCustomerId, quoteNo)),
|
|
1045
|
+
enabled: (options.enabled ?? true) && !!effectiveCustomerId && !!quoteNo && !!(options.queryFn ?? callbacks?.getCustomerQuoteDetail)
|
|
1046
|
+
});
|
|
1047
|
+
return {
|
|
1048
|
+
quote: data ?? null,
|
|
1049
|
+
isLoading,
|
|
1050
|
+
error
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
|
|
897
1054
|
// src/create-site-hooks.ts
|
|
898
1055
|
import { createElement } from "react";
|
|
899
1056
|
function createSiteHooks(config = {}) {
|
|
@@ -941,6 +1098,15 @@ function createSiteHooks(config = {}) {
|
|
|
941
1098
|
// Hooks -- Joomla
|
|
942
1099
|
useJoomlaContent,
|
|
943
1100
|
useJoomlaContentList,
|
|
1101
|
+
useJoomlaMenu,
|
|
1102
|
+
useJoomlaMenuDoc,
|
|
1103
|
+
// Hooks -- customer
|
|
1104
|
+
useCustomerOrders,
|
|
1105
|
+
useOrderDetail,
|
|
1106
|
+
useCustomerInvoices,
|
|
1107
|
+
useInvoiceDetail,
|
|
1108
|
+
useCustomerQuotes,
|
|
1109
|
+
useQuoteDetail,
|
|
944
1110
|
// Hooks -- utilities
|
|
945
1111
|
useDebounce,
|
|
946
1112
|
useFormatPrice
|
|
@@ -1114,6 +1280,12 @@ export {
|
|
|
1114
1280
|
getCartPricingQueryOptions,
|
|
1115
1281
|
getCategoryItemsInfiniteKey,
|
|
1116
1282
|
getCategoryItemsInfiniteOptions,
|
|
1283
|
+
getCustomerInvoiceDetailKey,
|
|
1284
|
+
getCustomerInvoicesKey,
|
|
1285
|
+
getCustomerOrderDetailKey,
|
|
1286
|
+
getCustomerOrdersKey,
|
|
1287
|
+
getCustomerQuoteDetailKey,
|
|
1288
|
+
getCustomerQuotesKey,
|
|
1117
1289
|
getInvMastDocKey,
|
|
1118
1290
|
getInvMastDocOptions,
|
|
1119
1291
|
getInvMastKey,
|
|
@@ -1134,6 +1306,10 @@ export {
|
|
|
1134
1306
|
getJoomlaContentListKey,
|
|
1135
1307
|
getJoomlaContentListOptions,
|
|
1136
1308
|
getJoomlaContentOptions,
|
|
1309
|
+
getJoomlaMenuDocKey,
|
|
1310
|
+
getJoomlaMenuDocOptions,
|
|
1311
|
+
getJoomlaMenuKey,
|
|
1312
|
+
getJoomlaMenuOptions,
|
|
1137
1313
|
getProductCategoryKey,
|
|
1138
1314
|
getProductCategoryOptions,
|
|
1139
1315
|
getProductSearchKey,
|
|
@@ -1155,11 +1331,15 @@ export {
|
|
|
1155
1331
|
useCartStore,
|
|
1156
1332
|
useCategoryItemsInfinite,
|
|
1157
1333
|
useClearCart,
|
|
1334
|
+
useCustomerInvoices,
|
|
1335
|
+
useCustomerOrders,
|
|
1336
|
+
useCustomerQuotes,
|
|
1158
1337
|
useDebounce,
|
|
1159
1338
|
useFormatPrice,
|
|
1160
1339
|
useInvMast,
|
|
1161
1340
|
useInvMastDoc,
|
|
1162
1341
|
useInvMastStock,
|
|
1342
|
+
useInvoiceDetail,
|
|
1163
1343
|
useItemAttributes,
|
|
1164
1344
|
useItemCategory,
|
|
1165
1345
|
useItemDetails,
|
|
@@ -1168,9 +1348,13 @@ export {
|
|
|
1168
1348
|
useItemSearchInfinite,
|
|
1169
1349
|
useJoomlaContent,
|
|
1170
1350
|
useJoomlaContentList,
|
|
1351
|
+
useJoomlaMenu,
|
|
1352
|
+
useJoomlaMenuDoc,
|
|
1353
|
+
useOrderDetail,
|
|
1171
1354
|
usePaginationPrefetch,
|
|
1172
1355
|
useProductCategory,
|
|
1173
1356
|
useProductSearch,
|
|
1357
|
+
useQuoteDetail,
|
|
1174
1358
|
useSearchSuggestions,
|
|
1175
1359
|
useSetCartHdrUid,
|
|
1176
1360
|
useSetCartLines
|