@mohasinac/appkit 2.7.50 → 2.7.52
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.
- package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +65 -0
- package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +163 -0
- package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +115 -0
- package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +96 -0
- package/dist/client.d.ts +29 -6
- package/dist/client.js +16 -4
- package/dist/constants/api-endpoints.d.ts +42 -0
- package/dist/constants/api-endpoints.js +14 -0
- package/dist/features/_guide-cls.d.ts +13 -0
- package/dist/features/_guide-cls.js +14 -0
- package/dist/features/about/components/HelpPageView.js +29 -26
- package/dist/features/account/components/BuyerAccountGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerAccountGuideView.js +39 -0
- package/dist/features/account/components/BuyerAuctionsGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerAuctionsGuideView.js +38 -0
- package/dist/features/account/components/BuyerOrdersGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerOrdersGuideView.js +48 -0
- package/dist/features/account/components/BuyerShoppingGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerShoppingGuideView.js +38 -0
- package/dist/features/admin/components/AdminAnalyticsGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +24 -0
- package/dist/features/admin/components/AdminBlogEditorView.js +100 -77
- package/dist/features/admin/components/AdminBundleEditorView.js +20 -14
- package/dist/features/admin/components/AdminBundlesView.d.ts +1 -3
- package/dist/features/admin/components/AdminBundlesView.js +173 -52
- package/dist/features/admin/components/AdminCatalogGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminCatalogGuideView.js +28 -0
- package/dist/features/admin/components/AdminContentGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminContentGuideView.js +36 -0
- package/dist/features/admin/components/AdminCouponEditorView.js +1 -1
- package/dist/features/admin/components/AdminGuideHubView.d.ts +5 -0
- package/dist/features/admin/components/AdminGuideHubView.js +79 -0
- package/dist/features/admin/components/AdminOrdersGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminOrdersGuideView.js +44 -0
- package/dist/features/admin/components/AdminProductsView.js +8 -3
- package/dist/features/admin/components/AdminSiteConfigGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +21 -0
- package/dist/features/admin/components/AdminStoresGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminStoresGuideView.js +32 -0
- package/dist/features/admin/components/AdminTeamGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminTeamGuideView.js +33 -0
- package/dist/features/admin/components/AdminTrustGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminTrustGuideView.js +40 -0
- package/dist/features/admin/components/AdminUsersGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminUsersGuideView.js +38 -0
- package/dist/features/categories/components/CategoryBundlesListing.js +3 -33
- package/dist/features/categories/components/index.d.ts +0 -2
- package/dist/features/categories/components/index.js +0 -1
- package/dist/features/events/components/AdminEventEditorView.js +223 -269
- package/dist/features/grouped/repository/grouped-listings.repository.d.ts +9 -0
- package/dist/features/grouped/repository/grouped-listings.repository.js +12 -0
- package/dist/features/media/upload/MediaUploadField.js +1 -1
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -1
- package/dist/features/products/components/AuctionsIndexListing.js +3 -1
- package/dist/features/products/components/MarketplaceBundleCard.d.ts +21 -0
- package/dist/features/products/components/MarketplaceBundleCard.js +56 -0
- package/dist/features/products/components/ProductsIndexListing.js +3 -1
- package/dist/features/products/components/index.d.ts +2 -4
- package/dist/features/products/components/index.js +1 -2
- package/dist/features/promotions/schemas/firestore.js +1 -1
- package/dist/features/reviews/components/index.d.ts +0 -2
- package/dist/features/reviews/components/index.js +0 -1
- package/dist/features/seller/components/BrandInlineSelect.js +23 -3
- package/dist/features/seller/components/CategoryInlineSelect.js +20 -3
- package/dist/features/seller/components/SellerAnalyticsAlertsView.d.ts +6 -0
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +124 -0
- package/dist/features/seller/components/SellerAnalyticsView.d.ts +2 -0
- package/dist/features/seller/components/SellerAnalyticsView.js +17 -9
- package/dist/features/seller/components/SellerBundlesView.d.ts +5 -0
- package/dist/features/seller/components/SellerBundlesView.js +104 -0
- package/dist/features/seller/components/SellerClassifiedView.d.ts +5 -0
- package/dist/features/seller/components/SellerClassifiedView.js +113 -0
- package/dist/features/seller/components/SellerDashboardView.js +19 -7
- package/dist/features/seller/components/SellerDigitalCodesView.d.ts +5 -0
- package/dist/features/seller/components/SellerDigitalCodesView.js +115 -0
- package/dist/features/seller/components/SellerGoogleReviewsView.d.ts +14 -0
- package/dist/features/seller/components/SellerGoogleReviewsView.js +95 -0
- package/dist/features/seller/components/SellerGroupedListingsView.d.ts +6 -0
- package/dist/features/seller/components/SellerGroupedListingsView.js +112 -0
- package/dist/features/seller/components/SellerLiveView.d.ts +5 -0
- package/dist/features/seller/components/SellerLiveView.js +113 -0
- package/dist/features/seller/components/SellerOrdersView.js +18 -2
- package/dist/features/seller/components/SellerPayoutMethodsView.d.ts +7 -0
- package/dist/features/seller/components/SellerPayoutMethodsView.js +120 -0
- package/dist/features/seller/components/SellerPayoutSettingsView.js +50 -12
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductShell.js +9 -7
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +3 -1
- package/dist/features/seller/components/SellerProductsView.js +48 -54
- package/dist/features/seller/components/SellerShippingConfigsView.d.ts +7 -0
- package/dist/features/seller/components/SellerShippingConfigsView.js +149 -0
- package/dist/features/seller/components/SellerShippingView.js +37 -10
- package/dist/features/seller/components/SellerStoreCategoriesView.d.ts +9 -0
- package/dist/features/seller/components/SellerStoreCategoriesView.js +122 -0
- package/dist/features/seller/components/SellerStorefrontView.d.ts +0 -7
- package/dist/features/seller/components/SellerStorefrontView.js +26 -29
- package/dist/features/seller/components/SellerTemplatesView.d.ts +10 -0
- package/dist/features/seller/components/SellerTemplatesView.js +265 -0
- package/dist/features/seller/components/index.d.ts +26 -0
- package/dist/features/seller/components/index.js +13 -0
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +49 -7
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +101 -0
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreFinanceGuideView.js +79 -0
- package/dist/features/stores/components/StoreGuideHubView.d.ts +5 -0
- package/dist/features/stores/components/StoreGuideHubView.js +89 -0
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreListingsGuideView.js +151 -0
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreOrdersGuideView.js +122 -0
- package/dist/features/stores/components/StoreReviewsListing.js +100 -23
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreSettingsGuideView.js +56 -0
- package/dist/features/stores/components/index.d.ts +12 -1
- package/dist/features/stores/components/index.js +6 -1
- package/dist/features/stores/hooks/useStores.d.ts +5 -0
- package/dist/features/stores/hooks/useStores.js +10 -0
- package/dist/features/stores/manifest.js +1 -1
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +13 -2
- package/dist/index.d.ts +54 -9
- package/dist/index.js +58 -15
- package/dist/next/routing/route-map.d.ts +55 -0
- package/dist/next/routing/route-map.js +25 -0
- package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +1 -0
- package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +93 -0
- package/dist/providers/db-firebase/sieve.d.ts +49 -0
- package/dist/providers/db-firebase/sieve.js +61 -8
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.js +2 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/ListingToolbar.d.ts +8 -1
- package/dist/ui/components/ListingToolbar.js +4 -2
- package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +1 -0
- package/dist/ui/components/__tests__/BulkActionBar.test.js +96 -0
- package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +1 -0
- package/dist/ui/components/__tests__/ListingToolbar.test.js +125 -0
- package/dist/ui/index.d.ts +1 -1
- 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
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
129
|
-
|
|
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
|