@mohasinac/appkit 3.8.2 → 3.9.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 (479) hide show
  1. package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
  2. package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +4 -4
  3. package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +8 -8
  4. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +1 -1
  5. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +2 -2
  6. package/dist/_internal/server/features/bundles/actions.js +2 -2
  7. package/dist/_internal/server/features/bundles/og.d.ts +1 -1
  8. package/dist/_internal/server/features/bundles/og.js +4 -5
  9. package/dist/_internal/server/features/checkout/actions.js +57 -21
  10. package/dist/_internal/server/features/checkout/stock-restore.d.ts +19 -0
  11. package/dist/_internal/server/features/checkout/stock-restore.js +80 -0
  12. package/dist/_internal/server/features/checkout/upi-resolution.d.ts +11 -0
  13. package/dist/_internal/server/features/checkout/upi-resolution.js +28 -0
  14. package/dist/_internal/server/features/classified/og.js +1 -1
  15. package/dist/_internal/server/features/digital-code/og.js +1 -1
  16. package/dist/_internal/server/features/item-requests/og.d.ts +2 -2
  17. package/dist/_internal/server/features/item-requests/og.js +4 -5
  18. package/dist/_internal/server/features/live/og.js +1 -1
  19. package/dist/_internal/server/features/lottery/adapters.d.ts +2 -2
  20. package/dist/_internal/server/features/lottery/adapters.js +1 -1
  21. package/dist/_internal/server/features/orders/actions.d.ts +28 -0
  22. package/dist/_internal/server/features/orders/actions.js +239 -4
  23. package/dist/_internal/server/features/orders/adapters.js +3 -0
  24. package/dist/_internal/server/features/payments/data.js +3 -2
  25. package/dist/_internal/server/features/payouts/actions.d.ts +2 -2
  26. package/dist/_internal/server/features/payouts/actions.js +4 -3
  27. package/dist/_internal/server/features/pre-orders/service.d.ts +1 -1
  28. package/dist/_internal/server/features/pre-orders/service.js +3 -2
  29. package/dist/_internal/server/features/prize-draws/og.js +5 -5
  30. package/dist/_internal/server/features/products/og.js +1 -1
  31. package/dist/_internal/server/features/promotions/service.js +3 -1
  32. package/dist/_internal/server/features/refunds/actions.d.ts +2 -2
  33. package/dist/_internal/server/features/refunds/actions.js +7 -6
  34. package/dist/_internal/server/functions/firestore.js +1 -1
  35. package/dist/_internal/server/functions/scheduled.d.ts +4 -1
  36. package/dist/_internal/server/functions/scheduled.js +26 -2
  37. package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +1 -1
  38. package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +4 -0
  39. package/dist/_internal/server/jobs/core/hardBanCascade.js +15 -4
  40. package/dist/_internal/server/jobs/core/hardBanReinstatement.d.ts +16 -0
  41. package/dist/_internal/server/jobs/core/hardBanReinstatement.js +63 -0
  42. package/dist/_internal/server/jobs/core/jobRunners.js +3 -1
  43. package/dist/_internal/server/jobs/core/onScamReportCreate.js +1 -1
  44. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.d.ts +10 -0
  45. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +60 -0
  46. package/dist/_internal/server/jobs/core/paymentWindowTimeout.d.ts +15 -0
  47. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +59 -0
  48. package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +7 -0
  49. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +32 -6
  50. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.d.ts +2 -0
  51. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.js +2 -0
  52. package/dist/_internal/server/jobs/handlers/index.d.ts +3 -0
  53. package/dist/_internal/server/jobs/handlers/index.js +3 -0
  54. package/dist/_internal/server/jobs/handlers/messages.d.ts +4 -0
  55. package/dist/_internal/server/jobs/handlers/messages.js +4 -0
  56. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +3 -3
  57. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +12 -12
  58. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +1 -1
  59. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +5 -5
  60. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.d.ts +2 -0
  61. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.js +2 -0
  62. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.d.ts +2 -0
  63. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.js +2 -0
  64. package/dist/_internal/shared/actions/action-registry.js +27 -0
  65. package/dist/_internal/shared/checkout/order-math.js +3 -2
  66. package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
  67. package/dist/_internal/shared/checkout/rules/preorder.rule.js +7 -0
  68. package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +7 -0
  69. package/dist/_internal/shared/checkout/rules/types.d.ts +11 -0
  70. package/dist/_internal/shared/features/auctions/errors.js +1 -1
  71. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +0 -1
  72. package/dist/_internal/shared/features/categories/bundle-copy.js +0 -1
  73. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +6 -6
  74. package/dist/_internal/shared/features/categories/bundle-schemas.js +2 -2
  75. package/dist/_internal/shared/features/checkout/config.d.ts +3 -3
  76. package/dist/_internal/shared/features/checkout/config.js +3 -3
  77. package/dist/_internal/shared/features/emi/schedule.d.ts +6 -6
  78. package/dist/_internal/shared/features/emi/schedule.js +10 -9
  79. package/dist/_internal/shared/features/promotions/errors.js +1 -1
  80. package/dist/_internal/shared/fees/calculator.d.ts +5 -5
  81. package/dist/_internal/shared/fees/calculator.js +19 -19
  82. package/dist/client.d.ts +1 -1
  83. package/dist/client.js +1 -1
  84. package/dist/constants/api-endpoints.d.ts +9 -0
  85. package/dist/constants/api-endpoints.js +3 -0
  86. package/dist/constants/field-names.d.ts +4 -0
  87. package/dist/constants/field-names.js +4 -0
  88. package/dist/features/admin/components/AdminArtView.js +2 -2
  89. package/dist/features/admin/components/AdminBidsView.js +2 -2
  90. package/dist/features/admin/components/AdminBundleEditorView.d.ts +1 -1
  91. package/dist/features/admin/components/AdminBundleEditorView.js +8 -8
  92. package/dist/features/admin/components/AdminBundlesView.js +6 -6
  93. package/dist/features/admin/components/AdminClassifiedView.js +2 -2
  94. package/dist/features/admin/components/AdminDigitalCodesView.js +2 -2
  95. package/dist/features/admin/components/AdminLiveView.js +2 -2
  96. package/dist/features/admin/components/AdminOrderEditorView.d.ts +6 -1
  97. package/dist/features/admin/components/AdminOrderEditorView.js +45 -5
  98. package/dist/features/admin/components/AdminOrdersView.js +8 -3
  99. package/dist/features/admin/components/AdminPayoutsView.js +2 -2
  100. package/dist/features/admin/components/AdminPrizeDrawsView.js +2 -2
  101. package/dist/features/admin/components/AdminReturnRequestsView.js +2 -2
  102. package/dist/features/admin/components/AdminSiteSettingsView.js +11 -11
  103. package/dist/features/admin/components/AdminStickersView.js +2 -2
  104. package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
  105. package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -1
  106. package/dist/features/admin/hooks/useAdminListingData.js +3 -2
  107. package/dist/features/admin/schemas/firestore.d.ts +9 -7
  108. package/dist/features/admin/schemas/firestore.js +4 -3
  109. package/dist/features/auctions/components/AuctionBidsTable.js +3 -3
  110. package/dist/features/auth/checkout-value-otp.d.ts +46 -0
  111. package/dist/features/auth/checkout-value-otp.js +73 -0
  112. package/dist/features/auth/repository/user.repository.d.ts +6 -0
  113. package/dist/features/auth/repository/user.repository.js +19 -0
  114. package/dist/features/auth/schemas/firestore.d.ts +10 -0
  115. package/dist/features/auth/schemas/firestore.js +2 -0
  116. package/dist/features/cart/actions/cart-actions.d.ts +1 -1
  117. package/dist/features/cart/actions/cart-actions.js +4 -4
  118. package/dist/features/cart/components/CartView.d.ts +2 -2
  119. package/dist/features/cart/components/ShippingPicker.d.ts +4 -4
  120. package/dist/features/cart/components/ShippingPicker.js +11 -11
  121. package/dist/features/cart/repository/cart.repository.d.ts +1 -1
  122. package/dist/features/cart/repository/cart.repository.js +2 -2
  123. package/dist/features/cart/schemas/firestore.d.ts +2 -2
  124. package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
  125. package/dist/features/catalogue/components/PublicCatalogueView.js +2 -2
  126. package/dist/features/catalogue/schemas/validation.js +1 -1
  127. package/dist/features/categories/components/BundleCollage.js +2 -2
  128. package/dist/features/categories/components/BundleDetailView.js +2 -2
  129. package/dist/features/categories/components/BundleItemsPicker.d.ts +1 -1
  130. package/dist/features/categories/components/BundleItemsPicker.js +2 -2
  131. package/dist/features/categories/components/CategoryBundlesListing.js +2 -2
  132. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  133. package/dist/features/categories/schemas/index.d.ts +3 -3
  134. package/dist/features/categories/schemas/index.js +2 -2
  135. package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +16 -0
  136. package/dist/features/checkout/actions/checkout-value-otp-actions.js +83 -0
  137. package/dist/features/checkout/actions/index.d.ts +1 -0
  138. package/dist/features/checkout/actions/index.js +1 -0
  139. package/dist/features/checkout/schemas/firestore.d.ts +1 -1
  140. package/dist/features/classified/components/index.d.ts +0 -4
  141. package/dist/features/classified/components/index.js +0 -2
  142. package/dist/features/digital-codes/components/index.d.ts +0 -4
  143. package/dist/features/digital-codes/components/index.js +0 -2
  144. package/dist/features/events/schemas/index.d.ts +1 -1
  145. package/dist/features/events/schemas/index.js +1 -1
  146. package/dist/features/homepage/components/FeaturedBundlesSection.js +2 -2
  147. package/dist/features/live/components/index.d.ts +0 -4
  148. package/dist/features/live/components/index.js +0 -2
  149. package/dist/features/lottery/types/index.d.ts +3 -3
  150. package/dist/features/lottery/types/index.js +5 -5
  151. package/dist/features/orders/components/OrderPaymentSummary.js +2 -2
  152. package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
  153. package/dist/features/orders/components/RefundHistoryTable.js +1 -1
  154. package/dist/features/orders/components/RefundRequestView.js +1 -1
  155. package/dist/features/orders/constants/payment-window.d.ts +10 -0
  156. package/dist/features/orders/constants/payment-window.js +10 -0
  157. package/dist/features/orders/repository/orders.repository.d.ts +25 -0
  158. package/dist/features/orders/repository/orders.repository.js +50 -1
  159. package/dist/features/orders/schemas/firestore.d.ts +50 -2
  160. package/dist/features/orders/schemas/index.d.ts +24 -24
  161. package/dist/features/orders/schemas/index.js +20 -20
  162. package/dist/features/orders/types/index.d.ts +4 -0
  163. package/dist/features/orders/utils/bundle-grouping.d.ts +1 -1
  164. package/dist/features/orders/utils/bundle-grouping.js +1 -1
  165. package/dist/features/payments/schemas/index.d.ts +10 -10
  166. package/dist/features/payments/schemas/index.js +9 -9
  167. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -2
  168. package/dist/features/products/components/ArtStickersListView.d.ts +7 -0
  169. package/dist/features/products/components/ArtStickersListView.js +57 -0
  170. package/dist/features/products/components/GroupSettingsPanel.js +1 -1
  171. package/dist/features/products/components/MakeOfferButton.js +3 -3
  172. package/dist/features/products/components/MarketplaceBundleCard.d.ts +1 -1
  173. package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
  174. package/dist/features/products/components/PrizeDrawCollage.js +2 -2
  175. package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
  176. package/dist/features/products/components/PrizeRevealModal.js +1 -1
  177. package/dist/features/products/components/ProductDetailPageView.js +2 -9
  178. package/dist/features/products/components/ProductForm.js +2 -2
  179. package/dist/features/products/components/ProductGrid.js +2 -2
  180. package/dist/features/products/components/ProductsIndexListing.d.ts +13 -1
  181. package/dist/features/products/components/ProductsIndexListing.js +7 -5
  182. package/dist/features/products/components/ProductsIndexPageView.js +6 -1
  183. package/dist/features/products/constants/listing-tabs.d.ts +42 -17
  184. package/dist/features/products/constants/listing-tabs.js +25 -6
  185. package/dist/features/products/schemas/catalog-product.d.ts +5 -5
  186. package/dist/features/products/schemas/catalog-product.js +1 -1
  187. package/dist/features/products/schemas/firestore.d.ts +5 -5
  188. package/dist/features/products/schemas/firestore.js +2 -2
  189. package/dist/features/products/types/index.d.ts +5 -2
  190. package/dist/features/promotions/components/CouponCard.js +2 -2
  191. package/dist/features/promotions/schemas/firestore.d.ts +2 -0
  192. package/dist/features/promotions/schemas/firestore.js +1 -0
  193. package/dist/features/promotions/schemas/index.d.ts +14 -14
  194. package/dist/features/promotions/schemas/index.js +6 -6
  195. package/dist/features/scams/components/ScamProfileView.js +3 -7
  196. package/dist/features/scams/components/ScamRegistryView.js +2 -6
  197. package/dist/features/scams/schemas/firestore.d.ts +1 -1
  198. package/dist/features/search/components/Search.d.ts +1 -1
  199. package/dist/features/seller/actions/offer-actions.js +1 -1
  200. package/dist/features/seller/components/PrintCenterView.js +2 -2
  201. package/dist/features/seller/components/QuickProductForm.js +5 -5
  202. package/dist/features/seller/components/SellerArtView.js +2 -2
  203. package/dist/features/seller/components/SellerAuctionsView.js +2 -2
  204. package/dist/features/seller/components/SellerBidsView.js +2 -2
  205. package/dist/features/seller/components/SellerBundlesView.js +6 -6
  206. package/dist/features/seller/components/SellerClassifiedView.js +2 -2
  207. package/dist/features/seller/components/SellerDigitalCodesView.js +2 -2
  208. package/dist/features/seller/components/SellerLiveView.js +2 -2
  209. package/dist/features/seller/components/SellerOffersView.js +2 -2
  210. package/dist/features/seller/components/SellerOrdersView.js +3 -3
  211. package/dist/features/seller/components/SellerPayoutRequestView.js +2 -2
  212. package/dist/features/seller/components/SellerPayoutSettingsView.js +2 -2
  213. package/dist/features/seller/components/SellerPayoutsView.js +2 -2
  214. package/dist/features/seller/components/SellerPreOrdersView.js +2 -2
  215. package/dist/features/seller/components/SellerPrizeDrawsView.js +2 -2
  216. package/dist/features/seller/components/SellerProductShell.js +8 -8
  217. package/dist/features/seller/components/SellerProductsView.js +1 -1
  218. package/dist/features/seller/components/SellerShippingView.js +6 -6
  219. package/dist/features/seller/components/SellerStickersView.js +2 -2
  220. package/dist/features/seller/hooks/useSellerListingData.d.ts +1 -1
  221. package/dist/features/seller/hooks/useSellerListingData.js +3 -2
  222. package/dist/features/shipments/components/AdminShipmentEditorView.js +10 -10
  223. package/dist/features/shipments/components/AdminShipmentLotItemsView.js +4 -4
  224. package/dist/features/shipments/components/AdminShipmentProjectionsView.js +5 -5
  225. package/dist/features/shipments/components/AdminShipmentsView.js +4 -4
  226. package/dist/features/shipments/repository/shipment-lots.repository.d.ts +2 -2
  227. package/dist/features/shipments/repository/shipment-lots.repository.js +8 -8
  228. package/dist/features/shipments/schemas/firestore.d.ts +21 -21
  229. package/dist/features/shipments/schemas/firestore.js +9 -9
  230. package/dist/features/shipments/schemas/validation.d.ts +30 -30
  231. package/dist/features/shipments/schemas/validation.js +6 -6
  232. package/dist/features/shipments/utils/cost-allocation.d.ts +5 -5
  233. package/dist/features/shipments/utils/cost-allocation.js +39 -38
  234. package/dist/features/store-extensions/schemas/firestore.d.ts +5 -5
  235. package/dist/features/stores/components/StoreDetailLayoutView.js +9 -13
  236. package/dist/features/stores/schemas/firestore.d.ts +7 -7
  237. package/dist/features/stores/schemas/index.d.ts +84 -84
  238. package/dist/features/stores/schemas/index.js +5 -5
  239. package/dist/features/tester/seed-data/categories-tester-seed-data.js +1 -1
  240. package/dist/features/tester/seed-data/products-tester-seed-data.js +6 -6
  241. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +9 -2
  242. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +8 -1
  243. package/dist/features/whatsapp-bot/helpers/whatsapp.js +13 -2
  244. package/dist/features/whatsapp-bot/types/index.d.ts +9 -1
  245. package/dist/index.d.ts +3 -7
  246. package/dist/index.js +7 -5
  247. package/dist/next/routing/route-map.d.ts +2 -0
  248. package/dist/next/routing/route-map.js +6 -0
  249. package/dist/schemas/firestore-helpers.d.ts +2 -2
  250. package/dist/schemas/firestore-helpers.js +2 -2
  251. package/dist/schemas/registry.d.ts +73 -73
  252. package/dist/seed/bids-seed-data.js +6 -6
  253. package/dist/seed/blog-posts-seed-data.js +1 -0
  254. package/dist/seed/cart-seed-data.js +13 -13
  255. package/dist/seed/catalogue-seed-data.js +6 -6
  256. package/dist/seed/categories-seed-data.js +5 -5
  257. package/dist/seed/claimed-coupons-seed-data.js +3 -3
  258. package/dist/seed/coupons-seed-data.js +20 -20
  259. package/dist/seed/events-seed-data.js +27 -27
  260. package/dist/seed/factories/bid.factory.js +1 -1
  261. package/dist/seed/faq-seed-data.js +20 -1
  262. package/dist/seed/grouped-listings-seed-data.d.ts +2 -2
  263. package/dist/seed/grouped-listings-seed-data.js +3 -3
  264. package/dist/seed/offers-seed-data.js +19 -19
  265. package/dist/seed/orders-seed-data.js +29 -29
  266. package/dist/seed/payouts-seed-data.js +7 -7
  267. package/dist/seed/products-auctions-seed-data.js +6 -6
  268. package/dist/seed/products-preorders-seed-data.d.ts +2 -2
  269. package/dist/seed/products-preorders-seed-data.js +1 -1
  270. package/dist/seed/products-standard-seed-data.js +8 -8
  271. package/dist/seed/scammers-seed-data.js +2 -2
  272. package/dist/seed/shipments-seed-data.js +29 -29
  273. package/dist/seed/site-settings-seed-data.js +3 -2
  274. package/dist/seed/store-extensions-seed-data.js +8 -8
  275. package/dist/seed/stores-seed-data.js +37 -8
  276. package/dist/seed/users-seed-data.js +38 -1
  277. package/dist/server-entry.d.ts +1 -3
  278. package/dist/server-entry.js +1 -3
  279. package/dist/server.d.ts +2 -1
  280. package/dist/server.js +3 -1
  281. package/dist/ui/components/PriceDisplay.js +3 -12
  282. package/dist/utils/number.formatter.d.ts +2 -7
  283. package/dist/utils/number.formatter.js +3 -8
  284. package/package.json +1 -1
  285. package/scripts/seed-cli.mjs +8 -3
  286. package/dist/_internal/client/scaffolds/DashboardScaffold.d.ts +0 -34
  287. package/dist/_internal/client/scaffolds/DashboardScaffold.js +0 -26
  288. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.d.ts +0 -1
  289. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.js +0 -109
  290. package/dist/_internal/server/features/auctions/__tests__/service.test.d.ts +0 -1
  291. package/dist/_internal/server/features/auctions/__tests__/service.test.js +0 -140
  292. package/dist/_internal/server/features/checkout/__tests__/actions.test.d.ts +0 -1
  293. package/dist/_internal/server/features/checkout/__tests__/actions.test.js +0 -600
  294. package/dist/_internal/server/features/refunds/__tests__/actions.test.d.ts +0 -1
  295. package/dist/_internal/server/features/refunds/__tests__/actions.test.js +0 -263
  296. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.d.ts +0 -1
  297. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.js +0 -249
  298. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +0 -1
  299. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +0 -65
  300. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +0 -1
  301. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +0 -163
  302. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +0 -1
  303. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +0 -115
  304. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.d.ts +0 -1
  305. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.js +0 -201
  306. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.d.ts +0 -1
  307. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.js +0 -169
  308. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.d.ts +0 -1
  309. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.js +0 -148
  310. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.d.ts +0 -1
  311. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.js +0 -210
  312. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.d.ts +0 -1
  313. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.js +0 -190
  314. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.d.ts +0 -1
  315. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.js +0 -161
  316. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.d.ts +0 -1
  317. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.js +0 -302
  318. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +0 -1
  319. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +0 -96
  320. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.d.ts +0 -1
  321. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.js +0 -252
  322. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.d.ts +0 -1
  323. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.js +0 -129
  324. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +0 -15
  325. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +0 -38
  326. package/dist/_internal/server/providers/index.d.ts +0 -11
  327. package/dist/_internal/server/providers/index.js +0 -11
  328. package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +0 -52
  329. package/dist/_internal/server/providers/payment/razorpay-mock.js +0 -118
  330. package/dist/_internal/server/providers/resolve.d.ts +0 -36
  331. package/dist/_internal/server/providers/resolve.js +0 -31
  332. package/dist/_internal/server/providers/shipping/shiprocket-mock.d.ts +0 -29
  333. package/dist/_internal/server/providers/shipping/shiprocket-mock.js +0 -152
  334. package/dist/_internal/shared/types/__tests__/action-result.test.d.ts +0 -1
  335. package/dist/_internal/shared/types/__tests__/action-result.test.js +0 -65
  336. package/dist/errors/__tests__/error-mapping.test.d.ts +0 -1
  337. package/dist/errors/__tests__/error-mapping.test.js +0 -122
  338. package/dist/errors/__tests__/safe-read.test.d.ts +0 -1
  339. package/dist/errors/__tests__/safe-read.test.js +0 -39
  340. package/dist/features/addresses/repository/__tests__/addresses.repository.test.d.ts +0 -1
  341. package/dist/features/addresses/repository/__tests__/addresses.repository.test.js +0 -386
  342. package/dist/features/admin/components/AdminListingScaffold.d.ts +0 -41
  343. package/dist/features/admin/components/AdminListingScaffold.js +0 -68
  344. package/dist/features/admin/components/QuickActionsPanel.d.ts +0 -15
  345. package/dist/features/admin/components/QuickActionsPanel.js +0 -5
  346. package/dist/features/admin/repository/__tests__/notification.repository.test.d.ts +0 -1
  347. package/dist/features/admin/repository/__tests__/notification.repository.test.js +0 -356
  348. package/dist/features/admin/repository/__tests__/site-settings.repository.test.d.ts +0 -1
  349. package/dist/features/admin/repository/__tests__/site-settings.repository.test.js +0 -298
  350. package/dist/features/auctions/repository/__tests__/bid.repository.test.d.ts +0 -1
  351. package/dist/features/auctions/repository/__tests__/bid.repository.test.js +0 -290
  352. package/dist/features/auctions/repository/auctions.repository.d.ts +0 -12
  353. package/dist/features/auctions/repository/auctions.repository.js +0 -42
  354. package/dist/features/auth/repository/__tests__/session.repository.test.d.ts +0 -1
  355. package/dist/features/auth/repository/__tests__/session.repository.test.js +0 -310
  356. package/dist/features/auth/repository/__tests__/session.test.d.ts +0 -1
  357. package/dist/features/auth/repository/__tests__/session.test.js +0 -146
  358. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.d.ts +0 -1
  359. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.js +0 -171
  360. package/dist/features/auth/repository/__tests__/sms-counter.test.d.ts +0 -1
  361. package/dist/features/auth/repository/__tests__/sms-counter.test.js +0 -88
  362. package/dist/features/auth/repository/__tests__/token.repository.test.d.ts +0 -1
  363. package/dist/features/auth/repository/__tests__/token.repository.test.js +0 -260
  364. package/dist/features/auth/repository/__tests__/token.test.d.ts +0 -1
  365. package/dist/features/auth/repository/__tests__/token.test.js +0 -140
  366. package/dist/features/auth/repository/__tests__/user.repository.test.d.ts +0 -1
  367. package/dist/features/auth/repository/__tests__/user.repository.test.js +0 -352
  368. package/dist/features/auth/repository/__tests__/user.test.d.ts +0 -1
  369. package/dist/features/auth/repository/__tests__/user.test.js +0 -226
  370. package/dist/features/before-after/repository/before-after.repository.d.ts +0 -13
  371. package/dist/features/before-after/repository/before-after.repository.js +0 -36
  372. package/dist/features/before-after/server.d.ts +0 -6
  373. package/dist/features/before-after/server.js +0 -6
  374. package/dist/features/cart/repository/__tests__/cart.repository.test.d.ts +0 -1
  375. package/dist/features/cart/repository/__tests__/cart.repository.test.js +0 -371
  376. package/dist/features/categories/repository/__tests__/categories.repository.test.d.ts +0 -1
  377. package/dist/features/categories/repository/__tests__/categories.repository.test.js +0 -813
  378. package/dist/features/collections/repository/collections.repository.d.ts +0 -8
  379. package/dist/features/collections/repository/collections.repository.js +0 -16
  380. package/dist/features/collections/server.d.ts +0 -6
  381. package/dist/features/collections/server.js +0 -6
  382. package/dist/features/events/repository/__tests__/event.repository.test.d.ts +0 -1
  383. package/dist/features/events/repository/__tests__/event.repository.test.js +0 -299
  384. package/dist/features/faq/repository/__tests__/faqs.repository.test.d.ts +0 -1
  385. package/dist/features/faq/repository/__tests__/faqs.repository.test.js +0 -311
  386. package/dist/features/forms/Form.d.ts +0 -25
  387. package/dist/features/forms/Form.js +0 -37
  388. package/dist/features/history/repository/__tests__/user-history.repository.test.d.ts +0 -1
  389. package/dist/features/history/repository/__tests__/user-history.repository.test.js +0 -180
  390. package/dist/features/homepage/repository/__tests__/carousel.repository.test.d.ts +0 -1
  391. package/dist/features/homepage/repository/__tests__/carousel.repository.test.js +0 -182
  392. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.d.ts +0 -1
  393. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.js +0 -185
  394. package/dist/features/layout/ListingLayout.d.ts +0 -34
  395. package/dist/features/layout/ListingLayout.js +0 -103
  396. package/dist/features/messages/repository/__tests__/conversations.repository.test.d.ts +0 -1
  397. package/dist/features/messages/repository/__tests__/conversations.repository.test.js +0 -257
  398. package/dist/features/orders/repository/__tests__/orders.repository.test.d.ts +0 -1
  399. package/dist/features/orders/repository/__tests__/orders.repository.test.js +0 -211
  400. package/dist/features/payments/repository/__tests__/payout.repository.test.d.ts +0 -1
  401. package/dist/features/payments/repository/__tests__/payout.repository.test.js +0 -292
  402. package/dist/features/pre-orders/repository/preorders.repository.d.ts +0 -8
  403. package/dist/features/pre-orders/repository/preorders.repository.js +0 -25
  404. package/dist/features/products/repository/__tests__/product-features.repository.test.d.ts +0 -1
  405. package/dist/features/products/repository/__tests__/product-features.repository.test.js +0 -329
  406. package/dist/features/products/repository/__tests__/products.repository.test.d.ts +0 -1
  407. package/dist/features/products/repository/__tests__/products.repository.test.js +0 -607
  408. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.d.ts +0 -1
  409. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.js +0 -219
  410. package/dist/features/promotions/repository/__tests__/coupons.repository.test.d.ts +0 -1
  411. package/dist/features/promotions/repository/__tests__/coupons.repository.test.js +0 -480
  412. package/dist/features/promotions/repository/promotions.repository.d.ts +0 -14
  413. package/dist/features/promotions/repository/promotions.repository.js +0 -43
  414. package/dist/features/reviews/repository/__tests__/reviews.repository.test.d.ts +0 -1
  415. package/dist/features/reviews/repository/__tests__/reviews.repository.test.js +0 -327
  416. package/dist/features/scams/repository/__tests__/scammer.repository.test.d.ts +0 -1
  417. package/dist/features/scams/repository/__tests__/scammer.repository.test.js +0 -385
  418. package/dist/features/search/repository/__tests__/search.repository.test.d.ts +0 -1
  419. package/dist/features/search/repository/__tests__/search.repository.test.js +0 -369
  420. package/dist/features/seller/components/SellerStatCard.d.ts +0 -14
  421. package/dist/features/seller/components/SellerStatCard.js +0 -6
  422. package/dist/features/seller/components/seller-products-styles.d.ts +0 -7
  423. package/dist/features/seller/components/seller-products-styles.js +0 -14
  424. package/dist/features/seller/repository/__tests__/offer.repository.test.d.ts +0 -1
  425. package/dist/features/seller/repository/__tests__/offer.repository.test.js +0 -458
  426. package/dist/features/seller/repository/seller.repository.d.ts +0 -22
  427. package/dist/features/seller/repository/seller.repository.js +0 -72
  428. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.d.ts +0 -1
  429. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.js +0 -37
  430. package/dist/features/stores/repository/__tests__/store.repository.test.d.ts +0 -1
  431. package/dist/features/stores/repository/__tests__/store.repository.test.js +0 -261
  432. package/dist/features/stores/repository/stores.repository.d.ts +0 -11
  433. package/dist/features/stores/repository/stores.repository.js +0 -37
  434. package/dist/features/support/repository/__tests__/support.repository.test.d.ts +0 -1
  435. package/dist/features/support/repository/__tests__/support.repository.test.js +0 -312
  436. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.d.ts +0 -1
  437. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.js +0 -139
  438. package/dist/features/wishlist/repository/wishlist.repository.d.ts +0 -13
  439. package/dist/features/wishlist/repository/wishlist.repository.js +0 -31
  440. package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +0 -1
  441. package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +0 -93
  442. package/dist/providers/shipping-shiprocket/index.d.ts +0 -297
  443. package/dist/providers/shipping-shiprocket/index.js +0 -194
  444. package/dist/providers/shipping-shiprocket/shiprocket-provider.d.ts +0 -45
  445. package/dist/providers/shipping-shiprocket/shiprocket-provider.js +0 -168
  446. package/dist/react/contexts/ThemeContext.d.ts +0 -13
  447. package/dist/react/contexts/ThemeContext.js +0 -64
  448. package/dist/schemas/webhooks/shiprocket.d.ts +0 -30
  449. package/dist/schemas/webhooks/shiprocket.js +0 -22
  450. package/dist/seed/actions/demo-seed-actions.d.ts +0 -42
  451. package/dist/seed/actions/demo-seed-actions.js +0 -36
  452. package/dist/seed/actions/index.d.ts +0 -1
  453. package/dist/seed/actions/index.js +0 -1
  454. package/dist/seed/sub-listings-seed-data.d.ts +0 -123
  455. package/dist/seed/sub-listings-seed-data.js +0 -447
  456. package/dist/seed/tester-checklist-seed-data.d.ts +0 -2
  457. package/dist/seed/tester-checklist-seed-data.js +0 -248
  458. package/dist/ui/components/DashboardStatsCard.d.ts +0 -15
  459. package/dist/ui/components/DashboardStatsCard.js +0 -27
  460. package/dist/ui/components/DashboardStatsCard.style.css +0 -68
  461. package/dist/ui/components/DynamicSelect.d.ts +0 -23
  462. package/dist/ui/components/DynamicSelect.js +0 -77
  463. package/dist/ui/components/DynamicSelect.style.css +0 -101
  464. package/dist/ui/components/InlineCreateSelect.d.ts +0 -48
  465. package/dist/ui/components/InlineCreateSelect.js +0 -75
  466. package/dist/ui/components/ListingViewShell.d.ts +0 -37
  467. package/dist/ui/components/ListingViewShell.js +0 -9
  468. package/dist/ui/components/PaginatedMultiSelect.d.ts +0 -28
  469. package/dist/ui/components/PaginatedMultiSelect.js +0 -141
  470. package/dist/ui/components/PaginatedMultiSelect.style.css +0 -272
  471. package/dist/ui/components/SectionTabs.d.ts +0 -19
  472. package/dist/ui/components/SectionTabs.js +0 -66
  473. package/dist/ui/components/SectionTabs.style.css +0 -164
  474. package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +0 -1
  475. package/dist/ui/components/__tests__/BulkActionBar.test.js +0 -96
  476. package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +0 -1
  477. package/dist/ui/components/__tests__/ListingToolbar.test.js +0 -125
  478. package/dist/ui/components/__tests__/new-primitives.test.d.ts +0 -1
  479. package/dist/ui/components/__tests__/new-primitives.test.js +0 -187
