team-telnyx/telnyx-node

Please create typescript declarations for the library

Opened this issue Β· 33 comments

thanks for the suggestion @kenptr. I will triage and let you know when we have that ready

Hey guys, do you have any estimate on when you deliver that?
@lucasassisrosa

Any updates on that? Would like to implement this service in my application, but without types it is not really useful for a production application.

Guys, this issue is more than 2 years old, any updates @lucasassisrosa ?

Any updates?

hey guys,
any update? :)

hellooooooo! is this going to be done?

bradrf commented

+1

Any update on this? At this point any type hinting would be great.

We are looking into this and should be releasing this with the next update.

Apologies for the delay of this requested feature!

dmexs commented

Exploring the API and would love to have some IntelliSense completion, even if the types aren't finisihed.

tgbv commented

Any updates on this one?

Converting the entire library to TS would be massive 🌞

elzii commented

TELNYX.D.TS

PLZZZ

Yes please add

4 years later smh

We also require this for our application management.

Any updates on this one?

I see that TS prep was specifically mentioned in the v1.26 release. Any ETA for this v2 release?

Hi everyone,

Thank you for your patience regarding the implementation of Typescript declarations for our Telnyx Node SDK. I wanted to provide an update: although it’s not on our roadmap for the rest of this year, we are currently planning the requirements and potential work involved to eventually deliver as we know it will provide a much needed and improved user experience.

While we can't commit to a firm date right now, we anticipate beginning work in Q1 2025.

This timeline may change, and work could start earlier. We will keep this thread updated at the beginning of Q4 2024.

Going for another provider then...

Hi everyone, I mentioned that I would share an update at the beginning of Q4 regarding this projects prioritisation.

I’m pleased to share an earlier update to confirm that the revision is now underway! Specifically, we're updating project dependencies and starting the conversion of library files and endpoints to TypeScript, as well as any potential missing endpoints.

I hope that you all hear from me again by the end of September if not earlier.

Hi everyone,

Time has certainly flown by. The team has been hard at work, and we now have an alpha version ready for internal testing.

We expect to release a beta version between mid and late October, and would love your help with further testing when it’s available.

Expect another update by then!

I've been reviewing progress and very excited for the upcoming release. It would be helpful if the Webhook dto's were explicitly defined in the SDK so we can import them directly into our application. Attributes like event_type and state are poorly documented and leave us blind as to their possible values.

Great progress on this! It'd also be helpful if v2 also exported as CommonJS. Some projects are not quite ready to adopt ESM.

I'm not entirely sure I agree with maintaining CJS support anymore, I reserve the right to be wrong but ESM is the future of JS and it has been for some time. The only time I see maintainers gripping onto CJS is when the codebase is not well maintained.

However the glory of OS is you can fork and build your own release.

using a pnpm mono-repo version 2.0.0-beta.4 does not resolve properly. I get this error:

Cannot find module 'node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx' imported from node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx.node.js

using a pnpm mono-repo version 2.0.0-beta.4 does not resolve properly. I get this error:

Cannot find module 'node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx' imported from node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx.node.js

@danclaroni thanks for spotting this. after trying to reproduce this issue I can see it's specific to how pnpm andtsconfig.json are resolving modules without an extension (.js). I have updated the existing examples to use 2.0.0-beta.4 version, will address that import issue and add a new example using pnpm

ref: https://www.typescriptlang.org/tsconfig/#Modules_6244

EDIT: could you share your error log and Node/TS version and config if possible?

using a pnpm mono-repo version 2.0.0-beta.4 does not resolve properly. I get this error:
Cannot find module 'node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx' imported from node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx.node.js

@danclaroni thanks for spotting this. after trying to reproduce this issue I can see it's specific to how pnpm andtsconfig.json are resolving modules without an extension (.js). I have updated the existing examples to use 2.0.0-beta.4 version, will address that import issue and add a new example using pnpm

ref: https://www.typescriptlang.org/tsconfig/#Modules_6244

EDIT: could you share your error log and Node/TS version and config if possible?

@lucasassisrosa is there an update on this? I dont know where you updated the existing examples. Can you provide a link or further instruction?

Node: 20.18.0
TS: 5.3.2

Error log:
4:58:12 PM [vite] Error when evaluating SSR module /src/routes/(dashboard)/notifications/+page.server.ts: failed to import "telnyx"
|- Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/danclaroni/repos/personal/tt/node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx' imported from /Users/danclaroni/repos/personal/tt/node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx.node.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1169:11)
at nextResolve (node:internal/modules/esm/hooks:868:28)
at resolve (file:///Users/danclaroni/repos/personal/tt/node_modules/.pnpm/@vavite+node-loader@3.0.0_vite@5.4.2_@types+node@20.14.12_terser@5.34.1_/node_modules/@vavite/node-loader/dist/index.js:45:12)
at nextResolve (node:internal/modules/esm/hooks:868:28)
at Hooks.resolve (node:internal/modules/esm/hooks:306:30)
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
at MessagePort. (node:internal/per_context/messageport:23:28)

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/danclaroni/repos/personal/tt/node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx' imported from /Users/danclaroni/repos/personal/tt/node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx.node.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1169:11)
at nextResolve (node:internal/modules/esm/hooks:868:28)
at resolve (file:///Users/danclaroni/repos/personal/tt/node_modules/.pnpm/@vavite+node-loader@3.0.0_vite@5.4.2_@types+node@20.14.12_terser@5.34.1_/node_modules/@vavite/node-loader/dist/index.js:45:12)
at nextResolve (node:internal/modules/esm/hooks:868:28)
at Hooks.resolve (node:internal/modules/esm/hooks:306:30)
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
at MessagePort. (node:internal/per_context/messageport:23:28) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/danclaroni/repos/personal/tt/node_modules/.pnpm/telnyx@2.0.0-beta.4/node_modules/telnyx/dist/telnyx'
}

Hi. Is there any progress?

If anyone else wants to use an alternative while they fix their typescript support, I've generated a full typescript client from Telnyx's OpenAPI specification: https://www.npmjs.com/package/telnyx-api