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.
Files changed (121) hide show
  1. package/lib/rest/ConversationsBase.d.ts +3 -0
  2. package/lib/rest/ConversationsBase.js +5 -0
  3. package/lib/rest/InsightsBase.d.ts +3 -0
  4. package/lib/rest/InsightsBase.js +5 -0
  5. package/lib/rest/IntelligenceBase.d.ts +3 -0
  6. package/lib/rest/IntelligenceBase.js +5 -0
  7. package/lib/rest/KnowledgeBase.d.ts +3 -0
  8. package/lib/rest/KnowledgeBase.js +5 -0
  9. package/lib/rest/Memory.d.ts +4 -0
  10. package/lib/rest/Memory.js +8 -0
  11. package/lib/rest/MemoryBase.d.ts +13 -0
  12. package/lib/rest/MemoryBase.js +31 -0
  13. package/lib/rest/Twilio.d.ts +5 -0
  14. package/lib/rest/Twilio.js +5 -0
  15. package/lib/rest/VoiceBase.d.ts +3 -0
  16. package/lib/rest/VoiceBase.js +5 -0
  17. package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
  18. package/lib/rest/api/v2010/account/call/recording.js +4 -0
  19. package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/call/transcription.js +6 -4
  21. package/lib/rest/api/v2010/account/call.d.ts +2 -0
  22. package/lib/rest/api/v2010/account/call.js +4 -0
  23. package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
  24. package/lib/rest/api/v2010/account/conference/participant.js +4 -0
  25. package/lib/rest/conversations/V2.d.ts +38 -0
  26. package/lib/rest/conversations/V2.js +72 -0
  27. package/lib/rest/conversations/v2/action.d.ts +241 -0
  28. package/lib/rest/conversations/v2/action.js +246 -0
  29. package/lib/rest/conversations/v2/communication.d.ts +479 -0
  30. package/lib/rest/conversations/v2/communication.js +436 -0
  31. package/lib/rest/conversations/v2/configuration.d.ts +906 -0
  32. package/lib/rest/conversations/v2/configuration.js +619 -0
  33. package/lib/rest/conversations/v2/conversation.d.ts +936 -0
  34. package/lib/rest/conversations/v2/conversation.js +664 -0
  35. package/lib/rest/conversations/v2/operation.d.ts +167 -0
  36. package/lib/rest/conversations/v2/operation.js +170 -0
  37. package/lib/rest/conversations/v2/participant.d.ts +469 -0
  38. package/lib/rest/conversations/v2/participant.js +442 -0
  39. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
  40. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
  41. package/lib/rest/insights/V3.d.ts +20 -0
  42. package/lib/rest/insights/V3.js +42 -0
  43. package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
  44. package/lib/rest/insights/v1/call/event.d.ts +4 -4
  45. package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
  46. package/lib/rest/insights/v3/metadata.d.ts +115 -0
  47. package/lib/rest/insights/v3/metadata.js +118 -0
  48. package/lib/rest/insights/v3/query.d.ts +180 -0
  49. package/lib/rest/insights/v3/query.js +214 -0
  50. package/lib/rest/intelligence/V3.d.ts +35 -0
  51. package/lib/rest/intelligence/V3.js +65 -0
  52. package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
  53. package/lib/rest/intelligence/v3/configuration.js +528 -0
  54. package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
  55. package/lib/rest/intelligence/v3/conversation.js +342 -0
  56. package/lib/rest/intelligence/v3/operator.d.ts +619 -0
  57. package/lib/rest/intelligence/v3/operator.js +493 -0
  58. package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
  59. package/lib/rest/intelligence/v3/operatorResult.js +478 -0
  60. package/lib/rest/intelligence/v3/version.d.ts +469 -0
  61. package/lib/rest/intelligence/v3/version.js +341 -0
  62. package/lib/rest/knowledge/V2.d.ts +31 -0
  63. package/lib/rest/knowledge/V2.js +62 -0
  64. package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
  65. package/lib/rest/knowledge/v2/chunk.js +178 -0
  66. package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
  67. package/lib/rest/knowledge/v2/knowledge.js +466 -0
  68. package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
  69. package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
  70. package/lib/rest/knowledge/v2/operation.d.ts +162 -0
  71. package/lib/rest/knowledge/v2/operation.js +175 -0
  72. package/lib/rest/knowledge/v2/search.d.ts +180 -0
  73. package/lib/rest/knowledge/v2/search.js +174 -0
  74. package/lib/rest/memory/V1.d.ts +76 -0
  75. package/lib/rest/memory/V1.js +140 -0
  76. package/lib/rest/memory/v1/bulk.d.ts +129 -0
  77. package/lib/rest/memory/v1/bulk.js +158 -0
  78. package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
  79. package/lib/rest/memory/v1/conversationSummary.js +473 -0
  80. package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
  81. package/lib/rest/memory/v1/dataMapping.js +512 -0
  82. package/lib/rest/memory/v1/event.d.ts +153 -0
  83. package/lib/rest/memory/v1/event.js +159 -0
  84. package/lib/rest/memory/v1/identifier.d.ts +362 -0
  85. package/lib/rest/memory/v1/identifier.js +369 -0
  86. package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
  87. package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
  88. package/lib/rest/memory/v1/import.d.ts +292 -0
  89. package/lib/rest/memory/v1/import.js +280 -0
  90. package/lib/rest/memory/v1/lookup.d.ts +82 -0
  91. package/lib/rest/memory/v1/lookup.js +118 -0
  92. package/lib/rest/memory/v1/observation.d.ts +521 -0
  93. package/lib/rest/memory/v1/observation.js +477 -0
  94. package/lib/rest/memory/v1/operation.d.ts +162 -0
  95. package/lib/rest/memory/v1/operation.js +175 -0
  96. package/lib/rest/memory/v1/profile.d.ts +548 -0
  97. package/lib/rest/memory/v1/profile.js +531 -0
  98. package/lib/rest/memory/v1/recall.d.ts +306 -0
  99. package/lib/rest/memory/v1/recall.js +234 -0
  100. package/lib/rest/memory/v1/revision.d.ts +246 -0
  101. package/lib/rest/memory/v1/revision.js +195 -0
  102. package/lib/rest/memory/v1/store.d.ts +544 -0
  103. package/lib/rest/memory/v1/store.js +534 -0
  104. package/lib/rest/memory/v1/trait.d.ts +233 -0
  105. package/lib/rest/memory/v1/trait.js +190 -0
  106. package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
  107. package/lib/rest/memory/v1/traitGroup.js +555 -0
  108. package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
  109. package/lib/rest/messaging/v2/channelsSender.js +2 -0
  110. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
  111. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
  112. package/lib/rest/studio/v2/flow.d.ts +4 -0
  113. package/lib/rest/studio/v2/flow.js +8 -0
  114. package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
  115. package/lib/rest/verify/v2/service/webhook.js +8 -8
  116. package/lib/rest/voice/V3.d.ts +15 -0
  117. package/lib/rest/voice/V3.js +37 -0
  118. package/lib/rest/voice/v3/transcription.d.ts +378 -0
  119. package/lib/rest/voice/v3/transcription.js +264 -0
  120. package/lib/twiml/VoiceResponse.d.ts +8 -0
  121. package/package.json +1 -1
