@linqapp/sdk 0.1.0 → 0.1.4

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 (231) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +198 -4
  3. package/README.md +52 -52
  4. package/client.d.mts +35 -22
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +35 -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/tslib.js +6 -6
  51. package/internal/uploads.d.mts +4 -4
  52. package/internal/uploads.d.mts.map +1 -1
  53. package/internal/uploads.d.ts +4 -4
  54. package/internal/uploads.d.ts.map +1 -1
  55. package/internal/uploads.js.map +1 -1
  56. package/internal/uploads.mjs.map +1 -1
  57. package/internal/utils/base64.js +2 -2
  58. package/internal/utils/base64.js.map +1 -1
  59. package/internal/utils/base64.mjs +3 -3
  60. package/internal/utils/base64.mjs.map +1 -1
  61. package/internal/utils/log.d.mts +3 -3
  62. package/internal/utils/log.d.mts.map +1 -1
  63. package/internal/utils/log.d.ts +3 -3
  64. package/internal/utils/log.d.ts.map +1 -1
  65. package/internal/utils/log.js.map +1 -1
  66. package/internal/utils/log.mjs.map +1 -1
  67. package/internal/utils/path.js +1 -1
  68. package/internal/utils/path.js.map +1 -1
  69. package/internal/utils/path.mjs +2 -2
  70. package/internal/utils/path.mjs.map +1 -1
  71. package/internal/utils/values.js +5 -5
  72. package/internal/utils/values.js.map +1 -1
  73. package/internal/utils/values.mjs +6 -6
  74. package/internal/utils/values.mjs.map +1 -1
  75. package/package.json +4 -4
  76. package/resources/attachments.d.mts +28 -3
  77. package/resources/attachments.d.mts.map +1 -1
  78. package/resources/attachments.d.ts +28 -3
  79. package/resources/attachments.d.ts.map +1 -1
  80. package/resources/capability.d.mts +74 -0
  81. package/resources/capability.d.mts.map +1 -0
  82. package/resources/capability.d.ts +74 -0
  83. package/resources/capability.d.ts.map +1 -0
  84. package/resources/capability.js +36 -0
  85. package/resources/capability.js.map +1 -0
  86. package/resources/capability.mjs +32 -0
  87. package/resources/capability.mjs.map +1 -0
  88. package/resources/chats/chats.d.mts +129 -663
  89. package/resources/chats/chats.d.mts.map +1 -1
  90. package/resources/chats/chats.d.ts +129 -663
  91. package/resources/chats/chats.d.ts.map +1 -1
  92. package/resources/chats/chats.js +2 -2
  93. package/resources/chats/chats.js.map +1 -1
  94. package/resources/chats/chats.mjs +2 -2
  95. package/resources/chats/chats.mjs.map +1 -1
  96. package/resources/chats/index.d.mts +2 -2
  97. package/resources/chats/index.d.mts.map +1 -1
  98. package/resources/chats/index.d.ts +2 -2
  99. package/resources/chats/index.d.ts.map +1 -1
  100. package/resources/chats/index.js.map +1 -1
  101. package/resources/chats/index.mjs.map +1 -1
  102. package/resources/chats/messages.d.mts +56 -716
  103. package/resources/chats/messages.d.mts.map +1 -1
  104. package/resources/chats/messages.d.ts +56 -716
  105. package/resources/chats/messages.d.ts.map +1 -1
  106. package/resources/chats/messages.js.map +1 -1
  107. package/resources/chats/messages.mjs.map +1 -1
  108. package/resources/index.d.mts +9 -5
  109. package/resources/index.d.mts.map +1 -1
  110. package/resources/index.d.ts +9 -5
  111. package/resources/index.d.ts.map +1 -1
  112. package/resources/index.js +11 -3
  113. package/resources/index.js.map +1 -1
  114. package/resources/index.mjs +6 -2
  115. package/resources/index.mjs.map +1 -1
  116. package/resources/messages.d.mts +156 -544
  117. package/resources/messages.d.mts.map +1 -1
  118. package/resources/messages.d.ts +156 -544
  119. package/resources/messages.d.ts.map +1 -1
  120. package/resources/messages.js +1 -1
  121. package/resources/messages.js.map +1 -1
  122. package/resources/messages.mjs +1 -1
  123. package/resources/messages.mjs.map +1 -1
  124. package/resources/phone-numbers.d.mts +1 -50
  125. package/resources/phone-numbers.d.mts.map +1 -1
  126. package/resources/phone-numbers.d.ts +1 -50
  127. package/resources/phone-numbers.d.ts.map +1 -1
  128. package/resources/phone-numbers.js +0 -8
  129. package/resources/phone-numbers.js.map +1 -1
  130. package/resources/phone-numbers.mjs +0 -8
  131. package/resources/phone-numbers.mjs.map +1 -1
  132. package/resources/phonenumbers.d.mts +58 -0
  133. package/resources/phonenumbers.d.mts.map +1 -0
  134. package/resources/phonenumbers.d.ts +58 -0
  135. package/resources/phonenumbers.d.ts.map +1 -0
  136. package/resources/phonenumbers.js +17 -0
  137. package/resources/phonenumbers.js.map +1 -0
  138. package/resources/phonenumbers.mjs +13 -0
  139. package/resources/phonenumbers.mjs.map +1 -0
  140. package/resources/shared.d.mts +5 -0
  141. package/resources/shared.d.mts.map +1 -0
  142. package/resources/shared.d.ts +5 -0
  143. package/resources/shared.d.ts.map +1 -0
  144. package/resources/{webhooks.js → shared.js} +1 -3
  145. package/resources/shared.js.map +1 -0
  146. package/{src/resources/webhooks.ts → resources/shared.mjs} +2 -2
  147. package/resources/shared.mjs.map +1 -0
  148. package/resources/webhook-events.d.mts +29 -0
  149. package/resources/webhook-events.d.mts.map +1 -0
  150. package/resources/webhook-events.d.ts +29 -0
  151. package/resources/webhook-events.d.ts.map +1 -0
  152. package/resources/{webhooks/events.js → webhook-events.js} +5 -10
  153. package/resources/webhook-events.js.map +1 -0
  154. package/resources/{webhooks/events.mjs → webhook-events.mjs} +3 -8
  155. package/resources/webhook-events.mjs.map +1 -0
  156. package/resources/webhook-subscriptions.d.mts +184 -0
  157. package/resources/webhook-subscriptions.d.mts.map +1 -0
  158. package/resources/webhook-subscriptions.d.ts +184 -0
  159. package/resources/webhook-subscriptions.d.ts.map +1 -0
  160. package/resources/{webhooks/subscriptions.js → webhook-subscriptions.js} +16 -16
  161. package/resources/webhook-subscriptions.js.map +1 -0
  162. package/resources/{webhooks/subscriptions.mjs → webhook-subscriptions.mjs} +14 -14
  163. package/resources/webhook-subscriptions.mjs.map +1 -0
  164. package/src/client.ts +97 -41
  165. package/src/core/api-promise.ts +4 -4
  166. package/src/core/error.ts +2 -2
  167. package/src/core/resource.ts +3 -3
  168. package/src/index.ts +3 -3
  169. package/src/internal/parse.ts +2 -2
  170. package/src/internal/shims.ts +1 -1
  171. package/src/internal/uploads.ts +5 -5
  172. package/src/internal/utils/base64.ts +3 -3
  173. package/src/internal/utils/log.ts +3 -3
  174. package/src/internal/utils/path.ts +2 -2
  175. package/src/internal/utils/values.ts +6 -6
  176. package/src/resources/attachments.ts +81 -106
  177. package/src/resources/capability.ts +98 -0
  178. package/src/resources/chats/chats.ts +130 -771
  179. package/src/resources/chats/index.ts +3 -2
  180. package/src/resources/chats/messages.ts +61 -839
  181. package/src/resources/index.ts +29 -9
  182. package/src/resources/messages.ts +186 -642
  183. package/src/resources/phone-numbers.ts +1 -65
  184. package/src/resources/phonenumbers.ts +72 -0
  185. package/src/resources/shared.ts +6 -0
  186. package/src/resources/webhook-events.ts +57 -0
  187. package/src/resources/webhook-subscriptions.ts +238 -0
  188. package/src/version.ts +1 -1
  189. package/version.d.mts +1 -1
  190. package/version.d.ts +1 -1
  191. package/version.js +1 -1
  192. package/version.mjs +1 -1
  193. package/resources/webhooks/events.d.mts +0 -30
  194. package/resources/webhooks/events.d.mts.map +0 -1
  195. package/resources/webhooks/events.d.ts +0 -30
  196. package/resources/webhooks/events.d.ts.map +0 -1
  197. package/resources/webhooks/events.js.map +0 -1
  198. package/resources/webhooks/events.mjs.map +0 -1
  199. package/resources/webhooks/index.d.mts +0 -4
  200. package/resources/webhooks/index.d.mts.map +0 -1
  201. package/resources/webhooks/index.d.ts +0 -4
  202. package/resources/webhooks/index.d.ts.map +0 -1
  203. package/resources/webhooks/index.js +0 -11
  204. package/resources/webhooks/index.js.map +0 -1
  205. package/resources/webhooks/index.mjs +0 -5
  206. package/resources/webhooks/index.mjs.map +0 -1
  207. package/resources/webhooks/subscriptions.d.mts +0 -237
  208. package/resources/webhooks/subscriptions.d.mts.map +0 -1
  209. package/resources/webhooks/subscriptions.d.ts +0 -237
  210. package/resources/webhooks/subscriptions.d.ts.map +0 -1
  211. package/resources/webhooks/subscriptions.js.map +0 -1
  212. package/resources/webhooks/subscriptions.mjs.map +0 -1
  213. package/resources/webhooks/webhooks.d.mts +0 -14
  214. package/resources/webhooks/webhooks.d.mts.map +0 -1
  215. package/resources/webhooks/webhooks.d.ts +0 -14
  216. package/resources/webhooks/webhooks.d.ts.map +0 -1
  217. package/resources/webhooks/webhooks.js +0 -21
  218. package/resources/webhooks/webhooks.js.map +0 -1
  219. package/resources/webhooks/webhooks.mjs +0 -16
  220. package/resources/webhooks/webhooks.mjs.map +0 -1
  221. package/resources/webhooks.d.mts +0 -2
  222. package/resources/webhooks.d.mts.map +0 -1
  223. package/resources/webhooks.d.ts +0 -2
  224. package/resources/webhooks.d.ts.map +0 -1
  225. package/resources/webhooks.js.map +0 -1
  226. package/resources/webhooks.mjs +0 -3
  227. package/resources/webhooks.mjs.map +0 -1
  228. package/src/resources/webhooks/events.ts +0 -55
  229. package/src/resources/webhooks/index.ts +0 -13
  230. package/src/resources/webhooks/subscriptions.ts +0 -409
  231. package/src/resources/webhooks/webhooks.ts +0 -37
