@almadar/std 5.0.0 → 5.2.0

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 (421) hide show
  1. package/behaviors/exports/atoms/std-agent-activity-log.orb +5 -45
  2. package/behaviors/exports/atoms/std-agent-chat-thread.orb +5 -55
  3. package/behaviors/exports/atoms/std-agent-classifier.orb +8 -8
  4. package/behaviors/exports/atoms/std-agent-completion.orb +8 -8
  5. package/behaviors/exports/atoms/std-agent-context-window.orb +5 -4
  6. package/behaviors/exports/atoms/std-agent-conversation.orb +5 -71
  7. package/behaviors/exports/atoms/std-agent-memory.orb +13 -127
  8. package/behaviors/exports/atoms/std-agent-provider.orb +8 -8
  9. package/behaviors/exports/atoms/std-agent-search.orb +6 -27
  10. package/behaviors/exports/atoms/std-agent-session.orb +11 -85
  11. package/behaviors/exports/atoms/std-agent-step-progress.orb +5 -4
  12. package/behaviors/exports/atoms/std-agent-token-gauge.orb +5 -4
  13. package/behaviors/exports/atoms/std-agent-tool-call.orb +8 -8
  14. package/behaviors/exports/atoms/std-async.orb +5 -8
  15. package/behaviors/exports/atoms/std-autoregressive.orb +4 -2
  16. package/behaviors/exports/atoms/std-browse.orb +5 -4
  17. package/behaviors/exports/atoms/std-cache-aside.orb +5 -8
  18. package/behaviors/exports/atoms/std-calendar.orb +5 -4
  19. package/behaviors/exports/atoms/std-circuit-breaker.orb +5 -4
  20. package/behaviors/exports/atoms/std-collision.orb +5 -4
  21. package/behaviors/exports/atoms/std-combat-log.orb +5 -4
  22. package/behaviors/exports/atoms/std-combat.orb +5 -4
  23. package/behaviors/exports/atoms/std-confirmation.orb +10 -4
  24. package/behaviors/exports/atoms/std-dialogue-box.orb +5 -4
  25. package/behaviors/exports/atoms/std-display.orb +5 -4
  26. package/behaviors/exports/atoms/std-drawer.orb +5 -4
  27. package/behaviors/exports/atoms/std-filter.orb +5 -4
  28. package/behaviors/exports/atoms/std-flip-card.orb +5 -4
  29. package/behaviors/exports/atoms/std-gallery.orb +5 -4
  30. package/behaviors/exports/atoms/std-game-audio.orb +5 -4
  31. package/behaviors/exports/atoms/std-game-canvas2d.orb +4 -2
  32. package/behaviors/exports/atoms/std-game-canvas3d.orb +4 -2
  33. package/behaviors/exports/atoms/std-game-hud.orb +5 -4
  34. package/behaviors/exports/atoms/std-game-menu.orb +5 -4
  35. package/behaviors/exports/atoms/std-game-over-screen.orb +5 -4
  36. package/behaviors/exports/atoms/std-gameflow.orb +5 -4
  37. package/behaviors/exports/atoms/std-input.orb +5 -4
  38. package/behaviors/exports/atoms/std-inventory-panel.orb +5 -8
  39. package/behaviors/exports/atoms/std-isometric-canvas.orb +5 -4
  40. package/behaviors/exports/atoms/std-loading.orb +5 -4
  41. package/behaviors/exports/atoms/std-modal.orb +89 -4
  42. package/behaviors/exports/atoms/std-movement.orb +5 -4
  43. package/behaviors/exports/atoms/std-notification.orb +5 -4
  44. package/behaviors/exports/atoms/std-overworld.orb +5 -4
  45. package/behaviors/exports/atoms/std-pagination.orb +5 -4
  46. package/behaviors/exports/atoms/std-physics2d.orb +5 -4
  47. package/behaviors/exports/atoms/std-platformer-canvas.orb +5 -4
  48. package/behaviors/exports/atoms/std-quest.orb +5 -8
  49. package/behaviors/exports/atoms/std-rate-limiter.orb +5 -4
  50. package/behaviors/exports/atoms/std-rating.orb +5 -4
  51. package/behaviors/exports/atoms/std-score-board.orb +5 -4
  52. package/behaviors/exports/atoms/std-score.orb +5 -4
  53. package/behaviors/exports/atoms/std-search.orb +5 -4
  54. package/behaviors/exports/atoms/std-selection.orb +5 -4
  55. package/behaviors/exports/atoms/std-service-custom-bearer.orb +5 -15
  56. package/behaviors/exports/atoms/std-service-custom-header.orb +5 -17
  57. package/behaviors/exports/atoms/std-service-custom-noauth.orb +5 -11
  58. package/behaviors/exports/atoms/std-service-custom-query.orb +5 -17
  59. package/behaviors/exports/atoms/std-service-email.orb +5 -4
  60. package/behaviors/exports/atoms/std-service-github.orb +5 -4
  61. package/behaviors/exports/atoms/std-service-llm.orb +5 -4
  62. package/behaviors/exports/atoms/std-service-oauth.orb +5 -4
  63. package/behaviors/exports/atoms/std-service-redis.orb +5 -4
  64. package/behaviors/exports/atoms/std-service-storage.orb +5 -4
  65. package/behaviors/exports/atoms/std-service-stripe.orb +5 -4
  66. package/behaviors/exports/atoms/std-service-twilio.orb +5 -4
  67. package/behaviors/exports/atoms/std-service-youtube.orb +5 -4
  68. package/behaviors/exports/atoms/std-simulation-canvas.orb +5 -4
  69. package/behaviors/exports/atoms/std-sort.orb +5 -4
  70. package/behaviors/exports/atoms/std-sprite.orb +5 -4
  71. package/behaviors/exports/atoms/std-tabs.orb +5 -4
  72. package/behaviors/exports/atoms/std-text-effects.orb +5 -4
  73. package/behaviors/exports/atoms/std-theme.orb +5 -4
  74. package/behaviors/exports/atoms/std-timer.orb +5 -4
  75. package/behaviors/exports/atoms/std-undo.orb +5 -4
  76. package/behaviors/exports/atoms/std-upload.orb +5 -4
  77. package/behaviors/exports/atoms/std-validate-on-save.orb +5 -32
  78. package/behaviors/exports/atoms/std-wizard.orb +5 -4
  79. package/behaviors/exports/molecules/std-agent-fix-loop.orb +1141 -1709
  80. package/behaviors/exports/molecules/std-agent-learner.orb +608 -938
  81. package/behaviors/exports/molecules/std-agent-planner.orb +613 -961
  82. package/behaviors/exports/molecules/std-agent-rag.orb +586 -915
  83. package/behaviors/exports/molecules/std-agent-tool-loop.orb +915 -2846
  84. package/behaviors/exports/molecules/std-builder-game.orb +5 -4
  85. package/behaviors/exports/molecules/std-cart.orb +196 -307
  86. package/behaviors/exports/molecules/std-classifier-game.orb +5 -4
  87. package/behaviors/exports/molecules/std-debugger-game.orb +5 -4
  88. package/behaviors/exports/molecules/std-detail.orb +309 -467
  89. package/behaviors/exports/molecules/std-event-handler-game.orb +5 -4
  90. package/behaviors/exports/molecules/std-form-advanced.orb +5 -8
  91. package/behaviors/exports/molecules/std-geospatial.orb +363 -539
  92. package/behaviors/exports/molecules/std-inventory.orb +390 -720
  93. package/behaviors/exports/molecules/std-list.orb +526 -1156
  94. package/behaviors/exports/molecules/std-messaging.orb +295 -452
  95. package/behaviors/exports/molecules/std-negotiator-game.orb +5 -4
  96. package/behaviors/exports/molecules/std-platformer-game.orb +5 -4
  97. package/behaviors/exports/molecules/std-puzzle-game.orb +5 -4
  98. package/behaviors/exports/molecules/std-quiz.orb +5 -4
  99. package/behaviors/exports/molecules/std-sequencer-game.orb +5 -4
  100. package/behaviors/exports/molecules/std-service-content-pipeline.orb +5 -4
  101. package/behaviors/exports/molecules/std-service-custom-api-tester.orb +5 -42
  102. package/behaviors/exports/molecules/std-service-devops-toolkit.orb +5 -4
  103. package/behaviors/exports/molecules/std-service-notification-hub.orb +5 -4
  104. package/behaviors/exports/molecules/std-service-payment-flow.orb +5 -4
  105. package/behaviors/exports/molecules/std-simulator-game.orb +5 -4
  106. package/behaviors/exports/molecules/std-turn-based-battle.orb +5 -4
  107. package/behaviors/exports/organisms/std-agent-assistant.orb +15 -143
  108. package/behaviors/exports/organisms/std-agent-builder.orb +814 -1476
  109. package/behaviors/exports/organisms/std-agent-pipeline.orb +785 -1567
  110. package/behaviors/exports/organisms/std-agent-reviewer.orb +299 -502
  111. package/behaviors/exports/organisms/std-agent-tutor.orb +306 -493
  112. package/behaviors/exports/organisms/std-api-gateway.orb +284 -626
  113. package/behaviors/exports/organisms/std-arcade-game.orb +4 -4
  114. package/behaviors/exports/organisms/std-booking-system.orb +1422 -2160
  115. package/behaviors/exports/organisms/std-cicd-pipeline.orb +274 -617
  116. package/behaviors/exports/organisms/std-cms.orb +1274 -1972
  117. package/behaviors/exports/organisms/std-coding-academy.orb +4 -4
  118. package/behaviors/exports/organisms/std-crm.orb +999 -1775
  119. package/behaviors/exports/organisms/std-devops-dashboard.orb +284 -638
  120. package/behaviors/exports/organisms/std-ecommerce.orb +1653 -2398
  121. package/behaviors/exports/organisms/std-finance-tracker.orb +340 -684
  122. package/behaviors/exports/organisms/std-healthcare.orb +984 -1838
  123. package/behaviors/exports/organisms/std-helpdesk.orb +340 -744
  124. package/behaviors/exports/organisms/std-hr-portal.orb +1401 -2151
  125. package/behaviors/exports/organisms/std-iot-dashboard.orb +284 -626
  126. package/behaviors/exports/organisms/std-lms.orb +284 -632
  127. package/behaviors/exports/organisms/std-logic-training.orb +4 -4
  128. package/behaviors/exports/organisms/std-platformer-app.orb +15 -98
  129. package/behaviors/exports/organisms/std-project-manager.orb +970 -1774
  130. package/behaviors/exports/organisms/std-puzzle-app.orb +4 -4
  131. package/behaviors/exports/organisms/std-realtime-chat.orb +364 -714
  132. package/behaviors/exports/organisms/std-rpg-game.orb +15 -102
  133. package/behaviors/exports/organisms/std-service-marketplace.orb +1589 -2361
  134. package/behaviors/exports/organisms/std-service-research-assistant.orb +4 -15
  135. package/behaviors/exports/organisms/std-social-feed.orb +62 -66
  136. package/behaviors/exports/organisms/std-stem-lab.orb +4 -4
  137. package/behaviors/exports/organisms/std-strategy-game.orb +4 -4
  138. package/behaviors/exports/organisms/std-trading-dashboard.orb +274 -620
  139. package/dist/behaviors/exports/atoms/std-agent-activity-log.orb +5 -45
  140. package/dist/behaviors/exports/atoms/std-agent-chat-thread.orb +5 -55
  141. package/dist/behaviors/exports/atoms/std-agent-classifier.orb +8 -8
  142. package/dist/behaviors/exports/atoms/std-agent-completion.orb +8 -8
  143. package/dist/behaviors/exports/atoms/std-agent-context-window.orb +5 -4
  144. package/dist/behaviors/exports/atoms/std-agent-conversation.orb +5 -71
  145. package/dist/behaviors/exports/atoms/std-agent-memory.orb +13 -127
  146. package/dist/behaviors/exports/atoms/std-agent-provider.orb +8 -8
  147. package/dist/behaviors/exports/atoms/std-agent-search.orb +6 -27
  148. package/dist/behaviors/exports/atoms/std-agent-session.orb +11 -85
  149. package/dist/behaviors/exports/atoms/std-agent-step-progress.orb +5 -4
  150. package/dist/behaviors/exports/atoms/std-agent-token-gauge.orb +5 -4
  151. package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +8 -8
  152. package/dist/behaviors/exports/atoms/std-async.orb +5 -8
  153. package/dist/behaviors/exports/atoms/std-autoregressive.orb +4 -2
  154. package/dist/behaviors/exports/atoms/std-browse.orb +5 -4
  155. package/dist/behaviors/exports/atoms/std-cache-aside.orb +5 -8
  156. package/dist/behaviors/exports/atoms/std-calendar.orb +5 -4
  157. package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +5 -4
  158. package/dist/behaviors/exports/atoms/std-collision.orb +5 -4
  159. package/dist/behaviors/exports/atoms/std-combat-log.orb +5 -4
  160. package/dist/behaviors/exports/atoms/std-combat.orb +5 -4
  161. package/dist/behaviors/exports/atoms/std-confirmation.orb +10 -4
  162. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +5 -4
  163. package/dist/behaviors/exports/atoms/std-display.orb +5 -4
  164. package/dist/behaviors/exports/atoms/std-drawer.orb +5 -4
  165. package/dist/behaviors/exports/atoms/std-filter.orb +5 -4
  166. package/dist/behaviors/exports/atoms/std-flip-card.orb +5 -4
  167. package/dist/behaviors/exports/atoms/std-gallery.orb +5 -4
  168. package/dist/behaviors/exports/atoms/std-game-audio.orb +5 -4
  169. package/dist/behaviors/exports/atoms/std-game-canvas2d.orb +4 -2
  170. package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +4 -2
  171. package/dist/behaviors/exports/atoms/std-game-hud.orb +5 -4
  172. package/dist/behaviors/exports/atoms/std-game-menu.orb +5 -4
  173. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +5 -4
  174. package/dist/behaviors/exports/atoms/std-gameflow.orb +5 -4
  175. package/dist/behaviors/exports/atoms/std-input.orb +5 -4
  176. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +5 -8
  177. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +5 -4
  178. package/dist/behaviors/exports/atoms/std-loading.orb +5 -4
  179. package/dist/behaviors/exports/atoms/std-modal.orb +89 -4
  180. package/dist/behaviors/exports/atoms/std-movement.orb +5 -4
  181. package/dist/behaviors/exports/atoms/std-notification.orb +5 -4
  182. package/dist/behaviors/exports/atoms/std-overworld.orb +5 -4
  183. package/dist/behaviors/exports/atoms/std-pagination.orb +5 -4
  184. package/dist/behaviors/exports/atoms/std-physics2d.orb +5 -4
  185. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +5 -4
  186. package/dist/behaviors/exports/atoms/std-quest.orb +5 -8
  187. package/dist/behaviors/exports/atoms/std-rate-limiter.orb +5 -4
  188. package/dist/behaviors/exports/atoms/std-rating.orb +5 -4
  189. package/dist/behaviors/exports/atoms/std-score-board.orb +5 -4
  190. package/dist/behaviors/exports/atoms/std-score.orb +5 -4
  191. package/dist/behaviors/exports/atoms/std-search.orb +5 -4
  192. package/dist/behaviors/exports/atoms/std-selection.orb +5 -4
  193. package/dist/behaviors/exports/atoms/std-service-custom-bearer.orb +5 -15
  194. package/dist/behaviors/exports/atoms/std-service-custom-header.orb +5 -17
  195. package/dist/behaviors/exports/atoms/std-service-custom-noauth.orb +5 -11
  196. package/dist/behaviors/exports/atoms/std-service-custom-query.orb +5 -17
  197. package/dist/behaviors/exports/atoms/std-service-email.orb +5 -4
  198. package/dist/behaviors/exports/atoms/std-service-github.orb +5 -4
  199. package/dist/behaviors/exports/atoms/std-service-llm.orb +5 -4
  200. package/dist/behaviors/exports/atoms/std-service-oauth.orb +5 -4
  201. package/dist/behaviors/exports/atoms/std-service-redis.orb +5 -4
  202. package/dist/behaviors/exports/atoms/std-service-storage.orb +5 -4
  203. package/dist/behaviors/exports/atoms/std-service-stripe.orb +5 -4
  204. package/dist/behaviors/exports/atoms/std-service-twilio.orb +5 -4
  205. package/dist/behaviors/exports/atoms/std-service-youtube.orb +5 -4
  206. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +5 -4
  207. package/dist/behaviors/exports/atoms/std-sort.orb +5 -4
  208. package/dist/behaviors/exports/atoms/std-sprite.orb +5 -4
  209. package/dist/behaviors/exports/atoms/std-tabs.orb +5 -4
  210. package/dist/behaviors/exports/atoms/std-text-effects.orb +5 -4
  211. package/dist/behaviors/exports/atoms/std-theme.orb +5 -4
  212. package/dist/behaviors/exports/atoms/std-timer.orb +5 -4
  213. package/dist/behaviors/exports/atoms/std-undo.orb +5 -4
  214. package/dist/behaviors/exports/atoms/std-upload.orb +5 -4
  215. package/dist/behaviors/exports/atoms/std-validate-on-save.orb +5 -32
  216. package/dist/behaviors/exports/atoms/std-wizard.orb +5 -4
  217. package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +1141 -1709
  218. package/dist/behaviors/exports/molecules/std-agent-learner.orb +608 -938
  219. package/dist/behaviors/exports/molecules/std-agent-planner.orb +613 -961
  220. package/dist/behaviors/exports/molecules/std-agent-rag.orb +586 -915
  221. package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +915 -2846
  222. package/dist/behaviors/exports/molecules/std-builder-game.orb +5 -4
  223. package/dist/behaviors/exports/molecules/std-cart.orb +196 -307
  224. package/dist/behaviors/exports/molecules/std-classifier-game.orb +5 -4
  225. package/dist/behaviors/exports/molecules/std-debugger-game.orb +5 -4
  226. package/dist/behaviors/exports/molecules/std-detail.orb +309 -467
  227. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +5 -4
  228. package/dist/behaviors/exports/molecules/std-form-advanced.orb +5 -8
  229. package/dist/behaviors/exports/molecules/std-geospatial.orb +363 -539
  230. package/dist/behaviors/exports/molecules/std-inventory.orb +390 -720
  231. package/dist/behaviors/exports/molecules/std-list.orb +526 -1156
  232. package/dist/behaviors/exports/molecules/std-messaging.orb +295 -452
  233. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +5 -4
  234. package/dist/behaviors/exports/molecules/std-platformer-game.orb +5 -4
  235. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +5 -4
  236. package/dist/behaviors/exports/molecules/std-quiz.orb +5 -4
  237. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +5 -4
  238. package/dist/behaviors/exports/molecules/std-service-content-pipeline.orb +5 -4
  239. package/dist/behaviors/exports/molecules/std-service-custom-api-tester.orb +5 -42
  240. package/dist/behaviors/exports/molecules/std-service-devops-toolkit.orb +5 -4
  241. package/dist/behaviors/exports/molecules/std-service-notification-hub.orb +5 -4
  242. package/dist/behaviors/exports/molecules/std-service-payment-flow.orb +5 -4
  243. package/dist/behaviors/exports/molecules/std-simulator-game.orb +5 -4
  244. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +5 -4
  245. package/dist/behaviors/exports/organisms/std-agent-assistant.orb +15 -143
  246. package/dist/behaviors/exports/organisms/std-agent-builder.orb +814 -1476
  247. package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +785 -1567
  248. package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +299 -502
  249. package/dist/behaviors/exports/organisms/std-agent-tutor.orb +306 -493
  250. package/dist/behaviors/exports/organisms/std-api-gateway.orb +284 -626
  251. package/dist/behaviors/exports/organisms/std-arcade-game.orb +4 -4
  252. package/dist/behaviors/exports/organisms/std-booking-system.orb +1422 -2160
  253. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +274 -617
  254. package/dist/behaviors/exports/organisms/std-cms.orb +1274 -1972
  255. package/dist/behaviors/exports/organisms/std-coding-academy.orb +4 -4
  256. package/dist/behaviors/exports/organisms/std-crm.orb +999 -1775
  257. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +284 -638
  258. package/dist/behaviors/exports/organisms/std-ecommerce.orb +1653 -2398
  259. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +340 -684
  260. package/dist/behaviors/exports/organisms/std-healthcare.orb +984 -1838
  261. package/dist/behaviors/exports/organisms/std-helpdesk.orb +340 -744
  262. package/dist/behaviors/exports/organisms/std-hr-portal.orb +1401 -2151
  263. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +284 -626
  264. package/dist/behaviors/exports/organisms/std-lms.orb +284 -632
  265. package/dist/behaviors/exports/organisms/std-logic-training.orb +4 -4
  266. package/dist/behaviors/exports/organisms/std-platformer-app.orb +15 -98
  267. package/dist/behaviors/exports/organisms/std-project-manager.orb +970 -1774
  268. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +4 -4
  269. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +364 -714
  270. package/dist/behaviors/exports/organisms/std-rpg-game.orb +15 -102
  271. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +1589 -2361
  272. package/dist/behaviors/exports/organisms/std-service-research-assistant.orb +4 -15
  273. package/dist/behaviors/exports/organisms/std-social-feed.orb +62 -66
  274. package/dist/behaviors/exports/organisms/std-stem-lab.orb +4 -4
  275. package/dist/behaviors/exports/organisms/std-strategy-game.orb +4 -4
  276. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +274 -620
  277. package/dist/behaviors/exports-reader.js.map +1 -1
  278. package/dist/behaviors/functions/index.d.ts +2192 -0
  279. package/dist/behaviors/functions/index.js.map +1 -1
  280. package/dist/behaviors/index.js.map +1 -1
  281. package/dist/behaviors/query.js.map +1 -1
  282. package/dist/exports/atoms/std-agent-activity-log.orb +5 -45
  283. package/dist/exports/atoms/std-agent-chat-thread.orb +5 -55
  284. package/dist/exports/atoms/std-agent-classifier.orb +8 -8
  285. package/dist/exports/atoms/std-agent-completion.orb +8 -8
  286. package/dist/exports/atoms/std-agent-context-window.orb +5 -4
  287. package/dist/exports/atoms/std-agent-conversation.orb +5 -71
  288. package/dist/exports/atoms/std-agent-memory.orb +13 -127
  289. package/dist/exports/atoms/std-agent-provider.orb +8 -8
  290. package/dist/exports/atoms/std-agent-search.orb +6 -27
  291. package/dist/exports/atoms/std-agent-session.orb +11 -85
  292. package/dist/exports/atoms/std-agent-step-progress.orb +5 -4
  293. package/dist/exports/atoms/std-agent-token-gauge.orb +5 -4
  294. package/dist/exports/atoms/std-agent-tool-call.orb +8 -8
  295. package/dist/exports/atoms/std-async.orb +5 -8
  296. package/dist/exports/atoms/std-autoregressive.orb +4 -2
  297. package/dist/exports/atoms/std-browse.orb +5 -4
  298. package/dist/exports/atoms/std-cache-aside.orb +5 -8
  299. package/dist/exports/atoms/std-calendar.orb +5 -4
  300. package/dist/exports/atoms/std-circuit-breaker.orb +5 -4
  301. package/dist/exports/atoms/std-collision.orb +5 -4
  302. package/dist/exports/atoms/std-combat-log.orb +5 -4
  303. package/dist/exports/atoms/std-combat.orb +5 -4
  304. package/dist/exports/atoms/std-confirmation.orb +10 -4
  305. package/dist/exports/atoms/std-dialogue-box.orb +5 -4
  306. package/dist/exports/atoms/std-display.orb +5 -4
  307. package/dist/exports/atoms/std-drawer.orb +5 -4
  308. package/dist/exports/atoms/std-filter.orb +5 -4
  309. package/dist/exports/atoms/std-flip-card.orb +5 -4
  310. package/dist/exports/atoms/std-gallery.orb +5 -4
  311. package/dist/exports/atoms/std-game-audio.orb +5 -4
  312. package/dist/exports/atoms/std-game-canvas2d.orb +4 -2
  313. package/dist/exports/atoms/std-game-canvas3d.orb +4 -2
  314. package/dist/exports/atoms/std-game-hud.orb +5 -4
  315. package/dist/exports/atoms/std-game-menu.orb +5 -4
  316. package/dist/exports/atoms/std-game-over-screen.orb +5 -4
  317. package/dist/exports/atoms/std-gameflow.orb +5 -4
  318. package/dist/exports/atoms/std-input.orb +5 -4
  319. package/dist/exports/atoms/std-inventory-panel.orb +5 -8
  320. package/dist/exports/atoms/std-isometric-canvas.orb +5 -4
  321. package/dist/exports/atoms/std-loading.orb +5 -4
  322. package/dist/exports/atoms/std-modal.orb +89 -4
  323. package/dist/exports/atoms/std-movement.orb +5 -4
  324. package/dist/exports/atoms/std-notification.orb +5 -4
  325. package/dist/exports/atoms/std-overworld.orb +5 -4
  326. package/dist/exports/atoms/std-pagination.orb +5 -4
  327. package/dist/exports/atoms/std-physics2d.orb +5 -4
  328. package/dist/exports/atoms/std-platformer-canvas.orb +5 -4
  329. package/dist/exports/atoms/std-quest.orb +5 -8
  330. package/dist/exports/atoms/std-rate-limiter.orb +5 -4
  331. package/dist/exports/atoms/std-rating.orb +5 -4
  332. package/dist/exports/atoms/std-score-board.orb +5 -4
  333. package/dist/exports/atoms/std-score.orb +5 -4
  334. package/dist/exports/atoms/std-search.orb +5 -4
  335. package/dist/exports/atoms/std-selection.orb +5 -4
  336. package/dist/exports/atoms/std-service-custom-bearer.orb +5 -15
  337. package/dist/exports/atoms/std-service-custom-header.orb +5 -17
  338. package/dist/exports/atoms/std-service-custom-noauth.orb +5 -11
  339. package/dist/exports/atoms/std-service-custom-query.orb +5 -17
  340. package/dist/exports/atoms/std-service-email.orb +5 -4
  341. package/dist/exports/atoms/std-service-github.orb +5 -4
  342. package/dist/exports/atoms/std-service-llm.orb +5 -4
  343. package/dist/exports/atoms/std-service-oauth.orb +5 -4
  344. package/dist/exports/atoms/std-service-redis.orb +5 -4
  345. package/dist/exports/atoms/std-service-storage.orb +5 -4
  346. package/dist/exports/atoms/std-service-stripe.orb +5 -4
  347. package/dist/exports/atoms/std-service-twilio.orb +5 -4
  348. package/dist/exports/atoms/std-service-youtube.orb +5 -4
  349. package/dist/exports/atoms/std-simulation-canvas.orb +5 -4
  350. package/dist/exports/atoms/std-sort.orb +5 -4
  351. package/dist/exports/atoms/std-sprite.orb +5 -4
  352. package/dist/exports/atoms/std-tabs.orb +5 -4
  353. package/dist/exports/atoms/std-text-effects.orb +5 -4
  354. package/dist/exports/atoms/std-theme.orb +5 -4
  355. package/dist/exports/atoms/std-timer.orb +5 -4
  356. package/dist/exports/atoms/std-undo.orb +5 -4
  357. package/dist/exports/atoms/std-upload.orb +5 -4
  358. package/dist/exports/atoms/std-validate-on-save.orb +5 -32
  359. package/dist/exports/atoms/std-wizard.orb +5 -4
  360. package/dist/exports/molecules/std-agent-fix-loop.orb +1141 -1709
  361. package/dist/exports/molecules/std-agent-learner.orb +608 -938
  362. package/dist/exports/molecules/std-agent-planner.orb +613 -961
  363. package/dist/exports/molecules/std-agent-rag.orb +586 -915
  364. package/dist/exports/molecules/std-agent-tool-loop.orb +915 -2846
  365. package/dist/exports/molecules/std-builder-game.orb +5 -4
  366. package/dist/exports/molecules/std-cart.orb +196 -307
  367. package/dist/exports/molecules/std-classifier-game.orb +5 -4
  368. package/dist/exports/molecules/std-debugger-game.orb +5 -4
  369. package/dist/exports/molecules/std-detail.orb +309 -467
  370. package/dist/exports/molecules/std-event-handler-game.orb +5 -4
  371. package/dist/exports/molecules/std-form-advanced.orb +5 -8
  372. package/dist/exports/molecules/std-geospatial.orb +363 -539
  373. package/dist/exports/molecules/std-inventory.orb +390 -720
  374. package/dist/exports/molecules/std-list.orb +526 -1156
  375. package/dist/exports/molecules/std-messaging.orb +295 -452
  376. package/dist/exports/molecules/std-negotiator-game.orb +5 -4
  377. package/dist/exports/molecules/std-platformer-game.orb +5 -4
  378. package/dist/exports/molecules/std-puzzle-game.orb +5 -4
  379. package/dist/exports/molecules/std-quiz.orb +5 -4
  380. package/dist/exports/molecules/std-sequencer-game.orb +5 -4
  381. package/dist/exports/molecules/std-service-content-pipeline.orb +5 -4
  382. package/dist/exports/molecules/std-service-custom-api-tester.orb +5 -42
  383. package/dist/exports/molecules/std-service-devops-toolkit.orb +5 -4
  384. package/dist/exports/molecules/std-service-notification-hub.orb +5 -4
  385. package/dist/exports/molecules/std-service-payment-flow.orb +5 -4
  386. package/dist/exports/molecules/std-simulator-game.orb +5 -4
  387. package/dist/exports/molecules/std-turn-based-battle.orb +5 -4
  388. package/dist/exports/organisms/std-agent-assistant.orb +15 -143
  389. package/dist/exports/organisms/std-agent-builder.orb +814 -1476
  390. package/dist/exports/organisms/std-agent-pipeline.orb +785 -1567
  391. package/dist/exports/organisms/std-agent-reviewer.orb +299 -502
  392. package/dist/exports/organisms/std-agent-tutor.orb +306 -493
  393. package/dist/exports/organisms/std-api-gateway.orb +284 -626
  394. package/dist/exports/organisms/std-arcade-game.orb +4 -4
  395. package/dist/exports/organisms/std-booking-system.orb +1422 -2160
  396. package/dist/exports/organisms/std-cicd-pipeline.orb +274 -617
  397. package/dist/exports/organisms/std-cms.orb +1274 -1972
  398. package/dist/exports/organisms/std-coding-academy.orb +4 -4
  399. package/dist/exports/organisms/std-crm.orb +999 -1775
  400. package/dist/exports/organisms/std-devops-dashboard.orb +284 -638
  401. package/dist/exports/organisms/std-ecommerce.orb +1653 -2398
  402. package/dist/exports/organisms/std-finance-tracker.orb +340 -684
  403. package/dist/exports/organisms/std-healthcare.orb +984 -1838
  404. package/dist/exports/organisms/std-helpdesk.orb +340 -744
  405. package/dist/exports/organisms/std-hr-portal.orb +1401 -2151
  406. package/dist/exports/organisms/std-iot-dashboard.orb +284 -626
  407. package/dist/exports/organisms/std-lms.orb +284 -632
  408. package/dist/exports/organisms/std-logic-training.orb +4 -4
  409. package/dist/exports/organisms/std-platformer-app.orb +15 -98
  410. package/dist/exports/organisms/std-project-manager.orb +970 -1774
  411. package/dist/exports/organisms/std-puzzle-app.orb +4 -4
  412. package/dist/exports/organisms/std-realtime-chat.orb +364 -714
  413. package/dist/exports/organisms/std-rpg-game.orb +15 -102
  414. package/dist/exports/organisms/std-service-marketplace.orb +1589 -2361
  415. package/dist/exports/organisms/std-service-research-assistant.orb +4 -15
  416. package/dist/exports/organisms/std-social-feed.orb +62 -66
  417. package/dist/exports/organisms/std-stem-lab.orb +4 -4
  418. package/dist/exports/organisms/std-strategy-game.orb +4 -4
  419. package/dist/exports/organisms/std-trading-dashboard.orb +274 -620
  420. package/dist/index.js.map +1 -1
  421. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  {
2
- "name": "ServiceMarketplace",
2
+ "name": "std-service-marketplace",
3
3
  "version": "1.0.0",
4
+ "description": "Service marketplace organism. Composes molecules and atoms via compose: - stdList(Product): product catalog with CRUD - stdServiceOauth(AuthSession): OAuth login with standalone provider picker - stdServicePaymentFlow(OrderPayment): Stripe payment + email receipt - stdList(Order): order history with CRUD",
4
5
  "orbitals": [
5
6
  {
6
7
  "name": "ProductOrbital",
@@ -47,11 +48,15 @@
47
48
  "listens": [
48
49
  {
49
50
  "event": "PRODUCT_CREATED",
50
- "triggers": "PRODUCT_CREATED"
51
+ "triggers": "INIT"
51
52
  },
52
53
  {
53
54
  "event": "PRODUCT_UPDATED",
54
- "triggers": "PRODUCT_UPDATED"
55
+ "triggers": "INIT"
56
+ },
57
+ {
58
+ "event": "PRODUCT_DELETED",
59
+ "triggers": "INIT"
55
60
  }
56
61
  ],
57
62
  "stateMachine": {
@@ -59,9 +64,6 @@
59
64
  {
60
65
  "name": "browsing",
61
66
  "isInitial": true
62
- },
63
- {
64
- "name": "deleting"
65
67
  }
66
68
  ],
67
69
  "events": [
@@ -117,40 +119,6 @@
117
119
  "type": "object"
118
120
  }
119
121
  ]
120
- },
121
- {
122
- "key": "PRODUCT_CREATED",
123
- "name": "PRODUCT_CREATED",
124
- "payload": [
125
- {
126
- "name": "data",
127
- "type": "object",
128
- "required": true
129
- }
130
- ]
131
- },
132
- {
133
- "key": "PRODUCT_UPDATED",
134
- "name": "PRODUCT_UPDATED",
135
- "payload": [
136
- {
137
- "name": "data",
138
- "type": "object",
139
- "required": true
140
- }
141
- ]
142
- },
143
- {
144
- "key": "CONFIRM_DELETE",
145
- "name": "Confirm Delete"
146
- },
147
- {
148
- "key": "CANCEL",
149
- "name": "Cancel"
150
- },
151
- {
152
- "key": "CLOSE",
153
- "name": "Close"
154
122
  }
155
123
  ],
