telnyx 7.17.0 → 7.19.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 (260) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/webhooks.d.mts +1 -1
  11. package/lib/webhooks.d.mts.map +1 -1
  12. package/lib/webhooks.d.ts +1 -1
  13. package/lib/webhooks.d.ts.map +1 -1
  14. package/lib/webhooks.js +74 -39
  15. package/lib/webhooks.js.map +1 -1
  16. package/lib/webhooks.mjs +52 -17
  17. package/lib/webhooks.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/ai/ai.d.mts +6 -2
  20. package/resources/ai/ai.d.mts.map +1 -1
  21. package/resources/ai/ai.d.ts +6 -2
  22. package/resources/ai/ai.d.ts.map +1 -1
  23. package/resources/ai/ai.js +4 -0
  24. package/resources/ai/ai.js.map +1 -1
  25. package/resources/ai/ai.mjs +4 -0
  26. package/resources/ai/ai.mjs.map +1 -1
  27. package/resources/ai/anthropic/v1.d.mts +4 -3
  28. package/resources/ai/anthropic/v1.d.mts.map +1 -1
  29. package/resources/ai/anthropic/v1.d.ts +4 -3
  30. package/resources/ai/anthropic/v1.d.ts.map +1 -1
  31. package/resources/ai/anthropic/v1.js +1 -1
  32. package/resources/ai/anthropic/v1.mjs +1 -1
  33. package/resources/ai/assistants/assistants.d.mts +124 -18
  34. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  35. package/resources/ai/assistants/assistants.d.ts +124 -18
  36. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  37. package/resources/ai/assistants/assistants.js.map +1 -1
  38. package/resources/ai/assistants/assistants.mjs.map +1 -1
  39. package/resources/ai/chat.d.mts +8 -0
  40. package/resources/ai/chat.d.mts.map +1 -1
  41. package/resources/ai/chat.d.ts +8 -0
  42. package/resources/ai/chat.d.ts.map +1 -1
  43. package/resources/ai/collections/collections.d.mts +1 -102
  44. package/resources/ai/collections/collections.d.mts.map +1 -1
  45. package/resources/ai/collections/collections.d.ts +1 -102
  46. package/resources/ai/collections/collections.d.ts.map +1 -1
  47. package/resources/ai/collections/collections.js +0 -44
  48. package/resources/ai/collections/collections.js.map +1 -1
  49. package/resources/ai/collections/collections.mjs +0 -44
  50. package/resources/ai/collections/collections.mjs.map +1 -1
  51. package/resources/ai/collections/index.d.mts +1 -1
  52. package/resources/ai/collections/index.d.mts.map +1 -1
  53. package/resources/ai/collections/index.d.ts +1 -1
  54. package/resources/ai/collections/index.d.ts.map +1 -1
  55. package/resources/ai/collections/index.js.map +1 -1
  56. package/resources/ai/collections/index.mjs.map +1 -1
  57. package/resources/ai/collections/settings.d.mts +4 -1
  58. package/resources/ai/collections/settings.d.mts.map +1 -1
  59. package/resources/ai/collections/settings.d.ts +4 -1
  60. package/resources/ai/collections/settings.d.ts.map +1 -1
  61. package/resources/ai/index.d.mts +2 -1
  62. package/resources/ai/index.d.mts.map +1 -1
  63. package/resources/ai/index.d.ts +2 -1
  64. package/resources/ai/index.d.ts.map +1 -1
  65. package/resources/ai/index.js +7 -5
  66. package/resources/ai/index.js.map +1 -1
  67. package/resources/ai/index.mjs +1 -0
  68. package/resources/ai/index.mjs.map +1 -1
  69. package/resources/ai/knowledge/collections.d.mts +140 -0
  70. package/resources/ai/knowledge/collections.d.mts.map +1 -0
  71. package/resources/ai/knowledge/collections.d.ts +140 -0
  72. package/resources/ai/knowledge/collections.d.ts.map +1 -0
  73. package/resources/ai/knowledge/collections.js +58 -0
  74. package/resources/ai/knowledge/collections.js.map +1 -0
  75. package/resources/ai/knowledge/collections.mjs +54 -0
  76. package/resources/ai/knowledge/collections.mjs.map +1 -0
  77. package/resources/ai/knowledge/index.d.mts +3 -0
  78. package/resources/ai/knowledge/index.d.mts.map +1 -0
  79. package/resources/ai/knowledge/index.d.ts +3 -0
  80. package/resources/ai/knowledge/index.d.ts.map +1 -0
  81. package/resources/ai/knowledge/index.js +9 -0
  82. package/resources/ai/knowledge/index.js.map +1 -0
  83. package/resources/ai/knowledge/index.mjs +4 -0
  84. package/resources/ai/knowledge/index.mjs.map +1 -0
  85. package/resources/ai/knowledge/knowledge.d.mts +10 -0
  86. package/resources/ai/knowledge/knowledge.d.mts.map +1 -0
  87. package/resources/ai/knowledge/knowledge.d.ts +10 -0
  88. package/resources/ai/knowledge/knowledge.d.ts.map +1 -0
  89. package/resources/ai/knowledge/knowledge.js +17 -0
  90. package/resources/ai/knowledge/knowledge.js.map +1 -0
  91. package/resources/ai/knowledge/knowledge.mjs +12 -0
  92. package/resources/ai/knowledge/knowledge.mjs.map +1 -0
  93. package/resources/ai/knowledge.d.mts +2 -0
  94. package/resources/ai/knowledge.d.mts.map +1 -0
  95. package/resources/ai/knowledge.d.ts +2 -0
  96. package/resources/ai/knowledge.d.ts.map +1 -0
  97. package/resources/ai/knowledge.js +6 -0
  98. package/resources/ai/knowledge.js.map +1 -0
  99. package/resources/ai/knowledge.mjs +3 -0
  100. package/resources/ai/knowledge.mjs.map +1 -0
  101. package/resources/ai/openai/chat.d.mts +8 -0
  102. package/resources/ai/openai/chat.d.mts.map +1 -1
  103. package/resources/ai/openai/chat.d.ts +8 -0
  104. package/resources/ai/openai/chat.d.ts.map +1 -1
  105. package/resources/ai/openai/openai.d.mts +10 -0
  106. package/resources/ai/openai/openai.d.mts.map +1 -1
  107. package/resources/ai/openai/openai.d.ts +10 -0
  108. package/resources/ai/openai/openai.d.ts.map +1 -1
  109. package/resources/ai/openai/openai.js.map +1 -1
  110. package/resources/ai/openai/openai.mjs.map +1 -1
  111. package/resources/calls/actions.d.mts +35 -12
  112. package/resources/calls/actions.d.mts.map +1 -1
  113. package/resources/calls/actions.d.ts +35 -12
  114. package/resources/calls/actions.d.ts.map +1 -1
  115. package/resources/calls/calls.d.mts +2 -2
  116. package/resources/calls/calls.d.mts.map +1 -1
  117. package/resources/calls/calls.d.ts +2 -2
  118. package/resources/calls/calls.d.ts.map +1 -1
  119. package/resources/calls/calls.js.map +1 -1
  120. package/resources/calls/calls.mjs.map +1 -1
  121. package/resources/calls/index.d.mts +1 -1
  122. package/resources/calls/index.d.mts.map +1 -1
  123. package/resources/calls/index.d.ts +1 -1
  124. package/resources/calls/index.d.ts.map +1 -1
  125. package/resources/calls/index.js.map +1 -1
  126. package/resources/calls/index.mjs.map +1 -1
  127. package/resources/conferences/actions.d.mts +3 -1
  128. package/resources/conferences/actions.d.mts.map +1 -1
  129. package/resources/conferences/actions.d.ts +3 -1
  130. package/resources/conferences/actions.d.ts.map +1 -1
  131. package/resources/credential-connections/credential-connections.d.mts +2 -2
  132. package/resources/credential-connections/credential-connections.d.ts +2 -2
  133. package/resources/external-requirements/external-requirements.d.mts +10 -0
  134. package/resources/external-requirements/external-requirements.d.mts.map +1 -0
  135. package/resources/external-requirements/external-requirements.d.ts +10 -0
  136. package/resources/external-requirements/external-requirements.d.ts.map +1 -0
  137. package/resources/external-requirements/external-requirements.js +17 -0
  138. package/resources/external-requirements/external-requirements.js.map +1 -0
  139. package/resources/external-requirements/external-requirements.mjs +12 -0
  140. package/resources/external-requirements/external-requirements.mjs.map +1 -0
  141. package/resources/external-requirements/index.d.mts +3 -0
  142. package/resources/external-requirements/index.d.mts.map +1 -0
  143. package/resources/external-requirements/index.d.ts +3 -0
  144. package/resources/external-requirements/index.d.ts.map +1 -0
  145. package/resources/external-requirements/index.js +9 -0
  146. package/resources/external-requirements/index.js.map +1 -0
  147. package/resources/external-requirements/index.mjs +4 -0
  148. package/resources/external-requirements/index.mjs.map +1 -0
  149. package/resources/external-requirements/sub-number-orders.d.mts +151 -0
  150. package/resources/external-requirements/sub-number-orders.d.mts.map +1 -0
  151. package/resources/external-requirements/sub-number-orders.d.ts +151 -0
  152. package/resources/external-requirements/sub-number-orders.d.ts.map +1 -0
  153. package/resources/external-requirements/sub-number-orders.js +61 -0
  154. package/resources/external-requirements/sub-number-orders.js.map +1 -0
  155. package/resources/external-requirements/sub-number-orders.mjs +57 -0
  156. package/resources/external-requirements/sub-number-orders.mjs.map +1 -0
  157. package/resources/external-requirements.d.mts +2 -0
  158. package/resources/external-requirements.d.mts.map +1 -0
  159. package/resources/external-requirements.d.ts +2 -0
  160. package/resources/external-requirements.d.ts.map +1 -0
  161. package/resources/external-requirements.js +6 -0
  162. package/resources/external-requirements.js.map +1 -0
  163. package/resources/external-requirements.mjs +3 -0
  164. package/resources/external-requirements.mjs.map +1 -0
  165. package/resources/index.d.mts +2 -1
  166. package/resources/index.d.mts.map +1 -1
  167. package/resources/index.d.ts +2 -1
  168. package/resources/index.d.ts.map +1 -1
  169. package/resources/index.js +6 -4
  170. package/resources/index.js.map +1 -1
  171. package/resources/index.mjs +1 -0
  172. package/resources/index.mjs.map +1 -1
  173. package/resources/outbound-voice-profiles.d.mts +30 -30
  174. package/resources/outbound-voice-profiles.d.ts +30 -30
  175. package/resources/phone-numbers/jobs.d.mts +21 -4
  176. package/resources/phone-numbers/jobs.d.mts.map +1 -1
  177. package/resources/phone-numbers/jobs.d.ts +21 -4
  178. package/resources/phone-numbers/jobs.d.ts.map +1 -1
  179. package/resources/phone-numbers/jobs.js +4 -2
  180. package/resources/phone-numbers/jobs.js.map +1 -1
  181. package/resources/phone-numbers/jobs.mjs +4 -2
  182. package/resources/phone-numbers/jobs.mjs.map +1 -1
  183. package/resources/sim-card-groups/actions.d.mts +10 -4
  184. package/resources/sim-card-groups/actions.d.mts.map +1 -1
  185. package/resources/sim-card-groups/actions.d.ts +10 -4
  186. package/resources/sim-card-groups/actions.d.ts.map +1 -1
  187. package/resources/sim-card-groups/actions.js +6 -4
  188. package/resources/sim-card-groups/actions.js.map +1 -1
  189. package/resources/sim-card-groups/actions.mjs +6 -4
  190. package/resources/sim-card-groups/actions.mjs.map +1 -1
  191. package/resources/speech-to-text/speech-to-text.d.mts +20 -10
  192. package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
  193. package/resources/speech-to-text/speech-to-text.d.ts +20 -10
  194. package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
  195. package/resources/speech-to-text/speech-to-text.js +3 -2
  196. package/resources/speech-to-text/speech-to-text.js.map +1 -1
  197. package/resources/speech-to-text/speech-to-text.mjs +3 -2
  198. package/resources/speech-to-text/speech-to-text.mjs.map +1 -1
  199. package/resources/webhooks.d.mts +4 -3
  200. package/resources/webhooks.d.mts.map +1 -1
  201. package/resources/webhooks.d.ts +4 -3
  202. package/resources/webhooks.d.ts.map +1 -1
  203. package/resources/webhooks.js +4 -11
  204. package/resources/webhooks.js.map +1 -1
  205. package/resources/webhooks.mjs +4 -11
  206. package/resources/webhooks.mjs.map +1 -1
  207. package/resources/wireless-blocklist-values.d.mts +6 -19
  208. package/resources/wireless-blocklist-values.d.mts.map +1 -1
  209. package/resources/wireless-blocklist-values.d.ts +6 -19
  210. package/resources/wireless-blocklist-values.d.ts.map +1 -1
  211. package/resources/wireless-blocklist-values.js +2 -1
  212. package/resources/wireless-blocklist-values.js.map +1 -1
  213. package/resources/wireless-blocklist-values.mjs +2 -1
  214. package/resources/wireless-blocklist-values.mjs.map +1 -1
  215. package/resources/wireless-blocklists.d.mts +40 -20
  216. package/resources/wireless-blocklists.d.mts.map +1 -1
  217. package/resources/wireless-blocklists.d.ts +40 -20
  218. package/resources/wireless-blocklists.d.ts.map +1 -1
  219. package/resources/wireless-blocklists.js +12 -7
  220. package/resources/wireless-blocklists.js.map +1 -1
  221. package/resources/wireless-blocklists.mjs +12 -7
  222. package/resources/wireless-blocklists.mjs.map +1 -1
  223. package/src/client.ts +9 -4
  224. package/src/lib/webhooks.ts +59 -18
  225. package/src/resources/ai/ai.ts +6 -6
  226. package/src/resources/ai/anthropic/v1.ts +4 -3
  227. package/src/resources/ai/assistants/assistants.ts +130 -17
  228. package/src/resources/ai/chat.ts +9 -0
  229. package/src/resources/ai/collections/collections.ts +0 -134
  230. package/src/resources/ai/collections/index.ts +0 -3
  231. package/src/resources/ai/collections/settings.ts +4 -1
  232. package/src/resources/ai/index.ts +1 -3
  233. package/src/resources/ai/knowledge/collections.ts +179 -0
  234. package/src/resources/ai/knowledge/index.ts +8 -0
  235. package/src/resources/ai/knowledge/knowledge.ts +23 -0
  236. package/src/resources/ai/knowledge.ts +3 -0
  237. package/src/resources/ai/openai/chat.ts +9 -0
  238. package/src/resources/ai/openai/openai.ts +12 -0
  239. package/src/resources/calls/actions.ts +38 -6
  240. package/src/resources/calls/calls.ts +2 -0
  241. package/src/resources/calls/index.ts +1 -0
  242. package/src/resources/conferences/actions.ts +3 -1
  243. package/src/resources/credential-connections/credential-connections.ts +2 -2
  244. package/src/resources/external-requirements/external-requirements.ts +27 -0
  245. package/src/resources/external-requirements/index.ts +10 -0
  246. package/src/resources/external-requirements/sub-number-orders.ts +202 -0
  247. package/src/resources/external-requirements.ts +3 -0
  248. package/src/resources/index.ts +3 -2
  249. package/src/resources/outbound-voice-profiles.ts +30 -30
  250. package/src/resources/phone-numbers/jobs.ts +23 -4
  251. package/src/resources/sim-card-groups/actions.ts +11 -4
  252. package/src/resources/speech-to-text/speech-to-text.ts +23 -9
  253. package/src/resources/webhooks.ts +8 -13
  254. package/src/resources/wireless-blocklist-values.ts +6 -23
  255. package/src/resources/wireless-blocklists.ts +54 -25
  256. package/src/version.ts +1 -1
  257. package/version.d.mts +1 -1
  258. package/version.d.ts +1 -1
  259. package/version.js +1 -1
  260. package/version.mjs +1 -1
