@final-commerce/command-frame 0.2.0-beta.6 → 0.3.0-beta.5
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 +24 -0
- package/dist/CommonTypes.d.ts +73 -622
- package/dist/CommonTypes.js +5 -65
- 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/add-product/mock.js +1 -1
- package/dist/actions/add-product-discount/mock.js +5 -5
- package/dist/actions/add-product-fee/mock.js +6 -6
- 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/cash-payment/mock.js +12 -18
- package/dist/actions/delete-parked-order/mock.js +3 -1
- package/dist/actions/edit-product/mock.js +1 -1
- package/dist/actions/extension-payment/types.d.ts +4 -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 +9 -4
- package/dist/actions/get-products/types.d.ts +2 -0
- package/dist/actions/get-roles/mock.js +35 -41
- package/dist/actions/get-smart-grid-layout/action.d.ts +2 -0
- package/dist/actions/get-smart-grid-layout/action.js +4 -0
- package/dist/actions/get-smart-grid-layout/mock.d.ts +2 -0
- package/dist/actions/get-smart-grid-layout/mock.js +9 -0
- package/dist/actions/get-smart-grid-layout/types.d.ts +10 -0
- package/dist/actions/get-users/mock.js +16 -25
- package/dist/actions/integration-payment/action.d.ts +5 -0
- package/dist/actions/integration-payment/action.js +7 -0
- package/dist/actions/integration-payment/mock.d.ts +2 -0
- package/dist/actions/integration-payment/mock.js +4 -0
- package/dist/actions/integration-payment/types.d.ts +56 -0
- package/dist/actions/open-extension-overlay/action.d.ts +2 -0
- package/dist/actions/open-extension-overlay/action.js +4 -0
- package/dist/actions/open-extension-overlay/mock.d.ts +2 -0
- package/dist/actions/open-extension-overlay/mock.js +1 -0
- package/dist/actions/open-extension-overlay/types.d.ts +9 -0
- package/dist/actions/park-order/mock.js +4 -1
- package/dist/actions/partial-payment/mock.js +21 -3
- 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/action.d.ts +2 -0
- package/dist/actions/resolve-extension-overlay/action.js +4 -0
- package/dist/actions/resolve-extension-overlay/mock.d.ts +2 -0
- package/dist/actions/resolve-extension-overlay/mock.js +1 -0
- package/dist/actions/resolve-extension-overlay/types.d.ts +9 -0
- package/dist/actions/resolve-extension-overlay/types.js +1 -0
- package/dist/actions/resume-parked-order/mock.js +5 -2
- package/dist/actions/save-smart-grid-layout/action.d.ts +2 -0
- package/dist/actions/save-smart-grid-layout/action.js +4 -0
- package/dist/actions/save-smart-grid-layout/mock.d.ts +2 -0
- package/dist/actions/save-smart-grid-layout/mock.js +10 -0
- package/dist/actions/save-smart-grid-layout/types.d.ts +10 -0
- package/dist/actions/save-smart-grid-layout/types.js +1 -0
- package/dist/actions/set-active-product-discount/mock.js +1 -1
- package/dist/actions/set-active-product-fee/mock.js +1 -1
- package/dist/actions/tap-to-pay-payment/mock.js +5 -3
- package/dist/actions/terminal-payment/mock.js +4 -5
- package/dist/actions/update-cart-item-quantity/mock.js +9 -9
- package/dist/demo/database.d.ts +33 -22
- package/dist/demo/database.js +191 -21
- package/dist/index.d.ts +116 -115
- package/dist/index.js +15 -13
- package/dist/interceptors/index.d.ts +21 -0
- package/dist/interceptors/index.js +53 -0
- package/dist/interceptors/types.d.ts +26 -0
- package/dist/interceptors/types.js +1 -0
- package/dist/projects/render/mocks.js +19 -15
- package/dist/projects/render/types.d.ts +8 -6
- package/dist/pubsub/topics/products/product-get-active/types.d.ts +6 -2
- 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 +17 -14
- 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/trigger-webhook/action.d.ts +0 -6
- package/dist/actions/trigger-webhook/action.js +0 -8
- package/dist/actions/trigger-webhook/mock.d.ts +0 -2
- package/dist/actions/trigger-webhook/mock.js +0 -8
- package/dist/actions/trigger-webhook/types.d.ts +0 -21
- package/dist/actions/trigger-webhook/types.js +0 -2
- package/dist/actions/trigger-zapier-webhook/action.d.ts +0 -6
- package/dist/actions/trigger-zapier-webhook/action.js +0 -8
- package/dist/actions/trigger-zapier-webhook/mock.d.ts +0 -2
- package/dist/actions/trigger-zapier-webhook/mock.js +0 -8
- package/dist/actions/trigger-zapier-webhook/types.d.ts +0 -9
- /package/dist/actions/{set-active-outlet → apply-transition}/types.js +0 -0
- /package/dist/actions/{set-active-session → get-smart-grid-layout}/types.js +0 -0
- /package/dist/actions/{set-active-station → integration-payment}/types.js +0 -0
- /package/dist/actions/{trigger-zapier-webhook → open-extension-overlay}/types.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,111 +1,110 @@
|
|
|
1
1
|
export declare const command: {
|
|
2
|
-
readonly exampleFunction: import("
|
|
3
|
-
readonly generateAPIKey: import("
|
|
4
|
-
readonly getProducts: import("
|
|
5
|
-
readonly addCustomSale: import("
|
|
6
|
-
readonly addNonRevenueItem: import("
|
|
7
|
-
readonly getCustomers: import("
|
|
8
|
-
readonly assignCustomer: import("
|
|
9
|
-
readonly addCustomer: import("
|
|
10
|
-
readonly editCustomer: import("
|
|
11
|
-
readonly getCategories: import("
|
|
12
|
-
readonly getOrders: import("
|
|
13
|
-
readonly getRefunds: import("
|
|
14
|
-
readonly addProductDiscount: import("
|
|
15
|
-
readonly addProductToCart: import("
|
|
16
|
-
readonly removeProductFromCart: import("
|
|
17
|
-
readonly updateCartItemQuantity: import("
|
|
18
|
-
readonly addCartDiscount: import("
|
|
19
|
-
readonly getContext: import("
|
|
20
|
-
readonly getFinalContext: import("
|
|
21
|
-
readonly addProductNote: import("
|
|
22
|
-
readonly addProductFee: import("
|
|
23
|
-
readonly setActiveProductFee: import("
|
|
24
|
-
readonly setActiveProductDiscount: import("
|
|
25
|
-
readonly getActiveProduct: import("
|
|
26
|
-
readonly setActiveProduct: import("
|
|
27
|
-
readonly adjustInventory: import("
|
|
28
|
-
readonly addOrderNote: import("
|
|
29
|
-
readonly addCartFee: import("
|
|
30
|
-
readonly getCurrentCart: import("
|
|
31
|
-
readonly clearCart: import("
|
|
32
|
-
readonly parkOrder: import("
|
|
33
|
-
readonly resumeParkedOrder: import("
|
|
34
|
-
readonly deleteParkedOrder: import("
|
|
35
|
-
readonly cashPayment: import("
|
|
36
|
-
readonly tapToPayPayment: import("
|
|
37
|
-
readonly terminalPayment: import("
|
|
38
|
-
readonly vendaraPayment: import("
|
|
39
|
-
readonly extensionPayment: import("
|
|
40
|
-
readonly redeemPayment: import("
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
57
|
-
readonly
|
|
58
|
-
readonly
|
|
59
|
-
readonly getActiveStation: import("
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
readonly
|
|
67
|
-
readonly
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
71
|
-
readonly
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
74
|
-
readonly
|
|
75
|
-
readonly
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
84
|
-
readonly
|
|
85
|
-
readonly
|
|
86
|
-
readonly
|
|
87
|
-
readonly
|
|
88
|
-
readonly
|
|
89
|
-
readonly
|
|
90
|
-
readonly
|
|
91
|
-
readonly
|
|
92
|
-
readonly
|
|
93
|
-
readonly
|
|
94
|
-
readonly
|
|
95
|
-
readonly
|
|
96
|
-
readonly
|
|
97
|
-
readonly
|
|
98
|
-
readonly
|
|
99
|
-
readonly
|
|
100
|
-
readonly
|
|
101
|
-
readonly
|
|
102
|
-
readonly
|
|
103
|
-
readonly
|
|
104
|
-
readonly
|
|
105
|
-
readonly
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
108
|
-
readonly getAvailableTransitions: import("./actions/get-available-transitions/types").GetAvailableTransitions;
|
|
2
|
+
readonly exampleFunction: import(".").ExampleFunction;
|
|
3
|
+
readonly generateAPIKey: import(".").GenerateAPIKey;
|
|
4
|
+
readonly getProducts: import(".").GetProducts;
|
|
5
|
+
readonly addCustomSale: import(".").AddCustomSale;
|
|
6
|
+
readonly addNonRevenueItem: import(".").AddNonRevenueItem;
|
|
7
|
+
readonly getCustomers: import(".").GetCustomers;
|
|
8
|
+
readonly assignCustomer: import(".").AssignCustomer;
|
|
9
|
+
readonly addCustomer: import(".").AddCustomer;
|
|
10
|
+
readonly editCustomer: import(".").EditCustomer;
|
|
11
|
+
readonly getCategories: import(".").GetCategories;
|
|
12
|
+
readonly getOrders: import(".").GetOrders;
|
|
13
|
+
readonly getRefunds: import(".").GetRefunds;
|
|
14
|
+
readonly addProductDiscount: import(".").AddProductDiscount;
|
|
15
|
+
readonly addProductToCart: import(".").AddProductToCart;
|
|
16
|
+
readonly removeProductFromCart: import(".").RemoveProductFromCart;
|
|
17
|
+
readonly updateCartItemQuantity: import(".").UpdateCartItemQuantity;
|
|
18
|
+
readonly addCartDiscount: import(".").AddCartDiscount;
|
|
19
|
+
readonly getContext: import(".").GetContext;
|
|
20
|
+
readonly getFinalContext: import(".").GetFinalContext;
|
|
21
|
+
readonly addProductNote: import(".").AddProductNote;
|
|
22
|
+
readonly addProductFee: import(".").AddProductFee;
|
|
23
|
+
readonly setActiveProductFee: import(".").SetActiveProductFee;
|
|
24
|
+
readonly setActiveProductDiscount: import(".").SetActiveProductDiscount;
|
|
25
|
+
readonly getActiveProduct: import(".").GetActiveProduct;
|
|
26
|
+
readonly setActiveProduct: import(".").SetActiveProduct;
|
|
27
|
+
readonly adjustInventory: import(".").AdjustInventory;
|
|
28
|
+
readonly addOrderNote: import(".").AddOrderNote;
|
|
29
|
+
readonly addCartFee: import(".").AddCartFee;
|
|
30
|
+
readonly getCurrentCart: import(".").GetCurrentCart;
|
|
31
|
+
readonly clearCart: import(".").ClearCart;
|
|
32
|
+
readonly parkOrder: import(".").ParkOrder;
|
|
33
|
+
readonly resumeParkedOrder: import(".").ResumeParkedOrder;
|
|
34
|
+
readonly deleteParkedOrder: import(".").DeleteParkedOrder;
|
|
35
|
+
readonly cashPayment: import(".").CashPayment;
|
|
36
|
+
readonly tapToPayPayment: import(".").TapToPayPayment;
|
|
37
|
+
readonly terminalPayment: import(".").TerminalPayment;
|
|
38
|
+
readonly vendaraPayment: import(".").VendaraPayment;
|
|
39
|
+
readonly extensionPayment: import(".").ExtensionPayment;
|
|
40
|
+
readonly redeemPayment: import(".").RedeemPayment;
|
|
41
|
+
readonly integrationPayment: import(".").IntegrationPayment;
|
|
42
|
+
readonly addCustomerNote: import(".").AddCustomerNote;
|
|
43
|
+
readonly removeCustomerNote: import(".").RemoveCustomerNote;
|
|
44
|
+
readonly removeCustomerFromCart: import(".").RemoveCustomerFromCart;
|
|
45
|
+
readonly removeCartDiscount: import(".").RemoveCartDiscount;
|
|
46
|
+
readonly goToStationHome: import(".").GoToStationHome;
|
|
47
|
+
readonly openCashDrawer: import(".").OpenCashDrawer;
|
|
48
|
+
readonly showNotification: import(".").ShowNotification;
|
|
49
|
+
readonly showConfirmation: import(".").ShowConfirmation;
|
|
50
|
+
readonly authenticateUser: import(".").AuthenticateUser;
|
|
51
|
+
readonly partialPayment: import(".").PartialPayment;
|
|
52
|
+
readonly switchUser: import(".").SwitchUser;
|
|
53
|
+
readonly print: import(".").Print;
|
|
54
|
+
readonly setActiveOrder: import(".").SetActiveOrder;
|
|
55
|
+
readonly getActiveOrder: import(".").GetActiveOrder;
|
|
56
|
+
readonly getActiveCustomer: import(".").GetActiveCustomer;
|
|
57
|
+
readonly setActiveCustomer: import(".").SetActiveCustomer;
|
|
58
|
+
readonly getActiveOutlet: import(".").GetActiveOutlet;
|
|
59
|
+
readonly getActiveStation: import(".").GetActiveStation;
|
|
60
|
+
readonly getActiveSession: import(".").GetActiveSession;
|
|
61
|
+
readonly getActiveUser: import(".").GetActiveUser;
|
|
62
|
+
readonly setActiveUser: import(".").SetActiveUser;
|
|
63
|
+
readonly setActiveRefund: import(".").SetActiveRefund;
|
|
64
|
+
readonly removeProductDiscount: import(".").RemoveProductDiscount;
|
|
65
|
+
readonly removeProductFee: import(".").RemoveProductFee;
|
|
66
|
+
readonly removeProductNote: import(".").RemoveProductNote;
|
|
67
|
+
readonly removeCartFee: import(".").RemoveCartFee;
|
|
68
|
+
readonly removeOrderNote: import(".").RemoveOrderNote;
|
|
69
|
+
readonly removeCustomSale: import(".").RemoveCustomSale;
|
|
70
|
+
readonly removeNonRevenueItem: import(".").RemoveNonRevenueItem;
|
|
71
|
+
readonly initiateRefund: import(".").InitiateRefund;
|
|
72
|
+
readonly setRefundStockAction: import(".").SetRefundStockAction;
|
|
73
|
+
readonly selectAllRefundItems: import(".").SelectAllRefundItems;
|
|
74
|
+
readonly resetRefundDetails: import(".").ResetRefundDetails;
|
|
75
|
+
readonly calculateRefundTotal: import(".").CalculateRefundTotal;
|
|
76
|
+
readonly getRemainingRefundableQuantities: import(".").GetRemainingRefundableQuantities;
|
|
77
|
+
readonly processPartialRefund: import(".").ProcessPartialRefund;
|
|
78
|
+
readonly addProduct: import(".").AddProduct;
|
|
79
|
+
readonly editProduct: import(".").EditProduct;
|
|
80
|
+
readonly editProductVariants: import(".").EditProductVariants;
|
|
81
|
+
readonly deleteProduct: import(".").DeleteProduct;
|
|
82
|
+
readonly getOutlets: import(".").GetOutlets;
|
|
83
|
+
readonly getStations: import(".").GetStations;
|
|
84
|
+
readonly getSmartGridLayout: import(".").GetSmartGridLayout;
|
|
85
|
+
readonly saveSmartGridLayout: import(".").SaveSmartGridLayout;
|
|
86
|
+
readonly getCustomTables: import(".").GetCustomTables;
|
|
87
|
+
readonly getCustomTableFields: import(".").GetCustomTableFields;
|
|
88
|
+
readonly getCustomTableData: import(".").GetCustomTableData;
|
|
89
|
+
readonly upsertCustomTableData: import(".").UpsertCustomTableData;
|
|
90
|
+
readonly deleteCustomTableData: import(".").DeleteCustomTableData;
|
|
91
|
+
readonly getCustomExtensions: import(".").GetCustomExtensions;
|
|
92
|
+
readonly getCurrentCompanyCustomExtensions: import(".").GetCurrentCompanyCustomExtensions;
|
|
93
|
+
readonly getCustomExtensionCustomTables: import(".").GetCustomExtensionCustomTables;
|
|
94
|
+
readonly getUsers: import(".").GetUsers;
|
|
95
|
+
readonly getRoles: import(".").GetRoles;
|
|
96
|
+
readonly getSecretsKeys: import(".").GetSecretsKeys;
|
|
97
|
+
readonly getSecretVal: import(".").GetSecretVal;
|
|
98
|
+
readonly setSecretVal: import(".").SetSecretVal;
|
|
99
|
+
readonly navigateTo: import(".").NavigateTo;
|
|
100
|
+
readonly refreshResource: import(".").RefreshResource;
|
|
101
|
+
readonly getMedia: import(".").GetMedia;
|
|
102
|
+
readonly uploadMedia: import(".").UploadMedia;
|
|
103
|
+
readonly getTaxTables: import(".").GetTaxTables;
|
|
104
|
+
readonly getBranding: import(".").GetBranding;
|
|
105
|
+
readonly canTransition: import(".").CanTransition;
|
|
106
|
+
readonly getAvailableTransitions: import(".").GetAvailableTransitions;
|
|
107
|
+
readonly applyTransition: import(".").ApplyTransition;
|
|
109
108
|
};
|
|
110
109
|
export type { ExampleFunction, ExampleFunctionParams, ExampleFunctionResponse } from "./actions/example-function/types";
|
|
111
110
|
export type { GenerateAPIKey, GenerateAPIKeyParams, GenerateAPIKeyResponse } from "./actions/generate-api-key/types";
|
|
@@ -123,6 +122,8 @@ export type { EditProductVariants, EditProductVariantsParams, EditProductVariant
|
|
|
123
122
|
export type { DeleteProduct, DeleteProductParams, DeleteProductResponse } from "./actions/delete-product/types";
|
|
124
123
|
export type { GetOutlets, GetOutletsResponse } from "./actions/get-outlets/types";
|
|
125
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";
|
|
126
127
|
export type { GetOrders, GetOrdersParams, GetOrdersResponse } from "./actions/get-orders/types";
|
|
127
128
|
export type { GetRefunds, GetRefundsParams, GetRefundsResponse } from "./actions/get-refunds/types";
|
|
128
129
|
export type { SetRefundStockAction, SetRefundStockActionParams, SetRefundStockActionResponse } from "./actions/set-refund-stock-action/types";
|
|
@@ -132,6 +133,8 @@ export type { CalculateRefundTotal, CalculateRefundTotalParams, CalculateRefundT
|
|
|
132
133
|
export type { GetRemainingRefundableQuantities, GetRemainingRefundableQuantitiesParams, GetRemainingRefundableQuantitiesResponse } from "./actions/get-remaining-refundable-quantities/types";
|
|
133
134
|
export type { ProcessPartialRefund, ProcessPartialRefundParams, ProcessPartialRefundResponse } from "./actions/process-partial-refund/types";
|
|
134
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";
|
|
135
138
|
export type { GetCurrentCart, GetCurrentCartResponse } from "./actions/get-current-cart/types";
|
|
136
139
|
export type { AddProductDiscount, AddProductDiscountParams, AddProductDiscountResponse } from "./actions/add-product-discount/types";
|
|
137
140
|
export type { AddProductToCart, AddProductToCartParams, AddProductToCartResponse } from "./actions/add-product-to-cart/types";
|
|
@@ -159,9 +162,7 @@ export type { TerminalPayment, TerminalPaymentParams, TerminalPaymentResponse }
|
|
|
159
162
|
export type { VendaraPayment, VendaraPaymentParams, VendaraPaymentResponse } from "./actions/vendara-payment/types";
|
|
160
163
|
export type { ExtensionPayment, ExtensionPaymentParams, ExtensionPaymentResponse } from "./actions/extension-payment/types";
|
|
161
164
|
export type { RedeemPayment, RedeemPaymentParams, RedeemPaymentResponse } from "./actions/redeem-payment/types";
|
|
162
|
-
export {
|
|
163
|
-
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
164
|
-
export type { ExtensionRefundParams, ExtensionRefundResponse } from "./actions/extension-refund/types";
|
|
165
|
+
export type { IntegrationPayment, IntegrationPaymentParams, IntegrationPaymentResponse, IntegrationEmvData } from "./actions/integration-payment/types";
|
|
165
166
|
export type { AddCustomerNote, AddCustomerNoteParams, AddCustomerNoteResponse } from "./actions/add-customer-note/types";
|
|
166
167
|
export type { RemoveCustomerNote, RemoveCustomerNoteParams, RemoveCustomerNoteResponse } from "./actions/remove-customer-note/types";
|
|
167
168
|
export type { RemoveCustomerFromCart, RemoveCustomerFromCartResponse } from "./actions/remove-customer-from-cart/types";
|
|
@@ -185,11 +186,8 @@ export type { GetActiveOrder, GetActiveOrderResponse } from "./actions/get-activ
|
|
|
185
186
|
export type { GetActiveCustomer, GetActiveCustomerResponse } from "./actions/get-active-customer/types";
|
|
186
187
|
export type { SetActiveCustomer, SetActiveCustomerParams, SetActiveCustomerResponse } from "./actions/set-active-customer/types";
|
|
187
188
|
export type { GetActiveOutlet, GetActiveOutletResponse } from "./actions/get-active-outlet/types";
|
|
188
|
-
export type { SetActiveOutlet, SetActiveOutletParams, SetActiveOutletResponse } from "./actions/set-active-outlet/types";
|
|
189
189
|
export type { GetActiveStation, GetActiveStationResponse } from "./actions/get-active-station/types";
|
|
190
|
-
export type { SetActiveStation, SetActiveStationParams, SetActiveStationResponse } from "./actions/set-active-station/types";
|
|
191
190
|
export type { GetActiveSession, GetActiveSessionResponse } from "./actions/get-active-session/types";
|
|
192
|
-
export type { SetActiveSession, SetActiveSessionParams, SetActiveSessionResponse } from "./actions/set-active-session/types";
|
|
193
191
|
export type { GetActiveUser, GetActiveUserResponse } from "./actions/get-active-user/types";
|
|
194
192
|
export type { SetActiveUser, SetActiveUserParams, SetActiveUserResponse } from "./actions/set-active-user/types";
|
|
195
193
|
export type { SetActiveRefund, SetActiveRefundParams, SetActiveRefundResponse } from "./actions/set-active-refund/types";
|
|
@@ -200,8 +198,6 @@ export type { RemoveCartFee, RemoveCartFeeParams, RemoveCartFeeResponse } from "
|
|
|
200
198
|
export type { RemoveOrderNote, RemoveOrderNoteResponse } from "./actions/remove-order-note/types";
|
|
201
199
|
export type { RemoveCustomSale, RemoveCustomSaleParams, RemoveCustomSaleResponse } from "./actions/remove-custom-sale/types";
|
|
202
200
|
export type { RemoveNonRevenueItem, RemoveNonRevenueItemParams, RemoveNonRevenueItemResponse } from "./actions/remove-non-revenue-item/types";
|
|
203
|
-
export type { TriggerWebhook, TriggerWebhookPresetType, TriggerWebhookParams, TriggerWebhookResponse } from "./actions/trigger-webhook/types";
|
|
204
|
-
export type { TriggerZapierWebhook, TriggerZapierWebhookParams, TriggerZapierWebhookResponse } from "./actions/trigger-zapier-webhook/types";
|
|
205
201
|
export * from "./CommonTypes";
|
|
206
202
|
export { setMockDatabase, setMockActiveProduct } from "./demo/database";
|
|
207
203
|
export type { MockDatabaseConfig } from "./demo/database";
|
|
@@ -216,12 +212,15 @@ export type { TopicDefinition, TopicEvent, TopicEventType, TopicSubscriptionCall
|
|
|
216
212
|
export type { TopicEventPayloadMap } from "./pubsub/topics/types";
|
|
217
213
|
export { hooks } from "./hooks";
|
|
218
214
|
export type { HookFunction, HookRegisterOptions } from "./hooks";
|
|
215
|
+
export { interceptors } from "./interceptors";
|
|
216
|
+
export type { InterceptorFunction, InterceptorPoint, InterceptorRegisterOptions, InterceptorReturn, InterceptorOverlayContext, InterceptorHostCommands } from "./interceptors";
|
|
219
217
|
export { customersTopic } from "./pubsub/topics/customers";
|
|
220
218
|
export { ordersTopic } from "./pubsub/topics/orders";
|
|
221
219
|
export { refundsTopic } from "./pubsub/topics/refunds";
|
|
222
220
|
export { productsTopic } from "./pubsub/topics/products";
|
|
223
221
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
224
222
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
223
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
225
224
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
226
225
|
export { printTopic } from "./pubsub/topics/print";
|
|
227
226
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
@@ -246,6 +245,7 @@ export type { CategoryCreatedPayload, CategoryCreatedEvent, CategoryUpdatedPaylo
|
|
|
246
245
|
export type { AttributeCreatedPayload, AttributeCreatedEvent, AttributeUpdatedPayload, AttributeUpdatedEvent, AttributesEventType, AttributesEventPayload } from "./pubsub/topics/attributes/types";
|
|
247
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";
|
|
248
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";
|
|
249
249
|
export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
|
|
250
250
|
export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload } from "./pubsub/topics/print/types";
|
|
251
251
|
export { AttributeType } from "./common-types/attribute-type";
|
|
@@ -267,4 +267,5 @@ export type { CFBlockedBy, CFStatePair, CFTransitionResult, CFFailedCondition, C
|
|
|
267
267
|
export type { CFConditionOperator, CFCondition, CFConditionGroup, CFTransitionConditionSet, CFPaymentTransitionPath, CFFulfillmentTransitionPath, CFCrossAxisRule, CFDisplayStateRule, CFStateConfigFragment } from "./common-types/state-fragment";
|
|
268
268
|
export type { CanTransition, CanTransitionParams, CanTransitionResponse } from "./actions/can-transition/types";
|
|
269
269
|
export type { GetAvailableTransitions, GetAvailableTransitionsParams, GetAvailableTransitionsResponse } from "./actions/get-available-transitions/types";
|
|
270
|
+
export type { ApplyTransition, ApplyTransitionParams, ApplyTransitionResponse } from "./actions/apply-transition/types";
|
|
270
271
|
export { preorderNoDepositFragment } from "./fragments";
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import { terminalPayment } from "./actions/terminal-payment/action";
|
|
|
38
38
|
import { vendaraPayment } from "./actions/vendara-payment/action";
|
|
39
39
|
import { extensionPayment } from "./actions/extension-payment/action";
|
|
40
40
|
import { redeemPayment } from "./actions/redeem-payment/action";
|
|
41
|
+
import { integrationPayment } from "./actions/integration-payment/action";
|
|
41
42
|
// Customer Actions
|
|
42
43
|
import { addCustomerNote } from "./actions/add-customer-note/action";
|
|
43
44
|
import { removeCustomerNote } from "./actions/remove-customer-note/action";
|
|
@@ -57,11 +58,8 @@ import { getActiveOrder } from "./actions/get-active-order/action";
|
|
|
57
58
|
import { getActiveCustomer } from "./actions/get-active-customer/action";
|
|
58
59
|
import { setActiveCustomer } from "./actions/set-active-customer/action";
|
|
59
60
|
import { getActiveOutlet } from "./actions/get-active-outlet/action";
|
|
60
|
-
import { setActiveOutlet } from "./actions/set-active-outlet/action";
|
|
61
61
|
import { getActiveStation } from "./actions/get-active-station/action";
|
|
62
|
-
import { setActiveStation } from "./actions/set-active-station/action";
|
|
63
62
|
import { getActiveSession } from "./actions/get-active-session/action";
|
|
64
|
-
import { setActiveSession } from "./actions/set-active-session/action";
|
|
65
63
|
import { getActiveUser } from "./actions/get-active-user/action";
|
|
66
64
|
import { setActiveUser } from "./actions/set-active-user/action";
|
|
67
65
|
import { setActiveRefund } from "./actions/set-active-refund/action";
|
|
@@ -74,8 +72,6 @@ import { removeOrderNote } from "./actions/remove-order-note/action";
|
|
|
74
72
|
import { removeCustomSale } from "./actions/remove-custom-sale/action";
|
|
75
73
|
import { removeNonRevenueItem } from "./actions/remove-non-revenue-item/action";
|
|
76
74
|
// Integration Actions
|
|
77
|
-
import { triggerWebhook } from "./actions/trigger-webhook/action";
|
|
78
|
-
import { triggerZapierWebhook } from "./actions/trigger-zapier-webhook/action";
|
|
79
75
|
// Refund Actions
|
|
80
76
|
import { getRefunds } from "./actions/get-refunds/action";
|
|
81
77
|
import { initiateRefund } from "./actions/initiate-refund/action";
|
|
@@ -105,6 +101,7 @@ import { generateAPIKey } from "./actions/generate-api-key/action";
|
|
|
105
101
|
// State Machine Query Actions
|
|
106
102
|
import { canTransition } from "./actions/can-transition/action";
|
|
107
103
|
import { getAvailableTransitions } from "./actions/get-available-transitions/action";
|
|
104
|
+
import { applyTransition } from "./actions/apply-transition/action";
|
|
108
105
|
// Product CRUD Actions
|
|
109
106
|
import { addProduct } from "./actions/add-product/action";
|
|
110
107
|
import { editProduct } from "./actions/edit-product/action";
|
|
@@ -113,6 +110,9 @@ import { deleteProduct } from "./actions/delete-product/action";
|
|
|
113
110
|
// Entity Actions
|
|
114
111
|
import { getOutlets } from "./actions/get-outlets/action";
|
|
115
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";
|
|
116
116
|
// Manage extension actions (optional hosts: Deerlake, etc.)
|
|
117
117
|
import { navigateTo } from "./actions/navigate-to/action";
|
|
118
118
|
import { refreshResource } from "./actions/refresh-resource/action";
|
|
@@ -163,6 +163,7 @@ export const command = {
|
|
|
163
163
|
vendaraPayment,
|
|
164
164
|
extensionPayment,
|
|
165
165
|
redeemPayment,
|
|
166
|
+
integrationPayment,
|
|
166
167
|
// Customer Actions
|
|
167
168
|
addCustomerNote,
|
|
168
169
|
removeCustomerNote,
|
|
@@ -182,11 +183,8 @@ export const command = {
|
|
|
182
183
|
getActiveCustomer,
|
|
183
184
|
setActiveCustomer,
|
|
184
185
|
getActiveOutlet,
|
|
185
|
-
setActiveOutlet,
|
|
186
186
|
getActiveStation,
|
|
187
|
-
setActiveStation,
|
|
188
187
|
getActiveSession,
|
|
189
|
-
setActiveSession,
|
|
190
188
|
getActiveUser,
|
|
191
189
|
setActiveUser,
|
|
192
190
|
setActiveRefund,
|
|
@@ -199,8 +197,6 @@ export const command = {
|
|
|
199
197
|
removeCustomSale,
|
|
200
198
|
removeNonRevenueItem,
|
|
201
199
|
// Integration Actions
|
|
202
|
-
triggerWebhook,
|
|
203
|
-
triggerZapierWebhook,
|
|
204
200
|
// Refund Actions
|
|
205
201
|
initiateRefund,
|
|
206
202
|
setRefundStockAction,
|
|
@@ -217,6 +213,9 @@ export const command = {
|
|
|
217
213
|
// Entity Actions
|
|
218
214
|
getOutlets,
|
|
219
215
|
getStations,
|
|
216
|
+
// SmartGrid Actions
|
|
217
|
+
getSmartGridLayout,
|
|
218
|
+
saveSmartGridLayout,
|
|
220
219
|
// Custom Tables Actions
|
|
221
220
|
getCustomTables,
|
|
222
221
|
getCustomTableFields,
|
|
@@ -243,10 +242,10 @@ export const command = {
|
|
|
243
242
|
getBranding,
|
|
244
243
|
// State Machine Queries
|
|
245
244
|
canTransition,
|
|
246
|
-
getAvailableTransitions
|
|
245
|
+
getAvailableTransitions,
|
|
246
|
+
applyTransition
|
|
247
247
|
};
|
|
248
|
-
|
|
249
|
-
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
248
|
+
// Integration Actions
|
|
250
249
|
// Export Common Types
|
|
251
250
|
export * from "./CommonTypes";
|
|
252
251
|
// Mock database override (standalone / extension dev)
|
|
@@ -263,6 +262,8 @@ export { commandFrameClient, CommandFrameClient } from "./client";
|
|
|
263
262
|
export { topics } from "./pubsub/topics";
|
|
264
263
|
// Export Hooks (extension iframe API for session-scoped event callbacks)
|
|
265
264
|
export { hooks } from "./hooks";
|
|
265
|
+
// Export Interceptors (extension iframe API for gating host flows)
|
|
266
|
+
export { interceptors } from "./interceptors";
|
|
266
267
|
// Export Pub/Sub Topics
|
|
267
268
|
export { customersTopic } from "./pubsub/topics/customers";
|
|
268
269
|
export { ordersTopic } from "./pubsub/topics/orders";
|
|
@@ -270,6 +271,7 @@ export { refundsTopic } from "./pubsub/topics/refunds";
|
|
|
270
271
|
export { productsTopic } from "./pubsub/topics/products";
|
|
271
272
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
272
273
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
274
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
273
275
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
274
276
|
export { printTopic } from "./pubsub/topics/print";
|
|
275
277
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
@@ -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 };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interceptors let an installed extension gate a host flow at a named point.
|
|
3
|
+
* Registration mirrors hooks: the callback is serialized and reconstructed on the host,
|
|
4
|
+
* so it must be self-contained (use only its payload arg and the injected host commands).
|
|
5
|
+
*/
|
|
6
|
+
export type InterceptorPoint = "refund_start";
|
|
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, any> = Record<string, any>> = boolean | T;
|
|
9
|
+
export interface InterceptorHostCommands {
|
|
10
|
+
openExtensionOverlay: (params: {
|
|
11
|
+
point: InterceptorPoint;
|
|
12
|
+
payload?: any;
|
|
13
|
+
}) => Promise<InterceptorReturn>;
|
|
14
|
+
[command: string]: (params?: any) => Promise<any>;
|
|
15
|
+
}
|
|
16
|
+
export type InterceptorFunction = (payload: any, cmds: InterceptorHostCommands, callCommand: (action: string, params?: any) => Promise<any>) => InterceptorReturn | Promise<InterceptorReturn>;
|
|
17
|
+
export interface InterceptorRegisterOptions {
|
|
18
|
+
/** Stable id; re-registering with the same id replaces the previous one. */
|
|
19
|
+
interceptorId: string;
|
|
20
|
+
/** Per-interceptor timeout override (ms). */
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface InterceptorOverlayContext {
|
|
24
|
+
point: InterceptorPoint;
|
|
25
|
+
payload: any;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|