@umituz/react-native-ai-generation-content 1.83.10 → 1.83.12

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.
Files changed (201) hide show
  1. package/package.json +1 -1
  2. package/src/domain/constants/queue-status.constants.ts +0 -2
  3. package/src/domain/entities/flow-config-data.types.ts +0 -9
  4. package/src/domain/entities/flow-config.types.ts +2 -6
  5. package/src/domain/entities/flow-configuration.types.ts +1 -8
  6. package/src/domain/interfaces/app-services.interface.ts +2 -2
  7. package/src/domain/interfaces/index.ts +0 -8
  8. package/src/domains/background/infrastructure/services/job-poller.service.ts +0 -1
  9. package/src/domains/background/infrastructure/utils/result-validator.util.ts +0 -1
  10. package/src/domains/background/infrastructure/utils/status-checker.util.ts +0 -1
  11. package/src/domains/background/infrastructure/utils/status-extraction-helpers.ts +1 -1
  12. package/src/domains/content-moderation/infrastructure/utils/content-security.util.ts +1 -1
  13. package/src/domains/creations/domain/constants/creation-fields.constants.ts +1 -10
  14. package/src/domains/creations/domain/constants/creation-status.constants.ts +0 -20
  15. package/src/domains/creations/domain/constants/creation-validation.constants.ts +0 -12
  16. package/src/domains/creations/domain/constants/index.ts +3 -15
  17. package/src/domains/creations/domain/entities/index.ts +1 -1
  18. package/src/domains/creations/infrastructure/repositories/creation-update.operations.ts +0 -2
  19. package/src/domains/creations/infrastructure/repositories/creations-operations.ts +1 -1
  20. package/src/domains/creations/presentation/components/CreationCard.tsx +3 -3
  21. package/src/domains/creations/presentation/components/CreationImagePreview.tsx +1 -1
  22. package/src/domains/creations/presentation/components/CreationVideoPreview.tsx +1 -1
  23. package/src/domains/creations/presentation/components/CreationsFilterBar.tsx +0 -1
  24. package/src/domains/creations/presentation/components/GalleryEmptyStates.tsx +4 -4
  25. package/src/domains/creations/presentation/components/GalleryHeader.tsx +3 -1
  26. package/src/domains/creations/presentation/components/GalleryScreenHeader.tsx +1 -1
  27. package/src/domains/creations/presentation/components/index.ts +0 -23
  28. package/src/domains/creations/presentation/hooks/creation-validators.ts +4 -4
  29. package/src/domains/creations/presentation/hooks/filterHelpers.ts +5 -5
  30. package/src/domains/creations/presentation/hooks/useFilter.ts +2 -2
  31. package/src/domains/creations/presentation/hooks/useGalleryCallbacks.ts +24 -19
  32. package/src/domains/creations/presentation/hooks/useGalleryState.ts +2 -2
  33. package/src/domains/creations/presentation/hooks/useProcessingJobsPoller.ts +24 -15
  34. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -1
  35. package/src/domains/creations/presentation/utils/filter-buttons.util.ts +2 -2
  36. package/src/domains/creations/presentation-exports.ts +5 -3
  37. package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +1 -1
  38. package/src/domains/generation/infrastructure/executors/text-to-image-executor.helpers.ts +1 -1
  39. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.strategy.ts +0 -2
  40. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.types.ts +0 -4
  41. package/src/domains/generation/wizard/infrastructure/strategies/index.ts +0 -1
  42. package/src/domains/generation/wizard/infrastructure/strategies/shared/unified-prompt-builder.ts +1 -1
  43. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.strategy.ts +0 -1
  44. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.types.ts +2 -6
  45. package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.constants.ts +0 -7
  46. package/src/domains/generation/wizard/infrastructure/strategies/wizard-strategy.factory.ts +1 -3
  47. package/src/domains/generation/wizard/infrastructure/utils/creation-persistence.util.ts +0 -5
  48. package/src/domains/generation/wizard/infrastructure/utils/index.ts +0 -3
  49. package/src/domains/generation/wizard/infrastructure/utils/primitive-extractors.ts +3 -3
  50. package/src/domains/generation/wizard/presentation/components/IndeterminateProgressBar.tsx +1 -1
  51. package/src/domains/generation/wizard/presentation/components/WizardContinueButton.tsx +1 -1
  52. package/src/domains/generation/wizard/presentation/components/WizardFlowContent.tsx +1 -1
  53. package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.tsx +0 -2
  54. package/src/domains/generation/wizard/presentation/components/WizardStepRenderer.utils.ts +0 -7
  55. package/src/domains/generation/wizard/presentation/components/index.ts +0 -2
  56. package/src/domains/generation/wizard/presentation/components/step-renderers/renderPhotoUploadStep.tsx +1 -1
  57. package/src/domains/generation/wizard/presentation/components/step-renderers/renderPreviewStep.tsx +1 -1
  58. package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx +1 -1
  59. package/src/domains/generation/wizard/presentation/components/step-renderers/renderTextInputStep.tsx +1 -1
  60. package/src/domains/generation/wizard/presentation/hooks/generationStateMachine.ts +2 -2
  61. package/src/domains/generation/wizard/presentation/hooks/useGenerationPhase.ts +1 -1
  62. package/src/domains/generation/wizard/presentation/hooks/usePhotoBlockingGeneration.ts +2 -2
  63. package/src/domains/generation/wizard/presentation/hooks/useWizardFlowHandlers.ts +1 -1
  64. package/src/domains/generation/wizard/presentation/screens/GeneratingScreen.tsx +1 -1
  65. package/src/domains/generation/wizard/presentation/screens/GenericPhotoUploadScreen.tsx +3 -3
  66. package/src/domains/generation/wizard/presentation/screens/SelectionScreen.tsx +0 -6
  67. package/src/domains/generation/wizard/presentation/screens/TextInputScreen.tsx +5 -3
  68. package/src/domains/generation/wizard/presentation/screens/index.ts +0 -13
  69. package/src/domains/generation/wizard/presentation/utilities/validateScenario.ts +0 -6
  70. package/src/domains/image-to-video/presentation/hooks/image-to-video-feature.types.ts +0 -8
  71. package/src/domains/image-to-video/presentation/index.ts +0 -4
  72. package/src/domains/result-preview/presentation/components/StarRatingPicker.tsx +1 -1
  73. package/src/domains/result-preview/presentation/types/result-preview.types.ts +0 -5
  74. package/src/domains/scenarios/configs/index.ts +1 -6
  75. package/src/domains/scenarios/configs/wizard-step-factories.ts +1 -1
  76. package/src/domains/scenarios/infrastructure/scenario-registry.ts +0 -9
  77. package/src/domains/scenarios/presentation/components/ScenarioContinueButton.tsx +1 -1
  78. package/src/domains/scenarios/presentation/hooks/useHierarchicalScenarios.ts +2 -2
  79. package/src/domains/scenarios/presentation/screens/HierarchicalScenarioListScreen.tsx +1 -1
  80. package/src/domains/scenarios/presentation/screens/ScenarioPreviewScreen.tsx +2 -2
  81. package/src/domains/shared/presentation/components/AutoSkipPreview.tsx +1 -1
  82. package/src/domains/shared/presentation/components/index.ts +0 -1
  83. package/src/domains/shared/presentation/utils/index.ts +0 -3
  84. package/src/domains/shared/presentation/utils/wizard-flow.utils.ts +2 -2
  85. package/src/domains/text-to-image/presentation/index.ts +0 -2
  86. package/src/domains/text-to-video/domain/types/component.types.ts +0 -6
  87. package/src/domains/text-to-video/domain/types/index.ts +0 -4
  88. package/src/domains/text-to-video/presentation/components/FrameSelector.tsx +97 -52
  89. package/src/domains/text-to-video/presentation/index.ts +0 -2
  90. package/src/infrastructure/config/index.ts +0 -2
  91. package/src/infrastructure/constants/index.ts +0 -6
  92. package/src/infrastructure/constants/polling.constants.ts +0 -21
  93. package/src/infrastructure/constants/validation.constants.ts +0 -30
  94. package/src/infrastructure/utils/error-classification.ts +1 -1
  95. package/src/infrastructure/utils/error-factory.ts +2 -2
  96. package/src/infrastructure/utils/index.ts +0 -9
  97. package/src/infrastructure/utils/message-extractor.ts +1 -20
  98. package/src/infrastructure/utils/progress.utils.ts +0 -37
  99. package/src/infrastructure/utils/provider-validator.util.ts +1 -1
  100. package/src/infrastructure/utils/url-extractor/index.ts +0 -5
  101. package/src/infrastructure/utils/url-extractor.util.ts +0 -11
  102. package/src/infrastructure/utils/video-helpers.ts +1 -1
  103. package/src/infrastructure/validation/ai-validator.ts +0 -28
  104. package/src/infrastructure/validation/entity-validator.ts +0 -34
  105. package/src/infrastructure/validation/input-validator.ts +2 -5
  106. package/src/infrastructure/validation/sanitizer.ts +0 -17
  107. package/src/presentation/components/AIGenerationConfig.tsx +3 -1
  108. package/src/presentation/components/GenerationProgressContent.styles.ts +0 -2
  109. package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +0 -1
  110. package/src/presentation/components/ProgressCloseButton.tsx +1 -1
  111. package/src/presentation/components/ProgressDismissButton.tsx +1 -1
  112. package/src/presentation/components/ProgressHeader.tsx +1 -1
  113. package/src/presentation/components/ProgressHint.tsx +1 -1
  114. package/src/presentation/components/display/AIGenerationResult.tsx +6 -4
  115. package/src/presentation/components/display/index.ts +0 -1
  116. package/src/presentation/components/moderation/ModerationSummary.tsx +2 -2
  117. package/src/presentation/components/prompts/ExamplePrompts.tsx +2 -2
  118. package/src/presentation/components/result/ResultImageCard.tsx +39 -21
  119. package/src/presentation/components/result/ResultStoryCard.tsx +38 -15
  120. package/src/presentation/components/result/button-style.utils.ts +1 -1
  121. package/src/presentation/components/selectors/GridSelector.tsx +2 -2
  122. package/src/presentation/components/selectors/factories/aspect-ratio.factory.ts +0 -2
  123. package/src/presentation/components/selectors/factories/duration.factory.ts +0 -2
  124. package/src/presentation/components/selectors/factories/style.factory.ts +1 -1
  125. package/src/presentation/components/shared/ModelSelector.tsx +3 -1
  126. package/src/presentation/hooks/ai-feature-callbacks-auth.hooks.ts +2 -2
  127. package/src/presentation/hooks/ai-feature-callbacks-cost.hooks.ts +2 -2
  128. package/src/presentation/hooks/ai-feature-callbacks-execution.hooks.ts +2 -2
  129. package/src/presentation/hooks/generation/index.ts +0 -5
  130. package/src/presentation/hooks/generation/moderation-handler.ts +1 -1
  131. package/src/presentation/hooks/generation/types.ts +0 -12
  132. package/src/presentation/hooks/index.ts +0 -4
  133. package/src/presentation/hooks/useProgressDismiss.ts +1 -1
  134. package/src/presentation/layouts/types/layout-props.ts +1 -1
  135. package/src/domain/constants/index.ts +0 -2
  136. package/src/domain/entities/feature-flow-config.types.ts +0 -17
  137. package/src/domain/entities/scenario-step-config.types.ts +0 -32
  138. package/src/domain/entities/step-config.types.ts +0 -18
  139. package/src/domain/entities/step-definition.types.ts +0 -50
  140. package/src/domain/entities/step-input-config.types.ts +0 -36
  141. package/src/domain/entities/step-upload-config.types.ts +0 -17
  142. package/src/domains/background/domain/entities/index.ts +0 -1
  143. package/src/domains/background/domain/interfaces/index.ts +0 -1
  144. package/src/domains/content-moderation/infrastructure/utils/validators.util.ts +0 -51
  145. package/src/domains/creations/domain/constants/creation-errors.constants.ts +0 -27
  146. package/src/domains/creations/domain/constants/creation-query.constants.ts +0 -37
  147. package/src/domains/creations/domain/constants/creation-types.constants.ts +0 -45
  148. package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -43
  149. package/src/domains/creations/presentation/components/CreationRating.tsx +0 -69
  150. package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -130
  151. package/src/domains/creations/presentation/components/FilterSheets.tsx +0 -63
  152. package/src/domains/creations/presentation/hooks/index.ts +0 -24
  153. package/src/domains/creations/presentation/hooks/useCreationRating.ts +0 -68
  154. package/src/domains/creations/presentation/screens/index.ts +0 -5
  155. package/src/domains/generation/infrastructure/flow/scenario-configs.ts +0 -54
  156. package/src/domains/generation/infrastructure/flow/step-builders.ts +0 -133
  157. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.utils.ts +0 -42
  158. package/src/domains/generation/wizard/presentation/components/WizardHeader.tsx +0 -96
  159. package/src/domains/generation/wizard/presentation/components/step-renderers/index.ts +0 -8
  160. package/src/domains/generation/wizard/presentation/components/step-renderers/renderGeneratingStep.tsx +0 -24
  161. package/src/domains/generation/wizard/presentation/components/step-renderers/renderResultStep.tsx +0 -69
  162. package/src/domains/generation/wizard/presentation/utilities/index.ts +0 -1
  163. package/src/domains/prompts/infrastructure/services/base/index.ts +0 -6
  164. package/src/domains/prompts/infrastructure/services/base/prompt-service.base.ts +0 -112
  165. package/src/domains/result-preview/index.ts +0 -37
  166. package/src/domains/result-preview/presentation/components/GenerationErrorScreen.tsx +0 -109
  167. package/src/domains/result-preview/presentation/components/index.ts +0 -16
  168. package/src/domains/result-preview/presentation/hooks/index.ts +0 -5
  169. package/src/domains/result-preview/presentation/types/index.ts +0 -16
  170. package/src/domains/result-preview/presentation/types/result-data.types.ts +0 -35
  171. package/src/domains/text-to-image/presentation/screens/TextToImageWizardFlow.types.ts +0 -27
  172. package/src/domains/text-to-video/domain/types/action-component.types.ts +0 -15
  173. package/src/domains/text-to-video/domain/types/selector-component.types.ts +0 -31
  174. package/src/infrastructure/constants/content.constants.ts +0 -8
  175. package/src/infrastructure/constants/storage.constants.ts +0 -27
  176. package/src/infrastructure/http/api-client.types.ts +0 -17
  177. package/src/infrastructure/http/http-client-methods.ts +0 -73
  178. package/src/infrastructure/http/http-client.util.ts +0 -12
  179. package/src/infrastructure/http/http-fetch-handler.ts +0 -63
  180. package/src/infrastructure/http/http-methods.constants.ts +0 -23
  181. package/src/infrastructure/http/http-request-executor.ts +0 -49
  182. package/src/infrastructure/http/http-response-parser.ts +0 -65
  183. package/src/infrastructure/http/index.ts +0 -16
  184. package/src/infrastructure/http/query-string.util.ts +0 -40
  185. package/src/infrastructure/http/timeout.util.ts +0 -26
  186. package/src/infrastructure/logging/debug.util.ts +0 -51
  187. package/src/infrastructure/logging/index.ts +0 -6
  188. package/src/infrastructure/utils/content-validators.ts +0 -92
  189. package/src/infrastructure/utils/domain-guards.ts +0 -23
  190. package/src/infrastructure/utils/error-classifiers.ts +0 -23
  191. package/src/infrastructure/utils/error-handlers.ts +0 -53
  192. package/src/infrastructure/utils/error-retry.ts +0 -44
  193. package/src/infrastructure/utils/error-types.ts +0 -23
  194. package/src/infrastructure/utils/general-validators.ts +0 -64
  195. package/src/infrastructure/utils/id-validators.ts +0 -39
  196. package/src/infrastructure/utils/primitive-guards.ts +0 -66
  197. package/src/infrastructure/utils/structure-guards.ts +0 -75
  198. package/src/infrastructure/utils/type-guards.util.ts +0 -26
  199. package/src/infrastructure/utils/validation-types.ts +0 -8
  200. package/src/infrastructure/utils/validation.util.ts +0 -18
  201. package/src/shared/utils/index.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.83.10",
