@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
|
@@ -13,9 +13,7 @@ export function successResponse(data, message, status = 200, meta) {
|
|
|
13
13
|
...(meta && { meta }),
|
|
14
14
|
}, { status });
|
|
15
15
|
}
|
|
16
|
-
export function errorResponse(error, status = 400,
|
|
17
|
-
// audit-unknown-ok: Generic response wrapper — issues field arbitrary
|
|
18
|
-
details) {
|
|
16
|
+
export function errorResponse(error, status = 400, details) {
|
|
19
17
|
return NextResponse.json({
|
|
20
18
|
success: false,
|
|
21
19
|
error,
|
|
@@ -27,7 +25,6 @@ export const ApiErrors = {
|
|
|
27
25
|
unauthorized: (message = "Unauthorized") => errorResponse(message, 401),
|
|
28
26
|
forbidden: (message = "Forbidden") => errorResponse(message, 403),
|
|
29
27
|
notFound: (resource = "Resource") => errorResponse(`${resource} not found`, 404),
|
|
30
|
-
// audit-unknown-ok: Generic response wrapper — issues field arbitrary
|
|
31
28
|
badRequest: (message = "Bad request", details) => errorResponse(message, 400, details),
|
|
32
29
|
internalError: (message = "Internal server error") => errorResponse(message, 500),
|
|
33
30
|
validationError: (details) => errorResponse("Validation failed", 422, details),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { normalizeError } from "../../errors/normalize";
|
|
2
2
|
async function validateSchema(request, schema) {
|
|
3
|
-
// audit-unknown-ok: Next.js route dispatcher boundary
|
|
4
3
|
if (typeof schema.safeParse === "function") {
|
|
5
4
|
const body = await request.json();
|
|
6
5
|
const result = schema.safeParse(body);
|
|
@@ -14,7 +13,6 @@ async function validateSchema(request, schema) {
|
|
|
14
13
|
return { validationError: false, data };
|
|
15
14
|
}
|
|
16
15
|
catch {
|
|
17
|
-
// audit-unknown-ok: TS structural escape — TInput
|
|
18
16
|
return { validationError: false, data: undefined };
|
|
19
17
|
}
|
|
20
18
|
}
|
|
@@ -47,9 +45,7 @@ async function applyRateLimitCheck(request, config, applyRateLimit, getRateLimit
|
|
|
47
45
|
}
|
|
48
46
|
return { blocked: false, headers };
|
|
49
47
|
}
|
|
50
|
-
async function applySchemaValidation(request, schema,
|
|
51
|
-
// audit-unknown-ok: Next.js route dispatcher boundary
|
|
52
|
-
errorResponse) {
|
|
48
|
+
async function applySchemaValidation(request, schema, errorResponse) {
|
|
53
49
|
const schemaResult = await validateSchema(request, schema);
|
|
54
50
|
if (schemaResult.validationError) {
|
|
55
51
|
return { invalid: true, response: errorResponse("Validation failed", 400, schemaResult.issues) };
|
|
@@ -34,14 +34,12 @@ import { NextResponse } from "next/server.js";
|
|
|
34
34
|
*/
|
|
35
35
|
export function createApiErrorHandler(options) {
|
|
36
36
|
const { isAppError, getStatusCode, toJSON, logger, internalErrorCode = "INTERNAL_ERROR", internalErrorMessage = "An internal server error occurred", } = options;
|
|
37
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
38
37
|
return function handleApiError(error) {
|
|
39
38
|
// Known AppError subclass — structured response
|
|
40
39
|
if (isAppError(error)) {
|
|
41
40
|
const status = getStatusCode(error);
|
|
42
41
|
if (status >= 500) {
|
|
43
42
|
logger.error("API Error", {
|
|
44
|
-
// audit-unknown-ok: error JSON serialization boundary
|
|
45
43
|
body: toJSON(error),
|
|
46
44
|
});
|
|
47
45
|
}
|
|
@@ -51,7 +49,6 @@ export function createApiErrorHandler(options) {
|
|
|
51
49
|
if (error !== null &&
|
|
52
50
|
typeof error === "object" &&
|
|
53
51
|
"issues" in error &&
|
|
54
|
-
// audit-unknown-ok: error JSON serialization boundary
|
|
55
52
|
Array.isArray(error.issues)) {
|
|
56
53
|
return NextResponse.json({
|
|
57
54
|
success: false,
|
|
@@ -12,7 +12,6 @@ import { ValidationError } from "../../errors";
|
|
|
12
12
|
* const body = await parseJsonBody<{ name?: string }>(request, { allowEmpty: true });
|
|
13
13
|
*/
|
|
14
14
|
export async function parseJsonBody(request, options) {
|
|
15
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
16
15
|
let raw;
|
|
17
16
|
try {
|
|
18
17
|
const text = await request.text();
|
|
@@ -108,7 +108,6 @@ function resolveBodySchema(schema) {
|
|
|
108
108
|
const entry = SCHEMAS.api[schema];
|
|
109
109
|
if (!entry || !("body" in entry) || !entry.body)
|
|
110
110
|
return null;
|
|
111
|
-
// audit-unknown-ok: TS structural escape — ParseableSchema
|
|
112
111
|
return entry.body;
|
|
113
112
|
}
|
|
114
113
|
/**
|
|
@@ -119,9 +118,7 @@ function resolveBodySchema(schema) {
|
|
|
119
118
|
* soon as every consumer is updated, after which `success` is removed from
|
|
120
119
|
* this helper and the audit re-runs to enforce the cleanup.
|
|
121
120
|
*/
|
|
122
|
-
function errorJson(status, code, message, requestId,
|
|
123
|
-
// audit-unknown-ok: Route handler body schema parse boundary
|
|
124
|
-
issues) {
|
|
121
|
+
function errorJson(status, code, message, requestId, issues) {
|
|
125
122
|
return NextResponse.json({
|
|
126
123
|
ok: false,
|
|
127
124
|
success: false, // deprecated — for compat during the migration sweep
|
|
@@ -190,7 +187,6 @@ export function createRouteHandler(options) {
|
|
|
190
187
|
return errorJson(500, HTTP_ERROR_CODES.INTERNAL, `Route schema not registered: ${String(options.schema)}`, requestId);
|
|
191
188
|
}
|
|
192
189
|
if (resolvedSchema) {
|
|
193
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
194
190
|
let raw;
|
|
195
191
|
try {
|
|
196
192
|
raw = await request.json();
|
|
@@ -248,7 +244,6 @@ export function createRouteHandler(options) {
|
|
|
248
244
|
response.headers.set("Cache-Control", buildPublicCacheControl(policy));
|
|
249
245
|
}
|
|
250
246
|
return response;
|
|
251
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
252
247
|
}
|
|
253
248
|
catch (err) {
|
|
254
249
|
void normalizeError(err);
|
|
@@ -30,9 +30,7 @@ function isCacheable(request, config) {
|
|
|
30
30
|
return methods.includes(request.method);
|
|
31
31
|
}
|
|
32
32
|
export function withCache(handler, config = {}) {
|
|
33
|
-
return async (request,
|
|
34
|
-
// audit-unknown-ok: Next.js middleware boundary
|
|
35
|
-
...args) => {
|
|
33
|
+
return async (request, ...args) => {
|
|
36
34
|
if (!isCacheable(request, config)) {
|
|
37
35
|
return handler(request, ...args);
|
|
38
36
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NextResponse } from "next/server";
|
|
2
2
|
const ENC_PREFIX = "enc:v1:";
|
|
3
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
4
3
|
function scrubValue(value) {
|
|
5
4
|
if (typeof value === "string" && value.startsWith(ENC_PREFIX)) {
|
|
6
5
|
return "[encrypted]";
|
|
@@ -29,7 +28,6 @@ export const piiScrubberMiddleware = async (_request, _ctx, next) => {
|
|
|
29
28
|
const contentType = response.headers.get("content-type") ?? "";
|
|
30
29
|
if (!contentType.includes("application/json"))
|
|
31
30
|
return response;
|
|
32
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
33
31
|
let body;
|
|
34
32
|
try {
|
|
35
33
|
body = await response.json();
|
|
@@ -15,7 +15,6 @@ const EXPECTED_AUTH_CODES = new Set([
|
|
|
15
15
|
"auth/user-disabled",
|
|
16
16
|
"auth/user-not-found",
|
|
17
17
|
]);
|
|
18
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
19
18
|
function isExpectedAuthError(err) {
|
|
20
19
|
return EXPECTED_AUTH_CODES.has(err.code ?? "");
|
|
21
20
|
}
|
|
@@ -48,7 +48,6 @@ function get(key) {
|
|
|
48
48
|
return globalThis[key] ?? null;
|
|
49
49
|
}
|
|
50
50
|
function set(key, value) {
|
|
51
|
-
// audit-unknown-ok: Admin SDK init — global type augmentation
|
|
52
51
|
globalThis[key] = value;
|
|
53
52
|
}
|
|
54
53
|
// --- App ----------------------------------------------------------------------
|
|
@@ -35,7 +35,6 @@ export class FirebaseRepository {
|
|
|
35
35
|
return deserializeTimestamps({
|
|
36
36
|
id: snap.id,
|
|
37
37
|
...(snap.data() ?? {}),
|
|
38
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
// -- IReadRepository --------------------------------------------------------
|
|
@@ -100,7 +99,6 @@ export class FirebaseRepository {
|
|
|
100
99
|
const totalPages = total === 0 ? 0 : Math.max(1, Math.ceil(total / perPage));
|
|
101
100
|
return { data, total, page, perPage, totalPages };
|
|
102
101
|
}
|
|
103
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
104
102
|
async findWhere(field, op, value) {
|
|
105
103
|
const snap = await this.getCollection()
|
|
106
104
|
.where(field, op, value)
|
|
@@ -169,7 +167,6 @@ export class FirebaseRepository {
|
|
|
169
167
|
return doc;
|
|
170
168
|
}
|
|
171
169
|
/** Find first document where `field == value`. */
|
|
172
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
173
170
|
async findOneBy(field, value) {
|
|
174
171
|
const snap = await this.getCollection()
|
|
175
172
|
.where(field, "==", value)
|
|
@@ -195,7 +192,6 @@ const TOKEN_TO_OP = {
|
|
|
195
192
|
"@=": "array-contains",
|
|
196
193
|
};
|
|
197
194
|
/** Best-effort scalar coercion for sieve filter values. */
|
|
198
|
-
// audit-unknown-ok: Base repository coerceValue — accepts any cell value
|
|
199
195
|
function coerceValue(raw) {
|
|
200
196
|
if (raw === "true")
|
|
201
197
|
return true;
|
|
@@ -18,7 +18,6 @@ export class BaseRepository {
|
|
|
18
18
|
return deserializeTimestamps({
|
|
19
19
|
id: snap.id,
|
|
20
20
|
...(snap.data() ?? {}),
|
|
21
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
async findById(id) {
|
|
@@ -41,7 +40,6 @@ export class BaseRepository {
|
|
|
41
40
|
}
|
|
42
41
|
return doc;
|
|
43
42
|
}
|
|
44
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
45
43
|
async findBy(field, value) {
|
|
46
44
|
try {
|
|
47
45
|
const snapshot = await this.getCollection()
|
|
@@ -54,7 +52,6 @@ export class BaseRepository {
|
|
|
54
52
|
throw new DatabaseError(`Failed to find documents by ${field}`, error);
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
58
55
|
async findOneBy(field, value) {
|
|
59
56
|
try {
|
|
60
57
|
const snapshot = await this.getCollection()
|
|
@@ -6,9 +6,7 @@ import { FieldValue } from "firebase-admin/firestore";
|
|
|
6
6
|
export const firebaseFieldOps = {
|
|
7
7
|
serverTimestamp: () => FieldValue.serverTimestamp(),
|
|
8
8
|
increment: (n) => FieldValue.increment(n),
|
|
9
|
-
// audit-unknown-ok: Firestore field operations SDK boundary
|
|
10
9
|
arrayUnion: (...elements) => FieldValue.arrayUnion(...elements),
|
|
11
|
-
// audit-unknown-ok: Firestore field operations SDK boundary
|
|
12
10
|
arrayRemove: (...elements) => FieldValue.arrayRemove(...elements),
|
|
13
11
|
deleteField: () => FieldValue.delete(),
|
|
14
12
|
};
|
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
* FieldValue sentinels (increment, arrayUnion, deleteField, etc.) are not
|
|
13
13
|
* stripped.
|
|
14
14
|
*/
|
|
15
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
16
15
|
function isPlainObject(v) {
|
|
17
16
|
if (v === null || typeof v !== "object" || Array.isArray(v))
|
|
18
17
|
return false;
|
|
19
|
-
// audit-unknown-ok: TS structural escape
|
|
20
18
|
const proto = Object.getPrototypeOf(v);
|
|
21
19
|
return proto === Object.prototype || proto === null;
|
|
22
20
|
}
|
|
@@ -68,11 +66,9 @@ export function deserializeTimestamps(obj) {
|
|
|
68
66
|
if (typeof obj === "object" &&
|
|
69
67
|
!(obj instanceof Date) &&
|
|
70
68
|
typeof obj.toDate === "function") {
|
|
71
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
72
69
|
return obj.toDate();
|
|
73
70
|
}
|
|
74
71
|
if (Array.isArray(obj)) {
|
|
75
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
76
72
|
return obj.map(deserializeTimestamps);
|
|
77
73
|
}
|
|
78
74
|
if (typeof obj === "object" && !(obj instanceof Date)) {
|
|
@@ -31,7 +31,6 @@ export class FirebaseRealtimeRepository {
|
|
|
31
31
|
const snap = await this.nodeRef(id).get();
|
|
32
32
|
if (!snap.exists())
|
|
33
33
|
return null;
|
|
34
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
35
34
|
return { id, ...snap.val() };
|
|
36
35
|
}
|
|
37
36
|
async findAll(query) {
|
|
@@ -46,9 +45,7 @@ export class FirebaseRealtimeRepository {
|
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
const raw = snap.val();
|
|
49
|
-
let data = Object.entries(raw).map(
|
|
50
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
51
|
-
([id, val]) => ({ id, ...val }));
|
|
48
|
+
let data = Object.entries(raw).map(([id, val]) => ({ id, ...val }));
|
|
52
49
|
// Basic server-side sort (RTDB has no native multi-field sort)
|
|
53
50
|
if (query?.sort) {
|
|
54
51
|
const key = query.sort;
|
|
@@ -74,7 +71,6 @@ export class FirebaseRealtimeRepository {
|
|
|
74
71
|
totalPages,
|
|
75
72
|
};
|
|
76
73
|
}
|
|
77
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
78
74
|
async findWhere(field, _op, value) {
|
|
79
75
|
// RTDB Admin SDK supports orderByChild + equalTo for == only
|
|
80
76
|
const snap = await this.nodeRef()
|
|
@@ -84,23 +80,19 @@ export class FirebaseRealtimeRepository {
|
|
|
84
80
|
if (!snap.exists())
|
|
85
81
|
return [];
|
|
86
82
|
const raw = snap.val();
|
|
87
|
-
return Object.entries(raw).map(
|
|
88
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
89
|
-
([id, val]) => ({ id, ...val }));
|
|
83
|
+
return Object.entries(raw).map(([id, val]) => ({ id, ...val }));
|
|
90
84
|
}
|
|
91
85
|
// -- IWriteRepository -------------------------------------------------------
|
|
92
86
|
async create(data) {
|
|
93
87
|
const now = Date.now();
|
|
94
88
|
const payload = { ...data, createdAt: now, updatedAt: now };
|
|
95
89
|
const ref = await this.nodeRef().push(payload);
|
|
96
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
97
90
|
return { id: ref.key, ...payload };
|
|
98
91
|
}
|
|
99
92
|
async update(id, data) {
|
|
100
93
|
const payload = { ...data, updatedAt: Date.now() };
|
|
101
94
|
await this.nodeRef(id).update(payload);
|
|
102
95
|
const snap = await this.nodeRef(id).get();
|
|
103
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
104
96
|
return { id, ...snap.val() };
|
|
105
97
|
}
|
|
106
98
|
async delete(id) {
|
|
@@ -123,15 +115,12 @@ export class FirebaseRealtimeRepository {
|
|
|
123
115
|
subscribe(id, cb) {
|
|
124
116
|
const ref = this.nodeRef(id);
|
|
125
117
|
const handler = (snap) => {
|
|
126
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
127
118
|
cb(snap.exists() ? { id, ...snap.val() } : null);
|
|
128
119
|
};
|
|
129
120
|
ref.on("value", handler);
|
|
130
121
|
return () => ref.off("value", handler);
|
|
131
122
|
}
|
|
132
|
-
subscribeWhere(field,
|
|
133
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
134
|
-
value, cb) {
|
|
123
|
+
subscribeWhere(field, value, cb) {
|
|
135
124
|
const ref = this.nodeRef()
|
|
136
125
|
.orderByChild(field)
|
|
137
126
|
.equalTo(value);
|
|
@@ -141,7 +130,6 @@ export class FirebaseRealtimeRepository {
|
|
|
141
130
|
return;
|
|
142
131
|
}
|
|
143
132
|
const raw = snap.val();
|
|
144
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
145
133
|
cb(Object.entries(raw).map(([id, v]) => ({ id, ...v })));
|
|
146
134
|
};
|
|
147
135
|
ref.on("value", handler);
|
|
@@ -135,16 +135,13 @@ export async function applySieveToFirestore(params) {
|
|
|
135
135
|
// Apply filters + sorts once; count without reading docs.
|
|
136
136
|
const filteredQ = processor.apply(effective, baseQuery, {
|
|
137
137
|
applyPagination: false,
|
|
138
|
-
// audit-unknown-ok: TS structural escape — Firebase SDK type
|
|
139
138
|
});
|
|
140
139
|
const total = await getFirestoreCount(filteredQ);
|
|
141
140
|
// Apply pagination on top of the already-filtered query — avoids re-applying
|
|
142
141
|
// the full Sieve DSL from the base.
|
|
143
142
|
const pagedQ = filteredQ.offset((page - 1) * pageSize).limit(pageSize);
|
|
144
143
|
const snap = await pagedQ.get();
|
|
145
|
-
const items = snap.docs.map(
|
|
146
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
147
|
-
(d) => deserializeTimestamps({ id: d.id, ...d.data() }));
|
|
144
|
+
const items = snap.docs.map((d) => deserializeTimestamps({ id: d.id, ...d.data() }));
|
|
148
145
|
const totalPages = total === 0 ? 0 : Math.max(1, Math.ceil(total / pageSize));
|
|
149
146
|
return {
|
|
150
147
|
items,
|
|
@@ -180,16 +177,13 @@ export class FirebaseSieveRepository extends FirebaseRepository {
|
|
|
180
177
|
// Apply filters + sorts once; count without reading docs.
|
|
181
178
|
const filteredQ = processor.apply(effective, base, {
|
|
182
179
|
applyPagination: false,
|
|
183
|
-
// audit-unknown-ok: TS structural escape — Firebase SDK type
|
|
184
180
|
});
|
|
185
181
|
const total = await getFirestoreCount(filteredQ);
|
|
186
182
|
// Apply pagination on top of the already-filtered query — avoids re-applying
|
|
187
183
|
// the full Sieve DSL from the base.
|
|
188
184
|
const pagedQ = filteredQ.offset((page - 1) * pageSize).limit(pageSize);
|
|
189
185
|
const snap = await pagedQ.get();
|
|
190
|
-
const items = snap.docs.map((d) =>
|
|
191
|
-
// audit-unknown-ok: TS structural escape — TResult
|
|
192
|
-
deserializeTimestamps({ id: d.id, ...d.data() }));
|
|
186
|
+
const items = snap.docs.map((d) => deserializeTimestamps({ id: d.id, ...d.data() }));
|
|
193
187
|
const totalPages = total === 0 ? 0 : Math.max(1, Math.ceil(total / pageSize));
|
|
194
188
|
return {
|
|
195
189
|
items,
|
|
@@ -148,7 +148,6 @@ export async function createRazorpayOrder(opts) {
|
|
|
148
148
|
receipt: opts.receipt ?? `rcpt_${Date.now()}`,
|
|
149
149
|
notes: opts.notes,
|
|
150
150
|
});
|
|
151
|
-
// audit-unknown-ok: TS structural escape — RazorpayOrder
|
|
152
151
|
return order;
|
|
153
152
|
}
|
|
154
153
|
/**
|
|
@@ -159,7 +158,6 @@ export async function createRazorpayOrder(opts) {
|
|
|
159
158
|
export async function fetchRazorpayOrder(orderId) {
|
|
160
159
|
const razorpay = await getRazorpayInstance();
|
|
161
160
|
const order = await razorpay.orders.fetch(orderId);
|
|
162
|
-
// audit-unknown-ok: TS structural escape — RazorpayOrder
|
|
163
161
|
return order;
|
|
164
162
|
}
|
|
165
163
|
/**
|
|
@@ -203,6 +201,5 @@ export async function createRazorpayRefund(paymentId, amountPaise) {
|
|
|
203
201
|
if (amountPaise)
|
|
204
202
|
opts.amount = amountPaise;
|
|
205
203
|
const refund = await razorpay.payments.refund(paymentId, opts);
|
|
206
|
-
// audit-unknown-ok: TS structural escape — RazorpayRefundResult
|
|
207
204
|
return refund;
|
|
208
205
|
}
|
|
@@ -33,7 +33,6 @@ export function createStorageHelpers(storage) {
|
|
|
33
33
|
});
|
|
34
34
|
const url = await getDownloadURL(uploadResult.ref);
|
|
35
35
|
return { url, ref: uploadResult.ref, uploadResult };
|
|
36
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
37
36
|
}
|
|
38
37
|
catch (error) {
|
|
39
38
|
void normalizeError(error);
|
|
@@ -70,7 +69,6 @@ export function createStorageHelpers(storage) {
|
|
|
70
69
|
async function getFileUrl(path) {
|
|
71
70
|
try {
|
|
72
71
|
return await getDownloadURL(ref(storage, path));
|
|
73
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
74
72
|
}
|
|
75
73
|
catch (error) {
|
|
76
74
|
void normalizeError(error);
|
|
@@ -81,7 +79,6 @@ export function createStorageHelpers(storage) {
|
|
|
81
79
|
async function deleteFile(path) {
|
|
82
80
|
try {
|
|
83
81
|
await deleteObject(ref(storage, path));
|
|
84
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
85
82
|
}
|
|
86
83
|
catch (error) {
|
|
87
84
|
void normalizeError(error);
|
|
@@ -96,7 +93,6 @@ export function createStorageHelpers(storage) {
|
|
|
96
93
|
try {
|
|
97
94
|
const result = await listAll(ref(storage, folderPath));
|
|
98
95
|
return result.items;
|
|
99
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
100
96
|
}
|
|
101
97
|
catch (error) {
|
|
102
98
|
void normalizeError(error);
|
|
@@ -141,7 +141,6 @@ export function SessionProvider({ children, initialUser, endpoints: endpointOver
|
|
|
141
141
|
stats: data.stats,
|
|
142
142
|
metadata: data.metadata,
|
|
143
143
|
scamAwarenessAcknowledgedAt: data.scamAwarenessAcknowledgedAt
|
|
144
|
-
// audit-unknown-ok: TS structural escape — primitive cast
|
|
145
144
|
? new Date(data.scamAwarenessAcknowledgedAt)
|
|
146
145
|
: null,
|
|
147
146
|
dismissedBannerHash: data.dismissedBannerHash,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
/** Resolve any date-like value into a ms timestamp. */
|
|
4
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
5
4
|
function resolveMs(endDate) {
|
|
6
5
|
if (!endDate)
|
|
7
6
|
return NaN;
|
|
@@ -17,7 +17,6 @@ const ROLE_HIERARCHY = {
|
|
|
17
17
|
seller: 2,
|
|
18
18
|
user: 1,
|
|
19
19
|
};
|
|
20
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
21
20
|
export function requireAuth(user) {
|
|
22
21
|
if (!user) {
|
|
23
22
|
throw new AuthenticationError(ERROR_MESSAGES.AUTH.UNAUTHORIZED);
|
|
@@ -208,7 +208,6 @@ export function encryptPayoutDetails(details) {
|
|
|
208
208
|
if (bank && typeof bank === "object" && !Array.isArray(bank) && !(bank instanceof Date)) {
|
|
209
209
|
result.bankAccount = encryptPiiFields({ ...bank }, ["accountNumber"]);
|
|
210
210
|
}
|
|
211
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
212
211
|
return result;
|
|
213
212
|
}
|
|
214
213
|
/**
|
|
@@ -225,7 +224,6 @@ export function decryptPayoutDetails(details) {
|
|
|
225
224
|
if (bank && typeof bank === "object" && !Array.isArray(bank) && !(bank instanceof Date)) {
|
|
226
225
|
result.bankAccount = decryptPiiFields({ ...bank }, ["accountNumber"]);
|
|
227
226
|
}
|
|
228
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
229
227
|
return result;
|
|
230
228
|
}
|
|
231
229
|
/**
|
|
@@ -243,7 +241,6 @@ export function encryptShippingConfig(config) {
|
|
|
243
241
|
if (addr && typeof addr === "object" && !Array.isArray(addr) && !(addr instanceof Date)) {
|
|
244
242
|
result.pickupAddress = encryptPiiFields({ ...addr }, ["phone", "email", "address", "address2"]);
|
|
245
243
|
}
|
|
246
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
247
244
|
return result;
|
|
248
245
|
}
|
|
249
246
|
/**
|
|
@@ -260,7 +257,6 @@ export function decryptShippingConfig(config) {
|
|
|
260
257
|
if (addr && typeof addr === "object" && !Array.isArray(addr) && !(addr instanceof Date)) {
|
|
261
258
|
result.pickupAddress = decryptPiiFields({ ...addr }, ["phone", "email", "address", "address2"]);
|
|
262
259
|
}
|
|
263
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
264
260
|
return result;
|
|
265
261
|
}
|
|
266
262
|
/**
|
|
@@ -112,7 +112,6 @@ function redactStringValue(key, value) {
|
|
|
112
112
|
* Returns a new object with sensitive fields masked — the original is
|
|
113
113
|
* never mutated.
|
|
114
114
|
*/
|
|
115
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
116
115
|
export function redactPii(data, depth = 0) {
|
|
117
116
|
if (depth > MAX_DEPTH)
|
|
118
117
|
return "[MAX_DEPTH]";
|
|
@@ -123,9 +122,7 @@ export function redactPii(data, depth = 0) {
|
|
|
123
122
|
if (Array.isArray(data)) {
|
|
124
123
|
return data.map((item) => redactPii(item, depth + 1));
|
|
125
124
|
}
|
|
126
|
-
// audit-unknown-ok: PII redaction — accepts arbitrary values, narrows by typeof
|
|
127
125
|
const result = {};
|
|
128
|
-
// audit-unknown-ok: PII redaction — accepts arbitrary values, narrows by typeof
|
|
129
126
|
for (const [key, value] of Object.entries(data)) {
|
|
130
127
|
if (typeof value === "string") {
|
|
131
128
|
result[key] = redactStringValue(key, value);
|
package/dist/seed/manifest.js
CHANGED
|
@@ -46,12 +46,9 @@ import { productFeaturesSeedData } from "./product-features-seed-data";
|
|
|
46
46
|
import { offersSeedData } from "./offers-seed-data";
|
|
47
47
|
import { couponUsageSeedData } from "./coupon-usage-seed-data";
|
|
48
48
|
import { claimedCouponsSeedData } from "./claimed-coupons-seed-data";
|
|
49
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
50
49
|
function asArr(items) {
|
|
51
|
-
// audit-unknown-ok: TS structural escape — Array
|
|
52
50
|
return items ?? [];
|
|
53
51
|
}
|
|
54
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
55
52
|
function pick(items, nameKey = "name") {
|
|
56
53
|
return items
|
|
57
54
|
.filter((item) => Boolean(item.id))
|
|
@@ -114,9 +111,7 @@ export const SEED_MANIFEST = {
|
|
|
114
111
|
...s,
|
|
115
112
|
name: s.title ?? s.type ?? s.id,
|
|
116
113
|
})), "name"),
|
|
117
|
-
siteSettings: pick(
|
|
118
|
-
// audit-unknown-ok: TS structural escape — domain document type lacks index signature
|
|
119
|
-
[siteSettingsSeedData].map((s) => ({
|
|
114
|
+
siteSettings: pick([siteSettingsSeedData].map((s) => ({
|
|
120
115
|
...s,
|
|
121
116
|
name: s.siteName ?? "global",
|
|
122
117
|
}))),
|
package/dist/seed/runner.js
CHANGED
|
@@ -7,7 +7,6 @@ const DEFAULT_MAX_ATTEMPTS = 2;
|
|
|
7
7
|
* surface a canonical "retryable" flag — we match the error message against
|
|
8
8
|
* known-transient patterns (DEADLINE_EXCEEDED, UNAVAILABLE, network resets).
|
|
9
9
|
*/
|
|
10
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
11
10
|
function isRetryableError(err) {
|
|
12
11
|
const msg = err instanceof Error ? err.message : String(err);
|
|
13
12
|
return (msg.includes("DEADLINE_EXCEEDED") ||
|
|
@@ -38,7 +37,6 @@ export async function runSeed(config) {
|
|
|
38
37
|
const { collection: name, data, idField = "id", merge = false, piiFields = [], validate, } = collection;
|
|
39
38
|
// P31-A: per-doc validation gate. Invalid docs are pulled out of the
|
|
40
39
|
// write set before we touch Firestore. Strict mode aborts on first error.
|
|
41
|
-
// audit-unknown-ok: Seed runner — receives Firestore doc shape from seed files
|
|
42
40
|
const validDocs = [];
|
|
43
41
|
const skipped = [];
|
|
44
42
|
for (const rawDoc of data) {
|
package/dist/ui/DataTable.js
CHANGED
|
@@ -134,9 +134,7 @@ pageSize: pageSizeProp, stickyHeader: stickyHeaderProp, striped: stripedProp, sh
|
|
|
134
134
|
? "ascending"
|
|
135
135
|
: "descending"
|
|
136
136
|
: "none"
|
|
137
|
-
: undefined, className: `appkit-data-table__th ${col.sortable ? "appkit-data-table__th--sortable" : ""}`,
|
|
138
|
-
// audit-inline-style-ok: dynamic CSS
|
|
139
|
-
style: { width: col.width }, onClick: () => col.sortable && handleSort(col.key), children: _jsxs(Row, { gap: "sm", children: [col.header, col.sortable && (_jsx(Span, { "aria-hidden": "true", color: "faint", children: sortKey === col.key ? (sortDirection === "asc" ? ("↑") : ("↓")) : (_jsx(Span, { className: "opacity-30", children: "\u2195" })) }))] }) }, col.key))), actions && (_jsx("th", { scope: "col", className: "appkit-data-table__th appkit-data-table__td--actions", children: labelActions }))] }) }), _jsx("tbody", { className: "appkit-data-table__tbody divide-y divide-zinc-200 dark:divide-slate-700", children: paginatedData.map((item, index) => (_jsxs("tr", { className: [
|
|
137
|
+
: undefined, className: `appkit-data-table__th ${col.sortable ? "appkit-data-table__th--sortable" : ""}`, style: { width: col.width }, onClick: () => col.sortable && handleSort(col.key), children: _jsxs(Row, { gap: "sm", children: [col.header, col.sortable && (_jsx(Span, { "aria-hidden": "true", color: "faint", children: sortKey === col.key ? (sortDirection === "asc" ? ("↑") : ("↓")) : (_jsx(Span, { className: "opacity-30", children: "\u2195" })) }))] }) }, col.key))), actions && (_jsx("th", { scope: "col", className: "appkit-data-table__th appkit-data-table__td--actions", children: labelActions }))] }) }), _jsx("tbody", { className: "appkit-data-table__tbody divide-y divide-zinc-200 dark:divide-slate-700", children: paginatedData.map((item, index) => (_jsxs("tr", { className: [
|
|
140
138
|
"appkit-data-table__row",
|
|
141
139
|
striped && index % 2 === 1
|
|
142
140
|
? "appkit-data-table__row--striped"
|
|
@@ -161,9 +159,7 @@ function DataTableTableView({ columns, paginatedData, keyExtractor, selectable,
|
|
|
161
159
|
? sortKey === col.key
|
|
162
160
|
? sortDirection === "asc" ? "ascending" : "descending"
|
|
163
161
|
: "none"
|
|
164
|
-
: undefined, className: `appkit-data-table__th ${col.sortable ? "appkit-data-table__th--sortable" : ""}`,
|
|
165
|
-
// audit-inline-style-ok: dynamic CSS
|
|
166
|
-
style: { width: col.width }, onClick: () => col.sortable && onSort(col.key), children: _jsxs(Row, { gap: "sm", children: [col.header, col.sortable && (_jsx(Span, { "aria-hidden": "true", color: "faint", children: sortKey === col.key ? (sortDirection === "asc" ? "↑" : "↓") : _jsx(Span, { className: "opacity-30", children: "\u2195" }) }))] }) }, col.key))), actions && (_jsx("th", { scope: "col", className: "appkit-data-table__th appkit-data-table__td--actions", children: labelActions }))] }) }), _jsx("tbody", { className: "appkit-data-table__tbody divide-y divide-zinc-200 dark:divide-slate-700", children: paginatedData.map((item, index) => (_jsxs("tr", { className: [
|
|
162
|
+
: undefined, className: `appkit-data-table__th ${col.sortable ? "appkit-data-table__th--sortable" : ""}`, style: { width: col.width }, onClick: () => col.sortable && onSort(col.key), children: _jsxs(Row, { gap: "sm", children: [col.header, col.sortable && (_jsx(Span, { "aria-hidden": "true", color: "faint", children: sortKey === col.key ? (sortDirection === "asc" ? "↑" : "↓") : _jsx(Span, { className: "opacity-30", children: "\u2195" }) }))] }) }, col.key))), actions && (_jsx("th", { scope: "col", className: "appkit-data-table__th appkit-data-table__td--actions", children: labelActions }))] }) }), _jsx("tbody", { className: "appkit-data-table__tbody divide-y divide-zinc-200 dark:divide-slate-700", children: paginatedData.map((item, index) => (_jsxs("tr", { className: [
|
|
167
163
|
"appkit-data-table__row",
|
|
168
164
|
striped && index % 2 === 1 ? "appkit-data-table__row--striped" : "",
|
|
169
165
|
onRowClick ? "appkit-data-table__row--clickable" : "",
|
|
@@ -33,7 +33,6 @@ export function Anchor({ href, children, tone = "brand", underline = "hover", si
|
|
|
33
33
|
const computedRel = rel ??
|
|
34
34
|
(resolvedExternal && isHttp ? "noopener noreferrer" : undefined);
|
|
35
35
|
return (_jsx("a", { href: href, target: computedTarget, rel: computedRel,
|
|
36
|
-
// audit-variant-ok: Anchor is the catalogued primitive for external
|
|
37
36
|
// links. Tone + underline come from typed enums; className is the
|
|
38
37
|
// escape hatch for behaviour-coupled utility classes only.
|
|
39
38
|
className: `${TONE_CLS[tone]} ${UNDERLINE_CLS[underline]} ${size ? ANCHOR_SIZE_CLS[size] : ""} transition-colors${className ? ` ${className}` : ""}`, ...rest, children: children }));
|
|
@@ -44,9 +44,7 @@ export function AvatarDisplay({ cropData, size = "md", className = "", alt = "Pr
|
|
|
44
44
|
className,
|
|
45
45
|
]
|
|
46
46
|
.filter(Boolean)
|
|
47
|
-
.join(" "), "data-section": "avatardisplay-div-455", children: _jsx("div", { className: UI_AVATAR_DISPLAY.imageInner,
|
|
48
|
-
// audit-inline-style-ok: dynamic CSS
|
|
49
|
-
style: {
|
|
47
|
+
.join(" "), "data-section": "avatardisplay-div-455", children: _jsx("div", { className: UI_AVATAR_DISPLAY.imageInner, style: {
|
|
50
48
|
backgroundImage: `url(${cropData.url})`,
|
|
51
49
|
backgroundSize: "cover",
|
|
52
50
|
width: `${(cropData.zoom || 1) * 100}%`,
|
|
@@ -36,11 +36,7 @@ export function BackgroundRenderer({ mode, lightMode, darkMode, }) {
|
|
|
36
36
|
opacity: config.overlay.opacity,
|
|
37
37
|
}
|
|
38
38
|
: { display: "none" };
|
|
39
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-bg-renderer",
|
|
40
|
-
// audit-inline-style-ok: computed style fn
|
|
41
|
-
style: getBackgroundStyle(), "data-section": "backgroundrenderer-div-456", children: config.type === "video" && (_jsxs("video", { ref: videoRef, autoPlay: true, loop: true, muted: true, playsInline: true, onLoadedData: () => setIsVideoLoaded(true), className: `appkit-bg-renderer__video ${isVideoLoaded
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-bg-renderer", style: getBackgroundStyle(), "data-section": "backgroundrenderer-div-456", children: config.type === "video" && (_jsxs("video", { ref: videoRef, autoPlay: true, loop: true, muted: true, playsInline: true, onLoadedData: () => setIsVideoLoaded(true), className: `appkit-bg-renderer__video ${isVideoLoaded
|
|
42
40
|
? "appkit-bg-renderer__video--loaded"
|
|
43
|
-
: "appkit-bg-renderer__video--loading"}`, children: [_jsx("source", { src: config.value, type: "video/mp4" }), "Your browser does not support the video tag."] })) }), _jsx("div", { className: "appkit-bg-renderer__overlay",
|
|
44
|
-
// audit-inline-style-ok: pass-through style prop
|
|
45
|
-
style: overlayStyle })] }));
|
|
41
|
+
: "appkit-bg-renderer__video--loading"}`, children: [_jsx("source", { src: config.value, type: "video/mp4" }), "Your browser does not support the video tag."] })) }), _jsx("div", { className: "appkit-bg-renderer__overlay", style: overlayStyle })] }));
|
|
46
42
|
}
|
|
@@ -49,7 +49,6 @@ function BaseListingCardInfo({ variant = "grid", className = "", children, }) {
|
|
|
49
49
|
function BaseListingCardCheckbox({ selected, onSelect, label, position = "top-2 left-2", className = "", }) {
|
|
50
50
|
return (_jsx("button", { type: "button", "aria-label": label ?? (selected ? "Deselect" : "Select"), "aria-checked": selected, role: "checkbox", onClick: (e) => {
|
|
51
51
|
e.stopPropagation();
|
|
52
|
-
// audit-unknown-ok: TS structural escape — MouseEvent
|
|
53
52
|
onSelect?.(e);
|
|
54
53
|
}, className: [
|
|
55
54
|
"absolute z-10 h-4 w-4 rounded flex items-center justify-center",
|