@shopfront/bridge 1.18.4 → 1.20.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.
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GitToolBoxProjectSettings">
4
+ <option name="commitMessageIssueKeyValidationOverride">
5
+ <BoolValueOverride>
6
+ <option name="enabled" value="true" />
7
+ </BoolValueOverride>
8
+ </option>
9
+ <option name="commitMessageValidationEnabledOverride">
10
+ <BoolValueOverride>
11
+ <option name="enabled" value="true" />
12
+ </BoolValueOverride>
13
+ </option>
14
+ </component>
15
+ </project>
@@ -1,4 +1,4 @@
1
- import { ShopfrontSaleProduct, ShopfrontSaleProductType } from "./ShopfrontSaleState";
1
+ import { ShopfrontSaleProduct, ShopfrontSaleProductPromotions, ShopfrontSaleProductType } from "./ShopfrontSaleState";
2
2
  export declare class SaleProduct {
3
3
  readonly internalId: string;
4
4
  protected id: string;
@@ -12,6 +12,7 @@ export declare class SaleProduct {
12
12
  protected contains: Array<SaleProduct>;
13
13
  protected edited: boolean;
14
14
  protected caseQuantity?: number;
15
+ protected promotions: ShopfrontSaleProductPromotions;
15
16
  protected metaData: Record<string, unknown>;
16
17
  protected mapped?: string;
17
18
  constructor(id: string, quantity: number, price?: number, indexAddress?: Array<number>);
@@ -114,6 +115,12 @@ export declare class SaleProduct {
114
115
  * @returns {number | undefined}
115
116
  */
116
117
  getCaseQuantity(): number | undefined;
118
+ /**
119
+ * Get the promotions for the product.
120
+ *
121
+ * @returns {Record<string, unknown>}
122
+ */
123
+ getPromotions(): ShopfrontSaleProductPromotions;
117
124
  /**
118
125
  * Get the meta data for the product.
119
126
  *
@@ -7,6 +7,7 @@ exports.SaleProduct = void 0;
7
7
  const UUID_1 = __importDefault(require("../../Utilities/UUID"));
8
8
  class SaleProduct {
9
9
  constructor(id, quantity, price, indexAddress) {
10
+ this.promotions = {};
10
11
  this.metaData = {};
11
12
  this.internalId = UUID_1.default.generate();
12
13
  this.id = id;
@@ -55,6 +56,7 @@ class SaleProduct {
55
56
  this.note = data.note;
56
57
  this.edited = data.edited;
57
58
  this.caseQuantity = data.caseQuantity;
59
+ this.promotions = data.promotions;
58
60
  this.metaData = data.metaData;
59
61
  this.mapped = data.mapped;
60
62
  for (let i = 0, l = data.products.length; i < l; i++) {
@@ -161,6 +163,14 @@ class SaleProduct {
161
163
  getCaseQuantity() {
162
164
  return this.caseQuantity;
163
165
  }
166
+ /**
167
+ * Get the promotions for the product.
168
+ *
169
+ * @returns {Record<string, unknown>}
170
+ */
171
+ getPromotions() {
172
+ return this.promotions;
173
+ }
164
174
  /**
165
175
  * Get the meta data for the product.
166
176
  *
@@ -1,5 +1,12 @@
1
1
  export declare type ShopfrontSalePaymentStatus = "completed" | "cancelled" | "failed";
2
2
  export declare type ShopfrontSaleProductType = "Normal" | "Basket" | "Package" | "Component" | "Voucher";
3
+ export interface ShopfrontSaleProductPromotions {
4
+ [id: string]: {
5
+ name: string;
6
+ active: boolean;
7
+ quantity: number;
8
+ };
9
+ }
3
10
  export interface ShopfrontSaleProduct {
4
11
  uuid: string;
5
12
  type: ShopfrontSaleProductType;
@@ -15,6 +22,7 @@ export interface ShopfrontSaleProduct {
15
22
  };
16
23
  note: string;
17
24
  products: Array<ShopfrontSaleProduct>;
25
+ promotions: ShopfrontSaleProductPromotions;
18
26
  edited: boolean;
19
27
  caseQuantity: number;
20
28
  metaData: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopfront/bridge",
3
- "version": "1.18.4",
3
+ "version": "1.20.0",
4
4
  "main": "./lib/index.js",
5
5
  "license": "ISC",
6
6
  "description": "The bridge used to embed your application within Shopfront",