@01.software/sdk 0.44.0 → 0.45.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +358 -2
  2. package/MIGRATION.md +89 -10
  3. package/README.md +441 -98
  4. package/dist/{server-nXOezi4b.d.cts → catalog-mappers-sIshKNb3.d.cts} +14 -3
  5. package/dist/{server-nXOezi4b.d.ts → catalog-mappers-sIshKNb3.d.ts} +14 -3
  6. package/dist/client.cjs +2680 -345
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.d.cts +10 -7
  9. package/dist/client.d.ts +10 -7
  10. package/dist/client.js +2680 -345
  11. package/dist/client.js.map +1 -1
  12. package/dist/{collection-client-Dyl-CDcj.d.cts → collection-client-BSo7VXQE.d.cts} +8 -5
  13. package/dist/{collection-client-DWooaiTr.d.ts → collection-client-Ckfusuee.d.ts} +8 -5
  14. package/dist/{const-pGDnsy0o.d.ts → const-BAG0MH0u.d.cts} +13 -10
  15. package/dist/{const-1vleZ6ov.d.cts → const-CaPq2AE4.d.ts} +13 -10
  16. package/dist/errors.cjs +74 -1
  17. package/dist/errors.cjs.map +1 -1
  18. package/dist/errors.d.cts +38 -1
  19. package/dist/errors.d.ts +38 -1
  20. package/dist/errors.js +74 -1
  21. package/dist/errors.js.map +1 -1
  22. package/dist/{index-DUNySyxV.d.ts → index-BNICJxBL.d.ts} +4 -4
  23. package/dist/{index-a6g7vqAD.d.cts → index-YGrZrxNn.d.cts} +4 -4
  24. package/dist/index.cjs +2741 -368
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +18 -19
  27. package/dist/index.d.ts +18 -19
  28. package/dist/index.js +2741 -368
  29. package/dist/index.js.map +1 -1
  30. package/dist/{payload-types-CDsuOEfM.d.cts → payload-types-CJZuXcgF.d.cts} +6671 -4001
  31. package/dist/{payload-types-CDsuOEfM.d.ts → payload-types-CJZuXcgF.d.ts} +6671 -4001
  32. package/dist/query.cjs +550 -101
  33. package/dist/query.cjs.map +1 -1
  34. package/dist/query.d.cts +43 -45
  35. package/dist/query.d.ts +43 -45
  36. package/dist/query.js +550 -101
  37. package/dist/query.js.map +1 -1
  38. package/dist/realtime.cjs.map +1 -1
  39. package/dist/realtime.d.cts +2 -2
  40. package/dist/realtime.d.ts +2 -2
  41. package/dist/realtime.js.map +1 -1
  42. package/dist/server.cjs +2252 -444
  43. package/dist/server.cjs.map +1 -1
  44. package/dist/server.d.cts +11 -10
  45. package/dist/server.d.ts +11 -10
  46. package/dist/server.js +2252 -444
  47. package/dist/server.js.map +1 -1
  48. package/dist/storefront-cache.cjs +65 -1
  49. package/dist/storefront-cache.cjs.map +1 -1
  50. package/dist/storefront-cache.js +65 -1
  51. package/dist/storefront-cache.js.map +1 -1
  52. package/dist/types-BC6rVmJa.d.ts +47 -0
  53. package/dist/{types-CDND3hzq.d.cts → types-BlOvjoTX.d.ts} +1095 -509
  54. package/dist/{types-Dt9FJisi.d.ts → types-C4WuJfw7.d.cts} +1095 -509
  55. package/dist/types-D5p7-m1l.d.cts +47 -0
  56. package/dist/ui/canvas/server.cjs +244 -2
  57. package/dist/ui/canvas/server.cjs.map +1 -1
  58. package/dist/ui/canvas/server.d.cts +27 -1
  59. package/dist/ui/canvas/server.d.ts +27 -1
  60. package/dist/ui/canvas/server.js +244 -2
  61. package/dist/ui/canvas/server.js.map +1 -1
  62. package/dist/ui/canvas.cjs +419 -103
  63. package/dist/ui/canvas.cjs.map +1 -1
  64. package/dist/ui/canvas.d.cts +19 -7
  65. package/dist/ui/canvas.d.ts +19 -7
  66. package/dist/ui/canvas.js +419 -103
  67. package/dist/ui/canvas.js.map +1 -1
  68. package/dist/ui/form.d.cts +1 -1
  69. package/dist/ui/form.d.ts +1 -1
  70. package/dist/ui/video.d.cts +1 -1
  71. package/dist/ui/video.d.ts +1 -1
  72. package/dist/webhook.cjs +2 -1
  73. package/dist/webhook.cjs.map +1 -1
  74. package/dist/webhook.d.cts +4 -4
  75. package/dist/webhook.d.ts +4 -4
  76. package/dist/webhook.js +2 -1
  77. package/dist/webhook.js.map +1 -1
  78. package/package.json +12 -11
  79. package/dist/types-SoXsbKhj.d.cts +0 -33
  80. 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 { g as ApiQueryOptions, P as PayloadFindResponse, aD as PublicReadQueryOptions, o as PayloadMutationResponse, aE as CustomerAuth, aF as CustomerProfile, aG as CustomerAuthResponse, aH as CustomerLoginData, aI as CustomerRegisterResponse, aJ as CustomerRegisterData, aK as CustomerRefreshResponse, aL as UpdateProfileData, aM as ProductListingPageBaseParams, aN as ProductListingPageParams, aO as ProductDetailParams, aP as ProductDetailResult, aQ as ProductListingPageCatalogParams, aR as ProductListingPageResult, aS as ProductListingGroupsCatalogItem, aT as ProductListingPageFullParams, aU as ProductListingGroupsItem, S as Sort, W as Where, z as RootClient, aq as RootServerClient } from './types-CDND3hzq.cjs';