@@ -0,0 +1,342 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio Conversational Intelligence API
9
+ * The Conversational Intelligence API includes resources to create and manage intelligence configurations, define and run language operators, and retrieve processed conversations and operator results. * Use the Configurations resource to create and manage intelligence configurations and define rules that control how and when language operators analyze and transform conversations. * Use the Operators resource to create custom language operators or retrieve Twilio-author and custom operators. * Use the Conversations resource to retrieve conversations processed with an intelligence configuration, and the OperatorResults resource to retrieve language operator results for those conversations.
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.ConversationPage = exports.ConversationInstance = exports.ConversationContextImpl = exports.Participant = exports.Content = exports.Communication = void 0;
20
+ exports.ConversationListInstance = ConversationListInstance;
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 Communication {
27
+ constructor(payload) {
28
+ this.id = payload["id"];
29
+ this.participantId = payload["participantId"];
30
+ this.content = payload["content"];
31
+ this.createdAt = payload["createdAt"];
32
+ }
33
+ }
34
+ exports.Communication = Communication;
35
+ /**
36
+ * The content of the communication.
37
+ */
38
+ class Content {
39
+ constructor(payload) {
40
+ this.text = payload["text"];
41
+ }
42
+ }
43
+ exports.Content = Content;
44
+ class Participant {
45
+ constructor(payload) {
46
+ this.id = payload["id"];
47
+ this.name = payload["name"];
48
+ this.type = payload["type"];
49
+ this.addressValues = payload["addressValues"];
50
+ }
51
+ }
52
+ exports.Participant = Participant;
53
+ class ConversationContextImpl {
54
+ constructor(_version, id) {
55
+ this._version = _version;
56
+ if (!(0, utility_1.isValidPathParam)(id)) {
57
+ throw new Error("Parameter 'id' is not valid.");
58
+ }
59
+ this._solution = { id };
60
+ this._uri = `/Conversations/${id}`;
61
+ }
62
+ fetch(callback) {
63
+ const headers = {};
64
+ headers["Accept"] = "application/json";
65
+ const instance = this;
66
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
67
+ uri: instance._uri,
68
+ method: "get",
69
+ headers,
70
+ });
71
+ operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.id));
72
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
73
+ return operationPromise;
74
+ }
75
+ fetchWithHttpInfo(callback) {
76
+ const headers = {};
77
+ headers["Accept"] = "application/json";
78
+ const instance = this;
79
+ let operationVersion = instance._version;
80
+ // CREATE, FETCH, UPDATE operations
81
+ let operationPromise = operationVersion
82
+ .fetchWithResponseInfo({
83
+ uri: instance._uri,
84
+ method: "get",
85
+ headers,
86
+ })
87
+ .then((response) => ({
88
+ ...response,
89
+ body: new ConversationInstance(operationVersion, response.body, instance._solution.id),
90
+ }));
91
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
92
+ return operationPromise;
93
+ }
94
+ /**
95
+ * Provide a user-friendly representation
96
+ *
97
+ * @returns Object
98
+ */
99
+ toJSON() {
100
+ return this._solution;
101
+ }
102
+ [util_1.inspect.custom](_depth, options) {
103
+ return (0, util_1.inspect)(this.toJSON(), options);
104
+ }
105
+ }
106
+ exports.ConversationContextImpl = ConversationContextImpl;
107
+ class ConversationInstance {
108
+ constructor(_version, _payload, id) {
109
+ this._version = _version;
110
+ const payload = _payload;
111
+ this.id = payload.id;
112
+ this.accountId = payload.accountId;
113
+ this.name = payload.name;
114
+ this.status = payload.status;
115
+ this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
116
+ this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
117
+ this.intelligenceConfigurationIds = payload.intelligenceConfigurationIds;
118
+ this.conversationConfigurationId = payload.conversationConfigurationId;
119
+ this.channels = payload.channels;
120
+ this.channelIds = payload.channelIds;
121
+ this.participants =
122
+ payload.participants !== null && payload.participants !== undefined
123
+ ? payload.participants.map((payload) => new Participant(payload))
124
+ : null;
125
+ this.communications =
126
+ payload.communications !== null && payload.communications !== undefined
127
+ ? payload.communications.map((payload) => new Communication(payload))
128
+ : null;
129
+ this.operatorResultIds = payload.operatorResultIds;
130
+ this._solution = { id: id };
131
+ }
132
+ get _proxy() {
133
+ this._context =
134
+ this._context ||
135
+ new ConversationContextImpl(this._version, this._solution.id);
136
+ return this._context;
137
+ }
138
+ /**
139
+ * Fetch a ConversationInstance
140
+ *
141
+ * @param callback - Callback to handle processed record
142
+ *
143
+ * @returns Resolves to processed ConversationInstance
144
+ */
145
+ fetch(callback) {
146
+ return this._proxy.fetch(callback);
147
+ }
148
+ /**
149
+ * Fetch a ConversationInstance and return HTTP info
150
+ *
151
+ * @param callback - Callback to handle processed record
152
+ *
153
+ * @returns Resolves to processed ConversationInstance with HTTP metadata
154
+ */
155
+ fetchWithHttpInfo(callback) {
156
+ return this._proxy.fetchWithHttpInfo(callback);
157
+ }
158
+ /**
159
+ * Provide a user-friendly representation
160
+ *
161
+ * @returns Object
162
+ */
163
+ toJSON() {
164
+ return {
165
+ id: this.id,
166
+ accountId: this.accountId,
167
+ name: this.name,
168
+ status: this.status,
169
+ createdAt: this.createdAt,
170
+ updatedAt: this.updatedAt,
171
+ intelligenceConfigurationIds: this.intelligenceConfigurationIds,
172
+ conversationConfigurationId: this.conversationConfigurationId,
173
+ channels: this.channels,
174
+ channelIds: this.channelIds,
175
+ participants: this.participants,
176
+ communications: this.communications,
177
+ operatorResultIds: this.operatorResultIds,
178
+ };
179
+ }
180
+ [util_1.inspect.custom](_depth, options) {
181
+ return (0, util_1.inspect)(this.toJSON(), options);
182
+ }
183
+ }
184
+ exports.ConversationInstance = ConversationInstance;
185
+ function ConversationListInstance(version) {
186
+ const instance = ((id) => instance.get(id));
187
+ instance.get = function get(id) {
188
+ return new ConversationContextImpl(version, id);
189
+ };
190
+ instance._version = version;
191
+ instance._solution = {};
192
+ instance._uri = `/Conversations`;
193
+ instance.page = function page(params, callback) {
194
+ if (params instanceof Function) {
195
+ callback = params;
196
+ params = {};
197
+ }
198
+ else {
199
+ params = params || {};
200
+ }
201
+ let data = {};
202
+ if (params["pageSize"] !== undefined)
203
+ data["pageSize"] = params["pageSize"];
204
+ if (params["pageToken"] !== undefined)
205
+ data["pageToken"] = params["pageToken"];
206
+ if (params["createdAtBefore"] !== undefined)
207
+ data["createdAtBefore"] = serialize.iso8601DateTime(params["createdAtBefore"]);
208
+ if (params["createdAtAfter"] !== undefined)
209
+ data["createdAtAfter"] = serialize.iso8601DateTime(params["createdAtAfter"]);
210
+ if (params["status"] !== undefined)
211
+ data["status"] = params["status"];
212
+ if (params["channelId"] !== undefined)
213
+ data["channelId"] = params["channelId"];
214
+ if (params["channels"] !== undefined)
215
+ data["channels"] = serialize.map(params["channels"], (e) => e);
216
+ if (params["conversationConfigurationId"] !== undefined)
217
+ data["conversationConfigurationId"] =
218
+ params["conversationConfigurationId"];
219
+ if (params["intelligenceConfigurationIds"] !== undefined)
220
+ data["intelligenceConfigurationIds"] = serialize.map(params["intelligenceConfigurationIds"], (e) => e);
221
+ if (params["operatorIds"] !== undefined)
222
+ data["operatorIds"] = serialize.map(params["operatorIds"], (e) => e);
223
+ const headers = {};
224
+ headers["Accept"] = "application/json";
225
+ let operationVersion = version, operationPromise = operationVersion.page({
226
+ uri: instance._uri,
227
+ method: "get",
228
+ params: data,
229
+ headers,
230
+ });
231
+ operationPromise = operationPromise.then((payload) => new ConversationPage(operationVersion, payload, instance._uri, data, instance._solution));
232
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
233
+ return operationPromise;
234
+ };
235
+ instance.each = instance._version.each;
236
+ instance.list = instance._version.list;
237
+ instance.getPage = function getPage(targetUrl, callback) {
238
+ const operationPromise = instance._version._domain.twilio.request({
239
+ method: "get",
240
+ uri: targetUrl,
241
+ });
242
+ let pagePromise = operationPromise.then((payload) => new ConversationPage(instance._version, payload, instance._uri, {}, instance._solution));
243
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
244
+ return pagePromise;
245
+ };
246
+ instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
247
+ if (params instanceof Function) {
248
+ callback = params;
249
+ params = {};
250
+ }
251
+ else {
252
+ params = params || {};
253
+ }
254
+ let data = {};
255
+ if (params["pageSize"] !== undefined)
256
+ data["pageSize"] = params["pageSize"];
257
+ if (params["pageToken"] !== undefined)
258
+ data["pageToken"] = params["pageToken"];
259
+ if (params["createdAtBefore"] !== undefined)
260
+ data["createdAtBefore"] = serialize.iso8601DateTime(params["createdAtBefore"]);
261
+ if (params["createdAtAfter"] !== undefined)
262
+ data["createdAtAfter"] = serialize.iso8601DateTime(params["createdAtAfter"]);
263
+ if (params["status"] !== undefined)
264
+ data["status"] = params["status"];
265
+ if (params["channelId"] !== undefined)
266
+ data["channelId"] = params["channelId"];
267
+ if (params["channels"] !== undefined)
268
+ data["channels"] = serialize.map(params["channels"], (e) => e);
269
+ if (params["conversationConfigurationId"] !== undefined)
270
+ data["conversationConfigurationId"] =
271
+ params["conversationConfigurationId"];
272
+ if (params["intelligenceConfigurationIds"] !== undefined)
273
+ data["intelligenceConfigurationIds"] = serialize.map(params["intelligenceConfigurationIds"], (e) => e);
274
+ if (params["operatorIds"] !== undefined)
275
+ data["operatorIds"] = serialize.map(params["operatorIds"], (e) => e);
276
+ const headers = {};
277
+ headers["Accept"] = "application/json";
278
+ let operationVersion = version;
279
+ // For page operations, use page() directly as it already returns { statusCode, body, headers }
280
+ // IMPORTANT: Pass full response to Page constructor, not response.body
281
+ let operationPromise = operationVersion
282
+ .page({ uri: instance._uri, method: "get", params: data, headers })
283
+ .then((response) => ({
284
+ statusCode: response.statusCode,
285
+ headers: response.headers,
286
+ body: new ConversationPage(operationVersion, response, instance._uri, data, instance._solution),
287
+ }));
288
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
289
+ return operationPromise;
290
+ };
291
+ instance.each = instance._version.each;
292
+ instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
293
+ instance.list = instance._version.list;
294
+ instance.listWithHttpInfo = instance._version.listWithHttpInfo;
295
+ instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
296
+ // Use request() directly as it already returns { statusCode, body, headers }
297
+ const operationPromise = instance._version._domain.twilio.request({
298
+ method: "get",
299
+ uri: targetUrl,
300
+ });
301
+ let pagePromise = operationPromise.then((response) => ({
302
+ statusCode: response.statusCode,
303
+ headers: response.headers,
304
+ body: new ConversationPage(instance._version, response, instance._uri, {}, instance._solution),
305
+ }));
306
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
307
+ return pagePromise;
308
+ };
309
+ instance.toJSON = function toJSON() {
310
+ return instance._solution;
311
+ };
312
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
313
+ return (0, util_1.inspect)(instance.toJSON(), options);
314
+ };
315
+ return instance;
316
+ }
317
+ class ConversationPage extends TokenPage_1.default {
318
+ /**
319
+ * Initialize the ConversationPage
320
+ *
321
+ * @param version - Version of the resource
322
+ * @param response - Response from the API
323
+ * @param uri - URI of the resource
324
+ * @param params - Query parameters
325
+ * @param solution - Path solution
326
+ */
327
+ constructor(version, response, uri, params, solution) {
328
+ super(version, response, uri, params, solution);
329
+ }
330
+ /**
331
+ * Build an instance of ConversationInstance
332
+ *
333
+ * @param payload - Payload response from the API
334
+ */
335
+ getInstance(payload) {
336
+ return new ConversationInstance(this._version, payload);
337
+ }
338
+ [util_1.inspect.custom](depth, options) {
339
+ return (0, util_1.inspect)(this.toJSON(), options);
340
+ }
341
+ }
342
+ exports.ConversationPage = ConversationPage;