@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
|
@@ -59,10 +59,10 @@ export declare const emiInstallmentSchema: z.ZodObject<{
|
|
|
59
59
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
60
60
|
}, z.ZodTypeAny, "passthrough">;
|
|
61
61
|
transactionId?: string | undefined;
|
|
62
|
+
proofUrl?: string | undefined;
|
|
62
63
|
paidAt?: string | Date | z.objectOutputType<{
|
|
63
64
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
64
65
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
65
|
-
proofUrl?: string | undefined;
|
|
66
66
|
reminderSentAt?: string | Date | z.objectOutputType<{
|
|
67
67
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
68
68
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -74,10 +74,10 @@ export declare const emiInstallmentSchema: z.ZodObject<{
|
|
|
74
74
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
75
75
|
}, z.ZodTypeAny, "passthrough">;
|
|
76
76
|
transactionId?: string | undefined;
|
|
77
|
+
proofUrl?: string | undefined;
|
|
77
78
|
paidAt?: string | Date | z.objectInputType<{
|
|
78
79
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
79
80
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
80
|
-
proofUrl?: string | undefined;
|
|
81
81
|
reminderSentAt?: string | Date | z.objectInputType<{
|
|
82
82
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
83
83
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -380,10 +380,10 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
380
380
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
381
381
|
}, z.ZodTypeAny, "passthrough">;
|
|
382
382
|
transactionId?: string | undefined;
|
|
383
|
+
proofUrl?: string | undefined;
|
|
383
384
|
paidAt?: string | Date | z.objectOutputType<{
|
|
384
385
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
385
386
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
386
|
-
proofUrl?: string | undefined;
|
|
387
387
|
reminderSentAt?: string | Date | z.objectOutputType<{
|
|
388
388
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
389
389
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -395,10 +395,10 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
395
395
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
396
396
|
}, z.ZodTypeAny, "passthrough">;
|
|
397
397
|
transactionId?: string | undefined;
|
|
398
|
+
proofUrl?: string | undefined;
|
|
398
399
|
paidAt?: string | Date | z.objectInputType<{
|
|
399
400
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
400
401
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
401
|
-
proofUrl?: string | undefined;
|
|
402
402
|
reminderSentAt?: string | Date | z.objectInputType<{
|
|
403
403
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
404
404
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -640,10 +640,10 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
640
640
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
641
641
|
}, z.ZodTypeAny, "passthrough">;
|
|
642
642
|
transactionId?: string | undefined;
|
|
643
|
+
proofUrl?: string | undefined;
|
|
643
644
|
paidAt?: string | Date | z.objectOutputType<{
|
|
644
645
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
645
646
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
646
|
-
proofUrl?: string | undefined;
|
|
647
647
|
reminderSentAt?: string | Date | z.objectOutputType<{
|
|
648
648
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
649
649
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -788,10 +788,10 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
788
788
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
789
789
|
}, z.ZodTypeAny, "passthrough">;
|
|
790
790
|
transactionId?: string | undefined;
|
|
791
|
+
proofUrl?: string | undefined;
|
|
791
792
|
paidAt?: string | Date | z.objectInputType<{
|
|
792
793
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
793
794
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
794
|
-
proofUrl?: string | undefined;
|
|
795
795
|
reminderSentAt?: string | Date | z.objectInputType<{
|
|
796
796
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
797
797
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -1041,15 +1041,15 @@ export declare const orderListParamsSchema: z.ZodObject<{
|
|
|
1041
1041
|
}, "strip", z.ZodTypeAny, {
|
|
1042
1042
|
sort?: string | undefined;
|
|
1043
1043
|
page?: number | undefined;
|
|
1044
|
-
perPage?: number | undefined;
|
|
1045
1044
|
userId?: string | undefined;
|
|
1046
1045
|
paymentStatus?: string | undefined;
|
|
1046
|
+
perPage?: number | undefined;
|
|
1047
1047
|
orderStatus?: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned" | undefined;
|
|
1048
1048
|
}, {
|
|
1049
1049
|
sort?: string | undefined;
|
|
1050
1050
|
page?: number | undefined;
|
|
1051
|
-
perPage?: number | undefined;
|
|
1052
1051
|
userId?: string | undefined;
|
|
1053
1052
|
paymentStatus?: string | undefined;
|
|
1053
|
+
perPage?: number | undefined;
|
|
1054
1054
|
orderStatus?: "pending" | "delivered" | "confirmed" | "shipped" | "processing" | "return_requested" | "cancelled" | "refunded" | "returned" | undefined;
|
|
1055
1055
|
}>;
|
|
@@ -312,7 +312,7 @@ export interface OrderListResponse {
|
|
|
312
312
|
items: Order[];
|
|
313
313
|
total: number;
|
|
314
314
|
page: number;
|
|
315
|
-
|
|
315
|
+
pageSize: number;
|
|
316
316
|
totalPages: number;
|
|
317
317
|
}
|
|
318
318
|
export interface OrderListParams {
|
|
@@ -321,5 +321,5 @@ export interface OrderListParams {
|
|
|
321
321
|
paymentStatus?: PaymentStatus;
|
|
322
322
|
sort?: string;
|
|
323
323
|
page?: number;
|
|
324
|
-
|
|
324
|
+
pageSize?: number;
|
|
325
325
|
}
|
|
@@ -13,7 +13,7 @@ export class PaymentsRepository {
|
|
|
13
13
|
const result = await this.paymentsRepo.findAll({
|
|
14
14
|
filters: `orderId==${orderId}`,
|
|
15
15
|
sort: "-createdAt",
|
|
16
|
-
|
|
16
|
+
pageSize: 20,
|
|
17
17
|
});
|
|
18
18
|
return result.data;
|
|
19
19
|
}
|
|
@@ -27,7 +27,7 @@ export class PaymentsRepository {
|
|
|
27
27
|
return this.paymentsRepo.delete(id);
|
|
28
28
|
}
|
|
29
29
|
async getSettings() {
|
|
30
|
-
const result = await this.settingsRepo.findAll({
|
|
30
|
+
const result = await this.settingsRepo.findAll({ pageSize: 1 });
|
|
31
31
|
return result.data[0] ?? null;
|
|
32
32
|
}
|
|
33
33
|
async updateSettings(id, data) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { BaseRepository, parseSieveDateValue, type SieveModel, type FirebaseSieveResult } from "../../../providers/db-firebase";
|
|
8
8
|
import type { DocumentReference } from "firebase-admin/firestore";
|
|
9
|
-
import type { PayoutDocument, PayoutCreateInput, PayoutRefundDeduction, PayoutStatus, PayoutUpdateInput } from "../schemas";
|
|
9
|
+
import type { PayoutDocument, PayoutPlain, PayoutCreateInput, PayoutRefundDeduction, PayoutStatus, PayoutUpdateInput } from "../schemas";
|
|
10
10
|
import { type HistoryActor } from "../../../_internal/shared/history/index";
|
|
11
11
|
/** Who/why for a payout write that lands in `statusHistory`. */
|
|
12
12
|
export interface PayoutWriteContext {
|
|
@@ -18,7 +18,26 @@ export interface PayoutWriteContext {
|
|
|
18
18
|
export declare class PayoutRepository extends BaseRepository<PayoutDocument> {
|
|
19
19
|
constructor();
|
|
20
20
|
/** Decrypt PII fields on a payout document after Firestore read */
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Plaintext PII. **Opt-in and named** — for the payout run that has to
|
|
23
|
+
* actually pay someone, and for the remittance email.
|
|
24
|
+
*/
|
|
25
|
+
revealPayout(doc: PayoutDocument): PayoutPlain;
|
|
26
|
+
/** As `revealPayout`, for a list read. */
|
|
27
|
+
revealPayouts(docs: readonly PayoutDocument[]): PayoutPlain[];
|
|
28
|
+
/**
|
|
29
|
+
* Masked PII — **the default for the admin and seller payout lists**, which
|
|
30
|
+
* need to identify a payee rather than pay them.
|
|
31
|
+
*
|
|
32
|
+
* `bankAccount.accountHolderName` is masked too — it is a person's name, and
|
|
33
|
+
* a payout list only needs to identify the payee. The other three members
|
|
34
|
+
* (`accountNumberMasked`, `ifscCode`, `bankName`) are already non-revealing,
|
|
35
|
+
* so they pass through: masking a bank name would make the row useless
|
|
36
|
+
* without protecting anything.
|
|
37
|
+
*/
|
|
38
|
+
maskedPayout(doc: PayoutDocument): PayoutPlain;
|
|
39
|
+
/** As `maskedPayout`, for a list read. */
|
|
40
|
+
maskedPayouts(docs: readonly PayoutDocument[]): PayoutPlain[];
|
|
22
41
|
/**
|
|
23
42
|
* Declared, not hand-rolled.
|
|
24
43
|
*
|
|
@@ -40,15 +59,13 @@ export declare class PayoutRepository extends BaseRepository<PayoutDocument> {
|
|
|
40
59
|
* encryption path with one extra step on top, rather than two parallel paths
|
|
41
60
|
* that have to agree — which is what the hand-rolled override was.
|
|
42
61
|
*/
|
|
43
|
-
protected applyWriteHooks<D extends object>(data: D): D;
|
|
44
62
|
/** Override mapDoc to auto-decrypt PII on every Firestore read */
|
|
45
|
-
protected mapDoc<D = PayoutDocument>(snap: import("../../../providers/db-firebase").DocumentSnapshot): D;
|
|
46
63
|
/**
|
|
47
64
|
* Create a new payout request
|
|
48
65
|
*/
|
|
49
|
-
|
|
66
|
+
createPayout(input: PayoutCreateInput): Promise<PayoutPlain>;
|
|
50
67
|
/** Override base update to preserve encryption/indexing for changed PII fields. */
|
|
51
|
-
update(payoutId: string, data: Partial<
|
|
68
|
+
update(payoutId: string, data: Partial<PayoutPlain>): Promise<PayoutDocument>;
|
|
52
69
|
/**
|
|
53
70
|
* Find all payouts for a specific seller, newest first
|
|
54
71
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { BaseRepository, prepareForFirestore, parseSieveDateValue, } from "../../../providers/db-firebase/index.js";
|
|
8
8
|
import { PAYOUT_COLLECTION, PAYOUT_FIELDS, PAYOUT_TRACKED_FIELDS, createPayoutId } from "../schemas/index.js";
|
|
9
9
|
import { withHistory } from "../../../_internal/shared/history/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { maskPii, revealPii, PAYOUT_PII_FIELDS, PAYOUT_PII_INDEX_MAP, } from "../../../security/index.js";
|
|
11
11
|
export class PayoutRepository extends BaseRepository {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(PAYOUT_COLLECTION);
|
|
@@ -26,12 +26,48 @@ export class PayoutRepository extends BaseRepository {
|
|
|
26
26
|
this.piiIndexMap = PAYOUT_PII_INDEX_MAP;
|
|
27
27
|
}
|
|
28
28
|
/** Decrypt PII fields on a payout document after Firestore read */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/*
|
|
30
|
+
* 🛑 `mapDoc` no longer decrypts — reads return what Firestore holds.
|
|
31
|
+
*
|
|
32
|
+
* `bankAccount` is handled here rather than by `revealPii`, because it is
|
|
33
|
+
* encrypted by its OWN scheme (`decryptPayoutBankAccount`) and not by the
|
|
34
|
+
* `PAYOUT_PII_FIELDS` path list. A named accessor that silently skipped it
|
|
35
|
+
* would hand a caller an account number it could not read, which is worse
|
|
36
|
+
* than refusing: the value looks present.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Plaintext PII. **Opt-in and named** — for the payout run that has to
|
|
40
|
+
* actually pay someone, and for the remittance email.
|
|
41
|
+
*/
|
|
42
|
+
revealPayout(doc) {
|
|
43
|
+
// `bankAccount` needs no unwrap: its four members are masked or public
|
|
44
|
+
// bank identifiers, never encrypted. See the tombstone in pii-encrypt.ts.
|
|
45
|
+
return revealPii(doc, PAYOUT_PII_FIELDS);
|
|
46
|
+
}
|
|
47
|
+
/** As `revealPayout`, for a list read. */
|
|
48
|
+
revealPayouts(docs) {
|
|
49
|
+
return docs.map((d) => this.revealPayout(d));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Masked PII — **the default for the admin and seller payout lists**, which
|
|
53
|
+
* need to identify a payee rather than pay them.
|
|
54
|
+
*
|
|
55
|
+
* `bankAccount.accountHolderName` is masked too — it is a person's name, and
|
|
56
|
+
* a payout list only needs to identify the payee. The other three members
|
|
57
|
+
* (`accountNumberMasked`, `ifscCode`, `bankName`) are already non-revealing,
|
|
58
|
+
* so they pass through: masking a bank name would make the row useless
|
|
59
|
+
* without protecting anything.
|
|
60
|
+
*/
|
|
61
|
+
maskedPayout(doc) {
|
|
62
|
+
const masked = maskPii(doc, PAYOUT_PII_FIELDS);
|
|
63
|
+
if (masked.bankAccount) {
|
|
64
|
+
masked.bankAccount = maskPii(masked.bankAccount, ["accountHolderName"]);
|
|
33
65
|
}
|
|
34
|
-
return
|
|
66
|
+
return masked;
|
|
67
|
+
}
|
|
68
|
+
/** As `maskedPayout`, for a list read. */
|
|
69
|
+
maskedPayouts(docs) {
|
|
70
|
+
return docs.map((d) => this.maskedPayout(d));
|
|
35
71
|
}
|
|
36
72
|
/**
|
|
37
73
|
* The base hook, plus the nested objects it cannot see.
|
|
@@ -41,24 +77,28 @@ export class PayoutRepository extends BaseRepository {
|
|
|
41
77
|
* encryption path with one extra step on top, rather than two parallel paths
|
|
42
78
|
* that have to agree — which is what the hand-rolled override was.
|
|
43
79
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
80
|
+
/*
|
|
81
|
+
* No `bankAccount` hook any more. It called `encryptPayoutBankAccount`,
|
|
82
|
+
* which was `encryptPiiFields(bank, [])` — a no-op — and
|
|
83
|
+
* `PayoutBankAccount` carries no secret field to encrypt. See the tombstone
|
|
84
|
+
* in `security/pii-encrypt.ts`.
|
|
85
|
+
*/
|
|
51
86
|
/** Override mapDoc to auto-decrypt PII on every Firestore read */
|
|
52
|
-
mapDoc(snap) {
|
|
53
|
-
const raw = super.mapDoc(snap);
|
|
54
|
-
return this.decryptPayout(raw);
|
|
55
|
-
}
|
|
56
87
|
/**
|
|
57
88
|
* Create a new payout request
|
|
58
89
|
*/
|
|
59
|
-
|
|
90
|
+
/*
|
|
91
|
+
* 🛑 NOT an `override`. It returns the plaintext it was handed (no
|
|
92
|
+
* read-after-write, which would cost a Firestore read per payout), and
|
|
93
|
+
* `PayoutPlain` is not assignable to the base's `Promise<T>` — correctly,
|
|
94
|
+
* because the two genuinely differ. The declaration used to say
|
|
95
|
+
* `PayoutDocument` directly above a line commented "return plaintext to
|
|
96
|
+
* caller".
|
|
97
|
+
*/
|
|
98
|
+
async createPayout(input) {
|
|
60
99
|
const now = new Date();
|
|
61
100
|
const id = createPayoutId({ sellerName: input.sellerName, date: now });
|
|
101
|
+
// Plain in, ciphertext out — the write hook encrypts below.
|
|
62
102
|
const data = {
|
|
63
103
|
...input,
|
|
64
104
|
status: "pending",
|
|
@@ -72,7 +112,7 @@ export class PayoutRepository extends BaseRepository {
|
|
|
72
112
|
.collection(this.collection)
|
|
73
113
|
.doc(id)
|
|
74
114
|
.set(prepareForFirestore(encrypted));
|
|
75
|
-
return { id, ...data };
|
|
115
|
+
return { id, ...data };
|
|
76
116
|
}
|
|
77
117
|
/** Override base update to preserve encryption/indexing for changed PII fields. */
|
|
78
118
|
async update(payoutId, data) {
|
|
@@ -88,7 +128,7 @@ export class PayoutRepository extends BaseRepository {
|
|
|
88
128
|
.where(PAYOUT_FIELDS.STORE_ID, "==", storeId)
|
|
89
129
|
.orderBy(PAYOUT_FIELDS.CREATED_AT, "desc")
|
|
90
130
|
.get();
|
|
91
|
-
return snapshot.docs.map((doc) =>
|
|
131
|
+
return snapshot.docs.map((doc) => ({
|
|
92
132
|
id: doc.id,
|
|
93
133
|
...doc.data(),
|
|
94
134
|
}));
|
|
@@ -103,7 +143,7 @@ export class PayoutRepository extends BaseRepository {
|
|
|
103
143
|
.where(PAYOUT_FIELDS.STATUS, "==", status)
|
|
104
144
|
.orderBy(PAYOUT_FIELDS.CREATED_AT, "desc")
|
|
105
145
|
.get();
|
|
106
|
-
return snapshot.docs.map((doc) =>
|
|
146
|
+
return snapshot.docs.map((doc) => ({
|
|
107
147
|
id: doc.id,
|
|
108
148
|
...doc.data(),
|
|
109
149
|
}));
|
|
@@ -197,7 +237,7 @@ export class PayoutRepository extends BaseRepository {
|
|
|
197
237
|
.get();
|
|
198
238
|
if (snapshot.empty)
|
|
199
239
|
return null;
|
|
200
|
-
return
|
|
240
|
+
return { id: snapshot.docs[0].id, ...snapshot.docs[0].data() };
|
|
201
241
|
}
|
|
202
242
|
/**
|
|
203
243
|
* Atomically append a refund deduction and recalculate netAmount.
|
|
@@ -227,7 +267,7 @@ export class PayoutRepository extends BaseRepository {
|
|
|
227
267
|
});
|
|
228
268
|
return { ...doc, refundDeductions: newDeductions, netAmount, updatedAt: new Date() };
|
|
229
269
|
});
|
|
230
|
-
return
|
|
270
|
+
return (updated);
|
|
231
271
|
}
|
|
232
272
|
/**
|
|
233
273
|
* Paginated, Firestore-native payout list (admin use).
|
|
@@ -8,15 +8,26 @@
|
|
|
8
8
|
* to clients. `identifierHash` is unencrypted SHA-256 for cross-account
|
|
9
9
|
* dedup queries. `displayLabel` is pre-masked and safe to display.
|
|
10
10
|
*/
|
|
11
|
-
import { BaseRepository
|
|
12
|
-
import { type SavedPaymentMethodBanStatus, type SavedPaymentMethodCreateInput, type SavedPaymentMethodDocument } from "../schemas/saved-methods-firestore";
|
|
11
|
+
import { BaseRepository } from "../../../providers/db-firebase";
|
|
12
|
+
import { type SavedPaymentMethodBanStatus, type SavedPaymentMethodCreateInput, type SavedPaymentMethodDocument, type SavedPaymentMethodPlain } from "../schemas/saved-methods-firestore";
|
|
13
13
|
export declare class SavedPaymentMethodsRepository extends BaseRepository<SavedPaymentMethodDocument> {
|
|
14
14
|
constructor();
|
|
15
|
-
private decrypt;
|
|
16
15
|
private encrypt;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
/** Plaintext PII. **Opt-in and named** — shows up in review and in a grep. */
|
|
17
|
+
revealMethod(doc: SavedPaymentMethodDocument): SavedPaymentMethodPlain;
|
|
18
|
+
/** As `revealMethod`, for a list read. */
|
|
19
|
+
revealMethods(docs: readonly SavedPaymentMethodDocument[]): SavedPaymentMethodPlain[];
|
|
20
|
+
/**
|
|
21
|
+
* Masked PII — **the default for any surface that only needs to identify a
|
|
22
|
+
* row to a human.** Decrypts first, then masks: the mask helpers refuse
|
|
23
|
+
* ciphertext by design, so passing a stored field straight in would return
|
|
24
|
+
* "Anonymous" for every row.
|
|
25
|
+
*/
|
|
26
|
+
maskedMethod(doc: SavedPaymentMethodDocument): SavedPaymentMethodPlain;
|
|
27
|
+
/** As `maskedMethod`, for a list read. */
|
|
28
|
+
maskedMethods(docs: readonly SavedPaymentMethodDocument[]): SavedPaymentMethodPlain[];
|
|
29
|
+
createWithId(id: string, data: Partial<SavedPaymentMethodPlain>): Promise<SavedPaymentMethodDocument>;
|
|
30
|
+
update(id: string, data: Partial<SavedPaymentMethodPlain>): Promise<SavedPaymentMethodDocument>;
|
|
20
31
|
/** List all saved methods for a user. Never returns raw `identifier` — only `displayLabel`. */
|
|
21
32
|
listByUser(userId: string): Promise<SavedPaymentMethodDocument[]>;
|
|
22
33
|
/**
|
|
@@ -13,7 +13,8 @@ import { normalizeError } from "../../../errors/normalize.js";
|
|
|
13
13
|
import { DatabaseError } from "../../../errors/index.js";
|
|
14
14
|
import { serverLogger } from "../../../monitoring/index.js";
|
|
15
15
|
import { BaseRepository, prepareForFirestore, } from "../../../providers/db-firebase/index.js";
|
|
16
|
-
import { PAYMENT_METHOD_PII_FIELDS,
|
|
16
|
+
import { PAYMENT_METHOD_PII_FIELDS, encryptPiiFields, maskPii, revealPii, } from "../../../security/index.js";
|
|
17
|
+
import { asEncrypted } from "../../../security/encrypted.js";
|
|
17
18
|
import { SAVED_PAYMENT_METHOD_FIELDS, SAVED_PAYMENT_METHODS_COLLECTION, } from "../schemas/saved-methods-firestore.js";
|
|
18
19
|
function normaliseIdentifier(s) {
|
|
19
20
|
return s.toLowerCase().replace(/\s+/g, "").trim();
|
|
@@ -27,19 +28,53 @@ export class SavedPaymentMethodsRepository extends BaseRepository {
|
|
|
27
28
|
constructor() {
|
|
28
29
|
super(SAVED_PAYMENT_METHODS_COLLECTION);
|
|
29
30
|
}
|
|
30
|
-
decrypt(doc) {
|
|
31
|
-
return decryptPiiFields(doc, [...PAYMENT_METHOD_PII_FIELDS]);
|
|
32
|
-
}
|
|
33
31
|
encrypt(data) {
|
|
34
32
|
return encryptPiiFields(data, [...PAYMENT_METHOD_PII_FIELDS]);
|
|
35
33
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
/*
|
|
35
|
+
* 🛑 `mapDoc` is NOT overridden, and that absence IS the change.
|
|
36
|
+
*
|
|
37
|
+
* It used to decrypt on every read, so ciphertext never left the database
|
|
38
|
+
* and every caller handled plaintext without ever saying so. Following
|
|
39
|
+
* `SiteSettingsRepository`: reads return what Firestore holds, and plaintext
|
|
40
|
+
* requires one of the two named methods below.
|
|
41
|
+
*
|
|
42
|
+
* A convention would not hold this. `SavedPaymentMethodDocument`'s PII fields are
|
|
43
|
+
* `Encrypted<string>`, assignable to nothing that wants a plain `string`, so
|
|
44
|
+
* a reader that skips both accessors is a compile error naming file and line.
|
|
45
|
+
*/
|
|
46
|
+
/** Plaintext PII. **Opt-in and named** — shows up in review and in a grep. */
|
|
47
|
+
revealMethod(doc) {
|
|
48
|
+
return revealPii(doc, PAYMENT_METHOD_PII_FIELDS);
|
|
49
|
+
}
|
|
50
|
+
/** As `revealMethod`, for a list read. */
|
|
51
|
+
revealMethods(docs) {
|
|
52
|
+
return docs.map((d) => this.revealMethod(d));
|
|
39
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Masked PII — **the default for any surface that only needs to identify a
|
|
56
|
+
* row to a human.** Decrypts first, then masks: the mask helpers refuse
|
|
57
|
+
* ciphertext by design, so passing a stored field straight in would return
|
|
58
|
+
* "Anonymous" for every row.
|
|
59
|
+
*/
|
|
60
|
+
maskedMethod(doc) {
|
|
61
|
+
return maskPii(doc, PAYMENT_METHOD_PII_FIELDS);
|
|
62
|
+
}
|
|
63
|
+
/** As `maskedMethod`, for a list read. */
|
|
64
|
+
maskedMethods(docs) {
|
|
65
|
+
return docs.map((d) => this.maskedMethod(d));
|
|
66
|
+
}
|
|
67
|
+
/*
|
|
68
|
+
* Takes PLAINTEXT, like the base it overrides — this method is what
|
|
69
|
+
* encrypts, so demanding ciphertext from callers inverted its own contract.
|
|
70
|
+
*/
|
|
40
71
|
async createWithId(id, data) {
|
|
41
72
|
return super.createWithId(id, this.encrypt(data));
|
|
42
73
|
}
|
|
74
|
+
/*
|
|
75
|
+
* Takes PLAINTEXT, like the base it overrides — this method is what
|
|
76
|
+
* encrypts, so demanding ciphertext from callers inverted its own contract.
|
|
77
|
+
*/
|
|
43
78
|
async update(id, data) {
|
|
44
79
|
return super.update(id, this.encrypt(data));
|
|
45
80
|
}
|
|
@@ -52,7 +87,18 @@ export class SavedPaymentMethodsRepository extends BaseRepository {
|
|
|
52
87
|
.get();
|
|
53
88
|
return snap.docs.map((d) => {
|
|
54
89
|
const doc = this.mapDoc(d);
|
|
55
|
-
|
|
90
|
+
/*
|
|
91
|
+
* Dropped, not decrypted-then-dropped.
|
|
92
|
+
*
|
|
93
|
+
* This read "never expose decrypted PII to caller" — true, because
|
|
94
|
+
* `mapDoc` decrypted every identifier and this threw it away
|
|
95
|
+
* immediately. The decryption was pure waste plus a window in which
|
|
96
|
+
* plaintext existed. `mapDoc` no longer decrypts, so what arrives here
|
|
97
|
+
* is ciphertext; the field is still blanked because these list reads
|
|
98
|
+
* are display-only, and ciphertext a caller cannot use is ciphertext
|
|
99
|
+
* it should not receive.
|
|
100
|
+
*/
|
|
101
|
+
doc.identifier = asEncrypted("");
|
|
56
102
|
return doc;
|
|
57
103
|
});
|
|
58
104
|
}
|
|
@@ -81,6 +127,8 @@ export class SavedPaymentMethodsRepository extends BaseRepository {
|
|
|
81
127
|
return this.update(docId, { lastUsedAt: now, displayLabel: input.displayLabel });
|
|
82
128
|
}
|
|
83
129
|
const docRef = this.getCollection().doc();
|
|
130
|
+
// PLAINTEXT in, ciphertext out: `this.encrypt(data)` below is what makes
|
|
131
|
+
// the document type true, so the payload is typed as the plain shape.
|
|
84
132
|
const data = {
|
|
85
133
|
userId,
|
|
86
134
|
type: input.type,
|
|
@@ -97,7 +145,7 @@ export class SavedPaymentMethodsRepository extends BaseRepository {
|
|
|
97
145
|
const refetched = await this.findById(docRef.id);
|
|
98
146
|
if (!refetched)
|
|
99
147
|
throw new DatabaseError("Payment method not readable after create");
|
|
100
|
-
refetched.identifier = "";
|
|
148
|
+
refetched.identifier = asEncrypted(""); // display-only — see listByUser
|
|
101
149
|
return refetched;
|
|
102
150
|
}
|
|
103
151
|
catch (error) {
|
|
@@ -113,7 +161,7 @@ export class SavedPaymentMethodsRepository extends BaseRepository {
|
|
|
113
161
|
.get();
|
|
114
162
|
return snap.docs.map((d) => {
|
|
115
163
|
const doc = this.mapDoc(d);
|
|
116
|
-
doc.identifier = "";
|
|
164
|
+
doc.identifier = asEncrypted(""); // display-only — see listByUser
|
|
117
165
|
return doc;
|
|
118
166
|
});
|
|
119
167
|
}
|
|
@@ -190,7 +238,7 @@ export class SavedPaymentMethodsRepository extends BaseRepository {
|
|
|
190
238
|
.get();
|
|
191
239
|
return snap.docs.map((d) => {
|
|
192
240
|
const doc = this.mapDoc(d);
|
|
193
|
-
doc.identifier = "";
|
|
241
|
+
doc.identifier = asEncrypted(""); // display-only — see listByUser
|
|
194
242
|
return doc;
|
|
195
243
|
});
|
|
196
244
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { type GeneratePayoutIdInput } from "../../../utils/id-generators";
|
|
5
5
|
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
6
6
|
import type { StatusChangeEntry } from "../../../_internal/shared/history/types";
|
|
7
|
+
import type { Encrypted, Plaintext } from "../../../security/encrypted";
|
|
7
8
|
export interface PayoutBankAccount {
|
|
8
9
|
accountHolderName: string;
|
|
9
10
|
accountNumberMasked: string;
|
|
@@ -34,10 +35,20 @@ export declare const PayoutStatusValues: {
|
|
|
34
35
|
readonly FAILED: "failed";
|
|
35
36
|
};
|
|
36
37
|
export type PayoutPaymentMethod = "bank_transfer" | "upi";
|
|
38
|
+
/**
|
|
39
|
+
* `PayoutDocument` with its PII as plain `string` — what the named repository
|
|
40
|
+
* accessors return, and what a WRITE path accepts (the repository encrypts).
|
|
41
|
+
*
|
|
42
|
+
* `Plaintext<T>` is the one definition of this shape; see `security/encrypted.ts`.
|
|
43
|
+
* It is deliberately NOT distinguishable from a MASKED value — `maskPii`
|
|
44
|
+
* returns plain strings too, and no type can express "these characters are
|
|
45
|
+
* asterisks". The distinction is which named method you called.
|
|
46
|
+
*/
|
|
47
|
+
export type PayoutPlain = Plaintext<PayoutDocument>;
|
|
37
48
|
export interface PayoutDocument extends BaseDocument {
|
|
38
49
|
storeId: string;
|
|
39
50
|
sellerName: string;
|
|
40
|
-
sellerEmail: string
|
|
51
|
+
sellerEmail: Encrypted<string>;
|
|
41
52
|
amount: number;
|
|
42
53
|
grossAmount: number;
|
|
43
54
|
platformFee: number;
|
|
@@ -46,7 +57,7 @@ export interface PayoutDocument extends BaseDocument {
|
|
|
46
57
|
status: PayoutStatus;
|
|
47
58
|
paymentMethod: PayoutPaymentMethod;
|
|
48
59
|
bankAccount?: PayoutBankAccount;
|
|
49
|
-
upiId?: string
|
|
60
|
+
upiId?: Encrypted<string>;
|
|
50
61
|
notes?: string;
|
|
51
62
|
adminNote?: string;
|
|
52
63
|
orderIds: string[];
|
|
@@ -119,7 +130,7 @@ export declare const PAYOUT_PUBLIC_FIELDS: readonly ["id", "storeId", "amount",
|
|
|
119
130
|
export declare const PAYOUT_ADMIN_UPDATEABLE_FIELDS: readonly ["status", "adminNote", "processedAt", "transactionId"];
|
|
120
131
|
/** The only field a seller may write on their own payout doc. */
|
|
121
132
|
export declare const PAYOUT_SELLER_UPDATEABLE_FIELDS: readonly ["sellerReminderFlag"];
|
|
122
|
-
export type PayoutCreateInput = Omit<
|
|
133
|
+
export type PayoutCreateInput = Omit<PayoutPlain, "id" | "createdAt" | "updatedAt" | "status" | "requestedAt">;
|
|
123
134
|
export type PayoutUpdateInput = Partial<Pick<PayoutDocument, (typeof PAYOUT_ADMIN_UPDATEABLE_FIELDS)[number]>>;
|
|
124
135
|
export declare const payoutQueryHelpers: {
|
|
125
136
|
readonly byStore: (storeId: string) => readonly ["storeId", "==", string];
|
|
@@ -10,13 +10,24 @@
|
|
|
10
10
|
* `displayLabel` is a pre-masked string and never contains full PII.
|
|
11
11
|
*/
|
|
12
12
|
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
13
|
+
import type { Encrypted, Plaintext } from "../../../security/encrypted";
|
|
13
14
|
export type SavedPaymentMethodType = "upi" | "card" | "bank_account" | "wallet";
|
|
14
15
|
export type SavedPaymentMethodBanStatus = "banned" | "suspicious" | "unban_requested";
|
|
16
|
+
/**
|
|
17
|
+
* `SavedPaymentMethodDocument` with its PII as plain `string` — what the named repository
|
|
18
|
+
* accessors return, and what a WRITE path accepts (the repository encrypts).
|
|
19
|
+
*
|
|
20
|
+
* `Plaintext<T>` is the one definition of this shape; see `security/encrypted.ts`.
|
|
21
|
+
* It is deliberately NOT distinguishable from a MASKED value — `maskPii`
|
|
22
|
+
* returns plain strings too, and no type can express "these characters are
|
|
23
|
+
* asterisks". The distinction is which named method you called.
|
|
24
|
+
*/
|
|
25
|
+
export type SavedPaymentMethodPlain = Plaintext<SavedPaymentMethodDocument>;
|
|
15
26
|
export interface SavedPaymentMethodDocument extends BaseDocument {
|
|
16
27
|
userId: string;
|
|
17
28
|
type: SavedPaymentMethodType;
|
|
18
29
|
/** Full UPI VPA / card PAN / account number — ENCRYPTED at rest. */
|
|
19
|
-
identifier: string
|
|
30
|
+
identifier: Encrypted<string>;
|
|
20
31
|
/** Pre-masked display string, never contains full PII. e.g. "9876...@paytm", "XXXX 4321 (HDFC)" */
|
|
21
32
|
displayLabel: string;
|
|
22
33
|
/** SHA-256(type|normalised(identifier)) — unencrypted; enables cross-account dedup without decrypting. */
|
|
@@ -23,7 +23,7 @@ export async function GET(request, { params }) {
|
|
|
23
23
|
const repo = db.getRepository("preorders");
|
|
24
24
|
const result = await repo.findAll({
|
|
25
25
|
filters: `slug==${slug}`,
|
|
26
|
-
|
|
26
|
+
pageSize: 1,
|
|
27
27
|
});
|
|
28
28
|
if (!result.data[0]) {
|
|
29
29
|
return NextResponse.json({ success: false, error: "Pre-order not found" }, { status: 404 });
|
|
@@ -5,9 +5,9 @@ export declare class PreOrdersRepository {
|
|
|
5
5
|
constructor(repo: IRepository<PreOrderItem>);
|
|
6
6
|
findAll(query?: SieveQuery): Promise<PagedResult<PreOrderItem>>;
|
|
7
7
|
findById(id: string): Promise<PreOrderItem | null>;
|
|
8
|
-
findByCustomer(customerId: string, page?: number,
|
|
9
|
-
findBySeller(sellerId: string, page?: number,
|
|
10
|
-
findByStatus(status: PreOrderStatus, page?: number,
|
|
8
|
+
findByCustomer(customerId: string, page?: number, pageSize?: number): Promise<PagedResult<PreOrderItem>>;
|
|
9
|
+
findBySeller(sellerId: string, page?: number, pageSize?: number): Promise<PagedResult<PreOrderItem>>;
|
|
10
|
+
findByStatus(status: PreOrderStatus, page?: number, pageSize?: number): Promise<PagedResult<PreOrderItem>>;
|
|
11
11
|
create(data: Omit<PreOrderItem, "id" | "createdAt" | "updatedAt">): Promise<PreOrderItem>;
|
|
12
12
|
updateStatus(id: string, status: PreOrderStatus, adminNote?: string): Promise<PreOrderItem>;
|
|
13
13
|
delete(id: string): Promise<void>;
|
|
@@ -8,28 +8,28 @@ export class PreOrdersRepository {
|
|
|
8
8
|
async findById(id) {
|
|
9
9
|
return this.repo.findById(id);
|
|
10
10
|
}
|
|
11
|
-
async findByCustomer(customerId, page = 1,
|
|
11
|
+
async findByCustomer(customerId, page = 1, pageSize = 20) {
|
|
12
12
|
return this.repo.findAll({
|
|
13
13
|
filters: `customerId==${customerId}`,
|
|
14
14
|
sort: "-createdAt",
|
|
15
15
|
page,
|
|
16
|
-
|
|
16
|
+
pageSize,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
async findBySeller(sellerId, page = 1,
|
|
19
|
+
async findBySeller(sellerId, page = 1, pageSize = 20) {
|
|
20
20
|
return this.repo.findAll({
|
|
21
21
|
filters: `sellerId==${sellerId}`,
|
|
22
22
|
sort: "-createdAt",
|
|
23
23
|
page,
|
|
24
|
-
|
|
24
|
+
pageSize,
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
async findByStatus(status, page = 1,
|
|
27
|
+
async findByStatus(status, page = 1, pageSize = 50) {
|
|
28
28
|
return this.repo.findAll({
|
|
29
29
|
filters: `status==${status}`,
|
|
30
30
|
sort: "-createdAt",
|
|
31
31
|
page,
|
|
32
|
-
|
|
32
|
+
pageSize,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
async create(data) {
|
|
@@ -75,7 +75,7 @@ export async function GET(_request, context) {
|
|
|
75
75
|
// Slug fallback: search by slug==id, status==published
|
|
76
76
|
const slugResult = await repo.findAll({
|
|
77
77
|
filters: `slug==${id},status==published`,
|
|
78
|
-
|
|
78
|
+
pageSize: 1,
|
|
79
79
|
});
|
|
80
80
|
item = slugResult.data[0] ?? null;
|
|
81
81
|
}
|