@umituz/react-native-ai-generation-content 1.27.0 → 1.27.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.27.0",
3
+ "version": "1.27.1",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -17,7 +17,7 @@ export class CreationsFetcher {
17
17
 
18
18
  async getAll(userId: string): Promise<Creation[]> {
19
19
  if (__DEV__) {
20
-
20
+
21
21
  console.log("[CreationsRepository] getAll()", { userId });
22
22
  }
23
23
 
@@ -29,20 +29,32 @@ export class CreationsFetcher {
29
29
  const snapshot = await getDocs(q);
30
30
 
31
31
  if (__DEV__) {
32
-
32
+
33
33
  console.log("[CreationsRepository] Fetched:", snapshot.docs.length);
34
34
  }
35
35
 
36
36
  const allCreations = snapshot.docs.map((docSnap) => {
37
37
  const data = docSnap.data() as CreationDocument;
38
- return this.documentMapper(docSnap.id, data);
38
+ const creation = this.documentMapper(docSnap.id, data);
39
+
40
+ // Ensure deletedAt is always mapped from raw data (custom mappers may omit it)
41
+ if (creation.deletedAt === undefined && data.deletedAt) {
42
+ const deletedAt = data.deletedAt instanceof Date
43
+ ? data.deletedAt
44
+ : (data.deletedAt && typeof data.deletedAt === "object" && "toDate" in data.deletedAt)
45
+ ? (data.deletedAt as { toDate: () => Date }).toDate()
46
+ : undefined;
47
+ return { ...creation, deletedAt };
48
+ }
49
+
50
+ return creation;
39
51
  });
40
52
 
41
53
  // Filter out soft-deleted creations
42
54
  return allCreations.filter((creation) => !creation.deletedAt);
43
55
  } catch (error) {
44
56
  if (__DEV__) {
45
-
57
+
46
58
  console.error("[CreationsRepository] getAll() ERROR", error);
47
59
  }
48
60
  return [];