twilio 3.68.0 → 3.71.2

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 (85) hide show
  1. package/CHANGES.md +104 -0
  2. package/README.md +1 -1
  3. package/lib/jwt/AccessToken.d.ts +16 -0
  4. package/lib/jwt/AccessToken.js +20 -0
  5. package/lib/jwt/ClientCapability.d.ts +1 -1
  6. package/lib/rest/Media.d.ts +28 -0
  7. package/lib/rest/Media.js +64 -0
  8. package/lib/rest/Twilio.d.ts +2 -0
  9. package/lib/rest/Twilio.js +14 -0
  10. package/lib/rest/Verify.d.ts +2 -2
  11. package/lib/rest/Verify.js +3 -4
  12. package/lib/rest/api/v2010/account/call/siprec.d.ts +776 -0
  13. package/lib/rest/api/v2010/account/call/siprec.js +811 -0
  14. package/lib/rest/api/v2010/account/call.d.ts +8 -1
  15. package/lib/rest/api/v2010/account/call.js +29 -1
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -2
  17. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +5 -2
  18. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -2
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +5 -2
  20. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -2
  21. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +5 -2
  22. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +7 -3
  23. package/lib/rest/api/v2010/account/incomingPhoneNumber.js +7 -4
  24. package/lib/rest/conversations/v1/service/configuration/notification.d.ts +6 -0
  25. package/lib/rest/conversations/v1/service/configuration/notification.js +11 -1
  26. package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
  27. package/lib/rest/flexApi/v1/configuration.js +2 -0
  28. package/lib/rest/frontlineApi/v1/user.d.ts +4 -0
  29. package/lib/rest/frontlineApi/v1/user.js +10 -1
  30. package/lib/rest/insights/v1/callSummaries.d.ts +27 -27
  31. package/lib/rest/insights/v1/callSummaries.js +36 -36
  32. package/lib/rest/media/V1.d.ts +28 -0
  33. package/lib/rest/media/V1.js +59 -0
  34. package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
  35. package/lib/rest/media/v1/mediaProcessor.js +702 -0
  36. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
  37. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
  38. package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
  39. package/lib/rest/media/v1/playerStreamer.js +729 -0
  40. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +330 -0
  41. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +655 -0
  42. package/lib/rest/messaging/v1/brandRegistration.d.ts +15 -2
  43. package/lib/rest/messaging/v1/brandRegistration.js +37 -1
  44. package/lib/rest/messaging/v1/service.d.ts +8 -0
  45. package/lib/rest/messaging/v1/service.js +14 -0
  46. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +133 -0
  47. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +268 -0
  48. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +127 -0
  49. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +271 -0
  50. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +14 -0
  51. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +56 -0
  52. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  53. package/lib/rest/serverless/v1/service/environment.js +1 -1
  54. package/lib/rest/serverless/v1/service.d.ts +2 -0
  55. package/lib/rest/serverless/v1/service.js +3 -0
  56. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
  57. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
  58. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
  59. package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
  60. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
  61. package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
  62. package/lib/rest/trunking/v1/trunk.d.ts +9 -1
  63. package/lib/rest/trunking/v1/trunk.js +13 -2
  64. package/lib/rest/verify/V2.d.ts +3 -3
  65. package/lib/rest/verify/V2.js +6 -8
  66. package/lib/rest/verify/v2/service/entity/factor.d.ts +4 -2
  67. package/lib/rest/verify/v2/service/entity/factor.js +8 -3
  68. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +2 -2
  69. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  70. package/lib/rest/verify/v2/service/verification.d.ts +5 -1
  71. package/lib/rest/verify/v2/service/verification.js +7 -2
  72. package/lib/rest/verify/v2/service.d.ts +6 -0
  73. package/lib/rest/verify/v2/service.js +12 -2
  74. package/lib/rest/verify/v2/{verificationTemplate.d.ts → template.d.ts} +35 -37
  75. package/lib/rest/verify/v2/{verificationTemplate.js → template.js} +58 -64
  76. package/lib/rest/verify/v2/verificationAttempt.d.ts +1 -1
  77. package/lib/rest/video/v1/room.d.ts +4 -0
  78. package/lib/rest/video/v1/room.js +7 -1
  79. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  80. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  81. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  82. package/lib/rest/wireless/v1/sim.js +18 -24
  83. package/lib/twiml/VoiceResponse.d.ts +1296 -24
  84. package/lib/twiml/VoiceResponse.js +2170 -82
  85. package/package.json +2 -2
@@ -29,18 +29,29 @@ import { WorkersStatisticsListInstance } from './worker/workersStatistics';
29
29
  */
30
30
  declare function WorkerList(version: V1, workspaceSid: string): WorkerListInstance;
31
31
 
