@rovela-ai/sdk 0.1.2 → 0.1.4

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 (569) hide show
  1. package/dist/admin/api/auth.d.ts +32 -0
  2. package/dist/admin/api/auth.d.ts.map +1 -0
  3. package/dist/admin/api/auth.js +43 -0
  4. package/dist/admin/api/auth.js.map +1 -0
  5. package/dist/admin/api/categories.d.ts +68 -0
  6. package/dist/admin/api/categories.d.ts.map +1 -0
  7. package/dist/admin/api/categories.js +247 -0
  8. package/dist/admin/api/categories.js.map +1 -0
  9. package/dist/admin/api/customers.d.ts +41 -0
  10. package/dist/admin/api/customers.d.ts.map +1 -0
  11. package/dist/admin/api/customers.js +113 -0
  12. package/dist/admin/api/customers.js.map +1 -0
  13. package/dist/admin/api/index.d.ts +56 -0
  14. package/dist/admin/api/index.d.ts.map +1 -0
  15. package/dist/admin/api/index.js +87 -0
  16. package/dist/admin/api/index.js.map +1 -0
  17. package/dist/admin/api/orders.d.ts +59 -0
  18. package/dist/admin/api/orders.d.ts.map +1 -0
  19. package/dist/admin/api/orders.js +209 -0
  20. package/dist/admin/api/orders.js.map +1 -0
  21. package/dist/admin/api/products.d.ts +103 -0
  22. package/dist/admin/api/products.d.ts.map +1 -0
  23. package/dist/admin/api/products.js +329 -0
  24. package/dist/admin/api/products.js.map +1 -0
  25. package/dist/admin/api/refund.d.ts +29 -0
  26. package/dist/admin/api/refund.d.ts.map +1 -0
  27. package/dist/admin/api/refund.js +136 -0
  28. package/dist/admin/api/refund.js.map +1 -0
  29. package/dist/admin/api/stats.d.ts +40 -0
  30. package/dist/admin/api/stats.d.ts.map +1 -0
  31. package/dist/admin/api/stats.js +74 -0
  32. package/dist/admin/api/stats.js.map +1 -0
  33. package/dist/admin/components/AdminGuard.d.ts +40 -0
  34. package/dist/admin/components/AdminGuard.d.ts.map +1 -0
  35. package/dist/admin/components/AdminGuard.js +97 -0
  36. package/dist/admin/components/AdminGuard.js.map +1 -0
  37. package/dist/admin/components/AdminHeader.d.ts +18 -0
  38. package/dist/admin/components/AdminHeader.d.ts.map +1 -0
  39. package/dist/admin/components/AdminHeader.js +33 -0
  40. package/dist/admin/components/AdminHeader.js.map +1 -0
  41. package/dist/admin/components/AdminLayout.d.ts +50 -0
  42. package/dist/admin/components/AdminLayout.d.ts.map +1 -0
  43. package/dist/admin/components/AdminLayout.js +46 -0
  44. package/dist/admin/components/AdminLayout.js.map +1 -0
  45. package/dist/admin/components/AdminLoginForm.d.ts +18 -0
  46. package/dist/admin/components/AdminLoginForm.d.ts.map +1 -0
  47. package/dist/admin/components/AdminLoginForm.js +58 -0
  48. package/dist/admin/components/AdminLoginForm.js.map +1 -0
  49. package/dist/admin/components/AdminNav.d.ts +34 -0
  50. package/dist/admin/components/AdminNav.d.ts.map +1 -0
  51. package/dist/admin/components/AdminNav.js +61 -0
  52. package/dist/admin/components/AdminNav.js.map +1 -0
  53. package/dist/admin/components/InventoryEditor.d.ts +15 -0
  54. package/dist/admin/components/InventoryEditor.d.ts.map +1 -0
  55. package/dist/admin/components/InventoryEditor.js +83 -0
  56. package/dist/admin/components/InventoryEditor.js.map +1 -0
  57. package/dist/admin/components/LowStockAlert.d.ts +11 -0
  58. package/dist/admin/components/LowStockAlert.d.ts.map +1 -0
  59. package/dist/admin/components/LowStockAlert.js +35 -0
  60. package/dist/admin/components/LowStockAlert.js.map +1 -0
  61. package/dist/admin/components/OrderDetails.d.ts +14 -0
  62. package/dist/admin/components/OrderDetails.d.ts.map +1 -0
  63. package/dist/admin/components/OrderDetails.js +94 -0
  64. package/dist/admin/components/OrderDetails.js.map +1 -0
  65. package/dist/admin/components/OrderTable.d.ts +13 -0
  66. package/dist/admin/components/OrderTable.d.ts.map +1 -0
  67. package/dist/admin/components/OrderTable.js +89 -0
  68. package/dist/admin/components/OrderTable.js.map +1 -0
  69. package/dist/admin/components/ProductForm.d.ts +18 -0
  70. package/dist/admin/components/ProductForm.d.ts.map +1 -0
  71. package/dist/admin/components/ProductForm.js +127 -0
  72. package/dist/admin/components/ProductForm.js.map +1 -0
  73. package/dist/admin/components/ProductTable.d.ts +13 -0
  74. package/dist/admin/components/ProductTable.d.ts.map +1 -0
  75. package/dist/admin/components/ProductTable.js +81 -0
  76. package/dist/admin/components/ProductTable.js.map +1 -0
  77. package/dist/admin/components/RecentOrders.d.ts +11 -0
  78. package/dist/admin/components/RecentOrders.d.ts.map +1 -0
  79. package/dist/admin/components/RecentOrders.js +58 -0
  80. package/dist/admin/components/RecentOrders.js.map +1 -0
  81. package/dist/admin/components/RefundDialog.d.ts +17 -0
  82. package/dist/admin/components/RefundDialog.d.ts.map +1 -0
  83. package/dist/admin/components/RefundDialog.js +86 -0
  84. package/dist/admin/components/RefundDialog.js.map +1 -0
  85. package/dist/admin/components/StatsCards.d.ts +23 -0
  86. package/dist/admin/components/StatsCards.d.ts.map +1 -0
  87. package/dist/admin/components/StatsCards.js +82 -0
  88. package/dist/admin/components/StatsCards.js.map +1 -0
  89. package/dist/admin/components/StoreSettings.d.ts +14 -0
  90. package/dist/admin/components/StoreSettings.d.ts.map +1 -0
  91. package/dist/admin/components/StoreSettings.js +88 -0
  92. package/dist/admin/components/StoreSettings.js.map +1 -0
  93. package/dist/admin/components/index.d.ts +21 -0
  94. package/dist/admin/components/index.d.ts.map +1 -0
  95. package/dist/admin/components/index.js +57 -0
  96. package/dist/admin/components/index.js.map +1 -0
  97. package/dist/admin/config.d.ts +74 -0
  98. package/dist/admin/config.d.ts.map +1 -0
  99. package/dist/admin/config.js +229 -0
  100. package/dist/admin/config.js.map +1 -0
  101. package/dist/admin/hooks/index.d.ts +10 -0
  102. package/dist/admin/hooks/index.d.ts.map +1 -0
  103. package/dist/admin/hooks/index.js +17 -0
  104. package/dist/admin/hooks/index.js.map +1 -0
  105. package/dist/admin/hooks/useAdminOrders.d.ts +41 -0
  106. package/dist/admin/hooks/useAdminOrders.d.ts.map +1 -0
  107. package/dist/admin/hooks/useAdminOrders.js +191 -0
  108. package/dist/admin/hooks/useAdminOrders.js.map +1 -0
  109. package/dist/admin/hooks/useAdminProducts.d.ts +39 -0
  110. package/dist/admin/hooks/useAdminProducts.d.ts.map +1 -0
  111. package/dist/admin/hooks/useAdminProducts.js +235 -0
  112. package/dist/admin/hooks/useAdminProducts.js.map +1 -0
  113. package/dist/admin/hooks/useAdminStats.d.ts +50 -0
  114. package/dist/admin/hooks/useAdminStats.d.ts.map +1 -0
  115. package/dist/admin/hooks/useAdminStats.js +111 -0
  116. package/dist/admin/hooks/useAdminStats.js.map +1 -0
  117. package/dist/admin/index.d.ts +63 -0
  118. package/dist/admin/index.d.ts.map +1 -0
  119. package/dist/admin/index.js +148 -0
  120. package/dist/admin/index.js.map +1 -0
  121. package/dist/admin/server/admin-service.d.ts +130 -0
  122. package/dist/admin/server/admin-service.d.ts.map +1 -0
  123. package/dist/admin/server/admin-service.js +298 -0
  124. package/dist/admin/server/admin-service.js.map +1 -0
  125. package/dist/admin/server/index.d.ts +8 -0
  126. package/dist/admin/server/index.d.ts.map +1 -0
  127. package/dist/admin/server/index.js +25 -0
  128. package/dist/admin/server/index.js.map +1 -0
  129. package/dist/admin/types.d.ts +549 -0
  130. package/dist/admin/types.d.ts.map +1 -0
  131. package/dist/admin/types.js +11 -0
  132. package/dist/admin/types.js.map +1 -0
  133. package/dist/auth/api/auth.d.ts +54 -0
  134. package/dist/auth/api/auth.d.ts.map +1 -0
  135. package/dist/auth/api/auth.js +67 -0
  136. package/dist/auth/api/auth.js.map +1 -0
  137. package/dist/auth/api/forgot-password.d.ts +41 -0
  138. package/dist/auth/api/forgot-password.d.ts.map +1 -0
  139. package/dist/auth/api/forgot-password.js +68 -0
  140. package/dist/auth/api/forgot-password.js.map +1 -0
  141. package/dist/auth/api/index.d.ts +34 -0
  142. package/dist/auth/api/index.d.ts.map +1 -0
  143. package/dist/auth/api/index.js +52 -0
  144. package/dist/auth/api/index.js.map +1 -0
  145. package/dist/auth/api/register.d.ts +41 -0
  146. package/dist/auth/api/register.d.ts.map +1 -0
  147. package/dist/auth/api/register.js +93 -0
  148. package/dist/auth/api/register.js.map +1 -0
  149. package/dist/auth/api/resend-verification.d.ts +41 -0
  150. package/dist/auth/api/resend-verification.d.ts.map +1 -0
  151. package/dist/auth/api/resend-verification.js +71 -0
  152. package/dist/auth/api/resend-verification.js.map +1 -0
  153. package/dist/auth/api/reset-password.d.ts +67 -0
  154. package/dist/auth/api/reset-password.d.ts.map +1 -0
  155. package/dist/auth/api/reset-password.js +110 -0
  156. package/dist/auth/api/reset-password.js.map +1 -0
  157. package/dist/auth/api/verify-email.d.ts +47 -0
  158. package/dist/auth/api/verify-email.d.ts.map +1 -0
  159. package/dist/auth/api/verify-email.js +94 -0
  160. package/dist/auth/api/verify-email.js.map +1 -0
  161. package/dist/auth/components/AuthGuard.d.ts +52 -0
  162. package/dist/auth/components/AuthGuard.d.ts.map +1 -0
  163. package/dist/auth/components/AuthGuard.js +113 -0
  164. package/dist/auth/components/AuthGuard.js.map +1 -0
  165. package/dist/auth/components/ForgotPasswordForm.d.ts +15 -0
  166. package/dist/auth/components/ForgotPasswordForm.d.ts.map +1 -0
  167. package/dist/auth/components/ForgotPasswordForm.js +44 -0
  168. package/dist/auth/components/ForgotPasswordForm.js.map +1 -0
  169. package/dist/auth/components/ResetPasswordForm.d.ts +18 -0
  170. package/dist/auth/components/ResetPasswordForm.d.ts.map +1 -0
  171. package/dist/auth/components/ResetPasswordForm.js +88 -0
  172. package/dist/auth/components/ResetPasswordForm.js.map +1 -0
  173. package/dist/auth/components/SignInForm.d.ts +21 -0
  174. package/dist/auth/components/SignInForm.d.ts.map +1 -0
  175. package/dist/auth/components/SignInForm.js +63 -0
  176. package/dist/auth/components/SignInForm.js.map +1 -0
  177. package/dist/auth/components/SignUpForm.d.ts +18 -0
  178. package/dist/auth/components/SignUpForm.d.ts.map +1 -0
  179. package/dist/auth/components/SignUpForm.js +79 -0
  180. package/dist/auth/components/SignUpForm.js.map +1 -0
  181. package/dist/auth/components/UserMenu.d.ts +18 -0
  182. package/dist/auth/components/UserMenu.d.ts.map +1 -0
  183. package/dist/auth/components/UserMenu.js +75 -0
  184. package/dist/auth/components/UserMenu.js.map +1 -0
  185. package/dist/auth/components/VerifyEmailNotice.d.ts +20 -0
  186. package/dist/auth/components/VerifyEmailNotice.d.ts.map +1 -0
  187. package/dist/auth/components/VerifyEmailNotice.js +59 -0
  188. package/dist/auth/components/VerifyEmailNotice.js.map +1 -0
  189. package/dist/auth/components/index.d.ts +13 -0
  190. package/dist/auth/components/index.d.ts.map +1 -0
  191. package/dist/auth/components/index.js +24 -0
  192. package/dist/auth/components/index.js.map +1 -0
  193. package/dist/auth/config.d.ts +42 -0
  194. package/dist/auth/config.d.ts.map +1 -0
  195. package/dist/auth/config.js +174 -0
  196. package/dist/auth/config.js.map +1 -0
  197. package/dist/auth/hooks/index.d.ts +7 -0
  198. package/dist/auth/hooks/index.d.ts.map +1 -0
  199. package/dist/auth/hooks/index.js +11 -0
  200. package/dist/auth/hooks/index.js.map +1 -0
  201. package/dist/auth/index.d.ts +54 -0
  202. package/dist/auth/index.d.ts.map +1 -0
  203. package/dist/auth/index.js +88 -0
  204. package/dist/auth/index.js.map +1 -0
  205. package/dist/auth/server/customer-service.d.ts +138 -0
  206. package/dist/auth/server/customer-service.d.ts.map +1 -0
  207. package/dist/auth/server/customer-service.js +309 -0
  208. package/dist/auth/server/customer-service.js.map +1 -0
  209. package/dist/auth/server/email-sender.d.ts +64 -0
  210. package/dist/auth/server/email-sender.d.ts.map +1 -0
  211. package/dist/auth/server/email-sender.js +112 -0
  212. package/dist/auth/server/email-sender.js.map +1 -0
  213. package/dist/auth/server/index.d.ts +13 -0
  214. package/dist/auth/server/index.d.ts.map +1 -0
  215. package/dist/auth/server/index.js +48 -0
  216. package/dist/auth/server/index.js.map +1 -0
  217. package/dist/auth/server/password-reset-service.d.ts +86 -0
  218. package/dist/auth/server/password-reset-service.d.ts.map +1 -0
  219. package/dist/auth/server/password-reset-service.js +236 -0
  220. package/dist/auth/server/password-reset-service.js.map +1 -0
  221. package/dist/auth/server/password.d.ts +58 -0
  222. package/dist/auth/server/password.d.ts.map +1 -0
  223. package/dist/auth/server/password.js +94 -0
  224. package/dist/auth/server/password.js.map +1 -0
  225. package/dist/auth/server/verification-service.d.ts +87 -0
  226. package/dist/auth/server/verification-service.d.ts.map +1 -0
  227. package/dist/auth/server/verification-service.js +268 -0
  228. package/dist/auth/server/verification-service.js.map +1 -0
  229. package/dist/auth/types.d.ts +305 -0
  230. package/dist/auth/types.d.ts.map +1 -0
  231. package/dist/auth/types.js +8 -0
  232. package/dist/auth/types.js.map +1 -0
  233. package/dist/cart/CartProvider.d.ts +65 -0
  234. package/dist/cart/CartProvider.d.ts.map +1 -0
  235. package/dist/cart/CartProvider.js +101 -0
  236. package/dist/cart/CartProvider.js.map +1 -0
  237. package/dist/cart/components/AddToCartButton.d.ts +77 -0
  238. package/dist/cart/components/AddToCartButton.d.ts.map +1 -0
  239. package/dist/cart/components/AddToCartButton.js +124 -0
  240. package/dist/cart/components/AddToCartButton.js.map +1 -0
  241. package/dist/cart/components/CartDrawer.d.ts +71 -0
  242. package/dist/cart/components/CartDrawer.d.ts.map +1 -0
  243. package/dist/cart/components/CartDrawer.js +108 -0
  244. package/dist/cart/components/CartDrawer.js.map +1 -0
  245. package/dist/cart/components/CartIcon.d.ts +36 -0
  246. package/dist/cart/components/CartIcon.d.ts.map +1 -0
  247. package/dist/cart/components/CartIcon.js +70 -0
  248. package/dist/cart/components/CartIcon.js.map +1 -0
  249. package/dist/cart/components/CartItem.d.ts +52 -0
  250. package/dist/cart/components/CartItem.d.ts.map +1 -0
  251. package/dist/cart/components/CartItem.js +55 -0
  252. package/dist/cart/components/CartItem.js.map +1 -0
  253. package/dist/cart/components/CartSummary.d.ts +43 -0
  254. package/dist/cart/components/CartSummary.d.ts.map +1 -0
  255. package/dist/cart/components/CartSummary.js +58 -0
  256. package/dist/cart/components/CartSummary.js.map +1 -0
  257. package/dist/cart/components/QuantitySelector.d.ts +39 -0
  258. package/dist/cart/components/QuantitySelector.d.ts.map +1 -0
  259. package/dist/cart/components/QuantitySelector.js +87 -0
  260. package/dist/cart/components/QuantitySelector.js.map +1 -0
  261. package/dist/cart/components/index.d.ts +18 -0
  262. package/dist/cart/components/index.d.ts.map +1 -0
  263. package/dist/cart/components/index.js +21 -0
  264. package/dist/cart/components/index.js.map +1 -0
  265. package/dist/cart/index.d.ts +109 -0
  266. package/dist/cart/index.d.ts.map +1 -0
  267. package/dist/cart/index.js +129 -0
  268. package/dist/cart/index.js.map +1 -0
  269. package/dist/cart/store.d.ts +101 -0
  270. package/dist/cart/store.d.ts.map +1 -0
  271. package/dist/cart/store.js +207 -0
  272. package/dist/cart/store.js.map +1 -0
  273. package/dist/checkout/api/checkout.d.ts +31 -0
  274. package/dist/checkout/api/checkout.d.ts.map +1 -0
  275. package/dist/checkout/api/checkout.js +103 -0
  276. package/dist/checkout/api/checkout.js.map +1 -0
  277. package/dist/checkout/api/index.d.ts +8 -0
  278. package/dist/checkout/api/index.d.ts.map +1 -0
  279. package/dist/checkout/api/index.js +13 -0
  280. package/dist/checkout/api/index.js.map +1 -0
  281. package/dist/checkout/api/webhook.d.ts +30 -0
  282. package/dist/checkout/api/webhook.d.ts.map +1 -0
  283. package/dist/checkout/api/webhook.js +58 -0
  284. package/dist/checkout/api/webhook.js.map +1 -0
  285. package/dist/checkout/components/CheckoutButton.d.ts +44 -0
  286. package/dist/checkout/components/CheckoutButton.d.ts.map +1 -0
  287. package/dist/checkout/components/CheckoutButton.js +97 -0
  288. package/dist/checkout/components/CheckoutButton.js.map +1 -0
  289. package/dist/checkout/components/CheckoutSuccess.d.ts +29 -0
  290. package/dist/checkout/components/CheckoutSuccess.d.ts.map +1 -0
  291. package/dist/checkout/components/CheckoutSuccess.js +60 -0
  292. package/dist/checkout/components/CheckoutSuccess.js.map +1 -0
  293. package/dist/checkout/components/OrderSummary.d.ts +37 -0
  294. package/dist/checkout/components/OrderSummary.d.ts.map +1 -0
  295. package/dist/checkout/components/OrderSummary.js +70 -0
  296. package/dist/checkout/components/OrderSummary.js.map +1 -0
  297. package/dist/checkout/components/ShippingForm.d.ts +30 -0
  298. package/dist/checkout/components/ShippingForm.d.ts.map +1 -0
  299. package/dist/checkout/components/ShippingForm.js +125 -0
  300. package/dist/checkout/components/ShippingForm.js.map +1 -0
  301. package/dist/checkout/components/index.d.ts +10 -0
  302. package/dist/checkout/components/index.d.ts.map +1 -0
  303. package/dist/checkout/components/index.js +17 -0
  304. package/dist/checkout/components/index.js.map +1 -0
  305. package/dist/checkout/hooks/index.d.ts +7 -0
  306. package/dist/checkout/hooks/index.d.ts.map +1 -0
  307. package/dist/checkout/hooks/index.js +12 -0
  308. package/dist/checkout/hooks/index.js.map +1 -0
  309. package/dist/checkout/hooks/useCheckout.d.ts +61 -0
  310. package/dist/checkout/hooks/useCheckout.d.ts.map +1 -0
  311. package/dist/checkout/hooks/useCheckout.js +174 -0
  312. package/dist/checkout/hooks/useCheckout.js.map +1 -0
  313. package/dist/checkout/index.d.ts +111 -0
  314. package/dist/checkout/index.d.ts.map +1 -0
  315. package/dist/checkout/index.js +148 -0
  316. package/dist/checkout/index.js.map +1 -0
  317. package/dist/checkout/server/create-checkout-session.d.ts +69 -0
  318. package/dist/checkout/server/create-checkout-session.d.ts.map +1 -0
  319. package/dist/checkout/server/create-checkout-session.js +190 -0
  320. package/dist/checkout/server/create-checkout-session.js.map +1 -0
  321. package/dist/checkout/server/handle-webhook.d.ts +35 -0
  322. package/dist/checkout/server/handle-webhook.d.ts.map +1 -0
  323. package/dist/checkout/server/handle-webhook.js +279 -0
  324. package/dist/checkout/server/handle-webhook.js.map +1 -0
  325. package/dist/checkout/server/index.d.ts +10 -0
  326. package/dist/checkout/server/index.d.ts.map +1 -0
  327. package/dist/checkout/server/index.js +19 -0
  328. package/dist/checkout/server/index.js.map +1 -0
  329. package/dist/checkout/server/order-service.d.ts +43 -0
  330. package/dist/checkout/server/order-service.d.ts.map +1 -0
  331. package/dist/checkout/server/order-service.js +196 -0
  332. package/dist/checkout/server/order-service.js.map +1 -0
  333. package/dist/checkout/stripe/client.d.ts +72 -0
  334. package/dist/checkout/stripe/client.d.ts.map +1 -0
  335. package/dist/checkout/stripe/client.js +189 -0
  336. package/dist/checkout/stripe/client.js.map +1 -0
  337. package/dist/checkout/stripe/index.d.ts +7 -0
  338. package/dist/checkout/stripe/index.d.ts.map +1 -0
  339. package/dist/checkout/stripe/index.js +21 -0
  340. package/dist/checkout/stripe/index.js.map +1 -0
  341. package/dist/checkout/types.d.ts +263 -0
  342. package/dist/checkout/types.d.ts.map +1 -0
  343. package/dist/checkout/types.js +9 -0
  344. package/dist/checkout/types.js.map +1 -0
  345. package/dist/core/config.d.ts +296 -0
  346. package/dist/core/config.d.ts.map +1 -0
  347. package/dist/core/config.js +162 -0
  348. package/dist/core/config.js.map +1 -0
  349. package/dist/core/db/client.d.ts +69 -0
  350. package/dist/core/db/client.d.ts.map +1 -0
  351. package/dist/core/db/client.js +202 -0
  352. package/dist/core/db/client.js.map +1 -0
  353. package/dist/core/db/index.d.ts +11 -0
  354. package/dist/core/db/index.d.ts.map +1 -0
  355. package/dist/core/db/index.js +109 -0
  356. package/dist/core/db/index.js.map +1 -0
  357. package/dist/core/db/queries.d.ts +627 -0
  358. package/dist/core/db/queries.d.ts.map +1 -0
  359. package/dist/core/db/queries.js +730 -0
  360. package/dist/core/db/queries.js.map +1 -0
  361. package/dist/core/db/schema.d.ts +1628 -0
  362. package/dist/core/db/schema.d.ts.map +1 -0
  363. package/dist/core/db/schema.js +262 -0
  364. package/dist/core/db/schema.js.map +1 -0
  365. package/dist/core/index.d.ts +20 -0
  366. package/dist/core/index.d.ts.map +1 -0
  367. package/dist/core/index.js +71 -0
  368. package/dist/core/index.js.map +1 -0
  369. package/dist/core/server/index.d.ts +17 -0
  370. package/dist/core/server/index.d.ts.map +1 -0
  371. package/dist/core/server/index.js +96 -0
  372. package/dist/core/server/index.js.map +1 -0
  373. package/dist/core/types.d.ts +230 -0
  374. package/dist/core/types.d.ts.map +1 -0
  375. package/dist/core/types.js +9 -0
  376. package/dist/core/types.js.map +1 -0
  377. package/dist/core/utils.d.ts +153 -0
  378. package/dist/core/utils.d.ts.map +1 -0
  379. package/dist/core/utils.js +356 -0
  380. package/dist/core/utils.js.map +1 -0
  381. package/dist/emails/config.d.ts +42 -0
  382. package/dist/emails/config.d.ts.map +1 -0
  383. package/dist/emails/config.js +89 -0
  384. package/dist/emails/config.js.map +1 -0
  385. package/dist/emails/index.d.ts +85 -0
  386. package/dist/emails/index.d.ts.map +1 -0
  387. package/dist/emails/index.js +170 -0
  388. package/dist/emails/index.js.map +1 -0
  389. package/dist/emails/send/auth.d.ts +91 -0
  390. package/dist/emails/send/auth.d.ts.map +1 -0
  391. package/dist/emails/send/auth.js +132 -0
  392. package/dist/emails/send/auth.js.map +1 -0
  393. package/dist/emails/send/index.d.ts +10 -0
  394. package/dist/emails/send/index.d.ts.map +1 -0
  395. package/dist/emails/send/index.js +33 -0
  396. package/dist/emails/send/index.js.map +1 -0
  397. package/dist/emails/send/orders.d.ts +180 -0
  398. package/dist/emails/send/orders.d.ts.map +1 -0
  399. package/dist/emails/send/orders.js +259 -0
  400. package/dist/emails/send/orders.js.map +1 -0
  401. package/dist/emails/sender.d.ts +72 -0
  402. package/dist/emails/sender.d.ts.map +1 -0
  403. package/dist/emails/sender.js +118 -0
  404. package/dist/emails/sender.js.map +1 -0
  405. package/dist/emails/templates/base.d.ts +105 -0
  406. package/dist/emails/templates/base.d.ts.map +1 -0
  407. package/dist/emails/templates/base.js +291 -0
  408. package/dist/emails/templates/base.js.map +1 -0
  409. package/dist/emails/templates/email-verification.d.ts +28 -0
  410. package/dist/emails/templates/email-verification.d.ts.map +1 -0
  411. package/dist/emails/templates/email-verification.js +56 -0
  412. package/dist/emails/templates/email-verification.js.map +1 -0
  413. package/dist/emails/templates/index.d.ts +15 -0
  414. package/dist/emails/templates/index.d.ts.map +1 -0
  415. package/dist/emails/templates/index.js +58 -0
  416. package/dist/emails/templates/index.js.map +1 -0
  417. package/dist/emails/templates/order-cancelled.d.ts +30 -0
  418. package/dist/emails/templates/order-cancelled.d.ts.map +1 -0
  419. package/dist/emails/templates/order-cancelled.js +87 -0
  420. package/dist/emails/templates/order-cancelled.js.map +1 -0
  421. package/dist/emails/templates/order-confirmation.d.ts +36 -0
  422. package/dist/emails/templates/order-confirmation.d.ts.map +1 -0
  423. package/dist/emails/templates/order-confirmation.js +161 -0
  424. package/dist/emails/templates/order-confirmation.js.map +1 -0
  425. package/dist/emails/templates/order-delivered.d.ts +31 -0
  426. package/dist/emails/templates/order-delivered.d.ts.map +1 -0
  427. package/dist/emails/templates/order-delivered.js +95 -0
  428. package/dist/emails/templates/order-delivered.js.map +1 -0
  429. package/dist/emails/templates/order-shipped.d.ts +32 -0
  430. package/dist/emails/templates/order-shipped.d.ts.map +1 -0
  431. package/dist/emails/templates/order-shipped.js +87 -0
  432. package/dist/emails/templates/order-shipped.js.map +1 -0
  433. package/dist/emails/templates/password-reset.d.ts +27 -0
  434. package/dist/emails/templates/password-reset.d.ts.map +1 -0
  435. package/dist/emails/templates/password-reset.js +55 -0
  436. package/dist/emails/templates/password-reset.js.map +1 -0
  437. package/dist/emails/templates/refund-processed.d.ts +32 -0
  438. package/dist/emails/templates/refund-processed.d.ts.map +1 -0
  439. package/dist/emails/templates/refund-processed.js +96 -0
  440. package/dist/emails/templates/refund-processed.js.map +1 -0
  441. package/dist/emails/templates/welcome.d.ts +27 -0
  442. package/dist/emails/templates/welcome.d.ts.map +1 -0
  443. package/dist/emails/templates/welcome.js +56 -0
  444. package/dist/emails/templates/welcome.js.map +1 -0
  445. package/dist/emails/types.d.ts +202 -0
  446. package/dist/emails/types.d.ts.map +1 -0
  447. package/dist/emails/types.js +8 -0
  448. package/dist/emails/types.js.map +1 -0
  449. package/dist/emails/utils.d.ts +94 -0
  450. package/dist/emails/utils.d.ts.map +1 -0
  451. package/dist/emails/utils.js +229 -0
  452. package/dist/emails/utils.js.map +1 -0
  453. package/dist/index.d.ts +40 -0
  454. package/dist/index.d.ts.map +1 -0
  455. package/dist/index.js +225 -0
  456. package/dist/index.js.map +1 -0
  457. package/dist/products/api/categories.d.ts +29 -0
  458. package/dist/products/api/categories.d.ts.map +1 -0
  459. package/dist/products/api/categories.js +49 -0
  460. package/dist/products/api/categories.js.map +1 -0
  461. package/dist/products/api/index.d.ts +24 -0
  462. package/dist/products/api/index.d.ts.map +1 -0
  463. package/dist/products/api/index.js +30 -0
  464. package/dist/products/api/index.js.map +1 -0
  465. package/dist/products/api/product.d.ts +36 -0
  466. package/dist/products/api/product.d.ts.map +1 -0
  467. package/dist/products/api/product.js +70 -0
  468. package/dist/products/api/product.js.map +1 -0
  469. package/dist/products/api/products.d.ts +41 -0
  470. package/dist/products/api/products.d.ts.map +1 -0
  471. package/dist/products/api/products.js +102 -0
  472. package/dist/products/api/products.js.map +1 -0
  473. package/dist/products/components/CategoryNav.d.ts +51 -0
  474. package/dist/products/components/CategoryNav.d.ts.map +1 -0
  475. package/dist/products/components/CategoryNav.js +115 -0
  476. package/dist/products/components/CategoryNav.js.map +1 -0
  477. package/dist/products/components/ProductBreadcrumb.d.ts +52 -0
  478. package/dist/products/components/ProductBreadcrumb.d.ts.map +1 -0
  479. package/dist/products/components/ProductBreadcrumb.js +78 -0
  480. package/dist/products/components/ProductBreadcrumb.js.map +1 -0
  481. package/dist/products/components/ProductCard.d.ts +54 -0
  482. package/dist/products/components/ProductCard.d.ts.map +1 -0
  483. package/dist/products/components/ProductCard.js +65 -0
  484. package/dist/products/components/ProductCard.js.map +1 -0
  485. package/dist/products/components/ProductDetails.d.ts +63 -0
  486. package/dist/products/components/ProductDetails.d.ts.map +1 -0
  487. package/dist/products/components/ProductDetails.js +105 -0
  488. package/dist/products/components/ProductDetails.js.map +1 -0
  489. package/dist/products/components/ProductFilters.d.ts +70 -0
  490. package/dist/products/components/ProductFilters.d.ts.map +1 -0
  491. package/dist/products/components/ProductFilters.js +127 -0
  492. package/dist/products/components/ProductFilters.js.map +1 -0
  493. package/dist/products/components/ProductGallery.d.ts +37 -0
  494. package/dist/products/components/ProductGallery.d.ts.map +1 -0
  495. package/dist/products/components/ProductGallery.js +80 -0
  496. package/dist/products/components/ProductGallery.js.map +1 -0
  497. package/dist/products/components/ProductGrid.d.ts +50 -0
  498. package/dist/products/components/ProductGrid.d.ts.map +1 -0
  499. package/dist/products/components/ProductGrid.js +83 -0
  500. package/dist/products/components/ProductGrid.js.map +1 -0
  501. package/dist/products/components/ProductSearch.d.ts +43 -0
  502. package/dist/products/components/ProductSearch.d.ts.map +1 -0
  503. package/dist/products/components/ProductSearch.js +99 -0
  504. package/dist/products/components/ProductSearch.js.map +1 -0
  505. package/dist/products/components/ProductSort.d.ts +43 -0
  506. package/dist/products/components/ProductSort.d.ts.map +1 -0
  507. package/dist/products/components/ProductSort.js +61 -0
  508. package/dist/products/components/ProductSort.js.map +1 -0
  509. package/dist/products/components/VariantSelector.d.ts +43 -0
  510. package/dist/products/components/VariantSelector.d.ts.map +1 -0
  511. package/dist/products/components/VariantSelector.js +147 -0
  512. package/dist/products/components/VariantSelector.js.map +1 -0
  513. package/dist/products/components/index.d.ts +26 -0
  514. package/dist/products/components/index.d.ts.map +1 -0
  515. package/dist/products/components/index.js +32 -0
  516. package/dist/products/components/index.js.map +1 -0
  517. package/dist/products/hooks/index.d.ts +14 -0
  518. package/dist/products/hooks/index.d.ts.map +1 -0
  519. package/dist/products/hooks/index.js +17 -0
  520. package/dist/products/hooks/index.js.map +1 -0
  521. package/dist/products/hooks/useCategories.d.ts +56 -0
  522. package/dist/products/hooks/useCategories.d.ts.map +1 -0
  523. package/dist/products/hooks/useCategories.js +126 -0
  524. package/dist/products/hooks/useCategories.js.map +1 -0
  525. package/dist/products/hooks/useProduct.d.ts +44 -0
  526. package/dist/products/hooks/useProduct.d.ts.map +1 -0
  527. package/dist/products/hooks/useProduct.js +86 -0
  528. package/dist/products/hooks/useProduct.js.map +1 -0
  529. package/dist/products/hooks/useProductAttributes.d.ts +59 -0
  530. package/dist/products/hooks/useProductAttributes.d.ts.map +1 -0
  531. package/dist/products/hooks/useProductAttributes.js +148 -0
  532. package/dist/products/hooks/useProductAttributes.js.map +1 -0
  533. package/dist/products/hooks/useProducts.d.ts +67 -0
  534. package/dist/products/hooks/useProducts.d.ts.map +1 -0
  535. package/dist/products/hooks/useProducts.js +132 -0
  536. package/dist/products/hooks/useProducts.js.map +1 -0
  537. package/dist/products/index.d.ts +94 -0
  538. package/dist/products/index.d.ts.map +1 -0
  539. package/dist/products/index.js +123 -0
  540. package/dist/products/index.js.map +1 -0
  541. package/dist/theme/ThemeProvider.d.ts +70 -0
  542. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  543. package/dist/theme/ThemeProvider.js +77 -0
  544. package/dist/theme/ThemeProvider.js.map +1 -0
  545. package/dist/theme/colors.d.ts +148 -0
  546. package/dist/theme/colors.d.ts.map +1 -0
  547. package/dist/theme/colors.js +219 -0
  548. package/dist/theme/colors.js.map +1 -0
  549. package/dist/theme/defaults.d.ts +212 -0
  550. package/dist/theme/defaults.d.ts.map +1 -0
  551. package/dist/theme/defaults.js +278 -0
  552. package/dist/theme/defaults.js.map +1 -0
  553. package/dist/theme/fonts.d.ts +59 -0
  554. package/dist/theme/fonts.d.ts.map +1 -0
  555. package/dist/theme/fonts.js +202 -0
  556. package/dist/theme/fonts.js.map +1 -0
  557. package/dist/theme/generator.d.ts +50 -0
  558. package/dist/theme/generator.d.ts.map +1 -0
  559. package/dist/theme/generator.js +322 -0
  560. package/dist/theme/generator.js.map +1 -0
  561. package/dist/theme/hooks.d.ts +110 -0
  562. package/dist/theme/hooks.d.ts.map +1 -0
  563. package/dist/theme/hooks.js +106 -0
  564. package/dist/theme/hooks.js.map +1 -0
  565. package/dist/theme/index.d.ts +37 -0
  566. package/dist/theme/index.d.ts.map +1 -0
  567. package/dist/theme/index.js +85 -0
  568. package/dist/theme/index.js.map +1 -0
  569. package/package.json +7 -2
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @rovela/sdk/checkout/components
3
+ *
4
+ * Checkout UI components
5
+ */
6
+ export { CheckoutButton } from './CheckoutButton';
7
+ export { CheckoutSuccess } from './CheckoutSuccess';
8
+ export { OrderSummary } from './OrderSummary';
9
+ export { ShippingForm } from './ShippingForm';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checkout/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * @rovela/sdk/checkout/components
4
+ *
5
+ * Checkout UI components
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ShippingForm = exports.OrderSummary = exports.CheckoutSuccess = exports.CheckoutButton = void 0;
9
+ var CheckoutButton_1 = require("./CheckoutButton");
10
+ Object.defineProperty(exports, "CheckoutButton", { enumerable: true, get: function () { return CheckoutButton_1.CheckoutButton; } });
11
+ var CheckoutSuccess_1 = require("./CheckoutSuccess");
12
+ Object.defineProperty(exports, "CheckoutSuccess", { enumerable: true, get: function () { return CheckoutSuccess_1.CheckoutSuccess; } });
13
+ var OrderSummary_1 = require("./OrderSummary");
14
+ Object.defineProperty(exports, "OrderSummary", { enumerable: true, get: function () { return OrderSummary_1.OrderSummary; } });
15
+ var ShippingForm_1 = require("./ShippingForm");
16
+ Object.defineProperty(exports, "ShippingForm", { enumerable: true, get: function () { return ShippingForm_1.ShippingForm; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkout/components/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AACrB,+CAA6C;AAApC,4GAAA,YAAY,OAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @rovela/sdk/checkout/hooks
3
+ *
4
+ * React hooks for checkout
5
+ */
6
+ export { useCheckout, useCheckoutSuccess } from './useCheckout';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checkout/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * @rovela/sdk/checkout/hooks
4
+ *
5
+ * React hooks for checkout
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.useCheckoutSuccess = exports.useCheckout = void 0;
9
+ var useCheckout_1 = require("./useCheckout");
10
+ Object.defineProperty(exports, "useCheckout", { enumerable: true, get: function () { return useCheckout_1.useCheckout; } });
11
+ Object.defineProperty(exports, "useCheckoutSuccess", { enumerable: true, get: function () { return useCheckout_1.useCheckoutSuccess; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkout/hooks/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAA+D;AAAtD,0GAAA,WAAW,OAAA;AAAE,iHAAA,kBAAkB,OAAA"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @rovela/sdk/checkout/hooks/useCheckout
3
+ *
4
+ * React hook for initiating Stripe Checkout.
5
+ */
6
+ import type { UseCheckoutOptions, UseCheckoutReturn } from '../types';
7
+ /**
8
+ * Hook for initiating Stripe Checkout.
9
+ *
10
+ * Automatically reads cart items and creates a checkout session.
11
+ * Redirects to Stripe's hosted checkout page.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { useCheckout } from '@rovela/sdk/checkout'
16
+ *
17
+ * function CheckoutButton() {
18
+ * const { checkout, isLoading, error } = useCheckout()
19
+ *
20
+ * return (
21
+ * <button onClick={checkout} disabled={isLoading}>
22
+ * {isLoading ? 'Redirecting...' : 'Checkout'}
23
+ * </button>
24
+ * )
25
+ * }
26
+ * ```
27
+ *
28
+ * @example With custom options
29
+ * ```tsx
30
+ * const { checkout } = useCheckout({
31
+ * onSuccess: (session) => console.log('Session created:', session.sessionId),
32
+ * onError: (error) => alert(error.error),
33
+ * customerEmail: 'customer@example.com',
34
+ * })
35
+ * ```
36
+ */
37
+ export declare function useCheckout(options?: UseCheckoutOptions): UseCheckoutReturn;
38
+ /**
39
+ * Hook to retrieve checkout session details from URL.
40
+ * Used on success pages to display order confirmation.
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * // app/checkout/success/page.tsx
45
+ * 'use client'
46
+ *
47
+ * import { useCheckoutSuccess } from '@rovela/sdk/checkout'
48
+ *
49
+ * export default function SuccessPage() {
50
+ * const { sessionId, isLoading, session } = useCheckoutSuccess()
51
+ *
52
+ * if (isLoading) return <div>Loading...</div>
53
+ *
54
+ * return <div>Thank you for your order! Session: {sessionId}</div>
55
+ * }
56
+ * ```
57
+ */
58
+ export declare function useCheckoutSuccess(): {
59
+ sessionId: string | null;
60
+ };
61
+ //# sourceMappingURL=useCheckout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCheckout.d.ts","sourceRoot":"","sources":["../../../src/checkout/hooks/useCheckout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAGV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAMjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CA8F3E;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB;;EAgBjC"}
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ /**
3
+ * @rovela/sdk/checkout/hooks/useCheckout
4
+ *
5
+ * React hook for initiating Stripe Checkout.
6
+ */
7
+ 'use client';
8
+ /**
9
+ * @rovela/sdk/checkout/hooks/useCheckout
10
+ *
11
+ * React hook for initiating Stripe Checkout.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.useCheckout = useCheckout;
15
+ exports.useCheckoutSuccess = useCheckoutSuccess;
16
+ const react_1 = require("react");
17
+ const store_1 = require("../../cart/store");
18
+ // =============================================================================
19
+ // Hook
20
+ // =============================================================================
21
+ /**
22
+ * Hook for initiating Stripe Checkout.
23
+ *
24
+ * Automatically reads cart items and creates a checkout session.
25
+ * Redirects to Stripe's hosted checkout page.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * import { useCheckout } from '@rovela/sdk/checkout'
30
+ *
31
+ * function CheckoutButton() {
32
+ * const { checkout, isLoading, error } = useCheckout()
33
+ *
34
+ * return (
35
+ * <button onClick={checkout} disabled={isLoading}>
36
+ * {isLoading ? 'Redirecting...' : 'Checkout'}
37
+ * </button>
38
+ * )
39
+ * }
40
+ * ```
41
+ *
42
+ * @example With custom options
43
+ * ```tsx
44
+ * const { checkout } = useCheckout({
45
+ * onSuccess: (session) => console.log('Session created:', session.sessionId),
46
+ * onError: (error) => alert(error.error),
47
+ * customerEmail: 'customer@example.com',
48
+ * })
49
+ * ```
50
+ */
51
+ function useCheckout(options) {
52
+ const { items, clearCart } = (0, store_1.useCart)();
53
+ const [isLoading, setIsLoading] = (0, react_1.useState)(false);
54
+ const [error, setError] = (0, react_1.useState)(null);
55
+ const checkout = (0, react_1.useCallback)(async () => {
56
+ // Reset error state
57
+ setError(null);
58
+ // Validate cart
59
+ if (items.length === 0) {
60
+ const emptyError = {
61
+ error: 'Your cart is empty',
62
+ code: 'EMPTY_CART',
63
+ };
64
+ setError(emptyError);
65
+ options?.onError?.(emptyError);
66
+ return;
67
+ }
68
+ setIsLoading(true);
69
+ try {
70
+ // Build request body
71
+ const body = {
72
+ items: items.map((item) => ({
73
+ productId: item.productId,
74
+ variantId: item.variantId,
75
+ name: item.name,
76
+ description: item.attributes
77
+ ? Object.entries(item.attributes)
78
+ .map(([k, v]) => `${k}: ${v}`)
79
+ .join(', ')
80
+ : undefined,
81
+ // Convert dollars to cents for Stripe
82
+ price: Math.round(item.price * 100),
83
+ quantity: item.quantity,
84
+ image: item.image,
85
+ })),
86
+ customerEmail: options?.customerEmail,
87
+ customerId: options?.customerId,
88
+ successUrl: options?.successUrl,
89
+ cancelUrl: options?.cancelUrl,
90
+ metadata: options?.metadata,
91
+ };
92
+ // Call checkout API
93
+ const response = await fetch('/api/checkout', {
94
+ method: 'POST',
95
+ headers: { 'Content-Type': 'application/json' },
96
+ body: JSON.stringify(body),
97
+ });
98
+ const data = await response.json();
99
+ if (!response.ok) {
100
+ const apiError = data;
101
+ setError(apiError);
102
+ options?.onError?.(apiError);
103
+ return;
104
+ }
105
+ const session = data;
106
+ // Call success callback
107
+ options?.onSuccess?.(session);
108
+ // Clear cart before redirect (optional behavior)
109
+ if (options?.clearCartOnCheckout !== false) {
110
+ clearCart();
111
+ }
112
+ // Redirect to Stripe Checkout
113
+ if (session.url) {
114
+ window.location.href = session.url;
115
+ }
116
+ }
117
+ catch (err) {
118
+ const networkError = {
119
+ error: 'Network error. Please try again.',
120
+ code: 'CHECKOUT_ERROR',
121
+ };
122
+ setError(networkError);
123
+ options?.onError?.(networkError);
124
+ }
125
+ finally {
126
+ setIsLoading(false);
127
+ }
128
+ }, [items, clearCart, options]);
129
+ return {
130
+ checkout,
131
+ isLoading,
132
+ error,
133
+ clearError: (0, react_1.useCallback)(() => setError(null), []),
134
+ };
135
+ }
136
+ // =============================================================================
137
+ // Additional Hooks
138
+ // =============================================================================
139
+ /**
140
+ * Hook to retrieve checkout session details from URL.
141
+ * Used on success pages to display order confirmation.
142
+ *
143
+ * @example
144
+ * ```tsx
145
+ * // app/checkout/success/page.tsx
146
+ * 'use client'
147
+ *
148
+ * import { useCheckoutSuccess } from '@rovela/sdk/checkout'
149
+ *
150
+ * export default function SuccessPage() {
151
+ * const { sessionId, isLoading, session } = useCheckoutSuccess()
152
+ *
153
+ * if (isLoading) return <div>Loading...</div>
154
+ *
155
+ * return <div>Thank you for your order! Session: {sessionId}</div>
156
+ * }
157
+ * ```
158
+ */
159
+ function useCheckoutSuccess() {
160
+ const [sessionId, setSessionId] = (0, react_1.useState)(null);
161
+ // Extract session_id from URL on mount
162
+ if (typeof window !== 'undefined' && !sessionId) {
163
+ const params = new URLSearchParams(window.location.search);
164
+ const id = params.get('session_id');
165
+ if (id) {
166
+ setSessionId(id);
167
+ }
168
+ }
169
+ return {
170
+ sessionId,
171
+ // Could be extended to fetch session details from API if needed
172
+ };
173
+ }
174
+ //# sourceMappingURL=useCheckout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCheckout.js","sourceRoot":"","sources":["../../../src/checkout/hooks/useCheckout.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,YAAY,CAAA;AANZ;;;;GAIG;;AA+CH,kCA8FC;AA0BD,gDAgBC;AAnLD,iCAA6C;AAC7C,4CAA0C;AAQ1C,gFAAgF;AAChF,OAAO;AACP,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACtD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAA,eAAO,GAAE,CAAA;IACtC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IACjD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAA0B,IAAI,CAAC,CAAA;IAEjE,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QACtC,oBAAoB;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAA;QAEd,gBAAgB;QAChB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,UAAU,GAAqB;gBACnC,KAAK,EAAE,oBAAoB;gBAC3B,IAAI,EAAE,YAAY;aACnB,CAAA;YACD,QAAQ,CAAC,UAAU,CAAC,CAAA;YACpB,OAAO,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,CAAA;YAC9B,OAAM;QACR,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,CAAA;QAElB,IAAI,CAAC;YACH,qBAAqB;YACrB,MAAM,IAAI,GAAG;gBACX,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAC1B,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,WAAW,EAAE,IAAI,CAAC,UAAU;wBAC1B,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;6BAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;6BAC7B,IAAI,CAAC,IAAI,CAAC;wBACf,CAAC,CAAC,SAAS;oBACb,sCAAsC;oBACtC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;oBACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,KAAK,EAAE,IAAI,CAAC,KAAK;iBAClB,CAAC,CAAC;gBACH,aAAa,EAAE,OAAO,EAAE,aAAa;gBACrC,UAAU,EAAE,OAAO,EAAE,UAAU;gBAC/B,UAAU,EAAE,OAAO,EAAE,UAAU;gBAC/B,SAAS,EAAE,OAAO,EAAE,SAAS;gBAC7B,QAAQ,EAAE,OAAO,EAAE,QAAQ;aAC5B,CAAA;YAED,oBAAoB;YACpB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE;gBAC5C,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;gBAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aAC3B,CAAC,CAAA;YAEF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YAElC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,QAAQ,GAAG,IAAwB,CAAA;gBACzC,QAAQ,CAAC,QAAQ,CAAC,CAAA;gBAClB,OAAO,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC5B,OAAM;YACR,CAAC;YAED,MAAM,OAAO,GAAG,IAA+B,CAAA;YAE/C,wBAAwB;YACxB,OAAO,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,CAAA;YAE7B,iDAAiD;YACjD,IAAI,OAAO,EAAE,mBAAmB,KAAK,KAAK,EAAE,CAAC;gBAC3C,SAAS,EAAE,CAAA;YACb,CAAC;YAED,8BAA8B;YAC9B,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;gBAChB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAA;YACpC,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,YAAY,GAAqB;gBACrC,KAAK,EAAE,kCAAkC;gBACzC,IAAI,EAAE,gBAAgB;aACvB,CAAA;YACD,QAAQ,CAAC,YAAY,CAAC,CAAA;YACtB,OAAO,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,CAAA;QAClC,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;IAE/B,OAAO;QACL,QAAQ;QACR,SAAS;QACT,KAAK;QACL,UAAU,EAAE,IAAA,mBAAW,EAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;KAClD,CAAA;AACH,CAAC;AAED,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,kBAAkB;IAChC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAA;IAE/D,uCAAuC;IACvC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC1D,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QACnC,IAAI,EAAE,EAAE,CAAC;YACP,YAAY,CAAC,EAAE,CAAC,CAAA;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,SAAS;QACT,gEAAgE;KACjE,CAAA;AACH,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @rovela/sdk/checkout
3
+ *
4
+ * Stripe Checkout integration with Direct Charges for connected accounts.
5
+ *
6
+ * ## Overview
7
+ *
8
+ * This module provides complete Stripe Checkout integration:
9
+ * - Stripe Checkout (hosted) for payment collection
10
+ * - Direct Charges to connected accounts
11
+ * - Automatic platform fee calculation
12
+ * - Webhook handling for order creation
13
+ *
14
+ * ## Quick Start
15
+ *
16
+ * ### 1. Environment Variables
17
+ *
18
+ * ```env
19
+ * # Platform (Rovela) credentials
20
+ * STRIPE_SECRET_KEY=sk_live_...
21
+ * STRIPE_PUBLISHABLE_KEY=pk_live_...
22
+ * STRIPE_WEBHOOK_SECRET=whsec_...
23
+ *
24
+ * # Per-store connected account (set during store setup)
25
+ * STRIPE_CONNECTED_ACCOUNT_ID=acct_...
26
+ *
27
+ * # Optional configuration
28
+ * STRIPE_PLATFORM_FEE_PERCENT=5 # Platform takes 5%
29
+ * STORE_CURRENCY=USD # Store currency
30
+ * ```
31
+ *
32
+ * ### 2. API Routes
33
+ *
34
+ * ```typescript
35
+ * // app/api/checkout/route.ts
36
+ * export { POST } from '@rovela/sdk/checkout/api'
37
+ *
38
+ * // app/api/webhooks/stripe/route.ts
39
+ * import { handleStripeWebhook } from '@rovela/sdk/checkout/server'
40
+ *
41
+ * export async function POST(request: Request) {
42
+ * const payload = await request.text()
43
+ * const signature = request.headers.get('stripe-signature')!
44
+ * const result = await handleStripeWebhook(payload, signature)
45
+ * return Response.json(result)
46
+ * }
47
+ * ```
48
+ *
49
+ * ### 3. Checkout Button
50
+ *
51
+ * ```tsx
52
+ * // In your cart or product page
53
+ * import { CheckoutButton } from '@rovela/sdk/checkout'
54
+ *
55
+ * function Cart() {
56
+ * return (
57
+ * <div>
58
+ * <CartItems />
59
+ * <CartSummary />
60
+ * <CheckoutButton size="lg" fullWidth>
61
+ * Proceed to Checkout
62
+ * </CheckoutButton>
63
+ * </div>
64
+ * )
65
+ * }
66
+ * ```
67
+ *
68
+ * ### 4. Success Page
69
+ *
70
+ * ```tsx
71
+ * // app/checkout/success/page.tsx
72
+ * import { CheckoutSuccess } from '@rovela/sdk/checkout'
73
+ * import { useCart } from '@rovela/sdk/cart'
74
+ *
75
+ * export default function SuccessPage() {
76
+ * const { clearCart } = useCart()
77
+ *
78
+ * return (
79
+ * <CheckoutSuccess
80
+ * continueShoppingHref="/products"
81
+ * viewOrderHref="/account/orders/{orderId}"
82
+ * onMount={clearCart}
83
+ * />
84
+ * )
85
+ * }
86
+ * ```
87
+ *
88
+ * ## Architecture
89
+ *
90
+ * ```
91
+ * Cart → CheckoutButton → /api/checkout → Stripe Checkout (hosted)
92
+ * ↓
93
+ * Database ← Webhook ← /api/webhooks/stripe ← Stripe
94
+ * ↓
95
+ * Order Created
96
+ * ```
97
+ *
98
+ * ## Direct Charges Model
99
+ *
100
+ * With Direct Charges, payments are made directly on the connected account:
101
+ * - Payment shows connected account name on customer statement
102
+ * - Connected account handles disputes
103
+ * - Platform collects application fee automatically
104
+ */
105
+ export type { CheckoutLineItem, CheckoutSessionRequest, CheckoutSessionResponse, CheckoutApiError, CreateOrderParams, WebhookResult, CheckoutStep, ShippingOption, CheckoutState, CheckoutButtonProps, ShippingFormProps, OrderSummaryProps, CheckoutSuccessProps, UseCheckoutOptions, UseCheckoutReturn, } from './types';
106
+ export { CheckoutButton, CheckoutSuccess, OrderSummary, ShippingForm, } from './components';
107
+ export { useCheckout, useCheckoutSuccess } from './hooks';
108
+ export { createCheckoutSession, getCheckoutSession, createOrderFromCheckout, extractOrderParamsFromSession, handleRefund, handleStripeWebhook, } from './server';
109
+ export type { CreateCheckoutSessionOptions } from './server';
110
+ export { getStripe, getConnectedAccountId, hasConnectedAccount, getPlatformFeePercent, calculateApplicationFee, getWebhookSecret, getStoreCurrency, getAllowedShippingCountries, getPublishableKey, } from './stripe';
111
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkout/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGG;AAMH,YAAY,EAEV,gBAAgB,EAEhB,sBAAsB,EACtB,uBAAuB,EAEvB,gBAAgB,EAEhB,iBAAiB,EAEjB,aAAa,EAEb,YAAY,EACZ,cAAc,EACd,aAAa,EAEb,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EAEpB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAA;AAMhB,OAAO,EACL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,cAAc,CAAA;AAMrB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAMzD,OAAO,EAEL,qBAAqB,EACrB,kBAAkB,EAElB,uBAAuB,EACvB,6BAA6B,EAC7B,YAAY,EAEZ,mBAAmB,GACpB,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAM5D,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,UAAU,CAAA"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ /**
3
+ * @rovela/sdk/checkout
4
+ *
5
+ * Stripe Checkout integration with Direct Charges for connected accounts.
6
+ *
7
+ * ## Overview
8
+ *
9
+ * This module provides complete Stripe Checkout integration:
10
+ * - Stripe Checkout (hosted) for payment collection
11
+ * - Direct Charges to connected accounts
12
+ * - Automatic platform fee calculation
13
+ * - Webhook handling for order creation
14
+ *
15
+ * ## Quick Start
16
+ *
17
+ * ### 1. Environment Variables
18
+ *
19
+ * ```env
20
+ * # Platform (Rovela) credentials
21
+ * STRIPE_SECRET_KEY=sk_live_...
22
+ * STRIPE_PUBLISHABLE_KEY=pk_live_...
23
+ * STRIPE_WEBHOOK_SECRET=whsec_...
24
+ *
25
+ * # Per-store connected account (set during store setup)
26
+ * STRIPE_CONNECTED_ACCOUNT_ID=acct_...
27
+ *
28
+ * # Optional configuration
29
+ * STRIPE_PLATFORM_FEE_PERCENT=5 # Platform takes 5%
30
+ * STORE_CURRENCY=USD # Store currency
31
+ * ```
32
+ *
33
+ * ### 2. API Routes
34
+ *
35
+ * ```typescript
36
+ * // app/api/checkout/route.ts
37
+ * export { POST } from '@rovela/sdk/checkout/api'
38
+ *
39
+ * // app/api/webhooks/stripe/route.ts
40
+ * import { handleStripeWebhook } from '@rovela/sdk/checkout/server'
41
+ *
42
+ * export async function POST(request: Request) {
43
+ * const payload = await request.text()
44
+ * const signature = request.headers.get('stripe-signature')!
45
+ * const result = await handleStripeWebhook(payload, signature)
46
+ * return Response.json(result)
47
+ * }
48
+ * ```
49
+ *
50
+ * ### 3. Checkout Button
51
+ *
52
+ * ```tsx
53
+ * // In your cart or product page
54
+ * import { CheckoutButton } from '@rovela/sdk/checkout'
55
+ *
56
+ * function Cart() {
57
+ * return (
58
+ * <div>
59
+ * <CartItems />
60
+ * <CartSummary />
61
+ * <CheckoutButton size="lg" fullWidth>
62
+ * Proceed to Checkout
63
+ * </CheckoutButton>
64
+ * </div>
65
+ * )
66
+ * }
67
+ * ```
68
+ *
69
+ * ### 4. Success Page
70
+ *
71
+ * ```tsx
72
+ * // app/checkout/success/page.tsx
73
+ * import { CheckoutSuccess } from '@rovela/sdk/checkout'
74
+ * import { useCart } from '@rovela/sdk/cart'
75
+ *
76
+ * export default function SuccessPage() {
77
+ * const { clearCart } = useCart()
78
+ *
79
+ * return (
80
+ * <CheckoutSuccess
81
+ * continueShoppingHref="/products"
82
+ * viewOrderHref="/account/orders/{orderId}"
83
+ * onMount={clearCart}
84
+ * />
85
+ * )
86
+ * }
87
+ * ```
88
+ *
89
+ * ## Architecture
90
+ *
91
+ * ```
92
+ * Cart → CheckoutButton → /api/checkout → Stripe Checkout (hosted)
93
+ * ↓
94
+ * Database ← Webhook ← /api/webhooks/stripe ← Stripe
95
+ * ↓
96
+ * Order Created
97
+ * ```
98
+ *
99
+ * ## Direct Charges Model
100
+ *
101
+ * With Direct Charges, payments are made directly on the connected account:
102
+ * - Payment shows connected account name on customer statement
103
+ * - Connected account handles disputes
104
+ * - Platform collects application fee automatically
105
+ */
106
+ Object.defineProperty(exports, "__esModule", { value: true });
107
+ exports.getPublishableKey = exports.getAllowedShippingCountries = exports.getStoreCurrency = exports.getWebhookSecret = exports.calculateApplicationFee = exports.getPlatformFeePercent = exports.hasConnectedAccount = exports.getConnectedAccountId = exports.getStripe = exports.handleStripeWebhook = exports.handleRefund = exports.extractOrderParamsFromSession = exports.createOrderFromCheckout = exports.getCheckoutSession = exports.createCheckoutSession = exports.useCheckoutSuccess = exports.useCheckout = exports.ShippingForm = exports.OrderSummary = exports.CheckoutSuccess = exports.CheckoutButton = void 0;
108
+ // =============================================================================
109
+ // Components
110
+ // =============================================================================
111
+ var components_1 = require("./components");
112
+ Object.defineProperty(exports, "CheckoutButton", { enumerable: true, get: function () { return components_1.CheckoutButton; } });
113
+ Object.defineProperty(exports, "CheckoutSuccess", { enumerable: true, get: function () { return components_1.CheckoutSuccess; } });
114
+ Object.defineProperty(exports, "OrderSummary", { enumerable: true, get: function () { return components_1.OrderSummary; } });
115
+ Object.defineProperty(exports, "ShippingForm", { enumerable: true, get: function () { return components_1.ShippingForm; } });
116
+ // =============================================================================
117
+ // Hooks
118
+ // =============================================================================
119
+ var hooks_1 = require("./hooks");
120
+ Object.defineProperty(exports, "useCheckout", { enumerable: true, get: function () { return hooks_1.useCheckout; } });
121
+ Object.defineProperty(exports, "useCheckoutSuccess", { enumerable: true, get: function () { return hooks_1.useCheckoutSuccess; } });
122
+ // =============================================================================
123
+ // Server Functions
124
+ // =============================================================================
125
+ var server_1 = require("./server");
126
+ // Session creation
127
+ Object.defineProperty(exports, "createCheckoutSession", { enumerable: true, get: function () { return server_1.createCheckoutSession; } });
128
+ Object.defineProperty(exports, "getCheckoutSession", { enumerable: true, get: function () { return server_1.getCheckoutSession; } });
129
+ // Order management
130
+ Object.defineProperty(exports, "createOrderFromCheckout", { enumerable: true, get: function () { return server_1.createOrderFromCheckout; } });
131
+ Object.defineProperty(exports, "extractOrderParamsFromSession", { enumerable: true, get: function () { return server_1.extractOrderParamsFromSession; } });
132
+ Object.defineProperty(exports, "handleRefund", { enumerable: true, get: function () { return server_1.handleRefund; } });
133
+ // Webhook handler
134
+ Object.defineProperty(exports, "handleStripeWebhook", { enumerable: true, get: function () { return server_1.handleStripeWebhook; } });
135
+ // =============================================================================
136
+ // Stripe Client Utilities
137
+ // =============================================================================
138
+ var stripe_1 = require("./stripe");
139
+ Object.defineProperty(exports, "getStripe", { enumerable: true, get: function () { return stripe_1.getStripe; } });
140
+ Object.defineProperty(exports, "getConnectedAccountId", { enumerable: true, get: function () { return stripe_1.getConnectedAccountId; } });
141
+ Object.defineProperty(exports, "hasConnectedAccount", { enumerable: true, get: function () { return stripe_1.hasConnectedAccount; } });
142
+ Object.defineProperty(exports, "getPlatformFeePercent", { enumerable: true, get: function () { return stripe_1.getPlatformFeePercent; } });
143
+ Object.defineProperty(exports, "calculateApplicationFee", { enumerable: true, get: function () { return stripe_1.calculateApplicationFee; } });
144
+ Object.defineProperty(exports, "getWebhookSecret", { enumerable: true, get: function () { return stripe_1.getWebhookSecret; } });
145
+ Object.defineProperty(exports, "getStoreCurrency", { enumerable: true, get: function () { return stripe_1.getStoreCurrency; } });
146
+ Object.defineProperty(exports, "getAllowedShippingCountries", { enumerable: true, get: function () { return stripe_1.getAllowedShippingCountries; } });
147
+ Object.defineProperty(exports, "getPublishableKey", { enumerable: true, get: function () { return stripe_1.getPublishableKey; } });
148
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checkout/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGG;;;AAgCH,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,2CAKqB;AAJnB,4GAAA,cAAc,OAAA;AACd,6GAAA,eAAe,OAAA;AACf,0GAAA,YAAY,OAAA;AACZ,0GAAA,YAAY,OAAA;AAGd,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAEhF,iCAAyD;AAAhD,oGAAA,WAAW,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAExC,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF,mCAUiB;AATf,mBAAmB;AACnB,+GAAA,qBAAqB,OAAA;AACrB,4GAAA,kBAAkB,OAAA;AAClB,mBAAmB;AACnB,iHAAA,uBAAuB,OAAA;AACvB,uHAAA,6BAA6B,OAAA;AAC7B,sGAAA,YAAY,OAAA;AACZ,kBAAkB;AAClB,6GAAA,mBAAmB,OAAA;AAKrB,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF,mCAUiB;AATf,mGAAA,SAAS,OAAA;AACT,+GAAA,qBAAqB,OAAA;AACrB,6GAAA,mBAAmB,OAAA;AACnB,+GAAA,qBAAqB,OAAA;AACrB,iHAAA,uBAAuB,OAAA;AACvB,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAChB,qHAAA,2BAA2B,OAAA;AAC3B,2GAAA,iBAAiB,OAAA"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @rovela/sdk/checkout/server/create-checkout-session
3
+ *
4
+ * Creates a Stripe Checkout session using Direct Charges.
5
+ * The payment is processed ON the connected account, not the platform.
6
+ */
7
+ import type Stripe from 'stripe';
8
+ import type { CheckoutSessionRequest, CheckoutSessionResponse, CheckoutLineItem } from '../types';
9
+ export interface CreateCheckoutSessionOptions {
10
+ /**
11
+ * Whether to collect shipping address.
12
+ * Default: true
13
+ */
14
+ collectShippingAddress?: boolean;
15
+ /**
16
+ * Whether to collect phone number.
17
+ * Default: false
18
+ */
19
+ collectPhoneNumber?: boolean;
20
+ /**
21
+ * Whether to allow promotion codes.
22
+ * Default: false
23
+ */
24
+ allowPromotionCodes?: boolean;
25
+ /**
26
+ * Automatic tax calculation.
27
+ * Requires Stripe Tax to be enabled.
28
+ * Default: false
29
+ */
30
+ automaticTax?: boolean;
31
+ /**
32
+ * Custom application fee in cents.
33
+ * If not provided, calculated from STRIPE_PLATFORM_FEE_PERCENT.
34
+ */
35
+ applicationFeeAmount?: number;
36
+ }
37
+ /**
38
+ * Create a Stripe Checkout session for Direct Charges.
39
+ *
40
+ * This creates the checkout session ON the connected account (Direct Charge),
41
+ * meaning the payment shows up in the connected account's dashboard, and
42
+ * the application fee is transferred to the platform.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const session = await createCheckoutSession({
47
+ * items: [
48
+ * { name: 'T-Shirt', price: 2999, quantity: 1 }
49
+ * ],
50
+ * customerEmail: 'customer@example.com',
51
+ * successUrl: 'https://store.example.com/success?session_id={CHECKOUT_SESSION_ID}',
52
+ * cancelUrl: 'https://store.example.com/cart',
53
+ * })
54
+ *
55
+ * // Redirect customer to Stripe Checkout
56
+ * redirect(session.url)
57
+ * ```
58
+ */
59
+ export declare function createCheckoutSession(request: CheckoutSessionRequest, options?: CreateCheckoutSessionOptions): Promise<CheckoutSessionResponse>;
60
+ /**
61
+ * Deserialize items from Stripe metadata.
62
+ */
63
+ export declare function deserializeItemsFromMetadata(json: string): CheckoutLineItem[];
64
+ /**
65
+ * Retrieve a checkout session by ID.
66
+ * Useful for the success page to get order details.
67
+ */
68
+ export declare function getCheckoutSession(sessionId: string): Promise<Stripe.Checkout.Session | null>;
69
+ //# sourceMappingURL=create-checkout-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-checkout-session.d.ts","sourceRoot":"","sources":["../../../src/checkout/server/create-checkout-session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAQhC,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,UAAU,CAAA;AAMjB,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAEhC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,sBAAsB,EAC/B,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,uBAAuB,CAAC,CAsHlC;AA4BD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,GACX,gBAAgB,EAAE,CAqBpB;AAMD;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,CAoBzC"}