@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.
- package/CHANGELOG.md +36 -0
- package/LICENSE +198 -4
- package/README.md +52 -52
- package/client.d.mts +34 -22
- package/client.d.mts.map +1 -1
- package/client.d.ts +34 -22
- package/client.d.ts.map +1 -1
- package/client.js +50 -41
- package/client.js.map +1 -1
- package/client.mjs +49 -40
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +2 -2
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +2 -2
- package/core/error.d.ts.map +1 -1
- package/core/error.js +4 -4
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +3 -3
- package/index.d.mts.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/index.mjs +3 -3
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/shims.js +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.js +2 -2
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +3 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.js +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +2 -2
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -6
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +4 -4
- package/resources/attachments.d.mts +28 -3
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +28 -3
- package/resources/attachments.d.ts.map +1 -1
- package/resources/capability.d.mts +74 -0
- package/resources/capability.d.mts.map +1 -0
- package/resources/capability.d.ts +74 -0
- package/resources/capability.d.ts.map +1 -0
- package/resources/capability.js +36 -0
- package/resources/capability.js.map +1 -0
- package/resources/capability.mjs +32 -0
- package/resources/capability.mjs.map +1 -0
- package/resources/chats/chats.d.mts +133 -663
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +133 -663
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +2 -2
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +2 -2
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +2 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +2 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/index.js.map +1 -1
- package/resources/chats/index.mjs.map +1 -1
- package/resources/chats/messages.d.mts +55 -716
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +55 -716
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/index.d.mts +8 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -2
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +129 -553
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +129 -553
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +1 -50
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +1 -50
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +0 -8
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +0 -8
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/phonenumbers.d.mts +58 -0
- package/resources/phonenumbers.d.mts.map +1 -0
- package/resources/phonenumbers.d.ts +58 -0
- package/resources/phonenumbers.d.ts.map +1 -0
- package/resources/phonenumbers.js +17 -0
- package/resources/phonenumbers.js.map +1 -0
- package/resources/phonenumbers.mjs +13 -0
- package/resources/phonenumbers.mjs.map +1 -0
- package/resources/webhook-events.d.mts +29 -0
- package/resources/webhook-events.d.mts.map +1 -0
- package/resources/webhook-events.d.ts +29 -0
- package/resources/webhook-events.d.ts.map +1 -0
- package/resources/{webhooks/events.js → webhook-events.js} +5 -10
- package/resources/webhook-events.js.map +1 -0
- package/resources/{webhooks/events.mjs → webhook-events.mjs} +3 -8
- package/resources/webhook-events.mjs.map +1 -0
- package/resources/webhook-subscriptions.d.mts +184 -0
- package/resources/webhook-subscriptions.d.mts.map +1 -0
- package/resources/webhook-subscriptions.d.ts +184 -0
- package/resources/webhook-subscriptions.d.ts.map +1 -0
- package/resources/{webhooks/subscriptions.js → webhook-subscriptions.js} +16 -16
- package/resources/webhook-subscriptions.js.map +1 -0
- package/resources/{webhooks/subscriptions.mjs → webhook-subscriptions.mjs} +14 -14
- package/resources/webhook-subscriptions.mjs.map +1 -0
- package/src/client.ts +97 -41
- package/src/core/api-promise.ts +4 -4
- package/src/core/error.ts +2 -2
- package/src/core/resource.ts +3 -3
- package/src/index.ts +3 -3
- package/src/internal/parse.ts +2 -2
- package/src/internal/shims.ts +1 -1
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/base64.ts +3 -3
- package/src/internal/utils/log.ts +3 -3
- package/src/internal/utils/path.ts +2 -2
- package/src/internal/utils/values.ts +6 -6
- package/src/resources/attachments.ts +81 -106
- package/src/resources/capability.ts +98 -0
- package/src/resources/chats/chats.ts +135 -770
- package/src/resources/chats/index.ts +4 -2
- package/src/resources/chats/messages.ts +60 -839
- package/src/resources/index.ts +29 -9
- package/src/resources/messages.ts +153 -659
- package/src/resources/phone-numbers.ts +1 -65
- package/src/resources/phonenumbers.ts +72 -0
- package/src/resources/webhook-events.ts +57 -0
- package/src/resources/webhook-subscriptions.ts +238 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/webhooks/events.d.mts +0 -30
- package/resources/webhooks/events.d.mts.map +0 -1
- package/resources/webhooks/events.d.ts +0 -30
- package/resources/webhooks/events.d.ts.map +0 -1
- package/resources/webhooks/events.js.map +0 -1
- package/resources/webhooks/events.mjs.map +0 -1
- package/resources/webhooks/index.d.mts +0 -4
- package/resources/webhooks/index.d.mts.map +0 -1
- package/resources/webhooks/index.d.ts +0 -4
- package/resources/webhooks/index.d.ts.map +0 -1
- package/resources/webhooks/index.js +0 -11
- package/resources/webhooks/index.js.map +0 -1
- package/resources/webhooks/index.mjs +0 -5
- package/resources/webhooks/index.mjs.map +0 -1
- package/resources/webhooks/subscriptions.d.mts +0 -237
- package/resources/webhooks/subscriptions.d.mts.map +0 -1
- package/resources/webhooks/subscriptions.d.ts +0 -237
- package/resources/webhooks/subscriptions.d.ts.map +0 -1
- package/resources/webhooks/subscriptions.js.map +0 -1
- package/resources/webhooks/subscriptions.mjs.map +0 -1
- package/resources/webhooks/webhooks.d.mts +0 -14
- package/resources/webhooks/webhooks.d.mts.map +0 -1
- package/resources/webhooks/webhooks.d.ts +0 -14
- package/resources/webhooks/webhooks.d.ts.map +0 -1
- package/resources/webhooks/webhooks.js +0 -21
- package/resources/webhooks/webhooks.js.map +0 -1
- package/resources/webhooks/webhooks.mjs +0 -16
- package/resources/webhooks/webhooks.mjs.map +0 -1
- package/resources/webhooks.d.mts +0 -2
- package/resources/webhooks.d.mts.map +0 -1
- package/resources/webhooks.d.ts +0 -2
- package/resources/webhooks.d.ts.map +0 -1
- package/resources/webhooks.js +0 -6
- package/resources/webhooks.js.map +0 -1
- package/resources/webhooks.mjs +0 -3
- package/resources/webhooks.mjs.map +0 -1
- package/src/resources/webhooks/events.ts +0 -55
- package/src/resources/webhooks/index.ts +0 -13
- package/src/resources/webhooks/subscriptions.ts +0 -409
- package/src/resources/webhooks/webhooks.ts +0 -37
- package/src/resources/webhooks.ts +0 -3
|
@@ -1,13 +1,16 @@
|
|
|
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
|
|
4
|
+
import * as ChatsAPI from './chats';
|
|
5
|
+
import * as MessagesAPI from '../messages';
|
|
6
|
+
import * as ChatsMessagesAPI from './messages';
|
|
5
7
|
import {
|
|
6
8
|
MessageListParams,
|
|
7
9
|
MessageListResponse,
|
|
8
10
|
MessageSendParams,
|
|
9
11
|
MessageSendResponse,
|
|
10
12
|
Messages,
|
|
13
|
+
SentMessage,
|
|
11
14
|
} from './messages';
|
|
12
15
|
import * as ParticipantsAPI from './participants';
|
|
13
16
|
import {
|
|
@@ -27,7 +30,7 @@ import { path } from '../../internal/utils/path';
|
|
|
27
30
|
export class Chats extends APIResource {
|
|
28
31
|
participants: ParticipantsAPI.Participants = new ParticipantsAPI.Participants(this._client);
|
|
29
32
|
typing: TypingAPI.Typing = new TypingAPI.Typing(this._client);
|
|
30
|
-
messages:
|
|
33
|
+
messages: ChatsMessagesAPI.Messages = new ChatsMessagesAPI.Messages(this._client);
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* Create a new chat with specified participants and send an initial message. The
|
|
@@ -77,7 +80,7 @@ export class Chats extends APIResource {
|
|
|
77
80
|
* );
|
|
78
81
|
* ```
|
|
79
82
|
*/
|
|
80
|
-
retrieve(chatID: string, options?: RequestOptions): APIPromise<
|
|
83
|
+
retrieve(chatID: string, options?: RequestOptions): APIPromise<Chat> {
|
|
81
84
|
return this._client.get(path`/v3/chats/${chatID}`, options);
|
|
82
85
|
}
|
|
83
86
|
|
|
@@ -92,7 +95,7 @@ export class Chats extends APIResource {
|
|
|
92
95
|
* );
|
|
93
96
|
* ```
|
|
94
97
|
*/
|
|
95
|
-
update(chatID: string, body: ChatUpdateParams, options?: RequestOptions): APIPromise<
|
|
98
|
+
update(chatID: string, body: ChatUpdateParams, options?: RequestOptions): APIPromise<Chat> {
|
|
96
99
|
return this._client.put(path`/v3/chats/${chatID}`, { body, ...options });
|
|
97
100
|
}
|
|
98
101
|
|
|
@@ -200,411 +203,7 @@ export class Chats extends APIResource {
|
|
|
200
203
|
}
|
|
201
204
|
}
|
|
202
205
|
|
|
203
|
-
|
|
204
|
-
* Response for creating a new chat with an initial message
|
|
205
|
-
*/
|
|
206
|
-
export interface ChatCreateResponse {
|
|
207
|
-
chat: ChatCreateResponse.Chat;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export namespace ChatCreateResponse {
|
|
211
|
-
export interface Chat {
|
|
212
|
-
/**
|
|
213
|
-
* Unique identifier for the created chat (UUID)
|
|
214
|
-
*/
|
|
215
|
-
id: string;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
219
|
-
* handles. Can be updated for group chats.
|
|
220
|
-
*/
|
|
221
|
-
display_name: string | null;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* List of participants in the chat. Always contains at least two handles (your
|
|
225
|
-
* phone number and the other participant).
|
|
226
|
-
*/
|
|
227
|
-
handles: Array<Chat.Handle>;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Whether this is a group chat
|
|
231
|
-
*/
|
|
232
|
-
is_group: boolean;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
236
|
-
*/
|
|
237
|
-
message: Chat.Message;
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Messaging service type
|
|
241
|
-
*/
|
|
242
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export namespace Chat {
|
|
246
|
-
export interface Handle {
|
|
247
|
-
/**
|
|
248
|
-
* Unique identifier for this handle
|
|
249
|
-
*/
|
|
250
|
-
id: string;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Phone number (E.164) or email address of the participant
|
|
254
|
-
*/
|
|
255
|
-
handle: string;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* When this participant joined the chat
|
|
259
|
-
*/
|
|
260
|
-
joined_at: string;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Messaging service type
|
|
264
|
-
*/
|
|
265
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
269
|
-
*/
|
|
270
|
-
is_me?: boolean | null;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* When they left (if applicable)
|
|
274
|
-
*/
|
|
275
|
-
left_at?: string | null;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Participant status
|
|
279
|
-
*/
|
|
280
|
-
status?: 'active' | 'left' | 'removed' | null;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
285
|
-
*/
|
|
286
|
-
export interface Message {
|
|
287
|
-
/**
|
|
288
|
-
* Message identifier (UUID)
|
|
289
|
-
*/
|
|
290
|
-
id: string;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Current delivery status of a message
|
|
294
|
-
*/
|
|
295
|
-
delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'failed';
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Whether the message has been read
|
|
299
|
-
*/
|
|
300
|
-
is_read: boolean;
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Message parts in order (text and media)
|
|
304
|
-
*/
|
|
305
|
-
parts: Array<Message.TextPartResponse | Message.MediaPartResponse>;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* When the message was sent
|
|
309
|
-
*/
|
|
310
|
-
sent_at: string;
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* When the message was delivered
|
|
314
|
-
*/
|
|
315
|
-
delivered_at?: string | null;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* iMessage effect applied to a message (screen or bubble effect)
|
|
319
|
-
*/
|
|
320
|
-
effect?: Message.Effect | null;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* The sender of this message as a full handle object
|
|
324
|
-
*/
|
|
325
|
-
from_handle?: Message.FromHandle | null;
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Messaging service type
|
|
329
|
-
*/
|
|
330
|
-
preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Indicates this message is a threaded reply to another message
|
|
334
|
-
*/
|
|
335
|
-
reply_to?: Message.ReplyTo | null;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Messaging service type
|
|
339
|
-
*/
|
|
340
|
-
service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export namespace Message {
|
|
344
|
-
/**
|
|
345
|
-
* A text message part
|
|
346
|
-
*/
|
|
347
|
-
export interface TextPartResponse {
|
|
348
|
-
/**
|
|
349
|
-
* Reactions on this message part
|
|
350
|
-
*/
|
|
351
|
-
reactions: Array<TextPartResponse.Reaction> | null;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Indicates this is a text message part
|
|
355
|
-
*/
|
|
356
|
-
type: 'text';
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* The text content
|
|
360
|
-
*/
|
|
361
|
-
value: string;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
export namespace TextPartResponse {
|
|
365
|
-
export interface Reaction {
|
|
366
|
-
handle: Reaction.Handle;
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Whether this reaction is from the current user
|
|
370
|
-
*/
|
|
371
|
-
is_me: boolean;
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
375
|
-
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
376
|
-
* emoji in the custom_emoji field.
|
|
377
|
-
*/
|
|
378
|
-
type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Custom emoji if type is "custom", null otherwise
|
|
382
|
-
*/
|
|
383
|
-
custom_emoji?: string | null;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export namespace Reaction {
|
|
387
|
-
export interface Handle {
|
|
388
|
-
/**
|
|
389
|
-
* Unique identifier for this handle
|
|
390
|
-
*/
|
|
391
|
-
id: string;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Phone number (E.164) or email address of the participant
|
|
395
|
-
*/
|
|
396
|
-
handle: string;
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* When this participant joined the chat
|
|
400
|
-
*/
|
|
401
|
-
joined_at: string;
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Messaging service type
|
|
405
|
-
*/
|
|
406
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
410
|
-
*/
|
|
411
|
-
is_me?: boolean | null;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* When they left (if applicable)
|
|
415
|
-
*/
|
|
416
|
-
left_at?: string | null;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Participant status
|
|
420
|
-
*/
|
|
421
|
-
status?: 'active' | 'left' | 'removed' | null;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* A media attachment part
|
|
428
|
-
*/
|
|
429
|
-
export interface MediaPartResponse {
|
|
430
|
-
/**
|
|
431
|
-
* Unique attachment identifier
|
|
432
|
-
*/
|
|
433
|
-
id: string;
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Original filename
|
|
437
|
-
*/
|
|
438
|
-
filename: string;
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* MIME type of the file
|
|
442
|
-
*/
|
|
443
|
-
mime_type: string;
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Reactions on this message part
|
|
447
|
-
*/
|
|
448
|
-
reactions: Array<MediaPartResponse.Reaction> | null;
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* File size in bytes
|
|
452
|
-
*/
|
|
453
|
-
size_bytes: number;
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Indicates this is a media attachment part
|
|
457
|
-
*/
|
|
458
|
-
type: 'media';
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Presigned URL for downloading the attachment (expires in 1 hour).
|
|
462
|
-
*/
|
|
463
|
-
url: string;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
export namespace MediaPartResponse {
|
|
467
|
-
export interface Reaction {
|
|
468
|
-
handle: Reaction.Handle;
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Whether this reaction is from the current user
|
|
472
|
-
*/
|
|
473
|
-
is_me: boolean;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
477
|
-
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
478
|
-
* emoji in the custom_emoji field.
|
|
479
|
-
*/
|
|
480
|
-
type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Custom emoji if type is "custom", null otherwise
|
|
484
|
-
*/
|
|
485
|
-
custom_emoji?: string | null;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export namespace Reaction {
|
|
489
|
-
export interface Handle {
|
|
490
|
-
/**
|
|
491
|
-
* Unique identifier for this handle
|
|
492
|
-
*/
|
|
493
|
-
id: string;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Phone number (E.164) or email address of the participant
|
|
497
|
-
*/
|
|
498
|
-
handle: string;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* When this participant joined the chat
|
|
502
|
-
*/
|
|
503
|
-
joined_at: string;
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Messaging service type
|
|
507
|
-
*/
|
|
508
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
512
|
-
*/
|
|
513
|
-
is_me?: boolean | null;
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* When they left (if applicable)
|
|
517
|
-
*/
|
|
518
|
-
left_at?: string | null;
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Participant status
|
|
522
|
-
*/
|
|
523
|
-
status?: 'active' | 'left' | 'removed' | null;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* iMessage effect applied to a message (screen or bubble effect)
|
|
530
|
-
*/
|
|
531
|
-
export interface Effect {
|
|
532
|
-
/**
|
|
533
|
-
* Name of the effect. Common values:
|
|
534
|
-
*
|
|
535
|
-
* - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
|
|
536
|
-
* love, balloons, happy_birthday, echo, spotlight
|
|
537
|
-
* - Bubble effects: slam, loud, gentle, invisible
|
|
538
|
-
*/
|
|
539
|
-
name?: string;
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Type of effect
|
|
543
|
-
*/
|
|
544
|
-
type?: 'screen' | 'bubble';
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* The sender of this message as a full handle object
|
|
549
|
-
*/
|
|
550
|
-
export interface FromHandle {
|
|
551
|
-
/**
|
|
552
|
-
* Unique identifier for this handle
|
|
553
|
-
*/
|
|
554
|
-
id: string;
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Phone number (E.164) or email address of the participant
|
|
558
|
-
*/
|
|
559
|
-
handle: string;
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* When this participant joined the chat
|
|
563
|
-
*/
|
|
564
|
-
joined_at: string;
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Messaging service type
|
|
568
|
-
*/
|
|
569
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
573
|
-
*/
|
|
574
|
-
is_me?: boolean | null;
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* When they left (if applicable)
|
|
578
|
-
*/
|
|
579
|
-
left_at?: string | null;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Participant status
|
|
583
|
-
*/
|
|
584
|
-
status?: 'active' | 'left' | 'removed' | null;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Indicates this message is a threaded reply to another message
|
|
589
|
-
*/
|
|
590
|
-
export interface ReplyTo {
|
|
591
|
-
/**
|
|
592
|
-
* The ID of the message to reply to
|
|
593
|
-
*/
|
|
594
|
-
message_id: string;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* The specific message part to reply to (0-based index). Defaults to 0 (first
|
|
598
|
-
* part) if not provided. Use this when replying to a specific part of a multipart
|
|
599
|
-
* message.
|
|
600
|
-
*/
|
|
601
|
-
part_index?: number;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
export interface ChatRetrieveResponse {
|
|
206
|
+
export interface Chat {
|
|
608
207
|
/**
|
|
609
208
|
* Unique identifier for the chat
|
|
610
209
|
*/
|
|
@@ -625,7 +224,7 @@ export interface ChatRetrieveResponse {
|
|
|
625
224
|
* List of chat participants with full handle details. Always contains at least two
|
|
626
225
|
* handles (your phone number and the other participant).
|
|
627
226
|
*/
|
|
628
|
-
handles: Array<
|
|
227
|
+
handles: Array<MessagesAPI.ChatHandle>;
|
|
629
228
|
|
|
630
229
|
/**
|
|
631
230
|
* Whether the chat is archived
|
|
@@ -645,156 +244,156 @@ export interface ChatRetrieveResponse {
|
|
|
645
244
|
/**
|
|
646
245
|
* Messaging service type
|
|
647
246
|
*/
|
|
648
|
-
service?:
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
export namespace ChatRetrieveResponse {
|
|
652
|
-
export interface Handle {
|
|
653
|
-
/**
|
|
654
|
-
* Unique identifier for this handle
|
|
655
|
-
*/
|
|
656
|
-
id: string;
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* Phone number (E.164) or email address of the participant
|
|
660
|
-
*/
|
|
661
|
-
handle: string;
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* When this participant joined the chat
|
|
665
|
-
*/
|
|
666
|
-
joined_at: string;
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Messaging service type
|
|
670
|
-
*/
|
|
671
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
675
|
-
*/
|
|
676
|
-
is_me?: boolean | null;
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* When they left (if applicable)
|
|
680
|
-
*/
|
|
681
|
-
left_at?: string | null;
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Participant status
|
|
685
|
-
*/
|
|
686
|
-
status?: 'active' | 'left' | 'removed' | null;
|
|
687
|
-
}
|
|
247
|
+
service?: ServiceType | null;
|
|
688
248
|
}
|
|
689
249
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* When the chat was created
|
|
698
|
-
*/
|
|
699
|
-
created_at: string;
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
703
|
-
* handles. Can be updated for group chats.
|
|
704
|
-
*/
|
|
705
|
-
display_name: string | null;
|
|
706
|
-
|
|
250
|
+
/**
|
|
251
|
+
* Message content container. Groups all message-related fields together,
|
|
252
|
+
* separating the "what" (message content) from the "where" (routing fields like
|
|
253
|
+
* from/to).
|
|
254
|
+
*/
|
|
255
|
+
export interface MessageContent {
|
|
707
256
|
/**
|
|
708
|
-
*
|
|
709
|
-
*
|
|
257
|
+
* Array of message parts. Each part can be either text or media. Parts are
|
|
258
|
+
* displayed in order. Text and media can be mixed.
|
|
259
|
+
*
|
|
260
|
+
* **Supported Media:**
|
|
261
|
+
*
|
|
262
|
+
* - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
|
|
263
|
+
* - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
|
|
264
|
+
* - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
|
|
265
|
+
* - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
|
|
266
|
+
* .pages, .numbers, .key, .epub, .zip, .html, .htm
|
|
267
|
+
* - Contact & Calendar: .vcf, .ics
|
|
268
|
+
*
|
|
269
|
+
* **Audio:**
|
|
270
|
+
*
|
|
271
|
+
* - Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as
|
|
272
|
+
* media parts
|
|
273
|
+
* - To send audio as an **iMessage voice memo bubble** (inline playback UI), use
|
|
274
|
+
* the dedicated `/v3/chats/{chatId}/voicememo` endpoint instead
|
|
275
|
+
*
|
|
276
|
+
* **Validation Rule:** Consecutive text parts are not allowed. Text parts must be
|
|
277
|
+
* separated by media parts. For example, [text, text] is invalid, but [text,
|
|
278
|
+
* media, text] is valid.
|
|
710
279
|
*/
|
|
711
|
-
|
|
280
|
+
parts: Array<MessageContent.TextPart | MessageContent.MediaPart>;
|
|
712
281
|
|
|
713
282
|
/**
|
|
714
|
-
*
|
|
283
|
+
* iMessage effect to apply to this message (screen or bubble effect)
|
|
715
284
|
*/
|
|
716
|
-
|
|
285
|
+
effect?: MessagesAPI.MessageEffect;
|
|
717
286
|
|
|
718
287
|
/**
|
|
719
|
-
*
|
|
288
|
+
* Optional idempotency key for this message. Use this to prevent duplicate sends
|
|
289
|
+
* of the same message.
|
|
720
290
|
*/
|
|
721
|
-
|
|
291
|
+
idempotency_key?: string;
|
|
722
292
|
|
|
723
293
|
/**
|
|
724
|
-
*
|
|
294
|
+
* Messaging service type
|
|
725
295
|
*/
|
|
726
|
-
|
|
296
|
+
preferred_service?: ServiceType;
|
|
727
297
|
|
|
728
298
|
/**
|
|
729
|
-
*
|
|
299
|
+
* Reply to another message to create a threaded conversation
|
|
730
300
|
*/
|
|
731
|
-
|
|
301
|
+
reply_to?: MessagesAPI.ReplyTo;
|
|
732
302
|
}
|
|
733
303
|
|
|
734
|
-
export namespace
|
|
735
|
-
export interface
|
|
304
|
+
export namespace MessageContent {
|
|
305
|
+
export interface TextPart {
|
|
736
306
|
/**
|
|
737
|
-
*
|
|
307
|
+
* Indicates this is a text message part
|
|
738
308
|
*/
|
|
739
|
-
|
|
309
|
+
type: 'text';
|
|
740
310
|
|
|
741
311
|
/**
|
|
742
|
-
*
|
|
312
|
+
* The text content
|
|
743
313
|
*/
|
|
744
|
-
|
|
314
|
+
value: string;
|
|
745
315
|
|
|
746
316
|
/**
|
|
747
|
-
*
|
|
317
|
+
* Optional idempotency key for this specific message part. Use this to prevent
|
|
318
|
+
* duplicate sends of the same part.
|
|
748
319
|
*/
|
|
749
|
-
|
|
320
|
+
idempotency_key?: string;
|
|
321
|
+
}
|
|
750
322
|
|
|
323
|
+
export interface MediaPart {
|
|
751
324
|
/**
|
|
752
|
-
*
|
|
325
|
+
* Indicates this is a media attachment part
|
|
753
326
|
*/
|
|
754
|
-
|
|
327
|
+
type: 'media';
|
|
755
328
|
|
|
756
329
|
/**
|
|
757
|
-
*
|
|
330
|
+
* Reference to a file pre-uploaded via `POST /v3/attachments` (optional). The file
|
|
331
|
+
* is already stored, so sends using this ID skip the download step — useful when
|
|
332
|
+
* sending the same file to many recipients.
|
|
333
|
+
*
|
|
334
|
+
* Either `url` or `attachment_id` must be provided, but not both.
|
|
758
335
|
*/
|
|
759
|
-
|
|
336
|
+
attachment_id?: string;
|
|
760
337
|
|
|
761
338
|
/**
|
|
762
|
-
*
|
|
339
|
+
* Optional idempotency key for this specific message part. Use this to prevent
|
|
340
|
+
* duplicate sends of the same part.
|
|
763
341
|
*/
|
|
764
|
-
|
|
342
|
+
idempotency_key?: string;
|
|
765
343
|
|
|
766
344
|
/**
|
|
767
|
-
*
|
|
345
|
+
* Any publicly accessible HTTPS URL to the media file. The server downloads and
|
|
346
|
+
* sends the file automatically — no pre-upload step required.
|
|
347
|
+
*
|
|
348
|
+
* **Size limit:** 10MB maximum for URL-based downloads. For larger files (up to
|
|
349
|
+
* 100MB), use the pre-upload flow: `POST /v3/attachments` to get a presigned URL,
|
|
350
|
+
* upload directly, then reference by `attachment_id`.
|
|
351
|
+
*
|
|
352
|
+
* **Requirements:**
|
|
353
|
+
*
|
|
354
|
+
* - URL must use HTTPS
|
|
355
|
+
* - File content must be a supported format (the server validates the actual file
|
|
356
|
+
* content)
|
|
357
|
+
*
|
|
358
|
+
* **Supported formats:**
|
|
359
|
+
*
|
|
360
|
+
* - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
|
|
361
|
+
* - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
|
|
362
|
+
* - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
|
|
363
|
+
* - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
|
|
364
|
+
* .pages, .numbers, .key, .epub, .zip, .html, .htm
|
|
365
|
+
* - Contact & Calendar: .vcf, .ics
|
|
366
|
+
*
|
|
367
|
+
* **Tip:** Audio sent here appears as a regular file attachment. To send audio as
|
|
368
|
+
* an iMessage voice memo bubble (with inline playback), use
|
|
369
|
+
* `/v3/chats/{chatId}/voicememo`. For repeated sends of the same file, use
|
|
370
|
+
* `attachment_id` to avoid redundant downloads.
|
|
371
|
+
*
|
|
372
|
+
* Either `url` or `attachment_id` must be provided, but not both.
|
|
768
373
|
*/
|
|
769
|
-
|
|
374
|
+
url?: string;
|
|
770
375
|
}
|
|
771
376
|
}
|
|
772
377
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
chats: Array<ChatListResponse.Chat>;
|
|
378
|
+
/**
|
|
379
|
+
* Messaging service type
|
|
380
|
+
*/
|
|
381
|
+
export type ServiceType = 'iMessage' | 'SMS' | 'RCS';
|
|
778
382
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
383
|
+
/**
|
|
384
|
+
* Response for creating a new chat with an initial message
|
|
385
|
+
*/
|
|
386
|
+
export interface ChatCreateResponse {
|
|
387
|
+
chat: ChatCreateResponse.Chat;
|
|
784
388
|
}
|
|
785
389
|
|
|
786
|
-
export namespace
|
|
390
|
+
export namespace ChatCreateResponse {
|
|
787
391
|
export interface Chat {
|
|
788
392
|
/**
|
|
789
|
-
* Unique identifier for the chat
|
|
393
|
+
* Unique identifier for the created chat (UUID)
|
|
790
394
|
*/
|
|
791
395
|
id: string;
|
|
792
396
|
|
|
793
|
-
/**
|
|
794
|
-
* When the chat was created
|
|
795
|
-
*/
|
|
796
|
-
created_at: string;
|
|
797
|
-
|
|
798
397
|
/**
|
|
799
398
|
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
800
399
|
* handles. Can be updated for group chats.
|
|
@@ -802,15 +401,10 @@ export namespace ChatListResponse {
|
|
|
802
401
|
display_name: string | null;
|
|
803
402
|
|
|
804
403
|
/**
|
|
805
|
-
* List of
|
|
806
|
-
*
|
|
807
|
-
*/
|
|
808
|
-
handles: Array<Chat.Handle>;
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Whether the chat is archived
|
|
404
|
+
* List of participants in the chat. Always contains at least two handles (your
|
|
405
|
+
* phone number and the other participant).
|
|
812
406
|
*/
|
|
813
|
-
|
|
407
|
+
handles: Array<MessagesAPI.ChatHandle>;
|
|
814
408
|
|
|
815
409
|
/**
|
|
816
410
|
* Whether this is a group chat
|
|
@@ -818,54 +412,28 @@ export namespace ChatListResponse {
|
|
|
818
412
|
is_group: boolean;
|
|
819
413
|
|
|
820
414
|
/**
|
|
821
|
-
*
|
|
415
|
+
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
822
416
|
*/
|
|
823
|
-
|
|
417
|
+
message: ChatsMessagesAPI.SentMessage;
|
|
824
418
|
|
|
825
419
|
/**
|
|
826
420
|
* Messaging service type
|
|
827
421
|
*/
|
|
828
|
-
service
|
|
422
|
+
service: ChatsAPI.ServiceType;
|
|
829
423
|
}
|
|
424
|
+
}
|
|
830
425
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
id: string;
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Phone number (E.164) or email address of the participant
|
|
840
|
-
*/
|
|
841
|
-
handle: string;
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* When this participant joined the chat
|
|
845
|
-
*/
|
|
846
|
-
joined_at: string;
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* Messaging service type
|
|
850
|
-
*/
|
|
851
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
855
|
-
*/
|
|
856
|
-
is_me?: boolean | null;
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* When they left (if applicable)
|
|
860
|
-
*/
|
|
861
|
-
left_at?: string | null;
|
|
426
|
+
export interface ChatListResponse {
|
|
427
|
+
/**
|
|
428
|
+
* List of chats
|
|
429
|
+
*/
|
|
430
|
+
chats: Array<Chat>;
|
|
862
431
|
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}
|
|
432
|
+
/**
|
|
433
|
+
* Cursor for fetching the next page of results. Null if there are no more results
|
|
434
|
+
* to fetch. Pass this value as the `cursor` parameter in the next request.
|
|
435
|
+
*/
|
|
436
|
+
next_cursor?: string | null;
|
|
869
437
|
}
|
|
870
438
|
|
|
871
439
|
/**
|
|
@@ -909,7 +477,7 @@ export namespace ChatSendVoicememoResponse {
|
|
|
909
477
|
/**
|
|
910
478
|
* Messaging service type
|
|
911
479
|
*/
|
|
912
|
-
service?:
|
|
480
|
+
service?: ChatsAPI.ServiceType | null;
|
|
913
481
|
}
|
|
914
482
|
|
|
915
483
|
export namespace VoiceMemo {
|
|
@@ -922,7 +490,7 @@ export namespace ChatSendVoicememoResponse {
|
|
|
922
490
|
/**
|
|
923
491
|
* Chat participants
|
|
924
492
|
*/
|
|
925
|
-
handles: Array<
|
|
493
|
+
handles: Array<MessagesAPI.ChatHandle>;
|
|
926
494
|
|
|
927
495
|
/**
|
|
928
496
|
* Whether the chat is active
|
|
@@ -937,46 +505,7 @@ export namespace ChatSendVoicememoResponse {
|
|
|
937
505
|
/**
|
|
938
506
|
* Messaging service type
|
|
939
507
|
*/
|
|
940
|
-
service:
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
export namespace Chat {
|
|
944
|
-
export interface Handle {
|
|
945
|
-
/**
|
|
946
|
-
* Unique identifier for this handle
|
|
947
|
-
*/
|
|
948
|
-
id: string;
|
|
949
|
-
|
|
950
|
-
/**
|
|
951
|
-
* Phone number (E.164) or email address of the participant
|
|
952
|
-
*/
|
|
953
|
-
handle: string;
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* When this participant joined the chat
|
|
957
|
-
*/
|
|
958
|
-
joined_at: string;
|
|
959
|
-
|
|
960
|
-
/**
|
|
961
|
-
* Messaging service type
|
|
962
|
-
*/
|
|
963
|
-
service: 'iMessage' | 'SMS' | 'RCS';
|
|
964
|
-
|
|
965
|
-
/**
|
|
966
|
-
* Whether this handle belongs to the sender (your phone number)
|
|
967
|
-
*/
|
|
968
|
-
is_me?: boolean | null;
|
|
969
|
-
|
|
970
|
-
/**
|
|
971
|
-
* When they left (if applicable)
|
|
972
|
-
*/
|
|
973
|
-
left_at?: string | null;
|
|
974
|
-
|
|
975
|
-
/**
|
|
976
|
-
* Participant status
|
|
977
|
-
*/
|
|
978
|
-
status?: 'active' | 'left' | 'removed' | null;
|
|
979
|
-
}
|
|
508
|
+
service: ChatsAPI.ServiceType;
|
|
980
509
|
}
|
|
981
510
|
|
|
982
511
|
export interface VoiceMemo {
|
|
@@ -1025,7 +554,7 @@ export interface ChatCreateParams {
|
|
|
1025
554
|
* separating the "what" (message content) from the "where" (routing fields like
|
|
1026
555
|
* from/to).
|
|
1027
556
|
*/
|
|
1028
|
-
message:
|
|
557
|
+
message: MessageContent;
|
|
1029
558
|
|
|
1030
559
|
/**
|
|
1031
560
|
* Array of recipient handles (phone numbers in E.164 format or email addresses).
|
|
@@ -1034,172 +563,6 @@ export interface ChatCreateParams {
|
|
|
1034
563
|
to: Array<string>;
|
|
1035
564
|
}
|
|
1036
565
|
|
|
1037
|
-
export namespace ChatCreateParams {
|
|
1038
|
-
/**
|
|
1039
|
-
* Message content container. Groups all message-related fields together,
|
|
1040
|
-
* separating the "what" (message content) from the "where" (routing fields like
|
|
1041
|
-
* from/to).
|
|
1042
|
-
*/
|
|
1043
|
-
export interface Message {
|
|
1044
|
-
/**
|
|
1045
|
-
* Array of message parts. Each part can be either text or media. Parts are
|
|
1046
|
-
* displayed in order. Text and media can be mixed.
|
|
1047
|
-
*
|
|
1048
|
-
* **Supported Media:**
|
|
1049
|
-
*
|
|
1050
|
-
* - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
|
|
1051
|
-
* - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
|
|
1052
|
-
* - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
|
|
1053
|
-
* - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
|
|
1054
|
-
* .pages, .numbers, .key, .epub, .zip, .html, .htm
|
|
1055
|
-
* - Contact & Calendar: .vcf, .ics
|
|
1056
|
-
*
|
|
1057
|
-
* **Audio:**
|
|
1058
|
-
*
|
|
1059
|
-
* - Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as
|
|
1060
|
-
* media parts
|
|
1061
|
-
* - To send audio as an **iMessage voice memo bubble** (inline playback UI), use
|
|
1062
|
-
* the dedicated `/v3/chats/{chatId}/voicememo` endpoint instead
|
|
1063
|
-
*
|
|
1064
|
-
* **Validation Rule:** Consecutive text parts are not allowed. Text parts must be
|
|
1065
|
-
* separated by media parts. For example, [text, text] is invalid, but [text,
|
|
1066
|
-
* media, text] is valid.
|
|
1067
|
-
*/
|
|
1068
|
-
parts: Array<Message.TextPart | Message.MediaPart>;
|
|
1069
|
-
|
|
1070
|
-
/**
|
|
1071
|
-
* iMessage effect to apply to this message (screen or bubble effect)
|
|
1072
|
-
*/
|
|
1073
|
-
effect?: Message.Effect;
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* Optional idempotency key for this message. Use this to prevent duplicate sends
|
|
1077
|
-
* of the same message.
|
|
1078
|
-
*/
|
|
1079
|
-
idempotency_key?: string;
|
|
1080
|
-
|
|
1081
|
-
/**
|
|
1082
|
-
* Messaging service type
|
|
1083
|
-
*/
|
|
1084
|
-
preferred_service?: 'iMessage' | 'SMS' | 'RCS';
|
|
1085
|
-
|
|
1086
|
-
/**
|
|
1087
|
-
* Reply to another message to create a threaded conversation
|
|
1088
|
-
*/
|
|
1089
|
-
reply_to?: Message.ReplyTo;
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
export namespace Message {
|
|
1093
|
-
export interface TextPart {
|
|
1094
|
-
/**
|
|
1095
|
-
* Indicates this is a text message part
|
|
1096
|
-
*/
|
|
1097
|
-
type: 'text';
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* The text content
|
|
1101
|
-
*/
|
|
1102
|
-
value: string;
|
|
1103
|
-
|
|
1104
|
-
/**
|
|
1105
|
-
* Optional idempotency key for this specific message part. Use this to prevent
|
|
1106
|
-
* duplicate sends of the same part.
|
|
1107
|
-
*/
|
|
1108
|
-
idempotency_key?: string;
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
export interface MediaPart {
|
|
1112
|
-
/**
|
|
1113
|
-
* Indicates this is a media attachment part
|
|
1114
|
-
*/
|
|
1115
|
-
type: 'media';
|
|
1116
|
-
|
|
1117
|
-
/**
|
|
1118
|
-
* Reference to a file pre-uploaded via `POST /v3/attachments` (optional). The file
|
|
1119
|
-
* is already stored, so sends using this ID skip the download step — useful when
|
|
1120
|
-
* sending the same file to many recipients.
|
|
1121
|
-
*
|
|
1122
|
-
* Either `url` or `attachment_id` must be provided, but not both.
|
|
1123
|
-
*/
|
|
1124
|
-
attachment_id?: string;
|
|
1125
|
-
|
|
1126
|
-
/**
|
|
1127
|
-
* Optional idempotency key for this specific message part. Use this to prevent
|
|
1128
|
-
* duplicate sends of the same part.
|
|
1129
|
-
*/
|
|
1130
|
-
idempotency_key?: string;
|
|
1131
|
-
|
|
1132
|
-
/**
|
|
1133
|
-
* Any publicly accessible HTTPS URL to the media file. The server downloads and
|
|
1134
|
-
* sends the file automatically — no pre-upload step required.
|
|
1135
|
-
*
|
|
1136
|
-
* **Size limit:** 10MB maximum for URL-based downloads. For larger files (up to
|
|
1137
|
-
* 100MB), use the pre-upload flow: `POST /v3/attachments` to get a presigned URL,
|
|
1138
|
-
* upload directly, then reference by `attachment_id`.
|
|
1139
|
-
*
|
|
1140
|
-
* **Requirements:**
|
|
1141
|
-
*
|
|
1142
|
-
* - URL must use HTTPS
|
|
1143
|
-
* - File content must be a supported format (the server validates the actual file
|
|
1144
|
-
* content)
|
|
1145
|
-
*
|
|
1146
|
-
* **Supported formats:**
|
|
1147
|
-
*
|
|
1148
|
-
* - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
|
|
1149
|
-
* - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
|
|
1150
|
-
* - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
|
|
1151
|
-
* - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
|
|
1152
|
-
* .pages, .numbers, .key, .epub, .zip, .html, .htm
|
|
1153
|
-
* - Contact & Calendar: .vcf, .ics
|
|
1154
|
-
*
|
|
1155
|
-
* **Tip:** Audio sent here appears as a regular file attachment. To send audio as
|
|
1156
|
-
* an iMessage voice memo bubble (with inline playback), use
|
|
1157
|
-
* `/v3/chats/{chatId}/voicememo`. For repeated sends of the same file, use
|
|
1158
|
-
* `attachment_id` to avoid redundant downloads.
|
|
1159
|
-
*
|
|
1160
|
-
* Either `url` or `attachment_id` must be provided, but not both.
|
|
1161
|
-
*/
|
|
1162
|
-
url?: string;
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
* iMessage effect to apply to this message (screen or bubble effect)
|
|
1167
|
-
*/
|
|
1168
|
-
export interface Effect {
|
|
1169
|
-
/**
|
|
1170
|
-
* Name of the effect. Common values:
|
|
1171
|
-
*
|
|
1172
|
-
* - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
|
|
1173
|
-
* love, balloons, happy_birthday, echo, spotlight
|
|
1174
|
-
* - Bubble effects: slam, loud, gentle, invisible
|
|
1175
|
-
*/
|
|
1176
|
-
name?: string;
|
|
1177
|
-
|
|
1178
|
-
/**
|
|
1179
|
-
* Type of effect
|
|
1180
|
-
*/
|
|
1181
|
-
type?: 'screen' | 'bubble';
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* Reply to another message to create a threaded conversation
|
|
1186
|
-
*/
|
|
1187
|
-
export interface ReplyTo {
|
|
1188
|
-
/**
|
|
1189
|
-
* The ID of the message to reply to
|
|
1190
|
-
*/
|
|
1191
|
-
message_id: string;
|
|
1192
|
-
|
|
1193
|
-
/**
|
|
1194
|
-
* The specific message part to reply to (0-based index). Defaults to 0 (first
|
|
1195
|
-
* part) if not provided. Use this when replying to a specific part of a multipart
|
|
1196
|
-
* message.
|
|
1197
|
-
*/
|
|
1198
|
-
part_index?: number;
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
566
|
export interface ChatUpdateParams {
|
|
1204
567
|
/**
|
|
1205
568
|
* New display name for the chat (group chats only)
|
|
@@ -1250,9 +613,10 @@ Chats.Messages = Messages;
|
|
|
1250
613
|
|
|
1251
614
|
export declare namespace Chats {
|
|
1252
615
|
export {
|
|
616
|
+
type Chat as Chat,
|
|
617
|
+
type MessageContent as MessageContent,
|
|
618
|
+
type ServiceType as ServiceType,
|
|
1253
619
|
type ChatCreateResponse as ChatCreateResponse,
|
|
1254
|
-
type ChatRetrieveResponse as ChatRetrieveResponse,
|
|
1255
|
-
type ChatUpdateResponse as ChatUpdateResponse,
|
|
1256
620
|
type ChatListResponse as ChatListResponse,
|
|
1257
621
|
type ChatSendVoicememoResponse as ChatSendVoicememoResponse,
|
|
1258
622
|
type ChatCreateParams as ChatCreateParams,
|
|
@@ -1273,6 +637,7 @@ export declare namespace Chats {
|
|
|
1273
637
|
|
|
1274
638
|
export {
|
|
1275
639
|
Messages as Messages,
|
|
640
|
+
type SentMessage as SentMessage,
|
|
1276
641
|
type MessageListResponse as MessageListResponse,
|
|
1277
642
|
type MessageSendResponse as MessageSendResponse,
|
|
1278
643
|
type MessageListParams as MessageListParams,
|