156
124
  "transitions": [
@@ -307,22 +275,75 @@
307
275
  }
308
276
  ]
309
277
  ]
278
+ }
279
+ ]
280
+ },
281
+ "emits": [
282
+ {
283
+ "event": "CHECKOUT",
284
+ "payload": [
285
+ {
286
+ "name": "id",
287
+ "type": "string",
288
+ "required": true
289
+ }
290
+ ],
291
+ "scope": "external"
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "name": "ProductCreate",
297
+ "linkedEntity": "Product",
298
+ "category": "interaction",
299
+ "emits": [
300
+ {
301
+ "event": "SAVE"
302
+ },
303
+ {
304
+ "event": "PRODUCT_CREATED"
305
+ }
306
+ ],
307
+ "stateMachine": {
308
+ "states": [
309
+ {
310
+ "name": "closed",
311
+ "isInitial": true
310
312
  },
311
313
  {
312
- "from": "browsing",
313
- "to": "browsing",
314
- "event": "PRODUCT_CREATED",
315
- "effects": [
316
- [
317
- "ref",
318
- "Product"
319
- ]
320
- ]
314
+ "name": "open"
315
+ }
316
+ ],
317
+ "events": [
318
+ {
319
+ "key": "INIT",
320
+ "name": "Initialize"
321
321
  },
322
322
  {
323
- "from": "browsing",
324
- "to": "browsing",
325
- "event": "PRODUCT_UPDATED",
323
+ "key": "CREATE",
324
+ "name": "Open"
325
+ },
326
+ {
327
+ "key": "CLOSE",
328
+ "name": "Close"
329
+ },
330
+ {
331
+ "key": "SAVE",
332
+ "name": "Save",
333
+ "payload": [
334
+ {
335
+ "name": "data",
336
+ "type": "object",
337
+ "required": true
338
+ }
339
+ ]
340
+ }
341
+ ],
342
+ "transitions": [
343
+ {
344
+ "from": "closed",
345
+ "to": "closed",
346
+ "event": "INIT",
326
347
  "effects": [
327
348
  [
328
349
  "ref",
@@ -331,16 +352,13 @@
331
352
  ]
332
353
  },
333
354
  {
334
- "from": "browsing",
335
- "to": "deleting",
336
- "event": "DELETE",
355
+ "from": "closed",
356
+ "to": "open",
357
+ "event": "CREATE",
337
358
  "effects": [
338
359
  [
339
360
  "fetch",
340
- "Product",
341
- {
342
- "id": "@payload.id"
343
- }
361
+ "Product"
344
362
  ],
345
363
  [
346
364
  "render-ui",
@@ -357,12 +375,12 @@
357
375
  "children": [
358
376
  {
359
377
  "type": "icon",
360
- "name": "trash-2",
378
+ "name": "plus-circle",
361
379
  "size": "md"
362
380
  },
363
381
  {
364
382
  "type": "typography",
365
- "content": "Delete Product",
383
+ "content": "Create Product",
366
384
  "variant": "h3"
367
385
  }
368
386
  ]
@@ -371,34 +389,17 @@
371
389
  "type": "divider"
372
390
  },
373
391
  {
374
- "type": "typography",
375
- "content": "@entity.name",
376
- "variant": "h4"
377
- },
378
- {
379
- "type": "typography",
380
- "content": "This action cannot be undone.",
381
- "variant": "body"
382
- },
383
- {
384
- "type": "stack",
385
- "direction": "horizontal",
386
- "gap": "sm",
387
- "justify": "end",
388
- "children": [
389
- {
390
- "type": "button",
391
- "label": "Cancel",
392
- "event": "CANCEL",
393
- "variant": "ghost"
394
- },
395
- {
396
- "type": "button",
397
- "label": "Delete",
398
- "event": "CONFIRM_DELETE",
399
- "variant": "danger",
400
- "icon": "trash"
401
- }
392
+ "type": "form-section",
393
+ "entity": "Product",
394
+ "mode": "create",
395
+ "submitEvent": "SAVE",
396
+ "cancelEvent": "CLOSE",
397
+ "fields": [
398
+ "name",
399
+ "description",
400
+ "price",
401
+ "category",
402
+ "inStock"
402
403
  ]
403
404
  }
404
405
  ]
@@ -407,643 +408,32 @@
407
408
  ]
408
409
  },
409
410
  {
410
- "from": "deleting",
411
- "to": "browsing",
412
- "event": "CONFIRM_DELETE",
411
+ "from": "open",
412
+ "to": "closed",
413
+ "event": "CLOSE",
414
+ "effects": [
415
+ [
416
+ "render-ui",
417
+ "modal",
418
+ null
419
+ ],
420
+ [
421
+ "notify",
422
+ "Cancelled",
423
+ "info"
424
+ ]
425
+ ]
426
+ },
427
+ {
428
+ "from": "open",
429
+ "to": "closed",
430
+ "event": "SAVE",
413
431
  "effects": [
414
432
  [
415
433
  "persist",
416
- "delete",
434
+ "create",
417
435
  "Product",
418
- "@entity.id"
419
- ],
420
- [
421
- "render-ui",
422
- "modal",
423
- null
424
- ],
425
- [
426
- "render-ui",
427
- "main",
428
- {
429
- "type": "dashboard-layout",
430
- "appName": "ServiceMarketplace",
431
- "navItems": [
432
- {
433
- "label": "Products",
434
- "href": "/products",
435
- "icon": "package"
436
- },
437
- {
438
- "label": "Login",
439
- "href": "/login",
440
- "icon": "layout-list"
441
- },
442
- {
443
- "label": "Checkout",
444
- "href": "/checkout",
445
- "icon": "credit-card"
446
- },
447
- {
448
- "label": "Orders",
449
- "href": "/orders",
450
- "icon": "clipboard-list"
451
- }
452
- ],
453
- "children": [
454
- {
455
- "type": "stack",
456
- "direction": "vertical",
457
- "gap": "lg",
458
- "className": "max-w-5xl mx-auto w-full",
459
- "children": [
460
- {
461
- "type": "stack",
462
- "direction": "horizontal",
463
- "gap": "md",
464
- "justify": "space-between",
465
- "align": "center",
466
- "children": [
467
- {
468
- "type": "stack",
469
- "direction": "horizontal",
470
- "gap": "sm",
471
- "align": "center",
472
- "children": [
473
- {
474
- "type": "icon",
475
- "name": "shopping-bag",
476
- "size": "lg"
477
- },
478
- {
479
- "type": "typography",
480
- "content": "Products",
481
- "variant": "h2"
482
- }
483
- ]
484
- },
485
- {
486
- "type": "stack",
487
- "direction": "horizontal",
488
- "gap": "sm",
489
- "children": [
490
- {
491
- "type": "button",
492
- "label": "Create Product",
493
- "event": "CREATE",
494
- "variant": "primary",
495
- "icon": "plus"
496
- }
497
- ]
498
- }
499
- ]
500
- },
501
- {
502
- "type": "divider"
503
- },
504
- {
505
- "type": "data-grid",
506
- "entity": "Product",
507
- "emptyIcon": "inbox",
508
- "emptyTitle": "No products yet",
509
- "emptyDescription": "Add products to build your catalog.",
510
- "itemActions": [
511
- {
512
- "label": "View",
513
- "event": "VIEW",
514
- "variant": "ghost",
515
- "size": "sm"
516
- },
517
- {
518
- "label": "Edit",
519
- "event": "EDIT",
520
- "variant": "ghost",
521
- "size": "sm"
522
- },
523
- {
524
- "label": "Delete",
525
- "event": "DELETE",
526
- "variant": "danger",
527
- "size": "sm"
528
- }
529
- ],
530
- "columns": [
531
- {
532
- "name": "name",
533
- "label": "Name",
534
- "variant": "h4",
535
- "icon": "shopping-bag"
536
- },
537
- {
538
- "name": "description",
539
- "label": "Description",
540
- "variant": "badge",
541
- "colorMap": {
542
- "active": "success",
543
- "completed": "success",
544
- "done": "success",
545
- "pending": "warning",
546
- "draft": "warning",
547
- "scheduled": "warning",
548
- "inactive": "neutral",
549
- "archived": "neutral",
550
- "disabled": "neutral",
551
- "error": "destructive",
552
- "cancelled": "destructive",
553
- "failed": "destructive"
554
- }
555
- },
556
- {
557
- "name": "price",
558
- "label": "Price",
559
- "variant": "caption"
560
- }
561
- ]
562
- }
563
- ]
564
- }
565
- ]
566
- }
567
- ],
568
- [
569
- "notify",
570
- "Product deleted successfully"
571
- ]
572
- ]
573
- },
574
- {
575
- "from": "deleting",
576
- "to": "browsing",
577
- "event": "CANCEL",
578
- "effects": [
579
- [
580
- "render-ui",
581
- "modal",
582
- null
583
- ],
584
- [
585
- "fetch",
586
- "Product"
587
- ],
588
- [
589
- "render-ui",
590
- "main",
591
- {
592
- "type": "dashboard-layout",
593
- "appName": "ServiceMarketplace",
594
- "navItems": [
595
- {
596
- "label": "Products",
597
- "href": "/products",
598
- "icon": "package"
599
- },
600
- {
601
- "label": "Login",
602
- "href": "/login",
603
- "icon": "layout-list"
604
- },
605
- {
606
- "label": "Checkout",
607
- "href": "/checkout",
608
- "icon": "credit-card"
609
- },
610
- {
611
- "label": "Orders",
612
- "href": "/orders",
613
- "icon": "clipboard-list"
614
- }
615
- ],
616
- "children": [
617
- {
618
- "type": "stack",
619
- "direction": "vertical",
620
- "gap": "lg",
621
- "className": "max-w-5xl mx-auto w-full",
622
- "children": [
623
- {
624
- "type": "stack",
625
- "direction": "horizontal",
626
- "gap": "md",
627
- "justify": "space-between",
628
- "align": "center",
629
- "children": [
630
- {
631
- "type": "stack",
632
- "direction": "horizontal",
633
- "gap": "sm",
634
- "align": "center",
635
- "children": [
636
- {
637
- "type": "icon",
638
- "name": "shopping-bag",
639
- "size": "lg"
640
- },
641
- {
642
- "type": "typography",
643
- "content": "Products",
644
- "variant": "h2"
645
- }
646
- ]
647
- },
648
- {
649
- "type": "stack",
650
- "direction": "horizontal",
651
- "gap": "sm",
652
- "children": [
653
- {
654
- "type": "button",
655
- "label": "Create Product",
656
- "event": "CREATE",
657
- "variant": "primary",
658
- "icon": "plus"
659
- }
660
- ]
661
- }
662
- ]
663
- },
664
- {
665
- "type": "divider"
666
- },
667
- {
668
- "type": "data-grid",
669
- "entity": "Product",
670
- "emptyIcon": "inbox",
671
- "emptyTitle": "No products yet",
672
- "emptyDescription": "Add products to build your catalog.",
673
- "itemActions": [
674
- {
675
- "label": "View",
676
- "event": "VIEW",
677
- "variant": "ghost",
678
- "size": "sm"
679
- },
680
- {
681
- "label": "Edit",
682
- "event": "EDIT",
683
- "variant": "ghost",
684
- "size": "sm"
685
- },
686
- {
687
- "label": "Delete",
688
- "event": "DELETE",
689
- "variant": "danger",
690
- "size": "sm"
691
- }
692
- ],
693
- "columns": [
694
- {
695
- "name": "name",
696
- "label": "Name",
697
- "variant": "h4",
698
- "icon": "shopping-bag"
699
- },
700
- {
701
- "name": "description",
702
- "label": "Description",
703
- "variant": "badge",
704
- "colorMap": {
705
- "active": "success",
706
- "completed": "success",
707
- "done": "success",
708
- "pending": "warning",
709
- "draft": "warning",
710
- "scheduled": "warning",
711
- "inactive": "neutral",
712
- "archived": "neutral",
713
- "disabled": "neutral",
714
- "error": "destructive",
715
- "cancelled": "destructive",
716
- "failed": "destructive"
717
- }
718
- },
719
- {
720
- "name": "price",
721
- "label": "Price",
722
- "variant": "caption"
723
- }
724
- ]
725
- }
726
- ]
727
- }
728
- ]
729
- }
730
- ]
731
- ]
732
- },
733
- {
734
- "from": "deleting",
735
- "to": "browsing",
736
- "event": "CLOSE",
737
- "effects": [
738
- [
739
- "render-ui",
740
- "modal",
741
- null
742
- ],
743
- [
744
- "fetch",
745
- "Product"
746
- ],
747
- [
748
- "render-ui",
749
- "main",
750
- {
751
- "type": "dashboard-layout",
752
- "appName": "ServiceMarketplace",
753
- "navItems": [
754
- {
755
- "label": "Products",
756
- "href": "/products",
757
- "icon": "package"
758
- },
759
- {
760
- "label": "Login",
761
- "href": "/login",
762
- "icon": "layout-list"
763
- },
764
- {
765
- "label": "Checkout",
766
- "href": "/checkout",
767
- "icon": "credit-card"
768
- },
769
- {
770
- "label": "Orders",
771
- "href": "/orders",
772
- "icon": "clipboard-list"
773
- }
774
- ],
775
- "children": [
776
- {
777
- "type": "stack",
778
- "direction": "vertical",
779
- "gap": "lg",
780
- "className": "max-w-5xl mx-auto w-full",
781
- "children": [
782
- {
783
- "type": "stack",
784
- "direction": "horizontal",
785
- "gap": "md",
786
- "justify": "space-between",
787
- "align": "center",
788
- "children": [
789
- {
790
- "type": "stack",
791
- "direction": "horizontal",
792
- "gap": "sm",
793
- "align": "center",
794
- "children": [
795
- {
796
- "type": "icon",
797
- "name": "shopping-bag",
798
- "size": "lg"
799
- },
800
- {
801
- "type": "typography",
802
- "content": "Products",
803
- "variant": "h2"
804
- }
805
- ]
806
- },
807
- {
808
- "type": "stack",
809
- "direction": "horizontal",
810
- "gap": "sm",
811
- "children": [
812
- {
813
- "type": "button",
814
- "label": "Create Product",
815
- "event": "CREATE",
816
- "variant": "primary",
817
- "icon": "plus"
818
- }
819
- ]
820
- }
821
- ]
822
- },
823
- {
824
- "type": "divider"
825
- },
826
- {
827
- "type": "data-grid",
828
- "entity": "Product",
829
- "emptyIcon": "inbox",
830
- "emptyTitle": "No products yet",
831
- "emptyDescription": "Add products to build your catalog.",
832
- "itemActions": [
833
- {
834
- "label": "View",
835
- "event": "VIEW",
836
- "variant": "ghost",
837
- "size": "sm"
838
- },
839
- {
840
- "label": "Edit",
841
- "event": "EDIT",
842
- "variant": "ghost",
843
- "size": "sm"
844
- },
845
- {
846
- "label": "Delete",
847
- "event": "DELETE",
848
- "variant": "danger",
849
- "size": "sm"
850
- }
851
- ],
852
- "columns": [
853
- {
854
- "name": "name",
855
- "label": "Name",
856
- "variant": "h4",
857
- "icon": "shopping-bag"
858
- },
859
- {
860
- "name": "description",
861
- "label": "Description",
862
- "variant": "badge",
863
- "colorMap": {
864
- "active": "success",
865
- "completed": "success",
866
- "done": "success",
867
- "pending": "warning",
868
- "draft": "warning",
869
- "scheduled": "warning",
870
- "inactive": "neutral",
871
- "archived": "neutral",
872
- "disabled": "neutral",
873
- "error": "destructive",
874
- "cancelled": "destructive",
875
- "failed": "destructive"
876
- }
877
- },
878
- {
879
- "name": "price",
880
- "label": "Price",
881
- "variant": "caption"
882
- }
883
- ]
884
- }
885
- ]
886
- }
887
- ]
888
- }
889
- ]
890
- ]
891
- }
892
- ]
893
- },
894
- "emits": [
895
- {
896
- "event": "CHECKOUT",
897
- "payload": [
898
- {
899
- "name": "id",
900
- "type": "string",
901
- "required": true
902
- }
903
- ],
904
- "scope": "external"
905
- }
906
- ]
907
- },
908
- {
909
- "name": "ProductCreate",
910
- "linkedEntity": "Product",
911
- "category": "interaction",
912
- "emits": [
913
- {
914
- "event": "PRODUCT_CREATED"
915
- }
916
- ],
917
- "stateMachine": {
918
- "states": [
919
- {
920
- "name": "closed",
921
- "isInitial": true
922
- },
923
- {
924
- "name": "open"
925
- }
926
- ],
927
- "events": [
928
- {
929
- "key": "INIT",
930
- "name": "Initialize"
931
- },
932
- {
933
- "key": "CREATE",
934
- "name": "Open"
935
- },
936
- {
937
- "key": "CLOSE",
938
- "name": "Close"
939
- },
940
- {
941
- "key": "SAVE",
942
- "name": "Save",
943
- "payload": [
944
- {
945
- "name": "data",
946
- "type": "object",
947
- "required": true
948
- }
949
- ]
950
- }
951
- ],
952
- "transitions": [
953
- {
954
- "from": "closed",
955
- "to": "closed",
956
- "event": "INIT",
957
- "effects": [
958
- [
959
- "ref",
960
- "Product"
961
- ]
962
- ]
963
- },
964
- {
965
- "from": "closed",
966
- "to": "open",
967
- "event": "CREATE",
968
- "effects": [
969
- [
970
- "fetch",
971
- "Product"
972
- ],
973
- [
974
- "render-ui",
975
- "modal",
976
- {
977
- "type": "stack",
978
- "direction": "vertical",
979
- "gap": "md",
980
- "children": [
981
- {
982
- "type": "stack",
983
- "direction": "horizontal",
984
- "gap": "sm",
985
- "children": [
986
- {
987
- "type": "icon",
988
- "name": "plus-circle",
989
- "size": "md"
990
- },
991
- {
992
- "type": "typography",
993
- "content": "Create Product",
994
- "variant": "h3"
995
- }
996
- ]
997
- },
998
- {
999
- "type": "divider"
1000
- },
1001
- {
1002
- "type": "form-section",
1003
- "entity": "Product",
1004
- "mode": "create",
1005
- "submitEvent": "SAVE",
1006
- "cancelEvent": "CLOSE",
1007
- "fields": [
1008
- "name",
1009
- "description",
1010
- "price",
1011
- "category",
1012
- "inStock"
1013
- ]
1014
- }
1015
- ]
1016
- }
1017
- ]
1018
- ]
1019
- },
1020
- {
1021
- "from": "open",
1022
- "to": "closed",
1023
- "event": "CLOSE",
1024
- "effects": [
1025
- [
1026
- "render-ui",
1027
- "modal",
1028
- null
1029
- ],
1030
- [
1031
- "notify",
1032
- "Cancelled",
1033
- "info"
1034
- ]
1035
- ]
1036
- },
1037
- {
1038
- "from": "open",
1039
- "to": "closed",
1040
- "event": "SAVE",
1041
- "effects": [
1042
- [
1043
- "persist",
1044
- "create",
1045
- "Product",
1046
- "@payload.data"
436
+ "@payload.data"
1047
437
  ],
1048
438
  [
1049
439
  "render-ui",
@@ -1053,10 +443,6 @@
1053
443
  [
1054
444
  "emit",
1055
445
  "PRODUCT_CREATED"
1056
- ],
1057
- [
1058
- "notify",
1059
- "Product created successfully"
1060
446
  ]
1061
447
  ]
1062
448
  }
@@ -1068,6 +454,9 @@
1068
454
  "linkedEntity": "Product",
1069
455
  "category": "interaction",
1070
456
  "emits": [
457
+ {
458
+ "event": "SAVE"
459
+ },
1071
460
  {
1072
461
  "event": "PRODUCT_UPDATED"
1073
462
  }
@@ -1222,10 +611,6 @@
1222
611
  [
1223
612
  "emit",
1224
613
  "PRODUCT_UPDATED"
1225
- ],
1226
- [
1227
- "notify",
1228
- "Product updated successfully"
1229
614
  ]
1230
615
  ]
1231
616
  }
@@ -1236,6 +621,11 @@
1236
621
  "name": "ProductView",
1237
622
  "linkedEntity": "Product",
1238
623
  "category": "interaction",
624
+ "emits": [
625
+ {
626
+ "event": "SAVE"
627
+ }
628
+ ],
1239
629
  "stateMachine": {
1240
630
  "states": [
1241
631
  {
@@ -1265,6 +655,17 @@
1265
655
  {
1266
656
  "key": "CLOSE",
1267
657
  "name": "Close"
658
+ },
659
+ {
660
+ "key": "SAVE",
661
+ "name": "Save",
662
+ "payload": [
663
+ {
664
+ "name": "data",
665
+ "type": "object",
666
+ "required": true
667
+ }
668
+ ]
1268
669
  }
1269
670
  ],
1270
671
  "transitions": [
@@ -1445,9 +846,222 @@
1445
846
  null
1446
847
  ],
1447
848
  [
1448
- "notify",
1449
- "Cancelled",
1450
- "info"
849
+ "notify",
850
+ "Cancelled",
851
+ "info"
852
+ ]
853
+ ]
854
+ },
855
+ {
856
+ "from": "open",
857
+ "to": "closed",
858
+ "event": "SAVE",
859
+ "effects": [
860
+ [
861
+ "render-ui",
862
+ "modal",
863
+ null
864
+ ]
865
+ ]
866
+ }
867
+ ]
868
+ }
869
+ },
870
+ {
871
+ "name": "ProductDelete",
872
+ "linkedEntity": "Product",
873
+ "category": "interaction",
874
+ "emits": [
875
+ {
876
+ "event": "CONFIRM_DELETE"
877
+ },
878
+ {
879
+ "event": "PRODUCT_DELETED"
880
+ }
881
+ ],
882
+ "stateMachine": {
883
+ "states": [
884
+ {
885
+ "name": "idle",
886
+ "isInitial": true
887
+ },
888
+ {
889
+ "name": "confirming"
890
+ }
891
+ ],
892
+ "events": [
893
+ {
894
+ "key": "INIT",
895
+ "name": "Initialize"
896
+ },
897
+ {
898
+ "key": "DELETE",
899
+ "name": "Request Confirmation",
900
+ "payload": [
901
+ {
902
+ "name": "id",
903
+ "type": "string",
904
+ "required": true
905
+ }
906
+ ]
907
+ },
908
+ {
909
+ "key": "CONFIRM_DELETE",
910
+ "name": "Confirm"
911
+ },
912
+ {
913
+ "key": "CANCEL",
914
+ "name": "Cancel"
915
+ },
916
+ {
917
+ "key": "CLOSE",
918
+ "name": "Close"
919
+ }
920
+ ],
921
+ "transitions": [
922
+ {
923
+ "from": "idle",
924
+ "to": "idle",
925
+ "event": "INIT",
926
+ "effects": [
927
+ [
928
+ "ref",
929
+ "Product"
930
+ ]
931
+ ]
932
+ },
933
+ {
934
+ "from": "idle",
935
+ "to": "confirming",
936
+ "event": "DELETE",
937
+ "effects": [
938
+ [
939
+ "set",
940
+ "@entity.pendingId",
941
+ "@payload.id"
942
+ ],
943
+ [
944
+ "fetch",
945
+ "Product",
946
+ {
947
+ "id": "@payload.id"
948
+ }
949
+ ],
950
+ [
951
+ "render-ui",
952
+ "modal",
953
+ {
954
+ "type": "stack",
955
+ "direction": "vertical",
956
+ "gap": "md",
957
+ "children": [
958
+ {
959
+ "type": "stack",
960
+ "direction": "horizontal",
961
+ "gap": "sm",
962
+ "align": "center",
963
+ "children": [
964
+ {
965
+ "type": "icon",
966
+ "name": "alert-triangle",
967
+ "size": "md"
968
+ },
969
+ {
970
+ "type": "typography",
971
+ "content": "Delete Product",
972
+ "variant": "h3"
973
+ }
974
+ ]
975
+ },
976
+ {
977
+ "type": "divider"
978
+ },
979
+ {
980
+ "type": "alert",
981
+ "variant": "danger",
982
+ "message": "This action cannot be undone."
983
+ },
984
+ {
985
+ "type": "stack",
986
+ "direction": "horizontal",
987
+ "gap": "sm",
988
+ "justify": "end",
989
+ "children": [
990
+ {
991
+ "type": "button",
992
+ "label": "Cancel",
993
+ "event": "CANCEL",
994
+ "variant": "ghost"
995
+ },
996
+ {
997
+ "type": "button",
998
+ "label": "Delete",
999
+ "event": "CONFIRM_DELETE",
1000
+ "variant": "danger",
1001
+ "icon": "check"
1002
+ }
1003
+ ]
1004
+ }
1005
+ ]
1006
+ }
1007
+ ]
1008
+ ]
1009
+ },
1010
+ {
1011
+ "from": "confirming",
1012
+ "to": "idle",
1013
+ "event": "CONFIRM_DELETE",
1014
+ "effects": [
1015
+ [
1016
+ "persist",
1017
+ "delete",
1018
+ "Product",
1019
+ "@entity.pendingId"
1020
+ ],
1021
+ [
1022
+ "render-ui",
1023
+ "modal",
1024
+ null
1025
+ ],
1026
+ [
1027
+ "ref",
1028
+ "Product"
1029
+ ],
1030
+ [
1031
+ "emit",
1032
+ "PRODUCT_DELETED"
1033
+ ]
1034
+ ]
1035
+ },
1036
+ {
1037
+ "from": "confirming",
1038
+ "to": "idle",
1039
+ "event": "CANCEL",
1040
+ "effects": [
1041
+ [
1042
+ "render-ui",
1043
+ "modal",
1044
+ null
1045
+ ],
1046
+ [
1047
+ "ref",
1048
+ "Product"
1049
+ ]
1050
+ ]
1051
+ },
1052
+ {
1053
+ "from": "confirming",
1054
+ "to": "idle",
1055
+ "event": "CLOSE",
1056
+ "effects": [
1057
+ [
1058
+ "render-ui",
1059
+ "modal",
1060
+ null
1061
+ ],
1062
+ [
1063
+ "ref",
1064
+ "Product"
1451
1065
  ]
1452
1066
  ]
1453
1067
  }
@@ -1472,11 +1086,13 @@
1472
1086
  },
1473
1087
  {
1474
1088
  "ref": "ProductView"
1089
+ },
1090
+ {
1091
+ "ref": "ProductDelete"
1475
1092
  }
1476
1093
  ]
1477
1094
  }
1478
- ],
1479
- "services": []
1095
+ ]
1480
1096
  },
