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

Extend the library to support TypeScript #33

Closed
abisalehalliprasan opened this issue Sep 30, 2019 · 33 comments
Closed

Extend the library to support TypeScript #33

abisalehalliprasan opened this issue Sep 30, 2019 · 33 comments
Assignees
Labels
enhancement New feature or request hacktoberfest

Comments

@abisalehalliprasan
Copy link
Collaborator

Goal :
To be able to support typescript community

Ref :
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gapi.client.oauth2
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-oauth2

@spencerwi
Copy link

spencerwi commented Sep 30, 2019

I think I can take a crack at it.

There are two ways to handle Typescript support:

  1. Include declaration file(s) in your own repo, and point the types property of package.json at the "root" type declaration file (or just name it index.d.ts). This makes everything "just work" out of the box for devs using Typescript, as the Typescript compiler will know where to find the type definition files when Typescript devs do const OAuthClient = require('intuit-oauth');

  2. Create declaration files, and submit them to DefinitelyTyped (the repo you linked to). In this case, Typescript developers will need to install a separate dev dependency from the @types namespace that corresponds to your library:

$ npm install --save-dev @types/intuit-oauth

@abisalehalliprasan
Copy link
Collaborator Author

@qjd2413 : Awesome. Just did that 👨‍💻. Appreciate that @qjd2413

@spencerwi
Copy link

Oh, shoot, I'm just a tiny bit late. womp womp, I'll find another issue.

@abisalehalliprasan
Copy link
Collaborator Author

@spencerwi: There might be more. I will keep you posted. Thank you.

@abisalehalliprasan abisalehalliprasan added the enhancement New feature or request label Oct 7, 2019
@29er
Copy link

29er commented Nov 27, 2019

im kinda surprised you dont have these yet. anything on the horizon ?

@abisalehalliprasan
Copy link
Collaborator Author

@29er : We will be releasing the typescript version soon. Thanks.

@jponc
Copy link

jponc commented May 7, 2020

@abisalehalliprasan did the TS types pushed through?

@abisalehalliprasan
Copy link
Collaborator Author

@jponc : We have a typescript branch but the code is not Production-ready yet.
Ref : oauth-jsclient typescript

I cannot provide exact timelines on the release at the moment. But you are free to look at the sample example here if it helps.

@jponc
Copy link

jponc commented May 7, 2020

No worries, thanks mate 👍

@salvadorbarb1
Copy link

im kinda surprised you dont have these yet. anything on the horizon ?

@ryannewton
Copy link

Is this published?

I just tried running npm install --save-dev @types/intuit-oauth and I can't tell if I'm missing something or if it's still being developed.

@ryannewton
Copy link

@abisalehalliprasan
Could you provide an update on this?

I'm just jumping into using intuit-oauth and am using Typescript. It'd be nice to have confirmation if I'm missing something or if this project got shelved.

@abisalehalliprasan
Copy link
Collaborator Author

Hi @ryannewton :
There a few things which need to be tested before we release the typescript version. We will try to prioritize a release very soon. Thank you for your understanding!

@jesuschris
Copy link

Hello @abisalehalliprasan! Just checking in 👯

@zenininja
Copy link

Hi, What is the status of typescript type definition ? Could you please provide it ?

@lsacco-nutreense
Copy link

Hello @abisalehalliprasan...It's been almost 6 months since your last post and I don't see anything posted on NPM in this regard. This would be a big help for us. Thanks.

@AshMartian
Copy link

Quick work around for Typescript users.

  • Create a new folder in root of project types
  • New folder inside that called intuit-oauth
  • Reference this folder in tsconfig.json
...
        "types": [
            "intuit-oauth",
        ],
        "typeRoots": [ "./types", "./node_modules/@types"],
...
  • New file inside intuit-oauth called index.d.ts
  • I copied the type definitions from the typescript branch but was full of errors. Cleaned it up and it's eslint happy in this gist

This has not been fully tested, but seems to work. Someone should test this and make a PR as Typescript support here seems essential.

