@mohasinac/appkit 4.53.2 → 4.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/.build-stamp.json +3 -3
  2. package/dist/_internal/server/features/auth/capabilities.js +7 -5
  3. package/dist/_internal/server/features/checkout/actions.d.ts +22 -6
  4. package/dist/_internal/server/features/checkout/actions.js +96 -51
  5. package/dist/_internal/server/features/checkout/index.d.ts +1 -1
  6. package/dist/_internal/server/features/checkout/index.js +1 -1
  7. package/dist/_internal/server/features/checkout/supplier-identity.js +28 -6
  8. package/dist/_internal/server/features/orders/adapters.js +1 -3
  9. package/dist/_internal/server/features/products/listing-tab-counts.js +81 -25
  10. package/dist/_internal/server/features/search/index-build/sources.js +43 -2
  11. package/dist/_internal/server/features/site-settings/adapters.js +1 -1
  12. package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
  13. package/dist/_internal/server/features/stores/adapters.js +0 -1
  14. package/dist/_internal/server/jobs/core/analyticsAlertEvaluate.js +2 -5
  15. package/dist/_internal/server/jobs/core/jobRunners.js +0 -10
  16. package/dist/_internal/server/jobs/core/onOrderCreate.js +10 -104
  17. package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +0 -2
  18. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +0 -1
  19. package/dist/_internal/server/jobs/core/onScamReportCreate.js +0 -1
  20. package/dist/_internal/server/jobs/core/onScamReportRejected.js +0 -1
  21. package/dist/_internal/server/jobs/core/onScamReportVerified.js +0 -1
  22. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +0 -1
  23. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +0 -1
  24. package/dist/_internal/server/notifications/channel-health.d.ts +7 -3
  25. package/dist/_internal/server/notifications/channel-health.js +2 -2
  26. package/dist/_internal/server/notifications/send-guard.d.ts +1 -1
  27. package/dist/_internal/server/notifications/send-guard.js +2 -4
  28. package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
  29. package/dist/_internal/shared/actions/action-registry.js +128 -28
  30. package/dist/_internal/shared/checkout/order-math.d.ts +1 -1
  31. package/dist/_internal/shared/checkout/order-math.js +1 -1
  32. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +1 -1
  33. package/dist/_internal/shared/features/checkout/config.d.ts +0 -2
  34. package/dist/_internal/shared/features/checkout/config.js +0 -2
  35. package/dist/_internal/shared/features/messaging/config.d.ts +7 -5
  36. package/dist/_internal/shared/features/messaging/config.js +1 -4
  37. package/dist/_internal/shared/features/site-settings/fees.d.ts +0 -2
  38. package/dist/_internal/shared/features/site-settings/fees.js +0 -2
  39. package/dist/_internal/shared/features/site-settings/supplier-of-record.d.ts +56 -0
  40. package/dist/_internal/shared/features/site-settings/supplier-of-record.js +57 -0
  41. package/dist/_internal/shared/fees/calculator.d.ts +0 -8
  42. package/dist/_internal/shared/fees/calculator.js +0 -7
  43. package/dist/_internal/shared/listing-types/tiers.d.ts +94 -0
  44. package/dist/_internal/shared/listing-types/tiers.js +150 -0
  45. package/dist/cli/index.js +0 -2
  46. package/dist/client.d.ts +25 -4
  47. package/dist/client.js +36 -5
  48. package/dist/constants/api-endpoints.d.ts +21 -15
  49. package/dist/constants/api-endpoints.js +7 -8
  50. package/dist/constants/field-names.d.ts +1 -0
  51. package/dist/constants/field-names.js +1 -0
  52. package/dist/constants/notification-types.d.ts +1 -1
  53. package/dist/constants/notification-types.js +1 -1
  54. package/dist/core/integration-keys.d.ts +5 -5
  55. package/dist/core/integration-keys.js +21 -10
  56. package/dist/features/about/components/FeesView.js +0 -6
  57. package/dist/features/about/components/GuidesHubView.js +15 -2
  58. package/dist/features/account/components/NotificationPreferencesPanel.js +3 -4
  59. package/dist/features/account/components/UserOrdersView.js +26 -7
  60. package/dist/features/account/types/index.d.ts +0 -2
  61. package/dist/features/addresses/utils/postal-autofill.d.ts +39 -0
  62. package/dist/features/addresses/utils/postal-autofill.js +54 -0
  63. package/dist/features/admin/actions/notification-actions.d.ts +2 -8
  64. package/dist/features/admin/actions/notification-actions.js +9 -104
  65. package/dist/features/admin/components/AdminGuideHubView.js +1 -8
  66. package/dist/features/admin/components/AdminOrderEditorView.d.ts +1 -1
  67. package/dist/features/admin/components/AdminOrdersView.js +0 -2
  68. package/dist/features/admin/components/AdminSectionsView.js +3 -2
  69. package/dist/features/admin/components/AdminSiteSettingsView.js +22 -68
  70. package/dist/features/admin/components/AdminStoreEditorView.js +72 -34
  71. package/dist/features/admin/components/OwnerQuickActions.d.ts +29 -0
  72. package/dist/features/admin/components/OwnerQuickActions.js +142 -0
  73. package/dist/features/admin/components/sections/adminSectionsTypes.js +13 -4
  74. package/dist/features/admin/components/sections/icon-options.d.ts +21 -0
  75. package/dist/features/admin/components/sections/icon-options.js +23 -0
  76. package/dist/features/admin/components/sections/sectionTemplates.js +4 -1
  77. package/dist/features/admin/constants/site-settings-tabs.d.ts +7 -12
  78. package/dist/features/admin/constants/site-settings-tabs.js +6 -12
  79. package/dist/features/admin/repository/site-settings.repository.js +1 -1
  80. package/dist/features/admin/schemas/admin-editor-forms.d.ts +1 -1
  81. package/dist/features/admin/schemas/admin-editor-forms.js +4 -1
  82. package/dist/features/admin/schemas/admin-user-form.d.ts +0 -61
  83. package/dist/features/admin/schemas/admin-user-form.js +3 -44
  84. package/dist/features/admin/schemas/firestore.d.ts +28 -54
  85. package/dist/features/admin/schemas/firestore.js +40 -18
  86. package/dist/features/auctions/components/AuctionDetailPageView.js +4 -3
  87. package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +11 -1
  88. package/dist/features/auctions/components/MarketplaceAuctionCard.js +9 -2
  89. package/dist/features/auth/checkout-value-otp.d.ts +1 -1
  90. package/dist/features/auth/checkout-value-otp.js +1 -1
  91. package/dist/features/auth/permissions/constants.d.ts +29 -2
  92. package/dist/features/auth/permissions/constants.js +67 -1
  93. package/dist/features/blog/components/BlogFeaturedCard.d.ts +11 -1
  94. package/dist/features/blog/components/BlogFeaturedCard.js +9 -2
  95. package/dist/features/cart/components/CartDrawer.js +3 -2
  96. package/dist/features/cart/components/CartGroupLineRow.js +2 -1
  97. package/dist/features/cart/components/CartPriceBreakdown.d.ts +0 -2
  98. package/dist/features/cart/components/CartPriceBreakdown.js +1 -1
  99. package/dist/features/cart/components/StoreAddonsPicker.d.ts +2 -5
  100. package/dist/features/cart/components/StoreAddonsPicker.js +4 -5
  101. package/dist/features/cart/hooks/useAddToCart.js +10 -5
  102. package/dist/features/cart/repository/cart.repository.js +1 -2
  103. package/dist/features/cart/schemas/firestore.d.ts +1 -2
  104. package/dist/features/cart/utils/pending-ops.d.ts +11 -1
  105. package/dist/features/cart/utils/pending-ops.js +14 -2
  106. package/dist/features/categories/components/BrandDetailPageView.js +2 -1
  107. package/dist/features/categories/components/BundleDetailView.js +2 -1
  108. package/dist/features/categories/components/CategoryDetailPageView.js +2 -1
  109. package/dist/features/categories/components/CategoryGrid.d.ts +11 -1
  110. package/dist/features/categories/components/CategoryGrid.js +9 -2
  111. package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +10 -5
  112. package/dist/features/checkout/actions/checkout-value-otp-actions.js +2 -88
  113. package/dist/features/classified/components/ClassifiedDetailPageView.js +2 -1
  114. package/dist/features/digital-codes/components/DigitalCodeDetailPageView.js +2 -1
  115. package/dist/features/events/components/EventCard.d.ts +11 -1
  116. package/dist/features/events/components/EventCard.js +9 -2
  117. package/dist/features/grouped/components/GroupedListingDetailView.js +3 -1
  118. package/dist/features/homepage/components/CTABannerSection.d.ts +3 -1
  119. package/dist/features/homepage/components/CTABannerSection.js +6 -3
  120. package/dist/features/homepage/components/HeroCarousel.js +8 -6
  121. package/dist/features/homepage/components/MarketplaceHomepageView.js +33 -7
  122. package/dist/features/homepage/components/SectionCarousel.js +13 -5
  123. package/dist/features/homepage/components/SecurityHighlightsSection.d.ts +8 -3
  124. package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -2
  125. package/dist/features/homepage/components/StatsCounterSection.d.ts +9 -4
  126. package/dist/features/homepage/components/StatsCounterSection.js +2 -2
  127. package/dist/features/homepage/components/TestimonialsCarousel.js +1 -1
  128. package/dist/features/homepage/components/TrustFeaturesSection.d.ts +18 -4
  129. package/dist/features/homepage/components/TrustFeaturesSection.js +5 -5
  130. package/dist/features/homepage/components/WelcomeSection.d.ts +13 -2
  131. package/dist/features/homepage/components/WelcomeSection.js +3 -3
  132. package/dist/features/homepage/components/WhatsAppCommunitySection.d.ts +28 -0
  133. package/dist/features/homepage/components/WhatsAppCommunitySection.js +42 -6
  134. package/dist/features/homepage/components/WhatsAppGlyph.d.ts +20 -0
  135. package/dist/features/homepage/components/WhatsAppGlyph.js +20 -0
  136. package/dist/features/homepage/constants/hero-carousel-styles.d.ts +8 -6
  137. package/dist/features/homepage/constants/hero-carousel-styles.js +8 -6
  138. package/dist/features/homepage/constants/section-copy.d.ts +12 -10
  139. package/dist/features/homepage/constants/section-copy.js +28 -6
  140. package/dist/features/homepage/constants/stat-icons.d.ts +12 -0
  141. package/dist/features/homepage/constants/stat-icons.js +17 -0
  142. package/dist/features/homepage/constants/trust-icon-aliases.d.ts +8 -0
  143. package/dist/features/homepage/constants/trust-icon-aliases.js +75 -0
  144. package/dist/features/homepage/lib/section-defaults.d.ts +16 -1
  145. package/dist/features/homepage/lib/section-defaults.js +24 -4
  146. package/dist/features/homepage/lib/section-renderer.js +48 -8
  147. package/dist/features/homepage/schemas/firestore.d.ts +18 -1
  148. package/dist/features/layout/AppLayoutShell.js +2 -1
  149. package/dist/features/layout/BottomActions.d.ts +1 -0
  150. package/dist/features/layout/BottomActions.js +330 -0
  151. package/dist/features/layout/BottomChrome.d.ts +45 -0
  152. package/dist/features/layout/BottomChrome.js +5 -17
  153. package/dist/features/layout/SideActionDock.js +36 -13
  154. package/dist/features/layout/index.d.ts +2 -7
  155. package/dist/features/layout/index.js +7 -7
  156. package/dist/features/layout/useIsDesktop.d.ts +36 -0
  157. package/dist/features/layout/useIsDesktop.js +48 -0
  158. package/dist/features/live/components/LiveItemDetailPageView.js +2 -1
  159. package/dist/features/orders/actions/refund-actions.js +0 -1
  160. package/dist/features/orders/components/OrderAddonBadges.d.ts +1 -3
  161. package/dist/features/orders/components/OrderAddonBadges.js +3 -4
  162. package/dist/features/orders/components/OrderPaymentSummary.js +15 -2
  163. package/dist/features/orders/components/YourPurchaseStrip.d.ts +24 -0
  164. package/dist/features/orders/components/YourPurchaseStrip.js +77 -0
  165. package/dist/features/orders/components/index.d.ts +2 -1
  166. package/dist/features/orders/components/index.js +1 -1
  167. package/dist/features/orders/repository/orders.repository.d.ts +0 -8
  168. package/dist/features/orders/repository/orders.repository.js +0 -2
  169. package/dist/features/orders/schemas/firestore.d.ts +17 -9
  170. package/dist/features/orders/types/index.d.ts +2 -5
  171. package/dist/features/orders/utils/order-announcement-message.d.ts +18 -0
  172. package/dist/features/orders/utils/order-announcement-message.js +16 -0
  173. package/dist/features/orders/utils/payment-proof-message.d.ts +20 -0
  174. package/dist/features/orders/utils/payment-proof-message.js +17 -0
  175. package/dist/features/parts/components/PartDetailPageView.js +96 -1
  176. package/dist/features/parts/schemas/firestore.d.ts +247 -0
  177. package/dist/features/parts/schemas/firestore.js +6 -6
  178. package/dist/features/pre-orders/components/MarketplacePreorderCard.d.ts +11 -1
  179. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +10 -3
  180. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +4 -3
  181. package/dist/features/products/api/[id]/route.js +8 -1
  182. package/dist/features/products/api/route.js +16 -4
  183. package/dist/features/products/components/AvailabilityScopeHint.js +1 -1
  184. package/dist/features/products/components/InteractiveProductCard.d.ts +7 -1
  185. package/dist/features/products/components/InteractiveProductCard.js +16 -4
  186. package/dist/features/products/components/MarketplaceBundleCard.d.ts +11 -1
  187. package/dist/features/products/components/MarketplaceBundleCard.js +9 -2
  188. package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +11 -1
  189. package/dist/features/products/components/MarketplacePrizeDrawCard.js +9 -2
  190. package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -1
  191. package/dist/features/products/components/ProductDetailPageView.js +27 -2
  192. package/dist/features/products/components/ProductGrid.d.ts +14 -1
  193. package/dist/features/products/components/ProductGrid.js +22 -5
  194. package/dist/features/products/components/ProductsIndexListing.js +2 -2
  195. package/dist/features/reviews/api/[id]/route.js +83 -23
  196. package/dist/features/reviews/components/PurchaseReviewAffordance.d.ts +6 -0
  197. package/dist/features/reviews/components/PurchaseReviewAffordance.js +42 -0
  198. package/dist/features/reviews/components/ReviewFormDrawer.d.ts +34 -0
  199. package/dist/features/reviews/components/ReviewFormDrawer.js +127 -0
  200. package/dist/features/reviews/components/index.d.ts +4 -0
  201. package/dist/features/reviews/components/index.js +2 -0
  202. package/dist/features/scams/schemas/index.d.ts +10 -10
  203. package/dist/features/search/action-index/settings-entries.js +0 -9
  204. package/dist/features/seller/actions/seller-actions.d.ts +1 -1
  205. package/dist/features/seller/actions/seller-actions.js +49 -3
  206. package/dist/features/seller/components/SellerPayoutSettingsView.js +30 -2
  207. package/dist/features/seller/components/SellerProductShell.d.ts +17 -1
  208. package/dist/features/seller/hooks/useStoreListingEntitlements.d.ts +8 -0
  209. package/dist/features/seller/hooks/useStoreListingEntitlements.js +70 -0
  210. package/dist/features/store-extensions/repository/store-extensions.repositories.d.ts +1 -6
  211. package/dist/features/store-extensions/repository/store-extensions.repositories.js +1 -10
  212. package/dist/features/store-extensions/schemas/firestore.d.ts +1 -17
  213. package/dist/features/store-extensions/schemas/firestore.js +0 -10
  214. package/dist/features/stores/components/InteractiveStoreCard.d.ts +11 -1
  215. package/dist/features/stores/components/InteractiveStoreCard.js +9 -2
  216. package/dist/features/stores/components/StoreCapabilitiesGuideView.js +0 -1
  217. package/dist/features/stores/components/StoreGuideHubView.js +2 -8
  218. package/dist/features/stores/components/StoreSettingsGuideView.js +2 -6
  219. package/dist/features/stores/components/index.d.ts +0 -2
  220. package/dist/features/stores/components/index.js +0 -1
  221. package/dist/features/stores/repository/store.repository.d.ts +1 -26
  222. package/dist/features/stores/repository/store.repository.js +5 -60
  223. package/dist/features/stores/schemas/firestore.d.ts +6 -25
  224. package/dist/features/stores/schemas/firestore.js +6 -3
  225. package/dist/features/stores/schemas/index.d.ts +1 -87
  226. package/dist/features/stores/schemas/index.js +10 -15
  227. package/dist/features/tester/seed-data/authored/admin__site-system.js +0 -48
  228. package/dist/features/tester/seed-data/authored/buying__buying-checkout.js +0 -40
  229. package/dist/features/tester/seed-data/authored/selling__quick-add-minimum-details.js +0 -16
  230. package/dist/features/tester/seed-data/authored/selling__seller-guide.js +1 -1
  231. package/dist/features/tester/seed-data/authored/selling__seller-marketing-extras.js +0 -79
  232. package/dist/features/tester/seed-data/authored/selling__seller-orders.js +1 -1
  233. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +415 -69
  234. package/dist/index.d.ts +20 -32
  235. package/dist/index.js +34 -43
  236. package/dist/next/routing/route-map.d.ts +2 -8
  237. package/dist/next/routing/route-map.js +21 -4
  238. package/dist/providers/db-firebase/base.repository.d.ts +1 -1
  239. package/dist/providers/db-firebase/base.repository.js +1 -1
  240. package/dist/providers/payment-razorpay/index.d.ts +125 -0
  241. package/dist/providers/payment-razorpay/index.js +232 -0
  242. package/dist/providers/payment-razorpay/signature.d.ts +53 -0
  243. package/dist/providers/payment-razorpay/signature.js +71 -0
  244. package/dist/providers/shipping-shiprocket/index.d.ts +98 -0
  245. package/dist/providers/shipping-shiprocket/index.js +356 -0
  246. package/dist/providers.d.ts +3 -0
  247. package/dist/providers.js +3 -0
  248. package/dist/react/hooks/useCanSeePrices.d.ts +0 -27
  249. package/dist/react/hooks/useCanSeePrices.js +25 -0
  250. package/dist/repositories/index.d.ts +1 -1
  251. package/dist/repositories/index.js +1 -1
  252. package/dist/schemas/registry.d.ts +10 -115
  253. package/dist/schemas/registry.js +1 -2
  254. package/dist/security/pii-encrypt.js +1 -1
  255. package/dist/seed/_helpers/category-forest.js +27 -0
  256. package/dist/seed/_helpers/category-parts-glossary-map.js +1816 -88
  257. package/dist/seed/_helpers/category-parts.d.ts +1 -1
  258. package/dist/seed/_helpers/category-parts.js +13399 -3019
  259. package/dist/seed/carousel-slides-seed-data.js +47 -10
  260. package/dist/seed/categories-seed-data.js +48 -6
  261. package/dist/seed/faq-seed-data.js +2 -2
  262. package/dist/seed/homepage-sections-seed-data.js +286 -54
  263. package/dist/seed/index.d.ts +1 -1
  264. package/dist/seed/index.js +1 -1
  265. package/dist/seed/manifest.d.ts +1 -1
  266. package/dist/seed/manifest.js +1 -2
  267. package/dist/seed/model-composition-seed-data.js +6 -8
  268. package/dist/seed/part-glossary/chunk0.d.ts +9 -0
  269. package/dist/seed/part-glossary/chunk0.js +35448 -0
  270. package/dist/seed/part-glossary/chunk1.d.ts +9 -0
  271. package/dist/seed/part-glossary/chunk1.js +40494 -0
  272. package/dist/seed/part-glossary/chunk2.d.ts +9 -0
  273. package/dist/seed/part-glossary/chunk2.js +51242 -0
  274. package/dist/seed/part-glossary/chunk3.d.ts +9 -0
  275. package/dist/seed/part-glossary/chunk3.js +53337 -0
  276. package/dist/seed/part-glossary/chunk4.d.ts +9 -0
  277. package/dist/seed/part-glossary/chunk4.js +51454 -0
  278. package/dist/seed/part-glossary-seed-data.d.ts +1 -1
  279. package/dist/seed/part-glossary-seed-data.js +23 -47483
  280. package/dist/seed/products-catalogue-seed-data.d.ts +5 -5
  281. package/dist/seed/products-catalogue-seed-data.js +63936 -13803
  282. package/dist/seed/site-settings-seed-data.js +34 -35
  283. package/dist/seed/store-extensions-seed-data.d.ts +1 -2
  284. package/dist/seed/store-extensions-seed-data.js +1 -23
  285. package/dist/seed/stores-seed-data.js +0 -1
  286. package/dist/server-entry.d.ts +1 -1
  287. package/dist/server-entry.js +1 -1
  288. package/dist/server.d.ts +8 -10
  289. package/dist/server.js +16 -22
  290. package/dist/styles.css +392 -43
  291. package/dist/tailwind-utilities.css +1 -1
  292. package/dist/tokens/themes/default-dark.js +1 -1
  293. package/dist/tokens/themes/default-light.js +2 -1
  294. package/dist/tokens/tokens.css +6 -2
  295. package/dist/ui/components/Button.d.ts +11 -0
  296. package/dist/ui/components/Button.js +11 -0
  297. package/dist/ui/components/Button.style.css +29 -0
  298. package/dist/ui/components/CarouselNav.d.ts +57 -0
  299. package/dist/ui/components/CarouselNav.js +25 -0
  300. package/dist/ui/components/CarouselNav.style.css +265 -0
  301. package/dist/ui/components/GatedPrice.js +30 -3
  302. package/dist/ui/components/GatedPrice.style.css +43 -40
  303. package/dist/ui/components/HorizontalScroller.d.ts +12 -1
  304. package/dist/ui/components/HorizontalScroller.js +43 -3
  305. package/dist/ui/components/ImageMosaic.d.ts +8 -1
  306. package/dist/ui/components/ImageMosaic.js +3 -2
  307. package/dist/ui/components/ImageMosaic.style.css +22 -0
  308. package/dist/ui/components/Layout.style.css +6 -0
  309. package/dist/ui/components/Semantic.d.ts +3 -2
  310. package/dist/ui/components/Semantic.js +1 -0
  311. package/dist/ui/components/Typography.d.ts +2 -0
  312. package/dist/ui/components/Typography.js +2 -0
  313. package/dist/ui/components/Typography.style.css +19 -0
  314. package/dist/ui/components/index.style.css +1 -0
  315. package/dist/ui/index.d.ts +3 -1
  316. package/dist/ui/index.js +4 -0
  317. package/package.json +3 -2
  318. package/dist/_internal/server/jobs/core/whatsappCatalogImport.d.ts +0 -27
  319. package/dist/_internal/server/jobs/core/whatsappCatalogImport.js +0 -172
  320. package/dist/_internal/server/jobs/core/whatsappNotify.d.ts +0 -35
  321. package/dist/_internal/server/jobs/core/whatsappNotify.js +0 -140
  322. package/dist/features/admin/components/AdminWhatsAppGuideView.d.ts +0 -2
  323. package/dist/features/admin/components/AdminWhatsAppGuideView.js +0 -35
  324. package/dist/features/orders/components/MarketplaceOrderCard.d.ts +0 -36
  325. package/dist/features/orders/components/MarketplaceOrderCard.js +0 -57
  326. package/dist/features/stores/components/StoreWhatsAppGuideView.d.ts +0 -3
  327. package/dist/features/stores/components/StoreWhatsAppGuideView.js +0 -12
  328. package/dist/features/whatsapp-bot/api/send-status/route.d.ts +0 -12
  329. package/dist/features/whatsapp-bot/api/send-status/route.js +0 -38
  330. package/dist/features/whatsapp-bot/api/webhook/route.d.ts +0 -12
  331. package/dist/features/whatsapp-bot/api/webhook/route.js +0 -43
  332. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.d.ts +0 -6
  333. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +0 -270
  334. package/dist/features/whatsapp-bot/components/WhatsAppChatButton.d.ts +0 -9
  335. package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +0 -7
  336. package/dist/features/whatsapp-bot/components/index.d.ts +0 -3
  337. package/dist/features/whatsapp-bot/components/index.js +0 -2
  338. package/dist/features/whatsapp-bot/helpers/payment-proof-message.d.ts +0 -14
  339. package/dist/features/whatsapp-bot/helpers/payment-proof-message.js +0 -17
  340. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +0 -52
  341. package/dist/features/whatsapp-bot/helpers/whatsapp.js +0 -283
  342. package/dist/features/whatsapp-bot/index.d.ts +0 -3
  343. package/dist/features/whatsapp-bot/index.js +0 -3
  344. package/dist/features/whatsapp-bot/manifest.d.ts +0 -2
  345. package/dist/features/whatsapp-bot/manifest.js +0 -13
  346. package/dist/features/whatsapp-bot/messages/en.json +0 -7
  347. package/dist/features/whatsapp-bot/server.d.ts +0 -7
  348. package/dist/features/whatsapp-bot/server.js +0 -7
  349. package/dist/features/whatsapp-bot/types/index.d.ts +0 -126
  350. package/dist/features/whatsapp-bot/types/index.js +0 -1
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Which listing types a store may create: the basic/advanced split.
3
+ *
4
+ * ── The rule ──────────────────────────────────────────────────────────────
5
+ *
6
+ * `standard`, `spares` and `auction` are BASIC — every store can use them.
7
+ * The other seven are ADVANCED and need the `advanced_listing_types`
8
+ * capability, because each carries an obligation a new seller has not agreed
9
+ * to yet: a pre-order takes money for stock that does not exist, a prize draw
10
+ * is a regulated promotion, a classified happens off-platform with no escrow,
11
+ * a digital code must be delivered from a pool the seller has to keep stocked,
12
+ * and a live listing is an animal.
13
+ *
14
+ * ── Why a Record and not an array ─────────────────────────────────────────
15
+ *
16
+ * 🛑 `Record<ListingType, ListingTypeTier>`, so adding a member to the union
17
+ * is a COMPILE error here rather than a silent omission that defaults to
18
+ * whichever branch the code happens to fall through to.
19
+ * `features/products/types/index.ts` warns that adding a union member touches
20
+ * 21 named sites of which only 11 are compile-checked; this file is written to
21
+ * be one of the eleven. Root Cause #61.
22
+ *
23
+ * ── Why `capabilities` is `readonly string[]` and not `StoreCapability[]` ──
24
+ *
25
+ * Two reasons, and the first is the honest one: that is what is actually
26
+ * STORED. `storeFirestoreSchema` validates the field as `z.array(z.string())`,
27
+ * so a capability that is not a union member round-trips today and this helper
28
+ * must not pretend otherwise. The second is that it keeps this module free of
29
+ * an import from `features/auth/permissions/constants`, which is the kind of
30
+ * cross-feature edge `audit-import-cycles` exists to watch.
31
+ *
32
+ * A `StoreCapability[]` is assignable to it, so a typed caller loses nothing.
33
+ */
34
+ import { AuthorizationError } from "../../../errors/index.js";
35
+ import { ALL_LISTING_TYPES } from "./feature-flags.js";
36
+ /**
37
+ * The capability that unlocks every advanced type at once.
38
+ *
39
+ * One flag rather than seven, deliberately: the question a seller is actually
40
+ * answering is "do I want the complicated listing kinds", and seven checkboxes
41
+ * invite six of them to be wrong. An admin who needs finer control has the
42
+ * per-type legacy grants below.
43
+ */
44
+ export const ADVANCED_LISTING_TYPE_CAPABILITY = "advanced_listing_types";
45
+ export const LISTING_TYPE_TIER = {
46
+ standard: "basic",
47
+ spares: "basic",
48
+ auction: "basic",
49
+ "pre-order": "advanced",
50
+ "prize-draw": "advanced",
51
+ classified: "advanced",
52
+ "digital-code": "advanced",
53
+ live: "advanced",
54
+ art: "advanced",
55
+ stickers: "advanced",
56
+ };
57
+ /**
58
+ * Capabilities that grant ONE advanced type on their own, for stores that were
59
+ * granted it before `advanced_listing_types` existed.
60
+ *
61
+ * 🛑 Load-bearing, not politeness. `host_preorders` is a real capability some
62
+ * live stores already carry; dropping it would silently revoke pre-order
63
+ * access from a seller who had been using it, and a permission that disappears
64
+ * on deploy is indistinguishable from a bug.
65
+ *
66
+ * `host_auctions` deliberately has NO entry: `auction` is basic now, so the
67
+ * check is gone. The capability string stays declared in the union so existing
68
+ * store documents carrying it remain valid — it simply no longer gates
69
+ * anything.
70
+ */
71
+ const LEGACY_PER_TYPE_GRANT = {
72
+ "pre-order": "host_preorders",
73
+ };
74
+ export function isAdvancedListingType(listingType) {
75
+ return LISTING_TYPE_TIER[listingType] === "advanced";
76
+ }
77
+ /**
78
+ * Does this capability array carry the advanced-types grant?
79
+ *
80
+ * Exists so no call site has to spell the capability string, and so none has
81
+ * to cast: `capabilities` is `StoreCapability[]` in typed code and
82
+ * `string[]` as stored, and an `.includes()` across that boundary is where an
83
+ * `as never` gets reached for — which silences every other check on the
84
+ * expression, not just the one being worked around.
85
+ */
86
+ export function hasAdvancedListingTypes(capabilities) {
87
+ return (capabilities ?? []).includes(ADVANCED_LISTING_TYPE_CAPABILITY);
88
+ }
89
+ /** The types every store can use, with no capability at all. */
90
+ export const BASIC_LISTING_TYPES = ALL_LISTING_TYPES.filter((t) => LISTING_TYPE_TIER[t] === "basic");
91
+ export const ADVANCED_LISTING_TYPES = ALL_LISTING_TYPES.filter((t) => LISTING_TYPE_TIER[t] === "advanced");
92
+ /**
93
+ * May this store create or convert to this listing type?
94
+ *
95
+ * Pure — takes the capability array the caller already holds rather than
96
+ * re-reading the store. Every gate site in the codebase has the store document
97
+ * in scope already, and a helper that fetched would add one Firestore read per
98
+ * product write against Rule #6's round-trip budget.
99
+ */
100
+ export function isListingTypeAllowedFor(listingType, ctx = {}) {
101
+ if (ctx.isPrivileged)
102
+ return true;
103
+ if (!isAdvancedListingType(listingType))
104
+ return true;
105
+ const caps = ctx.capabilities ?? [];
106
+ if (caps.includes(ADVANCED_LISTING_TYPE_CAPABILITY))
107
+ return true;
108
+ const legacy = LEGACY_PER_TYPE_GRANT[listingType];
109
+ return legacy ? caps.includes(legacy) : false;
110
+ }
111
+ /** Every type this store may use, for building a picker or filtering nav. */
112
+ export function listingTypesAllowedFor(ctx = {}) {
113
+ return ALL_LISTING_TYPES.filter((t) => isListingTypeAllowedFor(t, ctx));
114
+ }
115
+ /**
116
+ * Throwing form, for the server-side write paths.
117
+ *
118
+ * 🛑 `listingType` being absent is ALLOWED and must stay that way. Both product
119
+ * schemas declare it optional, and a partial update that touches only `status`
120
+ * or `stockQuantity` carries no type at all — refusing those would break every
121
+ * stock decrement and status flip in the app. The gate's job is to refuse a
122
+ * NAMED advanced type, not to require one.
123
+ *
124
+ * 🛑 On an UPDATE, the caller must additionally compare against the STORED
125
+ * type and skip this when they match — see `sellerUpdateProduct`. Every
126
+ * per-type edit page re-sends its own type literal, so asserting on the
127
+ * submitted value alone locks a seller out of editing listings they already
128
+ * own as soon as the capability is withdrawn. The rule is about creating and
129
+ * converting, not about touching.
130
+ */
131
+ export function assertListingTypeAllowed(
132
+ /*
133
+ * `JsonValue | undefined`, not `unknown`. The callers hold
134
+ * `Record<string, JsonValue>` request bodies, so this is the widest type the
135
+ * value can genuinely have — and naming it keeps the narrowing below honest,
136
+ * where `unknown` would let any argument at all through the door and leave
137
+ * the type-level signal at the call site worth nothing
138
+ * (`audit-unknown-leakage`).
139
+ */
140
+ listingType, ctx = {}) {
141
+ if (typeof listingType !== "string")
142
+ return;
143
+ if (!(listingType in LISTING_TYPE_TIER))
144
+ return;
145
+ const typed = listingType;
146
+ if (isListingTypeAllowedFor(typed, ctx))
147
+ return;
148
+ throw new AuthorizationError(`Your store is not approved to create ${typed} listings. ` +
149
+ `Enable advanced listing types in your store settings first.`);
150
+ }
package/dist/cli/index.js CHANGED
@@ -60,7 +60,6 @@ export const FEATURE_SUBPATH_MAP = {
60
60
  loyalty: "@mohasinac/appkit/features/loyalty",
61
61
  collections: "@mohasinac/appkit/features/collections",
62
62
  preorders: "@mohasinac/appkit/features/pre-orders",
63
- "whatsapp-bot": "@mohasinac/appkit/features/whatsapp-bot",
64
63
  };
