@mohasinac/appkit 3.0.0 → 3.0.1
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/_internal/client/features/layout/SidebarCollapseToggle.js +1 -5
- package/dist/_internal/server/features/auctions/actions.js +0 -1
- package/dist/_internal/server/features/auctions/og.js +0 -1
- package/dist/_internal/server/features/auctions/service.js +0 -4
- package/dist/_internal/server/features/auth/capabilities.js +0 -1
- package/dist/_internal/server/features/blog/actions.js +0 -2
- package/dist/_internal/server/features/brands/actions.js +0 -2
- package/dist/_internal/server/features/cart/actions.js +0 -3
- package/dist/_internal/server/features/checkout/actions.js +11 -20
- package/dist/_internal/server/features/events/actions.js +0 -3
- package/dist/_internal/server/features/events/og.js +0 -1
- package/dist/_internal/server/features/events/service.js +0 -2
- package/dist/_internal/server/features/grouped/data.js +0 -2
- package/dist/_internal/server/features/orders/actions.js +0 -4
- package/dist/_internal/server/features/pre-orders/actions.js +0 -1
- package/dist/_internal/server/features/pre-orders/og.js +0 -1
- package/dist/_internal/server/features/pre-orders/service.js +0 -1
- package/dist/_internal/server/features/products/actions.js +0 -6
- package/dist/_internal/server/features/products/service.js +0 -1
- package/dist/_internal/server/features/promotions/actions.js +0 -3
- package/dist/_internal/server/features/reviews/actions.js +0 -3
- package/dist/_internal/server/functions/https.js +0 -6
- package/dist/_internal/server/functions/manifest.js +0 -1
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
- package/dist/_internal/server/jobs/core/wrapJobHandler.js +0 -1
- package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
- package/dist/_internal/shared/serialization/index.js +0 -4
- package/dist/_internal/shared/styles/themed.js +0 -3
- package/dist/client/api/ApiError.js +1 -4
- package/dist/client/api/surface-error.js +0 -1
- package/dist/client/api/useApiQuery.js +0 -1
- package/dist/configs/next.js +0 -1
- package/dist/configs/tailwind.js +0 -1
- package/dist/contracts/field-ops.js +0 -2
- package/dist/core/EventBus.js +0 -2
- package/dist/core/Logger.js +0 -6
- package/dist/core/Queue.js +0 -2
- package/dist/core/hooks/useSyncManager.js +4 -4
- package/dist/core/mutation-events.js +0 -1
- package/dist/core/newsletter.repository.js +2 -6
- package/dist/errors/api-error.js +0 -1
- package/dist/errors/authentication-error.js +0 -1
- package/dist/errors/authorization-error.js +0 -1
- package/dist/errors/base-error.js +1 -3
- package/dist/errors/database-error.js +0 -1
- package/dist/errors/error-handler.js +1 -5
- package/dist/errors/error-mapping.js +1 -6
- package/dist/errors/normalize.js +0 -4
- package/dist/errors/not-found-error.js +0 -1
- package/dist/errors/razorpay-unreachable.js +0 -1
- package/dist/errors/validation-error.js +0 -1
- package/dist/features/about/components/FAQPageView.js +1 -3
- package/dist/features/about/components/FeesView.js +1 -3
- package/dist/features/about/components/HelpPageView.js +1 -3
- package/dist/features/about/components/PublicProfileView.js +4 -4
- package/dist/features/account/components/AddressBook.js +1 -3
- package/dist/features/account/components/AddressForm.js +0 -1
- package/dist/features/account/components/AddressesIndexListing.js +0 -1
- package/dist/features/account/components/MessagesView.js +1 -3
- package/dist/features/account/components/NotificationBell.js +3 -14
- package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
- package/dist/features/account/components/UserOffersPanel.js +0 -2
- package/dist/features/account/components/UserSidebar.js +1 -3
- package/dist/features/admin/components/AdminBlogEditorView.js +0 -1
- package/dist/features/admin/components/AdminBundleEditorView.js +0 -1
- package/dist/features/admin/components/AdminBundlesView.js +0 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -5
- package/dist/features/admin/components/AdminCarouselView.js +1 -4
- package/dist/features/admin/components/AdminCartsView.js +0 -1
- package/dist/features/admin/components/AdminMediaView.js +1 -3
- package/dist/features/admin/components/AdminPayoutsView.js +0 -1
- package/dist/features/admin/components/AdminProductsView.js +1 -3
- package/dist/features/admin/components/AdminSidebar.js +1 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +1 -5
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -13
- package/dist/features/admin/components/DashboardStats.js +1 -7
- package/dist/features/admin/components/DataListingView.js +1 -5
- package/dist/features/admin/components/DataTable.js +1 -3
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +1 -3
- package/dist/features/admin/components/analytics/AdminStatCard.js +1 -7
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -3
- package/dist/features/admin/components/sections/adminSectionsBuildParse.js +0 -5
- package/dist/features/admin/hooks/useAdminListingData.js +0 -5
- package/dist/features/admin/hooks/useChat.js +0 -3
- package/dist/features/admin/repository/chat.repository.js +0 -1
- package/dist/features/admin/repository/notification.repository.js +1 -4
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -7
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -6
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -15
- package/dist/features/auctions/components/PlaceBidFormClient.js +0 -3
- package/dist/features/auctions/repository/bid.repository.js +0 -1
- package/dist/features/auth/components/ForgotPasswordView.js +0 -1
- package/dist/features/auth/components/LoginForm.js +0 -1
- package/dist/features/auth/components/RegisterForm.js +0 -1
- package/dist/features/auth/components/ResetPasswordView.js +0 -1
- package/dist/features/auth/hooks/useAuth.js +0 -1
- package/dist/features/auth/repository/session.repository.js +0 -1
- package/dist/features/auth/repository/token.repository.js +0 -2
- package/dist/features/auth/repository/user.repository.js +0 -1
- package/dist/features/blog/api/[slug]/route.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -5
- package/dist/features/blog/components/BlogIndexListing.js +0 -1
- package/dist/features/blog/components/BlogListView.js +1 -5
- package/dist/features/blog/components/BlogPostView.js +1 -3
- package/dist/features/cart/components/CartDrawer.js +2 -6
- package/dist/features/cart/repository/cart.repository.js +0 -1
- package/dist/features/categories/api/route.js +0 -1
- package/dist/features/categories/components/BrandDetailPageView.js +1 -13
- package/dist/features/categories/components/BundleDetailView.js +1 -5
- package/dist/features/categories/components/BundleItemsPicker.js +1 -5
- package/dist/features/categories/components/CategoriesIndexListing.js +0 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +0 -1
- package/dist/features/categories/components/CategoryBundlesListing.js +1 -3
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -16
- package/dist/features/categories/components/CategoryGrid.js +1 -5
- package/dist/features/categories/components/CategorySelectorCreate.js +0 -1
- package/dist/features/categories/components/CategoryTableColumns.js +2 -6
- package/dist/features/categories/components/CategoryTree.js +1 -3
- package/dist/features/categories/components/ConcernCard.js +1 -3
- package/dist/features/collections/components/CollectionCard.js +1 -5
- package/dist/features/contact/email.js +0 -1
- package/dist/features/events/actions/event-actions.js +0 -1
- package/dist/features/events/api/[id]/route.js +0 -1
- package/dist/features/events/components/AdminEventEditorView.js +1 -2
- package/dist/features/events/components/EventCard.js +2 -8
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -3
- package/dist/features/events/components/EventRaffleWinnerView.js +1 -3
- package/dist/features/events/components/EventRafflesSection.js +0 -1
- package/dist/features/events/components/EventsIndexListing.js +0 -1
- package/dist/features/events/hooks/useBulkEvent.js +0 -1
- package/dist/features/events/repository/event-entry.repository.js +0 -1
- package/dist/features/faq/components/ContactCTA.js +1 -3
- package/dist/features/faq/components/FAQAccordion.js +1 -3
- package/dist/features/faq/components/FAQCategorySidebar.js +1 -3
- package/dist/features/faq/components/RelatedFAQs.js +1 -5
- package/dist/features/filters/AsyncFacetSection.js +1 -3
- package/dist/features/filters/FilterFacetSection.js +4 -14
- package/dist/features/forms/Checkbox.js +1 -3
- package/dist/features/forms/Slider.js +1 -3
- package/dist/features/history/hooks/useHistory.js +0 -1
- package/dist/features/history/repository/user-history.repository.js +0 -2
- package/dist/features/homepage/actions/carousel-actions.js +0 -1
- package/dist/features/homepage/actions/homepage-section-actions.js +1 -3
- package/dist/features/homepage/api/carousel/route.js +0 -1
- package/dist/features/homepage/api/route.js +0 -1
- package/dist/features/homepage/components/AdSlot.js +3 -9
- package/dist/features/homepage/components/AdvertisementBanner.js +2 -12
- package/dist/features/homepage/components/BeforeAfterCard.js +1 -5
- package/dist/features/homepage/components/CharacterHotspotForm.js +2 -10
- package/dist/features/homepage/components/CollectionCardsSection.js +1 -3
- package/dist/features/homepage/components/CustomCardsSection.js +1 -5
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -3
- package/dist/features/homepage/components/GoogleReviewsSection.js +1 -3
- package/dist/features/homepage/components/HeroCarousel.js +5 -26
- package/dist/features/homepage/components/HeroSection.js +2 -6
- package/dist/features/homepage/components/HowItWorksSection.js +2 -8
- package/dist/features/homepage/components/MarketplaceHomepageView.js +0 -8
- package/dist/features/homepage/components/NewsletterBanner.js +2 -10
- package/dist/features/homepage/components/PromoGrid.js +1 -3
- package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -6
- package/dist/features/homepage/components/ShopByCategorySection.js +2 -6
- package/dist/features/homepage/components/SocialPostCard.js +1 -3
- package/dist/features/homepage/components/StatsCounterSection.js +1 -5
- package/dist/features/homepage/components/TrustBadges.js +1 -3
- package/dist/features/homepage/components/TrustFeaturesSection.js +1 -3
- package/dist/features/homepage/components/WelcomeSection.js +2 -16
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -5
- package/dist/features/homepage/lib/social-feed-fetcher.js +0 -8
- package/dist/features/layout/AppLayoutShell.js +1 -3
- package/dist/features/layout/BottomNavbar.js +1 -11
- package/dist/features/media/MediaAudio.js +2 -6
- package/dist/features/media/MediaImage.js +0 -1
- package/dist/features/media/MediaLightbox.js +3 -9
- package/dist/features/media/MediaVideo.js +2 -8
- package/dist/features/media/upload/MediaUploadField.js +1 -3
- package/dist/features/messages/hooks/useConversation.js +0 -2
- package/dist/features/messages/hooks/useConversations.js +0 -1
- package/dist/features/messages/repository/conversations.repository.js +0 -1
- package/dist/features/orders/api/track/[trackingId]/route.js +0 -1
- package/dist/features/orders/components/OrdersList.js +1 -3
- package/dist/features/orders/components/RefundHistoryTable.js +1 -3
- package/dist/features/orders/repository/orders.repository.js +0 -2
- package/dist/features/payments/repository/payout.repository.js +0 -1
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -6
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +0 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -3
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -5
- package/dist/features/products/api/route.js +1 -3
- package/dist/features/products/components/CompareOverlay.js +1 -6
- package/dist/features/products/components/FeatureBadge.js +1 -3
- package/dist/features/products/components/MakeOfferButton.js +0 -2
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -3
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -3
- package/dist/features/products/components/PrizeDrawDetailPageView.js +0 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -3
- package/dist/features/products/components/PrizeDrawsSection.js +1 -3
- package/dist/features/products/components/ProductDetailPageView.js +0 -6
- package/dist/features/products/components/ProductFeatureBadges.js +1 -3
- package/dist/features/products/components/ProductFeaturesSelector.js +0 -1
- package/dist/features/products/components/ProductGrid.js +5 -15
- package/dist/features/products/components/ShareButton.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +3 -7
- package/dist/features/products/components/SublistingCarouselSection.js +2 -4
- package/dist/features/products/repository/product-features.repository.js +0 -1
- package/dist/features/products/repository/products.repository.js +0 -1
- package/dist/features/promotions/components/CouponCard.js +2 -5
- package/dist/features/promotions/repository/coupons.repository.js +0 -1
- package/dist/features/reviews/api/route.js +0 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -13
- package/dist/features/reviews/components/ReviewModal.js +1 -5
- package/dist/features/reviews/components/ReviewSummary.js +2 -6
- package/dist/features/reviews/components/ReviewsIndexListing.js +0 -1
- package/dist/features/reviews/components/ReviewsList.js +1 -7
- package/dist/features/reviews/repository/reviews.repository.js +0 -3
- package/dist/features/scams/actions/scam-actions.js +1 -1
- package/dist/features/scams/components/ScamProfileView.js +1 -3
- package/dist/features/search/components/Search.js +2 -8
- package/dist/features/search/components/SearchFiltersRow.js +1 -3
- package/dist/features/seller/components/PhysicalLocationModal.js +1 -5
- package/dist/features/seller/components/SellerAddressesView.js +1 -6
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -4
- package/dist/features/seller/components/SellerBidsView.js +1 -3
- package/dist/features/seller/components/SellerBundlesView.js +0 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -3
- package/dist/features/seller/components/SellerFeaturesView.js +0 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerLiveView.js +1 -3
- package/dist/features/seller/components/SellerOffersPanel.js +0 -2
- package/dist/features/seller/components/SellerOrdersView.js +1 -6
- package/dist/features/seller/components/SellerPayoutMethodsView.js +0 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +2 -4
- package/dist/features/seller/components/SellerProductsCards.js +1 -3
- package/dist/features/seller/components/SellerProductsView.js +1 -7
- package/dist/features/seller/components/SellerReviewsView.js +1 -4
- package/dist/features/seller/components/SellerShippingConfigsView.js +1 -4
- package/dist/features/seller/components/SellerShippingView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +4 -12
- package/dist/features/seller/components/SellerStoreCategoriesView.js +0 -2
- package/dist/features/seller/components/SellerTemplatesView.js +0 -1
- package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -3
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -3
- package/dist/features/seller/hooks/useSellerListingData.js +0 -5
- package/dist/features/seller/repository/offer.repository.js +0 -1
- package/dist/features/shell/FormShell.js +2 -15
- package/dist/features/shell/QuickFormDrawer.js +1 -5
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -3
- package/dist/features/site-settings/components/ThemeManagerView.js +0 -1
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +0 -1
- package/dist/features/stores/components/StoreHeader.js +1 -7
- package/dist/features/stores/components/StoreReviewsListing.js +0 -1
- package/dist/features/stores/components/StoresIndexListing.js +0 -1
- package/dist/features/stores/repository/store.repository.js +0 -2
- package/dist/features/support/repository/support.repository.js +0 -1
- package/dist/features/wishlist/components/WishlistPage.js +1 -3
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
- package/dist/features/wishlist/repository/user-wishlist.repository.js +0 -2
- package/dist/http/ApiClient.js +4 -12
- package/dist/index.js +0 -1
- package/dist/monitoring/client-logger.js +7 -22
- package/dist/monitoring/error-tracking.js +0 -1
- package/dist/monitoring/performance.js +0 -1
- package/dist/monitoring/server-logger.js +11 -33
- package/dist/next/api/api-response.js +1 -4
- package/dist/next/api/apiHandler.js +1 -5
- package/dist/next/api/errorHandler.js +0 -3
- package/dist/next/api/parseJsonBody.js +0 -1
- package/dist/next/api/routeHandler.js +1 -6
- package/dist/next/cache-middleware.js +1 -3
- package/dist/next/middleware/chain.js +0 -1
- package/dist/next/middleware/pii-scrubber.js +0 -2
- package/dist/providers/auth-firebase/provider.js +0 -1
- package/dist/providers/db-firebase/admin.js +0 -1
- package/dist/providers/db-firebase/base.js +0 -4
- package/dist/providers/db-firebase/base.repository.js +0 -3
- package/dist/providers/db-firebase/field-ops.js +0 -2
- package/dist/providers/db-firebase/helpers.js +0 -4
- package/dist/providers/db-firebase/realtime.js +3 -15
- package/dist/providers/db-firebase/sieve.js +2 -8
- package/dist/providers/payment-razorpay/index.js +0 -3
- package/dist/providers/shipping-shiprocket/index.js +0 -1
- package/dist/providers/storage-firebase/client.js +0 -4
- package/dist/react/contexts/SessionContext.js +0 -1
- package/dist/react/hooks/useCountdown.js +0 -1
- package/dist/security/authorization.js +0 -1
- package/dist/security/pii-encrypt.js +0 -4
- package/dist/security/pii-redact.js +0 -3
- package/dist/seed/manifest.js +1 -6
- package/dist/seed/runner.js +0 -2
- package/dist/ui/DataTable.js +2 -6
- package/dist/ui/components/Anchor.js +0 -1
- package/dist/ui/components/AvatarDisplay.js +1 -3
- package/dist/ui/components/BackgroundRenderer.js +2 -6
- package/dist/ui/components/BaseListingCard.js +0 -1
- package/dist/ui/components/Button.js +0 -3
- package/dist/ui/components/Card.js +2 -6
- package/dist/ui/components/Details.js +2 -8
- package/dist/ui/components/Dialog.js +0 -1
- package/dist/ui/components/FallbackShell.js +5 -17
- package/dist/ui/components/Fieldset.js +2 -6
- package/dist/ui/components/HorizontalRule.js +0 -1
- package/dist/ui/components/HotspotMarker.js +1 -3
- package/dist/ui/components/IconBox.js +0 -1
- package/dist/ui/components/Iframe.js +0 -1
- package/dist/ui/components/ImageGallery.js +1 -3
- package/dist/ui/components/ImageLightbox.js +1 -5
- package/dist/ui/components/Kbd.js +0 -1
- package/dist/ui/components/Motion.js +1 -3
- package/dist/ui/components/NavbarChevron.js +0 -1
- package/dist/ui/components/PasswordStrengthIndicator.js +1 -3
- package/dist/ui/components/Progress.js +2 -6
- package/dist/ui/components/Quote.js +1 -4
- package/dist/ui/components/Responsive.js +0 -4
- package/dist/ui/components/RowActionMenu.js +1 -3
- package/dist/ui/components/Scrim.js +0 -1
- package/dist/ui/components/SiteLogo.js +1 -9
- package/dist/ui/components/Skeleton.js +1 -3
- package/dist/ui/components/Slider.js +1 -3
- package/dist/ui/components/StickyToolbar.js +0 -1
- package/dist/ui/components/TabStrip.js +1 -3
- package/dist/ui/components/Toast.js +1 -3
- package/dist/ui/components/Tooltip.js +1 -4
- package/dist/ui/components/UnsavedChangesModal.js +1 -3
- package/dist/ui/rich-text/RichText.js +1 -1
- package/dist/utils/action-response.js +0 -1
- package/dist/utils/date.formatter.js +0 -1
- package/dist/utils/object.helper.js +0 -2
- package/dist/utils/schema-ui.js +1 -3
- package/dist/validation/input.validator.js +0 -1
- package/dist/validation/schemas.js +1 -3
- package/package.json +5 -2
- package/scripts/bundle-css.mjs +47 -0
- package/scripts/copy-assets.mjs +34 -0
- package/scripts/dedupe-peer-deps.mjs +81 -0
|
@@ -7,9 +7,5 @@ const CHEVRON_STYLE = {
|
|
|
7
7
|
color: "var(--appkit-color-text-on-primary)",
|
|
8
8
|
};
|
|
9
9
|
export function SidebarCollapseToggle({ expanded, onToggle, expandedLabel = "Collapse sidebar", collapsedLabel = "Expand sidebar", }) {
|
|
10
|
-
return (_jsx("button", { type: "button", onClick: onToggle, "aria-label": expanded ? expandedLabel : collapsedLabel, "aria-expanded": expanded,
|
|
11
|
-
// audit-inline-style-ok: pass-through style prop
|
|
12
|
-
style: HANDLE_STYLE, className: "w-9 shrink-0 flex items-center justify-center cursor-pointer rounded-r-[1.25rem] shadow-lg transition-all duration-200 hover:shadow-xl hover:brightness-110 active:scale-[0.96]", children: _jsx("svg", { className: `w-4 h-4 drop-shadow-sm transition-transform duration-300 ${expanded ? "" : "rotate-180"}`,
|
|
13
|
-
// audit-inline-style-ok: pass-through style prop
|
|
14
|
-
style: CHEVRON_STYLE, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M15 19l-7-7 7-7" }) }) }));
|
|
10
|
+
return (_jsx("button", { type: "button", onClick: onToggle, "aria-label": expanded ? expandedLabel : collapsedLabel, "aria-expanded": expanded, style: HANDLE_STYLE, className: "w-9 shrink-0 flex items-center justify-center cursor-pointer rounded-r-[1.25rem] shadow-lg transition-all duration-200 hover:shadow-xl hover:brightness-110 active:scale-[0.96]", children: _jsx("svg", { className: `w-4 h-4 drop-shadow-sm transition-transform duration-300 ${expanded ? "" : "rotate-180"}`, style: CHEVRON_STYLE, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M15 19l-7-7 7-7" }) }) }));
|
|
15
11
|
}
|
|
@@ -5,7 +5,6 @@ import { requireRoleUser } from "../../../../providers/auth-firebase/helpers";
|
|
|
5
5
|
import { placeBidSchema } from "../../../shared/features/auctions/schema";
|
|
6
6
|
import { assertAuctionActive, assertBidAmount, assertNotAuctionOwner, shouldAutoExtend, computeExtendedEndDate, } from "./service";
|
|
7
7
|
import { ValidationError } from "../../../shared/errors/index";
|
|
8
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
9
8
|
export async function placeBidAction(input) {
|
|
10
9
|
return wrapAction(async () => {
|
|
11
10
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -6,7 +6,6 @@ export function renderAuctionOg(doc, opts) {
|
|
|
6
6
|
const endDate = doc?.auctionEndDate
|
|
7
7
|
? doc.auctionEndDate instanceof Date
|
|
8
8
|
? doc.auctionEndDate
|
|
9
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
10
9
|
: new Date(doc.auctionEndDate)
|
|
11
10
|
: null;
|
|
12
11
|
const endsLabel = endDate
|
|
@@ -10,12 +10,10 @@ export async function assertAuctionActive(auctionId) {
|
|
|
10
10
|
const endDate = product.auctionEndDate instanceof Date
|
|
11
11
|
? product.auctionEndDate
|
|
12
12
|
: product.auctionEndDate
|
|
13
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
14
13
|
? new Date(product.auctionEndDate)
|
|
15
14
|
: null;
|
|
16
15
|
if (!endDate || endDate.getTime() <= Date.now())
|
|
17
16
|
throw new AuctionEndedError(auctionId);
|
|
18
|
-
// audit-unknown-ok: TS structural escape — domain document type lacks index signature
|
|
19
17
|
return product;
|
|
20
18
|
}
|
|
21
19
|
/** Compute the minimum valid bid given the current state. */
|
|
@@ -42,7 +40,6 @@ export function shouldAutoExtend(product) {
|
|
|
42
40
|
const endDate = product.auctionEndDate instanceof Date
|
|
43
41
|
? product.auctionEndDate
|
|
44
42
|
: product.auctionEndDate
|
|
45
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
46
43
|
? new Date(product.auctionEndDate)
|
|
47
44
|
: null;
|
|
48
45
|
if (!endDate)
|
|
@@ -54,7 +51,6 @@ export function shouldAutoExtend(product) {
|
|
|
54
51
|
export function computeExtendedEndDate(product) {
|
|
55
52
|
const current = product.auctionEndDate instanceof Date
|
|
56
53
|
? product.auctionEndDate
|
|
57
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
58
54
|
: new Date(product.auctionEndDate);
|
|
59
55
|
const extensionMs = (product.auctionExtensionMinutes ?? AUCTION_DEFAULT_EXTENSION_MINUTES) * 60 * 1000;
|
|
60
56
|
return new Date(current.getTime() + extensionMs);
|
|
@@ -16,7 +16,6 @@ export async function getStoreCapabilities(storeId) {
|
|
|
16
16
|
const store = await storeRepository.findById(storeId);
|
|
17
17
|
if (!store)
|
|
18
18
|
return [...DEFAULT_STORE_CAPABILITIES];
|
|
19
|
-
// audit-unknown-ok: TS structural escape — domain document type lacks index signature
|
|
20
19
|
const raw = store.capabilities;
|
|
21
20
|
if (Array.isArray(raw) && raw.length > 0)
|
|
22
21
|
return raw;
|
|
@@ -5,7 +5,6 @@ import { requireRoleUser } from "../../../../providers/auth-firebase/helpers";
|
|
|
5
5
|
import { blogPostInputSchema, blogPostUpdateSchema } from "../../../shared/features/blog/schema";
|
|
6
6
|
import { assertBlogPostExists, assertBlogSlugUnique, computeReadTime } from "./service";
|
|
7
7
|
import { ValidationError } from "../../../shared/errors/index";
|
|
8
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
9
8
|
export async function createBlogPostAction(input) {
|
|
10
9
|
return wrapAction(async () => {
|
|
11
10
|
const user = await requireRoleUser(["admin", "moderator"]);
|
|
@@ -24,7 +23,6 @@ export async function createBlogPostAction(input) {
|
|
|
24
23
|
});
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
28
26
|
export async function updateBlogPostAction(postId, input) {
|
|
29
27
|
return wrapAction(async () => {
|
|
30
28
|
await requireRoleUser(["admin", "moderator"]);
|
|
@@ -37,7 +37,6 @@ function brandInputToCategoryFields(input) {
|
|
|
37
37
|
out.order = input.displayOrder;
|
|
38
38
|
return out;
|
|
39
39
|
}
|
|
40
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
41
40
|
export async function createBrandAction(input) {
|
|
42
41
|
return wrapAction(async () => {
|
|
43
42
|
await requireRoleUser("admin");
|
|
@@ -83,7 +82,6 @@ export async function createBrandAction(input) {
|
|
|
83
82
|
});
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
87
85
|
export async function updateBrandAction(brandId, input) {
|
|
88
86
|
return wrapAction(async () => {
|
|
89
87
|
await requireRoleUser("admin");
|
|
@@ -5,7 +5,6 @@ import { requireRoleUser } from "../../../../providers/auth-firebase/helpers";
|
|
|
5
5
|
import { addToCartSchema, removeFromCartSchema, mergeGuestCartSchema, } from "../../../shared/features/cart/schema";
|
|
6
6
|
import { upsertCartItem, mergeGuestItems } from "./service";
|
|
7
7
|
import { ValidationError } from "../../../shared/errors/index";
|
|
8
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
9
8
|
export async function addToCartAction(input) {
|
|
10
9
|
return wrapAction(async () => {
|
|
11
10
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -16,7 +15,6 @@ export async function addToCartAction(input) {
|
|
|
16
15
|
return { success: true };
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
20
18
|
export async function removeFromCartAction(input) {
|
|
21
19
|
return wrapAction(async () => {
|
|
22
20
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -34,7 +32,6 @@ export async function clearCartAction() {
|
|
|
34
32
|
return { success: true };
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
38
35
|
export async function mergeGuestCartAction(input) {
|
|
39
36
|
return wrapAction(async () => {
|
|
40
37
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -112,7 +112,6 @@ function emitOrderPlacedNotifications(args) {
|
|
|
112
112
|
relatedType: "order",
|
|
113
113
|
actionUrl: `/user/orders/view/${orderId}`,
|
|
114
114
|
})
|
|
115
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
116
115
|
.catch((err) => serverLogger.warn("Failed to create buyer order_placed notification", {
|
|
117
116
|
err: err instanceof Error ? err.message : String(err),
|
|
118
117
|
orderId,
|
|
@@ -129,7 +128,6 @@ function emitOrderPlacedNotifications(args) {
|
|
|
129
128
|
relatedType: "order",
|
|
130
129
|
actionUrl: `/store/orders/${orderId}/view`,
|
|
131
130
|
})
|
|
132
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
133
131
|
.catch((err) => serverLogger.warn("Failed to create seller order_placed notification", {
|
|
134
132
|
err: err instanceof Error ? err.message : String(err),
|
|
135
133
|
orderId,
|
|
@@ -217,15 +215,12 @@ function grantConsentOtpBypassCredit(db, uid, emailOtpUsed, unavailableCount) {
|
|
|
217
215
|
const cur = snap.exists ? (snap.data()?.bypassCredits ?? 0) : 0;
|
|
218
216
|
return metaRef.set({ bypassCredits: Math.min(cur + 1, CONSENT_OTP_MAX_BYPASS_CREDITS) }, { merge: true });
|
|
219
217
|
})
|
|
220
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
221
218
|
.catch((err) => serverLogger.warn("Failed to grant consent OTP bypass credit", { err }));
|
|
222
219
|
}
|
|
223
220
|
function dispatchOrderConfirmationEmails(emailsToSend) {
|
|
224
221
|
if (emailsToSend.length === 0)
|
|
225
222
|
return;
|
|
226
|
-
Promise.all(emailsToSend.map((e) => sendOrderConfirmationEmail(e))).catch(
|
|
227
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
228
|
-
(err) => serverLogger.error("Order confirmation email error:", err));
|
|
223
|
+
Promise.all(emailsToSend.map((e) => sendOrderConfirmationEmail(e))).catch((err) => serverLogger.error("Order confirmation email error:", err));
|
|
229
224
|
}
|
|
230
225
|
/**
|
|
231
226
|
* Place order(s) from the user's cart in a single Firestore transaction.
|
|
@@ -263,7 +258,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
263
258
|
if (!addressId) {
|
|
264
259
|
failedCheckoutRepository
|
|
265
260
|
.logCheckout(uid, "address_not_found", "Address required for physical cart", { addressId: "", paymentMethod })
|
|
266
|
-
.catch(() => { });
|
|
261
|
+
.catch(() => { });
|
|
267
262
|
throw new NotFoundError(ERROR_MESSAGES.CHECKOUT.ADDRESS_REQUIRED);
|
|
268
263
|
}
|
|
269
264
|
const addressDoc = await unitOfWork.addresses.findById(addressId);
|
|
@@ -274,7 +269,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
274
269
|
if (!resolvedAddress) {
|
|
275
270
|
failedCheckoutRepository
|
|
276
271
|
.logCheckout(uid, "address_not_found", "Address not found", { addressId, paymentMethod })
|
|
277
|
-
.catch(() => { });
|
|
272
|
+
.catch(() => { });
|
|
278
273
|
throw new NotFoundError(ERROR_MESSAGES.CHECKOUT.ADDRESS_REQUIRED);
|
|
279
274
|
}
|
|
280
275
|
shippingAddress = formatShippingAddress(resolvedAddress);
|
|
@@ -400,7 +395,6 @@ export async function createCheckoutOrderAction(input) {
|
|
|
400
395
|
}
|
|
401
396
|
return { available: availableItems, unavailable: unavailableItems, emailOtpUsed };
|
|
402
397
|
});
|
|
403
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
404
398
|
}
|
|
405
399
|
catch (err) {
|
|
406
400
|
void normalizeError(err);
|
|
@@ -414,7 +408,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
414
408
|
addressId,
|
|
415
409
|
paymentMethod,
|
|
416
410
|
})
|
|
417
|
-
.catch(() => { });
|
|
411
|
+
.catch(() => { });
|
|
418
412
|
throw err;
|
|
419
413
|
}
|
|
420
414
|
const { available, unavailable, emailOtpUsed } = stockResult;
|
|
@@ -425,7 +419,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
425
419
|
paymentMethod,
|
|
426
420
|
cartItemCount: cartItems.length,
|
|
427
421
|
})
|
|
428
|
-
.catch(() => { });
|
|
422
|
+
.catch(() => { });
|
|
429
423
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.INSUFFICIENT_STOCK);
|
|
430
424
|
}
|
|
431
425
|
const appliedCoupons = cart.appliedCoupons ?? [];
|
|
@@ -669,7 +663,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
669
663
|
gatewayPaymentId: razorpay_payment_id,
|
|
670
664
|
addressId,
|
|
671
665
|
})
|
|
672
|
-
.catch(() => { });
|
|
666
|
+
.catch(() => { });
|
|
673
667
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.PAYMENT_FAILED);
|
|
674
668
|
}
|
|
675
669
|
const cart = await unitOfWork.carts.getOrCreate(uid);
|
|
@@ -711,7 +705,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
711
705
|
gatewayPaymentId: razorpay_payment_id,
|
|
712
706
|
addressId,
|
|
713
707
|
})
|
|
714
|
-
.catch(() => { });
|
|
708
|
+
.catch(() => { });
|
|
715
709
|
throw new ApiError(403, "Order verification required. Please complete OTP verification and retry.");
|
|
716
710
|
}
|
|
717
711
|
}
|
|
@@ -762,7 +756,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
762
756
|
gatewayPaymentId: razorpay_payment_id,
|
|
763
757
|
addressId,
|
|
764
758
|
})
|
|
765
|
-
.catch(() => { });
|
|
759
|
+
.catch(() => { });
|
|
766
760
|
throw new ValidationError(exists
|
|
767
761
|
? ERROR_MESSAGES.CHECKOUT.INSUFFICIENT_STOCK
|
|
768
762
|
: ERROR_MESSAGES.CHECKOUT.PRODUCT_UNAVAILABLE);
|
|
@@ -790,7 +784,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
790
784
|
amountRs: paidAmountRs,
|
|
791
785
|
addressId,
|
|
792
786
|
})
|
|
793
|
-
.catch(() => { });
|
|
787
|
+
.catch(() => { });
|
|
794
788
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.PAYMENT_FAILED);
|
|
795
789
|
}
|
|
796
790
|
}
|
|
@@ -996,18 +990,15 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
996
990
|
});
|
|
997
991
|
if (!isDigitalCartRazorpay && addressId) {
|
|
998
992
|
const otpRefForDelete = consentOtpRef(db, uid, addressId);
|
|
999
|
-
otpRefForDelete.delete().catch(() => { });
|
|
993
|
+
otpRefForDelete.delete().catch(() => { });
|
|
1000
994
|
}
|
|
1001
995
|
if (emailsToSend.length > 0) {
|
|
1002
|
-
Promise.all(emailsToSend.map((e) => sendOrderConfirmationEmail(e))).catch(
|
|
1003
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
1004
|
-
(err) => serverLogger.error("Order confirmation email error:", err));
|
|
996
|
+
Promise.all(emailsToSend.map((e) => sendOrderConfirmationEmail(e))).catch((err) => serverLogger.error("Order confirmation email error:", err));
|
|
1005
997
|
}
|
|
1006
998
|
serverLogger.info(`verifyAndPlaceRazorpayOrderAction: ${orderIds.length} order(s) placed for uid=${uid} — payment ${razorpay_payment_id}`);
|
|
1007
999
|
getAdminRealtimeDb()
|
|
1008
1000
|
.ref(`${RTDB_PATHS.PAYMENT_EVENTS}/${razorpay_order_id}`)
|
|
1009
1001
|
.update({ status: "success", orderIds, updatedAt: Date.now() })
|
|
1010
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
1011
1002
|
.catch((err) => serverLogger.warn("Payment event RTDB signal failed (non-critical)", { err }));
|
|
1012
1003
|
return { orderIds, total, itemCount: orderIds.length };
|
|
1013
1004
|
}
|
|
@@ -6,7 +6,6 @@ import { eventInputSchema, eventUpdateSchema, registerForEventSchema } from "../
|
|
|
6
6
|
import { assertEventActive } from "./service";
|
|
7
7
|
import { AlreadyRegisteredError, EventNotFoundError } from "../../../shared/features/events/errors";
|
|
8
8
|
import { ValidationError } from "../../../shared/errors/index";
|
|
9
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
10
9
|
export async function createEventAction(input) {
|
|
11
10
|
return wrapAction(async () => {
|
|
12
11
|
const user = await requireRoleUser(["admin", "moderator"]);
|
|
@@ -21,7 +20,6 @@ export async function createEventAction(input) {
|
|
|
21
20
|
});
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
25
23
|
export async function updateEventAction(eventId, input) {
|
|
26
24
|
return wrapAction(async () => {
|
|
27
25
|
await requireRoleUser(["admin", "moderator"]);
|
|
@@ -34,7 +32,6 @@ export async function updateEventAction(eventId, input) {
|
|
|
34
32
|
return eventRepository.updateEvent(eventId, parsed.data);
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
38
35
|
export async function registerForEventAction(input) {
|
|
39
36
|
return wrapAction(async () => {
|
|
40
37
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -23,7 +23,6 @@ export function renderEventOg(doc, opts) {
|
|
|
23
23
|
null;
|
|
24
24
|
const coverImageUrl = resolveOgImageUrl(rawCoverImageUrl, opts.baseUrl);
|
|
25
25
|
const startsAt = doc?.startsAt
|
|
26
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
27
26
|
? new Date(doc.startsAt).toLocaleDateString(locale, {
|
|
28
27
|
day: "numeric",
|
|
29
28
|
month: "short",
|
|
@@ -8,7 +8,6 @@ export async function assertEventActive(eventId) {
|
|
|
8
8
|
if (status !== "active" && status !== "upcoming")
|
|
9
9
|
throw new EventNotActiveError(status ?? "unknown");
|
|
10
10
|
const endsAt = event.endsAt
|
|
11
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
12
11
|
? new Date(event.endsAt)
|
|
13
12
|
: null;
|
|
14
13
|
if (endsAt && endsAt.getTime() < Date.now())
|
|
@@ -23,7 +22,6 @@ export function isEventAcceptingRegistrations(event) {
|
|
|
23
22
|
const status = event.status;
|
|
24
23
|
if (status !== "active" && status !== "upcoming")
|
|
25
24
|
return false;
|
|
26
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
27
25
|
const endsAt = event.endsAt ? new Date(event.endsAt) : null;
|
|
28
26
|
return !endsAt || endsAt.getTime() > Date.now();
|
|
29
27
|
}
|
|
@@ -6,7 +6,6 @@ import { PRODUCT_FIELDS, CATEGORY_FIELDS } from "../../../../constants/field-nam
|
|
|
6
6
|
import { GROUPED_LISTINGS_FEATURED_LIMIT, GROUPED_LISTINGS_PAGE_SIZE, GROUPED_LISTINGS_SITEMAP_LIMIT, } from "../../../shared/features/grouped/config";
|
|
7
7
|
function mapDoc(doc) {
|
|
8
8
|
const data = doc.data();
|
|
9
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
10
9
|
const ts = (v) => {
|
|
11
10
|
const d = v?.toDate?.();
|
|
12
11
|
return d ?? (v instanceof Date ? v : new Date());
|
|
@@ -52,7 +51,6 @@ export const getGroupedListingForDetail = cache(async (slug) => {
|
|
|
52
51
|
const byId = await db.collection(GROUPED_LISTINGS_COLLECTION).doc(slug).get();
|
|
53
52
|
if (!byId.exists)
|
|
54
53
|
return null;
|
|
55
|
-
// audit-unknown-ok: TS structural escape — Firebase SDK type
|
|
56
54
|
return mapDoc(byId);
|
|
57
55
|
}
|
|
58
56
|
return mapDoc(snap.docs[0]);
|
|
@@ -7,7 +7,6 @@ import { assertOrderCancellable, assertReturnWindowOpen } from "./service";
|
|
|
7
7
|
import { ValidationError } from "../../../shared/errors/index";
|
|
8
8
|
import { OrderNotFoundError, OrderOwnershipError } from "../../../shared/features/orders/errors";
|
|
9
9
|
import { isAdminUser } from "../../../../features/auth/role-predicates";
|
|
10
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
11
10
|
export async function createOrderAction(input) {
|
|
12
11
|
return wrapAction(async () => {
|
|
13
12
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -21,7 +20,6 @@ export async function createOrderAction(input) {
|
|
|
21
20
|
});
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
25
23
|
export async function cancelOrderAction(input) {
|
|
26
24
|
return wrapAction(async () => {
|
|
27
25
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -32,7 +30,6 @@ export async function cancelOrderAction(input) {
|
|
|
32
30
|
return orderRepository.cancelOrder(parsed.data.orderId, parsed.data.reason ?? "Cancelled by user");
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
36
33
|
export async function requestReturnAction(input) {
|
|
37
34
|
return wrapAction(async () => {
|
|
38
35
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -43,7 +40,6 @@ export async function requestReturnAction(input) {
|
|
|
43
40
|
return orderRepository.updateStatus(parsed.data.orderId, "return_requested");
|
|
44
41
|
});
|
|
45
42
|
}
|
|
46
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
47
43
|
export async function updateOrderStatusAction(input) {
|
|
48
44
|
return wrapAction(async () => {
|
|
49
45
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -5,7 +5,6 @@ import { requireRoleUser } from "../../../../providers/auth-firebase/helpers";
|
|
|
5
5
|
import { reservePreOrderSchema } from "../../../shared/features/pre-orders/schema";
|
|
6
6
|
import { assertPreOrderAvailable, computeDeposit } from "./service";
|
|
7
7
|
import { ValidationError } from "../../../shared/errors/index";
|
|
8
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
9
8
|
export async function reservePreOrderAction(input) {
|
|
10
9
|
return wrapAction(async () => {
|
|
11
10
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -4,7 +4,6 @@ import { resolveOgImageUrl } from "../seo/og";
|
|
|
4
4
|
export function renderPreOrderOg(doc, opts) {
|
|
5
5
|
const locale = opts.locale ?? "en-IN";
|
|
6
6
|
const release = doc?.preOrderReleaseDate
|
|
7
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
8
7
|
? new Date(doc.preOrderReleaseDate)
|
|
9
8
|
: null;
|
|
10
9
|
const releaseDateLabel = release
|
|
@@ -12,7 +12,6 @@ export async function assertPreOrderAvailable(preOrderId, requestedQty = 1) {
|
|
|
12
12
|
const current = product.preOrderCurrentCount ?? 0;
|
|
13
13
|
if (current + requestedQty > maxQty)
|
|
14
14
|
throw new PreOrderSoldOutError(preOrderId);
|
|
15
|
-
// audit-unknown-ok: TS structural escape — domain document type lacks index signature
|
|
16
15
|
return product;
|
|
17
16
|
}
|
|
18
17
|
/** Compute deposit amount in paise. */
|
|
@@ -6,7 +6,6 @@ import { isAdminUser } from "../../../../features/auth/role-predicates";
|
|
|
6
6
|
import { productInputSchema, productUpdateSchema, auctionInputSchema, preOrderInputSchema, setFeaturedSchema, setStatusSchema, } from "../../../shared/features/products/schema";
|
|
7
7
|
import { assertProductOwnership, assertStatusTransition } from "./service";
|
|
8
8
|
import { ValidationError } from "../../../shared/errors/index";
|
|
9
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
10
9
|
export async function createProductAction(input) {
|
|
11
10
|
return wrapAction(async () => {
|
|
12
11
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -22,7 +21,6 @@ export async function createProductAction(input) {
|
|
|
22
21
|
});
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
26
24
|
export async function createAuctionAction(input) {
|
|
27
25
|
return wrapAction(async () => {
|
|
28
26
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -38,7 +36,6 @@ export async function createAuctionAction(input) {
|
|
|
38
36
|
});
|
|
39
37
|
});
|
|
40
38
|
}
|
|
41
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
42
39
|
export async function createPreOrderAction(input) {
|
|
43
40
|
return wrapAction(async () => {
|
|
44
41
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -54,7 +51,6 @@ export async function createPreOrderAction(input) {
|
|
|
54
51
|
});
|
|
55
52
|
});
|
|
56
53
|
}
|
|
57
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
58
54
|
export async function updateProductAction(productId, input) {
|
|
59
55
|
return wrapAction(async () => {
|
|
60
56
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -72,7 +68,6 @@ export async function deleteProductAction(productId) {
|
|
|
72
68
|
return productRepository.delete(productId);
|
|
73
69
|
});
|
|
74
70
|
}
|
|
75
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
76
71
|
export async function setProductStatusAction(input) {
|
|
77
72
|
return wrapAction(async () => {
|
|
78
73
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -91,7 +86,6 @@ export async function setProductStatusAction(input) {
|
|
|
91
86
|
return productRepository.update(parsed.data.productId, { status: parsed.data.status });
|
|
92
87
|
});
|
|
93
88
|
}
|
|
94
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
95
89
|
export async function setProductFeaturedAction(input) {
|
|
96
90
|
return wrapAction(async () => {
|
|
97
91
|
await requireRoleUser("admin");
|
|
@@ -46,7 +46,6 @@ export function isAvailableForPurchase(product) {
|
|
|
46
46
|
if (isAuctionListing(product)) {
|
|
47
47
|
const endDate = product.auctionEndDate instanceof Date
|
|
48
48
|
? product.auctionEndDate
|
|
49
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
50
49
|
: product.auctionEndDate ? new Date(product.auctionEndDate) : null;
|
|
51
50
|
return endDate ? endDate.getTime() > Date.now() : false;
|
|
52
51
|
}
|
|
@@ -7,7 +7,6 @@ import { validateCoupon, computeDiscount } from "./service";
|
|
|
7
7
|
import { CouponNotFoundError } from "../../../shared/features/promotions/errors";
|
|
8
8
|
import { ValidationError } from "../../../shared/errors/index";
|
|
9
9
|
const ERR_INVALID_COUPON_INPUT = "Invalid coupon input";
|
|
10
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
11
10
|
export async function applyCouponAction(input) {
|
|
12
11
|
return wrapAction(async () => {
|
|
13
12
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -22,7 +21,6 @@ export async function applyCouponAction(input) {
|
|
|
22
21
|
return { couponId: coupon.id, code: coupon.code, discount, type: coupon.type };
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
26
24
|
export async function createCouponAction(input) {
|
|
27
25
|
return wrapAction(async () => {
|
|
28
26
|
const user = await requireRoleUser(["admin", "seller"]);
|
|
@@ -32,7 +30,6 @@ export async function createCouponAction(input) {
|
|
|
32
30
|
return couponsRepository.createWithId(`coupon-${parsed.data.code.toLowerCase()}`, { ...parsed.data, createdBy: user.uid, usage: { ...parsed.data.usage, currentUsage: 0 } });
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
36
33
|
export async function updateCouponAction(couponId, input) {
|
|
37
34
|
return wrapAction(async () => {
|
|
38
35
|
await requireRoleUser(["admin", "seller"]);
|
|
@@ -6,7 +6,6 @@ import { reviewRepository, productRepository, userRepository, } from "../../../.
|
|
|
6
6
|
import { ValidationError } from "../../../shared/errors/index";
|
|
7
7
|
import { createReviewSchema, replyToReviewSchema, deleteReviewSchema, } from "../../../shared/features/reviews/schema";
|
|
8
8
|
import { assertNotDuplicateReview, assertReviewOwnership, getReviewOrThrow, } from "./service";
|
|
9
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
10
9
|
export async function createReviewAction(input) {
|
|
11
10
|
return wrapAction(async () => {
|
|
12
11
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -35,7 +34,6 @@ export async function createReviewAction(input) {
|
|
|
35
34
|
});
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
39
37
|
export async function replyToReviewAction(input) {
|
|
40
38
|
return wrapAction(async () => {
|
|
41
39
|
const user = await requireRoleUser(["seller", "admin"]);
|
|
@@ -52,7 +50,6 @@ export async function replyToReviewAction(input) {
|
|
|
52
50
|
});
|
|
53
51
|
});
|
|
54
52
|
}
|
|
55
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
56
53
|
export async function deleteReviewAction(input) {
|
|
57
54
|
return wrapAction(async () => {
|
|
58
55
|
const user = await requireRoleUser(["buyer", "seller", "admin"]);
|
|
@@ -101,17 +101,11 @@ export const assignSpinPrize = defineFunction({
|
|
|
101
101
|
},
|
|
102
102
|
});
|
|
103
103
|
const GATEWAY_HANDLERS = {
|
|
104
|
-
// audit-unknown-ok: TS structural escape — GatewayHandler
|
|
105
104
|
listingProcessor: listingProcessorHandler,
|
|
106
|
-
// audit-unknown-ok: TS structural escape — GatewayHandler
|
|
107
105
|
adminAnalytics: adminAnalyticsHandler,
|
|
108
|
-
// audit-unknown-ok: TS structural escape — GatewayHandler
|
|
109
106
|
storeAnalytics: storeAnalyticsHandler,
|
|
110
|
-
// audit-unknown-ok: TS structural escape — GatewayHandler
|
|
111
107
|
promotionsApi: promotionsHandler,
|
|
112
|
-
// audit-unknown-ok: TS structural escape — GatewayHandler
|
|
113
108
|
triggerEventRaffle: triggerEventRaffleHandler,
|
|
114
|
-
// audit-unknown-ok: TS structural escape — GatewayHandler
|
|
115
109
|
assignSpinPrize: assignSpinPrizeHandler,
|
|
116
110
|
};
|
|
117
111
|
async function gatewayHandler(input, ctx) {
|
|
@@ -17,6 +17,5 @@ export const APPKIT_FUNCTIONS = [
|
|
|
17
17
|
...SCHEDULED_FUNCTIONS,
|
|
18
18
|
...FIRESTORE_TRIGGER_FUNCTIONS,
|
|
19
19
|
...HTTPS_FUNCTIONS,
|
|
20
|
-
// audit-unknown-ok: TS structural escape — readonly
|
|
21
20
|
];
|
|
22
21
|
export const APPKIT_FUNCTIONS_BY_NAME = Object.freeze(Object.fromEntries(APPKIT_FUNCTIONS.map((def) => [def.name, def])));
|
|
@@ -17,7 +17,7 @@ export async function runCleanupRtdbEvents(ctx) {
|
|
|
17
17
|
if (staleAuthIds.length > 0) {
|
|
18
18
|
await Promise.all(staleAuthIds.flatMap((id) => [
|
|
19
19
|
rtdb.ref(`auth_events/${id}`).remove(),
|
|
20
|
-
auth.deleteUser(`auth_event_${id}`).catch(() => { }),
|
|
20
|
+
auth.deleteUser(`auth_event_${id}`).catch(() => { }),
|
|
21
21
|
]));
|
|
22
22
|
ctx.logger.info("Auth events removed", { count: staleAuthIds.length });
|
|
23
23
|
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { mapToHttpError } from "../../../../errors/error-mapping";
|
|
10
10
|
import { serverErrorsRepository } from "../../../../features/server-errors/repository/server-errors.repository";
|
|
11
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
12
11
|
async function persist(name, err, ctxLike) {
|
|
13
12
|
const mapped = mapToHttpError(err);
|
|
14
13
|
try {
|
|
@@ -32,7 +32,7 @@ export const actionTracker = {
|
|
|
32
32
|
const result = currentSink(event);
|
|
33
33
|
// Swallow promise rejections so the caller path is never affected.
|
|
34
34
|
if (result && typeof result.catch === "function") {
|
|
35
|
-
result.catch(() => { });
|
|
35
|
+
result.catch(() => { });
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
catch {
|
|
@@ -16,15 +16,12 @@ export function toClient(value) {
|
|
|
16
16
|
// Firestore Timestamp duck-type — `.toDate()` returns a JS Date.
|
|
17
17
|
const maybeTs = value;
|
|
18
18
|
if (typeof maybeTs.toDate === "function") {
|
|
19
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
20
19
|
return maybeTs.toDate().toISOString();
|
|
21
20
|
}
|
|
22
21
|
if (value instanceof Date) {
|
|
23
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
24
22
|
return value.toISOString();
|
|
25
23
|
}
|
|
26
24
|
if (Array.isArray(value)) {
|
|
27
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
28
25
|
return value.map((v) => toClient(v));
|
|
29
26
|
}
|
|
30
27
|
const out = {};
|
|
@@ -33,7 +30,6 @@ export function toClient(value) {
|
|
|
33
30
|
continue;
|
|
34
31
|
out[k] = toClient(v);
|
|
35
32
|
}
|
|
36
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
37
33
|
return out;
|
|
38
34
|
}
|
|
39
35
|
/**
|
|
@@ -15,11 +15,8 @@ export const THEMED_TEXT_PRIMARY = "text-zinc-900 dark:text-zinc-50";
|
|
|
15
15
|
export const THEMED_TEXT_SECONDARY = "text-zinc-500 dark:text-zinc-400";
|
|
16
16
|
export const THEMED_TEXT_TERTIARY = "text-zinc-400 dark:text-zinc-500";
|
|
17
17
|
export const THEMED_TEXT_MUTED = "text-zinc-400 dark:text-zinc-400";
|
|
18
|
-
// audit-semantic-color-ok: these constants ARE the semantic token definitions
|
|
19
18
|
export const THEMED_TEXT_SUCCESS = "text-emerald-600 dark:text-emerald-400";
|
|
20
|
-
// audit-semantic-color-ok: these constants ARE the semantic token definitions
|
|
21
19
|
export const THEMED_TEXT_WARNING = "text-amber-600 dark:text-amber-400";
|
|
22
|
-
// audit-semantic-color-ok: these constants ARE the semantic token definitions
|
|
23
20
|
export const THEMED_TEXT_ERROR = "text-red-600 dark:text-red-400";
|
|
24
21
|
export const FLEX_CENTER = "flex items-center justify-center";
|
|
25
22
|
export const FLEX_BETWEEN = "flex items-center justify-between";
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
* can route the failure (toast vs inline field error vs error boundary).
|
|
5
5
|
*/
|
|
6
6
|
export class ApiError extends Error {
|
|
7
|
-
constructor(code, message, status,
|
|
8
|
-
// audit-unknown-ok: ApiError cause/issues — error chaining canonical API
|
|
9
|
-
options) {
|
|
7
|
+
constructor(code, message, status, options) {
|
|
10
8
|
super(message);
|
|
11
9
|
this.name = "ApiError";
|
|
12
10
|
this.code = code;
|
|
@@ -17,7 +15,6 @@ export class ApiError extends Error {
|
|
|
17
15
|
Object.setPrototypeOf(this, ApiError.prototype);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
21
18
|
export function isApiError(err) {
|
|
22
19
|
return err instanceof ApiError;
|
|
23
20
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { isApiError } from "./ApiError";
|
|
3
3
|
import { getErrorDisplay } from "../../errors/error-display-map";
|
|
4
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
5
4
|
export function surfaceError(err, opts) {
|
|
6
5
|
const { showToast, setFieldError, translate, report } = opts;
|
|
7
6
|
if (isApiError(err)) {
|
|
@@ -19,7 +19,6 @@ export function useApiQuery(options) {
|
|
|
19
19
|
// Background refetch failures: toast a quiet warning.
|
|
20
20
|
if (result.isFetching || !result.data)
|
|
21
21
|
return;
|
|
22
|
-
// audit-unknown-ok: TS structural escape
|
|
23
22
|
const err = result.error;
|
|
24
23
|
if (err instanceof ApiError) {
|
|
25
24
|
const display = getErrorDisplay(err.code);
|
package/dist/configs/next.js
CHANGED
|
@@ -184,7 +184,6 @@ export function defineNextConfig(override = {}) {
|
|
|
184
184
|
];
|
|
185
185
|
}
|
|
186
186
|
function mergedWebpack(config, ctx) {
|
|
187
|
-
// audit-unknown-ok: Next.js config callback — third-party shape
|
|
188
187
|
const { isServer, webpack } = ctx;
|
|
189
188
|
// Deduplicate firebase client SDK across the monorepo.
|
|
190
189
|
// appkit ships its own node_modules/firebase (from standalone dev). Without
|