@rovela-ai/sdk 0.1.1 → 0.1.2
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/hooks/useAdminAuth.d.ts.map +1 -1
- package/dist/admin/hooks/useAdminAuth.js +4 -1
- package/dist/admin/hooks/useAdminAuth.js.map +1 -1
- package/dist/auth/hooks/useAuth.d.ts.map +1 -1
- package/dist/auth/hooks/useAuth.js +8 -2
- package/dist/auth/hooks/useAuth.js.map +1 -1
- package/package.json +1 -1
- package/dist/admin/api/auth.d.ts +0 -32
- package/dist/admin/api/auth.d.ts.map +0 -1
- package/dist/admin/api/auth.js +0 -43
- package/dist/admin/api/auth.js.map +0 -1
- package/dist/admin/api/categories.d.ts +0 -68
- package/dist/admin/api/categories.d.ts.map +0 -1
- package/dist/admin/api/categories.js +0 -247
- package/dist/admin/api/categories.js.map +0 -1
- package/dist/admin/api/customers.d.ts +0 -41
- package/dist/admin/api/customers.d.ts.map +0 -1
- package/dist/admin/api/customers.js +0 -113
- package/dist/admin/api/customers.js.map +0 -1
- package/dist/admin/api/index.d.ts +0 -56
- package/dist/admin/api/index.d.ts.map +0 -1
- package/dist/admin/api/index.js +0 -87
- package/dist/admin/api/index.js.map +0 -1
- package/dist/admin/api/orders.d.ts +0 -59
- package/dist/admin/api/orders.d.ts.map +0 -1
- package/dist/admin/api/orders.js +0 -209
- package/dist/admin/api/orders.js.map +0 -1
- package/dist/admin/api/products.d.ts +0 -103
- package/dist/admin/api/products.d.ts.map +0 -1
- package/dist/admin/api/products.js +0 -329
- package/dist/admin/api/products.js.map +0 -1
- package/dist/admin/api/refund.d.ts +0 -29
- package/dist/admin/api/refund.d.ts.map +0 -1
- package/dist/admin/api/refund.js +0 -136
- package/dist/admin/api/refund.js.map +0 -1
- package/dist/admin/api/stats.d.ts +0 -40
- package/dist/admin/api/stats.d.ts.map +0 -1
- package/dist/admin/api/stats.js +0 -74
- package/dist/admin/api/stats.js.map +0 -1
- package/dist/admin/components/AdminGuard.d.ts +0 -40
- package/dist/admin/components/AdminGuard.d.ts.map +0 -1
- package/dist/admin/components/AdminGuard.js +0 -97
- package/dist/admin/components/AdminGuard.js.map +0 -1
- package/dist/admin/components/AdminHeader.d.ts +0 -18
- package/dist/admin/components/AdminHeader.d.ts.map +0 -1
- package/dist/admin/components/AdminHeader.js +0 -33
- package/dist/admin/components/AdminHeader.js.map +0 -1
- package/dist/admin/components/AdminLayout.d.ts +0 -50
- package/dist/admin/components/AdminLayout.d.ts.map +0 -1
- package/dist/admin/components/AdminLayout.js +0 -46
- package/dist/admin/components/AdminLayout.js.map +0 -1
- package/dist/admin/components/AdminLoginForm.d.ts +0 -18
- package/dist/admin/components/AdminLoginForm.d.ts.map +0 -1
- package/dist/admin/components/AdminLoginForm.js +0 -58
- package/dist/admin/components/AdminLoginForm.js.map +0 -1
- package/dist/admin/components/AdminNav.d.ts +0 -34
- package/dist/admin/components/AdminNav.d.ts.map +0 -1
- package/dist/admin/components/AdminNav.js +0 -61
- package/dist/admin/components/AdminNav.js.map +0 -1
- package/dist/admin/components/InventoryEditor.d.ts +0 -15
- package/dist/admin/components/InventoryEditor.d.ts.map +0 -1
- package/dist/admin/components/InventoryEditor.js +0 -83
- package/dist/admin/components/InventoryEditor.js.map +0 -1
- package/dist/admin/components/LowStockAlert.d.ts +0 -11
- package/dist/admin/components/LowStockAlert.d.ts.map +0 -1
- package/dist/admin/components/LowStockAlert.js +0 -35
- package/dist/admin/components/LowStockAlert.js.map +0 -1
- package/dist/admin/components/OrderDetails.d.ts +0 -14
- package/dist/admin/components/OrderDetails.d.ts.map +0 -1
- package/dist/admin/components/OrderDetails.js +0 -94
- package/dist/admin/components/OrderDetails.js.map +0 -1
- package/dist/admin/components/OrderTable.d.ts +0 -13
- package/dist/admin/components/OrderTable.d.ts.map +0 -1
- package/dist/admin/components/OrderTable.js +0 -89
- package/dist/admin/components/OrderTable.js.map +0 -1
- package/dist/admin/components/ProductForm.d.ts +0 -18
- package/dist/admin/components/ProductForm.d.ts.map +0 -1
- package/dist/admin/components/ProductForm.js +0 -127
- package/dist/admin/components/ProductForm.js.map +0 -1
- package/dist/admin/components/ProductTable.d.ts +0 -13
- package/dist/admin/components/ProductTable.d.ts.map +0 -1
- package/dist/admin/components/ProductTable.js +0 -81
- package/dist/admin/components/ProductTable.js.map +0 -1
- package/dist/admin/components/RecentOrders.d.ts +0 -11
- package/dist/admin/components/RecentOrders.d.ts.map +0 -1
- package/dist/admin/components/RecentOrders.js +0 -58
- package/dist/admin/components/RecentOrders.js.map +0 -1
- package/dist/admin/components/RefundDialog.d.ts +0 -17
- package/dist/admin/components/RefundDialog.d.ts.map +0 -1
- package/dist/admin/components/RefundDialog.js +0 -86
- package/dist/admin/components/RefundDialog.js.map +0 -1
- package/dist/admin/components/StatsCards.d.ts +0 -23
- package/dist/admin/components/StatsCards.d.ts.map +0 -1
- package/dist/admin/components/StatsCards.js +0 -82
- package/dist/admin/components/StatsCards.js.map +0 -1
- package/dist/admin/components/StoreSettings.d.ts +0 -14
- package/dist/admin/components/StoreSettings.d.ts.map +0 -1
- package/dist/admin/components/StoreSettings.js +0 -88
- package/dist/admin/components/StoreSettings.js.map +0 -1
- package/dist/admin/components/index.d.ts +0 -21
- package/dist/admin/components/index.d.ts.map +0 -1
- package/dist/admin/components/index.js +0 -57
- package/dist/admin/components/index.js.map +0 -1
- package/dist/admin/config.d.ts +0 -74
- package/dist/admin/config.d.ts.map +0 -1
- package/dist/admin/config.js +0 -229
- package/dist/admin/config.js.map +0 -1
- package/dist/admin/hooks/index.d.ts +0 -10
- package/dist/admin/hooks/index.d.ts.map +0 -1
- package/dist/admin/hooks/index.js +0 -17
- package/dist/admin/hooks/index.js.map +0 -1
- package/dist/admin/hooks/useAdminOrders.d.ts +0 -41
- package/dist/admin/hooks/useAdminOrders.d.ts.map +0 -1
- package/dist/admin/hooks/useAdminOrders.js +0 -191
- package/dist/admin/hooks/useAdminOrders.js.map +0 -1
- package/dist/admin/hooks/useAdminProducts.d.ts +0 -39
- package/dist/admin/hooks/useAdminProducts.d.ts.map +0 -1
- package/dist/admin/hooks/useAdminProducts.js +0 -235
- package/dist/admin/hooks/useAdminProducts.js.map +0 -1
- package/dist/admin/hooks/useAdminStats.d.ts +0 -50
- package/dist/admin/hooks/useAdminStats.d.ts.map +0 -1
- package/dist/admin/hooks/useAdminStats.js +0 -111
- package/dist/admin/hooks/useAdminStats.js.map +0 -1
- package/dist/admin/index.d.ts +0 -63
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/index.js +0 -148
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/server/admin-service.d.ts +0 -130
- package/dist/admin/server/admin-service.d.ts.map +0 -1
- package/dist/admin/server/admin-service.js +0 -298
- package/dist/admin/server/admin-service.js.map +0 -1
- package/dist/admin/server/index.d.ts +0 -8
- package/dist/admin/server/index.d.ts.map +0 -1
- package/dist/admin/server/index.js +0 -25
- package/dist/admin/server/index.js.map +0 -1
- package/dist/admin/types.d.ts +0 -549
- package/dist/admin/types.d.ts.map +0 -1
- package/dist/admin/types.js +0 -11
- package/dist/admin/types.js.map +0 -1
- package/dist/auth/api/auth.d.ts +0 -54
- package/dist/auth/api/auth.d.ts.map +0 -1
- package/dist/auth/api/auth.js +0 -67
- package/dist/auth/api/auth.js.map +0 -1
- package/dist/auth/api/forgot-password.d.ts +0 -41
- package/dist/auth/api/forgot-password.d.ts.map +0 -1
- package/dist/auth/api/forgot-password.js +0 -68
- package/dist/auth/api/forgot-password.js.map +0 -1
- package/dist/auth/api/index.d.ts +0 -34
- package/dist/auth/api/index.d.ts.map +0 -1
- package/dist/auth/api/index.js +0 -52
- package/dist/auth/api/index.js.map +0 -1
- package/dist/auth/api/register.d.ts +0 -41
- package/dist/auth/api/register.d.ts.map +0 -1
- package/dist/auth/api/register.js +0 -93
- package/dist/auth/api/register.js.map +0 -1
- package/dist/auth/api/resend-verification.d.ts +0 -41
- package/dist/auth/api/resend-verification.d.ts.map +0 -1
- package/dist/auth/api/resend-verification.js +0 -71
- package/dist/auth/api/resend-verification.js.map +0 -1
- package/dist/auth/api/reset-password.d.ts +0 -67
- package/dist/auth/api/reset-password.d.ts.map +0 -1
- package/dist/auth/api/reset-password.js +0 -110
- package/dist/auth/api/reset-password.js.map +0 -1
- package/dist/auth/api/verify-email.d.ts +0 -47
- package/dist/auth/api/verify-email.d.ts.map +0 -1
- package/dist/auth/api/verify-email.js +0 -94
- package/dist/auth/api/verify-email.js.map +0 -1
- package/dist/auth/components/AuthGuard.d.ts +0 -52
- package/dist/auth/components/AuthGuard.d.ts.map +0 -1
- package/dist/auth/components/AuthGuard.js +0 -113
- package/dist/auth/components/AuthGuard.js.map +0 -1
- package/dist/auth/components/ForgotPasswordForm.d.ts +0 -15
- package/dist/auth/components/ForgotPasswordForm.d.ts.map +0 -1
- package/dist/auth/components/ForgotPasswordForm.js +0 -44
- package/dist/auth/components/ForgotPasswordForm.js.map +0 -1
- package/dist/auth/components/ResetPasswordForm.d.ts +0 -18
- package/dist/auth/components/ResetPasswordForm.d.ts.map +0 -1
- package/dist/auth/components/ResetPasswordForm.js +0 -88
- package/dist/auth/components/ResetPasswordForm.js.map +0 -1
- package/dist/auth/components/SignInForm.d.ts +0 -21
- package/dist/auth/components/SignInForm.d.ts.map +0 -1
- package/dist/auth/components/SignInForm.js +0 -63
- package/dist/auth/components/SignInForm.js.map +0 -1
- package/dist/auth/components/SignUpForm.d.ts +0 -18
- package/dist/auth/components/SignUpForm.d.ts.map +0 -1
- package/dist/auth/components/SignUpForm.js +0 -79
- package/dist/auth/components/SignUpForm.js.map +0 -1
- package/dist/auth/components/UserMenu.d.ts +0 -18
- package/dist/auth/components/UserMenu.d.ts.map +0 -1
- package/dist/auth/components/UserMenu.js +0 -75
- package/dist/auth/components/UserMenu.js.map +0 -1
- package/dist/auth/components/VerifyEmailNotice.d.ts +0 -20
- package/dist/auth/components/VerifyEmailNotice.d.ts.map +0 -1
- package/dist/auth/components/VerifyEmailNotice.js +0 -59
- package/dist/auth/components/VerifyEmailNotice.js.map +0 -1
- package/dist/auth/components/index.d.ts +0 -13
- package/dist/auth/components/index.d.ts.map +0 -1
- package/dist/auth/components/index.js +0 -24
- package/dist/auth/components/index.js.map +0 -1
- package/dist/auth/config.d.ts +0 -42
- package/dist/auth/config.d.ts.map +0 -1
- package/dist/auth/config.js +0 -174
- package/dist/auth/config.js.map +0 -1
- package/dist/auth/hooks/index.d.ts +0 -7
- package/dist/auth/hooks/index.d.ts.map +0 -1
- package/dist/auth/hooks/index.js +0 -11
- package/dist/auth/hooks/index.js.map +0 -1
- package/dist/auth/index.d.ts +0 -54
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -88
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/server/customer-service.d.ts +0 -138
- package/dist/auth/server/customer-service.d.ts.map +0 -1
- package/dist/auth/server/customer-service.js +0 -309
- package/dist/auth/server/customer-service.js.map +0 -1
- package/dist/auth/server/email-sender.d.ts +0 -64
- package/dist/auth/server/email-sender.d.ts.map +0 -1
- package/dist/auth/server/email-sender.js +0 -112
- package/dist/auth/server/email-sender.js.map +0 -1
- package/dist/auth/server/index.d.ts +0 -13
- package/dist/auth/server/index.d.ts.map +0 -1
- package/dist/auth/server/index.js +0 -48
- package/dist/auth/server/index.js.map +0 -1
- package/dist/auth/server/password-reset-service.d.ts +0 -86
- package/dist/auth/server/password-reset-service.d.ts.map +0 -1
- package/dist/auth/server/password-reset-service.js +0 -236
- package/dist/auth/server/password-reset-service.js.map +0 -1
- package/dist/auth/server/password.d.ts +0 -58
- package/dist/auth/server/password.d.ts.map +0 -1
- package/dist/auth/server/password.js +0 -94
- package/dist/auth/server/password.js.map +0 -1
- package/dist/auth/server/verification-service.d.ts +0 -87
- package/dist/auth/server/verification-service.d.ts.map +0 -1
- package/dist/auth/server/verification-service.js +0 -268
- package/dist/auth/server/verification-service.js.map +0 -1
- package/dist/auth/types.d.ts +0 -305
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -8
- package/dist/auth/types.js.map +0 -1
- package/dist/cart/CartProvider.d.ts +0 -65
- package/dist/cart/CartProvider.d.ts.map +0 -1
- package/dist/cart/CartProvider.js +0 -101
- package/dist/cart/CartProvider.js.map +0 -1
- package/dist/cart/components/AddToCartButton.d.ts +0 -77
- package/dist/cart/components/AddToCartButton.d.ts.map +0 -1
- package/dist/cart/components/AddToCartButton.js +0 -124
- package/dist/cart/components/AddToCartButton.js.map +0 -1
- package/dist/cart/components/CartDrawer.d.ts +0 -71
- package/dist/cart/components/CartDrawer.d.ts.map +0 -1
- package/dist/cart/components/CartDrawer.js +0 -108
- package/dist/cart/components/CartDrawer.js.map +0 -1
- package/dist/cart/components/CartIcon.d.ts +0 -36
- package/dist/cart/components/CartIcon.d.ts.map +0 -1
- package/dist/cart/components/CartIcon.js +0 -70
- package/dist/cart/components/CartIcon.js.map +0 -1
- package/dist/cart/components/CartItem.d.ts +0 -52
- package/dist/cart/components/CartItem.d.ts.map +0 -1
- package/dist/cart/components/CartItem.js +0 -55
- package/dist/cart/components/CartItem.js.map +0 -1
- package/dist/cart/components/CartSummary.d.ts +0 -43
- package/dist/cart/components/CartSummary.d.ts.map +0 -1
- package/dist/cart/components/CartSummary.js +0 -58
- package/dist/cart/components/CartSummary.js.map +0 -1
- package/dist/cart/components/QuantitySelector.d.ts +0 -39
- package/dist/cart/components/QuantitySelector.d.ts.map +0 -1
- package/dist/cart/components/QuantitySelector.js +0 -87
- package/dist/cart/components/QuantitySelector.js.map +0 -1
- package/dist/cart/components/index.d.ts +0 -18
- package/dist/cart/components/index.d.ts.map +0 -1
- package/dist/cart/components/index.js +0 -21
- package/dist/cart/components/index.js.map +0 -1
- package/dist/cart/index.d.ts +0 -109
- package/dist/cart/index.d.ts.map +0 -1
- package/dist/cart/index.js +0 -129
- package/dist/cart/index.js.map +0 -1
- package/dist/cart/store.d.ts +0 -101
- package/dist/cart/store.d.ts.map +0 -1
- package/dist/cart/store.js +0 -207
- package/dist/cart/store.js.map +0 -1
- package/dist/checkout/api/checkout.d.ts +0 -31
- package/dist/checkout/api/checkout.d.ts.map +0 -1
- package/dist/checkout/api/checkout.js +0 -103
- package/dist/checkout/api/checkout.js.map +0 -1
- package/dist/checkout/api/index.d.ts +0 -8
- package/dist/checkout/api/index.d.ts.map +0 -1
- package/dist/checkout/api/index.js +0 -13
- package/dist/checkout/api/index.js.map +0 -1
- package/dist/checkout/api/webhook.d.ts +0 -30
- package/dist/checkout/api/webhook.d.ts.map +0 -1
- package/dist/checkout/api/webhook.js +0 -58
- package/dist/checkout/api/webhook.js.map +0 -1
- package/dist/checkout/components/CheckoutButton.d.ts +0 -44
- package/dist/checkout/components/CheckoutButton.d.ts.map +0 -1
- package/dist/checkout/components/CheckoutButton.js +0 -97
- package/dist/checkout/components/CheckoutButton.js.map +0 -1
- package/dist/checkout/components/CheckoutSuccess.d.ts +0 -29
- package/dist/checkout/components/CheckoutSuccess.d.ts.map +0 -1
- package/dist/checkout/components/CheckoutSuccess.js +0 -60
- package/dist/checkout/components/CheckoutSuccess.js.map +0 -1
- package/dist/checkout/components/OrderSummary.d.ts +0 -37
- package/dist/checkout/components/OrderSummary.d.ts.map +0 -1
- package/dist/checkout/components/OrderSummary.js +0 -70
- package/dist/checkout/components/OrderSummary.js.map +0 -1
- package/dist/checkout/components/ShippingForm.d.ts +0 -30
- package/dist/checkout/components/ShippingForm.d.ts.map +0 -1
- package/dist/checkout/components/ShippingForm.js +0 -125
- package/dist/checkout/components/ShippingForm.js.map +0 -1
- package/dist/checkout/components/index.d.ts +0 -10
- package/dist/checkout/components/index.d.ts.map +0 -1
- package/dist/checkout/components/index.js +0 -17
- package/dist/checkout/components/index.js.map +0 -1
- package/dist/checkout/hooks/index.d.ts +0 -7
- package/dist/checkout/hooks/index.d.ts.map +0 -1
- package/dist/checkout/hooks/index.js +0 -12
- package/dist/checkout/hooks/index.js.map +0 -1
- package/dist/checkout/hooks/useCheckout.d.ts +0 -61
- package/dist/checkout/hooks/useCheckout.d.ts.map +0 -1
- package/dist/checkout/hooks/useCheckout.js +0 -174
- package/dist/checkout/hooks/useCheckout.js.map +0 -1
- package/dist/checkout/index.d.ts +0 -111
- package/dist/checkout/index.d.ts.map +0 -1
- package/dist/checkout/index.js +0 -148
- package/dist/checkout/index.js.map +0 -1
- package/dist/checkout/server/create-checkout-session.d.ts +0 -69
- package/dist/checkout/server/create-checkout-session.d.ts.map +0 -1
- package/dist/checkout/server/create-checkout-session.js +0 -190
- package/dist/checkout/server/create-checkout-session.js.map +0 -1
- package/dist/checkout/server/handle-webhook.d.ts +0 -35
- package/dist/checkout/server/handle-webhook.d.ts.map +0 -1
- package/dist/checkout/server/handle-webhook.js +0 -279
- package/dist/checkout/server/handle-webhook.js.map +0 -1
- package/dist/checkout/server/index.d.ts +0 -10
- package/dist/checkout/server/index.d.ts.map +0 -1
- package/dist/checkout/server/index.js +0 -19
- package/dist/checkout/server/index.js.map +0 -1
- package/dist/checkout/server/order-service.d.ts +0 -43
- package/dist/checkout/server/order-service.d.ts.map +0 -1
- package/dist/checkout/server/order-service.js +0 -196
- package/dist/checkout/server/order-service.js.map +0 -1
- package/dist/checkout/stripe/client.d.ts +0 -72
- package/dist/checkout/stripe/client.d.ts.map +0 -1
- package/dist/checkout/stripe/client.js +0 -189
- package/dist/checkout/stripe/client.js.map +0 -1
- package/dist/checkout/stripe/index.d.ts +0 -7
- package/dist/checkout/stripe/index.d.ts.map +0 -1
- package/dist/checkout/stripe/index.js +0 -21
- package/dist/checkout/stripe/index.js.map +0 -1
- package/dist/checkout/types.d.ts +0 -263
- package/dist/checkout/types.d.ts.map +0 -1
- package/dist/checkout/types.js +0 -9
- package/dist/checkout/types.js.map +0 -1
- package/dist/core/config.d.ts +0 -296
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js +0 -162
- package/dist/core/config.js.map +0 -1
- package/dist/core/db/client.d.ts +0 -69
- package/dist/core/db/client.d.ts.map +0 -1
- package/dist/core/db/client.js +0 -202
- package/dist/core/db/client.js.map +0 -1
- package/dist/core/db/index.d.ts +0 -11
- package/dist/core/db/index.d.ts.map +0 -1
- package/dist/core/db/index.js +0 -87
- package/dist/core/db/index.js.map +0 -1
- package/dist/core/db/queries.d.ts +0 -658
- package/dist/core/db/queries.d.ts.map +0 -1
- package/dist/core/db/queries.js +0 -735
- package/dist/core/db/queries.js.map +0 -1
- package/dist/core/db/schema.d.ts +0 -1628
- package/dist/core/db/schema.d.ts.map +0 -1
- package/dist/core/db/schema.js +0 -262
- package/dist/core/db/schema.js.map +0 -1
- package/dist/core/index.d.ts +0 -20
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -71
- package/dist/core/index.js.map +0 -1
- package/dist/core/server/index.d.ts +0 -17
- package/dist/core/server/index.d.ts.map +0 -1
- package/dist/core/server/index.js +0 -68
- package/dist/core/server/index.js.map +0 -1
- package/dist/core/types.d.ts +0 -230
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -9
- package/dist/core/types.js.map +0 -1
- package/dist/core/utils.d.ts +0 -153
- package/dist/core/utils.d.ts.map +0 -1
- package/dist/core/utils.js +0 -356
- package/dist/core/utils.js.map +0 -1
- package/dist/emails/config.d.ts +0 -42
- package/dist/emails/config.d.ts.map +0 -1
- package/dist/emails/config.js +0 -89
- package/dist/emails/config.js.map +0 -1
- package/dist/emails/index.d.ts +0 -85
- package/dist/emails/index.d.ts.map +0 -1
- package/dist/emails/index.js +0 -170
- package/dist/emails/index.js.map +0 -1
- package/dist/emails/send/auth.d.ts +0 -91
- package/dist/emails/send/auth.d.ts.map +0 -1
- package/dist/emails/send/auth.js +0 -132
- package/dist/emails/send/auth.js.map +0 -1
- package/dist/emails/send/index.d.ts +0 -10
- package/dist/emails/send/index.d.ts.map +0 -1
- package/dist/emails/send/index.js +0 -33
- package/dist/emails/send/index.js.map +0 -1
- package/dist/emails/send/orders.d.ts +0 -180
- package/dist/emails/send/orders.d.ts.map +0 -1
- package/dist/emails/send/orders.js +0 -259
- package/dist/emails/send/orders.js.map +0 -1
- package/dist/emails/sender.d.ts +0 -72
- package/dist/emails/sender.d.ts.map +0 -1
- package/dist/emails/sender.js +0 -118
- package/dist/emails/sender.js.map +0 -1
- package/dist/emails/templates/base.d.ts +0 -105
- package/dist/emails/templates/base.d.ts.map +0 -1
- package/dist/emails/templates/base.js +0 -291
- package/dist/emails/templates/base.js.map +0 -1
- package/dist/emails/templates/email-verification.d.ts +0 -28
- package/dist/emails/templates/email-verification.d.ts.map +0 -1
- package/dist/emails/templates/email-verification.js +0 -56
- package/dist/emails/templates/email-verification.js.map +0 -1
- package/dist/emails/templates/index.d.ts +0 -15
- package/dist/emails/templates/index.d.ts.map +0 -1
- package/dist/emails/templates/index.js +0 -58
- package/dist/emails/templates/index.js.map +0 -1
- package/dist/emails/templates/order-cancelled.d.ts +0 -30
- package/dist/emails/templates/order-cancelled.d.ts.map +0 -1
- package/dist/emails/templates/order-cancelled.js +0 -87
- package/dist/emails/templates/order-cancelled.js.map +0 -1
- package/dist/emails/templates/order-confirmation.d.ts +0 -36
- package/dist/emails/templates/order-confirmation.d.ts.map +0 -1
- package/dist/emails/templates/order-confirmation.js +0 -161
- package/dist/emails/templates/order-confirmation.js.map +0 -1
- package/dist/emails/templates/order-delivered.d.ts +0 -31
- package/dist/emails/templates/order-delivered.d.ts.map +0 -1
- package/dist/emails/templates/order-delivered.js +0 -95
- package/dist/emails/templates/order-delivered.js.map +0 -1
- package/dist/emails/templates/order-shipped.d.ts +0 -32
- package/dist/emails/templates/order-shipped.d.ts.map +0 -1
- package/dist/emails/templates/order-shipped.js +0 -87
- package/dist/emails/templates/order-shipped.js.map +0 -1
- package/dist/emails/templates/password-reset.d.ts +0 -27
- package/dist/emails/templates/password-reset.d.ts.map +0 -1
- package/dist/emails/templates/password-reset.js +0 -55
- package/dist/emails/templates/password-reset.js.map +0 -1
- package/dist/emails/templates/refund-processed.d.ts +0 -32
- package/dist/emails/templates/refund-processed.d.ts.map +0 -1
- package/dist/emails/templates/refund-processed.js +0 -96
- package/dist/emails/templates/refund-processed.js.map +0 -1
- package/dist/emails/templates/welcome.d.ts +0 -27
- package/dist/emails/templates/welcome.d.ts.map +0 -1
- package/dist/emails/templates/welcome.js +0 -56
- package/dist/emails/templates/welcome.js.map +0 -1
- package/dist/emails/types.d.ts +0 -202
- package/dist/emails/types.d.ts.map +0 -1
- package/dist/emails/types.js +0 -8
- package/dist/emails/types.js.map +0 -1
- package/dist/emails/utils.d.ts +0 -94
- package/dist/emails/utils.d.ts.map +0 -1
- package/dist/emails/utils.js +0 -229
- package/dist/emails/utils.js.map +0 -1
- package/dist/index.d.ts +0 -40
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -225
- package/dist/index.js.map +0 -1
- package/dist/products/api/categories.d.ts +0 -29
- package/dist/products/api/categories.d.ts.map +0 -1
- package/dist/products/api/categories.js +0 -49
- package/dist/products/api/categories.js.map +0 -1
- package/dist/products/api/index.d.ts +0 -24
- package/dist/products/api/index.d.ts.map +0 -1
- package/dist/products/api/index.js +0 -30
- package/dist/products/api/index.js.map +0 -1
- package/dist/products/api/product.d.ts +0 -36
- package/dist/products/api/product.d.ts.map +0 -1
- package/dist/products/api/product.js +0 -70
- package/dist/products/api/product.js.map +0 -1
- package/dist/products/api/products.d.ts +0 -41
- package/dist/products/api/products.d.ts.map +0 -1
- package/dist/products/api/products.js +0 -102
- package/dist/products/api/products.js.map +0 -1
- package/dist/products/components/CategoryNav.d.ts +0 -51
- package/dist/products/components/CategoryNav.d.ts.map +0 -1
- package/dist/products/components/CategoryNav.js +0 -115
- package/dist/products/components/CategoryNav.js.map +0 -1
- package/dist/products/components/ProductBreadcrumb.d.ts +0 -52
- package/dist/products/components/ProductBreadcrumb.d.ts.map +0 -1
- package/dist/products/components/ProductBreadcrumb.js +0 -78
- package/dist/products/components/ProductBreadcrumb.js.map +0 -1
- package/dist/products/components/ProductCard.d.ts +0 -54
- package/dist/products/components/ProductCard.d.ts.map +0 -1
- package/dist/products/components/ProductCard.js +0 -65
- package/dist/products/components/ProductCard.js.map +0 -1
- package/dist/products/components/ProductDetails.d.ts +0 -63
- package/dist/products/components/ProductDetails.d.ts.map +0 -1
- package/dist/products/components/ProductDetails.js +0 -105
- package/dist/products/components/ProductDetails.js.map +0 -1
- package/dist/products/components/ProductFilters.d.ts +0 -70
- package/dist/products/components/ProductFilters.d.ts.map +0 -1
- package/dist/products/components/ProductFilters.js +0 -127
- package/dist/products/components/ProductFilters.js.map +0 -1
- package/dist/products/components/ProductGallery.d.ts +0 -37
- package/dist/products/components/ProductGallery.d.ts.map +0 -1
- package/dist/products/components/ProductGallery.js +0 -80
- package/dist/products/components/ProductGallery.js.map +0 -1
- package/dist/products/components/ProductGrid.d.ts +0 -50
- package/dist/products/components/ProductGrid.d.ts.map +0 -1
- package/dist/products/components/ProductGrid.js +0 -83
- package/dist/products/components/ProductGrid.js.map +0 -1
- package/dist/products/components/ProductSearch.d.ts +0 -43
- package/dist/products/components/ProductSearch.d.ts.map +0 -1
- package/dist/products/components/ProductSearch.js +0 -99
- package/dist/products/components/ProductSearch.js.map +0 -1
- package/dist/products/components/ProductSort.d.ts +0 -43
- package/dist/products/components/ProductSort.d.ts.map +0 -1
- package/dist/products/components/ProductSort.js +0 -61
- package/dist/products/components/ProductSort.js.map +0 -1
- package/dist/products/components/VariantSelector.d.ts +0 -43
- package/dist/products/components/VariantSelector.d.ts.map +0 -1
- package/dist/products/components/VariantSelector.js +0 -147
- package/dist/products/components/VariantSelector.js.map +0 -1
- package/dist/products/components/index.d.ts +0 -26
- package/dist/products/components/index.d.ts.map +0 -1
- package/dist/products/components/index.js +0 -32
- package/dist/products/components/index.js.map +0 -1
- package/dist/products/hooks/index.d.ts +0 -14
- package/dist/products/hooks/index.d.ts.map +0 -1
- package/dist/products/hooks/index.js +0 -17
- package/dist/products/hooks/index.js.map +0 -1
- package/dist/products/hooks/useCategories.d.ts +0 -56
- package/dist/products/hooks/useCategories.d.ts.map +0 -1
- package/dist/products/hooks/useCategories.js +0 -126
- package/dist/products/hooks/useCategories.js.map +0 -1
- package/dist/products/hooks/useProduct.d.ts +0 -44
- package/dist/products/hooks/useProduct.d.ts.map +0 -1
- package/dist/products/hooks/useProduct.js +0 -86
- package/dist/products/hooks/useProduct.js.map +0 -1
- package/dist/products/hooks/useProductAttributes.d.ts +0 -59
- package/dist/products/hooks/useProductAttributes.d.ts.map +0 -1
- package/dist/products/hooks/useProductAttributes.js +0 -148
- package/dist/products/hooks/useProductAttributes.js.map +0 -1
- package/dist/products/hooks/useProducts.d.ts +0 -67
- package/dist/products/hooks/useProducts.d.ts.map +0 -1
- package/dist/products/hooks/useProducts.js +0 -132
- package/dist/products/hooks/useProducts.js.map +0 -1
- package/dist/products/index.d.ts +0 -94
- package/dist/products/index.d.ts.map +0 -1
- package/dist/products/index.js +0 -123
- package/dist/products/index.js.map +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -70
- package/dist/theme/ThemeProvider.d.ts.map +0 -1
- package/dist/theme/ThemeProvider.js +0 -77
- package/dist/theme/ThemeProvider.js.map +0 -1
- package/dist/theme/colors.d.ts +0 -148
- package/dist/theme/colors.d.ts.map +0 -1
- package/dist/theme/colors.js +0 -219
- package/dist/theme/colors.js.map +0 -1
- package/dist/theme/defaults.d.ts +0 -212
- package/dist/theme/defaults.d.ts.map +0 -1
- package/dist/theme/defaults.js +0 -278
- package/dist/theme/defaults.js.map +0 -1
- package/dist/theme/fonts.d.ts +0 -59
- package/dist/theme/fonts.d.ts.map +0 -1
- package/dist/theme/fonts.js +0 -202
- package/dist/theme/fonts.js.map +0 -1
- package/dist/theme/generator.d.ts +0 -50
- package/dist/theme/generator.d.ts.map +0 -1
- package/dist/theme/generator.js +0 -322
- package/dist/theme/generator.js.map +0 -1
- package/dist/theme/hooks.d.ts +0 -110
- package/dist/theme/hooks.d.ts.map +0 -1
- package/dist/theme/hooks.js +0 -106
- package/dist/theme/hooks.js.map +0 -1
- package/dist/theme/index.d.ts +0 -37
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -85
- package/dist/theme/index.js.map +0 -1
package/dist/auth/api/auth.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,68 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/auth/api/index.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/auth/api/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,93 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,67 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|