@umituz/react-native-ai-fal-provider 2.1.5 → 2.1.7
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/exports/infrastructure.ts +0 -2
- package/src/index.ts +1 -1
- package/src/infrastructure/services/fal-provider-subscription.ts +1 -1
- package/src/infrastructure/services/index.ts +0 -16
- package/src/infrastructure/utils/cost-tracker.ts +1 -1
- package/src/infrastructure/utils/fal-error-handler.util.ts +1 -1
- package/src/infrastructure/utils/index.ts +9 -13
- package/src/infrastructure/utils/input-validator.util.ts +1 -1
- package/src/infrastructure/utils/job-metadata/job-metadata-queries.util.ts +2 -2
- package/src/infrastructure/utils/job-storage/job-storage-crud.util.ts +1 -1
- package/src/infrastructure/utils/job-storage/job-storage-queries.util.ts +1 -1
- package/src/presentation/hooks/use-fal-generation.ts +1 -1
- package/src/infrastructure/utils/collection-filters.util.ts +0 -9
- package/src/infrastructure/utils/data-parsers.util.ts +0 -9
- package/src/infrastructure/utils/error-mapper.ts +0 -24
- package/src/infrastructure/utils/formatting.util.ts +0 -13
- package/src/infrastructure/utils/general-helpers.util.ts +0 -9
- package/src/infrastructure/utils/input-builders.util.ts +0 -6
- package/src/infrastructure/utils/type-guards.util.ts +0 -9
- package/src/infrastructure/validators/index.ts +0 -6
- package/src/init/index.ts +0 -10
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { DEFAULT_FAL_CONFIG } from "./fal-provider.constants";
|
|
|
10
10
|
import { mapFalStatusToJobStatus } from "./fal-status-mapper";
|
|
11
11
|
import { validateNSFWContent } from "../validators/nsfw-validator";
|
|
12
12
|
import { NSFWContentError } from "./nsfw-content-error";
|
|
13
|
-
import { parseFalError } from "../utils/error-
|
|
13
|
+
import { parseFalError } from "../utils/fal-error-handler.util";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Handle FAL subscription with timeout and cancellation
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* Services Index
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { falProvider } from "./fal-provider";
|
|
6
|
-
|
|
7
5
|
export { FalProvider, falProvider } from "./fal-provider";
|
|
8
6
|
export type { FalProvider as FalProviderType } from "./fal-provider";
|
|
9
7
|
export { falModelsService, type FalModelConfig, type ModelSelectionResult } from "./fal-models.service";
|
|
@@ -21,17 +19,3 @@ export {
|
|
|
21
19
|
stopAutomaticCleanup,
|
|
22
20
|
} from "./request-store";
|
|
23
21
|
export type { ActiveRequest } from "./request-store";
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Cancel the current running FAL request
|
|
27
|
-
*/
|
|
28
|
-
export function cancelCurrentFalRequest(): void {
|
|
29
|
-
falProvider.cancelCurrentRequest();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Check if there's a running FAL request
|
|
34
|
-
*/
|
|
35
|
-
export function hasRunningFalRequest(): boolean {
|
|
36
|
-
return falProvider.hasRunningRequest();
|
|
37
|
-
}
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ModelCostInfo,
|
|
10
10
|
} from "../../domain/entities/cost-tracking.types";
|
|
11
11
|
import { findModelById } from "../../domain/constants/default-models.constants";
|
|
12
|
-
import { filterByProperty, filterByTimeRange } from "./
|
|
12
|
+
import { filterByProperty, filterByTimeRange } from "./collections";
|
|
13
13
|
|
|
14
14
|
export type { GenerationCost } from "../../domain/entities/cost-tracking.types";
|
|
15
15
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { FalErrorInfo, FalErrorCategory, FalErrorType } from "../../domain/entities/error.types";
|
|
7
7
|
import { FalErrorType as ErrorTypeEnum } from "../../domain/entities/error.types";
|
|
8
|
-
import { safeJsonParseOrNull } from "./
|
|
8
|
+
import { safeJsonParseOrNull } from "./parsers";
|
|
9
9
|
|
|
10
10
|
const STATUS_CODES = ["400", "401", "402", "403", "404", "422", "429", "500", "502", "503", "504"];
|
|
11
11
|
|
|
@@ -11,7 +11,7 @@ export {
|
|
|
11
11
|
sortByDateAscending,
|
|
12
12
|
sortByNumberDescending,
|
|
13
13
|
sortByNumberAscending,
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./collections";
|
|
15
15
|
|
|
16
16
|
export {
|
|
17
17
|
safeJsonParse,
|
|
@@ -19,7 +19,7 @@ export {
|
|
|
19
19
|
safeJsonStringify,
|
|
20
20
|
isValidJson,
|
|
21
21
|
validateObjectStructure,
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./parsers";
|
|
23
23
|
|
|
24
24
|
export { categorizeFalError } from "./error-categorizer";
|
|
25
25
|
export {
|
|
@@ -27,20 +27,16 @@ export {
|
|
|
27
27
|
parseFalError,
|
|
28
28
|
isFalErrorRetryable,
|
|
29
29
|
extractStatusCode,
|
|
30
|
-
} from "./error-
|
|
30
|
+
} from "./fal-error-handler.util";
|
|
31
31
|
|
|
32
|
-
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
formatDuration,
|
|
36
|
-
formatDate,
|
|
37
|
-
truncateText,
|
|
38
|
-
} from "./formatting.util";
|
|
32
|
+
export { formatDate } from "./date-format.util";
|
|
33
|
+
export { formatNumber, formatBytes, formatDuration } from "./number-format.util";
|
|
34
|
+
export { truncateText } from "./string-format.util";
|
|
39
35
|
|
|
40
36
|
export {
|
|
41
37
|
buildSingleImageInput,
|
|
42
38
|
buildDualImageInput,
|
|
43
|
-
} from "./
|
|
39
|
+
} from "./base-builders.util";
|
|
44
40
|
|
|
45
41
|
export {
|
|
46
42
|
isFalModelType,
|
|
@@ -52,7 +48,7 @@ export {
|
|
|
52
48
|
isValidPrompt,
|
|
53
49
|
isValidTimeout,
|
|
54
50
|
isValidRetryCount,
|
|
55
|
-
} from "./type-guards
|
|
51
|
+
} from "./type-guards";
|
|
56
52
|
|
|
57
53
|
export {
|
|
58
54
|
formatImageDataUri,
|
|
@@ -77,7 +73,7 @@ export {
|
|
|
77
73
|
removeNullish,
|
|
78
74
|
generateUniqueId,
|
|
79
75
|
sleep,
|
|
80
|
-
} from "./
|
|
76
|
+
} from "./helpers";
|
|
81
77
|
|
|
82
78
|
export { preprocessInput } from "./input-preprocessor.util";
|
|
83
79
|
export { validateInput } from "./input-validator.util";
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import type { FalJobMetadata } from "./job-metadata.types";
|
|
7
7
|
import { isJobStale, isJobRunning, isJobCompleted } from "./job-metadata-lifecycle.util";
|
|
8
|
-
import { sortByDateDescending, filterByPredicate } from "../
|
|
9
|
-
import { safeJsonParseOrNull, validateObjectStructure } from "../
|
|
8
|
+
import { sortByDateDescending, filterByPredicate } from "../collections";
|
|
9
|
+
import { safeJsonParseOrNull, validateObjectStructure } from "../parsers";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Serialize job metadata for storage
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type { FalJobMetadata } from "../job-metadata";
|
|
7
7
|
import { updateJobMetadata } from "../job-metadata";
|
|
8
8
|
import type { IJobStorage } from "./job-storage-interface";
|
|
9
|
-
import { safeJsonParseOrNull, safeJsonStringify } from "../
|
|
9
|
+
import { safeJsonParseOrNull, safeJsonStringify } from "../parsers";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Save job metadata to storage
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type { FalJobMetadata } from "../job-metadata";
|
|
7
7
|
import type { IJobStorage } from "./job-storage-interface";
|
|
8
8
|
import { deleteJobMetadata } from "./job-storage-crud.util";
|
|
9
|
-
import { safeJsonParseOrNull } from "../
|
|
9
|
+
import { safeJsonParseOrNull } from "../parsers";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Load all jobs from storage
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { useState, useCallback, useRef, useEffect } from "react";
|
|
7
7
|
import { falProvider } from "../../infrastructure/services/fal-provider";
|
|
8
|
-
import { mapFalError } from "../../infrastructure/utils/error-
|
|
8
|
+
import { mapFalError } from "../../infrastructure/utils/fal-error-handler.util";
|
|
9
9
|
import { FalGenerationStateManager } from "../../infrastructure/utils/fal-generation-state-manager.util";
|
|
10
10
|
import type { FalJobInput, FalQueueStatus } from "../../domain/entities/fal.types";
|
|
11
11
|
import type { FalErrorInfo } from "../../domain/entities/error.types";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collection Filter Utilities
|
|
3
|
-
* @deprecated This file is now split into smaller modules for better maintainability.
|
|
4
|
-
* Import from './collections' submodules instead.
|
|
5
|
-
*
|
|
6
|
-
* This file re-exports all functions for backward compatibility.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export * from './collections';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Data Parser Utilities
|
|
3
|
-
* @deprecated This file is now split into smaller modules for better maintainability.
|
|
4
|
-
* Import from './parsers' submodules instead.
|
|
5
|
-
*
|
|
6
|
-
* This file re-exports all functions for backward compatibility.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export * from './parsers';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FAL Error Mapper - Maps errors to user-friendly info
|
|
3
|
-
*
|
|
4
|
-
* @deprecated This module is a re-export for backward compatibility.
|
|
5
|
-
* Import directly from './fal-error-handler.util' instead.
|
|
6
|
-
*
|
|
7
|
-
* This module re-exports error handling functions from the unified
|
|
8
|
-
* fal-error-handler.util module for backward compatibility.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* // Instead of:
|
|
12
|
-
* import { mapFalError } from './error-mapper';
|
|
13
|
-
*
|
|
14
|
-
* // Use:
|
|
15
|
-
* import { mapFalError } from './fal-error-handler.util';
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
mapFalError,
|
|
20
|
-
parseFalError,
|
|
21
|
-
isFalErrorRetryable,
|
|
22
|
-
categorizeFalError,
|
|
23
|
-
extractStatusCode,
|
|
24
|
-
} from "./fal-error-handler.util";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formatting Utilities
|
|
3
|
-
* Common formatting functions for display and data presentation
|
|
4
|
-
*
|
|
5
|
-
* This module re-exports formatting utilities from specialized modules
|
|
6
|
-
* for better organization and maintainability.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { formatDate } from "./date-format.util";
|
|
10
|
-
|
|
11
|
-
export { formatNumber, formatBytes, formatDuration } from "./number-format.util";
|
|
12
|
-
|
|
13
|
-
export { truncateText } from "./string-format.util";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* General Helper Utilities
|
|
3
|
-
* @deprecated This file is now split into smaller modules for better maintainability.
|
|
4
|
-
* Import from './helpers' submodules instead.
|
|
5
|
-
*
|
|
6
|
-
* This file re-exports all functions for backward compatibility.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export * from './helpers';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type Guards and Validation Utilities
|
|
3
|
-
* @deprecated This file is now split into smaller modules for better maintainability.
|
|
4
|
-
* Import from './type-guards' submodules instead.
|
|
5
|
-
*
|
|
6
|
-
* This file re-exports all functions for backward compatibility.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export * from './type-guards';
|
package/src/init/index.ts
DELETED