twilio 5.3.0 → 5.3.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.
Files changed (34) hide show
  1. package/lib/rest/Assistants.d.ts +4 -0
  2. package/lib/rest/Assistants.js +8 -0
  3. package/lib/rest/AssistantsBase.d.ts +13 -0
  4. package/lib/rest/AssistantsBase.js +31 -0
  5. package/lib/rest/Twilio.d.ts +5 -0
  6. package/lib/rest/Twilio.js +6 -0
  7. package/lib/rest/assistants/V1.d.ts +35 -0
  8. package/lib/rest/assistants/V1.js +60 -0
  9. package/lib/rest/assistants/v1/assistant/feedback.d.ts +231 -0
  10. package/lib/rest/assistants/v1/assistant/feedback.js +161 -0
  11. package/lib/rest/assistants/v1/assistant.d.ts +466 -0
  12. package/lib/rest/assistants/v1/assistant.js +284 -0
  13. package/lib/rest/assistants/v1/knowledge/chunk.d.ts +167 -0
  14. package/lib/rest/assistants/v1/knowledge/chunk.js +130 -0
  15. package/lib/rest/assistants/v1/knowledge.d.ts +385 -0
  16. package/lib/rest/assistants/v1/knowledge.js +273 -0
  17. package/lib/rest/assistants/v1/policy.d.ts +202 -0
  18. package/lib/rest/assistants/v1/policy.js +138 -0
  19. package/lib/rest/assistants/v1/session/message.d.ts +197 -0
  20. package/lib/rest/assistants/v1/session/message.js +140 -0
  21. package/lib/rest/assistants/v1/session.d.ts +231 -0
  22. package/lib/rest/assistants/v1/session.js +194 -0
  23. package/lib/rest/assistants/v1/tool.d.ts +378 -0
  24. package/lib/rest/assistants/v1/tool.js +242 -0
  25. package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
  26. package/lib/rest/content/v1/content/approvalFetch.js +14 -14
  27. package/lib/rest/intelligence/v2/operatorType.d.ts +1 -1
  28. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +12 -18
  29. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +3 -6
  30. package/lib/rest/marketplace/v1/moduleDataManagement.d.ts +14 -6
  31. package/lib/rest/marketplace/v1/moduleDataManagement.js +4 -0
  32. package/lib/rest/numbers/v2/bundleClone.d.ts +1 -1
  33. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +4 -4
  34. package/package.json +1 -1
