@sentdm/sentdm 0.41.0 → 0.42.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 (111) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +18 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +18 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +13 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +13 -0
  9. package/client.mjs.map +1 -1
  10. package/core/pagination.d.mts +25 -0
  11. package/core/pagination.d.mts.map +1 -1
  12. package/core/pagination.d.ts +25 -0
  13. package/core/pagination.d.ts.map +1 -1
  14. package/core/pagination.js +28 -1
  15. package/core/pagination.js.map +1 -1
  16. package/core/pagination.mjs +26 -0
  17. package/core/pagination.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/calls/calls.d.mts +386 -0
  20. package/resources/calls/calls.d.mts.map +1 -0
  21. package/resources/calls/calls.d.ts +386 -0
  22. package/resources/calls/calls.d.ts.map +1 -0
  23. package/resources/calls/calls.js +158 -0
  24. package/resources/calls/calls.js.map +1 -0
  25. package/resources/calls/calls.mjs +153 -0
  26. package/resources/calls/calls.mjs.map +1 -0
  27. package/resources/calls/index.d.mts +3 -0
  28. package/resources/calls/index.d.mts.map +1 -0
  29. package/resources/calls/index.d.ts +3 -0
  30. package/resources/calls/index.d.ts.map +1 -0
  31. package/resources/calls/index.js +9 -0
  32. package/resources/calls/index.js.map +1 -0
  33. package/resources/calls/index.mjs +4 -0
  34. package/resources/calls/index.mjs.map +1 -0
  35. package/resources/calls/participants.d.mts +258 -0
  36. package/resources/calls/participants.d.mts.map +1 -0
  37. package/resources/calls/participants.d.ts +258 -0
  38. package/resources/calls/participants.d.ts.map +1 -0
  39. package/resources/calls/participants.js +158 -0
  40. package/resources/calls/participants.js.map +1 -0
  41. package/resources/calls/participants.mjs +154 -0
  42. package/resources/calls/participants.mjs.map +1 -0
  43. package/resources/calls.d.mts +2 -0
  44. package/resources/calls.d.mts.map +1 -0
  45. package/resources/calls.d.ts +2 -0
  46. package/resources/calls.d.ts.map +1 -0
  47. package/resources/calls.js +6 -0
  48. package/resources/calls.js.map +1 -0
  49. package/resources/calls.mjs +3 -0
  50. package/resources/calls.mjs.map +1 -0
  51. package/resources/channels/channels.d.mts +10 -0
  52. package/resources/channels/channels.d.mts.map +1 -0
  53. package/resources/channels/channels.d.ts +10 -0
  54. package/resources/channels/channels.d.ts.map +1 -0
  55. package/resources/channels/channels.js +17 -0
  56. package/resources/channels/channels.js.map +1 -0
  57. package/resources/channels/channels.mjs +12 -0
  58. package/resources/channels/channels.mjs.map +1 -0
  59. package/resources/channels/index.d.mts +3 -0
  60. package/resources/channels/index.d.mts.map +1 -0
  61. package/resources/channels/index.d.ts +3 -0
  62. package/resources/channels/index.d.ts.map +1 -0
  63. package/resources/channels/index.js +9 -0
  64. package/resources/channels/index.js.map +1 -0
  65. package/resources/channels/index.mjs +4 -0
  66. package/resources/channels/index.mjs.map +1 -0
  67. package/resources/channels/voice.d.mts +654 -0
  68. package/resources/channels/voice.d.mts.map +1 -0
  69. package/resources/channels/voice.d.ts +654 -0
  70. package/resources/channels/voice.d.ts.map +1 -0
  71. package/resources/channels/voice.js +285 -0
  72. package/resources/channels/voice.js.map +1 -0
  73. package/resources/channels/voice.mjs +281 -0
  74. package/resources/channels/voice.mjs.map +1 -0
  75. package/resources/channels.d.mts +2 -0
  76. package/resources/channels.d.mts.map +1 -0
  77. package/resources/channels.d.ts +2 -0
  78. package/resources/channels.d.ts.map +1 -0
  79. package/resources/channels.js +6 -0
  80. package/resources/channels.js.map +1 -0
  81. package/resources/channels.mjs +3 -0
  82. package/resources/channels.mjs.map +1 -0
  83. package/resources/index.d.mts +3 -1
  84. package/resources/index.d.mts.map +1 -1
  85. package/resources/index.d.ts +3 -1
  86. package/resources/index.d.ts.map +1 -1
  87. package/resources/index.js +5 -1
  88. package/resources/index.js.map +1 -1
  89. package/resources/index.mjs +2 -0
  90. package/resources/index.mjs.map +1 -1
  91. package/resources/webhooks.d.mts +104 -106
  92. package/resources/webhooks.d.mts.map +1 -1
  93. package/resources/webhooks.d.ts +104 -106
  94. package/resources/webhooks.d.ts.map +1 -1
  95. package/src/client.ts +60 -0
  96. package/src/core/pagination.ts +59 -0
  97. package/src/resources/calls/calls.ts +554 -0
  98. package/src/resources/calls/index.ts +31 -0
  99. package/src/resources/calls/participants.ts +367 -0
  100. package/src/resources/calls.ts +3 -0
  101. package/src/resources/channels/channels.ts +61 -0
  102. package/src/resources/channels/index.ts +27 -0
  103. package/src/resources/channels/voice.ts +864 -0
  104. package/src/resources/channels.ts +3 -0
  105. package/src/resources/index.ts +21 -0
  106. package/src/resources/webhooks.ts +119 -119
  107. package/src/version.ts +1 -1
  108. package/version.d.mts +1 -1
  109. package/version.d.ts +1 -1
  110. package/version.js +1 -1
  111. package/version.mjs +1 -1
