@final-commerce/command-frame 0.2.0-beta.6 → 0.3.0-beta.3

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 (100) hide show
  1. package/README.md +28 -26
  2. package/dist/CommonTypes.d.ts +72 -622
  3. package/dist/CommonTypes.js +5 -65
  4. package/dist/actions/add-product/mock.js +1 -1
  5. package/dist/actions/add-product-discount/mock.js +5 -5
  6. package/dist/actions/add-product-fee/mock.js +6 -6
  7. package/dist/actions/cash-payment/types.d.ts +0 -5
  8. package/dist/actions/delete-parked-order/types.d.ts +0 -3
  9. package/dist/actions/edit-product/mock.js +1 -1
  10. package/dist/actions/extension-payment/types.d.ts +4 -5
  11. package/dist/actions/get-products/mock.js +3 -3
  12. package/dist/actions/get-roles/mock.js +35 -41
  13. package/dist/actions/get-smart-grid-layout/action.d.ts +2 -0
  14. package/dist/actions/get-smart-grid-layout/action.js +4 -0
  15. package/dist/actions/get-smart-grid-layout/mock.d.ts +2 -0
  16. package/dist/actions/get-smart-grid-layout/mock.js +7 -0
  17. package/dist/actions/get-smart-grid-layout/types.d.ts +12 -0
  18. package/dist/actions/get-users/mock.js +16 -25
  19. package/dist/actions/initiate-refund/types.d.ts +0 -3
  20. package/dist/actions/integration-payment/action.d.ts +5 -0
  21. package/dist/actions/integration-payment/action.js +7 -0
  22. package/dist/actions/integration-payment/mock.d.ts +2 -0
  23. package/dist/actions/integration-payment/mock.js +4 -0
  24. package/dist/actions/integration-payment/types.d.ts +16 -0
  25. package/dist/actions/open-extension-overlay/action.d.ts +2 -0
  26. package/dist/actions/open-extension-overlay/action.js +4 -0
  27. package/dist/actions/open-extension-overlay/mock.d.ts +2 -0
  28. package/dist/actions/open-extension-overlay/mock.js +1 -0
  29. package/dist/actions/open-extension-overlay/types.d.ts +9 -0
  30. package/dist/actions/park-order/types.d.ts +0 -3
  31. package/dist/actions/partial-payment/types.d.ts +0 -5
  32. package/dist/actions/process-partial-refund/types.d.ts +0 -3
  33. package/dist/actions/resolve-extension-overlay/action.d.ts +2 -0
  34. package/dist/actions/resolve-extension-overlay/action.js +4 -0
  35. package/dist/actions/resolve-extension-overlay/mock.d.ts +2 -0
  36. package/dist/actions/resolve-extension-overlay/mock.js +1 -0
  37. package/dist/actions/resolve-extension-overlay/types.d.ts +9 -0
  38. package/dist/actions/resume-parked-order/mock.js +1 -1
  39. package/dist/actions/resume-parked-order/types.d.ts +0 -3
  40. package/dist/actions/save-smart-grid-layout/action.d.ts +2 -0
  41. package/dist/actions/save-smart-grid-layout/action.js +4 -0
  42. package/dist/actions/save-smart-grid-layout/mock.d.ts +2 -0
  43. package/dist/actions/save-smart-grid-layout/mock.js +7 -0
  44. package/dist/actions/save-smart-grid-layout/types.d.ts +12 -0
  45. package/dist/actions/set-active-product-discount/mock.js +1 -1
  46. package/dist/actions/set-active-product-fee/mock.js +1 -1
  47. package/dist/actions/tap-to-pay-payment/types.d.ts +0 -5
  48. package/dist/actions/terminal-payment/types.d.ts +0 -5
  49. package/dist/actions/vendara-payment/types.d.ts +0 -5
  50. package/dist/common-types/index.d.ts +0 -1
  51. package/dist/common-types/index.js +0 -1
  52. package/dist/demo/database.d.ts +21 -21
  53. package/dist/demo/database.js +27 -27
  54. package/dist/index.d.ts +115 -115
  55. package/dist/index.js +15 -15
  56. package/dist/interceptors/types.d.ts +34 -0
  57. package/dist/interceptors/types.js +1 -0
  58. package/dist/projects/render/mocks.js +10 -8
  59. package/dist/projects/render/types.d.ts +6 -5
  60. package/dist/pubsub/topics/orders/index.js +0 -10
  61. package/dist/pubsub/topics/orders/types.d.ts +2 -6
  62. package/dist/pubsub/topics/orders/types.js +0 -2
  63. package/dist/pubsub/topics/products/product-get-active/types.d.ts +6 -2
  64. package/package.json +15 -12
  65. package/dist/actions/can-transition/action.d.ts +0 -2
  66. package/dist/actions/can-transition/action.js +0 -4
  67. package/dist/actions/can-transition/mock.d.ts +0 -6
  68. package/dist/actions/can-transition/mock.js +0 -28
  69. package/dist/actions/can-transition/types.d.ts +0 -11
  70. package/dist/actions/get-available-transitions/action.d.ts +0 -2
  71. package/dist/actions/get-available-transitions/action.js +0 -4
  72. package/dist/actions/get-available-transitions/mock.d.ts +0 -6
  73. package/dist/actions/get-available-transitions/mock.js +0 -26
  74. package/dist/actions/get-available-transitions/types.d.ts +0 -9
  75. package/dist/actions/trigger-webhook/action.d.ts +0 -6
  76. package/dist/actions/trigger-webhook/action.js +0 -8
  77. package/dist/actions/trigger-webhook/mock.d.ts +0 -2
  78. package/dist/actions/trigger-webhook/mock.js +0 -8
  79. package/dist/actions/trigger-webhook/types.d.ts +0 -21
  80. package/dist/actions/trigger-webhook/types.js +0 -2
  81. package/dist/actions/trigger-zapier-webhook/action.d.ts +0 -6
  82. package/dist/actions/trigger-zapier-webhook/action.js +0 -8
  83. package/dist/actions/trigger-zapier-webhook/mock.d.ts +0 -2
  84. package/dist/actions/trigger-zapier-webhook/mock.js +0 -8
  85. package/dist/actions/trigger-zapier-webhook/types.d.ts +0 -9
  86. package/dist/common-types/order-state.d.ts +0 -32
  87. package/dist/common-types/order-state.js +0 -6
  88. package/dist/common-types/state-fragment.d.ts +0 -77
  89. package/dist/common-types/state-fragment.js +0 -10
  90. package/dist/fragments/index.d.ts +0 -1
  91. package/dist/fragments/index.js +0 -1
  92. package/dist/fragments/preorder-no-deposit.d.ts +0 -26
  93. package/dist/fragments/preorder-no-deposit.js +0 -166
  94. package/dist/pubsub/topics/orders/state-transition-blocked/types.d.ts +0 -16
  95. package/dist/pubsub/topics/orders/state-transition-completed/types.d.ts +0 -15
  96. /package/dist/actions/{can-transition → get-smart-grid-layout}/types.js +0 -0
  97. /package/dist/actions/{get-available-transitions → integration-payment}/types.js +0 -0
  98. /package/dist/actions/{trigger-zapier-webhook → open-extension-overlay}/types.js +0 -0
  99. /package/dist/{pubsub/topics/orders/state-transition-blocked → actions/resolve-extension-overlay}/types.js +0 -0
  100. /package/dist/{pubsub/topics/orders/state-transition-completed → actions/save-smart-grid-layout}/types.js +0 -0
