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

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 (101) hide show
  1. package/README.md +26 -28
  2. package/dist/CommonTypes.d.ts +118 -19
  3. package/dist/actions/add-customer-note/mock.js +27 -18
  4. package/dist/actions/add-customer-note/types.d.ts +3 -2
  5. package/dist/actions/add-product/mock.js +11 -5
  6. package/dist/actions/can-transition/action.d.ts +2 -0
  7. package/dist/actions/can-transition/action.js +4 -0
  8. package/dist/actions/can-transition/mock.d.ts +6 -0
  9. package/dist/actions/can-transition/mock.js +28 -0
  10. package/dist/actions/can-transition/types.d.ts +11 -0
  11. package/dist/actions/can-transition/types.js +1 -0
  12. package/dist/actions/cash-payment/types.d.ts +5 -0
  13. package/dist/actions/delete-parked-order/types.d.ts +3 -0
  14. package/dist/actions/edit-product/mock.js +4 -2
  15. package/dist/actions/extension-payment/types.d.ts +5 -0
  16. package/dist/actions/get-available-transitions/action.d.ts +2 -0
  17. package/dist/actions/get-available-transitions/action.js +4 -0
  18. package/dist/actions/get-available-transitions/mock.d.ts +6 -0
  19. package/dist/actions/get-available-transitions/mock.js +26 -0
  20. package/dist/actions/get-available-transitions/types.d.ts +9 -0
  21. package/dist/actions/get-available-transitions/types.js +1 -0
  22. package/dist/actions/get-context/mock.js +12 -6
  23. package/dist/actions/initiate-refund/types.d.ts +3 -0
  24. package/dist/actions/park-order/types.d.ts +3 -0
  25. package/dist/actions/partial-payment/types.d.ts +5 -0
  26. package/dist/actions/print/mock.js +3 -6
  27. package/dist/actions/print/types.d.ts +1 -7
  28. package/dist/actions/process-partial-refund/types.d.ts +3 -0
  29. package/dist/actions/remove-customer-note/mock.js +16 -7
  30. package/dist/actions/resume-parked-order/types.d.ts +3 -0
  31. package/dist/actions/tap-to-pay-payment/types.d.ts +5 -0
  32. package/dist/actions/terminal-payment/types.d.ts +5 -0
  33. package/dist/actions/vendara-payment/types.d.ts +5 -0
  34. package/dist/common-types/index.d.ts +1 -0
  35. package/dist/common-types/index.js +1 -0
  36. package/dist/common-types/order-state.d.ts +32 -0
  37. package/dist/common-types/order-state.js +6 -0
  38. package/dist/common-types/state-fragment.d.ts +77 -0
  39. package/dist/common-types/state-fragment.js +10 -0
  40. package/dist/demo/database.js +18 -24
  41. package/dist/fragments/index.d.ts +1 -0
  42. package/dist/fragments/index.js +1 -0
  43. package/dist/fragments/preorder-no-deposit.d.ts +26 -0
  44. package/dist/fragments/preorder-no-deposit.js +166 -0
  45. package/dist/index.d.ts +17 -2
  46. package/dist/index.js +12 -0
  47. package/dist/projects/render/mocks.js +5 -1
  48. package/dist/projects/render/types.d.ts +3 -1
  49. package/dist/pubsub/topics/attributes/attribute-created/types.d.ts +6 -0
  50. package/dist/pubsub/topics/attributes/attribute-created/types.js +1 -0
  51. package/dist/pubsub/topics/attributes/attribute-updated/types.d.ts +6 -0
  52. package/dist/pubsub/topics/attributes/attribute-updated/types.js +1 -0
  53. package/dist/pubsub/topics/attributes/index.d.ts +3 -0
  54. package/dist/pubsub/topics/attributes/index.js +18 -0
  55. package/dist/pubsub/topics/attributes/types.d.ts +6 -0
  56. package/dist/pubsub/topics/attributes/types.js +2 -0
  57. package/dist/pubsub/topics/categories/category-created/types.d.ts +6 -0
  58. package/dist/pubsub/topics/categories/category-created/types.js +1 -0
  59. package/dist/pubsub/topics/categories/category-updated/types.d.ts +6 -0
  60. package/dist/pubsub/topics/categories/category-updated/types.js +1 -0
  61. package/dist/pubsub/topics/categories/index.d.ts +3 -0
  62. package/dist/pubsub/topics/categories/index.js +18 -0
  63. package/dist/pubsub/topics/categories/types.d.ts +6 -0
  64. package/dist/pubsub/topics/categories/types.js +2 -0
  65. package/dist/pubsub/topics/index.d.ts +4 -0
  66. package/dist/pubsub/topics/index.js +4 -0
  67. package/dist/pubsub/topics/orders/index.js +10 -0
  68. package/dist/pubsub/topics/orders/state-transition-blocked/types.d.ts +16 -0
  69. package/dist/pubsub/topics/orders/state-transition-blocked/types.js +1 -0
  70. package/dist/pubsub/topics/orders/state-transition-completed/types.d.ts +15 -0
  71. package/dist/pubsub/topics/orders/state-transition-completed/types.js +1 -0
  72. package/dist/pubsub/topics/orders/types.d.ts +6 -2
  73. package/dist/pubsub/topics/orders/types.js +2 -0
  74. package/dist/pubsub/topics/print/print-completed/types.d.ts +1 -1
  75. package/dist/pubsub/topics/print/print-error/types.d.ts +1 -1
  76. package/dist/pubsub/topics/print/print-started/types.d.ts +1 -1
  77. package/dist/pubsub/topics/transactions/index.d.ts +3 -0
  78. package/dist/pubsub/topics/transactions/index.js +18 -0
  79. package/dist/pubsub/topics/transactions/transaction-created/types.d.ts +6 -0
  80. package/dist/pubsub/topics/transactions/transaction-created/types.js +1 -0
  81. package/dist/pubsub/topics/transactions/transaction-updated/types.d.ts +6 -0
  82. package/dist/pubsub/topics/transactions/transaction-updated/types.js +1 -0
  83. package/dist/pubsub/topics/transactions/types.d.ts +6 -0
  84. package/dist/pubsub/topics/transactions/types.js +2 -0
  85. package/dist/pubsub/topics/types.d.ts +8 -0
  86. package/dist/pubsub/topics/users/index.js +10 -0
  87. package/dist/pubsub/topics/users/types.d.ts +6 -2
  88. package/dist/pubsub/topics/users/types.js +2 -0
  89. package/dist/pubsub/topics/users/user-created/types.d.ts +6 -0
  90. package/dist/pubsub/topics/users/user-created/types.js +1 -0
  91. package/dist/pubsub/topics/users/user-updated/types.d.ts +6 -0
  92. package/dist/pubsub/topics/users/user-updated/types.js +1 -0
  93. package/dist/pubsub/topics/variants/index.d.ts +3 -0
  94. package/dist/pubsub/topics/variants/index.js +18 -0
  95. package/dist/pubsub/topics/variants/types.d.ts +6 -0
  96. package/dist/pubsub/topics/variants/types.js +2 -0
  97. package/dist/pubsub/topics/variants/variant-created/types.d.ts +6 -0
  98. package/dist/pubsub/topics/variants/variant-created/types.js +1 -0
  99. package/dist/pubsub/topics/variants/variant-updated/types.d.ts +6 -0
  100. package/dist/pubsub/topics/variants/variant-updated/types.js +1 -0
  101. package/package.json +1 -1
