@final-commerce/command-frame 0.1.60 → 0.1.61

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.
Files changed (53) hide show
  1. package/dist/actions/remove-cart-fee/action.d.ts +2 -0
  2. package/dist/actions/remove-cart-fee/action.js +4 -0
  3. package/dist/actions/remove-cart-fee/types.d.ts +9 -0
  4. package/dist/actions/remove-custom-sale/action.d.ts +2 -0
  5. package/dist/actions/remove-custom-sale/action.js +4 -0
  6. package/dist/actions/remove-custom-sale/types.d.ts +10 -0
  7. package/dist/actions/remove-custom-sale/types.js +1 -0
  8. package/dist/actions/remove-non-revenue-item/action.d.ts +2 -0
  9. package/dist/actions/remove-non-revenue-item/action.js +4 -0
  10. package/dist/actions/remove-non-revenue-item/types.d.ts +10 -0
  11. package/dist/actions/remove-non-revenue-item/types.js +1 -0
  12. package/dist/actions/remove-order-note/action.d.ts +2 -0
  13. package/dist/actions/remove-order-note/action.js +4 -0
  14. package/dist/actions/remove-order-note/types.d.ts +5 -0
  15. package/dist/actions/remove-order-note/types.js +1 -0
  16. package/dist/actions/remove-product-discount/action.d.ts +2 -0
  17. package/dist/actions/remove-product-discount/action.js +4 -0
  18. package/dist/actions/remove-product-discount/types.d.ts +10 -0
  19. package/dist/actions/remove-product-discount/types.js +1 -0
  20. package/dist/actions/remove-product-fee/action.d.ts +2 -0
  21. package/dist/actions/remove-product-fee/action.js +4 -0
  22. package/dist/actions/remove-product-fee/types.d.ts +10 -0
  23. package/dist/actions/remove-product-fee/types.js +1 -0
  24. package/dist/actions/remove-product-note/action.d.ts +2 -0
  25. package/dist/actions/remove-product-note/action.js +4 -0
  26. package/dist/actions/remove-product-note/types.d.ts +10 -0
  27. package/dist/actions/remove-product-note/types.js +1 -0
  28. package/dist/index.d.ts +15 -3
  29. package/dist/index.js +16 -2
  30. package/dist/projects/render/mocks.js +8 -3
  31. package/dist/projects/render/types.d.ts +8 -2
  32. package/dist/pubsub/topics/cart/index.js +30 -0
  33. package/dist/pubsub/topics/cart/product-discount-added/types.d.ts +18 -0
  34. package/dist/pubsub/topics/cart/product-discount-added/types.js +1 -0
  35. package/dist/pubsub/topics/cart/product-discount-removed/types.d.ts +13 -0
  36. package/dist/pubsub/topics/cart/product-discount-removed/types.js +1 -0
  37. package/dist/pubsub/topics/cart/product-fee-added/types.d.ts +19 -0
  38. package/dist/pubsub/topics/cart/product-fee-added/types.js +1 -0
  39. package/dist/pubsub/topics/cart/product-fee-removed/types.d.ts +13 -0
  40. package/dist/pubsub/topics/cart/product-fee-removed/types.js +1 -0
  41. package/dist/pubsub/topics/cart/product-note-added/types.d.ts +14 -0
  42. package/dist/pubsub/topics/cart/product-note-added/types.js +1 -0
  43. package/dist/pubsub/topics/cart/product-note-removed/types.d.ts +13 -0
  44. package/dist/pubsub/topics/cart/product-note-removed/types.js +1 -0
  45. package/dist/pubsub/topics/cart/types.d.ts +14 -2
  46. package/dist/pubsub/topics/cart/types.js +6 -0
  47. package/package.json +1 -1
  48. package/dist/actions/get-active-refund/action.d.ts +0 -2
  49. package/dist/actions/get-active-refund/action.js +0 -4
  50. package/dist/actions/get-active-refund/mock.d.ts +0 -2
  51. package/dist/actions/get-active-refund/mock.js +0 -9
  52. package/dist/actions/get-active-refund/types.d.ts +0 -7
  53. /package/dist/actions/{get-active-refund → remove-cart-fee}/types.js +0 -0
