twilio 5.5.2 → 5.6.1
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/lib/base/BaseTwilio.js +2 -1
- package/lib/rest/MessagingBase.d.ts +3 -0
- package/lib/rest/MessagingBase.js +5 -0
- package/lib/rest/accounts/v1/bulkConsents.d.ts +1 -1
- package/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts +10 -12
- package/lib/rest/api/v2010/account/address/dependentPhoneNumber.js +2 -2
- package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
- package/lib/rest/api/v2010/account/call.d.ts +1 -1
- package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -2
- package/lib/rest/content/v1/content/approvalFetch.d.ts +3 -3
- package/lib/rest/content/v1/content.d.ts +9 -6
- package/lib/rest/content/v1/contentAndApprovals.d.ts +9 -9
- package/lib/rest/content/v1/legacyContent.d.ts +6 -6
- package/lib/rest/events/v1/subscription.d.ts +0 -10
- package/lib/rest/events/v1/subscription.js +0 -6
- package/lib/rest/flexApi/v1/interaction.d.ts +47 -0
- package/lib/rest/flexApi/v1/interaction.js +32 -0
- package/lib/rest/messaging/V2.d.ts +15 -0
- package/lib/rest/messaging/V2.js +37 -0
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +0 -6
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +0 -2
- package/lib/rest/messaging/v2/channelsSender.d.ts +453 -0
- package/lib/rest/messaging/v2/channelsSender.js +301 -0
- package/lib/rest/numbers/V1.d.ts +5 -5
- package/lib/rest/numbers/V1.js +8 -6
- package/lib/rest/numbers/v1/{webhook.d.ts → portingWebhookConfigurationFetch.d.ts} +10 -10
- package/lib/rest/numbers/v1/{webhook.js → portingWebhookConfigurationFetch.js} +6 -6
- package/lib/rest/serverless/v1/service/build.d.ts +1 -1
- package/lib/rest/verify/v2/verificationAttemptsSummary.d.ts +3 -3
- package/lib/rest/video/v1/room.d.ts +4 -0
- package/lib/rest/video/v1/room.js +4 -0
- package/lib/twiml/VoiceResponse.d.ts +36 -16
- package/package.json +2 -2
package/lib/base/BaseTwilio.js
CHANGED
|
@@ -173,7 +173,8 @@ var Twilio;
|
|
|
173
173
|
data: opts.data,
|
|
174
174
|
timeout: opts.timeout,
|
|
175
175
|
allowRedirects: opts.allowRedirects,
|
|
176
|
-
|
|
176
|
+
// use the Twilio client's log-level if the httpClient's log-level is unspecified
|
|
177
|
+
logLevel: opts.logLevel || this.opts?.logLevel,
|
|
177
178
|
});
|
|
178
179
|
}
|
|
179
180
|
/* jshint ignore:start */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Domain from "../base/Domain";
|
|
2
2
|
import V1 from "./messaging/V1";
|
|
3
|
+
import V2 from "./messaging/V2";
|
|
3
4
|
declare class MessagingBase extends Domain {
|
|
4
5
|
_v1?: V1;
|
|
6
|
+
_v2?: V2;
|
|
5
7
|
/**
|
|
6
8
|
* Initialize messaging domain
|
|
7
9
|
*
|
|
@@ -9,5 +11,6 @@ declare class MessagingBase extends Domain {
|
|
|
9
11
|
*/
|
|
10
12
|
constructor(twilio: any);
|
|
11
13
|
get v1(): V1;
|
|
14
|
+
get v2(): V2;
|
|
12
15
|
}
|
|
13
16
|
export = MessagingBase;
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
};
|
|
15
15
|
const Domain_1 = __importDefault(require("../base/Domain"));
|
|
16
16
|
const V1_1 = __importDefault(require("./messaging/V1"));
|
|
17
|
+
const V2_1 = __importDefault(require("./messaging/V2"));
|
|
17
18
|
class MessagingBase extends Domain_1.default {
|
|
18
19
|
/**
|
|
19
20
|
* Initialize messaging domain
|
|
@@ -27,5 +28,9 @@ class MessagingBase extends Domain_1.default {
|
|
|
27
28
|
this._v1 = this._v1 || new V1_1.default(this);
|
|
28
29
|
return this._v1;
|
|
29
30
|
}
|
|
31
|
+
get v2() {
|
|
32
|
+
this._v2 = this._v2 || new V2_1.default(this);
|
|
33
|
+
return this._v2;
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
module.exports = MessagingBase;
|
|
@@ -5,7 +5,7 @@ import V1 from "../V1";
|
|
|
5
5
|
* Options to pass to create a BulkConsentsInstance
|
|
6
6
|
*/
|
|
7
7
|
export interface BulkConsentsListInstanceCreateOptions {
|
|
8
|
-
/** This is a list of objects that describes a contact\\\'s opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`];
|
|
8
|
+
/** This is a list of objects that describes a contact\\\'s opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]; `date_of_consent`, an optional datetime string field in ISO-8601 format that captures the exact date and time when the user gave or revoked consent. If not provided, it will be empty. */
|
|
9
9
|
items: Array<object>;
|
|
10
10
|
}
|
|
11
11
|
export interface BulkConsentsSolution {
|
|
@@ -3,6 +3,7 @@ import { inspect, InspectOptions } from "util";
|
|
|
3
3
|
import Page, { TwilioResponsePayload } from "../../../../../base/Page";
|
|
4
4
|
import Response from "../../../../../http/response";
|
|
5
5
|
import V2010 from "../../../V2010";
|
|
6
|
+
import { PhoneNumberCapabilities } from "../../../../../interfaces";
|
|
6
7
|
export type DependentPhoneNumberAddressRequirement = "none" | "any" | "local" | "foreign";
|
|
7
8
|
/**
|
|
8
9
|
* Whether the phone number is enabled for emergency calling.
|
|
@@ -119,14 +120,14 @@ interface DependentPhoneNumberResource {
|
|
|
119
120
|
voice_fallback_method: string;
|
|
120
121
|
voice_fallback_url: string;
|
|
121
122
|
voice_caller_id_lookup: boolean;
|
|
122
|
-
date_created:
|
|
123
|
-
date_updated:
|
|
123
|
+
date_created: string;
|
|
124
|
+
date_updated: string;
|
|
124
125
|
sms_fallback_method: string;
|
|
125
126
|
sms_fallback_url: string;
|
|
126
127
|
sms_method: string;
|
|
127
128
|
sms_url: string;
|
|
128
129
|
address_requirements: DependentPhoneNumberAddressRequirement;
|
|
129
|
-
capabilities:
|
|
130
|
+
capabilities: PhoneNumberCapabilities;
|
|
130
131
|
status_callback: string;
|
|
131
132
|
status_callback_method: string;
|
|
132
133
|
api_version: string;
|
|
@@ -179,11 +180,11 @@ export declare class DependentPhoneNumberInstance {
|
|
|
179
180
|
/**
|
|
180
181
|
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
181
182
|
*/
|
|
182
|
-
dateCreated:
|
|
183
|
+
dateCreated: string;
|
|
183
184
|
/**
|
|
184
185
|
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
185
186
|
*/
|
|
186
|
-
dateUpdated:
|
|
187
|
+
dateUpdated: string;
|
|
187
188
|
/**
|
|
188
189
|
* The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`.
|
|
189
190
|
*/
|
|
@@ -201,10 +202,7 @@ export declare class DependentPhoneNumberInstance {
|
|
|
201
202
|
*/
|
|
202
203
|
smsUrl: string;
|
|
203
204
|
addressRequirements: DependentPhoneNumberAddressRequirement;
|
|
204
|
-
|
|
205
|
-
* The set of Boolean properties that indicates whether a phone number can receive calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` or `false`.
|
|
206
|
-
*/
|
|
207
|
-
capabilities: Record<string, object>;
|
|
205
|
+
capabilities: PhoneNumberCapabilities;
|
|
208
206
|
/**
|
|
209
207
|
* The URL we call using the `status_callback_method` to send status information to your application.
|
|
210
208
|
*/
|
|
@@ -253,14 +251,14 @@ export declare class DependentPhoneNumberInstance {
|
|
|
253
251
|
voiceFallbackMethod: string;
|
|
254
252
|
voiceFallbackUrl: string;
|
|
255
253
|
voiceCallerIdLookup: boolean;
|
|
256
|
-
dateCreated:
|
|
257
|
-
dateUpdated:
|
|
254
|
+
dateCreated: string;
|
|
255
|
+
dateUpdated: string;
|
|
258
256
|
smsFallbackMethod: string;
|
|
259
257
|
smsFallbackUrl: string;
|
|
260
258
|
smsMethod: string;
|
|
261
259
|
smsUrl: string;
|
|
262
260
|
addressRequirements: DependentPhoneNumberAddressRequirement;
|
|
263
|
-
capabilities:
|
|
261
|
+
capabilities: PhoneNumberCapabilities;
|
|
264
262
|
statusCallback: string;
|
|
265
263
|
statusCallbackMethod: string;
|
|
266
264
|
apiVersion: string;
|
|
@@ -92,8 +92,8 @@ class DependentPhoneNumberInstance {
|
|
|
92
92
|
this.voiceFallbackMethod = payload.voice_fallback_method;
|
|
93
93
|
this.voiceFallbackUrl = payload.voice_fallback_url;
|
|
94
94
|
this.voiceCallerIdLookup = payload.voice_caller_id_lookup;
|
|
95
|
-
this.dateCreated =
|
|
96
|
-
this.dateUpdated =
|
|
95
|
+
this.dateCreated = payload.date_created;
|
|
96
|
+
this.dateUpdated = payload.date_updated;
|
|
97
97
|
this.smsFallbackMethod = payload.sms_fallback_method;
|
|
98
98
|
this.smsFallbackUrl = payload.sms_fallback_url;
|
|
99
99
|
this.smsMethod = payload.sms_method;
|
|
@@ -44,7 +44,7 @@ export interface TranscriptionListInstanceCreateOptions {
|
|
|
44
44
|
hints?: string;
|
|
45
45
|
/** The provider will add punctuation to recognition result */
|
|
46
46
|
enableAutomaticPunctuation?: boolean;
|
|
47
|
-
/** The SID or unique name of the [
|
|
47
|
+
/** The SID or unique name of the [Intelligence Service](https://www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . */
|
|
48
48
|
intelligenceService?: string;
|
|
49
49
|
}
|
|
50
50
|
export interface TranscriptionContext {
|
|
@@ -61,7 +61,7 @@ export interface CallListInstanceCreateOptions {
|
|
|
61
61
|
statusCallbackEvent?: Array<string>;
|
|
62
62
|
/** The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */
|
|
63
63
|
statusCallbackMethod?: string;
|
|
64
|
-
/**
|
|
64
|
+
/** The string of keys to dial after connecting to the number, with a maximum length of 32 digits. Valid digits in the string include any digit (`0`-`9`), \\\'`A`\\\', \\\'`B`\\\', \\\'`C`\\\', \\\'`D`\\\', \\\'`#`\\\', and \\\'`*`\\\'. You can also use \\\'`w`\\\' to insert a half-second pause and \\\'`W`\\\' to insert a one-second pause. For example, to pause for one second after connecting and then dial extension 1234 followed by the # key, set this parameter to `W1234#`. Be sure to URL-encode this string because the \\\'`#`\\\' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. */
|
|
65
65
|
sendDigits?: string;
|
|
66
66
|
/** The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. */
|
|
67
67
|
timeout?: number;
|
|
@@ -23,7 +23,7 @@ export interface ParticipantContextUpdateOptions {
|
|
|
23
23
|
announceUrl?: string;
|
|
24
24
|
/** The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. */
|
|
25
25
|
announceMethod?: string;
|
|
26
|
-
/** The URL
|
|
26
|
+
/** The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `\\\'\\\'`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [<Conference> TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). */
|
|
27
27
|
waitUrl?: string;
|
|
28
28
|
/** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */
|
|
29
29
|
waitMethod?: string;
|
|
@@ -64,7 +64,7 @@ export interface ParticipantListInstanceCreateOptions {
|
|
|
64
64
|
startConferenceOnEnter?: boolean;
|
|
65
65
|
/** Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. */
|
|
66
66
|
endConferenceOnExit?: boolean;
|
|
67
|
-
/** The URL
|
|
67
|
+
/** The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `\\\'\\\'`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [<Conference> TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). */
|
|
68
68
|
waitUrl?: string;
|
|
69
69
|
/** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */
|
|
70
70
|
waitMethod?: string;
|
|
@@ -36,7 +36,7 @@ export declare class ApprovalFetchContextImpl implements ApprovalFetchContext {
|
|
|
36
36
|
interface ApprovalFetchResource {
|
|
37
37
|
sid: string;
|
|
38
38
|
account_sid: string;
|
|
39
|
-
whatsapp:
|
|
39
|
+
whatsapp: Record<string, object>;
|
|
40
40
|
url: string;
|
|
41
41
|
}
|
|
42
42
|
export declare class ApprovalFetchInstance {
|
|
@@ -55,7 +55,7 @@ export declare class ApprovalFetchInstance {
|
|
|
55
55
|
/**
|
|
56
56
|
* Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others.
|
|
57
57
|
*/
|
|
58
|
-
whatsapp:
|
|
58
|
+
whatsapp: Record<string, object>;
|
|
59
59
|
/**
|
|
60
60
|
* The URL of the resource, relative to `https://content.twilio.com`.
|
|
61
61
|
*/
|
|
@@ -77,7 +77,7 @@ export declare class ApprovalFetchInstance {
|
|
|
77
77
|
toJSON(): {
|
|
78
78
|
sid: string;
|
|
79
79
|
accountSid: string;
|
|
80
|
-
whatsapp:
|
|
80
|
+
whatsapp: Record<string, object>;
|
|
81
81
|
url: string;
|
|
82
82
|
};
|
|
83
83
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
@@ -16,6 +16,7 @@ export declare class CallToActionAction {
|
|
|
16
16
|
"url"?: string;
|
|
17
17
|
"phone"?: string;
|
|
18
18
|
"code"?: string;
|
|
19
|
+
"id"?: string;
|
|
19
20
|
}
|
|
20
21
|
export type CallToActionActionType = "URL" | "PHONE_NUMBER" | "COPY_CODE" | "VOICE_CALL" | "VOICE_CALL_REQUEST";
|
|
21
22
|
export declare class CardAction {
|
|
@@ -151,6 +152,8 @@ export declare class TwilioLocation {
|
|
|
151
152
|
"latitude": number;
|
|
152
153
|
"longitude": number;
|
|
153
154
|
"label"?: string;
|
|
155
|
+
"id"?: string;
|
|
156
|
+
"address"?: string;
|
|
154
157
|
}
|
|
155
158
|
/**
|
|
156
159
|
* twilio/media is used to send file attachments, or to send long text via MMS in the US and Canada. As such, the twilio/media type must contain at least ONE of text or media content.
|
|
@@ -313,8 +316,8 @@ interface ContentResource {
|
|
|
313
316
|
account_sid: string;
|
|
314
317
|
friendly_name: string;
|
|
315
318
|
language: string;
|
|
316
|
-
variables:
|
|
317
|
-
types:
|
|
319
|
+
variables: Record<string, object>;
|
|
320
|
+
types: Record<string, object>;
|
|
318
321
|
url: string;
|
|
319
322
|
links: Record<string, string>;
|
|
320
323
|
}
|
|
@@ -350,11 +353,11 @@ export declare class ContentInstance {
|
|
|
350
353
|
/**
|
|
351
354
|
* Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
|
|
352
355
|
*/
|
|
353
|
-
variables:
|
|
356
|
+
variables: Record<string, object>;
|
|
354
357
|
/**
|
|
355
358
|
* The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
|
|
356
359
|
*/
|
|
357
|
-
types:
|
|
360
|
+
types: Record<string, object>;
|
|
358
361
|
/**
|
|
359
362
|
* The URL of the resource, relative to `https://content.twilio.com`.
|
|
360
363
|
*/
|
|
@@ -400,8 +403,8 @@ export declare class ContentInstance {
|
|
|
400
403
|
accountSid: string;
|
|
401
404
|
friendlyName: string;
|
|
402
405
|
language: string;
|
|
403
|
-
variables:
|
|
404
|
-
types:
|
|
406
|
+
variables: Record<string, object>;
|
|
407
|
+
types: Record<string, object>;
|
|
405
408
|
url: string;
|
|
406
409
|
links: Record<string, string>;
|
|
407
410
|
};
|
|
@@ -109,9 +109,9 @@ interface ContentAndApprovalsResource {
|
|
|
109
109
|
account_sid: string;
|
|
110
110
|
friendly_name: string;
|
|
111
111
|
language: string;
|
|
112
|
-
variables:
|
|
113
|
-
types:
|
|
114
|
-
approval_requests:
|
|
112
|
+
variables: Record<string, object>;
|
|
113
|
+
types: Record<string, object>;
|
|
114
|
+
approval_requests: Record<string, object>;
|
|
115
115
|
}
|
|
116
116
|
export declare class ContentAndApprovalsInstance {
|
|
117
117
|
protected _version: V1;
|
|
@@ -143,15 +143,15 @@ export declare class ContentAndApprovalsInstance {
|
|
|
143
143
|
/**
|
|
144
144
|
* Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
|
|
145
145
|
*/
|
|
146
|
-
variables:
|
|
146
|
+
variables: Record<string, object>;
|
|
147
147
|
/**
|
|
148
148
|
* The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
|
|
149
149
|
*/
|
|
150
|
-
types:
|
|
150
|
+
types: Record<string, object>;
|
|
151
151
|
/**
|
|
152
152
|
* The submitted information and approval request status of the Content resource.
|
|
153
153
|
*/
|
|
154
|
-
approvalRequests:
|
|
154
|
+
approvalRequests: Record<string, object>;
|
|
155
155
|
/**
|
|
156
156
|
* Provide a user-friendly representation
|
|
157
157
|
*
|
|
@@ -164,9 +164,9 @@ export declare class ContentAndApprovalsInstance {
|
|
|
164
164
|
accountSid: string;
|
|
165
165
|
friendlyName: string;
|
|
166
166
|
language: string;
|
|
167
|
-
variables:
|
|
168
|
-
types:
|
|
169
|
-
approvalRequests:
|
|
167
|
+
variables: Record<string, object>;
|
|
168
|
+
types: Record<string, object>;
|
|
169
|
+
approvalRequests: Record<string, object>;
|
|
170
170
|
};
|
|
171
171
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
172
172
|
}
|
|
@@ -109,8 +109,8 @@ interface LegacyContentResource {
|
|
|
109
109
|
account_sid: string;
|
|
110
110
|
friendly_name: string;
|
|
111
111
|
language: string;
|
|
112
|
-
variables:
|
|
113
|
-
types:
|
|
112
|
+
variables: Record<string, object>;
|
|
113
|
+
types: Record<string, object>;
|
|
114
114
|
legacy_template_name: string;
|
|
115
115
|
legacy_body: string;
|
|
116
116
|
url: string;
|
|
@@ -145,11 +145,11 @@ export declare class LegacyContentInstance {
|
|
|
145
145
|
/**
|
|
146
146
|
* Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
|
|
147
147
|
*/
|
|
148
|
-
variables:
|
|
148
|
+
variables: Record<string, object>;
|
|
149
149
|
/**
|
|
150
150
|
* The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
|
|
151
151
|
*/
|
|
152
|
-
types:
|
|
152
|
+
types: Record<string, object>;
|
|
153
153
|
/**
|
|
154
154
|
* The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed
|
|
155
155
|
*/
|
|
@@ -174,8 +174,8 @@ export declare class LegacyContentInstance {
|
|
|
174
174
|
accountSid: string;
|
|
175
175
|
friendlyName: string;
|
|
176
176
|
language: string;
|
|
177
|
-
variables:
|
|
178
|
-
types:
|
|
177
|
+
variables: Record<string, object>;
|
|
178
|
+
types: Record<string, object>;
|
|
179
179
|
legacyTemplateName: string;
|
|
180
180
|
legacyBody: string;
|
|
181
181
|
url: string;
|
|
@@ -12,8 +12,6 @@ export interface SubscriptionContextUpdateOptions {
|
|
|
12
12
|
description?: string;
|
|
13
13
|
/** The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. */
|
|
14
14
|
sinkSid?: string;
|
|
15
|
-
/** Receive events from all children accounts in the parent account subscription. */
|
|
16
|
-
receiveEventsFromSubaccounts?: boolean;
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
19
17
|
* Options to pass to create a SubscriptionInstance
|
|
@@ -25,8 +23,6 @@ export interface SubscriptionListInstanceCreateOptions {
|
|
|
25
23
|
sinkSid: string;
|
|
26
24
|
/** An array of objects containing the subscribed Event Types */
|
|
27
25
|
types: Array<object>;
|
|
28
|
-
/** Receive events from all children accounts in the parent account subscription. */
|
|
29
|
-
receiveEventsFromSubaccounts?: boolean;
|
|
30
26
|
}
|
|
31
27
|
/**
|
|
32
28
|
* Options to pass to each
|
|
@@ -141,7 +137,6 @@ interface SubscriptionResource {
|
|
|
141
137
|
sink_sid: string;
|
|
142
138
|
url: string;
|
|
143
139
|
links: Record<string, string>;
|
|
144
|
-
receive_events_from_subaccounts: boolean;
|
|
145
140
|
}
|
|
146
141
|
export declare class SubscriptionInstance {
|
|
147
142
|
protected _version: V1;
|
|
@@ -180,10 +175,6 @@ export declare class SubscriptionInstance {
|
|
|
180
175
|
* Contains a dictionary of URL links to nested resources of this Subscription.
|
|
181
176
|
*/
|
|
182
177
|
links: Record<string, string>;
|
|
183
|
-
/**
|
|
184
|
-
* Receive events from all children accounts in the parent account subscription.
|
|
185
|
-
*/
|
|
186
|
-
receiveEventsFromSubaccounts: boolean;
|
|
187
178
|
private get _proxy();
|
|
188
179
|
/**
|
|
189
180
|
* Remove a SubscriptionInstance
|
|
@@ -236,7 +227,6 @@ export declare class SubscriptionInstance {
|
|
|
236
227
|
sinkSid: string;
|
|
237
228
|
url: string;
|
|
238
229
|
links: Record<string, string>;
|
|
239
|
-
receiveEventsFromSubaccounts: boolean;
|
|
240
230
|
};
|
|
241
231
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
242
232
|
}
|
|
@@ -75,8 +75,6 @@ class SubscriptionContextImpl {
|
|
|
75
75
|
data["Description"] = params["description"];
|
|
76
76
|
if (params["sinkSid"] !== undefined)
|
|
77
77
|
data["SinkSid"] = params["sinkSid"];
|
|
78
|
-
if (params["receiveEventsFromSubaccounts"] !== undefined)
|
|
79
|
-
data["ReceiveEventsFromSubaccounts"] = serialize.bool(params["receiveEventsFromSubaccounts"]);
|
|
80
78
|
const headers = {};
|
|
81
79
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
82
80
|
headers["Accept"] = "application/json";
|
|
@@ -115,7 +113,6 @@ class SubscriptionInstance {
|
|
|
115
113
|
this.sinkSid = payload.sink_sid;
|
|
116
114
|
this.url = payload.url;
|
|
117
115
|
this.links = payload.links;
|
|
118
|
-
this.receiveEventsFromSubaccounts = payload.receive_events_from_subaccounts;
|
|
119
116
|
this._solution = { sid: sid || this.sid };
|
|
120
117
|
}
|
|
121
118
|
get _proxy() {
|
|
@@ -168,7 +165,6 @@ class SubscriptionInstance {
|
|
|
168
165
|
sinkSid: this.sinkSid,
|
|
169
166
|
url: this.url,
|
|
170
167
|
links: this.links,
|
|
171
|
-
receiveEventsFromSubaccounts: this.receiveEventsFromSubaccounts,
|
|
172
168
|
};
|
|
173
169
|
}
|
|
174
170
|
[util_1.inspect.custom](_depth, options) {
|
|
@@ -201,8 +197,6 @@ function SubscriptionListInstance(version) {
|
|
|
201
197
|
data["Description"] = params["description"];
|
|
202
198
|
data["SinkSid"] = params["sinkSid"];
|
|
203
199
|
data["Types"] = serialize.map(params["types"], (e) => e);
|
|
204
|
-
if (params["receiveEventsFromSubaccounts"] !== undefined)
|
|
205
|
-
data["ReceiveEventsFromSubaccounts"] = serialize.bool(params["receiveEventsFromSubaccounts"]);
|
|
206
200
|
const headers = {};
|
|
207
201
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
208
202
|
headers["Accept"] = "application/json";
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
import { inspect, InspectOptions } from "util";
|
|
3
3
|
import V1 from "../V1";
|
|
4
4
|
import { InteractionChannelListInstance } from "./interaction/interactionChannel";
|
|
5
|
+
/**
|
|
6
|
+
* Options to pass to update a InteractionInstance
|
|
7
|
+
*/
|
|
8
|
+
export interface InteractionContextUpdateOptions {
|
|
9
|
+
/** The unique identifier for Interaction level webhook */
|
|
10
|
+
webhookTtid?: string;
|
|
11
|
+
}
|
|
5
12
|
/**
|
|
6
13
|
* Options to pass to create a InteractionInstance
|
|
7
14
|
*/
|
|
@@ -12,6 +19,8 @@ export interface InteractionListInstanceCreateOptions {
|
|
|
12
19
|
routing?: object;
|
|
13
20
|
/** The Interaction context sid is used for adding a context lookup sid */
|
|
14
21
|
interactionContextSid?: string;
|
|
22
|
+
/** The unique identifier for Interaction level webhook */
|
|
23
|
+
webhookTtid?: string;
|
|
15
24
|
}
|
|
16
25
|
export interface InteractionContext {
|
|
17
26
|
channels: InteractionChannelListInstance;
|
|
@@ -23,6 +32,23 @@ export interface InteractionContext {
|
|
|
23
32
|
* @returns Resolves to processed InteractionInstance
|
|
24
33
|
*/
|
|
25
34
|
fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
35
|
+
/**
|
|
36
|
+
* Update a InteractionInstance
|
|
37
|
+
*
|
|
38
|
+
* @param callback - Callback to handle processed record
|
|
39
|
+
*
|
|
40
|
+
* @returns Resolves to processed InteractionInstance
|
|
41
|
+
*/
|
|
42
|
+
update(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a InteractionInstance
|
|
45
|
+
*
|
|
46
|
+
* @param params - Parameter for request
|
|
47
|
+
* @param callback - Callback to handle processed record
|
|
48
|
+
*
|
|
49
|
+
* @returns Resolves to processed InteractionInstance
|
|
50
|
+
*/
|
|
51
|
+
update(params: InteractionContextUpdateOptions, callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
26
52
|
/**
|
|
27
53
|
* Provide a user-friendly representation
|
|
28
54
|
*/
|
|
@@ -40,6 +66,7 @@ export declare class InteractionContextImpl implements InteractionContext {
|
|
|
40
66
|
constructor(_version: V1, sid: string);
|
|
41
67
|
get channels(): InteractionChannelListInstance;
|
|
42
68
|
fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
69
|
+
update(params?: InteractionContextUpdateOptions | ((error: Error | null, item?: InteractionInstance) => any), callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
43
70
|
/**
|
|
44
71
|
* Provide a user-friendly representation
|
|
45
72
|
*
|
|
@@ -55,6 +82,7 @@ interface InteractionResource {
|
|
|
55
82
|
url: string;
|
|
56
83
|
links: Record<string, string>;
|
|
57
84
|
interaction_context_sid: string;
|
|
85
|
+
webhook_ttid: string;
|
|
58
86
|
}
|
|
59
87
|
export declare class InteractionInstance {
|
|
60
88
|
protected _version: V1;
|
|
@@ -76,6 +104,7 @@ export declare class InteractionInstance {
|
|
|
76
104
|
url: string;
|
|
77
105
|
links: Record<string, string>;
|
|
78
106
|
interactionContextSid: string;
|
|
107
|
+
webhookTtid: string;
|
|
79
108
|
private get _proxy();
|
|
80
109
|
/**
|
|
81
110
|
* Fetch a InteractionInstance
|
|
@@ -85,6 +114,23 @@ export declare class InteractionInstance {
|
|
|
85
114
|
* @returns Resolves to processed InteractionInstance
|
|
86
115
|
*/
|
|
87
116
|
fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
117
|
+
/**
|
|
118
|
+
* Update a InteractionInstance
|
|
119
|
+
*
|
|
120
|
+
* @param callback - Callback to handle processed record
|
|
121
|
+
*
|
|
122
|
+
* @returns Resolves to processed InteractionInstance
|
|
123
|
+
*/
|
|
124
|
+
update(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
125
|
+
/**
|
|
126
|
+
* Update a InteractionInstance
|
|
127
|
+
*
|
|
128
|
+
* @param params - Parameter for request
|
|
129
|
+
* @param callback - Callback to handle processed record
|
|
130
|
+
*
|
|
131
|
+
* @returns Resolves to processed InteractionInstance
|
|
132
|
+
*/
|
|
133
|
+
update(params: InteractionContextUpdateOptions, callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
88
134
|
/**
|
|
89
135
|
* Access the channels.
|
|
90
136
|
*/
|
|
@@ -101,6 +147,7 @@ export declare class InteractionInstance {
|
|
|
101
147
|
url: string;
|
|
102
148
|
links: Record<string, string>;
|
|
103
149
|
interactionContextSid: string;
|
|
150
|
+
webhookTtid: string;
|
|
104
151
|
};
|
|
105
152
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
106
153
|
}
|
|
@@ -47,6 +47,31 @@ class InteractionContextImpl {
|
|
|
47
47
|
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
48
48
|
return operationPromise;
|
|
49
49
|
}
|
|
50
|
+
update(params, callback) {
|
|
51
|
+
if (params instanceof Function) {
|
|
52
|
+
callback = params;
|
|
53
|
+
params = {};
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
params = params || {};
|
|
57
|
+
}
|
|
58
|
+
let data = {};
|
|
59
|
+
if (params["webhookTtid"] !== undefined)
|
|
60
|
+
data["WebhookTtid"] = params["webhookTtid"];
|
|
61
|
+
const headers = {};
|
|
62
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
63
|
+
headers["Accept"] = "application/json";
|
|
64
|
+
const instance = this;
|
|
65
|
+
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
66
|
+
uri: instance._uri,
|
|
67
|
+
method: "post",
|
|
68
|
+
data,
|
|
69
|
+
headers,
|
|
70
|
+
});
|
|
71
|
+
operationPromise = operationPromise.then((payload) => new InteractionInstance(operationVersion, payload, instance._solution.sid));
|
|
72
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
73
|
+
return operationPromise;
|
|
74
|
+
}
|
|
50
75
|
/**
|
|
51
76
|
* Provide a user-friendly representation
|
|
52
77
|
*
|
|
@@ -69,6 +94,7 @@ class InteractionInstance {
|
|
|
69
94
|
this.url = payload.url;
|
|
70
95
|
this.links = payload.links;
|
|
71
96
|
this.interactionContextSid = payload.interaction_context_sid;
|
|
97
|
+
this.webhookTtid = payload.webhook_ttid;
|
|
72
98
|
this._solution = { sid: sid || this.sid };
|
|
73
99
|
}
|
|
74
100
|
get _proxy() {
|
|
@@ -87,6 +113,9 @@ class InteractionInstance {
|
|
|
87
113
|
fetch(callback) {
|
|
88
114
|
return this._proxy.fetch(callback);
|
|
89
115
|
}
|
|
116
|
+
update(params, callback) {
|
|
117
|
+
return this._proxy.update(params, callback);
|
|
118
|
+
}
|
|
90
119
|
/**
|
|
91
120
|
* Access the channels.
|
|
92
121
|
*/
|
|
@@ -106,6 +135,7 @@ class InteractionInstance {
|
|
|
106
135
|
url: this.url,
|
|
107
136
|
links: this.links,
|
|
108
137
|
interactionContextSid: this.interactionContextSid,
|
|
138
|
+
webhookTtid: this.webhookTtid,
|
|
109
139
|
};
|
|
110
140
|
}
|
|
111
141
|
[util_1.inspect.custom](_depth, options) {
|
|
@@ -134,6 +164,8 @@ function InteractionListInstance(version) {
|
|
|
134
164
|
data["Routing"] = serialize.object(params["routing"]);
|
|
135
165
|
if (params["interactionContextSid"] !== undefined)
|
|
136
166
|
data["InteractionContextSid"] = params["interactionContextSid"];
|
|
167
|
+
if (params["webhookTtid"] !== undefined)
|
|
168
|
+
data["WebhookTtid"] = params["webhookTtid"];
|
|
137
169
|
const headers = {};
|
|
138
170
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
139
171
|
headers["Accept"] = "application/json";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import MessagingBase from "../MessagingBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { ChannelsSenderListInstance } from "./v2/channelsSender";
|
|
4
|
+
export default class V2 extends Version {
|
|
5
|
+
/**
|
|
6
|
+
* Initialize the V2 version of Messaging
|
|
7
|
+
*
|
|
8
|
+
* @param domain - The Twilio (Twilio.Messaging) domain
|
|
9
|
+
*/
|
|
10
|
+
constructor(domain: MessagingBase);
|
|
11
|
+
/** channelsSenders - { Twilio.Messaging.V2.ChannelsSenderListInstance } resource */
|
|
12
|
+
protected _channelsSenders?: ChannelsSenderListInstance;
|
|
13
|
+
/** Getter for channelsSenders resource */
|
|
14
|
+
get channelsSenders(): ChannelsSenderListInstance;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Messaging
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
|
+
const channelsSender_1 = require("./v2/channelsSender");
|
|
21
|
+
class V2 extends Version_1.default {
|
|
22
|
+
/**
|
|
23
|
+
* Initialize the V2 version of Messaging
|
|
24
|
+
*
|
|
25
|
+
* @param domain - The Twilio (Twilio.Messaging) domain
|
|
26
|
+
*/
|
|
27
|
+
constructor(domain) {
|
|
28
|
+
super(domain, "v2");
|
|
29
|
+
}
|
|
30
|
+
/** Getter for channelsSenders resource */
|
|
31
|
+
get channelsSenders() {
|
|
32
|
+
this._channelsSenders =
|
|
33
|
+
this._channelsSenders || (0, channelsSender_1.ChannelsSenderListInstance)(this);
|
|
34
|
+
return this._channelsSenders;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = V2;
|