@@ -1,66 +1,6 @@
1
1
  export * from "./common-types";
2
- export var CurrencyCode;
3
- (function (CurrencyCode) {
4
- CurrencyCode["USD"] = "USD";
5
- CurrencyCode["EUR"] = "EUR";
6
- CurrencyCode["GBP"] = "GBP";
7
- CurrencyCode["CAD"] = "CAD";
8
- CurrencyCode["AUD"] = "AUD";
9
- CurrencyCode["NZD"] = "NZD";
10
- CurrencyCode["CHF"] = "CHF";
11
- CurrencyCode["CNY"] = "CNY";
12
- CurrencyCode["INR"] = "INR";
13
- CurrencyCode["MXN"] = "MXN";
14
- CurrencyCode["BRL"] = "BRL";
15
- CurrencyCode["ZAR"] = "ZAR";
16
- CurrencyCode["SGD"] = "SGD";
17
- CurrencyCode["HKD"] = "HKD";
18
- CurrencyCode["SEK"] = "SEK";
19
- CurrencyCode["NOK"] = "NOK";
20
- CurrencyCode["DKK"] = "DKK";
21
- CurrencyCode["PLN"] = "PLN";
22
- CurrencyCode["THB"] = "THB";
23
- CurrencyCode["MYR"] = "MYR";
24
- CurrencyCode["PHP"] = "PHP";
25
- CurrencyCode["IDR"] = "IDR";
26
- CurrencyCode["AED"] = "AED";
27
- CurrencyCode["SAR"] = "SAR";
28
- CurrencyCode["ILS"] = "ILS";
29
- CurrencyCode["TRY"] = "TRY";
30
- CurrencyCode["RUB"] = "RUB";
31
- CurrencyCode["JPY"] = "JPY";
32
- CurrencyCode["KRW"] = "KRW";
33
- CurrencyCode["VND"] = "VND";
34
- CurrencyCode["CLP"] = "CLP";
35
- CurrencyCode["ISK"] = "ISK";
36
- CurrencyCode["HUF"] = "HUF";
37
- CurrencyCode["TWD"] = "TWD";
38
- CurrencyCode["KWD"] = "KWD";
39
- CurrencyCode["BHD"] = "BHD";
40
- CurrencyCode["OMR"] = "OMR";
41
- CurrencyCode["JOD"] = "JOD";
42
- CurrencyCode["TND"] = "TND";
43
- CurrencyCode["LYD"] = "LYD";
44
- CurrencyCode["IQD"] = "IQD";
45
- })(CurrencyCode || (CurrencyCode = {}));
46
- // Enums
47
- export var CFProductType;
48
- (function (CFProductType) {
49
- CFProductType["SIMPLE"] = "simple";
50
- CFProductType["VARIABLE"] = "variable";
51
- })(CFProductType || (CFProductType = {}));
52
- export var CFUserTypes;
53
- (function (CFUserTypes) {
54
- CFUserTypes["OWNER"] = "owner";
55
- CFUserTypes["ORG_USER"] = "organization_user";
56
- CFUserTypes["ORG_OWNER"] = "organization_owner";
57
- CFUserTypes["FINAL_USER"] = "final_user";
58
- CFUserTypes["FINAL_OWNER"] = "final_owner";
59
- CFUserTypes["EMPLOYEE"] = "employee";
60
- CFUserTypes["SUPER_ADMIN"] = "super_admin";
61
- CFUserTypes["MANAGER"] = "manager";
62
- CFUserTypes["ADMIN"] = "admin";
63
- CFUserTypes["ASSISTANT_MANAGER"] = "assistant";
64
- CFUserTypes["CASHIER"] = "cashier";
65
- CFUserTypes["RESELLER"] = "reseller";
66
- })(CFUserTypes || (CFUserTypes = {}));
2
+ // Enums — re-exported from common (single source). CurrencyCode keeps its name;
3
+ // CFProductType/CFUserTypes alias common's ProductType/UserTypes. Note: common's
4
+ // UserTypes uses `COMPANY_OWNER` where command-frame's enum previously had `OWNER`
5
+ // (same value `'owner'`).
6
+ export { CurrencyCode, ProductType as CFProductType, UserTypes as CFUserTypes } from "@final-commerce/common";
@@ -12,7 +12,7 @@ export const mockAddProduct = async (params) => {
12
12
  minorUnits: 2,
13
13
  name: params.name,
14
14
  description: params.description,
15
- categories: params.categories || [],
15
+ categories: (params.categories || []).map((c) => ({ name: c, externalId: c })),
16
16
  taxTable: params.taxTable || "",
17
17
  images: params.images || [],
18
18
  status: params.status || "active",
@@ -10,11 +10,11 @@ export const mockAddProductDiscount = async (params) => {
10
10
  item = MOCK_CART.products[MOCK_CART.products.length - 1];
11
11
  }
12
12
  if (item) {
13
- item.discount = {
14
- value: params.amount,
15
- isPercent: params.isPercent || false,
16
- label: params.label
17
- };
13
+ item.discounts = [{
14
+ value: params.amount,
15
+ isPercent: params.isPercent || false,
16
+ label: params.label
17
+ }];
18
18
  // Recalculate cart totals (simplified)
19
19
  // Ideally, this should trigger a full recalculation function
20
20
  }
@@ -10,12 +10,12 @@ export const mockAddProductFee = async (params) => {
10
10
  item = MOCK_CART.products[MOCK_CART.products.length - 1];
11
11
  }
12
12
  if (item) {
13
- item.fee = {
14
- label: params.label || "Fee",
15
- amount: params.amount,
16
- isPercent: params.isPercent || false,
17
- applyTaxes: params.applyTaxes || false
18
- };
13
+ item.fees = [{
14
+ label: params.label || "Fee",
15
+ amount: params.amount,
16
+ isPercent: params.isPercent || false,
17
+ applyTaxes: params.applyTaxes || false
18
+ }];
19
19
  }
20
20
  }