4
- import './payload-types-CDsuOEfM.cjs';
5
- import { C as CollectionClient } from './collection-client-Dyl-CDcj.cjs';
6
- import { S as ServerCollection, P as PublicCollection } from './const-1vleZ6ov.cjs';
7
- import { C as CollectionType } from './types-SoXsbKhj.cjs';
3
+ import { i as ApiQueryOptions, P as PayloadFindResponse, bI as PublicReadQueryOptions, K as PayloadMutationResponse, bJ as CustomerAuth, bK as CustomerProfile, bL as CustomerAuthResponse, bM as CustomerLoginData, bN as CustomerRegisterResponse, bO as CustomerRegisterData, bP as CustomerRefreshResponse, bQ as UpdateProfileData, bR as ProductListingPageParams, bS as ProductListingPageBaseParams, bT as ProductDetailParams, bU as ProductDetailCatalogResult, bV as ProductListingPageCatalogParams, bW as ProductListingPageResult, bX as ProductListingGroupsCatalogItem, bY as ProductListingPageFullParams, bZ as ProductListingGroupsItem, ah as RootClient, bp as RootServerClient } from './types-C4WuJfw7.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-BSo7VXQE.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<ProductDetailResult>;
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
- declare function productListingPageQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogParams): {
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
- constructor(queryClient: QueryClient, collectionClient: CollectionClient<TCollection>, customerAuth?: CustomerAuth, commerceClient?: ProductCommerceCallable);
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
- slug: string;
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", Omit<ProductListingGroupsQueryOptions, "page" | "limit"> | {
370
- limit: number;
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 { g as ApiQueryOptions, P as PayloadFindResponse, aD as PublicReadQueryOptions, o as PayloadMutationResponse, aE as CustomerAuth, aF as CustomerProfile, aG as CustomerAuthResponse, aH as CustomerLoginData, aI as CustomerRegisterResponse, aJ as CustomerRegisterData, aK as CustomerRefreshResponse, aL as UpdateProfileData, aM as ProductListingPageBaseParams, aN as ProductListingPageParams, aO as ProductDetailParams, aP as ProductDetailResult, aQ as ProductListingPageCatalogParams, aR as ProductListingPageResult, aS as ProductListingGroupsCatalogItem, aT as ProductListingPageFullParams, aU as ProductListingGroupsItem, S as Sort, W as Where, z as RootClient, aq as RootServerClient } from './types-Dt9FJisi.js';
4
- import './payload-types-CDsuOEfM.js';
5
- import { C as CollectionClient } from './collection-client-DWooaiTr.js';
6
- import { S as ServerCollection, P as PublicCollection } from './const-pGDnsy0o.js';
7
- import { C as CollectionType } from './types-oiae_LMm.js';
3
+ import { i as ApiQueryOptions, P as PayloadFindResponse, bI as PublicReadQueryOptions, K as PayloadMutationResponse, bJ as CustomerAuth, bK as CustomerProfile, bL as CustomerAuthResponse, bM as CustomerLoginData, bN as CustomerRegisterResponse, bO as CustomerRegisterData, bP as CustomerRefreshResponse, bQ as UpdateProfileData, bR as ProductListingPageParams, bS as ProductListingPageBaseParams, bT as ProductDetailParams, bU as ProductDetailCatalogResult, bV as ProductListingPageCatalogParams, bW as ProductListingPageResult, bX as ProductListingGroupsCatalogItem, bY as ProductListingPageFullParams, bZ as ProductListingGroupsItem, ah as RootClient, bp as RootServerClient } from './types-BlOvjoTX.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-Ckfusuee.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<ProductDetailResult>;
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
- declare function productListingPageQueryOptions(commerceClient: ProductListingPageCatalogCallable, params?: ProductListingPageCatalogParams): {
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
- constructor(queryClient: QueryClient, collectionClient: CollectionClient<TCollection>, customerAuth?: CustomerAuth, commerceClient?: ProductCommerceCallable);
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
- slug: string;
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", Omit<ProductListingGroupsQueryOptions, "page" | "limit"> | {
370
- limit: number;
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 };