@scayle/storefront-core 8.12.1 → 8.12.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.12.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix typo introduced in 8.12.2.
8
+
9
+ ## 8.12.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Use `CentAmount` in the Order type to avoid nominal type errors.
14
+
3
15
  ## 8.12.1
4
16
 
5
17
  ### Patch Changes
@@ -23,7 +23,7 @@ export declare const getUniqueItemsFromOrder: (order: Order) => {
23
23
  key: string;
24
24
  lowestPriorPrice?: null | {
25
25
  relativeDifferenceToPrice: number;
26
- withTax: number;
26
+ withTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
27
27
  };
28
28
  merchant?: {
29
29
  id: number;
@@ -33,7 +33,7 @@ export declare const getUniqueItemsFromOrder: (order: Order) => {
33
33
  price: {
34
34
  appliedReductions?: {
35
35
  amount: {
36
- absoluteWithTax: number;
36
+ absoluteWithTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
37
37
  relative: number;
38
38
  };
39
39
  category: "sale" | "campaign" | "voucher";
@@ -55,8 +55,8 @@ export declare const getUniqueItemsFromOrder: (order: Order) => {
55
55
  };
56
56
  undiscountedWithOutTax?: number;
57
57
  undiscountedWithTax?: number;
58
- withoutTax: number;
59
- withTax: number;
58
+ withoutTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
59
+ withTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
60
60
  };
61
61
  product: {
62
62
  [k: string]: unknown;
@@ -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.12.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
39
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.12.3"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
40
40
  return {
41
41
  accessToken: refreshedAccessToken,
42
42
  checkoutJwt
@@ -1,3 +1,4 @@
1
+ import type { CentAmount } from './product';
1
2
  /**
2
3
  * Items are grouped by package, depending on the item's supplier configuration. The `packageId` references an entry in the packages list with delivery estimates and expected carrier.
3
4
  */
@@ -130,8 +131,8 @@ export interface Order {
130
131
  */
131
132
  appliedFees?: {
132
133
  amount: {
133
- withoutTax: number;
134
- withTax: number;
134
+ withoutTax: CentAmount;
135
+ withTax: CentAmount;
135
136
  };
136
137
  category: 'payment' | 'delivery' | 'percentage_payment' | 'return';
137
138
  key: string;
@@ -148,7 +149,7 @@ export interface Order {
148
149
  */
149
150
  appliedReductions?: {
150
151
  amount: {
151
- absoluteWithTax: number;
152
+ absoluteWithTax: CentAmount;
152
153
  /**
153
154
  * The `rate` is calculated on the basis of the reduction in relation to the `preDiscountPrice` price.
154
155
  */
@@ -185,11 +186,11 @@ export interface Order {
185
186
  /**
186
187
  * This price excludes taxes, but also includes all applicable reductions.
187
188
  */
188
- withoutTax: number;
189
+ withoutTax: CentAmount;
189
190
  /**
190
191
  * The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provdided on the request).
191
192
  */
192
- withTax: number;
193
+ withTax: CentAmount;
193
194
  };
194
195
  currencyCode: string;
195
196
  customData?: {
@@ -306,7 +307,7 @@ export interface Order {
306
307
  /**
307
308
  * Lowest price including taxes
308
309
  */
309
- withTax: number;
310
+ withTax: CentAmount;
310
311
  };
311
312
  /**
312
313
  * the merchant id to which the item belongs.
@@ -325,7 +326,7 @@ export interface Order {
325
326
  */
326
327
  appliedReductions?: {
327
328
  amount: {
328
- absoluteWithTax: number;
329
+ absoluteWithTax: CentAmount;
329
330
  /**
330
331
  * The `rate` is calculated on the basis of the reduction in relation to the `preDiscountPrice` price.
331
332
  */
@@ -356,11 +357,11 @@ export interface Order {
356
357
  /**
357
358
  * This price excludes taxes, but also includes all applicable reductions.
358
359
  */
359
- withoutTax: number;
360
+ withoutTax: CentAmount;
360
361
  /**
361
362
  * The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provided on the request).
362
363
  */
363
- withTax: number;
364
+ withTax: CentAmount;
364
365
  };
365
366
  product: {
366
367
  [k: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.12.1",
3
+ "version": "8.12.3",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",