@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,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/core/config
|
|
4
|
+
*
|
|
5
|
+
* Configuration system for reading blueprint.json at runtime.
|
|
6
|
+
* The blueprint is generated by Rovela and placed at .rovela/blueprint.json
|
|
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.loadBlueprint = loadBlueprint;
|
|
43
|
+
exports.getBlueprint = getBlueprint;
|
|
44
|
+
exports.getStoreConfig = getStoreConfig;
|
|
45
|
+
exports.clearConfigCache = clearConfigCache;
|
|
46
|
+
exports.blueprintExists = blueprintExists;
|
|
47
|
+
exports.getTheme = getTheme;
|
|
48
|
+
exports.getBrand = getBrand;
|
|
49
|
+
exports.getHomepage = getHomepage;
|
|
50
|
+
exports.getModules = getModules;
|
|
51
|
+
exports.getSEO = getSEO;
|
|
52
|
+
const fs = __importStar(require("fs"));
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// Configuration Loading
|
|
56
|
+
// =============================================================================
|
|
57
|
+
let cachedBlueprint = null;
|
|
58
|
+
let cachedConfig = null;
|
|
59
|
+
/**
|
|
60
|
+
* Default blueprint path relative to project root
|
|
61
|
+
*/
|
|
62
|
+
const DEFAULT_BLUEPRINT_PATH = '.rovela/blueprint.json';
|
|
63
|
+
/**
|
|
64
|
+
* Get the blueprint file path, checking environment variable first
|
|
65
|
+
*/
|
|
66
|
+
function getBlueprintPath() {
|
|
67
|
+
return process.env.ROVELA_BLUEPRINT_PATH || path.join(process.cwd(), DEFAULT_BLUEPRINT_PATH);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Load and parse the blueprint.json file
|
|
71
|
+
* @throws Error if blueprint file is not found or invalid
|
|
72
|
+
*/
|
|
73
|
+
function loadBlueprint() {
|
|
74
|
+
if (cachedBlueprint) {
|
|
75
|
+
return cachedBlueprint;
|
|
76
|
+
}
|
|
77
|
+
const blueprintPath = getBlueprintPath();
|
|
78
|
+
if (!fs.existsSync(blueprintPath)) {
|
|
79
|
+
throw new Error(`Blueprint not found at ${blueprintPath}. ` +
|
|
80
|
+
`Make sure .rovela/blueprint.json exists or set ROVELA_BLUEPRINT_PATH environment variable.`);
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
const content = fs.readFileSync(blueprintPath, 'utf-8');
|
|
84
|
+
cachedBlueprint = JSON.parse(content);
|
|
85
|
+
return cachedBlueprint;
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
throw new Error(`Failed to parse blueprint at ${blueprintPath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get the full blueprint object
|
|
93
|
+
* Use this when you need access to all blueprint data (theme, brand, homepage, etc.)
|
|
94
|
+
*/
|
|
95
|
+
function getBlueprint() {
|
|
96
|
+
return loadBlueprint();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get simplified store configuration
|
|
100
|
+
* Use this for basic store info (name, currency, locale)
|
|
101
|
+
*/
|
|
102
|
+
function getStoreConfig() {
|
|
103
|
+
if (cachedConfig) {
|
|
104
|
+
return cachedConfig;
|
|
105
|
+
}
|
|
106
|
+
const blueprint = loadBlueprint();
|
|
107
|
+
cachedConfig = {
|
|
108
|
+
name: blueprint.store.name,
|
|
109
|
+
slug: blueprint.store.slug,
|
|
110
|
+
currency: blueprint.store.currency,
|
|
111
|
+
locale: blueprint.store.locale,
|
|
112
|
+
ownerEmail: process.env.STORE_OWNER_EMAIL || '',
|
|
113
|
+
};
|
|
114
|
+
return cachedConfig;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Clear cached blueprint and config (useful for testing or hot reloading)
|
|
118
|
+
*/
|
|
119
|
+
function clearConfigCache() {
|
|
120
|
+
cachedBlueprint = null;
|
|
121
|
+
cachedConfig = null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Check if blueprint exists at the expected path
|
|
125
|
+
*/
|
|
126
|
+
function blueprintExists() {
|
|
127
|
+
return fs.existsSync(getBlueprintPath());
|
|
128
|
+
}
|
|
129
|
+
// =============================================================================
|
|
130
|
+
// Convenience Accessors
|
|
131
|
+
// =============================================================================
|
|
132
|
+
/**
|
|
133
|
+
* Get theme configuration from blueprint
|
|
134
|
+
*/
|
|
135
|
+
function getTheme() {
|
|
136
|
+
return loadBlueprint().theme;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get brand configuration from blueprint
|
|
140
|
+
*/
|
|
141
|
+
function getBrand() {
|
|
142
|
+
return loadBlueprint().brand;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Get homepage configuration from blueprint
|
|
146
|
+
*/
|
|
147
|
+
function getHomepage() {
|
|
148
|
+
return loadBlueprint().homepage;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get module configuration from blueprint
|
|
152
|
+
*/
|
|
153
|
+
function getModules() {
|
|
154
|
+
return loadBlueprint().modules;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get SEO configuration from blueprint
|
|
158
|
+
*/
|
|
159
|
+
function getSEO() {
|
|
160
|
+
return loadBlueprint().seo;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/core/db/client
|
|
3
|
+
*
|
|
4
|
+
* Neon serverless database client with Drizzle ORM
|
|
5
|
+
* Includes tenant isolation for multi-tenant e-commerce stores
|
|
6
|
+
*/
|
|
7
|
+
import { NeonQueryFunction } from '@neondatabase/serverless';
|
|
8
|
+
import { NeonHttpDatabase } from 'drizzle-orm/neon-http';
|
|
9
|
+
import * as schema from './schema';
|
|
10
|
+
/**
|
|
11
|
+
* Get the raw Neon SQL client
|
|
12
|
+
* Use this for raw SQL queries when needed
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSql(): NeonQueryFunction<false, false>;
|
|
15
|
+
/**
|
|
16
|
+
* Get the Drizzle ORM database client with full schema
|
|
17
|
+
* This is the main entry point for database operations
|
|
18
|
+
*/
|
|
19
|
+
export declare function getDb(): NeonHttpDatabase<typeof schema>;
|
|
20
|
+
/**
|
|
21
|
+
* Main database client export
|
|
22
|
+
* Usage: import { db } from '@rovela/sdk/core'
|
|
23
|
+
*
|
|
24
|
+
* Note: This is a lazy-loaded proxy to avoid connection at import time
|
|
25
|
+
*/
|
|
26
|
+
export declare const db: NeonHttpDatabase<typeof schema>;
|
|
27
|
+
/**
|
|
28
|
+
* Set the current tenant ID for the request
|
|
29
|
+
* All queries using withTenant() will be scoped to this tenant
|
|
30
|
+
*/
|
|
31
|
+
export declare function setTenantId(tenantId: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get the current tenant ID
|
|
34
|
+
* @throws Error if tenant ID is not set
|
|
35
|
+
*/
|
|
36
|
+
export declare function getTenantId(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Clear the tenant context (call at end of request)
|
|
39
|
+
*/
|
|
40
|
+
export declare function clearTenantId(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Initialize tenant from environment variable
|
|
43
|
+
* Useful for single-tenant deployments
|
|
44
|
+
*/
|
|
45
|
+
export declare function initTenantFromEnv(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Execute a function with a specific tenant context
|
|
48
|
+
* Automatically clears tenant after execution
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const products = await withTenant(tenantId, async () => {
|
|
52
|
+
* return db.query.products.findMany()
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
export declare function withTenant<T>(tenantId: string, fn: () => Promise<T>): Promise<T>;
|
|
56
|
+
/**
|
|
57
|
+
* Check database connection health
|
|
58
|
+
* Returns true if connection is successful
|
|
59
|
+
*/
|
|
60
|
+
export declare function checkConnection(): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Get database connection info (for debugging)
|
|
63
|
+
*/
|
|
64
|
+
export declare function getConnectionInfo(): {
|
|
65
|
+
hasUrl: boolean;
|
|
66
|
+
hasTenant: boolean;
|
|
67
|
+
tenantId: string | null;
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/db/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAW,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAyBlC;;;GAGG;AACH,wBAAgB,MAAM,IAAI,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAKxD;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,gBAAgB,CAAC,OAAO,MAAM,CAAC,CAMvD;AAED;;;;;GAKG;AACH,eAAO,MAAM,EAAE,iCAMb,CAAA;AAYF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAElD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAQpC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAKxC;AAMD;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAYZ;AAMD;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAQxD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI;IACnC,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAMA"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/core/db/client
|
|
4
|
+
*
|
|
5
|
+
* Neon serverless database client with Drizzle ORM
|
|
6
|
+
* Includes tenant isolation for multi-tenant e-commerce stores
|
|
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.db = void 0;
|
|
43
|
+
exports.getSql = getSql;
|
|
44
|
+
exports.getDb = getDb;
|
|
45
|
+
exports.setTenantId = setTenantId;
|
|
46
|
+
exports.getTenantId = getTenantId;
|
|
47
|
+
exports.clearTenantId = clearTenantId;
|
|
48
|
+
exports.initTenantFromEnv = initTenantFromEnv;
|
|
49
|
+
exports.withTenant = withTenant;
|
|
50
|
+
exports.checkConnection = checkConnection;
|
|
51
|
+
exports.getConnectionInfo = getConnectionInfo;
|
|
52
|
+
const serverless_1 = require("@neondatabase/serverless");
|
|
53
|
+
const neon_http_1 = require("drizzle-orm/neon-http");
|
|
54
|
+
const schema = __importStar(require("./schema"));
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// Configuration
|
|
57
|
+
// =============================================================================
|
|
58
|
+
// Get database URL from environment
|
|
59
|
+
function getDatabaseUrl() {
|
|
60
|
+
const url = process.env.DATABASE_URL;
|
|
61
|
+
if (!url) {
|
|
62
|
+
throw new Error('DATABASE_URL environment variable is not set. ' +
|
|
63
|
+
'Please set it to your Neon database connection string.');
|
|
64
|
+
}
|
|
65
|
+
return url;
|
|
66
|
+
}
|
|
67
|
+
// =============================================================================
|
|
68
|
+
// Database Client
|
|
69
|
+
// =============================================================================
|
|
70
|
+
let _sql = null;
|
|
71
|
+
let _db = null;
|
|
72
|
+
/**
|
|
73
|
+
* Get the raw Neon SQL client
|
|
74
|
+
* Use this for raw SQL queries when needed
|
|
75
|
+
*/
|
|
76
|
+
function getSql() {
|
|
77
|
+
if (!_sql) {
|
|
78
|
+
_sql = (0, serverless_1.neon)(getDatabaseUrl());
|
|
79
|
+
}
|
|
80
|
+
return _sql;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the Drizzle ORM database client with full schema
|
|
84
|
+
* This is the main entry point for database operations
|
|
85
|
+
*/
|
|
86
|
+
function getDb() {
|
|
87
|
+
if (!_db) {
|
|
88
|
+
const sql = getSql();
|
|
89
|
+
_db = (0, neon_http_1.drizzle)(sql, { schema });
|
|
90
|
+
}
|
|
91
|
+
return _db;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Main database client export
|
|
95
|
+
* Usage: import { db } from '@rovela/sdk/core'
|
|
96
|
+
*
|
|
97
|
+
* Note: This is a lazy-loaded proxy to avoid connection at import time
|
|
98
|
+
*/
|
|
99
|
+
exports.db = new Proxy({}, {
|
|
100
|
+
get(_target, prop) {
|
|
101
|
+
const database = getDb();
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
|
+
return database[prop];
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
// =============================================================================
|
|
107
|
+
// Tenant Context
|
|
108
|
+
// =============================================================================
|
|
109
|
+
/**
|
|
110
|
+
* Tenant context for multi-tenant isolation
|
|
111
|
+
* Set this at the start of each request to ensure queries are scoped
|
|
112
|
+
*/
|
|
113
|
+
let currentTenantId = null;
|
|
114
|
+
/**
|
|
115
|
+
* Set the current tenant ID for the request
|
|
116
|
+
* All queries using withTenant() will be scoped to this tenant
|
|
117
|
+
*/
|
|
118
|
+
function setTenantId(tenantId) {
|
|
119
|
+
currentTenantId = tenantId;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get the current tenant ID
|
|
123
|
+
* @throws Error if tenant ID is not set
|
|
124
|
+
*/
|
|
125
|
+
function getTenantId() {
|
|
126
|
+
if (!currentTenantId) {
|
|
127
|
+
throw new Error('Tenant ID not set. Call setTenantId() at the start of each request, ' +
|
|
128
|
+
'or set TENANT_ID environment variable.');
|
|
129
|
+
}
|
|
130
|
+
return currentTenantId;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Clear the tenant context (call at end of request)
|
|
134
|
+
*/
|
|
135
|
+
function clearTenantId() {
|
|
136
|
+
currentTenantId = null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Initialize tenant from environment variable
|
|
140
|
+
* Useful for single-tenant deployments
|
|
141
|
+
*/
|
|
142
|
+
function initTenantFromEnv() {
|
|
143
|
+
const envTenantId = process.env.TENANT_ID;
|
|
144
|
+
if (envTenantId) {
|
|
145
|
+
setTenantId(envTenantId);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// =============================================================================
|
|
149
|
+
// Request Scoped Tenant (for middleware)
|
|
150
|
+
// =============================================================================
|
|
151
|
+
/**
|
|
152
|
+
* Execute a function with a specific tenant context
|
|
153
|
+
* Automatically clears tenant after execution
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* const products = await withTenant(tenantId, async () => {
|
|
157
|
+
* return db.query.products.findMany()
|
|
158
|
+
* })
|
|
159
|
+
*/
|
|
160
|
+
async function withTenant(tenantId, fn) {
|
|
161
|
+
const previousTenantId = currentTenantId;
|
|
162
|
+
try {
|
|
163
|
+
setTenantId(tenantId);
|
|
164
|
+
return await fn();
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
if (previousTenantId) {
|
|
168
|
+
setTenantId(previousTenantId);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
clearTenantId();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// =============================================================================
|
|
176
|
+
// Connection Health
|
|
177
|
+
// =============================================================================
|
|
178
|
+
/**
|
|
179
|
+
* Check database connection health
|
|
180
|
+
* Returns true if connection is successful
|
|
181
|
+
*/
|
|
182
|
+
async function checkConnection() {
|
|
183
|
+
try {
|
|
184
|
+
const sql = getSql();
|
|
185
|
+
await sql `SELECT 1`;
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get database connection info (for debugging)
|
|
194
|
+
*/
|
|
195
|
+
function getConnectionInfo() {
|
|
196
|
+
return {
|
|
197
|
+
hasUrl: !!process.env.DATABASE_URL,
|
|
198
|
+
hasTenant: !!currentTenantId,
|
|
199
|
+
tenantId: currentTenantId,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/core/db/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/core/db
|
|
3
|
+
*
|
|
4
|
+
* Database module exports
|
|
5
|
+
*/
|
|
6
|
+
export { db, getDb, getSql, setTenantId, getTenantId, clearTenantId, initTenantFromEnv, withTenant, checkConnection, getConnectionInfo, } from './client';
|
|
7
|
+
export * as schema from './schema';
|
|
8
|
+
export type { Product, NewProduct, ProductVariant, NewProductVariant, Category, NewCategory, Order, NewOrder, OrderItem, NewOrderItem, Customer, NewCustomer, StoreAdmin, NewStoreAdmin, } from './schema';
|
|
9
|
+
export { findProducts, findProductBySlug, findProductById, findProductVariants, countProducts, createProduct, updateProduct, deleteProduct, hardDeleteProduct, createProductVariant, updateProductVariant, deleteProductVariant, updateVariantInventory, findVariantById, findCategories, findCategoryBySlug, findCategoryById, countCategories, createCategory, updateCategory, deleteCategory, findOrders, findOrderById, findOrderItems, findOrderByPaymentIntent, countOrders, getRevenueByPeriod, getOrdersByStatus, createOrder, createOrderItems, updateOrderStatus, findCustomerByEmail, findCustomerById, findCustomers, countCustomers, findCustomerOrders, findAdminByEmail, getStoreStats, getLowStockProducts, getRecentOrders, } from './queries';
|
|
10
|
+
export type { FindProductsOptions, FindOrdersOptions } from './queries';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/db/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,EAAE,EACF,KAAK,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAGjB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAGlC,YAAY,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,UAAU,CAAA;AAGjB,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,aAAa,EAEb,aAAa,EACb,aAAa,EACb,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EAEf,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EAEf,cAAc,EACd,cAAc,EACd,cAAc,EAEd,UAAU,EACV,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EAEjB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EAEjB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,kBAAkB,EAElB,gBAAgB,EAEhB,aAAa,EACb,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/core/db
|
|
4
|
+
*
|
|
5
|
+
* Database module exports
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.getLowStockProducts = exports.getStoreStats = exports.findAdminByEmail = exports.findCustomerOrders = exports.countCustomers = exports.findCustomers = exports.findCustomerById = exports.findCustomerByEmail = exports.updateOrderStatus = exports.createOrderItems = exports.createOrder = exports.getOrdersByStatus = exports.getRevenueByPeriod = exports.countOrders = exports.findOrderByPaymentIntent = exports.findOrderItems = exports.findOrderById = exports.findOrders = exports.deleteCategory = exports.updateCategory = exports.createCategory = exports.countCategories = exports.findCategoryById = exports.findCategoryBySlug = exports.findCategories = exports.findVariantById = exports.updateVariantInventory = exports.deleteProductVariant = exports.updateProductVariant = exports.createProductVariant = exports.hardDeleteProduct = exports.deleteProduct = exports.updateProduct = exports.createProduct = exports.countProducts = exports.findProductVariants = exports.findProductById = exports.findProductBySlug = exports.findProducts = exports.schema = exports.getConnectionInfo = exports.checkConnection = exports.withTenant = exports.initTenantFromEnv = exports.clearTenantId = exports.getTenantId = exports.setTenantId = exports.getSql = exports.getDb = exports.db = void 0;
|
|
42
|
+
exports.getRecentOrders = void 0;
|
|
43
|
+
// Client and tenant management
|
|
44
|
+
var client_1 = require("./client");
|
|
45
|
+
Object.defineProperty(exports, "db", { enumerable: true, get: function () { return client_1.db; } });
|
|
46
|
+
Object.defineProperty(exports, "getDb", { enumerable: true, get: function () { return client_1.getDb; } });
|
|
47
|
+
Object.defineProperty(exports, "getSql", { enumerable: true, get: function () { return client_1.getSql; } });
|
|
48
|
+
Object.defineProperty(exports, "setTenantId", { enumerable: true, get: function () { return client_1.setTenantId; } });
|
|
49
|
+
Object.defineProperty(exports, "getTenantId", { enumerable: true, get: function () { return client_1.getTenantId; } });
|
|
50
|
+
Object.defineProperty(exports, "clearTenantId", { enumerable: true, get: function () { return client_1.clearTenantId; } });
|
|
51
|
+
Object.defineProperty(exports, "initTenantFromEnv", { enumerable: true, get: function () { return client_1.initTenantFromEnv; } });
|
|
52
|
+
Object.defineProperty(exports, "withTenant", { enumerable: true, get: function () { return client_1.withTenant; } });
|
|
53
|
+
Object.defineProperty(exports, "checkConnection", { enumerable: true, get: function () { return client_1.checkConnection; } });
|
|
54
|
+
Object.defineProperty(exports, "getConnectionInfo", { enumerable: true, get: function () { return client_1.getConnectionInfo; } });
|
|
55
|
+
// Schema exports
|
|
56
|
+
exports.schema = __importStar(require("./schema"));
|
|
57
|
+
// Query helpers
|
|
58
|
+
var queries_1 = require("./queries");
|
|
59
|
+
// Products (queries)
|
|
60
|
+
Object.defineProperty(exports, "findProducts", { enumerable: true, get: function () { return queries_1.findProducts; } });
|
|
61
|
+
Object.defineProperty(exports, "findProductBySlug", { enumerable: true, get: function () { return queries_1.findProductBySlug; } });
|
|
62
|
+
Object.defineProperty(exports, "findProductById", { enumerable: true, get: function () { return queries_1.findProductById; } });
|
|
63
|
+
Object.defineProperty(exports, "findProductVariants", { enumerable: true, get: function () { return queries_1.findProductVariants; } });
|
|
64
|
+
Object.defineProperty(exports, "countProducts", { enumerable: true, get: function () { return queries_1.countProducts; } });
|
|
65
|
+
// Products (mutations)
|
|
66
|
+
Object.defineProperty(exports, "createProduct", { enumerable: true, get: function () { return queries_1.createProduct; } });
|
|
67
|
+
Object.defineProperty(exports, "updateProduct", { enumerable: true, get: function () { return queries_1.updateProduct; } });
|
|
68
|
+
Object.defineProperty(exports, "deleteProduct", { enumerable: true, get: function () { return queries_1.deleteProduct; } });
|
|
69
|
+
Object.defineProperty(exports, "hardDeleteProduct", { enumerable: true, get: function () { return queries_1.hardDeleteProduct; } });
|
|
70
|
+
// Product Variants (mutations)
|
|
71
|
+
Object.defineProperty(exports, "createProductVariant", { enumerable: true, get: function () { return queries_1.createProductVariant; } });
|
|
72
|
+
Object.defineProperty(exports, "updateProductVariant", { enumerable: true, get: function () { return queries_1.updateProductVariant; } });
|
|
73
|
+
Object.defineProperty(exports, "deleteProductVariant", { enumerable: true, get: function () { return queries_1.deleteProductVariant; } });
|
|
74
|
+
Object.defineProperty(exports, "updateVariantInventory", { enumerable: true, get: function () { return queries_1.updateVariantInventory; } });
|
|
75
|
+
Object.defineProperty(exports, "findVariantById", { enumerable: true, get: function () { return queries_1.findVariantById; } });
|
|
76
|
+
// Categories (queries)
|
|
77
|
+
Object.defineProperty(exports, "findCategories", { enumerable: true, get: function () { return queries_1.findCategories; } });
|
|
78
|
+
Object.defineProperty(exports, "findCategoryBySlug", { enumerable: true, get: function () { return queries_1.findCategoryBySlug; } });
|
|
79
|
+
Object.defineProperty(exports, "findCategoryById", { enumerable: true, get: function () { return queries_1.findCategoryById; } });
|
|
80
|
+
Object.defineProperty(exports, "countCategories", { enumerable: true, get: function () { return queries_1.countCategories; } });
|
|
81
|
+
// Categories (mutations)
|
|
82
|
+
Object.defineProperty(exports, "createCategory", { enumerable: true, get: function () { return queries_1.createCategory; } });
|
|
83
|
+
Object.defineProperty(exports, "updateCategory", { enumerable: true, get: function () { return queries_1.updateCategory; } });
|
|
84
|
+
Object.defineProperty(exports, "deleteCategory", { enumerable: true, get: function () { return queries_1.deleteCategory; } });
|
|
85
|
+
// Orders (queries)
|
|
86
|
+
Object.defineProperty(exports, "findOrders", { enumerable: true, get: function () { return queries_1.findOrders; } });
|
|
87
|
+
Object.defineProperty(exports, "findOrderById", { enumerable: true, get: function () { return queries_1.findOrderById; } });
|
|
88
|
+
Object.defineProperty(exports, "findOrderItems", { enumerable: true, get: function () { return queries_1.findOrderItems; } });
|
|
89
|
+
Object.defineProperty(exports, "findOrderByPaymentIntent", { enumerable: true, get: function () { return queries_1.findOrderByPaymentIntent; } });
|
|
90
|
+
Object.defineProperty(exports, "countOrders", { enumerable: true, get: function () { return queries_1.countOrders; } });
|
|
91
|
+
Object.defineProperty(exports, "getRevenueByPeriod", { enumerable: true, get: function () { return queries_1.getRevenueByPeriod; } });
|
|
92
|
+
Object.defineProperty(exports, "getOrdersByStatus", { enumerable: true, get: function () { return queries_1.getOrdersByStatus; } });
|
|
93
|
+
// Orders (mutations)
|
|
94
|
+
Object.defineProperty(exports, "createOrder", { enumerable: true, get: function () { return queries_1.createOrder; } });
|
|
95
|
+
Object.defineProperty(exports, "createOrderItems", { enumerable: true, get: function () { return queries_1.createOrderItems; } });
|
|
96
|
+
Object.defineProperty(exports, "updateOrderStatus", { enumerable: true, get: function () { return queries_1.updateOrderStatus; } });
|
|
97
|
+
// Customers (queries)
|
|
98
|
+
Object.defineProperty(exports, "findCustomerByEmail", { enumerable: true, get: function () { return queries_1.findCustomerByEmail; } });
|
|
99
|
+
Object.defineProperty(exports, "findCustomerById", { enumerable: true, get: function () { return queries_1.findCustomerById; } });
|
|
100
|
+
Object.defineProperty(exports, "findCustomers", { enumerable: true, get: function () { return queries_1.findCustomers; } });
|
|
101
|
+
Object.defineProperty(exports, "countCustomers", { enumerable: true, get: function () { return queries_1.countCustomers; } });
|
|
102
|
+
Object.defineProperty(exports, "findCustomerOrders", { enumerable: true, get: function () { return queries_1.findCustomerOrders; } });
|
|
103
|
+
// Admins
|
|
104
|
+
Object.defineProperty(exports, "findAdminByEmail", { enumerable: true, get: function () { return queries_1.findAdminByEmail; } });
|
|
105
|
+
// Stats
|
|
106
|
+
Object.defineProperty(exports, "getStoreStats", { enumerable: true, get: function () { return queries_1.getStoreStats; } });
|
|
107
|
+
Object.defineProperty(exports, "getLowStockProducts", { enumerable: true, get: function () { return queries_1.getLowStockProducts; } });
|
|
108
|
+
Object.defineProperty(exports, "getRecentOrders", { enumerable: true, get: function () { return queries_1.getRecentOrders; } });
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/db/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+BAA+B;AAC/B,mCAWiB;AAVf,4FAAA,EAAE,OAAA;AACF,+FAAA,KAAK,OAAA;AACL,gGAAA,MAAM,OAAA;AACN,qGAAA,WAAW,OAAA;AACX,qGAAA,WAAW,OAAA;AACX,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA;AACjB,oGAAA,UAAU,OAAA;AACV,yGAAA,eAAe,OAAA;AACf,2GAAA,iBAAiB,OAAA;AAGnB,iBAAiB;AACjB,mDAAkC;AAoBlC,gBAAgB;AAChB,qCAmDkB;AAlDhB,qBAAqB;AACrB,uGAAA,YAAY,OAAA;AACZ,4GAAA,iBAAiB,OAAA;AACjB,0GAAA,eAAe,OAAA;AACf,8GAAA,mBAAmB,OAAA;AACnB,wGAAA,aAAa,OAAA;AACb,uBAAuB;AACvB,wGAAA,aAAa,OAAA;AACb,wGAAA,aAAa,OAAA;AACb,wGAAA,aAAa,OAAA;AACb,4GAAA,iBAAiB,OAAA;AACjB,+BAA+B;AAC/B,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,iHAAA,sBAAsB,OAAA;AACtB,0GAAA,eAAe,OAAA;AACf,uBAAuB;AACvB,yGAAA,cAAc,OAAA;AACd,6GAAA,kBAAkB,OAAA;AAClB,2GAAA,gBAAgB,OAAA;AAChB,0GAAA,eAAe,OAAA;AACf,yBAAyB;AACzB,yGAAA,cAAc,OAAA;AACd,yGAAA,cAAc,OAAA;AACd,yGAAA,cAAc,OAAA;AACd,mBAAmB;AACnB,qGAAA,UAAU,OAAA;AACV,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,mHAAA,wBAAwB,OAAA;AACxB,sGAAA,WAAW,OAAA;AACX,6GAAA,kBAAkB,OAAA;AAClB,4GAAA,iBAAiB,OAAA;AACjB,qBAAqB;AACrB,sGAAA,WAAW,OAAA;AACX,2GAAA,gBAAgB,OAAA;AAChB,4GAAA,iBAAiB,OAAA;AACjB,sBAAsB;AACtB,8GAAA,mBAAmB,OAAA;AACnB,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,6GAAA,kBAAkB,OAAA;AAClB,SAAS;AACT,2GAAA,gBAAgB,OAAA;AAChB,QAAQ;AACR,wGAAA,aAAa,OAAA;AACb,8GAAA,mBAAmB,OAAA;AACnB,0GAAA,eAAe,OAAA"}
|