twilio 3.79.0 → 3.81.0
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/README.md +5 -1
- package/lib/base/RequestClient.d.ts +40 -6
- package/lib/base/RequestClient.js +48 -7
- package/lib/rest/Microvisor.d.ts +28 -0
- package/lib/rest/Microvisor.js +62 -0
- package/lib/rest/Preview.d.ts +0 -6
- package/lib/rest/Preview.js +0 -28
- package/lib/rest/Routes.d.ts +30 -0
- package/lib/rest/Routes.js +71 -0
- package/lib/rest/Twilio.d.ts +4 -0
- package/lib/rest/Twilio.js +28 -0
- package/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.d.ts +2 -2
- package/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js +4 -4
- package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +12 -4
- package/lib/rest/flexApi/v1/interaction/interactionChannel.js +12 -3
- package/lib/rest/microvisor/V1.d.ts +28 -0
- package/lib/rest/microvisor/V1.js +57 -0
- package/lib/rest/{preview/bulk_exports/export/day.d.ts → microvisor/v1/app.d.ts} +79 -69
- package/lib/rest/{preview/bulk_exports/export/day.js → microvisor/v1/app.js} +160 -122
- package/lib/rest/{preview/bulk_exports/export/exportCustomJob.d.ts → microvisor/v1/device.d.ts} +136 -84
- package/lib/rest/microvisor/v1/device.js +652 -0
- package/lib/rest/routes/V2.d.ts +31 -0
- package/lib/rest/routes/V2.js +69 -0
- package/lib/rest/routes/v2/phoneNumber.d.ts +168 -0
- package/lib/rest/routes/v2/phoneNumber.js +394 -0
- package/lib/rest/routes/v2/sipDomain.d.ts +168 -0
- package/lib/rest/routes/v2/sipDomain.js +383 -0
- package/lib/rest/routes/v2/trunk.d.ts +168 -0
- package/lib/rest/routes/v2/trunk.js +390 -0
- package/lib/rest/supersim/v1/fleet.d.ts +3 -1
- package/lib/rest/supersim/v1/fleet.js +8 -3
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verification.js +1 -1
- package/lib/rest/verify/v2/service/verificationCheck.d.ts +2 -0
- package/lib/rest/verify/v2/service/verificationCheck.js +6 -3
- package/lib/twiml/VoiceResponse.d.ts +2 -2
- package/package.json +1 -1
- package/lib/rest/preview/BulkExports.d.ts +0 -28
- package/lib/rest/preview/BulkExports.js +0 -59
- package/lib/rest/preview/bulk_exports/export/exportCustomJob.js +0 -540
- package/lib/rest/preview/bulk_exports/export/job.d.ts +0 -163
- package/lib/rest/preview/bulk_exports/export/job.js +0 -390
- package/lib/rest/preview/bulk_exports/export.d.ts +0 -153
- package/lib/rest/preview/bulk_exports/export.js +0 -402
- package/lib/rest/preview/bulk_exports/exportConfiguration.d.ts +0 -180
- package/lib/rest/preview/bulk_exports/exportConfiguration.js +0 -411
package/README.md
CHANGED
|
@@ -28,6 +28,10 @@ This library supports the following Node.js implementations:
|
|
|
28
28
|
|
|
29
29
|
TypeScript is supported for TypeScript version 2.9 and above.
|
|
30
30
|
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
`npm install twilio` or `yarn add twilio`
|
|
34
|
+
|
|
31
35
|
## Sample Usage
|
|
32
36
|
|
|
33
37
|
Check out these [code examples](examples) in JavaScript and TypeScript to get up and running quickly.
|
|
@@ -138,7 +142,7 @@ npm test
|
|
|
138
142
|
To run just one specific test file instead of the whole suite, provide a JavaScript regular expression that will match your spec file's name, like:
|
|
139
143
|
|
|
140
144
|
```bash
|
|
141
|
-
npm run test -- -m .\*client.\*
|
|
145
|
+
npm run test:javascript -- -m .\*client.\*
|
|
142
146
|
```
|
|
143
147
|
|
|
144
148
|
[apidocs]: https://www.twilio.com/docs/api
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { HttpMethod } from
|
|
2
|
-
import Response = require(
|
|
1
|
+
import { HttpMethod } from "../interfaces";
|
|
2
|
+
import Response = require("../http/response");
|
|
3
3
|
|
|
4
4
|
declare class RequestClient {
|
|
5
|
-
constructor();
|
|
5
|
+
constructor(opts?: RequestClient.RequestClientOptions);
|
|
6
6
|
/**
|
|
7
7
|
* Make an HTTP request
|
|
8
|
-
* @param opts The
|
|
8
|
+
* @param opts The options https.Agent takes in
|
|
9
9
|
*/
|
|
10
|
-
request<TData>(
|
|
10
|
+
request<TData>(
|
|
11
|
+
opts: RequestClient.RequestOptions<TData>
|
|
12
|
+
): Promise<Response<TData>>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
declare namespace RequestClient {
|
|
@@ -54,9 +56,41 @@ declare namespace RequestClient {
|
|
|
54
56
|
forever?: boolean;
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
export interface RequestClientOptions {
|
|
60
|
+
/**
|
|
61
|
+
* A timeout in milliseconds. This will be used as the HTTPS agent's socket
|
|
62
|
+
* timeout, AND as the default request timeout.
|
|
63
|
+
*/
|
|
64
|
+
timeout?: number;
|
|
65
|
+
/**
|
|
66
|
+
* https.Agent keepAlive option
|
|
67
|
+
*/
|
|
68
|
+
keepAlive?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* https.Agent keepAliveMSecs option
|
|
71
|
+
*/
|
|
72
|
+
keepAliveMsecs?: number;
|
|
73
|
+
/**
|
|
74
|
+
* https.Agent maxSockets option
|
|
75
|
+
*/
|
|
76
|
+
maxSockets?: number;
|
|
77
|
+
/**
|
|
78
|
+
* https.Agent maxTotalSockets option
|
|
79
|
+
*/
|
|
80
|
+
maxTotalSockets?: number;
|
|
81
|
+
/**
|
|
82
|
+
* https.Agent maxFreeSockets option
|
|
83
|
+
*/
|
|
84
|
+
maxFreeSockets?: number;
|
|
85
|
+
/**
|
|
86
|
+
* https.Agent scheduling option
|
|
87
|
+
*/
|
|
88
|
+
scheduling?: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
57
91
|
export interface Headers {
|
|
58
92
|
[header: string]: string;
|
|
59
93
|
}
|
|
60
94
|
}
|
|
61
95
|
|
|
62
|
-
export = RequestClient;
|
|
96
|
+
export = RequestClient;
|
|
@@ -6,12 +6,54 @@ var fs = require('fs');
|
|
|
6
6
|
var HttpsProxyAgent = require('https-proxy-agent');
|
|
7
7
|
var Q = require('q');
|
|
8
8
|
var qs = require('qs');
|
|
9
|
+
var url = require('url');
|
|
10
|
+
var https = require('https');
|
|
9
11
|
var Response = require('../http/response');
|
|
10
12
|
var Request = require('../http/request');
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
const DEFAULT_CONTENT_TYPE = 'application/x-www-form-urlencoded';
|
|
15
|
+
const DEFAULT_TIMEOUT = 30000;
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Make http request
|
|
19
|
+
* @param {object} opts - The options passed to https.Agent
|
|
20
|
+
* @param {number} opts.timeout - https.Agent timeout option. Used as the socket timeout, AND as the default request timeout.
|
|
21
|
+
* @param {boolean} opts.keepAlive - https.Agent keepAlive option
|
|
22
|
+
* @param {number} opts.keepAliveMsecs - https.Agent keepAliveMsecs option
|
|
23
|
+
* @param {number} opts.maxSockets - https.Agent maxSockets option
|
|
24
|
+
* @param {number} opts.maxTotalSockets - https.Agent maxTotalSockets option
|
|
25
|
+
* @param {number} opts.maxFreeSockets - https.Agent maxFreeSockets option
|
|
26
|
+
* @param {string} opts.scheduling - https.Agent scheduling option
|
|
27
|
+
*/
|
|
28
|
+
var RequestClient = function (opts) {
|
|
29
|
+
opts = opts || {};
|
|
30
|
+
this.defaultTimeout = opts.timeout || DEFAULT_TIMEOUT;
|
|
31
|
+
|
|
32
|
+
// construct an https agent
|
|
33
|
+
let agentOpts = {
|
|
34
|
+
timeout: this.defaultTimeout,
|
|
35
|
+
keepAlive: opts.keepAlive,
|
|
36
|
+
keepAliveMsecs: opts.keepAliveMsecs,
|
|
37
|
+
maxSockets: opts.maxSockets,
|
|
38
|
+
maxTotalSockets: opts.maxTotalSockets,
|
|
39
|
+
maxFreeSockets: opts.maxFreeSockets,
|
|
40
|
+
scheduling: opts.scheduling,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
let agent;
|
|
44
|
+
if (process.env.HTTP_PROXY) {
|
|
45
|
+
// Note: if process.env.HTTP_PROXY is set, we're not able to apply the given
|
|
46
|
+
// socket timeout. See: https://github.com/TooTallNate/node-https-proxy-agent/pull/96
|
|
47
|
+
agent = new HttpsProxyAgent(process.env.HTTP_PROXY);
|
|
48
|
+
} else {
|
|
49
|
+
agent = new https.Agent(agentOpts);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// construct an axios instance
|
|
53
|
+
this.axios = axios.create();
|
|
54
|
+
this.axios.defaults.headers.post['Content-Type'] = DEFAULT_CONTENT_TYPE;
|
|
55
|
+
this.axios.defaults.httpsAgent = agent;
|
|
56
|
+
};
|
|
15
57
|
|
|
16
58
|
/**
|
|
17
59
|
* Make http request
|
|
@@ -53,12 +95,11 @@ RequestClient.prototype.request = function (opts) {
|
|
|
53
95
|
}
|
|
54
96
|
|
|
55
97
|
var options = {
|
|
56
|
-
timeout: opts.timeout ||
|
|
98
|
+
timeout: opts.timeout || this.defaultTimeout,
|
|
57
99
|
maxRedirects: opts.allowRedirects ? 10 : 0, // Same number of allowed redirects as request module default
|
|
58
100
|
url: opts.uri,
|
|
59
101
|
method: opts.method,
|
|
60
102
|
headers: opts.headers,
|
|
61
|
-
httpsAgent: process.env.HTTP_PROXY ? new HttpsProxyAgent(process.env.HTTP_PROXY) : undefined,
|
|
62
103
|
proxy: false,
|
|
63
104
|
validateStatus: status => status >= 100 && status < 600,
|
|
64
105
|
};
|
|
@@ -99,7 +140,7 @@ RequestClient.prototype.request = function (opts) {
|
|
|
99
140
|
this.lastResponse = undefined;
|
|
100
141
|
this.lastRequest = new Request(optionsRequest);
|
|
101
142
|
|
|
102
|
-
axios(options).then((response) => {
|
|
143
|
+
this.axios(options).then((response) => {
|
|
103
144
|
if (opts.logLevel === 'debug') {
|
|
104
145
|
console.log(`response.statusCode: ${response.status}`)
|
|
105
146
|
console.log(`response.headers: ${JSON.stringify(response.headers)}`)
|
|
@@ -122,7 +163,7 @@ RequestClient.prototype.filterLoggingHeaders = function (headers){
|
|
|
122
163
|
return Object.keys(headers).filter((header) => {
|
|
123
164
|
return !'authorization'.includes(header.toLowerCase());
|
|
124
165
|
});
|
|
125
|
-
}
|
|
166
|
+
};
|
|
126
167
|
|
|
127
168
|
RequestClient.prototype.logRequest = function (options){
|
|
128
169
|
console.log('-- BEGIN Twilio API Request --');
|
|
@@ -140,6 +181,6 @@ RequestClient.prototype.logRequest = function (options){
|
|
|
140
181
|
}
|
|
141
182
|
|
|
142
183
|
console.log('-- END Twilio API Request --');
|
|
143
|
-
}
|
|
184
|
+
};
|
|
144
185
|
|
|
145
186
|
module.exports = RequestClient;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Domain = require('../base/Domain');
|
|
9
|
+
import Twilio = require('./Twilio');
|
|
10
|
+
import V1 = require('./microvisor/V1');
|
|
11
|
+
import { AppListInstance } from './microvisor/v1/app';
|
|
12
|
+
import { DeviceListInstance } from './microvisor/v1/device';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
declare class Microvisor extends Domain {
|
|
16
|
+
/**
|
|
17
|
+
* Initialize microvisor domain
|
|
18
|
+
*
|
|
19
|
+
* @param twilio - The twilio client
|
|
20
|
+
*/
|
|
21
|
+
constructor(twilio: Twilio);
|
|
22
|
+
|
|
23
|
+
readonly apps: AppListInstance;
|
|
24
|
+
readonly devices: DeviceListInstance;
|
|
25
|
+
readonly v1: V1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export = Microvisor;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 Domain = require('../base/Domain'); /* jshint ignore:line */
|
|
14
|
+
var V1 = require('./microvisor/V1'); /* jshint ignore:line */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/* jshint ignore:start */
|
|
18
|
+
/**
|
|
19
|
+
* Initialize microvisor domain
|
|
20
|
+
*
|
|
21
|
+
* @constructor Twilio.Microvisor
|
|
22
|
+
*
|
|
23
|
+
* @property {Twilio.Microvisor.V1} v1 - v1 version
|
|
24
|
+
* @property {Twilio.Microvisor.V1.AppList} apps - apps resource
|
|
25
|
+
* @property {Twilio.Microvisor.V1.DeviceList} devices - devices resource
|
|
26
|
+
*
|
|
27
|
+
* @param {Twilio} twilio - The twilio client
|
|
28
|
+
*/
|
|
29
|
+
/* jshint ignore:end */
|
|
30
|
+
function Microvisor(twilio) {
|
|
31
|
+
Domain.prototype.constructor.call(this, twilio, 'https://microvisor.twilio.com');
|
|
32
|
+
|
|
33
|
+
// Versions
|
|
34
|
+
this._v1 = undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_.extend(Microvisor.prototype, Domain.prototype);
|
|
38
|
+
Microvisor.prototype.constructor = Microvisor;
|
|
39
|
+
|
|
40
|
+
Object.defineProperty(Microvisor.prototype,
|
|
41
|
+
'v1', {
|
|
42
|
+
get: function() {
|
|
43
|
+
this._v1 = this._v1 || new V1(this);
|
|
44
|
+
return this._v1;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
Object.defineProperty(Microvisor.prototype,
|
|
49
|
+
'apps', {
|
|
50
|
+
get: function() {
|
|
51
|
+
return this.v1.apps;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
Object.defineProperty(Microvisor.prototype,
|
|
56
|
+
'devices', {
|
|
57
|
+
get: function() {
|
|
58
|
+
return this.v1.devices;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
module.exports = Microvisor;
|
package/lib/rest/Preview.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* / /
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import BulkExports = require('./preview/BulkExports');
|
|
9
8
|
import DeployedDevices = require('./preview/DeployedDevices');
|
|
10
9
|
import Domain = require('../base/Domain');
|
|
11
10
|
import HostedNumbers = require('./preview/HostedNumbers');
|
|
@@ -23,8 +22,6 @@ import { BrandsInformationListInstance } from './preview/trusted_comms/brandsInf
|
|
|
23
22
|
import { CommandListInstance } from './preview/wireless/command';
|
|
24
23
|
import { CpsListInstance } from './preview/trusted_comms/cps';
|
|
25
24
|
import { CurrentCallListInstance } from './preview/trusted_comms/currentCall';
|
|
26
|
-
import { ExportConfigurationListInstance } from './preview/bulk_exports/exportConfiguration';
|
|
27
|
-
import { ExportListInstance } from './preview/bulk_exports/export';
|
|
28
25
|
import { FleetListInstance } from './preview/deployed_devices/fleet';
|
|
29
26
|
import { HostedNumberOrderListInstance } from './preview/hosted_numbers/hostedNumberOrder';
|
|
30
27
|
import { InstalledAddOnListInstance } from './preview/marketplace/installedAddOn';
|
|
@@ -46,13 +43,10 @@ declare class Preview extends Domain {
|
|
|
46
43
|
readonly availableAddOns: AvailableAddOnListInstance;
|
|
47
44
|
readonly brandedChannels: BrandedChannelListInstance;
|
|
48
45
|
readonly brandsInformation: BrandsInformationListInstance;
|
|
49
|
-
readonly bulk_exports: BulkExports;
|
|
50
46
|
readonly commands: CommandListInstance;
|
|
51
47
|
readonly cps: CpsListInstance;
|
|
52
48
|
readonly currentCalls: CurrentCallListInstance;
|
|
53
49
|
readonly deployed_devices: DeployedDevices;
|
|
54
|
-
readonly exportConfiguration: ExportConfigurationListInstance;
|
|
55
|
-
readonly exports: ExportListInstance;
|
|
56
50
|
readonly fleets: FleetListInstance;
|
|
57
51
|
readonly hostedNumberOrders: HostedNumberOrderListInstance;
|
|
58
52
|
readonly hosted_numbers: HostedNumbers;
|
package/lib/rest/Preview.js
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
/* jshint ignore:end */
|
|
11
11
|
|
|
12
12
|
var _ = require('lodash'); /* jshint ignore:line */
|
|
13
|
-
var BulkExports = require('./preview/BulkExports'); /* jshint ignore:line */
|
|
14
13
|
var DeployedDevices = require(
|
|
15
14
|
'./preview/DeployedDevices'); /* jshint ignore:line */
|
|
16
15
|
var Domain = require('../base/Domain'); /* jshint ignore:line */
|
|
@@ -29,7 +28,6 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
|
|
|
29
28
|
*
|
|
30
29
|
* @constructor Twilio.Preview
|
|
31
30
|
*
|
|
32
|
-
* @property {Twilio.Preview.BulkExports} bulk_exports - bulk_exports version
|
|
33
31
|
* @property {Twilio.Preview.DeployedDevices} deployed_devices -
|
|
34
32
|
* deployed_devices version
|
|
35
33
|
* @property {Twilio.Preview.HostedNumbers} hosted_numbers - hosted_numbers version
|
|
@@ -38,9 +36,6 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
|
|
|
38
36
|
* @property {Twilio.Preview.Understand} understand - understand version
|
|
39
37
|
* @property {Twilio.Preview.Wireless} wireless - wireless version
|
|
40
38
|
* @property {Twilio.Preview.TrustedComms} trusted_comms - trusted_comms version
|
|
41
|
-
* @property {Twilio.Preview.BulkExports.ExportList} exports - exports resource
|
|
42
|
-
* @property {Twilio.Preview.BulkExports.ExportConfigurationList} exportConfiguration -
|
|
43
|
-
* exportConfiguration resource
|
|
44
39
|
* @property {Twilio.Preview.DeployedDevices.FleetList} fleets - fleets resource
|
|
45
40
|
* @property {Twilio.Preview.HostedNumbers.AuthorizationDocumentList} authorizationDocuments -
|
|
46
41
|
* authorizationDocuments resource
|
|
@@ -71,7 +66,6 @@ function Preview(twilio) {
|
|
|
71
66
|
Domain.prototype.constructor.call(this, twilio, 'https://preview.twilio.com');
|
|
72
67
|
|
|
73
68
|
// Versions
|
|
74
|
-
this._bulk_exports = undefined;
|
|
75
69
|
this._deployed_devices = undefined;
|
|
76
70
|
this._hosted_numbers = undefined;
|
|
77
71
|
this._marketplace = undefined;
|
|
@@ -84,14 +78,6 @@ function Preview(twilio) {
|
|
|
84
78
|
_.extend(Preview.prototype, Domain.prototype);
|
|
85
79
|
Preview.prototype.constructor = Preview;
|
|
86
80
|
|
|
87
|
-
Object.defineProperty(Preview.prototype,
|
|
88
|
-
'bulk_exports', {
|
|
89
|
-
get: function() {
|
|
90
|
-
this._bulk_exports = this._bulk_exports || new BulkExports(this);
|
|
91
|
-
return this._bulk_exports;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
81
|
Object.defineProperty(Preview.prototype,
|
|
96
82
|
'deployed_devices', {
|
|
97
83
|
get: function() {
|
|
@@ -148,20 +134,6 @@ Object.defineProperty(Preview.prototype,
|
|
|
148
134
|
}
|
|
149
135
|
});
|
|
150
136
|
|
|
151
|
-
Object.defineProperty(Preview.prototype,
|
|
152
|
-
'exports', {
|
|
153
|
-
get: function() {
|
|
154
|
-
return this.bulk_exports.exports;
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
Object.defineProperty(Preview.prototype,
|
|
159
|
-
'exportConfiguration', {
|
|
160
|
-
get: function() {
|
|
161
|
-
return this.bulk_exports.exportConfiguration;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
|
|
165
137
|
Object.defineProperty(Preview.prototype,
|
|
166
138
|
'fleets', {
|
|
167
139
|
get: function() {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Domain = require('../base/Domain');
|
|
9
|
+
import Twilio = require('./Twilio');
|
|
10
|
+
import V2 = require('./routes/V2');
|
|
11
|
+
import { PhoneNumberListInstance } from './routes/v2/phoneNumber';
|
|
12
|
+
import { SipDomainListInstance } from './routes/v2/sipDomain';
|
|
13
|
+
import { TrunkListInstance } from './routes/v2/trunk';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
declare class Routes extends Domain {
|
|
17
|
+
/**
|
|
18
|
+
* Initialize routes domain
|
|
19
|
+
*
|
|
20
|
+
* @param twilio - The twilio client
|
|
21
|
+
*/
|
|
22
|
+
constructor(twilio: Twilio);
|
|
23
|
+
|
|
24
|
+
readonly phoneNumbers: PhoneNumberListInstance;
|
|
25
|
+
readonly sipDomains: SipDomainListInstance;
|
|
26
|
+
readonly trunks: TrunkListInstance;
|
|
27
|
+
readonly v2: V2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export = Routes;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 Domain = require('../base/Domain'); /* jshint ignore:line */
|
|
14
|
+
var V2 = require('./routes/V2'); /* jshint ignore:line */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/* jshint ignore:start */
|
|
18
|
+
/**
|
|
19
|
+
* Initialize routes domain
|
|
20
|
+
*
|
|
21
|
+
* @constructor Twilio.Routes
|
|
22
|
+
*
|
|
23
|
+
* @property {Twilio.Routes.V2} v2 - v2 version
|
|
24
|
+
* @property {Twilio.Routes.V2.PhoneNumberList} phoneNumbers -
|
|
25
|
+
* phoneNumbers resource
|
|
26
|
+
* @property {Twilio.Routes.V2.SipDomainList} sipDomains - sipDomains resource
|
|
27
|
+
* @property {Twilio.Routes.V2.TrunkList} trunks - trunks resource
|
|
28
|
+
*
|
|
29
|
+
* @param {Twilio} twilio - The twilio client
|
|
30
|
+
*/
|
|
31
|
+
/* jshint ignore:end */
|
|
32
|
+
function Routes(twilio) {
|
|
33
|
+
Domain.prototype.constructor.call(this, twilio, 'https://routes.twilio.com');
|
|
34
|
+
|
|
35
|
+
// Versions
|
|
36
|
+
this._v2 = undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_.extend(Routes.prototype, Domain.prototype);
|
|
40
|
+
Routes.prototype.constructor = Routes;
|
|
41
|
+
|
|
42
|
+
Object.defineProperty(Routes.prototype,
|
|
43
|
+
'v2', {
|
|
44
|
+
get: function() {
|
|
45
|
+
this._v2 = this._v2 || new V2(this);
|
|
46
|
+
return this._v2;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
Object.defineProperty(Routes.prototype,
|
|
51
|
+
'phoneNumbers', {
|
|
52
|
+
get: function() {
|
|
53
|
+
return this.v2.phoneNumbers;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
Object.defineProperty(Routes.prototype,
|
|
58
|
+
'sipDomains', {
|
|
59
|
+
get: function() {
|
|
60
|
+
return this.v2.sipDomains;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
Object.defineProperty(Routes.prototype,
|
|
65
|
+
'trunks', {
|
|
66
|
+
get: function() {
|
|
67
|
+
return this.v2.trunks;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
module.exports = Routes;
|
package/lib/rest/Twilio.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import IpMessaging = require('./IpMessaging');
|
|
|
19
19
|
import Lookups = require('./Lookups');
|
|
20
20
|
import Media = require('./Media');
|
|
21
21
|
import Messaging = require('./Messaging');
|
|
22
|
+
import Microvisor = require('./Microvisor');
|
|
22
23
|
import Monitor = require('./Monitor');
|
|
23
24
|
import Notify = require('./Notify');
|
|
24
25
|
import Numbers = require('./Numbers');
|
|
@@ -26,6 +27,7 @@ import Preview = require('./Preview');
|
|
|
26
27
|
import Pricing = require('./Pricing');
|
|
27
28
|
import Proxy = require('./Proxy');
|
|
28
29
|
import RequestClient = require('../base/RequestClient');
|
|
30
|
+
import Routes = require('./Routes');
|
|
29
31
|
import Serverless = require('./Serverless');
|
|
30
32
|
import Studio = require('./Studio');
|
|
31
33
|
import Supersim = require('./Supersim');
|
|
@@ -74,6 +76,7 @@ declare class Twilio {
|
|
|
74
76
|
media: Media;
|
|
75
77
|
messages: (typeof Api.prototype.account.messages);
|
|
76
78
|
messaging: Messaging;
|
|
79
|
+
microvisor: Microvisor;
|
|
77
80
|
monitor: Monitor;
|
|
78
81
|
newKeys: (typeof Api.prototype.account.newKeys);
|
|
79
82
|
newSigningKeys: (typeof Api.prototype.account.newSigningKeys);
|
|
@@ -93,6 +96,7 @@ declare class Twilio {
|
|
|
93
96
|
* @param opts - The options argument
|
|
94
97
|
*/
|
|
95
98
|
request(opts: Twilio.RequestOptions): Promise<any>;
|
|
99
|
+
routes: Routes;
|
|
96
100
|
serverless: Serverless;
|
|
97
101
|
shortCodes: (typeof Api.prototype.account.shortCodes);
|
|
98
102
|
signingKeys: (typeof Api.prototype.account.signingKeys);
|
package/lib/rest/Twilio.js
CHANGED
|
@@ -41,6 +41,7 @@ var RestException = require('../base/RestException'); /* jshint ignore:line */
|
|
|
41
41
|
* @property {Twilio.Preview} preview - preview domain
|
|
42
42
|
* @property {Twilio.Pricing} pricing - pricing domain
|
|
43
43
|
* @property {Twilio.Proxy} proxy - proxy domain
|
|
44
|
+
* @property {Twilio.Routes} routes - routes domain
|
|
44
45
|
* @property {Twilio.Serverless} serverless - serverless domain
|
|
45
46
|
* @property {Twilio.Studio} studio - studio domain
|
|
46
47
|
* @property {Twilio.Sync} sync - sync domain
|
|
@@ -53,6 +54,7 @@ var RestException = require('../base/RestException'); /* jshint ignore:line */
|
|
|
53
54
|
* @property {Twilio.Wireless} wireless - wireless domain
|
|
54
55
|
* @property {Twilio.Supersim} supersim - supersim domain
|
|
55
56
|
* @property {Twilio.Bulkexports} bulkexports - bulkexports domain
|
|
57
|
+
* @property {Twilio.Microvisor} microvisor - microvisor domain
|
|
56
58
|
* @property {Twilio.Api.V2010.AccountContext.AddressList} addresses -
|
|
57
59
|
* addresses resource
|
|
58
60
|
* @property {Twilio.Api.V2010.AccountContext.ApplicationList} applications -
|
|
@@ -166,6 +168,7 @@ function Twilio(username, password, opts) {
|
|
|
166
168
|
this._preview = undefined;
|
|
167
169
|
this._pricing = undefined;
|
|
168
170
|
this._proxy = undefined;
|
|
171
|
+
this._routes = undefined;
|
|
169
172
|
this._serverless = undefined;
|
|
170
173
|
this._studio = undefined;
|
|
171
174
|
this._sync = undefined;
|
|
@@ -178,6 +181,7 @@ function Twilio(username, password, opts) {
|
|
|
178
181
|
this._wireless = undefined;
|
|
179
182
|
this._supersim = undefined;
|
|
180
183
|
this._bulkexports = undefined;
|
|
184
|
+
this._microvisor = undefined;
|
|
181
185
|
|
|
182
186
|
if (opts.lazyLoading == false) {
|
|
183
187
|
this.accounts;
|
|
@@ -199,6 +203,7 @@ function Twilio(username, password, opts) {
|
|
|
199
203
|
this.preview;
|
|
200
204
|
this.pricing;
|
|
201
205
|
this.proxy;
|
|
206
|
+
this.routes;
|
|
202
207
|
this.serverless;
|
|
203
208
|
this.studio;
|
|
204
209
|
this.sync;
|
|
@@ -211,6 +216,7 @@ function Twilio(username, password, opts) {
|
|
|
211
216
|
this.wireless;
|
|
212
217
|
this.supersim;
|
|
213
218
|
this.bulkexports;
|
|
219
|
+
this.microvisor;
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
222
|
|
|
@@ -568,6 +574,17 @@ Object.defineProperty(Twilio.prototype,
|
|
|
568
574
|
}
|
|
569
575
|
});
|
|
570
576
|
|
|
577
|
+
Object.defineProperty(Twilio.prototype,
|
|
578
|
+
'routes', {
|
|
579
|
+
get: function() {
|
|
580
|
+
if (!this._routes) {
|
|
581
|
+
var Routes = require('./Routes'); /* jshint ignore:line */
|
|
582
|
+
this._routes = new Routes(this);
|
|
583
|
+
}
|
|
584
|
+
return this._routes;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
|
|
571
588
|
Object.defineProperty(Twilio.prototype,
|
|
572
589
|
'serverless', {
|
|
573
590
|
get: function() {
|
|
@@ -700,6 +717,17 @@ Object.defineProperty(Twilio.prototype,
|
|
|
700
717
|
}
|
|
701
718
|
});
|
|
702
719
|
|
|
720
|
+
Object.defineProperty(Twilio.prototype,
|
|
721
|
+
'microvisor', {
|
|
722
|
+
get: function() {
|
|
723
|
+
if (!this._microvisor) {
|
|
724
|
+
var Microvisor = require('./Microvisor'); /* jshint ignore:line */
|
|
725
|
+
this._microvisor = new Microvisor(this);
|
|
726
|
+
}
|
|
727
|
+
return this._microvisor;
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
703
731
|
Object.defineProperty(Twilio.prototype,
|
|
704
732
|
'addresses', {
|
|
705
733
|
get: function() {
|
|
@@ -23,7 +23,7 @@ declare function IpAddressList(version: V2010, accountSid: string, ipAccessContr
|
|
|
23
23
|
* Options to pass to update
|
|
24
24
|
*
|
|
25
25
|
* @property cidrPrefixLength - An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used.
|
|
26
|
-
* @property friendlyName - A human readable descriptive text for this resource, up to
|
|
26
|
+
* @property friendlyName - A human readable descriptive text for this resource, up to 255 characters long.
|
|
27
27
|
* @property ipAddress - An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
|
|
28
28
|
*/
|
|
29
29
|
interface IpAddressInstanceUpdateOptions {
|
|
@@ -156,7 +156,7 @@ interface IpAddressListInstance {
|
|
|
156
156
|
* Options to pass to create
|
|
157
157
|
*
|
|
158
158
|
* @property cidrPrefixLength - An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used.
|
|
159
|
-
* @property friendlyName - A human readable descriptive text for this resource, up to
|
|
159
|
+
* @property friendlyName - A human readable descriptive text for this resource, up to 255 characters long.
|
|
160
160
|
* @property ipAddress - An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
|
|
161
161
|
*/
|
|
162
162
|
interface IpAddressListInstanceCreateOptions {
|
|
@@ -311,7 +311,7 @@ IpAddressList = function IpAddressList(version, accountSid,
|
|
|
311
311
|
*
|
|
312
312
|
* @param {object} opts - Options for request
|
|
313
313
|
* @param {string} opts.friendlyName -
|
|
314
|
-
* A human readable descriptive text for this resource, up to
|
|
314
|
+
* A human readable descriptive text for this resource, up to 255 characters long.
|
|
315
315
|
* @param {string} opts.ipAddress -
|
|
316
316
|
* An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
|
|
317
317
|
* @param {number} [opts.cidrPrefixLength] -
|
|
@@ -486,7 +486,7 @@ IpAddressPage.prototype[util.inspect.custom] = function inspect(depth, options)
|
|
|
486
486
|
* @property {string} accountSid -
|
|
487
487
|
* The unique id of the Account that is responsible for this resource.
|
|
488
488
|
* @property {string} friendlyName -
|
|
489
|
-
* A human readable descriptive text for this resource, up to
|
|
489
|
+
* A human readable descriptive text for this resource, up to 255 characters long.
|
|
490
490
|
* @property {string} ipAddress -
|
|
491
491
|
* An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
|
|
492
492
|
* @property {number} cidrPrefixLength -
|
|
@@ -576,7 +576,7 @@ IpAddressInstance.prototype.fetch = function fetch(callback) {
|
|
|
576
576
|
* @param {string} [opts.ipAddress] -
|
|
577
577
|
* An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
|
|
578
578
|
* @param {string} [opts.friendlyName] -
|
|
579
|
-
* A human readable descriptive text for this resource, up to
|
|
579
|
+
* A human readable descriptive text for this resource, up to 255 characters long.
|
|
580
580
|
* @param {number} [opts.cidrPrefixLength] -
|
|
581
581
|
* An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used.
|
|
582
582
|
* @param {function} [callback] - Callback to handle processed record
|
|
@@ -700,7 +700,7 @@ IpAddressContext.prototype.fetch = function fetch(callback) {
|
|
|
700
700
|
* @param {string} [opts.ipAddress] -
|
|
701
701
|
* An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
|
|
702
702
|
* @param {string} [opts.friendlyName] -
|
|
703
|
-
* A human readable descriptive text for this resource, up to
|
|
703
|
+
* A human readable descriptive text for this resource, up to 255 characters long.
|
|
704
704
|
* @param {number} [opts.cidrPrefixLength] -
|
|
705
705
|
* An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used.
|
|
706
706
|
* @param {function} [callback] - Callback to handle processed record
|