@simpleapps-com/augur-hooks 2.0.22 → 2.1.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/EXPORTS.md +10 -117
- package/dist/cart-pricing-D_mSECzx.d.cts +184 -0
- package/dist/cart-pricing-D_mSECzx.d.ts +184 -0
- package/dist/chunk-JPSDNJIZ.js +138 -0
- package/dist/chunk-JPSDNJIZ.js.map +1 -0
- package/dist/chunk-Q5YH4HDR.cjs +138 -0
- package/dist/chunk-Q5YH4HDR.cjs.map +1 -0
- package/dist/index.cjs +53 -818
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -622
- package/dist/index.d.ts +5 -622
- package/dist/index.js +28 -793
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +2 -82
- 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 +1 -81
- package/dist/server.js.map +1 -1
- package/dist/web.cjs +42 -6
- package/dist/web.cjs.map +1 -1
- package/dist/web.d.cts +16 -3
- package/dist/web.d.ts +16 -3
- package/dist/web.js +40 -4
- package/dist/web.js.map +1 -1
- package/llms.txt +12 -117
- package/package.json +3 -3
- package/dist/chunk-AXCNTEAB.cjs +0 -44
- package/dist/chunk-AXCNTEAB.cjs.map +0 -1
- package/dist/chunk-H7OXSAHP.cjs +0 -748
- package/dist/chunk-H7OXSAHP.cjs.map +0 -1
- package/dist/chunk-LTBEP4MC.js +0 -44
- package/dist/chunk-LTBEP4MC.js.map +0 -1
- package/dist/chunk-QFZHOGID.js +0 -748
- package/dist/chunk-QFZHOGID.js.map +0 -1
- package/dist/customer-quotes-BQYqzomR.d.cts +0 -562
- package/dist/customer-quotes-BQYqzomR.d.ts +0 -562
- package/dist/use-image-with-fallback-DgmtrGZU.d.cts +0 -17
- package/dist/use-image-with-fallback-DgmtrGZU.d.ts +0 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { InfiniteScrollPage, ListResult, CacheConfig, AugurAuthContext } from '@simpleapps-com/augur-core';
|
|
1
|
+
import { P as PersistenceConfig } from './cart-pricing-D_mSECzx.js';
|
|
2
|
+
export { A as AugurApiClient, a as AugurHooksProvider, B as BatchQueryConfig, G as GetItemCategoryApiOptions, b as PageData, e as executeBatchQuery, g as getCartPricingQueryOptions, c as getStockKey, d as getStockOptions, u as useAugurApi, f as useAugurApiOptional, h as useAugurAuth, i as useAugurCache, j as useAugurOptions, k as useAugurSite } from './cart-pricing-D_mSECzx.js';
|
|
4
3
|
export { AugurAuthContext, AugurSiteConfig, AugurSiteDefaults, AugurSiteFormatting, CacheConfig, CacheProvider, CacheTierConfig, DeepQueryOptions, EdgeCacheValue, InfiniteScrollPage, ProxyMutationOptions, ProxyQueryOptions } from '@simpleapps-com/augur-core';
|
|
5
4
|
import * as zustand from 'zustand';
|
|
6
5
|
import * as _simpleapps_com_augur_utils from '@simpleapps-com/augur-utils';
|
|
7
|
-
import { TCartLine, TItemsFilters,
|
|
6
|
+
import { TCartLine, TItemsFilters, TStock, TTransactionSetup, TCardInfo, TPaymentValidation, TAccountQuery, TBillingUpdate, TPriceData } from '@simpleapps-com/augur-utils';
|
|
8
7
|
export { DerivePriceInput, DerivedPrice, ResolveStockInput, ResolvedStock, TSearchSuggestion as SearchSuggestion, TSearchSuggestionsResponse as SearchSuggestionsResponse } from '@simpleapps-com/augur-utils';
|
|
9
|
-
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
10
|
-
import { QueryKey } from '@tanstack/react-query';
|
|
11
8
|
import * as react from 'react';
|
|
12
|
-
import {
|
|
13
|
-
import { u as useImageWithFallback } from './use-image-with-fallback-DgmtrGZU.js';
|
|
9
|
+
import { QueryKey } from '@tanstack/react-query';
|
|
14
10
|
import * as _tanstack_react_query_persist_client from '@tanstack/react-query-persist-client';
|
|
15
11
|
import 'react/jsx-runtime';
|
|
16
12
|
|
|
@@ -126,251 +122,6 @@ declare function useFormatPrice(optionsOrLocale?: UseFormatPriceOptions | string
|
|
|
126
122
|
formatPrice: (price: number, callOptions?: FormatPriceCallOptions) => string;
|
|
127
123
|
};
|
|
128
124
|
|
|
129
|
-
interface UseItemPriceOptions {
|
|
130
|
-
enabled?: boolean;
|
|
131
|
-
/** Override the default queryFn (e.g. with a cached server action). */
|
|
132
|
-
queryFn?: () => Promise<TPriceData>;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* @deprecated Use `useQuery(q.pricing.priceEngine.get(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
136
|
-
*
|
|
137
|
-
* Fetches and caches item pricing via the augur-api SDK.
|
|
138
|
-
*
|
|
139
|
-
* Pass `options.queryFn` to override with a cached server action:
|
|
140
|
-
* ```ts
|
|
141
|
-
* useItemPrice(itemId, customerId, 1, {
|
|
142
|
-
* queryFn: () => getItemPriceCached(itemId, customerId, 1),
|
|
143
|
-
* });
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
declare function useItemPrice(itemId: string | undefined, customerId?: string | number, quantity?: number, options?: UseItemPriceOptions): {
|
|
147
|
-
derived: _simpleapps_com_augur_utils.DerivedPrice | null;
|
|
148
|
-
data: TPriceData;
|
|
149
|
-
error: Error;
|
|
150
|
-
isError: true;
|
|
151
|
-
isPending: false;
|
|
152
|
-
isLoading: false;
|
|
153
|
-
isLoadingError: false;
|
|
154
|
-
isRefetchError: true;
|
|
155
|
-
isSuccess: false;
|
|
156
|
-
isPlaceholderData: false;
|
|
157
|
-
status: "error";
|
|
158
|
-
dataUpdatedAt: number;
|
|
159
|
-
errorUpdatedAt: number;
|
|
160
|
-
failureCount: number;
|
|
161
|
-
failureReason: Error | null;
|
|
162
|
-
errorUpdateCount: number;
|
|
163
|
-
isFetched: boolean;
|
|
164
|
-
isFetchedAfterMount: boolean;
|
|
165
|
-
isFetching: boolean;
|
|
166
|
-
isInitialLoading: boolean;
|
|
167
|
-
isPaused: boolean;
|
|
168
|
-
isRefetching: boolean;
|
|
169
|
-
isStale: boolean;
|
|
170
|
-
isEnabled: boolean;
|
|
171
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TPriceData, Error>>;
|
|
172
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
173
|
-
promise: Promise<TPriceData>;
|
|
174
|
-
} | {
|
|
175
|
-
derived: _simpleapps_com_augur_utils.DerivedPrice | null;
|
|
176
|
-
data: TPriceData;
|
|
177
|
-
error: null;
|
|
178
|
-
isError: false;
|
|
179
|
-
isPending: false;
|
|
180
|
-
isLoading: false;
|
|
181
|
-
isLoadingError: false;
|
|
182
|
-
isRefetchError: false;
|
|
183
|
-
isSuccess: true;
|
|
184
|
-
isPlaceholderData: false;
|
|
185
|
-
status: "success";
|
|
186
|
-
dataUpdatedAt: number;
|
|
187
|
-
errorUpdatedAt: number;
|
|
188
|
-
failureCount: number;
|
|
189
|
-
failureReason: Error | null;
|
|
190
|
-
errorUpdateCount: number;
|
|
191
|
-
isFetched: boolean;
|
|
192
|
-
isFetchedAfterMount: boolean;
|
|
193
|
-
isFetching: boolean;
|
|
194
|
-
isInitialLoading: boolean;
|
|
195
|
-
isPaused: boolean;
|
|
196
|
-
isRefetching: boolean;
|
|
197
|
-
isStale: boolean;
|
|
198
|
-
isEnabled: boolean;
|
|
199
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TPriceData, Error>>;
|
|
200
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
201
|
-
promise: Promise<TPriceData>;
|
|
202
|
-
} | {
|
|
203
|
-
derived: _simpleapps_com_augur_utils.DerivedPrice | null;
|
|
204
|
-
data: undefined;
|
|
205
|
-
error: Error;
|
|
206
|
-
isError: true;
|
|
207
|
-
isPending: false;
|
|
208
|
-
isLoading: false;
|
|
209
|
-
isLoadingError: true;
|
|
210
|
-
isRefetchError: false;
|
|
211
|
-
isSuccess: false;
|
|
212
|
-
isPlaceholderData: false;
|
|
213
|
-
status: "error";
|
|
214
|
-
dataUpdatedAt: number;
|
|
215
|
-
errorUpdatedAt: number;
|
|
216
|
-
failureCount: number;
|
|
217
|
-
failureReason: Error | null;
|
|
218
|
-
errorUpdateCount: number;
|
|
219
|
-
isFetched: boolean;
|
|
220
|
-
isFetchedAfterMount: boolean;
|
|
221
|
-
isFetching: boolean;
|
|
222
|
-
isInitialLoading: boolean;
|
|
223
|
-
isPaused: boolean;
|
|
224
|
-
isRefetching: boolean;
|
|
225
|
-
isStale: boolean;
|
|
226
|
-
isEnabled: boolean;
|
|
227
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TPriceData, Error>>;
|
|
228
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
229
|
-
promise: Promise<TPriceData>;
|
|
230
|
-
} | {
|
|
231
|
-
derived: _simpleapps_com_augur_utils.DerivedPrice | null;
|
|
232
|
-
data: undefined;
|
|
233
|
-
error: null;
|
|
234
|
-
isError: false;
|
|
235
|
-
isPending: true;
|
|
236
|
-
isLoading: true;
|
|
237
|
-
isLoadingError: false;
|
|
238
|
-
isRefetchError: false;
|
|
239
|
-
isSuccess: false;
|
|
240
|
-
isPlaceholderData: false;
|
|
241
|
-
status: "pending";
|
|
242
|
-
dataUpdatedAt: number;
|
|
243
|
-
errorUpdatedAt: number;
|
|
244
|
-
failureCount: number;
|
|
245
|
-
failureReason: Error | null;
|
|
246
|
-
errorUpdateCount: number;
|
|
247
|
-
isFetched: boolean;
|
|
248
|
-
isFetchedAfterMount: boolean;
|
|
249
|
-
isFetching: boolean;
|
|
250
|
-
isInitialLoading: boolean;
|
|
251
|
-
isPaused: boolean;
|
|
252
|
-
isRefetching: boolean;
|
|
253
|
-
isStale: boolean;
|
|
254
|
-
isEnabled: boolean;
|
|
255
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TPriceData, Error>>;
|
|
256
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
257
|
-
promise: Promise<TPriceData>;
|
|
258
|
-
} | {
|
|
259
|
-
derived: _simpleapps_com_augur_utils.DerivedPrice | null;
|
|
260
|
-
data: undefined;
|
|
261
|
-
error: null;
|
|
262
|
-
isError: false;
|
|
263
|
-
isPending: true;
|
|
264
|
-
isLoadingError: false;
|
|
265
|
-
isRefetchError: false;
|
|
266
|
-
isSuccess: false;
|
|
267
|
-
isPlaceholderData: false;
|
|
268
|
-
status: "pending";
|
|
269
|
-
dataUpdatedAt: number;
|
|
270
|
-
errorUpdatedAt: number;
|
|
271
|
-
failureCount: number;
|
|
272
|
-
failureReason: Error | null;
|
|
273
|
-
errorUpdateCount: number;
|
|
274
|
-
isFetched: boolean;
|
|
275
|
-
isFetchedAfterMount: boolean;
|
|
276
|
-
isFetching: boolean;
|
|
277
|
-
isLoading: boolean;
|
|
278
|
-
isInitialLoading: boolean;
|
|
279
|
-
isPaused: boolean;
|
|
280
|
-
isRefetching: boolean;
|
|
281
|
-
isStale: boolean;
|
|
282
|
-
isEnabled: boolean;
|
|
283
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TPriceData, Error>>;
|
|
284
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
285
|
-
promise: Promise<TPriceData>;
|
|
286
|
-
} | {
|
|
287
|
-
derived: _simpleapps_com_augur_utils.DerivedPrice | null;
|
|
288
|
-
data: TPriceData;
|
|
289
|
-
isError: false;
|
|
290
|
-
error: null;
|
|
291
|
-
isPending: false;
|
|
292
|
-
isLoading: false;
|
|
293
|
-
isLoadingError: false;
|
|
294
|
-
isRefetchError: false;
|
|
295
|
-
isSuccess: true;
|
|
296
|
-
isPlaceholderData: true;
|
|
297
|
-
status: "success";
|
|
298
|
-
dataUpdatedAt: number;
|
|
299
|
-
errorUpdatedAt: number;
|
|
300
|
-
failureCount: number;
|
|
301
|
-
failureReason: Error | null;
|
|
302
|
-
errorUpdateCount: number;
|
|
303
|
-
isFetched: boolean;
|
|
304
|
-
isFetchedAfterMount: boolean;
|
|
305
|
-
isFetching: boolean;
|
|
306
|
-
isInitialLoading: boolean;
|
|
307
|
-
isPaused: boolean;
|
|
308
|
-
isRefetching: boolean;
|
|
309
|
-
isStale: boolean;
|
|
310
|
-
isEnabled: boolean;
|
|
311
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TPriceData, Error>>;
|
|
312
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
313
|
-
promise: Promise<TPriceData>;
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
interface UseInvMastDocOptions {
|
|
317
|
-
enabled?: boolean;
|
|
318
|
-
includePricing?: "Y" | "N";
|
|
319
|
-
/** Initial data from server -- enables instant render without loading state. */
|
|
320
|
-
initialData?: TInvMastDoc;
|
|
321
|
-
/** Override the default queryFn (e.g. with a cached server action). */
|
|
322
|
-
queryFn?: () => Promise<TInvMastDoc>;
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* @deprecated Use `useQuery(q.items.invMast.doc.get(id))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
326
|
-
*
|
|
327
|
-
* Fetches and caches an inventory master document via the augur-api SDK.
|
|
328
|
-
*/
|
|
329
|
-
declare function useInvMastDoc(invMastUid: number, itemId: string, options?: UseInvMastDocOptions): {
|
|
330
|
-
item: TInvMastDoc | undefined;
|
|
331
|
-
isLoading: boolean;
|
|
332
|
-
error: Error | null;
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
interface UseItemCategoryOptions {
|
|
336
|
-
enabled?: boolean;
|
|
337
|
-
apiOptions?: GetItemCategoryApiOptions;
|
|
338
|
-
/** Override the default queryFn (e.g. with a cached server action). */
|
|
339
|
-
queryFn?: () => Promise<TCategory>;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* @deprecated Use `useQuery(q.items.categories.get(uid))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
343
|
-
*
|
|
344
|
-
* Fetches and caches item category data via the augur-api SDK.
|
|
345
|
-
*/
|
|
346
|
-
declare function useItemCategory(itemCategoryUid: number, options?: UseItemCategoryOptions): {
|
|
347
|
-
category: TCategory | undefined;
|
|
348
|
-
isLoading: boolean;
|
|
349
|
-
error: Error | null;
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
interface UseInvMastOptions {
|
|
353
|
-
enabled?: boolean;
|
|
354
|
-
queryFn?: () => Promise<TItemDetails>;
|
|
355
|
-
}
|
|
356
|
-
/** @deprecated Use `useQuery(q.items.invMast.get(uid))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
357
|
-
declare function useInvMast(invMastUid: number, itemId: string, options?: UseInvMastOptions): {
|
|
358
|
-
item: TItemDetails | undefined;
|
|
359
|
-
isLoading: boolean;
|
|
360
|
-
error: Error | null;
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
interface UseInvMastStockOptions {
|
|
364
|
-
enabled?: boolean;
|
|
365
|
-
queryFn?: () => Promise<number>;
|
|
366
|
-
}
|
|
367
|
-
/** @deprecated Use `useQuery(q.items.invMast.stock.get(uid))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
368
|
-
declare function useInvMastStock(invMastUid: number | string, options?: UseInvMastStockOptions): {
|
|
369
|
-
qtyOnHand: number | null;
|
|
370
|
-
loading: boolean;
|
|
371
|
-
error: Error | null;
|
|
372
|
-
};
|
|
373
|
-
|
|
374
125
|
interface UseStockOptions {
|
|
375
126
|
enabled?: boolean;
|
|
376
127
|
/** Override the default queryFn (e.g. with a cached server action). */
|
|
@@ -401,120 +152,6 @@ declare function useStock(invMastUid: number | string, options?: UseStockOptions
|
|
|
401
152
|
error: Error | null;
|
|
402
153
|
};
|
|
403
154
|
|
|
404
|
-
interface UseBatchInvMastDocOptions {
|
|
405
|
-
enabled?: boolean;
|
|
406
|
-
includePricing?: "Y" | "N";
|
|
407
|
-
/** Override the default queryFn (e.g. with a cached server action). */
|
|
408
|
-
queryFn?: (params: BatchInvMastDocParam[], includePricing: "Y" | "N") => Promise<Record<string, TInvMastDoc>>;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* @deprecated Use `useQueries` with `q.items.invMast.doc.get(id)` and `useAugurOptions()` instead. Will be removed in the next major version.
|
|
412
|
-
*
|
|
413
|
-
* Fetches and caches multiple inventory master documents in a single batch.
|
|
414
|
-
*
|
|
415
|
-
* Checks the queryClient cache for each param before fetching.
|
|
416
|
-
* Only uncached items are sent to the batch call.
|
|
417
|
-
* Individual `["invMastDoc", ...]` cache entries are seeded from the response
|
|
418
|
-
* so subsequent `useInvMastDoc` calls find data pre-cached.
|
|
419
|
-
*/
|
|
420
|
-
declare function useBatchInvMastDoc(params: BatchInvMastDocParam[], options?: UseBatchInvMastDocOptions): {
|
|
421
|
-
items: Record<string, TInvMastDoc>;
|
|
422
|
-
isLoading: boolean;
|
|
423
|
-
error: Error | null;
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
type ProductCategoryResponse = {
|
|
427
|
-
itemCategoryDesc: string;
|
|
428
|
-
childrenTotal: number;
|
|
429
|
-
children: unknown[];
|
|
430
|
-
categoryImage: string | null;
|
|
431
|
-
};
|
|
432
|
-
interface UseProductCategoryOptions {
|
|
433
|
-
enabled?: boolean;
|
|
434
|
-
queryFn?: () => Promise<ProductCategoryResponse>;
|
|
435
|
-
}
|
|
436
|
-
/** @deprecated Use `useQuery(q.items.itemCategory.get(uid))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
437
|
-
declare function useProductCategory(itemCategoryUid: number | string | null, options?: UseProductCategoryOptions): {
|
|
438
|
-
loading: boolean;
|
|
439
|
-
error: Error | null;
|
|
440
|
-
childrenTotal: number;
|
|
441
|
-
itemCategoryDesc: string;
|
|
442
|
-
productCategories: unknown[] | null;
|
|
443
|
-
productCategoryImage: string | null;
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
interface UseItemDetailsOptions {
|
|
447
|
-
enabled?: boolean;
|
|
448
|
-
queryFn?: () => Promise<TItemDetails>;
|
|
449
|
-
}
|
|
450
|
-
/** @deprecated Use `useQuery(q.items.invMast.doc.get(id))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
451
|
-
declare function useItemDetails(itemId: number | string | undefined, options?: UseItemDetailsOptions): {
|
|
452
|
-
itemCategoryUid: number | null | undefined;
|
|
453
|
-
itemDetails: TItemDetails | null;
|
|
454
|
-
loading: boolean;
|
|
455
|
-
error: Error | null;
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
interface UseItemAttributesOptions {
|
|
459
|
-
enabled?: boolean;
|
|
460
|
-
queryFn?: () => Promise<{
|
|
461
|
-
attributes: TAttribute[];
|
|
462
|
-
}>;
|
|
463
|
-
}
|
|
464
|
-
/** @deprecated Use `useQuery(q.items.invMast.attributes.get(uid))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
465
|
-
declare function useItemAttributes(itemCategoryUid: number | string | null, options?: UseItemAttributesOptions): {
|
|
466
|
-
attributes: any;
|
|
467
|
-
loading: boolean;
|
|
468
|
-
error: Error | null;
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
type ProductSearchResponse = {
|
|
472
|
-
items: unknown[];
|
|
473
|
-
totalResults: number;
|
|
474
|
-
};
|
|
475
|
-
interface UseProductSearchOptions {
|
|
476
|
-
/** Override the default queryFn (e.g. with a cached server action). */
|
|
477
|
-
queryFn?: () => Promise<ProductSearchResponse>;
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* @deprecated Use `useQuery(q.opensearch.itemSearch.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
481
|
-
*
|
|
482
|
-
* Searches products via the augur-api OpenSearch endpoint.
|
|
483
|
-
* Replaces the ampro-online pattern of fetching from a Next.js API route.
|
|
484
|
-
*/
|
|
485
|
-
declare function useProductSearch(pageData: PageData, options?: UseProductSearchOptions): {
|
|
486
|
-
productItems: unknown[] | null;
|
|
487
|
-
total: number;
|
|
488
|
-
result: ProductSearchResponse | undefined;
|
|
489
|
-
loading: boolean;
|
|
490
|
-
error: Error | null;
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
interface UseSearchSuggestionsOptions {
|
|
494
|
-
enabled?: boolean;
|
|
495
|
-
limit?: number;
|
|
496
|
-
offset?: number;
|
|
497
|
-
/** Override the default queryFn (e.g. with a cached server action). */
|
|
498
|
-
queryFn?: () => Promise<TSearchSuggestionsResponse>;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* @deprecated Use `useQuery(q.opensearch.suggestions.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
502
|
-
*
|
|
503
|
-
* Fetches search suggestions via the augur-api OpenSearch endpoint.
|
|
504
|
-
* Replaces the ampro-online pattern of fetching from a Next.js API route.
|
|
505
|
-
*/
|
|
506
|
-
declare function useSearchSuggestions(query: string, options?: UseSearchSuggestionsOptions): {
|
|
507
|
-
suggestions: _simpleapps_com_augur_utils.TSearchSuggestion[];
|
|
508
|
-
total: number;
|
|
509
|
-
count: number | undefined;
|
|
510
|
-
totalResults: number | undefined;
|
|
511
|
-
message: string | undefined;
|
|
512
|
-
status: number | undefined;
|
|
513
|
-
result: TSearchSuggestionsResponse | undefined;
|
|
514
|
-
isLoading: boolean;
|
|
515
|
-
error: Error | null;
|
|
516
|
-
};
|
|
517
|
-
|
|
518
155
|
type CartLineInput = Pick<TCartLine, "invMastUid" | "quantity" | "unitOfMeasure"> & {
|
|
519
156
|
cartHdrUid?: number | string | undefined;
|
|
520
157
|
};
|
|
@@ -777,260 +414,6 @@ declare const usePaginationPrefetch: ({ queryKey, queryFn, pageSize, queryKeyFn,
|
|
|
777
414
|
handlePaginationHover: (page: number) => () => void;
|
|
778
415
|
};
|
|
779
416
|
|
|
780
|
-
interface UseCategoryItemsInfiniteOptions {
|
|
781
|
-
enabled?: boolean;
|
|
782
|
-
/** Override the default queryFn (e.g. with a server action). */
|
|
783
|
-
queryFn?: (context: {
|
|
784
|
-
pageParam: unknown;
|
|
785
|
-
}) => Promise<InfiniteScrollPage>;
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* @deprecated Use `useInfiniteQuery(q.opensearch.itemSearch.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
789
|
-
*
|
|
790
|
-
* Infinite scroll for category product listings.
|
|
791
|
-
* Fetches pages of products via the augur-api SDK.
|
|
792
|
-
*/
|
|
793
|
-
declare function useCategoryItemsInfinite(itemCategoryUid: number, itemsFilters: TItemsFilters, options?: UseCategoryItemsInfiniteOptions): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<InfiniteScrollPage, unknown>, Error>;
|
|
794
|
-
|
|
795
|
-
interface UseItemSearchInfiniteOptions {
|
|
796
|
-
enabled?: boolean;
|
|
797
|
-
/** Override the default queryFn (e.g. with a server action). */
|
|
798
|
-
queryFn?: (context: {
|
|
799
|
-
pageParam: unknown;
|
|
800
|
-
}) => Promise<InfiniteScrollPage>;
|
|
801
|
-
}
|
|
802
|
-
/**
|
|
803
|
-
* @deprecated Use `useInfiniteQuery(q.opensearch.itemSearch.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version.
|
|
804
|
-
*
|
|
805
|
-
* Infinite scroll for search results.
|
|
806
|
-
* Fetches pages of products via the augur-api SDK OpenSearch endpoint.
|
|
807
|
-
*/
|
|
808
|
-
declare function useItemSearchInfinite(itemsFilters: TItemsFilters, itemCategoryUid?: number | string, options?: UseItemSearchInfiniteOptions): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<InfiniteScrollPage, unknown>, Error>;
|
|
809
|
-
|
|
810
|
-
interface UseJoomlaContentOptions {
|
|
811
|
-
enabled?: boolean;
|
|
812
|
-
queryFn?: () => Promise<TJoomlaContent>;
|
|
813
|
-
}
|
|
814
|
-
/** @deprecated Use `useQuery(q.joomla.content.doc.get(id))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
815
|
-
declare function useJoomlaContent(articleId: number | string | undefined, options?: UseJoomlaContentOptions): {
|
|
816
|
-
article: TJoomlaContent | null;
|
|
817
|
-
isLoading: boolean;
|
|
818
|
-
error: Error | null;
|
|
819
|
-
};
|
|
820
|
-
|
|
821
|
-
interface UseJoomlaContentListOptions {
|
|
822
|
-
enabled?: boolean;
|
|
823
|
-
queryFn?: () => Promise<ListResult<TJoomlaContent>>;
|
|
824
|
-
filters?: Partial<TJoomlaContentFilters>;
|
|
825
|
-
}
|
|
826
|
-
/** @deprecated Use `useQuery(q.joomla.content.list(params))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
827
|
-
declare function useJoomlaContentList(categoryId: number | string | undefined, options?: UseJoomlaContentListOptions): {
|
|
828
|
-
articles: TJoomlaContent[];
|
|
829
|
-
total: number;
|
|
830
|
-
count: number | undefined;
|
|
831
|
-
totalResults: number | undefined;
|
|
832
|
-
message: string | undefined;
|
|
833
|
-
status: number | undefined;
|
|
834
|
-
result: ListResult<TJoomlaContent>;
|
|
835
|
-
isLoading: false;
|
|
836
|
-
error: Error | null;
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
interface UseJoomlaMenuOptions {
|
|
840
|
-
enabled?: boolean;
|
|
841
|
-
queryFn?: () => Promise<ListResult<MenuItem>>;
|
|
842
|
-
filters?: Partial<TMenuFilters>;
|
|
843
|
-
}
|
|
844
|
-
/** @deprecated Use `useQuery(q.joomla.menu.list(id))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
845
|
-
declare function useJoomlaMenu(options?: UseJoomlaMenuOptions): {
|
|
846
|
-
menuItems: MenuItem[];
|
|
847
|
-
total: number;
|
|
848
|
-
count: number | undefined;
|
|
849
|
-
totalResults: number | undefined;
|
|
850
|
-
message: string | undefined;
|
|
851
|
-
status: number | undefined;
|
|
852
|
-
result: ListResult<MenuItem>;
|
|
853
|
-
isLoading: false;
|
|
854
|
-
error: Error | null;
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
interface UseJoomlaMenuDocOptions {
|
|
858
|
-
enabled?: boolean;
|
|
859
|
-
queryFn?: () => Promise<MenuItem>;
|
|
860
|
-
}
|
|
861
|
-
/** @deprecated Use `useQuery(q.joomla.menu.doc.get(id))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
862
|
-
declare function useJoomlaMenuDoc(menuId: number | string | undefined, options?: UseJoomlaMenuDocOptions): {
|
|
863
|
-
menuItem: MenuItem | null;
|
|
864
|
-
isLoading: boolean;
|
|
865
|
-
error: Error | null;
|
|
866
|
-
};
|
|
867
|
-
|
|
868
|
-
interface UseCustomerOrdersOptions {
|
|
869
|
-
enabled?: boolean;
|
|
870
|
-
queryFn?: () => Promise<ListResult>;
|
|
871
|
-
}
|
|
872
|
-
/** @deprecated Use `useQuery(q.customers.customer.orders.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
873
|
-
declare function useCustomerOrders(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerOrdersOptions): {
|
|
874
|
-
orders: unknown[];
|
|
875
|
-
total: number;
|
|
876
|
-
count: number | undefined;
|
|
877
|
-
totalResults: number | undefined;
|
|
878
|
-
message: string | undefined;
|
|
879
|
-
status: number | undefined;
|
|
880
|
-
result: ListResult;
|
|
881
|
-
isLoading: boolean;
|
|
882
|
-
error: Error | null;
|
|
883
|
-
};
|
|
884
|
-
interface UseOrderDetailOptions {
|
|
885
|
-
enabled?: boolean;
|
|
886
|
-
queryFn?: () => Promise<unknown>;
|
|
887
|
-
}
|
|
888
|
-
/** @deprecated Use `useQuery(q.customers.customer.orders.get(custId, orderNo))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
889
|
-
declare function useOrderDetail(customerId?: number | string, orderId?: number | string, options?: UseOrderDetailOptions): {
|
|
890
|
-
order: {} | null;
|
|
891
|
-
isLoading: boolean;
|
|
892
|
-
error: Error | null;
|
|
893
|
-
};
|
|
894
|
-
|
|
895
|
-
interface UseCustomerInvoicesOptions {
|
|
896
|
-
enabled?: boolean;
|
|
897
|
-
queryFn?: () => Promise<ListResult>;
|
|
898
|
-
}
|
|
899
|
-
/** @deprecated Use `useQuery(q.customers.customer.invoices.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
900
|
-
declare function useCustomerInvoices(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerInvoicesOptions): {
|
|
901
|
-
invoices: unknown[];
|
|
902
|
-
total: number;
|
|
903
|
-
count: number | undefined;
|
|
904
|
-
totalResults: number | undefined;
|
|
905
|
-
message: string | undefined;
|
|
906
|
-
status: number | undefined;
|
|
907
|
-
result: ListResult;
|
|
908
|
-
isLoading: boolean;
|
|
909
|
-
error: Error | null;
|
|
910
|
-
};
|
|
911
|
-
interface UseInvoiceDetailOptions {
|
|
912
|
-
enabled?: boolean;
|
|
913
|
-
queryFn?: () => Promise<unknown>;
|
|
914
|
-
}
|
|
915
|
-
/** @deprecated Use `useQuery(q.customers.customer.invoices.get(custId, invoiceNo))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
916
|
-
declare function useInvoiceDetail(customerId?: number | string, invoiceNo?: number | string, options?: UseInvoiceDetailOptions): {
|
|
917
|
-
invoice: {} | null;
|
|
918
|
-
isLoading: boolean;
|
|
919
|
-
error: Error | null;
|
|
920
|
-
};
|
|
921
|
-
|
|
922
|
-
interface UseCustomerQuotesOptions {
|
|
923
|
-
enabled?: boolean;
|
|
924
|
-
queryFn?: () => Promise<ListResult>;
|
|
925
|
-
}
|
|
926
|
-
/** @deprecated Use `useQuery(q.customers.customer.quotes.list(custId))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
927
|
-
declare function useCustomerQuotes(customerId?: number | string, params?: Record<string, unknown>, options?: UseCustomerQuotesOptions): {
|
|
928
|
-
quotes: unknown[];
|
|
929
|
-
total: number;
|
|
930
|
-
count: number | undefined;
|
|
931
|
-
totalResults: number | undefined;
|
|
932
|
-
message: string | undefined;
|
|
933
|
-
status: number | undefined;
|
|
934
|
-
result: ListResult;
|
|
935
|
-
isLoading: boolean;
|
|
936
|
-
error: Error | null;
|
|
937
|
-
};
|
|
938
|
-
interface UseQuoteDetailOptions {
|
|
939
|
-
enabled?: boolean;
|
|
940
|
-
queryFn?: () => Promise<unknown>;
|
|
941
|
-
}
|
|
942
|
-
/** @deprecated Use `useQuery(q.customers.customer.quotes.get(custId, quoteNo))` with `useAugurOptions()` instead. Will be removed in the next major version. */
|
|
943
|
-
declare function useQuoteDetail(customerId?: number | string, quoteNo?: number | string, options?: UseQuoteDetailOptions): {
|
|
944
|
-
quote: {} | null;
|
|
945
|
-
isLoading: boolean;
|
|
946
|
-
error: Error | null;
|
|
947
|
-
};
|
|
948
|
-
|
|
949
|
-
/**
|
|
950
|
-
* Factory function that creates a pre-configured provider + hook bundle,
|
|
951
|
-
* eliminating per-hook wrapper boilerplate in consumer sites.
|
|
952
|
-
*
|
|
953
|
-
* @example
|
|
954
|
-
* ```ts
|
|
955
|
-
* // lib/augur.ts
|
|
956
|
-
* import { createSiteHooks } from "@simpleapps-com/augur-hooks";
|
|
957
|
-
* import { getItemPrice, getItemCategory } from "@/lib/actions/pricing";
|
|
958
|
-
*
|
|
959
|
-
* export const augur = createSiteHooks({
|
|
960
|
-
* callbacks: { getItemPrice, getItemCategory },
|
|
961
|
-
* // defaultCustomerId falls back to DEFAULT_CUSTOMER_ID env var automatically
|
|
962
|
-
* });
|
|
963
|
-
*
|
|
964
|
-
* // app/layout.tsx
|
|
965
|
-
* <augur.Provider api={api} auth={{ status, customerId, userId }}>
|
|
966
|
-
* {children}
|
|
967
|
-
* </augur.Provider>
|
|
968
|
-
*
|
|
969
|
-
* // components/price.tsx
|
|
970
|
-
* const { data } = augur.useItemPrice(itemId);
|
|
971
|
-
* ```
|
|
972
|
-
*/
|
|
973
|
-
|
|
974
|
-
interface CreateSiteHooksConfig {
|
|
975
|
-
/** Callback registry for routing SDK calls through server actions. */
|
|
976
|
-
callbacks?: Partial<AugurCallbacks>;
|
|
977
|
-
/** Default customer ID used when auth.customerId is not provided. */
|
|
978
|
-
defaultCustomerId?: string | number;
|
|
979
|
-
/** Cache configuration — controls edge and Redis caching per tier. */
|
|
980
|
-
cache?: CacheConfig;
|
|
981
|
-
/** Image CDN configuration for agr.media URL generation. */
|
|
982
|
-
imageConfig?: ImageConfig;
|
|
983
|
-
}
|
|
984
|
-
interface SiteHooksProviderProps {
|
|
985
|
-
/** SDK client instance. Optional when all data fetching is routed through callbacks. */
|
|
986
|
-
api?: AugurApiClient;
|
|
987
|
-
/** Auth context (partial -- missing fields are filled from config defaults). */
|
|
988
|
-
auth?: Partial<AugurAuthContext>;
|
|
989
|
-
children: ReactNode;
|
|
990
|
-
}
|
|
991
|
-
interface SiteHooks {
|
|
992
|
-
Provider: (props: SiteHooksProviderProps) => ReturnType<typeof createElement>;
|
|
993
|
-
useItemPrice: typeof useItemPrice;
|
|
994
|
-
useCartPricing: typeof useCartPricing;
|
|
995
|
-
useInvMast: typeof useInvMast;
|
|
996
|
-
useInvMastDoc: typeof useInvMastDoc;
|
|
997
|
-
useBatchInvMastDoc: typeof useBatchInvMastDoc;
|
|
998
|
-
useInvMastStock: typeof useInvMastStock;
|
|
999
|
-
useItemCategory: typeof useItemCategory;
|
|
1000
|
-
useProductCategory: typeof useProductCategory;
|
|
1001
|
-
useItemDetails: typeof useItemDetails;
|
|
1002
|
-
useItemAttributes: typeof useItemAttributes;
|
|
1003
|
-
useProductSearch: typeof useProductSearch;
|
|
1004
|
-
useSearchSuggestions: typeof useSearchSuggestions;
|
|
1005
|
-
useCartActions: typeof useCartActions;
|
|
1006
|
-
useCartInitialization: typeof useCartInitialization;
|
|
1007
|
-
usePaginationPrefetch: typeof usePaginationPrefetch;
|
|
1008
|
-
useCategoryItemsInfinite: typeof useCategoryItemsInfinite;
|
|
1009
|
-
useItemSearchInfinite: typeof useItemSearchInfinite;
|
|
1010
|
-
useJoomlaContent: typeof useJoomlaContent;
|
|
1011
|
-
useJoomlaContentList: typeof useJoomlaContentList;
|
|
1012
|
-
useJoomlaMenu: typeof useJoomlaMenu;
|
|
1013
|
-
useJoomlaMenuDoc: typeof useJoomlaMenuDoc;
|
|
1014
|
-
useCustomerOrders: typeof useCustomerOrders;
|
|
1015
|
-
useOrderDetail: typeof useOrderDetail;
|
|
1016
|
-
useCustomerInvoices: typeof useCustomerInvoices;
|
|
1017
|
-
useInvoiceDetail: typeof useInvoiceDetail;
|
|
1018
|
-
useCustomerQuotes: typeof useCustomerQuotes;
|
|
1019
|
-
useQuoteDetail: typeof useQuoteDetail;
|
|
1020
|
-
useDebounce: typeof useDebounce;
|
|
1021
|
-
useFormatPrice: typeof useFormatPrice;
|
|
1022
|
-
useImageWithFallback: (imagePath: string | undefined, options?: ImageUrlOptions) => ReturnType<typeof useImageWithFallback>;
|
|
1023
|
-
}
|
|
1024
|
-
/**
|
|
1025
|
-
* @deprecated Use `AugurHooksProvider` and `useAugurOptions()` instead. Will be removed in the next major version.
|
|
1026
|
-
*
|
|
1027
|
-
* Creates a pre-configured provider component and re-exports all hooks.
|
|
1028
|
-
*
|
|
1029
|
-
* The returned `Provider` merges `config.defaultCustomerId` into the auth
|
|
1030
|
-
* context; an explicit `auth.customerId` prop takes priority.
|
|
1031
|
-
*/
|
|
1032
|
-
declare function createSiteHooks(config?: CreateSiteHooksConfig): SiteHooks;
|
|
1033
|
-
|
|
1034
417
|
/**
|
|
1035
418
|
* Returns a fully configured `persistOptions` object for use with
|
|
1036
419
|
* `PersistQueryClientProvider` from `@tanstack/react-query-persist-client`.
|
|
@@ -1082,4 +465,4 @@ declare function useAugurPersistence(config: PersistenceConfig): {
|
|
|
1082
465
|
};
|
|
1083
466
|
};
|
|
1084
467
|
|
|
1085
|
-
export {
|
|
468
|
+
export { type CartActionCallbacks, type CartInitCallbacks, type CartPriceData, type CartPricingResult, type CartSessionInfo, type FormatPriceCallOptions, type PaymentBillingAddress, type PaymentFlowCallbacks, PersistenceConfig, type UseFormatPriceOptions, type UseStockOptions, useAugurPersistence, useCartActions, useCartHdrUid, useCartInitialization, useCartLineCount, useCartLines, useCartPricing, useCartQuantityTotal, useCartStore, useClearCart, useDebounce, useFormatPrice, useItemFiltersStore, usePaginationPrefetch, usePaymentFlow, useSetCartHdrUid, useSetCartLines, useStock };
|