@umituz/react-native-ai-generation-content 1.82.2 → 1.82.4
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/background/infrastructure/services/job-poller.service.ts +1 -1
- package/src/domains/generation/wizard/presentation/hooks/usePhotoUploadState.ts +1 -1
- package/src/infrastructure/validation/ai-validator.ts +1 -1
- package/src/infrastructure/validation/base-validator.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.4",
|
|
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",
|
|
@@ -39,7 +39,7 @@ function withAbortSignal<T>(
|
|
|
39
39
|
signal?.addEventListener("abort", abortHandler, { once: true });
|
|
40
40
|
|
|
41
41
|
// Handle timeout
|
|
42
|
-
let timeoutId:
|
|
42
|
+
let timeoutId: ReturnType<typeof setTimeout> | undefined;
|
|
43
43
|
if (timeoutMs) {
|
|
44
44
|
timeoutId = setTimeout(() => {
|
|
45
45
|
reject(new Error(`Operation timeout after ${timeoutMs}ms`));
|
|
@@ -51,7 +51,7 @@ export const usePhotoUploadState = ({
|
|
|
51
51
|
}: UsePhotoUploadStateProps): UsePhotoUploadStateReturn => {
|
|
52
52
|
const [image, setImage] = useState<UploadedImage | null>(initialImage || null);
|
|
53
53
|
const { pickImage, isLoading } = useMedia();
|
|
54
|
-
const timeoutRef = useRef<
|
|
54
|
+
const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
55
55
|
|
|
56
56
|
// Use refs to avoid effect re-runs on callback changes
|
|
57
57
|
const onErrorRef = useRef(onError);
|
|
@@ -74,7 +74,7 @@ export function validateVideoUrl(input: unknown): ValidationResult {
|
|
|
74
74
|
return urlResult;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const url = new URL(input);
|
|
77
|
+
const url = new URL(input) as URL & { pathname: string };
|
|
78
78
|
const validExtensions = [".mp4", ".mov", ".webm", ".gif"];
|
|
79
79
|
const hasValidExtension = validExtensions.some((ext) =>
|
|
80
80
|
url.pathname.toLowerCase().endsWith(ext)
|
|
@@ -102,7 +102,7 @@ export function validateURL(input: unknown): ValidationResult {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
try {
|
|
105
|
-
const url = new URL(input);
|
|
105
|
+
const url = new URL(input) as URL & { protocol: string };
|
|
106
106
|
if (!["http:", "https:"].includes(url.protocol)) {
|
|
107
107
|
return { isValid: false, errors: ["Only HTTP and HTTPS protocols are allowed"] };
|
|
108
108
|
}
|