@@ -14,8 +14,10 @@ import { path } from '../../internal/utils/path';
14
14
  */
15
15
  export class Jobs extends APIResource {
16
16
  /**
17
- * Returns background jobs that operate on phone numbers. Results can be filtered
18
- * by job type and sorted by creation time, and include pagination metadata.
17
+ * Returns background jobs that operate on phone numbers. Filter by job type,
18
+ * target phone numbers, or job status, and sort by creation time. Multiple
19
+ * phone-number or status values use OR semantics within that filter; different
20
+ * filter categories use AND semantics. Results include pagination metadata.
19
21
  *
20
22
  * @example
21
23
  * ```ts
@@ -239,7 +241,8 @@ export interface JobUpdateEmergencySettingsBatchResponse {
239
241
 
240
242
  export interface JobListParams extends DefaultFlatPaginationParams {
241
243
  /**
242
- * Consolidated filter parameter (deepObject style). Originally: filter[type]
244
+ * Consolidated filter parameter (deepObject style). Originally: filter[type],
245
+ * filter[phone_number], filter[phone_number][], filter[status][]
243
246
  */
244
247
  filter?: JobListParams.Filter;
245
248
 
@@ -252,9 +255,25 @@ export interface JobListParams extends DefaultFlatPaginationParams {
252
255
 
253
256
  export namespace JobListParams {
254
257
  /**
255
- * Consolidated filter parameter (deepObject style). Originally: filter[type]
258
+ * Consolidated filter parameter (deepObject style). Originally: filter[type],
259
+ * filter[phone_number], filter[phone_number][], filter[status][]
256
260
  */
257
261
  export interface Filter {
262
+ /**
263
+ * Returns jobs that targeted any of the supplied account-owned phone numbers.
264
+ * Values beginning with `+` must contain 1 to 20 digits after the plus sign. The
265
+ * 10-value limit is enforced before duplicate values are removed. Unmatched or
266
+ * non-account-owned identifiers return an empty result. Phone-number filtering
267
+ * must be enabled for the account.
268
+ */
269
+ phone_number?: string | Array<string>;
270
+
271
+ /**
272
+ * Returns jobs with any of the supplied statuses. Use repeated `filter[status][]`
273
+ * parameters; scalar and comma-separated status values are not accepted.
274
+ */
275
+ status?: Array<'pending' | 'in_progress' | 'completed' | 'failed' | 'expired'>;
276
+
258
277
  /**
259
278
  * Identifies the type of the background job.
260
279
  */
@@ -67,8 +67,9 @@ export class Actions extends APIResource {
67
67
  }
68
68
 
69
69
  /**
70
- * This action will asynchronously remove an existing Wireless Blocklist to all the
71
- * SIMs in the SIM card group.
70
+ * This action asynchronously removes the Wireless Blocklist assigned to a SIM Card
71
+ * Group. The request returns `404` when the SIM Card Group does not exist and
72
+ * `422` when no Wireless Blocklist is assigned.
72
73
  *
73
74
  * @example
74
75
  * ```ts
@@ -118,8 +119,9 @@ export class Actions extends APIResource {
118
119
  }
119
120
 
120
121
  /**
121
- * This action will asynchronously assign a Wireless Blocklist to all the SIMs in
122
- * the SIM card group.
122
+ * This action asynchronously assigns a Wireless Blocklist to all SIMs in the SIM
123
+ * Card Group. The request returns `404` when the SIM Card Group does not exist and
124
+ * `422` when the Wireless Blocklist does not exist.
123
125
  *
124
126
  * @example
125
127
  * ```ts
@@ -201,6 +203,11 @@ export namespace SimCardGroupAction {
201
203
  * The identification of the related Private Wireless Gateway resource.
202
204
  */
203
205
  private_wireless_gateway_id?: string;
206
+
207
+ /**
208
+ * The identification of the related Wireless Blocklist resource.
209
+ */
210
+ wireless_blocklist_id?: string;
204
211
  }
205
212
  }
206
213
 
@@ -43,13 +43,14 @@ export class SpeechToText extends APIResource {
43
43
  * `Authorization: Bearer <API_KEY>` header.
44
44
  *
45
45
  * Supported engines: `Azure`, `Deepgram`, `Google`, `Telnyx`, `xAI`,
46
- * `Speechmatics`, `Soniox`, `Parakeet`, `Humain`, `Reson8`.
46
+ * `Speechmatics`, `Soniox`, `Parakeet`, `Humain`, `Reson8`, `Cohere`.
47
47
  *
48
48
  * **Connection flow:**
49
49
  *
50
50
  * 1. Open WebSocket with query parameters specifying engine, input format, and
51
51
  * language.
52
- * 2. Send binary audio frames (mp3/wav format).
52
+ * 2. Send binary audio frames (mp3, wav, linear16, or linear32 format, per
53
+ * `input_format`).
53
54
  * 3. Receive JSON transcript frames with `transcript`, `is_final`, and
54
55
  * `confidence` fields.
55
56
  * 4. Close connection when done.
@@ -76,7 +77,7 @@ export class SpeechToText extends APIResource {
76
77
  export type SttServiceType = 'streaming' | 'file_based' | 'in_call' | 'ai_assistant';
77
78
 
78
79
  /**
79
- * Binary audio data in mp3 or wav format.
80
+ * Binary audio data in mp3, wav, linear16, or linear32 format, per `input_format`.
80
81
  */
81
82
  export type TranscribeClientEvent = Uploadable;
82
83
 
@@ -103,9 +104,10 @@ export namespace TranscribeServerEvent {
103
104
  type: 'transcript';
104
105
 
105
106
  /**
106
- * Confidence score of the transcription, ranging from 0 to 1.
107
+ * Confidence score of the transcription, ranging from 0 to 1. `cohere/ar-stt`
108
+ * frames return `null` here rather than omitting the field.
107
109
  */
108
- confidence?: number;
110
+ confidence?: number | null;
109
111
 
110
112
  /**
111
113
  * Whether this is a final transcription result. When `false`, this is an interim
@@ -219,6 +221,7 @@ export interface SpeechToTextListProvidersParams {
219
221
  | 'parakeet'
220
222
  | 'humain'
221
223
  | 'reson8'
224
+ | 'cohere'
222
225
  | 'azure'
223
226
  | 'openai'
224
227
  | 'google'
@@ -239,7 +242,7 @@ export interface SpeechToTextRetrieveTranscriptionParams {
239
242
  /**
240
243
  * The format of input audio stream.
241
244
  */
242
- input_format: 'mp3' | 'wav';
245
+ input_format: 'mp3' | 'wav' | 'linear16' | 'linear32';
243
246
 
244
247
  /**
245
248
  * The transcription engine to use for processing the audio stream.
@@ -254,7 +257,8 @@ export interface SpeechToTextRetrieveTranscriptionParams {
254
257
  | 'Soniox'
255
258
  | 'Parakeet'
256
259
  | 'Humain'
257
- | 'Reson8';
260
+ | 'Reson8'
261
+ | 'Cohere';
258
262
 
259
263
  /**
260
264
  * Silence duration (in milliseconds) that triggers end-of-speech detection. When
@@ -283,7 +287,9 @@ export interface SpeechToTextRetrieveTranscriptionParams {
283
287
  keywords?: string;
284
288
 
285
289
  /**
286
- * The language spoken in the audio stream.
290
+ * The language spoken in the audio stream. For `cohere/ar-stt`, this must be `ar`
291
+ * or `en` — unlike other engines, Cohere does not auto-detect the language, and
292
+ * rejects unsupported values including `auto`; omitting it defaults to `ar`.
287
293
  */
288
294
  language?: string;
289
295
 
@@ -309,13 +315,21 @@ export interface SpeechToTextRetrieveTranscriptionParams {
309
315
  | 'soniox/stt-rt-v4'
310
316
  | 'nvidia/parakeet-v3'
311
317
  | 'humain/realtime'
312
- | 'reson8/turns';
318
+ | 'reson8/turns'
319
+ | 'cohere/ar-stt';
313
320
 
314
321
  /**
315
322
  * Enable redaction of sensitive information (e.g., PCI data, SSN) from
316
323
  * transcription results. Supported values depend on the transcription engine.
317
324
  */
318
325
  redact?: string;
326
+
327
+ /**
328
+ * Audio sample rate in Hz. Required when `input_format` is a raw encoding
329
+ * (`linear16`, `linear32`) — those formats carry no header metadata. Ignored for
330
+ * container formats (`mp3`, `wav`), which self-describe their rate.
331
+ */
332
+ sample_rate?: number;
319
333
  }
320
334
 
321
335
  export declare namespace SpeechToText {
@@ -6,25 +6,19 @@ import * as NumberOrdersAPI from './number-orders';
6
6
  import * as CallsAPI from './calls/calls';
7
7
  import * as MessagesAPI from './messages/messages';
8
8
  import * as ThreadsAPI from './email-inboxes/threads/threads';
9
- import { Webhook } from 'standardwebhooks';
10
9
  import { EmailBracketCursorPagination } from '../core/pagination';
10
+ import { unsafeUnwrapWebhook, unwrapWebhook } from '../lib/webhooks';
11
11
 
12
12
  export class Webhooks extends APIResource {
13
- unwrap(
13
+ async unwrap(
14
14
  body: string,
15
15
  { headers, key }: { headers: Record<string, string>; key?: string },
16
- ): UnwrapWebhookEvent {
17
- if (headers !== undefined) {
18
- const keyStr: string | null = key === undefined ? this._client.publicKey : key;
19
- if (keyStr === null) throw new Error('Webhook key must not be null in order to unwrap');
20
- const wh = new Webhook(keyStr);
21
- wh.verify(body, headers);
22
- }
23
- return JSON.parse(body) as UnwrapWebhookEvent;
16
+ ): Promise<UnwrapWebhookEvent> {
17
+ return unwrapWebhook<UnwrapWebhookEvent>(body, { headers, key }, this._client.publicKey);
24
18
  }
25
19
 
26
20
  unsafeUnwrap(body: string): UnsafeUnwrapWebhookEvent {
27
- return JSON.parse(body) as UnsafeUnwrapWebhookEvent;
21
+ return unsafeUnwrapWebhook<UnsafeUnwrapWebhookEvent>(body);
28
22
  }
29
23
  }
30
24
 
@@ -4482,9 +4476,10 @@ export namespace Transcription {
4482
4476
  export namespace Payload {
4483
4477
  export interface TranscriptionData {
4484
4478
  /**
4485
- * Speech recognition confidence level.
4479
+ * Speech recognition confidence level. `cohere/ar-stt` returns `null` here rather
4480
+ * than omitting the field.
4486
4481
  */
4487
- confidence?: number;
4482
+ confidence?: number | null;
4488
4483
 
4489
4484
  /**
4490
4485
  * When false, it means that this is an interim result.
@@ -1,7 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
- import * as AuthenticationProvidersAPI from './authentication-providers';
5
4
  import { APIPromise } from '../core/api-promise';
6
5
  import { RequestOptions } from '../internal/request-options';
7
6
 
@@ -10,7 +9,8 @@ import { RequestOptions } from '../internal/request-options';
10
9
  */
11
10
  export class WirelessBlocklistValues extends APIResource {
12
11
  /**
13
- * Retrieve all wireless blocklist values for a given blocklist type.
12
+ * Retrieve all wireless blocklist values for a given blocklist type. The request
13
+ * returns `422` when `type` is missing or invalid.
14
14
  */
15
15
  list(
16
16
  query: WirelessBlocklistValueListParams,
@@ -21,12 +21,10 @@ export class WirelessBlocklistValues extends APIResource {
21
21
  }
22
22
 
23
23
  export interface WirelessBlocklistValueListResponse {
24
- data?:
24
+ data:
25
25
  | Array<WirelessBlocklistValueListResponse.Country>
26
26
  | Array<WirelessBlocklistValueListResponse.Mcc>
27
27
  | Array<WirelessBlocklistValueListResponse.Plmn>;
28
-
29
- meta?: AuthenticationProvidersAPI.PaginationMeta;
30
28
  }
31
29
 
32
30
  export namespace WirelessBlocklistValueListResponse {
@@ -34,36 +32,21 @@ export namespace WirelessBlocklistValueListResponse {
34
32
  /**
35
33
  * ISO 3166-1 Alpha-2 Country Code.
36
34
  */
37
- code: string;
38
-
39
- /**
40
- * The name of the country.
41
- */
42
- name: string;
35
+ country_code: string;
43
36
  }
44
37
 
45
38
  export interface Mcc {
46
39
  /**
47
40
  * Mobile Country Code.
48
41
  */
49
- code: string;
50
-
51
- /**
52
- * The name of the country.
53
- */
54
- name: string;
42
+ mcc: string;
55
43
  }
56
44
 
57
45
  export interface Plmn {
58
46
  /**
59
47
  * Public land mobile network code (MCC + MNC).
60
48
  */
61
- code: string;
62
-
63
- /**
64
- * The name of the network.
65
- */
66
- name: string;
49
+ plmn: string;
67
50
  }
68
51
  }
69
52
 
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { DefaultFlatPagination, type DefaultFlatPaginationParams, PagePromise } from '../core/pagination';
6
+ import { buildHeaders } from '../internal/headers';
6
7
  import { RequestOptions } from '../internal/request-options';
7
8
  import { path } from '../internal/utils/path';
8
9
 
@@ -16,7 +17,7 @@ export class WirelessBlocklists extends APIResource {
16
17
  * @example
17
18
  * ```ts
18
19
  * // Automatically fetches more pages as needed.
19
- * for await (const wirelessBlocklist of client.wirelessBlocklists.list()) {
20
+ * for await (const wirelessWirelessBlocklist of client.wirelessBlocklists.list()) {
20
21
  * // ...
21
22
  * }
22
23
  * ```
@@ -24,8 +25,8 @@ export class WirelessBlocklists extends APIResource {
24
25
  list(
25
26
  query: WirelessBlocklistListParams | null | undefined = {},
26
27
  options?: RequestOptions,
27
- ): PagePromise<WirelessBlocklistsDefaultFlatPagination, WirelessBlocklist> {
28
- return this._client.getAPIList('/wireless_blocklists', DefaultFlatPagination<WirelessBlocklist>, {
28
+ ): PagePromise<WirelessWirelessBlocklistsDefaultFlatPagination, WirelessWirelessBlocklist> {
29
+ return this._client.getAPIList('/wireless_blocklists', DefaultFlatPagination<WirelessWirelessBlocklist>, {
29
30
  query,
30
31
  ...options,
31
32
  });
@@ -72,18 +73,22 @@ export class WirelessBlocklists extends APIResource {
72
73
  }
73
74
 
74
75
  /**
75
- * Permanently deletes the specified wireless blocklist from your account.
76
+ * Permanently deletes the specified wireless blocklist from your account. The
77
+ * request returns `422` when the wireless blocklist is assigned to a SIM Card
78
+ * Group.
76
79
  *
77
80
  * @example
78
81
  * ```ts
79
- * const wirelessBlocklist =
80
- * await client.wirelessBlocklists.delete(
81
- * '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
82
- * );
82
+ * await client.wirelessBlocklists.delete(
83
+ * '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
84
+ * );
83
85
  * ```
84
86
  */
85
- delete(id: string, options?: RequestOptions): APIPromise<WirelessBlocklistDeleteResponse> {
86
- return this._client.delete(path`/wireless_blocklists/${id}`, options);
87
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
88
+ return this._client.delete(path`/wireless_blocklists/${id}`, {
89
+ ...options,
90
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
91
+ });
87
92
  }
88
93
 
89
94
  /**
@@ -102,7 +107,8 @@ export class WirelessBlocklists extends APIResource {
102
107
  }
103
108
  }
104
109
 
105
- export type WirelessBlocklistsDefaultFlatPagination = DefaultFlatPagination<WirelessBlocklist>;
110
+ export type WirelessWirelessBlocklistsDefaultFlatPagination =
111
+ DefaultFlatPagination<WirelessWirelessBlocklist>;
106
112
 
107
113
  export interface WirelessBlocklist {
108
114
  /**
@@ -138,20 +144,48 @@ export interface WirelessBlocklist {
138
144
  values?: Array<string>;
139
145
  }
140
146
 
147
+ export interface WirelessWirelessBlocklist {
148
+ /**
149
+ * Identifies the resource.
150
+ */
151
+ id?: string;
152
+
153
+ /**
154
+ * ISO 8601 formatted date-time indicating when the resource was created.
155
+ */
156
+ created_at?: string;
157
+
158
+ /**
159
+ * The wireless blocklist name.
160
+ */
161
+ name?: string;
162
+
163
+ /**
164
+ * The type of the wireless blocklist.
165
+ */
166
+ type?: 'country' | 'mcc' | 'plmn';
167
+
168
+ /**
169
+ * ISO 8601 formatted date-time indicating when the resource was updated.
170
+ */
171
+ updated_at?: string;
172
+
173
+ /**
174
+ * Values to block. The values here depend on the `type` of Wireless Blocklist.
175
+ */
176
+ values?: Array<string>;
177
+ }
178
+
141
179
  export interface WirelessBlocklistCreateResponse {
142
- data?: WirelessBlocklist;
180
+ data?: WirelessWirelessBlocklist;
143
181
  }
144
182
 
145
183
  export interface WirelessBlocklistRetrieveResponse {
146
- data?: WirelessBlocklist;
184
+ data?: WirelessWirelessBlocklist;
147
185
  }
148
186
 
149
187
  export interface WirelessBlocklistUpdateResponse {
150
- data?: WirelessBlocklist;
151
- }
152
-
153
- export interface WirelessBlocklistDeleteResponse {
154
- data?: WirelessBlocklist;
188
+ data?: WirelessWirelessBlocklist;
155
189
  }
156
190
 
157
191
  export interface WirelessBlocklistListParams extends DefaultFlatPaginationParams {
@@ -164,11 +198,6 @@ export interface WirelessBlocklistListParams extends DefaultFlatPaginationParams
164
198
  * When the Private Wireless Gateway was last updated.
165
199
  */
166
200
  'filter[type]'?: string;
167
-
168
- /**
169
- * Values to filter on (inclusive).
170
- */
171
- 'filter[values]'?: string;
172
201
  }
173
202
 
174
203
  export interface WirelessBlocklistUpdateParams {
@@ -203,11 +232,11 @@ export interface WirelessBlocklistCreateParams {
203
232
  export declare namespace WirelessBlocklists {
204
233
  export {
205
234
  type WirelessBlocklist as WirelessBlocklist,
235
+ type WirelessWirelessBlocklist as WirelessWirelessBlocklist,
206
236
  type WirelessBlocklistCreateResponse as WirelessBlocklistCreateResponse,
207
237
  type WirelessBlocklistRetrieveResponse as WirelessBlocklistRetrieveResponse,
208
238
  type WirelessBlocklistUpdateResponse as WirelessBlocklistUpdateResponse,
209
- type WirelessBlocklistDeleteResponse as WirelessBlocklistDeleteResponse,
210
- type WirelessBlocklistsDefaultFlatPagination as WirelessBlocklistsDefaultFlatPagination,
239
+ type WirelessWirelessBlocklistsDefaultFlatPagination as WirelessWirelessBlocklistsDefaultFlatPagination,
211
240
  type WirelessBlocklistListParams as WirelessBlocklistListParams,
212
241
  type WirelessBlocklistUpdateParams as WirelessBlocklistUpdateParams,
213
242
  type WirelessBlocklistCreateParams as WirelessBlocklistCreateParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.17.0'; // x-release-please-version
1
+ export const VERSION = '7.19.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.17.0";
1
+ export declare const VERSION = "7.19.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.17.0";
1
+ export declare const VERSION = "7.19.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 = '7.17.0'; // x-release-please-version
4
+ exports.VERSION = '7.19.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '7.17.0'; // x-release-please-version
1
+ export const VERSION = '7.19.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map