Coder Social home page Coder Social logo

Comments (5)

gr2m avatar gr2m commented on June 6, 2024 1

I'd like to throw an Error in the code, and not rely on the TypeScript definitions. hen using the auth strategy with Octokit, the octokit.auth() method does currently not inherit the types

from auth-app.js.

gr2m avatar gr2m commented on June 6, 2024 1

at TS level does not have much sense since an invalid type is impossible to reach when using @octokit/auth-app package.

That is a known limitation right now. See octokit/core.js#32 and https://github.com/octokit/rest.js/issues/1562#issuecomment-582678977. It comes back to the idea of having a global Octokit namespace that plugins can extend, it's a bigger project. I want to create a high level issue for this for further discussion. This will also address the ability to define custom event webhooks, for example

from auth-app.js.

oscard0m avatar oscard0m commented on June 6, 2024

Hi @gr2m

Taking a look into this.

Trying to reproduce it with TypeScript, the compiler complains about it:
https://codesandbox.io/s/octokit-auth-app-with-typo-lsg69

Do you have more details on how to reproduce this?

from auth-app.js.

oscard0m avatar oscard0m commented on June 6, 2024

Drafted this PR (#249) but at TS level does not have much sense since an invalid type is impossible to reach when using @octokit/auth-app package.


Checking at @octokit/core package, I found some TODOs which probably are the cause of the problem:

And checking at @octokit/types seems we are not exposing AuthTypes. What we would need is:

auth-app.js/src/types.ts

Lines 141 to 144 in f008655

export type AuthOptions = InstallationAuthOptions &
OAuthOptions & {
type: "app" | "installation" | "oauth";
};

Not sure how to proceed here:

  • To place AuthOptions in @octokit/types (and @octokit/auth-app and @octokit/core consume them from there) (?)
  • To add @octokit/auth-app as dependency for @octokit/core and consume AuthOptions directly (?)
  • Any other option I'm not considering (?)

@gr2m

from auth-app.js.

github-actions avatar github-actions commented on June 6, 2024

🎉 This issue has been resolved in version 2.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from auth-app.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.