@mohasinac/appkit 2.7.50 → 2.7.53

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 (143) hide show
  1. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +1 -0
  2. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +65 -0
  3. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +1 -0
  4. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +163 -0
  5. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +1 -0
  6. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +115 -0
  7. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +1 -0
  8. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +96 -0
  9. package/dist/client.d.ts +29 -6
  10. package/dist/client.js +16 -4
  11. package/dist/constants/api-endpoints.d.ts +42 -0
  12. package/dist/constants/api-endpoints.js +14 -0
  13. package/dist/features/_guide-cls.d.ts +13 -0
  14. package/dist/features/_guide-cls.js +14 -0
  15. package/dist/features/about/components/HelpPageView.js +29 -26
  16. package/dist/features/account/components/BuyerAccountGuideView.d.ts +1 -0
  17. package/dist/features/account/components/BuyerAccountGuideView.js +39 -0
  18. package/dist/features/account/components/BuyerAuctionsGuideView.d.ts +1 -0
  19. package/dist/features/account/components/BuyerAuctionsGuideView.js +38 -0
  20. package/dist/features/account/components/BuyerOrdersGuideView.d.ts +1 -0
  21. package/dist/features/account/components/BuyerOrdersGuideView.js +48 -0
  22. package/dist/features/account/components/BuyerShoppingGuideView.d.ts +1 -0
  23. package/dist/features/account/components/BuyerShoppingGuideView.js +38 -0
  24. package/dist/features/admin/components/AdminAnalyticsGuideView.d.ts +1 -0
  25. package/dist/features/admin/components/AdminAnalyticsGuideView.js +24 -0
  26. package/dist/features/admin/components/AdminBlogEditorView.js +100 -77
  27. package/dist/features/admin/components/AdminBundleEditorView.js +20 -14
  28. package/dist/features/admin/components/AdminBundlesView.d.ts +1 -3
  29. package/dist/features/admin/components/AdminBundlesView.js +173 -52
  30. package/dist/features/admin/components/AdminCatalogGuideView.d.ts +1 -0
  31. package/dist/features/admin/components/AdminCatalogGuideView.js +28 -0
  32. package/dist/features/admin/components/AdminContentGuideView.d.ts +1 -0
  33. package/dist/features/admin/components/AdminContentGuideView.js +36 -0
  34. package/dist/features/admin/components/AdminCouponEditorView.js +1 -1
  35. package/dist/features/admin/components/AdminGuideHubView.d.ts +5 -0
  36. package/dist/features/admin/components/AdminGuideHubView.js +79 -0
  37. package/dist/features/admin/components/AdminOrdersGuideView.d.ts +1 -0
  38. package/dist/features/admin/components/AdminOrdersGuideView.js +44 -0
  39. package/dist/features/admin/components/AdminProductsView.js +8 -3
  40. package/dist/features/admin/components/AdminSiteConfigGuideView.d.ts +1 -0
  41. package/dist/features/admin/components/AdminSiteConfigGuideView.js +21 -0
  42. package/dist/features/admin/components/AdminStoresGuideView.d.ts +1 -0
  43. package/dist/features/admin/components/AdminStoresGuideView.js +32 -0
  44. package/dist/features/admin/components/AdminTeamGuideView.d.ts +1 -0
  45. package/dist/features/admin/components/AdminTeamGuideView.js +33 -0
  46. package/dist/features/admin/components/AdminTrustGuideView.d.ts +1 -0
  47. package/dist/features/admin/components/AdminTrustGuideView.js +40 -0
  48. package/dist/features/admin/components/AdminUsersGuideView.d.ts +1 -0
  49. package/dist/features/admin/components/AdminUsersGuideView.js +38 -0
  50. package/dist/features/categories/components/CategoryBundlesListing.js +3 -33
  51. package/dist/features/categories/components/index.d.ts +0 -2
  52. package/dist/features/categories/components/index.js +0 -1
  53. package/dist/features/events/components/AdminEventEditorView.js +223 -269
  54. package/dist/features/grouped/repository/grouped-listings.repository.d.ts +9 -0
  55. package/dist/features/grouped/repository/grouped-listings.repository.js +12 -0
  56. package/dist/features/media/upload/MediaUploadField.js +1 -1
  57. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -1
  58. package/dist/features/products/components/AuctionsIndexListing.js +3 -1
  59. package/dist/features/products/components/MarketplaceBundleCard.d.ts +21 -0
  60. package/dist/features/products/components/MarketplaceBundleCard.js +56 -0
  61. package/dist/features/products/components/ProductsIndexListing.js +3 -1
  62. package/dist/features/products/components/index.d.ts +2 -4
  63. package/dist/features/products/components/index.js +1 -2
  64. package/dist/features/promotions/schemas/firestore.js +1 -1
  65. package/dist/features/reviews/components/index.d.ts +0 -2
  66. package/dist/features/reviews/components/index.js +0 -1
  67. package/dist/features/seller/components/BrandInlineSelect.js +23 -3
  68. package/dist/features/seller/components/CategoryInlineSelect.js +20 -3
  69. package/dist/features/seller/components/SellerAnalyticsAlertsView.d.ts +6 -0
  70. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +124 -0
  71. package/dist/features/seller/components/SellerAnalyticsView.d.ts +2 -0
  72. package/dist/features/seller/components/SellerAnalyticsView.js +17 -9
  73. package/dist/features/seller/components/SellerBundlesView.d.ts +5 -0
  74. package/dist/features/seller/components/SellerBundlesView.js +104 -0
  75. package/dist/features/seller/components/SellerClassifiedView.d.ts +5 -0
  76. package/dist/features/seller/components/SellerClassifiedView.js +113 -0
  77. package/dist/features/seller/components/SellerDashboardView.js +19 -7
  78. package/dist/features/seller/components/SellerDigitalCodesView.d.ts +5 -0
  79. package/dist/features/seller/components/SellerDigitalCodesView.js +115 -0
  80. package/dist/features/seller/components/SellerGoogleReviewsView.d.ts +14 -0
  81. package/dist/features/seller/components/SellerGoogleReviewsView.js +95 -0
  82. package/dist/features/seller/components/SellerGroupedListingsView.d.ts +6 -0
  83. package/dist/features/seller/components/SellerGroupedListingsView.js +112 -0
  84. package/dist/features/seller/components/SellerLiveView.d.ts +5 -0
  85. package/dist/features/seller/components/SellerLiveView.js +113 -0
  86. package/dist/features/seller/components/SellerOrdersView.js +18 -2
  87. package/dist/features/seller/components/SellerPayoutMethodsView.d.ts +7 -0
  88. package/dist/features/seller/components/SellerPayoutMethodsView.js +120 -0
  89. package/dist/features/seller/components/SellerPayoutSettingsView.js +50 -12
  90. package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
  91. package/dist/features/seller/components/SellerProductShell.js +9 -7
  92. package/dist/features/seller/components/SellerProductsFilterDrawer.js +3 -1
  93. package/dist/features/seller/components/SellerProductsView.js +48 -54
  94. package/dist/features/seller/components/SellerShippingConfigsView.d.ts +7 -0
  95. package/dist/features/seller/components/SellerShippingConfigsView.js +149 -0
  96. package/dist/features/seller/components/SellerShippingView.js +37 -10
  97. package/dist/features/seller/components/SellerStoreCategoriesView.d.ts +9 -0
  98. package/dist/features/seller/components/SellerStoreCategoriesView.js +122 -0
  99. package/dist/features/seller/components/SellerStorefrontView.d.ts +0 -7
  100. package/dist/features/seller/components/SellerStorefrontView.js +26 -29
  101. package/dist/features/seller/components/SellerTemplatesView.d.ts +10 -0
  102. package/dist/features/seller/components/SellerTemplatesView.js +265 -0
  103. package/dist/features/seller/components/index.d.ts +26 -0
  104. package/dist/features/seller/components/index.js +13 -0
  105. package/dist/features/stores/api/[storeSlug]/reviews/route.js +49 -7
  106. package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +3 -0
  107. package/dist/features/stores/components/StoreCapabilitiesGuideView.js +101 -0
  108. package/dist/features/stores/components/StoreFinanceGuideView.d.ts +3 -0
  109. package/dist/features/stores/components/StoreFinanceGuideView.js +79 -0
  110. package/dist/features/stores/components/StoreGuideHubView.d.ts +5 -0
  111. package/dist/features/stores/components/StoreGuideHubView.js +89 -0
  112. package/dist/features/stores/components/StoreListingsGuideView.d.ts +3 -0
  113. package/dist/features/stores/components/StoreListingsGuideView.js +151 -0
  114. package/dist/features/stores/components/StoreOrdersGuideView.d.ts +3 -0
  115. package/dist/features/stores/components/StoreOrdersGuideView.js +122 -0
  116. package/dist/features/stores/components/StoreReviewsListing.js +100 -23
  117. package/dist/features/stores/components/StoreSettingsGuideView.d.ts +3 -0
  118. package/dist/features/stores/components/StoreSettingsGuideView.js +56 -0
  119. package/dist/features/stores/components/index.d.ts +12 -1
  120. package/dist/features/stores/components/index.js +6 -1
  121. package/dist/features/stores/hooks/useStores.d.ts +5 -0
  122. package/dist/features/stores/hooks/useStores.js +10 -0
  123. package/dist/features/stores/manifest.js +1 -1
  124. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +13 -2
  125. package/dist/index.d.ts +54 -9
  126. package/dist/index.js +58 -15
  127. package/dist/next/routing/route-map.d.ts +55 -0
  128. package/dist/next/routing/route-map.js +25 -0
  129. package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +1 -0
  130. package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +93 -0
  131. package/dist/providers/db-firebase/sieve.d.ts +49 -0
  132. package/dist/providers/db-firebase/sieve.js +61 -8
  133. package/dist/repositories/index.d.ts +1 -0
  134. package/dist/repositories/index.js +2 -0
  135. package/dist/tailwind-utilities.css +1 -1
  136. package/dist/ui/components/ListingToolbar.d.ts +8 -1
  137. package/dist/ui/components/ListingToolbar.js +4 -2
  138. package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +1 -0
  139. package/dist/ui/components/__tests__/BulkActionBar.test.js +96 -0
  140. package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +1 -0
  141. package/dist/ui/components/__tests__/ListingToolbar.test.js +125 -0
  142. package/dist/ui/index.d.ts +1 -1
  143. package/package.json +8 -2
