@mohasinac/appkit 2.8.1 → 2.8.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.
@@ -19,9 +19,9 @@ export declare const CONSENT_OTP_VERIFY_RATE_LIMIT: {
19
19
  };
20
20
  type Db = ReturnType<typeof getAdminDb>;
21
21
  /** Reference to a user's consent OTP document for a given address. */
22
- export declare function consentOtpRef(db: Db, uid: string, addressId: string): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData>;
22
+ export declare function consentOtpRef(db: Db, uid: string, addressId: string): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>;
23
23
  /** Reference to a user's consent OTP rate-limit metadata document. */
24
- export declare function consentOtpRateLimitRef(db: Db, uid: string): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData>;
24
+ export declare function consentOtpRateLimitRef(db: Db, uid: string): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>;
25
25
  /** HMAC-SHA256 hash of an OTP code. */
26
26
  export declare function hashOtp(code: string): string;
27
27
  /** Generate a cryptographically-secure random 6-digit OTP string. */
@@ -4,7 +4,7 @@ export declare abstract class BaseRepository<T extends DocumentData> {
4
4
  protected collection: string;
5
5
  constructor(collectionName: string);
6
6
  protected get db(): Firestore;
7
- protected getCollection(): CollectionReference<DocumentData>;
7
+ protected getCollection(): CollectionReference<DocumentData, DocumentData>;
8
8
  protected mapDoc<D = T>(snap: DocumentSnapshot): D;
9
9
  findById(id: string): Promise<T | null>;
10
10
  findByIdOrFail(id: string): Promise<T>;
@@ -6,7 +6,7 @@
6
6
  * the actual collection-specific seeding logic (800+ lines with PII encryption,
7
7
  * Auth user creation, subcollection handling, etc.).
8
8
  */
9
- export type SeedCollectionName = "users" | "addresses" | "categories" | "stores" | "products" | "orders" | "reviews" | "bids" | "coupons" | "carousels" | "carouselSlides" | "homepageSections" | "siteSettings" | "faqs" | "notifications" | "payouts" | "blogPosts" | "events" | "eventEntries" | "sessions" | "carts" | "wishlists" | "history" | "conversations" | "groupedListings" | "scammerProfiles" | "supportTickets" | "productFeatures" | "offers" | "payoutMethods" | "shippingConfigs" | "analyticsCards" | "analyticsAlerts" | "storeCategories" | "listingTemplates" | "moderationQueue" | "reports" | "itemRequests" | "storeWhatsAppConfig" | "storeGoogleConfig" | "roleOverrides" | "customRoles" | "adminNotifications";
9
+ export type SeedCollectionName = "users" | "addresses" | "categories" | "stores" | "products" | "orders" | "reviews" | "bids" | "coupons" | "carousels" | "carouselSlides" | "homepageSections" | "siteSettings" | "faqs" | "notifications" | "payouts" | "blogPosts" | "events" | "eventEntries" | "sessions" | "carts" | "wishlists" | "history" | "conversations" | "groupedListings" | "scammerProfiles" | "supportTickets" | "productFeatures" | "offers" | "couponUsage" | "claimedCoupons" | "payoutMethods" | "shippingConfigs" | "analyticsCards" | "analyticsAlerts" | "storeCategories" | "listingTemplates" | "moderationQueue" | "reports" | "itemRequests" | "storeWhatsAppConfig" | "storeGoogleConfig" | "roleOverrides" | "customRoles" | "adminNotifications";
10
10
  export interface SeedOperationResult {
11
11
  success?: boolean;
12
12
  message: string;
@@ -44,6 +44,8 @@ import { scammersSeedData } from "./scammers-seed-data";
44
44
  import { supportTicketsSeedData } from "./support-tickets-seed-data";
45
45
  import { productFeaturesSeedData } from "./product-features-seed-data";
46
46
  import { offersSeedData } from "./offers-seed-data";
47
+ import { couponUsageSeedData } from "./coupon-usage-seed-data";
48
+ import { claimedCouponsSeedData } from "./claimed-coupons-seed-data";
47
49
  function asArr(items) {
48
50
  return items ?? [];
49
51
  }
@@ -187,6 +189,14 @@ export const SEED_MANIFEST = {
187
189
  ...o,
188
190
  name: o.productTitle ?? o.id,
189
191
  }))),
192
+ couponUsage: asArr(couponUsageSeedData).map((u) => ({
193
+ id: `${u.userId}/${u.couponId}`,
194
+ name: String(u.couponCode ?? u.couponId),
195
+ })),
196
+ claimedCoupons: pick(asArr(claimedCouponsSeedData).map((c) => ({
197
+ ...c,
198
+ name: c.couponCode ?? c.couponId ?? c.id,
199
+ }))),
190
200
  // S-STORE foundation collections — entries derived lazily from store-extensions-seed-data
191
201
  payoutMethods: pick(asArr(payoutMethodsSeedData)),
192
202
  shippingConfigs: pick(asArr(shippingConfigsSeedData)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -165,7 +165,7 @@
165
165
  "@tanstack/react-query": ">=5.0.0",
166
166
  "@types/react": ">=18",
167
167
  "@types/react-dom": ">=18",
168
- "firebase-admin": "^10.3.0",
168
+ "firebase-admin": "^13.6.1",
169
169
  "firebase-functions": ">=6.0.0",
170
170
  "next": ">=14",
171
171
  "next-intl": ">=3",
@@ -196,12 +196,21 @@
196
196
  "@tanstack/react-query": "^5.0.0",
197
197
  "@testing-library/jest-dom": "^6.9.1",
198
198
  "@testing-library/react": "^16.3.2",
199
+ "@types/babel__generator": "^7.27.0",
200
+ "@types/babel__template": "^7.4.4",
201
+ "@types/babel__traverse": "^7.28.0",
202
+ "@types/caseless": "^0.12.5",
203
+ "@types/d3-color": "^3.1.3",
204
+ "@types/d3-path": "^3.1.1",
205
+ "@types/istanbul-lib-report": "^3.0.3",
206
+ "@types/ms": "^2.1.0",
207
+ "@types/yargs-parser": "^21.0.3",
199
208
  "@upstash/ratelimit": "^2.0.8",
200
209
  "@upstash/redis": "^1.37.0",
201
210
  "concurrently": "^9.2.1",
202
211
  "eslint": "^9.37.0",
203
212
  "firebase": "^12.8.0",
204
- "firebase-admin": "^10.3.0",
213
+ "firebase-admin": "^13.6.1",
205
214
  "firebase-functions": "^6.6.0",
206
215
  "jsdom": "^29.1.1",
207
216
  "lucide-react": "^1.7.0",