@@ -0,0 +1,2 @@
1
+ import type { RemoveCartFee } from "./types";
2
+ export declare const removeCartFee: RemoveCartFee;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeCartFee = async (params) => {
3
+ return await commandFrameClient.call("removeCartFee", params);
4
+ };
@@ -0,0 +1,9 @@
1
+ export interface RemoveCartFeeParams {
2
+ /** Index of fee to remove from cart.customFee array */
3
+ index: number;
4
+ }
5
+ export interface RemoveCartFeeResponse {
6
+ success: boolean;
7
+ timestamp: string;
8
+ }
9
+ export type RemoveCartFee = (params: RemoveCartFeeParams) => Promise<RemoveCartFeeResponse>;
@@ -0,0 +1,2 @@
1
+ import type { RemoveCustomSale } from "./types";
2
+ export declare const removeCustomSale: RemoveCustomSale;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeCustomSale = async (params) => {
3
+ return await commandFrameClient.call("removeCustomSale", params);
4
+ };
@@ -0,0 +1,10 @@
1
+ export interface RemoveCustomSaleParams {
2
+ /** The id of the custom sale to remove */
3
+ id: string;
4
+ }
5
+ export interface RemoveCustomSaleResponse {
6
+ success: boolean;
7
+ id: string;
8
+ timestamp: string;
9
+ }
10
+ export type RemoveCustomSale = (params: RemoveCustomSaleParams) => Promise<RemoveCustomSaleResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RemoveNonRevenueItem } from "./types";
2
+ export declare const removeNonRevenueItem: RemoveNonRevenueItem;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeNonRevenueItem = async (params) => {
3
+ return await commandFrameClient.call("removeNonRevenueItem", params);
4
+ };
@@ -0,0 +1,10 @@
1
+ export interface RemoveNonRevenueItemParams {
2
+ /** The externalId of the non-revenue item to remove */
3
+ externalId: string;
4
+ }
5
+ export interface RemoveNonRevenueItemResponse {
6
+ success: boolean;
7
+ externalId: string;
8
+ timestamp: string;
9
+ }
10
+ export type RemoveNonRevenueItem = (params: RemoveNonRevenueItemParams) => Promise<RemoveNonRevenueItemResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RemoveOrderNote } from "./types";
2
+ export declare const removeOrderNote: RemoveOrderNote;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeOrderNote = async () => {
3
+ return await commandFrameClient.call("removeOrderNote");
4
+ };
@@ -0,0 +1,5 @@
1
+ export interface RemoveOrderNoteResponse {
2
+ success: boolean;
3
+ timestamp: string;
4
+ }
5
+ export type RemoveOrderNote = () => Promise<RemoveOrderNoteResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RemoveProductDiscount } from "./types";
2
+ export declare const removeProductDiscount: RemoveProductDiscount;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeProductDiscount = async (params) => {
3
+ return await commandFrameClient.call("removeProductDiscount", params);
4
+ };
@@ -0,0 +1,10 @@
1
+ export interface RemoveProductDiscountParams {
2
+ /** If provided, removes discount from specific cart item. Otherwise uses active product. */
3
+ internalId?: string;
4
+ }
5
+ export interface RemoveProductDiscountResponse {
6
+ success: boolean;
7
+ internalId?: string;
8
+ timestamp: string;
9
+ }
10
+ export type RemoveProductDiscount = (params?: RemoveProductDiscountParams) => Promise<RemoveProductDiscountResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RemoveProductFee } from "./types";
2
+ export declare const removeProductFee: RemoveProductFee;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeProductFee = async (params) => {
3
+ return await commandFrameClient.call("removeProductFee", params);
4
+ };
@@ -0,0 +1,10 @@
1
+ export interface RemoveProductFeeParams {
2
+ /** If provided, removes fee from specific cart item. Otherwise uses active product. */
3
+ internalId?: string;
4
+ }
5
+ export interface RemoveProductFeeResponse {
6
+ success: boolean;
7
+ internalId?: string;
8
+ timestamp: string;
9
+ }
10
+ export type RemoveProductFee = (params?: RemoveProductFeeParams) => Promise<RemoveProductFeeResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RemoveProductNote } from "./types";
2
+ export declare const removeProductNote: RemoveProductNote;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const removeProductNote = async (params) => {
3
+ return await commandFrameClient.call("removeProductNote", params);
4
+ };
@@ -0,0 +1,10 @@
1
+ export interface RemoveProductNoteParams {
2
+ /** If provided, removes note from specific cart item. Otherwise uses active product. */
3
+ internalId?: string;
4
+ }
5
+ export interface RemoveProductNoteResponse {
6
+ success: boolean;
7
+ internalId?: string;
8
+ timestamp: string;
9
+ }
10
+ export type RemoveProductNote = (params?: RemoveProductNoteParams) => Promise<RemoveProductNoteResponse>;
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -61,8 +61,14 @@ export declare const command: {
61
61
  readonly setActiveSession: import("./actions/set-active-session/types").SetActiveSession;
62
62
  readonly getActiveUser: import("./actions/get-active-user/types").GetActiveUser;
63
63
  readonly setActiveUser: import("./actions/set-active-user/types").SetActiveUser;
64
- readonly getActiveRefund: import("./actions/get-active-refund/types").GetActiveRefund;
65
64
  readonly setActiveRefund: import("./actions/set-active-refund/types").SetActiveRefund;
65
+ readonly removeProductDiscount: import("./actions/remove-product-discount/types").RemoveProductDiscount;
66
+ readonly removeProductFee: import("./actions/remove-product-fee/types").RemoveProductFee;
67
+ readonly removeProductNote: import("./actions/remove-product-note/types").RemoveProductNote;
68
+ readonly removeCartFee: import("./actions/remove-cart-fee/types").RemoveCartFee;
69
+ readonly removeOrderNote: import("./actions/remove-order-note/types").RemoveOrderNote;
70
+ readonly removeCustomSale: import("./actions/remove-custom-sale/types").RemoveCustomSale;
71
+ readonly removeNonRevenueItem: import("./actions/remove-non-revenue-item/types").RemoveNonRevenueItem;
66
72
  readonly triggerWebhook: import("./actions/trigger-webhook/types").TriggerWebhook;
67
73
  readonly triggerZapierWebhook: import("./actions/trigger-zapier-webhook/types").TriggerZapierWebhook;
68
74
  readonly initiateRefund: import("./actions/initiate-refund/types").InitiateRefund;
@@ -182,8 +188,14 @@ export type { GetActiveSession, GetActiveSessionResponse } from "./actions/get-a
182
188
  export type { SetActiveSession, SetActiveSessionParams, SetActiveSessionResponse } from "./actions/set-active-session/types";
183
189
  export type { GetActiveUser, GetActiveUserResponse } from "./actions/get-active-user/types";
184
190
  export type { SetActiveUser, SetActiveUserParams, SetActiveUserResponse } from "./actions/set-active-user/types";
185
- export type { GetActiveRefund, GetActiveRefundResponse } from "./actions/get-active-refund/types";
186
191
  export type { SetActiveRefund, SetActiveRefundParams, SetActiveRefundResponse } from "./actions/set-active-refund/types";
192
+ export type { RemoveProductDiscount, RemoveProductDiscountParams, RemoveProductDiscountResponse } from "./actions/remove-product-discount/types";
193
+ export type { RemoveProductFee, RemoveProductFeeParams, RemoveProductFeeResponse } from "./actions/remove-product-fee/types";
194
+ export type { RemoveProductNote, RemoveProductNoteParams, RemoveProductNoteResponse } from "./actions/remove-product-note/types";
195
+ export type { RemoveCartFee, RemoveCartFeeParams, RemoveCartFeeResponse } from "./actions/remove-cart-fee/types";
196
+ export type { RemoveOrderNote, RemoveOrderNoteResponse } from "./actions/remove-order-note/types";
197
+ export type { RemoveCustomSale, RemoveCustomSaleParams, RemoveCustomSaleResponse } from "./actions/remove-custom-sale/types";
198
+ export type { RemoveNonRevenueItem, RemoveNonRevenueItemParams, RemoveNonRevenueItemResponse } from "./actions/remove-non-revenue-item/types";
187
199
  export type { TriggerWebhook, TriggerWebhookPresetType, TriggerWebhookParams, TriggerWebhookResponse } from "./actions/trigger-webhook/types";
188
200
  export type { TriggerZapierWebhook, TriggerZapierWebhookParams, TriggerZapierWebhookResponse } from "./actions/trigger-zapier-webhook/types";
189
201
  export * from "./CommonTypes";
@@ -220,7 +232,7 @@ export type { OutletActiveSetPayload, OutletActiveGetPayload, OutletActiveSetEve
220
232
  export type { StationActiveSetPayload, StationActiveGetPayload, StationActiveSetEvent, StationActiveGetEvent, StationEventType, StationEventPayload } from "./pubsub/topics/station/types";
221
233
  export type { SessionActiveSetPayload, SessionActiveGetPayload, SessionActiveSetEvent, SessionActiveGetEvent, SessionEventType, SessionEventPayload } from "./pubsub/topics/session/types";
222
234
  export type { UserActiveSetPayload, UserActiveGetPayload, UserActiveSetEvent, UserActiveGetEvent, UsersEventType, UsersEventPayload } from "./pubsub/topics/users/types";
223
- 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";
235
+ 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";
224
236
  export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload } from "./pubsub/topics/payments/types";
225
237
  export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
226
238
  export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload } from "./pubsub/topics/print/types";
