Commit Graph

16 Commits

Author SHA1 Message Date
icarus
e0781e1bb0 refactor(ocr): restructure ocr types into modular files for better maintainability
- Split monolithic ocr.ts into separate files for base types, providers, models, and layers (api, data, business)
- Update related imports and references across the codebase
- Rename API request/response types to be more consistent (Patch->Update, Put->Replace)
- Adjust repository and service implementations to match new type structure
2025-10-20 20:39:24 +08:00
icarus
281632f859 feat(ocr): add validation for OCR provider operations
- Add params validation in API handlers to ensure path ID matches body ID
- Introduce isDbOcrProvider type guard for runtime validation
- Validate provider data before database operations
2025-10-20 08:28:15 +08:00
icarus
a2e628d7e9 refactor(ocr): improve ocr provider handling and error states
- Add ListOcrProvidersQuery type for better type safety
- Update useOcrProviders hook to accept query params and handle undefined data
- Improve error handling and loading states in OcrImageSettings component
- Memoize filtered image providers for better performance
2025-10-20 08:07:32 +08:00
icarus
389dfc08f6 feat(ocr): add filtering by registration status to provider list
Add optional query parameter to filter OCR providers by registration status
Prevent modification and deletion of built-in OCR providers
2025-10-20 07:54:50 +08:00
icarus
f9ed8343fe feat(ocr): implement delete provider API endpoint
Add DELETE endpoint for OCR providers with proper type definitions and handler implementation. The endpoint removes the provider from both the registry and database after validation checks.
2025-10-20 07:40:31 +08:00
icarus
a042892250 feat(ocr): implement create and update provider endpoints
add POST handler for creating new OCR providers
add PUT handler for updating existing OCR providers
add required request/response types and schemas
2025-10-20 07:35:03 +08:00
icarus
4ab6961fcc feat(ocr): add type for OcrProviderId and getProvider method
Add OcrProviderId type definition and implement getProvider method in OcrService to fetch a single OCR provider by ID
2025-10-20 07:23:41 +08:00
icarus
4e7a67df59 feat(ocr): implement PATCH endpoint for OCR provider updates
Add PATCH handler for OCR provider updates with request/response schemas
Implement patchProvider method in OcrService to update provider data
2025-10-20 07:19:08 +08:00
icarus
1e9014b080 feat(ocr): implement ocr providers list endpoint
Add DbOcrProviderSchema and update response schemas for list and get endpoints
Implement the GET /ocr/providers endpoint using ocrService
2025-10-20 07:00:23 +08:00
icarus
f538e89976 Revert "refactor(ocr): simplify ocr providers api by returning string array"
This reverts commit 695afb6f75.
2025-10-20 05:16:35 +08:00
icarus
695afb6f75 refactor(ocr): simplify ocr providers api by returning string array
Remove unused OcrProvider type and related endpoints. The GET endpoint now returns a simple array of provider IDs instead of full provider objects, as the detailed provider data will be handled separately.
2025-10-20 01:02:17 +08:00
icarus
c780552197 feat(ocr): add api schemas and handlers for ocr providers
Implement API schemas and handlers for OCR providers endpoints
Add TODO comments for future migration tasks
Fix endpoint path in OcrImageSettings component
2025-10-19 23:21:54 +08:00
Phantom
d4b0272fe7
refactor: prefer import type (#10190)
* style(linter): enable consistent-type-imports rule in typescript

* chore: add biome to lint script for improved code formatting

* chore: add oxlint-specific lint script for faster linting

* refactor: use type-only imports for better type safety and clarity
2025-09-17 12:32:53 +08:00
fullex
c0cca4ae44 chore: update configuration and improve cache management
- Added "packages/ui/scripts/**" to .oxlintrc.json for linting.
- Excluded ".claude/**" from biome.jsonc.
- Refactored API path types in apiPaths.ts for better clarity.
- Updated error handling in errorCodes.ts to ensure stack trace is always available.
- Modified preferenceSchemas.ts to include new features and updated generated timestamp.
- Cleaned up tsconfig.json for better organization.
- Adjusted CustomTag component to improve rendering logic.
- Enhanced CodeEditor utility functions for better type safety.
- Improved Scrollbar story for better readability.
- Refactored CacheService to streamline comments and improve documentation.
- Updated useCache and useSharedCache hooks for better clarity and functionality.
- Cleaned up selectionStore and settings.ts by commenting out deprecated actions.
- Updated DataApiHookTests for better optimistic update handling.
2025-09-16 11:27:18 +08:00
fullex
bd448b5108 refactor: remove AbortSignal support from DataApiService and related components
- Eliminated AbortSignal handling from ApiClient interface and DataApiService to streamline request processing.
- Updated IpcAdapter to remove event sender logic for responses, aligning with the new direct IPC approach.
- Adjusted tests to reflect the removal of cancellation capabilities, emphasizing that direct IPC requests cannot be cancelled.
- Cleaned up related code and comments to enhance clarity and maintainability.
2025-09-13 13:50:59 +08:00
fullex
a7d12abd1f feat: add Data API channels and integrate swr for data fetching
- Introduced new IPC channels for Data API requests and responses in IpcChannel.
- Added swr library to package.json for improved data fetching capabilities.
- Updated preload API to include Data API related methods for handling requests and subscriptions.
- Removed deprecated pending_default_values.ts file as part of data refactor.
2025-09-13 00:55:15 +08:00