Skip to content

Commit

Permalink
[Librarian] Regenerated @ b99d9f1d3667442d965805ac71bf6185ee04b82c
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-ci committed Mar 18, 2020
1 parent c76264e commit 3120c68
Show file tree
Hide file tree
Showing 21 changed files with 298 additions and 1,769 deletions.
23 changes: 23 additions & 0 deletions CHANGES.md
@@ -1,6 +1,29 @@
twilio-node changelog
=====================

[2020-03-18] Version 3.41.0
---------------------------
**Library - Fix**
- [PR #546](https://github.com/twilio/twilio-node/pull/546): Page JSON parsing and integration tests. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
- [PR #545](https://github.com/twilio/twilio-node/pull/545): add overloaded TS definitions for non-required params. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
- [PR #544](https://github.com/twilio/twilio-node/pull/544): Add method overload to VoiceResponse.prototype.play. Thanks to [@DCtheTall](https://github.com/DCtheTall)!
- [PR #543](https://github.com/twilio/twilio-node/pull/543): don't re-parse parsed JSON. Thanks to [@eshanholtz](https://github.com/eshanholtz)!

**Library - Feature**
- [PR #542](https://github.com/twilio/twilio-node/pull/542): migrate from deprecated request module to axios. Thanks to [@eshanholtz](https://github.com/eshanholtz)!

**Api**
- Add optional `emergency_calling_enabled` parameter to SIP Domain
- Add optional property `call_reason` in the call create request

**Authy**
- Added `friendly_name` and `config` as optional params to Factor update
- Added `config` param to Factor creation **(breaking change)**

**Preview**
- Renamed `SuccessRate` endpoint to `ImpressionsRate` for Branded Calls (fka. Verified by Twilio) **(breaking change)**


[2020-03-04] Version 3.40.0
---------------------------
**Library - Docs**
Expand Down
2 changes: 2 additions & 0 deletions lib/rest/api/v2010/account/call.d.ts
Expand Up @@ -185,6 +185,7 @@ interface CallListInstance {
* @property asyncAmdStatusCallback - The URL we should call to send amd status information to your application
* @property asyncAmdStatusCallbackMethod - HTTP Method to use with async_amd_status_callback
* @property byoc - BYOC trunk SID (Beta)
* @property callReason - Reason for the call (Beta)
* @property callerId - The phone number, SIP address, or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`.
* @property fallbackMethod - HTTP Method to use with fallback_url
* @property fallbackUrl - Fallback URL in case of error
Expand Down Expand Up @@ -218,6 +219,7 @@ interface CallListInstanceCreateOptions {
asyncAmdStatusCallback?: string;
asyncAmdStatusCallbackMethod?: string;
byoc?: string;
callReason?: string;
callerId?: string;
fallbackMethod?: string;
fallbackUrl?: string;
Expand Down
4 changes: 3 additions & 1 deletion lib/rest/api/v2010/account/call.js
Expand Up @@ -117,6 +117,7 @@ CallList = function CallList(version, accountSid) {
* @param {string} [opts.asyncAmdStatusCallbackMethod] -
* HTTP Method to use with async_amd_status_callback
* @param {string} [opts.byoc] - BYOC trunk SID (Beta)
* @param {string} [opts.callReason] - Reason for the call (Beta)
* @param {string} [opts.url] - The absolute URL that returns TwiML for this call
* @param {string} [opts.twiml] - TwiML instructions for the call
* @param {string} [opts.applicationSid] -
Expand Down Expand Up @@ -169,7 +170,8 @@ CallList = function CallList(version, accountSid) {
'AsyncAmd': _.get(opts, 'asyncAmd'),
'AsyncAmdStatusCallback': _.get(opts, 'asyncAmdStatusCallback'),
'AsyncAmdStatusCallbackMethod': _.get(opts, 'asyncAmdStatusCallbackMethod'),
'Byoc': _.get(opts, 'byoc')
'Byoc': _.get(opts, 'byoc'),
'CallReason': _.get(opts, 'callReason')
});

var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
Expand Down
6 changes: 6 additions & 0 deletions lib/rest/api/v2010/account/sip/domain.d.ts
Expand Up @@ -29,6 +29,7 @@ declare function DomainList(version: V2010, accountSid: string): DomainListInsta
* Options to pass to update
*
* @property domainName - The unique address on Twilio to route SIP traffic
* @property emergencyCallingEnabled - Whether emergency calling is enabled for the domain.
* @property friendlyName - A string to describe the resource
* @property sipRegistration - Whether SIP registration is allowed
* @property voiceFallbackMethod - The HTTP method used with voice_fallback_url
Expand All @@ -40,6 +41,7 @@ declare function DomainList(version: V2010, accountSid: string): DomainListInsta
*/
interface DomainInstanceUpdateOptions {
domainName?: string;
emergencyCallingEnabled?: boolean;
friendlyName?: string;
sipRegistration?: boolean;
voiceFallbackMethod?: string;
Expand Down Expand Up @@ -174,6 +176,7 @@ interface DomainListInstance {
* Options to pass to create
*
* @property domainName - The unique address on Twilio to route SIP traffic
* @property emergencyCallingEnabled - Whether emergency calling is enabled for the domain.
* @property friendlyName - A string to describe the resource
* @property sipRegistration - Whether SIP registration is allowed
* @property voiceFallbackMethod - The HTTP method to use with voice_fallback_url
Expand All @@ -185,6 +188,7 @@ interface DomainListInstance {
*/
interface DomainListInstanceCreateOptions {
domainName: string;
emergencyCallingEnabled?: boolean;
friendlyName?: string;
sipRegistration?: boolean;
voiceFallbackMethod?: string;
Expand Down Expand Up @@ -262,6 +266,7 @@ interface DomainResource {
date_created: Date;
date_updated: Date;
domain_name: string;
emergency_calling_enabled: boolean;
friendly_name: string;
sid: string;
sip_registration: boolean;
Expand Down Expand Up @@ -351,6 +356,7 @@ declare class DomainInstance extends SerializableClass {
dateCreated: Date;
dateUpdated: Date;
domainName: string;
emergencyCallingEnabled: boolean;
/**
* fetch a DomainInstance
*
Expand Down
15 changes: 13 additions & 2 deletions lib/rest/api/v2010/account/sip/domain.js
Expand Up @@ -325,6 +325,8 @@ DomainList = function DomainList(version, accountSid) {
* @param {string} [opts.voiceStatusCallbackMethod] -
* The HTTP method we should use to call `voice_status_callback_url`
* @param {boolean} [opts.sipRegistration] - Whether SIP registration is allowed
* @param {boolean} [opts.emergencyCallingEnabled] -
* Whether emergency calling is enabled for the domain.
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed DomainInstance
Expand All @@ -348,7 +350,8 @@ DomainList = function DomainList(version, accountSid) {
'VoiceFallbackMethod': _.get(opts, 'voiceFallbackMethod'),
'VoiceStatusCallbackUrl': _.get(opts, 'voiceStatusCallbackUrl'),
'VoiceStatusCallbackMethod': _.get(opts, 'voiceStatusCallbackMethod'),
'SipRegistration': serialize.bool(_.get(opts, 'sipRegistration'))
'SipRegistration': serialize.bool(_.get(opts, 'sipRegistration')),
'EmergencyCallingEnabled': serialize.bool(_.get(opts, 'emergencyCallingEnabled'))
});

var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
Expand Down Expand Up @@ -508,6 +511,8 @@ DomainPage.prototype[util.inspect.custom] = function inspect(depth, options) {
* @property {string} subresourceUris -
* A list mapping resources associated with the SIP Domain resource
* @property {boolean} sipRegistration - Whether SIP registration is allowed
* @property {boolean} emergencyCallingEnabled -
* Whether emergency calling is enabled for the domain.
*
* @param {V2010} version - Version of the resource
* @param {DomainPayload} payload - The instance payload
Expand Down Expand Up @@ -537,6 +542,7 @@ DomainInstance = function DomainInstance(version, payload, accountSid, sid) {
this.voiceUrl = payload.voice_url; // jshint ignore:line
this.subresourceUris = payload.subresource_uris; // jshint ignore:line
this.sipRegistration = payload.sip_registration; // jshint ignore:line
this.emergencyCallingEnabled = payload.emergency_calling_enabled; // jshint ignore:line

// Context
this._context = undefined;
Expand Down Expand Up @@ -593,6 +599,8 @@ DomainInstance.prototype.fetch = function fetch(callback) {
* @param {boolean} [opts.sipRegistration] - Whether SIP registration is allowed
* @param {string} [opts.domainName] -
* The unique address on Twilio to route SIP traffic
* @param {boolean} [opts.emergencyCallingEnabled] -
* Whether emergency calling is enabled for the domain.
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed DomainInstance
Expand Down Expand Up @@ -779,6 +787,8 @@ DomainContext.prototype.fetch = function fetch(callback) {
* @param {boolean} [opts.sipRegistration] - Whether SIP registration is allowed
* @param {string} [opts.domainName] -
* The unique address on Twilio to route SIP traffic
* @param {boolean} [opts.emergencyCallingEnabled] -
* Whether emergency calling is enabled for the domain.
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed DomainInstance
Expand All @@ -801,7 +811,8 @@ DomainContext.prototype.update = function update(opts, callback) {
'VoiceStatusCallbackUrl': _.get(opts, 'voiceStatusCallbackUrl'),
'VoiceUrl': _.get(opts, 'voiceUrl'),
'SipRegistration': serialize.bool(_.get(opts, 'sipRegistration')),
'DomainName': _.get(opts, 'domainName')
'DomainName': _.get(opts, 'domainName'),
'EmergencyCallingEnabled': serialize.bool(_.get(opts, 'emergencyCallingEnabled'))
});

var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
Expand Down
10 changes: 10 additions & 0 deletions lib/rest/authy/v1/service/entity/factor.d.ts
Expand Up @@ -51,10 +51,14 @@ interface FactorInstanceRemoveOptions {
* Options to pass to update
*
* @property authPayload - Optional payload to verify the Factor for the first time
* @property config - The config for this Factor as a json string
* @property friendlyName - The friendly name of this Factor
* @property twilioAuthySandboxMode - The Twilio-Authy-Sandbox-Mode HTTP request header
*/
interface FactorInstanceUpdateOptions {
authPayload?: string;
config?: string;
friendlyName?: string;
twilioAuthySandboxMode?: string;
}

Expand Down Expand Up @@ -181,13 +185,17 @@ interface FactorListInstance {
/**
* Options to pass to create
*
* @property authorization - The Authorization HTTP request header
* @property binding - A unique binding for this Factor as a json string
* @property config - The config for this Factor as a json string
* @property factorType - The Type of this Factor
* @property friendlyName - The friendly name of this Factor
* @property twilioAuthySandboxMode - The Twilio-Authy-Sandbox-Mode HTTP request header
*/
interface FactorListInstanceCreateOptions {
authorization?: string;
binding: string;
config: string;
factorType: FactorFactorTypes;
friendlyName: string;
twilioAuthySandboxMode?: string;
Expand Down Expand Up @@ -261,6 +269,7 @@ interface FactorPayload extends FactorResource, Page.TwilioResponsePayload {

interface FactorResource {
account_sid: string;
config: object;
date_created: Date;
date_updated: Date;
entity_sid: string;
Expand Down Expand Up @@ -364,6 +373,7 @@ declare class FactorInstance extends SerializableClass {
* Access the challenges
*/
challenges(): ChallengeListInstance;
config: object;
dateCreated: Date;
dateUpdated: Date;
entitySid: string;
Expand Down
25 changes: 22 additions & 3 deletions lib/rest/authy/v1/service/entity/factor.js
Expand Up @@ -68,8 +68,10 @@ FactorList = function FactorList(version, serviceSid, identity) {
* @param {string} opts.binding - A unique binding for this Factor as a json string
* @param {string} opts.friendlyName - The friendly name of this Factor
* @param {factor.factor_types} opts.factorType - The Type of this Factor
* @param {string} opts.config - The config for this Factor as a json string
* @param {string} [opts.twilioAuthySandboxMode] -
* The Twilio-Authy-Sandbox-Mode HTTP request header
* @param {string} [opts.authorization] - The Authorization HTTP request header
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed FactorInstance
Expand All @@ -88,14 +90,21 @@ FactorList = function FactorList(version, serviceSid, identity) {
if (_.isUndefined(opts.factorType)) {
throw new Error('Required parameter "opts.factorType" missing.');
}
if (_.isUndefined(opts.config)) {
throw new Error('Required parameter "opts.config" missing.');
}

var deferred = Q.defer();
var data = values.of({
'Binding': _.get(opts, 'binding'),
'FriendlyName': _.get(opts, 'friendlyName'),
'FactorType': _.get(opts, 'factorType')
'FactorType': _.get(opts, 'factorType'),
'Config': _.get(opts, 'config')
});
var headers = values.of({
'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode'),
'Authorization': _.get(opts, 'authorization')
});
var headers = values.of({'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode')});

var promise = this._version.create({uri: this._uri, method: 'POST', data: data, headers: headers});

Expand Down Expand Up @@ -502,6 +511,7 @@ FactorPage.prototype[util.inspect.custom] = function inspect(depth, options) {
* @property {string} friendlyName - A human readable description of this resource.
* @property {factor.factor_statuses} status - The Status of this Factor
* @property {factor.factor_types} factorType - The Type of this Factor
* @property {object} config - The config
* @property {string} url - The URL of this resource.
* @property {string} links - Nested resource URLs.
*
Expand All @@ -527,6 +537,7 @@ FactorInstance = function FactorInstance(version, payload, serviceSid, identity,
this.friendlyName = payload.friendly_name; // jshint ignore:line
this.status = payload.status; // jshint ignore:line
this.factorType = payload.factor_type; // jshint ignore:line
this.config = payload.config; // jshint ignore:line
this.url = payload.url; // jshint ignore:line
this.links = payload.links; // jshint ignore:line

Expand Down Expand Up @@ -599,6 +610,8 @@ FactorInstance.prototype.fetch = function fetch(opts, callback) {
* @param {object} [opts] - Options for request
* @param {string} [opts.authPayload] -
* Optional payload to verify the Factor for the first time
* @param {string} [opts.friendlyName] - The friendly name of this Factor
* @param {string} [opts.config] - The config for this Factor as a json string
* @param {string} [opts.twilioAuthySandboxMode] -
* The Twilio-Authy-Sandbox-Mode HTTP request header
* @param {function} [callback] - Callback to handle processed record
Expand Down Expand Up @@ -780,6 +793,8 @@ FactorContext.prototype.fetch = function fetch(opts, callback) {
* @param {object} [opts] - Options for request
* @param {string} [opts.authPayload] -
* Optional payload to verify the Factor for the first time
* @param {string} [opts.friendlyName] - The friendly name of this Factor
* @param {string} [opts.config] - The config for this Factor as a json string
* @param {string} [opts.twilioAuthySandboxMode] -
* The Twilio-Authy-Sandbox-Mode HTTP request header
* @param {function} [callback] - Callback to handle processed record
Expand All @@ -795,7 +810,11 @@ FactorContext.prototype.update = function update(opts, callback) {
opts = opts || {};

var deferred = Q.defer();
var data = values.of({'AuthPayload': _.get(opts, 'authPayload')});
var data = values.of({
'AuthPayload': _.get(opts, 'authPayload'),
'FriendlyName': _.get(opts, 'friendlyName'),
'Config': _.get(opts, 'config')
});
var headers = values.of({'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode')});

var promise = this._version.update({uri: this._uri, method: 'POST', data: data, headers: headers});
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/preview/trusted_comms/business/insights.d.ts
Expand Up @@ -21,7 +21,7 @@ import TrustedComms = require('../../TrustedComms');
declare function InsightsList(version: TrustedComms, businessSid: string): InsightsListInstance;

interface InsightsListInstance {
successRate?: object;
impressionsRate?: object;
/**
* Provide a user-friendly representation
*/
Expand Down
15 changes: 8 additions & 7 deletions lib/rest/preview/trusted_comms/business/insights.js
Expand Up @@ -11,7 +11,8 @@

var _ = require('lodash'); /* jshint ignore:line */
var util = require('util'); /* jshint ignore:line */
var SuccessRateList = require('./insights/successRate').SuccessRateList;
var ImpressionsRateList = require(
'./insights/impressionsRate').ImpressionsRateList;

var InsightsList;

Expand Down Expand Up @@ -49,16 +50,16 @@ InsightsList = function InsightsList(version, businessSid) {
InsightsListInstance._solution = {businessSid: businessSid};

// Components
InsightsListInstance._successRate = undefined;
InsightsListInstance._impressionsRate = undefined;

Object.defineProperty(InsightsListInstance,
'successRate', {
get: function successRate() {
if (!this._successRate) {
this._successRate = new SuccessRateList(this._version, this._solution.businessSid);
'impressionsRate', {
get: function impressionsRate() {
if (!this._impressionsRate) {
this._impressionsRate = new ImpressionsRateList(this._version, this._solution.businessSid);
}

return this._successRate;
return this._impressionsRate;
}
});

Expand Down

0 comments on commit 3120c68

Please sign in to comment.