@scayle/storefront-core 7.58.1 → 7.58.3
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 +15 -0
- package/dist/api/oauth.cjs +2 -1
- package/dist/api/oauth.d.ts +1 -1
- package/dist/api/oauth.mjs +2 -1
- package/dist/helpers/attributeHelpers.d.ts +1 -1
- package/dist/helpers/filterHelper.d.ts +4 -4
- package/dist/helpers/imageHelpers.d.ts +1 -1
- package/dist/helpers/localization.cjs +1 -1
- package/dist/helpers/localization.mjs +1 -1
- package/dist/helpers/orderHelpers.d.ts +36 -36
- package/dist/helpers/productHelpers.d.ts +2 -2
- package/dist/rpc/methods/basket/basket.d.ts +5 -5
- package/dist/rpc/methods/categories.d.ts +12 -12
- package/dist/rpc/methods/checkout/checkout.cjs +1 -1
- package/dist/rpc/methods/checkout/checkout.mjs +1 -1
- package/dist/rpc/methods/products.d.ts +1 -1
- package/dist/rpc/methods/search.d.ts +2 -2
- package/dist/rpc/methods/session.cjs +1 -1
- package/dist/rpc/methods/session.mjs +1 -1
- package/dist/rpc/methods/user.d.ts +1 -1
- package/dist/rpc/methods/wishlist.d.ts +9 -9
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 7.58.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Upgrades to the new Wishlist from @scayle/storefront-api
|
|
8
|
+
- `getDefaultFractionDigits` will return 2 if `maximumFractionDigits` is not defined
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @scayle/storefront-api@17.3.0
|
|
11
|
+
|
|
12
|
+
## 7.58.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Adds the `X-Shop-Id` header to the request when revoking an access token.
|
|
17
|
+
|
|
3
18
|
## 7.58.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/api/oauth.cjs
CHANGED
|
@@ -168,13 +168,14 @@ class OAuthClient {
|
|
|
168
168
|
* Revoke an access token
|
|
169
169
|
* @param accessToken
|
|
170
170
|
*/
|
|
171
|
-
async revokeToken(accessToken) {
|
|
171
|
+
async revokeToken(shopId, accessToken) {
|
|
172
172
|
this.logger?.debug("Revoking access token");
|
|
173
173
|
const decodedAccessToken = (0, _jose.decodeJwt)(accessToken);
|
|
174
174
|
await fetch(`${this.baseURL}/oauth/tokens/${decodedAccessToken.jti}`, {
|
|
175
175
|
method: "DELETE",
|
|
176
176
|
headers: {
|
|
177
177
|
...this.headers,
|
|
178
|
+
"X-Shop-Id": `${shopId}`,
|
|
178
179
|
Authorization: `Bearer ${accessToken}`
|
|
179
180
|
}
|
|
180
181
|
}).then(emptyOAuthResponseHandler);
|
package/dist/api/oauth.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare class OAuthClient {
|
|
|
62
62
|
* Revoke an access token
|
|
63
63
|
* @param accessToken
|
|
64
64
|
*/
|
|
65
|
-
revokeToken(accessToken: string): Promise<void>;
|
|
65
|
+
revokeToken(shopId: number, accessToken: string): Promise<void>;
|
|
66
66
|
/**
|
|
67
67
|
* Revoke all tokens for a user
|
|
68
68
|
* @param userId
|
package/dist/api/oauth.mjs
CHANGED
|
@@ -153,13 +153,14 @@ export class OAuthClient {
|
|
|
153
153
|
* Revoke an access token
|
|
154
154
|
* @param accessToken
|
|
155
155
|
*/
|
|
156
|
-
async revokeToken(accessToken) {
|
|
156
|
+
async revokeToken(shopId, accessToken) {
|
|
157
157
|
this.logger?.debug("Revoking access token");
|
|
158
158
|
const decodedAccessToken = decodeJwt(accessToken);
|
|
159
159
|
await fetch(`${this.baseURL}/oauth/tokens/${decodedAccessToken.jti}`, {
|
|
160
160
|
method: "DELETE",
|
|
161
161
|
headers: {
|
|
162
162
|
...this.headers,
|
|
163
|
+
"X-Shop-Id": `${shopId}`,
|
|
163
164
|
Authorization: `Bearer ${accessToken}`
|
|
164
165
|
}
|
|
165
166
|
}).then(emptyOAuthResponseHandler);
|
|
@@ -2,4 +2,4 @@ import type { Attributes } from '@scayle/storefront-api';
|
|
|
2
2
|
export declare const getFirstAttributeValue: (attributes: Attributes | undefined, attributeName: string) => import("@scayle/storefront-api").Value | undefined;
|
|
3
3
|
export declare const getAttributeValue: (attributes: Attributes | undefined, attributeName: string) => string | undefined;
|
|
4
4
|
export declare const getAttributeValueTuples: (attributes: Attributes | undefined, attributeName: string) => import("@scayle/storefront-api").Value[];
|
|
5
|
-
export declare const getManyAttributeValueTuples: (attributes: Attributes | undefined, attributeNames: string[]) =>
|
|
5
|
+
export declare const getManyAttributeValueTuples: (attributes: Attributes | undefined, attributeNames: string[]) => import("@scayle/storefront-api").Value[];
|
|
@@ -8,9 +8,9 @@ export interface TransformedFilter {
|
|
|
8
8
|
whereCondition: Record<string, any>;
|
|
9
9
|
}
|
|
10
10
|
export declare const transformToWhereCondition: (conditions: Record<string, any>) => {
|
|
11
|
-
minPrice?: ProductSearchQuery[
|
|
12
|
-
maxPrice?: ProductSearchQuery[
|
|
13
|
-
attributes: ProductSearchQuery[
|
|
11
|
+
minPrice?: ProductSearchQuery["minPrice"];
|
|
12
|
+
maxPrice?: ProductSearchQuery["maxPrice"];
|
|
13
|
+
attributes: ProductSearchQuery["attributes"];
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Compute an array of filters that can be used to render the quick filters, for example.
|
|
@@ -68,7 +68,7 @@ export declare const transformSortToFilter: (sort: string) => {
|
|
|
68
68
|
export declare const getGroupedFilterableValues: (keys: Array<string>, filterableValues: ProductFilter[], { sortable }?: {
|
|
69
69
|
sortable: boolean;
|
|
70
70
|
}) => Record<string, TransformedFilter[]>;
|
|
71
|
-
export declare const getFilterablePriceValue: (filterableValues: Record<string, any>, key?:
|
|
71
|
+
export declare const getFilterablePriceValue: (filterableValues: Record<string, any>, key?: "min" | "max") => any;
|
|
72
72
|
export type SerializedFilter = Record<string, string>;
|
|
73
73
|
export type Filter = Record<string, string | number | (string | number | null)[]>;
|
|
74
74
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ProductImageType } from '../constants/product';
|
|
2
2
|
import type { Product, ProductImage } from '../index';
|
|
3
3
|
export declare function isImageType(type: ProductImageType, image: ProductImage): boolean;
|
|
4
|
-
export declare const getImageFromList: (images: Product[
|
|
4
|
+
export declare const getImageFromList: (images: Product["images"], imageType: string, imageView: string, fallback?: boolean) => ProductImage | null;
|
|
@@ -8,6 +8,6 @@ const getDefaultFractionDigits = (locale, currency) => {
|
|
|
8
8
|
return new Intl.NumberFormat(locale, {
|
|
9
9
|
style: "currency",
|
|
10
10
|
currency
|
|
11
|
-
}).resolvedOptions().maximumFractionDigits;
|
|
11
|
+
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
12
12
|
};
|
|
13
13
|
exports.getDefaultFractionDigits = getDefaultFractionDigits;
|
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
import type { Order } from '../types';
|
|
2
2
|
export declare const getUniqueItemsFromOrder: (order: Order) => {
|
|
3
|
-
id?:
|
|
4
|
-
availableQuantity?:
|
|
5
|
-
currency?:
|
|
3
|
+
id?: import("../types").UniqueNumericIdentifierOfTheItem;
|
|
4
|
+
availableQuantity?: import("../types").AvailableQuantityInTheWarehouse;
|
|
5
|
+
currency?: import("../types").CharacterCurrencyCode1;
|
|
6
6
|
customData?: {
|
|
7
7
|
[k: string]: unknown;
|
|
8
|
-
}
|
|
9
|
-
deliveryForecast?: import("../types").DeliveryForecastFromWarehouse
|
|
10
|
-
isManuallyReturnedByCci?:
|
|
11
|
-
itemGroup?: {
|
|
8
|
+
};
|
|
9
|
+
deliveryForecast?: import("../types").DeliveryForecastFromWarehouse;
|
|
10
|
+
isManuallyReturnedByCci?: import("../types").TheReturnShipmentHasBeenTriggeredByCCI;
|
|
11
|
+
itemGroup?: null | {
|
|
12
12
|
id: string;
|
|
13
13
|
isMainItem: boolean;
|
|
14
14
|
isRequired: boolean;
|
|
15
|
-
}
|
|
16
|
-
key:
|
|
17
|
-
lowestPriorPrice?: {
|
|
15
|
+
};
|
|
16
|
+
key: import("../types").UniqueIdentifierOfTheItem;
|
|
17
|
+
lowestPriorPrice?: null | {
|
|
18
18
|
relativeDifferenceToPrice: number;
|
|
19
19
|
withTax: number;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
merchant?: {
|
|
22
|
-
[k: string]: unknown;
|
|
23
22
|
id: number;
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
packageId: import("../types").PackageReference;
|
|
26
26
|
price: {
|
|
27
27
|
appliedReductions?: {
|
|
28
28
|
amount: {
|
|
29
|
-
absoluteWithTax:
|
|
29
|
+
absoluteWithTax: import("../types").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
|
|
30
30
|
relative: number;
|
|
31
31
|
};
|
|
32
|
-
category: "
|
|
33
|
-
code?: string
|
|
34
|
-
type: "
|
|
35
|
-
}[]
|
|
36
|
-
overrideWithoutTax?: number
|
|
37
|
-
overrideWithTax?: number
|
|
32
|
+
category: "sale" | "campaign" | "voucher";
|
|
33
|
+
code?: string;
|
|
34
|
+
type: "relative" | "absolute";
|
|
35
|
+
}[];
|
|
36
|
+
overrideWithoutTax?: number;
|
|
37
|
+
overrideWithTax?: number;
|
|
38
38
|
reference?: {
|
|
39
|
-
size?: string
|
|
40
|
-
unit?: string
|
|
41
|
-
withTax?: number
|
|
42
|
-
}
|
|
39
|
+
size?: string;
|
|
40
|
+
unit?: string;
|
|
41
|
+
withTax?: number;
|
|
42
|
+
};
|
|
43
43
|
tax: {
|
|
44
44
|
[k: string]: {
|
|
45
|
-
amount:
|
|
46
|
-
rate:
|
|
45
|
+
amount: import("../types").AbsoluteValueOfTheAppliedTax1;
|
|
46
|
+
rate: import("../types").RelativeValueOfTheAppliedTax;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
undiscountedWithOutTax?:
|
|
50
|
-
undiscountedWithTax?:
|
|
51
|
-
withoutTax:
|
|
52
|
-
withTax:
|
|
49
|
+
undiscountedWithOutTax?: import("../types").UndiscountedItemPriceExcludingTaxes;
|
|
50
|
+
undiscountedWithTax?: import("../types").UndiscountedItemPriceIncludingTaxes;
|
|
51
|
+
withoutTax: import("../types").ItemPriceExcludingTaxes1;
|
|
52
|
+
withTax: import("../types").ItemPriceIncludingTaxes1;
|
|
53
53
|
};
|
|
54
54
|
product: {
|
|
55
55
|
[k: string]: unknown;
|
|
56
56
|
};
|
|
57
|
-
reservationKey?: string
|
|
57
|
+
reservationKey?: string;
|
|
58
58
|
status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
|
|
59
59
|
variant: {
|
|
60
60
|
[k: string]: unknown;
|
|
61
61
|
};
|
|
62
|
-
warehouseId?: import("../types").PickingWarehouseId
|
|
63
|
-
warehousePackageGroupId?: import("../types").WarehousePackageReference
|
|
64
|
-
createdAt:
|
|
65
|
-
updatedAt:
|
|
62
|
+
warehouseId?: import("../types").PickingWarehouseId;
|
|
63
|
+
warehousePackageGroupId?: import("../types").WarehousePackageReference;
|
|
64
|
+
createdAt: import("../types").TimestampOfItemCreation;
|
|
65
|
+
updatedAt: import("../types").TimestampOfLastItemUpdate;
|
|
66
66
|
}[] | undefined;
|
|
67
67
|
export declare const getItemQuantityFromOrder: (order: Order, variantId: number) => number | undefined;
|
|
@@ -26,7 +26,7 @@ export declare const getTotalAppliedReductions: (price: {
|
|
|
26
26
|
relative: number;
|
|
27
27
|
};
|
|
28
28
|
export declare const getLowestPrice: (variants: Variant[]) => VariantPrice;
|
|
29
|
-
export declare const getAppliedReductionsByCategory: (price: VariantPrice | BasketItemPrice, category: AppliedReduction[
|
|
29
|
+
export declare const getAppliedReductionsByCategory: (price: VariantPrice | BasketItemPrice, category: AppliedReduction["category"]) => AppliedReduction[];
|
|
30
30
|
export declare const getSizeFromVariant: (variant: Variant, attributeName?: string) => Value | undefined;
|
|
31
31
|
export declare const getSizeFromSpecificVariant: (product: Product, variantId?: number) => Value | null | undefined;
|
|
32
32
|
export declare const getVariant: (variants: Variant[], id: number) => Variant | undefined;
|
|
@@ -39,7 +39,7 @@ export declare const isVariantInStock: (variants: Variant[], size: Value, sizeAt
|
|
|
39
39
|
export declare const getAttribute: (product: Product, key: string) => any;
|
|
40
40
|
export declare const getProductPath: (product: Product) => string;
|
|
41
41
|
export declare const getCategoriesByRoute: (product: Product | null, route: Route | null) => import("@scayle/storefront-api").ProductCategory[];
|
|
42
|
-
export declare const getLatestCategory: (categories?: Product[
|
|
42
|
+
export declare const getLatestCategory: (categories?: Product["categories"]) => import("@scayle/storefront-api").ProductCategory | undefined;
|
|
43
43
|
export declare const getProductAndSiblingsColors: (product: Product, colorAttributeName?: string) => Value[];
|
|
44
44
|
export declare const getVariantCrosssellingValues: (variants: Variant[] | undefined) => (string | number)[];
|
|
45
45
|
export {};
|
|
@@ -2,24 +2,24 @@ import type { AddOrUpdateItemError } from '@scayle/storefront-api';
|
|
|
2
2
|
import type { AddOrUpdateItemType, BasketResponseData, BasketWithOptions, Product, RpcContext, Variant } from '../../../types';
|
|
3
3
|
import { ExistingItemHandling } from '../../../constants';
|
|
4
4
|
export declare const addItemToBasket: ({ variantId, promotionId, quantity, displayData, customData, existingItemHandling, itemGroup, with: _with, }: AddOrUpdateItemType & {
|
|
5
|
-
existingItemHandling?:
|
|
6
|
-
with?: BasketWithOptions
|
|
5
|
+
existingItemHandling?: ExistingItemHandling;
|
|
6
|
+
with?: BasketWithOptions;
|
|
7
7
|
}, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
8
8
|
export declare const addItemsToBasket: (params: {
|
|
9
9
|
items: AddOrUpdateItemType[];
|
|
10
10
|
existingItemHandling: ExistingItemHandling;
|
|
11
|
-
with?: BasketWithOptions
|
|
11
|
+
with?: BasketWithOptions;
|
|
12
12
|
}, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
13
13
|
export declare const getBasket: (options: BasketWithOptions | undefined, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
14
14
|
export declare const removeItemFromBasket: (options: {
|
|
15
15
|
itemKey: string;
|
|
16
|
-
with?: BasketWithOptions
|
|
16
|
+
with?: BasketWithOptions;
|
|
17
17
|
}, context: RpcContext) => Promise<BasketResponseData<Product, Variant>>;
|
|
18
18
|
export declare const clearBasket: (context: RpcContext) => Promise<boolean>;
|
|
19
19
|
export declare const mergeBaskets: ({ fromBasketKey, toBasketKey, with: _with }: {
|
|
20
20
|
fromBasketKey: string;
|
|
21
21
|
toBasketKey: string;
|
|
22
|
-
with?: BasketWithOptions
|
|
22
|
+
with?: BasketWithOptions;
|
|
23
23
|
}, context: RpcContext) => Promise<{
|
|
24
24
|
type: "failure";
|
|
25
25
|
statusCode: number;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { Category, ProductCategoryPropertyWith } from '../../types';
|
|
2
2
|
export declare const getRootCategories: ({ children, includeHidden, properties }: {
|
|
3
|
-
children?: number
|
|
4
|
-
includeHidden?: true
|
|
5
|
-
properties?: ProductCategoryPropertyWith
|
|
3
|
+
children?: number;
|
|
4
|
+
includeHidden?: true;
|
|
5
|
+
properties?: ProductCategoryPropertyWith;
|
|
6
6
|
}, { cached, bapiClient }: import("../../types").RpcContext) => Promise<{
|
|
7
7
|
categories: Category[];
|
|
8
8
|
activeNode: undefined;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const getCategoryByPath: ({ path, children, includeHidden, properties }: {
|
|
11
11
|
path: string;
|
|
12
|
-
children?: number
|
|
13
|
-
includeHidden?: true
|
|
14
|
-
properties?: ProductCategoryPropertyWith
|
|
12
|
+
children?: number;
|
|
13
|
+
includeHidden?: true;
|
|
14
|
+
properties?: ProductCategoryPropertyWith;
|
|
15
15
|
}, context: import("../../types").RpcContext) => Promise<Category>;
|
|
16
16
|
export declare const getCategoriesByPath: ({ path, children, includeHidden, properties }: {
|
|
17
17
|
path: string;
|
|
18
|
-
children?: number
|
|
19
|
-
includeHidden?: true
|
|
20
|
-
properties?: ProductCategoryPropertyWith
|
|
18
|
+
children?: number;
|
|
19
|
+
includeHidden?: true;
|
|
20
|
+
properties?: ProductCategoryPropertyWith;
|
|
21
21
|
}, context: import("../../types").RpcContext) => Promise<{
|
|
22
22
|
categories: Category[];
|
|
23
23
|
activeNode: undefined;
|
|
@@ -27,7 +27,7 @@ export declare const getCategoriesByPath: ({ path, children, includeHidden, prop
|
|
|
27
27
|
}>;
|
|
28
28
|
export declare const getCategoryById: ({ id, children, includeHidden, properties }: {
|
|
29
29
|
id: number;
|
|
30
|
-
children?: number
|
|
31
|
-
includeHidden?: true
|
|
32
|
-
properties?: ProductCategoryPropertyWith
|
|
30
|
+
children?: number;
|
|
31
|
+
includeHidden?: true;
|
|
32
|
+
properties?: ProductCategoryPropertyWith;
|
|
33
33
|
}, context: import("../../types").RpcContext) => Promise<Category>;
|
|
@@ -31,7 +31,7 @@ const getCheckoutToken = exports.getCheckoutToken = async function getCheckoutTo
|
|
|
31
31
|
carrier,
|
|
32
32
|
basketId: context.basketKey,
|
|
33
33
|
campaignKey: context.campaignKey
|
|
34
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.58.
|
|
34
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.58.2"}`).setProtectedHeader({
|
|
35
35
|
alg: "HS256",
|
|
36
36
|
typ: "JWT"
|
|
37
37
|
}).sign(secret);
|
|
@@ -21,7 +21,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
|
|
|
21
21
|
carrier,
|
|
22
22
|
basketId: context.basketKey,
|
|
23
23
|
campaignKey: context.campaignKey
|
|
24
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.58.
|
|
24
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.58.2"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
25
25
|
return {
|
|
26
26
|
accessToken: refreshedAccessToken,
|
|
27
27
|
checkoutJwt
|
|
@@ -7,7 +7,7 @@ export declare const getProductsCount: ({ category, categoryId, where, includeSo
|
|
|
7
7
|
count: number;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const fetchAllFiltersForCategory: ({ includedFilters, category }: {
|
|
10
|
-
includedFilters?: string[]
|
|
10
|
+
includedFilters?: string[];
|
|
11
11
|
category: {
|
|
12
12
|
slug: string;
|
|
13
13
|
id: number;
|
|
@@ -4,9 +4,9 @@ type SearchWith = TypeaheadSuggestionsEndpointRequestParameters['with'];
|
|
|
4
4
|
/** @deprecated `searchProducts` is deprecated. Please, use `getSuggestions` or `resolve` RPC methods */
|
|
5
5
|
export declare const searchProducts: ({ term, slug, with: _with, productLimit }: {
|
|
6
6
|
term: string;
|
|
7
|
-
slug?: string
|
|
7
|
+
slug?: string;
|
|
8
8
|
with?: SearchWith;
|
|
9
|
-
productLimit?: number
|
|
9
|
+
productLimit?: number;
|
|
10
10
|
}, { cached, bapiClient, withParams }: import("../../types").RpcContext) => Promise<TypeaheadSuggestionsEndpointResponseData>;
|
|
11
11
|
export declare const getSearchSuggestions: ({ term, with: _with, categoryId }: SearchV2SuggestionsEndpointParameters, { bapiClient, withParams }: import("../../types").RpcContext) => Promise<SearchV2SuggestionsEndpointResponseData>;
|
|
12
12
|
export declare const resolveSearch: ({ term, with: _with, categoryId }: SearchV2ResolveEndpointParameters, { cached, bapiClient, withParams }: import("../../types").RpcContext) => Promise<import("@scayle/storefront-api").SearchEntity | null>;
|
|
@@ -144,7 +144,7 @@ const oauthRevokeToken = async context => {
|
|
|
144
144
|
const client = (0, _oauth.getOAuthClient)(context);
|
|
145
145
|
await context.destroySession();
|
|
146
146
|
try {
|
|
147
|
-
await client.revokeToken(accessToken);
|
|
147
|
+
await client.revokeToken(context.shopId, accessToken);
|
|
148
148
|
return {
|
|
149
149
|
result: true
|
|
150
150
|
};
|
|
@@ -149,7 +149,7 @@ export const oauthRevokeToken = async (context) => {
|
|
|
149
149
|
const client = getOAuthClient(context);
|
|
150
150
|
await context.destroySession();
|
|
151
151
|
try {
|
|
152
|
-
await client.revokeToken(accessToken);
|
|
152
|
+
await client.revokeToken(context.shopId, accessToken);
|
|
153
153
|
return { result: true };
|
|
154
154
|
} catch (error) {
|
|
155
155
|
const res = convertErrorForRpcCall(error, [
|
|
@@ -17,6 +17,6 @@ declare const refreshUser: (context: RpcContext) => Promise<{
|
|
|
17
17
|
user: ShopUser;
|
|
18
18
|
}>;
|
|
19
19
|
declare const getAccessToken: ({ forceTokenRefresh }: {
|
|
20
|
-
forceTokenRefresh?: boolean
|
|
20
|
+
forceTokenRefresh?: boolean;
|
|
21
21
|
}, context: RpcContext) => Promise<string | Response>;
|
|
22
22
|
export { getUser, fetchUser, refreshUser, getAccessToken };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Wishlist } from '@scayle/storefront-api';
|
|
2
2
|
import type { RpcContext, WishlistWithOptions } from '../../types';
|
|
3
|
-
export declare const getWishlist: (options: WishlistWithOptions | undefined, context: RpcContext) => Promise<
|
|
3
|
+
export declare const getWishlist: (options: WishlistWithOptions | undefined, context: RpcContext) => Promise<Wishlist>;
|
|
4
4
|
export declare const addItemToWishlist: (options: {
|
|
5
|
-
variantId?: number
|
|
6
|
-
productId?: number
|
|
7
|
-
with?: WishlistWithOptions
|
|
8
|
-
}, context: RpcContext) => Promise<
|
|
5
|
+
variantId?: number;
|
|
6
|
+
productId?: number;
|
|
7
|
+
with?: WishlistWithOptions;
|
|
8
|
+
}, context: RpcContext) => Promise<Wishlist | Response>;
|
|
9
9
|
export declare const removeItemFromWishlist: (options: {
|
|
10
10
|
itemKey: string;
|
|
11
|
-
with?: WishlistWithOptions
|
|
12
|
-
}, context: RpcContext) => Promise<
|
|
13
|
-
export declare const clearWishlist: (context: RpcContext) => Promise<
|
|
11
|
+
with?: WishlistWithOptions;
|
|
12
|
+
}, context: RpcContext) => Promise<Wishlist>;
|
|
13
|
+
export declare const clearWishlist: (context: RpcContext) => Promise<Wishlist>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.58.
|
|
3
|
+
"version": "7.58.3",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@scayle/storefront-api": "17.
|
|
62
|
+
"@scayle/storefront-api": "17.3.0",
|
|
63
63
|
"crypto-js": "4.2.0",
|
|
64
|
-
"jose": "5.
|
|
64
|
+
"jose": "5.5.0",
|
|
65
65
|
"radash": "12.1.0",
|
|
66
66
|
"slugify": "1.6.6",
|
|
67
67
|
"ufo": "1.5.3",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@scayle/eslint-config-storefront": "4.2.0",
|
|
73
73
|
"@types/crypto-js": "4.2.2",
|
|
74
|
-
"@types/node": "20.14.
|
|
74
|
+
"@types/node": "20.14.9",
|
|
75
75
|
"@types/webpack-env": "1.18.5",
|
|
76
76
|
"@vitest/coverage-v8": "1.6.0",
|
|
77
77
|
"dprint": "0.46.3",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"publint": "0.2.8",
|
|
81
81
|
"rimraf": "5.0.7",
|
|
82
82
|
"ts-node": "10.9.2",
|
|
83
|
-
"typescript": "5.
|
|
83
|
+
"typescript": "5.5.2",
|
|
84
84
|
"unbuild": "2.0.0",
|
|
85
85
|
"unstorage": "1.10.2",
|
|
86
86
|
"vitest": "1.6.0"
|