@shopfront/bridge 2.0.0 → 2.0.2

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.
Files changed (244) hide show
  1. package/.idea/codeStyles/Project.xml +10 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.idea/git_toolbox_blame.xml +6 -0
  4. package/.idea/git_toolbox_prj.xml +15 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +5 -0
  6. package/.idea/jsLinters/eslint.xml +6 -0
  7. package/.idea/modules.xml +1 -1
  8. package/.idea/php.xml +15 -0
  9. package/lib/APIs/Database/BaseDatabase.d.ts +28 -0
  10. package/lib/APIs/Database/BaseDatabase.js +5 -0
  11. package/lib/APIs/Database/Database.d.ts +19 -7
  12. package/lib/APIs/Database/Database.js +22 -12
  13. package/lib/APIs/Database/types/BaseBarcodeTemplateRepository.d.ts +8 -0
  14. package/lib/APIs/Database/types/BaseBarcodeTemplateRepository.js +1 -0
  15. package/lib/APIs/Database/types/BaseClassificationRepository.d.ts +11 -0
  16. package/lib/APIs/Database/types/BaseClassificationRepository.js +1 -0
  17. package/lib/APIs/Database/types/BaseCustomerDisplayRepository.d.ts +10 -0
  18. package/lib/APIs/Database/types/BaseCustomerDisplayRepository.js +1 -0
  19. package/lib/APIs/Database/types/BaseCustomerGroupRepository.d.ts +24 -0
  20. package/lib/APIs/Database/types/BaseCustomerGroupRepository.js +1 -0
  21. package/lib/APIs/Database/types/BaseCustomerRepository.d.ts +76 -0
  22. package/lib/APIs/Database/types/BaseCustomerRepository.js +1 -0
  23. package/lib/APIs/Database/types/BaseEnterpriseRepository.d.ts +8 -0
  24. package/lib/APIs/Database/types/BaseEnterpriseRepository.js +1 -0
  25. package/lib/APIs/Database/types/BaseGiftCardRepository.d.ts +18 -0
  26. package/lib/APIs/Database/types/BaseGiftCardRepository.js +1 -0
  27. package/lib/APIs/Database/types/BaseKitchenOrderRepository.d.ts +41 -0
  28. package/lib/APIs/Database/types/BaseKitchenOrderRepository.js +1 -0
  29. package/lib/APIs/Database/types/BaseKitchenScreenRepository.d.ts +16 -0
  30. package/lib/APIs/Database/types/BaseKitchenScreenRepository.js +1 -0
  31. package/lib/APIs/Database/types/BaseLockedResourceRepository.d.ts +12 -0
  32. package/lib/APIs/Database/types/BaseLockedResourceRepository.js +1 -0
  33. package/lib/APIs/Database/types/BaseLoyaltyRepository.d.ts +16 -0
  34. package/lib/APIs/Database/types/BaseLoyaltyRepository.js +1 -0
  35. package/lib/APIs/Database/types/BaseMovementRepository.d.ts +16 -0
  36. package/lib/APIs/Database/types/BaseMovementRepository.js +1 -0
  37. package/lib/APIs/Database/types/BaseOutletRepository.d.ts +19 -0
  38. package/lib/APIs/Database/types/BaseOutletRepository.js +1 -0
  39. package/lib/APIs/Database/types/BasePaymentMethodRepository.d.ts +27 -0
  40. package/lib/APIs/Database/types/BasePaymentMethodRepository.js +1 -0
  41. package/lib/APIs/Database/types/BasePriceListRepository.d.ts +40 -0
  42. package/lib/APIs/Database/types/BasePriceListRepository.js +1 -0
  43. package/lib/APIs/Database/types/BasePriceSetRepository.d.ts +6 -0
  44. package/lib/APIs/Database/types/BasePriceSetRepository.js +1 -0
  45. package/lib/APIs/Database/types/BaseProductRepository.d.ts +160 -0
  46. package/lib/APIs/Database/types/BaseProductRepository.js +1 -0
  47. package/lib/APIs/Database/types/BasePromotionCategoryRepository.d.ts +10 -0
  48. package/lib/APIs/Database/types/BasePromotionCategoryRepository.js +1 -0
  49. package/lib/APIs/Database/types/BasePromotionRepository.d.ts +72 -0
  50. package/lib/APIs/Database/types/BasePromotionRepository.js +1 -0
  51. package/lib/APIs/Database/types/BaseReceiptRepository.d.ts +31 -0
  52. package/lib/APIs/Database/types/BaseReceiptRepository.js +1 -0
  53. package/lib/APIs/Database/types/BaseRegisterRepository.d.ts +56 -0
  54. package/lib/APIs/Database/types/BaseRegisterRepository.js +1 -0
  55. package/lib/APIs/Database/types/BaseRepository.d.ts +41 -0
  56. package/lib/APIs/Database/types/BaseRepository.js +1 -0
  57. package/lib/APIs/Database/types/BaseSalesKeyRepository.d.ts +37 -0
  58. package/lib/APIs/Database/types/BaseSalesKeyRepository.js +1 -0
  59. package/lib/APIs/Database/types/BaseSalesRepository.d.ts +123 -0
  60. package/lib/APIs/Database/types/BaseSalesRepository.js +1 -0
  61. package/lib/APIs/Database/types/BaseSearchableRepository.d.ts +8 -0
  62. package/lib/APIs/Database/types/BaseSearchableRepository.js +1 -0
  63. package/lib/APIs/Database/types/BaseStocktakeAccumulatedRepository.d.ts +16 -0
  64. package/lib/APIs/Database/types/BaseStocktakeAccumulatedRepository.js +1 -0
  65. package/lib/APIs/Database/types/BaseStocktakeRepository.d.ts +8 -0
  66. package/lib/APIs/Database/types/BaseStocktakeRepository.js +1 -0
  67. package/lib/APIs/Database/types/BaseStocktakeScannedRepository.d.ts +24 -0
  68. package/lib/APIs/Database/types/BaseStocktakeScannedRepository.js +1 -0
  69. package/lib/APIs/Database/types/BaseSupplierRepository.d.ts +35 -0
  70. package/lib/APIs/Database/types/BaseSupplierRepository.js +1 -0
  71. package/lib/APIs/Database/types/BaseTakingsRepository.d.ts +13 -0
  72. package/lib/APIs/Database/types/BaseTakingsRepository.js +1 -0
  73. package/lib/APIs/Database/types/BaseTaxRateRepository.d.ts +9 -0
  74. package/lib/APIs/Database/types/BaseTaxRateRepository.js +1 -0
  75. package/lib/APIs/Database/types/BaseTransfereeRepository.d.ts +12 -0
  76. package/lib/APIs/Database/types/BaseTransfereeRepository.js +1 -0
  77. package/lib/APIs/Database/types/BaseVendorConnectionRepository.d.ts +7 -0
  78. package/lib/APIs/Database/types/BaseVendorConnectionRepository.js +1 -0
  79. package/lib/APIs/Database/types/DataSourceTables.d.ts +61 -0
  80. package/lib/APIs/Database/types/DataSourceTables.js +1 -0
  81. package/lib/APIs/Fulfilment/FulfilmentTypes.d.ts +2 -2
  82. package/lib/APIs/Fulfilment/FulfilmentTypes.js +1 -2
  83. package/lib/APIs/InternalMessages/InternalMessageSource.d.ts +6 -3
  84. package/lib/APIs/InternalMessages/InternalMessageSource.js +6 -7
  85. package/lib/APIs/Sale/BaseCurrentSale.d.ts +83 -0
  86. package/lib/APIs/Sale/BaseCurrentSale.js +13 -0
  87. package/lib/APIs/Sale/BaseSale.d.ts +3 -38
  88. package/lib/APIs/Sale/BaseSale.js +1 -40
  89. package/lib/APIs/Sale/CurrentSale.d.ts +19 -84
  90. package/lib/APIs/Sale/CurrentSale.js +32 -102
  91. package/lib/APIs/Sale/Exceptions.d.ts +3 -0
  92. package/lib/APIs/Sale/Exceptions.js +7 -7
  93. package/lib/APIs/Sale/Sale.d.ts +39 -7
  94. package/lib/APIs/Sale/Sale.js +41 -13
  95. package/lib/APIs/Sale/SaleCustomer.d.ts +0 -2
  96. package/lib/APIs/Sale/SaleCustomer.js +1 -7
  97. package/lib/APIs/Sale/SalePayment.d.ts +3 -22
  98. package/lib/APIs/Sale/SalePayment.js +7 -33
  99. package/lib/APIs/Sale/SaleProduct.d.ts +6 -46
  100. package/lib/APIs/Sale/SaleProduct.js +6 -53
  101. package/lib/APIs/Sale/ShopfrontSaleState.d.ts +7 -9
  102. package/lib/APIs/Sale/ShopfrontSaleState.js +1 -2
  103. package/lib/APIs/Sale/index.d.ts +9 -9
  104. package/lib/APIs/Sale/index.js +7 -39
  105. package/lib/Actions/BaseAction.d.ts +21 -5
  106. package/lib/Actions/BaseAction.js +155 -97
  107. package/lib/Actions/Button.d.ts +2 -2
  108. package/lib/Actions/Button.js +3 -7
  109. package/lib/Actions/CustomerListOption.d.ts +2 -2
  110. package/lib/Actions/CustomerListOption.js +2 -6
  111. package/lib/Actions/Dialog.d.ts +4 -4
  112. package/lib/Actions/Dialog.js +2 -6
  113. package/lib/Actions/Redirect.d.ts +2 -2
  114. package/lib/Actions/Redirect.js +7 -9
  115. package/lib/Actions/SaleKey.d.ts +2 -2
  116. package/lib/Actions/SaleKey.js +3 -7
  117. package/lib/Actions/SaleUpdate.d.ts +3 -3
  118. package/lib/Actions/SaleUpdate.js +3 -7
  119. package/lib/Actions/Toast.d.ts +3 -3
  120. package/lib/Actions/Toast.js +2 -6
  121. package/lib/Application.d.ts +114 -78
  122. package/lib/Application.js +207 -160
  123. package/lib/ApplicationEvents.d.ts +66 -53
  124. package/lib/ApplicationEvents.js +10 -6
  125. package/lib/BaseApplication.d.ts +169 -0
  126. package/lib/BaseApplication.js +40 -0
  127. package/lib/BaseBridge.d.ts +33 -0
  128. package/lib/BaseBridge.js +16 -0
  129. package/lib/Bridge.d.ts +46 -9
  130. package/lib/Bridge.js +42 -54
  131. package/lib/Common/EventEmitter.d.ts +10 -1
  132. package/lib/Common/EventEmitter.js +10 -5
  133. package/lib/Common/Serializable.d.ts +8 -6
  134. package/lib/Common/Serializable.js +1 -2
  135. package/lib/EmitableEvents/BaseEmitableEvent.d.ts +7 -1
  136. package/lib/EmitableEvents/BaseEmitableEvent.js +7 -5
  137. package/lib/EmitableEvents/Fulfilment/Options.d.ts +1 -1
  138. package/lib/EmitableEvents/Fulfilment/Options.js +4 -8
  139. package/lib/EmitableEvents/Fulfilment/OrderCancel.d.ts +1 -1
  140. package/lib/EmitableEvents/Fulfilment/OrderCancel.js +4 -8
  141. package/lib/EmitableEvents/Fulfilment/OrderCreate.d.ts +2 -2
  142. package/lib/EmitableEvents/Fulfilment/OrderCreate.js +4 -8
  143. package/lib/EmitableEvents/Fulfilment/OrderUpdate.d.ts +2 -2
  144. package/lib/EmitableEvents/Fulfilment/OrderUpdate.js +4 -8
  145. package/lib/EmitableEvents/Fulfilment/OrdersSync.d.ts +2 -2
  146. package/lib/EmitableEvents/Fulfilment/OrdersSync.js +4 -8
  147. package/lib/EmitableEvents/Fulfilment/RegisterIntent.d.ts +2 -2
  148. package/lib/EmitableEvents/Fulfilment/RegisterIntent.js +4 -8
  149. package/lib/EmitableEvents/Fulfilment/index.d.ts +7 -7
  150. package/lib/EmitableEvents/Fulfilment/index.js +6 -15
  151. package/lib/EmitableEvents/InternalMessage.d.ts +2 -2
  152. package/lib/EmitableEvents/InternalMessage.js +4 -8
  153. package/lib/EmitableEvents/SellScreenOption.d.ts +2 -2
  154. package/lib/EmitableEvents/SellScreenOption.js +7 -11
  155. package/lib/EmitableEvents/SellScreenPromotionApplicable.d.ts +1 -1
  156. package/lib/EmitableEvents/SellScreenPromotionApplicable.js +4 -8
  157. package/lib/EmitableEvents/TableUpdate.d.ts +2 -2
  158. package/lib/EmitableEvents/TableUpdate.js +4 -8
  159. package/lib/Events/AudioPermissionChange.d.ts +5 -2
  160. package/lib/Events/AudioPermissionChange.js +6 -7
  161. package/lib/Events/AudioReady.d.ts +5 -2
  162. package/lib/Events/AudioReady.js +6 -7
  163. package/lib/Events/BaseEvent.d.ts +8 -3
  164. package/lib/Events/BaseEvent.js +1 -6
  165. package/lib/Events/Callback.d.ts +5 -2
  166. package/lib/Events/Callback.js +5 -6
  167. package/lib/Events/FormatIntegratedProduct.d.ts +27 -32
  168. package/lib/Events/FormatIntegratedProduct.js +12 -9
  169. package/lib/Events/FulfilmentCollectOrder.d.ts +5 -2
  170. package/lib/Events/FulfilmentCollectOrder.js +5 -6
  171. package/lib/Events/FulfilmentCompleteOrder.d.ts +5 -2
  172. package/lib/Events/FulfilmentCompleteOrder.js +5 -6
  173. package/lib/Events/FulfilmentGetOrder.d.ts +12 -6
  174. package/lib/Events/FulfilmentGetOrder.js +10 -8
  175. package/lib/Events/FulfilmentOrderApproval.d.ts +5 -2
  176. package/lib/Events/FulfilmentOrderApproval.js +5 -6
  177. package/lib/Events/FulfilmentProcessOrder.d.ts +12 -10
  178. package/lib/Events/FulfilmentProcessOrder.js +7 -8
  179. package/lib/Events/FulfilmentVoidOrder.d.ts +5 -2
  180. package/lib/Events/FulfilmentVoidOrder.js +5 -6
  181. package/lib/Events/GiftCardCodeCheck.d.ts +19 -0
  182. package/lib/Events/GiftCardCodeCheck.js +23 -0
  183. package/lib/Events/InternalPageMessage.d.ts +10 -4
  184. package/lib/Events/InternalPageMessage.js +12 -10
  185. package/lib/Events/PaymentMethodsEnabled.d.ts +16 -11
  186. package/lib/Events/PaymentMethodsEnabled.js +10 -8
  187. package/lib/Events/Ready.d.ts +12 -7
  188. package/lib/Events/Ready.js +5 -6
  189. package/lib/Events/RegisterChanged.d.ts +12 -6
  190. package/lib/Events/RegisterChanged.js +6 -7
  191. package/lib/Events/RequestButtons.d.ts +17 -12
  192. package/lib/Events/RequestButtons.js +13 -11
  193. package/lib/Events/RequestCustomerListOptions.d.ts +11 -5
  194. package/lib/Events/RequestCustomerListOptions.js +12 -11
  195. package/lib/Events/RequestSaleKeys.d.ts +12 -6
  196. package/lib/Events/RequestSaleKeys.js +13 -11
  197. package/lib/Events/RequestSellScreenOptions.d.ts +18 -5
  198. package/lib/Events/RequestSellScreenOptions.js +17 -9
  199. package/lib/Events/RequestSettings.d.ts +11 -5
  200. package/lib/Events/RequestSettings.js +12 -10
  201. package/lib/Events/RequestTableColumns.d.ts +16 -11
  202. package/lib/Events/RequestTableColumns.js +12 -9
  203. package/lib/Events/SaleComplete.d.ts +15 -18
  204. package/lib/Events/SaleComplete.js +6 -7
  205. package/lib/Events/UIPipeline.d.ts +17 -5
  206. package/lib/Events/UIPipeline.js +17 -10
  207. package/lib/Mocks/APIs/Sale/MockCurrentSale.d.ts +99 -0
  208. package/lib/Mocks/APIs/Sale/MockCurrentSale.js +326 -0
  209. package/lib/Mocks/Database/MockDatabase.d.ts +96 -0
  210. package/lib/Mocks/Database/MockDatabase.js +89 -0
  211. package/lib/Mocks/MockApplication.d.ts +154 -0
  212. package/lib/Mocks/MockApplication.js +481 -0
  213. package/lib/Mocks/MockBridge.d.ts +31 -0
  214. package/lib/Mocks/MockBridge.js +77 -0
  215. package/lib/Mocks/index.d.ts +7 -0
  216. package/lib/Mocks/index.js +15 -0
  217. package/lib/Utilities/ActionEventRegistrar.d.ts +19 -4
  218. package/lib/Utilities/ActionEventRegistrar.js +19 -3
  219. package/lib/Utilities/MiscTypes.d.ts +6 -4
  220. package/lib/Utilities/MiscTypes.js +1 -2
  221. package/lib/Utilities/SaleCreate.d.ts +6 -2
  222. package/lib/Utilities/SaleCreate.js +10 -6
  223. package/lib/Utilities/Static.d.ts +3 -0
  224. package/lib/Utilities/Static.js +5 -7
  225. package/lib/Utilities/UUID.d.ts +9 -3
  226. package/lib/Utilities/UUID.js +10 -7
  227. package/lib/index.d.ts +16 -14
  228. package/lib/index.js +14 -49
  229. package/package.json +3 -2
  230. package/lib/APIs/CurrentSale/Exceptions.d.ts +0 -6
  231. package/lib/APIs/CurrentSale/Exceptions.js +0 -15
  232. package/lib/APIs/CurrentSale/Sale.d.ts +0 -182
  233. package/lib/APIs/CurrentSale/Sale.js +0 -290
  234. package/lib/APIs/CurrentSale/SaleCustomer.d.ts +0 -10
  235. package/lib/APIs/CurrentSale/SaleCustomer.js +0 -17
  236. package/lib/APIs/CurrentSale/SalePayment.d.ts +0 -68
  237. package/lib/APIs/CurrentSale/SalePayment.js +0 -99
  238. package/lib/APIs/CurrentSale/SaleProduct.d.ts +0 -121
  239. package/lib/APIs/CurrentSale/SaleProduct.js +0 -167
  240. package/lib/APIs/CurrentSale/ShopfrontSaleState.d.ts +0 -53
  241. package/lib/APIs/CurrentSale/ShopfrontSaleState.js +0 -2
  242. package/lib/APIs/CurrentSale/index.d.ts +0 -6
  243. package/lib/APIs/CurrentSale/index.js +0 -37
  244. /package/.idea/{embedded-bridge.iml → shopfront-embedded-bridge.iml} +0 -0
