twilio 5.5.1 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest/Knowledge.d.ts +4 -0
- package/lib/rest/Knowledge.js +8 -0
- package/lib/rest/KnowledgeBase.d.ts +13 -0
- package/lib/rest/KnowledgeBase.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/api/v2010/account/call.d.ts +1 -1
- package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -2
- package/lib/rest/flexApi/v1/interaction.d.ts +47 -0
- package/lib/rest/flexApi/v1/interaction.js +32 -0
- package/lib/rest/knowledge/V1.d.ts +15 -0
- package/lib/rest/knowledge/V1.js +36 -0
- package/lib/rest/knowledge/v1/knowledge/chunk.d.ts +167 -0
- package/lib/rest/knowledge/v1/knowledge/chunk.js +131 -0
- package/lib/rest/knowledge/v1/knowledge/knowledgeStatus.d.ts +101 -0
- package/lib/rest/knowledge/v1/knowledge/knowledgeStatus.js +118 -0
- package/lib/rest/knowledge/v1/knowledge.d.ts +406 -0
- package/lib/rest/knowledge/v1/knowledge.js +300 -0
- package/lib/rest/lookups/v1/phoneNumber.d.ts +1 -1
- package/lib/rest/messaging/V2.d.ts +15 -0
- package/lib/rest/messaging/V2.js +37 -0
- package/lib/rest/messaging/v2/channelsSender.d.ts +453 -0
- package/lib/rest/messaging/v2/channelsSender.js +301 -0
- package/lib/rest/monitor/v1/event.d.ts +1 -1
- package/lib/rest/numbers/V1.d.ts +5 -5
- package/lib/rest/numbers/V1.js +8 -6
- package/lib/rest/numbers/v1/{webhook.d.ts → portingWebhookConfigurationFetch.d.ts} +10 -10
- package/lib/rest/numbers/v1/{webhook.js → portingWebhookConfigurationFetch.js} +6 -6
- package/lib/rest/serverless/v1/service/build.d.ts +1 -1
- package/lib/rest/studio/v1/flow/engagement/step.d.ts +6 -0
- package/lib/rest/studio/v1/flow/engagement/step.js +2 -0
- package/lib/rest/studio/v1/flow/execution/executionStep.d.ts +6 -0
- package/lib/rest/studio/v1/flow/execution/executionStep.js +2 -0
- package/lib/rest/studio/v2/flow/execution/executionStep.d.ts +6 -0
- package/lib/rest/studio/v2/flow/execution/executionStep.js +2 -0
- package/lib/rest/video/v1/room.d.ts +4 -0
- package/lib/rest/video/v1/room.js +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const KnowledgeBase_1 = __importDefault(require("./KnowledgeBase"));
|
|
6
|
+
class Knowledge extends KnowledgeBase_1.default {
|
|
7
|
+
}
|
|
8
|
+
module.exports = Knowledge;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Domain from "../base/Domain";
|
|
2
|
+
import V1 from "./knowledge/V1";
|
|
3
|
+
declare class KnowledgeBase extends Domain {
|
|
4
|
+
_v1?: V1;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize knowledge domain
|
|
7
|
+
*
|
|
8
|
+
* @param twilio - The twilio client
|
|
9
|
+
*/
|
|
10
|
+
constructor(twilio: any);
|
|
11
|
+
get v1(): V1;
|
|
12
|
+
}
|
|
13
|
+
export = KnowledgeBase;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
const Domain_1 = __importDefault(require("../base/Domain"));
|
|
16
|
+
const V1_1 = __importDefault(require("./knowledge/V1"));
|
|
17
|
+
class KnowledgeBase extends Domain_1.default {
|
|
18
|
+
/**
|
|
19
|
+
* Initialize knowledge domain
|
|
20
|
+
*
|
|
21
|
+
* @param twilio - The twilio client
|
|
22
|
+
*/
|
|
23
|
+
constructor(twilio) {
|
|
24
|
+
super(twilio, "https://knowledge.twilio.com");
|
|
25
|
+
}
|
|
26
|
+
get v1() {
|
|
27
|
+
this._v1 = this._v1 || new V1_1.default(this);
|
|
28
|
+
return this._v1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
module.exports = KnowledgeBase;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Domain from "../base/Domain";
|
|
2
2
|
import V1 from "./messaging/V1";
|
|
3
|
+
import V2 from "./messaging/V2";
|
|
3
4
|
declare class MessagingBase extends Domain {
|
|
4
5
|
_v1?: V1;
|
|
6
|
+
_v2?: V2;
|
|
5
7
|
/**
|
|
6
8
|
* Initialize messaging domain
|
|
7
9
|
*
|
|
@@ -9,5 +11,6 @@ declare class MessagingBase extends Domain {
|
|
|
9
11
|
*/
|
|
10
12
|
constructor(twilio: any);
|
|
11
13
|
get v1(): V1;
|
|
14
|
+
get v2(): V2;
|
|
12
15
|
}
|
|
13
16
|
export = MessagingBase;
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
};
|
|
15
15
|
const Domain_1 = __importDefault(require("../base/Domain"));
|
|
16
16
|
const V1_1 = __importDefault(require("./messaging/V1"));
|
|
17
|
+
const V2_1 = __importDefault(require("./messaging/V2"));
|
|
17
18
|
class MessagingBase extends Domain_1.default {
|
|
18
19
|
/**
|
|
19
20
|
* Initialize messaging domain
|
|
@@ -27,5 +28,9 @@ class MessagingBase extends Domain_1.default {
|
|
|
27
28
|
this._v1 = this._v1 || new V1_1.default(this);
|
|
28
29
|
return this._v1;
|
|
29
30
|
}
|
|
31
|
+
get v2() {
|
|
32
|
+
this._v2 = this._v2 || new V2_1.default(this);
|
|
33
|
+
return this._v2;
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
module.exports = MessagingBase;
|
package/lib/rest/Twilio.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import Iam from "./Iam";
|
|
|
14
14
|
import Insights from "./Insights";
|
|
15
15
|
import Intelligence from "./Intelligence";
|
|
16
16
|
import IpMessaging from "./IpMessaging";
|
|
17
|
+
import Knowledge from "./Knowledge";
|
|
17
18
|
import Lookups from "./Lookups";
|
|
18
19
|
import Marketplace from "./Marketplace";
|
|
19
20
|
import Messaging from "./Messaging";
|
|
@@ -95,6 +96,8 @@ declare class Twilio extends Client {
|
|
|
95
96
|
_intelligence?: Intelligence;
|
|
96
97
|
/** (Twilio.IpMessaging) - ipMessaging domain */
|
|
97
98
|
_ipMessaging?: IpMessaging;
|
|
99
|
+
/** (Twilio.Knowledge) - knowledge domain */
|
|
100
|
+
_knowledge?: Knowledge;
|
|
98
101
|
/** (Twilio.Lookups) - lookups domain */
|
|
99
102
|
_lookups?: Lookups;
|
|
100
103
|
/** (Twilio.Marketplace) - marketplace domain */
|
|
@@ -183,6 +186,8 @@ declare class Twilio extends Client {
|
|
|
183
186
|
get intelligence(): Intelligence;
|
|
184
187
|
/** Getter for (Twilio.IpMessaging) domain */
|
|
185
188
|
get ipMessaging(): IpMessaging;
|
|
189
|
+
/** Getter for (Twilio.Knowledge) domain */
|
|
190
|
+
get knowledge(): Knowledge;
|
|
186
191
|
/** Getter for (Twilio.Lookups) domain */
|
|
187
192
|
get lookups(): Lookups;
|
|
188
193
|
/** Getter for (Twilio.Marketplace) domain */
|
package/lib/rest/Twilio.js
CHANGED
|
@@ -47,6 +47,7 @@ class Twilio extends BaseTwilio_1.Client {
|
|
|
47
47
|
this.insights;
|
|
48
48
|
this.intelligence;
|
|
49
49
|
this.ipMessaging;
|
|
50
|
+
this.knowledge;
|
|
50
51
|
this.lookups;
|
|
51
52
|
this.marketplace;
|
|
52
53
|
this.messaging;
|
|
@@ -140,6 +141,10 @@ class Twilio extends BaseTwilio_1.Client {
|
|
|
140
141
|
return (this._ipMessaging ??
|
|
141
142
|
(this._ipMessaging = new (require("./IpMessaging"))(this)));
|
|
142
143
|
}
|
|
144
|
+
/** Getter for (Twilio.Knowledge) domain */
|
|
145
|
+
get knowledge() {
|
|
146
|
+
return (this._knowledge ?? (this._knowledge = new (require("./Knowledge"))(this)));
|
|
147
|
+
}
|
|
143
148
|
/** Getter for (Twilio.Lookups) domain */
|
|
144
149
|
get lookups() {
|
|
145
150
|
return this._lookups ?? (this._lookups = new (require("./Lookups"))(this));
|
|
@@ -61,7 +61,7 @@ export interface CallListInstanceCreateOptions {
|
|
|
61
61
|
statusCallbackEvent?: Array<string>;
|
|
62
62
|
/** The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */
|
|
63
63
|
statusCallbackMethod?: string;
|
|
64
|
-
/**
|
|
64
|
+
/** The string of keys to dial after connecting to the number, with a maximum length of 32 digits. Valid digits in the string include any digit (`0`-`9`), \\\'`A`\\\', \\\'`B`\\\', \\\'`C`\\\', \\\'`D`\\\', \\\'`#`\\\', and \\\'`*`\\\'. You can also use \\\'`w`\\\' to insert a half-second pause and \\\'`W`\\\' to insert a one-second pause. For example, to pause for one second after connecting and then dial extension 1234 followed by the # key, set this parameter to `W1234#`. Be sure to URL-encode this string because the \\\'`#`\\\' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. */
|
|
65
65
|
sendDigits?: string;
|
|
66
66
|
/** The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. */
|
|
67
67
|
timeout?: number;
|
|
@@ -23,7 +23,7 @@ export interface ParticipantContextUpdateOptions {
|
|
|
23
23
|
announceUrl?: string;
|
|
24
24
|
/** The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. */
|
|
25
25
|
announceMethod?: string;
|
|
26
|
-
/** The URL
|
|
26
|
+
/** The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `\\\'\\\'`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [<Conference> TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). */
|
|
27
27
|
waitUrl?: string;
|
|
28
28
|
/** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */
|
|
29
29
|
waitMethod?: string;
|
|
@@ -64,7 +64,7 @@ export interface ParticipantListInstanceCreateOptions {
|
|
|
64
64
|
startConferenceOnEnter?: boolean;
|
|
65
65
|
/** Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. */
|
|
66
66
|
endConferenceOnExit?: boolean;
|
|
67
|
-
/** The URL
|
|
67
|
+
/** The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `\\\'\\\'`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [<Conference> TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). */
|
|
68
68
|
waitUrl?: string;
|
|
69
69
|
/** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */
|
|
70
70
|
waitMethod?: string;
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
import { inspect, InspectOptions } from "util";
|
|
3
3
|
import V1 from "../V1";
|
|
4
4
|
import { InteractionChannelListInstance } from "./interaction/interactionChannel";
|
|
5
|
+
/**
|
|
6
|
+
* Options to pass to update a InteractionInstance
|
|
7
|
+
*/
|
|
8
|
+
export interface InteractionContextUpdateOptions {
|
|
9
|
+
/** The unique identifier for Interaction level webhook */
|
|
10
|
+
webhookTtid?: string;
|
|
11
|
+
}
|
|
5
12
|
/**
|
|
6
13
|
* Options to pass to create a InteractionInstance
|
|
7
14
|
*/
|
|
@@ -12,6 +19,8 @@ export interface InteractionListInstanceCreateOptions {
|
|
|
12
19
|
routing?: object;
|
|
13
20
|
/** The Interaction context sid is used for adding a context lookup sid */
|
|
14
21
|
interactionContextSid?: string;
|
|
22
|
+
/** The unique identifier for Interaction level webhook */
|
|
23
|
+
webhookTtid?: string;
|
|
15
24
|
}
|
|
16
25
|
export interface InteractionContext {
|
|
17
26
|
channels: InteractionChannelListInstance;
|
|
@@ -23,6 +32,23 @@ export interface InteractionContext {
|
|
|
23
32
|
* @returns Resolves to processed InteractionInstance
|
|
24
33
|
*/
|
|
25
34
|
fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
35
|
+
/**
|
|
36
|
+
* Update a InteractionInstance
|
|
37
|
+
*
|
|
38
|
+
* @param callback - Callback to handle processed record
|
|
39
|
+
*
|
|
40
|
+
* @returns Resolves to processed InteractionInstance
|
|
41
|
+
*/
|
|
42
|
+
update(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a InteractionInstance
|
|
45
|
+
*
|
|
46
|
+
* @param params - Parameter for request
|
|
47
|
+
* @param callback - Callback to handle processed record
|
|
48
|
+
*
|
|
49
|
+
* @returns Resolves to processed InteractionInstance
|
|
50
|
+
*/
|
|
51
|
+
update(params: InteractionContextUpdateOptions, callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
26
52
|
/**
|
|
27
53
|
* Provide a user-friendly representation
|
|
28
54
|
*/
|
|
@@ -40,6 +66,7 @@ export declare class InteractionContextImpl implements InteractionContext {
|
|
|
40
66
|
constructor(_version: V1, sid: string);
|
|
41
67
|
get channels(): InteractionChannelListInstance;
|
|
42
68
|
fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
69
|
+
update(params?: InteractionContextUpdateOptions | ((error: Error | null, item?: InteractionInstance) => any), callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
43
70
|
/**
|
|
44
71
|
* Provide a user-friendly representation
|
|
45
72
|
*
|
|
@@ -55,6 +82,7 @@ interface InteractionResource {
|
|
|
55
82
|
url: string;
|
|
56
83
|
links: Record<string, string>;
|
|
57
84
|
interaction_context_sid: string;
|
|
85
|
+
webhook_ttid: string;
|
|
58
86
|
}
|
|
59
87
|
export declare class InteractionInstance {
|
|
60
88
|
protected _version: V1;
|
|
@@ -76,6 +104,7 @@ export declare class InteractionInstance {
|
|
|
76
104
|
url: string;
|
|
77
105
|
links: Record<string, string>;
|
|
78
106
|
interactionContextSid: string;
|
|
107
|
+
webhookTtid: string;
|
|
79
108
|
private get _proxy();
|
|
80
109
|
/**
|
|
81
110
|
* Fetch a InteractionInstance
|
|
@@ -85,6 +114,23 @@ export declare class InteractionInstance {
|
|
|
85
114
|
* @returns Resolves to processed InteractionInstance
|
|
86
115
|
*/
|
|
87
116
|
fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
117
|
+
/**
|
|
118
|
+
* Update a InteractionInstance
|
|
119
|
+
*
|
|
120
|
+
* @param callback - Callback to handle processed record
|
|
121
|
+
*
|
|
122
|
+
* @returns Resolves to processed InteractionInstance
|
|
123
|
+
*/
|
|
124
|
+
update(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
125
|
+
/**
|
|
126
|
+
* Update a InteractionInstance
|
|
127
|
+
*
|
|
128
|
+
* @param params - Parameter for request
|
|
129
|
+
* @param callback - Callback to handle processed record
|
|
130
|
+
*
|
|
131
|
+
* @returns Resolves to processed InteractionInstance
|
|
132
|
+
*/
|
|
133
|
+
update(params: InteractionContextUpdateOptions, callback?: (error: Error | null, item?: InteractionInstance) => any): Promise<InteractionInstance>;
|
|
88
134
|
/**
|
|
89
135
|
* Access the channels.
|
|
90
136
|
*/
|
|
@@ -101,6 +147,7 @@ export declare class InteractionInstance {
|
|
|
101
147
|
url: string;
|
|
102
148
|
links: Record<string, string>;
|
|
103
149
|
interactionContextSid: string;
|
|
150
|
+
webhookTtid: string;
|
|
104
151
|
};
|
|
105
152
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
106
153
|
}
|
|
@@ -47,6 +47,31 @@ class InteractionContextImpl {
|
|
|
47
47
|
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
48
48
|
return operationPromise;
|
|
49
49
|
}
|
|
50
|
+
update(params, callback) {
|
|
51
|
+
if (params instanceof Function) {
|
|
52
|
+
callback = params;
|
|
53
|
+
params = {};
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
params = params || {};
|
|
57
|
+
}
|
|
58
|
+
let data = {};
|
|
59
|
+
if (params["webhookTtid"] !== undefined)
|
|
60
|
+
data["WebhookTtid"] = params["webhookTtid"];
|
|
61
|
+
const headers = {};
|
|
62
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
63
|
+
headers["Accept"] = "application/json";
|
|
64
|
+
const instance = this;
|
|
65
|
+
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
66
|
+
uri: instance._uri,
|
|
67
|
+
method: "post",
|
|
68
|
+
data,
|
|
69
|
+
headers,
|
|
70
|
+
});
|
|
71
|
+
operationPromise = operationPromise.then((payload) => new InteractionInstance(operationVersion, payload, instance._solution.sid));
|
|
72
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
73
|
+
return operationPromise;
|
|
74
|
+
}
|
|
50
75
|
/**
|
|
51
76
|
* Provide a user-friendly representation
|
|
52
77
|
*
|
|
@@ -69,6 +94,7 @@ class InteractionInstance {
|
|
|
69
94
|
this.url = payload.url;
|
|
70
95
|
this.links = payload.links;
|
|
71
96
|
this.interactionContextSid = payload.interaction_context_sid;
|
|
97
|
+
this.webhookTtid = payload.webhook_ttid;
|
|
72
98
|
this._solution = { sid: sid || this.sid };
|
|
73
99
|
}
|
|
74
100
|
get _proxy() {
|
|
@@ -87,6 +113,9 @@ class InteractionInstance {
|
|
|
87
113
|
fetch(callback) {
|
|
88
114
|
return this._proxy.fetch(callback);
|
|
89
115
|
}
|
|
116
|
+
update(params, callback) {
|
|
117
|
+
return this._proxy.update(params, callback);
|
|
118
|
+
}
|
|
90
119
|
/**
|
|
91
120
|
* Access the channels.
|
|
92
121
|
*/
|
|
@@ -106,6 +135,7 @@ class InteractionInstance {
|
|
|
106
135
|
url: this.url,
|
|
107
136
|
links: this.links,
|
|
108
137
|
interactionContextSid: this.interactionContextSid,
|
|
138
|
+
webhookTtid: this.webhookTtid,
|
|
109
139
|
};
|
|
110
140
|
}
|
|
111
141
|
[util_1.inspect.custom](_depth, options) {
|
|
@@ -134,6 +164,8 @@ function InteractionListInstance(version) {
|
|
|
134
164
|
data["Routing"] = serialize.object(params["routing"]);
|
|
135
165
|
if (params["interactionContextSid"] !== undefined)
|
|
136
166
|
data["InteractionContextSid"] = params["interactionContextSid"];
|
|
167
|
+
if (params["webhookTtid"] !== undefined)
|
|
168
|
+
data["WebhookTtid"] = params["webhookTtid"];
|
|
137
169
|
const headers = {};
|
|
138
170
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
139
171
|
headers["Accept"] = "application/json";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import KnowledgeBase from "../KnowledgeBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { KnowledgeListInstance } from "./v1/knowledge";
|
|
4
|
+
export default class V1 extends Version {
|
|
5
|
+
/**
|
|
6
|
+
* Initialize the V1 version of Knowledge
|
|
7
|
+
*
|
|
8
|
+
* @param domain - The Twilio (Twilio.Knowledge) domain
|
|
9
|
+
*/
|
|
10
|
+
constructor(domain: KnowledgeBase);
|
|
11
|
+
/** knowledge - { Twilio.Knowledge.V1.KnowledgeListInstance } resource */
|
|
12
|
+
protected _knowledge?: KnowledgeListInstance;
|
|
13
|
+
/** Getter for knowledge resource */
|
|
14
|
+
get knowledge(): KnowledgeListInstance;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Knowledge
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
|
+
const knowledge_1 = require("./v1/knowledge");
|
|
21
|
+
class V1 extends Version_1.default {
|
|
22
|
+
/**
|
|
23
|
+
* Initialize the V1 version of Knowledge
|
|
24
|
+
*
|
|
25
|
+
* @param domain - The Twilio (Twilio.Knowledge) domain
|
|
26
|
+
*/
|
|
27
|
+
constructor(domain) {
|
|
28
|
+
super(domain, "v1");
|
|
29
|
+
}
|
|
30
|
+
/** Getter for knowledge resource */
|
|
31
|
+
get knowledge() {
|
|
32
|
+
this._knowledge = this._knowledge || (0, knowledge_1.KnowledgeListInstance)(this);
|
|
33
|
+
return this._knowledge;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = V1;
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* Options to pass to each
|
|
8
|
+
*/
|
|
9
|
+
export interface ChunkListInstanceEachOptions {
|
|
10
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
13
|
+
callback?: (item: ChunkInstance, done: (err?: Error) => void) => void;
|
|
14
|
+
/** Function to be called upon completion of streaming */
|
|
15
|
+
done?: Function;
|
|
16
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options to pass to list
|
|
21
|
+
*/
|
|
22
|
+
export interface ChunkListInstanceOptions {
|
|
23
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
24
|
+
pageSize?: number;
|
|
25
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options to pass to page
|
|
30
|
+
*/
|
|
31
|
+
export interface ChunkListInstancePageOptions {
|
|
32
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
/** Page Number, this value is simply for client state */
|
|
35
|
+
pageNumber?: number;
|
|
36
|
+
/** PageToken provided by the API */
|
|
37
|
+
pageToken?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ChunkSolution {
|
|
40
|
+
id: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ChunkListInstance {
|
|
43
|
+
_version: V1;
|
|
44
|
+
_solution: ChunkSolution;
|
|
45
|
+
_uri: string;
|
|
46
|
+
/**
|
|
47
|
+
* Streams ChunkInstance records from the API.
|
|
48
|
+
*
|
|
49
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
50
|
+
* is reached.
|
|
51
|
+
*
|
|
52
|
+
* The results are passed into the callback function, so this operation is memory
|
|
53
|
+
* efficient.
|
|
54
|
+
*
|
|
55
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
56
|
+
* function.
|
|
57
|
+
*
|
|
58
|
+
* @param { ChunkListInstanceEachOptions } [params] - Options for request
|
|
59
|
+
* @param { function } [callback] - Function to process each record
|
|
60
|
+
*/
|
|
61
|
+
each(callback?: (item: ChunkInstance, done: (err?: Error) => void) => void): void;
|
|
62
|
+
each(params: ChunkListInstanceEachOptions, callback?: (item: ChunkInstance, done: (err?: Error) => void) => void): void;
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve a single target page of ChunkInstance records from the API.
|
|
65
|
+
*
|
|
66
|
+
* The request is executed immediately.
|
|
67
|
+
*
|
|
68
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
69
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
70
|
+
*/
|
|
71
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: ChunkPage) => any): Promise<ChunkPage>;
|
|
72
|
+
/**
|
|
73
|
+
* Lists ChunkInstance records from the API as a list.
|
|
74
|
+
*
|
|
75
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
76
|
+
* function.
|
|
77
|
+
*
|
|
78
|
+
* @param { ChunkListInstanceOptions } [params] - Options for request
|
|
79
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
80
|
+
*/
|
|
81
|
+
list(callback?: (error: Error | null, items: ChunkInstance[]) => any): Promise<ChunkInstance[]>;
|
|
82
|
+
list(params: ChunkListInstanceOptions, callback?: (error: Error | null, items: ChunkInstance[]) => any): Promise<ChunkInstance[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Retrieve a single page of ChunkInstance records from the API.
|
|
85
|
+
*
|
|
86
|
+
* The request is executed immediately.
|
|
87
|
+
*
|
|
88
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
89
|
+
* function.
|
|
90
|
+
*
|
|
91
|
+
* @param { ChunkListInstancePageOptions } [params] - Options for request
|
|
92
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
93
|
+
*/
|
|
94
|
+
page(callback?: (error: Error | null, items: ChunkPage) => any): Promise<ChunkPage>;
|
|
95
|
+
page(params: ChunkListInstancePageOptions, callback?: (error: Error | null, items: ChunkPage) => any): Promise<ChunkPage>;
|
|
96
|
+
/**
|
|
97
|
+
* Provide a user-friendly representation
|
|
98
|
+
*/
|
|
99
|
+
toJSON(): any;
|
|
100
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
101
|
+
}
|
|
102
|
+
export declare function ChunkListInstance(version: V1, id: string): ChunkListInstance;
|
|
103
|
+
interface ChunkPayload extends TwilioResponsePayload {
|
|
104
|
+
chunks: ChunkResource[];
|
|
105
|
+
}
|
|
106
|
+
interface ChunkResource {
|
|
107
|
+
account_sid: string;
|
|
108
|
+
content: string;
|
|
109
|
+
metadata: Record<string, object>;
|
|
110
|
+
date_created: Date;
|
|
111
|
+
date_updated: Date;
|
|
112
|
+
}
|
|
113
|
+
export declare class ChunkInstance {
|
|
114
|
+
protected _version: V1;
|
|
115
|
+
constructor(_version: V1, payload: ChunkResource, id: string);
|
|
116
|
+
/**
|
|
117
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
|
|
118
|
+
*/
|
|
119
|
+
accountSid: string;
|
|
120
|
+
/**
|
|
121
|
+
* The chunk content.
|
|
122
|
+
*/
|
|
123
|
+
content: string;
|
|
124
|
+
/**
|
|
125
|
+
* The metadata of the chunk.
|
|
126
|
+
*/
|
|
127
|
+
metadata: Record<string, object>;
|
|
128
|
+
/**
|
|
129
|
+
* The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
130
|
+
*/
|
|
131
|
+
dateCreated: Date;
|
|
132
|
+
/**
|
|
133
|
+
* The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
134
|
+
*/
|
|
135
|
+
dateUpdated: Date;
|
|
136
|
+
/**
|
|
137
|
+
* Provide a user-friendly representation
|
|
138
|
+
*
|
|
139
|
+
* @returns Object
|
|
140
|
+
*/
|
|
141
|
+
toJSON(): {
|
|
142
|
+
accountSid: string;
|
|
143
|
+
content: string;
|
|
144
|
+
metadata: Record<string, object>;
|
|
145
|
+
dateCreated: Date;
|
|
146
|
+
dateUpdated: Date;
|
|
147
|
+
};
|
|
148
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
149
|
+
}
|
|
150
|
+
export declare class ChunkPage extends Page<V1, ChunkPayload, ChunkResource, ChunkInstance> {
|
|
151
|
+
/**
|
|
152
|
+
* Initialize the ChunkPage
|
|
153
|
+
*
|
|
154
|
+
* @param version - Version of the resource
|
|
155
|
+
* @param response - Response from the API
|
|
156
|
+
* @param solution - Path solution
|
|
157
|
+
*/
|
|
158
|
+
constructor(version: V1, response: Response<string>, solution: ChunkSolution);
|
|
159
|
+
/**
|
|
160
|
+
* Build an instance of ChunkInstance
|
|
161
|
+
*
|
|
162
|
+
* @param payload - Payload response from the API
|
|
163
|
+
*/
|
|
164
|
+
getInstance(payload: ChunkResource): ChunkInstance;
|
|
165
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
166
|
+
}
|
|
167
|
+
export {};
|