32
+ /**
33
+ * Options to pass to remove
34
+ *
35
+ * @property ifMatch - The If-Match HTTP request header
36
+ */
37
+ interface WorkerInstanceRemoveOptions {
38
+ ifMatch?: string;
39
+ }
40
+
32
41
  /**
33
42
  * Options to pass to update
34
43
  *
35
44
  * @property activitySid - The SID of the Activity that describes the Worker's initial state
36
45
  * @property attributes - The JSON string that describes the Worker
37
46
  * @property friendlyName - A string to describe the Worker
38
- * @property rejectPendingReservations - Whether to reject pending reservations
47
+ * @property ifMatch - The If-Match HTTP request header
48
+ * @property rejectPendingReservations - Whether to reject the Worker's pending reservations
39
49
  */
40
50
  interface WorkerInstanceUpdateOptions {
41
51
  activitySid?: string;
42
52
  attributes?: string;
43
53
  friendlyName?: string;
54
+ ifMatch?: string;
44
55
  rejectPendingReservations?: boolean;
45
56
  }
46
57
 
@@ -325,6 +336,13 @@ declare class WorkerContext {
325
336
  * @param callback - Callback to handle processed record
326
337
  */
327
338
  remove(callback?: (error: Error | null, items: WorkerInstance) => any): Promise<boolean>;
339
+ /**
340
+ * remove a WorkerInstance
341
+ *
342
+ * @param opts - Options for request
343
+ * @param callback - Callback to handle processed record
344
+ */
345
+ remove(opts?: WorkerInstanceRemoveOptions, callback?: (error: Error | null, items: WorkerInstance) => any): Promise<boolean>;
328
346
  reservations: ReservationListInstance;
329
347
  statistics: WorkerStatisticsListInstance;
330
348
  /**
@@ -390,6 +408,13 @@ declare class WorkerInstance extends SerializableClass {
390
408
  * @param callback - Callback to handle processed record
391
409
  */
392
410
  remove(callback?: (error: Error | null, items: WorkerInstance) => any): Promise<boolean>;
411
+ /**
412
+ * remove a WorkerInstance
413
+ *
414
+ * @param opts - Options for request
415
+ * @param callback - Callback to handle processed record
416
+ */
417
+ remove(opts?: WorkerInstanceRemoveOptions, callback?: (error: Error | null, items: WorkerInstance) => any): Promise<boolean>;
393
418
  /**
394
419
  * Access the reservations
395
420
  */
@@ -447,4 +472,4 @@ declare class WorkerPage extends Page<V1, WorkerPayload, WorkerResource, WorkerI
447
472
  toJSON(): any;
448
473
  }
449
474
 
