twilio 5.3.1 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/RequestClient.d.ts +1 -0
- package/lib/rest/Preview.d.ts +0 -5
- package/lib/rest/Preview.js +0 -7
- package/lib/rest/PreviewBase.d.ts +0 -3
- package/lib/rest/PreviewBase.js +0 -6
- package/lib/rest/accounts/V1.d.ts +10 -0
- package/lib/rest/accounts/V1.js +12 -0
- package/lib/rest/accounts/v1/bulkConsents.d.ts +53 -0
- package/lib/rest/accounts/v1/bulkConsents.js +74 -0
- package/lib/rest/accounts/v1/bulkContacts.d.ts +53 -0
- package/lib/rest/accounts/v1/bulkContacts.js +74 -0
- package/lib/rest/assistants/v1/assistant/assistantsKnowledge.d.ts +260 -0
- package/lib/rest/{preview/deployed_devices/fleet/key.js → assistants/v1/assistant/assistantsKnowledge.js} +62 -116
- package/lib/rest/assistants/v1/assistant/assistantsTool.d.ts +266 -0
- package/lib/rest/{preview/deployed_devices/fleet/deployment.js → assistants/v1/assistant/assistantsTool.js} +64 -112
- package/lib/rest/assistants/v1/assistant/message.d.ts +112 -0
- package/lib/rest/assistants/v1/assistant/message.js +90 -0
- package/lib/rest/assistants/v1/assistant.d.ts +38 -0
- package/lib/rest/assistants/v1/assistant.js +40 -0
- package/lib/rest/assistants/v1/knowledge/knowledgeStatus.d.ts +101 -0
- package/lib/rest/assistants/v1/knowledge/knowledgeStatus.js +115 -0
- package/lib/rest/assistants/v1/knowledge.d.ts +14 -0
- package/lib/rest/assistants/v1/knowledge.js +15 -0
- package/lib/rest/assistants/v1/tool.d.ts +67 -0
- package/lib/rest/assistants/v1/tool.js +28 -1
- package/lib/rest/iam/V1.d.ts +5 -5
- package/lib/rest/iam/V1.js +5 -5
- package/lib/rest/iam/v1/{newApiKey.d.ts → key.d.ts} +14 -14
- package/lib/rest/iam/v1/{newApiKey.js → key.js} +6 -6
- package/lib/rest/numbers/V1.d.ts +5 -5
- package/lib/rest/numbers/V1.js +6 -8
- package/lib/rest/numbers/v1/portingPortability.d.ts +2 -0
- package/lib/rest/numbers/v1/portingPortability.js +2 -0
- package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.d.ts → webhook.d.ts} +10 -10
- package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.js → webhook.js} +6 -6
- package/lib/rest/serverless/v1/service/environment/deployment.d.ts +2 -0
- package/lib/rest/serverless/v1/service/environment/deployment.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/task.d.ts +2 -2
- package/lib/rest/verify/v2/service/verification.d.ts +2 -0
- package/lib/rest/verify/v2/service/verification.js +2 -0
- package/lib/rest/verify/v2/service/verificationCheck.d.ts +2 -0
- package/lib/rest/verify/v2/service/verificationCheck.js +2 -0
- package/lib/webhooks/webhooks.d.ts +1 -0
- package/package.json +1 -1
- package/lib/rest/preview/DeployedDevices.d.ts +0 -15
- package/lib/rest/preview/DeployedDevices.js +0 -36
- package/lib/rest/preview/deployed_devices/fleet/certificate.d.ts +0 -324
- package/lib/rest/preview/deployed_devices/fleet/certificate.js +0 -269
- package/lib/rest/preview/deployed_devices/fleet/deployment.d.ts +0 -318
- package/lib/rest/preview/deployed_devices/fleet/device.d.ts +0 -358
- package/lib/rest/preview/deployed_devices/fleet/device.js +0 -284
- package/lib/rest/preview/deployed_devices/fleet/key.d.ts +0 -330
- package/lib/rest/preview/deployed_devices/fleet.d.ts +0 -352
- package/lib/rest/preview/deployed_devices/fleet.js +0 -307
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
6
|
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
7
|
*
|
|
8
|
-
* Twilio -
|
|
8
|
+
* Twilio - Assistants
|
|
9
9
|
* This is the public Twilio REST API.
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
@@ -16,66 +16,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.AssistantsToolPage = exports.AssistantsToolListInstance = exports.AssistantsToolInstance = exports.AssistantsToolContextImpl = void 0;
|
|
20
20
|
const util_1 = require("util");
|
|
21
21
|
const Page_1 = __importDefault(require("../../../../base/Page"));
|
|
22
22
|
const deserialize = require("../../../../base/deserialize");
|
|
23
23
|
const serialize = require("../../../../base/serialize");
|
|
24
24
|
const utility_1 = require("../../../../base/utility");
|
|
25
|
-
class
|
|
26
|
-
constructor(_version,
|
|
25
|
+
class AssistantsToolContextImpl {
|
|
26
|
+
constructor(_version, assistantId, id) {
|
|
27
27
|
this._version = _version;
|
|
28
|
-
if (!(0, utility_1.isValidPathParam)(
|
|
29
|
-
throw new Error("Parameter '
|
|
28
|
+
if (!(0, utility_1.isValidPathParam)(assistantId)) {
|
|
29
|
+
throw new Error("Parameter 'assistantId' is not valid.");
|
|
30
30
|
}
|
|
31
|
-
if (!(0, utility_1.isValidPathParam)(
|
|
32
|
-
throw new Error("Parameter '
|
|
31
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
32
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
33
33
|
}
|
|
34
|
-
this._solution = {
|
|
35
|
-
this._uri = `/
|
|
34
|
+
this._solution = { assistantId, id };
|
|
35
|
+
this._uri = `/Assistants/${assistantId}/Tools/${id}`;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
const instance = this;
|
|
39
|
-
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
40
|
-
uri: instance._uri,
|
|
41
|
-
method: "delete",
|
|
42
|
-
});
|
|
43
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
44
|
-
return operationPromise;
|
|
45
|
-
}
|
|
46
|
-
fetch(callback) {
|
|
37
|
+
create(callback) {
|
|
47
38
|
const instance = this;
|
|
48
|
-
let operationVersion = instance._version, operationPromise = operationVersion.
|
|
39
|
+
let operationVersion = instance._version, operationPromise = operationVersion.create({
|
|
49
40
|
uri: instance._uri,
|
|
50
|
-
method: "
|
|
41
|
+
method: "post",
|
|
51
42
|
});
|
|
52
|
-
operationPromise = operationPromise.then((payload) => new
|
|
43
|
+
operationPromise = operationPromise.then((payload) => new AssistantsToolInstance(operationVersion, payload, instance._solution.assistantId, instance._solution.id));
|
|
53
44
|
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
54
45
|
return operationPromise;
|
|
55
46
|
}
|
|
56
|
-
|
|
57
|
-
if (params instanceof Function) {
|
|
58
|
-
callback = params;
|
|
59
|
-
params = {};
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
params = params || {};
|
|
63
|
-
}
|
|
64
|
-
let data = {};
|
|
65
|
-
if (params["friendlyName"] !== undefined)
|
|
66
|
-
data["FriendlyName"] = params["friendlyName"];
|
|
67
|
-
if (params["syncServiceSid"] !== undefined)
|
|
68
|
-
data["SyncServiceSid"] = params["syncServiceSid"];
|
|
69
|
-
const headers = {};
|
|
70
|
-
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
47
|
+
remove(callback) {
|
|
71
48
|
const instance = this;
|
|
72
|
-
let operationVersion = instance._version, operationPromise = operationVersion.
|
|
49
|
+
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
73
50
|
uri: instance._uri,
|
|
74
|
-
method: "
|
|
75
|
-
data,
|
|
76
|
-
headers,
|
|
51
|
+
method: "delete",
|
|
77
52
|
});
|
|
78
|
-
operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid));
|
|
79
53
|
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
80
54
|
return operationPromise;
|
|
81
55
|
}
|
|
@@ -91,48 +65,48 @@ class DeploymentContextImpl {
|
|
|
91
65
|
return (0, util_1.inspect)(this.toJSON(), options);
|
|
92
66
|
}
|
|
93
67
|
}
|
|
94
|
-
exports.
|
|
95
|
-
class
|
|
96
|
-
constructor(_version, payload,
|
|
68
|
+
exports.AssistantsToolContextImpl = AssistantsToolContextImpl;
|
|
69
|
+
class AssistantsToolInstance {
|
|
70
|
+
constructor(_version, payload, assistantId, id) {
|
|
97
71
|
this._version = _version;
|
|
98
|
-
this.sid = payload.sid;
|
|
99
|
-
this.url = payload.url;
|
|
100
|
-
this.friendlyName = payload.friendly_name;
|
|
101
|
-
this.fleetSid = payload.fleet_sid;
|
|
102
72
|
this.accountSid = payload.account_sid;
|
|
103
|
-
this.
|
|
73
|
+
this.description = payload.description;
|
|
74
|
+
this.enabled = payload.enabled;
|
|
75
|
+
this.id = payload.id;
|
|
76
|
+
this.meta = payload.meta;
|
|
77
|
+
this.name = payload.name;
|
|
78
|
+
this.requiresAuth = payload.requires_auth;
|
|
79
|
+
this.type = payload.type;
|
|
80
|
+
this.url = payload.url;
|
|
104
81
|
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
105
82
|
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
106
|
-
this._solution = {
|
|
83
|
+
this._solution = { assistantId, id: id || this.id };
|
|
107
84
|
}
|
|
108
85
|
get _proxy() {
|
|
109
86
|
this._context =
|
|
110
87
|
this._context ||
|
|
111
|
-
new
|
|
88
|
+
new AssistantsToolContextImpl(this._version, this._solution.assistantId, this._solution.id);
|
|
112
89
|
return this._context;
|
|
113
90
|
}
|
|
114
91
|
/**
|
|
115
|
-
*
|
|
92
|
+
* Create a AssistantsToolInstance
|
|
116
93
|
*
|
|
117
94
|
* @param callback - Callback to handle processed record
|
|
118
95
|
*
|
|
119
|
-
* @returns Resolves to processed
|
|
96
|
+
* @returns Resolves to processed AssistantsToolInstance
|
|
120
97
|
*/
|
|
121
|
-
|
|
122
|
-
return this._proxy.
|
|
98
|
+
create(callback) {
|
|
99
|
+
return this._proxy.create(callback);
|
|
123
100
|
}
|
|
124
101
|
/**
|
|
125
|
-
*
|
|
102
|
+
* Remove a AssistantsToolInstance
|
|
126
103
|
*
|
|
127
104
|
* @param callback - Callback to handle processed record
|
|
128
105
|
*
|
|
129
|
-
* @returns Resolves to processed
|
|
106
|
+
* @returns Resolves to processed boolean
|
|
130
107
|
*/
|
|
131
|
-
|
|
132
|
-
return this._proxy.
|
|
133
|
-
}
|
|
134
|
-
update(params, callback) {
|
|
135
|
-
return this._proxy.update(params, callback);
|
|
108
|
+
remove(callback) {
|
|
109
|
+
return this._proxy.remove(callback);
|
|
136
110
|
}
|
|
137
111
|
/**
|
|
138
112
|
* Provide a user-friendly representation
|
|
@@ -141,12 +115,15 @@ class DeploymentInstance {
|
|
|
141
115
|
*/
|
|
142
116
|
toJSON() {
|
|
143
117
|
return {
|
|
144
|
-
sid: this.sid,
|
|
145
|
-
url: this.url,
|
|
146
|
-
friendlyName: this.friendlyName,
|
|
147
|
-
fleetSid: this.fleetSid,
|
|
148
118
|
accountSid: this.accountSid,
|
|
149
|
-
|
|
119
|
+
description: this.description,
|
|
120
|
+
enabled: this.enabled,
|
|
121
|
+
id: this.id,
|
|
122
|
+
meta: this.meta,
|
|
123
|
+
name: this.name,
|
|
124
|
+
requiresAuth: this.requiresAuth,
|
|
125
|
+
type: this.type,
|
|
126
|
+
url: this.url,
|
|
150
127
|
dateCreated: this.dateCreated,
|
|
151
128
|
dateUpdated: this.dateUpdated,
|
|
152
129
|
};
|
|
@@ -155,43 +132,18 @@ class DeploymentInstance {
|
|
|
155
132
|
return (0, util_1.inspect)(this.toJSON(), options);
|
|
156
133
|
}
|
|
157
134
|
}
|
|
158
|
-
exports.
|
|
159
|
-
function
|
|
160
|
-
if (!(0, utility_1.isValidPathParam)(
|
|
161
|
-
throw new Error("Parameter '
|
|
162
|
-
}
|
|
163
|
-
const instance = ((
|
|
164
|
-
instance.get = function get(
|
|
165
|
-
return new
|
|
135
|
+
exports.AssistantsToolInstance = AssistantsToolInstance;
|
|
136
|
+
function AssistantsToolListInstance(version, assistantId) {
|
|
137
|
+
if (!(0, utility_1.isValidPathParam)(assistantId)) {
|
|
138
|
+
throw new Error("Parameter 'assistantId' is not valid.");
|
|
139
|
+
}
|
|
140
|
+
const instance = ((id) => instance.get(id));
|
|
141
|
+
instance.get = function get(id) {
|
|
142
|
+
return new AssistantsToolContextImpl(version, assistantId, id);
|
|
166
143
|
};
|
|
167
144
|
instance._version = version;
|
|
168
|
-
instance._solution = {
|
|
169
|
-
instance._uri = `/
|
|
170
|
-
instance.create = function create(params, callback) {
|
|
171
|
-
if (params instanceof Function) {
|
|
172
|
-
callback = params;
|
|
173
|
-
params = {};
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
params = params || {};
|
|
177
|
-
}
|
|
178
|
-
let data = {};
|
|
179
|
-
if (params["friendlyName"] !== undefined)
|
|
180
|
-
data["FriendlyName"] = params["friendlyName"];
|
|
181
|
-
if (params["syncServiceSid"] !== undefined)
|
|
182
|
-
data["SyncServiceSid"] = params["syncServiceSid"];
|
|
183
|
-
const headers = {};
|
|
184
|
-
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
185
|
-
let operationVersion = version, operationPromise = operationVersion.create({
|
|
186
|
-
uri: instance._uri,
|
|
187
|
-
method: "post",
|
|
188
|
-
data,
|
|
189
|
-
headers,
|
|
190
|
-
});
|
|
191
|
-
operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.fleetSid));
|
|
192
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
193
|
-
return operationPromise;
|
|
194
|
-
};
|
|
145
|
+
instance._solution = { assistantId };
|
|
146
|
+
instance._uri = `/Assistants/${assistantId}/Tools`;
|
|
195
147
|
instance.page = function page(params, callback) {
|
|
196
148
|
if (params instanceof Function) {
|
|
197
149
|
callback = params;
|
|
@@ -214,7 +166,7 @@ function DeploymentListInstance(version, fleetSid) {
|
|
|
214
166
|
params: data,
|
|
215
167
|
headers,
|
|
216
168
|
});
|
|
217
|
-
operationPromise = operationPromise.then((payload) => new
|
|
169
|
+
operationPromise = operationPromise.then((payload) => new AssistantsToolPage(operationVersion, payload, instance._solution));
|
|
218
170
|
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
219
171
|
return operationPromise;
|
|
220
172
|
};
|
|
@@ -225,7 +177,7 @@ function DeploymentListInstance(version, fleetSid) {
|
|
|
225
177
|
method: "get",
|
|
226
178
|
uri: targetUrl,
|
|
227
179
|
});
|
|
228
|
-
let pagePromise = operationPromise.then((payload) => new
|
|
180
|
+
let pagePromise = operationPromise.then((payload) => new AssistantsToolPage(instance._version, payload, instance._solution));
|
|
229
181
|
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
230
182
|
return pagePromise;
|
|
231
183
|
};
|
|
@@ -237,10 +189,10 @@ function DeploymentListInstance(version, fleetSid) {
|
|
|
237
189
|
};
|
|
238
190
|
return instance;
|
|
239
191
|
}
|
|
240
|
-
exports.
|
|
241
|
-
class
|
|
192
|
+
exports.AssistantsToolListInstance = AssistantsToolListInstance;
|
|
193
|
+
class AssistantsToolPage extends Page_1.default {
|
|
242
194
|
/**
|
|
243
|
-
* Initialize the
|
|
195
|
+
* Initialize the AssistantsToolPage
|
|
244
196
|
*
|
|
245
197
|
* @param version - Version of the resource
|
|
246
198
|
* @param response - Response from the API
|
|
@@ -250,15 +202,15 @@ class DeploymentPage extends Page_1.default {
|
|
|
250
202
|
super(version, response, solution);
|
|
251
203
|
}
|
|
252
204
|
/**
|
|
253
|
-
* Build an instance of
|
|
205
|
+
* Build an instance of AssistantsToolInstance
|
|
254
206
|
*
|
|
255
207
|
* @param payload - Payload response from the API
|
|
256
208
|
*/
|
|
257
209
|
getInstance(payload) {
|
|
258
|
-
return new
|
|
210
|
+
return new AssistantsToolInstance(this._version, payload, this._solution.assistantId);
|
|
259
211
|
}
|
|
260
212
|
[util_1.inspect.custom](depth, options) {
|
|
261
213
|
return (0, util_1.inspect)(this.toJSON(), options);
|
|
262
214
|
}
|
|
263
215
|
}
|
|
264
|
-
exports.
|
|
216
|
+
exports.AssistantsToolPage = AssistantsToolPage;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../../V1";
|
|
4
|
+
export declare class AssistantsV1ServiceAssistantSendMessageRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The unique identity of user for the session.
|
|
7
|
+
*/
|
|
8
|
+
"identity": string;
|
|
9
|
+
/**
|
|
10
|
+
* The unique name for the session.
|
|
11
|
+
*/
|
|
12
|
+
"sessionId"?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The query to ask the assistant.
|
|
15
|
+
*/
|
|
16
|
+
"body": string;
|
|
17
|
+
/**
|
|
18
|
+
* The webhook url to call after the assistant has generated a response or report an error.
|
|
19
|
+
*/
|
|
20
|
+
"webhook"?: string;
|
|
21
|
+
/**
|
|
22
|
+
* one of the modes \'chat\', \'email\' or \'voice\'
|
|
23
|
+
*/
|
|
24
|
+
"mode"?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Options to pass to create a MessageInstance
|
|
28
|
+
*/
|
|
29
|
+
export interface MessageListInstanceCreateOptions {
|
|
30
|
+
/** */
|
|
31
|
+
assistantsV1ServiceAssistantSendMessageRequest: AssistantsV1ServiceAssistantSendMessageRequest;
|
|
32
|
+
}
|
|
33
|
+
export interface MessageSolution {
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
36
|
+
export interface MessageListInstance {
|
|
37
|
+
_version: V1;
|
|
38
|
+
_solution: MessageSolution;
|
|
39
|
+
_uri: string;
|
|
40
|
+
/**
|
|
41
|
+
* Create a MessageInstance
|
|
42
|
+
*
|
|
43
|
+
* @param params - Body for request
|
|
44
|
+
* @param callback - Callback to handle processed record
|
|
45
|
+
*
|
|
46
|
+
* @returns Resolves to processed MessageInstance
|
|
47
|
+
*/
|
|
48
|
+
create(params: AssistantsV1ServiceAssistantSendMessageRequest, callback?: (error: Error | null, item?: MessageInstance) => any): Promise<MessageInstance>;
|
|
49
|
+
/**
|
|
50
|
+
* Provide a user-friendly representation
|
|
51
|
+
*/
|
|
52
|
+
toJSON(): any;
|
|
53
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
54
|
+
}
|
|
55
|
+
export declare function MessageListInstance(version: V1, id: string): MessageListInstance;
|
|
56
|
+
interface MessageResource {
|
|
57
|
+
status: string;
|
|
58
|
+
flagged: boolean;
|
|
59
|
+
aborted: boolean;
|
|
60
|
+
session_id: string;
|
|
61
|
+
account_sid: string;
|
|
62
|
+
body: string;
|
|
63
|
+
error: string;
|
|
64
|
+
}
|
|
65
|
+
export declare class MessageInstance {
|
|
66
|
+
protected _version: V1;
|
|
67
|
+
constructor(_version: V1, payload: MessageResource, id: string);
|
|
68
|
+
/**
|
|
69
|
+
* success or failure based on whether the request successfully generated a response.
|
|
70
|
+
*/
|
|
71
|
+
status: string;
|
|
72
|
+
/**
|
|
73
|
+
* If successful, this property will denote whether the response was flagged or not.
|
|
74
|
+
*/
|
|
75
|
+
flagged: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* This property will denote whether the request was aborted or not.
|
|
78
|
+
*/
|
|
79
|
+
aborted: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The unique name for the session.
|
|
82
|
+
*/
|
|
83
|
+
sessionId: string;
|
|
84
|
+
/**
|
|
85
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that sent the Message.
|
|
86
|
+
*/
|
|
87
|
+
accountSid: string;
|
|
88
|
+
/**
|
|
89
|
+
* If successful, the body of the generated response
|
|
90
|
+
*/
|
|
91
|
+
body: string;
|
|
92
|
+
/**
|
|
93
|
+
* The error message if generation was not successful
|
|
94
|
+
*/
|
|
95
|
+
error: string;
|
|
96
|
+
/**
|
|
97
|
+
* Provide a user-friendly representation
|
|
98
|
+
*
|
|
99
|
+
* @returns Object
|
|
100
|
+
*/
|
|
101
|
+
toJSON(): {
|
|
102
|
+
status: string;
|
|
103
|
+
flagged: boolean;
|
|
104
|
+
aborted: boolean;
|
|
105
|
+
sessionId: string;
|
|
106
|
+
accountSid: string;
|
|
107
|
+
body: string;
|
|
108
|
+
error: string;
|
|
109
|
+
};
|
|
110
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
111
|
+
}
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Assistants
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.MessageInstance = exports.MessageListInstance = exports.AssistantsV1ServiceAssistantSendMessageRequest = void 0;
|
|
17
|
+
const util_1 = require("util");
|
|
18
|
+
const deserialize = require("../../../../base/deserialize");
|
|
19
|
+
const serialize = require("../../../../base/serialize");
|
|
20
|
+
const utility_1 = require("../../../../base/utility");
|
|
21
|
+
class AssistantsV1ServiceAssistantSendMessageRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.AssistantsV1ServiceAssistantSendMessageRequest = AssistantsV1ServiceAssistantSendMessageRequest;
|
|
24
|
+
function MessageListInstance(version, id) {
|
|
25
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
26
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
27
|
+
}
|
|
28
|
+
const instance = {};
|
|
29
|
+
instance._version = version;
|
|
30
|
+
instance._solution = { id };
|
|
31
|
+
instance._uri = `/Assistants/${id}/Messages`;
|
|
32
|
+
instance.create = function create(params, callback) {
|
|
33
|
+
if (params === null || params === undefined) {
|
|
34
|
+
throw new Error('Required parameter "params" missing.');
|
|
35
|
+
}
|
|
36
|
+
let data = {};
|
|
37
|
+
data = params;
|
|
38
|
+
const headers = {};
|
|
39
|
+
headers["Content-Type"] = "application/json";
|
|
40
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
41
|
+
uri: instance._uri,
|
|
42
|
+
method: "post",
|
|
43
|
+
data,
|
|
44
|
+
headers,
|
|
45
|
+
});
|
|
46
|
+
operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.id));
|
|
47
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
48
|
+
return operationPromise;
|
|
49
|
+
};
|
|
50
|
+
instance.toJSON = function toJSON() {
|
|
51
|
+
return instance._solution;
|
|
52
|
+
};
|
|
53
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
54
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
55
|
+
};
|
|
56
|
+
return instance;
|
|
57
|
+
}
|
|
58
|
+
exports.MessageListInstance = MessageListInstance;
|
|
59
|
+
class MessageInstance {
|
|
60
|
+
constructor(_version, payload, id) {
|
|
61
|
+
this._version = _version;
|
|
62
|
+
this.status = payload.status;
|
|
63
|
+
this.flagged = payload.flagged;
|
|
64
|
+
this.aborted = payload.aborted;
|
|
65
|
+
this.sessionId = payload.session_id;
|
|
66
|
+
this.accountSid = payload.account_sid;
|
|
67
|
+
this.body = payload.body;
|
|
68
|
+
this.error = payload.error;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Provide a user-friendly representation
|
|
72
|
+
*
|
|
73
|
+
* @returns Object
|
|
74
|
+
*/
|
|
75
|
+
toJSON() {
|
|
76
|
+
return {
|
|
77
|
+
status: this.status,
|
|
78
|
+
flagged: this.flagged,
|
|
79
|
+
aborted: this.aborted,
|
|
80
|
+
sessionId: this.sessionId,
|
|
81
|
+
accountSid: this.accountSid,
|
|
82
|
+
body: this.body,
|
|
83
|
+
error: this.error,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
[util_1.inspect.custom](_depth, options) {
|
|
87
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.MessageInstance = MessageInstance;
|
|
@@ -3,7 +3,10 @@ import { inspect, InspectOptions } from "util";
|
|
|
3
3
|
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
4
|
import Response from "../../../http/response";
|
|
5
5
|
import V1 from "../V1";
|
|
6
|
+
import { AssistantsKnowledgeListInstance } from "./assistant/assistantsKnowledge";
|
|
7
|
+
import { AssistantsToolListInstance } from "./assistant/assistantsTool";
|
|
6
8
|
import { FeedbackListInstance } from "./assistant/feedback";
|
|
9
|
+
import { MessageListInstance } from "./assistant/message";
|
|
7
10
|
export declare class AssistantsV1ServiceCreateAssistantRequest {
|
|
8
11
|
"customerAi"?: AssistantsV1ServiceCustomerAi;
|
|
9
12
|
/**
|
|
@@ -59,6 +62,10 @@ export declare class AssistantsV1ServiceKnowledge {
|
|
|
59
62
|
* The type of knowledge source (\'Web\', \'Database\', \'Text\', \'File\')
|
|
60
63
|
*/
|
|
61
64
|
"type"?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The url of the knowledge resource.
|
|
67
|
+
*/
|
|
68
|
+
"url"?: string;
|
|
62
69
|
/**
|
|
63
70
|
* The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
64
71
|
*/
|
|
@@ -115,6 +122,10 @@ export declare class AssistantsV1ServiceTool {
|
|
|
115
122
|
* The type of the tool. (\'WEBHOOK\')
|
|
116
123
|
*/
|
|
117
124
|
"type": string;
|
|
125
|
+
/**
|
|
126
|
+
* The url of the tool resource.
|
|
127
|
+
*/
|
|
128
|
+
"url"?: string;
|
|
118
129
|
/**
|
|
119
130
|
* The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
120
131
|
*/
|
|
@@ -188,7 +199,10 @@ export interface AssistantListInstancePageOptions {
|
|
|
188
199
|
pageToken?: string;
|
|
189
200
|
}
|
|
190
201
|
export interface AssistantContext {
|
|
202
|
+
assistantsKnowledge: AssistantsKnowledgeListInstance;
|
|
203
|
+
assistantsTools: AssistantsToolListInstance;
|
|
191
204
|
feedbacks: FeedbackListInstance;
|
|
205
|
+
messages: MessageListInstance;
|
|
192
206
|
/**
|
|
193
207
|
* Remove a AssistantInstance
|
|
194
208
|
*
|
|
@@ -235,9 +249,15 @@ export declare class AssistantContextImpl implements AssistantContext {
|
|
|
235
249
|
protected _version: V1;
|
|
236
250
|
protected _solution: AssistantContextSolution;
|
|
237
251
|
protected _uri: string;
|
|
252
|
+
protected _assistantsKnowledge?: AssistantsKnowledgeListInstance;
|
|
253
|
+
protected _assistantsTools?: AssistantsToolListInstance;
|
|
238
254
|
protected _feedbacks?: FeedbackListInstance;
|
|
255
|
+
protected _messages?: MessageListInstance;
|
|
239
256
|
constructor(_version: V1, id: string);
|
|
257
|
+
get assistantsKnowledge(): AssistantsKnowledgeListInstance;
|
|
258
|
+
get assistantsTools(): AssistantsToolListInstance;
|
|
240
259
|
get feedbacks(): FeedbackListInstance;
|
|
260
|
+
get messages(): MessageListInstance;
|
|
241
261
|
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
242
262
|
fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
243
263
|
update(params?: AssistantsV1ServiceUpdateAssistantRequest | ((error: Error | null, item?: AssistantInstance) => any), callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
@@ -259,6 +279,7 @@ interface AssistantResource {
|
|
|
259
279
|
model: string;
|
|
260
280
|
name: string;
|
|
261
281
|
owner: string;
|
|
282
|
+
url: string;
|
|
262
283
|
personality_prompt: string;
|
|
263
284
|
date_created: Date;
|
|
264
285
|
date_updated: Date;
|
|
@@ -294,6 +315,10 @@ export declare class AssistantInstance {
|
|
|
294
315
|
* The owner/company of the assistant.
|
|
295
316
|
*/
|
|
296
317
|
owner: string;
|
|
318
|
+
/**
|
|
319
|
+
* The url of the assistant resource.
|
|
320
|
+
*/
|
|
321
|
+
url: string;
|
|
297
322
|
/**
|
|
298
323
|
* The personality prompt to be used for assistant.
|
|
299
324
|
*/
|
|
@@ -348,10 +373,22 @@ export declare class AssistantInstance {
|
|
|
348
373
|
* @returns Resolves to processed AssistantInstance
|
|
349
374
|
*/
|
|
350
375
|
update(params: AssistantsV1ServiceUpdateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
376
|
+
/**
|
|
377
|
+
* Access the assistantsKnowledge.
|
|
378
|
+
*/
|
|
379
|
+
assistantsKnowledge(): AssistantsKnowledgeListInstance;
|
|
380
|
+
/**
|
|
381
|
+
* Access the assistantsTools.
|
|
382
|
+
*/
|
|
383
|
+
assistantsTools(): AssistantsToolListInstance;
|
|
351
384
|
/**
|
|
352
385
|
* Access the feedbacks.
|
|
353
386
|
*/
|
|
354
387
|
feedbacks(): FeedbackListInstance;
|
|
388
|
+
/**
|
|
389
|
+
* Access the messages.
|
|
390
|
+
*/
|
|
391
|
+
messages(): MessageListInstance;
|
|
355
392
|
/**
|
|
356
393
|
* Provide a user-friendly representation
|
|
357
394
|
*
|
|
@@ -364,6 +401,7 @@ export declare class AssistantInstance {
|
|
|
364
401
|
model: string;
|
|
365
402
|
name: string;
|
|
366
403
|
owner: string;
|
|
404
|
+
url: string;
|
|
367
405
|
personalityPrompt: string;
|
|
368
406
|
dateCreated: Date;
|
|
369
407
|
dateUpdated: Date;
|
|
@@ -22,7 +22,10 @@ const Page_1 = __importDefault(require("../../../base/Page"));
|
|
|
22
22
|
const deserialize = require("../../../base/deserialize");
|
|
23
23
|
const serialize = require("../../../base/serialize");
|
|
24
24
|
const utility_1 = require("../../../base/utility");
|
|
25
|
+
const assistantsKnowledge_1 = require("./assistant/assistantsKnowledge");
|
|
26
|
+
const assistantsTool_1 = require("./assistant/assistantsTool");
|
|
25
27
|
const feedback_1 = require("./assistant/feedback");
|
|
28
|
+
const message_1 = require("./assistant/message");
|
|
26
29
|
class AssistantsV1ServiceCreateAssistantRequest {
|
|
27
30
|
}
|
|
28
31
|
exports.AssistantsV1ServiceCreateAssistantRequest = AssistantsV1ServiceCreateAssistantRequest;
|
|
@@ -50,11 +53,28 @@ class AssistantContextImpl {
|
|
|
50
53
|
this._solution = { id };
|
|
51
54
|
this._uri = `/Assistants/${id}`;
|
|
52
55
|
}
|
|
56
|
+
get assistantsKnowledge() {
|
|
57
|
+
this._assistantsKnowledge =
|
|
58
|
+
this._assistantsKnowledge ||
|
|
59
|
+
(0, assistantsKnowledge_1.AssistantsKnowledgeListInstance)(this._version, this._solution.id);
|
|
60
|
+
return this._assistantsKnowledge;
|
|
61
|
+
}
|
|
62
|
+
get assistantsTools() {
|
|
63
|
+
this._assistantsTools =
|
|
64
|
+
this._assistantsTools ||
|
|
65
|
+
(0, assistantsTool_1.AssistantsToolListInstance)(this._version, this._solution.id);
|
|
66
|
+
return this._assistantsTools;
|
|
67
|
+
}
|
|
53
68
|
get feedbacks() {
|
|
54
69
|
this._feedbacks =
|
|
55
70
|
this._feedbacks || (0, feedback_1.FeedbackListInstance)(this._version, this._solution.id);
|
|
56
71
|
return this._feedbacks;
|
|
57
72
|
}
|
|
73
|
+
get messages() {
|
|
74
|
+
this._messages =
|
|
75
|
+
this._messages || (0, message_1.MessageListInstance)(this._version, this._solution.id);
|
|
76
|
+
return this._messages;
|
|
77
|
+
}
|
|
58
78
|
remove(callback) {
|
|
59
79
|
const instance = this;
|
|
60
80
|
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
@@ -119,6 +139,7 @@ class AssistantInstance {
|
|
|
119
139
|
this.model = payload.model;
|
|
120
140
|
this.name = payload.name;
|
|
121
141
|
this.owner = payload.owner;
|
|
142
|
+
this.url = payload.url;
|
|
122
143
|
this.personalityPrompt = payload.personality_prompt;
|
|
123
144
|
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
124
145
|
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
@@ -155,12 +176,30 @@ class AssistantInstance {
|
|
|
155
176
|
update(params, callback) {
|
|
156
177
|
return this._proxy.update(params, callback);
|
|
157
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Access the assistantsKnowledge.
|
|
181
|
+
*/
|
|
182
|
+
assistantsKnowledge() {
|
|
183
|
+
return this._proxy.assistantsKnowledge;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Access the assistantsTools.
|
|
187
|
+
*/
|
|
188
|
+
assistantsTools() {
|
|
189
|
+
return this._proxy.assistantsTools;
|
|
190
|
+
}
|
|
158
191
|
/**
|
|
159
192
|
* Access the feedbacks.
|
|
160
193
|
*/
|
|
161
194
|
feedbacks() {
|
|
162
195
|
return this._proxy.feedbacks;
|
|
163
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Access the messages.
|
|
199
|
+
*/
|
|
200
|
+
messages() {
|
|
201
|
+
return this._proxy.messages;
|
|
202
|
+
}
|
|
164
203
|
/**
|
|
165
204
|
* Provide a user-friendly representation
|
|
166
205
|
*
|
|
@@ -174,6 +213,7 @@ class AssistantInstance {
|
|
|
174
213
|
model: this.model,
|
|
175
214
|
name: this.name,
|
|
176
215
|
owner: this.owner,
|
|
216
|
+
url: this.url,
|
|
177
217
|
personalityPrompt: this.personalityPrompt,
|
|
178
218
|
dateCreated: this.dateCreated,
|
|
179
219
|
dateUpdated: this.dateUpdated,
|