@@ -0,0 +1,654 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as WebhooksAPI from "../webhooks.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ /**
6
+ * The senders you send from, one per channel.
7
+ *
8
+ * **SMS is a list of markets**, each keyed by `(country, number_type)` — a customer can hold `us/10dlc` and `gb/alphanumeric` at once, so a market is addressed by the pair rather than by country alone. **WhatsApp and RCS are single**: a customer has one business account and one agent. **Voice is per number**: each number you hold can carry phone calls on its own (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do with its calls, one of them is the default line for calls placed from your app, and voice tokens are minted under `POST /v3/channels/voice/tokens`. Read your voice numbers with `GET /v3/channels/voice` and change one with `PATCH /v3/channels/voice/{number}`.
9
+ *
10
+ * ## Compliance lives on the market
11
+ *
12
+ * Adding a market records everything that market registers with, in its `compliance` object. Only **US `TEN_DLC`** registers with a regime — The Campaign Registry — and it is the only market whose compliance carries `brand` and `campaign`. Everywhere else compliance is documents, and many markets ask for none at all.
13
+ *
14
+ * `GET` and `PATCH` on a market return and accept the same shape, so what comes back can be sent back: an omitted key is left alone, and a key reported in `requirements` is the path into the body that clears it.
15
+ *
16
+ * Call `GET /v3/compliance/requirements` first — it answers what a market demands before you hold it, with a body you can fill in and post.
17
+ */
18
+ export declare class Voice extends APIResource {
19
+ /**
20
+ * Adds voice to one of the numbers you hold, or gives you a new one. Send `number`
21
+ * for a number that is already yours (see `GET /v3/channels`); leave it out to be
22
+ * given a new US number, optionally in a particular `area_code`. Sending both is
23
+ * refused. Nothing registers, so the number can carry calls as soon as this
24
+ * returns.
25
+ *
26
+ * What happens on a call is decided by your `callback_url`: when a call arrives on
27
+ * the number, or a caller presses a key on a menu, Sent POSTs a signed question
28
+ * there and follows the answer. The response carries the `callback_secret` the
29
+ * questions are signed with, the one time it is shown without rotating; verify a
30
+ * question the way you verify a webhook. `POST /v3/channels/voice/{number}/test`
31
+ * sends a test question and reports the verdict.
32
+ *
33
+ * Your first voice number becomes the line app-originated calls are placed from
34
+ * when a voice token names no number; send `default_for_app_calls: true` to give
35
+ * that role to another number. A number you turned off earlier is turned back on,
36
+ * and the same number with a different `callback_url` has its URL replaced and
37
+ * keeps its secret.
38
+ *
39
+ * Read the number's settings with `GET /v3/channels/voice` and change them with
40
+ * `PATCH /v3/channels/voice/{number}`.
41
+ *
42
+ * With `sandbox: true` the request is validated and a simulated number reported
43
+ * with `202`; nothing is written and no number is bought.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const apiResponseOfVoiceNumberCreated =
48
+ * await client.channels.voice.create({
49
+ * callback_url: 'https://example.com/voice',
50
+ * number: '+12125550100',
51
+ * });
52
+ * ```
53
+ */
54
+ create(params: VoiceCreateParams, options?: RequestOptions): APIPromise<APIResponseOfVoiceNumberCreated>;
55
+ /**
56
+ * Reads one of your voice numbers, active or inactive: its status, whether it is
57
+ * the default line for calls placed from your app, and its callback URL. The
58
+ * signing secret is not on this read.
59
+ *
60
+ * The same shape `GET /v3/channels/voice` lists, and the same shape `PATCH` on
61
+ * this path accepts and returns, so what comes back can be sent back.
62
+ *
63
+ * The number is the E.164 value in the path with the plus sign URL-encoded
64
+ * (`%2B`).
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const apiResponseOfVoiceNumber =
69
+ * await client.channels.voice.retrieve('+12125550100');
70
+ * ```
71
+ */
72
+ retrieve(number: string, params?: VoiceRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseOfVoiceNumber>;
73
+ /**
74
+ * Changes one of your voice numbers and answers with the number as stored, the
75
+ * same shape `GET` on this path returns, so what comes back can be sent back.
76
+ *
77
+ * ## What it changes
78
+ *
79
+ * | Body | Effect |
80
+ * | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
+ * | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept |
82
+ * | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number |
83
+ * | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number |
84
+ * | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret is kept, and a number that was waiting for its first URL is turned on |
85
+ * | key omitted | left exactly as it is |
86
+ *
87
+ * `status` is matched ignoring case. Any combination is accepted:
88
+ * `status: "ACTIVE"` with `default_for_app_calls: true` turns a number on as the
89
+ * new default, and a `callback_url` sent with either status is written too. A body
90
+ * that names none of the three is refused.
91
+ *
92
+ * ## What it will refuse
93
+ *
94
+ * **`default_for_app_calls: false` is `400`.** An account with active voice
95
+ * numbers always has exactly one default, so the default moves by giving it to
96
+ * another number.
97
+ *
98
+ * **Turning the default line off is `409`** while other active voice numbers
99
+ * remain. Move the default to another number first. Turning off your last voice
100
+ * number is allowed; that turns phone calls off.
101
+ *
102
+ * **Making an inactive number the default is `400`.** Send `status: "ACTIVE"` in
103
+ * the same call.
104
+ *
105
+ * A number added without a `callback_url` is `INACTIVE` for that one reason, so
106
+ * sending it a `callback_url` turns it on by itself, and it becomes your default
107
+ * line if you have no other active voice number. A number you turned off while it
108
+ * had a URL stays off.
109
+ *
110
+ * **A number you never turned voice on for is `404`.** Add it with
111
+ * `POST /v3/channels/voice`.
112
+ *
113
+ * The number is the E.164 value in the path with the plus sign URL-encoded
114
+ * (`%2B`).
115
+ *
116
+ * With `sandbox: true` nothing is written: the request is validated against the
117
+ * stored number and the number is reported with `200` as it would read after the
118
+ * change.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const apiResponseOfVoiceNumber =
123
+ * await client.channels.voice.update('+12125550100');
124
+ * ```
125
+ */
126
+ update(number: string, params: VoiceUpdateParams, options?: RequestOptions): APIPromise<APIResponseOfVoiceNumber>;
127
+ /**
128
+ * Every number you turned phone calls on for, active or inactive, oldest first.
129
+ * Each entry carries the number's status, whether it is the default line for calls
130
+ * placed from your app, and its callback URL. The signing secret is never on a
131
+ * read; it is shown when voice is turned on and by
132
+ * `POST /v3/channels/voice/{number}/rotate-secret`.
133
+ *
134
+ * The same entries `GET /v3/channels` reports under `voice`, and the same shape
135
+ * `GET /v3/channels/voice/{number}` returns for one of them. Change a number with
136
+ * `PATCH /v3/channels/voice/{number}`.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const apiResponseOfListOfVoiceNumber =
141
+ * await client.channels.voice.list();
142
+ * ```
143
+ */
144
+ list(params?: VoiceListParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseOfListOfVoiceNumber>;
145
+ /**
146
+ * Mints a short-lived token for one of your app users. Call this from your backend
147
+ * and return the token to your app, which passes it to the voice client SDK to
148
+ * register. The identity is bound to the given number, or to your default app-call
149
+ * number when omitted, and calls placed by that identity are routed through the
150
+ * bound number. Minting again re-binds the identity, so an identity can move
151
+ * between numbers.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * const apiResponseOfVoiceToken =
156
+ * await client.channels.voice.createToken();
157
+ * ```
158
+ */
159
+ createToken(params: VoiceCreateTokenParams, options?: RequestOptions): APIPromise<APIResponseOfVoiceToken>;
160
+ /**
161
+ * Generates a new signing secret for the questions Sent sends to this number's
162
+ * callback URL and returns it. The previous secret stops signing immediately, so
163
+ * update your backend before the next call reaches it. The number is the E.164
164
+ * value in the path with the plus sign URL-encoded (`%2B`).
165
+ *
166
+ * With `sandbox: true` a secret is generated and returned with `202`, and nothing
167
+ * is written.
168
+ *
169
+ * @example
170
+ * ```ts
171
+ * const apiResponseOfVoiceSecret =
172
+ * await client.channels.voice.rotateSecret('+12125550100');
173
+ * ```
174
+ */
175
+ rotateSecret(number: string, params: VoiceRotateSecretParams, options?: RequestOptions): APIPromise<APIResponseOfVoiceSecret>;
176
+ /**
177
+ * Sends a synthetic call.request question, flagged "test": true, to the number's
178
+ * callback URL, signed with that number's real secret, and reports what came back.
179
+ * Use it to build and debug your callback endpoint without placing calls: no call
180
+ * is placed, nothing is billed, and nothing is stored. One attempt with the same
181
+ * deadline as a live call, no retry. The outcome is ok when your endpoint answered
182
+ * 2xx with a valid answer; otherwise it is timeout, connection_failed, http_error
183
+ * or invalid_answer, with the reason and, for an invalid answer, the field at
184
+ * fault. The number is the E.164 value in the path with the plus sign URL-encoded
185
+ * (`%2B`).
186
+ *
187
+ * With `sandbox: true` nothing is sent: the verdict comes back ok with `202` and
188
+ * no request or response in it.
189
+ *
190
+ * @example
191
+ * ```ts
192
+ * const apiResponseOfVoiceCallbackTest =
193
+ * await client.channels.voice.test('+12025550123');
194
+ * ```
195
+ */
196
+ test(number: string, params: VoiceTestParams, options?: RequestOptions): APIPromise<APIResponseOfVoiceCallbackTest>;
197
+ }
198
+ /**
199
+ * Standard API response envelope for all v3 endpoints
200
+ */
201
+ export interface APIResponseOfListOfVoiceNumber {
202
+ /**
203
+ * The response data (null if error)
204
+ */
205
+ data?: Array<VoiceNumber> | null;
206
+ /**
207
+ * Error information
208
+ */
209
+ error?: WebhooksAPI.ErrorDetail | null;
210
+ /**
211
+ * Request and response metadata
212
+ */
213
+ meta?: WebhooksAPI.APIMeta;
214
+ /**
215
+ * Indicates whether the request was successful
216
+ */
217
+ success?: boolean;
218
+ }
219
+ /**
220
+ * Standard API response envelope for all v3 endpoints
221
+ */
222
+ export interface APIResponseOfVoiceCallbackTest {
223
+ /**
224
+ * The verdict of a test question sent to your callback URL
225
+ */
226
+ data?: VoiceCallbackTest | null;
227
+ /**
228
+ * Error information
229
+ */
230
+ error?: WebhooksAPI.ErrorDetail | null;
231
+ /**
232
+ * Request and response metadata
233
+ */
234
+ meta?: WebhooksAPI.APIMeta;
235
+ /**
236
+ * Indicates whether the request was successful
237
+ */
238
+ success?: boolean;
239
+ }
240
+ /**
241
+ * Standard API response envelope for all v3 endpoints
242
+ */
243
+ export interface APIResponseOfVoiceNumber {
244
+ /**
245
+ * One number the profile carries phone calls on.
246
+ */
247
+ data?: VoiceNumber | null;
248
+ /**
249
+ * Error information
250
+ */
251
+ error?: WebhooksAPI.ErrorDetail | null;
252
+ /**
253
+ * Request and response metadata
254
+ */
255
+ meta?: WebhooksAPI.APIMeta;
256
+ /**
257
+ * Indicates whether the request was successful
258
+ */
259
+ success?: boolean;
260
+ }
261
+ /**
262
+ * Standard API response envelope for all v3 endpoints
263
+ */
264
+ export interface APIResponseOfVoiceNumberCreated {
265
+ /**
266
+ * The response data (null if error)
267
+ */
268
+ data?: VoiceNumberCreated | null;
269
+ /**
270
+ * Error information
271
+ */
272
+ error?: WebhooksAPI.ErrorDetail | null;
273
+ /**
274
+ * Request and response metadata
275
+ */
276
+ meta?: WebhooksAPI.APIMeta;
277
+ /**
278
+ * Indicates whether the request was successful
279
+ */
280
+ success?: boolean;
281
+ }
282
+ /**
283
+ * Standard API response envelope for all v3 endpoints
284
+ */
285
+ export interface APIResponseOfVoiceSecret {
286
+ /**
287
+ * A freshly rotated callback signing secret
288
+ */
289
+ data?: VoiceSecret | null;
290
+ /**
291
+ * Error information
292
+ */
293
+ error?: WebhooksAPI.ErrorDetail | null;
294
+ /**
295
+ * Request and response metadata
296
+ */
297
+ meta?: WebhooksAPI.APIMeta;
298
+ /**
299
+ * Indicates whether the request was successful
300
+ */
301
+ success?: boolean;
302
+ }
303
+ /**
304
+ * Standard API response envelope for all v3 endpoints
305
+ */
306
+ export interface APIResponseOfVoiceToken {
307
+ /**
308
+ * A short-lived token your app passes to the voice client SDK to register
309
+ */
310
+ data?: VoiceToken | null;
311
+ /**
312
+ * Error information
313
+ */
314
+ error?: WebhooksAPI.ErrorDetail | null;
315
+ /**
316
+ * Request and response metadata
317
+ */
318
+ meta?: WebhooksAPI.APIMeta;
319
+ /**
320
+ * Indicates whether the request was successful
321
+ */
322
+ success?: boolean;
323
+ }
324
+ /**
325
+ * The verdict of a test question sent to your callback URL
326
+ */
327
+ export interface VoiceCallbackTest {
328
+ /**
329
+ * Your answer as Sent read it, with numbers in E.164 and a missing caller id
330
+ * filled in. Set only when the outcome is ok.
331
+ */
332
+ answer?: unknown | null;
333
+ /**
334
+ * The call id the test question carried. It does not exist anywhere else and
335
+ * cannot be looked up.
336
+ */
337
+ call_id?: string;
338
+ /**
339
+ * Why the test did not end with ok
340
+ */
341
+ error?: VoiceCallbackTestErrorInfo | null;
342
+ /**
343
+ * What happened: ok, timeout, connection_failed, http_error or invalid_answer
344
+ */
345
+ outcome?: string;
346
+ /**
347
+ * The test question exactly as it was sent
348
+ */
349
+ request?: VoiceCallbackTestRequestInfo | null;
350
+ /**
351
+ * What your endpoint answered
352
+ */
353
+ response?: VoiceCallbackTestResponseInfo | null;
354
+ }
355
+ /**
356
+ * Why the test did not end with ok
357
+ */
358
+ export interface VoiceCallbackTestErrorInfo {
359
+ /**
360
+ * What to fix
361
+ */
362
+ message?: string;
363
+ /**
364
+ * Dotted path of the answer field at fault, such as action.action, when one field
365
+ * is to blame
366
+ */
367
+ path?: string | null;
368
+ /**
369
+ * Machine-readable reason, such as timeout, http_error, malformed_json,
370
+ * missing_action or unknown_action
371
+ */
372
+ reason?: string;
373
+ }
374
+ /**
375
+ * The test question exactly as it was sent
376
+ */
377
+ export interface VoiceCallbackTestRequestInfo {
378
+ /**
379
+ * The request body byte for byte. This is what the signature covers.
380
+ */
381
+ body?: string;
382
+ /**
383
+ * Every header Sent added, the signature included, so you can compare against what
384
+ * your endpoint verified. The signing secret itself is never included.
385
+ */
386
+ headers?: {
387
+ [key: string]: string;
388
+ };
389
+ /**
390
+ * The callback URL that was called
391
+ */
392
+ url?: string;
393
+ }
394
+ /**
395
+ * What your endpoint answered
396
+ */
397
+ export interface VoiceCallbackTestResponseInfo {
398
+ /**
399
+ * The start of the raw response body, capped at 2048 characters
400
+ */
401
+ body?: string | null;
402
+ /**
403
+ * The HTTP status your endpoint returned
404
+ */
405
+ status_code?: number;
406
+ }
407
+ /**
408
+ * One number the profile carries phone calls on.
409
+ */
410
+ export interface VoiceNumber {
411
+ /**
412
+ * Where Sent asks what to do with each call on this number: a signed question is
413
+ * POSTed here when a call arrives or a caller presses a key, and the answer
414
+ * decides the call. The signing secret is not on this read; it is shown when voice
415
+ * is turned on and by the rotate endpoint.
416
+ */
417
+ callback_url?: string | null;
418
+ created_at?: string;
419
+ /**
420
+ * Whether this is the line app-originated calls are placed from when a voice token
421
+ * names no number. Exactly one active voice number carries it while the profile
422
+ * has any.
423
+ */
424
+ default_for_app_calls?: boolean;
425
+ /**
426
+ * The number, in E.164.
427
+ */
428
+ number?: string;
429
+ /**
430
+ * ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
431
+ * provisions: a number the customer holds can carry calls the moment voice is
432
+ * turned on for it.
433
+ */
434
+ status?: string;
435
+ updated_at?: string;
436
+ }
437
+ /**
438
+ * One number the profile carries phone calls on.
439
+ */
440
+ export interface VoiceNumberCreated extends VoiceNumber {
441
+ /**
442
+ * The whsec\_ secret every question to callback_url is signed with. Shown here and
443
+ * by POST /v3/channels/voice/{number}/rotate-secret, nowhere else: store it now.
444
+ * Verify a question exactly as you verify a webhook, with X-Webhook-ID,
445
+ * X-Webhook-Timestamp and the body.
446
+ */
447
+ callback_secret?: string;
448
+ }
449
+ /**
450
+ * A freshly rotated callback signing secret
451
+ */
452
+ export interface VoiceSecret {
453
+ /**
454
+ * The new whsec\_ secret. The previous one stopped signing the moment this was
455
+ * returned, so update your backend before the next call reaches it. Shown once.
456
+ */
457
+ callback_secret?: string;
458
+ }
459
+ /**
460
+ * A short-lived token your app passes to the voice client SDK to register
461
+ */
462
+ export interface VoiceToken {
463
+ /**
464
+ * The signed token. Hand it to the client SDK unchanged.
465
+ */
466
+ token?: string;
467
+ /**
468
+ * When the token expires (UTC)
469
+ */
470
+ expires_at?: string;
471
+ /**
472
+ * The identity the token was minted for
473
+ */
474
+ identity?: string;
475
+ /**
476
+ * The phone number this identity is now bound to, in E.164 format
477
+ */
478
+ number?: string;
479
+ }
480
+ export interface VoiceCreateParams {
481
+ /**
482
+ * Body param: Where Sent asks what to do with each call on this number: an
483
+ * absolute HTTP or HTTPS URL on a public host. A signed question is POSTed here
484
+ * when a call arrives or a caller presses a key, and the answer decides the call.
485
+ * Every question is signed with the callback_secret the response returns, the same
486
+ * way your webhooks are signed. Turning the number on again with a different URL
487
+ * replaces it and keeps the secret.
488
+ */
489
+ callback_url: string;
490
+ /**
491
+ * Body param: The US area code a new number should be in, as 212. Only for a
492
+ * request that leaves number out — sending both says two different things about
493
+ * which number to use, and is refused. Omit it too and the number comes from
494
+ * anywhere in the country.
495
+ */
496
+ area_code?: string | null;
497
+ /**
498
+ * Body param: Make this the line app-originated calls are placed from when a voice
499
+ * token names no number. Omit it and your first voice number takes that role; a
500
+ * later one leaves it where it is.
501
+ */
502
+ default_for_app_calls?: boolean | null;
503
+ /**
504
+ * Body param: One of your phone numbers, in E.164 format. Leave the field out
505
+ * entirely to be given a new one instead; sending it empty is a refused request
506
+ * rather than a request for a new number.
507
+ */
508
+ number?: string | null;
509
+ /**
510
+ * Body param: Sandbox flag - when true, the operation is simulated without side
511
+ * effects Useful for testing integrations without actual execution
512
+ */
513
+ sandbox?: boolean;
514
+ /**
515
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
516
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
517
+ * hours per key per customer.
518
+ */
519
+ 'Idempotency-Key'?: string;
520
+ /**
521
+ * Header param: Profile UUID to scope the request to a child profile. Only
522
+ * organization API keys can use this header. The profile must belong to the
523
+ * calling organization.
524
+ */
525
+ 'x-profile-id'?: string;
526
+ }
527
+ export interface VoiceRetrieveParams {
528
+ /**
529
+ * Profile UUID to scope the request to a child profile. Only organization API keys
530
+ * can use this header. The profile must belong to the calling organization.
531
+ */
532
+ 'x-profile-id'?: string;
533
+ }
534
+ export interface VoiceUpdateParams {
535
+ /**
536
+ * Body param: A new callback URL for the number, active or not: an absolute HTTP
537
+ * or HTTPS URL on a public host, where Sent asks what to do with each call. The
538
+ * signing secret is kept.
539
+ */
540
+ callback_url?: string | null;
541
+ /**
542
+ * Body param: true makes this the line app-originated calls are placed from when a
543
+ * voice token names no number. false is refused: an account with active voice
544
+ * numbers always has exactly one default, so the default moves by giving it to
545
+ * another number.
546
+ */
547
+ default_for_app_calls?: boolean | null;
548
+ /**
549
+ * Body param: Sandbox flag - when true, the operation is simulated without side
550
+ * effects Useful for testing integrations without actual execution
551
+ */
552
+ sandbox?: boolean;
553
+ /**
554
+ * Body param: ACTIVE turns calls on for the number again, INACTIVE turns them off.
555
+ * Matched ignoring case. Turning the default line off is refused while other
556
+ * active voice numbers remain.
557
+ */
558
+ status?: 'ACTIVE' | 'INACTIVE' | null;
559
+ /**
560
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
561
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
562
+ * hours per key per customer.
563
+ */
564
+ 'Idempotency-Key'?: string;
565
+ /**
566
+ * Header param: Profile UUID to scope the request to a child profile. Only
567
+ * organization API keys can use this header. The profile must belong to the
568
+ * calling organization.
569
+ */
570
+ 'x-profile-id'?: string;
571
+ }
572
+ export interface VoiceListParams {
573
+ /**
574
+ * Profile UUID to scope the request to a child profile. Only organization API keys
575
+ * can use this header. The profile must belong to the calling organization.
576
+ */
577
+ 'x-profile-id'?: string;
578
+ }
579
+ export interface VoiceCreateTokenParams {
580
+ /**
581
+ * Body param: Your identifier for the app user, such as an agent or account id.
582
+ * Letters, digits, hyphens and underscores only, up to 200 characters.
583
+ */
584
+ identity?: string;
585
+ /**
586
+ * Body param: One of your voice-enabled phone numbers in E.164 format. Calls
587
+ * placed by this identity are routed through that number. Omit to use your default
588
+ * app-call number.
589
+ */
590
+ number?: string | null;
591
+ /**
592
+ * Body param: Sandbox flag - when true, the operation is simulated without side
593
+ * effects Useful for testing integrations without actual execution
594
+ */
595
+ sandbox?: boolean;
596
+ /**
597
+ * Body param: Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
598
+ */
599
+ ttl?: number | null;
600
+ /**
601
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
602
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
603
+ * hours per key per customer.
604
+ */
605
+ 'Idempotency-Key'?: string;
606
+ /**
607
+ * Header param: Profile UUID to scope the request to a child profile. Only
608
+ * organization API keys can use this header. The profile must belong to the
609
+ * calling organization.
610
+ */
611
+ 'x-profile-id'?: string;
612
+ }
613
+ export interface VoiceRotateSecretParams {
614
+ /**
615
+ * Body param: Sandbox flag - when true, the operation is simulated without side
616
+ * effects Useful for testing integrations without actual execution
617
+ */
618
+ sandbox?: boolean;
619
+ /**
620
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
621
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
622
+ * hours per key per customer.
623
+ */
624
+ 'Idempotency-Key'?: string;
625
+ /**
626
+ * Header param: Profile UUID to scope the request to a child profile. Only
627
+ * organization API keys can use this header. The profile must belong to the
628
+ * calling organization.
629
+ */
630
+ 'x-profile-id'?: string;
631
+ }
632
+ export interface VoiceTestParams {
633
+ /**
634
+ * Body param: Sandbox flag - when true, the operation is simulated without side
635
+ * effects Useful for testing integrations without actual execution
636
+ */
637
+ sandbox?: boolean;
638
+ /**
639
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
640
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
641
+ * hours per key per customer.
642
+ */
643
+ 'Idempotency-Key'?: string;
644
+ /**
645
+ * Header param: Profile UUID to scope the request to a child profile. Only
646
+ * organization API keys can use this header. The profile must belong to the
647
+ * calling organization.
648
+ */
649
+ 'x-profile-id'?: string;
650
+ }
651
+ export declare namespace Voice {
652
+ export { type APIResponseOfListOfVoiceNumber as APIResponseOfListOfVoiceNumber, type APIResponseOfVoiceCallbackTest as APIResponseOfVoiceCallbackTest, type APIResponseOfVoiceNumber as APIResponseOfVoiceNumber, type APIResponseOfVoiceNumberCreated as APIResponseOfVoiceNumberCreated, type APIResponseOfVoiceSecret as APIResponseOfVoiceSecret, type APIResponseOfVoiceToken as APIResponseOfVoiceToken, type VoiceCallbackTest as VoiceCallbackTest, type VoiceCallbackTestErrorInfo as VoiceCallbackTestErrorInfo, type VoiceCallbackTestRequestInfo as VoiceCallbackTestRequestInfo, type VoiceCallbackTestResponseInfo as VoiceCallbackTestResponseInfo, type VoiceNumber as VoiceNumber, type VoiceNumberCreated as VoiceNumberCreated, type VoiceSecret as VoiceSecret, type VoiceToken as VoiceToken, type VoiceCreateParams as VoiceCreateParams, type VoiceRetrieveParams as VoiceRetrieveParams, type VoiceUpdateParams as VoiceUpdateParams, type VoiceListParams as VoiceListParams, type VoiceCreateTokenParams as VoiceCreateTokenParams, type VoiceRotateSecretParams as VoiceRotateSecretParams, type VoiceTestParams as VoiceTestParams, };
653
+ }
654
+ //# sourceMappingURL=voice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../src/resources/channels/voice.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,WAAW,uBAAoB;AAC3C,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;;;;GAYG;AACH,qBAAa,KAAM,SAAQ,W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