@mohasinac/appkit 4.52.4 → 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 +12 -3
- package/dist/features/layout/AppLayoutShell.js +65 -13
- 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.d.ts +1 -3
- package/dist/features/layout/TitleBarLayout.js +3 -4
- 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/design-ux__header-controls-and-messages.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/design-ux__header-controls-and-messages.js +85 -0
- package/dist/features/tester/seed-data/authored/index.js +10 -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 +235 -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
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// The defining module, not the `/client` entry — this is reached from
|
|
2
|
+
// server-only metadata paths (Root Cause #76).
|
|
3
|
+
import { ROUTES } from "../../../../next/routing/route-map.js";
|
|
1
4
|
export function buildRobots({ siteUrl }) {
|
|
2
5
|
return {
|
|
3
6
|
rules: [
|
|
@@ -12,7 +15,24 @@ export function buildRobots({ siteUrl }) {
|
|
|
12
15
|
"/auth/",
|
|
13
16
|
"/checkout/",
|
|
14
17
|
"/cart/",
|
|
15
|
-
|
|
18
|
+
/*
|
|
19
|
+
* The one entry here that is a PAGE rather than a subtree prefix —
|
|
20
|
+
* its twelve siblings end in "/" because they disallow a whole tree,
|
|
21
|
+
* and `/wishlist` is a single route. So it genuinely is a route
|
|
22
|
+
* reference and takes the constant; the earlier
|
|
23
|
+
* eslint-disable here was treating a real finding as noise.
|
|
24
|
+
*/
|
|
25
|
+
ROUTES.USER.WISHLIST,
|
|
26
|
+
/*
|
|
27
|
+
* Admin-only tool under a public prefix. Belongs here for the same
|
|
28
|
+
* reason /admin/ does, and takes the CONSTANT rather than a literal
|
|
29
|
+
* so a route rename cannot leave this entry pointing at nothing.
|
|
30
|
+
*
|
|
31
|
+
* 🛑 A Disallow stops the crawl, which means the page's own
|
|
32
|
+
* `noindex` is never read — the layout's server-side redirect is
|
|
33
|
+
* what actually guarantees there is no indexable content here.
|
|
34
|
+
*/
|
|
35
|
+
ROUTES.PUBLIC.TOOL_STICKER_TRACER,
|
|
16
36
|
"/preview/",
|
|
17
37
|
"/track/",
|
|
18
38
|
"/unauthorized/",
|
|
@@ -117,7 +117,7 @@ function staticPages(baseUrl) {
|
|
|
117
117
|
page(String(ROUTES.PUBLIC.AUCTIONS), "daily", 0.9),
|
|
118
118
|
page(String(ROUTES.PUBLIC.CATEGORIES), "weekly", 0.8),
|
|
119
119
|
page(String(ROUTES.PUBLIC.BRANDS), "weekly", 0.7),
|
|
120
|
-
page(String(ROUTES.
|
|
120
|
+
page(String(ROUTES.BLOG.LIST), "daily", 0.7),
|
|
121
121
|
page(String(ROUTES.PUBLIC.EVENTS), "daily", 0.7),
|
|
122
122
|
page(String(ROUTES.PUBLIC.SELLERS), "weekly", 0.6),
|
|
123
123
|
page(String(ROUTES.PUBLIC.ABOUT), "monthly", 0.5),
|
|
@@ -55,14 +55,26 @@ export const getProductFeaturesForStore = cache(async (storeId) => safeRead(() =
|
|
|
55
55
|
// Export names in stores/data.ts stay identical so consumers need no changes.
|
|
56
56
|
export function makeGetStoreListingsInitial(type, pageSize) {
|
|
57
57
|
return cache(async (storeId, page = 1) => {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
/*
|
|
59
|
+
* 🛑 `safeRead`, not `.catch(() => null)`. This factory backs every
|
|
60
|
+
* per-type store listing tab, so a swallowed failure renders a seller's
|
|
61
|
+
* page as "no listings" — which is Root Cause #59's exact shape, where a
|
|
62
|
+
* `FAILED_PRECONDITION` from a missing composite index was indistinguishable
|
|
63
|
+
* from an empty catalogue and stayed invisible for weeks.
|
|
64
|
+
*
|
|
65
|
+
* Same `null` fallback and same empty render; the difference is that the
|
|
66
|
+
* failure now lands in `serverErrors` as a `DEGRADED_READ`.
|
|
67
|
+
*/
|
|
68
|
+
const result = await safeRead(() => productRepository.list({
|
|
60
69
|
filters: `storeId==${storeId},status==published,listingType==${type}`,
|
|
61
70
|
sorts: "-createdAt",
|
|
62
71
|
page,
|
|
63
72
|
pageSize,
|
|
64
|
-
})
|
|
65
|
-
|
|
73
|
+
}), {
|
|
74
|
+
route: `store-listing:${type}`,
|
|
75
|
+
key: "products.listByStoreAndType",
|
|
76
|
+
fallback: null,
|
|
77
|
+
});
|
|
66
78
|
return { items: result?.items ?? [], total: result?.total ?? 0 };
|
|
67
79
|
});
|
|
68
80
|
}
|
|
@@ -37,7 +37,7 @@ import type { PublicSiteSettings } from "../../../shared/features/site-settings/
|
|
|
37
37
|
* was traced to a call site; anything without one belongs in the private list,
|
|
38
38
|
* because an unused public field is pure attack surface.
|
|
39
39
|
*/
|
|
40
|
-
export declare const PUBLIC_SITE_SETTINGS_FIELDS: readonly ["contact", "payment", "listings", "notificationChannels", "announcementBar", "navConfig", "actionConfig", "background", "watermark", "disabledRoutes", "chat"];
|
|
40
|
+
export declare const PUBLIC_SITE_SETTINGS_FIELDS: readonly ["contact", "payment", "listings", "notificationChannels", "announcementBar", "navConfig", "actionConfig", "background", "watermark", "disabledRoutes", "chat", "search"];
|
|
41
41
|
/** Everything else, with the reason it stays server-side. */
|
|
42
42
|
export declare const PRIVATE_SITE_SETTINGS_FIELDS: readonly ["id", "createdAt", "updatedAt", "credentials", "emailSettings", "legalPages", "commissions", "emi", "gst", "laborRate", "adSettings", "integrations", "platformLimits", "auctionConfig", "siteName", "tagline", "motto", "logo", "favicon", "seo", "socialLinks", "features", "shipping", "returns", "faq", "aboutContent", "navbarConfig", "footerConfig", "theme", "featuredResults", "messaging"];
|
|
43
43
|
export interface ToPublicSiteSettingsOptions {
|
|
@@ -37,6 +37,20 @@ export const PUBLIC_SITE_SETTINGS_FIELDS = [
|
|
|
37
37
|
// render a "Message seller" CTA at all. Narrowed to `enabled` only; there is
|
|
38
38
|
// nothing else in the group.
|
|
39
39
|
"chat",
|
|
40
|
+
/*
|
|
41
|
+
* useSearchIndex — the kill switch for the browser-side search artifact.
|
|
42
|
+
*
|
|
43
|
+
* Public because the reader is a GUEST's search box: search is the one
|
|
44
|
+
* surface that must work before anyone signs in, so a server-only flag
|
|
45
|
+
* could not reach the visitor it governs. Publishing it discloses one
|
|
46
|
+
* boolean meaning "site search currently falls back to the server path",
|
|
47
|
+
* which is observable from the outside anyway by watching which request
|
|
48
|
+
* the page makes.
|
|
49
|
+
*
|
|
50
|
+
* 🛑 It fails OPEN on absence (`!== false`), so a settings fetch that fails
|
|
51
|
+
* leaves search working rather than dark — see the schema note.
|
|
52
|
+
*/
|
|
53
|
+
"search",
|
|
40
54
|
];
|
|
41
55
|
/** Everything else, with the reason it stays server-side. */
|
|
42
56
|
export const PRIVATE_SITE_SETTINGS_FIELDS = [
|
|
@@ -112,5 +126,17 @@ export function toPublicSiteSettings(doc, opts) {
|
|
|
112
126
|
effectiveWatermark: opts?.effectiveWatermark,
|
|
113
127
|
// D9 — undefined reads as OFF, never a default-true `??`.
|
|
114
128
|
chat: { enabled: doc.chat?.enabled === true },
|
|
129
|
+
/*
|
|
130
|
+
* 🛑 `!== false`, the opposite of the line above it, and the two sit
|
|
131
|
+
* together deliberately so the difference is visible rather than looking
|
|
132
|
+
* like one of them is a mistake.
|
|
133
|
+
*
|
|
134
|
+
* `chat` is a feature nobody has turned on yet; absent means off. This is
|
|
135
|
+
* a kill switch on a path that is already the primary one; absent means
|
|
136
|
+
* ON, and only an explicit `false` disables it. Normalised here rather
|
|
137
|
+
* than at the reader so there is one place that decides, and a client
|
|
138
|
+
* cannot accidentally re-derive it with `??`.
|
|
139
|
+
*/
|
|
140
|
+
search: { indexEnabled: doc.search?.indexEnabled !== false },
|
|
115
141
|
};
|
|
116
142
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type StickerTraceRunDocument } from "../../../../features/sticker-trace/schemas/firestore";
|
|
2
|
+
import { type ResumeDecision } from "../../../shared/features/sticker-trace/resume";
|
|
3
|
+
import type { PrecisionTier, TraceParams, TraceStage } from "../../../shared/features/sticker-trace/types";
|
|
4
|
+
/** What a caller needs to watch a run it just started. */
|
|
5
|
+
export interface TraceRunHandle {
|
|
6
|
+
runId: string;
|
|
7
|
+
/** Carries the single `stickerTraceRunId` claim for this run's channel. */
|
|
8
|
+
customToken: string;
|
|
9
|
+
}
|
|
10
|
+
export interface StartTraceRunInput {
|
|
11
|
+
sheetId: string;
|
|
12
|
+
/** 🛑 Mandatory, and validated here rather than trusted. */
|
|
13
|
+
name: string;
|
|
14
|
+
tier: PrecisionTier;
|
|
15
|
+
requestedBy: string;
|
|
16
|
+
/** Advanced-panel overrides on top of the tier's defaults. */
|
|
17
|
+
paramOverrides?: Partial<TraceParams>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Start the first trace of a sheet.
|
|
21
|
+
*
|
|
22
|
+
* The sheet is read to confirm it exists before a run is written against it —
|
|
23
|
+
* a run whose `sheetId` points at nothing is an orphan that every list query
|
|
24
|
+
* returns and no page can open.
|
|
25
|
+
*/
|
|
26
|
+
export declare function startStickerTraceRun(input: StartTraceRunInput): Promise<TraceRunHandle>;
|
|
27
|
+
export interface RetryTraceRunInput {
|
|
28
|
+
sheetId: string;
|
|
29
|
+
/** The run being retried. Read for its params; never modified. */
|
|
30
|
+
sourceRunId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
tier: PrecisionTier;
|
|
33
|
+
requestedBy: string;
|
|
34
|
+
paramOverrides?: Partial<TraceParams>;
|
|
35
|
+
/** Where the operator asked to resume from. Clamped, never silently. */
|
|
36
|
+
requestedResumeStage?: TraceStage;
|
|
37
|
+
}
|
|
38
|
+
export interface RetryTraceRunResult extends TraceRunHandle {
|
|
39
|
+
resume: ResumeDecision;
|
|
40
|
+
/** The sentence the retry panel shows. Empty when nothing was clamped. */
|
|
41
|
+
notice: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retry a run.
|
|
45
|
+
*
|
|
46
|
+
* 🛑 A retry is a NEW named run. Editing the old one would destroy the only
|
|
47
|
+
* thing attempt history is for — being able to compare "standard vs precise on
|
|
48
|
+
* the same sheet" weeks later, and to see that run 2 died at `ridge`.
|
|
49
|
+
*
|
|
50
|
+
* 🛑 Resuming requires the source run's artifacts to still EXIST. Retention
|
|
51
|
+
* may have stripped them, and a resume from `parts` against a run whose
|
|
52
|
+
* geometry is gone would read every missing artifact as an empty result — a
|
|
53
|
+
* successful-looking run with no parts. `artifactsPruned` is checked and the
|
|
54
|
+
* resume point is forced back to the start rather than failing, because
|
|
55
|
+
* restarting is what the operator wants and being told why is what they need.
|
|
56
|
+
*/
|
|
57
|
+
export declare function retryStickerTraceRun(input: RetryTraceRunInput): Promise<RetryTraceRunResult>;
|
|
58
|
+
/**
|
|
59
|
+
* One row of a sheet's attempt history.
|
|
60
|
+
*
|
|
61
|
+
* 🛑 A PROJECTION, not the run document. Every `*Path` on a run is a raw
|
|
62
|
+
* Storage path under `private/sticker-sheets/…` and must never reach a client
|
|
63
|
+
* — the bucket's own rule is `allow read: if true`, so containment is the
|
|
64
|
+
* application's job. The panel needs to know an artifact EXISTS so it can
|
|
65
|
+
* offer a link; the path itself is resolved to a short-lived signed URL by an
|
|
66
|
+
* authenticated route when the link is actually clicked.
|
|
67
|
+
*
|
|
68
|
+
* `events` is omitted too: up to 100 entries per run times N runs is a large
|
|
69
|
+
* payload for a list nobody expands, and the detail view fetches one run.
|
|
70
|
+
*/
|
|
71
|
+
export interface TraceRunListRow {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
tier: StickerTraceRunDocument["tier"];
|
|
75
|
+
status: StickerTraceRunDocument["status"];
|
|
76
|
+
stage: StickerTraceRunDocument["stage"];
|
|
77
|
+
partCount: number;
|
|
78
|
+
groupCount: number;
|
|
79
|
+
durationMs: number | null;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
finishedAt: Date | null;
|
|
82
|
+
/** Whether this run is the sheet's currently accepted result. */
|
|
83
|
+
isActive: boolean;
|
|
84
|
+
/** True once promoted — i.e. full-resolution parts exist. */
|
|
85
|
+
isPromoted: boolean;
|
|
86
|
+
/** Which artifacts exist, WITHOUT their paths. */
|
|
87
|
+
has: {
|
|
88
|
+
preview: boolean;
|
|
89
|
+
overlay: boolean;
|
|
90
|
+
geometry: boolean;
|
|
91
|
+
cutSvg: boolean;
|
|
92
|
+
thumbAtlas: boolean;
|
|
93
|
+
};
|
|
94
|
+
/** Present only on a failure, already user-safe. */
|
|
95
|
+
error: StickerTraceRunDocument["error"] | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A sheet's attempt history, newest first.
|
|
99
|
+
*
|
|
100
|
+
* Served by the `(sheetId, createdAt desc)` composite index deployed in P4, so
|
|
101
|
+
* this is one query regardless of how many runs a sheet has accumulated.
|
|
102
|
+
*
|
|
103
|
+
* 🛑 `activeRunId` comes from the SHEET, not from a flag on each run. A
|
|
104
|
+
* per-run `isActive` boolean would be a mirror that needs clearing on every
|
|
105
|
+
* other run whenever one is promoted — and the first write path that forgot
|
|
106
|
+
* would show two active runs with nothing contradicting it (Root Cause #42).
|
|
107
|
+
* One read of the sheet decides it for the whole list.
|
|
108
|
+
*/
|
|
109
|
+
export declare function listStickerTraceRuns(sheetId: string, limit?: number): Promise<TraceRunListRow[]>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: A trace is started once and retried several times, and the retries are
|
|
3
|
+
* the point — tuning a halftone scan takes a few goes. Every attempt has
|
|
4
|
+
* to be a record you can come back to, which means a retry creates a new
|
|
5
|
+
* run and never edits the old one.
|
|
6
|
+
* WHAT: Start, and retry-with-resume.
|
|
7
|
+
*
|
|
8
|
+
* 🛑 Returns a PLAIN object, not an `ActionResult` envelope — mirroring
|
|
9
|
+
* `enqueueJob`, which these are modelled on. That is deliberate rather than
|
|
10
|
+
* casual: an envelope spread as if it were the payload is Root Cause #98,
|
|
11
|
+
* where `{ ok, data }` reached nine edit pages as `initialValues`, every field
|
|
12
|
+
* resolved `undefined`, and pressing Save wrote `draft` over live listings.
|
|
13
|
+
* These throw on failure; the route's `createRouteHandler` maps that.
|
|
14
|
+
*
|
|
15
|
+
* EXPORTS: StartTraceRunInput, RetryTraceRunInput, TraceRunHandle,
|
|
16
|
+
* startStickerTraceRun, retryStickerTraceRun
|
|
17
|
+
*
|
|
18
|
+
* @tag domain:sticker-trace
|
|
19
|
+
* @tag layer:server
|
|
20
|
+
* @tag pattern:none
|
|
21
|
+
* @tag access:server
|
|
22
|
+
* @tag consumers:api/admin/sticker-sheets
|
|
23
|
+
* @tag sideEffects:firestore,rtdb
|
|
24
|
+
*/
|
|
25
|
+
import { ValidationError } from "../../../../errors/validation-error.js";
|
|
26
|
+
import { stickerSheetsRepository } from "../../../../features/sticker-trace/repository/sticker-sheets.repository.js";
|
|
27
|
+
import { stickerTraceRunsRepository } from "../../../../features/sticker-trace/repository/sticker-trace-runs.repository.js";
|
|
28
|
+
import { TraceRunStatusValues, } from "../../../../features/sticker-trace/schemas/firestore.js";
|
|
29
|
+
import { paramsForTier } from "../../../shared/features/sticker-trace/config.js";
|
|
30
|
+
import { explainResume, resolveResumeStage, } from "../../../shared/features/sticker-trace/resume.js";
|
|
31
|
+
import { emitProgress, mintStickerTraceToken } from "./progress.js";
|
|
32
|
+
/**
|
|
33
|
+
* A name is required to process, and this is where that is enforced.
|
|
34
|
+
*
|
|
35
|
+
* Trimmed before the length check, so " " is rejected rather than stored as
|
|
36
|
+
* a run nobody can tell apart from the next one — which is the whole reason
|
|
37
|
+
* the field is mandatory.
|
|
38
|
+
*/
|
|
39
|
+
function requireName(raw) {
|
|
40
|
+
const name = (raw ?? "").trim();
|
|
41
|
+
if (name.length === 0) {
|
|
42
|
+
throw new ValidationError("Give this run a name so you can tell it apart later.", {
|
|
43
|
+
name: "A name is required.",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return name;
|
|
47
|
+
}
|
|
48
|
+
async function createRun(input) {
|
|
49
|
+
const run = await stickerTraceRunsRepository.create(input);
|
|
50
|
+
/*
|
|
51
|
+
* Seed the channel BEFORE returning the token, so a client that subscribes
|
|
52
|
+
* immediately finds a node rather than an absence it cannot distinguish from
|
|
53
|
+
* a run that never started. `emitProgress` never throws, so a failure here
|
|
54
|
+
* costs the live bar and not the run.
|
|
55
|
+
*/
|
|
56
|
+
await emitProgress({ runId: run.id, stage: "queued", pct: 0, prior: run });
|
|
57
|
+
return { runId: run.id, customToken: await mintStickerTraceToken(run.id) };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Start the first trace of a sheet.
|
|
61
|
+
*
|
|
62
|
+
* The sheet is read to confirm it exists before a run is written against it —
|
|
63
|
+
* a run whose `sheetId` points at nothing is an orphan that every list query
|
|
64
|
+
* returns and no page can open.
|
|
65
|
+
*/
|
|
66
|
+
export async function startStickerTraceRun(input) {
|
|
67
|
+
const name = requireName(input.name);
|
|
68
|
+
await stickerSheetsRepository.findByIdOrFail(input.sheetId);
|
|
69
|
+
/*
|
|
70
|
+
* Tier defaults FIRST, overrides second. The run records the parameters it
|
|
71
|
+
* actually used, which is what makes the resume clamp meaningful — a run
|
|
72
|
+
* storing a tier name and resolving defaults later could not tell whether
|
|
73
|
+
* its artifacts predated a default changing.
|
|
74
|
+
*/
|
|
75
|
+
const params = {
|
|
76
|
+
...paramsForTier(input.tier),
|
|
77
|
+
...(input.paramOverrides ?? {}),
|
|
78
|
+
};
|
|
79
|
+
const handle = await createRun({
|
|
80
|
+
sheetId: input.sheetId,
|
|
81
|
+
name,
|
|
82
|
+
tier: input.tier,
|
|
83
|
+
params,
|
|
84
|
+
requestedBy: input.requestedBy,
|
|
85
|
+
});
|
|
86
|
+
await stickerSheetsRepository.update(input.sheetId, {
|
|
87
|
+
traceStatus: TraceRunStatusValues.QUEUED,
|
|
88
|
+
});
|
|
89
|
+
return handle;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Retry a run.
|
|
93
|
+
*
|
|
94
|
+
* 🛑 A retry is a NEW named run. Editing the old one would destroy the only
|
|
95
|
+
* thing attempt history is for — being able to compare "standard vs precise on
|
|
96
|
+
* the same sheet" weeks later, and to see that run 2 died at `ridge`.
|
|
97
|
+
*
|
|
98
|
+
* 🛑 Resuming requires the source run's artifacts to still EXIST. Retention
|
|
99
|
+
* may have stripped them, and a resume from `parts` against a run whose
|
|
100
|
+
* geometry is gone would read every missing artifact as an empty result — a
|
|
101
|
+
* successful-looking run with no parts. `artifactsPruned` is checked and the
|
|
102
|
+
* resume point is forced back to the start rather than failing, because
|
|
103
|
+
* restarting is what the operator wants and being told why is what they need.
|
|
104
|
+
*/
|
|
105
|
+
export async function retryStickerTraceRun(input) {
|
|
106
|
+
const name = requireName(input.name);
|
|
107
|
+
const source = await stickerTraceRunsRepository.findByIdOrFail(input.sourceRunId);
|
|
108
|
+
if (source.sheetId !== input.sheetId) {
|
|
109
|
+
throw new ValidationError("That run belongs to a different sheet.", {
|
|
110
|
+
sourceRunId: "Run and sheet do not match.",
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const params = {
|
|
114
|
+
...paramsForTier(input.tier),
|
|
115
|
+
...(input.paramOverrides ?? {}),
|
|
116
|
+
};
|
|
117
|
+
const requested = input.requestedResumeStage ?? "decode";
|
|
118
|
+
let resume = resolveResumeStage(requested, source.params, params);
|
|
119
|
+
let notice = explainResume(resume);
|
|
120
|
+
if (source.artifactsPruned && resume.stage !== "decode") {
|
|
121
|
+
resume = { stage: "decode", clamped: true, requested, forcedBy: resume.forcedBy };
|
|
122
|
+
notice =
|
|
123
|
+
"This run's intermediate files were cleared, so there is nothing to resume " +
|
|
124
|
+
"from — the retry starts from the beginning.";
|
|
125
|
+
}
|
|
126
|
+
const handle = await createRun({
|
|
127
|
+
sheetId: input.sheetId,
|
|
128
|
+
name,
|
|
129
|
+
tier: input.tier,
|
|
130
|
+
params,
|
|
131
|
+
requestedBy: input.requestedBy,
|
|
132
|
+
});
|
|
133
|
+
return { ...handle, resume, notice };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A sheet's attempt history, newest first.
|
|
137
|
+
*
|
|
138
|
+
* Served by the `(sheetId, createdAt desc)` composite index deployed in P4, so
|
|
139
|
+
* this is one query regardless of how many runs a sheet has accumulated.
|
|
140
|
+
*
|
|
141
|
+
* 🛑 `activeRunId` comes from the SHEET, not from a flag on each run. A
|
|
142
|
+
* per-run `isActive` boolean would be a mirror that needs clearing on every
|
|
143
|
+
* other run whenever one is promoted — and the first write path that forgot
|
|
144
|
+
* would show two active runs with nothing contradicting it (Root Cause #42).
|
|
145
|
+
* One read of the sheet decides it for the whole list.
|
|
146
|
+
*/
|
|
147
|
+
export async function listStickerTraceRuns(sheetId, limit = 50) {
|
|
148
|
+
const sheet = await stickerSheetsRepository.findByIdOrFail(sheetId);
|
|
149
|
+
const runs = await stickerTraceRunsRepository.listBySheet(sheetId, limit);
|
|
150
|
+
return runs.map((run) => ({
|
|
151
|
+
id: run.id,
|
|
152
|
+
name: run.name,
|
|
153
|
+
tier: run.tier,
|
|
154
|
+
status: run.status,
|
|
155
|
+
stage: run.stage,
|
|
156
|
+
partCount: run.partCount,
|
|
157
|
+
groupCount: run.groupCount,
|
|
158
|
+
durationMs: run.durationMs ?? null,
|
|
159
|
+
createdAt: run.createdAt,
|
|
160
|
+
finishedAt: run.finishedAt ?? null,
|
|
161
|
+
isActive: sheet.activeRunId === run.id,
|
|
162
|
+
isPromoted: Boolean(run.promoted),
|
|
163
|
+
has: {
|
|
164
|
+
preview: Boolean(run.artifacts?.previewPath),
|
|
165
|
+
overlay: Boolean(run.artifacts?.overlayPath),
|
|
166
|
+
geometry: Boolean(run.artifacts?.geometryPath),
|
|
167
|
+
cutSvg: Boolean(run.artifacts?.cutSvgPath),
|
|
168
|
+
thumbAtlas: Boolean(run.artifacts?.thumbAtlasPath),
|
|
169
|
+
},
|
|
170
|
+
error: run.error ?? null,
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { DpiSource, StickerSheetDocument, StickerTraceRunDocument, TraceRunError, TraceRunEvent, TraceRunStatus } from "../../../../features/sticker-trace/schemas/firestore";
|
|
2
|
+
import type { PrecisionTier, Rect, ScanType, TraceParams, TraceStage } from "../../../shared/features/sticker-trace/types";
|
|
3
|
+
export declare const PUBLIC_STICKER_SHEET_FIELDS: readonly ["id", "title", "scanType", "dpi", "dpiSource", "widthPx", "heightPx", "activeRunId", "traceStatus", "partCount", "groupCount", "parts", "createdAt", "updatedAt"];
|
|
4
|
+
export declare const PRIVATE_STICKER_SHEET_FIELDS: readonly ["sourceScan", "artifacts"];
|
|
5
|
+
export declare const PUBLIC_TRACE_RUN_FIELDS: readonly ["id", "sheetId", "name", "tier", "params", "requestedBy", "startedAt", "finishedAt", "durationMs", "status", "stage", "events", "eventsTruncated", "partCount", "groupCount", "shardCount", "error", "artifactsPruned", "createdAt", "updatedAt"];
|
|
6
|
+
export declare const PRIVATE_TRACE_RUN_FIELDS: readonly ["artifacts", "promoted"];
|
|
7
|
+
/** A part as the review UI sees it: geometry and identity, never a path. */
|
|
8
|
+
export interface ClientSheetPart {
|
|
9
|
+
ordinal: number;
|
|
10
|
+
name: string;
|
|
11
|
+
groupIndex: number;
|
|
12
|
+
bboxPx: Rect;
|
|
13
|
+
/** Null whenever dpi is untrustworthy — never a fabricated millimetre. */
|
|
14
|
+
bboxMm: Rect | null;
|
|
15
|
+
areaMm2: number | null;
|
|
16
|
+
/** Whether a full-resolution render exists, NOT where it is. */
|
|
17
|
+
hasAsset: boolean;
|
|
18
|
+
duplicateOf?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ClientStickerSheet {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
scanType: ScanType;
|
|
24
|
+
dpi?: number;
|
|
25
|
+
dpiSource?: DpiSource;
|
|
26
|
+
widthPx: number;
|
|
27
|
+
heightPx: number;
|
|
28
|
+
/** Size only. The path and hash never leave the server. */
|
|
29
|
+
sourceScanBytes: number;
|
|
30
|
+
activeRunId?: string;
|
|
31
|
+
traceStatus: TraceRunStatus;
|
|
32
|
+
partCount: number;
|
|
33
|
+
groupCount: number;
|
|
34
|
+
parts: ClientSheetPart[];
|
|
35
|
+
hasPreview: boolean;
|
|
36
|
+
hasOverlay: boolean;
|
|
37
|
+
hasGeometry: boolean;
|
|
38
|
+
hasCutSvg: boolean;
|
|
39
|
+
hasCricutSvg: boolean;
|
|
40
|
+
hasPrintThenCutSvg: boolean;
|
|
41
|
+
hasPdfMosaic: boolean;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
}
|
|
45
|
+
export interface ClientTraceRun {
|
|
46
|
+
id: string;
|
|
47
|
+
sheetId: string;
|
|
48
|
+
name: string;
|
|
49
|
+
tier: PrecisionTier;
|
|
50
|
+
params: TraceParams;
|
|
51
|
+
requestedBy: string;
|
|
52
|
+
startedAt?: Date;
|
|
53
|
+
finishedAt?: Date;
|
|
54
|
+
durationMs?: number;
|
|
55
|
+
status: TraceRunStatus;
|
|
56
|
+
stage?: TraceStage | "queued" | "done";
|
|
57
|
+
events: TraceRunEvent[];
|
|
58
|
+
eventsTruncated?: number;
|
|
59
|
+
partCount: number;
|
|
60
|
+
groupCount: number;
|
|
61
|
+
shardCount?: number;
|
|
62
|
+
error?: TraceRunError;
|
|
63
|
+
artifactsPruned?: boolean;
|
|
64
|
+
hasPreview: boolean;
|
|
65
|
+
hasOverlay: boolean;
|
|
66
|
+
hasGeometry: boolean;
|
|
67
|
+
hasCutSvg: boolean;
|
|
68
|
+
hasThumbAtlas: boolean;
|
|
69
|
+
/** Promotion is a fact about the run; its paths are not. */
|
|
70
|
+
promotedAt?: Date;
|
|
71
|
+
promotedBy?: string;
|
|
72
|
+
promotedPartCount: number;
|
|
73
|
+
hasCricutSvg: boolean;
|
|
74
|
+
hasPrintThenCutSvg: boolean;
|
|
75
|
+
hasPdfMosaic: boolean;
|
|
76
|
+
createdAt: Date;
|
|
77
|
+
updatedAt: Date;
|
|
78
|
+
}
|
|
79
|
+
export declare function toClientStickerSheet(doc: StickerSheetDocument): ClientStickerSheet;
|
|
80
|
+
export declare function toClientTraceRun(doc: StickerTraceRunDocument): ClientTraceRun;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: Every `*Path` on these documents is a raw private Storage path. A
|
|
3
|
+
* document field is private until someone names it public, and the only
|
|
4
|
+
* thing that actually removes a field at runtime is a function that builds
|
|
5
|
+
* a NEW object.
|
|
6
|
+
* WHAT: The sheet and run projections, with every schema field triaged.
|
|
7
|
+
*
|
|
8
|
+
* 🛑 ALLOW-LIST, never spread-and-delete. A denial keyed on a TypeScript
|
|
9
|
+
* interface is structurally blind to fields the interface does not declare —
|
|
10
|
+
* which is exactly how `adSettings.providerCredentials` went out unmasked from
|
|
11
|
+
* `GET /api/site-settings` (Root Cause #70). These build literals.
|
|
12
|
+
*
|
|
13
|
+
* 🛑 A NARROW PROP TYPE STRIPS NOTHING. TypeScript's structural typing accepts
|
|
14
|
+
* a wider object without complaint and Next serialises whatever the value
|
|
15
|
+
* actually is, so typing a client prop `ClientStickerSheet` while passing a
|
|
16
|
+
* `StickerSheetDocument` publishes every path in it. Only these functions
|
|
17
|
+
* remove anything.
|
|
18
|
+
*
|
|
19
|
+
* 🛑 PATHS ARE REPLACED BY BOOLEANS, not omitted silently. The review UI needs
|
|
20
|
+
* to know an overlay EXISTS so it can offer the button; it must never learn
|
|
21
|
+
* WHERE. It then asks an authenticated route for a 5-minute signed URL. A bare
|
|
22
|
+
* omission would have left the UI unable to tell "no overlay" from "overlay I
|
|
23
|
+
* cannot see", and the obvious fix for that is to leak the path.
|
|
24
|
+
*
|
|
25
|
+
* EXPORTS: ClientStickerSheet, ClientSheetPart, ClientTraceRun,
|
|
26
|
+
* toClientStickerSheet, toClientTraceRun,
|
|
27
|
+
* PUBLIC_STICKER_SHEET_FIELDS, PRIVATE_STICKER_SHEET_FIELDS,
|
|
28
|
+
* PUBLIC_TRACE_RUN_FIELDS, PRIVATE_TRACE_RUN_FIELDS
|
|
29
|
+
*
|
|
30
|
+
* @tag domain:sticker-trace
|
|
31
|
+
* @tag layer:server
|
|
32
|
+
* @tag pattern:adapter
|
|
33
|
+
* @tag access:server
|
|
34
|
+
* @tag consumers:api/admin/sticker-sheets,sticker-trace/components
|
|
35
|
+
* @tag sideEffects:none
|
|
36
|
+
*/
|
|
37
|
+
/*
|
|
38
|
+
* ---------------------------------------------------------------------------
|
|
39
|
+
* The triage. Every schema field appears in exactly ONE of these lists, with a
|
|
40
|
+
* reason on each private entry. audit-public-projection-parity fails on an
|
|
41
|
+
* untriaged field, so adding one to the schema forces a decision here.
|
|
42
|
+
* ---------------------------------------------------------------------------
|
|
43
|
+
*/
|
|
44
|
+
export const PUBLIC_STICKER_SHEET_FIELDS = [
|
|
45
|
+
"id",
|
|
46
|
+
"title",
|
|
47
|
+
"scanType",
|
|
48
|
+
"dpi",
|
|
49
|
+
"dpiSource", // always shown and always confirmable — see the schema's 🛑
|
|
50
|
+
"widthPx",
|
|
51
|
+
"heightPx",
|
|
52
|
+
"activeRunId",
|
|
53
|
+
"traceStatus",
|
|
54
|
+
"partCount",
|
|
55
|
+
"groupCount",
|
|
56
|
+
"parts", // projected per-part; `assetPath` stripped inside
|
|
57
|
+
"createdAt",
|
|
58
|
+
"updatedAt",
|
|
59
|
+
];
|
|
60
|
+
export const PRIVATE_STICKER_SHEET_FIELDS = [
|
|
61
|
+
// Carries assetPath (a raw private Storage path) and sha256. Only `bytes` is
|
|
62
|
+
// surfaced, as sourceScanBytes, for the usage meter.
|
|
63
|
+
"sourceScan",
|
|
64
|
+
// Every member is a raw private Storage path. The client gets booleans here
|
|
65
|
+
// and a 5-minute signed URL from an authenticated route.
|
|
66
|
+
"artifacts",
|
|
67
|
+
];
|
|
68
|
+
export const PUBLIC_TRACE_RUN_FIELDS = [
|
|
69
|
+
"id",
|
|
70
|
+
"sheetId",
|
|
71
|
+
"name",
|
|
72
|
+
"tier",
|
|
73
|
+
"params", // the retry panel shows and edits these
|
|
74
|
+
"requestedBy", // an Auth UID, never a name or an email — the actorUid rule
|
|
75
|
+
"startedAt",
|
|
76
|
+
"finishedAt",
|
|
77
|
+
"durationMs",
|
|
78
|
+
"status",
|
|
79
|
+
"stage",
|
|
80
|
+
"events", // the progress history the panel renders; messages are user-safe by contract
|
|
81
|
+
"eventsTruncated",
|
|
82
|
+
"partCount",
|
|
83
|
+
"groupCount",
|
|
84
|
+
"shardCount",
|
|
85
|
+
"error", // stage/code/message/partOrdinal — message resolved through toUserMessage
|
|
86
|
+
"artifactsPruned", // the retry panel MUST know artifacts are gone before offering resume
|
|
87
|
+
"createdAt",
|
|
88
|
+
"updatedAt",
|
|
89
|
+
];
|
|
90
|
+
export const PRIVATE_TRACE_RUN_FIELDS = [
|
|
91
|
+
// Raw private Storage paths (preview/overlay/geometry/cutSvg/thumbAtlas).
|
|
92
|
+
// Surfaced as hasPreview/hasOverlay/hasGeometry/hasCutSvg/hasThumbAtlas.
|
|
93
|
+
"artifacts",
|
|
94
|
+
// partAssetPaths plus the three export paths are all raw Storage paths.
|
|
95
|
+
// `at`/`by` are surfaced as promotedAt/promotedBy, the count as
|
|
96
|
+
// promotedPartCount.
|
|
97
|
+
"promoted",
|
|
98
|
+
];
|
|
99
|
+
function toClientPart(part) {
|
|
100
|
+
return {
|
|
101
|
+
ordinal: part.ordinal,
|
|
102
|
+
name: part.name,
|
|
103
|
+
groupIndex: part.groupIndex,
|
|
104
|
+
bboxPx: part.bboxPx,
|
|
105
|
+
bboxMm: part.bboxMm,
|
|
106
|
+
areaMm2: part.areaMm2,
|
|
107
|
+
hasAsset: Boolean(part.assetPath),
|
|
108
|
+
...(part.duplicateOf !== undefined ? { duplicateOf: part.duplicateOf } : {}),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function toClientStickerSheet(doc) {
|
|
112
|
+
const a = doc.artifacts ?? {};
|
|
113
|
+
return {
|
|
114
|
+
id: doc.id,
|
|
115
|
+
title: doc.title,
|
|
116
|
+
scanType: doc.scanType,
|
|
117
|
+
dpi: doc.dpi,
|
|
118
|
+
dpiSource: doc.dpiSource,
|
|
119
|
+
widthPx: doc.widthPx,
|
|
120
|
+
heightPx: doc.heightPx,
|
|
121
|
+
sourceScanBytes: doc.sourceScan?.bytes ?? 0,
|
|
122
|
+
activeRunId: doc.activeRunId,
|
|
123
|
+
traceStatus: doc.traceStatus,
|
|
124
|
+
partCount: doc.partCount,
|
|
125
|
+
groupCount: doc.groupCount,
|
|
126
|
+
parts: (doc.parts ?? []).map(toClientPart),
|
|
127
|
+
hasPreview: Boolean(a.previewPath),
|
|
128
|
+
hasOverlay: Boolean(a.overlayPath),
|
|
129
|
+
hasGeometry: Boolean(a.geometryPath),
|
|
130
|
+
hasCutSvg: Boolean(a.cutSvgPath),
|
|
131
|
+
hasCricutSvg: Boolean(a.cricutSvgPath),
|
|
132
|
+
hasPrintThenCutSvg: Boolean(a.printThenCutSvgPath),
|
|
133
|
+
hasPdfMosaic: Boolean(a.pdfMosaicPath),
|
|
134
|
+
createdAt: doc.createdAt,
|
|
135
|
+
updatedAt: doc.updatedAt,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export function toClientTraceRun(doc) {
|
|
139
|
+
const a = doc.artifacts ?? {};
|
|
140
|
+
const p = doc.promoted ?? null;
|
|
141
|
+
return {
|
|
142
|
+
id: doc.id,
|
|
143
|
+
sheetId: doc.sheetId,
|
|
144
|
+
name: doc.name,
|
|
145
|
+
tier: doc.tier,
|
|
146
|
+
params: doc.params,
|
|
147
|
+
requestedBy: doc.requestedBy,
|
|
148
|
+
startedAt: doc.startedAt,
|
|
149
|
+
finishedAt: doc.finishedAt,
|
|
150
|
+
durationMs: doc.durationMs,
|
|
151
|
+
status: doc.status,
|
|
152
|
+
stage: doc.stage,
|
|
153
|
+
events: doc.events ?? [],
|
|
154
|
+
eventsTruncated: doc.eventsTruncated,
|
|
155
|
+
partCount: doc.partCount,
|
|
156
|
+
groupCount: doc.groupCount,
|
|
157
|
+
shardCount: doc.shardCount,
|
|
158
|
+
error: doc.error,
|
|
159
|
+
artifactsPruned: doc.artifactsPruned,
|
|
160
|
+
hasPreview: Boolean(a.previewPath),
|
|
161
|
+
hasOverlay: Boolean(a.overlayPath),
|
|
162
|
+
hasGeometry: Boolean(a.geometryPath),
|
|
163
|
+
hasCutSvg: Boolean(a.cutSvgPath),
|
|
164
|
+
hasThumbAtlas: Boolean(a.thumbAtlasPath),
|
|
165
|
+
...(p?.at ? { promotedAt: p.at } : {}),
|
|
166
|
+
...(p?.by ? { promotedBy: p.by } : {}),
|
|
167
|
+
promotedPartCount: p?.partAssetPaths?.length ?? 0,
|
|
168
|
+
hasCricutSvg: Boolean(p?.cricutSvgPath),
|
|
169
|
+
hasPrintThenCutSvg: Boolean(p?.printThenCutSvgPath),
|
|
170
|
+
hasPdfMosaic: Boolean(p?.pdfMosaicPath),
|
|
171
|
+
createdAt: doc.createdAt,
|
|
172
|
+
updatedAt: doc.updatedAt,
|
|
173
|
+
};
|
|
174
|
+
}
|