@final-commerce/command-frame 0.1.62 → 0.1.63

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 CHANGED
@@ -6,6 +6,8 @@ A TypeScript library for type-safe communication between iframes and their paren
6
6
 
7
7
  Command Frame provides a structured way to build integrations that run inside Final Commerce applications (like Render POS or Manage Dashboard). It handles the underlying `postMessage` communication while enforcing strict type safety for both the host application (Provider) and the embedded app (Client).
8
8
 
9
+ `RenderClient` and `ManageClient` extend `CommandFrameClient`: dynamic methods such as `getProducts()` map to `postMessage` actions named after the method (camelCase), with typed params and responses per project.
10
+
9
11
  The library provides three main capabilities:
10
12
 
11
13
  | Capability | Purpose | Scope |
@@ -15,6 +17,8 @@ The library provides three main capabilities:
15
17
  | **Hooks** | Register business-logic callbacks that persist across all pages | Session-scoped (survives page navigation) |
16
18
  | **Host → iframe refunds** | Render asks the extension to reverse redeem / gift-card payments before completing a POS refund | Parent `postMessage` + `requestId` (see below) |
17
19
 
20
+ Domain models (orders, cart, customers, products, and related types) are documented in **[Types reference](./src/types/README.md)**.
21
+
18
22
  ## Installation
19
23
 
20
24
  ### From npm (public registry)
@@ -75,7 +79,7 @@ const context = await client.getContext();
75
79
  The pub/sub system allows iframe extensions to subscribe to topics and receive real-time events published by the host (Render). Subscriptions are **page-scoped** -- they fire only while the iframe is mounted on the current page.
76
80
 
77
81
  - **[Pub/Sub Documentation](./src/pubsub/README.md)**
78
- - **Topics:** Cart (9), Customers (8), Orders (4), Payments (2), Products (4), Refunds (4), Print (3), Custom Tables (3), Outlet (2), Station (2), Session (2), Users (2).
82
+ - **Topics:** Cart (16), Customers (8), Orders (4), Payments (2), Products (4), Refunds (4), Print (3), Custom Tables (3), Outlet (2), Station (2), Session (2), Users (2).
79
83
 
80
84
  ```typescript
81
85
  import { topics } from '@final-commerce/command-frame';
@@ -33,6 +33,7 @@ import { mockGetCustomers } from "../../actions/get-customers/mock";
33
33
  import { mockGetOrders } from "../../actions/get-orders/mock";
34
34
  import { mockGetProducts } from "../../actions/get-products/mock";
35
35
  import { mockGetRefunds } from "../../actions/get-refunds/mock";
36
+ import { mockGetTaxTables } from "../../actions/get-tax-tables/mock";
36
37
  import { mockGetRemainingRefundableQuantities } from "../../actions/get-remaining-refundable-quantities/mock";
37
38
  import { mockGoToStationHome } from "../../actions/go-to-station-home/mock";
38
39
  import { mockInitiateRefund } from "../../actions/initiate-refund/mock";
@@ -118,6 +119,7 @@ export const RENDER_MOCKS = {
118
119
  getOrders: mockGetOrders,
119
120
  getProducts: mockGetProducts,
120
121
  getRefunds: mockGetRefunds,
122
+ getTaxTables: mockGetTaxTables,
121
123
  getRemainingRefundableQuantities: mockGetRemainingRefundableQuantities,
122
124
  goToStationHome: mockGoToStationHome,
123
125
  initiateRefund: mockInitiateRefund,
@@ -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, 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 } from "../../index";
2
2
  export interface RenderProviderActions {
3
3
  exampleFunction: ExampleFunction;
4
4
  getProducts: GetProducts;
@@ -10,6 +10,7 @@ export interface RenderProviderActions {
10
10
  getCategories: GetCategories;
11
11
  getOrders: GetOrders;
12
12
  getRefunds: GetRefunds;
13
+ getTaxTables: GetTaxTables;
13
14
  addProductDiscount: AddProductDiscount;
14
15
  addProductToCart: AddProductToCart;
15
16
  removeProductFromCart: RemoveProductFromCart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -60,6 +60,9 @@
60
60
  "@typescript-eslint/eslint-plugin": "^8.48.0",
61
61
  "@typescript-eslint/parser": "^8.48.0",
62
62
  "eslint": "^8.57.0",
63
+ "eslint-plugin-react": "^7.37.5",
64
+ "eslint-plugin-react-hooks": "^7.1.1",
65
+ "eslint-plugin-react-refresh": "^0.4.26",
63
66
  "husky": "^9.1.7",
64
67
  "jira-prepare-commit-msg": "^1.7.2",
65
68
  "lint-staged": "^16.2.7",