@final-commerce/command-frame 0.1.56 → 0.1.58

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 (150) hide show
  1. package/README.md +2 -6
  2. package/dist/CommonTypes.d.ts +33 -0
  3. package/dist/actions/get-active-customer/action.d.ts +2 -0
  4. package/dist/actions/get-active-customer/action.js +4 -0
  5. package/dist/actions/get-active-customer/mock.d.ts +2 -0
  6. package/dist/actions/get-active-customer/mock.js +10 -0
  7. package/dist/actions/get-active-customer/types.d.ts +7 -0
  8. package/dist/actions/get-active-order/action.d.ts +6 -0
  9. package/dist/actions/get-active-order/action.js +8 -0
  10. package/dist/actions/get-active-order/mock.d.ts +2 -0
  11. package/dist/actions/get-active-order/mock.js +11 -0
  12. package/dist/actions/get-active-order/types.d.ts +7 -0
  13. package/dist/actions/get-active-order/types.js +1 -0
  14. package/dist/actions/get-active-outlet/action.d.ts +2 -0
  15. package/dist/actions/get-active-outlet/action.js +4 -0
  16. package/dist/actions/get-active-outlet/mock.d.ts +2 -0
  17. package/dist/actions/get-active-outlet/mock.js +9 -0
  18. package/dist/actions/get-active-outlet/types.d.ts +7 -0
  19. package/dist/actions/get-active-outlet/types.js +1 -0
  20. package/dist/actions/get-active-refund/action.d.ts +2 -0
  21. package/dist/actions/get-active-refund/action.js +4 -0
  22. package/dist/actions/get-active-refund/mock.d.ts +2 -0
  23. package/dist/actions/get-active-refund/mock.js +9 -0
  24. package/dist/actions/get-active-refund/types.d.ts +7 -0
  25. package/dist/actions/get-active-refund/types.js +1 -0
  26. package/dist/actions/get-active-session/action.d.ts +2 -0
  27. package/dist/actions/get-active-session/action.js +4 -0
  28. package/dist/actions/get-active-session/mock.d.ts +2 -0
  29. package/dist/actions/get-active-session/mock.js +9 -0
  30. package/dist/actions/get-active-session/types.d.ts +7 -0
  31. package/dist/actions/get-active-session/types.js +1 -0
  32. package/dist/actions/get-active-station/action.d.ts +2 -0
  33. package/dist/actions/get-active-station/action.js +4 -0
  34. package/dist/actions/get-active-station/mock.d.ts +2 -0
  35. package/dist/actions/get-active-station/mock.js +9 -0
  36. package/dist/actions/get-active-station/types.d.ts +7 -0
  37. package/dist/actions/get-active-station/types.js +1 -0
  38. package/dist/actions/get-active-user/action.d.ts +2 -0
  39. package/dist/actions/get-active-user/action.js +4 -0
  40. package/dist/actions/get-active-user/mock.d.ts +2 -0
  41. package/dist/actions/get-active-user/mock.js +9 -0
  42. package/dist/actions/get-active-user/types.d.ts +7 -0
  43. package/dist/actions/get-active-user/types.js +1 -0
  44. package/dist/actions/set-active-customer/action.d.ts +2 -0
  45. package/dist/actions/set-active-customer/action.js +4 -0
  46. package/dist/actions/set-active-customer/mock.d.ts +2 -0
  47. package/dist/actions/set-active-customer/mock.js +16 -0
  48. package/dist/actions/set-active-customer/types.d.ts +10 -0
  49. package/dist/actions/set-active-customer/types.js +1 -0
  50. package/dist/actions/set-active-outlet/action.d.ts +2 -0
  51. package/dist/actions/set-active-outlet/action.js +4 -0
  52. package/dist/actions/set-active-outlet/mock.d.ts +2 -0
  53. package/dist/actions/set-active-outlet/mock.js +16 -0
  54. package/dist/actions/set-active-outlet/types.d.ts +10 -0
  55. package/dist/actions/set-active-outlet/types.js +1 -0
  56. package/dist/actions/set-active-refund/action.d.ts +2 -0
  57. package/dist/actions/set-active-refund/action.js +4 -0
  58. package/dist/actions/set-active-refund/mock.d.ts +2 -0
  59. package/dist/actions/set-active-refund/mock.js +12 -0
  60. package/dist/actions/set-active-refund/types.d.ts +10 -0
  61. package/dist/actions/set-active-refund/types.js +1 -0
  62. package/dist/actions/set-active-session/action.d.ts +2 -0
  63. package/dist/actions/set-active-session/action.js +4 -0
  64. package/dist/actions/set-active-session/mock.d.ts +2 -0
  65. package/dist/actions/set-active-session/mock.js +15 -0
  66. package/dist/actions/set-active-session/types.d.ts +10 -0
  67. package/dist/actions/set-active-session/types.js +1 -0
  68. package/dist/actions/set-active-station/action.d.ts +2 -0
  69. package/dist/actions/set-active-station/action.js +4 -0
  70. package/dist/actions/set-active-station/mock.d.ts +2 -0
  71. package/dist/actions/set-active-station/mock.js +16 -0
  72. package/dist/actions/set-active-station/types.d.ts +10 -0
  73. package/dist/actions/set-active-station/types.js +1 -0
  74. package/dist/actions/set-active-user/action.d.ts +2 -0
  75. package/dist/actions/set-active-user/action.js +4 -0
  76. package/dist/actions/set-active-user/mock.d.ts +2 -0
  77. package/dist/actions/set-active-user/mock.js +16 -0
  78. package/dist/actions/set-active-user/types.d.ts +10 -0
  79. package/dist/actions/set-active-user/types.js +1 -0
  80. package/dist/actions/terminal-payment/mock.js +2 -1
  81. package/dist/actions/terminal-payment/types.d.ts +2 -0
  82. package/dist/demo/database.d.ts +3 -1
  83. package/dist/demo/database.js +19 -1
  84. package/dist/index.d.ts +39 -4
  85. package/dist/index.js +30 -0
  86. package/dist/projects/render/mocks.js +26 -0
  87. package/dist/projects/render/provider.d.ts +2 -2
  88. package/dist/projects/render/types.d.ts +14 -1
  89. package/dist/pubsub/topics/customers/get-active-customer/types.d.ts +6 -0
  90. package/dist/pubsub/topics/customers/get-active-customer/types.js +1 -0
  91. package/dist/pubsub/topics/customers/index.js +10 -0
  92. package/dist/pubsub/topics/customers/set-active-customer/types.d.ts +6 -0
  93. package/dist/pubsub/topics/customers/set-active-customer/types.js +1 -0
  94. package/dist/pubsub/topics/customers/types.d.ts +6 -2
  95. package/dist/pubsub/topics/customers/types.js +2 -0
  96. package/dist/pubsub/topics/index.d.ts +4 -0
  97. package/dist/pubsub/topics/index.js +4 -0
  98. package/dist/pubsub/topics/orders/get-active-order/types.d.ts +6 -0
  99. package/dist/pubsub/topics/orders/get-active-order/types.js +1 -0
  100. package/dist/pubsub/topics/orders/index.js +10 -0
  101. package/dist/pubsub/topics/orders/set-active-order/types.d.ts +6 -0
  102. package/dist/pubsub/topics/orders/set-active-order/types.js +1 -0
  103. package/dist/pubsub/topics/orders/types.d.ts +6 -2
  104. package/dist/pubsub/topics/orders/types.js +2 -0
  105. package/dist/pubsub/topics/outlet/get-active-outlet/types.d.ts +6 -0
  106. package/dist/pubsub/topics/outlet/get-active-outlet/types.js +1 -0
  107. package/dist/pubsub/topics/outlet/index.d.ts +3 -0
  108. package/dist/pubsub/topics/outlet/index.js +18 -0
  109. package/dist/pubsub/topics/outlet/set-active-outlet/types.d.ts +6 -0
  110. package/dist/pubsub/topics/outlet/set-active-outlet/types.js +1 -0
  111. package/dist/pubsub/topics/outlet/types.d.ts +6 -0
  112. package/dist/pubsub/topics/outlet/types.js +2 -0
  113. package/dist/pubsub/topics/products/product-get-active/types.js +1 -0
  114. package/dist/pubsub/topics/products/types.d.ts +6 -2
  115. package/dist/pubsub/topics/products/types.js +2 -0
  116. package/dist/pubsub/topics/refunds/get-active-refund/types.d.ts +6 -0
  117. package/dist/pubsub/topics/refunds/get-active-refund/types.js +1 -0
  118. package/dist/pubsub/topics/refunds/index.js +10 -0
  119. package/dist/pubsub/topics/refunds/set-active-refund/types.d.ts +6 -0
  120. package/dist/pubsub/topics/refunds/set-active-refund/types.js +1 -0
  121. package/dist/pubsub/topics/refunds/types.d.ts +6 -2
  122. package/dist/pubsub/topics/refunds/types.js +2 -0
  123. package/dist/pubsub/topics/session/get-active-session/types.d.ts +6 -0
  124. package/dist/pubsub/topics/session/get-active-session/types.js +1 -0
  125. package/dist/pubsub/topics/session/index.d.ts +3 -0
  126. package/dist/pubsub/topics/session/index.js +18 -0
  127. package/dist/pubsub/topics/session/set-active-session/types.d.ts +6 -0
  128. package/dist/pubsub/topics/session/set-active-session/types.js +1 -0
  129. package/dist/pubsub/topics/session/types.d.ts +6 -0
  130. package/dist/pubsub/topics/session/types.js +2 -0
  131. package/dist/pubsub/topics/station/get-active-station/types.d.ts +6 -0
  132. package/dist/pubsub/topics/station/get-active-station/types.js +1 -0
  133. package/dist/pubsub/topics/station/index.d.ts +3 -0
  134. package/dist/pubsub/topics/station/index.js +18 -0
  135. package/dist/pubsub/topics/station/set-active-station/types.d.ts +6 -0
  136. package/dist/pubsub/topics/station/set-active-station/types.js +1 -0
  137. package/dist/pubsub/topics/station/types.d.ts +6 -0
  138. package/dist/pubsub/topics/station/types.js +2 -0
  139. package/dist/pubsub/topics/types.d.ts +8 -0
  140. package/dist/pubsub/topics/users/get-active-user/types.d.ts +6 -0
  141. package/dist/pubsub/topics/users/get-active-user/types.js +1 -0
  142. package/dist/pubsub/topics/users/index.d.ts +3 -0
  143. package/dist/pubsub/topics/users/index.js +18 -0
  144. package/dist/pubsub/topics/users/set-active-user/types.d.ts +6 -0
  145. package/dist/pubsub/topics/users/set-active-user/types.js +1 -0
  146. package/dist/pubsub/topics/users/types.d.ts +6 -0
  147. package/dist/pubsub/topics/users/types.js +2 -0
  148. package/package.json +1 -1
  149. /package/dist/{pubsub/topics/products/product-get-active/types..js → actions/get-active-customer/types.js} +0 -0
  150. /package/dist/pubsub/topics/products/product-get-active/{types..d.ts → types.d.ts} +0 -0