65
64
  /**
66
65
  * Wraps a Next.js config object. With appkit, only `@mohasinac/appkit` needs to
@@ -112,7 +111,6 @@ const FEATURE_NAMESPACE_MAP = {
112
111
  "before-after": "beforeAfter",
113
112
  loyalty: "loyalty",
114
113
  collections: "collections",
115
- "whatsapp-bot": "whatsappBot",
116
114
  };
117
115
  // Opaque dynamic import — prevents bundlers from statically analysing the path
118
116
  const _dynamicImport = new Function("modulePath", "return import(modulePath)");
package/dist/client.d.ts CHANGED
@@ -213,6 +213,14 @@ export type { ActionRowProps, ActionRowAlign } from "./ui/components/ActionRow";
213
213
  export { Textarea } from "./ui/components/Textarea";
214
214
  export { GlobalError } from "./next/components/GlobalError";
215
215
  export { AppLayoutShell, LocaleSwitcher, useDashboardNav, BottomActionsProvider, useBottomActions, DashboardNavProvider, LayoutClient } from "./features/layout/index";
216
+ /**
217
+ * A page declares its own inline primary CTA so the floating action control
218
+ * stays out of its way until that button has been seen and scrolled past. A
219
+ * page that publishes actions and no anchor gets the control immediately —
220
+ * which is right for a bulk-selection screen and wrong for anything with a
221
+ * visible Buy/Checkout button. See `useCtaReveal`.
222
+ */
223
+ export { ctaAnchorProps, CTA_ANCHOR_ATTR } from "./features/layout/index";
216
224
  export type { AppLayoutShellProps, AppLayoutShellSidebarLink, AppLayoutShellSidebarSection, DashboardNavState, MainNavbarItem, LayoutClientProps } from "./features/layout/index";