package/dist/index.js CHANGED
@@ -63,8 +63,15 @@ import { getActiveSession } from "./actions/get-active-session/action";
63
63
  import { setActiveSession } from "./actions/set-active-session/action";
64
64
  import { getActiveUser } from "./actions/get-active-user/action";
65
65
  import { setActiveUser } from "./actions/set-active-user/action";
66
- import { getActiveRefund } from "./actions/get-active-refund/action";
67
66
  import { setActiveRefund } from "./actions/set-active-refund/action";
67
+ // Remove Actions
68
+ import { removeProductDiscount } from "./actions/remove-product-discount/action";
69
+ import { removeProductFee } from "./actions/remove-product-fee/action";
70
+ import { removeProductNote } from "./actions/remove-product-note/action";
71
+ import { removeCartFee } from "./actions/remove-cart-fee/action";
72
+ import { removeOrderNote } from "./actions/remove-order-note/action";
73
+ import { removeCustomSale } from "./actions/remove-custom-sale/action";
74
+ import { removeNonRevenueItem } from "./actions/remove-non-revenue-item/action";
68
75
  // Integration Actions
69
76
  import { triggerWebhook } from "./actions/trigger-webhook/action";
70
77
  import { triggerZapierWebhook } from "./actions/trigger-zapier-webhook/action";