@@ -0,0 +1,6 @@
1
+ import type { CFSession } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface SessionActiveSetPayload {
4
+ session: CFSession;
5
+ }
6
+ export type SessionActiveSetEvent = TopicEvent<SessionActiveSetPayload>;
@@ -0,0 +1,6 @@
1
+ export * from "./set-active-session/types";
2
+ export * from "./get-active-session/types";
3
+ import type { SessionActiveSetPayload } from "./set-active-session/types";
4
+ import type { SessionActiveGetPayload } from "./get-active-session/types";
5
+ export type SessionEventPayload = SessionActiveSetPayload | SessionActiveGetPayload;
6
+ export type SessionEventType = "set-active-session" | "get-active-session";
@@ -0,0 +1,2 @@
1
+ export * from "./set-active-session/types";
2
+ export * from "./get-active-session/types";
@@ -0,0 +1,6 @@
1
+ import type { CFActiveStation } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface StationActiveGetPayload {
4
+ station: CFActiveStation | null;
5
+ }
6
+ export type StationActiveGetEvent = TopicEvent<StationActiveGetPayload>;
@@ -0,0 +1,3 @@
1
+ import type { TopicDefinition } from "../../types";
2
+ export declare const stationTopic: TopicDefinition;
3
+ export * from "./types";
@@ -0,0 +1,18 @@
1
+ export const stationTopic = {
2
+ id: "station",
3
+ name: "Station",
4
+ description: "Topic for active station context in the POS",
5
+ eventTypes: [
6
+ {
7
+ id: "set-active-station",
8
+ name: "Set Active Station",
9
+ description: "Published when the active station is set"
10
+ },
11
+ {
12
+ id: "get-active-station",
13
+ name: "Get Active Station",
14
+ description: "Published when the active station is published to listeners"
15
+ }
16
+ ]
17
+ };
18
+ export * from "./types";
@@ -0,0 +1,6 @@
1
+ import type { CFActiveStation } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface StationActiveSetPayload {
4
+ station: CFActiveStation;
5
+ }
6
+ export type StationActiveSetEvent = TopicEvent<StationActiveSetPayload>;
@@ -0,0 +1,6 @@
1
+ export * from "./set-active-station/types";
2
+ export * from "./get-active-station/types";
3
+ import type { StationActiveSetPayload } from "./set-active-station/types";
4
+ import type { StationActiveGetPayload } from "./get-active-station/types";
5
+ export type StationEventPayload = StationActiveSetPayload | StationActiveGetPayload;
6
+ export type StationEventType = "set-active-station" | "get-active-station";
@@ -0,0 +1,2 @@
1
+ export * from "./set-active-station/types";
2
+ export * from "./get-active-station/types";
@@ -6,6 +6,10 @@ import { CartEventType, CartEventPayload } from "./cart/types";
6
6
  import { PaymentsEventType, PaymentsEventPayload } from "./payments/types";
