twilio 3.70.0 → 3.72.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.
Files changed (60) hide show
  1. package/CHANGES.md +100 -0
  2. package/README.md +1 -1
  3. package/lib/jwt/ClientCapability.d.ts +1 -1
  4. package/lib/rest/Insights.d.ts +2 -0
  5. package/lib/rest/Insights.js +8 -0
  6. package/lib/rest/Supersim.d.ts +2 -0
  7. package/lib/rest/Supersim.js +8 -0
  8. package/lib/rest/Voice.d.ts +2 -0
  9. package/lib/rest/Voice.js +9 -0
  10. package/lib/rest/api/v2010/account/call.d.ts +1 -1
  11. package/lib/rest/api/v2010/account/call.js +1 -1
  12. package/lib/rest/api/v2010/account/message.d.ts +2 -0
  13. package/lib/rest/api/v2010/account/message.js +4 -1
  14. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +172 -0
  15. package/lib/rest/conversations/v1/service/configuration/webhook.js +400 -0
  16. package/lib/rest/conversations/v1/service/configuration.d.ts +2 -0
  17. package/lib/rest/conversations/v1/service/configuration.js +13 -0
  18. package/lib/rest/flexApi/v1/configuration.d.ts +4 -0
  19. package/lib/rest/flexApi/v1/configuration.js +5 -0
  20. package/lib/rest/frontlineApi/v1/user.d.ts +4 -0
  21. package/lib/rest/frontlineApi/v1/user.js +10 -1
  22. package/lib/rest/insights/V1.d.ts +3 -0
  23. package/lib/rest/insights/V1.js +11 -0
  24. package/lib/rest/insights/v1/setting.d.ts +181 -0
  25. package/lib/rest/insights/v1/setting.js +384 -0
  26. package/lib/rest/media/v1/mediaProcessor.d.ts +4 -0
  27. package/lib/rest/media/v1/mediaProcessor.js +5 -1
  28. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +46 -2
  29. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +139 -5
  30. package/lib/rest/messaging/v1/brandRegistration.d.ts +1 -1
  31. package/lib/rest/messaging/v1/brandRegistration.js +1 -1
  32. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  33. package/lib/rest/supersim/V1.d.ts +3 -0
  34. package/lib/rest/supersim/V1.js +11 -0
  35. package/lib/rest/supersim/v1/ipCommand.d.ts +362 -0
  36. package/lib/rest/supersim/v1/ipCommand.js +679 -0
  37. package/lib/rest/verify/v2/service/accessToken.d.ts +2 -0
  38. package/lib/rest/verify/v2/service/accessToken.js +3 -1
  39. package/lib/rest/verify/v2/service/entity/factor.d.ts +4 -2
  40. package/lib/rest/verify/v2/service/entity/factor.js +8 -3
  41. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +2 -2
  42. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  43. package/lib/rest/verify/v2/service/verification.d.ts +4 -0
  44. package/lib/rest/verify/v2/service/verification.js +6 -1
  45. package/lib/rest/verify/v2/service.d.ts +6 -0
  46. package/lib/rest/verify/v2/service.js +12 -2
  47. package/lib/rest/verify/v2/verificationAttempt.d.ts +1 -1
  48. package/lib/rest/video/v1/room.d.ts +12 -0
  49. package/lib/rest/video/v1/room.js +19 -1
  50. package/lib/rest/voice/V1.d.ts +3 -0
  51. package/lib/rest/voice/V1.js +12 -0
  52. package/lib/rest/voice/v1/archivedCall.d.ts +136 -0
  53. package/lib/rest/voice/v1/archivedCall.js +325 -0
  54. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  55. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  56. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  57. package/lib/rest/wireless/v1/sim.js +17 -27
  58. package/lib/twiml/VoiceResponse.d.ts +1296 -24
  59. package/lib/twiml/VoiceResponse.js +2170 -82
  60. package/package.json +1 -1
