@umituz/react-native-ai-pruna-provider 1.0.30 → 1.0.31

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-pruna-provider",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Pruna AI provider for React Native - implements IAIProvider interface for unified AI generation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -86,15 +86,27 @@ export async function uploadFileToStorage(
86
86
  const timeoutId = setTimeout(() => uploadController.abort(), UPLOAD_CONFIG.timeoutMs);
87
87
 
88
88
  try {
89
- // Create FormData with data URI string (React Native compatible)
89
+ // Create FormData with file object format (React Native compatible)
90
90
  const formData = new FormData();
91
- formData.append('content', dataUri);
91
+
92
+ // React Native expects {uri, type, name} format for file uploads
93
+ const fileObject = {
94
+ uri: dataUri,
95
+ type: mimeType,
96
+ name: 'upload.jpg',
97
+ } as any;
98
+
99
+ formData.append('content', fileObject);
92
100
 
93
101
  // __DEV__ log FormData
94
102
  if (typeof __DEV__ !== 'undefined' && __DEV__) {
95
- console.log(`[DEV] [${TAG}] FormData created (data URI format):`, {
103
+ console.log(`[DEV] [${TAG}] FormData created (file object format):`, {
96
104
  hasContent: formData.has('content'),
97
- dataUriLength: dataUri.length,
105
+ fileObject: {
106
+ uri: fileObject.uri.substring(0, 50) + '...',
107
+ type: fileObject.type,
108
+ name: fileObject.name,
109
+ },
98
110
  });
99
111
  }
100
112