@mohasinac/appkit 2.6.1 → 2.6.2

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 (301) hide show
  1. package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +38 -0
  2. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +75 -0
  3. package/dist/_internal/client/features/layout/RoleGuard.d.ts +15 -0
  4. package/dist/_internal/client/features/layout/RoleGuard.js +25 -0
  5. package/dist/_internal/client/features/layout/index.d.ts +5 -0
  6. package/dist/_internal/client/features/layout/index.js +4 -0
  7. package/dist/_internal/server/features/brands/actions.d.ts +3 -3
  8. package/dist/_internal/server/features/brands/actions.js +72 -5
  9. package/dist/_internal/server/features/brands/data.d.ts +8 -8
  10. package/dist/_internal/server/features/brands/data.js +10 -11
  11. package/dist/_internal/server/features/brands/service.d.ts +2 -2
  12. package/dist/_internal/server/features/brands/service.js +5 -5
  13. package/dist/_internal/server/features/categories/og.d.ts +33 -0
  14. package/dist/_internal/server/features/categories/og.js +75 -0
  15. package/dist/_internal/server/features/checkout/actions.d.ts +24 -0
  16. package/dist/_internal/server/features/checkout/actions.js +442 -13
  17. package/dist/_internal/server/features/checkout/index.d.ts +1 -1
  18. package/dist/_internal/server/features/checkout/index.js +1 -1
  19. package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +59 -0
  20. package/dist/_internal/server/features/checkout/prize-bundle-gates.js +99 -0
  21. package/dist/_internal/server/features/grouped/data.js +12 -5
  22. package/dist/_internal/server/features/homepage/data.d.ts +1 -1
  23. package/dist/_internal/server/features/homepage/data.js +2 -2
  24. package/dist/_internal/server/features/media/contextGuards.d.ts +52 -0
  25. package/dist/_internal/server/features/media/contextGuards.js +198 -0
  26. package/dist/_internal/server/features/orders/adapters.js +12 -0
  27. package/dist/_internal/server/features/products/data.d.ts +1 -1
  28. package/dist/_internal/server/features/sublisting-categories/data.d.ts +1 -1
  29. package/dist/_internal/server/features/sublisting-categories/data.js +2 -2
  30. package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +24 -0
  31. package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +86 -0
  32. package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +18 -0
  33. package/dist/_internal/server/jobs/handlers/bundleStockSync.js +80 -0
  34. package/dist/_internal/server/jobs/handlers/index.d.ts +8 -0
  35. package/dist/_internal/server/jobs/handlers/index.js +13 -0
  36. package/dist/_internal/server/jobs/handlers/listingProcessor.js +13 -3
  37. package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +17 -0
  38. package/dist/_internal/server/jobs/handlers/onProductStockChange.js +136 -0
  39. package/dist/_internal/server/jobs/handlers/onProductWrite.js +17 -1
  40. package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +9 -0
  41. package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +29 -0
  42. package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +10 -0
  43. package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +58 -0
  44. package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +10 -0
  45. package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +65 -0
  46. package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +9 -0
  47. package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +45 -0
  48. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +30 -0
  49. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +94 -0
  50. package/dist/_internal/shared/features/brands/schema.d.ts +3 -3
  51. package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
  52. package/dist/_internal/shared/features/cart/schema.js +1 -1
  53. package/dist/_internal/shared/features/categories/bundle-config.d.ts +17 -0
  54. package/dist/_internal/shared/features/categories/bundle-config.js +17 -0
  55. package/dist/_internal/shared/features/layout/config.d.ts +35 -0
  56. package/dist/_internal/shared/features/layout/config.js +58 -0
  57. package/dist/_internal/shared/features/layout/index.d.ts +3 -0
  58. package/dist/_internal/shared/features/layout/index.js +2 -0
  59. package/dist/_internal/shared/features/layout/types.d.ts +137 -0
  60. package/dist/_internal/shared/features/layout/types.js +13 -0
  61. package/dist/_internal/shared/features/products/types.d.ts +1 -1
  62. package/dist/_internal/shared/listing-types/_registry.d.ts +57 -0
  63. package/dist/_internal/shared/listing-types/_registry.js +28 -0
  64. package/dist/_internal/shared/listing-types/auction/config.d.ts +7 -0
  65. package/dist/_internal/shared/listing-types/auction/config.js +8 -0
  66. package/dist/_internal/shared/listing-types/auction/ctas.d.ts +1 -0
  67. package/dist/_internal/shared/listing-types/auction/ctas.js +2 -0
  68. package/dist/_internal/shared/listing-types/auction/og.d.ts +1 -0
  69. package/dist/_internal/shared/listing-types/auction/og.js +1 -0
  70. package/dist/_internal/shared/listing-types/auction/schema.d.ts +1 -0
  71. package/dist/_internal/shared/listing-types/auction/schema.js +1 -0
  72. package/dist/_internal/shared/listing-types/auction/seed-factory.d.ts +1 -0
  73. package/dist/_internal/shared/listing-types/auction/seed-factory.js +1 -0
  74. package/dist/_internal/shared/listing-types/capabilities.d.ts +41 -0
  75. package/dist/_internal/shared/listing-types/capabilities.js +75 -0
  76. package/dist/_internal/shared/listing-types/pre-order/config.d.ts +7 -0
  77. package/dist/_internal/shared/listing-types/pre-order/config.js +8 -0
  78. package/dist/_internal/shared/listing-types/pre-order/ctas.d.ts +1 -0
  79. package/dist/_internal/shared/listing-types/pre-order/ctas.js +2 -0
  80. package/dist/_internal/shared/listing-types/pre-order/og.d.ts +1 -0
  81. package/dist/_internal/shared/listing-types/pre-order/og.js +1 -0
  82. package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +1 -0
  83. package/dist/_internal/shared/listing-types/pre-order/schema.js +1 -0
  84. package/dist/_internal/shared/listing-types/pre-order/seed-factory.d.ts +1 -0
  85. package/dist/_internal/shared/listing-types/pre-order/seed-factory.js +1 -0
  86. package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +7 -0
  87. package/dist/_internal/shared/listing-types/prize-draw/config.js +8 -0
  88. package/dist/_internal/shared/listing-types/prize-draw/ctas.d.ts +1 -0
  89. package/dist/_internal/shared/listing-types/prize-draw/ctas.js +2 -0
  90. package/dist/_internal/shared/listing-types/prize-draw/og.d.ts +1 -0
  91. package/dist/_internal/shared/listing-types/prize-draw/og.js +1 -0
  92. package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +1 -0
  93. package/dist/_internal/shared/listing-types/prize-draw/schema.js +1 -0
  94. package/dist/_internal/shared/listing-types/prize-draw/seed-factory.d.ts +1 -0
  95. package/dist/_internal/shared/listing-types/prize-draw/seed-factory.js +1 -0
  96. package/dist/_internal/shared/listing-types/standard/config.d.ts +7 -0
  97. package/dist/_internal/shared/listing-types/standard/config.js +8 -0
  98. package/dist/_internal/shared/listing-types/standard/ctas.d.ts +1 -0
  99. package/dist/_internal/shared/listing-types/standard/ctas.js +3 -0
  100. package/dist/_internal/shared/listing-types/standard/og.d.ts +1 -0
  101. package/dist/_internal/shared/listing-types/standard/og.js +1 -0
  102. package/dist/_internal/shared/listing-types/standard/schema.d.ts +1 -0
  103. package/dist/_internal/shared/listing-types/standard/schema.js +1 -0
  104. package/dist/_internal/shared/listing-types/standard/seed-factory.d.ts +1 -0
  105. package/dist/_internal/shared/listing-types/standard/seed-factory.js +1 -0
  106. package/dist/_internal/shared/media/limits.d.ts +33 -0
  107. package/dist/_internal/shared/media/limits.js +97 -0
  108. package/dist/_internal/shared/schema-versions.d.ts +76 -0
  109. package/dist/_internal/shared/schema-versions.js +82 -0
  110. package/dist/client.d.ts +9 -0
  111. package/dist/client.js +7 -0
  112. package/dist/constants/api-endpoints.d.ts +6 -3
  113. package/dist/constants/api-endpoints.js +2 -1
  114. package/dist/errors/messages.d.ts +1 -1
  115. package/dist/errors/messages.js +1 -1
  116. package/dist/features/account/migrations.d.ts +2 -0
  117. package/dist/features/account/migrations.js +10 -0
  118. package/dist/features/admin/components/AdminMediaView.js +1 -1
  119. package/dist/features/admin/components/AdminProductsView.js +7 -3
  120. package/dist/features/admin/migrations.d.ts +2 -0
  121. package/dist/features/admin/migrations.js +10 -0
  122. package/dist/features/admin/types/product.types.d.ts +1 -1
  123. package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +1 -1
  124. package/dist/features/auctions/migrations.d.ts +2 -0
  125. package/dist/features/auctions/migrations.js +10 -0
  126. package/dist/features/auctions/schemas/index.d.ts +3 -3
  127. package/dist/features/auctions/schemas/index.js +1 -1
  128. package/dist/features/auth/migrations.d.ts +2 -0
  129. package/dist/features/auth/migrations.js +10 -0
  130. package/dist/features/blog/migrations.d.ts +2 -0
  131. package/dist/features/blog/migrations.js +10 -0
  132. package/dist/features/brands/migrations.d.ts +2 -0
  133. package/dist/features/brands/migrations.js +10 -0
  134. package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +6 -0
  135. package/dist/features/bundles/components/BundlesByCategoryListing.js +50 -0
  136. package/dist/features/bundles/components/index.d.ts +2 -0
  137. package/dist/features/bundles/components/index.js +1 -0
  138. package/dist/features/bundles/migrations.d.ts +2 -0
  139. package/dist/features/bundles/migrations.js +10 -0
  140. package/dist/features/bundles/schemas/index.d.ts +1 -0
  141. package/dist/features/bundles/schemas/index.js +1 -0
  142. package/dist/features/bundles/schemas/zod.d.ts +377 -0
  143. package/dist/features/bundles/schemas/zod.js +71 -0
  144. package/dist/features/cart/migrations.d.ts +2 -0
  145. package/dist/features/cart/migrations.js +10 -0
  146. package/dist/features/cart/schemas/firestore.d.ts +2 -2
  147. package/dist/features/categories/components/BrandDetailPageView.js +35 -4
  148. package/dist/features/categories/components/BrandDetailTabs.d.ts +5 -1
  149. package/dist/features/categories/components/BrandDetailTabs.js +22 -8
  150. package/dist/features/categories/components/CategoryBundlesListing.d.ts +6 -0
  151. package/dist/features/categories/components/CategoryBundlesListing.js +74 -0
  152. package/dist/features/categories/components/CategoryDetailPageView.js +29 -4
  153. package/dist/features/categories/components/CategoryDetailTabs.d.ts +5 -1
  154. package/dist/features/categories/components/CategoryDetailTabs.js +22 -8
  155. package/dist/features/categories/migrations.d.ts +2 -0
  156. package/dist/features/categories/migrations.js +10 -0
  157. package/dist/features/categories/repository/categories.repository.d.ts +29 -0
  158. package/dist/features/categories/repository/categories.repository.js +83 -0
  159. package/dist/features/categories/schemas/firestore.d.ts +59 -2
  160. package/dist/features/categories/schemas/firestore.js +6 -0
  161. package/dist/features/categories/types/index.d.ts +11 -3
  162. package/dist/features/events/migrations.d.ts +2 -0
  163. package/dist/features/events/migrations.js +10 -0
  164. package/dist/features/faq/migrations.d.ts +2 -0
  165. package/dist/features/faq/migrations.js +10 -0
  166. package/dist/features/grouped/migrations.d.ts +2 -0
  167. package/dist/features/grouped/migrations.js +10 -0
  168. package/dist/features/grouped/schemas/firestore.d.ts +29 -10
  169. package/dist/features/grouped/schemas/firestore.js +10 -5
  170. package/dist/features/history/migrations.d.ts +2 -0
  171. package/dist/features/history/migrations.js +10 -0
  172. package/dist/features/homepage/hooks/useFeaturedAuctions.js +2 -2
  173. package/dist/features/homepage/hooks/useFeaturedPreOrders.js +2 -2
  174. package/dist/features/homepage/lib/section-renderer.js +5 -3
  175. package/dist/features/media/AvatarUpload.js +6 -28
  176. package/dist/features/media/hooks/useMedia.d.ts +31 -15
  177. package/dist/features/media/hooks/useMedia.js +48 -13
  178. package/dist/features/media/upload/ImageUpload.js +1 -1
  179. package/dist/features/media/upload/MediaUploadField.js +1 -1
  180. package/dist/features/messages/migrations.d.ts +2 -0
  181. package/dist/features/messages/migrations.js +10 -0
  182. package/dist/features/orders/components/OrdersList.js +10 -1
  183. package/dist/features/orders/migrations.d.ts +2 -0
  184. package/dist/features/orders/migrations.js +10 -0
  185. package/dist/features/orders/repository/orders.repository.d.ts +16 -0
  186. package/dist/features/orders/repository/orders.repository.js +49 -0
  187. package/dist/features/orders/schemas/firestore.d.ts +8 -0
  188. package/dist/features/orders/types/index.d.ts +12 -0
  189. package/dist/features/orders/utils/order-splitter.d.ts +2 -2
  190. package/dist/features/orders/utils/order-splitter.js +5 -0
  191. package/dist/features/payments/migrations.d.ts +2 -0
  192. package/dist/features/payments/migrations.js +10 -0
  193. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +4 -1
  194. package/dist/features/products/actions/product-actions.d.ts +1 -1
  195. package/dist/features/products/api/[id]/route.js +34 -0
  196. package/dist/features/products/api/route.js +1 -19
  197. package/dist/features/products/components/CompareOverlay.d.ts +1 -1
  198. package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +24 -0
  199. package/dist/features/products/components/MarketplacePrizeDrawCard.js +102 -0
  200. package/dist/features/products/components/PrizeDrawCollage.d.ts +32 -0
  201. package/dist/features/products/components/PrizeDrawCollage.js +22 -0
  202. package/dist/features/products/components/PrizeDrawDetailPageView.d.ts +27 -0
  203. package/dist/features/products/components/PrizeDrawDetailPageView.js +118 -0
  204. package/dist/features/products/components/PrizeDrawEntryActions.d.ts +19 -0
  205. package/dist/features/products/components/PrizeDrawEntryActions.js +48 -0
  206. package/dist/features/products/components/PrizeDrawItemsEditor.d.ts +13 -0
  207. package/dist/features/products/components/PrizeDrawItemsEditor.js +97 -0
  208. package/dist/features/products/components/PrizeDrawsIndexListing.d.ts +8 -0
  209. package/dist/features/products/components/PrizeDrawsIndexListing.js +128 -0
  210. package/dist/features/products/components/PrizeDrawsListingView.d.ts +15 -0
  211. package/dist/features/products/components/PrizeDrawsListingView.js +49 -0
  212. package/dist/features/products/components/PrizeRevealModal.d.ts +34 -0
  213. package/dist/features/products/components/PrizeRevealModal.js +124 -0
  214. package/dist/features/products/components/ProductDetailPageView.js +13 -1
  215. package/dist/features/products/components/ProductForm.js +35 -2
  216. package/dist/features/products/components/ProductGrid.js +3 -1
  217. package/dist/features/products/components/index.d.ts +16 -0
  218. package/dist/features/products/components/index.js +8 -0
  219. package/dist/features/products/constants/listing-tabs.d.ts +113 -0
  220. package/dist/features/products/constants/listing-tabs.js +43 -0
  221. package/dist/features/products/index.d.ts +1 -0
  222. package/dist/features/products/index.js +1 -0
  223. package/dist/features/products/migrations.d.ts +2 -0
  224. package/dist/features/products/migrations.js +10 -0
  225. package/dist/features/products/repository/products.repository.d.ts +11 -7
  226. package/dist/features/products/repository/products.repository.js +49 -24
  227. package/dist/features/products/schemas/firestore.d.ts +3 -3
  228. package/dist/features/products/schemas/firestore.js +2 -2
  229. package/dist/features/products/schemas/index.d.ts +5 -5
  230. package/dist/features/products/schemas/index.js +3 -1
  231. package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
  232. package/dist/features/products/types/index.d.ts +17 -1
  233. package/dist/features/products/utils/listing-type.d.ts +7 -4
  234. package/dist/features/products/utils/listing-type.js +8 -4
  235. package/dist/features/promotions/actions/coupon-actions.d.ts +1 -1
  236. package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
  237. package/dist/features/promotions/migrations.d.ts +2 -0
  238. package/dist/features/promotions/migrations.js +10 -0
  239. package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
  240. package/dist/features/promotions/schemas/index.d.ts +2 -2
  241. package/dist/features/reviews/migrations.d.ts +2 -0
  242. package/dist/features/reviews/migrations.js +10 -0
  243. package/dist/features/scams/migrations.d.ts +2 -0
  244. package/dist/features/scams/migrations.js +10 -0
  245. package/dist/features/search/api/route.d.ts +1 -1
  246. package/dist/features/search/api/route.js +3 -3
  247. package/dist/features/search/components/Search.d.ts +1 -1
  248. package/dist/features/search/schemas/index.d.ts +3 -3
  249. package/dist/features/search/schemas/index.js +3 -1
  250. package/dist/features/search/types/index.d.ts +2 -2
  251. package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
  252. package/dist/features/seller/components/SellerProductsView.js +20 -6
  253. package/dist/features/seller/migrations.d.ts +2 -0
  254. package/dist/features/seller/migrations.js +10 -0
  255. package/dist/features/seller/schemas/index.d.ts +2 -2
  256. package/dist/features/stores/components/StoreBundlesPageView.d.ts +12 -0
  257. package/dist/features/stores/components/StoreBundlesPageView.js +24 -0
  258. package/dist/features/stores/components/StoreDetailLayoutView.js +15 -3
  259. package/dist/features/stores/components/StorePrizeDrawsPageView.d.ts +11 -0
  260. package/dist/features/stores/components/StorePrizeDrawsPageView.js +27 -0
  261. package/dist/features/stores/components/index.d.ts +2 -0
  262. package/dist/features/stores/migrations.d.ts +2 -0
  263. package/dist/features/stores/migrations.js +10 -0
  264. package/dist/features/stores/schemas/index.d.ts +2 -2
  265. package/dist/features/stores/types/index.d.ts +1 -1
  266. package/dist/features/sublisting/migrations.d.ts +2 -0
  267. package/dist/features/sublisting/migrations.js +10 -0
  268. package/dist/features/sublisting/schemas/firestore.d.ts +2 -0
  269. package/dist/features/support/migrations.d.ts +2 -0
  270. package/dist/features/support/migrations.js +10 -0
  271. package/dist/features/wishlist/migrations.d.ts +2 -0
  272. package/dist/features/wishlist/migrations.js +10 -0
  273. package/dist/features/wishlist/types/index.d.ts +1 -1
  274. package/dist/index.d.ts +26 -18
  275. package/dist/index.js +41 -24
  276. package/dist/jobs.d.ts +1 -1
  277. package/dist/jobs.js +4 -0
  278. package/dist/next/routing/route-map.d.ts +4 -0
  279. package/dist/next/routing/route-map.js +2 -0
  280. package/dist/providers/db-firebase/filter-aliases.d.ts +2 -2
  281. package/dist/repositories/index.d.ts +0 -5
  282. package/dist/repositories/index.js +5 -4
  283. package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
  284. package/dist/seed/categories-seed-data.js +1105 -6
  285. package/dist/seed/faq-seed-data.js +160 -0
  286. package/dist/seed/grouped-listings-seed-data.js +32 -32
  287. package/dist/seed/homepage-sections-seed-data.js +52 -6
  288. package/dist/seed/index.d.ts +1 -3
  289. package/dist/seed/index.js +4 -3
  290. package/dist/seed/manifest.js +8 -13
  291. package/dist/seed/products-prize-draws-seed-data.d.ts +17 -0
  292. package/dist/seed/products-prize-draws-seed-data.js +313 -0
  293. package/dist/seo/json-ld.d.ts +1 -1
  294. package/dist/server-entry.d.ts +2 -2
  295. package/dist/server-entry.js +5 -3
  296. package/dist/server.d.ts +9 -2
  297. package/dist/server.js +11 -5
  298. package/dist/tailwind-utilities.css +1 -1
  299. package/dist/validation/schemas.d.ts +8 -8
  300. package/package.json +1 -1
  301. package/scripts/seed-cli.mjs +2 -4