1481
1097
  {
1482
1098
  "name": "AuthSessionOrbital",
@@ -1836,276 +1452,46 @@
1836
1452
  {
1837
1453
  "type": "typography",
1838
1454
  "content": "Authorization Required",
1839
- "variant": "h2"
1840
- },
1841
- {
1842
- "type": "typography",
1843
- "content": "@entity.authUrl",
1844
- "variant": "body",
1845
- "color": "muted"
1846
- },
1847
- {
1848
- "type": "input",
1849
- "label": "Authorization Code",
1850
- "field": "code",
1851
- "placeholder": "Paste authorization code here"
1852
- },
1853
- {
1854
- "type": "button",
1855
- "label": "Submit",
1856
- "event": "CALLBACK",
1857
- "variant": "primary",
1858
- "icon": "check"
1859
- }
1860
- ]
1861
- }
1862
- ]
1863
- }
1864
- ]
1865
- ]
1866
- },
1867
- {
1868
- "from": "authorizing",
1869
- "to": "authenticated",
1870
- "event": "CALLBACK",
1871
- "effects": [
1872
- [
1873
- "call-service",
1874
- "oauth",
1875
- "token",
1876
- {
1877
- "code": "@payload.code"
1878
- }
1879
- ],
1880
- [
1881
- "render-ui",
1882
- "main",
1883
- {
1884
- "type": "dashboard-layout",
1885
- "appName": "ServiceMarketplace",
1886
- "navItems": [
1887
- {
1888
- "label": "Products",
1889
- "href": "/products",
1890
- "icon": "package"
1891
- },
1892
- {
1893
- "label": "Login",
1894
- "href": "/login",
1895
- "icon": "layout-list"
1896
- },
1897
- {
1898
- "label": "Checkout",
1899
- "href": "/checkout",
1900
- "icon": "credit-card"
1901
- },
1902
- {
1903
- "label": "Orders",
1904
- "href": "/orders",
1905
- "icon": "clipboard-list"
1906
- }
1907
- ],
1908
- "children": [
1909
- {
1910
- "type": "stack",
1911
- "direction": "vertical",
1912
- "gap": "lg",
1913
- "align": "center",
1914
- "children": [
1915
- {
1916
- "type": "icon",
1917
- "name": "check-circle",
1918
- "size": "lg"
1919
- },
1920
- {
1921
- "type": "alert",
1922
- "variant": "success",
1923
- "message": "Authenticated successfully"
1924
- },
1925
- {
1926
- "type": "stack",
1927
- "direction": "horizontal",
1928
- "gap": "sm",
1929
- "justify": "center",
1930
- "children": [
1931
- {
1932
- "type": "button",
1933
- "label": "Refresh Token",
1934
- "event": "REFRESH",
1935
- "variant": "outline",
1936
- "icon": "refresh-cw"
1937
- },
1938
- {
1939
- "type": "button",
1940
- "label": "Logout",
1941
- "event": "LOGOUT",
1942
- "variant": "ghost",
1943
- "icon": "log-out"
1944
- }
1945
- ]
1946
- }
1947
- ]
1948
- }
1949
- ]
1950
- }
1951
- ]
1952
- ]
1953
- },
1954
- {
1955
- "from": "authenticated",
1956
- "to": "authenticated",
1957
- "event": "TOKEN_RECEIVED",
1958
- "effects": [
1959
- [
1960
- "set",
1961
- "@entity.accessToken",
1962
- "@payload.accessToken"
1963
- ],
1964
- [
1965
- "set",
1966
- "@entity.refreshToken",
1967
- "@payload.refreshToken"
1968
- ],
1969
- [
1970
- "set",
1971
- "@entity.authStatus",
1972
- "authenticated"
1973
- ],
1974
- [
1975
- "render-ui",
1976
- "main",
1977
- {
1978
- "type": "dashboard-layout",
1979
- "appName": "ServiceMarketplace",
1980
- "navItems": [
1981
- {
1982
- "label": "Products",
1983
- "href": "/products",
1984
- "icon": "package"
1985
- },
1986
- {
1987
- "label": "Login",
1988
- "href": "/login",
1989
- "icon": "layout-list"
1990
- },
1991
- {
1992
- "label": "Checkout",
1993
- "href": "/checkout",
1994
- "icon": "credit-card"
1995
- },
1996
- {
1997
- "label": "Orders",
1998
- "href": "/orders",
1999
- "icon": "clipboard-list"
2000
- }
2001
- ],
2002
- "children": [
2003
- {
2004
- "type": "stack",
2005
- "direction": "vertical",
2006
- "gap": "lg",
2007
- "align": "center",
2008
- "children": [
2009
- {
2010
- "type": "icon",
2011
- "name": "check-circle",
2012
- "size": "lg"
2013
- },
2014
- {
2015
- "type": "alert",
2016
- "variant": "success",
2017
- "message": "Authenticated successfully"
2018
- },
2019
- {
2020
- "type": "stack",
2021
- "direction": "horizontal",
2022
- "gap": "sm",
2023
- "justify": "center",
2024
- "children": [
2025
- {
2026
- "type": "button",
2027
- "label": "Refresh Token",
2028
- "event": "REFRESH",
2029
- "variant": "outline",
2030
- "icon": "refresh-cw"
2031
- },
2032
- {
2033
- "type": "button",
2034
- "label": "Logout",
2035
- "event": "LOGOUT",
2036
- "variant": "ghost",
2037
- "icon": "log-out"
2038
- }
2039
- ]
2040
- }
2041
- ]
2042
- }
2043
- ]
2044
- }
2045
- ]
2046
- ]
2047
- },
2048
- {
2049
- "from": "authenticated",
2050
- "to": "refreshing",
2051
- "event": "REFRESH",
2052
- "effects": [
2053
- [
2054
- "render-ui",
2055
- "main",
2056
- {
2057
- "type": "dashboard-layout",
2058
- "appName": "ServiceMarketplace",
2059
- "navItems": [
2060
- {
2061
- "label": "Products",
2062
- "href": "/products",
2063
- "icon": "package"
2064
- },
2065
- {
2066
- "label": "Login",
2067
- "href": "/login",
2068
- "icon": "layout-list"
2069
- },
2070
- {
2071
- "label": "Checkout",
2072
- "href": "/checkout",
2073
- "icon": "credit-card"
2074
- },
2075
- {
2076
- "label": "Orders",
2077
- "href": "/orders",
2078
- "icon": "clipboard-list"
2079
- }
2080
- ],
2081
- "children": [
2082
- {
2083
- "type": "loading-state",
2084
- "title": "Refreshing token...",
2085
- "message": "Obtaining a new access token."
1455
+ "variant": "h2"
1456
+ },
1457
+ {
1458
+ "type": "typography",
1459
+ "content": "@entity.authUrl",
1460
+ "variant": "body",
1461
+ "color": "muted"
1462
+ },
1463
+ {
1464
+ "type": "input",
1465
+ "label": "Authorization Code",
1466
+ "field": "code",
1467
+ "placeholder": "Paste authorization code here"
1468
+ },
1469
+ {
1470
+ "type": "button",
1471
+ "label": "Submit",
1472
+ "event": "CALLBACK",
1473
+ "variant": "primary",
1474
+ "icon": "check"
1475
+ }
1476
+ ]
2086
1477
  }
2087
1478
  ]
2088
1479
  }
2089
- ],
2090
- [
2091
- "call-service",
2092
- "oauth",
2093
- "refresh",
2094
- {
2095
- "refreshToken": "@entity.refreshToken"
2096
- }
2097
1480
  ]
