@rovela-ai/sdk 0.3.34 → 0.4.1

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 (981) hide show
  1. package/dist/admin/{styles/admin-theme.css → admin-theme.css} +1 -46
  2. package/dist/checkout/index.d.ts +1 -1
  3. package/dist/checkout/index.d.ts.map +1 -1
  4. package/dist/checkout/server/create-checkout-session.d.ts +10 -1
  5. package/dist/checkout/server/create-checkout-session.d.ts.map +1 -1
  6. package/dist/checkout/server/create-checkout-session.js +28 -17
  7. package/dist/checkout/server/create-checkout-session.js.map +1 -1
  8. package/dist/checkout/server/handle-webhook.d.ts.map +1 -1
  9. package/dist/checkout/server/handle-webhook.js +24 -26
  10. package/dist/checkout/server/handle-webhook.js.map +1 -1
  11. package/dist/checkout/server/order-service.d.ts +8 -3
  12. package/dist/checkout/server/order-service.d.ts.map +1 -1
  13. package/dist/checkout/server/order-service.js +60 -14
  14. package/dist/checkout/server/order-service.js.map +1 -1
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.d.ts.map +1 -1
  17. package/package.json +1 -2
  18. package/dist/admin/api/accept-invite.d.ts +0 -65
  19. package/dist/admin/api/accept-invite.d.ts.map +0 -1
  20. package/dist/admin/api/accept-invite.js +0 -115
  21. package/dist/admin/api/accept-invite.js.map +0 -1
  22. package/dist/admin/api/auth.d.ts +0 -32
  23. package/dist/admin/api/auth.d.ts.map +0 -1
  24. package/dist/admin/api/auth.js +0 -37
  25. package/dist/admin/api/auth.js.map +0 -1
  26. package/dist/admin/api/categories.d.ts +0 -68
  27. package/dist/admin/api/categories.d.ts.map +0 -1
  28. package/dist/admin/api/categories.js +0 -266
  29. package/dist/admin/api/categories.js.map +0 -1
  30. package/dist/admin/api/check.d.ts +0 -38
  31. package/dist/admin/api/check.d.ts.map +0 -1
  32. package/dist/admin/api/check.js +0 -49
  33. package/dist/admin/api/check.js.map +0 -1
  34. package/dist/admin/api/customers.d.ts +0 -77
  35. package/dist/admin/api/customers.d.ts.map +0 -1
  36. package/dist/admin/api/customers.js +0 -219
  37. package/dist/admin/api/customers.js.map +0 -1
  38. package/dist/admin/api/forgot-password.d.ts +0 -39
  39. package/dist/admin/api/forgot-password.d.ts.map +0 -1
  40. package/dist/admin/api/forgot-password.js +0 -66
  41. package/dist/admin/api/forgot-password.js.map +0 -1
  42. package/dist/admin/api/index.d.ts +0 -107
  43. package/dist/admin/api/index.d.ts.map +0 -1
  44. package/dist/admin/api/index.js +0 -127
  45. package/dist/admin/api/index.js.map +0 -1
  46. package/dist/admin/api/linked-customer.d.ts +0 -32
  47. package/dist/admin/api/linked-customer.d.ts.map +0 -1
  48. package/dist/admin/api/linked-customer.js +0 -45
  49. package/dist/admin/api/linked-customer.js.map +0 -1
  50. package/dist/admin/api/me.d.ts +0 -72
  51. package/dist/admin/api/me.d.ts.map +0 -1
  52. package/dist/admin/api/me.js +0 -177
  53. package/dist/admin/api/me.js.map +0 -1
  54. package/dist/admin/api/orders.d.ts +0 -91
  55. package/dist/admin/api/orders.d.ts.map +0 -1
  56. package/dist/admin/api/orders.js +0 -390
  57. package/dist/admin/api/orders.js.map +0 -1
  58. package/dist/admin/api/products-bulk.d.ts +0 -38
  59. package/dist/admin/api/products-bulk.d.ts.map +0 -1
  60. package/dist/admin/api/products-bulk.js +0 -135
  61. package/dist/admin/api/products-bulk.js.map +0 -1
  62. package/dist/admin/api/products-stats.d.ts +0 -34
  63. package/dist/admin/api/products-stats.d.ts.map +0 -1
  64. package/dist/admin/api/products-stats.js +0 -43
  65. package/dist/admin/api/products-stats.js.map +0 -1
  66. package/dist/admin/api/products.d.ts +0 -104
  67. package/dist/admin/api/products.d.ts.map +0 -1
  68. package/dist/admin/api/products.js +0 -491
  69. package/dist/admin/api/products.js.map +0 -1
  70. package/dist/admin/api/refund.d.ts +0 -29
  71. package/dist/admin/api/refund.d.ts.map +0 -1
  72. package/dist/admin/api/refund.js +0 -142
  73. package/dist/admin/api/refund.js.map +0 -1
  74. package/dist/admin/api/reset-password.d.ts +0 -49
  75. package/dist/admin/api/reset-password.d.ts.map +0 -1
  76. package/dist/admin/api/reset-password.js +0 -99
  77. package/dist/admin/api/reset-password.js.map +0 -1
  78. package/dist/admin/api/return.d.ts +0 -47
  79. package/dist/admin/api/return.d.ts.map +0 -1
  80. package/dist/admin/api/return.js +0 -186
  81. package/dist/admin/api/return.js.map +0 -1
  82. package/dist/admin/api/settings.d.ts +0 -49
  83. package/dist/admin/api/settings.d.ts.map +0 -1
  84. package/dist/admin/api/settings.js +0 -201
  85. package/dist/admin/api/settings.js.map +0 -1
  86. package/dist/admin/api/setup-guide.d.ts +0 -78
  87. package/dist/admin/api/setup-guide.d.ts.map +0 -1
  88. package/dist/admin/api/setup-guide.js +0 -235
  89. package/dist/admin/api/setup-guide.js.map +0 -1
  90. package/dist/admin/api/setup.d.ts +0 -60
  91. package/dist/admin/api/setup.d.ts.map +0 -1
  92. package/dist/admin/api/setup.js +0 -126
  93. package/dist/admin/api/setup.js.map +0 -1
  94. package/dist/admin/api/shipping.d.ts +0 -287
  95. package/dist/admin/api/shipping.d.ts.map +0 -1
  96. package/dist/admin/api/shipping.js +0 -746
  97. package/dist/admin/api/shipping.js.map +0 -1
  98. package/dist/admin/api/stats.d.ts +0 -43
  99. package/dist/admin/api/stats.d.ts.map +0 -1
  100. package/dist/admin/api/stats.js +0 -92
  101. package/dist/admin/api/stats.js.map +0 -1
  102. package/dist/admin/api/stripe-status.d.ts +0 -39
  103. package/dist/admin/api/stripe-status.d.ts.map +0 -1
  104. package/dist/admin/api/stripe-status.js +0 -99
  105. package/dist/admin/api/stripe-status.js.map +0 -1
  106. package/dist/admin/api/tax-zones.d.ts +0 -97
  107. package/dist/admin/api/tax-zones.d.ts.map +0 -1
  108. package/dist/admin/api/tax-zones.js +0 -265
  109. package/dist/admin/api/tax-zones.js.map +0 -1
  110. package/dist/admin/api/users.d.ts +0 -142
  111. package/dist/admin/api/users.d.ts.map +0 -1
  112. package/dist/admin/api/users.js +0 -356
  113. package/dist/admin/api/users.js.map +0 -1
  114. package/dist/admin/components/AdminAcceptInviteForm.d.ts +0 -3
  115. package/dist/admin/components/AdminAcceptInviteForm.d.ts.map +0 -1
  116. package/dist/admin/components/AdminAcceptInviteForm.js +0 -137
  117. package/dist/admin/components/AdminAcceptInviteForm.js.map +0 -1
  118. package/dist/admin/components/AdminAccountPage.d.ts +0 -10
  119. package/dist/admin/components/AdminAccountPage.d.ts.map +0 -1
  120. package/dist/admin/components/AdminAccountPage.js +0 -126
  121. package/dist/admin/components/AdminAccountPage.js.map +0 -1
  122. package/dist/admin/components/AdminBarBanner.d.ts +0 -2
  123. package/dist/admin/components/AdminBarBanner.d.ts.map +0 -1
  124. package/dist/admin/components/AdminBarBanner.js +0 -266
  125. package/dist/admin/components/AdminBarBanner.js.map +0 -1
  126. package/dist/admin/components/AdminForgotPasswordForm.d.ts +0 -8
  127. package/dist/admin/components/AdminForgotPasswordForm.d.ts.map +0 -1
  128. package/dist/admin/components/AdminForgotPasswordForm.js +0 -59
  129. package/dist/admin/components/AdminForgotPasswordForm.js.map +0 -1
  130. package/dist/admin/components/AdminGuard.d.ts +0 -40
  131. package/dist/admin/components/AdminGuard.d.ts.map +0 -1
  132. package/dist/admin/components/AdminGuard.js +0 -94
  133. package/dist/admin/components/AdminGuard.js.map +0 -1
  134. package/dist/admin/components/AdminLayout.d.ts +0 -40
  135. package/dist/admin/components/AdminLayout.d.ts.map +0 -1
  136. package/dist/admin/components/AdminLayout.js +0 -39
  137. package/dist/admin/components/AdminLayout.js.map +0 -1
  138. package/dist/admin/components/AdminLoginForm.d.ts +0 -18
  139. package/dist/admin/components/AdminLoginForm.d.ts.map +0 -1
  140. package/dist/admin/components/AdminLoginForm.js +0 -61
  141. package/dist/admin/components/AdminLoginForm.js.map +0 -1
  142. package/dist/admin/components/AdminNav.d.ts +0 -44
  143. package/dist/admin/components/AdminNav.d.ts.map +0 -1
  144. package/dist/admin/components/AdminNav.js +0 -175
  145. package/dist/admin/components/AdminNav.js.map +0 -1
  146. package/dist/admin/components/AdminResetPasswordForm.d.ts +0 -12
  147. package/dist/admin/components/AdminResetPasswordForm.d.ts.map +0 -1
  148. package/dist/admin/components/AdminResetPasswordForm.js +0 -134
  149. package/dist/admin/components/AdminResetPasswordForm.js.map +0 -1
  150. package/dist/admin/components/AdminSelect.d.ts +0 -47
  151. package/dist/admin/components/AdminSelect.d.ts.map +0 -1
  152. package/dist/admin/components/AdminSelect.js +0 -71
  153. package/dist/admin/components/AdminSelect.js.map +0 -1
  154. package/dist/admin/components/AdminSetupForm.d.ts +0 -28
  155. package/dist/admin/components/AdminSetupForm.d.ts.map +0 -1
  156. package/dist/admin/components/AdminSetupForm.js +0 -85
  157. package/dist/admin/components/AdminSetupForm.js.map +0 -1
  158. package/dist/admin/components/AdminToast.d.ts +0 -31
  159. package/dist/admin/components/AdminToast.d.ts.map +0 -1
  160. package/dist/admin/components/AdminToast.js +0 -83
  161. package/dist/admin/components/AdminToast.js.map +0 -1
  162. package/dist/admin/components/AdminUserMenu.d.ts +0 -14
  163. package/dist/admin/components/AdminUserMenu.d.ts.map +0 -1
  164. package/dist/admin/components/AdminUserMenu.js +0 -34
  165. package/dist/admin/components/AdminUserMenu.js.map +0 -1
  166. package/dist/admin/components/CategoryForm.d.ts +0 -30
  167. package/dist/admin/components/CategoryForm.d.ts.map +0 -1
  168. package/dist/admin/components/CategoryForm.js +0 -152
  169. package/dist/admin/components/CategoryForm.js.map +0 -1
  170. package/dist/admin/components/CategorySelect.d.ts +0 -32
  171. package/dist/admin/components/CategorySelect.d.ts.map +0 -1
  172. package/dist/admin/components/CategorySelect.js +0 -139
  173. package/dist/admin/components/CategorySelect.js.map +0 -1
  174. package/dist/admin/components/CustomerDetails.d.ts +0 -15
  175. package/dist/admin/components/CustomerDetails.d.ts.map +0 -1
  176. package/dist/admin/components/CustomerDetails.js +0 -177
  177. package/dist/admin/components/CustomerDetails.js.map +0 -1
  178. package/dist/admin/components/CustomerTable.d.ts +0 -13
  179. package/dist/admin/components/CustomerTable.d.ts.map +0 -1
  180. package/dist/admin/components/CustomerTable.js +0 -112
  181. package/dist/admin/components/CustomerTable.js.map +0 -1
  182. package/dist/admin/components/DeleteConfirmDialog.d.ts +0 -57
  183. package/dist/admin/components/DeleteConfirmDialog.d.ts.map +0 -1
  184. package/dist/admin/components/DeleteConfirmDialog.js +0 -46
  185. package/dist/admin/components/DeleteConfirmDialog.js.map +0 -1
  186. package/dist/admin/components/ExampleContentBanner.d.ts +0 -2
  187. package/dist/admin/components/ExampleContentBanner.d.ts.map +0 -1
  188. package/dist/admin/components/ExampleContentBanner.js +0 -153
  189. package/dist/admin/components/ExampleContentBanner.js.map +0 -1
  190. package/dist/admin/components/InventoryEditor.d.ts +0 -15
  191. package/dist/admin/components/InventoryEditor.d.ts.map +0 -1
  192. package/dist/admin/components/InventoryEditor.js +0 -86
  193. package/dist/admin/components/InventoryEditor.js.map +0 -1
  194. package/dist/admin/components/InviteUserDialog.d.ts +0 -3
  195. package/dist/admin/components/InviteUserDialog.d.ts.map +0 -1
  196. package/dist/admin/components/InviteUserDialog.js +0 -127
  197. package/dist/admin/components/InviteUserDialog.js.map +0 -1
  198. package/dist/admin/components/LogoUpload.d.ts +0 -22
  199. package/dist/admin/components/LogoUpload.d.ts.map +0 -1
  200. package/dist/admin/components/LogoUpload.js +0 -210
  201. package/dist/admin/components/LogoUpload.js.map +0 -1
  202. package/dist/admin/components/LowStockAlert.d.ts +0 -11
  203. package/dist/admin/components/LowStockAlert.d.ts.map +0 -1
  204. package/dist/admin/components/LowStockAlert.js +0 -33
  205. package/dist/admin/components/LowStockAlert.js.map +0 -1
  206. package/dist/admin/components/OrderDetails.d.ts +0 -14
  207. package/dist/admin/components/OrderDetails.d.ts.map +0 -1
  208. package/dist/admin/components/OrderDetails.js +0 -210
  209. package/dist/admin/components/OrderDetails.js.map +0 -1
  210. package/dist/admin/components/OrderStatusChart.d.ts +0 -21
  211. package/dist/admin/components/OrderStatusChart.d.ts.map +0 -1
  212. package/dist/admin/components/OrderStatusChart.js +0 -61
  213. package/dist/admin/components/OrderStatusChart.js.map +0 -1
  214. package/dist/admin/components/OrderTable.d.ts +0 -13
  215. package/dist/admin/components/OrderTable.d.ts.map +0 -1
  216. package/dist/admin/components/OrderTable.js +0 -117
  217. package/dist/admin/components/OrderTable.js.map +0 -1
  218. package/dist/admin/components/PaymentSettings.d.ts +0 -13
  219. package/dist/admin/components/PaymentSettings.d.ts.map +0 -1
  220. package/dist/admin/components/PaymentSettings.js +0 -120
  221. package/dist/admin/components/PaymentSettings.js.map +0 -1
  222. package/dist/admin/components/PeriodSelector.d.ts +0 -9
  223. package/dist/admin/components/PeriodSelector.d.ts.map +0 -1
  224. package/dist/admin/components/PeriodSelector.js +0 -19
  225. package/dist/admin/components/PeriodSelector.js.map +0 -1
  226. package/dist/admin/components/PermissionsMatrix.d.ts +0 -8
  227. package/dist/admin/components/PermissionsMatrix.d.ts.map +0 -1
  228. package/dist/admin/components/PermissionsMatrix.js +0 -70
  229. package/dist/admin/components/PermissionsMatrix.js.map +0 -1
  230. package/dist/admin/components/PrimaryMetricsRow.d.ts +0 -11
  231. package/dist/admin/components/PrimaryMetricsRow.d.ts.map +0 -1
  232. package/dist/admin/components/PrimaryMetricsRow.js +0 -73
  233. package/dist/admin/components/PrimaryMetricsRow.js.map +0 -1
  234. package/dist/admin/components/ProductForm.d.ts +0 -18
  235. package/dist/admin/components/ProductForm.d.ts.map +0 -1
  236. package/dist/admin/components/ProductForm.js +0 -261
  237. package/dist/admin/components/ProductForm.js.map +0 -1
  238. package/dist/admin/components/ProductTable.d.ts +0 -14
  239. package/dist/admin/components/ProductTable.d.ts.map +0 -1
  240. package/dist/admin/components/ProductTable.js +0 -384
  241. package/dist/admin/components/ProductTable.js.map +0 -1
  242. package/dist/admin/components/RecentOrders.d.ts +0 -11
  243. package/dist/admin/components/RecentOrders.d.ts.map +0 -1
  244. package/dist/admin/components/RecentOrders.js +0 -63
  245. package/dist/admin/components/RecentOrders.js.map +0 -1
  246. package/dist/admin/components/RefundDialog.d.ts +0 -17
  247. package/dist/admin/components/RefundDialog.d.ts.map +0 -1
  248. package/dist/admin/components/RefundDialog.js +0 -90
  249. package/dist/admin/components/RefundDialog.js.map +0 -1
  250. package/dist/admin/components/RevenueChart.d.ts +0 -23
  251. package/dist/admin/components/RevenueChart.d.ts.map +0 -1
  252. package/dist/admin/components/RevenueChart.js +0 -75
  253. package/dist/admin/components/RevenueChart.js.map +0 -1
  254. package/dist/admin/components/SEOPreview.d.ts +0 -33
  255. package/dist/admin/components/SEOPreview.d.ts.map +0 -1
  256. package/dist/admin/components/SEOPreview.js +0 -30
  257. package/dist/admin/components/SEOPreview.js.map +0 -1
  258. package/dist/admin/components/SecondaryMetricsRow.d.ts +0 -14
  259. package/dist/admin/components/SecondaryMetricsRow.d.ts.map +0 -1
  260. package/dist/admin/components/SecondaryMetricsRow.js +0 -45
  261. package/dist/admin/components/SecondaryMetricsRow.js.map +0 -1
  262. package/dist/admin/components/SetupGuide.d.ts +0 -4
  263. package/dist/admin/components/SetupGuide.d.ts.map +0 -1
  264. package/dist/admin/components/SetupGuide.js +0 -244
  265. package/dist/admin/components/SetupGuide.js.map +0 -1
  266. package/dist/admin/components/ShippingSettings.d.ts +0 -3
  267. package/dist/admin/components/ShippingSettings.d.ts.map +0 -1
  268. package/dist/admin/components/ShippingSettings.js +0 -553
  269. package/dist/admin/components/ShippingSettings.js.map +0 -1
  270. package/dist/admin/components/StatsCards.d.ts +0 -18
  271. package/dist/admin/components/StatsCards.d.ts.map +0 -1
  272. package/dist/admin/components/StatsCards.js +0 -71
  273. package/dist/admin/components/StatsCards.js.map +0 -1
  274. package/dist/admin/components/StoreSettings.d.ts +0 -19
  275. package/dist/admin/components/StoreSettings.d.ts.map +0 -1
  276. package/dist/admin/components/StoreSettings.js +0 -149
  277. package/dist/admin/components/StoreSettings.js.map +0 -1
  278. package/dist/admin/components/TagInput.d.ts +0 -29
  279. package/dist/admin/components/TagInput.d.ts.map +0 -1
  280. package/dist/admin/components/TagInput.js +0 -69
  281. package/dist/admin/components/TagInput.js.map +0 -1
  282. package/dist/admin/components/TaxSettings.d.ts +0 -12
  283. package/dist/admin/components/TaxSettings.d.ts.map +0 -1
  284. package/dist/admin/components/TaxSettings.js +0 -272
  285. package/dist/admin/components/TaxSettings.js.map +0 -1
  286. package/dist/admin/components/UsersTable.d.ts +0 -3
  287. package/dist/admin/components/UsersTable.d.ts.map +0 -1
  288. package/dist/admin/components/UsersTable.js +0 -393
  289. package/dist/admin/components/UsersTable.js.map +0 -1
  290. package/dist/admin/components/VariantManager.d.ts +0 -44
  291. package/dist/admin/components/VariantManager.d.ts.map +0 -1
  292. package/dist/admin/components/VariantManager.js +0 -325
  293. package/dist/admin/components/VariantManager.js.map +0 -1
  294. package/dist/admin/components/index.d.ts +0 -71
  295. package/dist/admin/components/index.d.ts.map +0 -1
  296. package/dist/admin/components/index.js +0 -87
  297. package/dist/admin/components/index.js.map +0 -1
  298. package/dist/admin/config.d.ts +0 -71
  299. package/dist/admin/config.d.ts.map +0 -1
  300. package/dist/admin/config.js +0 -253
  301. package/dist/admin/config.js.map +0 -1
  302. package/dist/admin/hooks/fetchAdminApi.d.ts +0 -65
  303. package/dist/admin/hooks/fetchAdminApi.d.ts.map +0 -1
  304. package/dist/admin/hooks/fetchAdminApi.js +0 -96
  305. package/dist/admin/hooks/fetchAdminApi.js.map +0 -1
  306. package/dist/admin/hooks/index.d.ts +0 -24
  307. package/dist/admin/hooks/index.d.ts.map +0 -1
  308. package/dist/admin/hooks/index.js +0 -19
  309. package/dist/admin/hooks/index.js.map +0 -1
  310. package/dist/admin/hooks/useAdminAuth.d.ts +0 -25
  311. package/dist/admin/hooks/useAdminAuth.d.ts.map +0 -1
  312. package/dist/admin/hooks/useAdminAuth.js +0 -183
  313. package/dist/admin/hooks/useAdminAuth.js.map +0 -1
  314. package/dist/admin/hooks/useAdminCategories.d.ts +0 -9
  315. package/dist/admin/hooks/useAdminCategories.d.ts.map +0 -1
  316. package/dist/admin/hooks/useAdminCategories.js +0 -112
  317. package/dist/admin/hooks/useAdminCategories.js.map +0 -1
  318. package/dist/admin/hooks/useAdminCustomers.d.ts +0 -3
  319. package/dist/admin/hooks/useAdminCustomers.d.ts.map +0 -1
  320. package/dist/admin/hooks/useAdminCustomers.js +0 -110
  321. package/dist/admin/hooks/useAdminCustomers.js.map +0 -1
  322. package/dist/admin/hooks/useAdminMe.d.ts +0 -31
  323. package/dist/admin/hooks/useAdminMe.d.ts.map +0 -1
  324. package/dist/admin/hooks/useAdminMe.js +0 -78
  325. package/dist/admin/hooks/useAdminMe.js.map +0 -1
  326. package/dist/admin/hooks/useAdminOrders.d.ts +0 -3
  327. package/dist/admin/hooks/useAdminOrders.d.ts.map +0 -1
  328. package/dist/admin/hooks/useAdminOrders.js +0 -118
  329. package/dist/admin/hooks/useAdminOrders.js.map +0 -1
  330. package/dist/admin/hooks/useAdminPermissions.d.ts +0 -3
  331. package/dist/admin/hooks/useAdminPermissions.d.ts.map +0 -1
  332. package/dist/admin/hooks/useAdminPermissions.js +0 -51
  333. package/dist/admin/hooks/useAdminPermissions.js.map +0 -1
  334. package/dist/admin/hooks/useAdminProductMetrics.d.ts +0 -3
  335. package/dist/admin/hooks/useAdminProductMetrics.d.ts.map +0 -1
  336. package/dist/admin/hooks/useAdminProductMetrics.js +0 -32
  337. package/dist/admin/hooks/useAdminProductMetrics.js.map +0 -1
  338. package/dist/admin/hooks/useAdminProducts.d.ts +0 -3
  339. package/dist/admin/hooks/useAdminProducts.d.ts.map +0 -1
  340. package/dist/admin/hooks/useAdminProducts.js +0 -132
  341. package/dist/admin/hooks/useAdminProducts.js.map +0 -1
  342. package/dist/admin/hooks/useAdminSession.d.ts +0 -23
  343. package/dist/admin/hooks/useAdminSession.d.ts.map +0 -1
  344. package/dist/admin/hooks/useAdminSession.js +0 -117
  345. package/dist/admin/hooks/useAdminSession.js.map +0 -1
  346. package/dist/admin/hooks/useAdminStats.d.ts +0 -47
  347. package/dist/admin/hooks/useAdminStats.d.ts.map +0 -1
  348. package/dist/admin/hooks/useAdminStats.js +0 -128
  349. package/dist/admin/hooks/useAdminStats.js.map +0 -1
  350. package/dist/admin/hooks/useAdminUsers.d.ts +0 -3
  351. package/dist/admin/hooks/useAdminUsers.d.ts.map +0 -1
  352. package/dist/admin/hooks/useAdminUsers.js +0 -177
  353. package/dist/admin/hooks/useAdminUsers.js.map +0 -1
  354. package/dist/admin/hooks/useLinkedCustomerStatus.d.ts +0 -3
  355. package/dist/admin/hooks/useLinkedCustomerStatus.d.ts.map +0 -1
  356. package/dist/admin/hooks/useLinkedCustomerStatus.js +0 -48
  357. package/dist/admin/hooks/useLinkedCustomerStatus.js.map +0 -1
  358. package/dist/admin/hooks/useSetupGuide.d.ts +0 -45
  359. package/dist/admin/hooks/useSetupGuide.d.ts.map +0 -1
  360. package/dist/admin/hooks/useSetupGuide.js +0 -60
  361. package/dist/admin/hooks/useSetupGuide.js.map +0 -1
  362. package/dist/admin/index.d.ts +0 -66
  363. package/dist/admin/index.d.ts.map +0 -1
  364. package/dist/admin/index.js +0 -144
  365. package/dist/admin/index.js.map +0 -1
  366. package/dist/admin/permissions.d.ts +0 -92
  367. package/dist/admin/permissions.d.ts.map +0 -1
  368. package/dist/admin/permissions.js +0 -201
  369. package/dist/admin/permissions.js.map +0 -1
  370. package/dist/admin/server/admin-invite.d.ts +0 -122
  371. package/dist/admin/server/admin-invite.d.ts.map +0 -1
  372. package/dist/admin/server/admin-invite.js +0 -235
  373. package/dist/admin/server/admin-invite.js.map +0 -1
  374. package/dist/admin/server/admin-password-reset.d.ts +0 -87
  375. package/dist/admin/server/admin-password-reset.d.ts.map +0 -1
  376. package/dist/admin/server/admin-password-reset.js +0 -220
  377. package/dist/admin/server/admin-password-reset.js.map +0 -1
  378. package/dist/admin/server/admin-self-service.d.ts +0 -86
  379. package/dist/admin/server/admin-self-service.d.ts.map +0 -1
  380. package/dist/admin/server/admin-self-service.js +0 -188
  381. package/dist/admin/server/admin-self-service.js.map +0 -1
  382. package/dist/admin/server/admin-service.d.ts +0 -130
  383. package/dist/admin/server/admin-service.d.ts.map +0 -1
  384. package/dist/admin/server/admin-service.js +0 -278
  385. package/dist/admin/server/admin-service.js.map +0 -1
  386. package/dist/admin/server/admin-session.d.ts +0 -173
  387. package/dist/admin/server/admin-session.d.ts.map +0 -1
  388. package/dist/admin/server/admin-session.js +0 -272
  389. package/dist/admin/server/admin-session.js.map +0 -1
  390. package/dist/admin/server/index.d.ts +0 -17
  391. package/dist/admin/server/index.d.ts.map +0 -1
  392. package/dist/admin/server/index.js +0 -39
  393. package/dist/admin/server/index.js.map +0 -1
  394. package/dist/admin/server/user-management.d.ts +0 -223
  395. package/dist/admin/server/user-management.d.ts.map +0 -1
  396. package/dist/admin/server/user-management.js +0 -846
  397. package/dist/admin/server/user-management.js.map +0 -1
  398. package/dist/admin/types.d.ts +0 -1172
  399. package/dist/admin/types.d.ts.map +0 -1
  400. package/dist/admin/types.js +0 -10
  401. package/dist/admin/types.js.map +0 -1
  402. package/dist/auth/api/auth.d.ts +0 -54
  403. package/dist/auth/api/auth.d.ts.map +0 -1
  404. package/dist/auth/api/auth.js +0 -59
  405. package/dist/auth/api/auth.js.map +0 -1
  406. package/dist/auth/api/forgot-password.d.ts +0 -41
  407. package/dist/auth/api/forgot-password.d.ts.map +0 -1
  408. package/dist/auth/api/forgot-password.js +0 -65
  409. package/dist/auth/api/forgot-password.js.map +0 -1
  410. package/dist/auth/api/index.d.ts +0 -36
  411. package/dist/auth/api/index.d.ts.map +0 -1
  412. package/dist/auth/api/index.js +0 -44
  413. package/dist/auth/api/index.js.map +0 -1
  414. package/dist/auth/api/register.d.ts +0 -41
  415. package/dist/auth/api/register.d.ts.map +0 -1
  416. package/dist/auth/api/register.js +0 -94
  417. package/dist/auth/api/register.js.map +0 -1
  418. package/dist/auth/api/request-refund.d.ts +0 -38
  419. package/dist/auth/api/request-refund.d.ts.map +0 -1
  420. package/dist/auth/api/request-refund.js +0 -142
  421. package/dist/auth/api/request-refund.js.map +0 -1
  422. package/dist/auth/api/request-return.d.ts +0 -39
  423. package/dist/auth/api/request-return.d.ts.map +0 -1
  424. package/dist/auth/api/request-return.js +0 -109
  425. package/dist/auth/api/request-return.js.map +0 -1
  426. package/dist/auth/api/resend-verification.d.ts +0 -41
  427. package/dist/auth/api/resend-verification.d.ts.map +0 -1
  428. package/dist/auth/api/resend-verification.js +0 -68
  429. package/dist/auth/api/resend-verification.js.map +0 -1
  430. package/dist/auth/api/reset-password.d.ts +0 -67
  431. package/dist/auth/api/reset-password.d.ts.map +0 -1
  432. package/dist/auth/api/reset-password.js +0 -106
  433. package/dist/auth/api/reset-password.js.map +0 -1
  434. package/dist/auth/api/verify-email.d.ts +0 -47
  435. package/dist/auth/api/verify-email.d.ts.map +0 -1
  436. package/dist/auth/api/verify-email.js +0 -90
  437. package/dist/auth/api/verify-email.js.map +0 -1
  438. package/dist/auth/components/AuthGuard.d.ts +0 -52
  439. package/dist/auth/components/AuthGuard.d.ts.map +0 -1
  440. package/dist/auth/components/AuthGuard.js +0 -109
  441. package/dist/auth/components/AuthGuard.js.map +0 -1
  442. package/dist/auth/components/ForgotPasswordForm.d.ts +0 -15
  443. package/dist/auth/components/ForgotPasswordForm.d.ts.map +0 -1
  444. package/dist/auth/components/ForgotPasswordForm.js +0 -43
  445. package/dist/auth/components/ForgotPasswordForm.js.map +0 -1
  446. package/dist/auth/components/Label.d.ts +0 -19
  447. package/dist/auth/components/Label.d.ts.map +0 -1
  448. package/dist/auth/components/Label.js +0 -18
  449. package/dist/auth/components/Label.js.map +0 -1
  450. package/dist/auth/components/ResetPasswordForm.d.ts +0 -18
  451. package/dist/auth/components/ResetPasswordForm.d.ts.map +0 -1
  452. package/dist/auth/components/ResetPasswordForm.js +0 -87
  453. package/dist/auth/components/ResetPasswordForm.js.map +0 -1
  454. package/dist/auth/components/SignInForm.d.ts +0 -21
  455. package/dist/auth/components/SignInForm.d.ts.map +0 -1
  456. package/dist/auth/components/SignInForm.js +0 -61
  457. package/dist/auth/components/SignInForm.js.map +0 -1
  458. package/dist/auth/components/SignUpForm.d.ts +0 -18
  459. package/dist/auth/components/SignUpForm.d.ts.map +0 -1
  460. package/dist/auth/components/SignUpForm.js +0 -78
  461. package/dist/auth/components/SignUpForm.js.map +0 -1
  462. package/dist/auth/components/UserMenu.d.ts +0 -18
  463. package/dist/auth/components/UserMenu.d.ts.map +0 -1
  464. package/dist/auth/components/UserMenu.js +0 -73
  465. package/dist/auth/components/UserMenu.js.map +0 -1
  466. package/dist/auth/components/VerifyEmailNotice.d.ts +0 -20
  467. package/dist/auth/components/VerifyEmailNotice.d.ts.map +0 -1
  468. package/dist/auth/components/VerifyEmailNotice.js +0 -57
  469. package/dist/auth/components/VerifyEmailNotice.js.map +0 -1
  470. package/dist/auth/components/index.d.ts +0 -15
  471. package/dist/auth/components/index.d.ts.map +0 -1
  472. package/dist/auth/components/index.js +0 -14
  473. package/dist/auth/components/index.js.map +0 -1
  474. package/dist/auth/config.d.ts +0 -59
  475. package/dist/auth/config.d.ts.map +0 -1
  476. package/dist/auth/config.js +0 -255
  477. package/dist/auth/config.js.map +0 -1
  478. package/dist/auth/hooks/index.d.ts +0 -7
  479. package/dist/auth/hooks/index.d.ts.map +0 -1
  480. package/dist/auth/hooks/index.js +0 -7
  481. package/dist/auth/hooks/index.js.map +0 -1
  482. package/dist/auth/hooks/useAuth.d.ts +0 -30
  483. package/dist/auth/hooks/useAuth.d.ts.map +0 -1
  484. package/dist/auth/hooks/useAuth.js +0 -261
  485. package/dist/auth/hooks/useAuth.js.map +0 -1
  486. package/dist/auth/index.d.ts +0 -55
  487. package/dist/auth/index.d.ts.map +0 -1
  488. package/dist/auth/index.js +0 -67
  489. package/dist/auth/index.js.map +0 -1
  490. package/dist/auth/server/customer-service.d.ts +0 -140
  491. package/dist/auth/server/customer-service.d.ts.map +0 -1
  492. package/dist/auth/server/customer-service.js +0 -266
  493. package/dist/auth/server/customer-service.js.map +0 -1
  494. package/dist/auth/server/customer-session.d.ts +0 -81
  495. package/dist/auth/server/customer-session.d.ts.map +0 -1
  496. package/dist/auth/server/customer-session.js +0 -115
  497. package/dist/auth/server/customer-session.js.map +0 -1
  498. package/dist/auth/server/email-sender.d.ts +0 -64
  499. package/dist/auth/server/email-sender.d.ts.map +0 -1
  500. package/dist/auth/server/email-sender.js +0 -106
  501. package/dist/auth/server/email-sender.js.map +0 -1
  502. package/dist/auth/server/index.d.ts +0 -15
  503. package/dist/auth/server/index.d.ts.map +0 -1
  504. package/dist/auth/server/index.js +0 -19
  505. package/dist/auth/server/index.js.map +0 -1
  506. package/dist/auth/server/password-reset-service.d.ts +0 -87
  507. package/dist/auth/server/password-reset-service.d.ts.map +0 -1
  508. package/dist/auth/server/password-reset-service.js +0 -198
  509. package/dist/auth/server/password-reset-service.js.map +0 -1
  510. package/dist/auth/server/password.d.ts +0 -58
  511. package/dist/auth/server/password.d.ts.map +0 -1
  512. package/dist/auth/server/password.js +0 -85
  513. package/dist/auth/server/password.js.map +0 -1
  514. package/dist/auth/server/verification-service.d.ts +0 -88
  515. package/dist/auth/server/verification-service.d.ts.map +0 -1
  516. package/dist/auth/server/verification-service.js +0 -224
  517. package/dist/auth/server/verification-service.js.map +0 -1
  518. package/dist/auth/types.d.ts +0 -311
  519. package/dist/auth/types.d.ts.map +0 -1
  520. package/dist/auth/types.js +0 -7
  521. package/dist/auth/types.js.map +0 -1
  522. package/dist/cart/CartProvider.d.ts +0 -65
  523. package/dist/cart/CartProvider.d.ts.map +0 -1
  524. package/dist/cart/CartProvider.js +0 -100
  525. package/dist/cart/CartProvider.js.map +0 -1
  526. package/dist/cart/components/AddToCartButton.d.ts +0 -77
  527. package/dist/cart/components/AddToCartButton.d.ts.map +0 -1
  528. package/dist/cart/components/AddToCartButton.js +0 -122
  529. package/dist/cart/components/AddToCartButton.js.map +0 -1
  530. package/dist/cart/components/CartDrawer.d.ts +0 -71
  531. package/dist/cart/components/CartDrawer.d.ts.map +0 -1
  532. package/dist/cart/components/CartDrawer.js +0 -117
  533. package/dist/cart/components/CartDrawer.js.map +0 -1
  534. package/dist/cart/components/CartIcon.d.ts +0 -36
  535. package/dist/cart/components/CartIcon.d.ts.map +0 -1
  536. package/dist/cart/components/CartIcon.js +0 -68
  537. package/dist/cart/components/CartIcon.js.map +0 -1
  538. package/dist/cart/components/CartItem.d.ts +0 -52
  539. package/dist/cart/components/CartItem.d.ts.map +0 -1
  540. package/dist/cart/components/CartItem.js +0 -55
  541. package/dist/cart/components/CartItem.js.map +0 -1
  542. package/dist/cart/components/CartSummary.d.ts +0 -43
  543. package/dist/cart/components/CartSummary.d.ts.map +0 -1
  544. package/dist/cart/components/CartSummary.js +0 -60
  545. package/dist/cart/components/CartSummary.js.map +0 -1
  546. package/dist/cart/components/QuantitySelector.d.ts +0 -39
  547. package/dist/cart/components/QuantitySelector.d.ts.map +0 -1
  548. package/dist/cart/components/QuantitySelector.js +0 -85
  549. package/dist/cart/components/QuantitySelector.js.map +0 -1
  550. package/dist/cart/components/index.d.ts +0 -18
  551. package/dist/cart/components/index.d.ts.map +0 -1
  552. package/dist/cart/components/index.js +0 -12
  553. package/dist/cart/components/index.js.map +0 -1
  554. package/dist/cart/index.d.ts +0 -109
  555. package/dist/cart/index.d.ts.map +0 -1
  556. package/dist/cart/index.js +0 -115
  557. package/dist/cart/index.js.map +0 -1
  558. package/dist/cart/store.d.ts +0 -150
  559. package/dist/cart/store.d.ts.map +0 -1
  560. package/dist/cart/store.js +0 -315
  561. package/dist/cart/store.js.map +0 -1
  562. package/dist/checkout/api/checkout.js +0 -112
  563. package/dist/checkout/api/checkout.js.map +0 -1
  564. package/dist/checkout/api/countries.d.ts +0 -17
  565. package/dist/checkout/api/countries.d.ts.map +0 -1
  566. package/dist/checkout/api/countries.js +0 -38
  567. package/dist/checkout/api/countries.js.map +0 -1
  568. package/dist/checkout/api/index.js +0 -11
  569. package/dist/checkout/api/index.js.map +0 -1
  570. package/dist/checkout/api/payment-status.d.ts +0 -45
  571. package/dist/checkout/api/payment-status.d.ts.map +0 -1
  572. package/dist/checkout/api/payment-status.js +0 -104
  573. package/dist/checkout/api/payment-status.js.map +0 -1
  574. package/dist/checkout/api/shipping.d.ts +0 -34
  575. package/dist/checkout/api/shipping.d.ts.map +0 -1
  576. package/dist/checkout/api/shipping.js +0 -247
  577. package/dist/checkout/api/shipping.js.map +0 -1
  578. package/dist/checkout/api/webhook.js +0 -55
  579. package/dist/checkout/api/webhook.js.map +0 -1
  580. package/dist/checkout/components/CheckoutButton.d.ts +0 -55
  581. package/dist/checkout/components/CheckoutButton.d.ts.map +0 -1
  582. package/dist/checkout/components/CheckoutButton.js +0 -132
  583. package/dist/checkout/components/CheckoutButton.js.map +0 -1
  584. package/dist/checkout/components/CheckoutFlow.d.ts +0 -53
  585. package/dist/checkout/components/CheckoutFlow.d.ts.map +0 -1
  586. package/dist/checkout/components/CheckoutFlow.js +0 -286
  587. package/dist/checkout/components/CheckoutFlow.js.map +0 -1
  588. package/dist/checkout/components/CheckoutSuccess.d.ts +0 -29
  589. package/dist/checkout/components/CheckoutSuccess.d.ts.map +0 -1
  590. package/dist/checkout/components/CheckoutSuccess.js +0 -49
  591. package/dist/checkout/components/CheckoutSuccess.js.map +0 -1
  592. package/dist/checkout/components/OrderSummary.d.ts +0 -37
  593. package/dist/checkout/components/OrderSummary.d.ts.map +0 -1
  594. package/dist/checkout/components/OrderSummary.js +0 -71
  595. package/dist/checkout/components/OrderSummary.js.map +0 -1
  596. package/dist/checkout/components/ShippingForm.d.ts +0 -30
  597. package/dist/checkout/components/ShippingForm.d.ts.map +0 -1
  598. package/dist/checkout/components/ShippingForm.js +0 -184
  599. package/dist/checkout/components/ShippingForm.js.map +0 -1
  600. package/dist/checkout/components/ShippingOptions.d.ts +0 -51
  601. package/dist/checkout/components/ShippingOptions.d.ts.map +0 -1
  602. package/dist/checkout/components/ShippingOptions.js +0 -93
  603. package/dist/checkout/components/ShippingOptions.js.map +0 -1
  604. package/dist/checkout/components/index.d.ts +0 -12
  605. package/dist/checkout/components/index.d.ts.map +0 -1
  606. package/dist/checkout/components/index.js +0 -12
  607. package/dist/checkout/components/index.js.map +0 -1
  608. package/dist/checkout/constants.d.ts +0 -244
  609. package/dist/checkout/constants.d.ts.map +0 -1
  610. package/dist/checkout/constants.js +0 -119
  611. package/dist/checkout/constants.js.map +0 -1
  612. package/dist/checkout/hooks/index.d.ts +0 -9
  613. package/dist/checkout/hooks/index.d.ts.map +0 -1
  614. package/dist/checkout/hooks/index.js +0 -8
  615. package/dist/checkout/hooks/index.js.map +0 -1
  616. package/dist/checkout/hooks/useCheckout.d.ts +0 -61
  617. package/dist/checkout/hooks/useCheckout.d.ts.map +0 -1
  618. package/dist/checkout/hooks/useCheckout.js +0 -172
  619. package/dist/checkout/hooks/useCheckout.js.map +0 -1
  620. package/dist/checkout/hooks/usePaymentStatus.d.ts +0 -42
  621. package/dist/checkout/hooks/usePaymentStatus.d.ts.map +0 -1
  622. package/dist/checkout/hooks/usePaymentStatus.js +0 -71
  623. package/dist/checkout/hooks/usePaymentStatus.js.map +0 -1
  624. package/dist/checkout/index.js +0 -135
  625. package/dist/checkout/index.js.map +0 -1
  626. package/dist/checkout/server/coupons.d.ts +0 -91
  627. package/dist/checkout/server/coupons.d.ts.map +0 -1
  628. package/dist/checkout/server/coupons.js +0 -192
  629. package/dist/checkout/server/coupons.js.map +0 -1
  630. package/dist/checkout/server/index.js +0 -10
  631. package/dist/checkout/server/index.js.map +0 -1
  632. package/dist/checkout/stripe/client.d.ts +0 -74
  633. package/dist/checkout/stripe/client.d.ts.map +0 -1
  634. package/dist/checkout/stripe/client.js +0 -175
  635. package/dist/checkout/stripe/client.js.map +0 -1
  636. package/dist/checkout/stripe/index.d.ts +0 -7
  637. package/dist/checkout/stripe/index.d.ts.map +0 -1
  638. package/dist/checkout/stripe/index.js +0 -7
  639. package/dist/checkout/stripe/index.js.map +0 -1
  640. package/dist/checkout/types.d.ts +0 -489
  641. package/dist/checkout/types.d.ts.map +0 -1
  642. package/dist/checkout/types.js +0 -8
  643. package/dist/checkout/types.js.map +0 -1
  644. package/dist/core/StoreSettingsProvider.d.ts +0 -107
  645. package/dist/core/StoreSettingsProvider.d.ts.map +0 -1
  646. package/dist/core/StoreSettingsProvider.js +0 -200
  647. package/dist/core/StoreSettingsProvider.js.map +0 -1
  648. package/dist/core/api/index.d.ts +0 -7
  649. package/dist/core/api/index.d.ts.map +0 -1
  650. package/dist/core/api/index.js +0 -7
  651. package/dist/core/api/index.js.map +0 -1
  652. package/dist/core/api/settings.d.ts +0 -42
  653. package/dist/core/api/settings.d.ts.map +0 -1
  654. package/dist/core/api/settings.js +0 -74
  655. package/dist/core/api/settings.js.map +0 -1
  656. package/dist/core/config.d.ts +0 -296
  657. package/dist/core/config.d.ts.map +0 -1
  658. package/dist/core/config.js +0 -117
  659. package/dist/core/config.js.map +0 -1
  660. package/dist/core/cookie-consent/CookieBanner.d.ts +0 -2
  661. package/dist/core/cookie-consent/CookieBanner.d.ts.map +0 -1
  662. package/dist/core/cookie-consent/CookieBanner.js +0 -243
  663. package/dist/core/cookie-consent/CookieBanner.js.map +0 -1
  664. package/dist/core/cookie-consent/CookieConsentProvider.d.ts +0 -53
  665. package/dist/core/cookie-consent/CookieConsentProvider.d.ts.map +0 -1
  666. package/dist/core/cookie-consent/CookieConsentProvider.js +0 -162
  667. package/dist/core/cookie-consent/CookieConsentProvider.js.map +0 -1
  668. package/dist/core/cookie-consent/CookiePreferencesLink.d.ts +0 -15
  669. package/dist/core/cookie-consent/CookiePreferencesLink.d.ts.map +0 -1
  670. package/dist/core/cookie-consent/CookiePreferencesLink.js +0 -12
  671. package/dist/core/cookie-consent/CookiePreferencesLink.js.map +0 -1
  672. package/dist/core/cookie-consent/index.d.ts +0 -17
  673. package/dist/core/cookie-consent/index.d.ts.map +0 -1
  674. package/dist/core/cookie-consent/index.js +0 -16
  675. package/dist/core/cookie-consent/index.js.map +0 -1
  676. package/dist/core/cookie-consent/types.d.ts +0 -31
  677. package/dist/core/cookie-consent/types.d.ts.map +0 -1
  678. package/dist/core/cookie-consent/types.js +0 -10
  679. package/dist/core/cookie-consent/types.js.map +0 -1
  680. package/dist/core/cookie-consent/useCookieConsent.d.ts +0 -14
  681. package/dist/core/cookie-consent/useCookieConsent.d.ts.map +0 -1
  682. package/dist/core/cookie-consent/useCookieConsent.js +0 -25
  683. package/dist/core/cookie-consent/useCookieConsent.js.map +0 -1
  684. package/dist/core/db/client.d.ts +0 -39
  685. package/dist/core/db/client.d.ts.map +0 -1
  686. package/dist/core/db/client.js +0 -86
  687. package/dist/core/db/client.js.map +0 -1
  688. package/dist/core/db/index.d.ts +0 -11
  689. package/dist/core/db/index.d.ts.map +0 -1
  690. package/dist/core/db/index.js +0 -36
  691. package/dist/core/db/index.js.map +0 -1
  692. package/dist/core/db/queries.d.ts +0 -1427
  693. package/dist/core/db/queries.d.ts.map +0 -1
  694. package/dist/core/db/queries.js +0 -1932
  695. package/dist/core/db/queries.js.map +0 -1
  696. package/dist/core/db/schema.d.ts +0 -3462
  697. package/dist/core/db/schema.d.ts.map +0 -1
  698. package/dist/core/db/schema.js +0 -494
  699. package/dist/core/db/schema.js.map +0 -1
  700. package/dist/core/index.d.ts +0 -22
  701. package/dist/core/index.d.ts.map +0 -1
  702. package/dist/core/index.js +0 -43
  703. package/dist/core/index.js.map +0 -1
  704. package/dist/core/server/index.d.ts +0 -18
  705. package/dist/core/server/index.d.ts.map +0 -1
  706. package/dist/core/server/index.js +0 -47
  707. package/dist/core/server/index.js.map +0 -1
  708. package/dist/core/types.d.ts +0 -283
  709. package/dist/core/types.d.ts.map +0 -1
  710. package/dist/core/types.js +0 -8
  711. package/dist/core/types.js.map +0 -1
  712. package/dist/core/utils.d.ts +0 -167
  713. package/dist/core/utils.d.ts.map +0 -1
  714. package/dist/core/utils.js +0 -351
  715. package/dist/core/utils.js.map +0 -1
  716. package/dist/emails/config.d.ts +0 -69
  717. package/dist/emails/config.d.ts.map +0 -1
  718. package/dist/emails/config.js +0 -147
  719. package/dist/emails/config.js.map +0 -1
  720. package/dist/emails/index.d.ts +0 -85
  721. package/dist/emails/index.d.ts.map +0 -1
  722. package/dist/emails/index.js +0 -110
  723. package/dist/emails/index.js.map +0 -1
  724. package/dist/emails/send/admin-auth.d.ts +0 -94
  725. package/dist/emails/send/admin-auth.d.ts.map +0 -1
  726. package/dist/emails/send/admin-auth.js +0 -118
  727. package/dist/emails/send/admin-auth.js.map +0 -1
  728. package/dist/emails/send/auth.d.ts +0 -91
  729. package/dist/emails/send/auth.d.ts.map +0 -1
  730. package/dist/emails/send/auth.js +0 -130
  731. package/dist/emails/send/auth.js.map +0 -1
  732. package/dist/emails/send/index.d.ts +0 -12
  733. package/dist/emails/send/index.d.ts.map +0 -1
  734. package/dist/emails/send/index.js +0 -18
  735. package/dist/emails/send/index.js.map +0 -1
  736. package/dist/emails/send/orders.d.ts +0 -186
  737. package/dist/emails/send/orders.d.ts.map +0 -1
  738. package/dist/emails/send/orders.js +0 -258
  739. package/dist/emails/send/orders.js.map +0 -1
  740. package/dist/emails/sender.d.ts +0 -72
  741. package/dist/emails/sender.d.ts.map +0 -1
  742. package/dist/emails/sender.js +0 -116
  743. package/dist/emails/sender.js.map +0 -1
  744. package/dist/emails/templates/admin-invite.d.ts +0 -40
  745. package/dist/emails/templates/admin-invite.d.ts.map +0 -1
  746. package/dist/emails/templates/admin-invite.js +0 -62
  747. package/dist/emails/templates/admin-invite.js.map +0 -1
  748. package/dist/emails/templates/base.d.ts +0 -109
  749. package/dist/emails/templates/base.d.ts.map +0 -1
  750. package/dist/emails/templates/base.js +0 -334
  751. package/dist/emails/templates/base.js.map +0 -1
  752. package/dist/emails/templates/email-verification.d.ts +0 -28
  753. package/dist/emails/templates/email-verification.d.ts.map +0 -1
  754. package/dist/emails/templates/email-verification.js +0 -52
  755. package/dist/emails/templates/email-verification.js.map +0 -1
  756. package/dist/emails/templates/index.d.ts +0 -16
  757. package/dist/emails/templates/index.d.ts.map +0 -1
  758. package/dist/emails/templates/index.js +0 -28
  759. package/dist/emails/templates/index.js.map +0 -1
  760. package/dist/emails/templates/order-cancelled.d.ts +0 -30
  761. package/dist/emails/templates/order-cancelled.d.ts.map +0 -1
  762. package/dist/emails/templates/order-cancelled.js +0 -83
  763. package/dist/emails/templates/order-cancelled.js.map +0 -1
  764. package/dist/emails/templates/order-confirmation.d.ts +0 -36
  765. package/dist/emails/templates/order-confirmation.d.ts.map +0 -1
  766. package/dist/emails/templates/order-confirmation.js +0 -174
  767. package/dist/emails/templates/order-confirmation.js.map +0 -1
  768. package/dist/emails/templates/order-delivered.d.ts +0 -31
  769. package/dist/emails/templates/order-delivered.d.ts.map +0 -1
  770. package/dist/emails/templates/order-delivered.js +0 -100
  771. package/dist/emails/templates/order-delivered.js.map +0 -1
  772. package/dist/emails/templates/order-shipped.d.ts +0 -32
  773. package/dist/emails/templates/order-shipped.d.ts.map +0 -1
  774. package/dist/emails/templates/order-shipped.js +0 -83
  775. package/dist/emails/templates/order-shipped.js.map +0 -1
  776. package/dist/emails/templates/password-reset.d.ts +0 -27
  777. package/dist/emails/templates/password-reset.d.ts.map +0 -1
  778. package/dist/emails/templates/password-reset.js +0 -51
  779. package/dist/emails/templates/password-reset.js.map +0 -1
  780. package/dist/emails/templates/refund-processed.d.ts +0 -32
  781. package/dist/emails/templates/refund-processed.d.ts.map +0 -1
  782. package/dist/emails/templates/refund-processed.js +0 -92
  783. package/dist/emails/templates/refund-processed.js.map +0 -1
  784. package/dist/emails/templates/welcome.d.ts +0 -27
  785. package/dist/emails/templates/welcome.d.ts.map +0 -1
  786. package/dist/emails/templates/welcome.js +0 -52
  787. package/dist/emails/templates/welcome.js.map +0 -1
  788. package/dist/emails/types.d.ts +0 -229
  789. package/dist/emails/types.d.ts.map +0 -1
  790. package/dist/emails/types.js +0 -7
  791. package/dist/emails/types.js.map +0 -1
  792. package/dist/emails/utils.d.ts +0 -94
  793. package/dist/emails/utils.d.ts.map +0 -1
  794. package/dist/emails/utils.js +0 -218
  795. package/dist/emails/utils.js.map +0 -1
  796. package/dist/index.js +0 -73
  797. package/dist/index.js.map +0 -1
  798. package/dist/media/api/delete.d.ts +0 -43
  799. package/dist/media/api/delete.d.ts.map +0 -1
  800. package/dist/media/api/delete.js +0 -124
  801. package/dist/media/api/delete.js.map +0 -1
  802. package/dist/media/api/index.d.ts +0 -17
  803. package/dist/media/api/index.d.ts.map +0 -1
  804. package/dist/media/api/index.js +0 -17
  805. package/dist/media/api/index.js.map +0 -1
  806. package/dist/media/api/presign.d.ts +0 -38
  807. package/dist/media/api/presign.d.ts.map +0 -1
  808. package/dist/media/api/presign.js +0 -130
  809. package/dist/media/api/presign.js.map +0 -1
  810. package/dist/media/components/DropZone.d.ts +0 -18
  811. package/dist/media/components/DropZone.d.ts.map +0 -1
  812. package/dist/media/components/DropZone.js +0 -107
  813. package/dist/media/components/DropZone.js.map +0 -1
  814. package/dist/media/components/ImageGalleryUpload.d.ts +0 -21
  815. package/dist/media/components/ImageGalleryUpload.d.ts.map +0 -1
  816. package/dist/media/components/ImageGalleryUpload.js +0 -195
  817. package/dist/media/components/ImageGalleryUpload.js.map +0 -1
  818. package/dist/media/components/ImageUpload.d.ts +0 -17
  819. package/dist/media/components/ImageUpload.d.ts.map +0 -1
  820. package/dist/media/components/ImageUpload.js +0 -89
  821. package/dist/media/components/ImageUpload.js.map +0 -1
  822. package/dist/media/components/index.d.ts +0 -10
  823. package/dist/media/components/index.d.ts.map +0 -1
  824. package/dist/media/components/index.js +0 -9
  825. package/dist/media/components/index.js.map +0 -1
  826. package/dist/media/config.d.ts +0 -83
  827. package/dist/media/config.d.ts.map +0 -1
  828. package/dist/media/config.js +0 -189
  829. package/dist/media/config.js.map +0 -1
  830. package/dist/media/hooks/index.d.ts +0 -8
  831. package/dist/media/hooks/index.d.ts.map +0 -1
  832. package/dist/media/hooks/index.js +0 -7
  833. package/dist/media/hooks/index.js.map +0 -1
  834. package/dist/media/hooks/useUpload.d.ts +0 -32
  835. package/dist/media/hooks/useUpload.d.ts.map +0 -1
  836. package/dist/media/hooks/useUpload.js +0 -260
  837. package/dist/media/hooks/useUpload.js.map +0 -1
  838. package/dist/media/index.d.ts +0 -57
  839. package/dist/media/index.d.ts.map +0 -1
  840. package/dist/media/index.js +0 -68
  841. package/dist/media/index.js.map +0 -1
  842. package/dist/media/server/delete.d.ts +0 -59
  843. package/dist/media/server/delete.d.ts.map +0 -1
  844. package/dist/media/server/delete.js +0 -176
  845. package/dist/media/server/delete.js.map +0 -1
  846. package/dist/media/server/index.d.ts +0 -10
  847. package/dist/media/server/index.d.ts.map +0 -1
  848. package/dist/media/server/index.js +0 -13
  849. package/dist/media/server/index.js.map +0 -1
  850. package/dist/media/server/presign.d.ts +0 -57
  851. package/dist/media/server/presign.d.ts.map +0 -1
  852. package/dist/media/server/presign.js +0 -112
  853. package/dist/media/server/presign.js.map +0 -1
  854. package/dist/media/server/r2-client.d.ts +0 -30
  855. package/dist/media/server/r2-client.d.ts.map +0 -1
  856. package/dist/media/server/r2-client.js +0 -76
  857. package/dist/media/server/r2-client.js.map +0 -1
  858. package/dist/media/types.d.ts +0 -317
  859. package/dist/media/types.d.ts.map +0 -1
  860. package/dist/media/types.js +0 -95
  861. package/dist/media/types.js.map +0 -1
  862. package/dist/products/api/categories.d.ts +0 -29
  863. package/dist/products/api/categories.d.ts.map +0 -1
  864. package/dist/products/api/categories.js +0 -46
  865. package/dist/products/api/categories.js.map +0 -1
  866. package/dist/products/api/index.d.ts +0 -24
  867. package/dist/products/api/index.d.ts.map +0 -1
  868. package/dist/products/api/index.js +0 -24
  869. package/dist/products/api/index.js.map +0 -1
  870. package/dist/products/api/product.d.ts +0 -36
  871. package/dist/products/api/product.d.ts.map +0 -1
  872. package/dist/products/api/product.js +0 -67
  873. package/dist/products/api/product.js.map +0 -1
  874. package/dist/products/api/products.d.ts +0 -41
  875. package/dist/products/api/products.d.ts.map +0 -1
  876. package/dist/products/api/products.js +0 -99
  877. package/dist/products/api/products.js.map +0 -1
  878. package/dist/products/components/CategoryNav.d.ts +0 -51
  879. package/dist/products/components/CategoryNav.d.ts.map +0 -1
  880. package/dist/products/components/CategoryNav.js +0 -110
  881. package/dist/products/components/CategoryNav.js.map +0 -1
  882. package/dist/products/components/ProductBreadcrumb.d.ts +0 -52
  883. package/dist/products/components/ProductBreadcrumb.d.ts.map +0 -1
  884. package/dist/products/components/ProductBreadcrumb.js +0 -73
  885. package/dist/products/components/ProductBreadcrumb.js.map +0 -1
  886. package/dist/products/components/ProductCard.d.ts +0 -54
  887. package/dist/products/components/ProductCard.d.ts.map +0 -1
  888. package/dist/products/components/ProductCard.js +0 -72
  889. package/dist/products/components/ProductCard.js.map +0 -1
  890. package/dist/products/components/ProductDetails.d.ts +0 -63
  891. package/dist/products/components/ProductDetails.d.ts.map +0 -1
  892. package/dist/products/components/ProductDetails.js +0 -137
  893. package/dist/products/components/ProductDetails.js.map +0 -1
  894. package/dist/products/components/ProductFilters.d.ts +0 -70
  895. package/dist/products/components/ProductFilters.d.ts.map +0 -1
  896. package/dist/products/components/ProductFilters.js +0 -125
  897. package/dist/products/components/ProductFilters.js.map +0 -1
  898. package/dist/products/components/ProductGallery.d.ts +0 -42
  899. package/dist/products/components/ProductGallery.d.ts.map +0 -1
  900. package/dist/products/components/ProductGallery.js +0 -103
  901. package/dist/products/components/ProductGallery.js.map +0 -1
  902. package/dist/products/components/ProductGrid.d.ts +0 -50
  903. package/dist/products/components/ProductGrid.d.ts.map +0 -1
  904. package/dist/products/components/ProductGrid.js +0 -81
  905. package/dist/products/components/ProductGrid.js.map +0 -1
  906. package/dist/products/components/ProductSearch.d.ts +0 -43
  907. package/dist/products/components/ProductSearch.d.ts.map +0 -1
  908. package/dist/products/components/ProductSearch.js +0 -97
  909. package/dist/products/components/ProductSearch.js.map +0 -1
  910. package/dist/products/components/ProductSort.d.ts +0 -43
  911. package/dist/products/components/ProductSort.d.ts.map +0 -1
  912. package/dist/products/components/ProductSort.js +0 -59
  913. package/dist/products/components/ProductSort.js.map +0 -1
  914. package/dist/products/components/VariantSelector.d.ts +0 -43
  915. package/dist/products/components/VariantSelector.d.ts.map +0 -1
  916. package/dist/products/components/VariantSelector.js +0 -147
  917. package/dist/products/components/VariantSelector.js.map +0 -1
  918. package/dist/products/components/index.d.ts +0 -26
  919. package/dist/products/components/index.d.ts.map +0 -1
  920. package/dist/products/components/index.js +0 -19
  921. package/dist/products/components/index.js.map +0 -1
  922. package/dist/products/hooks/index.d.ts +0 -14
  923. package/dist/products/hooks/index.d.ts.map +0 -1
  924. package/dist/products/hooks/index.js +0 -10
  925. package/dist/products/hooks/index.js.map +0 -1
  926. package/dist/products/hooks/useCategories.d.ts +0 -56
  927. package/dist/products/hooks/useCategories.d.ts.map +0 -1
  928. package/dist/products/hooks/useCategories.js +0 -126
  929. package/dist/products/hooks/useCategories.js.map +0 -1
  930. package/dist/products/hooks/useProduct.d.ts +0 -44
  931. package/dist/products/hooks/useProduct.d.ts.map +0 -1
  932. package/dist/products/hooks/useProduct.js +0 -87
  933. package/dist/products/hooks/useProduct.js.map +0 -1
  934. package/dist/products/hooks/useProductAttributes.d.ts +0 -59
  935. package/dist/products/hooks/useProductAttributes.d.ts.map +0 -1
  936. package/dist/products/hooks/useProductAttributes.js +0 -146
  937. package/dist/products/hooks/useProductAttributes.js.map +0 -1
  938. package/dist/products/hooks/useProducts.d.ts +0 -67
  939. package/dist/products/hooks/useProducts.d.ts.map +0 -1
  940. package/dist/products/hooks/useProducts.js +0 -131
  941. package/dist/products/hooks/useProducts.js.map +0 -1
  942. package/dist/products/index.d.ts +0 -94
  943. package/dist/products/index.d.ts.map +0 -1
  944. package/dist/products/index.js +0 -106
  945. package/dist/products/index.js.map +0 -1
  946. package/dist/shipping/index.d.ts +0 -8
  947. package/dist/shipping/index.d.ts.map +0 -1
  948. package/dist/shipping/index.js +0 -8
  949. package/dist/shipping/index.js.map +0 -1
  950. package/dist/shipping/shippo.d.ts +0 -85
  951. package/dist/shipping/shippo.d.ts.map +0 -1
  952. package/dist/shipping/shippo.js +0 -298
  953. package/dist/shipping/shippo.js.map +0 -1
  954. package/dist/theme/ThemeProvider.d.ts +0 -70
  955. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  956. package/dist/theme/ThemeProvider.js +0 -75
  957. package/dist/theme/ThemeProvider.js.map +0 -1
  958. package/dist/theme/colors.d.ts +0 -148
  959. package/dist/theme/colors.d.ts.map +0 -1
  960. package/dist/theme/colors.js +0 -214
  961. package/dist/theme/colors.js.map +0 -1
  962. package/dist/theme/defaults.d.ts +0 -212
  963. package/dist/theme/defaults.d.ts.map +0 -1
  964. package/dist/theme/defaults.js +0 -275
  965. package/dist/theme/defaults.js.map +0 -1
  966. package/dist/theme/fonts.d.ts +0 -59
  967. package/dist/theme/fonts.d.ts.map +0 -1
  968. package/dist/theme/fonts.js +0 -196
  969. package/dist/theme/fonts.js.map +0 -1
  970. package/dist/theme/generator.d.ts +0 -50
  971. package/dist/theme/generator.d.ts.map +0 -1
  972. package/dist/theme/generator.js +0 -316
  973. package/dist/theme/generator.js.map +0 -1
  974. package/dist/theme/hooks.d.ts +0 -110
  975. package/dist/theme/hooks.d.ts.map +0 -1
  976. package/dist/theme/hooks.js +0 -101
  977. package/dist/theme/hooks.js.map +0 -1
  978. package/dist/theme/index.d.ts +0 -37
  979. package/dist/theme/index.d.ts.map +0 -1
  980. package/dist/theme/index.js +0 -49
  981. package/dist/theme/index.js.map +0 -1
