@rovela-ai/sdk 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/api/accept-invite.d.ts +65 -0
- package/dist/admin/api/accept-invite.d.ts.map +1 -0
- package/dist/admin/api/accept-invite.js +115 -0
- package/dist/admin/api/accept-invite.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 +266 -0
- package/dist/admin/api/categories.js.map +1 -0
- package/dist/admin/api/check.d.ts +38 -0
- package/dist/admin/api/check.d.ts.map +1 -0
- package/dist/admin/api/check.js +49 -0
- package/dist/admin/api/check.js.map +1 -0
- package/dist/admin/api/customers.d.ts +77 -0
- package/dist/admin/api/customers.d.ts.map +1 -0
- package/dist/admin/api/customers.js +219 -0
- package/dist/admin/api/customers.js.map +1 -0
- package/dist/admin/api/forgot-password.d.ts +39 -0
- package/dist/admin/api/forgot-password.d.ts.map +1 -0
- package/dist/admin/api/forgot-password.js +66 -0
- package/dist/admin/api/forgot-password.js.map +1 -0
- package/dist/admin/api/index.d.ts +109 -0
- package/dist/admin/api/index.d.ts.map +1 -0
- package/dist/admin/api/index.js +128 -0
- package/dist/admin/api/index.js.map +1 -0
- package/dist/admin/api/linked-customer.d.ts +32 -0
- package/dist/admin/api/linked-customer.d.ts.map +1 -0
- package/dist/admin/api/linked-customer.js +45 -0
- package/dist/admin/api/linked-customer.js.map +1 -0
- package/dist/admin/api/me.d.ts +72 -0
- package/dist/admin/api/me.d.ts.map +1 -0
- package/dist/admin/api/me.js +177 -0
- package/dist/admin/api/me.js.map +1 -0
- package/dist/admin/api/orders.d.ts +91 -0
- package/dist/admin/api/orders.d.ts.map +1 -0
- package/dist/admin/api/orders.js +390 -0
- package/dist/admin/api/orders.js.map +1 -0
- package/dist/admin/api/products-bulk.d.ts +38 -0
- package/dist/admin/api/products-bulk.d.ts.map +1 -0
- package/dist/admin/api/products-bulk.js +135 -0
- package/dist/admin/api/products-bulk.js.map +1 -0
- package/dist/admin/api/products-stats.d.ts +34 -0
- package/dist/admin/api/products-stats.d.ts.map +1 -0
- package/dist/admin/api/products-stats.js +43 -0
- package/dist/admin/api/products-stats.js.map +1 -0
- package/dist/admin/api/products.d.ts +104 -0
- package/dist/admin/api/products.d.ts.map +1 -0
- package/dist/admin/api/products.js +491 -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 +142 -0
- package/dist/admin/api/refund.js.map +1 -0
- package/dist/admin/api/reset-password.d.ts +49 -0
- package/dist/admin/api/reset-password.d.ts.map +1 -0
- package/dist/admin/api/reset-password.js +99 -0
- package/dist/admin/api/reset-password.js.map +1 -0
- package/dist/admin/api/return.d.ts +47 -0
- package/dist/admin/api/return.d.ts.map +1 -0
- package/dist/admin/api/return.js +186 -0
- package/dist/admin/api/return.js.map +1 -0
- package/dist/admin/api/settings.d.ts +49 -0
- package/dist/admin/api/settings.d.ts.map +1 -0
- package/dist/admin/api/settings.js +201 -0
- package/dist/admin/api/settings.js.map +1 -0
- package/dist/admin/api/setup-guide.d.ts +78 -0
- package/dist/admin/api/setup-guide.d.ts.map +1 -0
- package/dist/admin/api/setup-guide.js +235 -0
- package/dist/admin/api/setup-guide.js.map +1 -0
- package/dist/admin/api/setup.d.ts +60 -0
- package/dist/admin/api/setup.d.ts.map +1 -0
- package/dist/admin/api/setup.js +126 -0
- package/dist/admin/api/setup.js.map +1 -0
- package/dist/admin/api/shipping.d.ts +287 -0
- package/dist/admin/api/shipping.d.ts.map +1 -0
- package/dist/admin/api/shipping.js +746 -0
- package/dist/admin/api/shipping.js.map +1 -0
- package/dist/admin/api/stats.d.ts +43 -0
- package/dist/admin/api/stats.d.ts.map +1 -0
- package/dist/admin/api/stats.js +92 -0
- package/dist/admin/api/stats.js.map +1 -0
- package/dist/admin/api/stripe-status.d.ts +39 -0
- package/dist/admin/api/stripe-status.d.ts.map +1 -0
- package/dist/admin/api/stripe-status.js +99 -0
- package/dist/admin/api/stripe-status.js.map +1 -0
- package/dist/admin/api/tax-zones.d.ts +97 -0
- package/dist/admin/api/tax-zones.d.ts.map +1 -0
- package/dist/admin/api/tax-zones.js +265 -0
- package/dist/admin/api/tax-zones.js.map +1 -0
- package/dist/admin/api/users.d.ts +142 -0
- package/dist/admin/api/users.d.ts.map +1 -0
- package/dist/admin/api/users.js +355 -0
- package/dist/admin/api/users.js.map +1 -0
- package/dist/admin/components/AdminAcceptInviteForm.d.ts +3 -0
- package/dist/admin/components/AdminAcceptInviteForm.d.ts.map +1 -0
- package/dist/admin/components/AdminAcceptInviteForm.js +137 -0
- package/dist/admin/components/AdminAcceptInviteForm.js.map +1 -0
- package/dist/admin/components/AdminAccountPage.d.ts +10 -0
- package/dist/admin/components/AdminAccountPage.d.ts.map +1 -0
- package/dist/admin/components/AdminAccountPage.js +126 -0
- package/dist/admin/components/AdminAccountPage.js.map +1 -0
- package/dist/admin/components/AdminBarBanner.d.ts +2 -0
- package/dist/admin/components/AdminBarBanner.d.ts.map +1 -0
- package/dist/admin/components/AdminBarBanner.js +266 -0
- package/dist/admin/components/AdminBarBanner.js.map +1 -0
- package/dist/admin/components/AdminForgotPasswordForm.d.ts +8 -0
- package/dist/admin/components/AdminForgotPasswordForm.d.ts.map +1 -0
- package/dist/admin/components/AdminForgotPasswordForm.js +59 -0
- package/dist/admin/components/AdminForgotPasswordForm.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 +94 -0
- package/dist/admin/components/AdminGuard.js.map +1 -0
- package/dist/admin/components/AdminLayout.d.ts +40 -0
- package/dist/admin/components/AdminLayout.d.ts.map +1 -0
- package/dist/admin/components/AdminLayout.js +39 -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 +61 -0
- package/dist/admin/components/AdminLoginForm.js.map +1 -0
- package/dist/admin/components/AdminNav.d.ts +44 -0
- package/dist/admin/components/AdminNav.d.ts.map +1 -0
- package/dist/admin/components/AdminNav.js +175 -0
- package/dist/admin/components/AdminNav.js.map +1 -0
- package/dist/admin/components/AdminResetPasswordForm.d.ts +12 -0
- package/dist/admin/components/AdminResetPasswordForm.d.ts.map +1 -0
- package/dist/admin/components/AdminResetPasswordForm.js +134 -0
- package/dist/admin/components/AdminResetPasswordForm.js.map +1 -0
- package/dist/admin/components/AdminSelect.d.ts +47 -0
- package/dist/admin/components/AdminSelect.d.ts.map +1 -0
- package/dist/admin/components/AdminSelect.js +71 -0
- package/dist/admin/components/AdminSelect.js.map +1 -0
- package/dist/admin/components/AdminToast.d.ts +31 -0
- package/dist/admin/components/AdminToast.d.ts.map +1 -0
- package/dist/admin/components/AdminToast.js +83 -0
- package/dist/admin/components/AdminToast.js.map +1 -0
- package/dist/admin/components/AdminUserMenu.d.ts +14 -0
- package/dist/admin/components/AdminUserMenu.d.ts.map +1 -0
- package/dist/admin/components/AdminUserMenu.js +34 -0
- package/dist/admin/components/AdminUserMenu.js.map +1 -0
- package/dist/admin/components/CategoryForm.d.ts +30 -0
- package/dist/admin/components/CategoryForm.d.ts.map +1 -0
- package/dist/admin/components/CategoryForm.js +152 -0
- package/dist/admin/components/CategoryForm.js.map +1 -0
- package/dist/admin/components/CategorySelect.d.ts +32 -0
- package/dist/admin/components/CategorySelect.d.ts.map +1 -0
- package/dist/admin/components/CategorySelect.js +139 -0
- package/dist/admin/components/CategorySelect.js.map +1 -0
- package/dist/admin/components/CustomerDetails.d.ts +15 -0
- package/dist/admin/components/CustomerDetails.d.ts.map +1 -0
- package/dist/admin/components/CustomerDetails.js +177 -0
- package/dist/admin/components/CustomerDetails.js.map +1 -0
- package/dist/admin/components/CustomerTable.d.ts +13 -0
- package/dist/admin/components/CustomerTable.d.ts.map +1 -0
- package/dist/admin/components/CustomerTable.js +112 -0
- package/dist/admin/components/CustomerTable.js.map +1 -0
- package/dist/admin/components/DeleteConfirmDialog.d.ts +56 -0
- package/dist/admin/components/DeleteConfirmDialog.d.ts.map +1 -0
- package/dist/admin/components/DeleteConfirmDialog.js +46 -0
- package/dist/admin/components/DeleteConfirmDialog.js.map +1 -0
- package/dist/admin/components/ExampleContentBanner.d.ts +2 -0
- package/dist/admin/components/ExampleContentBanner.d.ts.map +1 -0
- package/dist/admin/components/ExampleContentBanner.js +153 -0
- package/dist/admin/components/ExampleContentBanner.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 +86 -0
- package/dist/admin/components/InventoryEditor.js.map +1 -0
- package/dist/admin/components/InviteUserDialog.d.ts +3 -0
- package/dist/admin/components/InviteUserDialog.d.ts.map +1 -0
- package/dist/admin/components/InviteUserDialog.js +126 -0
- package/dist/admin/components/InviteUserDialog.js.map +1 -0
- package/dist/admin/components/LogoUpload.d.ts +22 -0
- package/dist/admin/components/LogoUpload.d.ts.map +1 -0
- package/dist/admin/components/LogoUpload.js +210 -0
- package/dist/admin/components/LogoUpload.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 +33 -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 +210 -0
- package/dist/admin/components/OrderDetails.js.map +1 -0
- package/dist/admin/components/OrderStatusChart.d.ts +21 -0
- package/dist/admin/components/OrderStatusChart.d.ts.map +1 -0
- package/dist/admin/components/OrderStatusChart.js +61 -0
- package/dist/admin/components/OrderStatusChart.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 +117 -0
- package/dist/admin/components/OrderTable.js.map +1 -0
- package/dist/admin/components/PaymentSettings.d.ts +13 -0
- package/dist/admin/components/PaymentSettings.d.ts.map +1 -0
- package/dist/admin/components/PaymentSettings.js +117 -0
- package/dist/admin/components/PaymentSettings.js.map +1 -0
- package/dist/admin/components/PeriodSelector.d.ts +9 -0
- package/dist/admin/components/PeriodSelector.d.ts.map +1 -0
- package/dist/admin/components/PeriodSelector.js +19 -0
- package/dist/admin/components/PeriodSelector.js.map +1 -0
- package/dist/admin/components/PermissionsMatrix.d.ts +8 -0
- package/dist/admin/components/PermissionsMatrix.d.ts.map +1 -0
- package/dist/admin/components/PermissionsMatrix.js +70 -0
- package/dist/admin/components/PermissionsMatrix.js.map +1 -0
- package/dist/admin/components/PrimaryMetricsRow.d.ts +11 -0
- package/dist/admin/components/PrimaryMetricsRow.d.ts.map +1 -0
- package/dist/admin/components/PrimaryMetricsRow.js +73 -0
- package/dist/admin/components/PrimaryMetricsRow.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 +251 -0
- package/dist/admin/components/ProductForm.js.map +1 -0
- package/dist/admin/components/ProductTable.d.ts +14 -0
- package/dist/admin/components/ProductTable.d.ts.map +1 -0
- package/dist/admin/components/ProductTable.js +384 -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 +63 -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 +90 -0
- package/dist/admin/components/RefundDialog.js.map +1 -0
- package/dist/admin/components/RevenueChart.d.ts +23 -0
- package/dist/admin/components/RevenueChart.d.ts.map +1 -0
- package/dist/admin/components/RevenueChart.js +75 -0
- package/dist/admin/components/RevenueChart.js.map +1 -0
- package/dist/admin/components/SEOPreview.d.ts +33 -0
- package/dist/admin/components/SEOPreview.d.ts.map +1 -0
- package/dist/admin/components/SEOPreview.js +30 -0
- package/dist/admin/components/SEOPreview.js.map +1 -0
- package/dist/admin/components/SecondaryMetricsRow.d.ts +14 -0
- package/dist/admin/components/SecondaryMetricsRow.d.ts.map +1 -0
- package/dist/admin/components/SecondaryMetricsRow.js +45 -0
- package/dist/admin/components/SecondaryMetricsRow.js.map +1 -0
- package/dist/admin/components/SetupGuide.d.ts +4 -0
- package/dist/admin/components/SetupGuide.d.ts.map +1 -0
- package/dist/admin/components/SetupGuide.js +244 -0
- package/dist/admin/components/SetupGuide.js.map +1 -0
- package/dist/admin/components/ShippingSettings.d.ts +3 -0
- package/dist/admin/components/ShippingSettings.d.ts.map +1 -0
- package/dist/admin/components/ShippingSettings.js +553 -0
- package/dist/admin/components/ShippingSettings.js.map +1 -0
- package/dist/admin/components/StatsCards.d.ts +18 -0
- package/dist/admin/components/StatsCards.d.ts.map +1 -0
- package/dist/admin/components/StatsCards.js +71 -0
- package/dist/admin/components/StatsCards.js.map +1 -0
- package/dist/admin/components/StoreSettings.d.ts +19 -0
- package/dist/admin/components/StoreSettings.d.ts.map +1 -0
- package/dist/admin/components/StoreSettings.js +149 -0
- package/dist/admin/components/StoreSettings.js.map +1 -0
- package/dist/admin/components/TagInput.d.ts +29 -0
- package/dist/admin/components/TagInput.d.ts.map +1 -0
- package/dist/admin/components/TagInput.js +69 -0
- package/dist/admin/components/TagInput.js.map +1 -0
- package/dist/admin/components/TaxSettings.d.ts +12 -0
- package/dist/admin/components/TaxSettings.d.ts.map +1 -0
- package/dist/admin/components/TaxSettings.js +272 -0
- package/dist/admin/components/TaxSettings.js.map +1 -0
- package/dist/admin/components/UsersTable.d.ts +3 -0
- package/dist/admin/components/UsersTable.d.ts.map +1 -0
- package/dist/admin/components/UsersTable.js +388 -0
- package/dist/admin/components/UsersTable.js.map +1 -0
- package/dist/admin/components/VariantManager.d.ts +44 -0
- package/dist/admin/components/VariantManager.d.ts.map +1 -0
- package/dist/admin/components/VariantManager.js +324 -0
- package/dist/admin/components/VariantManager.js.map +1 -0
- package/dist/admin/components/index.d.ts +69 -0
- package/dist/admin/components/index.d.ts.map +1 -0
- package/dist/admin/components/index.js +86 -0
- package/dist/admin/components/index.js.map +1 -0
- package/dist/admin/config.d.ts +51 -0
- package/dist/admin/config.d.ts.map +1 -0
- package/dist/admin/config.js +224 -0
- package/dist/admin/config.js.map +1 -0
- package/dist/admin/hooks/fetchAdminApi.d.ts +65 -0
- package/dist/admin/hooks/fetchAdminApi.d.ts.map +1 -0
- package/dist/admin/hooks/fetchAdminApi.js +96 -0
- package/dist/admin/hooks/fetchAdminApi.js.map +1 -0
- package/dist/admin/hooks/index.d.ts +24 -0
- package/dist/admin/hooks/index.d.ts.map +1 -0
- package/dist/admin/hooks/index.js +19 -0
- package/dist/admin/hooks/index.js.map +1 -0
- package/dist/admin/hooks/useAdminAuth.d.ts +25 -0
- package/dist/admin/hooks/useAdminAuth.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminAuth.js +183 -0
- package/dist/admin/hooks/useAdminAuth.js.map +1 -0
- package/dist/admin/hooks/useAdminCategories.d.ts +9 -0
- package/dist/admin/hooks/useAdminCategories.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminCategories.js +112 -0
- package/dist/admin/hooks/useAdminCategories.js.map +1 -0
- package/dist/admin/hooks/useAdminCustomers.d.ts +3 -0
- package/dist/admin/hooks/useAdminCustomers.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminCustomers.js +110 -0
- package/dist/admin/hooks/useAdminCustomers.js.map +1 -0
- package/dist/admin/hooks/useAdminMe.d.ts +31 -0
- package/dist/admin/hooks/useAdminMe.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminMe.js +78 -0
- package/dist/admin/hooks/useAdminMe.js.map +1 -0
- package/dist/admin/hooks/useAdminOrders.d.ts +3 -0
- package/dist/admin/hooks/useAdminOrders.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminOrders.js +118 -0
- package/dist/admin/hooks/useAdminOrders.js.map +1 -0
- package/dist/admin/hooks/useAdminPermissions.d.ts +3 -0
- package/dist/admin/hooks/useAdminPermissions.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminPermissions.js +51 -0
- package/dist/admin/hooks/useAdminPermissions.js.map +1 -0
- package/dist/admin/hooks/useAdminProductMetrics.d.ts +3 -0
- package/dist/admin/hooks/useAdminProductMetrics.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminProductMetrics.js +32 -0
- package/dist/admin/hooks/useAdminProductMetrics.js.map +1 -0
- package/dist/admin/hooks/useAdminProducts.d.ts +3 -0
- package/dist/admin/hooks/useAdminProducts.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminProducts.js +132 -0
- package/dist/admin/hooks/useAdminProducts.js.map +1 -0
- package/dist/admin/hooks/useAdminSession.d.ts +23 -0
- package/dist/admin/hooks/useAdminSession.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminSession.js +117 -0
- package/dist/admin/hooks/useAdminSession.js.map +1 -0
- package/dist/admin/hooks/useAdminStats.d.ts +47 -0
- package/dist/admin/hooks/useAdminStats.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminStats.js +128 -0
- package/dist/admin/hooks/useAdminStats.js.map +1 -0
- package/dist/admin/hooks/useAdminUsers.d.ts +3 -0
- package/dist/admin/hooks/useAdminUsers.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminUsers.js +177 -0
- package/dist/admin/hooks/useAdminUsers.js.map +1 -0
- package/dist/admin/hooks/useLinkedCustomerStatus.d.ts +3 -0
- package/dist/admin/hooks/useLinkedCustomerStatus.d.ts.map +1 -0
- package/dist/admin/hooks/useLinkedCustomerStatus.js +48 -0
- package/dist/admin/hooks/useLinkedCustomerStatus.js.map +1 -0
- package/dist/admin/hooks/useSetupGuide.d.ts +45 -0
- package/dist/admin/hooks/useSetupGuide.d.ts.map +1 -0
- package/dist/admin/hooks/useSetupGuide.js +60 -0
- package/dist/admin/hooks/useSetupGuide.js.map +1 -0
- package/dist/admin/index.d.ts +66 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +144 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/permissions.d.ts +79 -0
- package/dist/admin/permissions.d.ts.map +1 -0
- package/dist/admin/permissions.js +182 -0
- package/dist/admin/permissions.js.map +1 -0
- package/dist/admin/server/admin-invite.d.ts +122 -0
- package/dist/admin/server/admin-invite.d.ts.map +1 -0
- package/dist/admin/server/admin-invite.js +235 -0
- package/dist/admin/server/admin-invite.js.map +1 -0
- package/dist/admin/server/admin-password-reset.d.ts +87 -0
- package/dist/admin/server/admin-password-reset.d.ts.map +1 -0
- package/dist/admin/server/admin-password-reset.js +220 -0
- package/dist/admin/server/admin-password-reset.js.map +1 -0
- package/dist/admin/server/admin-self-service.d.ts +86 -0
- package/dist/admin/server/admin-self-service.d.ts.map +1 -0
- package/dist/admin/server/admin-self-service.js +188 -0
- package/dist/admin/server/admin-self-service.js.map +1 -0
- package/dist/admin/server/admin-service.d.ts +131 -0
- package/dist/admin/server/admin-service.d.ts.map +1 -0
- package/dist/admin/server/admin-service.js +278 -0
- package/dist/admin/server/admin-service.js.map +1 -0
- package/dist/admin/server/admin-session.d.ts +173 -0
- package/dist/admin/server/admin-session.d.ts.map +1 -0
- package/dist/admin/server/admin-session.js +272 -0
- package/dist/admin/server/admin-session.js.map +1 -0
- package/dist/admin/server/index.d.ts +17 -0
- package/dist/admin/server/index.d.ts.map +1 -0
- package/dist/admin/server/index.js +39 -0
- package/dist/admin/server/index.js.map +1 -0
- package/dist/admin/server/user-management.d.ts +221 -0
- package/dist/admin/server/user-management.d.ts.map +1 -0
- package/dist/admin/server/user-management.js +838 -0
- package/dist/admin/server/user-management.js.map +1 -0
- package/dist/admin/types.d.ts +1161 -0
- package/dist/admin/types.d.ts.map +1 -0
- package/dist/admin/types.js +10 -0
- package/dist/admin/types.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 +65 -0
- package/dist/auth/api/forgot-password.js.map +1 -0
- package/dist/auth/api/index.d.ts +37 -0
- package/dist/auth/api/index.d.ts.map +1 -0
- package/dist/auth/api/index.js +44 -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 +99 -0
- package/dist/auth/api/register.js.map +1 -0
- package/dist/auth/api/request-refund.d.ts +38 -0
- package/dist/auth/api/request-refund.d.ts.map +1 -0
- package/dist/auth/api/request-refund.js +142 -0
- package/dist/auth/api/request-refund.js.map +1 -0
- package/dist/auth/api/request-return.d.ts +39 -0
- package/dist/auth/api/request-return.d.ts.map +1 -0
- package/dist/auth/api/request-return.js +109 -0
- package/dist/auth/api/request-return.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 +68 -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 +106 -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 +90 -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 +109 -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 +43 -0
- package/dist/auth/components/ForgotPasswordForm.js.map +1 -0
- package/dist/auth/components/Label.d.ts +19 -0
- package/dist/auth/components/Label.d.ts.map +1 -0
- package/dist/auth/components/Label.js +18 -0
- package/dist/auth/components/Label.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 +87 -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 +61 -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 +78 -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 +73 -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 +57 -0
- package/dist/auth/components/VerifyEmailNotice.js.map +1 -0
- package/dist/auth/components/index.d.ts +15 -0
- package/dist/auth/components/index.d.ts.map +1 -0
- package/dist/auth/components/index.js +14 -0
- package/dist/auth/components/index.js.map +1 -0
- package/dist/auth/config.d.ts +52 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/config.js +243 -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 +7 -0
- package/dist/auth/hooks/index.js.map +1 -0
- package/dist/auth/hooks/useAuth.d.ts +30 -0
- package/dist/auth/hooks/useAuth.d.ts.map +1 -0
- package/dist/auth/hooks/useAuth.js +251 -0
- package/dist/auth/hooks/useAuth.js.map +1 -0
- package/dist/auth/index.d.ts +55 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +67 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/server/customer-service.d.ts +140 -0
- package/dist/auth/server/customer-service.d.ts.map +1 -0
- package/dist/auth/server/customer-service.js +266 -0
- package/dist/auth/server/customer-service.js.map +1 -0
- package/dist/auth/server/customer-session.d.ts +79 -0
- package/dist/auth/server/customer-session.d.ts.map +1 -0
- package/dist/auth/server/customer-session.js +103 -0
- package/dist/auth/server/customer-session.js.map +1 -0
- package/dist/auth/server/index.d.ts +14 -0
- package/dist/auth/server/index.d.ts.map +1 -0
- package/dist/auth/server/index.js +17 -0
- package/dist/auth/server/index.js.map +1 -0
- package/dist/auth/server/password-reset-service.d.ts +87 -0
- package/dist/auth/server/password-reset-service.d.ts.map +1 -0
- package/dist/auth/server/password-reset-service.js +203 -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 +85 -0
- package/dist/auth/server/password.js.map +1 -0
- package/dist/auth/server/verification-service.d.ts +88 -0
- package/dist/auth/server/verification-service.d.ts.map +1 -0
- package/dist/auth/server/verification-service.js +231 -0
- package/dist/auth/server/verification-service.js.map +1 -0
- package/dist/auth/types.d.ts +311 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +7 -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 +96 -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 +122 -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 +117 -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 +68 -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 +60 -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 +85 -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 +12 -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 +115 -0
- package/dist/cart/index.js.map +1 -0
- package/dist/cart/store.d.ts +150 -0
- package/dist/cart/store.d.ts.map +1 -0
- package/dist/cart/store.js +315 -0
- package/dist/cart/store.js.map +1 -0
- package/dist/checkout/api/checkout.js +112 -0
- package/dist/checkout/api/checkout.js.map +1 -0
- package/dist/checkout/api/countries.d.ts +17 -0
- package/dist/checkout/api/countries.d.ts.map +1 -0
- package/dist/checkout/api/countries.js +38 -0
- package/dist/checkout/api/countries.js.map +1 -0
- package/dist/checkout/api/index.js +11 -0
- package/dist/checkout/api/index.js.map +1 -0
- package/dist/checkout/api/payment-status.d.ts +45 -0
- package/dist/checkout/api/payment-status.d.ts.map +1 -0
- package/dist/checkout/api/payment-status.js +104 -0
- package/dist/checkout/api/payment-status.js.map +1 -0
- package/dist/checkout/api/shipping.d.ts +34 -0
- package/dist/checkout/api/shipping.d.ts.map +1 -0
- package/dist/checkout/api/shipping.js +247 -0
- package/dist/checkout/api/shipping.js.map +1 -0
- package/dist/checkout/api/webhook.js +55 -0
- package/dist/checkout/api/webhook.js.map +1 -0
- package/dist/checkout/components/CheckoutButton.d.ts +55 -0
- package/dist/checkout/components/CheckoutButton.d.ts.map +1 -0
- package/dist/checkout/components/CheckoutButton.js +132 -0
- package/dist/checkout/components/CheckoutButton.js.map +1 -0
- package/dist/checkout/components/CheckoutFlow.d.ts +53 -0
- package/dist/checkout/components/CheckoutFlow.d.ts.map +1 -0
- package/dist/checkout/components/CheckoutFlow.js +286 -0
- package/dist/checkout/components/CheckoutFlow.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 +49 -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 +71 -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 +185 -0
- package/dist/checkout/components/ShippingForm.js.map +1 -0
- package/dist/checkout/components/ShippingOptions.d.ts +51 -0
- package/dist/checkout/components/ShippingOptions.d.ts.map +1 -0
- package/dist/checkout/components/ShippingOptions.js +93 -0
- package/dist/checkout/components/ShippingOptions.js.map +1 -0
- package/dist/checkout/components/index.d.ts +12 -0
- package/dist/checkout/components/index.d.ts.map +1 -0
- package/dist/checkout/components/index.js +12 -0
- package/dist/checkout/components/index.js.map +1 -0
- package/dist/checkout/constants.d.ts +244 -0
- package/dist/checkout/constants.d.ts.map +1 -0
- package/dist/checkout/constants.js +119 -0
- package/dist/checkout/constants.js.map +1 -0
- package/dist/checkout/hooks/index.d.ts +9 -0
- package/dist/checkout/hooks/index.d.ts.map +1 -0
- package/dist/checkout/hooks/index.js +8 -0
- package/dist/checkout/hooks/index.js.map +1 -0
- package/dist/checkout/hooks/useCheckout.d.ts +38 -0
- package/dist/checkout/hooks/useCheckout.d.ts.map +1 -0
- package/dist/checkout/hooks/useCheckout.js +134 -0
- package/dist/checkout/hooks/useCheckout.js.map +1 -0
- package/dist/checkout/hooks/usePaymentStatus.d.ts +42 -0
- package/dist/checkout/hooks/usePaymentStatus.d.ts.map +1 -0
- package/dist/checkout/hooks/usePaymentStatus.js +71 -0
- package/dist/checkout/hooks/usePaymentStatus.js.map +1 -0
- package/dist/checkout/index.js +135 -0
- package/dist/checkout/index.js.map +1 -0
- package/dist/checkout/server/coupons.d.ts +91 -0
- package/dist/checkout/server/coupons.d.ts.map +1 -0
- package/dist/checkout/server/coupons.js +192 -0
- package/dist/checkout/server/coupons.js.map +1 -0
- package/dist/checkout/server/index.js +10 -0
- package/dist/checkout/server/index.js.map +1 -0
- package/dist/checkout/stripe/client.d.ts +74 -0
- package/dist/checkout/stripe/client.d.ts.map +1 -0
- package/dist/checkout/stripe/client.js +175 -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 +7 -0
- package/dist/checkout/stripe/index.js.map +1 -0
- package/dist/checkout/types.d.ts +489 -0
- package/dist/checkout/types.d.ts.map +1 -0
- package/dist/checkout/types.js +8 -0
- package/dist/checkout/types.js.map +1 -0
- package/dist/core/StoreSettingsProvider.d.ts +107 -0
- package/dist/core/StoreSettingsProvider.d.ts.map +1 -0
- package/dist/core/StoreSettingsProvider.js +200 -0
- package/dist/core/StoreSettingsProvider.js.map +1 -0
- package/dist/core/api/index.d.ts +7 -0
- package/dist/core/api/index.d.ts.map +1 -0
- package/dist/core/api/index.js +7 -0
- package/dist/core/api/index.js.map +1 -0
- package/dist/core/api/settings.d.ts +42 -0
- package/dist/core/api/settings.d.ts.map +1 -0
- package/dist/core/api/settings.js +74 -0
- package/dist/core/api/settings.js.map +1 -0
- package/dist/core/config.d.ts +270 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +80 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/cookie-consent/CookieBanner.d.ts +2 -0
- package/dist/core/cookie-consent/CookieBanner.d.ts.map +1 -0
- package/dist/core/cookie-consent/CookieBanner.js +243 -0
- package/dist/core/cookie-consent/CookieBanner.js.map +1 -0
- package/dist/core/cookie-consent/CookieConsentProvider.d.ts +53 -0
- package/dist/core/cookie-consent/CookieConsentProvider.d.ts.map +1 -0
- package/dist/core/cookie-consent/CookieConsentProvider.js +162 -0
- package/dist/core/cookie-consent/CookieConsentProvider.js.map +1 -0
- package/dist/core/cookie-consent/CookiePreferencesLink.d.ts +15 -0
- package/dist/core/cookie-consent/CookiePreferencesLink.d.ts.map +1 -0
- package/dist/core/cookie-consent/CookiePreferencesLink.js +12 -0
- package/dist/core/cookie-consent/CookiePreferencesLink.js.map +1 -0
- package/dist/core/cookie-consent/index.d.ts +17 -0
- package/dist/core/cookie-consent/index.d.ts.map +1 -0
- package/dist/core/cookie-consent/index.js +16 -0
- package/dist/core/cookie-consent/index.js.map +1 -0
- package/dist/core/cookie-consent/types.d.ts +31 -0
- package/dist/core/cookie-consent/types.d.ts.map +1 -0
- package/dist/core/cookie-consent/types.js +10 -0
- package/dist/core/cookie-consent/types.js.map +1 -0
- package/dist/core/cookie-consent/useCookieConsent.d.ts +14 -0
- package/dist/core/cookie-consent/useCookieConsent.d.ts.map +1 -0
- package/dist/core/cookie-consent/useCookieConsent.js +25 -0
- package/dist/core/cookie-consent/useCookieConsent.js.map +1 -0
- package/dist/core/db/client.d.ts +39 -0
- package/dist/core/db/client.d.ts.map +1 -0
- package/dist/core/db/client.js +86 -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 +36 -0
- package/dist/core/db/index.js.map +1 -0
- package/dist/core/db/queries.d.ts +1427 -0
- package/dist/core/db/queries.d.ts.map +1 -0
- package/dist/core/db/queries.js +1932 -0
- package/dist/core/db/queries.js.map +1 -0
- package/dist/core/db/schema.d.ts +3462 -0
- package/dist/core/db/schema.d.ts.map +1 -0
- package/dist/core/db/schema.js +495 -0
- package/dist/core/db/schema.js.map +1 -0
- package/dist/core/index.d.ts +22 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +43 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/server/index.d.ts +18 -0
- package/dist/core/server/index.d.ts.map +1 -0
- package/dist/core/server/index.js +47 -0
- package/dist/core/server/index.js.map +1 -0
- package/dist/core/types.d.ts +246 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils.d.ts +147 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +309 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/emails/config.d.ts +69 -0
- package/dist/emails/config.d.ts.map +1 -0
- package/dist/emails/config.js +147 -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 +110 -0
- package/dist/emails/index.js.map +1 -0
- package/dist/emails/send/admin-auth.d.ts +94 -0
- package/dist/emails/send/admin-auth.d.ts.map +1 -0
- package/dist/emails/send/admin-auth.js +118 -0
- package/dist/emails/send/admin-auth.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 +130 -0
- package/dist/emails/send/auth.js.map +1 -0
- package/dist/emails/send/index.d.ts +12 -0
- package/dist/emails/send/index.d.ts.map +1 -0
- package/dist/emails/send/index.js +18 -0
- package/dist/emails/send/index.js.map +1 -0
- package/dist/emails/send/orders.d.ts +186 -0
- package/dist/emails/send/orders.d.ts.map +1 -0
- package/dist/emails/send/orders.js +258 -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 +116 -0
- package/dist/emails/sender.js.map +1 -0
- package/dist/emails/templates/admin-invite.d.ts +40 -0
- package/dist/emails/templates/admin-invite.d.ts.map +1 -0
- package/dist/emails/templates/admin-invite.js +62 -0
- package/dist/emails/templates/admin-invite.js.map +1 -0
- package/dist/emails/templates/base.d.ts +109 -0
- package/dist/emails/templates/base.d.ts.map +1 -0
- package/dist/emails/templates/base.js +334 -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 +52 -0
- package/dist/emails/templates/email-verification.js.map +1 -0
- package/dist/emails/templates/index.d.ts +16 -0
- package/dist/emails/templates/index.d.ts.map +1 -0
- package/dist/emails/templates/index.js +28 -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 +83 -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 +174 -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 +100 -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 +83 -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 +51 -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 +92 -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 +52 -0
- package/dist/emails/templates/welcome.js.map +1 -0
- package/dist/emails/types.d.ts +229 -0
- package/dist/emails/types.d.ts.map +1 -0
- package/dist/emails/types.js +7 -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 +218 -0
- package/dist/emails/utils.js.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/media/api/delete.d.ts +43 -0
- package/dist/media/api/delete.d.ts.map +1 -0
- package/dist/media/api/delete.js +124 -0
- package/dist/media/api/delete.js.map +1 -0
- package/dist/media/api/index.d.ts +17 -0
- package/dist/media/api/index.d.ts.map +1 -0
- package/dist/media/api/index.js +17 -0
- package/dist/media/api/index.js.map +1 -0
- package/dist/media/api/presign.d.ts +38 -0
- package/dist/media/api/presign.d.ts.map +1 -0
- package/dist/media/api/presign.js +130 -0
- package/dist/media/api/presign.js.map +1 -0
- package/dist/media/components/DropZone.d.ts +18 -0
- package/dist/media/components/DropZone.d.ts.map +1 -0
- package/dist/media/components/DropZone.js +107 -0
- package/dist/media/components/DropZone.js.map +1 -0
- package/dist/media/components/ImageGalleryUpload.d.ts +21 -0
- package/dist/media/components/ImageGalleryUpload.d.ts.map +1 -0
- package/dist/media/components/ImageGalleryUpload.js +193 -0
- package/dist/media/components/ImageGalleryUpload.js.map +1 -0
- package/dist/media/components/ImageUpload.d.ts +17 -0
- package/dist/media/components/ImageUpload.d.ts.map +1 -0
- package/dist/media/components/ImageUpload.js +89 -0
- package/dist/media/components/ImageUpload.js.map +1 -0
- package/dist/media/components/index.d.ts +10 -0
- package/dist/media/components/index.d.ts.map +1 -0
- package/dist/media/components/index.js +9 -0
- package/dist/media/components/index.js.map +1 -0
- package/dist/media/config.d.ts +83 -0
- package/dist/media/config.d.ts.map +1 -0
- package/dist/media/config.js +189 -0
- package/dist/media/config.js.map +1 -0
- package/dist/media/hooks/index.d.ts +8 -0
- package/dist/media/hooks/index.d.ts.map +1 -0
- package/dist/media/hooks/index.js +7 -0
- package/dist/media/hooks/index.js.map +1 -0
- package/dist/media/hooks/useUpload.d.ts +32 -0
- package/dist/media/hooks/useUpload.d.ts.map +1 -0
- package/dist/media/hooks/useUpload.js +260 -0
- package/dist/media/hooks/useUpload.js.map +1 -0
- package/dist/media/index.d.ts +57 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +68 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/server/delete.d.ts +59 -0
- package/dist/media/server/delete.d.ts.map +1 -0
- package/dist/media/server/delete.js +176 -0
- package/dist/media/server/delete.js.map +1 -0
- package/dist/media/server/index.d.ts +10 -0
- package/dist/media/server/index.d.ts.map +1 -0
- package/dist/media/server/index.js +13 -0
- package/dist/media/server/index.js.map +1 -0
- package/dist/media/server/presign.d.ts +57 -0
- package/dist/media/server/presign.d.ts.map +1 -0
- package/dist/media/server/presign.js +112 -0
- package/dist/media/server/presign.js.map +1 -0
- package/dist/media/server/r2-client.d.ts +30 -0
- package/dist/media/server/r2-client.d.ts.map +1 -0
- package/dist/media/server/r2-client.js +76 -0
- package/dist/media/server/r2-client.js.map +1 -0
- package/dist/media/types.d.ts +316 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/media/types.js +95 -0
- package/dist/media/types.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 +46 -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 +24 -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 +67 -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 +99 -0
- package/dist/products/api/products.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 +72 -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 +137 -0
- package/dist/products/components/ProductDetails.js.map +1 -0
- package/dist/products/components/ProductGallery.d.ts +30 -0
- package/dist/products/components/ProductGallery.d.ts.map +1 -0
- package/dist/products/components/ProductGallery.js +91 -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 +81 -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 +97 -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 +59 -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 +20 -0
- package/dist/products/components/index.d.ts.map +1 -0
- package/dist/products/components/index.js +15 -0
- package/dist/products/components/index.js.map +1 -0
- package/dist/products/hooks/index.d.ts +10 -0
- package/dist/products/hooks/index.d.ts.map +1 -0
- package/dist/products/hooks/index.js +8 -0
- package/dist/products/hooks/index.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 +87 -0
- package/dist/products/hooks/useProduct.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 +131 -0
- package/dist/products/hooks/useProducts.js.map +1 -0
- package/dist/products/index.d.ts +69 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +79 -0
- package/dist/products/index.js.map +1 -0
- package/dist/shipping/index.d.ts +8 -0
- package/dist/shipping/index.d.ts.map +1 -0
- package/dist/shipping/index.js +8 -0
- package/dist/shipping/index.js.map +1 -0
- package/dist/shipping/shippo.d.ts +77 -0
- package/dist/shipping/shippo.d.ts.map +1 -0
- package/dist/shipping/shippo.js +280 -0
- package/dist/shipping/shippo.js.map +1 -0
- package/dist/theme/colors.d.ts +134 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +214 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/defaults.d.ts +133 -0
- package/dist/theme/defaults.d.ts.map +1 -0
- package/dist/theme/defaults.js +210 -0
- package/dist/theme/defaults.js.map +1 -0
- package/dist/theme/fonts.d.ts +28 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +55 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/generator.d.ts +43 -0
- package/dist/theme/generator.d.ts.map +1 -0
- package/dist/theme/generator.js +272 -0
- package/dist/theme/generator.js.map +1 -0
- package/dist/theme/index.d.ts +23 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +30 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +2 -2
- /package/dist/admin/{admin-theme.css → styles/admin-theme.css} +0 -0
|
@@ -0,0 +1,1427 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/core/db/queries
|
|
3
|
+
*
|
|
4
|
+
* Type-safe query helpers for e-commerce stores
|
|
5
|
+
* Each store has its own database (via Neon branches) - no tenant filtering needed
|
|
6
|
+
*/
|
|
7
|
+
import * as schema from './schema';
|
|
8
|
+
export interface FindProductsOptions {
|
|
9
|
+
categoryId?: string;
|
|
10
|
+
status?: 'draft' | 'active' | 'archived';
|
|
11
|
+
search?: string;
|
|
12
|
+
sort?: 'newest' | 'price-asc' | 'price-desc' | 'name';
|
|
13
|
+
limit?: number;
|
|
14
|
+
offset?: number;
|
|
15
|
+
/**
|
|
16
|
+
* When true, return only products effectively out of stock.
|
|
17
|
+
* For non-variant products: `inventory <= 0 AND track_inventory = true`.
|
|
18
|
+
* For variant products: no variant has `inventory > 0`.
|
|
19
|
+
*/
|
|
20
|
+
outOfStock?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* When true, return only products with a sale price (compare_price > price).
|
|
23
|
+
* Used by the auto-curated /sale collection card. Cheap to evaluate — no
|
|
24
|
+
* subquery, just a column comparison.
|
|
25
|
+
*/
|
|
26
|
+
onSale?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* When set, return only products whose `tags` JSONB array overlaps any of
|
|
29
|
+
* the provided tags. Used by the product-quiz card to filter to products
|
|
30
|
+
* matching the merchant's quiz answer→tag mapping. Empty array is a
|
|
31
|
+
* no-op (returns all products).
|
|
32
|
+
*/
|
|
33
|
+
tags?: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Find products with filtering, sorting, and pagination
|
|
37
|
+
*/
|
|
38
|
+
export declare function findProducts(options?: FindProductsOptions): Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
slug: string;
|
|
42
|
+
description: string;
|
|
43
|
+
price: string;
|
|
44
|
+
comparePrice: string | null;
|
|
45
|
+
images: string[];
|
|
46
|
+
videos: string[];
|
|
47
|
+
status: "draft" | "active" | "archived";
|
|
48
|
+
categoryId: string | null;
|
|
49
|
+
hasVariants: boolean;
|
|
50
|
+
sku: string | null;
|
|
51
|
+
inventory: number | null;
|
|
52
|
+
trackInventory: boolean | null;
|
|
53
|
+
continueSellingWhenOutOfStock: boolean | null;
|
|
54
|
+
productType: string | null;
|
|
55
|
+
vendor: string | null;
|
|
56
|
+
tags: string[] | null;
|
|
57
|
+
metaTitle: string | null;
|
|
58
|
+
metaDescription: string | null;
|
|
59
|
+
metaKeywords: string[] | null;
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
}[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Find a single product by slug
|
|
65
|
+
*/
|
|
66
|
+
export declare function findProductBySlug(slug: string): Promise<{
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
description: string;
|
|
71
|
+
price: string;
|
|
72
|
+
comparePrice: string | null;
|
|
73
|
+
images: string[];
|
|
74
|
+
videos: string[];
|
|
75
|
+
status: "draft" | "active" | "archived";
|
|
76
|
+
categoryId: string | null;
|
|
77
|
+
hasVariants: boolean;
|
|
78
|
+
sku: string | null;
|
|
79
|
+
inventory: number | null;
|
|
80
|
+
trackInventory: boolean | null;
|
|
81
|
+
continueSellingWhenOutOfStock: boolean | null;
|
|
82
|
+
productType: string | null;
|
|
83
|
+
vendor: string | null;
|
|
84
|
+
tags: string[] | null;
|
|
85
|
+
metaTitle: string | null;
|
|
86
|
+
metaDescription: string | null;
|
|
87
|
+
metaKeywords: string[] | null;
|
|
88
|
+
createdAt: Date;
|
|
89
|
+
updatedAt: Date;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Find a single product by ID
|
|
93
|
+
*/
|
|
94
|
+
export declare function findProductById(id: string): Promise<{
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
slug: string;
|
|
98
|
+
description: string;
|
|
99
|
+
price: string;
|
|
100
|
+
comparePrice: string | null;
|
|
101
|
+
images: string[];
|
|
102
|
+
videos: string[];
|
|
103
|
+
status: "draft" | "active" | "archived";
|
|
104
|
+
categoryId: string | null;
|
|
105
|
+
hasVariants: boolean;
|
|
106
|
+
sku: string | null;
|
|
107
|
+
inventory: number | null;
|
|
108
|
+
trackInventory: boolean | null;
|
|
109
|
+
continueSellingWhenOutOfStock: boolean | null;
|
|
110
|
+
productType: string | null;
|
|
111
|
+
vendor: string | null;
|
|
112
|
+
tags: string[] | null;
|
|
113
|
+
metaTitle: string | null;
|
|
114
|
+
metaDescription: string | null;
|
|
115
|
+
metaKeywords: string[] | null;
|
|
116
|
+
createdAt: Date;
|
|
117
|
+
updatedAt: Date;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Get product variants for a product
|
|
121
|
+
*/
|
|
122
|
+
export declare function findProductVariants(productId: string): Promise<{
|
|
123
|
+
id: string;
|
|
124
|
+
productId: string;
|
|
125
|
+
sku: string;
|
|
126
|
+
name: string;
|
|
127
|
+
price: string | null;
|
|
128
|
+
inventory: number;
|
|
129
|
+
image: string | null;
|
|
130
|
+
video: string | null;
|
|
131
|
+
attributes: Record<string, string>;
|
|
132
|
+
createdAt: Date;
|
|
133
|
+
}[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Count total products matching filters
|
|
136
|
+
*/
|
|
137
|
+
export declare function countProducts(options?: Pick<FindProductsOptions, 'categoryId' | 'status' | 'search' | 'outOfStock'>): Promise<number>;
|
|
138
|
+
/**
|
|
139
|
+
* For products with `hasVariants=true`, the parent `products.inventory` column
|
|
140
|
+
* is unused — inventory lives on `product_variants`. This helper returns a
|
|
141
|
+
* Map of `productId → effectiveInventory` for an arbitrary set of variant
|
|
142
|
+
* product IDs. The page-list handler calls this for the products it just
|
|
143
|
+
* returned and merges the sums into each row before responding to the client.
|
|
144
|
+
*
|
|
145
|
+
* Empty input → empty map. Single SQL query, GROUP BY product_id.
|
|
146
|
+
*/
|
|
147
|
+
export declare function getInventoryByProductIds(productIds: string[]): Promise<Map<string, number>>;
|
|
148
|
+
/**
|
|
149
|
+
* Count of products in `status='active'`. Drives the "Active products"
|
|
150
|
+
* metric card on the admin product list page.
|
|
151
|
+
*/
|
|
152
|
+
export declare function getActiveProductCount(): Promise<number>;
|
|
153
|
+
/**
|
|
154
|
+
* Count of *active* products that are effectively out of stock. Excludes
|
|
155
|
+
* drafts / archived (they're irrelevant noise on the product list view).
|
|
156
|
+
*
|
|
157
|
+
* Uses the same OOS condition as the chip filter (single source of truth).
|
|
158
|
+
*/
|
|
159
|
+
export declare function getOutOfStockProductCount(): Promise<number>;
|
|
160
|
+
/**
|
|
161
|
+
* Best-selling product over the last `days` window, by units sold.
|
|
162
|
+
*
|
|
163
|
+
* Counts only orders that actually moved revenue: `paid`, `shipped`,
|
|
164
|
+
* `delivered`. Excludes pending (might fail), cancelled, refunded, and
|
|
165
|
+
* return_requested (not yet finalized).
|
|
166
|
+
*
|
|
167
|
+
* Returns null when no qualifying orders exist in the window — the UI
|
|
168
|
+
* renders an empty state rather than a broken card.
|
|
169
|
+
*/
|
|
170
|
+
export declare function getBestSellerProduct(days?: number): Promise<{
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
unitsSold: number;
|
|
174
|
+
revenue: string;
|
|
175
|
+
} | null>;
|
|
176
|
+
/**
|
|
177
|
+
* Best-selling products in the last N days, capped to `limit`.
|
|
178
|
+
*
|
|
179
|
+
* Same SQL shape as `getBestSellerProduct` (paid+shipped+delivered window,
|
|
180
|
+
* ordered by units sold desc) but returns up to `limit` rows. Used by the
|
|
181
|
+
* Best Sellers homepage section card. Returns an empty array when no
|
|
182
|
+
* qualifying orders exist — callers MUST hide their UI when length === 0
|
|
183
|
+
* (don't render an empty rail).
|
|
184
|
+
*
|
|
185
|
+
* `order_items_product_id_idx` covers the JOIN; cost is the same as the
|
|
186
|
+
* existing single-row helper.
|
|
187
|
+
*/
|
|
188
|
+
export declare function getBestSellers(days?: number, limit?: number): Promise<Array<{
|
|
189
|
+
id: string;
|
|
190
|
+
slug: string;
|
|
191
|
+
name: string;
|
|
192
|
+
price: string;
|
|
193
|
+
comparePrice: string | null;
|
|
194
|
+
images: string[];
|
|
195
|
+
unitsSold: number;
|
|
196
|
+
}>>;
|
|
197
|
+
/**
|
|
198
|
+
* Most-popular products by distinct buyer count (last N days), capped.
|
|
199
|
+
*
|
|
200
|
+
* Different from best sellers — best sellers is units sold (revenue lens);
|
|
201
|
+
* this is buyer reach (how many distinct customers bought it). Used by the
|
|
202
|
+
* Most Popular homepage section card. Same JOIN path; same status window.
|
|
203
|
+
*
|
|
204
|
+
* Excludes guest orders (`customer_id IS NULL`) so we count real distinct
|
|
205
|
+
* buyers, not anonymous sessions. Returns empty array when no data — UI
|
|
206
|
+
* must hide.
|
|
207
|
+
*/
|
|
208
|
+
export declare function getMostPopularProducts(days?: number, limit?: number): Promise<Array<{
|
|
209
|
+
id: string;
|
|
210
|
+
slug: string;
|
|
211
|
+
name: string;
|
|
212
|
+
price: string;
|
|
213
|
+
comparePrice: string | null;
|
|
214
|
+
images: string[];
|
|
215
|
+
buyerCount: number;
|
|
216
|
+
}>>;
|
|
217
|
+
/**
|
|
218
|
+
* Distinct-buyer count for a single product within the last N hours.
|
|
219
|
+
*
|
|
220
|
+
* Powers the "X people bought this in the last 24h" social-proof card on
|
|
221
|
+
* PDPs. Server-only — caller MUST cache via Server Component + ISR
|
|
222
|
+
* (`revalidate: 300`); calling this per page view is a perf trap.
|
|
223
|
+
*
|
|
224
|
+
* Returns 0 when no qualifying orders exist. UI gates on a `minThreshold`
|
|
225
|
+
* (default 5) — never render "1 person bought this" (awkward + reads as
|
|
226
|
+
* dead store).
|
|
227
|
+
*/
|
|
228
|
+
export declare function getProductRecentBuyerCount(productId: string, hours?: number): Promise<number>;
|
|
229
|
+
/**
|
|
230
|
+
* Check whether a customer has purchased a specific product.
|
|
231
|
+
*
|
|
232
|
+
* Powers the verified-purchase badge on the C2 reviews card. Returns true
|
|
233
|
+
* iff the customer has at least one paid+shipped+delivered order containing
|
|
234
|
+
* the product (variant-agnostic — buying any variant counts).
|
|
235
|
+
*
|
|
236
|
+
* Uses EXISTS for short-circuit evaluation; cheap even on large order
|
|
237
|
+
* histories. Index `order_items_product_id_idx` covers the inner lookup;
|
|
238
|
+
* `orders_customer_id_idx` covers the join.
|
|
239
|
+
*/
|
|
240
|
+
export declare function hasCustomerPurchasedProduct(customerId: string, productId: string): Promise<boolean>;
|
|
241
|
+
/**
|
|
242
|
+
* Find all categories
|
|
243
|
+
*/
|
|
244
|
+
export declare function findCategories(): Promise<{
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
slug: string;
|
|
248
|
+
description: string | null;
|
|
249
|
+
image: string | null;
|
|
250
|
+
parentId: string | null;
|
|
251
|
+
order: number;
|
|
252
|
+
createdAt: Date;
|
|
253
|
+
}[]>;
|
|
254
|
+
/**
|
|
255
|
+
* Find a category by slug
|
|
256
|
+
*/
|
|
257
|
+
export declare function findCategoryBySlug(slug: string): Promise<{
|
|
258
|
+
id: string;
|
|
259
|
+
name: string;
|
|
260
|
+
slug: string;
|
|
261
|
+
description: string | null;
|
|
262
|
+
image: string | null;
|
|
263
|
+
parentId: string | null;
|
|
264
|
+
order: number;
|
|
265
|
+
createdAt: Date;
|
|
266
|
+
}>;
|
|
267
|
+
export interface FindOrdersOptions {
|
|
268
|
+
status?: schema.Order['status'];
|
|
269
|
+
customerId?: string;
|
|
270
|
+
limit?: number;
|
|
271
|
+
offset?: number;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Find orders with filtering and pagination
|
|
275
|
+
*/
|
|
276
|
+
export declare function findOrders(options?: FindOrdersOptions): Promise<{
|
|
277
|
+
id: string;
|
|
278
|
+
customerId: string | null;
|
|
279
|
+
email: string;
|
|
280
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
281
|
+
subtotal: string;
|
|
282
|
+
tax: string;
|
|
283
|
+
shipping: string;
|
|
284
|
+
total: string;
|
|
285
|
+
refundAmount: string | null;
|
|
286
|
+
returnReason: string | null;
|
|
287
|
+
discountCode: string | null;
|
|
288
|
+
discountAmount: string | null;
|
|
289
|
+
stripePromotionCodeId: string | null;
|
|
290
|
+
shippingAddress: {
|
|
291
|
+
firstName: string;
|
|
292
|
+
lastName: string;
|
|
293
|
+
line1: string;
|
|
294
|
+
line2?: string;
|
|
295
|
+
city: string;
|
|
296
|
+
state: string;
|
|
297
|
+
postalCode: string;
|
|
298
|
+
country: string;
|
|
299
|
+
phone?: string;
|
|
300
|
+
} | null;
|
|
301
|
+
billingAddress: {
|
|
302
|
+
firstName: string;
|
|
303
|
+
lastName: string;
|
|
304
|
+
line1: string;
|
|
305
|
+
line2?: string;
|
|
306
|
+
city: string;
|
|
307
|
+
state: string;
|
|
308
|
+
postalCode: string;
|
|
309
|
+
country: string;
|
|
310
|
+
phone?: string;
|
|
311
|
+
} | null;
|
|
312
|
+
stripePaymentIntentId: string | null;
|
|
313
|
+
stripeChargeId: string | null;
|
|
314
|
+
receiptUrl: string | null;
|
|
315
|
+
trackingNumber: string | null;
|
|
316
|
+
trackingUrl: string | null;
|
|
317
|
+
carrier: string | null;
|
|
318
|
+
labelUrl: string | null;
|
|
319
|
+
shippoRateId: string | null;
|
|
320
|
+
shippingMethod: string | null;
|
|
321
|
+
createdAt: Date;
|
|
322
|
+
updatedAt: Date;
|
|
323
|
+
}[]>;
|
|
324
|
+
/**
|
|
325
|
+
* Find order by ID with items (includes product images)
|
|
326
|
+
*/
|
|
327
|
+
export declare function findOrderById(id: string): Promise<{
|
|
328
|
+
items: {
|
|
329
|
+
id: string;
|
|
330
|
+
orderId: string;
|
|
331
|
+
productId: string;
|
|
332
|
+
variantId: string | null;
|
|
333
|
+
name: string;
|
|
334
|
+
price: string;
|
|
335
|
+
quantity: number;
|
|
336
|
+
attributes: Record<string, string> | null;
|
|
337
|
+
createdAt: Date;
|
|
338
|
+
image: string | null;
|
|
339
|
+
}[];
|
|
340
|
+
id: string;
|
|
341
|
+
customerId: string | null;
|
|
342
|
+
email: string;
|
|
343
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
344
|
+
subtotal: string;
|
|
345
|
+
tax: string;
|
|
346
|
+
shipping: string;
|
|
347
|
+
total: string;
|
|
348
|
+
refundAmount: string | null;
|
|
349
|
+
returnReason: string | null;
|
|
350
|
+
discountCode: string | null;
|
|
351
|
+
discountAmount: string | null;
|
|
352
|
+
stripePromotionCodeId: string | null;
|
|
353
|
+
shippingAddress: {
|
|
354
|
+
firstName: string;
|
|
355
|
+
lastName: string;
|
|
356
|
+
line1: string;
|
|
357
|
+
line2?: string;
|
|
358
|
+
city: string;
|
|
359
|
+
state: string;
|
|
360
|
+
postalCode: string;
|
|
361
|
+
country: string;
|
|
362
|
+
phone?: string;
|
|
363
|
+
} | null;
|
|
364
|
+
billingAddress: {
|
|
365
|
+
firstName: string;
|
|
366
|
+
lastName: string;
|
|
367
|
+
line1: string;
|
|
368
|
+
line2?: string;
|
|
369
|
+
city: string;
|
|
370
|
+
state: string;
|
|
371
|
+
postalCode: string;
|
|
372
|
+
country: string;
|
|
373
|
+
phone?: string;
|
|
374
|
+
} | null;
|
|
375
|
+
stripePaymentIntentId: string | null;
|
|
376
|
+
stripeChargeId: string | null;
|
|
377
|
+
receiptUrl: string | null;
|
|
378
|
+
trackingNumber: string | null;
|
|
379
|
+
trackingUrl: string | null;
|
|
380
|
+
carrier: string | null;
|
|
381
|
+
labelUrl: string | null;
|
|
382
|
+
shippoRateId: string | null;
|
|
383
|
+
shippingMethod: string | null;
|
|
384
|
+
createdAt: Date;
|
|
385
|
+
updatedAt: Date;
|
|
386
|
+
} | null>;
|
|
387
|
+
/**
|
|
388
|
+
* Get order items for an order
|
|
389
|
+
*/
|
|
390
|
+
export declare function findOrderItems(orderId: string): Promise<{
|
|
391
|
+
id: string;
|
|
392
|
+
orderId: string;
|
|
393
|
+
productId: string;
|
|
394
|
+
variantId: string | null;
|
|
395
|
+
name: string;
|
|
396
|
+
price: string;
|
|
397
|
+
quantity: number;
|
|
398
|
+
attributes: Record<string, string> | null;
|
|
399
|
+
createdAt: Date;
|
|
400
|
+
}[]>;
|
|
401
|
+
/**
|
|
402
|
+
* Find customer by email
|
|
403
|
+
*/
|
|
404
|
+
export declare function findCustomerByEmail(email: string): Promise<{
|
|
405
|
+
id: string;
|
|
406
|
+
email: string;
|
|
407
|
+
name: string | null;
|
|
408
|
+
passwordHash: string;
|
|
409
|
+
stripeCustomerId: string | null;
|
|
410
|
+
emailVerified: Date | null;
|
|
411
|
+
createdAt: Date;
|
|
412
|
+
}>;
|
|
413
|
+
/**
|
|
414
|
+
* Find customer by ID
|
|
415
|
+
*/
|
|
416
|
+
export declare function findCustomerById(id: string): Promise<{
|
|
417
|
+
id: string;
|
|
418
|
+
email: string;
|
|
419
|
+
name: string | null;
|
|
420
|
+
passwordHash: string;
|
|
421
|
+
stripeCustomerId: string | null;
|
|
422
|
+
emailVerified: Date | null;
|
|
423
|
+
createdAt: Date;
|
|
424
|
+
}>;
|
|
425
|
+
/**
|
|
426
|
+
* Find all customers with pagination
|
|
427
|
+
*/
|
|
428
|
+
export declare function findCustomers(options?: {
|
|
429
|
+
limit?: number;
|
|
430
|
+
offset?: number;
|
|
431
|
+
search?: string;
|
|
432
|
+
}): Promise<{
|
|
433
|
+
id: string;
|
|
434
|
+
email: string;
|
|
435
|
+
name: string | null;
|
|
436
|
+
passwordHash: string;
|
|
437
|
+
stripeCustomerId: string | null;
|
|
438
|
+
emailVerified: Date | null;
|
|
439
|
+
createdAt: Date;
|
|
440
|
+
}[]>;
|
|
441
|
+
/**
|
|
442
|
+
* Find admin by email
|
|
443
|
+
*/
|
|
444
|
+
export declare function findAdminByEmail(email: string): Promise<{
|
|
445
|
+
id: string;
|
|
446
|
+
email: string;
|
|
447
|
+
name: string;
|
|
448
|
+
passwordHash: string | null;
|
|
449
|
+
role: "owner" | "administrator" | "manager" | "user";
|
|
450
|
+
status: "active" | "invited" | "deactivated";
|
|
451
|
+
createdBy: string | null;
|
|
452
|
+
createdAt: Date;
|
|
453
|
+
lastLoginAt: Date | null;
|
|
454
|
+
deactivatedAt: Date | null;
|
|
455
|
+
deactivatedBy: string | null;
|
|
456
|
+
sessionVersion: number;
|
|
457
|
+
}>;
|
|
458
|
+
/**
|
|
459
|
+
* Get store statistics for admin dashboard
|
|
460
|
+
*/
|
|
461
|
+
export declare function getStoreStats(): Promise<{
|
|
462
|
+
products: number;
|
|
463
|
+
orders: number;
|
|
464
|
+
customers: number;
|
|
465
|
+
revenue: number;
|
|
466
|
+
}>;
|
|
467
|
+
/**
|
|
468
|
+
* Same shape as `getStoreStats()` but scoped to a window of `days` ago to now.
|
|
469
|
+
* Powers the "Today / 7d / 30d / 90d" selector on the admin dashboard. Both
|
|
470
|
+
* Orders and Revenue use the same status filter (paid + shipped + delivered)
|
|
471
|
+
* so they tell the same story.
|
|
472
|
+
*
|
|
473
|
+
* Note: `products` and `customers` here mean *new* products created in the
|
|
474
|
+
* window and *new* customers registered in the window — this is what makes
|
|
475
|
+
* the period-vs-prior-period delta meaningful. For the absolute "how many
|
|
476
|
+
* active products do I have" use `getStoreStats()`.
|
|
477
|
+
*/
|
|
478
|
+
export declare function getStoreStatsForPeriod(startDate: Date, endDate: Date): Promise<{
|
|
479
|
+
revenue: number;
|
|
480
|
+
orders: number;
|
|
481
|
+
newProducts: number;
|
|
482
|
+
newCustomers: number;
|
|
483
|
+
}>;
|
|
484
|
+
/**
|
|
485
|
+
* Count of refunded orders in the window. Used to compute refund rate.
|
|
486
|
+
*/
|
|
487
|
+
export declare function getRefundedOrdersCount(startDate: Date, endDate: Date): Promise<number>;
|
|
488
|
+
export interface DashboardSummary {
|
|
489
|
+
/** Window the metrics cover (in calendar days). */
|
|
490
|
+
periodDays: number;
|
|
491
|
+
current: {
|
|
492
|
+
revenue: number;
|
|
493
|
+
orders: number;
|
|
494
|
+
newCustomers: number;
|
|
495
|
+
newProducts: number;
|
|
496
|
+
/** Average order value: revenue / orders. 0 when orders=0. */
|
|
497
|
+
aov: number;
|
|
498
|
+
/** Refund rate as a decimal (0.05 = 5%). 0 when no orders. */
|
|
499
|
+
refundRate: number;
|
|
500
|
+
/** Best-selling product in the window, or null when no qualifying orders. */
|
|
501
|
+
bestSeller: {
|
|
502
|
+
id: string;
|
|
503
|
+
name: string;
|
|
504
|
+
unitsSold: number;
|
|
505
|
+
revenue: string;
|
|
506
|
+
} | null;
|
|
507
|
+
};
|
|
508
|
+
/** Same shape, scoped to the previous window of equal length. */
|
|
509
|
+
previous: {
|
|
510
|
+
revenue: number;
|
|
511
|
+
orders: number;
|
|
512
|
+
newCustomers: number;
|
|
513
|
+
newProducts: number;
|
|
514
|
+
aov: number;
|
|
515
|
+
refundRate: number;
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* Percentage delta of current vs previous, expressed as a decimal where
|
|
519
|
+
* 0.124 = +12.4%. Null when prior period had zero (delta is undefined).
|
|
520
|
+
* Refund-rate delta is *signed by direction*: a fall in refund rate is
|
|
521
|
+
* positive (good) — we report the raw direction here and let the UI
|
|
522
|
+
* invert the color semantics (down arrow with green when refund rate
|
|
523
|
+
* decreases).
|
|
524
|
+
*/
|
|
525
|
+
deltas: {
|
|
526
|
+
revenue: number | null;
|
|
527
|
+
orders: number | null;
|
|
528
|
+
aov: number | null;
|
|
529
|
+
refundRate: number | null;
|
|
530
|
+
customers: number | null;
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Build the full dashboard summary in a single round-trip. Runs eight
|
|
535
|
+
* parallel queries (current period + previous period × four metrics) and
|
|
536
|
+
* computes derived ratios + deltas in-process. Total wall-clock ~30–50ms
|
|
537
|
+
* on a warm Neon connection.
|
|
538
|
+
*/
|
|
539
|
+
export declare function getDashboardSummary(periodDays?: number): Promise<DashboardSummary>;
|
|
540
|
+
/**
|
|
541
|
+
* Get low stock products (inventory < threshold)
|
|
542
|
+
*/
|
|
543
|
+
export declare function getLowStockProducts(threshold?: number): Promise<{
|
|
544
|
+
product: {
|
|
545
|
+
id: string;
|
|
546
|
+
name: string;
|
|
547
|
+
slug: string;
|
|
548
|
+
description: string;
|
|
549
|
+
price: string;
|
|
550
|
+
comparePrice: string | null;
|
|
551
|
+
images: string[];
|
|
552
|
+
videos: string[];
|
|
553
|
+
status: "draft" | "active" | "archived";
|
|
554
|
+
categoryId: string | null;
|
|
555
|
+
hasVariants: boolean;
|
|
556
|
+
sku: string | null;
|
|
557
|
+
inventory: number | null;
|
|
558
|
+
trackInventory: boolean | null;
|
|
559
|
+
continueSellingWhenOutOfStock: boolean | null;
|
|
560
|
+
productType: string | null;
|
|
561
|
+
vendor: string | null;
|
|
562
|
+
tags: string[] | null;
|
|
563
|
+
metaTitle: string | null;
|
|
564
|
+
metaDescription: string | null;
|
|
565
|
+
metaKeywords: string[] | null;
|
|
566
|
+
createdAt: Date;
|
|
567
|
+
updatedAt: Date;
|
|
568
|
+
};
|
|
569
|
+
variant: {
|
|
570
|
+
id: string;
|
|
571
|
+
productId: string;
|
|
572
|
+
sku: string;
|
|
573
|
+
name: string;
|
|
574
|
+
price: string | null;
|
|
575
|
+
inventory: number;
|
|
576
|
+
image: string | null;
|
|
577
|
+
video: string | null;
|
|
578
|
+
attributes: Record<string, string>;
|
|
579
|
+
createdAt: Date;
|
|
580
|
+
};
|
|
581
|
+
}[]>;
|
|
582
|
+
/**
|
|
583
|
+
* Get recent orders
|
|
584
|
+
*/
|
|
585
|
+
export declare function getRecentOrders(limit?: number): Promise<{
|
|
586
|
+
id: string;
|
|
587
|
+
customerId: string | null;
|
|
588
|
+
email: string;
|
|
589
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
590
|
+
subtotal: string;
|
|
591
|
+
tax: string;
|
|
592
|
+
shipping: string;
|
|
593
|
+
total: string;
|
|
594
|
+
refundAmount: string | null;
|
|
595
|
+
returnReason: string | null;
|
|
596
|
+
discountCode: string | null;
|
|
597
|
+
discountAmount: string | null;
|
|
598
|
+
stripePromotionCodeId: string | null;
|
|
599
|
+
shippingAddress: {
|
|
600
|
+
firstName: string;
|
|
601
|
+
lastName: string;
|
|
602
|
+
line1: string;
|
|
603
|
+
line2?: string;
|
|
604
|
+
city: string;
|
|
605
|
+
state: string;
|
|
606
|
+
postalCode: string;
|
|
607
|
+
country: string;
|
|
608
|
+
phone?: string;
|
|
609
|
+
} | null;
|
|
610
|
+
billingAddress: {
|
|
611
|
+
firstName: string;
|
|
612
|
+
lastName: string;
|
|
613
|
+
line1: string;
|
|
614
|
+
line2?: string;
|
|
615
|
+
city: string;
|
|
616
|
+
state: string;
|
|
617
|
+
postalCode: string;
|
|
618
|
+
country: string;
|
|
619
|
+
phone?: string;
|
|
620
|
+
} | null;
|
|
621
|
+
stripePaymentIntentId: string | null;
|
|
622
|
+
stripeChargeId: string | null;
|
|
623
|
+
receiptUrl: string | null;
|
|
624
|
+
trackingNumber: string | null;
|
|
625
|
+
trackingUrl: string | null;
|
|
626
|
+
carrier: string | null;
|
|
627
|
+
labelUrl: string | null;
|
|
628
|
+
shippoRateId: string | null;
|
|
629
|
+
shippingMethod: string | null;
|
|
630
|
+
createdAt: Date;
|
|
631
|
+
updatedAt: Date;
|
|
632
|
+
}[]>;
|
|
633
|
+
/**
|
|
634
|
+
* Create a new order
|
|
635
|
+
*/
|
|
636
|
+
export declare function createOrder(data: schema.NewOrder): Promise<{
|
|
637
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
638
|
+
carrier: string | null;
|
|
639
|
+
email: string;
|
|
640
|
+
id: string;
|
|
641
|
+
total: string;
|
|
642
|
+
createdAt: Date;
|
|
643
|
+
updatedAt: Date;
|
|
644
|
+
customerId: string | null;
|
|
645
|
+
subtotal: string;
|
|
646
|
+
tax: string;
|
|
647
|
+
shipping: string;
|
|
648
|
+
refundAmount: string | null;
|
|
649
|
+
returnReason: string | null;
|
|
650
|
+
discountCode: string | null;
|
|
651
|
+
discountAmount: string | null;
|
|
652
|
+
stripePromotionCodeId: string | null;
|
|
653
|
+
shippingAddress: {
|
|
654
|
+
firstName: string;
|
|
655
|
+
lastName: string;
|
|
656
|
+
line1: string;
|
|
657
|
+
line2?: string;
|
|
658
|
+
city: string;
|
|
659
|
+
state: string;
|
|
660
|
+
postalCode: string;
|
|
661
|
+
country: string;
|
|
662
|
+
phone?: string;
|
|
663
|
+
} | null;
|
|
664
|
+
billingAddress: {
|
|
665
|
+
firstName: string;
|
|
666
|
+
lastName: string;
|
|
667
|
+
line1: string;
|
|
668
|
+
line2?: string;
|
|
669
|
+
city: string;
|
|
670
|
+
state: string;
|
|
671
|
+
postalCode: string;
|
|
672
|
+
country: string;
|
|
673
|
+
phone?: string;
|
|
674
|
+
} | null;
|
|
675
|
+
stripePaymentIntentId: string | null;
|
|
676
|
+
stripeChargeId: string | null;
|
|
677
|
+
receiptUrl: string | null;
|
|
678
|
+
trackingNumber: string | null;
|
|
679
|
+
trackingUrl: string | null;
|
|
680
|
+
labelUrl: string | null;
|
|
681
|
+
shippoRateId: string | null;
|
|
682
|
+
shippingMethod: string | null;
|
|
683
|
+
}>;
|
|
684
|
+
/**
|
|
685
|
+
* Create order items for an order
|
|
686
|
+
*/
|
|
687
|
+
export declare function createOrderItems(items: schema.NewOrderItem[]): Promise<{
|
|
688
|
+
name: string;
|
|
689
|
+
id: string;
|
|
690
|
+
attributes: Record<string, string> | null;
|
|
691
|
+
quantity: number;
|
|
692
|
+
price: string;
|
|
693
|
+
createdAt: Date;
|
|
694
|
+
productId: string;
|
|
695
|
+
orderId: string;
|
|
696
|
+
variantId: string | null;
|
|
697
|
+
}[]>;
|
|
698
|
+
/**
|
|
699
|
+
* Update order status
|
|
700
|
+
*/
|
|
701
|
+
export declare function updateOrderStatus(orderId: string, status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled' | 'refunded' | 'return_requested'): Promise<{
|
|
702
|
+
id: string;
|
|
703
|
+
customerId: string | null;
|
|
704
|
+
email: string;
|
|
705
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
706
|
+
subtotal: string;
|
|
707
|
+
tax: string;
|
|
708
|
+
shipping: string;
|
|
709
|
+
total: string;
|
|
710
|
+
refundAmount: string | null;
|
|
711
|
+
returnReason: string | null;
|
|
712
|
+
discountCode: string | null;
|
|
713
|
+
discountAmount: string | null;
|
|
714
|
+
stripePromotionCodeId: string | null;
|
|
715
|
+
shippingAddress: {
|
|
716
|
+
firstName: string;
|
|
717
|
+
lastName: string;
|
|
718
|
+
line1: string;
|
|
719
|
+
line2?: string;
|
|
720
|
+
city: string;
|
|
721
|
+
state: string;
|
|
722
|
+
postalCode: string;
|
|
723
|
+
country: string;
|
|
724
|
+
phone?: string;
|
|
725
|
+
} | null;
|
|
726
|
+
billingAddress: {
|
|
727
|
+
firstName: string;
|
|
728
|
+
lastName: string;
|
|
729
|
+
line1: string;
|
|
730
|
+
line2?: string;
|
|
731
|
+
city: string;
|
|
732
|
+
state: string;
|
|
733
|
+
postalCode: string;
|
|
734
|
+
country: string;
|
|
735
|
+
phone?: string;
|
|
736
|
+
} | null;
|
|
737
|
+
stripePaymentIntentId: string | null;
|
|
738
|
+
stripeChargeId: string | null;
|
|
739
|
+
receiptUrl: string | null;
|
|
740
|
+
trackingNumber: string | null;
|
|
741
|
+
trackingUrl: string | null;
|
|
742
|
+
carrier: string | null;
|
|
743
|
+
labelUrl: string | null;
|
|
744
|
+
shippoRateId: string | null;
|
|
745
|
+
shippingMethod: string | null;
|
|
746
|
+
createdAt: Date;
|
|
747
|
+
updatedAt: Date;
|
|
748
|
+
}>;
|
|
749
|
+
/**
|
|
750
|
+
* Update order shipping information (for Shippo integration)
|
|
751
|
+
*/
|
|
752
|
+
export declare function updateOrderShipping(orderId: string, shippingData: {
|
|
753
|
+
trackingNumber?: string;
|
|
754
|
+
trackingUrl?: string;
|
|
755
|
+
carrier?: string;
|
|
756
|
+
labelUrl?: string;
|
|
757
|
+
shippoRateId?: string;
|
|
758
|
+
shippingMethod?: string;
|
|
759
|
+
status?: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled' | 'refunded';
|
|
760
|
+
}): Promise<{
|
|
761
|
+
id: string;
|
|
762
|
+
customerId: string | null;
|
|
763
|
+
email: string;
|
|
764
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
765
|
+
subtotal: string;
|
|
766
|
+
tax: string;
|
|
767
|
+
shipping: string;
|
|
768
|
+
total: string;
|
|
769
|
+
refundAmount: string | null;
|
|
770
|
+
returnReason: string | null;
|
|
771
|
+
discountCode: string | null;
|
|
772
|
+
discountAmount: string | null;
|
|
773
|
+
stripePromotionCodeId: string | null;
|
|
774
|
+
shippingAddress: {
|
|
775
|
+
firstName: string;
|
|
776
|
+
lastName: string;
|
|
777
|
+
line1: string;
|
|
778
|
+
line2?: string;
|
|
779
|
+
city: string;
|
|
780
|
+
state: string;
|
|
781
|
+
postalCode: string;
|
|
782
|
+
country: string;
|
|
783
|
+
phone?: string;
|
|
784
|
+
} | null;
|
|
785
|
+
billingAddress: {
|
|
786
|
+
firstName: string;
|
|
787
|
+
lastName: string;
|
|
788
|
+
line1: string;
|
|
789
|
+
line2?: string;
|
|
790
|
+
city: string;
|
|
791
|
+
state: string;
|
|
792
|
+
postalCode: string;
|
|
793
|
+
country: string;
|
|
794
|
+
phone?: string;
|
|
795
|
+
} | null;
|
|
796
|
+
stripePaymentIntentId: string | null;
|
|
797
|
+
stripeChargeId: string | null;
|
|
798
|
+
receiptUrl: string | null;
|
|
799
|
+
trackingNumber: string | null;
|
|
800
|
+
trackingUrl: string | null;
|
|
801
|
+
carrier: string | null;
|
|
802
|
+
labelUrl: string | null;
|
|
803
|
+
shippoRateId: string | null;
|
|
804
|
+
shippingMethod: string | null;
|
|
805
|
+
createdAt: Date;
|
|
806
|
+
updatedAt: Date;
|
|
807
|
+
}>;
|
|
808
|
+
/**
|
|
809
|
+
* Find order by Stripe Payment Intent ID
|
|
810
|
+
* Used for idempotency in webhook handling
|
|
811
|
+
*/
|
|
812
|
+
export declare function findOrderByPaymentIntent(paymentIntentId: string): Promise<{
|
|
813
|
+
id: string;
|
|
814
|
+
customerId: string | null;
|
|
815
|
+
email: string;
|
|
816
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
817
|
+
subtotal: string;
|
|
818
|
+
tax: string;
|
|
819
|
+
shipping: string;
|
|
820
|
+
total: string;
|
|
821
|
+
refundAmount: string | null;
|
|
822
|
+
returnReason: string | null;
|
|
823
|
+
discountCode: string | null;
|
|
824
|
+
discountAmount: string | null;
|
|
825
|
+
stripePromotionCodeId: string | null;
|
|
826
|
+
shippingAddress: {
|
|
827
|
+
firstName: string;
|
|
828
|
+
lastName: string;
|
|
829
|
+
line1: string;
|
|
830
|
+
line2?: string;
|
|
831
|
+
city: string;
|
|
832
|
+
state: string;
|
|
833
|
+
postalCode: string;
|
|
834
|
+
country: string;
|
|
835
|
+
phone?: string;
|
|
836
|
+
} | null;
|
|
837
|
+
billingAddress: {
|
|
838
|
+
firstName: string;
|
|
839
|
+
lastName: string;
|
|
840
|
+
line1: string;
|
|
841
|
+
line2?: string;
|
|
842
|
+
city: string;
|
|
843
|
+
state: string;
|
|
844
|
+
postalCode: string;
|
|
845
|
+
country: string;
|
|
846
|
+
phone?: string;
|
|
847
|
+
} | null;
|
|
848
|
+
stripePaymentIntentId: string | null;
|
|
849
|
+
stripeChargeId: string | null;
|
|
850
|
+
receiptUrl: string | null;
|
|
851
|
+
trackingNumber: string | null;
|
|
852
|
+
trackingUrl: string | null;
|
|
853
|
+
carrier: string | null;
|
|
854
|
+
labelUrl: string | null;
|
|
855
|
+
shippoRateId: string | null;
|
|
856
|
+
shippingMethod: string | null;
|
|
857
|
+
createdAt: Date;
|
|
858
|
+
updatedAt: Date;
|
|
859
|
+
}>;
|
|
860
|
+
/**
|
|
861
|
+
* Update order refund amount (for partial refund tracking)
|
|
862
|
+
* Adds the refund amount to the existing refund total
|
|
863
|
+
*/
|
|
864
|
+
export declare function updateOrderRefundAmount(orderId: string, refundAmountCents: number): Promise<schema.Order | null>;
|
|
865
|
+
/**
|
|
866
|
+
* Update order receipt information (for Stripe receipt URL)
|
|
867
|
+
*/
|
|
868
|
+
export declare function updateOrderReceipt(orderId: string, receiptData: {
|
|
869
|
+
stripeChargeId?: string;
|
|
870
|
+
receiptUrl?: string;
|
|
871
|
+
}): Promise<schema.Order | null>;
|
|
872
|
+
/**
|
|
873
|
+
* Update order with return request
|
|
874
|
+
* Sets status to 'return_requested' and stores the return reason
|
|
875
|
+
*/
|
|
876
|
+
export declare function updateOrderReturnRequest(orderId: string, returnReason: string): Promise<schema.Order | null>;
|
|
877
|
+
/**
|
|
878
|
+
* Clear order return request
|
|
879
|
+
* Sets status back to 'delivered' and clears the return reason
|
|
880
|
+
*/
|
|
881
|
+
export declare function clearOrderReturnRequest(orderId: string): Promise<schema.Order | null>;
|
|
882
|
+
/**
|
|
883
|
+
* Create a new product
|
|
884
|
+
*/
|
|
885
|
+
export declare function createProduct(data: schema.NewProduct): Promise<schema.Product>;
|
|
886
|
+
/**
|
|
887
|
+
* Update a product by ID
|
|
888
|
+
*/
|
|
889
|
+
export declare function updateProduct(id: string, data: Partial<Omit<schema.NewProduct, 'id'>>): Promise<schema.Product | null>;
|
|
890
|
+
/**
|
|
891
|
+
* Archive a product by ID (soft delete).
|
|
892
|
+
* Sets status to 'archived' instead of deleting to preserve order history.
|
|
893
|
+
* Use hardDeleteProduct() for permanent deletion if needed.
|
|
894
|
+
*/
|
|
895
|
+
export declare function deleteProduct(id: string): Promise<boolean>;
|
|
896
|
+
/**
|
|
897
|
+
* Permanently delete a product by ID.
|
|
898
|
+
* WARNING: This will fail if there are order_items referencing this product.
|
|
899
|
+
* Use deleteProduct() (soft delete) for most cases.
|
|
900
|
+
*/
|
|
901
|
+
export declare function hardDeleteProduct(id: string): Promise<boolean>;
|
|
902
|
+
/**
|
|
903
|
+
* Create a new product variant
|
|
904
|
+
*/
|
|
905
|
+
export declare function createProductVariant(data: schema.NewProductVariant): Promise<schema.ProductVariant>;
|
|
906
|
+
/**
|
|
907
|
+
* Update a product variant by ID
|
|
908
|
+
*/
|
|
909
|
+
export declare function updateProductVariant(id: string, data: Partial<Omit<schema.NewProductVariant, 'id' | 'productId'>>): Promise<schema.ProductVariant | null>;
|
|
910
|
+
/**
|
|
911
|
+
* Delete a product variant by ID
|
|
912
|
+
*/
|
|
913
|
+
export declare function deleteProductVariant(id: string): Promise<boolean>;
|
|
914
|
+
/**
|
|
915
|
+
* Update variant inventory
|
|
916
|
+
*/
|
|
917
|
+
export declare function updateVariantInventory(id: string, inventory: number): Promise<void>;
|
|
918
|
+
/**
|
|
919
|
+
* Find a variant by ID
|
|
920
|
+
*/
|
|
921
|
+
export declare function findVariantById(id: string): Promise<schema.ProductVariant | null>;
|
|
922
|
+
/**
|
|
923
|
+
* Find a category by ID
|
|
924
|
+
*/
|
|
925
|
+
export declare function findCategoryById(id: string): Promise<schema.Category | null>;
|
|
926
|
+
/**
|
|
927
|
+
* Create a new category
|
|
928
|
+
*/
|
|
929
|
+
export declare function createCategory(data: schema.NewCategory): Promise<schema.Category>;
|
|
930
|
+
/**
|
|
931
|
+
* Update a category by ID
|
|
932
|
+
*/
|
|
933
|
+
export declare function updateCategory(id: string, data: Partial<Omit<schema.NewCategory, 'id'>>): Promise<schema.Category | null>;
|
|
934
|
+
/**
|
|
935
|
+
* Delete a category by ID
|
|
936
|
+
*/
|
|
937
|
+
export declare function deleteCategory(id: string): Promise<boolean>;
|
|
938
|
+
/**
|
|
939
|
+
* Count categories
|
|
940
|
+
*/
|
|
941
|
+
export declare function countCategories(): Promise<number>;
|
|
942
|
+
/**
|
|
943
|
+
* Count customers with optional search
|
|
944
|
+
*/
|
|
945
|
+
export declare function countCustomers(options?: {
|
|
946
|
+
search?: string;
|
|
947
|
+
}): Promise<number>;
|
|
948
|
+
/**
|
|
949
|
+
* Find orders for a specific customer
|
|
950
|
+
*/
|
|
951
|
+
export declare function findCustomerOrders(customerId: string): Promise<{
|
|
952
|
+
id: string;
|
|
953
|
+
customerId: string | null;
|
|
954
|
+
email: string;
|
|
955
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded" | "return_requested";
|
|
956
|
+
subtotal: string;
|
|
957
|
+
tax: string;
|
|
958
|
+
shipping: string;
|
|
959
|
+
total: string;
|
|
960
|
+
refundAmount: string | null;
|
|
961
|
+
returnReason: string | null;
|
|
962
|
+
discountCode: string | null;
|
|
963
|
+
discountAmount: string | null;
|
|
964
|
+
stripePromotionCodeId: string | null;
|
|
965
|
+
shippingAddress: {
|
|
966
|
+
firstName: string;
|
|
967
|
+
lastName: string;
|
|
968
|
+
line1: string;
|
|
969
|
+
line2?: string;
|
|
970
|
+
city: string;
|
|
971
|
+
state: string;
|
|
972
|
+
postalCode: string;
|
|
973
|
+
country: string;
|
|
974
|
+
phone?: string;
|
|
975
|
+
} | null;
|
|
976
|
+
billingAddress: {
|
|
977
|
+
firstName: string;
|
|
978
|
+
lastName: string;
|
|
979
|
+
line1: string;
|
|
980
|
+
line2?: string;
|
|
981
|
+
city: string;
|
|
982
|
+
state: string;
|
|
983
|
+
postalCode: string;
|
|
984
|
+
country: string;
|
|
985
|
+
phone?: string;
|
|
986
|
+
} | null;
|
|
987
|
+
stripePaymentIntentId: string | null;
|
|
988
|
+
stripeChargeId: string | null;
|
|
989
|
+
receiptUrl: string | null;
|
|
990
|
+
trackingNumber: string | null;
|
|
991
|
+
trackingUrl: string | null;
|
|
992
|
+
carrier: string | null;
|
|
993
|
+
labelUrl: string | null;
|
|
994
|
+
shippoRateId: string | null;
|
|
995
|
+
shippingMethod: string | null;
|
|
996
|
+
createdAt: Date;
|
|
997
|
+
updatedAt: Date;
|
|
998
|
+
}[]>;
|
|
999
|
+
/**
|
|
1000
|
+
* Claim guest orders by email when a customer registers.
|
|
1001
|
+
* Updates all orders with matching email and null customerId to the new customer.
|
|
1002
|
+
*
|
|
1003
|
+
* @param email - Email address (will be lowercased)
|
|
1004
|
+
* @param customerId - New customer ID to assign
|
|
1005
|
+
* @returns Number of orders claimed
|
|
1006
|
+
*/
|
|
1007
|
+
export declare function claimGuestOrders(email: string, customerId: string): Promise<number>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Delete (anonymize) a customer by ID.
|
|
1010
|
+
*
|
|
1011
|
+
* This is a SOFT DELETE that anonymizes customer data instead of removing the record.
|
|
1012
|
+
* This approach:
|
|
1013
|
+
* - Preserves order history integrity (orders reference customerId)
|
|
1014
|
+
* - Complies with GDPR "right to erasure" through anonymization
|
|
1015
|
+
* - Prevents login by invalidating passwordHash
|
|
1016
|
+
* - Keeps the record for audit trail purposes
|
|
1017
|
+
*
|
|
1018
|
+
* Related tokens (verification, password reset) are auto-deleted via CASCADE.
|
|
1019
|
+
*
|
|
1020
|
+
* @param id - Customer UUID
|
|
1021
|
+
* @returns true if customer was found and anonymized, false if not found
|
|
1022
|
+
*/
|
|
1023
|
+
export declare function deleteCustomer(id: string): Promise<boolean>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Count orders with optional status filter
|
|
1026
|
+
*/
|
|
1027
|
+
export declare function countOrders(options?: {
|
|
1028
|
+
status?: schema.Order['status'];
|
|
1029
|
+
}): Promise<number>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Get revenue by period (for analytics).
|
|
1032
|
+
*
|
|
1033
|
+
* Returns one row per calendar day in the window, **including days with zero
|
|
1034
|
+
* revenue**. The SQL GROUP BY only emits rows where orders exist, which made
|
|
1035
|
+
* the chart skip empty days and look discontinuous (e.g., a Friday-only seller
|
|
1036
|
+
* showed 5 floating points instead of 30). Fill happens in-process, so the
|
|
1037
|
+
* chart can render a continuous line without the consumer thinking about it.
|
|
1038
|
+
*
|
|
1039
|
+
* Date format is `YYYY-MM-DD` in UTC (matches Postgres `DATE()` output).
|
|
1040
|
+
*/
|
|
1041
|
+
export declare function getRevenueByPeriod(days: number): Promise<{
|
|
1042
|
+
date: string;
|
|
1043
|
+
revenue: number;
|
|
1044
|
+
}[]>;
|
|
1045
|
+
/**
|
|
1046
|
+
* Get orders by status count (for analytics)
|
|
1047
|
+
*/
|
|
1048
|
+
export declare function getOrdersByStatus(): Promise<{
|
|
1049
|
+
status: string;
|
|
1050
|
+
count: number;
|
|
1051
|
+
}[]>;
|
|
1052
|
+
/**
|
|
1053
|
+
* Settings data type for API responses
|
|
1054
|
+
*/
|
|
1055
|
+
export interface StoreSettingsData {
|
|
1056
|
+
storeName: string | null;
|
|
1057
|
+
storeEmail: string | null;
|
|
1058
|
+
logoUrl: string | null;
|
|
1059
|
+
storeCurrency: string | null;
|
|
1060
|
+
storeTimezone: string | null;
|
|
1061
|
+
taxIncludedInPrices: boolean | null;
|
|
1062
|
+
shippingEnabled: boolean | null;
|
|
1063
|
+
freeShippingThreshold: number | null;
|
|
1064
|
+
shippingCountries: string[] | null;
|
|
1065
|
+
guestCheckout: boolean | null;
|
|
1066
|
+
customerAccounts: boolean | null;
|
|
1067
|
+
shippingMode: 'manual' | 'shippo' | null;
|
|
1068
|
+
shippoApiKey: string | null;
|
|
1069
|
+
shippoTestMode: boolean | null;
|
|
1070
|
+
shippoFromAddress: {
|
|
1071
|
+
name: string;
|
|
1072
|
+
company?: string;
|
|
1073
|
+
street1: string;
|
|
1074
|
+
street2?: string;
|
|
1075
|
+
city: string;
|
|
1076
|
+
state: string;
|
|
1077
|
+
zip: string;
|
|
1078
|
+
country: string;
|
|
1079
|
+
phone?: string;
|
|
1080
|
+
email?: string;
|
|
1081
|
+
} | null;
|
|
1082
|
+
shippoDefaultParcel: {
|
|
1083
|
+
length: number;
|
|
1084
|
+
width: number;
|
|
1085
|
+
height: number;
|
|
1086
|
+
weight: number;
|
|
1087
|
+
} | null;
|
|
1088
|
+
promotionCodesEnabled: boolean | null;
|
|
1089
|
+
cookieBannerEnabled: boolean | null;
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Find store settings.
|
|
1093
|
+
* Returns null if no settings exist (first time access).
|
|
1094
|
+
* Each store has only one settings row.
|
|
1095
|
+
*/
|
|
1096
|
+
export declare function findSettings(): Promise<StoreSettingsData | null>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Upsert (create or update) store settings.
|
|
1099
|
+
* Each store has only one settings row.
|
|
1100
|
+
*/
|
|
1101
|
+
export declare function upsertSettings(data: Partial<StoreSettingsData>): Promise<StoreSettingsData>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Shipping carrier data for API responses
|
|
1104
|
+
*/
|
|
1105
|
+
export interface ShippingCarrierData {
|
|
1106
|
+
id: string;
|
|
1107
|
+
name: string;
|
|
1108
|
+
code: string;
|
|
1109
|
+
description: string | null;
|
|
1110
|
+
isActive: boolean;
|
|
1111
|
+
sortOrder: number;
|
|
1112
|
+
createdAt: Date;
|
|
1113
|
+
updatedAt: Date;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Shipping carrier with nested zones and rates for full hierarchy
|
|
1117
|
+
*/
|
|
1118
|
+
export interface ShippingCarrierWithZones extends ShippingCarrierData {
|
|
1119
|
+
zones: ShippingZoneWithRates[];
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Find all shipping carriers
|
|
1123
|
+
*/
|
|
1124
|
+
export declare function findShippingCarriers(): Promise<ShippingCarrierData[]>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Find active shipping carriers only
|
|
1127
|
+
*/
|
|
1128
|
+
export declare function findActiveShippingCarriers(): Promise<ShippingCarrierData[]>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Find a shipping carrier by ID
|
|
1131
|
+
*/
|
|
1132
|
+
export declare function findShippingCarrierById(id: string): Promise<ShippingCarrierData | null>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Create a new shipping carrier
|
|
1135
|
+
*/
|
|
1136
|
+
export declare function createShippingCarrier(data: {
|
|
1137
|
+
name: string;
|
|
1138
|
+
code: string;
|
|
1139
|
+
description?: string;
|
|
1140
|
+
isActive?: boolean;
|
|
1141
|
+
sortOrder?: number;
|
|
1142
|
+
}): Promise<schema.ShippingCarrier>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Update a shipping carrier
|
|
1145
|
+
*/
|
|
1146
|
+
export declare function updateShippingCarrier(id: string, data: Partial<{
|
|
1147
|
+
name: string;
|
|
1148
|
+
code: string;
|
|
1149
|
+
description: string | null;
|
|
1150
|
+
isActive: boolean;
|
|
1151
|
+
sortOrder: number;
|
|
1152
|
+
}>): Promise<schema.ShippingCarrier | null>;
|
|
1153
|
+
/**
|
|
1154
|
+
* Delete a shipping carrier (cascades to zones and rates)
|
|
1155
|
+
*/
|
|
1156
|
+
export declare function deleteShippingCarrier(id: string): Promise<boolean>;
|
|
1157
|
+
/**
|
|
1158
|
+
* Find all carriers with their zones and rates (full hierarchy for admin UI)
|
|
1159
|
+
*/
|
|
1160
|
+
export declare function findCarriersWithZonesAndRates(): Promise<ShippingCarrierWithZones[]>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Shipping zone with nested rates for API responses
|
|
1163
|
+
*/
|
|
1164
|
+
export interface ShippingZoneWithRates {
|
|
1165
|
+
id: string;
|
|
1166
|
+
carrierId: string;
|
|
1167
|
+
carrier?: {
|
|
1168
|
+
id: string;
|
|
1169
|
+
name: string;
|
|
1170
|
+
code: string;
|
|
1171
|
+
};
|
|
1172
|
+
name: string;
|
|
1173
|
+
countries: string[];
|
|
1174
|
+
isActive: boolean;
|
|
1175
|
+
sortOrder: number;
|
|
1176
|
+
createdAt: Date;
|
|
1177
|
+
updatedAt: Date;
|
|
1178
|
+
rates: Array<{
|
|
1179
|
+
id: string;
|
|
1180
|
+
name: string;
|
|
1181
|
+
description: string | null;
|
|
1182
|
+
price: number;
|
|
1183
|
+
minOrderAmount: number | null;
|
|
1184
|
+
maxOrderAmount: number | null;
|
|
1185
|
+
estimatedDays: string | null;
|
|
1186
|
+
isActive: boolean;
|
|
1187
|
+
sortOrder: number;
|
|
1188
|
+
}>;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Find all shipping zones with their rates and carrier info
|
|
1192
|
+
*/
|
|
1193
|
+
export declare function findShippingZones(): Promise<ShippingZoneWithRates[]>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Find active shipping zones only
|
|
1196
|
+
*/
|
|
1197
|
+
export declare function findActiveShippingZones(): Promise<ShippingZoneWithRates[]>;
|
|
1198
|
+
/**
|
|
1199
|
+
* Find a shipping zone by ID
|
|
1200
|
+
*/
|
|
1201
|
+
export declare function findShippingZoneById(id: string): Promise<ShippingZoneWithRates | null>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Create a new shipping zone under a carrier
|
|
1204
|
+
*/
|
|
1205
|
+
export declare function createShippingZone(data: {
|
|
1206
|
+
carrierId: string;
|
|
1207
|
+
name: string;
|
|
1208
|
+
countries: string[];
|
|
1209
|
+
isActive?: boolean;
|
|
1210
|
+
sortOrder?: number;
|
|
1211
|
+
}): Promise<schema.ShippingZone>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Update a shipping zone
|
|
1214
|
+
*/
|
|
1215
|
+
export declare function updateShippingZone(id: string, data: Partial<{
|
|
1216
|
+
carrierId: string;
|
|
1217
|
+
name: string;
|
|
1218
|
+
countries: string[];
|
|
1219
|
+
isActive: boolean;
|
|
1220
|
+
sortOrder: number;
|
|
1221
|
+
}>): Promise<schema.ShippingZone | null>;
|
|
1222
|
+
/**
|
|
1223
|
+
* Delete a shipping zone (cascades to rates)
|
|
1224
|
+
*/
|
|
1225
|
+
export declare function deleteShippingZone(id: string): Promise<boolean>;
|
|
1226
|
+
/**
|
|
1227
|
+
* Create a shipping rate for a zone
|
|
1228
|
+
*/
|
|
1229
|
+
export declare function createShippingRate(data: {
|
|
1230
|
+
zoneId: string;
|
|
1231
|
+
name: string;
|
|
1232
|
+
description?: string;
|
|
1233
|
+
price: number;
|
|
1234
|
+
minOrderAmount?: number;
|
|
1235
|
+
maxOrderAmount?: number;
|
|
1236
|
+
estimatedDays?: string;
|
|
1237
|
+
isActive?: boolean;
|
|
1238
|
+
sortOrder?: number;
|
|
1239
|
+
}): Promise<schema.ShippingRate>;
|
|
1240
|
+
/**
|
|
1241
|
+
* Update a shipping rate
|
|
1242
|
+
*/
|
|
1243
|
+
export declare function updateShippingRate(id: string, data: Partial<{
|
|
1244
|
+
name: string;
|
|
1245
|
+
description: string | null;
|
|
1246
|
+
price: number;
|
|
1247
|
+
minOrderAmount: number | null;
|
|
1248
|
+
maxOrderAmount: number | null;
|
|
1249
|
+
estimatedDays: string | null;
|
|
1250
|
+
isActive: boolean;
|
|
1251
|
+
sortOrder: number;
|
|
1252
|
+
}>): Promise<schema.ShippingRate | null>;
|
|
1253
|
+
/**
|
|
1254
|
+
* Delete a shipping rate
|
|
1255
|
+
*/
|
|
1256
|
+
export declare function deleteShippingRate(id: string): Promise<boolean>;
|
|
1257
|
+
/**
|
|
1258
|
+
* Find shipping rates applicable to a specific country and order amount.
|
|
1259
|
+
* Used during checkout to determine which shipping options to show.
|
|
1260
|
+
*
|
|
1261
|
+
* @param country - ISO country code (e.g., 'US', 'CA')
|
|
1262
|
+
* @param orderAmount - Order subtotal in dollars
|
|
1263
|
+
* @returns Array of applicable shipping rates with carrier info
|
|
1264
|
+
*/
|
|
1265
|
+
export declare function findShippingRatesForCountry(country: string, orderAmount: number): Promise<Array<{
|
|
1266
|
+
id: string;
|
|
1267
|
+
carrierId: string;
|
|
1268
|
+
carrierName: string;
|
|
1269
|
+
carrierCode: string;
|
|
1270
|
+
zoneName: string;
|
|
1271
|
+
name: string;
|
|
1272
|
+
description: string | null;
|
|
1273
|
+
price: number;
|
|
1274
|
+
estimatedDays: string | null;
|
|
1275
|
+
}>>;
|
|
1276
|
+
/**
|
|
1277
|
+
* Shipping option for checkout UI (unified format for both manual and Shippo modes)
|
|
1278
|
+
* Compatible with checkout/types.ts ShippingOption
|
|
1279
|
+
*/
|
|
1280
|
+
export interface ShippingOptionForCheckout {
|
|
1281
|
+
id: string;
|
|
1282
|
+
carrierId: string;
|
|
1283
|
+
carrierName: string;
|
|
1284
|
+
carrierCode: string;
|
|
1285
|
+
/** Display name (e.g., "Standard Shipping", "Priority Mail") - matches ShippingOption.name */
|
|
1286
|
+
name: string;
|
|
1287
|
+
/** Description - optional to match ShippingOption */
|
|
1288
|
+
description?: string;
|
|
1289
|
+
price: number;
|
|
1290
|
+
/** Estimated delivery time - optional to match ShippingOption */
|
|
1291
|
+
estimatedDays?: string;
|
|
1292
|
+
source: 'manual' | 'shippo';
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Shipping options grouped by carrier for checkout UI
|
|
1296
|
+
*/
|
|
1297
|
+
export interface ShippingOptionsGroupedByCarrier {
|
|
1298
|
+
carrier: {
|
|
1299
|
+
id: string;
|
|
1300
|
+
name: string;
|
|
1301
|
+
code: string;
|
|
1302
|
+
};
|
|
1303
|
+
options: ShippingOptionForCheckout[];
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Find shipping options for checkout grouped by carrier.
|
|
1307
|
+
* This is the main function used by the pre-checkout flow.
|
|
1308
|
+
*
|
|
1309
|
+
* @param country - ISO country code (e.g., 'US', 'CA')
|
|
1310
|
+
* @param orderAmount - Order subtotal in dollars
|
|
1311
|
+
* @returns Shipping options grouped by carrier
|
|
1312
|
+
*/
|
|
1313
|
+
export declare function findShippingOptionsForCountry(country: string, orderAmount: number): Promise<ShippingOptionsGroupedByCarrier[]>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Tax zone data for API responses
|
|
1316
|
+
*/
|
|
1317
|
+
export interface TaxZoneData {
|
|
1318
|
+
id: string;
|
|
1319
|
+
name: string;
|
|
1320
|
+
countries: string[];
|
|
1321
|
+
states: string[];
|
|
1322
|
+
taxRate: number;
|
|
1323
|
+
isActive: boolean;
|
|
1324
|
+
sortOrder: number;
|
|
1325
|
+
createdAt: Date;
|
|
1326
|
+
updatedAt: Date;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Find all tax zones ordered by priority (sortOrder ascending)
|
|
1330
|
+
*/
|
|
1331
|
+
export declare function findTaxZones(): Promise<TaxZoneData[]>;
|
|
1332
|
+
/**
|
|
1333
|
+
* Find only active tax zones
|
|
1334
|
+
*/
|
|
1335
|
+
export declare function findActiveTaxZones(): Promise<TaxZoneData[]>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Find a tax zone by ID
|
|
1338
|
+
*/
|
|
1339
|
+
export declare function findTaxZoneById(id: string): Promise<TaxZoneData | null>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Create a new tax zone
|
|
1342
|
+
*/
|
|
1343
|
+
export declare function createTaxZone(data: {
|
|
1344
|
+
name: string;
|
|
1345
|
+
countries: string[];
|
|
1346
|
+
states?: string[];
|
|
1347
|
+
taxRate: number;
|
|
1348
|
+
isActive?: boolean;
|
|
1349
|
+
sortOrder?: number;
|
|
1350
|
+
}): Promise<schema.TaxZone>;
|
|
1351
|
+
/**
|
|
1352
|
+
* Update a tax zone
|
|
1353
|
+
*/
|
|
1354
|
+
export declare function updateTaxZone(id: string, data: Partial<{
|
|
1355
|
+
name: string;
|
|
1356
|
+
countries: string[];
|
|
1357
|
+
states: string[];
|
|
1358
|
+
taxRate: number;
|
|
1359
|
+
isActive: boolean;
|
|
1360
|
+
sortOrder: number;
|
|
1361
|
+
}>): Promise<schema.TaxZone | null>;
|
|
1362
|
+
/**
|
|
1363
|
+
* Delete a tax zone
|
|
1364
|
+
*/
|
|
1365
|
+
export declare function deleteTaxZone(id: string): Promise<boolean>;
|
|
1366
|
+
/**
|
|
1367
|
+
* Result of tax zone matching for checkout
|
|
1368
|
+
*/
|
|
1369
|
+
export interface TaxRateMatch {
|
|
1370
|
+
zoneId: string;
|
|
1371
|
+
zoneName: string;
|
|
1372
|
+
taxRate: number;
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Find the applicable tax rate for a given address.
|
|
1376
|
+
* Returns the first matching zone based on priority (sortOrder).
|
|
1377
|
+
*
|
|
1378
|
+
* Matching logic:
|
|
1379
|
+
* 1. For US addresses: Match country='US' AND state matches (if zone has states)
|
|
1380
|
+
* 2. For non-US addresses: Match country only
|
|
1381
|
+
* 3. Wildcard '*' in countries matches any country
|
|
1382
|
+
*
|
|
1383
|
+
* @param country - ISO-2 country code (e.g., 'US', 'FR')
|
|
1384
|
+
* @param state - State/province code for US (e.g., 'CA', 'NY')
|
|
1385
|
+
* @returns Tax rate info or null if no matching zone
|
|
1386
|
+
*/
|
|
1387
|
+
export declare function findTaxRateForAddress(country: string, state?: string): Promise<TaxRateMatch | null>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Shape of the `store_settings.onboarding` JSONB column. Mirrors the type in
|
|
1390
|
+
* schema.ts. Re-declared here as a plain interface so non-Drizzle consumers
|
|
1391
|
+
* (API handlers, tests) don't have to import the schema's inferred type.
|
|
1392
|
+
*/
|
|
1393
|
+
export interface OnboardingState {
|
|
1394
|
+
firstProductTouched?: boolean;
|
|
1395
|
+
logoUploaded?: boolean;
|
|
1396
|
+
taxNoneNeeded?: boolean;
|
|
1397
|
+
legalPagesReviewed?: boolean;
|
|
1398
|
+
dismissedAt?: string;
|
|
1399
|
+
}
|
|
1400
|
+
export declare function ensureOnboardingColumn(): Promise<void>;
|
|
1401
|
+
/**
|
|
1402
|
+
* Read the onboarding JSONB. Returns `{}` when the row is missing or the
|
|
1403
|
+
* column hasn't been initialized yet (legacy stores). Always safe to call.
|
|
1404
|
+
*/
|
|
1405
|
+
export declare function getOnboardingState(): Promise<OnboardingState>;
|
|
1406
|
+
/**
|
|
1407
|
+
* Set or clear a single key on the onboarding JSONB. Uses `jsonb_set` so it
|
|
1408
|
+
* never clobbers other keys written by parallel requests. Safe to call
|
|
1409
|
+
* fire-and-forget from mutating API routes (products POST/PUT, settings PUT).
|
|
1410
|
+
*/
|
|
1411
|
+
export declare function setOnboardingFlag<K extends keyof OnboardingState>(key: K, value: OnboardingState[K]): Promise<void>;
|
|
1412
|
+
/**
|
|
1413
|
+
* Aggregated signal counts used by the setup-guide GET handler. One round-trip
|
|
1414
|
+
* via Promise.all instead of four sequential queries.
|
|
1415
|
+
*/
|
|
1416
|
+
export declare function getSetupGuideSignals(): Promise<{
|
|
1417
|
+
productCount: number;
|
|
1418
|
+
shippingZonesCount: number;
|
|
1419
|
+
taxZonesCount: number;
|
|
1420
|
+
adminCount: number;
|
|
1421
|
+
storeSettings: {
|
|
1422
|
+
logoUrl: string | null;
|
|
1423
|
+
analytics: Record<string, unknown>;
|
|
1424
|
+
onboarding: OnboardingState;
|
|
1425
|
+
} | null;
|
|
1426
|
+
}>;
|
|
1427
|
+
//# sourceMappingURL=queries.d.ts.map
|