@umituz/react-native-ai-creations 1.3.7 → 1.3.9

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-creations",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "description": "AI-generated creations gallery with filtering, sharing, and management for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -35,9 +35,11 @@
35
35
  "@tanstack/react-query": ">=5.0.0",
36
36
  "@umituz/react-native-bottom-sheet": "latest",
37
37
  "@umituz/react-native-design-system": "latest",
38
- "@umituz/react-native-firebase": "^1.13.15",
38
+ "@umituz/react-native-firebase": "latest",
39
39
  "@umituz/react-native-image": "latest",
40
40
  "@umituz/react-native-sharing": "latest",
41
+ "@umituz/react-native-uuid": "latest",
42
+ "expo-image-manipulator": ">=13.0.0",
41
43
  "expo-linear-gradient": ">=14.0.0",
42
44
  "firebase": ">=11.0.0",
43
45
  "react": ">=19.1.0",
@@ -53,6 +55,7 @@
53
55
  "@umituz/react-native-firebase": "latest",
54
56
  "@umituz/react-native-image": "latest",
55
57
  "@umituz/react-native-sharing": "latest",
58
+ "@umituz/react-native-uuid": "latest",
56
59
  "expo-linear-gradient": "^15.0.8",
57
60
  "firebase": "^11.0.0",
58
61
  "react": "19.1.0",
@@ -1,4 +1,5 @@
1
1
  import { serverTimestamp, addDoc, collection } from "firebase/firestore";
2
+ import { generateUUID } from "@umituz/react-native-uuid";
2
3
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
3
4
  import type { ICreationsStorageService } from "../../domain/services/ICreationsStorageService";
4
5
  import type { CreationType } from "../../domain/value-objects";
@@ -37,9 +38,7 @@ export class CreationsService extends BaseRepository {
37
38
  // Let's assume standard path for now or ask repository (if we expanded interface).
38
39
  // A better way: The service generates an ID.
39
40
 
40
- const creationId = crypto.randomUUID
41
- ? crypto.randomUUID()
42
- : Date.now().toString() + Math.random().toString().slice(2);
41
+ const creationId = generateUUID();
43
42
 
44
43
  // 2. Upload Image
45
44
  const imageUrl = await this.storageService.uploadCreationImage(
@@ -49,18 +48,15 @@ export class CreationsService extends BaseRepository {
49
48
  );
50
49
 
51
50
  // 3. Save Metadata to Firestore
52
- // We need to use the repository or direct firestore if repository doesnt support 'create'.
53
- // The current repository only supports 'getAll', 'delete'.
54
- // We should ideally add 'create' to repository.
55
- // For now, I'll access firestore directly here using BaseRepository's getDb().
56
- // BUT, I should really update CreationsRepository to support 'create' or 'add'.
57
-
58
- // Let's use direct firestore here for now, but following the path logic.
59
- // Wait, CreationsRepository has 'pathBuilder'. I can't access it easily if it's private.
60
- // Standard practice: Service delegates to Repository.
61
- // So I should add `create(userId, creation)` to CreationsRepository.
62
-
63
- // I will STOP here and update CreationsRepository to have `create` first.
51
+ await this.repository.create(dto.userId, {
52
+ id: creationId,
53
+ uri: imageUrl,
54
+ type: dto.type.id,
55
+ prompt: dto.prompt,
56
+ metadata: dto.metadata,
57
+ createdAt: new Date(),
58
+ isShared: false,
59
+ });
64
60
 
65
61
  return creationId;
66
62
  } catch (error) {