@@ -0,0 +1,2 @@
1
+ // SB-UNI X2 — placeholder. Phase 7 (W-1) wires the CTA registry.
2
+ export const ctas = [];
@@ -0,0 +1,7 @@
1
+ export declare const LISTING_TYPE: "prize-draw";
2
+ export declare const capability: import("../capabilities").ListingTypeCapability;
3
+ export declare const config: {
4
+ listingType: "prize-draw";
5
+ slugPrefix: string;
6
+ cartLine: "single-product";
7
+ };
@@ -0,0 +1,8 @@
1
+ import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
2
+ export const LISTING_TYPE = "prize-draw";
3
+ export const capability = LISTING_TYPE_CAPABILITIES["prize-draw"];
4
+ export const config = {
5
+ listingType: LISTING_TYPE,
6
+ slugPrefix: "prizedraw-",
7
+ cartLine: "single-product",
8
+ };
@@ -0,0 +1 @@
1
+ export declare const ctas: readonly string[];
@@ -0,0 +1,2 @@
1
+ // SB-UNI X2 — placeholder. Phase 7 (W-1) wires the CTA registry.
2
+ export const ctas = [];
@@ -0,0 +1,7 @@
1
+ export declare const LISTING_TYPE: "standard";
2
+ export declare const capability: import("../capabilities").ListingTypeCapability;
3
+ export declare const config: {
4
+ listingType: "standard";
5
+ slugPrefix: string;
6
+ cartLine: "single-product";
7
+ };
@@ -0,0 +1,8 @@
1
+ import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
2
+ export const LISTING_TYPE = "standard";
3
+ export const capability = LISTING_TYPE_CAPABILITIES.standard;
4
+ export const config = {
5
+ listingType: LISTING_TYPE,
6
+ slugPrefix: "product-",
7
+ cartLine: "single-product",
8
+ };
@@ -0,0 +1 @@
1
+ export declare const ctas: readonly string[];
@@ -0,0 +1,3 @@
1
+ // SB-UNI X2 — placeholder for standard-listing CTA list.
2
+ // Phase 7 (W-1) wires the CTA registry; entries land here.
3
+ export const ctas = [];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Media upload limits — single source of truth for byte ceilings, MIME
3
+ * allowlists, and extension mapping. Shared between the signed-URL issuer,
4
+ * the finalize handler, the client upload hook, and any field-level
5
+ * pre-validation.
6
+ *
7
+ * Why centralised: previously these constants were duplicated across
8
+ * `/api/media/upload`, `/api/media/crop`, and the React hook — drifting
9
+ * allowlists were the surface area Z2 had to chase down.
10
+ */
11
+ export declare const MEGABYTE: number;
12
+ export declare const MAX_IMAGE_BYTES: number;
13
+ export declare const MAX_PDF_BYTES: number;
14
+ export declare const MAX_VIDEO_BYTES: number;
15
+ export type MediaKind = "image" | "video" | "pdf";
16
+ export declare const MAX_LABEL: Record<MediaKind, string>;
17
+ export declare const MAX_BYTES: Record<MediaKind, number>;
18
+ export declare const ALLOWED_IMAGE_MIMES: readonly ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp"];
19
+ export declare const ALLOWED_VIDEO_MIMES: readonly ["video/mp4", "video/webm", "video/quicktime", "video/3gpp", "video/3gpp2", "video/x-matroska"];
20
+ export declare const ALLOWED_DOC_MIMES: readonly ["application/pdf"];
21
+ export declare const ALLOWED_MIMES: readonly ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp", "video/mp4", "video/webm", "video/quicktime", "video/3gpp", "video/3gpp2", "video/x-matroska", "application/pdf"];
22
+ export type AllowedImageMime = (typeof ALLOWED_IMAGE_MIMES)[number];
23
+ export type AllowedVideoMime = (typeof ALLOWED_VIDEO_MIMES)[number];
24
+ export type AllowedDocMime = (typeof ALLOWED_DOC_MIMES)[number];
25
+ export type AllowedMime = (typeof ALLOWED_MIMES)[number];
26
+ export declare const ALLOWED_TYPES_LABEL = "JPEG, PNG, GIF, WebP, MP4, WebM, QuickTime, 3GP, MKV, PDF";
27
+ export declare const MIME_TO_EXT: Record<string, string>;
28
+ export declare function classifyMime(mime: string): MediaKind | null;
29
+ export declare function isAllowedMime(mime: string): mime is AllowedMime;
30
+ export declare function maxBytesFor(mime: string): number | null;
31
+ export declare const PDF_MAGIC = "%PDF-";
32
+ export declare const VIDEO_CONVERSION_HINTS: Record<string, string>;
33
+ export declare function getConversionHint(mime: string): string | null;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Media upload limits — single source of truth for byte ceilings, MIME
3
+ * allowlists, and extension mapping. Shared between the signed-URL issuer,
4
+ * the finalize handler, the client upload hook, and any field-level
5
+ * pre-validation.
6
+ *
7
+ * Why centralised: previously these constants were duplicated across
8
+ * `/api/media/upload`, `/api/media/crop`, and the React hook — drifting
9
+ * allowlists were the surface area Z2 had to chase down.
10
+ */
11
+ export const MEGABYTE = 1024 * 1024;
12
+ export const MAX_IMAGE_BYTES = 10 * MEGABYTE;
13
+ export const MAX_PDF_BYTES = 20 * MEGABYTE;
14
+ export const MAX_VIDEO_BYTES = 50 * MEGABYTE;
15
+ export const MAX_LABEL = {
16
+ image: "10MB",
17
+ video: "50MB",
18
+ pdf: "20MB",
19
+ };
20
+ export const MAX_BYTES = {
21
+ image: MAX_IMAGE_BYTES,
22
+ video: MAX_VIDEO_BYTES,
23
+ pdf: MAX_PDF_BYTES,
24
+ };
25
+ // Image allowlist — kept conservative; SVG intentionally excluded (XSS surface).
26
+ export const ALLOWED_IMAGE_MIMES = [
27
+ "image/jpeg",
28
+ "image/jpg",
29
+ "image/png",
30
+ "image/gif",
31
+ "image/webp",
32
+ ];
33
+ // Video allowlist — Z2 widening: phone-camera 3GPP captures + Matroska container.
34
+ // `video/x-matroska` covers .mkv from desktop encoders; `video/3gpp` + `video/3gpp2`
35
+ // cover legacy Android/iOS camera output.
36
+ export const ALLOWED_VIDEO_MIMES = [
37
+ "video/mp4",
38
+ "video/webm",
39
+ "video/quicktime",
40
+ "video/3gpp",
41
+ "video/3gpp2",
42
+ "video/x-matroska",
43
+ ];
44
+ export const ALLOWED_DOC_MIMES = ["application/pdf"];
45
+ export const ALLOWED_MIMES = [
46
+ ...ALLOWED_IMAGE_MIMES,
47
+ ...ALLOWED_VIDEO_MIMES,
48
+ ...ALLOWED_DOC_MIMES,
49
+ ];
50
+ export const ALLOWED_TYPES_LABEL = "JPEG, PNG, GIF, WebP, MP4, WebM, QuickTime, 3GP, MKV, PDF";
51
+ // Server-detected MIME → canonical filename extension. The browser-supplied
52
+ // File.type is untrusted; the server picks the ext from the detected MIME.
53
+ export const MIME_TO_EXT = {
54
+ "image/jpeg": "jpg",
55
+ "image/jpg": "jpg",
56
+ "image/png": "png",
57
+ "image/gif": "gif",
58
+ "image/webp": "webp",
59
+ "video/mp4": "mp4",
60
+ "video/webm": "webm",
61
+ "video/quicktime": "mov",
62
+ "video/3gpp": "3gp",
63
+ "video/3gpp2": "3g2",
64
+ "video/x-matroska": "mkv",
65
+ "application/pdf": "pdf",
66
+ };
67
+ export function classifyMime(mime) {
68
+ if (ALLOWED_IMAGE_MIMES.includes(mime))
69
+ return "image";
70
+ if (ALLOWED_VIDEO_MIMES.includes(mime))
71
+ return "video";
72
+ if (ALLOWED_DOC_MIMES.includes(mime))
73
+ return "pdf";
74
+ return null;
75
+ }
76
+ export function isAllowedMime(mime) {
77
+ return ALLOWED_MIMES.includes(mime);
78
+ }
79
+ export function maxBytesFor(mime) {
80
+ const kind = classifyMime(mime);
81
+ return kind ? MAX_BYTES[kind] : null;
82
+ }
83
+ export const PDF_MAGIC = "%PDF-";
84
+ // Known-but-rejected video formats. Mapping returns a user-actionable
85
+ // conversion hint so the upload error can say "convert your .avi to .mp4"
86
+ // rather than the generic "invalid type" response.
87
+ export const VIDEO_CONVERSION_HINTS = {
88
+ "video/x-msvideo": "AVI is not supported — please convert to MP4 or WebM",
89
+ "video/avi": "AVI is not supported — please convert to MP4 or WebM",
90
+ "video/MP2T": "M2TS/TS streams are not supported — please convert to MP4",
91
+ "video/mp2t": "M2TS/TS streams are not supported — please convert to MP4",
92
+ "video/x-flv": "FLV is not supported — please convert to MP4",
93
+ "video/x-ms-wmv": "WMV is not supported — please convert to MP4",
94
+ };
95
+ export function getConversionHint(mime) {
96
+ return VIDEO_CONVERSION_HINTS[mime] ?? null;
97
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Firestore document schema versions — SB-UNI X3.
3
+ *
4
+ * Every persisted document type carries an optional `schemaVersion?: number`
5
+ * field. When absent, repositories default to v1. When out-of-date, the
6
+ * repository's per-feature `migrations.ts` runs the in-flight migration
7
+ * before returning the doc.
8
+ *
9
+ * This is Pattern 4 from the SB-UNI plan — a one-time tax that prevents
10
+ * future migration pain by giving every document a version handle.
11
+ *
12
+ * Adding a migration:
13
+ * 1. Bump the entry below (e.g. `product: 2`)
14
+ * 2. Add a `migrations.ts` row keyed `1: (doc) => migrateProductV1ToV2(doc)`
15
+ * 3. Repository handles the rest via `migrateDocument()`.
16
+ */
17
+ export declare const SCHEMA_VERSIONS: {
18
+ readonly address: 1;
19
+ readonly bid: 1;
20
+ readonly blogPost: 1;
21
+ readonly brand: 1;
22
+ readonly bundle: 1;
23
+ readonly carouselSlide: 1;
24
+ readonly cart: 1;
25
+ readonly cartItem: 1;
26
+ readonly category: 1;
27
+ readonly chatRoom: 1;
28
+ readonly contactSubmission: 1;
29
+ readonly conversation: 1;
30
+ readonly copilotLog: 1;
31
+ readonly coupon: 1;
32
+ readonly couponUsage: 1;
33
+ readonly emailVerificationToken: 1;
34
+ readonly event: 1;
35
+ readonly eventEntry: 1;
36
+ readonly faq: 1;
37
+ readonly groupedListing: 1;
38
+ readonly history: 1;
39
+ readonly newsletterSubscriber: 1;
40
+ readonly notification: 1;
41
+ readonly offer: 1;
42
+ readonly order: 1;
43
+ readonly passwordResetToken: 1;
44
+ readonly payout: 1;
45
+ readonly product: 1;
46
+ readonly productFeature: 1;
47
+ readonly productTemplate: 1;
48
+ readonly review: 1;
49
+ readonly scammer: 1;
50
+ readonly scammerComment: 1;
51
+ readonly scammerContest: 1;
52
+ readonly scammerIncident: 1;
53
+ readonly session: 1;
54
+ readonly siteSettings: 1;
55
+ readonly smsCounter: 1;
56
+ readonly store: 1;
57
+ readonly storeAddress: 1;
58
+ readonly sublistingCategory: 1;
59
+ readonly supportTicket: 1;
60
+ readonly user: 1;
61
+ readonly wishlist: 1;
62
+ };
63
+ export type SchemaCollection = keyof typeof SCHEMA_VERSIONS;
64
+ export interface SchemaVersioned {
65
+ schemaVersion?: number;
66
+ }
67
+ export type MigrationStep<T> = (doc: T) => T;
68
+ /**
69
+ * Migrate a document from its persisted `schemaVersion` to the current
70
+ * collection version. Passes through unchanged when the doc is already
71
+ * current, missing version (treated as v1), or no migrations are defined.
72
+ *
73
+ * Migrations is a map keyed by the FROM-version (e.g. `1: (doc) => v2(doc)`
74
+ * upgrades a v1 doc to v2). Multi-step migrations chain automatically.
75
+ */
76
+ export declare function migrateDocument<T extends SchemaVersioned>(doc: T, current: number, migrations: Record<number, MigrationStep<T>>): T;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Firestore document schema versions — SB-UNI X3.
3
+ *
4
+ * Every persisted document type carries an optional `schemaVersion?: number`
5
+ * field. When absent, repositories default to v1. When out-of-date, the
6
+ * repository's per-feature `migrations.ts` runs the in-flight migration
7
+ * before returning the doc.
8
+ *
9
+ * This is Pattern 4 from the SB-UNI plan — a one-time tax that prevents
10
+ * future migration pain by giving every document a version handle.
11
+ *
12
+ * Adding a migration:
13
+ * 1. Bump the entry below (e.g. `product: 2`)
14
+ * 2. Add a `migrations.ts` row keyed `1: (doc) => migrateProductV1ToV2(doc)`
15
+ * 3. Repository handles the rest via `migrateDocument()`.
16
+ */
17
+ export const SCHEMA_VERSIONS = {
18
+ address: 1,
19
+ bid: 1,
20
+ blogPost: 1,
21
+ brand: 1,
22
+ bundle: 1,
23
+ carouselSlide: 1,
24
+ cart: 1,
25
+ cartItem: 1,
26
+ category: 1,
27
+ chatRoom: 1,
28
+ contactSubmission: 1,
29
+ conversation: 1,
30
+ copilotLog: 1,
31
+ coupon: 1,
32
+ couponUsage: 1,
33
+ emailVerificationToken: 1,
34
+ event: 1,
35
+ eventEntry: 1,
36
+ faq: 1,
37
+ groupedListing: 1,
38
+ history: 1,
39
+ newsletterSubscriber: 1,
40
+ notification: 1,
41
+ offer: 1,
42
+ order: 1,
43
+ passwordResetToken: 1,
44
+ payout: 1,
45
+ product: 1,
46
+ productFeature: 1,
47
+ productTemplate: 1,
48
+ review: 1,
49
+ scammer: 1,
50
+ scammerComment: 1,
51
+ scammerContest: 1,
52
+ scammerIncident: 1,
53
+ session: 1,
54
+ siteSettings: 1,
55
+ smsCounter: 1,
56
+ store: 1,
57
+ storeAddress: 1,
58
+ sublistingCategory: 1,
59
+ supportTicket: 1,
60
+ user: 1,
61
+ wishlist: 1,
62
+ };
63
+ /**
64
+ * Migrate a document from its persisted `schemaVersion` to the current
65
+ * collection version. Passes through unchanged when the doc is already
66
+ * current, missing version (treated as v1), or no migrations are defined.
67
+ *
68
+ * Migrations is a map keyed by the FROM-version (e.g. `1: (doc) => v2(doc)`
69
+ * upgrades a v1 doc to v2). Multi-step migrations chain automatically.
70
+ */
71
+ export function migrateDocument(doc, current, migrations) {
72
+ let working = doc;
73
+ let version = doc.schemaVersion ?? 1;
74
+ while (version < current) {
75
+ const step = migrations[version];
76
+ if (!step)
77
+ break;
78
+ working = step(working);
79
+ version += 1;
80
+ }
81
+ return { ...working, schemaVersion: current };
82
+ }
package/dist/client.d.ts CHANGED
@@ -175,3 +175,12 @@ export type { GuestHistoryItem, GuestHistoryType, UserHistoryItem, HistoryProduc
175
175
  export type { TrackArgs as TrackHistoryArgs } from "./features/history/hooks/useHistory";
176
176
  export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
177
177
  export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, } from "./features/products/utils/listing-type";
178
+ export { DashboardLayoutClient, RoleGuard } from "./_internal/client/features/layout/index";
179
+ export type { DashboardLayoutClientProps, RoleGuardProps, } from "./_internal/client/features/layout/index";
180
+ export type { LayoutBreakpoint, DashboardVariant, LayoutRole, SidebarNavItem, SidebarNavGroup, MainNavItem as LayoutMainNavItem, BrandingConfig, FooterConfig, SectionResponsive, SectionTheming, LayoutConfig, DashboardLayoutConfig, } from "./_internal/shared/features/layout/index";
181
+ export { LISTING_TYPE_CAPABILITIES, capabilityFor, canAddToCart, canBid, supportsShipping, requiresVendorVerified, requiresJurisdictionCheck, hasInstantFulfillment, assertNever, } from "./_internal/shared/listing-types/capabilities";
182
+ export type { ListingTypeCapability } from "./_internal/shared/listing-types/capabilities";
183
+ export { LISTING_TYPE_REGISTRY, pluginFor } from "./_internal/shared/listing-types/_registry";
184
+ export type { ListingTypePlugin } from "./_internal/shared/listing-types/_registry";
185
+ export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, } from "./_internal/shared/media/limits";
186
+ export type { MediaKind, AllowedImageMime, AllowedVideoMime, AllowedDocMime, AllowedMime, } from "./_internal/shared/media/limits";
package/dist/client.js CHANGED
@@ -198,3 +198,10 @@ export { useHistory, useHistoryMergeOnLogin, getGuestHistory, trackGuestHistory,
198
198
  export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
199
199
  // SB1-G canonical listing-type accessors (pure functions, client-safe).
200
200
  export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, } from "./features/products/utils/listing-type";