@@ -1,1427 +0,0 @@
1
- /**
2
- * @rovela/sdk/core/db/queries
3
- *
4
- * Type-safe query helpers for e-commerce stores
5
- * Each store has its own database (via Neon branches) - no tenant filtering needed
6
- */
7
- import * as schema from './schema';
8
- export interface FindProductsOptions {
9
- categoryId?: string;
10
- status?: 'draft' | 'active' | 'archived';
11
- search?: string;
12
- sort?: 'newest' | 'price-asc' | 'price-desc' | 'name';
13
- limit?: number;
14
- offset?: number;
15
- /**
16
- * When true, return only products effectively out of stock.
17
- * For non-variant products: `inventory <= 0 AND track_inventory = true`.
18
- * For variant products: no variant has `inventory > 0`.
19
- */
20
- outOfStock?: boolean;
21
- /**
22
- * When true, return only products with a sale price (compare_price > price).
23
- * Used by the auto-curated /sale collection card. Cheap to evaluate — no
24
- * subquery, just a column comparison.
25
- */
26
- onSale?: boolean;
27
- /**
28
- * When set, return only products whose `tags` JSONB array overlaps any of
29
- * the provided tags. Used by the product-quiz card to filter to products
30
- * matching the merchant's quiz answer→tag mapping. Empty array is a
31
- * no-op (returns all products).
32
- */
33
- tags?: string[];
34
- }
35
- /**
36
- * Find products with filtering, sorting, and pagination
37
- */
38
- export declare function findProducts(options?: FindProductsOptions): Promise<{
39
- id: string;
40
- name: string;
41
- slug: string;
42
- description: string;
43
- price: string;
44
- comparePrice: string | null;
45
- images: string[];
46
- videos: string[];
47
- status: "draft" | "active" | "archived";
48
- categoryId: string | null;
49
- hasVariants: boolean;
50
- sku: string | null;
51
- inventory: number | null;
52
- trackInventory: boolean | null;
53
- continueSellingWhenOutOfStock: boolean | null;
54
- productType: string | null;
55
- vendor: string | null;
56
- tags: string[] | null;
57
- metaTitle: string | null;
58
- metaDescription: string | null;
59
- metaKeywords: string[] | null;
60
- createdAt: Date;
61
- updatedAt: Date;
62
- }[]>;
63
- /**
64
- * Find a single product by slug
65
- */
66
- export declare function findProductBySlug(slug: string): Promise<{
67
- id: string;
68
- name: string;
69
- slug: string;
70
- description: string;
71
- price: string;
72
- comparePrice: string | null;
73
- images: string[];
74
- videos: string[];
75
- status: "draft" | "active" | "archived";
76
- categoryId: string | null;
77
- hasVariants: boolean;
78
- sku: string | null;
79
- inventory: number | null;
80
- trackInventory: boolean | null;
81
- continueSellingWhenOutOfStock: boolean | null;
82
- productType: string | null;
83
- vendor: string | null;
84
- tags: string[] | null;
85
- metaTitle: string | null;
86
- metaDescription: string | null;
87
- metaKeywords: string[] | null;
88
- createdAt: Date;
89
- updatedAt: Date;
90
- }>;
91
- /**
92
- * Find a single product by ID
93
- */
94
- export declare function findProductById(id: string): Promise<{
95
- id: string;
96
- name: string;
97
- slug: string;
98
- description: string;
99
- price: string;
100
- comparePrice: string | null;
101
- images: string[];
102
- videos: string[];
103
- status: "draft" | "active" | "archived";
104
- categoryId: string | null;
105
- hasVariants: boolean;
106
- sku: string | null;
107
- inventory: number | null;
108
- trackInventory: boolean | null;
109
- continueSellingWhenOutOfStock: boolean | null;
110
- productType: string | null;
111
- vendor: string | null;
112
- tags: string[] | null;
113
- metaTitle: string | null;
114
- metaDescription: string | null;
115
- metaKeywords: string[] | null;
116
- createdAt: Date;
117
- updatedAt: Date;
118
- }>;
119
- /**
120
- * Get product variants for a product
121
- */
122
- export declare function findProductVariants(productId: string): Promise<{
123
- id: string;
124
- productId: string;
125
- sku: string;
126
- name: string;
127
- price: string | null;
128
- inventory: number;
129
- image: string | null;
130
- video: string | null;
131
- attributes: Record<string, string>;
132
- createdAt: Date;
133
- }[]>;
134
- /**
135
- * Count total products matching filters
136
- */
137
- export declare function countProducts(options?: Pick<FindProductsOptions, 'categoryId' | 'status' | 'search' | 'outOfStock'>): Promise<number>;
138
- /**
139
- * For products with `hasVariants=true`, the parent `products.inventory` column
140
- * is unused — inventory lives on `product_variants`. This helper returns a
141
- * Map of `productId → effectiveInventory` for an arbitrary set of variant
142
- * product IDs. The page-list handler calls this for the products it just
143
- * returned and merges the sums into each row before responding to the client.
144
- *
145
- * Empty input → empty map. Single SQL query, GROUP BY product_id.
146
- */
147
- export declare function getInventoryByProductIds(productIds: string[]): Promise<Map<string, number>>;
148
- /**
149
- * Count of products in `status='active'`. Drives the "Active products"
150
- * metric card on the admin product list page.
151
- */
152
- export declare function getActiveProductCount(): Promise<number>;
153
- /**
154
- * Count of *active* products that are effectively out of stock. Excludes
155
- * drafts / archived (they're irrelevant noise on the product list view).
156
- *
157
- * Uses the same OOS condition as the chip filter (single source of truth).
158
- */
159
- export declare function getOutOfStockProductCount(): Promise<number>;
160
- /**
161
- * Best-selling product over the last `days` window, by units sold.
162
- *
163
- * Counts only orders that actually moved revenue: `paid`, `shipped`,
164
- * `delivered`. Excludes pending (might fail), cancelled, refunded, and
165
- * return_requested (not yet finalized).
166
- *
167
- * Returns null when no qualifying orders exist in the window — the UI
168
- * renders an empty state rather than a broken card.
169
- */
170
- export declare function getBestSellerProduct(days?: number): Promise<{
171
- id: string;
172
- name: string;
173
- unitsSold: number;
174
- revenue: string;
175
- } | null>;
176
- /**
177
- * Best-selling products in the last N days, capped to `limit`.
178
- *
179
- * Same SQL shape as `getBestSellerProduct` (paid+shipped+delivered window,
180
- * ordered by units sold desc) but returns up to `limit` rows. Used by the
181
- * Best Sellers homepage section card. Returns an empty array when no
182
- * qualifying orders exist — callers MUST hide their UI when length === 0
183
- * (don't render an empty rail).
184
- *
185
- * `order_items_product_id_idx` covers the JOIN; cost is the same as the
186
- * existing single-row helper.
187
- */
188
- export declare function getBestSellers(days?: number, limit?: number): Promise<Array<{
189
- id: string;
190
- slug: string;
191
- name: string;
192
- price: string;
193
- comparePrice: string | null;
194
- images: string[];
195
- unitsSold: number;
196
- }>>;
197
- /**
198
- * Most-popular products by distinct buyer count (last N days), capped.
199
- *
200
- * Different from best sellers — best sellers is units sold (revenue lens);
201
- * this is buyer reach (how many distinct customers bought it). Used by the
202
- * Most Popular homepage section card. Same JOIN path; same status window.
203
- *
204
- * Excludes guest orders (`customer_id IS NULL`) so we count real distinct
205
- * buyers, not anonymous sessions. Returns empty array when no data — UI
206
- * must hide.
207
- */
208
- export declare function getMostPopularProducts(days?: number, limit?: number): Promise<Array<{
209
- id: string;
210
- slug: string;
211
- name: string;
212
- price: string;
213
- comparePrice: string | null;
214
- images: string[];
215
- buyerCount: number;
216
- }>>;
217
- /**
218
- * Distinct-buyer count for a single product within the last N hours.
219
- *
220
- * Powers the "X people bought this in the last 24h" social-proof card on
221
- * PDPs. Server-only — caller MUST cache via Server Component + ISR
222
- * (`revalidate: 300`); calling this per page view is a perf trap.
223
- *
224
- * Returns 0 when no qualifying orders exist. UI gates on a `minThreshold`
225
- * (default 5) — never render "1 person bought this" (awkward + reads as
226
- * dead store).
227
- */
228
- export declare function getProductRecentBuyerCount(productId: string, hours?: number): Promise<number>;
229
- /**
230
- * Check whether a customer has purchased a specific product.
231
- *
232
- * Powers the verified-purchase badge on the C2 reviews card. Returns true
233
- * iff the customer has at least one paid+shipped+delivered order containing
234
- * the product (variant-agnostic — buying any variant counts).
235
- *
236
- * Uses EXISTS for short-circuit evaluation; cheap even on large order
237
- * histories. Index `order_items_product_id_idx` covers the inner lookup;
238
- * `orders_customer_id_idx` covers the join.
239
- */
240
- export declare function hasCustomerPurchasedProduct(customerId: string, productId: string): Promise<boolean>;
241
- /**
242
- * Find all categories
243
- */
244
- export declare function findCategories(): Promise<{
245
- id: string;
246
- name: string;
247
- slug: string;
248
- description: string | null;
249
- image: string | null;
250
- parentId: string | null;
251
- order: number;
252
- createdAt: Date;
253
- }[]>;
254
- /**
255
- * Find a category by slug
256
- */
257
- export declare function findCategoryBySlug(slug: string): Promise<{
258
- id: string;
259
- name: string;
260
- slug: string;
261
- description: string | null;
262
- image: string | null;
263
- parentId: string | null;
264
- order: number;
265
- createdAt: Date;
266
- }>;
267
- export interface FindOrdersOptions {
268
- status?: schema.Order['status'];
269
- customerId?: string;
270
- limit?: number;
271
- offset?: number;
272
- }
273
- /**
274
- * Find orders with filtering and pagination
275
- */
276
- export declare function findOrders(options?: FindOrdersOptions): Promise<{
277
- id: string;
278
- customerId: string | null;
279
- email: string;
280
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
281
- subtotal: string;
282
- tax: string;
283
- shipping: string;
284
- total: string;
285
- refundAmount: string | null;
286
- returnReason: string | null;
287
- discountCode: string | null;
288
- discountAmount: string | null;
289
- stripePromotionCodeId: string | null;
290
- shippingAddress: {
291
- firstName: string;
292
- lastName: string;
293
- line1: string;
294
- line2?: string;
295
- city: string;
296
- state: string;
297
- postalCode: string;
298
- country: string;
299
- phone?: string;
300
- } | null;
301
- billingAddress: {
302
- firstName: string;
303
- lastName: string;
304
- line1: string;
305
- line2?: string;
306
- city: string;
307
- state: string;
308
- postalCode: string;
309
- country: string;
310
- phone?: string;
311
- } | null;
312
- stripePaymentIntentId: string | null;
313
- stripeChargeId: string | null;
314
- receiptUrl: string | null;
315
- trackingNumber: string | null;
316
- trackingUrl: string | null;
317
- carrier: string | null;
318
- labelUrl: string | null;
319
- shippoRateId: string | null;
320
- shippingMethod: string | null;
321
- createdAt: Date;
322
- updatedAt: Date;
323
- }[]>;
324
- /**
325
- * Find order by ID with items (includes product images)
326
- */
327
- export declare function findOrderById(id: string): Promise<{
328
- items: {
329
- id: string;
330
- orderId: string;
331
- productId: string;
332
- variantId: string | null;
333
- name: string;
334
- price: string;
335
- quantity: number;
336
- attributes: Record<string, string> | null;
337
- createdAt: Date;
338
- image: string | null;
339
- }[];
340
- id: string;
341
- customerId: string | null;
342
- email: string;
343
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
344
- subtotal: string;
345
- tax: string;
346
- shipping: string;
347
- total: string;
348
- refundAmount: string | null;
349
- returnReason: string | null;
350
- discountCode: string | null;
351
- discountAmount: string | null;
352
- stripePromotionCodeId: string | null;
353
- shippingAddress: {
354
- firstName: string;
355
- lastName: string;
356
- line1: string;
357
- line2?: string;
358
- city: string;
359
- state: string;
360
- postalCode: string;
361
- country: string;
362
- phone?: string;
363
- } | null;
364
- billingAddress: {
365
- firstName: string;
366
- lastName: string;
367
- line1: string;
368
- line2?: string;
369
- city: string;
370
- state: string;
371
- postalCode: string;
372
- country: string;
373
- phone?: string;
374
- } | null;
375
- stripePaymentIntentId: string | null;
376
- stripeChargeId: string | null;
377
- receiptUrl: string | null;
378
- trackingNumber: string | null;
379
- trackingUrl: string | null;
380
- carrier: string | null;
381
- labelUrl: string | null;
382
- shippoRateId: string | null;
383
- shippingMethod: string | null;
384
- createdAt: Date;
385
- updatedAt: Date;
386
- } | null>;
387
- /**
388
- * Get order items for an order
389
- */
390
- export declare function findOrderItems(orderId: string): Promise<{
391
- id: string;
392
- orderId: string;
393
- productId: string;
394
- variantId: string | null;
395
- name: string;
396
- price: string;
397
- quantity: number;
398
- attributes: Record<string, string> | null;
399
- createdAt: Date;
400
- }[]>;
401
- /**
402
- * Find customer by email
403
- */
404
- export declare function findCustomerByEmail(email: string): Promise<{
405
- id: string;
406
- email: string;
407
- name: string | null;
408
- passwordHash: string;
409
- stripeCustomerId: string | null;
410
- emailVerified: Date | null;
411
- createdAt: Date;
412
- }>;
413
- /**
414
- * Find customer by ID
415
- */
416
- export declare function findCustomerById(id: string): Promise<{
417
- id: string;
418
- email: string;
419
- name: string | null;
420
- passwordHash: string;
421
- stripeCustomerId: string | null;
422
- emailVerified: Date | null;
423
- createdAt: Date;
424
- }>;
425
- /**
426
- * Find all customers with pagination
427
- */
428
- export declare function findCustomers(options?: {
429
- limit?: number;
430
- offset?: number;
431
- search?: string;
432
- }): Promise<{
433
- id: string;
434
- email: string;
435
- name: string | null;
436
- passwordHash: string;
437
- stripeCustomerId: string | null;
438
- emailVerified: Date | null;
439
- createdAt: Date;
440
- }[]>;
441
- /**
442
- * Find admin by email
443
- */
444
- export declare function findAdminByEmail(email: string): Promise<{
445
- id: string;
446
- email: string;
447
- name: string;
448
- passwordHash: string | null;
449
- role: "owner" | "admin" | "administrator" | "manager" | "user";
450
- status: "active" | "invited" | "deactivated";
451
- createdBy: string | null;
452
- createdAt: Date;
453
- lastLoginAt: Date | null;
454
- deactivatedAt: Date | null;
455
- deactivatedBy: string | null;
456
- sessionVersion: number;
457
- }>;
458
- /**
459
- * Get store statistics for admin dashboard
460
- */
461
- export declare function getStoreStats(): Promise<{
462
- products: number;
463
- orders: number;
464
- customers: number;
465
- revenue: number;
466
- }>;
467
- /**
468
- * Same shape as `getStoreStats()` but scoped to a window of `days` ago to now.
469
- * Powers the "Today / 7d / 30d / 90d" selector on the admin dashboard. Both
470
- * Orders and Revenue use the same status filter (paid + shipped + delivered)
471
- * so they tell the same story.
472
- *
473
- * Note: `products` and `customers` here mean *new* products created in the
474
- * window and *new* customers registered in the window — this is what makes
475
- * the period-vs-prior-period delta meaningful. For the absolute "how many
476
- * active products do I have" use `getStoreStats()`.
477
- */
478
- export declare function getStoreStatsForPeriod(startDate: Date, endDate: Date): Promise<{
479
- revenue: number;
480
- orders: number;
481
- newProducts: number;
482
- newCustomers: number;
483
- }>;
484
- /**
485
- * Count of refunded orders in the window. Used to compute refund rate.
486
- */
487
- export declare function getRefundedOrdersCount(startDate: Date, endDate: Date): Promise<number>;
488
- export interface DashboardSummary {
489
- /** Window the metrics cover (in calendar days). */
490
- periodDays: number;
491
- current: {
492
- revenue: number;
493
- orders: number;
494
- newCustomers: number;
495
- newProducts: number;
496
- /** Average order value: revenue / orders. 0 when orders=0. */
497
- aov: number;
498
- /** Refund rate as a decimal (0.05 = 5%). 0 when no orders. */
499
- refundRate: number;
500
- /** Best-selling product in the window, or null when no qualifying orders. */
501
- bestSeller: {
502
- id: string;
503
- name: string;
504
- unitsSold: number;
505
- revenue: string;
506
- } | null;
507
- };
508
- /** Same shape, scoped to the previous window of equal length. */
509
- previous: {
510
- revenue: number;
511
- orders: number;
512
- newCustomers: number;
513
- newProducts: number;
514
- aov: number;
515
- refundRate: number;
516
- };
517
- /**
518
- * Percentage delta of current vs previous, expressed as a decimal where
519
- * 0.124 = +12.4%. Null when prior period had zero (delta is undefined).
520
- * Refund-rate delta is *signed by direction*: a fall in refund rate is
521
- * positive (good) — we report the raw direction here and let the UI
522
- * invert the color semantics (down arrow with green when refund rate
523
- * decreases).
524
- */
525
- deltas: {
526
- revenue: number | null;
527
- orders: number | null;
528
- aov: number | null;
529
- refundRate: number | null;
530
- customers: number | null;
531
- };
532
- }
533
- /**
534
- * Build the full dashboard summary in a single round-trip. Runs eight
535
- * parallel queries (current period + previous period × four metrics) and
536
- * computes derived ratios + deltas in-process. Total wall-clock ~30–50ms
537
- * on a warm Neon connection.
538
- */
539
- export declare function getDashboardSummary(periodDays?: number): Promise<DashboardSummary>;
540
- /**
541
- * Get low stock products (inventory < threshold)
542
- */
543
- export declare function getLowStockProducts(threshold?: number): Promise<{
544
- product: {
545
- id: string;
546
- name: string;
547
- slug: string;
548
- description: string;
549
- price: string;
550
- comparePrice: string | null;
551
- images: string[];
552
- videos: string[];
553
- status: "draft" | "active" | "archived";
554
- categoryId: string | null;
555
- hasVariants: boolean;
556
- sku: string | null;
557
- inventory: number | null;
558
- trackInventory: boolean | null;
559
- continueSellingWhenOutOfStock: boolean | null;
560
- productType: string | null;
561
- vendor: string | null;
562
- tags: string[] | null;
563
- metaTitle: string | null;
564
- metaDescription: string | null;
565
- metaKeywords: string[] | null;
566
- createdAt: Date;
567
- updatedAt: Date;
568
- };
569
- variant: {
570
- id: string;
571
- productId: string;
572
- sku: string;
573
- name: string;
574
- price: string | null;
575
- inventory: number;
576
- image: string | null;
577
- video: string | null;
578
- attributes: Record<string, string>;
579
- createdAt: Date;
580
- };
581
- }[]>;
582
- /**
583
- * Get recent orders
584
- */
585
- export declare function getRecentOrders(limit?: number): Promise<{
586
- id: string;
587
- customerId: string | null;
588
- email: string;
589
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
590
- subtotal: string;
591
- tax: string;
592
- shipping: string;
593
- total: string;
594
- refundAmount: string | null;
595
- returnReason: string | null;
596
- discountCode: string | null;
597
- discountAmount: string | null;
598
- stripePromotionCodeId: string | null;
599
- shippingAddress: {
600
- firstName: string;
601
- lastName: string;
602
- line1: string;
603
- line2?: string;
604
- city: string;
605
- state: string;
606
- postalCode: string;
607
- country: string;
608
- phone?: string;
609
- } | null;
610
- billingAddress: {
611
- firstName: string;
612
- lastName: string;
613
- line1: string;
614
- line2?: string;
615
- city: string;
616
- state: string;
617
- postalCode: string;
618
- country: string;
619
- phone?: string;
620
- } | null;
621
- stripePaymentIntentId: string | null;
622
- stripeChargeId: string | null;
623
- receiptUrl: string | null;
624
- trackingNumber: string | null;
625
- trackingUrl: string | null;
626
- carrier: string | null;
627
- labelUrl: string | null;
628
- shippoRateId: string | null;
629
- shippingMethod: string | null;
630
- createdAt: Date;
631
- updatedAt: Date;
632
- }[]>;
633
- /**
634
- * Create a new order
635
- */
636
- export declare function createOrder(data: schema.NewOrder): Promise<{
637
- id: string;
638
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
639
- createdAt: Date;
640
- updatedAt: Date;
641
- customerId: string | null;
642
- email: string;
643
- subtotal: string;
644
- tax: string;
645
- shipping: string;
646
- total: string;
647
- refundAmount: string | null;
648
- returnReason: string | null;
649
- discountCode: string | null;
650
- discountAmount: string | null;
651
- stripePromotionCodeId: string | null;
652
- shippingAddress: {
653
- firstName: string;
654
- lastName: string;
655
- line1: string;
656
- line2?: string;
657
- city: string;
658
- state: string;
659
- postalCode: string;
660
- country: string;
661
- phone?: string;
662
- } | null;
663
- billingAddress: {
664
- firstName: string;
665
- lastName: string;
666
- line1: string;
667
- line2?: string;
668
- city: string;
669
- state: string;
670
- postalCode: string;
671
- country: string;
672
- phone?: string;
673
- } | null;
674
- stripePaymentIntentId: string | null;
675
- stripeChargeId: string | null;
676
- receiptUrl: string | null;
677
- trackingNumber: string | null;
678
- trackingUrl: string | null;
679
- carrier: string | null;
680
- labelUrl: string | null;
681
- shippoRateId: string | null;
682
- shippingMethod: string | null;
683
- }>;
684
- /**
685
- * Create order items for an order
686
- */
687
- export declare function createOrderItems(items: schema.NewOrderItem[]): Promise<{
688
- id: string;
689
- name: string;
690
- price: string;
691
- createdAt: Date;
692
- productId: string;
693
- attributes: Record<string, string> | null;
694
- orderId: string;
695
- variantId: string | null;
696
- quantity: number;
697
- }[]>;
698
- /**
699
- * Update order status
700
- */
701
- export declare function updateOrderStatus(orderId: string, status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled' | 'refunded' | 'return_requested'): Promise<{
702
- id: string;
703
- customerId: string | null;
704
- email: string;
705
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
706
- subtotal: string;
707
- tax: string;
708
- shipping: string;
709
- total: string;
710
- refundAmount: string | null;
711
- returnReason: string | null;
712
- discountCode: string | null;
713
- discountAmount: string | null;
714
- stripePromotionCodeId: string | null;
715
- shippingAddress: {
716
- firstName: string;
717
- lastName: string;
718
- line1: string;
719
- line2?: string;
720
- city: string;
721
- state: string;
722
- postalCode: string;
723
- country: string;
724
- phone?: string;
725
- } | null;
726
- billingAddress: {
727
- firstName: string;
728
- lastName: string;
729
- line1: string;
730
- line2?: string;
731
- city: string;
732
- state: string;
733
- postalCode: string;
734
- country: string;
735
- phone?: string;
736
- } | null;
737
- stripePaymentIntentId: string | null;
738
- stripeChargeId: string | null;
739
- receiptUrl: string | null;
740
- trackingNumber: string | null;
741
- trackingUrl: string | null;
742
- carrier: string | null;
743
- labelUrl: string | null;
744
- shippoRateId: string | null;
745
- shippingMethod: string | null;
746
- createdAt: Date;
747
- updatedAt: Date;
748
- }>;
749
- /**
750
- * Update order shipping information (for Shippo integration)
751
- */
752
- export declare function updateOrderShipping(orderId: string, shippingData: {
753
- trackingNumber?: string;
754
- trackingUrl?: string;
755
- carrier?: string;
756
- labelUrl?: string;
757
- shippoRateId?: string;
758
- shippingMethod?: string;
759
- status?: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled' | 'refunded';
760
- }): Promise<{
761
- id: string;
762
- customerId: string | null;
763
- email: string;
764
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
765
- subtotal: string;
766
- tax: string;
767
- shipping: string;
768
- total: string;
769
- refundAmount: string | null;
770
- returnReason: string | null;
771
- discountCode: string | null;
772
- discountAmount: string | null;
773
- stripePromotionCodeId: string | null;
774
- shippingAddress: {
775
- firstName: string;
776
- lastName: string;
777
- line1: string;
778
- line2?: string;
779
- city: string;
780
- state: string;
781
- postalCode: string;
782
- country: string;
783
- phone?: string;
784
- } | null;
785
- billingAddress: {
786
- firstName: string;
787
- lastName: string;
788
- line1: string;
789
- line2?: string;
790
- city: string;
791
- state: string;
792
- postalCode: string;
793
- country: string;
794
- phone?: string;
795
- } | null;
796
- stripePaymentIntentId: string | null;
797
- stripeChargeId: string | null;
798
- receiptUrl: string | null;
799
- trackingNumber: string | null;
800
- trackingUrl: string | null;
801
- carrier: string | null;
802
- labelUrl: string | null;
803
- shippoRateId: string | null;
804
- shippingMethod: string | null;
805
- createdAt: Date;
806
- updatedAt: Date;
807
- }>;
808
- /**
809
- * Find order by Stripe Payment Intent ID
810
- * Used for idempotency in webhook handling
811
- */
812
- export declare function findOrderByPaymentIntent(paymentIntentId: string): Promise<{
813
- id: string;
814
- customerId: string | null;
815
- email: string;
816
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
817
- subtotal: string;
818
- tax: string;
819
- shipping: string;
820
- total: string;
821
- refundAmount: string | null;
822
- returnReason: string | null;
823
- discountCode: string | null;
824
- discountAmount: string | null;
825
- stripePromotionCodeId: string | null;
826
- shippingAddress: {
827
- firstName: string;
828
- lastName: string;
829
- line1: string;
830
- line2?: string;
831
- city: string;
832
- state: string;
833
- postalCode: string;
834
- country: string;
835
- phone?: string;
836
- } | null;
837
- billingAddress: {
838
- firstName: string;
839
- lastName: string;
840
- line1: string;
841
- line2?: string;
842
- city: string;
843
- state: string;
844
- postalCode: string;
845
- country: string;
846
- phone?: string;
847
- } | null;
848
- stripePaymentIntentId: string | null;
849
- stripeChargeId: string | null;
850
- receiptUrl: string | null;
851
- trackingNumber: string | null;
852
- trackingUrl: string | null;
853
- carrier: string | null;
854
- labelUrl: string | null;
855
- shippoRateId: string | null;
856
- shippingMethod: string | null;
857
- createdAt: Date;
858
- updatedAt: Date;
859
- }>;
860
- /**
861
- * Update order refund amount (for partial refund tracking)
862
- * Adds the refund amount to the existing refund total
863
- */
864
- export declare function updateOrderRefundAmount(orderId: string, refundAmountCents: number): Promise<schema.Order | null>;
865
- /**
866
- * Update order receipt information (for Stripe receipt URL)
867
- */
868
- export declare function updateOrderReceipt(orderId: string, receiptData: {
869
- stripeChargeId?: string;
870
- receiptUrl?: string;
871
- }): Promise<schema.Order | null>;
872
- /**
873
- * Update order with return request
874
- * Sets status to 'return_requested' and stores the return reason
875
- */
876
- export declare function updateOrderReturnRequest(orderId: string, returnReason: string): Promise<schema.Order | null>;
877
- /**
878
- * Clear order return request
879
- * Sets status back to 'delivered' and clears the return reason
880
- */
881
- export declare function clearOrderReturnRequest(orderId: string): Promise<schema.Order | null>;
882
- /**
883
- * Create a new product
884
- */
885
- export declare function createProduct(data: schema.NewProduct): Promise<schema.Product>;
886
- /**
887
- * Update a product by ID
888
- */
889
- export declare function updateProduct(id: string, data: Partial<Omit<schema.NewProduct, 'id'>>): Promise<schema.Product | null>;
890
- /**
891
- * Archive a product by ID (soft delete).
892
- * Sets status to 'archived' instead of deleting to preserve order history.
893
- * Use hardDeleteProduct() for permanent deletion if needed.
894
- */
895
- export declare function deleteProduct(id: string): Promise<boolean>;
896
- /**
897
- * Permanently delete a product by ID.
898
- * WARNING: This will fail if there are order_items referencing this product.
899
- * Use deleteProduct() (soft delete) for most cases.
900
- */
901
- export declare function hardDeleteProduct(id: string): Promise<boolean>;
902
- /**
903
- * Create a new product variant
904
- */
905
- export declare function createProductVariant(data: schema.NewProductVariant): Promise<schema.ProductVariant>;
906
- /**
907
- * Update a product variant by ID
908
- */
909
- export declare function updateProductVariant(id: string, data: Partial<Omit<schema.NewProductVariant, 'id' | 'productId'>>): Promise<schema.ProductVariant | null>;
910
- /**
911
- * Delete a product variant by ID
912
- */
913
- export declare function deleteProductVariant(id: string): Promise<boolean>;
914
- /**
915
- * Update variant inventory
916
- */
917
- export declare function updateVariantInventory(id: string, inventory: number): Promise<void>;
918
- /**
919
- * Find a variant by ID
920
- */
921
- export declare function findVariantById(id: string): Promise<schema.ProductVariant | null>;
922
- /**
923
- * Find a category by ID
924
- */
925
- export declare function findCategoryById(id: string): Promise<schema.Category | null>;
926
- /**
927
- * Create a new category
928
- */
929
- export declare function createCategory(data: schema.NewCategory): Promise<schema.Category>;
930
- /**
931
- * Update a category by ID
932
- */
933
- export declare function updateCategory(id: string, data: Partial<Omit<schema.NewCategory, 'id'>>): Promise<schema.Category | null>;
934
- /**
935
- * Delete a category by ID
936
- */
937
- export declare function deleteCategory(id: string): Promise<boolean>;
938
- /**
939
- * Count categories
940
- */
941
- export declare function countCategories(): Promise<number>;
942
- /**
943
- * Count customers with optional search
944
- */
945
- export declare function countCustomers(options?: {
946
- search?: string;
947
- }): Promise<number>;
948
- /**
949
- * Find orders for a specific customer
950
- */
951
- export declare function findCustomerOrders(customerId: string): Promise<{
952
- id: string;
953
- customerId: string | null;
954
- email: string;
955
- status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
956
- subtotal: string;
957
- tax: string;
958
- shipping: string;
959
- total: string;
960
- refundAmount: string | null;
961
- returnReason: string | null;
962
- discountCode: string | null;
963
- discountAmount: string | null;
964
- stripePromotionCodeId: string | null;
965
- shippingAddress: {
966
- firstName: string;
967
- lastName: string;
968
- line1: string;
969
- line2?: string;
970
- city: string;
971
- state: string;
972
- postalCode: string;
973
- country: string;
974
- phone?: string;
975
- } | null;
976
- billingAddress: {
977
- firstName: string;
978
- lastName: string;
979
- line1: string;
980
- line2?: string;
981
- city: string;
982
- state: string;
983
- postalCode: string;
984
- country: string;
985
- phone?: string;
986
- } | null;
987
- stripePaymentIntentId: string | null;
988
- stripeChargeId: string | null;
989
- receiptUrl: string | null;
990
- trackingNumber: string | null;
991
- trackingUrl: string | null;
992
- carrier: string | null;
993
- labelUrl: string | null;
994
- shippoRateId: string | null;
995
- shippingMethod: string | null;
996
- createdAt: Date;
997
- updatedAt: Date;
998
- }[]>;
999
- /**
1000
- * Claim guest orders by email when a customer registers.
1001
- * Updates all orders with matching email and null customerId to the new customer.
1002
- *
1003
- * @param email - Email address (will be lowercased)
1004
- * @param customerId - New customer ID to assign
1005
- * @returns Number of orders claimed
1006
- */
1007
- export declare function claimGuestOrders(email: string, customerId: string): Promise<number>;
1008
- /**
1009
- * Delete (anonymize) a customer by ID.
1010
- *
1011
- * This is a SOFT DELETE that anonymizes customer data instead of removing the record.
1012
- * This approach:
1013
- * - Preserves order history integrity (orders reference customerId)
1014
- * - Complies with GDPR "right to erasure" through anonymization
1015
- * - Prevents login by invalidating passwordHash
1016
- * - Keeps the record for audit trail purposes
1017
- *
1018
- * Related tokens (verification, password reset) are auto-deleted via CASCADE.
1019
- *
1020
- * @param id - Customer UUID
1021
- * @returns true if customer was found and anonymized, false if not found
1022
- */
1023
- export declare function deleteCustomer(id: string): Promise<boolean>;
1024
- /**
1025
- * Count orders with optional status filter
1026
- */
1027
- export declare function countOrders(options?: {
1028
- status?: schema.Order['status'];
1029
- }): Promise<number>;
1030
- /**
1031
- * Get revenue by period (for analytics).
1032
- *
1033
- * Returns one row per calendar day in the window, **including days with zero
1034
- * revenue**. The SQL GROUP BY only emits rows where orders exist, which made
1035
- * the chart skip empty days and look discontinuous (e.g., a Friday-only seller
1036
- * showed 5 floating points instead of 30). Fill happens in-process, so the
1037
- * chart can render a continuous line without the consumer thinking about it.
1038
- *
1039
- * Date format is `YYYY-MM-DD` in UTC (matches Postgres `DATE()` output).
1040
- */
1041
- export declare function getRevenueByPeriod(days: number): Promise<{
1042
- date: string;
1043
- revenue: number;
1044
- }[]>;
1045
- /**
1046
- * Get orders by status count (for analytics)
1047
- */
1048
- export declare function getOrdersByStatus(): Promise<{
1049
- status: string;
1050
- count: number;
1051
- }[]>;
1052
- /**
1053
- * Settings data type for API responses
1054
- */
1055
- export interface StoreSettingsData {
1056
- storeName: string | null;
1057
- storeEmail: string | null;
1058
- logoUrl: string | null;
1059
- storeCurrency: string | null;
1060
- storeTimezone: string | null;
1061
- taxIncludedInPrices: boolean | null;
1062
- shippingEnabled: boolean | null;
1063
- freeShippingThreshold: number | null;
1064
- shippingCountries: string[] | null;
1065
- guestCheckout: boolean | null;
1066
- customerAccounts: boolean | null;
1067
- shippingMode: 'manual' | 'shippo' | null;
1068
- shippoApiKey: string | null;
1069
- shippoTestMode: boolean | null;
1070
- shippoFromAddress: {
1071
- name: string;
1072
- company?: string;
1073
- street1: string;
1074
- street2?: string;
1075
- city: string;
1076
- state: string;
1077
- zip: string;
1078
- country: string;
1079
- phone?: string;
1080
- email?: string;
1081
- } | null;
1082
- shippoDefaultParcel: {
1083
- length: number;
1084
- width: number;
1085
- height: number;
1086
- weight: number;
1087
- } | null;
1088
- promotionCodesEnabled: boolean | null;
1089
- cookieBannerEnabled: boolean | null;
1090
- }
1091
- /**
1092
- * Find store settings.
1093
- * Returns null if no settings exist (first time access).
1094
- * Each store has only one settings row.
1095
- */
1096
- export declare function findSettings(): Promise<StoreSettingsData | null>;
1097
- /**
1098
- * Upsert (create or update) store settings.
1099
- * Each store has only one settings row.
1100
- */
1101
- export declare function upsertSettings(data: Partial<StoreSettingsData>): Promise<StoreSettingsData>;
1102
- /**
1103
- * Shipping carrier data for API responses
1104
- */
1105
- export interface ShippingCarrierData {
1106
- id: string;
1107
- name: string;
1108
- code: string;
1109
- description: string | null;
1110
- isActive: boolean;
1111
- sortOrder: number;
1112
- createdAt: Date;
1113
- updatedAt: Date;
1114
- }
1115
- /**
1116
- * Shipping carrier with nested zones and rates for full hierarchy
1117
- */
1118
- export interface ShippingCarrierWithZones extends ShippingCarrierData {
1119
- zones: ShippingZoneWithRates[];
1120
- }
1121
- /**
1122
- * Find all shipping carriers
1123
- */
1124
- export declare function findShippingCarriers(): Promise<ShippingCarrierData[]>;
1125
- /**
1126
- * Find active shipping carriers only
1127
- */
1128
- export declare function findActiveShippingCarriers(): Promise<ShippingCarrierData[]>;
1129
- /**
1130
- * Find a shipping carrier by ID
1131
- */
1132
- export declare function findShippingCarrierById(id: string): Promise<ShippingCarrierData | null>;
1133
- /**
1134
- * Create a new shipping carrier
1135
- */
1136
- export declare function createShippingCarrier(data: {
1137
- name: string;
1138
- code: string;
1139
- description?: string;
1140
- isActive?: boolean;
1141
- sortOrder?: number;
1142
- }): Promise<schema.ShippingCarrier>;
1143
- /**
1144
- * Update a shipping carrier
1145
- */
1146
- export declare function updateShippingCarrier(id: string, data: Partial<{
1147
- name: string;
1148
- code: string;
1149
- description: string | null;
1150
- isActive: boolean;
1151
- sortOrder: number;
1152
- }>): Promise<schema.ShippingCarrier | null>;
1153
- /**
1154
- * Delete a shipping carrier (cascades to zones and rates)
1155
- */
1156
- export declare function deleteShippingCarrier(id: string): Promise<boolean>;
1157
- /**
1158
- * Find all carriers with their zones and rates (full hierarchy for admin UI)
1159
- */
1160
- export declare function findCarriersWithZonesAndRates(): Promise<ShippingCarrierWithZones[]>;
1161
- /**
1162
- * Shipping zone with nested rates for API responses
1163
- */
1164
- export interface ShippingZoneWithRates {
1165
- id: string;
1166
- carrierId: string;
1167
- carrier?: {
1168
- id: string;
1169
- name: string;
1170
- code: string;
1171
- };
1172
- name: string;
1173
- countries: string[];
1174
- isActive: boolean;
1175
- sortOrder: number;
1176
- createdAt: Date;
1177
- updatedAt: Date;
1178
- rates: Array<{
1179
- id: string;
1180
- name: string;
1181
- description: string | null;
1182
- price: number;
1183
- minOrderAmount: number | null;
1184
- maxOrderAmount: number | null;
1185
- estimatedDays: string | null;
1186
- isActive: boolean;
1187
- sortOrder: number;
1188
- }>;
1189
- }
1190
- /**
1191
- * Find all shipping zones with their rates and carrier info
1192
- */
1193
- export declare function findShippingZones(): Promise<ShippingZoneWithRates[]>;
1194
- /**
1195
- * Find active shipping zones only
1196
- */
1197
- export declare function findActiveShippingZones(): Promise<ShippingZoneWithRates[]>;
1198
- /**
1199
- * Find a shipping zone by ID
1200
- */
1201
- export declare function findShippingZoneById(id: string): Promise<ShippingZoneWithRates | null>;
1202
- /**
1203
- * Create a new shipping zone under a carrier
1204
- */
1205
- export declare function createShippingZone(data: {
1206
- carrierId: string;
1207
- name: string;
1208
- countries: string[];
1209
- isActive?: boolean;
1210
- sortOrder?: number;
1211
- }): Promise<schema.ShippingZone>;
1212
- /**
1213
- * Update a shipping zone
1214
- */
1215
- export declare function updateShippingZone(id: string, data: Partial<{
1216
- carrierId: string;
1217
- name: string;
1218
- countries: string[];
1219
- isActive: boolean;
1220
- sortOrder: number;
1221
- }>): Promise<schema.ShippingZone | null>;
1222
- /**
1223
- * Delete a shipping zone (cascades to rates)
1224
- */
1225
- export declare function deleteShippingZone(id: string): Promise<boolean>;
1226
- /**
1227
- * Create a shipping rate for a zone
1228
- */
1229
- export declare function createShippingRate(data: {
1230
- zoneId: string;
1231
- name: string;
1232
- description?: string;
1233
- price: number;
1234
- minOrderAmount?: number;
1235
- maxOrderAmount?: number;
1236
- estimatedDays?: string;
1237
- isActive?: boolean;
1238
- sortOrder?: number;
1239
- }): Promise<schema.ShippingRate>;
1240
- /**
1241
- * Update a shipping rate
1242
- */
1243
- export declare function updateShippingRate(id: string, data: Partial<{
1244
- name: string;
1245
- description: string | null;
1246
- price: number;
1247
- minOrderAmount: number | null;
1248
- maxOrderAmount: number | null;
1249
- estimatedDays: string | null;
1250
- isActive: boolean;
1251
- sortOrder: number;
1252
- }>): Promise<schema.ShippingRate | null>;
1253
- /**
1254
- * Delete a shipping rate
1255
- */
1256
- export declare function deleteShippingRate(id: string): Promise<boolean>;
1257
- /**
1258
- * Find shipping rates applicable to a specific country and order amount.
1259
- * Used during checkout to determine which shipping options to show.
1260
- *
1261
- * @param country - ISO country code (e.g., 'US', 'CA')
1262
- * @param orderAmount - Order subtotal in dollars
1263
- * @returns Array of applicable shipping rates with carrier info
1264
- */
1265
- export declare function findShippingRatesForCountry(country: string, orderAmount: number): Promise<Array<{
1266
- id: string;
1267
- carrierId: string;
1268
- carrierName: string;
1269
- carrierCode: string;
1270
- zoneName: string;
1271
- name: string;
1272
- description: string | null;
1273
- price: number;
1274
- estimatedDays: string | null;
1275
- }>>;
1276
- /**
1277
- * Shipping option for checkout UI (unified format for both manual and Shippo modes)
1278
- * Compatible with checkout/types.ts ShippingOption
1279
- */
1280
- export interface ShippingOptionForCheckout {
1281
- id: string;
1282
- carrierId: string;
1283
- carrierName: string;
1284
- carrierCode: string;
1285
- /** Display name (e.g., "Standard Shipping", "Priority Mail") - matches ShippingOption.name */
1286
- name: string;
1287
- /** Description - optional to match ShippingOption */
1288
- description?: string;
1289
- price: number;
1290
- /** Estimated delivery time - optional to match ShippingOption */
1291
- estimatedDays?: string;
1292
- source: 'manual' | 'shippo';
1293
- }
1294
- /**
1295
- * Shipping options grouped by carrier for checkout UI
1296
- */
1297
- export interface ShippingOptionsGroupedByCarrier {
1298
- carrier: {
1299
- id: string;
1300
- name: string;
1301
- code: string;
1302
- };
1303
- options: ShippingOptionForCheckout[];
1304
- }
1305
- /**
1306
- * Find shipping options for checkout grouped by carrier.
1307
- * This is the main function used by the pre-checkout flow.
1308
- *
1309
- * @param country - ISO country code (e.g., 'US', 'CA')
1310
- * @param orderAmount - Order subtotal in dollars
1311
- * @returns Shipping options grouped by carrier
1312
- */
1313
- export declare function findShippingOptionsForCountry(country: string, orderAmount: number): Promise<ShippingOptionsGroupedByCarrier[]>;
1314
- /**
1315
- * Tax zone data for API responses
1316
- */
1317
- export interface TaxZoneData {
1318
- id: string;
1319
- name: string;
1320
- countries: string[];
1321
- states: string[];
1322
- taxRate: number;
1323
- isActive: boolean;
1324
- sortOrder: number;
1325
- createdAt: Date;
1326
- updatedAt: Date;
1327
- }
1328
- /**
1329
- * Find all tax zones ordered by priority (sortOrder ascending)
1330
- */
1331
- export declare function findTaxZones(): Promise<TaxZoneData[]>;
1332
- /**
1333
- * Find only active tax zones
1334
- */
1335
- export declare function findActiveTaxZones(): Promise<TaxZoneData[]>;
1336
- /**
1337
- * Find a tax zone by ID
1338
- */
1339
- export declare function findTaxZoneById(id: string): Promise<TaxZoneData | null>;
1340
- /**
1341
- * Create a new tax zone
1342
- */
1343
- export declare function createTaxZone(data: {
1344
- name: string;
1345
- countries: string[];
1346
- states?: string[];
1347
- taxRate: number;
1348
- isActive?: boolean;
1349
- sortOrder?: number;
1350
- }): Promise<schema.TaxZone>;
1351
- /**
1352
- * Update a tax zone
1353
- */
1354
- export declare function updateTaxZone(id: string, data: Partial<{
1355
- name: string;
1356
- countries: string[];
1357
- states: string[];
1358
- taxRate: number;
1359
- isActive: boolean;
1360
- sortOrder: number;
1361
- }>): Promise<schema.TaxZone | null>;
1362
- /**
1363
- * Delete a tax zone
1364
- */
1365
- export declare function deleteTaxZone(id: string): Promise<boolean>;
1366
- /**
1367
- * Result of tax zone matching for checkout
1368
- */
1369
- export interface TaxRateMatch {
1370
- zoneId: string;
1371
- zoneName: string;
1372
- taxRate: number;
1373
- }
1374
- /**
1375
- * Find the applicable tax rate for a given address.
1376
- * Returns the first matching zone based on priority (sortOrder).
1377
- *
1378
- * Matching logic:
1379
- * 1. For US addresses: Match country='US' AND state matches (if zone has states)
1380
- * 2. For non-US addresses: Match country only
1381
- * 3. Wildcard '*' in countries matches any country
1382
- *
1383
- * @param country - ISO-2 country code (e.g., 'US', 'FR')
1384
- * @param state - State/province code for US (e.g., 'CA', 'NY')
1385
- * @returns Tax rate info or null if no matching zone
1386
- */
1387
- export declare function findTaxRateForAddress(country: string, state?: string): Promise<TaxRateMatch | null>;
1388
- /**
1389
- * Shape of the `store_settings.onboarding` JSONB column. Mirrors the type in
1390
- * schema.ts. Re-declared here as a plain interface so non-Drizzle consumers
1391
- * (API handlers, tests) don't have to import the schema's inferred type.
1392
- */
1393
- export interface OnboardingState {
1394
- firstProductTouched?: boolean;
1395
- logoUploaded?: boolean;
1396
- taxNoneNeeded?: boolean;
1397
- legalPagesReviewed?: boolean;
1398
- dismissedAt?: string;
1399
- }
1400
- export declare function ensureOnboardingColumn(): Promise<void>;
1401
- /**
1402
- * Read the onboarding JSONB. Returns `{}` when the row is missing or the
1403
- * column hasn't been initialized yet (legacy stores). Always safe to call.
1404
- */
1405
- export declare function getOnboardingState(): Promise<OnboardingState>;
1406
- /**
1407
- * Set or clear a single key on the onboarding JSONB. Uses `jsonb_set` so it
1408
- * never clobbers other keys written by parallel requests. Safe to call
1409
- * fire-and-forget from mutating API routes (products POST/PUT, settings PUT).
1410
- */
1411
- export declare function setOnboardingFlag<K extends keyof OnboardingState>(key: K, value: OnboardingState[K]): Promise<void>;
1412
- /**
1413
- * Aggregated signal counts used by the setup-guide GET handler. One round-trip
1414
- * via Promise.all instead of four sequential queries.
1415
- */
1416
- export declare function getSetupGuideSignals(): Promise<{
1417
- productCount: number;
1418
- shippingZonesCount: number;
1419
- taxZonesCount: number;
1420
- adminCount: number;
1421
- storeSettings: {
1422
- logoUrl: string | null;
1423
- analytics: Record<string, unknown>;
1424
- onboarding: OnboardingState;
1425
- } | null;
1426
- }>;
1427
- //# sourceMappingURL=queries.d.ts.map