@mohasinac/appkit 2.7.11 → 2.7.13

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 (152) hide show
  1. package/dist/_internal/server/jobs/core/assignSpinPrize.js +8 -7
  2. package/dist/_internal/server/jobs/core/bundleStockSync.js +17 -20
  3. package/dist/_internal/server/jobs/core/countersReconcile.js +3 -2
  4. package/dist/_internal/server/jobs/core/onProductStockChange.js +18 -20
  5. package/dist/_internal/server/jobs/core/onProductWrite.js +3 -2
  6. package/dist/_internal/server/jobs/core/prizeRevealClose.js +7 -5
  7. package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +11 -6
  8. package/dist/_internal/server/jobs/core/prizeRevealOpen.js +13 -7
  9. package/dist/_internal/server/jobs/core/prizeRevealReminder.js +9 -4
  10. package/dist/_internal/server/jobs/core/triggerEventRaffle.js +3 -2
  11. package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
  12. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +3 -6
  13. package/dist/_internal/shared/features/categories/bundle-copy.js +3 -6
  14. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +32 -32
  15. package/dist/_internal/shared/features/events/schema.d.ts +4 -4
  16. package/dist/_internal/shared/features/products/schema.d.ts +20 -20
  17. package/dist/_internal/shared/features/promotions/schema.d.ts +2 -2
  18. package/dist/_internal/shared/features/reviews/schema.d.ts +1 -1
  19. package/dist/constants/field-names.d.ts +824 -0
  20. package/dist/constants/field-names.js +929 -0
  21. package/dist/constants/sort.d.ts +7 -0
  22. package/dist/constants/sort.js +5 -0
  23. package/dist/constants/table-keys.d.ts +48 -0
  24. package/dist/constants/table-keys.js +46 -0
  25. package/dist/features/account/components/AddressesIndexListing.js +9 -6
  26. package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -1
  27. package/dist/features/admin/components/AdminBidsView.js +4 -1
  28. package/dist/features/admin/components/AdminBlogView.js +9 -2
  29. package/dist/features/admin/components/AdminBrandsView.js +9 -2
  30. package/dist/features/admin/components/AdminBundlesView.js +0 -1
  31. package/dist/features/admin/components/AdminCarouselView.js +4 -1
  32. package/dist/features/admin/components/AdminCartsView.js +4 -1
  33. package/dist/features/admin/components/AdminCategoriesView.js +9 -2
  34. package/dist/features/admin/components/AdminContactView.js +4 -1
  35. package/dist/features/admin/components/AdminCouponsView.js +4 -1
  36. package/dist/features/admin/components/AdminFaqsView.js +5 -1
  37. package/dist/features/admin/components/AdminFeaturesView.js +5 -2
  38. package/dist/features/admin/components/AdminHistoryView.js +5 -1
  39. package/dist/features/admin/components/AdminNewsletterView.js +4 -1
  40. package/dist/features/admin/components/AdminNotificationsView.js +4 -1
  41. package/dist/features/admin/components/AdminOrdersView.js +14 -12
  42. package/dist/features/admin/components/AdminPayoutsView.js +4 -1
  43. package/dist/features/admin/components/AdminPrizeDrawsView.js +4 -1
  44. package/dist/features/admin/components/AdminProductsView.js +14 -3
  45. package/dist/features/admin/components/AdminReturnRequestsView.js +4 -1
  46. package/dist/features/admin/components/AdminReviewsView.js +4 -1
  47. package/dist/features/admin/components/AdminScammersView.js +4 -1
  48. package/dist/features/admin/components/AdminSessionsView.js +4 -1
  49. package/dist/features/admin/components/AdminStoreAddressesView.js +5 -1
  50. package/dist/features/admin/components/AdminStoresView.js +10 -3
  51. package/dist/features/admin/components/AdminSublistingCategoriesView.js +4 -1
  52. package/dist/features/admin/components/AdminSupportTicketsView.js +4 -1
  53. package/dist/features/admin/components/AdminTeamView.js +4 -1
  54. package/dist/features/admin/components/AdminUsersView.js +9 -12
  55. package/dist/features/admin/components/AdminViewCards.d.ts +12 -0
  56. package/dist/features/admin/components/AdminViewCards.js +53 -0
  57. package/dist/features/admin/components/AdminWishlistsView.js +4 -1
  58. package/dist/features/auctions/repository/bid.repository.js +1 -6
  59. package/dist/features/auctions/schemas/index.d.ts +4 -4
  60. package/dist/features/blog/actions/blog-actions.d.ts +16 -16
  61. package/dist/features/blog/components/BlogFilters.d.ts +28 -28
  62. package/dist/features/blog/components/BlogFilters.js +18 -15
  63. package/dist/features/blog/components/BlogIndexListing.js +20 -16
  64. package/dist/features/blog/schemas/index.d.ts +10 -10
  65. package/dist/features/categories/components/BundleDetailView.js +0 -1
  66. package/dist/features/categories/components/CategoriesIndexListing.js +25 -21
  67. package/dist/features/categories/components/CategoryBundlesListing.js +2 -4
  68. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  69. package/dist/features/categories/schemas/index.d.ts +2 -2
  70. package/dist/features/events/components/AdminEventsView.js +5 -1
  71. package/dist/features/events/components/EventFilters.d.ts +24 -24
  72. package/dist/features/events/components/EventFilters.js +16 -13
  73. package/dist/features/events/components/EventStatusBadge.js +1 -0
  74. package/dist/features/events/components/EventsIndexListing.js +31 -26
  75. package/dist/features/events/components/EventsListPageView.js +13 -10
  76. package/dist/features/events/schemas/firestore.d.ts +1 -0
  77. package/dist/features/events/schemas/firestore.js +1 -0
  78. package/dist/features/events/schemas/index.d.ts +1 -1
  79. package/dist/features/events/types/index.d.ts +1 -1
  80. package/dist/features/faq/actions/faq-actions.d.ts +10 -10
  81. package/dist/features/faq/schemas/index.d.ts +4 -4
  82. package/dist/features/homepage/components/FeaturedBundlesSection.js +1 -3
  83. package/dist/features/orders/components/OrderFilters.d.ts +20 -20
  84. package/dist/features/orders/components/OrderFilters.js +33 -30
  85. package/dist/features/orders/repository/orders.repository.js +1 -15
  86. package/dist/features/orders/schemas/index.d.ts +2 -2
  87. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +35 -31
  88. package/dist/features/pre-orders/repository/preorders.repository.js +8 -4
  89. package/dist/features/pre-orders/schemas/index.d.ts +3 -3
  90. package/dist/features/products/components/AuctionsIndexListing.js +34 -30
  91. package/dist/features/products/components/BidHistory.d.ts +0 -1
  92. package/dist/features/products/components/BidHistory.js +1 -1
  93. package/dist/features/products/components/PrizeDrawsIndexListing.js +44 -40
  94. package/dist/features/products/components/ProductDetailPageView.js +1 -1
  95. package/dist/features/products/components/ProductFilters.d.ts +20 -20
  96. package/dist/features/products/components/ProductFilters.js +62 -59
  97. package/dist/features/products/components/ProductsIndexListing.js +28 -24
  98. package/dist/features/products/components/ProductsIndexPageView.js +18 -10
  99. package/dist/features/products/hooks/useProducts.js +2 -0
  100. package/dist/features/products/repository/products.repository.js +2 -22
  101. package/dist/features/products/schemas/index.d.ts +28 -28
  102. package/dist/features/products/schemas/product-features.validators.d.ts +12 -12
  103. package/dist/features/products/types/index.d.ts +2 -0
  104. package/dist/features/promotions/components/CouponsIndexListing.js +57 -32
  105. package/dist/features/promotions/schemas/index.d.ts +4 -4
  106. package/dist/features/reviews/components/ReviewDetailShell.js +6 -5
  107. package/dist/features/reviews/components/ReviewFilters.d.ts +16 -16
  108. package/dist/features/reviews/components/ReviewFilters.js +10 -7
  109. package/dist/features/reviews/components/ReviewsIndexListing.js +21 -17
  110. package/dist/features/reviews/components/ReviewsList.d.ts +5 -2
  111. package/dist/features/reviews/components/ReviewsList.js +11 -5
  112. package/dist/features/reviews/schemas/firestore.d.ts +1 -0
  113. package/dist/features/reviews/schemas/index.d.ts +8 -8
  114. package/dist/features/reviews/types/index.d.ts +1 -0
  115. package/dist/features/search/schemas/index.d.ts +2 -2
  116. package/dist/features/seller/components/SellerAuctionsView.js +5 -1
  117. package/dist/features/seller/components/SellerBidsView.js +4 -1
  118. package/dist/features/seller/components/SellerCouponsView.js +4 -1
  119. package/dist/features/seller/components/SellerOffersView.js +5 -1
  120. package/dist/features/seller/components/SellerOrdersView.js +4 -1
  121. package/dist/features/seller/components/SellerPayoutsView.js +5 -1
  122. package/dist/features/seller/components/SellerPreOrdersView.js +4 -1
  123. package/dist/features/seller/components/SellerPrizeDrawsView.js +4 -1
  124. package/dist/features/seller/components/SellerProductsView.js +4 -1
  125. package/dist/features/seller/schemas/index.d.ts +12 -12
  126. package/dist/features/stores/api/route.js +10 -1
  127. package/dist/features/stores/components/StoreReviewsListing.js +1 -1
  128. package/dist/features/stores/components/StoresIndexListing.js +24 -20
  129. package/dist/features/stores/repository/stores.repository.js +8 -5
  130. package/dist/features/stores/schemas/firestore.d.ts +1 -0
  131. package/dist/features/stores/schemas/index.d.ts +4 -4
  132. package/dist/index.d.ts +8 -1
  133. package/dist/index.js +12 -1
  134. package/dist/providers/firebase-client/auth.d.ts +7 -0
  135. package/dist/providers/firebase-client/auth.js +15 -8
  136. package/dist/react/hooks/useUrlTable.js +2 -1
  137. package/dist/seed/bids-seed-data.js +45 -44
  138. package/dist/seed/categories-seed-data.js +41 -40
  139. package/dist/seed/coupons-seed-data.js +41 -40
  140. package/dist/seed/products-auctions-seed-data.js +54 -53
  141. package/dist/seed/products-preorders-seed-data.js +25 -24
  142. package/dist/seed/products-prize-draws-seed-data.js +24 -23
  143. package/dist/seed/products-standard-seed-data.js +294 -293
  144. package/dist/seed/reviews-seed-data.js +61 -60
  145. package/dist/seed/scammers-seed-data.js +3 -2
  146. package/dist/seed/stores-seed-data.js +9 -8
  147. package/dist/seed/support-tickets-seed-data.js +13 -12
  148. package/dist/seed/users-seed-data.js +28 -27
  149. package/dist/tailwind-utilities.css +1 -1
  150. package/dist/utils/sieve-builder.d.ts +41 -0
  151. package/dist/utils/sieve-builder.js +66 -0
  152. package/package.json +2 -2
