@umituz/react-native-ai-generation-content 1.61.21 → 1.61.24
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 +2 -3
- package/src/domains/creations/presentation/hooks/index.ts +1 -1
- package/src/domains/creations/presentation/hooks/useFilter.ts +0 -4
- package/src/domains/generation/wizard/infrastructure/strategies/video-generation.utils.ts +1 -1
- package/src/features/image-to-video/infrastructure/services/image-to-video-executor.ts +6 -6
- package/src/features/text-to-image/infrastructure/services/text-to-image-executor.ts +7 -7
- package/src/features/text-to-video/infrastructure/services/text-to-video-executor.ts +6 -6
- package/src/infrastructure/executors/base-executor.ts +4 -4
- package/LICENSE +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.61.
|
|
3
|
+
"version": "1.61.24",
|
|
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",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
22
22
|
"lint": "eslint src --max-warnings 0",
|
|
23
23
|
"lint:fix": "eslint src --fix",
|
|
24
|
-
"
|
|
25
|
-
"prepublishOnly": "npm run content-check"
|
|
24
|
+
"typecheck:strict": "tsc --noEmit"
|
|
26
25
|
},
|
|
27
26
|
"keywords": [
|
|
28
27
|
"react-native",
|
|
@@ -11,7 +11,7 @@ export type {
|
|
|
11
11
|
UseAdvancedFilterProps,
|
|
12
12
|
UseAdvancedFilterReturn,
|
|
13
13
|
} from "./advancedFilter.types";
|
|
14
|
-
export { useFilter
|
|
14
|
+
export { useFilter } from "./useFilter";
|
|
15
15
|
export type { UseFilterProps, UseFilterReturn } from "./useFilter";
|
|
16
16
|
export { useGalleryFilters } from "./useGalleryFilters";
|
|
17
17
|
export { useCreationPersistence } from "./useCreationPersistence";
|
|
@@ -24,7 +24,7 @@ export function getVideoFeatureType(scenario: WizardScenarioData): VideoFeatureT
|
|
|
24
24
|
return featureType;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// Fallback: Pattern matching
|
|
27
|
+
// Fallback: Pattern matching
|
|
28
28
|
const lowerId = id.toLowerCase();
|
|
29
29
|
for (const [pattern, type] of Object.entries(VIDEO_FEATURE_PATTERNS)) {
|
|
30
30
|
if (lowerId.includes(pattern)) {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { BaseExecutor } from "../../../../infrastructure/executors/base-executor";
|
|
7
7
|
import { isSuccess, type Result } from "../../../../domain/types/result.types";
|
|
8
|
+
import type { IAIProvider } from "../../../../domain/interfaces";
|
|
8
9
|
import type {
|
|
9
10
|
ImageToVideoRequest,
|
|
10
11
|
ImageToVideoResult,
|
|
@@ -101,10 +102,9 @@ class ImageToVideoExecutor extends BaseExecutor<
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
protected async executeProvider(
|
|
104
|
-
|
|
105
|
-
provider: any,
|
|
105
|
+
provider: IAIProvider,
|
|
106
106
|
model: string,
|
|
107
|
-
input: unknown
|
|
107
|
+
input: Record<string, unknown>,
|
|
108
108
|
onProgress?: (progress: number) => void,
|
|
109
109
|
): Promise<unknown> {
|
|
110
110
|
this.logInfo("Starting provider.subscribe()...");
|
|
@@ -160,7 +160,7 @@ const executor = new ImageToVideoExecutor();
|
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
162
|
* Execute image-to-video generation
|
|
163
|
-
* Public API
|
|
163
|
+
* Public API
|
|
164
164
|
*/
|
|
165
165
|
export async function executeImageToVideo(
|
|
166
166
|
request: ImageToVideoRequest,
|
|
@@ -177,7 +177,7 @@ export async function executeImageToVideo(
|
|
|
177
177
|
},
|
|
178
178
|
);
|
|
179
179
|
|
|
180
|
-
// Convert Result<T, E>
|
|
180
|
+
// Convert Result<T, E> to return format
|
|
181
181
|
if (isSuccess(result)) {
|
|
182
182
|
return result.value;
|
|
183
183
|
}
|
|
@@ -186,7 +186,7 @@ export async function executeImageToVideo(
|
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* Check if image-to-video is supported
|
|
189
|
-
* Public API
|
|
189
|
+
* Public API
|
|
190
190
|
*/
|
|
191
191
|
export function hasImageToVideoSupport(): boolean {
|
|
192
192
|
return executor.hasSupport();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { BaseExecutor } from "../../../../infrastructure/executors/base-executor";
|
|
7
7
|
import { isSuccess, type Result } from "../../../../domain/types/result.types";
|
|
8
|
+
import type { IAIProvider } from "../../../../domain/interfaces";
|
|
8
9
|
import type {
|
|
9
10
|
TextToImageRequest,
|
|
10
11
|
TextToImageResult,
|
|
@@ -92,7 +93,7 @@ function defaultExtractResult(
|
|
|
92
93
|
return { imageUrl: dataUrl, imageUrls: [dataUrl] };
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
//
|
|
96
|
+
// Check for 'image' field
|
|
96
97
|
if (typeof r.image === "string") {
|
|
97
98
|
return { imageUrl: r.image, imageUrls: [r.image] };
|
|
98
99
|
}
|
|
@@ -121,10 +122,9 @@ class TextToImageExecutor extends BaseExecutor<
|
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
protected async executeProvider(
|
|
124
|
-
|
|
125
|
-
provider: any,
|
|
125
|
+
provider: IAIProvider,
|
|
126
126
|
model: string,
|
|
127
|
-
input: unknown
|
|
127
|
+
input: Record<string, unknown>,
|
|
128
128
|
): Promise<unknown> {
|
|
129
129
|
return provider.run(model, input);
|
|
130
130
|
}
|
|
@@ -160,7 +160,7 @@ const executor = new TextToImageExecutor();
|
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
162
|
* Execute text-to-image generation
|
|
163
|
-
* Public API
|
|
163
|
+
* Public API
|
|
164
164
|
*/
|
|
165
165
|
export async function executeTextToImage(
|
|
166
166
|
request: TextToImageRequest,
|
|
@@ -176,7 +176,7 @@ export async function executeTextToImage(
|
|
|
176
176
|
},
|
|
177
177
|
);
|
|
178
178
|
|
|
179
|
-
// Convert Result<T, E>
|
|
179
|
+
// Convert Result<T, E> to return format
|
|
180
180
|
if (isSuccess(result)) {
|
|
181
181
|
return result.value;
|
|
182
182
|
}
|
|
@@ -185,7 +185,7 @@ export async function executeTextToImage(
|
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Check if text-to-image is supported
|
|
188
|
-
* Public API
|
|
188
|
+
* Public API
|
|
189
189
|
*/
|
|
190
190
|
export function hasTextToImageSupport(): boolean {
|
|
191
191
|
return executor.hasSupport();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { BaseExecutor } from "../../../../infrastructure/executors/base-executor";
|
|
7
7
|
import { isSuccess, type Result } from "../../../../domain/types/result.types";
|
|
8
|
+
import type { IAIProvider } from "../../../../domain/interfaces";
|
|
8
9
|
import type {
|
|
9
10
|
TextToVideoRequest,
|
|
10
11
|
TextToVideoResult,
|
|
@@ -81,10 +82,9 @@ class TextToVideoExecutor extends BaseExecutor<
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
protected async executeProvider(
|
|
84
|
-
|
|
85
|
-
provider: any,
|
|
85
|
+
provider: IAIProvider,
|
|
86
86
|
model: string,
|
|
87
|
-
input: unknown
|
|
87
|
+
input: Record<string, unknown>,
|
|
88
88
|
onProgress?: (progress: number) => void,
|
|
89
89
|
): Promise<unknown> {
|
|
90
90
|
this.logInfo("Starting provider.run()...");
|
|
@@ -135,7 +135,7 @@ const executor = new TextToVideoExecutor();
|
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Execute text-to-video generation
|
|
138
|
-
* Public API
|
|
138
|
+
* Public API
|
|
139
139
|
*/
|
|
140
140
|
export async function executeTextToVideo(
|
|
141
141
|
request: TextToVideoRequest,
|
|
@@ -151,7 +151,7 @@ export async function executeTextToVideo(
|
|
|
151
151
|
},
|
|
152
152
|
);
|
|
153
153
|
|
|
154
|
-
// Convert Result<T, E>
|
|
154
|
+
// Convert Result<T, E> to return format
|
|
155
155
|
if (isSuccess(result)) {
|
|
156
156
|
return result.value;
|
|
157
157
|
}
|
|
@@ -160,7 +160,7 @@ export async function executeTextToVideo(
|
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
162
|
* Check if text-to-video is supported
|
|
163
|
-
* Public API
|
|
163
|
+
* Public API
|
|
164
164
|
*/
|
|
165
165
|
export function hasTextToVideoSupport(): boolean {
|
|
166
166
|
return executor.hasSupport();
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { providerRegistry } from "../services";
|
|
12
12
|
import { failure, success, type Result } from "../../domain/types/result.types";
|
|
13
|
+
import type { IAIProvider } from "../../domain/interfaces";
|
|
13
14
|
|
|
14
15
|
declare const __DEV__: boolean;
|
|
15
16
|
|
|
@@ -18,7 +19,7 @@ declare const __DEV__: boolean;
|
|
|
18
19
|
*/
|
|
19
20
|
export interface BaseExecutorOptions<TInput, TOutput> {
|
|
20
21
|
model: string;
|
|
21
|
-
buildInput: (request: TInput) => unknown
|
|
22
|
+
buildInput: (request: TInput) => Record<string, unknown>;
|
|
22
23
|
extractResult?: (result: unknown) => TOutput | undefined;
|
|
23
24
|
onProgress?: (progress: number) => void;
|
|
24
25
|
}
|
|
@@ -120,10 +121,9 @@ export abstract class BaseExecutor<TRequest, TResult, TOutput> {
|
|
|
120
121
|
* Subclasses implement their specific provider interaction
|
|
121
122
|
*/
|
|
122
123
|
protected abstract executeProvider(
|
|
123
|
-
|
|
124
|
-
provider: any,
|
|
124
|
+
provider: IAIProvider,
|
|
125
125
|
model: string,
|
|
126
|
-
input: unknown
|
|
126
|
+
input: Record<string, unknown>,
|
|
127
127
|
onProgress?: (progress: number) => void,
|
|
128
128
|
): Promise<unknown>;
|
|
129
129
|
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Umit Uz
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|