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.
Files changed (71) hide show
  1. package/CHANGES.md +83 -0
  2. package/lib/base/RequestClient.js +1 -0
  3. package/lib/jwt/AccessToken.d.ts +16 -0
  4. package/lib/jwt/AccessToken.js +20 -0
  5. package/lib/rest/Media.d.ts +28 -0
  6. package/lib/rest/Media.js +64 -0
  7. package/lib/rest/Twilio.d.ts +2 -0
  8. package/lib/rest/Twilio.js +14 -0
  9. package/lib/rest/Verify.d.ts +2 -0
  10. package/lib/rest/Verify.js +8 -0
  11. package/lib/rest/api/v2010/account/call/siprec.d.ts +776 -0
  12. package/lib/rest/api/v2010/account/call/siprec.js +811 -0
  13. package/lib/rest/api/v2010/account/call.d.ts +7 -0
  14. package/lib/rest/api/v2010/account/call.js +28 -0
  15. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -2
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +5 -2
  17. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -2
  18. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +5 -2
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -2
  20. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +5 -2
  21. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +7 -3
  22. package/lib/rest/api/v2010/account/incomingPhoneNumber.js +7 -4
  23. package/lib/rest/conversations/v1/service/configuration/notification.d.ts +6 -0
  24. package/lib/rest/conversations/v1/service/configuration/notification.js +11 -1
  25. package/lib/rest/events/v1/sink.d.ts +1 -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/insights/v1/callSummaries.d.ts +27 -27
  29. package/lib/rest/insights/v1/callSummaries.js +35 -35
  30. package/lib/rest/media/V1.d.ts +28 -0
  31. package/lib/rest/media/V1.js +59 -0
  32. package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
  33. package/lib/rest/media/v1/mediaProcessor.js +702 -0
  34. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
  35. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
  36. package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
  37. package/lib/rest/media/v1/playerStreamer.js +729 -0
  38. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +286 -0
  39. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +521 -0
  40. package/lib/rest/messaging/v1/brandRegistration.d.ts +30 -1
  41. package/lib/rest/messaging/v1/brandRegistration.js +54 -1
  42. package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +2 -0
  43. package/lib/rest/messaging/v1/service/usAppToPerson.js +3 -0
  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/environment.js +1 -1
  53. package/lib/rest/serverless/v1/service.d.ts +2 -0
  54. package/lib/rest/serverless/v1/service.js +3 -0
  55. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
  56. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
  57. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
  58. package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
  59. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
  60. package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
  61. package/lib/rest/trunking/v1/trunk.d.ts +9 -1
  62. package/lib/rest/trunking/v1/trunk.js +13 -2
  63. package/lib/rest/verify/V2.d.ts +3 -0
  64. package/lib/rest/verify/V2.js +11 -0
  65. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  66. package/lib/rest/verify/v2/service/verification.js +1 -1
  67. package/lib/rest/verify/v2/template.d.ts +242 -0
  68. package/lib/rest/verify/v2/template.js +440 -0
  69. package/lib/rest/video/v1/room.d.ts +4 -0
  70. package/lib/rest/video/v1/room.js +7 -1
  71. package/package.json +2 -2
package/CHANGES.md CHANGED
@@ -1,6 +1,89 @@
1
1
  twilio-node changelog
2
2
  =====================
3
3
 