@@ -9,23 +9,27 @@ import { ROUTES } from "../../../next";
9
9
  import { InteractiveStoreCard } from "./InteractiveStoreCard";
10
10
  import { StoreFilters } from "./StoreFilters";
11
11
  import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
12
+ import { TABLE_KEYS, VIEW_MODE } from "../../../constants/table-keys";
13
+ import { sortBy } from "../../../constants/sort";
14
+ import { STORE_FIELDS } from "../../../constants/field-names";
15
+ const DEFAULT_SORT = sortBy(STORE_FIELDS.CREATED_AT);
12
16
  const STORE_SORT_OPTIONS = [
13
- { value: "-createdAt", label: "Newest First" },
14
- { value: "storeName", label: "Name A–Z" },
17
+ { value: sortBy(STORE_FIELDS.CREATED_AT), label: "Newest First" },
18
+ { value: sortBy(STORE_FIELDS.STORE_NAME, "ASC"), label: "Name A–Z" },
15
19
  { value: "-itemsSold", label: "Most Sales" },
16
20
  { value: "-averageRating", label: "Top Rated" },
17
21
  ];
18
- const FILTER_KEYS = ["category", "rating", "minProductCount", "maxProductCount", "featured"];
22
+ const FILTER_KEYS = [TABLE_KEYS.CATEGORY, "rating", "minProductCount", "maxProductCount", TABLE_KEYS.FEATURED];
19
23
  export function StoresIndexListing({ initialData }) {
20
- const table = useUrlTable({ defaults: { pageSize: "24", sort: "-createdAt" } });
21
- const [searchInput, setSearchInput] = useState(table.get("q") || "");
24
+ const table = useUrlTable({ defaults: { pageSize: "24", sort: DEFAULT_SORT } });
25
+ const [searchInput, setSearchInput] = useState(table.get(TABLE_KEYS.QUERY) || "");
22
26
  const [filterOpen, setFilterOpen] = useState(false);
23
- const [view, setView] = useState(table.get("view") || "grid");
27
+ const [view, setView] = useState(table.get(TABLE_KEYS.VIEW) || VIEW_MODE.GRID);
24
28
  const handleViewToggle = (next) => {
25
- if (next === "table")
29
+ if (next === VIEW_MODE.TABLE)
26
30
  return;
27
31
  setView(next);
28
- table.set("view", next);
32
+ table.set(TABLE_KEYS.VIEW, next);
29
33
  };
30
34
  // Pending filter state — buffered until "Apply Filters" clicked
31
35
  const [pendingFilters, setPendingFilters] = useState(() => Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
@@ -69,24 +73,24 @@ export function StoresIndexListing({ initialData }) {
69
73
  setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, ""])));
