@mohasinac/appkit 4.53.1 → 4.54.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.
Files changed (384) hide show
  1. package/dist/.build-stamp.json +3 -3
  2. package/dist/_internal/client/theme/ThemeProvider.js +15 -1
  3. package/dist/_internal/server/features/auth/capabilities.js +7 -5
  4. package/dist/_internal/server/features/categories/price-guidance-resolve.d.ts +66 -0
  5. package/dist/_internal/server/features/categories/price-guidance-resolve.js +138 -0
  6. package/dist/_internal/server/features/checkout/actions.d.ts +22 -6
  7. package/dist/_internal/server/features/checkout/actions.js +96 -51
  8. package/dist/_internal/server/features/checkout/index.d.ts +1 -1
  9. package/dist/_internal/server/features/checkout/index.js +1 -1
  10. package/dist/_internal/server/features/checkout/supplier-identity.js +28 -6
  11. package/dist/_internal/server/features/orders/adapters.js +1 -3
  12. package/dist/_internal/server/features/price-index/market.d.ts +57 -0
  13. package/dist/_internal/server/features/price-index/market.js +120 -0
  14. package/dist/_internal/server/features/products/list-public.d.ts +12 -0
  15. package/dist/_internal/server/features/products/list-public.js +10 -1
  16. package/dist/_internal/server/features/products/listing-tab-counts.d.ts +25 -1
  17. package/dist/_internal/server/features/products/listing-tab-counts.js +184 -10
  18. package/dist/_internal/server/features/search/index-build/sources.js +43 -2
  19. package/dist/_internal/server/features/site-settings/adapters.js +1 -1
  20. package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
  21. package/dist/_internal/server/features/stores/adapters.js +0 -1
  22. package/dist/_internal/server/features/stores/tabs.d.ts +7 -2
  23. package/dist/_internal/server/features/stores/tabs.js +5 -3
  24. package/dist/_internal/server/jobs/core/analyticsAlertEvaluate.js +2 -5
  25. package/dist/_internal/server/jobs/core/jobRunners.js +0 -10
  26. package/dist/_internal/server/jobs/core/onOrderCreate.js +10 -104
  27. package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +0 -2
  28. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +0 -1
  29. package/dist/_internal/server/jobs/core/onScamReportCreate.js +0 -1
  30. package/dist/_internal/server/jobs/core/onScamReportRejected.js +0 -1
  31. package/dist/_internal/server/jobs/core/onScamReportVerified.js +0 -1
  32. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +0 -1
  33. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +0 -1
  34. package/dist/_internal/server/notifications/channel-health.d.ts +7 -3
  35. package/dist/_internal/server/notifications/channel-health.js +2 -2
  36. package/dist/_internal/server/notifications/send-guard.d.ts +1 -1
  37. package/dist/_internal/server/notifications/send-guard.js +2 -4
  38. package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
  39. package/dist/_internal/shared/actions/action-registry.js +128 -28
  40. package/dist/_internal/shared/checkout/order-math.d.ts +1 -1
  41. package/dist/_internal/shared/checkout/order-math.js +1 -1
  42. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +1 -1
  43. package/dist/_internal/shared/features/checkout/config.d.ts +0 -2
  44. package/dist/_internal/shared/features/checkout/config.js +0 -2
  45. package/dist/_internal/shared/features/messaging/config.d.ts +7 -5
  46. package/dist/_internal/shared/features/messaging/config.js +1 -4
  47. package/dist/_internal/shared/features/site-settings/fees.d.ts +0 -2
  48. package/dist/_internal/shared/features/site-settings/fees.js +0 -2
  49. package/dist/_internal/shared/features/site-settings/supplier-of-record.d.ts +56 -0
  50. package/dist/_internal/shared/features/site-settings/supplier-of-record.js +57 -0
  51. package/dist/_internal/shared/fees/calculator.d.ts +0 -8
  52. package/dist/_internal/shared/fees/calculator.js +0 -7
  53. package/dist/_internal/shared/listing-types/tiers.d.ts +94 -0
  54. package/dist/_internal/shared/listing-types/tiers.js +150 -0
  55. package/dist/_internal/shared/search/match.js +28 -2
  56. package/dist/cli/index.js +0 -2
  57. package/dist/client.d.ts +25 -4
  58. package/dist/client.js +36 -5
  59. package/dist/constants/api-endpoints.d.ts +28 -15
  60. package/dist/constants/api-endpoints.js +14 -8
  61. package/dist/constants/field-names.d.ts +1 -0
  62. package/dist/constants/field-names.js +1 -0
  63. package/dist/constants/notification-types.d.ts +1 -1
  64. package/dist/constants/notification-types.js +1 -1
  65. package/dist/core/integration-keys.d.ts +5 -5
  66. package/dist/core/integration-keys.js +21 -10
  67. package/dist/features/about/components/FeesView.js +0 -6
  68. package/dist/features/about/components/GuidesHubView.js +15 -2
  69. package/dist/features/account/components/NotificationPreferencesPanel.js +3 -4
  70. package/dist/features/account/components/UserOrdersView.js +26 -7
  71. package/dist/features/account/types/index.d.ts +0 -2
  72. package/dist/features/addresses/utils/postal-autofill.d.ts +39 -0
  73. package/dist/features/addresses/utils/postal-autofill.js +54 -0
  74. package/dist/features/admin/actions/notification-actions.d.ts +2 -8
  75. package/dist/features/admin/actions/notification-actions.js +9 -104
  76. package/dist/features/admin/components/AdminGuideHubView.js +1 -8
  77. package/dist/features/admin/components/AdminOrderEditorView.d.ts +1 -1
  78. package/dist/features/admin/components/AdminOrdersView.js +0 -2
  79. package/dist/features/admin/components/AdminSectionsView.js +3 -2
  80. package/dist/features/admin/components/AdminSiteSettingsView.js +22 -68
  81. package/dist/features/admin/components/AdminStoreEditorView.js +72 -34
  82. package/dist/features/admin/components/OwnerQuickActions.d.ts +29 -0
  83. package/dist/features/admin/components/OwnerQuickActions.js +142 -0
  84. package/dist/features/admin/components/sections/adminSectionsTypes.js +13 -4
  85. package/dist/features/admin/components/sections/icon-options.d.ts +21 -0
  86. package/dist/features/admin/components/sections/icon-options.js +23 -0
  87. package/dist/features/admin/components/sections/sectionTemplates.js +4 -1
  88. package/dist/features/admin/constants/site-settings-tabs.d.ts +7 -12
  89. package/dist/features/admin/constants/site-settings-tabs.js +6 -12
  90. package/dist/features/admin/repository/site-settings.repository.js +1 -1
  91. package/dist/features/admin/schemas/admin-editor-forms.d.ts +1 -1
  92. package/dist/features/admin/schemas/admin-editor-forms.js +4 -1
  93. package/dist/features/admin/schemas/admin-user-form.d.ts +0 -61
  94. package/dist/features/admin/schemas/admin-user-form.js +3 -44
  95. package/dist/features/admin/schemas/firestore.d.ts +28 -54
  96. package/dist/features/admin/schemas/firestore.js +40 -18
  97. package/dist/features/auctions/components/AuctionDetailPageView.js +12 -10
  98. package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +11 -1
  99. package/dist/features/auctions/components/MarketplaceAuctionCard.js +9 -2
  100. package/dist/features/auth/checkout-value-otp.d.ts +1 -1
  101. package/dist/features/auth/checkout-value-otp.js +1 -1
  102. package/dist/features/auth/permissions/constants.d.ts +29 -2
  103. package/dist/features/auth/permissions/constants.js +67 -1
  104. package/dist/features/blog/components/BlogFeaturedCard.d.ts +11 -1
  105. package/dist/features/blog/components/BlogFeaturedCard.js +9 -2
  106. package/dist/features/cart/components/CartDrawer.js +3 -2
  107. package/dist/features/cart/components/CartGroupLineRow.js +2 -1
  108. package/dist/features/cart/components/CartPriceBreakdown.d.ts +0 -2
  109. package/dist/features/cart/components/CartPriceBreakdown.js +1 -1
  110. package/dist/features/cart/components/StoreAddonsPicker.d.ts +2 -5
  111. package/dist/features/cart/components/StoreAddonsPicker.js +4 -5
  112. package/dist/features/cart/hooks/useAddToCart.js +10 -5
  113. package/dist/features/cart/repository/cart.repository.js +1 -2
  114. package/dist/features/cart/schemas/firestore.d.ts +1 -2
  115. package/dist/features/cart/utils/pending-ops.d.ts +11 -1
  116. package/dist/features/cart/utils/pending-ops.js +14 -2
  117. package/dist/features/categories/api/[id]/price-guidance/route.js +1 -24
  118. package/dist/features/categories/components/BrandDetailPageView.js +15 -6
  119. package/dist/features/categories/components/BrandDetailTabs.d.ts +7 -1
  120. package/dist/features/categories/components/BrandDetailTabs.js +18 -3
  121. package/dist/features/categories/components/BundleCollage.js +3 -2
  122. package/dist/features/categories/components/BundleDetailView.js +2 -1
  123. package/dist/features/categories/components/BundleItemsPicker.js +3 -4
  124. package/dist/features/categories/components/CategoryDetailPageView.js +19 -8
  125. package/dist/features/categories/components/CategoryDetailTabs.d.ts +7 -1
  126. package/dist/features/categories/components/CategoryDetailTabs.js +29 -7
  127. package/dist/features/categories/components/CategoryGrid.d.ts +11 -1
  128. package/dist/features/categories/components/CategoryGrid.js +9 -2
  129. package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +10 -5
  130. package/dist/features/checkout/actions/checkout-value-otp-actions.js +2 -88
  131. package/dist/features/classified/components/ClassifiedDetailPageView.js +12 -2
  132. package/dist/features/digital-codes/components/DigitalCodeDetailPageView.js +12 -2
  133. package/dist/features/events/components/EventCard.d.ts +11 -1
  134. package/dist/features/events/components/EventCard.js +9 -2
  135. package/dist/features/grouped/components/GroupedListingDetailView.js +3 -1
  136. package/dist/features/homepage/components/CTABannerSection.d.ts +3 -1
  137. package/dist/features/homepage/components/CTABannerSection.js +6 -3
  138. package/dist/features/homepage/components/HeroCarousel.js +8 -6
  139. package/dist/features/homepage/components/MarketplaceHomepageView.js +33 -7
  140. package/dist/features/homepage/components/SectionCarousel.js +13 -5
  141. package/dist/features/homepage/components/SecurityHighlightsSection.d.ts +8 -3
  142. package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -2
  143. package/dist/features/homepage/components/StatsCounterSection.d.ts +9 -4
  144. package/dist/features/homepage/components/StatsCounterSection.js +2 -2
  145. package/dist/features/homepage/components/TestimonialsCarousel.js +1 -1
  146. package/dist/features/homepage/components/TrustFeaturesSection.d.ts +18 -4
  147. package/dist/features/homepage/components/TrustFeaturesSection.js +5 -5
  148. package/dist/features/homepage/components/WelcomeSection.d.ts +13 -2
  149. package/dist/features/homepage/components/WelcomeSection.js +3 -3
  150. package/dist/features/homepage/components/WhatsAppCommunitySection.d.ts +28 -0
  151. package/dist/features/homepage/components/WhatsAppCommunitySection.js +42 -6
  152. package/dist/features/homepage/components/WhatsAppGlyph.d.ts +20 -0
  153. package/dist/features/homepage/components/WhatsAppGlyph.js +20 -0
  154. package/dist/features/homepage/constants/hero-carousel-styles.d.ts +8 -6
  155. package/dist/features/homepage/constants/hero-carousel-styles.js +8 -6
  156. package/dist/features/homepage/constants/section-copy.d.ts +12 -10
  157. package/dist/features/homepage/constants/section-copy.js +28 -6
  158. package/dist/features/homepage/constants/stat-icons.d.ts +12 -0
  159. package/dist/features/homepage/constants/stat-icons.js +17 -0
  160. package/dist/features/homepage/constants/trust-icon-aliases.d.ts +8 -0
  161. package/dist/features/homepage/constants/trust-icon-aliases.js +75 -0
  162. package/dist/features/homepage/lib/section-defaults.d.ts +16 -1
  163. package/dist/features/homepage/lib/section-defaults.js +24 -4
  164. package/dist/features/homepage/lib/section-renderer.js +48 -8
  165. package/dist/features/homepage/schemas/firestore.d.ts +18 -1
  166. package/dist/features/layout/AppLayoutShell.js +2 -1
  167. package/dist/features/layout/BottomActions.d.ts +1 -0
  168. package/dist/features/layout/BottomActions.js +330 -0
  169. package/dist/features/layout/BottomChrome.d.ts +45 -0
  170. package/dist/features/layout/BottomChrome.js +5 -17
  171. package/dist/features/layout/SideActionDock.js +36 -13
  172. package/dist/features/layout/index.d.ts +2 -7
  173. package/dist/features/layout/index.js +7 -7
  174. package/dist/features/layout/useIsDesktop.d.ts +36 -0
  175. package/dist/features/layout/useIsDesktop.js +48 -0
  176. package/dist/features/live/components/LiveItemDetailPageView.js +12 -2
  177. package/dist/features/orders/actions/refund-actions.js +0 -1
  178. package/dist/features/orders/components/OrderAddonBadges.d.ts +1 -3
  179. package/dist/features/orders/components/OrderAddonBadges.js +3 -4
  180. package/dist/features/orders/components/OrderPaymentSummary.js +15 -2
  181. package/dist/features/orders/components/YourPurchaseStrip.d.ts +24 -0
  182. package/dist/features/orders/components/YourPurchaseStrip.js +77 -0
  183. package/dist/features/orders/components/index.d.ts +2 -1
  184. package/dist/features/orders/components/index.js +1 -1
  185. package/dist/features/orders/repository/orders.repository.d.ts +0 -8
  186. package/dist/features/orders/repository/orders.repository.js +0 -2
  187. package/dist/features/orders/schemas/firestore.d.ts +17 -9
  188. package/dist/features/orders/types/index.d.ts +2 -5
  189. package/dist/features/orders/utils/order-announcement-message.d.ts +18 -0
  190. package/dist/features/orders/utils/order-announcement-message.js +16 -0
  191. package/dist/features/orders/utils/payment-proof-message.d.ts +20 -0
  192. package/dist/features/orders/utils/payment-proof-message.js +17 -0
  193. package/dist/features/parts/components/PartDetailPageView.js +96 -1
  194. package/dist/features/parts/schemas/firestore.d.ts +247 -0
  195. package/dist/features/parts/schemas/firestore.js +6 -6
  196. package/dist/features/pre-orders/components/MarketplacePreorderCard.d.ts +11 -1
  197. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +10 -3
  198. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +12 -10
  199. package/dist/features/price-index/components/PriceIndexToolView.d.ts +21 -0
  200. package/dist/features/price-index/components/PriceIndexToolView.js +230 -27
  201. package/dist/features/price-index/lookup-target.d.ts +48 -0
  202. package/dist/features/price-index/lookup-target.js +107 -0
  203. package/dist/features/products/api/[id]/route.js +8 -1
  204. package/dist/features/products/api/route.js +16 -4
  205. package/dist/features/products/components/AvailabilityScopeHint.d.ts +22 -0
  206. package/dist/features/products/components/AvailabilityScopeHint.js +27 -0
  207. package/dist/features/products/components/CompareOverlay.d.ts +2 -1
  208. package/dist/features/products/components/CompareOverlay.js +2 -1
  209. package/dist/features/products/components/GroupSettingsPanel.js +2 -1
  210. package/dist/features/products/components/InteractiveProductCard.d.ts +7 -1
  211. package/dist/features/products/components/InteractiveProductCard.js +16 -4
  212. package/dist/features/products/components/MarketplaceBundleCard.d.ts +11 -1
  213. package/dist/features/products/components/MarketplaceBundleCard.js +9 -2
  214. package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +11 -1
  215. package/dist/features/products/components/MarketplacePrizeDrawCard.js +9 -2
  216. package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -1
  217. package/dist/features/products/components/ProductDetailPageView.js +34 -4
  218. package/dist/features/products/components/ProductGrid.d.ts +14 -1
  219. package/dist/features/products/components/ProductGrid.js +22 -5
  220. package/dist/features/products/components/ProductsIndexListing.js +2 -2
  221. package/dist/features/products/components/SublistingCarouselSection.js +2 -1
  222. package/dist/features/products/repository/products.repository.d.ts +1 -0
  223. package/dist/features/products/repository/products.repository.js +5 -1
  224. package/dist/features/products/utils/group-member-image.d.ts +9 -2
  225. package/dist/features/products/utils/group-member-image.js +2 -1
  226. package/dist/features/reviews/api/[id]/route.js +83 -23
  227. package/dist/features/reviews/components/PurchaseReviewAffordance.d.ts +6 -0
  228. package/dist/features/reviews/components/PurchaseReviewAffordance.js +42 -0
  229. package/dist/features/reviews/components/ReviewFormDrawer.d.ts +34 -0
  230. package/dist/features/reviews/components/ReviewFormDrawer.js +127 -0
  231. package/dist/features/reviews/components/index.d.ts +4 -0
  232. package/dist/features/reviews/components/index.js +2 -0
  233. package/dist/features/scams/schemas/index.d.ts +10 -10
  234. package/dist/features/search/action-index/settings-entries.js +0 -9
  235. package/dist/features/seller/actions/seller-actions.d.ts +1 -1
  236. package/dist/features/seller/actions/seller-actions.js +49 -3
  237. package/dist/features/seller/components/SellerPayoutSettingsView.js +30 -2
  238. package/dist/features/seller/components/SellerProductShell.d.ts +17 -1
  239. package/dist/features/seller/components/SellerProductsView.js +3 -2
  240. package/dist/features/seller/hooks/useStoreListingEntitlements.d.ts +8 -0
  241. package/dist/features/seller/hooks/useStoreListingEntitlements.js +70 -0
  242. package/dist/features/store-extensions/repository/store-extensions.repositories.d.ts +1 -6
  243. package/dist/features/store-extensions/repository/store-extensions.repositories.js +1 -10
  244. package/dist/features/store-extensions/schemas/firestore.d.ts +1 -17
  245. package/dist/features/store-extensions/schemas/firestore.js +0 -10
  246. package/dist/features/stores/components/InteractiveStoreCard.d.ts +11 -1
  247. package/dist/features/stores/components/InteractiveStoreCard.js +9 -2
  248. package/dist/features/stores/components/StoreAuctionsListing.js +2 -1
  249. package/dist/features/stores/components/StoreCapabilitiesGuideView.js +0 -1
  250. package/dist/features/stores/components/StoreGuideHubView.js +2 -8
  251. package/dist/features/stores/components/StoreSettingsGuideView.js +2 -6
  252. package/dist/features/stores/components/index.d.ts +0 -2
  253. package/dist/features/stores/components/index.js +0 -1
  254. package/dist/features/stores/repository/store.repository.d.ts +1 -26
  255. package/dist/features/stores/repository/store.repository.js +5 -60
  256. package/dist/features/stores/schemas/firestore.d.ts +6 -25
  257. package/dist/features/stores/schemas/firestore.js +6 -3
  258. package/dist/features/stores/schemas/index.d.ts +1 -87
  259. package/dist/features/stores/schemas/index.js +10 -15
  260. package/dist/features/tester/seed-data/authored/admin__site-system.js +0 -48
  261. package/dist/features/tester/seed-data/authored/buying__buying-checkout.js +0 -40
  262. package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.js +114 -2
  263. package/dist/features/tester/seed-data/authored/selling__quick-add-minimum-details.js +0 -16
  264. package/dist/features/tester/seed-data/authored/selling__seller-guide.js +1 -1
  265. package/dist/features/tester/seed-data/authored/selling__seller-marketing-extras.js +0 -79
  266. package/dist/features/tester/seed-data/authored/selling__seller-orders.js +1 -1
  267. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +427 -69
  268. package/dist/index.d.ts +20 -32
  269. package/dist/index.js +34 -43
  270. package/dist/next/routing/route-map.d.ts +2 -8
  271. package/dist/next/routing/route-map.js +21 -4
  272. package/dist/providers/db-firebase/base.repository.d.ts +1 -1
  273. package/dist/providers/db-firebase/base.repository.js +1 -1
  274. package/dist/providers/payment-razorpay/index.d.ts +125 -0
  275. package/dist/providers/payment-razorpay/index.js +232 -0
  276. package/dist/providers/payment-razorpay/signature.d.ts +53 -0
  277. package/dist/providers/payment-razorpay/signature.js +71 -0
  278. package/dist/providers/shipping-shiprocket/index.d.ts +98 -0
  279. package/dist/providers/shipping-shiprocket/index.js +356 -0
  280. package/dist/providers.d.ts +3 -0
  281. package/dist/providers.js +3 -0
  282. package/dist/react/hooks/useCanSeePrices.d.ts +0 -27
  283. package/dist/react/hooks/useCanSeePrices.js +25 -0
  284. package/dist/repositories/index.d.ts +1 -1
  285. package/dist/repositories/index.js +1 -1
  286. package/dist/schemas/registry.d.ts +10 -115
  287. package/dist/schemas/registry.js +1 -2
  288. package/dist/security/pii-encrypt.js +1 -1
  289. package/dist/seed/_helpers/category-forest.js +27 -0
  290. package/dist/seed/_helpers/category-parts-glossary-map.js +1816 -86
  291. package/dist/seed/_helpers/category-parts.d.ts +1 -1
  292. package/dist/seed/_helpers/category-parts.js +13412 -3020
  293. package/dist/seed/carousel-slides-seed-data.js +47 -10
  294. package/dist/seed/categories-seed-data.js +48 -6
  295. package/dist/seed/faq-seed-data.js +2 -2
  296. package/dist/seed/homepage-sections-seed-data.js +286 -54
  297. package/dist/seed/index.d.ts +1 -1
  298. package/dist/seed/index.js +1 -1
  299. package/dist/seed/manifest.d.ts +1 -1
  300. package/dist/seed/manifest.js +1 -2
  301. package/dist/seed/model-composition-seed-data.js +6 -8
  302. package/dist/seed/part-glossary/chunk0.d.ts +9 -0
  303. package/dist/seed/part-glossary/chunk0.js +35448 -0
  304. package/dist/seed/part-glossary/chunk1.d.ts +9 -0
  305. package/dist/seed/part-glossary/chunk1.js +40494 -0
  306. package/dist/seed/part-glossary/chunk2.d.ts +9 -0
  307. package/dist/seed/part-glossary/chunk2.js +51242 -0
  308. package/dist/seed/part-glossary/chunk3.d.ts +9 -0
  309. package/dist/seed/part-glossary/chunk3.js +53337 -0
  310. package/dist/seed/part-glossary/chunk4.d.ts +9 -0
  311. package/dist/seed/part-glossary/chunk4.js +51454 -0
  312. package/dist/seed/part-glossary-seed-data.d.ts +1 -1
  313. package/dist/seed/part-glossary-seed-data.js +23 -47483
  314. package/dist/seed/products-beyblade-x-seed-data.js +36 -1
  315. package/dist/seed/site-settings-seed-data.js +34 -35
  316. package/dist/seed/store-extensions-seed-data.d.ts +1 -2
  317. package/dist/seed/store-extensions-seed-data.js +1 -23
  318. package/dist/seed/stores-seed-data.js +0 -1
  319. package/dist/server-entry.d.ts +1 -1
  320. package/dist/server-entry.js +1 -1
  321. package/dist/server.d.ts +10 -10
  322. package/dist/server.js +24 -22
  323. package/dist/styles.css +392 -43
  324. package/dist/tailwind-utilities.css +1 -1
  325. package/dist/tokens/themes/default-dark.js +1 -1
  326. package/dist/tokens/themes/default-light.js +2 -1
  327. package/dist/tokens/tokens.css +6 -2
  328. package/dist/ui/components/Button.d.ts +11 -0
  329. package/dist/ui/components/Button.js +11 -0
  330. package/dist/ui/components/Button.style.css +29 -0
  331. package/dist/ui/components/CarouselNav.d.ts +57 -0
  332. package/dist/ui/components/CarouselNav.js +25 -0
  333. package/dist/ui/components/CarouselNav.style.css +265 -0
  334. package/dist/ui/components/GatedPrice.js +30 -3
  335. package/dist/ui/components/GatedPrice.style.css +43 -40
  336. package/dist/ui/components/HorizontalScroller.d.ts +12 -1
  337. package/dist/ui/components/HorizontalScroller.js +43 -3
  338. package/dist/ui/components/ImageMosaic.d.ts +8 -1
  339. package/dist/ui/components/ImageMosaic.js +3 -2
  340. package/dist/ui/components/ImageMosaic.style.css +22 -0
  341. package/dist/ui/components/Layout.style.css +6 -0
  342. package/dist/ui/components/Semantic.d.ts +3 -2
  343. package/dist/ui/components/Semantic.js +1 -0
  344. package/dist/ui/components/Typography.d.ts +2 -0
  345. package/dist/ui/components/Typography.js +2 -0
  346. package/dist/ui/components/Typography.style.css +19 -0
  347. package/dist/ui/components/index.style.css +1 -0
  348. package/dist/ui/index.d.ts +3 -1
  349. package/dist/ui/index.js +4 -0
  350. package/package.json +3 -2
  351. package/scripts/seed-cli.mjs +133 -27
  352. package/dist/_internal/server/jobs/core/whatsappCatalogImport.d.ts +0 -27
  353. package/dist/_internal/server/jobs/core/whatsappCatalogImport.js +0 -172
  354. package/dist/_internal/server/jobs/core/whatsappNotify.d.ts +0 -35
  355. package/dist/_internal/server/jobs/core/whatsappNotify.js +0 -140
  356. package/dist/features/admin/components/AdminWhatsAppGuideView.d.ts +0 -2
  357. package/dist/features/admin/components/AdminWhatsAppGuideView.js +0 -35
  358. package/dist/features/orders/components/MarketplaceOrderCard.d.ts +0 -36
  359. package/dist/features/orders/components/MarketplaceOrderCard.js +0 -57
  360. package/dist/features/stores/components/StoreWhatsAppGuideView.d.ts +0 -3
  361. package/dist/features/stores/components/StoreWhatsAppGuideView.js +0 -12
  362. package/dist/features/whatsapp-bot/api/send-status/route.d.ts +0 -12
  363. package/dist/features/whatsapp-bot/api/send-status/route.js +0 -38
  364. package/dist/features/whatsapp-bot/api/webhook/route.d.ts +0 -12
  365. package/dist/features/whatsapp-bot/api/webhook/route.js +0 -43
  366. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.d.ts +0 -6
  367. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +0 -270
  368. package/dist/features/whatsapp-bot/components/WhatsAppChatButton.d.ts +0 -9
  369. package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +0 -7
  370. package/dist/features/whatsapp-bot/components/index.d.ts +0 -3
  371. package/dist/features/whatsapp-bot/components/index.js +0 -2
  372. package/dist/features/whatsapp-bot/helpers/payment-proof-message.d.ts +0 -14
  373. package/dist/features/whatsapp-bot/helpers/payment-proof-message.js +0 -17
  374. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +0 -52
  375. package/dist/features/whatsapp-bot/helpers/whatsapp.js +0 -283
  376. package/dist/features/whatsapp-bot/index.d.ts +0 -3
  377. package/dist/features/whatsapp-bot/index.js +0 -3
  378. package/dist/features/whatsapp-bot/manifest.d.ts +0 -2
  379. package/dist/features/whatsapp-bot/manifest.js +0 -13
  380. package/dist/features/whatsapp-bot/messages/en.json +0 -7
  381. package/dist/features/whatsapp-bot/server.d.ts +0 -7
  382. package/dist/features/whatsapp-bot/server.js +0 -7
  383. package/dist/features/whatsapp-bot/types/index.d.ts +0 -126
  384. package/dist/features/whatsapp-bot/types/index.js +0 -1