@@ -1,139 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import { makeMockDb, makeSnap } from "../../../../../tests/helpers/mock-firestore";
3
- const { db, mockDocRef, mockCollection, mockTxn } = makeMockDb();
4
- vi.mock("../../../../providers/db-firebase", () => ({
5
- getAdminDb: () => db,
6
- }));
7
- vi.mock("../../../../monitoring", () => ({
8
- serverLogger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() },
9
- }));
10
- import { UserWishlistRepository, WishlistFullError } from "../user-wishlist.repository";
11
- import { WISHLIST_MAX } from "../../../../constants/limits";
12
- const repo = new UserWishlistRepository();
13
- function makeItems(count) {
14
- return Array.from({ length: count }, (_, i) => ({
15
- productId: `product-${i}`,
16
- addedAt: new Date(),
17
- }));
18
- }
19
- beforeEach(() => {
20
- vi.clearAllMocks();
21
- // Reset collection chain so tests that override db.collection don't leak
22
- db.collection.mockReturnValue(mockCollection);
23
- mockCollection.doc.mockReturnValue(mockDocRef);
24
- // Default: runTransaction calls through
25
- db.runTransaction.mockImplementation(async (fn) => fn(mockTxn));
26
- // Default: doc.get returns non-existent snap
27
- mockDocRef.get.mockResolvedValue(makeSnap(null));
28
- mockDocRef.set.mockResolvedValue(undefined);
29
- mockTxn.get.mockResolvedValue(makeSnap(null));
30
- mockTxn.set.mockResolvedValue(undefined);
31
- });
32
- describe("UserWishlistRepository.addItem", () => {
33
- it("adds first item: count = 1, no error", async () => {
34
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "user-1", items: [], updatedAt: new Date() }));
35
- const count = await repo.addItem("user-1", "product-new");
36
- expect(count).toBe(1);
37
- expect(mockTxn.set).toHaveBeenCalledOnce();
38
- });
39
- it("19 items → adds item, count = 20, no error", async () => {
40
- const items = makeItems(19);
41
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
42
- const count = await repo.addItem("u", "product-20");
43
- expect(count).toBe(20);
44
- });
45
- it("20 items + new productId → throws WishlistFullError with current=20, limit=20", async () => {
46
- const items = makeItems(WISHLIST_MAX);
47
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
48
- await expect(repo.addItem("u", "product-new")).rejects.toBeInstanceOf(WishlistFullError);
49
- const err = await repo.addItem("u", "product-new").catch((e) => e);
50
- if (err instanceof WishlistFullError) {
51
- expect(err.current).toBe(WISHLIST_MAX);
52
- expect(err.limit).toBe(WISHLIST_MAX);
53
- }
54
- });
55
- it("20 items + same productId (existing) → idempotent no-op, returns existing count", async () => {
56
- const items = makeItems(WISHLIST_MAX);
57
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
58
- const count = await repo.addItem("u", "product-0"); // already in list
59
- expect(count).toBe(WISHLIST_MAX);
60
- expect(mockTxn.set).not.toHaveBeenCalled();
61
- });
62
- it("5 items + existing productId → idempotent no-op, count remains 5", async () => {
63
- const items = makeItems(5);
64
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
65
- const count = await repo.addItem("u", "product-3"); // already in list
66
- expect(count).toBe(5);
67
- expect(mockTxn.set).not.toHaveBeenCalled();
68
- });
69
- it("uses db.runTransaction for every add", async () => {
70
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items: [], updatedAt: new Date() }));
71
- await repo.addItem("u", "product-x");
72
- expect(db.runTransaction).toHaveBeenCalledOnce();
73
- });
74
- it("stores productType in the item", async () => {
75
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items: [], updatedAt: new Date() }));
76
- await repo.addItem("u", "product-x", { productType: "auction" });
77
- const setCall = mockTxn.set.mock.calls[0][1];
78
- expect(setCall.items[0].productType).toBe("auction");
79
- });
80
- });
81
- describe("UserWishlistRepository.removeItem", () => {
82
- it("removes existing productId, count decrements", async () => {
83
- const items = [
84
- { productId: "product-0", addedAt: new Date() },
85
- { productId: "product-1", addedAt: new Date() },
86
- ];
87
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
88
- await repo.removeItem("u", "product-0");
89
- const setCall = mockTxn.set.mock.calls[0][1];
90
- expect(setCall.items).toHaveLength(1);
91
- expect(setCall.items[0].productId).toBe("product-1");
92
- });
93
- it("non-existent productId → no-op, set not called", async () => {
94
- const items = [{ productId: "product-0", addedAt: new Date() }];
95
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
96
- await repo.removeItem("u", "product-xxx");
97
- expect(mockTxn.set).not.toHaveBeenCalled();
98
- });
99
- it("uses db.runTransaction", async () => {
100
- mockTxn.get.mockResolvedValue(makeSnap({ userId: "u", items: [], updatedAt: new Date() }));
101
- await repo.removeItem("u", "product-x");
102
- expect(db.runTransaction).toHaveBeenCalledOnce();
103
- });
104
- });
105
- describe("UserWishlistRepository.isInWishlist", () => {
106
- it("productId in items array → returns true", async () => {
107
- const items = [{ productId: "product-0", addedAt: new Date() }];
108
- // First get: wishlist doc; second get: product exists check in filterExistingProducts
109
- mockDocRef.get
110
- .mockResolvedValueOnce(makeSnap({ userId: "u", items, updatedAt: new Date() }))
111
- .mockResolvedValue(makeSnap({ id: "product-0" }, "product-0"));
112
- const result = await repo.isInWishlist("u", "product-0");
113
- expect(result).toBe(true);
114
- });
115
- it("productId not in items array → returns false", async () => {
116
- mockDocRef.get.mockResolvedValue(makeSnap({ userId: "u", items: [], updatedAt: new Date() }));
117
- const result = await repo.isInWishlist("u", "product-xxx");
118
- expect(result).toBe(false);
119
- });
120
- });
121
- describe("UserWishlistRepository.countByUser", () => {
122
- it("returns items.length from stored document", async () => {
123
- const items = makeItems(7);
124
- mockDocRef.get.mockResolvedValue(makeSnap({ userId: "u", items, updatedAt: new Date() }));
125
- const count = await repo.countByUser("u");
126
- expect(count).toBe(7);
127
- });
128
- it("returns 0 for user with no document", async () => {
129
- mockDocRef.get.mockResolvedValue(makeSnap(null));
130
- const count = await repo.countByUser("u");
131
- expect(count).toBe(0);
132
- });
133
- });
134
- describe("UserWishlistRepository.clearWishlist", () => {
135
- it("sets items: [] without deleting the document", async () => {
136
- await repo.clearWishlist("u");
137
- expect(mockDocRef.set).toHaveBeenCalledWith(expect.objectContaining({ items: [] }));
138
- });
139
- });
@@ -1,13 +0,0 @@
1
- import type { IRepository, PagedResult, SieveQuery } from "../../../contracts";
2
- import type { WishlistItem } from "../types";
3
- export declare class WishlistRepository {
4
- private readonly repo;
5
- constructor(repo: IRepository<WishlistItem>);
6
- findByUser(userId: string): Promise<WishlistItem[]>;
7
- findAll(query?: SieveQuery): Promise<PagedResult<WishlistItem>>;
8
- findById(id: string): Promise<WishlistItem | null>;
9
- add(data: Omit<WishlistItem, "id">): Promise<WishlistItem>;
10
- remove(id: string): Promise<void>;
11
- update(id: string, data: Partial<WishlistItem>): Promise<WishlistItem>;
12
- delete(id: string): Promise<void>;
13
- }
@@ -1,31 +0,0 @@
1
- export class WishlistRepository {
2
- constructor(repo) {
3
- this.repo = repo;
4
- }
5
- async findByUser(userId) {
6
- const result = await this.repo.findAll({
7
- filters: `userId==${userId}`,
8
- sort: "-addedAt",
9
- perPage: 200,
10
- });
11
- return result.data;
12
- }
13
- async findAll(query) {
14
- return this.repo.findAll(query ?? {});
15
- }
16
- async findById(id) {
17
- return this.repo.findById(id);
18
- }
19
- async add(data) {
20
- return this.repo.create(data);
21
- }
22
- async remove(id) {
23
- return this.repo.delete(id);
24
- }
25
- async update(id, data) {
26
- return this.repo.update(id, data);
27
- }
28
- async delete(id) {
29
- return this.repo.delete(id);
30
- }
31
- }
@@ -1,93 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { expandFilterAliases } from "../filter-aliases";
3
- describe("expandFilterAliases", () => {
4
- it("returns undefined when filters is undefined", () => {
5
- const aliases = { scope: () => "status==active" };
6
- expect(expandFilterAliases(undefined, aliases)).toBeUndefined();
7
- });
8
- it("returns filters unchanged when aliases is undefined", () => {
9
- expect(expandFilterAliases("status==active", undefined)).toBe("status==active");
10
- });
11
- it("returns filters unchanged when aliases is empty object", () => {
12
- expect(expandFilterAliases("status==active", {})).toBe("status==active");
13
- });
14
- it("expands a single alias clause", () => {
15
- const aliases = {
16
- scope: (value) => value === "publicAuctions" ? "status==published,listingType==auction" : "",
17
- };
18
- expect(expandFilterAliases("scope==publicAuctions", aliases)).toBe("status==published,listingType==auction");
19
- });
20
- it("passes the operator to the alias function", () => {
21
- const received = [];
22
- const aliases = {
23
- myField: (value, op) => {
24
- received.push({ value, op });
25
- return "x==1";
26
- },
27
- };
28
- expandFilterAliases("myField!=foo", aliases);
29
- expect(received).toEqual([{ value: "foo", op: "!=" }]);
30
- });
31
- it("expands an alias and passes through unknown clauses", () => {
32
- const aliases = {
33
- scope: () => "status==published,listingType==auction",
34
- };
35
- const result = expandFilterAliases("scope==publicAuctions,storeId==store-abc", aliases);
36
- expect(result).toBe("status==published,listingType==auction,storeId==store-abc");
37
- });
38
- it("passes through a clause whose field has no alias", () => {
39
- const aliases = { scope: () => "status==active" };
40
- expect(expandFilterAliases("category==brand-pokemon", aliases)).toBe("category==brand-pokemon");
41
- });
42
- it("drops a clause when the alias returns empty string", () => {
43
- const aliases = {
44
- scope: () => "",
45
- };
46
- expect(expandFilterAliases("scope==unknown", aliases)).toBe("");
47
- });
48
- it("drops an empty-expansion clause while keeping other clauses", () => {
49
- const aliases = {
50
- scope: (value) => (value === "known" ? "status==active" : ""),
51
- };
52
- const result = expandFilterAliases("scope==notknown,listingType==standard", aliases);
53
- expect(result).toBe("listingType==standard");
54
- });
55
- it("handles multiple alias fields in one filter string", () => {
56
- const aliases = {
57
- scope: () => "status==active",
58
- type: () => "listingType==auction",
59
- };
60
- const result = expandFilterAliases("scope==any,type==any", aliases);
61
- expect(result).toBe("status==active,listingType==auction");
62
- });
63
- it("trims whitespace around clauses", () => {
64
- const aliases = { scope: () => "status==active" };
65
- const result = expandFilterAliases(" scope==x , name==foo ", aliases);
66
- expect(result).toBe("status==active,name==foo");
67
- });
68
- it("passes through a clause that does not match the operator pattern", () => {
69
- const aliases = { scope: () => "status==active" };
70
- // A malformed clause has no operator — should pass through unchanged
71
- expect(expandFilterAliases("malformed", aliases)).toBe("malformed");
72
- });
73
- it("handles @= operator", () => {
74
- const received = [];
75
- const aliases = {
76
- tags: (_v, op) => { received.push(op); return "tags@=value"; },
77
- };
78
- expandFilterAliases("tags@=value", aliases);
79
- expect(received[0]).toBe("@=");
80
- });
81
- it("handles @=* operator", () => {
82
- const received = [];
83
- const aliases = {
84
- tags: (_v, op) => { received.push(op); return "tags@=*value"; },
85
- };
86
- expandFilterAliases("tags@=*value", aliases);
87
- expect(received[0]).toBe("@=*");
88
- });
89
- it("returns empty string when all clauses expand to empty", () => {
90
- const aliases = { scope: () => "" };
91
- expect(expandFilterAliases("scope==x", aliases)).toBe("");
92
- });
93
- });
@@ -1,297 +0,0 @@
1
- export interface ShiprocketAuthRequest {
2
- email: string;
3
- password: string;
4
- }
5
- export interface ShiprocketAuthResponse {
6
- token: string;
7
- message: string;
8
- data?: {
9
- id: number;
10
- email: string;
11
- name: string;
12
- company_id: number;
13
- };
14
- }
15
- export interface ShiprocketPickupLocation {
16
- id: number;
17
- pickup_location: string;
18
- add: string;
19
- add2?: string;
20
- city: string;
21
- state: string;
22
- country: string;
23
- pin_code: string;
24
- phone: string;
25
- email: string;
26
- name: string;
27
- phone_verified?: number;
28
- }
29
- export interface ShiprocketPickupLocationsResponse {
30
- shipping_address: ShiprocketPickupLocation[];
31
- }
32
- export interface ShiprocketAddPickupRequest {
33
- pickup_location: string;
34
- name: string;
35
- email: string;
36
- phone: string;
37
- address: string;
38
- address_2?: string;
39
- city: string;
40
- state: string;
41
- country: string;
42
- pin_code: string;
43
- }
44
- export interface ShiprocketAddPickupResponse {
45
- success: boolean;
46
- address?: {
47
- pickup_location_id: number;
48
- name: string;
49
- phone: string;
50
- address: string;
51
- city: string;
52
- state: string;
53
- country: string;
54
- pin_code: string;
55
- };
56
- message?: string;
57
- }
58
- export interface ShiprocketVerifyPickupOTPRequest {
59
- otp: number;
60
- pickup_location_id: number;
61
- }
62
- export interface ShiprocketVerifyPickupOTPResponse {
63
- success: boolean;
64
- message: string;
65
- }
66
- export interface ShiprocketOrderItem {
67
- name: string;
68
- sku: string;
69
- units: number;
70
- selling_price: number;
71
- discount?: number;
72
- tax?: string;
73
- hsn?: number;
74
- }
75
- export interface ShiprocketCreateOrderRequest {
76
- order_id: string;
77
- order_date: string;
78
- pickup_location: string;
79
- billing_customer_name: string;
80
- billing_last_name?: string;
81
- billing_address: string;
82
- billing_address_2?: string;
83
- billing_city: string;
84
- billing_pincode: string;
85
- billing_state: string;
86
- billing_country: string;
87
- billing_email: string;
88
- billing_phone: string;
89
- shipping_is_billing: boolean;
90
- shipping_customer_name?: string;
91
- shipping_last_name?: string;
92
- shipping_address?: string;
93
- shipping_address_2?: string;
94
- shipping_city?: string;
95
- shipping_pincode?: string;
96
- shipping_state?: string;
97
- shipping_country?: string;
98
- shipping_phone?: string;
99
- order_items: ShiprocketOrderItem[];
100
- payment_method: "Prepaid" | "COD";
101
- sub_total: number;
102
- length: number;
103
- breadth: number;
104
- height: number;
105
- weight: number;
106
- }
107
- export interface ShiprocketCreateOrderResponse {
108
- order_id: number;
109
- shipment_id: number;
110
- status: string;
111
- status_code: number;
112
- onboarding_completed_now: boolean;
113
- awb_code?: string;
114
- courier_company_id?: number;
115
- courier_name?: string;
116
- }
117
- export interface ShiprocketGenerateAWBRequest {
118
- shipment_id: number;
119
- courier_id?: number;
120
- }
121
- export interface ShiprocketAWBResponse {
122
- awb_code: string;
123
- courier_company_id: number;
124
- courier_name: string;
125
- shipment_id: number;
126
- assigned_date_time: string;
127
- expected_delivery: string;
128
- tracking_url?: string;
129
- }
130
- export interface ShiprocketGeneratePickupRequest {
131
- shipment_id: number[];
132
- pickup_date?: string[];
133
- }
134
- export interface ShiprocketPickupResponse {
135
- pickup_scheduled_date?: string;
136
- pickup_token_number?: string;
137
- status: number;
138
- others?: string;
139
- }
140
- export interface ShiprocketTrackActivity {
141
- date: string;
142
- status: string;
143
- activity: string;
144
- location: string;
145
- sr_status?: string;
146
- sr_status_label?: string;
147
- }
148
- export interface ShiprocketShipmentTrack {
149
- id: number;
150
- awb_code: string;
151
- courier_company_id: number;
152
- shipment_id: number;
153
- order_id: number;
154
- pickup_date?: string;
155
- delivered_date?: string;
156
- weight: string;
157
- current_status: string;
158
- edd?: string;
159
- shipment_track_activities: ShiprocketTrackActivity[];
160
- }
161
- export interface ShiprocketTrackingResponse {
162
- tracking_data: {
163
- awb_track_url: string;
164
- track_url: string;
165
- current_status: string;
166
- current_status_id: number;
167
- shipment_status: number;
168
- shipment_track: ShiprocketShipmentTrack[];
169
- shipment_track_activities: ShiprocketTrackActivity[];
170
- error?: string;
171
- cod?: boolean;
172
- };
173
- }
174
- export interface ShiprocketCourierServiceabilityResponse {
175
- data?: {
176
- available_courier_companies: Array<{
177
- id: number;
178
- name: string;
179
- etd: string;
180
- rate: number;
181
- cod_charges?: number;
182
- }>;
183
- };
184
- status: number;
185
- message?: string;
186
- }
187
- export interface ShiprocketCancelOrderResponse {
188
- message: string;
189
- status: number;
190
- }
191
- export interface ShiprocketOrderDetailResponse {
192
- data?: {
193
- shipments?: Array<{
194
- id: number;
195
- awb: string;
196
- status: string;
197
- }>;
198
- };
199
- }
200
- export interface ShiprocketLabelResponse {
201
- label_created: number;
202
- label_url: string;
203
- others?: string;
204
- }
205
- export interface ShiprocketWebhookPayload {
206
- awb: string;
207
- order_id: string;
208
- shipment_id: string;
209
- current_status: string;
210
- current_status_id: number;
211
- courier_agent_assigned?: boolean;
212
- etd?: string;
213
- pickup_generated?: boolean;
214
- }
215
- export { ShiprocketProvider } from "./shiprocket-provider";
216
- export type { ShiprocketProviderConfig } from "./shiprocket-provider";
217
- /**
218
- * @deprecated Use `ShiprocketProvider.authenticate()` instead.
219
- * @internal
220
- */
221
- export declare function shiprocketAuthenticate(credentials: ShiprocketAuthRequest): Promise<ShiprocketAuthResponse>;
222
- /**
223
- * @deprecated Use `ShiprocketProvider.getPickupLocations()` instead.
224
- * @internal
225
- */
226
- export declare function shiprocketGetPickupLocations(token: string): Promise<ShiprocketPickupLocationsResponse>;
227
- /**
228
- * @deprecated Use `ShiprocketProvider.addPickupLocation()` instead.
229
- * @internal
230
- */
231
- export declare function shiprocketAddPickupLocation(token: string, data: ShiprocketAddPickupRequest): Promise<ShiprocketAddPickupResponse>;
232
- /**
233
- * @deprecated Use `ShiprocketProvider.verifyPickupOTP()` instead.
234
- * @internal
235
- */
236
- export declare function shiprocketVerifyPickupOTP(token: string, data: ShiprocketVerifyPickupOTPRequest): Promise<ShiprocketVerifyPickupOTPResponse>;
237
- /**
238
- * @deprecated Use `ShiprocketProvider.createShipment()` instead.
239
- * @internal
240
- */
241
- export declare function shiprocketCreateOrder(token: string, order: ShiprocketCreateOrderRequest): Promise<ShiprocketCreateOrderResponse>;
242
- /**
243
- * @deprecated Use `ShiprocketProvider.createShipment()` instead (generates AWB internally).
244
- * @internal
245
- */
246
- export declare function shiprocketGenerateAWB(token: string, params: ShiprocketGenerateAWBRequest): Promise<ShiprocketAWBResponse>;
247
- /**
248
- * @deprecated Use `ShiprocketProvider.createShipment()` instead (schedules pickup internally).
249
- * @internal
250
- */
251
- export declare function shiprocketGeneratePickup(token: string, params: ShiprocketGeneratePickupRequest): Promise<ShiprocketPickupResponse>;
252
- /**
253
- * @deprecated Use `ShiprocketProvider.trackShipment()` instead.
254
- * @internal
255
- */
256
- export declare function shiprocketTrackByAWB(token: string, awb: string): Promise<ShiprocketTrackingResponse>;
257
- /**
258
- * @deprecated Use `ShiprocketProvider.checkServiceability()` instead.
259
- * @internal
260
- */
261
- export declare function shiprocketCheckServiceability(token: string, paramsOrPickup: {
262
- pickup_postcode: string;
263
- delivery_postcode: string;
264
- weight: number;
265
- cod?: 0 | 1;
266
- } | string, deliveryPostcode?: string, weight?: number, cod?: boolean): Promise<ShiprocketCourierServiceabilityResponse>;
267
- /**
268
- * Cancel one or more Shiprocket orders by their order IDs.
269
- * @deprecated Use `ShiprocketProvider.cancelShipment()` instead.
270
- * @internal
271
- */
272
- export declare function shiprocketCancelOrder(token: string, orderIds: number[]): Promise<ShiprocketCancelOrderResponse>;
273
- /**
274
- * Fetch full order details (including nested shipment IDs) for a Shiprocket order.
275
- * @deprecated Use `ShiprocketProvider.generateLabel()` instead (calls this internally).
276
- * @internal
277
- */
278
- export declare function shiprocketGetOrderDetail(token: string, orderId: number): Promise<ShiprocketOrderDetailResponse>;
279
- /**
280
- * Request a shipping label PDF for one or more Shiprocket shipment IDs.
281
- * Returns a label URL — fetch that URL separately to get the raw PDF bytes.
282
- * @deprecated Use `ShiprocketProvider.generateLabel()` instead.
283
- * @internal
284
- */
285
- export declare function shiprocketPrintLabel(token: string, shipmentIds: number[]): Promise<ShiprocketLabelResponse>;
286
- /** Shiprocket tokens are valid for approx. 10 days */
287
- export declare const SHIPROCKET_TOKEN_TTL_MS: number;
288
- export declare function isShiprocketTokenExpired(expiry: Date | undefined): boolean;
289
- /**
290
- * Public tracking URL Shiprocket exposes for every AWB. All consumers that
291
- * record `trackingUrl` on an order should build it via this helper so the
292
- * base URL stays single-source-of-truth.
293
- */
294
- export declare const SHIPROCKET_TRACKING_URL_BASE = "https://shiprocket.co/tracking";
295
- export declare function buildShiprocketTrackingUrl(awb: string): string;
296
- /** Status saved on an order immediately after pickup is generated. */
297
- export declare const SHIPROCKET_STATUS_PICKUP_SCHEDULED = "Pickup Scheduled";