@umituz/react-native-ai-generation-content 1.17.305 → 1.17.306
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.17.
|
|
3
|
+
"version": "1.17.306",
|
|
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",
|
|
@@ -10,6 +10,9 @@ export interface UseCoupleFutureGenerationConfig<TInput extends CoupleFutureInpu
|
|
|
10
10
|
userId: string | undefined;
|
|
11
11
|
processResult: (imageUrl: string, input: TInput) => Promise<TResult> | TResult;
|
|
12
12
|
buildCreation?: (result: TResult, input: TInput) => Creation | null;
|
|
13
|
+
/** Check credits BEFORE generation starts - critical for security */
|
|
14
|
+
checkCredits?: () => Promise<boolean>;
|
|
15
|
+
/** Deduct credits AFTER successful generation */
|
|
13
16
|
deductCredits?: () => Promise<void>;
|
|
14
17
|
onSuccess?: (result: TResult) => void;
|
|
15
18
|
onError?: (error: string) => void;
|
|
@@ -29,6 +32,7 @@ export const useCoupleFutureGeneration = <TInput extends CoupleFutureInput, TRes
|
|
|
29
32
|
userId,
|
|
30
33
|
processResult,
|
|
31
34
|
buildCreation,
|
|
35
|
+
checkCredits,
|
|
32
36
|
deductCredits,
|
|
33
37
|
onSuccess,
|
|
34
38
|
onError,
|
|
@@ -65,6 +69,7 @@ export const useCoupleFutureGeneration = <TInput extends CoupleFutureInput, TRes
|
|
|
65
69
|
}
|
|
66
70
|
},
|
|
67
71
|
|
|
72
|
+
checkCredits,
|
|
68
73
|
deductCredits,
|
|
69
74
|
onSuccess,
|
|
70
75
|
onError: (error: PhotoGenerationError) => {
|