70
74
  }, []);
71
75
  const resetAll = useCallback(() => {
72
- const updates = { q: "", sort: "" };
76
+ const updates = { [TABLE_KEYS.QUERY]: "", [TABLE_KEYS.SORT]: "" };
73
77
  for (const k of FILTER_KEYS)
74
78
  updates[k] = "";
75
79
  table.setMany(updates);
76
80
  setSearchInput("");
77
81
  }, [table]);
78
82
  const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
79
- const hasActiveState = !!table.get("q") ||
80
- table.get("sort") !== "-createdAt" ||
83
+ const hasActiveState = !!table.get(TABLE_KEYS.QUERY) ||
84
+ table.get(TABLE_KEYS.SORT) !== DEFAULT_SORT ||
81
85
  activeFilterCount > 0;
82
86
  const commitSearch = useCallback(() => {
83
- table.set("q", searchInput.trim());
87
+ table.set(TABLE_KEYS.QUERY, searchInput.trim());
84
88
  }, [searchInput, table]);
85
89
  // Build sieve filters from applied URL params
86
- const ratingRaw = table.get("rating");
90
+ const ratingRaw = table.get(TABLE_KEYS.RATING);
87
91
  const minProductCount = table.get("minProductCount");
88
92
  const maxProductCount = table.get("maxProductCount");
89
- const featured = table.get("featured");
93
+ const featured = table.get(TABLE_KEYS.FEATURED);
90
94
  const filterParts = [];
