@rovela-ai/sdk 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +109 -0
- package/dist/core/db/index.js.map +1 -0
- package/dist/core/db/queries.d.ts +627 -0
- package/dist/core/db/queries.d.ts.map +1 -0
- package/dist/core/db/queries.js +730 -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 +96 -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 +7 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/admin
|
|
3
|
+
*
|
|
4
|
+
* Admin dashboard module: complete store management with separate admin auth.
|
|
5
|
+
*
|
|
6
|
+
* ## Features
|
|
7
|
+
* - Separate admin authentication (independent from customer auth)
|
|
8
|
+
* - Dashboard with stats, recent orders, and low stock alerts
|
|
9
|
+
* - Product management with variants and inventory
|
|
10
|
+
* - Order management with status updates and refunds
|
|
11
|
+
* - Customer viewing
|
|
12
|
+
* - Store settings
|
|
13
|
+
*
|
|
14
|
+
* ## Usage
|
|
15
|
+
*
|
|
16
|
+
* ### Setup Auth (app/api/admin/auth/[...nextauth]/route.ts)
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import NextAuth from 'next-auth'
|
|
19
|
+
* import { adminAuthConfig } from '@rovela/sdk/admin'
|
|
20
|
+
* const handler = NextAuth(adminAuthConfig)
|
|
21
|
+
* export { handler as GET, handler as POST }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ### Protected Layout (app/admin/layout.tsx)
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { AdminGuard, AdminLayout } from '@rovela/sdk/admin'
|
|
27
|
+
*
|
|
28
|
+
* export default function Layout({ children }) {
|
|
29
|
+
* return (
|
|
30
|
+
* <AdminGuard>
|
|
31
|
+
* <AdminLayout storeName="My Store">
|
|
32
|
+
* {children}
|
|
33
|
+
* </AdminLayout>
|
|
34
|
+
* </AdminGuard>
|
|
35
|
+
* )
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* ### Dashboard Page (app/admin/page.tsx)
|
|
40
|
+
* ```tsx
|
|
41
|
+
* import { StatsCards, RecentOrders, LowStockAlert, useAdminStats } from '@rovela/sdk/admin'
|
|
42
|
+
*
|
|
43
|
+
* export default function DashboardPage() {
|
|
44
|
+
* const { stats, isLoading } = useAdminStats()
|
|
45
|
+
* return (
|
|
46
|
+
* <div>
|
|
47
|
+
* <StatsCards stats={stats} isLoading={isLoading} />
|
|
48
|
+
* <div className="grid grid-cols-2 gap-6">
|
|
49
|
+
* <RecentOrders />
|
|
50
|
+
* <LowStockAlert />
|
|
51
|
+
* </div>
|
|
52
|
+
* </div>
|
|
53
|
+
* )
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export type { OrderStatus, ProductStatus, AdminRole, Order, OrderItem, Product, ProductVariant, Customer, StoreAdmin, Category, PaginatedResponse, ApiError, Address, AdminApiError, AdminSession, AdminAuthState, AdminSignInOptions, AdminSignInResult, DashboardStats, LowStockItem, RecentOrder, UseAdminStatsOptions, ProductFormData, VariantFormData, CategoryFormData, ProductListOptions, OrderListOptions, CustomerListOptions, CrudResult, RefundResult, StoreSettingsData, AdminOrderListItem, AdminOrderDetail, AdminOrderItem, AdminProductListItem, AdminProductDetail, AdminProductVariant, AdminCustomerListItem, AdminCustomerDetail, AdminCategoryListItem, AdminLayoutProps, AdminGuardProps, AdminLoginFormProps, AdminNavProps, AdminHeaderProps, StatsCardsProps, RecentOrdersProps, LowStockAlertProps, ProductTableProps, ProductFormProps, InventoryEditorProps, OrderTableProps, OrderDetailsProps, RefundDialogProps, StoreSettingsProps, CustomerTableProps, AdminAuthConfigOptions, UseAdminAuthReturn, UseAdminStatsReturn, UseAdminOrdersReturn, UseAdminProductsReturn, UseAdminCustomersReturn, UseAdminCategoriesReturn, } from './types';
|
|
58
|
+
export { createAdminAuthOptions, adminAuthConfig, adminAuthHandlers, createAdminNextAuthHandler, getAdminSession, } from './config';
|
|
59
|
+
export { authenticateAdmin, createAdmin, updateAdminPassword, findAdminForSession, findAdminByEmail, findAdminById, updateAdmin, adminEmailExists, countAdmins, } from './server';
|
|
60
|
+
export { createAdminAuthHandlers, getProducts, createProduct as createProductHandler, getProduct, updateProduct as updateProductHandler, deleteProduct as deleteProductHandler, addVariant, updateVariantHandler, deleteVariantHandler, getOrders, getOrder, updateOrder, processRefund as processRefundHandler, getStats, getCategories, createCategory as createCategoryHandler, getCategory, updateCategory as updateCategoryHandler, deleteCategory as deleteCategoryHandler, getCustomers, getCustomer, } from './api';
|
|
61
|
+
export { useAdminAuth, useAdminStats, useAdminProducts, useAdminOrders, } from './hooks';
|
|
62
|
+
export { AdminGuard, AdminLoginForm, AdminLayout, AdminNav, AdminHeader, StatsCards, RecentOrders, LowStockAlert, ProductTable, ProductForm, InventoryEditor, OrderTable, OrderDetails, RefundDialog, StoreSettings, } from './components';
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAMH,YAAY,EAEV,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,OAAO,EAGP,aAAa,EAGb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,iBAAiB,EAGjB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EAGrB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAGlB,sBAAsB,EAGtB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,SAAS,CAAA;AAMhB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,UAAU,CAAA;AAMjB,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,MAAM,UAAU,CAAA;AAMjB,OAAO,EAEL,uBAAuB,EAEvB,WAAW,EACX,aAAa,IAAI,oBAAoB,EACrC,UAAU,EACV,aAAa,IAAI,oBAAoB,EACrC,aAAa,IAAI,oBAAoB,EACrC,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EAEpB,SAAS,EACT,QAAQ,EACR,WAAW,EAEX,aAAa,IAAI,oBAAoB,EAErC,QAAQ,EAER,aAAa,EACb,cAAc,IAAI,qBAAqB,EACvC,WAAW,EACX,cAAc,IAAI,qBAAqB,EACvC,cAAc,IAAI,qBAAqB,EAEvC,YAAY,EACZ,WAAW,GACZ,MAAM,OAAO,CAAA;AAMd,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,cAAc,GACf,MAAM,SAAS,CAAA;AAMhB,OAAO,EAEL,UAAU,EACV,cAAc,EAEd,WAAW,EACX,QAAQ,EACR,WAAW,EAEX,UAAU,EACV,YAAY,EACZ,aAAa,EAEb,YAAY,EACZ,WAAW,EACX,eAAe,EAEf,UAAU,EACV,YAAY,EACZ,YAAY,EAEZ,aAAa,GACd,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/admin
|
|
4
|
+
*
|
|
5
|
+
* Admin dashboard module: complete store management with separate admin auth.
|
|
6
|
+
*
|
|
7
|
+
* ## Features
|
|
8
|
+
* - Separate admin authentication (independent from customer auth)
|
|
9
|
+
* - Dashboard with stats, recent orders, and low stock alerts
|
|
10
|
+
* - Product management with variants and inventory
|
|
11
|
+
* - Order management with status updates and refunds
|
|
12
|
+
* - Customer viewing
|
|
13
|
+
* - Store settings
|
|
14
|
+
*
|
|
15
|
+
* ## Usage
|
|
16
|
+
*
|
|
17
|
+
* ### Setup Auth (app/api/admin/auth/[...nextauth]/route.ts)
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import NextAuth from 'next-auth'
|
|
20
|
+
* import { adminAuthConfig } from '@rovela/sdk/admin'
|
|
21
|
+
* const handler = NextAuth(adminAuthConfig)
|
|
22
|
+
* export { handler as GET, handler as POST }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* ### Protected Layout (app/admin/layout.tsx)
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { AdminGuard, AdminLayout } from '@rovela/sdk/admin'
|
|
28
|
+
*
|
|
29
|
+
* export default function Layout({ children }) {
|
|
30
|
+
* return (
|
|
31
|
+
* <AdminGuard>
|
|
32
|
+
* <AdminLayout storeName="My Store">
|
|
33
|
+
* {children}
|
|
34
|
+
* </AdminLayout>
|
|
35
|
+
* </AdminGuard>
|
|
36
|
+
* )
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* ### Dashboard Page (app/admin/page.tsx)
|
|
41
|
+
* ```tsx
|
|
42
|
+
* import { StatsCards, RecentOrders, LowStockAlert, useAdminStats } from '@rovela/sdk/admin'
|
|
43
|
+
*
|
|
44
|
+
* export default function DashboardPage() {
|
|
45
|
+
* const { stats, isLoading } = useAdminStats()
|
|
46
|
+
* return (
|
|
47
|
+
* <div>
|
|
48
|
+
* <StatsCards stats={stats} isLoading={isLoading} />
|
|
49
|
+
* <div className="grid grid-cols-2 gap-6">
|
|
50
|
+
* <RecentOrders />
|
|
51
|
+
* <LowStockAlert />
|
|
52
|
+
* </div>
|
|
53
|
+
* </div>
|
|
54
|
+
* )
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
exports.InventoryEditor = exports.ProductForm = exports.ProductTable = exports.LowStockAlert = exports.RecentOrders = exports.StatsCards = exports.AdminHeader = exports.AdminNav = exports.AdminLayout = exports.AdminLoginForm = exports.AdminGuard = exports.useAdminOrders = exports.useAdminProducts = exports.useAdminStats = exports.useAdminAuth = exports.getCustomer = exports.getCustomers = exports.deleteCategoryHandler = exports.updateCategoryHandler = exports.getCategory = exports.createCategoryHandler = exports.getCategories = exports.getStats = exports.processRefundHandler = exports.updateOrder = exports.getOrder = exports.getOrders = exports.deleteVariantHandler = exports.updateVariantHandler = exports.addVariant = exports.deleteProductHandler = exports.updateProductHandler = exports.getProduct = exports.createProductHandler = exports.getProducts = exports.createAdminAuthHandlers = exports.countAdmins = exports.adminEmailExists = exports.updateAdmin = exports.findAdminById = exports.findAdminByEmail = exports.findAdminForSession = exports.updateAdminPassword = exports.createAdmin = exports.authenticateAdmin = exports.getAdminSession = exports.createAdminNextAuthHandler = exports.adminAuthHandlers = exports.adminAuthConfig = exports.createAdminAuthOptions = void 0;
|
|
60
|
+
exports.StoreSettings = exports.RefundDialog = exports.OrderDetails = exports.OrderTable = void 0;
|
|
61
|
+
// =============================================================================
|
|
62
|
+
// Configuration (NextAuth)
|
|
63
|
+
// =============================================================================
|
|
64
|
+
var config_1 = require("./config");
|
|
65
|
+
Object.defineProperty(exports, "createAdminAuthOptions", { enumerable: true, get: function () { return config_1.createAdminAuthOptions; } });
|
|
66
|
+
Object.defineProperty(exports, "adminAuthConfig", { enumerable: true, get: function () { return config_1.adminAuthConfig; } });
|
|
67
|
+
Object.defineProperty(exports, "adminAuthHandlers", { enumerable: true, get: function () { return config_1.adminAuthHandlers; } });
|
|
68
|
+
Object.defineProperty(exports, "createAdminNextAuthHandler", { enumerable: true, get: function () { return config_1.createAdminNextAuthHandler; } });
|
|
69
|
+
Object.defineProperty(exports, "getAdminSession", { enumerable: true, get: function () { return config_1.getAdminSession; } });
|
|
70
|
+
// =============================================================================
|
|
71
|
+
// Server-side Services
|
|
72
|
+
// =============================================================================
|
|
73
|
+
var server_1 = require("./server");
|
|
74
|
+
Object.defineProperty(exports, "authenticateAdmin", { enumerable: true, get: function () { return server_1.authenticateAdmin; } });
|
|
75
|
+
Object.defineProperty(exports, "createAdmin", { enumerable: true, get: function () { return server_1.createAdmin; } });
|
|
76
|
+
Object.defineProperty(exports, "updateAdminPassword", { enumerable: true, get: function () { return server_1.updateAdminPassword; } });
|
|
77
|
+
Object.defineProperty(exports, "findAdminForSession", { enumerable: true, get: function () { return server_1.findAdminForSession; } });
|
|
78
|
+
Object.defineProperty(exports, "findAdminByEmail", { enumerable: true, get: function () { return server_1.findAdminByEmail; } });
|
|
79
|
+
Object.defineProperty(exports, "findAdminById", { enumerable: true, get: function () { return server_1.findAdminById; } });
|
|
80
|
+
Object.defineProperty(exports, "updateAdmin", { enumerable: true, get: function () { return server_1.updateAdmin; } });
|
|
81
|
+
Object.defineProperty(exports, "adminEmailExists", { enumerable: true, get: function () { return server_1.adminEmailExists; } });
|
|
82
|
+
Object.defineProperty(exports, "countAdmins", { enumerable: true, get: function () { return server_1.countAdmins; } });
|
|
83
|
+
// =============================================================================
|
|
84
|
+
// API Route Handlers
|
|
85
|
+
// =============================================================================
|
|
86
|
+
var api_1 = require("./api");
|
|
87
|
+
// Auth
|
|
88
|
+
Object.defineProperty(exports, "createAdminAuthHandlers", { enumerable: true, get: function () { return api_1.createAdminAuthHandlers; } });
|
|
89
|
+
// Products
|
|
90
|
+
Object.defineProperty(exports, "getProducts", { enumerable: true, get: function () { return api_1.getProducts; } });
|
|
91
|
+
Object.defineProperty(exports, "createProductHandler", { enumerable: true, get: function () { return api_1.createProduct; } });
|
|
92
|
+
Object.defineProperty(exports, "getProduct", { enumerable: true, get: function () { return api_1.getProduct; } });
|
|
93
|
+
Object.defineProperty(exports, "updateProductHandler", { enumerable: true, get: function () { return api_1.updateProduct; } });
|
|
94
|
+
Object.defineProperty(exports, "deleteProductHandler", { enumerable: true, get: function () { return api_1.deleteProduct; } });
|
|
95
|
+
Object.defineProperty(exports, "addVariant", { enumerable: true, get: function () { return api_1.addVariant; } });
|
|
96
|
+
Object.defineProperty(exports, "updateVariantHandler", { enumerable: true, get: function () { return api_1.updateVariantHandler; } });
|
|
97
|
+
Object.defineProperty(exports, "deleteVariantHandler", { enumerable: true, get: function () { return api_1.deleteVariantHandler; } });
|
|
98
|
+
// Orders
|
|
99
|
+
Object.defineProperty(exports, "getOrders", { enumerable: true, get: function () { return api_1.getOrders; } });
|
|
100
|
+
Object.defineProperty(exports, "getOrder", { enumerable: true, get: function () { return api_1.getOrder; } });
|
|
101
|
+
Object.defineProperty(exports, "updateOrder", { enumerable: true, get: function () { return api_1.updateOrder; } });
|
|
102
|
+
// Refund
|
|
103
|
+
Object.defineProperty(exports, "processRefundHandler", { enumerable: true, get: function () { return api_1.processRefund; } });
|
|
104
|
+
// Stats
|
|
105
|
+
Object.defineProperty(exports, "getStats", { enumerable: true, get: function () { return api_1.getStats; } });
|
|
106
|
+
// Categories
|
|
107
|
+
Object.defineProperty(exports, "getCategories", { enumerable: true, get: function () { return api_1.getCategories; } });
|
|
108
|
+
Object.defineProperty(exports, "createCategoryHandler", { enumerable: true, get: function () { return api_1.createCategory; } });
|
|
109
|
+
Object.defineProperty(exports, "getCategory", { enumerable: true, get: function () { return api_1.getCategory; } });
|
|
110
|
+
Object.defineProperty(exports, "updateCategoryHandler", { enumerable: true, get: function () { return api_1.updateCategory; } });
|
|
111
|
+
Object.defineProperty(exports, "deleteCategoryHandler", { enumerable: true, get: function () { return api_1.deleteCategory; } });
|
|
112
|
+
// Customers
|
|
113
|
+
Object.defineProperty(exports, "getCustomers", { enumerable: true, get: function () { return api_1.getCustomers; } });
|
|
114
|
+
Object.defineProperty(exports, "getCustomer", { enumerable: true, get: function () { return api_1.getCustomer; } });
|
|
115
|
+
// =============================================================================
|
|
116
|
+
// React Hooks
|
|
117
|
+
// =============================================================================
|
|
118
|
+
var hooks_1 = require("./hooks");
|
|
119
|
+
Object.defineProperty(exports, "useAdminAuth", { enumerable: true, get: function () { return hooks_1.useAdminAuth; } });
|
|
120
|
+
Object.defineProperty(exports, "useAdminStats", { enumerable: true, get: function () { return hooks_1.useAdminStats; } });
|
|
121
|
+
Object.defineProperty(exports, "useAdminProducts", { enumerable: true, get: function () { return hooks_1.useAdminProducts; } });
|
|
122
|
+
Object.defineProperty(exports, "useAdminOrders", { enumerable: true, get: function () { return hooks_1.useAdminOrders; } });
|
|
123
|
+
// =============================================================================
|
|
124
|
+
// React Components
|
|
125
|
+
// =============================================================================
|
|
126
|
+
var components_1 = require("./components");
|
|
127
|
+
// Auth
|
|
128
|
+
Object.defineProperty(exports, "AdminGuard", { enumerable: true, get: function () { return components_1.AdminGuard; } });
|
|
129
|
+
Object.defineProperty(exports, "AdminLoginForm", { enumerable: true, get: function () { return components_1.AdminLoginForm; } });
|
|
130
|
+
// Layout
|
|
131
|
+
Object.defineProperty(exports, "AdminLayout", { enumerable: true, get: function () { return components_1.AdminLayout; } });
|
|
132
|
+
Object.defineProperty(exports, "AdminNav", { enumerable: true, get: function () { return components_1.AdminNav; } });
|
|
133
|
+
Object.defineProperty(exports, "AdminHeader", { enumerable: true, get: function () { return components_1.AdminHeader; } });
|
|
134
|
+
// Dashboard
|
|
135
|
+
Object.defineProperty(exports, "StatsCards", { enumerable: true, get: function () { return components_1.StatsCards; } });
|
|
136
|
+
Object.defineProperty(exports, "RecentOrders", { enumerable: true, get: function () { return components_1.RecentOrders; } });
|
|
137
|
+
Object.defineProperty(exports, "LowStockAlert", { enumerable: true, get: function () { return components_1.LowStockAlert; } });
|
|
138
|
+
// Products
|
|
139
|
+
Object.defineProperty(exports, "ProductTable", { enumerable: true, get: function () { return components_1.ProductTable; } });
|
|
140
|
+
Object.defineProperty(exports, "ProductForm", { enumerable: true, get: function () { return components_1.ProductForm; } });
|
|
141
|
+
Object.defineProperty(exports, "InventoryEditor", { enumerable: true, get: function () { return components_1.InventoryEditor; } });
|
|
142
|
+
// Orders
|
|
143
|
+
Object.defineProperty(exports, "OrderTable", { enumerable: true, get: function () { return components_1.OrderTable; } });
|
|
144
|
+
Object.defineProperty(exports, "OrderDetails", { enumerable: true, get: function () { return components_1.OrderDetails; } });
|
|
145
|
+
Object.defineProperty(exports, "RefundDialog", { enumerable: true, get: function () { return components_1.RefundDialog; } });
|
|
146
|
+
// Settings
|
|
147
|
+
Object.defineProperty(exports, "StoreSettings", { enumerable: true, get: function () { return components_1.StoreSettings; } });
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;;;;AAqFH,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF,mCAMiB;AALf,gHAAA,sBAAsB,OAAA;AACtB,yGAAA,eAAe,OAAA;AACf,2GAAA,iBAAiB,OAAA;AACjB,oHAAA,0BAA0B,OAAA;AAC1B,yGAAA,eAAe,OAAA;AAGjB,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AAEhF,mCAUiB;AATf,2GAAA,iBAAiB,OAAA;AACjB,qGAAA,WAAW,OAAA;AACX,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AACnB,0GAAA,gBAAgB,OAAA;AAChB,uGAAA,aAAa,OAAA;AACb,qGAAA,WAAW,OAAA;AACX,0GAAA,gBAAgB,OAAA;AAChB,qGAAA,WAAW,OAAA;AAGb,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF,6BA6Bc;AA5BZ,OAAO;AACP,8GAAA,uBAAuB,OAAA;AACvB,WAAW;AACX,kGAAA,WAAW,OAAA;AACX,2GAAA,aAAa,OAAwB;AACrC,iGAAA,UAAU,OAAA;AACV,2GAAA,aAAa,OAAw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admin 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 { AdminSession } from '../types';
|
|
9
|
+
export interface CreateAdminResult {
|
|
10
|
+
admin: schema.StoreAdmin;
|
|
11
|
+
}
|
|
12
|
+
export interface AuthenticateAdminResult {
|
|
13
|
+
success: true;
|
|
14
|
+
admin: schema.StoreAdmin;
|
|
15
|
+
}
|
|
16
|
+
export interface AuthenticateAdminError {
|
|
17
|
+
success: false;
|
|
18
|
+
error: string;
|
|
19
|
+
code: 'INVALID_CREDENTIALS' | 'ADMIN_NOT_FOUND';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Authenticate an admin by email and password.
|
|
23
|
+
*
|
|
24
|
+
* @param email - Admin email
|
|
25
|
+
* @param password - Plain text password
|
|
26
|
+
* @returns Authentication result
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const result = await authenticateAdmin('admin@store.com', 'password123')
|
|
31
|
+
* if (result.success) {
|
|
32
|
+
* console.log('Authenticated:', result.admin.email)
|
|
33
|
+
* } else {
|
|
34
|
+
* console.log('Failed:', result.error)
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function authenticateAdmin(email: string, password: string): Promise<AuthenticateAdminResult | AuthenticateAdminError>;
|
|
39
|
+
/**
|
|
40
|
+
* Create a new admin account.
|
|
41
|
+
* Password is hashed before storage.
|
|
42
|
+
*
|
|
43
|
+
* @param email - Admin email (will be lowercased)
|
|
44
|
+
* @param password - Plain text password (min 8 chars)
|
|
45
|
+
* @param name - Admin name
|
|
46
|
+
* @param role - Admin role ('owner' or 'admin')
|
|
47
|
+
* @returns Created admin
|
|
48
|
+
* @throws Error if email already exists
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const { admin } = await createAdmin(
|
|
53
|
+
* 'admin@store.com',
|
|
54
|
+
* 'securePassword123',
|
|
55
|
+
* 'Store Owner',
|
|
56
|
+
* 'owner'
|
|
57
|
+
* )
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function createAdmin(email: string, password: string, name: string, role?: 'owner' | 'admin'): Promise<CreateAdminResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Get admin data for session (excludes sensitive fields).
|
|
63
|
+
*
|
|
64
|
+
* @param adminId - Admin UUID
|
|
65
|
+
* @returns Admin session data or null if not found
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const session = await findAdminForSession(adminId)
|
|
70
|
+
* if (session) {
|
|
71
|
+
* console.log('Admin:', session.email)
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function findAdminForSession(adminId: string): Promise<AdminSession | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Find an admin by email.
|
|
78
|
+
*
|
|
79
|
+
* @param email - Admin email
|
|
80
|
+
* @returns Admin or null if not found
|
|
81
|
+
*/
|
|
82
|
+
export declare function findAdminByEmail(email: string): Promise<schema.StoreAdmin | null>;
|
|
83
|
+
/**
|
|
84
|
+
* Find an admin by ID.
|
|
85
|
+
*
|
|
86
|
+
* @param adminId - Admin UUID
|
|
87
|
+
* @returns Admin or null if not found
|
|
88
|
+
*/
|
|
89
|
+
export declare function findAdminById(adminId: string): Promise<schema.StoreAdmin | null>;
|
|
90
|
+
/**
|
|
91
|
+
* Update admin profile information.
|
|
92
|
+
*
|
|
93
|
+
* @param adminId - Admin UUID
|
|
94
|
+
* @param data - Fields to update
|
|
95
|
+
* @returns Updated admin
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const updated = await updateAdmin(adminId, { name: 'New Name' })
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export declare function updateAdmin(adminId: string, data: {
|
|
103
|
+
name?: string;
|
|
104
|
+
email?: string;
|
|
105
|
+
}): Promise<schema.StoreAdmin | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Update admin password.
|
|
108
|
+
*
|
|
109
|
+
* @param adminId - Admin UUID
|
|
110
|
+
* @param newPassword - New plain text password
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* await updateAdminPassword(adminId, 'newSecurePassword123')
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare function updateAdminPassword(adminId: string, newPassword: string): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Check if email is already registered as an admin.
|
|
120
|
+
*
|
|
121
|
+
* @param email - Email to check
|
|
122
|
+
* @returns True if email exists
|
|
123
|
+
*/
|
|
124
|
+
export declare function adminEmailExists(email: string): Promise<boolean>;
|
|
125
|
+
/**
|
|
126
|
+
* Get the count of admins for the current tenant.
|
|
127
|
+
* Used to check if this is the first admin (should be owner).
|
|
128
|
+
*/
|
|
129
|
+
export declare function countAdmins(): Promise<number>;
|
|
130
|
+
//# sourceMappingURL=admin-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-service.d.ts","sourceRoot":"","sources":["../../../src/admin/server/admin-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAM5C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,IAAI,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,UAAU,CAAA;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,qBAAqB,GAAG,i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,OAAO,CAAC,MAAM,CAAC,CAUnD"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/admin/server/admin-service
|
|
4
|
+
*
|
|
5
|
+
* Admin CRUD operations with tenant isolation.
|
|
6
|
+
* All operations are scoped to the current tenant.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.authenticateAdmin = authenticateAdmin;
|
|
43
|
+
exports.createAdmin = createAdmin;
|
|
44
|
+
exports.findAdminForSession = findAdminForSession;
|
|
45
|
+
exports.findAdminByEmail = findAdminByEmail;
|
|
46
|
+
exports.findAdminById = findAdminById;
|
|
47
|
+
exports.updateAdmin = updateAdmin;
|
|
48
|
+
exports.updateAdminPassword = updateAdminPassword;
|
|
49
|
+
exports.adminEmailExists = adminEmailExists;
|
|
50
|
+
exports.countAdmins = countAdmins;
|
|
51
|
+
const drizzle_orm_1 = require("drizzle-orm");
|
|
52
|
+
const client_1 = require("../../core/db/client");
|
|
53
|
+
const schema = __importStar(require("../../core/db/schema"));
|
|
54
|
+
const password_1 = require("../../auth/server/password");
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// Admin Authentication
|
|
57
|
+
// =============================================================================
|
|
58
|
+
/**
|
|
59
|
+
* Authenticate an admin by email and password.
|
|
60
|
+
*
|
|
61
|
+
* @param email - Admin email
|
|
62
|
+
* @param password - Plain text password
|
|
63
|
+
* @returns Authentication result
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const result = await authenticateAdmin('admin@store.com', 'password123')
|
|
68
|
+
* if (result.success) {
|
|
69
|
+
* console.log('Authenticated:', result.admin.email)
|
|
70
|
+
* } else {
|
|
71
|
+
* console.log('Failed:', result.error)
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
async function authenticateAdmin(email, password) {
|
|
76
|
+
const db = (0, client_1.getDb)();
|
|
77
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
78
|
+
// Find admin by email
|
|
79
|
+
const [admin] = await db
|
|
80
|
+
.select()
|
|
81
|
+
.from(schema.storeAdmins)
|
|
82
|
+
.where((0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId), (0, drizzle_orm_1.eq)(schema.storeAdmins.email, email.toLowerCase().trim())))
|
|
83
|
+
.limit(1);
|
|
84
|
+
if (!admin) {
|
|
85
|
+
return {
|
|
86
|
+
success: false,
|
|
87
|
+
error: 'Invalid email or password',
|
|
88
|
+
code: 'INVALID_CREDENTIALS',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Verify password
|
|
92
|
+
const isValidPassword = await (0, password_1.verifyPassword)(password, admin.passwordHash);
|
|
93
|
+
if (!isValidPassword) {
|
|
94
|
+
return {
|
|
95
|
+
success: false,
|
|
96
|
+
error: 'Invalid email or password',
|
|
97
|
+
code: 'INVALID_CREDENTIALS',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return { success: true, admin };
|
|
101
|
+
}
|
|
102
|
+
// =============================================================================
|
|
103
|
+
// Admin CRUD
|
|
104
|
+
// =============================================================================
|
|
105
|
+
/**
|
|
106
|
+
* Create a new admin account.
|
|
107
|
+
* Password is hashed before storage.
|
|
108
|
+
*
|
|
109
|
+
* @param email - Admin email (will be lowercased)
|
|
110
|
+
* @param password - Plain text password (min 8 chars)
|
|
111
|
+
* @param name - Admin name
|
|
112
|
+
* @param role - Admin role ('owner' or 'admin')
|
|
113
|
+
* @returns Created admin
|
|
114
|
+
* @throws Error if email already exists
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const { admin } = await createAdmin(
|
|
119
|
+
* 'admin@store.com',
|
|
120
|
+
* 'securePassword123',
|
|
121
|
+
* 'Store Owner',
|
|
122
|
+
* 'owner'
|
|
123
|
+
* )
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
async function createAdmin(email, password, name, role = 'admin') {
|
|
127
|
+
const db = (0, client_1.getDb)();
|
|
128
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
129
|
+
// Hash password
|
|
130
|
+
const passwordHash = await (0, password_1.hashPassword)(password);
|
|
131
|
+
try {
|
|
132
|
+
const [admin] = await db
|
|
133
|
+
.insert(schema.storeAdmins)
|
|
134
|
+
.values({
|
|
135
|
+
tenantId,
|
|
136
|
+
email: email.toLowerCase().trim(),
|
|
137
|
+
name: name.trim(),
|
|
138
|
+
passwordHash,
|
|
139
|
+
role,
|
|
140
|
+
})
|
|
141
|
+
.returning();
|
|
142
|
+
return { admin };
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
// Check for unique constraint violation
|
|
146
|
+
const err = error;
|
|
147
|
+
if (err.code === '23505' || err.cause?.code === '23505') {
|
|
148
|
+
throw new Error('An admin with this email already exists');
|
|
149
|
+
}
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get admin data for session (excludes sensitive fields).
|
|
155
|
+
*
|
|
156
|
+
* @param adminId - Admin UUID
|
|
157
|
+
* @returns Admin session data or null if not found
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* const session = await findAdminForSession(adminId)
|
|
162
|
+
* if (session) {
|
|
163
|
+
* console.log('Admin:', session.email)
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
async function findAdminForSession(adminId) {
|
|
168
|
+
const db = (0, client_1.getDb)();
|
|
169
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
170
|
+
const [admin] = await db
|
|
171
|
+
.select({
|
|
172
|
+
id: schema.storeAdmins.id,
|
|
173
|
+
email: schema.storeAdmins.email,
|
|
174
|
+
name: schema.storeAdmins.name,
|
|
175
|
+
role: schema.storeAdmins.role,
|
|
176
|
+
})
|
|
177
|
+
.from(schema.storeAdmins)
|
|
178
|
+
.where((0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId), (0, drizzle_orm_1.eq)(schema.storeAdmins.id, adminId)))
|
|
179
|
+
.limit(1);
|
|
180
|
+
if (!admin) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
id: admin.id,
|
|
185
|
+
email: admin.email,
|
|
186
|
+
name: admin.name,
|
|
187
|
+
role: admin.role,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Find an admin by email.
|
|
192
|
+
*
|
|
193
|
+
* @param email - Admin email
|
|
194
|
+
* @returns Admin or null if not found
|
|
195
|
+
*/
|
|
196
|
+
async function findAdminByEmail(email) {
|
|
197
|
+
const db = (0, client_1.getDb)();
|
|
198
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
199
|
+
const [admin] = await db
|
|
200
|
+
.select()
|
|
201
|
+
.from(schema.storeAdmins)
|
|
202
|
+
.where((0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId), (0, drizzle_orm_1.eq)(schema.storeAdmins.email, email.toLowerCase().trim())))
|
|
203
|
+
.limit(1);
|
|
204
|
+
return admin || null;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Find an admin by ID.
|
|
208
|
+
*
|
|
209
|
+
* @param adminId - Admin UUID
|
|
210
|
+
* @returns Admin or null if not found
|
|
211
|
+
*/
|
|
212
|
+
async function findAdminById(adminId) {
|
|
213
|
+
const db = (0, client_1.getDb)();
|
|
214
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
215
|
+
const [admin] = await db
|
|
216
|
+
.select()
|
|
217
|
+
.from(schema.storeAdmins)
|
|
218
|
+
.where((0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId), (0, drizzle_orm_1.eq)(schema.storeAdmins.id, adminId)))
|
|
219
|
+
.limit(1);
|
|
220
|
+
return admin || null;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Update admin profile information.
|
|
224
|
+
*
|
|
225
|
+
* @param adminId - Admin UUID
|
|
226
|
+
* @param data - Fields to update
|
|
227
|
+
* @returns Updated admin
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* const updated = await updateAdmin(adminId, { name: 'New Name' })
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
async function updateAdmin(adminId, data) {
|
|
235
|
+
const db = (0, client_1.getDb)();
|
|
236
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
237
|
+
const updateData = {};
|
|
238
|
+
if (data.name !== undefined) {
|
|
239
|
+
updateData.name = data.name.trim();
|
|
240
|
+
}
|
|
241
|
+
if (data.email !== undefined) {
|
|
242
|
+
updateData.email = data.email.toLowerCase().trim();
|
|
243
|
+
}
|
|
244
|
+
if (Object.keys(updateData).length === 0) {
|
|
245
|
+
// Nothing to update, return current admin
|
|
246
|
+
return findAdminById(adminId);
|
|
247
|
+
}
|
|
248
|
+
const [admin] = await db
|
|
249
|
+
.update(schema.storeAdmins)
|
|
250
|
+
.set(updateData)
|
|
251
|
+
.where((0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId), (0, drizzle_orm_1.eq)(schema.storeAdmins.id, adminId)))
|
|
252
|
+
.returning();
|
|
253
|
+
return admin || null;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Update admin password.
|
|
257
|
+
*
|
|
258
|
+
* @param adminId - Admin UUID
|
|
259
|
+
* @param newPassword - New plain text password
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```typescript
|
|
263
|
+
* await updateAdminPassword(adminId, 'newSecurePassword123')
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
async function updateAdminPassword(adminId, newPassword) {
|
|
267
|
+
const db = (0, client_1.getDb)();
|
|
268
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
269
|
+
const passwordHash = await (0, password_1.hashPassword)(newPassword);
|
|
270
|
+
await db
|
|
271
|
+
.update(schema.storeAdmins)
|
|
272
|
+
.set({ passwordHash })
|
|
273
|
+
.where((0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId), (0, drizzle_orm_1.eq)(schema.storeAdmins.id, adminId)));
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Check if email is already registered as an admin.
|
|
277
|
+
*
|
|
278
|
+
* @param email - Email to check
|
|
279
|
+
* @returns True if email exists
|
|
280
|
+
*/
|
|
281
|
+
async function adminEmailExists(email) {
|
|
282
|
+
const admin = await findAdminByEmail(email);
|
|
283
|
+
return !!admin;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Get the count of admins for the current tenant.
|
|
287
|
+
* Used to check if this is the first admin (should be owner).
|
|
288
|
+
*/
|
|
289
|
+
async function countAdmins() {
|
|
290
|
+
const db = (0, client_1.getDb)();
|
|
291
|
+
const tenantId = (0, client_1.getTenantId)();
|
|
292
|
+
const result = await db
|
|
293
|
+
.select({ id: schema.storeAdmins.id })
|
|
294
|
+
.from(schema.storeAdmins)
|
|
295
|
+
.where((0, drizzle_orm_1.eq)(schema.storeAdmins.tenantId, tenantId));
|
|
296
|
+
return result.length;
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=admin-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-service.js","sourceRoot":"","sources":["../../../src/admin/server/admin-service.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDH,8CAsCC;AA2BD,kCAiCC;AAgBD,kDAgCC;AAQD,4CAkBC;AAQD,sCAkBC;AAcD,kCAkCC;AAaD,kDAkBC;AAQD,4CAGC;AAMD,kCAUC;AA9VD,6CAAqC;AACrC,iDAAyD;AACzD,6DAA8C;AAC9C,yDAAyE;AAsBzE,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,iBAAiB,CACrC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