@scayle/storefront-core 8.14.0 → 8.14.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update `getUniqueItemsFromOrder` and `getItemQuantityFromOrder` to accept order
8
+ `Product` and `Variant` generics to ensure correct types. Morover, both methods
9
+ are deprecated as they should be handled within Storefront project itself.
10
+
3
11
  ## 8.14.0
4
12
 
5
13
  ### Minor Changes
@@ -5,8 +5,10 @@ import type { Order } from '../types';
5
5
  * @param order The order object.
6
6
  *
7
7
  * @returns An array of unique order items.
8
+ *
9
+ * @deprecated getting unique items from order should be handled within the Storefront project itself.
8
10
  */
9
- export declare const getUniqueItemsFromOrder: (order: Order) => import("../types").OrderItem<Record<string, unknown>, Record<string, unknown>>[] | undefined;
11
+ export declare const getUniqueItemsFromOrder: <P, V>(order: Order<P, V>) => import("../types").OrderItem<P, V>[] | undefined;
10
12
  /**
11
13
  * Gets the quantity of a specific item in an order based on its variant ID.
12
14
  *
@@ -14,5 +16,7 @@ export declare const getUniqueItemsFromOrder: (order: Order) => import("../types
14
16
  * @param variantId The ID of the variant to count.
15
17
  *
16
18
  * @returns The quantity of the item in the order, or undefined if the order or items are undefined.
19
+ *
20
+ * @deprecated getting item quantity from order should be handled within the Storefront project itself.
17
21
  */
18
- export declare const getItemQuantityFromOrder: (order: Order, variantId: number) => number | undefined;
22
+ export declare const getItemQuantityFromOrder: <P, V>(order: Order<P, V>, variantId: number) => number | undefined;
@@ -36,7 +36,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
36
36
  carrier,
37
37
  basketId: context.basketKey,
38
38
  campaignKey
39
- }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.14.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
39
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.14.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
40
40
  return {
41
41
  accessToken: refreshedAccessToken,
42
42
  checkoutJwt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.14.0",
3
+ "version": "8.14.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",