@final-commerce/command-frame 0.3.0-beta.3 → 0.3.0-beta.6
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/README.md +50 -28
- package/dist/CommonTypes.d.ts +2 -1
- package/dist/actions/add-cart-discount/mock.js +6 -3
- package/dist/actions/add-cart-fee/mock.js +6 -6
- package/dist/actions/add-custom-sale/mock.js +7 -2
- package/dist/actions/add-order-note/mock.js +3 -1
- package/dist/actions/apply-transition/action.d.ts +2 -0
- package/dist/actions/apply-transition/action.js +4 -0
- package/dist/actions/apply-transition/mock.d.ts +6 -0
- package/dist/actions/apply-transition/mock.js +33 -0
- package/dist/actions/apply-transition/types.d.ts +17 -0
- package/dist/actions/can-transition/action.d.ts +2 -0
- package/dist/actions/can-transition/action.js +4 -0
- package/dist/actions/can-transition/mock.d.ts +6 -0
- package/dist/actions/can-transition/mock.js +28 -0
- package/dist/actions/can-transition/types.d.ts +11 -0
- package/dist/actions/cash-payment/mock.js +12 -18
- package/dist/actions/cash-payment/types.d.ts +5 -0
- package/dist/actions/delete-parked-order/mock.js +3 -1
- package/dist/actions/delete-parked-order/types.d.ts +3 -0
- package/dist/actions/extension-payment/types.d.ts +8 -3
- package/dist/actions/get-available-transitions/action.d.ts +2 -0
- package/dist/actions/get-available-transitions/action.js +4 -0
- package/dist/actions/get-available-transitions/mock.d.ts +6 -0
- package/dist/actions/get-available-transitions/mock.js +26 -0
- package/dist/actions/get-available-transitions/types.d.ts +9 -0
- package/dist/actions/get-context/mock.js +1 -1
- package/dist/actions/get-orders/mock.js +3 -3
- package/dist/actions/get-products/mock.js +6 -1
- package/dist/actions/get-products/types.d.ts +2 -0
- package/dist/actions/get-smart-grid-layout/mock.d.ts +1 -1
- package/dist/actions/get-smart-grid-layout/mock.js +3 -1
- package/dist/actions/get-smart-grid-layout/types.d.ts +1 -3
- package/dist/actions/initiate-refund/types.d.ts +3 -0
- package/dist/actions/integration-payment/types.d.ts +48 -8
- package/dist/actions/open-extension-overlay/mock.js +1 -1
- package/dist/actions/open-extension-overlay/types.d.ts +1 -1
- package/dist/actions/park-order/mock.js +4 -1
- package/dist/actions/park-order/types.d.ts +3 -0
- package/dist/actions/partial-payment/mock.js +21 -3
- package/dist/actions/partial-payment/types.d.ts +5 -0
- package/dist/actions/process-partial-refund/types.d.ts +3 -0
- package/dist/actions/redeem-payment/types.d.ts +9 -5
- package/dist/actions/remove-custom-sale/mock.d.ts +2 -0
- package/dist/actions/remove-custom-sale/mock.js +29 -0
- package/dist/actions/remove-customer-from-cart/mock.js +3 -1
- package/dist/actions/remove-order-note/mock.d.ts +2 -0
- package/dist/actions/remove-order-note/mock.js +12 -0
- package/dist/actions/remove-product-discount/mock.d.ts +2 -0
- package/dist/actions/remove-product-discount/mock.js +17 -0
- package/dist/actions/remove-product-fee/mock.d.ts +2 -0
- package/dist/actions/remove-product-fee/mock.js +17 -0
- package/dist/actions/remove-product-from-cart/mock.js +5 -5
- package/dist/actions/resolve-extension-overlay/mock.js +1 -1
- package/dist/actions/resume-parked-order/mock.js +4 -1
- package/dist/actions/resume-parked-order/types.d.ts +3 -0
- package/dist/actions/save-smart-grid-layout/mock.d.ts +1 -1
- package/dist/actions/save-smart-grid-layout/mock.js +3 -0
- package/dist/actions/save-smart-grid-layout/types.d.ts +1 -3
- package/dist/actions/tap-to-pay-payment/mock.js +5 -3
- package/dist/actions/tap-to-pay-payment/types.d.ts +5 -0
- package/dist/actions/terminal-payment/mock.js +4 -5
- package/dist/actions/terminal-payment/types.d.ts +5 -0
- package/dist/actions/update-cart-item-quantity/mock.js +9 -9
- package/dist/actions/vendara-payment/types.d.ts +5 -0
- package/dist/common-types/index.d.ts +1 -0
- package/dist/common-types/index.js +1 -0
- package/dist/common-types/order-state.d.ts +32 -0
- package/dist/common-types/order-state.js +6 -0
- package/dist/common-types/state-fragment.d.ts +77 -0
- package/dist/common-types/state-fragment.js +10 -0
- package/dist/demo/database.d.ts +12 -1
- package/dist/demo/database.js +173 -3
- package/dist/fragments/index.d.ts +1 -0
- package/dist/fragments/index.js +1 -0
- package/dist/fragments/preorder-no-deposit.d.ts +26 -0
- package/dist/fragments/preorder-no-deposit.js +166 -0
- package/dist/index.d.ts +21 -20
- package/dist/index.js +23 -21
- package/dist/interceptors/index.d.ts +21 -0
- package/dist/interceptors/index.js +53 -0
- package/dist/interceptors/types.d.ts +8 -16
- package/dist/projects/render/mocks.js +19 -17
- package/dist/projects/render/types.d.ts +7 -6
- package/dist/pubsub/topics/orders/index.js +10 -0
- package/dist/pubsub/topics/orders/state-transition-blocked/types.d.ts +16 -0
- package/dist/pubsub/topics/orders/state-transition-blocked/types.js +1 -0
- package/dist/pubsub/topics/orders/state-transition-completed/types.d.ts +15 -0
- package/dist/pubsub/topics/orders/state-transition-completed/types.js +1 -0
- package/dist/pubsub/topics/orders/types.d.ts +6 -2
- package/dist/pubsub/topics/orders/types.js +2 -0
- package/dist/pubsub/topics/split-payments/index.d.ts +12 -0
- package/dist/pubsub/topics/split-payments/index.js +22 -0
- package/dist/pubsub/topics/split-payments/split-payment-updated/types.d.ts +16 -0
- package/dist/pubsub/topics/split-payments/split-payment-updated/types.js +1 -0
- package/dist/pubsub/topics/split-payments/types.d.ts +10 -0
- package/dist/pubsub/topics/split-payments/types.js +5 -0
- package/dist/pubsub/topics/types.d.ts +2 -0
- package/package.json +3 -3
- package/dist/actions/extension-refund/constants.d.ts +0 -2
- package/dist/actions/extension-refund/constants.js +0 -2
- package/dist/actions/extension-refund/extension-refund-listener.d.ts +0 -11
- package/dist/actions/extension-refund/extension-refund-listener.js +0 -60
- package/dist/actions/extension-refund/types.d.ts +0 -32
- package/dist/actions/extension-refund/types.js +0 -5
- package/dist/actions/set-active-outlet/action.d.ts +0 -2
- package/dist/actions/set-active-outlet/action.js +0 -4
- package/dist/actions/set-active-outlet/mock.d.ts +0 -2
- package/dist/actions/set-active-outlet/mock.js +0 -16
- package/dist/actions/set-active-outlet/types.d.ts +0 -10
- package/dist/actions/set-active-session/action.d.ts +0 -2
- package/dist/actions/set-active-session/action.js +0 -4
- package/dist/actions/set-active-session/mock.d.ts +0 -2
- package/dist/actions/set-active-session/mock.js +0 -15
- package/dist/actions/set-active-session/types.d.ts +0 -10
- package/dist/actions/set-active-station/action.d.ts +0 -2
- package/dist/actions/set-active-station/action.js +0 -4
- package/dist/actions/set-active-station/mock.d.ts +0 -2
- package/dist/actions/set-active-station/mock.js +0 -16
- package/dist/actions/set-active-station/types.d.ts +0 -10
- /package/dist/actions/{set-active-outlet → apply-transition}/types.js +0 -0
- /package/dist/actions/{set-active-session → can-transition}/types.js +0 -0
- /package/dist/actions/{set-active-station → get-available-transitions}/types.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -56,11 +56,8 @@ export declare const command: {
|
|
|
56
56
|
readonly getActiveCustomer: import(".").GetActiveCustomer;
|
|
57
57
|
readonly setActiveCustomer: import(".").SetActiveCustomer;
|
|
58
58
|
readonly getActiveOutlet: import(".").GetActiveOutlet;
|
|
59
|
-
readonly setActiveOutlet: import(".").SetActiveOutlet;
|
|
60
59
|
readonly getActiveStation: import(".").GetActiveStation;
|
|
61
|
-
readonly setActiveStation: import(".").SetActiveStation;
|
|
62
60
|
readonly getActiveSession: import(".").GetActiveSession;
|
|
63
|
-
readonly setActiveSession: import(".").SetActiveSession;
|
|
64
61
|
readonly getActiveUser: import(".").GetActiveUser;
|
|
65
62
|
readonly setActiveUser: import(".").SetActiveUser;
|
|
66
63
|
readonly setActiveRefund: import(".").SetActiveRefund;
|
|
@@ -71,10 +68,6 @@ export declare const command: {
|
|
|
71
68
|
readonly removeOrderNote: import(".").RemoveOrderNote;
|
|
72
69
|
readonly removeCustomSale: import(".").RemoveCustomSale;
|
|
73
70
|
readonly removeNonRevenueItem: import(".").RemoveNonRevenueItem;
|
|
74
|
-
readonly getSmartGridLayout: import(".").GetSmartGridLayout;
|
|
75
|
-
readonly saveSmartGridLayout: import(".").SaveSmartGridLayout;
|
|
76
|
-
readonly openExtensionOverlay: import(".").OpenExtensionOverlay;
|
|
77
|
-
readonly resolveExtensionOverlay: import(".").ResolveExtensionOverlay;
|
|
78
71
|
readonly initiateRefund: import(".").InitiateRefund;
|
|
79
72
|
readonly setRefundStockAction: import(".").SetRefundStockAction;
|
|
80
73
|
readonly selectAllRefundItems: import(".").SelectAllRefundItems;
|
|
@@ -88,6 +81,8 @@ export declare const command: {
|
|
|
88
81
|
readonly deleteProduct: import(".").DeleteProduct;
|
|
89
82
|
readonly getOutlets: import(".").GetOutlets;
|
|
90
83
|
readonly getStations: import(".").GetStations;
|
|
84
|
+
readonly getSmartGridLayout: import(".").GetSmartGridLayout;
|
|
85
|
+
readonly saveSmartGridLayout: import(".").SaveSmartGridLayout;
|
|
91
86
|
readonly getCustomTables: import(".").GetCustomTables;
|
|
92
87
|
readonly getCustomTableFields: import(".").GetCustomTableFields;
|
|
93
88
|
readonly getCustomTableData: import(".").GetCustomTableData;
|
|
@@ -107,6 +102,9 @@ export declare const command: {
|
|
|
107
102
|
readonly uploadMedia: import(".").UploadMedia;
|
|
108
103
|
readonly getTaxTables: import(".").GetTaxTables;
|
|
109
104
|
readonly getBranding: import(".").GetBranding;
|
|
105
|
+
readonly canTransition: import(".").CanTransition;
|
|
106
|
+
readonly getAvailableTransitions: import(".").GetAvailableTransitions;
|
|
107
|
+
readonly applyTransition: import(".").ApplyTransition;
|
|
110
108
|
};
|
|
111
109
|
export type { ExampleFunction, ExampleFunctionParams, ExampleFunctionResponse } from "./actions/example-function/types";
|
|
112
110
|
export type { GenerateAPIKey, GenerateAPIKeyParams, GenerateAPIKeyResponse } from "./actions/generate-api-key/types";
|
|
@@ -124,6 +122,8 @@ export type { EditProductVariants, EditProductVariantsParams, EditProductVariant
|
|
|
124
122
|
export type { DeleteProduct, DeleteProductParams, DeleteProductResponse } from "./actions/delete-product/types";
|
|
125
123
|
export type { GetOutlets, GetOutletsResponse } from "./actions/get-outlets/types";
|
|
126
124
|
export type { GetStations, GetStationsParams, GetStationsResponse } from "./actions/get-stations/types";
|
|
125
|
+
export type { GetSmartGridLayout, GetSmartGridLayoutParams, GetSmartGridLayoutResponse } from "./actions/get-smart-grid-layout/types";
|
|
126
|
+
export type { SaveSmartGridLayout, SaveSmartGridLayoutParams, SaveSmartGridLayoutResponse } from "./actions/save-smart-grid-layout/types";
|
|
127
127
|
export type { GetOrders, GetOrdersParams, GetOrdersResponse } from "./actions/get-orders/types";
|
|
128
128
|
export type { GetRefunds, GetRefundsParams, GetRefundsResponse } from "./actions/get-refunds/types";
|
|
129
129
|
export type { SetRefundStockAction, SetRefundStockActionParams, SetRefundStockActionResponse } from "./actions/set-refund-stock-action/types";
|
|
@@ -133,6 +133,8 @@ export type { CalculateRefundTotal, CalculateRefundTotalParams, CalculateRefundT
|
|
|
133
133
|
export type { GetRemainingRefundableQuantities, GetRemainingRefundableQuantitiesParams, GetRemainingRefundableQuantitiesResponse } from "./actions/get-remaining-refundable-quantities/types";
|
|
134
134
|
export type { ProcessPartialRefund, ProcessPartialRefundParams, ProcessPartialRefundResponse } from "./actions/process-partial-refund/types";
|
|
135
135
|
export type { InitiateRefund, InitiateRefundParams, InitiateRefundResponse } from "./actions/initiate-refund/types";
|
|
136
|
+
export type { OpenExtensionOverlay, OpenExtensionOverlayParams, OpenExtensionOverlayResponse } from "./actions/open-extension-overlay/types";
|
|
137
|
+
export type { ResolveExtensionOverlay, ResolveExtensionOverlayParams, ResolveExtensionOverlayResponse } from "./actions/resolve-extension-overlay/types";
|
|
136
138
|
export type { GetCurrentCart, GetCurrentCartResponse } from "./actions/get-current-cart/types";
|
|
137
139
|
export type { AddProductDiscount, AddProductDiscountParams, AddProductDiscountResponse } from "./actions/add-product-discount/types";
|
|
138
140
|
export type { AddProductToCart, AddProductToCartParams, AddProductToCartResponse } from "./actions/add-product-to-cart/types";
|
|
@@ -160,10 +162,7 @@ export type { TerminalPayment, TerminalPaymentParams, TerminalPaymentResponse }
|
|
|
160
162
|
export type { VendaraPayment, VendaraPaymentParams, VendaraPaymentResponse } from "./actions/vendara-payment/types";
|
|
161
163
|
export type { ExtensionPayment, ExtensionPaymentParams, ExtensionPaymentResponse } from "./actions/extension-payment/types";
|
|
162
164
|
export type { RedeemPayment, RedeemPaymentParams, RedeemPaymentResponse } from "./actions/redeem-payment/types";
|
|
163
|
-
export type { IntegrationPayment, IntegrationPaymentParams, IntegrationPaymentResponse } from "./actions/integration-payment/types";
|
|
164
|
-
export { EXTENSION_REFUND_REQUEST_ACTION } from "./actions/extension-refund/constants";
|
|
165
|
-
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
166
|
-
export type { ExtensionRefundParams, ExtensionRefundResponse } from "./actions/extension-refund/types";
|
|
165
|
+
export type { IntegrationPayment, IntegrationPaymentParams, IntegrationPaymentResponse, IntegrationEmvData } from "./actions/integration-payment/types";
|
|
167
166
|
export type { AddCustomerNote, AddCustomerNoteParams, AddCustomerNoteResponse } from "./actions/add-customer-note/types";
|
|
168
167
|
export type { RemoveCustomerNote, RemoveCustomerNoteParams, RemoveCustomerNoteResponse } from "./actions/remove-customer-note/types";
|
|
169
168
|
export type { RemoveCustomerFromCart, RemoveCustomerFromCartResponse } from "./actions/remove-customer-from-cart/types";
|
|
@@ -187,11 +186,8 @@ export type { GetActiveOrder, GetActiveOrderResponse } from "./actions/get-activ
|
|
|
187
186
|
export type { GetActiveCustomer, GetActiveCustomerResponse } from "./actions/get-active-customer/types";
|
|
188
187
|
export type { SetActiveCustomer, SetActiveCustomerParams, SetActiveCustomerResponse } from "./actions/set-active-customer/types";
|
|
189
188
|
export type { GetActiveOutlet, GetActiveOutletResponse } from "./actions/get-active-outlet/types";
|
|
190
|
-
export type { SetActiveOutlet, SetActiveOutletParams, SetActiveOutletResponse } from "./actions/set-active-outlet/types";
|
|
191
189
|
export type { GetActiveStation, GetActiveStationResponse } from "./actions/get-active-station/types";
|
|
192
|
-
export type { SetActiveStation, SetActiveStationParams, SetActiveStationResponse } from "./actions/set-active-station/types";
|
|
193
190
|
export type { GetActiveSession, GetActiveSessionResponse } from "./actions/get-active-session/types";
|
|
194
|
-
export type { SetActiveSession, SetActiveSessionParams, SetActiveSessionResponse } from "./actions/set-active-session/types";
|
|
195
191
|
export type { GetActiveUser, GetActiveUserResponse } from "./actions/get-active-user/types";
|
|
196
192
|
export type { SetActiveUser, SetActiveUserParams, SetActiveUserResponse } from "./actions/set-active-user/types";
|
|
197
193
|
export type { SetActiveRefund, SetActiveRefundParams, SetActiveRefundResponse } from "./actions/set-active-refund/types";
|
|
@@ -202,11 +198,6 @@ export type { RemoveCartFee, RemoveCartFeeParams, RemoveCartFeeResponse } from "
|
|
|
202
198
|
export type { RemoveOrderNote, RemoveOrderNoteResponse } from "./actions/remove-order-note/types";
|
|
203
199
|
export type { RemoveCustomSale, RemoveCustomSaleParams, RemoveCustomSaleResponse } from "./actions/remove-custom-sale/types";
|
|
204
200
|
export type { RemoveNonRevenueItem, RemoveNonRevenueItemParams, RemoveNonRevenueItemResponse } from "./actions/remove-non-revenue-item/types";
|
|
205
|
-
export type { GetSmartGridLayout, GetSmartGridLayoutParams, GetSmartGridLayoutResponse } from "./actions/get-smart-grid-layout/types";
|
|
206
|
-
export type { SaveSmartGridLayout, SaveSmartGridLayoutParams, SaveSmartGridLayoutResponse } from "./actions/save-smart-grid-layout/types";
|
|
207
|
-
export type { OpenExtensionOverlay, OpenExtensionOverlayParams, OpenExtensionOverlayResponse } from "./actions/open-extension-overlay/types";
|
|
208
|
-
export type { ResolveExtensionOverlay, ResolveExtensionOverlayParams, ResolveExtensionOverlayResponse } from "./actions/resolve-extension-overlay/types";
|
|
209
|
-
export type { InterceptorPoint, InterceptorReturn, InterceptorFunction, InterceptorHostCommands, InterceptorRegisterOptions, InterceptorOverlayContext } from "./interceptors/types";
|
|
210
201
|
export * from "./CommonTypes";
|
|
211
202
|
export { setMockDatabase, setMockActiveProduct } from "./demo/database";
|
|
212
203
|
export type { MockDatabaseConfig } from "./demo/database";
|
|
@@ -221,12 +212,15 @@ export type { TopicDefinition, TopicEvent, TopicEventType, TopicSubscriptionCall
|
|
|
221
212
|
export type { TopicEventPayloadMap } from "./pubsub/topics/types";
|
|
222
213
|
export { hooks } from "./hooks";
|
|
223
214
|
export type { HookFunction, HookRegisterOptions } from "./hooks";
|
|
215
|
+
export { interceptors } from "./interceptors";
|
|
216
|
+
export type { InterceptorFunction, InterceptorPoint, InterceptorRegisterOptions, InterceptorReturn, InterceptorOverlayContext, InterceptorHostCommands } from "./interceptors";
|
|
224
217
|
export { customersTopic } from "./pubsub/topics/customers";
|
|
225
218
|
export { ordersTopic } from "./pubsub/topics/orders";
|
|
226
219
|
export { refundsTopic } from "./pubsub/topics/refunds";
|
|
227
220
|
export { productsTopic } from "./pubsub/topics/products";
|
|
228
221
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
229
222
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
223
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
230
224
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
231
225
|
export { printTopic } from "./pubsub/topics/print";
|
|
232
226
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
@@ -238,7 +232,7 @@ export { transactionsTopic } from "./pubsub/topics/transactions";
|
|
|
238
232
|
export { categoriesTopic } from "./pubsub/topics/categories";
|
|
239
233
|
export { attributesTopic } from "./pubsub/topics/attributes";
|
|
240
234
|
export type { CustomerCreatedPayload, CustomerUpdatedPayload, CustomerNoteAddedPayload, CustomerNoteDeletedPayload, CustomerAssignedPayload, CustomerUnassignedPayload, CustomerActiveSetPayload, CustomerActiveGetPayload, CustomerCreatedEvent, CustomerUpdatedEvent, CustomerNoteAddedEvent, CustomerNoteDeletedEvent, CustomerAssignedEvent, CustomerUnassignedEvent, CustomerActiveSetEvent, CustomerActiveGetEvent, CustomersEventType, CustomersEventPayload } from "./pubsub/topics/customers/types";
|
|
241
|
-
export type { OrderCreatedPayload, OrderUpdatedPayload, OrderActiveSetPayload, OrderActiveGetPayload, OrderCreatedEvent, OrderUpdatedEvent, OrderActiveSetEvent, OrderActiveGetEvent, OrdersEventType, OrdersEventPayload } from "./pubsub/topics/orders/types";
|
|
235
|
+
export type { OrderCreatedPayload, OrderUpdatedPayload, OrderActiveSetPayload, OrderActiveGetPayload, OrderCreatedEvent, OrderUpdatedEvent, OrderActiveSetEvent, OrderActiveGetEvent, OrderStateTransitionCompletedPayload, OrderStateTransitionBlockedPayload, OrderStateTransitionCompletedEvent, OrderStateTransitionBlockedEvent, OrdersEventType, OrdersEventPayload } from "./pubsub/topics/orders/types";
|
|
242
236
|
export type { RefundCreatedPayload, RefundUpdatedPayload, RefundActiveSetPayload, RefundActiveGetPayload, RefundCreatedEvent, RefundUpdatedEvent, RefundActiveSetEvent, RefundActiveGetEvent, RefundsEventType, RefundsEventPayload } from "./pubsub/topics/refunds/types";
|
|
243
237
|
export type { ProductCreatedPayload, ProductUpdatedPayload, ProductSetActivePayload, ProductGetActivePayload, ProductCreatedEvent, ProductUpdatedEvent, ProductSetActiveEvent, ProductGetActiveEvent, ProductsEventType, ProductsEventPayload } from "./pubsub/topics/products/types";
|
|
244
238
|
export type { OutletActiveSetPayload, OutletActiveGetPayload, OutletActiveSetEvent, OutletActiveGetEvent, OutletEventType, OutletEventPayload } from "./pubsub/topics/outlet/types";
|
|
@@ -251,6 +245,7 @@ export type { CategoryCreatedPayload, CategoryCreatedEvent, CategoryUpdatedPaylo
|
|
|
251
245
|
export type { AttributeCreatedPayload, AttributeCreatedEvent, AttributeUpdatedPayload, AttributeUpdatedEvent, AttributesEventType, AttributesEventPayload } from "./pubsub/topics/attributes/types";
|
|
252
246
|
export type { CartCreatedPayload, CartCustomerAssignedPayload, ProductAddedPayload, ProductDeletedPayload, CartDiscountAddedPayload, CartDiscountRemovedPayload, CartFeeAddedPayload, CartFeeRemovedPayload, ProductDiscountAddedPayload, ProductDiscountRemovedPayload, ProductFeeAddedPayload, ProductFeeRemovedPayload, ProductNoteAddedPayload, ProductNoteRemovedPayload, CartCreatedEvent, CartCustomerAssignedEvent, ProductAddedEvent, ProductDeletedEvent, CartDiscountAddedEvent, CartDiscountRemovedEvent, CartFeeAddedEvent, CartFeeRemovedEvent, ProductDiscountAddedEvent, ProductDiscountRemovedEvent, ProductFeeAddedEvent, ProductFeeRemovedEvent, ProductNoteAddedEvent, ProductNoteRemovedEvent, CartEventType, CartEventPayload } from "./pubsub/topics/cart/types";
|
|
253
247
|
export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload } from "./pubsub/topics/payments/types";
|
|
248
|
+
export type { SplitPaymentUpdatedPayload, SplitPaymentUpdatedEvent, SplitPaymentsEventType, SplitPaymentsEventPayload } from "./pubsub/topics/split-payments/types";
|
|
254
249
|
export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
|
|
255
250
|
export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload } from "./pubsub/topics/print/types";
|
|
256
251
|
export { AttributeType } from "./common-types/attribute-type";
|
|
@@ -268,3 +263,9 @@ export type { GetSecretVal, GetSecretValParams, GetSecretValResponse } from "./a
|
|
|
268
263
|
export type { SetSecretVal, SetSecretValParams, SetSecretValResponse } from "./actions/set-secret-val/types";
|
|
269
264
|
export type { GetUsers, GetUsersParams, GetUsersResponse } from "./actions/get-users/types";
|
|
270
265
|
export type { GetRoles, GetRolesParams, GetRolesResponse } from "./actions/get-roles/types";
|
|
266
|
+
export type { CFBlockedBy, CFStatePair, CFTransitionResult, CFFailedCondition, CFConditionStatus, CFAvailableTransition } from "./common-types/order-state";
|
|
267
|
+
export type { CFConditionOperator, CFCondition, CFConditionGroup, CFTransitionConditionSet, CFPaymentTransitionPath, CFFulfillmentTransitionPath, CFCrossAxisRule, CFDisplayStateRule, CFStateConfigFragment } from "./common-types/state-fragment";
|
|
268
|
+
export type { CanTransition, CanTransitionParams, CanTransitionResponse } from "./actions/can-transition/types";
|
|
269
|
+
export type { GetAvailableTransitions, GetAvailableTransitionsParams, GetAvailableTransitionsResponse } from "./actions/get-available-transitions/types";
|
|
270
|
+
export type { ApplyTransition, ApplyTransitionParams, ApplyTransitionResponse } from "./actions/apply-transition/types";
|
|
271
|
+
export { preorderNoDepositFragment } from "./fragments";
|
package/dist/index.js
CHANGED
|
@@ -58,11 +58,8 @@ import { getActiveOrder } from "./actions/get-active-order/action";
|
|
|
58
58
|
import { getActiveCustomer } from "./actions/get-active-customer/action";
|
|
59
59
|
import { setActiveCustomer } from "./actions/set-active-customer/action";
|
|
60
60
|
import { getActiveOutlet } from "./actions/get-active-outlet/action";
|
|
61
|
-
import { setActiveOutlet } from "./actions/set-active-outlet/action";
|
|
62
61
|
import { getActiveStation } from "./actions/get-active-station/action";
|
|
63
|
-
import { setActiveStation } from "./actions/set-active-station/action";
|
|
64
62
|
import { getActiveSession } from "./actions/get-active-session/action";
|
|
65
|
-
import { setActiveSession } from "./actions/set-active-session/action";
|
|
66
63
|
import { getActiveUser } from "./actions/get-active-user/action";
|
|
67
64
|
import { setActiveUser } from "./actions/set-active-user/action";
|
|
68
65
|
import { setActiveRefund } from "./actions/set-active-refund/action";
|
|
@@ -74,12 +71,7 @@ import { removeCartFee } from "./actions/remove-cart-fee/action";
|
|
|
74
71
|
import { removeOrderNote } from "./actions/remove-order-note/action";
|
|
75
72
|
import { removeCustomSale } from "./actions/remove-custom-sale/action";
|
|
76
73
|
import { removeNonRevenueItem } from "./actions/remove-non-revenue-item/action";
|
|
77
|
-
//
|
|
78
|
-
import { getSmartGridLayout } from "./actions/get-smart-grid-layout/action";
|
|
79
|
-
import { saveSmartGridLayout } from "./actions/save-smart-grid-layout/action";
|
|
80
|
-
// Extension Overlay / Interceptor Actions
|
|
81
|
-
import { openExtensionOverlay } from "./actions/open-extension-overlay/action";
|
|
82
|
-
import { resolveExtensionOverlay } from "./actions/resolve-extension-overlay/action";
|
|
74
|
+
// Integration Actions
|
|
83
75
|
// Refund Actions
|
|
84
76
|
import { getRefunds } from "./actions/get-refunds/action";
|
|
85
77
|
import { initiateRefund } from "./actions/initiate-refund/action";
|
|
@@ -106,6 +98,10 @@ import { getSecretsKeys } from "./actions/get-secrets-keys/action";
|
|
|
106
98
|
import { getSecretVal } from "./actions/get-secret-val/action";
|
|
107
99
|
import { setSecretVal } from "./actions/set-secret-val/action";
|
|
108
100
|
import { generateAPIKey } from "./actions/generate-api-key/action";
|
|
101
|
+
// State Machine Query Actions
|
|
102
|
+
import { canTransition } from "./actions/can-transition/action";
|
|
103
|
+
import { getAvailableTransitions } from "./actions/get-available-transitions/action";
|
|
104
|
+
import { applyTransition } from "./actions/apply-transition/action";
|
|
109
105
|
// Product CRUD Actions
|
|
110
106
|
import { addProduct } from "./actions/add-product/action";
|
|
111
107
|
import { editProduct } from "./actions/edit-product/action";
|
|
@@ -114,6 +110,9 @@ import { deleteProduct } from "./actions/delete-product/action";
|
|
|
114
110
|
// Entity Actions
|
|
115
111
|
import { getOutlets } from "./actions/get-outlets/action";
|
|
116
112
|
import { getStations } from "./actions/get-stations/action";
|
|
113
|
+
// SmartGrid Actions
|
|
114
|
+
import { getSmartGridLayout } from "./actions/get-smart-grid-layout/action";
|
|
115
|
+
import { saveSmartGridLayout } from "./actions/save-smart-grid-layout/action";
|
|
117
116
|
// Manage extension actions (optional hosts: Deerlake, etc.)
|
|
118
117
|
import { navigateTo } from "./actions/navigate-to/action";
|
|
119
118
|
import { refreshResource } from "./actions/refresh-resource/action";
|
|
@@ -184,11 +183,8 @@ export const command = {
|
|
|
184
183
|
getActiveCustomer,
|
|
185
184
|
setActiveCustomer,
|
|
186
185
|
getActiveOutlet,
|
|
187
|
-
setActiveOutlet,
|
|
188
186
|
getActiveStation,
|
|
189
|
-
setActiveStation,
|
|
190
187
|
getActiveSession,
|
|
191
|
-
setActiveSession,
|
|
192
188
|
getActiveUser,
|
|
193
189
|
setActiveUser,
|
|
194
190
|
setActiveRefund,
|
|
@@ -200,12 +196,7 @@ export const command = {
|
|
|
200
196
|
removeOrderNote,
|
|
201
197
|
removeCustomSale,
|
|
202
198
|
removeNonRevenueItem,
|
|
203
|
-
//
|
|
204
|
-
getSmartGridLayout,
|
|
205
|
-
saveSmartGridLayout,
|
|
206
|
-
// Extension Overlay / Interceptor Actions
|
|
207
|
-
openExtensionOverlay,
|
|
208
|
-
resolveExtensionOverlay,
|
|
199
|
+
// Integration Actions
|
|
209
200
|
// Refund Actions
|
|
210
201
|
initiateRefund,
|
|
211
202
|
setRefundStockAction,
|
|
@@ -222,6 +213,9 @@ export const command = {
|
|
|
222
213
|
// Entity Actions
|
|
223
214
|
getOutlets,
|
|
224
215
|
getStations,
|
|
216
|
+
// SmartGrid Actions
|
|
217
|
+
getSmartGridLayout,
|
|
218
|
+
saveSmartGridLayout,
|
|
225
219
|
// Custom Tables Actions
|
|
226
220
|
getCustomTables,
|
|
227
221
|
getCustomTableFields,
|
|
@@ -245,10 +239,13 @@ export const command = {
|
|
|
245
239
|
getMedia,
|
|
246
240
|
uploadMedia,
|
|
247
241
|
getTaxTables,
|
|
248
|
-
getBranding
|
|
242
|
+
getBranding,
|
|
243
|
+
// State Machine Queries
|
|
244
|
+
canTransition,
|
|
245
|
+
getAvailableTransitions,
|
|
246
|
+
applyTransition
|
|
249
247
|
};
|
|
250
|
-
|
|
251
|
-
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
248
|
+
// Integration Actions
|
|
252
249
|
// Export Common Types
|
|
253
250
|
export * from "./CommonTypes";
|
|
254
251
|
// Mock database override (standalone / extension dev)
|
|
@@ -265,6 +262,8 @@ export { commandFrameClient, CommandFrameClient } from "./client";
|
|
|
265
262
|
export { topics } from "./pubsub/topics";
|
|
266
263
|
// Export Hooks (extension iframe API for session-scoped event callbacks)
|
|
267
264
|
export { hooks } from "./hooks";
|
|
265
|
+
// Export Interceptors (extension iframe API for gating host flows)
|
|
266
|
+
export { interceptors } from "./interceptors";
|
|
268
267
|
// Export Pub/Sub Topics
|
|
269
268
|
export { customersTopic } from "./pubsub/topics/customers";
|
|
270
269
|
export { ordersTopic } from "./pubsub/topics/orders";
|
|
@@ -272,6 +271,7 @@ export { refundsTopic } from "./pubsub/topics/refunds";
|
|
|
272
271
|
export { productsTopic } from "./pubsub/topics/products";
|
|
273
272
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
274
273
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
274
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
275
275
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
276
276
|
export { printTopic } from "./pubsub/topics/print";
|
|
277
277
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
@@ -284,3 +284,5 @@ export { categoriesTopic } from "./pubsub/topics/categories";
|
|
|
284
284
|
export { attributesTopic } from "./pubsub/topics/attributes";
|
|
285
285
|
// Export Custom Tables Types
|
|
286
286
|
export { AttributeType } from "./common-types/attribute-type";
|
|
287
|
+
// State Machine Fragments
|
|
288
|
+
export { preorderNoDepositFragment } from "./fragments";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { InterceptorFunction, InterceptorPoint, InterceptorRegisterOptions, InterceptorOverlayContext } from "./types";
|
|
2
|
+
/** Register a session-scoped interceptor for a named point. Callback is serialized to the host. */
|
|
3
|
+
declare function register(point: InterceptorPoint, callback: InterceptorFunction, options: InterceptorRegisterOptions): string;
|
|
4
|
+
declare function unregister(interceptorId: string): void;
|
|
5
|
+
/** Register a handler invoked when this iframe is opened as an overlay by the host. */
|
|
6
|
+
declare function onOverlay(handler: (ctx: InterceptorOverlayContext) => void): void;
|
|
7
|
+
/** Continue the gated flow, merging `data` into the flow payload. */
|
|
8
|
+
declare function resolve(data: Record<string, any>): Promise<void>;
|
|
9
|
+
/** Continue the gated flow with no data. */
|
|
10
|
+
declare function proceed(): Promise<void>;
|
|
11
|
+
/** Stop the gated flow. */
|
|
12
|
+
declare function cancel(): Promise<void>;
|
|
13
|
+
export declare const interceptors: {
|
|
14
|
+
register: typeof register;
|
|
15
|
+
unregister: typeof unregister;
|
|
16
|
+
onOverlay: typeof onOverlay;
|
|
17
|
+
resolve: typeof resolve;
|
|
18
|
+
proceed: typeof proceed;
|
|
19
|
+
cancel: typeof cancel;
|
|
20
|
+
};
|
|
21
|
+
export type { InterceptorFunction, InterceptorPoint, InterceptorRegisterOptions, InterceptorReturn, InterceptorOverlayContext, InterceptorHostCommands } from "./types";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { commandFrameClient } from "../client";
|
|
2
|
+
const DEFAULT_ORIGIN = "*";
|
|
3
|
+
function getOrigin() {
|
|
4
|
+
return typeof window !== "undefined" ? window.__COMMAND_FRAME_ORIGIN__ ?? DEFAULT_ORIGIN : DEFAULT_ORIGIN;
|
|
5
|
+
}
|
|
6
|
+
let overlayId = null;
|
|
7
|
+
let overlayContext = null;
|
|
8
|
+
let overlayHandler = null;
|
|
9
|
+
if (typeof window !== "undefined") {
|
|
10
|
+
window.addEventListener("message", (event) => {
|
|
11
|
+
const data = event.data;
|
|
12
|
+
if (data && data.type === "interceptor-overlay-init" && typeof data.overlayId === "string") {
|
|
13
|
+
overlayId = data.overlayId;
|
|
14
|
+
overlayContext = { point: data.point, payload: data.payload };
|
|
15
|
+
if (overlayHandler)
|
|
16
|
+
overlayHandler(overlayContext);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** Register a session-scoped interceptor for a named point. Callback is serialized to the host. */
|
|
21
|
+
function register(point, callback, options) {
|
|
22
|
+
const interceptorId = options.interceptorId;
|
|
23
|
+
const functionBody = callback.toString();
|
|
24
|
+
if (typeof window !== "undefined" && window.top && window.top !== window) {
|
|
25
|
+
window.top.postMessage({ type: "interceptor-register", point, functionBody, interceptorId, timeoutMs: options.timeoutMs }, getOrigin());
|
|
26
|
+
}
|
|
27
|
+
return interceptorId;
|
|
28
|
+
}
|
|
29
|
+
function unregister(interceptorId) {
|
|
30
|
+
if (typeof window !== "undefined" && window.top && window.top !== window) {
|
|
31
|
+
window.top.postMessage({ type: "interceptor-unregister", interceptorId }, getOrigin());
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** Register a handler invoked when this iframe is opened as an overlay by the host. */
|
|
35
|
+
function onOverlay(handler) {
|
|
36
|
+
overlayHandler = handler;
|
|
37
|
+
if (overlayContext)
|
|
38
|
+
handler(overlayContext);
|
|
39
|
+
}
|
|
40
|
+
async function report(result) {
|
|
41
|
+
if (!overlayId) {
|
|
42
|
+
console.warn("[interceptors] report called outside an overlay context — ignored");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
await commandFrameClient.call("resolveExtensionOverlay", { overlayId, result });
|
|
46
|
+
}
|
|
47
|
+
/** Continue the gated flow, merging `data` into the flow payload. */
|
|
48
|
+
function resolve(data) { return report(data); }
|
|
49
|
+
/** Continue the gated flow with no data. */
|
|
50
|
+
function proceed() { return report(true); }
|
|
51
|
+
/** Stop the gated flow. */
|
|
52
|
+
function cancel() { return report(false); }
|
|
53
|
+
export const interceptors = { register, unregister, onOverlay, resolve, proceed, cancel };
|
|
@@ -5,23 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type InterceptorPoint = "refund_start";
|
|
7
7
|
/** false = stop the flow; true = continue, no data; object = continue and merge into the flow payload. */
|
|
8
|
-
export type InterceptorReturn<T extends Record<string,
|
|
9
|
-
/** Params accepted by the host-injected `openExtensionOverlay` command. */
|
|
10
|
-
export interface OpenExtensionOverlayCommandParams {
|
|
11
|
-
point: InterceptorPoint;
|
|
12
|
-
payload?: unknown;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Host commands injected into an interceptor callback. `openExtensionOverlay` is the one
|
|
16
|
-
* always-present command; additional host commands are dispatched through the same shape.
|
|
17
|
-
* Heterogeneous command payloads are sent via the separate `callCommand` arg of
|
|
18
|
-
* `InterceptorFunction`, so the indexed entries here share the overlay command's param type.
|
|
19
|
-
*/
|
|
8
|
+
export type InterceptorReturn<T extends Record<string, any> = Record<string, any>> = boolean | T;
|
|
20
9
|
export interface InterceptorHostCommands {
|
|
21
|
-
openExtensionOverlay: (params:
|
|
22
|
-
|
|
10
|
+
openExtensionOverlay: (params: {
|
|
11
|
+
point: InterceptorPoint;
|
|
12
|
+
payload?: any;
|
|
13
|
+
}) => Promise<InterceptorReturn>;
|
|
14
|
+
[command: string]: (params?: any) => Promise<any>;
|
|
23
15
|
}
|
|
24
|
-
export type InterceptorFunction = (payload:
|
|
16
|
+
export type InterceptorFunction = (payload: any, cmds: InterceptorHostCommands, callCommand: (action: string, params?: any) => Promise<any>) => InterceptorReturn | Promise<InterceptorReturn>;
|
|
25
17
|
export interface InterceptorRegisterOptions {
|
|
26
18
|
/** Stable id; re-registering with the same id replaces the previous one. */
|
|
27
19
|
interceptorId: string;
|
|
@@ -30,5 +22,5 @@ export interface InterceptorRegisterOptions {
|
|
|
30
22
|
}
|
|
31
23
|
export interface InterceptorOverlayContext {
|
|
32
24
|
point: InterceptorPoint;
|
|
33
|
-
payload:
|
|
25
|
+
payload: any;
|
|
34
26
|
}
|
|
@@ -2,13 +2,17 @@ import { mockAddCartDiscount } from "../../actions/add-cart-discount/mock";
|
|
|
2
2
|
import { mockAddCartFee } from "../../actions/add-cart-fee/mock";
|
|
3
3
|
import { mockRemoveCartFee } from "../../actions/remove-cart-fee/mock";
|
|
4
4
|
import { mockAddCustomSale } from "../../actions/add-custom-sale/mock";
|
|
5
|
+
import { mockRemoveCustomSale } from "../../actions/remove-custom-sale/mock";
|
|
5
6
|
import { mockAddCustomer } from "../../actions/add-customer/mock";
|
|
6
7
|
import { mockAddCustomerNote } from "../../actions/add-customer-note/mock";
|
|
7
8
|
import { mockRemoveCustomerNote } from "../../actions/remove-customer-note/mock";
|
|
8
9
|
import { mockEditCustomer } from "../../actions/edit-customer/mock";
|
|
9
10
|
import { mockAddOrderNote } from "../../actions/add-order-note/mock";
|
|
11
|
+
import { mockRemoveOrderNote } from "../../actions/remove-order-note/mock";
|
|
10
12
|
import { mockAddProductDiscount } from "../../actions/add-product-discount/mock";
|
|
11
13
|
import { mockAddProductFee } from "../../actions/add-product-fee/mock";
|
|
14
|
+
import { mockRemoveProductDiscount } from "../../actions/remove-product-discount/mock";
|
|
15
|
+
import { mockRemoveProductFee } from "../../actions/remove-product-fee/mock";
|
|
12
16
|
import { mockSetActiveProductFee } from "../../actions/set-active-product-fee/mock";
|
|
13
17
|
import { mockSetActiveProductDiscount } from "../../actions/set-active-product-discount/mock";
|
|
14
18
|
import { mockGetActiveProduct } from "../../actions/get-active-product/mock";
|
|
@@ -37,6 +41,8 @@ import { mockGetTaxTables } from "../../actions/get-tax-tables/mock";
|
|
|
37
41
|
import { mockGetRemainingRefundableQuantities } from "../../actions/get-remaining-refundable-quantities/mock";
|
|
38
42
|
import { mockGoToStationHome } from "../../actions/go-to-station-home/mock";
|
|
39
43
|
import { mockInitiateRefund } from "../../actions/initiate-refund/mock";
|
|
44
|
+
import { mockOpenExtensionOverlay } from "../../actions/open-extension-overlay/mock";
|
|
45
|
+
import { mockResolveExtensionOverlay } from "../../actions/resolve-extension-overlay/mock";
|
|
40
46
|
import { mockOpenCashDrawer } from "../../actions/open-cash-drawer/mock";
|
|
41
47
|
import { mockParkOrder } from "../../actions/park-order/mock";
|
|
42
48
|
import { mockPartialPayment } from "../../actions/partial-payment/mock";
|
|
@@ -55,10 +61,6 @@ import { mockVendaraPayment } from "../../actions/vendara-payment/mock";
|
|
|
55
61
|
import { mockExtensionPayment } from "../../actions/extension-payment/mock";
|
|
56
62
|
import { mockRedeemPayment } from "../../actions/redeem-payment/mock";
|
|
57
63
|
import { mockIntegrationPayment } from "../../actions/integration-payment/mock";
|
|
58
|
-
import { mockGetSmartGridLayout } from "../../actions/get-smart-grid-layout/mock";
|
|
59
|
-
import { mockSaveSmartGridLayout } from "../../actions/save-smart-grid-layout/mock";
|
|
60
|
-
import { mockOpenExtensionOverlay } from "../../actions/open-extension-overlay/mock";
|
|
61
|
-
import { mockResolveExtensionOverlay } from "../../actions/resolve-extension-overlay/mock";
|
|
62
64
|
import { mockAddNonRevenueItem } from "../../actions/add-non-revenue-item/mock";
|
|
63
65
|
import { mockGetFinalContext } from "../../actions/get-final-context/mock";
|
|
64
66
|
import { mockPrint } from "../../actions/print/mock";
|
|
@@ -80,14 +82,15 @@ import { mockGetActiveOrder } from "../../actions/get-active-order/mock";
|
|
|
80
82
|
import { mockGetActiveCustomer } from "../../actions/get-active-customer/mock";
|
|
81
83
|
import { mockSetActiveCustomer } from "../../actions/set-active-customer/mock";
|
|
82
84
|
import { mockGetActiveOutlet } from "../../actions/get-active-outlet/mock";
|
|
83
|
-
import { mockSetActiveOutlet } from "../../actions/set-active-outlet/mock";
|
|
84
85
|
import { mockGetActiveStation } from "../../actions/get-active-station/mock";
|
|
85
|
-
import { mockSetActiveStation } from "../../actions/set-active-station/mock";
|
|
86
86
|
import { mockGetActiveSession } from "../../actions/get-active-session/mock";
|
|
87
|
-
import { mockSetActiveSession } from "../../actions/set-active-session/mock";
|
|
88
87
|
import { mockGetActiveUser } from "../../actions/get-active-user/mock";
|
|
89
88
|
import { mockSetActiveUser } from "../../actions/set-active-user/mock";
|
|
90
89
|
import { mockSetActiveRefund } from "../../actions/set-active-refund/mock";
|
|
90
|
+
import { canTransitionMock } from "../../actions/can-transition/mock";
|
|
91
|
+
import { getAvailableTransitionsMock } from "../../actions/get-available-transitions/mock";
|
|
92
|
+
import { mockGetSmartGridLayout } from "../../actions/get-smart-grid-layout/mock";
|
|
93
|
+
import { mockSaveSmartGridLayout } from "../../actions/save-smart-grid-layout/mock";
|
|
91
94
|
export const RENDER_MOCKS = {
|
|
92
95
|
addCartDiscount: mockAddCartDiscount,
|
|
93
96
|
addCartFee: mockAddCartFee,
|
|
@@ -126,6 +129,8 @@ export const RENDER_MOCKS = {
|
|
|
126
129
|
getRemainingRefundableQuantities: mockGetRemainingRefundableQuantities,
|
|
127
130
|
goToStationHome: mockGoToStationHome,
|
|
128
131
|
initiateRefund: mockInitiateRefund,
|
|
132
|
+
openExtensionOverlay: mockOpenExtensionOverlay,
|
|
133
|
+
resolveExtensionOverlay: mockResolveExtensionOverlay,
|
|
129
134
|
openCashDrawer: mockOpenCashDrawer,
|
|
130
135
|
parkOrder: mockParkOrder,
|
|
131
136
|
partialPayment: mockPartialPayment,
|
|
@@ -166,23 +171,20 @@ export const RENDER_MOCKS = {
|
|
|
166
171
|
getActiveCustomer: mockGetActiveCustomer,
|
|
167
172
|
setActiveCustomer: mockSetActiveCustomer,
|
|
168
173
|
getActiveOutlet: mockGetActiveOutlet,
|
|
169
|
-
setActiveOutlet: mockSetActiveOutlet,
|
|
170
174
|
getActiveStation: mockGetActiveStation,
|
|
171
|
-
setActiveStation: mockSetActiveStation,
|
|
172
175
|
getActiveSession: mockGetActiveSession,
|
|
173
|
-
setActiveSession: mockSetActiveSession,
|
|
174
176
|
getActiveUser: mockGetActiveUser,
|
|
175
177
|
setActiveUser: mockSetActiveUser,
|
|
176
178
|
setActiveRefund: mockSetActiveRefund,
|
|
177
|
-
removeProductDiscount:
|
|
178
|
-
removeProductFee:
|
|
179
|
+
removeProductDiscount: mockRemoveProductDiscount,
|
|
180
|
+
removeProductFee: mockRemoveProductFee,
|
|
179
181
|
removeProductNote: () => Promise.resolve({ success: true, timestamp: new Date().toISOString() }),
|
|
180
182
|
removeCartFee: mockRemoveCartFee,
|
|
181
|
-
removeOrderNote:
|
|
182
|
-
removeCustomSale:
|
|
183
|
+
removeOrderNote: mockRemoveOrderNote,
|
|
184
|
+
removeCustomSale: mockRemoveCustomSale,
|
|
183
185
|
removeNonRevenueItem: params => Promise.resolve({ success: true, externalId: params.externalId, timestamp: new Date().toISOString() }),
|
|
186
|
+
canTransition: canTransitionMock,
|
|
187
|
+
getAvailableTransitions: getAvailableTransitionsMock,
|
|
184
188
|
getSmartGridLayout: mockGetSmartGridLayout,
|
|
185
|
-
saveSmartGridLayout: mockSaveSmartGridLayout
|
|
186
|
-
openExtensionOverlay: mockOpenExtensionOverlay,
|
|
187
|
-
resolveExtensionOverlay: mockResolveExtensionOverlay
|
|
189
|
+
saveSmartGridLayout: mockSaveSmartGridLayout
|
|
188
190
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet,
|
|
1
|
+
import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout } from "../../index";
|
|
2
|
+
import type { OpenExtensionOverlay } from "../../actions/open-extension-overlay/types";
|
|
3
|
+
import type { ResolveExtensionOverlay } from "../../actions/resolve-extension-overlay/types";
|
|
2
4
|
export interface RenderProviderActions {
|
|
3
5
|
exampleFunction: ExampleFunction;
|
|
4
6
|
getProducts: GetProducts;
|
|
@@ -32,6 +34,8 @@ export interface RenderProviderActions {
|
|
|
32
34
|
resumeParkedOrder: ResumeParkedOrder;
|
|
33
35
|
deleteParkedOrder: DeleteParkedOrder;
|
|
34
36
|
initiateRefund: InitiateRefund;
|
|
37
|
+
openExtensionOverlay: OpenExtensionOverlay;
|
|
38
|
+
resolveExtensionOverlay: ResolveExtensionOverlay;
|
|
35
39
|
cashPayment: CashPayment;
|
|
36
40
|
tapToPayPayment: TapToPayPayment;
|
|
37
41
|
terminalPayment: TerminalPayment;
|
|
@@ -77,11 +81,8 @@ export interface RenderProviderActions {
|
|
|
77
81
|
getActiveCustomer: GetActiveCustomer;
|
|
78
82
|
setActiveCustomer: SetActiveCustomer;
|
|
79
83
|
getActiveOutlet: GetActiveOutlet;
|
|
80
|
-
setActiveOutlet: SetActiveOutlet;
|
|
81
84
|
getActiveStation: GetActiveStation;
|
|
82
|
-
setActiveStation: SetActiveStation;
|
|
83
85
|
getActiveSession: GetActiveSession;
|
|
84
|
-
setActiveSession: SetActiveSession;
|
|
85
86
|
getActiveUser: GetActiveUser;
|
|
86
87
|
setActiveUser: SetActiveUser;
|
|
87
88
|
setActiveRefund: SetActiveRefund;
|
|
@@ -92,8 +93,8 @@ export interface RenderProviderActions {
|
|
|
92
93
|
removeOrderNote: RemoveOrderNote;
|
|
93
94
|
removeCustomSale: RemoveCustomSale;
|
|
94
95
|
removeNonRevenueItem: RemoveNonRevenueItem;
|
|
96
|
+
canTransition: CanTransition;
|
|
97
|
+
getAvailableTransitions: GetAvailableTransitions;
|
|
95
98
|
getSmartGridLayout: GetSmartGridLayout;
|
|
96
99
|
saveSmartGridLayout: SaveSmartGridLayout;
|
|
97
|
-
openExtensionOverlay: OpenExtensionOverlay;
|
|
98
|
-
resolveExtensionOverlay: ResolveExtensionOverlay;
|
|
99
100
|
}
|
|
@@ -26,6 +26,16 @@ export const ordersTopic = {
|
|
|
26
26
|
id: "get-active-order",
|
|
27
27
|
name: "Get Active Order",
|
|
28
28
|
description: "Published when the active order is retrieved for listeners"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "state-transition-completed",
|
|
32
|
+
name: "State Transition Completed",
|
|
33
|
+
description: "Published when an order state transition completes successfully"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "state-transition-blocked",
|
|
37
|
+
name: "State Transition Blocked",
|
|
38
|
+
description: "Published when an order state transition is blocked by the state machine"
|
|
29
39
|
}
|
|
30
40
|
]
|
|
31
41
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TopicEvent } from "../../../types";
|
|
2
|
+
import type { CFBlockedBy } from "../../../../common-types/order-state";
|
|
3
|
+
export interface OrderStateTransitionBlockedPayload {
|
|
4
|
+
orderId: string;
|
|
5
|
+
from: {
|
|
6
|
+
payment: string;
|
|
7
|
+
fulfillment: string;
|
|
8
|
+
};
|
|
9
|
+
to: {
|
|
10
|
+
payment: string;
|
|
11
|
+
fulfillment: string;
|
|
12
|
+
};
|
|
13
|
+
blockedBy: CFBlockedBy;
|
|
14
|
+
reason?: string;
|
|
15
|
+
}
|
|
16
|
+
export type OrderStateTransitionBlockedEvent = TopicEvent<OrderStateTransitionBlockedPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TopicEvent } from "../../../types";
|
|
2
|
+
export interface OrderStateTransitionCompletedPayload {
|
|
3
|
+
orderId: string;
|
|
4
|
+
from: {
|
|
5
|
+
payment: string;
|
|
6
|
+
fulfillment: string;
|
|
7
|
+
};
|
|
8
|
+
to: {
|
|
9
|
+
payment: string;
|
|
10
|
+
fulfillment: string;
|
|
11
|
+
};
|
|
12
|
+
displayState: string;
|
|
13
|
+
forced?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type OrderStateTransitionCompletedEvent = TopicEvent<OrderStateTransitionCompletedPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,9 +6,13 @@ export * from "./order-created/types";
|
|
|
6
6
|
export * from "./order-updated/types";
|
|
7
7
|
export * from "./set-active-order/types";
|
|
8
8
|
export * from "./get-active-order/types";
|
|
9
|
+
export * from "./state-transition-completed/types";
|
|
10
|
+
export * from "./state-transition-blocked/types";
|
|
9
11
|
import type { OrderCreatedPayload } from "./order-created/types";
|
|
10
12
|
import type { OrderUpdatedPayload } from "./order-updated/types";
|
|
11
13
|
import type { OrderActiveSetPayload } from "./set-active-order/types";
|
|
12
14
|
import type { OrderActiveGetPayload } from "./get-active-order/types";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
import type { OrderStateTransitionCompletedPayload } from "./state-transition-completed/types";
|
|
16
|
+
import type { OrderStateTransitionBlockedPayload } from "./state-transition-blocked/types";
|
|
17
|
+
export type OrdersEventPayload = OrderCreatedPayload | OrderUpdatedPayload | OrderActiveSetPayload | OrderActiveGetPayload | OrderStateTransitionCompletedPayload | OrderStateTransitionBlockedPayload;
|
|
18
|
+
export type OrdersEventType = "order-created" | "order-updated" | "set-active-order" | "get-active-order" | "state-transition-completed" | "state-transition-blocked";
|
|
@@ -7,3 +7,5 @@ export * from "./order-created/types";
|
|
|
7
7
|
export * from "./order-updated/types";
|
|
8
8
|
export * from "./set-active-order/types";
|
|
9
9
|
export * from "./get-active-order/types";
|
|
10
|
+
export * from "./state-transition-completed/types";
|
|
11
|
+
export * from "./state-transition-blocked/types";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Payments Topic Definition
|
|
3
|
+
* Defines the split-payments topic and its available event types.
|
|
4
|
+
*
|
|
5
|
+
* This topic mirrors render's `activeEntities.splitPayment` Redux slice. The
|
|
6
|
+
* host (render) publishes the full current `CFSplitPayment` (or `null` when
|
|
7
|
+
* reset) on every mutation and on the command-frame handshake so consumers
|
|
8
|
+
* stay in sync without owning the underlying state.
|
|
9
|
+
*/
|
|
10
|
+
import type { TopicDefinition } from "../../types";
|
|
11
|
+
export declare const splitPaymentsTopic: TopicDefinition;
|
|
12
|
+
export * from "./types";
|