@umituz/react-native-ai-generation-content 1.82.5 → 1.82.6

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.82.5",
3
+ "version": "1.82.6",
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",
@@ -5,7 +5,7 @@
5
5
 
6
6
  export const DEFAULT_MODELS = {
7
7
  TEXT_TO_IMAGE: "xai/grok-imagine-image",
8
- TEXT_TO_VIDEO: "xai/grok-imagine-video/text-to-video",
9
- IMAGE_TO_VIDEO: "xai/grok-imagine-video/image-to-video",
8
+ TEXT_TO_VIDEO: "fal-ai/ltx-video",
9
+ IMAGE_TO_VIDEO: "fal-ai/ltx-video",
10
10
  SCENARIO_VIDEO: "fal-ai/ltx-video",
11
11
  } as const;
@@ -41,6 +41,9 @@ export const CREATION_FIELDS = {
41
41
  IS_SHARED: "isShared" as const,
42
42
  RATING: "rating" as const,
43
43
 
44
+ // Completion timestamp
45
+ COMPLETED_AT: "completedAt" as const,
46
+
44
47
  // AI provider metadata
45
48
  REQUEST_ID: "requestId" as const,
46
49
  MODEL: "model" as const,
@@ -69,6 +72,7 @@ export const UPDATABLE_FIELDS: ReadonlyArray<CreationFieldName> = [
69
72
  CREATION_FIELDS.REQUEST_ID,
70
73
  CREATION_FIELDS.MODEL,
71
74
  CREATION_FIELDS.PROMPT,
75
+ CREATION_FIELDS.COMPLETED_AT,
72
76
  ] as const;
73
77
 
74
78
  /**
@@ -38,6 +38,8 @@ export interface Creation {
38
38
  // Background job tracking
39
39
  readonly requestId?: string;
40
40
  readonly model?: string;
41
+ // Timestamps
42
+ readonly completedAt?: Date;
41
43
  // Soft delete - if set, the creation is considered deleted
42
44
  readonly deletedAt?: Date;
43
45
  }
@@ -61,6 +63,7 @@ export interface CreationDocument {
61
63
  readonly createdAt: FirebaseTimestamp | Date;
62
64
  readonly completedAt?: FirebaseTimestamp | Date | null;
63
65
  readonly deletedAt?: FirebaseTimestamp | Date | null;
66
+ readonly updatedAt?: FirebaseTimestamp | Date | null;
64
67
  // Background job tracking
65
68
  readonly requestId?: string;
66
69
  readonly model?: string;
@@ -105,6 +108,13 @@ export function mapDocumentToCreation(
105
108
  deletedAtDate = data.deletedAt.toDate();
106
109
  }
107
110
 
111
+ let completedAtDate: Date | undefined;
112
+ if (data.completedAt instanceof Date) {
113
+ completedAtDate = data.completedAt;
114
+ } else if (data.completedAt && typeof data.completedAt === "object" && "toDate" in data.completedAt && typeof data.completedAt.toDate === "function") {
115
+ completedAtDate = data.completedAt.toDate();
116
+ }
117
+
108
118
  return {
109
119
  id,
110
120
  uri,
@@ -121,6 +131,7 @@ export function mapDocumentToCreation(
121
131
  output: data.output ?? undefined,
122
132
  requestId: data.requestId,
123
133
  model: data.model,
134
+ completedAt: completedAtDate,
124
135
  deletedAt: deletedAtDate,
125
136
  };
126
137
  }
@@ -16,6 +16,9 @@ export interface ProcessingCreationData {
16
16
  readonly duration?: number;
17
17
  readonly resolution?: string;
18
18
  readonly creditCost?: number;
19
+ readonly aspectRatio?: string;
20
+ readonly provider?: string;
21
+ readonly outputType?: string;
19
22
  }
20
23
 
21
24
  export interface CompletedCreationData {
@@ -36,6 +36,10 @@ export async function saveAsProcessing(
36
36
  ...(data.duration && { duration: data.duration }),
37
37
  ...(data.resolution && { resolution: data.resolution }),
38
38
  ...(data.creditCost && { creditCost: data.creditCost }),
39
+ ...(data.aspectRatio && { aspectRatio: data.aspectRatio }),
40
+ ...(data.provider && { provider: data.provider }),
41
+ ...(data.outputType && { outputType: data.outputType }),
42
+ startedAt: new Date().toISOString(),
39
43
  },
40
44
  });
41
45
 
@@ -26,7 +26,8 @@ export async function updateToCompleted(
26
26
  uri: data.uri,
27
27
  status: "completed" as const,
28
28
  output,
29
- });
29
+ completedAt: new Date(),
30
+ } as Partial<import("../../../../creations/domain/entities/Creation").Creation>);
30
31
 
31
32
  if (typeof __DEV__ !== "undefined" && __DEV__) {
32
33
  console.log("[CreationPersistence] Updated to completed", { creationId });
@@ -45,7 +46,8 @@ export async function updateToFailed(
45
46
  await repository.update(userId, creationId, {
46
47
  status: "failed" as const,
47
48
  metadata: { error },
48
- });
49
+ completedAt: new Date(),
50
+ } as Partial<import("../../../../creations/domain/entities/Creation").Creation>);
49
51
 
50
52
  if (typeof __DEV__ !== "undefined" && __DEV__) {
51
53
  console.log("[CreationPersistence] Updated to failed", { creationId, error });
@@ -158,6 +158,7 @@ export function useVideoQueueGeneration(props: UseVideoQueueGenerationProps): Us
158
158
  const inputData = input as Record<string, unknown>;
159
159
  const duration = typeof inputData?.duration === "number" ? inputData.duration : undefined;
160
160
  const resolution = typeof inputData?.resolution === "string" ? inputData.resolution : undefined;
161
+ const aspectRatio = typeof inputData?.aspectRatio === "string" ? inputData.aspectRatio : undefined;
161
162
 
162
163
  creationId = await persistence.saveAsProcessing(userId, {
163
164
  scenarioId: scenario.id,
@@ -166,6 +167,9 @@ export function useVideoQueueGeneration(props: UseVideoQueueGenerationProps): Us
166
167
  duration,
167
168
  resolution,
168
169
  creditCost,
170
+ aspectRatio,
171
+ provider: "fal",
172
+ outputType: scenario.outputType,
169
173
  });
170
174
  creationIdRef.current = creationId;
171
175
  } catch (error) {