twilio 3.77.2 → 3.77.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest/Lookups.d.ts +2 -0
- package/lib/rest/Lookups.js +11 -0
- package/lib/rest/api/v2010/account/call/payment.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/payment.js +1 -1
- package/lib/rest/lookups/V2.d.ts +25 -0
- package/lib/rest/lookups/V2.js +47 -0
- package/lib/rest/lookups/v2/phoneNumber.d.ts +182 -0
- package/lib/rest/lookups/v2/phoneNumber.js +362 -0
- package/lib/rest/media/v1/mediaRecording.d.ts +2 -2
- package/lib/rest/media/v1/mediaRecording.js +2 -2
- package/lib/twiml/VoiceResponse.d.ts +79 -4
- package/lib/twiml/VoiceResponse.js +110 -3
- package/package.json +1 -1
package/lib/rest/Lookups.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import Domain = require('../base/Domain');
|
|
9
9
|
import Twilio = require('./Twilio');
|
|
10
10
|
import V1 = require('./lookups/V1');
|
|
11
|
+
import V2 = require('./lookups/V2');
|
|
11
12
|
import { PhoneNumberListInstance } from './lookups/v1/phoneNumber';
|
|
12
13
|
|
|
13
14
|
|
|
@@ -21,6 +22,7 @@ declare class Lookups extends Domain {
|
|
|
21
22
|
|
|
22
23
|
readonly phoneNumbers: PhoneNumberListInstance;
|
|
23
24
|
readonly v1: V1;
|
|
25
|
+
readonly v2: V2;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export = Lookups;
|
package/lib/rest/Lookups.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
var _ = require('lodash'); /* jshint ignore:line */
|
|
13
13
|
var Domain = require('../base/Domain'); /* jshint ignore:line */
|
|
14
14
|
var V1 = require('./lookups/V1'); /* jshint ignore:line */
|
|
15
|
+
var V2 = require('./lookups/V2'); /* jshint ignore:line */
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
/* jshint ignore:start */
|
|
@@ -21,6 +22,7 @@ var V1 = require('./lookups/V1'); /* jshint ignore:line */
|
|
|
21
22
|
* @constructor Twilio.Lookups
|
|
22
23
|
*
|
|
23
24
|
* @property {Twilio.Lookups.V1} v1 - v1 version
|
|
25
|
+
* @property {Twilio.Lookups.V2} v2 - v2 version
|
|
24
26
|
* @property {Twilio.Lookups.V1.PhoneNumberList} phoneNumbers -
|
|
25
27
|
* phoneNumbers resource
|
|
26
28
|
*
|
|
@@ -32,6 +34,7 @@ function Lookups(twilio) {
|
|
|
32
34
|
|
|
33
35
|
// Versions
|
|
34
36
|
this._v1 = undefined;
|
|
37
|
+
this._v2 = undefined;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
_.extend(Lookups.prototype, Domain.prototype);
|
|
@@ -45,6 +48,14 @@ Object.defineProperty(Lookups.prototype,
|
|
|
45
48
|
}
|
|
46
49
|
});
|
|
47
50
|
|
|
51
|
+
Object.defineProperty(Lookups.prototype,
|
|
52
|
+
'v2', {
|
|
53
|
+
get: function() {
|
|
54
|
+
this._v2 = this._v2 || new V2(this);
|
|
55
|
+
return this._v2;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
48
59
|
Object.defineProperty(Lookups.prototype,
|
|
49
60
|
'phoneNumbers', {
|
|
50
61
|
get: function() {
|
|
@@ -83,7 +83,7 @@ interface PaymentListInstance {
|
|
|
83
83
|
* @property input - A list of inputs that should be accepted. Currently only `dtmf` is supported.
|
|
84
84
|
* @property minPostalCodeLength - A positive integer that is used to validate the length of the `PostalCode` inputted by the user.
|
|
85
85
|
* @property parameter - A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments)
|
|
86
|
-
* @property paymentConnector - This is the unique name corresponding to the
|
|
86
|
+
* @property paymentConnector - This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons.
|
|
87
87
|
* @property paymentMethod - Type of payment being captured.
|
|
88
88
|
* @property postalCode - Indicates whether the credit card PostalCode (zip code) is a required piece of payment information that must be provided by the caller.
|
|
89
89
|
* @property securityCode - Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller.
|
|
@@ -85,7 +85,7 @@ PaymentList = function PaymentList(version, accountSid, callSid) {
|
|
|
85
85
|
* @param {object} [opts.parameter] -
|
|
86
86
|
* A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments)
|
|
87
87
|
* @param {string} [opts.paymentConnector] -
|
|
88
|
-
* This is the unique name corresponding to the
|
|
88
|
+
* This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons.
|
|
89
89
|
* @param {payment.payment_method} [opts.paymentMethod] -
|
|
90
90
|
* Type of payment being captured.
|
|
91
91
|
* @param {boolean} [opts.postalCode] -
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Lookups = require('../Lookups');
|
|
9
|
+
import Version = require('../../base/Version');
|
|
10
|
+
import { PhoneNumberList } from './v2/phoneNumber';
|
|
11
|
+
import { PhoneNumberListInstance } from './v2/phoneNumber';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
declare class V2 extends Version {
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the V2 version of Lookups
|
|
17
|
+
*
|
|
18
|
+
* @param domain - The twilio domain
|
|
19
|
+
*/
|
|
20
|
+
constructor(domain: Lookups);
|
|
21
|
+
|
|
22
|
+
readonly phoneNumbers: PhoneNumberListInstance;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export = V2;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* jshint ignore:start */
|
|
4
|
+
/**
|
|
5
|
+
* This code was generated by
|
|
6
|
+
* \ / _ _ _| _ _
|
|
7
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
8
|
+
* / /
|
|
9
|
+
*/
|
|
10
|
+
/* jshint ignore:end */
|
|
11
|
+
|
|
12
|
+
var _ = require('lodash'); /* jshint ignore:line */
|
|
13
|
+
var PhoneNumberList = require('./v2/phoneNumber').PhoneNumberList;
|
|
14
|
+
var Version = require('../../base/Version'); /* jshint ignore:line */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/* jshint ignore:start */
|
|
18
|
+
/**
|
|
19
|
+
* Initialize the V2 version of Lookups
|
|
20
|
+
*
|
|
21
|
+
* @constructor Twilio.Lookups.V2
|
|
22
|
+
*
|
|
23
|
+
* @property {Twilio.Lookups.V2.PhoneNumberList} phoneNumbers -
|
|
24
|
+
* phoneNumbers resource
|
|
25
|
+
*
|
|
26
|
+
* @param {Twilio.Lookups} domain - The twilio domain
|
|
27
|
+
*/
|
|
28
|
+
/* jshint ignore:end */
|
|
29
|
+
function V2(domain) {
|
|
30
|
+
Version.prototype.constructor.call(this, domain, 'v2');
|
|
31
|
+
|
|
32
|
+
// Resources
|
|
33
|
+
this._phoneNumbers = undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_.extend(V2.prototype, Version.prototype);
|
|
37
|
+
V2.prototype.constructor = V2;
|
|
38
|
+
|
|
39
|
+
Object.defineProperty(V2.prototype,
|
|
40
|
+
'phoneNumbers', {
|
|
41
|
+
get: function() {
|
|
42
|
+
this._phoneNumbers = this._phoneNumbers || new PhoneNumberList(this);
|
|
43
|
+
return this._phoneNumbers;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
module.exports = V2;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Page = require('../../../base/Page');
|
|
9
|
+
import Response = require('../../../http/response');
|
|
10
|
+
import V2 = require('../V2');
|
|
11
|
+
import { SerializableClass } from '../../../interfaces';
|
|
12
|
+
|
|
13
|
+
type PhoneNumberType = 'landline'|'mobile'|'voip';
|
|
14
|
+
|
|
15
|
+
type PhoneNumberValidationError = 'TOO_SHORT'|'TOO_LONG'|'INVALID_BUT_POSSIBLE'|'INVALID_COUNTRY_CODE'|'INVALID_LENGTH'|'NOT_A_NUMBER';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the PhoneNumberList
|
|
19
|
+
*
|
|
20
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
21
|
+
* Use them with caution.
|
|
22
|
+
*
|
|
23
|
+
* @param version - Version of the resource
|
|
24
|
+
*/
|
|
25
|
+
declare function PhoneNumberList(version: V2): PhoneNumberListInstance;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Options to pass to fetch
|
|
29
|
+
*
|
|
30
|
+
* @property countryCode - Country code for national phone number lookups
|
|
31
|
+
* @property fields - Fields to return
|
|
32
|
+
*/
|
|
33
|
+
interface PhoneNumberInstanceFetchOptions {
|
|
34
|
+
countryCode?: string;
|
|
35
|
+
fields?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface PhoneNumberListInstance {
|
|
39
|
+
/**
|
|
40
|
+
* @param sid - sid of instance
|
|
41
|
+
*/
|
|
42
|
+
(sid: string): PhoneNumberContext;
|
|
43
|
+
/**
|
|
44
|
+
* Constructs a phone_number
|
|
45
|
+
*
|
|
46
|
+
* @param phoneNumber - Phone number to lookup
|
|
47
|
+
*/
|
|
48
|
+
get(phoneNumber: string): PhoneNumberContext;
|
|
49
|
+
/**
|
|
50
|
+
* Provide a user-friendly representation
|
|
51
|
+
*/
|
|
52
|
+
toJSON(): any;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface PhoneNumberPayload extends PhoneNumberResource, Page.TwilioResponsePayload {
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface PhoneNumberResource {
|
|
59
|
+
call_forwarding: object;
|
|
60
|
+
caller_name: object;
|
|
61
|
+
calling_country_code: string;
|
|
62
|
+
country_code: string;
|
|
63
|
+
enhanced_line_type: object;
|
|
64
|
+
line_type_intelligence: object;
|
|
65
|
+
live_activity: object;
|
|
66
|
+
national_format: string;
|
|
67
|
+
phone_number: string;
|
|
68
|
+
sim_swap: object;
|
|
69
|
+
url: string;
|
|
70
|
+
valid: boolean;
|
|
71
|
+
validation_errors: PhoneNumberValidationError[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface PhoneNumberSolution {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
declare class PhoneNumberContext {
|
|
79
|
+
/**
|
|
80
|
+
* Initialize the PhoneNumberContext
|
|
81
|
+
*
|
|
82
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
83
|
+
* Use them with caution.
|
|
84
|
+
*
|
|
85
|
+
* @param version - Version of the resource
|
|
86
|
+
* @param phoneNumber - Phone number to lookup
|
|
87
|
+
*/
|
|
88
|
+
constructor(version: V2, phoneNumber: string);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* fetch a PhoneNumberInstance
|
|
92
|
+
*
|
|
93
|
+
* @param callback - Callback to handle processed record
|
|
94
|
+
*/
|
|
95
|
+
fetch(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
96
|
+
/**
|
|
97
|
+
* fetch a PhoneNumberInstance
|
|
98
|
+
*
|
|
99
|
+
* @param opts - Options for request
|
|
100
|
+
* @param callback - Callback to handle processed record
|
|
101
|
+
*/
|
|
102
|
+
fetch(opts?: PhoneNumberInstanceFetchOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
103
|
+
/**
|
|
104
|
+
* Provide a user-friendly representation
|
|
105
|
+
*/
|
|
106
|
+
toJSON(): any;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
declare class PhoneNumberInstance extends SerializableClass {
|
|
111
|
+
/**
|
|
112
|
+
* Initialize the PhoneNumberContext
|
|
113
|
+
*
|
|
114
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
115
|
+
* Use them with caution.
|
|
116
|
+
*
|
|
117
|
+
* @param version - Version of the resource
|
|
118
|
+
* @param payload - The instance payload
|
|
119
|
+
* @param phoneNumber - Phone number to lookup
|
|
120
|
+
*/
|
|
121
|
+
constructor(version: V2, payload: PhoneNumberPayload, phoneNumber: string);
|
|
122
|
+
|
|
123
|
+
private _proxy: PhoneNumberContext;
|
|
124
|
+
callForwarding: any;
|
|
125
|
+
callerName: any;
|
|
126
|
+
callingCountryCode: string;
|
|
127
|
+
countryCode: string;
|
|
128
|
+
enhancedLineType: any;
|
|
129
|
+
/**
|
|
130
|
+
* fetch a PhoneNumberInstance
|
|
131
|
+
*
|
|
132
|
+
* @param callback - Callback to handle processed record
|
|
133
|
+
*/
|
|
134
|
+
fetch(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
135
|
+
/**
|
|
136
|
+
* fetch a PhoneNumberInstance
|
|
137
|
+
*
|
|
138
|
+
* @param opts - Options for request
|
|
139
|
+
* @param callback - Callback to handle processed record
|
|
140
|
+
*/
|
|
141
|
+
fetch(opts?: PhoneNumberInstanceFetchOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
142
|
+
lineTypeIntelligence: any;
|
|
143
|
+
liveActivity: any;
|
|
144
|
+
nationalFormat: string;
|
|
145
|
+
phoneNumber: string;
|
|
146
|
+
simSwap: any;
|
|
147
|
+
/**
|
|
148
|
+
* Provide a user-friendly representation
|
|
149
|
+
*/
|
|
150
|
+
toJSON(): any;
|
|
151
|
+
url: string;
|
|
152
|
+
valid: boolean;
|
|
153
|
+
validationErrors: PhoneNumberValidationError[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
declare class PhoneNumberPage extends Page<V2, PhoneNumberPayload, PhoneNumberResource, PhoneNumberInstance> {
|
|
158
|
+
/**
|
|
159
|
+
* Initialize the PhoneNumberPage
|
|
160
|
+
*
|
|
161
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
162
|
+
* Use them with caution.
|
|
163
|
+
*
|
|
164
|
+
* @param version - Version of the resource
|
|
165
|
+
* @param response - Response from the API
|
|
166
|
+
* @param solution - Path solution
|
|
167
|
+
*/
|
|
168
|
+
constructor(version: V2, response: Response<string>, solution: PhoneNumberSolution);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Build an instance of PhoneNumberInstance
|
|
172
|
+
*
|
|
173
|
+
* @param payload - Payload response from the API
|
|
174
|
+
*/
|
|
175
|
+
getInstance(payload: PhoneNumberPayload): PhoneNumberInstance;
|
|
176
|
+
/**
|
|
177
|
+
* Provide a user-friendly representation
|
|
178
|
+
*/
|
|
179
|
+
toJSON(): any;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { PhoneNumberContext, PhoneNumberInstance, PhoneNumberInstanceFetchOptions, PhoneNumberList, PhoneNumberListInstance, PhoneNumberPage, PhoneNumberPayload, PhoneNumberResource, PhoneNumberSolution, PhoneNumberType, PhoneNumberValidationError }
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* jshint ignore:start */
|
|
4
|
+
/**
|
|
5
|
+
* This code was generated by
|
|
6
|
+
* \ / _ _ _| _ _
|
|
7
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
8
|
+
* / /
|
|
9
|
+
*/
|
|
10
|
+
/* jshint ignore:end */
|
|
11
|
+
|
|
12
|
+
var Q = require('q'); /* jshint ignore:line */
|
|
13
|
+
var _ = require('lodash'); /* jshint ignore:line */
|
|
14
|
+
var util = require('util'); /* jshint ignore:line */
|
|
15
|
+
var Page = require('../../../base/Page'); /* jshint ignore:line */
|
|
16
|
+
var values = require('../../../base/values'); /* jshint ignore:line */
|
|
17
|
+
|
|
18
|
+
var PhoneNumberList;
|
|
19
|
+
var PhoneNumberPage;
|
|
20
|
+
var PhoneNumberInstance;
|
|
21
|
+
var PhoneNumberContext;
|
|
22
|
+
|
|
23
|
+
/* jshint ignore:start */
|
|
24
|
+
/**
|
|
25
|
+
* Initialize the PhoneNumberList
|
|
26
|
+
*
|
|
27
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
28
|
+
* Use them with caution.
|
|
29
|
+
*
|
|
30
|
+
* @constructor Twilio.Lookups.V2.PhoneNumberList
|
|
31
|
+
*
|
|
32
|
+
* @param {Twilio.Lookups.V2} version - Version of the resource
|
|
33
|
+
*/
|
|
34
|
+
/* jshint ignore:end */
|
|
35
|
+
PhoneNumberList = function PhoneNumberList(version) {
|
|
36
|
+
/* jshint ignore:start */
|
|
37
|
+
/**
|
|
38
|
+
* @function phoneNumbers
|
|
39
|
+
* @memberof Twilio.Lookups.V2#
|
|
40
|
+
*
|
|
41
|
+
* @param {string} sid - sid of instance
|
|
42
|
+
*
|
|
43
|
+
* @returns {Twilio.Lookups.V2.PhoneNumberContext}
|
|
44
|
+
*/
|
|
45
|
+
/* jshint ignore:end */
|
|
46
|
+
function PhoneNumberListInstance(sid) {
|
|
47
|
+
return PhoneNumberListInstance.get(sid);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
PhoneNumberListInstance._version = version;
|
|
51
|
+
// Path Solution
|
|
52
|
+
PhoneNumberListInstance._solution = {};
|
|
53
|
+
/* jshint ignore:start */
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a phone_number
|
|
56
|
+
*
|
|
57
|
+
* @function get
|
|
58
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberList#
|
|
59
|
+
*
|
|
60
|
+
* @param {string} phoneNumber - Phone number to lookup
|
|
61
|
+
*
|
|
62
|
+
* @returns {Twilio.Lookups.V2.PhoneNumberContext}
|
|
63
|
+
*/
|
|
64
|
+
/* jshint ignore:end */
|
|
65
|
+
PhoneNumberListInstance.get = function get(phoneNumber) {
|
|
66
|
+
return new PhoneNumberContext(this._version, phoneNumber);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/* jshint ignore:start */
|
|
70
|
+
/**
|
|
71
|
+
* Provide a user-friendly representation
|
|
72
|
+
*
|
|
73
|
+
* @function toJSON
|
|
74
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberList#
|
|
75
|
+
*
|
|
76
|
+
* @returns Object
|
|
77
|
+
*/
|
|
78
|
+
/* jshint ignore:end */
|
|
79
|
+
PhoneNumberListInstance.toJSON = function toJSON() {
|
|
80
|
+
return this._solution;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
PhoneNumberListInstance[util.inspect.custom] = function inspect(depth, options)
|
|
84
|
+
{
|
|
85
|
+
return util.inspect(this.toJSON(), options);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return PhoneNumberListInstance;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
/* jshint ignore:start */
|
|
93
|
+
/**
|
|
94
|
+
* Initialize the PhoneNumberPage
|
|
95
|
+
*
|
|
96
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
97
|
+
* Use them with caution.
|
|
98
|
+
*
|
|
99
|
+
* @constructor Twilio.Lookups.V2.PhoneNumberPage
|
|
100
|
+
*
|
|
101
|
+
* @param {V2} version - Version of the resource
|
|
102
|
+
* @param {Response<string>} response - Response from the API
|
|
103
|
+
* @param {PhoneNumberSolution} solution - Path solution
|
|
104
|
+
*
|
|
105
|
+
* @returns PhoneNumberPage
|
|
106
|
+
*/
|
|
107
|
+
/* jshint ignore:end */
|
|
108
|
+
PhoneNumberPage = function PhoneNumberPage(version, response, solution) {
|
|
109
|
+
// Path Solution
|
|
110
|
+
this._solution = solution;
|
|
111
|
+
|
|
112
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
_.extend(PhoneNumberPage.prototype, Page.prototype);
|
|
116
|
+
PhoneNumberPage.prototype.constructor = PhoneNumberPage;
|
|
117
|
+
|
|
118
|
+
/* jshint ignore:start */
|
|
119
|
+
/**
|
|
120
|
+
* Build an instance of PhoneNumberInstance
|
|
121
|
+
*
|
|
122
|
+
* @function getInstance
|
|
123
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberPage#
|
|
124
|
+
*
|
|
125
|
+
* @param {PhoneNumberPayload} payload - Payload response from the API
|
|
126
|
+
*
|
|
127
|
+
* @returns PhoneNumberInstance
|
|
128
|
+
*/
|
|
129
|
+
/* jshint ignore:end */
|
|
130
|
+
PhoneNumberPage.prototype.getInstance = function getInstance(payload) {
|
|
131
|
+
return new PhoneNumberInstance(this._version, payload);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/* jshint ignore:start */
|
|
135
|
+
/**
|
|
136
|
+
* Provide a user-friendly representation
|
|
137
|
+
*
|
|
138
|
+
* @function toJSON
|
|
139
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberPage#
|
|
140
|
+
*
|
|
141
|
+
* @returns Object
|
|
142
|
+
*/
|
|
143
|
+
/* jshint ignore:end */
|
|
144
|
+
PhoneNumberPage.prototype.toJSON = function toJSON() {
|
|
145
|
+
let clone = {};
|
|
146
|
+
_.forOwn(this, function(value, key) {
|
|
147
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
148
|
+
clone[key] = value;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return clone;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
PhoneNumberPage.prototype[util.inspect.custom] = function inspect(depth,
|
|
155
|
+
options) {
|
|
156
|
+
return util.inspect(this.toJSON(), options);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/* jshint ignore:start */
|
|
161
|
+
/**
|
|
162
|
+
* Initialize the PhoneNumberContext
|
|
163
|
+
*
|
|
164
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
165
|
+
* Use them with caution.
|
|
166
|
+
*
|
|
167
|
+
* @constructor Twilio.Lookups.V2.PhoneNumberInstance
|
|
168
|
+
*
|
|
169
|
+
* @property {string} callingCountryCode - International dialing prefix
|
|
170
|
+
* @property {string} countryCode - Phone number's ISO country code
|
|
171
|
+
* @property {string} phoneNumber - Phone number in E.164 format
|
|
172
|
+
* @property {string} nationalFormat - Phone number in national format
|
|
173
|
+
* @property {boolean} valid - Boolean which indicates if the phone number is valid
|
|
174
|
+
* @property {phone_number.validation_error} validationErrors -
|
|
175
|
+
* Contains reasons why a phone number is invalid
|
|
176
|
+
* @property {object} callerName - An object that contains caller name information
|
|
177
|
+
* @property {object} simSwap - An object that contains SIM swap information
|
|
178
|
+
* @property {object} callForwarding -
|
|
179
|
+
* An object that contains call forwarding status information
|
|
180
|
+
* @property {object} liveActivity -
|
|
181
|
+
* An object that contains live activity information
|
|
182
|
+
* @property {object} enhancedLineType -
|
|
183
|
+
* An object that contains line type information
|
|
184
|
+
* @property {object} lineTypeIntelligence -
|
|
185
|
+
* An object that contains line type information
|
|
186
|
+
* @property {string} url - The absolute URL of the resource
|
|
187
|
+
*
|
|
188
|
+
* @param {V2} version - Version of the resource
|
|
189
|
+
* @param {PhoneNumberPayload} payload - The instance payload
|
|
190
|
+
* @param {string} phoneNumber - Phone number to lookup
|
|
191
|
+
*/
|
|
192
|
+
/* jshint ignore:end */
|
|
193
|
+
PhoneNumberInstance = function PhoneNumberInstance(version, payload,
|
|
194
|
+
phoneNumber) {
|
|
195
|
+
this._version = version;
|
|
196
|
+
|
|
197
|
+
// Marshaled Properties
|
|
198
|
+
this.callingCountryCode = payload.calling_country_code; // jshint ignore:line
|
|
199
|
+
this.countryCode = payload.country_code; // jshint ignore:line
|
|
200
|
+
this.phoneNumber = payload.phone_number; // jshint ignore:line
|
|
201
|
+
this.nationalFormat = payload.national_format; // jshint ignore:line
|
|
202
|
+
this.valid = payload.valid; // jshint ignore:line
|
|
203
|
+
this.validationErrors = payload.validation_errors; // jshint ignore:line
|
|
204
|
+
this.callerName = payload.caller_name; // jshint ignore:line
|
|
205
|
+
this.simSwap = payload.sim_swap; // jshint ignore:line
|
|
206
|
+
this.callForwarding = payload.call_forwarding; // jshint ignore:line
|
|
207
|
+
this.liveActivity = payload.live_activity; // jshint ignore:line
|
|
208
|
+
this.enhancedLineType = payload.enhanced_line_type; // jshint ignore:line
|
|
209
|
+
this.lineTypeIntelligence = payload.line_type_intelligence; // jshint ignore:line
|
|
210
|
+
this.url = payload.url; // jshint ignore:line
|
|
211
|
+
|
|
212
|
+
// Context
|
|
213
|
+
this._context = undefined;
|
|
214
|
+
this._solution = {phoneNumber: phoneNumber || this.phoneNumber, };
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
Object.defineProperty(PhoneNumberInstance.prototype,
|
|
218
|
+
'_proxy', {
|
|
219
|
+
get: function() {
|
|
220
|
+
if (!this._context) {
|
|
221
|
+
this._context = new PhoneNumberContext(this._version, this._solution.phoneNumber);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return this._context;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
/* jshint ignore:start */
|
|
229
|
+
/**
|
|
230
|
+
* fetch a PhoneNumberInstance
|
|
231
|
+
*
|
|
232
|
+
* @function fetch
|
|
233
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberInstance#
|
|
234
|
+
*
|
|
235
|
+
* @param {object} [opts] - Options for request
|
|
236
|
+
* @param {string} [opts.fields] - Fields to return
|
|
237
|
+
* @param {string} [opts.countryCode] -
|
|
238
|
+
* Country code for national phone number lookups
|
|
239
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
240
|
+
*
|
|
241
|
+
* @returns {Promise} Resolves to processed PhoneNumberInstance
|
|
242
|
+
*/
|
|
243
|
+
/* jshint ignore:end */
|
|
244
|
+
PhoneNumberInstance.prototype.fetch = function fetch(opts, callback) {
|
|
245
|
+
return this._proxy.fetch(opts, callback);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/* jshint ignore:start */
|
|
249
|
+
/**
|
|
250
|
+
* Provide a user-friendly representation
|
|
251
|
+
*
|
|
252
|
+
* @function toJSON
|
|
253
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberInstance#
|
|
254
|
+
*
|
|
255
|
+
* @returns Object
|
|
256
|
+
*/
|
|
257
|
+
/* jshint ignore:end */
|
|
258
|
+
PhoneNumberInstance.prototype.toJSON = function toJSON() {
|
|
259
|
+
let clone = {};
|
|
260
|
+
_.forOwn(this, function(value, key) {
|
|
261
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
262
|
+
clone[key] = value;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
return clone;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
PhoneNumberInstance.prototype[util.inspect.custom] = function inspect(depth,
|
|
269
|
+
options) {
|
|
270
|
+
return util.inspect(this.toJSON(), options);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
/* jshint ignore:start */
|
|
275
|
+
/**
|
|
276
|
+
* Initialize the PhoneNumberContext
|
|
277
|
+
*
|
|
278
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
279
|
+
* Use them with caution.
|
|
280
|
+
*
|
|
281
|
+
* @constructor Twilio.Lookups.V2.PhoneNumberContext
|
|
282
|
+
*
|
|
283
|
+
* @param {V2} version - Version of the resource
|
|
284
|
+
* @param {string} phoneNumber - Phone number to lookup
|
|
285
|
+
*/
|
|
286
|
+
/* jshint ignore:end */
|
|
287
|
+
PhoneNumberContext = function PhoneNumberContext(version, phoneNumber) {
|
|
288
|
+
this._version = version;
|
|
289
|
+
|
|
290
|
+
// Path Solution
|
|
291
|
+
this._solution = {phoneNumber: phoneNumber, };
|
|
292
|
+
this._uri = `/PhoneNumbers/${phoneNumber}`;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/* jshint ignore:start */
|
|
296
|
+
/**
|
|
297
|
+
* fetch a PhoneNumberInstance
|
|
298
|
+
*
|
|
299
|
+
* @function fetch
|
|
300
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberContext#
|
|
301
|
+
*
|
|
302
|
+
* @param {object} [opts] - Options for request
|
|
303
|
+
* @param {string} [opts.fields] - Fields to return
|
|
304
|
+
* @param {string} [opts.countryCode] -
|
|
305
|
+
* Country code for national phone number lookups
|
|
306
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
307
|
+
*
|
|
308
|
+
* @returns {Promise} Resolves to processed PhoneNumberInstance
|
|
309
|
+
*/
|
|
310
|
+
/* jshint ignore:end */
|
|
311
|
+
PhoneNumberContext.prototype.fetch = function fetch(opts, callback) {
|
|
312
|
+
if (_.isFunction(opts)) {
|
|
313
|
+
callback = opts;
|
|
314
|
+
opts = {};
|
|
315
|
+
}
|
|
316
|
+
opts = opts || {};
|
|
317
|
+
|
|
318
|
+
var deferred = Q.defer();
|
|
319
|
+
var data = values.of({'Fields': _.get(opts, 'fields'), 'CountryCode': _.get(opts, 'countryCode')});
|
|
320
|
+
|
|
321
|
+
var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data});
|
|
322
|
+
|
|
323
|
+
promise = promise.then(function(payload) {
|
|
324
|
+
deferred.resolve(new PhoneNumberInstance(this._version, payload, this._solution.phoneNumber));
|
|
325
|
+
}.bind(this));
|
|
326
|
+
|
|
327
|
+
promise.catch(function(error) {
|
|
328
|
+
deferred.reject(error);
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
if (_.isFunction(callback)) {
|
|
332
|
+
deferred.promise.nodeify(callback);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return deferred.promise;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/* jshint ignore:start */
|
|
339
|
+
/**
|
|
340
|
+
* Provide a user-friendly representation
|
|
341
|
+
*
|
|
342
|
+
* @function toJSON
|
|
343
|
+
* @memberof Twilio.Lookups.V2.PhoneNumberContext#
|
|
344
|
+
*
|
|
345
|
+
* @returns Object
|
|
346
|
+
*/
|
|
347
|
+
/* jshint ignore:end */
|
|
348
|
+
PhoneNumberContext.prototype.toJSON = function toJSON() {
|
|
349
|
+
return this._solution;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
PhoneNumberContext.prototype[util.inspect.custom] = function inspect(depth,
|
|
353
|
+
options) {
|
|
354
|
+
return util.inspect(this.toJSON(), options);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
module.exports = {
|
|
358
|
+
PhoneNumberList: PhoneNumberList,
|
|
359
|
+
PhoneNumberPage: PhoneNumberPage,
|
|
360
|
+
PhoneNumberInstance: PhoneNumberInstance,
|
|
361
|
+
PhoneNumberContext: PhoneNumberContext
|
|
362
|
+
};
|
|
@@ -232,10 +232,10 @@ interface MediaRecordingResource {
|
|
|
232
232
|
duration: number;
|
|
233
233
|
format: MediaRecordingFormat;
|
|
234
234
|
links: string;
|
|
235
|
+
media_size: number;
|
|
235
236
|
processor_sid: string;
|
|
236
237
|
resolution: string;
|
|
237
238
|
sid: string;
|
|
238
|
-
size: number;
|
|
239
239
|
source_sid: string;
|
|
240
240
|
status: MediaRecordingStatus;
|
|
241
241
|
status_callback: string;
|
|
@@ -307,6 +307,7 @@ declare class MediaRecordingInstance extends SerializableClass {
|
|
|
307
307
|
fetch(callback?: (error: Error | null, items: MediaRecordingInstance) => any): Promise<MediaRecordingInstance>;
|
|
308
308
|
format: MediaRecordingFormat;
|
|
309
309
|
links: string;
|
|
310
|
+
mediaSize: number;
|
|
310
311
|
processorSid: string;
|
|
311
312
|
/**
|
|
312
313
|
* remove a MediaRecordingInstance
|
|
@@ -316,7 +317,6 @@ declare class MediaRecordingInstance extends SerializableClass {
|
|
|
316
317
|
remove(callback?: (error: Error | null, items: MediaRecordingInstance) => any): Promise<boolean>;
|
|
317
318
|
resolution: string;
|
|
318
319
|
sid: string;
|
|
319
|
-
size: number;
|
|
320
320
|
sourceSid: string;
|
|
321
321
|
status: MediaRecordingStatus;
|
|
322
322
|
statusCallback: string;
|
|
@@ -446,7 +446,7 @@ MediaRecordingPage.prototype[util.inspect.custom] = function inspect(depth,
|
|
|
446
446
|
* @property {string} sourceSid -
|
|
447
447
|
* The SID of the resource that generated the original media
|
|
448
448
|
* @property {string} sid - The unique string that identifies the resource
|
|
449
|
-
* @property {number}
|
|
449
|
+
* @property {number} mediaSize - The size of the recording media
|
|
450
450
|
* @property {media_recording.status} status - The status of the MediaRecording
|
|
451
451
|
* @property {string} statusCallback -
|
|
452
452
|
* The URL to which Twilio will send MediaRecording event updates
|
|
@@ -475,7 +475,7 @@ MediaRecordingInstance = function MediaRecordingInstance(version, payload, sid)
|
|
|
475
475
|
this.resolution = payload.resolution; // jshint ignore:line
|
|
476
476
|
this.sourceSid = payload.source_sid; // jshint ignore:line
|
|
477
477
|
this.sid = payload.sid; // jshint ignore:line
|
|
478
|
-
this.
|
|
478
|
+
this.mediaSize = deserialize.integer(payload.media_size); // jshint ignore:line
|
|
479
479
|
this.status = payload.status; // jshint ignore:line
|
|
480
480
|
this.statusCallback = payload.status_callback; // jshint ignore:line
|
|
481
481
|
this.statusCallbackMethod = payload.status_callback_method; // jshint ignore:line
|
|
@@ -205,6 +205,14 @@ declare namespace VoiceResponse {
|
|
|
205
205
|
|
|
206
206
|
type ConferenceTrim = 'trim-silence'|'do-not-trim';
|
|
207
207
|
|
|
208
|
+
type ConversationEvent = 'call-initiated'|'call-ringing'|'call-in-progress'|'call-completed';
|
|
209
|
+
|
|
210
|
+
type ConversationRecord = 'do-not-record'|'record-from-answer'|'record-from-ringing'|'record-from-answer-dual'|'record-from-ringing-dual'|'true'|'false';
|
|
211
|
+
|
|
212
|
+
type ConversationRecordingEvent = 'in-progress'|'completed'|'absent';
|
|
213
|
+
|
|
214
|
+
type ConversationTrim = 'trim-silence'|'do-not-trim';
|
|
215
|
+
|
|
208
216
|
type DialRecord = 'do-not-record'|'record-from-answer'|'record-from-ringing'|'record-from-answer-dual'|'record-from-ringing-dual';
|
|
209
217
|
|
|
210
218
|
type DialRecordingEvent = 'in-progress'|'completed'|'absent';
|
|
@@ -249,9 +257,9 @@ declare namespace VoiceResponse {
|
|
|
249
257
|
|
|
250
258
|
type RejectReason = 'rejected'|'busy';
|
|
251
259
|
|
|
252
|
-
type SayLanguage = 'arb'|'ca-ES'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-CA'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-NZ'|'en-ZA'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fi-FI'|'fr-CA'|'fr-FR'|'hi-IN'|'is-IS'|'it-IT'|'ja-JP'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'|'zh-CN'|'zh-HK'|'zh-TW';
|
|
260
|
+
type SayLanguage = 'arb'|'ca-ES'|'cy-GB'|'da-DK'|'de-DE'|'de-AT'|'en-AU'|'en-CA'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-NZ'|'en-ZA'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fi-FI'|'fr-CA'|'fr-FR'|'hi-IN'|'is-IS'|'it-IT'|'ja-JP'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'|'zh-CN'|'zh-HK'|'zh-TW';
|
|
253
261
|
|
|
254
|
-
type SayVoice = 'man'|'woman'|'alice'|'Polly.Aditi'|'Polly.Amy'|'Polly.Astrid'|'Polly.Bianca'|'Polly.Brian'|'Polly.Camila'|'Polly.Carla'|'Polly.Carmen'|'Polly.Celine'|'Polly.Chantal'|'Polly.Conchita'|'Polly.Cristiano'|'Polly.Dora'|'Polly.Emma'|'Polly.Enrique'|'Polly.Ewa'|'Polly.Filiz'|'Polly.Geraint'|'Polly.Giorgio'|'Polly.Gwyneth'|'Polly.Hans'|'Polly.Ines'|'Polly.Ivy'|'Polly.Jacek'|'Polly.Jan'|'Polly.Joanna'|'Polly.Joey'|'Polly.Justin'|'Polly.Karl'|'Polly.Kendra'|'Polly.Kimberly'|'Polly.Lea'|'Polly.Liv'|'Polly.Lotte'|'Polly.Lucia'|'Polly.Lupe'|'Polly.Mads'|'Polly.Maja'|'Polly.Marlene'|'Polly.Mathieu'|'Polly.Matthew'|'Polly.Maxim'|'Polly.Mia'|'Polly.Miguel'|'Polly.Mizuki'|'Polly.Naja'|'Polly.Nicole'|'Polly.Penelope'|'Polly.Raveena'|'Polly.Ricardo'|'Polly.Ruben'|'Polly.Russell'|'Polly.Salli'|'Polly.Seoyeon'|'Polly.Takumi'|'Polly.Tatyana'|'Polly.Vicki'|'Polly.Vitoria'|'Polly.Zeina'|'Polly.Zhiyu'|'Polly.Amy-Neural'|'Polly.Emma-Neural'|'Polly.Brian-Neural'|'Polly.Salli-Neural'|'Polly.Ivy-Neural'|'Polly.Joanna-Neural'|'Polly.Kendra-Neural'|'Polly.Kimberly-Neural'|'Polly.Joey-Neural'|'Polly.Justin-Neural'|'Polly.Matthew-Neural'|'Polly.Camila-Neural'|'Polly.Lupe-Neural'|'Polly.Olivia-Neural'|'Polly.Kevin-Neural'|'Polly.Aria-Neural'|'Polly.Ayanda-Neural'|'Polly.Gabrielle-Neural'|'Polly.Lea-Neural'|'Polly.Vicki-Neural'|'Polly.Bianca-Neural'|'Polly.Takumi-Neural'|'Polly.Seoyeon-Neural'|'Polly.Lucia-Neural';
|
|
262
|
+
type SayVoice = 'man'|'woman'|'alice'|'Polly.Aditi'|'Polly.Amy'|'Polly.Astrid'|'Polly.Bianca'|'Polly.Brian'|'Polly.Camila'|'Polly.Carla'|'Polly.Carmen'|'Polly.Celine'|'Polly.Chantal'|'Polly.Conchita'|'Polly.Cristiano'|'Polly.Dora'|'Polly.Emma'|'Polly.Enrique'|'Polly.Ewa'|'Polly.Filiz'|'Polly.Geraint'|'Polly.Giorgio'|'Polly.Gwyneth'|'Polly.Hans'|'Polly.Ines'|'Polly.Ivy'|'Polly.Jacek'|'Polly.Jan'|'Polly.Joanna'|'Polly.Joey'|'Polly.Justin'|'Polly.Karl'|'Polly.Kendra'|'Polly.Kimberly'|'Polly.Lea'|'Polly.Liv'|'Polly.Lotte'|'Polly.Lucia'|'Polly.Lupe'|'Polly.Mads'|'Polly.Maja'|'Polly.Marlene'|'Polly.Mathieu'|'Polly.Matthew'|'Polly.Maxim'|'Polly.Mia'|'Polly.Miguel'|'Polly.Mizuki'|'Polly.Naja'|'Polly.Nicole'|'Polly.Penelope'|'Polly.Raveena'|'Polly.Ricardo'|'Polly.Ruben'|'Polly.Russell'|'Polly.Salli'|'Polly.Seoyeon'|'Polly.Takumi'|'Polly.Tatyana'|'Polly.Vicki'|'Polly.Vitoria'|'Polly.Zeina'|'Polly.Zhiyu'|'Polly.Amy-Neural'|'Polly.Emma-Neural'|'Polly.Brian-Neural'|'Polly.Salli-Neural'|'Polly.Ivy-Neural'|'Polly.Joanna-Neural'|'Polly.Kendra-Neural'|'Polly.Kimberly-Neural'|'Polly.Joey-Neural'|'Polly.Justin-Neural'|'Polly.Matthew-Neural'|'Polly.Camila-Neural'|'Polly.Lupe-Neural'|'Polly.Olivia-Neural'|'Polly.Kevin-Neural'|'Polly.Aria-Neural'|'Polly.Ayanda-Neural'|'Polly.Gabrielle-Neural'|'Polly.Lea-Neural'|'Polly.Vicki-Neural'|'Polly.Bianca-Neural'|'Polly.Takumi-Neural'|'Polly.Seoyeon-Neural'|'Polly.Lucia-Neural'|'Polly.Arlet-Neural'|'Polly.Hannah-Neural'|'Polly.Mia-Neural'|'Polly.Vitoria-Neural'|'Polly.Ines-Neural';
|
|
255
263
|
|
|
256
264
|
type SipEvent = 'initiated'|'ringing'|'answered'|'completed';
|
|
257
265
|
|
|
@@ -337,6 +345,17 @@ declare namespace VoiceResponse {
|
|
|
337
345
|
waitUrl?: string;
|
|
338
346
|
}
|
|
339
347
|
|
|
348
|
+
/**
|
|
349
|
+
* Options to pass to config
|
|
350
|
+
*
|
|
351
|
+
* @property name - The name of the custom config
|
|
352
|
+
* @property value - The value of the custom config
|
|
353
|
+
*/
|
|
354
|
+
export interface ConfigAttributes {
|
|
355
|
+
name?: string;
|
|
356
|
+
value?: string;
|
|
357
|
+
}
|
|
358
|
+
|
|
340
359
|
/**
|
|
341
360
|
* Options to pass to connect
|
|
342
361
|
*
|
|
@@ -348,6 +367,37 @@ declare namespace VoiceResponse {
|
|
|
348
367
|
method?: string;
|
|
349
368
|
}
|
|
350
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Options to pass to conversation
|
|
372
|
+
*
|
|
373
|
+
* @property inboundAutocreation - Inbound autocreation
|
|
374
|
+
* @property inboundTimeout - Inbound timeout
|
|
375
|
+
* @property record - Record
|
|
376
|
+
* @property recordingStatusCallback - Recording status callback URL
|
|
377
|
+
* @property recordingStatusCallbackEvent - Recording status callback events
|
|
378
|
+
* @property recordingStatusCallbackMethod - Recording status callback URL method
|
|
379
|
+
* @property routingAssignmentTimeout - Routing assignment timeout
|
|
380
|
+
* @property serviceInstanceSid - Service instance Sid
|
|
381
|
+
* @property statusCallback - Status callback URL
|
|
382
|
+
* @property statusCallbackEvent - Events to call status callback URL
|
|
383
|
+
* @property statusCallbackMethod - Status callback URL method
|
|
384
|
+
* @property trim - Trim
|
|
385
|
+
*/
|
|
386
|
+
export interface ConversationAttributes {
|
|
387
|
+
inboundAutocreation?: boolean;
|
|
388
|
+
inboundTimeout?: number;
|
|
389
|
+
record?: ConversationRecord;
|
|
390
|
+
recordingStatusCallback?: string;
|
|
391
|
+
recordingStatusCallbackEvent?: ConversationRecordingEvent[];
|
|
392
|
+
recordingStatusCallbackMethod?: string;
|
|
393
|
+
routingAssignmentTimeout?: number;
|
|
394
|
+
serviceInstanceSid?: string;
|
|
395
|
+
statusCallback?: string;
|
|
396
|
+
statusCallbackEvent?: ConversationEvent[];
|
|
397
|
+
statusCallbackMethod?: string;
|
|
398
|
+
trim?: ConversationTrim;
|
|
399
|
+
}
|
|
400
|
+
|
|
351
401
|
/**
|
|
352
402
|
* Options to pass to dial
|
|
353
403
|
*
|
|
@@ -646,7 +696,7 @@ declare namespace VoiceResponse {
|
|
|
646
696
|
/**
|
|
647
697
|
* Options to pass to say
|
|
648
698
|
*
|
|
649
|
-
* @property language - Message
|
|
699
|
+
* @property language - Message language
|
|
650
700
|
* @property loop - Times to loop message
|
|
651
701
|
* @property voice - Voice to use
|
|
652
702
|
*/
|
|
@@ -837,12 +887,14 @@ declare namespace VoiceResponse {
|
|
|
837
887
|
* @property language - Language to be used by Dialogflow to transcribe speech
|
|
838
888
|
* @property sentimentAnalysis - Whether sentiment analysis needs to be enabled or not
|
|
839
889
|
* @property statusCallback - URL to post status callbacks from Twilio
|
|
890
|
+
* @property statusCallbackMethod - HTTP method to use when requesting the status callback URL
|
|
840
891
|
*/
|
|
841
892
|
export interface VirtualAgentAttributes {
|
|
842
893
|
connectorName?: string;
|
|
843
894
|
language?: string;
|
|
844
895
|
sentimentAnalysis?: boolean;
|
|
845
896
|
statusCallback?: string;
|
|
897
|
+
statusCallbackMethod?: string;
|
|
846
898
|
}
|
|
847
899
|
|
|
848
900
|
|
|
@@ -885,6 +937,12 @@ declare namespace VoiceResponse {
|
|
|
885
937
|
* @param name - Autopilot assistant sid or unique name
|
|
886
938
|
*/
|
|
887
939
|
autopilot(attributes: object, name: string): void;
|
|
940
|
+
/**
|
|
941
|
+
* <Conversation> TwiML Noun
|
|
942
|
+
*
|
|
943
|
+
* @param attributes - TwiML attributes
|
|
944
|
+
*/
|
|
945
|
+
conversation(attributes?: VoiceResponse.ConversationAttributes): void;
|
|
888
946
|
/**
|
|
889
947
|
* <Room> TwiML Noun
|
|
890
948
|
*
|
|
@@ -909,7 +967,7 @@ declare namespace VoiceResponse {
|
|
|
909
967
|
*
|
|
910
968
|
* @param attributes - TwiML attributes
|
|
911
969
|
*/
|
|
912
|
-
virtualAgent(attributes?: VoiceResponse.VirtualAgentAttributes):
|
|
970
|
+
virtualAgent(attributes?: VoiceResponse.VirtualAgentAttributes): VoiceResponse.VirtualAgent;
|
|
913
971
|
}
|
|
914
972
|
|
|
915
973
|
|
|
@@ -2713,6 +2771,23 @@ declare namespace VoiceResponse {
|
|
|
2713
2771
|
*/
|
|
2714
2772
|
parameter(attributes?: VoiceResponse.ParameterAttributes): void;
|
|
2715
2773
|
}
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
class VirtualAgent {
|
|
2777
|
+
|
|
2778
|
+
/**
|
|
2779
|
+
* <Config> TwiML Noun
|
|
2780
|
+
*
|
|
2781
|
+
* @param attributes - TwiML attributes
|
|
2782
|
+
*/
|
|
2783
|
+
config(attributes?: VoiceResponse.ConfigAttributes): void;
|
|
2784
|
+
/**
|
|
2785
|
+
* <Parameter> TwiML Noun
|
|
2786
|
+
*
|
|
2787
|
+
* @param attributes - TwiML attributes
|
|
2788
|
+
*/
|
|
2789
|
+
parameter(attributes?: VoiceResponse.ParameterAttributes): void;
|
|
2790
|
+
}
|
|
2716
2791
|
}
|
|
2717
2792
|
|
|
2718
2793
|
export = VoiceResponse;
|
|
@@ -329,7 +329,7 @@ VoiceResponse.prototype.reject = function reject(attributes) {
|
|
|
329
329
|
* @param {object} attributes - TwiML attributes
|
|
330
330
|
* @param {say.voice} [attributes.voice] - Voice to use
|
|
331
331
|
* @param {number} [attributes.loop] - Times to loop message
|
|
332
|
-
* @param {say.language} [attributes.language] - Message
|
|
332
|
+
* @param {say.language} [attributes.language] - Message language
|
|
333
333
|
* @param {string} message - Message to say
|
|
334
334
|
*
|
|
335
335
|
* @returns Say
|
|
@@ -792,7 +792,7 @@ Prompt.prototype.constructor = Prompt;
|
|
|
792
792
|
* @param {object} attributes - TwiML attributes
|
|
793
793
|
* @param {say.voice} [attributes.voice] - Voice to use
|
|
794
794
|
* @param {number} [attributes.loop] - Times to loop message
|
|
795
|
-
* @param {say.language} [attributes.language] - Message
|
|
795
|
+
* @param {say.language} [attributes.language] - Message language
|
|
796
796
|
* @param {string} message - Message to say
|
|
797
797
|
*
|
|
798
798
|
* @returns Say
|
|
@@ -3773,7 +3773,7 @@ Gather.prototype.constructor = Gather;
|
|
|
3773
3773
|
* @param {object} attributes - TwiML attributes
|
|
3774
3774
|
* @param {say.voice} [attributes.voice] - Voice to use
|
|
3775
3775
|
* @param {number} [attributes.loop] - Times to loop message
|
|
3776
|
-
* @param {say.language} [attributes.language] - Message
|
|
3776
|
+
* @param {say.language} [attributes.language] - Message language
|
|
3777
3777
|
* @param {string} message - Message to say
|
|
3778
3778
|
*
|
|
3779
3779
|
* @returns Say
|
|
@@ -4302,6 +4302,8 @@ Connect.prototype.stream = function stream(attributes) {
|
|
|
4302
4302
|
* Whether sentiment analysis needs to be enabled or not
|
|
4303
4303
|
* @param {string} [attributes.statusCallback] -
|
|
4304
4304
|
* URL to post status callbacks from Twilio
|
|
4305
|
+
* @param {string} [attributes.statusCallbackMethod] -
|
|
4306
|
+
* HTTP method to use when requesting the status callback URL
|
|
4305
4307
|
*
|
|
4306
4308
|
* @returns VirtualAgent
|
|
4307
4309
|
*/
|
|
@@ -4310,6 +4312,57 @@ Connect.prototype.virtualAgent = function virtualAgent(attributes) {
|
|
|
4310
4312
|
return new VirtualAgent(this.connect.ele('VirtualAgent', attributes));
|
|
4311
4313
|
};
|
|
4312
4314
|
|
|
4315
|
+
/* jshint ignore:start */
|
|
4316
|
+
/**
|
|
4317
|
+
* <Conversation> TwiML Noun
|
|
4318
|
+
*
|
|
4319
|
+
* @function conversation
|
|
4320
|
+
* @memberof Connect#
|
|
4321
|
+
*
|
|
4322
|
+
* @param {object} [attributes] - TwiML attributes
|
|
4323
|
+
* @param {string} [attributes.serviceInstanceSid] - Service instance Sid
|
|
4324
|
+
* @param {boolean} [attributes.inboundAutocreation] - Inbound autocreation
|
|
4325
|
+
* @param {number} [attributes.routingAssignmentTimeout] -
|
|
4326
|
+
* Routing assignment timeout
|
|
4327
|
+
* @param {number} [attributes.inboundTimeout] - Inbound timeout
|
|
4328
|
+
* @param {conversation.record} [attributes.record] - Record
|
|
4329
|
+
* @param {conversation.trim} [attributes.trim] - Trim
|
|
4330
|
+
* @param {string} [attributes.recordingStatusCallback] -
|
|
4331
|
+
* Recording status callback URL
|
|
4332
|
+
* @param {string} [attributes.recordingStatusCallbackMethod] -
|
|
4333
|
+
* Recording status callback URL method
|
|
4334
|
+
* @param {conversation.recording_event} [attributes.recordingStatusCallbackEvent] -
|
|
4335
|
+
* Recording status callback events
|
|
4336
|
+
* @param {string} [attributes.statusCallback] - Status callback URL
|
|
4337
|
+
* @param {string} [attributes.statusCallbackMethod] - Status callback URL method
|
|
4338
|
+
* @param {conversation.event} [attributes.statusCallbackEvent] -
|
|
4339
|
+
* Events to call status callback URL
|
|
4340
|
+
*
|
|
4341
|
+
* @returns Conversation
|
|
4342
|
+
*/
|
|
4343
|
+
/* jshint ignore:end */
|
|
4344
|
+
Connect.prototype.conversation = function conversation(attributes) {
|
|
4345
|
+
return new Conversation(this.connect.ele('Conversation', attributes));
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
|
|
4349
|
+
/* jshint ignore:start */
|
|
4350
|
+
/**
|
|
4351
|
+
* <Conversation> TwiML Noun
|
|
4352
|
+
*
|
|
4353
|
+
* @constructor Conversation
|
|
4354
|
+
*
|
|
4355
|
+
* @param {object} conversation - <Conversation> TwiML Noun
|
|
4356
|
+
*/
|
|
4357
|
+
/* jshint ignore:end */
|
|
4358
|
+
function Conversation(conversation) {
|
|
4359
|
+
this.conversation = conversation;
|
|
4360
|
+
this._propertyName = 'conversation';
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4363
|
+
Conversation.prototype = Object.create(TwiML.prototype);
|
|
4364
|
+
Conversation.prototype.constructor = Conversation;
|
|
4365
|
+
|
|
4313
4366
|
|
|
4314
4367
|
/* jshint ignore:start */
|
|
4315
4368
|
/**
|
|
@@ -4328,6 +4381,60 @@ function VirtualAgent(virtualAgent) {
|
|
|
4328
4381
|
VirtualAgent.prototype = Object.create(TwiML.prototype);
|
|
4329
4382
|
VirtualAgent.prototype.constructor = VirtualAgent;
|
|
4330
4383
|
|
|
4384
|
+
/* jshint ignore:start */
|
|
4385
|
+
/**
|
|
4386
|
+
* <Config> TwiML Noun
|
|
4387
|
+
*
|
|
4388
|
+
* @function config
|
|
4389
|
+
* @memberof VirtualAgent#
|
|
4390
|
+
*
|
|
4391
|
+
* @param {object} [attributes] - TwiML attributes
|
|
4392
|
+
* @param {string} [attributes.name] - The name of the custom config
|
|
4393
|
+
* @param {string} [attributes.value] - The value of the custom config
|
|
4394
|
+
*
|
|
4395
|
+
* @returns Config
|
|
4396
|
+
*/
|
|
4397
|
+
/* jshint ignore:end */
|
|
4398
|
+
VirtualAgent.prototype.config = function config(attributes) {
|
|
4399
|
+
return new Config(this.virtual_agent.ele('Config', attributes));
|
|
4400
|
+
};
|
|
4401
|
+
|
|
4402
|
+
/* jshint ignore:start */
|
|
4403
|
+
/**
|
|
4404
|
+
* <Parameter> TwiML Noun
|
|
4405
|
+
*
|
|
4406
|
+
* @function parameter
|
|
4407
|
+
* @memberof VirtualAgent#
|
|
4408
|
+
*
|
|
4409
|
+
* @param {object} [attributes] - TwiML attributes
|
|
4410
|
+
* @param {string} [attributes.name] - The name of the custom parameter
|
|
4411
|
+
* @param {string} [attributes.value] - The value of the custom parameter
|
|
4412
|
+
*
|
|
4413
|
+
* @returns Parameter
|
|
4414
|
+
*/
|
|
4415
|
+
/* jshint ignore:end */
|
|
4416
|
+
VirtualAgent.prototype.parameter = function parameter(attributes) {
|
|
4417
|
+
return new Parameter(this.virtual_agent.ele('Parameter', attributes));
|
|
4418
|
+
};
|
|
4419
|
+
|
|
4420
|
+
|
|
4421
|
+
/* jshint ignore:start */
|
|
4422
|
+
/**
|
|
4423
|
+
* <Config> TwiML Noun
|
|
4424
|
+
*
|
|
4425
|
+
* @constructor Config
|
|
4426
|
+
*
|
|
4427
|
+
* @param {object} config - <Config> TwiML Noun
|
|
4428
|
+
*/
|
|
4429
|
+
/* jshint ignore:end */
|
|
4430
|
+
function Config(config) {
|
|
4431
|
+
this.config = config;
|
|
4432
|
+
this._propertyName = 'config';
|
|
4433
|
+
}
|
|
4434
|
+
|
|
4435
|
+
Config.prototype = Object.create(TwiML.prototype);
|
|
4436
|
+
Config.prototype.constructor = Config;
|
|
4437
|
+
|
|
4331
4438
|
|
|
4332
4439
|
/* jshint ignore:start */
|
|
4333
4440
|
/**
|