7
7
  import { CustomTablesEventPayload, CustomTablesEventType } from "./custom-tables/types";
8
8
  import { PrintEventType, PrintEventPayload } from "./print/types";
9
+ import { OutletEventType, OutletEventPayload } from "./outlet/types";
10
+ import { StationEventType, StationEventPayload } from "./station/types";
11
+ import { SessionEventType, SessionEventPayload } from "./session/types";
12
+ import { UsersEventType, UsersEventPayload } from "./users/types";
9
13
  export interface TopicEventPayloadMap {
10
14
  customers: Record<CustomersEventType, CustomersEventPayload>;
11
15
  orders: Record<OrdersEventType, OrdersEventPayload>;
@@ -15,4 +19,8 @@ export interface TopicEventPayloadMap {
15
19
  payments: Record<PaymentsEventType, PaymentsEventPayload>;
16
20
  customTables: Record<CustomTablesEventType, CustomTablesEventPayload>;
17
21
  print: Record<PrintEventType, PrintEventPayload>;
22
+ outlet: Record<OutletEventType, OutletEventPayload>;
23
+ station: Record<StationEventType, StationEventPayload>;
24
+ session: Record<SessionEventType, SessionEventPayload>;
25
+ users: Record<UsersEventType, UsersEventPayload>;
18
26
  }
@@ -0,0 +1,6 @@
1
+ import type { CFActiveUser } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface UserActiveGetPayload {
4
+ user: CFActiveUser | null;
5
+ }
6
+ export type UserActiveGetEvent = TopicEvent<UserActiveGetPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { TopicDefinition } from "../../types";
2
+ export declare const usersTopic: TopicDefinition;
3
+ export * from "./types";
@@ -0,0 +1,18 @@
1
+ export const usersTopic = {
2
+ id: "users",
3
+ name: "Users",
4
+ description: "Topic for active POS user (employee) context",
5
+ eventTypes: [
6
+ {
7
+ id: "set-active-user",
8
+ name: "Set Active User",
9
+ description: "Published when the active user is set"
10
+ },
11
+ {
12
+ id: "get-active-user",
13
+ name: "Get Active User",
14
+ description: "Published when the active user is published to listeners"
15
+ }
16
+ ]
17
+ };
18
+ export * from "./types";
@@ -0,0 +1,6 @@
1
+ import type { CFActiveUser } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface UserActiveSetPayload {
4
+ user: CFActiveUser;
5
+ }
6
+ export type UserActiveSetEvent = TopicEvent<UserActiveSetPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from "./set-active-user/types";
2
+ export * from "./get-active-user/types";
3
+ import type { UserActiveSetPayload } from "./set-active-user/types";
4
+ import type { UserActiveGetPayload } from "./get-active-user/types";
5
+ export type UsersEventPayload = UserActiveSetPayload | UserActiveGetPayload;
6
+ export type UsersEventType = "set-active-user" | "get-active-user";
@@ -0,0 +1,2 @@
1
+ export * from "./set-active-user/types";
2
+ export * from "./get-active-user/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",