telnyx 6.35.0 → 6.36.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 (80) hide show
  1. package/CHANGELOG.md +14 -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 +7 -0
  46. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  47. package/resources/texml/accounts/calls/calls.d.ts +7 -0
  48. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  49. package/resources/texml/accounts/calls/calls.js.map +1 -1
  50. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  51. package/resources/texml/index.d.mts +1 -1
  52. package/resources/texml/index.d.mts.map +1 -1
  53. package/resources/texml/index.d.ts +1 -1
  54. package/resources/texml/index.d.ts.map +1 -1
  55. package/resources/texml/index.js.map +1 -1
  56. package/resources/texml/index.mjs +1 -1
  57. package/resources/texml/index.mjs.map +1 -1
  58. package/resources/texml/texml.d.mts +219 -1
  59. package/resources/texml/texml.d.mts.map +1 -1
  60. package/resources/texml/texml.d.ts +219 -1
  61. package/resources/texml/texml.d.ts.map +1 -1
  62. package/resources/texml/texml.js +26 -0
  63. package/resources/texml/texml.js.map +1 -1
  64. package/resources/texml/texml.mjs +26 -0
  65. package/resources/texml/texml.mjs.map +1 -1
  66. package/src/client.ts +9 -1
  67. package/src/resources/enterprises/enterprises.ts +6 -6
  68. package/src/resources/enterprises/index.ts +3 -3
  69. package/src/resources/enterprises/reputation/index.ts +6 -6
  70. package/src/resources/enterprises/reputation/numbers.ts +58 -54
  71. package/src/resources/enterprises/reputation/reputation.ts +60 -61
  72. package/src/resources/index.ts +7 -1
  73. package/src/resources/texml/accounts/calls/calls.ts +8 -0
  74. package/src/resources/texml/index.ts +7 -1
  75. package/src/resources/texml/texml.ts +279 -1
  76. package/src/version.ts +1 -1
  77. package/version.d.mts +1 -1
  78. package/version.d.ts +1 -1
  79. package/version.js +1 -1
  80. package/version.mjs +1 -1
@@ -8,6 +8,25 @@ import { RequestOptions } from "../../internal/request-options.js";
8
8
  */
9
9
  export declare class Texml extends APIResource {
10
10
  accounts: AccountsAPI.Accounts;
11
+ /**
12
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
13
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
14
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
15
+ * not allowed and will result in a 422 error.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const response = await client.texml.initiateAICall(
20
+ * 'connection_id',
21
+ * {
22
+ * AIAssistantId: 'ai-assistant-id-123',
23
+ * From: '+13120001234',
24
+ * To: '+13121230000',
25
+ * },
26
+ * );
27
+ * ```
28
+ */
29
+ initiateAICall(connectionID: string, params: TexmlInitiateAICallParams, options?: RequestOptions): APIPromise<TexmlInitiateAICallResponse>;
11
30
  /**
12
31
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
13
32
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -25,6 +44,12 @@ export declare class Texml extends APIResource {
25
44
  */
26
45
  secrets(body: TexmlSecretsParams, options?: RequestOptions): APIPromise<TexmlSecretsResponse>;
27
46
  }
47
+ export interface TexmlInitiateAICallResponse {
48
+ call_sid?: string;
49
+ from?: string;
50
+ status?: string;
51
+ to?: string;
52
+ }
28
53
  export interface TexmlSecretsResponse {
29
54
  data?: TexmlSecretsResponse.Data;
30
55
  }
@@ -34,6 +59,199 @@ export declare namespace TexmlSecretsResponse {
34
59
  value?: 'REDACTED';
35
60
  }
36
61
  }
