twilio 3.70.0 → 3.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGES.md +100 -0
  2. package/README.md +1 -1
  3. package/lib/jwt/ClientCapability.d.ts +1 -1
  4. package/lib/rest/Insights.d.ts +2 -0
  5. package/lib/rest/Insights.js +8 -0
  6. package/lib/rest/Supersim.d.ts +2 -0
  7. package/lib/rest/Supersim.js +8 -0
  8. package/lib/rest/Voice.d.ts +2 -0
  9. package/lib/rest/Voice.js +9 -0
  10. package/lib/rest/api/v2010/account/call.d.ts +1 -1
  11. package/lib/rest/api/v2010/account/call.js +1 -1
  12. package/lib/rest/api/v2010/account/message.d.ts +2 -0
  13. package/lib/rest/api/v2010/account/message.js +4 -1
  14. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +172 -0
  15. package/lib/rest/conversations/v1/service/configuration/webhook.js +400 -0
  16. package/lib/rest/conversations/v1/service/configuration.d.ts +2 -0
  17. package/lib/rest/conversations/v1/service/configuration.js +13 -0
  18. package/lib/rest/flexApi/v1/configuration.d.ts +4 -0
  19. package/lib/rest/flexApi/v1/configuration.js +5 -0
  20. package/lib/rest/frontlineApi/v1/user.d.ts +4 -0
  21. package/lib/rest/frontlineApi/v1/user.js +10 -1
  22. package/lib/rest/insights/V1.d.ts +3 -0
  23. package/lib/rest/insights/V1.js +11 -0
  24. package/lib/rest/insights/v1/setting.d.ts +181 -0
  25. package/lib/rest/insights/v1/setting.js +384 -0
  26. package/lib/rest/media/v1/mediaProcessor.d.ts +4 -0
  27. package/lib/rest/media/v1/mediaProcessor.js +5 -1
  28. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +46 -2
  29. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +139 -5
  30. package/lib/rest/messaging/v1/brandRegistration.d.ts +1 -1
  31. package/lib/rest/messaging/v1/brandRegistration.js +1 -1
  32. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  33. package/lib/rest/supersim/V1.d.ts +3 -0
  34. package/lib/rest/supersim/V1.js +11 -0
  35. package/lib/rest/supersim/v1/ipCommand.d.ts +362 -0
  36. package/lib/rest/supersim/v1/ipCommand.js +679 -0
  37. package/lib/rest/verify/v2/service/accessToken.d.ts +2 -0
  38. package/lib/rest/verify/v2/service/accessToken.js +3 -1
  39. package/lib/rest/verify/v2/service/entity/factor.d.ts +4 -2
  40. package/lib/rest/verify/v2/service/entity/factor.js +8 -3
  41. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +2 -2
  42. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  43. package/lib/rest/verify/v2/service/verification.d.ts +4 -0
  44. package/lib/rest/verify/v2/service/verification.js +6 -1
  45. package/lib/rest/verify/v2/service.d.ts +6 -0
  46. package/lib/rest/verify/v2/service.js +12 -2
  47. package/lib/rest/verify/v2/verificationAttempt.d.ts +1 -1
  48. package/lib/rest/video/v1/room.d.ts +12 -0
  49. package/lib/rest/video/v1/room.js +19 -1
  50. package/lib/rest/voice/V1.d.ts +3 -0
  51. package/lib/rest/voice/V1.js +12 -0
  52. package/lib/rest/voice/v1/archivedCall.d.ts +136 -0
  53. package/lib/rest/voice/v1/archivedCall.js +325 -0
  54. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  55. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  56. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  57. package/lib/rest/wireless/v1/sim.js +17 -27
  58. package/lib/twiml/VoiceResponse.d.ts +1296 -24
  59. package/lib/twiml/VoiceResponse.js +2170 -82
  60. package/package.json +1 -1
package/CHANGES.md CHANGED
@@ -1,6 +1,106 @@
1
1
  twilio-node changelog
2
2
  =====================
3
3
 
