@mohasinac/appkit 2.7.59 → 2.8.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/filters/filter-load-options.d.ts +4 -5
- package/dist/_internal/server/features/auctions/og.js +8 -32
- package/dist/_internal/server/features/blog/og.js +10 -49
- package/dist/_internal/server/features/checkout/actions.js +6 -0
- package/dist/_internal/server/features/classified/og.js +9 -51
- package/dist/_internal/server/features/digital-code/actions.d.ts +11 -0
- package/dist/_internal/server/features/digital-code/actions.js +30 -0
- package/dist/_internal/server/features/digital-code/index.d.ts +1 -0
- package/dist/_internal/server/features/digital-code/index.js +1 -0
- package/dist/_internal/server/features/digital-code/og.js +9 -51
- package/dist/_internal/server/features/events/og.js +10 -49
- package/dist/_internal/server/features/item-requests/data.d.ts +17 -0
- package/dist/_internal/server/features/item-requests/data.js +20 -0
- package/dist/_internal/server/features/item-requests/index.d.ts +2 -0
- package/dist/_internal/server/features/item-requests/index.js +2 -0
- package/dist/_internal/server/features/item-requests/og.d.ts +40 -0
- package/dist/_internal/server/features/item-requests/og.js +136 -0
- package/dist/_internal/server/features/live/actions.d.ts +5 -0
- package/dist/_internal/server/features/live/actions.js +24 -0
- package/dist/_internal/server/features/live/index.d.ts +1 -0
- package/dist/_internal/server/features/live/index.js +1 -0
- package/dist/_internal/server/features/live/og.js +9 -51
- package/dist/_internal/server/features/media/contextGuards.js +19 -8
- package/dist/_internal/server/features/pre-orders/og.js +8 -32
- package/dist/_internal/server/features/prize-draws/data.d.ts +17 -0
- package/dist/_internal/server/features/prize-draws/data.js +20 -0
- package/dist/_internal/server/features/prize-draws/index.d.ts +2 -0
- package/dist/_internal/server/features/prize-draws/index.js +2 -0
- package/dist/_internal/server/features/prize-draws/og.d.ts +30 -0
- package/dist/_internal/server/features/prize-draws/og.js +50 -0
- package/dist/_internal/server/features/products/og.js +8 -33
- package/dist/_internal/server/features/seo/og-layout.d.ts +42 -0
- package/dist/_internal/server/features/seo/og-layout.js +69 -0
- package/dist/_internal/server/features/stores/og.js +8 -41
- package/dist/_internal/server/features/sublisting-categories/og.js +11 -42
- package/dist/client.d.ts +10 -6
- package/dist/client.js +7 -3
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/notification-types.d.ts +20 -0
- package/dist/constants/notification-types.js +37 -0
- package/dist/constants/pagination-presets.d.ts +39 -0
- package/dist/constants/pagination-presets.js +38 -0
- package/dist/errors/messages.d.ts +0 -4
- package/dist/errors/messages.js +0 -4
- package/dist/features/about/components/PublicProfileView.js +8 -8
- package/dist/features/account/components/UserOffersPanel.js +1 -1
- package/dist/features/account/components/UserSupportView.d.ts +1 -2
- package/dist/features/account/components/UserSupportView.js +9 -1
- package/dist/features/admin/actions/admin-actions.js +16 -1
- package/dist/features/admin/components/AdminAllEventEntriesView.d.ts +2 -3
- package/dist/features/admin/components/AdminAllEventEntriesView.js +50 -83
- package/dist/features/admin/components/AdminBidsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBidsView.js +64 -98
- package/dist/features/admin/components/AdminBlogView.d.ts +3 -7
- package/dist/features/admin/components/AdminBlogView.js +53 -83
- package/dist/features/admin/components/AdminBrandsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBrandsView.js +84 -83
- package/dist/features/admin/components/AdminBundlesView.js +82 -125
- package/dist/features/admin/components/AdminCarouselView.d.ts +2 -2
- package/dist/features/admin/components/AdminCarouselView.js +17 -52
- package/dist/features/admin/components/AdminCartsView.d.ts +2 -3
- package/dist/features/admin/components/AdminCartsView.js +39 -88
- package/dist/features/admin/components/AdminCategoriesView.d.ts +3 -3
- package/dist/features/admin/components/AdminCategoriesView.js +98 -92
- package/dist/features/admin/components/AdminCategoryEditorView.js +2 -2
- package/dist/features/admin/components/AdminClassifiedView.d.ts +3 -0
- package/dist/features/admin/components/AdminClassifiedView.js +44 -0
- package/dist/features/admin/components/AdminContactView.d.ts +2 -2
- package/dist/features/admin/components/AdminContactView.js +104 -111
- package/dist/features/admin/components/AdminCouponsView.d.ts +3 -6
- package/dist/features/admin/components/AdminCouponsView.js +66 -86
- package/dist/features/admin/components/AdminDigitalCodesView.d.ts +3 -0
- package/dist/features/admin/components/AdminDigitalCodesView.js +51 -0
- package/dist/features/admin/components/AdminFaqsView.d.ts +4 -4
- package/dist/features/admin/components/AdminFaqsView.js +77 -33
- package/dist/features/admin/components/AdminFeaturesView.d.ts +2 -3
- package/dist/features/admin/components/AdminFeaturesView.js +57 -70
- package/dist/features/admin/components/AdminGroupedListingsView.d.ts +3 -0
- package/dist/features/admin/components/AdminGroupedListingsView.js +43 -0
- package/dist/features/admin/components/AdminHistoryView.d.ts +2 -3
- package/dist/features/admin/components/AdminHistoryView.js +35 -52
- package/dist/features/admin/components/AdminListingScaffold.d.ts +2 -2
- package/dist/features/admin/components/AdminListingScaffold.js +3 -3
- package/dist/features/admin/components/AdminLiveView.d.ts +3 -0
- package/dist/features/admin/components/AdminLiveView.js +50 -0
- package/dist/features/admin/components/AdminNewsletterView.d.ts +2 -2
- package/dist/features/admin/components/AdminNewsletterView.js +67 -97
- package/dist/features/admin/components/AdminNotificationsView.d.ts +2 -3
- package/dist/features/admin/components/AdminNotificationsView.js +67 -93
- package/dist/features/admin/components/AdminOrderEditorView.js +10 -10
- package/dist/features/admin/components/AdminOrdersView.d.ts +2 -3
- package/dist/features/admin/components/AdminOrdersView.js +93 -107
- package/dist/features/admin/components/AdminPayoutsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPayoutsView.js +51 -91
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.js +39 -76
- package/dist/features/admin/components/AdminProductEditorView.js +3 -3
- package/dist/features/admin/components/AdminProductsView.d.ts +4 -4
- package/dist/features/admin/components/AdminProductsView.js +167 -163
- package/dist/features/admin/components/AdminReturnRequestsView.d.ts +1 -1
- package/dist/features/admin/components/AdminReturnRequestsView.js +64 -66
- package/dist/features/admin/components/AdminReviewsView.d.ts +3 -7
- package/dist/features/admin/components/AdminReviewsView.js +94 -110
- package/dist/features/admin/components/AdminScammersView.d.ts +2 -3
- package/dist/features/admin/components/AdminScammersView.js +53 -97
- package/dist/features/admin/components/AdminSectionsView.js +1 -1
- package/dist/features/admin/components/AdminSessionsView.d.ts +2 -3
- package/dist/features/admin/components/AdminSessionsView.js +62 -89
- package/dist/features/admin/components/AdminSiteSettingsView.js +4 -5
- package/dist/features/admin/components/AdminStoreAddressesView.d.ts +1 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +39 -53
- package/dist/features/admin/components/AdminStoreEditorView.js +21 -8
- package/dist/features/admin/components/AdminStoresView.d.ts +2 -3
- package/dist/features/admin/components/AdminStoresView.js +67 -99
- package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +1 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +28 -44
- package/dist/features/admin/components/AdminSupportTicketDetailView.d.ts +10 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +191 -5
- package/dist/features/admin/components/AdminSupportTicketsView.d.ts +2 -3
- package/dist/features/admin/components/AdminSupportTicketsView.js +65 -96
- package/dist/features/admin/components/AdminTeamView.d.ts +2 -2
- package/dist/features/admin/components/AdminTeamView.js +40 -74
- package/dist/features/admin/components/AdminUserEditorView.d.ts +11 -1
- package/dist/features/admin/components/AdminUserEditorView.js +77 -7
- package/dist/features/admin/components/AdminUsersView.d.ts +2 -3
- package/dist/features/admin/components/AdminUsersView.js +108 -100
- package/dist/features/admin/components/AdminViewCards.d.ts +1 -1
- package/dist/features/admin/components/AdminViewCards.js +15 -15
- package/dist/features/admin/components/AdminWishlistsView.d.ts +2 -3
- package/dist/features/admin/components/AdminWishlistsView.js +36 -62
- package/dist/features/admin/components/DataListingView.d.ts +122 -0
- package/dist/features/admin/components/DataListingView.js +66 -0
- package/dist/features/admin/components/index.d.ts +10 -4
- package/dist/features/admin/components/index.js +6 -2
- package/dist/features/admin/constants/filter-tabs.d.ts +23 -17
- package/dist/features/admin/constants/filter-tabs.js +21 -17
- package/dist/features/admin/hooks/useAdminListing.d.ts +1 -0
- package/dist/features/admin/hooks/useAdminListing.js +1 -1
- package/dist/features/admin/schemas/firestore.js +6 -7
- package/dist/features/auctions/server.d.ts +0 -1
- package/dist/features/auctions/server.js +0 -1
- package/dist/features/auth/actions/realtime-token-actions.js +1 -1
- package/dist/features/auth/repository/user.repository.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -0
- package/dist/features/cart/repository/cart.repository.d.ts +4 -1
- package/dist/features/cart/repository/cart.repository.js +12 -0
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -2
- package/dist/features/checkout/index.d.ts +1 -1
- package/dist/features/events/components/AdminEventEditorView.js +10 -13
- package/dist/features/events/components/AdminEventsView.d.ts +3 -3
- package/dist/features/events/components/AdminEventsView.js +50 -86
- package/dist/features/events/components/EventCard.js +1 -0
- package/dist/features/events/components/EventOfferCard.d.ts +19 -0
- package/dist/features/events/components/EventOfferCard.js +29 -0
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +25 -0
- package/dist/features/events/components/EventRaffleEntryForm.js +37 -0
- package/dist/features/events/components/EventRafflesSection.d.ts +1 -4
- package/dist/features/events/components/EventRafflesSection.js +17 -6
- package/dist/features/events/components/EventSaleBanner.d.ts +21 -0
- package/dist/features/events/components/EventSaleBanner.js +18 -0
- package/dist/features/events/components/index.d.ts +6 -0
- package/dist/features/events/components/index.js +4 -0
- package/dist/features/events/repository/event-entry.repository.d.ts +5 -0
- package/dist/features/events/repository/event-entry.repository.js +7 -0
- package/dist/features/faq/components/FAQPageContent.js +1 -0
- package/dist/features/filters/AsyncFacetSection.d.ts +1 -1
- package/dist/features/homepage/components/AdvertisementBanner.js +6 -6
- package/dist/features/homepage/components/FAQSection.d.ts +0 -5
- package/dist/features/homepage/components/HomepageSkeleton.js +2 -2
- package/dist/features/homepage/components/WelcomeSection.js +3 -3
- package/dist/features/homepage/lib/live-stats.js +1 -1
- package/dist/features/homepage/schemas/firestore.d.ts +0 -2
- package/dist/features/layout/TitleBar.js +1 -0
- package/dist/features/layout/index.d.ts +0 -2
- package/dist/features/layout/index.js +0 -1
- package/dist/features/pre-orders/server.d.ts +0 -1
- package/dist/features/pre-orders/server.js +0 -1
- package/dist/features/products/components/GroupSettingsPanel.js +2 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
- package/dist/features/products/components/PrizeDrawsSection.d.ts +1 -4
- package/dist/features/products/components/PrizeDrawsSection.js +17 -6
- package/dist/features/products/components/PrizeRevealModal.js +1 -1
- package/dist/features/products/components/ProductCardMetadataSection.d.ts +11 -0
- package/dist/features/products/components/ProductCardMetadataSection.js +25 -0
- package/dist/features/products/components/ProductDetailPageView.js +3 -1
- package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
- package/dist/features/products/components/ProductGradingTab.d.ts +13 -0
- package/dist/features/products/components/ProductGradingTab.js +25 -0
- package/dist/features/products/components/ProductGrid.js +15 -2
- package/dist/features/products/components/ProductTabsShell.d.ts +5 -1
- package/dist/features/products/components/ProductTabsShell.js +6 -1
- package/dist/features/products/components/index.d.ts +4 -0
- package/dist/features/products/components/index.js +3 -0
- package/dist/features/products/constants/action-defs.d.ts +5 -0
- package/dist/features/products/constants/action-defs.js +52 -32
- package/dist/features/products/constants/sieve.d.ts +24 -4
- package/dist/features/products/constants/sieve.js +20 -11
- package/dist/features/products/schemas/firestore.d.ts +17 -0
- package/dist/features/products/schemas/product-features.validators.d.ts +2 -2
- package/dist/features/products/schemas/product-templates.d.ts +2 -4
- package/dist/features/products/types/index.d.ts +4 -0
- package/dist/features/promotions/components/CouponsIndexListing.js +4 -4
- package/dist/features/promotions/server.d.ts +0 -1
- package/dist/features/promotions/server.js +0 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -3
- package/dist/features/search/api/route.js +44 -1
- package/dist/features/search/components/Search.js +2 -0
- package/dist/features/search/hooks/useNavSuggestions.d.ts +5 -1
- package/dist/features/search/hooks/useNavSuggestions.js +31 -4
- package/dist/features/seller/components/BrandInlineSelect.js +2 -2
- package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
- package/dist/features/seller/components/SellerAddressesView.js +4 -5
- package/dist/features/seller/components/SellerAuctionsView.d.ts +3 -3
- package/dist/features/seller/components/SellerAuctionsView.js +60 -90
- package/dist/features/seller/components/SellerBidsView.js +1 -1
- package/dist/features/seller/components/SellerBundlesView.js +64 -89
- package/dist/features/seller/components/SellerClassifiedView.js +67 -90
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
- package/dist/features/seller/components/SellerCouponsView.d.ts +2 -2
- package/dist/features/seller/components/SellerCouponsView.js +45 -84
- package/dist/features/seller/components/SellerDigitalCodesView.js +63 -88
- package/dist/features/seller/components/SellerGroupedListingsView.js +33 -49
- package/dist/features/seller/components/SellerLiveView.js +63 -84
- package/dist/features/seller/components/SellerOffersPanel.js +1 -1
- package/dist/features/seller/components/SellerOffersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOffersView.js +37 -69
- package/dist/features/seller/components/SellerOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +4 -4
- package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
- package/dist/features/seller/components/SellerPayoutsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPayoutsView.js +34 -68
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerPreOrdersView.js +49 -82
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPrizeDrawsView.js +49 -82
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -2
- package/dist/features/seller/components/SellerProductsView.js +15 -10
- package/dist/features/seller/components/SellerShippingConfigsView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.d.ts +0 -4
- package/dist/features/seller/components/SellerSidebar.js +0 -2
- package/dist/features/seller/components/SellerStoreCategoriesView.js +1 -1
- package/dist/features/seller/components/SellerTemplatesView.js +2 -2
- package/dist/features/seller/components/SellersListView.d.ts +1 -2
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.d.ts +5 -0
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.js +2 -8
- package/dist/features/seller/components/index.d.ts +0 -3
- package/dist/features/seller/components/index.js +0 -2
- package/dist/features/seller/server.d.ts +0 -1
- package/dist/features/seller/server.js +0 -1
- package/dist/features/shell/FormShell.d.ts +1 -1
- package/dist/features/shell/FormShell.js +7 -4
- package/dist/features/shell/field-groups/ImageFieldGroup.d.ts +18 -0
- package/dist/features/shell/field-groups/ImageFieldGroup.js +15 -0
- package/dist/features/shell/field-groups/SeoFieldGroup.d.ts +22 -0
- package/dist/features/shell/field-groups/SeoFieldGroup.js +16 -0
- package/dist/features/shell/field-groups/StatusFieldGroup.d.ts +35 -0
- package/dist/features/shell/field-groups/StatusFieldGroup.js +16 -0
- package/dist/features/shell/field-groups/TitleDescriptionGroup.d.ts +40 -0
- package/dist/features/shell/field-groups/TitleDescriptionGroup.js +16 -0
- package/dist/features/shell/field-groups/index.d.ts +13 -0
- package/dist/features/shell/field-groups/index.js +9 -0
- package/dist/features/shell/index.d.ts +2 -0
- package/dist/features/shell/index.js +1 -0
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreHeader.js +2 -1
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreScopedSearch.d.ts +16 -0
- package/dist/features/stores/components/StoreScopedSearch.js +27 -0
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +1 -2
- package/dist/features/stores/server.d.ts +0 -1
- package/dist/features/stores/server.js +0 -1
- package/dist/features/support/schemas/firestore.d.ts +22 -1
- package/dist/features/support/schemas/firestore.js +10 -0
- package/dist/features/wishlist/server.d.ts +0 -1
- package/dist/features/wishlist/server.js +0 -1
- package/dist/index.d.ts +9 -27
- package/dist/index.js +14 -50
- package/dist/next/routing/route-map.d.ts +8 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/react/hooks/useListingTypeFlags.d.ts +32 -0
- package/dist/react/hooks/useListingTypeFlags.js +19 -0
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/pii-redact.d.ts +8 -0
- package/dist/security/pii-redact.js +10 -1
- package/dist/seed/grouped-listings-seed-data.d.ts +4 -0
- package/dist/seed/products-preorders-seed-data.d.ts +4 -0
- package/dist/seed/products-prize-draws-seed-data.js +3 -0
- package/dist/seed/site-settings-seed-data.js +5 -5
- package/dist/seed/sub-listings-seed-data.d.ts +4 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +4 -0
- package/dist/styles.css +54 -395
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/BaseListingCard.d.ts +10 -0
- package/dist/ui/components/BaseListingCard.js +17 -1
- package/dist/ui/components/DetailPageGallery.d.ts +32 -0
- package/dist/ui/components/DetailPageGallery.js +47 -0
- package/dist/ui/components/DetailPageHero.d.ts +30 -0
- package/dist/ui/components/DetailPageHero.js +22 -0
- package/dist/ui/components/DetailPageTabs.d.ts +34 -0
- package/dist/ui/components/DetailPageTabs.js +38 -0
- package/dist/ui/components/HorizontalScroller.style.css +15 -2
- package/dist/ui/components/ListingLayout.d.ts +11 -2
- package/dist/ui/components/ListingLayout.js +12 -6
- package/dist/ui/components/PaginatedSelect.d.ts +66 -0
- package/dist/ui/components/PaginatedSelect.js +201 -0
- package/dist/ui/components/PaginatedSelect.style.css +254 -0
- package/dist/ui/components/Semantic.d.ts +0 -4
- package/dist/ui/components/Semantic.js +0 -2
- package/dist/ui/components/SettingsSection.d.ts +47 -0
- package/dist/ui/components/SettingsSection.js +38 -0
- package/dist/ui/components/index.style.css +1 -4
- package/dist/ui/index.d.ts +12 -14
- package/dist/ui/index.js +6 -7
- package/dist/utils/id-generators.d.ts +1 -18
- package/dist/utils/id-generators.js +51 -18
- package/dist/validation/schemas.d.ts +25 -0
- package/dist/validation/schemas.js +28 -0
- package/package.json +1 -1
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
* filter-load-options.ts
|
|
3
3
|
*
|
|
4
4
|
* Factory functions that return `loadOptions(query, page)` callbacks for use
|
|
5
|
-
* with AsyncFacetSection
|
|
6
|
-
*
|
|
7
|
-
* response to { items: DynamicSelectOption[], hasMore: boolean }.
|
|
5
|
+
* with AsyncFacetSection and PaginatedSelect. Each factory hits a paginated API
|
|
6
|
+
* endpoint and maps the response to { items: PaginatedSelectOption[], hasMore: boolean }.
|
|
8
7
|
*
|
|
9
8
|
* Usage:
|
|
10
9
|
* const load = makeCategoryLoadOptions();
|
|
11
10
|
* <AsyncFacetSection loadOptions={load} ... />
|
|
12
11
|
*/
|
|
13
|
-
import type {
|
|
12
|
+
import type { PaginatedSelectOption, AsyncPage } from "../../../../ui/components/PaginatedSelect";
|
|
14
13
|
import type { FacetOption } from "../../../../features/filters/FilterFacetSection";
|
|
15
|
-
export type LoadOptionsFn<T =
|
|
14
|
+
export type LoadOptionsFn<T = PaginatedSelectOption> = (query: string, page: number) => Promise<AsyncPage<T>>;
|
|
16
15
|
/**
|
|
17
16
|
* Returns a loadOptions function for categories.
|
|
18
17
|
* @param variant "admin" uses /api/admin/categories; "public" uses /api/categories.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
/** High-level OG renderer — accepts the raw auction document from `getAuctionForDetail`. */
|
|
4
4
|
export function renderAuctionOg(doc, opts) {
|
|
@@ -18,35 +18,11 @@ export function renderAuctionOg(doc, opts) {
|
|
|
18
18
|
}, opts.siteName);
|
|
19
19
|
}
|
|
20
20
|
export function renderAuctionOgImage(data, siteName) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
position: "relative",
|
|
29
|
-
overflow: "hidden",
|
|
30
|
-
}, children: [imageUrl && (_jsx("img", { src: imageUrl, alt: "", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.15 } })), _jsx("div", { style: {
|
|
31
|
-
position: "absolute",
|
|
32
|
-
inset: 0,
|
|
33
|
-
background: "linear-gradient(135deg, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.8) 100%)",
|
|
34
|
-
} }), _jsxs("div", { style: {
|
|
35
|
-
position: "relative",
|
|
36
|
-
display: "flex",
|
|
37
|
-
width: "100%",
|
|
38
|
-
height: "100%",
|
|
39
|
-
padding: "60px",
|
|
40
|
-
gap: "48px",
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
}, children: [imageUrl && (_jsx("img", { src: imageUrl, alt: title, style: { width: 420, height: 420, objectFit: "contain", borderRadius: 16, flexShrink: 0 } })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 24, flex: 1 }, children: [_jsxs("div", { style: { fontSize: 20, color: "#f59e0b", fontWeight: 600, letterSpacing: 2, textTransform: "uppercase" }, children: [siteName, " \u00B7 Live Auction"] }), _jsx("div", { style: {
|
|
43
|
-
fontSize: imageUrl ? 44 : 56,
|
|
44
|
-
fontWeight: 700,
|
|
45
|
-
color: "#f1f5f9",
|
|
46
|
-
lineHeight: 1.2,
|
|
47
|
-
display: "-webkit-box",
|
|
48
|
-
WebkitLineClamp: 3,
|
|
49
|
-
WebkitBoxOrient: "vertical",
|
|
50
|
-
overflow: "hidden",
|
|
51
|
-
}, children: title }), endsLabel && (_jsx("div", { style: { fontSize: 28, fontWeight: 600, color: "#f59e0b" }, children: endsLabel }))] })] })] }));
|
|
21
|
+
return renderOgLayout({
|
|
22
|
+
title: data.title,
|
|
23
|
+
imageUrl: data.imageUrl,
|
|
24
|
+
siteName: `${siteName} · Live Auction`,
|
|
25
|
+
accentSlot: data.endsLabel,
|
|
26
|
+
theme: { accentColor: "#f59e0b" },
|
|
27
|
+
});
|
|
52
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
/** High-level OG renderer — accepts the raw blog post document from `getBlogPostForDetail`. */
|
|
4
4
|
export function renderBlogOg(doc, opts) {
|
|
@@ -14,52 +14,13 @@ export function renderBlogOg(doc, opts) {
|
|
|
14
14
|
}, opts.siteName);
|
|
15
15
|
}
|
|
16
16
|
export function renderBlogOgImage(data, siteName) {
|
|
17
|
-
const
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, children: [coverImage && (_jsx("img", { src: coverImage, alt: "", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.12 } })), _jsx("div", { style: {
|
|
27
|
-
position: "absolute",
|
|
28
|
-
inset: 0,
|
|
29
|
-
background: "linear-gradient(135deg, rgba(15,23,42,0.97) 0%, rgba(15,23,42,0.82) 100%)",
|
|
30
|
-
} }), _jsxs("div", { style: {
|
|
31
|
-
position: "relative",
|
|
32
|
-
display: "flex",
|
|
33
|
-
width: "100%",
|
|
34
|
-
height: "100%",
|
|
35
|
-
padding: "60px",
|
|
36
|
-
gap: "48px",
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
}, children: [coverImage && (_jsx("img", { src: coverImage, alt: title, style: { width: 360, height: 360, objectFit: "cover", borderRadius: 16, flexShrink: 0 } })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20, flex: 1 }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [_jsxs("div", { style: { fontSize: 16, color: "#34d399", fontWeight: 600, letterSpacing: 2, textTransform: "uppercase" }, children: [siteName, " \u00B7 Blog"] }), category && (_jsx("div", { style: {
|
|
39
|
-
fontSize: 13,
|
|
40
|
-
color: "#6ee7b7",
|
|
41
|
-
fontWeight: 500,
|
|
42
|
-
letterSpacing: 1,
|
|
43
|
-
textTransform: "uppercase",
|
|
44
|
-
background: "rgba(52,211,153,0.12)",
|
|
45
|
-
padding: "3px 10px",
|
|
46
|
-
borderRadius: 100,
|
|
47
|
-
}, children: category }))] }), _jsx("div", { style: {
|
|
48
|
-
fontSize: coverImage ? 44 : 56,
|
|
49
|
-
fontWeight: 700,
|
|
50
|
-
color: "#f1f5f9",
|
|
51
|
-
lineHeight: 1.2,
|
|
52
|
-
display: "-webkit-box",
|
|
53
|
-
WebkitLineClamp: 3,
|
|
54
|
-
WebkitBoxOrient: "vertical",
|
|
55
|
-
overflow: "hidden",
|
|
56
|
-
}, children: title }), excerpt && (_jsx("div", { style: {
|
|
57
|
-
fontSize: 22,
|
|
58
|
-
color: "#94a3b8",
|
|
59
|
-
lineHeight: 1.45,
|
|
60
|
-
display: "-webkit-box",
|
|
61
|
-
WebkitLineClamp: 2,
|
|
62
|
-
WebkitBoxOrient: "vertical",
|
|
63
|
-
overflow: "hidden",
|
|
64
|
-
}, children: excerpt })), authorName && (_jsxs("div", { style: { fontSize: 18, color: "#64748b", fontWeight: 500, marginTop: 4 }, children: ["By ", authorName] }))] })] })] }));
|
|
17
|
+
const sublines = [data.excerpt, data.authorName ? `By ${data.authorName}` : null].filter(Boolean);
|
|
18
|
+
return renderOgLayout({
|
|
19
|
+
title: data.title,
|
|
20
|
+
subtitle: sublines.length > 0 ? sublines.join(" · ") : undefined,
|
|
21
|
+
imageUrl: data.coverImage,
|
|
22
|
+
siteName: `${siteName} · Blog`,
|
|
23
|
+
badges: data.category ? [data.category] : undefined,
|
|
24
|
+
theme: { accentColor: "#34d399" },
|
|
25
|
+
});
|
|
65
26
|
}
|
|
@@ -182,6 +182,12 @@ export async function createCheckoutOrderAction(input) {
|
|
|
182
182
|
const { userId: uid, userName, userEmail, addressId, paymentMethod, notes, excludedProductIds = [], adminBypass = false, adminBypassBy, } = input;
|
|
183
183
|
const siteSettings = await siteSettingsRepository.getSingleton();
|
|
184
184
|
const commissions = siteSettings?.commissions ?? CHECKOUT_DEFAULT_COMMISSIONS;
|
|
185
|
+
// W1-43 — enforce COD toggle. Admin bypass + non-COD payments still flow through.
|
|
186
|
+
if (!adminBypass &&
|
|
187
|
+
paymentMethod === "cod" &&
|
|
188
|
+
siteSettings?.payment?.codEnabled === false) {
|
|
189
|
+
throw new ValidationError("Cash on Delivery is not currently accepted. Please choose another payment method.");
|
|
190
|
+
}
|
|
185
191
|
const cart = await unitOfWork.carts.getOrCreate(uid);
|
|
186
192
|
if (!cart.items || cart.items.length === 0) {
|
|
187
193
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.CART_EMPTY);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
export function renderClassifiedOg(doc, opts) {
|
|
4
4
|
const meta = doc?.classified;
|
|
@@ -20,56 +20,14 @@ export function renderClassifiedOg(doc, opts) {
|
|
|
20
20
|
}, opts.siteName);
|
|
21
21
|
}
|
|
22
22
|
export function renderClassifiedOgImage(data, siteName) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
overflow: "hidden",
|
|
32
|
-
}, children: [imageUrl && (_jsx("img", { src: imageUrl, alt: "", style: {
|
|
33
|
-
position: "absolute",
|
|
34
|
-
inset: 0,
|
|
35
|
-
width: "100%",
|
|
36
|
-
height: "100%",
|
|
37
|
-
objectFit: "cover",
|
|
38
|
-
opacity: 0.12,
|
|
39
|
-
} })), _jsx("div", { style: {
|
|
40
|
-
position: "absolute",
|
|
41
|
-
inset: 0,
|
|
42
|
-
background: "linear-gradient(135deg, rgba(15,23,42,0.96) 0%, rgba(15,23,42,0.82) 100%)",
|
|
43
|
-
} }), _jsxs("div", { style: {
|
|
44
|
-
position: "relative",
|
|
45
|
-
display: "flex",
|
|
46
|
-
width: "100%",
|
|
47
|
-
height: "100%",
|
|
48
|
-
padding: "60px",
|
|
49
|
-
gap: "48px",
|
|
50
|
-
alignItems: "center",
|
|
51
|
-
}, children: [imageUrl && (_jsx("img", { src: imageUrl, alt: title, style: {
|
|
52
|
-
width: 400,
|
|
53
|
-
height: 400,
|
|
54
|
-
objectFit: "contain",
|
|
55
|
-
borderRadius: 16,
|
|
56
|
-
flexShrink: 0,
|
|
57
|
-
} })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20, flex: 1 }, children: [_jsxs("div", { style: {
|
|
58
|
-
fontSize: 18,
|
|
59
|
-
color: "#38bdf8",
|
|
60
|
-
fontWeight: 600,
|
|
61
|
-
letterSpacing: 2,
|
|
62
|
-
textTransform: "uppercase",
|
|
63
|
-
}, children: [siteName, " \u00B7 Classified"] }), _jsx("div", { style: {
|
|
64
|
-
fontSize: imageUrl ? 44 : 56,
|
|
65
|
-
fontWeight: 700,
|
|
66
|
-
color: "#f1f5f9",
|
|
67
|
-
lineHeight: 1.2,
|
|
68
|
-
display: "-webkit-box",
|
|
69
|
-
WebkitLineClamp: 3,
|
|
70
|
-
WebkitBoxOrient: "vertical",
|
|
71
|
-
overflow: "hidden",
|
|
72
|
-
}, children: title }), priceLabel && (_jsx("div", { style: { fontSize: 32, fontWeight: 700, color: "#4ade80" }, children: priceLabel })), location && (_jsx("div", { style: { fontSize: 22, color: "#94a3b8" }, children: location }))] })] })] }));
|
|
23
|
+
return renderOgLayout({
|
|
24
|
+
title: data.title,
|
|
25
|
+
subtitle: data.location ?? undefined,
|
|
26
|
+
imageUrl: data.imageUrl,
|
|
27
|
+
siteName: `${siteName} · Classified`,
|
|
28
|
+
accentSlot: data.priceLabel,
|
|
29
|
+
theme: { accentColor: "#38bdf8" },
|
|
30
|
+
});
|
|
73
31
|
}
|
|
74
32
|
/** Type-safe overload that accepts the full ProductDocument. */
|
|
75
33
|
export function renderClassifiedOgFromDoc(doc, opts) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConversationDocument } from "../../../../features/messages/schemas/firestore";
|
|
2
|
+
export interface StartDigitalCodeConversationInput {
|
|
3
|
+
productId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Open a buyer↔seller conversation for a digital-code listing (questions
|
|
7
|
+
* about platform/region/edition before purchase). Post-purchase code reveal
|
|
8
|
+
* is handled by the existing `/api/orders/[id]/code` endpoint, not a server
|
|
9
|
+
* action — the code reveal panel lives in the order detail view.
|
|
10
|
+
*/
|
|
11
|
+
export declare function startDigitalCodeConversationAction(input: StartDigitalCodeConversationInput): Promise<ConversationDocument>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { conversationsRepository } from "../../../../features/messages/repository/conversations.repository";
|
|
3
|
+
import { requireRoleUser } from "../../../../providers/auth-firebase/helpers";
|
|
4
|
+
import { storeRepository, productRepository } from "../../../../repositories";
|
|
5
|
+
/**
|
|
6
|
+
* Open a buyer↔seller conversation for a digital-code listing (questions
|
|
7
|
+
* about platform/region/edition before purchase). Post-purchase code reveal
|
|
8
|
+
* is handled by the existing `/api/orders/[id]/code` endpoint, not a server
|
|
9
|
+
* action — the code reveal panel lives in the order detail view.
|
|
10
|
+
*/
|
|
11
|
+
export async function startDigitalCodeConversationAction(input) {
|
|
12
|
+
const user = await requireRoleUser(["user", "buyer", "seller", "admin"]);
|
|
13
|
+
const product = await productRepository.findByIdOrSlug(input.productId);
|
|
14
|
+
if (!product || product.listingType !== "digital-code") {
|
|
15
|
+
throw new Error("Product not found or not a digital-code listing");
|
|
16
|
+
}
|
|
17
|
+
const store = await storeRepository.findById(product.storeId);
|
|
18
|
+
if (!store) {
|
|
19
|
+
throw new Error("Store not found");
|
|
20
|
+
}
|
|
21
|
+
return conversationsRepository.findOrCreateByContext({
|
|
22
|
+
buyerId: user.uid,
|
|
23
|
+
buyerDisplayName: user.name ?? user.email ?? user.uid,
|
|
24
|
+
storeId: product.storeId,
|
|
25
|
+
storeName: store.storeName,
|
|
26
|
+
sellerDisplayName: store.storeName,
|
|
27
|
+
productId: product.id,
|
|
28
|
+
productTitle: product.title,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
export function renderDigitalCodeOg(doc, opts) {
|
|
4
4
|
const priceLabel = doc?.price != null
|
|
@@ -21,56 +21,14 @@ export function renderDigitalCodeOg(doc, opts) {
|
|
|
21
21
|
}, opts.siteName);
|
|
22
22
|
}
|
|
23
23
|
export function renderDigitalCodeOgImage(data, siteName) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
overflow: "hidden",
|
|
33
|
-
}, children: [imageUrl && (_jsx("img", { src: imageUrl, alt: "", style: {
|
|
34
|
-
position: "absolute",
|
|
35
|
-
inset: 0,
|
|
36
|
-
width: "100%",
|
|
37
|
-
height: "100%",
|
|
38
|
-
objectFit: "cover",
|
|
39
|
-
opacity: 0.1,
|
|
40
|
-
} })), _jsx("div", { style: {
|
|
41
|
-
position: "absolute",
|
|
42
|
-
inset: 0,
|
|
43
|
-
background: "linear-gradient(135deg, rgba(12,10,30,0.97) 0%, rgba(12,10,30,0.83) 100%)",
|
|
44
|
-
} }), _jsxs("div", { style: {
|
|
45
|
-
position: "relative",
|
|
46
|
-
display: "flex",
|
|
47
|
-
width: "100%",
|
|
48
|
-
height: "100%",
|
|
49
|
-
padding: "60px",
|
|
50
|
-
gap: "48px",
|
|
51
|
-
alignItems: "center",
|
|
52
|
-
}, children: [imageUrl && (_jsx("img", { src: imageUrl, alt: title, style: {
|
|
53
|
-
width: 400,
|
|
54
|
-
height: 400,
|
|
55
|
-
objectFit: "contain",
|
|
56
|
-
borderRadius: 16,
|
|
57
|
-
flexShrink: 0,
|
|
58
|
-
} })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20, flex: 1 }, children: [_jsxs("div", { style: {
|
|
59
|
-
fontSize: 18,
|
|
60
|
-
color: "#a78bfa",
|
|
61
|
-
fontWeight: 600,
|
|
62
|
-
letterSpacing: 2,
|
|
63
|
-
textTransform: "uppercase",
|
|
64
|
-
}, children: [siteName, " \u00B7 Digital Code"] }), _jsx("div", { style: {
|
|
65
|
-
fontSize: imageUrl ? 44 : 56,
|
|
66
|
-
fontWeight: 700,
|
|
67
|
-
color: "#f1f5f9",
|
|
68
|
-
lineHeight: 1.2,
|
|
69
|
-
display: "-webkit-box",
|
|
70
|
-
WebkitLineClamp: 3,
|
|
71
|
-
WebkitBoxOrient: "vertical",
|
|
72
|
-
overflow: "hidden",
|
|
73
|
-
}, children: title }), priceLabel && (_jsx("div", { style: { fontSize: 32, fontWeight: 700, color: "#4ade80" }, children: priceLabel })), deliveryMethod && (_jsx("div", { style: { fontSize: 22, color: "#94a3b8" }, children: deliveryMethod }))] })] })] }));
|
|
24
|
+
return renderOgLayout({
|
|
25
|
+
title: data.title,
|
|
26
|
+
subtitle: data.deliveryMethod ?? undefined,
|
|
27
|
+
imageUrl: data.imageUrl,
|
|
28
|
+
siteName: `${siteName} · Digital Code`,
|
|
29
|
+
accentSlot: data.priceLabel,
|
|
30
|
+
theme: { background: "#0c0a1e", accentColor: "#a78bfa" },
|
|
31
|
+
});
|
|
74
32
|
}
|
|
75
33
|
/** Type-safe overload that accepts the full ProductDocument. */
|
|
76
34
|
export function renderDigitalCodeOgFromDoc(doc, opts) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
const EVENT_TYPE_LABEL = {
|
|
4
4
|
TOURNAMENT: "Tournament",
|
|
@@ -38,52 +38,13 @@ export function renderEventOg(doc, opts) {
|
|
|
38
38
|
}, opts.siteName);
|
|
39
39
|
}
|
|
40
40
|
export function renderEventOgImage(data, siteName) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, children: [coverImageUrl && (_jsx("img", { src: coverImageUrl, alt: "", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.15 } })), _jsx("div", { style: {
|
|
51
|
-
position: "absolute",
|
|
52
|
-
inset: 0,
|
|
53
|
-
background: "linear-gradient(135deg, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.80) 100%)",
|
|
54
|
-
} }), _jsxs("div", { style: {
|
|
55
|
-
position: "relative",
|
|
56
|
-
display: "flex",
|
|
57
|
-
width: "100%",
|
|
58
|
-
height: "100%",
|
|
59
|
-
padding: "60px",
|
|
60
|
-
gap: "48px",
|
|
61
|
-
alignItems: "center",
|
|
62
|
-
}, children: [coverImageUrl && (_jsx("img", { src: coverImageUrl, alt: title, style: { width: 380, height: 380, objectFit: "cover", borderRadius: 16, flexShrink: 0 } })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20, flex: 1 }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [_jsxs("div", { style: { fontSize: 16, color: "#a78bfa", fontWeight: 600, letterSpacing: 2, textTransform: "uppercase" }, children: [siteName, " \u00B7 Events"] }), typeLabel && (_jsx("div", { style: {
|
|
63
|
-
fontSize: 13,
|
|
64
|
-
color: "#c4b5fd",
|
|
65
|
-
fontWeight: 500,
|
|
66
|
-
letterSpacing: 1,
|
|
67
|
-
textTransform: "uppercase",
|
|
68
|
-
background: "rgba(167,139,250,0.12)",
|
|
69
|
-
padding: "3px 10px",
|
|
70
|
-
borderRadius: 100,
|
|
71
|
-
}, children: typeLabel }))] }), _jsx("div", { style: {
|
|
72
|
-
fontSize: coverImageUrl ? 44 : 56,
|
|
73
|
-
fontWeight: 700,
|
|
74
|
-
color: "#f1f5f9",
|
|
75
|
-
lineHeight: 1.2,
|
|
76
|
-
display: "-webkit-box",
|
|
77
|
-
WebkitLineClamp: 3,
|
|
78
|
-
WebkitBoxOrient: "vertical",
|
|
79
|
-
overflow: "hidden",
|
|
80
|
-
}, children: title }), description && (_jsx("div", { style: {
|
|
81
|
-
fontSize: 22,
|
|
82
|
-
color: "#94a3b8",
|
|
83
|
-
lineHeight: 1.45,
|
|
84
|
-
display: "-webkit-box",
|
|
85
|
-
WebkitLineClamp: 2,
|
|
86
|
-
WebkitBoxOrient: "vertical",
|
|
87
|
-
overflow: "hidden",
|
|
88
|
-
}, children: description })), startsAt && (_jsx("div", { style: { fontSize: 22, fontWeight: 600, color: "#a78bfa" }, children: startsAt }))] })] })] }));
|
|
41
|
+
return renderOgLayout({
|
|
42
|
+
title: data.title,
|
|
43
|
+
subtitle: data.description ?? undefined,
|
|
44
|
+
imageUrl: data.coverImageUrl,
|
|
45
|
+
siteName: `${siteName} · Events`,
|
|
46
|
+
badges: data.typeLabel ? [data.typeLabel] : undefined,
|
|
47
|
+
accentSlot: data.startsAt,
|
|
48
|
+
theme: { accentColor: "#a78bfa" },
|
|
49
|
+
});
|
|
89
50
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item Request data layer — OG-coverage-followup 2026-05-23.
|
|
3
|
+
*
|
|
4
|
+
* Item requests are buyer-posted "want to buy" threads sellers reply to.
|
|
5
|
+
* This file wraps the repo call in `React.cache` so the OG renderer (and
|
|
6
|
+
* any future page/generateMetadata pair) share one Firestore read per
|
|
7
|
+
* request.
|
|
8
|
+
*/
|
|
9
|
+
import type { ItemRequestDocument } from "../../../../features/store-extensions/schemas/firestore";
|
|
10
|
+
export interface ItemRequestDataOptions {
|
|
11
|
+
_reserved?: never;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Fetch a single item-request by id. Returns null when the id is empty
|
|
15
|
+
* or no matching document exists.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getItemRequestForDetail: (id: string, _opts?: ItemRequestDataOptions) => Promise<ItemRequestDocument | null>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item Request data layer — OG-coverage-followup 2026-05-23.
|
|
3
|
+
*
|
|
4
|
+
* Item requests are buyer-posted "want to buy" threads sellers reply to.
|
|
5
|
+
* This file wraps the repo call in `React.cache` so the OG renderer (and
|
|
6
|
+
* any future page/generateMetadata pair) share one Firestore read per
|
|
7
|
+
* request.
|
|
8
|
+
*/
|
|
9
|
+
import { cache } from "react";
|
|
10
|
+
import { itemRequestsRepository } from "../../../../repositories";
|
|
11
|
+
/**
|
|
12
|
+
* Fetch a single item-request by id. Returns null when the id is empty
|
|
13
|
+
* or no matching document exists.
|
|
14
|
+
*/
|
|
15
|
+
export const getItemRequestForDetail = cache(async (id, _opts) => {
|
|
16
|
+
void _opts;
|
|
17
|
+
if (!id)
|
|
18
|
+
return null;
|
|
19
|
+
return (await itemRequestsRepository.findById(id).catch(() => null)) ?? null;
|
|
20
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item Request OG image renderer — OG-coverage-followup 2026-05-23.
|
|
3
|
+
*
|
|
4
|
+
* Two layers (mirror of classified/og.tsx):
|
|
5
|
+
* - `renderItemRequestOg(doc, opts)` — maps an ItemRequestDocument into the
|
|
6
|
+
* OG data shape.
|
|
7
|
+
* - `renderItemRequestOgImage(data, siteName)` — pure JSX primitive,
|
|
8
|
+
* consumer wraps with `new ImageResponse(...)`.
|
|
9
|
+
*
|
|
10
|
+
* Item-request-specific accents:
|
|
11
|
+
* - Header pill says "Wanted" with cyan accent.
|
|
12
|
+
* - Status badge (Open / Closed).
|
|
13
|
+
* - Budget chip when maxBudgetInPaise is set.
|
|
14
|
+
* - Reply count chip.
|
|
15
|
+
*/
|
|
16
|
+
import type { ReactElement } from "react";
|
|
17
|
+
export interface ItemRequestOgData {
|
|
18
|
+
title: string;
|
|
19
|
+
opDisplayName?: string | null;
|
|
20
|
+
budgetLabel?: string | null;
|
|
21
|
+
imageUrl?: string | null;
|
|
22
|
+
status?: "open" | "closed" | "removed" | "approved" | null;
|
|
23
|
+
replyCount?: number | null;
|
|
24
|
+
category?: string | null;
|
|
25
|
+
}
|
|
26
|
+
interface ItemRequestDocLike {
|
|
27
|
+
title?: string | null;
|
|
28
|
+
opDisplayName?: string | null;
|
|
29
|
+
maxBudgetInPaise?: number | null;
|
|
30
|
+
imageUrls?: (string | null | undefined)[] | null;
|
|
31
|
+
status?: string | null;
|
|
32
|
+
replyCount?: number | null;
|
|
33
|
+
category?: string | null;
|
|
34
|
+
}
|
|
35
|
+
export declare function renderItemRequestOg(doc: ItemRequestDocLike | null | undefined, opts: {
|
|
36
|
+
siteName: string;
|
|
37
|
+
baseUrl?: string;
|
|
38
|
+
}): ReactElement;
|
|
39
|
+
export declare function renderItemRequestOgImage(data: ItemRequestOgData, siteName: string): ReactElement;
|
|
40
|
+
export {};
|