@linqapp/sdk 0.80.0 → 0.82.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 +36 -18
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +36 -18
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +11 -5
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +11 -5
- 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 +17 -13
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +17 -13
- 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 +534 -52
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +534 -52
- 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 +37 -18
- package/src/resources/phone-numbers.ts +21 -0
- package/src/resources/phonenumbers.ts +13 -0
- package/src/resources/shared.ts +17 -13
- package/src/resources/sip-profiles.ts +282 -0
- package/src/resources/webhook-events.ts +1 -7
- package/src/resources/webhooks.ts +1273 -285
- 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/resources/shared.ts
CHANGED
|
@@ -153,15 +153,18 @@ export interface Reaction {
|
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
156
|
-
* emphasize, question. Custom
|
|
157
|
-
* emoji in the custom_emoji field
|
|
158
|
-
*
|
|
156
|
+
* emphasize, question. Custom tapbacks have type "custom": an emoji tapback
|
|
157
|
+
* carries the emoji in the custom_emoji field, and an image tapback carries the
|
|
158
|
+
* image in the sticker field. Sticker reactions have type "sticker" with sticker
|
|
159
|
+
* attachment details in the sticker field.
|
|
159
160
|
*/
|
|
160
161
|
type: ReactionType;
|
|
161
162
|
|
|
162
163
|
/**
|
|
163
|
-
* Identifier for this reaction
|
|
164
|
-
* `
|
|
164
|
+
* Identifier for this reaction, the same value as `reaction_id` on the
|
|
165
|
+
* `reaction.added` and `reaction.removed` webhooks. Changing a tapback keeps the
|
|
166
|
+
* same id. Pass it to `PATCH /v3/messages/{messageId}/reactions/{reactionId}` to
|
|
167
|
+
* move a sticker.
|
|
165
168
|
*
|
|
166
169
|
* Stickers placed before this API shipped can be read but not moved: the
|
|
167
170
|
* device-side reference needed to reposition them was never recorded, so `PATCH`
|
|
@@ -170,21 +173,21 @@ export interface Reaction {
|
|
|
170
173
|
id?: string;
|
|
171
174
|
|
|
172
175
|
/**
|
|
173
|
-
* Custom emoji if type is "custom", null otherwise
|
|
176
|
+
* Custom emoji if type is "custom" and the tapback is an emoji, null otherwise
|
|
174
177
|
*/
|
|
175
178
|
custom_emoji?: string | null;
|
|
176
179
|
|
|
177
180
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
181
|
+
* The image when type is "sticker", or when type is "custom" and the tapback is an
|
|
182
|
+
* image. Null otherwise.
|
|
180
183
|
*/
|
|
181
184
|
sticker?: Reaction.Sticker | null;
|
|
182
185
|
}
|
|
183
186
|
|
|
184
187
|
export namespace Reaction {
|
|
185
188
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
189
|
+
* The image when type is "sticker", or when type is "custom" and the tapback is an
|
|
190
|
+
* image. Null otherwise.
|
|
188
191
|
*/
|
|
189
192
|
export interface Sticker {
|
|
190
193
|
/**
|
|
@@ -216,9 +219,10 @@ export namespace Reaction {
|
|
|
216
219
|
|
|
217
220
|
/**
|
|
218
221
|
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
219
|
-
* emphasize, question. Custom
|
|
220
|
-
* emoji in the custom_emoji field
|
|
221
|
-
*
|
|
222
|
+
* emphasize, question. Custom tapbacks have type "custom": an emoji tapback
|
|
223
|
+
* carries the emoji in the custom_emoji field, and an image tapback carries the
|
|
224
|
+
* image in the sticker field. Sticker reactions have type "sticker" with sticker
|
|
225
|
+
* attachment details in the sticker field.
|
|
222
226
|
*/
|
|
223
227
|
export type ReactionType =
|
|
224
228
|
| 'love'
|
|
@@ -0,0 +1,282 @@
|
|
|
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 { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* ## SIP configuration
|
|
11
|
+
*
|
|
12
|
+
* Add these IP ranges to your SIP endpoint's allowlist:
|
|
13
|
+
*
|
|
14
|
+
* ```
|
|
15
|
+
* 54.172.60.0/30
|
|
16
|
+
* 54.244.51.0/30
|
|
17
|
+
* 168.86.128.0/18
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Set `primary_uri` to your endpoint as scheme + host — `sips:` for TLS or
|
|
21
|
+
* `sip:` for UDP, with no user part (we add it). Each call arrives at your
|
|
22
|
+
* endpoint as:
|
|
23
|
+
*
|
|
24
|
+
* ```
|
|
25
|
+
* sip:<called-number>@<your-host>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* so you can route on the dialed number. The caller's number is in the
|
|
29
|
+
* `From` header in E.164. Media (RTP) uses UDP ports 10000–60000.
|
|
30
|
+
*/
|
|
31
|
+
export class SipProfiles extends APIResource {
|
|
32
|
+
/**
|
|
33
|
+
* ## SIP configuration
|
|
34
|
+
*
|
|
35
|
+
* Add these IP ranges to your SIP endpoint's allowlist:
|
|
36
|
+
*
|
|
37
|
+
* ```
|
|
38
|
+
* 54.172.60.0/30
|
|
39
|
+
* 54.244.51.0/30
|
|
40
|
+
* 168.86.128.0/18
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Set `primary_uri` to your endpoint as scheme + host — `sips:` for TLS or `sip:`
|
|
44
|
+
* for UDP, with no user part (we add it). Each call arrives at your endpoint as:
|
|
45
|
+
*
|
|
46
|
+
* ```
|
|
47
|
+
* sip:<called-number>@<your-host>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* so you can route on the dialed number. The caller's number is in the `From`
|
|
51
|
+
* header in E.164. Media (RTP) uses UDP ports 10000–60000.
|
|
52
|
+
*
|
|
53
|
+
* ---
|
|
54
|
+
*
|
|
55
|
+
* Create a SIP routing profile for your inbound calls, then assign it to a phone
|
|
56
|
+
* number to start routing calls to its SIP URI.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const sipProfile = await client.sipProfiles.create({
|
|
61
|
+
* name: 'byoc-primary',
|
|
62
|
+
* primary_uri: 'sips:sip.partner.example',
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
create(body: SipProfileCreateParams, options?: RequestOptions): APIPromise<SipProfile> {
|
|
67
|
+
return this._client.post('/v3/sip-profiles', { body, ...options });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Retrieve details for a specific SIP profile.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const sipProfile = await client.sipProfiles.retrieve(
|
|
76
|
+
* 'sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
retrieve(sipProfileID: string, options?: RequestOptions): APIPromise<SipProfile> {
|
|
81
|
+
return this._client.get(path`/v3/sip-profiles/${sipProfileID}`, options);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Update a SIP profile. Only the fields you send are changed; omitted fields keep
|
|
86
|
+
* their current value. Set `backup_uri` to an empty string to clear it.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const sipProfile = await client.sipProfiles.update(
|
|
91
|
+
* 'sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c',
|
|
92
|
+
* { name: 'byoc-east' },
|
|
93
|
+
* );
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
update(
|
|
97
|
+
sipProfileID: string,
|
|
98
|
+
body: SipProfileUpdateParams,
|
|
99
|
+
options?: RequestOptions,
|
|
100
|
+
): APIPromise<SipProfile> {
|
|
101
|
+
return this._client.put(path`/v3/sip-profiles/${sipProfileID}`, { body, ...options });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Retrieve all SIP profiles for the authenticated partner.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const sipProfiles = await client.sipProfiles.list();
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
list(options?: RequestOptions): APIPromise<SipProfileListResponse> {
|
|
113
|
+
return this._client.get('/v3/sip-profiles', options);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Delete a SIP profile. The profile must not be assigned to any phone number;
|
|
118
|
+
* unassign it first or the request is rejected.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* await client.sipProfiles.delete(
|
|
123
|
+
* 'sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c',
|
|
124
|
+
* );
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
delete(sipProfileID: string, options?: RequestOptions): APIPromise<void> {
|
|
128
|
+
return this._client.delete(path`/v3/sip-profiles/${sipProfileID}`, {
|
|
129
|
+
...options,
|
|
130
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* ## SIP configuration
|
|
136
|
+
*
|
|
137
|
+
* Add these IP ranges to your SIP endpoint's allowlist:
|
|
138
|
+
*
|
|
139
|
+
* ```
|
|
140
|
+
* 54.172.60.0/30
|
|
141
|
+
* 54.244.51.0/30
|
|
142
|
+
* 168.86.128.0/18
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* Set `primary_uri` to your endpoint as scheme + host — `sips:` for TLS or `sip:`
|
|
146
|
+
* for UDP, with no user part (we add it). Each call arrives at your endpoint as:
|
|
147
|
+
*
|
|
148
|
+
* ```
|
|
149
|
+
* sip:<called-number>@<your-host>
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* so you can route on the dialed number. The caller's number is in the `From`
|
|
153
|
+
* header in E.164. Media (RTP) uses UDP ports 10000–60000.
|
|
154
|
+
*
|
|
155
|
+
* ---
|
|
156
|
+
*
|
|
157
|
+
* Assign a SIP profile to route inbound calls to its SIP URI. This takes
|
|
158
|
+
* precedence over an existing `forwarding_number` without clearing it. Send
|
|
159
|
+
* `sip_profile_id: null` to remove the SIP assignment and resume existing
|
|
160
|
+
* forwarding, if configured. Allow about 5 minutes for routing changes to
|
|
161
|
+
* propagate. The phone number must belong to the authenticated partner.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* const response = await client.sipProfiles.assign(
|
|
166
|
+
* '+14254758217',
|
|
167
|
+
* {
|
|
168
|
+
* sip_profile_id: 'sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c',
|
|
169
|
+
* },
|
|
170
|
+
* );
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
assign(
|
|
174
|
+
phoneNumber: string,
|
|
175
|
+
body: SipProfileAssignParams,
|
|
176
|
+
options?: RequestOptions,
|
|
177
|
+
): APIPromise<SipProfileAssignResponse> {
|
|
178
|
+
return this._client.put(path`/v3/phone-numbers/${phoneNumber}/sip-profile`, { body, ...options });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface SipProfile {
|
|
183
|
+
/**
|
|
184
|
+
* Unique identifier for the SIP profile
|
|
185
|
+
*/
|
|
186
|
+
id: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* How many phone numbers reference this profile
|
|
190
|
+
*/
|
|
191
|
+
assigned_number_count: number;
|
|
192
|
+
|
|
193
|
+
created_at: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Human-readable name
|
|
197
|
+
*/
|
|
198
|
+
name: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we
|
|
202
|
+
* set it to the called number on each call.
|
|
203
|
+
*/
|
|
204
|
+
primary_uri: string;
|
|
205
|
+
|
|
206
|
+
updated_at: string;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Monotonic version, incremented on each update
|
|
210
|
+
*/
|
|
211
|
+
version: number;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Optional failover SIP URI. Null when unset.
|
|
215
|
+
*/
|
|
216
|
+
backup_uri?: string | null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface SipProfileListResponse {
|
|
220
|
+
/**
|
|
221
|
+
* The partner's SIP profiles
|
|
222
|
+
*/
|
|
223
|
+
sip_profiles: Array<SipProfile>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface SipProfileAssignResponse {
|
|
227
|
+
/**
|
|
228
|
+
* The phone number whose assignment changed
|
|
229
|
+
*/
|
|
230
|
+
phone_number: string;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* The assigned SIP profile id, or null when cleared
|
|
234
|
+
*/
|
|
235
|
+
sip_profile_id: string | null;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface SipProfileCreateParams {
|
|
239
|
+
name: string;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Your SIP endpoint as scheme + host, e.g. `sips:sip.partner.example`. Must start
|
|
243
|
+
* with `sip:` (UDP) or `sips:` (TLS) — the scheme sets the transport. Do not
|
|
244
|
+
* include a user part: we set it to the called number on each call
|
|
245
|
+
* (`sip:<called-number>@<your-host>`). A bare host with no scheme is rejected.
|
|
246
|
+
*/
|
|
247
|
+
primary_uri: string;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Optional failover SIP URI
|
|
251
|
+
*/
|
|
252
|
+
backup_uri?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface SipProfileUpdateParams {
|
|
256
|
+
/**
|
|
257
|
+
* Set to "" to clear the backup URI.
|
|
258
|
+
*/
|
|
259
|
+
backup_uri?: string;
|
|
260
|
+
|
|
261
|
+
name?: string;
|
|
262
|
+
|
|
263
|
+
primary_uri?: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface SipProfileAssignParams {
|
|
267
|
+
/**
|
|
268
|
+
* The SIP profile to assign, or null to clear the number's current assignment.
|
|
269
|
+
*/
|
|
270
|
+
sip_profile_id: string | null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export declare namespace SipProfiles {
|
|
274
|
+
export {
|
|
275
|
+
type SipProfile as SipProfile,
|
|
276
|
+
type SipProfileListResponse as SipProfileListResponse,
|
|
277
|
+
type SipProfileAssignResponse as SipProfileAssignResponse,
|
|
278
|
+
type SipProfileCreateParams as SipProfileCreateParams,
|
|
279
|
+
type SipProfileUpdateParams as SipProfileUpdateParams,
|
|
280
|
+
type SipProfileAssignParams as SipProfileAssignParams,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
@@ -182,14 +182,8 @@ export type WebhookEventType =
|
|
|
182
182
|
| 'phone_number.status_updated'
|
|
183
183
|
| 'phone_number.assigned'
|
|
184
184
|
| 'phone_number.released'
|
|
185
|
+
| 'phone_number.line_type_updated'
|
|
185
186
|
| 'contact_card.received'
|
|
186
|
-
| 'call.initiated'
|
|
187
|
-
| 'call.ringing'
|
|
188
|
-
| 'call.answered'
|
|
189
|
-
| 'call.ended'
|
|
190
|
-
| 'call.failed'
|
|
191
|
-
| 'call.declined'
|
|
192
|
-
| 'call.no_answer'
|
|
193
187
|
| 'location.sharing.started'
|
|
194
188
|
| 'location.sharing.stopped'
|
|
195
189
|
| 'payment.succeeded'
|