201
+ // Layout feature — client islands (unifies admin/store/user dashboard layouts).
202
+ export { DashboardLayoutClient, RoleGuard } from "./_internal/client/features/layout/index";
203
+ // Listing-type capability registry — SB-UNI X1.
204
+ export { LISTING_TYPE_CAPABILITIES, capabilityFor, canAddToCart, canBid, supportsShipping, requiresVendorVerified, requiresJurisdictionCheck, hasInstantFulfillment, assertNever, } from "./_internal/shared/listing-types/capabilities";
205
+ export { LISTING_TYPE_REGISTRY, pluginFor } from "./_internal/shared/listing-types/_registry";
206
+ // Media upload limits — shared by client uploaders + server sign/finalize routes.
207
+ export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, } from "./_internal/shared/media/limits";
@@ -193,7 +193,8 @@ export declare const LOYALTY_ENDPOINTS: {
193
193
  };
194
194
  export declare const MEDIA_ENDPOINTS: {
195
195
  readonly BASE: "/api/media";
196
- readonly UPLOAD: "/api/media/upload";
196
+ readonly SIGN: "/api/media/sign";
197
+ readonly FINALIZE: "/api/media/finalize";
197
198
  readonly CROP: "/api/media/crop";
198
199
  readonly TRIM: "/api/media/trim";
199
200
  readonly DELETE: (url: string) => string;
@@ -468,7 +469,8 @@ export declare const API_ENDPOINTS: {
468
469
  };
469
470
  readonly MEDIA: {
470
471
  readonly BASE: "/api/media";
471
- readonly UPLOAD: "/api/media/upload";
472
+ readonly SIGN: "/api/media/sign";
473
+ readonly FINALIZE: "/api/media/finalize";
472
474
  readonly CROP: "/api/media/crop";
473
475
  readonly TRIM: "/api/media/trim";
474
476
  readonly DELETE: (url: string) => string;
@@ -742,7 +744,8 @@ export declare const API_ROUTES: {
742
744
  };
743
745
  readonly MEDIA: {
744
746
  readonly BASE: "/api/media";
745
- readonly UPLOAD: "/api/media/upload";
747
+ readonly SIGN: "/api/media/sign";
748
+ readonly FINALIZE: "/api/media/finalize";
746
749
  readonly CROP: "/api/media/crop";
747
750
  readonly TRIM: "/api/media/trim";
748
751
  readonly DELETE: (url: string) => string;
@@ -259,7 +259,8 @@ export const LOYALTY_ENDPOINTS = {
259
259
  // ---------------------------------------------------------------------------
260
260
  export const MEDIA_ENDPOINTS = {
261
261
  BASE: "/api/media",
262
- UPLOAD: "/api/media/upload",
262
+ SIGN: "/api/media/sign",
263
+ FINALIZE: "/api/media/finalize",
263
264
  CROP: "/api/media/crop",
264
265
  TRIM: "/api/media/trim",
265
266
  DELETE: (url) => `/api/media?url=${encodeURIComponent(url)}`,
@@ -398,7 +398,7 @@ export declare const ERROR_MESSAGES: {
398
398
  readonly CART_POST_ERROR: "POST /api/cart error:";
399
399
  readonly CART_ITEM_PATCH_ERROR: "error:";
400
400
  readonly CART_ITEM_DELETE_ERROR: "error:";
401
- readonly MEDIA_UPLOAD_ERROR: "POST /api/media/upload error:";
401
+ readonly MEDIA_UPLOAD_ERROR: "Media upload (sign+PUT+finalize) error:";
402
402
  readonly MEDIA_TRIM_ERROR: "POST /api/media/trim error:";
403
403
  readonly MEDIA_CROP_ERROR: "POST /api/media/crop error:";
404
404
  readonly PROFILE_UPDATE_ERROR: "Profile update error:";
@@ -426,7 +426,7 @@ export const ERROR_MESSAGES = {
426
426
  CART_POST_ERROR: "POST /api/cart error:",
427
427
  CART_ITEM_PATCH_ERROR: "error:", // Template: `PATCH /api/cart/${itemId} error:`
428
428
  CART_ITEM_DELETE_ERROR: "error:", // Template: `DELETE /api/cart/${itemId} error:`
429
- MEDIA_UPLOAD_ERROR: "POST /api/media/upload error:",
429
+ MEDIA_UPLOAD_ERROR: "Media upload (sign+PUT+finalize) error:",
430
430
  MEDIA_TRIM_ERROR: "POST /api/media/trim error:",
431
431
  MEDIA_CROP_ERROR: "POST /api/media/crop error:",
432
432
  PROFILE_UPDATE_ERROR: "Profile update error:",
@@ -0,0 +1,2 @@
1
+ import type { MigrationStep } from "../../_internal/shared/schema-versions";
2
+ export declare const migrations: Record<number, MigrationStep<any>>;
@@ -0,0 +1,10 @@
1
+ // SB-UNI X3 — migrations shell for address.
2
+ // v1 schema is current; no migrations needed yet.
3
+ //
4
+ // To add a migration:
5
+ // 1. Bump the relevant SCHEMA_VERSIONS entry in
6
+ // `_internal/shared/schema-versions.ts` (e.g. `account: 2`)
7
+ // 2. Add a row below keyed by the FROM-version, returning the upgraded doc
8
+ // 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export const migrations = {};
@@ -113,7 +113,7 @@ export function AdminMediaView({ labels = {}, children, ...rest }) {
113
113
  _jsx(Alert, { variant: "info", title: "Media Library", children: "Upload new files in the sandbox below, or browse the existing Storage bucket via the grid." }, "media-info"),
114
114
  _jsx(MediaBrowser, { onCopy: copyToClipboard }, "media-browser"),
115
115
  operationMessage ? (_jsx(Alert, { variant: operationMessage.startsWith("Failed") || operationMessage.startsWith("Some") || operationMessage.startsWith("Could") ? "error" : "success", title: "Media", children: operationMessage }, "media-op-message")) : null,
116
- _jsxs(Div, { className: "space-y-5 rounded-xl border border-zinc-200 bg-white p-4 dark:border-slate-700 dark:bg-slate-900", children: [_jsx(Text, { className: "text-sm font-semibold text-zinc-900 dark:text-zinc-100", children: "Upload & Copy URL" }), _jsx(MediaUploadField, { label: "Primary media asset", value: heroAssetUrl, onChange: setHeroAssetUrl, onUpload: onUpload, helperText: "Uploads to /api/media/upload and previews the returned URL.", onAbort: handleAbort, onStagedUrlsChange: setStagedUrls }), heroAssetUrl && (_jsxs(Div, { className: "flex items-center gap-2 rounded-lg bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 px-3 py-2", children: [_jsx(Text, { className: "flex-1 truncate text-xs text-zinc-600 dark:text-zinc-400 font-mono", children: heroAssetUrl }), _jsx(Button, { type: "button", variant: "outline", onClick: () => copyToClipboard(heroAssetUrl), children: copiedUrl === heroAssetUrl ? "Copied!" : "Copy URL" })] })), _jsx(MediaUploadList, { label: "Gallery assets", value: galleryAssets, onChange: setGalleryAssets, onUpload: onUpload, helperText: "Attach multiple images or videos for batch checks.", onAbort: handleAbort, onStagedUrlsChange: setStagedUrls, maxItems: 12 }), galleryAssets.length > 0 && (_jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 font-medium", children: "Gallery URLs" }), galleryAssets.map((asset, i) => (_jsxs(Div, { className: "flex items-center gap-2 rounded bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 px-2 py-1", children: [_jsx(Text, { className: "flex-1 truncate text-xs text-zinc-600 dark:text-zinc-400 font-mono", children: asset.url }), _jsx(Button, { type: "button", variant: "ghost", onClick: () => copyToClipboard(asset.url), children: copiedUrl === asset.url ? "Copied!" : "Copy" })] }, i)))] })), _jsxs(Div, { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => {
116
+ _jsxs(Div, { className: "space-y-5 rounded-xl border border-zinc-200 bg-white p-4 dark:border-slate-700 dark:bg-slate-900", children: [_jsx(Text, { className: "text-sm font-semibold text-zinc-900 dark:text-zinc-100", children: "Upload & Copy URL" }), _jsx(MediaUploadField, { label: "Primary media asset", value: heroAssetUrl, onChange: setHeroAssetUrl, onUpload: onUpload, helperText: "Uploads via signed URL (sign \u2192 PUT \u2192 finalize) and previews the returned URL.", onAbort: handleAbort, onStagedUrlsChange: setStagedUrls }), heroAssetUrl && (_jsxs(Div, { className: "flex items-center gap-2 rounded-lg bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 px-3 py-2", children: [_jsx(Text, { className: "flex-1 truncate text-xs text-zinc-600 dark:text-zinc-400 font-mono", children: heroAssetUrl }), _jsx(Button, { type: "button", variant: "outline", onClick: () => copyToClipboard(heroAssetUrl), children: copiedUrl === heroAssetUrl ? "Copied!" : "Copy URL" })] })), _jsx(MediaUploadList, { label: "Gallery assets", value: galleryAssets, onChange: setGalleryAssets, onUpload: onUpload, helperText: "Attach multiple images or videos for batch checks.", onAbort: handleAbort, onStagedUrlsChange: setStagedUrls, maxItems: 12 }), galleryAssets.length > 0 && (_jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 font-medium", children: "Gallery URLs" }), galleryAssets.map((asset, i) => (_jsxs(Div, { className: "flex items-center gap-2 rounded bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 px-2 py-1", children: [_jsx(Text, { className: "flex-1 truncate text-xs text-zinc-600 dark:text-zinc-400 font-mono", children: asset.url }), _jsx(Button, { type: "button", variant: "ghost", onClick: () => copyToClipboard(asset.url), children: copiedUrl === asset.url ? "Copied!" : "Copy" })] }, i)))] })), _jsxs(Div, { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => {
117
117
  setHeroAssetUrl("");
118
118
  setGalleryAssets([]);
119
119
  }, disabled: isUploadPending || isCleanupPending, children: "Clear previews" }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
@@ -21,7 +21,7 @@ const SORT_OPTIONS = [
21
21
  { value: "-price", label: "Highest price" },
22
22
  ];
23
23
  const STATUS_OPTIONS = ["All", "pending", "published", "draft", "archived"];
24
- const TYPE_OPTIONS = ["All", "Products", "Auctions", "Pre-orders"];
24
+ const TYPE_OPTIONS = ["All", "Products", "Auctions", "Pre-orders", "Prize Draws"];
25
25
  const FLAG_DEFS = [
26
26
  { key: "featured", label: "Featured" },
27
27
  { key: "isPromoted", label: "Promoted" },
@@ -94,9 +94,13 @@ export function AdminProductsView({ children, actionHref, getRowHref, ...props }
94
94
  const typeRaw = table.get("type");
95
95
  if (typeRaw && typeRaw !== "All") {
96
96
  if (typeRaw === "Auctions")
97
- filterParts.push("isAuction==true");
97
+ filterParts.push("listingType==auction");
98
98
  else if (typeRaw === "Pre-orders")
99
- filterParts.push("isPreOrder==true");
99
+ filterParts.push("listingType==pre-order");
100
+ else if (typeRaw === "Prize Draws")
101
+ filterParts.push("listingType==prize-draw");
102
+ else if (typeRaw === "Products")
103
+ filterParts.push("listingType==standard");
100
104
  }
101
105
  const filters = filterParts.join(",") || undefined;
102
106
  const { rows: fetchedRows, total, isLoading, errorMessage } = useAdminListingData({
@@ -0,0 +1,2 @@
1
+ import type { MigrationStep } from "../../_internal/shared/schema-versions";
2
+ export declare const migrations: Record<number, MigrationStep<any>>;
@@ -0,0 +1,10 @@
1
+ // SB-UNI X3 — migrations shell for notification/chatRoom/siteSettings.
2
+ // v1 schema is current; no migrations needed yet.
3
+ //
4
+ // To add a migration:
5
+ // 1. Bump the relevant SCHEMA_VERSIONS entry in
6
+ // `_internal/shared/schema-versions.ts` (e.g. `admin: 2`)
7
+ // 2. Add a row below keyed by the FROM-version, returning the upgraded doc
8
+ // 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export const migrations = {};
@@ -48,7 +48,7 @@ export interface AdminProduct {
48
48
  insuranceCost?: number;
49
49
  shippingPaidBy?: "seller" | "buyer";
50
50
  /** Canonical listing-kind discriminator (SB1-G Phase 4 — booleans removed). */
51
- listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
51
+ listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
52
52
  auctionEndDate?: string;
53
53
  startingBid?: number;
54
54
  currentBid?: number;
@@ -12,7 +12,7 @@ export interface MarketplaceAuctionCardData {
12
12
  thumbnailUrl?: string;
13
13
  };
14
14
  /** Canonical discriminator (SB1-G Phase 4). */
15
- listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
15
+ listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
16
16
  auctionEndDate?: string | Date;
17
17
  startingBid?: number;
18
18
  currentBid?: number;
@@ -0,0 +1,2 @@
1
+ import type { MigrationStep } from "../../_internal/shared/schema-versions";
2
+ export declare const migrations: Record<number, MigrationStep<any>>;
@@ -0,0 +1,10 @@
1
+ // SB-UNI X3 — migrations shell for bid.
2
+ // v1 schema is current; no migrations needed yet.
3
+ //
4
+ // To add a migration:
5
+ // 1. Bump the relevant SCHEMA_VERSIONS entry in
6
+ // `_internal/shared/schema-versions.ts` (e.g. `auctions: 2`)
7
+ // 2. Add a row below keyed by the FROM-version, returning the upgraded doc
8
+ // 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export const migrations = {};