@linqapp/sdk 0.79.0 → 0.81.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.
- package/CHANGELOG.md +14 -0
- package/client.d.mts +77 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +77 -2
- package/client.d.ts.map +1 -1
- package/client.js +75 -0
- package/client.js.map +1 -1
- package/client.mjs +75 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/available-number.d.mts +13 -0
- package/resources/available-number.d.mts.map +1 -1
- package/resources/available-number.d.ts +13 -0
- package/resources/available-number.d.ts.map +1 -1
- package/resources/available-number.js +13 -0
- package/resources/available-number.js.map +1 -1
- package/resources/available-number.mjs +13 -0
- package/resources/available-number.mjs.map +1 -1
- package/resources/call-voice.d.mts +82 -0
- package/resources/call-voice.d.mts.map +1 -0
- package/resources/call-voice.d.ts +82 -0
- package/resources/call-voice.d.ts.map +1 -0
- package/resources/call-voice.js +35 -0
- package/resources/call-voice.js.map +1 -0
- package/resources/call-voice.mjs +31 -0
- package/resources/call-voice.mjs.map +1 -0
- package/resources/chats/chats.d.mts +16 -3
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +16 -3
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/messages.d.mts +10 -3
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +10 -3
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/polls.d.mts +1 -1
- package/resources/chats/polls.d.ts +1 -1
- package/resources/contact-card.d.mts +8 -0
- package/resources/contact-card.d.mts.map +1 -1
- package/resources/contact-card.d.ts +8 -0
- package/resources/contact-card.d.ts.map +1 -1
- package/resources/contact-card.js +8 -0
- package/resources/contact-card.js.map +1 -1
- package/resources/contact-card.mjs +8 -0
- package/resources/contact-card.mjs.map +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +16 -7
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +16 -7
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +6 -4
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +6 -4
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +20 -0
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +20 -0
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +13 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +13 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/phonenumbers.d.mts +13 -0
- package/resources/phonenumbers.d.mts.map +1 -1
- package/resources/phonenumbers.d.ts +13 -0
- package/resources/phonenumbers.d.ts.map +1 -1
- package/resources/phonenumbers.js +13 -0
- package/resources/phonenumbers.js.map +1 -1
- package/resources/phonenumbers.mjs +13 -0
- package/resources/phonenumbers.mjs.map +1 -1
- package/resources/shared.d.mts +4 -2
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/sip-profiles.d.mts +224 -0
- package/resources/sip-profiles.d.mts.map +1 -0
- package/resources/sip-profiles.d.ts +224 -0
- package/resources/sip-profiles.d.ts.map +1 -0
- package/resources/sip-profiles.js +168 -0
- package/resources/sip-profiles.js.map +1 -0
- package/resources/sip-profiles.mjs +164 -0
- package/resources/sip-profiles.mjs.map +1 -0
- package/resources/webhook-events.d.mts +1 -1
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +1 -1
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhooks.d.mts +524 -44
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +524 -44
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +121 -0
- package/src/resources/available-number.ts +13 -0
- package/src/resources/call-voice.ts +110 -0
- package/src/resources/chats/chats.ts +18 -3
- package/src/resources/chats/messages.ts +11 -3
- package/src/resources/chats/polls.ts +1 -1
- package/src/resources/contact-card.ts +8 -0
- package/src/resources/index.ts +23 -0
- package/src/resources/messages/messages.ts +17 -7
- package/src/resources/phone-numbers.ts +21 -0
- package/src/resources/phonenumbers.ts +13 -0
- package/src/resources/shared.ts +4 -2
- package/src/resources/sip-profiles.ts +282 -0
- package/src/resources/webhook-events.ts +1 -7
- package/src/resources/webhooks.ts +1263 -277
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -45,6 +45,12 @@ import {
|
|
|
45
45
|
BlockedHandleUnblockParams,
|
|
46
46
|
BlockedHandles,
|
|
47
47
|
} from './resources/blocked-handles';
|
|
48
|
+
import {
|
|
49
|
+
CallVoice,
|
|
50
|
+
CallVoiceListParams,
|
|
51
|
+
CallVoiceListResponse,
|
|
52
|
+
CallVoiceRecord,
|
|
53
|
+
} from './resources/call-voice';
|
|
48
54
|
import {
|
|
49
55
|
Capability,
|
|
50
56
|
CapabilityCheckIMessageParams,
|
|
@@ -99,6 +105,15 @@ import {
|
|
|
99
105
|
ReputationUnhealthyChat,
|
|
100
106
|
} from './resources/phone-numbers';
|
|
101
107
|
import { PhonenumberListResponse, Phonenumbers } from './resources/phonenumbers';
|
|
108
|
+
import {
|
|
109
|
+
SipProfile,
|
|
110
|
+
SipProfileAssignParams,
|
|
111
|
+
SipProfileAssignResponse,
|
|
112
|
+
SipProfileCreateParams,
|
|
113
|
+
SipProfileListResponse,
|
|
114
|
+
SipProfileUpdateParams,
|
|
115
|
+
SipProfiles,
|
|
116
|
+
} from './resources/sip-profiles';
|
|
102
117
|
import { WebhookEventListResponse, WebhookEventType, WebhookEvents } from './resources/webhook-events';
|
|
103
118
|
import {
|
|
104
119
|
WebhookSubscription,
|
|
@@ -115,6 +130,13 @@ import {
|
|
|
115
130
|
APITokenExpiredWebhookEvent,
|
|
116
131
|
APITokenExpiryScheduledWebhookEvent,
|
|
117
132
|
APITokenRenamedWebhookEvent,
|
|
133
|
+
CallVoiceAnsweredWebhookEvent,
|
|
134
|
+
CallVoiceDeclinedWebhookEvent,
|
|
135
|
+
CallVoiceEndedWebhookEvent,
|
|
136
|
+
CallVoiceFailedWebhookEvent,
|
|
137
|
+
CallVoiceInitiatedWebhookEvent,
|
|
138
|
+
CallVoiceNoAnswerWebhookEvent,
|
|
139
|
+
CallVoiceRingingWebhookEvent,
|
|
118
140
|
ChatBackgroundUpdateFailedWebhookEvent,
|
|
119
141
|
ChatBackgroundUpdatedWebhookEvent,
|
|
120
142
|
ChatCreatedWebhookEvent,
|
|
@@ -153,6 +175,7 @@ import {
|
|
|
153
175
|
PaymentSucceededWebhookEvent,
|
|
154
176
|
PhoneNumberAssignedWebhookEvent,
|
|
155
177
|
PhoneNumberForwardingUpdatedWebhookEvent,
|
|
178
|
+
PhoneNumberLineTypeUpdatedWebhookEvent,
|
|
156
179
|
PhoneNumberReleasedWebhookEvent,
|
|
157
180
|
PhoneNumberStatusUpdatedWebhookEvent,
|
|
158
181
|
PollDeliveredWebhookEvent,
|
|
@@ -1272,6 +1295,19 @@ export class LinqAPIV3 {
|
|
|
1272
1295
|
* numbers are eligible, you get `409` (no `from` number was ever chosen, so there's no
|
|
1273
1296
|
* specific number to blame with a `403`).
|
|
1274
1297
|
*
|
|
1298
|
+
* **Published vs unpublished.** A *published* number is available for your account to use.
|
|
1299
|
+
* Only published numbers appear in `GET /v3/phone_numbers`.
|
|
1300
|
+
*
|
|
1301
|
+
* Unpublished numbers allow `GET` requests. `POST`, `PUT`, `PATCH`, and `DELETE` requests that
|
|
1302
|
+
* change a chat return `403` with error code `2033` (`Phone number is unpublished`).
|
|
1303
|
+
*
|
|
1304
|
+
* A number's existing data is preserved when its status changes to unpublished. Unpublished
|
|
1305
|
+
* status alone does not block reads, blocked-handle management, or deletion
|
|
1306
|
+
* of your data. Existing authorization, retention, and endpoint rules still apply.
|
|
1307
|
+
*
|
|
1308
|
+
* Webhook events are suppressed for affected numbers when their publication status is known to
|
|
1309
|
+
* be unpublished.
|
|
1310
|
+
*
|
|
1275
1311
|
*/
|
|
1276
1312
|
phonenumbers: API.Phonenumbers = new API.Phonenumbers(this);
|
|
1277
1313
|
/**
|
|
@@ -1292,6 +1328,19 @@ export class LinqAPIV3 {
|
|
|
1292
1328
|
* numbers are eligible, you get `409` (no `from` number was ever chosen, so there's no
|
|
1293
1329
|
* specific number to blame with a `403`).
|
|
1294
1330
|
*
|
|
1331
|
+
* **Published vs unpublished.** A *published* number is available for your account to use.
|
|
1332
|
+
* Only published numbers appear in `GET /v3/phone_numbers`.
|
|
1333
|
+
*
|
|
1334
|
+
* Unpublished numbers allow `GET` requests. `POST`, `PUT`, `PATCH`, and `DELETE` requests that
|
|
1335
|
+
* change a chat return `403` with error code `2033` (`Phone number is unpublished`).
|
|
1336
|
+
*
|
|
1337
|
+
* A number's existing data is preserved when its status changes to unpublished. Unpublished
|
|
1338
|
+
* status alone does not block reads, blocked-handle management, or deletion
|
|
1339
|
+
* of your data. Existing authorization, retention, and endpoint rules still apply.
|
|
1340
|
+
*
|
|
1341
|
+
* Webhook events are suppressed for affected numbers when their publication status is known to
|
|
1342
|
+
* be unpublished.
|
|
1343
|
+
*
|
|
1295
1344
|
*/
|
|
1296
1345
|
phoneNumbers: API.PhoneNumbers = new API.PhoneNumbers(this);
|
|
1297
1346
|
/**
|
|
@@ -1312,6 +1361,19 @@ export class LinqAPIV3 {
|
|
|
1312
1361
|
* numbers are eligible, you get `409` (no `from` number was ever chosen, so there's no
|
|
1313
1362
|
* specific number to blame with a `403`).
|
|
1314
1363
|
*
|
|
1364
|
+
* **Published vs unpublished.** A *published* number is available for your account to use.
|
|
1365
|
+
* Only published numbers appear in `GET /v3/phone_numbers`.
|
|
1366
|
+
*
|
|
1367
|
+
* Unpublished numbers allow `GET` requests. `POST`, `PUT`, `PATCH`, and `DELETE` requests that
|
|
1368
|
+
* change a chat return `403` with error code `2033` (`Phone number is unpublished`).
|
|
1369
|
+
*
|
|
1370
|
+
* A number's existing data is preserved when its status changes to unpublished. Unpublished
|
|
1371
|
+
* status alone does not block reads, blocked-handle management, or deletion
|
|
1372
|
+
* of your data. Existing authorization, retention, and endpoint rules still apply.
|
|
1373
|
+
*
|
|
1374
|
+
* Webhook events are suppressed for affected numbers when their publication status is known to
|
|
1375
|
+
* be unpublished.
|
|
1376
|
+
*
|
|
1315
1377
|
*/
|
|
1316
1378
|
availableNumber: API.AvailableNumber = new API.AvailableNumber(this);
|
|
1317
1379
|
/**
|
|
@@ -1588,6 +1650,38 @@ export class LinqAPIV3 {
|
|
|
1588
1650
|
*
|
|
1589
1651
|
*/
|
|
1590
1652
|
experiences: API.Experiences = new API.Experiences(this);
|
|
1653
|
+
/**
|
|
1654
|
+
* ## SIP configuration
|
|
1655
|
+
*
|
|
1656
|
+
* Add these IP ranges to your SIP endpoint's allowlist:
|
|
1657
|
+
*
|
|
1658
|
+
* ```
|
|
1659
|
+
* 54.172.60.0/30
|
|
1660
|
+
* 54.244.51.0/30
|
|
1661
|
+
* 168.86.128.0/18
|
|
1662
|
+
* ```
|
|
1663
|
+
*
|
|
1664
|
+
* Set `primary_uri` to your endpoint as scheme + host — `sips:` for TLS or
|
|
1665
|
+
* `sip:` for UDP, with no user part (we add it). Each call arrives at your
|
|
1666
|
+
* endpoint as:
|
|
1667
|
+
*
|
|
1668
|
+
* ```
|
|
1669
|
+
* sip:<called-number>@<your-host>
|
|
1670
|
+
* ```
|
|
1671
|
+
*
|
|
1672
|
+
* so you can route on the dialed number. The caller's number is in the
|
|
1673
|
+
* `From` header in E.164. Media (RTP) uses UDP ports 10000–60000.
|
|
1674
|
+
*
|
|
1675
|
+
*/
|
|
1676
|
+
sipProfiles: API.SipProfiles = new API.SipProfiles(this);
|
|
1677
|
+
/**
|
|
1678
|
+
* Read the carrier (BYOC) voice calls received on your phone numbers. Each
|
|
1679
|
+
* record is the durable form of the `call_voice.*` webhooks for that call and
|
|
1680
|
+
* shares the same `id`, so you can look a call up by the id a webhook
|
|
1681
|
+
* delivered. See SIP Profiles for routing inbound calls to your endpoint.
|
|
1682
|
+
*
|
|
1683
|
+
*/
|
|
1684
|
+
callVoice: API.CallVoice = new API.CallVoice(this);
|
|
1591
1685
|
/**
|
|
1592
1686
|
* Webhook Subscriptions allow you to receive real-time notifications when events
|
|
1593
1687
|
* occur on your account.
|
|
@@ -1881,6 +1975,8 @@ LinqAPIV3.LinkConnections = LinkConnections;
|
|
|
1881
1975
|
LinqAPIV3.LinkPayments = LinkPayments;
|
|
1882
1976
|
LinqAPIV3.BlockedHandles = BlockedHandles;
|
|
1883
1977
|
LinqAPIV3.Experiences = Experiences;
|
|
1978
|
+
LinqAPIV3.SipProfiles = SipProfiles;
|
|
1979
|
+
LinqAPIV3.CallVoice = CallVoice;
|
|
1884
1980
|
LinqAPIV3.WebhookEvents = WebhookEvents;
|
|
1885
1981
|
LinqAPIV3.WebhookSubscriptions = WebhookSubscriptions;
|
|
1886
1982
|
LinqAPIV3.Webhooks = Webhooks;
|
|
@@ -2019,6 +2115,23 @@ export declare namespace LinqAPIV3 {
|
|
|
2019
2115
|
type ExperienceListResponse as ExperienceListResponse,
|
|
2020
2116
|
};
|
|
2021
2117
|
|
|
2118
|
+
export {
|
|
2119
|
+
SipProfiles as SipProfiles,
|
|
2120
|
+
type SipProfile as SipProfile,
|
|
2121
|
+
type SipProfileListResponse as SipProfileListResponse,
|
|
2122
|
+
type SipProfileAssignResponse as SipProfileAssignResponse,
|
|
2123
|
+
type SipProfileCreateParams as SipProfileCreateParams,
|
|
2124
|
+
type SipProfileUpdateParams as SipProfileUpdateParams,
|
|
2125
|
+
type SipProfileAssignParams as SipProfileAssignParams,
|
|
2126
|
+
};
|
|
2127
|
+
|
|
2128
|
+
export {
|
|
2129
|
+
CallVoice as CallVoice,
|
|
2130
|
+
type CallVoiceRecord as CallVoiceRecord,
|
|
2131
|
+
type CallVoiceListResponse as CallVoiceListResponse,
|
|
2132
|
+
type CallVoiceListParams as CallVoiceListParams,
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2022
2135
|
export {
|
|
2023
2136
|
WebhookEvents as WebhookEvents,
|
|
2024
2137
|
type WebhookEventType as WebhookEventType,
|
|
@@ -2074,6 +2187,7 @@ export declare namespace LinqAPIV3 {
|
|
|
2074
2187
|
type PhoneNumberStatusUpdatedWebhookEvent as PhoneNumberStatusUpdatedWebhookEvent,
|
|
2075
2188
|
type PhoneNumberAssignedWebhookEvent as PhoneNumberAssignedWebhookEvent,
|
|
2076
2189
|
type PhoneNumberReleasedWebhookEvent as PhoneNumberReleasedWebhookEvent,
|
|
2190
|
+
type PhoneNumberLineTypeUpdatedWebhookEvent as PhoneNumberLineTypeUpdatedWebhookEvent,
|
|
2077
2191
|
type ConnectionCreatedWebhookEvent as ConnectionCreatedWebhookEvent,
|
|
2078
2192
|
type ConnectionRevokedWebhookEvent as ConnectionRevokedWebhookEvent,
|
|
2079
2193
|
type LocationSharingStartedWebhookEvent as LocationSharingStartedWebhookEvent,
|
|
@@ -2110,6 +2224,13 @@ export declare namespace LinqAPIV3 {
|
|
|
2110
2224
|
type TeamMemberAddedWebhookEvent as TeamMemberAddedWebhookEvent,
|
|
2111
2225
|
type TeamMemberSignedInWebhookEvent as TeamMemberSignedInWebhookEvent,
|
|
2112
2226
|
type TeamMemberSignedOutWebhookEvent as TeamMemberSignedOutWebhookEvent,
|
|
2227
|
+
type CallVoiceInitiatedWebhookEvent as CallVoiceInitiatedWebhookEvent,
|
|
2228
|
+
type CallVoiceRingingWebhookEvent as CallVoiceRingingWebhookEvent,
|
|
2229
|
+
type CallVoiceAnsweredWebhookEvent as CallVoiceAnsweredWebhookEvent,
|
|
2230
|
+
type CallVoiceEndedWebhookEvent as CallVoiceEndedWebhookEvent,
|
|
2231
|
+
type CallVoiceFailedWebhookEvent as CallVoiceFailedWebhookEvent,
|
|
2232
|
+
type CallVoiceDeclinedWebhookEvent as CallVoiceDeclinedWebhookEvent,
|
|
2233
|
+
type CallVoiceNoAnswerWebhookEvent as CallVoiceNoAnswerWebhookEvent,
|
|
2113
2234
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
|
2114
2235
|
};
|
|
2115
2236
|
|
|
@@ -21,6 +21,19 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
21
21
|
* pick an eligible number for you, skipping ineligible ones; if none of your assigned
|
|
22
22
|
* numbers are eligible, you get `409` (no `from` number was ever chosen, so there's no
|
|
23
23
|
* specific number to blame with a `403`).
|
|
24
|
+
*
|
|
25
|
+
* **Published vs unpublished.** A *published* number is available for your account to use.
|
|
26
|
+
* Only published numbers appear in `GET /v3/phone_numbers`.
|
|
27
|
+
*
|
|
28
|
+
* Unpublished numbers allow `GET` requests. `POST`, `PUT`, `PATCH`, and `DELETE` requests that
|
|
29
|
+
* change a chat return `403` with error code `2033` (`Phone number is unpublished`).
|
|
30
|
+
*
|
|
31
|
+
* A number's existing data is preserved when its status changes to unpublished. Unpublished
|
|
32
|
+
* status alone does not block reads, blocked-handle management, or deletion
|
|
33
|
+
* of your data. Existing authorization, retention, and endpoint rules still apply.
|
|
34
|
+
*
|
|
35
|
+
* Webhook events are suppressed for affected numbers when their publication status is known to
|
|
36
|
+
* be unpublished.
|
|
24
37
|
*/
|
|
25
38
|
export class AvailableNumber extends APIResource {
|
|
26
39
|
/**
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
* Read the carrier (BYOC) voice calls received on your phone numbers. Each
|
|
10
|
+
* record is the durable form of the `call_voice.*` webhooks for that call and
|
|
11
|
+
* shares the same `id`, so you can look a call up by the id a webhook
|
|
12
|
+
* delivered. See SIP Profiles for routing inbound calls to your endpoint.
|
|
13
|
+
*/
|
|
14
|
+
export class CallVoice extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve a single carrier voice call by its `id` — the same id delivered in the
|
|
17
|
+
* `call_voice.*` webhooks and returned by the list endpoint. The call must belong
|
|
18
|
+
* to the authenticated partner.
|
|
19
|
+
*/
|
|
20
|
+
retrieve(callVoiceID: string, options?: RequestOptions): APIPromise<CallVoiceRecord> {
|
|
21
|
+
return this._client.get(path`/v3/call-voice/${callVoiceID}`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List the carrier voice calls received on one of your phone numbers, newest
|
|
26
|
+
* first, with cursor pagination. Each record is the durable form of the
|
|
27
|
+
* `call_voice.*` webhooks for that call; the `id` is the same id those webhooks
|
|
28
|
+
* carry. Results are scoped to the authenticated partner — a number that isn't
|
|
29
|
+
* yours (or simply has no calls) returns `200` with an empty `call_voice` array,
|
|
30
|
+
* not an error.
|
|
31
|
+
*/
|
|
32
|
+
list(
|
|
33
|
+
phoneNumber: string,
|
|
34
|
+
query: CallVoiceListParams | null | undefined = {},
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<CallVoiceListResponse> {
|
|
37
|
+
return this._client.get(path`/v3/phone-numbers/${phoneNumber}/call-voice`, { query, ...options });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A carrier (BYOC) inbound voice call. Mirrors the call_voice.\* webhook payload.
|
|
43
|
+
*/
|
|
44
|
+
export interface CallVoiceRecord {
|
|
45
|
+
/**
|
|
46
|
+
* Stable call id, identical to the id in the call_voice.\* webhooks.
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
|
|
50
|
+
direction: 'inbound';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* External caller, E.164.
|
|
54
|
+
*/
|
|
55
|
+
from: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Terminal call outcome. Null while the call is still in progress; set once it
|
|
59
|
+
* ends.
|
|
60
|
+
*/
|
|
61
|
+
status: 'completed' | 'busy' | 'no_answer' | 'failed' | 'canceled' | null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Your line that was called, E.164.
|
|
65
|
+
*/
|
|
66
|
+
to: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* When the call ended. Null while still in progress.
|
|
70
|
+
*/
|
|
71
|
+
ended_at?: string | null;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* When the call was answered. Null if it never connected.
|
|
75
|
+
*/
|
|
76
|
+
started_at?: string | null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface CallVoiceListResponse {
|
|
80
|
+
/**
|
|
81
|
+
* Calls for the phone number, newest first.
|
|
82
|
+
*/
|
|
83
|
+
call_voice: Array<CallVoiceRecord>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Cursor for the next page of results. Null when there are no more. Pass this
|
|
87
|
+
* value as the `cursor` parameter in the next request.
|
|
88
|
+
*/
|
|
89
|
+
next_cursor?: string | null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface CallVoiceListParams {
|
|
93
|
+
/**
|
|
94
|
+
* Pagination cursor from a previous next_cursor response
|
|
95
|
+
*/
|
|
96
|
+
cursor?: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Maximum number of calls to return
|
|
100
|
+
*/
|
|
101
|
+
limit?: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare namespace CallVoice {
|
|
105
|
+
export {
|
|
106
|
+
type CallVoiceRecord as CallVoiceRecord,
|
|
107
|
+
type CallVoiceListResponse as CallVoiceListResponse,
|
|
108
|
+
type CallVoiceListParams as CallVoiceListParams,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -678,9 +678,9 @@ export interface MessageContent {
|
|
|
678
678
|
>;
|
|
679
679
|
|
|
680
680
|
/**
|
|
681
|
-
* Messaging service type. Where this names the transport a message
|
|
682
|
-
* per-message: a chat's own `service` can differ from a message in it,
|
|
683
|
-
* can downgrade an individual message.
|
|
681
|
+
* @deprecated Messaging service type. Where this names the transport a message
|
|
682
|
+
* used, it is per-message: a chat's own `service` can differ from a message in it,
|
|
683
|
+
* and Apple can downgrade an individual message.
|
|
684
684
|
*/
|
|
685
685
|
preferred_service?: Shared.ServiceType;
|
|
686
686
|
|
|
@@ -1260,6 +1260,14 @@ export interface ChatCreateParams {
|
|
|
1260
1260
|
*/
|
|
1261
1261
|
to: Array<string>;
|
|
1262
1262
|
|
|
1263
|
+
/**
|
|
1264
|
+
* iMessage only. If the recipient has Do Not Disturb or another Focus on and the
|
|
1265
|
+
* message is delivered silently, alert them anyway (iMessage's "Notify Anyway").
|
|
1266
|
+
* Best effort: ignored for SMS and RCS, and a no-op when the recipient was already
|
|
1267
|
+
* notified.
|
|
1268
|
+
*/
|
|
1269
|
+
force_notify?: boolean;
|
|
1270
|
+
|
|
1263
1271
|
/**
|
|
1264
1272
|
* Send even though the recipient asked you to stop (`403`, error code `2024`).
|
|
1265
1273
|
* Applies to this request only: the opt-out stays in place, so the next send
|
|
@@ -1308,6 +1316,13 @@ export interface ChatSendVoicememoParams {
|
|
|
1308
1316
|
*/
|
|
1309
1317
|
attachment_id?: string;
|
|
1310
1318
|
|
|
1319
|
+
/**
|
|
1320
|
+
* iMessage only. If the recipient has Do Not Disturb or another Focus on and the
|
|
1321
|
+
* voice memo is delivered silently, alert them anyway (iMessage's "Notify
|
|
1322
|
+
* Anyway"). Best effort: a no-op when the recipient was already notified.
|
|
1323
|
+
*/
|
|
1324
|
+
force_notify?: boolean;
|
|
1325
|
+
|
|
1311
1326
|
/**
|
|
1312
1327
|
* Send even though the recipient asked you to stop (`403`, error code `2024`).
|
|
1313
1328
|
* Applies to this request only: the opt-out stays in place, so the next send
|
|
@@ -269,9 +269,9 @@ export interface SentMessage {
|
|
|
269
269
|
from_handle?: Shared.ChatHandle | null;
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
|
-
* Messaging service type. Where this names the transport a message
|
|
273
|
-
* per-message: a chat's own `service` can differ from a message in it,
|
|
274
|
-
* can downgrade an individual message.
|
|
272
|
+
* @deprecated Messaging service type. Where this names the transport a message
|
|
273
|
+
* used, it is per-message: a chat's own `service` can differ from a message in it,
|
|
274
|
+
* and Apple can downgrade an individual message.
|
|
275
275
|
*/
|
|
276
276
|
preferred_service?: Shared.ServiceType | null;
|
|
277
277
|
|
|
@@ -491,6 +491,14 @@ export interface MessageSendParams {
|
|
|
491
491
|
*/
|
|
492
492
|
message: ChatsAPI.MessageContent;
|
|
493
493
|
|
|
494
|
+
/**
|
|
495
|
+
* iMessage only. If the recipient has Do Not Disturb or another Focus on and the
|
|
496
|
+
* message is delivered silently, alert them anyway (iMessage's "Notify Anyway").
|
|
497
|
+
* Best effort: ignored for SMS and RCS, and a no-op when the recipient was already
|
|
498
|
+
* notified.
|
|
499
|
+
*/
|
|
500
|
+
force_notify?: boolean;
|
|
501
|
+
|
|
494
502
|
/**
|
|
495
503
|
* Send even though the recipient asked you to stop (`403`, error code `2024`).
|
|
496
504
|
* Applies to this request only: the opt-out stays in place, so the next send
|
|
@@ -29,6 +29,10 @@ export class ContactCard extends APIResource {
|
|
|
29
29
|
* existing card is never overwritten by accident. Use `PATCH /v3/contact_card` to
|
|
30
30
|
* change it.
|
|
31
31
|
*
|
|
32
|
+
* Contact cards are an iMessage-only feature. On a non-iMessage (SMS/RCS) line the
|
|
33
|
+
* response is `403` (`2011`) — the card is not supported there and no retry will
|
|
34
|
+
* help.
|
|
35
|
+
*
|
|
32
36
|
* Rate limited per phone number: `POST` and `PATCH` share a budget of 3 calls
|
|
33
37
|
* every 10 minutes. Further calls return `429`, with `Retry-After` carrying the
|
|
34
38
|
* wait.
|
|
@@ -78,6 +82,10 @@ export class ContactCard extends APIResource {
|
|
|
78
82
|
* The update did not reach the line, so the card is left not active — wait before
|
|
79
83
|
* retrying, because repeated attempts extend the rate limit.
|
|
80
84
|
*
|
|
85
|
+
* Contact cards are an iMessage-only feature. On a non-iMessage (SMS/RCS) line the
|
|
86
|
+
* response is `403` (`2011`) — the card is not supported there and no retry will
|
|
87
|
+
* help.
|
|
88
|
+
*
|
|
81
89
|
* Rate limited per phone number: `POST` and `PATCH` share a budget of 3 calls
|
|
82
90
|
* every 10 minutes. Further calls return `429`, with `Retry-After` carrying the
|
|
83
91
|
* wait.
|
package/src/resources/index.ts
CHANGED
|
@@ -21,6 +21,12 @@ export {
|
|
|
21
21
|
type BlockedHandleBlockParams,
|
|
22
22
|
type BlockedHandleUnblockParams,
|
|
23
23
|
} from './blocked-handles';
|
|
24
|
+
export {
|
|
25
|
+
CallVoice,
|
|
26
|
+
type CallVoiceRecord,
|
|
27
|
+
type CallVoiceListResponse,
|
|
28
|
+
type CallVoiceListParams,
|
|
29
|
+
} from './call-voice';
|
|
24
30
|
export {
|
|
25
31
|
Capability,
|
|
26
32
|
type HandleCheck,
|
|
@@ -115,6 +121,15 @@ export {
|
|
|
115
121
|
type PhoneNumberGetReputationAuditParams,
|
|
116
122
|
} from './phone-numbers';
|
|
117
123
|
export { Phonenumbers, type PhonenumberListResponse } from './phonenumbers';
|
|
124
|
+
export {
|
|
125
|
+
SipProfiles,
|
|
126
|
+
type SipProfile,
|
|
127
|
+
type SipProfileListResponse,
|
|
128
|
+
type SipProfileAssignResponse,
|
|
129
|
+
type SipProfileCreateParams,
|
|
130
|
+
type SipProfileUpdateParams,
|
|
131
|
+
type SipProfileAssignParams,
|
|
132
|
+
} from './sip-profiles';
|
|
118
133
|
export { WebhookEvents, type WebhookEventType, type WebhookEventListResponse } from './webhook-events';
|
|
119
134
|
export {
|
|
120
135
|
WebhookSubscriptions,
|
|
@@ -164,6 +179,7 @@ export {
|
|
|
164
179
|
type PhoneNumberStatusUpdatedWebhookEvent,
|
|
165
180
|
type PhoneNumberAssignedWebhookEvent,
|
|
166
181
|
type PhoneNumberReleasedWebhookEvent,
|
|
182
|
+
type PhoneNumberLineTypeUpdatedWebhookEvent,
|
|
167
183
|
type ConnectionCreatedWebhookEvent,
|
|
168
184
|
type ConnectionRevokedWebhookEvent,
|
|
169
185
|
type LocationSharingStartedWebhookEvent,
|
|
@@ -200,5 +216,12 @@ export {
|
|
|
200
216
|
type TeamMemberAddedWebhookEvent,
|
|
201
217
|
type TeamMemberSignedInWebhookEvent,
|
|
202
218
|
type TeamMemberSignedOutWebhookEvent,
|
|
219
|
+
type CallVoiceInitiatedWebhookEvent,
|
|
220
|
+
type CallVoiceRingingWebhookEvent,
|
|
221
|
+
type CallVoiceAnsweredWebhookEvent,
|
|
222
|
+
type CallVoiceEndedWebhookEvent,
|
|
223
|
+
type CallVoiceFailedWebhookEvent,
|
|
224
|
+
type CallVoiceDeclinedWebhookEvent,
|
|
225
|
+
type CallVoiceNoAnswerWebhookEvent,
|
|
203
226
|
type UnwrapWebhookEvent,
|
|
204
227
|
} from './webhooks';
|
|
@@ -138,11 +138,10 @@ export class Messages extends APIResource {
|
|
|
138
138
|
* - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
|
|
139
139
|
* use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
|
|
140
140
|
*
|
|
141
|
-
* ##
|
|
141
|
+
* ## Effects, decorations, inline stickers
|
|
142
142
|
*
|
|
143
|
-
* Set `message.
|
|
144
|
-
*
|
|
145
|
-
* send endpoints.
|
|
143
|
+
* Set `message.effect` and per-part `text_decorations` and `inline_stickers`
|
|
144
|
+
* exactly as on the other send endpoints.
|
|
146
145
|
*
|
|
147
146
|
* Always responds `202 Accepted` — chat creation is incidental to the send.
|
|
148
147
|
*
|
|
@@ -254,6 +253,9 @@ export class Messages extends APIResource {
|
|
|
254
253
|
* `PATCH /v3/messages/{messageId}/reactions/{reactionId}`. An animated image peels
|
|
255
254
|
* as an animated sticker, in whatever shape the file already has.
|
|
256
255
|
*
|
|
256
|
+
* **Polls** take stickers only. Any tapback on a poll message — standard or
|
|
257
|
+
* `custom` — is rejected with a 400.
|
|
258
|
+
*
|
|
257
259
|
* @example
|
|
258
260
|
* ```ts
|
|
259
261
|
* const response = await client.messages.addReaction(
|
|
@@ -465,9 +467,9 @@ export interface Message {
|
|
|
465
467
|
> | null;
|
|
466
468
|
|
|
467
469
|
/**
|
|
468
|
-
* Messaging service type. Where this names the transport a message
|
|
469
|
-
* per-message: a chat's own `service` can differ from a message in it,
|
|
470
|
-
* can downgrade an individual message.
|
|
470
|
+
* @deprecated Messaging service type. Where this names the transport a message
|
|
471
|
+
* used, it is per-message: a chat's own `service` can differ from a message in it,
|
|
472
|
+
* and Apple can downgrade an individual message.
|
|
471
473
|
*/
|
|
472
474
|
preferred_service?: Shared.ServiceType | null;
|
|
473
475
|
|
|
@@ -868,6 +870,14 @@ export interface MessageCreateParams {
|
|
|
868
870
|
*/
|
|
869
871
|
exclude_from?: Array<string>;
|
|
870
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Body param: iMessage only. If the recipient has Do Not Disturb or another Focus
|
|
875
|
+
* on and the message is delivered silently, alert them anyway (iMessage's "Notify
|
|
876
|
+
* Anyway"). Best effort: ignored for SMS and RCS, and a no-op when the recipient
|
|
877
|
+
* was already notified.
|
|
878
|
+
*/
|
|
879
|
+
force_notify?: boolean;
|
|
880
|
+
|
|
871
881
|
/**
|
|
872
882
|
* Body param: Send even though the recipient asked you to stop (`403`, error code
|
|
873
883
|
* `2024`). Applies to this request only: the opt-out stays in place, so the next
|
|
@@ -22,6 +22,19 @@ import { path } from '../internal/utils/path';
|
|
|
22
22
|
* pick an eligible number for you, skipping ineligible ones; if none of your assigned
|
|
23
23
|
* numbers are eligible, you get `409` (no `from` number was ever chosen, so there's no
|
|
24
24
|
* specific number to blame with a `403`).
|
|
25
|
+
*
|
|
26
|
+
* **Published vs unpublished.** A *published* number is available for your account to use.
|
|
27
|
+
* Only published numbers appear in `GET /v3/phone_numbers`.
|
|
28
|
+
*
|
|
29
|
+
* Unpublished numbers allow `GET` requests. `POST`, `PUT`, `PATCH`, and `DELETE` requests that
|
|
30
|
+
* change a chat return `403` with error code `2033` (`Phone number is unpublished`).
|
|
31
|
+
*
|
|
32
|
+
* A number's existing data is preserved when its status changes to unpublished. Unpublished
|
|
33
|
+
* status alone does not block reads, blocked-handle management, or deletion
|
|
34
|
+
* of your data. Existing authorization, retention, and endpoint rules still apply.
|
|
35
|
+
*
|
|
36
|
+
* Webhook events are suppressed for affected numbers when their publication status is known to
|
|
37
|
+
* be unpublished.
|
|
25
38
|
*/
|
|
26
39
|
export class PhoneNumbers extends APIResource {
|
|
27
40
|
/**
|
|
@@ -370,6 +383,14 @@ export namespace PhoneNumberListResponse {
|
|
|
370
383
|
*/
|
|
371
384
|
id: string;
|
|
372
385
|
|
|
386
|
+
/**
|
|
387
|
+
* Operational status of the line (distinct from `reputation`).
|
|
388
|
+
*
|
|
389
|
+
* - `ACTIVE` — The line is not flagged and can be used normally.
|
|
390
|
+
* - `FLAGGED` — The line has been flagged and may have limited functionality.
|
|
391
|
+
*/
|
|
392
|
+
line_status: 'ACTIVE' | 'FLAGGED';
|
|
393
|
+
|
|
373
394
|
/**
|
|
374
395
|
* Phone number in E.164 format
|
|
375
396
|
*/
|
|
@@ -21,6 +21,19 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
21
21
|
* pick an eligible number for you, skipping ineligible ones; if none of your assigned
|
|
22
22
|
* numbers are eligible, you get `409` (no `from` number was ever chosen, so there's no
|
|
23
23
|
* specific number to blame with a `403`).
|
|
24
|
+
*
|
|
25
|
+
* **Published vs unpublished.** A *published* number is available for your account to use.
|
|
26
|
+
* Only published numbers appear in `GET /v3/phone_numbers`.
|
|
27
|
+
*
|
|
28
|
+
* Unpublished numbers allow `GET` requests. `POST`, `PUT`, `PATCH`, and `DELETE` requests that
|
|
29
|
+
* change a chat return `403` with error code `2033` (`Phone number is unpublished`).
|
|
30
|
+
*
|
|
31
|
+
* A number's existing data is preserved when its status changes to unpublished. Unpublished
|
|
32
|
+
* status alone does not block reads, blocked-handle management, or deletion
|
|
33
|
+
* of your data. Existing authorization, retention, and endpoint rules still apply.
|
|
34
|
+
*
|
|
35
|
+
* Webhook events are suppressed for affected numbers when their publication status is known to
|
|
36
|
+
* be unpublished.
|
|
24
37
|
*/
|
|
25
38
|
export class Phonenumbers extends APIResource {
|
|
26
39
|
/**
|
package/src/resources/shared.ts
CHANGED
|
@@ -160,8 +160,10 @@ export interface Reaction {
|
|
|
160
160
|
type: ReactionType;
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
|
-
* Identifier for this reaction
|
|
164
|
-
* `
|
|
163
|
+
* Identifier for this reaction, the same value as `reaction_id` on the
|
|
164
|
+
* `reaction.added` and `reaction.removed` webhooks. Changing a tapback keeps the
|
|
165
|
+
* same id. Pass it to `PATCH /v3/messages/{messageId}/reactions/{reactionId}` to
|
|
166
|
+
* move a sticker.
|
|
165
167
|
*
|
|
166
168
|
* Stickers placed before this API shipped can be read but not moved: the
|
|
167
169
|
* device-side reference needed to reposition them was never recorded, so `PATCH`
|