@linqapp/sdk 0.28.0 → 0.28.2

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 (147) 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 +59 -11
  73. package/resources/chats/chats.d.mts.map +1 -1
  74. package/resources/chats/chats.d.ts +59 -11
  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 +84 -6
  87. package/resources/chats/messages.d.mts.map +1 -1
  88. package/resources/chats/messages.d.ts +84 -6
  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 +400 -7
  107. package/resources/messages.d.mts.map +1 -1
  108. package/resources/messages.d.ts +400 -7
  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 +68 -23
  115. package/resources/phone-numbers.d.mts.map +1 -1
  116. package/resources/phone-numbers.d.ts +68 -23
  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 +14 -14
  123. package/resources/webhooks.d.ts +14 -14
  124. package/src/client.ts +94 -8
  125. package/src/internal/qs/LICENSE.md +13 -0
  126. package/src/internal/qs/README.md +3 -0
  127. package/src/internal/qs/formats.ts +10 -0
  128. package/src/internal/qs/index.ts +13 -0
  129. package/src/internal/qs/stringify.ts +385 -0
  130. package/src/internal/qs/types.ts +71 -0
  131. package/src/internal/qs/utils.ts +265 -0
  132. package/src/internal/utils/query.ts +2 -18
  133. package/src/resources/attachments.ts +1 -1
  134. package/src/resources/available-number.ts +72 -0
  135. package/src/resources/chats/chats.ts +64 -12
  136. package/src/resources/chats/location.ts +9 -8
  137. package/src/resources/chats/messages.ts +87 -6
  138. package/src/resources/contact-card.ts +1 -2
  139. package/src/resources/index.ts +15 -1
  140. package/src/resources/messages.ts +453 -6
  141. package/src/resources/phone-numbers.ts +85 -23
  142. package/src/resources/webhooks.ts +14 -14
  143. package/src/version.ts +1 -1
  144. package/version.d.mts +1 -1
  145. package/version.d.ts +1 -1
  146. package/version.js +1 -1
  147. 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 {
@@ -46,8 +91,8 @@ export namespace PhoneNumberListResponse {
46
91
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
47
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
 
@@ -64,10 +109,16 @@ export namespace PhoneNumberListResponse {
64
109
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
65
110
  * applies to individual recipients, not the whole line.
66
111
  *
67
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
68
- * status means and how to react.
112
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
113
+ * what each status means and how to react.
69
114
  */
70
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;
71
122
  }
72
123
 
73
124
  export namespace PhoneNumber {
@@ -79,23 +130,23 @@ export namespace PhoneNumberListResponse {
79
130
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
80
131
  * applies to individual recipients, not the whole line.
81
132
  *
82
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
83
- * status means and how to react.
133
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
134
+ * what each status means and how to react.
84
135
  */
85
136
  export interface HealthStatus {
86
137
  /**
87
- * Deep-link to the relevant section of the Phone Health guide for this status.
138
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
88
139
  */
89
140
  doc_url: string;
90
141
 
91
142
  /**
92
- * Current reputation of this phone line as assessed by risk-service.
143
+ * Current reputation of this phone line.
93
144
  *
94
- * - `HEALTHY` — No elevated risk detected.
95
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
96
- * reviewing messaging patterns.
97
- * - `CRITICAL` — High risk; further sending may result in line flagging or
98
- * restriction.
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.
99
150
  *
100
151
  * Defaults to `HEALTHY` for lines that have not yet been scored.
101
152
  */
@@ -110,23 +161,23 @@ export namespace PhoneNumberListResponse {
110
161
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
111
162
  * applies to individual recipients, not the whole line.
112
163
  *
113
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
114
- * 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.
115
166
  */
116
167
  export interface Reputation {
117
168
  /**
118
- * 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.
119
170
  */
120
171
  doc_url: string;
121
172
 
122
173
  /**
123
- * Current reputation of this phone line as assessed by risk-service.
174
+ * Current reputation of this phone line.
124
175
  *
125
- * - `HEALTHY` — No elevated risk detected.
126
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
127
- * reviewing messaging patterns.
128
- * - `CRITICAL` — High risk; further sending may result in line flagging or
129
- * 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.
130
181
  *
131
182
  * Defaults to `HEALTHY` for lines that have not yet been scored.
132
183
  */
@@ -135,6 +186,17 @@ export namespace PhoneNumberListResponse {
135
186
  }
136
187
  }
137
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
+
138
196
  export declare namespace PhoneNumbers {
139
- export { type PhoneNumberListResponse as PhoneNumberListResponse };
197
+ export {
198
+ type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse,
199
+ type PhoneNumberListResponse as PhoneNumberListResponse,
200
+ type PhoneNumberUpdateParams as PhoneNumberUpdateParams,
201
+ };
140
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
 
@@ -397,7 +397,7 @@ export namespace MessagePayload {
397
397
  type: 'imessage_app';
398
398
 
399
399
  /**
400
- * The URL delivered to the iMessage app on tap.
400
+ * The URL the recipient's app opens when the user taps the card.
401
401
  */
402
402
  url: string;
403
403
 
@@ -2121,13 +2121,13 @@ export namespace PhoneNumberStatusUpdatedWebhookEvent {
2121
2121
  changed_at: string;
2122
2122
 
2123
2123
  /**
2124
- * @deprecated Current reputation of this phone line as assessed by risk-service.
2124
+ * @deprecated Current reputation of this phone line.
2125
2125
  *
2126
- * - `HEALTHY` — No elevated risk detected.
2127
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
2128
- * reviewing messaging patterns.
2129
- * - `CRITICAL` — High risk; further sending may result in line flagging or
2130
- * restriction.
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
2131
  *
2132
2132
  * Defaults to `HEALTHY` for lines that have not yet been scored.
2133
2133
  */
@@ -2149,13 +2149,13 @@ export namespace PhoneNumberStatusUpdatedWebhookEvent {
2149
2149
  phone_number: string;
2150
2150
 
2151
2151
  /**
2152
- * @deprecated Current reputation of this phone line as assessed by risk-service.
2152
+ * @deprecated Current reputation of this phone line.
2153
2153
  *
2154
- * - `HEALTHY` — No elevated risk detected.
2155
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
2156
- * reviewing messaging patterns.
2157
- * - `CRITICAL` — High risk; further sending may result in line flagging or
2158
- * restriction.
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
2159
  *
2160
2160
  * Defaults to `HEALTHY` for lines that have not yet been scored.
2161
2161
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.28.0'; // x-release-please-version
1
+ export const VERSION = '0.28.2'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.28.0";
1
+ export declare const VERSION = "0.28.2";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.28.0";
1
+ export declare const VERSION = "0.28.2";
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.28.0'; // x-release-please-version
4
+ exports.VERSION = '0.28.2'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.28.0'; // x-release-please-version
1
+ export const VERSION = '0.28.2'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map