-
-
Notifications
You must be signed in to change notification settings - Fork 106
fix(delegate): remove createManyAndReturn
API from delegate model client
#1769
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
Conversation
📝 WalkthroughWalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/schema/src/plugins/enhancer/enhance/index.ts (2)
Line range hint
603-610
: Consider using AST manipulation instead of string replacements intransformTypeAlias
.In the
transformTypeAlias
method, the code modifies thesource
string usingreplace()
operations to remove auxiliary fields and adjust type aliases. Manipulating code as strings can be fragile and may lead to unintended consequences if similar patterns exist elsewhere in the code.Consider directly manipulating the AST nodes using the
ts-morph
library to perform these transformations. This approach is more robust and maintainable, reducing the risk of errors from incorrect string replacements.
Line range hint
645-658
: Use AST node manipulation inremoveCreateFromDelegateInput
for safer transformations.In the
removeCreateFromDelegateInput
method, the code removes certain fields by replacing text in thesource
string. This string manipulation can be error-prone, especially if the codebase evolves or if similar text appears elsewhere.It's advisable to use the AST manipulation capabilities of
ts-morph
to remove the specificPropertySignature
nodes corresponding to the fields. This ensures precise modifications and enhances code reliability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- packages/schema/src/plugins/enhancer/enhance/index.ts (1 hunks)
- packages/server/src/api/rest/index.ts (0 hunks)
💤 Files with no reviewable changes (1)
- packages/server/src/api/rest/index.ts
🧰 Additional context used
🔇 Additional comments (1)
packages/schema/src/plugins/enhancer/enhance/index.ts (1)
469-471
: LGTM!The code correctly filters out the specified methods, including
createManyAndReturn
, fromstructure.methods
. This ensures that delegate models cannot use these methods, aligning with the intended design constraints.
Fixes #1738