@umituz/react-native-ai-generation-content 1.89.1 → 1.89.3
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 +1 -1
- package/src/domains/content-moderation/infrastructure/services/moderators/base.moderator.ts +1 -1
- package/src/domains/creations/infrastructure/repositories/creation-create.operations.ts +8 -8
- package/src/domains/creations/infrastructure/repositories/creation-update.operations.ts +4 -2
- package/src/domains/creations/infrastructure/repositories/creations-state-operations.ts +2 -2
- package/src/domains/generation/infrastructure/flow/useFlow.ts +3 -4
- package/src/domains/generation/wizard/presentation/hooks/videoQueuePoller.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.3",
|
|
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",
|
|
@@ -34,7 +34,7 @@ export abstract class BaseModerator {
|
|
|
34
34
|
|
|
35
35
|
protected getSuggestion(type: ViolationType): string {
|
|
36
36
|
if (this.customSuggestions?.[type]) {
|
|
37
|
-
return this.customSuggestions[type]
|
|
37
|
+
return this.customSuggestions[type]!;
|
|
38
38
|
}
|
|
39
39
|
return DEFAULT_SUGGESTIONS[type] || DEFAULT_SUGGESTIONS.default;
|
|
40
40
|
}
|
|
@@ -18,17 +18,17 @@ export async function createCreation(
|
|
|
18
18
|
type: creation.type,
|
|
19
19
|
uri: creation.uri,
|
|
20
20
|
createdAt: creation.createdAt,
|
|
21
|
-
deletedAt:
|
|
21
|
+
deletedAt: undefined,
|
|
22
22
|
metadata: creation.metadata ?? {},
|
|
23
23
|
isShared: creation.isShared ?? false,
|
|
24
24
|
isFavorite: creation.isFavorite ?? false,
|
|
25
|
-
status: creation.status ??
|
|
26
|
-
output: creation.output ??
|
|
27
|
-
prompt: creation.prompt ??
|
|
28
|
-
provider: creation.provider ??
|
|
29
|
-
requestId: creation.requestId ??
|
|
30
|
-
model: creation.model ??
|
|
31
|
-
startedAt: creation.startedAt ??
|
|
25
|
+
status: creation.status ?? undefined,
|
|
26
|
+
output: creation.output ?? undefined,
|
|
27
|
+
prompt: creation.prompt ?? undefined,
|
|
28
|
+
provider: creation.provider ?? undefined,
|
|
29
|
+
requestId: creation.requestId ?? undefined,
|
|
30
|
+
model: creation.model ?? undefined,
|
|
31
|
+
startedAt: creation.startedAt ?? undefined,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
try {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Creation Update Operations
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { updateDoc } from "firebase/firestore";
|
|
5
|
+
import { updateDoc, type FieldValue } from "firebase/firestore";
|
|
6
6
|
import type { IPathResolver } from "@umituz/react-native-firebase";
|
|
7
7
|
import type { Creation } from "../../domain/entities/Creation";
|
|
8
8
|
import { UPDATABLE_FIELDS } from "../../domain/constants";
|
|
@@ -37,7 +37,9 @@ export async function updateCreation(
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
|
-
|
|
40
|
+
// TypeScript: updateDoc expects specific Firestore types, but our updateData is correct
|
|
41
|
+
// We filter to only valid fields, so this cast is safe
|
|
42
|
+
await updateDoc(docRef, updateData as { [x: string]: FieldValue | Partial<unknown> | undefined });
|
|
41
43
|
if (__DEV__) {
|
|
42
44
|
console.log("[updateCreation] Updated", {
|
|
43
45
|
id,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* State-specific operations like sharing, favoriting, and rating
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { updateDoc } from "firebase/firestore";
|
|
6
|
+
import { updateDoc, type FieldValue } from "firebase/firestore";
|
|
7
7
|
import type { IPathResolver } from "./CreationsFetcher";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -69,7 +69,7 @@ export async function rateCreation(
|
|
|
69
69
|
updates.ratingText = description;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
await updateDoc(docRef, updates);
|
|
72
|
+
await updateDoc(docRef, updates as { [x: string]: FieldValue | Partial<unknown> | undefined });
|
|
73
73
|
return true;
|
|
74
74
|
} catch {
|
|
75
75
|
return false;
|
|
@@ -27,14 +27,14 @@ interface UseFlowReturn extends FlowState, FlowActions {
|
|
|
27
27
|
|
|
28
28
|
export const useFlow = (config: UseFlowConfig): UseFlowReturn => {
|
|
29
29
|
const storeRef = useRef<FlowStoreType | null>(null);
|
|
30
|
-
const prevConfigRef = useRef<{ initialStepIndex?: number; initialStepId?: string;
|
|
30
|
+
const prevConfigRef = useRef<{ initialStepIndex?: number; initialStepId?: string; steps: readonly StepDefinition[] } | undefined>(undefined);
|
|
31
31
|
|
|
32
32
|
// Detect config changes (initialStepIndex, initialStepId, or steps changed)
|
|
33
33
|
const configChanged =
|
|
34
34
|
prevConfigRef.current !== undefined &&
|
|
35
35
|
(prevConfigRef.current.initialStepIndex !== config.initialStepIndex ||
|
|
36
36
|
prevConfigRef.current.initialStepId !== config.initialStepId ||
|
|
37
|
-
prevConfigRef.current.
|
|
37
|
+
prevConfigRef.current.steps !== config.steps);
|
|
38
38
|
|
|
39
39
|
// If config changed, reset and recreate store (per-component instance)
|
|
40
40
|
if (configChanged && storeRef.current) {
|
|
@@ -51,11 +51,10 @@ export const useFlow = (config: UseFlowConfig): UseFlowReturn => {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// Store current config for next render comparison
|
|
55
54
|
prevConfigRef.current = {
|
|
56
55
|
initialStepIndex: config.initialStepIndex,
|
|
57
56
|
initialStepId: config.initialStepId,
|
|
58
|
-
|
|
57
|
+
steps: config.steps,
|
|
59
58
|
};
|
|
60
59
|
|
|
61
60
|
const store = storeRef.current;
|
|
@@ -96,7 +96,8 @@ export const pollQueueStatus = async (params: PollParams): Promise<void> => {
|
|
|
96
96
|
} else {
|
|
97
97
|
// Try to extract error from FAL job logs (error-level log takes priority)
|
|
98
98
|
const logs = status.logs ?? [];
|
|
99
|
-
const
|
|
99
|
+
const errorLogs = logs.filter((l: any) => l.level === "error");
|
|
100
|
+
const errorLog = errorLogs.length > 0 ? errorLogs[errorLogs.length - 1] : logs[logs.length - 1];
|
|
100
101
|
const failMessage =
|
|
101
102
|
errorLog?.message && errorLog.message !== "[object Object]"
|
|
102
103
|
? errorLog.message
|