62
+ export interface TexmlInitiateAICallParams {
63
+ /**
64
+ * The ID of the AI assistant to use for the call.
65
+ */
66
+ AIAssistantId: string;
67
+ /**
68
+ * The phone number of the party initiating the call. Phone numbers are formatted
69
+ * with a `+` and country code.
70
+ */
71
+ From: string;
72
+ /**
73
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
74
+ * country code.
75
+ */
76
+ To: string;
77
+ /**
78
+ * Key-value map of dynamic variables to pass to the AI assistant.
79
+ */
80
+ AIAssistantDynamicVariables?: {
81
+ [key: string]: string;
82
+ };
83
+ /**
84
+ * The version of the AI assistant to use.
85
+ */
86
+ AIAssistantVersion?: string;
87
+ /**
88
+ * Select whether to perform answering machine detection in the background. By
89
+ * default execution is blocked until Answering Machine Detection is completed.
90
+ */
91
+ AsyncAmd?: boolean;
92
+ /**
93
+ * URL destination for Telnyx to send AMD callback events to for the call.
94
+ */
95
+ AsyncAmdStatusCallback?: string;
96
+ /**
97
+ * HTTP request type used for `AsyncAmdStatusCallback`.
98
+ */
99
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
100
+ /**
101
+ * To be used as the caller id name (SIP From Display Name) presented to the
102
+ * destination (`To` number). The string should have a maximum of 128 characters,
103
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
104
+ * omitted, the display name will be the same as the number in the `From` field.
105
+ */
106
+ CallerId?: string;
107
+ /**
108
+ * URL destination for Telnyx to send conversation callback events to.
109
+ */
110
+ ConversationCallback?: string;
111
+ /**
112
+ * HTTP request type used for `ConversationCallback`.
113
+ */
114
+ ConversationCallbackMethod?: 'GET' | 'POST';
115
+ /**
116
+ * An array of URL destinations for conversation callback events.
117
+ */
118
+ ConversationCallbacks?: Array<string>;
119
+ /**
120
+ * Custom HTTP headers to be sent with the call. Each header should be an object
121
+ * with 'name' and 'value' properties.
122
+ */
123
+ CustomHeaders?: Array<TexmlInitiateAICallParams.CustomHeader>;
124
+ /**
125
+ * Allows you to choose between Premium and Standard detections.
126
+ */
127
+ DetectionMode?: 'Premium' | 'Regular';
128
+ /**
129
+ * Enables Answering Machine Detection.
130
+ */
131
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
132
+ /**
133
+ * If initial silence duration is greater than this value, consider it a machine.
134
+ * Ignored when `premium` detection is used.
135
+ */
136
+ MachineDetectionSilenceTimeout?: number;
137
+ /**
138
+ * Silence duration threshold after a greeting message or voice for it be
139
+ * considered human. Ignored when `premium` detection is used.
140
+ */
141
+ MachineDetectionSpeechEndThreshold?: number;
142
+ /**
143
+ * Maximum threshold of a human greeting. If greeting longer than this value,
144
+ * considered machine. Ignored when `premium` detection is used.
145
+ */
146
+ MachineDetectionSpeechThreshold?: number;
147
+ /**
148
+ * Maximum timeout threshold in milliseconds for overall detection.
149
+ */
150
+ MachineDetectionTimeout?: number;
151
+ /**
152
+ * A string of passport identifiers to associate with the call.
153
+ */
154
+ Passports?: string;
155
+ /**
156
+ * The list of comma-separated codecs to be offered on a call.
157
+ */
158
+ PreferredCodecs?: string;
159
+ /**
160
+ * Whether to record the entire participant's call leg. Defaults to `false`.
161
+ */
162
+ Record?: boolean;
163
+ /**
164
+ * The number of channels in the final recording. Defaults to `mono`.
165
+ */
166
+ RecordingChannels?: 'mono' | 'dual';
167
+ /**
168
+ * The URL the recording callbacks will be sent to.
169
+ */
170
+ RecordingStatusCallback?: string;
171
+ /**
172
+ * The changes to the recording's state that should generate a call to
173
+ * `RecordingStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
174
+ * Separate multiple values with a space. Defaults to `completed`.
175
+ */
176
+ RecordingStatusCallbackEvent?: string;
177
+ /**
178
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
179
+ */
180
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
181
+ /**
182
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
183
+ * silence is detected. The timer only starts when the speech is detected. The
184
+ * minimum value is 0. The default value is 0 (infinite).
185
+ */
186
+ RecordingTimeout?: number;
187
+ /**
188
+ * The audio track to record for the call. The default is `both`.
189
+ */
190
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
191
+ /**
192
+ * Whether to send RecordingUrl in webhooks.
193
+ */
194
+ SendRecordingUrl?: boolean;
195
+ /**
196
+ * The password to use for SIP authentication.
197
+ */
198
+ SipAuthPassword?: string;
199
+ /**
200
+ * The username to use for SIP authentication.
201
+ */
202
+ SipAuthUsername?: string;
203
+ /**
204
+ * Defines the SIP region to be used for the call.
205
+ */
206
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
207
+ /**
208
+ * URL destination for Telnyx to send status callback events to for the call.
209
+ */
210
+ StatusCallback?: string;
211
+ /**
212
+ * The call events for which Telnyx should send a webhook. Multiple events can be
213
+ * defined when separated by a space. Valid values: initiated, ringing, answered,
214
+ * completed.
215
+ */
216
+ StatusCallbackEvent?: string;
217
+ /**
218
+ * HTTP request type used for `StatusCallback`.
219
+ */
220
+ StatusCallbackMethod?: 'GET' | 'POST';
221
+ /**
222
+ * An array of URL destinations for Telnyx to send status callback events to for
223
+ * the call.
224
+ */
225
+ StatusCallbacks?: Array<string>;
226
+ /**
227
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
228
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
229
+ */
230
+ TimeLimit?: number;
231
+ /**
232
+ * The number of seconds to wait for the called party to answer the call before the
233
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
234
+ * is 30 seconds.
235
+ */
236
+ timeout_seconds?: number;
237
+ /**
238
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
239
+ * `trim-silence`.
240
+ */
241
+ Trim?: 'trim-silence' | 'do-not-trim';
242
+ }
243
+ export declare namespace TexmlInitiateAICallParams {
244
+ interface CustomHeader {
245
+ /**
246
+ * The name of the custom header
247
+ */
248
+ name: string;
249
+ /**
250
+ * The value of the custom header
251
+ */
252
+ value: string;
253
+ }
254
+ }
37
255
  export interface TexmlSecretsParams {
38
256
  /**
39
257
  * Name used as a reference for the secret, if the name already exists within the
@@ -46,7 +264,7 @@ export interface TexmlSecretsParams {
46
264
  value: string;
47
265
  }
48
266
  export declare namespace Texml {
49
- export { type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlSecretsParams as TexmlSecretsParams };
267
+ export { type TexmlInitiateAICallResponse as TexmlInitiateAICallResponse, type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlInitiateAICallParams as TexmlInitiateAICallParams, type TexmlSecretsParams as TexmlSecretsParams, };
50
268
  export { Accounts as Accounts, type TexmlGetCallRecordingResponseBody as TexmlGetCallRecordingResponseBody, type TexmlRecordingSubresourcesUris as TexmlRecordingSubresourcesUris, type AccountRetrieveRecordingsJsonResponse as AccountRetrieveRecordingsJsonResponse, type AccountRetrieveTranscriptionsJsonResponse as AccountRetrieveTranscriptionsJsonResponse, type AccountRetrieveRecordingsJsonParams as AccountRetrieveRecordingsJsonParams, type AccountRetrieveTranscriptionsJsonParams as AccountRetrieveTranscriptionsJsonParams, };
51
269
  }
52
270
  //# sourceMappingURL=texml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"texml.d.ts","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,mCAAmC,EACnC,qCAAqC,EACrC,uCAAuC,EACvC,yCAAyC,EACzC,QAAQ,EACR,iCAAiC,EACjC,8BAA8B,EAC/B;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAG9F;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC;CAClC;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,IAAI;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAG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AAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;CACvC;AAED,yBAAiB,yBAAyB,CAAC;IACzC,UAAiB,YAAY;QAC3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,uCAAuC,IAAI,uCAAuC,GACxF,CAAC;CACH"}
@@ -6,6 +6,7 @@ const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
7
  const AccountsAPI = tslib_1.__importStar(require("./accounts/accounts.js"));
8
8
  const accounts_1 = require("./accounts/accounts.js");
9
+ const path_1 = require("../../internal/utils/path.js");
9
10
  /**
10
11
  * TeXML REST Commands
11
12
  */
@@ -14,6 +15,31 @@ class Texml extends resource_1.APIResource {
14
15
  super(...arguments);
15
16
  this.accounts = new AccountsAPI.Accounts(this._client);
16
17
  }
18
+ /**
19
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
20
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
21
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
22
+ * not allowed and will result in a 422 error.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const response = await client.texml.initiateAICall(
27
+ * 'connection_id',
28
+ * {
29
+ * AIAssistantId: 'ai-assistant-id-123',
30
+ * From: '+13120001234',
31
+ * To: '+13121230000',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ initiateAICall(connectionID, params, options) {
37
+ const { timeout_seconds, ...body } = params;
38
+ return this._client.post((0, path_1.path) `/texml/ai_calls/${connectionID}`, {
39
+ body: { Timeout: timeout_seconds, ...body },
40
+ ...options,
41
+ });
42
+ }
17
43
  /**
18
44
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
19
45
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -1 +1 @@
1
- {"version":3,"file":"texml.js","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,4EAAmD;AACnD,qDAQ6B;AAI7B;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoB1E,CAAC;IAlBC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AArBD,sBAqBC;AA2BD,KAAK,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
1
+ {"version":3,"file":"texml.js","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,4EAAmD;AACnD,qDAQ6B;AAG7B,uDAAiD;AAEjD;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkD1E,CAAC;IAhDC;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CACZ,YAAoB,EACpB,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,mBAAmB,YAAY,EAAE,EAAE;YAC9D,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE;YAC3C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AAnDD,sBAmDC;AA6QD,KAAK,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -2,6 +2,7 @@
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import * as AccountsAPI from "./accounts/accounts.mjs";
4
4
  import { Accounts, } from "./accounts/accounts.mjs";
5
+ import { path } from "../../internal/utils/path.mjs";
5
6
  /**
6
7
  * TeXML REST Commands
7
8
  */
@@ -10,6 +11,31 @@ export class Texml extends APIResource {
10
11
  super(...arguments);
11
12
  this.accounts = new AccountsAPI.Accounts(this._client);
12
13
  }
14
+ /**
15
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
16
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
17
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
18
+ * not allowed and will result in a 422 error.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const response = await client.texml.initiateAICall(
23
+ * 'connection_id',
24
+ * {
25
+ * AIAssistantId: 'ai-assistant-id-123',
26
+ * From: '+13120001234',
27
+ * To: '+13121230000',
28
+ * },
29
+ * );
30
+ * ```
31
+ */
32
+ initiateAICall(connectionID, params, options) {
33
+ const { timeout_seconds, ...body } = params;
34
+ return this._client.post(path `/texml/ai_calls/${connectionID}`, {
35
+ body: { Timeout: timeout_seconds, ...body },
36
+ ...options,
37
+ });
38
+ }
13
39
  /**
14
40
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
15
41
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -1 +1 @@
1
- {"version":3,"file":"texml.mjs","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAKL,QAAQ,GAGT;AAID;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoB1E,CAAC;IAlBC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AA2BD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"texml.mjs","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAKL,QAAQ,GAGT;OAGM,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkD1E,CAAC;IAhDC;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CACZ,YAAoB,EACpB,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,mBAAmB,YAAY,EAAE,EAAE;YAC9D,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE;YAC3C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AA6QD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
package/src/client.ts CHANGED
@@ -1496,7 +1496,13 @@ import {
1496
1496
  } from './resources/sim-cards/sim-cards';
1497
1497
  import { Storage, StorageListMigrationSourceCoverageResponse } from './resources/storage/storage';
1498
1498
  import { TermsOfService } from './resources/terms-of-service/terms-of-service';
1499
- import { Texml, TexmlSecretsParams, TexmlSecretsResponse } from './resources/texml/texml';
1499
+ import {
1500
+ Texml,
1501
+ TexmlInitiateAICallParams,
1502
+ TexmlInitiateAICallResponse,
1503
+ TexmlSecretsParams,
1504
+ TexmlSecretsResponse,
1505
+ } from './resources/texml/texml';
1500
1506
  import {
1501
1507
  StreamClientEvent,
1502
1508
  StreamServerEvent,
@@ -4487,7 +4493,9 @@ export declare namespace Telnyx {
4487
4493
 
4488
4494
  export {
4489
4495
  Texml as Texml,
4496
+ type TexmlInitiateAICallResponse as TexmlInitiateAICallResponse,
4490
4497
  type TexmlSecretsResponse as TexmlSecretsResponse,
4498
+ type TexmlInitiateAICallParams as TexmlInitiateAICallParams,
4491
4499
  type TexmlSecretsParams as TexmlSecretsParams,
4492
4500
  };
4493
4501
 
@@ -5,9 +5,9 @@ import * as ReputationAPI from './reputation/reputation';
5
5
  import {
6
6
  EnterpriseReputationPublic,
7
7
  Reputation,
8
- ReputationCreateParams,
9
- ReputationCreateResponse,
10
- ReputationListResponse,
8
+ ReputationEnableParams,
9
+ ReputationEnableResponse,
10
+ ReputationRetrieveResponse,
11
11
  ReputationUpdateFrequencyParams,
12
12
  ReputationUpdateFrequencyResponse,
13
13
  } from './reputation/reputation';
@@ -586,10 +586,10 @@ export declare namespace Enterprises {
586
586
  export {
587
587
  Reputation as Reputation,
588
588
  type EnterpriseReputationPublic as EnterpriseReputationPublic,
589
- type ReputationCreateResponse as ReputationCreateResponse,
590
- type ReputationListResponse as ReputationListResponse,
589
+ type ReputationRetrieveResponse as ReputationRetrieveResponse,
590
+ type ReputationEnableResponse as ReputationEnableResponse,
591
591
  type ReputationUpdateFrequencyResponse as ReputationUpdateFrequencyResponse,
592
- type ReputationCreateParams as ReputationCreateParams,
592
+ type ReputationEnableParams as ReputationEnableParams,
593
593
  type ReputationUpdateFrequencyParams as ReputationUpdateFrequencyParams,
594
594
  };
595
595
  }
@@ -18,9 +18,9 @@ export {
18
18
  export {
19
19
  Reputation,
20
20
  type EnterpriseReputationPublic,
21
- type ReputationCreateResponse,
22
- type ReputationListResponse,
21
+ type ReputationRetrieveResponse,
22
+ type ReputationEnableResponse,
23
23
  type ReputationUpdateFrequencyResponse,
24
- type ReputationCreateParams,
24
+ type ReputationEnableParams,
25
25
  type ReputationUpdateFrequencyParams,
26
26
  } from './reputation/index';
@@ -2,19 +2,19 @@
2
2
 
3
3
  export {
4
4
  Numbers,
5
- type NumberCreateResponse,
6
5
  type NumberRetrieveResponse,
7
- type NumberCreateParams,
6
+ type NumberAssociateResponse,
8
7
  type NumberRetrieveParams,
9
8
  type NumberListParams,
10
- type NumberDeleteParams,
9
+ type NumberAssociateParams,
10
+ type NumberDisassociateParams,
11
11
  } from './numbers';
12
12
  export {
13
13
  Reputation,
14
14
  type EnterpriseReputationPublic,
15
- type ReputationCreateResponse,
16
- type ReputationListResponse,
15
+ type ReputationRetrieveResponse,
16
+ type ReputationEnableResponse,
17
17
  type ReputationUpdateFrequencyResponse,
18
- type ReputationCreateParams,
18
+ type ReputationEnableParams,
19
19
  type ReputationUpdateFrequencyParams,
20
20
  } from './reputation';
@@ -17,40 +17,6 @@ import { path } from '../../../internal/utils/path';
17
17
  * Associate phone numbers with an enterprise for reputation monitoring and retrieve reputation scores
18
18
  */
19
19
  export class Numbers extends APIResource {
20
- /**
21
- * Associate one or more phone numbers with an enterprise for Number Reputation
22
- * monitoring.
23
- *
24
- * **Validations:**
25
- *
26
- * - Phone numbers must be in E.164 format (e.g., `+16035551234`)
27
- * - Phone numbers must be in-service and belong to your account (verified via
28
- * Warehouse)
29
- * - Phone numbers must be US local numbers
30
- * - Phone numbers cannot already be associated with any enterprise
31
- *
32
- * **Note:** This operation is atomic — if any number fails validation, the entire
33
- * request fails.
34
- *
35
- * **Maximum:** 100 phone numbers per request.
36
- *
37
- * @example
38
- * ```ts
39
- * const number =
40
- * await client.enterprises.reputation.numbers.create(
41
- * '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
42
- * { phone_numbers: ['+16035551234'] },
43
- * );
44
- * ```
45
- */
46
- create(
47
- enterpriseID: string,
48
- body: NumberCreateParams,
49
- options?: RequestOptions,
50
- ): APIPromise<NumberCreateResponse> {
51
- return this._client.post(path`/enterprises/${enterpriseID}/reputation/numbers`, { body, ...options });
52
- }
53
-
54
20
  /**
55
21
  * Get detailed reputation data for a specific phone number associated with an
56
22
  * enterprise.
@@ -126,6 +92,40 @@ export class Numbers extends APIResource {
126
92
  );
127
93
  }
128
94
 
95
+ /**
96
+ * Associate one or more phone numbers with an enterprise for Number Reputation
97
+ * monitoring.
98
+ *
99
+ * **Validations:**
100
+ *
101
+ * - Phone numbers must be in E.164 format (e.g., `+16035551234`)
102
+ * - Phone numbers must be in-service and belong to your account (verified via
103
+ * Warehouse)
104
+ * - Phone numbers must be US local numbers
105
+ * - Phone numbers cannot already be associated with any enterprise
106
+ *
107
+ * **Note:** This operation is atomic — if any number fails validation, the entire
108
+ * request fails.
109
+ *
110
+ * **Maximum:** 100 phone numbers per request.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const response =
115
+ * await client.enterprises.reputation.numbers.associate(
116
+ * '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
117
+ * { phone_numbers: ['+16035551234'] },
118
+ * );
119
+ * ```
120
+ */
121
+ associate(
122
+ enterpriseID: string,
123
+ body: NumberAssociateParams,
124
+ options?: RequestOptions,
125
+ ): APIPromise<NumberAssociateResponse> {
126
+ return this._client.post(path`/enterprises/${enterpriseID}/reputation/numbers`, { body, ...options });
127
+ }
128
+
129
129
  /**
130
130
  * Remove a phone number from Number Reputation monitoring for an enterprise.
131
131
  *
@@ -134,13 +134,17 @@ export class Numbers extends APIResource {
134
134
  *
135
135
  * @example
136
136
  * ```ts
137
- * await client.enterprises.reputation.numbers.delete(
137
+ * await client.enterprises.reputation.numbers.disassociate(
138
138
  * '+16035551234',
139
139
  * { enterprise_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58' },
140
140
  * );
141
141
  * ```
142
142
  */
143
- delete(phoneNumber: string, params: NumberDeleteParams, options?: RequestOptions): APIPromise<void> {
143
+ disassociate(
144
+ phoneNumber: string,
145
+ params: NumberDisassociateParams,
146
+ options?: RequestOptions,
147
+ ): APIPromise<void> {
144
148
  const { enterprise_id } = params;
145
149
  return this._client.delete(path`/enterprises/${enterprise_id}/reputation/numbers/${phoneNumber}`, {
146
150
  ...options,
@@ -149,13 +153,17 @@ export class Numbers extends APIResource {
149
153
  }
150
154
  }
151
155
 
152
- export interface NumberCreateResponse {
153
- data?: Array<NumberCreateResponse.Data>;
156
+ export interface NumberRetrieveResponse {
157
+ data?: Shared.ReputationPhoneNumberWithReputationData;
158
+ }
159
+
160
+ export interface NumberAssociateResponse {
161
+ data?: Array<NumberAssociateResponse.Data>;
154
162
 
155
163
  meta?: Shared.MetaInfo;
156
164
  }
157
165
 
158
- export namespace NumberCreateResponse {
166
+ export namespace NumberAssociateResponse {
159
167
  export interface Data {
160
168
  /**
161
169
  * Unique identifier
@@ -184,17 +192,6 @@ export namespace NumberCreateResponse {
184
192
  }
185
193
  }
186
194
 
187
- export interface NumberRetrieveResponse {
188
- data?: Shared.ReputationPhoneNumberWithReputationData;
189
- }
190
-
191
- export interface NumberCreateParams {
192
- /**
193
- * List of phone numbers to associate for reputation monitoring (max 100)
194
- */
195
- phone_numbers: Array<string>;
196
- }
197
-
198
195
  export interface NumberRetrieveParams {
199
196
  /**
200
197
  * Path param: Unique identifier of the enterprise (UUID)
@@ -215,7 +212,14 @@ export interface NumberListParams extends DefaultFlatPaginationParams {
215
212
  phone_number?: string;
216
213
  }
217
214
 
218
- export interface NumberDeleteParams {
215
+ export interface NumberAssociateParams {
216
+ /**
217
+ * List of phone numbers to associate for reputation monitoring (max 100)
218
+ */
219
+ phone_numbers: Array<string>;
220
+ }
221
+
222
+ export interface NumberDisassociateParams {
219
223
  /**
220
224
  * Unique identifier of the enterprise (UUID)
221
225
  */
@@ -224,12 +228,12 @@ export interface NumberDeleteParams {
224
228
 
225
229
  export declare namespace Numbers {
226
230
  export {
227
- type NumberCreateResponse as NumberCreateResponse,
228
231
  type NumberRetrieveResponse as NumberRetrieveResponse,
229
- type NumberCreateParams as NumberCreateParams,
232
+ type NumberAssociateResponse as NumberAssociateResponse,
230
233
  type NumberRetrieveParams as NumberRetrieveParams,
231
234
  type NumberListParams as NumberListParams,
232
- type NumberDeleteParams as NumberDeleteParams,
235
+ type NumberAssociateParams as NumberAssociateParams,
236
+ type NumberDisassociateParams as NumberDisassociateParams,
233
237
  };
234
238
  }
235
239