@linqapp/sdk 0.27.1 → 0.28.1

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 (149) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +59 -9
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +59 -9
  5. package/client.d.ts.map +1 -1
  6. package/client.js +63 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +64 -6
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/tslib.js +17 -17
  51. package/internal/utils/query.d.mts +0 -3
  52. package/internal/utils/query.d.mts.map +1 -1
  53. package/internal/utils/query.d.ts +0 -3
  54. package/internal/utils/query.d.ts.map +1 -1
  55. package/internal/utils/query.js +3 -16
  56. package/internal/utils/query.js.map +1 -1
  57. package/internal/utils/query.mjs +2 -16
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/resources/attachments.d.mts +1 -1
  61. package/resources/attachments.d.ts +1 -1
  62. package/resources/attachments.js +1 -1
  63. package/resources/attachments.mjs +1 -1
  64. package/resources/available-number.d.mts +58 -0
  65. package/resources/available-number.d.mts.map +1 -0
  66. package/resources/available-number.d.ts +58 -0
  67. package/resources/available-number.d.ts.map +1 -0
  68. package/resources/available-number.js +36 -0
  69. package/resources/available-number.js.map +1 -0
  70. package/resources/available-number.mjs +32 -0
  71. package/resources/available-number.mjs.map +1 -0
  72. package/resources/chats/chats.d.mts +49 -12
  73. package/resources/chats/chats.d.mts.map +1 -1
  74. package/resources/chats/chats.d.ts +49 -12
  75. package/resources/chats/chats.d.ts.map +1 -1
  76. package/resources/chats/chats.js.map +1 -1
  77. package/resources/chats/chats.mjs.map +1 -1
  78. package/resources/chats/location.d.mts +9 -8
  79. package/resources/chats/location.d.mts.map +1 -1
  80. package/resources/chats/location.d.ts +9 -8
  81. package/resources/chats/location.d.ts.map +1 -1
  82. package/resources/chats/location.js +9 -8
  83. package/resources/chats/location.js.map +1 -1
  84. package/resources/chats/location.mjs +9 -8
  85. package/resources/chats/location.mjs.map +1 -1
  86. package/resources/chats/messages.d.mts +71 -8
  87. package/resources/chats/messages.d.mts.map +1 -1
  88. package/resources/chats/messages.d.ts +71 -8
  89. package/resources/chats/messages.d.ts.map +1 -1
  90. package/resources/chats/messages.js +40 -0
  91. package/resources/chats/messages.js.map +1 -1
  92. package/resources/chats/messages.mjs +40 -0
  93. package/resources/chats/messages.mjs.map +1 -1
  94. package/resources/contact-card.d.mts +1 -2
  95. package/resources/contact-card.d.mts.map +1 -1
  96. package/resources/contact-card.d.ts +1 -2
  97. package/resources/contact-card.d.ts.map +1 -1
  98. package/resources/index.d.mts +3 -2
  99. package/resources/index.d.mts.map +1 -1
  100. package/resources/index.d.ts +3 -2
  101. package/resources/index.d.ts.map +1 -1
  102. package/resources/index.js +3 -1
  103. package/resources/index.js.map +1 -1
  104. package/resources/index.mjs +2 -1
  105. package/resources/index.mjs.map +1 -1
  106. package/resources/messages.d.mts +387 -9
  107. package/resources/messages.d.mts.map +1 -1
  108. package/resources/messages.d.ts +387 -9
  109. package/resources/messages.d.ts.map +1 -1
  110. package/resources/messages.js +148 -0
  111. package/resources/messages.js.map +1 -1
  112. package/resources/messages.mjs +148 -0
  113. package/resources/messages.mjs.map +1 -1
  114. package/resources/phone-numbers.d.mts +107 -21
  115. package/resources/phone-numbers.d.mts.map +1 -1
  116. package/resources/phone-numbers.d.ts +107 -21
  117. package/resources/phone-numbers.d.ts.map +1 -1
  118. package/resources/phone-numbers.js +23 -0
  119. package/resources/phone-numbers.js.map +1 -1
  120. package/resources/phone-numbers.mjs +23 -0
  121. package/resources/phone-numbers.mjs.map +1 -1
  122. package/resources/webhooks.d.mts +28 -36
  123. package/resources/webhooks.d.mts.map +1 -1
  124. package/resources/webhooks.d.ts +28 -36
  125. package/resources/webhooks.d.ts.map +1 -1
  126. package/src/client.ts +94 -8
  127. package/src/internal/qs/LICENSE.md +13 -0
  128. package/src/internal/qs/README.md +3 -0
  129. package/src/internal/qs/formats.ts +10 -0
  130. package/src/internal/qs/index.ts +13 -0
  131. package/src/internal/qs/stringify.ts +385 -0
  132. package/src/internal/qs/types.ts +71 -0
  133. package/src/internal/qs/utils.ts +265 -0
  134. package/src/internal/utils/query.ts +2 -18
  135. package/src/resources/attachments.ts +1 -1
  136. package/src/resources/available-number.ts +72 -0
  137. package/src/resources/chats/chats.ts +51 -13
  138. package/src/resources/chats/location.ts +9 -8
  139. package/src/resources/chats/messages.ts +71 -9
  140. package/src/resources/contact-card.ts +1 -2
  141. package/src/resources/index.ts +15 -1
  142. package/src/resources/messages.ts +437 -9
  143. package/src/resources/phone-numbers.ts +127 -21
  144. package/src/resources/webhooks.ts +30 -44
  145. package/src/version.ts +1 -1
  146. package/version.d.mts +1 -1
  147. package/version.d.ts +1 -1
  148. package/version.js +1 -1
  149. package/version.mjs +1 -1
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
6
7
 