2098
1481
  ]
2099
1482
  },
2100
1483
  {
2101
- "from": "refreshing",
1484
+ "from": "authorizing",
2102
1485
  "to": "authenticated",
2103
- "event": "TOKEN_REFRESHED",
1486
+ "event": "CALLBACK",
2104
1487
  "effects": [
2105
1488
  [
2106
- "set",
2107
- "@entity.accessToken",
2108
- "@payload.accessToken"
1489
+ "call-service",
1490
+ "oauth",
1491
+ "token",
1492
+ {
1493
+ "code": "@payload.code"
1494
+ }
2109
1495
  ],
2110
1496
  [
2111
1497
  "render-ui",
@@ -2183,13 +1569,23 @@
2183
1569
  },
2184
1570
  {
2185
1571
  "from": "authenticated",
2186
- "to": "unauthenticated",
2187
- "event": "LOGOUT",
1572
+ "to": "authenticated",
1573
+ "event": "TOKEN_RECEIVED",
2188
1574
  "effects": [
1575
+ [
1576
+ "set",
1577
+ "@entity.accessToken",
1578
+ "@payload.accessToken"
1579
+ ],
1580
+ [
1581
+ "set",
1582
+ "@entity.refreshToken",
1583
+ "@payload.refreshToken"
1584
+ ],
2189
1585
  [
2190
1586
  "set",
2191
1587
  "@entity.authStatus",
2192
- "unauthenticated"
1588
+ "authenticated"
2193
1589
  ],
2194
1590
  [
2195
1591
  "render-ui",
@@ -2227,52 +1623,36 @@
2227
1623
  "align": "center",
2228
1624
  "children": [
2229
1625
  {
2230
- "type": "stack",
2231
- "direction": "horizontal",
2232
- "gap": "md",
2233
- "align": "center",
2234
- "children": [
2235
- {
2236
- "type": "icon",
2237
- "name": "lock",
2238
- "size": "lg"
2239
- },
2240
- {
2241
- "type": "typography",
2242
- "content": "Sign In",
2243
- "variant": "h2"
2244
- }
2245
- ]
1626
+ "type": "icon",
1627
+ "name": "check-circle",
1628
+ "size": "lg"
2246
1629
  },
2247
1630
  {
2248
- "type": "divider"
1631
+ "type": "alert",
1632
+ "variant": "success",
1633
+ "message": "Authenticated successfully"
2249
1634
  },
2250
1635
  {
2251
- "type": "select",
2252
- "label": "Provider",
2253
- "field": "provider",
2254
- "bind": "@entity.provider",
2255
- "options": [
2256
- {
2257
- "label": "Google",
2258
- "value": "google"
2259
- },
1636
+ "type": "stack",
1637
+ "direction": "horizontal",
1638
+ "gap": "sm",
1639
+ "justify": "center",
1640
+ "children": [
2260
1641
  {
2261
- "label": "GitHub",
2262
- "value": "github"
1642
+ "type": "button",
1643
+ "label": "Refresh Token",
1644
+ "event": "REFRESH",
1645
+ "variant": "outline",
1646
+ "icon": "refresh-cw"
2263
1647
  },
2264
1648
  {
2265
- "label": "Microsoft",
2266
- "value": "microsoft"
1649
+ "type": "button",
1650
+ "label": "Logout",
1651
+ "event": "LOGOUT",
1652
+ "variant": "ghost",
1653
+ "icon": "log-out"
2267
1654
  }
2268
1655
  ]
2269
- },
2270
- {
2271
- "type": "button",
2272
- "label": "Login",
2273
- "event": "LOGIN",
2274
- "variant": "primary",
2275
- "icon": "log-in"
2276
1656
  }
2277
1657
  ]
2278
1658
  }
@@ -2282,15 +1662,10 @@
2282
1662
  ]
2283
1663
  },
2284
1664
  {
2285
- "from": "authorizing",
2286
- "to": "error",
2287
- "event": "FAILED",
1665
+ "from": "authenticated",
1666
+ "to": "refreshing",
1667
+ "event": "REFRESH",
2288
1668
  "effects": [
2289
- [
2290
- "set",
2291
- "@entity.error",
2292
- "@payload.error"
2293
- ],
2294
1669
  [
2295
1670
  "render-ui",
2296
1671
  "main",
@@ -2321,101 +1696,33 @@
2321
1696
  ],
2322
1697
  "children": [
2323
1698
  {
2324
- "type": "stack",
2325
- "direction": "vertical",
2326
- "gap": "lg",
2327
- "align": "center",
2328
- "children": [
2329
- {
2330
- "type": "error-state",
2331
- "title": "Authentication Failed",
2332
- "message": "@entity.error",
2333
- "onRetry": "RETRY"
2334
- },
2335
- {
2336
- "type": "button",
2337
- "label": "Try Again",
2338
- "event": "RETRY",
2339
- "variant": "primary",
2340
- "icon": "rotate-ccw"
2341
- }
2342
- ]
1699
+ "type": "loading-state",
1700
+ "title": "Refreshing token...",
1701
+ "message": "Obtaining a new access token."
2343
1702
  }
2344
1703
  ]
2345
1704
  }
2346
- ]
2347
- ]
2348
- },
2349
- {
2350
- "from": "refreshing",
2351
- "to": "error",
2352
- "event": "FAILED",
2353
- "effects": [
2354
- [
2355
- "set",
2356
- "@entity.error",
2357
- "@payload.error"
2358
1705
  ],
2359
1706
  [
2360
- "render-ui",
2361
- "main",
1707
+ "call-service",
1708
+ "oauth",
1709
+ "refresh",
2362
1710
  {
2363
- "type": "dashboard-layout",
2364
- "appName": "ServiceMarketplace",
2365
- "navItems": [
2366
- {
2367
- "label": "Products",
2368
- "href": "/products",
2369
- "icon": "package"
2370
- },
2371
- {
2372
- "label": "Login",
2373
- "href": "/login",
2374
- "icon": "layout-list"
2375
- },
2376
- {
2377
- "label": "Checkout",
2378
- "href": "/checkout",
2379
- "icon": "credit-card"
2380
- },
2381
- {
2382
- "label": "Orders",
2383
- "href": "/orders",
2384
- "icon": "clipboard-list"
2385
- }
2386
- ],
2387
- "children": [
2388
- {
2389
- "type": "stack",
2390
- "direction": "vertical",
2391
- "gap": "lg",
2392
- "align": "center",
2393
- "children": [
2394
- {
2395
- "type": "error-state",
2396
- "title": "Authentication Failed",
2397
- "message": "@entity.error",
2398
- "onRetry": "RETRY"
2399
- },
2400
- {
2401
- "type": "button",
2402
- "label": "Try Again",
2403
- "event": "RETRY",
2404
- "variant": "primary",
2405
- "icon": "rotate-ccw"
2406
- }
2407
- ]
2408
- }
2409
- ]
1711
+ "refreshToken": "@entity.refreshToken"
2410
1712
  }
2411
1713
  ]
2412
1714
  ]
2413
1715
  },
2414
1716
  {
2415
- "from": "error",
2416
- "to": "unauthenticated",
2417
- "event": "RETRY",
1717
+ "from": "refreshing",
1718
+ "to": "authenticated",
1719
+ "event": "TOKEN_REFRESHED",
2418
1720
  "effects": [
1721
+ [
1722
+ "set",
1723
+ "@entity.accessToken",
1724
+ "@payload.accessToken"
1725
+ ],
2419
1726
  [
2420
1727
  "render-ui",
2421
1728
  "main",
@@ -2438,66 +1745,50 @@
2438
1745
  "href": "/checkout",
2439
1746
  "icon": "credit-card"
2440
1747
  },
2441
- {
2442
- "label": "Orders",
2443
- "href": "/orders",
2444
- "icon": "clipboard-list"
2445
- }
2446
- ],
2447
- "children": [
2448
- {
2449
- "type": "stack",
2450
- "direction": "vertical",
2451
- "gap": "lg",
2452
- "align": "center",
2453
- "children": [
2454
- {
2455
- "type": "stack",
2456
- "direction": "horizontal",
2457
- "gap": "md",
2458
- "align": "center",
2459
- "children": [
2460
- {
2461
- "type": "icon",
2462
- "name": "lock",
2463
- "size": "lg"
2464
- },
2465
- {
2466
- "type": "typography",
2467
- "content": "Sign In",
2468
- "variant": "h2"
2469
- }
2470
- ]
1748
+ {
1749
+ "label": "Orders",
1750
+ "href": "/orders",
1751
+ "icon": "clipboard-list"
1752
+ }
1753
+ ],
1754
+ "children": [
1755
+ {
1756
+ "type": "stack",
1757
+ "direction": "vertical",
1758
+ "gap": "lg",
1759
+ "align": "center",
1760
+ "children": [
1761
+ {
1762
+ "type": "icon",
1763
+ "name": "check-circle",
1764
+ "size": "lg"
2471
1765
  },
2472
1766
  {
2473
- "type": "divider"
1767
+ "type": "alert",
1768
+ "variant": "success",
1769
+ "message": "Authenticated successfully"
2474
1770
  },
2475
1771
  {
2476
- "type": "select",
2477
- "label": "Provider",
2478
- "field": "provider",
2479
- "bind": "@entity.provider",
2480
- "options": [
2481
- {
2482
- "label": "Google",
2483
- "value": "google"
2484
- },
1772
+ "type": "stack",
1773
+ "direction": "horizontal",
1774
+ "gap": "sm",
1775
+ "justify": "center",
1776
+ "children": [
2485
1777
  {
2486
- "label": "GitHub",
2487
- "value": "github"
1778
+ "type": "button",
1779
+ "label": "Refresh Token",
1780
+ "event": "REFRESH",
1781
+ "variant": "outline",
1782
+ "icon": "refresh-cw"
2488
1783
  },
2489
1784
  {
2490
- "label": "Microsoft",
2491
- "value": "microsoft"
1785
+ "type": "button",
1786
+ "label": "Logout",
1787
+ "event": "LOGOUT",
1788
+ "variant": "ghost",
1789
+ "icon": "log-out"
2492
1790
  }
2493
1791
  ]
2494
- },
2495
- {
2496
- "type": "button",
2497
- "label": "Login",
2498
- "event": "LOGIN",
2499
- "variant": "primary",
2500
- "icon": "log-in"
2501
1792
  }
2502
1793
  ]
2503
1794
  }
@@ -2505,168 +1796,16 @@
2505
1796
  }
2506
1797
  ]
2507
1798
  ]
2508
- }
2509
- ]
2510
- }
2511
- }
2512
- ],
2513
- "pages": [
2514
- {
2515
- "name": "LoginPage",
2516
- "path": "/login",
2517
- "traits": [
2518
- {
2519
- "ref": "AuthSessionOauth"
2520
- }
2521
- ]
2522
- }
2523
- ],
2524
- "services": []
2525
- },
2526
- {
2527
- "name": "OrderPaymentOrbital",
2528
- "entity": {
2529
- "name": "OrderPayment",
2530
- "persistence": "runtime",
2531
- "fields": [
2532
- {
2533
- "name": "id",
2534
- "type": "string",
2535
- "required": true
2536
- },
2537
- {
2538
- "name": "amount",
2539
- "type": "number"
2540
- },
2541
- {
2542
- "name": "currency",
2543
- "type": "string",
2544
- "default": "usd"
2545
- },
2546
- {
2547
- "name": "paymentIntentId",
2548
- "type": "string"
2549
- },
2550
- {
2551
- "name": "clientSecret",
2552
- "type": "string"
2553
- },
2554
- {
2555
- "name": "paymentStatus",
2556
- "type": "string",
2557
- "default": "idle"
2558
- },
2559
- {
2560
- "name": "to",
2561
- "type": "string"
2562
- },
2563
- {
2564
- "name": "subject",
2565
- "type": "string",
2566
- "default": "Payment Receipt"
2567
- },
2568
- {
2569
- "name": "body",
2570
- "type": "string"
2571
- },
2572
- {
2573
- "name": "sendStatus",
2574
- "type": "string",
2575
- "default": "idle"
2576
- },
2577
- {
2578
- "name": "error",
2579
- "type": "string"
2580
- }
2581
- ]
2582
- },
2583
- "traits": [
2584
- {
2585
- "name": "OrderPaymentPayment",
2586
- "linkedEntity": "OrderPayment",
2587
- "category": "interaction",
2588
- "emits": [
2589
- {
2590
- "event": "SEND_RECEIPT"
2591
- }
2592
- ],
2593
- "stateMachine": {
2594
- "states": [
2595
- {
2596
- "name": "idle",
2597
- "isInitial": true
2598
- },
2599
- {
2600
- "name": "creating"
2601
- },
2602
- {
2603
- "name": "confirming"
2604
- },
2605
- {
2606
- "name": "succeeded"
2607
- },
2608
- {
2609
- "name": "error"
2610
- }
2611
- ],
2612
- "events": [
2613
- {
2614
- "key": "INIT",
2615
- "name": "Initialize"
2616
- },
2617
- {
2618
- "key": "CREATE_PAYMENT",
2619
- "name": "Create Payment"
2620
- },
2621
- {
2622
- "key": "PAYMENT_CREATED",
2623
- "name": "Payment Created",
2624
- "payload": [
2625
- {
2626
- "name": "id",
2627
- "type": "string",
2628
- "required": true
2629
- },
2630
- {
2631
- "name": "clientSecret",
2632
- "type": "string",
2633
- "required": true
2634
- }
2635
- ]
2636
- },
2637
- {
2638
- "key": "PAYMENT_CONFIRMED",
2639
- "name": "Payment Confirmed"
2640
- },
2641
- {
2642
- "key": "FAILED",
2643
- "name": "Failed",
2644
- "payload": [
2645
- {
2646
- "name": "error",
2647
- "type": "string",
2648
- "required": true
2649
- }
2650
- ]
2651
- },
2652
- {
2653
- "key": "RETRY",
2654
- "name": "Retry"
2655
1799
  },
2656
1800
  {
2657
- "key": "RESET",
2658
- "name": "Reset"
2659
- }
2660
- ],
2661
- "transitions": [
2662
- {
2663
- "from": "idle",
2664
- "to": "idle",
2665
- "event": "INIT",
1801
+ "from": "authenticated",
1802
+ "to": "unauthenticated",
1803
+ "event": "LOGOUT",
2666
1804
  "effects": [
2667
1805
  [
2668
- "fetch",
2669
- "OrderPayment"
1806
+ "set",
1807
+ "@entity.authStatus",
1808
+ "unauthenticated"
2670
1809
  ],
2671
1810
  [
2672
1811
  "render-ui",
@@ -2711,12 +1850,12 @@
2711
1850
  "children": [
2712
1851
  {
2713
1852
  "type": "icon",
2714
- "name": "credit-card",
1853
+ "name": "lock",
2715
1854
  "size": "lg"
2716
1855
  },
2717
1856
  {
2718
1857
  "type": "typography",
2719
- "content": "Payment",
1858
+ "content": "Sign In",
2720
1859
  "variant": "h2"
2721
1860
  }
2722
1861
  ]
@@ -2725,44 +1864,31 @@
2725
1864
  "type": "divider"
2726
1865
  },
2727
1866
  {
2728
- "type": "stack",
2729
- "direction": "vertical",
2730
- "gap": "md",
2731
- "children": [
1867
+ "type": "select",
1868
+ "label": "Provider",
1869
+ "field": "provider",
1870
+ "bind": "@entity.provider",
1871
+ "options": [
2732
1872
  {
2733
- "type": "input",
2734
- "label": "Amount",
2735
- "field": "amount",
2736
- "inputType": "number",
2737
- "placeholder": "0.00"
1873
+ "label": "Google",
1874
+ "value": "google"
2738
1875
  },
2739
1876
  {
2740
- "type": "select",
2741
- "label": "Currency",
2742
- "field": "currency",
2743
- "options": [
2744
- {
2745
- "label": "USD",
2746
- "value": "usd"
2747
- },
2748
- {
2749
- "label": "EUR",
2750
- "value": "eur"
2751
- },
2752
- {
2753
- "label": "GBP",
2754
- "value": "gbp"
2755
- }
2756
- ]
1877
+ "label": "GitHub",
1878
+ "value": "github"
1879
+ },
1880
+ {
1881
+ "label": "Microsoft",
1882
+ "value": "microsoft"
2757
1883
  }
2758
1884
  ]
2759
1885
  },
2760
1886
  {
2761
1887
  "type": "button",
2762
- "label": "Pay",
2763
- "event": "CREATE_PAYMENT",
1888
+ "label": "Login",
1889
+ "event": "LOGIN",
2764
1890
  "variant": "primary",
2765
- "icon": "credit-card"
1891
+ "icon": "log-in"
2766
1892
  }
2767
1893
  ]
2768
1894
  }
@@ -2772,10 +1898,15 @@
2772
1898
  ]
2773
1899
  },
2774
1900
  {
2775
- "from": "idle",
2776
- "to": "creating",
2777
- "event": "CREATE_PAYMENT",
1901
+ "from": "authorizing",
1902
+ "to": "error",
1903
+ "event": "FAILED",
2778
1904
  "effects": [
1905
+ [
1906
+ "set",
1907
+ "@entity.error",
1908
+ "@payload.error"
1909
+ ],
2779
1910
  [
2780
1911
  "render-ui",
2781
1912
  "main",
@@ -2806,38 +1937,40 @@
2806
1937
  ],
2807
1938
  "children": [
2808
1939
  {
2809
- "type": "loading-state",
2810
- "title": "Creating payment...",
2811
- "message": "Setting up your payment intent."
1940
+ "type": "stack",
1941
+ "direction": "vertical",
1942
+ "gap": "lg",
1943
+ "align": "center",
1944
+ "children": [
1945
+ {
1946
+ "type": "error-state",
1947
+ "title": "Authentication Failed",
1948
+ "message": "@entity.error",
1949
+ "onRetry": "RETRY"
1950
+ },
1951
+ {
1952
+ "type": "button",
1953
+ "label": "Try Again",
1954
+ "event": "RETRY",
1955
+ "variant": "primary",
1956
+ "icon": "rotate-ccw"
1957
+ }
1958
+ ]
2812
1959
  }
2813
1960
  ]
2814
1961
  }
2815
- ],
2816
- [
2817
- "call-service",
2818
- "stripe",
2819
- "createPaymentIntent",
2820
- {
2821
- "amount": "@entity.amount",
2822
- "currency": "@entity.currency"
2823
- }
2824
1962
  ]
2825
1963
  ]
2826
1964
  },
2827
1965
  {
2828
- "from": "creating",
2829
- "to": "confirming",
2830
- "event": "PAYMENT_CREATED",
1966
+ "from": "refreshing",
1967
+ "to": "error",
1968
+ "event": "FAILED",
2831
1969
  "effects": [
2832
1970
  [
2833
1971
  "set",
2834
- "@entity.paymentIntentId",
2835
- "@payload.id"
2836
- ],
2837
- [
2838
- "set",
2839
- "@entity.clientSecret",
2840
- "@payload.clientSecret"
1972
+ "@entity.error",
1973
+ "@payload.error"
2841
1974
  ],
2842
1975
  [
2843
1976
  "render-ui",
@@ -2869,37 +2002,36 @@
2869
2002
  ],
2870
2003
  "children": [
2871
2004
  {
2872
- "type": "loading-state",
2873
- "title": "Confirming payment...",
2874
- "message": "Processing your payment."
2005
+ "type": "stack",
2006
+ "direction": "vertical",
2007
+ "gap": "lg",
2008
+ "align": "center",
2009
+ "children": [
2010
+ {
2011
+ "type": "error-state",
2012
+ "title": "Authentication Failed",
2013
+ "message": "@entity.error",
2014
+ "onRetry": "RETRY"
2015
+ },
2016
+ {
2017
+ "type": "button",
2018
+ "label": "Try Again",
2019
+ "event": "RETRY",
2020
+ "variant": "primary",
2021
+ "icon": "rotate-ccw"
2022
+ }
2023
+ ]
2875
2024
  }
2876
2025
  ]
2877
2026
  }
2878
- ],
2879
- [
2880
- "call-service",
2881
- "stripe",
2882
- "confirmPayment",
2883
- {
2884
- "paymentIntentId": "@entity.paymentIntentId"
2885
- }
2886
2027
  ]
2887
2028
  ]
2888
2029
  },
