twilio 6.0.0 → 6.0.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/lib/rest/ConversationsBase.d.ts +3 -0
- package/lib/rest/ConversationsBase.js +5 -0
- package/lib/rest/InsightsBase.d.ts +3 -0
- package/lib/rest/InsightsBase.js +5 -0
- package/lib/rest/IntelligenceBase.d.ts +3 -0
- package/lib/rest/IntelligenceBase.js +5 -0
- package/lib/rest/KnowledgeBase.d.ts +3 -0
- package/lib/rest/KnowledgeBase.js +5 -0
- package/lib/rest/Memory.d.ts +4 -0
- package/lib/rest/Memory.js +8 -0
- package/lib/rest/MemoryBase.d.ts +13 -0
- package/lib/rest/MemoryBase.js +31 -0
- package/lib/rest/Twilio.d.ts +5 -0
- package/lib/rest/Twilio.js +5 -0
- package/lib/rest/VoiceBase.d.ts +3 -0
- package/lib/rest/VoiceBase.js +5 -0
- package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
- package/lib/rest/api/v2010/account/call/recording.js +4 -0
- package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/transcription.js +6 -4
- package/lib/rest/api/v2010/account/call.d.ts +2 -0
- package/lib/rest/api/v2010/account/call.js +4 -0
- package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
- package/lib/rest/api/v2010/account/conference/participant.js +4 -0
- package/lib/rest/conversations/V2.d.ts +38 -0
- package/lib/rest/conversations/V2.js +72 -0
- package/lib/rest/conversations/v2/action.d.ts +241 -0
- package/lib/rest/conversations/v2/action.js +246 -0
- package/lib/rest/conversations/v2/communication.d.ts +479 -0
- package/lib/rest/conversations/v2/communication.js +436 -0
- package/lib/rest/conversations/v2/configuration.d.ts +906 -0
- package/lib/rest/conversations/v2/configuration.js +619 -0
- package/lib/rest/conversations/v2/conversation.d.ts +936 -0
- package/lib/rest/conversations/v2/conversation.js +664 -0
- package/lib/rest/conversations/v2/operation.d.ts +167 -0
- package/lib/rest/conversations/v2/operation.js +170 -0
- package/lib/rest/conversations/v2/participant.d.ts +469 -0
- package/lib/rest/conversations/v2/participant.js +442 -0
- package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
- package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
- package/lib/rest/insights/V3.d.ts +20 -0
- package/lib/rest/insights/V3.js +42 -0
- package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
- package/lib/rest/insights/v1/call/event.d.ts +4 -4
- package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
- package/lib/rest/insights/v3/metadata.d.ts +115 -0
- package/lib/rest/insights/v3/metadata.js +118 -0
- package/lib/rest/insights/v3/query.d.ts +180 -0
- package/lib/rest/insights/v3/query.js +214 -0
- package/lib/rest/intelligence/V3.d.ts +35 -0
- package/lib/rest/intelligence/V3.js +65 -0
- package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
- package/lib/rest/intelligence/v3/configuration.js +528 -0
- package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
- package/lib/rest/intelligence/v3/conversation.js +342 -0
- package/lib/rest/intelligence/v3/operator.d.ts +619 -0
- package/lib/rest/intelligence/v3/operator.js +493 -0
- package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
- package/lib/rest/intelligence/v3/operatorResult.js +478 -0
- package/lib/rest/intelligence/v3/version.d.ts +469 -0
- package/lib/rest/intelligence/v3/version.js +341 -0
- package/lib/rest/knowledge/V2.d.ts +31 -0
- package/lib/rest/knowledge/V2.js +62 -0
- package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
- package/lib/rest/knowledge/v2/chunk.js +178 -0
- package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
- package/lib/rest/knowledge/v2/knowledge.js +466 -0
- package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
- package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
- package/lib/rest/knowledge/v2/operation.d.ts +162 -0
- package/lib/rest/knowledge/v2/operation.js +175 -0
- package/lib/rest/knowledge/v2/search.d.ts +180 -0
- package/lib/rest/knowledge/v2/search.js +174 -0
- package/lib/rest/memory/V1.d.ts +76 -0
- package/lib/rest/memory/V1.js +140 -0
- package/lib/rest/memory/v1/bulk.d.ts +129 -0
- package/lib/rest/memory/v1/bulk.js +158 -0
- package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
- package/lib/rest/memory/v1/conversationSummary.js +473 -0
- package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
- package/lib/rest/memory/v1/dataMapping.js +512 -0
- package/lib/rest/memory/v1/event.d.ts +153 -0
- package/lib/rest/memory/v1/event.js +159 -0
- package/lib/rest/memory/v1/identifier.d.ts +362 -0
- package/lib/rest/memory/v1/identifier.js +369 -0
- package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
- package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
- package/lib/rest/memory/v1/import.d.ts +292 -0
- package/lib/rest/memory/v1/import.js +280 -0
- package/lib/rest/memory/v1/lookup.d.ts +82 -0
- package/lib/rest/memory/v1/lookup.js +118 -0
- package/lib/rest/memory/v1/observation.d.ts +521 -0
- package/lib/rest/memory/v1/observation.js +477 -0
- package/lib/rest/memory/v1/operation.d.ts +162 -0
- package/lib/rest/memory/v1/operation.js +175 -0
- package/lib/rest/memory/v1/profile.d.ts +548 -0
- package/lib/rest/memory/v1/profile.js +531 -0
- package/lib/rest/memory/v1/recall.d.ts +306 -0
- package/lib/rest/memory/v1/recall.js +234 -0
- package/lib/rest/memory/v1/revision.d.ts +246 -0
- package/lib/rest/memory/v1/revision.js +195 -0
- package/lib/rest/memory/v1/store.d.ts +544 -0
- package/lib/rest/memory/v1/store.js +534 -0
- package/lib/rest/memory/v1/trait.d.ts +233 -0
- package/lib/rest/memory/v1/trait.js +190 -0
- package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
- package/lib/rest/memory/v1/traitGroup.js +555 -0
- package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
- package/lib/rest/messaging/v2/channelsSender.js +2 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
- package/lib/rest/studio/v2/flow.d.ts +4 -0
- package/lib/rest/studio/v2/flow.js +8 -0
- package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
- package/lib/rest/verify/v2/service/webhook.js +8 -8
- package/lib/rest/voice/V3.d.ts +15 -0
- package/lib/rest/voice/V3.js +37 -0
- package/lib/rest/voice/v3/transcription.d.ts +378 -0
- package/lib/rest/voice/v3/transcription.js +264 -0
- package/lib/twiml/VoiceResponse.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Conversation Orchestrator
|
|
9
|
+
* Manage configurations, conversations, participants, and communications. Create configurations to define capture rules and channel settings, then use conversations to group related communications.
|
|
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
|
+
exports.ParticipantPage = exports.ParticipantInstance = exports.ParticipantContextImpl = exports.UpdateParticipantInConversationRequest = exports.CreateParticipantInConversationRequestAddresses = exports.CreateParticipantInConversationRequest = exports.ConversationsV2Address = void 0;
|
|
20
|
+
exports.ParticipantListInstance = ParticipantListInstance;
|
|
21
|
+
const util_1 = require("util");
|
|
22
|
+
const TokenPage_1 = __importDefault(require("../../../base/TokenPage"));
|
|
23
|
+
const deserialize = require("../../../base/deserialize");
|
|
24
|
+
const serialize = require("../../../base/serialize");
|
|
25
|
+
const utility_1 = require("../../../base/utility");
|
|
26
|
+
class ConversationsV2Address {
|
|
27
|
+
constructor(payload) {
|
|
28
|
+
this.channel = payload["channel"];
|
|
29
|
+
this.address = payload["address"];
|
|
30
|
+
this.channelId = payload["channelId"];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ConversationsV2Address = ConversationsV2Address;
|
|
34
|
+
class CreateParticipantInConversationRequest {
|
|
35
|
+
constructor(payload) {
|
|
36
|
+
this.name = payload["name"];
|
|
37
|
+
this.type = payload["type"];
|
|
38
|
+
this.profileId = payload["profileId"];
|
|
39
|
+
this.addresses = payload["addresses"];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.CreateParticipantInConversationRequest = CreateParticipantInConversationRequest;
|
|
43
|
+
class CreateParticipantInConversationRequestAddresses {
|
|
44
|
+
constructor(payload) {
|
|
45
|
+
this.channel = payload["channel"];
|
|
46
|
+
this.address = payload["address"];
|
|
47
|
+
this.channelId = payload["channelId"];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.CreateParticipantInConversationRequestAddresses = CreateParticipantInConversationRequestAddresses;
|
|
51
|
+
class UpdateParticipantInConversationRequest {
|
|
52
|
+
constructor(payload) {
|
|
53
|
+
this.name = payload["name"];
|
|
54
|
+
this.type = payload["type"];
|
|
55
|
+
this.profileId = payload["profileId"];
|
|
56
|
+
this.addresses = payload["addresses"];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.UpdateParticipantInConversationRequest = UpdateParticipantInConversationRequest;
|
|
60
|
+
class ParticipantContextImpl {
|
|
61
|
+
constructor(_version, conversationSid, sid) {
|
|
62
|
+
this._version = _version;
|
|
63
|
+
if (!(0, utility_1.isValidPathParam)(conversationSid)) {
|
|
64
|
+
throw new Error("Parameter 'conversationSid' is not valid.");
|
|
65
|
+
}
|
|
66
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
67
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
68
|
+
}
|
|
69
|
+
this._solution = { conversationSid, sid };
|
|
70
|
+
this._uri = `/Conversations/${conversationSid}/Participants/${sid}`;
|
|
71
|
+
}
|
|
72
|
+
fetch(callback) {
|
|
73
|
+
const headers = {};
|
|
74
|
+
headers["Accept"] = "application/json";
|
|
75
|
+
const instance = this;
|
|
76
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
77
|
+
uri: instance._uri,
|
|
78
|
+
method: "get",
|
|
79
|
+
headers,
|
|
80
|
+
});
|
|
81
|
+
operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid));
|
|
82
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
83
|
+
return operationPromise;
|
|
84
|
+
}
|
|
85
|
+
fetchWithHttpInfo(callback) {
|
|
86
|
+
const headers = {};
|
|
87
|
+
headers["Accept"] = "application/json";
|
|
88
|
+
const instance = this;
|
|
89
|
+
let operationVersion = instance._version;
|
|
90
|
+
// CREATE, FETCH, UPDATE operations
|
|
91
|
+
let operationPromise = operationVersion
|
|
92
|
+
.fetchWithResponseInfo({
|
|
93
|
+
uri: instance._uri,
|
|
94
|
+
method: "get",
|
|
95
|
+
headers,
|
|
96
|
+
})
|
|
97
|
+
.then((response) => ({
|
|
98
|
+
...response,
|
|
99
|
+
body: new ParticipantInstance(operationVersion, response.body, instance._solution.conversationSid, instance._solution.sid),
|
|
100
|
+
}));
|
|
101
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
102
|
+
return operationPromise;
|
|
103
|
+
}
|
|
104
|
+
update(params, headers, callback) {
|
|
105
|
+
if (params instanceof Function) {
|
|
106
|
+
callback = params;
|
|
107
|
+
params =
|
|
108
|
+
{};
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
params =
|
|
112
|
+
params ||
|
|
113
|
+
{};
|
|
114
|
+
}
|
|
115
|
+
let data = {};
|
|
116
|
+
data = params;
|
|
117
|
+
if (headers === null || headers === undefined) {
|
|
118
|
+
headers = {};
|
|
119
|
+
}
|
|
120
|
+
headers["Content-Type"] = "application/json";
|
|
121
|
+
headers["Accept"] = "application/json";
|
|
122
|
+
const instance = this;
|
|
123
|
+
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
124
|
+
uri: instance._uri,
|
|
125
|
+
method: "put",
|
|
126
|
+
data,
|
|
127
|
+
headers,
|
|
128
|
+
});
|
|
129
|
+
operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid));
|
|
130
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
131
|
+
return operationPromise;
|
|
132
|
+
}
|
|
133
|
+
updateWithHttpInfo(params, headers, callback) {
|
|
134
|
+
if (params instanceof Function) {
|
|
135
|
+
callback = params;
|
|
136
|
+
params =
|
|
137
|
+
{};
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
params =
|
|
141
|
+
params ||
|
|
142
|
+
{};
|
|
143
|
+
}
|
|
144
|
+
let data = {};
|
|
145
|
+
data = params;
|
|
146
|
+
if (headers === null || headers === undefined) {
|
|
147
|
+
headers = {};
|
|
148
|
+
}
|
|
149
|
+
headers["Content-Type"] = "application/json";
|
|
150
|
+
headers["Accept"] = "application/json";
|
|
151
|
+
const instance = this;
|
|
152
|
+
let operationVersion = instance._version;
|
|
153
|
+
// CREATE, FETCH, UPDATE operations
|
|
154
|
+
let operationPromise = operationVersion
|
|
155
|
+
.updateWithResponseInfo({
|
|
156
|
+
uri: instance._uri,
|
|
157
|
+
method: "put",
|
|
158
|
+
data,
|
|
159
|
+
headers,
|
|
160
|
+
})
|
|
161
|
+
.then((response) => ({
|
|
162
|
+
...response,
|
|
163
|
+
body: new ParticipantInstance(operationVersion, response.body, instance._solution.conversationSid, instance._solution.sid),
|
|
164
|
+
}));
|
|
165
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
166
|
+
return operationPromise;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Provide a user-friendly representation
|
|
170
|
+
*
|
|
171
|
+
* @returns Object
|
|
172
|
+
*/
|
|
173
|
+
toJSON() {
|
|
174
|
+
return this._solution;
|
|
175
|
+
}
|
|
176
|
+
[util_1.inspect.custom](_depth, options) {
|
|
177
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
exports.ParticipantContextImpl = ParticipantContextImpl;
|
|
181
|
+
class ParticipantInstance {
|
|
182
|
+
constructor(_version, _payload, conversationSid, sid) {
|
|
183
|
+
this._version = _version;
|
|
184
|
+
const payload = _payload;
|
|
185
|
+
this.id = payload.id;
|
|
186
|
+
this.conversationId = payload.conversationId;
|
|
187
|
+
this.accountId = payload.accountId;
|
|
188
|
+
this.name = payload.name;
|
|
189
|
+
this.type = payload.type;
|
|
190
|
+
this.profileId = payload.profileId;
|
|
191
|
+
this.addresses =
|
|
192
|
+
payload.addresses !== null && payload.addresses !== undefined
|
|
193
|
+
? payload.addresses.map((payload) => new ConversationsV2Address(payload))
|
|
194
|
+
: null;
|
|
195
|
+
this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
|
|
196
|
+
this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
|
|
197
|
+
this._solution = { conversationSid, sid: sid };
|
|
198
|
+
}
|
|
199
|
+
get _proxy() {
|
|
200
|
+
this._context =
|
|
201
|
+
this._context ||
|
|
202
|
+
new ParticipantContextImpl(this._version, this._solution.conversationSid, this._solution.sid);
|
|
203
|
+
return this._context;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Fetch a ParticipantInstance
|
|
207
|
+
*
|
|
208
|
+
* @param callback - Callback to handle processed record
|
|
209
|
+
*
|
|
210
|
+
* @returns Resolves to processed ParticipantInstance
|
|
211
|
+
*/
|
|
212
|
+
fetch(callback) {
|
|
213
|
+
return this._proxy.fetch(callback);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Fetch a ParticipantInstance and return HTTP info
|
|
217
|
+
*
|
|
218
|
+
* @param callback - Callback to handle processed record
|
|
219
|
+
*
|
|
220
|
+
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
|
221
|
+
*/
|
|
222
|
+
fetchWithHttpInfo(callback) {
|
|
223
|
+
return this._proxy.fetchWithHttpInfo(callback);
|
|
224
|
+
}
|
|
225
|
+
update(params, callback) {
|
|
226
|
+
return this._proxy.update(params, callback);
|
|
227
|
+
}
|
|
228
|
+
updateWithHttpInfo(params, callback) {
|
|
229
|
+
return this._proxy.updateWithHttpInfo(params, callback);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Provide a user-friendly representation
|
|
233
|
+
*
|
|
234
|
+
* @returns Object
|
|
235
|
+
*/
|
|
236
|
+
toJSON() {
|
|
237
|
+
return {
|
|
238
|
+
id: this.id,
|
|
239
|
+
conversationId: this.conversationId,
|
|
240
|
+
accountId: this.accountId,
|
|
241
|
+
name: this.name,
|
|
242
|
+
type: this.type,
|
|
243
|
+
profileId: this.profileId,
|
|
244
|
+
addresses: this.addresses,
|
|
245
|
+
createdAt: this.createdAt,
|
|
246
|
+
updatedAt: this.updatedAt,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
[util_1.inspect.custom](_depth, options) {
|
|
250
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
exports.ParticipantInstance = ParticipantInstance;
|
|
254
|
+
function ParticipantListInstance(version, conversationSid) {
|
|
255
|
+
if (!(0, utility_1.isValidPathParam)(conversationSid)) {
|
|
256
|
+
throw new Error("Parameter 'conversationSid' is not valid.");
|
|
257
|
+
}
|
|
258
|
+
const instance = ((sid) => instance.get(sid));
|
|
259
|
+
instance.get = function get(sid) {
|
|
260
|
+
return new ParticipantContextImpl(version, conversationSid, sid);
|
|
261
|
+
};
|
|
262
|
+
instance._version = version;
|
|
263
|
+
instance._solution = { conversationSid };
|
|
264
|
+
instance._uri = `/Conversations/${conversationSid}/Participants`;
|
|
265
|
+
instance.create = function create(params, headers, callback) {
|
|
266
|
+
if (params instanceof Function) {
|
|
267
|
+
callback = params;
|
|
268
|
+
params =
|
|
269
|
+
{};
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
params =
|
|
273
|
+
params ||
|
|
274
|
+
{};
|
|
275
|
+
}
|
|
276
|
+
let data = {};
|
|
277
|
+
data = params;
|
|
278
|
+
if (headers === null || headers === undefined) {
|
|
279
|
+
headers = {};
|
|
280
|
+
}
|
|
281
|
+
headers["Content-Type"] = "application/json";
|
|
282
|
+
headers["Accept"] = "application/json";
|
|
283
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
284
|
+
uri: instance._uri,
|
|
285
|
+
method: "post",
|
|
286
|
+
data,
|
|
287
|
+
headers,
|
|
288
|
+
});
|
|
289
|
+
operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.conversationSid));
|
|
290
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
291
|
+
return operationPromise;
|
|
292
|
+
};
|
|
293
|
+
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
|
294
|
+
if (params instanceof Function) {
|
|
295
|
+
callback = params;
|
|
296
|
+
params =
|
|
297
|
+
{};
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
params =
|
|
301
|
+
params ||
|
|
302
|
+
{};
|
|
303
|
+
}
|
|
304
|
+
let data = {};
|
|
305
|
+
data = params;
|
|
306
|
+
if (headers === null || headers === undefined) {
|
|
307
|
+
headers = {};
|
|
308
|
+
}
|
|
309
|
+
headers["Content-Type"] = "application/json";
|
|
310
|
+
headers["Accept"] = "application/json";
|
|
311
|
+
let operationVersion = version;
|
|
312
|
+
// CREATE, FETCH, UPDATE operations
|
|
313
|
+
let operationPromise = operationVersion
|
|
314
|
+
.createWithResponseInfo({
|
|
315
|
+
uri: instance._uri,
|
|
316
|
+
method: "post",
|
|
317
|
+
data,
|
|
318
|
+
headers,
|
|
319
|
+
})
|
|
320
|
+
.then((response) => ({
|
|
321
|
+
...response,
|
|
322
|
+
body: new ParticipantInstance(operationVersion, response.body, instance._solution.conversationSid),
|
|
323
|
+
}));
|
|
324
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
325
|
+
return operationPromise;
|
|
326
|
+
};
|
|
327
|
+
instance.page = function page(params, callback) {
|
|
328
|
+
if (params instanceof Function) {
|
|
329
|
+
callback = params;
|
|
330
|
+
params = {};
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
params = params || {};
|
|
334
|
+
}
|
|
335
|
+
let data = {};
|
|
336
|
+
if (params["pageSize"] !== undefined)
|
|
337
|
+
data["pageSize"] = params["pageSize"];
|
|
338
|
+
if (params["pageToken"] !== undefined)
|
|
339
|
+
data["pageToken"] = params["pageToken"];
|
|
340
|
+
const headers = {};
|
|
341
|
+
headers["Accept"] = "application/json";
|
|
342
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
343
|
+
uri: instance._uri,
|
|
344
|
+
method: "get",
|
|
345
|
+
params: data,
|
|
346
|
+
headers,
|
|
347
|
+
});
|
|
348
|
+
operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._uri, data, instance._solution));
|
|
349
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
350
|
+
return operationPromise;
|
|
351
|
+
};
|
|
352
|
+
instance.each = instance._version.each;
|
|
353
|
+
instance.list = instance._version.list;
|
|
354
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
355
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
356
|
+
method: "get",
|
|
357
|
+
uri: targetUrl,
|
|
358
|
+
});
|
|
359
|
+
let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._uri, {}, instance._solution));
|
|
360
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
361
|
+
return pagePromise;
|
|
362
|
+
};
|
|
363
|
+
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
|
364
|
+
if (params instanceof Function) {
|
|
365
|
+
callback = params;
|
|
366
|
+
params = {};
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
params = params || {};
|
|
370
|
+
}
|
|
371
|
+
let data = {};
|
|
372
|
+
if (params["pageSize"] !== undefined)
|
|
373
|
+
data["pageSize"] = params["pageSize"];
|
|
374
|
+
if (params["pageToken"] !== undefined)
|
|
375
|
+
data["pageToken"] = params["pageToken"];
|
|
376
|
+
const headers = {};
|
|
377
|
+
headers["Accept"] = "application/json";
|
|
378
|
+
let operationVersion = version;
|
|
379
|
+
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
|
380
|
+
// IMPORTANT: Pass full response to Page constructor, not response.body
|
|
381
|
+
let operationPromise = operationVersion
|
|
382
|
+
.page({ uri: instance._uri, method: "get", params: data, headers })
|
|
383
|
+
.then((response) => ({
|
|
384
|
+
statusCode: response.statusCode,
|
|
385
|
+
headers: response.headers,
|
|
386
|
+
body: new ParticipantPage(operationVersion, response, instance._uri, data, instance._solution),
|
|
387
|
+
}));
|
|
388
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
389
|
+
return operationPromise;
|
|
390
|
+
};
|
|
391
|
+
instance.each = instance._version.each;
|
|
392
|
+
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
|
393
|
+
instance.list = instance._version.list;
|
|
394
|
+
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
|
395
|
+
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
|
396
|
+
// Use request() directly as it already returns { statusCode, body, headers }
|
|
397
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
398
|
+
method: "get",
|
|
399
|
+
uri: targetUrl,
|
|
400
|
+
});
|
|
401
|
+
let pagePromise = operationPromise.then((response) => ({
|
|
402
|
+
statusCode: response.statusCode,
|
|
403
|
+
headers: response.headers,
|
|
404
|
+
body: new ParticipantPage(instance._version, response, instance._uri, {}, instance._solution),
|
|
405
|
+
}));
|
|
406
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
407
|
+
return pagePromise;
|
|
408
|
+
};
|
|
409
|
+
instance.toJSON = function toJSON() {
|
|
410
|
+
return instance._solution;
|
|
411
|
+
};
|
|
412
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
413
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
414
|
+
};
|
|
415
|
+
return instance;
|
|
416
|
+
}
|
|
417
|
+
class ParticipantPage extends TokenPage_1.default {
|
|
418
|
+
/**
|
|
419
|
+
* Initialize the ParticipantPage
|
|
420
|
+
*
|
|
421
|
+
* @param version - Version of the resource
|
|
422
|
+
* @param response - Response from the API
|
|
423
|
+
* @param uri - URI of the resource
|
|
424
|
+
* @param params - Query parameters
|
|
425
|
+
* @param solution - Path solution
|
|
426
|
+
*/
|
|
427
|
+
constructor(version, response, uri, params, solution) {
|
|
428
|
+
super(version, response, uri, params, solution);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Build an instance of ParticipantInstance
|
|
432
|
+
*
|
|
433
|
+
* @param payload - Payload response from the API
|
|
434
|
+
*/
|
|
435
|
+
getInstance(payload) {
|
|
436
|
+
return new ParticipantInstance(this._version, payload, this._solution.conversationSid);
|
|
437
|
+
}
|
|
438
|
+
[util_1.inspect.custom](depth, options) {
|
|
439
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
exports.ParticipantPage = ParticipantPage;
|
|
@@ -15,7 +15,7 @@ export interface PluginVersionsContextFetchOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
export interface PluginVersionsListInstanceCreateOptions {
|
|
17
17
|
/** The Flex Plugin Version\\\'s version. */
|
|
18
|
-
|
|
18
|
+
versionParam: string;
|
|
19
19
|
/** The URL of the Flex Plugin Version bundle */
|
|
20
20
|
pluginUrl: string;
|
|
21
21
|
/** The Flex-Metadata HTTP request header */
|
|
@@ -170,14 +170,15 @@ function PluginVersionsListInstance(version, pluginSid) {
|
|
|
170
170
|
if (params === null || params === undefined) {
|
|
171
171
|
throw new Error('Required parameter "params" missing.');
|
|
172
172
|
}
|
|
173
|
-
if (params["
|
|
174
|
-
|
|
173
|
+
if (params["versionParam"] === null ||
|
|
174
|
+
params["versionParam"] === undefined) {
|
|
175
|
+
throw new Error("Required parameter \"params['versionParam']\" missing.");
|
|
175
176
|
}
|
|
176
177
|
if (params["pluginUrl"] === null || params["pluginUrl"] === undefined) {
|
|
177
178
|
throw new Error("Required parameter \"params['pluginUrl']\" missing.");
|
|
178
179
|
}
|
|
179
180
|
let data = {};
|
|
180
|
-
data["Version"] = params["
|
|
181
|
+
data["Version"] = params["versionParam"];
|
|
181
182
|
data["PluginUrl"] = params["pluginUrl"];
|
|
182
183
|
if (params["changelog"] !== undefined)
|
|
183
184
|
data["Changelog"] = params["changelog"];
|
|
@@ -206,14 +207,15 @@ function PluginVersionsListInstance(version, pluginSid) {
|
|
|
206
207
|
if (params === null || params === undefined) {
|
|
207
208
|
throw new Error('Required parameter "params" missing.');
|
|
208
209
|
}
|
|
209
|
-
if (params["
|
|
210
|
-
|
|
210
|
+
if (params["versionParam"] === null ||
|
|
211
|
+
params["versionParam"] === undefined) {
|
|
212
|
+
throw new Error("Required parameter \"params['versionParam']\" missing.");
|
|
211
213
|
}
|
|
212
214
|
if (params["pluginUrl"] === null || params["pluginUrl"] === undefined) {
|
|
213
215
|
throw new Error("Required parameter \"params['pluginUrl']\" missing.");
|
|
214
216
|
}
|
|
215
217
|
let data = {};
|
|
216
|
-
data["Version"] = params["
|
|
218
|
+
data["Version"] = params["versionParam"];
|
|
217
219
|
data["PluginUrl"] = params["pluginUrl"];
|
|
218
220
|
if (params["changelog"] !== undefined)
|
|
219
221
|
data["Changelog"] = params["changelog"];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import InsightsBase from "../InsightsBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { MetadataListInstance } from "./v3/metadata";
|
|
4
|
+
import { QueryListInstance } from "./v3/query";
|
|
5
|
+
export default class V3 extends Version {
|
|
6
|
+
/**
|
|
7
|
+
* Initialize the V3 version of Insights
|
|
8
|
+
*
|
|
9
|
+
* @param domain - The Twilio (Twilio.Insights) domain
|
|
10
|
+
*/
|
|
11
|
+
constructor(domain: InsightsBase);
|
|
12
|
+
/** metadata - { Twilio.Insights.V3.MetadataListInstance } resource */
|
|
13
|
+
protected _metadata?: MetadataListInstance;
|
|
14
|
+
/** query - { Twilio.Insights.V3.QueryListInstance } resource */
|
|
15
|
+
protected _query?: QueryListInstance;
|
|
16
|
+
/** Getter for metadata resource */
|
|
17
|
+
get metadata(): MetadataListInstance;
|
|
18
|
+
/** Getter for query resource */
|
|
19
|
+
get query(): QueryListInstance;
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Insights
|
|
9
|
+
* Insights Domain V3 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 metadata_1 = require("./v3/metadata");
|
|
21
|
+
const query_1 = require("./v3/query");
|
|
22
|
+
class V3 extends Version_1.default {
|
|
23
|
+
/**
|
|
24
|
+
* Initialize the V3 version of Insights
|
|
25
|
+
*
|
|
26
|
+
* @param domain - The Twilio (Twilio.Insights) domain
|
|
27
|
+
*/
|
|
28
|
+
constructor(domain) {
|
|
29
|
+
super(domain, "v3");
|
|
30
|
+
}
|
|
31
|
+
/** Getter for metadata resource */
|
|
32
|
+
get metadata() {
|
|
33
|
+
this._metadata = this._metadata || (0, metadata_1.MetadataListInstance)(this);
|
|
34
|
+
return this._metadata;
|
|
35
|
+
}
|
|
36
|
+
/** Getter for query resource */
|
|
37
|
+
get query() {
|
|
38
|
+
this._query = this._query || (0, query_1.QueryListInstance)(this);
|
|
39
|
+
return this._query;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = V3;
|
|
@@ -134,27 +134,27 @@ export declare class CallSummaryInstance {
|
|
|
134
134
|
*/
|
|
135
135
|
connectDuration: number;
|
|
136
136
|
/**
|
|
137
|
-
* The calling party.
|
|
137
|
+
* `object` The calling party. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#tofrom-object) for the object properties.
|
|
138
138
|
*/
|
|
139
139
|
from: any;
|
|
140
140
|
/**
|
|
141
|
-
* The called party.
|
|
141
|
+
* `object` The called party. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#tofrom-object) for the object properties.
|
|
142
142
|
*/
|
|
143
143
|
to: any;
|
|
144
144
|
/**
|
|
145
|
-
* Contains metrics and properties for the Twilio media gateway of a PSTN call.
|
|
145
|
+
* `object` Contains metrics and properties for the Twilio media gateway of a PSTN call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
146
146
|
*/
|
|
147
147
|
carrierEdge: any;
|
|
148
148
|
/**
|
|
149
|
-
* Contains metrics and properties for the Twilio media gateway of a Client call.
|
|
149
|
+
* `object` Contains metrics and properties for the Twilio media gateway of a Client call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
150
150
|
*/
|
|
151
151
|
clientEdge: any;
|
|
152
152
|
/**
|
|
153
|
-
* Contains metrics and properties for the SDK sensor library for Client calls.
|
|
153
|
+
* `object` Contains metrics and properties for the SDK sensor library for Client calls. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
154
154
|
*/
|
|
155
155
|
sdkEdge: any;
|
|
156
156
|
/**
|
|
157
|
-
* Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.
|
|
157
|
+
* `object` Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
158
158
|
*/
|
|
159
159
|
sipEdge: any;
|
|
160
160
|
/**
|
|
@@ -166,19 +166,19 @@ export declare class CallSummaryInstance {
|
|
|
166
166
|
*/
|
|
167
167
|
url: string;
|
|
168
168
|
/**
|
|
169
|
-
* Attributes capturing call-flow-specific details.
|
|
169
|
+
* `object` Attributes capturing call-flow-specific details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#attributes-object) for the object properties.
|
|
170
170
|
*/
|
|
171
171
|
attributes: any;
|
|
172
172
|
/**
|
|
173
|
-
* Contains edge-agnostic call-level details.
|
|
173
|
+
* `object` Contains edge-agnostic call-level details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#properties-object) for the object properties.
|
|
174
174
|
*/
|
|
175
175
|
properties: any;
|
|
176
176
|
/**
|
|
177
|
-
* Contains trusted communications details including Branded Call and verified caller ID.
|
|
177
|
+
* `object` Contains trusted communications details including Branded Call and verified caller ID. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#trust-object) for the object properties.
|
|
178
178
|
*/
|
|
179
179
|
trust: any;
|
|
180
180
|
/**
|
|
181
|
-
* Programmatically labeled annotations for the Call. Developers can update the Call Summary records with Annotation during or after a Call. Annotations can be updated as long as the Call Summary record is addressable via the API.
|
|
181
|
+
* `object` Programmatically labeled annotations for the Call. Developers can update the Call Summary records with Annotation during or after a Call. Annotations can be updated as long as the Call Summary record is addressable via the API. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#annotation-object) for the object properties.
|
|
182
182
|
*/
|
|
183
183
|
annotation: any;
|
|
184
184
|
private get _proxy();
|
|
@@ -202,19 +202,19 @@ export declare class EventInstance {
|
|
|
202
202
|
*/
|
|
203
203
|
name: string;
|
|
204
204
|
/**
|
|
205
|
-
* Represents the connection between Twilio and our immediate carrier partners. The events here describe the call lifecycle as reported by Twilio\'s carrier media gateways.
|
|
205
|
+
* `object` Represents the connection between Twilio and our immediate carrier partners. The events here describe the call lifecycle as reported by Twilio\'s carrier media gateways. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
206
206
|
*/
|
|
207
207
|
carrierEdge: any;
|
|
208
208
|
/**
|
|
209
|
-
* Represents the Twilio media gateway for SIP interface and SIP trunking calls. The events here describe the call lifecycle as reported by Twilio\'s public media gateways.
|
|
209
|
+
* `object` Represents the Twilio media gateway for SIP interface and SIP trunking calls. The events here describe the call lifecycle as reported by Twilio\'s public media gateways. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
210
210
|
*/
|
|
211
211
|
sipEdge: any;
|
|
212
212
|
/**
|
|
213
|
-
* Represents the Voice SDK running locally in the browser or in the Android/iOS application. The events here are emitted by the Voice SDK in response to certain call progress events, network changes, or call quality conditions.
|
|
213
|
+
* `object` Represents the Voice SDK running locally in the browser or in the Android/iOS application. The events here are emitted by the Voice SDK in response to certain call progress events, network changes, or call quality conditions. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
214
214
|
*/
|
|
215
215
|
sdkEdge: any;
|
|
216
216
|
/**
|
|
217
|
-
* Represents the Twilio media gateway for Client calls. The events here describe the call lifecycle as reported by Twilio\'s Voice SDK media gateways.
|
|
217
|
+
* `object` Represents the Twilio media gateway for Client calls. The events here describe the call lifecycle as reported by Twilio\'s Voice SDK media gateways. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
218
218
|
*/
|
|
219
219
|
clientEdge: any;
|
|
220
220
|
/**
|