7
8
  /**
8
9
  * Phone Numbers represent the phone numbers assigned to your partner account.
@@ -18,10 +19,54 @@ export class PhoneNumbers extends APIResource {
18
19
  * Returns all phone numbers assigned to the authenticated partner. Use this
19
20
  * endpoint to discover which phone numbers are available for use as the `from`
20
21
  * field when creating a chat, listing chats, or sending a voice memo.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const phoneNumbers = await client.phoneNumbers.list();
26
+ * ```
21
27
  */
22
28
  list(options?: RequestOptions): APIPromise<PhoneNumberListResponse> {
23
29
  return this._client.get('/v3/phone_numbers', options);
24
30
  }
31
+
32
+ /**
33
+ * Updates the forwarding number for a phone number. The forwarding number is where
34
+ * inbound calls will be forwarded to.
35
+ *
36
+ * Pass an empty string to clear the forwarding number.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const phoneNumber = await client.phoneNumbers.update(
41
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
42
+ * { forwarding_number: '+12025559999' },
43
+ * );
44
+ * ```
45
+ */
46
+ update(
47
+ phoneNumberID: string,
48
+ body: PhoneNumberUpdateParams,
49
+ options?: RequestOptions,
50
+ ): APIPromise<PhoneNumberUpdateResponse> {
51
+ return this._client.put(path`/v3/phone_numbers/${phoneNumberID}`, { body, ...options });
52
+ }
53
+ }
54
+
55
+ export interface PhoneNumberUpdateResponse {
56
+ /**
57
+ * Unique identifier for the phone number
58
+ */
59
+ id: string;
60
+
61
+ /**
62
+ * The forwarding number after the update. Null when cleared.
63
+ */
64
+ forwarding_number: string | null;
65
+
66
+ /**
67
+ * Phone number in E.164 format
68
+ */
69
+ phone_number: string;
25
70
  }
26
71
 
