-
Notifications
You must be signed in to change notification settings - Fork 92
Improve various types #1919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Improve various types #1919
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1919 +/- ##
==========================================
+ Coverage 99.02% 99.15% +0.13%
==========================================
Files 18 18
Lines 1435 1301 -134
Branches 303 303
==========================================
- Hits 1421 1290 -131
+ Misses 14 11 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves and documents various types and methods, with a focus on renaming types (e.g. Health to HealthResponse and Version to VersionResponse) and replacing inline error code references with string literals.
- Migrates error codes from ErrorStatusCode enums to inline string literals for improved type safety and clarity
- Updates documentation comments in source files and refines type definitions
- Adjusts tests accordingly to match the new error code format
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/* | Replaces ErrorStatusCode with explicit string literals |
src/types/* and src/errors/* | Updates type names and documentation per migration requirements |
src/meilisearch.ts and src/indexes.ts | Migrates API responses and error handling to new type definitions |
Comments suppressed due to low confidence (2)
tests/get_search.test.ts:551
- [nitpick] Consider centralizing error code string literals into a shared constant or module rather than using inline strings throughout tests. This can help reduce duplication, avoid potential typos, and simplify future updates.
).rejects.toHaveProperty("cause.code", "index_not_found");
src/meilisearch.ts:187
- [nitpick] Consider centralizing the error code string literals (e.g., "index_not_found") into a dedicated constants module to ensure consistency and maintainability across both production and test code.
if ((e as MeiliSearchApiError)?.cause?.code === "index_not_found") {
Pull Request
What does this PR do?
Migration
Health
->HealthResponse
Version
->VersionResponse