@@ -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
- export type UsersEventPayload = UserActiveSetPayload | UserActiveGetPayload;
6
- export type UsersEventType = "set-active-user" | "get-active-user";
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";
@@ -1,2 +1,4 @@
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";
@@ -0,0 +1,6 @@
1
+ import type { CFActiveUser } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface UserCreatedPayload {
4
+ user: CFActiveUser;
5
+ }
6
+ export type UserCreatedEvent = TopicEvent<UserCreatedPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { CFActiveUser } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface UserUpdatedPayload {
4
+ user: CFActiveUser;
5
+ }
6
+ export type UserUpdatedEvent = TopicEvent<UserUpdatedPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { TopicDefinition } from "../../types";
2
+ export declare const variantsTopic: TopicDefinition;
3
+ export * from "./types";
@@ -0,0 +1,18 @@
1
+ export const variantsTopic = {
2
+ id: "variants",
3
+ name: "Variants",
4
+ description: "Topic for product variant changes synced from the database",
5
+ eventTypes: [
6
+ {
7
+ id: "variant-created",
8
+ name: "Variant Created",
9
+ description: "Published when a new product variant is synced/created"
10
+ },
11
+ {
12
+ id: "variant-updated",
13
+ name: "Variant Updated",
14
+ description: "Published when a product variant is synced/updated"
15
+ }
16
+ ]
17
+ };
18
+ export * from "./types";
@@ -0,0 +1,6 @@
1
+ export * from "./variant-created/types";
2
+ export * from "./variant-updated/types";
3
+ import type { VariantCreatedPayload } from "./variant-created/types";
4
+ import type { VariantUpdatedPayload } from "./variant-updated/types";
5
+ export type VariantsEventPayload = VariantCreatedPayload | VariantUpdatedPayload;
6
+ export type VariantsEventType = "variant-created" | "variant-updated";
@@ -0,0 +1,2 @@
1
+ export * from "./variant-created/types";
2
+ export * from "./variant-updated/types";
@@ -0,0 +1,6 @@
1
+ import type { CFProductVariant } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface VariantCreatedPayload {
4
+ variant: CFProductVariant;
5
+ }
6
+ export type VariantCreatedEvent = TopicEvent<VariantCreatedPayload>;
@@ -0,0 +1,6 @@
1
+ import type { CFProductVariant } from "../../../../CommonTypes";
2
+ import type { TopicEvent } from "../../../types";
3
+ export interface VariantUpdatedPayload {
4
+ variant: CFProductVariant;
5
+ }
6
+ export type VariantUpdatedEvent = TopicEvent<VariantUpdatedPayload>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.63",
3
+ "version": "0.2.0-beta.6",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",