27
72
  export interface PhoneNumberListResponse {
@@ -39,15 +84,15 @@ export namespace PhoneNumberListResponse {
39
84
  id: string;
40
85
 
41
86
  /**
42
- * **[BETA]** Current health for a phone line. Always present — lines start at
43
- * `HEALTHY` and may shift based on aggregate engagement and delivery signals
44
- * across all conversations on the line.
87
+ * @deprecated **[BETA]** Current reputation for a phone line. Always present —
88
+ * lines start at `HEALTHY` and may shift based on aggregate engagement and
89
+ * delivery signals across all conversations on the line.
45
90
  *
46
- * Unlike chat health, line health does not include `opted_out` — opt-out applies
47
- * to individual recipients, not the whole line.
91
+ * Unlike chat health, line reputation does not include `opted_out` — opt-out
92
+ * applies to individual recipients, not the whole line.
48
93
  *
49
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
50
- * status means and how to react.
94
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
95
+ * what each status means and how to react.
51
96
  */
52
97
  health_status: PhoneNumber.HealthStatus;
53
98
 
@@ -55,34 +100,84 @@ export namespace PhoneNumberListResponse {
55
100
  * Phone number in E.164 format
56
101
  */
57
102
  phone_number: string;
103
+
104
+ /**
105
+ * **[BETA]** Current reputation for a phone line. Always present — lines start at
106
+ * `HEALTHY` and may shift based on aggregate engagement and delivery signals
107
+ * across all conversations on the line.
108
+ *
109
+ * Unlike chat health, line reputation does not include `opted_out` — opt-out
110
+ * applies to individual recipients, not the whole line.
111
+ *
112
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
113
+ * what each status means and how to react.
114
+ */
115
+ reputation: PhoneNumber.Reputation;
116
+
117
+ /**
118
+ * The forwarding number associated with this phone number, in E.164 format. Null
119
+ * when no forwarding number is configured.
120
+ */
121
+ forwarding_number?: string | null;
58
122
  }
59
123
 
60
124
  export namespace PhoneNumber {
61
125
  /**
62
- * **[BETA]** Current health for a phone line. Always present — lines start at
126
+ * @deprecated **[BETA]** Current reputation for a phone line. Always present —
127
+ * lines start at `HEALTHY` and may shift based on aggregate engagement and
128
+ * delivery signals across all conversations on the line.
129
+ *
130
+ * Unlike chat health, line reputation does not include `opted_out` — opt-out
131
+ * applies to individual recipients, not the whole line.
132
+ *
133
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
134
+ * what each status means and how to react.
135
+ */
136
+ export interface HealthStatus {
137
+ /**
138
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
139
+ */
140
+ doc_url: string;
141
+
142
+ /**
143
+ * Current reputation of this phone line.
144
+ *
145
+ * - `HEALTHY` — The line is in good standing. Send normally.
146
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
147
+ * send pace and review your messaging patterns.
148
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
149
+ * Pause outbound on the line until it recovers.
150
+ *
151
+ * Defaults to `HEALTHY` for lines that have not yet been scored.
152
+ */
153
+ status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
154
+ }
155
+
156
+ /**
157
+ * **[BETA]** Current reputation for a phone line. Always present — lines start at
63
158
  * `HEALTHY` and may shift based on aggregate engagement and delivery signals
64
159
  * across all conversations on the line.
65
160
  *
66
- * Unlike chat health, line health does not include `opted_out` — opt-out applies
67
- * to individual recipients, not the whole line.
161
+ * Unlike chat health, line reputation does not include `opted_out` — opt-out
162
+ * applies to individual recipients, not the whole line.
68
163
  *
69
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
70
- * status means and how to react.
164
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
165
+ * what each status means and how to react.
71
166
  */
72
- export interface HealthStatus {
167
+ export interface Reputation {
73
168
  /**
74
- * Deep-link to the relevant section of the Phone Health guide for this status.
169
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
75
170
  */
76
171
  doc_url: string;
77
172
 
78
173
  /**
79
- * Current health of this phone line as assessed by risk-service.
174
+ * Current reputation of this phone line.
80
175
  *
81
- * - `HEALTHY` — No elevated risk detected.
82
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
83
- * reviewing messaging patterns.
84
- * - `CRITICAL` — High risk; further sending may result in line flagging or
85
- * restriction.
176
+ * - `HEALTHY` — The line is in good standing. Send normally.
177
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
178
+ * send pace and review your messaging patterns.
179
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
180
+ * Pause outbound on the line until it recovers.
86
181
  *
87
182
  * Defaults to `HEALTHY` for lines that have not yet been scored.
88
183
  */
@@ -91,6 +186,17 @@ export namespace PhoneNumberListResponse {
91
186
  }
92
187
  }
93
188
 
189
+ export interface PhoneNumberUpdateParams {
190
+ /**
191
+ * The forwarding number in E.164 format. Set to null or empty string to clear.
192
+ */
193
+ forwarding_number: string | null;
194
+ }
195
+
94
196
  export declare namespace PhoneNumbers {
95
- export { type PhoneNumberListResponse as PhoneNumberListResponse };
197
+ export {
198
+ type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse,
199
+ type PhoneNumberListResponse as PhoneNumberListResponse,
200
+ type PhoneNumberUpdateParams as PhoneNumberUpdateParams,
201
+ };
96
202
  }
@@ -218,7 +218,7 @@ export namespace MessageEventV2 {
218
218
  type: 'imessage_app';
219
219
 
220
220
  /**
221
- * The URL delivered to the iMessage app on tap.
221
+ * The URL the recipient's app opens when the user taps the card.
222
222
  */
223
223
  url: string;
224
224
 
@@ -226,11 +226,6 @@ export namespace MessageEventV2 {
226
226
  * Fallback text for surfaces that cannot render the card.
227
227
  */
228
228
  fallback_text?: string | null;
229
-
230
- /**
231
- * Client-supplied session identifier, echoed back when provided.
232
- */
233
- session_id?: string | null;
234
229
  }
235
230
 
236
231
  export namespace SchemasIMessageAppPartResponse {
@@ -268,21 +263,6 @@ export namespace MessageEventV2 {
268
263
  */
269
264
  caption?: string | null;
270
265
 
271
- /**
272
- * Overlay text shown below image_title.
273
- */
274
- image_subtitle?: string | null;
275
-
276
- /**
277
- * Overlay text shown above the image.
278
- */
279
- image_title?: string | null;
280
-
281
- /**
282
- * Presigned URL of the card preview image, when present.
283
- */
284
- image_url?: string | null;
285
-
286
266
  /**
287
267
  * Secondary label, below caption on the left.
288
268
  */
@@ -417,7 +397,7 @@ export namespace MessagePayload {
417
397
  type: 'imessage_app';
418
398
 
419
399
  /**
420
- * The URL delivered to the iMessage app on tap.
400
+ * The URL the recipient's app opens when the user taps the card.
421
401
  */
422
402
  url: string;
423
403
 
@@ -425,11 +405,6 @@ export namespace MessagePayload {
425
405
  * Fallback text for surfaces that cannot render the card.
426
406
  */
427
407
  fallback_text?: string | null;
428
-
429
- /**
430
- * Client-supplied session identifier, echoed back when provided.
431
- */
432
- session_id?: string | null;
433
408
  }
434
409
 
435
410
  export namespace SchemasIMessageAppPartResponse {
@@ -467,21 +442,6 @@ export namespace MessagePayload {
467
442
  */
468
443
  caption?: string | null;
469
444
 
470
- /**
471
- * Overlay text shown below image_title.
472
- */
473
- image_subtitle?: string | null;
474
-
475
- /**
476
- * Overlay text shown above the image.
477
- */
478
- image_title?: string | null;
479
-
480
- /**
481
- * Presigned URL of the card preview image, when present.
482
- */
483
- image_url?: string | null;
484
-
485
445
  /**
486
446
  * Secondary label, below caption on the left.
487
447
  */
@@ -2161,10 +2121,23 @@ export namespace PhoneNumberStatusUpdatedWebhookEvent {
2161
2121
  changed_at: string;
2162
2122
 
2163
2123
  /**
2164
- * The new line health status
2124
+ * @deprecated Current reputation of this phone line.
2125
+ *
2126
+ * - `HEALTHY` — The line is in good standing. Send normally.
2127
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
2128
+ * send pace and review your messaging patterns.
2129
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
2130
+ * Pause outbound on the line until it recovers.
2131
+ *
2132
+ * Defaults to `HEALTHY` for lines that have not yet been scored.
2165
2133
  */
2166
2134
  new_health_status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
2167
2135
 
2136
+ /**
2137
+ * The new line reputation
2138
+ */
2139
+ new_reputation: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
2140
+
2168
2141
  /**
2169
2142
  * The new service status
2170
2143
  */
@@ -2176,10 +2149,23 @@ export namespace PhoneNumberStatusUpdatedWebhookEvent {
2176
2149
  phone_number: string;
2177
2150
 
2178
2151
  /**
2179
- * The previous line health status
2152
+ * @deprecated Current reputation of this phone line.
2153
+ *
2154
+ * - `HEALTHY` — The line is in good standing. Send normally.
2155
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
2156
+ * send pace and review your messaging patterns.
2157
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
2158
+ * Pause outbound on the line until it recovers.
2159
+ *
2160
+ * Defaults to `HEALTHY` for lines that have not yet been scored.
2180
2161
  */
2181
2162
  previous_health_status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
2182
2163
 
2164
+ /**
2165
+ * The previous line reputation
2166
+ */
2167
+ previous_reputation: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
2168
+
2183
2169
  /**
2184
2170
  * The previous service status
2185
2171
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.27.1'; // x-release-please-version
1
+ export const VERSION = '0.28.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.27.1";
1
+ export declare const VERSION = "0.28.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.27.1";
1
+ export declare const VERSION = "0.28.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.27.1'; // x-release-please-version
4
+ exports.VERSION = '0.28.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.27.1'; // x-release-please-version
1
+ export const VERSION = '0.28.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map