Closed abisalehalliprasan closed 4 years ago
I think I can take a crack at it.
There are two ways to handle Typescript support:
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');
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
@qjd2413 : Awesome. Just did that 👨💻. Appreciate that @qjd2413
Oh, shoot, I'm just a tiny bit late. womp womp, I'll find another issue.
@spencerwi: There might be more. I will keep you posted. Thank you.
im kinda surprised you dont have these yet. anything on the horizon ?
@29er : We will be releasing the typescript version soon. Thanks.
@abisalehalliprasan did the TS types pushed through?
@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.
No worries, thanks mate 👍
im kinda surprised you dont have these yet. anything on the horizon ?
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.
@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.
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!
Hello @abisalehalliprasan! Just checking in :dancers:
Hi, What is the status of typescript type definition ? Could you please provide it ?
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.
Quick work around for Typescript users.
types
intuit-oauth
tsconfig.json
...
"types": [
"intuit-oauth",
],
"typeRoots": [ "./types", "./node_modules/@types"],
...
intuit-oauth
called index.d.ts
This has not been fully tested, but seems to work. Someone should test this and make a PR as Typescript support here seems essential.
Why is this closed if it's not released (13 months later)?
@abisalehalliprasan can you comment on the current state of type definitions for TypeScript?
Bump
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
calledindex.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!
Really guys? Three+ years? That's totally not serious!
@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"
]
}
Hello from Nov 2023...
26 Dec 2023 and this is still not implemented?
Hello from 2024
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.
I don't think they will introduce it anytime soon :(
lol, this isn't happening folks. it's time for us to step in
What's the status on this? @IntuitDeveloperRelations
Why is this closed? Is there no plan on supporting typescript?
Is there a custom implementation somewhere? I don't think we're going to get an official one anytime soon
Goal : To be able to support
typescript
communityRef : https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gapi.client.oauth2 https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-oauth2