@umituz/react-native-ai-fal-provider 1.1.13 → 1.1.14
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": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
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",
|
|
@@ -42,7 +42,7 @@ function parseFalError(error: unknown): string {
|
|
|
42
42
|
|
|
43
43
|
function safeJsonParse(str: string): { detail?: FalApiErrorDetail[] } | null {
|
|
44
44
|
try {
|
|
45
|
-
return JSON.parse(str);
|
|
45
|
+
return JSON.parse(str) as { detail?: FalApiErrorDetail[] };
|
|
46
46
|
} catch {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
@@ -18,9 +18,12 @@ declare const __DEV__: boolean | undefined;
|
|
|
18
18
|
* Uses design system's filesystem utilities for React Native compatibility
|
|
19
19
|
*/
|
|
20
20
|
export async function uploadToFalStorage(base64: string): Promise<string> {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
|
|
22
|
+
const tempUri = (await base64ToTempFile(base64)) as string;
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
24
|
+
const fileSize = getFileSize(tempUri) as number;
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
26
|
+
const mimeType = detectMimeType(base64) as string;
|
|
24
27
|
|
|
25
28
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
26
29
|
console.log("[FalStorage] Uploading image", {
|
|
@@ -33,6 +36,7 @@ export async function uploadToFalStorage(base64: string): Promise<string> {
|
|
|
33
36
|
const blob = await response.blob();
|
|
34
37
|
const url = await fal.storage.upload(blob);
|
|
35
38
|
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
36
40
|
await deleteTempFile(tempUri);
|
|
37
41
|
|
|
38
42
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
@@ -9,10 +9,12 @@ declare const __DEV__: boolean | undefined;
|
|
|
9
9
|
|
|
10
10
|
const IMAGE_URL_KEYS = [
|
|
11
11
|
"image_url",
|
|
12
|
+
"second_image_url",
|
|
13
|
+
"third_image_url",
|
|
14
|
+
"fourth_image_url",
|
|
12
15
|
"driver_image_url",
|
|
13
16
|
"base_image_url",
|
|
14
17
|
"swap_image_url",
|
|
15
|
-
"second_image_url",
|
|
16
18
|
"mask_url",
|
|
17
19
|
"input_image_url",
|
|
18
20
|
];
|
|
@@ -88,7 +88,7 @@ export function createAiProviderInitModule(
|
|
|
88
88
|
name: 'aiProviders',
|
|
89
89
|
critical,
|
|
90
90
|
dependsOn,
|
|
91
|
-
init:
|
|
91
|
+
init: () => {
|
|
92
92
|
try {
|
|
93
93
|
const apiKey = getApiKey();
|
|
94
94
|
|
|
@@ -96,11 +96,11 @@ export function createAiProviderInitModule(
|
|
|
96
96
|
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
97
97
|
console.log('[createAiProviderInitModule] No API key - skipping');
|
|
98
98
|
}
|
|
99
|
-
return true; // Not an error, just skip
|
|
99
|
+
return Promise.resolve(true); // Not an error, just skip
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// Initialize FAL provider
|
|
103
|
-
|
|
103
|
+
falProvider.initialize({
|
|
104
104
|
apiKey,
|
|
105
105
|
videoFeatureModels,
|
|
106
106
|
});
|
|
@@ -113,13 +113,13 @@ export function createAiProviderInitModule(
|
|
|
113
113
|
console.log('[createAiProviderInitModule] AI provider initialized');
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
return true;
|
|
116
|
+
return Promise.resolve(true);
|
|
117
117
|
} catch (error) {
|
|
118
118
|
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
119
119
|
console.error('[createAiProviderInitModule] Error:', error);
|
|
120
120
|
}
|
|
121
121
|
// Continue on error - AI provider is not critical
|
|
122
|
-
return true;
|
|
122
|
+
return Promise.resolve(true);
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
};
|