-
Notifications
You must be signed in to change notification settings - Fork 3
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
Change type login and register #19
Conversation
@trunges21, Please see my comments on the 👉 corresponding pull request the same comments apply here. Thanks 👍 . |
WalkthroughThe recent updates focus on enhancing the usability and readability of both the code and its configuration. Specifically, the YAML structure for GitHub Actions has been optimized, and the SDK now features more precise type definitions for login and registration parameters. Additionally, the validation logic for these parameters has been refined to improve reliability and error handling. Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (5)
dist/ApiClient.d.ts
is excluded by:!dist/**
dist/SDK/KindeSDK.d.ts
is excluded by:!dist/**
dist/SDK/Utils.js
is excluded by:!dist/**
dist/types/Auth.d.ts
is excluded by:!dist/**
dist/types/KindeSDK.d.ts
is excluded by:!dist/**
Files selected for processing (4)
- .github/workflows/run-tests.yml (1 hunks)
- src/SDK/KindeSDK.ts (3 hunks)
- src/SDK/Utils.ts (1 hunks)
- src/types/KindeSDK.ts (1 hunks)
Additional comments: 6
.github/workflows/run-tests.yml (2)
- 4-7: The changes to the
on
event triggers, specifying branches for bothpush
andpull_request
events to onlymaster
, improve clarity and ensure that tests are run only for changes to themaster
branch. This is a good practice for focusing CI resources on the most critical branch.- 10-21: The indentation adjustments within the
jobs
section enhance readability, making it easier to understand the steps involved in thetest
job. However, it's important to ensure that the indentation follows the YAML standards to avoid any parsing errors. The comment on line 18 suggests usingnpm install
instead ofnpm ci
due to.gitignore
d lock files. This approach can lead to inconsistencies in dependencies across environments. If possible, consider committing the lock file to ensure reproducible builds.Consider committing the
package-lock.json
oryarn.lock
file to the repository to enable the use ofnpm ci
for more consistent and faster installations in CI environments.src/types/KindeSDK.ts (1)
- 78-87: The introduction of
LoginAdditionalParameters
andRegisterAdditionalParameters
types is a significant improvement for type safety and clarity. By omittingis_create_org
fromLoginAdditionalParameters
and extendingOrgAdditionalParams
forRegisterAdditionalParameters
, the types are tailored to the specific needs of login and registration functionalities. This change aligns with best practices for TypeScript development by ensuring that function parameters are accurately typed, which can help prevent bugs and improve code maintainability.src/SDK/Utils.ts (1)
- 122-124: The refinement in the
checkAdditionalParameters
function to include a check for the presence of keys inkeysAllow
before throwing anInvalidTypeException
is a thoughtful enhancement. This change ensures that only allowed keys are considered valid, which enhances the robustness of parameter validation and helps prevent potential errors or security issues. It's important to ensure that theAdditionalParametersAllow
object is kept up-to-date with all valid keys to maintain the effectiveness of this validation.src/SDK/KindeSDK.ts (2)
- 106-111: Updating the
additionalParameters
type in thelogin
method toLoginAdditionalParameters
is a positive change that enhances type safety and clarity. This update ensures that the method's parameters are more accurately typed, aligning with the specific requirements of the login functionality. It's crucial to ensure that all calls to this method throughout the codebase have been updated to match the new signature to avoid type errors.- 142-142: Similarly, updating the
additionalParameters
type in theregister
method toRegisterAdditionalParameters
improves type safety and clarity, tailoring the method's parameters to the specific needs of the registration functionality. This change aligns with best practices for TypeScript development by ensuring accurate typing, which can help prevent bugs and improve code maintainability. As with thelogin
method, it's important to verify that all calls to this method have been updated accordingly.
Explain your changes
Suppose there is a related issue with enough detail for a reviewer to understand your changes fully. In that case, you can omit an explanation and instead include either “Fixes #XX” or “Updates #XX” where “XX” is the issue number.
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.
Summary by CodeRabbit