4
+ [2021-10-18] Version 3.70.0
5
+ ---------------------------
6
+ **Library - Feature**
7
+ - [PR #700](https://github.com/twilio/twilio-node/pull/700): Add PlaybackGrant. Thanks to [@sarahcstringer](https://github.com/sarahcstringer)!
8
+
9
+ **Library - Fix**
10
+ - [PR #695](https://github.com/twilio/twilio-node/pull/695): Update Axios package. Thanks to [@houmark](https://github.com/houmark)!
11
+
12
+ **Api**
13
+ - Corrected enum values for `emergency_address_status` values in `/IncomingPhoneNumbers` response. **(breaking change)**
14
+ - Clarify `emergency_address_status` values in `/IncomingPhoneNumbers` response.
15
+
16
+ **Messaging**
17
+ - Add PUT and List brand vettings api
18
+ - Removes beta feature flag based visibility for us_app_to_person_registered and usecase field.Updates test cases to add POLITICAL usecase. **(breaking change)**
19
+ - Add brand_feedback as optional field to BrandRegistrations
20
+
21
+ **Video**
22
+ - Add `AudioOnly` to create room
23
+
24
+
25
+ [2021-10-06] Version 3.69.0
26
+ ---------------------------
27
+ **Api**
28
+ - Add `emergency_address_status` attribute to `/IncomingPhoneNumbers` response.
29
+ - Add `siprec` resource
30
+
31
+ **Conversations**
32
+ - Added attachment parameters in configuration for `NewMessage` type of push notifications
33
+
34
+ **Flex**
35
+ - Adding `flex_insights_hr` object to Flex Configuration
36
+
37
+ **Numbers**
38
+ - Add API endpoint for Bundle ReplaceItems resource
39
+ - Add API endpoint for Bundle Copies resource
40
+
41
+ **Serverless**
42
+ - Add domain_base field to Service response
43
+
44
+ **Taskrouter**
45
+ - Add `If-Match` Header based on ETag for Worker Delete **(breaking change)**
46
+ - Add `If-Match` Header based on Etag for Reservation Update
47
+ - Add `If-Match` Header based on ETag for Worker Update
48
+ - Add `If-Match` Header based on ETag for Worker Delete
49
+ - Add `ETag` as Response Header to Worker
50
+
51
+ **Trunking**
52
+ - Added `transfer_caller_id` property on Trunks.
53
+
54
+ **Verify**
55
+ - Document new pilot `whatsapp` channel.
56
+
57
+
58
+ [2021-09-22] Version 3.68.0
59
+ ---------------------------
60
+ **Library - Feature**
61
+ - [PR #692](https://github.com/twilio/twilio-node/pull/692): add API response headers to the returned response. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
62
+
63
+ **Events**
64
+ - Add segment sink
65
+
66
+ **Messaging**
67
+ - Add post_approval_required attribute in GET us_app_to_person_usecase api response
68
+ - Add Identity Status, Russell 3000, Tax Exempt Status and Should Skip SecVet fields for Brand Registrations
69
+ - Add Should Skip Secondary Vetting optional flag parameter to create Brand API
70
+
71
+
72
+ [2021-09-08] Version 3.67.2
73
+ ---------------------------
74
+ **Api**
75
+ - Revert adding `siprec` resource
76
+ - Add `siprec` resource
77
+
78
+ **Messaging**
79
+ - Add 'mock' as an optional field to brand_registration api
80
+ - Add 'mock' as an optional field to us_app_to_person api
81
+ - Adds more Use Cases in us_app_to_person_usecase api transaction and updates us_app_to_person_usecase docs
82
+
83
+ **Verify**
84
+ - Verify List Templates API endpoint added.
85
+
86
+
4
87
  [2021-08-25] Version 3.67.1
5
88
  ---------------------------
6
89
  **Library - Fix**
@@ -108,6 +108,7 @@ RequestClient.prototype.request = function (opts) {
108
108
  deferred.resolve({
109
109
  statusCode: response.status,
110
110
  body: response.data,
111
+ headers: response.headers,
111
112
  });
112
113
  }).catch((error) => {
113
114
  _this.lastResponse = undefined;
@@ -177,6 +177,22 @@ declare namespace AccessToken {
177
177
  endpointId?: string;
178
178
  }
179
179
 
180
+ export interface PlaybackGrantOptions {
181
+ grant?: object;
182
+ }
183
+
184
+ export interface PlaybackGrantPayload {
185
+ grant?: object;
186
+ }
187
+
188
+ export class PlaybackGrant extends Grant<
189
+ PlaybackGrantOptions,
190
+ PlaybackGrantPayload,
191
+ 'player'
192
+ > implements PlaybackGrantOptions {
193
+ grant?: object
194
+ }
195
+
180
196
  export interface AccessTokenOptions {
181
197
  /**
182
198
  * Time to live in seconds
@@ -199,6 +199,25 @@ _.extend(VoiceGrant.prototype, {
199
199
  }
200
200
  });
201
201
 
202
+ /**
203
+ * @constructor
204
+ * @param {object} options - ...
205
+ * @param {string} options.grant - The PlaybackGrant retrieved from Twilio's API
206
+ */
207
+ function PlaybackGrant(options) {
208
+ options = options || {};
209
+ this.grant = options.grant;
210
+ }
211
+
212
+ _.extend(PlaybackGrant.prototype, {
213
+ key: 'player',
214
+ toPayload: function() {
215
+ var grant = {};
216
+ if (this.grant) { grant = this.grant; }
217
+ return grant;
218
+ }
219
+ });
220
+
202
221
  /**
203
222
  * @constructor
204
223
  * @param {string} accountSid - The account's unique ID to which access is scoped
@@ -234,6 +253,7 @@ AccessToken.SyncGrant = SyncGrant;
234
253
  AccessToken.VideoGrant = VideoGrant;
235
254
  AccessToken.ConversationsGrant = util.deprecate(ConversationsGrant, 'ConversationsGrant is deprecated, use VideoGrant instead.');
236
255
  AccessToken.TaskRouterGrant = TaskRouterGrant;
256
+ AccessToken.PlaybackGrant = PlaybackGrant;
237
257
  AccessToken.DEFAULT_ALGORITHM = 'HS256';
238
258
  AccessToken.ALGORITHMS = [
239
259
  'HS256',
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Domain = require('../base/Domain');
9
+ import Twilio = require('./Twilio');
10
+ import V1 = require('./media/V1');
11
+ import { MediaProcessorListInstance } from './media/v1/mediaProcessor';
12
+ import { PlayerStreamerListInstance } from './media/v1/playerStreamer';
13
+
14
+
15
+ declare class Media extends Domain {
16
+ /**
17
+ * Initialize media domain
18
+ *
19
+ * @param twilio - The twilio client
20
+ */
21
+ constructor(twilio: Twilio);
22
+
23
+ readonly mediaProcessor: MediaProcessorListInstance;
24
+ readonly playerStreamer: PlayerStreamerListInstance;
25
+ readonly v1: V1;
26
+ }
27
+
28
+ export = Media;
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ /* jshint ignore:start */
4
+ /**
5
+ * This code was generated by
6
+ * \ / _ _ _| _ _
7
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
8
+ * / /
9
+ */
10
+ /* jshint ignore:end */
11
+
12
+ var _ = require('lodash'); /* jshint ignore:line */
13
+ var Domain = require('../base/Domain'); /* jshint ignore:line */
14
+ var V1 = require('./media/V1'); /* jshint ignore:line */
15
+
16
+
17
+ /* jshint ignore:start */
18
+ /**
19
+ * Initialize media domain
20
+ *
21
+ * @constructor Twilio.Media
22
+ *
23
+ * @property {Twilio.Media.V1} v1 - v1 version
24
+ * @property {Twilio.Media.V1.MediaProcessorList} mediaProcessor -
25
+ * mediaProcessor resource
26
+ * @property {Twilio.Media.V1.PlayerStreamerList} playerStreamer -
27
+ * playerStreamer resource
28
+ *
29
+ * @param {Twilio} twilio - The twilio client
30
+ */
31
+ /* jshint ignore:end */
32
+ function Media(twilio) {
33
+ Domain.prototype.constructor.call(this, twilio, 'https://media.twilio.com');
34
+
35
+ // Versions
36
+ this._v1 = undefined;
37
+ }
38
+
39
+ _.extend(Media.prototype, Domain.prototype);
40
+ Media.prototype.constructor = Media;
41
+
42
+ Object.defineProperty(Media.prototype,
43
+ 'v1', {
44
+ get: function() {
45
+ this._v1 = this._v1 || new V1(this);
46
+ return this._v1;
47
+ }
48
+ });
49
+
50
+ Object.defineProperty(Media.prototype,
51
+ 'mediaProcessor', {
52
+ get: function() {
53
+ return this.v1.mediaProcessor;
54
+ }
55
+ });
56
+
57
+ Object.defineProperty(Media.prototype,
58
+ 'playerStreamer', {
59
+ get: function() {
60
+ return this.v1.playerStreamer;
61
+ }
62
+ });
63
+
64
+ module.exports = Media;
@@ -18,6 +18,7 @@ import FrontlineApi = require('./FrontlineApi');
18
18
  import Insights = require('./Insights');
19
19
  import IpMessaging = require('./IpMessaging');
20
20
  import Lookups = require('./Lookups');
21
+ import Media = require('./Media');
21
22
  import Messaging = require('./Messaging');
22
23
  import Monitor = require('./Monitor');
23
24
  import Notify = require('./Notify');
@@ -72,6 +73,7 @@ declare class Twilio {
72
73
  ipMessaging: IpMessaging;
73
74
  keys: (typeof Api.prototype.account.keys);
74
75
  lookups: Lookups;
76
+ media: Media;
75
77
  messages: (typeof Api.prototype.account.messages);
76
78
  messaging: Messaging;
77
79
  monitor: Monitor;
@@ -34,6 +34,7 @@ var RestException = require('../base/RestException'); /* jshint ignore:line */
34
34
  * @property {Twilio.Insights} insights - insights domain
35
35
  * @property {Twilio.IpMessaging} ipMessaging - ip_messaging domain
36
36
  * @property {Twilio.Lookups} lookups - lookups domain
37
+ * @property {Twilio.Media} media - media domain
37
38
  * @property {Twilio.Messaging} messaging - messaging domain
38
39
  * @property {Twilio.Monitor} monitor - monitor domain
39
40
  * @property {Twilio.Notify} notify - notify domain
@@ -159,6 +160,7 @@ function Twilio(username, password, opts) {
159
160
  this._insights = undefined;
160
161
  this._ipMessaging = undefined;
161
162
  this._lookups = undefined;
163
+ this._media = undefined;
162
164
  this._messaging = undefined;
163
165
  this._monitor = undefined;
164
166
  this._notify = undefined;
@@ -192,6 +194,7 @@ function Twilio(username, password, opts) {
192
194
  this.insights;
193
195
  this.ipMessaging;
194
196
  this.lookups;
197
+ this.media;
195
198
  this.messaging;
196
199
  this.monitor;
197
200
  this.notify;
@@ -491,6 +494,17 @@ Object.defineProperty(Twilio.prototype,
491
494
  }
492
495
  });
493
496
 
497
+ Object.defineProperty(Twilio.prototype,
498
+ 'media', {
499
+ get: function() {
500
+ if (!this._media) {
501
+ var Media = require('./Media'); /* jshint ignore:line */
502
+ this._media = new Media(this);
503
+ }
504
+ return this._media;
505
+ }
506
+ });
507
+
494
508
  Object.defineProperty(Twilio.prototype,
495
509
  'messaging', {
496
510
  get: function() {
@@ -10,6 +10,7 @@ import Twilio = require('./Twilio');
10
10
  import V2 = require('./verify/V2');
11
11
  import { FormListInstance } from './verify/v2/form';
12
12
  import { ServiceListInstance } from './verify/v2/service';
13
+ import { TemplateListInstance } from './verify/v2/template';
13
14
  import { VerificationAttemptListInstance } from './verify/v2/verificationAttempt';
14
15
 
15
16
 
@@ -23,6 +24,7 @@ declare class Verify extends Domain {
23
24
 
24
25
  readonly forms: FormListInstance;
25
26
  readonly services: ServiceListInstance;
27
+ readonly templates: TemplateListInstance;
26
28
  readonly v2: V2;
27
29
  readonly verificationAttempts: VerificationAttemptListInstance;
28
30
  }
@@ -25,6 +25,7 @@ var V2 = require('./verify/V2'); /* jshint ignore:line */
25
25
  * @property {Twilio.Verify.V2.ServiceList} services - services resource
26
26
  * @property {Twilio.Verify.V2.VerificationAttemptList} verificationAttempts -
27
27
  * verificationAttempts resource
28
+ * @property {Twilio.Verify.V2.TemplateList} templates - templates resource
28
29
  *
29
30
  * @param {Twilio} twilio - The twilio client
30
31
  */
@@ -68,4 +69,11 @@ Object.defineProperty(Verify.prototype,
68
69
  }
69
70
  });
70
71
 
72
+ Object.defineProperty(Verify.prototype,
73
+ 'templates', {
74
+ get: function() {
75
+ return this.v2.templates;
76
+ }
77
+ });
78
+
71
79
  module.exports = Verify;