@01.software/sdk 0.38.0 → 0.40.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/README.md +169 -54
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +1194 -5
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.js +1194 -5
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-BroIWHY1.d.ts → collection-client-CKFa99C6.d.ts} +16 -10
- package/dist/{collection-client-B0J9wMNE.d.cts → collection-client-VYwYi6u6.d.cts} +16 -10
- package/dist/const-4BUtUdGU.d.cts +32 -0
- package/dist/const-ymprfiPf.d.ts +32 -0
- package/dist/errors.cjs +4 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +4 -1
- package/dist/errors.js.map +1 -1
- package/dist/{index-BOLQxveo.d.cts → index-Dquv4xTL.d.cts} +3 -3
- package/dist/{index-CSwR2HSg.d.ts → index-w36lpSkU.d.ts} +3 -3
- package/dist/index.cjs +2796 -2651
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +2796 -2651
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-m3jjhxk9.d.cts → payload-types-DC0xzR9i.d.cts} +470 -265
- package/dist/{payload-types-m3jjhxk9.d.ts → payload-types-DC0xzR9i.d.ts} +470 -265
- package/dist/query.cjs +241 -58
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +151 -26
- package/dist/query.d.ts +151 -26
- package/dist/query.js +241 -58
- package/dist/query.js.map +1 -1
- package/dist/realtime.cjs +5 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +5 -1
- package/dist/realtime.js.map +1 -1
- package/dist/server.cjs +1117 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +1117 -1
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +144 -0
- package/dist/storefront-cache.cjs.map +1 -0
- package/dist/storefront-cache.d.cts +24 -0
- package/dist/storefront-cache.d.ts +24 -0
- package/dist/storefront-cache.js +121 -0
- package/dist/storefront-cache.js.map +1 -0
- package/dist/{types-Cmrd1ezc.d.ts → types-Bh2p-EMc.d.ts} +5 -1
- package/dist/{types-D0ubzQw0.d.cts → types-BvpjooU-.d.cts} +5 -1
- package/dist/{types-D2xYdz4P.d.ts → types-D5uHrPLr.d.cts} +264 -96
- package/dist/{types-CIGscmus.d.cts → types-Umd-YTjM.d.ts} +264 -96
- package/dist/ui/canvas/server.cjs +5 -1
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.js +5 -1
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +5 -1
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.js +5 -1
- package/dist/ui/canvas.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.ts +4 -4
- package/package.json +13 -3
- package/dist/const-6XHz_jej.d.ts +0 -32
- package/dist/const-B5KT72c7.d.cts +0 -32
package/dist/query.js
CHANGED
|
@@ -58,6 +58,49 @@ function getStorefrontQueryClient() {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// src/core/query/query-keys.ts
|
|
61
|
+
function nonEmpty(values) {
|
|
62
|
+
return values?.length ? values : void 0;
|
|
63
|
+
}
|
|
64
|
+
function canonicalProductListingPageParams(params = {}, limit) {
|
|
65
|
+
const filters = params.filters;
|
|
66
|
+
const canonicalFilters = {};
|
|
67
|
+
const ids = nonEmpty(filters?.ids);
|
|
68
|
+
if (ids) canonicalFilters.ids = ids;
|
|
69
|
+
const slugs = nonEmpty(filters?.slugs);
|
|
70
|
+
if (slugs) canonicalFilters.slugs = slugs;
|
|
71
|
+
const handles = nonEmpty(filters?.handles);
|
|
72
|
+
if (handles) canonicalFilters.handles = handles;
|
|
73
|
+
const categoryIds = nonEmpty(filters?.categoryIds);
|
|
74
|
+
if (categoryIds) canonicalFilters.categoryIds = categoryIds;
|
|
75
|
+
const tagIds = nonEmpty(filters?.tagIds);
|
|
76
|
+
if (tagIds) canonicalFilters.tagIds = tagIds;
|
|
77
|
+
if (filters?.price?.min != null || filters?.price?.max != null) {
|
|
78
|
+
canonicalFilters.price = {
|
|
79
|
+
...filters.price.min != null && { min: filters.price.min },
|
|
80
|
+
...filters.price.max != null && { max: filters.price.max }
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (filters?.availableForSale != null) {
|
|
84
|
+
canonicalFilters.availableForSale = filters.availableForSale;
|
|
85
|
+
}
|
|
86
|
+
const search = params.search?.trim();
|
|
87
|
+
return {
|
|
88
|
+
mode: params.mode ?? "catalog",
|
|
89
|
+
...params.page != null && { page: params.page },
|
|
90
|
+
...limit != null ? { limit } : params.limit != null ? { limit: params.limit } : {},
|
|
91
|
+
...search && { search },
|
|
92
|
+
...params.sort != null && { sort: params.sort },
|
|
93
|
+
...Object.keys(canonicalFilters).length > 0 && {
|
|
94
|
+
filters: canonicalFilters
|
|
95
|
+
},
|
|
96
|
+
...params.basePath != null && { basePath: params.basePath },
|
|
97
|
+
...params.trailingSlash != null && { trailingSlash: params.trailingSlash },
|
|
98
|
+
...params.emit != null && { emit: params.emit },
|
|
99
|
+
...params.preferCompleteVariantFromHint != null && {
|
|
100
|
+
preferCompleteVariantFromHint: params.preferCompleteVariantFromHint
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
61
104
|
function collectionKeys(collection) {
|
|
62
105
|
return {
|
|
63
106
|
all: [collection],
|
|
@@ -66,7 +109,11 @@ function collectionKeys(collection) {
|
|
|
66
109
|
details: () => [collection, "detail"],
|
|
67
110
|
detail: (id, options) => [collection, "detail", id, options],
|
|
68
111
|
infinites: () => [collection, "infinite"],
|
|
69
|
-
infinite: (options) => [
|
|
112
|
+
infinite: (options, pageSize) => [
|
|
113
|
+
collection,
|
|
114
|
+
"infinite",
|
|
115
|
+
pageSize === void 0 ? options : { ...options, limit: pageSize }
|
|
116
|
+
]
|
|
70
117
|
};
|
|
71
118
|
}
|
|
72
119
|
var customerKeys = {
|
|
@@ -76,8 +123,29 @@ var customerKeys = {
|
|
|
76
123
|
var productKeys = {
|
|
77
124
|
listingGroups: (options) => ["products", "listing-groups", "list", options],
|
|
78
125
|
listingGroupsCatalog: (options) => ["products", "listing-groups", "catalog", options],
|
|
79
|
-
listingGroupsInfinite: (options) => [
|
|
80
|
-
|
|
126
|
+
listingGroupsInfinite: (options, pageSize) => [
|
|
127
|
+
"products",
|
|
128
|
+
"listing-groups",
|
|
129
|
+
"infinite",
|
|
130
|
+
pageSize === void 0 ? options : { ...options, limit: pageSize }
|
|
131
|
+
],
|
|
132
|
+
listingGroupsCatalogInfinite: (options, pageSize) => [
|
|
133
|
+
"products",
|
|
134
|
+
"listing-groups",
|
|
135
|
+
"catalog",
|
|
136
|
+
"infinite",
|
|
137
|
+
pageSize === void 0 ? options : { ...options, limit: pageSize }
|
|
138
|
+
],
|
|
139
|
+
listingPage: (params) => ["products", "listing-page", canonicalProductListingPageParams(params)],
|
|
140
|
+
listingPageInfinite: (params, pageSize) => [
|
|
141
|
+
"products",
|
|
142
|
+
"listing-page",
|
|
143
|
+
"infinite",
|
|
144
|
+
canonicalProductListingPageParams(
|
|
145
|
+
params,
|
|
146
|
+
pageSize
|
|
147
|
+
)
|
|
148
|
+
],
|
|
81
149
|
detail: (params) => ["products", "detail", params],
|
|
82
150
|
detailAll: () => ["products", "detail"]
|
|
83
151
|
};
|
|
@@ -164,13 +232,14 @@ var CollectionHooks = class {
|
|
|
164
232
|
}
|
|
165
233
|
// ===== useInfiniteQuery =====
|
|
166
234
|
useInfiniteQuery(params, options) {
|
|
167
|
-
const {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
pageSize = DEFAULT_PAGE_SIZE
|
|
171
|
-
} = params;
|
|
235
|
+
const { collection, options: queryOptions } = params;
|
|
236
|
+
const explicitPageSize = params.pageSize;
|
|
237
|
+
const pageSize = explicitPageSize ?? DEFAULT_PAGE_SIZE;
|
|
172
238
|
return useInfiniteQueryOriginal({
|
|
173
|
-
queryKey: collectionKeys(collection).infinite(
|
|
239
|
+
queryKey: collectionKeys(collection).infinite(
|
|
240
|
+
queryOptions,
|
|
241
|
+
explicitPageSize
|
|
242
|
+
),
|
|
174
243
|
queryFn: async ({ pageParam }) => {
|
|
175
244
|
const response = await this.collectionClient.from(collection).find({ ...queryOptions, page: pageParam, limit: pageSize });
|
|
176
245
|
return response;
|
|
@@ -184,13 +253,14 @@ var CollectionHooks = class {
|
|
|
184
253
|
}
|
|
185
254
|
// ===== useSuspenseInfiniteQuery =====
|
|
186
255
|
useSuspenseInfiniteQuery(params, options) {
|
|
187
|
-
const {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
pageSize = DEFAULT_PAGE_SIZE
|
|
191
|
-
} = params;
|
|
256
|
+
const { collection, options: queryOptions } = params;
|
|
257
|
+
const explicitPageSize = params.pageSize;
|
|
258
|
+
const pageSize = explicitPageSize ?? DEFAULT_PAGE_SIZE;
|
|
192
259
|
return useSuspenseInfiniteQueryOriginal({
|
|
193
|
-
queryKey: collectionKeys(collection).infinite(
|
|
260
|
+
queryKey: collectionKeys(collection).infinite(
|
|
261
|
+
queryOptions,
|
|
262
|
+
explicitPageSize
|
|
263
|
+
),
|
|
194
264
|
queryFn: async ({ pageParam }) => {
|
|
195
265
|
const response = await this.collectionClient.from(collection).find({ ...queryOptions, page: pageParam, limit: pageSize });
|
|
196
266
|
return response;
|
|
@@ -226,13 +296,14 @@ var CollectionHooks = class {
|
|
|
226
296
|
}
|
|
227
297
|
// ===== prefetchInfiniteQuery =====
|
|
228
298
|
async prefetchInfiniteQuery(params, options) {
|
|
229
|
-
const {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
pageSize = DEFAULT_PAGE_SIZE
|
|
233
|
-
} = params;
|
|
299
|
+
const { collection, options: queryOptions } = params;
|
|
300
|
+
const explicitPageSize = params.pageSize;
|
|
301
|
+
const pageSize = explicitPageSize ?? DEFAULT_PAGE_SIZE;
|
|
234
302
|
return this.queryClient.prefetchInfiniteQuery({
|
|
235
|
-
queryKey: collectionKeys(collection).infinite(
|
|
303
|
+
queryKey: collectionKeys(collection).infinite(
|
|
304
|
+
queryOptions,
|
|
305
|
+
explicitPageSize
|
|
306
|
+
),
|
|
236
307
|
queryFn: async ({ pageParam }) => {
|
|
237
308
|
const response = await this.collectionClient.from(collection).find({ ...queryOptions, page: pageParam, limit: pageSize });
|
|
238
309
|
return response;
|
|
@@ -541,6 +612,50 @@ function fetchProductListingGroupsCatalogQuery(collectionClient, queryOptions) {
|
|
|
541
612
|
listingGroupsQueryCatalogUrl(queryOptions)
|
|
542
613
|
);
|
|
543
614
|
}
|
|
615
|
+
function productListingPageQueryOptions(commerceClient, params = {}) {
|
|
616
|
+
return {
|
|
617
|
+
queryKey: productKeys.listingPage(params),
|
|
618
|
+
queryFn: () => commerceClient.product.listingPage(params)
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
function productListingPageInfiniteQueryOptions(commerceClient, params = {}) {
|
|
622
|
+
const {
|
|
623
|
+
pageSize: explicitPageSize,
|
|
624
|
+
page: _page,
|
|
625
|
+
limit: _limit,
|
|
626
|
+
...pageParams
|
|
627
|
+
} = params;
|
|
628
|
+
const pageSize = explicitPageSize ?? 20;
|
|
629
|
+
return {
|
|
630
|
+
queryKey: productKeys.listingPageInfinite(pageParams, explicitPageSize),
|
|
631
|
+
queryFn: ({ pageParam }) => commerceClient.product.listingPage({
|
|
632
|
+
...pageParams,
|
|
633
|
+
page: pageParam,
|
|
634
|
+
limit: pageSize
|
|
635
|
+
}),
|
|
636
|
+
initialPageParam: 1,
|
|
637
|
+
getNextPageParam: (lastPage) => lastPage.hasNextPage ? lastPage.nextPage : void 0
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function prefetchProductListingPage(queryClient, commerceClient, params = {}, options) {
|
|
641
|
+
return queryClient.prefetchQuery({
|
|
642
|
+
...productListingPageQueryOptions(
|
|
643
|
+
commerceClient,
|
|
644
|
+
params
|
|
645
|
+
),
|
|
646
|
+
...options
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function prefetchInfiniteProductListingPage(queryClient, commerceClient, params = {}, options) {
|
|
650
|
+
return queryClient.prefetchInfiniteQuery({
|
|
651
|
+
...productListingPageInfiniteQueryOptions(
|
|
652
|
+
commerceClient,
|
|
653
|
+
params
|
|
654
|
+
),
|
|
655
|
+
pages: options?.pages ?? 1,
|
|
656
|
+
staleTime: options?.staleTime
|
|
657
|
+
});
|
|
658
|
+
}
|
|
544
659
|
var QueryHooks = class extends CollectionHooks {
|
|
545
660
|
constructor(queryClient, collectionClient, customerAuth, commerceClient) {
|
|
546
661
|
super(queryClient, collectionClient);
|
|
@@ -561,6 +676,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
561
676
|
this._customer = new CustomerHooks(queryClient, customerAuth);
|
|
562
677
|
this._commerce = commerceClient;
|
|
563
678
|
}
|
|
679
|
+
ensureCommerce() {
|
|
680
|
+
if (!this._commerce) {
|
|
681
|
+
throw createConfigError(
|
|
682
|
+
"Product listing page hooks require Client or ServerClient. Use createQueryHooks(client) or createServerQueryHooks(server) instead of constructing QueryHooks directly."
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
return this._commerce;
|
|
686
|
+
}
|
|
564
687
|
useProductListingGroupsQuery(params, options) {
|
|
565
688
|
const queryOptions = params.options;
|
|
566
689
|
const { placeholderData, ...restOptions } = options ?? {};
|
|
@@ -608,12 +731,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
608
731
|
});
|
|
609
732
|
}
|
|
610
733
|
useInfiniteProductListingGroupsQuery(params, options) {
|
|
611
|
-
const {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
} = params;
|
|
734
|
+
const { options: queryOptions } = params;
|
|
735
|
+
const explicitPageSize = params.pageSize;
|
|
736
|
+
const pageSize = explicitPageSize ?? 20;
|
|
615
737
|
return useInfiniteQueryOriginal2({
|
|
616
|
-
queryKey: productKeys.listingGroupsInfinite(
|
|
738
|
+
queryKey: productKeys.listingGroupsInfinite(
|
|
739
|
+
queryOptions,
|
|
740
|
+
explicitPageSize
|
|
741
|
+
),
|
|
617
742
|
queryFn: async ({ pageParam }) => fetchProductListingGroupsQuery(this.collectionClient, {
|
|
618
743
|
...queryOptions,
|
|
619
744
|
page: pageParam,
|
|
@@ -625,12 +750,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
625
750
|
});
|
|
626
751
|
}
|
|
627
752
|
useInfiniteProductListingGroupsCatalogQuery(params, options) {
|
|
628
|
-
const {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
} = params;
|
|
753
|
+
const { options: queryOptions } = params;
|
|
754
|
+
const explicitPageSize = params.pageSize;
|
|
755
|
+
const pageSize = explicitPageSize ?? 20;
|
|
632
756
|
return useInfiniteQueryOriginal2({
|
|
633
|
-
queryKey: productKeys.listingGroupsCatalogInfinite(
|
|
757
|
+
queryKey: productKeys.listingGroupsCatalogInfinite(
|
|
758
|
+
queryOptions,
|
|
759
|
+
explicitPageSize
|
|
760
|
+
),
|
|
634
761
|
queryFn: async ({ pageParam }) => fetchProductListingGroupsCatalogQuery(this.collectionClient, {
|
|
635
762
|
...queryOptions,
|
|
636
763
|
page: pageParam,
|
|
@@ -642,12 +769,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
642
769
|
});
|
|
643
770
|
}
|
|
644
771
|
useSuspenseInfiniteProductListingGroupsQuery(params, options) {
|
|
645
|
-
const {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
} = params;
|
|
772
|
+
const { options: queryOptions } = params;
|
|
773
|
+
const explicitPageSize = params.pageSize;
|
|
774
|
+
const pageSize = explicitPageSize ?? 20;
|
|
649
775
|
return useSuspenseInfiniteQueryOriginal2({
|
|
650
|
-
queryKey: productKeys.listingGroupsInfinite(
|
|
776
|
+
queryKey: productKeys.listingGroupsInfinite(
|
|
777
|
+
queryOptions,
|
|
778
|
+
explicitPageSize
|
|
779
|
+
),
|
|
651
780
|
queryFn: async ({ pageParam }) => fetchProductListingGroupsQuery(this.collectionClient, {
|
|
652
781
|
...queryOptions,
|
|
653
782
|
page: pageParam,
|
|
@@ -659,12 +788,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
659
788
|
});
|
|
660
789
|
}
|
|
661
790
|
useSuspenseInfiniteProductListingGroupsCatalogQuery(params, options) {
|
|
662
|
-
const {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
} = params;
|
|
791
|
+
const { options: queryOptions } = params;
|
|
792
|
+
const explicitPageSize = params.pageSize;
|
|
793
|
+
const pageSize = explicitPageSize ?? 20;
|
|
666
794
|
return useSuspenseInfiniteQueryOriginal2({
|
|
667
|
-
queryKey: productKeys.listingGroupsCatalogInfinite(
|
|
795
|
+
queryKey: productKeys.listingGroupsCatalogInfinite(
|
|
796
|
+
queryOptions,
|
|
797
|
+
explicitPageSize
|
|
798
|
+
),
|
|
668
799
|
queryFn: async ({ pageParam }) => fetchProductListingGroupsCatalogQuery(this.collectionClient, {
|
|
669
800
|
...queryOptions,
|
|
670
801
|
page: pageParam,
|
|
@@ -695,12 +826,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
695
826
|
});
|
|
696
827
|
}
|
|
697
828
|
async prefetchInfiniteProductListingGroupsQuery(params, options) {
|
|
698
|
-
const {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
} = params;
|
|
829
|
+
const { options: queryOptions } = params;
|
|
830
|
+
const explicitPageSize = params.pageSize;
|
|
831
|
+
const pageSize = explicitPageSize ?? 20;
|
|
702
832
|
return this.queryClient.prefetchInfiniteQuery({
|
|
703
|
-
queryKey: productKeys.listingGroupsInfinite(
|
|
833
|
+
queryKey: productKeys.listingGroupsInfinite(
|
|
834
|
+
queryOptions,
|
|
835
|
+
explicitPageSize
|
|
836
|
+
),
|
|
704
837
|
queryFn: async ({ pageParam }) => fetchProductListingGroupsQuery(this.collectionClient, {
|
|
705
838
|
...queryOptions,
|
|
706
839
|
page: pageParam,
|
|
@@ -713,12 +846,14 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
713
846
|
});
|
|
714
847
|
}
|
|
715
848
|
async prefetchInfiniteProductListingGroupsCatalogQuery(params, options) {
|
|
716
|
-
const {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
} = params;
|
|
849
|
+
const { options: queryOptions } = params;
|
|
850
|
+
const explicitPageSize = params.pageSize;
|
|
851
|
+
const pageSize = explicitPageSize ?? 20;
|
|
720
852
|
return this.queryClient.prefetchInfiniteQuery({
|
|
721
|
-
queryKey: productKeys.listingGroupsCatalogInfinite(
|
|
853
|
+
queryKey: productKeys.listingGroupsCatalogInfinite(
|
|
854
|
+
queryOptions,
|
|
855
|
+
explicitPageSize
|
|
856
|
+
),
|
|
722
857
|
queryFn: async ({ pageParam }) => fetchProductListingGroupsCatalogQuery(this.collectionClient, {
|
|
723
858
|
...queryOptions,
|
|
724
859
|
page: pageParam,
|
|
@@ -730,6 +865,45 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
730
865
|
staleTime: options?.staleTime
|
|
731
866
|
});
|
|
732
867
|
}
|
|
868
|
+
useProductListingPage(params = {}, options) {
|
|
869
|
+
const { placeholderData, ...restOptions } = options ?? {};
|
|
870
|
+
return useQueryOriginal3({
|
|
871
|
+
...productListingPageQueryOptions(this.ensureCommerce(), params),
|
|
872
|
+
...restOptions,
|
|
873
|
+
...placeholderData !== void 0 && {
|
|
874
|
+
placeholderData
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
useSuspenseProductListingPage(params = {}, options) {
|
|
879
|
+
const suspenseOptions = options;
|
|
880
|
+
return useSuspenseQueryOriginal2({
|
|
881
|
+
...productListingPageQueryOptions(this.ensureCommerce(), params),
|
|
882
|
+
...suspenseOptions
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
useInfiniteProductListingPage(params = {}, options) {
|
|
886
|
+
return useInfiniteQueryOriginal2({
|
|
887
|
+
...productListingPageInfiniteQueryOptions(this.ensureCommerce(), params),
|
|
888
|
+
...options
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
async prefetchProductListingPage(params = {}, options) {
|
|
892
|
+
return prefetchProductListingPage(
|
|
893
|
+
this.queryClient,
|
|
894
|
+
this.ensureCommerce(),
|
|
895
|
+
params,
|
|
896
|
+
options
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
async prefetchInfiniteProductListingPage(params = {}, options) {
|
|
900
|
+
return prefetchInfiniteProductListingPage(
|
|
901
|
+
this.queryClient,
|
|
902
|
+
this.ensureCommerce(),
|
|
903
|
+
params,
|
|
904
|
+
options
|
|
905
|
+
);
|
|
906
|
+
}
|
|
733
907
|
useProductDetail(params, options) {
|
|
734
908
|
const discriminator = "slug" in params ? params.slug : params.id;
|
|
735
909
|
const { enabled, ...restOptions } = options ?? {};
|
|
@@ -921,12 +1095,17 @@ function createReadOnlyQueryHooksFacade(hooks) {
|
|
|
921
1095
|
invalidateCustomerQueries: hooks.invalidateCustomerQueries.bind(hooks),
|
|
922
1096
|
getCustomerData: hooks.getCustomerData.bind(hooks),
|
|
923
1097
|
setCustomerData: hooks.setCustomerData.bind(hooks),
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1098
|
+
useProductListingGroupsCatalogQuery: hooks.useProductListingGroupsCatalogQuery.bind(hooks),
|
|
1099
|
+
useSuspenseProductListingGroupsCatalogQuery: hooks.useSuspenseProductListingGroupsCatalogQuery.bind(hooks),
|
|
1100
|
+
useInfiniteProductListingGroupsCatalogQuery: hooks.useInfiniteProductListingGroupsCatalogQuery.bind(hooks),
|
|
1101
|
+
useSuspenseInfiniteProductListingGroupsCatalogQuery: hooks.useSuspenseInfiniteProductListingGroupsCatalogQuery.bind(hooks),
|
|
1102
|
+
prefetchProductListingGroupsCatalogQuery: hooks.prefetchProductListingGroupsCatalogQuery.bind(hooks),
|
|
1103
|
+
prefetchInfiniteProductListingGroupsCatalogQuery: hooks.prefetchInfiniteProductListingGroupsCatalogQuery.bind(hooks),
|
|
1104
|
+
useProductListingPage: hooks.useProductListingPage.bind(hooks),
|
|
1105
|
+
useSuspenseProductListingPage: hooks.useSuspenseProductListingPage.bind(hooks),
|
|
1106
|
+
useInfiniteProductListingPage: hooks.useInfiniteProductListingPage.bind(hooks),
|
|
1107
|
+
prefetchProductListingPage: hooks.prefetchProductListingPage.bind(hooks),
|
|
1108
|
+
prefetchInfiniteProductListingPage: hooks.prefetchInfiniteProductListingPage.bind(hooks),
|
|
930
1109
|
useProductDetail: hooks.useProductDetail.bind(hooks),
|
|
931
1110
|
useProductDetailBySlug: hooks.useProductDetailBySlug.bind(hooks),
|
|
932
1111
|
useProductDetailById: hooks.useProductDetailById.bind(hooks)
|
|
@@ -960,6 +1139,10 @@ export {
|
|
|
960
1139
|
customerKeys,
|
|
961
1140
|
getQueryClient,
|
|
962
1141
|
getStorefrontQueryClient,
|
|
963
|
-
|
|
1142
|
+
prefetchInfiniteProductListingPage,
|
|
1143
|
+
prefetchProductListingPage,
|
|
1144
|
+
productKeys,
|
|
1145
|
+
productListingPageInfiniteQueryOptions,
|
|
1146
|
+
productListingPageQueryOptions
|
|
964
1147
|
};
|
|
965
1148
|
//# sourceMappingURL=query.js.map
|