@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,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/config
|
|
4
|
+
*
|
|
5
|
+
* NextAuth configuration for store customer authentication.
|
|
6
|
+
* Uses JWT strategy with credentials provider.
|
|
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 = createAuthOptions;
|
|
13
|
+
exports.getCustomerSession = getCustomerSession;
|
|
14
|
+
const credentials_1 = __importDefault(require("next-auth/providers/credentials"));
|
|
15
|
+
const customer_service_1 = require("./server/customer-service");
|
|
16
|
+
// =============================================================================
|
|
17
|
+
// Constants
|
|
18
|
+
// =============================================================================
|
|
19
|
+
/**
|
|
20
|
+
* Default session duration: 24 hours (in seconds).
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_SESSION_MAX_AGE = 24 * 60 * 60;
|
|
23
|
+
/**
|
|
24
|
+
* Remember me session duration: 30 days (in seconds).
|
|
25
|
+
*/
|
|
26
|
+
const REMEMBER_ME_MAX_AGE = 30 * 24 * 60 * 60;
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// Auth Configuration
|
|
29
|
+
// =============================================================================
|
|
30
|
+
/**
|
|
31
|
+
* Create NextAuth options for store customer authentication.
|
|
32
|
+
*
|
|
33
|
+
* @param options - Configuration options
|
|
34
|
+
* @returns NextAuth options object
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // app/api/auth/[...nextauth]/route.ts
|
|
39
|
+
* import NextAuth from 'next-auth'
|
|
40
|
+
* import { createAuthOptions } from '@rovela/sdk/auth'
|
|
41
|
+
*
|
|
42
|
+
* const handler = NextAuth(createAuthOptions())
|
|
43
|
+
* export { handler as GET, handler as POST }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
function createAuthOptions(options = {}) {
|
|
47
|
+
const { sessionMaxAge = DEFAULT_SESSION_MAX_AGE, rememberMeMaxAge = REMEMBER_ME_MAX_AGE, requireEmailVerification = true, signInPage = '/auth/signin', errorPage = '/auth/signin', } = options;
|
|
48
|
+
return {
|
|
49
|
+
providers: [
|
|
50
|
+
(0, credentials_1.default)({
|
|
51
|
+
id: 'credentials',
|
|
52
|
+
name: 'Credentials',
|
|
53
|
+
credentials: {
|
|
54
|
+
email: { label: 'Email', type: 'email' },
|
|
55
|
+
password: { label: 'Password', type: 'password' },
|
|
56
|
+
rememberMe: { label: 'Remember Me', type: 'checkbox' },
|
|
57
|
+
},
|
|
58
|
+
async authorize(credentials) {
|
|
59
|
+
if (!credentials?.email || !credentials?.password) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const result = await (0, customer_service_1.authenticateCustomer)(credentials.email, credentials.password, requireEmailVerification);
|
|
63
|
+
if (!result.success) {
|
|
64
|
+
// Throw error with specific code for frontend handling
|
|
65
|
+
throw new Error(result.error, { cause: result.code });
|
|
66
|
+
}
|
|
67
|
+
// Return user object for session
|
|
68
|
+
// Cast to SDKUser to include custom fields, then to User for NextAuth
|
|
69
|
+
return {
|
|
70
|
+
id: result.customer.id,
|
|
71
|
+
email: result.customer.email,
|
|
72
|
+
name: result.customer.name || undefined,
|
|
73
|
+
emailVerified: result.customer.emailVerified,
|
|
74
|
+
// Pass rememberMe through to JWT callback
|
|
75
|
+
rememberMe: credentials.rememberMe === 'true',
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
],
|
|
80
|
+
session: {
|
|
81
|
+
strategy: 'jwt',
|
|
82
|
+
maxAge: sessionMaxAge,
|
|
83
|
+
},
|
|
84
|
+
jwt: {
|
|
85
|
+
maxAge: sessionMaxAge,
|
|
86
|
+
},
|
|
87
|
+
pages: {
|
|
88
|
+
signIn: signInPage,
|
|
89
|
+
error: errorPage,
|
|
90
|
+
},
|
|
91
|
+
callbacks: {
|
|
92
|
+
async jwt({ token, user, trigger, session }) {
|
|
93
|
+
// Cast token to SDK type for custom fields
|
|
94
|
+
const sdkToken = token;
|
|
95
|
+
// Initial sign in
|
|
96
|
+
if (user) {
|
|
97
|
+
// Cast user to SDK type to access custom fields
|
|
98
|
+
const sdkUser = user;
|
|
99
|
+
sdkToken.id = user.id;
|
|
100
|
+
sdkToken.email = user.email ?? undefined;
|
|
101
|
+
sdkToken.name = user.name ?? undefined;
|
|
102
|
+
// Store as ISO string or null (aligned with main project pattern)
|
|
103
|
+
sdkToken.emailVerified = sdkUser.emailVerified
|
|
104
|
+
? (sdkUser.emailVerified instanceof Date
|
|
105
|
+
? sdkUser.emailVerified.toISOString()
|
|
106
|
+
: String(sdkUser.emailVerified))
|
|
107
|
+
: null;
|
|
108
|
+
// Handle remember me - extend token expiry
|
|
109
|
+
if (sdkUser.rememberMe) {
|
|
110
|
+
// Set longer expiry for remember me
|
|
111
|
+
sdkToken.maxAge = rememberMeMaxAge;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Update session when triggered
|
|
115
|
+
if (trigger === 'update' && session) {
|
|
116
|
+
// Allow updating session data
|
|
117
|
+
if (session.name !== undefined) {
|
|
118
|
+
sdkToken.name = session.name;
|
|
119
|
+
}
|
|
120
|
+
if (session.emailVerified !== undefined) {
|
|
121
|
+
sdkToken.emailVerified = session.emailVerified
|
|
122
|
+
? String(session.emailVerified)
|
|
123
|
+
: null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return token;
|
|
127
|
+
},
|
|
128
|
+
async session({ session, token }) {
|
|
129
|
+
// Build customer session from token
|
|
130
|
+
// Use type assertion to avoid conflicts with parent project's type declarations
|
|
131
|
+
if (token) {
|
|
132
|
+
const sdkToken = token;
|
|
133
|
+
const user = session.user;
|
|
134
|
+
user.id = sdkToken.id;
|
|
135
|
+
user.email = sdkToken.email;
|
|
136
|
+
user.name = sdkToken.name;
|
|
137
|
+
// Convert string back to boolean for session
|
|
138
|
+
user.emailVerified = !!sdkToken.emailVerified;
|
|
139
|
+
}
|
|
140
|
+
return session;
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
events: {
|
|
144
|
+
// Optional: Log sign in events
|
|
145
|
+
async signIn({ user }) {
|
|
146
|
+
console.log(`[Auth] Customer signed in: ${user.email}`);
|
|
147
|
+
},
|
|
148
|
+
async signOut({ token }) {
|
|
149
|
+
console.log(`[Auth] Customer signed out: ${token?.email}`);
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
// Enable debug in development
|
|
153
|
+
debug: process.env.NODE_ENV === 'development',
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get customer session data from the current session.
|
|
158
|
+
* Refreshes data from database for accuracy.
|
|
159
|
+
*
|
|
160
|
+
* @param customerId - Customer UUID from session
|
|
161
|
+
* @returns Customer session data or null
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* const session = await getServerSession(authOptions)
|
|
166
|
+
* if (session?.user?.id) {
|
|
167
|
+
* const customer = await getCustomerSession(session.user.id)
|
|
168
|
+
* }
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
async function getCustomerSession(customerId) {
|
|
172
|
+
return (0, customer_service_1.findCustomerForSession)(customerId);
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/auth/config.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AA0CH,8CAuIC;AAiBD,gDAIC;AAlMD,kFAAiE;AACjE,gEAAwF;AAGxF,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;GAEG;AACH,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAE5C;;GAEG;AACH,MAAM,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAE7C,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF;;;;;;;;;;;;;;;GAeG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K,EAAE,KAAK,EAAE,CAAC,CAAA;YAC5D,CAAC;SACF;QAED,8BAA8B;QAC9B,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;KAC9C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,kBAAkB,CACtC,UAAkB;IAElB,OAAO,IAAA,yCAAsB,EAAC,UAAU,CAAC,CAAA;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth/hooks
|
|
4
|
+
*
|
|
5
|
+
* Client-side authentication hooks.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.useAuth = void 0;
|
|
9
|
+
var useAuth_1 = require("./useAuth");
|
|
10
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return useAuth_1.useAuth; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/hooks/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qCAAmC;AAA1B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth
|
|
3
|
+
*
|
|
4
|
+
* Customer authentication module for e-commerce stores.
|
|
5
|
+
*
|
|
6
|
+
* This module provides complete customer authentication including:
|
|
7
|
+
* - Email/password sign in and sign up
|
|
8
|
+
* - Email verification flow
|
|
9
|
+
* - Password reset flow
|
|
10
|
+
* - Remember me functionality
|
|
11
|
+
* - Session management with JWT
|
|
12
|
+
* - Pre-built UI components
|
|
13
|
+
* - Route protection
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // Setup NextAuth route handler
|
|
18
|
+
* // app/api/auth/[...nextauth]/route.ts
|
|
19
|
+
* import { createAuthHandlers } from '@rovela/sdk/auth'
|
|
20
|
+
* export const { GET, POST } = createAuthHandlers()
|
|
21
|
+
*
|
|
22
|
+
* // Setup API routes for registration, verification, etc.
|
|
23
|
+
* // app/api/auth/register/route.ts
|
|
24
|
+
* export { POST } from '@rovela/sdk/auth/api/register'
|
|
25
|
+
*
|
|
26
|
+
* // Use components in pages
|
|
27
|
+
* import { SignInForm, SignUpForm, AuthGuard, UserMenu } from '@rovela/sdk/auth'
|
|
28
|
+
*
|
|
29
|
+
* // Use auth hook in components
|
|
30
|
+
* import { useAuth } from '@rovela/sdk/auth'
|
|
31
|
+
*
|
|
32
|
+
* function MyComponent() {
|
|
33
|
+
* const { customer, isAuthenticated, signIn, signOut } = useAuth()
|
|
34
|
+
* // ...
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export type { CustomerSession, AuthSession, AuthState, SignInOptions, SignInResult, SignUpData, SignUpResult, PasswordResetRequestResult, PasswordResetResult, TokenValidationResult, VerifyEmailResult, ResendVerificationResult, SignInFormProps, SignUpFormProps, ForgotPasswordFormProps, ResetPasswordFormProps, VerifyEmailNoticeProps, UserMenuProps, AuthGuardProps, AuthApiError, RegisterRequest, RegisterResponse, VerifyEmailResponse, ForgotPasswordRequest, ResetPasswordRequest, AuthConfigOptions, UseAuthReturn, } from './types';
|
|
39
|
+
export { createAuthOptions, getCustomerSession } from './config';
|
|
40
|
+
export { createAuthHandlers } from './api/auth';
|
|
41
|
+
export { POST as registerPOST } from './api/register';
|
|
42
|
+
export { GET as verifyEmailGET, POST as verifyEmailPOST } from './api/verify-email';
|
|
43
|
+
export { POST as resendVerificationPOST } from './api/resend-verification';
|
|
44
|
+
export { POST as forgotPasswordPOST } from './api/forgot-password';
|
|
45
|
+
export { GET as resetPasswordGET, POST as resetPasswordPOST } from './api/reset-password';
|
|
46
|
+
export { useAuth } from './hooks/useAuth';
|
|
47
|
+
export { SignInForm } from './components/SignInForm';
|
|
48
|
+
export { SignUpForm } from './components/SignUpForm';
|
|
49
|
+
export { ForgotPasswordForm } from './components/ForgotPasswordForm';
|
|
50
|
+
export { ResetPasswordForm } from './components/ResetPasswordForm';
|
|
51
|
+
export { VerifyEmailNotice } from './components/VerifyEmailNotice';
|
|
52
|
+
export { UserMenu } from './components/UserMenu';
|
|
53
|
+
export { AuthGuard, withAuth } from './components/AuthGuard';
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,YAAY,EAEV,eAAe,EACf,WAAW,EACX,SAAS,EAGT,aAAa,EACb,YAAY,EAGZ,UAAU,EACV,YAAY,EAGZ,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EAGrB,iBAAiB,EACjB,wBAAwB,EAGxB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,cAAc,EAGd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EAGpB,iBAAiB,EAGjB,aAAa,GACd,MAAM,SAAS,CAAA;AAMhB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAMhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAG/C,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,GAAG,IAAI,cAAc,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,IAAI,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,GAAG,IAAI,gBAAgB,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAMzF,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAMzC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/auth
|
|
4
|
+
*
|
|
5
|
+
* Customer authentication module for e-commerce stores.
|
|
6
|
+
*
|
|
7
|
+
* This module provides complete customer authentication including:
|
|
8
|
+
* - Email/password sign in and sign up
|
|
9
|
+
* - Email verification flow
|
|
10
|
+
* - Password reset flow
|
|
11
|
+
* - Remember me functionality
|
|
12
|
+
* - Session management with JWT
|
|
13
|
+
* - Pre-built UI components
|
|
14
|
+
* - Route protection
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Setup NextAuth route handler
|
|
19
|
+
* // app/api/auth/[...nextauth]/route.ts
|
|
20
|
+
* import { createAuthHandlers } from '@rovela/sdk/auth'
|
|
21
|
+
* export const { GET, POST } = createAuthHandlers()
|
|
22
|
+
*
|
|
23
|
+
* // Setup API routes for registration, verification, etc.
|
|
24
|
+
* // app/api/auth/register/route.ts
|
|
25
|
+
* export { POST } from '@rovela/sdk/auth/api/register'
|
|
26
|
+
*
|
|
27
|
+
* // Use components in pages
|
|
28
|
+
* import { SignInForm, SignUpForm, AuthGuard, UserMenu } from '@rovela/sdk/auth'
|
|
29
|
+
*
|
|
30
|
+
* // Use auth hook in components
|
|
31
|
+
* import { useAuth } from '@rovela/sdk/auth'
|
|
32
|
+
*
|
|
33
|
+
* function MyComponent() {
|
|
34
|
+
* const { customer, isAuthenticated, signIn, signOut } = useAuth()
|
|
35
|
+
* // ...
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.withAuth = exports.AuthGuard = exports.UserMenu = exports.VerifyEmailNotice = exports.ResetPasswordForm = exports.ForgotPasswordForm = exports.SignUpForm = exports.SignInForm = exports.useAuth = exports.resetPasswordPOST = exports.resetPasswordGET = exports.forgotPasswordPOST = exports.resendVerificationPOST = exports.verifyEmailPOST = exports.verifyEmailGET = exports.registerPOST = exports.createAuthHandlers = exports.getCustomerSession = exports.createAuthOptions = void 0;
|
|
41
|
+
// =============================================================================
|
|
42
|
+
// Configuration
|
|
43
|
+
// =============================================================================
|
|
44
|
+
var config_1 = require("./config");
|
|
45
|
+
Object.defineProperty(exports, "createAuthOptions", { enumerable: true, get: function () { return config_1.createAuthOptions; } });
|
|
46
|
+
Object.defineProperty(exports, "getCustomerSession", { enumerable: true, get: function () { return config_1.getCustomerSession; } });
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// API Route Handlers
|
|
49
|
+
// =============================================================================
|
|
50
|
+
var auth_1 = require("./api/auth");
|
|
51
|
+
Object.defineProperty(exports, "createAuthHandlers", { enumerable: true, get: function () { return auth_1.createAuthHandlers; } });
|
|
52
|
+
// Individual route handlers (for flexible routing)
|
|
53
|
+
var register_1 = require("./api/register");
|
|
54
|
+
Object.defineProperty(exports, "registerPOST", { enumerable: true, get: function () { return register_1.POST; } });
|
|
55
|
+
var verify_email_1 = require("./api/verify-email");
|
|
56
|
+
Object.defineProperty(exports, "verifyEmailGET", { enumerable: true, get: function () { return verify_email_1.GET; } });
|
|
57
|
+
Object.defineProperty(exports, "verifyEmailPOST", { enumerable: true, get: function () { return verify_email_1.POST; } });
|
|
58
|
+
var resend_verification_1 = require("./api/resend-verification");
|
|
59
|
+
Object.defineProperty(exports, "resendVerificationPOST", { enumerable: true, get: function () { return resend_verification_1.POST; } });
|
|
60
|
+
var forgot_password_1 = require("./api/forgot-password");
|
|
61
|
+
Object.defineProperty(exports, "forgotPasswordPOST", { enumerable: true, get: function () { return forgot_password_1.POST; } });
|
|
62
|
+
var reset_password_1 = require("./api/reset-password");
|
|
63
|
+
Object.defineProperty(exports, "resetPasswordGET", { enumerable: true, get: function () { return reset_password_1.GET; } });
|
|
64
|
+
Object.defineProperty(exports, "resetPasswordPOST", { enumerable: true, get: function () { return reset_password_1.POST; } });
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// Client Hooks
|
|
67
|
+
// =============================================================================
|
|
68
|
+
var useAuth_1 = require("./hooks/useAuth");
|
|
69
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return useAuth_1.useAuth; } });
|
|
70
|
+
// =============================================================================
|
|
71
|
+
// UI Components
|
|
72
|
+
// =============================================================================
|
|
73
|
+
var SignInForm_1 = require("./components/SignInForm");
|
|
74
|
+
Object.defineProperty(exports, "SignInForm", { enumerable: true, get: function () { return SignInForm_1.SignInForm; } });
|
|
75
|
+
var SignUpForm_1 = require("./components/SignUpForm");
|
|
76
|
+
Object.defineProperty(exports, "SignUpForm", { enumerable: true, get: function () { return SignUpForm_1.SignUpForm; } });
|
|
77
|
+
var ForgotPasswordForm_1 = require("./components/ForgotPasswordForm");
|
|
78
|
+
Object.defineProperty(exports, "ForgotPasswordForm", { enumerable: true, get: function () { return ForgotPasswordForm_1.ForgotPasswordForm; } });
|
|
79
|
+
var ResetPasswordForm_1 = require("./components/ResetPasswordForm");
|
|
80
|
+
Object.defineProperty(exports, "ResetPasswordForm", { enumerable: true, get: function () { return ResetPasswordForm_1.ResetPasswordForm; } });
|
|
81
|
+
var VerifyEmailNotice_1 = require("./components/VerifyEmailNotice");
|
|
82
|
+
Object.defineProperty(exports, "VerifyEmailNotice", { enumerable: true, get: function () { return VerifyEmailNotice_1.VerifyEmailNotice; } });
|
|
83
|
+
var UserMenu_1 = require("./components/UserMenu");
|
|
84
|
+
Object.defineProperty(exports, "UserMenu", { enumerable: true, get: function () { return UserMenu_1.UserMenu; } });
|
|
85
|
+
var AuthGuard_1 = require("./components/AuthGuard");
|
|
86
|
+
Object.defineProperty(exports, "AuthGuard", { enumerable: true, get: function () { return AuthGuard_1.AuthGuard; } });
|
|
87
|
+
Object.defineProperty(exports, "withAuth", { enumerable: true, get: function () { return AuthGuard_1.withAuth; } });
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;AAqDH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,mCAAgE;AAAvD,2GAAA,iBAAiB,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAE9C,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF,mCAA+C;AAAtC,0GAAA,kBAAkB,OAAA;AAE3B,mDAAmD;AACnD,2CAAqD;AAA5C,wGAAA,IAAI,OAAgB;AAC7B,mDAAmF;AAA1E,8GAAA,GAAG,OAAkB;AAAE,+GAAA,IAAI,OAAmB;AACvD,iEAA0E;AAAjE,6HAAA,IAAI,OAA0B;AACvC,yDAAkE;AAAzD,qHAAA,IAAI,OAAsB;AACnC,uDAAyF;AAAhF,kHAAA,GAAG,OAAoB;AAAE,mHAAA,IAAI,OAAqB;AAE3D,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,2CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAEhB,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,sDAAoD;AAA3C,wGAAA,UAAU,OAAA;AACnB,sDAAoD;AAA3C,wGAAA,UAAU,OAAA;AACnB,sEAAoE;AAA3D,wHAAA,kBAAkB,OAAA;AAC3B,oEAAkE;AAAzD,sHAAA,iBAAiB,OAAA;AAC1B,oEAAkE;AAAzD,sHAAA,iBAAiB,OAAA;AAC1B,kDAAgD;AAAvC,oGAAA,QAAQ,OAAA;AACjB,oDAA4D;AAAnD,sGAAA,SAAS,OAAA;AAAE,qGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/auth/server/customer-service
|
|
3
|
+
*
|
|
4
|
+
* Customer CRUD operations with tenant isolation.
|
|
5
|
+
* All operations are scoped to the current tenant.
|
|
6
|
+
*/
|
|
7
|
+
import * as schema from '../../core/db/schema';
|
|
8
|
+
import type { CustomerSession } from '../types';
|
|
9
|
+
export interface CreateCustomerResult {
|
|
10
|
+
customer: schema.Customer;
|
|
11
|
+
verificationToken?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AuthenticateResult {
|
|
14
|
+
success: true;
|
|
15
|
+
customer: schema.Customer;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthenticateError {
|
|
18
|
+
success: false;
|
|
19
|
+
error: string;
|
|
20
|
+
code: 'INVALID_CREDENTIALS' | 'EMAIL_NOT_VERIFIED' | 'USER_NOT_FOUND';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a new customer account.
|
|
24
|
+
* Password is hashed before storage.
|
|
25
|
+
* Returns customer with null emailVerified (needs verification).
|
|
26
|
+
*
|
|
27
|
+
* @param email - Customer email (will be lowercased)
|
|
28
|
+
* @param password - Plain text password (min 8 chars)
|
|
29
|
+
* @param name - Optional customer name
|
|
30
|
+
* @returns Created customer
|
|
31
|
+
* @throws Error if email already exists
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const { customer } = await createCustomer(
|
|
36
|
+
* 'customer@example.com',
|
|
37
|
+
* 'securePassword123',
|
|
38
|
+
* 'John Doe'
|
|
39
|
+
* )
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function createCustomer(email: string, password: string, name?: string): Promise<CreateCustomerResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Authenticate a customer by email and password.
|
|
45
|
+
* Checks email verification status.
|
|
46
|
+
*
|
|
47
|
+
* @param email - Customer email
|
|
48
|
+
* @param password - Plain text password
|
|
49
|
+
* @param requireVerification - Whether to require email verification (default: true)
|
|
50
|
+
* @returns Authentication result
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const result = await authenticateCustomer('customer@example.com', 'password123')
|
|
55
|
+
* if (result.success) {
|
|
56
|
+
* console.log('Authenticated:', result.customer.email)
|
|
57
|
+
* } else {
|
|
58
|
+
* console.log('Failed:', result.error)
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function authenticateCustomer(email: string, password: string, requireVerification?: boolean): Promise<AuthenticateResult | AuthenticateError>;
|
|
63
|
+
/**
|
|
64
|
+
* Get customer data for session (excludes sensitive fields).
|
|
65
|
+
*
|
|
66
|
+
* @param customerId - Customer UUID
|
|
67
|
+
* @returns Customer session data or null if not found
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const session = await findCustomerForSession(customerId)
|
|
72
|
+
* if (session) {
|
|
73
|
+
* console.log('Customer:', session.email)
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function findCustomerForSession(customerId: string): Promise<CustomerSession | null>;
|
|
78
|
+
/**
|
|
79
|
+
* Find a customer by email.
|
|
80
|
+
*
|
|
81
|
+
* @param email - Customer email
|
|
82
|
+
* @returns Customer or null if not found
|
|
83
|
+
*/
|
|
84
|
+
export declare function findCustomerByEmail(email: string): Promise<schema.Customer | null>;
|
|
85
|
+
/**
|
|
86
|
+
* Find a customer by ID.
|
|
87
|
+
*
|
|
88
|
+
* @param customerId - Customer UUID
|
|
89
|
+
* @returns Customer or null if not found
|
|
90
|
+
*/
|
|
91
|
+
export declare function findCustomerById(customerId: string): Promise<schema.Customer | null>;
|
|
92
|
+
/**
|
|
93
|
+
* Update customer profile information.
|
|
94
|
+
*
|
|
95
|
+
* @param customerId - Customer UUID
|
|
96
|
+
* @param data - Fields to update
|
|
97
|
+
* @returns Updated customer
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const updated = await updateCustomer(customerId, { name: 'Jane Doe' })
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function updateCustomer(customerId: string, data: {
|
|
105
|
+
name?: string;
|
|
106
|
+
email?: string;
|
|
107
|
+
}): Promise<schema.Customer | null>;
|
|
108
|
+
/**
|
|
109
|
+
* Update customer password.
|
|
110
|
+
*
|
|
111
|
+
* @param customerId - Customer UUID
|
|
112
|
+
* @param newPassword - New plain text password
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* await updateCustomerPassword(customerId, 'newSecurePassword123')
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function updateCustomerPassword(customerId: string, newPassword: string): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Mark customer email as verified.
|
|
122
|
+
*
|
|
123
|
+
* @param customerId - Customer UUID
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* await markEmailVerified(customerId)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare function markEmailVerified(customerId: string): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Check if email is already registered.
|
|
133
|
+
*
|
|
134
|
+
* @param email - Email to check
|
|
135
|
+
* @returns True if email exists
|
|
136
|
+
*/
|
|
137
|
+
export declare function emailExists(email: string): Promise<boolean>;
|
|
138
|
+
//# sourceMappingURL=customer-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-service.d.ts","sourceRoot":"","sources":["../../../src/auth/server/customer-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAM/C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,IAAI,CAAA;IACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,qBAAqB,GAAG,oBAAoB,GAAG,gBAAgB,CAAA;CACtE;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC,CA4B/B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,mBAAmB,UAAO,GACzB,OAAO,CAAC,kBAAkB,GAAG,iBAAiB,CAAC,CA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