telnyx 6.35.0 → 6.37.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/enterprises/enterprises.d.mts +2 -2
  11. package/resources/enterprises/enterprises.d.mts.map +1 -1
  12. package/resources/enterprises/enterprises.d.ts +2 -2
  13. package/resources/enterprises/enterprises.d.ts.map +1 -1
  14. package/resources/enterprises/index.d.mts +1 -1
  15. package/resources/enterprises/index.d.mts.map +1 -1
  16. package/resources/enterprises/index.d.ts +1 -1
  17. package/resources/enterprises/index.d.ts.map +1 -1
  18. package/resources/enterprises/reputation/index.d.mts +2 -2
  19. package/resources/enterprises/reputation/index.d.mts.map +1 -1
  20. package/resources/enterprises/reputation/index.d.ts +2 -2
  21. package/resources/enterprises/reputation/index.d.ts.map +1 -1
  22. package/resources/enterprises/reputation/numbers.d.mts +43 -43
  23. package/resources/enterprises/reputation/numbers.d.mts.map +1 -1
  24. package/resources/enterprises/reputation/numbers.d.ts +43 -43
  25. package/resources/enterprises/reputation/numbers.d.ts.map +1 -1
  26. package/resources/enterprises/reputation/numbers.js +31 -31
  27. package/resources/enterprises/reputation/numbers.js.map +1 -1
  28. package/resources/enterprises/reputation/numbers.mjs +31 -31
  29. package/resources/enterprises/reputation/numbers.mjs.map +1 -1
  30. package/resources/enterprises/reputation/reputation.d.mts +45 -46
  31. package/resources/enterprises/reputation/reputation.d.mts.map +1 -1
  32. package/resources/enterprises/reputation/reputation.d.ts +45 -46
  33. package/resources/enterprises/reputation/reputation.d.ts.map +1 -1
  34. package/resources/enterprises/reputation/reputation.js +43 -44
  35. package/resources/enterprises/reputation/reputation.js.map +1 -1
  36. package/resources/enterprises/reputation/reputation.mjs +43 -44
  37. package/resources/enterprises/reputation/reputation.mjs.map +1 -1
  38. package/resources/index.d.mts +1 -1
  39. package/resources/index.d.mts.map +1 -1
  40. package/resources/index.d.ts +1 -1
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs +1 -1
  44. package/resources/index.mjs.map +1 -1
  45. package/resources/texml/accounts/calls/calls.d.mts +613 -201
  46. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  47. package/resources/texml/accounts/calls/calls.d.ts +613 -201
  48. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  49. package/resources/texml/accounts/calls/calls.js +1 -5
  50. package/resources/texml/accounts/calls/calls.js.map +1 -1
  51. package/resources/texml/accounts/calls/calls.mjs +1 -5
  52. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  53. package/resources/texml/index.d.mts +1 -1
  54. package/resources/texml/index.d.mts.map +1 -1
  55. package/resources/texml/index.d.ts +1 -1
  56. package/resources/texml/index.d.ts.map +1 -1
  57. package/resources/texml/index.js.map +1 -1
  58. package/resources/texml/index.mjs +1 -1
  59. package/resources/texml/index.mjs.map +1 -1
  60. package/resources/texml/texml.d.mts +219 -1
  61. package/resources/texml/texml.d.mts.map +1 -1
  62. package/resources/texml/texml.d.ts +219 -1
  63. package/resources/texml/texml.d.ts.map +1 -1
  64. package/resources/texml/texml.js +26 -0
  65. package/resources/texml/texml.js.map +1 -1
  66. package/resources/texml/texml.mjs +26 -0
  67. package/resources/texml/texml.mjs.map +1 -1
  68. package/src/client.ts +9 -1
  69. package/src/resources/enterprises/enterprises.ts +6 -6
  70. package/src/resources/enterprises/index.ts +3 -3
  71. package/src/resources/enterprises/reputation/index.ts +6 -6
  72. package/src/resources/enterprises/reputation/numbers.ts +58 -54
  73. package/src/resources/enterprises/reputation/reputation.ts +60 -61
  74. package/src/resources/index.ts +7 -1
  75. package/src/resources/texml/accounts/calls/calls.ts +705 -202
  76. package/src/resources/texml/index.ts +7 -1
  77. package/src/resources/texml/texml.ts +279 -1
  78. package/src/version.ts +1 -1
  79. package/version.d.mts +1 -1
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
  82. package/version.mjs +1 -1
@@ -9,4 +9,10 @@ export {
9
9
  type AccountRetrieveRecordingsJsonParams,
10
10
  type AccountRetrieveTranscriptionsJsonParams,
11
11
  } from './accounts/index';
12
- export { Texml, type TexmlSecretsResponse, type TexmlSecretsParams } from './texml';
12
+ export {
13
+ Texml,
14
+ type TexmlInitiateAICallResponse,
15
+ type TexmlSecretsResponse,
16
+ type TexmlInitiateAICallParams,
17
+ type TexmlSecretsParams,
18
+ } from './texml';
@@ -13,6 +13,7 @@ import {
13
13
  } from './accounts/accounts';