2889
2030
  {
2890
- "from": "confirming",
2891
- "to": "succeeded",
2892
- "event": "PAYMENT_CONFIRMED",
2031
+ "from": "error",
2032
+ "to": "unauthenticated",
2033
+ "event": "RETRY",
2893
2034
  "effects": [
2894
- [
2895
- "set",
2896
- "@entity.paymentStatus",
2897
- "succeeded"
2898
- ],
2899
- [
2900
- "emit",
2901
- "SEND_RECEIPT"
2902
- ],
2903
2035
  [
2904
2036
  "render-ui",
2905
2037
  "main",
@@ -2936,27 +2068,52 @@
2936
2068
  "align": "center",
2937
2069
  "children": [
2938
2070
  {
2939
- "type": "icon",
2940
- "name": "check-circle",
2941
- "size": "lg"
2071
+ "type": "stack",
2072
+ "direction": "horizontal",
2073
+ "gap": "md",
2074
+ "align": "center",
2075
+ "children": [
2076
+ {
2077
+ "type": "icon",
2078
+ "name": "lock",
2079
+ "size": "lg"
2080
+ },
2081
+ {
2082
+ "type": "typography",
2083
+ "content": "Sign In",
2084
+ "variant": "h2"
2085
+ }
2086
+ ]
2942
2087
  },
2943
2088
  {
2944
- "type": "alert",
2945
- "variant": "success",
2946
- "message": "Payment successful! Sending receipt..."
2089
+ "type": "divider"
2947
2090
  },
2948
2091
  {
2949
- "type": "typography",
2950
- "variant": "body",
2951
- "color": "muted",
2952
- "content": "@entity.paymentIntentId"
2092
+ "type": "select",
2093
+ "label": "Provider",
2094
+ "field": "provider",
2095
+ "bind": "@entity.provider",
2096
+ "options": [
2097
+ {
2098
+ "label": "Google",
2099
+ "value": "google"
2100
+ },
2101
+ {
2102
+ "label": "GitHub",
2103
+ "value": "github"
2104
+ },
2105
+ {
2106
+ "label": "Microsoft",
2107
+ "value": "microsoft"
2108
+ }
2109
+ ]
2953
2110
  },
2954
2111
  {
2955
2112
  "type": "button",
2956
- "label": "New Payment",
2957
- "event": "RESET",
2958
- "variant": "ghost",
2959
- "icon": "rotate-ccw"
2113
+ "label": "Login",
2114
+ "event": "LOGIN",
2115
+ "variant": "primary",
2116
+ "icon": "log-in"
2960
2117
  }
2961
2118
  ]
2962
2119
  }
@@ -2964,112 +2121,168 @@
2964
2121
  }
2965
2122
  ]
2966
2123
  ]
