twilio 5.13.1 → 6.0.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/README.md +2 -4
- 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/MessagingBase.d.ts +3 -0
- package/lib/rest/MessagingBase.js +5 -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 +2 -0
- package/lib/rest/api/v2010/account/call/transcription.js +6 -0
- 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/api/v2010/account/message.d.ts +2 -0
- package/lib/rest/api/v2010/account/message.js +4 -0
- package/lib/rest/conversations/V2.d.ts +35 -0
- package/lib/rest/conversations/V2.js +67 -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.d.ts +0 -5
- package/lib/rest/flexApi/V1.js +0 -7
- package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
- package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
- package/lib/rest/iam/V1.d.ts +3 -0
- package/lib/rest/iam/V1.js +5 -0
- package/lib/rest/iam/v1/rolePermission.d.ts +225 -0
- package/lib/rest/iam/v1/rolePermission.js +181 -0
- 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/v2/inbound.d.ts +8 -8
- package/lib/rest/insights/v2/inbound.js +4 -4
- package/lib/rest/insights/v2/outbound.d.ts +8 -8
- package/lib/rest/insights/v2/outbound.js +4 -4
- package/lib/rest/insights/v2/report.d.ts +8 -8
- package/lib/rest/insights/v2/report.js +4 -4
- 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/{flexApi/v1/createFlexInstance.js → knowledge/v2/search.js} +45 -36
- 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 +441 -0
- package/lib/rest/memory/v1/profile.js +467 -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 +503 -0
- package/lib/rest/memory/v1/store.js +482 -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/V3.d.ts +15 -0
- package/lib/rest/messaging/V3.js +37 -0
- package/lib/rest/messaging/v2/channelsSender.d.ts +9 -1
- package/lib/rest/messaging/v2/channelsSender.js +2 -0
- package/lib/rest/messaging/v3/typingIndicator.d.ts +90 -0
- package/lib/rest/messaging/v3/typingIndicator.js +114 -0
- package/lib/rest/numbers/v3/hostedNumberOrder.d.ts +1 -1
- package/lib/rest/numbers/v3/hostedNumberOrder.js +2 -1
- 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/execution.d.ts +12 -0
- package/lib/rest/studio/v2/flow/execution.js +6 -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/approveChallenge.d.ts +6 -6
- package/lib/rest/verify/v2/service/approveChallenge.js +2 -2
- package/lib/rest/verify/v2/service/newChallenge.d.ts +6 -6
- package/lib/rest/verify/v2/service/newChallenge.js +2 -2
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
- package/lib/rest/verify/v2/service/webhook.js +8 -8
- package/lib/rest/video/v1/room.d.ts +4 -1
- 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 +18 -0
- package/package.json +2 -2
- package/lib/rest/flexApi/v1/createFlexInstance.d.ts +0 -165
|
@@ -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;
|
package/lib/rest/flexApi/V1.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import Version from "../../base/Version";
|
|
|
3
3
|
import { AssessmentsListInstance } from "./v1/assessments";
|
|
4
4
|
import { ChannelListInstance } from "./v1/channel";
|
|
5
5
|
import { ConfigurationListInstance } from "./v1/configuration";
|
|
6
|
-
import { CreateFlexInstanceListInstance } from "./v1/createFlexInstance";
|
|
7
6
|
import { FlexFlowListInstance } from "./v1/flexFlow";
|
|
8
7
|
import { InsightsAssessmentsCommentListInstance } from "./v1/insightsAssessmentsComment";
|
|
9
8
|
import { InsightsConversationsListInstance } from "./v1/insightsConversations";
|
|
@@ -37,8 +36,6 @@ export default class V1 extends Version {
|
|
|
37
36
|
protected _channel?: ChannelListInstance;
|
|
38
37
|
/** configuration - { Twilio.FlexApi.V1.ConfigurationListInstance } resource */
|
|
39
38
|
protected _configuration?: ConfigurationListInstance;
|
|
40
|
-
/** createFlexInstance - { Twilio.FlexApi.V1.CreateFlexInstanceListInstance } resource */
|
|
41
|
-
protected _createFlexInstance?: CreateFlexInstanceListInstance;
|
|
42
39
|
/** flexFlow - { Twilio.FlexApi.V1.FlexFlowListInstance } resource */
|
|
43
40
|
protected _flexFlow?: FlexFlowListInstance;
|
|
44
41
|
/** insightsAssessmentsComment - { Twilio.FlexApi.V1.InsightsAssessmentsCommentListInstance } resource */
|
|
@@ -85,8 +82,6 @@ export default class V1 extends Version {
|
|
|
85
82
|
get channel(): ChannelListInstance;
|
|
86
83
|
/** Getter for configuration resource */
|
|
87
84
|
get configuration(): ConfigurationListInstance;
|
|
88
|
-
/** Getter for createFlexInstance resource */
|
|
89
|
-
get createFlexInstance(): CreateFlexInstanceListInstance;
|
|
90
85
|
/** Getter for flexFlow resource */
|
|
91
86
|
get flexFlow(): FlexFlowListInstance;
|
|
92
87
|
/** Getter for insightsAssessmentsComment resource */
|
package/lib/rest/flexApi/V1.js
CHANGED
|
@@ -20,7 +20,6 @@ const Version_1 = __importDefault(require("../../base/Version"));
|
|
|
20
20
|
const assessments_1 = require("./v1/assessments");
|
|
21
21
|
const channel_1 = require("./v1/channel");
|
|
22
22
|
const configuration_1 = require("./v1/configuration");
|
|
23
|
-
const createFlexInstance_1 = require("./v1/createFlexInstance");
|
|
24
23
|
const flexFlow_1 = require("./v1/flexFlow");
|
|
25
24
|
const insightsAssessmentsComment_1 = require("./v1/insightsAssessmentsComment");
|
|
26
25
|
const insightsConversations_1 = require("./v1/insightsConversations");
|
|
@@ -66,12 +65,6 @@ class V1 extends Version_1.default {
|
|
|
66
65
|
this._configuration || (0, configuration_1.ConfigurationListInstance)(this);
|
|
67
66
|
return this._configuration;
|
|
68
67
|
}
|
|
69
|
-
/** Getter for createFlexInstance resource */
|
|
70
|
-
get createFlexInstance() {
|
|
71
|
-
this._createFlexInstance =
|
|
72
|
-
this._createFlexInstance || (0, createFlexInstance_1.CreateFlexInstanceListInstance)(this);
|
|
73
|
-
return this._createFlexInstance;
|
|
74
|
-
}
|
|
75
68
|
/** Getter for flexFlow resource */
|
|
76
69
|
get flexFlow() {
|
|
77
70
|
this._flexFlow = this._flexFlow || (0, flexFlow_1.FlexFlowListInstance)(this);
|
|
@@ -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"];
|
package/lib/rest/iam/V1.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ApiKeyListInstance } from "./v1/apiKey";
|
|
|
4
4
|
import { GetApiKeysListInstance } from "./v1/getApiKeys";
|
|
5
5
|
import { NewApiKeyListInstance } from "./v1/newApiKey";
|
|
6
6
|
import { OAuthAppListInstance } from "./v1/oAuthApp";
|
|
7
|
+
import { RolePermissionListInstance } from "./v1/rolePermission";
|
|
7
8
|
import { TokenListInstance } from "./v1/token";
|
|
8
9
|
export default class V1 extends Version {
|
|
9
10
|
/**
|
|
@@ -30,6 +31,8 @@ export default class V1 extends Version {
|
|
|
30
31
|
get newApiKey(): NewApiKeyListInstance;
|
|
31
32
|
/** Getter for oAuthApps resource */
|
|
32
33
|
get oAuthApps(): OAuthAppListInstance;
|
|
34
|
+
/** Accessor for rolePermission resource */
|
|
35
|
+
rolePermission(RoleSid: string): RolePermissionListInstance;
|
|
33
36
|
/** Getter for token resource */
|
|
34
37
|
get token(): TokenListInstance;
|
|
35
38
|
}
|
package/lib/rest/iam/V1.js
CHANGED
|
@@ -21,6 +21,7 @@ const apiKey_1 = require("./v1/apiKey");
|
|
|
21
21
|
const getApiKeys_1 = require("./v1/getApiKeys");
|
|
22
22
|
const newApiKey_1 = require("./v1/newApiKey");
|
|
23
23
|
const oAuthApp_1 = require("./v1/oAuthApp");
|
|
24
|
+
const rolePermission_1 = require("./v1/rolePermission");
|
|
24
25
|
const token_1 = require("./v1/token");
|
|
25
26
|
class V1 extends Version_1.default {
|
|
26
27
|
/**
|
|
@@ -51,6 +52,10 @@ class V1 extends Version_1.default {
|
|
|
51
52
|
this._oAuthApps = this._oAuthApps || (0, oAuthApp_1.OAuthAppListInstance)(this);
|
|
52
53
|
return this._oAuthApps;
|
|
53
54
|
}
|
|
55
|
+
/** Accessor for rolePermission resource */
|
|
56
|
+
rolePermission(RoleSid) {
|
|
57
|
+
return (0, rolePermission_1.RolePermissionListInstance)(this, RoleSid);
|
|
58
|
+
}
|
|
54
59
|
/** Getter for token resource */
|
|
55
60
|
get token() {
|
|
56
61
|
this._token = this._token || (0, token_1.TokenListInstance)(this);
|