14
14
  import { APIPromise } from '../../core/api-promise';
15
15
  import { RequestOptions } from '../../internal/request-options';
16
+ import { path } from '../../internal/utils/path';
16
17
 
17
18
  /**
18
19
  * TeXML REST Commands
@@ -20,6 +21,36 @@ import { RequestOptions } from '../../internal/request-options';
20
21
  export class Texml extends APIResource {
21
22
  accounts: AccountsAPI.Accounts = new AccountsAPI.Accounts(this._client);
22
23
 
24
+ /**
25
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
26
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
27
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
28
+ * not allowed and will result in a 422 error.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.texml.initiateAICall(
33
+ * 'connection_id',
34
+ * {
35
+ * AIAssistantId: 'ai-assistant-id-123',
36
+ * From: '+13120001234',
37
+ * To: '+13121230000',
38
+ * },
39
+ * );
40
+ * ```
41
+ */
42
+ initiateAICall(
43
+ connectionID: string,
44
+ params: TexmlInitiateAICallParams,
45
+ options?: RequestOptions,
46
+ ): APIPromise<TexmlInitiateAICallResponse> {
47
+ const { timeout_seconds, ...body } = params;
48
+ return this._client.post(path`/texml/ai_calls/${connectionID}`, {
49
+ body: { Timeout: timeout_seconds, ...body },
50
+ ...options,
51
+ });
52
+ }
53
+
23
54
  /**
24
55
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
25
56
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -40,6 +71,16 @@ export class Texml extends APIResource {
40
71
  }
41
72
  }
42
73
 
74
+ export interface TexmlInitiateAICallResponse {
75
+ call_sid?: string;
76
+
77
+ from?: string;
78
+
79
+ status?: string;
80
+
81
+ to?: string;
82
+ }
83
+
43
84
  export interface TexmlSecretsResponse {
44
85
  data?: TexmlSecretsResponse.Data;
45
86
  }
@@ -52,6 +93,238 @@ export namespace TexmlSecretsResponse {
52
93
  }
53
94
  }
54
95
 
96
+ export interface TexmlInitiateAICallParams {
97
+ /**
98
+ * The ID of the AI assistant to use for the call.
99
+ */
100
+ AIAssistantId: string;
101
+
102
+ /**
103
+ * The phone number of the party initiating the call. Phone numbers are formatted
104
+ * with a `+` and country code.
105
+ */
106
+ From: string;
107
+
108
+ /**
109
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
110
+ * country code.
111
+ */
112
+ To: string;
113
+
114
+ /**
115
+ * Key-value map of dynamic variables to pass to the AI assistant.
116
+ */
117
+ AIAssistantDynamicVariables?: { [key: string]: string };
118
+
119
+ /**
120
+ * The version of the AI assistant to use.
121
+ */
122
+ AIAssistantVersion?: string;
123
+
124
+ /**
125
+ * Select whether to perform answering machine detection in the background. By
126
+ * default execution is blocked until Answering Machine Detection is completed.
127
+ */
128
+ AsyncAmd?: boolean;
129
+
130
+ /**
131
+ * URL destination for Telnyx to send AMD callback events to for the call.
132
+ */
133
+ AsyncAmdStatusCallback?: string;
134
+
135
+ /**
136
+ * HTTP request type used for `AsyncAmdStatusCallback`.
137
+ */
138
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
139
+
140
+ /**
141
+ * To be used as the caller id name (SIP From Display Name) presented to the
142
+ * destination (`To` number). The string should have a maximum of 128 characters,
143
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
144
+ * omitted, the display name will be the same as the number in the `From` field.
145
+ */
146
+ CallerId?: string;
147
+
148
+ /**
149
+ * URL destination for Telnyx to send conversation callback events to.
150
+ */
151
+ ConversationCallback?: string;
152
+
153
+ /**
154
+ * HTTP request type used for `ConversationCallback`.
155
+ */
156
+ ConversationCallbackMethod?: 'GET' | 'POST';
157
+
158
+ /**
159
+ * An array of URL destinations for conversation callback events.
160
+ */
161
+ ConversationCallbacks?: Array<string>;
162
+
163
+ /**
164
+ * Custom HTTP headers to be sent with the call. Each header should be an object
165
+ * with 'name' and 'value' properties.
166
+ */
167
+ CustomHeaders?: Array<TexmlInitiateAICallParams.CustomHeader>;
168
+
169
+ /**
170
+ * Allows you to choose between Premium and Standard detections.
171
+ */
172
+ DetectionMode?: 'Premium' | 'Regular';
173
+
174
+ /**
175
+ * Enables Answering Machine Detection.
176
+ */
177
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
178
+
179
+ /**
180
+ * If initial silence duration is greater than this value, consider it a machine.
181
+ * Ignored when `premium` detection is used.
182
+ */
183
+ MachineDetectionSilenceTimeout?: number;
184
+
185
+ /**
186
+ * Silence duration threshold after a greeting message or voice for it be
187
+ * considered human. Ignored when `premium` detection is used.
188
+ */
189
+ MachineDetectionSpeechEndThreshold?: number;
190
+
191
+ /**
192
+ * Maximum threshold of a human greeting. If greeting longer than this value,
193
+ * considered machine. Ignored when `premium` detection is used.
194
+ */
195
+ MachineDetectionSpeechThreshold?: number;
196
+
197
+ /**
198
+ * Maximum timeout threshold in milliseconds for overall detection.
199
+ */
200
+ MachineDetectionTimeout?: number;
201
+
202
+ /**
203
+ * A string of passport identifiers to associate with the call.
204
+ */
205
+ Passports?: string;
206
+
207
+ /**
208
+ * The list of comma-separated codecs to be offered on a call.
209
+ */
210
+ PreferredCodecs?: string;
211
+
212
+ /**
213
+ * Whether to record the entire participant's call leg. Defaults to `false`.
214
+ */
215
+ Record?: boolean;
216
+
217
+ /**
218
+ * The number of channels in the final recording. Defaults to `mono`.
219
+ */
220
+ RecordingChannels?: 'mono' | 'dual';
221
+
222
+ /**
223
+ * The URL the recording callbacks will be sent to.
224
+ */
225
+ RecordingStatusCallback?: string;
226
+
227
+ /**
228
+ * The changes to the recording's state that should generate a call to
229
+ * `RecordingStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
230
+ * Separate multiple values with a space. Defaults to `completed`.
231
+ */
232
+ RecordingStatusCallbackEvent?: string;
233
+
234
+ /**
235
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
236
+ */
237
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
238
+
239
+ /**
240
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
241
+ * silence is detected. The timer only starts when the speech is detected. The
242
+ * minimum value is 0. The default value is 0 (infinite).
243
+ */
244
+ RecordingTimeout?: number;
245
+
246
+ /**
247
+ * The audio track to record for the call. The default is `both`.
248
+ */
249
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
250
+
251
+ /**
252
+ * Whether to send RecordingUrl in webhooks.
253
+ */
254
+ SendRecordingUrl?: boolean;
255
+
256
+ /**
257
+ * The password to use for SIP authentication.
258
+ */
259
+ SipAuthPassword?: string;
260
+
261
+ /**
262
+ * The username to use for SIP authentication.
263
+ */
264
+ SipAuthUsername?: string;
265
+
266
+ /**
267
+ * Defines the SIP region to be used for the call.
268
+ */
269
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
270
+
271
+ /**
272
+ * URL destination for Telnyx to send status callback events to for the call.
273
+ */
274
+ StatusCallback?: string;
275
+
276
+ /**
277
+ * The call events for which Telnyx should send a webhook. Multiple events can be
278
+ * defined when separated by a space. Valid values: initiated, ringing, answered,
279
+ * completed.
280
+ */
281
+ StatusCallbackEvent?: string;
282
+
283
+ /**
284
+ * HTTP request type used for `StatusCallback`.
285
+ */
286
+ StatusCallbackMethod?: 'GET' | 'POST';
287
+
288
+ /**
289
+ * An array of URL destinations for Telnyx to send status callback events to for
290
+ * the call.
291
+ */
292
+ StatusCallbacks?: Array<string>;
293
+
294
+ /**
295
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
296
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
297
+ */
298
+ TimeLimit?: number;
299
+
300
+ /**
301
+ * The number of seconds to wait for the called party to answer the call before the
302
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
303
+ * is 30 seconds.
304
+ */
305
+ timeout_seconds?: number;
306
+
307
+ /**
308
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
309
+ * `trim-silence`.
310
+ */
311
+ Trim?: 'trim-silence' | 'do-not-trim';
312
+ }
313
+
314
+ export namespace TexmlInitiateAICallParams {
315
+ export interface CustomHeader {
316
+ /**
317
+ * The name of the custom header
318
+ */
319
+ name: string;
320
+
321
+ /**
322
+ * The value of the custom header
323
+ */
324
+ value: string;
325
+ }
326
+ }
327
+
55
328
  export interface TexmlSecretsParams {
56
329
  /**
57
330
  * Name used as a reference for the secret, if the name already exists within the
@@ -68,7 +341,12 @@ export interface TexmlSecretsParams {
68
341
  Texml.Accounts = Accounts;
69
342
 
70
343
  export declare namespace Texml {
71
- export { type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlSecretsParams as TexmlSecretsParams };
344
+ export {
345
+ type TexmlInitiateAICallResponse as TexmlInitiateAICallResponse,
346
+ type TexmlSecretsResponse as TexmlSecretsResponse,
347
+ type TexmlInitiateAICallParams as TexmlInitiateAICallParams,
348
+ type TexmlSecretsParams as TexmlSecretsParams,
349
+ };
72
350
 
73
351
  export {
74
352
  Accounts as Accounts,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.35.0'; // x-release-please-version
1
+ export const VERSION = '6.37.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "6.35.0";
1
+ export declare const VERSION = "6.37.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "6.35.0";
1
+ export declare const VERSION = "6.37.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '6.35.0'; // x-release-please-version
4
+ exports.VERSION = '6.37.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '6.35.0'; // x-release-please-version
1
+ export const VERSION = '6.37.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map