Skip to content
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

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Conversation

trunges21
Copy link
Contributor

@trunges21 trunges21 commented Feb 2, 2024

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

  • Refactor
    • Improved YAML structure and readability for test workflows.
  • New Features
    • Updated login and registration functionality to support new parameter types.
  • Bug Fixes
    • Refined logic for parameter validation to prevent invalid types.

@atifcppprogrammer
Copy link
Contributor

@trunges21, Please see my comments on the 👉 corresponding pull request the same comments apply here. Thanks 👍 .

@DanielRivers DanielRivers self-requested a review February 22, 2024 09:34
Copy link

coderabbitai bot commented Mar 7, 2024

Walkthrough

The 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

File Path Change Summary
.github/workflows/run-tests.yml Reformatting YAML structure for on event triggers; improved indentation in jobs section.
src/SDK/KindeSDK.ts Updated parameter types in login and register methods.
src/SDK/Utils.ts Refined logic for checking additional parameters.
src/types/KindeSDK.ts Added LoginAdditionalParameters and RegisterAdditionalParameters types.

🐰✨
In the burrow of code, where changes take flight,
A rabbit hops in, to make everything right.
With a twitch of the nose, and a flick of the ear,
YAML and types, all crystal clear.
🌟 For every line, and every letter,
Our code now runs a bit better.
🎉🐾

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 71ef7fb and 1631ac6.
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 both push and pull_request events to only master, improve clarity and ensure that tests are run only for changes to the master 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 the test 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 using npm install instead of npm ci due to .gitignored 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 or yarn.lock file to the repository to enable the use of npm ci for more consistent and faster installations in CI environments.

src/types/KindeSDK.ts (1)
  • 78-87: The introduction of LoginAdditionalParameters and RegisterAdditionalParameters types is a significant improvement for type safety and clarity. By omitting is_create_org from LoginAdditionalParameters and extending OrgAdditionalParams for RegisterAdditionalParameters, 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 in keysAllow before throwing an InvalidTypeException 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 the AdditionalParametersAllow 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 the login method to LoginAdditionalParameters 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 the register method to RegisterAdditionalParameters 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 the login method, it's important to verify that all calls to this method have been updated accordingly.

@DanielRivers DanielRivers merged commit 8cda253 into kinde-oss:master Apr 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants