@rovela-ai/sdk 0.1.2 → 0.1.3
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.
- package/dist/admin/api/auth.d.ts +32 -0
- package/dist/admin/api/auth.d.ts.map +1 -0
- package/dist/admin/api/auth.js +43 -0
- package/dist/admin/api/auth.js.map +1 -0
- package/dist/admin/api/categories.d.ts +68 -0
- package/dist/admin/api/categories.d.ts.map +1 -0
- package/dist/admin/api/categories.js +247 -0
- package/dist/admin/api/categories.js.map +1 -0
- package/dist/admin/api/customers.d.ts +41 -0
- package/dist/admin/api/customers.d.ts.map +1 -0
- package/dist/admin/api/customers.js +113 -0
- package/dist/admin/api/customers.js.map +1 -0
- package/dist/admin/api/index.d.ts +56 -0
- package/dist/admin/api/index.d.ts.map +1 -0
- package/dist/admin/api/index.js +87 -0
- package/dist/admin/api/index.js.map +1 -0
- package/dist/admin/api/orders.d.ts +59 -0
- package/dist/admin/api/orders.d.ts.map +1 -0
- package/dist/admin/api/orders.js +209 -0
- package/dist/admin/api/orders.js.map +1 -0
- package/dist/admin/api/products.d.ts +103 -0
- package/dist/admin/api/products.d.ts.map +1 -0
- package/dist/admin/api/products.js +329 -0
- package/dist/admin/api/products.js.map +1 -0
- package/dist/admin/api/refund.d.ts +29 -0
- package/dist/admin/api/refund.d.ts.map +1 -0
- package/dist/admin/api/refund.js +136 -0
- package/dist/admin/api/refund.js.map +1 -0
- package/dist/admin/api/stats.d.ts +40 -0
- package/dist/admin/api/stats.d.ts.map +1 -0
- package/dist/admin/api/stats.js +74 -0
- package/dist/admin/api/stats.js.map +1 -0
- package/dist/admin/components/AdminGuard.d.ts +40 -0
- package/dist/admin/components/AdminGuard.d.ts.map +1 -0
- package/dist/admin/components/AdminGuard.js +97 -0
- package/dist/admin/components/AdminGuard.js.map +1 -0
- package/dist/admin/components/AdminHeader.d.ts +18 -0
- package/dist/admin/components/AdminHeader.d.ts.map +1 -0
- package/dist/admin/components/AdminHeader.js +33 -0
- package/dist/admin/components/AdminHeader.js.map +1 -0
- package/dist/admin/components/AdminLayout.d.ts +50 -0
- package/dist/admin/components/AdminLayout.d.ts.map +1 -0
- package/dist/admin/components/AdminLayout.js +46 -0
- package/dist/admin/components/AdminLayout.js.map +1 -0
- package/dist/admin/components/AdminLoginForm.d.ts +18 -0
- package/dist/admin/components/AdminLoginForm.d.ts.map +1 -0
- package/dist/admin/components/AdminLoginForm.js +58 -0
- package/dist/admin/components/AdminLoginForm.js.map +1 -0
- package/dist/admin/components/AdminNav.d.ts +34 -0
- package/dist/admin/components/AdminNav.d.ts.map +1 -0
- package/dist/admin/components/AdminNav.js +61 -0
- package/dist/admin/components/AdminNav.js.map +1 -0
- package/dist/admin/components/InventoryEditor.d.ts +15 -0
- package/dist/admin/components/InventoryEditor.d.ts.map +1 -0
- package/dist/admin/components/InventoryEditor.js +83 -0
- package/dist/admin/components/InventoryEditor.js.map +1 -0
- package/dist/admin/components/LowStockAlert.d.ts +11 -0
- package/dist/admin/components/LowStockAlert.d.ts.map +1 -0
- package/dist/admin/components/LowStockAlert.js +35 -0
- package/dist/admin/components/LowStockAlert.js.map +1 -0
- package/dist/admin/components/OrderDetails.d.ts +14 -0
- package/dist/admin/components/OrderDetails.d.ts.map +1 -0
- package/dist/admin/components/OrderDetails.js +94 -0
- package/dist/admin/components/OrderDetails.js.map +1 -0
- package/dist/admin/components/OrderTable.d.ts +13 -0
- package/dist/admin/components/OrderTable.d.ts.map +1 -0
- package/dist/admin/components/OrderTable.js +89 -0
- package/dist/admin/components/OrderTable.js.map +1 -0
- package/dist/admin/components/ProductForm.d.ts +18 -0
- package/dist/admin/components/ProductForm.d.ts.map +1 -0
- package/dist/admin/components/ProductForm.js +127 -0
- package/dist/admin/components/ProductForm.js.map +1 -0
- package/dist/admin/components/ProductTable.d.ts +13 -0
- package/dist/admin/components/ProductTable.d.ts.map +1 -0
- package/dist/admin/components/ProductTable.js +81 -0
- package/dist/admin/components/ProductTable.js.map +1 -0
- package/dist/admin/components/RecentOrders.d.ts +11 -0
- package/dist/admin/components/RecentOrders.d.ts.map +1 -0
- package/dist/admin/components/RecentOrders.js +58 -0
- package/dist/admin/components/RecentOrders.js.map +1 -0
- package/dist/admin/components/RefundDialog.d.ts +17 -0
- package/dist/admin/components/RefundDialog.d.ts.map +1 -0
- package/dist/admin/components/RefundDialog.js +86 -0
- package/dist/admin/components/RefundDialog.js.map +1 -0
- package/dist/admin/components/StatsCards.d.ts +23 -0
- package/dist/admin/components/StatsCards.d.ts.map +1 -0
- package/dist/admin/components/StatsCards.js +82 -0
- package/dist/admin/components/StatsCards.js.map +1 -0
- package/dist/admin/components/StoreSettings.d.ts +14 -0
- package/dist/admin/components/StoreSettings.d.ts.map +1 -0
- package/dist/admin/components/StoreSettings.js +88 -0
- package/dist/admin/components/StoreSettings.js.map +1 -0
- package/dist/admin/components/index.d.ts +21 -0
- package/dist/admin/components/index.d.ts.map +1 -0
- package/dist/admin/components/index.js +57 -0
- package/dist/admin/components/index.js.map +1 -0
- package/dist/admin/config.d.ts +74 -0
- package/dist/admin/config.d.ts.map +1 -0
- package/dist/admin/config.js +229 -0
- package/dist/admin/config.js.map +1 -0
- package/dist/admin/hooks/index.d.ts +10 -0
- package/dist/admin/hooks/index.d.ts.map +1 -0
- package/dist/admin/hooks/index.js +17 -0
- package/dist/admin/hooks/index.js.map +1 -0
- package/dist/admin/hooks/useAdminOrders.d.ts +41 -0
- package/dist/admin/hooks/useAdminOrders.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminOrders.js +191 -0
- package/dist/admin/hooks/useAdminOrders.js.map +1 -0
- package/dist/admin/hooks/useAdminProducts.d.ts +39 -0
- package/dist/admin/hooks/useAdminProducts.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminProducts.js +235 -0
- package/dist/admin/hooks/useAdminProducts.js.map +1 -0
- package/dist/admin/hooks/useAdminStats.d.ts +50 -0
- package/dist/admin/hooks/useAdminStats.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminStats.js +111 -0
- package/dist/admin/hooks/useAdminStats.js.map +1 -0
- package/dist/admin/index.d.ts +63 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +148 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/server/admin-service.d.ts +130 -0
- package/dist/admin/server/admin-service.d.ts.map +1 -0
- package/dist/admin/server/admin-service.js +298 -0
- package/dist/admin/server/admin-service.js.map +1 -0
- package/dist/admin/server/index.d.ts +8 -0
- package/dist/admin/server/index.d.ts.map +1 -0
- package/dist/admin/server/index.js +25 -0
- package/dist/admin/server/index.js.map +1 -0
- package/dist/admin/types.d.ts +549 -0
- package/dist/admin/types.d.ts.map +1 -0
- package/dist/admin/types.js +11 -0
- package/dist/admin/types.js.map +1 -0
- package/dist/auth/api/auth.d.ts +54 -0
- package/dist/auth/api/auth.d.ts.map +1 -0
- package/dist/auth/api/auth.js +67 -0
- package/dist/auth/api/auth.js.map +1 -0
- package/dist/auth/api/forgot-password.d.ts +41 -0
- package/dist/auth/api/forgot-password.d.ts.map +1 -0
- package/dist/auth/api/forgot-password.js +68 -0
- package/dist/auth/api/forgot-password.js.map +1 -0
- package/dist/auth/api/index.d.ts +34 -0
- package/dist/auth/api/index.d.ts.map +1 -0
- package/dist/auth/api/index.js +52 -0
- package/dist/auth/api/index.js.map +1 -0
- package/dist/auth/api/register.d.ts +41 -0
- package/dist/auth/api/register.d.ts.map +1 -0
- package/dist/auth/api/register.js +93 -0
- package/dist/auth/api/register.js.map +1 -0
- package/dist/auth/api/resend-verification.d.ts +41 -0
- package/dist/auth/api/resend-verification.d.ts.map +1 -0
- package/dist/auth/api/resend-verification.js +71 -0
- package/dist/auth/api/resend-verification.js.map +1 -0
- package/dist/auth/api/reset-password.d.ts +67 -0
- package/dist/auth/api/reset-password.d.ts.map +1 -0
- package/dist/auth/api/reset-password.js +110 -0
- package/dist/auth/api/reset-password.js.map +1 -0
- package/dist/auth/api/verify-email.d.ts +47 -0
- package/dist/auth/api/verify-email.d.ts.map +1 -0
- package/dist/auth/api/verify-email.js +94 -0
- package/dist/auth/api/verify-email.js.map +1 -0
- package/dist/auth/components/AuthGuard.d.ts +52 -0
- package/dist/auth/components/AuthGuard.d.ts.map +1 -0
- package/dist/auth/components/AuthGuard.js +113 -0
- package/dist/auth/components/AuthGuard.js.map +1 -0
- package/dist/auth/components/ForgotPasswordForm.d.ts +15 -0
- package/dist/auth/components/ForgotPasswordForm.d.ts.map +1 -0
- package/dist/auth/components/ForgotPasswordForm.js +44 -0
- package/dist/auth/components/ForgotPasswordForm.js.map +1 -0
- package/dist/auth/components/ResetPasswordForm.d.ts +18 -0
- package/dist/auth/components/ResetPasswordForm.d.ts.map +1 -0
- package/dist/auth/components/ResetPasswordForm.js +88 -0
- package/dist/auth/components/ResetPasswordForm.js.map +1 -0
- package/dist/auth/components/SignInForm.d.ts +21 -0
- package/dist/auth/components/SignInForm.d.ts.map +1 -0
- package/dist/auth/components/SignInForm.js +63 -0
- package/dist/auth/components/SignInForm.js.map +1 -0
- package/dist/auth/components/SignUpForm.d.ts +18 -0
- package/dist/auth/components/SignUpForm.d.ts.map +1 -0
- package/dist/auth/components/SignUpForm.js +79 -0
- package/dist/auth/components/SignUpForm.js.map +1 -0
- package/dist/auth/components/UserMenu.d.ts +18 -0
- package/dist/auth/components/UserMenu.d.ts.map +1 -0
- package/dist/auth/components/UserMenu.js +75 -0
- package/dist/auth/components/UserMenu.js.map +1 -0
- package/dist/auth/components/VerifyEmailNotice.d.ts +20 -0
- package/dist/auth/components/VerifyEmailNotice.d.ts.map +1 -0
- package/dist/auth/components/VerifyEmailNotice.js +59 -0
- package/dist/auth/components/VerifyEmailNotice.js.map +1 -0
- package/dist/auth/components/index.d.ts +13 -0
- package/dist/auth/components/index.d.ts.map +1 -0
- package/dist/auth/components/index.js +24 -0
- package/dist/auth/components/index.js.map +1 -0
- package/dist/auth/config.d.ts +42 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/config.js +174 -0
- package/dist/auth/config.js.map +1 -0
- package/dist/auth/hooks/index.d.ts +7 -0
- package/dist/auth/hooks/index.d.ts.map +1 -0
- package/dist/auth/hooks/index.js +11 -0
- package/dist/auth/hooks/index.js.map +1 -0
- package/dist/auth/index.d.ts +54 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +88 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/server/customer-service.d.ts +138 -0
- package/dist/auth/server/customer-service.d.ts.map +1 -0
- package/dist/auth/server/customer-service.js +309 -0
- package/dist/auth/server/customer-service.js.map +1 -0
- package/dist/auth/server/email-sender.d.ts +64 -0
- package/dist/auth/server/email-sender.d.ts.map +1 -0
- package/dist/auth/server/email-sender.js +112 -0
- package/dist/auth/server/email-sender.js.map +1 -0
- package/dist/auth/server/index.d.ts +13 -0
- package/dist/auth/server/index.d.ts.map +1 -0
- package/dist/auth/server/index.js +48 -0
- package/dist/auth/server/index.js.map +1 -0
- package/dist/auth/server/password-reset-service.d.ts +86 -0
- package/dist/auth/server/password-reset-service.d.ts.map +1 -0
- package/dist/auth/server/password-reset-service.js +236 -0
- package/dist/auth/server/password-reset-service.js.map +1 -0
- package/dist/auth/server/password.d.ts +58 -0
- package/dist/auth/server/password.d.ts.map +1 -0
- package/dist/auth/server/password.js +94 -0
- package/dist/auth/server/password.js.map +1 -0
- package/dist/auth/server/verification-service.d.ts +87 -0
- package/dist/auth/server/verification-service.d.ts.map +1 -0
- package/dist/auth/server/verification-service.js +268 -0
- package/dist/auth/server/verification-service.js.map +1 -0
- package/dist/auth/types.d.ts +305 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +8 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/cart/CartProvider.d.ts +65 -0
- package/dist/cart/CartProvider.d.ts.map +1 -0
- package/dist/cart/CartProvider.js +101 -0
- package/dist/cart/CartProvider.js.map +1 -0
- package/dist/cart/components/AddToCartButton.d.ts +77 -0
- package/dist/cart/components/AddToCartButton.d.ts.map +1 -0
- package/dist/cart/components/AddToCartButton.js +124 -0
- package/dist/cart/components/AddToCartButton.js.map +1 -0
- package/dist/cart/components/CartDrawer.d.ts +71 -0
- package/dist/cart/components/CartDrawer.d.ts.map +1 -0
- package/dist/cart/components/CartDrawer.js +108 -0
- package/dist/cart/components/CartDrawer.js.map +1 -0
- package/dist/cart/components/CartIcon.d.ts +36 -0
- package/dist/cart/components/CartIcon.d.ts.map +1 -0
- package/dist/cart/components/CartIcon.js +70 -0
- package/dist/cart/components/CartIcon.js.map +1 -0
- package/dist/cart/components/CartItem.d.ts +52 -0
- package/dist/cart/components/CartItem.d.ts.map +1 -0
- package/dist/cart/components/CartItem.js +55 -0
- package/dist/cart/components/CartItem.js.map +1 -0
- package/dist/cart/components/CartSummary.d.ts +43 -0
- package/dist/cart/components/CartSummary.d.ts.map +1 -0
- package/dist/cart/components/CartSummary.js +58 -0
- package/dist/cart/components/CartSummary.js.map +1 -0
- package/dist/cart/components/QuantitySelector.d.ts +39 -0
- package/dist/cart/components/QuantitySelector.d.ts.map +1 -0
- package/dist/cart/components/QuantitySelector.js +87 -0
- package/dist/cart/components/QuantitySelector.js.map +1 -0
- package/dist/cart/components/index.d.ts +18 -0
- package/dist/cart/components/index.d.ts.map +1 -0
- package/dist/cart/components/index.js +21 -0
- package/dist/cart/components/index.js.map +1 -0
- package/dist/cart/index.d.ts +109 -0
- package/dist/cart/index.d.ts.map +1 -0
- package/dist/cart/index.js +129 -0
- package/dist/cart/index.js.map +1 -0
- package/dist/cart/store.d.ts +101 -0
- package/dist/cart/store.d.ts.map +1 -0
- package/dist/cart/store.js +207 -0
- package/dist/cart/store.js.map +1 -0
- package/dist/checkout/api/checkout.d.ts +31 -0
- package/dist/checkout/api/checkout.d.ts.map +1 -0
- package/dist/checkout/api/checkout.js +103 -0
- package/dist/checkout/api/checkout.js.map +1 -0
- package/dist/checkout/api/index.d.ts +8 -0
- package/dist/checkout/api/index.d.ts.map +1 -0
- package/dist/checkout/api/index.js +13 -0
- package/dist/checkout/api/index.js.map +1 -0
- package/dist/checkout/api/webhook.d.ts +30 -0
- package/dist/checkout/api/webhook.d.ts.map +1 -0
- package/dist/checkout/api/webhook.js +58 -0
- package/dist/checkout/api/webhook.js.map +1 -0
- package/dist/checkout/components/CheckoutButton.d.ts +44 -0
- package/dist/checkout/components/CheckoutButton.d.ts.map +1 -0
- package/dist/checkout/components/CheckoutButton.js +97 -0
- package/dist/checkout/components/CheckoutButton.js.map +1 -0
- package/dist/checkout/components/CheckoutSuccess.d.ts +29 -0
- package/dist/checkout/components/CheckoutSuccess.d.ts.map +1 -0
- package/dist/checkout/components/CheckoutSuccess.js +60 -0
- package/dist/checkout/components/CheckoutSuccess.js.map +1 -0
- package/dist/checkout/components/OrderSummary.d.ts +37 -0
- package/dist/checkout/components/OrderSummary.d.ts.map +1 -0
- package/dist/checkout/components/OrderSummary.js +70 -0
- package/dist/checkout/components/OrderSummary.js.map +1 -0
- package/dist/checkout/components/ShippingForm.d.ts +30 -0
- package/dist/checkout/components/ShippingForm.d.ts.map +1 -0
- package/dist/checkout/components/ShippingForm.js +125 -0
- package/dist/checkout/components/ShippingForm.js.map +1 -0
- package/dist/checkout/components/index.d.ts +10 -0
- package/dist/checkout/components/index.d.ts.map +1 -0
- package/dist/checkout/components/index.js +17 -0
- package/dist/checkout/components/index.js.map +1 -0
- package/dist/checkout/hooks/index.d.ts +7 -0
- package/dist/checkout/hooks/index.d.ts.map +1 -0
- package/dist/checkout/hooks/index.js +12 -0
- package/dist/checkout/hooks/index.js.map +1 -0
- package/dist/checkout/hooks/useCheckout.d.ts +61 -0
- package/dist/checkout/hooks/useCheckout.d.ts.map +1 -0
- package/dist/checkout/hooks/useCheckout.js +174 -0
- package/dist/checkout/hooks/useCheckout.js.map +1 -0
- package/dist/checkout/index.d.ts +111 -0
- package/dist/checkout/index.d.ts.map +1 -0
- package/dist/checkout/index.js +148 -0
- package/dist/checkout/index.js.map +1 -0
- package/dist/checkout/server/create-checkout-session.d.ts +69 -0
- package/dist/checkout/server/create-checkout-session.d.ts.map +1 -0
- package/dist/checkout/server/create-checkout-session.js +190 -0
- package/dist/checkout/server/create-checkout-session.js.map +1 -0
- package/dist/checkout/server/handle-webhook.d.ts +35 -0
- package/dist/checkout/server/handle-webhook.d.ts.map +1 -0
- package/dist/checkout/server/handle-webhook.js +279 -0
- package/dist/checkout/server/handle-webhook.js.map +1 -0
- package/dist/checkout/server/index.d.ts +10 -0
- package/dist/checkout/server/index.d.ts.map +1 -0
- package/dist/checkout/server/index.js +19 -0
- package/dist/checkout/server/index.js.map +1 -0
- package/dist/checkout/server/order-service.d.ts +43 -0
- package/dist/checkout/server/order-service.d.ts.map +1 -0
- package/dist/checkout/server/order-service.js +196 -0
- package/dist/checkout/server/order-service.js.map +1 -0
- package/dist/checkout/stripe/client.d.ts +72 -0
- package/dist/checkout/stripe/client.d.ts.map +1 -0
- package/dist/checkout/stripe/client.js +189 -0
- package/dist/checkout/stripe/client.js.map +1 -0
- package/dist/checkout/stripe/index.d.ts +7 -0
- package/dist/checkout/stripe/index.d.ts.map +1 -0
- package/dist/checkout/stripe/index.js +21 -0
- package/dist/checkout/stripe/index.js.map +1 -0
- package/dist/checkout/types.d.ts +263 -0
- package/dist/checkout/types.d.ts.map +1 -0
- package/dist/checkout/types.js +9 -0
- package/dist/checkout/types.js.map +1 -0
- package/dist/core/config.d.ts +296 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +162 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/db/client.d.ts +69 -0
- package/dist/core/db/client.d.ts.map +1 -0
- package/dist/core/db/client.js +202 -0
- package/dist/core/db/client.js.map +1 -0
- package/dist/core/db/index.d.ts +11 -0
- package/dist/core/db/index.d.ts.map +1 -0
- package/dist/core/db/index.js +87 -0
- package/dist/core/db/index.js.map +1 -0
- package/dist/core/db/queries.d.ts +658 -0
- package/dist/core/db/queries.d.ts.map +1 -0
- package/dist/core/db/queries.js +735 -0
- package/dist/core/db/queries.js.map +1 -0
- package/dist/core/db/schema.d.ts +1628 -0
- package/dist/core/db/schema.d.ts.map +1 -0
- package/dist/core/db/schema.js +262 -0
- package/dist/core/db/schema.js.map +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +71 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/server/index.d.ts +17 -0
- package/dist/core/server/index.d.ts.map +1 -0
- package/dist/core/server/index.js +68 -0
- package/dist/core/server/index.js.map +1 -0
- package/dist/core/types.d.ts +230 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +9 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils.d.ts +153 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +356 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/emails/config.d.ts +42 -0
- package/dist/emails/config.d.ts.map +1 -0
- package/dist/emails/config.js +89 -0
- package/dist/emails/config.js.map +1 -0
- package/dist/emails/index.d.ts +85 -0
- package/dist/emails/index.d.ts.map +1 -0
- package/dist/emails/index.js +170 -0
- package/dist/emails/index.js.map +1 -0
- package/dist/emails/send/auth.d.ts +91 -0
- package/dist/emails/send/auth.d.ts.map +1 -0
- package/dist/emails/send/auth.js +132 -0
- package/dist/emails/send/auth.js.map +1 -0
- package/dist/emails/send/index.d.ts +10 -0
- package/dist/emails/send/index.d.ts.map +1 -0
- package/dist/emails/send/index.js +33 -0
- package/dist/emails/send/index.js.map +1 -0
- package/dist/emails/send/orders.d.ts +180 -0
- package/dist/emails/send/orders.d.ts.map +1 -0
- package/dist/emails/send/orders.js +259 -0
- package/dist/emails/send/orders.js.map +1 -0
- package/dist/emails/sender.d.ts +72 -0
- package/dist/emails/sender.d.ts.map +1 -0
- package/dist/emails/sender.js +118 -0
- package/dist/emails/sender.js.map +1 -0
- package/dist/emails/templates/base.d.ts +105 -0
- package/dist/emails/templates/base.d.ts.map +1 -0
- package/dist/emails/templates/base.js +291 -0
- package/dist/emails/templates/base.js.map +1 -0
- package/dist/emails/templates/email-verification.d.ts +28 -0
- package/dist/emails/templates/email-verification.d.ts.map +1 -0
- package/dist/emails/templates/email-verification.js +56 -0
- package/dist/emails/templates/email-verification.js.map +1 -0
- package/dist/emails/templates/index.d.ts +15 -0
- package/dist/emails/templates/index.d.ts.map +1 -0
- package/dist/emails/templates/index.js +58 -0
- package/dist/emails/templates/index.js.map +1 -0
- package/dist/emails/templates/order-cancelled.d.ts +30 -0
- package/dist/emails/templates/order-cancelled.d.ts.map +1 -0
- package/dist/emails/templates/order-cancelled.js +87 -0
- package/dist/emails/templates/order-cancelled.js.map +1 -0
- package/dist/emails/templates/order-confirmation.d.ts +36 -0
- package/dist/emails/templates/order-confirmation.d.ts.map +1 -0
- package/dist/emails/templates/order-confirmation.js +161 -0
- package/dist/emails/templates/order-confirmation.js.map +1 -0
- package/dist/emails/templates/order-delivered.d.ts +31 -0
- package/dist/emails/templates/order-delivered.d.ts.map +1 -0
- package/dist/emails/templates/order-delivered.js +95 -0
- package/dist/emails/templates/order-delivered.js.map +1 -0
- package/dist/emails/templates/order-shipped.d.ts +32 -0
- package/dist/emails/templates/order-shipped.d.ts.map +1 -0
- package/dist/emails/templates/order-shipped.js +87 -0
- package/dist/emails/templates/order-shipped.js.map +1 -0
- package/dist/emails/templates/password-reset.d.ts +27 -0
- package/dist/emails/templates/password-reset.d.ts.map +1 -0
- package/dist/emails/templates/password-reset.js +55 -0
- package/dist/emails/templates/password-reset.js.map +1 -0
- package/dist/emails/templates/refund-processed.d.ts +32 -0
- package/dist/emails/templates/refund-processed.d.ts.map +1 -0
- package/dist/emails/templates/refund-processed.js +96 -0
- package/dist/emails/templates/refund-processed.js.map +1 -0
- package/dist/emails/templates/welcome.d.ts +27 -0
- package/dist/emails/templates/welcome.d.ts.map +1 -0
- package/dist/emails/templates/welcome.js +56 -0
- package/dist/emails/templates/welcome.js.map +1 -0
- package/dist/emails/types.d.ts +202 -0
- package/dist/emails/types.d.ts.map +1 -0
- package/dist/emails/types.js +8 -0
- package/dist/emails/types.js.map +1 -0
- package/dist/emails/utils.d.ts +94 -0
- package/dist/emails/utils.d.ts.map +1 -0
- package/dist/emails/utils.js +229 -0
- package/dist/emails/utils.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +225 -0
- package/dist/index.js.map +1 -0
- package/dist/products/api/categories.d.ts +29 -0
- package/dist/products/api/categories.d.ts.map +1 -0
- package/dist/products/api/categories.js +49 -0
- package/dist/products/api/categories.js.map +1 -0
- package/dist/products/api/index.d.ts +24 -0
- package/dist/products/api/index.d.ts.map +1 -0
- package/dist/products/api/index.js +30 -0
- package/dist/products/api/index.js.map +1 -0
- package/dist/products/api/product.d.ts +36 -0
- package/dist/products/api/product.d.ts.map +1 -0
- package/dist/products/api/product.js +70 -0
- package/dist/products/api/product.js.map +1 -0
- package/dist/products/api/products.d.ts +41 -0
- package/dist/products/api/products.d.ts.map +1 -0
- package/dist/products/api/products.js +102 -0
- package/dist/products/api/products.js.map +1 -0
- package/dist/products/components/CategoryNav.d.ts +51 -0
- package/dist/products/components/CategoryNav.d.ts.map +1 -0
- package/dist/products/components/CategoryNav.js +115 -0
- package/dist/products/components/CategoryNav.js.map +1 -0
- package/dist/products/components/ProductBreadcrumb.d.ts +52 -0
- package/dist/products/components/ProductBreadcrumb.d.ts.map +1 -0
- package/dist/products/components/ProductBreadcrumb.js +78 -0
- package/dist/products/components/ProductBreadcrumb.js.map +1 -0
- package/dist/products/components/ProductCard.d.ts +54 -0
- package/dist/products/components/ProductCard.d.ts.map +1 -0
- package/dist/products/components/ProductCard.js +65 -0
- package/dist/products/components/ProductCard.js.map +1 -0
- package/dist/products/components/ProductDetails.d.ts +63 -0
- package/dist/products/components/ProductDetails.d.ts.map +1 -0
- package/dist/products/components/ProductDetails.js +105 -0
- package/dist/products/components/ProductDetails.js.map +1 -0
- package/dist/products/components/ProductFilters.d.ts +70 -0
- package/dist/products/components/ProductFilters.d.ts.map +1 -0
- package/dist/products/components/ProductFilters.js +127 -0
- package/dist/products/components/ProductFilters.js.map +1 -0
- package/dist/products/components/ProductGallery.d.ts +37 -0
- package/dist/products/components/ProductGallery.d.ts.map +1 -0
- package/dist/products/components/ProductGallery.js +80 -0
- package/dist/products/components/ProductGallery.js.map +1 -0
- package/dist/products/components/ProductGrid.d.ts +50 -0
- package/dist/products/components/ProductGrid.d.ts.map +1 -0
- package/dist/products/components/ProductGrid.js +83 -0
- package/dist/products/components/ProductGrid.js.map +1 -0
- package/dist/products/components/ProductSearch.d.ts +43 -0
- package/dist/products/components/ProductSearch.d.ts.map +1 -0
- package/dist/products/components/ProductSearch.js +99 -0
- package/dist/products/components/ProductSearch.js.map +1 -0
- package/dist/products/components/ProductSort.d.ts +43 -0
- package/dist/products/components/ProductSort.d.ts.map +1 -0
- package/dist/products/components/ProductSort.js +61 -0
- package/dist/products/components/ProductSort.js.map +1 -0
- package/dist/products/components/VariantSelector.d.ts +43 -0
- package/dist/products/components/VariantSelector.d.ts.map +1 -0
- package/dist/products/components/VariantSelector.js +147 -0
- package/dist/products/components/VariantSelector.js.map +1 -0
- package/dist/products/components/index.d.ts +26 -0
- package/dist/products/components/index.d.ts.map +1 -0
- package/dist/products/components/index.js +32 -0
- package/dist/products/components/index.js.map +1 -0
- package/dist/products/hooks/index.d.ts +14 -0
- package/dist/products/hooks/index.d.ts.map +1 -0
- package/dist/products/hooks/index.js +17 -0
- package/dist/products/hooks/index.js.map +1 -0
- package/dist/products/hooks/useCategories.d.ts +56 -0
- package/dist/products/hooks/useCategories.d.ts.map +1 -0
- package/dist/products/hooks/useCategories.js +126 -0
- package/dist/products/hooks/useCategories.js.map +1 -0
- package/dist/products/hooks/useProduct.d.ts +44 -0
- package/dist/products/hooks/useProduct.d.ts.map +1 -0
- package/dist/products/hooks/useProduct.js +86 -0
- package/dist/products/hooks/useProduct.js.map +1 -0
- package/dist/products/hooks/useProductAttributes.d.ts +59 -0
- package/dist/products/hooks/useProductAttributes.d.ts.map +1 -0
- package/dist/products/hooks/useProductAttributes.js +148 -0
- package/dist/products/hooks/useProductAttributes.js.map +1 -0
- package/dist/products/hooks/useProducts.d.ts +67 -0
- package/dist/products/hooks/useProducts.d.ts.map +1 -0
- package/dist/products/hooks/useProducts.js +132 -0
- package/dist/products/hooks/useProducts.js.map +1 -0
- package/dist/products/index.d.ts +94 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +123 -0
- package/dist/products/index.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +70 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +77 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/colors.d.ts +148 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +219 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/defaults.d.ts +212 -0
- package/dist/theme/defaults.d.ts.map +1 -0
- package/dist/theme/defaults.js +278 -0
- package/dist/theme/defaults.js.map +1 -0
- package/dist/theme/fonts.d.ts +59 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +202 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/generator.d.ts +50 -0
- package/dist/theme/generator.d.ts.map +1 -0
- package/dist/theme/generator.js +322 -0
- package/dist/theme/generator.js.map +1 -0
- package/dist/theme/hooks.d.ts +110 -0
- package/dist/theme/hooks.d.ts.map +1 -0
- package/dist/theme/hooks.js +106 -0
- package/dist/theme/hooks.js.map +1 -0
- package/dist/theme/index.d.ts +37 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +85 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/api/auth
|
|
4
|
+
*
|
|
5
|
+
* NextAuth route handler helper.
|
|
6
|
+
* Use this to create the [...nextauth] route handler.
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createAuthOptions = void 0;
|
|
13
|
+
exports.createAuthHandlers = createAuthHandlers;
|
|
14
|
+
const next_auth_1 = __importDefault(require("next-auth"));
|
|
15
|
+
const config_1 = require("../config");
|
|
16
|
+
/**
|
|
17
|
+
* Create NextAuth route handlers for Next.js App Router.
|
|
18
|
+
*
|
|
19
|
+
* @param options - Auth configuration options
|
|
20
|
+
* @returns GET and POST handlers for NextAuth
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // app/api/auth/[...nextauth]/route.ts
|
|
25
|
+
* import { createAuthHandlers } from '@rovela/sdk/auth'
|
|
26
|
+
*
|
|
27
|
+
* export const { GET, POST } = createAuthHandlers()
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // With custom options
|
|
33
|
+
* import { createAuthHandlers } from '@rovela/sdk/auth'
|
|
34
|
+
*
|
|
35
|
+
* export const { GET, POST } = createAuthHandlers({
|
|
36
|
+
* signInPage: '/login',
|
|
37
|
+
* requireEmailVerification: false,
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function createAuthHandlers(options = {}) {
|
|
42
|
+
const authOptions = (0, config_1.createAuthOptions)(options);
|
|
43
|
+
const handler = (0, next_auth_1.default)(authOptions);
|
|
44
|
+
return {
|
|
45
|
+
GET: handler,
|
|
46
|
+
POST: handler,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Export auth options creator for use with getServerSession.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // lib/auth.ts
|
|
55
|
+
* import { getServerSession } from 'next-auth'
|
|
56
|
+
* import { createAuthOptions } from '@rovela/sdk/auth'
|
|
57
|
+
*
|
|
58
|
+
* export const authOptions = createAuthOptions()
|
|
59
|
+
*
|
|
60
|
+
* export async function getSession() {
|
|
61
|
+
* return getServerSession(authOptions)
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
var config_2 = require("../config");
|
|
66
|
+
Object.defineProperty(exports, "createAuthOptions", { enumerable: true, get: function () { return config_2.createAuthOptions; } });
|
|
67
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/auth/api/auth.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AA+BH,gDAQC;AArCD,0DAAgC;AAChC,sCAA6C;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,kBAAkB,CAAC,UAA6B,EAAE;IAChE,MAAM,WAAW,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAA;IAC9C,MAAM,OAAO,GAAG,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAA;IAErC,OAAO;QACL,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,OAAO;KACd,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,oCAA6C;AAApC,2GAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth/api/forgot-password
|
|
3
|
+
*
|
|
4
|
+
* Forgot password (request reset) API route handler.
|
|
5
|
+
*/
|
|
6
|
+
import { NextResponse } from 'next/server';
|
|
7
|
+
import type { AuthApiError } from '../types';
|
|
8
|
+
interface ForgotPasswordResponse {
|
|
9
|
+
success: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* POST handler for requesting password reset.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // app/api/auth/forgot-password/route.ts
|
|
18
|
+
* export { POST } from '@rovela/sdk/auth/api'
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Request body
|
|
24
|
+
* { "email": "customer@example.com" }
|
|
25
|
+
*
|
|
26
|
+
* // Success response (200) - always returns success to prevent email enumeration
|
|
27
|
+
* {
|
|
28
|
+
* "success": true,
|
|
29
|
+
* "message": "If an account exists with this email, a password reset link has been sent."
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // Error response (400)
|
|
33
|
+
* {
|
|
34
|
+
* "error": "Please enter a valid email address",
|
|
35
|
+
* "code": "VALIDATION_ERROR"
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function POST(request: Request): Promise<NextResponse<ForgotPasswordResponse | AuthApiError>>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=forgot-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../src/auth/api/forgot-password.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAU5C,UAAU,sBAAsB;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,sBAAsB,GAAG,YAAY,CAAC,CAAC,CAkCzG"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/api/forgot-password
|
|
4
|
+
*
|
|
5
|
+
* Forgot password (request reset) API route handler.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.POST = POST;
|
|
9
|
+
const server_1 = require("next/server");
|
|
10
|
+
const password_reset_service_1 = require("../server/password-reset-service");
|
|
11
|
+
/**
|
|
12
|
+
* Validate email format.
|
|
13
|
+
*/
|
|
14
|
+
function isValidEmail(email) {
|
|
15
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
16
|
+
return emailRegex.test(email);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* POST handler for requesting password reset.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // app/api/auth/forgot-password/route.ts
|
|
24
|
+
* export { POST } from '@rovela/sdk/auth/api'
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Request body
|
|
30
|
+
* { "email": "customer@example.com" }
|
|
31
|
+
*
|
|
32
|
+
* // Success response (200) - always returns success to prevent email enumeration
|
|
33
|
+
* {
|
|
34
|
+
* "success": true,
|
|
35
|
+
* "message": "If an account exists with this email, a password reset link has been sent."
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* // Error response (400)
|
|
39
|
+
* {
|
|
40
|
+
* "error": "Please enter a valid email address",
|
|
41
|
+
* "code": "VALIDATION_ERROR"
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
async function POST(request) {
|
|
46
|
+
try {
|
|
47
|
+
const body = await request.json();
|
|
48
|
+
const email = body.email;
|
|
49
|
+
if (!email) {
|
|
50
|
+
return server_1.NextResponse.json({ error: 'Email is required', code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
51
|
+
}
|
|
52
|
+
if (!isValidEmail(email)) {
|
|
53
|
+
return server_1.NextResponse.json({ error: 'Please enter a valid email address', code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
54
|
+
}
|
|
55
|
+
// Request password reset - always returns success for security
|
|
56
|
+
await (0, password_reset_service_1.requestPasswordReset)(email);
|
|
57
|
+
// Always return success message to prevent email enumeration
|
|
58
|
+
return server_1.NextResponse.json({
|
|
59
|
+
success: true,
|
|
60
|
+
message: 'If an account exists with this email, a password reset link has been sent.',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error('[Auth Forgot Password] Error:', error);
|
|
65
|
+
return server_1.NextResponse.json({ error: 'Failed to process request. Please try again.', code: 'VALIDATION_ERROR' }, { status: 500 });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=forgot-password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgot-password.js","sourceRoot":"","sources":["../../../src/auth/api/forgot-password.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA8CH,oBAkCC;AA9ED,wCAA0C;AAC1C,6EAAuE;AAGvE;;GAEG;AACH,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,UAAU,GAAG,4BAA4B,CAAA;IAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,CAAC;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,IAAI,CAAC,OAAgB;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAA;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACxD,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,oCAAoC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACzE,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,+DAA+D;QAC/D,MAAM,IAAA,6CAAoB,EAAC,KAAK,CAAC,CAAA;QAEjC,6DAA6D;QAC7D,OAAO,qBAAY,CAAC,IAAI,CAAC;YACvB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,4EAA4E;SACtF,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;QACrD,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,8CAA8C,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACnF,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth/api
|
|
3
|
+
*
|
|
4
|
+
* API route handlers for authentication.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // app/api/auth/[...nextauth]/route.ts
|
|
9
|
+
* import { createAuthHandlers } from '@rovela/sdk/auth'
|
|
10
|
+
* export const { GET, POST } = createAuthHandlers()
|
|
11
|
+
*
|
|
12
|
+
* // app/api/auth/register/route.ts
|
|
13
|
+
* export { POST } from '@rovela/sdk/auth/api/register'
|
|
14
|
+
*
|
|
15
|
+
* // app/api/auth/verify-email/route.ts
|
|
16
|
+
* export { GET, POST } from '@rovela/sdk/auth/api/verify-email'
|
|
17
|
+
*
|
|
18
|
+
* // app/api/auth/resend-verification/route.ts
|
|
19
|
+
* export { POST } from '@rovela/sdk/auth/api/resend-verification'
|
|
20
|
+
*
|
|
21
|
+
* // app/api/auth/forgot-password/route.ts
|
|
22
|
+
* export { POST } from '@rovela/sdk/auth/api/forgot-password'
|
|
23
|
+
*
|
|
24
|
+
* // app/api/auth/reset-password/route.ts
|
|
25
|
+
* export { GET, POST } from '@rovela/sdk/auth/api/reset-password'
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export { createAuthHandlers, createAuthOptions } from './auth';
|
|
29
|
+
export { POST as registerPOST } from './register';
|
|
30
|
+
export { GET as verifyEmailGET, POST as verifyEmailPOST } from './verify-email';
|
|
31
|
+
export { POST as resendVerificationPOST } from './resend-verification';
|
|
32
|
+
export { POST as forgotPasswordPOST } from './forgot-password';
|
|
33
|
+
export { GET as resetPasswordGET, POST as resetPasswordPOST } from './reset-password';
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAG9D,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AAGjD,OAAO,EAAE,GAAG,IAAI,cAAc,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAG/E,OAAO,EAAE,IAAI,IAAI,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAGtE,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAG9D,OAAO,EAAE,GAAG,IAAI,gBAAgB,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/api
|
|
4
|
+
*
|
|
5
|
+
* API route handlers for authentication.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // app/api/auth/[...nextauth]/route.ts
|
|
10
|
+
* import { createAuthHandlers } from '@rovela/sdk/auth'
|
|
11
|
+
* export const { GET, POST } = createAuthHandlers()
|
|
12
|
+
*
|
|
13
|
+
* // app/api/auth/register/route.ts
|
|
14
|
+
* export { POST } from '@rovela/sdk/auth/api/register'
|
|
15
|
+
*
|
|
16
|
+
* // app/api/auth/verify-email/route.ts
|
|
17
|
+
* export { GET, POST } from '@rovela/sdk/auth/api/verify-email'
|
|
18
|
+
*
|
|
19
|
+
* // app/api/auth/resend-verification/route.ts
|
|
20
|
+
* export { POST } from '@rovela/sdk/auth/api/resend-verification'
|
|
21
|
+
*
|
|
22
|
+
* // app/api/auth/forgot-password/route.ts
|
|
23
|
+
* export { POST } from '@rovela/sdk/auth/api/forgot-password'
|
|
24
|
+
*
|
|
25
|
+
* // app/api/auth/reset-password/route.ts
|
|
26
|
+
* export { GET, POST } from '@rovela/sdk/auth/api/reset-password'
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.resetPasswordPOST = exports.resetPasswordGET = exports.forgotPasswordPOST = exports.resendVerificationPOST = exports.verifyEmailPOST = exports.verifyEmailGET = exports.registerPOST = exports.createAuthOptions = exports.createAuthHandlers = void 0;
|
|
31
|
+
// NextAuth handler
|
|
32
|
+
var auth_1 = require("./auth");
|
|
33
|
+
Object.defineProperty(exports, "createAuthHandlers", { enumerable: true, get: function () { return auth_1.createAuthHandlers; } });
|
|
34
|
+
Object.defineProperty(exports, "createAuthOptions", { enumerable: true, get: function () { return auth_1.createAuthOptions; } });
|
|
35
|
+
// Registration
|
|
36
|
+
var register_1 = require("./register");
|
|
37
|
+
Object.defineProperty(exports, "registerPOST", { enumerable: true, get: function () { return register_1.POST; } });
|
|
38
|
+
// Email verification
|
|
39
|
+
var verify_email_1 = require("./verify-email");
|
|
40
|
+
Object.defineProperty(exports, "verifyEmailGET", { enumerable: true, get: function () { return verify_email_1.GET; } });
|
|
41
|
+
Object.defineProperty(exports, "verifyEmailPOST", { enumerable: true, get: function () { return verify_email_1.POST; } });
|
|
42
|
+
// Resend verification
|
|
43
|
+
var resend_verification_1 = require("./resend-verification");
|
|
44
|
+
Object.defineProperty(exports, "resendVerificationPOST", { enumerable: true, get: function () { return resend_verification_1.POST; } });
|
|
45
|
+
// Password reset request
|
|
46
|
+
var forgot_password_1 = require("./forgot-password");
|
|
47
|
+
Object.defineProperty(exports, "forgotPasswordPOST", { enumerable: true, get: function () { return forgot_password_1.POST; } });
|
|
48
|
+
// Password reset execution
|
|
49
|
+
var reset_password_1 = require("./reset-password");
|
|
50
|
+
Object.defineProperty(exports, "resetPasswordGET", { enumerable: true, get: function () { return reset_password_1.GET; } });
|
|
51
|
+
Object.defineProperty(exports, "resetPasswordPOST", { enumerable: true, get: function () { return reset_password_1.POST; } });
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/api/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAEH,mBAAmB;AACnB,+BAA8D;AAArD,0GAAA,kBAAkB,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAE9C,eAAe;AACf,uCAAiD;AAAxC,wGAAA,IAAI,OAAgB;AAE7B,qBAAqB;AACrB,+CAA+E;AAAtE,8GAAA,GAAG,OAAkB;AAAE,+GAAA,IAAI,OAAmB;AAEvD,sBAAsB;AACtB,6DAAsE;AAA7D,6HAAA,IAAI,OAA0B;AAEvC,yBAAyB;AACzB,qDAA8D;AAArD,qHAAA,IAAI,OAAsB;AAEnC,2BAA2B;AAC3B,mDAAqF;AAA5E,kHAAA,GAAG,OAAoB;AAAE,mHAAA,IAAI,OAAqB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth/api/register
|
|
3
|
+
*
|
|
4
|
+
* Customer registration API route handler.
|
|
5
|
+
*/
|
|
6
|
+
import { NextResponse } from 'next/server';
|
|
7
|
+
import type { RegisterResponse, AuthApiError } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* POST handler for customer registration.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // app/api/auth/register/route.ts
|
|
14
|
+
* export { POST } from '@rovela/sdk/auth/api'
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // Request body
|
|
20
|
+
* {
|
|
21
|
+
* "email": "customer@example.com",
|
|
22
|
+
* "password": "securePassword123",
|
|
23
|
+
* "name": "John Doe" // optional
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // Success response (201)
|
|
27
|
+
* {
|
|
28
|
+
* "success": true,
|
|
29
|
+
* "customerId": "uuid",
|
|
30
|
+
* "message": "Account created. Please check your email to verify your account."
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* // Error response (400/409)
|
|
34
|
+
* {
|
|
35
|
+
* "error": "Error message",
|
|
36
|
+
* "code": "VALIDATION_ERROR" | "EMAIL_EXISTS"
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function POST(request: Request): Promise<NextResponse<RegisterResponse | AuthApiError>>;
|
|
41
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/auth/api/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK1C,OAAO,KAAK,EAAmB,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAU/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAqEnG"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/api/register
|
|
4
|
+
*
|
|
5
|
+
* Customer registration API route handler.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.POST = POST;
|
|
9
|
+
const server_1 = require("next/server");
|
|
10
|
+
const customer_service_1 = require("../server/customer-service");
|
|
11
|
+
const verification_service_1 = require("../server/verification-service");
|
|
12
|
+
const email_sender_1 = require("../server/email-sender");
|
|
13
|
+
const password_1 = require("../server/password");
|
|
14
|
+
/**
|
|
15
|
+
* Validate email format.
|
|
16
|
+
*/
|
|
17
|
+
function isValidEmail(email) {
|
|
18
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
19
|
+
return emailRegex.test(email);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* POST handler for customer registration.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // app/api/auth/register/route.ts
|
|
27
|
+
* export { POST } from '@rovela/sdk/auth/api'
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Request body
|
|
33
|
+
* {
|
|
34
|
+
* "email": "customer@example.com",
|
|
35
|
+
* "password": "securePassword123",
|
|
36
|
+
* "name": "John Doe" // optional
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* // Success response (201)
|
|
40
|
+
* {
|
|
41
|
+
* "success": true,
|
|
42
|
+
* "customerId": "uuid",
|
|
43
|
+
* "message": "Account created. Please check your email to verify your account."
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* // Error response (400/409)
|
|
47
|
+
* {
|
|
48
|
+
* "error": "Error message",
|
|
49
|
+
* "code": "VALIDATION_ERROR" | "EMAIL_EXISTS"
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
async function POST(request) {
|
|
54
|
+
try {
|
|
55
|
+
const body = await request.json();
|
|
56
|
+
// Validate required fields
|
|
57
|
+
if (!body.email || !body.password) {
|
|
58
|
+
return server_1.NextResponse.json({ error: 'Email and password are required', code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
59
|
+
}
|
|
60
|
+
// Validate email format
|
|
61
|
+
if (!isValidEmail(body.email)) {
|
|
62
|
+
return server_1.NextResponse.json({ error: 'Please enter a valid email address', code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
63
|
+
}
|
|
64
|
+
// Validate password
|
|
65
|
+
const passwordValidation = (0, password_1.validatePassword)(body.password);
|
|
66
|
+
if (!passwordValidation.valid) {
|
|
67
|
+
return server_1.NextResponse.json({ error: passwordValidation.error, code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
68
|
+
}
|
|
69
|
+
// Create customer
|
|
70
|
+
const { customer } = await (0, customer_service_1.createCustomer)(body.email, body.password, body.name);
|
|
71
|
+
// Create verification token
|
|
72
|
+
const token = await (0, verification_service_1.createVerificationToken)(customer.id);
|
|
73
|
+
// Send verification email (async, don't wait)
|
|
74
|
+
const storeName = (0, email_sender_1.getStoreName)();
|
|
75
|
+
(0, email_sender_1.sendVerificationEmail)(body.email, token, storeName).catch((err) => {
|
|
76
|
+
console.error('[Auth Register] Failed to send verification email:', err);
|
|
77
|
+
});
|
|
78
|
+
return server_1.NextResponse.json({
|
|
79
|
+
success: true,
|
|
80
|
+
customerId: customer.id,
|
|
81
|
+
message: 'Account created. Please check your email to verify your account.',
|
|
82
|
+
}, { status: 201 });
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('[Auth Register] Error:', error);
|
|
86
|
+
// Handle duplicate email
|
|
87
|
+
if (error instanceof Error && error.message.includes('already exists')) {
|
|
88
|
+
return server_1.NextResponse.json({ error: 'An account with this email already exists', code: 'EMAIL_EXISTS' }, { status: 409 });
|
|
89
|
+
}
|
|
90
|
+
return server_1.NextResponse.json({ error: 'Failed to create account. Please try again.', code: 'VALIDATION_ERROR' }, { status: 500 });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/auth/api/register.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAiDH,oBAqEC;AApHD,wCAA0C;AAC1C,iEAA2D;AAC3D,yEAAwE;AACxE,yDAA4E;AAC5E,iDAAqD;AAGrD;;GAEG;AACH,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,UAAU,GAAG,4BAA4B,CAAA;IAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACI,KAAK,UAAU,IAAI,CAAC,OAAgB;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAqB,CAAA;QAEpD,2BAA2B;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,iCAAiC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACtE,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,wBAAwB;QACxB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,oCAAoC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACzE,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,oBAAoB;QACpB,MAAM,kBAAkB,GAAG,IAAA,2BAAgB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC1D,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;YAC9B,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,kBAAkB,CAAC,KAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAC9D,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,kBAAkB;QAClB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,iCAAc,EACvC,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,IAAI,CACV,CAAA;QAED,4BAA4B;QAC5B,MAAM,KAAK,GAAG,MAAM,IAAA,8CAAuB,EAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAExD,8CAA8C;QAC9C,MAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAA;QAChC,IAAA,oCAAqB,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAChE,OAAO,CAAC,KAAK,CAAC,oDAAoD,EAAE,GAAG,CAAC,CAAA;QAC1E,CAAC,CAAC,CAAA;QAEF,OAAO,qBAAY,CAAC,IAAI,CACtB;YACE,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,QAAQ,CAAC,EAAE;YACvB,OAAO,EAAE,kEAAkE;SAC5E,EACD,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAA;QAE9C,yBAAyB;QACzB,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACvE,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,2CAA2C,EAAE,IAAI,EAAE,cAAc,EAAE,EAC5E,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,6CAA6C,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAClF,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth/api/resend-verification
|
|
3
|
+
*
|
|
4
|
+
* Resend verification email API route handler.
|
|
5
|
+
*/
|
|
6
|
+
import { NextResponse } from 'next/server';
|
|
7
|
+
import type { AuthApiError } from '../types';
|
|
8
|
+
interface ResendVerificationResponse {
|
|
9
|
+
success: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* POST handler for resending verification email.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // app/api/auth/resend-verification/route.ts
|
|
18
|
+
* export { POST } from '@rovela/sdk/auth/api'
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Request body
|
|
24
|
+
* { "email": "customer@example.com" }
|
|
25
|
+
*
|
|
26
|
+
* // Success response (200)
|
|
27
|
+
* {
|
|
28
|
+
* "success": true,
|
|
29
|
+
* "message": "If an account exists with this email, a verification link has been sent."
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // Error response (400)
|
|
33
|
+
* {
|
|
34
|
+
* "error": "Email is already verified",
|
|
35
|
+
* "code": "VALIDATION_ERROR"
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function POST(request: Request): Promise<NextResponse<ResendVerificationResponse | AuthApiError>>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=resend-verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resend-verification.d.ts","sourceRoot":"","sources":["../../../src/auth/api/resend-verification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAU5C,UAAU,0BAA0B;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,0BAA0B,GAAG,YAAY,CAAC,CAAC,CAyC7G"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/api/resend-verification
|
|
4
|
+
*
|
|
5
|
+
* Resend verification email API route handler.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.POST = POST;
|
|
9
|
+
const server_1 = require("next/server");
|
|
10
|
+
const verification_service_1 = require("../server/verification-service");
|
|
11
|
+
/**
|
|
12
|
+
* Validate email format.
|
|
13
|
+
*/
|
|
14
|
+
function isValidEmail(email) {
|
|
15
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
16
|
+
return emailRegex.test(email);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* POST handler for resending verification email.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // app/api/auth/resend-verification/route.ts
|
|
24
|
+
* export { POST } from '@rovela/sdk/auth/api'
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Request body
|
|
30
|
+
* { "email": "customer@example.com" }
|
|
31
|
+
*
|
|
32
|
+
* // Success response (200)
|
|
33
|
+
* {
|
|
34
|
+
* "success": true,
|
|
35
|
+
* "message": "If an account exists with this email, a verification link has been sent."
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* // Error response (400)
|
|
39
|
+
* {
|
|
40
|
+
* "error": "Email is already verified",
|
|
41
|
+
* "code": "VALIDATION_ERROR"
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
async function POST(request) {
|
|
46
|
+
try {
|
|
47
|
+
const body = await request.json();
|
|
48
|
+
const email = body.email;
|
|
49
|
+
if (!email) {
|
|
50
|
+
return server_1.NextResponse.json({ error: 'Email is required', code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
51
|
+
}
|
|
52
|
+
if (!isValidEmail(email)) {
|
|
53
|
+
return server_1.NextResponse.json({ error: 'Please enter a valid email address', code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
54
|
+
}
|
|
55
|
+
const result = await (0, verification_service_1.resendVerificationEmail)(email);
|
|
56
|
+
// If already verified, return error
|
|
57
|
+
if (!result.success && result.error?.includes('already verified')) {
|
|
58
|
+
return server_1.NextResponse.json({ error: result.error, code: 'VALIDATION_ERROR' }, { status: 400 });
|
|
59
|
+
}
|
|
60
|
+
// Always return success message to prevent email enumeration
|
|
61
|
+
return server_1.NextResponse.json({
|
|
62
|
+
success: true,
|
|
63
|
+
message: 'If an account exists with this email, a verification link has been sent.',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error('[Auth Resend Verification] Error:', error);
|
|
68
|
+
return server_1.NextResponse.json({ error: 'Failed to send verification email. Please try again.', code: 'VALIDATION_ERROR' }, { status: 500 });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=resend-verification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resend-verification.js","sourceRoot":"","sources":["../../../src/auth/api/resend-verification.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA8CH,oBAyCC;AArFD,wCAA0C;AAC1C,yEAAwE;AAGxE;;GAEG;AACH,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,UAAU,GAAG,4BAA4B,CAAA;IAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,CAAC;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,IAAI,CAAC,OAAgB;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAA;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACxD,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,oCAAoC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACzE,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAA,8CAAuB,EAAC,KAAK,CAAC,CAAA;QAEnD,oCAAoC;QACpC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAClE,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACjD,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;QACH,CAAC;QAED,6DAA6D;QAC7D,OAAO,qBAAY,CAAC,IAAI,CAAC;YACvB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,0EAA0E;SACpF,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAA;QACzD,OAAO,qBAAY,CAAC,IAAI,CACtB,EAAE,KAAK,EAAE,sDAAsD,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAC3F,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth/api/reset-password
|
|
3
|
+
*
|
|
4
|
+
* Reset password API route handler.
|
|
5
|
+
*/
|
|
6
|
+
import { NextResponse } from 'next/server';
|
|
7
|
+
import type { AuthApiError } from '../types';
|
|
8
|
+
interface ValidateTokenResponse {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ResetPasswordResponse {
|
|
13
|
+
success: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* GET handler for validating reset token.
|
|
18
|
+
* Use this to check if token is valid before showing the reset form.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // app/api/auth/reset-password/route.ts
|
|
23
|
+
* export { GET, POST } from '@rovela/sdk/auth/api'
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Request: GET /api/auth/reset-password?token=abc123
|
|
29
|
+
*
|
|
30
|
+
* // Success response (200)
|
|
31
|
+
* { "valid": true }
|
|
32
|
+
*
|
|
33
|
+
* // Error response (400)
|
|
34
|
+
* {
|
|
35
|
+
* "valid": false,
|
|
36
|
+
* "error": "Reset link has expired. Please request a new one."
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function GET(request: Request): Promise<NextResponse<ValidateTokenResponse>>;
|
|
41
|
+
/**
|
|
42
|
+
* POST handler for resetting password.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* // Request body
|
|
47
|
+
* {
|
|
48
|
+
* "token": "abc123",
|
|
49
|
+
* "password": "newSecurePassword123"
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* // Success response (200)
|
|
53
|
+
* {
|
|
54
|
+
* "success": true,
|
|
55
|
+
* "message": "Password reset successfully. You can now sign in with your new password."
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* // Error response (400)
|
|
59
|
+
* {
|
|
60
|
+
* "error": "Reset link has expired. Please request a new one.",
|
|
61
|
+
* "code": "TOKEN_EXPIRED"
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function POST(request: Request): Promise<NextResponse<ResetPasswordResponse | AuthApiError>>;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=reset-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../src/auth/api/reset-password.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,CA6BxF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,qBAAqB,GAAG,YAAY,CAAC,CAAC,CAkDxG"}
|