@linqapp/sdk 0.1.0 → 0.1.3

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 (223) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +198 -4
  3. package/README.md +52 -52
  4. package/client.d.mts +34 -22
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +34 -22
  7. package/client.d.ts.map +1 -1
  8. package/client.js +50 -41
  9. package/client.js.map +1 -1
  10. package/client.mjs +49 -40
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/resource.d.mts +3 -3
  27. package/core/resource.d.mts.map +1 -1
  28. package/core/resource.d.ts +3 -3
  29. package/core/resource.d.ts.map +1 -1
  30. package/core/resource.js.map +1 -1
  31. package/core/resource.mjs.map +1 -1
  32. package/index.d.mts +3 -3
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts +3 -3
  35. package/index.d.ts.map +1 -1
  36. package/index.js +4 -4
  37. package/index.js.map +1 -1
  38. package/index.mjs +3 -3
  39. package/index.mjs.map +1 -1
  40. package/internal/parse.d.mts +2 -2
  41. package/internal/parse.d.mts.map +1 -1
  42. package/internal/parse.d.ts +2 -2
  43. package/internal/parse.d.ts.map +1 -1
  44. package/internal/parse.js.map +1 -1
  45. package/internal/parse.mjs.map +1 -1
  46. package/internal/shims.js +1 -1
  47. package/internal/shims.js.map +1 -1
  48. package/internal/shims.mjs +1 -1
  49. package/internal/shims.mjs.map +1 -1
  50. package/internal/uploads.d.mts +4 -4
  51. package/internal/uploads.d.mts.map +1 -1
  52. package/internal/uploads.d.ts +4 -4
  53. package/internal/uploads.d.ts.map +1 -1
  54. package/internal/uploads.js.map +1 -1
  55. package/internal/uploads.mjs.map +1 -1
  56. package/internal/utils/base64.js +2 -2
  57. package/internal/utils/base64.js.map +1 -1
  58. package/internal/utils/base64.mjs +3 -3
  59. package/internal/utils/base64.mjs.map +1 -1
  60. package/internal/utils/log.d.mts +3 -3
  61. package/internal/utils/log.d.mts.map +1 -1
  62. package/internal/utils/log.d.ts +3 -3
  63. package/internal/utils/log.d.ts.map +1 -1
  64. package/internal/utils/log.js.map +1 -1
  65. package/internal/utils/log.mjs.map +1 -1
  66. package/internal/utils/path.js +1 -1
  67. package/internal/utils/path.js.map +1 -1
  68. package/internal/utils/path.mjs +2 -2
  69. package/internal/utils/path.mjs.map +1 -1
  70. package/internal/utils/values.js +5 -5
  71. package/internal/utils/values.js.map +1 -1
  72. package/internal/utils/values.mjs +6 -6
  73. package/internal/utils/values.mjs.map +1 -1
  74. package/package.json +4 -4
  75. package/resources/attachments.d.mts +28 -3
  76. package/resources/attachments.d.mts.map +1 -1
  77. package/resources/attachments.d.ts +28 -3
  78. package/resources/attachments.d.ts.map +1 -1
  79. package/resources/capability.d.mts +74 -0
  80. package/resources/capability.d.mts.map +1 -0
  81. package/resources/capability.d.ts +74 -0
  82. package/resources/capability.d.ts.map +1 -0
  83. package/resources/capability.js +36 -0
  84. package/resources/capability.js.map +1 -0
  85. package/resources/capability.mjs +32 -0
  86. package/resources/capability.mjs.map +1 -0
  87. package/resources/chats/chats.d.mts +133 -663
  88. package/resources/chats/chats.d.mts.map +1 -1
  89. package/resources/chats/chats.d.ts +133 -663
  90. package/resources/chats/chats.d.ts.map +1 -1
  91. package/resources/chats/chats.js +2 -2
  92. package/resources/chats/chats.js.map +1 -1
  93. package/resources/chats/chats.mjs +2 -2
  94. package/resources/chats/chats.mjs.map +1 -1
  95. package/resources/chats/index.d.mts +2 -2
  96. package/resources/chats/index.d.mts.map +1 -1
  97. package/resources/chats/index.d.ts +2 -2
  98. package/resources/chats/index.d.ts.map +1 -1
  99. package/resources/chats/index.js.map +1 -1
  100. package/resources/chats/index.mjs.map +1 -1
  101. package/resources/chats/messages.d.mts +55 -716
  102. package/resources/chats/messages.d.mts.map +1 -1
  103. package/resources/chats/messages.d.ts +55 -716
  104. package/resources/chats/messages.d.ts.map +1 -1
  105. package/resources/chats/messages.js.map +1 -1
  106. package/resources/chats/messages.mjs.map +1 -1
  107. package/resources/index.d.mts +8 -5
  108. package/resources/index.d.mts.map +1 -1
  109. package/resources/index.d.ts +8 -5
  110. package/resources/index.d.ts.map +1 -1
  111. package/resources/index.js +9 -3
  112. package/resources/index.js.map +1 -1
  113. package/resources/index.mjs +5 -2
  114. package/resources/index.mjs.map +1 -1
  115. package/resources/messages.d.mts +129 -553
  116. package/resources/messages.d.mts.map +1 -1
  117. package/resources/messages.d.ts +129 -553
  118. package/resources/messages.d.ts.map +1 -1
  119. package/resources/messages.js +1 -1
  120. package/resources/messages.js.map +1 -1
  121. package/resources/messages.mjs +1 -1
  122. package/resources/messages.mjs.map +1 -1
  123. package/resources/phone-numbers.d.mts +1 -50
  124. package/resources/phone-numbers.d.mts.map +1 -1
  125. package/resources/phone-numbers.d.ts +1 -50
  126. package/resources/phone-numbers.d.ts.map +1 -1
  127. package/resources/phone-numbers.js +0 -8
  128. package/resources/phone-numbers.js.map +1 -1
  129. package/resources/phone-numbers.mjs +0 -8
  130. package/resources/phone-numbers.mjs.map +1 -1
  131. package/resources/phonenumbers.d.mts +58 -0
  132. package/resources/phonenumbers.d.mts.map +1 -0
  133. package/resources/phonenumbers.d.ts +58 -0
  134. package/resources/phonenumbers.d.ts.map +1 -0
  135. package/resources/phonenumbers.js +17 -0
  136. package/resources/phonenumbers.js.map +1 -0
  137. package/resources/phonenumbers.mjs +13 -0
  138. package/resources/phonenumbers.mjs.map +1 -0
  139. package/resources/webhook-events.d.mts +29 -0
  140. package/resources/webhook-events.d.mts.map +1 -0
  141. package/resources/webhook-events.d.ts +29 -0
  142. package/resources/webhook-events.d.ts.map +1 -0
  143. package/resources/{webhooks/events.js → webhook-events.js} +5 -10
  144. package/resources/webhook-events.js.map +1 -0
  145. package/resources/{webhooks/events.mjs → webhook-events.mjs} +3 -8
  146. package/resources/webhook-events.mjs.map +1 -0
  147. package/resources/webhook-subscriptions.d.mts +184 -0
  148. package/resources/webhook-subscriptions.d.mts.map +1 -0
  149. package/resources/webhook-subscriptions.d.ts +184 -0
  150. package/resources/webhook-subscriptions.d.ts.map +1 -0
  151. package/resources/{webhooks/subscriptions.js → webhook-subscriptions.js} +16 -16
  152. package/resources/webhook-subscriptions.js.map +1 -0
  153. package/resources/{webhooks/subscriptions.mjs → webhook-subscriptions.mjs} +14 -14
  154. package/resources/webhook-subscriptions.mjs.map +1 -0
  155. package/src/client.ts +97 -41
  156. package/src/core/api-promise.ts +4 -4
  157. package/src/core/error.ts +2 -2
  158. package/src/core/resource.ts +3 -3
  159. package/src/index.ts +3 -3
  160. package/src/internal/parse.ts +2 -2
  161. package/src/internal/shims.ts +1 -1
  162. package/src/internal/uploads.ts +5 -5
  163. package/src/internal/utils/base64.ts +3 -3
  164. package/src/internal/utils/log.ts +3 -3
  165. package/src/internal/utils/path.ts +2 -2
  166. package/src/internal/utils/values.ts +6 -6
  167. package/src/resources/attachments.ts +81 -106
  168. package/src/resources/capability.ts +98 -0
  169. package/src/resources/chats/chats.ts +135 -770
  170. package/src/resources/chats/index.ts +4 -2
  171. package/src/resources/chats/messages.ts +60 -839
  172. package/src/resources/index.ts +29 -9
  173. package/src/resources/messages.ts +153 -659
  174. package/src/resources/phone-numbers.ts +1 -65
  175. package/src/resources/phonenumbers.ts +72 -0
  176. package/src/resources/webhook-events.ts +57 -0
  177. package/src/resources/webhook-subscriptions.ts +238 -0
  178. package/src/version.ts +1 -1
  179. package/version.d.mts +1 -1
  180. package/version.d.ts +1 -1
  181. package/version.js +1 -1
  182. package/version.mjs +1 -1
  183. package/resources/webhooks/events.d.mts +0 -30
  184. package/resources/webhooks/events.d.mts.map +0 -1
  185. package/resources/webhooks/events.d.ts +0 -30
  186. package/resources/webhooks/events.d.ts.map +0 -1
  187. package/resources/webhooks/events.js.map +0 -1
  188. package/resources/webhooks/events.mjs.map +0 -1
  189. package/resources/webhooks/index.d.mts +0 -4
  190. package/resources/webhooks/index.d.mts.map +0 -1
  191. package/resources/webhooks/index.d.ts +0 -4
  192. package/resources/webhooks/index.d.ts.map +0 -1
  193. package/resources/webhooks/index.js +0 -11
  194. package/resources/webhooks/index.js.map +0 -1
  195. package/resources/webhooks/index.mjs +0 -5
  196. package/resources/webhooks/index.mjs.map +0 -1
  197. package/resources/webhooks/subscriptions.d.mts +0 -237
  198. package/resources/webhooks/subscriptions.d.mts.map +0 -1
  199. package/resources/webhooks/subscriptions.d.ts +0 -237
  200. package/resources/webhooks/subscriptions.d.ts.map +0 -1
  201. package/resources/webhooks/subscriptions.js.map +0 -1
  202. package/resources/webhooks/subscriptions.mjs.map +0 -1
  203. package/resources/webhooks/webhooks.d.mts +0 -14
  204. package/resources/webhooks/webhooks.d.mts.map +0 -1
  205. package/resources/webhooks/webhooks.d.ts +0 -14
  206. package/resources/webhooks/webhooks.d.ts.map +0 -1
  207. package/resources/webhooks/webhooks.js +0 -21
  208. package/resources/webhooks/webhooks.js.map +0 -1
  209. package/resources/webhooks/webhooks.mjs +0 -16
  210. package/resources/webhooks/webhooks.mjs.map +0 -1
  211. package/resources/webhooks.d.mts +0 -2
  212. package/resources/webhooks.d.mts.map +0 -1
  213. package/resources/webhooks.d.ts +0 -2
  214. package/resources/webhooks.d.ts.map +0 -1
  215. package/resources/webhooks.js +0 -6
  216. package/resources/webhooks.js.map +0 -1
  217. package/resources/webhooks.mjs +0 -3
  218. package/resources/webhooks.mjs.map +0 -1
  219. package/src/resources/webhooks/events.ts +0 -55
  220. package/src/resources/webhooks/index.ts +0 -13
  221. package/src/resources/webhooks/subscriptions.ts +0 -409
  222. package/src/resources/webhooks/webhooks.ts +0 -37
  223. package/src/resources/webhooks.ts +0 -3
