@01.software/sdk 0.44.0 → 0.46.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/CHANGELOG.md +366 -2
- package/MIGRATION.md +108 -10
- package/README.md +486 -98
- package/dist/{server-nXOezi4b.d.cts → catalog-mappers-sIshKNb3.d.cts} +14 -3
- package/dist/{server-nXOezi4b.d.ts → catalog-mappers-sIshKNb3.d.ts} +14 -3
- package/dist/client.cjs +2693 -345
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +10 -7
- package/dist/client.d.ts +10 -7
- package/dist/client.js +2693 -345
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-DWooaiTr.d.ts → collection-client-D6kKrYdq.d.ts} +8 -5
- package/dist/{collection-client-Dyl-CDcj.d.cts → collection-client-DolMjCoC.d.cts} +8 -5
- package/dist/{const-pGDnsy0o.d.ts → const-BAG0MH0u.d.cts} +13 -10
- package/dist/{const-1vleZ6ov.d.cts → const-CaPq2AE4.d.ts} +13 -10
- package/dist/errors.cjs +74 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +38 -1
- package/dist/errors.d.ts +38 -1
- package/dist/errors.js +74 -1
- package/dist/errors.js.map +1 -1
- package/dist/{index-DUNySyxV.d.ts → index-BNICJxBL.d.ts} +4 -4
- package/dist/{index-a6g7vqAD.d.cts → index-YGrZrxNn.d.cts} +4 -4
- package/dist/index.cjs +2754 -368
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -19
- package/dist/index.d.ts +18 -19
- package/dist/index.js +2754 -368
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-CDsuOEfM.d.cts → payload-types-CJZuXcgF.d.cts} +6671 -4001
- package/dist/{payload-types-CDsuOEfM.d.ts → payload-types-CJZuXcgF.d.ts} +6671 -4001
- package/dist/query.cjs +558 -101
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +43 -45
- package/dist/query.d.ts +43 -45
- package/dist/query.js +558 -101
- package/dist/query.js.map +1 -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.map +1 -1
- package/dist/server.cjs +2343 -437
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +11 -10
- package/dist/server.d.ts +11 -10
- package/dist/server.js +2343 -437
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +65 -1
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +65 -1
- package/dist/storefront-cache.js.map +1 -1
- package/dist/types-BC6rVmJa.d.ts +47 -0
- package/dist/{types-CDND3hzq.d.cts → types-C60vHIkY.d.ts} +1134 -509
- package/dist/types-D5p7-m1l.d.cts +47 -0
- package/dist/{types-Dt9FJisi.d.ts → types-xlqBeW2N.d.cts} +1134 -509
- package/dist/ui/canvas/server.cjs +244 -2
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.d.cts +27 -1
- package/dist/ui/canvas/server.d.ts +27 -1
- package/dist/ui/canvas/server.js +244 -2
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +419 -103
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +19 -7
- package/dist/ui/canvas.d.ts +19 -7
- package/dist/ui/canvas.js +419 -103
- 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.cjs +2 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.ts +4 -4
- package/dist/webhook.js +2 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +10 -9
- package/dist/types-SoXsbKhj.d.cts +0 -33
- package/dist/types-oiae_LMm.d.ts +0 -33
package/dist/query.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, UseQueryResult, UseSuspenseQueryResult, InfiniteData, UseInfiniteQueryResult, UseSuspenseInfiniteQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
4
|
-
import './payload-types-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { C as CollectionType } from './types-
|
|
3
|
+
import { i as ApiQueryOptions, P as PayloadFindResponse, bO as PublicReadQueryOptions, K as PayloadMutationResponse, bP as CustomerAuth, bQ as CustomerProfile, bR as CustomerAuthResponse, bS as CustomerLoginData, bT as CustomerRegisterResponse, bU as CustomerRegisterData, bV as CustomerRefreshResponse, bW as UpdateProfileData, bX as ProductListingPageParams, bY as ProductListingPageBaseParams, bZ as ProductDetailParams, b_ as ProductDetailCatalogResult, b$ as ProductListingPageCatalogParams, c0 as ProductListingPageResult, c1 as ProductListingGroupsCatalogItem, c2 as ProductListingPageFullParams, c3 as ProductListingGroupsItem, ah as RootClient, bv as RootServerClient } from './types-xlqBeW2N.cjs';
|
|
4
|
+
import './payload-types-CJZuXcgF.cjs';
|
|
5
|
+
import { S as ServerCollection, P as PublicCollection } from './const-BAG0MH0u.cjs';
|
|
6
|
+
import { C as CollectionClient } from './collection-client-DolMjCoC.cjs';
|
|
7
|
+
import { C as CollectionType } from './types-D5p7-m1l.cjs';
|
|
8
8
|
import { SDKError } from './errors.cjs';
|
|
9
9
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
10
10
|
import './metadata.cjs';
|
|
@@ -150,7 +150,16 @@ declare class CustomerHooks {
|
|
|
150
150
|
setCustomerData(data: CustomerProfile | null): void;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
type ProductListingGroupsQueryOptions = Pick<ApiQueryOptions, 'page' | 'limit' | 'sort' | 'where'
|
|
153
|
+
type ProductListingGroupsQueryOptions = Pick<ApiQueryOptions, 'page' | 'limit' | 'sort' | 'where'> & {
|
|
154
|
+
market?: string;
|
|
155
|
+
locale?: ProductListingPageParams['locale'];
|
|
156
|
+
fallbackLocale?: ProductListingPageParams['fallbackLocale'];
|
|
157
|
+
};
|
|
158
|
+
type ProductDetailConvenienceOptions = QueryOptions<ProductDetailCatalogResult> & {
|
|
159
|
+
market?: string;
|
|
160
|
+
locale?: ProductDetailParams['locale'];
|
|
161
|
+
fallbackLocale?: ProductDetailParams['fallbackLocale'];
|
|
162
|
+
};
|
|
154
163
|
type ReadOnlyQueryHooks = Omit<QueryHooks<PublicCollection>, 'useCreate' | 'useUpdate' | 'useRemove' | 'useProductListingGroupsQuery' | 'useSuspenseProductListingGroupsQuery' | 'useInfiniteProductListingGroupsQuery' | 'useSuspenseInfiniteProductListingGroupsQuery' | 'prefetchProductListingGroupsQuery' | 'prefetchInfiniteProductListingGroupsQuery' | 'useProductListingPage' | 'useSuspenseProductListingPage' | 'useInfiniteProductListingPage' | 'prefetchProductListingPage' | 'prefetchInfiniteProductListingPage'> & {
|
|
155
164
|
useProductListingPage<TData = ProductListingPageResult<ProductListingGroupsCatalogItem>>(params?: ProductListingPageCatalogParams, options?: QueryOptions<ProductListingPageResult<ProductListingGroupsCatalogItem>, TData>): UseQueryResult<TData>;
|
|
156
165
|
useSuspenseProductListingPage<TData = ProductListingPageResult<ProductListingGroupsCatalogItem>>(params?: ProductListingPageCatalogParams, options?: SuspenseQueryOptions<ProductListingPageResult<ProductListingGroupsCatalogItem>, TData>): UseSuspenseQueryResult<TData>;
|
|
@@ -169,7 +178,7 @@ type ReadOnlyQueryHooks = Omit<QueryHooks<PublicCollection>, 'useCreate' | 'useU
|
|
|
169
178
|
*/
|
|
170
179
|
interface ProductDetailCallable {
|
|
171
180
|
product: {
|
|
172
|
-
detail: (params: ProductDetailParams) => Promise<
|
|
181
|
+
detail: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
173
182
|
};
|
|
174
183
|
}
|
|
175
184
|
interface ProductListingPageCatalogCallable {
|
|
@@ -195,19 +204,22 @@ type ProductListingPageInfiniteParams = Omit<ProductListingPageBaseParams, 'page
|
|
|
195
204
|
type ProductListingPageCatalogInfiniteParams = Omit<ProductListingPageInfiniteParams, 'mode'> & {
|
|
196
205
|
mode?: 'catalog';
|
|
197
206
|
};
|
|
198
|
-
|
|
207
|
+
type ProductMarketContext = {
|
|
208
|
+
market?: string;
|
|
209
|
+
};
|
|
210
|
+
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogParams, context?: ProductMarketContext): {
|
|
199
211
|
queryKey: ReturnType<typeof productKeys.listingPage>;
|
|
200
212
|
queryFn: () => Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
|
|
201
213
|
};
|
|
202
|
-
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageFullParams): {
|
|
214
|
+
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageFullParams, context?: ProductMarketContext): {
|
|
203
215
|
queryKey: ReturnType<typeof productKeys.listingPage>;
|
|
204
216
|
queryFn: () => Promise<ProductListingPageResult<ProductListingGroupsItem>>;
|
|
205
217
|
};
|
|
206
|
-
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageParams): {
|
|
218
|
+
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageParams, context?: ProductMarketContext): {
|
|
207
219
|
queryKey: ReturnType<typeof productKeys.listingPage>;
|
|
208
220
|
queryFn: () => Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
|
|
209
221
|
};
|
|
210
|
-
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogInfiniteParams): {
|
|
222
|
+
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogInfiniteParams, context?: ProductMarketContext): {
|
|
211
223
|
queryKey: ReturnType<typeof productKeys.listingPageInfinite>;
|
|
212
224
|
queryFn: (args: {
|
|
213
225
|
pageParam: number;
|
|
@@ -215,7 +227,7 @@ declare function productListingPageInfiniteQueryOptions(commerceClient: ProductL
|
|
|
215
227
|
initialPageParam: number;
|
|
216
228
|
getNextPageParam: (lastPage: ProductListingPageResult<ProductListingGroupsCatalogItem>) => number | null | undefined;
|
|
217
229
|
};
|
|
218
|
-
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCallable, params?: ProductListingPageInfiniteParams): {
|
|
230
|
+
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCallable, params?: ProductListingPageInfiniteParams, context?: ProductMarketContext): {
|
|
219
231
|
queryKey: ReturnType<typeof productKeys.listingPageInfinite>;
|
|
220
232
|
queryFn: (args: {
|
|
221
233
|
pageParam: number;
|
|
@@ -225,26 +237,28 @@ declare function productListingPageInfiniteQueryOptions(commerceClient: ProductL
|
|
|
225
237
|
};
|
|
226
238
|
declare function prefetchProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogParams, options?: {
|
|
227
239
|
staleTime?: number;
|
|
228
|
-
}): Promise<void>;
|
|
240
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
229
241
|
declare function prefetchProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCallable, params: ProductListingPageFullParams, options?: {
|
|
230
242
|
staleTime?: number;
|
|
231
|
-
}): Promise<void>;
|
|
243
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
232
244
|
declare function prefetchProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCallable, params: ProductListingPageParams, options?: {
|
|
233
245
|
staleTime?: number;
|
|
234
|
-
}): Promise<void>;
|
|
246
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
235
247
|
declare function prefetchInfiniteProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogInfiniteParams, options?: {
|
|
236
248
|
pages?: number;
|
|
237
249
|
staleTime?: number;
|
|
238
|
-
}): Promise<void>;
|
|
250
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
239
251
|
declare function prefetchInfiniteProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCallable, params?: ProductListingPageInfiniteParams, options?: {
|
|
240
252
|
pages?: number;
|
|
241
253
|
staleTime?: number;
|
|
242
|
-
}): Promise<void>;
|
|
254
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
243
255
|
declare class QueryHooks<TCollection extends ServerCollection = PublicCollection> extends CollectionHooks<TCollection> {
|
|
244
256
|
private _customer;
|
|
245
257
|
private _commerce?;
|
|
246
|
-
|
|
258
|
+
private readonly market?;
|
|
259
|
+
constructor(queryClient: QueryClient, collectionClient: CollectionClient<TCollection>, customerAuth?: CustomerAuth, commerceClient?: ProductCommerceCallable, market?: string);
|
|
247
260
|
private ensureCommerce;
|
|
261
|
+
private withProductMarket;
|
|
248
262
|
useCustomerMe: CustomerHooks['useCustomerMe'];
|
|
249
263
|
useCustomerLogin: CustomerHooks['useCustomerLogin'];
|
|
250
264
|
useCustomerRegister: CustomerHooks['useCustomerRegister'];
|
|
@@ -329,17 +343,16 @@ declare class QueryHooks<TCollection extends ServerCollection = PublicCollection
|
|
|
329
343
|
pages?: number;
|
|
330
344
|
staleTime?: number;
|
|
331
345
|
}): Promise<void>;
|
|
332
|
-
useProductDetail(params:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
id: string;
|
|
336
|
-
}, options?: QueryOptions<ProductDetailResult>): UseQueryResult<ProductDetailResult>;
|
|
337
|
-
useProductDetailBySlug(slug: string, options?: QueryOptions<ProductDetailResult>): UseQueryResult<ProductDetailResult>;
|
|
338
|
-
useProductDetailById(id: string, options?: QueryOptions<ProductDetailResult>): UseQueryResult<ProductDetailResult>;
|
|
346
|
+
useProductDetail(params: ProductDetailParams, options?: QueryOptions<ProductDetailCatalogResult>): UseQueryResult<ProductDetailCatalogResult>;
|
|
347
|
+
useProductDetailBySlug(slug: string, options?: ProductDetailConvenienceOptions): UseQueryResult<ProductDetailCatalogResult>;
|
|
348
|
+
useProductDetailById(id: string, options?: ProductDetailConvenienceOptions): UseQueryResult<ProductDetailCatalogResult>;
|
|
339
349
|
}
|
|
340
350
|
|
|
341
351
|
type ProductListingPageKeyParams = {
|
|
342
352
|
mode: 'catalog' | 'full';
|
|
353
|
+
market?: string;
|
|
354
|
+
locale?: ProductListingPageParams['locale'];
|
|
355
|
+
fallbackLocale?: ProductListingPageParams['fallbackLocale'];
|
|
343
356
|
page?: number;
|
|
344
357
|
limit?: number;
|
|
345
358
|
search?: string;
|
|
@@ -350,6 +363,7 @@ type ProductListingPageKeyParams = {
|
|
|
350
363
|
emit?: ProductListingPageParams['emit'];
|
|
351
364
|
preferCompleteVariantFromHint?: ProductListingPageParams['preferCompleteVariantFromHint'];
|
|
352
365
|
};
|
|
366
|
+
declare function canonicalProductListingGroupsQueryOptions(options?: ProductListingGroupsQueryOptions, limit?: number): ProductListingGroupsQueryOptions | undefined;
|
|
353
367
|
declare function collectionKeys<T extends ServerCollection>(collection: T): {
|
|
354
368
|
all: readonly [T];
|
|
355
369
|
lists: () => readonly [T, "list"];
|
|
@@ -366,31 +380,15 @@ declare const customerKeys: {
|
|
|
366
380
|
declare const productKeys: {
|
|
367
381
|
listingGroups: (options?: ProductListingGroupsQueryOptions) => readonly ["products", "listing-groups", "list", ProductListingGroupsQueryOptions | undefined];
|
|
368
382
|
listingGroupsCatalog: (options?: ProductListingGroupsQueryOptions) => readonly ["products", "listing-groups", "catalog", ProductListingGroupsQueryOptions | undefined];
|
|
369
|
-
listingGroupsInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "infinite",
|
|
370
|
-
|
|
371
|
-
sort?: Sort;
|
|
372
|
-
where?: Where;
|
|
373
|
-
} | undefined];
|
|
374
|
-
listingGroupsCatalogInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "catalog", "infinite", Omit<ProductListingGroupsQueryOptions, "page" | "limit"> | {
|
|
375
|
-
limit: number;
|
|
376
|
-
sort?: Sort;
|
|
377
|
-
where?: Where;
|
|
378
|
-
} | undefined];
|
|
383
|
+
listingGroupsInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "infinite", ProductListingGroupsQueryOptions | undefined];
|
|
384
|
+
listingGroupsCatalogInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "catalog", "infinite", ProductListingGroupsQueryOptions | undefined];
|
|
379
385
|
listingPage: (params?: ProductListingPageParams) => readonly ["products", "listing-page", ProductListingPageKeyParams];
|
|
380
386
|
listingPageInfinite: (params?: Omit<ProductListingPageParams, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-page", "infinite", ProductListingPageKeyParams];
|
|
381
|
-
detail: (params:
|
|
382
|
-
slug: string;
|
|
383
|
-
} | {
|
|
384
|
-
id: string;
|
|
385
|
-
}) => readonly ["products", "detail", {
|
|
386
|
-
slug: string;
|
|
387
|
-
} | {
|
|
388
|
-
id: string;
|
|
389
|
-
}];
|
|
387
|
+
detail: (params: ProductDetailParams) => readonly ["products", "detail", ProductDetailParams];
|
|
390
388
|
detailAll: () => readonly ["products", "detail"];
|
|
391
389
|
};
|
|
392
390
|
|
|
393
391
|
declare function createQueryHooks(client: RootClient, queryClient?: QueryClient): ReadOnlyQueryHooks;
|
|
394
392
|
declare function createServerQueryHooks(client: RootServerClient, queryClient?: QueryClient): QueryHooks<ServerCollection>;
|
|
395
393
|
|
|
396
|
-
export { type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, type CollectionQueryParams, CustomerHooks, type InfiniteQueryOptions, type ProductListingGroupsQueryOptions, type ProductListingPageCatalogInfiniteParams, type ProductListingPageInfiniteParams, QueryHooks, type QueryOptions, type ReadOnlyQueryHooks, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, collectionKeys, createQueryHooks, createServerQueryHooks, customerKeys, getQueryClient, getStorefrontQueryClient, prefetchInfiniteProductListingPage, prefetchProductListingPage, productKeys, productListingPageInfiniteQueryOptions, productListingPageQueryOptions };
|
|
394
|
+
export { type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, type CollectionQueryParams, CustomerHooks, type InfiniteQueryOptions, type ProductListingGroupsQueryOptions, type ProductListingPageCatalogInfiniteParams, type ProductListingPageInfiniteParams, QueryHooks, type QueryOptions, type ReadOnlyQueryHooks, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, canonicalProductListingGroupsQueryOptions, collectionKeys, createQueryHooks, createServerQueryHooks, customerKeys, getQueryClient, getStorefrontQueryClient, prefetchInfiniteProductListingPage, prefetchProductListingPage, productKeys, productListingPageInfiniteQueryOptions, productListingPageQueryOptions };
|
package/dist/query.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, UseQueryResult, UseSuspenseQueryResult, InfiniteData, UseInfiniteQueryResult, UseSuspenseInfiniteQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
4
|
-
import './payload-types-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { C as CollectionType } from './types-
|
|
3
|
+
import { i as ApiQueryOptions, P as PayloadFindResponse, bO as PublicReadQueryOptions, K as PayloadMutationResponse, bP as CustomerAuth, bQ as CustomerProfile, bR as CustomerAuthResponse, bS as CustomerLoginData, bT as CustomerRegisterResponse, bU as CustomerRegisterData, bV as CustomerRefreshResponse, bW as UpdateProfileData, bX as ProductListingPageParams, bY as ProductListingPageBaseParams, bZ as ProductDetailParams, b_ as ProductDetailCatalogResult, b$ as ProductListingPageCatalogParams, c0 as ProductListingPageResult, c1 as ProductListingGroupsCatalogItem, c2 as ProductListingPageFullParams, c3 as ProductListingGroupsItem, ah as RootClient, bv as RootServerClient } from './types-C60vHIkY.js';
|
|
4
|
+
import './payload-types-CJZuXcgF.js';
|
|
5
|
+
import { S as ServerCollection, P as PublicCollection } from './const-CaPq2AE4.js';
|
|
6
|
+
import { C as CollectionClient } from './collection-client-D6kKrYdq.js';
|
|
7
|
+
import { C as CollectionType } from './types-BC6rVmJa.js';
|
|
8
8
|
import { SDKError } from './errors.js';
|
|
9
9
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
10
10
|
import './metadata.js';
|
|
@@ -150,7 +150,16 @@ declare class CustomerHooks {
|
|
|
150
150
|
setCustomerData(data: CustomerProfile | null): void;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
type ProductListingGroupsQueryOptions = Pick<ApiQueryOptions, 'page' | 'limit' | 'sort' | 'where'
|
|
153
|
+
type ProductListingGroupsQueryOptions = Pick<ApiQueryOptions, 'page' | 'limit' | 'sort' | 'where'> & {
|
|
154
|
+
market?: string;
|
|
155
|
+
locale?: ProductListingPageParams['locale'];
|
|
156
|
+
fallbackLocale?: ProductListingPageParams['fallbackLocale'];
|
|
157
|
+
};
|
|
158
|
+
type ProductDetailConvenienceOptions = QueryOptions<ProductDetailCatalogResult> & {
|
|
159
|
+
market?: string;
|
|
160
|
+
locale?: ProductDetailParams['locale'];
|
|
161
|
+
fallbackLocale?: ProductDetailParams['fallbackLocale'];
|
|
162
|
+
};
|
|
154
163
|
type ReadOnlyQueryHooks = Omit<QueryHooks<PublicCollection>, 'useCreate' | 'useUpdate' | 'useRemove' | 'useProductListingGroupsQuery' | 'useSuspenseProductListingGroupsQuery' | 'useInfiniteProductListingGroupsQuery' | 'useSuspenseInfiniteProductListingGroupsQuery' | 'prefetchProductListingGroupsQuery' | 'prefetchInfiniteProductListingGroupsQuery' | 'useProductListingPage' | 'useSuspenseProductListingPage' | 'useInfiniteProductListingPage' | 'prefetchProductListingPage' | 'prefetchInfiniteProductListingPage'> & {
|
|
155
164
|
useProductListingPage<TData = ProductListingPageResult<ProductListingGroupsCatalogItem>>(params?: ProductListingPageCatalogParams, options?: QueryOptions<ProductListingPageResult<ProductListingGroupsCatalogItem>, TData>): UseQueryResult<TData>;
|
|
156
165
|
useSuspenseProductListingPage<TData = ProductListingPageResult<ProductListingGroupsCatalogItem>>(params?: ProductListingPageCatalogParams, options?: SuspenseQueryOptions<ProductListingPageResult<ProductListingGroupsCatalogItem>, TData>): UseSuspenseQueryResult<TData>;
|
|
@@ -169,7 +178,7 @@ type ReadOnlyQueryHooks = Omit<QueryHooks<PublicCollection>, 'useCreate' | 'useU
|
|
|
169
178
|
*/
|
|
170
179
|
interface ProductDetailCallable {
|
|
171
180
|
product: {
|
|
172
|
-
detail: (params: ProductDetailParams) => Promise<
|
|
181
|
+
detail: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
173
182
|
};
|
|
174
183
|
}
|
|
175
184
|
interface ProductListingPageCatalogCallable {
|
|
@@ -195,19 +204,22 @@ type ProductListingPageInfiniteParams = Omit<ProductListingPageBaseParams, 'page
|
|
|
195
204
|
type ProductListingPageCatalogInfiniteParams = Omit<ProductListingPageInfiniteParams, 'mode'> & {
|
|
196
205
|
mode?: 'catalog';
|
|
197
206
|
};
|
|
198
|
-
|
|
207
|
+
type ProductMarketContext = {
|
|
208
|
+
market?: string;
|
|
209
|
+
};
|
|
210
|
+
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogParams, context?: ProductMarketContext): {
|
|
199
211
|
queryKey: ReturnType<typeof productKeys.listingPage>;
|
|
200
212
|
queryFn: () => Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
|
|
201
213
|
};
|
|
202
|
-
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageFullParams): {
|
|
214
|
+
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageFullParams, context?: ProductMarketContext): {
|
|
203
215
|
queryKey: ReturnType<typeof productKeys.listingPage>;
|
|
204
216
|
queryFn: () => Promise<ProductListingPageResult<ProductListingGroupsItem>>;
|
|
205
217
|
};
|
|
206
|
-
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageParams): {
|
|
218
|
+
declare function productListingPageQueryOptions(commerceClient: ProductListingPageCallable, params: ProductListingPageParams, context?: ProductMarketContext): {
|
|
207
219
|
queryKey: ReturnType<typeof productKeys.listingPage>;
|
|
208
220
|
queryFn: () => Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
|
|
209
221
|
};
|
|
210
|
-
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogInfiniteParams): {
|
|
222
|
+
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogInfiniteParams, context?: ProductMarketContext): {
|
|
211
223
|
queryKey: ReturnType<typeof productKeys.listingPageInfinite>;
|
|
212
224
|
queryFn: (args: {
|
|
213
225
|
pageParam: number;
|
|
@@ -215,7 +227,7 @@ declare function productListingPageInfiniteQueryOptions(commerceClient: ProductL
|
|
|
215
227
|
initialPageParam: number;
|
|
216
228
|
getNextPageParam: (lastPage: ProductListingPageResult<ProductListingGroupsCatalogItem>) => number | null | undefined;
|
|
217
229
|
};
|
|
218
|
-
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCallable, params?: ProductListingPageInfiniteParams): {
|
|
230
|
+
declare function productListingPageInfiniteQueryOptions(commerceClient: ProductListingPageCallable, params?: ProductListingPageInfiniteParams, context?: ProductMarketContext): {
|
|
219
231
|
queryKey: ReturnType<typeof productKeys.listingPageInfinite>;
|
|
220
232
|
queryFn: (args: {
|
|
221
233
|
pageParam: number;
|
|
@@ -225,26 +237,28 @@ declare function productListingPageInfiniteQueryOptions(commerceClient: ProductL
|
|
|
225
237
|
};
|
|
226
238
|
declare function prefetchProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogParams, options?: {
|
|
227
239
|
staleTime?: number;
|
|
228
|
-
}): Promise<void>;
|
|
240
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
229
241
|
declare function prefetchProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCallable, params: ProductListingPageFullParams, options?: {
|
|
230
242
|
staleTime?: number;
|
|
231
|
-
}): Promise<void>;
|
|
243
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
232
244
|
declare function prefetchProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCallable, params: ProductListingPageParams, options?: {
|
|
233
245
|
staleTime?: number;
|
|
234
|
-
}): Promise<void>;
|
|
246
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
235
247
|
declare function prefetchInfiniteProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogInfiniteParams, options?: {
|
|
236
248
|
pages?: number;
|
|
237
249
|
staleTime?: number;
|
|
238
|
-
}): Promise<void>;
|
|
250
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
239
251
|
declare function prefetchInfiniteProductListingPage(queryClient: QueryClient, commerceClient: ProductListingPageCallable, params?: ProductListingPageInfiniteParams, options?: {
|
|
240
252
|
pages?: number;
|
|
241
253
|
staleTime?: number;
|
|
242
|
-
}): Promise<void>;
|
|
254
|
+
}, context?: ProductMarketContext): Promise<void>;
|
|
243
255
|
declare class QueryHooks<TCollection extends ServerCollection = PublicCollection> extends CollectionHooks<TCollection> {
|
|
244
256
|
private _customer;
|
|
245
257
|
private _commerce?;
|
|
246
|
-
|
|
258
|
+
private readonly market?;
|
|
259
|
+
constructor(queryClient: QueryClient, collectionClient: CollectionClient<TCollection>, customerAuth?: CustomerAuth, commerceClient?: ProductCommerceCallable, market?: string);
|
|
247
260
|
private ensureCommerce;
|
|
261
|
+
private withProductMarket;
|
|
248
262
|
useCustomerMe: CustomerHooks['useCustomerMe'];
|
|
249
263
|
useCustomerLogin: CustomerHooks['useCustomerLogin'];
|
|
250
264
|
useCustomerRegister: CustomerHooks['useCustomerRegister'];
|
|
@@ -329,17 +343,16 @@ declare class QueryHooks<TCollection extends ServerCollection = PublicCollection
|
|
|
329
343
|
pages?: number;
|
|
330
344
|
staleTime?: number;
|
|
331
345
|
}): Promise<void>;
|
|
332
|
-
useProductDetail(params:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
id: string;
|
|
336
|
-
}, options?: QueryOptions<ProductDetailResult>): UseQueryResult<ProductDetailResult>;
|
|
337
|
-
useProductDetailBySlug(slug: string, options?: QueryOptions<ProductDetailResult>): UseQueryResult<ProductDetailResult>;
|
|
338
|
-
useProductDetailById(id: string, options?: QueryOptions<ProductDetailResult>): UseQueryResult<ProductDetailResult>;
|
|
346
|
+
useProductDetail(params: ProductDetailParams, options?: QueryOptions<ProductDetailCatalogResult>): UseQueryResult<ProductDetailCatalogResult>;
|
|
347
|
+
useProductDetailBySlug(slug: string, options?: ProductDetailConvenienceOptions): UseQueryResult<ProductDetailCatalogResult>;
|
|
348
|
+
useProductDetailById(id: string, options?: ProductDetailConvenienceOptions): UseQueryResult<ProductDetailCatalogResult>;
|
|
339
349
|
}
|
|
340
350
|
|
|
341
351
|
type ProductListingPageKeyParams = {
|
|
342
352
|
mode: 'catalog' | 'full';
|
|
353
|
+
market?: string;
|
|
354
|
+
locale?: ProductListingPageParams['locale'];
|
|
355
|
+
fallbackLocale?: ProductListingPageParams['fallbackLocale'];
|
|
343
356
|
page?: number;
|
|
344
357
|
limit?: number;
|
|
345
358
|
search?: string;
|
|
@@ -350,6 +363,7 @@ type ProductListingPageKeyParams = {
|
|
|
350
363
|
emit?: ProductListingPageParams['emit'];
|
|
351
364
|
preferCompleteVariantFromHint?: ProductListingPageParams['preferCompleteVariantFromHint'];
|
|
352
365
|
};
|
|
366
|
+
declare function canonicalProductListingGroupsQueryOptions(options?: ProductListingGroupsQueryOptions, limit?: number): ProductListingGroupsQueryOptions | undefined;
|
|
353
367
|
declare function collectionKeys<T extends ServerCollection>(collection: T): {
|
|
354
368
|
all: readonly [T];
|
|
355
369
|
lists: () => readonly [T, "list"];
|
|
@@ -366,31 +380,15 @@ declare const customerKeys: {
|
|
|
366
380
|
declare const productKeys: {
|
|
367
381
|
listingGroups: (options?: ProductListingGroupsQueryOptions) => readonly ["products", "listing-groups", "list", ProductListingGroupsQueryOptions | undefined];
|
|
368
382
|
listingGroupsCatalog: (options?: ProductListingGroupsQueryOptions) => readonly ["products", "listing-groups", "catalog", ProductListingGroupsQueryOptions | undefined];
|
|
369
|
-
listingGroupsInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "infinite",
|
|
370
|
-
|
|
371
|
-
sort?: Sort;
|
|
372
|
-
where?: Where;
|
|
373
|
-
} | undefined];
|
|
374
|
-
listingGroupsCatalogInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "catalog", "infinite", Omit<ProductListingGroupsQueryOptions, "page" | "limit"> | {
|
|
375
|
-
limit: number;
|
|
376
|
-
sort?: Sort;
|
|
377
|
-
where?: Where;
|
|
378
|
-
} | undefined];
|
|
383
|
+
listingGroupsInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "infinite", ProductListingGroupsQueryOptions | undefined];
|
|
384
|
+
listingGroupsCatalogInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-groups", "catalog", "infinite", ProductListingGroupsQueryOptions | undefined];
|
|
379
385
|
listingPage: (params?: ProductListingPageParams) => readonly ["products", "listing-page", ProductListingPageKeyParams];
|
|
380
386
|
listingPageInfinite: (params?: Omit<ProductListingPageParams, "page" | "limit">, pageSize?: number) => readonly ["products", "listing-page", "infinite", ProductListingPageKeyParams];
|
|
381
|
-
detail: (params:
|
|
382
|
-
slug: string;
|
|
383
|
-
} | {
|
|
384
|
-
id: string;
|
|
385
|
-
}) => readonly ["products", "detail", {
|
|
386
|
-
slug: string;
|
|
387
|
-
} | {
|
|
388
|
-
id: string;
|
|
389
|
-
}];
|
|
387
|
+
detail: (params: ProductDetailParams) => readonly ["products", "detail", ProductDetailParams];
|
|
390
388
|
detailAll: () => readonly ["products", "detail"];
|
|
391
389
|
};
|
|
392
390
|
|
|
393
391
|
declare function createQueryHooks(client: RootClient, queryClient?: QueryClient): ReadOnlyQueryHooks;
|
|
394
392
|
declare function createServerQueryHooks(client: RootServerClient, queryClient?: QueryClient): QueryHooks<ServerCollection>;
|
|
395
393
|
|
|
396
|
-
export { type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, type CollectionQueryParams, CustomerHooks, type InfiniteQueryOptions, type ProductListingGroupsQueryOptions, type ProductListingPageCatalogInfiniteParams, type ProductListingPageInfiniteParams, QueryHooks, type QueryOptions, type ReadOnlyQueryHooks, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, collectionKeys, createQueryHooks, createServerQueryHooks, customerKeys, getQueryClient, getStorefrontQueryClient, prefetchInfiniteProductListingPage, prefetchProductListingPage, productKeys, productListingPageInfiniteQueryOptions, productListingPageQueryOptions };
|
|
394
|
+
export { type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, type CollectionQueryParams, CustomerHooks, type InfiniteQueryOptions, type ProductListingGroupsQueryOptions, type ProductListingPageCatalogInfiniteParams, type ProductListingPageInfiniteParams, QueryHooks, type QueryOptions, type ReadOnlyQueryHooks, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, canonicalProductListingGroupsQueryOptions, collectionKeys, createQueryHooks, createServerQueryHooks, customerKeys, getQueryClient, getStorefrontQueryClient, prefetchInfiniteProductListingPage, prefetchProductListingPage, productKeys, productListingPageInfiniteQueryOptions, productListingPageQueryOptions };
|