@mohasinac/appkit 2.6.3 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/server/features/account/data.js +2 -2
- package/dist/_internal/server/features/bundles/data.d.ts +26 -6
- package/dist/_internal/server/features/bundles/data.js +41 -6
- package/dist/_internal/server/features/bundles/index.d.ts +3 -2
- package/dist/_internal/server/features/bundles/index.js +4 -2
- package/dist/_internal/server/features/bundles/metadata.d.ts +20 -0
- package/dist/_internal/server/features/bundles/metadata.js +46 -0
- package/dist/_internal/server/features/bundles/og.d.ts +38 -0
- package/dist/_internal/server/features/bundles/og.js +122 -0
- package/dist/_internal/server/features/checkout/actions.js +192 -133
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +57 -0
- package/dist/_internal/server/features/checkout/bundle-expansion.js +70 -0
- package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +5 -15
- package/dist/_internal/server/features/checkout/prize-bundle-gates.js +5 -21
- package/dist/_internal/server/features/media/contextGuards.js +15 -1
- package/dist/_internal/server/features/payouts/actions.d.ts +19 -0
- package/dist/_internal/server/features/payouts/actions.js +38 -0
- package/dist/_internal/server/features/products/data.js +1 -2
- package/dist/_internal/server/features/raffle/actions.d.ts +11 -0
- package/dist/_internal/server/features/raffle/actions.js +31 -0
- package/dist/_internal/server/features/refunds/actions.d.ts +31 -0
- package/dist/_internal/server/features/refunds/actions.js +77 -0
- package/dist/_internal/server/jobs/core/adminAnalytics.d.ts +28 -0
- package/dist/_internal/server/jobs/core/adminAnalytics.js +98 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.d.ts +19 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.js +81 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.d.ts +2 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.js +70 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.d.ts +2 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +109 -0
- package/dist/_internal/server/jobs/core/bundleStockSync.d.ts +10 -0
- package/dist/_internal/server/jobs/core/bundleStockSync.js +71 -0
- package/dist/_internal/server/jobs/core/cartPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/cartPrune.js +13 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.d.ts +2 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +45 -0
- package/dist/_internal/server/jobs/core/countersReconcile.d.ts +2 -0
- package/dist/_internal/server/jobs/core/countersReconcile.js +107 -0
- package/dist/_internal/server/jobs/core/couponExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/couponExpiry.js +13 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.d.ts +2 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.js +20 -0
- package/dist/_internal/server/jobs/core/index.d.ts +44 -0
- package/dist/_internal/server/jobs/core/index.js +47 -0
- package/dist/_internal/server/jobs/core/listingProcessor.d.ts +30 -0
- package/dist/_internal/server/jobs/core/listingProcessor.js +138 -0
- package/dist/_internal/server/jobs/core/mediaTmpCleanup.d.ts +14 -0
- package/dist/_internal/server/jobs/core/mediaTmpCleanup.js +68 -0
- package/dist/_internal/server/jobs/core/notificationPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/notificationPrune.js +13 -0
- package/dist/_internal/server/jobs/core/offerExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/offerExpiry.js +50 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.d.ts +15 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.js +59 -0
- package/dist/_internal/server/jobs/core/onCategoryWrite.d.ts +14 -0
- package/dist/_internal/server/jobs/core/onCategoryWrite.js +134 -0
- package/dist/_internal/server/jobs/core/onOrderCreate.d.ts +18 -0
- package/dist/_internal/server/jobs/core/onOrderCreate.js +78 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +19 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.js +139 -0
- package/dist/_internal/server/jobs/core/onProductStockChange.d.ts +23 -0
- package/dist/_internal/server/jobs/core/onProductStockChange.js +130 -0
- package/dist/_internal/server/jobs/core/onProductWrite.d.ts +12 -0
- package/dist/_internal/server/jobs/core/onProductWrite.js +94 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.d.ts +7 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.js +49 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.d.ts +12 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.js +7 -0
- package/dist/_internal/server/jobs/core/payoutBatch.d.ts +8 -0
- package/dist/_internal/server/jobs/core/payoutBatch.js +102 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +2 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +27 -0
- package/dist/_internal/server/jobs/core/positionsReconcile.d.ts +7 -0
- package/dist/_internal/server/jobs/core/positionsReconcile.js +87 -0
- package/dist/_internal/server/jobs/core/prizeRevealClose.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +22 -0
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +50 -0
- package/dist/_internal/server/jobs/core/prizeRevealOpen.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +56 -0
- package/dist/_internal/server/jobs/core/prizeRevealReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +38 -0
- package/dist/_internal/server/jobs/core/productStatsSync.d.ts +8 -0
- package/dist/_internal/server/jobs/core/productStatsSync.js +36 -0
- package/dist/_internal/server/jobs/core/promotions.d.ts +12 -0
- package/dist/_internal/server/jobs/core/promotions.js +43 -0
- package/dist/_internal/server/jobs/core/storeAnalytics.d.ts +30 -0
- package/dist/_internal/server/jobs/core/storeAnalytics.js +109 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +19 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +86 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +85 -0
- package/dist/_internal/server/jobs/handlers/adminAnalytics.d.ts +2 -26
- package/dist/_internal/server/jobs/handlers/adminAnalytics.js +2 -98
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +1 -22
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +2 -86
- package/dist/_internal/server/jobs/handlers/auctionSettlement.js +2 -70
- package/dist/_internal/server/jobs/handlers/autoPayoutEligibility.js +2 -110
- package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +0 -16
- package/dist/_internal/server/jobs/handlers/bundleStockSync.js +2 -80
- package/dist/_internal/server/jobs/handlers/cartPrune.js +2 -13
- package/dist/_internal/server/jobs/handlers/cleanupRtdbEvents.js +2 -45
- package/dist/_internal/server/jobs/handlers/countersReconcile.js +2 -109
- package/dist/_internal/server/jobs/handlers/couponExpiry.js +2 -13
- package/dist/_internal/server/jobs/handlers/dailyDataCleanup.js +2 -20
- package/dist/_internal/server/jobs/handlers/listingProcessor.d.ts +3 -28
- package/dist/_internal/server/jobs/handlers/listingProcessor.js +3 -138
- package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.d.ts +0 -12
- package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.js +2 -69
- package/dist/_internal/server/jobs/handlers/notificationPrune.js +2 -13
- package/dist/_internal/server/jobs/handlers/offerExpiry.js +2 -50
- package/dist/_internal/server/jobs/handlers/onBidPlaced.d.ts +1 -10
- package/dist/_internal/server/jobs/handlers/onBidPlaced.js +2 -56
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.d.ts +1 -8
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.js +6 -134
- package/dist/_internal/server/jobs/handlers/onOrderCreate.d.ts +1 -12
- package/dist/_internal/server/jobs/handlers/onOrderCreate.js +2 -76
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.d.ts +1 -12
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +2 -139
- package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +0 -13
- package/dist/_internal/server/jobs/handlers/onProductStockChange.js +7 -134
- package/dist/_internal/server/jobs/handlers/onProductWrite.d.ts +1 -6
- package/dist/_internal/server/jobs/handlers/onProductWrite.js +6 -106
- package/dist/_internal/server/jobs/handlers/onReviewWrite.js +2 -49
- package/dist/_internal/server/jobs/handlers/onStoreWrite.d.ts +1 -8
- package/dist/_internal/server/jobs/handlers/onStoreWrite.js +7 -8
- package/dist/_internal/server/jobs/handlers/payoutBatch.d.ts +0 -9
- package/dist/_internal/server/jobs/handlers/payoutBatch.js +2 -104
- package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.js +2 -33
- package/dist/_internal/server/jobs/handlers/positionsReconcile.d.ts +0 -5
- package/dist/_internal/server/jobs/handlers/positionsReconcile.js +2 -87
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +0 -7
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +2 -29
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +0 -8
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +2 -58
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +0 -8
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +2 -65
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +0 -7
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +2 -45
- package/dist/_internal/server/jobs/handlers/productStatsSync.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/productStatsSync.js +2 -36
- package/dist/_internal/server/jobs/handlers/promotions.d.ts +2 -10
- package/dist/_internal/server/jobs/handlers/promotions.js +2 -43
- package/dist/_internal/server/jobs/handlers/storeAnalytics.d.ts +2 -28
- package/dist/_internal/server/jobs/handlers/storeAnalytics.js +2 -109
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +1 -28
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +2 -94
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +2 -87
- package/dist/_internal/server/jobs/index.d.ts +1 -0
- package/dist/_internal/server/jobs/index.js +1 -0
- package/dist/_internal/server/jobs/runtime/adapters/firebase.js +21 -0
- package/dist/_internal/shared/actions/action-registry.d.ts +84 -0
- package/dist/_internal/shared/actions/action-registry.js +160 -0
- package/dist/_internal/shared/checkout/rules/_defaults.d.ts +3 -0
- package/dist/_internal/shared/checkout/rules/_defaults.js +22 -0
- package/dist/_internal/shared/checkout/rules/_limits.d.ts +19 -0
- package/dist/_internal/shared/checkout/rules/_limits.js +19 -0
- package/dist/_internal/shared/checkout/rules/_registry.d.ts +44 -0
- package/dist/_internal/shared/checkout/rules/_registry.js +87 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.js +10 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.d.ts +11 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.js +9 -0
- package/dist/_internal/shared/checkout/rules/digital-code.rule.d.ts +8 -0
- package/dist/_internal/shared/checkout/rules/digital-code.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +12 -0
- package/dist/_internal/shared/checkout/rules/index.js +12 -0
- package/dist/_internal/shared/checkout/rules/live.rule.d.ts +10 -0
- package/dist/_internal/shared/checkout/rules/live.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.js +9 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.js +28 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +65 -0
- package/dist/_internal/shared/checkout/rules/standard.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/standard.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +125 -0
- package/dist/_internal/shared/checkout/rules/types.js +13 -0
- package/dist/_internal/shared/features/cart/schema.d.ts +6 -6
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +123 -0
- package/dist/_internal/shared/features/categories/bundle-copy.js +134 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +318 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.js +55 -0
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +36 -0
- package/dist/_internal/shared/features/orders/refund-copy.js +40 -0
- package/dist/_internal/shared/features/orders/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/_internal/shared/listing-types/_registry.d.ts +27 -0
- package/dist/_internal/shared/listing-types/_registry.js +8 -0
- package/dist/_internal/shared/listing-types/action-tracker.d.ts +41 -0
- package/dist/_internal/shared/listing-types/action-tracker.js +70 -0
- package/dist/_internal/shared/listing-types/capabilities.js +25 -0
- package/dist/_internal/shared/listing-types/cart-shipping.d.ts +37 -0
- package/dist/_internal/shared/listing-types/cart-shipping.js +46 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/classified/config.js +8 -0
- package/dist/_internal/shared/listing-types/classified/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/classified/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/og.js +1 -0
- package/dist/_internal/shared/listing-types/classified/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/schema.js +1 -0
- package/dist/_internal/shared/listing-types/classified/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +8 -0
- package/dist/_internal/shared/listing-types/digital-code/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/digital-code/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/og.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/schema.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +34 -0
- package/dist/_internal/shared/listing-types/feature-flags.js +45 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/live/config.js +8 -0
- package/dist/_internal/shared/listing-types/live/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/live/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/og.js +1 -0
- package/dist/_internal/shared/listing-types/live/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/schema.js +1 -0
- package/dist/_internal/shared/listing-types/live/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/seed-factory.js +1 -0
- package/dist/_internal/shared/media/limits.js +8 -0
- package/dist/client.d.ts +6 -1
- package/dist/client.js +14 -1
- package/dist/configs/next.js +7 -0
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +4 -0
- package/dist/core/hooks/useSyncManager.js +13 -1
- package/dist/core/unit-of-work.d.ts +1 -1
- package/dist/core/unit-of-work.js +2 -2
- package/dist/features/account/actions/address-actions.d.ts +1 -1
- package/dist/features/account/actions/address-actions.js +15 -7
- package/dist/features/account/schemas/firestore.d.ts +8 -43
- package/dist/features/account/schemas/firestore.js +8 -54
- package/dist/features/account/schemas/index.d.ts +6 -6
- package/dist/features/account/server.d.ts +1 -1
- package/dist/features/account/server.js +3 -1
- package/dist/features/addresses/index.d.ts +2 -0
- package/dist/features/addresses/index.js +2 -0
- package/dist/features/addresses/repository/addresses.repository.d.ts +29 -0
- package/dist/features/addresses/repository/addresses.repository.js +157 -0
- package/dist/features/addresses/schemas/firestore.d.ts +53 -0
- package/dist/features/addresses/schemas/firestore.js +68 -0
- package/dist/features/{bundles → addresses}/schemas/index.d.ts +0 -1
- package/dist/features/{bundles → addresses}/schemas/index.js +0 -1
- package/dist/features/addresses/server.d.ts +2 -0
- package/dist/features/addresses/server.js +2 -0
- package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -3
- package/dist/features/admin/components/AdminBidsView.js +4 -3
- package/dist/features/admin/components/AdminBlogView.js +8 -3
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +9 -0
- package/dist/features/admin/components/AdminBundleEditorView.js +209 -0
- package/dist/features/admin/components/AdminBundlesView.d.ts +9 -0
- package/dist/features/admin/components/AdminBundlesView.js +59 -0
- package/dist/features/admin/components/AdminCartsView.js +13 -3
- package/dist/features/admin/components/AdminContactView.js +4 -3
- package/dist/features/admin/components/AdminCouponsView.js +32 -13
- package/dist/features/admin/components/AdminNewsletterView.js +4 -3
- package/dist/features/admin/components/AdminOrdersView.js +15 -7
- package/dist/features/admin/components/AdminPayoutsView.js +4 -3
- package/dist/features/admin/components/AdminProductsView.js +6 -5
- package/dist/features/admin/components/AdminReviewsView.js +5 -4
- package/dist/features/admin/components/AdminStoresView.js +4 -3
- package/dist/features/admin/components/AdminUsersView.js +15 -5
- package/dist/features/admin/components/AdminWishlistsView.js +10 -1
- package/dist/features/admin/components/DataTable.d.ts +5 -1
- package/dist/features/admin/components/DataTable.js +24 -20
- package/dist/features/admin/components/index.d.ts +4 -0
- package/dist/features/admin/components/index.js +3 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +401 -0
- package/dist/features/admin/constants/filter-tabs.js +200 -0
- package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -0
- package/dist/features/admin/hooks/useAdminListingData.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +15 -0
- package/dist/features/admin/schemas/firestore.js +18 -0
- package/dist/features/admin/types/product.types.d.ts +2 -2
- package/dist/features/auctions/components/AuctionCard.d.ts +4 -1
- package/dist/features/auctions/components/AuctionCard.js +5 -3
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +2 -2
- package/dist/features/auctions/components/PlaceBidFormClient.js +12 -2
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/index.d.ts +1 -0
- package/dist/features/auth/index.js +1 -0
- package/dist/features/auth/role-predicates.d.ts +16 -0
- package/dist/features/auth/role-predicates.js +15 -0
- package/dist/features/blog/components/BlogFeaturedCard.d.ts +4 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +5 -3
- package/dist/features/cart/actions/cart-actions.d.ts +1 -0
- package/dist/features/cart/actions/cart-actions.js +16 -0
- package/dist/features/cart/components/CartView.d.ts +19 -1
- package/dist/features/cart/components/CartView.js +2 -2
- package/dist/features/cart/components/ShippingPicker.d.ts +13 -0
- package/dist/features/cart/components/ShippingPicker.js +48 -0
- package/dist/features/cart/components/index.d.ts +3 -1
- package/dist/features/cart/components/index.js +1 -0
- package/dist/features/cart/hooks/useCartCount.js +7 -1
- package/dist/features/cart/repository/cart.repository.d.ts +1 -0
- package/dist/features/cart/repository/cart.repository.js +35 -0
- package/dist/features/cart/schemas/firestore.d.ts +27 -2
- package/dist/features/categories/components/BundleAddToCartCta.d.ts +16 -0
- package/dist/features/categories/components/BundleAddToCartCta.js +54 -0
- package/dist/features/categories/components/BundleBuyNowCta.d.ts +8 -0
- package/dist/features/categories/components/BundleBuyNowCta.js +37 -0
- package/dist/features/categories/components/BundleDetailView.d.ts +22 -0
- package/dist/features/categories/components/BundleDetailView.js +31 -0
- package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +18 -0
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +60 -0
- package/dist/features/categories/components/BundleItemsPicker.d.ts +26 -0
- package/dist/features/categories/components/BundleItemsPicker.js +135 -0
- package/dist/features/categories/components/BundlesListView.d.ts +13 -0
- package/dist/features/categories/components/BundlesListView.js +27 -0
- package/dist/features/categories/components/index.d.ts +12 -0
- package/dist/features/categories/components/index.js +9 -0
- package/dist/features/checkout/actions/checkout-actions.js +10 -3
- package/dist/features/events/components/AdminEventEditorView.js +108 -2
- package/dist/features/events/components/AdminEventsView.js +16 -4
- package/dist/features/events/components/EventCard.d.ts +4 -1
- package/dist/features/events/components/EventCard.js +7 -3
- package/dist/features/events/components/EventRaffleWinnerView.d.ts +21 -0
- package/dist/features/events/components/EventRaffleWinnerView.js +18 -0
- package/dist/features/events/components/SpinWheelView.d.ts +27 -0
- package/dist/features/events/components/SpinWheelView.js +64 -0
- package/dist/features/events/components/index.d.ts +4 -0
- package/dist/features/events/components/index.js +2 -0
- package/dist/features/events/schemas/firestore.d.ts +27 -1
- package/dist/features/events/schemas/firestore.js +7 -0
- package/dist/features/events/types/index.d.ts +27 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +16 -0
- package/dist/features/homepage/components/FeaturedBundlesSection.js +24 -0
- package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -1
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +2 -2
- package/dist/features/homepage/lib/section-renderer.d.ts +2 -0
- package/dist/features/homepage/lib/section-renderer.js +5 -5
- package/dist/features/layout/NavbarLayout.d.ts +3 -1
- package/dist/features/layout/NavbarLayout.js +32 -3
- package/dist/features/layout/TitleBarLayout.d.ts +6 -3
- package/dist/features/layout/TitleBarLayout.js +22 -7
- package/dist/features/media/upload/MediaUploadField.d.ts +15 -1
- package/dist/features/media/upload/MediaUploadField.js +22 -1
- package/dist/features/orders/components/MarketplaceOrderCard.js +4 -2
- package/dist/features/orders/components/OrderSiblingPayments.d.ts +8 -0
- package/dist/features/orders/components/OrderSiblingPayments.js +16 -0
- package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
- package/dist/features/orders/components/RefundHistoryTable.js +23 -0
- package/dist/features/orders/components/RefundRequestView.d.ts +8 -0
- package/dist/features/orders/components/RefundRequestView.js +42 -0
- package/dist/features/orders/components/index.d.ts +6 -0
- package/dist/features/orders/components/index.js +3 -0
- package/dist/features/orders/index.d.ts +1 -0
- package/dist/features/orders/index.js +2 -0
- package/dist/features/orders/repository/orders.repository.d.ts +20 -1
- package/dist/features/orders/repository/orders.repository.js +30 -1
- package/dist/features/orders/schemas/firestore.d.ts +63 -13
- package/dist/features/orders/schemas/firestore.js +5 -5
- package/dist/features/orders/schemas/index.d.ts +4 -4
- package/dist/features/orders/types/index.d.ts +12 -2
- package/dist/features/orders/utils/bundle-grouping.d.ts +48 -0
- package/dist/features/orders/utils/bundle-grouping.js +54 -0
- package/dist/features/orders/utils/order-splitter.d.ts +9 -10
- package/dist/features/orders/utils/order-splitter.js +24 -30
- package/dist/features/payments/repository/payout.repository.d.ts +17 -1
- package/dist/features/payments/repository/payout.repository.js +47 -0
- package/dist/features/payments/schemas/firestore.d.ts +26 -0
- package/dist/features/pre-orders/components/PreorderCard.d.ts +4 -1
- package/dist/features/pre-orders/components/PreorderCard.js +8 -6
- package/dist/features/products/actions/product-actions.d.ts +1 -1
- package/dist/features/products/actions/product-actions.js +1 -1
- package/dist/features/products/components/CompareOverlay.d.ts +2 -2
- package/dist/features/products/components/CompareOverlay.js +4 -4
- package/dist/features/products/components/InteractiveProductCard.js +7 -12
- package/dist/features/products/components/NonRefundableConsentModal.d.ts +1 -1
- package/dist/features/products/components/NonRefundableConsentModal.js +0 -10
- package/dist/features/products/components/ProductGrid.js +28 -12
- package/dist/features/products/components/ShowGroupSection.js +3 -3
- package/dist/features/products/components/SublistingCarouselSection.js +2 -2
- package/dist/features/products/components/index.d.ts +0 -4
- package/dist/features/products/components/index.js +5 -2
- package/dist/features/products/index.d.ts +1 -1
- package/dist/features/products/index.js +3 -1
- package/dist/features/products/repository/products.repository.js +4 -0
- package/dist/features/products/schemas/catalog-product.d.ts +70 -0
- package/dist/features/products/schemas/catalog-product.js +50 -0
- package/dist/features/products/schemas/firestore.d.ts +110 -2
- package/dist/features/products/schemas/firestore.js +30 -0
- package/dist/features/products/schemas/index.d.ts +8 -8
- package/dist/features/products/types/index.d.ts +1 -1
- package/dist/features/products/utils/listing-type.d.ts +9 -0
- package/dist/features/products/utils/listing-type.js +4 -0
- package/dist/features/promotions/actions/coupon-actions.d.ts +2 -2
- package/dist/features/promotions/actions/coupon-actions.js +1 -1
- package/dist/features/promotions/components/CouponCard.d.ts +28 -10
- package/dist/features/promotions/components/CouponCard.js +116 -14
- package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
- package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/search/types/index.d.ts +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +4 -5
- package/dist/features/seller/components/SellerBidsView.js +5 -13
- package/dist/features/seller/components/SellerCouponsView.js +31 -67
- package/dist/features/seller/components/SellerOffersView.js +4 -5
- package/dist/features/seller/components/SellerOrdersView.js +4 -5
- package/dist/features/seller/components/SellerPayoutsView.js +4 -5
- package/dist/features/seller/components/SellerProductsView.js +4 -8
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/stores/actions/store-address-actions.d.ts +10 -6
- package/dist/features/stores/actions/store-address-actions.js +8 -7
- package/dist/features/stores/components/InteractiveStoreCard.js +3 -10
- package/dist/features/stores/components/StoreDetailLayoutView.js +20 -5
- package/dist/features/stores/schemas/firestore.d.ts +45 -38
- package/dist/features/stores/schemas/firestore.js +2 -49
- package/dist/features/stores/server.d.ts +0 -1
- package/dist/features/stores/server.js +2 -1
- package/dist/features/wishlist/hooks/useWishlistCount.d.ts +7 -9
- package/dist/features/wishlist/hooks/useWishlistCount.js +67 -86
- package/dist/features/wishlist/types/index.d.ts +1 -1
- package/dist/index.d.ts +50 -9
- package/dist/index.js +57 -11
- package/dist/next/routing/route-map.d.ts +6 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/providers/db-firebase/admin.d.ts +6 -2
- package/dist/providers/db-firebase/admin.js +23 -0
- package/dist/repositories/index.d.ts +1 -2
- package/dist/repositories/index.js +5 -2
- package/dist/security/authorization.d.ts +2 -1
- package/dist/security/authorization.js +3 -2
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/bids-seed-data.d.ts +2 -2
- package/dist/seed/bids-seed-data.js +77 -2
- package/dist/seed/cart-seed-data.d.ts +10 -10
- package/dist/seed/cart-seed-data.js +15 -15
- package/dist/seed/events-seed-data.js +77 -0
- package/dist/seed/manifest.js +16 -8
- package/dist/seed/orders-seed-data.js +41 -2
- package/dist/seed/payouts-seed-data.js +18 -2
- package/dist/seed/stores-seed-data.js +55 -0
- package/dist/server-entry.d.ts +1 -0
- package/dist/server-entry.js +2 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +8 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/FilterChipGroup.d.ts +39 -0
- package/dist/ui/components/FilterChipGroup.js +15 -0
- package/dist/ui/components/HorizontalScroller.js +32 -7
- package/dist/ui/components/HorizontalScroller.style.css +6 -0
- package/dist/ui/components/SiteLogo.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/utils/id-generators.d.ts +11 -0
- package/dist/utils/id-generators.js +16 -0
- package/package.json +1 -1
- package/dist/_internal/shared/features/bundles/config.d.ts +0 -6
- package/dist/_internal/shared/features/bundles/config.js +0 -6
- package/dist/_internal/shared/schema-versions.d.ts +0 -76
- package/dist/_internal/shared/schema-versions.js +0 -82
- package/dist/features/account/migrations.d.ts +0 -2
- package/dist/features/account/migrations.js +0 -10
- package/dist/features/admin/migrations.d.ts +0 -2
- package/dist/features/admin/migrations.js +0 -10
- package/dist/features/auctions/migrations.d.ts +0 -2
- package/dist/features/auctions/migrations.js +0 -10
- package/dist/features/auth/migrations.d.ts +0 -2
- package/dist/features/auth/migrations.js +0 -10
- package/dist/features/blog/migrations.d.ts +0 -2
- package/dist/features/blog/migrations.js +0 -10
- package/dist/features/brands/actions/brand-actions.d.ts +0 -2
- package/dist/features/brands/actions/brand-actions.js +0 -5
- package/dist/features/brands/index.d.ts +0 -3
- package/dist/features/brands/index.js +0 -3
- package/dist/features/brands/migrations.d.ts +0 -2
- package/dist/features/brands/migrations.js +0 -10
- package/dist/features/brands/repository/brands.repository.d.ts +0 -13
- package/dist/features/brands/repository/brands.repository.js +0 -60
- package/dist/features/brands/schemas/index.d.ts +0 -33
- package/dist/features/brands/schemas/index.js +0 -15
- package/dist/features/brands/server.d.ts +0 -7
- package/dist/features/brands/server.js +0 -7
- package/dist/features/bundles/components/AdminBundleEditorView.d.ts +0 -8
- package/dist/features/bundles/components/AdminBundleEditorView.js +0 -7
- package/dist/features/bundles/components/BundleDetailPageView.d.ts +0 -9
- package/dist/features/bundles/components/BundleDetailPageView.js +0 -45
- package/dist/features/bundles/components/BundleForm.d.ts +0 -12
- package/dist/features/bundles/components/BundleForm.js +0 -126
- package/dist/features/bundles/components/BundleItemsPicker.d.ts +0 -9
- package/dist/features/bundles/components/BundleItemsPicker.js +0 -77
- package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +0 -6
- package/dist/features/bundles/components/BundlesByCategoryListing.js +0 -50
- package/dist/features/bundles/components/BundlesListingView.d.ts +0 -17
- package/dist/features/bundles/components/BundlesListingView.js +0 -50
- package/dist/features/bundles/components/FeaturedBundlesSection.d.ts +0 -5
- package/dist/features/bundles/components/FeaturedBundlesSection.js +0 -55
- package/dist/features/bundles/components/SellerBundleCreateView.d.ts +0 -8
- package/dist/features/bundles/components/SellerBundleCreateView.js +0 -7
- package/dist/features/bundles/components/SellerBundleEditView.d.ts +0 -9
- package/dist/features/bundles/components/SellerBundleEditView.js +0 -7
- package/dist/features/bundles/components/index.d.ts +0 -18
- package/dist/features/bundles/components/index.js +0 -9
- package/dist/features/bundles/constants/index.d.ts +0 -32
- package/dist/features/bundles/constants/index.js +0 -35
- package/dist/features/bundles/index.d.ts +0 -2
- package/dist/features/bundles/index.js +0 -2
- package/dist/features/bundles/migrations.d.ts +0 -2
- package/dist/features/bundles/migrations.js +0 -10
- package/dist/features/bundles/repository/bundles.repository.d.ts +0 -36
- package/dist/features/bundles/repository/bundles.repository.js +0 -148
- package/dist/features/bundles/repository/index.d.ts +0 -1
- package/dist/features/bundles/repository/index.js +0 -1
- package/dist/features/bundles/schemas/firestore.d.ts +0 -88
- package/dist/features/bundles/schemas/firestore.js +0 -29
- package/dist/features/bundles/schemas/zod.d.ts +0 -377
- package/dist/features/bundles/schemas/zod.js +0 -71
- package/dist/features/cart/migrations.d.ts +0 -2
- package/dist/features/cart/migrations.js +0 -10
- package/dist/features/categories/migrations.d.ts +0 -2
- package/dist/features/categories/migrations.js +0 -10
- package/dist/features/events/migrations.d.ts +0 -2
- package/dist/features/events/migrations.js +0 -10
- package/dist/features/faq/migrations.d.ts +0 -2
- package/dist/features/faq/migrations.js +0 -10
- package/dist/features/grouped/migrations.d.ts +0 -2
- package/dist/features/grouped/migrations.js +0 -10
- package/dist/features/history/migrations.d.ts +0 -2
- package/dist/features/history/migrations.js +0 -10
- package/dist/features/messages/migrations.d.ts +0 -2
- package/dist/features/messages/migrations.js +0 -10
- package/dist/features/orders/migrations.d.ts +0 -2
- package/dist/features/orders/migrations.js +0 -10
- package/dist/features/payments/migrations.d.ts +0 -2
- package/dist/features/payments/migrations.js +0 -10
- package/dist/features/products/migrations.d.ts +0 -2
- package/dist/features/products/migrations.js +0 -10
- package/dist/features/products/repository/sublisting-categories.repository.d.ts +0 -16
- package/dist/features/products/repository/sublisting-categories.repository.js +0 -126
- package/dist/features/products/schemas/sublisting-categories.d.ts +0 -45
- package/dist/features/products/schemas/sublisting-categories.js +0 -16
- package/dist/features/promotions/migrations.d.ts +0 -2
- package/dist/features/promotions/migrations.js +0 -10
- package/dist/features/reviews/migrations.d.ts +0 -2
- package/dist/features/reviews/migrations.js +0 -10
- package/dist/features/scams/migrations.d.ts +0 -2
- package/dist/features/scams/migrations.js +0 -10
- package/dist/features/seller/migrations.d.ts +0 -2
- package/dist/features/seller/migrations.js +0 -10
- package/dist/features/stores/migrations.d.ts +0 -2
- package/dist/features/stores/migrations.js +0 -10
- package/dist/features/sublisting/migrations.d.ts +0 -2
- package/dist/features/sublisting/migrations.js +0 -10
- package/dist/features/sublisting/schemas/firestore.d.ts +0 -32
- package/dist/features/sublisting/schemas/firestore.js +0 -19
- package/dist/features/support/migrations.d.ts +0 -2
- package/dist/features/support/migrations.js +0 -10
- package/dist/features/wishlist/migrations.d.ts +0 -2
- package/dist/features/wishlist/migrations.js +0 -10
- package/dist/seed/_bundle-constants.d.ts +0 -14
- package/dist/seed/_bundle-constants.js +0 -14
- package/dist/seed/anime-figures-seed-data.d.ts +0 -8
- package/dist/seed/anime-figures-seed-data.js +0 -1033
- package/dist/seed/beyblade-seed-data.d.ts +0 -7
- package/dist/seed/beyblade-seed-data.js +0 -1129
- package/dist/seed/brands-seed-data.d.ts +0 -7
- package/dist/seed/brands-seed-data.js +0 -410
- package/dist/seed/bundles-seed-data.d.ts +0 -13
- package/dist/seed/bundles-seed-data.js +0 -229
- package/dist/seed/cosplay-accessories-seed-data.d.ts +0 -8
- package/dist/seed/cosplay-accessories-seed-data.js +0 -647
- package/dist/seed/hot-wheels-seed-data.d.ts +0 -7
- package/dist/seed/hot-wheels-seed-data.js +0 -1612
- package/dist/seed/letitrip-official-seed-data.d.ts +0 -8
- package/dist/seed/letitrip-official-seed-data.js +0 -399
- package/dist/seed/pokemon-carousel-slides-seed-data.d.ts +0 -8
- package/dist/seed/pokemon-carousel-slides-seed-data.js +0 -322
- package/dist/seed/pokemon-categories-seed-data.d.ts +0 -24
- package/dist/seed/pokemon-categories-seed-data.js +0 -547
- package/dist/seed/pokemon-coupons-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-coupons-seed-data.js +0 -465
- package/dist/seed/pokemon-homepage-sections-seed-data.d.ts +0 -7
- package/dist/seed/pokemon-homepage-sections-seed-data.js +0 -241
- package/dist/seed/pokemon-products-seed-data.d.ts +0 -9
- package/dist/seed/pokemon-products-seed-data.js +0 -1791
- package/dist/seed/pokemon-seed-bundle.d.ts +0 -47
- package/dist/seed/pokemon-seed-bundle.js +0 -71
- package/dist/seed/pokemon-stores-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-stores-seed-data.js +0 -179
- package/dist/seed/pokemon-users-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-users-seed-data.js +0 -521
- package/dist/seed/products-seed-data.d.ts +0 -6
- package/dist/seed/products-seed-data.js +0 -2530
- package/dist/seed/retro-gaming-seed-data.d.ts +0 -8
- package/dist/seed/retro-gaming-seed-data.js +0 -801
- package/dist/seed/server.d.ts +0 -2
- package/dist/seed/server.js +0 -7
- package/dist/seed/sublisting-categories-seed-data.d.ts +0 -7
- package/dist/seed/sublisting-categories-seed-data.js +0 -159
- package/dist/seed/transformers-seed-data.d.ts +0 -7
- package/dist/seed/transformers-seed-data.js +0 -530
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action telemetry sink — SB-UNI-X5 2026-05-13.
|
|
3
|
+
*
|
|
4
|
+
* Pure-JS wrapper that Phase 7 (W-1 CTA registry) extends. Today the sink
|
|
5
|
+
* is a no-op in development and a structured-event emitter in production
|
|
6
|
+
* (writes to the `events` analytics stream OR an external sink configured
|
|
7
|
+
* via env). The Phase 7 `<Button action={...}>` extension calls
|
|
8
|
+
* `actionTracker.emit(action.id, ctx, success)` on click + outcome.
|
|
9
|
+
*
|
|
10
|
+
* Designed so a future telemetry consumer (Sentry, GA, custom) drops in by
|
|
11
|
+
* replacing the `sink` impl via `setActionTrackerSink`. Default sink is
|
|
12
|
+
* environment-aware:
|
|
13
|
+
* - SSR / Node + `NODE_ENV !== "production"` → console.debug
|
|
14
|
+
* - Browser + `NODE_ENV === "production"` → POST to /api/telemetry/actions
|
|
15
|
+
* (no-op when the endpoint isn't deployed yet — silently logs to console)
|
|
16
|
+
*
|
|
17
|
+
* Pattern 7 from the SB-UNI future-expansion plan.
|
|
18
|
+
*/
|
|
19
|
+
function defaultSink(event) {
|
|
20
|
+
if (typeof window === "undefined") {
|
|
21
|
+
// SSR / Node — best-effort console log; production servers can swap
|
|
22
|
+
// the sink to a real logger via `setActionTrackerSink`.
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
if (process.env.NODE_ENV !== "production") {
|
|
25
|
+
console.debug("[action-tracker]", event);
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// Browser. In production we'd POST to a telemetry endpoint when it's
|
|
30
|
+
// deployed; for now stay silent in prod to avoid 404 noise + dev-mode
|
|
31
|
+
// logs surface the events.
|
|
32
|
+
if (process.env.NODE_ENV !== "production") {
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.debug("[action-tracker]", event);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
let currentSink = defaultSink;
|
|
38
|
+
export const actionTracker = {
|
|
39
|
+
/**
|
|
40
|
+
* Emit an action event. Designed to be fire-and-forget — never throws,
|
|
41
|
+
* never blocks the caller. Consumers wrap critical paths in try/catch
|
|
42
|
+
* even though sinks must self-handle errors.
|
|
43
|
+
*/
|
|
44
|
+
emit(actionId, ctx, success) {
|
|
45
|
+
const event = {
|
|
46
|
+
actionId,
|
|
47
|
+
ctx,
|
|
48
|
+
success,
|
|
49
|
+
timestamp: new Date().toISOString(),
|
|
50
|
+
};
|
|
51
|
+
try {
|
|
52
|
+
const result = currentSink(event);
|
|
53
|
+
// Swallow promise rejections so the caller path is never affected.
|
|
54
|
+
if (result && typeof result.catch === "function") {
|
|
55
|
+
result.catch(() => { });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Intentionally swallowed — telemetry must never break callers.
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
/** Replace the default sink — useful for Sentry/GA/custom telemetry. */
|
|
64
|
+
export function setActionTrackerSink(sink) {
|
|
65
|
+
currentSink = sink;
|
|
66
|
+
}
|
|
67
|
+
/** Restore the default sink. Mostly for tests. */
|
|
68
|
+
export function resetActionTrackerSink() {
|
|
69
|
+
currentSink = defaultSink;
|
|
70
|
+
}
|
|
@@ -43,6 +43,31 @@ export const LISTING_TYPE_CAPABILITIES = {
|
|
|
43
43
|
requiresJurisdictionCheck: false,
|
|
44
44
|
hasInstantFulfillment: false,
|
|
45
45
|
},
|
|
46
|
+
// SB-UNI-F 2026-05-13 — Phase 2 union extension.
|
|
47
|
+
classified: {
|
|
48
|
+
canAddToCart: false, // chat-only (OLX / Facebook Marketplace pattern)
|
|
49
|
+
canBid: false,
|
|
50
|
+
supportsShipping: false, // local meetup; shipping is a "negotiable" flag, not a flow
|
|
51
|
+
requiresVendorVerified: false,
|
|
52
|
+
requiresJurisdictionCheck: false,
|
|
53
|
+
hasInstantFulfillment: false,
|
|
54
|
+
},
|
|
55
|
+
"digital-code": {
|
|
56
|
+
canAddToCart: true,
|
|
57
|
+
canBid: false,
|
|
58
|
+
supportsShipping: false, // codes delivered electronically — no address
|
|
59
|
+
requiresVendorVerified: false,
|
|
60
|
+
requiresJurisdictionCheck: false,
|
|
61
|
+
hasInstantFulfillment: true, // atomic code claim at order paid
|
|
62
|
+
},
|
|
63
|
+
live: {
|
|
64
|
+
canAddToCart: true, // but jurisdictionAllowed must include buyer's state
|
|
65
|
+
canBid: false,
|
|
66
|
+
supportsShipping: true, // physical, often via specialised carrier
|
|
67
|
+
requiresVendorVerified: true,
|
|
68
|
+
requiresJurisdictionCheck: true,
|
|
69
|
+
hasInstantFulfillment: false,
|
|
70
|
+
},
|
|
46
71
|
};
|
|
47
72
|
export function capabilityFor(type) {
|
|
48
73
|
return LISTING_TYPE_CAPABILITIES[type];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cart-level shipping-requirement helpers — SB-UNI-S 2026-05-13.
|
|
3
|
+
*
|
|
4
|
+
* Reads `supportsShipping` / `hasInstantFulfillment` / `canAddToCart` off
|
|
5
|
+
* the capability registry for every cart item and answers three questions:
|
|
6
|
+
*
|
|
7
|
+
* - `cartRequiresShipping(items)` — does ANY line need a shipping address?
|
|
8
|
+
* If true, the checkout flow MUST collect an address and the order
|
|
9
|
+
* record persists it. If false, the checkout flow can skip the address
|
|
10
|
+
* step entirely (digital-code-only carts).
|
|
11
|
+
*
|
|
12
|
+
* - `cartIsDigitalOnly(items)` — does EVERY line have
|
|
13
|
+
* `hasInstantFulfillment === true`? If true, the order detail page
|
|
14
|
+
* surfaces the reveal/claim flow inline and the buyer gets a digital
|
|
15
|
+
* receipt with no shipping tracking.
|
|
16
|
+
*
|
|
17
|
+
* - `cartIsChatOnly(items)` — does EVERY line have
|
|
18
|
+
* `canAddToCart === false`? Lets the cart UI surface "this product
|
|
19
|
+
* can only be reached via chat" when classified items somehow make it
|
|
20
|
+
* through (defence-in-depth — addToCart already rejects them).
|
|
21
|
+
*
|
|
22
|
+
* Used by both checkout server actions (skip address validation when
|
|
23
|
+
* `!cartRequiresShipping(items)`) and the cart/checkout UI (collapse the
|
|
24
|
+
* address-picker step in the same case).
|
|
25
|
+
*/
|
|
26
|
+
import type { ListingType } from "../../../features/products/types/index";
|
|
27
|
+
interface CartItemLike {
|
|
28
|
+
listingType?: ListingType;
|
|
29
|
+
}
|
|
30
|
+
/** True when AT LEAST ONE line in the cart needs a shipping address. */
|
|
31
|
+
export declare function cartRequiresShipping(items: CartItemLike[]): boolean;
|
|
32
|
+
/** True when EVERY line in the cart fulfills instantly (digital-code-only carts). */
|
|
33
|
+
export declare function cartIsDigitalOnly(items: CartItemLike[]): boolean;
|
|
34
|
+
/** True when EVERY line is chat-only (`canAddToCart === false`). Used to
|
|
35
|
+
* surface "this product can only be reached via chat" at the cart UI. */
|
|
36
|
+
export declare function cartIsChatOnly(items: CartItemLike[]): boolean;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cart-level shipping-requirement helpers — SB-UNI-S 2026-05-13.
|
|
3
|
+
*
|
|
4
|
+
* Reads `supportsShipping` / `hasInstantFulfillment` / `canAddToCart` off
|
|
5
|
+
* the capability registry for every cart item and answers three questions:
|
|
6
|
+
*
|
|
7
|
+
* - `cartRequiresShipping(items)` — does ANY line need a shipping address?
|
|
8
|
+
* If true, the checkout flow MUST collect an address and the order
|
|
9
|
+
* record persists it. If false, the checkout flow can skip the address
|
|
10
|
+
* step entirely (digital-code-only carts).
|
|
11
|
+
*
|
|
12
|
+
* - `cartIsDigitalOnly(items)` — does EVERY line have
|
|
13
|
+
* `hasInstantFulfillment === true`? If true, the order detail page
|
|
14
|
+
* surfaces the reveal/claim flow inline and the buyer gets a digital
|
|
15
|
+
* receipt with no shipping tracking.
|
|
16
|
+
*
|
|
17
|
+
* - `cartIsChatOnly(items)` — does EVERY line have
|
|
18
|
+
* `canAddToCart === false`? Lets the cart UI surface "this product
|
|
19
|
+
* can only be reached via chat" when classified items somehow make it
|
|
20
|
+
* through (defence-in-depth — addToCart already rejects them).
|
|
21
|
+
*
|
|
22
|
+
* Used by both checkout server actions (skip address validation when
|
|
23
|
+
* `!cartRequiresShipping(items)`) and the cart/checkout UI (collapse the
|
|
24
|
+
* address-picker step in the same case).
|
|
25
|
+
*/
|
|
26
|
+
import { capabilityFor } from "./capabilities";
|
|
27
|
+
function getCap(item) {
|
|
28
|
+
return capabilityFor(item.listingType ?? "standard");
|
|
29
|
+
}
|
|
30
|
+
/** True when AT LEAST ONE line in the cart needs a shipping address. */
|
|
31
|
+
export function cartRequiresShipping(items) {
|
|
32
|
+
return items.some((it) => getCap(it).supportsShipping);
|
|
33
|
+
}
|
|
34
|
+
/** True when EVERY line in the cart fulfills instantly (digital-code-only carts). */
|
|
35
|
+
export function cartIsDigitalOnly(items) {
|
|
36
|
+
if (items.length === 0)
|
|
37
|
+
return false;
|
|
38
|
+
return items.every((it) => getCap(it).hasInstantFulfillment);
|
|
39
|
+
}
|
|
40
|
+
/** True when EVERY line is chat-only (`canAddToCart === false`). Used to
|
|
41
|
+
* surface "this product can only be reached via chat" at the cart UI. */
|
|
42
|
+
export function cartIsChatOnly(items) {
|
|
43
|
+
if (items.length === 0)
|
|
44
|
+
return false;
|
|
45
|
+
return items.every((it) => !getCap(it).canAddToCart);
|
|
46
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
|
|
2
|
+
export const LISTING_TYPE = "classified";
|
|
3
|
+
export const capability = LISTING_TYPE_CAPABILITIES.classified;
|
|
4
|
+
export const config = {
|
|
5
|
+
listingType: LISTING_TYPE,
|
|
6
|
+
slugPrefix: "classified-",
|
|
7
|
+
cartLine: "blocked",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ctas: readonly string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
|
|
2
|
+
export const LISTING_TYPE = "digital-code";
|
|
3
|
+
export const capability = LISTING_TYPE_CAPABILITIES["digital-code"];
|
|
4
|
+
export const config = {
|
|
5
|
+
listingType: LISTING_TYPE,
|
|
6
|
+
slugPrefix: "digitalcode-",
|
|
7
|
+
cartLine: "single-product",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ctas: readonly string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing-type / category-type feature flag helpers — SB-UNI-X4 2026-05-13.
|
|
3
|
+
*
|
|
4
|
+
* Reads from `siteSettings.featureFlags.{listingTypes,categoryTypes}` and
|
|
5
|
+
* collapses missing fields to a "type is enabled" default. The capability
|
|
6
|
+
* registry decides what each type CAN do; these flags decide whether the
|
|
7
|
+
* site exposes the type at all.
|
|
8
|
+
*
|
|
9
|
+
* Consumer pattern:
|
|
10
|
+
* const settings = await siteSettingsRepository.findById("global");
|
|
11
|
+
* if (!isListingTypeEnabled("classified", settings)) return null;
|
|
12
|
+
*
|
|
13
|
+
* Future-expansion Pattern 5. Slots with Phase 7 (CTA registry consults the
|
|
14
|
+
* same flag to hide actions for disabled types).
|
|
15
|
+
*/
|
|
16
|
+
import type { ListingType } from "../../../features/products/types/index";
|
|
17
|
+
import type { CategoryType } from "../../../features/categories/types/index";
|
|
18
|
+
interface FeatureFlagSnapshot {
|
|
19
|
+
featureFlags?: {
|
|
20
|
+
listingTypes?: Partial<Record<ListingType, boolean>>;
|
|
21
|
+
categoryTypes?: Partial<Record<CategoryType, boolean>>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `true` when the type is missing from the flag map OR explicitly enabled.
|
|
26
|
+
* Defaulting to enabled keeps legacy data working — a flag has to be
|
|
27
|
+
* EXPLICITLY set to `false` to disable a type.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isListingTypeEnabled(type: ListingType, settings: FeatureFlagSnapshot | null | undefined): boolean;
|
|
30
|
+
export declare function isCategoryTypeEnabled(type: CategoryType, settings: FeatureFlagSnapshot | null | undefined): boolean;
|
|
31
|
+
/** Pull the full list of enabled listing types in canonical iteration order. */
|
|
32
|
+
export declare function enabledListingTypes(settings: FeatureFlagSnapshot | null | undefined): ListingType[];
|
|
33
|
+
export declare function enabledCategoryTypes(settings: FeatureFlagSnapshot | null | undefined): CategoryType[];
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing-type / category-type feature flag helpers — SB-UNI-X4 2026-05-13.
|
|
3
|
+
*
|
|
4
|
+
* Reads from `siteSettings.featureFlags.{listingTypes,categoryTypes}` and
|
|
5
|
+
* collapses missing fields to a "type is enabled" default. The capability
|
|
6
|
+
* registry decides what each type CAN do; these flags decide whether the
|
|
7
|
+
* site exposes the type at all.
|
|
8
|
+
*
|
|
9
|
+
* Consumer pattern:
|
|
10
|
+
* const settings = await siteSettingsRepository.findById("global");
|
|
11
|
+
* if (!isListingTypeEnabled("classified", settings)) return null;
|
|
12
|
+
*
|
|
13
|
+
* Future-expansion Pattern 5. Slots with Phase 7 (CTA registry consults the
|
|
14
|
+
* same flag to hide actions for disabled types).
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* `true` when the type is missing from the flag map OR explicitly enabled.
|
|
18
|
+
* Defaulting to enabled keeps legacy data working — a flag has to be
|
|
19
|
+
* EXPLICITLY set to `false` to disable a type.
|
|
20
|
+
*/
|
|
21
|
+
export function isListingTypeEnabled(type, settings) {
|
|
22
|
+
const flag = settings?.featureFlags?.listingTypes?.[type];
|
|
23
|
+
return flag !== false;
|
|
24
|
+
}
|
|
25
|
+
export function isCategoryTypeEnabled(type, settings) {
|
|
26
|
+
const flag = settings?.featureFlags?.categoryTypes?.[type];
|
|
27
|
+
return flag !== false;
|
|
28
|
+
}
|
|
29
|
+
/** Pull the full list of enabled listing types in canonical iteration order. */
|
|
30
|
+
export function enabledListingTypes(settings) {
|
|
31
|
+
const all = [
|
|
32
|
+
"standard",
|
|
33
|
+
"auction",
|
|
34
|
+
"pre-order",
|
|
35
|
+
"prize-draw",
|
|
36
|
+
"classified",
|
|
37
|
+
"digital-code",
|
|
38
|
+
"live",
|
|
39
|
+
];
|
|
40
|
+
return all.filter((t) => isListingTypeEnabled(t, settings));
|
|
41
|
+
}
|
|
42
|
+
export function enabledCategoryTypes(settings) {
|
|
43
|
+
const all = ["category", "sublisting", "brand", "bundle"];
|
|
44
|
+
return all.filter((t) => isCategoryTypeEnabled(t, settings));
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
|
|
2
|
+
export const LISTING_TYPE = "live";
|
|
3
|
+
export const capability = LISTING_TYPE_CAPABILITIES.live;
|
|
4
|
+
export const config = {
|
|
5
|
+
listingType: LISTING_TYPE,
|
|
6
|
+
slugPrefix: "live-",
|
|
7
|
+
cartLine: "single-product",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ctas: readonly string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -91,6 +91,14 @@ export const VIDEO_CONVERSION_HINTS = {
|
|
|
91
91
|
"video/mp2t": "M2TS/TS streams are not supported — please convert to MP4",
|
|
92
92
|
"video/x-flv": "FLV is not supported — please convert to MP4",
|
|
93
93
|
"video/x-ms-wmv": "WMV is not supported — please convert to MP4",
|
|
94
|
+
// SB-UNI-Z4 2026-05-13 — HEVC / H.265 + HEIC/HEIF preview hint. The bytes
|
|
95
|
+
// upload fine via the signed-URL flow; the issue is in-browser preview —
|
|
96
|
+
// most browsers can't decode HEVC inline without an OS codec license.
|
|
97
|
+
"video/hevc": "HEVC (H.265) video is accepted but doesn't preview in most browsers — please convert to MP4 (H.264) or WebM for in-browser playback",
|
|
98
|
+
"video/x-hevc": "HEVC (H.265) video is accepted but doesn't preview in most browsers — please convert to MP4 (H.264) or WebM for in-browser playback",
|
|
99
|
+
"video/H265": "HEVC (H.265) video is accepted but doesn't preview in most browsers — please convert to MP4 (H.264) or WebM for in-browser playback",
|
|
100
|
+
"image/heic": "HEIC image is accepted but doesn't preview in most browsers — please convert to JPEG or WebP for inline preview",
|
|
101
|
+
"image/heif": "HEIF image is accepted but doesn't preview in most browsers — please convert to JPEG or WebP for inline preview",
|
|
94
102
|
};
|
|
95
103
|
export function getConversionHint(mime) {
|
|
96
104
|
return VIDEO_CONVERSION_HINTS[mime] ?? null;
|
package/dist/client.d.ts
CHANGED
|
@@ -174,7 +174,12 @@ export { useHistory, useHistoryMergeOnLogin, getGuestHistory, trackGuestHistory,
|
|
|
174
174
|
export type { GuestHistoryItem, GuestHistoryType, UserHistoryItem, HistoryProductType, HistoryItemSnapshot, } from "./features/history/index";
|
|
175
175
|
export type { TrackArgs as TrackHistoryArgs } from "./features/history/hooks/useHistory";
|
|
176
176
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
|
|
177
|
-
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, } from "./features/products/utils/listing-type";
|
|
177
|
+
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, } from "./features/products/utils/listing-type";
|
|
178
|
+
export { isListingTypeEnabled, isCategoryTypeEnabled, enabledListingTypes, enabledCategoryTypes, } from "./_internal/shared/listing-types/feature-flags";
|
|
179
|
+
export { actionTracker, setActionTrackerSink, resetActionTrackerSink, type ActionEvent, type ActionTrackerSink, } from "./_internal/shared/listing-types/action-tracker";
|
|
180
|
+
export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
|
|
181
|
+
export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, type ActionDef, type ActionKind, type ActionResource, type ActionTree, type ActionConfirmation, } from "./_internal/shared/actions/action-registry";
|
|
182
|
+
export { isAdminUser, isSellerUser, isModeratorUser, isEmployeeUser, isBuyerUser, } from "./features/auth/role-predicates";
|
|
178
183
|
export { DashboardLayoutClient, RoleGuard } from "./_internal/client/features/layout/index";
|
|
179
184
|
export type { DashboardLayoutClientProps, RoleGuardProps, } from "./_internal/client/features/layout/index";
|
|
180
185
|
export type { LayoutBreakpoint, DashboardVariant, LayoutRole, SidebarNavItem, SidebarNavGroup, MainNavItem as LayoutMainNavItem, BrandingConfig, FooterConfig, SectionResponsive, SectionTheming, LayoutConfig, DashboardLayoutConfig, } from "./_internal/shared/features/layout/index";
|
package/dist/client.js
CHANGED
|
@@ -197,7 +197,20 @@ export { SCAM_PLATFORM_LABELS, ScamPlatformValues, } from "./features/scams/sche
|
|
|
197
197
|
export { useHistory, useHistoryMergeOnLogin, getGuestHistory, trackGuestHistory, removeGuestHistoryItem, clearGuestHistory, getGuestHistoryCount, HistoryTracker, } from "./features/history/index";
|
|
198
198
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
|
|
199
199
|
// SB1-G canonical listing-type accessors (pure functions, client-safe).
|
|
200
|
-
|
|
200
|
+
// SB-UNI-F 2026-05-13 — Phase 2 predicates surfaced through client barrel.
|
|
201
|
+
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, } from "./features/products/utils/listing-type";
|
|
202
|
+
// SB-UNI-X4 2026-05-13 — per-type feature-flag helpers (client-safe).
|
|
203
|
+
export { isListingTypeEnabled, isCategoryTypeEnabled, enabledListingTypes, enabledCategoryTypes, } from "./_internal/shared/listing-types/feature-flags";
|
|
204
|
+
// SB-UNI-X5 2026-05-13 — action telemetry sink (client-safe; defaults to
|
|
205
|
+
// a no-op + console.debug in dev).
|
|
206
|
+
export { actionTracker, setActionTrackerSink, resetActionTrackerSink, } from "./_internal/shared/listing-types/action-tracker";
|
|
207
|
+
// SB-UNI-S 2026-05-13 — cart-level shipping-requirement helpers (client-safe).
|
|
208
|
+
export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
|
|
209
|
+
// SB-UNI-W-1 2026-05-13 — CTA action registry shell (client-safe).
|
|
210
|
+
// Phase 7 W-2..W-4 sweeps fill the per-resource buckets surface by surface.
|
|
211
|
+
export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, } from "./_internal/shared/actions/action-registry";
|
|
212
|
+
// SB-UNI-E user-role predicates (pure functions, client-safe).
|
|
213
|
+
export { isAdminUser, isSellerUser, isModeratorUser, isEmployeeUser, isBuyerUser, } from "./features/auth/role-predicates";
|
|
201
214
|
// Layout feature — client islands (unifies admin/store/user dashboard layouts).
|
|
202
215
|
export { DashboardLayoutClient, RoleGuard } from "./_internal/client/features/layout/index";
|
|
203
216
|
// Listing-type capability registry — SB-UNI X1.
|
package/dist/configs/next.js
CHANGED
|
@@ -78,6 +78,13 @@ export function defineNextConfig(override = {}) {
|
|
|
78
78
|
"/api/**": [
|
|
79
79
|
"./node_modules/firebase-admin/lib/database/**",
|
|
80
80
|
"./node_modules/firebase-admin/lib/esm/database/**",
|
|
81
|
+
"./node_modules/firebase-admin/lib/firestore/**",
|
|
82
|
+
"./node_modules/firebase-admin/lib/esm/firestore/**",
|
|
83
|
+
"./node_modules/firebase-admin/lib/auth/**",
|
|
84
|
+
"./node_modules/firebase-admin/lib/esm/auth/**",
|
|
85
|
+
"./node_modules/firebase-admin/lib/app/**",
|
|
86
|
+
"./node_modules/firebase-admin/lib/esm/app/**",
|
|
87
|
+
"./node_modules/@google-cloud/firestore/build/src/**",
|
|
81
88
|
],
|
|
82
89
|
};
|
|
83
90
|
const mergedOutputFileTracingIncludes = {
|
|
@@ -89,6 +89,7 @@ export declare const ADMIN_ENDPOINTS: {
|
|
|
89
89
|
readonly EVENT_STATS: (id: string) => string;
|
|
90
90
|
readonly EVENT_ENTRIES: (id: string) => string;
|
|
91
91
|
readonly EVENT_ENTRY_BY_ID: (eventId: string, entryId: string) => string;
|
|
92
|
+
readonly EVENT_TRIGGER_RAFFLE: (id: string) => string;
|
|
92
93
|
readonly COUPONS: "/api/admin/coupons";
|
|
93
94
|
readonly COUPON_BY_ID: (id: string) => string;
|
|
94
95
|
readonly SECTIONS: "/api/admin/sections";
|
|
@@ -176,6 +177,7 @@ export declare const EVENT_ENDPOINTS: {
|
|
|
176
177
|
readonly BY_ID: (id: string) => string;
|
|
177
178
|
readonly ENTRIES: (id: string) => string;
|
|
178
179
|
readonly LEADERBOARD: (id: string, limit?: number) => string;
|
|
180
|
+
readonly SPIN: (id: string) => string;
|
|
179
181
|
};
|
|
180
182
|
export declare const FAQ_ENDPOINTS: {
|
|
181
183
|
readonly LIST: "/api/faqs";
|
|
@@ -362,6 +364,7 @@ export declare const API_ENDPOINTS: {
|
|
|
362
364
|
readonly EVENT_STATS: (id: string) => string;
|
|
363
365
|
readonly EVENT_ENTRIES: (id: string) => string;
|
|
364
366
|
readonly EVENT_ENTRY_BY_ID: (eventId: string, entryId: string) => string;
|
|
367
|
+
readonly EVENT_TRIGGER_RAFFLE: (id: string) => string;
|
|
365
368
|
readonly COUPONS: "/api/admin/coupons";
|
|
366
369
|
readonly COUPON_BY_ID: (id: string) => string;
|
|
367
370
|
readonly SECTIONS: "/api/admin/sections";
|
|
@@ -452,6 +455,7 @@ export declare const API_ENDPOINTS: {
|
|
|
452
455
|
readonly BY_ID: (id: string) => string;
|
|
453
456
|
readonly ENTRIES: (id: string) => string;
|
|
454
457
|
readonly LEADERBOARD: (id: string, limit?: number) => string;
|
|
458
|
+
readonly SPIN: (id: string) => string;
|
|
455
459
|
};
|
|
456
460
|
readonly FAQS: {
|
|
457
461
|
readonly LIST: "/api/faqs";
|
|
@@ -637,6 +641,7 @@ export declare const API_ROUTES: {
|
|
|
637
641
|
readonly EVENT_STATS: (id: string) => string;
|
|
638
642
|
readonly EVENT_ENTRIES: (id: string) => string;
|
|
639
643
|
readonly EVENT_ENTRY_BY_ID: (eventId: string, entryId: string) => string;
|
|
644
|
+
readonly EVENT_TRIGGER_RAFFLE: (id: string) => string;
|
|
640
645
|
readonly COUPONS: "/api/admin/coupons";
|
|
641
646
|
readonly COUPON_BY_ID: (id: string) => string;
|
|
642
647
|
readonly SECTIONS: "/api/admin/sections";
|
|
@@ -727,6 +732,7 @@ export declare const API_ROUTES: {
|
|
|
727
732
|
readonly BY_ID: (id: string) => string;
|
|
728
733
|
readonly ENTRIES: (id: string) => string;
|
|
729
734
|
readonly LEADERBOARD: (id: string, limit?: number) => string;
|
|
735
|
+
readonly SPIN: (id: string) => string;
|
|
730
736
|
};
|
|
731
737
|
readonly FAQS: {
|
|
732
738
|
readonly LIST: "/api/faqs";
|
|
@@ -107,6 +107,8 @@ export const ADMIN_ENDPOINTS = {
|
|
|
107
107
|
EVENT_STATS: (id) => `/api/admin/events/${id}/stats`,
|
|
108
108
|
EVENT_ENTRIES: (id) => `/api/admin/events/${id}/entries`,
|
|
109
109
|
EVENT_ENTRY_BY_ID: (eventId, entryId) => `/api/admin/events/${eventId}/entries/${entryId}`,
|
|
110
|
+
// SB9-D — admin manual raffle trigger
|
|
111
|
+
EVENT_TRIGGER_RAFFLE: (id) => `/api/admin/events/${id}/trigger-raffle`,
|
|
110
112
|
COUPONS: "/api/admin/coupons",
|
|
111
113
|
COUPON_BY_ID: (id) => `/api/admin/coupons/${id}`,
|
|
112
114
|
SECTIONS: "/api/admin/sections",
|
|
@@ -230,6 +232,8 @@ export const EVENT_ENDPOINTS = {
|
|
|
230
232
|
BY_ID: (id) => `/api/events/${id}`,
|
|
231
233
|
ENTRIES: (id) => `/api/events/${id}/entries`,
|
|
232
234
|
LEADERBOARD: (id, limit) => `/api/events/${id}/leaderboard${limit !== undefined ? `?limit=${limit}` : ""}`,
|
|
235
|
+
// SB9-E user spin assignment
|
|
236
|
+
SPIN: (id) => `/api/events/${id}/spin`,
|
|
233
237
|
};
|
|
234
238
|
// ---------------------------------------------------------------------------
|
|
235
239
|
// FAQ
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* The local store (guest-cart / guest-wishlist) is always the source of truth.
|
|
15
15
|
*/
|
|
16
16
|
import { useEffect, useRef } from "react";
|
|
17
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
17
18
|
import { apiClient } from "../../http";
|
|
18
19
|
import { getCartOps, clearCartOps, getWishlistOps, clearWishlistOps, } from "../../features/cart/utils/pending-ops";
|
|
19
20
|
const SYNC_INTERVAL_MS = 30000;
|
|
@@ -61,6 +62,7 @@ async function replayWishlistOps() {
|
|
|
61
62
|
}
|
|
62
63
|
export function useSyncManager(userId) {
|
|
63
64
|
const isSyncing = useRef(false);
|
|
65
|
+
const queryClient = useQueryClient();
|
|
64
66
|
useEffect(() => {
|
|
65
67
|
if (!userId)
|
|
66
68
|
return; // Guest — keep ops in queue, don't sync
|
|
@@ -69,7 +71,17 @@ export function useSyncManager(userId) {
|
|
|
69
71
|
return;
|
|
70
72
|
isSyncing.current = true;
|
|
71
73
|
try {
|
|
74
|
+
const hadCartOps = getCartOps().length > 0;
|
|
75
|
+
const hadWishlistOps = getWishlistOps().length > 0;
|
|
72
76
|
await Promise.all([replayCartOps(), replayWishlistOps()]);
|
|
77
|
+
if (hadCartOps) {
|
|
78
|
+
await queryClient.invalidateQueries({ queryKey: ["cart"] });
|
|
79
|
+
}
|
|
80
|
+
if (hadWishlistOps) {
|
|
81
|
+
await queryClient.invalidateQueries({
|
|
82
|
+
queryKey: ["wishlist", userId],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
73
85
|
}
|
|
74
86
|
finally {
|
|
75
87
|
isSyncing.current = false;
|
|
@@ -79,5 +91,5 @@ export function useSyncManager(userId) {
|
|
|
79
91
|
sync();
|
|
80
92
|
const id = setInterval(sync, SYNC_INTERVAL_MS);
|
|
81
93
|
return () => clearInterval(id);
|
|
82
|
-
}, [userId]);
|
|
94
|
+
}, [userId, queryClient]);
|
|
83
95
|
}
|
|
@@ -2,7 +2,7 @@ import type { Transaction, WriteBatch } from "firebase-admin/firestore";
|
|
|
2
2
|
export declare class UnitOfWork {
|
|
3
3
|
private get db();
|
|
4
4
|
get users(): import("..").UserRepository;
|
|
5
|
-
get addresses(): import("..").
|
|
5
|
+
get addresses(): import("..").AddressesRepository;
|
|
6
6
|
get tokens(): {
|
|
7
7
|
email: import("..").EmailVerificationTokenRepository;
|
|
8
8
|
password: import("..").PasswordResetTokenRepository;
|
|
@@ -3,7 +3,7 @@ const getAdminDb = () => module.require("../providers/db-firebase").getAdminDb()
|
|
|
3
3
|
import { DatabaseError } from "../errors";
|
|
4
4
|
import { serverLogger } from "../monitoring";
|
|
5
5
|
import { userRepository, tokenRepository, sessionRepository, } from "../features/auth/repository";
|
|
6
|
-
import {
|
|
6
|
+
import { addressesRepository } from "../features/addresses/repository/addresses.repository";
|
|
7
7
|
import { cartRepository } from "../features/cart/repository/cart.repository";
|
|
8
8
|
import { categoriesRepository } from "../features/categories/repository/categories.repository";
|
|
9
9
|
import { productRepository } from "../features/products/repository/products.repository";
|
|
@@ -27,7 +27,7 @@ export class UnitOfWork {
|
|
|
27
27
|
return userRepository;
|
|
28
28
|
}
|
|
29
29
|
get addresses() {
|
|
30
|
-
return
|
|
30
|
+
return addressesRepository;
|
|
31
31
|
}
|
|
32
32
|
get tokens() {
|
|
33
33
|
return tokenRepository;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddressCreateInput, AddressDocument, AddressUpdateInput } from "
|
|
1
|
+
import type { AddressCreateInput, AddressDocument, AddressUpdateInput } from "../../addresses/schemas";
|
|
2
2
|
export declare function createAddressForUser(userId: string, input: AddressCreateInput): Promise<AddressDocument>;
|
|
3
3
|
export declare function updateAddressForUser(userId: string, addressId: string, input: AddressUpdateInput): Promise<AddressDocument>;
|
|
4
4
|
export declare function deleteAddressForUser(userId: string, addressId: string): Promise<void>;
|