@simpleapps-com/augur-hooks 0.3.1 → 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-LCWJOWAC.js → chunk-CL3XM5B5.js} +33 -3
- package/dist/chunk-CL3XM5B5.js.map +1 -0
- package/dist/{chunk-QXDTBGFO.cjs → chunk-I3JHJMQ6.cjs} +32 -2
- package/dist/chunk-I3JHJMQ6.cjs.map +1 -0
- package/dist/{joomla-menu-doc-C0Dcq1eO.d.cts → customer-quotes-SdLKX_-8.d.cts} +31 -1
- package/dist/{joomla-menu-doc-C0Dcq1eO.d.ts → customer-quotes-SdLKX_-8.d.ts} +31 -1
- package/dist/index.cjs +163 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -3
- package/dist/index.d.ts +81 -3
- package/dist/index.js +131 -1
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +14 -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 +13 -1
- package/package.json +3 -3
- package/dist/chunk-LCWJOWAC.js.map +0 -1
- package/dist/chunk-QXDTBGFO.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -32,7 +32,13 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var _chunkI3JHJMQ6cjs = require('./chunk-I3JHJMQ6.cjs');
|
|
36
42
|
|
|
37
43
|
// src/provider.tsx
|
|
38
44
|
var _react = require('react');
|
|
@@ -177,7 +183,7 @@ function useItemPrice(itemId, customerId, quantity = 1, options = {}) {
|
|
|
177
183
|
const auth = useAugurAuth();
|
|
178
184
|
const cache = useAugurCache();
|
|
179
185
|
const effectiveCustomerId = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _ => _.customerId])));
|
|
180
|
-
const defaultOptions =
|
|
186
|
+
const defaultOptions = _chunkI3JHJMQ6cjs.getItemPriceOptions.call(void 0, api, itemId, effectiveCustomerId, quantity, cache);
|
|
181
187
|
const resolvedQueryFn = _nullishCoalesce(options.queryFn, () => ( (_optionalChain([callbacks, 'optionalAccess', _2 => _2.getItemPrice]) ? () => callbacks.getItemPrice(itemId, effectiveCustomerId, quantity) : void 0)));
|
|
182
188
|
return _reactquery.useQuery.call(void 0, {
|
|
183
189
|
...defaultOptions,
|
|
@@ -193,7 +199,7 @@ function useInvMastDoc(invMastUid, itemId, options = {}) {
|
|
|
193
199
|
const api = useAugurApiOptional();
|
|
194
200
|
const callbacks = useAugurCallbacks();
|
|
195
201
|
const cache = useAugurCache();
|
|
196
|
-
const queryOpts =
|
|
202
|
+
const queryOpts = _chunkI3JHJMQ6cjs.getInvMastDocOptions.call(void 0,
|
|
197
203
|
api,
|
|
198
204
|
invMastUid,
|
|
199
205
|
itemId,
|
|
@@ -215,7 +221,7 @@ function useItemCategory(itemCategoryUid, options = {}) {
|
|
|
215
221
|
const api = useAugurApiOptional();
|
|
216
222
|
const callbacks = useAugurCallbacks();
|
|
217
223
|
const cache = useAugurCache();
|
|
218
|
-
const queryOpts =
|
|
224
|
+
const queryOpts = _chunkI3JHJMQ6cjs.getItemCategoryOptions.call(void 0,
|
|
219
225
|
api,
|
|
220
226
|
itemCategoryUid,
|
|
221
227
|
options.apiOptions,
|
|
@@ -235,7 +241,7 @@ function useInvMast(invMastUid, itemId, options = {}) {
|
|
|
235
241
|
const api = useAugurApiOptional();
|
|
236
242
|
const callbacks = useAugurCallbacks();
|
|
237
243
|
const cache = useAugurCache();
|
|
238
|
-
const queryOpts =
|
|
244
|
+
const queryOpts = _chunkI3JHJMQ6cjs.getInvMastOptions.call(void 0, api, invMastUid, itemId, cache);
|
|
239
245
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
240
246
|
...queryOpts,
|
|
241
247
|
..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _5 => _5.getInvMast]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getInvMast(invMastUid, itemId)))) } : {},
|
|
@@ -250,7 +256,7 @@ function useInvMastStock(invMastUid, options = {}) {
|
|
|
250
256
|
const api = useAugurApiOptional();
|
|
251
257
|
const callbacks = useAugurCallbacks();
|
|
252
258
|
const cache = useAugurCache();
|
|
253
|
-
const queryOpts =
|
|
259
|
+
const queryOpts = _chunkI3JHJMQ6cjs.getInvMastStockOptions.call(void 0, api, invMastUid, cache);
|
|
254
260
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
255
261
|
...queryOpts,
|
|
256
262
|
..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _6 => _6.getInvMastStock]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getInvMastStock(invMastUid)))) } : {},
|
|
@@ -281,8 +287,8 @@ function useProductCategory(itemCategoryUid, options = {}) {
|
|
|
281
287
|
const api = useAugurApiOptional();
|
|
282
288
|
const callbacks = useAugurCallbacks();
|
|
283
289
|
const cache = useAugurCache();
|
|
284
|
-
const baseOptions = itemCategoryUid ?
|
|
285
|
-
queryKey:
|
|
290
|
+
const baseOptions = itemCategoryUid ? _chunkI3JHJMQ6cjs.getProductCategoryOptions.call(void 0, api, itemCategoryUid, cache) : {
|
|
291
|
+
queryKey: _chunkI3JHJMQ6cjs.getProductCategoryKey.call(void 0, null),
|
|
286
292
|
/* v8 ignore next */
|
|
287
293
|
queryFn: () => Promise.reject()
|
|
288
294
|
};
|
|
@@ -310,8 +316,8 @@ function useItemDetails(itemId, options = {}) {
|
|
|
310
316
|
const callbacks = useAugurCallbacks();
|
|
311
317
|
const cache = useAugurCache();
|
|
312
318
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
313
|
-
...itemId ?
|
|
314
|
-
queryKey:
|
|
319
|
+
...itemId ? _chunkI3JHJMQ6cjs.getItemDetailsOptions.call(void 0, api, itemId, cache) : {
|
|
320
|
+
queryKey: _chunkI3JHJMQ6cjs.getItemDetailsKey.call(void 0, ""),
|
|
315
321
|
/* v8 ignore next */
|
|
316
322
|
queryFn: () => Promise.reject()
|
|
317
323
|
},
|
|
@@ -338,8 +344,8 @@ function useItemAttributes(itemCategoryUid, options = {}) {
|
|
|
338
344
|
const callbacks = useAugurCallbacks();
|
|
339
345
|
const cache = useAugurCache();
|
|
340
346
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
341
|
-
...itemCategoryUid ?
|
|
342
|
-
queryKey:
|
|
347
|
+
...itemCategoryUid ? _chunkI3JHJMQ6cjs.getItemAttributesOptions.call(void 0, api, itemCategoryUid, cache) : {
|
|
348
|
+
queryKey: _chunkI3JHJMQ6cjs.getItemAttributesKey.call(void 0, null),
|
|
343
349
|
/* v8 ignore next */
|
|
344
350
|
queryFn: () => Promise.reject()
|
|
345
351
|
},
|
|
@@ -363,7 +369,7 @@ function useProductSearch(pageData, options = {}) {
|
|
|
363
369
|
const api = useAugurApiOptional();
|
|
364
370
|
const callbacks = useAugurCallbacks();
|
|
365
371
|
const cache = useAugurCache();
|
|
366
|
-
const defaultOptions =
|
|
372
|
+
const defaultOptions = _chunkI3JHJMQ6cjs.getProductSearchOptions.call(void 0, api, pageData, cache);
|
|
367
373
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
368
374
|
...defaultOptions,
|
|
369
375
|
..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _16 => _16.getProductSearch]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getProductSearch(pageData)))) } : {},
|
|
@@ -389,7 +395,7 @@ function useSearchSuggestions(query, options = {}) {
|
|
|
389
395
|
const limit = _nullishCoalesce(options.limit, () => ( 10));
|
|
390
396
|
const offset = _nullishCoalesce(options.offset, () => ( 0));
|
|
391
397
|
const enabled = (_nullishCoalesce(options.enabled, () => ( true))) && query.trim().length > 0;
|
|
392
|
-
const defaultOptions =
|
|
398
|
+
const defaultOptions = _chunkI3JHJMQ6cjs.getSearchSuggestionsOptions.call(void 0, api, query, limit, offset, cache);
|
|
393
399
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
394
400
|
...defaultOptions,
|
|
395
401
|
..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _19 => _19.getSearchSuggestions]))) ? { queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getSearchSuggestions(query, limit, offset)))) } : {},
|
|
@@ -700,12 +706,12 @@ function useCartPricing(options = {}) {
|
|
|
700
706
|
const priceQueries = _reactquery.useQueries.call(void 0, {
|
|
701
707
|
queries: cartLines.map((line) => {
|
|
702
708
|
const base = priceFn ? {
|
|
703
|
-
queryKey:
|
|
709
|
+
queryKey: _chunkI3JHJMQ6cjs.getItemPriceKey.call(void 0, line.itemId, customerId, line.quantity),
|
|
704
710
|
queryFn: () => priceFn(line.itemId, customerId, line.quantity),
|
|
705
711
|
refetchOnReconnect: true,
|
|
706
712
|
refetchOnWindowFocus: false,
|
|
707
713
|
meta: { persist: true }
|
|
708
|
-
} :
|
|
714
|
+
} : _chunkI3JHJMQ6cjs.getItemPriceOptions.call(void 0, api, line.itemId, customerId, line.quantity, cache);
|
|
709
715
|
return {
|
|
710
716
|
...base,
|
|
711
717
|
enabled: !!customerId && !!line.itemId
|
|
@@ -805,7 +811,7 @@ function useCategoryItemsInfinite(itemCategoryUid, itemsFilters, options = {}) {
|
|
|
805
811
|
const callbacks = useAugurCallbacks();
|
|
806
812
|
const cache = useAugurCache();
|
|
807
813
|
const { enabled = true } = options;
|
|
808
|
-
const defaultOptions =
|
|
814
|
+
const defaultOptions = _chunkI3JHJMQ6cjs.getCategoryItemsInfiniteOptions.call(void 0,
|
|
809
815
|
api,
|
|
810
816
|
itemCategoryUid,
|
|
811
817
|
itemsFilters,
|
|
@@ -832,7 +838,7 @@ function useItemSearchInfinite(itemsFilters, itemCategoryUid, options = {}) {
|
|
|
832
838
|
const callbacks = useAugurCallbacks();
|
|
833
839
|
const cache = useAugurCache();
|
|
834
840
|
const { enabled = true } = options;
|
|
835
|
-
const defaultOptions =
|
|
841
|
+
const defaultOptions = _chunkI3JHJMQ6cjs.getItemSearchInfiniteOptions.call(void 0,
|
|
836
842
|
api,
|
|
837
843
|
itemsFilters,
|
|
838
844
|
itemCategoryUid,
|
|
@@ -859,8 +865,8 @@ function useJoomlaContent(articleId, options = {}) {
|
|
|
859
865
|
const callbacks = useAugurCallbacks();
|
|
860
866
|
const cache = useAugurCache();
|
|
861
867
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
862
|
-
...articleId ?
|
|
863
|
-
queryKey:
|
|
868
|
+
...articleId ? _chunkI3JHJMQ6cjs.getJoomlaContentOptions.call(void 0, api, articleId, cache) : {
|
|
869
|
+
queryKey: _chunkI3JHJMQ6cjs.getJoomlaContentKey.call(void 0, ""),
|
|
864
870
|
/* v8 ignore next */
|
|
865
871
|
queryFn: () => Promise.reject()
|
|
866
872
|
},
|
|
@@ -881,8 +887,8 @@ function useJoomlaContentList(categoryId, options = {}) {
|
|
|
881
887
|
const callbacks = useAugurCallbacks();
|
|
882
888
|
const cache = useAugurCache();
|
|
883
889
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
884
|
-
...categoryId ?
|
|
885
|
-
queryKey:
|
|
890
|
+
...categoryId ? _chunkI3JHJMQ6cjs.getJoomlaContentListOptions.call(void 0, api, categoryId, options.filters, cache) : {
|
|
891
|
+
queryKey: _chunkI3JHJMQ6cjs.getJoomlaContentListKey.call(void 0, ""),
|
|
886
892
|
/* v8 ignore next */
|
|
887
893
|
queryFn: () => Promise.reject()
|
|
888
894
|
},
|
|
@@ -905,7 +911,7 @@ function useJoomlaMenu(options = {}) {
|
|
|
905
911
|
const callbacks = useAugurCallbacks();
|
|
906
912
|
const cache = useAugurCache();
|
|
907
913
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
908
|
-
...
|
|
914
|
+
..._chunkI3JHJMQ6cjs.getJoomlaMenuOptions.call(void 0, api, options.filters, cache),
|
|
909
915
|
..._nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _55 => _55.getJoomlaMenu]))) ? {
|
|
910
916
|
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getJoomlaMenu(options.filters))))
|
|
911
917
|
} : {},
|
|
@@ -925,8 +931,8 @@ function useJoomlaMenuDoc(menuId, options = {}) {
|
|
|
925
931
|
const callbacks = useAugurCallbacks();
|
|
926
932
|
const cache = useAugurCache();
|
|
927
933
|
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
928
|
-
...menuId ?
|
|
929
|
-
queryKey:
|
|
934
|
+
...menuId ? _chunkI3JHJMQ6cjs.getJoomlaMenuDocOptions.call(void 0, api, menuId, cache) : {
|
|
935
|
+
queryKey: _chunkI3JHJMQ6cjs.getJoomlaMenuDocKey.call(void 0, ""),
|
|
930
936
|
/* v8 ignore next */
|
|
931
937
|
queryFn: () => Promise.reject()
|
|
932
938
|
},
|
|
@@ -940,16 +946,121 @@ function useJoomlaMenuDoc(menuId, options = {}) {
|
|
|
940
946
|
};
|
|
941
947
|
}
|
|
942
948
|
|
|
949
|
+
// src/hooks/use-customer-orders.ts
|
|
950
|
+
|
|
951
|
+
function useCustomerOrders(customerId, params, options = {}) {
|
|
952
|
+
const callbacks = useAugurCallbacks();
|
|
953
|
+
const auth = useAugurAuth();
|
|
954
|
+
const effectiveCustomerId = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _57 => _57.customerId])));
|
|
955
|
+
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
956
|
+
queryKey: _chunkI3JHJMQ6cjs.getCustomerOrdersKey.call(void 0, effectiveCustomerId, params),
|
|
957
|
+
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getCustomerOrders(effectiveCustomerId, params)))),
|
|
958
|
+
enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!effectiveCustomerId && !!(_nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _58 => _58.getCustomerOrders]))))
|
|
959
|
+
});
|
|
960
|
+
return {
|
|
961
|
+
orders: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _59 => _59.data]), () => ( [])),
|
|
962
|
+
total: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _60 => _60.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 = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _61 => _61.customerId])));
|
|
971
|
+
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
972
|
+
queryKey: _chunkI3JHJMQ6cjs.getCustomerOrderDetailKey.call(void 0, effectiveCustomerId, orderId),
|
|
973
|
+
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getCustomerOrderDetail(effectiveCustomerId, orderId)))),
|
|
974
|
+
enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!effectiveCustomerId && !!orderId && !!(_nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _62 => _62.getCustomerOrderDetail]))))
|
|
975
|
+
});
|
|
976
|
+
return {
|
|
977
|
+
order: _nullishCoalesce(data, () => ( null)),
|
|
978
|
+
isLoading,
|
|
979
|
+
error
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// src/hooks/use-customer-invoices.ts
|
|
984
|
+
|
|
985
|
+
function useCustomerInvoices(customerId, params, options = {}) {
|
|
986
|
+
const callbacks = useAugurCallbacks();
|
|
987
|
+
const auth = useAugurAuth();
|
|
988
|
+
const effectiveCustomerId = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _63 => _63.customerId])));
|
|
989
|
+
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
990
|
+
queryKey: _chunkI3JHJMQ6cjs.getCustomerInvoicesKey.call(void 0, effectiveCustomerId, params),
|
|
991
|
+
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getCustomerInvoices(effectiveCustomerId, params)))),
|
|
992
|
+
enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!effectiveCustomerId && !!(_nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _64 => _64.getCustomerInvoices]))))
|
|
993
|
+
});
|
|
994
|
+
return {
|
|
995
|
+
invoices: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _65 => _65.data]), () => ( [])),
|
|
996
|
+
total: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _66 => _66.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 = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _67 => _67.customerId])));
|
|
1005
|
+
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
1006
|
+
queryKey: _chunkI3JHJMQ6cjs.getCustomerInvoiceDetailKey.call(void 0, effectiveCustomerId, invoiceNo),
|
|
1007
|
+
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getCustomerInvoiceDetail(
|
|
1008
|
+
effectiveCustomerId,
|
|
1009
|
+
invoiceNo
|
|
1010
|
+
)))),
|
|
1011
|
+
enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!effectiveCustomerId && !!invoiceNo && !!(_nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _68 => _68.getCustomerInvoiceDetail]))))
|
|
1012
|
+
});
|
|
1013
|
+
return {
|
|
1014
|
+
invoice: _nullishCoalesce(data, () => ( null)),
|
|
1015
|
+
isLoading,
|
|
1016
|
+
error
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// src/hooks/use-customer-quotes.ts
|
|
1021
|
+
|
|
1022
|
+
function useCustomerQuotes(customerId, params, options = {}) {
|
|
1023
|
+
const callbacks = useAugurCallbacks();
|
|
1024
|
+
const auth = useAugurAuth();
|
|
1025
|
+
const effectiveCustomerId = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _69 => _69.customerId])));
|
|
1026
|
+
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
1027
|
+
queryKey: _chunkI3JHJMQ6cjs.getCustomerQuotesKey.call(void 0, effectiveCustomerId, params),
|
|
1028
|
+
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getCustomerQuotes(effectiveCustomerId, params)))),
|
|
1029
|
+
enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!effectiveCustomerId && !!(_nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _70 => _70.getCustomerQuotes]))))
|
|
1030
|
+
});
|
|
1031
|
+
return {
|
|
1032
|
+
quotes: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _71 => _71.data]), () => ( [])),
|
|
1033
|
+
total: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _72 => _72.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 = _nullishCoalesce(customerId, () => ( _optionalChain([auth, 'optionalAccess', _73 => _73.customerId])));
|
|
1042
|
+
const { data, isLoading, error } = _reactquery.useQuery.call(void 0, {
|
|
1043
|
+
queryKey: _chunkI3JHJMQ6cjs.getCustomerQuoteDetailKey.call(void 0, effectiveCustomerId, quoteNo),
|
|
1044
|
+
queryFn: _nullishCoalesce(options.queryFn, () => ( (() => callbacks.getCustomerQuoteDetail(effectiveCustomerId, quoteNo)))),
|
|
1045
|
+
enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!effectiveCustomerId && !!quoteNo && !!(_nullishCoalesce(options.queryFn, () => ( _optionalChain([callbacks, 'optionalAccess', _74 => _74.getCustomerQuoteDetail]))))
|
|
1046
|
+
});
|
|
1047
|
+
return {
|
|
1048
|
+
quote: _nullishCoalesce(data, () => ( null)),
|
|
1049
|
+
isLoading,
|
|
1050
|
+
error
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
|
|
943
1054
|
// src/create-site-hooks.ts
|
|
944
1055
|
|
|
945
1056
|
function createSiteHooks(config = {}) {
|
|
946
1057
|
const { callbacks, defaultCustomerId, cache } = config;
|
|
947
1058
|
function Provider({ api, auth, children }) {
|
|
948
1059
|
const mergedAuth = {
|
|
949
|
-
status: _nullishCoalesce(_optionalChain([auth, 'optionalAccess',
|
|
950
|
-
customerId: _nullishCoalesce(_optionalChain([auth, 'optionalAccess',
|
|
951
|
-
userId: _optionalChain([auth, 'optionalAccess',
|
|
952
|
-
cartHdrUid: _optionalChain([auth, 'optionalAccess',
|
|
1060
|
+
status: _nullishCoalesce(_optionalChain([auth, 'optionalAccess', _75 => _75.status]), () => ( "unauthenticated")),
|
|
1061
|
+
customerId: _nullishCoalesce(_optionalChain([auth, 'optionalAccess', _76 => _76.customerId]), () => ( defaultCustomerId)),
|
|
1062
|
+
userId: _optionalChain([auth, 'optionalAccess', _77 => _77.userId]),
|
|
1063
|
+
cartHdrUid: _optionalChain([auth, 'optionalAccess', _78 => _78.cartHdrUid])
|
|
953
1064
|
};
|
|
954
1065
|
return _react.createElement.call(void 0, AugurHooksProvider, {
|
|
955
1066
|
api,
|
|
@@ -989,6 +1100,13 @@ function createSiteHooks(config = {}) {
|
|
|
989
1100
|
useJoomlaContentList,
|
|
990
1101
|
useJoomlaMenu,
|
|
991
1102
|
useJoomlaMenuDoc,
|
|
1103
|
+
// Hooks -- customer
|
|
1104
|
+
useCustomerOrders,
|
|
1105
|
+
useOrderDetail,
|
|
1106
|
+
useCustomerInvoices,
|
|
1107
|
+
useInvoiceDetail,
|
|
1108
|
+
useCustomerQuotes,
|
|
1109
|
+
useQuoteDetail,
|
|
992
1110
|
// Hooks -- utilities
|
|
993
1111
|
useDebounce,
|
|
994
1112
|
useFormatPrice
|
|
@@ -1011,7 +1129,7 @@ function deserialize(data) {
|
|
|
1011
1129
|
|
|
1012
1130
|
// src/persistence/apply-limits.ts
|
|
1013
1131
|
function applyLimits(data, limits) {
|
|
1014
|
-
const queries = _optionalChain([data, 'access',
|
|
1132
|
+
const queries = _optionalChain([data, 'access', _79 => _79.clientState, 'optionalAccess', _80 => _80.queries]);
|
|
1015
1133
|
if (!queries || Object.keys(limits).length === 0) return data;
|
|
1016
1134
|
const entries = queries;
|
|
1017
1135
|
const unlimited = [];
|
|
@@ -1112,7 +1230,7 @@ function useStorageMonitor(config) {
|
|
|
1112
1230
|
const raw = storage.getItem(key);
|
|
1113
1231
|
if (!raw) return;
|
|
1114
1232
|
const parsed = JSON.parse(raw);
|
|
1115
|
-
if (!_optionalChain([parsed, 'access',
|
|
1233
|
+
if (!_optionalChain([parsed, 'access', _81 => _81.clientState, 'optionalAccess', _82 => _82.queries])) return;
|
|
1116
1234
|
parsed.clientState.queries = parsed.clientState.queries.filter(
|
|
1117
1235
|
(q) => {
|
|
1118
1236
|
if (!Array.isArray(q.queryKey)) return true;
|
|
@@ -1139,7 +1257,7 @@ function useAugurPersistence(config) {
|
|
|
1139
1257
|
setIsMounted(true);
|
|
1140
1258
|
}, []);
|
|
1141
1259
|
useStorageMonitor(config);
|
|
1142
|
-
const isDev = typeof process !== "undefined" && _optionalChain([process, 'access',
|
|
1260
|
+
const isDev = typeof process !== "undefined" && _optionalChain([process, 'access', _83 => _83.env, 'optionalAccess', _84 => _84.NODE_ENV]) === "development";
|
|
1143
1261
|
const { persistableKeys } = config;
|
|
1144
1262
|
const dehydrateOptions = _react.useMemo.call(void 0, () => ({
|
|
1145
1263
|
shouldDehydrateQuery: (query) => {
|
|
@@ -1228,5 +1346,17 @@ function useAugurPersistence(config) {
|
|
|
1228
1346
|
|
|
1229
1347
|
|
|
1230
1348
|
|
|
1231
|
-
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
exports.AugurHooksProvider = AugurHooksProvider; exports.createSiteHooks = createSiteHooks; exports.getCartPricingQueryOptions = _chunkI3JHJMQ6cjs.getCartPricingQueryOptions; exports.getCategoryItemsInfiniteKey = _chunkI3JHJMQ6cjs.getCategoryItemsInfiniteKey; exports.getCategoryItemsInfiniteOptions = _chunkI3JHJMQ6cjs.getCategoryItemsInfiniteOptions; exports.getCustomerInvoiceDetailKey = _chunkI3JHJMQ6cjs.getCustomerInvoiceDetailKey; exports.getCustomerInvoicesKey = _chunkI3JHJMQ6cjs.getCustomerInvoicesKey; exports.getCustomerOrderDetailKey = _chunkI3JHJMQ6cjs.getCustomerOrderDetailKey; exports.getCustomerOrdersKey = _chunkI3JHJMQ6cjs.getCustomerOrdersKey; exports.getCustomerQuoteDetailKey = _chunkI3JHJMQ6cjs.getCustomerQuoteDetailKey; exports.getCustomerQuotesKey = _chunkI3JHJMQ6cjs.getCustomerQuotesKey; exports.getInvMastDocKey = _chunkI3JHJMQ6cjs.getInvMastDocKey; exports.getInvMastDocOptions = _chunkI3JHJMQ6cjs.getInvMastDocOptions; exports.getInvMastKey = _chunkI3JHJMQ6cjs.getInvMastKey; exports.getInvMastOptions = _chunkI3JHJMQ6cjs.getInvMastOptions; exports.getInvMastStockKey = _chunkI3JHJMQ6cjs.getInvMastStockKey; exports.getInvMastStockOptions = _chunkI3JHJMQ6cjs.getInvMastStockOptions; exports.getItemAttributesKey = _chunkI3JHJMQ6cjs.getItemAttributesKey; exports.getItemAttributesOptions = _chunkI3JHJMQ6cjs.getItemAttributesOptions; exports.getItemCategoryKey = _chunkI3JHJMQ6cjs.getItemCategoryKey; exports.getItemCategoryOptions = _chunkI3JHJMQ6cjs.getItemCategoryOptions; exports.getItemDetailsKey = _chunkI3JHJMQ6cjs.getItemDetailsKey; exports.getItemDetailsOptions = _chunkI3JHJMQ6cjs.getItemDetailsOptions; exports.getItemPriceKey = _chunkI3JHJMQ6cjs.getItemPriceKey; exports.getItemPriceOptions = _chunkI3JHJMQ6cjs.getItemPriceOptions; exports.getItemSearchInfiniteKey = _chunkI3JHJMQ6cjs.getItemSearchInfiniteKey; exports.getItemSearchInfiniteOptions = _chunkI3JHJMQ6cjs.getItemSearchInfiniteOptions; exports.getJoomlaContentKey = _chunkI3JHJMQ6cjs.getJoomlaContentKey; exports.getJoomlaContentListKey = _chunkI3JHJMQ6cjs.getJoomlaContentListKey; exports.getJoomlaContentListOptions = _chunkI3JHJMQ6cjs.getJoomlaContentListOptions; exports.getJoomlaContentOptions = _chunkI3JHJMQ6cjs.getJoomlaContentOptions; exports.getJoomlaMenuDocKey = _chunkI3JHJMQ6cjs.getJoomlaMenuDocKey; exports.getJoomlaMenuDocOptions = _chunkI3JHJMQ6cjs.getJoomlaMenuDocOptions; exports.getJoomlaMenuKey = _chunkI3JHJMQ6cjs.getJoomlaMenuKey; exports.getJoomlaMenuOptions = _chunkI3JHJMQ6cjs.getJoomlaMenuOptions; exports.getProductCategoryKey = _chunkI3JHJMQ6cjs.getProductCategoryKey; exports.getProductCategoryOptions = _chunkI3JHJMQ6cjs.getProductCategoryOptions; exports.getProductSearchKey = _chunkI3JHJMQ6cjs.getProductSearchKey; exports.getProductSearchOptions = _chunkI3JHJMQ6cjs.getProductSearchOptions; exports.getSearchSuggestionsKey = _chunkI3JHJMQ6cjs.getSearchSuggestionsKey; exports.getSearchSuggestionsOptions = _chunkI3JHJMQ6cjs.getSearchSuggestionsOptions; exports.useAugurApi = useAugurApi; exports.useAugurApiOptional = useAugurApiOptional; exports.useAugurAuth = useAugurAuth; exports.useAugurCache = useAugurCache; exports.useAugurPersistence = useAugurPersistence; exports.useCartActions = useCartActions; exports.useCartHdrUid = useCartHdrUid; exports.useCartInitialization = useCartInitialization; exports.useCartLineCount = useCartLineCount; exports.useCartLines = useCartLines; exports.useCartPricing = useCartPricing; exports.useCartQuantityTotal = useCartQuantityTotal; exports.useCartStore = useCartStore; exports.useCategoryItemsInfinite = useCategoryItemsInfinite; exports.useClearCart = useClearCart; exports.useCustomerInvoices = useCustomerInvoices; exports.useCustomerOrders = useCustomerOrders; exports.useCustomerQuotes = useCustomerQuotes; exports.useDebounce = useDebounce; exports.useFormatPrice = useFormatPrice; exports.useInvMast = useInvMast; exports.useInvMastDoc = useInvMastDoc; exports.useInvMastStock = useInvMastStock; exports.useInvoiceDetail = useInvoiceDetail; 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.useJoomlaMenu = useJoomlaMenu; exports.useJoomlaMenuDoc = useJoomlaMenuDoc; exports.useOrderDetail = useOrderDetail; exports.usePaginationPrefetch = usePaginationPrefetch; exports.useProductCategory = useProductCategory; exports.useProductSearch = useProductSearch; exports.useQuoteDetail = useQuoteDetail; exports.useSearchSuggestions = useSearchSuggestions; exports.useSetCartHdrUid = useSetCartHdrUid; exports.useSetCartLines = useSetCartLines;
|
|
1232
1362
|
//# sourceMappingURL=index.cjs.map
|