@thesoftwarephilosopher
Copy link

thesoftwarephilosopher commented Feb 10, 2022

Why is this closed if it's not released (13 months later)?

@GuiSim
Copy link

GuiSim commented Apr 28, 2022

@abisalehalliprasan can you comment on the current state of type definitions for TypeScript?

@bluefire2121
Copy link

Bump

@juanjalvarez
Copy link

Quick work around for Typescript users.

  • Create a new folder in root of project types
  • New folder inside that called intuit-oauth
  • Reference this folder in tsconfig.json
...
        "types": [
            "intuit-oauth",
        ],
        "typeRoots": [ "./types", "./node_modules/@types"],
...
  • New file inside intuit-oauth called index.d.ts
  • I copied the type definitions from the typescript branch but was full of errors. Cleaned it up and it's eslint happy in this gist

This has not been fully tested, but seems to work. Someone should test this and make a PR as Typescript support here seems essential.

This worked perfectly for me, thank you!

@tedyme
Copy link

tedyme commented Mar 9, 2023

Really guys? Three+ years? That's totally not serious!

@flare-autobots
Copy link

@juanjalvarez does it work for production? I am having an issue.

2023-03-24T18:21:19.164Z	undefined	ERROR	Uncaught Exception 	{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module './development.js'\nRequire stack:\n- /var/task/node_modules/@dabh/diagnostics/node/index.js\n- /var/task/node_modules/winston/lib/winston/exception-handler.js\n- /var/task/node_modules/winston/lib/winston/logger.js\n- /var/task/node_modules/winston/lib/winston/create-logger.js\n- /var/task/node_modules/winston/lib/winston.js\n- /var/task/node_modules/intuit-oauth/src/OAuthClient.js\n- /var/task/src/functions/quickBooks/oauth/handler.js\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module './development.js'",
        "Require stack:",
        "- /var/task/node_modules/@dabh/diagnostics/node/index.js",
        "- /var/task/node_modules/winston/lib/winston/exception-handler.js",
        "- /var/task/node_modules/winston/lib/winston/logger.js",
        "- /var/task/node_modules/winston/lib/winston/create-logger.js",
        "- /var/task/node_modules/winston/lib/winston.js",
        "- /var/task/node_modules/intuit-oauth/src/OAuthClient.js",
        "- /var/task/src/functions/quickBooks/oauth/handler.js",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:996:17)",
        "    at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1031:21)",
        "    at async start (file:///var/runtime/index.mjs:1194:23)",
        "    at async file:///var/runtime/index.mjs:1200:1"
    ]
}

@zahinz
Copy link

zahinz commented Nov 17, 2023

Hello from Nov 2023...

@yannickcare
Copy link

26 Dec 2023 and this is still not implemented?

@vinu-ablabs
Copy link

Hello from 2024

@qjd2413 qjd2413 removed their assignment Jan 29, 2024
@egervari
Copy link

It's essential to include TypeScript support. TypeScript, introduced in 2012 and further popularized by Angular in 2016, has become a cornerstone of modern development. With frameworks like NestJS leveraging its capabilities since 2017, it's evident that TypeScript is integral to contemporary programming practices. Given the significant financial transactions your customers conduct, the absence of TypeScript support seems unwarranted. It's high time for this support to be officially integrated.

@AliHydr
Copy link

AliHydr commented Mar 14, 2024

I don't think they will introduce it anytime soon :(

@ananay
Copy link

ananay commented Apr 11, 2024

lol, this isn't happening folks. it's time for us to step in

@kuang
Copy link

kuang commented Jun 20, 2024

What's the status on this? @IntuitDeveloperRelations

@jjuli93
Copy link

jjuli93 commented Aug 22, 2024

Why is this closed? Is there no plan on supporting typescript?

@luis-ryestrategy
Copy link

Is there a custom implementation somewhere? I don't think we're going to get an official one anytime soon

@thamilmurugesan
Copy link

oh wow, 2024 is gonna end, and we didnt receive it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests