telnyx 6.48.0 → 6.49.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 (84) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/ai/assistants/assistants.d.mts +2 -2
  12. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  13. package/resources/ai/assistants/assistants.d.ts +2 -2
  14. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  15. package/resources/ai/assistants/assistants.js.map +1 -1
  16. package/resources/ai/assistants/assistants.mjs.map +1 -1
  17. package/resources/ai/assistants/canary-deploys.d.mts +246 -30
  18. package/resources/ai/assistants/canary-deploys.d.mts.map +1 -1
  19. package/resources/ai/assistants/canary-deploys.d.ts +246 -30
  20. package/resources/ai/assistants/canary-deploys.d.ts.map +1 -1
  21. package/resources/ai/assistants/canary-deploys.js +0 -10
  22. package/resources/ai/assistants/canary-deploys.js.map +1 -1
  23. package/resources/ai/assistants/canary-deploys.mjs +0 -10
  24. package/resources/ai/assistants/canary-deploys.mjs.map +1 -1
  25. package/resources/ai/assistants/index.d.mts +1 -1
  26. package/resources/ai/assistants/index.d.mts.map +1 -1
  27. package/resources/ai/assistants/index.d.ts +1 -1
  28. package/resources/ai/assistants/index.d.ts.map +1 -1
  29. package/resources/ai/assistants/index.js.map +1 -1
  30. package/resources/ai/assistants/index.mjs.map +1 -1
  31. package/resources/index.d.mts +1 -0
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +1 -0
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +4 -2
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/uac-connections/actions.d.mts +65 -0
  40. package/resources/uac-connections/actions.d.mts.map +1 -0
  41. package/resources/uac-connections/actions.d.ts +65 -0
  42. package/resources/uac-connections/actions.d.ts.map +1 -0
  43. package/resources/uac-connections/actions.js +29 -0
  44. package/resources/uac-connections/actions.js.map +1 -0
  45. package/resources/uac-connections/actions.mjs +25 -0
  46. package/resources/uac-connections/actions.mjs.map +1 -0
  47. package/resources/uac-connections/index.d.mts +3 -0
  48. package/resources/uac-connections/index.d.mts.map +1 -0
  49. package/resources/uac-connections/index.d.ts +3 -0
  50. package/resources/uac-connections/index.d.ts.map +1 -0
  51. package/resources/uac-connections/index.js +9 -0
  52. package/resources/uac-connections/index.js.map +1 -0
  53. package/resources/uac-connections/index.mjs +4 -0
  54. package/resources/uac-connections/index.mjs.map +1 -0
  55. package/resources/uac-connections/uac-connections.d.mts +2588 -0
  56. package/resources/uac-connections/uac-connections.d.mts.map +1 -0
  57. package/resources/uac-connections/uac-connections.d.ts +2588 -0
  58. package/resources/uac-connections/uac-connections.d.ts.map +1 -0
  59. package/resources/uac-connections/uac-connections.js +97 -0
  60. package/resources/uac-connections/uac-connections.js.map +1 -0
  61. package/resources/uac-connections/uac-connections.mjs +92 -0
  62. package/resources/uac-connections/uac-connections.mjs.map +1 -0
  63. package/resources/uac-connections.d.mts +2 -0
  64. package/resources/uac-connections.d.mts.map +1 -0
  65. package/resources/uac-connections.d.ts +2 -0
  66. package/resources/uac-connections.d.ts.map +1 -0
  67. package/resources/uac-connections.js +6 -0
  68. package/resources/uac-connections.js.map +1 -0
  69. package/resources/uac-connections.mjs +3 -0
  70. package/resources/uac-connections.mjs.map +1 -0
  71. package/src/client.ts +30 -0
  72. package/src/resources/ai/assistants/assistants.ts +0 -2
  73. package/src/resources/ai/assistants/canary-deploys.ts +280 -31
  74. package/src/resources/ai/assistants/index.ts +0 -1
  75. package/src/resources/index.ts +12 -0
  76. package/src/resources/uac-connections/actions.ts +83 -0
  77. package/src/resources/uac-connections/index.ts +15 -0
  78. package/src/resources/uac-connections/uac-connections.ts +3153 -0
  79. package/src/resources/uac-connections.ts +3 -0
  80. package/src/version.ts +1 -1
  81. package/version.d.mts +1 -1
  82. package/version.d.ts +1 -1
  83. package/version.js +1 -1
  84. package/version.mjs +1 -1
@@ -21,11 +21,6 @@ export class CanaryDeploys extends APIResource {
21
21
  * const canaryDeployResponse =
22
22
  * await client.ai.assistants.canaryDeploys.create(
23
23
  * 'assistant_id',
24
- * {
25
- * versions: [
26
- * { percentage: 1, version_id: 'version_id' },
27
- * ],
28
- * },
29
24
  * );
30
25
  * ```
31
26
  */
@@ -67,11 +62,6 @@ export class CanaryDeploys extends APIResource {
67
62
  * const canaryDeployResponse =
68
63
  * await client.ai.assistants.canaryDeploys.update(
69
64
  * 'assistant_id',
70
- * {
71
- * versions: [
72
- * { percentage: 1, version_id: 'version_id' },
73
- * ],
74
- * },
75
65
  * );
76
66
  * ```
77
67
  */
@@ -104,62 +94,321 @@ export class CanaryDeploys extends APIResource {
104
94
  }
105
95
 
106
96
  /**
107
- * Request model for creating or updating canary deploys.
97
+ * Create/update request body. Accepts:
98
+ *
99
+ * - `rules` — canonical ordered list of routing rules
108
100
  */
109
101
  export interface CanaryDeploy {
102
+ rules?: Array<CanaryDeploy.Rule>;
103
+ }
104
+
105
+ export namespace CanaryDeploy {
110
106
  /**
111
- * List of version configurations
107
+ * A targeting rule: `match` clauses (AND) gate `serve`.
108
+ *
109
+ * An empty `match` is a catch-all (always fires).
112
110
  */
113
- versions: Array<VersionConfig>;
111
+ export interface Rule {
112
+ /**
113
+ * What a rule serves when matched.
114
+ *
115
+ * Exactly one of:
116
+ *
117
+ * - `version_id` — serve a specific version
118
+ * - `rollout` — weighted random across versions; weights must sum to less than
119
+ * 100, with the leftover routing to the main version
120
+ */
121
+ serve: Rule.Serve;
122
+
123
+ match?: Array<Rule.Match>;
124
+ }
125
+
126
+ export namespace Rule {
127
+ /**
128
+ * What a rule serves when matched.
129
+ *
130
+ * Exactly one of:
131
+ *
132
+ * - `version_id` — serve a specific version
133
+ * - `rollout` — weighted random across versions; weights must sum to less than
134
+ * 100, with the leftover routing to the main version
135
+ */
136
+ export interface Serve {
137
+ rollout?: Array<Serve.Rollout>;
138
+
139
+ version_id?: string;
140
+ }
141
+
142
+ export namespace Serve {
143
+ /**
144
+ * One slot in a percentage rollout.
145
+ */
146
+ export interface Rollout {
147
+ version_id: string;
148
+
149
+ weight: number;
150
+ }
151
+ }
152
+
153
+ /**
154
+ * A single attribute/operator/values check.
155
+ *
156
+ * A clause matches when the routing context's value for `attribute` satisfies
157
+ * `operator` against any of `values`.
158
+ */
159
+ export interface Match {
160
+ /**
161
+ * Attribute name from the routing context
162
+ */
163
+ attribute: string;
164
+
165
+ /**
166
+ * Match operator
167
+ */
168
+ operator: 'in' | 'not_in' | 'starts_with';
169
+
170
+ values: Array<string>;
171
+ }
172
+ }
114
173
  }
115
174
 
116
175
  /**
117
- * Response model for canary deploy operations.
176
+ * Response shape.
177
+ *
178
+ * Always carries `rules` (canonical).
118
179
  */
119
180
  export interface CanaryDeployResponse {
120
181
  assistant_id: string;
121
182
 
122
183
  created_at: string;
123
184
 
124
- updated_at: string;
185
+ rules: Array<CanaryDeployResponse.Rule>;
125
186
 
126
- versions: Array<VersionConfig>;
187
+ updated_at: string;
127
188
  }
128
189
 
129
- /**
130
- * Configuration for a single version in canary deploy.
131
- */
132
- export interface VersionConfig {
190
+ export namespace CanaryDeployResponse {
133
191
  /**
134
- * Percentage of traffic for this version [1-99]
192
+ * A targeting rule: `match` clauses (AND) gate `serve`.
193
+ *
194
+ * An empty `match` is a catch-all (always fires).
135
195
  */
136
- percentage: number;
196
+ export interface Rule {
197
+ /**
198
+ * What a rule serves when matched.
199
+ *
200
+ * Exactly one of:
201
+ *
202
+ * - `version_id` — serve a specific version
203
+ * - `rollout` — weighted random across versions; weights must sum to less than
204
+ * 100, with the leftover routing to the main version
205
+ */
206
+ serve: Rule.Serve;
137
207
 
138
- /**
139
- * Version ID string that references assistant_versions.version_id
140
- */
141
- version_id: string;
208
+ match?: Array<Rule.Match>;
209
+ }
210
+
211
+ export namespace Rule {
212
+ /**
213
+ * What a rule serves when matched.
214
+ *
215
+ * Exactly one of:
216
+ *
217
+ * - `version_id` — serve a specific version
218
+ * - `rollout` — weighted random across versions; weights must sum to less than
219
+ * 100, with the leftover routing to the main version
220
+ */
221
+ export interface Serve {
222
+ rollout?: Array<Serve.Rollout>;
223
+
224
+ version_id?: string;
225
+ }
226
+
227
+ export namespace Serve {
228
+ /**
229
+ * One slot in a percentage rollout.
230
+ */
231
+ export interface Rollout {
232
+ version_id: string;
233
+
234
+ weight: number;
235
+ }
236
+ }
237
+
238
+ /**
239
+ * A single attribute/operator/values check.
240
+ *
241
+ * A clause matches when the routing context's value for `attribute` satisfies
242
+ * `operator` against any of `values`.
243
+ */
244
+ export interface Match {
245
+ /**
246
+ * Attribute name from the routing context
247
+ */
248
+ attribute: string;
249
+
250
+ /**
251
+ * Match operator
252
+ */
253
+ operator: 'in' | 'not_in' | 'starts_with';
254
+
255
+ values: Array<string>;
256
+ }
257
+ }
142
258
  }
143
259
 
144
260
  export interface CanaryDeployCreateParams {
261
+ rules?: Array<CanaryDeployCreateParams.Rule>;
262
+ }
263
+
264
+ export namespace CanaryDeployCreateParams {
145
265
  /**
146
- * List of version configurations
266
+ * A targeting rule: `match` clauses (AND) gate `serve`.
267
+ *
268
+ * An empty `match` is a catch-all (always fires).
147
269
  */
148
- versions: Array<VersionConfig>;
270
+ export interface Rule {
271
+ /**
272
+ * What a rule serves when matched.
273
+ *
274
+ * Exactly one of:
275
+ *
276
+ * - `version_id` — serve a specific version
277
+ * - `rollout` — weighted random across versions; weights must sum to less than
278
+ * 100, with the leftover routing to the main version
279
+ */
280
+ serve: Rule.Serve;
281
+
282
+ match?: Array<Rule.Match>;
283
+ }
284
+
285
+ export namespace Rule {
286
+ /**
287
+ * What a rule serves when matched.
288
+ *
289
+ * Exactly one of:
290
+ *
291
+ * - `version_id` — serve a specific version
292
+ * - `rollout` — weighted random across versions; weights must sum to less than
293
+ * 100, with the leftover routing to the main version
294
+ */
295
+ export interface Serve {
296
+ rollout?: Array<Serve.Rollout>;
297
+
298
+ version_id?: string;
299
+ }
300
+
301
+ export namespace Serve {
302
+ /**
303
+ * One slot in a percentage rollout.
304
+ */
305
+ export interface Rollout {
306
+ version_id: string;
307
+
308
+ weight: number;
309
+ }
310
+ }
311
+
312
+ /**
313
+ * A single attribute/operator/values check.
314
+ *
315
+ * A clause matches when the routing context's value for `attribute` satisfies
316
+ * `operator` against any of `values`.
317
+ */
318
+ export interface Match {
319
+ /**
320
+ * Attribute name from the routing context
321
+ */
322
+ attribute: string;
323
+
324
+ /**
325
+ * Match operator
326
+ */
327
+ operator: 'in' | 'not_in' | 'starts_with';
328
+
329
+ values: Array<string>;
330
+ }
331
+ }
149
332
  }
150
333
 
151
334
  export interface CanaryDeployUpdateParams {
335
+ rules?: Array<CanaryDeployUpdateParams.Rule>;
336
+ }
337
+
338
+ export namespace CanaryDeployUpdateParams {
152
339
  /**
153
- * List of version configurations
340
+ * A targeting rule: `match` clauses (AND) gate `serve`.
341
+ *
342
+ * An empty `match` is a catch-all (always fires).
154
343
  */
155
- versions: Array<VersionConfig>;
344
+ export interface Rule {
345
+ /**
346
+ * What a rule serves when matched.
347
+ *
348
+ * Exactly one of:
349
+ *
350
+ * - `version_id` — serve a specific version
351
+ * - `rollout` — weighted random across versions; weights must sum to less than
352
+ * 100, with the leftover routing to the main version
353
+ */
354
+ serve: Rule.Serve;
355
+
356
+ match?: Array<Rule.Match>;
357
+ }
358
+
359
+ export namespace Rule {
360
+ /**
361
+ * What a rule serves when matched.
362
+ *
363
+ * Exactly one of:
364
+ *
365
+ * - `version_id` — serve a specific version
366
+ * - `rollout` — weighted random across versions; weights must sum to less than
367
+ * 100, with the leftover routing to the main version
368
+ */
369
+ export interface Serve {
370
+ rollout?: Array<Serve.Rollout>;
371
+
372
+ version_id?: string;
373
+ }
374
+
375
+ export namespace Serve {
376
+ /**
377
+ * One slot in a percentage rollout.
378
+ */
379
+ export interface Rollout {
380
+ version_id: string;
381
+
382
+ weight: number;
383
+ }
384
+ }
385
+
386
+ /**
387
+ * A single attribute/operator/values check.
388
+ *
389
+ * A clause matches when the routing context's value for `attribute` satisfies
390
+ * `operator` against any of `values`.
391
+ */
392
+ export interface Match {
393
+ /**
394
+ * Attribute name from the routing context
395
+ */
396
+ attribute: string;
397
+
398
+ /**
399
+ * Match operator
400
+ */
401
+ operator: 'in' | 'not_in' | 'starts_with';
402
+
403
+ values: Array<string>;
404
+ }
405
+ }
156
406
  }
157
407
 
158
408
  export declare namespace CanaryDeploys {
159
409
  export {
160
410
  type CanaryDeploy as CanaryDeploy,
161
411
  type CanaryDeployResponse as CanaryDeployResponse,
162
- type VersionConfig as VersionConfig,
163
412
  type CanaryDeployCreateParams as CanaryDeployCreateParams,
164
413
  type CanaryDeployUpdateParams as CanaryDeployUpdateParams,
165
414
  };
@@ -46,7 +46,6 @@ export {
46
46
  CanaryDeploys,
47
47
  type CanaryDeploy,
48
48
  type CanaryDeployResponse,
49
- type VersionConfig,
50
49
  type CanaryDeployCreateParams,
51
50
  type CanaryDeployUpdateParams,
52
51
  } from './canary-deploys';
@@ -1242,6 +1242,18 @@ export {
1242
1242
  type TrafficPolicyProfilesDefaultFlatPagination,
1243
1243
  type TrafficPolicyProfileListServicesResponsesDefaultFlatPagination,
1244
1244
  } from './traffic-policy-profiles';
1245
+ export {
1246
+ UacConnections,
1247
+ type UacConnectionCreateResponse,
1248
+ type UacConnectionRetrieveResponse,
1249
+ type UacConnectionUpdateResponse,
1250
+ type UacConnectionListResponse,
1251
+ type UacConnectionDeleteResponse,
1252
+ type UacConnectionCreateParams,
1253
+ type UacConnectionUpdateParams,
1254
+ type UacConnectionListParams,
1255
+ type UacConnectionListResponsesDefaultFlatPagination,
1256
+ } from './uac-connections/uac-connections';
1245
1257
  export {
1246
1258
  UsageReports,
1247
1259
  type UsageReportListResponse,
@@ -0,0 +1,83 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ /**
9
+ * UAC connection operations
10
+ */
11
+ export class Actions extends APIResource {
12
+ /**
13
+ * Checks the registration status for a UAC connection (`registration_status`) as
14
+ * well as the timestamp for the last SIP registration event
15
+ * (`registration_status_updated_at`).
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const response =
20
+ * await client.uacConnections.actions.checkRegistrationStatus(
21
+ * 'id',
22
+ * );
23
+ * ```
24
+ */
25
+ checkRegistrationStatus(
26
+ id: string,
27
+ options?: RequestOptions,
28
+ ): APIPromise<ActionCheckRegistrationStatusResponse> {
29
+ return this._client.post(path`/uac_connections/${id}/actions/check_registration_status`, options);
30
+ }
31
+ }
32
+
33
+ export interface ActionCheckRegistrationStatusResponse {
34
+ data?: ActionCheckRegistrationStatusResponse.Data;
35
+ }
36
+
37
+ export namespace ActionCheckRegistrationStatusResponse {
38
+ export interface Data {
39
+ /**
40
+ * The ip used during the SIP connection
41
+ */
42
+ ip_address?: string;
43
+
44
+ /**
45
+ * ISO 8601 formatted date indicating when the resource was last updated.
46
+ */
47
+ last_registration?: string;
48
+
49
+ /**
50
+ * The port of the SIP connection
51
+ */
52
+ port?: number;
53
+
54
+ /**
55
+ * Identifies the type of the resource.
56
+ */
57
+ record_type?: string;
58
+
59
+ /**
60
+ * The user name of the SIP connection
61
+ */
62
+ sip_username?: string;
63
+
64
+ /**
65
+ * The current registration status of your SIP connection
66
+ */
67
+ status?: 'Not Applicable' | 'Not Registered' | 'Failed' | 'Expired' | 'Registered' | 'Unregistered';
68
+
69
+ /**
70
+ * The protocol of the SIP connection
71
+ */
72
+ transport?: string;
73
+
74
+ /**
75
+ * The user agent of the SIP connection
76
+ */
77
+ user_agent?: string;
78
+ }
79
+ }
80
+
81
+ export declare namespace Actions {
82
+ export { type ActionCheckRegistrationStatusResponse as ActionCheckRegistrationStatusResponse };
83
+ }
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Actions, type ActionCheckRegistrationStatusResponse } from './actions';
4
+ export {
5
+ UacConnections,
6
+ type UacConnectionCreateResponse,
7
+ type UacConnectionRetrieveResponse,
8
+ type UacConnectionUpdateResponse,
9
+ type UacConnectionListResponse,
10
+ type UacConnectionDeleteResponse,
11
+ type UacConnectionCreateParams,
12
+ type UacConnectionUpdateParams,
13
+ type UacConnectionListParams,
14
+ type UacConnectionListResponsesDefaultFlatPagination,
15
+ } from './uac-connections';