217
225
  export { ListingLayout } from "./ui/components/ListingLayout";
218
226
  export type { ListingLayoutProps, ListingLayoutLabels } from "./ui/components/ListingLayout";
@@ -240,6 +248,7 @@ export { SELLER_ENDPOINTS } from "./constants/index";
240
248
  * BidDetailPageClient — checklist-page-wiring-detail-pages-detail-page-matches-list-modal.
241
249
  */
242
250
  export { ACCOUNT_ENDPOINTS } from "./constants/index";
251
+ export { REVIEW_ENDPOINTS } from "./constants/index";
243
252
  export { TourProvider, useTour } from "./_internal/client/features/tour/TourProvider";
244
253
  export type { TourContextValue, TourRole } from "./_internal/client/features/tour/TourProvider";
245
254
  export { apiClient, ApiClientError } from "./http/index";
@@ -411,6 +420,8 @@ export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
411
420
  export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, isArtListing, isStickersListing, } from "./features/products/utils/listing-type";
412
421
  export { isFinalSale, acceptsChangeOfMindReturns, } from "./features/products/constants/final-sale";
413
422
  export { isListingTypeEnabled, isCategoryTypeEnabled, enabledListingTypes, enabledCategoryTypes, ALL_LISTING_TYPES, isListingType, } from "./_internal/shared/listing-types/feature-flags";
