@mohasinac/appkit 4.52.5 → 4.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +4 -4
- package/dist/_internal/client/features/sticker-trace/canvas-codec.d.ts +2 -0
- package/dist/_internal/client/features/sticker-trace/canvas-codec.js +148 -0
- package/dist/_internal/server/features/auctions/actions.js +1 -1
- package/dist/_internal/server/features/categories/data.js +23 -7
- package/dist/_internal/server/features/checkout/actions.js +10 -3
- package/dist/_internal/server/features/checkout/data.d.ts +15 -0
- package/dist/_internal/server/features/checkout/data.js +20 -3
- package/dist/_internal/server/features/lottery/actions.js +9 -1
- package/dist/_internal/server/features/lottery/og.d.ts +40 -0
- package/dist/_internal/server/features/lottery/og.js +79 -0
- package/dist/_internal/server/features/messages/actions.js +4 -0
- package/dist/_internal/server/features/offers/adapters.js +17 -3
- package/dist/_internal/server/features/orders/actions.js +7 -2
- package/dist/_internal/server/features/raffle/actions.d.ts +19 -0
- package/dist/_internal/server/features/raffle/actions.js +25 -0
- package/dist/_internal/server/features/reviews/actions.js +1 -1
- package/dist/_internal/server/features/reviews/data.d.ts +1 -1
- package/dist/_internal/server/features/search/index-build/artifact-store.d.ts +89 -0
- package/dist/_internal/server/features/search/index-build/artifact-store.js +208 -0
- package/dist/_internal/server/features/search/index-build/build.d.ts +57 -0
- package/dist/_internal/server/features/search/index-build/build.js +285 -0
- package/dist/_internal/server/features/search/index-build/sources.d.ts +53 -0
- package/dist/_internal/server/features/search/index-build/sources.js +385 -0
- package/dist/_internal/server/features/search/search-sources.d.ts +0 -15
- package/dist/_internal/server/features/search/search-sources.js +142 -7
- package/dist/_internal/server/features/seo/robots.js +21 -1
- package/dist/_internal/server/features/seo/sitemap.js +1 -1
- package/dist/_internal/server/features/shared/listing-data-factory.js +16 -4
- package/dist/_internal/server/features/site-settings/adapters.d.ts +1 -1
- package/dist/_internal/server/features/site-settings/adapters.js +26 -0
- package/dist/_internal/server/features/sticker-trace/actions.d.ts +109 -0
- package/dist/_internal/server/features/sticker-trace/actions.js +172 -0
- package/dist/_internal/server/features/sticker-trace/adapters.d.ts +80 -0
- package/dist/_internal/server/features/sticker-trace/adapters.js +174 -0
- package/dist/_internal/server/features/sticker-trace/build-cut-file.d.ts +26 -0
- package/dist/_internal/server/features/sticker-trace/build-cut-file.js +127 -0
- package/dist/_internal/server/features/sticker-trace/coordinator.d.ts +27 -0
- package/dist/_internal/server/features/sticker-trace/coordinator.js +169 -0
- package/dist/_internal/server/features/sticker-trace/fanout.d.ts +43 -0
- package/dist/_internal/server/features/sticker-trace/fanout.js +180 -0
- package/dist/_internal/server/features/sticker-trace/finalizer.d.ts +25 -0
- package/dist/_internal/server/features/sticker-trace/finalizer.js +123 -0
- package/dist/_internal/server/features/sticker-trace/mosaic-inputs.d.ts +30 -0
- package/dist/_internal/server/features/sticker-trace/mosaic-inputs.js +112 -0
- package/dist/_internal/server/features/sticker-trace/progress.d.ts +81 -0
- package/dist/_internal/server/features/sticker-trace/progress.js +198 -0
- package/dist/_internal/server/features/sticker-trace/promote.d.ts +23 -0
- package/dist/_internal/server/features/sticker-trace/promote.js +193 -0
- package/dist/_internal/server/features/sticker-trace/shard.d.ts +50 -0
- package/dist/_internal/server/features/sticker-trace/shard.js +174 -0
- package/dist/_internal/server/features/sticker-trace/sheet-actions.d.ts +141 -0
- package/dist/_internal/server/features/sticker-trace/sheet-actions.js +279 -0
- package/dist/_internal/server/features/sticker-trace/storage.d.ts +135 -0
- package/dist/_internal/server/features/sticker-trace/storage.js +282 -0
- package/dist/_internal/server/functions/scheduled.d.ts +2 -1
- package/dist/_internal/server/functions/scheduled.js +25 -1
- package/dist/_internal/server/jobs/core/_event-ref.d.ts +51 -0
- package/dist/_internal/server/jobs/core/_event-ref.js +63 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.d.ts +18 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.js +77 -16
- package/dist/_internal/server/jobs/core/auctionSettlement.js +13 -4
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +44 -15
- package/dist/_internal/server/jobs/core/bundleStockSync.js +3 -4
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +44 -0
- package/dist/_internal/server/jobs/core/event-draw-reasons.d.ts +78 -0
- package/dist/_internal/server/jobs/core/event-draw-reasons.js +133 -0
- package/dist/_internal/server/jobs/core/listingProcessor.js +28 -8
- package/dist/_internal/server/jobs/core/onOrderCreate.js +12 -1
- package/dist/_internal/server/jobs/core/onScamReportCreate.js +13 -2
- package/dist/_internal/server/jobs/core/onScamReportRejected.js +8 -2
- package/dist/_internal/server/jobs/core/onScamReportVerified.js +8 -2
- package/dist/_internal/server/jobs/core/onStoreWrite.js +11 -4
- package/dist/_internal/server/jobs/core/prizeDrawAssignWinner.js +5 -4
- package/dist/_internal/server/jobs/core/prizeDrawExpiryReveal.js +1 -4
- package/dist/_internal/server/jobs/core/prizeDrawSoldOutReveal.js +1 -2
- package/dist/_internal/server/jobs/core/promotions.js +7 -4
- package/dist/_internal/server/jobs/core/searchIndexBuild.d.ts +7 -0
- package/dist/_internal/server/jobs/core/searchIndexBuild.js +211 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +35 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +213 -31
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +20 -14
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +8 -0
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +15 -15
- package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
- package/dist/_internal/server/jobs/handlers/index.js +1 -0
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/onProductWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/onReviewWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/onScamReportUpdate.js +18 -0
- package/dist/_internal/server/jobs/handlers/onStoreWrite.js +18 -0
- package/dist/_internal/server/jobs/handlers/searchIndexBuild.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/searchIndexBuild.js +2 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +8 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +15 -6
- package/dist/_internal/shared/actions/action-registry.js +29 -0
- package/dist/_internal/shared/cache/revalidate-targets.d.ts +0 -1
- package/dist/_internal/shared/cache/revalidate-targets.js +10 -8
- package/dist/_internal/shared/features/events/config.d.ts +14 -0
- package/dist/_internal/shared/features/events/config.js +14 -0
- package/dist/_internal/shared/features/notifications/action-url.js +8 -0
- package/dist/_internal/shared/features/site-settings/types.d.ts +11 -0
- package/dist/_internal/shared/features/sticker-trace/codec.d.ts +81 -0
- package/dist/_internal/shared/features/sticker-trace/codec.js +30 -0
- package/dist/_internal/shared/features/sticker-trace/config.d.ts +81 -0
- package/dist/_internal/shared/features/sticker-trace/config.js +177 -0
- package/dist/_internal/shared/features/sticker-trace/cut-contour.d.ts +20 -0
- package/dist/_internal/shared/features/sticker-trace/cut-contour.js +60 -0
- package/dist/_internal/shared/features/sticker-trace/export/build-export-set.d.ts +65 -0
- package/dist/_internal/shared/features/sticker-trace/export/build-export-set.js +176 -0
- package/dist/_internal/shared/features/sticker-trace/export/cut-svg.d.ts +56 -0
- package/dist/_internal/shared/features/sticker-trace/export/cut-svg.js +120 -0
- package/dist/_internal/shared/features/sticker-trace/export/machine-profiles.d.ts +92 -0
- package/dist/_internal/shared/features/sticker-trace/export/machine-profiles.js +153 -0
- package/dist/_internal/shared/features/sticker-trace/export/nesting.d.ts +51 -0
- package/dist/_internal/shared/features/sticker-trace/export/nesting.js +110 -0
- package/dist/_internal/shared/features/sticker-trace/export/page-sizes.d.ts +68 -0
- package/dist/_internal/shared/features/sticker-trace/export/page-sizes.js +223 -0
- package/dist/_internal/shared/features/sticker-trace/export/part-tiling.d.ts +51 -0
- package/dist/_internal/shared/features/sticker-trace/export/part-tiling.js +178 -0
- package/dist/_internal/shared/features/sticker-trace/export/simplify-budget.d.ts +26 -0
- package/dist/_internal/shared/features/sticker-trace/export/simplify-budget.js +134 -0
- package/dist/_internal/shared/features/sticker-trace/export/vectorise-art.d.ts +40 -0
- package/dist/_internal/shared/features/sticker-trace/export/vectorise-art.js +195 -0
- package/dist/_internal/shared/features/sticker-trace/index.d.ts +2 -0
- package/dist/_internal/shared/features/sticker-trace/index.js +59 -0
- package/dist/_internal/shared/features/sticker-trace/math/catmull-rom.d.ts +11 -0
- package/dist/_internal/shared/features/sticker-trace/math/catmull-rom.js +66 -0
- package/dist/_internal/shared/features/sticker-trace/math/edt.d.ts +27 -0
- package/dist/_internal/shared/features/sticker-trace/math/edt.js +165 -0
- package/dist/_internal/shared/features/sticker-trace/math/label.d.ts +15 -0
- package/dist/_internal/shared/features/sticker-trace/math/label.js +156 -0
- package/dist/_internal/shared/features/sticker-trace/math/marching-squares.d.ts +16 -0
- package/dist/_internal/shared/features/sticker-trace/math/marching-squares.js +242 -0
- package/dist/_internal/shared/features/sticker-trace/math/morphology.d.ts +46 -0
- package/dist/_internal/shared/features/sticker-trace/math/morphology.js +168 -0
- package/dist/_internal/shared/features/sticker-trace/math/rasterize-path.d.ts +88 -0
- package/dist/_internal/shared/features/sticker-trace/math/rasterize-path.js +286 -0
- package/dist/_internal/shared/features/sticker-trace/math/rdp.d.ts +10 -0
- package/dist/_internal/shared/features/sticker-trace/math/rdp.js +74 -0
- package/dist/_internal/shared/features/sticker-trace/resume.d.ts +50 -0
- package/dist/_internal/shared/features/sticker-trace/resume.js +160 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cluster.d.ts +20 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cluster.js +132 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cross-profile.d.ts +28 -0
- package/dist/_internal/shared/features/sticker-trace/trace/cross-profile.js +120 -0
- package/dist/_internal/shared/features/sticker-trace/trace/flood.d.ts +21 -0
- package/dist/_internal/shared/features/sticker-trace/trace/flood.js +104 -0
- package/dist/_internal/shared/features/sticker-trace/trace/geometry.d.ts +3 -0
- package/dist/_internal/shared/features/sticker-trace/trace/geometry.js +140 -0
- package/dist/_internal/shared/features/sticker-trace/trace/line-filter.d.ts +15 -0
- package/dist/_internal/shared/features/sticker-trace/trace/line-filter.js +138 -0
- package/dist/_internal/shared/features/sticker-trace/trace/merge.d.ts +27 -0
- package/dist/_internal/shared/features/sticker-trace/trace/merge.js +187 -0
- package/dist/_internal/shared/features/sticker-trace/trace/paper.d.ts +32 -0
- package/dist/_internal/shared/features/sticker-trace/trace/paper.js +147 -0
- package/dist/_internal/shared/features/sticker-trace/trace/prefilter.d.ts +30 -0
- package/dist/_internal/shared/features/sticker-trace/trace/prefilter.js +125 -0
- package/dist/_internal/shared/features/sticker-trace/trace/quantise.d.ts +10 -0
- package/dist/_internal/shared/features/sticker-trace/trace/quantise.js +153 -0
- package/dist/_internal/shared/features/sticker-trace/trace/ridge.d.ts +88 -0
- package/dist/_internal/shared/features/sticker-trace/trace/ridge.js +344 -0
- package/dist/_internal/shared/features/sticker-trace/trace/segment.d.ts +10 -0
- package/dist/_internal/shared/features/sticker-trace/trace/segment.js +251 -0
- package/dist/_internal/shared/features/sticker-trace/types.d.ts +197 -0
- package/dist/_internal/shared/features/sticker-trace/types.js +49 -0
- package/dist/_internal/shared/listing-types/_registry.d.ts +11 -0
- package/dist/_internal/shared/listing-types/art/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/config.js +1 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/config.js +1 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/config.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +1 -0
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +7 -0
- package/dist/_internal/shared/listing-types/feature-flags.js +9 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/config.js +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +1 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/config.js +1 -0
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/config.js +1 -0
- package/dist/_internal/shared/media/limits.d.ts +12 -2
- package/dist/_internal/shared/media/limits.js +12 -2
- package/dist/_internal/shared/search/artifact-url.d.ts +35 -0
- package/dist/_internal/shared/search/artifact-url.js +119 -0
- package/dist/_internal/shared/search/index-record.d.ts +68 -0
- package/dist/_internal/shared/search/index-record.js +96 -0
- package/dist/_internal/shared/search/match.d.ts +65 -0
- package/dist/_internal/shared/search/match.js +263 -0
- package/dist/client.d.ts +8 -7
- package/dist/client.js +12 -5
- package/dist/configs/eslint.js +22 -2
- package/dist/constants/api-endpoints.d.ts +68 -0
- package/dist/constants/api-endpoints.js +32 -0
- package/dist/constants/field-names.d.ts +7 -1
- package/dist/constants/field-names.js +36 -1
- package/dist/contracts/repository.d.ts +8 -7
- package/dist/contracts/search.d.ts +2 -2
- package/dist/contracts/table.d.ts +3 -3
- package/dist/contracts/table.js +3 -3
- package/dist/core/contact-submissions.repository.js +2 -2
- package/dist/core/integration-keys.js +7 -1
- package/dist/core/newsletter.repository.js +2 -2
- package/dist/core/site-config.js +1 -1
- package/dist/errors/error-codes.d.ts +30 -0
- package/dist/errors/error-codes.js +30 -0
- package/dist/errors/error-display-map.js +40 -1
- package/dist/features/account/api/[userId]/addresses/route.js +1 -1
- package/dist/features/account/components/UserBidsView.js +1 -1
- package/dist/features/account/components/index.d.ts +0 -8
- package/dist/features/account/components/index.js +0 -4
- package/dist/features/addresses/repository/addresses.repository.d.ts +17 -6
- package/dist/features/addresses/repository/addresses.repository.js +65 -9
- package/dist/features/addresses/schemas/firestore.d.ts +17 -6
- package/dist/features/admin/actions/notification-actions.js +15 -6
- package/dist/features/admin/api/bids/route.js +1 -1
- package/dist/features/admin/api/coupons/route.js +1 -1
- package/dist/features/admin/api/products/route.js +1 -1
- package/dist/features/admin/api/reviews/route.js +1 -1
- package/dist/features/admin/components/AdminAdEditorView.js +19 -5
- package/dist/features/admin/components/AdminAuditLogView.js +1 -1
- package/dist/features/admin/components/AdminBlogEditorView.js +0 -1
- package/dist/features/admin/components/AdminBlogView.js +1 -1
- package/dist/features/admin/components/AdminBrandsView.js +17 -1
- package/dist/features/admin/components/AdminCategoryEditorView.js +0 -1
- package/dist/features/admin/components/AdminContactView.js +1 -1
- package/dist/features/admin/components/AdminEmployeeEditorView.js +1 -3
- package/dist/features/admin/components/AdminNewsletterView.js +1 -1
- package/dist/features/admin/components/AdminOrdersView.js +9 -2
- package/dist/features/admin/components/AdminPayoutsView.js +1 -1
- package/dist/features/admin/components/AdminPrizeDrawsView.js +11 -0
- package/dist/features/admin/components/AdminProductEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminProductEditorView.js +24 -37
- package/dist/features/admin/components/AdminProductsView.js +10 -3
- package/dist/features/admin/components/AdminScammersView.js +1 -1
- package/dist/features/admin/components/AdminSectionsView.js +21 -5
- package/dist/features/admin/components/AdminSessionsView.js +1 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +22 -1
- package/dist/features/admin/components/AdminTeamView.js +1 -1
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +0 -1
- package/dist/features/admin/components/AdminUsersView.js +1 -1
- package/dist/features/admin/components/DataListingView.d.ts +2 -1
- package/dist/features/admin/components/DataListingView.js +9 -4
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.js +0 -2
- package/dist/features/admin/hooks/useAdminListing.d.ts +1 -1
- package/dist/features/admin/repository/site-settings.repository.js +8 -3
- package/dist/features/admin/schemas/firestore.d.ts +62 -1
- package/dist/features/admin/schemas/firestore.js +32 -0
- package/dist/features/admin/types/index.d.ts +1 -1
- package/dist/features/auctions/actions/bid-actions.d.ts +2 -2
- package/dist/features/auctions/actions/bid-actions.js +16 -4
- package/dist/features/auctions/api/route.js +1 -1
- package/dist/features/auctions/components/AuctionBottomActions.js +4 -0
- package/dist/features/auctions/repository/bid.repository.d.ts +46 -4
- package/dist/features/auctions/repository/bid.repository.js +114 -13
- package/dist/features/auctions/schemas/firestore.d.ts +24 -4
- package/dist/features/auctions/schemas/firestore.js +1 -0
- package/dist/features/auth/actions/profile-actions.js +30 -4
- package/dist/features/auth/components/index.d.ts +0 -1
- package/dist/features/auth/components/index.js +0 -1
- package/dist/features/auth/repository/session.repository.d.ts +17 -3
- package/dist/features/auth/repository/session.repository.js +46 -5
- package/dist/features/auth/repository/token.repository.d.ts +27 -4
- package/dist/features/auth/repository/token.repository.js +65 -11
- package/dist/features/auth/repository/user.repository.d.ts +33 -7
- package/dist/features/auth/repository/user.repository.js +100 -15
- package/dist/features/auth/schemas/firestore.d.ts +63 -12
- package/dist/features/auth/schemas/firestore.js +11 -0
- package/dist/features/before-after/api/route.js +1 -1
- package/dist/features/blog/components/BlogListView.js +16 -3
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/blog/schemas/index.d.ts +2 -2
- package/dist/features/cart/api/route.js +1 -1
- package/dist/features/catalogue/repository/catalogue.repository.d.ts +7 -7
- package/dist/features/catalogue/repository/catalogue.repository.js +28 -10
- package/dist/features/catalogue/schemas/firestore.d.ts +11 -0
- package/dist/features/categories/api/route.js +10 -10
- package/dist/features/categories/components/CategoryDetailPageView.js +35 -5
- package/dist/features/categories/components/CategorySelectorCreate.js +0 -1
- package/dist/features/categories/components/index.d.ts +0 -2
- package/dist/features/categories/components/index.js +0 -1
- package/dist/features/categories/repository/categories.repository.d.ts +1 -0
- package/dist/features/categories/repository/categories.repository.js +31 -1
- package/dist/features/categories/schemas/index.d.ts +2 -2
- package/dist/features/categories/utils/taxonomy-visual.d.ts +21 -0
- package/dist/features/categories/utils/taxonomy-visual.js +58 -0
- package/dist/features/checkout/actions/checkout-value-otp-actions.js +8 -1
- package/dist/features/collections/api/[slug]/route.js +3 -3
- package/dist/features/collections/api/route.js +1 -1
- package/dist/features/consultation/api/route.js +1 -1
- package/dist/features/consultation/repository/consultations.repository.js +1 -1
- package/dist/features/consultation/types/index.d.ts +1 -1
- package/dist/features/contact/components/ContactForm.js +1 -3
- package/dist/features/corporate/api/route.js +1 -1
- package/dist/features/corporate/repository/corporate.repository.js +1 -1
- package/dist/features/corporate/types/index.d.ts +1 -1
- package/dist/features/cron/jobs/auction-expiry.job.js +1 -1
- package/dist/features/cron/jobs/preorder-reminder.job.js +1 -1
- package/dist/features/events/actions/event-actions.d.ts +14 -0
- package/dist/features/events/actions/event-actions.js +82 -3
- package/dist/features/events/api/[id]/route.js +2 -2
- package/dist/features/events/components/AdminEventEditorView.js +22 -3
- package/dist/features/events/components/AdminEventsView.js +32 -8
- package/dist/features/events/components/EventRafflesSection.d.ts +34 -1
- package/dist/features/events/components/EventRafflesSection.js +52 -3
- package/dist/features/events/components/SpinWheelView.d.ts +2 -2
- package/dist/features/events/components/SpinWheelView.js +41 -4
- package/dist/features/events/repository/event-entry.repository.d.ts +14 -2
- package/dist/features/events/repository/event-entry.repository.js +41 -7
- package/dist/features/events/schemas/firestore.d.ts +17 -4
- package/dist/features/events/types/index.d.ts +37 -0
- package/dist/features/faq/repository/faqs.repository.js +1 -1
- package/dist/features/faq/schemas/index.d.ts +5 -2
- package/dist/features/faq/schemas/index.js +6 -0
- package/dist/features/faq/types/index.d.ts +0 -1
- package/dist/features/grouped/components/GroupedListingEditorView.js +17 -2
- package/dist/features/homepage/api/carousel/[id]/route.js +1 -1
- package/dist/features/homepage/api/carousel/route.js +4 -4
- package/dist/features/homepage/api/route.js +2 -2
- package/dist/features/homepage/api/sections/route.js +1 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +1 -9
- package/dist/features/homepage/components/AnnouncementBar.js +13 -19
- package/dist/features/homepage/components/MarketplaceHomepageView.js +6 -1
- package/dist/features/homepage/components/index.d.ts +0 -2
- package/dist/features/homepage/components/index.js +0 -1
- package/dist/features/homepage/repository/homepage.repository.js +1 -1
- package/dist/features/homepage/schemas/firestore.d.ts +6 -0
- package/dist/features/homepage/schemas/index.d.ts +10 -10
- package/dist/features/layout/AppLayoutShell.d.ts +11 -0
- package/dist/features/layout/AppLayoutShell.js +64 -12
- package/dist/features/layout/BottomActionsContext.d.ts +16 -0
- package/dist/features/layout/BottomActionsContext.js +5 -0
- package/dist/features/layout/BottomChrome.js +48 -9
- package/dist/features/layout/BottomNavbar.d.ts +14 -0
- package/dist/features/layout/BottomNavbar.js +43 -3
- package/dist/features/layout/MainNavbar.d.ts +11 -0
- package/dist/features/layout/NavbarLayout.d.ts +3 -0
- package/dist/features/layout/NavbarLayout.js +88 -11
- package/dist/features/layout/SideActionDock.d.ts +1 -0
- package/dist/features/layout/SideActionDock.js +219 -0
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/layout/cta-anchor.d.ts +31 -0
- package/dist/features/layout/cta-anchor.js +31 -0
- package/dist/features/layout/hooks/useBottomActions.d.ts +7 -0
- package/dist/features/layout/hooks/useBottomActions.js +6 -1
- package/dist/features/layout/index.d.ts +9 -1
- package/dist/features/layout/index.js +9 -1
- package/dist/features/layout/useCtaReveal.d.ts +24 -0
- package/dist/features/layout/useCtaReveal.js +82 -0
- package/dist/features/layout/useHoldToOpen.d.ts +41 -0
- package/dist/features/layout/useHoldToOpen.js +84 -0
- package/dist/features/lottery/repository/lottery-entry.repository.d.ts +18 -3
- package/dist/features/lottery/repository/lottery-entry.repository.js +48 -6
- package/dist/features/lottery/schemas/firestore.d.ts +33 -5
- package/dist/features/loyalty/api/balance/route.js +1 -1
- package/dist/features/loyalty/api/history/route.js +1 -1
- package/dist/features/media/MediaImage.js +0 -1
- package/dist/features/media/MediaPickerModal.js +7 -1
- package/dist/features/media/modals/ImageEditor.js +5 -1
- package/dist/features/media/modals/VideoThumbnailSelector.js +17 -1
- package/dist/features/media/repository/media-assets.repository.d.ts +19 -0
- package/dist/features/media/upload/CameraCapture.js +16 -1
- package/dist/features/media/upload/ImageUpload.js +42 -4
- package/dist/features/media/upload/MediaUploadField.js +69 -13
- package/dist/features/media/upload/downscale-image.d.ts +56 -0
- package/dist/features/media/upload/downscale-image.js +150 -0
- package/dist/features/messages/components/ConversationThreadView.js +45 -2
- package/dist/features/messages/components/MessageSellerButton.d.ts +15 -1
- package/dist/features/messages/components/MessageSellerButton.js +10 -2
- package/dist/features/messages/schemas/firestore.d.ts +15 -0
- package/dist/features/orders/hooks/useOrders.js +4 -2
- package/dist/features/orders/repository/orders.repository.d.ts +15 -4
- package/dist/features/orders/repository/orders.repository.js +52 -20
- package/dist/features/orders/schemas/firestore.d.ts +15 -4
- package/dist/features/orders/schemas/index.d.ts +8 -8
- package/dist/features/orders/types/index.d.ts +2 -2
- package/dist/features/payments/repository/payments.repository.js +2 -2
- package/dist/features/payments/repository/payout.repository.d.ts +23 -6
- package/dist/features/payments/repository/payout.repository.js +63 -23
- package/dist/features/payments/repository/saved-payment-methods.repository.d.ts +17 -6
- package/dist/features/payments/repository/saved-payment-methods.repository.js +59 -11
- package/dist/features/payments/schemas/firestore.d.ts +14 -3
- package/dist/features/payments/schemas/saved-methods-firestore.d.ts +12 -1
- package/dist/features/pre-orders/api/[slug]/route.js +1 -1
- package/dist/features/pre-orders/api/admin/route.js +1 -1
- package/dist/features/pre-orders/api/route.js +1 -1
- package/dist/features/pre-orders/repository/pre-orders.repository.d.ts +3 -3
- package/dist/features/pre-orders/repository/pre-orders.repository.js +6 -6
- package/dist/features/products/api/[id]/route.js +1 -1
- package/dist/features/products/components/ListingBottomActions.js +4 -0
- package/dist/features/products/components/ProductDetailPageView.js +2 -1
- package/dist/features/products/components/ProductGalleryClient.js +2 -2
- package/dist/features/products/components/ProductGrid.js +12 -1
- package/dist/features/products/components/index.d.ts +0 -2
- package/dist/features/products/components/index.js +0 -1
- package/dist/features/products/config/listing-type-listing-config.d.ts +0 -3
- package/dist/features/products/config/listing-type-listing-config.js +27 -2
- package/dist/features/products/constants/listing-tabs.d.ts +9 -0
- package/dist/features/products/constants/listing-tabs.js +3 -2
- package/dist/features/products/hooks/useProducts.js +2 -2
- package/dist/features/products/repository/products.repository.js +13 -1
- package/dist/features/products/schemas/index.d.ts +2 -2
- package/dist/features/products/types/index.d.ts +1 -1
- package/dist/features/promotions/api/route.js +1 -1
- package/dist/features/reviews/actions/review-actions.d.ts +6 -6
- package/dist/features/reviews/actions/review-actions.js +22 -8
- package/dist/features/reviews/components/ReviewDetailPageView.js +13 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.js +21 -4
- package/dist/features/reviews/repository/reviews.repository.d.ts +19 -7
- package/dist/features/reviews/repository/reviews.repository.js +63 -12
- package/dist/features/reviews/schemas/firestore.d.ts +13 -2
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/scams/actions/scam-actions.js +16 -4
- package/dist/features/search/components/SearchResultsPageView.js +2 -1
- package/dist/features/search/hooks/useSearchIndex.d.ts +34 -0
- package/dist/features/search/hooks/useSearchIndex.js +172 -0
- package/dist/features/search/repository/search.repository.js +2 -2
- package/dist/features/seller/actions/offer-actions.d.ts +5 -5
- package/dist/features/seller/actions/offer-actions.js +38 -8
- package/dist/features/seller/actions/seller-actions.js +34 -7
- package/dist/features/seller/api/coupons/route.js +1 -1
- package/dist/features/seller/api/products/route.js +1 -1
- package/dist/features/seller/api/store/route.js +1 -1
- package/dist/features/seller/components/SellerBidsView.js +1 -1
- package/dist/features/seller/components/SellerCouponsView.js +1 -1
- package/dist/features/seller/components/SellerListingTypeView.js +9 -1
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +0 -1
- package/dist/features/seller/components/SellerPayoutsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +0 -1
- package/dist/features/seller/components/SellerProductsView.js +1 -1
- package/dist/features/seller/components/SellerShippingView.js +0 -1
- package/dist/features/seller/components/SellerStorefrontView.js +0 -1
- package/dist/features/seller/components/index.d.ts +0 -4
- package/dist/features/seller/components/index.js +0 -2
- package/dist/features/seller/repository/offer.repository.d.ts +15 -3
- package/dist/features/seller/repository/offer.repository.js +43 -7
- package/dist/features/seller/schemas/firestore.d.ts +14 -3
- package/dist/features/seller/schemas/index.d.ts +4 -4
- package/dist/features/seller/schemas/order-forms.d.ts +39 -0
- package/dist/features/seller/schemas/order-forms.js +37 -0
- package/dist/features/shell/FormShell.js +6 -2
- package/dist/features/shell/QuickFormDrawer.js +15 -1
- package/dist/features/shipments/components/AdminShipmentEditorView.js +0 -1
- package/dist/features/shipments/components/AdminShipmentsView.js +1 -1
- package/dist/features/sticker-trace/components/StickerCommitPanel.d.ts +30 -0
- package/dist/features/sticker-trace/components/StickerCommitPanel.js +93 -0
- package/dist/features/sticker-trace/components/StickerPrintPanel.d.ts +33 -0
- package/dist/features/sticker-trace/components/StickerPrintPanel.js +104 -0
- package/dist/features/sticker-trace/components/StickerRetryPanel.d.ts +20 -0
- package/dist/features/sticker-trace/components/StickerRetryPanel.js +128 -0
- package/dist/features/sticker-trace/components/StickerRunHistoryPanel.d.ts +45 -0
- package/dist/features/sticker-trace/components/StickerRunHistoryPanel.js +84 -0
- package/dist/features/sticker-trace/components/StickerTraceStudio.d.ts +27 -0
- package/dist/features/sticker-trace/components/StickerTraceStudio.js +171 -0
- package/dist/features/sticker-trace/constants/help-content.d.ts +23 -0
- package/dist/features/sticker-trace/constants/help-content.js +172 -0
- package/dist/features/sticker-trace/hooks/useLiveTrace.d.ts +27 -0
- package/dist/features/sticker-trace/hooks/useLiveTrace.js +160 -0
- package/dist/features/sticker-trace/hooks/useStickerTraceProgress.d.ts +22 -0
- package/dist/features/sticker-trace/hooks/useStickerTraceProgress.js +106 -0
- package/dist/features/sticker-trace/repository/sticker-sheets.repository.d.ts +113 -0
- package/dist/features/sticker-trace/repository/sticker-sheets.repository.js +146 -0
- package/dist/features/sticker-trace/repository/sticker-trace-runs.repository.d.ts +132 -0
- package/dist/features/sticker-trace/repository/sticker-trace-runs.repository.js +174 -0
- package/dist/features/sticker-trace/schemas/firestore.d.ts +248 -0
- package/dist/features/sticker-trace/schemas/firestore.js +79 -0
- package/dist/features/sticker-trace/server.d.ts +8 -0
- package/dist/features/sticker-trace/server.js +51 -0
- package/dist/features/stores/actions/store-query-actions.d.ts +2 -2
- package/dist/features/stores/actions/store-query-actions.js +7 -2
- package/dist/features/stores/api/[storeSlug]/auctions/route.js +3 -3
- package/dist/features/stores/api/[storeSlug]/products/route.js +3 -3
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +1 -1
- package/dist/features/stores/api/[storeSlug]/route.js +1 -1
- package/dist/features/stores/components/StoreNavTabs.js +17 -2
- package/dist/features/stores/manifest.js +8 -4
- package/dist/features/support/repository/support.repository.d.ts +14 -3
- package/dist/features/support/repository/support.repository.js +93 -13
- package/dist/features/support/schemas/firestore.d.ts +16 -5
- package/dist/features/tester/seed-data/authored/admin__events-raffles-spin.js +61 -19
- package/dist/features/tester/seed-data/authored/buying__browsing-search.js +19 -3
- package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.js +243 -0
- package/dist/features/tester/seed-data/authored/content-discovery__events.js +36 -10
- package/dist/features/tester/seed-data/authored/content-discovery__overflowing-pill-rows.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__overflowing-pill-rows.js +209 -0
- package/dist/features/tester/seed-data/authored/design-ux__header-brand-mark-centring.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/design-ux__header-brand-mark-centring.js +90 -0
- package/dist/features/tester/seed-data/authored/index.js +8 -0
- package/dist/features/tester/seed-data/authored/selling__media-limits.js +19 -17
- package/dist/features/tester/seed-data/authored/selling__product-upload-details.js +10 -5
- package/dist/features/tester/seed-data/authored/tools__sticker-tracer.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/tools__sticker-tracer.js +283 -0
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +192 -22
- package/dist/index.d.ts +10 -23
- package/dist/index.js +27 -19
- package/dist/next/api/routeHandler.js +9 -0
- package/dist/next/routing/require-record.d.ts +13 -0
- package/dist/next/routing/require-record.js +62 -0
- package/dist/next/routing/route-map.d.ts +4 -4
- package/dist/next/routing/route-map.js +25 -3
- package/dist/providers/db-firebase/base.d.ts +4 -2
- package/dist/providers/db-firebase/base.js +21 -5
- package/dist/providers/db-firebase/base.repository.d.ts +11 -9
- package/dist/providers/db-firebase/base.repository.js +19 -0
- package/dist/providers/db-firebase/rtdb-paths.d.ts +12 -0
- package/dist/providers/db-firebase/rtdb-paths.js +12 -0
- package/dist/react/ErrorBoundary.js +6 -1
- package/dist/react/hooks/realtime-event-constants.d.ts +1 -0
- package/dist/react/hooks/realtime-event-constants.js +8 -0
- package/dist/react/hooks/useEntityDelete.js +5 -1
- package/dist/react/hooks/useMessage.js +5 -1
- package/dist/repositories/index.d.ts +2 -2
- package/dist/repositories/index.js +6 -1
- package/dist/schemas/registry.d.ts +13 -20
- package/dist/schemas/registry.js +31 -14
- package/dist/schemas/webhooks/google-oauth.d.ts +2 -2
- package/dist/security/encrypted.d.ts +117 -0
- package/dist/security/encrypted.js +100 -0
- package/dist/security/index.d.ts +5 -2
- package/dist/security/index.js +16 -2
- package/dist/security/pii-accessors.d.ts +71 -0
- package/dist/security/pii-accessors.js +150 -0
- package/dist/security/pii-encrypt.d.ts +0 -8
- package/dist/security/pii-encrypt.js +22 -15
- package/dist/security/pii-mask.d.ts +18 -0
- package/dist/security/pii-mask.js +27 -0
- package/dist/seed/_helpers/search-txt-wrappers.d.ts +6 -6
- package/dist/seed/_helpers/search-txt-wrappers.js +22 -0
- package/dist/seed/addresses-seed-data.d.ts +2 -2
- package/dist/seed/authenticity-knowledge-seed-data.d.ts +34 -0
- package/dist/seed/authenticity-knowledge-seed-data.js +1277 -0
- package/dist/seed/bids-seed-data.d.ts +2 -2
- package/dist/seed/bids-seed-data.js +23 -2
- package/dist/seed/events-seed-data.d.ts +2 -2
- package/dist/seed/events-seed-data.js +5 -0
- package/dist/seed/faq-seed-data.js +175 -5
- package/dist/seed/homepage-sections-seed-data.js +39 -23
- package/dist/seed/index.d.ts +1 -0
- package/dist/seed/index.js +1 -0
- package/dist/seed/lottery-entries-seed-data.d.ts +2 -2
- package/dist/seed/offers-seed-data.d.ts +2 -2
- package/dist/seed/offers-seed-data.js +1 -1
- package/dist/seed/orders-seed-data.d.ts +2 -2
- package/dist/seed/payouts-seed-data.d.ts +2 -2
- package/dist/seed/payouts-seed-data.js +1 -1
- package/dist/seed/reviews-seed-data.d.ts +1 -2
- package/dist/seed/seed-purpose.js +7 -0
- package/dist/seed/sessions-seed-data.d.ts +2 -2
- package/dist/seed/sessions-seed-data.js +5 -0
- package/dist/seed/site-settings-seed-data.js +1 -1
- package/dist/seed/support-tickets-seed-data.d.ts +2 -2
- package/dist/seed/support-tickets-seed-data.js +1 -1
- package/dist/seed/users-seed-data.d.ts +2 -2
- package/dist/seed/users-seed-data.js +1 -1
- package/dist/seo/json-ld.js +5 -1
- package/dist/server.d.ts +18 -3
- package/dist/server.js +59 -3
- package/dist/styles.css +237 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Button.js +7 -1
- package/dist/ui/components/FilterChipGroup.d.ts +11 -0
- package/dist/ui/components/FilterChipGroup.js +1 -1
- package/dist/ui/components/ImageGallery.js +6 -1
- package/dist/ui/components/ListingLayout.js +14 -8
- package/dist/ui/components/OverflowRow.d.ts +92 -0
- package/dist/ui/components/OverflowRow.js +203 -0
- package/dist/ui/components/OverflowRow.style.css +235 -0
- package/dist/ui/components/RecordDetailModal.js +14 -1
- package/dist/ui/components/RowActionMenu.js +5 -1
- package/dist/ui/components/SideDrawer.js +5 -1
- package/dist/ui/components/SideModal.js +9 -1
- package/dist/ui/components/TabBarShell.d.ts +12 -1
- package/dist/ui/components/TabBarShell.js +3 -2
- package/dist/ui/components/Tabs.js +36 -24
- package/dist/ui/components/Toast.d.ts +3 -24
- package/dist/ui/components/Toast.js +2 -19
- package/dist/ui/components/TopBannerPortal.d.ts +15 -0
- package/dist/ui/components/TopBannerPortal.js +19 -0
- package/dist/ui/components/UnsavedChangesModal.js +5 -1
- package/dist/ui/components/index.style.css +1 -0
- package/dist/ui/components/row-collapse.d.ts +15 -0
- package/dist/ui/components/row-collapse.js +127 -0
- package/dist/ui/components/toast-context.d.ts +63 -0
- package/dist/ui/components/toast-context.js +48 -0
- package/dist/ui/components/top-banner-slot.d.ts +37 -0
- package/dist/ui/components/top-banner-slot.js +45 -0
- package/dist/ui/icons/icon-registry.d.ts +6 -0
- package/dist/ui/icons/icon-registry.js +17 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/array.helper.d.ts +2 -2
- package/dist/utils/array.helper.js +5 -5
- package/dist/utils/id-generators.d.ts +6 -0
- package/dist/utils/id-generators.js +10 -0
- package/dist/utils/media-url.js +0 -2
- package/dist/utils/search-txt-builders.d.ts +28 -4
- package/dist/utils/search-txt-builders.js +41 -1
- package/dist/validation/schemas.d.ts +8 -8
- package/package.json +6 -2
- package/scripts/seed-cli.mjs +3 -0
- package/dist/features/account/components/UserAddressesView.d.ts +0 -13
- package/dist/features/account/components/UserAddressesView.js +0 -5
- package/dist/features/account/components/UserNotificationsView.d.ts +0 -15
- package/dist/features/account/components/UserNotificationsView.js +0 -12
- package/dist/features/account/components/UserSettingsView.d.ts +0 -16
- package/dist/features/account/components/UserSettingsView.js +0 -13
- package/dist/features/account/components/UserSupportView.d.ts +0 -3
- package/dist/features/account/components/UserSupportView.js +0 -166
- package/dist/features/admin/components/DemoSeedView.d.ts +0 -11
- package/dist/features/admin/components/DemoSeedView.js +0 -5
- package/dist/features/auth/components/AuthStatusPanel.d.ts +0 -10
- package/dist/features/auth/components/AuthStatusPanel.js +0 -22
- package/dist/features/categories/components/CategoryProductsView.d.ts +0 -45
- package/dist/features/categories/components/CategoryProductsView.js +0 -21
- package/dist/features/homepage/components/HowItWorksInfoView.d.ts +0 -36
- package/dist/features/homepage/components/HowItWorksInfoView.js +0 -10
- package/dist/features/layout/BottomActions.d.ts +0 -1
- package/dist/features/layout/BottomActions.js +0 -311
- package/dist/features/products/components/ProductsView.d.ts +0 -6
- package/dist/features/products/components/ProductsView.js +0 -5
- package/dist/features/seller/components/SellerStoreView.d.ts +0 -8
- package/dist/features/seller/components/SellerStoreView.js +0 -8
|
@@ -48,7 +48,7 @@ export const GET = createRouteHandler({
|
|
|
48
48
|
filters: combinedFilters,
|
|
49
49
|
sort,
|
|
50
50
|
page,
|
|
51
|
-
|
|
51
|
+
pageSize: pageSize,
|
|
52
52
|
});
|
|
53
53
|
const totalPages = Math.max(1, Math.ceil(result.total / pageSize));
|
|
54
54
|
// Keep same response shape as local route so useSellerProducts hook needs no changes
|
|
@@ -106,7 +106,7 @@ export function SellerBidsView({ endpoint = SELLER_ENDPOINTS.BIDS }) {
|
|
|
106
106
|
sortOptions: SORT_OPTIONS,
|
|
107
107
|
initialView: "list",
|
|
108
108
|
columns,
|
|
109
|
-
mapRows: (response) => toRecordArray(response.
|
|
109
|
+
mapRows: (response) => toRecordArray(response.items).map((item, idx) => ({
|
|
110
110
|
id: toStringValue(item.id, `bid-${idx}`),
|
|
111
111
|
productTitle: toStringValue(item.productTitle, "Unknown auction"),
|
|
112
112
|
productId: toStringValue(item.productId, ""),
|
|
@@ -68,7 +68,7 @@ export function SellerCouponsView({ onCreateClick, onEditClick, onToggle, onDele
|
|
|
68
68
|
{ value: "code", label: "Code A–Z" },
|
|
69
69
|
],
|
|
70
70
|
hideTableView: true,
|
|
71
|
-
mapRows: (response) => toRecordArray(response.
|
|
71
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
72
72
|
id: toStringValue(item.id, `coupon-${index}`),
|
|
73
73
|
raw: item,
|
|
74
74
|
isActive: getIsActive(item),
|
|
@@ -230,7 +230,15 @@ export function SellerListingTypeView({ type, onCreateClick, onEditClick, onDele
|
|
|
230
230
|
// four options where its four siblings offered five.
|
|
231
231
|
sortOptions: [...plugin.sortOptions],
|
|
232
232
|
columns,
|
|
233
|
-
mapRows: (response) =>
|
|
233
|
+
mapRows: (response) =>
|
|
234
|
+
/*
|
|
235
|
+
* `items` only. The `?? response.products` fallback is gone because both
|
|
236
|
+
* endpoints this config reads (`/api/admin/products`, `/api/store/products`)
|
|
237
|
+
* now emit the canonical key — verified before removing it. A defence
|
|
238
|
+
* against a shape that no longer exists reads as though the shape still
|
|
239
|
+
* might, which is how two spellings stay alive forever.
|
|
240
|
+
*/
|
|
241
|
+
toRecordArray(response.items).map((item, index) => ({
|
|
234
242
|
id: toStringValue(item.id, `${type}-${index}`),
|
|
235
243
|
title: toStringValue(item.productTitle ?? item.title, "Untitled"),
|
|
236
244
|
price: toCurrency(item.price),
|
|
@@ -398,7 +398,7 @@ export function SellerOrdersView({ orderDetailApiBase = SELLER_ENDPOINTS.ORDERS,
|
|
|
398
398
|
endpoint: SELLER_ENDPOINTS.ORDERS,
|
|
399
399
|
sortOptions: SORT_OPTIONS,
|
|
400
400
|
columns,
|
|
401
|
-
mapRows: (response) => toRecordArray(response.
|
|
401
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => {
|
|
402
402
|
const itemsArr = Array.isArray(item.items) ? item.items : [];
|
|
403
403
|
/*
|
|
404
404
|
* Same legacy fallback as AdminOrdersView: `items[]` is canonical and
|
|
@@ -258,7 +258,6 @@ export function SellerPayoutSettingsView({ apiBase = SELLER_ENDPOINTS.PAYOUT_SET
|
|
|
258
258
|
const { shellCtx, setFieldError, clearErrors, validate } = useFormShellState(payoutSettingsDraftSchema, { sections: sectionMeta, onGoToSection: goToSection, fieldToSectionIndex });
|
|
259
259
|
useEffect(() => {
|
|
260
260
|
validate(draft);
|
|
261
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
262
261
|
}, [draft, validate]);
|
|
263
262
|
return (_jsx(StackedViewShell, { portal: "seller", title: "Payout Settings", sections: [
|
|
264
263
|
_jsxs(Div, { children: [error && _jsx(Alert, { variant: "error", className: "mb-4", children: error }), success && _jsx(Alert, { variant: "success", className: "mb-4", children: "Payout details saved." }), _jsxs(FormShellContext.Provider, { value: shellCtx, children: [_jsx(FormErrorSummary, {}), _jsx(SectionForm, { sections: sections, values: draft, onChange: update, onSubmit: handleSave, schema: payoutSettingsDraftSchema, openIds: openIds, onOpenChange: setOpenIds, submitLabel: "Save Payout Details", isLoading: busy })] })] }, "payout"),
|
|
@@ -105,7 +105,7 @@ export function SellerPayoutsView({ children, ...props }) {
|
|
|
105
105
|
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
106
106
|
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
107
107
|
],
|
|
108
|
-
mapRows: (response) => toRecordArray(response.
|
|
108
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => {
|
|
109
109
|
const id = toStringValue(item.id, `payout-${index}`);
|
|
110
110
|
rawByIdRef.current[id] = item;
|
|
111
111
|
return {
|
|
@@ -696,7 +696,6 @@ productId, onSave, onPublish, onDiscard, isLoading = false, storeSlug, renderCat
|
|
|
696
696
|
// seller types (per the "even on-change errors must be shown" requirement).
|
|
697
697
|
useEffect(() => {
|
|
698
698
|
validate(draft);
|
|
699
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
700
699
|
}, [draft, validate]);
|
|
701
700
|
/*
|
|
702
701
|
* `handleNext` and `stepValidationErrors` are gone with the wizard.
|
|
@@ -502,7 +502,7 @@ export function SellerProductsView({ onDeleteProduct, onCreateClick, }) {
|
|
|
502
502
|
columns: PRODUCT_COLUMNS,
|
|
503
503
|
primaryAction: onCreateClick ? { label: "New Listing", onClick: onCreateClick } : undefined,
|
|
504
504
|
mapRows: (response) => {
|
|
505
|
-
const rows = toRecordArray(response.
|
|
505
|
+
const rows = toRecordArray(response.items).map((item, index) => {
|
|
506
506
|
const lt = normalizeListingType(item);
|
|
507
507
|
// The row's own type, verbatim. This used to be a 4-branch ternary
|
|
508
508
|
// that collapsed classified / digital-code / live / art / stickers all
|
|
@@ -132,7 +132,6 @@ export function SellerShippingView({ apiBase = SELLER_ENDPOINTS.SHIPPING }) {
|
|
|
132
132
|
const { shellCtx, setFieldError, clearErrors, validate } = useFormShellState(shippingDraftSchema, { sections: sectionMeta, onGoToSection: goToSection, fieldToSectionIndex });
|
|
133
133
|
useEffect(() => {
|
|
134
134
|
validate(draft);
|
|
135
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
135
|
}, [draft, validate]);
|
|
137
136
|
return (_jsx(StackedViewShell, { portal: "seller", title: "Shipping Configuration", sections: [
|
|
138
137
|
_jsxs(Div, { children: [error && _jsx(Alert, { variant: "error", className: "mb-4", children: error }), success && _jsx(Alert, { variant: "success", className: "mb-4", children: "Shipping configuration saved." }), _jsxs(FormShellContext.Provider, { value: shellCtx, children: [_jsx(FormErrorSummary, {}), _jsx(SectionForm, { sections: sections, values: draft, onChange: update, onSubmit: handleSave, schema: shippingDraftSchema, openIds: openIds, onOpenChange: setOpenIds, submitLabel: "Save Configuration", isLoading: busy })] })] }, "shipping"),
|
|
@@ -86,7 +86,6 @@ export function SellerStorefrontView({ initialValues, onSave, isLoading = false,
|
|
|
86
86
|
const { shellCtx, setFieldError, clearErrors, validate } = useFormShellState(storefrontDraftSchema, { sections: sectionMeta, onGoToSection: goToSection, fieldToSectionIndex });
|
|
87
87
|
useEffect(() => {
|
|
88
88
|
validate(draft);
|
|
89
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
89
|
}, [draft, validate]);
|
|
91
90
|
return (_jsx(StackedViewShell, { portal: "seller", title: "Storefront Settings", sections: [
|
|
92
91
|
_jsxs(Div, { children: [saved && (_jsx(Alert, { variant: "success", className: "mb-6", children: "Changes saved successfully." })), _jsxs(FormShellContext.Provider, { value: shellCtx, children: [_jsx(FormErrorSummary, {}), _jsx(SectionForm, { sections: sections, values: draft, onChange: update, onSubmit: handleSave, schema: storefrontDraftSchema, openIds: openIds, onOpenChange: setOpenIds, submitLabel: "Save Storefront", isLoading: busy })] })] }, "stepform"),
|
|
@@ -35,8 +35,6 @@ export { SellerProductShell } from "./SellerProductShell";
|
|
|
35
35
|
export type { SellerProductShellProps, SellerProductDraft, ProductListingMode } from "./SellerProductShell";
|
|
36
36
|
export { SellerStoreSetupView } from "./SellerStoreSetupView";
|
|
37
37
|
export type { SellerStoreSetupViewProps } from "./SellerStoreSetupView";
|
|
38
|
-
export { SellerStoreView } from "./SellerStoreView";
|
|
39
|
-
export type { SellerStoreViewProps } from "./SellerStoreView";
|
|
40
38
|
export { SellerStorefrontView } from "./SellerStorefrontView";
|
|
41
39
|
export type { SellerStorefrontViewProps, StorefrontDraft } from "./SellerStorefrontView";
|
|
42
40
|
export { SellerShippingView } from "./SellerShippingView";
|
|
@@ -74,8 +72,6 @@ export { SellerCreateProductView as StoreCreateProductView } from "./SellerCreat
|
|
|
74
72
|
export type { SellerCreateProductViewProps as StoreCreateProductViewProps } from "./SellerCreateProductView";
|
|
75
73
|
export { SellerEditProductView as StoreEditProductView } from "./SellerEditProductView";
|
|
76
74
|
export type { SellerEditProductViewProps as StoreEditProductViewProps } from "./SellerEditProductView";
|
|
77
|
-
export { SellerStoreView as StoreStorefrontView } from "./SellerStoreView";
|
|
78
|
-
export type { SellerStoreViewProps as StoreStorefrontViewProps } from "./SellerStoreView";
|
|
79
75
|
export { SellerShippingView as StoreShippingView } from "./SellerShippingView";
|
|
80
76
|
export type { SellerShippingViewProps as StoreShippingViewProps } from "./SellerShippingView";
|
|
81
77
|
export { SellerAddressesView as StoreAddressesView } from "./SellerAddressesView";
|
|
@@ -17,7 +17,6 @@ export { SellerCreateProductView } from "./SellerCreateProductView.js";
|
|
|
17
17
|
export { SellerEditProductView } from "./SellerEditProductView.js";
|
|
18
18
|
export { SellerProductShell } from "./SellerProductShell.js";
|
|
19
19
|
export { SellerStoreSetupView } from "./SellerStoreSetupView.js";
|
|
20
|
-
export { SellerStoreView } from "./SellerStoreView.js";
|
|
21
20
|
export { SellerStorefrontView } from "./SellerStorefrontView.js";
|
|
22
21
|
export { SellerShippingView } from "./SellerShippingView.js";
|
|
23
22
|
export { SellerAddressesView } from "./SellerAddressesView.js";
|
|
@@ -40,7 +39,6 @@ export { SellerPayoutSettingsView as StorePayoutSettingsView } from "./SellerPay
|
|
|
40
39
|
export { SellerAnalyticsView as StoreAnalyticsView } from "./SellerAnalyticsView.js";
|
|
41
40
|
export { SellerCreateProductView as StoreCreateProductView } from "./SellerCreateProductView.js";
|
|
42
41
|
export { SellerEditProductView as StoreEditProductView } from "./SellerEditProductView.js";
|
|
43
|
-
export { SellerStoreView as StoreStorefrontView } from "./SellerStoreView.js";
|
|
44
42
|
export { SellerShippingView as StoreShippingView } from "./SellerShippingView.js";
|
|
45
43
|
export { SellerAddressesView as StoreAddressesView } from "./SellerAddressesView.js";
|
|
46
44
|
export { SellerBidsView as StoreBidsView } from "./SellerBidsView.js";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { JsonValue } from "../../../schemas/types";
|
|
8
8
|
import { BaseRepository, parseSieveDateValue } from "../../../providers/db-firebase";
|
|
9
9
|
import type { SieveModel, FirebaseSieveResult } from "../../../providers/db-firebase";
|
|
10
|
-
import type { OfferDocument, OfferCreateInput, OfferUpdateInput } from "../schemas";
|
|
10
|
+
import type { OfferDocument, OfferPlain, OfferCreateInput, OfferUpdateInput } from "../schemas";
|
|
11
11
|
import { type HistoryActor } from "../../../_internal/shared/history/index";
|
|
12
12
|
/**
|
|
13
13
|
* Who/why for a write that lands in an offer's `statusHistory`.
|
|
@@ -22,7 +22,19 @@ export interface OfferWriteContext {
|
|
|
22
22
|
declare class OfferRepository extends BaseRepository<OfferDocument> {
|
|
23
23
|
constructor();
|
|
24
24
|
/** Override mapDoc to auto-decrypt PII on every offer read */
|
|
25
|
-
|
|
25
|
+
/** Plaintext PII. **Opt-in and named** — shows up in review and in a grep. */
|
|
26
|
+
revealOffer(doc: OfferDocument): OfferPlain;
|
|
27
|
+
/** As `revealOffer`, for a list read. */
|
|
28
|
+
revealOffers(docs: readonly OfferDocument[]): OfferPlain[];
|
|
29
|
+
/**
|
|
30
|
+
* Masked PII — **the default for any surface that only needs to identify a
|
|
31
|
+
* row to a human.** Decrypts first, then masks: the mask helpers refuse
|
|
32
|
+
* ciphertext by design, so passing a stored field straight in would return
|
|
33
|
+
* "Anonymous" for every row.
|
|
34
|
+
*/
|
|
35
|
+
maskedOffer(doc: OfferDocument): OfferPlain;
|
|
36
|
+
/** As `maskedOffer`, for a list read. */
|
|
37
|
+
maskedOffers(docs: readonly OfferDocument[]): OfferPlain[];
|
|
26
38
|
/**
|
|
27
39
|
* Every Timestamp field here carries `parseValue: parseSieveDateValue`.
|
|
28
40
|
*
|
|
@@ -110,7 +122,7 @@ declare class OfferRepository extends BaseRepository<OfferDocument> {
|
|
|
110
122
|
list(model: SieveModel, opts?: {
|
|
111
123
|
search?: string;
|
|
112
124
|
}): Promise<FirebaseSieveResult<OfferDocument>>;
|
|
113
|
-
|
|
125
|
+
createOffer(input: OfferCreateInput): Promise<OfferPlain>;
|
|
114
126
|
findByBuyer(buyerUid: string, model?: SieveModel): Promise<FirebaseSieveResult<OfferDocument>>;
|
|
115
127
|
findByStore(storeId: string, model?: SieveModel, opts?: {
|
|
116
128
|
search?: string;
|
|
@@ -9,7 +9,7 @@ import { buildOfferSearchTxt } from "../../../utils/search-txt-builders.js";
|
|
|
9
9
|
import { BaseRepository, prepareForFirestore, parseSieveDateValue, } from "../../../providers/db-firebase/index.js";
|
|
10
10
|
import { OFFER_COLLECTION, OFFER_FIELDS, OFFER_TRACKED_FIELDS, createOfferId } from "../schemas/index.js";
|
|
11
11
|
import { withHistory } from "../../../_internal/shared/history/index.js";
|
|
12
|
-
import { encryptPiiFields,
|
|
12
|
+
import { encryptPiiFields, maskPii, revealPii, OFFER_PII_FIELDS, } from "../../../security/index.js";
|
|
13
13
|
/** Max rounds in one negotiation chain — matches the per-buyer offer limit. */
|
|
14
14
|
const OFFER_CHAIN_MAX = 3;
|
|
15
15
|
class OfferRepository extends BaseRepository {
|
|
@@ -17,11 +17,38 @@ class OfferRepository extends BaseRepository {
|
|
|
17
17
|
super(OFFER_COLLECTION);
|
|
18
18
|
}
|
|
19
19
|
/** Override mapDoc to auto-decrypt PII on every offer read */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
/*
|
|
21
|
+
* 🛑 `mapDoc` is NOT overridden, and that absence IS the change.
|
|
22
|
+
*
|
|
23
|
+
* It used to decrypt on every read, so ciphertext never left the database
|
|
24
|
+
* and every caller handled plaintext without ever saying so. Following
|
|
25
|
+
* `SiteSettingsRepository`: reads return what Firestore holds, and plaintext
|
|
26
|
+
* requires one of the two named methods below.
|
|
27
|
+
*
|
|
28
|
+
* A convention would not hold this. `OfferDocument`'s PII fields are
|
|
29
|
+
* `Encrypted<string>`, assignable to nothing that wants a plain `string`, so
|
|
30
|
+
* a reader that skips both accessors is a compile error naming file and line.
|
|
31
|
+
*/
|
|
32
|
+
/** Plaintext PII. **Opt-in and named** — shows up in review and in a grep. */
|
|
33
|
+
revealOffer(doc) {
|
|
34
|
+
return revealPii(doc, OFFER_PII_FIELDS);
|
|
35
|
+
}
|
|
36
|
+
/** As `revealOffer`, for a list read. */
|
|
37
|
+
revealOffers(docs) {
|
|
38
|
+
return docs.map((d) => this.revealOffer(d));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Masked PII — **the default for any surface that only needs to identify a
|
|
42
|
+
* row to a human.** Decrypts first, then masks: the mask helpers refuse
|
|
43
|
+
* ciphertext by design, so passing a stored field straight in would return
|
|
44
|
+
* "Anonymous" for every row.
|
|
45
|
+
*/
|
|
46
|
+
maskedOffer(doc) {
|
|
47
|
+
return maskPii(doc, OFFER_PII_FIELDS);
|
|
48
|
+
}
|
|
49
|
+
/** As `maskedOffer`, for a list read. */
|
|
50
|
+
maskedOffers(docs) {
|
|
51
|
+
return docs.map((d) => this.maskedOffer(d));
|
|
25
52
|
}
|
|
26
53
|
/**
|
|
27
54
|
* Paginated, Firestore-native offer list (admin use).
|
|
@@ -58,7 +85,14 @@ class OfferRepository extends BaseRepository {
|
|
|
58
85
|
return win.finish(result);
|
|
59
86
|
}
|
|
60
87
|
// --- Create --------------------------------------------------------------
|
|
61
|
-
|
|
88
|
+
/*
|
|
89
|
+
* 🛑 NOT an `override` of `create`. `BaseRepository.create` promises to
|
|
90
|
+
* accept the CIPHERTEXT shape; this accepts PLAINTEXT and encrypts, and
|
|
91
|
+
* `string` vs `Encrypted<string>` is incompatible in both directions, so an
|
|
92
|
+
* override is a TS2416 either way — correctly, because the two signatures
|
|
93
|
+
* genuinely disagree about what the caller holds.
|
|
94
|
+
*/
|
|
95
|
+
async createOffer(input) {
|
|
62
96
|
const now = new Date();
|
|
63
97
|
const expiresAt = new Date(now.getTime() + 48 * 60 * 60 * 1000); // 48 h
|
|
64
98
|
const id = createOfferId({
|
|
@@ -66,6 +100,8 @@ class OfferRepository extends BaseRepository {
|
|
|
66
100
|
buyerUid: input.buyerUid,
|
|
67
101
|
date: now,
|
|
68
102
|
});
|
|
103
|
+
// Plain in, ciphertext out — `encryptPiiFields` below is what makes the
|
|
104
|
+
// document type true.
|
|
69
105
|
const data = {
|
|
70
106
|
...input,
|
|
71
107
|
status: "pending",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { type GenerateOfferIdInput } from "../../../utils/id-generators";
|
|
5
5
|
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
6
6
|
import type { StatusChangeEntry } from "../../../_internal/shared/history/index";
|
|
7
|
+
import type { Encrypted, Plaintext } from "../../../security/encrypted";
|
|
7
8
|
export type OfferStatus = "pending" | "accepted" | "declined" | "countered" | "expired" | "withdrawn" | "paid";
|
|
8
9
|
/** Runtime-accessible offer status values — use instead of bare string literals. */
|
|
9
10
|
export declare const OfferStatusValues: {
|
|
@@ -15,6 +16,16 @@ export declare const OfferStatusValues: {
|
|
|
15
16
|
readonly WITHDRAWN: "withdrawn";
|
|
16
17
|
readonly PAID: "paid";
|
|
17
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* `OfferDocument` with its PII as plain `string` — what the named repository
|
|
21
|
+
* accessors return, and what a WRITE path accepts (the repository encrypts).
|
|
22
|
+
*
|
|
23
|
+
* `Plaintext<T>` is the one definition of this shape; see `security/encrypted.ts`.
|
|
24
|
+
* It is deliberately NOT distinguishable from a MASKED value — `maskPii`
|
|
25
|
+
* returns plain strings too, and no type can express "these characters are
|
|
26
|
+
* asterisks". The distinction is which named method you called.
|
|
27
|
+
*/
|
|
28
|
+
export type OfferPlain = Plaintext<OfferDocument>;
|
|
18
29
|
export interface OfferDocument extends BaseDocument {
|
|
19
30
|
/** Word-prefix search tokens. Derived on write; never fed by a PII field. */
|
|
20
31
|
searchTxt?: string[];
|
|
@@ -23,8 +34,8 @@ export interface OfferDocument extends BaseDocument {
|
|
|
23
34
|
productSlug?: string;
|
|
24
35
|
productImageUrl?: string;
|
|
25
36
|
buyerUid: string;
|
|
26
|
-
buyerName: string
|
|
27
|
-
buyerEmail: string
|
|
37
|
+
buyerName: Encrypted<string>;
|
|
38
|
+
buyerEmail: Encrypted<string>;
|
|
28
39
|
storeId: string;
|
|
29
40
|
storeName: string;
|
|
30
41
|
offerAmount: number;
|
|
@@ -126,7 +137,7 @@ export declare const OFFER_FIELDS: {
|
|
|
126
137
|
/** Word-prefix n-grams for `array-contains` search. Derived by `buildOfferSearchTxt`. */
|
|
127
138
|
readonly SEARCH_TXT: "searchTxt";
|
|
128
139
|
};
|
|
129
|
-
export type OfferCreateInput = Pick<
|
|
140
|
+
export type OfferCreateInput = Pick<OfferPlain, "productId" | "productTitle" | "productSlug" | "productImageUrl" | "buyerUid" | "buyerName" | "buyerEmail" | "storeId" | "storeName" | "offerAmount" | "listedPrice" | "currency" | "buyerNote" | "previousOfferId" | "chainRootOfferId" | "counterRound">;
|
|
130
141
|
export type OfferUpdateInput = Partial<Pick<OfferDocument, "status" | "counterAmount" | "lockedPrice" | "sellerNote" | "acceptedAt" | "checkoutDeadline" | "respondedAt" | "paidOrderId" | "paidAt" | "updatedAt" | "statusHistory" | "statusHistoryTruncated" | "supersededByOfferId" | "cancelledByAdminUid" | "cancelReason">>;
|
|
131
142
|
export declare const offerQueryHelpers: {
|
|
132
143
|
readonly byBuyer: (buyerUid: string) => readonly ["buyerUid", "==", string];
|
|
@@ -213,15 +213,15 @@ export declare const sellerListParamsSchema: z.ZodObject<{
|
|
|
213
213
|
status?: "pending" | "active" | "rejected" | "suspended" | undefined;
|
|
214
214
|
page?: number | undefined;
|
|
215
215
|
q?: string | undefined;
|
|
216
|
-
perPage?: number | undefined;
|
|
217
216
|
category?: string | undefined;
|
|
217
|
+
perPage?: number | undefined;
|
|
218
218
|
}, {
|
|
219
219
|
sort?: string | undefined;
|
|
220
220
|
status?: "pending" | "active" | "rejected" | "suspended" | undefined;
|
|
221
221
|
page?: number | undefined;
|
|
222
222
|
q?: string | undefined;
|
|
223
|
-
perPage?: number | undefined;
|
|
224
223
|
category?: string | undefined;
|
|
224
|
+
perPage?: number | undefined;
|
|
225
225
|
}>;
|
|
226
226
|
export declare const payoutListParamsSchema: z.ZodObject<{
|
|
227
227
|
sellerId: z.ZodOptional<z.ZodString>;
|
|
@@ -233,12 +233,12 @@ export declare const payoutListParamsSchema: z.ZodObject<{
|
|
|
233
233
|
sort?: string | undefined;
|
|
234
234
|
status?: "paid" | "failed" | "pending" | "processing" | undefined;
|
|
235
235
|
page?: number | undefined;
|
|
236
|
-
perPage?: number | undefined;
|
|
237
236
|
sellerId?: string | undefined;
|
|
237
|
+
perPage?: number | undefined;
|
|
238
238
|
}, {
|
|
239
239
|
sort?: string | undefined;
|
|
240
240
|
status?: "paid" | "failed" | "pending" | "processing" | undefined;
|
|
241
241
|
page?: number | undefined;
|
|
242
|
-
perPage?: number | undefined;
|
|
243
242
|
sellerId?: string | undefined;
|
|
243
|
+
perPage?: number | undefined;
|
|
244
244
|
}>;
|
|
@@ -31,3 +31,42 @@ export declare const sellerOrderUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
31
31
|
carrier?: string | undefined;
|
|
32
32
|
}>;
|
|
33
33
|
export type SellerOrderUpdateValues = z.infer<typeof sellerOrderUpdateSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Manual shipment entry. `method` is a literal rather than an enum because
|
|
36
|
+
* `ManualShippingProvider` is the only provider — see § "Provider Resolution".
|
|
37
|
+
*/
|
|
38
|
+
export declare const shipOrderSchema: z.ZodObject<{
|
|
39
|
+
method: z.ZodLiteral<"custom">;
|
|
40
|
+
shippingCarrier: z.ZodString;
|
|
41
|
+
trackingNumber: z.ZodString;
|
|
42
|
+
trackingUrl: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
trackingNumber: string;
|
|
45
|
+
shippingCarrier: string;
|
|
46
|
+
trackingUrl: string;
|
|
47
|
+
method: "custom";
|
|
48
|
+
}, {
|
|
49
|
+
trackingNumber: string;
|
|
50
|
+
shippingCarrier: string;
|
|
51
|
+
trackingUrl: string;
|
|
52
|
+
method: "custom";
|
|
53
|
+
}>;
|
|
54
|
+
export type ShipOrderValues = z.infer<typeof shipOrderSchema>;
|
|
55
|
+
/**
|
|
56
|
+
* Marking one EMI installment paid. `installmentIndex` is 1-based, matching
|
|
57
|
+
* how the schedule is presented to the buyer.
|
|
58
|
+
*/
|
|
59
|
+
export declare const markEmiInstallmentPaidSchema: z.ZodObject<{
|
|
60
|
+
installmentIndex: z.ZodNumber;
|
|
61
|
+
transactionId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
proofUrl: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
installmentIndex: number;
|
|
65
|
+
transactionId?: string | undefined;
|
|
66
|
+
proofUrl?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
installmentIndex: number;
|
|
69
|
+
transactionId?: string | undefined;
|
|
70
|
+
proofUrl?: string | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
export type MarkEmiInstallmentPaidValues = z.infer<typeof markEmiInstallmentPaidSchema>;
|
|
@@ -73,3 +73,40 @@ export const sellerOrderUpdateSchema = z
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
+
/*
|
|
77
|
+
* ── Two schemas lifted out of a `"use server"` module, 2026-10-17 ──
|
|
78
|
+
*
|
|
79
|
+
* `shipOrderSchema` and `markEmiInstallmentPaidSchema` were declared privately
|
|
80
|
+
* inside `src/actions/seller.actions.ts`. The actions safe-parse with them, so
|
|
81
|
+
* the rule WAS enforced — but their routes could not reach it: a `"use server"`
|
|
82
|
+
* module may only export async functions, so a schema declared there is
|
|
83
|
+
* unexportable by construction.
|
|
84
|
+
*
|
|
85
|
+
* The consequence was that `POST /api/store/orders/[id]/ship` and
|
|
86
|
+
* `PATCH .../emi-installment` both did `parseJsonBody(…).catch(() => ({}))`
|
|
87
|
+
* and handed the result on `as never` — a route reading a body it could not
|
|
88
|
+
* validate, with the real check an import away and unreachable.
|
|
89
|
+
*
|
|
90
|
+
* Declared here so the route and the action share ONE definition rather than
|
|
91
|
+
* two copies that drift (Root Cause #75). The action keeps its own `safeParse`:
|
|
92
|
+
* it is also called directly from a server action, where no route ran first.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* Manual shipment entry. `method` is a literal rather than an enum because
|
|
96
|
+
* `ManualShippingProvider` is the only provider — see § "Provider Resolution".
|
|
97
|
+
*/
|
|
98
|
+
export const shipOrderSchema = z.object({
|
|
99
|
+
method: z.literal("custom"),
|
|
100
|
+
shippingCarrier: z.string().min(1),
|
|
101
|
+
trackingNumber: z.string().min(1),
|
|
102
|
+
trackingUrl: z.string().url(),
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Marking one EMI installment paid. `installmentIndex` is 1-based, matching
|
|
106
|
+
* how the schedule is presented to the buyer.
|
|
107
|
+
*/
|
|
108
|
+
export const markEmiInstallmentPaidSchema = z.object({
|
|
109
|
+
installmentIndex: z.number().int().min(1),
|
|
110
|
+
transactionId: z.string().min(1).optional(),
|
|
111
|
+
proofUrl: z.string().min(1).optional(),
|
|
112
|
+
});
|
|
@@ -6,7 +6,7 @@ import { Button } from "../../ui/components/Button.js";
|
|
|
6
6
|
import { IconButton } from "../../ui/components/IconButton.js";
|
|
7
7
|
import { classNames } from "../../ui/style.helper.js";
|
|
8
8
|
import { FORM_ACTION_META, FORM_ACTION_ID } from "../products/constants/action-defs.js";
|
|
9
|
-
import { ActionRow, Div, Row, Span, Stack, Text } from "../../ui/index.js";
|
|
9
|
+
import { ActionRow, Div, OverflowRow, Row, Span, Stack, Text } from "../../ui/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* Carries the `schema` prop passed to `<FormShell>` down to any nested
|
|
12
12
|
* `<SectionForm>` that doesn't declare its own `schema`/`SectionDef.schema` —
|
|
@@ -122,7 +122,11 @@ export function FormShell({ isOpen, onClose, title, breadcrumb, schema, isDirty
|
|
|
122
122
|
};
|
|
123
123
|
if (!isOpen)
|
|
124
124
|
return null;
|
|
125
|
-
return (_jsxs(FormSchemaContext.Provider, { value: schema, children: [_jsx(Div, { surface: "overlay-sm", className: "fixed inset-0 backdrop-blur-[2px]", style: { zIndex: "calc(var(--appkit-z-modal) - 1)" }, "aria-hidden": "true", onClick: attemptClose }), _jsxs(Div, { layout: "flex", ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 bottom-0 left-0 right-0 lg:left-[10%] lg:right-[10%] [flex-direction:column] bg-[var(--appkit-color-surface)]", shadow: "2xl", style: { zIndex: "var(--appkit-z-modal)" }, children: [_jsxs(Row, { gap: "sm", paddingX: "x-5", className: "flex-shrink-0 sticky top-0 z-10 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", padding: "y-sm", children: [previewMode ? (_jsxs(Button, { variant: "ghost", type: "button", onClick: () => setPreviewMode(false), "aria-label": "Back to edit", gap: "xs", rounded: "lg", textSize: "sm", textColor: "muted", className: "flex-shrink-0", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Back to Edit" })] })) : (_jsx(IconButton, { type: "button", onClick: attemptClose, "aria-label": "Close", variant: "ghost", rounded: "lg", className: "text-[var(--appkit-color-text-muted)] flex-shrink-0", children: _jsx(X, { className: "w-5 h-5" }) })), _jsxs(Div, { className: "flex-1 min-w-0", children: [breadcrumb && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)] truncate mb-0.5", size: "xs", children: breadcrumb })), _jsx(Text, { className: "text-[var(--appkit-color-text)] truncate", size: "sm", weight: "semibold", children: previewMode ? `Preview — ${title}` : title })] }), _jsx(Row, { gap: "xs", className: "flex-shrink-0", children: previewMode ? null : (_jsxs(_Fragment, { children: [previewSlot && (_jsxs(Button, { variant: "outline", type: "button", onClick: () => setPreviewMode(true), gap: "xs", rounded: "lg", paddingX: "sm", textSize: "sm", textColor: "muted", children: [_jsx(Eye, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Preview" })] })), onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsx(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: publishLabel }))] })) })] }), _jsxs(Div, { layout: "flex", className: `flex-1 ${__O.hidden}`, children: [sections && sections.length > 0 && !previewMode && (_jsx("nav", { "aria-label": "Form sections", className: "hidden lg:flex flex-col flex-shrink-0 w-48 border-r border-[var(--appkit-color-border)] py-[var(--appkit-space-4)] px-[var(--appkit-space-3)] gap-[var(--appkit-space-1)] overflow-y-auto", children: sections.map((sec) => (_jsx(Button, { variant: "ghost", type: "button", onClick: () => scrollToSection(sec.id), rounded: "lg", paddingX: "sm", paddingY: "xs", textSize: "sm", textColor: "muted", justify: "start", className: "text-left", children: sec.label }, sec.id))) })), sections && sections.length > 0 && !previewMode && (_jsx(Row, { gap: "px", className:
|
|
125
|
+
return (_jsxs(FormSchemaContext.Provider, { value: schema, children: [_jsx(Div, { surface: "overlay-sm", className: "fixed inset-0 backdrop-blur-[2px]", style: { zIndex: "calc(var(--appkit-z-modal) - 1)" }, "aria-hidden": "true", onClick: attemptClose }), _jsxs(Div, { layout: "flex", ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 bottom-0 left-0 right-0 lg:left-[10%] lg:right-[10%] [flex-direction:column] bg-[var(--appkit-color-surface)]", shadow: "2xl", style: { zIndex: "var(--appkit-z-modal)" }, children: [_jsxs(Row, { gap: "sm", paddingX: "x-5", className: "flex-shrink-0 sticky top-0 z-10 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", padding: "y-sm", children: [previewMode ? (_jsxs(Button, { variant: "ghost", type: "button", onClick: () => setPreviewMode(false), "aria-label": "Back to edit", gap: "xs", rounded: "lg", textSize: "sm", textColor: "muted", className: "flex-shrink-0", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Back to Edit" })] })) : (_jsx(IconButton, { type: "button", onClick: attemptClose, "aria-label": "Close", variant: "ghost", rounded: "lg", className: "text-[var(--appkit-color-text-muted)] flex-shrink-0", children: _jsx(X, { className: "w-5 h-5" }) })), _jsxs(Div, { className: "flex-1 min-w-0", children: [breadcrumb && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)] truncate mb-0.5", size: "xs", children: breadcrumb })), _jsx(Text, { className: "text-[var(--appkit-color-text)] truncate", size: "sm", weight: "semibold", children: previewMode ? `Preview — ${title}` : title })] }), _jsx(Row, { gap: "xs", className: "flex-shrink-0", children: previewMode ? null : (_jsxs(_Fragment, { children: [previewSlot && (_jsxs(Button, { variant: "outline", type: "button", onClick: () => setPreviewMode(true), gap: "xs", rounded: "lg", paddingX: "sm", textSize: "sm", textColor: "muted", children: [_jsx(Eye, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Preview" })] })), onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsx(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: publishLabel }))] })) })] }), _jsxs(Div, { layout: "flex", className: `flex-1 ${__O.hidden}`, children: [sections && sections.length > 0 && !previewMode && (_jsx("nav", { "aria-label": "Form sections", className: "hidden lg:flex flex-col flex-shrink-0 w-48 border-r border-[var(--appkit-color-border)] py-[var(--appkit-space-4)] px-[var(--appkit-space-3)] gap-[var(--appkit-space-1)] overflow-y-auto", children: sections.map((sec) => (_jsx(Button, { variant: "ghost", type: "button", onClick: () => scrollToSection(sec.id), rounded: "lg", paddingX: "sm", paddingY: "xs", textSize: "sm", textColor: "muted", justify: "start", className: "text-left", children: sec.label }, sec.id))) })), sections && sections.length > 0 && !previewMode && (_jsx(Row, { gap: "px", className: "lg:hidden fixed top-[var(--form-shell-topbar-h,57px)] left-0 right-0 z-10 px-[1.25rem] bg-[var(--appkit-color-surface)] border-b border-[var(--appkit-color-border)]", padding: "y-xs", children: _jsx(OverflowRow, { items: sections.map((sec) => ({
|
|
126
|
+
id: sec.id,
|
|
127
|
+
label: sec.label,
|
|
128
|
+
onSelect: () => scrollToSection(sec.id),
|
|
129
|
+
})), ariaLabel: "Form sections", variant: "nav", placeholder: "Jump to section", searchPlaceholder: "Search sections\u2026" }) })), _jsx(Div, { ref: bodyRef, className: classNames("flex-1 overflow-y-auto", sections && sections.length > 0 && !previewMode ? "pt-[var(--appkit-space-0)] lg:pt-[var(--appkit-space-0)]" : ""), children: previewMode && previewSlot ? (_jsxs(_Fragment, { children: [_jsxs(Row, { textSize: "sm", gap: "xs", className: "sticky top-0 z-10 bg-[var(--appkit-color-warning-surface)] border-b border-[var(--appkit-color-warning)] text-[var(--appkit-color-warning-text,var(--appkit-color-warning))]", paddingY: "y-xs", paddingX: "x-md", children: [_jsx(Eye, { className: "w-4 h-4 flex-shrink-0" }), _jsx(Span, { children: "Preview \u2014 not visible to buyers until published" })] }), _jsx(Div, { padding: "y-md", children: previewSlot() })] })) : splitPreview && previewSlot ? (
|
|
126
130
|
// S-STORE-3-D — desktop 60/40 split: form left, preview right.
|
|
127
131
|
// Below `lg`, falls back to single-column form (preview-as-modal via existing toggle).
|
|
128
132
|
_jsxs(Div, { className: "lg:grid lg:grid-cols-[3fr_2fr] lg:gap-[1.5rem] lg:px-[1.5rem] lg:py-[1.5rem] lg:max-w-[1400px] lg:mx-auto", children: [_jsx(Div, { className: "max-w-3xl mx-auto px-[1.25rem] sm:px-[1.5rem] lg:max-w-none lg:px-[0] lg:py-[0]", padding: "y-lg", children: children }), _jsxs(Div, { className: `hidden lg:block sticky lg:top-4 lg:self-start lg:max-h-[calc(100vh-6rem)] ${__O.yAuto} border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-raised)] ${__P.p4}`, rounded: "lg", children: [_jsxs(Row, { textWeight: "semibold", textSize: "xs", gap: "xs", className: "mb-3 uppercase tracking-wide text-[var(--appkit-color-text-muted)]", children: [_jsx(Eye, { className: "w-3.5 h-3.5" }), _jsx(Span, { children: "Live preview" })] }), previewSlot()] })] })) : (_jsx(Div, { className: "max-w-3xl mx-auto px-[1.25rem] sm:px-[1.5rem]", padding: "y-lg", children: children })) })] }), !previewMode && renderBottomBar ? (renderBottomBar()) : !previewMode && (onSaveDraft || onPublish) ? (_jsxs(Stack, { gap: "none", className: "flex-shrink-0 sticky bottom-0 z-10 border-t border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", children: [footerTopSlot && (_jsx(Div, { paddingX: "x-5", padding: "t-sm", children: footerTopSlot })), _jsxs(ActionRow, { align: "end", paddingX: "x-5", padding: "y-sm", style: { paddingBottom: "calc(var(--appkit-space-3) + var(--keyboard-inset-height, 0px))" }, anchor: _jsx(Button, { variant: "ghost", size: "sm", onClick: attemptClose, disabled: isLoading, children: FORM_ACTION_META[FORM_ACTION_ID.DISCARD].label }), children: [onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsxs(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: [publishLabel, " \u2192"] }))] })] })) : null] }), showUnsaved && (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-lg", className: "fixed inset-0", style: { zIndex: "var(--appkit-z-confirm)" }, onClick: () => setShowUnsaved(false) }), _jsxs(Div, { className: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-sm bg-[var(--appkit-color-surface)]", shadow: "2xl", rounded: "xl", padding: "lg", style: { zIndex: "var(--appkit-z-confirm)" }, children: [_jsxs(Row, { gap: "sm", align: "start", className: "mb-4", children: [_jsx(Span, { layout: "flex-center", className: "flex-shrink-0 w-10 h-10 bg-[var(--appkit-color-warning-surface)]", rounded: "full", children: _jsx(AlertTriangle, { className: "w-5 h-5 text-[var(--appkit-color-warning)]" }) }), _jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", weight: "semibold", children: "Unsaved changes" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "You have unsaved changes. Leave without saving?" })] })] }), _jsxs(Row, { gap: "xs", justify: "end", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowUnsaved(false), children: "Stay" }), _jsx(Button, { variant: "danger", size: "sm", onClick: () => { setShowUnsaved(false); onClose(); }, children: "Leave" })] })] })] }))] }));
|
|
@@ -6,7 +6,21 @@ import { Button } from "../../ui/components/Button.js";
|
|
|
6
6
|
import { IconButton } from "../../ui/components/IconButton.js";
|
|
7
7
|
import { FormField } from "../../ui/components/FormField.js";
|
|
8
8
|
import { Toggle } from "../../ui/components/Toggle.js";
|
|
9
|
-
|
|
9
|
+
/*
|
|
10
|
+
* Defining modules, not the `ui` barrel — Root Cause #18.
|
|
11
|
+
*
|
|
12
|
+
* `ui/index.ts` re-exports `FormField`, `PaginatedSelect` and
|
|
13
|
+
* `RecordDetailModal`, and those three import back INTO `features/media` and
|
|
14
|
+
* `features/shell`. So reaching a primitive through the barrel closed a
|
|
15
|
+
* ten-module cycle (`audit-import-cycles` component 1) — while the deep paths
|
|
16
|
+
* below have one direction only. `ui → features/media` is the real dependency
|
|
17
|
+
* and it stays; the barrel hop is what did not need to exist.
|
|
18
|
+
*/
|
|
19
|
+
import { ActionRow } from "../../ui/components/ActionRow.js";
|
|
20
|
+
import { Div } from "../../ui/components/Div.js";
|
|
21
|
+
import { Form } from "../../ui/components/Form.js";
|
|
22
|
+
import { Row, Stack } from "../../ui/components/Layout.js";
|
|
23
|
+
import { Text } from "../../ui/components/Typography.js";
|
|
10
24
|
import { FormShellContext, FormErrorSummary } from "../../ui/forms/index.js";
|
|
11
25
|
import { useHandMode } from "../../_internal/client/hand-mode/index.js";
|
|
12
26
|
function initValues(fields, defaults = {}) {
|
|
@@ -62,7 +62,6 @@ export function AdminShipmentEditorView({ shipmentId, onSaved }) {
|
|
|
62
62
|
laborRatePerHour: doc.laborRatePerHour ?? 0,
|
|
63
63
|
notes: doc.notes ?? "",
|
|
64
64
|
});
|
|
65
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
65
|
}, [shipment]);
|
|
67
66
|
const saveMutation = useApiMutation({
|
|
68
67
|
successMessage: isCreate ? "Shipment created" : "Shipment updated",
|
|
@@ -40,7 +40,7 @@ export function AdminShipmentsView({ children, ...props }) {
|
|
|
40
40
|
{ value: sortBy("projectedProfit", "DESC"), label: "Highest projected profit" },
|
|
41
41
|
{ value: "shipmentNumber", label: "Shipment # A–Z" },
|
|
42
42
|
],
|
|
43
|
-
mapRows: (response) => toRecordArray(response.
|
|
43
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => {
|
|
44
44
|
const totals = item.totals ?? {};
|
|
45
45
|
const totalsComputedAt = item.totalsComputedAt;
|
|
46
46
|
const updatedAt = item.updatedAt;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PrecisionTier } from "../../../_internal/shared/features/sticker-trace/types";
|
|
2
|
+
export interface StickerCommitResult {
|
|
3
|
+
sheetId: string;
|
|
4
|
+
runId: string;
|
|
5
|
+
/** Carries the single per-run claim for the live progress channel. */
|
|
6
|
+
customToken: string;
|
|
7
|
+
}
|
|
8
|
+
export interface StickerCommitPanelProps {
|
|
9
|
+
/** The file the studio is currently showing. Null disables the whole panel. */
|
|
10
|
+
file: File | null;
|
|
11
|
+
/** The raster's real size, from the studio's own decode. */
|
|
12
|
+
dimensions: {
|
|
13
|
+
widthPx: number;
|
|
14
|
+
heightPx: number;
|
|
15
|
+
} | null;
|
|
16
|
+
/**
|
|
17
|
+
* Does the whole three-hop commit. Injected rather than imported so this
|
|
18
|
+
* component stays in appkit and the consumer owns the transport — the same
|
|
19
|
+
* seam the codec uses.
|
|
20
|
+
*/
|
|
21
|
+
onCommit: (input: {
|
|
22
|
+
file: File;
|
|
23
|
+
title: string;
|
|
24
|
+
tier: PrecisionTier;
|
|
25
|
+
widthPx: number;
|
|
26
|
+
heightPx: number;
|
|
27
|
+
}) => Promise<StickerCommitResult>;
|
|
28
|
+
onCommitted?: (result: StickerCommitResult) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function StickerCommitPanel({ file, dimensions, onCommit, onCommitted, }: StickerCommitPanelProps): import("react").JSX.Element;
|