@@ -0,0 +1,466 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import Page, { TwilioResponsePayload } from "../../../base/Page";
4
+ import Response from "../../../http/response";
5
+ import V1 from "../V1";
6
+ import { FeedbackListInstance } from "./assistant/feedback";
7
+ export declare class AssistantsV1ServiceCreateAssistantRequest {
8
+ "customerAi"?: AssistantsV1ServiceCustomerAi;
9
+ /**
10
+ * The name of the assistant.
11
+ */
12
+ "name": string;
13
+ /**
14
+ * The owner/company of the assistant.
15
+ */
16
+ "owner"?: string;
17
+ /**
18
+ * The personality prompt to be used for assistant.
19
+ */
20
+ "personalityPrompt"?: string;
21
+ "segmentCredential"?: AssistantsV1ServiceSegmentCredential;
22
+ }
23
+ export declare class AssistantsV1ServiceCustomerAi {
24
+ /**
25
+ * True if the perception engine is enabled.
26
+ */
27
+ "perceptionEngineEnabled": boolean;
28
+ /**
29
+ * True if the personalization engine is enabled.
30
+ */
31
+ "personalizationEngineEnabled": boolean;
32
+ }
33
+ export declare class AssistantsV1ServiceKnowledge {
34
+ /**
35
+ * The type of knowledge source.
36
+ */
37
+ "description"?: string;
38
+ /**
39
+ * The description of knowledge.
40
+ */
41
+ "id"?: string;
42
+ /**
43
+ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
44
+ */
45
+ "accountSid"?: string;
46
+ /**
47
+ * The details of the knowledge source based on the type.
48
+ */
49
+ "knowledgeSourceDetails"?: Record<string, object>;
50
+ /**
51
+ * The name of the knowledge source.
52
+ */
53
+ "name"?: string;
54
+ /**
55
+ * The status of processing the knowledge source (\'QUEUED\', \'PROCESSING\', \'COMPLETED\', \'FAILED\')
56
+ */
57
+ "status"?: string;
58
+ /**
59
+ * The type of knowledge source (\'Web\', \'Database\', \'Text\', \'File\')
60
+ */
61
+ "type"?: string;
62
+ /**
63
+ * The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
64
+ */
65
+ "dateCreated"?: Date;
66
+ /**
67
+ * The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
68
+ */
69
+ "dateUpdated"?: Date;
70
+ }
71
+ export declare class AssistantsV1ServiceSegmentCredential {
72
+ /**
73
+ * The profile API key.
74
+ */
75
+ "profileApiKey"?: string;
76
+ /**
77
+ * The space ID.
78
+ */
79
+ "spaceId"?: string;
80
+ /**
81
+ * The write key.
82
+ */
83
+ "writeKey"?: string;
84
+ }
85
+ export declare class AssistantsV1ServiceTool {
86
+ /**
87
+ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource.
88
+ */
89
+ "accountSid"?: string;
90
+ /**
91
+ * The description of the tool.
92
+ */
93
+ "description": string;
94
+ /**
95
+ * True if the tool is enabled.
96
+ */
97
+ "enabled": boolean;
98
+ /**
99
+ * The tool ID.
100
+ */
101
+ "id": string;
102
+ /**
103
+ * The metadata related to method, url, input_schema to used with the Tool.
104
+ */
105
+ "meta": Record<string, object>;
106
+ /**
107
+ * The name of the tool.
108
+ */
109
+ "name": string;
110
+ /**
111
+ * The authentication requirement for the tool.
112
+ */
113
+ "requiresAuth": boolean;
114
+ /**
115
+ * The type of the tool. (\'WEBHOOK\')
116
+ */
117
+ "type": string;
118
+ /**
119
+ * The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
120
+ */
121
+ "dateCreated": Date;
122
+ /**
123
+ * The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
124
+ */
125
+ "dateUpdated": Date;
126
+ }
127
+ export declare class AssistantsV1ServiceUpdateAssistantRequest {
128
+ "customerAi"?: AssistantsV1ServiceCustomerAi;
129
+ /**
130
+ * The name of the assistant.
131
+ */
132
+ "name"?: string;
133
+ /**
134
+ * The owner/company of the assistant.
135
+ */
136
+ "owner"?: string;
137
+ /**
138
+ * The personality prompt to be used for assistant.
139
+ */
140
+ "personalityPrompt"?: string;
141
+ "segmentCredential"?: AssistantsV1ServiceSegmentCredential;
142
+ }
143
+ /**
144
+ * Options to pass to update a AssistantInstance
145
+ */
146
+ export interface AssistantContextUpdateOptions {
147
+ /** */
148
+ assistantsV1ServiceUpdateAssistantRequest?: AssistantsV1ServiceUpdateAssistantRequest;
149
+ }
150
+ /**
151
+ * Options to pass to create a AssistantInstance
152
+ */
153
+ export interface AssistantListInstanceCreateOptions {
154
+ /** */
155
+ assistantsV1ServiceCreateAssistantRequest: AssistantsV1ServiceCreateAssistantRequest;
156
+ }
157
+ /**
158
+ * Options to pass to each
159
+ */
160
+ export interface AssistantListInstanceEachOptions {
161
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
162
+ pageSize?: number;
163
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
164
+ callback?: (item: AssistantInstance, done: (err?: Error) => void) => void;
165
+ /** Function to be called upon completion of streaming */
166
+ done?: Function;
167
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
168
+ limit?: number;
169
+ }
170
+ /**
171
+ * Options to pass to list
172
+ */
173
+ export interface AssistantListInstanceOptions {
174
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
175
+ pageSize?: number;
176
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
177
+ limit?: number;
178
+ }
179
+ /**
180
+ * Options to pass to page
181
+ */
182
+ export interface AssistantListInstancePageOptions {
183
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
184
+ pageSize?: number;
185
+ /** Page Number, this value is simply for client state */
186
+ pageNumber?: number;
187
+ /** PageToken provided by the API */
188
+ pageToken?: string;
189
+ }
190
+ export interface AssistantContext {
191
+ feedbacks: FeedbackListInstance;
192
+ /**
193
+ * Remove a AssistantInstance
194
+ *
195
+ * @param callback - Callback to handle processed record
196
+ *
197
+ * @returns Resolves to processed boolean
198
+ */
199
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
200
+ /**
201
+ * Fetch a AssistantInstance
202
+ *
203
+ * @param callback - Callback to handle processed record
204
+ *
205
+ * @returns Resolves to processed AssistantInstance
206
+ */
207
+ fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
208
+ /**
209
+ * Update a AssistantInstance
210
+ *
211
+ * @param callback - Callback to handle processed record
212
+ *
213
+ * @returns Resolves to processed AssistantInstance
214
+ */
215
+ update(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
216
+ /**
217
+ * Update a AssistantInstance
218
+ *
219
+ * @param params - Body for request
220
+ * @param callback - Callback to handle processed record
221
+ *
222
+ * @returns Resolves to processed AssistantInstance
223
+ */
224
+ update(params: AssistantsV1ServiceUpdateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
225
+ /**
226
+ * Provide a user-friendly representation
227
+ */
228
+ toJSON(): any;
229
+ [inspect.custom](_depth: any, options: InspectOptions): any;
230
+ }
231
+ export interface AssistantContextSolution {
232
+ id: string;
233
+ }
234
+ export declare class AssistantContextImpl implements AssistantContext {
235
+ protected _version: V1;
236
+ protected _solution: AssistantContextSolution;
237
+ protected _uri: string;
238
+ protected _feedbacks?: FeedbackListInstance;
239
+ constructor(_version: V1, id: string);
240
+ get feedbacks(): FeedbackListInstance;
241
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
242
+ fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
243
+ update(params?: AssistantsV1ServiceUpdateAssistantRequest | ((error: Error | null, item?: AssistantInstance) => any), callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
244
+ /**
245
+ * Provide a user-friendly representation
246
+ *
247
+ * @returns Object
248
+ */
249
+ toJSON(): AssistantContextSolution;
250
+ [inspect.custom](_depth: any, options: InspectOptions): string;
251
+ }
252
+ interface AssistantPayload extends TwilioResponsePayload {
253
+ assistants: AssistantResource[];
254
+ }
255
+ interface AssistantResource {
256
+ account_sid: string;
257
+ customer_ai: Record<string, object>;
258
+ id: string;
259
+ model: string;
260
+ name: string;
261
+ owner: string;
262
+ personality_prompt: string;
263
+ date_created: Date;
264
+ date_updated: Date;
265
+ knowledge: Array<AssistantsV1ServiceKnowledge>;
266
+ tools: Array<AssistantsV1ServiceTool>;
267
+ }
268
+ export declare class AssistantInstance {
269
+ protected _version: V1;
270
+ protected _solution: AssistantContextSolution;
271
+ protected _context?: AssistantContext;
272
+ constructor(_version: V1, payload: AssistantResource, id?: string);
273
+ /**
274
+ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource.
275
+ */
276
+ accountSid: string;
277
+ /**
278
+ * The Personalization and Perception Engine settings.
279
+ */
280
+ customerAi: Record<string, object>;
281
+ /**
282
+ * The Assistant ID.
283
+ */
284
+ id: string;
285
+ /**
286
+ * The default model used by the assistant.
287
+ */
288
+ model: string;
289
+ /**
290
+ * The name of the assistant.
291
+ */
292
+ name: string;
293
+ /**
294
+ * The owner/company of the assistant.
295
+ */
296
+ owner: string;
297
+ /**
298
+ * The personality prompt to be used for assistant.
299
+ */
300
+ personalityPrompt: string;
301
+ /**
302
+ * The date and time in GMT when the Assistant was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
303
+ */
304
+ dateCreated: Date;
305
+ /**
306
+ * The date and time in GMT when the Assistant was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
307
+ */
308
+ dateUpdated: Date;
309
+ /**
310
+ * The list of knowledge sources associated with the assistant.
311
+ */
312
+ knowledge: Array<AssistantsV1ServiceKnowledge>;
313
+ /**
314
+ * The list of tools associated with the assistant.
315
+ */
316
+ tools: Array<AssistantsV1ServiceTool>;
317
+ private get _proxy();
318
+ /**
319
+ * Remove a AssistantInstance
320
+ *
321
+ * @param callback - Callback to handle processed record
322
+ *
323
+ * @returns Resolves to processed boolean
324
+ */
325
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
326
+ /**
327
+ * Fetch a AssistantInstance
328
+ *
329
+ * @param callback - Callback to handle processed record
330
+ *
331
+ * @returns Resolves to processed AssistantInstance
332
+ */
333
+ fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
334
+ /**
335
+ * Update a AssistantInstance
336
+ *
337
+ * @param callback - Callback to handle processed record
338
+ *
339
+ * @returns Resolves to processed AssistantInstance
340
+ */
341
+ update(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
342
+ /**
343
+ * Update a AssistantInstance
344
+ *
345
+ * @param params - Body for request
346
+ * @param callback - Callback to handle processed record
347
+ *
348
+ * @returns Resolves to processed AssistantInstance
349
+ */
350
+ update(params: AssistantsV1ServiceUpdateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
351
+ /**
352
+ * Access the feedbacks.
353
+ */
354
+ feedbacks(): FeedbackListInstance;
355
+ /**
356
+ * Provide a user-friendly representation
357
+ *
358
+ * @returns Object
359
+ */
360
+ toJSON(): {
361
+ accountSid: string;
362
+ customerAi: Record<string, object>;
363
+ id: string;
364
+ model: string;
365
+ name: string;
366
+ owner: string;
367
+ personalityPrompt: string;
368
+ dateCreated: Date;
369
+ dateUpdated: Date;
370
+ knowledge: AssistantsV1ServiceKnowledge[];
371
+ tools: AssistantsV1ServiceTool[];
372
+ };
373
+ [inspect.custom](_depth: any, options: InspectOptions): string;
374
+ }
375
+ export interface AssistantSolution {
376
+ }
377
+ export interface AssistantListInstance {
378
+ _version: V1;
379
+ _solution: AssistantSolution;
380
+ _uri: string;
381
+ (id: string): AssistantContext;
382
+ get(id: string): AssistantContext;
383
+ /**
384
+ * Create a AssistantInstance
385
+ *
386
+ * @param params - Body for request
387
+ * @param callback - Callback to handle processed record
388
+ *
389
+ * @returns Resolves to processed AssistantInstance
390
+ */
391
+ create(params: AssistantsV1ServiceCreateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
392
+ /**
393
+ * Streams AssistantInstance records from the API.
394
+ *
395
+ * This operation lazily loads records as efficiently as possible until the limit
396
+ * is reached.
397
+ *
398
+ * The results are passed into the callback function, so this operation is memory
399
+ * efficient.
400
+ *
401
+ * If a function is passed as the first argument, it will be used as the callback
402
+ * function.
403
+ *
404
+ * @param { AssistantListInstanceEachOptions } [params] - Options for request
405
+ * @param { function } [callback] - Function to process each record
406
+ */
407
+ each(callback?: (item: AssistantInstance, done: (err?: Error) => void) => void): void;
408
+ each(params: AssistantListInstanceEachOptions, callback?: (item: AssistantInstance, done: (err?: Error) => void) => void): void;
409
+ /**
410
+ * Retrieve a single target page of AssistantInstance records from the API.
411
+ *
412
+ * The request is executed immediately.
413
+ *
414
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
415
+ * @param { function } [callback] - Callback to handle list of records
416
+ */
417
+ getPage(targetUrl: string, callback?: (error: Error | null, items: AssistantPage) => any): Promise<AssistantPage>;
418
+ /**
419
+ * Lists AssistantInstance records from the API as a list.
420
+ *
421
+ * If a function is passed as the first argument, it will be used as the callback
422
+ * function.
423
+ *
424
+ * @param { AssistantListInstanceOptions } [params] - Options for request
425
+ * @param { function } [callback] - Callback to handle list of records
426
+ */
427
+ list(callback?: (error: Error | null, items: AssistantInstance[]) => any): Promise<AssistantInstance[]>;
428
+ list(params: AssistantListInstanceOptions, callback?: (error: Error | null, items: AssistantInstance[]) => any): Promise<AssistantInstance[]>;
429
+ /**
430
+ * Retrieve a single page of AssistantInstance records from the API.
431
+ *
432
+ * The request is executed immediately.
433
+ *
434
+ * If a function is passed as the first argument, it will be used as the callback
435
+ * function.
436
+ *
437
+ * @param { AssistantListInstancePageOptions } [params] - Options for request
438
+ * @param { function } [callback] - Callback to handle list of records
439
+ */
440
+ page(callback?: (error: Error | null, items: AssistantPage) => any): Promise<AssistantPage>;
441
+ page(params: AssistantListInstancePageOptions, callback?: (error: Error | null, items: AssistantPage) => any): Promise<AssistantPage>;
442
+ /**
443
+ * Provide a user-friendly representation
444
+ */
445
+ toJSON(): any;
446
+ [inspect.custom](_depth: any, options: InspectOptions): any;
447
+ }
448
+ export declare function AssistantListInstance(version: V1): AssistantListInstance;
449
+ export declare class AssistantPage extends Page<V1, AssistantPayload, AssistantResource, AssistantInstance> {
450
+ /**
451
+ * Initialize the AssistantPage
452
+ *
453
+ * @param version - Version of the resource
454
+ * @param response - Response from the API
455
+ * @param solution - Path solution
456
+ */
457
+ constructor(version: V1, response: Response<string>, solution: AssistantSolution);
458
+ /**
459
+ * Build an instance of AssistantInstance
460
+ *
461
+ * @param payload - Payload response from the API
462
+ */
463
+ getInstance(payload: AssistantResource): AssistantInstance;
464
+ [inspect.custom](depth: any, options: InspectOptions): string;
465
+ }
466
+ export {};