@umituz/react-native-ai-fal-provider 2.0.41 → 2.1.0

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-fal-provider",
3
- "version": "2.0.41",
3
+ "version": "2.1.0",
4
4
  "description": "FAL AI provider for React Native - implements IAIProvider interface for unified AI generation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@fal-ai/client": ">=0.6.0",
31
+ "@umituz/react-native-ai-generation-content": ">=1.70.0",
31
32
  "expo": ">=54.0.0",
32
33
  "react": ">=19.0.0",
33
34
  "react-native": "0.81.4"
@@ -49,6 +50,7 @@
49
50
  "@types/react": "~19.1.0",
50
51
  "@typescript-eslint/eslint-plugin": "^7.0.0",
51
52
  "@typescript-eslint/parser": "^7.0.0",
53
+ "@umituz/react-native-ai-generation-content": "^1.70.1",
52
54
  "@umituz/react-native-auth": "*",
53
55
  "@umituz/react-native-design-system": "*",
54
56
  "@umituz/react-native-firebase": "*",
@@ -22,7 +22,7 @@ export type {
22
22
  FaceSwapOptions,
23
23
  } from "./input-builders.types";
24
24
 
25
- // Provider Types (local definitions)
25
+ // Provider Types (imported from core package)
26
26
  export type {
27
27
  ImageFeatureType,
28
28
  VideoFeatureType,
@@ -44,4 +44,4 @@ export type {
44
44
  IAIProviderImageFeatures,
45
45
  IAIProviderVideoFeatures,
46
46
  IAIProvider,
47
- } from "./provider.types";
47
+ } from "@umituz/react-native-ai-generation-content/core";
@@ -1,194 +0,0 @@
1
- /**
2
- * Provider Types
3
- * Local type definitions for FAL Provider
4
- */
5
-
6
- // =============================================================================
7
- // Feature Types
8
- // =============================================================================
9
-
10
- /**
11
- * Feature types for image processing (output: image)
12
- */
13
- export type ImageFeatureType =
14
- | "upscale"
15
- | "photo-restore"
16
- | "face-swap"
17
- | "anime-selfie"
18
- | "remove-background"
19
- | "remove-object"
20
- | "hd-touch-up"
21
- | "replace-background";
22
-
23
- /**
24
- * Feature types for video generation (output: video)
25
- */
26
- export type VideoFeatureType = "image-to-video" | "text-to-video";
27
-
28
- // =============================================================================
29
- // Provider Configuration
30
- // =============================================================================
31
-
32
- export interface AIProviderConfig {
33
- apiKey: string;
34
- maxRetries?: number;
35
- baseDelay?: number;
36
- maxDelay?: number;
37
- defaultTimeoutMs?: number;
38
- textModel?: string;
39
- textToImageModel?: string;
40
- imageEditModel?: string;
41
- videoGenerationModel?: string;
42
- }
43
-
44
- // =============================================================================
45
- // Status Types
46
- // =============================================================================
47
-
48
- export type AIJobStatusType =
49
- | "IN_QUEUE"
50
- | "IN_PROGRESS"
51
- | "COMPLETED"
52
- | "FAILED";
53
-
54
- export interface AILogEntry {
55
- message: string;
56
- level: "info" | "warn" | "error";
57
- timestamp?: string;
58
- }
59
-
60
- export interface JobSubmission {
61
- requestId: string;
62
- statusUrl?: string;
63
- responseUrl?: string;
64
- }
65
-
66
- export interface JobStatus {
67
- status: AIJobStatusType;
68
- logs?: AILogEntry[];
69
- queuePosition?: number;
70
- eta?: number;
71
- requestId?: string;
72
- }
73
-
74
- // =============================================================================
75
- // Progress & Options
76
- // =============================================================================
77
-
78
- export interface ProviderProgressInfo {
79
- progress: number;
80
- status?: AIJobStatusType;
81
- message?: string;
82
- estimatedTimeRemaining?: number;
83
- }
84
-
85
- export interface SubscribeOptions<T = unknown> {
86
- timeoutMs?: number;
87
- onQueueUpdate?: (status: JobStatus) => void;
88
- onProgress?: (progress: ProviderProgressInfo) => void;
89
- onResult?: (result: T) => void;
90
- }
91
-
92
- export interface RunOptions {
93
- onProgress?: (progress: ProviderProgressInfo) => void;
94
- signal?: AbortSignal;
95
- }
96
-
97
- // =============================================================================
98
- // Capabilities
99
- // =============================================================================
100
-
101
- export interface ProviderCapabilities {
102
- imageFeatures: readonly ImageFeatureType[];
103
- videoFeatures: readonly VideoFeatureType[];
104
- textToImage: boolean;
105
- textToVideo: boolean;
106
- imageToVideo: boolean;
107
- textToVoice: boolean;
108
- textToText: boolean;
109
- }
110
-
111
- // =============================================================================
112
- // Feature Input Data
113
- // =============================================================================
114
-
115
- export interface ImageFeatureInputData {
116
- imageBase64: string;
117
- targetImageBase64?: string;
118
- prompt?: string;
119
- options?: Record<string, unknown>;
120
- }
121
-
122
- export interface VideoFeatureInputData {
123
- sourceImageBase64?: string;
124
- targetImageBase64?: string;
125
- prompt?: string;
126
- options?: Record<string, unknown>;
127
- }
128
-
129
- // =============================================================================
130
- // Provider Interface
131
- // =============================================================================
132
-
133
- export interface IAIProviderLifecycle {
134
- initialize(config: AIProviderConfig): void;
135
- isInitialized(): boolean;
136
- reset(): void;
137
- }
138
-
139
- export interface IAIProviderCapabilities {
140
- getCapabilities(): ProviderCapabilities;
141
- isFeatureSupported(feature: ImageFeatureType | VideoFeatureType): boolean;
142
- }
143
-
144
- export interface IAIProviderJobManager {
145
- submitJob(
146
- model: string,
147
- input: Record<string, unknown>,
148
- ): Promise<JobSubmission>;
149
- getJobStatus(model: string, requestId: string): Promise<JobStatus>;
150
- getJobResult<T = unknown>(model: string, requestId: string): Promise<T>;
151
- }
152
-
153
- export interface IAIProviderExecutor {
154
- subscribe<T = unknown>(
155
- model: string,
156
- input: Record<string, unknown>,
157
- options?: SubscribeOptions<T>,
158
- ): Promise<T>;
159
- run<T = unknown>(
160
- model: string,
161
- input: Record<string, unknown>,
162
- options?: RunOptions,
163
- ): Promise<T>;
164
- }
165
-
166
- export interface IAIProviderImageFeatures {
167
- getImageFeatureModel(feature: ImageFeatureType): string;
168
- buildImageFeatureInput(
169
- feature: ImageFeatureType,
170
- data: ImageFeatureInputData,
171
- ): Record<string, unknown>;
172
- }
173
-
174
- export interface IAIProviderVideoFeatures {
175
- getVideoFeatureModel(feature: VideoFeatureType): string;
176
- buildVideoFeatureInput(
177
- feature: VideoFeatureType,
178
- data: VideoFeatureInputData,
179
- ): Record<string, unknown>;
180
- }
181
-
182
- /**
183
- * Main AI Provider Interface
184
- */
185
- export interface IAIProvider
186
- extends IAIProviderLifecycle,
187
- IAIProviderCapabilities,
188
- IAIProviderJobManager,
189
- IAIProviderExecutor,
190
- IAIProviderImageFeatures,
191
- IAIProviderVideoFeatures {
192
- readonly providerId: string;
193
- readonly providerName: string;
194
- }