Closed speak-jure closed 1 year ago
The types for v2 have been mostly community supported. I'm working on v3 right now which will help with some of this, but haven't gotten to Voice quite yet. I should be in the next week or two. The only other way to work around it is set it to any, or extend it locally. I wish I had better news for you.
Hey Kelly!
Thank you for your reply. I assumed it's an upcoming improvement, but I'm glad to have gotten your confirmation.
I have a workaround set up by using @ts-ignore
, so I agree that my request is more of a nice to have than anything else.
Keep up the good work.
@speak-jure Can you update V3 of the SDK and LMK if you still have an issue?
Hello, i have the same issue this thread speaks about, those are my vonage object properties;
` Vonage {credentials: Auth, options: undefined, accounts: Accounts, applications: Applications, messages: Messages, …}
accounts: Accounts {auth: Auth, config: {…}, authType: 'query_key_secret'} applications: Applications {auth: Auth, config: {…}, authType: 'basic'} credentials: Auth {getQueryParams: ƒ, createBasicHeader: ƒ, createBearerHeader: ƒ, createSignatureHash: ƒ, apiKey: 'xxxxxx', …} messages: Messages {auth: Auth, config: {…}} numberInsights: NumberInsights {auth: Auth, config: {…}} numbers: Numbers {auth: Auth, config: {…}, authType: 'query_key_secret'} options: undefined pricing: Pricing {auth: Auth, config: {…}, authType: 'query_key_secret'} secrets: Secrets {auth: Auth, config: {…}, authType: 'basic'} sms: SMS {auth: Auth, config: {…}} verify: Verify {auth: Auth, config: {…}} voice: Voice {auth: Auth, config: {…}, authType: 'jwt'}
` There is a "voice" property, but any "calls".
I use the version 3.0.10;
"dependencies": { "@vonage/server-sdk": "^3.0.10", }
@serfermorhc and @speak-jure Apologies as we are behind on updating the code snippets and documentation. calls
is no longer a property on numbers
. We updated the function names to be more descriptive. Instead of calling vonage.numbers.calls.create
, you can call vonage.numbers.createOutboundCall
. I have added a migration guide that should explain all the changes.
Another point of note, we updated most of the functions to accept a parameters object instead of just passing in parameters. We are looking to build out technical documentation for all our functions. Once that is ready to go, you will be able to get a more detailed rundown of what needs to be passed into each call.
This issue stems from improper documentation which has been addressed
Issue
Vonage in relation to Typescript. After initializing a Vonage object, the
calls
property is not recognized as being part of the object, since it's not defined ind.ts
.Code
Error
The
calls
invonage.calls.create
is underlined and specifies the following problem:Property 'calls' does not exist on type 'Vonage'.
Request
Is there any short-term plan on adding typing for this as well? Or is there a workaround that I am not aware of? Besides using
// @ts-ignore
.