@shopware/composables 1.11.1 → 1.12.1
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 +18 -13
- package/dist/index.d.mts +35 -5
- package/dist/index.d.ts +35 -5
- package/dist/index.mjs +167 -100
- package/nuxt.config.ts +10 -0
- package/package.json +14 -15
- package/src/cms/useCmsElementConfig.test.ts +1 -0
- package/src/cms/useCmsElementConfig.ts +1 -0
- package/src/cms/useCmsElementImage.test.ts +1 -0
- package/src/cms/useCmsElementImage.ts +2 -0
- package/src/cms/useCmsElementProductBox.test.ts +1 -0
- package/src/cms/useCmsElementProductBox.ts +2 -0
- package/src/createShopwareContext.test.ts +1 -0
- package/src/createShopwareContext.ts +8 -0
- package/src/devtools/plugin.ts +13 -13
- package/src/helpers/ContextError.spec.ts +1 -0
- package/src/index.test.ts +2 -0
- package/src/index.ts +1 -0
- package/src/types/cmsElementTypes.ts +1 -0
- package/src/useAddToCart/useAddToCart.test.ts +1 -0
- package/src/useAddToCart/useAddToCart.ts +1 -0
- package/src/useAddress/useAddress.test.ts +2 -0
- package/src/useAddress/useAddress.ts +1 -0
- package/src/useB2bQuoteManagement/useB2bQuoteManagement.test.ts +1 -0
- package/src/useBreadcrumbs/useBreadcrumbs.test.ts +2 -0
- package/src/useBreadcrumbs/useBreadcrumbs.ts +2 -1
- package/src/useCart/useCart.test.ts +19 -0
- package/src/useCart/useCart.ts +6 -3
- package/src/useCartErrorParamsResolver/useCartErrorParamsResolver.test.ts +1 -0
- package/src/useCartItem/useCartItem.test.ts +15 -0
- package/src/useCartItem/useCartItem.ts +15 -7
- package/src/useCartNotification/useCartNotification.test.ts +2 -0
- package/src/useCategory/useCategory.test.ts +2 -0
- package/src/useCategory/useCategory.ts +2 -0
- package/src/useCategorySearch/useCategorySearch.test.ts +104 -2
- package/src/useCategorySearch/useCategorySearch.ts +45 -23
- package/src/useCheckout/useCheckout.test.ts +1 -0
- package/src/useCheckout/useCheckout.ts +1 -0
- package/src/useCmsBlock/useCmsBlock.test.ts +2 -0
- package/src/useCmsMeta/useCmsMeta.test.ts +2 -0
- package/src/useCmsMeta/useCmsMeta.ts +1 -0
- package/src/useCmsSection/useCmsSection.test.ts +2 -0
- package/src/useCmsTranslations/useCmsTranslations.test.ts +2 -0
- package/src/useCountries/useCountries.test.ts +96 -6
- package/src/useCountries/useCountries.ts +19 -8
- package/src/useCustomerOrders/useCustomerOrders.test.ts +1 -0
- package/src/useCustomerOrders/useCustomerOrders.ts +1 -0
- package/src/useCustomerPassword/useCustomerPassword.test.ts +1 -0
- package/src/useDefaultOrderAssociations/useDefaultOrderAssociations.test.ts +1 -0
- package/src/useInternationalization/useInternationalization.test.ts +14 -1
- package/src/useInternationalization/useInternationalization.ts +5 -3
- package/src/useLandingSearch/useLandingSearch.test.ts +1 -0
- package/src/useLandingSearch/useLandingSearch.ts +1 -0
- package/src/useListing/useListing.test.ts +2 -0
- package/src/useListing/useListing.ts +3 -2
- package/src/useLocalWishlist/useLocalWishlist.test.ts +1 -0
- package/src/useNavigation/useNavigation.test.ts +24 -1
- package/src/useNavigation/useNavigation.ts +36 -14
- package/src/useNavigationContext/useNavigationContext.test.ts +1 -0
- package/src/useNavigationContext/useNavigationContext.ts +1 -0
- package/src/useNavigationSearch/useNavigationSearch.test.ts +30 -0
- package/src/useNavigationSearch/useNavigationSearch.ts +19 -12
- package/src/useNewsletter/useNewsletter.test.ts +1 -0
- package/src/useNewsletter/useNewsletter.ts +1 -0
- package/src/useNotifications/useNotifications.test.ts +1 -0
- package/src/useOrderDetails/useOrderDetails.test.ts +1 -0
- package/src/useOrderDetails/useOrderDetails.ts +1 -0
- package/src/useOrderPayment/useOrderPayment.test.ts +2 -0
- package/src/useOrderPayment/useOrderPayment.ts +1 -0
- package/src/usePrice/usePrice.test.ts +2 -0
- package/src/usePrice/usePrice.ts +1 -0
- package/src/useProduct/useProduct.test.ts +2 -0
- package/src/useProduct/useProduct.ts +2 -0
- package/src/useProductAssociations/useProductAssociations.spec.ts +48 -0
- package/src/useProductAssociations/useProductAssociations.ts +7 -3
- package/src/useProductConfigurator/useProductConfigurator.spec.ts +24 -0
- package/src/useProductConfigurator/useProductConfigurator.ts +20 -13
- package/src/useProductPrice/useProductPrice.test.ts +2 -0
- package/src/useProductPrice/useProductPrice.ts +1 -0
- package/src/useProductReviews/useProductReviews.test.ts +42 -2
- package/src/useProductReviews/useProductReviews.ts +18 -8
- package/src/useProductSearch/useProductSearch.test.ts +24 -1
- package/src/useProductSearch/useProductSearch.ts +24 -11
- package/src/useProductSearchSuggest/useProductSearchSuggest.test.ts +1 -0
- package/src/useProductSearchSuggest/useProductSearchSuggest.ts +1 -0
- package/src/useProductWishlist/useProductWishlist.test.ts +2 -0
- package/src/useProductWishlist/useProductWishlist.ts +1 -0
- package/src/useSalutations/useSalutations.spec.ts +15 -0
- package/src/useSalutations/useSalutations.ts +5 -2
- package/src/useSessionContext/useSessionContext.test.ts +84 -6
- package/src/useSessionContext/useSessionContext.ts +17 -2
- package/src/useShopwareContext/useShopwareContext.test.ts +1 -0
- package/src/useShopwareContext/useShopwareContext.ts +13 -0
- package/src/useSyncWishlist/useSyncWishlist.test.ts +1 -0
- package/src/useSyncWishlist/useSyncWishlist.ts +1 -0
- package/src/useUrlResolver/useUrlResolver.test.ts +1 -0
- package/src/useUser/useUser.test.ts +55 -2
- package/src/useUser/useUser.ts +34 -25
- package/src/useWishlist/useWishlist.test.ts +2 -0
- package/src/useWishlist/useWishlist.ts +1 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/shopware/frontends/issues?q=is%3Aopen+is%3Aissue+label%3Acomposables)
|
|
6
6
|
[](#)
|
|
7
7
|
|
|
8
|
-
Set of Vue.js composition functions that can be used in any Vue.js project. They provide state management, UI logic and data fetching and are the base for all guides in our [building section](https://
|
|
8
|
+
Set of Vue.js composition functions that can be used in any Vue.js project. They provide state management, UI logic and data fetching and are the base for all guides in our [building section](https://developer.shopware.com/frontends/guides/page-elements/navigation.html).
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
@@ -88,7 +88,7 @@ Now you can use any composable function in your setup function:
|
|
|
88
88
|
|
|
89
89
|
const { login } = useUser();
|
|
90
90
|
const { refreshSessionContext, sessionContext } = useSessionContext();
|
|
91
|
-
refreshSessionContext();
|
|
91
|
+
await refreshSessionContext();
|
|
92
92
|
</script>
|
|
93
93
|
<template>
|
|
94
94
|
<pre>{{ sessionContext }}</pre>
|
|
@@ -123,6 +123,7 @@ Let's get back to the step where the `api-client` was initialized:
|
|
|
123
123
|
```ts [apiClient.ts]
|
|
124
124
|
import { createAPIClient } from "@shopware/api-client";
|
|
125
125
|
import Cookies from "js-cookie";
|
|
126
|
+
|
|
126
127
|
import type { operations } from "#shopware";
|
|
127
128
|
|
|
128
129
|
const shopwareEndpoint = "https://demo-frontends.shopware.store/store-api";
|
|
@@ -155,7 +156,7 @@ All composable functions are fully typed with TypeScript and they are registed g
|
|
|
155
156
|
|
|
156
157
|
## Links
|
|
157
158
|
|
|
158
|
-
- [📘 Documentation](https://
|
|
159
|
+
- [📘 Documentation](https://developer.shopware.com/frontends)
|
|
159
160
|
|
|
160
161
|
- [👥 Community Discord](https://discord.com/channels/1308047705309708348/1405501315160739951) (`#composable-frontend`)
|
|
161
162
|
|
|
@@ -165,20 +166,24 @@ All composable functions are fully typed with TypeScript and they are registed g
|
|
|
165
166
|
|
|
166
167
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/composables/CHANGELOG.md)
|
|
167
168
|
|
|
168
|
-
### Latest changes: 1.
|
|
169
|
+
### Latest changes: 1.12.1
|
|
169
170
|
|
|
170
171
|
### Patch Changes
|
|
171
172
|
|
|
172
|
-
- [#
|
|
173
|
+
- [#2568](https://github.com/shopware/frontends/pull/2568) [`6315350`](https://github.com/shopware/frontends/commit/6315350add0464abef153343897d42f5808f2003) Thanks [@patzick](https://github.com/patzick)! - Add cacheable GET support for category details and product reviews while preserving the existing POST behavior when `cacheableReads` is disabled.
|
|
174
|
+
|
|
175
|
+
- `useCategorySearch.search` now calls `GET /category/{navigationId}` and sends the complete encoded Criteria in the `_criteria` query parameter when cacheable reads are enabled.
|
|
176
|
+
- `useProductReviews.loadProductReviews` now calls `GET /product/{productId}/reviews` and sends its encoded Criteria in `_criteria` when cacheable reads are enabled.
|
|
177
|
+
- The CMS product description reviews element follows the same flag and endpoint behavior when it needs to fetch reviews directly.
|
|
178
|
+
|
|
179
|
+
- [#2596](https://github.com/shopware/frontends/pull/2596) [`6572aa8`](https://github.com/shopware/frontends/commit/6572aa84431e1f4a34d6cf04e549037692d638a6) Thanks [@patzick](https://github.com/patzick)! - Reduce Rolldown/Vite build noise: scope Nuxt global components, keep the three.js async chunk warning intentional, avoid shipping full carbon icon JSON via UnoCSS runtime, and bump @vueuse to 14.4.0.
|
|
173
180
|
|
|
174
|
-
|
|
175
|
-
`useNavigationSearch` to resolve `/navigation/*`, `/detail/*`, and
|
|
176
|
-
`/landingPage/*` routes more reliably, including fallback behavior when no SEO
|
|
177
|
-
mapping row is returned.
|
|
181
|
+
- [#2514](https://github.com/shopware/frontends/pull/2514) [`744833b`](https://github.com/shopware/frontends/commit/744833b9d7d2f8ea1f5dfe65be3fa554dbe4a09f) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Allow passing custom criteria to `useCountries`.
|
|
178
182
|
|
|
179
|
-
- [#
|
|
183
|
+
- [#2552](https://github.com/shopware/frontends/pull/2552) [`e03c91b`](https://github.com/shopware/frontends/commit/e03c91be172374894d90b7a0111855b76719fee1) Thanks [@patzick](https://github.com/patzick)! - Suppress Rolldown diagnostic warnings for invalid third-party pure annotations and plugin timings in the Nuxt layer build config.
|
|
180
184
|
|
|
181
|
-
- [#
|
|
185
|
+
- [#2591](https://github.com/shopware/frontends/pull/2591) [`38379a5`](https://github.com/shopware/frontends/commit/38379a5d52ab09008774533ef417ebe2cde3f7fd) Thanks [@patzick](https://github.com/patzick)! - Propagate session context refresh failures so login, registration, logout, and context setters cannot complete after an unverifiable context switch.
|
|
182
186
|
|
|
183
|
-
- Updated dependencies [[`
|
|
184
|
-
- @shopware/
|
|
187
|
+
- Updated dependencies [[`b767721`](https://github.com/shopware/frontends/commit/b767721847bf3391f9067eca7a045089fb22fce0), [`f16c5a0`](https://github.com/shopware/frontends/commit/f16c5a0785d6187b73c3edcf37feab7c90bd7988), [`978b02c`](https://github.com/shopware/frontends/commit/978b02c969ca4b16f5fc1d7a953ec4cce3d98173), [`33facb1`](https://github.com/shopware/frontends/commit/33facb178792c8cb26b47ab984ac48c08ab4b72b), [`9137475`](https://github.com/shopware/frontends/commit/91374753cedb2034385f642e6af11314f2971caa), [`474d3fe`](https://github.com/shopware/frontends/commit/474d3fed346816135b0c7c797990b215a8b691c0)]:
|
|
188
|
+
- @shopware/api-client@1.5.1
|
|
189
|
+
- @shopware/helpers@1.7.2
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
|
|
3
3
|
import { createAPIClient, ApiError } from '@shopware/api-client';
|
|
4
|
-
import { operations as operations$1
|
|
4
|
+
import { components, operations as operations$1 } from '@shopware/api-client/store-api-types';
|
|
5
5
|
import * as _shopware_api_client_api_types from '@shopware/api-client/api-types';
|
|
6
6
|
import { getListingFilters, TierPrice } from '@shopware/helpers';
|
|
7
7
|
|
|
@@ -421,6 +421,13 @@ declare function createShopwareContext(app: App, options: {
|
|
|
421
421
|
devStorefrontUrl?: string | null;
|
|
422
422
|
enableDevtools?: boolean;
|
|
423
423
|
browserLocale?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Opt in to reading data via cacheable GET Store API routes instead of
|
|
426
|
+
* POST. Surfaced on the Shopware context as `cacheableReads`.
|
|
427
|
+
*
|
|
428
|
+
* @default false
|
|
429
|
+
*/
|
|
430
|
+
cacheableReads?: boolean;
|
|
424
431
|
}): vue.Raw<{
|
|
425
432
|
install(app: App): void;
|
|
426
433
|
_a: App<any>;
|
|
@@ -430,6 +437,7 @@ declare function createShopwareContext(app: App, options: {
|
|
|
430
437
|
interceptors: {};
|
|
431
438
|
} | undefined;
|
|
432
439
|
browserLocale: string;
|
|
440
|
+
cacheableReads: boolean;
|
|
433
441
|
}>;
|
|
434
442
|
|
|
435
443
|
type UseAddressReturn = {
|
|
@@ -564,7 +572,7 @@ type UseBreadcrumbsReturn = {
|
|
|
564
572
|
};
|
|
565
573
|
/**
|
|
566
574
|
* Composable for breadcrumbs management.
|
|
567
|
-
* Read the [guide](https://
|
|
575
|
+
* Read the [guide](https://developer.shopware.com/frontends/guides/page-elements/breadcrumbs.html#building-breadcrumbs-for-cms-pages).
|
|
568
576
|
*
|
|
569
577
|
* @public
|
|
570
578
|
* @category CMS (Shopping Experiences)
|
|
@@ -663,13 +671,14 @@ type UseCartReturn = {
|
|
|
663
671
|
/**
|
|
664
672
|
* Cart management logic.
|
|
665
673
|
*
|
|
666
|
-
* Used as [Shared](https://
|
|
674
|
+
* Used as [Shared](https://developer.shopware.com/frontends/concepts/composables/shared-composables.html) Composable `useCart`
|
|
667
675
|
*
|
|
668
676
|
* @category Cart & Checkout
|
|
669
677
|
*/
|
|
670
678
|
declare function useCartFunction(): UseCartReturn;
|
|
671
679
|
declare const useCart: typeof useCartFunction;
|
|
672
680
|
|
|
681
|
+
type LineItemOptions = Schemas["PropertyGroupOption"][];
|
|
673
682
|
type UseCartItemReturn = {
|
|
674
683
|
/**
|
|
675
684
|
* Calculated price {number} for the current item
|
|
@@ -690,7 +699,7 @@ type UseCartItemReturn = {
|
|
|
690
699
|
/**
|
|
691
700
|
* Options (of variation) for the current item
|
|
692
701
|
*/
|
|
693
|
-
itemOptions: ComputedRef<
|
|
702
|
+
itemOptions: ComputedRef<LineItemOptions>;
|
|
694
703
|
/**
|
|
695
704
|
* Type of the current item: "product" or "promotion"
|
|
696
705
|
*/
|
|
@@ -933,7 +942,7 @@ type UseCountriesReturn = {
|
|
|
933
942
|
* @public
|
|
934
943
|
* @category Context & Language
|
|
935
944
|
*/
|
|
936
|
-
declare function useCountries(): UseCountriesReturn;
|
|
945
|
+
declare function useCountries(criteria?: Schemas["Criteria"]): UseCountriesReturn;
|
|
937
946
|
|
|
938
947
|
type UseCustomerOrdersReturn = {
|
|
939
948
|
/**
|
|
@@ -1715,6 +1724,7 @@ type UseProductAssociationsReturn = {
|
|
|
1715
1724
|
*/
|
|
1716
1725
|
declare function useProductAssociations(product: ComputedRef<Schemas["Product"]>, options: {
|
|
1717
1726
|
associationContext: "cross-selling" | "reviews";
|
|
1727
|
+
includeSeoUrls?: boolean;
|
|
1718
1728
|
}): UseProductAssociationsReturn;
|
|
1719
1729
|
|
|
1720
1730
|
type UseProductConfiguratorReturn = {
|
|
@@ -1940,6 +1950,10 @@ type UseSessionContextReturn = {
|
|
|
1940
1950
|
sessionContext: ComputedRef<Schemas["SalesChannelContext"] | undefined>;
|
|
1941
1951
|
/**
|
|
1942
1952
|
* Fetches the session context and assigns the result to the `sessionContext` property
|
|
1953
|
+
*
|
|
1954
|
+
* Throws when the context cannot be loaded. Callers that depend on a verified
|
|
1955
|
+
* context switch, such as logout or checkout flows, should block progression
|
|
1956
|
+
* when this fails.
|
|
1943
1957
|
*/
|
|
1944
1958
|
refreshSessionContext(): Promise<void>;
|
|
1945
1959
|
/**
|
|
@@ -2018,6 +2032,12 @@ type UseSessionContextReturn = {
|
|
|
2018
2032
|
* current language code
|
|
2019
2033
|
*/
|
|
2020
2034
|
currentLanguageId: ComputedRef<string | undefined>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Locale code of the active language (e.g. `"en-GB"`), read from the
|
|
2037
|
+
* context's `languageInfo`. Available from the session context alone — no
|
|
2038
|
+
* separate language list request is required to detect the current locale.
|
|
2039
|
+
*/
|
|
2040
|
+
currentLocaleCode: ComputedRef<string | undefined>;
|
|
2021
2041
|
/**
|
|
2022
2042
|
* current context's customer object
|
|
2023
2043
|
*/
|
|
@@ -2042,6 +2062,16 @@ type ShopwareContext = {
|
|
|
2042
2062
|
* If not provided, it will be "en-US"
|
|
2043
2063
|
*/
|
|
2044
2064
|
browserLocale: string;
|
|
2065
|
+
/**
|
|
2066
|
+
* When `true`, composables read data through the cacheable GET variants of
|
|
2067
|
+
* the Store API (criteria compressed into the `_criteria` query param)
|
|
2068
|
+
* instead of POST, so the responses can be cached by HTTP infrastructure
|
|
2069
|
+
* (CDN, reverse proxy, browser). Requires a backend that supports the GET
|
|
2070
|
+
* read routes.
|
|
2071
|
+
*
|
|
2072
|
+
* @default false
|
|
2073
|
+
*/
|
|
2074
|
+
cacheableReads: boolean;
|
|
2045
2075
|
};
|
|
2046
2076
|
/**
|
|
2047
2077
|
* @public
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { CSSProperties, ComputedRef, AnchorHTMLAttributes, ImgHTMLAttributes, App, EffectScope, Ref } from 'vue';
|
|
3
3
|
import { createAPIClient, ApiError } from '@shopware/api-client';
|
|
4
|
-
import { operations as operations$1
|
|
4
|
+
import { components, operations as operations$1 } from '@shopware/api-client/store-api-types';
|
|
5
5
|
import * as _shopware_api_client_api_types from '@shopware/api-client/api-types';
|
|
6
6
|
import { getListingFilters, TierPrice } from '@shopware/helpers';
|
|
7
7
|
|
|
@@ -421,6 +421,13 @@ declare function createShopwareContext(app: App, options: {
|
|
|
421
421
|
devStorefrontUrl?: string | null;
|
|
422
422
|
enableDevtools?: boolean;
|
|
423
423
|
browserLocale?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Opt in to reading data via cacheable GET Store API routes instead of
|
|
426
|
+
* POST. Surfaced on the Shopware context as `cacheableReads`.
|
|
427
|
+
*
|
|
428
|
+
* @default false
|
|
429
|
+
*/
|
|
430
|
+
cacheableReads?: boolean;
|
|
424
431
|
}): vue.Raw<{
|
|
425
432
|
install(app: App): void;
|
|
426
433
|
_a: App<any>;
|
|
@@ -430,6 +437,7 @@ declare function createShopwareContext(app: App, options: {
|
|
|
430
437
|
interceptors: {};
|
|
431
438
|
} | undefined;
|
|
432
439
|
browserLocale: string;
|
|
440
|
+
cacheableReads: boolean;
|
|
433
441
|
}>;
|
|
434
442
|
|
|
435
443
|
type UseAddressReturn = {
|
|
@@ -564,7 +572,7 @@ type UseBreadcrumbsReturn = {
|
|
|
564
572
|
};
|
|
565
573
|
/**
|
|
566
574
|
* Composable for breadcrumbs management.
|
|
567
|
-
* Read the [guide](https://
|
|
575
|
+
* Read the [guide](https://developer.shopware.com/frontends/guides/page-elements/breadcrumbs.html#building-breadcrumbs-for-cms-pages).
|
|
568
576
|
*
|
|
569
577
|
* @public
|
|
570
578
|
* @category CMS (Shopping Experiences)
|
|
@@ -663,13 +671,14 @@ type UseCartReturn = {
|
|
|
663
671
|
/**
|
|
664
672
|
* Cart management logic.
|
|
665
673
|
*
|
|
666
|
-
* Used as [Shared](https://
|
|
674
|
+
* Used as [Shared](https://developer.shopware.com/frontends/concepts/composables/shared-composables.html) Composable `useCart`
|
|
667
675
|
*
|
|
668
676
|
* @category Cart & Checkout
|
|
669
677
|
*/
|
|
670
678
|
declare function useCartFunction(): UseCartReturn;
|
|
671
679
|
declare const useCart: typeof useCartFunction;
|
|
672
680
|
|
|
681
|
+
type LineItemOptions = Schemas["PropertyGroupOption"][];
|
|
673
682
|
type UseCartItemReturn = {
|
|
674
683
|
/**
|
|
675
684
|
* Calculated price {number} for the current item
|
|
@@ -690,7 +699,7 @@ type UseCartItemReturn = {
|
|
|
690
699
|
/**
|
|
691
700
|
* Options (of variation) for the current item
|
|
692
701
|
*/
|
|
693
|
-
itemOptions: ComputedRef<
|
|
702
|
+
itemOptions: ComputedRef<LineItemOptions>;
|
|
694
703
|
/**
|
|
695
704
|
* Type of the current item: "product" or "promotion"
|
|
696
705
|
*/
|
|
@@ -933,7 +942,7 @@ type UseCountriesReturn = {
|
|
|
933
942
|
* @public
|
|
934
943
|
* @category Context & Language
|
|
935
944
|
*/
|
|
936
|
-
declare function useCountries(): UseCountriesReturn;
|
|
945
|
+
declare function useCountries(criteria?: Schemas["Criteria"]): UseCountriesReturn;
|
|
937
946
|
|
|
938
947
|
type UseCustomerOrdersReturn = {
|
|
939
948
|
/**
|
|
@@ -1715,6 +1724,7 @@ type UseProductAssociationsReturn = {
|
|
|
1715
1724
|
*/
|
|
1716
1725
|
declare function useProductAssociations(product: ComputedRef<Schemas["Product"]>, options: {
|
|
1717
1726
|
associationContext: "cross-selling" | "reviews";
|
|
1727
|
+
includeSeoUrls?: boolean;
|
|
1718
1728
|
}): UseProductAssociationsReturn;
|
|
1719
1729
|
|
|
1720
1730
|
type UseProductConfiguratorReturn = {
|
|
@@ -1940,6 +1950,10 @@ type UseSessionContextReturn = {
|
|
|
1940
1950
|
sessionContext: ComputedRef<Schemas["SalesChannelContext"] | undefined>;
|
|
1941
1951
|
/**
|
|
1942
1952
|
* Fetches the session context and assigns the result to the `sessionContext` property
|
|
1953
|
+
*
|
|
1954
|
+
* Throws when the context cannot be loaded. Callers that depend on a verified
|
|
1955
|
+
* context switch, such as logout or checkout flows, should block progression
|
|
1956
|
+
* when this fails.
|
|
1943
1957
|
*/
|
|
1944
1958
|
refreshSessionContext(): Promise<void>;
|
|
1945
1959
|
/**
|
|
@@ -2018,6 +2032,12 @@ type UseSessionContextReturn = {
|
|
|
2018
2032
|
* current language code
|
|
2019
2033
|
*/
|
|
2020
2034
|
currentLanguageId: ComputedRef<string | undefined>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Locale code of the active language (e.g. `"en-GB"`), read from the
|
|
2037
|
+
* context's `languageInfo`. Available from the session context alone — no
|
|
2038
|
+
* separate language list request is required to detect the current locale.
|
|
2039
|
+
*/
|
|
2040
|
+
currentLocaleCode: ComputedRef<string | undefined>;
|
|
2021
2041
|
/**
|
|
2022
2042
|
* current context's customer object
|
|
2023
2043
|
*/
|
|
@@ -2042,6 +2062,16 @@ type ShopwareContext = {
|
|
|
2042
2062
|
* If not provided, it will be "en-US"
|
|
2043
2063
|
*/
|
|
2044
2064
|
browserLocale: string;
|
|
2065
|
+
/**
|
|
2066
|
+
* When `true`, composables read data through the cacheable GET variants of
|
|
2067
|
+
* the Store API (criteria compressed into the `_criteria` query param)
|
|
2068
|
+
* instead of POST, so the responses can be cached by HTTP infrastructure
|
|
2069
|
+
* (CDN, reverse proxy, browser). Requires a backend that supports the GET
|
|
2070
|
+
* read routes.
|
|
2071
|
+
*
|
|
2072
|
+
* @default false
|
|
2073
|
+
*/
|
|
2074
|
+
cacheableReads: boolean;
|
|
2045
2075
|
};
|
|
2046
2076
|
/**
|
|
2047
2077
|
* @public
|