twilio 3.24.0 → 3.25.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/CHANGES.md +22 -0
- package/lib/rest/Authy.js +5 -5
- package/lib/rest/Preview.d.ts +0 -2
- package/lib/rest/Preview.js +12 -23
- package/lib/rest/Video.js +8 -8
- package/lib/rest/api/v2010/account/message.d.ts +2 -0
- package/lib/rest/api/v2010/account/message.js +4 -1
- package/lib/rest/api/v2010/account/sip/ipAccessControlList.d.ts +3 -3
- package/lib/rest/api/v2010/account/sip/ipAccessControlList.js +3 -3
- package/lib/rest/authy/V1.d.ts +1 -1
- package/lib/rest/authy/V1.js +8 -8
- package/lib/rest/authy/v1/form.d.ts +13 -13
- package/lib/rest/authy/v1/form.js +17 -17
- package/lib/rest/authy/v1/service/entity/factor/challenge.d.ts +12 -13
- package/lib/rest/authy/v1/service/entity/factor/challenge.js +4 -6
- package/lib/rest/authy/v1/service/entity/factor.d.ts +9 -9
- package/lib/rest/authy/v1/service/entity/factor.js +7 -9
- package/lib/rest/chat/v2/service/channel/member.d.ts +7 -0
- package/lib/rest/chat/v2/service/channel/member.js +13 -2
- package/lib/rest/ipMessaging/v2/service/channel/member.d.ts +7 -0
- package/lib/rest/ipMessaging/v2/service/channel/member.js +13 -2
- package/lib/rest/preview/Marketplace.d.ts +1 -1
- package/lib/rest/preview/Marketplace.js +9 -9
- package/lib/rest/verify/v1/service/verification.d.ts +2 -0
- package/lib/rest/verify/v1/service/verification.js +3 -1
- package/lib/rest/video/V1.d.ts +1 -1
- package/lib/rest/video/V1.js +10 -10
- package/package.json +1 -1
- package/lib/rest/preview/Authy.d.ts +0 -27
- package/lib/rest/preview/Authy.js +0 -44
- package/lib/rest/preview/authy/service/entity.d.ts +0 -250
- package/lib/rest/preview/authy/service/entity.js +0 -514
- package/lib/rest/preview/authy/service.d.ts +0 -275
- package/lib/rest/preview/authy/service.js +0 -578
package/CHANGES.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
twilio-node changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
[2018-11-30] Version 3.25.0
|
|
5
|
+
----------------------------
|
|
6
|
+
**Api**
|
|
7
|
+
- Add `interactive_data` optional param to Messages create request
|
|
8
|
+
|
|
9
|
+
**Authy**
|
|
10
|
+
- Required authentication for `/v1/Forms/{type}` endpoint **(breaking change)**
|
|
11
|
+
- Removed `Challenge.reason` to `Challenge.responded_reason`
|
|
12
|
+
- Removed `verification_sid` from Challenge responses
|
|
13
|
+
- Removed `config` param from the Factor creation
|
|
14
|
+
- Replaced all occurrences of `FactorType` and `FormType` in favor of a unified `Type` **(breaking change)**
|
|
15
|
+
|
|
16
|
+
**Chat**
|
|
17
|
+
- Add Member attributes
|
|
18
|
+
|
|
19
|
+
**Preview**
|
|
20
|
+
- Removed `Authy` version from `preview` subdomain in favor to `authy` subdomain. **(breaking change)**
|
|
21
|
+
|
|
22
|
+
**Verify**
|
|
23
|
+
- Add `CustomCode` optional parameter on Verication creation.
|
|
24
|
+
|
|
25
|
+
|
|
4
26
|
[2018-11-16] Version 3.24.0
|
|
5
27
|
----------------------------
|
|
6
28
|
**Messaging**
|
package/lib/rest/Authy.js
CHANGED
|
@@ -21,8 +21,8 @@ var V1 = require('./authy/V1'); /* jshint ignore:line */
|
|
|
21
21
|
* @constructor
|
|
22
22
|
*
|
|
23
23
|
* @property {Twilio.Authy.V1} v1 - v1 version
|
|
24
|
-
* @property {Twilio.Authy.V1.ServiceList} services - services resource
|
|
25
24
|
* @property {Twilio.Authy.V1.FormList} forms - forms resource
|
|
25
|
+
* @property {Twilio.Authy.V1.ServiceList} services - services resource
|
|
26
26
|
*
|
|
27
27
|
* @param {Twilio} twilio - The twilio client
|
|
28
28
|
*/
|
|
@@ -46,16 +46,16 @@ Object.defineProperty(Authy.prototype,
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
Object.defineProperty(Authy.prototype,
|
|
49
|
-
'
|
|
49
|
+
'forms', {
|
|
50
50
|
get: function() {
|
|
51
|
-
return this.v1.
|
|
51
|
+
return this.v1.forms;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
Object.defineProperty(Authy.prototype,
|
|
56
|
-
'
|
|
56
|
+
'services', {
|
|
57
57
|
get: function() {
|
|
58
|
-
return this.v1.
|
|
58
|
+
return this.v1.services;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
package/lib/rest/Preview.d.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import AccSecurity = require('./preview/AccSecurity');
|
|
9
|
-
import Authy = require('./preview/Authy');
|
|
10
9
|
import BulkExports = require('./preview/BulkExports');
|
|
11
10
|
import DeployedDevices = require('./preview/DeployedDevices');
|
|
12
11
|
import Domain = require('../base/Domain');
|
|
@@ -41,7 +40,6 @@ declare class Preview extends Domain {
|
|
|
41
40
|
readonly acc_security: AccSecurity;
|
|
42
41
|
readonly assistants: AssistantListInstance;
|
|
43
42
|
readonly authorizationDocuments: AuthorizationDocumentListInstance;
|
|
44
|
-
readonly authy: Authy;
|
|
45
43
|
readonly availableAddOns: AvailableAddOnListInstance;
|
|
46
44
|
readonly bulk_exports: BulkExports;
|
|
47
45
|
readonly commands: CommandListInstance;
|
package/lib/rest/Preview.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
var _ = require('lodash'); /* jshint ignore:line */
|
|
13
13
|
var AccSecurity = require('./preview/AccSecurity'); /* jshint ignore:line */
|
|
14
|
-
var Authy = require('./preview/Authy'); /* jshint ignore:line */
|
|
15
14
|
var BulkExports = require('./preview/BulkExports'); /* jshint ignore:line */
|
|
16
15
|
var DeployedDevices = require(
|
|
17
16
|
'./preview/DeployedDevices'); /* jshint ignore:line */
|
|
@@ -30,7 +29,6 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
|
|
|
30
29
|
*
|
|
31
30
|
* @constructor
|
|
32
31
|
*
|
|
33
|
-
* @property {Twilio.Preview.Authy} authy - authy version
|
|
34
32
|
* @property {Twilio.Preview.BulkExports} bulk_exports - bulk_exports version
|
|
35
33
|
* @property {Twilio.Preview.DeployedDevices} deployed_devices -
|
|
36
34
|
* deployed_devices version
|
|
@@ -40,7 +38,6 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
|
|
|
40
38
|
* @property {Twilio.Preview.Sync} sync - sync version
|
|
41
39
|
* @property {Twilio.Preview.Understand} understand - understand version
|
|
42
40
|
* @property {Twilio.Preview.Wireless} wireless - wireless version
|
|
43
|
-
* @property {Twilio.Preview.Sync.ServiceList} services - services resource
|
|
44
41
|
* @property {Twilio.Preview.BulkExports.ExportList} exports - exports resource
|
|
45
42
|
* @property {Twilio.Preview.BulkExports.ExportConfigurationList} exportConfiguration -
|
|
46
43
|
* exportConfiguration resource
|
|
@@ -49,10 +46,11 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
|
|
|
49
46
|
* authorizationDocuments resource
|
|
50
47
|
* @property {Twilio.Preview.HostedNumbers.HostedNumberOrderList} hostedNumberOrders -
|
|
51
48
|
* hostedNumberOrders resource
|
|
52
|
-
* @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns -
|
|
53
|
-
* installedAddOns resource
|
|
54
49
|
* @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns -
|
|
55
50
|
* availableAddOns resource
|
|
51
|
+
* @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns -
|
|
52
|
+
* installedAddOns resource
|
|
53
|
+
* @property {Twilio.Preview.Sync.ServiceList} services - services resource
|
|
56
54
|
* @property {Twilio.Preview.Understand.AssistantList} assistants -
|
|
57
55
|
* assistants resource
|
|
58
56
|
* @property {Twilio.Preview.Wireless.CommandList} commands - commands resource
|
|
@@ -66,7 +64,6 @@ function Preview(twilio) {
|
|
|
66
64
|
Domain.prototype.constructor.call(this, twilio, 'https://preview.twilio.com');
|
|
67
65
|
|
|
68
66
|
// Versions
|
|
69
|
-
this._authy = undefined;
|
|
70
67
|
this._bulk_exports = undefined;
|
|
71
68
|
this._deployed_devices = undefined;
|
|
72
69
|
this._hosted_numbers = undefined;
|
|
@@ -80,14 +77,6 @@ function Preview(twilio) {
|
|
|
80
77
|
_.extend(Preview.prototype, Domain.prototype);
|
|
81
78
|
Preview.prototype.constructor = Preview;
|
|
82
79
|
|
|
83
|
-
Object.defineProperty(Preview.prototype,
|
|
84
|
-
'authy', {
|
|
85
|
-
get: function() {
|
|
86
|
-
this._authy = this._authy || new Authy(this);
|
|
87
|
-
return this._authy;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
80
|
Object.defineProperty(Preview.prototype,
|
|
92
81
|
'bulk_exports', {
|
|
93
82
|
get: function() {
|
|
@@ -152,13 +141,6 @@ Object.defineProperty(Preview.prototype,
|
|
|
152
141
|
}
|
|
153
142
|
});
|
|
154
143
|
|
|
155
|
-
Object.defineProperty(Preview.prototype,
|
|
156
|
-
'services', {
|
|
157
|
-
get: function() {
|
|
158
|
-
return this.sync.services;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
144
|
Object.defineProperty(Preview.prototype,
|
|
163
145
|
'exports', {
|
|
164
146
|
get: function() {
|
|
@@ -194,6 +176,13 @@ Object.defineProperty(Preview.prototype,
|
|
|
194
176
|
}
|
|
195
177
|
});
|
|
196
178
|
|
|
179
|
+
Object.defineProperty(Preview.prototype,
|
|
180
|
+
'availableAddOns', {
|
|
181
|
+
get: function() {
|
|
182
|
+
return this.marketplace.availableAddOns;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
197
186
|
Object.defineProperty(Preview.prototype,
|
|
198
187
|
'installedAddOns', {
|
|
199
188
|
get: function() {
|
|
@@ -202,9 +191,9 @@ Object.defineProperty(Preview.prototype,
|
|
|
202
191
|
});
|
|
203
192
|
|
|
204
193
|
Object.defineProperty(Preview.prototype,
|
|
205
|
-
'
|
|
194
|
+
'services', {
|
|
206
195
|
get: function() {
|
|
207
|
-
return this.
|
|
196
|
+
return this.sync.services;
|
|
208
197
|
}
|
|
209
198
|
});
|
|
210
199
|
|
package/lib/rest/Video.js
CHANGED
|
@@ -21,6 +21,7 @@ var V1 = require('./video/V1'); /* jshint ignore:line */
|
|
|
21
21
|
* @constructor
|
|
22
22
|
*
|
|
23
23
|
* @property {Twilio.Video.V1} v1 - v1 version
|
|
24
|
+
* @property {Twilio.Video.V1.CompositionList} compositions - compositions resource
|
|
24
25
|
* @property {Twilio.Video.V1.CompositionHookList} compositionHooks -
|
|
25
26
|
* compositionHooks resource
|
|
26
27
|
* @property {Twilio.Video.V1.CompositionSettingsList} compositionSettings -
|
|
@@ -28,7 +29,6 @@ var V1 = require('./video/V1'); /* jshint ignore:line */
|
|
|
28
29
|
* @property {Twilio.Video.V1.RecordingList} recordings - recordings resource
|
|
29
30
|
* @property {Twilio.Video.V1.RecordingSettingsList} recordingSettings -
|
|
30
31
|
* recordingSettings resource
|
|
31
|
-
* @property {Twilio.Video.V1.CompositionList} compositions - compositions resource
|
|
32
32
|
* @property {Twilio.Video.V1.RoomList} rooms - rooms resource
|
|
33
33
|
*
|
|
34
34
|
* @param {Twilio} twilio - The twilio client
|
|
@@ -52,6 +52,13 @@ Object.defineProperty(Video.prototype,
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
+
Object.defineProperty(Video.prototype,
|
|
56
|
+
'compositions', {
|
|
57
|
+
get: function() {
|
|
58
|
+
return this.v1.compositions;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
55
62
|
Object.defineProperty(Video.prototype,
|
|
56
63
|
'compositionHooks', {
|
|
57
64
|
get: function() {
|
|
@@ -80,13 +87,6 @@ Object.defineProperty(Video.prototype,
|
|
|
80
87
|
}
|
|
81
88
|
});
|
|
82
89
|
|
|
83
|
-
Object.defineProperty(Video.prototype,
|
|
84
|
-
'compositions', {
|
|
85
|
-
get: function() {
|
|
86
|
-
return this.v1.compositions;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
90
|
Object.defineProperty(Video.prototype,
|
|
91
91
|
'rooms', {
|
|
92
92
|
get: function() {
|
|
@@ -112,6 +112,7 @@ interface MessageListInstance {
|
|
|
112
112
|
* @property contentRetention - The content_retention
|
|
113
113
|
* @property forceDelivery - The force_delivery
|
|
114
114
|
* @property from - The phone number that initiated the message
|
|
115
|
+
* @property interactiveData - JSON string representing interactive data message.
|
|
115
116
|
* @property maxPrice - The total maximum price up to the fourth decimal in US dollars acceptable for the message to be delivered.
|
|
116
117
|
* @property maxRate - The max_rate
|
|
117
118
|
* @property mediaUrl - The URL of the media you wish to send out with the message.
|
|
@@ -130,6 +131,7 @@ interface MessageListInstanceCreateOptions {
|
|
|
130
131
|
contentRetention?: MessageContentRetention;
|
|
131
132
|
forceDelivery?: boolean;
|
|
132
133
|
from?: string;
|
|
134
|
+
interactiveData?: string;
|
|
133
135
|
maxPrice?: number;
|
|
134
136
|
maxRate?: string;
|
|
135
137
|
mediaUrl?: string[];
|
|
@@ -73,6 +73,8 @@ MessageList = function MessageList(version, accountSid) {
|
|
|
73
73
|
* @param {message.address_retention} [opts.addressRetention] -
|
|
74
74
|
* The address_retention
|
|
75
75
|
* @param {boolean} [opts.smartEncoded] - The smart_encoded
|
|
76
|
+
* @param {string} [opts.interactiveData] -
|
|
77
|
+
* JSON string representing interactive data message.
|
|
76
78
|
* @param {string} [opts.from] - The phone number that initiated the message
|
|
77
79
|
* @param {string} [opts.messagingServiceSid] -
|
|
78
80
|
* The 34 character unique id of the Messaging Service you want to associate with this Message.
|
|
@@ -110,7 +112,8 @@ MessageList = function MessageList(version, accountSid) {
|
|
|
110
112
|
'ProviderSid': _.get(opts, 'providerSid'),
|
|
111
113
|
'ContentRetention': _.get(opts, 'contentRetention'),
|
|
112
114
|
'AddressRetention': _.get(opts, 'addressRetention'),
|
|
113
|
-
'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded'))
|
|
115
|
+
'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded')),
|
|
116
|
+
'InteractiveData': _.get(opts, 'interactiveData')
|
|
114
117
|
});
|
|
115
118
|
|
|
116
119
|
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
@@ -58,7 +58,7 @@ interface IpAccessControlListListInstance {
|
|
|
58
58
|
/**
|
|
59
59
|
* Constructs a ip_access_control_list
|
|
60
60
|
*
|
|
61
|
-
* @param sid - Fetch by unique
|
|
61
|
+
* @param sid - Fetch by unique IpAccessControlList Sid
|
|
62
62
|
*/
|
|
63
63
|
get(sid: string): IpAccessControlListContext;
|
|
64
64
|
/**
|
|
@@ -184,7 +184,7 @@ declare class IpAccessControlListContext {
|
|
|
184
184
|
*
|
|
185
185
|
* @param version - Version of the resource
|
|
186
186
|
* @param accountSid - The account_sid
|
|
187
|
-
* @param sid - Fetch by unique
|
|
187
|
+
* @param sid - Fetch by unique IpAccessControlList Sid
|
|
188
188
|
*/
|
|
189
189
|
constructor(version: V2010, accountSid: string, sid: string);
|
|
190
190
|
|
|
@@ -226,7 +226,7 @@ declare class IpAccessControlListInstance extends SerializableClass {
|
|
|
226
226
|
* @param version - Version of the resource
|
|
227
227
|
* @param payload - The instance payload
|
|
228
228
|
* @param accountSid - A 34 character string that uniquely identifies this resource.
|
|
229
|
-
* @param sid - Fetch by unique
|
|
229
|
+
* @param sid - Fetch by unique IpAccessControlList Sid
|
|
230
230
|
*/
|
|
231
231
|
constructor(version: V2010, payload: IpAccessControlListPayload, accountSid: string, sid: string);
|
|
232
232
|
|
|
@@ -325,7 +325,7 @@ IpAccessControlListList = function IpAccessControlListList(version, accountSid)
|
|
|
325
325
|
/**
|
|
326
326
|
* Constructs a ip_access_control_list
|
|
327
327
|
*
|
|
328
|
-
* @param {string} sid - Fetch by unique
|
|
328
|
+
* @param {string} sid - Fetch by unique IpAccessControlList Sid
|
|
329
329
|
*
|
|
330
330
|
* @returns {Twilio.Api.V2010.AccountContext.SipContext.IpAccessControlListContext}
|
|
331
331
|
*/
|
|
@@ -390,7 +390,7 @@ IpAccessControlListPage.prototype.getInstance = function getInstance(payload) {
|
|
|
390
390
|
* @param {IpAccessControlListPayload} payload - The instance payload
|
|
391
391
|
* @param {sid} accountSid -
|
|
392
392
|
* A 34 character string that uniquely identifies this resource.
|
|
393
|
-
* @param {sid} sid - Fetch by unique
|
|
393
|
+
* @param {sid} sid - Fetch by unique IpAccessControlList Sid
|
|
394
394
|
*/
|
|
395
395
|
/* jshint ignore:end */
|
|
396
396
|
IpAccessControlListInstance = function IpAccessControlListInstance(version,
|
|
@@ -507,7 +507,7 @@ IpAccessControlListInstance.prototype.toJSON = function toJSON() {
|
|
|
507
507
|
*
|
|
508
508
|
* @param {V2010} version - Version of the resource
|
|
509
509
|
* @param {sid} accountSid - The account_sid
|
|
510
|
-
* @param {sid} sid - Fetch by unique
|
|
510
|
+
* @param {sid} sid - Fetch by unique IpAccessControlList Sid
|
|
511
511
|
*/
|
|
512
512
|
/* jshint ignore:end */
|
|
513
513
|
IpAccessControlListContext = function IpAccessControlListContext(version,
|
package/lib/rest/authy/V1.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ declare class V1 extends Version {
|
|
|
17
17
|
/**
|
|
18
18
|
* Initialize the V1 version of Authy
|
|
19
19
|
*
|
|
20
|
-
* @property services - services resource
|
|
21
20
|
* @property forms - forms resource
|
|
21
|
+
* @property services - services resource
|
|
22
22
|
*
|
|
23
23
|
* @param domain - The twilio domain
|
|
24
24
|
*/
|
package/lib/rest/authy/V1.js
CHANGED
|
@@ -19,8 +19,8 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
|
|
|
19
19
|
/**
|
|
20
20
|
* Initialize the V1 version of Authy
|
|
21
21
|
*
|
|
22
|
-
* @property {Twilio.Authy.V1.ServiceList} services - services resource
|
|
23
22
|
* @property {Twilio.Authy.V1.FormList} forms - forms resource
|
|
23
|
+
* @property {Twilio.Authy.V1.ServiceList} services - services resource
|
|
24
24
|
*
|
|
25
25
|
* @param {Twilio.Authy} domain - The twilio domain
|
|
26
26
|
*/
|
|
@@ -29,26 +29,26 @@ function V1(domain) {
|
|
|
29
29
|
Version.prototype.constructor.call(this, domain, 'v1');
|
|
30
30
|
|
|
31
31
|
// Resources
|
|
32
|
-
this._services = undefined;
|
|
33
32
|
this._forms = undefined;
|
|
33
|
+
this._services = undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
_.extend(V1.prototype, Version.prototype);
|
|
37
37
|
V1.prototype.constructor = V1;
|
|
38
38
|
|
|
39
39
|
Object.defineProperty(V1.prototype,
|
|
40
|
-
'
|
|
40
|
+
'forms', {
|
|
41
41
|
get: function() {
|
|
42
|
-
this.
|
|
43
|
-
return this.
|
|
42
|
+
this._forms = this._forms || new FormList(this);
|
|
43
|
+
return this._forms;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
Object.defineProperty(V1.prototype,
|
|
48
|
-
'
|
|
48
|
+
'services', {
|
|
49
49
|
get: function() {
|
|
50
|
-
this.
|
|
51
|
-
return this.
|
|
50
|
+
this._services = this._services || new ServiceList(this);
|
|
51
|
+
return this._services;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -10,7 +10,7 @@ import Response = require('../../../http/response');
|
|
|
10
10
|
import V1 = require('../V1');
|
|
11
11
|
import { SerializableClass } from '../../../interfaces';
|
|
12
12
|
|
|
13
|
-
type
|
|
13
|
+
type FormFormTypes = 'form-app-push'|'form-sms'|'form-totp';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @description Initialize the FormList
|
|
@@ -28,9 +28,9 @@ interface FormListInstance {
|
|
|
28
28
|
/**
|
|
29
29
|
* Constructs a form
|
|
30
30
|
*
|
|
31
|
-
* @param
|
|
31
|
+
* @param type - The Type of this Form
|
|
32
32
|
*/
|
|
33
|
-
get(
|
|
33
|
+
get(type: string): FormContext;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface FormPayload extends FormResource, Page.TwilioResponsePayload {
|
|
@@ -38,8 +38,8 @@ interface FormPayload extends FormResource, Page.TwilioResponsePayload {
|
|
|
38
38
|
|
|
39
39
|
interface FormResource {
|
|
40
40
|
form_meta: string;
|
|
41
|
-
form_type: FormFormType;
|
|
42
41
|
forms: string;
|
|
42
|
+
type: FormFormTypes;
|
|
43
43
|
url: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -52,9 +52,9 @@ declare class FormContext {
|
|
|
52
52
|
* Initialize the FormContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
53
53
|
*
|
|
54
54
|
* @param version - Version of the resource
|
|
55
|
-
* @param
|
|
55
|
+
* @param type - The Type of this Form
|
|
56
56
|
*/
|
|
57
|
-
constructor(version: V1,
|
|
57
|
+
constructor(version: V1, type: FormFormTypes);
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* fetch a FormInstance
|
|
@@ -69,16 +69,16 @@ declare class FormInstance extends SerializableClass {
|
|
|
69
69
|
/**
|
|
70
70
|
* Initialize the FormContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
71
71
|
*
|
|
72
|
-
* @property
|
|
73
|
-
* @property forms - Object that contains the available forms for this
|
|
74
|
-
* @property formMeta - Additional information for the available forms for this
|
|
75
|
-
* @property url - The URL to access the forms for this
|
|
72
|
+
* @property type - The Type of this Form
|
|
73
|
+
* @property forms - Object that contains the available forms for this type.
|
|
74
|
+
* @property formMeta - Additional information for the available forms for this type.
|
|
75
|
+
* @property url - The URL to access the forms for this type.
|
|
76
76
|
*
|
|
77
77
|
* @param version - Version of the resource
|
|
78
78
|
* @param payload - The instance payload
|
|
79
|
-
* @param
|
|
79
|
+
* @param type - The Type of this Form
|
|
80
80
|
*/
|
|
81
|
-
constructor(version: V1, payload: FormPayload,
|
|
81
|
+
constructor(version: V1, payload: FormPayload, type: FormFormTypes);
|
|
82
82
|
|
|
83
83
|
private _proxy: FormContext;
|
|
84
84
|
/**
|
|
@@ -88,13 +88,13 @@ declare class FormInstance extends SerializableClass {
|
|
|
88
88
|
*/
|
|
89
89
|
fetch(callback?: (error: Error | null, items: FormInstance) => any): void;
|
|
90
90
|
formMeta: string;
|
|
91
|
-
formType: FormFormType;
|
|
92
91
|
forms: string;
|
|
93
92
|
/**
|
|
94
93
|
* Produce a plain JSON object version of the FormInstance for serialization.
|
|
95
94
|
* Removes any circular references in the object.
|
|
96
95
|
*/
|
|
97
96
|
toJSON(): any;
|
|
97
|
+
type: FormFormTypes;
|
|
98
98
|
url: string;
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -46,13 +46,13 @@ FormList = function FormList(version) {
|
|
|
46
46
|
/**
|
|
47
47
|
* Constructs a form
|
|
48
48
|
*
|
|
49
|
-
* @param {string}
|
|
49
|
+
* @param {string} type - The Type of this Form
|
|
50
50
|
*
|
|
51
51
|
* @returns {Twilio.Authy.V1.FormContext}
|
|
52
52
|
*/
|
|
53
53
|
/* jshint ignore:end */
|
|
54
|
-
FormListInstance.get = function get(
|
|
55
|
-
return new FormContext(this._version,
|
|
54
|
+
FormListInstance.get = function get(type) {
|
|
55
|
+
return new FormContext(this._version, type);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
return FormListInstance;
|
|
@@ -98,37 +98,37 @@ FormPage.prototype.getInstance = function getInstance(payload) {
|
|
|
98
98
|
/**
|
|
99
99
|
* Initialize the FormContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
100
100
|
*
|
|
101
|
-
* @property {form.
|
|
101
|
+
* @property {form.form_types} type - The Type of this Form
|
|
102
102
|
* @property {string} forms -
|
|
103
|
-
* Object that contains the available forms for this
|
|
103
|
+
* Object that contains the available forms for this type.
|
|
104
104
|
* @property {string} formMeta -
|
|
105
|
-
* Additional information for the available forms for this
|
|
106
|
-
* @property {string} url - The URL to access the forms for this
|
|
105
|
+
* Additional information for the available forms for this type.
|
|
106
|
+
* @property {string} url - The URL to access the forms for this type.
|
|
107
107
|
*
|
|
108
108
|
* @param {V1} version - Version of the resource
|
|
109
109
|
* @param {FormPayload} payload - The instance payload
|
|
110
|
-
* @param {form:enum:
|
|
110
|
+
* @param {form:enum:form_types} type - The Type of this Form
|
|
111
111
|
*/
|
|
112
112
|
/* jshint ignore:end */
|
|
113
|
-
FormInstance = function FormInstance(version, payload,
|
|
113
|
+
FormInstance = function FormInstance(version, payload, type) {
|
|
114
114
|
this._version = version;
|
|
115
115
|
|
|
116
116
|
// Marshaled Properties
|
|
117
|
-
this.
|
|
117
|
+
this.type = payload.type; // jshint ignore:line
|
|
118
118
|
this.forms = payload.forms; // jshint ignore:line
|
|
119
119
|
this.formMeta = payload.form_meta; // jshint ignore:line
|
|
120
120
|
this.url = payload.url; // jshint ignore:line
|
|
121
121
|
|
|
122
122
|
// Context
|
|
123
123
|
this._context = undefined;
|
|
124
|
-
this._solution = {
|
|
124
|
+
this._solution = {type: type || this.type, };
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
Object.defineProperty(FormInstance.prototype,
|
|
128
128
|
'_proxy', {
|
|
129
129
|
get: function() {
|
|
130
130
|
if (!this._context) {
|
|
131
|
-
this._context = new FormContext(this._version, this._solution.
|
|
131
|
+
this._context = new FormContext(this._version, this._solution.type);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
return this._context;
|
|
@@ -172,16 +172,16 @@ FormInstance.prototype.toJSON = function toJSON() {
|
|
|
172
172
|
* Initialize the FormContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
173
173
|
*
|
|
174
174
|
* @param {V1} version - Version of the resource
|
|
175
|
-
* @param {form:enum:
|
|
175
|
+
* @param {form:enum:form_types} type - The Type of this Form
|
|
176
176
|
*/
|
|
177
177
|
/* jshint ignore:end */
|
|
178
|
-
FormContext = function FormContext(version,
|
|
178
|
+
FormContext = function FormContext(version, type) {
|
|
179
179
|
this._version = version;
|
|
180
180
|
|
|
181
181
|
// Path Solution
|
|
182
|
-
this._solution = {
|
|
182
|
+
this._solution = {type: type, };
|
|
183
183
|
this._uri = _.template(
|
|
184
|
-
'/Forms/<%=
|
|
184
|
+
'/Forms/<%= type %>' // jshint ignore:line
|
|
185
185
|
)(this._solution);
|
|
186
186
|
};
|
|
187
187
|
|
|
@@ -199,7 +199,7 @@ FormContext.prototype.fetch = function fetch(callback) {
|
|
|
199
199
|
var promise = this._version.fetch({uri: this._uri, method: 'GET'});
|
|
200
200
|
|
|
201
201
|
promise = promise.then(function(payload) {
|
|
202
|
-
deferred.resolve(new FormInstance(this._version, payload, this._solution.
|
|
202
|
+
deferred.resolve(new FormInstance(this._version, payload, this._solution.type));
|
|
203
203
|
}.bind(this));
|
|
204
204
|
|
|
205
205
|
promise.catch(function(error) {
|
|
@@ -11,9 +11,11 @@ import V1 = require('../../../../V1');
|
|
|
11
11
|
import serialize = require('../../../../../../base/serialize');
|
|
12
12
|
import { SerializableClass } from '../../../../../../interfaces';
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
type ChallengeChallengeReasons = 'none'|'not_needed'|'not_requested';
|
|
15
15
|
|
|
16
|
-
type
|
|
16
|
+
type ChallengeChallengeStatuses = 'pending'|'expired'|'approved'|'denied';
|
|
17
|
+
|
|
18
|
+
type ChallengeFactorTypes = 'app-push'|'sms'|'totp';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* @description Initialize the ChallengeList
|
|
@@ -82,13 +84,12 @@ interface ChallengeResource {
|
|
|
82
84
|
factor_sid: string;
|
|
83
85
|
hidden_details: string;
|
|
84
86
|
identity: string;
|
|
85
|
-
|
|
87
|
+
responded_reason: ChallengeChallengeReasons;
|
|
86
88
|
service_sid: string;
|
|
87
89
|
sid: string;
|
|
88
|
-
status:
|
|
89
|
-
type:
|
|
90
|
+
status: ChallengeChallengeStatuses;
|
|
91
|
+
type: ChallengeFactorTypes;
|
|
90
92
|
url: string;
|
|
91
|
-
verification_sid: string;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
interface ChallengeSolution {
|
|
@@ -146,12 +147,11 @@ declare class ChallengeInstance extends SerializableClass {
|
|
|
146
147
|
* @property dateUpdated - The date this Challenge was updated
|
|
147
148
|
* @property dateResponded - The date this Challenge was responded
|
|
148
149
|
* @property expirationDate - The date this Challenge is expired
|
|
149
|
-
* @property verificationSid - Verification Sid.
|
|
150
150
|
* @property status - The Status of this Challenge
|
|
151
|
-
* @property
|
|
151
|
+
* @property respondedReason - The Reason of this Challenge `status`
|
|
152
152
|
* @property details - Public details provided to contextualize the Challenge
|
|
153
153
|
* @property hiddenDetails - Hidden details provided to contextualize the Challenge
|
|
154
|
-
* @property type - The
|
|
154
|
+
* @property type - The Type of this Challenge
|
|
155
155
|
* @property url - The URL of this resource.
|
|
156
156
|
*
|
|
157
157
|
* @param version - Version of the resource
|
|
@@ -180,22 +180,22 @@ declare class ChallengeInstance extends SerializableClass {
|
|
|
180
180
|
fetch(callback?: (error: Error | null, items: ChallengeInstance) => any): void;
|
|
181
181
|
hiddenDetails: string;
|
|
182
182
|
identity: string;
|
|
183
|
-
reason: ChallengeChallengeReason;
|
|
184
183
|
/**
|
|
185
184
|
* remove a ChallengeInstance
|
|
186
185
|
*
|
|
187
186
|
* @param callback - Callback to handle processed record
|
|
188
187
|
*/
|
|
189
188
|
remove(callback?: (error: Error | null, items: ChallengeInstance) => any): void;
|
|
189
|
+
respondedReason: ChallengeChallengeReasons;
|
|
190
190
|
serviceSid: string;
|
|
191
191
|
sid: string;
|
|
192
|
-
status:
|
|
192
|
+
status: ChallengeChallengeStatuses;
|
|
193
193
|
/**
|
|
194
194
|
* Produce a plain JSON object version of the ChallengeInstance for serialization.
|
|
195
195
|
* Removes any circular references in the object.
|
|
196
196
|
*/
|
|
197
197
|
toJSON(): any;
|
|
198
|
-
type:
|
|
198
|
+
type: ChallengeFactorTypes;
|
|
199
199
|
/**
|
|
200
200
|
* update a ChallengeInstance
|
|
201
201
|
*
|
|
@@ -204,7 +204,6 @@ declare class ChallengeInstance extends SerializableClass {
|
|
|
204
204
|
*/
|
|
205
205
|
update(opts?: ChallengeInstanceUpdateOptions, callback?: (error: Error | null, items: ChallengeInstance) => any): void;
|
|
206
206
|
url: string;
|
|
207
|
-
verificationSid: string;
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
|
|
@@ -190,15 +190,14 @@ ChallengePage.prototype.getInstance = function getInstance(payload) {
|
|
|
190
190
|
* @property {Date} dateUpdated - The date this Challenge was updated
|
|
191
191
|
* @property {Date} dateResponded - The date this Challenge was responded
|
|
192
192
|
* @property {Date} expirationDate - The date this Challenge is expired
|
|
193
|
-
* @property {
|
|
194
|
-
* @property {challenge.
|
|
195
|
-
* @property {challenge.challenge_reason} reason -
|
|
193
|
+
* @property {challenge.challenge_statuses} status - The Status of this Challenge
|
|
194
|
+
* @property {challenge.challenge_reasons} respondedReason -
|
|
196
195
|
* The Reason of this Challenge `status`
|
|
197
196
|
* @property {string} details -
|
|
198
197
|
* Public details provided to contextualize the Challenge
|
|
199
198
|
* @property {string} hiddenDetails -
|
|
200
199
|
* Hidden details provided to contextualize the Challenge
|
|
201
|
-
* @property {
|
|
200
|
+
* @property {challenge.factor_types} type - The Type of this Challenge
|
|
202
201
|
* @property {string} url - The URL of this resource.
|
|
203
202
|
*
|
|
204
203
|
* @param {V1} version - Version of the resource
|
|
@@ -225,9 +224,8 @@ ChallengeInstance = function ChallengeInstance(version, payload, serviceSid,
|
|
|
225
224
|
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
|
|
226
225
|
this.dateResponded = deserialize.iso8601DateTime(payload.date_responded); // jshint ignore:line
|
|
227
226
|
this.expirationDate = deserialize.iso8601DateTime(payload.expiration_date); // jshint ignore:line
|
|
228
|
-
this.verificationSid = payload.verification_sid; // jshint ignore:line
|
|
229
227
|
this.status = payload.status; // jshint ignore:line
|
|
230
|
-
this.
|
|
228
|
+
this.respondedReason = payload.responded_reason; // jshint ignore:line
|
|
231
229
|
this.details = payload.details; // jshint ignore:line
|
|
232
230
|
this.hiddenDetails = payload.hidden_details; // jshint ignore:line
|
|
233
231
|
this.type = payload.type; // jshint ignore:line
|