450
- export { WorkerContext, WorkerInstance, WorkerInstanceUpdateOptions, WorkerList, WorkerListInstance, WorkerListInstanceCreateOptions, WorkerListInstanceEachOptions, WorkerListInstanceOptions, WorkerListInstancePageOptions, WorkerPage, WorkerPayload, WorkerResource, WorkerSolution }
475
+ export { WorkerContext, WorkerInstance, WorkerInstanceRemoveOptions, WorkerInstanceUpdateOptions, WorkerList, WorkerListInstance, WorkerListInstanceCreateOptions, WorkerListInstanceEachOptions, WorkerListInstanceOptions, WorkerListInstancePageOptions, WorkerPage, WorkerPayload, WorkerResource, WorkerSolution }
@@ -620,7 +620,8 @@ WorkerInstance.prototype.fetch = function fetch(callback) {
620
620
  * @param {string} [opts.attributes] - The JSON string that describes the Worker
621
621
  * @param {string} [opts.friendlyName] - A string to describe the Worker
622
622
  * @param {boolean} [opts.rejectPendingReservations] -
623
- * Whether to reject pending reservations
623
+ * Whether to reject the Worker's pending reservations
624
+ * @param {string} [opts.ifMatch] - The If-Match HTTP request header
624
625
  * @param {function} [callback] - Callback to handle processed record
625
626
  *
626
627
  * @returns {Promise} Resolves to processed WorkerInstance
@@ -637,13 +638,15 @@ WorkerInstance.prototype.update = function update(opts, callback) {
637
638
  * @function remove
638
639
  * @memberof Twilio.Taskrouter.V1.WorkspaceContext.WorkerInstance#
639
640
  *
641
+ * @param {object} [opts] - Options for request
642
+ * @param {string} [opts.ifMatch] - The If-Match HTTP request header
640
643
  * @param {function} [callback] - Callback to handle processed record
641
644
  *
642
645
  * @returns {Promise} Resolves to processed WorkerInstance
643
646
  */
644
647
  /* jshint ignore:end */
645
- WorkerInstance.prototype.remove = function remove(callback) {
646
- return this._proxy.remove(callback);
648
+ WorkerInstance.prototype.remove = function remove(opts, callback) {
649
+ return this._proxy.remove(opts, callback);
647
650
  };
648
651
 
649
652
  /* jshint ignore:start */
@@ -829,7 +832,8 @@ WorkerContext.prototype.fetch = function fetch(callback) {
829
832
  * @param {string} [opts.attributes] - The JSON string that describes the Worker
830
833
  * @param {string} [opts.friendlyName] - A string to describe the Worker
831
834
  * @param {boolean} [opts.rejectPendingReservations] -
832
- * Whether to reject pending reservations
835
+ * Whether to reject the Worker's pending reservations
836
+ * @param {string} [opts.ifMatch] - The If-Match HTTP request header
833
837
  * @param {function} [callback] - Callback to handle processed record
834
838
  *
835
839
  * @returns {Promise} Resolves to processed WorkerInstance
@@ -849,8 +853,9 @@ WorkerContext.prototype.update = function update(opts, callback) {
849
853
  'FriendlyName': _.get(opts, 'friendlyName'),
850
854
  'RejectPendingReservations': serialize.bool(_.get(opts, 'rejectPendingReservations'))
851
855
  });
856
+ var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});
852
857
 
853
- var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
858
+ var promise = this._version.update({uri: this._uri, method: 'POST', data: data, headers: headers});
854
859
 
855
860
  promise = promise.then(function(payload) {
856
861
  deferred.resolve(new WorkerInstance(
@@ -879,14 +884,24 @@ WorkerContext.prototype.update = function update(opts, callback) {
879
884
  * @function remove
880
885
  * @memberof Twilio.Taskrouter.V1.WorkspaceContext.WorkerContext#
881
886
  *
887
+ * @param {object} [opts] - Options for request
888
+ * @param {string} [opts.ifMatch] - The If-Match HTTP request header
882
889
  * @param {function} [callback] - Callback to handle processed record
883
890
  *
884
891
  * @returns {Promise} Resolves to processed WorkerInstance
885
892
  */
886
893
  /* jshint ignore:end */
887
- WorkerContext.prototype.remove = function remove(callback) {
894
+ WorkerContext.prototype.remove = function remove(opts, callback) {
895
+ if (_.isFunction(opts)) {
896
+ callback = opts;
897
+ opts = {};
898
+ }
899
+ opts = opts || {};
900
+
888
901
  var deferred = Q.defer();
889
- var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
902
+ var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});
903
+
904
+ var promise = this._version.remove({uri: this._uri, method: 'DELETE', headers: headers});
890
905
 
891
906
  promise = promise.then(function(payload) {
892
907
  deferred.resolve(payload);
@@ -20,6 +20,8 @@ import { RecordingList } from './trunk/recording';
20
20
  import { RecordingListInstance } from './trunk/recording';
21
21
  import { SerializableClass } from '../../../interfaces';
22
22
 
23
+ type TrunkTransferCallerId = 'from-transferee'|'from-transferor';
24
+
23
25
  type TrunkTransferSetting = 'disable-all'|'enable-all'|'sip-only';
24
26
 
25
27
  /**
@@ -38,6 +40,7 @@ declare function TrunkList(version: V1): TrunkListInstance;
38
40
  * @property domainName - The unique address you reserve on Twilio to which you route your SIP traffic
39
41
  * @property friendlyName - A string to describe the resource
40
42
  * @property secure - Whether Secure Trunking is enabled for the trunk
43
+ * @property transferCallerId - Caller Id for transfer target
41
44
  * @property transferMode - The call transfer settings for the trunk
42
45
  */
43
46
  interface TrunkInstanceUpdateOptions {
@@ -47,6 +50,7 @@ interface TrunkInstanceUpdateOptions {
47
50
  domainName?: string;
48
51
  friendlyName?: string;
49
52
  secure?: boolean;
53
+ transferCallerId?: TrunkTransferCallerId;
50
54
  transferMode?: TrunkTransferSetting;
51
55
  }
52
56
 
@@ -185,6 +189,7 @@ interface TrunkListInstance {
185
189
  * @property domainName - The unique address you reserve on Twilio to which you route your SIP traffic
186
190
  * @property friendlyName - A string to describe the resource
187
191
  * @property secure - Whether Secure Trunking is enabled for the trunk
192
+ * @property transferCallerId - Caller Id for transfer target
188
193
  * @property transferMode - The call transfer settings for the trunk
189
194
  */
190
195
  interface TrunkListInstanceCreateOptions {
@@ -194,6 +199,7 @@ interface TrunkListInstanceCreateOptions {
194
199
  domainName?: string;
195
200
  friendlyName?: string;
196
201
  secure?: boolean;
202
+ transferCallerId?: TrunkTransferCallerId;
197
203
  transferMode?: TrunkTransferSetting;
198
204
  }
199
205
 
@@ -272,6 +278,7 @@ interface TrunkResource {
272
278
  recording: object;
273
279
  secure: boolean;
274
280
  sid: string;
281
+ transfer_caller_id: TrunkTransferCallerId;
275
282
  transfer_mode: TrunkTransferSetting;
276
283
  url: string;
277
284
  }
@@ -387,6 +394,7 @@ declare class TrunkInstance extends SerializableClass {
387
394
  * Provide a user-friendly representation
388
395
  */
389
396
  toJSON(): any;
397
+ transferCallerId: TrunkTransferCallerId;
390
398
  transferMode: TrunkTransferSetting;
391
399
  /**
392
400
  * update a TrunkInstance
@@ -427,4 +435,4 @@ declare class TrunkPage extends Page<V1, TrunkPayload, TrunkResource, TrunkInsta
427
435
  toJSON(): any;
428
436
  }
429
437
 
430
- export { TrunkContext, TrunkInstance, TrunkInstanceUpdateOptions, TrunkList, TrunkListInstance, TrunkListInstanceCreateOptions, TrunkListInstanceEachOptions, TrunkListInstanceOptions, TrunkListInstancePageOptions, TrunkPage, TrunkPayload, TrunkResource, TrunkSolution, TrunkTransferSetting }
438
+ export { TrunkContext, TrunkInstance, TrunkInstanceUpdateOptions, TrunkList, TrunkListInstance, TrunkListInstanceCreateOptions, TrunkListInstanceEachOptions, TrunkListInstanceOptions, TrunkListInstancePageOptions, TrunkPage, TrunkPayload, TrunkResource, TrunkSolution, TrunkTransferCallerId, TrunkTransferSetting }
@@ -78,6 +78,8 @@ TrunkList = function TrunkList(version) {
78
78
  * Whether Secure Trunking is enabled for the trunk
79
79
  * @param {boolean} [opts.cnamLookupEnabled] -
80
80
  * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk
81
+ * @param {trunk.transfer_caller_id} [opts.transferCallerId] -
82
+ * Caller Id for transfer target
81
83
  * @param {function} [callback] - Callback to handle processed record
82
84
  *
83
85
  * @returns {Promise} Resolves to processed TrunkInstance
@@ -98,7 +100,8 @@ TrunkList = function TrunkList(version) {
98
100
  'DisasterRecoveryMethod': _.get(opts, 'disasterRecoveryMethod'),
99
101
  'TransferMode': _.get(opts, 'transferMode'),
100
102
  'Secure': serialize.bool(_.get(opts, 'secure')),
101
- 'CnamLookupEnabled': serialize.bool(_.get(opts, 'cnamLookupEnabled'))
103
+ 'CnamLookupEnabled': serialize.bool(_.get(opts, 'cnamLookupEnabled')),
104
+ 'TransferCallerId': _.get(opts, 'transferCallerId')
102
105
  });
103
106
 
104
107
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -481,6 +484,8 @@ TrunkPage.prototype[util.inspect.custom] = function inspect(depth, options) {
481
484
  * @property {object} recording - The recording settings for the trunk
482
485
  * @property {trunk.transfer_setting} transferMode -
483
486
  * The call transfer settings for the trunk
487
+ * @property {trunk.transfer_caller_id} transferCallerId -
488
+ * Caller Id for transfer target
484
489
  * @property {boolean} cnamLookupEnabled -
485
490
  * Whether Caller ID Name (CNAM) lookup is enabled for the trunk
486
491
  * @property {string} authType - The types of authentication mapped to the domain
@@ -510,6 +515,7 @@ TrunkInstance = function TrunkInstance(version, payload, sid) {
510
515
  this.secure = payload.secure; // jshint ignore:line
511
516
  this.recording = payload.recording; // jshint ignore:line
512
517
  this.transferMode = payload.transfer_mode; // jshint ignore:line
518
+ this.transferCallerId = payload.transfer_caller_id; // jshint ignore:line
513
519
  this.cnamLookupEnabled = payload.cnam_lookup_enabled; // jshint ignore:line
514
520
  this.authType = payload.auth_type; // jshint ignore:line
515
521
  this.authTypeSet = payload.auth_type_set; // jshint ignore:line
@@ -588,6 +594,8 @@ TrunkInstance.prototype.remove = function remove(callback) {
588
594
  * Whether Secure Trunking is enabled for the trunk
589
595
  * @param {boolean} [opts.cnamLookupEnabled] -
590
596
  * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk
597
+ * @param {trunk.transfer_caller_id} [opts.transferCallerId] -
598
+ * Caller Id for transfer target
591
599
  * @param {function} [callback] - Callback to handle processed record
592
600
  *
593
601
  * @returns {Promise} Resolves to processed TrunkInstance
@@ -812,6 +820,8 @@ TrunkContext.prototype.remove = function remove(callback) {
812
820
  * Whether Secure Trunking is enabled for the trunk
813
821
  * @param {boolean} [opts.cnamLookupEnabled] -
814
822
  * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk
823
+ * @param {trunk.transfer_caller_id} [opts.transferCallerId] -
824
+ * Caller Id for transfer target
815
825
  * @param {function} [callback] - Callback to handle processed record
816
826
  *
817
827
  * @returns {Promise} Resolves to processed TrunkInstance
@@ -832,7 +842,8 @@ TrunkContext.prototype.update = function update(opts, callback) {
832
842
  'DisasterRecoveryMethod': _.get(opts, 'disasterRecoveryMethod'),
833
843
  'TransferMode': _.get(opts, 'transferMode'),
834
844
  'Secure': serialize.bool(_.get(opts, 'secure')),
835
- 'CnamLookupEnabled': serialize.bool(_.get(opts, 'cnamLookupEnabled'))
845
+ 'CnamLookupEnabled': serialize.bool(_.get(opts, 'cnamLookupEnabled')),
846
+ 'TransferCallerId': _.get(opts, 'transferCallerId')
836
847
  });
837
848
 
838
849
  var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
@@ -11,10 +11,10 @@ import { FormList } from './v2/form';
11
11
  import { FormListInstance } from './v2/form';
12
12
  import { ServiceList } from './v2/service';
13
13
  import { ServiceListInstance } from './v2/service';
14
+ import { TemplateList } from './v2/template';
15
+ import { TemplateListInstance } from './v2/template';
14
16
  import { VerificationAttemptList } from './v2/verificationAttempt';
15
17
  import { VerificationAttemptListInstance } from './v2/verificationAttempt';
16
- import { VerificationTemplateList } from './v2/verificationTemplate';
17
- import { VerificationTemplateListInstance } from './v2/verificationTemplate';
18
18
 
19
19
 
20
20
  declare class V2 extends Version {
@@ -27,8 +27,8 @@ declare class V2 extends Version {
27
27
 
28
28
  readonly forms: FormListInstance;
29
29
  readonly services: ServiceListInstance;
30
+ readonly templates: TemplateListInstance;
30
31
  readonly verificationAttempts: VerificationAttemptListInstance;
31
- readonly verificationTemplates: VerificationTemplateListInstance;
32
32
  }
33
33
 
34
34
  export = V2;
@@ -12,10 +12,9 @@
12
12
  var _ = require('lodash'); /* jshint ignore:line */
13
13
  var FormList = require('./v2/form').FormList;
14
14
  var ServiceList = require('./v2/service').ServiceList;
15
+ var TemplateList = require('./v2/template').TemplateList;
15
16
  var VerificationAttemptList = require(
16
17
  './v2/verificationAttempt').VerificationAttemptList;
17
- var VerificationTemplateList = require(
18
- './v2/verificationTemplate').VerificationTemplateList;
19
18
  var Version = require('../../base/Version'); /* jshint ignore:line */
20
19
 
21
20
 
@@ -29,8 +28,7 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
29
28
  * @property {Twilio.Verify.V2.ServiceList} services - services resource
30
29
  * @property {Twilio.Verify.V2.VerificationAttemptList} verificationAttempts -
31
30
  * verificationAttempts resource
32
- * @property {Twilio.Verify.V2.VerificationTemplateList} verificationTemplates -
33
- * verificationTemplates resource
31
+ * @property {Twilio.Verify.V2.TemplateList} templates - templates resource
34
32
  *
35
33
  * @param {Twilio.Verify} domain - The twilio domain
36
34
  */
@@ -42,7 +40,7 @@ function V2(domain) {
42
40
  this._forms = undefined;
43
41
  this._services = undefined;
44
42
  this._verificationAttempts = undefined;
45
- this._verificationTemplates = undefined;
43
+ this._templates = undefined;
46
44
  }
47
45
 
48
46
  _.extend(V2.prototype, Version.prototype);
@@ -73,10 +71,10 @@ Object.defineProperty(V2.prototype,
73
71
  });
74
72
 
75
73
  Object.defineProperty(V2.prototype,
76
- 'verificationTemplates', {
74
+ 'templates', {
77
75
  get: function() {
78
- this._verificationTemplates = this._verificationTemplates || new VerificationTemplateList(this);
79
- return this._verificationTemplates;
76
+ this._templates = this._templates || new TemplateList(this);
77
+ return this._templates;
80
78
  }
81
79
  });
82
80
 
@@ -14,7 +14,7 @@ type FactorFactorStatuses = 'unverified'|'verified';
14
14
 
15
15
  type FactorFactorTypes = 'push'|'totp';
16
16
 
17
- type FactorNotificationPlatforms = 'apn'|'fcm';
17
+ type FactorNotificationPlatforms = 'apn'|'fcm'|'none';
18
18
 
19
19
  type FactorTotpAlgorithms = 'sha1'|'sha256'|'sha512';
20
20
 
@@ -36,7 +36,8 @@ declare function FactorList(version: V2, serviceSid: string, identity: string):
36
36
  * @property authPayload - Optional payload to verify the Factor for the first time
37
37
  * @property config.alg - The algorithm used to derive the TOTP codes
38
38
  * @property config.codeLength - Number of digits for generated TOTP codes
39
- * @property config.notificationToken - For APN, the device token. For FCM the registration token
39
+ * @property config.notificationPlatform - The transport technology used to generate the Notification Token
40
+ * @property config.notificationToken - For APN, the device token. For FCM, the registration token
40
41
  * @property config.sdkVersion - The Verify Push SDK version used to configure the factor
41
42
  * @property config.skew - The number of past and future time-steps valid at a given time
42
43
  * @property config.timeStep - How often, in seconds, are TOTP codes generated
@@ -51,6 +52,7 @@ interface FactorInstanceUpdateOptions {
51
52
  skew?: number;
52
53
  codeLength?: number;
53
54
  alg?: FactorTotpAlgorithms;
55
+ notificationPlatform?: string;
54
56
  };
55
57
  friendlyName?: string;
56
58
  }
@@ -519,7 +519,7 @@ FactorInstance.prototype.fetch = function fetch(callback) {
519
519
  * Optional payload to verify the Factor for the first time
520
520
  * @param {string} [opts.friendlyName] - The friendly name of this Factor
521
521
  * @param {string} [opts.config.notificationToken] -
522
- * For APN, the device token. For FCM the registration token
522
+ * For APN, the device token. For FCM, the registration token
523
523
  * @param {string} [opts.config.sdkVersion] -
524
524
  * The Verify Push SDK version used to configure the factor
525
525
  * @param {number} [opts.config.timeStep] -
@@ -530,6 +530,8 @@ FactorInstance.prototype.fetch = function fetch(callback) {
530
530
  * Number of digits for generated TOTP codes
531
531
  * @param {factor.totp_algorithms} [opts.config.alg] -
532
532
  * The algorithm used to derive the TOTP codes
533
+ * @param {string} [opts.config.notificationPlatform] -
534
+ * The transport technology used to generate the Notification Token
533
535
  * @param {function} [callback] - Callback to handle processed record
534
536
  *
535
537
  * @returns {Promise} Resolves to processed FactorInstance
@@ -668,7 +670,7 @@ FactorContext.prototype.fetch = function fetch(callback) {
668
670
  * Optional payload to verify the Factor for the first time
669
671
  * @param {string} [opts.friendlyName] - The friendly name of this Factor
670
672
  * @param {string} [opts.config.notificationToken] -
671
- * For APN, the device token. For FCM the registration token
673
+ * For APN, the device token. For FCM, the registration token
672
674
  * @param {string} [opts.config.sdkVersion] -
673
675
  * The Verify Push SDK version used to configure the factor
674
676
  * @param {number} [opts.config.timeStep] -
@@ -679,6 +681,8 @@ FactorContext.prototype.fetch = function fetch(callback) {
679
681
  * Number of digits for generated TOTP codes
680
682
  * @param {factor.totp_algorithms} [opts.config.alg] -
681
683
  * The algorithm used to derive the TOTP codes
684
+ * @param {string} [opts.config.notificationPlatform] -
685
+ * The transport technology used to generate the Notification Token
682
686
  * @param {function} [callback] - Callback to handle processed record
683
687
  *
684
688
  * @returns {Promise} Resolves to processed FactorInstance
@@ -700,7 +704,8 @@ FactorContext.prototype.update = function update(opts, callback) {
700
704
  'Config.TimeStep': _.get(opts, 'config.timeStep'),
701
705
  'Config.Skew': _.get(opts, 'config.skew'),
702
706
  'Config.CodeLength': _.get(opts, 'config.codeLength'),
703
- 'Config.Alg': _.get(opts, 'config.alg')
707
+ 'Config.Alg': _.get(opts, 'config.alg'),
708
+ 'Config.NotificationPlatform': _.get(opts, 'config.notificationPlatform')
704
709
  });
705
710
 
706
711
  var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
@@ -14,7 +14,7 @@ type NewFactorFactorStatuses = 'unverified'|'verified';
14
14
 
15
15
  type NewFactorFactorTypes = 'push'|'totp';
16
16
 
17
- type NewFactorNotificationPlatforms = 'apn'|'fcm';
17
+ type NewFactorNotificationPlatforms = 'apn'|'fcm'|'none';
18
18
 
19
19
  type NewFactorTotpAlgorithms = 'sha1'|'sha256'|'sha512';
20
20
 
@@ -54,7 +54,7 @@ interface NewFactorListInstance {
54
54
  * @property config.appId - The ID that uniquely identifies your app in the Google or Apple store
55
55
  * @property config.codeLength - Number of digits for generated TOTP codes
56
56
  * @property config.notificationPlatform - The transport technology used to generate the Notification Token
57
- * @property config.notificationToken - For APN, the device token. For FCM the registration token
57
+ * @property config.notificationToken - For APN, the device token. For FCM, the registration token
58
58
  * @property config.sdkVersion - The Verify Push SDK version used to configure the factor
59
59
  * @property config.skew - The number of past and future time-steps valid at a given time
60
60
  * @property config.timeStep - How often, in seconds, are TOTP codes generated
@@ -72,7 +72,7 @@ NewFactorList = function NewFactorList(version, serviceSid, identity) {
72
72
  * @param {new_factor.notification_platforms} [opts.config.notificationPlatform] -
73
73
  * The transport technology used to generate the Notification Token
74
74
  * @param {string} [opts.config.notificationToken] -
75
- * For APN, the device token. For FCM the registration token
75
+ * For APN, the device token. For FCM, the registration token
76
76
  * @param {string} [opts.config.sdkVersion] -
77
77
  * The Verify Push SDK version used to configure the factor
78
78
  * @param {string} [opts.binding.secret] - The shared secret in Base32
@@ -65,10 +65,12 @@ interface VerificationListInstance {
65
65
  * @property customCode - A pre-generated code
66
66
  * @property customFriendlyName - A custom user defined friendly name
67
67
  * @property customMessage - The text of a custom message to use for the verification
68
- * @property locale - The locale to use for the verification SMS or call
68
+ * @property locale - The locale to use for the verification SMS, WhatsApp or call
69
69
  * @property payee - The payee of the associated PSD2 compliant transaction
70
70
  * @property rateLimits - The custom key-value pairs of Programmable Rate Limits.
71
71
  * @property sendDigits - The digits to send after a phone call is answered
72
+ * @property templateCustomSubstitutions - The values of the special variables declared on the message template.
73
+ * @property templateSid - The verification template SMS messages.
72
74
  * @property to - The phone number or email to verify
73
75
  */
74
76
  interface VerificationListInstanceCreateOptions {
@@ -83,6 +85,8 @@ interface VerificationListInstanceCreateOptions {
83
85
  payee?: string;
84
86
  rateLimits?: object;
85
87
  sendDigits?: string;
88
+ templateCustomSubstitutions?: string;
89
+ templateSid?: string;
86
90
  to: string;
87
91
  }
88
92
 
@@ -69,7 +69,7 @@ VerificationList = function VerificationList(version, serviceSid) {
69
69
  * @param {string} [opts.sendDigits] -
70
70
  * The digits to send after a phone call is answered
71
71
  * @param {string} [opts.locale] -
72
- * The locale to use for the verification SMS or call
72
+ * The locale to use for the verification SMS, WhatsApp or call
73
73
  * @param {string} [opts.customCode] - A pre-generated code
74
74
  * @param {string} [opts.amount] -
75
75
  * The amount of the associated PSD2 compliant transaction.
@@ -81,6 +81,9 @@ VerificationList = function VerificationList(version, serviceSid) {
81
81
  * Channel specific configuration in json format.
82
82
  * @param {string} [opts.appHash] -
83
83
  * Your App Hash to be appended at the end of an SMS.
84
+ * @param {string} [opts.templateSid] - The verification template SMS messages.
85
+ * @param {string} [opts.templateCustomSubstitutions] -
86
+ * The values of the special variables declared on the message template.
84
87
  * @param {function} [callback] - Callback to handle processed record
85
88
  *
86
89
  * @returns {Promise} Resolves to processed VerificationInstance
@@ -110,7 +113,9 @@ VerificationList = function VerificationList(version, serviceSid) {
110
113
  'Payee': _.get(opts, 'payee'),
111
114
  'RateLimits': serialize.object(_.get(opts, 'rateLimits')),
112
115
  'ChannelConfiguration': serialize.object(_.get(opts, 'channelConfiguration')),
113
- 'AppHash': _.get(opts, 'appHash')
116
+ 'AppHash': _.get(opts, 'appHash'),
117
+ 'TemplateSid': _.get(opts, 'templateSid'),
118
+ 'TemplateCustomSubstitutions': _.get(opts, 'templateCustomSubstitutions')
114
119
  });
115
120
 
116
121
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -36,6 +36,7 @@ declare function ServiceList(version: V2): ServiceListInstance;
36
36
  *
37
37
  * @property codeLength - The length of the verification code to generate
38
38
  * @property customCodeEnabled - Whether to allow sending verifications with a custom code.
39
+ * @property defaultTemplateSid - The verification template SMS messages.
39
40
  * @property doNotShareWarningEnabled - Whether to add a privacy warning at the end of an SMS.
40
41
  * @property dtmfInputRequired - Whether to ask the user to press a number before delivering the verify code in a phone call
41
42
  * @property friendlyName - A string to describe the verification service
@@ -54,6 +55,7 @@ declare function ServiceList(version: V2): ServiceListInstance;
54
55
  interface ServiceInstanceUpdateOptions {
55
56
  codeLength?: number;
56
57
  customCodeEnabled?: boolean;
58
+ defaultTemplateSid?: string;
57
59
  doNotShareWarningEnabled?: boolean;
58
60
  dtmfInputRequired?: boolean;
59
61
  friendlyName?: string;
@@ -199,6 +201,7 @@ interface ServiceListInstance {
199
201
  *
200
202
  * @property codeLength - The length of the verification code to generate
201
203
  * @property customCodeEnabled - Whether to allow sending verifications with a custom code.
204
+ * @property defaultTemplateSid - The verification template SMS messages.
202
205
  * @property doNotShareWarningEnabled - Whether to add a security warning at the end of an SMS.
203
206
  * @property dtmfInputRequired - Whether to ask the user to press a number before delivering the verify code in a phone call
204
207
  * @property friendlyName - A string to describe the verification service
@@ -217,6 +220,7 @@ interface ServiceListInstance {
217
220
  interface ServiceListInstanceCreateOptions {
218
221
  codeLength?: number;
219
222
  customCodeEnabled?: boolean;
223
+ defaultTemplateSid?: string;
220
224
  doNotShareWarningEnabled?: boolean;
221
225
  dtmfInputRequired?: boolean;
222
226
  friendlyName: string;
@@ -303,6 +307,7 @@ interface ServiceResource {
303
307
  custom_code_enabled: boolean;
304
308
  date_created: Date;
305
309
  date_updated: Date;
310
+ default_template_sid: string;
306
311
  do_not_share_warning_enabled: boolean;
307
312
  dtmf_input_required: boolean;
308
313
  friendly_name: string;
@@ -389,6 +394,7 @@ declare class ServiceInstance extends SerializableClass {
389
394
  customCodeEnabled: boolean;
390
395
  dateCreated: Date;
391
396
  dateUpdated: Date;
397
+ defaultTemplateSid: string;
392
398
  doNotShareWarningEnabled: boolean;
393
399
  dtmfInputRequired: boolean;
394
400
  /**
@@ -99,6 +99,8 @@ ServiceList = function ServiceList(version) {
99
99
  * Optional. Number of digits for generated TOTP codes
100
100
  * @param {number} [opts.totp.skew] -
101
101
  * Optional. The number of past and future time-steps valid at a given time
102
+ * @param {string} [opts.defaultTemplateSid] -
103
+ * The verification template SMS messages.
102
104
  * @param {function} [callback] - Callback to handle processed record
103
105
  *
104
106
  * @returns {Promise} Resolves to processed ServiceInstance
@@ -129,7 +131,8 @@ ServiceList = function ServiceList(version) {
129
131
  'Totp.Issuer': _.get(opts, 'totp.issuer'),
130
132
  'Totp.TimeStep': _.get(opts, 'totp.timeStep'),
131
133
  'Totp.CodeLength': _.get(opts, 'totp.codeLength'),
132
- 'Totp.Skew': _.get(opts, 'totp.skew')
134
+ 'Totp.Skew': _.get(opts, 'totp.skew'),
135
+ 'DefaultTemplateSid': _.get(opts, 'defaultTemplateSid')
133
136
  });
134
137
 
135
138
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -520,6 +523,7 @@ ServicePage.prototype[util.inspect.custom] = function inspect(depth, options) {
520
523
  * Whether to allow sending verifications with a custom code.
521
524
  * @property {object} push - The service level configuration of factor push type.
522
525
  * @property {object} totp - The service level configuration of factor TOTP type.
526
+ * @property {string} defaultTemplateSid - The default_template_sid
523
527
  * @property {Date} dateCreated -
524
528
  * The RFC 2822 date and time in GMT when the resource was created
525
529
  * @property {Date} dateUpdated -
@@ -549,6 +553,7 @@ ServiceInstance = function ServiceInstance(version, payload, sid) {
549
553
  this.customCodeEnabled = payload.custom_code_enabled; // jshint ignore:line
550
554
  this.push = payload.push; // jshint ignore:line
551
555
  this.totp = payload.totp; // jshint ignore:line
556
+ this.defaultTemplateSid = payload.default_template_sid; // jshint ignore:line
552
557
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
553
558
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
554
559
  this.url = payload.url; // jshint ignore:line
@@ -641,6 +646,8 @@ ServiceInstance.prototype.remove = function remove(callback) {
641
646
  * Optional. Number of digits for generated TOTP codes
642
647
  * @param {number} [opts.totp.skew] -
643
648
  * Optional. The number of past and future time-steps valid at a given time
649
+ * @param {string} [opts.defaultTemplateSid] -
650
+ * The verification template SMS messages.
644
651
  * @param {function} [callback] - Callback to handle processed record
645
652
  *
646
653
  * @returns {Promise} Resolves to processed ServiceInstance
@@ -918,6 +925,8 @@ ServiceContext.prototype.remove = function remove(callback) {
918
925
  * Optional. Number of digits for generated TOTP codes
919
926
  * @param {number} [opts.totp.skew] -
920
927
  * Optional. The number of past and future time-steps valid at a given time
928
+ * @param {string} [opts.defaultTemplateSid] -
929
+ * The verification template SMS messages.
921
930
  * @param {function} [callback] - Callback to handle processed record
922
931
  *
923
932
  * @returns {Promise} Resolves to processed ServiceInstance
@@ -947,7 +956,8 @@ ServiceContext.prototype.update = function update(opts, callback) {
947
956
  'Totp.Issuer': _.get(opts, 'totp.issuer'),
948
957
  'Totp.TimeStep': _.get(opts, 'totp.timeStep'),
949
958
  'Totp.CodeLength': _.get(opts, 'totp.codeLength'),
950
- 'Totp.Skew': _.get(opts, 'totp.skew')
959
+ 'Totp.Skew': _.get(opts, 'totp.skew'),
960
+ 'DefaultTemplateSid': _.get(opts, 'defaultTemplateSid')
951
961
  });
952
962
 
953
963
  var promise = this._version.update({uri: this._uri, method: 'POST', data: data});