423
+ export { ADVANCED_LISTING_TYPE_CAPABILITY, ADVANCED_LISTING_TYPES, BASIC_LISTING_TYPES, LISTING_TYPE_TIER, hasAdvancedListingTypes, isAdvancedListingType, isListingTypeAllowedFor, listingTypesAllowedFor, } from "./_internal/shared/listing-types/tiers";
424
+ export type { ListingTypeAccessContext, ListingTypeTier, } from "./_internal/shared/listing-types/tiers";
414
425
  export { actionTracker, setActionTrackerSink, resetActionTrackerSink, type ActionEvent, type ActionTrackerSink, } from "./_internal/shared/listing-types/action-tracker";
415
426
  export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
416
427
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, type ActionDef, type ActionKind, type ActionResource, type ActionTree, type ActionConfirmation, } from "./_internal/shared/actions/action-registry";
@@ -422,6 +433,16 @@ export type { LayoutBreakpoint, DashboardVariant, LayoutRole, SidebarNavItem, Si
422
433
  export { LISTING_TYPE_CAPABILITIES, capabilityFor, canAddToCart, canBid, supportsShipping, requiresVendorVerified, requiresJurisdictionCheck, hasInstantFulfillment, assertNever, } from "./_internal/shared/listing-types/capabilities";
423
434
  export type { ListingTypeCapability } from "./_internal/shared/listing-types/capabilities";
424
435
  export { LISTING_TYPE_REGISTRY, pluginFor, detectListingTypeFromSlug } from "./_internal/shared/listing-types/_registry";
436
+ export { useStoreListingEntitlements } from "./features/seller/hooks/useStoreListingEntitlements";
437
+ export { OwnerQuickActions } from "./features/admin/components/OwnerQuickActions";
438
+ export { YourPurchaseStrip } from "./features/orders/components/YourPurchaseStrip";
439
+ export { ReviewFormDrawer, reviewFormSchema } from "./features/reviews/components/ReviewFormDrawer";
440
+ export type { ReviewFormDrawerProps, ReviewFormValues } from "./features/reviews/components/ReviewFormDrawer";
441
+ export { PurchaseReviewAffordance } from "./features/reviews/components/PurchaseReviewAffordance";
442
+ export type { PurchaseReviewAffordanceProps } from "./features/reviews/components/PurchaseReviewAffordance";
443
+ export type { YourPurchaseStripProps, PurchaseContext } from "./features/orders/components/YourPurchaseStrip";
444
+ export type { OwnerQuickActionsProps, OwnerQuickActionsResource } from "./features/admin/components/OwnerQuickActions";
445
+ export type { StoreListingEntitlements } from "./features/seller/hooks/useStoreListingEntitlements";
425
446
  export type { ListingTypePlugin } from "./_internal/shared/listing-types/_registry";
426
447
  export type { ListingType } from "./features/products/types/index";
427
448
  export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits";
@@ -468,8 +489,8 @@ export { SCHEMAS, lookupApiSchema, lookupFormSchema, lookupFirestoreSchema, } fr
468
489
  export type { ApiRouteKey, ApiRouteSchema, FirestoreDocument, FirestoreValue, FormFieldValue, FormValues, HttpVerb, JsonArray, JsonObject, JsonObjectWithUndefined, JsonPrimitive, JsonValue, JsonValueWithUndefined, RegisteredApiRouteKey, RegisteredFirestoreCollection, RegisteredFormId, RegisteredRtdbChannel, RegisteredSieveCollection, RegisteredStorageOp, RegisteredWebhookProvider, RegistryEntry, SchemaRegistry, SchemasShape, WebhookSchemaBucket, } from "./schemas/index";
469
490
  export { normalizeError, getErrorMessage, isApiNormalized, isAppNormalized, isFirebaseAuthNormalized, isFirebaseFirestoreNormalized, isFirebaseStorageNormalized, isNativeNormalized, isNetworkNormalized, isUnknownNormalized, isZodNormalized, } from "./errors/normalize";
470
491
  export type { NormalizedError, NormalizedApiError, NormalizedAppError, NormalizedFirebaseAuthError, NormalizedFirebaseFirestoreError, NormalizedFirebaseStorageError, NormalizedNativeError, NormalizedNetworkError, NormalizedUnknownThrownValue, NormalizedZodError, } from "./errors/normalize";
471
- export { buildPaymentProofReviewMessage } from "./features/whatsapp-bot/helpers/payment-proof-message";
472
- export type { PaymentProofReviewMessageInput } from "./features/whatsapp-bot/types";
492
+ export { buildPaymentProofReviewMessage } from "./features/orders/utils/payment-proof-message";
493
+ export type { PaymentProofReviewMessageInput } from "./features/orders/utils/payment-proof-message";
473
494
  export type { AdminNotificationDocument, ItemRequestDocument, ModerationQueueDocument, ReportDocument, CustomRoleDocument, AnalyticsCardDocument, ListingTemplateDocument, } from "./features/store-extensions/index";
474
495
  export { CommandPalette, useCommandPaletteHotkey } from "./features/shell/index";
475
496
  export type { CommandPaletteGroup } from "./features/shell/index";
@@ -499,7 +520,7 @@ export type { EmiSettings, BuyerEmiQuote } from "./_internal/shared/features/emi
499
520
  export type { BuyerFacingFees, BuyerEmiSettings, } from "./_internal/shared/features/site-settings/fees";
500
521
  export type { PublicSiteSettings } from "./_internal/shared/features/site-settings/types";
501
522
  export { computeCodHandlingFee } from "./_internal/shared/fees/calculator";
502
- export type { CodHandlingFeeRates, WhatsAppNotifyFeeRates, GiftWrapFeeRates, ShipmentProtectionFeeRates, } from "./_internal/shared/fees/calculator";
523
+ export type { CodHandlingFeeRates, GiftWrapFeeRates, ShipmentProtectionFeeRates, } from "./_internal/shared/fees/calculator";
503
524
  export { FAQPageContent } from "./features/faq/index";
504
525
  export type { FAQCategory, FAQCategoryItem, FAQSortOption } from "./features/faq/index";
505
526
  export { CategoryInlineSelect } from "./features/seller/components/CategoryInlineSelect";
@@ -522,7 +543,7 @@ export { sublistingCategoryFormSchema } from "./features/store-extensions/schema
522
543
  export { adminStoreUpdateSchema, announcementBarSchema, } from "./features/admin/schemas/admin-editor-forms";
523
544
  export { adminOrderUpdateSchema, employeeInviteSchema, hardBanReasonSchema, featureFlagsUpdateSchema, adminAdFormSchema, } from "./features/admin/schemas/admin-ops-forms";
524
545
  export { changeEmailSchema } from "./features/account/schemas/index";
525
- export { adminUserUpdateSchema, whatsappSettingsSchema, lotteryPullSchema, } from "./features/admin/schemas/admin-user-form";
546
+ export { adminUserUpdateSchema, lotteryPullSchema, } from "./features/admin/schemas/admin-user-form";
526
547
  export { siteSettingsFormSchema } from "./features/admin/schemas/site-settings-form";
527
548
  export { refineAddressPostal, addressFormSchema, addressUpdateSchema, adminAddressCreateSchema, adminAddressUpdateSchema, addressUnbanRequestSchema, } from "./features/addresses/schemas/address-form";
528
549
  export type { AddressFormValues, AddressUpdateValues, AdminAddressCreateValues, } from "./features/addresses/schemas/address-form";
package/dist/client.js CHANGED
@@ -263,6 +263,14 @@ export { ActionRow } from "./ui/components/ActionRow.js";
263
263
  export { Textarea } from "./ui/components/Textarea.js";
264
264
  export { GlobalError } from "./next/components/GlobalError.js";
265
265
  export { AppLayoutShell, LocaleSwitcher, useDashboardNav, BottomActionsProvider, useBottomActions, DashboardNavProvider, LayoutClient } from "./features/layout/index.js";
266
+ /**
267
+ * A page declares its own inline primary CTA so the floating action control
268
+ * stays out of its way until that button has been seen and scrolled past. A
269
+ * page that publishes actions and no anchor gets the control immediately —
270
+ * which is right for a bulk-selection screen and wrong for anything with a
271
+ * visible Buy/Checkout button. See `useCtaReveal`.
272
+ */
273
+ export { ctaAnchorProps, CTA_ANCHOR_ATTR } from "./features/layout/index.js";
266
274
  export { ListingLayout } from "./ui/components/ListingLayout.js";
267
275
  export { Search } from "./features/search/components/index.js";
268
276
  export { ToastProvider, SkipToMain, NavigationLoader } from "./ui/index.js";
@@ -290,6 +298,7 @@ export { SELLER_ENDPOINTS } from "./constants/index.js";
290
298
  * BidDetailPageClient — checklist-page-wiring-detail-pages-detail-page-matches-list-modal.
291
299
  */
292
300
  export { ACCOUNT_ENDPOINTS } from "./constants/index.js";
301
+ export { REVIEW_ENDPOINTS } from "./constants/index.js";
293
302
  // P-16 — Tour system (driver.js-backed onboarding walkthrough).
294
303
  export { TourProvider, useTour } from "./_internal/client/features/tour/TourProvider.js";
295
304
  export { apiClient, ApiClientError } from "./http/index.js";
@@ -424,6 +433,10 @@ export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardLi
424
433
  export { isFinalSale, acceptsChangeOfMindReturns, } from "./features/products/constants/final-sale.js";
425
434
  // SB-UNI-X4 2026-05-13 — per-type feature-flag helpers (client-safe).
426
435
  export { isListingTypeEnabled, isCategoryTypeEnabled, enabledListingTypes, enabledCategoryTypes, ALL_LISTING_TYPES, isListingType, } from "./_internal/shared/listing-types/feature-flags.js";
436
+ // Basic/advanced listing-type split. Client-safe: the nav filter and any
437
+ // seller-facing picker need the same rule the server enforces, and deriving it
438
+ // twice is how the ten hand-written copies of the union happened.
439
+ export { ADVANCED_LISTING_TYPE_CAPABILITY, ADVANCED_LISTING_TYPES, BASIC_LISTING_TYPES, LISTING_TYPE_TIER, hasAdvancedListingTypes, isAdvancedListingType, isListingTypeAllowedFor, listingTypesAllowedFor, } from "./_internal/shared/listing-types/tiers.js";
427
440
  // SB-UNI-X5 2026-05-13 — action telemetry sink (client-safe; defaults to
428
441
  // a no-op + console.debug in dev).
429
442
  export { actionTracker, setActionTrackerSink, resetActionTrackerSink, } from "./_internal/shared/listing-types/action-tracker.js";
@@ -440,6 +453,16 @@ export { DashboardLayoutClient, RoleGuard } from "./_internal/client/features/la
440
453
  // Listing-type capability registry — SB-UNI X1.
441
454
  export { LISTING_TYPE_CAPABILITIES, capabilityFor, canAddToCart, canBid, supportsShipping, requiresVendorVerified, requiresJurisdictionCheck, hasInstantFulfillment, assertNever, } from "./_internal/shared/listing-types/capabilities.js";
442
455
  export { LISTING_TYPE_REGISTRY, pluginFor, detectListingTypeFromSlug } from "./_internal/shared/listing-types/_registry.js";
456
+ // Which listing types the signed-in seller's own store may create. Needs a
457
+ // fetch because `capabilities` is a PRIVATE store field — see the hook.
458
+ export { useStoreListingEntitlements } from "./features/seller/hooks/useStoreListingEntitlements.js";
459
+ // Pencil / clone / bin for whoever owns the record, on a PUBLIC surface.
460
+ export { OwnerQuickActions } from "./features/admin/components/OwnerQuickActions.js";
461
+ // "You ordered this - track it" / "your review - edit it", on a product page.
462
+ export { YourPurchaseStrip } from "./features/orders/components/YourPurchaseStrip.js";
463
+ // The first review form this app has had - see the component's header.
464
+ export { ReviewFormDrawer, reviewFormSchema } from "./features/reviews/components/ReviewFormDrawer.js";
465
+ export { PurchaseReviewAffordance } from "./features/reviews/components/PurchaseReviewAffordance.js";
443
466
  // Media upload limits — shared by client uploaders + server sign/finalize routes.
444
467
  export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits.js";
445
468
  export { ScamAwarenessModal } from "./features/scams/components/ScamAwarenessModal.js";
@@ -476,10 +499,18 @@ export { SellerLiveView } from "./features/seller/components/SellerLiveView.js";
476
499
  export { SCHEMAS, lookupApiSchema, lookupFormSchema, lookupFirestoreSchema, } from "./schemas/index.js";
477
500
  // ── W3 catch-clause normalizer ──────────────────────────────────────────────
478
501
  export { normalizeError, getErrorMessage, isApiNormalized, isAppNormalized, isFirebaseAuthNormalized, isFirebaseFirestoreNormalized, isFirebaseStorageNormalized, isNativeNormalized, isNetworkNormalized, isUnknownNormalized, isZodNormalized, } from "./errors/normalize.js";
479
- // [CLIENT-SAFE] Pure wa.me share-link message builder — imported directly
480
- // from its isolated file (not ./whatsapp-bot/server) so this barrel's graph
481
- // never touches the sibling crypto-importing helpers.
482
- export { buildPaymentProofReviewMessage } from "./features/whatsapp-bot/helpers/payment-proof-message.js";
502
+ /*
503
+ * [CLIENT-SAFE] Pure wa.me share-link message builder — no crypto, no network.
504
+ *
505
+ * It used to live beside the WhatsApp Cloud API senders, isolated into its own
506
+ * file precisely so this barrel's import graph never reached their top-level
507
+ * `crypto` import (Root Cause #24). The Cloud API integration was removed
508
+ * 2026-10-20 and this moved to `features/orders/utils/`, which is its real
509
+ * domain: it builds the body of the buyer's "Share for review" link on the
510
+ * order payment page, and a wa.me deep link needs no token or registered
511
+ * number.
512
+ */
513
+ export { buildPaymentProofReviewMessage } from "./features/orders/utils/payment-proof-message.js";
483
514
  export { CommandPalette, useCommandPaletteHotkey } from "./features/shell/index.js";
484
515
  export { AdminBlogEditorView, AdminBundleEditorView, AdminCarouselEditorView, AdminCategoryEditorView, AdminCouponEditorView, AdminFaqEditorView, AdminFeatureEditorView, AdminOrderEditorView, AdminPayoutMarkPaidModal, AdminAuditLogView, ViewAuditLogEntryModal, AdminProductEditorView, AdminScammerEditorView,
485
516
  // Client-exported for the W22 /admin/team/{new,[id]/edit} pages. It was
@@ -531,7 +562,7 @@ export { sublistingCategoryFormSchema } from "./features/store-extensions/schema
531
562
  export { adminStoreUpdateSchema, announcementBarSchema, } from "./features/admin/schemas/admin-editor-forms.js";
532
563
  export { adminOrderUpdateSchema, employeeInviteSchema, hardBanReasonSchema, featureFlagsUpdateSchema, adminAdFormSchema, } from "./features/admin/schemas/admin-ops-forms.js";
533
564
  export { changeEmailSchema } from "./features/account/schemas/index.js";
534
- export { adminUserUpdateSchema, whatsappSettingsSchema, lotteryPullSchema, } from "./features/admin/schemas/admin-user-form.js";
565
+ export { adminUserUpdateSchema, lotteryPullSchema, } from "./features/admin/schemas/admin-user-form.js";
535
566
  export { siteSettingsFormSchema } from "./features/admin/schemas/site-settings-form.js";
536
567
  // The ONE address shape and the ONE postal rule (W5 / D19). Eleven field
537
568
  // shapes and fifteen disagreeing postal rules collapsed to these.
@@ -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";
@@ -452,6 +457,8 @@ export declare const PROMOTION_ENDPOINTS: {
452
457
  export declare const REVIEW_ENDPOINTS: {
453
458
  readonly LIST: "/api/reviews";
454
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;
455
462
  };
456
463
  export declare const SEARCH_ENDPOINTS: {
457
464
  readonly SUGGESTIONS: "/api/search/suggestions";
@@ -562,11 +569,6 @@ export declare const SCAMMER_ENDPOINTS: {
562
569
  export declare const BEFORE_AFTER_ENDPOINTS: {
563
570
  readonly LIST: "/api/before-after";
564
571
  };
565
- export declare const WHATSAPP_SELLER_ENDPOINTS: {
566
- readonly SETTINGS: "/api/store/whatsapp-settings";
567
- readonly CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync";
568
- readonly CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import";
569
- };
570
572
  export declare const API_ENDPOINTS: {
571
573
  readonly CONFIG: {};
572
574
  readonly LOGS: {
@@ -619,6 +621,11 @@ export declare const API_ENDPOINTS: {
619
621
  readonly HISTORY_ITEM: (productId: string) => string;
620
622
  readonly HISTORY_MERGE: "/api/user/history/merge";
621
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;
622
629
  readonly BIDS: "/api/user/bids";
623
630
  readonly BID_BY_ID: (id: string) => string;
624
631
  readonly EXPORT: "/api/user/export";
@@ -958,6 +965,8 @@ export declare const API_ENDPOINTS: {
958
965
  readonly REVIEWS: {
959
966
  readonly LIST: "/api/reviews";
960
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;
961
970
  };
962
971
  readonly SEARCH: {
963
972
  readonly SUGGESTIONS: "/api/search/suggestions";
@@ -1055,11 +1064,6 @@ export declare const API_ENDPOINTS: {
1055
1064
  readonly PRODUCTS: (sellerId: string) => string;
1056
1065
  readonly REVIEWS: (userId: string) => string;
1057
1066
  };
1058
- readonly WHATSAPP_SELLER: {
1059
- readonly SETTINGS: "/api/store/whatsapp-settings";
1060
- readonly CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync";
1061
- readonly CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import";
1062
- };
1063
1067
  readonly SUPPORT: {
1064
1068
  readonly TICKETS: "/api/support/tickets";
1065
1069
  readonly TICKET_BY_ID: (id: string) => string;
@@ -1146,6 +1150,11 @@ export declare const API_ROUTES: {
1146
1150
  readonly HISTORY_ITEM: (productId: string) => string;
1147
1151
  readonly HISTORY_MERGE: "/api/user/history/merge";
1148
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;
1149
1158
  readonly BIDS: "/api/user/bids";
1150
1159
  readonly BID_BY_ID: (id: string) => string;
1151
1160
  readonly EXPORT: "/api/user/export";
@@ -1485,6 +1494,8 @@ export declare const API_ROUTES: {
1485
1494
  readonly REVIEWS: {
1486
1495
  readonly LIST: "/api/reviews";
1487
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;
1488
1499
  };
1489
1500
  readonly SEARCH: {
1490
1501
  readonly SUGGESTIONS: "/api/search/suggestions";
@@ -1582,11 +1593,6 @@ export declare const API_ROUTES: {
1582
1593
  readonly PRODUCTS: (sellerId: string) => string;
1583
1594
  readonly REVIEWS: (userId: string) => string;
1584
1595
  };
1585
- readonly WHATSAPP_SELLER: {
1586
- readonly SETTINGS: "/api/store/whatsapp-settings";
1587
- readonly CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync";
1588
- readonly CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import";
1589
- };
1590
1596
  readonly SUPPORT: {
1591
1597
  readonly TICKETS: "/api/support/tickets";
1592
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",
@@ -592,6 +597,8 @@ export const PROMOTION_ENDPOINTS = {
592
597
  export const REVIEW_ENDPOINTS = {
593
598
  LIST: "/api/reviews",
594
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)}`,
595
602
  };
596
603
  // ---------------------------------------------------------------------------
597
604
  // Search
@@ -739,13 +746,6 @@ export const BEFORE_AFTER_ENDPOINTS = {
739
746
  LIST: "/api/before-after",
740
747
  };
741
748
  // ---------------------------------------------------------------------------
742
- // WhatsApp Business (store-level settings + catalog sync)
743
- // ---------------------------------------------------------------------------
744
- export const WHATSAPP_SELLER_ENDPOINTS = {
745
- SETTINGS: "/api/store/whatsapp-settings",
746
- CATALOG_SYNC: "/api/store/whatsapp-settings/catalog-sync",
747
- CATALOG_IMPORT: "/api/store/whatsapp-settings/catalog-import",
748
- };
749
749
  // ---------------------------------------------------------------------------
750
750
  // Aggregate namespace export
751
751
  // ---------------------------------------------------------------------------
@@ -791,7 +791,6 @@ export const API_ENDPOINTS = {
791
791
  SUBLISTING_CATEGORIES: SUBLISTING_CATEGORY_ENDPOINTS,
792
792
  WISHLIST: WISHLIST_ENDPOINTS,
793
793
  PROFILE_STATS: PROFILE_STATS_ENDPOINTS,
794
- WHATSAPP_SELLER: WHATSAPP_SELLER_ENDPOINTS,
795
794
  SUPPORT: SUPPORT_ENDPOINTS,
796
795
  SCAMMERS: SCAMMER_ENDPOINTS,
797
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
  ];