@@ -1,6 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as MessagesAPI from '../messages';
5
+ import * as Shared from '../shared';
6
+ import * as ChatsAPI from './chats';
4
7
  import { APIPromise } from '../../core/api-promise';
5
8
  import { RequestOptions } from '../../internal/request-options';
6
9
  import { path } from '../../internal/utils/path';
@@ -59,369 +62,77 @@ export class Messages extends APIResource {
59
62
  }
60
63
  }
61
64
 
62
- export interface MessageListResponse {
65
+ /**
66
+ * A message that was sent (used in CreateChat and SendMessage responses)
67
+ */
68
+ export interface SentMessage {
63
69
  /**
64
- * List of messages
70
+ * Message identifier (UUID)
65
71
  */
66
- messages: Array<MessageListResponse.Message>;
72
+ id: string;
67
73
 
68
74
  /**
69
- * Cursor for fetching the next page of results. Null if there are no more results
70
- * to fetch. Pass this value as the `cursor` parameter in the next request.
75
+ * Current delivery status of a message
71
76
  */
72
- next_cursor?: string | null;
73
- }
74
-
75
- export namespace MessageListResponse {
76
- export interface Message {
77
- /**
78
- * Unique identifier for the message
79
- */
80
- id: string;
81
-
82
- /**
83
- * ID of the chat this message belongs to
84
- */
85
- chat_id: string;
86
-
87
- /**
88
- * When the message was created
89
- */
90
- created_at: string;
91
-
92
- /**
93
- * Whether the message has been delivered
94
- */
95
- is_delivered: boolean;
96
-
97
- /**
98
- * Whether this message was sent by the authenticated user
99
- */
100
- is_from_me: boolean;
101
-
102
- /**
103
- * Whether the message has been read
104
- */
105
- is_read: boolean;
106
-
107
- /**
108
- * When the message was last updated
109
- */
110
- updated_at: string;
111
-
112
- /**
113
- * When the message was delivered
114
- */
115
- delivered_at?: string | null;
116
-
117
- /**
118
- * iMessage effect applied to a message (screen or bubble effect)
119
- */
120
- effect?: Message.Effect | null;
121
-
122
- /**
123
- * @deprecated DEPRECATED: Use from_handle instead. Phone number of the message
124
- * sender.
125
- */
126
- from?: string | null;
127
-
128
- /**
129
- * The sender of this message as a full handle object
130
- */
131
- from_handle?: Message.FromHandle | null;
132
-
133
- /**
134
- * Message parts in order (text and media)
135
- */
136
- parts?: Array<Message.TextPartResponse | Message.MediaPartResponse> | null;
137
-
138
- /**
139
- * Messaging service type
140
- */
141
- preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
142
-
143
- /**
144
- * When the message was read
145
- */
146
- read_at?: string | null;
147
-
148
- /**
149
- * Indicates this message is a threaded reply to another message
150
- */
151
- reply_to?: Message.ReplyTo | null;
152
-
153
- /**
154
- * When the message was sent
155
- */
156
- sent_at?: string | null;
157
-
158
- /**
159
- * Messaging service type
160
- */
161
- service?: 'iMessage' | 'SMS' | 'RCS' | null;
162
- }
163
-
164
- export namespace Message {
165
- /**
166
- * iMessage effect applied to a message (screen or bubble effect)
167
- */
168
- export interface Effect {
169
- /**
170
- * Name of the effect. Common values:
171
- *
172
- * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
173
- * love, balloons, happy_birthday, echo, spotlight
174
- * - Bubble effects: slam, loud, gentle, invisible
175
- */
176
- name?: string;
177
-
178
- /**
179
- * Type of effect
180
- */
181
- type?: 'screen' | 'bubble';
182
- }
183
-
184
- /**
185
- * The sender of this message as a full handle object
186
- */
187
- export interface FromHandle {
188
- /**
189
- * Unique identifier for this handle
190
- */
191
- id: string;
192
-
193
- /**
194
- * Phone number (E.164) or email address of the participant
195
- */
196
- handle: string;
197
-
198
- /**
199
- * When this participant joined the chat
200
- */
201
- joined_at: string;
202
-
203
- /**
204
- * Messaging service type
205
- */
206
- service: 'iMessage' | 'SMS' | 'RCS';
207
-
208
- /**
209
- * Whether this handle belongs to the sender (your phone number)
210
- */
211
- is_me?: boolean | null;
212
-
213
- /**
214
- * When they left (if applicable)
215
- */
216
- left_at?: string | null;
217
-
218
- /**
219
- * Participant status
220
- */
221
- status?: 'active' | 'left' | 'removed' | null;
222
- }
223
-
224
- /**
225
- * A text message part
226
- */
227
- export interface TextPartResponse {
228
- /**
229
- * Reactions on this message part
230
- */
231
- reactions: Array<TextPartResponse.Reaction> | null;
232
-
233
- /**
234
- * Indicates this is a text message part
235
- */
236
- type: 'text';
237
-
238
- /**
239
- * The text content
240
- */
241
- value: string;
242
- }
243
-
244
- export namespace TextPartResponse {
245
- export interface Reaction {
246
- handle: Reaction.Handle;
247
-
248
- /**
249
- * Whether this reaction is from the current user
250
- */
251
- is_me: boolean;
252
-
253
- /**
254
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
255
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
256
- * emoji in the custom_emoji field.
257
- */
258
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
259
-
260
- /**
261
- * Custom emoji if type is "custom", null otherwise
262
- */
263
- custom_emoji?: string | null;
264
- }
265
-
266
- export namespace Reaction {
267
- export interface Handle {
268
- /**
269
- * Unique identifier for this handle
270
- */
271
- id: string;
77
+ delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'failed';
272
78
 
273
- /**
274
- * Phone number (E.164) or email address of the participant
275
- */
276
- handle: string;
277
-
278
- /**
279
- * When this participant joined the chat
280
- */
281
- joined_at: string;
282
-
283
- /**
284
- * Messaging service type
285
- */
286
- service: 'iMessage' | 'SMS' | 'RCS';
287
-
288
- /**
289
- * Whether this handle belongs to the sender (your phone number)
290
- */
291
- is_me?: boolean | null;
292
-
293
- /**
294
- * When they left (if applicable)
295
- */
296
- left_at?: string | null;
297
-
298
- /**
299
- * Participant status
300
- */
301
- status?: 'active' | 'left' | 'removed' | null;
302
- }
303
- }
304
- }
305
-
306
- /**
307
- * A media attachment part
308
- */
309
- export interface MediaPartResponse {
310
- /**
311
- * Unique attachment identifier
312
- */
313
- id: string;
314
-
315
- /**
316
- * Original filename
317
- */
318
- filename: string;
319
-
320
- /**
321
- * MIME type of the file
322
- */
323
- mime_type: string;
324
-
325
- /**
326
- * Reactions on this message part
327
- */
328
- reactions: Array<MediaPartResponse.Reaction> | null;
329
-
330
- /**
331
- * File size in bytes
332
- */
333
- size_bytes: number;
334
-
335
- /**
336
- * Indicates this is a media attachment part
337
- */
338
- type: 'media';
339
-
340
- /**
341
- * Presigned URL for downloading the attachment (expires in 1 hour).
342
- */
343
- url: string;
344
- }
345
-
346
- export namespace MediaPartResponse {
347
- export interface Reaction {
348
- handle: Reaction.Handle;
349
-
350
- /**
351
- * Whether this reaction is from the current user
352
- */
353
- is_me: boolean;
354
-
355
- /**
356
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
357
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
358
- * emoji in the custom_emoji field.
359
- */
360
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
79
+ /**
80
+ * Whether the message has been read
81
+ */
82
+ is_read: boolean;
361
83
 
362
- /**
363
- * Custom emoji if type is "custom", null otherwise
364
- */
365
- custom_emoji?: string | null;
366
- }
84
+ /**
85
+ * Message parts in order (text and media)
86
+ */
87
+ parts: Array<MessagesAPI.TextPart | MessagesAPI.MediaPart>;
367
88
 
368
- export namespace Reaction {
369
- export interface Handle {
370
- /**
371
- * Unique identifier for this handle
372
- */
373
- id: string;
89
+ /**
90
+ * When the message was sent
91
+ */
92
+ sent_at: string;
374
93
 
375
- /**
376
- * Phone number (E.164) or email address of the participant
377
- */
378
- handle: string;
94
+ /**
95
+ * When the message was delivered
96
+ */
97
+ delivered_at?: string | null;
379
98
 
380
- /**
381
- * When this participant joined the chat
382
- */
383
- joined_at: string;
99
+ /**
100
+ * iMessage effect applied to a message (screen or bubble effect)
101
+ */
102
+ effect?: MessagesAPI.MessageEffect | null;
384
103
 
385
- /**
386
- * Messaging service type
387
- */
388
- service: 'iMessage' | 'SMS' | 'RCS';
104
+ /**
105
+ * The sender of this message as a full handle object
106
+ */
107
+ from_handle?: MessagesAPI.ChatHandle | null;
389
108
 
390
- /**
391
- * Whether this handle belongs to the sender (your phone number)
392
- */
393
- is_me?: boolean | null;
109
+ /**
110
+ * Messaging service type
111
+ */
112
+ preferred_service?: Shared.ServiceType | null;
394
113
 
395
- /**
396
- * When they left (if applicable)
397
- */
398
- left_at?: string | null;
114
+ /**
115
+ * Indicates this message is a threaded reply to another message
116
+ */
117
+ reply_to?: MessagesAPI.ReplyTo | null;
399
118
 
400
- /**
401
- * Participant status
402
- */
403
- status?: 'active' | 'left' | 'removed' | null;
404
- }
405
- }
406
- }
119
+ /**
120
+ * Messaging service type
121
+ */
122
+ service?: Shared.ServiceType | null;
123
+ }
407
124
 
408
- /**
409
- * Indicates this message is a threaded reply to another message
410
- */
411
- export interface ReplyTo {
412
- /**
413
- * The ID of the message to reply to
414
- */
415
- message_id: string;
125
+ export interface MessageListResponse {
126
+ /**
127
+ * List of messages
128
+ */
129
+ messages: Array<MessagesAPI.Message>;
416
130
 
417
- /**
418
- * The specific message part to reply to (0-based index). Defaults to 0 (first
419
- * part) if not provided. Use this when replying to a specific part of a multipart
420
- * message.
421
- */
422
- part_index?: number;
423
- }
424
- }
131
+ /**
132
+ * Cursor for fetching the next page of results. Null if there are no more results
133
+ * to fetch. Pass this value as the `cursor` parameter in the next request.
134
+ */
135
+ next_cursor?: string | null;
425
136
  }
426
137
 
427
138
  /**
@@ -436,331 +147,7 @@ export interface MessageSendResponse {
436
147
  /**
437
148
  * A message that was sent (used in CreateChat and SendMessage responses)
438
149
  */
439
- message: MessageSendResponse.Message;
440
- }
441
-
442
- export namespace MessageSendResponse {
443
- /**
444
- * A message that was sent (used in CreateChat and SendMessage responses)
445
- */
446
- export interface Message {
447
- /**
448
- * Message identifier (UUID)
449
- */
450
- id: string;
451
-
452
- /**
453
- * Current delivery status of a message
454
- */
455
- delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'failed';
456
-
457
- /**
458
- * Whether the message has been read
459
- */
460
- is_read: boolean;
461
-
462
- /**
463
- * Message parts in order (text and media)
464
- */
465
- parts: Array<Message.TextPartResponse | Message.MediaPartResponse>;
466
-
467
- /**
468
- * When the message was sent
469
- */
470
- sent_at: string;
471
-
472
- /**
473
- * When the message was delivered
474
- */
475
- delivered_at?: string | null;
476
-
477
- /**
478
- * iMessage effect applied to a message (screen or bubble effect)
479
- */
480
- effect?: Message.Effect | null;
481
-
482
- /**
483
- * The sender of this message as a full handle object
484
- */
485
- from_handle?: Message.FromHandle | null;
486
-
487
- /**
488
- * Messaging service type
489
- */
490
- preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
491
-
492
- /**
493
- * Indicates this message is a threaded reply to another message
494
- */
495
- reply_to?: Message.ReplyTo | null;
496
-
497
- /**
498
- * Messaging service type
499
- */
500
- service?: 'iMessage' | 'SMS' | 'RCS' | null;
501
- }
502
-
503
- export namespace Message {
504
- /**
505
- * A text message part
506
- */
507
- export interface TextPartResponse {
508
- /**
509
- * Reactions on this message part
510
- */
511
- reactions: Array<TextPartResponse.Reaction> | null;
512
-
513
- /**
514
- * Indicates this is a text message part
515
- */
516
- type: 'text';
517
-
518
- /**
519
- * The text content
520
- */
521
- value: string;
522
- }
523
-
524
- export namespace TextPartResponse {
525
- export interface Reaction {
526
- handle: Reaction.Handle;
527
-
528
- /**
529
- * Whether this reaction is from the current user
530
- */
531
- is_me: boolean;
532
-
533
- /**
534
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
535
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
536
- * emoji in the custom_emoji field.
537
- */
538
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
539
-
540
- /**
541
- * Custom emoji if type is "custom", null otherwise
542
- */
543
- custom_emoji?: string | null;
544
- }
545
-
546
- export namespace Reaction {
547
- export interface Handle {
548
- /**
549
- * Unique identifier for this handle
550
- */
551
- id: string;
552
-
553
- /**
554
- * Phone number (E.164) or email address of the participant
555
- */
556
- handle: string;
557
-
558
- /**
559
- * When this participant joined the chat
560
- */
561
- joined_at: string;
562
-
563
- /**
564
- * Messaging service type
565
- */
566
- service: 'iMessage' | 'SMS' | 'RCS';
567
-
568
- /**
569
- * Whether this handle belongs to the sender (your phone number)
570
- */
571
- is_me?: boolean | null;
572
-
573
- /**
574
- * When they left (if applicable)
575
- */
576
- left_at?: string | null;
577
-
578
- /**
579
- * Participant status
580
- */
581
- status?: 'active' | 'left' | 'removed' | null;
582
- }
583
- }
584
- }
585
-
586
- /**
587
- * A media attachment part
588
- */
589
- export interface MediaPartResponse {
590
- /**
591
- * Unique attachment identifier
592
- */
593
- id: string;
594
-
595
- /**
596
- * Original filename
597
- */
598
- filename: string;
599
-
600
- /**
601
- * MIME type of the file
602
- */
603
- mime_type: string;
604
-
605
- /**
606
- * Reactions on this message part
607
- */
608
- reactions: Array<MediaPartResponse.Reaction> | null;
609
-
610
- /**
611
- * File size in bytes
612
- */
613
- size_bytes: number;
614
-
615
- /**
616
- * Indicates this is a media attachment part
617
- */
618
- type: 'media';
619
-
620
- /**
621
- * Presigned URL for downloading the attachment (expires in 1 hour).
622
- */
623
- url: string;
624
- }
625
-
626
- export namespace MediaPartResponse {
627
- export interface Reaction {
628
- handle: Reaction.Handle;
629
-
630
- /**
631
- * Whether this reaction is from the current user
632
- */
633
- is_me: boolean;
634
-
635
- /**
636
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
637
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
638
- * emoji in the custom_emoji field.
639
- */
640
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
641
-
642
- /**
643
- * Custom emoji if type is "custom", null otherwise
644
- */
645
- custom_emoji?: string | null;
646
- }
647
-
648
- export namespace Reaction {
649
- export interface Handle {
650
- /**
651
- * Unique identifier for this handle
652
- */
653
- id: string;
654
-
655
- /**
656
- * Phone number (E.164) or email address of the participant
657
- */
658
- handle: string;
659
-
660
- /**
661
- * When this participant joined the chat
662
- */
663
- joined_at: string;
664
-
665
- /**
666
- * Messaging service type
667
- */
668
- service: 'iMessage' | 'SMS' | 'RCS';
669
-
670
- /**
671
- * Whether this handle belongs to the sender (your phone number)
672
- */
673
- is_me?: boolean | null;
674
-
675
- /**
676
- * When they left (if applicable)
677
- */
678
- left_at?: string | null;
679
-
680
- /**
681
- * Participant status
682
- */
683
- status?: 'active' | 'left' | 'removed' | null;
684
- }
685
- }
686
- }
687
-
688
- /**
689
- * iMessage effect applied to a message (screen or bubble effect)
690
- */
691
- export interface Effect {
692
- /**
693
- * Name of the effect. Common values:
694
- *
695
- * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
696
- * love, balloons, happy_birthday, echo, spotlight
697
- * - Bubble effects: slam, loud, gentle, invisible
698
- */
699
- name?: string;
700
-
701
- /**
702
- * Type of effect
703
- */
704
- type?: 'screen' | 'bubble';
705
- }
706
-
707
- /**
708
- * The sender of this message as a full handle object
709
- */
710
- export interface FromHandle {
711
- /**
712
- * Unique identifier for this handle
713
- */
714
- id: string;
715
-
716
- /**
717
- * Phone number (E.164) or email address of the participant
718
- */
719
- handle: string;
720
-
721
- /**
722
- * When this participant joined the chat
723
- */
724
- joined_at: string;
725
-
726
- /**
727
- * Messaging service type
728
- */
729
- service: 'iMessage' | 'SMS' | 'RCS';
730
-
731
- /**
732
- * Whether this handle belongs to the sender (your phone number)
733
- */
734
- is_me?: boolean | null;
735
-
736
- /**
737
- * When they left (if applicable)
738
- */
739
- left_at?: string | null;
740
-
741
- /**
742
- * Participant status
743
- */
744
- status?: 'active' | 'left' | 'removed' | null;
745
- }
746
-
747
- /**
748
- * Indicates this message is a threaded reply to another message
749
- */
750
- export interface ReplyTo {
751
- /**
752
- * The ID of the message to reply to
753
- */
754
- message_id: string;
755
-
756
- /**
757
- * The specific message part to reply to (0-based index). Defaults to 0 (first
758
- * part) if not provided. Use this when replying to a specific part of a multipart
759
- * message.
760
- */
761
- part_index?: number;
762
- }
763
- }
150
+ message: SentMessage;
764
151
  }
