@scayle/storefront-nuxt 8.10.4 → 8.11.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/CHANGELOG.md +21 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/api/cacheAuth.d.ts +20 -5
- package/dist/runtime/api/purgeAll.d.ts +12 -0
- package/dist/runtime/api/purgeTags.d.ts +14 -0
- package/dist/runtime/api/rpcHandler.d.ts +17 -22
- package/dist/runtime/api/up.d.ts +8 -0
- package/dist/runtime/cached.d.ts +13 -0
- package/dist/runtime/campaignKey.d.ts +18 -0
- package/dist/runtime/composables/core/useAvailableShops.d.ts +10 -0
- package/dist/runtime/composables/core/useCurrentShop.d.ts +10 -0
- package/dist/runtime/composables/core/useFormatHelpers.d.ts +57 -6
- package/dist/runtime/composables/core/useIDP.d.ts +17 -0
- package/dist/runtime/composables/core/useLog.d.ts +12 -0
- package/dist/runtime/composables/core/useRpc.d.ts +76 -24
- package/dist/runtime/composables/core/useRpcCall.d.ts +40 -0
- package/dist/runtime/composables/core/useSession.d.ts +10 -0
- package/dist/runtime/composables/core/useUser.d.ts +24 -0
- package/dist/runtime/composables/storefront/useBasket.d.ts +24 -0
- package/dist/runtime/composables/storefront/useBrand.d.ts +21 -0
- package/dist/runtime/composables/storefront/useBrands.d.ts +21 -0
- package/dist/runtime/composables/storefront/useCategories.d.ts +28 -0
- package/dist/runtime/composables/storefront/useCategoryById.d.ts +21 -0
- package/dist/runtime/composables/storefront/useCategoryByPath.d.ts +21 -0
- package/dist/runtime/composables/storefront/useCurrentPromotions.d.ts +24 -0
- package/dist/runtime/composables/storefront/useFilters.d.ts +21 -0
- package/dist/runtime/composables/storefront/useNavigationTree.d.ts +42 -0
- package/dist/runtime/composables/storefront/useNavigationTrees.d.ts +21 -0
- package/dist/runtime/composables/storefront/useOrder.d.ts +23 -0
- package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +21 -0
- package/dist/runtime/composables/storefront/useProduct.d.ts +21 -0
- package/dist/runtime/composables/storefront/useProducts.d.ts +21 -0
- package/dist/runtime/composables/storefront/useProductsByIds.d.ts +21 -0
- package/dist/runtime/composables/storefront/useProductsByReferenceKeys.d.ts +21 -0
- package/dist/runtime/composables/storefront/useProductsCount.d.ts +19 -0
- package/dist/runtime/composables/storefront/usePromotions.d.ts +21 -0
- package/dist/runtime/composables/storefront/usePromotionsByIds.d.ts +21 -0
- package/dist/runtime/composables/storefront/useShopConfiguration.d.ts +21 -0
- package/dist/runtime/composables/storefront/useStorefrontSearch.d.ts +11 -1
- package/dist/runtime/composables/storefront/useUserAddresses.d.ts +21 -0
- package/dist/runtime/composables/storefront/useVariant.d.ts +21 -0
- package/dist/runtime/composables/storefront/useWishlist.d.ts +29 -0
- package/dist/runtime/composables/useCoreLog.d.ts +13 -0
- package/dist/runtime/context.d.ts +25 -0
- package/dist/runtime/context.js +25 -1
- package/dist/runtime/createLog.d.ts +16 -0
- package/dist/runtime/handler.d.ts +18 -4
- package/dist/runtime/rpc/rpcCall.d.ts +15 -3
- package/dist/runtime/server/middleware/bootstrap-utils.d.ts +1 -1
- package/dist/runtime/utils/promise.d.ts +30 -6
- package/dist/runtime/utils/route.d.ts +11 -0
- package/dist/runtime/utils/seo.d.ts +13 -0
- package/package.json +7 -7
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves brand data using the `getBrandById` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching brand data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/brands/get-a-brand
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getBrandById'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getBrandById` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getBrandById` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useBrand<DataT = NormalizedRpcResponse<'getBrandById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getBrandById'>>;
|
|
6
27
|
options: UseRpcOptions<'getBrandById', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves multiple brands data using the 'getBrands' RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching brands data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/brands/list-brands
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getBrands'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getBrands` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getBrands` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. This key is used internally by `useRpc` for caching and managing state.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useBrands<DataT = NormalizedRpcResponse<'getBrands'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getBrands'>>;
|
|
6
27
|
options: UseRpcOptions<'getBrands', DataT, PickKeys, DefaultT>;
|
|
@@ -4,6 +4,34 @@ import type { MaybeRefOrGetter } from 'vue';
|
|
|
4
4
|
type UseCategoriesBaseReturn<DataT, PickKeys extends KeysOf<DataT>, DefaultT> = Pick<Awaited<UseRpcReturn<'getCategoriesByPath', DataT, PickKeys, DefaultT>>, 'data' | 'error' | 'status' | 'refresh'> & {
|
|
5
5
|
getCategoryById: (id: number, includeHidden?: true) => RpcMethodReturnType<'getCategoryById'>;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves categories data using the 'getCategoriesByPath' RPC method and
|
|
9
|
+
* provides a helper for fetching individual categories by ID.
|
|
10
|
+
*
|
|
11
|
+
* This function extends the functionality of `useRpc` by adding a
|
|
12
|
+
* `getCategoryById` method to the returned object. It fetches category data via
|
|
13
|
+
* 'getCategoriesByPath', then constructs and returns a promise enriched with the data,
|
|
14
|
+
* error, status, refresh function from the original promise, along with the
|
|
15
|
+
* added `getCategoryById` function. This approach allows for efficient retrieval
|
|
16
|
+
* of category data and simplifies the process of accessing individual categories.
|
|
17
|
+
*
|
|
18
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
19
|
+
* simplifying the process of fetching brand data. It internally calls `useRpc`
|
|
20
|
+
* with the provided parameters and options.
|
|
21
|
+
*
|
|
22
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getCategoriesByPath'>`.
|
|
23
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
24
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
25
|
+
*
|
|
26
|
+
* @param input An object containing parameters and options for the `getCategoriesByPath` RPC call.
|
|
27
|
+
* @param input.params The parameters for the `getCategoriesByPath` RPC method.
|
|
28
|
+
* @param input.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
29
|
+
* @param keyA A unique key for caching and state management within `useRpc`.
|
|
30
|
+
*
|
|
31
|
+
* @returns A promise that resolves to an object containing the category data,
|
|
32
|
+
* error and status information, a refresh function, and a `getCategoryById`
|
|
33
|
+
* function for fetching individual categories.
|
|
34
|
+
*/
|
|
7
35
|
export declare function useCategories<DataT = NormalizedRpcResponse<'getCategoriesByPath'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
8
36
|
params: MaybeRefOrGetter<RpcMethodParameters<'getCategoriesByPath'>>;
|
|
9
37
|
options: UseRpcOptions<'getCategoriesByPath', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data for a single category by its ID using the `getCategoryById` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/categories/get-a-category
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getCategoryById'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getCategoryById` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getCategoryById` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useCategoryById<DataT = NormalizedRpcResponse<'getCategoryById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryById'>>;
|
|
6
27
|
options: UseRpcOptions<'getCategoryById', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data for a single category by its path using the `getCategoryByPath` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/categories/get-a-category
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getCategoriesByPath'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getCategoryByPath` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getCategoryByPath` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useCategoryByPath<DataT = NormalizedRpcResponse<'getCategoryByPath'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }: {
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryByPath'>>;
|
|
6
27
|
options?: UseRpcOptions<'getCategoryByPath', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data of the current active promotion data using the `getCurrentPromotions` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options, and it uses the default shared cache
|
|
10
|
+
* implementation, getting data from Nuxt's payload or static data during hydration
|
|
11
|
+
* or from async data otherwise.
|
|
12
|
+
*
|
|
13
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/promotions/list-promotions
|
|
14
|
+
* @see https://scayle.dev/en/storefront-guide/developer-guide/basic-setup/rpc-methods#managing-shared-state-with-userpc
|
|
15
|
+
*
|
|
16
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getCurrentPromotions'>`.
|
|
17
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
18
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
19
|
+
*
|
|
20
|
+
* @param params An object containing parameters and options for the `getCurrentPromotions` RPC call.
|
|
21
|
+
* @param params.params The parameters for the `getCurrentPromotions` RPC method.
|
|
22
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
23
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
24
|
+
*
|
|
25
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
26
|
+
* loading state, and any error information.
|
|
27
|
+
*/
|
|
4
28
|
export declare function useCurrentPromotions<DataT = NormalizedRpcResponse<'getCurrentPromotions'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
29
|
params: MaybeRefOrGetter<RpcMethodParameters<'getCurrentPromotions'>>;
|
|
6
30
|
options: UseRpcOptions<'getCurrentPromotions', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves filter data using the `getFilters` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/filters/list-filters
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getFilters'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getFilters` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getFilters` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useFilters<DataT = NormalizedRpcResponse<'getFilters'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getFilters'>>;
|
|
6
27
|
options: UseRpcOptions<'getFilters', DataT, PickKeys, DefaultT>;
|
|
@@ -1,10 +1,52 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data of a single navigation tree using the `fetchNavigationTreeById` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/navigation/get-a-navigation
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getBrands'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `fetchNavigationTreeById` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `fetchNavigationTreeById` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useNavigationTreeById<DataT = NormalizedRpcResponse<'fetchNavigationTreeById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'fetchNavigationTreeById'>>;
|
|
6
27
|
options: UseRpcOptions<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
|
|
7
28
|
}>, key?: string): UseRpcReturn<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves data of a single navigation tree using the `fetchNavigationTreeByName` RPC method.
|
|
31
|
+
*
|
|
32
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
33
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
34
|
+
* with the provided parameters and options.
|
|
35
|
+
*
|
|
36
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/navigation/get-a-navigation
|
|
37
|
+
*
|
|
38
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getBrands'>`.
|
|
39
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
40
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
41
|
+
*
|
|
42
|
+
* @param params An object containing parameters and options for the `fetchNavigationTreeByName` RPC call.
|
|
43
|
+
* @param params.params The parameters for the `fetchNavigationTreeByName` RPC method.
|
|
44
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
45
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
46
|
+
*
|
|
47
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
48
|
+
* loading state, and any error information.
|
|
49
|
+
*/
|
|
8
50
|
export declare function useNavigationTreeByName<DataT = NormalizedRpcResponse<'fetchNavigationTreeById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
9
51
|
params: MaybeRefOrGetter<RpcMethodParameters<'fetchNavigationTreeByName'>>;
|
|
10
52
|
options: UseRpcOptions<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcReturn, UseRpcOptions, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data of all navigation trees using the `fetchAllNavigationTrees` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/navigation/list-navigations
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getBrands'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `fetchAllNavigationTrees` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `fetchAllNavigationTrees` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useNavigationTrees<DataT = NormalizedRpcResponse<'fetchAllNavigationTrees'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'fetchAllNavigationTrees'>>;
|
|
6
27
|
options: UseRpcOptions<'fetchAllNavigationTrees', DataT, PickKeys, DefaultT>;
|
|
@@ -7,6 +7,29 @@ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
|
7
7
|
product: P;
|
|
8
8
|
variant: V;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves order data by ID using the `getOrderById` RPC method.
|
|
12
|
+
*
|
|
13
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
14
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
15
|
+
* with the provided parameters and options.
|
|
16
|
+
* It allows for flexible typing of the `product` and `variant` properties within the order items.
|
|
17
|
+
*
|
|
18
|
+
* @see https://scayle.dev/en/api-guides/customer-account-api/resources/order/get-order
|
|
19
|
+
*
|
|
20
|
+
* @template P The type of the `product` property within the order items. Defaults to an object with any keys.
|
|
21
|
+
* @template V The type of the `variant` property within the order items. Defaults to an object with any keys.
|
|
22
|
+
* @template DataT The type of the transformed data. Defaults to `Order & { items?: NewItemsType<P, V>[] }`.
|
|
23
|
+
* @template PickKeys Keys of the `DataT` type that will be present. This defaults to all keys of DataT.
|
|
24
|
+
* @template DefaultT The default return type. Useful for showing loading skeletons. Defaults to `null`.
|
|
25
|
+
*
|
|
26
|
+
* @param params An object containing parameters and options for the `getOrderById` RPC call.
|
|
27
|
+
* @param params.params The parameters for the `getOrderById` RPC method.
|
|
28
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
29
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
30
|
+
*
|
|
31
|
+
* @returns An extended async data object containing the order data.
|
|
32
|
+
*/
|
|
10
33
|
export declare function useOrder<P = {
|
|
11
34
|
[k: string]: unknown;
|
|
12
35
|
}, V = {
|
|
@@ -7,6 +7,27 @@ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
|
7
7
|
product: P;
|
|
8
8
|
variant: V;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves order data by ID using the `getOrderDataByCbd RPC method.
|
|
12
|
+
*
|
|
13
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
14
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
15
|
+
* with the provided parameters and options.
|
|
16
|
+
* It allows for flexible typing of the `product` and `variant` properties within the order items.
|
|
17
|
+
*
|
|
18
|
+
* @template P The type of the `product` property within the order items. Defaults to an object with any keys.
|
|
19
|
+
* @template V The type of the `variant` property within the order items. Defaults to an object with any keys.
|
|
20
|
+
* @template DataT The type of the transformed data. Defaults to `Order & { items?: NewItemsType<P, V>[] }`.
|
|
21
|
+
* @template PickKeys Keys of the `DataT` type that will be present. This defaults to all keys of DataT.
|
|
22
|
+
* @template DefaultT The default return type. Useful for showing loading skeletons. Defaults to `null`.
|
|
23
|
+
*
|
|
24
|
+
* @param params An object containing parameters and options for the `getOrderDataByCbd RPC call.
|
|
25
|
+
* @param params.params The parameters for the `getOrderDataByCbd RPC method.
|
|
26
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
27
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
28
|
+
*
|
|
29
|
+
* @returns An extended async data object containing the order data.
|
|
30
|
+
*/
|
|
10
31
|
export declare function useOrderConfirmation<P = {
|
|
11
32
|
[k: string]: unknown;
|
|
12
33
|
}, V = {
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data for a single product by its ID using the `getProductById` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/products/get-a-product
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getProductById'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getProductById` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getProductById` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useProduct<DataT = NormalizedRpcResponse<'getProductById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getProductById'>>;
|
|
6
27
|
options: UseRpcOptions<'getProductById', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves product data by its category using the `getProductById` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/products/list-products
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getProductById'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getProductById` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getProductById` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useProducts<DataT = NormalizedRpcResponse<'getProductsByCategory'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByCategory'>>;
|
|
6
27
|
options: UseRpcOptions<'getProductsByCategory', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data of multiple products by their ID using the `getProductsByIds` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/products/list-products
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getProductsByIds'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getProductsByIds` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getProductsByIds` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useProductsByIds<DataT = NormalizedRpcResponse<'getProductsByIds'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByIds'>>;
|
|
6
27
|
options: UseRpcOptions<'getProductsByIds', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data of multiple products by their reference keys using the `getProductsByReferenceKeys` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/products/list-products
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getProductsByReferenceKeys'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getProductsByReferenceKeys` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getProductsByReferenceKeys` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function useProductsByReferenceKeys<DataT = NormalizedRpcResponse<'getProductsByReferenceKeys'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByReferenceKeys'>>;
|
|
6
27
|
options: UseRpcOptions<'getProductsByReferenceKeys', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves product count of a category by its ID using the `getProductsCount` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
* *
|
|
11
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getProductsCount'>`.
|
|
12
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
13
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
14
|
+
*
|
|
15
|
+
* @param params An object containing parameters and options for the `getProductsCount` RPC call.
|
|
16
|
+
* @param params.params The parameters for the `getProductsCount` RPC method.
|
|
17
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
18
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
19
|
+
*
|
|
20
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
21
|
+
* loading state, and any error information.
|
|
22
|
+
*/
|
|
4
23
|
export declare function useProductsCount<DataT = NormalizedRpcResponse<'getProductsCount'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
24
|
params: MaybeRefOrGetter<RpcMethodParameters<'getProductsCount'>>;
|
|
6
25
|
options: UseRpcOptions<'getProductsCount', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data for all available promotion using the `getPromotions` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/promotions/list-promotions
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getPromotions'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getPromotions` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getPromotions` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function usePromotions<DataT = NormalizedRpcResponse<'getPromotions'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getPromotions'>>;
|
|
6
27
|
options: UseRpcOptions<'getPromotions', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
2
|
import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves data for multiple promotions by their IDs using the `getPromotionsByIds` RPC method.
|
|
6
|
+
*
|
|
7
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
8
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
9
|
+
* with the provided parameters and options.
|
|
10
|
+
*
|
|
11
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/promotions/list-promotions
|
|
12
|
+
*
|
|
13
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getPromotionsByIds'>`.
|
|
14
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
15
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
16
|
+
*
|
|
17
|
+
* @param params An object containing parameters and options for the `getPromotionsByIds` RPC call.
|
|
18
|
+
* @param params.params The parameters for the `getPromotionsByIds` RPC method.
|
|
19
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
20
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
21
|
+
*
|
|
22
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
23
|
+
* loading state, and any error information.
|
|
24
|
+
*/
|
|
4
25
|
export declare function usePromotionsByIds<DataT = NormalizedRpcResponse<'getPromotionsByIds'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
5
26
|
params: MaybeRefOrGetter<RpcMethodParameters<'getPromotionsByIds'>>;
|
|
6
27
|
options: UseRpcOptions<'getPromotionsByIds', DataT, PickKeys, DefaultT>;
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves data about the current shop by its shopID using the `getShopConfiguration` RPC method.
|
|
4
|
+
*
|
|
5
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
6
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
7
|
+
* with the provided parameters and options.
|
|
8
|
+
*
|
|
9
|
+
* @see https://scayle.dev/en/api-guides/storefront-api/resources/shop-configuration/get-a-shop-configuration
|
|
10
|
+
*
|
|
11
|
+
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getShopConfiguration'>`.
|
|
12
|
+
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
|
|
13
|
+
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
|
|
14
|
+
*
|
|
15
|
+
* @param params An object containing parameters and options for the `getShopConfiguration` RPC call.
|
|
16
|
+
* @param params.params The parameters for the `getShopConfiguration` RPC method.
|
|
17
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
18
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
19
|
+
*
|
|
20
|
+
* @returns The result of the `useRpc` call, which includes the fetched data,
|
|
21
|
+
* loading state, and any error information.
|
|
22
|
+
*/
|
|
2
23
|
export declare function useShopConfiguration<DataT = NormalizedRpcResponse<'getShopConfiguration'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
|
|
3
24
|
options: UseRpcOptions<'getShopConfiguration', DataT, PickKeys, DefaultT>;
|
|
4
25
|
}>, key?: string): UseRpcReturn<'getShopConfiguration', DataT, PickKeys, DefaultT>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { SearchV2SuggestionsEndpointResponseData, SearchV2With } from '@scayle/storefront-core';
|
|
2
2
|
import type { Status } from '../core/useRpc.js';
|
|
3
3
|
import type { Ref } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Representation of options for the search composable.
|
|
6
|
+
*/
|
|
4
7
|
export type SearchOptions = Partial<{
|
|
5
8
|
params: Partial<{
|
|
6
9
|
categoryId: number;
|
|
@@ -9,7 +12,14 @@ export type SearchOptions = Partial<{
|
|
|
9
12
|
key: string;
|
|
10
13
|
}>;
|
|
11
14
|
/**
|
|
12
|
-
*
|
|
15
|
+
* A composable that provides a way to fetch and manage search suggestions and results.
|
|
16
|
+
*
|
|
17
|
+
* @deprecated `useStorefrontSearch` is deprecated. Consider using `useSearch` of `@scayle/storefront-search` instead.
|
|
18
|
+
*
|
|
19
|
+
* @param option - An object containing options for the search request.
|
|
20
|
+
* @param option.with - An object describing which data the returned suggestions/results should contain.
|
|
21
|
+
*
|
|
22
|
+
* @returns An object containing reactive data and computed properties for managing search results and suggestions.
|
|
13
23
|
*/
|
|
14
24
|
export declare function useStorefrontSearch(searchQuery: Ref<string>, { params }?: SearchOptions, key?: string): {
|
|
15
25
|
data: Ref<SearchV2SuggestionsEndpointResponseData | undefined, SearchV2SuggestionsEndpointResponseData | undefined>;
|