-
Notifications
You must be signed in to change notification settings - Fork 1
/
compatibility-api.d.ts
347 lines (325 loc) · 8.18 KB
/
compatibility-api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
import { Twilio, TwimlInterface, JwtInterface } from './index'
import * as webhookTools from './lib/webhooks/webhooks'
import TwilioClient = require('./lib/rest/Twilio')
import RequestClient = require('./lib/base/RequestClient')
import VoiceResponseTwilio = require('./lib/twiml/VoiceResponse')
import {
CallListInstance,
CallInstance,
CallListInstanceCreateOptions,
} from './lib/rest/api/v2010/account/call'
import {
AIAttributes,
AIPromptAttributes,
AIPostPromptAttributes,
LanguageAttributes,
DefaultsAttributes,
FunctionAttributes,
} from './src/types'
export interface CompatibilityAPIRestClientOptions
extends Twilio.TwilioClientOptions {
signalwireSpaceUrl?: string
}
declare function RestClient(
username: string,
token: string,
opts?: CompatibilityAPIRestClientOptions
): CompatibilityApi
interface CompatibilityApiCallListInstanceCreateOptions
extends CallListInstanceCreateOptions {
machineWordsThreshold?: number
maxPricePerMinute?: number
}
interface CompatibilityApiCallListInstance extends CallListInstance {
create(
opts: CompatibilityApiCallListInstanceCreateOptions,
callback?: (error: Error | null, item: CallInstance) => any
): Promise<CallInstance>
}
declare class CompatibilityApi extends Twilio {
calls: CompatibilityApiCallListInstance
}
declare class FaxResponse {
constructor()
receive(attributes?: FaxResponse.ReceiveAttributes): void
toString(): string
reject(): void
}
declare namespace FaxResponse {
type ReceiveMediaType = 'application/pdf' | 'image/tiff'
type ReceivePageSize = 'letter' | 'legal' | 'a4'
export interface ReceiveAttributes {
action?: string
mediaType?: ReceiveMediaType
method?: string
pageSize?: ReceivePageSize
storeMedia?: boolean
}
}
declare class VoiceResponse extends VoiceResponseTwilio {
connect(attributes?: VoiceResponseTwilio.ConnectAttributes): VoiceResponse.Connect
}
declare namespace VoiceResponse {
class Connect extends VoiceResponseTwilio.Connect {
/**
* <AI> TwiML Noun
*
* @param attributes - TwiML attributes
*/
ai(attributes?: AIAttributes): VoiceResponse.AI
}
class AI {
/**
* Add engine attribute
*
* @param engine - string
*/
setEngine(engine: string): void
/**
* Add voice attribute
*
* @param voice - string
*/
setVoice(voice: string): void
/**
* Add postPromptURL attribute
*
* @param postPromptURL - string
*/
setPostPromptURL(postPromptURL: string): void
/**
* Add postPromptAuthUser attribute
*
* @param postPromptAuthUser - string
*/
setPostPromptAuthUser(postPromptAuthUser: string): void
/**
* Add postPromptAuthPassword attribute
*
* @param postPromptAuthPassword - string
*/
setPostPromptAuthPassword(postPromptAuthPassword: string): void
/**
* Add hints attribute
*
* @param hints - string
*/
setHints(hints: string): void
/**
* <Prompt> TwiML Noun
*
* @param text - Text in prompt
*/
prompt(text?: string): VoiceResponse.AIPrompt
/**
* <Prompt> TwiML Noun
*
* @param attributes - TwiML attributes
* @param text - Text in prompt
*/
prompt(attributes?: AIPromptAttributes, text?: string): VoiceResponse.AIPrompt
/**
* <PostPrompt> TwiML Noun
*
* @param text - Text in post prompt
*/
postPrompt(text?: string): VoiceResponse.AIPrompt
/**
* <PostPrompt> TwiML Noun
*
* @param attributes - TwiML attributes
* @param text - Text in post prompt
*/
postPrompt(attributes?: AIPostPromptAttributes, text?: string): VoiceResponse.AIPostPrompt
/**
* <Languages> TwiML Noun
*
* @param attributes - TwiML attributes
*/
languages(attributes?: any): VoiceResponse.Languages
/**
* <SWAIG> TwiML Noun
*
* @param attributes - TwiML attributes
*/
swaig(attributes?: any): VoiceResponse.SWAIG
}
class AIPrompt {
/**
* Add temperature attribute
*
* @param temperature - number
*/
setTemperature(temperature: number): void
/**
* Add topP attribute
*
* @param topP - number
*/
setTopP(topP: number): void
/**
* Add temperature attribute
*
* @param temperature - number
*/
setTemperature(temperature: number): void
/**
* Add confidence attribute
*
* @param confidence - number
*/
setConfidence(confidence: number): void
/**
* Add bargeConfidence attribute
*
* @param bargeConfidence - number
*/
setBargeConfidence(bargeConfidence: number): void
/**
* Add presencePenalty attribute
*
* @param presencePenalty - number
*/
setPresencePenalty(presencePenalty: number): void
/**
* Add frequencyPenalty attribute
*
* @param frequencyPenalty - number
*/
setFrequencyPenalty(frequencyPenalty: number): void
}
class AIPostPrompt extends AIPrompt {}
class Languages {
/**
* <Langauge> TwiML Noun
*
* @param attributes - TwiML attributes
*/
language(attributes?: LanguageAttributes): VoiceResponse.Language
}
class Language {
/**
* Add code attribute
*
* @param code - string
*/
setCode(code: string): void
/**
* Add name attribute
*
* @param name - string
*/
setName(name: string): void
/**
* Add voice attribute
*
* @param voice - string
*/
setVoice(voice: string): void
}
class SWAIG {
/**
* <Defaults> TwiML Noun
*
* @param attributes - TwiML attributes
*/
defaults(attribute?: DefaultsAttributes): VoiceResponse.Defaults
/**
* <Function> TwiML Noun
*
* @param attributes - TwiML attributes
*/
function(attribute?: FunctionAttributes): VoiceResponse.Function
}
class Defaults {
/**
* Add webHookURL attribute
*
* @param webHookURL - string
*/
setWebHookURL(webHookURL: string): void
/**
* Add webHookAuthUser attribute
*
* @param webHookAuthUser - string
*/
setWebHookAuthUser(webHookAuthUser: string): void
/**
* Add webHookAuthPass attribute
*
* @param webHookAuthPass - string
*/
setWebHookAuthPass(webHookAuthPass: string): void
/**
* <name> TwiML Noun
*
* @param name - string
* @param value - string
*/
addMetaData(name: string, value: string): VoiceResponse.Metadata
}
class Function {
/**
* Add name attribute
*
* @param name - string
*/
setName(name: string): void
/**
* Add argument attribute
*
* @param argument - string
*/
setArgument(argument: string): void
/**
* Add purpose attribute
*
* @param purpose - string
*/
setPurpose(purpose: string): void
/**
* Add webHookURL attribute
*
* @param webHookURL - string
*/
setWebHookURL(webHookURL: string): void
/**
* Add webHookAuthUser attribute
*
* @param webHookAuthUser - string
*/
setWebHookAuthUser(webHookAuthUser: string): void
/**
* Add webHookAuthPass attribute
*
* @param webHookAuthPass - string
*/
setWebHookAuthPass(webHookAuthPass: string): void
/**
* <name> TwiML Noun
*
* @param name - string
* @param value - string
*/
addMetaData(name: string, value: string): VoiceResponse.Metadata
}
class Metadata {}
}
interface TwimlConstructor<T> {
new (): T
}
declare namespace RestClient {
export interface RestClientLaMLInterface extends TwimlInterface {
FaxResponse: TwimlConstructor<FaxResponse>
VoiceResponse: TwimlConstructor<VoiceResponse>
}
export import Twilio = TwilioClient
export const jwt: JwtInterface
export const RequestClient: RequestClient
export const validateRequest: typeof webhookTools.validateRequest
export const validateRequestWithBody: typeof webhookTools.validateRequestWithBody
export const validateExpressRequest: typeof webhookTools.validateExpressRequest
export const webhook: typeof webhookTools.webhook
export const LaML: RestClientLaMLInterface
}
export { RestClient, CompatibilityApi }