twilio 3.67.1 → 3.70.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 +83 -0
- package/lib/base/RequestClient.js +1 -0
- package/lib/jwt/AccessToken.d.ts +16 -0
- package/lib/jwt/AccessToken.js +20 -0
- package/lib/rest/Media.d.ts +28 -0
- package/lib/rest/Media.js +64 -0
- package/lib/rest/Twilio.d.ts +2 -0
- package/lib/rest/Twilio.js +14 -0
- package/lib/rest/Verify.d.ts +2 -0
- package/lib/rest/Verify.js +8 -0
- package/lib/rest/api/v2010/account/call/siprec.d.ts +776 -0
- package/lib/rest/api/v2010/account/call/siprec.js +811 -0
- package/lib/rest/api/v2010/account/call.d.ts +7 -0
- package/lib/rest/api/v2010/account/call.js +28 -0
- package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +5 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +5 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +5 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +7 -3
- package/lib/rest/api/v2010/account/incomingPhoneNumber.js +7 -4
- package/lib/rest/conversations/v1/service/configuration/notification.d.ts +6 -0
- package/lib/rest/conversations/v1/service/configuration/notification.js +11 -1
- package/lib/rest/events/v1/sink.d.ts +1 -1
- package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
- package/lib/rest/flexApi/v1/configuration.js +2 -0
- package/lib/rest/insights/v1/callSummaries.d.ts +27 -27
- package/lib/rest/insights/v1/callSummaries.js +35 -35
- package/lib/rest/media/V1.d.ts +28 -0
- package/lib/rest/media/V1.js +59 -0
- package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
- package/lib/rest/media/v1/mediaProcessor.js +702 -0
- package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
- package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
- package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
- package/lib/rest/media/v1/playerStreamer.js +729 -0
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +286 -0
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +521 -0
- package/lib/rest/messaging/v1/brandRegistration.d.ts +30 -1
- package/lib/rest/messaging/v1/brandRegistration.js +54 -1
- package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +2 -0
- package/lib/rest/messaging/v1/service/usAppToPerson.js +3 -0
- package/lib/rest/messaging/v1/service.d.ts +8 -0
- package/lib/rest/messaging/v1/service.js +14 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +133 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +268 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +127 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +271 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +14 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +56 -0
- package/lib/rest/serverless/v1/service/environment.js +1 -1
- package/lib/rest/serverless/v1/service.d.ts +2 -0
- package/lib/rest/serverless/v1/service.js +3 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
- package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
- package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
- package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
- package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
- package/lib/rest/trunking/v1/trunk.d.ts +9 -1
- package/lib/rest/trunking/v1/trunk.js +13 -2
- package/lib/rest/verify/V2.d.ts +3 -0
- package/lib/rest/verify/V2.js +11 -0
- 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/template.d.ts +242 -0
- package/lib/rest/verify/v2/template.js +440 -0
- package/lib/rest/video/v1/room.d.ts +4 -0
- package/lib/rest/video/v1/room.js +7 -1
- 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
|
|
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
|
|
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});
|
package/lib/rest/verify/V2.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ 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
18
|
|
|
@@ -25,6 +27,7 @@ declare class V2 extends Version {
|
|
|
25
27
|
|
|
26
28
|
readonly forms: FormListInstance;
|
|
27
29
|
readonly services: ServiceListInstance;
|
|
30
|
+
readonly templates: TemplateListInstance;
|
|
28
31
|
readonly verificationAttempts: VerificationAttemptListInstance;
|
|
29
32
|
}
|
|
30
33
|
|
package/lib/rest/verify/V2.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
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
18
|
var Version = require('../../base/Version'); /* jshint ignore:line */
|
|
@@ -27,6 +28,7 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
|
|
|
27
28
|
* @property {Twilio.Verify.V2.ServiceList} services - services resource
|
|
28
29
|
* @property {Twilio.Verify.V2.VerificationAttemptList} verificationAttempts -
|
|
29
30
|
* verificationAttempts resource
|
|
31
|
+
* @property {Twilio.Verify.V2.TemplateList} templates - templates resource
|
|
30
32
|
*
|
|
31
33
|
* @param {Twilio.Verify} domain - The twilio domain
|
|
32
34
|
*/
|
|
@@ -38,6 +40,7 @@ function V2(domain) {
|
|
|
38
40
|
this._forms = undefined;
|
|
39
41
|
this._services = undefined;
|
|
40
42
|
this._verificationAttempts = undefined;
|
|
43
|
+
this._templates = undefined;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
_.extend(V2.prototype, Version.prototype);
|
|
@@ -67,4 +70,12 @@ Object.defineProperty(V2.prototype,
|
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
72
|
|
|
73
|
+
Object.defineProperty(V2.prototype,
|
|
74
|
+
'templates', {
|
|
75
|
+
get: function() {
|
|
76
|
+
this._templates = this._templates || new TemplateList(this);
|
|
77
|
+
return this._templates;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
70
81
|
module.exports = V2;
|
|
@@ -65,7 +65,7 @@ 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
|
|
@@ -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.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Page = require('../../../base/Page');
|
|
9
|
+
import Response = require('../../../http/response');
|
|
10
|
+
import V2 = require('../V2');
|
|
11
|
+
import { SerializableClass } from '../../../interfaces';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the TemplateList
|
|
15
|
+
*
|
|
16
|
+
* @param version - Version of the resource
|
|
17
|
+
*/
|
|
18
|
+
declare function TemplateList(version: V2): TemplateListInstance;
|
|
19
|
+
|
|
20
|
+
interface TemplateListInstance {
|
|
21
|
+
/**
|
|
22
|
+
* Streams TemplateInstance records from the API.
|
|
23
|
+
*
|
|
24
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
25
|
+
* is reached.
|
|
26
|
+
*
|
|
27
|
+
* The results are passed into the callback function, so this operation is memory
|
|
28
|
+
* efficient.
|
|
29
|
+
*
|
|
30
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
31
|
+
* function.
|
|
32
|
+
*
|
|
33
|
+
* @param callback - Function to process each record
|
|
34
|
+
*/
|
|
35
|
+
each(callback?: (item: TemplateInstance, done: (err?: Error) => void) => void): void;
|
|
36
|
+
/**
|
|
37
|
+
* Streams TemplateInstance records from the API.
|
|
38
|
+
*
|
|
39
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
40
|
+
* is reached.
|
|
41
|
+
*
|
|
42
|
+
* The results are passed into the callback function, so this operation is memory
|
|
43
|
+
* efficient.
|
|
44
|
+
*
|
|
45
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
46
|
+
* function.
|
|
47
|
+
*
|
|
48
|
+
* @param opts - Options for request
|
|
49
|
+
* @param callback - Function to process each record
|
|
50
|
+
*/
|
|
51
|
+
each(opts?: TemplateListInstanceEachOptions, callback?: (item: TemplateInstance, done: (err?: Error) => void) => void): void;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve a single target page of TemplateInstance records from the API.
|
|
54
|
+
*
|
|
55
|
+
* The request is executed immediately.
|
|
56
|
+
*
|
|
57
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
58
|
+
* function.
|
|
59
|
+
*
|
|
60
|
+
* @param callback - Callback to handle list of records
|
|
61
|
+
*/
|
|
62
|
+
getPage(callback?: (error: Error | null, items: TemplatePage) => any): Promise<TemplatePage>;
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve a single target page of TemplateInstance records from the API.
|
|
65
|
+
*
|
|
66
|
+
* The request is executed immediately.
|
|
67
|
+
*
|
|
68
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
69
|
+
* function.
|
|
70
|
+
*
|
|
71
|
+
* @param targetUrl - API-generated URL for the requested results page
|
|
72
|
+
* @param callback - Callback to handle list of records
|
|
73
|
+
*/
|
|
74
|
+
getPage(targetUrl?: string, callback?: (error: Error | null, items: TemplatePage) => any): Promise<TemplatePage>;
|
|
75
|
+
/**
|
|
76
|
+
* Lists TemplateInstance records from the API as a list.
|
|
77
|
+
*
|
|
78
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
79
|
+
* function.
|
|
80
|
+
*
|
|
81
|
+
* @param callback - Callback to handle list of records
|
|
82
|
+
*/
|
|
83
|
+
list(callback?: (error: Error | null, items: TemplateInstance[]) => any): Promise<TemplateInstance[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Lists TemplateInstance records from the API as a list.
|
|
86
|
+
*
|
|
87
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
88
|
+
* function.
|
|
89
|
+
*
|
|
90
|
+
* @param opts - Options for request
|
|
91
|
+
* @param callback - Callback to handle list of records
|
|
92
|
+
*/
|
|
93
|
+
list(opts?: TemplateListInstanceOptions, callback?: (error: Error | null, items: TemplateInstance[]) => any): Promise<TemplateInstance[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Retrieve a single page of TemplateInstance records from the API.
|
|
96
|
+
*
|
|
97
|
+
* The request is executed immediately.
|
|
98
|
+
*
|
|
99
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
100
|
+
* function.
|
|
101
|
+
*
|
|
102
|
+
* @param callback - Callback to handle list of records
|
|
103
|
+
*/
|
|
104
|
+
page(callback?: (error: Error | null, items: TemplatePage) => any): Promise<TemplatePage>;
|
|
105
|
+
/**
|
|
106
|
+
* Retrieve a single page of TemplateInstance records from the API.
|
|
107
|
+
*
|
|
108
|
+
* The request is executed immediately.
|
|
109
|
+
*
|
|
110
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
111
|
+
* function.
|
|
112
|
+
*
|
|
113
|
+
* @param opts - Options for request
|
|
114
|
+
* @param callback - Callback to handle list of records
|
|
115
|
+
*/
|
|
116
|
+
page(opts?: TemplateListInstancePageOptions, callback?: (error: Error | null, items: TemplatePage) => any): Promise<TemplatePage>;
|
|
117
|
+
/**
|
|
118
|
+
* Provide a user-friendly representation
|
|
119
|
+
*/
|
|
120
|
+
toJSON(): any;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Options to pass to each
|
|
125
|
+
*
|
|
126
|
+
* @property callback -
|
|
127
|
+
* Function to process each record. If this and a positional
|
|
128
|
+
* callback are passed, this one will be used
|
|
129
|
+
* @property done - Function to be called upon completion of streaming
|
|
130
|
+
* @property friendlyName - Filter templates using friendly name
|
|
131
|
+
* @property limit -
|
|
132
|
+
* Upper limit for the number of records to return.
|
|
133
|
+
* each() guarantees never to return more than limit.
|
|
134
|
+
* Default is no limit
|
|
135
|
+
* @property pageSize -
|
|
136
|
+
* Number of records to fetch per request,
|
|
137
|
+
* when not set will use the default value of 50 records.
|
|
138
|
+
* If no pageSize is defined but a limit is defined,
|
|
139
|
+
* each() will attempt to read the limit with the most efficient
|
|
140
|
+
* page size, i.e. min(limit, 1000)
|
|
141
|
+
*/
|
|
142
|
+
interface TemplateListInstanceEachOptions {
|
|
143
|
+
callback?: (item: TemplateInstance, done: (err?: Error) => void) => void;
|
|
144
|
+
done?: Function;
|
|
145
|
+
friendlyName?: string;
|
|
146
|
+
limit?: number;
|
|
147
|
+
pageSize?: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Options to pass to list
|
|
152
|
+
*
|
|
153
|
+
* @property friendlyName - Filter templates using friendly name
|
|
154
|
+
* @property limit -
|
|
155
|
+
* Upper limit for the number of records to return.
|
|
156
|
+
* list() guarantees never to return more than limit.
|
|
157
|
+
* Default is no limit
|
|
158
|
+
* @property pageSize -
|
|
159
|
+
* Number of records to fetch per request,
|
|
160
|
+
* when not set will use the default value of 50 records.
|
|
161
|
+
* If no page_size is defined but a limit is defined,
|
|
162
|
+
* list() will attempt to read the limit with the most
|
|
163
|
+
* efficient page size, i.e. min(limit, 1000)
|
|
164
|
+
*/
|
|
165
|
+
interface TemplateListInstanceOptions {
|
|
166
|
+
friendlyName?: string;
|
|
167
|
+
limit?: number;
|
|
168
|
+
pageSize?: number;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Options to pass to page
|
|
173
|
+
*
|
|
174
|
+
* @property friendlyName - Filter templates using friendly name
|
|
175
|
+
* @property pageNumber - Page Number, this value is simply for client state
|
|
176
|
+
* @property pageSize - Number of records to return, defaults to 50
|
|
177
|
+
* @property pageToken - PageToken provided by the API
|
|
178
|
+
*/
|
|
179
|
+
interface TemplateListInstancePageOptions {
|
|
180
|
+
friendlyName?: string;
|
|
181
|
+
pageNumber?: number;
|
|
182
|
+
pageSize?: number;
|
|
183
|
+
pageToken?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface TemplatePayload extends TemplateResource, Page.TwilioResponsePayload {
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface TemplateResource {
|
|
190
|
+
account_sid: string;
|
|
191
|
+
friendly_name: string;
|
|
192
|
+
sid: string;
|
|
193
|
+
translations: object;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface TemplateSolution {
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
declare class TemplateInstance extends SerializableClass {
|
|
201
|
+
/**
|
|
202
|
+
* Initialize the TemplateContext
|
|
203
|
+
*
|
|
204
|
+
* @param version - Version of the resource
|
|
205
|
+
* @param payload - The instance payload
|
|
206
|
+
*/
|
|
207
|
+
constructor(version: V2, payload: TemplatePayload);
|
|
208
|
+
|
|
209
|
+
accountSid: string;
|
|
210
|
+
friendlyName: string;
|
|
211
|
+
sid: string;
|
|
212
|
+
/**
|
|
213
|
+
* Provide a user-friendly representation
|
|
214
|
+
*/
|
|
215
|
+
toJSON(): any;
|
|
216
|
+
translations: any;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
declare class TemplatePage extends Page<V2, TemplatePayload, TemplateResource, TemplateInstance> {
|
|
221
|
+
/**
|
|
222
|
+
* Initialize the TemplatePage
|
|
223
|
+
*
|
|
224
|
+
* @param version - Version of the resource
|
|
225
|
+
* @param response - Response from the API
|
|
226
|
+
* @param solution - Path solution
|
|
227
|
+
*/
|
|
228
|
+
constructor(version: V2, response: Response<string>, solution: TemplateSolution);
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Build an instance of TemplateInstance
|
|
232
|
+
*
|
|
233
|
+
* @param payload - Payload response from the API
|
|
234
|
+
*/
|
|
235
|
+
getInstance(payload: TemplatePayload): TemplateInstance;
|
|
236
|
+
/**
|
|
237
|
+
* Provide a user-friendly representation
|
|
238
|
+
*/
|
|
239
|
+
toJSON(): any;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export { TemplateInstance, TemplateList, TemplateListInstance, TemplateListInstanceEachOptions, TemplateListInstanceOptions, TemplateListInstancePageOptions, TemplatePage, TemplatePayload, TemplateResource, TemplateSolution }
|