765
152
 
766
153
  export interface MessageListParams {
@@ -781,177 +168,12 @@ export interface MessageSendParams {
781
168
  * separating the "what" (message content) from the "where" (routing fields like
782
169
  * from/to).
783
170
  */
784
- message: MessageSendParams.Message;
785
- }
786
-
787
- export namespace MessageSendParams {
788
- /**
789
- * Message content container. Groups all message-related fields together,
790
- * separating the "what" (message content) from the "where" (routing fields like
791
- * from/to).
792
- */
793
- export interface Message {
794
- /**
795
- * Array of message parts. Each part can be either text or media. Parts are
796
- * displayed in order. Text and media can be mixed.
797
- *
798
- * **Supported Media:**
799
- *
800
- * - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
801
- * - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
802
- * - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
803
- * - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
804
- * .pages, .numbers, .key, .epub, .zip, .html, .htm
805
- * - Contact & Calendar: .vcf, .ics
806
- *
807
- * **Audio:**
808
- *
809
- * - Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as
810
- * media parts
811
- * - To send audio as an **iMessage voice memo bubble** (inline playback UI), use
812
- * the dedicated `/v3/chats/{chatId}/voicememo` endpoint instead
813
- *
814
- * **Validation Rule:** Consecutive text parts are not allowed. Text parts must be
815
- * separated by media parts. For example, [text, text] is invalid, but [text,
816
- * media, text] is valid.
817
- */
818
- parts: Array<Message.TextPart | Message.MediaPart>;
819
-
820
- /**
821
- * iMessage effect to apply to this message (screen or bubble effect)
822
- */
823
- effect?: Message.Effect;
824
-
825
- /**
826
- * Optional idempotency key for this message. Use this to prevent duplicate sends
827
- * of the same message.
828
- */
829
- idempotency_key?: string;
830
-
831
- /**
832
- * Messaging service type
833
- */
834
- preferred_service?: 'iMessage' | 'SMS' | 'RCS';
835
-
836
- /**
837
- * Reply to another message to create a threaded conversation
838
- */
839
- reply_to?: Message.ReplyTo;
840
- }
841
-
842
- export namespace Message {
843
- export interface TextPart {
844
- /**
845
- * Indicates this is a text message part
846
- */
847
- type: 'text';
848
-
849
- /**
850
- * The text content
851
- */
852
- value: string;
853
-
854
- /**
855
- * Optional idempotency key for this specific message part. Use this to prevent
856
- * duplicate sends of the same part.
857
- */
858
- idempotency_key?: string;
859
- }
860
-
861
- export interface MediaPart {
862
- /**
863
- * Indicates this is a media attachment part
864
- */
865
- type: 'media';
866
-
867
- /**
868
- * Reference to a file pre-uploaded via `POST /v3/attachments` (optional). The file
869
- * is already stored, so sends using this ID skip the download step — useful when
870
- * sending the same file to many recipients.
871
- *
872
- * Either `url` or `attachment_id` must be provided, but not both.
873
- */
874
- attachment_id?: string;
875
-
876
- /**
877
- * Optional idempotency key for this specific message part. Use this to prevent
878
- * duplicate sends of the same part.
879
- */
880
- idempotency_key?: string;
881
-
882
- /**
883
- * Any publicly accessible HTTPS URL to the media file. The server downloads and
884
- * sends the file automatically — no pre-upload step required.
885
- *
886
- * **Size limit:** 10MB maximum for URL-based downloads. For larger files (up to
887
- * 100MB), use the pre-upload flow: `POST /v3/attachments` to get a presigned URL,
888
- * upload directly, then reference by `attachment_id`.
889
- *
890
- * **Requirements:**
891
- *
892
- * - URL must use HTTPS
893
- * - File content must be a supported format (the server validates the actual file
894
- * content)
895
- *
896
- * **Supported formats:**
897
- *
898
- * - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
899
- * - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
900
- * - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
901
- * - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
902
- * .pages, .numbers, .key, .epub, .zip, .html, .htm
903
- * - Contact & Calendar: .vcf, .ics
904
- *
905
- * **Tip:** Audio sent here appears as a regular file attachment. To send audio as
906
- * an iMessage voice memo bubble (with inline playback), use
907
- * `/v3/chats/{chatId}/voicememo`. For repeated sends of the same file, use
908
- * `attachment_id` to avoid redundant downloads.
909
- *
910
- * Either `url` or `attachment_id` must be provided, but not both.
911
- */
912
- url?: string;
913
- }
914
-
915
- /**
916
- * iMessage effect to apply to this message (screen or bubble effect)
917
- */
918
- export interface Effect {
919
- /**
920
- * Name of the effect. Common values:
921
- *
922
- * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
923
- * love, balloons, happy_birthday, echo, spotlight
924
- * - Bubble effects: slam, loud, gentle, invisible
925
- */
926
- name?: string;
927
-
928
- /**
929
- * Type of effect
930
- */
931
- type?: 'screen' | 'bubble';
932
- }
933
-
934
- /**
935
- * Reply to another message to create a threaded conversation
936
- */
937
- export interface ReplyTo {
938
- /**
939
- * The ID of the message to reply to
940
- */
941
- message_id: string;
942
-
943
- /**
944
- * The specific message part to reply to (0-based index). Defaults to 0 (first
945
- * part) if not provided. Use this when replying to a specific part of a multipart
946
- * message.
947
- */
948
- part_index?: number;
949
- }
950
- }
171
+ message: ChatsAPI.MessageContent;
951
172
  }
952
173
 
953
174
  export declare namespace Messages {
954
175
  export {
176
+ type SentMessage as SentMessage,
955
177
  type MessageListResponse as MessageListResponse,
956
178
  type MessageSendResponse as MessageSendResponse,
957
179
  type MessageListParams as MessageListParams,