91
95
  if (ratingRaw) {
92
96
  const ratings = ratingRaw.split("|").filter(Boolean);
@@ -100,15 +104,15 @@ export function StoresIndexListing({ initialData }) {
100
104
  if (featured === "true")
101
105
  filterParts.push("isFeatured==true");
102
106
  const { stores, totalPages, isLoading } = useStores({
103
- q: table.get("q") || undefined,
104
- page: table.getNumber("page", 1),
105
- pageSize: table.getNumber("pageSize", 24),
106
- sort: table.get("sort") || undefined,
107
- category: table.get("category") || undefined,
107
+ q: table.get(TABLE_KEYS.QUERY) || undefined,
108
+ page: table.getNumber(TABLE_KEYS.PAGE, 1),
109
+ pageSize: table.getNumber(TABLE_KEYS.PAGE_SIZE, 24),
110
+ sort: table.get(TABLE_KEYS.SORT) || undefined,
111
+ category: table.get(TABLE_KEYS.CATEGORY) || undefined,
108
112
  filters: filterParts.length > 0 ? filterParts.join(",") : undefined,
109
113
  }, { initialData });
110
114
  const selection = useBulkSelection({ items: stores, keyExtractor: (s) => s.id ?? s.storeSlug });
111
- return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search stores...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || "-createdAt", sortOptions: STORE_SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, view: view, onViewChange: handleViewToggle, onResetAll: resetAll, hasActiveState: hasActiveState, bulkMode: selection.isSelecting, bulkSelectedCount: selection.selectedCount, bulkTotalCount: stores.length, onBulkSelectAll: selection.toggleAll, onBulkClear: selection.clearSelection }), _jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
115
+ return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search stores...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get(TABLE_KEYS.SORT) || DEFAULT_SORT, sortOptions: STORE_SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, view: view, onViewChange: handleViewToggle, onResetAll: resetAll, hasActiveState: hasActiveState, bulkMode: selection.isSelecting, bulkSelectedCount: selection.selectedCount, bulkTotalCount: stores.length, onBulkSelectAll: selection.toggleAll, onBulkClear: selection.clearSelection }), _jsx(BulkActionBar, { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: [
112
116
  {
113
117
  id: "compare",
114
118
  label: "Compare",
@@ -1,3 +1,6 @@
1
+ import { STORE_FIELDS } from "../../../constants/field-names";
2
+ const { STATUS, IS_PUBLIC, STORE_SLUG, STORE_CATEGORY, STATS_FIELDS } = STORE_FIELDS;
3
+ const { ACTIVE } = STORE_FIELDS.STATUS_VALUES;
1
4
  export class StoresRepository {
2
5
  constructor(repo) {
3
6
  this.repo = repo;
@@ -10,23 +13,23 @@ export class StoresRepository {
10
13
  }
11
14
  async findBySlug(storeSlug) {
12
15
  const result = await this.repo.findAll({
13
- filters: `storeSlug==${storeSlug},status==active`,
16
+ filters: `${STORE_SLUG}==${storeSlug},${STATUS}==${ACTIVE}`,
14
17
  perPage: 1,
15
18
  });
16
19
  return result.data[0] ?? null;
17
20
  }
18
21
  async findActive(page = 1, perPage = 20) {
19
22
  return this.repo.findAll({
20
- filters: "status==active,isPublic==true",
21
- sort: "-itemsSold",
23
+ filters: `${STATUS}==${ACTIVE},${IS_PUBLIC}==true`,
24
+ sort: `-${STATS_FIELDS.ITEMS_SOLD}`,
22
25
  page,
23
26
  perPage,
24
27
  });
25
28
  }
26
29
  async findByCategory(category, page = 1, perPage = 20) {
27
30
  return this.repo.findAll({
28
- filters: `storeCategory==${category},status==active`,
29
- sort: "-averageRating",
31
+ filters: `${STORE_CATEGORY}==${category},${STATUS}==${ACTIVE}`,
32
+ sort: `-${STATS_FIELDS.AVERAGE_RATING}`,
30
33
  page,
31
34
  perPage,
32
35
  });
@@ -68,6 +68,7 @@ export interface StoreDocument {
68
68
  returnPolicy?: string;
69
69
  shippingPolicy?: string;
70
70
  isPublic: boolean;
71
+ isFeatured?: boolean;
71
72
  isVacationMode?: boolean;
72
73
  vacationMessage?: string;
73
74
  stats?: {
@@ -34,14 +34,14 @@ export declare const storeListItemSchema: z.ZodObject<{
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  id: string;
36
36
  status: string;
37
- isPublic: boolean;
38
37
  storeName: string;
38
+ isPublic: boolean;
39
39
  storeSlug: string;
40
40
  ownerId: string;
41
41
  createdAt?: string | undefined;
42
42
  itemsSold?: number | undefined;
43
- storeDescription?: string | undefined;
44
43
  storeCategory?: string | undefined;
44
+ storeDescription?: string | undefined;
45
45
  storeLogoURL?: string | undefined;
46
46
  storeBannerURL?: string | undefined;
47
47
  totalProducts?: number | undefined;
@@ -50,14 +50,14 @@ export declare const storeListItemSchema: z.ZodObject<{
50
50
  }, {
51
51
  id: string;
52
52
  status: string;
53
- isPublic: boolean;
54
53
  storeName: string;
54
+ isPublic: boolean;
55
55
  storeSlug: string;
56
56
  ownerId: string;
57
57
  createdAt?: string | undefined;
58
58
  itemsSold?: number | undefined;
59
- storeDescription?: string | undefined;
60
59
  storeCategory?: string | undefined;
60
+ storeDescription?: string | undefined;
61
61
  storeLogoURL?: string | undefined;
62
62
  storeBannerURL?: string | undefined;
63
63
  totalProducts?: number | undefined;
package/dist/index.d.ts CHANGED
@@ -528,7 +528,7 @@ export { storeRepository } from "./repositories/index";
528
528
  export { scammerRepository } from "./repositories/index";
529
529
  export { supportRepository, SupportRepository } from "./repositories/index";
530
530
  export type { SupportTicketDocument, SupportTicketCreateInput, SupportTicketUpdateInput, TicketMessage, TicketCategory, TicketStatus, TicketPriority, } from "./repositories/index";
531
- export { ELIGIBLE_ORDER_STATUSES_FOR_TICKET, SUPPORT_TICKET_COLLECTION, ACTIVE_TICKET_STATUSES, TicketCategoryValues, TicketStatusValues, TicketPriorityValues, } from "./features/support/schemas/firestore";
531
+ export { ELIGIBLE_ORDER_STATUSES_FOR_TICKET, SUPPORT_TICKET_COLLECTION, ACTIVE_TICKET_STATUSES, SUPPORT_TICKET_FIELDS, TicketCategoryValues, TicketStatusValues, TicketPriorityValues, } from "./features/support/schemas/firestore";
532
532
  export { supportTicketsSeedData } from "./seed/index";
533
533
  export { productFeaturesRepository } from "./repositories/index";
534
534
  export type { ProductFeatureListFilter } from "./repositories/index";
@@ -3047,3 +3047,10 @@ export { getListingRule, getCategoryRule, pickOrderType, getSplitKey, runSyncPre
3047
3047
  export type { ListingCheckoutRule, CategoryCheckoutRule, CartItemProductPair, OrderItemInput, RefundPolicy, } from "./_internal/shared/checkout/rules";
3048
3048
  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";
3049
3049
  export type { MediaKind, AllowedImageMime, AllowedVideoMime, AllowedDocMime, AllowedMime, } from "./_internal/shared/media/limits";
3050
+ export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, BLOG_FIELDS, BRAND_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, COUPON_USAGE_FIELDS, CONVERSATION_FIELDS, CAROUSEL_FIELDS, FAQ_FIELDS, HOMEPAGE_SECTION_FIELDS, SITE_SETTINGS_FIELDS, COMMON_FIELDS, OAUTH_STATE_VALUES, SCHEMA_DEFAULTS, } from "./constants/field-names";
3051
+ export { SORT_DIR, sortBy } from "./constants/sort";
3052
+ export type { SortDirection } from "./constants/sort";
3053
+ export { TABLE_KEYS, VIEW_MODE } from "./constants/table-keys";
3054
+ export type { TableKey, ViewMode } from "./constants/table-keys";
3055
+ export { SIEVE_OP, SIEVE_PIPE_OPS, sieveFilter, sieveMultiEq, expandSieveParam, sieveAnd, } from "./utils/sieve-builder";
3056
+ export type { SieveOp } from "./utils/sieve-builder";
package/dist/index.js CHANGED
@@ -1084,7 +1084,7 @@ export { storeRepository } from "./repositories/index";
1084
1084
  export { scammerRepository } from "./repositories/index";
1085
1085
  // supportRepository - Server-only repository for support tickets (BAN1).
1086
1086
  export { supportRepository, SupportRepository } from "./repositories/index";
1087
- export { ELIGIBLE_ORDER_STATUSES_FOR_TICKET, SUPPORT_TICKET_COLLECTION, ACTIVE_TICKET_STATUSES, TicketCategoryValues, TicketStatusValues, TicketPriorityValues, } from "./features/support/schemas/firestore";
1087
+ export { ELIGIBLE_ORDER_STATUSES_FOR_TICKET, SUPPORT_TICKET_COLLECTION, ACTIVE_TICKET_STATUSES, SUPPORT_TICKET_FIELDS, TicketCategoryValues, TicketStatusValues, TicketPriorityValues, } from "./features/support/schemas/firestore";
1088
1088
  // Support tickets — seed data
1089
1089
  export { supportTicketsSeedData } from "./seed/index";
1090
1090
  // SB-UNI-B — sublistingCategoriesRepository + SublistingCategoryDocument deleted.
@@ -5488,3 +5488,14 @@ export { LISTING_TYPE_REGISTRY, pluginFor } from "./_internal/shared/listing-typ
5488
5488
  export { getListingRule, getCategoryRule, pickOrderType, getSplitKey, runSyncPreflight, CHECKOUT_RULES, CATEGORY_CHECKOUT_RULES, CHECKOUT_MAX_ORDERS_PER_TX, PRIZE_DRAW_MAX_REVEALS_PER_ORDER, BUNDLE_MAX_QTY_PER_TX, STANDARD_MAX_QTY_PER_LINE, } from "./_internal/shared/checkout/rules";
5489
5489
  // Media upload limits — pure constants, safe in both client and server bundles.
5490
5490
  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";
5491
+ // ── Field name constants — canonical source of truth for all Firestore field names ──
5492
+ // NOTE: STORE_FIELDS, CATEGORY_FIELDS, EVENT_FIELDS, EVENT_ENTRY_FIELDS, PAYOUT_FIELDS,
5493
+ // COUPON_FIELDS, CART_FIELDS, USER_FIELDS, ADDRESS_FIELDS, NOTIFICATION_FIELDS,
5494
+ // SESSION_FIELDS, SCAMMER_FIELDS are already exported from feature barrels above.
5495
+ export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, BLOG_FIELDS, BRAND_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, COUPON_USAGE_FIELDS, CONVERSATION_FIELDS, CAROUSEL_FIELDS, FAQ_FIELDS, HOMEPAGE_SECTION_FIELDS, SITE_SETTINGS_FIELDS, COMMON_FIELDS, OAUTH_STATE_VALUES, SCHEMA_DEFAULTS, } from "./constants/field-names";
5496
+ // ── Sort helpers ──────────────────────────────────────────────────────────────
5497
+ export { SORT_DIR, sortBy } from "./constants/sort";
5498
+ // ── URL table keys + view mode ────────────────────────────────────────────────
5499
+ export { TABLE_KEYS, VIEW_MODE } from "./constants/table-keys";
5500
+ // ── Sieve query builder ───────────────────────────────────────────────────────
5501
+ export { SIEVE_OP, SIEVE_PIPE_OPS, sieveFilter, sieveMultiEq, expandSieveParam, sieveAnd, } from "./utils/sieve-builder";
@@ -1,8 +1,15 @@
1
+ import { type Auth } from "firebase/auth";
1
2
  import type { IClientAuthProvider } from "../../contracts/client-auth";
2
3
  /**
3
4
  * Firebase Auth client SDK implementation of IClientAuthProvider.
5
+ *
6
+ * Accepts the already-initialized Auth instance explicitly to avoid relying on
7
+ * the global Firebase app registry — which breaks when Turbopack resolves
8
+ * firebase/auth to a different module copy than the one that called initializeApp().
4
9
  */
5
10
  export declare class FirebaseClientAuthProvider implements IClientAuthProvider {
11
+ private readonly _auth;
12
+ constructor(_auth: Auth);
6
13
  signInWithEmailAndPassword(email: string, password: string): Promise<void>;
7
14
  applyActionCode(code: string): Promise<void>;
8
15
  sendPasswordResetEmail(email: string): Promise<void>;
@@ -1,22 +1,29 @@
1
- import { applyActionCode as fbApplyActionCode, confirmPasswordReset as fbConfirmPasswordReset, EmailAuthProvider, getAuth, reauthenticateWithCredential, sendPasswordResetEmail as fbSendPasswordResetEmail, signInWithEmailAndPassword as fbSignInWithEmailAndPassword, updatePassword, verifyBeforeUpdateEmail, } from "firebase/auth";
1
+ import { applyActionCode as fbApplyActionCode, confirmPasswordReset as fbConfirmPasswordReset, EmailAuthProvider, reauthenticateWithCredential, sendPasswordResetEmail as fbSendPasswordResetEmail, signInWithEmailAndPassword as fbSignInWithEmailAndPassword, updatePassword, verifyBeforeUpdateEmail, } from "firebase/auth";
2
2
  /**
3
3
  * Firebase Auth client SDK implementation of IClientAuthProvider.
4
+ *
5
+ * Accepts the already-initialized Auth instance explicitly to avoid relying on
6
+ * the global Firebase app registry — which breaks when Turbopack resolves
7
+ * firebase/auth to a different module copy than the one that called initializeApp().
4
8
  */
5
9
  export class FirebaseClientAuthProvider {
10
+ constructor(_auth) {
11
+ this._auth = _auth;
12
+ }
6
13
  async signInWithEmailAndPassword(email, password) {
7
- await fbSignInWithEmailAndPassword(getAuth(), email, password);
14
+ await fbSignInWithEmailAndPassword(this._auth, email, password);
8
15
  }
9
16
  async applyActionCode(code) {
10
- await fbApplyActionCode(getAuth(), code);
17
+ await fbApplyActionCode(this._auth, code);
11
18
  }
12
19
  async sendPasswordResetEmail(email) {
13
- await fbSendPasswordResetEmail(getAuth(), email);
20
+ await fbSendPasswordResetEmail(this._auth, email);
14
21
  }
15
22
  async confirmPasswordReset(code, newPassword) {
16
- await fbConfirmPasswordReset(getAuth(), code, newPassword);
23
+ await fbConfirmPasswordReset(this._auth, code, newPassword);
17
24
  }
18
25
  async reauthenticateAndChangePassword(currentPassword, newPassword) {
19
- const user = getAuth().currentUser;
26
+ const user = this._auth.currentUser;
20
27
  if (!user?.email)
21
28
  throw new Error("No authenticated user.");
22
29
  const credential = EmailAuthProvider.credential(user.email, currentPassword);
@@ -24,7 +31,7 @@ export class FirebaseClientAuthProvider {
24
31
  await updatePassword(user, newPassword);
25
32
  }
26
33
  async reauthenticateAndSendEmailUpdateVerification(currentPassword, newEmail) {
27
- const user = getAuth().currentUser;
34
+ const user = this._auth.currentUser;
28
35
  if (!user?.email)
29
36
  throw new Error("No authenticated user.");
30
37
  const credential = EmailAuthProvider.credential(user.email, currentPassword);
@@ -32,6 +39,6 @@ export class FirebaseClientAuthProvider {
32
39
  await verifyBeforeUpdateEmail(user, newEmail);
33
40
  }
34
41
  async reloadCurrentUser() {
35
- await getAuth().currentUser?.reload();
42
+ await this._auth.currentUser?.reload();
36
43
  }
37
44
  }
@@ -34,7 +34,8 @@
34
34
  */
35
35
  import { useRouter, usePathname, useSearchParams } from "next/navigation";
36
36
  import { useCallback, useRef } from "react";
37
- const NON_RESETTING_KEYS = ["page", "pageSize", "view"];
37
+ import { TABLE_KEYS } from "../../constants/table-keys";
38
+ const NON_RESETTING_KEYS = [TABLE_KEYS.PAGE, TABLE_KEYS.PAGE_SIZE, TABLE_KEYS.VIEW];
38
39
  export function useUrlTable(options) {
39
40
  // Always call native hooks unconditionally (React rules).
40
41
  const nativeRouter = useRouter();
@@ -4,6 +4,7 @@
4
4
  * Auctions with bidCount = 0 (upcoming / no-bid) are intentionally absent.
5
5
  * Buyer IDs from P15 users seed data.
6
6
  */
7
+ import { BID_FIELDS, SCHEMA_DEFAULTS } from "../constants/field-names";
7
8
  const NOW = new Date();
8
9
  const daysAgo = (n) => new Date(NOW.getTime() - n * 86400000);
9
10
  const hoursAgo = (h) => new Date(NOW.getTime() - h * 3600000);
@@ -21,8 +22,8 @@ export const bidsSeedData = [
21
22
  userName: "Rahul Sharma",
22
23
  userEmail: "rahul.sharma@gmail.com",
23
24
  bidAmount: 9999900,
24
- currency: "INR",
25
- status: "outbid",
25
+ currency: SCHEMA_DEFAULTS.CURRENCY,
26
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
26
27
  isWinning: false,
27
28
  bidDate: daysAgo(14),
28
29
  createdAt: daysAgo(14),
@@ -36,8 +37,8 @@ export const bidsSeedData = [
36
37
  userName: "Priya Patel",
37
38
  userEmail: "priya.patel@gmail.com",
38
39
  bidAmount: 12000000,
39
- currency: "INR",
40
- status: "outbid",
40
+ currency: SCHEMA_DEFAULTS.CURRENCY,
41
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
41
42
  isWinning: false,
42
43
  previousBidAmount: 9999900,
43
44
  bidDate: daysAgo(10),
@@ -52,8 +53,8 @@ export const bidsSeedData = [
52
53
  userName: "Rahul Sharma",
53
54
  userEmail: "rahul.sharma@gmail.com",
54
55
  bidAmount: 15000000,
55
- currency: "INR",
56
- status: "outbid",
56
+ currency: SCHEMA_DEFAULTS.CURRENCY,
57
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
57
58
  isWinning: false,
58
59
  previousBidAmount: 12000000,
59
60
  bidDate: daysAgo(7),
@@ -68,8 +69,8 @@ export const bidsSeedData = [
68
69
  userName: "Meera Nair",
69
70
  userEmail: "meera.nair@gmail.com",
70
71
  bidAmount: 20000000,
71
- currency: "INR",
72
- status: "outbid",
72
+ currency: SCHEMA_DEFAULTS.CURRENCY,
73
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
73
74
  isWinning: false,
74
75
  previousBidAmount: 15000000,
75
76
  bidDate: daysAgo(4),
@@ -84,8 +85,8 @@ export const bidsSeedData = [
84
85
  userName: "Arjun Singh",
85
86
  userEmail: "arjun.singh@gmail.com",
86
87
  bidAmount: 25000000,
87
- currency: "INR",
88
- status: "outbid",
88
+ currency: SCHEMA_DEFAULTS.CURRENCY,
89
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
89
90
  isWinning: false,
90
91
  previousBidAmount: 20000000,
91
92
  bidDate: daysAgo(2),
@@ -100,8 +101,8 @@ export const bidsSeedData = [
100
101
  userName: "Rahul Sharma",
101
102
  userEmail: "rahul.sharma@gmail.com",
102
103
  bidAmount: 29999900,
103
- currency: "INR",
104
- status: "active",
104
+ currency: SCHEMA_DEFAULTS.CURRENCY,
105
+ status: BID_FIELDS.STATUS_VALUES.ACTIVE,
105
106
  isWinning: true,
106
107
  previousBidAmount: 25000000,
107
108
  bidDate: hoursAgo(4),
@@ -120,8 +121,8 @@ export const bidsSeedData = [
120
121
  userName: "Priya Patel",
121
122
  userEmail: "priya.patel@gmail.com",
122
123
  bidAmount: 1499900,
123
- currency: "INR",
124
- status: "outbid",
124
+ currency: SCHEMA_DEFAULTS.CURRENCY,
125
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
125
126
  isWinning: false,
126
127
  bidDate: daysAgo(7),
127
128
  createdAt: daysAgo(7),
@@ -135,8 +136,8 @@ export const bidsSeedData = [
135
136
  userName: "Arjun Singh",
136
137
  userEmail: "arjun.singh@gmail.com",
137
138
  bidAmount: 2000000,
138
- currency: "INR",
139
- status: "outbid",
139
+ currency: SCHEMA_DEFAULTS.CURRENCY,
140
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
140
141
  isWinning: false,
141
142
  previousBidAmount: 1499900,
142
143
  bidDate: daysAgo(5),
@@ -151,8 +152,8 @@ export const bidsSeedData = [
151
152
  userName: "Priya Patel",
152
153
  userEmail: "priya.patel@gmail.com",
153
154
  bidAmount: 2999900,
154
- currency: "INR",
155
- status: "outbid",
155
+ currency: SCHEMA_DEFAULTS.CURRENCY,
156
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
156
157
  isWinning: false,
157
158
  previousBidAmount: 2000000,
158
159
  bidDate: daysAgo(3),
@@ -167,8 +168,8 @@ export const bidsSeedData = [
167
168
  userName: "Rahul Sharma",
168
169
  userEmail: "rahul.sharma@gmail.com",
169
170
  bidAmount: 3999900,
170
- currency: "INR",
171
- status: "outbid",
171
+ currency: SCHEMA_DEFAULTS.CURRENCY,
172
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
172
173
  isWinning: false,
173
174
  previousBidAmount: 2999900,
174
175
  bidDate: daysAgo(2),
@@ -183,8 +184,8 @@ export const bidsSeedData = [
183
184
  userName: "Priya Patel",
184
185
  userEmail: "priya.patel@gmail.com",
185
186
  bidAmount: 4999900,
186
- currency: "INR",
187
- status: "active",
187
+ currency: SCHEMA_DEFAULTS.CURRENCY,
188
+ status: BID_FIELDS.STATUS_VALUES.ACTIVE,
188
189
  isWinning: true,
189
190
  previousBidAmount: 3999900,
190
191
  bidDate: hoursAgo(12),
@@ -203,8 +204,8 @@ export const bidsSeedData = [
203
204
  userName: "Meera Nair",
204
205
  userEmail: "meera.nair@gmail.com",
205
206
  bidAmount: 499900,
206
- currency: "INR",
207
- status: "outbid",
207
+ currency: SCHEMA_DEFAULTS.CURRENCY,
208
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
208
209
  isWinning: false,
209
210
  bidDate: daysAgo(5),
210
211
  createdAt: daysAgo(5),
@@ -218,8 +219,8 @@ export const bidsSeedData = [
218
219
  userName: "Arjun Singh",
219
220
  userEmail: "arjun.singh@gmail.com",
220
221
  bidAmount: 750000,
221
- currency: "INR",
222
- status: "outbid",
222
+ currency: SCHEMA_DEFAULTS.CURRENCY,
223
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
223
224
  isWinning: false,
224
225
  previousBidAmount: 499900,
225
226
  bidDate: daysAgo(3),
@@ -234,8 +235,8 @@ export const bidsSeedData = [
234
235
  userName: "Meera Nair",
235
236
  userEmail: "meera.nair@gmail.com",
236
237
  bidAmount: 1000000,
237
- currency: "INR",
238
- status: "outbid",
238
+ currency: SCHEMA_DEFAULTS.CURRENCY,
239
+ status: BID_FIELDS.STATUS_VALUES.OUTBID,
239
240
  isWinning: false,
240
241
  previousBidAmount: 750000,
241
242
  bidDate: daysAgo(1),
@@ -250,8 +251,8 @@ export const bidsSeedData = [
250
251
  userName: "Arjun Singh",
251
252
  userEmail: "arjun.singh@gmail.com",
252
253
  bidAmount: 1299900,
253
- currency: "INR",
254
- status: "active",
254
+ currency: SCHEMA_DEFAULTS.CURRENCY,
255
+ status: BID_FIELDS.STATUS_VALUES.ACTIVE,
255
256
  isWinning: true,
256
257
  previousBidAmount: 1000000,
257
258
  bidDate: hoursAgo(3),
@@ -270,7 +271,7 @@ export const bidsSeedData = [
270
271
  userName: "Arjun Singh",
271
272
  userEmail: "arjun.singh@gmail.com",
272
273
  bidAmount: 999900,
273
- currency: "INR",
274
+ currency: SCHEMA_DEFAULTS.CURRENCY,
274
275
  status: "lost",
275
276
  isWinning: false,
276
277
  bidDate: daysAgo(21),
@@ -285,7 +286,7 @@ export const bidsSeedData = [
285
286
  userName: "Priya Patel",
286
287
  userEmail: "priya.patel@gmail.com",
287
288
  bidAmount: 1499900,
288
- currency: "INR",
289
+ currency: SCHEMA_DEFAULTS.CURRENCY,
289
290
  status: "lost",
290
291
  isWinning: false,
291
292
  previousBidAmount: 999900,
@@ -301,7 +302,7 @@ export const bidsSeedData = [
301
302
  userName: "Arjun Singh",
302
303
  userEmail: "arjun.singh@gmail.com",
303
304
  bidAmount: 1999900,
304
- currency: "INR",
305
+ currency: SCHEMA_DEFAULTS.CURRENCY,
305
306
  status: "lost",
306
307
  isWinning: false,
307
308
  previousBidAmount: 1499900,
@@ -317,7 +318,7 @@ export const bidsSeedData = [
317
318
  userName: "Priya Patel",
318
319
  userEmail: "priya.patel@gmail.com",
319
320
  bidAmount: 2499900,
320
- currency: "INR",
321
+ currency: SCHEMA_DEFAULTS.CURRENCY,
321
322
  status: "lost",
322
323
  isWinning: false,
323
324
  previousBidAmount: 1999900,
@@ -333,7 +334,7 @@ export const bidsSeedData = [
333
334
  userName: "Arjun Singh",
334
335
  userEmail: "arjun.singh@gmail.com",
335
336
  bidAmount: 2799900,
336
- currency: "INR",
337
+ currency: SCHEMA_DEFAULTS.CURRENCY,
337
338
  status: "lost",
338
339
  isWinning: false,
339
340
  previousBidAmount: 2499900,
@@ -349,8 +350,8 @@ export const bidsSeedData = [
349
350
  userName: "Priya Patel",
350
351
  userEmail: "priya.patel@gmail.com",
351
352
  bidAmount: 2999900,
352
- currency: "INR",
353
- status: "won",
353
+ currency: SCHEMA_DEFAULTS.CURRENCY,
354
+ status: BID_FIELDS.STATUS_VALUES.WON,
354
355
  isWinning: true,
355
356
  previousBidAmount: 2799900,
356
357
  bidDate: daysAgo(7),
@@ -369,7 +370,7 @@ export const bidsSeedData = [
369
370
  userName: "Rahul Sharma",
370
371
  userEmail: "rahul.sharma@gmail.com",
371
372
  bidAmount: 299900,
372
- currency: "INR",
373
+ currency: SCHEMA_DEFAULTS.CURRENCY,
373
374
  status: "lost",
374
375
  isWinning: false,
375
376
  bidDate: daysAgo(45),
@@ -384,7 +385,7 @@ export const bidsSeedData = [
384
385
  userName: "Meera Nair",
385
386
  userEmail: "meera.nair@gmail.com",
386
387
  bidAmount: 499900,
387
- currency: "INR",
388
+ currency: SCHEMA_DEFAULTS.CURRENCY,
388
389
  status: "lost",
389
390
  isWinning: false,
390
391
  previousBidAmount: 299900,
@@ -400,7 +401,7 @@ export const bidsSeedData = [
400
401
  userName: "Rahul Sharma",
401
402
  userEmail: "rahul.sharma@gmail.com",
402
403
  bidAmount: 599900,
403
- currency: "INR",
404
+ currency: SCHEMA_DEFAULTS.CURRENCY,
404
405
  status: "lost",
405
406
  isWinning: false,
406
407
  previousBidAmount: 499900,
@@ -416,7 +417,7 @@ export const bidsSeedData = [
416
417
  userName: "Meera Nair",
417
418
  userEmail: "meera.nair@gmail.com",
418
419
  bidAmount: 699900,
419
- currency: "INR",
420
+ currency: SCHEMA_DEFAULTS.CURRENCY,
420
421
  status: "lost",
421
422
  isWinning: false,
422
423
  previousBidAmount: 599900,
@@ -432,8 +433,8 @@ export const bidsSeedData = [
432
433
  userName: "Meera Nair",
433
434
  userEmail: "meera.nair@gmail.com",
434
435
  bidAmount: 799900,
435
- currency: "INR",
436
- status: "won",
436
+ currency: SCHEMA_DEFAULTS.CURRENCY,
437
+ status: BID_FIELDS.STATUS_VALUES.WON,
437
438
  isWinning: true,
438
439
  previousBidAmount: 699900,
439
440
  bidDate: daysAgo(30),
@@ -671,7 +672,7 @@ function buildBidLadder({ productId, productTitle, amounts, bidders, daysAgoForF
671
672
  userName: bidder.name,
672
673
  userEmail: bidder.email,
673
674
  bidAmount: amount,
674
- currency: "INR",
675
+ currency: SCHEMA_DEFAULTS.CURRENCY,
675
676
  status,
676
677
  isWinning: isLast && endsActive ? true : winIdx === i,
677
678
  previousBidAmount: i > 0 ? amounts[i - 1] : undefined,