@@ -57,6 +57,11 @@ export declare const ACCOUNT_ENDPOINTS: {
57
57
  readonly HISTORY_ITEM: (productId: string) => string;
58
58
  readonly HISTORY_MERGE: "/api/user/history/merge";
59
59
  readonly REVIEWS: "/api/user/reviews";
60
+ /**
61
+ * "Have I bought this, and did I review it?" for one product — backs the
62
+ * purchase strip on a product page. Per-viewer, never cached.
63
+ */
64
+ readonly PURCHASE_CONTEXT: (productId: string) => string;
60
65
  readonly BIDS: "/api/user/bids";
61
66
  readonly BID_BY_ID: (id: string) => string;
62
67
  readonly EXPORT: "/api/user/export";
@@ -301,6 +306,13 @@ export declare const TOOL_ENDPOINTS: {
301
306
  * is the multi-get `searchPriceIndex` otherwise pays for every lookup.
302
307
  */
303
308
  readonly PRICE_INDEX_BANDS: (ids: readonly string[]) => string;
309
+ /**
310
+ * The competitor-crawl market band for the same leaves — SIGNED-IN ONLY, and
311
+ * therefore a separate request from `PRICE_INDEX_BANDS` rather than more
312
+ * fields on it. That route is public and edge-cached; this one must not be,
313
+ * or one signed-in lookup populates an entry every guest reads.
314
+ */
315
+ readonly PRICE_INDEX_MARKET: (ids: readonly string[]) => string;
304
316
  };
305
317
  /**
306
318
  * The sticker-sheet kiss-cut tracer. Admin-only, every route behind
@@ -445,6 +457,8 @@ export declare const PROMOTION_ENDPOINTS: {
445
457
  export declare const REVIEW_ENDPOINTS: {
446
458
  readonly LIST: "/api/reviews";
447
459
  readonly FEATURED: "/api/reviews?featured=true";
460
+ /** GET / PATCH / DELETE one review. The PATCH is the buyer's own edit. */
461
+ readonly BY_ID: (id: string) => string;
448
462
  };