3
+ "version": "1.83.12",
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",
@@ -18,5 +18,3 @@ export const CREATION_STATUS = {
18
18
  COMPLETED: "completed",
19
19
  FAILED: "failed",
20
20
  } as const;
21
-
22
- export type CreationStatus = (typeof CREATION_STATUS)[keyof typeof CREATION_STATUS];
@@ -16,15 +16,6 @@ export interface CreditGateConfig {
16
16
  readonly onCreditsAvailable?: () => void;
17
17
  }
18
18
 
19
- /** Partner Configuration */
20
- export interface PartnerConfig {
21
- readonly partnerId: "A" | "B" | "single";
22
- readonly showNameInput?: boolean;
23
- readonly showFaceDetection?: boolean;
24
- readonly showPhotoTips?: boolean;
25
- readonly maxNameLength?: number;
26
- }
27
-
28
19
  /** Visual Style Option */
29
20
  export interface FlowVisualStyleData {
30
21
  readonly id: string;
@@ -3,19 +3,15 @@
3
3
  * Generic multi-step flow system for AI generation
4
4
  */
5
5
 
6
- export { StepType, type GateResult, type StepTransition, type StepDefinition, type StepComponentProps } from "./flow-step.types";
6
+ export { StepType, type GateResult, type StepDefinition } from "./flow-step.types";
7
7
  export type {
8
8
  AuthGateConfig,
9
9
  CreditGateConfig,
10
- PartnerConfig,
11
- FlowVisualStyleData,
12
10
  FlowUploadedImageData,
13
11
  } from "./flow-config-data.types";
14
- export type { FlowState, FlowGenerationStatus } from "./flow-state.types";
12
+ export type { FlowState } from "./flow-state.types";
15
13
  export type { FlowActions } from "./flow-actions.types";
16
14
  export type {
17
15
  FlowCallbacks,
18
- FlowDataProvider,
19
16
  FlowConfiguration,
20
- FlowFeatures,
21
17
  } from "./flow-configuration.types";
@@ -17,7 +17,7 @@ export interface FlowCallbacks {
17
17
  }
18
18
 
19
19
  /** Flow Data Provider - App provides data */
20
- export interface FlowDataProvider {
20
+ interface FlowDataProvider {
21
21
  readonly categories?: readonly unknown[];
22
22
  readonly scenarios?: readonly unknown[];
23
23
  readonly visualStyles?: readonly FlowVisualStyleData[];
@@ -35,10 +35,3 @@ export interface FlowConfiguration {
35
35
  readonly userId?: string;
36
36
  }
37
37
 
38
- /** Flow Features */
39
- export interface FlowFeatures {
40
- readonly categorySelection: boolean;
41
- readonly partnerCount: 0 | 1 | 2;
42
- readonly textInput: boolean;
43
- readonly scenarioSelection: boolean;
44
- }
@@ -7,7 +7,7 @@
7
7
  /**
8
8
  * Metadata types for credit cost calculation
9
9
  */
10
- export interface CreditCostMetadata {
10
+ interface CreditCostMetadata {
11
11
  readonly model?: string;
12
12
  readonly duration?: number;
13
13
  readonly resolution?: string;
@@ -105,7 +105,7 @@ export interface IAuthService {
105
105
  /**
106
106
  * Analytics event data
107
107
  */
108
- export interface AnalyticsEventData {
108
+ interface AnalyticsEventData {
109
109
  readonly [key: string]: string | number | boolean | null | undefined;
110
110
  }
111
111
 
@@ -6,13 +6,5 @@
6
6
  export * from "./ai-provider.interface";
7
7
  export * from "./app-services.interface";
8
8
 
9
- // Interface Segregation - Split provider interfaces
10
- export type { IAIProviderLifecycle } from "./provider-lifecycle.interface";
11
- export type { IAIProviderCapabilities } from "./provider-capabilities.interface";
12
- export type { IAIProviderJobManager } from "../../domains/background/domain/interfaces/provider-job-manager.interface";
13
- export type { IAIProviderExecutor } from "./provider-executor.interface";
14
- export type { IAIProviderImageFeatures } from "./provider-image-features.interface";
15
- export type { IAIProviderVideoFeatures } from "./provider-video-features.interface";
16
-
17
9
  // Video Model Configuration
18
10
  export type { VideoModelConfig, ModelCapabilityOption } from "./video-model-config.types";
@@ -221,4 +221,3 @@ export async function pollJob<T = unknown>(
221
221
  };
222
222
  }
223
223
 
224
- export type { PollJobOptions, PollJobResult } from "./job-poller.types";
@@ -8,5 +8,4 @@
8
8
  */
9
9
 
10
10
  export type { ResultValidation, ValidateResultOptions } from "./result-validator.types";
11
- export { DEFAULT_OUTPUT_FIELDS } from "./result-validator-constants";
12
11
  export { validateResult } from "./result-validation-logic";
@@ -8,6 +8,5 @@
8
8
  */
9
9
 
10
10
  export type { StatusCheckResult } from "./status-checker.types";
11
- export { hasProperty, safeString } from "./status-extraction-helpers";
12
11
  export { checkStatusForErrors } from "./status-error-detector";
13
12
  export { isJobComplete, isJobProcessing, isJobFailed } from "./status-predicates";
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * Type guard to check if object has a property
8
8
  */
9
- export function hasProperty<K extends PropertyKey>(
9
+ function hasProperty<K extends PropertyKey>(
10
10
  obj: unknown,
11
11
  prop: K
12
12
  ): obj is Record<K, unknown> {
@@ -7,7 +7,7 @@
7
7
  * HTML entity encoding detection
8
8
  * More reliable than regex for detecting encoded malicious content
9
9
  */
10
- export function containsHTMLEntities(content: string): boolean {
10
+ function containsHTMLEntities(content: string): boolean {
11
11
  const htmlEntities = [
12
12
  /&lt;/gi, /&gt;/gi, /&quot;/gi, /&amp;/gi, /&apos;/gi,
13
13
  /&#\d+;/gi, /&#x[0-9a-fA-F]+;/gi,
@@ -52,7 +52,7 @@ export const CREATION_FIELDS = {
52
52
  } as const;
53
53
 
54
54
  /** Union type of all field names */
55
- export type CreationFieldName =
55
+ type CreationFieldName =
56
56
  typeof CREATION_FIELDS[keyof typeof CREATION_FIELDS];
57
57
 
58
58
  /**
@@ -79,15 +79,6 @@ export const UPDATABLE_FIELDS: ReadonlyArray<CreationFieldName> = [
79
79
  CREATION_FIELDS.DURATION_MS,
80
80
  ] as const;
81
81
 
82
- /**
83
- * Type guard for updatable fields
84
- */
85
- export function isUpdatableField(
86
- field: string
87
- ): field is CreationFieldName {
88
- return UPDATABLE_FIELDS.includes(field as CreationFieldName);
89
- }
90
-
91
82
  // Freeze to prevent mutations
92
83
  Object.freeze(CREATION_FIELDS);
93
84
  Object.freeze(UPDATABLE_FIELDS);
@@ -22,25 +22,5 @@ export const CREATION_STATUS = {
22
22
  FAILED: "failed" as const,
23
23
  } as const;
24
24
 
25
- /** Union type of all valid status values */
26
- export type CreationStatusValue =
27
- typeof CREATION_STATUS[keyof typeof CREATION_STATUS];
28
-
29
- /**
30
- * Type guard for creation status values
31
- * @param value - Value to check
32
- * @returns True if value is a valid creation status
33
- */
34
- export function isCreationStatus(
35
- value: unknown
36
- ): value is CreationStatusValue {
37
- return (
38
- typeof value === "string" &&
39
- Object.values(CREATION_STATUS).includes(
40
- value as CreationStatusValue
41
- )
42
- );
43
- }
44
-
45
25
  // Freeze to prevent mutations
46
26
  Object.freeze(CREATION_STATUS);
@@ -44,17 +44,5 @@ export const CREATION_VALIDATION = {
44
44
  ] as const,
45
45
  } as const;
46
46
 
47
- /** Union type of valid URI protocols */
48
- export type ValidUriProtocol =
49
- typeof CREATION_VALIDATION.VALID_URI_PROTOCOLS[number];
50
-
51
- /** Union type of valid image MIME types */
52
- export type ValidImageMime =
53
- typeof CREATION_VALIDATION.VALID_IMAGE_MIMES[number];
54
-
55
- /** Union type of valid video MIME types */
56
- export type ValidVideoMime =
57
- typeof CREATION_VALIDATION.VALID_VIDEO_MIMES[number];
58
-
59
47
  // Freeze to prevent mutations
60
48
  Object.freeze(CREATION_VALIDATION);
@@ -1,24 +1,12 @@
1
1
  /**
2
2
  * Creation Domain Constants - Modular Exports
3
- *
4
- * All constants follow 100-line rule for maintainability.
5
- * Each module has single responsibility.
6
3
  */
7
4
 
8
- // Status constants (40 lines)
5
+ // Status constants
9
6
  export * from "./creation-status.constants";
10
7
 
11
- // Field name constants (70 lines)
8
+ // Field name constants
12
9
  export * from "./creation-fields.constants";
13
10
 
14
- // Validation rule constants (60 lines)
11
+ // Validation rule constants
15
12
  export * from "./creation-validation.constants";
16
-
17
- // Type discriminator constants (45 lines)
18
- export * from "./creation-types.constants";
19
-
20
- // Error code constants (35 lines)
21
- export * from "./creation-errors.constants";
22
-
23
- // Query & collection constants (40 lines)
24
- export * from "./creation-query.constants";
@@ -2,5 +2,5 @@
2
2
  * Domain Entities
3
3
  */
4
4
 
5
- export type { Creation, CreationDocument, CreationOutput } from "./Creation";
5
+ export type { Creation, CreationDocument } from "./Creation";
6
6
  export { mapDocumentToCreation } from "./Creation";
@@ -8,8 +8,6 @@ import type { Creation } from "../../domain/entities/Creation";
8
8
  import { UPDATABLE_FIELDS } from "../../domain/constants";
9
9
 
10
10
 
11
- export { UPDATABLE_FIELDS };
12
-
13
11
  export async function updateCreation(
14
12
  pathResolver: IPathResolver,
15
13
  userId: string,
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  export { createCreation } from "./creation-create.operations";
7
- export { updateCreation, UPDATABLE_FIELDS } from "./creation-update.operations";
7
+ export { updateCreation } from "./creation-update.operations";
8
8
  export {
9
9
  deleteCreation,
10
10
  hardDeleteCreation,
@@ -19,9 +19,11 @@ import type { CreationCardProps } from "./CreationCard.types";
19
19
  import type { CreationTypeId } from "../../domain/types";
20
20
  import { getPreviewUrl, getCreationTitle } from "../../domain/utils";
21
21
 
22
+ const EMPTY_CALLBACKS: CreationCardProps["callbacks"] = {};
23
+
22
24
  export function CreationCard({
23
25
  creation,
24
- callbacks = {},
26
+ callbacks = EMPTY_CALLBACKS,
25
27
  showBadges = true,
26
28
  showActions = true,
27
29
  statusText,
@@ -156,5 +158,3 @@ export function CreationCard({
156
158
  </TouchableOpacity>
157
159
  );
158
160
  }
159
-
160
- export type { CreationCardProps, CreationCardData, CreationCardCallbacks } from "./CreationCard.types";
@@ -15,7 +15,7 @@ import {
15
15
  import type { CreationStatus, CreationTypeId } from "../../domain/types";
16
16
  import { isInProgress, getTypeIcon } from "../../domain/utils";
17
17
 
18
- export interface CreationImagePreviewProps {
18
+ interface CreationImagePreviewProps {
19
19
  /** Preview image URL */
20
20
  readonly uri?: string | null;
21
21
  /** Creation status */
@@ -14,7 +14,7 @@ import type { CreationStatus, CreationTypeId } from "../../domain/types";
14
14
  import { isInProgress } from "../../domain/utils";
15
15
  import { shouldShowThumbnail } from "../../domain/utils/preview-helpers";
16
16
 
17
- export interface CreationVideoPreviewProps {
17
+ interface CreationVideoPreviewProps {
18
18
  /** Thumbnail image URL (optional) */
19
19
  readonly thumbnailUrl?: string | null;
20
20
  /** Video URL (for display purposes only) */
@@ -133,7 +133,6 @@ export function CreationsFilterBar({
133
133
  );
134
134
  }
135
135
 
136
- export type { FilterButton, CreationsFilterBarProps } from "./CreationsFilterBar.types";
137
136
 
138
137
  /**
139
138
  * Helper to create media filter buttons
@@ -45,9 +45,9 @@ function CreationCardSkeleton({ tokens }: { tokens: DesignTokens }) {
45
45
  </View>
46
46
  {/* Action buttons skeleton */}
47
47
  <View style={styles.actions}>
48
- {[1, 2, 3, 4].map((i) => (
48
+ {[1, 2, 3, 4].map((id) => (
49
49
  <AtomicSkeleton
50
- key={i}
50
+ key={id}
51
51
  pattern="custom"
52
52
  custom={[{ width: 36, height: 36, borderRadius: 18 }]}
53
53
  />
@@ -76,8 +76,8 @@ export function GalleryEmptyStates({
76
76
  if (isLoading && (!creations || creations?.length === 0)) {
77
77
  return (
78
78
  <View style={styles.skeletonContainer}>
79
- {[1, 2, 3].map((i: number) => (
80
- <CreationCardSkeleton key={i} tokens={tokens} />
79
+ {[1, 2, 3].map((id: number) => (
80
+ <CreationCardSkeleton key={id} tokens={tokens} />
81
81
  ))}
82
82
  </View>
83
83
  );
@@ -20,11 +20,13 @@ interface GalleryHeaderProps {
20
20
  readonly style?: ViewStyle;
21
21
  }
22
22
 
23
+ const EMPTY_FILTER_BUTTONS: FilterButtonConfig[] = [];
24
+
23
25
  export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
24
26
  title,
25
27
  count,
26
28
  countLabel,
27
- filterButtons = [],
29
+ filterButtons = EMPTY_FILTER_BUTTONS,
28
30
  showFilter = true,
29
31
  style,
30
32
  }: GalleryHeaderProps) => {
@@ -7,7 +7,7 @@ import React, { useMemo } from "react";
7
7
  import { View, TouchableOpacity, StyleSheet } from "react-native";
8
8
  import { useAppDesignTokens, AtomicIcon, AtomicText, type DesignTokens } from "@umituz/react-native-design-system";
9
9
 
10
- export interface GalleryScreenHeaderProps {
10
+ interface GalleryScreenHeaderProps {
11
11
  readonly title: string;
12
12
  readonly onBack: () => void;
13
13
  }
@@ -3,33 +3,10 @@
3
3
  */
4
4
 
5
5
  // Core Components
6
- export { CreationPreview } from "./CreationPreview";
7
- export { CreationImagePreview, type CreationImagePreviewProps } from "./CreationImagePreview";
8
- export { CreationVideoPreview, type CreationVideoPreviewProps } from "./CreationVideoPreview";
9
- export { CreationBadges } from "./CreationBadges";
10
- export { CreationActions, type CreationAction } from "./CreationActions";
11
6
  export {
12
7
  CreationCard,
13
- type CreationCardData,
14
- type CreationCardCallbacks,
15
8
  } from "./CreationCard";
16
- export { CreationThumbnail } from "./CreationThumbnail";
17
-
18
- // Filter Components
19
- export { FilterChips } from "./FilterChips";
20
- export {
21
- CreationsFilterBar,
22
- createMediaFilterButtons,
23
- createStatusFilterButtons,
24
- type FilterButton,
25
- } from "./CreationsFilterBar";
26
- export { StatusFilterSheet, MediaFilterSheet } from "./FilterSheets";
27
9
 
28
10
  // Gallery Components
29
11
  export { GalleryHeader } from "./GalleryHeader";
30
- export { EmptyState } from "./EmptyState";
31
12
  export { GalleryEmptyStates } from "./GalleryEmptyStates";
32
- export { CreationsHomeCard } from "./CreationsHomeCard";
33
- export { CreationRating } from "./CreationRating";
34
- export { CreationsGrid } from "./CreationsGrid";
35
- export { PendingJobsSection, type PendingJobsSectionProps } from "./PendingJobsSection";
@@ -15,7 +15,7 @@ import {
15
15
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
16
16
 
17
17
 
18
- export interface ValidationResult {
18
+ interface ValidationResult {
19
19
  isValid: boolean;
20
20
  error?: string;
21
21
  }
@@ -23,7 +23,7 @@ export interface ValidationResult {
23
23
  /**
24
24
  * Validates that at least one URL is present
25
25
  */
26
- export function validateHasUrl(
26
+ function validateHasUrl(
27
27
  imageUrl?: string,
28
28
  videoUrl?: string
29
29
  ): ValidationResult {
@@ -39,7 +39,7 @@ export function validateHasUrl(
39
39
  /**
40
40
  * Validates URI protocol
41
41
  */
42
- export function validateUriProtocol(uri: string): ValidationResult {
42
+ function validateUriProtocol(uri: string): ValidationResult {
43
43
  const hasValidProtocol = CREATION_VALIDATION.VALID_URI_PROTOCOLS.some(
44
44
  (protocol) => uri.startsWith(protocol)
45
45
  );
@@ -57,7 +57,7 @@ export function validateUriProtocol(uri: string): ValidationResult {
57
57
  /**
58
58
  * Validates URI length
59
59
  */
60
- export function validateUriLength(uri: string): ValidationResult {
60
+ function validateUriLength(uri: string): ValidationResult {
61
61
  if (uri.length > CREATION_VALIDATION.MAX_URI_LENGTH) {
62
62
  return {
63
63
  isValid: false,
@@ -9,7 +9,7 @@ import type { CreationCategory, CreationTypeId } from "../../domain/types";
9
9
  import type { FilterableCreation } from "./advancedFilter.types";
10
10
  import { normalizeDateToTimestamp, compareDates } from "../../../../shared/utils/date";
11
11
 
12
- export function filterByType<T extends FilterableCreation>(
12
+ function filterByType<T extends FilterableCreation>(
13
13
  creations: T[],
14
14
  filterType: string | undefined,
15
15
  ): T[] {
@@ -25,7 +25,7 @@ export function filterByType<T extends FilterableCreation>(
25
25
  return creations.filter((c) => c.type === filterType);
26
26
  }
27
27
 
28
- export function filterByStatus<T extends FilterableCreation>(
28
+ function filterByStatus<T extends FilterableCreation>(
29
29
  creations: T[],
30
30
  status: string | undefined,
31
31
  ): T[] {
@@ -33,7 +33,7 @@ export function filterByStatus<T extends FilterableCreation>(
33
33
  return creations.filter((c) => c.status === status);
34
34
  }
35
35
 
36
- export function filterBySearch<T extends FilterableCreation>(
36
+ function filterBySearch<T extends FilterableCreation>(
37
37
  creations: T[],
38
38
  searchQuery: string | undefined,
39
39
  ): T[] {
@@ -47,7 +47,7 @@ export function filterBySearch<T extends FilterableCreation>(
47
47
  });
48
48
  }
49
49
 
50
- export function filterByDateRange<T extends FilterableCreation>(
50
+ function filterByDateRange<T extends FilterableCreation>(
51
51
  creations: T[],
52
52
  startDate: number | undefined,
53
53
  endDate: number | undefined,
@@ -71,7 +71,7 @@ export function filterByDateRange<T extends FilterableCreation>(
71
71
  return result;
72
72
  }
73
73
 
74
- export function sortCreations<T extends FilterableCreation>(
74
+ function sortCreations<T extends FilterableCreation>(
75
75
  creations: T[],
76
76
  sortField: CreationFilter["sortField"],
77
77
  sortOrder: CreationFilter["sortOrder"],
@@ -8,13 +8,13 @@
8
8
  import { useState, useCallback, useMemo } from "react";
9
9
  import type { FilterOption } from "../../domain/types/creation-filter";
10
10
 
11
- export interface UseFilterProps {
11
+ interface UseFilterProps {
12
12
  readonly options: FilterOption[];
13
13
  readonly t: (key: string) => string;
14
14
  readonly defaultId?: string;
15
15
  }
16
16
 
17
- export interface UseFilterReturn {
17
+ interface UseFilterReturn {
18
18
  readonly selectedId: string;
19
19
  readonly filterOptions: FilterOption[];
20
20
  readonly hasActiveFilter: boolean;
@@ -10,7 +10,7 @@ import type { Creation } from "../../domain/entities/Creation";
10
10
  import type { CreationsConfig } from "../../domain/value-objects/CreationsConfig";
11
11
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
12
12
 
13
- export interface UseGalleryCallbacksProps {
13
+ interface UseGalleryCallbacksProps {
14
14
  readonly userId: string | null;
15
15
  readonly repository: ICreationsRepository;
16
16
  readonly config: CreationsConfig;
@@ -75,20 +75,19 @@ export function useGalleryCallbacks(props: UseGalleryCallbacksProps) {
75
75
  const handleFavorite = useCallback(
76
76
  (c: Creation) => {
77
77
  void (async () => {
78
- if (__DEV__) {
79
- console.log("[handleFavorite] Called", { id: c.id, currentFavorite: c.isFavorite, userId });
78
+ try {
79
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
80
+ console.log("[handleFavorite] Called", { id: c.id, currentFavorite: c.isFavorite, userId });
81
+ }
82
+ if (!userId) return;
83
+ const newFavoriteStatus = !c.isFavorite;
84
+ const success = await repository.updateFavorite(userId, c.id, newFavoriteStatus);
85
+ if (success) void refetch();
86
+ } catch (e) {
87
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
88
+ console.error("[handleFavorite] Error:", e);
89
+ }
80
90
  }
81
- if (!userId) return;
82
- // Toggle the favorite status
83
- const newFavoriteStatus = !c.isFavorite;
84
- if (__DEV__) {
85
- console.log("[handleFavorite] Toggling", { newFavoriteStatus });
86
- }
87
- const success = await repository.updateFavorite(userId, c.id, newFavoriteStatus);
88
- if (__DEV__) {
89
- console.log("[handleFavorite] Update result", { success });
90
- }
91
- if (success) void refetch();
92
91
  })();
93
92
  },
94
93
  [userId, repository, refetch],
@@ -118,11 +117,17 @@ export function useGalleryCallbacks(props: UseGalleryCallbacksProps) {
118
117
  (rating: number, description: string) => {
119
118
  if (!userId || !selectedCreation) return;
120
119
  void (async () => {
121
- const success = await repository.rate(userId, selectedCreation.id, rating, description);
122
- if (success) {
123
- setSelectedCreation({ ...selectedCreation, rating, ratedAt: new Date() });
124
- alert.show(AlertType.SUCCESS, AlertMode.TOAST, t("result.rateSuccessTitle"), t("result.rateSuccessMessage"));
125
- void refetch();
120
+ try {
121
+ const success = await repository.rate(userId, selectedCreation.id, rating, description);
122
+ if (success) {
123
+ setSelectedCreation({ ...selectedCreation, rating, ratedAt: new Date() });
124
+ alert.show(AlertType.SUCCESS, AlertMode.TOAST, t("result.rateSuccessTitle"), t("result.rateSuccessMessage"));
125
+ void refetch();
126
+ }
127
+ } catch (e) {
128
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
129
+ console.error("[handleSubmitRating] Error:", e);
130
+ }
126
131
  }
127
132
  })();
128
133
  },
@@ -7,12 +7,12 @@ import { useState, useEffect, useRef, useMemo } from "react";
7
7
  import type { Creation } from "../../domain/entities/Creation";
8
8
  import { getPreviewUrl } from "../../domain/utils";
9
9
 
10
- export interface GalleryStateOptions {
10
+ interface GalleryStateOptions {
11
11
  initialCreationId?: string;
12
12
  creations: Creation[] | undefined;
13
13
  }
14
14
 
15
- export interface GalleryStateReturn {
15
+ interface GalleryStateReturn {
16
16
  selectedCreation: Creation | null;
17
17
  showRatingPicker: boolean;
18
18
  selectedImageUrl: string | undefined;
@@ -178,23 +178,32 @@ export function useProcessingJobsPoller(
178
178
  useEffect(() => {
179
179
  if (!enabled || !userId || orphanJobs.length === 0) return;
180
180
 
181
- orphanJobs.forEach(async (creation) => {
182
- const ageMs = Date.now() - creation.createdAt.getTime();
183
- if (ageMs < DEFAULT_MAX_POLL_TIME_MS) return;
181
+ const cleanupOrphans = async () => {
182
+ const staleOrphans = orphanJobs.filter((creation) => {
183
+ const ageMs = Date.now() - creation.createdAt.getTime();
184
+ return ageMs >= DEFAULT_MAX_POLL_TIME_MS;
185
+ });
184
186
 
187
+ if (staleOrphans.length === 0) return;
188
+
189
+ await Promise.allSettled(
190
+ staleOrphans.map(async (creation) => {
191
+ if (!isMountedRef.current) return;
192
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
193
+ console.log("[ProcessingJobsPoller] Orphan job timed out, marking as failed:", creation.id);
194
+ }
195
+ await repository.update(userId, creation.id, {
196
+ status: CREATION_STATUS.FAILED,
197
+ metadata: { ...creation.metadata, error: "Generation timed out" },
198
+ completedAt: new Date(),
199
+ });
200
+ }),
201
+ );
202
+ };
203
+
204
+ void cleanupOrphans().catch((e) => {
185
205
  if (typeof __DEV__ !== "undefined" && __DEV__) {
186
- console.log("[ProcessingJobsPoller] Orphan job timed out, marking as failed:", creation.id, { ageMs });
187
- }
188
- try {
189
- await repository.update(userId, creation.id, {
190
- status: CREATION_STATUS.FAILED,
191
- metadata: { ...creation.metadata, error: "Generation timed out" },
192
- completedAt: new Date(),
193
- });
194
- } catch (e) {
195
- if (typeof __DEV__ !== "undefined" && __DEV__) {
196
- console.error("[ProcessingJobsPoller] Failed to mark orphan job:", e);
197
- }
206
+ console.error("[ProcessingJobsPoller] Failed to clean up orphan jobs:", e);
198
207
  }
199
208
  });
200
209
  }, [enabled, userId, orphanJobs, repository]);
@@ -21,7 +21,6 @@ import type { Creation } from "../../domain/entities/Creation";
21
21
  import type { CreationsGalleryScreenProps } from "./creations-gallery.types";
22
22
  import { creationsGalleryStyles as styles } from "./creations-gallery.styles";
23
23
 
24
- export type { CreationsGalleryScreenProps } from "./creations-gallery.types";
25
24
 
26
25
  export function CreationsGalleryScreen({
27
26
  userId,