@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,4 +1,5 @@
1
1
  import { APIResource } from "../core/resource.js";
2
+ import * as Shared from "./shared.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: Shared.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?: Shared.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?: Shared.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
- }
162
- /**
163
- * The sender of this message as a full handle object
164
- */
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
- }
208
+ /**
209
+ * iMessage effect applied to a message (screen or bubble effect)
210
+ */
211
+ export interface MessageEffect {
263
212
  /**
264
- * A media attachment part
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
265
218
  */
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
  */
@@ -369,46 +231,87 @@ export interface MessageAddReactionResponse {
369
231
  /**
370
232
  * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
371
233
  * emphasize, question. Custom emoji reactions have type "custom" with the actual
372
- * emoji in the custom_emoji field.
234
+ * emoji in the custom_emoji field. Sticker reactions have type "sticker" with
235
+ * sticker attachment details in the sticker field.
373
236
  */
374
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
237
+ type: ReactionType;
375
238
  /**
376
239
  * Custom emoji if type is "custom", null otherwise
377
240
  */
378
241
  custom_emoji?: string | null;
242
+ /**
243
+ * Sticker attachment details when reaction_type is "sticker". Null for non-sticker
244
+ * reactions.
245
+ */
246
+ sticker?: Reaction.Sticker | null;
379
247
  }
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;
248
+ export declare namespace Reaction {
249
+ /**
250
+ * Sticker attachment details when reaction_type is "sticker". Null for non-sticker
251
+ * reactions.
252
+ */
253
+ interface Sticker {
390
254
  /**
391
- * When this participant joined the chat
255
+ * Filename of the sticker
392
256
  */
393
- joined_at: string;
257
+ file_name?: string;
394
258
  /**
395
- * Messaging service type
259
+ * Sticker image height in pixels
396
260
  */
397
- service: 'iMessage' | 'SMS' | 'RCS';
261
+ height?: number;
398
262
  /**
399
- * Whether this handle belongs to the sender (your phone number)
263
+ * MIME type of the sticker image
400
264
  */
401
- is_me?: boolean | null;
265
+ mime_type?: string;
402
266
  /**
403
- * When they left (if applicable)
267
+ * Presigned URL for downloading the sticker image (expires in 1 hour).
404
268
  */
405
- left_at?: string | null;
269
+ url?: string;
406
270
  /**
407
- * Participant status
271
+ * Sticker image width in pixels
408
272
  */
409
- status?: 'active' | 'left' | 'removed' | null;
273
+ width?: number;
410
274
  }
411
275
  }
276
+ /**
277
+ * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
278
+ * emphasize, question. Custom emoji reactions have type "custom" with the actual
279
+ * emoji in the custom_emoji field. Sticker reactions have type "sticker" with
280
+ * sticker attachment details in the sticker field.
281
+ */
282
+ export type ReactionType = 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker';
283
+ /**
284
+ * Indicates this message is a threaded reply to another message
285
+ */
286
+ export interface ReplyTo {
287
+ /**
288
+ * The ID of the message to reply to
289
+ */
290
+ message_id: string;
291
+ /**
292
+ * The specific message part to reply to (0-based index). Defaults to 0 (first
293
+ * part) if not provided. Use this when replying to a specific part of a multipart
294
+ * message.
295
+ */
296
+ part_index?: number;
297
+ }
298
+ /**
299
+ * A text message part
300
+ */
301
+ export interface TextPart {
302
+ /**
303
+ * Reactions on this message part
304
+ */
305
+ reactions: Array<Reaction> | null;
306
+ /**
307
+ * Indicates this is a text message part
308
+ */
309
+ type: 'text';
310
+ /**
311
+ * The text content
312
+ */
313
+ value: string;
314
+ }
412
315
  /**
413
316
  * Response containing messages in a thread with pagination
414
317
  */
@@ -416,304 +319,12 @@ export interface MessageRetrieveThreadResponse {
416
319
  /**
417
320
  * Messages in the thread, ordered by the specified order parameter
418
321
  */
419
- messages: Array<MessageRetrieveThreadResponse.Message>;
322
+ messages: Array<Message>;
420
323
  /**
421
324
  * Cursor for fetching the next page of results (null if no more results)
422
325
  */
423
326
  next_cursor?: string | null;
424
327
  }
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
328
  export interface MessageDeleteParams {
718
329
  /**
719
330
  * ID of the chat containing the message to delete
@@ -728,9 +339,10 @@ export interface MessageAddReactionParams {
728
339
  /**
729
340
  * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
730
341
  * emphasize, question. Custom emoji reactions have type "custom" with the actual
731
- * emoji in the custom_emoji field.
342
+ * emoji in the custom_emoji field. Sticker reactions have type "sticker" with
343
+ * sticker attachment details in the sticker field.
732
344
  */
733
- type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
345
+ type: ReactionType;
734
346
  /**
735
347
  * Custom emoji string. Required when type is "custom".
736
348
  */
@@ -756,6 +368,6 @@ export interface MessageRetrieveThreadParams {
756
368
  order?: 'asc' | 'desc';
757
369
  }
758
370
  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, };
371
+ 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
372
  }
761
373
  //# sourceMappingURL=messages.d.ts.map