449
463
  export declare const SEARCH_ENDPOINTS: {
450
464
  readonly SUGGESTIONS: "/api/search/suggestions";
@@ -555,11 +569,6 @@ export declare const SCAMMER_ENDPOINTS: {
555
569
  export declare const BEFORE_AFTER_ENDPOINTS: {
556
570
  readonly LIST: "/api/before-after";
557
571
  };
558
- export declare const WHATSAPP_SELLER_ENDPOINTS: {
559
- readonly SETTINGS: "/api/store/whatsapp-settings";
560
- readonly CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync";
561
- readonly CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import";
562
- };
563
572
  export declare const API_ENDPOINTS: {
564
573
  readonly CONFIG: {};
565
574
  readonly LOGS: {
@@ -612,6 +621,11 @@ export declare const API_ENDPOINTS: {
612
621
  readonly HISTORY_ITEM: (productId: string) => string;
613
622
  readonly HISTORY_MERGE: "/api/user/history/merge";
614
623
  readonly REVIEWS: "/api/user/reviews";
624
+ /**
625
+ * "Have I bought this, and did I review it?" for one product — backs the
626
+ * purchase strip on a product page. Per-viewer, never cached.
627
+ */
628
+ readonly PURCHASE_CONTEXT: (productId: string) => string;
615
629
  readonly BIDS: "/api/user/bids";
616
630
  readonly BID_BY_ID: (id: string) => string;
617
631
  readonly EXPORT: "/api/user/export";
@@ -951,6 +965,8 @@ export declare const API_ENDPOINTS: {
951
965
  readonly REVIEWS: {
952
966
  readonly LIST: "/api/reviews";
953
967
  readonly FEATURED: "/api/reviews?featured=true";
968
+ /** GET / PATCH / DELETE one review. The PATCH is the buyer's own edit. */
969
+ readonly BY_ID: (id: string) => string;
954
970
  };
955
971
  readonly SEARCH: {
956
972
  readonly SUGGESTIONS: "/api/search/suggestions";
@@ -1048,11 +1064,6 @@ export declare const API_ENDPOINTS: {
1048
1064
  readonly PRODUCTS: (sellerId: string) => string;
1049
1065
  readonly REVIEWS: (userId: string) => string;
1050
1066
  };
1051
- readonly WHATSAPP_SELLER: {
1052
- readonly SETTINGS: "/api/store/whatsapp-settings";
1053
- readonly CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync";
1054
- readonly CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import";
1055
- };
1056
1067
  readonly SUPPORT: {
1057
1068
  readonly TICKETS: "/api/support/tickets";
1058
1069
  readonly TICKET_BY_ID: (id: string) => string;
@@ -1139,6 +1150,11 @@ export declare const API_ROUTES: {
1139
1150
  readonly HISTORY_ITEM: (productId: string) => string;
1140
1151
  readonly HISTORY_MERGE: "/api/user/history/merge";
1141
1152
  readonly REVIEWS: "/api/user/reviews";
1153
+ /**
1154
+ * "Have I bought this, and did I review it?" for one product — backs the
1155
+ * purchase strip on a product page. Per-viewer, never cached.
1156
+ */
1157
+ readonly PURCHASE_CONTEXT: (productId: string) => string;
1142
1158
  readonly BIDS: "/api/user/bids";
1143
1159
  readonly BID_BY_ID: (id: string) => string;
1144
1160
  readonly EXPORT: "/api/user/export";
@@ -1478,6 +1494,8 @@ export declare const API_ROUTES: {
1478
1494
  readonly REVIEWS: {
1479
1495
  readonly LIST: "/api/reviews";
1480
1496
  readonly FEATURED: "/api/reviews?featured=true";
1497
+ /** GET / PATCH / DELETE one review. The PATCH is the buyer's own edit. */
1498
+ readonly BY_ID: (id: string) => string;
1481
1499
  };
1482
1500
  readonly SEARCH: {
1483
1501
  readonly SUGGESTIONS: "/api/search/suggestions";
@@ -1575,11 +1593,6 @@ export declare const API_ROUTES: {
1575
1593
  readonly PRODUCTS: (sellerId: string) => string;
1576
1594
  readonly REVIEWS: (userId: string) => string;
1577
1595
  };
1578
- readonly WHATSAPP_SELLER: {
1579
- readonly SETTINGS: "/api/store/whatsapp-settings";
1580
- readonly CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync";
1581
- readonly CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import";
1582
- };
1583
1596
  readonly SUPPORT: {
1584
1597
  readonly TICKETS: "/api/support/tickets";
1585
1598
  readonly TICKET_BY_ID: (id: string) => string;
@@ -79,6 +79,11 @@ export const ACCOUNT_ENDPOINTS = {
79
79
  HISTORY_ITEM: (productId) => `/api/user/history/${encodeURIComponent(productId)}`,
80
80
  HISTORY_MERGE: "/api/user/history/merge",
81
81
  REVIEWS: "/api/user/reviews",
82
+ /**
83
+ * "Have I bought this, and did I review it?" for one product — backs the
84
+ * purchase strip on a product page. Per-viewer, never cached.
85
+ */
86
+ PURCHASE_CONTEXT: (productId) => `/api/user/purchases/${encodeURIComponent(productId)}`,
82
87
  BIDS: "/api/user/bids",
83
88
  BID_BY_ID: (id) => `/api/user/bids/${id}`,
84
89
  EXPORT: "/api/user/export",
@@ -348,6 +353,13 @@ export const TOOL_ENDPOINTS = {
348
353
  * is the multi-get `searchPriceIndex` otherwise pays for every lookup.
349
354
  */
350
355
  PRICE_INDEX_BANDS: (ids) => `/api/tools/price-index/bands?ids=${ids.map(encodeURIComponent).join(",")}`,
356
+ /**
357
+ * The competitor-crawl market band for the same leaves — SIGNED-IN ONLY, and
358
+ * therefore a separate request from `PRICE_INDEX_BANDS` rather than more
359
+ * fields on it. That route is public and edge-cached; this one must not be,
360
+ * or one signed-in lookup populates an entry every guest reads.
361
+ */
362
+ PRICE_INDEX_MARKET: (ids) => `/api/tools/price-index/market?ids=${ids.map(encodeURIComponent).join(",")}`,
351
363
  };
352
364
  /**
353
365
  * The sticker-sheet kiss-cut tracer. Admin-only, every route behind
@@ -585,6 +597,8 @@ export const PROMOTION_ENDPOINTS = {
585
597
  export const REVIEW_ENDPOINTS = {
586
598
  LIST: "/api/reviews",
587
599
  FEATURED: "/api/reviews?featured=true",
600
+ /** GET / PATCH / DELETE one review. The PATCH is the buyer's own edit. */
601
+ BY_ID: (id) => `/api/reviews/${encodeURIComponent(id)}`,
588
602
  };
589
603
  // ---------------------------------------------------------------------------
590
604
  // Search
@@ -732,13 +746,6 @@ export const BEFORE_AFTER_ENDPOINTS = {
732
746
  LIST: "/api/before-after",
733
747
  };
734
748
  // ---------------------------------------------------------------------------
735
- // WhatsApp Business (store-level settings + catalog sync)
736
- // ---------------------------------------------------------------------------
737
- export const WHATSAPP_SELLER_ENDPOINTS = {
738
- SETTINGS: "/api/store/whatsapp-settings",
739
- CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync",
740
- CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import",
741
- };
742
749
  // ---------------------------------------------------------------------------
743
750
  // Aggregate namespace export
744
751
  // ---------------------------------------------------------------------------
@@ -784,7 +791,6 @@ export const API_ENDPOINTS = {
784
791
  SUBLISTING_CATEGORIES: SUBLISTING_CATEGORY_ENDPOINTS,
785
792
  WISHLIST: WISHLIST_ENDPOINTS,
786
793
  PROFILE_STATS: PROFILE_STATS_ENDPOINTS,
787
- WHATSAPP_SELLER: WHATSAPP_SELLER_ENDPOINTS,
788
794
  SUPPORT: SUPPORT_ENDPOINTS,
789
795
  SCAMMERS: SCAMMER_ENDPOINTS,
790
796
  REPORTS: REPORT_ENDPOINTS,
@@ -892,6 +892,7 @@ export declare const SITE_SETTINGS_FIELDS: {
892
892
  };
893
893
  readonly PAYMENT: "payment";
894
894
  readonly PAYMENT_FIELDS: {
895
+ readonly RAZORPAY_ENABLED: "payment.razorpayEnabled";
895
896
  readonly PHONEPE_ENABLED: "payment.phonepeEnabled";
896
897
  readonly UPI_MANUAL_ENABLED: "payment.upiManualEnabled";
897
898
  readonly COD_ENABLED: "payment.codEnabled";
@@ -1077,6 +1077,7 @@ export const SITE_SETTINGS_FIELDS = {
1077
1077
  },
1078
1078
  PAYMENT: "payment",
1079
1079
  PAYMENT_FIELDS: {
1080
+ RAZORPAY_ENABLED: "payment.razorpayEnabled",
1080
1081
  PHONEPE_ENABLED: "payment.phonepeEnabled",
1081
1082
  UPI_MANUAL_ENABLED: "payment.upiManualEnabled",
1082
1083
  COD_ENABLED: "payment.codEnabled",
@@ -12,7 +12,7 @@
12
12
  * **18 of the 27 real types** and was offered two that never appear.
13
13
  * · `AdminSiteSettingsView`'s per-channel allow-list, so an admin literally
14
14
  * **could not allow-list `offer_received` or `payment_review`** for email
15
- * or WhatsApp — the toggle did not exist.
15
+ * — the toggle did not exist.
16
16
  *
17
17
  * Everything here now derives from `NOTIFICATION_TYPE_VALUES`, so a new
18
18
  * notification type is one edit and cannot be missing from either surface.
@@ -12,7 +12,7 @@
12
12
  * **18 of the 27 real types** and was offered two that never appear.
13
13
  * · `AdminSiteSettingsView`'s per-channel allow-list, so an admin literally
14
14
  * **could not allow-list `offer_received` or `payment_review`** for email
15
- * or WhatsApp — the toggle did not exist.
15
+ * — the toggle did not exist.
16
16
  *
17
17
  * Everything here now derives from `NOTIFICATION_TYPE_VALUES`, so a new
18
18
  * notification type is one edit and cannot be missing from either surface.
@@ -6,12 +6,12 @@ export interface ResolvedKeys {
6
6
  phonepeEnvironment: string;
7
7
  phonepeWebhookUsername: string;
8
8
  phonepeWebhookPassword: string;
9
+ /** Publishable key (`rzp_test_…` / `rzp_live_…`) — the one value here that is safe to hand the browser. */
10
+ razorpayKeyId: string;
11
+ razorpayKeySecret: string;
12
+ /** Webhook signing secret. Optional in practice: without it `verifyWebhook()` fails closed and the buyer-present /verify path still works. */
13
+ razorpayWebhookSecret: string;
9
14
  resendApiKey: string;
10
- whatsappApiKey: string;
11
- whatsappPhoneNumberId: string;
12
- whatsappCloudApiToken: string;
13
- /** Comma-separated digits-only numbers, e.g. "919876543210,918765432109" */
14
- whatsappAdminNotifyNumbers: string;
15
15
  }
16
16
  /** Drops the in-process cache. Call this after admin saves new credentials. */
17
17
  export declare function invalidateIntegrationKeysCache(): void;
@@ -28,14 +28,28 @@ const EMPTY_KEYS = {
28
28
  phonepeEnvironment: "",
29
29
  phonepeWebhookUsername: "",
30
30
  phonepeWebhookPassword: "",
31
+ razorpayKeyId: "",
32
+ razorpayKeySecret: "",
33
+ razorpayWebhookSecret: "",
31
34
  resendApiKey: "",
32
- whatsappApiKey: "",
33
- whatsappPhoneNumberId: "",
34
- whatsappCloudApiToken: "",
35
- whatsappAdminNotifyNumbers: "",
36
35
  };
37
36
  let _cache = null;
38
37
  const CACHE_TTL_MS = 60000; // 1 minute
38
+ /**
39
+ * Treats a seeded `*_PLACEHOLDER` value as ABSENT so the env fallback wins.
40
+ *
41
+ * Most seeded credentials are the literal string `"…_PLACEHOLDER"`, which is
42
+ * truthy — so a plain `db.x || process.env.X` resolves to the placeholder and
43
+ * the real env var is never read. For a gateway that is worse than an empty
44
+ * value: the placeholder reaches Razorpay's API and produces an authentication
45
+ * failure mid-checkout rather than cleanly falling back. `resolveEmailProvider`
46
+ * is the reference for this test; see CLAUDE.md's siteSettings row.
47
+ */
48
+ function usable(value) {
49
+ if (!value || value.includes("PLACEHOLDER"))
50
+ return "";
51
+ return value;
52
+ }
39
53
  /** Drops the in-process cache. Call this after admin saves new credentials. */
40
54
  export function invalidateIntegrationKeysCache() {
41
55
  _cache = null;
@@ -55,6 +69,9 @@ export async function resolveKeys() {
55
69
  void normalizeError(_err); // Firestore unavailable — fall through to env-based defaults for backward compatibility
56
70
  }
57
71
  const value = {
72
+ razorpayKeyId: usable(db.razorpayKeyId) || process.env.RAZORPAY_KEY_ID || "",
73
+ razorpayKeySecret: usable(db.razorpayKeySecret) || process.env.RAZORPAY_KEY_SECRET || "",
74
+ razorpayWebhookSecret: usable(db.razorpayWebhookSecret) || process.env.RAZORPAY_WEBHOOK_SECRET || "",
58
75
  phonepeClientId: db.phonepeClientId || process.env.PHONEPE_CLIENT_ID || "",
59
76
  phonepeClientSecret: db.phonepeClientSecret || process.env.PHONEPE_CLIENT_SECRET || "",
60
77
  phonepeClientVersion: db.phonepeClientVersion || process.env.PHONEPE_CLIENT_VERSION || "1",
@@ -62,12 +79,6 @@ export async function resolveKeys() {
62
79
  phonepeWebhookUsername: db.phonepeWebhookUsername || process.env.PHONEPE_WEBHOOK_USERNAME || "",
63
80
  phonepeWebhookPassword: db.phonepeWebhookPassword || process.env.PHONEPE_WEBHOOK_PASSWORD || "",
64
81
  resendApiKey: db.resendApiKey || process.env.RESEND_API_KEY || "",
65
- whatsappApiKey: db.whatsappApiKey || process.env.WHATSAPP_API_KEY || "",
66
- whatsappPhoneNumberId: db.whatsappPhoneNumberId || process.env.WHATSAPP_PHONE_NUMBER_ID || "",
67
- whatsappCloudApiToken: db.whatsappCloudApiToken || process.env.WHATSAPP_CLOUD_API_TOKEN || "",
68
- whatsappAdminNotifyNumbers: db.whatsappAdminNotifyNumbers ||
69
- process.env.WHATSAPP_ADMIN_NOTIFY_NUMBERS ||
70
- "",
71
82
  };
72
83
  _cache = { value, expiresAt: Date.now() + CACHE_TTL_MS };
73
84
  return value;
@@ -65,12 +65,6 @@ export async function FeesView({} = {}) {
65
65
  who: t("paidByBuyer"),
66
66
  note: t("codHandlingFeeNote"),
67
67
  },
68
- {
69
- category: t("whatsappNotifyFeeTitle"),
70
- rate: t("whatsappNotifyFeeRate"),
71
- who: t("paidByBuyer"),
72
- note: t("whatsappNotifyFeeNote"),
73
- },
74
68
  {
75
69
  category: t("giftWrapFeeTitle"),
76
70
  rate: t("giftWrapFeeRate"),
@@ -49,8 +49,21 @@ export async function GuidesHubView({} = {}) {
49
49
  blurb: t("groupSellingBlurb"),
50
50
  items: [
51
51
  { href: String(ROUTES.PUBLIC.SELLER_GUIDE), label: t("sellerGuide"), text: t("sellerGuideText") },
52
- { href: String(ROUTES.PUBLIC.SELLER_GUIDE_BUNDLES), label: t("bundleGuide"), text: t("bundleGuideText") },
53
- { href: String(ROUTES.PUBLIC.SELLER_GUIDE_PRIZE_DRAWS), label: t("prizeDrawGuide"), text: t("prizeDrawGuideText") },
52
+ /*
53
+ * 🛑 HIDDEN BLOCK — the bundle and prize-draw guides, withdrawn
54
+ * 2026-10-20 alongside the footer entries for those listing types
55
+ * (`HIDDEN_FOOTER_LINK_HREFS`, src/constants/navigation.tsx). A hub
56
+ * card is a promise that the thing it describes is open for business;
57
+ * teaching a seller to run a prize draw they cannot currently publish
58
+ * is worse than saying nothing.
59
+ *
60
+ * The pages, the routes and the `guidesHub.bundleGuide*` /
61
+ * `guidesHub.prizeDrawGuide*` message keys are all left in place, so
62
+ * restoring this is uncommenting two lines.
63
+ *
64
+ * { href: String(ROUTES.PUBLIC.SELLER_GUIDE_BUNDLES), label: t("bundleGuide"), text: t("bundleGuideText") },
65
+ * { href: String(ROUTES.PUBLIC.SELLER_GUIDE_PRIZE_DRAWS), label: t("prizeDrawGuide"), text: t("prizeDrawGuideText") },
66
+ */
54
67
  ],
55
68
  },
56
69
  ];
@@ -30,7 +30,7 @@ export function NotificationPreferencesPanel({ fetchUrl = ACCOUNT_ENDPOINTS.NOTI
30
30
  const { showToast } = useToast();
31
31
  const { data: settings } = useSiteSettings();
32
32
  const adminChannels = settings?.notificationChannels;
33
- const [channels, setChannels] = useState({ email: true, whatsapp: true, sms: true });
33
+ const [channels, setChannels] = useState({ email: true, sms: true });
34
34
  const [types, setTypes] = useState({
35
35
  orderUpdates: true, bids: true, promotions: true,
36
36
  system: true, reviews: true, messages: true, offers: true,
@@ -92,8 +92,7 @@ export function NotificationPreferencesPanel({ fetchUrl = ACCOUNT_ENDPOINTS.NOTI
92
92
  }
93
93
  // Which channels are admin-enabled (only show those toggles to the user)
94
94
  const emailAdminEnabled = adminChannels?.email?.enabled ?? false;
95
- const whatsappAdminEnabled = adminChannels?.whatsapp?.enabled ?? false;
96
95
  const smsAdminEnabled = adminChannels?.sms?.enabled ?? false;
97
- const anyChannelEnabled = emailAdminEnabled || whatsappAdminEnabled || smsAdminEnabled;
98
- return (_jsxs(Stack, { gap: "lg", children: [_jsx(SectionCard, { title: "In-app notifications", children: _jsxs(Row, { align: "center", justify: "between", gap: "md", padding: "y-sm", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: "In-app notifications" }), _jsx(Text, { variant: "secondary", className: "mt-0.5", size: "xs", children: "Always on \u2014 displayed in the notification bell and inbox" })] }), _jsx(Row, { className: "h-5 w-9 bg-[var(--appkit-color-primary)] px-[0.125rem]", align: "center", justify: "end", rounded: "full", "aria-label": "Always on", children: _jsx(Span, { className: "h-4 w-4", rounded: "full", surface: "default", shadow: "default" }) })] }) }), anyChannelEnabled && (_jsxs(SectionCard, { title: "Notification channels", children: [emailAdminEnabled && (_jsx(ToggleRow, { label: "Email", description: "Receive notifications by email", checked: channels.email !== false, onChange: (v) => setChannel("email", v) })), whatsappAdminEnabled && (_jsx(ToggleRow, { label: "WhatsApp", description: "Receive notifications on WhatsApp", checked: channels.whatsapp !== false, onChange: (v) => setChannel("whatsapp", v) })), smsAdminEnabled && (_jsx(ToggleRow, { label: "SMS", description: "Receive SMS text notifications", checked: channels.sms !== false, onChange: (v) => setChannel("sms", v) }))] })), _jsx(SectionCard, { title: "Notification types", children: TYPE_ROWS.map((row) => (_jsx(ToggleRow, { label: row.label, description: row.description, checked: types[row.key] !== false, onChange: (v) => setType(row.key, v) }, row.key))) }), _jsxs(Row, { justify: "end", gap: "sm", children: [saved && (_jsx(Text, { className: "text-[var(--appkit-color-success)] self-center", size: "sm", children: "Preferences saved \u2713" })), _jsx(Button, { onClick: handleSave, isLoading: saving, size: "sm", children: "Save preferences" })] })] }));
96
+ const anyChannelEnabled = emailAdminEnabled || smsAdminEnabled;
97
+ return (_jsxs(Stack, { gap: "lg", children: [_jsx(SectionCard, { title: "In-app notifications", children: _jsxs(Row, { align: "center", justify: "between", gap: "md", padding: "y-sm", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: "In-app notifications" }), _jsx(Text, { variant: "secondary", className: "mt-0.5", size: "xs", children: "Always on \u2014 displayed in the notification bell and inbox" })] }), _jsx(Row, { className: "h-5 w-9 bg-[var(--appkit-color-primary)] px-[0.125rem]", align: "center", justify: "end", rounded: "full", "aria-label": "Always on", children: _jsx(Span, { className: "h-4 w-4", rounded: "full", surface: "default", shadow: "default" }) })] }) }), anyChannelEnabled && (_jsxs(SectionCard, { title: "Notification channels", children: [emailAdminEnabled && (_jsx(ToggleRow, { label: "Email", description: "Receive notifications by email", checked: channels.email !== false, onChange: (v) => setChannel("email", v) })), smsAdminEnabled && (_jsx(ToggleRow, { label: "SMS", description: "Receive SMS text notifications", checked: channels.sms !== false, onChange: (v) => setChannel("sms", v) }))] })), _jsx(SectionCard, { title: "Notification types", children: TYPE_ROWS.map((row) => (_jsx(ToggleRow, { label: row.label, description: row.description, checked: types[row.key] !== false, onChange: (v) => setType(row.key, v) }, row.key))) }), _jsxs(Row, { justify: "end", gap: "sm", children: [saved && (_jsx(Text, { className: "text-[var(--appkit-color-success)] self-center", size: "sm", children: "Preferences saved \u2713" })), _jsx(Button, { onClick: handleSave, isLoading: saving, size: "sm", children: "Save preferences" })] })] }));
99
98
  }
@@ -11,7 +11,23 @@ import { OrderCard } from "../../orders/components/OrdersList.js";
11
11
  import { useOrderScope } from "../../orders/components/OrderScopeTabs.js";
12
12
  import { useSearchParams } from "next/navigation.js";
13
13
  const CANCELLABLE_STATUSES = new Set(["pending", "confirmed", "processing"]);
14
- const TRACKABLE_STATUSES = new Set(["shipped"]);
14
+ /*
15
+ * 🛑 Every PRE-DELIVERY status, not just "shipped".
16
+ *
17
+ * It was `["shipped"]` alone, so a buyer whose order was pending, confirmed
18
+ * or processing had no "where is it" link at all — which is precisely when
19
+ * they most want one. The timeline on the track page reads correctly for all
20
+ * of these: it shows the stages reached and the stages still ahead.
21
+ *
22
+ * Delivered, cancelled, refunded and returned are excluded because tracking a
23
+ * finished order is the order detail page's job, not a courier's.
24
+ */
25
+ const TRACKABLE_STATUSES = new Set([
26
+ "pending",
27
+ "confirmed",
28
+ "processing",
29
+ "shipped",
30
+ ]);
15
31
  const SORT_OPTIONS = [
16
32
  { value: sortBy("createdAt", "DESC"), label: "Newest first" },
17
33
  { value: sortBy("createdAt", "ASC"), label: "Oldest first" },
@@ -77,12 +93,15 @@ export function UserOrdersView({ onOrderClick }) {
77
93
  portal: "user",
78
94
  title: "My Orders",
79
95
  search: {
80
- placeholder: "Search by order id…",
81
- // `/api/user/orders` filters in memory on `o.id` and nothing else — not
82
- // the product titles the rows display, which is what a buyer would try
83
- // first. Saying "order id" is the honest promise until the route can
84
- // match more.
85
- fields: ["id"],
96
+ placeholder: "Search by item or order id…",
97
+ /*
98
+ * The route now matches product titles as well as the order id, so the
99
+ * placeholder can promise it. It said "order id" because that was all
100
+ * the route could do, with a comment calling that "the honest promise
101
+ * until the route can match more" — this is the promise catching up,
102
+ * not a widened claim.
103
+ */
104
+ fields: ["id", "productTitle"],
86
105
  },
87
106
  emptyLabel: emptyMessage,
88
107
  filterKeys: ["status", "orderType"],
@@ -75,8 +75,6 @@ export interface UserAddress {
75
75
  export interface NotificationChannelPrefs {
76
76
  /** Disable all email notifications for this user (default: true = enabled). */
77
77
  email?: boolean;
78
- /** Disable all WhatsApp notifications for this user. */
79
- whatsapp?: boolean;
80
78
  /** Disable all SMS notifications for this user. */
81
79
  sms?: boolean;
82
80
  }
@@ -0,0 +1,39 @@
1
+ interface CityState {
2
+ city: string;
3
+ state: string;
4
+ }
5
+ /**
6
+ * What the last autofill wrote, so a later one can tell its own output apart
7
+ * from a human's typing. A field is absent when the helper declined to write
8
+ * it — which makes it the human's, and untouchable.
9
+ */
10
+ export type PostalAutofillMemo = Partial<CityState>;
11
+ /**
12
+ * Merge `resolved` into `prev`, returning the new values and an updated memo.
13
+ *
14
+ * ── 🛑 THE BUG THIS EXISTS TO FIX ─────────────────────────────────────────
15
+ *
16
+ * Both address forms used `prev.city.trim() ? prev.city : city` — fill only
17
+ * an EMPTY field. That intent is right and is preserved here: correcting an
18
+ * address someone deliberately typed is a bug they cannot report, because
19
+ * they watch their own input vanish with no idea what did it.
20
+ *
21
+ * But "empty" cannot tell WHO filled the field. After the first lookup the
22
+ * city is non-empty — written by the autofill itself — so every subsequent
23
+ * lookup is refused. Enter 413001, get Solapur/Maharashtra; correct the PIN
24
+ * to 500005 (Hyderabad) and the form still shows Solapur. The PIN and the
25
+ * city now disagree, the form validates, and the parcel ships to the wrong
26
+ * city — worse than never autofilling at all.
27
+ *
28
+ * ── The rule ──────────────────────────────────────────────────────────────
29
+ *
30
+ * A field is ours to overwrite when it is EMPTY, or when it still holds
31
+ * exactly what we last wrote into it. The moment a human edits it, it stops
32
+ * matching the memo and becomes untouchable again — the original guarantee,
33
+ * now actually enforceable rather than approximated by "is it blank".
34
+ */
35
+ export declare function applyPostalAutofill<T extends CityState>(prev: T, resolved: Partial<CityState>, memo: PostalAutofillMemo): {
36
+ next: T;
37
+ memo: PostalAutofillMemo;
38
+ };
39
+ export {};
@@ -0,0 +1,54 @@
1
+ /*
2
+ * WHY: A postal lookup must fill the city/state it knows WITHOUT overwriting
3
+ * what the person typed — and the obvious test for that ("is the field
4
+ * empty?") silently breaks every lookup after the first.
5
+ * WHAT: `applyPostalAutofill` — merge a resolved city/state into form values,
6
+ * overwriting only values this helper itself wrote earlier.
7
+ *
8
+ * EXPORTS: applyPostalAutofill, type PostalAutofillMemo
9
+ *
10
+ * @tag domain:addresses
11
+ * @tag layer:utils
12
+ * @tag pattern:pure
13
+ * @tag sideEffects:none
14
+ */
15
+ /**
16
+ * Merge `resolved` into `prev`, returning the new values and an updated memo.
17
+ *
18
+ * ── 🛑 THE BUG THIS EXISTS TO FIX ─────────────────────────────────────────
19
+ *
20
+ * Both address forms used `prev.city.trim() ? prev.city : city` — fill only
21
+ * an EMPTY field. That intent is right and is preserved here: correcting an
22
+ * address someone deliberately typed is a bug they cannot report, because
23
+ * they watch their own input vanish with no idea what did it.
24
+ *
25
+ * But "empty" cannot tell WHO filled the field. After the first lookup the
26
+ * city is non-empty — written by the autofill itself — so every subsequent
27
+ * lookup is refused. Enter 413001, get Solapur/Maharashtra; correct the PIN
28
+ * to 500005 (Hyderabad) and the form still shows Solapur. The PIN and the
29
+ * city now disagree, the form validates, and the parcel ships to the wrong
30
+ * city — worse than never autofilling at all.
31
+ *
32
+ * ── The rule ──────────────────────────────────────────────────────────────
33
+ *
34
+ * A field is ours to overwrite when it is EMPTY, or when it still holds
35
+ * exactly what we last wrote into it. The moment a human edits it, it stops
36
+ * matching the memo and becomes untouchable again — the original guarantee,
37
+ * now actually enforceable rather than approximated by "is it blank".
38
+ */
39
+ export function applyPostalAutofill(prev, resolved, memo) {
40
+ const nextMemo = {};
41
+ const merge = (field) => {
42
+ const current = prev[field];
43
+ const incoming = resolved[field];
44
+ const ours = current.trim() === "" || current === memo[field];
45
+ if (!ours || !incoming)
46
+ return current; // human's value, or nothing to say
47
+ nextMemo[field] = incoming;
48
+ return incoming;
49
+ };
50
+ return {
51
+ next: { ...prev, city: merge("city"), state: merge("state") },
52
+ memo: nextMemo,
53
+ };
54
+ }
@@ -11,12 +11,8 @@ export declare function getUnreadNotificationCount(userId: string): Promise<numb
11
11
  export interface SendNotificationInput extends NotificationCreateInput {
12
12
  /** User's email — used by the email channel when enabled. */
13
13
  userEmail?: string;
14
- /** User's phone with country code, digits only — used by WhatsApp channel. */
15
- userPhone?: string;
16
14
  /** Pre-rendered email HTML — falls back to a plain-text <p> when absent. */
17
15
  emailHtml?: string;
18
- /** Buyer paid the ₹10 WhatsApp order-updates addon — enables WhatsApp channel for this notification even when the user has no standing WhatsApp subscription. */
19
- orderWhatsappAddonPaid?: boolean;
20
16
  /**
21
17
  * Which portal the recipient reads this in — decides where `actionUrl`
22
18
  * points when the caller does not supply one.
@@ -52,17 +48,15 @@ export interface SendNotificationInput extends NotificationCreateInput {
52
48
  export interface SendNotificationResult {
53
49
  notification: NotificationDocument;
54
50
  email: "sent" | "skipped" | "failed";
55
- /** WhatsApp dispatch is now async (enqueued as a `whatsappNotify` job) — "queued" replaces "sent" as the immediate outcome; the real delivery result lands on `notification.whatsappStatus`. */
56
- whatsapp: "queued" | "skipped" | "failed";
57
51
  }
58
52
  /**
59
53
  * Create an in-app notification and fan out to enabled external channels.
60
54
  *
61
- * In-app is always written. Email / WhatsApp are sent only when:
55
+ * In-app is always written. Email is sent only when:
62
56
  * 1. The channel is enabled in siteSettings.notificationChannels
63
57
  * 2. Notification priority meets the channel's minPriority threshold
64
58
  * 3. The optional `types` filter includes this notification type (or is absent)
65
- * 4. The contact field (userEmail / userPhone) is supplied by the caller
59
+ * 4. The contact field (userEmail) is supplied by the caller
66
60
  * 5. The required credentials are set in siteSettings.credentials
67
61
  */
68
62
  export declare function sendNotification(input: SendNotificationInput): Promise<SendNotificationResult>;