twilio 3.71.1 → 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.
package/CHANGES.md CHANGED
@@ -1,6 +1,27 @@
1
1
  twilio-node changelog
2
2
  =====================
3
3
 
4
+ [2021-11-17] Version 3.71.2
5
+ ---------------------------
6
+ **Library - Fix**
7
+ - [PR #707](https://github.com/twilio/twilio-node/pull/707): make ttl optional in ClientCapabilityOptions. Thanks to [@ghmeier](https://github.com/ghmeier)!
8
+ - [PR #704](https://github.com/twilio/twilio-node/pull/704): git log retrieval issues. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
9
+
10
+ **Frontline**
11
+ - Added `is_available` to User's resource
12
+
13
+ **Messaging**
14
+ - Added GET vetting API
15
+
16
+ **Verify**
17
+ - Add `WHATSAPP` to the attempts API.
18
+ - Allow to update `config.notification_platform` from `none` to `apn` or `fcm` and viceversa for Verify Push
19
+ - Add `none` as a valid `config.notification_platform` value for Verify Push
20
+
21
+ **Twiml**
22
+ - Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
23
+
24
+
4
25
  [2021-11-03] Version 3.71.1
5
26
  ---------------------------
6
27
  **Library - Fix**
@@ -47,7 +47,7 @@ declare namespace ClientCapability {
47
47
  export interface ClientCapabilityOptions {
48
48
  accountSid: string;
49
49
  authToken: string;
50
- ttl: number;
50
+ ttl?: number;
51
51
  }
52
52
  }
53
53
 
@@ -192,7 +192,7 @@ interface CallListInstance {
192
192
  * @property asyncAmdStatusCallbackMethod - HTTP Method to use with async_amd_status_callback
193
193
  * @property byoc - BYOC trunk SID (Beta)
194
194
  * @property callReason - Reason for the call (Branded Calls Beta)
195
- * @property callToken - A token string needed to invoke a forwarded call with a caller-id recieved on a previous incoming call
195
+ * @property callToken - A token string needed to invoke a forwarded call with a CallerId recieved on a previous incoming call
196
196
  * @property callerId - The phone number, SIP address, or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`.
197
197
  * @property fallbackMethod - HTTP Method to use with fallback_url
198
198
  * @property fallbackUrl - Fallback URL in case of error
@@ -121,7 +121,7 @@ CallList = function CallList(version, accountSid) {
121
121
  * @param {string} [opts.byoc] - BYOC trunk SID (Beta)
122
122
  * @param {string} [opts.callReason] - Reason for the call (Branded Calls Beta)
123
123
  * @param {string} [opts.callToken] -
124
- * A token string needed to invoke a forwarded call with a caller-id recieved on a previous incoming call
124
+ * A token string needed to invoke a forwarded call with a CallerId recieved on a previous incoming call
125
125
  * @param {string} [opts.recordingTrack] - Which track(s) to record
126
126
  * @param {number} [opts.timeLimit] - The maximum duration of the call in seconds.
127
127
  * @param {string} [opts.url] - The absolute URL that returns TwiML for this call
@@ -27,11 +27,13 @@ declare function UserList(version: V1): UserListInstance;
27
27
  *
28
28
  * @property avatar - The avatar URL which will be shown in Frontline application
29
29
  * @property friendlyName - The string that you assigned to describe the User
30
+ * @property isAvailable - Whether the User is available for new conversations
30
31
  * @property state - Current state of this user
31
32
  */
32
33
  interface UserInstanceUpdateOptions {
33
34
  avatar?: string;
34
35
  friendlyName?: string;
36
+ isAvailable?: boolean;
35
37
  state?: UserStateType;
36
38
  }
37
39
 
@@ -59,6 +61,7 @@ interface UserResource {
59
61
  avatar: string;
60
62
  friendly_name: string;
61
63
  identity: string;
64
+ is_available: boolean;
62
65
  sid: string;
63
66
  state: UserStateType;
64
67
  url: string;
@@ -129,6 +132,7 @@ declare class UserInstance extends SerializableClass {
129
132
  fetch(callback?: (error: Error | null, items: UserInstance) => any): Promise<UserInstance>;
130
133
  friendlyName: string;
131
134
  identity: string;
135
+ isAvailable: boolean;
132
136
  sid: string;
133
137
  state: UserStateType;
134
138
  /**
@@ -13,6 +13,7 @@ var Q = require('q'); /* jshint ignore:line */
13
13
  var _ = require('lodash'); /* jshint ignore:line */
14
14
  var util = require('util'); /* jshint ignore:line */
15
15
  var Page = require('../../../base/Page'); /* jshint ignore:line */
16
+ var serialize = require('../../../base/serialize'); /* jshint ignore:line */
16
17
  var values = require('../../../base/values'); /* jshint ignore:line */
17
18
 
18
19
  var UserList;
@@ -171,6 +172,8 @@ UserPage.prototype[util.inspect.custom] = function inspect(depth, options) {
171
172
  * @property {string} avatar -
172
173
  * The avatar URL which will be shown in Frontline application
173
174
  * @property {user.state_type} state - Current state of this user
175
+ * @property {boolean} isAvailable -
176
+ * Whether the User is available for new conversations
174
177
  * @property {string} url - An absolute URL for this user.
175
178
  *
176
179
  * @param {V1} version - Version of the resource
@@ -187,6 +190,7 @@ UserInstance = function UserInstance(version, payload, sid) {
187
190
  this.friendlyName = payload.friendly_name; // jshint ignore:line
188
191
  this.avatar = payload.avatar; // jshint ignore:line
189
192
  this.state = payload.state; // jshint ignore:line
193
+ this.isAvailable = payload.is_available; // jshint ignore:line
190
194
  this.url = payload.url; // jshint ignore:line
191
195
 
192
196
  // Context
@@ -234,6 +238,8 @@ UserInstance.prototype.fetch = function fetch(callback) {
234
238
  * @param {string} [opts.avatar] -
235
239
  * The avatar URL which will be shown in Frontline application
236
240
  * @param {user.state_type} [opts.state] - Current state of this user
241
+ * @param {boolean} [opts.isAvailable] -
242
+ * Whether the User is available for new conversations
237
243
  * @param {function} [callback] - Callback to handle processed record
238
244
  *
239
245
  * @returns {Promise} Resolves to processed UserInstance
@@ -333,6 +339,8 @@ UserContext.prototype.fetch = function fetch(callback) {
333
339
  * @param {string} [opts.avatar] -
334
340
  * The avatar URL which will be shown in Frontline application
335
341
  * @param {user.state_type} [opts.state] - Current state of this user
342
+ * @param {boolean} [opts.isAvailable] -
343
+ * Whether the User is available for new conversations
336
344
  * @param {function} [callback] - Callback to handle processed record
337
345
  *
338
346
  * @returns {Promise} Resolves to processed UserInstance
@@ -349,7 +357,8 @@ UserContext.prototype.update = function update(opts, callback) {
349
357
  var data = values.of({
350
358
  'FriendlyName': _.get(opts, 'friendlyName'),
351
359
  'Avatar': _.get(opts, 'avatar'),
352
- 'State': _.get(opts, 'state')
360
+ 'State': _.get(opts, 'state'),
361
+ 'IsAvailable': serialize.bool(_.get(opts, 'isAvailable'))
353
362
  });
354
363
 
355
364
  var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
@@ -24,6 +24,10 @@ type BrandVettingVettingProvider = 'campaign-verify';
24
24
  declare function BrandVettingList(version: V1, brandSid: string): BrandVettingListInstance;
25
25
 
26
26
  interface BrandVettingListInstance {
27
+ /**
28
+ * @param sid - sid of instance
29
+ */
30
+ (sid: string): BrandVettingContext;
27
31
  /**
28
32
  * create a BrandVettingInstance
29
33
  *
@@ -62,6 +66,12 @@ interface BrandVettingListInstance {
62
66
  * @param callback - Function to process each record
63
67
  */
64
68
  each(opts?: BrandVettingListInstanceEachOptions, callback?: (item: BrandVettingInstance, done: (err?: Error) => void) => void): void;
69
+ /**
70
+ * Constructs a brand_vetting
71
+ *
72
+ * @param brandVettingSid - SID for third-party vetting record
73
+ */
74
+ get(brandVettingSid: string): BrandVettingContext;
65
75
  /**
66
76
  * Retrieve a single target page of BrandVettingInstance records from the API.
67
77
  *
@@ -228,6 +238,32 @@ interface BrandVettingSolution {
228
238
  }
229
239
 
230
240
 
241
+ declare class BrandVettingContext {
242
+ /**
243
+ * Initialize the BrandVettingContext
244
+ *
245
+ * PLEASE NOTE that this class contains beta products that are subject to change.
246
+ * Use them with caution.
247
+ *
248
+ * @param version - Version of the resource
249
+ * @param brandSid - A2P BrandRegistration Sid
250
+ * @param brandVettingSid - SID for third-party vetting record
251
+ */
252
+ constructor(version: V1, brandSid: string, brandVettingSid: string);
253
+
254
+ /**
255
+ * fetch a BrandVettingInstance
256
+ *
257
+ * @param callback - Callback to handle processed record
258
+ */
259
+ fetch(callback?: (error: Error | null, items: BrandVettingInstance) => any): Promise<BrandVettingInstance>;
260
+ /**
261
+ * Provide a user-friendly representation
262
+ */
263
+ toJSON(): any;
264
+ }
265
+
266
+
231
267
  declare class BrandVettingInstance extends SerializableClass {
232
268
  /**
233
269
  * Initialize the BrandVettingContext
@@ -238,14 +274,22 @@ declare class BrandVettingInstance extends SerializableClass {
238
274
  * @param version - Version of the resource
239
275
  * @param payload - The instance payload
240
276
  * @param brandSid - A2P BrandRegistration Sid
277
+ * @param brandVettingSid - SID for third-party vetting record
241
278
  */
242
- constructor(version: V1, payload: BrandVettingPayload, brandSid: string);
279
+ constructor(version: V1, payload: BrandVettingPayload, brandSid: string, brandVettingSid: string);
243
280
 
281
+ private _proxy: BrandVettingContext;
244
282
  accountSid: string;
245
283
  brandSid: string;
246
284
  brandVettingSid: string;
247
285
  dateCreated: Date;
248
286
  dateUpdated: Date;
287
+ /**
288
+ * fetch a BrandVettingInstance
289
+ *
290
+ * @param callback - Callback to handle processed record
291
+ */
292
+ fetch(callback?: (error: Error | null, items: BrandVettingInstance) => any): Promise<BrandVettingInstance>;
249
293
  /**
250
294
  * Provide a user-friendly representation
251
295
  */
@@ -283,4 +327,4 @@ declare class BrandVettingPage extends Page<V1, BrandVettingPayload, BrandVettin
283
327
  toJSON(): any;
284
328
  }
285
329
 
286
- export { BrandVettingInstance, BrandVettingList, BrandVettingListInstance, BrandVettingListInstanceCreateOptions, BrandVettingListInstanceEachOptions, BrandVettingListInstanceOptions, BrandVettingListInstancePageOptions, BrandVettingPage, BrandVettingPayload, BrandVettingResource, BrandVettingSolution, BrandVettingVettingProvider }
330
+ export { BrandVettingContext, BrandVettingInstance, BrandVettingList, BrandVettingListInstance, BrandVettingListInstanceCreateOptions, BrandVettingListInstanceEachOptions, BrandVettingListInstanceOptions, BrandVettingListInstancePageOptions, BrandVettingPage, BrandVettingPayload, BrandVettingResource, BrandVettingSolution, BrandVettingVettingProvider }
@@ -20,6 +20,7 @@ var values = require('../../../../base/values'); /* jshint ignore:line */
20
20
  var BrandVettingList;
21
21
  var BrandVettingPage;
22
22
  var BrandVettingInstance;
23
+ var BrandVettingContext;
23
24
 
24
25
  /* jshint ignore:start */
25
26
  /**
@@ -86,7 +87,12 @@ BrandVettingList = function BrandVettingList(version, brandSid) {
86
87
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
87
88
 
88
89
  promise = promise.then(function(payload) {
89
- deferred.resolve(new BrandVettingInstance(this._version, payload));
90
+ deferred.resolve(new BrandVettingInstance(
91
+ this._version,
92
+ payload,
93
+ this._solution.brandSid,
94
+ this._solution.brandVettingSid
95
+ ));
90
96
  }.bind(this));
91
97
 
92
98
  promise.catch(function(error) {
@@ -349,6 +355,22 @@ BrandVettingList = function BrandVettingList(version, brandSid) {
349
355
  return deferred.promise;
350
356
  };
351
357
 
358
+ /* jshint ignore:start */
359
+ /**
360
+ * Constructs a brand_vetting
361
+ *
362
+ * @function get
363
+ * @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
364
+ *
365
+ * @param {string} brandVettingSid - SID for third-party vetting record
366
+ *
367
+ * @returns {Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingContext}
368
+ */
369
+ /* jshint ignore:end */
370
+ BrandVettingListInstance.get = function get(brandVettingSid) {
371
+ return new BrandVettingContext(this._version, this._solution.brandSid, brandVettingSid);
372
+ };
373
+
352
374
  /* jshint ignore:start */
353
375
  /**
354
376
  * Provide a user-friendly representation
@@ -466,10 +488,11 @@ BrandVettingPage.prototype[util.inspect.custom] = function inspect(depth,
466
488
  * @param {V1} version - Version of the resource
467
489
  * @param {BrandVettingPayload} payload - The instance payload
468
490
  * @param {sid} brandSid - A2P BrandRegistration Sid
491
+ * @param {sid} brandVettingSid - SID for third-party vetting record
469
492
  */
470
493
  /* jshint ignore:end */
471
- BrandVettingInstance = function BrandVettingInstance(version, payload, brandSid)
472
- {
494
+ BrandVettingInstance = function BrandVettingInstance(version, payload, brandSid,
495
+ brandVettingSid) {
473
496
  this._version = version;
474
497
 
475
498
  // Marshaled Properties
@@ -486,7 +509,38 @@ BrandVettingInstance = function BrandVettingInstance(version, payload, brandSid)
486
509
 
487
510
  // Context
488
511
  this._context = undefined;
489
- this._solution = {brandSid: brandSid, };
512
+ this._solution = {brandSid: brandSid, brandVettingSid: brandVettingSid || this.brandVettingSid, };
513
+ };
514
+
515
+ Object.defineProperty(BrandVettingInstance.prototype,
516
+ '_proxy', {
517
+ get: function() {
518
+ if (!this._context) {
519
+ this._context = new BrandVettingContext(
520
+ this._version,
521
+ this._solution.brandSid,
522
+ this._solution.brandVettingSid
523
+ );
524
+ }
525
+
526
+ return this._context;
527
+ }
528
+ });
529
+
530
+ /* jshint ignore:start */
531
+ /**
532
+ * fetch a BrandVettingInstance
533
+ *
534
+ * @function fetch
535
+ * @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingInstance#
536
+ *
537
+ * @param {function} [callback] - Callback to handle processed record
538
+ *
539
+ * @returns {Promise} Resolves to processed BrandVettingInstance
540
+ */
541
+ /* jshint ignore:end */
542
+ BrandVettingInstance.prototype.fetch = function fetch(callback) {
543
+ return this._proxy.fetch(callback);
490
544
  };
491
545
 
492
546
  /* jshint ignore:start */
@@ -514,8 +568,88 @@ BrandVettingInstance.prototype[util.inspect.custom] = function inspect(depth,
514
568
  return util.inspect(this.toJSON(), options);
515
569
  };
516
570
 
571
+
572
+ /* jshint ignore:start */
573
+ /**
574
+ * Initialize the BrandVettingContext
575
+ *
576
+ * PLEASE NOTE that this class contains beta products that are subject to change.
577
+ * Use them with caution.
578
+ *
579
+ * @constructor Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingContext
580
+ *
581
+ * @param {V1} version - Version of the resource
582
+ * @param {sid} brandSid - A2P BrandRegistration Sid
583
+ * @param {sid} brandVettingSid - SID for third-party vetting record
584
+ */
585
+ /* jshint ignore:end */
586
+ BrandVettingContext = function BrandVettingContext(version, brandSid,
587
+ brandVettingSid) {
588
+ this._version = version;
589
+
590
+ // Path Solution
591
+ this._solution = {brandSid: brandSid, brandVettingSid: brandVettingSid, };
592
+ this._uri = `/a2p/BrandRegistrations/${brandSid}/Vettings/${brandVettingSid}`;
593
+ };
594
+
595
+ /* jshint ignore:start */
596
+ /**
597
+ * fetch a BrandVettingInstance
598
+ *
599
+ * @function fetch
600
+ * @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingContext#
601
+ *
602
+ * @param {function} [callback] - Callback to handle processed record
603
+ *
604
+ * @returns {Promise} Resolves to processed BrandVettingInstance
605
+ */
606
+ /* jshint ignore:end */
607
+ BrandVettingContext.prototype.fetch = function fetch(callback) {
608
+ var deferred = Q.defer();
609
+ var promise = this._version.fetch({uri: this._uri, method: 'GET'});
610
+
611
+ promise = promise.then(function(payload) {
612
+ deferred.resolve(new BrandVettingInstance(
613
+ this._version,
614
+ payload,
615
+ this._solution.brandSid,
616
+ this._solution.brandVettingSid
617
+ ));
618
+ }.bind(this));
619
+
620
+ promise.catch(function(error) {
621
+ deferred.reject(error);
622
+ });
623
+
624
+ if (_.isFunction(callback)) {
625
+ deferred.promise.nodeify(callback);
626
+ }
627
+
628
+ return deferred.promise;
629
+ };
630
+
631
+ /* jshint ignore:start */
632
+ /**
633
+ * Provide a user-friendly representation
634
+ *
635
+ * @function toJSON
636
+ * @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingContext#
637
+ *
638
+ * @returns Object
639
+ */
640
+ /* jshint ignore:end */
641
+ BrandVettingContext.prototype.toJSON = function toJSON() {
642
+ return this._solution;
643
+ };
644
+
645
+ BrandVettingContext.prototype[util.inspect.custom] = function inspect(depth,
646
+ options) {
647
+ return util.inspect(this.toJSON(), options);
648
+ };
649
+
517
650
  module.exports = {
518
651
  BrandVettingList: BrandVettingList,
519
652
  BrandVettingPage: BrandVettingPage,
520
- BrandVettingInstance: BrandVettingInstance
653
+ BrandVettingInstance: BrandVettingInstance,
654
+ BrandVettingContext: BrandVettingContext
521
655
  };
@@ -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,6 +36,7 @@ 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.notificationPlatform - The transport technology used to generate the Notification Token
39
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
@@ -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
  }
@@ -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
@@ -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
 
@@ -10,7 +10,7 @@ import Response = require('../../../http/response');
10
10
  import V2 = require('../V2');
11
11
  import { SerializableClass } from '../../../interfaces';
12
12
 
13
- type VerificationAttemptChannels = 'sms'|'call'|'email';
13
+ type VerificationAttemptChannels = 'sms'|'call'|'email'|'whatsapp';
14
14
 
15
15
  type VerificationAttemptConversionStatus = 'converted'|'unconverted';
16
16