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

refactor(types): Minor Type Improvements for the ThirdParty Recipe #946

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

ITenthusiasm
Copy link
Contributor

Summary of changes

This PR is intended to improve the DX for anyone using supertokens-node/recipe/thirdparty. It

  • Explicitly identifies optional fields for the TypeProvider methods
  • Clarifies the true type of the redirectURIQueryParams field of the TypeProvider.exchangeAuthCodeForOAuthTokens method

Related issues

N/A. (Can create a separate issue if desired.)

Test Plan

This is just a simple TypeScript types change. So as long as the project builds, everything should be fine.

Documentation changes

N/A

Checklist for important updates

I was uncertain about whether or not I should update package.json (and friends).

  • Changelog has been updated
  • coreDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in lib/ts/version.ts
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • If new thirdparty provider is added,
    • update switch statement in recipe/thirdparty/providers/configUtils.ts file, createProvider function.
    • add an icon on the user management dashboard.
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If have added a new web framework, update the add-ts-no-check.js file to include that
  • If added a new recipe / api interface, then make sure that the implementation of it uses NON arrow functions only (like someFunc: function () {..}).
  • If added a new recipe, then make sure to expose it inside the recipe folder present in the root of this repo. We also need to expose its types.
  • If added a new entry point, then make sure that it is importable by adding it to the exports in package.json

It is safe to pass `undefined` for `userContext` in all of these
cases. Therefore, to improve the DX for developers not leveraging
`UserContext` for these methods, the argument should be optional.
This argument expects an object of strings. This should be
clarified to developers so that they don't mistakenly pass,
for instance, an instance of `URLSearchParams`.
@ITenthusiasm
Copy link
Contributor Author

Is there anything that I need to do to trigger Run tests?

@rishabhpoddar rishabhpoddar merged commit 7c9e78a into supertokens:21.0 Oct 19, 2024
3 of 4 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.

2 participants