Skip to content

Incorrect types for PhoneNumberCapabilities #833

@stephenwade

Description

@stephenwade

Issue Summary

The TypeScript types for phone number capabilities are wrong. The types are all lowercase, but the actual API response has some uppercase keys. Also, the types say fax will be present, but it is absent.

Steps to Reproduce

image

Code Snippet

import { Twilio } from "twilio";

const keySid = "REDACTED";
const keySecret = "REDACTED";
const accountSid = "REDACTED";

const client = new Twilio(keySid, keySecret, { accountSid });

const [phoneNumber] = await client.availablePhoneNumbers("US").local.list();

console.log(Object.keys(phoneNumber.capabilities));
// [ 'voice', 'SMS', 'MMS' ]

Technical details:

  • twilio-node version: 3.83.3
  • node version: 16.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalepriority: highNeeds immediate attention; blockers or critical or bugtype: bugbug in the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions