client.tokens.iceServers incorrectly typed as string array
Issue Summary
Type of client.tokens.iceServers is wrongly defined as string[] when it is in fact an array of objects.
Code Snippet / Steps to Reproduce
const client = twilio(accountSid, authToken);
const tokens = await client.tokens.create();
console.log(tokens.iceServers);
When running the above code, the console outputs the following which is clearly not an array of strings
[
{
"url": "stun:global.stun.twilio.com:3478?transport=udp",
"urls": "stun:global.stun.twilio.com:3478?transport=udp"
},
{
"username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
"credential": "tE2DajzSJwnsSbc123",
"url": "turn:global.turn.twilio.com:3478?transport=udp",
"urls": "turn:global.turn.twilio.com:3478?transport=udp"
},
{
"username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
"credential": "tE2DajzSJwnsSbc123",
"url": "turn:global.turn.twilio.com:3478?transport=tcp",
"urls": "turn:global.turn.twilio.com:3478?transport=tcp"
},
{
"username": "dc2d2894d5a9023620c467b0e71cfa6a35457e6679785ed6ae9856fe5bdfa269",
"credential": "tE2DajzSJwnsSbc123",
"url": "turn:global.turn.twilio.com:443?transport=tcp",
"urls": "turn:global.turn.twilio.com:443?transport=tcp"
}
]
Technical details:
- twilio-node version: 3.73.1
- node version: v14.18.0
Since the change is required in a generated file, we'll need to make changes in the internal upstream generator.
This issue has been added to our internal backlog to be prioritized. +1s on the issue summary will help it move up the backlog.
Closing as fixed in the RC branch: https://github.com/twilio/twilio-node/blob/e2204f2f882ea85b7cd9ca26b8b85cda28b98fe3/lib/rest/api/v2010/account/token.ts#L183
This will be included in the first release candidate for twilio-node@v4 dropping this week.