@@ -177,8 +184,15 @@ export const command = {
177
184
  setActiveSession,
178
185
  getActiveUser,
179
186
  setActiveUser,
180
- getActiveRefund,
181
187
  setActiveRefund,
188
+ // Remove Actions
189
+ removeProductDiscount,
190
+ removeProductFee,
191
+ removeProductNote,
192
+ removeCartFee,
193
+ removeOrderNote,
194
+ removeCustomSale,
195
+ removeNonRevenueItem,
182
196
  // Integration Actions
183
197
  triggerWebhook,
184
198
  triggerZapierWebhook,
@@ -81,7 +81,6 @@ import { mockGetActiveSession } from "../../actions/get-active-session/mock";
81
81
  import { mockSetActiveSession } from "../../actions/set-active-session/mock";
82
82
  import { mockGetActiveUser } from "../../actions/get-active-user/mock";
83
83
  import { mockSetActiveUser } from "../../actions/set-active-user/mock";
84
- import { mockGetActiveRefund } from "../../actions/get-active-refund/mock";
85
84
  import { mockSetActiveRefund } from "../../actions/set-active-refund/mock";
86
85
  export const RENDER_MOCKS = {
87
86
  addCartDiscount: mockAddCartDiscount,
@@ -167,6 +166,12 @@ export const RENDER_MOCKS = {
167
166
  setActiveSession: mockSetActiveSession,
168
167
  getActiveUser: mockGetActiveUser,
169
168
  setActiveUser: mockSetActiveUser,
170
- getActiveRefund: mockGetActiveRefund,
171
- setActiveRefund: mockSetActiveRefund
169
+ setActiveRefund: mockSetActiveRefund,
170
+ removeProductDiscount: async () => ({ success: true, timestamp: new Date().toISOString() }),
171
+ removeProductFee: async () => ({ success: true, timestamp: new Date().toISOString() }),
172
+ removeProductNote: async () => ({ success: true, timestamp: new Date().toISOString() }),
173
+ removeCartFee: async () => ({ success: true, timestamp: new Date().toISOString() }),
174
+ removeOrderNote: async () => ({ success: true, timestamp: new Date().toISOString() }),
175
+ removeCustomSale: async (params) => ({ success: true, id: params.id, timestamp: new Date().toISOString() }),
176
+ removeNonRevenueItem: async (params) => ({ success: true, externalId: params.externalId, timestamp: new Date().toISOString() })
172
177
  };
@@ -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, SetActiveProductFee, SetActiveProductDiscount, 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";
1
+ import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, 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, 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";
2
2
  export interface RenderProviderActions {
3
3
  exampleFunction: ExampleFunction;
4
4
  getProducts: GetProducts;
@@ -83,6 +83,12 @@ export interface RenderProviderActions {
83
83
  setActiveSession: SetActiveSession;
84
84
  getActiveUser: GetActiveUser;
85
85
  setActiveUser: SetActiveUser;
86
- getActiveRefund: GetActiveRefund;
87
86
  setActiveRefund: SetActiveRefund;
87
+ removeProductDiscount: RemoveProductDiscount;
88
+ removeProductFee: RemoveProductFee;
89
+ removeProductNote: RemoveProductNote;
90
+ removeCartFee: RemoveCartFee;
91
+ removeOrderNote: RemoveOrderNote;
92
+ removeCustomSale: RemoveCustomSale;
93
+ removeNonRevenueItem: RemoveNonRevenueItem;
88
94
  }
@@ -56,6 +56,36 @@ export const cartTopic = {
56
56
  id: "cart-fee-removed",
57
57
  name: "Cart Fee Removed",
58
58
  description: "Published when a fee is removed from the cart"
59
+ },
60
+ {
61
+ id: "product-discount-added",
62
+ name: "Product Discount Added",
63
+ description: "Published when a discount is added to a product in the cart"
64
+ },
65
+ {
66
+ id: "product-discount-removed",
67
+ name: "Product Discount Removed",
68
+ description: "Published when a discount is removed from a product in the cart"
69
+ },
70
+ {
71
+ id: "product-fee-added",
72
+ name: "Product Fee Added",
73
+ description: "Published when a fee is added to a product in the cart"
74
+ },
75
+ {
76
+ id: "product-fee-removed",
77
+ name: "Product Fee Removed",
78
+ description: "Published when a fee is removed from a product in the cart"
79
+ },
80
+ {
81
+ id: "product-note-added",
82
+ name: "Product Note Added",
83
+ description: "Published when a note is added to a product in the cart"
84
+ },
85
+ {
86
+ id: "product-note-removed",
87
+ name: "Product Note Removed",
88
+ description: "Published when a note is removed from a product in the cart"
59
89
  }
60
90
  ]
61
91
  };
@@ -0,0 +1,18 @@
1
+ import type { CFActiveProduct } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ /**
4
+ * Payload for product-discount-added event
5
+ */
6
+ export interface ProductDiscountAddedPayload {
7
+ product: CFActiveProduct;
8
+ internalId?: string;
9
+ discount: {
10
+ amount: number;
11
+ isPercent: boolean;
12
+ label: string;
13
+ };
14
+ }
15
+ /**
16
+ * Typed event for product-discount-added
17
+ */
18
+ export type ProductDiscountAddedEvent = TopicEvent<ProductDiscountAddedPayload>;
@@ -0,0 +1,13 @@
1
+ import type { CFActiveProduct } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ /**
4
+ * Payload for product-discount-removed event
5
+ */
6
+ export interface ProductDiscountRemovedPayload {
7
+ product: CFActiveProduct;
8
+ internalId?: string;
9
+ }
10
+ /**
11
+ * Typed event for product-discount-removed
12
+ */
13
+ export type ProductDiscountRemovedEvent = TopicEvent<ProductDiscountRemovedPayload>;
@@ -0,0 +1,19 @@
1
+ import type { CFActiveProduct } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ /**
4
+ * Payload for product-fee-added event
5
+ */
6
+ export interface ProductFeeAddedPayload {
7
+ product: CFActiveProduct;
8
+ internalId?: string;
9
+ fee: {
10
+ amount: number;
11
+ isPercent: boolean;
12
+ label: string;
13
+ applyTaxes: boolean;
14
+ };
15
+ }
16
+ /**
17
+ * Typed event for product-fee-added
18
+ */
19
+ export type ProductFeeAddedEvent = TopicEvent<ProductFeeAddedPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { CFActiveProduct } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ /**
4
+ * Payload for product-fee-removed event
5
+ */
6
+ export interface ProductFeeRemovedPayload {
7
+ product: CFActiveProduct;
8
+ internalId?: string;
9
+ }
10
+ /**
11
+ * Typed event for product-fee-removed
12
+ */
13
+ export type ProductFeeRemovedEvent = TopicEvent<ProductFeeRemovedPayload>;
@@ -0,0 +1,14 @@
1
+ import type { CFActiveProduct } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ /**
4
+ * Payload for product-note-added event
5
+ */
6
+ export interface ProductNoteAddedPayload {
7
+ product: CFActiveProduct;
8
+ internalId?: string;
9
+ note: string;
10
+ }
11
+ /**
12
+ * Typed event for product-note-added
13
+ */
14
+ export type ProductNoteAddedEvent = TopicEvent<ProductNoteAddedPayload>;
@@ -0,0 +1,13 @@
1
+ import type { CFActiveProduct } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ /**
4
+ * Payload for product-note-removed event
5
+ */
6
+ export interface ProductNoteRemovedPayload {
7
+ product: CFActiveProduct;
8
+ internalId?: string;
9
+ }
10
+ /**
11
+ * Typed event for product-note-removed
12
+ */
13
+ export type ProductNoteRemovedEvent = TopicEvent<ProductNoteRemovedPayload>;
@@ -11,6 +11,12 @@ export * from "./cart-discount-added/types";
11
11
  export * from "./cart-discount-removed/types";
12
12
  export * from "./cart-fee-added/types";
13
13
  export * from "./cart-fee-removed/types";
14
+ export * from "./product-discount-added/types";
15
+ export * from "./product-discount-removed/types";
16
+ export * from "./product-fee-added/types";
17
+ export * from "./product-fee-removed/types";
18
+ export * from "./product-note-added/types";
19
+ export * from "./product-note-removed/types";
14
20
  import type { CartCreatedPayload } from "./cart-created/types";
15
21
  import type { CartCustomerAssignedPayload } from "./customer-assigned/types";
16
22
  import type { ProductAddedPayload } from "./product-added/types";
@@ -20,5 +26,11 @@ import type { CartDiscountAddedPayload } from "./cart-discount-added/types";
20
26
  import type { CartDiscountRemovedPayload } from "./cart-discount-removed/types";
21
27
  import type { CartFeeAddedPayload } from "./cart-fee-added/types";
22
28
  import type { CartFeeRemovedPayload } from "./cart-fee-removed/types";
23
- export type CartEventPayload = CartCreatedPayload | CartCustomerAssignedPayload | ProductAddedPayload | ProductDeletedPayload | CartProductUpdatedPayload | CartDiscountAddedPayload | CartDiscountRemovedPayload | CartFeeAddedPayload | CartFeeRemovedPayload;
24
- export type CartEventType = "cart-created" | "customer-assigned" | "product-added" | "product-deleted" | "product-updated" | "cart-discount-added" | "cart-discount-removed" | "cart-fee-added" | "cart-fee-removed";
29
+ import type { ProductDiscountAddedPayload } from "./product-discount-added/types";
30
+ import type { ProductDiscountRemovedPayload } from "./product-discount-removed/types";
31
+ import type { ProductFeeAddedPayload } from "./product-fee-added/types";
32
+ import type { ProductFeeRemovedPayload } from "./product-fee-removed/types";
33
+ import type { ProductNoteAddedPayload } from "./product-note-added/types";
34
+ import type { ProductNoteRemovedPayload } from "./product-note-removed/types";
35
+ export type CartEventPayload = CartCreatedPayload | CartCustomerAssignedPayload | ProductAddedPayload | ProductDeletedPayload | CartProductUpdatedPayload | CartDiscountAddedPayload | CartDiscountRemovedPayload | CartFeeAddedPayload | CartFeeRemovedPayload | ProductDiscountAddedPayload | ProductDiscountRemovedPayload | ProductFeeAddedPayload | ProductFeeRemovedPayload | ProductNoteAddedPayload | ProductNoteRemovedPayload;
36
+ export type CartEventType = "cart-created" | "customer-assigned" | "customer-unassigned" | "product-added" | "product-deleted" | "product-updated" | "cart-discount-added" | "cart-discount-removed" | "cart-fee-added" | "cart-fee-removed" | "product-discount-added" | "product-discount-removed" | "product-fee-added" | "product-fee-removed" | "product-note-added" | "product-note-removed";
@@ -12,3 +12,9 @@ export * from "./cart-discount-added/types";
12
12
  export * from "./cart-discount-removed/types";
13
13
  export * from "./cart-fee-added/types";
14
14
  export * from "./cart-fee-removed/types";
15
+ export * from "./product-discount-added/types";
16
+ export * from "./product-discount-removed/types";
17
+ export * from "./product-fee-added/types";
18
+ export * from "./product-fee-removed/types";
19
+ export * from "./product-note-added/types";
20
+ export * from "./product-note-removed/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import type { GetActiveRefund } from "./types";
2
- export declare const getActiveRefund: GetActiveRefund;
@@ -1,4 +0,0 @@
1
- import { commandFrameClient } from "../../client";
2
- export const getActiveRefund = async () => {
3
- return await commandFrameClient.call("getActiveRefund");
4
- };
@@ -1,2 +0,0 @@
1
- import { GetActiveRefund } from "./types";
2
- export declare const mockGetActiveRefund: GetActiveRefund;
@@ -1,9 +0,0 @@
1
- import { MOCK_ACTIVE_REFUND_DETAILS } from "../../demo/database";
2
- export const mockGetActiveRefund = async () => {
3
- console.log("[Mock] getActiveRefund called");
4
- return {
5
- success: true,
6
- refund: MOCK_ACTIVE_REFUND_DETAILS,
7
- timestamp: new Date().toISOString()
8
- };
9
- };
@@ -1,7 +0,0 @@
1
- import { CFActiveRefundDetails } from "../../CommonTypes";
2
- export interface GetActiveRefundResponse {
3
- success: boolean;
4
- refund: CFActiveRefundDetails | null;
5
- timestamp: string;
6
- }
7
- export type GetActiveRefund = () => Promise<GetActiveRefundResponse>;