4
+ [2021-12-15] Version 3.72.0
5
+ ---------------------------
6
+ **Library - Feature**
7
+ - [PR #712](https://github.com/twilio/twilio-node/pull/712): run tests before deploying. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
8
+
9
+ **Api**
10
+ - Add optional boolean send_as_mms parameter to the create action of Message resource **(breaking change)**
11
+ - Change team ownership for `call` delete
12
+
13
+ **Conversations**
14
+ - Change wording for `Service Webhook Configuration` resource fields
15
+
16
+ **Insights**
17
+ - Added new APIs for updating and getting voice insights flags by accountSid.
18
+
19
+ **Media**
20
+ - Add max_duration param to MediaProcessor
21
+
22
+ **Video**
23
+ - Add `EmptyRoomTimeout` and `UnusedRoomTimeout` properties to a room; add corresponding parameters to room creation
24
+
25
+ **Voice**
26
+ - Add endpoint to delete archived Calls
27
+
28
+
29
+ [2021-12-01] Version 3.71.3
30
+ ---------------------------
31
+ **Conversations**
32
+ - Add `Service Webhook Configuration` resource
33
+
34
+ **Flex**
35
+ - Adding `flex_insights_drilldown` and `flex_url` objects to Flex Configuration
36
+
37
+ **Messaging**
38
+ - Update us_app_to_person endpoints to remove beta feature flag based access
39
+
40
+ **Supersim**
41
+ - Add IP Commands resource
42
+
43
+ **Verify**
44
+ - Add optional `factor_friendly_name` parameter to the create access token endpoint.
45
+
46
+ **Video**
47
+ - Add maxParticipantDuration param to Rooms
48
+
49
+ **Twiml**
50
+ - Unrevert Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
51
+ - Revert Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
52
+
53
+
54
+ [2021-11-17] Version 3.71.2
55
+ ---------------------------
56
+ **Library - Fix**
57
+ - [PR #707](https://github.com/twilio/twilio-node/pull/707): make ttl optional in ClientCapabilityOptions. Thanks to [@ghmeier](https://github.com/ghmeier)!
58
+ - [PR #704](https://github.com/twilio/twilio-node/pull/704): git log retrieval issues. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
59
+
60
+ **Frontline**
61
+ - Added `is_available` to User's resource
62
+
63
+ **Messaging**
64
+ - Added GET vetting API
65
+
66
+ **Verify**
67
+ - Add `WHATSAPP` to the attempts API.
68
+ - Allow to update `config.notification_platform` from `none` to `apn` or `fcm` and viceversa for Verify Push
69
+ - Add `none` as a valid `config.notification_platform` value for Verify Push
70
+
71
+ **Twiml**
72
+ - Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
73
+
74
+
75
+ [2021-11-03] Version 3.71.1
76
+ ---------------------------
77
+ **Library - Fix**
78
+ - [PR #705](https://github.com/twilio/twilio-node/pull/705): node setup wf step. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
79
+
80
+
81
+ [2021-11-03] Version 3.71.0
82
+ ---------------------------
83
+ **Library - Chore**
84
+ - [PR #703](https://github.com/twilio/twilio-node/pull/703): fix Docker image tag. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
85
+ - [PR #702](https://github.com/twilio/twilio-node/pull/702): migrate from TravisCI to GitHub Actions. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
86
+
87
+ **Api**
88
+ - Updated `media_url` property to be treated as PII
89
+
90
+ **Messaging**
91
+ - Added a new enum for brand registration status named DELETED **(breaking change)**
92
+ - Add a new K12_EDUCATION use case in us_app_to_person_usecase api transaction
93
+ - Added a new enum for brand registration status named IN_REVIEW
94
+
95
+ **Serverless**
96
+ - Add node14 as a valid Build runtime
97
+
98
+ **Verify**
99
+ - Fix typos in Verify Push Factor documentation for the `config.notification_token` parameter.
100
+ - Added `TemplateCustomSubstitutions` on verification creation
101
+ - Make `TemplateSid` parameter public for Verification resource and `DefaultTemplateSid` parameter public for Service resource. **(breaking change)**
102
+
103
+
4
104
  [2021-10-18] Version 3.70.0
5
105
  ---------------------------
6
106
  **Library - Feature**
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![NPM](https://nodei.co/npm/twilio.png?downloads=true&stars=true)](https://nodei.co/npm/twilio/)
4
4
 
5
- [![Build Status](https://travis-ci.com/twilio/twilio-node.svg?branch=main)](https://travis-ci.com/twilio/twilio-node)
5
+ [![Tests](https://github.com/twilio/twilio-node/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/twilio/twilio-node/actions/workflows/test-and-deploy.yml)
6
6
  [![Learn with TwilioQuest](https://img.shields.io/static/v1?label=TwilioQuest&message=Learn%20to%20contribute%21&color=F22F46&labelColor=1f243c&style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAASFBMVEUAAAAZGRkcHBwjIyMoKCgAAABgYGBoaGiAgICMjIyzs7PJycnMzMzNzc3UoBfd3d3m5ubqrhfrMEDu7u739/f4vSb/3AD///9tbdyEAAAABXRSTlMAAAAAAMJrBrEAAAKoSURBVHgB7ZrRcuI6EESdyxXGYoNFvMD//+l2bSszRgyUYpFAsXOeiJGmj4NkuWx1Qeh+Ekl9DgEXOBwOx+Px5xyQhDykfgq4wG63MxxaR4ddIkg6Ul3g84vCIcjPBA5gmUMeXESrlukuoK33+33uID8TWeLAdOWsKpJYzwVMB7bOzYSGOciyUlXSn0/ABXTosJ1M1SbypZ4O4MbZuIDMU02PMbauhhHMHXbmebmALIiEbbbbbUrpF1gwE9kFfRNAJaP+FQEXCCTGyJ4ngDrjOFo3jEL5JdqjF/pueR4cCeCGgAtwmuRS6gDwaRiGvu+DMFwSBLTE3+jF8JyuV1okPZ+AC4hDFhCHyHQjdjPHUKFDlHSJkHQXMB3KpSwXNGJPcwwTdZiXlRN0gSp0zpWxNtM0beYE0nRH6QIbO7rawwXaBYz0j78gxjokDuv12gVeUuBD0MDi0OQCLvDaAho4juP1Q/jkAncXqIcCfd+7gAu4QLMACCLxpRsSuQh0igu0C9Svhi7weAGZg50L3IE3cai4IfkNZAC8dfdhsUD3CgKBVC9JE5ABAFzg4QL/taYPAAWrHdYcgfLaIgAXWJ7OV38n1LEF8tt2TH29E+QAoDoO5Ve/LtCQDmKM9kPbvCEBApK+IXzbcSJ0cIGF6e8gpcRhUDogWZ8JnaWjPXc/fNnBBUKRngiHgTUSivSzDRDgHZQOLvBQgf8rRt+VdBUUhwkU6VpJ+xcOwQUqZr+mR0kvBUgv6cB4+37hQAkXqE8PwGisGhJtN4xAHMzrsgvI7rccXqSvKh6jltGlrOHA3Xk1At3LC4QiPdX9/0ndHpGVvTjR4bZA1ypAKgVcwE5vx74ulwIugDt8e/X7JgfkucBMIAr26ndnB4UCLnDOqvteQsHlgX9N4A+c4cW3DXSPbwAAAABJRU5ErkJggg==)](https://twil.io/learn-open-source)
7
7
 
8
8
  **The default branch name for this repository has been changed to `main` as of 07/27/2020.**
@@ -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
 
@@ -11,6 +11,7 @@ import V1 = require('./insights/V1');
11
11
  import { CallListInstance } from './insights/v1/call';
12
12
  import { CallSummariesListInstance } from './insights/v1/callSummaries';
13
13
  import { RoomListInstance } from './insights/v1/room';
14
+ import { SettingListInstance } from './insights/v1/setting';
14
15
 
15
16
 
16
17
  declare class Insights extends Domain {
@@ -24,6 +25,7 @@ declare class Insights extends Domain {
24
25
  readonly callSummaries: CallSummariesListInstance;
25
26
  readonly calls: CallListInstance;
26
27
  readonly rooms: RoomListInstance;
28
+ readonly settings: SettingListInstance;
27
29
  readonly v1: V1;
28
30
  }
29
31
 
@@ -21,6 +21,7 @@ var V1 = require('./insights/V1'); /* jshint ignore:line */
21
21
  * @constructor Twilio.Insights
22
22
  *
23
23
  * @property {Twilio.Insights.V1} v1 - v1 version
24
+ * @property {Twilio.Insights.V1.SettingList} settings - settings resource
24
25
  * @property {Twilio.Insights.V1.CallList} calls - calls resource
25
26
  * @property {Twilio.Insights.V1.CallSummariesList} callSummaries -
26
27
  * callSummaries resource
@@ -47,6 +48,13 @@ Object.defineProperty(Insights.prototype,
47
48
  }
48
49
  });
49
50
 
51
+ Object.defineProperty(Insights.prototype,
52
+ 'settings', {
53
+ get: function() {
54
+ return this.v1.settings;
55
+ }
56
+ });
57
+
50
58
  Object.defineProperty(Insights.prototype,
51
59
  'calls', {
52
60
  get: function() {
@@ -10,6 +10,7 @@ import Twilio = require('./Twilio');
10
10
  import V1 = require('./supersim/V1');
11
11
  import { CommandListInstance } from './supersim/v1/command';
12
12
  import { FleetListInstance } from './supersim/v1/fleet';
13
+ import { IpCommandListInstance } from './supersim/v1/ipCommand';
13
14
  import { NetworkAccessProfileListInstance } from './supersim/v1/networkAccessProfile';
14
15
  import { NetworkListInstance } from './supersim/v1/network';
15
16
  import { SimListInstance } from './supersim/v1/sim';
@@ -27,6 +28,7 @@ declare class Supersim extends Domain {
27
28
 
28
29
  readonly commands: CommandListInstance;
29
30
  readonly fleets: FleetListInstance;
31
+ readonly ipCommands: IpCommandListInstance;
30
32
  readonly networkAccessProfiles: NetworkAccessProfileListInstance;
31
33
  readonly networks: NetworkListInstance;
32
34
  readonly sims: SimListInstance;
@@ -23,6 +23,7 @@ var V1 = require('./supersim/V1'); /* jshint ignore:line */
23
23
  * @property {Twilio.Supersim.V1} v1 - v1 version
24
24
  * @property {Twilio.Supersim.V1.CommandList} commands - commands resource
25
25
  * @property {Twilio.Supersim.V1.FleetList} fleets - fleets resource
26
+ * @property {Twilio.Supersim.V1.IpCommandList} ipCommands - ipCommands resource
26
27
  * @property {Twilio.Supersim.V1.NetworkList} networks - networks resource
27
28
  * @property {Twilio.Supersim.V1.NetworkAccessProfileList} networkAccessProfiles -
28
29
  * networkAccessProfiles resource
@@ -66,6 +67,13 @@ Object.defineProperty(Supersim.prototype,
66
67
  }
67
68
  });
68
69
 
70
+ Object.defineProperty(Supersim.prototype,
71
+ 'ipCommands', {
72
+ get: function() {
73
+ return this.v1.ipCommands;
74
+ }
75
+ });
76
+
69
77
  Object.defineProperty(Supersim.prototype,
70
78
  'networks', {
71
79
  get: function() {
@@ -8,6 +8,7 @@
8
8
  import Domain = require('../base/Domain');
9
9
  import Twilio = require('./Twilio');
10
10
  import V1 = require('./voice/V1');
11
+ import { ArchivedCallListInstance } from './voice/v1/archivedCall';
11
12
  import { ByocTrunkListInstance } from './voice/v1/byocTrunk';
12
13
  import { ConnectionPolicyListInstance } from './voice/v1/connectionPolicy';
13
14
  import { DialingPermissionsListInstance } from './voice/v1/dialingPermissions';
@@ -23,6 +24,7 @@ declare class Voice extends Domain {
23
24
  */
24
25
  constructor(twilio: Twilio);
25
26
 
27
+ readonly archivedCalls: ArchivedCallListInstance;
26
28
  readonly byocTrunks: ByocTrunkListInstance;
27
29
  readonly connectionPolicies: ConnectionPolicyListInstance;
28
30
  readonly dialingPermissions: DialingPermissionsListInstance;
package/lib/rest/Voice.js CHANGED
@@ -21,6 +21,8 @@ var V1 = require('./voice/V1'); /* jshint ignore:line */
21
21
  * @constructor Twilio.Voice
22
22
  *
23
23
  * @property {Twilio.Voice.V1} v1 - v1 version
24
+ * @property {Twilio.Voice.V1.ArchivedCallList} archivedCalls -
25
+ * archivedCalls resource
24
26
  * @property {Twilio.Voice.V1.ByocTrunkList} byocTrunks - byocTrunks resource
25
27
  * @property {Twilio.Voice.V1.ConnectionPolicyList} connectionPolicies -
26
28
  * connectionPolicies resource
@@ -51,6 +53,13 @@ Object.defineProperty(Voice.prototype,
51
53
  }
52
54
  });
53
55
 
56
+ Object.defineProperty(Voice.prototype,
57
+ 'archivedCalls', {
58
+ get: function() {
59
+ return this.v1.archivedCalls;
60
+ }
61
+ });
62
+
54
63
  Object.defineProperty(Voice.prototype,
55
64
  'byocTrunks', {
56
65
  get: function() {
@@ -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
@@ -180,6 +180,7 @@ interface MessageListInstance {
180
180
  * @property messagingServiceSid - The SID of the Messaging Service you want to associate with the message.
181
181
  * @property persistentAction - Rich actions for Channels Messages.
182
182
  * @property provideFeedback - Whether to confirm delivery of the message
183
+ * @property sendAsMms - If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media
183
184
  * @property smartEncoded - Whether to detect Unicode characters that have a similar GSM-7 character and replace them
184
185
  * @property statusCallback - The URL we should call to send status information to your application
185
186
  * @property to - The destination phone number
@@ -198,6 +199,7 @@ interface MessageListInstanceCreateOptions {
198
199
  messagingServiceSid?: string;
199
200
  persistentAction?: string | string[];
200
201
  provideFeedback?: boolean;
202
+ sendAsMms?: boolean;
201
203
  smartEncoded?: boolean;
202
204
  statusCallback?: string;
203
205
  to: string;
@@ -83,6 +83,8 @@ MessageList = function MessageList(version, accountSid) {
83
83
  * Whether to detect Unicode characters that have a similar GSM-7 character and replace them
84
84
  * @param {string|list} [opts.persistentAction] -
85
85
  * Rich actions for Channels Messages.
86
+ * @param {boolean} [opts.sendAsMms] -
87
+ * If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media
86
88
  * @param {string} [opts.from] - The phone number that initiated the message
87
89
  * @param {string} [opts.messagingServiceSid] -
88
90
  * The SID of the Messaging Service you want to associate with the message.
@@ -120,7 +122,8 @@ MessageList = function MessageList(version, accountSid) {
120
122
  'ContentRetention': _.get(opts, 'contentRetention'),
121
123
  'AddressRetention': _.get(opts, 'addressRetention'),
122
124
  'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded')),
123
- 'PersistentAction': serialize.map(_.get(opts, 'persistentAction'), function(e) { return e; })
125
+ 'PersistentAction': serialize.map(_.get(opts, 'persistentAction'), function(e) { return e; }),
126
+ 'SendAsMms': serialize.bool(_.get(opts, 'sendAsMms'))
124
127
  });
125
128
 
126
129
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -0,0 +1,172 @@
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 V1 = require('../../../V1');
11
+ import { SerializableClass } from '../../../../../interfaces';
12
+
13
+ type WebhookMethod = 'GET'|'POST';
14
+
15
+ /**
16
+ * Initialize the WebhookList
17
+ *
18
+ * @param version - Version of the resource
19
+ * @param chatServiceSid - The unique string that identifies the resource
20
+ */
21
+ declare function WebhookList(version: V1, chatServiceSid: string): WebhookListInstance;
22
+
23
+ /**
24
+ * Options to pass to update
25
+ *
26
+ * @property filters - The list of events that your configured webhook targets will receive. Events not configured here will not fire.
27
+ * @property method - The HTTP method to be used when sending a webhook request
28
+ * @property postWebhookUrl - The absolute url the post-event webhook request should be sent to.
29
+ * @property preWebhookUrl - The absolute url the pre-event webhook request should be sent to.
30
+ */
31
+ interface WebhookInstanceUpdateOptions {
32
+ filters?: string | string[];
33
+ method?: string;
34
+ postWebhookUrl?: string;
35
+ preWebhookUrl?: string;
36
+ }
37
+
38
+ interface WebhookListInstance {
39
+ /**
40
+ * @param sid - sid of instance
41
+ */
42
+ (sid: string): WebhookContext;
43
+ /**
44
+ * Constructs a webhook
45
+ */
46
+ get(): WebhookContext;
47
+ /**
48
+ * Provide a user-friendly representation
49
+ */
50
+ toJSON(): any;
51
+ }
52
+
53
+ interface WebhookPayload extends WebhookResource, Page.TwilioResponsePayload {
54
+ }
55
+
56
+ interface WebhookResource {
57
+ account_sid: string;
58
+ chat_service_sid: string;
59
+ filters: string[];
60
+ method: WebhookMethod;
61
+ post_webhook_url: string;
62
+ pre_webhook_url: string;
63
+ url: string;
64
+ }
65
+
66
+ interface WebhookSolution {
67
+ chatServiceSid?: string;
68
+ }
69
+
70
+
71
+ declare class WebhookContext {
72
+ /**
73
+ * Initialize the WebhookContext
74
+ *
75
+ * @param version - Version of the resource
76
+ * @param chatServiceSid - The unique ID of the {@link https://www.twilio.com/docs/conversations/api/service-resource|Conversation Service} this conversation belongs to.
77
+ */
78
+ constructor(version: V1, chatServiceSid: string);
79
+
80
+ /**
81
+ * fetch a WebhookInstance
82
+ *
83
+ * @param callback - Callback to handle processed record
84
+ */
85
+ fetch(callback?: (error: Error | null, items: WebhookInstance) => any): Promise<WebhookInstance>;
86
+ /**
87
+ * Provide a user-friendly representation
88
+ */
89
+ toJSON(): any;
90
+ /**
91
+ * update a WebhookInstance
92
+ *
93
+ * @param callback - Callback to handle processed record
94
+ */
95
+ update(callback?: (error: Error | null, items: WebhookInstance) => any): Promise<WebhookInstance>;
96
+ /**
97
+ * update a WebhookInstance
98
+ *
99
+ * @param opts - Options for request
100
+ * @param callback - Callback to handle processed record
101
+ */
102
+ update(opts?: WebhookInstanceUpdateOptions, callback?: (error: Error | null, items: WebhookInstance) => any): Promise<WebhookInstance>;
103
+ }
104
+
105
+
106
+ declare class WebhookInstance extends SerializableClass {
107
+ /**
108
+ * Initialize the WebhookContext
109
+ *
110
+ * @param version - Version of the resource
111
+ * @param payload - The instance payload
112
+ * @param chatServiceSid - The unique string that identifies the resource
113
+ */
114
+ constructor(version: V1, payload: WebhookPayload, chatServiceSid: string);
115
+
116
+ private _proxy: WebhookContext;
117
+ accountSid: string;
118
+ chatServiceSid: string;
119
+ /**
120
+ * fetch a WebhookInstance
121
+ *
122
+ * @param callback - Callback to handle processed record
123
+ */
124
+ fetch(callback?: (error: Error | null, items: WebhookInstance) => any): Promise<WebhookInstance>;
125
+ filters: string[];
126
+ method: WebhookMethod;
127
+ postWebhookUrl: string;
128
+ preWebhookUrl: string;
129
+ /**
130
+ * Provide a user-friendly representation
131
+ */
132
+ toJSON(): any;
133
+ /**
134
+ * update a WebhookInstance
135
+ *
136
+ * @param callback - Callback to handle processed record
137
+ */
138
+ update(callback?: (error: Error | null, items: WebhookInstance) => any): Promise<WebhookInstance>;
139
+ /**
140
+ * update a WebhookInstance
141
+ *
142
+ * @param opts - Options for request
143
+ * @param callback - Callback to handle processed record
144
+ */
145
+ update(opts?: WebhookInstanceUpdateOptions, callback?: (error: Error | null, items: WebhookInstance) => any): Promise<WebhookInstance>;
146
+ url: string;
147
+ }
148
+
149
+
150
+ declare class WebhookPage extends Page<V1, WebhookPayload, WebhookResource, WebhookInstance> {
151
+ /**
152
+ * Initialize the WebhookPage
153
+ *
154
+ * @param version - Version of the resource
155
+ * @param response - Response from the API
156
+ * @param solution - Path solution
157
+ */
158
+ constructor(version: V1, response: Response<string>, solution: WebhookSolution);
159
+
160
+ /**
161
+ * Build an instance of WebhookInstance
162
+ *
163
+ * @param payload - Payload response from the API
164
+ */
165
+ getInstance(payload: WebhookPayload): WebhookInstance;
166
+ /**
167
+ * Provide a user-friendly representation
168
+ */
169
+ toJSON(): any;
170
+ }
171
+
172
+ export { WebhookContext, WebhookInstance, WebhookInstanceUpdateOptions, WebhookList, WebhookListInstance, WebhookMethod, WebhookPage, WebhookPayload, WebhookResource, WebhookSolution }