@umituz/react-native-ai-generation-content 1.26.59 → 1.26.61
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.26.
|
|
3
|
+
"version": "1.26.61",
|
|
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",
|
|
@@ -193,8 +193,8 @@ export interface CoupleFeatureSelection {
|
|
|
193
193
|
export interface ScenarioData {
|
|
194
194
|
readonly id: string;
|
|
195
195
|
readonly category?: string;
|
|
196
|
-
readonly title
|
|
197
|
-
readonly description
|
|
196
|
+
readonly title?: string;
|
|
197
|
+
readonly description?: string;
|
|
198
198
|
readonly icon?: string;
|
|
199
199
|
readonly imageUrl?: string;
|
|
200
200
|
readonly previewImageUrl?: string;
|
|
@@ -202,4 +202,5 @@ export interface ScenarioData {
|
|
|
202
202
|
readonly storyTemplate?: string;
|
|
203
203
|
readonly requiresPhoto?: boolean;
|
|
204
204
|
readonly hidden?: boolean;
|
|
205
|
+
readonly [key: string]: unknown;
|
|
205
206
|
}
|
|
@@ -75,8 +75,8 @@ export const useGenerationOrchestrator = <TInput, TResult>(
|
|
|
75
75
|
// Wrap credit hook to match expected interface
|
|
76
76
|
const defaultCredits = {
|
|
77
77
|
checkCredits: creditHook.checkCredits,
|
|
78
|
-
deductCredit: async (amount: number) => {
|
|
79
|
-
|
|
78
|
+
deductCredit: async (amount: number): Promise<boolean> => {
|
|
79
|
+
return creditHook.deductCredit(amount);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
|
|
@@ -216,7 +216,16 @@ export const useGenerationOrchestrator = <TInput, TResult>(
|
|
|
216
216
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
217
217
|
console.log("[Orchestrator] 💳 Deducting credit:", creditCost);
|
|
218
218
|
}
|
|
219
|
-
await deductCredit(creditCost);
|
|
219
|
+
const creditDeducted = await deductCredit(creditCost);
|
|
220
|
+
if (!creditDeducted) {
|
|
221
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
222
|
+
console.log("[Orchestrator] ❌ Credit deduction failed");
|
|
223
|
+
}
|
|
224
|
+
throw createGenerationError("credits", "Failed to deduct credits");
|
|
225
|
+
}
|
|
226
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
227
|
+
console.log("[Orchestrator] ✅ Credit deducted successfully");
|
|
228
|
+
}
|
|
220
229
|
|
|
221
230
|
// Success
|
|
222
231
|
if (isMountedRef.current) {
|
|
@@ -65,8 +65,8 @@ export interface ModerationCallbacks {
|
|
|
65
65
|
export interface CreditCallbacks {
|
|
66
66
|
/** Check if user can afford the cost */
|
|
67
67
|
checkCredits: (cost: number) => Promise<boolean>;
|
|
68
|
-
/** Deduct credits after successful generation */
|
|
69
|
-
deductCredits: (cost: number) => Promise<
|
|
68
|
+
/** Deduct credits after successful generation - returns true if successful */
|
|
69
|
+
deductCredits: (cost: number) => Promise<boolean>;
|
|
70
70
|
/** Called when credits are exhausted */
|
|
71
71
|
onCreditsExhausted?: () => void;
|
|
72
72
|
}
|