@final-commerce/command-frame 0.1.63 → 0.1.72
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/dist/CommonTypes.d.ts +128 -12
- package/dist/actions/add-customer-note/mock.js +27 -18
- package/dist/actions/add-customer-note/types.d.ts +3 -2
- package/dist/actions/add-product/mock.js +11 -5
- package/dist/actions/edit-product/mock.js +4 -2
- package/dist/actions/extension-payment/types.d.ts +4 -0
- package/dist/actions/get-context/mock.js +12 -6
- package/dist/actions/get-products/mock.js +6 -1
- package/dist/actions/get-products/types.d.ts +2 -0
- 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/integration-payment/types.js +1 -0
- package/dist/actions/print/mock.js +3 -6
- package/dist/actions/print/types.d.ts +1 -7
- package/dist/actions/redeem-payment/types.d.ts +9 -5
- package/dist/actions/remove-customer-note/mock.js +16 -7
- package/dist/demo/database.js +9 -24
- package/dist/index.d.ts +13 -1
- package/dist/index.js +8 -1
- package/dist/projects/render/mocks.js +2 -0
- package/dist/projects/render/types.d.ts +2 -1
- package/dist/pubsub/topics/attributes/attribute-created/types.d.ts +6 -0
- package/dist/pubsub/topics/attributes/attribute-created/types.js +1 -0
- package/dist/pubsub/topics/attributes/attribute-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/attributes/attribute-updated/types.js +1 -0
- package/dist/pubsub/topics/attributes/index.d.ts +3 -0
- package/dist/pubsub/topics/attributes/index.js +18 -0
- package/dist/pubsub/topics/attributes/types.d.ts +6 -0
- package/dist/pubsub/topics/attributes/types.js +2 -0
- package/dist/pubsub/topics/categories/category-created/types.d.ts +6 -0
- package/dist/pubsub/topics/categories/category-created/types.js +1 -0
- package/dist/pubsub/topics/categories/category-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/categories/category-updated/types.js +1 -0
- package/dist/pubsub/topics/categories/index.d.ts +3 -0
- package/dist/pubsub/topics/categories/index.js +18 -0
- package/dist/pubsub/topics/categories/types.d.ts +6 -0
- package/dist/pubsub/topics/categories/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/print/print-completed/types.d.ts +1 -1
- package/dist/pubsub/topics/print/print-error/types.d.ts +1 -1
- package/dist/pubsub/topics/print/print-started/types.d.ts +1 -1
- 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/transactions/index.d.ts +3 -0
- package/dist/pubsub/topics/transactions/index.js +18 -0
- package/dist/pubsub/topics/transactions/transaction-created/types.d.ts +6 -0
- package/dist/pubsub/topics/transactions/transaction-created/types.js +1 -0
- package/dist/pubsub/topics/transactions/transaction-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/transactions/transaction-updated/types.js +1 -0
- package/dist/pubsub/topics/transactions/types.d.ts +6 -0
- package/dist/pubsub/topics/transactions/types.js +2 -0
- package/dist/pubsub/topics/types.d.ts +10 -0
- package/dist/pubsub/topics/users/index.js +10 -0
- package/dist/pubsub/topics/users/types.d.ts +6 -2
- package/dist/pubsub/topics/users/types.js +2 -0
- package/dist/pubsub/topics/users/user-created/types.d.ts +6 -0
- package/dist/pubsub/topics/users/user-created/types.js +1 -0
- package/dist/pubsub/topics/users/user-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/users/user-updated/types.js +1 -0
- package/dist/pubsub/topics/variants/index.d.ts +3 -0
- package/dist/pubsub/topics/variants/index.js +18 -0
- package/dist/pubsub/topics/variants/types.d.ts +6 -0
- package/dist/pubsub/topics/variants/types.js +2 -0
- package/dist/pubsub/topics/variants/variant-created/types.d.ts +6 -0
- package/dist/pubsub/topics/variants/variant-created/types.js +1 -0
- package/dist/pubsub/topics/variants/variant-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/variants/variant-updated/types.js +1 -0
- package/package.json +4 -4
package/dist/demo/database.js
CHANGED
|
@@ -202,7 +202,7 @@ export const MOCK_CATEGORY_SPICY = {
|
|
|
202
202
|
parentId: null
|
|
203
203
|
};
|
|
204
204
|
// --- PRODUCTS ---
|
|
205
|
-
const createInventory = (stock) => [{ outletId: MOCK_OUTLET_MAIN.id, stock }];
|
|
205
|
+
const createInventory = (stock) => [{ warehouse: "main", outletId: MOCK_OUTLET_MAIN.id, stock }];
|
|
206
206
|
// Helper for Simple Product
|
|
207
207
|
const createSimpleProduct = (id, name, price, image, categories, description) => {
|
|
208
208
|
const sku = `SKU-${id.toUpperCase()}`;
|
|
@@ -366,10 +366,7 @@ export const MOCK_ORDER_1 = {
|
|
|
366
366
|
metadata: [],
|
|
367
367
|
billing: MOCK_CUSTOMER_1.billing || null,
|
|
368
368
|
shipping: null,
|
|
369
|
-
lineItems: [
|
|
370
|
-
createLineItem(MOCK_PRODUCT_GARLIC, 0, 1),
|
|
371
|
-
createLineItem(MOCK_PRODUCT_BASIL_ALMOND, 0, 1)
|
|
372
|
-
],
|
|
369
|
+
lineItems: [createLineItem(MOCK_PRODUCT_GARLIC, 0, 1), createLineItem(MOCK_PRODUCT_BASIL_ALMOND, 0, 1)],
|
|
373
370
|
customSales: [],
|
|
374
371
|
balance: 0,
|
|
375
372
|
user: MOCK_USER_LUIGI,
|
|
@@ -416,9 +413,7 @@ export const MOCK_ORDER_2 = {
|
|
|
416
413
|
metadata: [],
|
|
417
414
|
billing: null,
|
|
418
415
|
shipping: null,
|
|
419
|
-
lineItems: [
|
|
420
|
-
createLineItem(MOCK_PRODUCT_BEER, 0, 2)
|
|
421
|
-
],
|
|
416
|
+
lineItems: [createLineItem(MOCK_PRODUCT_BEER, 0, 2)],
|
|
422
417
|
customSales: [],
|
|
423
418
|
balance: 0,
|
|
424
419
|
user: MOCK_USER_MARIO,
|
|
@@ -430,20 +425,8 @@ export const MOCK_ORDER_2 = {
|
|
|
430
425
|
export const MOCK_USERS = [MOCK_USER_MARIO, MOCK_USER_LUIGI];
|
|
431
426
|
export const MOCK_STATIONS = [MOCK_STATION_1, MOCK_STATION_2];
|
|
432
427
|
export const MOCK_OUTLETS = [MOCK_OUTLET_MAIN];
|
|
433
|
-
export const MOCK_CUSTOMERS = [
|
|
434
|
-
|
|
435
|
-
MOCK_CUSTOMER_2,
|
|
436
|
-
MOCK_CUSTOMER_3,
|
|
437
|
-
MOCK_CUSTOMER_4,
|
|
438
|
-
MOCK_CUSTOMER_5
|
|
439
|
-
];
|
|
440
|
-
export const MOCK_CATEGORIES = [
|
|
441
|
-
MOCK_CATEGORY_PASTES,
|
|
442
|
-
MOCK_CATEGORY_SPECIALTY,
|
|
443
|
-
MOCK_CATEGORY_BASIC,
|
|
444
|
-
MOCK_CATEGORY_VEGAN,
|
|
445
|
-
MOCK_CATEGORY_SPICY
|
|
446
|
-
];
|
|
428
|
+
export const MOCK_CUSTOMERS = [MOCK_CUSTOMER_1, MOCK_CUSTOMER_2, MOCK_CUSTOMER_3, MOCK_CUSTOMER_4, MOCK_CUSTOMER_5];
|
|
429
|
+
export const MOCK_CATEGORIES = [MOCK_CATEGORY_PASTES, MOCK_CATEGORY_SPECIALTY, MOCK_CATEGORY_BASIC, MOCK_CATEGORY_VEGAN, MOCK_CATEGORY_SPICY];
|
|
447
430
|
export const MOCK_PRODUCTS = [
|
|
448
431
|
MOCK_PRODUCT_BASIL_ALMOND,
|
|
449
432
|
MOCK_PRODUCT_BEER,
|
|
@@ -494,7 +477,8 @@ export const resetMockCart = () => {
|
|
|
494
477
|
};
|
|
495
478
|
};
|
|
496
479
|
function resolveMockOrderCurrency() {
|
|
497
|
-
const
|
|
480
|
+
const settings = MOCK_COMPANY.settings;
|
|
481
|
+
const raw = settings?.currency;
|
|
498
482
|
if (typeof raw === "string" && Object.values(CurrencyCode).includes(raw)) {
|
|
499
483
|
return raw;
|
|
500
484
|
}
|
|
@@ -554,6 +538,7 @@ export const safeSerialize = (data) => {
|
|
|
554
538
|
return JSON.parse(JSON.stringify(data));
|
|
555
539
|
};
|
|
556
540
|
const mockTopicSubscribers = {};
|
|
541
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
557
542
|
export const mockPublishEvent = (topic, eventType, data) => {
|
|
558
543
|
const subscribers = mockTopicSubscribers[topic] || [];
|
|
559
544
|
const event = {
|
|
@@ -660,6 +645,6 @@ export const createOrderFromCart = (paymentType, amount, processor = "cash") =>
|
|
|
660
645
|
MOCK_ORDERS.push(newOrder);
|
|
661
646
|
resetMockCart();
|
|
662
647
|
// Publish cart-created event after cart is reset (simulates new empty cart)
|
|
663
|
-
mockPublishEvent(
|
|
648
|
+
mockPublishEvent("cart", "cart-created", {});
|
|
664
649
|
return newOrder;
|
|
665
650
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare const command: {
|
|
|
38
38
|
readonly vendaraPayment: import("./actions/vendara-payment/types").VendaraPayment;
|
|
39
39
|
readonly extensionPayment: import("./actions/extension-payment/types").ExtensionPayment;
|
|
40
40
|
readonly redeemPayment: import("./actions/redeem-payment/types").RedeemPayment;
|
|
41
|
+
readonly integrationPayment: import("./actions/integration-payment/types").IntegrationPayment;
|
|
41
42
|
readonly addCustomerNote: import("./actions/add-customer-note/types").AddCustomerNote;
|
|
42
43
|
readonly removeCustomerNote: import("./actions/remove-customer-note/types").RemoveCustomerNote;
|
|
43
44
|
readonly removeCustomerFromCart: import("./actions/remove-customer-from-cart/types").RemoveCustomerFromCart;
|
|
@@ -157,6 +158,7 @@ export type { TerminalPayment, TerminalPaymentParams, TerminalPaymentResponse }
|
|
|
157
158
|
export type { VendaraPayment, VendaraPaymentParams, VendaraPaymentResponse } from "./actions/vendara-payment/types";
|
|
158
159
|
export type { ExtensionPayment, ExtensionPaymentParams, ExtensionPaymentResponse } from "./actions/extension-payment/types";
|
|
159
160
|
export type { RedeemPayment, RedeemPaymentParams, RedeemPaymentResponse } from "./actions/redeem-payment/types";
|
|
161
|
+
export type { IntegrationPayment, IntegrationPaymentParams, IntegrationPaymentResponse, IntegrationEmvData } from "./actions/integration-payment/types";
|
|
160
162
|
export { EXTENSION_REFUND_REQUEST_ACTION } from "./actions/extension-refund/constants";
|
|
161
163
|
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
162
164
|
export type { ExtensionRefundParams, ExtensionRefundResponse } from "./actions/extension-refund/types";
|
|
@@ -220,12 +222,17 @@ export { refundsTopic } from "./pubsub/topics/refunds";
|
|
|
220
222
|
export { productsTopic } from "./pubsub/topics/products";
|
|
221
223
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
222
224
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
225
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
223
226
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
224
227
|
export { printTopic } from "./pubsub/topics/print";
|
|
225
228
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
226
229
|
export { stationTopic } from "./pubsub/topics/station";
|
|
227
230
|
export { sessionTopic } from "./pubsub/topics/session";
|
|
228
231
|
export { usersTopic } from "./pubsub/topics/users";
|
|
232
|
+
export { variantsTopic } from "./pubsub/topics/variants";
|
|
233
|
+
export { transactionsTopic } from "./pubsub/topics/transactions";
|
|
234
|
+
export { categoriesTopic } from "./pubsub/topics/categories";
|
|
235
|
+
export { attributesTopic } from "./pubsub/topics/attributes";
|
|
229
236
|
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";
|
|
230
237
|
export type { OrderCreatedPayload, OrderUpdatedPayload, OrderActiveSetPayload, OrderActiveGetPayload, OrderCreatedEvent, OrderUpdatedEvent, OrderActiveSetEvent, OrderActiveGetEvent, OrdersEventType, OrdersEventPayload } from "./pubsub/topics/orders/types";
|
|
231
238
|
export type { RefundCreatedPayload, RefundUpdatedPayload, RefundActiveSetPayload, RefundActiveGetPayload, RefundCreatedEvent, RefundUpdatedEvent, RefundActiveSetEvent, RefundActiveGetEvent, RefundsEventType, RefundsEventPayload } from "./pubsub/topics/refunds/types";
|
|
@@ -233,9 +240,14 @@ export type { ProductCreatedPayload, ProductUpdatedPayload, ProductSetActivePayl
|
|
|
233
240
|
export type { OutletActiveSetPayload, OutletActiveGetPayload, OutletActiveSetEvent, OutletActiveGetEvent, OutletEventType, OutletEventPayload } from "./pubsub/topics/outlet/types";
|
|
234
241
|
export type { StationActiveSetPayload, StationActiveGetPayload, StationActiveSetEvent, StationActiveGetEvent, StationEventType, StationEventPayload } from "./pubsub/topics/station/types";
|
|
235
242
|
export type { SessionActiveSetPayload, SessionActiveGetPayload, SessionActiveSetEvent, SessionActiveGetEvent, SessionEventType, SessionEventPayload } from "./pubsub/topics/session/types";
|
|
236
|
-
export type { UserActiveSetPayload, UserActiveGetPayload, UserActiveSetEvent, UserActiveGetEvent, UsersEventType, UsersEventPayload } from "./pubsub/topics/users/types";
|
|
243
|
+
export type { UserActiveSetPayload, UserActiveGetPayload, UserActiveSetEvent, UserActiveGetEvent, UserCreatedPayload, UserCreatedEvent, UserUpdatedPayload, UserUpdatedEvent, UsersEventType, UsersEventPayload } from "./pubsub/topics/users/types";
|
|
244
|
+
export type { VariantCreatedPayload, VariantCreatedEvent, VariantUpdatedPayload, VariantUpdatedEvent, VariantsEventType, VariantsEventPayload } from "./pubsub/topics/variants/types";
|
|
245
|
+
export type { TransactionCreatedPayload, TransactionCreatedEvent, TransactionUpdatedPayload, TransactionUpdatedEvent, TransactionsEventType, TransactionsEventPayload } from "./pubsub/topics/transactions/types";
|
|
246
|
+
export type { CategoryCreatedPayload, CategoryCreatedEvent, CategoryUpdatedPayload, CategoryUpdatedEvent, CategoriesEventType, CategoriesEventPayload } from "./pubsub/topics/categories/types";
|
|
247
|
+
export type { AttributeCreatedPayload, AttributeCreatedEvent, AttributeUpdatedPayload, AttributeUpdatedEvent, AttributesEventType, AttributesEventPayload } from "./pubsub/topics/attributes/types";
|
|
237
248
|
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";
|
|
238
249
|
export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload } from "./pubsub/topics/payments/types";
|
|
250
|
+
export type { SplitPaymentUpdatedPayload, SplitPaymentUpdatedEvent, SplitPaymentsEventType, SplitPaymentsEventPayload } from "./pubsub/topics/split-payments/types";
|
|
239
251
|
export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
|
|
240
252
|
export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload } from "./pubsub/topics/print/types";
|
|
241
253
|
export { AttributeType } from "./common-types/attribute-type";
|
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";
|
|
@@ -160,6 +161,7 @@ export const command = {
|
|
|
160
161
|
vendaraPayment,
|
|
161
162
|
extensionPayment,
|
|
162
163
|
redeemPayment,
|
|
164
|
+
integrationPayment,
|
|
163
165
|
// Customer Actions
|
|
164
166
|
addCustomerNote,
|
|
165
167
|
removeCustomerNote,
|
|
@@ -237,7 +239,7 @@ export const command = {
|
|
|
237
239
|
getMedia,
|
|
238
240
|
uploadMedia,
|
|
239
241
|
getTaxTables,
|
|
240
|
-
getBranding
|
|
242
|
+
getBranding
|
|
241
243
|
};
|
|
242
244
|
export { EXTENSION_REFUND_REQUEST_ACTION } from "./actions/extension-refund/constants";
|
|
243
245
|
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
@@ -264,11 +266,16 @@ export { refundsTopic } from "./pubsub/topics/refunds";
|
|
|
264
266
|
export { productsTopic } from "./pubsub/topics/products";
|
|
265
267
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
266
268
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
269
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
267
270
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
268
271
|
export { printTopic } from "./pubsub/topics/print";
|
|
269
272
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
270
273
|
export { stationTopic } from "./pubsub/topics/station";
|
|
271
274
|
export { sessionTopic } from "./pubsub/topics/session";
|
|
272
275
|
export { usersTopic } from "./pubsub/topics/users";
|
|
276
|
+
export { variantsTopic } from "./pubsub/topics/variants";
|
|
277
|
+
export { transactionsTopic } from "./pubsub/topics/transactions";
|
|
278
|
+
export { categoriesTopic } from "./pubsub/topics/categories";
|
|
279
|
+
export { attributesTopic } from "./pubsub/topics/attributes";
|
|
273
280
|
// Export Custom Tables Types
|
|
274
281
|
export { AttributeType } from "./common-types/attribute-type";
|
|
@@ -56,6 +56,7 @@ import { mockTriggerZapierWebhook } from "../../actions/trigger-zapier-webhook/m
|
|
|
56
56
|
import { mockVendaraPayment } from "../../actions/vendara-payment/mock";
|
|
57
57
|
import { mockExtensionPayment } from "../../actions/extension-payment/mock";
|
|
58
58
|
import { mockRedeemPayment } from "../../actions/redeem-payment/mock";
|
|
59
|
+
import { mockIntegrationPayment } from "../../actions/integration-payment/mock";
|
|
59
60
|
import { mockAddNonRevenueItem } from "../../actions/add-non-revenue-item/mock";
|
|
60
61
|
import { mockGetFinalContext } from "../../actions/get-final-context/mock";
|
|
61
62
|
import { mockPrint } from "../../actions/print/mock";
|
|
@@ -143,6 +144,7 @@ export const RENDER_MOCKS = {
|
|
|
143
144
|
vendaraPayment: mockVendaraPayment,
|
|
144
145
|
extensionPayment: mockExtensionPayment,
|
|
145
146
|
redeemPayment: mockRedeemPayment,
|
|
147
|
+
integrationPayment: mockIntegrationPayment,
|
|
146
148
|
addNonRevenueItem: mockAddNonRevenueItem,
|
|
147
149
|
getFinalContext: mockGetFinalContext,
|
|
148
150
|
print: mockPrint,
|
|
@@ -1,4 +1,4 @@
|
|
|
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, 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, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem } from "../../index";
|
|
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, 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, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, IntegrationPayment } from "../../index";
|
|
2
2
|
export interface RenderProviderActions {
|
|
3
3
|
exampleFunction: ExampleFunction;
|
|
4
4
|
getProducts: GetProducts;
|
|
@@ -38,6 +38,7 @@ export interface RenderProviderActions {
|
|
|
38
38
|
vendaraPayment: VendaraPayment;
|
|
39
39
|
extensionPayment: ExtensionPayment;
|
|
40
40
|
redeemPayment: RedeemPayment;
|
|
41
|
+
integrationPayment: IntegrationPayment;
|
|
41
42
|
addNonRevenueItem: AddNonRevenueItem;
|
|
42
43
|
addCustomerNote: AddCustomerNote;
|
|
43
44
|
removeCustomerNote: RemoveCustomerNote;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const attributesTopic = {
|
|
2
|
+
id: "attributes",
|
|
3
|
+
name: "Attributes",
|
|
4
|
+
description: "Topic for product attribute definition changes synced from the database",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "attribute-created",
|
|
8
|
+
name: "Attribute Created",
|
|
9
|
+
description: "Published when a new attribute definition is synced/created"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "attribute-updated",
|
|
13
|
+
name: "Attribute Updated",
|
|
14
|
+
description: "Published when an attribute definition is synced/updated"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./attribute-created/types";
|
|
2
|
+
export * from "./attribute-updated/types";
|
|
3
|
+
import type { AttributeCreatedPayload } from "./attribute-created/types";
|
|
4
|
+
import type { AttributeUpdatedPayload } from "./attribute-updated/types";
|
|
5
|
+
export type AttributesEventPayload = AttributeCreatedPayload | AttributeUpdatedPayload;
|
|
6
|
+
export type AttributesEventType = "attribute-created" | "attribute-updated";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const categoriesTopic = {
|
|
2
|
+
id: "categories",
|
|
3
|
+
name: "Categories",
|
|
4
|
+
description: "Topic for product category changes synced from the database",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "category-created",
|
|
8
|
+
name: "Category Created",
|
|
9
|
+
description: "Published when a new category is synced/created"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "category-updated",
|
|
13
|
+
name: "Category Updated",
|
|
14
|
+
description: "Published when a category is synced/updated"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./category-created/types";
|
|
2
|
+
export * from "./category-updated/types";
|
|
3
|
+
import type { CategoryCreatedPayload } from "./category-created/types";
|
|
4
|
+
import type { CategoryUpdatedPayload } from "./category-updated/types";
|
|
5
|
+
export type CategoriesEventPayload = CategoryCreatedPayload | CategoryUpdatedPayload;
|
|
6
|
+
export type CategoriesEventType = "category-created" | "category-updated";
|
|
@@ -3,7 +3,7 @@ import type { TopicEvent } from "../../../types";
|
|
|
3
3
|
* Payload for print-completed event
|
|
4
4
|
*/
|
|
5
5
|
export interface PrintCompletedPayload {
|
|
6
|
-
type: "image" | "html" | "
|
|
6
|
+
type: "image" | "html" | "receipt";
|
|
7
7
|
orderId?: string;
|
|
8
8
|
globalBlockId?: string;
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import type { TopicEvent } from "../../../types";
|
|
|
3
3
|
* Payload for print-error event
|
|
4
4
|
*/
|
|
5
5
|
export interface PrintErrorPayload {
|
|
6
|
-
type: "image" | "html" | "
|
|
6
|
+
type: "image" | "html" | "receipt";
|
|
7
7
|
error: string;
|
|
8
8
|
orderId?: string;
|
|
9
9
|
globalBlockId?: string;
|
|
@@ -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";
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export const splitPaymentsTopic = {
|
|
11
|
+
id: "split-payments",
|
|
12
|
+
name: "Split Payments",
|
|
13
|
+
description: "Topic for in-progress split-payment session updates",
|
|
14
|
+
eventTypes: [
|
|
15
|
+
{
|
|
16
|
+
id: "split-payment-updated",
|
|
17
|
+
name: "Split Payment Updated",
|
|
18
|
+
description: "Published whenever the host's split-payment slice mutates (partial added, reset, etc.); payload carries the full current slice or null."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
export * from "./types";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CFSplitPayment } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Payload for split-payment-updated event.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the host's full split-payment slice. When no split-payment session is
|
|
7
|
+
* active (initial state or after `resetSplitPayment`) the host publishes
|
|
8
|
+
* `{ splitPayment: null }` so subscribers can clear their mirror.
|
|
9
|
+
*/
|
|
10
|
+
export interface SplitPaymentUpdatedPayload {
|
|
11
|
+
splitPayment: CFSplitPayment | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Typed event for split-payment-updated.
|
|
15
|
+
*/
|
|
16
|
+
export type SplitPaymentUpdatedEvent = TopicEvent<SplitPaymentUpdatedPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Payments Topic Types
|
|
3
|
+
* Aggregated types for all split-payment-related events.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./split-payment-updated/types";
|
|
6
|
+
import type { SplitPaymentUpdatedPayload } from "./split-payment-updated/types";
|
|
7
|
+
/** Union type for all split-payments event payloads. */
|
|
8
|
+
export type SplitPaymentsEventPayload = SplitPaymentUpdatedPayload;
|
|
9
|
+
/** Literal types for split-payments event IDs. */
|
|
10
|
+
export type SplitPaymentsEventType = "split-payment-updated";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const transactionsTopic = {
|
|
2
|
+
id: "transactions",
|
|
3
|
+
name: "Transactions",
|
|
4
|
+
description: "Topic for payment transaction events",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "transaction-created",
|
|
8
|
+
name: "Transaction Created",
|
|
9
|
+
description: "Published when a new transaction is created"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "transaction-updated",
|
|
13
|
+
name: "Transaction Updated",
|
|
14
|
+
description: "Published when a transaction is updated"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CFTransaction } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
export interface TransactionCreatedPayload {
|
|
4
|
+
transaction: CFTransaction;
|
|
5
|
+
}
|
|
6
|
+
export type TransactionCreatedEvent = TopicEvent<TransactionCreatedPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CFTransaction } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
export interface TransactionUpdatedPayload {
|
|
4
|
+
transaction: CFTransaction;
|
|
5
|
+
}
|
|
6
|
+
export type TransactionUpdatedEvent = TopicEvent<TransactionUpdatedPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./transaction-created/types";
|
|
2
|
+
export * from "./transaction-updated/types";
|
|
3
|
+
import type { TransactionCreatedPayload } from "./transaction-created/types";
|
|
4
|
+
import type { TransactionUpdatedPayload } from "./transaction-updated/types";
|
|
5
|
+
export type TransactionsEventPayload = TransactionCreatedPayload | TransactionUpdatedPayload;
|
|
6
|
+
export type TransactionsEventType = "transaction-created" | "transaction-updated";
|
|
@@ -4,12 +4,17 @@ import { RefundsEventType, RefundsEventPayload } from "./refunds/types";
|
|
|
4
4
|
import { ProductsEventType, ProductsEventPayload } from "./products/types";
|
|
5
5
|
import { CartEventType, CartEventPayload } from "./cart/types";
|
|
6
6
|
import { PaymentsEventType, PaymentsEventPayload } from "./payments/types";
|
|
7
|
+
import { SplitPaymentsEventType, SplitPaymentsEventPayload } from "./split-payments/types";
|
|
7
8
|
import { CustomTablesEventPayload, CustomTablesEventType } from "./custom-tables/types";
|
|
8
9
|
import { PrintEventType, PrintEventPayload } from "./print/types";
|
|
9
10
|
import { OutletEventType, OutletEventPayload } from "./outlet/types";
|
|
10
11
|
import { StationEventType, StationEventPayload } from "./station/types";
|
|
11
12
|
import { SessionEventType, SessionEventPayload } from "./session/types";
|
|
12
13
|
import { UsersEventType, UsersEventPayload } from "./users/types";
|
|
14
|
+
import { VariantsEventType, VariantsEventPayload } from "./variants/types";
|
|
15
|
+
import { TransactionsEventType, TransactionsEventPayload } from "./transactions/types";
|
|
16
|
+
import { CategoriesEventType, CategoriesEventPayload } from "./categories/types";
|
|
17
|
+
import { AttributesEventType, AttributesEventPayload } from "./attributes/types";
|
|
13
18
|
export interface TopicEventPayloadMap {
|
|
14
19
|
customers: Record<CustomersEventType, CustomersEventPayload>;
|
|
15
20
|
orders: Record<OrdersEventType, OrdersEventPayload>;
|
|
@@ -17,10 +22,15 @@ export interface TopicEventPayloadMap {
|
|
|
17
22
|
products: Record<ProductsEventType, ProductsEventPayload>;
|
|
18
23
|
cart: Record<CartEventType, CartEventPayload>;
|
|
19
24
|
payments: Record<PaymentsEventType, PaymentsEventPayload>;
|
|
25
|
+
"split-payments": Record<SplitPaymentsEventType, SplitPaymentsEventPayload>;
|
|
20
26
|
customTables: Record<CustomTablesEventType, CustomTablesEventPayload>;
|
|
21
27
|
print: Record<PrintEventType, PrintEventPayload>;
|
|
22
28
|
outlet: Record<OutletEventType, OutletEventPayload>;
|
|
23
29
|
station: Record<StationEventType, StationEventPayload>;
|
|
24
30
|
session: Record<SessionEventType, SessionEventPayload>;
|
|
25
31
|
users: Record<UsersEventType, UsersEventPayload>;
|
|
32
|
+
variants: Record<VariantsEventType, VariantsEventPayload>;
|
|
33
|
+
transactions: Record<TransactionsEventType, TransactionsEventPayload>;
|
|
34
|
+
categories: Record<CategoriesEventType, CategoriesEventPayload>;
|
|
35
|
+
attributes: Record<AttributesEventType, AttributesEventPayload>;
|
|
26
36
|
}
|
|
@@ -12,6 +12,16 @@ export const usersTopic = {
|
|
|
12
12
|
id: "get-active-user",
|
|
13
13
|
name: "Get Active User",
|
|
14
14
|
description: "Published when the active user is published to listeners"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "user-created",
|
|
18
|
+
name: "User Created",
|
|
19
|
+
description: "Published when a new user record is synced/created in the database"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "user-updated",
|
|
23
|
+
name: "User Updated",
|
|
24
|
+
description: "Published when any user record is synced/updated in the database"
|
|
15
25
|
}
|
|
16
26
|
]
|
|
17
27
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from "./set-active-user/types";
|
|
2
2
|
export * from "./get-active-user/types";
|
|
3
|
+
export * from "./user-created/types";
|
|
4
|
+
export * from "./user-updated/types";
|
|
3
5
|
import type { UserActiveSetPayload } from "./set-active-user/types";
|
|
4
6
|
import type { UserActiveGetPayload } from "./get-active-user/types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
import type { UserCreatedPayload } from "./user-created/types";
|
|
8
|
+
import type { UserUpdatedPayload } from "./user-updated/types";
|
|
9
|
+
export type UsersEventPayload = UserActiveSetPayload | UserActiveGetPayload | UserCreatedPayload | UserUpdatedPayload;
|
|
10
|
+
export type UsersEventType = "set-active-user" | "get-active-user" | "user-created" | "user-updated";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|