@@ -1,4 +1,4 @@
1
- import { ShopfrontSalePayment } from "./ShopfrontSaleState";
1
+ import { ShopfrontSalePayment } from "./ShopfrontSaleState.js";
2
2
  export declare enum SalePaymentStatus {
3
3
  APPROVED = "completed",
4
4
  DECLINED = "failed",
@@ -16,61 +16,42 @@ export declare class SalePayment {
16
16
  constructor(id: string, amount: number, cashout?: number, status?: SalePaymentStatus);
17
17
  /**
18
18
  * Hydrate a sale payment from the SaleState.
19
- *
20
19
  * @internal
21
- * @param {ShopfrontSalePayment} payment
22
- * @returns {SalePayment}
23
- * @constructor
24
20
  */
25
21
  static HydrateFromState(payment: ShopfrontSalePayment): SalePayment;
26
22
  /**
27
23
  * Set the internal data for the payment.
28
- * This method is for hydration of the payment from Shopfront, it's highly recommend that you DO NOT use this method.
29
- *
24
+ * This method is for hydration of the payment from Shopfront,
25
+ * it's highly recommend that you DO NOT use this method.
30
26
  * @internal
31
- * @param {ShopfrontSalePayment} data
32
27
  */
33
28
  setInternal(data: ShopfrontSalePayment): void;
34
29
  /**
35
30
  * Get the ID of the sale payment method.
36
- *
37
- * @returns {string}
38
31
  */
39
32
  getId(): string;
40
33
  /**
41
34
  * Get the type of payment method this is.
42
- *
43
- * @returns {string | undefined}
44
35
  */
45
36
  getType(): string | undefined;
46
37
  /**
47
38
  * Get the status of this payment method.
48
- *
49
- * @returns {SalePaymentStatus | undefined}
50
39
  */
51
40
  getStatus(): SalePaymentStatus | undefined;
52
41
  /**
53
42
  * Get the value of this payment method.
54
- *
55
- * @returns {number}
56
43
  */
57
44
  getAmount(): number;
58
45
  /**
59
46
  * Get the cashout amount paid for on this payment method.
60
- *
61
- * @returns {number | undefined}
62
47
  */
63
48
  getCashout(): number | undefined;
64
49
  /**
65
50
  * Get the amount of rounding applied to this payment method.
66
- *
67
- * @returns {number | undefined}
68
51
  */
69
52
  getRounding(): number | undefined;
70
53
  /**
71
54
  * Get the metadata attached to this payment method
72
- *
73
- * @returns {Record<string, unknown>}
74
55
  */
75
56
  getMetaData(): Record<string, unknown>;
76
57
  }
@@ -1,20 +1,14 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SalePayment = exports.SalePaymentStatus = void 0;
7
- const UUID_1 = __importDefault(require("../../Utilities/UUID"));
8
- var SalePaymentStatus;
1
+ import UUID from "../../Utilities/UUID.js";
2
+ export var SalePaymentStatus;
9
3
  (function (SalePaymentStatus) {
10
4
  SalePaymentStatus["APPROVED"] = "completed";
11
5
  SalePaymentStatus["DECLINED"] = "failed";
12
6
  SalePaymentStatus["CANCELLED"] = "cancelled";
13
- })(SalePaymentStatus = exports.SalePaymentStatus || (exports.SalePaymentStatus = {}));
14
- class SalePayment {
7
+ })(SalePaymentStatus || (SalePaymentStatus = {}));
8
+ export class SalePayment {
15
9
  constructor(id, amount, cashout, status) {
16
10
  this.metaData = {};
17
- this.internalId = UUID_1.default.generate();
11
+ this.internalId = UUID.generate();
18
12
  this.id = id;
19
13
  this.amount = amount;
20
14
  this.cashout = cashout;
@@ -22,11 +16,7 @@ class SalePayment {
22
16
  }
23
17
  /**
24
18
  * Hydrate a sale payment from the SaleState.
25
- *
26
19
  * @internal
27
- * @param {ShopfrontSalePayment} payment
28
- * @returns {SalePayment}
29
- * @constructor
30
20
  */
31
21
  static HydrateFromState(payment) {
32
22
  let status = SalePaymentStatus.APPROVED;
@@ -44,10 +34,9 @@ class SalePayment {
44
34
  }
45
35
  /**
46
36
  * Set the internal data for the payment.
47
- * This method is for hydration of the payment from Shopfront, it's highly recommend that you DO NOT use this method.
48
- *
37
+ * This method is for hydration of the payment from Shopfront,
38
+ * it's highly recommend that you DO NOT use this method.
49
39
  * @internal
50
- * @param {ShopfrontSalePayment} data
51
40
  */
52
41
  setInternal(data) {
53
42
  this.type = data.type;
@@ -56,59 +45,44 @@ class SalePayment {
56
45
  }
57
46
  /**
58
47
  * Get the ID of the sale payment method.
59
- *
60
- * @returns {string}
61
48
  */
62
49
  getId() {
63
50
  return this.id;
64
51
  }
65
52
  /**
66
53
  * Get the type of payment method this is.
67
- *
68
- * @returns {string | undefined}
69
54
  */
70
55
  getType() {
71
56
  return this.type;
72
57
  }
73
58
  /**
74
59
  * Get the status of this payment method.
75
- *
76
- * @returns {SalePaymentStatus | undefined}
77
60
  */
78
61
  getStatus() {
79
62
  return this.status;
80
63
  }
81
64
  /**
82
65
  * Get the value of this payment method.
83
- *
84
- * @returns {number}
85
66
  */
86
67
  getAmount() {
87
68
  return this.amount;
88
69
  }
89
70
  /**
90
71
  * Get the cashout amount paid for on this payment method.
91
- *
92
- * @returns {number | undefined}
93
72
  */
94
73
  getCashout() {
95
74
  return this.cashout;
96
75
  }
97
76
  /**
98
77
  * Get the amount of rounding applied to this payment method.
99
- *
100
- * @returns {number | undefined}
101
78
  */
102
79
  getRounding() {
103
80
  return this.rounding;
104
81
  }
105
82
  /**
106
83
  * Get the metadata attached to this payment method
107
- *
108
- * @returns {Record<string, unknown>}
109
84
  */
110
85
  getMetaData() {
111
86
  return this.metaData;
112
87
  }
113
88
  }
114
- exports.SalePayment = SalePayment;
@@ -1,4 +1,4 @@
1
- import { ShopfrontSaleProduct, ShopfrontSaleProductPromotions, ShopfrontSaleProductType } from "./ShopfrontSaleState";
1
+ import { ShopfrontSaleProduct, ShopfrontSaleProductPromotions, ShopfrontSaleProductType } from "./ShopfrontSaleState.js";
2
2
  export declare class SaleProduct {
3
3
  readonly internalId: string;
4
4
  protected id: string;
@@ -21,44 +21,31 @@ export declare class SaleProduct {
21
21
  constructor(id: string, quantity: number, price?: number, indexAddress?: Array<number>);
22
22
  /**
23
23
  * Hydrate a sale product from the SaleState.
24
- *
25
24
  * @internal
26
- * @param {ShopfrontSaleProduct} product
27
- * @param {Array<number>} indexAddress
28
- * @returns {SaleProduct}
29
- * @constructor
30
25
  */
31
26
  static HydrateFromState(product: ShopfrontSaleProduct, indexAddress: Array<number>): SaleProduct;
32
27
  /**
33
28
  * Append a product to this product's list of contained products.
34
- *
35
- * @protected
36
- * @param {SaleProduct} product
37
29
  */
38
30
  protected appendProduct(product: SaleProduct): void;
39
31
  /**
40
32
  * Set the internal data for the product.
41
- * This method is for hydration of the product from Shopfront, it's highly recommend that you DO NOT use this method.
42
- *
33
+ * This method is for hydration of the product from Shopfront,
34
+ * it's highly recommend that you DO NOT use this method.
43
35
  * @internal
44
- * @param {ShopfrontSaleProduct} data
45
- * @param {Array<number>} indexAddress
46
36
  */
47
37
  setInternal(data: ShopfrontSaleProduct, indexAddress: Array<number>): void;
48
38
  /**
49
39
  * Get the ID of the product.
50
- * @returns {string}
51
40
  */
52
41
  getId(): string;
53
42
  /**
54
43
  * Gets the mapped id for the product.
55
44
  * Used when the product goes through the fulfilment process mapping
56
- * @returns {string | undefined}
57
45
  */
58
46
  getMapped(): string | undefined;
59
47
  /**
60
48
  * Get the current sale quantity of the product.
61
- * @returns {number}
62
49
  */
63
50
  getQuantity(): number;
64
51
  /**
@@ -67,7 +54,6 @@ export declare class SaleProduct {
67
54
  setQuantity(quantity: number): void;
68
55
  /**
69
56
  * Get the current price of the product.
70
- * @returns {number | undefined}
71
57
  */
72
58
  getPrice(): number | undefined;
73
59
  /**
@@ -78,93 +64,67 @@ export declare class SaleProduct {
78
64
  * Get the index address of the product.
79
65
  * This is the internal address of where the product is in the sale.
80
66
  * (e.g. if the address is [1, 3] it's the fourth contained product in the second sale line).
81
- *
82
- * @returns {Array<number>}
83
67
  */
84
- getIndexAddress(): number[];
68
+ getIndexAddress(): Array<number>;
85
69
  /**
86
70
  * Get the name of the product.
87
- *
88
- * @returns {string | undefined}
89
71
  */
90
72
  getName(): string | undefined;
91
73
  /**
92
74
  * Get the type of product this product is.
93
- *
94
- * @returns {ShopfrontSaleProductType | undefined}
95
75
  */
96
76
  getType(): ShopfrontSaleProductType | undefined;
97
77
  /**
98
78
  * Get the tax rate amount.
99
79
  * This is the rate of the tax rate (e.g. 10 is a tax rate of 10%).
100
- *
101
- * @returns {number | undefined}
102
80
  */
103
81
  getTaxRateAmount(): number | undefined;
104
82
  /**
105
83
  * Get the sale note attached to this product.
106
- *
107
- * @returns {string}
108
84
  */
109
85
  getNote(): string;
110
86
  /**
111
87
  * Get the products this product contains.
112
- *
113
- * @returns {Array<SaleProduct>}
114
88
  */
115
- getContains(): SaleProduct[];
89
+ getContains(): Array<SaleProduct>;
116
90
  /**
117
91
  * Get whether this product has been "edited".
118
92
  * Typically, being edited just means that this product has been discounted.
119
- *
120
- * @returns {boolean}
121
93
  */
122
94
  getEdited(): boolean;
123
95
  /**
124
96
  * Get the case quantity for this product.
125
- *
126
- * @returns {number | undefined}
127
97
  */
128
98
  getCaseQuantity(): number | undefined;
129
99
  /**
130
100
  * Get the current active promotions for the product.
131
- *
132
- * @returns {ShopfrontSaleProductPromotions}
133
101
  */
134
102
  getPromotions(): ShopfrontSaleProductPromotions;
135
103
  /**
136
- * Get the meta data for the product.
137
- *
138
- * @returns {Record<string, unknown>}
104
+ * Get the meta-data for the product.
139
105
  */
140
106
  getMetaData(): Record<string, unknown>;
141
107
  /**
142
108
  * Set the metaData for a product
143
- * @param key
144
- * @param value
145
109
  */
146
110
  setMetaData(key: string, value: unknown): void;
147
111
  /**
148
112
  * Returns whether the product's quantity was modified externally
149
- *
150
113
  * @internal
151
114
  */
152
115
  wasQuantityModified(): boolean;
153
116
  /**
154
117
  * Returns whether the product's price was modified externally
155
- *
156
118
  * @internal
157
119
  */
158
120
  wasPriceModified(): boolean;
159
121
  /**
160
122
  * Returns whether the product's metaData was modified externally
161
- *
162
123
  * @internal
163
124
  */
164
125
  wasMetaDataModified(): boolean;
165
126
  /**
166
127
  * Sets a product's modification flags to false
167
- *
168
128
  * @internal
169
129
  */
170
130
  clearModificationFlags(): void;
@@ -1,15 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SaleProduct = void 0;
7
- const UUID_1 = __importDefault(require("../../Utilities/UUID"));
8
- class SaleProduct {
1
+ import UUID from "../../Utilities/UUID.js";
2
+ export class SaleProduct {
9
3
  constructor(id, quantity, price, indexAddress) {
10
4
  this.promotions = {};
11
5
  this.metaData = {};
12
- this.internalId = UUID_1.default.generate();
6
+ this.internalId = UUID.generate();
13
7
  this.id = id;
14
8
  this.quantity = quantity;
15
9
  this.price = price;
@@ -23,12 +17,7 @@ class SaleProduct {
23
17
  }
24
18
  /**
25
19
  * Hydrate a sale product from the SaleState.
26
- *
27
20
  * @internal
28
- * @param {ShopfrontSaleProduct} product
29
- * @param {Array<number>} indexAddress
30
- * @returns {SaleProduct}
31
- * @constructor
32
21
  */
33
22
  static HydrateFromState(product, indexAddress) {
34
23
  const hydrated = new SaleProduct(product.uuid, product.quantity, product.prices.price, indexAddress);
@@ -37,20 +26,15 @@ class SaleProduct {
37
26
  }
38
27
  /**
39
28
  * Append a product to this product's list of contained products.
40
- *
41
- * @protected
42
- * @param {SaleProduct} product
43
29
  */
44
30
  appendProduct(product) {
45
31
  this.contains.push(product);
46
32
  }
47
33
  /**
48
34
  * Set the internal data for the product.
49
- * This method is for hydration of the product from Shopfront, it's highly recommend that you DO NOT use this method.
50
- *
35
+ * This method is for hydration of the product from Shopfront,
36
+ * it's highly recommend that you DO NOT use this method.
51
37
  * @internal
52
- * @param {ShopfrontSaleProduct} data
53
- * @param {Array<number>} indexAddress
54
38
  */
55
39
  setInternal(data, indexAddress) {
56
40
  this.name = data.name;
@@ -71,7 +55,6 @@ class SaleProduct {
71
55
  }
72
56
  /**
73
57
  * Get the ID of the product.
74
- * @returns {string}
75
58
  */
76
59
  getId() {
77
60
  return this.id;
@@ -79,14 +62,12 @@ class SaleProduct {
79
62
  /**
80
63
  * Gets the mapped id for the product.
81
64
  * Used when the product goes through the fulfilment process mapping
82
- * @returns {string | undefined}
83
65
  */
84
66
  getMapped() {
85
67
  return this.mapped;
86
68
  }
87
69
  /**
88
70
  * Get the current sale quantity of the product.
89
- * @returns {number}
90
71
  */
91
72
  getQuantity() {
92
73
  return this.quantity;
@@ -100,7 +81,6 @@ class SaleProduct {
100
81
  }
101
82
  /**
102
83
  * Get the current price of the product.
103
- * @returns {number | undefined}
104
84
  */
105
85
  getPrice() {
106
86
  return this.price;
@@ -116,24 +96,18 @@ class SaleProduct {
116
96
  * Get the index address of the product.
117
97
  * This is the internal address of where the product is in the sale.
118
98
  * (e.g. if the address is [1, 3] it's the fourth contained product in the second sale line).
119
- *
120
- * @returns {Array<number>}
121
99
  */
122
100
  getIndexAddress() {
123
101
  return this.indexAddress;
124
102
  }
125
103
  /**
126
104
  * Get the name of the product.
127
- *
128
- * @returns {string | undefined}
129
105
  */
130
106
  getName() {
131
107
  return this.name;
132
108
  }
133
109
  /**
134
110
  * Get the type of product this product is.
135
- *
136
- * @returns {ShopfrontSaleProductType | undefined}
137
111
  */
138
112
  getType() {
139
113
  return this.type;
@@ -141,24 +115,18 @@ class SaleProduct {
141
115
  /**
142
116
  * Get the tax rate amount.
143
117
  * This is the rate of the tax rate (e.g. 10 is a tax rate of 10%).
144
- *
145
- * @returns {number | undefined}
146
118
  */
147
119
  getTaxRateAmount() {
148
120
  return this.taxRateAmount;
149
121
  }
150
122
  /**
151
123
  * Get the sale note attached to this product.
152
- *
153
- * @returns {string}
154
124
  */
155
125
  getNote() {
156
126
  return this.note;
157
127
  }
158
128
  /**
159
129
  * Get the products this product contains.
160
- *
161
- * @returns {Array<SaleProduct>}
162
130
  */
163
131
  getContains() {
164
132
  return this.contains;
@@ -166,40 +134,30 @@ class SaleProduct {
166
134
  /**
167
135
  * Get whether this product has been "edited".
168
136
  * Typically, being edited just means that this product has been discounted.
169
- *
170
- * @returns {boolean}
171
137
  */
172
138
  getEdited() {
173
139
  return this.edited;
174
140
  }
175
141
  /**
176
142
  * Get the case quantity for this product.
177
- *
178
- * @returns {number | undefined}
179
143
  */
180
144
  getCaseQuantity() {
181
145
  return this.caseQuantity;
182
146
  }
183
147
  /**
184
148
  * Get the current active promotions for the product.
185
- *
186
- * @returns {ShopfrontSaleProductPromotions}
187
149
  */
188
150
  getPromotions() {
189
151
  return this.promotions;
190
152
  }
191
153
  /**
192
- * Get the meta data for the product.
193
- *
194
- * @returns {Record<string, unknown>}
154
+ * Get the meta-data for the product.
195
155
  */
196
156
  getMetaData() {
197
157
  return this.metaData;
198
158
  }
199
159
  /**
200
160
  * Set the metaData for a product
201
- * @param key
202
- * @param value
203
161
  */
204
162
  setMetaData(key, value) {
205
163
  this.metaData[key] = value;
@@ -207,7 +165,6 @@ class SaleProduct {
207
165
  }
208
166
  /**
209
167
  * Returns whether the product's quantity was modified externally
210
- *
211
168
  * @internal
212
169
  */
213
170
  wasQuantityModified() {
@@ -215,7 +172,6 @@ class SaleProduct {
215
172
  }
216
173
  /**
217
174
  * Returns whether the product's price was modified externally
218
- *
219
175
  * @internal
220
176
  */
221
177
  wasPriceModified() {
@@ -223,7 +179,6 @@ class SaleProduct {
223
179
  }
224
180
  /**
225
181
  * Returns whether the product's metaData was modified externally
226
- *
227
182
  * @internal
228
183
  */
229
184
  wasMetaDataModified() {
@@ -231,7 +186,6 @@ class SaleProduct {
231
186
  }
232
187
  /**
233
188
  * Sets a product's modification flags to false
234
- *
235
189
  * @internal
236
190
  */
237
191
  clearModificationFlags() {
@@ -240,4 +194,3 @@ class SaleProduct {
240
194
  this.metaDataModified = false;
241
195
  }
242
196
  }
243
- exports.SaleProduct = SaleProduct;
@@ -1,12 +1,10 @@
1
- export declare type ShopfrontSalePaymentStatus = "completed" | "cancelled" | "failed";
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
- }
1
+ export type ShopfrontSalePaymentStatus = "completed" | "cancelled" | "failed";
2
+ export type ShopfrontSaleProductType = "Normal" | "Basket" | "Package" | "Component" | "Voucher";
3
+ export type ShopfrontSaleProductPromotions = Record<string, {
4
+ name: string;
5
+ active: boolean;
6
+ quantity: number;
7
+ }>;
10
8
  export interface ShopfrontSaleProduct {
11
9
  uuid: string;
12
10
  type: ShopfrontSaleProductType;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,9 +1,9 @@
1
- export { SaleData, SalePaymentData, SaleProductData } from "../../Utilities/SaleCreate";
2
- export { ShopfrontSalePayment, ShopfrontSalePaymentStatus, ShopfrontSaleProduct, ShopfrontSaleProductType, ShopfrontSaleState } from "./ShopfrontSaleState";
3
- export { BaseSale } from "./BaseSale";
4
- export { SaleProduct } from "./SaleProduct";
5
- export { SalePayment } from "./SalePayment";
6
- export { SalePaymentStatus } from "./SalePayment";
7
- export { SaleCustomer } from "./SaleCustomer";
8
- export { Sale } from "./Sale";
9
- export * as Exceptions from "./Exceptions";
1
+ export type { SaleData, SalePaymentData, SaleProductData, } from "../../Utilities/SaleCreate.js";
2
+ export { BaseSale } from "./BaseSale.js";
3
+ export * as Exceptions from "./Exceptions.js";
4
+ export { Sale } from "./Sale.js";
5
+ export { SaleCustomer } from "./SaleCustomer.js";
6
+ export { SalePayment } from "./SalePayment.js";
7
+ export { SalePaymentStatus } from "./SalePayment.js";
8
+ export { SaleProduct } from "./SaleProduct.js";
9
+ export type { ShopfrontSalePayment, ShopfrontSalePaymentStatus, ShopfrontSaleProduct, ShopfrontSaleProductType, ShopfrontSaleState, } from "./ShopfrontSaleState.js";
@@ -1,39 +1,7 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Exceptions = exports.Sale = exports.SaleCustomer = exports.SalePaymentStatus = exports.SalePayment = exports.SaleProduct = exports.BaseSale = void 0;
27
- var BaseSale_1 = require("./BaseSale");
28
- Object.defineProperty(exports, "BaseSale", { enumerable: true, get: function () { return BaseSale_1.BaseSale; } });
29
- var SaleProduct_1 = require("./SaleProduct");
30
- Object.defineProperty(exports, "SaleProduct", { enumerable: true, get: function () { return SaleProduct_1.SaleProduct; } });
31
- var SalePayment_1 = require("./SalePayment");
32
- Object.defineProperty(exports, "SalePayment", { enumerable: true, get: function () { return SalePayment_1.SalePayment; } });
33
- var SalePayment_2 = require("./SalePayment");
34
- Object.defineProperty(exports, "SalePaymentStatus", { enumerable: true, get: function () { return SalePayment_2.SalePaymentStatus; } });
35
- var SaleCustomer_1 = require("./SaleCustomer");
36
- Object.defineProperty(exports, "SaleCustomer", { enumerable: true, get: function () { return SaleCustomer_1.SaleCustomer; } });
37
- var Sale_1 = require("./Sale");
38
- Object.defineProperty(exports, "Sale", { enumerable: true, get: function () { return Sale_1.Sale; } });
39
- exports.Exceptions = __importStar(require("./Exceptions"));
1
+ export { BaseSale } from "./BaseSale.js";
2
+ export * as Exceptions from "./Exceptions.js";
3
+ export { Sale } from "./Sale.js";
4
+ export { SaleCustomer } from "./SaleCustomer.js";
5
+ export { SalePayment } from "./SalePayment.js";
6
+ export { SalePaymentStatus } from "./SalePayment.js";
7
+ export { SaleProduct } from "./SaleProduct.js";
@@ -1,5 +1,5 @@
1
- import { EventEmitter } from "../Common/EventEmitter";
2
- import { Serializable, Serialized } from "../Common/Serializable";
1
+ import { EventEmitter } from "../Common/EventEmitter.js";
2
+ import { Serializable, Serialized } from "../Common/Serializable.js";
3
3
  interface BaseActionConstructor<T> {
4
4
  new (...args: Array<never>): BaseAction<T>;
5
5
  new (serialized: Serialized<T>): BaseAction<T>;
@@ -12,15 +12,31 @@ export declare class BaseAction<T> extends EventEmitter {
12
12
  id: string;
13
13
  }>;
14
14
  protected properties: Array<unknown>;
15
- static serializedRegistry: {
16
- [id: string]: BaseActionConstructor<unknown>;
17
- };
15
+ static serializedRegistry: Record<string, BaseActionConstructor<unknown>>;
18
16
  constructor(serialized: Serialized<T>, type: BaseActionConstructor<T>);
17
+ /**
18
+ * Serializes the registered action event data (excluding callbacks) and properties
19
+ */
19
20
  serialize(): Serialized<T>;
21
+ /**
22
+ * Recursively serializes the action properties
23
+ */
20
24
  protected serializeProperties(properties: Array<unknown>): Array<unknown>;
25
+ /**
26
+ * Deserializes the action data
27
+ */
21
28
  static deserialize<T extends Serializable<T>>(serialized: Serialized<T>): T;
29
+ /**
30
+ * Registers an action event listener
31
+ */
22
32
  addEventListener(event: string, callback: (...args: Array<unknown>) => void): void;
33
+ /**
34
+ * Unregisters an action event listener
35
+ */
23
36
  removeEventListener(event: string, callback: (...args: Array<unknown>) => void): void;
37
+ /**
38
+ * Fires the callback for the registered action event
39
+ */
24
40
  handleRegistrarEvent(id: string, data: unknown): void;
25
41
  }
26
42
  export {};