@final-commerce/command-frame 0.1.56 → 0.1.57
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 +1 -5
- package/dist/CommonTypes.d.ts +33 -0
- package/dist/actions/get-active-customer/action.d.ts +2 -0
- package/dist/actions/get-active-customer/action.js +4 -0
- package/dist/actions/get-active-customer/mock.d.ts +2 -0
- package/dist/actions/get-active-customer/mock.js +10 -0
- package/dist/actions/get-active-customer/types.d.ts +7 -0
- package/dist/actions/get-active-order/action.d.ts +6 -0
- package/dist/actions/get-active-order/action.js +8 -0
- package/dist/actions/get-active-order/mock.d.ts +2 -0
- package/dist/actions/get-active-order/mock.js +11 -0
- package/dist/actions/get-active-order/types.d.ts +7 -0
- package/dist/actions/get-active-order/types.js +1 -0
- package/dist/actions/get-active-outlet/action.d.ts +2 -0
- package/dist/actions/get-active-outlet/action.js +4 -0
- package/dist/actions/get-active-outlet/mock.d.ts +2 -0
- package/dist/actions/get-active-outlet/mock.js +9 -0
- package/dist/actions/get-active-outlet/types.d.ts +7 -0
- package/dist/actions/get-active-outlet/types.js +1 -0
- package/dist/actions/get-active-refund/action.d.ts +2 -0
- package/dist/actions/get-active-refund/action.js +4 -0
- package/dist/actions/get-active-refund/mock.d.ts +2 -0
- package/dist/actions/get-active-refund/mock.js +9 -0
- package/dist/actions/get-active-refund/types.d.ts +7 -0
- package/dist/actions/get-active-refund/types.js +1 -0
- package/dist/actions/get-active-session/action.d.ts +2 -0
- package/dist/actions/get-active-session/action.js +4 -0
- package/dist/actions/get-active-session/mock.d.ts +2 -0
- package/dist/actions/get-active-session/mock.js +9 -0
- package/dist/actions/get-active-session/types.d.ts +7 -0
- package/dist/actions/get-active-session/types.js +1 -0
- package/dist/actions/get-active-station/action.d.ts +2 -0
- package/dist/actions/get-active-station/action.js +4 -0
- package/dist/actions/get-active-station/mock.d.ts +2 -0
- package/dist/actions/get-active-station/mock.js +9 -0
- package/dist/actions/get-active-station/types.d.ts +7 -0
- package/dist/actions/get-active-station/types.js +1 -0
- package/dist/actions/get-active-user/action.d.ts +2 -0
- package/dist/actions/get-active-user/action.js +4 -0
- package/dist/actions/get-active-user/mock.d.ts +2 -0
- package/dist/actions/get-active-user/mock.js +9 -0
- package/dist/actions/get-active-user/types.d.ts +7 -0
- package/dist/actions/get-active-user/types.js +1 -0
- package/dist/actions/set-active-customer/action.d.ts +2 -0
- package/dist/actions/set-active-customer/action.js +4 -0
- package/dist/actions/set-active-customer/mock.d.ts +2 -0
- package/dist/actions/set-active-customer/mock.js +16 -0
- package/dist/actions/set-active-customer/types.d.ts +10 -0
- package/dist/actions/set-active-customer/types.js +1 -0
- package/dist/actions/set-active-outlet/action.d.ts +2 -0
- package/dist/actions/set-active-outlet/action.js +4 -0
- package/dist/actions/set-active-outlet/mock.d.ts +2 -0
- package/dist/actions/set-active-outlet/mock.js +16 -0
- package/dist/actions/set-active-outlet/types.d.ts +10 -0
- package/dist/actions/set-active-outlet/types.js +1 -0
- package/dist/actions/set-active-refund/action.d.ts +2 -0
- package/dist/actions/set-active-refund/action.js +4 -0
- package/dist/actions/set-active-refund/mock.d.ts +2 -0
- package/dist/actions/set-active-refund/mock.js +12 -0
- package/dist/actions/set-active-refund/types.d.ts +10 -0
- package/dist/actions/set-active-refund/types.js +1 -0
- package/dist/actions/set-active-session/action.d.ts +2 -0
- package/dist/actions/set-active-session/action.js +4 -0
- package/dist/actions/set-active-session/mock.d.ts +2 -0
- package/dist/actions/set-active-session/mock.js +15 -0
- package/dist/actions/set-active-session/types.d.ts +10 -0
- package/dist/actions/set-active-session/types.js +1 -0
- package/dist/actions/set-active-station/action.d.ts +2 -0
- package/dist/actions/set-active-station/action.js +4 -0
- package/dist/actions/set-active-station/mock.d.ts +2 -0
- package/dist/actions/set-active-station/mock.js +16 -0
- package/dist/actions/set-active-station/types.d.ts +10 -0
- package/dist/actions/set-active-station/types.js +1 -0
- package/dist/actions/set-active-user/action.d.ts +2 -0
- package/dist/actions/set-active-user/action.js +4 -0
- package/dist/actions/set-active-user/mock.d.ts +2 -0
- package/dist/actions/set-active-user/mock.js +16 -0
- package/dist/actions/set-active-user/types.d.ts +10 -0
- package/dist/actions/set-active-user/types.js +1 -0
- package/dist/demo/database.d.ts +3 -1
- package/dist/demo/database.js +19 -1
- package/dist/index.d.ts +39 -4
- package/dist/index.js +30 -0
- package/dist/projects/render/mocks.js +26 -0
- package/dist/projects/render/provider.d.ts +2 -2
- package/dist/projects/render/types.d.ts +14 -1
- package/dist/pubsub/topics/customers/get-active-customer/types.d.ts +6 -0
- package/dist/pubsub/topics/customers/get-active-customer/types.js +1 -0
- package/dist/pubsub/topics/customers/index.js +10 -0
- package/dist/pubsub/topics/customers/set-active-customer/types.d.ts +6 -0
- package/dist/pubsub/topics/customers/set-active-customer/types.js +1 -0
- package/dist/pubsub/topics/customers/types.d.ts +6 -2
- package/dist/pubsub/topics/customers/types.js +2 -0
- package/dist/pubsub/topics/index.d.ts +4 -0
- package/dist/pubsub/topics/index.js +4 -0
- package/dist/pubsub/topics/orders/get-active-order/types.d.ts +6 -0
- package/dist/pubsub/topics/orders/get-active-order/types.js +1 -0
- package/dist/pubsub/topics/orders/index.js +10 -0
- package/dist/pubsub/topics/orders/set-active-order/types.d.ts +6 -0
- package/dist/pubsub/topics/orders/set-active-order/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/outlet/get-active-outlet/types.d.ts +6 -0
- package/dist/pubsub/topics/outlet/get-active-outlet/types.js +1 -0
- package/dist/pubsub/topics/outlet/index.d.ts +3 -0
- package/dist/pubsub/topics/outlet/index.js +18 -0
- package/dist/pubsub/topics/outlet/set-active-outlet/types.d.ts +6 -0
- package/dist/pubsub/topics/outlet/set-active-outlet/types.js +1 -0
- package/dist/pubsub/topics/outlet/types.d.ts +6 -0
- package/dist/pubsub/topics/outlet/types.js +2 -0
- package/dist/pubsub/topics/products/product-get-active/types.js +1 -0
- package/dist/pubsub/topics/products/types.d.ts +6 -2
- package/dist/pubsub/topics/products/types.js +2 -0
- package/dist/pubsub/topics/refunds/get-active-refund/types.d.ts +6 -0
- package/dist/pubsub/topics/refunds/get-active-refund/types.js +1 -0
- package/dist/pubsub/topics/refunds/index.js +10 -0
- package/dist/pubsub/topics/refunds/set-active-refund/types.d.ts +6 -0
- package/dist/pubsub/topics/refunds/set-active-refund/types.js +1 -0
- package/dist/pubsub/topics/refunds/types.d.ts +6 -2
- package/dist/pubsub/topics/refunds/types.js +2 -0
- package/dist/pubsub/topics/session/get-active-session/types.d.ts +6 -0
- package/dist/pubsub/topics/session/get-active-session/types.js +1 -0
- package/dist/pubsub/topics/session/index.d.ts +3 -0
- package/dist/pubsub/topics/session/index.js +18 -0
- package/dist/pubsub/topics/session/set-active-session/types.d.ts +6 -0
- package/dist/pubsub/topics/session/set-active-session/types.js +1 -0
- package/dist/pubsub/topics/session/types.d.ts +6 -0
- package/dist/pubsub/topics/session/types.js +2 -0
- package/dist/pubsub/topics/station/get-active-station/types.d.ts +6 -0
- package/dist/pubsub/topics/station/get-active-station/types.js +1 -0
- package/dist/pubsub/topics/station/index.d.ts +3 -0
- package/dist/pubsub/topics/station/index.js +18 -0
- package/dist/pubsub/topics/station/set-active-station/types.d.ts +6 -0
- package/dist/pubsub/topics/station/set-active-station/types.js +1 -0
- package/dist/pubsub/topics/station/types.d.ts +6 -0
- package/dist/pubsub/topics/station/types.js +2 -0
- package/dist/pubsub/topics/types.d.ts +8 -0
- package/dist/pubsub/topics/users/get-active-user/types.d.ts +6 -0
- package/dist/pubsub/topics/users/get-active-user/types.js +1 -0
- package/dist/pubsub/topics/users/index.d.ts +3 -0
- package/dist/pubsub/topics/users/index.js +18 -0
- package/dist/pubsub/topics/users/set-active-user/types.d.ts +6 -0
- package/dist/pubsub/topics/users/set-active-user/types.js +1 -0
- package/dist/pubsub/topics/users/types.d.ts +6 -0
- package/dist/pubsub/topics/users/types.js +2 -0
- package/package.json +1 -1
- /package/dist/{pubsub/topics/products/product-get-active/types..js → actions/get-active-customer/types.js} +0 -0
- /package/dist/pubsub/topics/products/product-get-active/{types..d.ts → types.d.ts} +0 -0
package/dist/demo/database.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Mock Database for Standalone/Demo Mode
|
|
3
3
|
* Stores mock data that mimics the Render environment
|
|
4
4
|
*/
|
|
5
|
-
import { CFActiveCompany, CFActiveUser, CFActiveStation, CFActiveOutlet, CFActiveOrder, CFCustomer, CFProduct, CFActiveCart, CFCategory, CFActiveProduct } from "../CommonTypes";
|
|
5
|
+
import { CFActiveCompany, CFActiveUser, CFActiveStation, CFActiveOutlet, CFActiveOrder, CFCustomer, CFProduct, CFActiveCart, CFCategory, CFActiveProduct, CFSession, CFActiveRefundDetails } from "../CommonTypes";
|
|
6
6
|
export * from "./mocks";
|
|
7
7
|
/** Replace mock catalog / context data in place (same array references mock handlers use). */
|
|
8
8
|
export interface MockDatabaseConfig {
|
|
@@ -20,6 +20,8 @@ export declare const MOCK_COMPANY: CFActiveCompany;
|
|
|
20
20
|
export declare const MOCK_OUTLET_MAIN: CFActiveOutlet;
|
|
21
21
|
export declare const MOCK_STATION_1: CFActiveStation;
|
|
22
22
|
export declare const MOCK_STATION_2: CFActiveStation;
|
|
23
|
+
export declare const MOCK_SESSION: CFSession;
|
|
24
|
+
export declare const MOCK_ACTIVE_REFUND_DETAILS: CFActiveRefundDetails;
|
|
23
25
|
export declare const MOCK_USER_MARIO: CFActiveUser;
|
|
24
26
|
export declare const MOCK_USER_LUIGI: CFActiveUser;
|
|
25
27
|
export declare const MOCK_CUSTOMER_1: CFCustomer;
|
package/dist/demo/database.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Mock Database for Standalone/Demo Mode
|
|
3
3
|
* Stores mock data that mimics the Render environment
|
|
4
4
|
*/
|
|
5
|
-
import { CFProductType, CFUserTypes, CurrencyCode
|
|
5
|
+
import { CFProductType, CFUserTypes, CurrencyCode } from "../CommonTypes";
|
|
6
6
|
export * from "./mocks";
|
|
7
7
|
// Asset Imports - Using Remote URLs to avoid build complexity with asset copying
|
|
8
8
|
const ASSETS_BASE_URL = "https://raw.githubusercontent.com/Final-Commerce/command-frame/refs/heads/main/src/demo/assets";
|
|
@@ -61,6 +61,24 @@ export const MOCK_STATION_2 = {
|
|
|
61
61
|
sequenceNumber: 2,
|
|
62
62
|
stripeTerminalId: "tm_2"
|
|
63
63
|
};
|
|
64
|
+
// --- SESSION (cash register) ---
|
|
65
|
+
export const MOCK_SESSION = {
|
|
66
|
+
id: "sess_mock_1",
|
|
67
|
+
stationId: MOCK_STATION_1._id,
|
|
68
|
+
openingAmount: 100,
|
|
69
|
+
openedBy: "user_mario",
|
|
70
|
+
currency: CurrencyCode.USD,
|
|
71
|
+
minorUnits: 2
|
|
72
|
+
};
|
|
73
|
+
// --- ACTIVE REFUND DETAILS (refund UI state) ---
|
|
74
|
+
export const MOCK_ACTIVE_REFUND_DETAILS = {
|
|
75
|
+
quantities: { line_mock_1: 1 },
|
|
76
|
+
options: {},
|
|
77
|
+
refundAmounts: {},
|
|
78
|
+
currentRefundTotal: 0,
|
|
79
|
+
amountRemaining: null,
|
|
80
|
+
isRefund: true
|
|
81
|
+
};
|
|
64
82
|
// --- USERS ---
|
|
65
83
|
export const MOCK_USER_MARIO = {
|
|
66
84
|
id: "user_mario",
|
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,19 @@ export declare const command: {
|
|
|
48
48
|
readonly switchUser: import("./actions/switch-user/types").SwitchUser;
|
|
49
49
|
readonly print: import("./actions/print/types").Print;
|
|
50
50
|
readonly setActiveOrder: import("./actions/set-active-order/types").SetActiveOrder;
|
|
51
|
+
readonly getActiveOrder: import("./actions/get-active-order/types").GetActiveOrder;
|
|
52
|
+
readonly getActiveCustomer: import("./actions/get-active-customer/types").GetActiveCustomer;
|
|
53
|
+
readonly setActiveCustomer: import("./actions/set-active-customer/types").SetActiveCustomer;
|
|
54
|
+
readonly getActiveOutlet: import("./actions/get-active-outlet/types").GetActiveOutlet;
|
|
55
|
+
readonly setActiveOutlet: import("./actions/set-active-outlet/types").SetActiveOutlet;
|
|
56
|
+
readonly getActiveStation: import("./actions/get-active-station/types").GetActiveStation;
|
|
57
|
+
readonly setActiveStation: import("./actions/set-active-station/types").SetActiveStation;
|
|
58
|
+
readonly getActiveSession: import("./actions/get-active-session/types").GetActiveSession;
|
|
59
|
+
readonly setActiveSession: import("./actions/set-active-session/types").SetActiveSession;
|
|
60
|
+
readonly getActiveUser: import("./actions/get-active-user/types").GetActiveUser;
|
|
61
|
+
readonly setActiveUser: import("./actions/set-active-user/types").SetActiveUser;
|
|
62
|
+
readonly getActiveRefund: import("./actions/get-active-refund/types").GetActiveRefund;
|
|
63
|
+
readonly setActiveRefund: import("./actions/set-active-refund/types").SetActiveRefund;
|
|
51
64
|
readonly triggerWebhook: import("./actions/trigger-webhook/types").TriggerWebhook;
|
|
52
65
|
readonly triggerZapierWebhook: import("./actions/trigger-zapier-webhook/types").TriggerZapierWebhook;
|
|
53
66
|
readonly initiateRefund: import("./actions/initiate-refund/types").InitiateRefund;
|
|
@@ -154,6 +167,19 @@ export type { PartialPayment, PartialPaymentParams, PartialPaymentResponse } fro
|
|
|
154
167
|
export type { SwitchUser, SwitchUserParams, SwitchUserResponse } from "./actions/switch-user/types";
|
|
155
168
|
export type { Print, PrintParams, PrintResponse } from "./actions/print/types";
|
|
156
169
|
export type { SetActiveOrder, SetActiveOrderParams, SetActiveOrderResponse } from "./actions/set-active-order/types";
|
|
170
|
+
export type { GetActiveOrder, GetActiveOrderResponse } from "./actions/get-active-order/types";
|
|
171
|
+
export type { GetActiveCustomer, GetActiveCustomerResponse } from "./actions/get-active-customer/types";
|
|
172
|
+
export type { SetActiveCustomer, SetActiveCustomerParams, SetActiveCustomerResponse } from "./actions/set-active-customer/types";
|
|
173
|
+
export type { GetActiveOutlet, GetActiveOutletResponse } from "./actions/get-active-outlet/types";
|
|
174
|
+
export type { SetActiveOutlet, SetActiveOutletParams, SetActiveOutletResponse } from "./actions/set-active-outlet/types";
|
|
175
|
+
export type { GetActiveStation, GetActiveStationResponse } from "./actions/get-active-station/types";
|
|
176
|
+
export type { SetActiveStation, SetActiveStationParams, SetActiveStationResponse } from "./actions/set-active-station/types";
|
|
177
|
+
export type { GetActiveSession, GetActiveSessionResponse } from "./actions/get-active-session/types";
|
|
178
|
+
export type { SetActiveSession, SetActiveSessionParams, SetActiveSessionResponse } from "./actions/set-active-session/types";
|
|
179
|
+
export type { GetActiveUser, GetActiveUserResponse } from "./actions/get-active-user/types";
|
|
180
|
+
export type { SetActiveUser, SetActiveUserParams, SetActiveUserResponse } from "./actions/set-active-user/types";
|
|
181
|
+
export type { GetActiveRefund, GetActiveRefundResponse } from "./actions/get-active-refund/types";
|
|
182
|
+
export type { SetActiveRefund, SetActiveRefundParams, SetActiveRefundResponse } from "./actions/set-active-refund/types";
|
|
157
183
|
export type { TriggerWebhook, TriggerWebhookPresetType, TriggerWebhookParams, TriggerWebhookResponse } from "./actions/trigger-webhook/types";
|
|
158
184
|
export type { TriggerZapierWebhook, TriggerZapierWebhookParams, TriggerZapierWebhookResponse } from "./actions/trigger-zapier-webhook/types";
|
|
159
185
|
export * from "./CommonTypes";
|
|
@@ -167,6 +193,7 @@ export { commandFrameClient, CommandFrameClient } from "./client";
|
|
|
167
193
|
export type { PostMessageRequest, PostMessageResponse } from "./client";
|
|
168
194
|
export { topics } from "./pubsub/topics";
|
|
169
195
|
export type { TopicDefinition, TopicEvent, TopicEventType, TopicSubscriptionCallback, TopicSubscription, HookCallback, HookOptions, HookRegistration } from "./pubsub/types";
|
|
196
|
+
export type { TopicEventPayloadMap } from "./pubsub/topics/types";
|
|
170
197
|
export { hooks } from "./hooks";
|
|
171
198
|
export type { HookFunction, HookRegisterOptions } from "./hooks";
|
|
172
199
|
export { customersTopic } from "./pubsub/topics/customers";
|
|
@@ -177,10 +204,18 @@ export { cartTopic } from "./pubsub/topics/cart";
|
|
|
177
204
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
178
205
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
179
206
|
export { printTopic } from "./pubsub/topics/print";
|
|
180
|
-
export
|
|
181
|
-
export
|
|
182
|
-
export
|
|
183
|
-
export
|
|
207
|
+
export { outletTopic } from "./pubsub/topics/outlet";
|
|
208
|
+
export { stationTopic } from "./pubsub/topics/station";
|
|
209
|
+
export { sessionTopic } from "./pubsub/topics/session";
|
|
210
|
+
export { usersTopic } from "./pubsub/topics/users";
|
|
211
|
+
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";
|
|
212
|
+
export type { OrderCreatedPayload, OrderUpdatedPayload, OrderActiveSetPayload, OrderActiveGetPayload, OrderCreatedEvent, OrderUpdatedEvent, OrderActiveSetEvent, OrderActiveGetEvent, OrdersEventType, OrdersEventPayload } from "./pubsub/topics/orders/types";
|
|
213
|
+
export type { RefundCreatedPayload, RefundUpdatedPayload, RefundActiveSetPayload, RefundActiveGetPayload, RefundCreatedEvent, RefundUpdatedEvent, RefundActiveSetEvent, RefundActiveGetEvent, RefundsEventType, RefundsEventPayload } from "./pubsub/topics/refunds/types";
|
|
214
|
+
export type { ProductCreatedPayload, ProductUpdatedPayload, ProductSetActivePayload, ProductGetActivePayload, ProductCreatedEvent, ProductUpdatedEvent, ProductSetActiveEvent, ProductGetActiveEvent, ProductsEventType, ProductsEventPayload } from "./pubsub/topics/products/types";
|
|
215
|
+
export type { OutletActiveSetPayload, OutletActiveGetPayload, OutletActiveSetEvent, OutletActiveGetEvent, OutletEventType, OutletEventPayload } from "./pubsub/topics/outlet/types";
|
|
216
|
+
export type { StationActiveSetPayload, StationActiveGetPayload, StationActiveSetEvent, StationActiveGetEvent, StationEventType, StationEventPayload } from "./pubsub/topics/station/types";
|
|
217
|
+
export type { SessionActiveSetPayload, SessionActiveGetPayload, SessionActiveSetEvent, SessionActiveGetEvent, SessionEventType, SessionEventPayload } from "./pubsub/topics/session/types";
|
|
218
|
+
export type { UserActiveSetPayload, UserActiveGetPayload, UserActiveSetEvent, UserActiveGetEvent, UsersEventType, UsersEventPayload } from "./pubsub/topics/users/types";
|
|
184
219
|
export type { CartCreatedPayload, CartCustomerAssignedPayload, ProductAddedPayload, ProductDeletedPayload, CartDiscountAddedPayload, CartDiscountRemovedPayload, CartFeeAddedPayload, CartFeeRemovedPayload, CartCreatedEvent, CartCustomerAssignedEvent, ProductAddedEvent, ProductDeletedEvent, CartDiscountAddedEvent, CartDiscountRemovedEvent, CartFeeAddedEvent, CartFeeRemovedEvent, CartEventType, CartEventPayload } from "./pubsub/topics/cart/types";
|
|
185
220
|
export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload } from "./pubsub/topics/payments/types";
|
|
186
221
|
export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,19 @@ import { partialPayment } from "./actions/partial-payment/action";
|
|
|
50
50
|
import { switchUser } from "./actions/switch-user/action";
|
|
51
51
|
import { print } from "./actions/print/action";
|
|
52
52
|
import { setActiveOrder } from "./actions/set-active-order/action";
|
|
53
|
+
import { getActiveOrder } from "./actions/get-active-order/action";
|
|
54
|
+
import { getActiveCustomer } from "./actions/get-active-customer/action";
|
|
55
|
+
import { setActiveCustomer } from "./actions/set-active-customer/action";
|
|
56
|
+
import { getActiveOutlet } from "./actions/get-active-outlet/action";
|
|
57
|
+
import { setActiveOutlet } from "./actions/set-active-outlet/action";
|
|
58
|
+
import { getActiveStation } from "./actions/get-active-station/action";
|
|
59
|
+
import { setActiveStation } from "./actions/set-active-station/action";
|
|
60
|
+
import { getActiveSession } from "./actions/get-active-session/action";
|
|
61
|
+
import { setActiveSession } from "./actions/set-active-session/action";
|
|
62
|
+
import { getActiveUser } from "./actions/get-active-user/action";
|
|
63
|
+
import { setActiveUser } from "./actions/set-active-user/action";
|
|
64
|
+
import { getActiveRefund } from "./actions/get-active-refund/action";
|
|
65
|
+
import { setActiveRefund } from "./actions/set-active-refund/action";
|
|
53
66
|
// Integration Actions
|
|
54
67
|
import { triggerWebhook } from "./actions/trigger-webhook/action";
|
|
55
68
|
import { triggerZapierWebhook } from "./actions/trigger-zapier-webhook/action";
|
|
@@ -149,6 +162,19 @@ export const command = {
|
|
|
149
162
|
switchUser,
|
|
150
163
|
print,
|
|
151
164
|
setActiveOrder,
|
|
165
|
+
getActiveOrder,
|
|
166
|
+
getActiveCustomer,
|
|
167
|
+
setActiveCustomer,
|
|
168
|
+
getActiveOutlet,
|
|
169
|
+
setActiveOutlet,
|
|
170
|
+
getActiveStation,
|
|
171
|
+
setActiveStation,
|
|
172
|
+
getActiveSession,
|
|
173
|
+
setActiveSession,
|
|
174
|
+
getActiveUser,
|
|
175
|
+
setActiveUser,
|
|
176
|
+
getActiveRefund,
|
|
177
|
+
setActiveRefund,
|
|
152
178
|
// Integration Actions
|
|
153
179
|
triggerWebhook,
|
|
154
180
|
triggerZapierWebhook,
|
|
@@ -220,5 +246,9 @@ export { cartTopic } from "./pubsub/topics/cart";
|
|
|
220
246
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
221
247
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
222
248
|
export { printTopic } from "./pubsub/topics/print";
|
|
249
|
+
export { outletTopic } from "./pubsub/topics/outlet";
|
|
250
|
+
export { stationTopic } from "./pubsub/topics/station";
|
|
251
|
+
export { sessionTopic } from "./pubsub/topics/session";
|
|
252
|
+
export { usersTopic } from "./pubsub/topics/users";
|
|
223
253
|
// Export Custom Tables Types
|
|
224
254
|
export { AttributeType } from "./common-types/attribute-type";
|
|
@@ -68,6 +68,19 @@ import { mockGetSecretVal } from "../../actions/get-secret-val/mock";
|
|
|
68
68
|
import { mockSetSecretVal } from "../../actions/set-secret-val/mock";
|
|
69
69
|
import { mockGetUsers } from "../../actions/get-users/mock";
|
|
70
70
|
import { mockGetRoles } from "../../actions/get-roles/mock";
|
|
71
|
+
import { mockGetActiveOrder } from "../../actions/get-active-order/mock";
|
|
72
|
+
import { mockGetActiveCustomer } from "../../actions/get-active-customer/mock";
|
|
73
|
+
import { mockSetActiveCustomer } from "../../actions/set-active-customer/mock";
|
|
74
|
+
import { mockGetActiveOutlet } from "../../actions/get-active-outlet/mock";
|
|
75
|
+
import { mockSetActiveOutlet } from "../../actions/set-active-outlet/mock";
|
|
76
|
+
import { mockGetActiveStation } from "../../actions/get-active-station/mock";
|
|
77
|
+
import { mockSetActiveStation } from "../../actions/set-active-station/mock";
|
|
78
|
+
import { mockGetActiveSession } from "../../actions/get-active-session/mock";
|
|
79
|
+
import { mockSetActiveSession } from "../../actions/set-active-session/mock";
|
|
80
|
+
import { mockGetActiveUser } from "../../actions/get-active-user/mock";
|
|
81
|
+
import { mockSetActiveUser } from "../../actions/set-active-user/mock";
|
|
82
|
+
import { mockGetActiveRefund } from "../../actions/get-active-refund/mock";
|
|
83
|
+
import { mockSetActiveRefund } from "../../actions/set-active-refund/mock";
|
|
71
84
|
export const RENDER_MOCKS = {
|
|
72
85
|
addCartDiscount: mockAddCartDiscount,
|
|
73
86
|
addCartFee: mockAddCartFee,
|
|
@@ -139,4 +152,17 @@ export const RENDER_MOCKS = {
|
|
|
139
152
|
setSecretVal: mockSetSecretVal,
|
|
140
153
|
getUsers: mockGetUsers,
|
|
141
154
|
getRoles: mockGetRoles,
|
|
155
|
+
getActiveOrder: mockGetActiveOrder,
|
|
156
|
+
getActiveCustomer: mockGetActiveCustomer,
|
|
157
|
+
setActiveCustomer: mockSetActiveCustomer,
|
|
158
|
+
getActiveOutlet: mockGetActiveOutlet,
|
|
159
|
+
setActiveOutlet: mockSetActiveOutlet,
|
|
160
|
+
getActiveStation: mockGetActiveStation,
|
|
161
|
+
setActiveStation: mockSetActiveStation,
|
|
162
|
+
getActiveSession: mockGetActiveSession,
|
|
163
|
+
setActiveSession: mockSetActiveSession,
|
|
164
|
+
getActiveUser: mockGetActiveUser,
|
|
165
|
+
setActiveUser: mockSetActiveUser,
|
|
166
|
+
getActiveRefund: mockGetActiveRefund,
|
|
167
|
+
setActiveRefund: mockSetActiveRefund
|
|
142
168
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandFrameProvider } from "../../provider";
|
|
2
2
|
import { RenderProviderActions } from "./types";
|
|
3
|
-
export declare class RenderCommandFrameProvider extends CommandFrameProvider<RenderProviderActions
|
|
4
|
-
constructor(actions: RenderProviderActions
|
|
3
|
+
export declare class RenderCommandFrameProvider extends CommandFrameProvider<Partial<RenderProviderActions>> {
|
|
4
|
+
constructor(actions: Partial<RenderProviderActions>, options?: {
|
|
5
5
|
origin?: string;
|
|
6
6
|
debug?: boolean;
|
|
7
7
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount } from "../../index";
|
|
1
|
+
import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, 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, SetActiveOutlet, GetActiveStation, SetActiveStation, GetActiveSession, SetActiveSession, GetActiveUser, SetActiveUser, GetActiveRefund, SetActiveRefund } from "../../index";
|
|
2
2
|
export interface RenderProviderActions {
|
|
3
3
|
exampleFunction: ExampleFunction;
|
|
4
4
|
getProducts: GetProducts;
|
|
@@ -70,4 +70,17 @@ export interface RenderProviderActions {
|
|
|
70
70
|
setSecretVal: SetSecretVal;
|
|
71
71
|
getUsers: GetUsers;
|
|
72
72
|
getRoles: GetRoles;
|
|
73
|
+
getActiveOrder: GetActiveOrder;
|
|
74
|
+
getActiveCustomer: GetActiveCustomer;
|
|
75
|
+
setActiveCustomer: SetActiveCustomer;
|
|
76
|
+
getActiveOutlet: GetActiveOutlet;
|
|
77
|
+
setActiveOutlet: SetActiveOutlet;
|
|
78
|
+
getActiveStation: GetActiveStation;
|
|
79
|
+
setActiveStation: SetActiveStation;
|
|
80
|
+
getActiveSession: GetActiveSession;
|
|
81
|
+
setActiveSession: SetActiveSession;
|
|
82
|
+
getActiveUser: GetActiveUser;
|
|
83
|
+
setActiveUser: SetActiveUser;
|
|
84
|
+
getActiveRefund: GetActiveRefund;
|
|
85
|
+
setActiveRefund: SetActiveRefund;
|
|
73
86
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CFActiveCustomer } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
export interface CustomerActiveGetPayload {
|
|
4
|
+
customer: CFActiveCustomer | null;
|
|
5
|
+
}
|
|
6
|
+
export type CustomerActiveGetEvent = TopicEvent<CustomerActiveGetPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -36,6 +36,16 @@ export const customersTopic = {
|
|
|
36
36
|
id: "customer-unassigned",
|
|
37
37
|
name: "Customer Unassigned",
|
|
38
38
|
description: "Published when a customer is unassigned from the cart"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "set-active-customer",
|
|
42
|
+
name: "Set Active Customer",
|
|
43
|
+
description: "Published when the active customer is set in POS state"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "get-active-customer",
|
|
47
|
+
name: "Get Active Customer",
|
|
48
|
+
description: "Published when the active customer is published to listeners"
|
|
39
49
|
}
|
|
40
50
|
]
|
|
41
51
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CFActiveCustomer } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
export interface CustomerActiveSetPayload {
|
|
4
|
+
customer: CFActiveCustomer;
|
|
5
|
+
}
|
|
6
|
+
export type CustomerActiveSetEvent = TopicEvent<CustomerActiveSetPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,11 +8,15 @@ export * from "./customer-note-added/types";
|
|
|
8
8
|
export * from "./customer-note-deleted/types";
|
|
9
9
|
export * from "./customer-assigned/types";
|
|
10
10
|
export * from "./customer-unassigned/types";
|
|
11
|
+
export * from "./set-active-customer/types";
|
|
12
|
+
export * from "./get-active-customer/types";
|
|
11
13
|
import type { CustomerCreatedPayload } from "./customer-created/types";
|
|
12
14
|
import type { CustomerUpdatedPayload } from "./customer-updated/types";
|
|
13
15
|
import type { CustomerNoteAddedPayload } from "./customer-note-added/types";
|
|
14
16
|
import type { CustomerNoteDeletedPayload } from "./customer-note-deleted/types";
|
|
15
17
|
import type { CustomerAssignedPayload } from "./customer-assigned/types";
|
|
16
18
|
import type { CustomerUnassignedPayload } from "./customer-unassigned/types";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
import type { CustomerActiveSetPayload } from "./set-active-customer/types";
|
|
20
|
+
import type { CustomerActiveGetPayload } from "./get-active-customer/types";
|
|
21
|
+
export type CustomersEventPayload = CustomerCreatedPayload | CustomerUpdatedPayload | CustomerNoteAddedPayload | CustomerNoteDeletedPayload | CustomerAssignedPayload | CustomerUnassignedPayload | CustomerActiveSetPayload | CustomerActiveGetPayload;
|
|
22
|
+
export type CustomersEventType = "customer-created" | "customer-updated" | "customer-note-added" | "customer-note-deleted" | "customer-assigned" | "customer-unassigned" | "set-active-customer" | "get-active-customer";
|
|
@@ -9,3 +9,5 @@ export * from "./customer-note-added/types";
|
|
|
9
9
|
export * from "./customer-note-deleted/types";
|
|
10
10
|
export * from "./customer-assigned/types";
|
|
11
11
|
export * from "./customer-unassigned/types";
|
|
12
|
+
export * from "./set-active-customer/types";
|
|
13
|
+
export * from "./get-active-customer/types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,6 +16,16 @@ export const ordersTopic = {
|
|
|
16
16
|
id: "order-updated",
|
|
17
17
|
name: "Order Updated",
|
|
18
18
|
description: "Published when an order is updated"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "set-active-order",
|
|
22
|
+
name: "Set Active Order",
|
|
23
|
+
description: "Published when the active order is set in POS state"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "get-active-order",
|
|
27
|
+
name: "Get Active Order",
|
|
28
|
+
description: "Published when the active order is retrieved for listeners"
|
|
19
29
|
}
|
|
20
30
|
]
|
|
21
31
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export * from "./order-created/types";
|
|
6
6
|
export * from "./order-updated/types";
|
|
7
|
+
export * from "./set-active-order/types";
|
|
8
|
+
export * from "./get-active-order/types";
|
|
7
9
|
import type { OrderCreatedPayload } from "./order-created/types";
|
|
8
10
|
import type { OrderUpdatedPayload } from "./order-updated/types";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
import type { OrderActiveSetPayload } from "./set-active-order/types";
|
|
12
|
+
import type { OrderActiveGetPayload } from "./get-active-order/types";
|
|
13
|
+
export type OrdersEventPayload = OrderCreatedPayload | OrderUpdatedPayload | OrderActiveSetPayload | OrderActiveGetPayload;
|
|
14
|
+
export type OrdersEventType = "order-created" | "order-updated" | "set-active-order" | "get-active-order";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const outletTopic = {
|
|
2
|
+
id: "outlet",
|
|
3
|
+
name: "Outlet",
|
|
4
|
+
description: "Topic for active outlet context in the POS",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "set-active-outlet",
|
|
8
|
+
name: "Set Active Outlet",
|
|
9
|
+
description: "Published when the active outlet is set"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "get-active-outlet",
|
|
13
|
+
name: "Get Active Outlet",
|
|
14
|
+
description: "Published when the active outlet is published to listeners"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./set-active-outlet/types";
|
|
2
|
+
export * from "./get-active-outlet/types";
|
|
3
|
+
import type { OutletActiveSetPayload } from "./set-active-outlet/types";
|
|
4
|
+
import type { OutletActiveGetPayload } from "./get-active-outlet/types";
|
|
5
|
+
export type OutletEventPayload = OutletActiveSetPayload | OutletActiveGetPayload;
|
|
6
|
+
export type OutletEventType = "set-active-outlet" | "get-active-outlet";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export * from "./product-created/types";
|
|
6
6
|
export * from "./product-updated/types";
|
|
7
|
+
export * from "./product-set-active/types";
|
|
8
|
+
export * from "./product-get-active/types";
|
|
7
9
|
import type { ProductCreatedPayload } from "./product-created/types";
|
|
8
10
|
import type { ProductUpdatedPayload } from "./product-updated/types";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
import type { ProductSetActivePayload } from "./product-set-active/types";
|
|
12
|
+
import type { ProductGetActivePayload } from "./product-get-active/types";
|
|
13
|
+
export type ProductsEventPayload = ProductCreatedPayload | ProductUpdatedPayload | ProductSetActivePayload | ProductGetActivePayload;
|
|
14
|
+
export type ProductsEventType = "product-created" | "product-updated" | "set-active-product" | "get-active-product";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CFActiveRefundDetails } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
export interface RefundActiveGetPayload {
|
|
4
|
+
refund: CFActiveRefundDetails | null;
|
|
5
|
+
}
|
|
6
|
+
export type RefundActiveGetEvent = TopicEvent<RefundActiveGetPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,6 +16,16 @@ export const refundsTopic = {
|
|
|
16
16
|
id: "refund-updated",
|
|
17
17
|
name: "Refund Updated",
|
|
18
18
|
description: "Published when a refund is updated"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "set-active-refund",
|
|
22
|
+
name: "Set Active Refund",
|
|
23
|
+
description: "Published when active refund details change in POS state"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "get-active-refund",
|
|
27
|
+
name: "Get Active Refund",
|
|
28
|
+
description: "Published when refund details are published to listeners"
|
|
19
29
|
}
|
|
20
30
|
]
|
|
21
31
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CFActiveRefundDetails } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
export interface RefundActiveSetPayload {
|
|
4
|
+
refund: CFActiveRefundDetails;
|
|
5
|
+
}
|
|
6
|
+
export type RefundActiveSetEvent = TopicEvent<RefundActiveSetPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export * from "./refund-created/types";
|
|
6
6
|
export * from "./refund-updated/types";
|
|
7
|
+
export * from "./set-active-refund/types";
|
|
8
|
+
export * from "./get-active-refund/types";
|
|
7
9
|
import type { RefundCreatedPayload } from "./refund-created/types";
|
|
8
10
|
import type { RefundUpdatedPayload } from "./refund-updated/types";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
import type { RefundActiveSetPayload } from "./set-active-refund/types";
|
|
12
|
+
import type { RefundActiveGetPayload } from "./get-active-refund/types";
|
|
13
|
+
export type RefundsEventPayload = RefundCreatedPayload | RefundUpdatedPayload | RefundActiveSetPayload | RefundActiveGetPayload;
|
|
14
|
+
export type RefundsEventType = "refund-created" | "refund-updated" | "set-active-refund" | "get-active-refund";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const sessionTopic = {
|
|
2
|
+
id: "session",
|
|
3
|
+
name: "Session",
|
|
4
|
+
description: "Topic for cash register session context",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "set-active-session",
|
|
8
|
+
name: "Set Active Session",
|
|
9
|
+
description: "Published when the active register session is set"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "get-active-session",
|
|
13
|
+
name: "Get Active Session",
|
|
14
|
+
description: "Published when the active session is published to listeners"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./set-active-session/types";
|
|
2
|
+
export * from "./get-active-session/types";
|
|
3
|
+
import type { SessionActiveSetPayload } from "./set-active-session/types";
|
|
4
|
+
import type { SessionActiveGetPayload } from "./get-active-session/types";
|
|
5
|
+
export type SessionEventPayload = SessionActiveSetPayload | SessionActiveGetPayload;
|
|
6
|
+
export type SessionEventType = "set-active-session" | "get-active-session";
|