@scayle/storefront-core 7.44.0 → 7.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.
- package/CHANGELOG.md +39 -0
- package/dist/rpc/methods/basket/basket.d.ts +29 -17
- package/dist/rpc/methods/brands.d.ts +4 -4
- package/dist/rpc/methods/categories.d.ts +22 -19
- package/dist/rpc/methods/checkout/order.d.ts +3 -3
- package/dist/rpc/methods/checkout/shopUser.d.ts +3 -3
- package/dist/rpc/methods/checkout/shopUserAddresses.d.ts +2 -2
- package/dist/rpc/methods/navigationTrees.d.ts +3 -3
- package/dist/rpc/methods/products.d.ts +18 -9
- package/dist/rpc/methods/promotion.d.ts +4 -4
- package/dist/rpc/methods/search.d.ts +4 -5
- package/dist/rpc/methods/session.cjs +1 -2
- package/dist/rpc/methods/session.d.ts +18 -16
- package/dist/rpc/methods/session.mjs +1 -1
- package/dist/rpc/methods/shopConfiguration.d.ts +2 -2
- package/dist/rpc/methods/user.d.ts +8 -6
- package/dist/rpc/methods/variants.d.ts +2 -2
- package/dist/rpc/methods/wishlist.d.ts +11 -11
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 7.45.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Improve typing of RPC methods by using `satisfies` instead of assertions. The [`satisfies` operator](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html) validates that an expression matches a type without changing the type of that expression. For RPC methods it can be used to enforce that a function conforms to the spec of an RPC method, without affecting the more specific inferred type of the function.
|
|
8
|
+
|
|
9
|
+
You can use this pattern in your own custom RPC methods as well.
|
|
10
|
+
|
|
11
|
+
For example:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
export const custom: RpcHandler<{ shop: number }> = (
|
|
15
|
+
context: RpcContext,
|
|
16
|
+
) => {
|
|
17
|
+
return {
|
|
18
|
+
shop: context.shopId,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
export const custom = (
|
|
25
|
+
context: RpcContext,
|
|
26
|
+
) => {
|
|
27
|
+
return {
|
|
28
|
+
shop: context.shopId,
|
|
29
|
+
}
|
|
30
|
+
} satisfies RpcHandler<{ shop: number }>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In the first case, `custom` will be typed as `RpcHandler<{shop: number}>` or essentially a function takes no parameters and returns `{ shop: number } | Response<{shop: number}>`. In the second case, it will be typed as a function which takes no parameters and returns `{ shop: number }` which is more specific. The more specific typing may be useful if you are calling the custom RPC function as both a registered RPC method and regular function.
|
|
34
|
+
|
|
35
|
+
## 7.44.1
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @aboutyou/backbone@16.2.0
|
|
41
|
+
|
|
3
42
|
## 7.44.0
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AddOrUpdateItemError } from '@aboutyou/backbone/helpers/BapiClient';
|
|
2
|
+
import { AddOrUpdateItemType, BasketResponseData, BasketWithOptions, Product, Variant, RpcContext } from '../../../types';
|
|
2
3
|
import { ExistingItemHandling } from '../../../constants';
|
|
3
|
-
export declare const addItemToBasket:
|
|
4
|
-
existingItemHandling?:
|
|
5
|
-
with?: BasketWithOptions;
|
|
6
|
-
}, BasketResponseData<Product, Variant>>;
|
|
7
|
-
export declare const addItemsToBasket:
|
|
4
|
+
export declare const addItemToBasket: ({ variantId, promotionId, quantity, displayData, customData, existingItemHandling, itemGroup, with: _with, }: AddOrUpdateItemType & {
|
|
5
|
+
existingItemHandling?: 0 | 1 | 2 | 3 | undefined;
|
|
6
|
+
with?: BasketWithOptions | undefined;
|
|
7
|
+
}, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
8
|
+
export declare const addItemsToBasket: (params: {
|
|
8
9
|
items: AddOrUpdateItemType[];
|
|
9
10
|
existingItemHandling: ExistingItemHandling;
|
|
10
|
-
with?: BasketWithOptions;
|
|
11
|
-
considerItemGroupForUniqueness?: boolean;
|
|
12
|
-
}, BasketResponseData<Product, Variant>>;
|
|
13
|
-
export declare const getBasket:
|
|
14
|
-
export declare const removeItemFromBasket:
|
|
11
|
+
with?: BasketWithOptions | undefined;
|
|
12
|
+
considerItemGroupForUniqueness?: boolean | undefined;
|
|
13
|
+
}, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
14
|
+
export declare const getBasket: (options: BasketWithOptions | undefined, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
15
|
+
export declare const removeItemFromBasket: (options: {
|
|
15
16
|
itemKey: string;
|
|
16
|
-
with?: BasketWithOptions;
|
|
17
|
-
}, BasketResponseData<Product, Variant>>;
|
|
18
|
-
export declare const clearBasket:
|
|
19
|
-
export declare const mergeBaskets:
|
|
17
|
+
with?: BasketWithOptions | undefined;
|
|
18
|
+
}, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
19
|
+
export declare const clearBasket: (context: RpcContext) => Promise<boolean>;
|
|
20
|
+
export declare const mergeBaskets: ({ fromBasketKey, toBasketKey, with: _with }: {
|
|
20
21
|
fromBasketKey: string;
|
|
21
22
|
toBasketKey: string;
|
|
22
|
-
with?: BasketWithOptions;
|
|
23
|
-
},
|
|
23
|
+
with?: BasketWithOptions | undefined;
|
|
24
|
+
}, context: RpcContext) => Promise<{
|
|
25
|
+
type: "failure";
|
|
26
|
+
statusCode: number;
|
|
27
|
+
basket: BasketResponseData<Product, Variant>;
|
|
28
|
+
} | {
|
|
29
|
+
readonly type: "success";
|
|
30
|
+
readonly basket: BasketResponseData<Product, Variant>;
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: "failure";
|
|
33
|
+
readonly basket: BasketResponseData<Product, Variant>;
|
|
34
|
+
readonly errors: AddOrUpdateItemError[];
|
|
35
|
+
} | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Brand, BrandsEndpointRequestParameters, BrandsEndpointResponseData
|
|
2
|
-
export declare const getBrands:
|
|
3
|
-
export declare const getBrandById:
|
|
1
|
+
import { Brand, BrandsEndpointRequestParameters, BrandsEndpointResponseData } from '../../types';
|
|
2
|
+
export declare const getBrands: ({ pagination }: BrandsEndpointRequestParameters, { bapiClient, cached }: import("../../types").RpcContext) => Promise<BrandsEndpointResponseData>;
|
|
3
|
+
export declare const getBrandById: ({ brandId }: {
|
|
4
4
|
brandId: number;
|
|
5
|
-
}, Brand>;
|
|
5
|
+
}, { bapiClient, cached }: import("../../types").RpcContext) => Promise<Brand>;
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import { Category
|
|
2
|
-
export declare const getRootCategories:
|
|
3
|
-
children?: number;
|
|
4
|
-
includeHidden?: true;
|
|
5
|
-
}, {
|
|
1
|
+
import { Category } from '../../types';
|
|
2
|
+
export declare const getRootCategories: ({ children, includeHidden }: {
|
|
3
|
+
children?: number | undefined;
|
|
4
|
+
includeHidden?: true | undefined;
|
|
5
|
+
}, { cached, bapiClient }: import("../../types").RpcContext) => Promise<{
|
|
6
6
|
categories: Category[];
|
|
7
7
|
activeNode: undefined;
|
|
8
8
|
}>;
|
|
9
|
-
export declare const getCategoryByPath:
|
|
9
|
+
export declare const getCategoryByPath: ({ path, children, includeHidden }: {
|
|
10
10
|
path: string;
|
|
11
|
-
children?: number;
|
|
12
|
-
includeHidden?: true;
|
|
13
|
-
},
|
|
14
|
-
export declare const getCategoriesByPath:
|
|
11
|
+
children?: number | undefined;
|
|
12
|
+
includeHidden?: true | undefined;
|
|
13
|
+
}, context: import("../../types").RpcContext) => Promise<Category>;
|
|
14
|
+
export declare const getCategoriesByPath: ({ path, children, includeHidden }: {
|
|
15
15
|
path: string;
|
|
16
|
-
children?: number;
|
|
17
|
-
includeHidden?: true;
|
|
18
|
-
}, {
|
|
19
|
-
categories: Category[]
|
|
20
|
-
activeNode:
|
|
16
|
+
children?: number | undefined;
|
|
17
|
+
includeHidden?: true | undefined;
|
|
18
|
+
}, context: import("../../types").RpcContext) => Promise<{
|
|
19
|
+
categories: Category[];
|
|
20
|
+
activeNode: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
categories: Category;
|
|
23
|
+
activeNode: Category;
|
|
21
24
|
}>;
|
|
22
|
-
export declare const getCategoryById:
|
|
25
|
+
export declare const getCategoryById: ({ id, children, includeHidden }: {
|
|
23
26
|
id: number;
|
|
24
|
-
children?: number;
|
|
25
|
-
includeHidden?: true;
|
|
26
|
-
}, Category>;
|
|
27
|
+
children?: number | undefined;
|
|
28
|
+
includeHidden?: true | undefined;
|
|
29
|
+
}, context: import("../../types").RpcContext) => Promise<Category>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Order
|
|
2
|
-
export declare const getOrderById:
|
|
1
|
+
import { Order } from '../../../types';
|
|
2
|
+
export declare const getOrderById: ({ orderId }: {
|
|
3
3
|
orderId: number;
|
|
4
|
-
}, Order>;
|
|
4
|
+
}, context: import("../../../types").RpcContext) => Promise<Order>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { UpdatePasswordParams,
|
|
2
|
-
export declare const updateShopUser:
|
|
1
|
+
import type { UpdatePasswordParams, ShopUser } from '../../../types';
|
|
2
|
+
export declare const updateShopUser: (payload: Partial<ShopUser>, context: import("../../../types").RpcContext) => Promise<{
|
|
3
3
|
user: ShopUser;
|
|
4
4
|
}>;
|
|
5
|
-
export declare const updatePassword:
|
|
5
|
+
export declare const updatePassword: ({ oldPassword, newPassword }: UpdatePasswordParams, context: import("../../../types").RpcContext) => Promise<{
|
|
6
6
|
user: ShopUser | undefined;
|
|
7
7
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const getShopUserAddresses:
|
|
1
|
+
import type { ShopUserAddress } from '../../../types';
|
|
2
|
+
declare const getShopUserAddresses: (context: import("../../../types").RpcContext) => Promise<ShopUserAddress[]>;
|
|
3
3
|
export { getShopUserAddresses };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NavigationTree } from '@aboutyou/backbone/types/navigation';
|
|
2
2
|
import type { NavigationAllEndpointResponseData } from '@aboutyou/backbone/endpoints/navigation/navigation';
|
|
3
|
-
import { FetchNavigationTreesParams, FetchNavigationTreeByIdParams
|
|
4
|
-
export declare const fetchAllNavigationTrees:
|
|
5
|
-
export declare const fetchNavigationTreeById:
|
|
3
|
+
import { FetchNavigationTreesParams, FetchNavigationTreeByIdParams } from '../../types';
|
|
4
|
+
export declare const fetchAllNavigationTrees: ({ params }: FetchNavigationTreesParams, { bapiClient: { navigation }, cached }: import("../../types").RpcContext) => Promise<NavigationAllEndpointResponseData>;
|
|
5
|
+
export declare const fetchNavigationTreeById: ({ treeId, params }: FetchNavigationTreeByIdParams, { bapiClient: { navigation }, cached }: import("../../types").RpcContext) => Promise<NavigationTree>;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { FiltersEndpointResponseData } from '@aboutyou/backbone/endpoints/filters/filters';
|
|
2
|
+
import { FetchFiltersParams, FetchProductParams, FetchProductsByCategoryParams, FetchProductsCountParams, FetchProductsParams, Product, RpcContext } from '../../types';
|
|
3
|
+
export declare const getProductById: (options: FetchProductParams, { bapiClient, cached, campaignKey, withParams }: RpcContext) => Promise<Product>;
|
|
4
|
+
export declare const getProductsByIds: (options: FetchProductsParams, { bapiClient, cached, campaignKey, withParams }: RpcContext) => Promise<Product[]>;
|
|
5
|
+
export declare const getProductsByCategory: ({ category, cache, with: _with, perPage, page, where, sort, pricePromotionKey, includeSellableForFree, includeSoldOut, orFiltersOperator, }: FetchProductsByCategoryParams, context: RpcContext) => Promise<{
|
|
6
|
+
products: Product[];
|
|
7
|
+
pagination: import("@aboutyou/backbone/endpoints/products/productsByIds").Pagination;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getFilters: ({ category, includedFilters, where, includeSoldOut, includeSellableForFree, orFiltersOperator, }: FetchFiltersParams, context: RpcContext) => Promise<{
|
|
10
|
+
filters: FiltersEndpointResponseData;
|
|
11
|
+
unfilteredCount: number;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const fetchAllFiltersForCategory: ({ includedFilters, category }: {
|
|
14
|
+
includedFilters?: string[] | undefined;
|
|
8
15
|
category: {
|
|
9
16
|
slug: string;
|
|
10
17
|
id: number;
|
|
11
18
|
};
|
|
12
|
-
}, string[]>;
|
|
13
|
-
export declare const getProductsCount:
|
|
19
|
+
}, { cached, bapiClient, campaignKey }: RpcContext) => Promise<string[]>;
|
|
20
|
+
export declare const getProductsCount: ({ category, categoryId, where, includeSoldOut, includeSellableForFree, orFiltersOperator, }: FetchProductsCountParams, { cached, bapiClient, campaignKey }: RpcContext) => Promise<{
|
|
21
|
+
count: number;
|
|
22
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getPromotions:
|
|
3
|
-
export declare const getCurrentPromotions:
|
|
4
|
-
export declare const getPromotionsByIds:
|
|
1
|
+
import { PromotionsParams, PromotionsResponseData } from '../../types';
|
|
2
|
+
export declare const getPromotions: (params: Omit<PromotionsParams, "ids"> | undefined, context: import("../../types").RpcContext) => Promise<PromotionsResponseData>;
|
|
3
|
+
export declare const getCurrentPromotions: (params: Omit<PromotionsParams, "ids" | "activeAt"> | undefined, context: import("../../types").RpcContext) => Promise<PromotionsResponseData>;
|
|
4
|
+
export declare const getPromotionsByIds: (ids: string[], context: import("../../types").RpcContext) => Promise<PromotionsResponseData>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { TypeaheadSuggestionsEndpointRequestParameters, TypeaheadSuggestionsEndpointResponseData } from '@aboutyou/backbone/endpoints/typeahead/typeahead';
|
|
2
|
-
import { RpcHandler } from '../../types';
|
|
3
2
|
type SearchWith = TypeaheadSuggestionsEndpointRequestParameters['with'];
|
|
4
|
-
export declare const searchProducts:
|
|
3
|
+
export declare const searchProducts: ({ term, slug, with: _with, productLimit }: {
|
|
5
4
|
term: string;
|
|
6
|
-
slug?: string;
|
|
5
|
+
slug?: string | undefined;
|
|
7
6
|
with?: SearchWith;
|
|
8
|
-
productLimit?: number;
|
|
9
|
-
}, TypeaheadSuggestionsEndpointResponseData>;
|
|
7
|
+
productLimit?: number | undefined;
|
|
8
|
+
}, { cached, bapiClient, withParams }: import("../../types").RpcContext) => Promise<TypeaheadSuggestionsEndpointResponseData>;
|
|
10
9
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.updatePasswordByHash = exports.refreshAccessToken = exports.oauthRevokeToken = exports.oauthRegister = exports.oauthLogin = exports.oauthGuestLogin = exports.oauthForgetPassword =
|
|
6
|
+
exports.updatePasswordByHash = exports.refreshAccessToken = exports.oauthRevokeToken = exports.oauthRegister = exports.oauthLogin = exports.oauthGuestLogin = exports.oauthForgetPassword = void 0;
|
|
7
7
|
var _jose = require("jose");
|
|
8
8
|
var _types = require("../../types/index.cjs");
|
|
9
9
|
var _constants = require("../../constants/index.cjs");
|
|
@@ -19,7 +19,6 @@ const convertErrorForRpcCall = (error, httpStatuses) => {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
exports.convertErrorForRpcCall = convertErrorForRpcCall;
|
|
23
22
|
async function postLogin(context, tokens) {
|
|
24
23
|
const user = await (0, _response.unwrap)((0, _user2.fetchUser)({
|
|
25
24
|
accessToken: tokens.access_token,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import type { Optional } from 'utility-types';
|
|
2
|
-
import type { GuestRequest, LoginRequest,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const refreshAccessToken: RpcHandler<{
|
|
11
|
-
success: boolean;
|
|
2
|
+
import type { GuestRequest, LoginRequest, RegisterRequest, RpcContext, UpdatePasswordByHashRequest } from '../../types';
|
|
3
|
+
export declare const oauthLogin: (login: Optional<LoginRequest, "shop_id">, context: RpcContext) => Promise<Response>;
|
|
4
|
+
export declare const oauthRegister: (register: Optional<RegisterRequest, "shop_id">, context: RpcContext) => Promise<Response>;
|
|
5
|
+
export declare const oauthGuestLogin: (guest: Optional<GuestRequest, "shop_id">, context: RpcContext) => Promise<Response>;
|
|
6
|
+
export declare const refreshAccessToken: (context: RpcContext) => Promise<Response | {
|
|
7
|
+
success: true;
|
|
8
|
+
} | {
|
|
9
|
+
success: false;
|
|
12
10
|
}>;
|
|
13
|
-
export declare const oauthRevokeToken:
|
|
14
|
-
result:
|
|
11
|
+
export declare const oauthRevokeToken: (context: RpcContext) => Promise<Response | {
|
|
12
|
+
result: true;
|
|
13
|
+
} | {
|
|
14
|
+
result: false;
|
|
15
15
|
}>;
|
|
16
|
-
export declare const oauthForgetPassword:
|
|
16
|
+
export declare const oauthForgetPassword: ({ email }: {
|
|
17
17
|
email: string;
|
|
18
|
-
}, {
|
|
19
|
-
success:
|
|
18
|
+
}, context: RpcContext) => Promise<Response | {
|
|
19
|
+
success: true;
|
|
20
|
+
} | {
|
|
21
|
+
success: false;
|
|
20
22
|
}>;
|
|
21
|
-
export declare const updatePasswordByHash:
|
|
23
|
+
export declare const updatePasswordByHash: (passwordHash: Optional<UpdatePasswordByHashRequest, "shop_id">, context: RpcContext) => Promise<Response>;
|
|
@@ -6,7 +6,7 @@ import { mergeBaskets, mergeWishlists } from "../../utils/user.mjs";
|
|
|
6
6
|
import { fetchUser } from "../../rpc/methods/user.mjs";
|
|
7
7
|
import { unwrap } from "../../utils/response.mjs";
|
|
8
8
|
import { getOAuthClient } from "../../api/oauth.mjs";
|
|
9
|
-
|
|
9
|
+
const convertErrorForRpcCall = (error, httpStatuses) => {
|
|
10
10
|
if (error instanceof FetchError && httpStatuses.includes(error.response.status)) {
|
|
11
11
|
return new Response(null, { status: error.response.status });
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ShopConfigurationResponseData } from '@aboutyou/backbone/endpoints/shopconfiguration/shopconfiguration';
|
|
2
|
-
import {
|
|
3
|
-
declare const getShopConfiguration:
|
|
2
|
+
import { RpcContext } from '../../types';
|
|
3
|
+
declare const getShopConfiguration: ({ cached, bapiClient }: RpcContext) => Promise<ShopConfigurationResponseData>;
|
|
4
4
|
export { getShopConfiguration };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { AuthConfig,
|
|
2
|
-
declare const getUser:
|
|
1
|
+
import type { AuthConfig, RpcContext, ShopUser } from '../../types';
|
|
2
|
+
declare const getUser: (context: RpcContext) => {
|
|
3
3
|
user: ShopUser | undefined;
|
|
4
|
-
}
|
|
5
|
-
declare const fetchUser:
|
|
4
|
+
};
|
|
5
|
+
declare const fetchUser: (payload: AuthConfig, context: RpcContext) => Promise<ShopUser>;
|
|
6
6
|
/**
|
|
7
7
|
* This function adds a way to force fetch the user from checkout.
|
|
8
8
|
* In case the user is not logged in any longer the session will be destroyed and the returned user will be undefined.
|
|
9
9
|
* @param context
|
|
10
10
|
* @returns ShopUser
|
|
11
11
|
*/
|
|
12
|
-
declare const refreshUser:
|
|
13
|
-
user:
|
|
12
|
+
declare const refreshUser: (context: RpcContext) => Promise<{
|
|
13
|
+
user: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
user: ShopUser;
|
|
14
16
|
}>;
|
|
15
17
|
export { getUser, fetchUser, refreshUser };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ProductWith } from '@aboutyou/backbone';
|
|
2
2
|
import type { VariantDetail } from '@aboutyou/backbone/endpoints/variants/variantsByIds';
|
|
3
|
-
import {
|
|
3
|
+
import { RpcContext } from '../../types';
|
|
4
4
|
export interface FetchVariantsParams {
|
|
5
5
|
ids: number[];
|
|
6
6
|
include?: ProductWith;
|
|
7
7
|
pricePromotionKey?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const getVariantById:
|
|
9
|
+
export declare const getVariantById: ({ ids, include, pricePromotionKey }: FetchVariantsParams, { bapiClient, cached, campaignKey, withParams }: RpcContext) => Promise<VariantDetail[]>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { WishlistResponseData } from '@aboutyou/backbone/endpoints/wishlist/getWishlist';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const addItemToWishlist:
|
|
4
|
-
variantId?: number;
|
|
5
|
-
productId?: number;
|
|
6
|
-
with?: WishlistWithOptions;
|
|
7
|
-
}, WishlistResponseData | Response>;
|
|
8
|
-
export declare const getWishlist:
|
|
9
|
-
export declare const removeItemFromWishlist:
|
|
2
|
+
import type { RpcContext, WishlistWithOptions } from '../../types';
|
|
3
|
+
export declare const addItemToWishlist: (options: {
|
|
4
|
+
variantId?: number | undefined;
|
|
5
|
+
productId?: number | undefined;
|
|
6
|
+
with?: WishlistWithOptions | undefined;
|
|
7
|
+
}, context: RpcContext) => Promise<WishlistResponseData | Response>;
|
|
8
|
+
export declare const getWishlist: (options: WishlistWithOptions | undefined, context: RpcContext) => Promise<WishlistResponseData>;
|
|
9
|
+
export declare const removeItemFromWishlist: (options: {
|
|
10
10
|
itemKey: string;
|
|
11
|
-
with?: WishlistWithOptions;
|
|
12
|
-
},
|
|
13
|
-
export declare const clearWishlist:
|
|
11
|
+
with?: WishlistWithOptions | undefined;
|
|
12
|
+
}, context: RpcContext) => Promise<WishlistResponseData>;
|
|
13
|
+
export declare const clearWishlist: (context: RpcContext) => Promise<WishlistResponseData>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.45.0",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@aboutyou/backbone": "16.
|
|
62
|
+
"@aboutyou/backbone": "16.2.0",
|
|
63
63
|
"crypto-js": "4.2.0",
|
|
64
|
-
"jose": "5.2.
|
|
65
|
-
"radash": "12.
|
|
64
|
+
"jose": "5.2.3",
|
|
65
|
+
"radash": "12.1.0",
|
|
66
66
|
"slugify": "1.6.6",
|
|
67
67
|
"ufo": "1.4.0",
|
|
68
68
|
"uncrypto": "0.1.3",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@scayle/eslint-config-storefront": "3.2.6",
|
|
73
73
|
"@types/crypto-js": "4.2.2",
|
|
74
|
-
"@types/node": "20.11.
|
|
74
|
+
"@types/node": "20.11.28",
|
|
75
75
|
"@types/webpack-env": "1.18.4",
|
|
76
76
|
"@vitest/coverage-v8": "1.3.1",
|
|
77
77
|
"dprint": "0.45.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"publint": "0.2.7",
|
|
81
81
|
"rimraf": "5.0.5",
|
|
82
82
|
"ts-node": "10.9.2",
|
|
83
|
-
"typescript": "5.
|
|
83
|
+
"typescript": "5.4.2",
|
|
84
84
|
"unbuild": "2.0.0",
|
|
85
85
|
"unstorage": "1.10.1",
|
|
86
86
|
"vitest": "1.3.1"
|