@@ -0,0 +1,325 @@
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 deserialize = require(
17
+ '../../../base/deserialize'); /* jshint ignore:line */
18
+
19
+ var ArchivedCallList;
20
+ var ArchivedCallPage;
21
+ var ArchivedCallInstance;
22
+ var ArchivedCallContext;
23
+
24
+ /* jshint ignore:start */
25
+ /**
26
+ * Initialize the ArchivedCallList
27
+ *
28
+ * PLEASE NOTE that this class contains beta products that are subject to change.
29
+ * Use them with caution.
30
+ *
31
+ * @constructor Twilio.Voice.V1.ArchivedCallList
32
+ *
33
+ * @param {Twilio.Voice.V1} version - Version of the resource
34
+ */
35
+ /* jshint ignore:end */
36
+ ArchivedCallList = function ArchivedCallList(version) {
37
+ /* jshint ignore:start */
38
+ /**
39
+ * @function archivedCalls
40
+ * @memberof Twilio.Voice.V1#
41
+ *
42
+ * @param {string} sid - sid of instance
43
+ *
44
+ * @returns {Twilio.Voice.V1.ArchivedCallContext}
45
+ */
46
+ /* jshint ignore:end */
47
+ function ArchivedCallListInstance(sid) {
48
+ return ArchivedCallListInstance.get(sid);
49
+ }
50
+
51
+ ArchivedCallListInstance._version = version;
52
+ // Path Solution
53
+ ArchivedCallListInstance._solution = {};
54
+ /* jshint ignore:start */
55
+ /**
56
+ * Constructs a archived_call
57
+ *
58
+ * @function get
59
+ * @memberof Twilio.Voice.V1.ArchivedCallList#
60
+ *
61
+ * @param {string} date - The date of the Call in UTC.
62
+ * @param {string} sid - The unique string that identifies this resource
63
+ *
64
+ * @returns {Twilio.Voice.V1.ArchivedCallContext}
65
+ */
66
+ /* jshint ignore:end */
67
+ ArchivedCallListInstance.get = function get(date, sid) {
68
+ return new ArchivedCallContext(this._version, date, sid);
69
+ };
70
+
71
+ /* jshint ignore:start */
72
+ /**
73
+ * Provide a user-friendly representation
74
+ *
75
+ * @function toJSON
76
+ * @memberof Twilio.Voice.V1.ArchivedCallList#
77
+ *
78
+ * @returns Object
79
+ */
80
+ /* jshint ignore:end */
81
+ ArchivedCallListInstance.toJSON = function toJSON() {
82
+ return this._solution;
83
+ };
84
+
85
+ ArchivedCallListInstance[util.inspect.custom] = function inspect(depth, options)
86
+ {
87
+ return util.inspect(this.toJSON(), options);
88
+ };
89
+
90
+ return ArchivedCallListInstance;
91
+ };
92
+
93
+
94
+ /* jshint ignore:start */
95
+ /**
96
+ * Initialize the ArchivedCallPage
97
+ *
98
+ * PLEASE NOTE that this class contains beta products that are subject to change.
99
+ * Use them with caution.
100
+ *
101
+ * @constructor Twilio.Voice.V1.ArchivedCallPage
102
+ *
103
+ * @param {V1} version - Version of the resource
104
+ * @param {Response<string>} response - Response from the API
105
+ * @param {ArchivedCallSolution} solution - Path solution
106
+ *
107
+ * @returns ArchivedCallPage
108
+ */
109
+ /* jshint ignore:end */
110
+ ArchivedCallPage = function ArchivedCallPage(version, response, solution) {
111
+ // Path Solution
112
+ this._solution = solution;
113
+
114
+ Page.prototype.constructor.call(this, version, response, this._solution);
115
+ };
116
+
117
+ _.extend(ArchivedCallPage.prototype, Page.prototype);
118
+ ArchivedCallPage.prototype.constructor = ArchivedCallPage;
119
+
120
+ /* jshint ignore:start */
121
+ /**
122
+ * Build an instance of ArchivedCallInstance
123
+ *
124
+ * @function getInstance
125
+ * @memberof Twilio.Voice.V1.ArchivedCallPage#
126
+ *
127
+ * @param {ArchivedCallPayload} payload - Payload response from the API
128
+ *
129
+ * @returns ArchivedCallInstance
130
+ */
131
+ /* jshint ignore:end */
132
+ ArchivedCallPage.prototype.getInstance = function getInstance(payload) {
133
+ return new ArchivedCallInstance(this._version, payload);
134
+ };
135
+
136
+ /* jshint ignore:start */
137
+ /**
138
+ * Provide a user-friendly representation
139
+ *
140
+ * @function toJSON
141
+ * @memberof Twilio.Voice.V1.ArchivedCallPage#
142
+ *
143
+ * @returns Object
144
+ */
145
+ /* jshint ignore:end */
146
+ ArchivedCallPage.prototype.toJSON = function toJSON() {
147
+ let clone = {};
148
+ _.forOwn(this, function(value, key) {
149
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
150
+ clone[key] = value;
151
+ }
152
+ });
153
+ return clone;
154
+ };
155
+
156
+ ArchivedCallPage.prototype[util.inspect.custom] = function inspect(depth,
157
+ options) {
158
+ return util.inspect(this.toJSON(), options);
159
+ };
160
+
161
+
162
+ /* jshint ignore:start */
163
+ /**
164
+ * Initialize the ArchivedCallContext
165
+ *
166
+ * PLEASE NOTE that this class contains beta products that are subject to change.
167
+ * Use them with caution.
168
+ *
169
+ * @constructor Twilio.Voice.V1.ArchivedCallInstance
170
+ *
171
+ * @property {Date} date - date
172
+ * @property {string} sid - sid
173
+ * @property {string} url - The absolute URL of the resource
174
+ *
175
+ * @param {V1} version - Version of the resource
176
+ * @param {ArchivedCallPayload} payload - The instance payload
177
+ * @param {date} date - The date of the Call in UTC.
178
+ * @param {sid} sid - The unique string that identifies this resource
179
+ */
180
+ /* jshint ignore:end */
181
+ ArchivedCallInstance = function ArchivedCallInstance(version, payload, date,
182
+ sid) {
183
+ this._version = version;
184
+
185
+ // Marshaled Properties
186
+ this.date = deserialize.iso8601Date(payload.date); // jshint ignore:line
187
+ this.sid = payload.sid; // jshint ignore:line
188
+ this.url = payload.url; // jshint ignore:line
189
+
190
+ // Context
191
+ this._context = undefined;
192
+ this._solution = {date: date || this.date, sid: sid || this.sid, };
193
+ };
194
+
195
+ Object.defineProperty(ArchivedCallInstance.prototype,
196
+ '_proxy', {
197
+ get: function() {
198
+ if (!this._context) {
199
+ this._context = new ArchivedCallContext(this._version, this._solution.date, this._solution.sid);
200
+ }
201
+
202
+ return this._context;
203
+ }
204
+ });
205
+
206
+ /* jshint ignore:start */
207
+ /**
208
+ * remove a ArchivedCallInstance
209
+ *
210
+ * @function remove
211
+ * @memberof Twilio.Voice.V1.ArchivedCallInstance#
212
+ *
213
+ * @param {function} [callback] - Callback to handle processed record
214
+ *
215
+ * @returns {Promise} Resolves to processed ArchivedCallInstance
216
+ */
217
+ /* jshint ignore:end */
218
+ ArchivedCallInstance.prototype.remove = function remove(callback) {
219
+ return this._proxy.remove(callback);
220
+ };
221
+
222
+ /* jshint ignore:start */
223
+ /**
224
+ * Provide a user-friendly representation
225
+ *
226
+ * @function toJSON
227
+ * @memberof Twilio.Voice.V1.ArchivedCallInstance#
228
+ *
229
+ * @returns Object
230
+ */
231
+ /* jshint ignore:end */
232
+ ArchivedCallInstance.prototype.toJSON = function toJSON() {
233
+ let clone = {};
234
+ _.forOwn(this, function(value, key) {
235
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
236
+ clone[key] = value;
237
+ }
238
+ });
239
+ return clone;
240
+ };
241
+
242
+ ArchivedCallInstance.prototype[util.inspect.custom] = function inspect(depth,
243
+ options) {
244
+ return util.inspect(this.toJSON(), options);
245
+ };
246
+
247
+
248
+ /* jshint ignore:start */
249
+ /**
250
+ * Initialize the ArchivedCallContext
251
+ *
252
+ * PLEASE NOTE that this class contains beta products that are subject to change.
253
+ * Use them with caution.
254
+ *
255
+ * @constructor Twilio.Voice.V1.ArchivedCallContext
256
+ *
257
+ * @param {V1} version - Version of the resource
258
+ * @param {date} date - The date of the Call in UTC.
259
+ * @param {sid} sid - The unique string that identifies this resource
260
+ */
261
+ /* jshint ignore:end */
262
+ ArchivedCallContext = function ArchivedCallContext(version, date, sid) {
263
+ this._version = version;
264
+
265
+ // Path Solution
266
+ this._solution = {date: date, sid: sid, };
267
+ this._uri = `/Archives/${date}/Calls/${sid}`;
268
+ };
269
+
270
+ /* jshint ignore:start */
271
+ /**
272
+ * remove a ArchivedCallInstance
273
+ *
274
+ * @function remove
275
+ * @memberof Twilio.Voice.V1.ArchivedCallContext#
276
+ *
277
+ * @param {function} [callback] - Callback to handle processed record
278
+ *
279
+ * @returns {Promise} Resolves to processed ArchivedCallInstance
280
+ */
281
+ /* jshint ignore:end */
282
+ ArchivedCallContext.prototype.remove = function remove(callback) {
283
+ var deferred = Q.defer();
284
+ var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
285
+
286
+ promise = promise.then(function(payload) {
287
+ deferred.resolve(payload);
288
+ }.bind(this));
289
+
290
+ promise.catch(function(error) {
291
+ deferred.reject(error);
292
+ });
293
+
294
+ if (_.isFunction(callback)) {
295
+ deferred.promise.nodeify(callback);
296
+ }
297
+
298
+ return deferred.promise;
299
+ };
300
+
301
+ /* jshint ignore:start */
302
+ /**
303
+ * Provide a user-friendly representation
304
+ *
305
+ * @function toJSON
306
+ * @memberof Twilio.Voice.V1.ArchivedCallContext#
307
+ *
308
+ * @returns Object
309
+ */
310
+ /* jshint ignore:end */
311
+ ArchivedCallContext.prototype.toJSON = function toJSON() {
312
+ return this._solution;
313
+ };
314
+
315
+ ArchivedCallContext.prototype[util.inspect.custom] = function inspect(depth,
316
+ options) {
317
+ return util.inspect(this.toJSON(), options);
318
+ };
319
+
320
+ module.exports = {
321
+ ArchivedCallList: ArchivedCallList,
322
+ ArchivedCallPage: ArchivedCallPage,
323
+ ArchivedCallInstance: ArchivedCallInstance,
324
+ ArchivedCallContext: ArchivedCallContext
325
+ };
@@ -169,7 +169,7 @@ interface RatePlanListInstance {
169
169
  * @property nationalRoamingDataLimit - The total data usage in Megabytes that the Network allows during one month on non-home networks in the United States
170
170
  * @property nationalRoamingEnabled - Whether SIMs can roam on networks other than the home network in the United States
171
171
  * @property uniqueName - An application-defined string that uniquely identifies the resource
172
- * @property voiceEnabled - Whether SIMs can make and receive voice calls
172
+ * @property voiceEnabled - Deprecated
173
173
  */
174
174
  interface RatePlanListInstanceCreateOptions {
175
175
  dataEnabled?: boolean;
@@ -311,8 +311,7 @@ RatePlanList = function RatePlanList(version) {
311
311
  * @param {string} [opts.dataMetering] - The model used to meter data usage
312
312
  * @param {boolean} [opts.messagingEnabled] -
313
313
  * Whether SIMs can make, send, and receive SMS using Commands
314
- * @param {boolean} [opts.voiceEnabled] -
315
- * Whether SIMs can make and receive voice calls
314
+ * @param {boolean} [opts.voiceEnabled] - Deprecated
316
315
  * @param {boolean} [opts.nationalRoamingEnabled] -
317
316
  * Whether SIMs can roam on networks other than the home network in the United States
318
317
  * @param {string|list} [opts.internationalRoaming] -
@@ -486,7 +485,8 @@ RatePlanPage.prototype[util.inspect.custom] = function inspect(depth, options) {
486
485
  * The total data usage in Megabytes that the Network allows during one month on the home network
487
486
  * @property {boolean} messagingEnabled -
488
487
  * Whether SIMs can make, send, and receive SMS using Commands
489
- * @property {boolean} voiceEnabled - Whether SIMs can make and receive voice calls
488
+ * @property {boolean} voiceEnabled -
489
+ * Deprecated. Whether SIMs can make and receive voice calls
490
490
  * @property {boolean} nationalRoamingEnabled -
491
491
  * Whether SIMs can roam on networks other than the home network in the United States
492
492
  * @property {number} nationalRoamingDataLimit -
@@ -42,10 +42,10 @@ declare function SimList(version: V1): SimListInstance;
42
42
  * @property smsUrl - The URL we should call when the SIM-connected device sends an SMS message that is not a Command
43
43
  * @property status - The new status of the Sim resource
44
44
  * @property uniqueName - An application-defined string that uniquely identifies the resource
45
- * @property voiceFallbackMethod - The HTTP method we should use to call voice_fallback_url
46
- * @property voiceFallbackUrl - The URL we should call when an error occurs while retrieving or executing the TwiML requested from voice_url
47
- * @property voiceMethod - The HTTP method we should use when we call voice_url
48
- * @property voiceUrl - The URL we should call when the SIM-connected device makes a voice call
45
+ * @property voiceFallbackMethod - Deprecated
46
+ * @property voiceFallbackUrl - Deprecated
47
+ * @property voiceMethod - Deprecated
48
+ * @property voiceUrl - Deprecated
49
49
  */
50
50
  interface SimInstanceUpdateOptions {
51
51
  accountSid?: string;
@@ -446,20 +446,18 @@ SimPage.prototype[util.inspect.custom] = function inspect(depth, options) {
446
446
  * The URL we call when the SIM originates a machine-to-machine Command
447
447
  * @property {string} commandsCallbackMethod -
448
448
  * The HTTP method we use to call commands_callback_url
449
- * @property {string} smsFallbackMethod -
450
- * The HTTP method we use to call sms_fallback_url
451
- * @property {string} smsFallbackUrl -
452
- * The URL we call when an error occurs while retrieving or executing the TwiML requested from the sms_url
453
- * @property {string} smsMethod - The HTTP method we use to call sms_url
454
- * @property {string} smsUrl -
455
- * The URL we call when the SIM-connected device sends an SMS message that is not a Command
449
+ * @property {string} smsFallbackMethod - Deprecated
450
+ * @property {string} smsFallbackUrl - Deprecated
451
+ * @property {string} smsMethod - Deprecated
452
+ * @property {string} smsUrl - Deprecated
456
453
  * @property {string} voiceFallbackMethod -
457
- * The HTTP method we use to call voice_fallback_url
454
+ * Deprecated. The HTTP method we use to call voice_fallback_url
458
455
  * @property {string} voiceFallbackUrl -
459
- * The URL we call when an error occurs while retrieving or executing the TwiML requested from voice_url
460
- * @property {string} voiceMethod - The HTTP method we use to call voice_url
456
+ * Deprecated. The URL we call when an error occurs while retrieving or executing the TwiML requested from voice_url
457
+ * @property {string} voiceMethod -
458
+ * Deprecated. The HTTP method we use to call voice_url
461
459
  * @property {string} voiceUrl -
462
- * The URL we call when the SIM-connected device makes a voice call
460
+ * Deprecated. The URL we call when the SIM-connected device makes a voice call
463
461
  * @property {Date} dateCreated -
464
462
  * The ISO 8601 date and time in GMT when the resource was created
465
463
  * @property {Date} dateUpdated -
@@ -563,14 +561,10 @@ SimInstance.prototype.fetch = function fetch(callback) {
563
561
  * @param {string} [opts.smsMethod] - The HTTP method we should use to call sms_url
564
562
  * @param {string} [opts.smsUrl] -
565
563
  * The URL we should call when the SIM-connected device sends an SMS message that is not a Command
566
- * @param {string} [opts.voiceFallbackMethod] -
567
- * The HTTP method we should use to call voice_fallback_url
568
- * @param {string} [opts.voiceFallbackUrl] -
569
- * The URL we should call when an error occurs while retrieving or executing the TwiML requested from voice_url
570
- * @param {string} [opts.voiceMethod] -
571
- * The HTTP method we should use when we call voice_url
572
- * @param {string} [opts.voiceUrl] -
573
- * The URL we should call when the SIM-connected device makes a voice call
564
+ * @param {string} [opts.voiceFallbackMethod] - Deprecated
565
+ * @param {string} [opts.voiceFallbackUrl] - Deprecated
566
+ * @param {string} [opts.voiceMethod] - Deprecated
567
+ * @param {string} [opts.voiceUrl] - Deprecated
574
568
  * @param {sim.reset_status} [opts.resetStatus] -
575
569
  * Initiate a connectivity reset on a SIM
576
570
  * @param {string} [opts.accountSid] -
@@ -740,14 +734,10 @@ SimContext.prototype.fetch = function fetch(callback) {
740
734
  * @param {string} [opts.smsMethod] - The HTTP method we should use to call sms_url
741
735
  * @param {string} [opts.smsUrl] -
742
736
  * The URL we should call when the SIM-connected device sends an SMS message that is not a Command
743
- * @param {string} [opts.voiceFallbackMethod] -
744
- * The HTTP method we should use to call voice_fallback_url
745
- * @param {string} [opts.voiceFallbackUrl] -
746
- * The URL we should call when an error occurs while retrieving or executing the TwiML requested from voice_url
747
- * @param {string} [opts.voiceMethod] -
748
- * The HTTP method we should use when we call voice_url
749
- * @param {string} [opts.voiceUrl] -
750
- * The URL we should call when the SIM-connected device makes a voice call
737
+ * @param {string} [opts.voiceFallbackMethod] - Deprecated
738
+ * @param {string} [opts.voiceFallbackUrl] - Deprecated
739
+ * @param {string} [opts.voiceMethod] - Deprecated
740
+ * @param {string} [opts.voiceUrl] - Deprecated
751
741
  * @param {sim.reset_status} [opts.resetStatus] -
752
742
  * Initiate a connectivity reset on a SIM
753
743
  * @param {string} [opts.accountSid] -