@@ -16,6 +16,55 @@
16
16
  * }, { baseQuery });
17
17
  * }
18
18
  * ```
19
+ *
20
+ * ## Known Sieve ↔ Firestore incompatibilities
21
+ *
22
+ * These Sieve DSL features are silently unsupported or produce wrong results
23
+ * when translated to Firestore queries. Document them here to avoid surprise.
24
+ *
25
+ * ### 1. String-contains `@=*` (case-insensitive full-text)
26
+ * Sieve's `title@=*query` is a substring/CI match. Firestore has no native
27
+ * LIKE or ILIKE operator. The Firebase adapter maps it to `>=` / `<` prefix
28
+ * range tricks that only work for prefix matches on ASCII strings, not
29
+ * arbitrary substrings. Use a Firebase Function or in-memory post-filter for
30
+ * real substring search; never rely on `@=*` to match mid-string.
31
+ *
32
+ * ### 2. OR across different fields (`|` pipe between clauses)
33
+ * Sieve's `field1==v1|field2==v2` (OR across two different fields) is
34
+ * translated to `whereOr` by the stock Firebase adapter. Firestore's Admin SDK
35
+ * v6+ supports `Query.where(Filter.or(...))`, but the stock adapter version
36
+ * bundled with sievejs may emit an unsupported form. The enhanced adapter in
37
+ * this file only upgrades single-field OR groups (same-field equality → `in`
38
+ * query). Multi-field OR is still unsupported — apply it in memory.
39
+ *
40
+ * ### 3. OR on the same field (`field==v1|v2`) → Firestore `in`
41
+ * The custom `createEnhancedFirebaseAdapter` in this file upgrades these to
42
+ * Firestore `.where(field, "in", [v1, v2])`. Firestore supports up to 30
43
+ * values in an `in` clause. More than 30 values will throw. The stock adapter
44
+ * would have emitted a `whereOr` call that fails entirely.
45
+ *
46
+ * ### 4. Multi-field `orderBy` without a matching composite index
47
+ * Firestore requires a composite index for every combination of `where` +
48
+ * `orderBy` fields. Sieve sorts like `-createdAt,price` translate to two
49
+ * `orderBy` calls; if the Firestore collection has no index for that
50
+ * combination the query throws `FAILED_PRECONDITION`. Add the index to
51
+ * `appkit/firebase/base/firestore.indexes.json` and deploy before shipping.
52
+ *
53
+ * ### 5. Inequality filter + `orderBy` on a different field
54
+ * Firestore's rule: if you have an inequality filter (`!=`, `<`, `>`, `<=`,
55
+ * `>=`) on field A, the first `orderBy` must also be on field A. Sieve queries
56
+ * like `price>=100 & sorts=-createdAt` translate to an inequality on `price`
57
+ * with `orderBy createdAt`, which Firestore rejects. Work-arounds:
58
+ * (a) move the inequality filter to the Firebase Function path where it can
59
+ * be handled server-side, (b) apply it in-memory in the fallback path,
60
+ * (c) restructure the sort to use the same field as the filter.
61
+ *
62
+ * ### 6. Dot-notation nested field filters (`address.city==Delhi`)
63
+ * Sieve parses the field name verbatim; the Firebase adapter passes it as the
64
+ * Firestore field path. Firestore Admin SDK supports dot-notation for nested
65
+ * fields, so `address.city==Delhi` works — but only if the field is indexed.
66
+ * Add nested-field indexes explicitly; Firestore does not auto-index nested
67
+ * paths in composite indexes declared at the root level.
19
68
  */
20
69
  import { SieveProcessorBase } from "@mohasinac/sievejs/services";
21
70
  import { createFirebaseAdapter } from "@mohasinac/sievejs/adapters/firebase";
@@ -81,15 +130,18 @@ export async function applySieveToFirestore(params) {
81
130
  options: merged,
82
131
  fields,
83
132
  });
133
+ const page = Math.max(1, Number(model.page ?? 1));
134
+ const pageSize = Math.min(merged.maxPageSize, Math.max(1, Number(model.pageSize ?? merged.defaultPageSize)));
135
+ // Apply filters + sorts once; count without reading docs.
84
136
  const filteredQ = processor.apply(effective, baseQuery, {
85
137
  applyPagination: false,
86
138
  });
87
139
  const total = await getFirestoreCount(filteredQ);
88
- const pagedQ = processor.apply(effective, baseQuery);
140
+ // Apply pagination on top of the already-filtered query — avoids re-applying
141
+ // the full Sieve DSL from the base.
142
+ const pagedQ = filteredQ.offset((page - 1) * pageSize).limit(pageSize);
89
143
  const snap = await pagedQ.get();
90
144
  const items = snap.docs.map((d) => deserializeTimestamps({ id: d.id, ...d.data() }));
91
- const page = Math.max(1, Number(model.page ?? 1));
92
- const pageSize = Math.min(merged.maxPageSize, Math.max(1, Number(model.pageSize ?? merged.defaultPageSize)));
93
145
  const totalPages = total === 0 ? 0 : Math.max(1, Math.ceil(total / pageSize));
94
146
  return {
95
147
  items,
@@ -120,17 +172,18 @@ export class FirebaseSieveRepository extends FirebaseRepository {
120
172
  options: merged,
121
173
  fields,
122
174
  });
123
- // Count (no docs fetched)
175
+ const page = Math.max(1, Number(model.page ?? 1));
176
+ const pageSize = Math.min(merged.maxPageSize, Math.max(1, Number(model.pageSize ?? merged.defaultPageSize)));
177
+ // Apply filters + sorts once; count without reading docs.
124
178
  const filteredQ = processor.apply(effective, base, {
125
179
  applyPagination: false,
126
180
  });
127
181
  const total = await getFirestoreCount(filteredQ);
128
- // Paginated result
129
- const pagedQ = processor.apply(effective, base);
182
+ // Apply pagination on top of the already-filtered query — avoids re-applying
183
+ // the full Sieve DSL from the base.
184
+ const pagedQ = filteredQ.offset((page - 1) * pageSize).limit(pageSize);
130
185
  const snap = await pagedQ.get();
131
186
  const items = snap.docs.map((d) => deserializeTimestamps({ id: d.id, ...d.data() }));
132
- const page = Math.max(1, Number(model.page ?? 1));
133
- const pageSize = Math.min(merged.maxPageSize, Math.max(1, Number(model.pageSize ?? merged.defaultPageSize)));
134
187
  const totalPages = total === 0 ? 0 : Math.max(1, Math.ceil(total / pageSize));
135
188
  return {
136
189
  items,
@@ -29,6 +29,7 @@ export type { ClaimedCouponCreateInput } from "../features/promotions/repository
29
29
  export { FAQsRepository, FirebaseFAQsRepository, faqsRepository, } from "../features/faq/repository/faqs.repository";
30
30
  export { BlogRepository, blogRepository, } from "../features/blog/repository/blog.repository";
31
31
  export { payoutRepository } from "../features/payments/repository/payout.repository";
32
+ export { GroupedListingsRepository, groupedListingsRepository, } from "../features/grouped/repository/grouped-listings.repository";
32
33
  export { payoutMethodsRepository, shippingConfigsRepository, analyticsCardsRepository, analyticsAlertsRepository, storeCategoriesRepository, listingTemplatesRepository, moderationQueueRepository, reportsRepository, itemRequestsRepository, storeWhatsAppConfigRepository, storeGoogleConfigRepository, PayoutMethodsRepository, ShippingConfigsRepository, AnalyticsCardsRepository, AnalyticsAlertsRepository, StoreCategoriesRepository, ListingTemplatesRepository, ModerationQueueRepository, ReportsRepository, ItemRequestsRepository, StoreWhatsAppConfigRepository, StoreGoogleConfigRepository, } from "../features/store-extensions/repository/store-extensions.repositories";
33
34
  export { roleOverridesRepository, customRolesRepository, adminNotificationsRepository, RoleOverridesRepository, CustomRolesRepository, AdminNotificationsRepository, } from "../features/store-extensions/repository/rbac.repositories";
34
35
  export { OfferRepository, offerRepository, } from "../features/seller/repository/offer.repository";
@@ -35,6 +35,8 @@ export { ClaimedCouponsRepository, claimedCouponsRepository, } from "../features
35
35
  export { FAQsRepository, FirebaseFAQsRepository, faqsRepository, } from "../features/faq/repository/faqs.repository";
36
36
  export { BlogRepository, blogRepository, } from "../features/blog/repository/blog.repository";
37
37
  export { payoutRepository } from "../features/payments/repository/payout.repository";
38
+ // Grouped listings repository
39
+ export { GroupedListingsRepository, groupedListingsRepository, } from "../features/grouped/repository/grouped-listings.repository";
38
40
  // S-STORE-CROSS — 11 new collection repositories
39
41
  export { payoutMethodsRepository, shippingConfigsRepository, analyticsCardsRepository, analyticsAlertsRepository, storeCategoriesRepository, listingTemplatesRepository, moderationQueueRepository, reportsRepository, itemRequestsRepository, storeWhatsAppConfigRepository, storeGoogleConfigRepository, PayoutMethodsRepository, ShippingConfigsRepository, AnalyticsCardsRepository, AnalyticsAlertsRepository, StoreCategoriesRepository, ListingTemplatesRepository, ModerationQueueRepository, ReportsRepository, ItemRequestsRepository, StoreWhatsAppConfigRepository, StoreGoogleConfigRepository, } from "../features/store-extensions/repository/store-extensions.repositories";
40
42
  // S-STORE RBAC + admin notifications