@mohasinac/appkit 2.1.3 → 2.3.0
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/README.md +80 -30
- package/dist/index.d.ts +3124 -0
- package/dist/index.js +5836 -0
- package/package.json +67 -383
- package/src/cli/index.ts +0 -221
- package/src/contracts/auth.ts +0 -63
- package/src/contracts/config.ts +0 -58
- package/src/contracts/email.ts +0 -37
- package/src/contracts/extend.ts +0 -195
- package/src/contracts/feature.ts +0 -60
- package/src/contracts/index.ts +0 -122
- package/src/contracts/infra.ts +0 -50
- package/src/contracts/payment.ts +0 -50
- package/src/contracts/registry.ts +0 -44
- package/src/contracts/repository.ts +0 -87
- package/src/contracts/search.ts +0 -49
- package/src/contracts/shipping.ts +0 -77
- package/src/contracts/storage.ts +0 -37
- package/src/contracts/style.ts +0 -25
- package/src/contracts/table.ts +0 -148
- package/src/core/CacheManager.ts +0 -85
- package/src/core/EventBus.ts +0 -89
- package/src/core/Logger.ts +0 -209
- package/src/core/Queue.ts +0 -126
- package/src/core/StorageManager.ts +0 -167
- package/src/core/copilot-log.repository.ts +0 -106
- package/src/core/index.ts +0 -39
- package/src/core/newsletter.repository.ts +0 -193
- package/src/core/site-config.ts +0 -109
- package/src/errors/api-error.ts +0 -7
- package/src/errors/authentication-error.ts +0 -7
- package/src/errors/authorization-error.ts +0 -7
- package/src/errors/base-error.ts +0 -30
- package/src/errors/database-error.ts +0 -7
- package/src/errors/error-codes.ts +0 -106
- package/src/errors/error-handler.ts +0 -74
- package/src/errors/index.ts +0 -11
- package/src/errors/not-found-error.ts +0 -7
- package/src/errors/validation-error.ts +0 -7
- package/src/features/about/components/AboutView.tsx +0 -142
- package/src/features/about/components/index.ts +0 -7
- package/src/features/about/index.ts +0 -7
- package/src/features/account/api/[userId]/addresses/route.ts +0 -131
- package/src/features/account/api/[userId]/route.ts +0 -107
- package/src/features/account/columns/index.ts +0 -61
- package/src/features/account/components/AddressBook.tsx +0 -109
- package/src/features/account/components/BecomeSellerView.tsx +0 -44
- package/src/features/account/components/ChatList.tsx +0 -43
- package/src/features/account/components/ChatWindow.tsx +0 -52
- package/src/features/account/components/MessagesView.tsx +0 -60
- package/src/features/account/components/OrderDetailView.tsx +0 -50
- package/src/features/account/components/ProfileView.tsx +0 -40
- package/src/features/account/components/UserAccountHubView.tsx +0 -40
- package/src/features/account/components/UserAddressesView.tsx +0 -44
- package/src/features/account/components/UserNotificationsView.tsx +0 -52
- package/src/features/account/components/UserOffersView.tsx +0 -37
- package/src/features/account/components/UserOrderTrackView.tsx +0 -36
- package/src/features/account/components/UserOrdersView.tsx +0 -45
- package/src/features/account/components/UserSettingsView.tsx +0 -48
- package/src/features/account/components/index.ts +0 -54
- package/src/features/account/hooks/useAccount.ts +0 -25
- package/src/features/account/index.ts +0 -7
- package/src/features/account/manifest.ts +0 -29
- package/src/features/account/messages/en.json +0 -12
- package/src/features/account/repository/account.repository.ts +0 -28
- package/src/features/account/schemas/index.ts +0 -56
- package/src/features/account/types/index.ts +0 -124
- package/src/features/admin/api/bids/route.ts +0 -63
- package/src/features/admin/api/coupons/route.ts +0 -63
- package/src/features/admin/api/products/route.ts +0 -64
- package/src/features/admin/api/reviews/route.ts +0 -63
- package/src/features/admin/components/AdminAnalyticsView.tsx +0 -124
- package/src/features/admin/components/AdminBidsView.tsx +0 -29
- package/src/features/admin/components/AdminBlogView.tsx +0 -32
- package/src/features/admin/components/AdminCarouselView.tsx +0 -57
- package/src/features/admin/components/AdminCategoriesView.tsx +0 -57
- package/src/features/admin/components/AdminCouponsView.tsx +0 -32
- package/src/features/admin/components/AdminDashboardView.tsx +0 -50
- package/src/features/admin/components/AdminFaqsView.tsx +0 -29
- package/src/features/admin/components/AdminFeatureFlagsView.tsx +0 -33
- package/src/features/admin/components/AdminMediaView.tsx +0 -57
- package/src/features/admin/components/AdminNavigationView.tsx +0 -57
- package/src/features/admin/components/AdminOrdersView.tsx +0 -29
- package/src/features/admin/components/AdminPayoutsView.tsx +0 -29
- package/src/features/admin/components/AdminProductsView.tsx +0 -32
- package/src/features/admin/components/AdminReviewsView.tsx +0 -38
- package/src/features/admin/components/AdminSectionsView.tsx +0 -57
- package/src/features/admin/components/AdminSessionsManager.tsx +0 -28
- package/src/features/admin/components/AdminSidebar.tsx +0 -28
- package/src/features/admin/components/AdminSiteView.tsx +0 -34
- package/src/features/admin/components/AdminStoresView.tsx +0 -29
- package/src/features/admin/components/AdminTopBar.tsx +0 -22
- package/src/features/admin/components/AdminUsersView.tsx +0 -32
- package/src/features/admin/components/DashboardStats.tsx +0 -95
- package/src/features/admin/components/DataTable.tsx +0 -115
- package/src/features/admin/components/DemoSeedView.tsx +0 -22
- package/src/features/admin/components/QuickActionsPanel.tsx +0 -62
- package/src/features/admin/components/analytics/AdminAnalyticsCharts.tsx +0 -114
- package/src/features/admin/components/analytics/AdminStatCard.tsx +0 -36
- package/src/features/admin/components/analytics/AdminTopProductsTable.tsx +0 -61
- package/src/features/admin/components/analytics/index.ts +0 -3
- package/src/features/admin/components/index.ts +0 -71
- package/src/features/admin/hooks/useAdmin.ts +0 -19
- package/src/features/admin/index.ts +0 -5
- package/src/features/admin/manifest.ts +0 -15
- package/src/features/admin/messages/en.json +0 -13
- package/src/features/admin/permission-map.ts +0 -27
- package/src/features/admin/server.ts +0 -10
- package/src/features/admin/types/index.ts +0 -75
- package/src/features/auctions/api/route.ts +0 -83
- package/src/features/auctions/columns/index.ts +0 -91
- package/src/features/auctions/components/AuctionCard.tsx +0 -149
- package/src/features/auctions/components/index.ts +0 -1
- package/src/features/auctions/hooks/useAuctions.ts +0 -145
- package/src/features/auctions/hooks/usePlaceBid.ts +0 -48
- package/src/features/auctions/hooks/useRealtimeBids.ts +0 -100
- package/src/features/auctions/index.ts +0 -9
- package/src/features/auctions/manifest.ts +0 -19
- package/src/features/auctions/messages/en.json +0 -18
- package/src/features/auctions/repository/auctions.repository.ts +0 -57
- package/src/features/auctions/schemas/index.ts +0 -69
- package/src/features/auctions/server.ts +0 -7
- package/src/features/auctions/types/index.ts +0 -90
- package/src/features/auth/api/route.ts +0 -63
- package/src/features/auth/components/AuthStatusPanel.tsx +0 -67
- package/src/features/auth/components/ForgotPasswordView.tsx +0 -114
- package/src/features/auth/components/Guards.tsx +0 -60
- package/src/features/auth/components/LoginForm.tsx +0 -180
- package/src/features/auth/components/RegisterForm.tsx +0 -232
- package/src/features/auth/components/ResetPasswordView.tsx +0 -144
- package/src/features/auth/components/SocialAuthButtons.tsx +0 -60
- package/src/features/auth/components/VerifyEmailView.tsx +0 -118
- package/src/features/auth/components/index.ts +0 -13
- package/src/features/auth/hooks/useAuth.ts +0 -33
- package/src/features/auth/index.ts +0 -5
- package/src/features/auth/manifest.ts +0 -23
- package/src/features/auth/messages/en.json +0 -13
- package/src/features/auth/schemas/index.ts +0 -48
- package/src/features/auth/server.ts +0 -17
- package/src/features/auth/types/index.ts +0 -36
- package/src/features/before-after/api/[id]/route.ts +0 -143
- package/src/features/before-after/api/route.ts +0 -104
- package/src/features/before-after/columns/index.ts +0 -72
- package/src/features/before-after/components/BeforeAfterGallery.tsx +0 -41
- package/src/features/before-after/components/BeforeAfterSlider.tsx +0 -89
- package/src/features/before-after/components/index.ts +0 -2
- package/src/features/before-after/hooks/useBeforeAfter.ts +0 -33
- package/src/features/before-after/index.ts +0 -7
- package/src/features/before-after/manifest.ts +0 -12
- package/src/features/before-after/messages/en.json +0 -8
- package/src/features/before-after/repository/before-after.repository.ts +0 -44
- package/src/features/before-after/schemas/index.ts +0 -25
- package/src/features/before-after/types/index.ts +0 -19
- package/src/features/blog/api/[slug]/route.ts +0 -73
- package/src/features/blog/api/route.ts +0 -81
- package/src/features/blog/columns/index.ts +0 -68
- package/src/features/blog/components/BlogFeaturedCard.tsx +0 -108
- package/src/features/blog/components/BlogListView.tsx +0 -219
- package/src/features/blog/components/BlogPostForm.tsx +0 -254
- package/src/features/blog/components/BlogPostView.tsx +0 -221
- package/src/features/blog/components/index.ts +0 -12
- package/src/features/blog/hooks/useBlog.ts +0 -67
- package/src/features/blog/index.ts +0 -7
- package/src/features/blog/manifest.ts +0 -16
- package/src/features/blog/messages/en.json +0 -14
- package/src/features/blog/repository/blog.repository.ts +0 -73
- package/src/features/blog/schemas/index.ts +0 -74
- package/src/features/blog/server.ts +0 -9
- package/src/features/blog/types/index.ts +0 -58
- package/src/features/cart/api/[id]/route.ts +0 -98
- package/src/features/cart/api/route.ts +0 -104
- package/src/features/cart/columns/index.ts +0 -73
- package/src/features/cart/components/CartDrawer.tsx +0 -183
- package/src/features/cart/components/CartSummary.tsx +0 -43
- package/src/features/cart/components/CartView.tsx +0 -47
- package/src/features/cart/components/CheckoutAddressStep.tsx +0 -68
- package/src/features/cart/components/CheckoutOtpModal.tsx +0 -39
- package/src/features/cart/components/CheckoutSuccessView.tsx +0 -31
- package/src/features/cart/components/CheckoutView.tsx +0 -70
- package/src/features/cart/components/index.ts +0 -16
- package/src/features/cart/hooks/useCart.ts +0 -30
- package/src/features/cart/hooks/useCartQuery.ts +0 -22
- package/src/features/cart/hooks/useCheckoutReadQueries.ts +0 -34
- package/src/features/cart/hooks/useOrder.ts +0 -35
- package/src/features/cart/index.ts +0 -11
- package/src/features/cart/manifest.ts +0 -12
- package/src/features/cart/messages/en.json +0 -10
- package/src/features/cart/repository/cart.repository.ts +0 -50
- package/src/features/cart/schemas/index.ts +0 -36
- package/src/features/cart/types/index.ts +0 -29
- package/src/features/cart/utils/guest-cart.ts +0 -149
- package/src/features/categories/api/[id]/route.ts +0 -144
- package/src/features/categories/api/route.ts +0 -253
- package/src/features/categories/columns/index.ts +0 -51
- package/src/features/categories/components/BreadcrumbTrail.tsx +0 -80
- package/src/features/categories/components/CategoriesListView.tsx +0 -77
- package/src/features/categories/components/CategoryGrid.tsx +0 -93
- package/src/features/categories/components/CategoryProductsView.tsx +0 -116
- package/src/features/categories/components/CategoryTree.tsx +0 -156
- package/src/features/categories/components/ConcernCard.tsx +0 -45
- package/src/features/categories/components/ConcernGrid.tsx +0 -25
- package/src/features/categories/components/index.ts +0 -17
- package/src/features/categories/hooks/useCategories.ts +0 -72
- package/src/features/categories/index.ts +0 -7
- package/src/features/categories/manifest.ts +0 -22
- package/src/features/categories/messages/en.json +0 -14
- package/src/features/categories/repository/categories.repository.ts +0 -76
- package/src/features/categories/schemas/index.ts +0 -74
- package/src/features/categories/server.ts +0 -12
- package/src/features/categories/types/index.ts +0 -60
- package/src/features/checkout/components/CheckoutStepper.tsx +0 -45
- package/src/features/checkout/components/index.ts +0 -1
- package/src/features/checkout/hooks/useCheckout.ts +0 -38
- package/src/features/checkout/index.ts +0 -4
- package/src/features/checkout/manifest.ts +0 -19
- package/src/features/checkout/messages/en.json +0 -10
- package/src/features/checkout/types/index.ts +0 -62
- package/src/features/cms/index.ts +0 -6
- package/src/features/collections/api/[slug]/route.ts +0 -167
- package/src/features/collections/api/route.ts +0 -104
- package/src/features/collections/columns/index.ts +0 -77
- package/src/features/collections/components/CollectionCard.tsx +0 -61
- package/src/features/collections/components/index.ts +0 -1
- package/src/features/collections/hooks/useCollections.ts +0 -31
- package/src/features/collections/index.ts +0 -7
- package/src/features/collections/manifest.ts +0 -18
- package/src/features/collections/messages/en.json +0 -10
- package/src/features/collections/repository/collections.repository.ts +0 -19
- package/src/features/collections/schemas/index.ts +0 -36
- package/src/features/collections/types/index.ts +0 -26
- package/src/features/consultation/api/[id]/route.ts +0 -143
- package/src/features/consultation/api/route.ts +0 -104
- package/src/features/consultation/columns/index.ts +0 -76
- package/src/features/consultation/components/ConsultationForm.tsx +0 -161
- package/src/features/consultation/components/index.ts +0 -1
- package/src/features/consultation/hooks/useBookConsultation.ts +0 -19
- package/src/features/consultation/index.ts +0 -7
- package/src/features/consultation/manifest.ts +0 -14
- package/src/features/consultation/messages/en.json +0 -25
- package/src/features/consultation/repository/consultations.repository.ts +0 -35
- package/src/features/consultation/schemas/index.ts +0 -51
- package/src/features/consultation/types/index.ts +0 -36
- package/src/features/contact/components/ContactForm.tsx +0 -202
- package/src/features/contact/components/ContactInfoSidebar.tsx +0 -85
- package/src/features/contact/components/index.ts +0 -7
- package/src/features/contact/index.ts +0 -1
- package/src/features/copilot/components/AdminCopilotView.tsx +0 -157
- package/src/features/copilot/components/index.ts +0 -2
- package/src/features/copilot/hooks/useCopilotChat.ts +0 -86
- package/src/features/copilot/index.ts +0 -2
- package/src/features/corporate/api/[id]/route.ts +0 -149
- package/src/features/corporate/api/route.ts +0 -108
- package/src/features/corporate/columns/index.ts +0 -76
- package/src/features/corporate/components/CorporateInquiryForm.tsx +0 -155
- package/src/features/corporate/components/index.ts +0 -1
- package/src/features/corporate/hooks/useSubmitCorporateInquiry.ts +0 -19
- package/src/features/corporate/index.ts +0 -7
- package/src/features/corporate/manifest.ts +0 -14
- package/src/features/corporate/messages/en.json +0 -26
- package/src/features/corporate/repository/corporate.repository.ts +0 -39
- package/src/features/corporate/schemas/index.ts +0 -53
- package/src/features/corporate/types/index.ts +0 -40
- package/src/features/cron/firebase-adapters.ts +0 -117
- package/src/features/cron/index.ts +0 -28
- package/src/features/cron/jobs/auction-expiry.job.ts +0 -76
- package/src/features/cron/jobs/preorder-reminder.job.ts +0 -64
- package/src/features/cron/registry.ts +0 -115
- package/src/features/cron/types.ts +0 -83
- package/src/features/events/api/[id]/route.ts +0 -123
- package/src/features/events/api/route.ts +0 -110
- package/src/features/events/columns/index.ts +0 -54
- package/src/features/events/components/AdminEventEntriesView.tsx +0 -39
- package/src/features/events/components/AdminEventsView.tsx +0 -47
- package/src/features/events/components/EventCard.tsx +0 -88
- package/src/features/events/components/EventDetailView.tsx +0 -51
- package/src/features/events/components/EventFormDrawer.tsx +0 -47
- package/src/features/events/components/EventLeaderboard.tsx +0 -76
- package/src/features/events/components/EventParticipateView.tsx +0 -48
- package/src/features/events/components/EventStatusBadge.tsx +0 -28
- package/src/features/events/components/EventsListView.tsx +0 -100
- package/src/features/events/components/index.ts +0 -15
- package/src/features/events/hooks/useEvent.ts +0 -94
- package/src/features/events/hooks/useEvents.ts +0 -59
- package/src/features/events/index.ts +0 -11
- package/src/features/events/manifest.ts +0 -26
- package/src/features/events/messages/en.json +0 -28
- package/src/features/events/repository/events.repository.ts +0 -110
- package/src/features/events/schemas/index.ts +0 -98
- package/src/features/events/server.ts +0 -8
- package/src/features/events/types/index.ts +0 -185
- package/src/features/faq/api/route.ts +0 -61
- package/src/features/faq/columns/index.ts +0 -60
- package/src/features/faq/components/ContactCTA.tsx +0 -115
- package/src/features/faq/components/FAQAccordion.tsx +0 -150
- package/src/features/faq/components/FAQCategorySidebar.tsx +0 -124
- package/src/features/faq/components/FAQHelpfulButtons.tsx +0 -110
- package/src/features/faq/components/FAQPageContent.tsx +0 -217
- package/src/features/faq/components/FAQSortDropdown.tsx +0 -43
- package/src/features/faq/components/RelatedFAQs.tsx +0 -74
- package/src/features/faq/components/index.ts +0 -9
- package/src/features/faq/hooks/useFAQs.ts +0 -50
- package/src/features/faq/hooks/useFaqList.ts +0 -53
- package/src/features/faq/index.ts +0 -8
- package/src/features/faq/manifest.ts +0 -12
- package/src/features/faq/messages/en.json +0 -14
- package/src/features/faq/repository/faqs.repository.ts +0 -61
- package/src/features/faq/schemas/index.ts +0 -69
- package/src/features/faq/server.ts +0 -7
- package/src/features/faq/types/index.ts +0 -63
- package/src/features/filters/FilterFacetSection.tsx +0 -205
- package/src/features/filters/FilterPanel.tsx +0 -227
- package/src/features/filters/RangeFilter.tsx +0 -291
- package/src/features/filters/SwitchFilter.tsx +0 -143
- package/src/features/filters/filterUtils.ts +0 -24
- package/src/features/filters/index.ts +0 -28
- package/src/features/forms/Checkbox.tsx +0 -100
- package/src/features/forms/Form.tsx +0 -105
- package/src/features/forms/Input.tsx +0 -127
- package/src/features/forms/Radio.tsx +0 -126
- package/src/features/forms/Select.tsx +0 -101
- package/src/features/forms/Slider.tsx +0 -119
- package/src/features/forms/Textarea.tsx +0 -99
- package/src/features/forms/Toggle.tsx +0 -110
- package/src/features/forms/index.ts +0 -34
- package/src/features/forms/utils.ts +0 -25
- package/src/features/homepage/api/[id]/route.ts +0 -145
- package/src/features/homepage/api/carousel/[id]/route.ts +0 -169
- package/src/features/homepage/api/carousel/route.ts +0 -188
- package/src/features/homepage/api/route.ts +0 -167
- package/src/features/homepage/api/sections/[id]/route.ts +0 -143
- package/src/features/homepage/api/sections/route.ts +0 -104
- package/src/features/homepage/components/AdvertisementBanner.tsx +0 -202
- package/src/features/homepage/components/BeforeAfterCard.tsx +0 -147
- package/src/features/homepage/components/CharacterHotspot.tsx +0 -742
- package/src/features/homepage/components/CharacterHotspotForm.tsx +0 -1002
- package/src/features/homepage/components/CustomerReviewsSection.tsx +0 -108
- package/src/features/homepage/components/FAQSection.tsx +0 -154
- package/src/features/homepage/components/FeaturedResultsSection.tsx +0 -97
- package/src/features/homepage/components/HeroBanner.tsx +0 -283
- package/src/features/homepage/components/HeroCarousel.tsx +0 -442
- package/src/features/homepage/components/HeroSection.tsx +0 -50
- package/src/features/homepage/components/HomepageSkeleton.tsx +0 -88
- package/src/features/homepage/components/HomepageView.tsx +0 -77
- package/src/features/homepage/components/HowItWorksInfoView.tsx +0 -161
- package/src/features/homepage/components/HowItWorksSection.tsx +0 -194
- package/src/features/homepage/components/NewsletterBanner.tsx +0 -130
- package/src/features/homepage/components/NewsletterSection.tsx +0 -85
- package/src/features/homepage/components/PromoGrid.tsx +0 -130
- package/src/features/homepage/components/SectionCarousel.tsx +0 -284
- package/src/features/homepage/components/SecurityHighlightsSection.tsx +0 -149
- package/src/features/homepage/components/SiteFeaturesSection.tsx +0 -86
- package/src/features/homepage/components/StatsCounterSection.tsx +0 -118
- package/src/features/homepage/components/TestimonialsCarousel.tsx +0 -96
- package/src/features/homepage/components/TrustBadges.tsx +0 -155
- package/src/features/homepage/components/TrustFeaturesSection.tsx +0 -168
- package/src/features/homepage/components/TrustIndicatorsSection.tsx +0 -59
- package/src/features/homepage/components/WelcomeSection.tsx +0 -178
- package/src/features/homepage/components/WhatsAppCommunitySection.tsx +0 -187
- package/src/features/homepage/components/index.ts +0 -91
- package/src/features/homepage/hooks/useBlogArticles.ts +0 -46
- package/src/features/homepage/hooks/useFeaturedAuctions.ts +0 -39
- package/src/features/homepage/hooks/useFeaturedPreOrders.ts +0 -39
- package/src/features/homepage/hooks/useFeaturedProducts.ts +0 -44
- package/src/features/homepage/hooks/useHeroCarousel.ts +0 -19
- package/src/features/homepage/hooks/useHomepage.ts +0 -25
- package/src/features/homepage/hooks/useTopBrands.ts +0 -17
- package/src/features/homepage/hooks/useTopCategories.ts +0 -19
- package/src/features/homepage/index.ts +0 -10
- package/src/features/homepage/manifest.ts +0 -16
- package/src/features/homepage/messages/en.json +0 -6
- package/src/features/homepage/repository/homepage.repository.ts +0 -38
- package/src/features/homepage/server.ts +0 -14
- package/src/features/homepage/types/index.ts +0 -183
- package/src/features/layout/AutoBreadcrumbs.tsx +0 -143
- package/src/features/layout/BackToTop.tsx +0 -58
- package/src/features/layout/BottomNavItem.tsx +0 -71
- package/src/features/layout/BottomNavLayout.tsx +0 -34
- package/src/features/layout/BottomSheet.tsx +0 -120
- package/src/features/layout/Breadcrumbs.tsx +0 -83
- package/src/features/layout/FooterLayout.tsx +0 -215
- package/src/features/layout/ListingLayout.tsx +0 -383
- package/src/features/layout/LocaleSwitcher.tsx +0 -44
- package/src/features/layout/NavbarLayout.tsx +0 -108
- package/src/features/layout/SidebarLayout.tsx +0 -75
- package/src/features/layout/TitleBarLayout.tsx +0 -285
- package/src/features/layout/index.ts +0 -46
- package/src/features/loyalty/api/admin/loyalty/grant/route.ts +0 -51
- package/src/features/loyalty/api/balance/route.ts +0 -53
- package/src/features/loyalty/api/earn/route.ts +0 -51
- package/src/features/loyalty/api/history/route.ts +0 -74
- package/src/features/loyalty/api/redeem/route.ts +0 -51
- package/src/features/loyalty/columns/index.ts +0 -61
- package/src/features/loyalty/components/CoinsDisplay.tsx +0 -36
- package/src/features/loyalty/components/index.ts +0 -1
- package/src/features/loyalty/hooks/useLoyaltyBalance.ts +0 -17
- package/src/features/loyalty/index.ts +0 -7
- package/src/features/loyalty/manifest.ts +0 -18
- package/src/features/loyalty/messages/en.json +0 -19
- package/src/features/loyalty/repository/loyalty.repository.ts +0 -29
- package/src/features/loyalty/schemas/index.ts +0 -44
- package/src/features/loyalty/types/index.ts +0 -43
- package/src/features/loyalty/types/loyalty-math.ts +0 -36
- package/src/features/media/MediaAvatar.tsx +0 -37
- package/src/features/media/MediaImage.tsx +0 -119
- package/src/features/media/MediaLightbox.tsx +0 -520
- package/src/features/media/MediaVideo.tsx +0 -94
- package/src/features/media/components/MediaSlider.tsx +0 -53
- package/src/features/media/hooks/useMedia.ts +0 -118
- package/src/features/media/index.ts +0 -74
- package/src/features/media/messages/en.json +0 -63
- package/src/features/media/modals/ImageCropModal.tsx +0 -270
- package/src/features/media/modals/VideoThumbnailSelector.tsx +0 -117
- package/src/features/media/modals/VideoTrimModal.tsx +0 -193
- package/src/features/media/types/index.ts +0 -69
- package/src/features/media/upload/CameraCapture.tsx +0 -150
- package/src/features/media/upload/ImageUpload.tsx +0 -358
- package/src/features/media/upload/MediaUploadField.tsx +0 -442
- package/src/features/media/upload/MediaUploadList.tsx +0 -255
- package/src/features/orders/columns/index.ts +0 -47
- package/src/features/orders/components/OrdersList.tsx +0 -168
- package/src/features/orders/components/index.ts +0 -1
- package/src/features/orders/hooks/useOrders.ts +0 -53
- package/src/features/orders/index.ts +0 -8
- package/src/features/orders/manifest.ts +0 -20
- package/src/features/orders/messages/en.json +0 -15
- package/src/features/orders/repository/orders.repository.ts +0 -47
- package/src/features/orders/schemas/index.ts +0 -82
- package/src/features/orders/types/index.ts +0 -97
- package/src/features/orders/utils/order-splitter.ts +0 -48
- package/src/features/payments/columns/index.ts +0 -67
- package/src/features/payments/components/index.ts +0 -1
- package/src/features/payments/hooks/usePayments.ts +0 -23
- package/src/features/payments/index.ts +0 -6
- package/src/features/payments/manifest.ts +0 -14
- package/src/features/payments/messages/en.json +0 -11
- package/src/features/payments/repository/payments.repository.ts +0 -57
- package/src/features/payments/schemas/index.ts +0 -47
- package/src/features/payments/types/index.ts +0 -50
- package/src/features/pre-orders/api/[id]/route.ts +0 -143
- package/src/features/pre-orders/api/[slug]/route.ts +0 -61
- package/src/features/pre-orders/api/admin/[id]/route.ts +0 -105
- package/src/features/pre-orders/api/admin/route.ts +0 -69
- package/src/features/pre-orders/api/route.ts +0 -96
- package/src/features/pre-orders/columns/index.ts +0 -90
- package/src/features/pre-orders/components/PreOrderBadge.tsx +0 -52
- package/src/features/pre-orders/components/PreorderCard.tsx +0 -90
- package/src/features/pre-orders/components/index.ts +0 -1
- package/src/features/pre-orders/hooks/usePreOrders.ts +0 -31
- package/src/features/pre-orders/index.ts +0 -7
- package/src/features/pre-orders/manifest.ts +0 -19
- package/src/features/pre-orders/messages/en.json +0 -13
- package/src/features/pre-orders/repository/pre-orders.repository.ts +0 -75
- package/src/features/pre-orders/repository/preorders.repository.ts +0 -24
- package/src/features/pre-orders/schemas/index.ts +0 -28
- package/src/features/pre-orders/server.ts +0 -12
- package/src/features/pre-orders/types/index.ts +0 -49
- package/src/features/products/api/[id]/route.ts +0 -200
- package/src/features/products/api/route.ts +0 -242
- package/src/features/products/columns/index.ts +0 -90
- package/src/features/products/components/AuctionDetailView.tsx +0 -58
- package/src/features/products/components/AuctionsView.tsx +0 -48
- package/src/features/products/components/BidHistory.tsx +0 -83
- package/src/features/products/components/BuyBar.tsx +0 -36
- package/src/features/products/components/MakeOfferForm.tsx +0 -43
- package/src/features/products/components/PlaceBidForm.tsx +0 -42
- package/src/features/products/components/PreOrderDetailView.tsx +0 -50
- package/src/features/products/components/PreOrdersView.tsx +0 -39
- package/src/features/products/components/ProductDetailView.tsx +0 -52
- package/src/features/products/components/ProductFeatureBadges.tsx +0 -192
- package/src/features/products/components/ProductGrid.tsx +0 -424
- package/src/features/products/components/ProductInfo.tsx +0 -44
- package/src/features/products/components/ProductTabs.tsx +0 -84
- package/src/features/products/components/ProductsView.tsx +0 -48
- package/src/features/products/components/RelatedProducts.tsx +0 -51
- package/src/features/products/components/index.ts +0 -28
- package/src/features/products/hooks/useProductDetail.ts +0 -44
- package/src/features/products/hooks/useProducts.ts +0 -112
- package/src/features/products/index.ts +0 -9
- package/src/features/products/manifest.ts +0 -18
- package/src/features/products/messages/en.json +0 -11
- package/src/features/products/repository/products.repository.ts +0 -83
- package/src/features/products/schemas/index.ts +0 -185
- package/src/features/products/server.ts +0 -12
- package/src/features/products/types/index.ts +0 -142
- package/src/features/products/utils/listing-type.ts +0 -12
- package/src/features/promotions/api/route.ts +0 -105
- package/src/features/promotions/columns/index.ts +0 -60
- package/src/features/promotions/components/CouponCard.tsx +0 -79
- package/src/features/promotions/components/PromotionsView.tsx +0 -129
- package/src/features/promotions/components/index.ts +0 -7
- package/src/features/promotions/hooks/usePromotions.ts +0 -59
- package/src/features/promotions/index.ts +0 -7
- package/src/features/promotions/manifest.ts +0 -16
- package/src/features/promotions/messages/en.json +0 -20
- package/src/features/promotions/repository/promotions.repository.ts +0 -62
- package/src/features/promotions/schemas/index.ts +0 -63
- package/src/features/promotions/server.ts +0 -7
- package/src/features/promotions/types/index.ts +0 -65
- package/src/features/reviews/api/[id]/route.ts +0 -163
- package/src/features/reviews/api/route.ts +0 -216
- package/src/features/reviews/columns/index.ts +0 -57
- package/src/features/reviews/components/ReviewModal.tsx +0 -133
- package/src/features/reviews/components/ReviewSummary.tsx +0 -82
- package/src/features/reviews/components/ReviewsList.tsx +0 -182
- package/src/features/reviews/components/ReviewsListView.tsx +0 -100
- package/src/features/reviews/components/index.ts +0 -11
- package/src/features/reviews/hooks/useReviews.ts +0 -67
- package/src/features/reviews/index.ts +0 -7
- package/src/features/reviews/manifest.ts +0 -12
- package/src/features/reviews/messages/en.json +0 -10
- package/src/features/reviews/repository/reviews.repository.ts +0 -69
- package/src/features/reviews/schemas/index.ts +0 -74
- package/src/features/reviews/server.ts +0 -12
- package/src/features/reviews/types/index.ts +0 -68
- package/src/features/search/api/route.ts +0 -100
- package/src/features/search/columns/index.ts +0 -70
- package/src/features/search/components/SearchFiltersRow.tsx +0 -118
- package/src/features/search/components/SearchResultsSection.tsx +0 -195
- package/src/features/search/components/SearchView.tsx +0 -99
- package/src/features/search/components/index.ts +0 -6
- package/src/features/search/hooks/useSearch.ts +0 -41
- package/src/features/search/index.ts +0 -7
- package/src/features/search/manifest.ts +0 -12
- package/src/features/search/messages/en.json +0 -15
- package/src/features/search/repository/search.repository.ts +0 -64
- package/src/features/search/schemas/index.ts +0 -36
- package/src/features/search/server.ts +0 -3
- package/src/features/search/types/index.ts +0 -59
- package/src/features/seller/api/coupons/route.ts +0 -57
- package/src/features/seller/api/offers/route.ts +0 -73
- package/src/features/seller/api/products/route.ts +0 -75
- package/src/features/seller/api/store/route.ts +0 -41
- package/src/features/seller/columns/index.ts +0 -103
- package/src/features/seller/components/SellerAddressesView.tsx +0 -32
- package/src/features/seller/components/SellerAnalyticsView.tsx +0 -38
- package/src/features/seller/components/SellerAuctionsView.tsx +0 -48
- package/src/features/seller/components/SellerCouponsView.tsx +0 -48
- package/src/features/seller/components/SellerCreateProductView.tsx +0 -27
- package/src/features/seller/components/SellerDashboardView.tsx +0 -41
- package/src/features/seller/components/SellerEditProductView.tsx +0 -27
- package/src/features/seller/components/SellerGuideView.tsx +0 -34
- package/src/features/seller/components/SellerOffersView.tsx +0 -46
- package/src/features/seller/components/SellerOrdersView.tsx +0 -46
- package/src/features/seller/components/SellerPayoutHistoryTable.tsx +0 -44
- package/src/features/seller/components/SellerPayoutSettingsView.tsx +0 -27
- package/src/features/seller/components/SellerPayoutStats.tsx +0 -24
- package/src/features/seller/components/SellerPayoutsView.tsx +0 -46
- package/src/features/seller/components/SellerProductsView.tsx +0 -51
- package/src/features/seller/components/SellerShippingView.tsx +0 -30
- package/src/features/seller/components/SellerSidebar.tsx +0 -84
- package/src/features/seller/components/SellerStatCard.tsx +0 -44
- package/src/features/seller/components/SellerStoreSetupView.tsx +0 -31
- package/src/features/seller/components/SellerStoreView.tsx +0 -27
- package/src/features/seller/components/SellerStorefrontView.tsx +0 -49
- package/src/features/seller/components/SellersListView.tsx +0 -43
- package/src/features/seller/components/analytics/SellerAnalyticsStats.tsx +0 -87
- package/src/features/seller/components/analytics/SellerRevenueChart.tsx +0 -99
- package/src/features/seller/components/analytics/SellerTopProducts.tsx +0 -76
- package/src/features/seller/components/analytics/index.ts +0 -3
- package/src/features/seller/components/index.ts +0 -47
- package/src/features/seller/hooks/useSellerPayouts.ts +0 -51
- package/src/features/seller/hooks/useSellerStore.ts +0 -60
- package/src/features/seller/index.ts +0 -12
- package/src/features/seller/manifest.ts +0 -76
- package/src/features/seller/messages/en.json +0 -32
- package/src/features/seller/permission-map.ts +0 -18
- package/src/features/seller/repository/seller.repository.ts +0 -100
- package/src/features/seller/schemas/index.ts +0 -113
- package/src/features/seller/server.ts +0 -10
- package/src/features/seller/types/index.ts +0 -185
- package/src/features/stores/api/[storeSlug]/auctions/route.ts +0 -134
- package/src/features/stores/api/[storeSlug]/products/route.ts +0 -139
- package/src/features/stores/api/[storeSlug]/reviews/route.ts +0 -155
- package/src/features/stores/api/[storeSlug]/route.ts +0 -120
- package/src/features/stores/api/route.ts +0 -128
- package/src/features/stores/columns/index.ts +0 -58
- package/src/features/stores/components/StoreAboutView.tsx +0 -134
- package/src/features/stores/components/StoreAuctionsView.tsx +0 -46
- package/src/features/stores/components/StoreHeader.tsx +0 -115
- package/src/features/stores/components/StoreNavTabs.tsx +0 -77
- package/src/features/stores/components/StoreProductsView.tsx +0 -77
- package/src/features/stores/components/StoreReviewsView.tsx +0 -45
- package/src/features/stores/components/StoresListView.tsx +0 -142
- package/src/features/stores/components/index.ts +0 -12
- package/src/features/stores/hooks/useStores.ts +0 -130
- package/src/features/stores/index.ts +0 -7
- package/src/features/stores/manifest.ts +0 -37
- package/src/features/stores/messages/en.json +0 -21
- package/src/features/stores/repository/stores.repository.ts +0 -51
- package/src/features/stores/schemas/index.ts +0 -42
- package/src/features/stores/server.ts +0 -11
- package/src/features/stores/types/index.ts +0 -123
- package/src/features/user/components/BecomeSellerView.tsx +0 -36
- package/src/features/user/components/MessagesView.tsx +0 -37
- package/src/features/user/components/OrderDetailView.tsx +0 -36
- package/src/features/user/components/ProfileView.tsx +0 -33
- package/src/features/user/components/UserAccountHub.tsx +0 -30
- package/src/features/user/components/UserAddressesView.tsx +0 -32
- package/src/features/user/components/UserNotificationsView.tsx +0 -38
- package/src/features/user/components/UserOffersView.tsx +0 -35
- package/src/features/user/components/UserOrdersView.tsx +0 -39
- package/src/features/user/components/UserSettingsView.tsx +0 -31
- package/src/features/user/components/UserSidebar.tsx +0 -27
- package/src/features/user/components/index.ts +0 -22
- package/src/features/user/index.ts +0 -1
- package/src/features/whatsapp-bot/api/send-status/route.ts +0 -48
- package/src/features/whatsapp-bot/api/webhook/route.ts +0 -55
- package/src/features/whatsapp-bot/components/WhatsAppChatButton.tsx +0 -38
- package/src/features/whatsapp-bot/components/index.ts +0 -1
- package/src/features/whatsapp-bot/helpers/whatsapp.ts +0 -137
- package/src/features/whatsapp-bot/index.ts +0 -4
- package/src/features/whatsapp-bot/manifest.ts +0 -15
- package/src/features/whatsapp-bot/messages/en.json +0 -7
- package/src/features/whatsapp-bot/types/index.ts +0 -61
- package/src/features/wishlist/columns/index.ts +0 -65
- package/src/features/wishlist/components/WishlistPage.tsx +0 -118
- package/src/features/wishlist/components/WishlistToggleButton.tsx +0 -68
- package/src/features/wishlist/components/WishlistView.tsx +0 -150
- package/src/features/wishlist/components/index.ts +0 -4
- package/src/features/wishlist/hooks/useUserWishlist.ts +0 -39
- package/src/features/wishlist/hooks/useWishlist.ts +0 -31
- package/src/features/wishlist/index.ts +0 -8
- package/src/features/wishlist/manifest.ts +0 -14
- package/src/features/wishlist/messages/en.json +0 -7
- package/src/features/wishlist/repository/wishlist.repository.ts +0 -43
- package/src/features/wishlist/schemas/index.ts +0 -25
- package/src/features/wishlist/types/index.ts +0 -17
- package/src/http/ApiClient.ts +0 -247
- package/src/http/index.ts +0 -10
- package/src/index.ts +0 -22
- package/src/instrumentation/index.ts +0 -77
- package/src/monitoring/cache-metrics.ts +0 -105
- package/src/monitoring/client-logger.ts +0 -83
- package/src/monitoring/error-tracking.ts +0 -115
- package/src/monitoring/index.ts +0 -52
- package/src/monitoring/performance.ts +0 -64
- package/src/monitoring/runtime.ts +0 -33
- package/src/monitoring/server-logger.ts +0 -93
- package/src/next/IAuthVerifier.ts +0 -56
- package/src/next/api/api-response.ts +0 -72
- package/src/next/api/apiHandler.ts +0 -178
- package/src/next/api/errorHandler.ts +0 -125
- package/src/next/api/routeHandler.ts +0 -175
- package/src/next/cache-middleware.ts +0 -112
- package/src/next/components/ErrorView.tsx +0 -73
- package/src/next/components/GlobalError.tsx +0 -75
- package/src/next/components/NotFoundView.tsx +0 -56
- package/src/next/components/UnauthorizedView.tsx +0 -61
- package/src/next/index.ts +0 -82
- package/src/next/middleware/chain.ts +0 -117
- package/src/next/middleware/index.ts +0 -14
- package/src/next/middleware/pii-redactor.ts +0 -112
- package/src/next/middleware/pii-scrubber.ts +0 -56
- package/src/next/middleware/types.ts +0 -26
- package/src/next/request-helpers.ts +0 -76
- package/src/next/routing/route-map.ts +0 -221
- package/src/providers/auth-firebase/browser-stub.ts +0 -32
- package/src/providers/auth-firebase/helpers.ts +0 -150
- package/src/providers/auth-firebase/index.ts +0 -26
- package/src/providers/auth-firebase/provider.ts +0 -163
- package/src/providers/auth-firebase/session.ts +0 -111
- package/src/providers/db-firebase/admin-app-lite.ts +0 -66
- package/src/providers/db-firebase/admin-auth-lite.ts +0 -16
- package/src/providers/db-firebase/admin-storage-lite.ts +0 -19
- package/src/providers/db-firebase/admin.ts +0 -217
- package/src/providers/db-firebase/base.ts +0 -243
- package/src/providers/db-firebase/browser-stub.ts +0 -47
- package/src/providers/db-firebase/helpers.ts +0 -88
- package/src/providers/db-firebase/index.ts +0 -60
- package/src/providers/db-firebase/realtime.ts +0 -185
- package/src/providers/db-firebase/sieve.ts +0 -136
- package/src/providers/email-resend/index.ts +0 -16
- package/src/providers/email-resend/provider.ts +0 -103
- package/src/providers/payment-razorpay/index.ts +0 -165
- package/src/providers/shipping-shiprocket/index.ts +0 -402
- package/src/providers/storage-firebase/index.ts +0 -17
- package/src/providers/storage-firebase/provider.ts +0 -131
- package/src/react/ErrorBoundary.tsx +0 -130
- package/src/react/hooks/useBreakpoint.ts +0 -41
- package/src/react/hooks/useBulkAction.ts +0 -161
- package/src/react/hooks/useBulkSelection.ts +0 -119
- package/src/react/hooks/useCamera.ts +0 -191
- package/src/react/hooks/useClickOutside.ts +0 -87
- package/src/react/hooks/useContainerGrid.ts +0 -77
- package/src/react/hooks/useCountdown.ts +0 -73
- package/src/react/hooks/useGesture.ts +0 -255
- package/src/react/hooks/useKeyPress.ts +0 -113
- package/src/react/hooks/useLongPress.ts +0 -62
- package/src/react/hooks/useMediaQuery.ts +0 -40
- package/src/react/hooks/usePendingFilters.ts +0 -138
- package/src/react/hooks/usePendingTable.ts +0 -84
- package/src/react/hooks/usePullToRefresh.ts +0 -111
- package/src/react/hooks/useSwipe.ts +0 -240
- package/src/react/hooks/useUnsavedChanges.ts +0 -104
- package/src/react/hooks/useUrlTable.ts +0 -189
- package/src/react/hooks/useVisibleItems.ts +0 -110
- package/src/react/index.ts +0 -99
- package/src/react/useModalStack.ts +0 -86
- package/src/security/authorization.ts +0 -92
- package/src/security/csp.ts +0 -44
- package/src/security/index.ts +0 -50
- package/src/security/pii-encrypt.ts +0 -117
- package/src/security/pii-redact.ts +0 -133
- package/src/security/rate-limit.ts +0 -170
- package/src/security/rbac/Can.tsx +0 -50
- package/src/security/rbac/default-roles.ts +0 -86
- package/src/security/rbac/hook.ts +0 -55
- package/src/security/rbac/index.ts +0 -14
- package/src/security/rbac/middleware.ts +0 -103
- package/src/security/rbac/resolver.ts +0 -69
- package/src/security/rbac/server.ts +0 -52
- package/src/security/rbac/types.ts +0 -27
- package/src/seed/defaults/categories.ts +0 -13
- package/src/seed/defaults/faqs.ts +0 -40
- package/src/seed/defaults/homepage-sections.ts +0 -63
- package/src/seed/factories/address.factory.ts +0 -106
- package/src/seed/factories/bid.factory.ts +0 -50
- package/src/seed/factories/blog-post.factory.ts +0 -40
- package/src/seed/factories/carousel.factory.ts +0 -30
- package/src/seed/factories/cart.factory.ts +0 -66
- package/src/seed/factories/category.factory.ts +0 -30
- package/src/seed/factories/coupon.factory.ts +0 -67
- package/src/seed/factories/faq.factory.ts +0 -28
- package/src/seed/factories/homepage-section.factory.ts +0 -35
- package/src/seed/factories/notification.factory.ts +0 -68
- package/src/seed/factories/order.factory.ts +0 -43
- package/src/seed/factories/payout.factory.ts +0 -62
- package/src/seed/factories/product.factory.ts +0 -120
- package/src/seed/factories/review.factory.ts +0 -67
- package/src/seed/factories/session.factory.ts +0 -49
- package/src/seed/factories/store.factory.ts +0 -69
- package/src/seed/factories/user.factory.ts +0 -88
- package/src/seed/index.ts +0 -84
- package/src/seed/runner.ts +0 -57
- package/src/seed/test-utils.ts +0 -155
- package/src/seed/types.ts +0 -40
- package/src/seo/index.ts +0 -2
- package/src/seo/json-ld.ts +0 -241
- package/src/seo/metadata.ts +0 -302
- package/src/style/tailwind/index.ts +0 -66
- package/src/style/vanilla/index.ts +0 -57
- package/src/tokens/index.ts +0 -864
- package/src/tokens/tokens.css +0 -221
- package/src/ui/DataTable.tsx +0 -655
- package/src/ui/animation.helper.ts +0 -20
- package/src/ui/color.helper.ts +0 -37
- package/src/ui/components/Accordion.tsx +0 -189
- package/src/ui/components/ActiveFilterChips.tsx +0 -81
- package/src/ui/components/Alert.tsx +0 -167
- package/src/ui/components/Badge.tsx +0 -65
- package/src/ui/components/Breadcrumb.tsx +0 -61
- package/src/ui/components/BulkActionBar.tsx +0 -246
- package/src/ui/components/Button.tsx +0 -75
- package/src/ui/components/CountdownDisplay.tsx +0 -87
- package/src/ui/components/DescriptionField.tsx +0 -55
- package/src/ui/components/Div.tsx +0 -29
- package/src/ui/components/Divider.tsx +0 -52
- package/src/ui/components/Drawer.tsx +0 -178
- package/src/ui/components/Form.tsx +0 -25
- package/src/ui/components/FormGrid.tsx +0 -82
- package/src/ui/components/HorizontalScroller.tsx +0 -183
- package/src/ui/components/IconButton.tsx +0 -71
- package/src/ui/components/ImageLightbox.tsx +0 -187
- package/src/ui/components/Input.tsx +0 -17
- package/src/ui/components/ItemRow.tsx +0 -38
- package/src/ui/components/Layout.tsx +0 -391
- package/src/ui/components/ListingLayout.tsx +0 -514
- package/src/ui/components/Modal.tsx +0 -162
- package/src/ui/components/Pagination.tsx +0 -182
- package/src/ui/components/PriceDisplay.tsx +0 -63
- package/src/ui/components/Progress.tsx +0 -154
- package/src/ui/components/RatingDisplay.tsx +0 -56
- package/src/ui/components/Select.tsx +0 -221
- package/src/ui/components/Semantic.tsx +0 -257
- package/src/ui/components/SideModal.tsx +0 -137
- package/src/ui/components/Skeleton.tsx +0 -82
- package/src/ui/components/Slider.tsx +0 -35
- package/src/ui/components/SortDropdown.tsx +0 -43
- package/src/ui/components/Spinner.tsx +0 -48
- package/src/ui/components/StarRating.tsx +0 -85
- package/src/ui/components/StatsGrid.tsx +0 -56
- package/src/ui/components/StatusBadge.tsx +0 -130
- package/src/ui/components/StepperNav.tsx +0 -89
- package/src/ui/components/SummaryCard.tsx +0 -66
- package/src/ui/components/TabStrip.tsx +0 -142
- package/src/ui/components/TablePagination.tsx +0 -134
- package/src/ui/components/TagInput.tsx +0 -133
- package/src/ui/components/TextLink.tsx +0 -68
- package/src/ui/components/Textarea.tsx +0 -17
- package/src/ui/components/Tooltip.tsx +0 -190
- package/src/ui/components/Typography.tsx +0 -270
- package/src/ui/components/ViewToggle.tsx +0 -133
- package/src/ui/index.ts +0 -248
- package/src/ui/rich-text/RichText.tsx +0 -243
- package/src/ui/rich-text/index.ts +0 -2
- package/src/ui/style.helper.ts +0 -18
- package/src/utils/animation.helper.ts +0 -22
- package/src/utils/array.helper.ts +0 -73
- package/src/utils/color.helper.ts +0 -57
- package/src/utils/cookie.converter.ts +0 -32
- package/src/utils/date.formatter.ts +0 -228
- package/src/utils/event-manager.ts +0 -168
- package/src/utils/filter.helper.ts +0 -24
- package/src/utils/id-generators.ts +0 -629
- package/src/utils/index.ts +0 -31
- package/src/utils/media-field.ts +0 -13
- package/src/utils/number.formatter.ts +0 -107
- package/src/utils/object.helper.ts +0 -111
- package/src/utils/pagination.helper.ts +0 -46
- package/src/utils/sorting.helper.ts +0 -21
- package/src/utils/string.formatter.ts +0 -178
- package/src/utils/type.converter.ts +0 -86
- package/src/validation/email.validator.ts +0 -37
- package/src/validation/index.ts +0 -17
- package/src/validation/input.validator.ts +0 -38
- package/src/validation/password.validator.ts +0 -97
- package/src/validation/phone.validator.ts +0 -38
- package/src/validation/schemas.ts +0 -106
- package/src/validation/url.validator.ts +0 -46
- package/src/validation/zod-error-map.ts +0 -96
package/src/contracts/auth.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// ─── Auth Shared Types ────────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
export interface AuthPayload {
|
|
4
|
-
uid: string;
|
|
5
|
-
email: string | null;
|
|
6
|
-
/** Application-level role string, e.g. "admin" | "seller" | "user" */
|
|
7
|
-
role: string;
|
|
8
|
-
emailVerified: boolean;
|
|
9
|
-
/** Any extra custom claims stored on the token */
|
|
10
|
-
claims?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface AuthUser {
|
|
14
|
-
uid: string;
|
|
15
|
-
email: string | null;
|
|
16
|
-
displayName: string | null;
|
|
17
|
-
photoURL: string | null;
|
|
18
|
-
role: string;
|
|
19
|
-
emailVerified: boolean;
|
|
20
|
-
disabled: boolean;
|
|
21
|
-
createdAt: string; // ISO-8601
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface CreateUserInput {
|
|
25
|
-
email: string;
|
|
26
|
-
password?: string;
|
|
27
|
-
displayName?: string;
|
|
28
|
-
photoURL?: string;
|
|
29
|
-
role?: string;
|
|
30
|
-
emailVerified?: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// ─── Auth Interfaces ──────────────────────────────────────────────────────────
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Server-side authentication operations.
|
|
37
|
-
* Implemented by @mohasinac/auth-firebase, @mohasinac/auth-nextauth, @mohasinac/auth-clerk.
|
|
38
|
-
*/
|
|
39
|
-
export interface IAuthProvider {
|
|
40
|
-
verifyToken(token: string): Promise<AuthPayload>;
|
|
41
|
-
createCustomToken(
|
|
42
|
-
uid: string,
|
|
43
|
-
claims?: Record<string, unknown>,
|
|
44
|
-
): Promise<string>;
|
|
45
|
-
getUser(uid: string): Promise<AuthUser | null>;
|
|
46
|
-
createUser(data: CreateUserInput): Promise<AuthUser>;
|
|
47
|
-
updateUser(uid: string, data: Partial<CreateUserInput>): Promise<AuthUser>;
|
|
48
|
-
deleteUser(uid: string): Promise<void>;
|
|
49
|
-
revokeTokens(uid: string): Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Session cookie management (HTTP-only, server-side).
|
|
54
|
-
* Implemented alongside IAuthProvider by the same auth package.
|
|
55
|
-
*/
|
|
56
|
-
export interface ISessionProvider {
|
|
57
|
-
/** Creates a session cookie value from a verified auth payload. */
|
|
58
|
-
createSession(payload: AuthPayload): Promise<string>;
|
|
59
|
-
/** Verifies a session cookie and returns the auth payload. */
|
|
60
|
-
verifySession(cookie: string): Promise<AuthPayload>;
|
|
61
|
-
/** Invalidates a session cookie. */
|
|
62
|
-
destroySession(cookie: string): Promise<void>;
|
|
63
|
-
}
|
package/src/contracts/config.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// ─── Site Config ─────────────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Brand configuration injected into layout/nav shell components.
|
|
5
|
-
* Passed as the `config` prop to NavbarLayout, FooterLayout, etc.
|
|
6
|
-
*/
|
|
7
|
-
export interface SiteConfig {
|
|
8
|
-
name: string;
|
|
9
|
-
tagline?: string;
|
|
10
|
-
description: string;
|
|
11
|
-
/** Canonical base URL, e.g. "https://example.com" */
|
|
12
|
-
url: string;
|
|
13
|
-
logoUrl: string;
|
|
14
|
-
logoAlt?: string;
|
|
15
|
-
email: {
|
|
16
|
-
/** Address used as the "from" field in transactional emails */
|
|
17
|
-
fromAddress: string;
|
|
18
|
-
supportAddress: string;
|
|
19
|
-
};
|
|
20
|
-
phone?: string;
|
|
21
|
-
address?: string;
|
|
22
|
-
social?: {
|
|
23
|
-
twitter?: string;
|
|
24
|
-
instagram?: string;
|
|
25
|
-
facebook?: string;
|
|
26
|
-
youtube?: string;
|
|
27
|
-
linkedin?: string;
|
|
28
|
-
whatsapp?: string;
|
|
29
|
-
};
|
|
30
|
-
/** ISO 4217 currency code used site-wide, e.g. "INR" */
|
|
31
|
-
currency?: string;
|
|
32
|
-
/** BCP 47 locale tag for default locale, e.g. "en" */
|
|
33
|
-
defaultLocale?: string;
|
|
34
|
-
/** Supported locales */
|
|
35
|
-
locales?: string[];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ─── Navigation ───────────────────────────────────────────────────────────────
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* A single nav item passed to NavbarLayout / Sidebar / BottomNavbar.
|
|
42
|
-
*/
|
|
43
|
-
export interface NavItem {
|
|
44
|
-
/** Display label (translation key or literal string) */
|
|
45
|
-
label: string;
|
|
46
|
-
/** Route href */
|
|
47
|
-
href: string;
|
|
48
|
-
/** Icon name / component key */
|
|
49
|
-
icon?: string;
|
|
50
|
-
/** Nested items for dropdown / accordion menus */
|
|
51
|
-
children?: NavItem[];
|
|
52
|
-
/** If true, item is only shown to admin users */
|
|
53
|
-
adminOnly?: boolean;
|
|
54
|
-
/** If true, item is only shown when the user is authenticated */
|
|
55
|
-
authOnly?: boolean;
|
|
56
|
-
/** Open link in a new tab */
|
|
57
|
-
external?: boolean;
|
|
58
|
-
}
|
package/src/contracts/email.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// ─── Email Shared Types ───────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
export interface EmailAttachment {
|
|
4
|
-
filename: string;
|
|
5
|
-
content: Buffer | string;
|
|
6
|
-
contentType?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface EmailOptions {
|
|
10
|
-
to: string | string[];
|
|
11
|
-
subject: string;
|
|
12
|
-
html: string;
|
|
13
|
-
text?: string;
|
|
14
|
-
/** Defaults to SiteConfig.email.fromAddress if omitted. */
|
|
15
|
-
from?: string;
|
|
16
|
-
replyTo?: string;
|
|
17
|
-
attachments?: EmailAttachment[];
|
|
18
|
-
headers?: Record<string, string>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface EmailResult {
|
|
22
|
-
id: string;
|
|
23
|
-
accepted: string[];
|
|
24
|
-
rejected: string[];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// ─── Email Interface ──────────────────────────────────────────────────────────
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Transactional email sending contract.
|
|
31
|
-
* Implemented by @mohasinac/email-resend, @mohasinac/email-nodemailer,
|
|
32
|
-
* @mohasinac/email-sendgrid, @mohasinac/email-postmark.
|
|
33
|
-
*/
|
|
34
|
-
export interface IEmailProvider {
|
|
35
|
-
send(options: EmailOptions): Promise<EmailResult>;
|
|
36
|
-
sendBatch(options: EmailOptions[]): Promise<EmailResult[]>;
|
|
37
|
-
}
|
package/src/contracts/extend.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility types for schema/type extensibility across feat-* packages.
|
|
3
|
-
*
|
|
4
|
-
* ## Three-layer extensibility model
|
|
5
|
-
*
|
|
6
|
-
* Every feat-* package exports:
|
|
7
|
-
* 1. **Schema** — a base Zod object (`xxxSchema`). Extend with `.extend({...})`.
|
|
8
|
-
* 2. **Columns** — a `xxxAdminColumns` array + `buildXxxColumns()` factory.
|
|
9
|
-
* 3. **Slots** — render-prop overrides accepted by all list/detail views.
|
|
10
|
-
*
|
|
11
|
-
* Assemble all three into a single `FeatureExtension` descriptor and pass it
|
|
12
|
-
* to the hook AND the view component:
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* // 1. Declare the extension (one file per feature in your app)
|
|
17
|
-
* import { productItemSchema, buildProductColumns } from "@mohasinac/feat-products";
|
|
18
|
-
* import type { FeatureExtension } from "./";
|
|
19
|
-
* import type { ProductItem } from "@mohasinac/feat-products";
|
|
20
|
-
* import { z } from "zod";
|
|
21
|
-
*
|
|
22
|
-
* interface ProductDocument extends ProductItem { brand: string }
|
|
23
|
-
*
|
|
24
|
-
* export const productExt: FeatureExtension<ProductItem, ProductDocument> = {
|
|
25
|
-
* schema: productItemSchema.extend({ brand: z.string() }),
|
|
26
|
-
* columns: buildProductColumns<ProductDocument>({
|
|
27
|
-
* extras: [{ key: "brand", header: "Brand", render: (p) => p.brand }],
|
|
28
|
-
* }),
|
|
29
|
-
* slots: { renderCard: (p) => <MyBrandCard product={p} /> },
|
|
30
|
-
* transform: (raw) => ({ ...raw, brand: raw.attributes?.brand ?? "" }),
|
|
31
|
-
* };
|
|
32
|
-
*
|
|
33
|
-
* // 2. Hook
|
|
34
|
-
* const { products } = useProducts<ProductDocument>(params, productExt);
|
|
35
|
-
*
|
|
36
|
-
* // 3. View
|
|
37
|
-
* <ProductGrid products={products} {...productExt.slots} />
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Options mixin for hooks that support an optional per-item transform.
|
|
43
|
-
* The transform maps the API's base type to a richer app-level type.
|
|
44
|
-
*/
|
|
45
|
-
export interface WithTransformOpts<Base, Target extends Base = Base> {
|
|
46
|
-
/**
|
|
47
|
-
* Map each API item (BaseType) to a richer app-level type (Target).
|
|
48
|
-
* Called once per item after the query resolves.
|
|
49
|
-
*/
|
|
50
|
-
transform?: (item: Base) => Target;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Convenience helper: build a response type for list endpoints that mirrors
|
|
55
|
-
* the package's standard list-response shape but with a generic item type.
|
|
56
|
-
*/
|
|
57
|
-
export interface GenericListResponse<T> {
|
|
58
|
-
items: T[];
|
|
59
|
-
total: number;
|
|
60
|
-
page: number;
|
|
61
|
-
pageSize?: number;
|
|
62
|
-
perPage?: number;
|
|
63
|
-
totalPages: number;
|
|
64
|
-
hasMore?: boolean;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// ─── Table column type (shared across feat packages) ─────────────────────────
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* A single column definition for data tables.
|
|
71
|
-
* Defined here in contracts so feat-* packages can export default column sets
|
|
72
|
-
* without cross-importing each other.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* // feat-products can export default product columns
|
|
76
|
-
* export const productAdminColumns: TableColumn<ProductItem>[] = [...];
|
|
77
|
-
*
|
|
78
|
-
* // Consumer app extends with their richer type
|
|
79
|
-
* const columns: TableColumn<ProductDocument>[] = [
|
|
80
|
-
* ...productAdminColumns as TableColumn<ProductDocument>[],
|
|
81
|
-
* { key: "brand", header: "Brand", render: (p) => p.brand },
|
|
82
|
-
* ];
|
|
83
|
-
*/
|
|
84
|
-
export interface TableColumn<T = Record<string, unknown>> {
|
|
85
|
-
/** Field key (used for sorting, cell lookup) */
|
|
86
|
-
key: string;
|
|
87
|
-
/** Column header label */
|
|
88
|
-
header: string;
|
|
89
|
-
/** Whether clicking the header fires an onSort callback */
|
|
90
|
-
sortable?: boolean;
|
|
91
|
-
/** Custom cell renderer. Return value is rendered as-is (React.ReactNode in JSX context). */
|
|
92
|
-
render?: (row: T) => unknown;
|
|
93
|
-
/** Additional className for the `<th>` and `<td>` */
|
|
94
|
-
className?: string;
|
|
95
|
-
/** CSS width / Tailwind width class applied to the column. */
|
|
96
|
-
width?: string;
|
|
97
|
-
/** Hide this column from the rendered table (keeps it in the array for export) */
|
|
98
|
-
hidden?: boolean;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// ─── Column extension helper ──────────────────────────────────────────────────
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Options accepted by every feature's `buildXxxColumns<T>()` factory.
|
|
105
|
-
* Allows apps to override individual column renderers and/or append extras.
|
|
106
|
-
*/
|
|
107
|
-
export interface ColumnExtensionOpts<T> {
|
|
108
|
-
/**
|
|
109
|
-
* Keyed partial overrides merged into the matching base column.
|
|
110
|
-
* Only the provided fields are replaced; the rest of the base column is kept.
|
|
111
|
-
*/
|
|
112
|
-
overrides?: Partial<Record<string, Partial<TableColumn<T>>>>;
|
|
113
|
-
/** Additional columns appended after the base set. */
|
|
114
|
-
extras?: TableColumn<T>[];
|
|
115
|
-
/** Omit columns by key from the final list. */
|
|
116
|
-
omit?: string[];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// ─── Layout slots ─────────────────────────────────────────────────────────────
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Render-prop slots accepted by every feature's list/detail view component.
|
|
123
|
-
* Only the slots you provide are used; the rest fall back to the package default.
|
|
124
|
-
*
|
|
125
|
-
* All return types are `unknown` here (no React dep in contracts).
|
|
126
|
-
* In practice each package narrows them to `React.ReactNode`.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* // Override only the card renderer
|
|
130
|
-
* <BlogListView
|
|
131
|
-
* posts={posts}
|
|
132
|
-
* slots={{ renderCard: (post) => <FeaturedBlogCard post={post} /> }}
|
|
133
|
-
* />
|
|
134
|
-
*/
|
|
135
|
-
export interface LayoutSlots<T> {
|
|
136
|
-
/** Replace the default card used inside grid/card-list views. */
|
|
137
|
-
renderCard?: (item: T, index: number) => unknown;
|
|
138
|
-
/** Replace the default table row (used when the view renders a table). */
|
|
139
|
-
renderRow?: (item: T, index: number) => unknown;
|
|
140
|
-
/** Replace the empty-state UI shown when there are no items. */
|
|
141
|
-
renderEmptyState?: () => unknown;
|
|
142
|
-
/** Replace the header area (title bar, action buttons, filter summary). */
|
|
143
|
-
renderHeader?: (meta: { total: number }) => unknown;
|
|
144
|
-
/** Replace the footer area (pagination, load-more button). */
|
|
145
|
-
renderFooter?: (meta: { page: number; totalPages: number }) => unknown;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// ─── Unified Feature Extension descriptor ────────────────────────────────────
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* The single object an app passes to customise one feature.
|
|
152
|
-
* Contains schema, columns, layout slots, and item transform — all optional.
|
|
153
|
-
*
|
|
154
|
-
* Every feat-* hook accepts `FeatureExtension` as its second argument (the
|
|
155
|
-
* `opts` parameter). Every feat-* list view accepts `slots` prop destructured
|
|
156
|
-
* from this object.
|
|
157
|
-
*
|
|
158
|
-
* @typeParam TBase — The base interface exported by the feat-* package
|
|
159
|
-
* (e.g. `ProductItem`, `BlogPost`).
|
|
160
|
-
* @typeParam TExtended — Your app-level interface that extends TBase
|
|
161
|
-
* (e.g. `ProductDocument`). Defaults to TBase.
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* ```ts
|
|
165
|
-
* import { productItemSchema, buildProductColumns } from "@mohasinac/feat-products";
|
|
166
|
-
* import type { FeatureExtension } from "./";
|
|
167
|
-
* import type { ProductItem } from "@mohasinac/feat-products";
|
|
168
|
-
* import { z } from "zod";
|
|
169
|
-
*
|
|
170
|
-
* interface ProductDocument extends ProductItem { brand: string }
|
|
171
|
-
*
|
|
172
|
-
* export const productExt: FeatureExtension<ProductItem, ProductDocument> = {
|
|
173
|
-
* schema: productItemSchema.extend({ brand: z.string() }),
|
|
174
|
-
* columns: buildProductColumns<ProductDocument>({
|
|
175
|
-
* extras: [{ key: "brand", header: "Brand", render: (p) => p.brand }],
|
|
176
|
-
* }),
|
|
177
|
-
* slots: { renderCard: (p) => <MyBrandCard product={p} /> },
|
|
178
|
-
* transform: (raw) => ({ ...raw, brand: raw.attributes?.brand ?? "" }),
|
|
179
|
-
* };
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
export interface FeatureExtension<TBase, TExtended extends TBase = TBase>
|
|
183
|
-
extends WithTransformOpts<TBase, TExtended> {
|
|
184
|
-
/**
|
|
185
|
-
* Extended Zod schema. Use the package's base schema with `.extend({...})`.
|
|
186
|
-
* Typed as `unknown` here so contracts stays Zod-free; at runtime it is a
|
|
187
|
-
* `ZodObject` or `ZodEffects`.
|
|
188
|
-
*/
|
|
189
|
-
schema?: unknown;
|
|
190
|
-
/** Merged admin table columns. Use the package's `buildXxxColumns()` helper. */
|
|
191
|
-
columns?: TableColumn<TExtended>[];
|
|
192
|
-
/** Render-prop slot overrides for list/detail view components. */
|
|
193
|
-
slots?: LayoutSlots<TExtended>;
|
|
194
|
-
}
|
|
195
|
-
|
package/src/contracts/feature.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// ─── Feature Manifest ─────────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Describes a page route stub that the CLI generates when `add <feature>` is run.
|
|
5
|
-
*/
|
|
6
|
-
export interface RouteStub {
|
|
7
|
-
/** Next.js route segment, e.g. "[locale]/events" */
|
|
8
|
-
segment: string;
|
|
9
|
-
exports: {
|
|
10
|
-
/** Default export name from the feature package */
|
|
11
|
-
default: string;
|
|
12
|
-
/** generateMetadata export name, if applicable */
|
|
13
|
-
generateMetadata?: string;
|
|
14
|
-
};
|
|
15
|
-
/** If true, the CLI wraps the stub in admin-only protection comments */
|
|
16
|
-
adminOnly?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Describes an API route stub that the CLI generates.
|
|
21
|
-
*/
|
|
22
|
-
export interface ApiRouteStub {
|
|
23
|
-
/** Next.js route segment, e.g. "api/events/[id]" */
|
|
24
|
-
segment: string;
|
|
25
|
-
methods: Array<"GET" | "POST" | "PATCH" | "PUT" | "DELETE">;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The contract between a feature package and @mohasinac/cli.
|
|
30
|
-
* Every feat-* package exports a `manifest` object satisfying this interface.
|
|
31
|
-
*/
|
|
32
|
-
export interface FeatureManifest {
|
|
33
|
-
/** Unique feature identifier, matches FeaturesConfig key */
|
|
34
|
-
name: string;
|
|
35
|
-
/** next-intl namespace key for this feature's messages */
|
|
36
|
-
i18nNamespace: string;
|
|
37
|
-
/** Environment variable keys required by this feature (documentation only) */
|
|
38
|
-
envKeys: string[];
|
|
39
|
-
/** Page route stubs generated by CLI on install */
|
|
40
|
-
routes: RouteStub[];
|
|
41
|
-
/** API route stubs generated by CLI on install */
|
|
42
|
-
apiRoutes: ApiRouteStub[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// ─── Features Config ──────────────────────────────────────────────────────────
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Shape of features.config.ts in consumer projects.
|
|
49
|
-
* Keys are feature names; values are booleans (enabled/disabled).
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* export default {
|
|
54
|
-
* auth: true,
|
|
55
|
-
* events: true,
|
|
56
|
-
* auctions: false,
|
|
57
|
-
* } satisfies FeaturesConfig;
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export type FeaturesConfig = Record<string, boolean>;
|
package/src/contracts/index.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// @mohasinac/contracts
|
|
2
|
-
// Pure TypeScript interfaces and shared types — no concrete code.
|
|
3
|
-
// Every other @mohasinac/* package depends on this package.
|
|
4
|
-
|
|
5
|
-
// Repository
|
|
6
|
-
export type {
|
|
7
|
-
WhereOp,
|
|
8
|
-
SieveQuery,
|
|
9
|
-
PagedResult,
|
|
10
|
-
IReadRepository,
|
|
11
|
-
IWriteRepository,
|
|
12
|
-
IRepository,
|
|
13
|
-
IRealtimeRepository,
|
|
14
|
-
IDbProvider,
|
|
15
|
-
} from "./repository";
|
|
16
|
-
|
|
17
|
-
// Auth
|
|
18
|
-
export type {
|
|
19
|
-
AuthPayload,
|
|
20
|
-
AuthUser,
|
|
21
|
-
CreateUserInput,
|
|
22
|
-
IAuthProvider,
|
|
23
|
-
ISessionProvider,
|
|
24
|
-
} from "./auth";
|
|
25
|
-
|
|
26
|
-
// Email
|
|
27
|
-
export type {
|
|
28
|
-
EmailAttachment,
|
|
29
|
-
EmailOptions,
|
|
30
|
-
EmailResult,
|
|
31
|
-
IEmailProvider,
|
|
32
|
-
} from "./email";
|
|
33
|
-
|
|
34
|
-
// Storage
|
|
35
|
-
export type {
|
|
36
|
-
UploadOptions,
|
|
37
|
-
StorageFile,
|
|
38
|
-
IStorageProvider,
|
|
39
|
-
} from "./storage";
|
|
40
|
-
|
|
41
|
-
// Payment
|
|
42
|
-
export type {
|
|
43
|
-
PaymentOrder,
|
|
44
|
-
PaymentCapture,
|
|
45
|
-
Refund,
|
|
46
|
-
IPaymentProvider,
|
|
47
|
-
} from "./payment";
|
|
48
|
-
|
|
49
|
-
// Shipping
|
|
50
|
-
export type {
|
|
51
|
-
ShippingAddress,
|
|
52
|
-
CreateShipmentInput,
|
|
53
|
-
Shipment,
|
|
54
|
-
TrackingEvent,
|
|
55
|
-
TrackingInfo,
|
|
56
|
-
ServiceabilityResult,
|
|
57
|
-
IShippingProvider,
|
|
58
|
-
} from "./shipping";
|
|
59
|
-
|
|
60
|
-
// Search
|
|
61
|
-
export type {
|
|
62
|
-
SearchOptions,
|
|
63
|
-
SearchHit,
|
|
64
|
-
SearchResult,
|
|
65
|
-
SuggestOptions,
|
|
66
|
-
ISearchProvider,
|
|
67
|
-
} from "./search";
|
|
68
|
-
|
|
69
|
-
// Infra (Cache, Queue, EventBus)
|
|
70
|
-
export type {
|
|
71
|
-
ICacheProvider,
|
|
72
|
-
QueueJob,
|
|
73
|
-
IQueueProvider,
|
|
74
|
-
EventHandler,
|
|
75
|
-
IEventBus,
|
|
76
|
-
} from "./infra";
|
|
77
|
-
|
|
78
|
-
// Style
|
|
79
|
-
export type { IStyleAdapter } from "./style";
|
|
80
|
-
|
|
81
|
-
// Registry
|
|
82
|
-
export type { ProviderRegistry } from "./registry";
|
|
83
|
-
export {
|
|
84
|
-
registerProviders,
|
|
85
|
-
getProviders,
|
|
86
|
-
_resetProviders,
|
|
87
|
-
} from "./registry";
|
|
88
|
-
|
|
89
|
-
// Feature manifest
|
|
90
|
-
export type {
|
|
91
|
-
RouteStub,
|
|
92
|
-
ApiRouteStub,
|
|
93
|
-
FeatureManifest,
|
|
94
|
-
FeaturesConfig,
|
|
95
|
-
} from "./feature";
|
|
96
|
-
|
|
97
|
-
// Site config
|
|
98
|
-
export type { SiteConfig, NavItem } from "./config";
|
|
99
|
-
|
|
100
|
-
// Extensibility utilities
|
|
101
|
-
export type {
|
|
102
|
-
WithTransformOpts,
|
|
103
|
-
GenericListResponse,
|
|
104
|
-
TableColumn,
|
|
105
|
-
ColumnExtensionOpts,
|
|
106
|
-
LayoutSlots,
|
|
107
|
-
FeatureExtension,
|
|
108
|
-
} from "./extend";
|
|
109
|
-
|
|
110
|
-
// Table / Pagination / Sticky config
|
|
111
|
-
export type {
|
|
112
|
-
PaginationConfig,
|
|
113
|
-
StickyConfig,
|
|
114
|
-
TableConfig,
|
|
115
|
-
TableViewMode,
|
|
116
|
-
} from "./table";
|
|
117
|
-
export {
|
|
118
|
-
DEFAULT_PAGINATION_CONFIG,
|
|
119
|
-
DEFAULT_STICKY_CONFIG,
|
|
120
|
-
DEFAULT_TABLE_CONFIG,
|
|
121
|
-
mergeTableConfig,
|
|
122
|
-
} from "./table";
|
package/src/contracts/infra.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// ─── Infra Interfaces ─────────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Key-value cache adapter contract.
|
|
5
|
-
* Implemented by @mohasinac/core (in-memory), Redis, Upstash.
|
|
6
|
-
*/
|
|
7
|
-
export interface ICacheProvider {
|
|
8
|
-
get<T>(key: string): Promise<T | null>;
|
|
9
|
-
set<T>(key: string, value: T, ttlSeconds?: number): Promise<void>;
|
|
10
|
-
delete(key: string): Promise<void>;
|
|
11
|
-
clear(prefix?: string): Promise<void>;
|
|
12
|
-
has(key: string): Promise<boolean>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface QueueJob<T = unknown> {
|
|
16
|
-
id: string;
|
|
17
|
-
type: string;
|
|
18
|
-
payload: T;
|
|
19
|
-
attempts: number;
|
|
20
|
-
maxAttempts: number;
|
|
21
|
-
scheduledAt: string; // ISO-8601
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Background job queue adapter contract.
|
|
26
|
-
* Implemented by @mohasinac/core (in-memory), BullMQ, Upstash QStash.
|
|
27
|
-
*/
|
|
28
|
-
export interface IQueueProvider {
|
|
29
|
-
enqueue<T>(
|
|
30
|
-
type: string,
|
|
31
|
-
payload: T,
|
|
32
|
-
options?: { delayMs?: number; maxAttempts?: number },
|
|
33
|
-
): Promise<QueueJob<T>>;
|
|
34
|
-
process<T>(type: string, handler: (job: QueueJob<T>) => Promise<void>): void;
|
|
35
|
-
cancel(jobId: string): Promise<void>;
|
|
36
|
-
getJob<T>(jobId: string): Promise<QueueJob<T> | null>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type EventHandler<T = unknown> = (payload: T) => void | Promise<void>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* In-process event bus contract.
|
|
43
|
-
* Implemented by @mohasinac/core (EventEmitter-based).
|
|
44
|
-
*/
|
|
45
|
-
export interface IEventBus {
|
|
46
|
-
on<T>(event: string, handler: EventHandler<T>): void;
|
|
47
|
-
off<T>(event: string, handler: EventHandler<T>): void;
|
|
48
|
-
emit<T>(event: string, payload: T): void;
|
|
49
|
-
once<T>(event: string, handler: EventHandler<T>): void;
|
|
50
|
-
}
|
package/src/contracts/payment.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// ─── Payment Shared Types ─────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
export interface PaymentOrder {
|
|
4
|
-
id: string;
|
|
5
|
-
amount: number;
|
|
6
|
-
currency: string;
|
|
7
|
-
status: "created" | "attempted" | "paid" | "failed";
|
|
8
|
-
receipt?: string;
|
|
9
|
-
metadata?: Record<string, unknown>;
|
|
10
|
-
createdAt: string; // ISO-8601
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PaymentCapture {
|
|
14
|
-
id: string;
|
|
15
|
-
orderId: string;
|
|
16
|
-
amount: number;
|
|
17
|
-
currency: string;
|
|
18
|
-
status: "captured" | "failed";
|
|
19
|
-
capturedAt: string; // ISO-8601
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface Refund {
|
|
23
|
-
id: string;
|
|
24
|
-
paymentId: string;
|
|
25
|
-
amount: number;
|
|
26
|
-
currency: string;
|
|
27
|
-
status: "pending" | "processed" | "failed";
|
|
28
|
-
reason?: string;
|
|
29
|
-
createdAt: string; // ISO-8601
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// ─── Payment Interface ────────────────────────────────────────────────────────
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Payment gateway adapter contract.
|
|
36
|
-
* Implemented by @mohasinac/payment-razorpay, @mohasinac/payment-stripe,
|
|
37
|
-
* @mohasinac/payment-braintree.
|
|
38
|
-
*/
|
|
39
|
-
export interface IPaymentProvider {
|
|
40
|
-
createOrder(
|
|
41
|
-
amount: number,
|
|
42
|
-
currency: string,
|
|
43
|
-
metadata?: Record<string, unknown>,
|
|
44
|
-
): Promise<PaymentOrder>;
|
|
45
|
-
/** Returns true if the webhook signature is valid. */
|
|
46
|
-
verifyWebhook(payload: string, signature: string): boolean;
|
|
47
|
-
capturePayment(orderId: string): Promise<PaymentCapture>;
|
|
48
|
-
refund(paymentId: string, amount?: number): Promise<Refund>;
|
|
49
|
-
getOrder(orderId: string): Promise<PaymentOrder>;
|
|
50
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { IAuthProvider, ISessionProvider } from "./auth";
|
|
2
|
-
import type { IEmailProvider } from "./email";
|
|
3
|
-
import type { IStorageProvider } from "./storage";
|
|
4
|
-
import type { IPaymentProvider } from "./payment";
|
|
5
|
-
import type { IShippingProvider } from "./shipping";
|
|
6
|
-
import type { ISearchProvider } from "./search";
|
|
7
|
-
import type { ICacheProvider, IQueueProvider, IEventBus } from "./infra";
|
|
8
|
-
import type { IStyleAdapter } from "./style";
|
|
9
|
-
import type { IDbProvider } from "./repository";
|
|
10
|
-
|
|
11
|
-
export interface ProviderRegistry {
|
|
12
|
-
auth: IAuthProvider;
|
|
13
|
-
session: ISessionProvider;
|
|
14
|
-
email: IEmailProvider;
|
|
15
|
-
storage: IStorageProvider;
|
|
16
|
-
style: IStyleAdapter;
|
|
17
|
-
db?: IDbProvider;
|
|
18
|
-
payment?: IPaymentProvider;
|
|
19
|
-
shipping?: IShippingProvider;
|
|
20
|
-
search?: ISearchProvider;
|
|
21
|
-
cache?: ICacheProvider;
|
|
22
|
-
queue?: IQueueProvider;
|
|
23
|
-
eventBus?: IEventBus;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let _registry: ProviderRegistry | null = null;
|
|
27
|
-
|
|
28
|
-
export function registerProviders(registry: ProviderRegistry): void {
|
|
29
|
-
_registry = registry;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function getProviders(): ProviderRegistry {
|
|
33
|
-
if (!_registry) {
|
|
34
|
-
throw new Error(
|
|
35
|
-
"[contracts] Call registerProviders() before getProviders(). " +
|
|
36
|
-
"Ensure providers.config.ts is imported at app startup.",
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
return _registry;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function _resetProviders(): void {
|
|
43
|
-
_registry = null;
|
|
44
|
-
}
|