21
21
  return {
@@ -1,12 +1,9 @@
1
1
  import { CFOrder } from "../../CommonTypes";
2
- import type { CFTransitionResult } from "../../common-types/order-state";
3
2
  export interface CashPaymentParams {
4
3
  /** If not provided, uses the cart total. */
5
4
  amount?: number;
6
5
  /** Defaults to false. */
7
6
  openChangeCalculator?: boolean;
8
- /** Override the fulfillment state after full payment. Render resolves the cascade. */
9
- checkoutFulfillmentTarget?: string;
10
7
  }
11
8
  export interface CashPaymentResponse {
12
9
  success: boolean;
@@ -15,7 +12,5 @@ export interface CashPaymentResponse {
15
12
  paymentType: string;
16
13
  order: CFOrder | null;
17
14
  timestamp: string;
18
- /** Present when the state machine blocked or forced the transition. */
19
- transitionResult?: CFTransitionResult;
20
15
  }
21
16
  export type CashPayment = (params?: CashPaymentParams) => Promise<CashPaymentResponse>;
@@ -1,4 +1,3 @@
1
- import type { CFTransitionResult } from "../../common-types/order-state";
2
1
  export interface DeleteParkedOrderParams {
3
2
  orderId: string;
4
3
  }
@@ -6,7 +5,5 @@ export interface DeleteParkedOrderResponse {
6
5
  success: boolean;
7
6
  orderId: string;
8
7
  timestamp: string;
9
- /** Present when the state machine blocked or forced the transition. */
10
- transitionResult?: CFTransitionResult;
11
8
  }
12
9
  export type DeleteParkedOrder = (params?: DeleteParkedOrderParams) => Promise<DeleteParkedOrderResponse>;
@@ -10,7 +10,7 @@ export const mockEditProduct = async (params) => {
10
10
  minorUnits: 2,
11
11
  name: params.changes.name || "Updated Product",
12
12
  description: params.changes.description,
13
- categories: params.changes.categories || [],
13
+ categories: (params.changes.categories || []).map((c) => ({ name: c, externalId: c })),
14
14
  taxTable: params.changes.taxTable || "",
15
15
  images: params.changes.images || [],
16
16
  status: params.changes.status || "active",
@@ -1,5 +1,4 @@
1
1
  import { CFOrder } from "../../CommonTypes";
2
- import type { CFTransitionResult } from "../../common-types/order-state";
3
2
  /** Params for extension-initiated payments; host routes by `paymentType`. */
4
3
  export interface ExtensionPaymentParams {
5
4
  paymentType: string;
@@ -9,8 +8,10 @@ export interface ExtensionPaymentParams {
9
8
  referenceId?: string;
10
9
  extensionId?: string;
11
10
  metadata?: Record<string, unknown>;
12
- /** Override the fulfillment state after full payment. Render resolves the cascade. */
13
- checkoutFulfillmentTarget?: string;
11
+ /** EMV tag string from an integration terminal; forwarded to the order PaymentMethod's `emv`. */
12
+ emvData?: string;
13
+ /** Processor fee for an integration payment; forwarded to the order PaymentMethod's `processorFee`. */
14
+ processorFee?: number;
14
15
  }
15
16
  export interface ExtensionPaymentResponse {
16
17
  success: boolean;
@@ -18,7 +19,5 @@ export interface ExtensionPaymentResponse {
18
19
  paymentType: string;
19
20
  order: CFOrder | null;
20
21
  timestamp: string;
21
- /** Present when the state machine blocked or forced the transition. */
22
- transitionResult?: CFTransitionResult;
23
22
  }
24
23
  export type ExtensionPayment = (params?: ExtensionPaymentParams) => Promise<ExtensionPaymentResponse>;
@@ -13,15 +13,15 @@ export const mockGetProducts = async (params) => {
13
13
  // Handle categories filter: { $in: [...] } or direct string
14
14
  const catFilter = query.categories;
15
15
  if (typeof catFilter === 'string') {
16
- products = products.filter(p => (p.categories || []).includes(catFilter));
16
+ products = products.filter(p => (p.categories || []).some(c => c.name === catFilter));
17
17
  }
18
18
  else if (typeof catFilter === 'object' && '$in' in catFilter) {
19
19
  const inList = catFilter.$in;
20
- products = products.filter(p => (p.categories || []).some(c => inList.includes(c)));
20
+ products = products.filter(p => (p.categories || []).some(c => inList.includes(c.name)));
21
21
  }
22
22
  else if (typeof catFilter === 'object' && '$contains' in catFilter) {
23
23
  const containsVal = catFilter.$contains;
24
- products = products.filter(p => (p.categories || []).includes(containsVal));
24
+ products = products.filter(p => (p.categories || []).some(c => c.name.includes(containsVal)));
25
25
  }
26
26
  }
27
27
  return {
@@ -4,61 +4,55 @@ export const mockGetRoles = async (params) => {
4
4
  roles: [
5
5
  {
6
6
  id: "691df9c6c478bada1fb23d0b",
7
- _id: "691df9c6c478bada1fb23d0b",
8
- companyId: "691df9c4c478bada1fb23bff",
9
7
  name: "Owner",
10
8
  permissions: [
11
- { category: "hub_access", name: "taxes", value: true, subCategory: "store_management", permissionId: "664759347eefffe8aba84476" },
12
- { category: "hub_access", name: "general", value: true, subCategory: "store_management", permissionId: "6647591d7eefffe8aba84475" },
13
- { category: "hub_access", name: "reports", value: true, subCategory: "store_management", permissionId: "6645f719ee8498efff5c49bb" },
14
- { category: "hub_access", name: "products", value: true, subCategory: "store_management", permissionId: "6645f719f00dc43caaeffe2b" },
15
- { category: "hub_access", name: "users", value: true, subCategory: "store_management", permissionId: "6647555b7eefffe8aba84473" },
16
- { category: "hub_access", name: "outlets", value: true, subCategory: "store_management", permissionId: "664759047eefffe8aba84474" },
17
- { category: "hub_access", name: "builder", value: true, subCategory: "builder_access", permissionId: "664779827eefffe8aba84477" },
18
- { category: "hub_access", name: "global_blocks", value: true, subCategory: "builder_access", permissionId: "6645f719f00dc43caaeffe47" },
19
- { category: "hub_access", name: "images", value: true, subCategory: "builder_access", permissionId: "6645f719ee8498efff5c49dc" },
20
- { category: "hub_access", name: "transactions", value: true, subCategory: "payments_access", permissionId: "6645f719ee8498efff5c4a6b" },
21
- { category: "hub_access", name: "payouts", value: true, subCategory: "payments_access", permissionId: "66477add7eefffe8aba84478" },
22
- { category: "hub_access", name: "terminals", value: true, subCategory: "payments_access", permissionId: "6645f71998735e68b2c45740" },
23
- { category: "hub_access", name: "billing", value: true, subCategory: "payments_access", permissionId: "66bbb00572999149fdd57866" },
24
- { category: "station_access", name: "give_discounts", value: true, subCategory: "pos_actions", permissionId: "6723b146ae5f176f7539d8a6" },
25
- { category: "station_access", name: "issue_refunds", value: true, subCategory: "pos_actions", permissionId: "6645f719ee8498efff5c4ae4" },
26
- { category: "station_access", name: "delete_customers", value: true, subCategory: "pos_actions", permissionId: "6645f71998735e68b2c457df" },
27
- { category: "station_access", name: "version_control", value: true, subCategory: "station_setting", permissionId: "66e050160d69015fbff9758a" },
28
- { category: "station_access", name: "session_reports", value: true, subCategory: "station_home", permissionId: "6723b271ae5f176f7539d8a7" },
29
- { category: "station_access", name: "cash_drawer", value: true, subCategory: "station_home", permissionId: "6723b2aeae5f176f7539d8a8" },
30
- { category: "station_access", name: "station_setting", value: true, subCategory: "station_home", permissionId: "6723b2c5ae5f176f7539d8a9" },
31
- { category: "station_access", name: "station_transactions", value: true, subCategory: "station_home", permissionId: "677eb109d2607a0169fdf7d5" },
9
+ { category: "hub_access", label: "taxes", name: "taxes", value: true },
10
+ { category: "hub_access", label: "general", name: "general", value: true },
11
+ { category: "hub_access", label: "reports", name: "reports", value: true },
12
+ { category: "hub_access", label: "products", name: "products", value: true },
13
+ { category: "hub_access", label: "users", name: "users", value: true },
14
+ { category: "hub_access", label: "outlets", name: "outlets", value: true },
15
+ { category: "hub_access", label: "builder", name: "builder", value: true },
16
+ { category: "hub_access", label: "global_blocks", name: "global_blocks", value: true },
17
+ { category: "hub_access", label: "images", name: "images", value: true },
18
+ { category: "hub_access", label: "transactions", name: "transactions", value: true },
19
+ { category: "hub_access", label: "payouts", name: "payouts", value: true },
20
+ { category: "hub_access", label: "terminals", name: "terminals", value: true },
21
+ { category: "hub_access", label: "billing", name: "billing", value: true },
22
+ { category: "station_access", label: "give_discounts", name: "give_discounts", value: true },
23
+ { category: "station_access", label: "issue_refunds", name: "issue_refunds", value: true },
24
+ { category: "station_access", label: "delete_customers", name: "delete_customers", value: true },
25
+ { category: "station_access", label: "version_control", name: "version_control", value: true },
26
+ { category: "station_access", label: "session_reports", name: "session_reports", value: true },
27
+ { category: "station_access", label: "cash_drawer", name: "cash_drawer", value: true },
28
+ { category: "station_access", label: "station_setting", name: "station_setting", value: true },
29
+ { category: "station_access", label: "station_transactions", name: "station_transactions", value: true },
32
30
  ]
33
31
  },
34
32
  {
35
33
  id: "691df9c6c478bada1fb23d0c",
36
- _id: "691df9c6c478bada1fb23d0c",
37
- companyId: "691df9c4c478bada1fb23bff",
38
34
  name: "admin",
39
35
  permissions: [
40
- { category: "hub_access", name: "taxes", value: true, subCategory: "store_management", permissionId: "664759347eefffe8aba84476" },
41
- { category: "hub_access", name: "general", value: true, subCategory: "store_management", permissionId: "6647591d7eefffe8aba84475" },
42
- { category: "hub_access", name: "reports", value: true, subCategory: "store_management", permissionId: "6645f719ee8498efff5c49bb" },
43
- { category: "hub_access", name: "products", value: true, subCategory: "store_management", permissionId: "6645f719f00dc43caaeffe2b" },
44
- { category: "hub_access", name: "users", value: true, subCategory: "store_management", permissionId: "6647555b7eefffe8aba84473" },
45
- { category: "hub_access", name: "transactions", value: true, subCategory: "payments_access", permissionId: "6645f719ee8498efff5c4a6b" },
46
- { category: "station_access", name: "give_discounts", value: true, subCategory: "pos_actions", permissionId: "6723b146ae5f176f7539d8a6" },
47
- { category: "station_access", name: "issue_refunds", value: true, subCategory: "pos_actions", permissionId: "6645f719ee8498efff5c4ae4" },
48
- { category: "station_access", name: "delete_customers", value: true, subCategory: "pos_actions", permissionId: "6645f71998735e68b2c457df" },
36
+ { category: "hub_access", label: "taxes", name: "taxes", value: true },
37
+ { category: "hub_access", label: "general", name: "general", value: true },
38
+ { category: "hub_access", label: "reports", name: "reports", value: true },
39
+ { category: "hub_access", label: "products", name: "products", value: true },
40
+ { category: "hub_access", label: "users", name: "users", value: true },
41
+ { category: "hub_access", label: "transactions", name: "transactions", value: true },
42
+ { category: "station_access", label: "give_discounts", name: "give_discounts", value: true },
43
+ { category: "station_access", label: "issue_refunds", name: "issue_refunds", value: true },
44
+ { category: "station_access", label: "delete_customers", name: "delete_customers", value: true },
49
45
  ]
50
46
  },
51
47
  {
52
48
  id: "691df9c6c478bada1fb23d0d",
53
- _id: "691df9c6c478bada1fb23d0d",
54
- companyId: "691df9c4c478bada1fb23bff",
55
49
  name: "cashier",
56
50
  permissions: [
57
- { category: "station_access", name: "give_discounts", value: false, subCategory: "pos_actions", permissionId: "6723b146ae5f176f7539d8a6" },
58
- { category: "station_access", name: "issue_refunds", value: false, subCategory: "pos_actions", permissionId: "6645f719ee8498efff5c4ae4" },
59
- { category: "station_access", name: "delete_customers", value: false, subCategory: "pos_actions", permissionId: "6645f71998735e68b2c457df" },
60
- { category: "station_access", name: "session_reports", value: true, subCategory: "station_home", permissionId: "6723b271ae5f176f7539d8a7" },
61
- { category: "station_access", name: "cash_drawer", value: true, subCategory: "station_home", permissionId: "6723b2aeae5f176f7539d8a8" },
51
+ { category: "station_access", label: "give_discounts", name: "give_discounts", value: false },
52
+ { category: "station_access", label: "issue_refunds", name: "issue_refunds", value: false },
53
+ { category: "station_access", label: "delete_customers", name: "delete_customers", value: false },
54
+ { category: "station_access", label: "session_reports", name: "session_reports", value: true },
55
+ { category: "station_access", label: "cash_drawer", name: "cash_drawer", value: true },
62
56
  ]
63
57
  }
64
58
  ],
@@ -0,0 +1,2 @@
1
+ import type { GetSmartGridLayout } from "./types";
2
+ export declare const getSmartGridLayout: GetSmartGridLayout;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const getSmartGridLayout = async (params) => {
3
+ return await commandFrameClient.call("getSmartGridLayout", params);
4
+ };
@@ -0,0 +1,2 @@
1
+ import type { GetSmartGridLayout } from "./types";
2
+ export declare const mockGetSmartGridLayout: GetSmartGridLayout;
@@ -0,0 +1,7 @@
1
+ export const mockGetSmartGridLayout = (params) => {
2
+ return Promise.resolve({
3
+ success: true,
4
+ layout: { gridId: params.gridId, cells: [] },
5
+ timestamp: new Date().toISOString()
6
+ });
7
+ };
@@ -0,0 +1,12 @@
1
+ import type { CFSmartGridLayout } from "../../CommonTypes";
2
+ /** Fetch a builder SmartGrid layout by `gridId`. */
3
+ export interface GetSmartGridLayoutParams {
4
+ gridId: string;
5
+ }
6
+ export interface GetSmartGridLayoutResponse {
7
+ success: boolean;
8
+ /** The stored layout, or `null` when no layout exists for the grid. */
9
+ layout: CFSmartGridLayout | null;
10
+ timestamp: string;
11
+ }
12
+ export type GetSmartGridLayout = (params: GetSmartGridLayoutParams) => Promise<GetSmartGridLayoutResponse>;
@@ -5,7 +5,6 @@ export const mockGetUsers = async (params) => {
5
5
  users: [
6
6
  {
7
7
  id: "691df9c2047bfc55994d703f",
8
- _id: "691df9c2047bfc55994d703f",
9
8
  firstName: "Sarah",
10
9
  lastName: "Mitchell",
11
10
  email: "sarah.mitchell@company.com",
@@ -13,25 +12,22 @@ export const mockGetUsers = async (params) => {
13
12
  type: CFUserTypes.ORG_OWNER,
14
13
  role: {
15
14
  id: "691df9c6c478bada1fb23d0b",
16
- _id: "691df9c6c478bada1fb23d0b",
17
15
  name: "Owner",
18
- companyId: "691df9c4c478bada1fb23bff",
19
16
  permissions: [
20
- { category: "hub_access", name: "general", value: true, subCategory: "store_management" },
21
- { category: "hub_access", name: "products", value: true, subCategory: "store_management" },
22
- { category: "hub_access", name: "reports", value: true, subCategory: "store_management" },
23
- { category: "hub_access", name: "users", value: true, subCategory: "store_management" },
24
- { category: "hub_access", name: "builder", value: true, subCategory: "builder_access" },
25
- { category: "hub_access", name: "billing", value: true, subCategory: "payments_access" },
26
- { category: "station_access", name: "give_discounts", value: true, subCategory: "pos_actions" },
27
- { category: "station_access", name: "issue_refunds", value: true, subCategory: "pos_actions" },
17
+ { category: "hub_access", label: "general", name: "general", value: true },
18
+ { category: "hub_access", label: "products", name: "products", value: true },
19
+ { category: "hub_access", label: "reports", name: "reports", value: true },
20
+ { category: "hub_access", label: "users", name: "users", value: true },
21
+ { category: "hub_access", label: "builder", name: "builder", value: true },
22
+ { category: "hub_access", label: "billing", name: "billing", value: true },
23
+ { category: "station_access", label: "give_discounts", name: "give_discounts", value: true },
24
+ { category: "station_access", label: "issue_refunds", name: "issue_refunds", value: true },
28
25
  ]
29
26
  },
30
27
  outlets: []
31
28
  },
32
29
  {
33
30
  id: "692a1b3c4d5e6f7890abcde1",
34
- _id: "692a1b3c4d5e6f7890abcde1",
35
31
  firstName: "James",
36
32
  lastName: "Rodriguez",
37
33
  email: "james.rodriguez@company.com",
@@ -39,22 +35,19 @@ export const mockGetUsers = async (params) => {
39
35
  type: CFUserTypes.ADMIN,
40
36
  role: {
41
37
  id: "691df9c6c478bada1fb23d0c",
42
- _id: "691df9c6c478bada1fb23d0c",
43
38
  name: "admin",
44
- companyId: "691df9c4c478bada1fb23bff",
45
39
  permissions: [
46
- { category: "hub_access", name: "general", value: true, subCategory: "store_management" },
47
- { category: "hub_access", name: "products", value: true, subCategory: "store_management" },
48
- { category: "hub_access", name: "reports", value: true, subCategory: "store_management" },
49
- { category: "hub_access", name: "users", value: true, subCategory: "store_management" },
50
- { category: "station_access", name: "give_discounts", value: true, subCategory: "pos_actions" },
40
+ { category: "hub_access", label: "general", name: "general", value: true },
41
+ { category: "hub_access", label: "products", name: "products", value: true },
42
+ { category: "hub_access", label: "reports", name: "reports", value: true },
43
+ { category: "hub_access", label: "users", name: "users", value: true },
44
+ { category: "station_access", label: "give_discounts", name: "give_discounts", value: true },
51
45
  ]
52
46
  },
53
47
  outlets: ["outlet-main", "outlet-downtown"]
54
48
  },
55
49
  {
56
50
  id: "692a1b3c4d5e6f7890abcde2",
57
- _id: "692a1b3c4d5e6f7890abcde2",
58
51
  firstName: "Lisa",
59
52
  lastName: "Chen",
60
53
  email: "lisa.chen@company.com",
@@ -62,13 +55,11 @@ export const mockGetUsers = async (params) => {
62
55
  type: CFUserTypes.CASHIER,
63
56
  role: {
64
57
  id: "691df9c6c478bada1fb23d0d",
65
- _id: "691df9c6c478bada1fb23d0d",
66
58
  name: "cashier",
67
- companyId: "691df9c4c478bada1fb23bff",
68
59
  permissions: [
69
- { category: "station_access", name: "give_discounts", value: false, subCategory: "pos_actions" },
70
- { category: "station_access", name: "issue_refunds", value: false, subCategory: "pos_actions" },
71
- { category: "station_access", name: "session_reports", value: true, subCategory: "station_home" },
60
+ { category: "station_access", label: "give_discounts", name: "give_discounts", value: false },
61
+ { category: "station_access", label: "issue_refunds", name: "issue_refunds", value: false },
62
+ { category: "station_access", label: "session_reports", name: "session_reports", value: true },
72
63
  ]
73
64
  },
74
65
  outlets: ["outlet-main"]
@@ -1,4 +1,3 @@
1
- import type { CFTransitionResult } from "../../common-types/order-state";
2
1
  export interface InitiateRefundParams {
3
2
  /** The ID of the order to refund. If not provided, uses the currently active order. */
4
3
  orderId?: string;
@@ -7,7 +6,5 @@ export interface InitiateRefundResponse {
7
6
  success: boolean;
8
7
  orderId: string;
9
8
  timestamp: string;
10
- /** Present when the state machine blocked or forced the transition. */
11
- transitionResult?: CFTransitionResult;
12
9
  }
13
10
  export type InitiateRefund = (params?: InitiateRefundParams) => Promise<InitiateRefundResponse>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Integration payment — thin wrapper over {@link extensionPayment} with `paymentType: "integration"`.
3
+ */
4
+ import type { IntegrationPayment } from "./types";
5
+ export declare const integrationPayment: IntegrationPayment;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Integration payment — thin wrapper over {@link extensionPayment} with `paymentType: "integration"`.
3
+ */
4
+ import { extensionPayment } from "../extension-payment/action";
5
+ export const integrationPayment = async (params) => {
6
+ return extensionPayment({ ...params, paymentType: "integration" });
7
+ };
@@ -0,0 +1,2 @@
1
+ import type { IntegrationPayment } from "./types";
2
+ export declare const mockIntegrationPayment: IntegrationPayment;
@@ -0,0 +1,4 @@
1
+ import { mockExtensionPayment } from "../extension-payment/mock";
2
+ export const mockIntegrationPayment = async (params) => {
3
+ return mockExtensionPayment({ ...params, paymentType: "integration" });
4
+ };
@@ -0,0 +1,16 @@
1
+ import type { ExtensionPaymentResponse } from "../extension-payment/types";
2
+ /** Integration (e.g. Stripe-style terminal) payment — always uses paymentType `"integration"` on the wire. */
3
+ export interface IntegrationPaymentParams {
4
+ amount?: number;
5
+ processor?: string;
6
+ label?: string;
7
+ referenceId?: string;
8
+ extensionId?: string;
9
+ metadata?: Record<string, unknown>;
10
+ /** EMV tag string from the integration terminal; forwarded to the order PaymentMethod's `emv`. */
11
+ emvData?: string;
12
+ /** Processor fee for the integration payment; forwarded to the order PaymentMethod's `processorFee`. */
13
+ processorFee?: number;
14
+ }
15
+ export type IntegrationPaymentResponse = ExtensionPaymentResponse;
16
+ export type IntegrationPayment = (params?: IntegrationPaymentParams) => Promise<IntegrationPaymentResponse>;
@@ -0,0 +1,2 @@
1
+ import type { OpenExtensionOverlay } from "./types";
2
+ export declare const openExtensionOverlay: OpenExtensionOverlay;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const openExtensionOverlay = async (params) => {
3
+ return await commandFrameClient.call("openExtensionOverlay", params);
4
+ };
@@ -0,0 +1,2 @@
1
+ import type { OpenExtensionOverlay } from "./types";
2
+ export declare const mockOpenExtensionOverlay: OpenExtensionOverlay;
@@ -0,0 +1 @@
1
+ export const mockOpenExtensionOverlay = () => Promise.resolve(true);
@@ -0,0 +1,9 @@
1
+ import type { InterceptorPoint, InterceptorReturn } from "../../interceptors/types";
2
+ export interface OpenExtensionOverlayParams {
3
+ point: InterceptorPoint;
4
+ payload?: unknown;
5
+ /** Owning extension id. Injected by the host for interceptor-originated calls; optional for direct calls. */
6
+ extensionId?: string;
7
+ }
8
+ export type OpenExtensionOverlayResponse = InterceptorReturn;
9
+ export type OpenExtensionOverlay = (params: OpenExtensionOverlayParams) => Promise<OpenExtensionOverlayResponse>;
@@ -1,10 +1,7 @@
1
1
  import { CFOrder } from "../../CommonTypes";
2
- import type { CFTransitionResult } from "../../common-types/order-state";
3
2
  export interface ParkOrderResponse {
4
3
  success: boolean;
5
4
  order: CFOrder;
6
5
  timestamp: string;
7
- /** Present when the state machine blocked or forced the transition. */
8
- transitionResult?: CFTransitionResult;
9
6
  }
10
7
  export type ParkOrder = () => Promise<ParkOrderResponse>;
@@ -1,5 +1,4 @@
1
1
  import { CFOrder } from "../../CommonTypes";
2
- import type { CFTransitionResult } from "../../common-types/order-state";
3
2
  export interface PartialPaymentParams {
4
3
  /** The payment amount (required if openUI is false). */
5
4
  amount?: number;
@@ -7,8 +6,6 @@ export interface PartialPaymentParams {
7
6
  isPercent?: boolean;
8
7
  /** If true, opens the split payment UI. */
9
8
  openUI?: boolean;
10
- /** Override the fulfillment state after full payment. Render resolves the cascade. */
11
- checkoutFulfillmentTarget?: string;
12
9
  }
13
10
  export interface PartialPaymentResponse {
14
11
  success: boolean;
@@ -17,7 +14,5 @@ export interface PartialPaymentResponse {
17
14
  openUI: boolean;
18
15
  order: CFOrder | null;
19
16
  timestamp: string;
20
- /** Present when the state machine blocked or forced the transition. */
21
- transitionResult?: CFTransitionResult;
22
17
  }
23
18
  export type PartialPayment = (params?: PartialPaymentParams) => Promise<PartialPaymentResponse>;
@@ -1,4 +1,3 @@
1
- import type { CFTransitionResult } from "../../common-types/order-state";
2
1
  export interface ProcessPartialRefundParams {
3
2
  /** Optional refund reason. */
4
3
  reason?: string;
@@ -16,7 +15,5 @@ export interface ProcessPartialRefundResponse {
16
15
  success: boolean;
17
16
  refundId: string;
18
17
  timestamp: string;
19
- /** Present when the state machine blocked or forced the transition. */
20
- transitionResult?: CFTransitionResult;
21
18
  }
22
19
  export type ProcessPartialRefund = (params?: ProcessPartialRefundParams) => Promise<ProcessPartialRefundResponse>;
@@ -0,0 +1,2 @@
1
+ import type { ResolveExtensionOverlay } from "./types";
2
+ export declare const resolveExtensionOverlay: ResolveExtensionOverlay;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from "../../client";
2
+ export const resolveExtensionOverlay = async (params) => {
3
+ return await commandFrameClient.call("resolveExtensionOverlay", params);
4
+ };
@@ -0,0 +1,2 @@
1
+ import type { ResolveExtensionOverlay } from "./types";
2
+ export declare const mockResolveExtensionOverlay: ResolveExtensionOverlay;
@@ -0,0 +1 @@
1
+ export const mockResolveExtensionOverlay = () => Promise.resolve({ success: true });
@@ -0,0 +1,9 @@
1
+ import type { InterceptorReturn } from "../../interceptors/types";
2
+ export interface ResolveExtensionOverlayParams {
3
+ overlayId: string;
4
+ result: InterceptorReturn;
5
+ }
6
+ export interface ResolveExtensionOverlayResponse {
7
+ success: boolean;
8
+ }
9
+ export type ResolveExtensionOverlay = (params: ResolveExtensionOverlayParams) => Promise<ResolveExtensionOverlayResponse>;