2124
+ }
2125
+ ]
2126
+ }
2127
+ }
2128
+ ],
2129
+ "pages": [
2130
+ {
2131
+ "name": "LoginPage",
2132
+ "path": "/login",
2133
+ "traits": [
2134
+ {
2135
+ "ref": "AuthSessionOauth"
2136
+ }
2137
+ ]
2138
+ }
2139
+ ]
2140
+ },
2141
+ {
2142
+ "name": "OrderPaymentOrbital",
2143
+ "entity": {
2144
+ "name": "OrderPayment",
2145
+ "persistence": "runtime",
2146
+ "fields": [
2147
+ {
2148
+ "name": "id",
2149
+ "type": "string",
2150
+ "required": true
2151
+ },
2152
+ {
2153
+ "name": "amount",
2154
+ "type": "number"
2155
+ },
2156
+ {
2157
+ "name": "currency",
2158
+ "type": "string",
2159
+ "default": "usd"
2160
+ },
2161
+ {
2162
+ "name": "paymentIntentId",
2163
+ "type": "string"
2164
+ },
2165
+ {
2166
+ "name": "clientSecret",
2167
+ "type": "string"
2168
+ },
2169
+ {
2170
+ "name": "paymentStatus",
2171
+ "type": "string",
2172
+ "default": "idle"
2173
+ },
2174
+ {
2175
+ "name": "to",
2176
+ "type": "string"
2177
+ },
2178
+ {
2179
+ "name": "subject",
2180
+ "type": "string",
2181
+ "default": "Payment Receipt"
2182
+ },
2183
+ {
2184
+ "name": "body",
2185
+ "type": "string"
2186
+ },
2187
+ {
2188
+ "name": "sendStatus",
2189
+ "type": "string",
2190
+ "default": "idle"
2191
+ },
2192
+ {
2193
+ "name": "error",
2194
+ "type": "string"
2195
+ }
2196
+ ]
2197
+ },
2198
+ "traits": [
2199
+ {
2200
+ "name": "OrderPaymentPayment",
2201
+ "linkedEntity": "OrderPayment",
2202
+ "category": "interaction",
2203
+ "emits": [
2204
+ {
2205
+ "event": "SEND_RECEIPT"
2206
+ }
2207
+ ],
2208
+ "stateMachine": {
2209
+ "states": [
2210
+ {
2211
+ "name": "idle",
2212
+ "isInitial": true
2213
+ },
2214
+ {
2215
+ "name": "creating"
2967
2216
  },
2968
2217
  {
2969
- "from": "creating",
2970
- "to": "error",
2971
- "event": "FAILED",
2972
- "effects": [
2973
- [
2974
- "set",
2975
- "@entity.error",
2976
- "@payload.error"
2977
- ],
2978
- [
2979
- "render-ui",
2980
- "main",
2981
- {
2982
- "type": "dashboard-layout",
2983
- "appName": "ServiceMarketplace",
2984
- "navItems": [
2985
- {
2986
- "label": "Products",
2987
- "href": "/products",
2988
- "icon": "package"
2989
- },
2990
- {
2991
- "label": "Login",
2992
- "href": "/login",
2993
- "icon": "layout-list"
2994
- },
2995
- {
2996
- "label": "Checkout",
2997
- "href": "/checkout",
2998
- "icon": "credit-card"
2999
- },
3000
- {
3001
- "label": "Orders",
3002
- "href": "/orders",
3003
- "icon": "clipboard-list"
3004
- }
3005
- ],
3006
- "children": [
3007
- {
3008
- "type": "error-state",
3009
- "title": "Payment Failed",
3010
- "message": "@entity.error",
3011
- "onRetry": "RETRY"
3012
- }
3013
- ]
3014
- }
3015
- ]
2218
+ "name": "confirming"
2219
+ },
2220
+ {
2221
+ "name": "succeeded"
2222
+ },
2223
+ {
2224
+ "name": "error"
2225
+ }
2226
+ ],
2227
+ "events": [
2228
+ {
2229
+ "key": "INIT",
2230
+ "name": "Initialize"
2231
+ },
2232
+ {
2233
+ "key": "CREATE_PAYMENT",
2234
+ "name": "Create Payment"
2235
+ },
2236
+ {
2237
+ "key": "PAYMENT_CREATED",
2238
+ "name": "Payment Created",
2239
+ "payload": [
2240
+ {
2241
+ "name": "id",
2242
+ "type": "string",
2243
+ "required": true
2244
+ },
2245
+ {
2246
+ "name": "clientSecret",
2247
+ "type": "string",
2248
+ "required": true
2249
+ }
3016
2250
  ]
3017
2251
  },
3018
2252
  {
3019
- "from": "confirming",
3020
- "to": "error",
3021
- "event": "FAILED",
3022
- "effects": [
3023
- [
3024
- "set",
3025
- "@entity.error",
3026
- "@payload.error"
3027
- ],
3028
- [
3029
- "render-ui",
3030
- "main",
3031
- {
3032
- "type": "dashboard-layout",
3033
- "appName": "ServiceMarketplace",
3034
- "navItems": [
3035
- {
3036
- "label": "Products",
3037
- "href": "/products",
3038
- "icon": "package"
3039
- },
3040
- {
3041
- "label": "Login",
3042
- "href": "/login",
3043
- "icon": "layout-list"
3044
- },
3045
- {
3046
- "label": "Checkout",
3047
- "href": "/checkout",
3048
- "icon": "credit-card"
3049
- },
3050
- {
3051
- "label": "Orders",
3052
- "href": "/orders",
3053
- "icon": "clipboard-list"
3054
- }
3055
- ],
3056
- "children": [
3057
- {
3058
- "type": "error-state",
3059
- "title": "Payment Failed",
3060
- "message": "@entity.error",
3061
- "onRetry": "RETRY"
3062
- }
3063
- ]
3064
- }
3065
- ]
2253
+ "key": "PAYMENT_CONFIRMED",
2254
+ "name": "Payment Confirmed"
2255
+ },
2256
+ {
2257
+ "key": "FAILED",
2258
+ "name": "Failed",
2259
+ "payload": [
2260
+ {
2261
+ "name": "error",
2262
+ "type": "string",
2263
+ "required": true
2264
+ }
3066
2265
  ]
3067
2266
  },
3068
2267
  {
3069
- "from": "error",
2268
+ "key": "RETRY",
2269
+ "name": "Retry"
2270
+ },
2271
+ {
2272
+ "key": "RESET",
2273
+ "name": "Reset"
2274
+ }
2275
+ ],
2276
+ "transitions": [
2277
+ {
2278
+ "from": "idle",
3070
2279
  "to": "idle",
3071
- "event": "RETRY",
2280
+ "event": "INIT",
3072
2281
  "effects": [
2282
+ [
2283
+ "fetch",
2284
+ "OrderPayment"
2285
+ ],
3073
2286
  [
3074
2287
  "render-ui",
3075
2288
  "main",
@@ -3174,9 +2387,9 @@
3174
2387
  ]
3175
2388
  },
3176
2389
  {
3177
- "from": "succeeded",
3178
- "to": "idle",
3179
- "event": "RESET",
2390
+ "from": "idle",
2391
+ "to": "creating",
2392
+ "event": "CREATE_PAYMENT",
3180
2393
  "effects": [
3181
2394
  [
3182
2395
  "render-ui",
@@ -3208,84 +2421,100 @@
3208
2421
  ],
3209
2422
  "children": [
3210
2423
  {
3211
- "type": "stack",
3212
- "direction": "vertical",
3213
- "gap": "lg",
3214
- "align": "center",
3215
- "children": [
3216
- {
3217
- "type": "stack",
3218
- "direction": "horizontal",
3219
- "gap": "md",
3220
- "align": "center",
3221
- "children": [
3222
- {
3223
- "type": "icon",
3224
- "name": "credit-card",
3225
- "size": "lg"
3226
- },
3227
- {
3228
- "type": "typography",
3229
- "content": "Payment",
3230
- "variant": "h2"
3231
- }
3232
- ]
3233
- },
3234
- {
3235
- "type": "divider"
3236
- },
3237
- {
3238
- "type": "stack",
3239
- "direction": "vertical",
3240
- "gap": "md",
3241
- "children": [
3242
- {
3243
- "type": "input",
3244
- "label": "Amount",
3245
- "field": "amount",
3246
- "inputType": "number",
3247
- "placeholder": "0.00"
3248
- },
3249
- {
3250
- "type": "select",
3251
- "label": "Currency",
3252
- "field": "currency",
3253
- "options": [
3254
- {
3255
- "label": "USD",
3256
- "value": "usd"
3257
- },
3258
- {
3259
- "label": "EUR",
3260
- "value": "eur"
3261
- },
3262
- {
3263
- "label": "GBP",
3264
- "value": "gbp"
3265
- }
3266
- ]
3267
- }
3268
- ]
3269
- },
3270
- {
3271
- "type": "button",
3272
- "label": "Pay",
3273
- "event": "CREATE_PAYMENT",
3274
- "variant": "primary",
3275
- "icon": "credit-card"
3276
- }
3277
- ]
2424
+ "type": "loading-state",
2425
+ "title": "Creating payment...",
2426
+ "message": "Setting up your payment intent."
2427
+ }
2428
+ ]
2429
+ }
2430
+ ],
2431
+ [
2432
+ "call-service",
2433
+ "stripe",
2434
+ "createPaymentIntent",
2435
+ {
2436
+ "amount": "@entity.amount",
2437
+ "currency": "@entity.currency"
2438
+ }
2439
+ ]
2440
+ ]
2441
+ },
2442
+ {
2443
+ "from": "creating",
2444
+ "to": "confirming",
2445
+ "event": "PAYMENT_CREATED",
2446
+ "effects": [
2447
+ [
2448
+ "set",
2449
+ "@entity.paymentIntentId",
2450
+ "@payload.id"
2451
+ ],
2452
+ [
2453
+ "set",
2454
+ "@entity.clientSecret",
2455
+ "@payload.clientSecret"
2456
+ ],
2457
+ [
2458
+ "render-ui",
2459
+ "main",
2460
+ {
2461
+ "type": "dashboard-layout",
2462
+ "appName": "ServiceMarketplace",
2463
+ "navItems": [
2464
+ {
2465
+ "label": "Products",
2466
+ "href": "/products",
2467
+ "icon": "package"
2468
+ },
2469
+ {
2470
+ "label": "Login",
2471
+ "href": "/login",
2472
+ "icon": "layout-list"
2473
+ },
2474
+ {
2475
+ "label": "Checkout",
2476
+ "href": "/checkout",
2477
+ "icon": "credit-card"
2478
+ },
2479
+ {
2480
+ "label": "Orders",
2481
+ "href": "/orders",
2482
+ "icon": "clipboard-list"
2483
+ }
2484
+ ],
2485
+ "children": [
2486
+ {
2487
+ "type": "loading-state",
2488
+ "title": "Confirming payment...",
2489
+ "message": "Processing your payment."
3278
2490
  }
3279
2491
  ]
3280
2492
  }
2493
+ ],
2494
+ [
2495
+ "call-service",
2496
+ "stripe",
2497
+ "confirmPayment",
2498
+ {
2499
+ "paymentIntentId": "@entity.paymentIntentId"
2500
+ }
3281
2501
  ]
3282
2502
  ]
3283
2503
  },
3284
2504
  {
3285
- "from": "error",
3286
- "to": "idle",
3287
- "event": "RESET",
2505
+ "from": "confirming",
2506
+ "to": "succeeded",
2507
+ "event": "PAYMENT_CONFIRMED",
3288
2508
  "effects": [
2509
+ [
2510
+ "set",
2511
+ "@entity.paymentStatus",
2512
+ "succeeded"
2513
+ ],
2514
+ [
2515
+ "emit",
2516
+ "SEND_RECEIPT"
2517
+ ],
3289
2518
  [
3290
2519
  "render-ui",
3291
2520
  "main",
@@ -3322,65 +2551,27 @@
3322
2551
  "align": "center",
3323
2552
  "children": [
3324
2553
  {
3325
- "type": "stack",
3326
- "direction": "horizontal",
3327
- "gap": "md",
3328
- "align": "center",
3329
- "children": [
3330
- {
3331
- "type": "icon",
3332
- "name": "credit-card",
3333
- "size": "lg"
3334
- },
3335
- {
3336
- "type": "typography",
3337
- "content": "Payment",
3338
- "variant": "h2"
3339
- }
3340
- ]
2554
+ "type": "icon",
2555
+ "name": "check-circle",
2556
+ "size": "lg"
3341
2557
  },
3342
2558
  {
3343
- "type": "divider"
2559
+ "type": "alert",
2560
+ "variant": "success",
2561
+ "message": "Payment successful! Sending receipt..."
3344
2562
  },
3345
2563
  {
3346
- "type": "stack",
3347
- "direction": "vertical",
3348
- "gap": "md",
3349
- "children": [
3350
- {
3351
- "type": "input",
3352
- "label": "Amount",
3353
- "field": "amount",
3354
- "inputType": "number",
3355
- "placeholder": "0.00"
3356
- },
3357
- {
3358
- "type": "select",
3359
- "label": "Currency",
3360
- "field": "currency",
3361
- "options": [
3362
- {
3363
- "label": "USD",
3364
- "value": "usd"
3365
- },
3366
- {
3367
- "label": "EUR",
3368
- "value": "eur"
3369
- },
3370
- {
3371
- "label": "GBP",
3372
- "value": "gbp"
3373
- }
3374
- ]
3375
- }
3376
- ]
2564
+ "type": "typography",
2565
+ "variant": "body",
2566
+ "color": "muted",
2567
+ "content": "@entity.paymentIntentId"
3377
2568
  },
3378
2569
  {
3379
2570
  "type": "button",
3380
- "label": "Pay",
3381
- "event": "CREATE_PAYMENT",
3382
- "variant": "primary",
3383
- "icon": "credit-card"
2571
+ "label": "New Payment",
2572
+ "event": "RESET",
2573
+ "variant": "ghost",
2574
+ "icon": "rotate-ccw"
3384
2575
  }
3385
2576
  ]
3386
2577
  }
@@ -3388,79 +2579,17 @@
3388
2579
  }
3389
2580
  ]
3390
2581
  ]
3391
- }
3392
- ]
3393
- },
3394
- "listens": [
3395
- {
3396
- "event": "CHECKOUT",
3397
- "triggers": "INIT",
3398
- "scope": "external"
3399
- }
3400
- ]
3401
- },
3402
- {
3403
- "name": "OrderPaymentReceipt",
3404
- "linkedEntity": "OrderPayment",
3405
- "category": "interaction",
3406
- "listens": [
3407
- {
3408
- "event": "SEND_RECEIPT",
3409
- "triggers": "SEND_RECEIPT"
3410
- }
3411
- ],
3412
- "stateMachine": {
3413
- "states": [
3414
- {
3415
- "name": "waiting",
3416
- "isInitial": true
3417
- },
3418
- {
3419
- "name": "sending"
3420
- },
3421
- {
3422
- "name": "sent",
3423
- "isTerminal": true
3424
- },
3425
- {
3426
- "name": "receiptError"
3427
- }
3428
- ],
3429
- "events": [
3430
- {
3431
- "key": "INIT",
3432
- "name": "Initialize"
3433
- },
3434
- {
3435
- "key": "SEND_RECEIPT",
3436
- "name": "Send Receipt"
3437
- },
3438
- {
3439
- "key": "SENT",
3440
- "name": "Receipt Sent"
3441
- },
3442
- {
3443
- "key": "FAILED",
3444
- "name": "Send Failed",
3445
- "payload": [
3446
- {
3447
- "name": "error",
3448
- "type": "string",
3449
- "required": true
3450
- }
3451
- ]
3452
2582
  },
3453
2583
  {
3454
- "key": "RETRY_RECEIPT",
3455
- "name": "Retry Receipt"
3456
- }
3457
- ],
3458
- "transitions": [
3459
- {
3460
- "from": "waiting",
3461
- "to": "waiting",
3462
- "event": "INIT",
2584
+ "from": "creating",
2585
+ "to": "error",
2586
+ "event": "FAILED",
3463
2587
  "effects": [
2588
+ [
2589
+ "set",
2590
+ "@entity.error",
2591
+ "@payload.error"
2592
+ ],
3464
2593
  [
3465
2594
  "render-ui",
3466
2595
  "main",
@@ -3491,23 +2620,10 @@
3491
2620
  ],
3492
2621
  "children": [
3493
2622
  {
3494
- "type": "stack",
3495
- "direction": "vertical",
3496
- "gap": "md",
3497
- "align": "center",
3498
- "children": [
3499
- {
3500
- "type": "icon",
3501
- "name": "mail",
3502
- "size": "md"
3503
- },
3504
- {
3505
- "type": "typography",
3506
- "content": "Receipt will be sent after payment.",
3507
- "variant": "body",
3508
- "color": "muted"
3509
- }
3510
- ]
2623
+ "type": "error-state",
2624
+ "title": "Payment Failed",
2625
+ "message": "@entity.error",
2626
+ "onRetry": "RETRY"
3511
2627
  }
3512
2628
  ]
3513
2629
  }
@@ -3515,10 +2631,15 @@
3515
2631
  ]
3516
2632
  },
3517
2633
  {
3518
- "from": "waiting",
3519
- "to": "sending",
3520
- "event": "SEND_RECEIPT",
2634
+ "from": "confirming",
2635
+ "to": "error",
2636
+ "event": "FAILED",
3521
2637
  "effects": [
2638
+ [
2639
+ "set",
2640
+ "@entity.error",
2641
+ "@payload.error"
2642
+ ],
3522
2643
  [
3523
2644
  "render-ui",
3524
2645
  "main",
@@ -3548,36 +2669,22 @@
3548
2669
  }
3549
2670
  ],
3550
2671
  "children": [
3551
- {
3552
- "type": "loading-state",
3553
- "title": "Sending receipt...",
3554
- "message": "Delivering your payment receipt."
3555
- }
3556
- ]
3557
- }
3558
- ],
3559
- [
3560
- "call-service",
3561
- "email",
3562
- "send",
3563
- {
3564
- "to": "@entity.to",
3565
- "subject": "@entity.subject",
3566
- "body": "@entity.body"
2672
+ {
2673
+ "type": "error-state",
2674
+ "title": "Payment Failed",
2675
+ "message": "@entity.error",
2676
+ "onRetry": "RETRY"
2677
+ }
2678
+ ]
3567
2679
  }
3568
2680
  ]
3569
2681
  ]
3570
2682
  },
3571
2683
  {
3572
- "from": "sending",
3573
- "to": "sent",
3574
- "event": "SENT",
2684
+ "from": "error",
2685
+ "to": "idle",
2686
+ "event": "RETRY",
3575
2687
  "effects": [
3576
- [
3577
- "set",
3578
- "@entity.sendStatus",
3579
- "sent"
3580
- ],
3581
2688
  [
3582
2689
  "render-ui",
3583
2690
  "main",
@@ -3610,18 +2717,69 @@
3610
2717
  {
3611
2718
  "type": "stack",
3612
2719
  "direction": "vertical",
3613
- "gap": "md",
2720
+ "gap": "lg",
3614
2721
  "align": "center",
3615
2722
  "children": [
3616
2723
  {
3617
- "type": "icon",
3618
- "name": "check-circle",
3619
- "size": "md"
2724
+ "type": "stack",
2725
+ "direction": "horizontal",
2726
+ "gap": "md",
2727
+ "align": "center",
2728
+ "children": [
2729
+ {
2730
+ "type": "icon",
2731
+ "name": "credit-card",
2732
+ "size": "lg"
2733
+ },
2734
+ {
2735
+ "type": "typography",
2736
+ "content": "Payment",
2737
+ "variant": "h2"
2738
+ }
2739
+ ]
3620
2740
  },
3621
2741
  {
3622
- "type": "alert",
3623
- "variant": "success",
3624
- "message": "Receipt sent successfully"
2742
+ "type": "divider"
2743
+ },
2744
+ {
2745
+ "type": "stack",
2746
+ "direction": "vertical",
2747
+ "gap": "md",
2748
+ "children": [
2749
+ {
2750
+ "type": "input",
2751
+ "label": "Amount",
2752
+ "field": "amount",
2753
+ "inputType": "number",
2754
+ "placeholder": "0.00"
2755
+ },
2756
+ {
2757
+ "type": "select",
2758
+ "label": "Currency",
2759
+ "field": "currency",
2760
+ "options": [
2761
+ {
2762
+ "label": "USD",
2763
+ "value": "usd"
2764
+ },
2765
+ {
2766
+ "label": "EUR",
2767
+ "value": "eur"
2768
+ },
2769
+ {
2770
+ "label": "GBP",
2771
+ "value": "gbp"
2772
+ }
2773
+ ]
2774
+ }
2775
+ ]
2776
+ },
2777
+ {
2778
+ "type": "button",
2779
+ "label": "Pay",
2780
+ "event": "CREATE_PAYMENT",
2781
+ "variant": "primary",
2782
+ "icon": "credit-card"
3625
2783
  }
3626
2784
  ]
3627
2785
  }
@@ -3631,15 +2789,10 @@
3631
2789
  ]
3632
2790
  },
3633
2791
  {
3634
- "from": "sending",
3635
- "to": "receiptError",
3636
- "event": "FAILED",
2792
+ "from": "succeeded",
2793
+ "to": "idle",
2794
+ "event": "RESET",
3637
2795
  "effects": [
3638
- [
3639
- "set",
3640
- "@entity.sendStatus",
3641
- "error"
3642
- ],
3643
2796
  [
3644
2797
  "render-ui",
3645
2798
  "main",
@@ -3672,21 +2825,69 @@
3672
2825
  {
3673
2826
  "type": "stack",
3674
2827
  "direction": "vertical",
3675
- "gap": "md",
2828
+ "gap": "lg",
3676
2829
  "align": "center",
3677
2830
  "children": [
3678
2831
  {
3679
- "type": "error-state",
3680
- "title": "Receipt Failed",
3681
- "message": "Could not send receipt email.",
3682
- "onRetry": "RETRY_RECEIPT"
2832
+ "type": "stack",
2833
+ "direction": "horizontal",
2834
+ "gap": "md",
2835
+ "align": "center",
2836
+ "children": [
2837
+ {
2838
+ "type": "icon",
2839
+ "name": "credit-card",
2840
+ "size": "lg"
2841
+ },
2842
+ {
2843
+ "type": "typography",
2844
+ "content": "Payment",
2845
+ "variant": "h2"
2846
+ }
2847
+ ]
2848
+ },
2849
+ {
2850
+ "type": "divider"
2851
+ },
2852
+ {
2853
+ "type": "stack",
2854
+ "direction": "vertical",
2855
+ "gap": "md",
2856
+ "children": [
2857
+ {
2858
+ "type": "input",
2859
+ "label": "Amount",
2860
+ "field": "amount",
2861
+ "inputType": "number",
2862
+ "placeholder": "0.00"
2863
+ },
2864
+ {
2865
+ "type": "select",
2866
+ "label": "Currency",
2867
+ "field": "currency",
2868
+ "options": [
2869
+ {
2870
+ "label": "USD",
2871
+ "value": "usd"
2872
+ },
2873
+ {
2874
+ "label": "EUR",
2875
+ "value": "eur"
2876
+ },
2877
+ {
2878
+ "label": "GBP",
2879
+ "value": "gbp"
2880
+ }
2881
+ ]
2882
+ }
2883
+ ]
3683
2884
  },
3684
2885
  {
3685
2886
  "type": "button",
3686
- "label": "Retry",
3687
- "event": "RETRY_RECEIPT",
2887
+ "label": "Pay",
2888
+ "event": "CREATE_PAYMENT",
3688
2889
  "variant": "primary",
3689
- "icon": "refresh-cw"
2890
+ "icon": "credit-card"
3690
2891
  }
3691
2892
  ]
3692
2893
  }
@@ -3696,9 +2897,9 @@
3696
2897
  ]
3697
2898
  },
3698
2899
  {
3699
- "from": "receiptError",
3700
- "to": "sending",
3701
- "event": "RETRY_RECEIPT",
2900
+ "from": "error",
2901
+ "to": "idle",
2902
+ "event": "RESET",
3702
2903
  "effects": [
3703
2904
  [
3704
2905
  "render-ui",
@@ -3730,101 +2931,114 @@
3730
2931
  ],
3731
2932
  "children": [
3732
2933
  {
3733
- "type": "loading-state",
3734
- "title": "Sending receipt...",
3735
- "message": "Delivering your payment receipt."
2934
+ "type": "stack",
2935
+ "direction": "vertical",
2936
+ "gap": "lg",
2937
+ "align": "center",
2938
+ "children": [
2939
+ {
2940
+ "type": "stack",
2941
+ "direction": "horizontal",
2942
+ "gap": "md",
2943
+ "align": "center",
2944
+ "children": [
2945
+ {
2946
+ "type": "icon",
2947
+ "name": "credit-card",
2948
+ "size": "lg"
2949
+ },
2950
+ {
2951
+ "type": "typography",
2952
+ "content": "Payment",
2953
+ "variant": "h2"
2954
+ }
2955
+ ]
2956
+ },
2957
+ {
2958
+ "type": "divider"
2959
+ },
2960
+ {
2961
+ "type": "stack",
2962
+ "direction": "vertical",
2963
+ "gap": "md",
2964
+ "children": [
2965
+ {
2966
+ "type": "input",
2967
+ "label": "Amount",
2968
+ "field": "amount",
2969
+ "inputType": "number",
2970
+ "placeholder": "0.00"
2971
+ },
2972
+ {
2973
+ "type": "select",
2974
+ "label": "Currency",
2975
+ "field": "currency",
2976
+ "options": [
2977
+ {
2978
+ "label": "USD",
2979
+ "value": "usd"
2980
+ },
2981
+ {
2982
+ "label": "EUR",
2983
+ "value": "eur"
2984
+ },
2985
+ {
2986
+ "label": "GBP",
2987
+ "value": "gbp"
2988
+ }
2989
+ ]
2990
+ }
2991
+ ]
2992
+ },
2993
+ {
2994
+ "type": "button",
2995
+ "label": "Pay",
2996
+ "event": "CREATE_PAYMENT",
2997
+ "variant": "primary",
2998
+ "icon": "credit-card"
2999
+ }
3000
+ ]
3736
3001
  }
3737
3002
  ]
3738
3003
  }
3739
- ],
3740
- [
3741
- "call-service",
3742
- "email",
3743
- "send",
3744
- {
3745
- "to": "@entity.to",
3746
- "subject": "@entity.subject",
3747
- "body": "@entity.body"
3748
- }
3749
3004
  ]
3750
3005
  ]
3751
3006
  }