@@ -1,4 +1,5 @@
1
1
  import { APIResource } from "../core/resource.js";
2
+ import * as ChatsAPI from "./chats/chats.js";
2
3
  import { APIPromise } from "../core/api-promise.js";
3
4
  import { RequestOptions } from "../internal/request-options.js";
4
5
  export declare class Messages extends APIResource {
@@ -13,7 +14,7 @@ export declare class Messages extends APIResource {
13
14
  * );
14
15
  * ```
15
16
  */
16
- retrieve(messageID: string, options?: RequestOptions): APIPromise<MessageRetrieveResponse>;
17
+ retrieve(messageID: string, options?: RequestOptions): APIPromise<Message>;
17
18
  /**
18
19
  * Deletes a message from the Linq API only. This does NOT unsend or remove the
19
20
  * message from the actual chat - recipients will still see the message.
@@ -46,13 +47,13 @@ export declare class Messages extends APIResource {
46
47
  *
47
48
  * @example
48
49
  * ```ts
49
- * const response = await client.messages.addReaction(
50
+ * const reaction = await client.messages.addReaction(
50
51
  * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
51
52
  * { operation: 'add', type: 'love' },
52
53
  * );
53
54
  * ```
54
55
  */
55
- addReaction(messageID: string, body: MessageAddReactionParams, options?: RequestOptions): APIPromise<MessageAddReactionResponse>;
56
+ addReaction(messageID: string, body: MessageAddReactionParams, options?: RequestOptions): APIPromise<Reaction>;
56
57
  /**
57
58
  * Retrieve all messages in a conversation thread. Given any message ID in the
58
59
  * thread, returns the originator message and all replies in chronological order.
@@ -70,7 +71,70 @@ export declare class Messages extends APIResource {
70
71
  */
71
72
  retrieveThread(messageID: string, query?: MessageRetrieveThreadParams | null | undefined, options?: RequestOptions): APIPromise<MessageRetrieveThreadResponse>;
72
73
  }
73
- export interface MessageRetrieveResponse {
74
+ export interface ChatHandle {
75
+ /**
76
+ * Unique identifier for this handle
77
+ */
78
+ id: string;
79
+ /**
80
+ * Phone number (E.164) or email address of the participant
81
+ */
82
+ handle: string;
83
+ /**
84
+ * When this participant joined the chat
85
+ */
86
+ joined_at: string;
87
+ /**
88
+ * Messaging service type
89
+ */
90
+ service: ChatsAPI.ServiceType;
91
+ /**
92
+ * Whether this handle belongs to the sender (your phone number)
93
+ */
94
+ is_me?: boolean | null;
95
+ /**
96
+ * When they left (if applicable)
97
+ */
98
+ left_at?: string | null;
99
+ /**
100
+ * Participant status
101
+ */
102
+ status?: 'active' | 'left' | 'removed' | null;
103
+ }
104
+ /**
105
+ * A media attachment part
106
+ */
107
+ export interface MediaPart {
108
+ /**
109
+ * Unique attachment identifier
110
+ */
111
+ id: string;
112
+ /**
113
+ * Original filename
114
+ */
115
+ filename: string;
116
+ /**
117
+ * MIME type of the file
118
+ */
119
+ mime_type: string;
120
+ /**
121
+ * Reactions on this message part
122
+ */
123
+ reactions: Array<Reaction> | null;
124
+ /**
125
+ * File size in bytes
126
+ */
127
+ size_bytes: number;
128
+ /**
129
+ * Indicates this is a media attachment part
130
+ */
131
+ type: 'media';
132
+ /**
133
+ * Presigned URL for downloading the attachment (expires in 1 hour).
134
+ */
135
+ url: string;
136
+ }
137
+ export interface Message {
74
138
  /**
75
139
  * Unique identifier for the message
76
140
  */
@@ -106,7 +170,7 @@ export interface MessageRetrieveResponse {
106
170
  /**
107
171
  * iMessage effect applied to a message (screen or bubble effect)
108
172
  */
109
- effect?: MessageRetrieveResponse.Effect | null;
173
+ effect?: MessageEffect | null;
110
174
  /**
111
175
  * @deprecated DEPRECATED: Use from_handle instead. Phone number of the message
112
176
  * sender.
@@ -115,15 +179,15 @@ export interface MessageRetrieveResponse {
115
179
  /**
116
180
  * The sender of this message as a full handle object
117
181
  */
118
- from_handle?: MessageRetrieveResponse.FromHandle | null;
182
+ from_handle?: ChatHandle | null;
119
183
  /**
120
184
  * Message parts in order (text and media)
121
185
  */
122
- parts?: Array<MessageRetrieveResponse.TextPartResponse | MessageRetrieveResponse.MediaPartResponse> | null;
186
+ parts?: Array<TextPart | MediaPart> | null;
123
187
  /**
124
188
  * Messaging service type
125
189
  */
126
- preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
190
+ preferred_service?: ChatsAPI.ServiceType | null;
127
191
  /**
128
192
  * When the message was read
129
193
  */
@@ -131,7 +195,7 @@ export interface MessageRetrieveResponse {
131
195
  /**
132
196
  * Indicates this message is a threaded reply to another message
133
197
  */
134
- reply_to?: MessageRetrieveResponse.ReplyTo | null;
198
+ reply_to?: ReplyTo | null;
135
199
  /**
136
200
  * When the message was sent
137
201
  */
@@ -139,229 +203,27 @@ export interface MessageRetrieveResponse {
139
203
  /**
140
204
  * Messaging service type
141
205
  */
142
- service?: 'iMessage' | 'SMS' | 'RCS' | null;
206
+ service?: ChatsAPI.ServiceType | null;
143
207
  }
144
- export declare namespace MessageRetrieveResponse {
145
- /**
146
- * iMessage effect applied to a message (screen or bubble effect)
147
- */
148
- interface Effect {
149
- /**
150
- * Name of the effect. Common values:
151
- *
152
- * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
153
- * love, balloons, happy_birthday, echo, spotlight
154
- * - Bubble effects: slam, loud, gentle, invisible
155
- */
156
- name?: string;
157
- /**
158
- * Type of effect
159
- */
160
- type?: 'screen' | 'bubble';
161
- }
208
+ /**
209
+ * iMessage effect applied to a message (screen or bubble effect)
210
+ */
211
+ export interface MessageEffect {
162
212
  /**
163
- * The sender of this message as a full handle object
213
+ * Name of the effect. Common values:
214
+ *
215
+ * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
216
+ * love, balloons, happy_birthday, echo, spotlight
217
+ * - Bubble effects: slam, loud, gentle, invisible
164
218
  */
165
- interface FromHandle {
166
- /**
167
- * Unique identifier for this handle
168
- */
169
- id: string;
170
- /**
171
- * Phone number (E.164) or email address of the participant
172
- */
173
- handle: string;
174
- /**
175
- * When this participant joined the chat
176
- */
177
- joined_at: string;
178
- /**
179
- * Messaging service type
180
- */
181
- service: 'iMessage' | 'SMS' | 'RCS';
182
- /**
183
- * Whether this handle belongs to the sender (your phone number)
184
- */
185
- is_me?: boolean | null;
186
- /**
187
- * When they left (if applicable)
188
- */
189
- left_at?: string | null;
190
- /**
191
- * Participant status
192
- */
193
- status?: 'active' | 'left' | 'removed' | null;
194
- }
195
- /**
196
- * A text message part
197
- */
198
- interface TextPartResponse {
199
- /**
200
- * Reactions on this message part
201
- */
202
- reactions: Array<TextPartResponse.Reaction> | null;
203
- /**
204
- * Indicates this is a text message part
205
- */
206
- type: 'text';
207
- /**
208
- * The text content
209
- */
210
- value: string;
211
- }
212
- namespace TextPartResponse {
213
- interface Reaction {
214
- handle: Reaction.Handle;
215
- /**
216
- * Whether this reaction is from the current user
217
- */
218
- is_me: boolean;
219
- /**
220
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
221
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
222
- * emoji in the custom_emoji field.
223
- */
224
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
225
- /**
226
- * Custom emoji if type is "custom", null otherwise
227
- */
228
- custom_emoji?: string | null;
229
- }
230
- namespace Reaction {
231
- interface Handle {
232
- /**
233
- * Unique identifier for this handle
234
- */
235
- id: string;
236
- /**
237
- * Phone number (E.164) or email address of the participant
238
- */
239
- handle: string;
240
- /**
241
- * When this participant joined the chat
242
- */
243
- joined_at: string;
244
- /**
245
- * Messaging service type
246
- */
247
- service: 'iMessage' | 'SMS' | 'RCS';
248
- /**
249
- * Whether this handle belongs to the sender (your phone number)
250
- */
251
- is_me?: boolean | null;
252
- /**
253
- * When they left (if applicable)
254
- */
255
- left_at?: string | null;
256
- /**
257
- * Participant status
258
- */
259
- status?: 'active' | 'left' | 'removed' | null;
260
- }
261
- }
262
- }
263
- /**
264
- * A media attachment part
265
- */
266
- interface MediaPartResponse {
267
- /**
268
- * Unique attachment identifier
269
- */
270
- id: string;
271
- /**
272
- * Original filename
273
- */
274
- filename: string;
275
- /**
276
- * MIME type of the file
277
- */
278
- mime_type: string;
279
- /**
280
- * Reactions on this message part
281
- */
282
- reactions: Array<MediaPartResponse.Reaction> | null;
283
- /**
284
- * File size in bytes
285
- */
286
- size_bytes: number;
287
- /**
288
- * Indicates this is a media attachment part
289
- */
290
- type: 'media';
291
- /**
292
- * Presigned URL for downloading the attachment (expires in 1 hour).
293
- */
294
- url: string;
295
- }
296
- namespace MediaPartResponse {
297
- interface Reaction {
298
- handle: Reaction.Handle;
299
- /**
300
- * Whether this reaction is from the current user
301
- */
302
- is_me: boolean;
303
- /**
304
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
305
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
306
- * emoji in the custom_emoji field.
307
- */
308
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
309
- /**
310
- * Custom emoji if type is "custom", null otherwise
311
- */
312
- custom_emoji?: string | null;
313
- }
314
- namespace Reaction {
315
- interface Handle {
316
- /**
317
- * Unique identifier for this handle
318
- */
319
- id: string;
320
- /**
321
- * Phone number (E.164) or email address of the participant
322
- */
323
- handle: string;
324
- /**
325
- * When this participant joined the chat
326
- */
327
- joined_at: string;
328
- /**
329
- * Messaging service type
330
- */
331
- service: 'iMessage' | 'SMS' | 'RCS';
332
- /**
333
- * Whether this handle belongs to the sender (your phone number)
334
- */
335
- is_me?: boolean | null;
336
- /**
337
- * When they left (if applicable)
338
- */
339
- left_at?: string | null;
340
- /**
341
- * Participant status
342
- */
343
- status?: 'active' | 'left' | 'removed' | null;
344
- }
345
- }
346
- }
219
+ name?: string;
347
220
  /**
348
- * Indicates this message is a threaded reply to another message
221
+ * Type of effect
349
222
  */
350
- interface ReplyTo {
351
- /**
352
- * The ID of the message to reply to
353
- */
354
- message_id: string;
355
- /**
356
- * The specific message part to reply to (0-based index). Defaults to 0 (first
357
- * part) if not provided. Use this when replying to a specific part of a multipart
358
- * message.
359
- */
360
- part_index?: number;
361
- }
223
+ type?: 'screen' | 'bubble';
362
224
  }
363
- export interface MessageAddReactionResponse {
364
- handle: MessageAddReactionResponse.Handle;
225
+ export interface Reaction {
226
+ handle: ChatHandle;
365
227
  /**
366
228
  * Whether this reaction is from the current user
367
229
  */
@@ -371,43 +233,49 @@ export interface MessageAddReactionResponse {
371
233
  * emphasize, question. Custom emoji reactions have type "custom" with the actual
372
234
  * emoji in the custom_emoji field.
373
235
  */
374
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
236
+ type: ReactionType;
375
237
  /**
376
238
  * Custom emoji if type is "custom", null otherwise
377
239
  */
378
240
  custom_emoji?: string | null;
379
241
  }
380
- export declare namespace MessageAddReactionResponse {
381
- interface Handle {
382
- /**
383
- * Unique identifier for this handle
384
- */
385
- id: string;
386
- /**
387
- * Phone number (E.164) or email address of the participant
388
- */
389
- handle: string;
390
- /**
391
- * When this participant joined the chat
392
- */
393
- joined_at: string;
394
- /**
395
- * Messaging service type
396
- */
397
- service: 'iMessage' | 'SMS' | 'RCS';
398
- /**
399
- * Whether this handle belongs to the sender (your phone number)
400
- */
401
- is_me?: boolean | null;
402
- /**
403
- * When they left (if applicable)
404
- */
405
- left_at?: string | null;
406
- /**
407
- * Participant status
408
- */
409
- status?: 'active' | 'left' | 'removed' | null;
410
- }
242
+ /**
243
+ * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
244
+ * emphasize, question. Custom emoji reactions have type "custom" with the actual
245
+ * emoji in the custom_emoji field.
246
+ */
247
+ export type ReactionType = 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
248
+ /**
249
+ * Indicates this message is a threaded reply to another message
250
+ */
251
+ export interface ReplyTo {
252
+ /**
253
+ * The ID of the message to reply to
254
+ */
255
+ message_id: string;
256
+ /**
257
+ * The specific message part to reply to (0-based index). Defaults to 0 (first
258
+ * part) if not provided. Use this when replying to a specific part of a multipart
259
+ * message.
260
+ */
261
+ part_index?: number;
262
+ }
263
+ /**
264
+ * A text message part
265
+ */
266
+ export interface TextPart {
267
+ /**
268
+ * Reactions on this message part
269
+ */
270
+ reactions: Array<Reaction> | null;
271
+ /**
272
+ * Indicates this is a text message part
273
+ */
274
+ type: 'text';
275
+ /**
276
+ * The text content
277
+ */
278
+ value: string;
411
279
  }
412
280
  /**
413
281
  * Response containing messages in a thread with pagination
@@ -416,304 +284,12 @@ export interface MessageRetrieveThreadResponse {
416
284
  /**
417
285
  * Messages in the thread, ordered by the specified order parameter
418
286
  */
419
- messages: Array<MessageRetrieveThreadResponse.Message>;
287
+ messages: Array<Message>;
420
288
  /**
421
289
  * Cursor for fetching the next page of results (null if no more results)
422
290
  */
423
291
  next_cursor?: string | null;
424
292
  }
425
- export declare namespace MessageRetrieveThreadResponse {
426
- interface Message {
427
- /**
428
- * Unique identifier for the message
429
- */
430
- id: string;
431
- /**
432
- * ID of the chat this message belongs to
433
- */
434
- chat_id: string;
435
- /**
436
- * When the message was created
437
- */
438
- created_at: string;
439
- /**
440
- * Whether the message has been delivered
441
- */
442
- is_delivered: boolean;
443
- /**
444
- * Whether this message was sent by the authenticated user
445
- */
446
- is_from_me: boolean;
447
- /**
448
- * Whether the message has been read
449
- */
450
- is_read: boolean;
451
- /**
452
- * When the message was last updated
453
- */
454
- updated_at: string;
455
- /**
456
- * When the message was delivered
457
- */
458
- delivered_at?: string | null;
459
- /**
460
- * iMessage effect applied to a message (screen or bubble effect)
461
- */
462
- effect?: Message.Effect | null;
463
- /**
464
- * @deprecated DEPRECATED: Use from_handle instead. Phone number of the message
465
- * sender.
466
- */
467
- from?: string | null;
468
- /**
469
- * The sender of this message as a full handle object
470
- */
471
- from_handle?: Message.FromHandle | null;
472
- /**
473
- * Message parts in order (text and media)
474
- */
475
- parts?: Array<Message.TextPartResponse | Message.MediaPartResponse> | null;
476
- /**
477
- * Messaging service type
478
- */
479
- preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
480
- /**
481
- * When the message was read
482
- */
483
- read_at?: string | null;
484
- /**
485
- * Indicates this message is a threaded reply to another message
486
- */
487
- reply_to?: Message.ReplyTo | null;
488
- /**
489
- * When the message was sent
490
- */
491
- sent_at?: string | null;
492
- /**
493
- * Messaging service type
494
- */
495
- service?: 'iMessage' | 'SMS' | 'RCS' | null;
496
- }
497
- namespace Message {
498
- /**
499
- * iMessage effect applied to a message (screen or bubble effect)
500
- */
501
- interface Effect {
502
- /**
503
- * Name of the effect. Common values:
504
- *
505
- * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
506
- * love, balloons, happy_birthday, echo, spotlight
507
- * - Bubble effects: slam, loud, gentle, invisible
508
- */
509
- name?: string;
510
- /**
511
- * Type of effect
512
- */
513
- type?: 'screen' | 'bubble';
514
- }
515
- /**
516
- * The sender of this message as a full handle object
517
- */
518
- interface FromHandle {
519
- /**
520
- * Unique identifier for this handle
521
- */
522
- id: string;
523
- /**
524
- * Phone number (E.164) or email address of the participant
525
- */
526
- handle: string;
527
- /**
528
- * When this participant joined the chat
529
- */
530
- joined_at: string;
531
- /**
532
- * Messaging service type
533
- */
534
- service: 'iMessage' | 'SMS' | 'RCS';
535
- /**
536
- * Whether this handle belongs to the sender (your phone number)
537
- */
538
- is_me?: boolean | null;
539
- /**
540
- * When they left (if applicable)
541
- */
542
- left_at?: string | null;
543
- /**
544
- * Participant status
545
- */
546
- status?: 'active' | 'left' | 'removed' | null;
547
- }
548
- /**
549
- * A text message part
550
- */
551
- interface TextPartResponse {
552
- /**
553
- * Reactions on this message part
554
- */
555
- reactions: Array<TextPartResponse.Reaction> | null;
556
- /**
557
- * Indicates this is a text message part
558
- */
559
- type: 'text';
560
- /**
561
- * The text content
562
- */
563
- value: string;
564
- }
565
- namespace TextPartResponse {
566
- interface Reaction {
567
- handle: Reaction.Handle;
568
- /**
569
- * Whether this reaction is from the current user
570
- */
571
- is_me: boolean;
572
- /**
573
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
574
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
575
- * emoji in the custom_emoji field.
576
- */
577
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
578
- /**
579
- * Custom emoji if type is "custom", null otherwise
580
- */
581
- custom_emoji?: string | null;
582
- }
583
- namespace Reaction {
584
- interface Handle {
585
- /**
586
- * Unique identifier for this handle
587
- */
588
- id: string;
589
- /**
590
- * Phone number (E.164) or email address of the participant
591
- */
592
- handle: string;
593
- /**
594
- * When this participant joined the chat
595
- */
596
- joined_at: string;
597
- /**
598
- * Messaging service type
599
- */
600
- service: 'iMessage' | 'SMS' | 'RCS';
601
- /**
602
- * Whether this handle belongs to the sender (your phone number)
603
- */
604
- is_me?: boolean | null;
605
- /**
606
- * When they left (if applicable)
607
- */
608
- left_at?: string | null;
609
- /**
610
- * Participant status
611
- */
612
- status?: 'active' | 'left' | 'removed' | null;
613
- }
614
- }
615
- }
616
- /**
617
- * A media attachment part
618
- */
619
- interface MediaPartResponse {
620
- /**
621
- * Unique attachment identifier
622
- */
623
- id: string;
624
- /**
625
- * Original filename
626
- */
627
- filename: string;
628
- /**
629
- * MIME type of the file
630
- */
631
- mime_type: string;
632
- /**
633
- * Reactions on this message part
634
- */
635
- reactions: Array<MediaPartResponse.Reaction> | null;
636
- /**
637
- * File size in bytes
638
- */
639
- size_bytes: number;
640
- /**
641
- * Indicates this is a media attachment part
642
- */
643
- type: 'media';
644
- /**
645
- * Presigned URL for downloading the attachment (expires in 1 hour).
646
- */
647
- url: string;
648
- }
649
- namespace MediaPartResponse {
650
- interface Reaction {
651
- handle: Reaction.Handle;
652
- /**
653
- * Whether this reaction is from the current user
654
- */
655
- is_me: boolean;
656
- /**
657
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
658
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
659
- * emoji in the custom_emoji field.
660
- */
661
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
662
- /**
663
- * Custom emoji if type is "custom", null otherwise
664
- */
665
- custom_emoji?: string | null;
666
- }
667
- namespace Reaction {
668
- interface Handle {
669
- /**
670
- * Unique identifier for this handle
671
- */
672
- id: string;
673
- /**
674
- * Phone number (E.164) or email address of the participant
675
- */
676
- handle: string;
677
- /**
678
- * When this participant joined the chat
679
- */
680
- joined_at: string;
681
- /**
682
- * Messaging service type
683
- */
684
- service: 'iMessage' | 'SMS' | 'RCS';
685
- /**
686
- * Whether this handle belongs to the sender (your phone number)
687
- */
688
- is_me?: boolean | null;
689
- /**
690
- * When they left (if applicable)
691
- */
692
- left_at?: string | null;
693
- /**
694
- * Participant status
695
- */
696
- status?: 'active' | 'left' | 'removed' | null;
697
- }
698
- }
699
- }
700
- /**
701
- * Indicates this message is a threaded reply to another message
702
- */
703
- interface ReplyTo {
704
- /**
705
- * The ID of the message to reply to
706
- */
707
- message_id: string;
708
- /**
709
- * The specific message part to reply to (0-based index). Defaults to 0 (first
710
- * part) if not provided. Use this when replying to a specific part of a multipart
711
- * message.
712
- */
713
- part_index?: number;
714
- }
715
- }
716
- }
717
293
  export interface MessageDeleteParams {
718
294
  /**
719
295
  * ID of the chat containing the message to delete
@@ -730,7 +306,7 @@ export interface MessageAddReactionParams {
730
306
  * emphasize, question. Custom emoji reactions have type "custom" with the actual
731
307
  * emoji in the custom_emoji field.
732
308
  */
733
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
309
+ type: ReactionType;
734
310
  /**
735
311
  * Custom emoji string. Required when type is "custom".
736
312
  */
@@ -756,6 +332,6 @@ export interface MessageRetrieveThreadParams {
756
332
  order?: 'asc' | 'desc';
757
333
  }
758
334
  export declare namespace Messages {
759
- export { type MessageRetrieveResponse as MessageRetrieveResponse, type MessageAddReactionResponse as MessageAddReactionResponse, type MessageRetrieveThreadResponse as MessageRetrieveThreadResponse, type MessageDeleteParams as MessageDeleteParams, type MessageAddReactionParams as MessageAddReactionParams, type MessageRetrieveThreadParams as MessageRetrieveThreadParams, };
335
+ export { type ChatHandle as ChatHandle, type MediaPart as MediaPart, type Message as Message, type MessageEffect as MessageEffect, type Reaction as Reaction, type ReactionType as ReactionType, type ReplyTo as ReplyTo, type TextPart as TextPart, type MessageRetrieveThreadResponse as MessageRetrieveThreadResponse, type MessageDeleteParams as MessageDeleteParams, type MessageAddReactionParams as MessageAddReactionParams, type MessageRetrieveThreadParams as MessageRetrieveThreadParams, };
760
336
  }
761
337
  //# sourceMappingURL=messages.d.ts.map