@shopfront/bridge 3.0.2 → 3.0.3--canary.21.f9983a3.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.
- package/lib/APIs/InternalMessages/InternalMessageSource.d.ts +1 -1
- package/lib/APIs/Sale/index.d.ts +1 -1
- package/lib/Actions/index.d.ts +6 -0
- package/lib/Application.d.ts +3 -2
- package/lib/ApplicationEvents/DirectShopfront.d.ts +64 -0
- package/lib/ApplicationEvents/ToShopfront.d.ts +268 -0
- package/lib/ApplicationEvents/index.d.ts +3 -0
- package/lib/BaseApplication.d.ts +4 -1
- package/lib/BaseBridge.d.ts +3 -3
- package/lib/Bridge.d.ts +5 -5
- package/lib/EmitableEvents/BaseEmitableEvent.d.ts +1 -1
- package/lib/EmitableEvents/TableUpdate.d.ts +3 -3
- package/lib/EmitableEvents/index.d.ts +6 -0
- package/lib/Events/AudioPermissionChange.d.ts +2 -2
- package/lib/Events/AudioReady.d.ts +2 -2
- package/lib/Events/Callback.d.ts +2 -2
- package/lib/Events/DirectEvents/BaseDirectEvent.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleAddCustomer.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleAddProduct.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleChangeQuantity.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleClear.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleRemoveCustomer.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleRemoveProduct.d.ts +1 -1
- package/lib/Events/DirectEvents/SaleUpdateProducts.d.ts +1 -1
- package/lib/Events/FormatIntegratedProduct.d.ts +4 -4
- package/lib/Events/FulfilmentCollectOrder.d.ts +2 -2
- package/lib/Events/FulfilmentCompleteOrder.d.ts +2 -2
- package/lib/Events/FulfilmentGetOrder.d.ts +3 -3
- package/lib/Events/FulfilmentOrderApproval.d.ts +3 -3
- package/lib/Events/FulfilmentProcessOrder.d.ts +3 -3
- package/lib/Events/FulfilmentVoidOrder.d.ts +2 -2
- package/lib/Events/GiftCardCodeCheck.d.ts +4 -4
- package/lib/Events/InternalPageMessage.d.ts +2 -2
- package/lib/Events/PaymentMethodsEnabled.d.ts +4 -4
- package/lib/Events/Ready.d.ts +2 -2
- package/lib/Events/RegisterChanged.d.ts +2 -2
- package/lib/Events/RequestButtons.d.ts +3 -3
- package/lib/Events/RequestCustomerListOptions.d.ts +3 -3
- package/lib/Events/RequestSaleKeys.d.ts +2 -2
- package/lib/Events/RequestSellScreenOptions.d.ts +3 -3
- package/lib/Events/RequestSettings.d.ts +4 -4
- package/lib/Events/RequestTableColumns.d.ts +4 -4
- package/lib/Events/SaleComplete.d.ts +2 -2
- package/lib/Events/UIPipeline.d.ts +5 -5
- package/lib/Mocks/APIs/Sale/MockCurrentSale.d.ts +1 -1
- package/lib/Mocks/MockApplication.d.ts +3 -2
- package/lib/Mocks/MockBridge.d.ts +2 -2
- package/lib/index.d.mts +7 -13
- package/lib/index.mjs +395 -400
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
- package/lib/ApplicationEvents.d.ts +0 -311
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Application } from "../../Application.js";
|
|
2
|
-
import { type FromShopfront } from "../../ApplicationEvents.js";
|
|
2
|
+
import { type FromShopfront } from "../../ApplicationEvents/ToShopfront.js";
|
|
3
3
|
export type InternalPageMessageMethod = keyof FromShopfront | "EXTERNAL_APPLICATION";
|
|
4
4
|
export declare class InternalMessageSource {
|
|
5
5
|
protected application: Application;
|
package/lib/APIs/Sale/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { SaleData, SalePaymentData, SaleProductData, } from "../../Utilities/SaleCreate.js";
|
|
1
|
+
export type { SaleData as SaleCreateData, SalePaymentData as SaleCreatePaymentData, SaleProductData as SaleCreateProductData, } from "../../Utilities/SaleCreate.js";
|
|
2
2
|
export { BaseSale } from "./BaseSale.js";
|
|
3
3
|
export * as Exceptions from "./Exceptions.js";
|
|
4
4
|
export { Sale } from "./Sale.js";
|
package/lib/Application.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CurrentSale } from "./APIs/Sale/CurrentSale.js";
|
|
2
2
|
import { Sale, type ShopfrontSaleState } from "./APIs/Sale/index.js";
|
|
3
|
-
import { type DirectShopfrontEvent
|
|
4
|
-
import {
|
|
3
|
+
import { type DirectShopfrontEvent } from "./ApplicationEvents/DirectShopfront.js";
|
|
4
|
+
import { type FromShopfront, type FromShopfrontInternal, type ListenableFromShopfrontEvent, type RegisterChangedEvent, type SoundEvents } from "./ApplicationEvents/ToShopfront.js";
|
|
5
|
+
import { BaseApplication, type SellScreenActionMode, type SellScreenSummaryMode, type ShopfrontEmbeddedTokenError, type ShopfrontEmbeddedVerificationToken, type ShopfrontResponse } from "./BaseApplication.js";
|
|
5
6
|
import { Bridge, type JavaScriptCommunicatorExports } from "./Bridge.js";
|
|
6
7
|
import { type Serializable } from "./Common/Serializable.js";
|
|
7
8
|
import { BaseEmitableEvent } from "./EmitableEvents/BaseEmitableEvent.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { SaleAddCustomer } from "../Events/DirectEvents/SaleAddCustomer.js";
|
|
2
|
+
import { SaleAddProduct } from "../Events/DirectEvents/SaleAddProduct.js";
|
|
3
|
+
import { SaleChangeQuantity } from "../Events/DirectEvents/SaleChangeQuantity.js";
|
|
4
|
+
import { SaleClear } from "../Events/DirectEvents/SaleClear.js";
|
|
5
|
+
import { SaleRemoveCustomer } from "../Events/DirectEvents/SaleRemoveCustomer.js";
|
|
6
|
+
import { SaleRemoveProduct } from "../Events/DirectEvents/SaleRemoveProduct.js";
|
|
7
|
+
import { SaleUpdateProducts } from "../Events/DirectEvents/SaleUpdateProducts.js";
|
|
8
|
+
import type { SaleEventProduct } from "../Events/DirectEvents/types/SaleEventData.js";
|
|
9
|
+
import type { MaybePromise } from "../Utilities/MiscTypes.js";
|
|
10
|
+
import type { ListenableFromShopfrontEvent } from "./ToShopfront.js";
|
|
11
|
+
export interface SaleAddProductEvent {
|
|
12
|
+
product: SaleEventProduct;
|
|
13
|
+
indexAddress: Array<number>;
|
|
14
|
+
}
|
|
15
|
+
export interface SaleRemoveProductEvent {
|
|
16
|
+
indexAddress: Array<number>;
|
|
17
|
+
}
|
|
18
|
+
export interface SaleChangeQuantityEvent {
|
|
19
|
+
indexAddress: Array<number>;
|
|
20
|
+
amount: number;
|
|
21
|
+
absolute: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface SaleUpdateProductsEvent {
|
|
24
|
+
products: Array<SaleEventProduct>;
|
|
25
|
+
}
|
|
26
|
+
export interface SaleAddCustomerEvent {
|
|
27
|
+
customer: {
|
|
28
|
+
uuid: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface DirectShopfrontEventData {
|
|
32
|
+
SALE_ADD_PRODUCT: SaleAddProductEvent;
|
|
33
|
+
SALE_REMOVE_PRODUCT: SaleRemoveProductEvent;
|
|
34
|
+
SALE_CHANGE_QUANTITY: SaleChangeQuantityEvent;
|
|
35
|
+
SALE_UPDATE_PRODUCTS: SaleUpdateProductsEvent;
|
|
36
|
+
SALE_ADD_CUSTOMER: SaleAddCustomerEvent;
|
|
37
|
+
SALE_REMOVE_CUSTOMER: undefined;
|
|
38
|
+
SALE_CLEAR: undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface DirectShopfrontCallbacks {
|
|
41
|
+
SALE_ADD_PRODUCT: (event: DirectShopfrontEventData["SALE_ADD_PRODUCT"]) => MaybePromise<void>;
|
|
42
|
+
SALE_REMOVE_PRODUCT: (event: DirectShopfrontEventData["SALE_REMOVE_PRODUCT"]) => MaybePromise<void>;
|
|
43
|
+
SALE_CHANGE_QUANTITY: (event: DirectShopfrontEventData["SALE_CHANGE_QUANTITY"]) => MaybePromise<void>;
|
|
44
|
+
SALE_UPDATE_PRODUCTS: (event: DirectShopfrontEventData["SALE_UPDATE_PRODUCTS"]) => MaybePromise<void>;
|
|
45
|
+
SALE_ADD_CUSTOMER: (event: DirectShopfrontEventData["SALE_ADD_CUSTOMER"]) => MaybePromise<void>;
|
|
46
|
+
SALE_REMOVE_CUSTOMER: () => MaybePromise<void>;
|
|
47
|
+
SALE_CLEAR: () => MaybePromise<void>;
|
|
48
|
+
}
|
|
49
|
+
export interface DirectShopfront {
|
|
50
|
+
SALE_ADD_PRODUCT: SaleAddProduct;
|
|
51
|
+
SALE_REMOVE_PRODUCT: SaleRemoveProduct;
|
|
52
|
+
SALE_CHANGE_QUANTITY: SaleChangeQuantity;
|
|
53
|
+
SALE_UPDATE_PRODUCTS: SaleUpdateProducts;
|
|
54
|
+
SALE_ADD_CUSTOMER: SaleAddCustomer;
|
|
55
|
+
SALE_REMOVE_CUSTOMER: SaleRemoveCustomer;
|
|
56
|
+
SALE_CLEAR: SaleClear;
|
|
57
|
+
}
|
|
58
|
+
export type DirectShopfrontEvent = keyof DirectShopfront;
|
|
59
|
+
export declare const directShopfrontEvents: Array<DirectShopfrontEvent>;
|
|
60
|
+
/**
|
|
61
|
+
* Checks whether the event is a direct Shopfront event
|
|
62
|
+
*/
|
|
63
|
+
export declare const isDirectShopfrontEvent: (event: DirectShopfrontEvent | ListenableFromShopfrontEvent) => event is DirectShopfrontEvent;
|
|
64
|
+
//# sourceMappingURL=DirectShopfront.d.ts.map
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { Button } from "../Actions/Button.js";
|
|
2
|
+
import { SaleKey } from "../Actions/SaleKey.js";
|
|
3
|
+
import { type OrderDetails } from "../APIs/Fulfilment/FulfilmentTypes.js";
|
|
4
|
+
import { InternalMessageSource } from "../APIs/InternalMessages/InternalMessageSource.js";
|
|
5
|
+
import { Sale, type ShopfrontSaleState } from "../APIs/Sale/index.js";
|
|
6
|
+
import { AudioPermissionChange } from "../Events/AudioPermissionChange.js";
|
|
7
|
+
import { AudioReady } from "../Events/AudioReady.js";
|
|
8
|
+
import { Callback } from "../Events/Callback.js";
|
|
9
|
+
import { FormatIntegratedProduct, type FormattedSaleProduct } from "../Events/FormatIntegratedProduct.js";
|
|
10
|
+
import { FulfilmentCollectOrder } from "../Events/FulfilmentCollectOrder.js";
|
|
11
|
+
import { FulfilmentCompleteOrder } from "../Events/FulfilmentCompleteOrder.js";
|
|
12
|
+
import { FulfilmentGetOrder } from "../Events/FulfilmentGetOrder.js";
|
|
13
|
+
import { FulfilmentOrderApproval } from "../Events/FulfilmentOrderApproval.js";
|
|
14
|
+
import { FulfilmentProcessOrder } from "../Events/FulfilmentProcessOrder.js";
|
|
15
|
+
import { FulfilmentVoidOrder } from "../Events/FulfilmentVoidOrder.js";
|
|
16
|
+
import { GiftCardCodeCheck } from "../Events/GiftCardCodeCheck.js";
|
|
17
|
+
import { InternalPageMessage } from "../Events/InternalPageMessage.js";
|
|
18
|
+
import { PaymentMethodsEnabled } from "../Events/PaymentMethodsEnabled.js";
|
|
19
|
+
import { Ready } from "../Events/Ready.js";
|
|
20
|
+
import { RegisterChanged } from "../Events/RegisterChanged.js";
|
|
21
|
+
import { RequestButtons } from "../Events/RequestButtons.js";
|
|
22
|
+
import { RequestCustomerListOptions, type SellScreenCustomerListOption } from "../Events/RequestCustomerListOptions.js";
|
|
23
|
+
import { RequestSaleKeys } from "../Events/RequestSaleKeys.js";
|
|
24
|
+
import { RequestSellScreenOptions, type SellScreenOption } from "../Events/RequestSellScreenOptions.js";
|
|
25
|
+
import { RequestSettings } from "../Events/RequestSettings.js";
|
|
26
|
+
import { RequestTableColumns } from "../Events/RequestTableColumns.js";
|
|
27
|
+
import { type CompletedSale, SaleComplete } from "../Events/SaleComplete.js";
|
|
28
|
+
import { UIPipeline } from "../Events/UIPipeline.js";
|
|
29
|
+
import { type MaybePromise } from "../Utilities/MiscTypes.js";
|
|
30
|
+
export declare enum ToShopfront {
|
|
31
|
+
READY = "READY",
|
|
32
|
+
SERIALIZED = "SERIALIZED",
|
|
33
|
+
RESPONSE_BUTTONS = "RESPONSE_BUTTONS",
|
|
34
|
+
RESPONSE_SETTINGS = "RESPONSE_SETTINGS",
|
|
35
|
+
RESPONSE_TABLE_COLUMNS = "RESPONSE_TABLE_COLUMNS",
|
|
36
|
+
RESPONSE_SELL_SCREEN_OPTIONS = "RESPONSE_SELL_SCREEN_OPTIONS",
|
|
37
|
+
DOWNLOAD = "DOWNLOAD",
|
|
38
|
+
LOAD = "LOAD",
|
|
39
|
+
REQUEST_CURRENT_SALE = "REQUEST_CURRENT_SALE",
|
|
40
|
+
DATABASE_REQUEST = "DATABASE_REQUEST",
|
|
41
|
+
UNSUPPORTED_EVENT = "UNSUPPORTED_EVENT",
|
|
42
|
+
NOT_LISTENING_TO_EVENT = "NOT_LISTENING_TO_EVENT",
|
|
43
|
+
REQUEST_LOCATION = "REQUEST_LOCATION",
|
|
44
|
+
RESPONSE_FORMAT_PRODUCT = "RESPONSE_FORMAT_PRODUCT",
|
|
45
|
+
RESPONSE_CUSTOMER_LIST_OPTIONS = "RESPONSE_CUSTOMER_LIST_OPTIONS",
|
|
46
|
+
RESPONSE_SALE_KEYS = "RESPONSE_SALE_KEYS",
|
|
47
|
+
PRINT_RECEIPT = "PRINT_RECEIPT",
|
|
48
|
+
REDIRECT = "REDIRECT",
|
|
49
|
+
GET_OPTION = "GET_OPTION",
|
|
50
|
+
RESPONSE_UI_PIPELINE = "RESPONSE_UI_PIPELINE",
|
|
51
|
+
RESPONSE_GIFT_CARD_CODE_CHECK = "RESPONSE_GIFT_CARD_CODE_CHECK",
|
|
52
|
+
REQUEST_SECURE_KEY = "REQUEST_SECURE_KEY",
|
|
53
|
+
ROTATE_SIGNING_KEY = "ROTATE_SIGNING_KEY",
|
|
54
|
+
AUDIO_REQUEST_PERMISSION = "AUDIO_REQUEST_PERMISSION",
|
|
55
|
+
AUDIO_PRELOAD = "AUDIO_PRELOAD",
|
|
56
|
+
AUDIO_PLAY = "AUDIO_PLAY",
|
|
57
|
+
CHANGE_SELL_SCREEN_ACTION_MODE = "CHANGE_SELL_SCREEN_ACTION_MODE",
|
|
58
|
+
CHANGE_SELL_SCREEN_SUMMARY_MODE = "CHANGE_SELL_SCREEN_SUMMARY_MODE",
|
|
59
|
+
SELL_SCREEN_OPTION_CHANGE = "SELL_SCREEN_OPTION_CHANGE",
|
|
60
|
+
INTERNAL_PAGE_MESSAGE = "INTERNAL_PAGE_MESSAGE",
|
|
61
|
+
TABLE_UPDATE = "TABLE_UPDATE",
|
|
62
|
+
PIPELINE_TRIGGER = "PIPELINE_TRIGGER",
|
|
63
|
+
SELL_SCREEN_PROMOTION_APPLICABLE = "SELL_SCREEN_PROMOTION_APPLICABLE",
|
|
64
|
+
FULFILMENT_OPT_IN = "FULFILMENT_OPT_IN",
|
|
65
|
+
FULFILMENT_OPTIONS = "FULFILMENT_OPTIONS",
|
|
66
|
+
FULFILMENT_ORDERS_SYNC = "FULFILMENT_ORDERS_SYNC",
|
|
67
|
+
FULFILMENT_ORDERS_CREATE = "FULFILMENT_ORDERS_CREATE",
|
|
68
|
+
FULFILMENT_ORDERS_UPDATE = "FULFILMENT_ORDERS_UPDATE",
|
|
69
|
+
FULFILMENT_ORDERS_CANCEL = "FULFILMENT_ORDERS_CANCEL",
|
|
70
|
+
CREATE_SALE = "CREATE_SALE",
|
|
71
|
+
FULFILMENT_GET_ORDER = "FULFILMENT_GET_ORDER"
|
|
72
|
+
}
|
|
73
|
+
export interface SellScreenPaymentMethod {
|
|
74
|
+
uuid: string;
|
|
75
|
+
name: string;
|
|
76
|
+
type: "global" | "cash" | "eftpos" | "giftcard" | "voucher" | "cheque" | "pc-eftpos" | "linkly-vaa" | "direct-deposit" | "tyro" | "custom";
|
|
77
|
+
default_pay_exact: boolean;
|
|
78
|
+
background_colour?: string;
|
|
79
|
+
text_colour?: string;
|
|
80
|
+
}
|
|
81
|
+
export type SoundEvents = ToShopfront.AUDIO_REQUEST_PERMISSION | ToShopfront.AUDIO_PRELOAD | ToShopfront.AUDIO_PLAY;
|
|
82
|
+
export interface UIPipelineData {
|
|
83
|
+
name: string;
|
|
84
|
+
content: string;
|
|
85
|
+
}
|
|
86
|
+
export interface RequestSettingsResponse {
|
|
87
|
+
logo?: string;
|
|
88
|
+
description?: string;
|
|
89
|
+
url?: string;
|
|
90
|
+
html?: string;
|
|
91
|
+
}
|
|
92
|
+
export type RequestButtonsResponse = Array<Button>;
|
|
93
|
+
export type RequestTableColumnsResponse = null | {
|
|
94
|
+
headers: Array<{
|
|
95
|
+
label: string;
|
|
96
|
+
key: string;
|
|
97
|
+
weight: number;
|
|
98
|
+
}>;
|
|
99
|
+
body: Array<Record<string, string>>;
|
|
100
|
+
footer: Record<string, string>;
|
|
101
|
+
};
|
|
102
|
+
export type RequestSellScreenOptionsResponse = Array<SellScreenOption>;
|
|
103
|
+
export type FormatIntegratedProductResponse = FormatIntegratedProductEvent;
|
|
104
|
+
export type RequestCustomerListOptionsResponse = Array<SellScreenCustomerListOption>;
|
|
105
|
+
export type RequestSaleKeysResponse = Array<SaleKey>;
|
|
106
|
+
export type UIPipelineResponse = Array<UIPipelineData>;
|
|
107
|
+
export type PaymentMethodsEnabledResponse = Array<SellScreenPaymentMethod>;
|
|
108
|
+
export type FulfilmentGetOrderResponse = OrderDetails;
|
|
109
|
+
export interface GiftCardCodeCheckResponse {
|
|
110
|
+
code: string;
|
|
111
|
+
message: string | null;
|
|
112
|
+
}
|
|
113
|
+
interface InternalShopfrontResponse {
|
|
114
|
+
requestId: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ResponseCurrentSaleResponse extends InternalShopfrontResponse {
|
|
117
|
+
saleState: ShopfrontSaleState;
|
|
118
|
+
}
|
|
119
|
+
export interface ResponseLocationResponse extends InternalShopfrontResponse {
|
|
120
|
+
register: string | null;
|
|
121
|
+
outlet: string | null;
|
|
122
|
+
user: string | null;
|
|
123
|
+
}
|
|
124
|
+
interface GenericRequestResponse extends InternalShopfrontResponse {
|
|
125
|
+
success: boolean;
|
|
126
|
+
message?: string;
|
|
127
|
+
}
|
|
128
|
+
export type ResponseAudioRequestResponse = GenericRequestResponse;
|
|
129
|
+
export type ResponseCreateSaleResponse = GenericRequestResponse;
|
|
130
|
+
export interface FromShopfrontResponse {
|
|
131
|
+
READY: unknown;
|
|
132
|
+
REQUEST_SETTINGS: RequestSettingsResponse;
|
|
133
|
+
REQUEST_BUTTONS: RequestButtonsResponse;
|
|
134
|
+
REQUEST_TABLE_COLUMNS: RequestTableColumnsResponse;
|
|
135
|
+
REQUEST_SELL_SCREEN_OPTIONS: RequestSellScreenOptionsResponse;
|
|
136
|
+
CALLBACK: unknown;
|
|
137
|
+
RESPONSE_CURRENT_SALE: ResponseCurrentSaleResponse;
|
|
138
|
+
INTERNAL_PAGE_MESSAGE: unknown;
|
|
139
|
+
REGISTER_CHANGED: unknown;
|
|
140
|
+
RESPONSE_LOCATION: ResponseLocationResponse;
|
|
141
|
+
RESPONSE_AUDIO_REQUEST: ResponseAudioRequestResponse;
|
|
142
|
+
FORMAT_INTEGRATED_PRODUCT: FormatIntegratedProductResponse;
|
|
143
|
+
REQUEST_CUSTOMER_LIST_OPTIONS: RequestCustomerListOptionsResponse;
|
|
144
|
+
REQUEST_SALE_KEYS: RequestSaleKeysResponse;
|
|
145
|
+
SALE_COMPLETE: unknown;
|
|
146
|
+
UI_PIPELINE: UIPipelineResponse;
|
|
147
|
+
PAYMENT_METHODS_ENABLED: PaymentMethodsEnabledResponse;
|
|
148
|
+
AUDIO_READY: unknown;
|
|
149
|
+
AUDIO_PERMISSION_CHANGE: unknown;
|
|
150
|
+
FULFILMENT_GET_ORDER: FulfilmentGetOrderResponse;
|
|
151
|
+
FULFILMENT_VOID_ORDER: unknown;
|
|
152
|
+
FULFILMENT_PROCESS_ORDER: unknown;
|
|
153
|
+
FULFILMENT_ORDER_APPROVAL: unknown;
|
|
154
|
+
FULFILMENT_ORDER_COLLECTED: unknown;
|
|
155
|
+
FULFILMENT_ORDER_COMPLETED: unknown;
|
|
156
|
+
RESPONSE_CREATE_SALE: ResponseCreateSaleResponse;
|
|
157
|
+
GIFT_CARD_CODE_CHECK: GiftCardCodeCheckResponse;
|
|
158
|
+
}
|
|
159
|
+
export interface InternalPageMessageEvent {
|
|
160
|
+
method: "REQUEST_SETTINGS" | "REQUEST_SELL_SCREEN_OPTIONS" | "EXTERNAL_APPLICATION";
|
|
161
|
+
url: string;
|
|
162
|
+
message: unknown;
|
|
163
|
+
reference: InternalMessageSource;
|
|
164
|
+
}
|
|
165
|
+
export interface RegisterChangedEvent {
|
|
166
|
+
register: null | string;
|
|
167
|
+
outlet: null | string;
|
|
168
|
+
user: null | string;
|
|
169
|
+
}
|
|
170
|
+
export interface GiftCardCodeCheckEvent {
|
|
171
|
+
code: string;
|
|
172
|
+
message: string | null;
|
|
173
|
+
}
|
|
174
|
+
export interface FormatIntegratedProductEvent {
|
|
175
|
+
product: FormattedSaleProduct;
|
|
176
|
+
}
|
|
177
|
+
export interface SaleCompletedEvent {
|
|
178
|
+
sale: CompletedSale;
|
|
179
|
+
}
|
|
180
|
+
export interface AudioPermissionChangeEvent {
|
|
181
|
+
permitted: boolean;
|
|
182
|
+
}
|
|
183
|
+
export interface FulfilmentProcessEvent {
|
|
184
|
+
id: string;
|
|
185
|
+
sale: Sale;
|
|
186
|
+
}
|
|
187
|
+
export interface FulfilmentApprovalEvent {
|
|
188
|
+
id: string;
|
|
189
|
+
approved: boolean;
|
|
190
|
+
}
|
|
191
|
+
export type UIPipelineEvent = Array<UIPipelineData>;
|
|
192
|
+
export interface UIPipelineBaseContext {
|
|
193
|
+
location: string;
|
|
194
|
+
}
|
|
195
|
+
export interface UIPipelineContext extends UIPipelineBaseContext {
|
|
196
|
+
trigger?: () => void;
|
|
197
|
+
}
|
|
198
|
+
export type PaymentMethodsEnabledEvent = Array<SellScreenPaymentMethod>;
|
|
199
|
+
export interface PaymentMethodEnabledContext {
|
|
200
|
+
register: string;
|
|
201
|
+
customer: false | {
|
|
202
|
+
uuid: string;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export interface FromShopfrontCallbacks {
|
|
206
|
+
READY: (event: RegisterChangedEvent) => MaybePromise<FromShopfrontResponse["READY"]>;
|
|
207
|
+
REQUEST_SETTINGS: () => MaybePromise<FromShopfrontResponse["REQUEST_SETTINGS"]>;
|
|
208
|
+
REQUEST_BUTTONS: (location: string, context: unknown) => MaybePromise<FromShopfrontResponse["REQUEST_BUTTONS"]>;
|
|
209
|
+
REQUEST_TABLE_COLUMNS: (location: string, data: unknown) => MaybePromise<FromShopfrontResponse["REQUEST_TABLE_COLUMNS"]>;
|
|
210
|
+
REQUEST_SELL_SCREEN_OPTIONS: () => MaybePromise<FromShopfrontResponse["REQUEST_SELL_SCREEN_OPTIONS"]>;
|
|
211
|
+
INTERNAL_PAGE_MESSAGE: (event: InternalPageMessageEvent) => MaybePromise<FromShopfrontResponse["INTERNAL_PAGE_MESSAGE"]>;
|
|
212
|
+
REGISTER_CHANGED: (event: RegisterChangedEvent) => MaybePromise<FromShopfrontResponse["REGISTER_CHANGED"]>;
|
|
213
|
+
CALLBACK: () => MaybePromise<FromShopfrontResponse["CALLBACK"]>;
|
|
214
|
+
FORMAT_INTEGRATED_PRODUCT: (event: FormatIntegratedProductEvent) => MaybePromise<FromShopfrontResponse["FORMAT_INTEGRATED_PRODUCT"]>;
|
|
215
|
+
REQUEST_CUSTOMER_LIST_OPTIONS: () => MaybePromise<FromShopfrontResponse["REQUEST_CUSTOMER_LIST_OPTIONS"]>;
|
|
216
|
+
REQUEST_SALE_KEYS: () => MaybePromise<FromShopfrontResponse["REQUEST_SALE_KEYS"]>;
|
|
217
|
+
SALE_COMPLETE: (event: SaleCompletedEvent) => MaybePromise<FromShopfrontResponse["SALE_COMPLETE"]>;
|
|
218
|
+
UI_PIPELINE: (event: UIPipelineEvent, context: UIPipelineContext) => MaybePromise<FromShopfrontResponse["UI_PIPELINE"]>;
|
|
219
|
+
PAYMENT_METHODS_ENABLED: (event: PaymentMethodsEnabledEvent, context: PaymentMethodEnabledContext) => MaybePromise<FromShopfrontResponse["PAYMENT_METHODS_ENABLED"]>;
|
|
220
|
+
AUDIO_READY: () => MaybePromise<FromShopfrontResponse["AUDIO_READY"]>;
|
|
221
|
+
AUDIO_PERMISSION_CHANGE: (event: AudioPermissionChangeEvent) => MaybePromise<FromShopfrontResponse["AUDIO_PERMISSION_CHANGE"]>;
|
|
222
|
+
FULFILMENT_GET_ORDER: (id: string) => MaybePromise<FromShopfrontResponse["FULFILMENT_GET_ORDER"]>;
|
|
223
|
+
FULFILMENT_VOID_ORDER: (id: string) => MaybePromise<FromShopfrontResponse["FULFILMENT_VOID_ORDER"]>;
|
|
224
|
+
FULFILMENT_PROCESS_ORDER: (event: FulfilmentProcessEvent) => MaybePromise<FromShopfrontResponse["FULFILMENT_PROCESS_ORDER"]>;
|
|
225
|
+
FULFILMENT_ORDER_APPROVAL: (event: FulfilmentApprovalEvent) => MaybePromise<FromShopfrontResponse["FULFILMENT_ORDER_APPROVAL"]>;
|
|
226
|
+
FULFILMENT_ORDER_COLLECTED: (id: string) => MaybePromise<FromShopfrontResponse["FULFILMENT_ORDER_COLLECTED"]>;
|
|
227
|
+
FULFILMENT_ORDER_COMPLETED: (id: string) => MaybePromise<FromShopfrontResponse["FULFILMENT_ORDER_COMPLETED"]>;
|
|
228
|
+
GIFT_CARD_CODE_CHECK: (event: GiftCardCodeCheckEvent, context: unknown) => MaybePromise<FromShopfrontResponse["GIFT_CARD_CODE_CHECK"]>;
|
|
229
|
+
}
|
|
230
|
+
export interface FromShopfront {
|
|
231
|
+
READY: Ready;
|
|
232
|
+
REQUEST_SETTINGS: RequestSettings;
|
|
233
|
+
REQUEST_BUTTONS: RequestButtons;
|
|
234
|
+
REQUEST_TABLE_COLUMNS: RequestTableColumns;
|
|
235
|
+
REQUEST_SELL_SCREEN_OPTIONS: RequestSellScreenOptions;
|
|
236
|
+
CALLBACK: Callback;
|
|
237
|
+
INTERNAL_PAGE_MESSAGE: InternalPageMessage;
|
|
238
|
+
REGISTER_CHANGED: RegisterChanged;
|
|
239
|
+
FORMAT_INTEGRATED_PRODUCT: FormatIntegratedProduct;
|
|
240
|
+
REQUEST_CUSTOMER_LIST_OPTIONS: RequestCustomerListOptions;
|
|
241
|
+
SALE_COMPLETE: SaleComplete;
|
|
242
|
+
REQUEST_SALE_KEYS: RequestSaleKeys;
|
|
243
|
+
UI_PIPELINE: UIPipeline;
|
|
244
|
+
PAYMENT_METHODS_ENABLED: PaymentMethodsEnabled;
|
|
245
|
+
AUDIO_READY: AudioReady;
|
|
246
|
+
AUDIO_PERMISSION_CHANGE: AudioPermissionChange;
|
|
247
|
+
FULFILMENT_GET_ORDER: FulfilmentGetOrder;
|
|
248
|
+
FULFILMENT_VOID_ORDER: FulfilmentVoidOrder;
|
|
249
|
+
FULFILMENT_PROCESS_ORDER: FulfilmentProcessOrder;
|
|
250
|
+
FULFILMENT_ORDER_APPROVAL: FulfilmentOrderApproval;
|
|
251
|
+
FULFILMENT_ORDER_COLLECTED: FulfilmentCollectOrder;
|
|
252
|
+
FULFILMENT_ORDER_COMPLETED: FulfilmentCompleteOrder;
|
|
253
|
+
GIFT_CARD_CODE_CHECK: GiftCardCodeCheck;
|
|
254
|
+
}
|
|
255
|
+
export type ListenableFromShopfrontEvent = keyof Omit<FromShopfront, "CALLBACK">;
|
|
256
|
+
export interface FromShopfrontInternal {
|
|
257
|
+
CYCLE_KEY: "CYCLE_KEY";
|
|
258
|
+
LOCATION_CHANGED: "LOCATION_CHANGED";
|
|
259
|
+
RESPONSE_CURRENT_SALE: "RESPONSE_CURRENT_SALE";
|
|
260
|
+
RESPONSE_DATABASE_REQUEST: "RESPONSE_DATABASE_REQUEST";
|
|
261
|
+
RESPONSE_LOCATION: "RESPONSE_LOCATION";
|
|
262
|
+
RESPONSE_OPTION: "RESPONSE_OPTION";
|
|
263
|
+
RESPONSE_AUDIO_REQUEST: "RESPONSE_AUDIO_REQUEST";
|
|
264
|
+
RESPONSE_SECURE_KEY: "RESPONSE_SECURE_KEY";
|
|
265
|
+
RESPONSE_CREATE_SALE: "RESPONSE_CREATE_SALE";
|
|
266
|
+
}
|
|
267
|
+
export {};
|
|
268
|
+
//# sourceMappingURL=ToShopfront.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { SaleAddCustomerEvent, SaleAddProductEvent, SaleChangeQuantityEvent, SaleRemoveProductEvent, SaleUpdateProductsEvent, } from "./DirectShopfront.js";
|
|
2
|
+
export type { AudioPermissionChangeEvent, FormatIntegratedProductEvent, FormatIntegratedProductResponse, FulfilmentApprovalEvent, FulfilmentGetOrderResponse, FulfilmentProcessEvent, GiftCardCodeCheckEvent, GiftCardCodeCheckResponse, InternalPageMessageEvent, PaymentMethodEnabledContext, PaymentMethodsEnabledEvent, PaymentMethodsEnabledResponse, RegisterChangedEvent, RequestButtonsResponse, RequestCustomerListOptionsResponse, RequestSaleKeysResponse, RequestSellScreenOptionsResponse, RequestSettingsResponse, RequestTableColumnsResponse, UIPipelineContext, UIPipelineEvent, UIPipelineResponse, } from "./ToShopfront.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/BaseApplication.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { BaseDatabase } from "./APIs/Database/BaseDatabase.js";
|
|
2
2
|
import type { BaseCurrentSale } from "./APIs/Sale/BaseCurrentSale.js";
|
|
3
3
|
import type { Sale } from "./APIs/Sale/index.js";
|
|
4
|
-
import { type DirectShopfront, type DirectShopfrontCallbacks, type DirectShopfrontEvent
|
|
4
|
+
import { type DirectShopfront, type DirectShopfrontCallbacks, type DirectShopfrontEvent } from "./ApplicationEvents/DirectShopfront.js";
|
|
5
|
+
import { type FromShopfront, type FromShopfrontCallbacks, type FromShopfrontInternal, type ListenableFromShopfrontEvent, type RegisterChangedEvent, type SoundEvents } from "./ApplicationEvents/ToShopfront.js";
|
|
5
6
|
import type { BaseBridge } from "./BaseBridge.js";
|
|
6
7
|
import type { Serializable } from "./Common/Serializable.js";
|
|
7
8
|
import type { BaseEmitableEvent } from "./EmitableEvents/BaseEmitableEvent.js";
|
|
@@ -29,6 +30,8 @@ export declare class ShopfrontTokenDecodingError extends Error {
|
|
|
29
30
|
}
|
|
30
31
|
export declare class ShopfrontTokenRequestError extends Error {
|
|
31
32
|
}
|
|
33
|
+
export type SellScreenActionMode = "search" | "keys" | "held-sales" | "payment" | "customers" | "promotions" | "show-backorders" | "fulfilment-orders";
|
|
34
|
+
export type SellScreenSummaryMode = "transaction" | "payments" | "receipts";
|
|
32
35
|
export declare abstract class BaseApplication {
|
|
33
36
|
protected bridge: BaseBridge;
|
|
34
37
|
protected isReady: boolean;
|
package/lib/BaseBridge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type ApplicationEventListener = (event: keyof
|
|
1
|
+
import { type FromShopfront, type FromShopfrontInternal, ToShopfront } from "./ApplicationEvents/ToShopfront.js";
|
|
2
|
+
export type ApplicationEventListener = (event: keyof FromShopfront | keyof FromShopfrontInternal, data: Record<string, unknown>, id: string) => void;
|
|
3
3
|
export declare abstract class BaseBridge {
|
|
4
4
|
key: string;
|
|
5
5
|
url: URL;
|
|
@@ -22,7 +22,7 @@ export declare abstract class BaseBridge {
|
|
|
22
22
|
/**
|
|
23
23
|
* Sends an event to Shopfront
|
|
24
24
|
*/
|
|
25
|
-
abstract sendMessage(type:
|
|
25
|
+
abstract sendMessage(type: ToShopfront, data?: unknown, id?: string): void;
|
|
26
26
|
/**
|
|
27
27
|
* Adds a listener for a Shopfront event
|
|
28
28
|
*/
|
package/lib/Bridge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Application } from "./Application.js";
|
|
2
|
-
import
|
|
2
|
+
import { type FromShopfront, type FromShopfrontInternal, ToShopfront } from "./ApplicationEvents/ToShopfront.js";
|
|
3
3
|
import { type ApplicationEventListener, BaseBridge } from "./BaseBridge.js";
|
|
4
4
|
interface FrameApplicationOptions {
|
|
5
5
|
id: string;
|
|
@@ -17,7 +17,7 @@ type JavaScriptSendMessageCallback = (message: {
|
|
|
17
17
|
data: unknown;
|
|
18
18
|
id?: string;
|
|
19
19
|
}) => void;
|
|
20
|
-
export type JavaScriptReceiveMessageCallback = (type: keyof
|
|
20
|
+
export type JavaScriptReceiveMessageCallback = (type: keyof FromShopfront | keyof FromShopfrontInternal, data: Record<string, unknown>, id: string) => void;
|
|
21
21
|
export interface JavaScriptCommunicatorExports {
|
|
22
22
|
execute: () => void;
|
|
23
23
|
registerSendMessage: (callback: JavaScriptSendMessageCallback) => void;
|
|
@@ -51,7 +51,7 @@ export declare class Bridge extends BaseBridge {
|
|
|
51
51
|
/**
|
|
52
52
|
* Emit an event to the currently registered listeners
|
|
53
53
|
*/
|
|
54
|
-
protected emitToListeners(type: keyof
|
|
54
|
+
protected emitToListeners(type: keyof FromShopfront | keyof FromShopfrontInternal, data: Record<string, unknown>, id: string): void;
|
|
55
55
|
/**
|
|
56
56
|
* Receive a message from the application frame and distribute it to the correct listener
|
|
57
57
|
*/
|
|
@@ -59,11 +59,11 @@ export declare class Bridge extends BaseBridge {
|
|
|
59
59
|
/**
|
|
60
60
|
* Send a message via the JavaScript communicator
|
|
61
61
|
*/
|
|
62
|
-
protected sendMessageViaJavaScript(type:
|
|
62
|
+
protected sendMessageViaJavaScript(type: ToShopfront, data?: unknown, id?: string): void;
|
|
63
63
|
/**
|
|
64
64
|
* @inheritDoc
|
|
65
65
|
*/
|
|
66
|
-
sendMessage(type:
|
|
66
|
+
sendMessage(type: ToShopfront, data?: unknown, id?: string): void;
|
|
67
67
|
/**
|
|
68
68
|
* @inheritDoc
|
|
69
69
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type FromShopfrontResponse } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseEmitableEvent } from "./BaseEmitableEvent.js";
|
|
3
3
|
export declare class TableUpdate extends BaseEmitableEvent<{
|
|
4
4
|
location: string;
|
|
5
|
-
data: Exclude<
|
|
5
|
+
data: Exclude<FromShopfrontResponse["REQUEST_TABLE_COLUMNS"], null>;
|
|
6
6
|
}> {
|
|
7
|
-
constructor(location: string, columns: Exclude<
|
|
7
|
+
constructor(location: string, columns: Exclude<FromShopfrontResponse["REQUEST_TABLE_COLUMNS"], null>);
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=TableUpdate.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./Fulfilment/index.js";
|
|
2
|
+
export { InternalMessage } from "./InternalMessage.js";
|
|
3
|
+
export { SellScreenOption } from "./SellScreenOption.js";
|
|
4
|
+
export { SellScreenPromotionApplicable } from "./SellScreenPromotionApplicable.js";
|
|
5
|
+
export { TableUpdate } from "./TableUpdate.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { AudioPermissionChangeEvent, FromShopfrontCallbacks,
|
|
1
|
+
import type { AudioPermissionChangeEvent, FromShopfrontCallbacks, FromShopfrontResponse } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class AudioPermissionChange extends BaseEvent<AudioPermissionChangeEvent> {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["AUDIO_PERMISSION_CHANGE"]);
|
|
5
5
|
/**
|
|
6
6
|
* @inheritDoc
|
|
7
7
|
*/
|
|
8
|
-
emit(data: AudioPermissionChangeEvent): Promise<
|
|
8
|
+
emit(data: AudioPermissionChangeEvent): Promise<FromShopfrontResponse["AUDIO_PERMISSION_CHANGE"]>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=AudioPermissionChange.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type FromShopfrontCallbacks, type
|
|
1
|
+
import { type FromShopfrontCallbacks, type FromShopfrontResponse } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class AudioReady extends BaseEvent<undefined> {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["AUDIO_READY"]);
|
|
5
5
|
/**
|
|
6
6
|
* @inheritDoc
|
|
7
7
|
*/
|
|
8
|
-
emit(): Promise<
|
|
8
|
+
emit(): Promise<FromShopfrontResponse["AUDIO_READY"]>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=AudioReady.d.ts.map
|
package/lib/Events/Callback.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FromShopfrontCallbacks, FromShopfrontResponse } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class Callback extends BaseEvent {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["CALLBACK"]);
|
|
5
5
|
/**
|
|
6
6
|
* @inheritDoc
|
|
7
7
|
*/
|
|
8
|
-
emit(): Promise<
|
|
8
|
+
emit(): Promise<FromShopfrontResponse["CALLBACK"]>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=Callback.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DirectShopfrontCallbacks, DirectShopfrontEvent, DirectShopfrontEventData } from "../../ApplicationEvents.js";
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEvent, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
export declare abstract class BaseDirectEvent<TEvent extends DirectShopfrontEvent, TData = DirectShopfrontEventData[TEvent], TCallback = DirectShopfrontCallbacks[TEvent]> {
|
|
3
3
|
protected callback: TCallback;
|
|
4
4
|
protected constructor(callback: TCallback);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleAddCustomer extends BaseDirectEvent<"SALE_ADD_CUSTOMER"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_ADD_CUSTOMER"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleAddProduct extends BaseDirectEvent<"SALE_ADD_PRODUCT"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_ADD_PRODUCT"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleChangeQuantity extends BaseDirectEvent<"SALE_CHANGE_QUANTITY"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_CHANGE_QUANTITY"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleClear extends BaseDirectEvent<"SALE_CLEAR"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_CLEAR"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleRemoveCustomer extends BaseDirectEvent<"SALE_REMOVE_CUSTOMER"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_REMOVE_CUSTOMER"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleRemoveProduct extends BaseDirectEvent<"SALE_REMOVE_PRODUCT"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_REMOVE_PRODUCT"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DirectShopfrontCallbacks, DirectShopfrontEventData } from "../../ApplicationEvents/DirectShopfront.js";
|
|
2
2
|
import { BaseDirectEvent } from "./BaseDirectEvent.js";
|
|
3
3
|
export declare class SaleUpdateProducts extends BaseDirectEvent<"SALE_UPDATE_PRODUCTS"> {
|
|
4
4
|
constructor(callback: DirectShopfrontCallbacks["SALE_UPDATE_PRODUCTS"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FromShopfrontCallbacks, type
|
|
1
|
+
import { type FromShopfrontCallbacks, type FromShopfrontResponse } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseBridge } from "../BaseBridge.js";
|
|
3
3
|
import { type MaybePromise } from "../Utilities/MiscTypes.js";
|
|
4
4
|
import { BaseEvent } from "./BaseEvent.js";
|
|
@@ -64,16 +64,16 @@ interface FormattedIntegratedProductData {
|
|
|
64
64
|
};
|
|
65
65
|
context: Record<string, never>;
|
|
66
66
|
}
|
|
67
|
-
export declare class FormatIntegratedProduct extends BaseEvent<FormattedIntegratedProductData, MaybePromise<
|
|
67
|
+
export declare class FormatIntegratedProduct extends BaseEvent<FormattedIntegratedProductData, MaybePromise<FromShopfrontResponse["FORMAT_INTEGRATED_PRODUCT"]>, FromShopfrontResponse["FORMAT_INTEGRATED_PRODUCT"], FormattedIntegratedProductData["data"], Record<string, never>> {
|
|
68
68
|
constructor(callback: FromShopfrontCallbacks["FORMAT_INTEGRATED_PRODUCT"]);
|
|
69
69
|
/**
|
|
70
70
|
* @inheritDoc
|
|
71
71
|
*/
|
|
72
|
-
emit(data: FormattedIntegratedProductData): Promise<
|
|
72
|
+
emit(data: FormattedIntegratedProductData): Promise<FromShopfrontResponse["FORMAT_INTEGRATED_PRODUCT"]>;
|
|
73
73
|
/**
|
|
74
74
|
* Sends the response data to Shopfront
|
|
75
75
|
*/
|
|
76
|
-
static respond(bridge: BaseBridge, data: Array<
|
|
76
|
+
static respond(bridge: BaseBridge, data: Array<FromShopfrontResponse["FORMAT_INTEGRATED_PRODUCT"]>, id: string): Promise<void>;
|
|
77
77
|
}
|
|
78
78
|
export {};
|
|
79
79
|
//# sourceMappingURL=FormatIntegratedProduct.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FromShopfrontCallbacks, FromShopfrontResponse } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
export declare class FulfilmentCollectOrder extends BaseEvent {
|
|
4
4
|
constructor(callback: FromShopfrontCallbacks["FULFILMENT_ORDER_COLLECTED"]);
|
|
5
5
|
/**
|
|
6
6
|
* @inheritDoc
|
|
7
7
|
*/
|
|
8
|
-
emit(data: string): Promise<
|
|
8
|
+
emit(data: string): Promise<FromShopfrontResponse["FULFILMENT_ORDER_COLLECTED"]>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=FulfilmentCollectOrder.d.ts.map
|