@linqapp/sdk 0.80.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +77 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +77 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +75 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +75 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/available-number.d.mts +13 -0
  12. package/resources/available-number.d.mts.map +1 -1
  13. package/resources/available-number.d.ts +13 -0
  14. package/resources/available-number.d.ts.map +1 -1
  15. package/resources/available-number.js +13 -0
  16. package/resources/available-number.js.map +1 -1
  17. package/resources/available-number.mjs +13 -0
  18. package/resources/available-number.mjs.map +1 -1
  19. package/resources/call-voice.d.mts +82 -0
  20. package/resources/call-voice.d.mts.map +1 -0
  21. package/resources/call-voice.d.ts +82 -0
  22. package/resources/call-voice.d.ts.map +1 -0
  23. package/resources/call-voice.js +35 -0
  24. package/resources/call-voice.js.map +1 -0
  25. package/resources/call-voice.mjs +31 -0
  26. package/resources/call-voice.mjs.map +1 -0
  27. package/resources/chats/chats.d.mts +16 -3
  28. package/resources/chats/chats.d.mts.map +1 -1
  29. package/resources/chats/chats.d.ts +16 -3
  30. package/resources/chats/chats.d.ts.map +1 -1
  31. package/resources/chats/chats.js.map +1 -1
  32. package/resources/chats/chats.mjs.map +1 -1
  33. package/resources/chats/messages.d.mts +10 -3
  34. package/resources/chats/messages.d.mts.map +1 -1
  35. package/resources/chats/messages.d.ts +10 -3
  36. package/resources/chats/messages.d.ts.map +1 -1
  37. package/resources/chats/polls.d.mts +1 -1
  38. package/resources/chats/polls.d.ts +1 -1
  39. package/resources/contact-card.d.mts +8 -0
  40. package/resources/contact-card.d.mts.map +1 -1
  41. package/resources/contact-card.d.ts +8 -0
  42. package/resources/contact-card.d.ts.map +1 -1
  43. package/resources/contact-card.js +8 -0
  44. package/resources/contact-card.js.map +1 -1
  45. package/resources/contact-card.mjs +8 -0
  46. package/resources/contact-card.mjs.map +1 -1
  47. package/resources/index.d.mts +3 -1
  48. package/resources/index.d.mts.map +1 -1
  49. package/resources/index.d.ts +3 -1
  50. package/resources/index.d.ts.map +1 -1
  51. package/resources/index.js +5 -1
  52. package/resources/index.js.map +1 -1
  53. package/resources/index.mjs +2 -0
  54. package/resources/index.mjs.map +1 -1
  55. package/resources/messages/messages.d.mts +16 -7
  56. package/resources/messages/messages.d.mts.map +1 -1
  57. package/resources/messages/messages.d.ts +16 -7
  58. package/resources/messages/messages.d.ts.map +1 -1
  59. package/resources/messages/messages.js +6 -4
  60. package/resources/messages/messages.js.map +1 -1
  61. package/resources/messages/messages.mjs +6 -4
  62. package/resources/messages/messages.mjs.map +1 -1
  63. package/resources/phone-numbers.d.mts +20 -0
  64. package/resources/phone-numbers.d.mts.map +1 -1
  65. package/resources/phone-numbers.d.ts +20 -0
  66. package/resources/phone-numbers.d.ts.map +1 -1
  67. package/resources/phone-numbers.js +13 -0
  68. package/resources/phone-numbers.js.map +1 -1
  69. package/resources/phone-numbers.mjs +13 -0
  70. package/resources/phone-numbers.mjs.map +1 -1
  71. package/resources/phonenumbers.d.mts +13 -0
  72. package/resources/phonenumbers.d.mts.map +1 -1
  73. package/resources/phonenumbers.d.ts +13 -0
  74. package/resources/phonenumbers.d.ts.map +1 -1
  75. package/resources/phonenumbers.js +13 -0
  76. package/resources/phonenumbers.js.map +1 -1
  77. package/resources/phonenumbers.mjs +13 -0
  78. package/resources/phonenumbers.mjs.map +1 -1
  79. package/resources/shared.d.mts +4 -2
  80. package/resources/shared.d.mts.map +1 -1
  81. package/resources/shared.d.ts +4 -2
  82. package/resources/shared.d.ts.map +1 -1
  83. package/resources/sip-profiles.d.mts +224 -0
  84. package/resources/sip-profiles.d.mts.map +1 -0
  85. package/resources/sip-profiles.d.ts +224 -0
  86. package/resources/sip-profiles.d.ts.map +1 -0
  87. package/resources/sip-profiles.js +168 -0
  88. package/resources/sip-profiles.js.map +1 -0
  89. package/resources/sip-profiles.mjs +164 -0
  90. package/resources/sip-profiles.mjs.map +1 -0
  91. package/resources/webhook-events.d.mts +1 -1
  92. package/resources/webhook-events.d.mts.map +1 -1
  93. package/resources/webhook-events.d.ts +1 -1
  94. package/resources/webhook-events.d.ts.map +1 -1
  95. package/resources/webhooks.d.mts +524 -44
  96. package/resources/webhooks.d.mts.map +1 -1
  97. package/resources/webhooks.d.ts +524 -44
  98. package/resources/webhooks.d.ts.map +1 -1
  99. package/src/client.ts +121 -0
  100. package/src/resources/available-number.ts +13 -0
  101. package/src/resources/call-voice.ts +110 -0
  102. package/src/resources/chats/chats.ts +18 -3
  103. package/src/resources/chats/messages.ts +11 -3
  104. package/src/resources/chats/polls.ts +1 -1
  105. package/src/resources/contact-card.ts +8 -0
  106. package/src/resources/index.ts +23 -0
  107. package/src/resources/messages/messages.ts +17 -7
  108. package/src/resources/phone-numbers.ts +21 -0
  109. package/src/resources/phonenumbers.ts +13 -0
  110. package/src/resources/shared.ts +4 -2
  111. package/src/resources/sip-profiles.ts +282 -0
  112. package/src/resources/webhook-events.ts +1 -7
  113. package/src/resources/webhooks.ts +1263 -277
  114. package/src/version.ts +1 -1
  115. package/version.d.mts +1 -1
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
  118. package/version.mjs +1 -1
@@ -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'