3752
- ]
3753
- }
3754
- }
3755
- ],
3756
- "pages": [
3757
- {
3758
- "name": "CheckoutPage",
3759
- "path": "/checkout",
3760
- "traits": [
3761
- {
3762
- "ref": "OrderPaymentPayment"
3763
- },
3007
+ ]
3008
+ },
3009
+ "listens": [
3764
3010
  {
3765
- "ref": "OrderPaymentReceipt"
3011
+ "event": "CHECKOUT",
3012
+ "triggers": "INIT",
3013
+ "scope": "external"
3766
3014
  }
3767
3015
  ]
3768
- }
3769
- ],
3770
- "services": []
3771
- },
3772
- {
3773
- "name": "OrderOrbital",
3774
- "entity": {
3775
- "name": "Order",
3776
- "persistence": "persistent",
3777
- "collection": "orders",
3778
- "fields": [
3779
- {
3780
- "name": "id",
3781
- "type": "string",
3782
- "required": true
3783
- },
3784
- {
3785
- "name": "productName",
3786
- "type": "string",
3787
- "required": true
3788
- },
3789
- {
3790
- "name": "amount",
3791
- "type": "number",
3792
- "required": true
3793
- },
3794
- {
3795
- "name": "paymentStatus",
3796
- "type": "string",
3797
- "default": "pending"
3798
- },
3799
- {
3800
- "name": "orderDate",
3801
- "type": "string"
3802
- }
3803
- ]
3804
- },
3805
- "traits": [
3016
+ },
3806
3017
  {
3807
- "name": "OrderBrowse",
3808
- "linkedEntity": "Order",
3018
+ "name": "OrderPaymentReceipt",
3019
+ "linkedEntity": "OrderPayment",
3809
3020
  "category": "interaction",
3810
3021
  "listens": [
3811
3022
  {
3812
- "event": "ORDER_CREATED",
3813
- "triggers": "ORDER_CREATED"
3814
- },
3815
- {
3816
- "event": "ORDER_UPDATED",
3817
- "triggers": "ORDER_UPDATED"
3023
+ "event": "SEND_RECEIPT",
3024
+ "triggers": "SEND_RECEIPT"
3818
3025
  }
3819
3026
  ],
3820
3027
  "stateMachine": {
3821
3028
  "states": [
3822
3029
  {
3823
- "name": "browsing",
3030
+ "name": "waiting",
3824
3031
  "isInitial": true
3825
3032
  },
3826
3033
  {
3827
- "name": "deleting"
3034
+ "name": "sending"
3035
+ },
3036
+ {
3037
+ "name": "sent",
3038
+ "isTerminal": true
3039
+ },
3040
+ {
3041
+ "name": "receiptError"
3828
3042
  }
3829
3043
  ],
3830
3044
  "events": [
@@ -3833,99 +3047,35 @@
3833
3047
  "name": "Initialize"
3834
3048
  },
3835
3049
  {
3836
- "key": "CREATE",
3837
- "name": "CREATE"
3838
- },
3839
- {
3840
- "key": "VIEW",
3841
- "name": "VIEW",
3842
- "payload": [
3843
- {
3844
- "name": "id",
3845
- "type": "string",
3846
- "required": true
3847
- },
3848
- {
3849
- "name": "row",
3850
- "type": "object"
3851
- }
3852
- ]
3050
+ "key": "SEND_RECEIPT",
3051
+ "name": "Send Receipt"
3853
3052
  },
3854
3053
  {
3855
- "key": "EDIT",
3856
- "name": "EDIT",
3857
- "payload": [
3858
- {
3859
- "name": "id",
3860
- "type": "string",
3861
- "required": true
3862
- },
3863
- {
3864
- "name": "row",
3865
- "type": "object"
3866
- }
3867
- ]
3054
+ "key": "SENT",
3055
+ "name": "Receipt Sent"
3868
3056
  },
3869
3057
  {
3870
- "key": "DELETE",
3871
- "name": "DELETE",
3058
+ "key": "FAILED",
3059
+ "name": "Send Failed",
3872
3060
  "payload": [
3873
3061
  {
3874
- "name": "id",
3062
+ "name": "error",
3875
3063
  "type": "string",
3876
3064
  "required": true
3877
- },
3878
- {
3879
- "name": "row",
3880
- "type": "object"
3881
- }
3882
- ]
3883
- },
3884
- {
3885
- "key": "ORDER_CREATED",
3886
- "name": "ORDER_CREATED",
3887
- "payload": [
3888
- {
3889
- "name": "data",
3890
- "type": "object",
3891
- "required": true
3892
- }
3893
- ]
3894
- },
3895
- {
3896
- "key": "ORDER_UPDATED",
3897
- "name": "ORDER_UPDATED",
3898
- "payload": [
3899
- {
3900
- "name": "data",
3901
- "type": "object",
3902
- "required": true
3903
3065
  }
3904
3066
  ]
3905
3067
  },
3906
3068
  {
3907
- "key": "CONFIRM_DELETE",
3908
- "name": "Confirm Delete"
3909
- },
3910
- {
3911
- "key": "CANCEL",
3912
- "name": "Cancel"
3913
- },
3914
- {
3915
- "key": "CLOSE",
3916
- "name": "Close"
3069
+ "key": "RETRY_RECEIPT",
3070
+ "name": "Retry Receipt"
3917
3071
  }
3918
3072
  ],
3919
3073
  "transitions": [
3920
3074
  {
3921
- "from": "browsing",
3922
- "to": "browsing",
3075
+ "from": "waiting",
3076
+ "to": "waiting",
3923
3077
  "event": "INIT",
3924
3078
  "effects": [
3925
- [
3926
- "ref",
3927
- "Order"
3928
- ],
3929
3079
  [
3930
3080
  "render-ui",
3931
3081
  "main",
@@ -3958,111 +3108,19 @@
3958
3108
  {
3959
3109
  "type": "stack",
3960
3110
  "direction": "vertical",
3961
- "gap": "lg",
3962
- "className": "max-w-5xl mx-auto w-full",
3111
+ "gap": "md",
3112
+ "align": "center",
3963
3113
  "children": [
3964
3114
  {
3965
- "type": "stack",
3966
- "direction": "horizontal",
3967
- "gap": "md",
3968
- "justify": "space-between",
3969
- "align": "center",
3970
- "children": [
3971
- {
3972
- "type": "stack",
3973
- "direction": "horizontal",
3974
- "gap": "sm",
3975
- "align": "center",
3976
- "children": [
3977
- {
3978
- "type": "icon",
3979
- "name": "list",
3980
- "size": "lg"
3981
- },
3982
- {
3983
- "type": "typography",
3984
- "content": "Orders",
3985
- "variant": "h2"
3986
- }
3987
- ]
3988
- },
3989
- {
3990
- "type": "stack",
3991
- "direction": "horizontal",
3992
- "gap": "sm",
3993
- "children": [
3994
- {
3995
- "type": "button",
3996
- "label": "Create Order",
3997
- "event": "CREATE",
3998
- "variant": "primary",
3999
- "icon": "plus"
4000
- }
4001
- ]
4002
- }
4003
- ]
4004
- },
4005
- {
4006
- "type": "divider"
3115
+ "type": "icon",
3116
+ "name": "mail",
3117
+ "size": "md"
4007
3118
  },
4008
3119
  {
4009
- "type": "data-grid",
4010
- "entity": "Order",
4011
- "emptyIcon": "inbox",
4012
- "emptyTitle": "No orders yet",
4013
- "emptyDescription": "Orders will appear here after checkout.",
4014
- "itemActions": [
4015
- {
4016
- "label": "View",
4017
- "event": "VIEW",
4018
- "variant": "ghost",
4019
- "size": "sm"
4020
- },
4021
- {
4022
- "label": "Edit",
4023
- "event": "EDIT",
4024
- "variant": "ghost",
4025
- "size": "sm"
4026
- },
4027
- {
4028
- "label": "Delete",
4029
- "event": "DELETE",
4030
- "variant": "danger",
4031
- "size": "sm"
4032
- }
4033
- ],
4034
- "columns": [
4035
- {
4036
- "name": "productName",
4037
- "label": "Product Name",
4038
- "variant": "h4",
4039
- "icon": "list"
4040
- },
4041
- {
4042
- "name": "amount",
4043
- "label": "Amount",
4044
- "variant": "badge",
4045
- "colorMap": {
4046
- "active": "success",
4047
- "completed": "success",
4048
- "done": "success",
4049
- "pending": "warning",
4050
- "draft": "warning",
4051
- "scheduled": "warning",
4052
- "inactive": "neutral",
4053
- "archived": "neutral",
4054
- "disabled": "neutral",
4055
- "error": "destructive",
4056
- "cancelled": "destructive",
4057
- "failed": "destructive"
4058
- }
4059
- },
4060
- {
4061
- "name": "paymentStatus",
4062
- "label": "Payment Status",
4063
- "variant": "caption"
4064
- }
4065
- ]
3120
+ "type": "typography",
3121
+ "content": "Receipt will be sent after payment.",
3122
+ "variant": "body",
3123
+ "color": "muted"
4066
3124
  }
4067
3125
  ]
4068
3126
  }
@@ -4072,95 +3130,113 @@
4072
3130
  ]
4073
3131
  },
4074
3132
  {
4075
- "from": "browsing",
4076
- "to": "browsing",
4077
- "event": "ORDER_CREATED",
3133
+ "from": "waiting",
3134
+ "to": "sending",
3135
+ "event": "SEND_RECEIPT",
4078
3136
  "effects": [
4079
3137
  [
4080
- "ref",
4081
- "Order"
4082
- ]
4083
- ]
4084
- },
4085
- {
4086
- "from": "browsing",
4087
- "to": "browsing",
4088
- "event": "ORDER_UPDATED",
4089
- "effects": [
3138
+ "render-ui",
3139
+ "main",
3140
+ {
3141
+ "type": "dashboard-layout",
3142
+ "appName": "ServiceMarketplace",
3143
+ "navItems": [
3144
+ {
3145
+ "label": "Products",
3146
+ "href": "/products",
3147
+ "icon": "package"
3148
+ },
3149
+ {
3150
+ "label": "Login",
3151
+ "href": "/login",
3152
+ "icon": "layout-list"
3153
+ },
3154
+ {
3155
+ "label": "Checkout",
3156
+ "href": "/checkout",
3157
+ "icon": "credit-card"
3158
+ },
3159
+ {
3160
+ "label": "Orders",
3161
+ "href": "/orders",
3162
+ "icon": "clipboard-list"
3163
+ }
3164
+ ],
3165
+ "children": [
3166
+ {
3167
+ "type": "loading-state",
3168
+ "title": "Sending receipt...",
3169
+ "message": "Delivering your payment receipt."
3170
+ }
3171
+ ]
3172
+ }
3173
+ ],
4090
3174
  [
4091
- "ref",
4092
- "Order"
3175
+ "call-service",
3176
+ "email",
3177
+ "send",
3178
+ {
3179
+ "to": "@entity.to",
3180
+ "subject": "@entity.subject",
3181
+ "body": "@entity.body"
3182
+ }
4093
3183
  ]
4094
3184
  ]
4095
3185
  },
4096
3186
  {
4097
- "from": "browsing",
4098
- "to": "deleting",
4099
- "event": "DELETE",
3187
+ "from": "sending",
3188
+ "to": "sent",
3189
+ "event": "SENT",
4100
3190
  "effects": [
4101
3191
  [
4102
- "fetch",
4103
- "Order",
4104
- {
4105
- "id": "@payload.id"
4106
- }
3192
+ "set",
3193
+ "@entity.sendStatus",
3194
+ "sent"
4107
3195
  ],
4108
3196
  [
4109
3197
  "render-ui",
4110
- "modal",
3198
+ "main",
4111
3199
  {
4112
- "type": "stack",
4113
- "direction": "vertical",
4114
- "gap": "md",
4115
- "children": [
3200
+ "type": "dashboard-layout",
3201
+ "appName": "ServiceMarketplace",
3202
+ "navItems": [
4116
3203
  {
4117
- "type": "stack",
4118
- "direction": "horizontal",
4119
- "gap": "sm",
4120
- "children": [
4121
- {
4122
- "type": "icon",
4123
- "name": "trash-2",
4124
- "size": "md"
4125
- },
4126
- {
4127
- "type": "typography",
4128
- "content": "Delete Order",
4129
- "variant": "h3"
4130
- }
4131
- ]
3204
+ "label": "Products",
3205
+ "href": "/products",
3206
+ "icon": "package"
4132
3207
  },
4133
3208
  {
4134
- "type": "divider"
3209
+ "label": "Login",
3210
+ "href": "/login",
3211
+ "icon": "layout-list"
4135
3212
  },
4136
3213
  {
4137
- "type": "typography",
4138
- "content": "@entity.productName",
4139
- "variant": "h4"
3214
+ "label": "Checkout",
3215
+ "href": "/checkout",
3216
+ "icon": "credit-card"
4140
3217
  },
4141
3218
  {
4142
- "type": "typography",
4143
- "content": "This action cannot be undone.",
4144
- "variant": "body"
4145
- },
3219
+ "label": "Orders",
3220
+ "href": "/orders",
3221
+ "icon": "clipboard-list"
3222
+ }
3223
+ ],
3224
+ "children": [
4146
3225
  {
4147
3226
  "type": "stack",
4148
- "direction": "horizontal",
4149
- "gap": "sm",
4150
- "justify": "end",
3227
+ "direction": "vertical",
3228
+ "gap": "md",
3229
+ "align": "center",
4151
3230
  "children": [
4152
3231
  {
4153
- "type": "button",
4154
- "label": "Cancel",
4155
- "event": "CANCEL",
4156
- "variant": "ghost"
3232
+ "type": "icon",
3233
+ "name": "check-circle",
3234
+ "size": "md"
4157
3235
  },
4158
3236
  {
4159
- "type": "button",
4160
- "label": "Delete",
4161
- "event": "CONFIRM_DELETE",
4162
- "variant": "danger",
4163
- "icon": "trash"
3237
+ "type": "alert",
3238
+ "variant": "success",
3239
+ "message": "Receipt sent successfully"
4164
3240
  }
4165
3241
  ]
4166
3242
  }
@@ -4170,20 +3246,14 @@
4170
3246
  ]
4171
3247
  },
4172
3248
  {
4173
- "from": "deleting",
4174
- "to": "browsing",
4175
- "event": "CONFIRM_DELETE",
3249
+ "from": "sending",
3250
+ "to": "receiptError",
3251
+ "event": "FAILED",
4176
3252
  "effects": [
4177
3253
  [
4178
- "persist",
4179
- "delete",
4180
- "Order",
4181
- "@entity.id"
4182
- ],
4183
- [
4184
- "render-ui",
4185
- "modal",
4186
- null
3254
+ "set",
3255
+ "@entity.sendStatus",
3256
+ "error"
4187
3257
  ],
4188
3258
  [
4189
3259
  "render-ui",
@@ -4217,137 +3287,34 @@
4217
3287
  {
4218
3288
  "type": "stack",
4219
3289
  "direction": "vertical",
4220
- "gap": "lg",
4221
- "className": "max-w-5xl mx-auto w-full",
3290
+ "gap": "md",
3291
+ "align": "center",
4222
3292
  "children": [
4223
3293
  {
4224
- "type": "stack",
4225
- "direction": "horizontal",
4226
- "gap": "md",
4227
- "justify": "space-between",
4228
- "align": "center",
4229
- "children": [
4230
- {
4231
- "type": "stack",
4232
- "direction": "horizontal",
4233
- "gap": "sm",
4234
- "align": "center",
4235
- "children": [
4236
- {
4237
- "type": "icon",
4238
- "name": "list",
4239
- "size": "lg"
4240
- },
4241
- {
4242
- "type": "typography",
4243
- "content": "Orders",
4244
- "variant": "h2"
4245
- }
4246
- ]
4247
- },
4248
- {
4249
- "type": "stack",
4250
- "direction": "horizontal",
4251
- "gap": "sm",
4252
- "children": [
4253
- {
4254
- "type": "button",
4255
- "label": "Create Order",
4256
- "event": "CREATE",
4257
- "variant": "primary",
4258
- "icon": "plus"
4259
- }
4260
- ]
4261
- }
4262
- ]
4263
- },
4264
- {
4265
- "type": "divider"
3294
+ "type": "error-state",
3295
+ "title": "Receipt Failed",
3296
+ "message": "Could not send receipt email.",
3297
+ "onRetry": "RETRY_RECEIPT"
4266
3298
  },
4267
3299
  {
4268
- "type": "data-grid",
4269
- "entity": "Order",
4270
- "emptyIcon": "inbox",
4271
- "emptyTitle": "No orders yet",
4272
- "emptyDescription": "Orders will appear here after checkout.",
4273
- "itemActions": [
4274
- {
4275
- "label": "View",
4276
- "event": "VIEW",
4277
- "variant": "ghost",
4278
- "size": "sm"
4279
- },
4280
- {
4281
- "label": "Edit",
4282
- "event": "EDIT",
4283
- "variant": "ghost",
4284
- "size": "sm"
4285
- },
4286
- {
4287
- "label": "Delete",
4288
- "event": "DELETE",
4289
- "variant": "danger",
4290
- "size": "sm"
4291
- }
4292
- ],
4293
- "columns": [
4294
- {
4295
- "name": "productName",
4296
- "label": "Product Name",
4297
- "variant": "h4",
4298
- "icon": "list"
4299
- },
4300
- {
4301
- "name": "amount",
4302
- "label": "Amount",
4303
- "variant": "badge",
4304
- "colorMap": {
4305
- "active": "success",
4306
- "completed": "success",
4307
- "done": "success",
4308
- "pending": "warning",
4309
- "draft": "warning",
4310
- "scheduled": "warning",
4311
- "inactive": "neutral",
4312
- "archived": "neutral",
4313
- "disabled": "neutral",
4314
- "error": "destructive",
4315
- "cancelled": "destructive",
4316
- "failed": "destructive"
4317
- }
4318
- },
4319
- {
4320
- "name": "paymentStatus",
4321
- "label": "Payment Status",
4322
- "variant": "caption"
4323
- }
4324
- ]
3300
+ "type": "button",
3301
+ "label": "Retry",
3302
+ "event": "RETRY_RECEIPT",
3303
+ "variant": "primary",
3304
+ "icon": "refresh-cw"
4325
3305
  }
4326
3306
  ]
4327
3307
  }
4328
3308
  ]
4329
3309
  }
4330
- ],
4331
- [
4332
- "notify",
4333
- "Order deleted successfully"
4334
3310
  ]
4335
3311
  ]
4336
3312
  },
4337
3313
  {
4338
- "from": "deleting",
4339
- "to": "browsing",
4340
- "event": "CANCEL",
3314
+ "from": "receiptError",
3315
+ "to": "sending",
3316
+ "event": "RETRY_RECEIPT",
4341
3317
  "effects": [
4342
- [
4343
- "render-ui",
4344
- "modal",
4345
- null
4346
- ],
4347
- [
4348
- "fetch",
4349
- "Order"
4350
- ],
4351
3318
  [
4352
3319
  "render-ui",
4353
3320
  "main",
@@ -4378,133 +3345,166 @@
4378
3345
  ],
4379
3346
  "children": [
4380
3347
  {
4381
- "type": "stack",
4382
- "direction": "vertical",
4383
- "gap": "lg",
4384
- "className": "max-w-5xl mx-auto w-full",
4385
- "children": [
4386
- {
4387
- "type": "stack",
4388
- "direction": "horizontal",
4389
- "gap": "md",
4390
- "justify": "space-between",
4391
- "align": "center",
4392
- "children": [
4393
- {
4394
- "type": "stack",
4395
- "direction": "horizontal",
4396
- "gap": "sm",
4397
- "align": "center",
4398
- "children": [
4399
- {
4400
- "type": "icon",
4401
- "name": "list",
4402
- "size": "lg"
4403
- },
4404
- {
4405
- "type": "typography",
4406
- "content": "Orders",
4407
- "variant": "h2"
4408
- }
4409
- ]
4410
- },
4411
- {
4412
- "type": "stack",
4413
- "direction": "horizontal",
4414
- "gap": "sm",
4415
- "children": [
4416
- {
4417
- "type": "button",
4418
- "label": "Create Order",
4419
- "event": "CREATE",
4420
- "variant": "primary",
4421
- "icon": "plus"
4422
- }
4423
- ]
4424
- }
4425
- ]
4426
- },
4427
- {
4428
- "type": "divider"
4429
- },
4430
- {
4431
- "type": "data-grid",
4432
- "entity": "Order",
4433
- "emptyIcon": "inbox",
4434
- "emptyTitle": "No orders yet",
4435
- "emptyDescription": "Orders will appear here after checkout.",
4436
- "itemActions": [
4437
- {
4438
- "label": "View",
4439
- "event": "VIEW",
4440
- "variant": "ghost",
4441
- "size": "sm"
4442
- },
4443
- {
4444
- "label": "Edit",
4445
- "event": "EDIT",
4446
- "variant": "ghost",
4447
- "size": "sm"
4448
- },
4449
- {
4450
- "label": "Delete",
4451
- "event": "DELETE",
4452
- "variant": "danger",
4453
- "size": "sm"
4454
- }
4455
- ],
4456
- "columns": [
4457
- {
4458
- "name": "productName",
4459
- "label": "Product Name",
4460
- "variant": "h4",
4461
- "icon": "list"
4462
- },
4463
- {
4464
- "name": "amount",
4465
- "label": "Amount",
4466
- "variant": "badge",
4467
- "colorMap": {
4468
- "active": "success",
4469
- "completed": "success",
4470
- "done": "success",
4471
- "pending": "warning",
4472
- "draft": "warning",
4473
- "scheduled": "warning",
4474
- "inactive": "neutral",
4475
- "archived": "neutral",
4476
- "disabled": "neutral",
4477
- "error": "destructive",
4478
- "cancelled": "destructive",
4479
- "failed": "destructive"
4480
- }
4481
- },
4482
- {
4483
- "name": "paymentStatus",
4484
- "label": "Payment Status",
4485
- "variant": "caption"
4486
- }
4487
- ]
4488
- }
4489
- ]
3348
+ "type": "loading-state",
3349
+ "title": "Sending receipt...",
3350
+ "message": "Delivering your payment receipt."
4490
3351
  }
4491
3352
  ]
4492
3353
  }
3354
+ ],
3355
+ [
3356
+ "call-service",
3357
+ "email",
3358
+ "send",
3359
+ {
3360
+ "to": "@entity.to",
3361
+ "subject": "@entity.subject",
3362
+ "body": "@entity.body"
3363
+ }
4493
3364
  ]
4494
3365
  ]
3366
+ }
3367
+ ]
3368
+ }
3369
+ }
3370
+ ],
3371
+ "pages": [
3372
+ {
3373
+ "name": "CheckoutPage",
3374
+ "path": "/checkout",
3375
+ "traits": [
3376
+ {
3377
+ "ref": "OrderPaymentPayment"
3378
+ },
3379
+ {
3380
+ "ref": "OrderPaymentReceipt"
3381
+ }
3382
+ ]
3383
+ }
3384
+ ]
3385
+ },
3386
+ {
3387
+ "name": "OrderOrbital",
3388
+ "entity": {
3389
+ "name": "Order",
3390
+ "persistence": "persistent",
3391
+ "collection": "orders",
3392
+ "fields": [
3393
+ {
3394
+ "name": "id",
3395
+ "type": "string",
3396
+ "required": true
3397
+ },
3398
+ {
3399
+ "name": "productName",
3400
+ "type": "string",
3401
+ "required": true
3402
+ },
3403
+ {
3404
+ "name": "amount",
3405
+ "type": "number",
3406
+ "required": true
3407
+ },
3408
+ {
3409
+ "name": "paymentStatus",
3410
+ "type": "string",
3411
+ "default": "pending"
3412
+ },
3413
+ {
3414
+ "name": "orderDate",
3415
+ "type": "string"
3416
+ }
3417
+ ]
3418
+ },
3419
+ "traits": [
3420
+ {
3421
+ "name": "OrderBrowse",
3422
+ "linkedEntity": "Order",
3423
+ "category": "interaction",
3424
+ "listens": [
3425
+ {
3426
+ "event": "ORDER_CREATED",
3427
+ "triggers": "INIT"
3428
+ },
3429
+ {
3430
+ "event": "ORDER_UPDATED",
3431
+ "triggers": "INIT"
3432
+ },
3433
+ {
3434
+ "event": "ORDER_DELETED",
3435
+ "triggers": "INIT"
3436
+ }
3437
+ ],
3438
+ "stateMachine": {
3439
+ "states": [
3440
+ {
3441
+ "name": "browsing",
3442
+ "isInitial": true
3443
+ }
3444
+ ],
3445
+ "events": [
3446
+ {
3447
+ "key": "INIT",
3448
+ "name": "Initialize"
3449
+ },
3450
+ {
3451
+ "key": "CREATE",
3452
+ "name": "CREATE"
3453
+ },
3454
+ {
3455
+ "key": "VIEW",
3456
+ "name": "VIEW",
3457
+ "payload": [
3458
+ {
3459
+ "name": "id",
3460
+ "type": "string",
3461
+ "required": true
3462
+ },
3463
+ {
3464
+ "name": "row",
3465
+ "type": "object"
3466
+ }
3467
+ ]
3468
+ },
3469
+ {
3470
+ "key": "EDIT",
3471
+ "name": "EDIT",
3472
+ "payload": [
3473
+ {
3474
+ "name": "id",
3475
+ "type": "string",
3476
+ "required": true
3477
+ },
3478
+ {
3479
+ "name": "row",
3480
+ "type": "object"
3481
+ }
3482
+ ]
4495
3483
  },
4496
3484
  {
4497
- "from": "deleting",
3485
+ "key": "DELETE",
3486
+ "name": "DELETE",
3487
+ "payload": [
3488
+ {
3489
+ "name": "id",
3490
+ "type": "string",
3491
+ "required": true
3492
+ },
3493
+ {
3494
+ "name": "row",
3495
+ "type": "object"
3496
+ }
3497
+ ]
3498
+ }
3499
+ ],
3500
+ "transitions": [
3501
+ {
3502
+ "from": "browsing",
4498
3503
  "to": "browsing",
4499
- "event": "CLOSE",
3504
+ "event": "INIT",
4500
3505
  "effects": [
4501
3506
  [
4502
- "render-ui",
4503
- "modal",
4504
- null
4505
- ],
4506
- [
4507
- "fetch",
3507
+ "ref",
4508
3508
  "Order"
4509
3509
  ],
4510
3510
  [
@@ -4660,6 +3660,9 @@
4660
3660
  "linkedEntity": "Order",
4661
3661
  "category": "interaction",
4662
3662
  "emits": [
3663
+ {
3664
+ "event": "SAVE"
3665
+ },
4663
3666
  {
4664
3667
  "event": "ORDER_CREATED"
4665
3668
  }
@@ -4802,10 +3805,6 @@
4802
3805
  [
4803
3806
  "emit",
4804
3807
  "ORDER_CREATED"
4805
- ],
4806
- [
4807
- "notify",
4808
- "Order created successfully"
4809
3808
  ]
4810
3809
  ]
4811
3810
  }
@@ -4817,6 +3816,9 @@
4817
3816
  "linkedEntity": "Order",
4818
3817
  "category": "interaction",
4819
3818
  "emits": [
3819
+ {
3820
+ "event": "SAVE"
3821
+ },
4820
3822
  {
4821
3823
  "event": "ORDER_UPDATED"
4822
3824
  }
@@ -4970,10 +3972,6 @@
4970
3972
  [
4971
3973
  "emit",
4972
3974
  "ORDER_UPDATED"
4973
- ],
4974
- [
4975
- "notify",
4976
- "Order updated successfully"
4977
3975
  ]
4978
3976
  ]
4979
3977
  }
@@ -4984,6 +3982,11 @@
4984
3982
  "name": "OrderView",
4985
3983
  "linkedEntity": "Order",
4986
3984
  "category": "interaction",
3985
+ "emits": [
3986
+ {
3987
+ "event": "SAVE"
3988
+ }
3989
+ ],
4987
3990
  "stateMachine": {
4988
3991
  "states": [
4989
3992
  {
@@ -5013,6 +4016,17 @@
5013
4016
  {
5014
4017
  "key": "CLOSE",
5015
4018
  "name": "Close"
4019
+ },
4020
+ {
4021
+ "key": "SAVE",
4022
+ "name": "Save",
4023
+ "payload": [
4024
+ {
4025
+ "name": "data",
4026
+ "type": "object",
4027
+ "required": true
4028
+ }
4029
+ ]
5016
4030
  }
5017
4031
  ],
5018
4032
  "transitions": [
@@ -5181,6 +4195,219 @@
5181
4195
  "info"
5182
4196
  ]
5183
4197
  ]
4198
+ },
4199
+ {
4200
+ "from": "open",
4201
+ "to": "closed",
4202
+ "event": "SAVE",
4203
+ "effects": [
4204
+ [
4205
+ "render-ui",
4206
+ "modal",
4207
+ null
4208
+ ]
4209
+ ]
4210
+ }
4211
+ ]
4212
+ }
4213
+ },
4214
+ {
4215
+ "name": "OrderDelete",
4216
+ "linkedEntity": "Order",
4217
+ "category": "interaction",
4218
+ "emits": [
4219
+ {
4220
+ "event": "CONFIRM_DELETE"
4221
+ },
4222
+ {
4223
+ "event": "ORDER_DELETED"
4224
+ }
4225
+ ],
4226
+ "stateMachine": {
4227
+ "states": [
4228
+ {
4229
+ "name": "idle",
4230
+ "isInitial": true
4231
+ },
4232
+ {
4233
+ "name": "confirming"
4234
+ }
4235
+ ],
4236
+ "events": [
4237
+ {
4238
+ "key": "INIT",
4239
+ "name": "Initialize"
4240
+ },
4241
+ {
4242
+ "key": "DELETE",
4243
+ "name": "Request Confirmation",
4244
+ "payload": [
4245
+ {
4246
+ "name": "id",
4247
+ "type": "string",
4248
+ "required": true
4249
+ }
4250
+ ]
4251
+ },
4252
+ {
4253
+ "key": "CONFIRM_DELETE",
4254
+ "name": "Confirm"
4255
+ },
4256
+ {
4257
+ "key": "CANCEL",
4258
+ "name": "Cancel"
4259
+ },
4260
+ {
4261
+ "key": "CLOSE",
4262
+ "name": "Close"
4263
+ }
4264
+ ],
4265
+ "transitions": [
4266
+ {
4267
+ "from": "idle",
4268
+ "to": "idle",
4269
+ "event": "INIT",
4270
+ "effects": [
4271
+ [
4272
+ "ref",
4273
+ "Order"
4274
+ ]
4275
+ ]
4276
+ },
4277
+ {
4278
+ "from": "idle",
4279
+ "to": "confirming",
4280
+ "event": "DELETE",
4281
+ "effects": [
4282
+ [
4283
+ "set",
4284
+ "@entity.pendingId",
4285
+ "@payload.id"
4286
+ ],
4287
+ [
4288
+ "fetch",
4289
+ "Order",
4290
+ {
4291
+ "id": "@payload.id"
4292
+ }
4293
+ ],
4294
+ [
4295
+ "render-ui",
4296
+ "modal",
4297
+ {
4298
+ "type": "stack",
4299
+ "direction": "vertical",
4300
+ "gap": "md",
4301
+ "children": [
4302
+ {
4303
+ "type": "stack",
4304
+ "direction": "horizontal",
4305
+ "gap": "sm",
4306
+ "align": "center",
4307
+ "children": [
4308
+ {
4309
+ "type": "icon",
4310
+ "name": "alert-triangle",
4311
+ "size": "md"
4312
+ },
4313
+ {
4314
+ "type": "typography",
4315
+ "content": "Delete Order",
4316
+ "variant": "h3"
4317
+ }
4318
+ ]
4319
+ },
4320
+ {
4321
+ "type": "divider"
4322
+ },
4323
+ {
4324
+ "type": "alert",
4325
+ "variant": "danger",
4326
+ "message": "This action cannot be undone."
4327
+ },
4328
+ {
4329
+ "type": "stack",
4330
+ "direction": "horizontal",
4331
+ "gap": "sm",
4332
+ "justify": "end",
4333
+ "children": [
4334
+ {
4335
+ "type": "button",
4336
+ "label": "Cancel",
4337
+ "event": "CANCEL",
4338
+ "variant": "ghost"
4339
+ },
4340
+ {
4341
+ "type": "button",
4342
+ "label": "Delete",
4343
+ "event": "CONFIRM_DELETE",
4344
+ "variant": "danger",
4345
+ "icon": "check"
4346
+ }
4347
+ ]
4348
+ }
4349
+ ]
4350
+ }
4351
+ ]
4352
+ ]
4353
+ },
4354
+ {
4355
+ "from": "confirming",
4356
+ "to": "idle",
4357
+ "event": "CONFIRM_DELETE",
4358
+ "effects": [
4359
+ [
4360
+ "persist",
4361
+ "delete",
4362
+ "Order",
4363
+ "@entity.pendingId"
4364
+ ],
4365
+ [
4366
+ "render-ui",
4367
+ "modal",
4368
+ null
4369
+ ],
4370
+ [
4371
+ "ref",
4372
+ "Order"
4373
+ ],
4374
+ [
4375
+ "emit",
4376
+ "ORDER_DELETED"
4377
+ ]
4378
+ ]
4379
+ },
4380
+ {
4381
+ "from": "confirming",
4382
+ "to": "idle",
4383
+ "event": "CANCEL",
4384
+ "effects": [
4385
+ [
4386
+ "render-ui",
4387
+ "modal",
4388
+ null
4389
+ ],
4390
+ [
4391
+ "ref",
4392
+ "Order"
4393
+ ]
4394
+ ]
4395
+ },
4396
+ {
4397
+ "from": "confirming",
4398
+ "to": "idle",
4399
+ "event": "CLOSE",
4400
+ "effects": [
4401
+ [
4402
+ "render-ui",
4403
+ "modal",
4404
+ null
4405
+ ],
4406
+ [
4407
+ "ref",
4408
+ "Order"
4409
+ ]
4410
+ ]
5184
4411
  }
5185
4412
  ]
5186
4413
  }
@@ -5202,12 +4429,13 @@
5202
4429
  },
5203
4430
  {
5204
4431
  "ref": "OrderView"
4432
+ },
4433
+ {
4434
+ "ref": "OrderDelete"
5205
4435
  }
5206
4436
  ]
5207
4437
  }
5208
- ],
5209
- "services": []
4438
+ ]
5210
4439
  }
5211
- ],
5212
- "description": "Service marketplace organism. Composes molecules and atoms via compose: - stdList(Product): product catalog with CRUD - stdServiceOauth(AuthSession): OAuth login with standalone provider picker - stdServicePaymentFlow(OrderPayment): Stripe payment + email receipt - stdList(Order): order history with CRUD Cross-orbital connections: - CHECKOUT: ProductBrowse -> OrderPaymentPayment"
5213
- }
4440
+ ]
4441
+ }