From df54cd61f65756188ede34f91d854dd465de2925 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 15 Mar 2021 20:10:45 +0000 Subject: [PATCH] [Librarian] Regenerated @ ea687051c299d913d47e5ccde2b85955dc738246 --- CHANGES.md | 24 ++++ lib/rest/events/v1/eventType.d.ts | 20 ++-- lib/rest/events/v1/eventType.js | 20 ++-- lib/rest/events/v1/schema.d.ts | 20 ++-- lib/rest/events/v1/schema.js | 20 ++-- lib/rest/events/v1/schema/schemaVersion.d.ts | 20 ++-- lib/rest/events/v1/schema/schemaVersion.js | 20 ++-- lib/rest/events/v1/sink.d.ts | 20 ++-- lib/rest/events/v1/sink.js | 20 ++-- lib/rest/events/v1/sink/sinkTest.d.ts | 15 +-- lib/rest/events/v1/sink/sinkTest.js | 15 +-- lib/rest/events/v1/sink/sinkValidate.d.ts | 15 +-- lib/rest/events/v1/sink/sinkValidate.js | 15 +-- lib/rest/events/v1/subscription.d.ts | 20 ++-- lib/rest/events/v1/subscription.js | 20 ++-- .../v1/subscription/subscribedEvent.d.ts | 15 +-- .../events/v1/subscription/subscribedEvent.js | 15 +-- lib/rest/insights/v1/room.d.ts | 36 +++--- lib/rest/insights/v1/room.js | 105 ++++++++++-------- lib/rest/insights/v1/room/participant.d.ts | 12 +- lib/rest/insights/v1/room/participant.js | 52 +++++---- lib/rest/messaging/v1/brandRegistration.d.ts | 2 +- .../proxy/v1/service/session/participant.js | 3 +- .../verify/v2/service/entity/challenge.d.ts | 2 +- lib/rest/verify/v2/service/entity/factor.d.ts | 24 +++- lib/rest/verify/v2/service/entity/factor.js | 38 ++++++- lib/twiml/VoiceResponse.d.ts | 21 ++++ lib/twiml/VoiceResponse.js | 42 +++++++ .../rest/api/v2010/account/message.spec.js | 40 +++++++ .../messaging/v1/brandRegistration.spec.js | 10 +- .../verify/v2/service/entity/factor.spec.js | 6 +- 31 files changed, 427 insertions(+), 280 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4bb6214397..081289fff4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,30 @@ twilio-node changelog ===================== +[2021-03-15] Version 3.58.0 +--------------------------- +**Library - Fix** +- [PR #665](https://github.com/twilio/twilio-node/pull/665): fix validateExpressRequest issue. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! + +**Library - Chore** +- [PR #661](https://github.com/twilio/twilio-node/pull/661): upgrade url-parse. Thanks to [@thinkingserious](https://github.com/thinkingserious)! + +**Events** +- Set maturity to beta + +**Messaging** +- Adjust A2P brand registration status enum **(breaking change)** + +**Studio** +- Remove internal safeguards for Studio V2 API usage now that it's GA + +**Verify** +- Add support for creating and verifying totp factors. Support for totp factors is behind the `api.verify.totp` beta feature. + +**Twiml** +- Add support for `` noun + + [2021-02-24] Version 3.57.0 --------------------------- **Events** diff --git a/lib/rest/events/v1/eventType.d.ts b/lib/rest/events/v1/eventType.d.ts index b0f8cf25ec..d2f9763648 100644 --- a/lib/rest/events/v1/eventType.d.ts +++ b/lib/rest/events/v1/eventType.d.ts @@ -13,9 +13,8 @@ import { SerializableClass } from '../../../interfaces'; /** * Initialize the EventTypeList * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @param version - Version of the resource */ @@ -212,9 +211,8 @@ declare class EventTypeContext { /** * Initialize the EventTypeContext * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @param version - Version of the resource * @param type - A string that uniquely identifies this Event Type. @@ -238,9 +236,8 @@ declare class EventTypeInstance extends SerializableClass { /** * Initialize the EventTypeContext * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @param version - Version of the resource * @param payload - The instance payload @@ -273,9 +270,8 @@ declare class EventTypePage extends Page /** * Initialize the SinkPage * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/events/v1/sink.js b/lib/rest/events/v1/sink.js index 0e1e48da04..18c71ae2a7 100644 --- a/lib/rest/events/v1/sink.js +++ b/lib/rest/events/v1/sink.js @@ -29,9 +29,8 @@ var SinkContext; /** * Initialize the SinkList * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @constructor Twilio.Events.V1.SinkList * @@ -395,9 +394,8 @@ SinkList = function SinkList(version) { /** * Initialize the SinkPage * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @constructor Twilio.Events.V1.SinkPage * @@ -463,9 +461,8 @@ SinkPage.prototype[util.inspect.custom] = function inspect(depth, options) { /** * Initialize the SinkContext * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @constructor Twilio.Events.V1.SinkInstance * @@ -603,9 +600,8 @@ SinkInstance.prototype[util.inspect.custom] = function inspect(depth, options) { /** * Initialize the SinkContext * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @constructor Twilio.Events.V1.SinkContext * diff --git a/lib/rest/events/v1/sink/sinkTest.d.ts b/lib/rest/events/v1/sink/sinkTest.d.ts index 8b24c093b1..467d1188cd 100644 --- a/lib/rest/events/v1/sink/sinkTest.d.ts +++ b/lib/rest/events/v1/sink/sinkTest.d.ts @@ -13,9 +13,8 @@ import { SerializableClass } from '../../../../interfaces'; /** * Initialize the SinkTestList * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @param version - Version of the resource * @param sid - A string that uniquely identifies this Sink. @@ -51,9 +50,8 @@ declare class SinkTestInstance extends SerializableClass { /** * Initialize the SinkTestContext * - * PLEASE NOTE that this class contains preview products that are subject to - * change. Use them with caution. If you currently do not have developer preview - * access, please contact help@twilio.com. + * PLEASE NOTE that this class contains beta products that are subject to change. + * Use them with caution. * * @param version - Version of the resource * @param payload - The instance payload @@ -73,9 +71,8 @@ declare class SinkTestPage extends Page void) => void; @@ -189,9 +189,9 @@ interface RoomListInstanceEachOptions { /** * Options to pass to list * - * @property codec - The codec - * @property createdAfter - The created_after - * @property createdBefore - The created_before + * @property codec - Codecs used by participants in the room. + * @property createdAfter - Only read rooms that started on or after this ISO 8601 timestamp. + * @property createdBefore - Only read rooms that started before this ISO 8601 timestamp. * @property limit - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -202,8 +202,8 @@ interface RoomListInstanceEachOptions { * If no page_size is defined but a limit is defined, * list() will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) - * @property roomName - The room_name - * @property roomType - The room_type + * @property roomName - Room friendly name. + * @property roomType - Type of room. */ interface RoomListInstanceOptions { codec?: RoomCodec | RoomCodec[]; @@ -218,14 +218,14 @@ interface RoomListInstanceOptions { /** * Options to pass to page * - * @property codec - The codec - * @property createdAfter - The created_after - * @property createdBefore - The created_before + * @property codec - Codecs used by participants in the room. + * @property createdAfter - Only read rooms that started on or after this ISO 8601 timestamp. + * @property createdBefore - Only read rooms that started before this ISO 8601 timestamp. * @property pageNumber - Page Number, this value is simply for client state * @property pageSize - Number of records to return, defaults to 50 * @property pageToken - PageToken provided by the API - * @property roomName - The room_name - * @property roomType - The room_type + * @property roomName - Room friendly name. + * @property roomType - Type of room. */ interface RoomListInstancePageOptions { codec?: RoomCodec | RoomCodec[]; @@ -282,7 +282,7 @@ declare class RoomContext { * Use them with caution. * * @param version - Version of the resource - * @param roomSid - The room_sid + * @param roomSid - The SID of the Room resource. */ constructor(version: V1, roomSid: string); @@ -309,7 +309,7 @@ declare class RoomInstance extends SerializableClass { * * @param version - Version of the resource * @param payload - The instance payload - * @param roomSid - The room_sid + * @param roomSid - The SID of the Room resource. */ constructor(version: V1, payload: RoomPayload, roomSid: string); diff --git a/lib/rest/insights/v1/room.js b/lib/rest/insights/v1/room.js index e9c23c43ec..24f33534f4 100644 --- a/lib/rest/insights/v1/room.js +++ b/lib/rest/insights/v1/room.js @@ -72,11 +72,13 @@ RoomList = function RoomList(version) { * @memberof Twilio.Insights.V1.RoomList# * * @param {object} [opts] - Options for request - * @param {room.room_type|list} [opts.roomType] - The room_type - * @param {room.codec|list} [opts.codec] - The codec - * @param {string} [opts.roomName] - The room_name - * @param {Date} [opts.createdAfter] - The created_after - * @param {Date} [opts.createdBefore] - The created_before + * @param {room.room_type|list} [opts.roomType] - Type of room. + * @param {room.codec|list} [opts.codec] - Codecs used by participants in the room. + * @param {string} [opts.roomName] - Room friendly name. + * @param {Date} [opts.createdAfter] - + * Only read rooms that started on or after this ISO 8601 timestamp. + * @param {Date} [opts.createdBefore] - + * Only read rooms that started before this ISO 8601 timestamp. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -164,11 +166,13 @@ RoomList = function RoomList(version) { * @memberof Twilio.Insights.V1.RoomList# * * @param {object} [opts] - Options for request - * @param {room.room_type|list} [opts.roomType] - The room_type - * @param {room.codec|list} [opts.codec] - The codec - * @param {string} [opts.roomName] - The room_name - * @param {Date} [opts.createdAfter] - The created_after - * @param {Date} [opts.createdBefore] - The created_before + * @param {room.room_type|list} [opts.roomType] - Type of room. + * @param {room.codec|list} [opts.codec] - Codecs used by participants in the room. + * @param {string} [opts.roomName] - Room friendly name. + * @param {Date} [opts.createdAfter] - + * Only read rooms that started on or after this ISO 8601 timestamp. + * @param {Date} [opts.createdBefore] - + * Only read rooms that started before this ISO 8601 timestamp. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -229,11 +233,13 @@ RoomList = function RoomList(version) { * @memberof Twilio.Insights.V1.RoomList# * * @param {object} [opts] - Options for request - * @param {room.room_type|list} [opts.roomType] - The room_type - * @param {room.codec|list} [opts.codec] - The codec - * @param {string} [opts.roomName] - The room_name - * @param {Date} [opts.createdAfter] - The created_after - * @param {Date} [opts.createdBefore] - The created_before + * @param {room.room_type|list} [opts.roomType] - Type of room. + * @param {room.codec|list} [opts.codec] - Codecs used by participants in the room. + * @param {string} [opts.roomName] - Room friendly name. + * @param {Date} [opts.createdAfter] - + * Only read rooms that started on or after this ISO 8601 timestamp. + * @param {Date} [opts.createdBefore] - + * Only read rooms that started before this ISO 8601 timestamp. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -324,7 +330,7 @@ RoomList = function RoomList(version) { * @function get * @memberof Twilio.Insights.V1.RoomList# * - * @param {string} roomSid - The room_sid + * @param {string} roomSid - The SID of the Room resource. * * @returns {Twilio.Insights.V1.RoomContext} */ @@ -431,38 +437,49 @@ RoomPage.prototype[util.inspect.custom] = function inspect(depth, options) { * * @constructor Twilio.Insights.V1.RoomInstance * - * @property {string} accountSid - The account_sid - * @property {string} roomSid - The room_sid - * @property {string} roomName - The room_name - * @property {Date} createTime - The create_time - * @property {Date} endTime - The end_time - * @property {room.room_type} roomType - The room_type - * @property {room.room_status} roomStatus - The room_status - * @property {string} statusCallback - The status_callback - * @property {string} statusCallbackMethod - The status_callback_method - * @property {room.created_method} createdMethod - The created_method - * @property {room.end_reason} endReason - The end_reason - * @property {number} maxParticipants - The max_participants - * @property {number} uniqueParticipants - The unique_participants + * @property {string} accountSid - Account SID associated with this room. + * @property {string} roomSid - Unique identifier for the room. + * @property {string} roomName - room friendly name. + * @property {Date} createTime - Creation time of the room. + * @property {Date} endTime - End time for the room. + * @property {room.room_type} roomType - Type of room. + * @property {room.room_status} roomStatus - Status of the room. + * @property {string} statusCallback - Webhook provided for status callbacks. + * @property {string} statusCallbackMethod - + * HTTP method provided for status callback URL. + * @property {room.created_method} createdMethod - How the room was created. + * @property {room.end_reason} endReason - Reason the room ended. + * @property {number} maxParticipants - + * Max number of total participants allowed by the application settings. + * @property {number} uniqueParticipants - + * Number of participants. May include duplicate identities for participants who left and rejoined. * @property {number} uniqueParticipantIdentities - - * The unique_participant_identities - * @property {number} concurrentParticipants - The concurrent_participants - * @property {number} maxConcurrentParticipants - The max_concurrent_participants - * @property {room.codec} codecs - The codecs - * @property {room.twilio_realm} mediaRegion - The media_region - * @property {number} durationSec - The duration_sec + * Unique number of participant identities. + * @property {number} concurrentParticipants - + * Actual number of concurrent participants. + * @property {number} maxConcurrentParticipants - + * Maximum number of participants allowed in the room at the same time allowed by the application settings. + * @property {room.codec} codecs - Codecs used by participants in the room. + * @property {room.twilio_realm} mediaRegion - + * Region of Twilio media servers for the room. + * @property {number} durationSec - + * Total room duration from create time to end time. * @property {number} totalParticipantDurationSec - - * The total_participant_duration_sec - * @property {number} totalRecordingDurationSec - The total_recording_duration_sec - * @property {room.processing_state} processingState - The processing_state - * @property {boolean} recordingEnabled - The recording_enabled - * @property {room.edge_location} edgeLocation - The edge_location - * @property {string} url - The url - * @property {string} links - The links + * Combined amount of participant time in the room. + * @property {number} totalRecordingDurationSec - + * Combined amount of recorded seconds for participants in the room. + * @property {room.processing_state} processingState - + * Video Log Analyzer resource state. Will be either `in-progress` or `complete`. + * @property {boolean} recordingEnabled - + * Boolean indicating if recording is enabled for the room. + * @property {room.edge_location} edgeLocation - + * Edge location of Twilio media servers for the room. + * @property {string} url - URL for the room resource. + * @property {string} links - Room subresources. * * @param {V1} version - Version of the resource * @param {RoomPayload} payload - The instance payload - * @param {sid_like} roomSid - The room_sid + * @param {sid_like} roomSid - The SID of the Room resource. */ /* jshint ignore:end */ RoomInstance = function RoomInstance(version, payload, roomSid) { @@ -580,7 +597,7 @@ RoomInstance.prototype[util.inspect.custom] = function inspect(depth, options) { * participants resource * * @param {V1} version - Version of the resource - * @param {sid_like} roomSid - The room_sid + * @param {sid_like} roomSid - The SID of the Room resource. */ /* jshint ignore:end */ RoomContext = function RoomContext(version, roomSid) { diff --git a/lib/rest/insights/v1/room/participant.d.ts b/lib/rest/insights/v1/room/participant.d.ts index 96cd8d8346..ddd2646fc0 100644 --- a/lib/rest/insights/v1/room/participant.d.ts +++ b/lib/rest/insights/v1/room/participant.d.ts @@ -25,7 +25,7 @@ type ParticipantTwilioRealm = 'us1'|'us2'|'au1'|'br1'|'ie1'|'jp1'|'sg1'|'in1'|'d * Use them with caution. * * @param version - Version of the resource - * @param roomSid - The room_sid + * @param roomSid - Unique identifier for the room. */ declare function ParticipantList(version: V1, roomSid: string): ParticipantListInstance; @@ -68,7 +68,7 @@ interface ParticipantListInstance { /** * Constructs a participant * - * @param participantSid - The participant_sid + * @param participantSid - The SID of the Participant resource. */ get(participantSid: string): ParticipantContext; /** @@ -235,8 +235,8 @@ declare class ParticipantContext { * Use them with caution. * * @param version - Version of the resource - * @param roomSid - The room_sid - * @param participantSid - The participant_sid + * @param roomSid - The SID of the Room resource. + * @param participantSid - The SID of the Participant resource. */ constructor(version: V1, roomSid: string, participantSid: string); @@ -262,8 +262,8 @@ declare class ParticipantInstance extends SerializableClass { * * @param version - Version of the resource * @param payload - The instance payload - * @param roomSid - The room_sid - * @param participantSid - The participant_sid + * @param roomSid - Unique identifier for the room. + * @param participantSid - The SID of the Participant resource. */ constructor(version: V1, payload: ParticipantPayload, roomSid: string, participantSid: string); diff --git a/lib/rest/insights/v1/room/participant.js b/lib/rest/insights/v1/room/participant.js index 09fa105f46..8fe5f10547 100644 --- a/lib/rest/insights/v1/room/participant.js +++ b/lib/rest/insights/v1/room/participant.js @@ -32,7 +32,7 @@ var ParticipantContext; * @constructor Twilio.Insights.V1.RoomContext.ParticipantList * * @param {Twilio.Insights.V1} version - Version of the resource - * @param {string} roomSid - The room_sid + * @param {string} roomSid - Unique identifier for the room. */ /* jshint ignore:end */ ParticipantList = function ParticipantList(version, roomSid) { @@ -303,7 +303,7 @@ ParticipantList = function ParticipantList(version, roomSid) { * @function get * @memberof Twilio.Insights.V1.RoomContext.ParticipantList# * - * @param {string} participantSid - The participant_sid + * @param {string} participantSid - The SID of the Participant resource. * * @returns {Twilio.Insights.V1.RoomContext.ParticipantContext} */ @@ -412,28 +412,34 @@ ParticipantPage.prototype[util.inspect.custom] = function inspect(depth, * * @constructor Twilio.Insights.V1.RoomContext.ParticipantInstance * - * @property {string} participantSid - The participant_sid - * @property {string} participantIdentity - The participant_identity - * @property {Date} joinTime - The join_time - * @property {Date} leaveTime - The leave_time - * @property {number} durationSec - The duration_sec - * @property {string} accountSid - The account_sid - * @property {string} roomSid - The room_sid - * @property {participant.room_status} status - The status - * @property {participant.codec} codecs - The codecs - * @property {string} endReason - The end_reason - * @property {number} errorCode - The error_code - * @property {string} errorCodeUrl - The error_code_url - * @property {participant.twilio_realm} mediaRegion - The media_region - * @property {object} properties - The properties - * @property {participant.edge_location} edgeLocation - The edge_location - * @property {object} publisherInfo - The publisher_info - * @property {string} url - The url + * @property {string} participantSid - Unique identifier for the participant. + * @property {string} participantIdentity - + * The application-defined string that uniquely identifies the participant within a Room. + * @property {Date} joinTime - When the participant joined the room. + * @property {Date} leaveTime - When the participant left the room + * @property {number} durationSec - + * Amount of time in seconds the participant was in the room. + * @property {string} accountSid - Account SID associated with the room. + * @property {string} roomSid - Unique identifier for the room. + * @property {participant.room_status} status - Status of the room. + * @property {participant.codec} codecs - Codecs detected from the participant. + * @property {string} endReason - Reason the participant left the room. + * @property {number} errorCode - Errors encountered by the participant. + * @property {string} errorCodeUrl - Twilio error code dictionary link. + * @property {participant.twilio_realm} mediaRegion - + * Twilio media region the participant connected to. + * @property {object} properties - + * Object containing information about the participant's data from the room. + * @property {participant.edge_location} edgeLocation - + * Name of the edge location the participant connected to. + * @property {object} publisherInfo - + * Object containing information about the SDK name and version. + * @property {string} url - URL of the participant resource. * * @param {V1} version - Version of the resource * @param {ParticipantPayload} payload - The instance payload - * @param {sid} roomSid - The room_sid - * @param {sid_like} participantSid - The participant_sid + * @param {sid} roomSid - Unique identifier for the room. + * @param {sid_like} participantSid - The SID of the Participant resource. */ /* jshint ignore:end */ ParticipantInstance = function ParticipantInstance(version, payload, roomSid, @@ -531,8 +537,8 @@ ParticipantInstance.prototype[util.inspect.custom] = function inspect(depth, * @constructor Twilio.Insights.V1.RoomContext.ParticipantContext * * @param {V1} version - Version of the resource - * @param {sid_like} roomSid - The room_sid - * @param {sid_like} participantSid - The participant_sid + * @param {sid_like} roomSid - The SID of the Room resource. + * @param {sid_like} participantSid - The SID of the Participant resource. */ /* jshint ignore:end */ ParticipantContext = function ParticipantContext(version, roomSid, diff --git a/lib/rest/messaging/v1/brandRegistration.d.ts b/lib/rest/messaging/v1/brandRegistration.d.ts index 75866f7941..fcd650606a 100644 --- a/lib/rest/messaging/v1/brandRegistration.d.ts +++ b/lib/rest/messaging/v1/brandRegistration.d.ts @@ -10,7 +10,7 @@ import Response = require('../../../http/response'); import V1 = require('../V1'); import { SerializableClass } from '../../../interfaces'; -type BrandRegistrationStatus = 'IN_PROGRESS'|'VERIFIED'|'FAILED'; +type BrandRegistrationStatus = 'PENDING'|'APPROVED'|'FAILED'; /** * Initialize the BrandRegistrationList diff --git a/lib/rest/proxy/v1/service/session/participant.js b/lib/rest/proxy/v1/service/session/participant.js index 3da4bda102..95f50cf94e 100644 --- a/lib/rest/proxy/v1/service/session/participant.js +++ b/lib/rest/proxy/v1/service/session/participant.js @@ -494,7 +494,8 @@ ParticipantPage.prototype[util.inspect.custom] = function inspect(depth, * @property {string} accountSid - The SID of the Account that created the resource * @property {string} friendlyName - * The string that you assigned to describe the participant - * @property {string} identifier - The phone number of the Participant + * @property {string} identifier - + * The phone number or channel identifier of the Participant * @property {string} proxyIdentifier - * The phone number or short code of the participant's partner * @property {string} proxyIdentifierSid - diff --git a/lib/rest/verify/v2/service/entity/challenge.d.ts b/lib/rest/verify/v2/service/entity/challenge.d.ts index 86742a7fdb..7ea9556c59 100644 --- a/lib/rest/verify/v2/service/entity/challenge.d.ts +++ b/lib/rest/verify/v2/service/entity/challenge.d.ts @@ -14,7 +14,7 @@ type ChallengeChallengeReasons = 'none'|'not_needed'|'not_requested'; type ChallengeChallengeStatuses = 'pending'|'expired'|'approved'|'denied'; -type ChallengeFactorTypes = 'push'; +type ChallengeFactorTypes = 'push'|'totp'; /** * Initialize the ChallengeList diff --git a/lib/rest/verify/v2/service/entity/factor.d.ts b/lib/rest/verify/v2/service/entity/factor.d.ts index 68afa23590..e19b6e810d 100644 --- a/lib/rest/verify/v2/service/entity/factor.d.ts +++ b/lib/rest/verify/v2/service/entity/factor.d.ts @@ -12,10 +12,12 @@ import { SerializableClass } from '../../../../../interfaces'; type FactorFactorStatuses = 'unverified'|'verified'; -type FactorFactorTypes = 'push'; +type FactorFactorTypes = 'push'|'totp'; type FactorNotificationPlatforms = 'apn'|'fcm'; +type FactorTotpAlgorithms = 'sha1'|'sha256'|'sha512'; + /** * Initialize the FactorList * @@ -32,8 +34,12 @@ declare function FactorList(version: V2, serviceSid: string, identity: string): * Options to pass to update * * @property authPayload - Optional payload to verify the Factor for the first time + * @property config.alg - The algorithm used to derive the TOTP codes + * @property config.codeLength - Number of digits for generated TOTP codes * @property config.notificationToken - For APN, the device token. For FCM the registration token * @property config.sdkVersion - The Verify Push SDK version used to configure the factor + * @property config.skew - The number of past and future time-steps valid at a given time + * @property config.timeStep - How often, in seconds, are TOTP codes generated * @property friendlyName - The friendly name of this Factor */ interface FactorInstanceUpdateOptions { @@ -41,6 +47,10 @@ interface FactorInstanceUpdateOptions { config?: { notificationToken?: string; sdkVersion?: string; + timeStep?: number; + skew?: number; + codeLength?: number; + alg?: FactorTotpAlgorithms; }; friendlyName?: string; } @@ -170,10 +180,15 @@ interface FactorListInstance { * * @property binding.alg - The algorithm used when `factor_type` is `push` * @property binding.publicKey - The public key encoded in Base64 + * @property binding.secret - The shared secret in Base32 + * @property config.alg - The algorithm used to derive the TOTP codes * @property config.appId - The ID that uniquely identifies your app in the Google or Apple store + * @property config.codeLength - Number of digits for generated TOTP codes * @property config.notificationPlatform - The transport technology used to generate the Notification Token * @property config.notificationToken - For APN, the device token. For FCM the registration token * @property config.sdkVersion - The Verify Push SDK version used to configure the factor + * @property config.skew - The number of past and future time-steps valid at a given time + * @property config.timeStep - How often, in seconds, are TOTP codes generated * @property factorType - The Type of this Factor * @property friendlyName - The friendly name of this Factor */ @@ -181,12 +196,17 @@ interface FactorListInstanceCreateOptions { binding?: { alg?: string; publicKey?: string; + secret?: string; }; config?: { appId?: string; notificationPlatform?: FactorNotificationPlatforms; notificationToken?: string; sdkVersion?: string; + timeStep?: number; + skew?: number; + codeLength?: number; + alg?: FactorTotpAlgorithms; }; factorType: FactorFactorTypes; friendlyName: string; @@ -404,4 +424,4 @@ declare class FactorPage extends Page TwiML Noun + * + * @param attributes - TwiML attributes + */ + virtualAgent(attributes?: VoiceResponse.VirtualAgentAttributes): void; } diff --git a/lib/twiml/VoiceResponse.js b/lib/twiml/VoiceResponse.js index 7a9e902fba..b582cd1272 100644 --- a/lib/twiml/VoiceResponse.js +++ b/lib/twiml/VoiceResponse.js @@ -2198,6 +2198,48 @@ Connect.prototype.stream = function stream(attributes) { return new Stream(this.connect.ele('Stream', attributes)); }; +/* jshint ignore:start */ +/** + * TwiML Noun + * + * @function virtualAgent + * @memberof Connect# + * + * @param {object} [attributes] - TwiML attributes + * @param {string} [attributes.connectorName] - + * Defines the conversation profile Dialogflow needs to use + * @param {string} [attributes.language] - + * Language to be used by Dialogflow to transcribe speech + * @param {boolean} [attributes.sentimentAnalysis] - + * Whether sentiment analysis needs to be enabled or not + * @param {string} [attributes.statusCallback] - + * URL to post status callbacks from Twilio + * + * @returns VirtualAgent + */ +/* jshint ignore:end */ +Connect.prototype.virtualAgent = function virtualAgent(attributes) { + return new VirtualAgent(this.connect.ele('VirtualAgent', attributes)); +}; + + +/* jshint ignore:start */ +/** + * TwiML Noun + * + * @constructor VirtualAgent + * + * @param {object} virtualAgent - TwiML Noun + */ +/* jshint ignore:end */ +function VirtualAgent(virtualAgent) { + this.virtualAgent = virtualAgent; + this._propertyName = 'virtualAgent'; +} + +VirtualAgent.prototype = Object.create(TwiML.prototype); +VirtualAgent.prototype.constructor = VirtualAgent; + /* jshint ignore:start */ /** diff --git a/spec/integration/rest/api/v2010/account/message.spec.js b/spec/integration/rest/api/v2010/account/message.spec.js index a5819fbbfb..6b64a74a87 100644 --- a/spec/integration/rest/api/v2010/account/message.spec.js +++ b/spec/integration/rest/api/v2010/account/message.spec.js @@ -174,6 +174,46 @@ describe('Message', function() { }).done(); } ); + it('should generate valid create_with_queued_status response', + function(done) { + var body = { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'api_version': '2010-04-01', + 'body': 'Hello! \ud83d\udc4d', + 'date_created': 'Thu, 30 Jul 2015 20:12:31 +0000', + 'date_sent': 'Thu, 30 Jul 2015 20:12:33 +0000', + 'date_updated': 'Thu, 30 Jul 2015 20:12:33 +0000', + 'direction': 'outbound-api', + 'error_code': null, + 'error_message': null, + 'from': '+14155552345', + 'messaging_service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'num_media': '0', + 'num_segments': '1', + 'price': null, + 'price_unit': null, + 'sid': 'SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'status': 'queued', + 'subresource_uris': { + 'media': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json' + }, + 'to': '+14155552345', + 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + }; + + holodeck.mock(new Response(201, body)); + + var opts = {to: '+15558675310'}; + var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .messages.create(opts); + promise.then(function(response) { + expect(response).toBeDefined(); + done(); + }, function() { + throw new Error('failed'); + }).done(); + } + ); it('should generate valid remove request', function(done) { holodeck.mock(new Response(500, {})); diff --git a/spec/integration/rest/messaging/v1/brandRegistration.spec.js b/spec/integration/rest/messaging/v1/brandRegistration.spec.js index a145b8f0d0..5f830142c2 100644 --- a/spec/integration/rest/messaging/v1/brandRegistration.spec.js +++ b/spec/integration/rest/messaging/v1/brandRegistration.spec.js @@ -59,7 +59,7 @@ describe('BrandRegistration', function() { 'a2p_profile_bundle_sid': 'BU3344409f7e067e279523808d267e2d85', 'date_created': '2021-01-27T14:18:35Z', 'date_updated': '2021-01-27T14:18:36Z', - 'status': 'IN_PROGRESS', + 'status': 'PENDING', 'tcr_id': 'BXXXXXX', 'failure_reason': 'Registration error', 'url': 'https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85' @@ -96,7 +96,7 @@ describe('BrandRegistration', function() { 'a2p_profile_bundle_sid': 'BU3344409f7e067e279523808d267e2d85', 'date_created': '2021-01-27T14:18:35Z', 'date_updated': '2021-01-27T14:18:36Z', - 'status': 'IN_PROGRESS', + 'status': 'APPROVED', 'tcr_id': 'BXXXXXX', 'failure_reason': 'Registration error', 'url': 'https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85' @@ -127,7 +127,7 @@ describe('BrandRegistration', function() { 'a2p_profile_bundle_sid': 'BU3344409f7e067e279523808d267e2d85', 'date_created': '2021-01-27T14:18:35Z', 'date_updated': '2021-01-27T14:18:36Z', - 'status': 'IN_PROGRESS', + 'status': 'APPROVED', 'tcr_id': 'BXXXXXX', 'failure_reason': 'Registration error', 'url': 'https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85' @@ -163,7 +163,7 @@ describe('BrandRegistration', function() { 'a2p_profile_bundle_sid': 'BU3344409f7e067e279523808d267e2d85', 'date_created': '2021-01-27T14:18:35Z', 'date_updated': '2021-01-27T14:18:36Z', - 'status': 'IN_PROGRESS', + 'status': 'APPROVED', 'tcr_id': 'BXXXXXX', 'failure_reason': 'Registration error', 'url': 'https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85' @@ -214,7 +214,7 @@ describe('BrandRegistration', function() { 'a2p_profile_bundle_sid': 'BU3344409f7e067e279523808d267e2d85', 'date_created': '2021-01-27T14:18:35Z', 'date_updated': '2021-01-27T14:18:36Z', - 'status': 'IN_PROGRESS', + 'status': 'APPROVED', 'tcr_id': 'BXXXXXX', 'failure_reason': 'Registration error', 'url': 'https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85' diff --git a/spec/integration/rest/verify/v2/service/entity/factor.spec.js b/spec/integration/rest/verify/v2/service/entity/factor.spec.js index 6a1ccc11e6..e3b436f4ed 100644 --- a/spec/integration/rest/verify/v2/service/entity/factor.spec.js +++ b/spec/integration/rest/verify/v2/service/entity/factor.spec.js @@ -56,7 +56,7 @@ describe('Factor', function() { })); } ); - it('should generate valid create response', + it('should generate valid create_push response', function(done) { var body = { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -159,7 +159,7 @@ describe('Factor', function() { })); } ); - it('should generate valid fetch response', + it('should generate valid fetch_push response', function(done) { var body = { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -444,7 +444,7 @@ describe('Factor', function() { })); } ); - it('should generate valid verify response', + it('should generate valid verify_push response', function(done) { var body = { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',