@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.
- package/.idea/codeStyles/Project.xml +10 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/inspectionProfiles/Project_Default.xml +5 -0
- package/.idea/jsLinters/eslint.xml +6 -0
- package/.idea/modules.xml +1 -1
- package/.idea/php.xml +15 -0
- package/lib/APIs/Database/BaseDatabase.d.ts +28 -0
- package/lib/APIs/Database/BaseDatabase.js +5 -0
- package/lib/APIs/Database/Database.d.ts +19 -7
- package/lib/APIs/Database/Database.js +22 -12
- package/lib/APIs/Database/types/BaseBarcodeTemplateRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseBarcodeTemplateRepository.js +1 -0
- package/lib/APIs/Database/types/BaseClassificationRepository.d.ts +11 -0
- package/lib/APIs/Database/types/BaseClassificationRepository.js +1 -0
- package/lib/APIs/Database/types/BaseCustomerDisplayRepository.d.ts +10 -0
- package/lib/APIs/Database/types/BaseCustomerDisplayRepository.js +1 -0
- package/lib/APIs/Database/types/BaseCustomerGroupRepository.d.ts +24 -0
- package/lib/APIs/Database/types/BaseCustomerGroupRepository.js +1 -0
- package/lib/APIs/Database/types/BaseCustomerRepository.d.ts +76 -0
- package/lib/APIs/Database/types/BaseCustomerRepository.js +1 -0
- package/lib/APIs/Database/types/BaseEnterpriseRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseEnterpriseRepository.js +1 -0
- package/lib/APIs/Database/types/BaseGiftCardRepository.d.ts +18 -0
- package/lib/APIs/Database/types/BaseGiftCardRepository.js +1 -0
- package/lib/APIs/Database/types/BaseKitchenOrderRepository.d.ts +41 -0
- package/lib/APIs/Database/types/BaseKitchenOrderRepository.js +1 -0
- package/lib/APIs/Database/types/BaseKitchenScreenRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseKitchenScreenRepository.js +1 -0
- package/lib/APIs/Database/types/BaseLockedResourceRepository.d.ts +12 -0
- package/lib/APIs/Database/types/BaseLockedResourceRepository.js +1 -0
- package/lib/APIs/Database/types/BaseLoyaltyRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseLoyaltyRepository.js +1 -0
- package/lib/APIs/Database/types/BaseMovementRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseMovementRepository.js +1 -0
- package/lib/APIs/Database/types/BaseOutletRepository.d.ts +19 -0
- package/lib/APIs/Database/types/BaseOutletRepository.js +1 -0
- package/lib/APIs/Database/types/BasePaymentMethodRepository.d.ts +27 -0
- package/lib/APIs/Database/types/BasePaymentMethodRepository.js +1 -0
- package/lib/APIs/Database/types/BasePriceListRepository.d.ts +40 -0
- package/lib/APIs/Database/types/BasePriceListRepository.js +1 -0
- package/lib/APIs/Database/types/BasePriceSetRepository.d.ts +6 -0
- package/lib/APIs/Database/types/BasePriceSetRepository.js +1 -0
- package/lib/APIs/Database/types/BaseProductRepository.d.ts +160 -0
- package/lib/APIs/Database/types/BaseProductRepository.js +1 -0
- package/lib/APIs/Database/types/BasePromotionCategoryRepository.d.ts +10 -0
- package/lib/APIs/Database/types/BasePromotionCategoryRepository.js +1 -0
- package/lib/APIs/Database/types/BasePromotionRepository.d.ts +72 -0
- package/lib/APIs/Database/types/BasePromotionRepository.js +1 -0
- package/lib/APIs/Database/types/BaseReceiptRepository.d.ts +31 -0
- package/lib/APIs/Database/types/BaseReceiptRepository.js +1 -0
- package/lib/APIs/Database/types/BaseRegisterRepository.d.ts +56 -0
- package/lib/APIs/Database/types/BaseRegisterRepository.js +1 -0
- package/lib/APIs/Database/types/BaseRepository.d.ts +41 -0
- package/lib/APIs/Database/types/BaseRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSalesKeyRepository.d.ts +37 -0
- package/lib/APIs/Database/types/BaseSalesKeyRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSalesRepository.d.ts +123 -0
- package/lib/APIs/Database/types/BaseSalesRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSearchableRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseSearchableRepository.js +1 -0
- package/lib/APIs/Database/types/BaseStocktakeAccumulatedRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseStocktakeAccumulatedRepository.js +1 -0
- package/lib/APIs/Database/types/BaseStocktakeRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseStocktakeRepository.js +1 -0
- package/lib/APIs/Database/types/BaseStocktakeScannedRepository.d.ts +24 -0
- package/lib/APIs/Database/types/BaseStocktakeScannedRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSupplierRepository.d.ts +35 -0
- package/lib/APIs/Database/types/BaseSupplierRepository.js +1 -0
- package/lib/APIs/Database/types/BaseTakingsRepository.d.ts +13 -0
- package/lib/APIs/Database/types/BaseTakingsRepository.js +1 -0
- package/lib/APIs/Database/types/BaseTaxRateRepository.d.ts +9 -0
- package/lib/APIs/Database/types/BaseTaxRateRepository.js +1 -0
- package/lib/APIs/Database/types/BaseTransfereeRepository.d.ts +12 -0
- package/lib/APIs/Database/types/BaseTransfereeRepository.js +1 -0
- package/lib/APIs/Database/types/BaseVendorConnectionRepository.d.ts +7 -0
- package/lib/APIs/Database/types/BaseVendorConnectionRepository.js +1 -0
- package/lib/APIs/Database/types/DataSourceTables.d.ts +61 -0
- package/lib/APIs/Database/types/DataSourceTables.js +1 -0
- package/lib/APIs/Fulfilment/FulfilmentTypes.d.ts +2 -2
- package/lib/APIs/Fulfilment/FulfilmentTypes.js +1 -2
- package/lib/APIs/InternalMessages/InternalMessageSource.d.ts +6 -3
- package/lib/APIs/InternalMessages/InternalMessageSource.js +6 -7
- package/lib/APIs/Sale/BaseCurrentSale.d.ts +83 -0
- package/lib/APIs/Sale/BaseCurrentSale.js +13 -0
- package/lib/APIs/Sale/BaseSale.d.ts +3 -38
- package/lib/APIs/Sale/BaseSale.js +1 -40
- package/lib/APIs/Sale/CurrentSale.d.ts +19 -84
- package/lib/APIs/Sale/CurrentSale.js +32 -102
- package/lib/APIs/Sale/Exceptions.d.ts +3 -0
- package/lib/APIs/Sale/Exceptions.js +7 -7
- package/lib/APIs/Sale/Sale.d.ts +39 -7
- package/lib/APIs/Sale/Sale.js +41 -13
- package/lib/APIs/Sale/SaleCustomer.d.ts +0 -2
- package/lib/APIs/Sale/SaleCustomer.js +1 -7
- package/lib/APIs/Sale/SalePayment.d.ts +3 -22
- package/lib/APIs/Sale/SalePayment.js +7 -33
- package/lib/APIs/Sale/SaleProduct.d.ts +6 -46
- package/lib/APIs/Sale/SaleProduct.js +6 -53
- package/lib/APIs/Sale/ShopfrontSaleState.d.ts +7 -9
- package/lib/APIs/Sale/ShopfrontSaleState.js +1 -2
- package/lib/APIs/Sale/index.d.ts +9 -9
- package/lib/APIs/Sale/index.js +7 -39
- package/lib/Actions/BaseAction.d.ts +21 -5
- package/lib/Actions/BaseAction.js +155 -97
- package/lib/Actions/Button.d.ts +2 -2
- package/lib/Actions/Button.js +3 -7
- package/lib/Actions/CustomerListOption.d.ts +2 -2
- package/lib/Actions/CustomerListOption.js +2 -6
- package/lib/Actions/Dialog.d.ts +4 -4
- package/lib/Actions/Dialog.js +2 -6
- package/lib/Actions/Redirect.d.ts +2 -2
- package/lib/Actions/Redirect.js +7 -9
- package/lib/Actions/SaleKey.d.ts +2 -2
- package/lib/Actions/SaleKey.js +3 -7
- package/lib/Actions/SaleUpdate.d.ts +3 -3
- package/lib/Actions/SaleUpdate.js +3 -7
- package/lib/Actions/Toast.d.ts +3 -3
- package/lib/Actions/Toast.js +2 -6
- package/lib/Application.d.ts +114 -78
- package/lib/Application.js +207 -160
- package/lib/ApplicationEvents.d.ts +66 -53
- package/lib/ApplicationEvents.js +10 -6
- package/lib/BaseApplication.d.ts +169 -0
- package/lib/BaseApplication.js +40 -0
- package/lib/BaseBridge.d.ts +33 -0
- package/lib/BaseBridge.js +16 -0
- package/lib/Bridge.d.ts +46 -9
- package/lib/Bridge.js +42 -54
- package/lib/Common/EventEmitter.d.ts +10 -1
- package/lib/Common/EventEmitter.js +10 -5
- package/lib/Common/Serializable.d.ts +8 -6
- package/lib/Common/Serializable.js +1 -2
- package/lib/EmitableEvents/BaseEmitableEvent.d.ts +7 -1
- package/lib/EmitableEvents/BaseEmitableEvent.js +7 -5
- package/lib/EmitableEvents/Fulfilment/Options.d.ts +1 -1
- package/lib/EmitableEvents/Fulfilment/Options.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrderCancel.d.ts +1 -1
- package/lib/EmitableEvents/Fulfilment/OrderCancel.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrderCreate.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/OrderCreate.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrderUpdate.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/OrderUpdate.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrdersSync.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/OrdersSync.js +4 -8
- package/lib/EmitableEvents/Fulfilment/RegisterIntent.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/RegisterIntent.js +4 -8
- package/lib/EmitableEvents/Fulfilment/index.d.ts +7 -7
- package/lib/EmitableEvents/Fulfilment/index.js +6 -15
- package/lib/EmitableEvents/InternalMessage.d.ts +2 -2
- package/lib/EmitableEvents/InternalMessage.js +4 -8
- package/lib/EmitableEvents/SellScreenOption.d.ts +2 -2
- package/lib/EmitableEvents/SellScreenOption.js +7 -11
- package/lib/EmitableEvents/SellScreenPromotionApplicable.d.ts +1 -1
- package/lib/EmitableEvents/SellScreenPromotionApplicable.js +4 -8
- package/lib/EmitableEvents/TableUpdate.d.ts +2 -2
- package/lib/EmitableEvents/TableUpdate.js +4 -8
- package/lib/Events/AudioPermissionChange.d.ts +5 -2
- package/lib/Events/AudioPermissionChange.js +6 -7
- package/lib/Events/AudioReady.d.ts +5 -2
- package/lib/Events/AudioReady.js +6 -7
- package/lib/Events/BaseEvent.d.ts +8 -3
- package/lib/Events/BaseEvent.js +1 -6
- package/lib/Events/Callback.d.ts +5 -2
- package/lib/Events/Callback.js +5 -6
- package/lib/Events/FormatIntegratedProduct.d.ts +27 -32
- package/lib/Events/FormatIntegratedProduct.js +12 -9
- package/lib/Events/FulfilmentCollectOrder.d.ts +5 -2
- package/lib/Events/FulfilmentCollectOrder.js +5 -6
- package/lib/Events/FulfilmentCompleteOrder.d.ts +5 -2
- package/lib/Events/FulfilmentCompleteOrder.js +5 -6
- package/lib/Events/FulfilmentGetOrder.d.ts +12 -6
- package/lib/Events/FulfilmentGetOrder.js +10 -8
- package/lib/Events/FulfilmentOrderApproval.d.ts +5 -2
- package/lib/Events/FulfilmentOrderApproval.js +5 -6
- package/lib/Events/FulfilmentProcessOrder.d.ts +12 -10
- package/lib/Events/FulfilmentProcessOrder.js +7 -8
- package/lib/Events/FulfilmentVoidOrder.d.ts +5 -2
- package/lib/Events/FulfilmentVoidOrder.js +5 -6
- package/lib/Events/GiftCardCodeCheck.d.ts +19 -0
- package/lib/Events/GiftCardCodeCheck.js +23 -0
- package/lib/Events/InternalPageMessage.d.ts +10 -4
- package/lib/Events/InternalPageMessage.js +12 -10
- package/lib/Events/PaymentMethodsEnabled.d.ts +16 -11
- package/lib/Events/PaymentMethodsEnabled.js +10 -8
- package/lib/Events/Ready.d.ts +12 -7
- package/lib/Events/Ready.js +5 -6
- package/lib/Events/RegisterChanged.d.ts +12 -6
- package/lib/Events/RegisterChanged.js +6 -7
- package/lib/Events/RequestButtons.d.ts +17 -12
- package/lib/Events/RequestButtons.js +13 -11
- package/lib/Events/RequestCustomerListOptions.d.ts +11 -5
- package/lib/Events/RequestCustomerListOptions.js +12 -11
- package/lib/Events/RequestSaleKeys.d.ts +12 -6
- package/lib/Events/RequestSaleKeys.js +13 -11
- package/lib/Events/RequestSellScreenOptions.d.ts +18 -5
- package/lib/Events/RequestSellScreenOptions.js +17 -9
- package/lib/Events/RequestSettings.d.ts +11 -5
- package/lib/Events/RequestSettings.js +12 -10
- package/lib/Events/RequestTableColumns.d.ts +16 -11
- package/lib/Events/RequestTableColumns.js +12 -9
- package/lib/Events/SaleComplete.d.ts +15 -18
- package/lib/Events/SaleComplete.js +6 -7
- package/lib/Events/UIPipeline.d.ts +17 -5
- package/lib/Events/UIPipeline.js +17 -10
- package/lib/Mocks/APIs/Sale/MockCurrentSale.d.ts +99 -0
- package/lib/Mocks/APIs/Sale/MockCurrentSale.js +326 -0
- package/lib/Mocks/Database/MockDatabase.d.ts +96 -0
- package/lib/Mocks/Database/MockDatabase.js +89 -0
- package/lib/Mocks/MockApplication.d.ts +154 -0
- package/lib/Mocks/MockApplication.js +481 -0
- package/lib/Mocks/MockBridge.d.ts +31 -0
- package/lib/Mocks/MockBridge.js +77 -0
- package/lib/Mocks/index.d.ts +7 -0
- package/lib/Mocks/index.js +15 -0
- package/lib/Utilities/ActionEventRegistrar.d.ts +19 -4
- package/lib/Utilities/ActionEventRegistrar.js +19 -3
- package/lib/Utilities/MiscTypes.d.ts +6 -4
- package/lib/Utilities/MiscTypes.js +1 -2
- package/lib/Utilities/SaleCreate.d.ts +6 -2
- package/lib/Utilities/SaleCreate.js +10 -6
- package/lib/Utilities/Static.d.ts +3 -0
- package/lib/Utilities/Static.js +5 -7
- package/lib/Utilities/UUID.d.ts +9 -3
- package/lib/Utilities/UUID.js +10 -7
- package/lib/index.d.ts +16 -14
- package/lib/index.js +14 -49
- package/package.json +3 -2
- package/lib/APIs/CurrentSale/Exceptions.d.ts +0 -6
- package/lib/APIs/CurrentSale/Exceptions.js +0 -15
- package/lib/APIs/CurrentSale/Sale.d.ts +0 -182
- package/lib/APIs/CurrentSale/Sale.js +0 -290
- package/lib/APIs/CurrentSale/SaleCustomer.d.ts +0 -10
- package/lib/APIs/CurrentSale/SaleCustomer.js +0 -17
- package/lib/APIs/CurrentSale/SalePayment.d.ts +0 -68
- package/lib/APIs/CurrentSale/SalePayment.js +0 -99
- package/lib/APIs/CurrentSale/SaleProduct.d.ts +0 -121
- package/lib/APIs/CurrentSale/SaleProduct.js +0 -167
- package/lib/APIs/CurrentSale/ShopfrontSaleState.d.ts +0 -53
- package/lib/APIs/CurrentSale/ShopfrontSaleState.js +0 -2
- package/lib/APIs/CurrentSale/index.d.ts +0 -6
- package/lib/APIs/CurrentSale/index.js +0 -37
- /package/.idea/{embedded-bridge.iml → shopfront-embedded-bridge.iml} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AudioPermissionChange = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class AudioPermissionChange extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class AudioPermissionChange extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit(data) {
|
|
10
|
-
this.callback(data, undefined);
|
|
10
|
+
return this.callback(data, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.AudioPermissionChange = AudioPermissionChange;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class AudioReady extends BaseEvent<undefined> {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["AUDIO_READY"]);
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
5
8
|
emit(): Promise<FromShopfrontReturns["AUDIO_READY"]>;
|
|
6
9
|
}
|
package/lib/Events/AudioReady.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AudioReady = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class AudioReady extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class AudioReady extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit() {
|
|
10
|
-
this.callback(undefined, undefined);
|
|
10
|
+
return this.callback(undefined, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.AudioReady = AudioReady;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BaseBridge } from "../BaseBridge.js";
|
|
2
|
+
type _Infer = any;
|
|
3
|
+
export declare abstract class BaseEvent<TData = _Infer, TCallbackReturn = void, TEmitReturn = _Infer, TCallbackData = TData, TCallbackContext = undefined> {
|
|
3
4
|
protected callback: (data: TCallbackData, context: TCallbackContext) => TCallbackReturn;
|
|
4
5
|
protected constructor(callback: (data: TCallbackData, context: TCallbackContext) => TCallbackReturn);
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Invokes the registered callback
|
|
8
|
+
*/
|
|
9
|
+
abstract emit(data: TData, bridge?: BaseBridge): Promise<TEmitReturn>;
|
|
6
10
|
}
|
|
11
|
+
export {};
|
package/lib/Events/BaseEvent.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseEvent = void 0;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
class BaseEvent {
|
|
1
|
+
export class BaseEvent {
|
|
6
2
|
constructor(callback) {
|
|
7
3
|
this.callback = callback;
|
|
8
4
|
}
|
|
9
5
|
}
|
|
10
|
-
exports.BaseEvent = BaseEvent;
|
package/lib/Events/Callback.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents";
|
|
2
|
-
import { BaseEvent } from "./BaseEvent";
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class Callback extends BaseEvent {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["CALLBACK"]);
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
5
8
|
emit(): Promise<FromShopfrontReturns["CALLBACK"]>;
|
|
6
9
|
}
|
package/lib/Events/Callback.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Callback = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class Callback extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class Callback extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit() {
|
|
10
10
|
return this.callback(undefined, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.Callback = Callback;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseBridge } from "../BaseBridge.js";
|
|
3
|
+
import { MaybePromise } from "../Utilities/MiscTypes.js";
|
|
4
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
5
|
+
export type FormattedSaleProductType = "Normal" | "Product" | "GiftCard" | "Voucher" | "Basket" | "Package" | "Component" | "Integrated";
|
|
6
6
|
export interface SaleGiftCard {
|
|
7
7
|
code: string;
|
|
8
8
|
amount: number;
|
|
@@ -36,19 +36,15 @@ export interface FormattedSaleProduct {
|
|
|
36
36
|
defaultProducts: Array<FormattedSaleProduct>;
|
|
37
37
|
special: boolean;
|
|
38
38
|
edited: boolean;
|
|
39
|
-
promotions: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
amount: number;
|
|
49
|
-
quantity: number;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
39
|
+
promotions: Record<string, {
|
|
40
|
+
name: string;
|
|
41
|
+
active: boolean;
|
|
42
|
+
quantity: number;
|
|
43
|
+
}>;
|
|
44
|
+
rebates: Record<string, {
|
|
45
|
+
amount: number;
|
|
46
|
+
quantity: number;
|
|
47
|
+
}>;
|
|
52
48
|
giftCard: SaleGiftCard | null;
|
|
53
49
|
note: string;
|
|
54
50
|
userId: null | string;
|
|
@@ -60,24 +56,23 @@ export interface FormattedSaleProduct {
|
|
|
60
56
|
discountReason?: string;
|
|
61
57
|
requestPrice?: boolean;
|
|
62
58
|
lockQuantity: boolean;
|
|
63
|
-
metaData:
|
|
64
|
-
[key: string]: unknown;
|
|
65
|
-
};
|
|
59
|
+
metaData: Record<string, unknown>;
|
|
66
60
|
}
|
|
67
|
-
|
|
61
|
+
interface FormattedIntegratedProductData {
|
|
68
62
|
data: {
|
|
69
63
|
product: FormattedSaleProduct;
|
|
70
64
|
};
|
|
71
65
|
context: Record<string, never>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}, Record<string, never>> {
|
|
66
|
+
}
|
|
67
|
+
export declare class FormatIntegratedProduct extends BaseEvent<FormattedIntegratedProductData, MaybePromise<FromShopfrontReturns["FORMAT_INTEGRATED_PRODUCT"]>, FromShopfrontReturns["FORMAT_INTEGRATED_PRODUCT"], FormattedIntegratedProductData["data"], Record<string, never>> {
|
|
75
68
|
constructor(callback: FromShopfrontCallbacks["FORMAT_INTEGRATED_PRODUCT"]);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
/**
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
emit(data: FormattedIntegratedProductData): Promise<FromShopfrontReturns["FORMAT_INTEGRATED_PRODUCT"]>;
|
|
73
|
+
/**
|
|
74
|
+
* Sends the response data to Shopfront
|
|
75
|
+
*/
|
|
76
|
+
static respond(bridge: BaseBridge, data: Array<FromShopfrontReturns["FORMAT_INTEGRATED_PRODUCT"]>, id: string): Promise<void>;
|
|
83
77
|
}
|
|
78
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
const ApplicationEvents_1 = require("../ApplicationEvents");
|
|
6
|
-
class FormatIntegratedProduct extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { ToShopfront, } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
|
+
export class FormatIntegratedProduct extends BaseEvent {
|
|
7
4
|
constructor(callback) {
|
|
8
5
|
super(callback);
|
|
9
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
10
|
async emit(data) {
|
|
11
11
|
const result = await this.callback(data.data, data.context);
|
|
12
12
|
if (typeof result !== "object" || result === null) {
|
|
@@ -14,11 +14,14 @@ class FormatIntegratedProduct extends BaseEvent_1.BaseEvent {
|
|
|
14
14
|
}
|
|
15
15
|
return result;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Sends the response data to Shopfront
|
|
19
|
+
*/
|
|
17
20
|
static async respond(bridge, data, id) {
|
|
18
21
|
if (data.length > 1) {
|
|
19
|
-
throw new Error("Multiple integrated product responses found,
|
|
22
|
+
throw new Error("Multiple integrated product responses found, " +
|
|
23
|
+
"please ensure you are only subscribed to FORMAT_INTEGRATED_PRODUCT once");
|
|
20
24
|
}
|
|
21
|
-
bridge.sendMessage(
|
|
25
|
+
bridge.sendMessage(ToShopfront.RESPONSE_FORMAT_PRODUCT, data[0], id);
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
|
-
exports.FormatIntegratedProduct = FormatIntegratedProduct;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class FulfilmentCollectOrder extends BaseEvent {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_ORDER_COLLECTED"]);
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
5
8
|
emit(data: string): Promise<FromShopfrontReturns["FULFILMENT_ORDER_COLLECTED"]>;
|
|
6
9
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FulfilmentCollectOrder = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class FulfilmentCollectOrder extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class FulfilmentCollectOrder extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit(data) {
|
|
10
10
|
return this.callback(data, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.FulfilmentCollectOrder = FulfilmentCollectOrder;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class FulfilmentCompleteOrder extends BaseEvent {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_ORDER_COMPLETED"]);
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
5
8
|
emit(data: string): Promise<FromShopfrontReturns["FULFILMENT_ORDER_COLLECTED"]>;
|
|
6
9
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FulfilmentCompleteOrder = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class FulfilmentCompleteOrder extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class FulfilmentCompleteOrder extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit(data) {
|
|
10
10
|
return this.callback(data, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.FulfilmentCompleteOrder = FulfilmentCompleteOrder;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { OrderDetails } from "../APIs/Fulfilment/FulfilmentTypes.js";
|
|
2
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
3
|
+
import { BaseBridge } from "../BaseBridge.js";
|
|
4
|
+
import { MaybePromise } from "../Utilities/MiscTypes.js";
|
|
5
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
6
6
|
export declare class FulfilmentGetOrder extends BaseEvent<string, MaybePromise<FromShopfrontReturns["FULFILMENT_GET_ORDER"]>, MaybePromise<FromShopfrontReturns["FULFILMENT_GET_ORDER"]>> {
|
|
7
7
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_GET_ORDER"]);
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
8
11
|
emit(data: string): Promise<FromShopfrontReturns["FULFILMENT_GET_ORDER"]>;
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Sends the response data to Shopfront
|
|
14
|
+
*/
|
|
15
|
+
static respond(bridge: BaseBridge, order: OrderDetails, id: string): Promise<void>;
|
|
10
16
|
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
const ApplicationEvents_1 = require("../ApplicationEvents");
|
|
6
|
-
class FulfilmentGetOrder extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { ToShopfront } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
|
+
export class FulfilmentGetOrder extends BaseEvent {
|
|
7
4
|
constructor(callback) {
|
|
8
5
|
super(callback);
|
|
9
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
10
|
async emit(data) {
|
|
11
11
|
return this.callback(data, undefined);
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Sends the response data to Shopfront
|
|
15
|
+
*/
|
|
13
16
|
static async respond(bridge, order, id) {
|
|
14
|
-
bridge.sendMessage(
|
|
17
|
+
bridge.sendMessage(ToShopfront.FULFILMENT_GET_ORDER, order, id);
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
|
-
exports.FulfilmentGetOrder = FulfilmentGetOrder;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns, FulfilmentApprovalEvent } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class FulfilmentOrderApproval extends BaseEvent<FulfilmentApprovalEvent, FromShopfrontReturns["FULFILMENT_ORDER_APPROVAL"], FromShopfrontReturns["FULFILMENT_ORDER_APPROVAL"]> {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_ORDER_APPROVAL"]);
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
5
8
|
emit(data: FulfilmentApprovalEvent): Promise<FromShopfrontReturns["FULFILMENT_ORDER_APPROVAL"]>;
|
|
6
9
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FulfilmentOrderApproval = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class FulfilmentOrderApproval extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class FulfilmentOrderApproval extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit(data) {
|
|
10
10
|
return this.callback(data, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.FulfilmentOrderApproval = FulfilmentOrderApproval;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FromShopfrontCallbacks, FromShopfrontReturns, FulfilmentProcessEvent } from "../ApplicationEvents";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { ShopfrontSaleState } from "../APIs/Sale/index.js";
|
|
2
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns, FulfilmentProcessEvent } from "../ApplicationEvents.js";
|
|
3
|
+
import { MaybePromise } from "../Utilities/MiscTypes.js";
|
|
4
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
5
|
+
interface FulfilmentProcessOrderData {
|
|
6
6
|
id: string;
|
|
7
7
|
sale: ShopfrontSaleState;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
|
+
export declare class FulfilmentProcessOrder extends BaseEvent<FulfilmentProcessOrderData, MaybePromise<FromShopfrontReturns["FULFILMENT_PROCESS_ORDER"]>, MaybePromise<FromShopfrontReturns["FULFILMENT_PROCESS_ORDER"]>, FulfilmentProcessEvent> {
|
|
9
10
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_PROCESS_ORDER"]);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
emit(data: FulfilmentProcessOrderData): Promise<FromShopfrontReturns["FULFILMENT_PROCESS_ORDER"]>;
|
|
14
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
const Sale_1 = require("../APIs/Sale");
|
|
6
|
-
class FulfilmentProcessOrder extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { Sale } from "../APIs/Sale/index.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
|
+
export class FulfilmentProcessOrder extends BaseEvent {
|
|
7
4
|
constructor(callback) {
|
|
8
5
|
super(callback);
|
|
9
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
10
|
async emit(data) {
|
|
11
11
|
return this.callback({
|
|
12
12
|
id: data.id,
|
|
13
|
-
sale: new
|
|
13
|
+
sale: new Sale(Sale.buildSaleData(data.sale)),
|
|
14
14
|
}, undefined);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.FulfilmentProcessOrder = FulfilmentProcessOrder;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class FulfilmentVoidOrder extends BaseEvent {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_VOID_ORDER"]);
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
5
8
|
emit(data: string): Promise<FromShopfrontReturns["FULFILMENT_VOID_ORDER"]>;
|
|
6
9
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FulfilmentVoidOrder = void 0;
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
class FulfilmentVoidOrder extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
2
|
+
export class FulfilmentVoidOrder extends BaseEvent {
|
|
6
3
|
constructor(callback) {
|
|
7
4
|
super(callback);
|
|
8
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @inheritDoc
|
|
8
|
+
*/
|
|
9
9
|
async emit(data) {
|
|
10
10
|
return this.callback(data, undefined);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.FulfilmentVoidOrder = FulfilmentVoidOrder;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns, GiftCardCodeCheckEvent } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseBridge } from "../BaseBridge.js";
|
|
3
|
+
import { MaybePromise } from "../Utilities/MiscTypes.js";
|
|
4
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
5
|
+
interface GiftCardCodeCheckData {
|
|
6
|
+
data: GiftCardCodeCheckEvent;
|
|
7
|
+
}
|
|
8
|
+
export declare class GiftCardCodeCheck extends BaseEvent<GiftCardCodeCheckData, MaybePromise<FromShopfrontReturns["GIFT_CARD_CODE_CHECK"]>, FromShopfrontReturns["GIFT_CARD_CODE_CHECK"], GiftCardCodeCheckEvent> {
|
|
9
|
+
constructor(callback: FromShopfrontCallbacks["GIFT_CARD_CODE_CHECK"]);
|
|
10
|
+
/**
|
|
11
|
+
* @inheritDoc
|
|
12
|
+
*/
|
|
13
|
+
emit(data: GiftCardCodeCheckData): Promise<FromShopfrontReturns["GIFT_CARD_CODE_CHECK"]>;
|
|
14
|
+
/**
|
|
15
|
+
* Sends the response data to Shopfront
|
|
16
|
+
*/
|
|
17
|
+
static respond(bridge: BaseBridge, data: FromShopfrontReturns["GIFT_CARD_CODE_CHECK"], id: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ToShopfront, } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
|
+
export class GiftCardCodeCheck extends BaseEvent {
|
|
4
|
+
constructor(callback) {
|
|
5
|
+
super(callback);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
|
+
async emit(data) {
|
|
11
|
+
const result = await this.callback(data.data, undefined);
|
|
12
|
+
if (typeof result !== "object") {
|
|
13
|
+
throw new TypeError("Callback must return an object");
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Sends the response data to Shopfront
|
|
19
|
+
*/
|
|
20
|
+
static async respond(bridge, data, id) {
|
|
21
|
+
bridge.sendMessage(ToShopfront.RESPONSE_GIFT_CARD_CODE_CHECK, data, id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { InternalMessageSource } from "../APIs/InternalMessages/InternalMessageSource.js";
|
|
2
|
+
import { Application } from "../Application.js";
|
|
3
|
+
import { FromShopfront, FromShopfrontCallbacks, FromShopfrontReturns, InternalPageMessageEvent } from "../ApplicationEvents.js";
|
|
4
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
5
5
|
export declare class InternalPageMessage extends BaseEvent<InternalPageMessageEvent> {
|
|
6
6
|
protected application: Application;
|
|
7
7
|
constructor(callback: FromShopfrontCallbacks["INTERNAL_PAGE_MESSAGE"], application: Application);
|
|
8
|
+
/**
|
|
9
|
+
* Creates and returns a new internal message source
|
|
10
|
+
*/
|
|
8
11
|
protected createReference(method: keyof FromShopfront | "EXTERNAL_APPLICATION", url: string): InternalMessageSource;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
9
15
|
emit(data: InternalPageMessageEvent): Promise<FromShopfrontReturns["INTERNAL_PAGE_MESSAGE"]>;
|
|
10
16
|
}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const BaseEvent_1 = require("./BaseEvent");
|
|
5
|
-
const InternalMessageSource_1 = require("../APIs/InternalMessages/InternalMessageSource");
|
|
6
|
-
class InternalPageMessage extends BaseEvent_1.BaseEvent {
|
|
1
|
+
import { InternalMessageSource } from "../APIs/InternalMessages/InternalMessageSource.js";
|
|
2
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
3
|
+
export class InternalPageMessage extends BaseEvent {
|
|
7
4
|
constructor(callback, application) {
|
|
8
5
|
super(callback);
|
|
9
6
|
this.application = application;
|
|
10
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates and returns a new internal message source
|
|
10
|
+
*/
|
|
11
11
|
createReference(method, url) {
|
|
12
|
-
return new
|
|
12
|
+
return new InternalMessageSource(this.application, method, url);
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
14
17
|
async emit(data) {
|
|
15
|
-
this.callback({
|
|
18
|
+
return this.callback({
|
|
16
19
|
method: data.method,
|
|
17
20
|
url: data.url,
|
|
18
21
|
message: data.message,
|
|
19
|
-
reference: this.createReference(data.method, data.url)
|
|
22
|
+
reference: this.createReference(data.method, data.url),
|
|
20
23
|
}, undefined);
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
|
-
exports.InternalPageMessage = InternalPageMessage;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { FromShopfrontCallbacks, FromShopfrontReturns, PaymentMethodEnabledContext, SellScreenPaymentMethod } from "../ApplicationEvents.js";
|
|
2
|
+
import { BaseBridge } from "../BaseBridge.js";
|
|
3
|
+
import { MaybePromise } from "../Utilities/MiscTypes.js";
|
|
4
|
+
import { BaseEvent } from "./BaseEvent.js";
|
|
5
|
+
interface PaymentMethodsEnabledData {
|
|
6
6
|
data: Array<SellScreenPaymentMethod>;
|
|
7
7
|
context: PaymentMethodEnabledContext;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
|
+
export declare class PaymentMethodsEnabled extends BaseEvent<PaymentMethodsEnabledData, MaybePromise<FromShopfrontReturns["PAYMENT_METHODS_ENABLED"]>, FromShopfrontReturns["PAYMENT_METHODS_ENABLED"], Array<SellScreenPaymentMethod>, PaymentMethodEnabledContext> {
|
|
9
10
|
constructor(callback: FromShopfrontCallbacks["PAYMENT_METHODS_ENABLED"]);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
emit(data: PaymentMethodsEnabledData): Promise<FromShopfrontReturns["PAYMENT_METHODS_ENABLED"]>;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the response data to Shopfront
|
|
17
|
+
*/
|
|
18
|
+
static respond(bridge: BaseBridge, data: FromShopfrontReturns["PAYMENT_METHODS_ENABLED"], id: string): Promise<void>;
|
|
15
19
|
}
|
|
20
|
+
export {};
|