@linqapp/sdk 0.1.0-alpha.1
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 +26 -0
- package/LICENSE +7 -0
- package/README.md +393 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +193 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +193 -0
- package/client.d.ts.map +1 -0
- package/client.js +479 -0
- package/client.js.map +1 -0
- package/client.mjs +475 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +137 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/attachments.d.mts +215 -0
- package/resources/attachments.d.mts.map +1 -0
- package/resources/attachments.d.ts +215 -0
- package/resources/attachments.d.ts.map +1 -0
- package/resources/attachments.js +102 -0
- package/resources/attachments.js.map +1 -0
- package/resources/attachments.mjs +98 -0
- package/resources/attachments.mjs.map +1 -0
- package/resources/chats/chats.d.mts +1040 -0
- package/resources/chats/chats.d.mts.map +1 -0
- package/resources/chats/chats.d.ts +1040 -0
- package/resources/chats/chats.d.ts.map +1 -0
- package/resources/chats/chats.js +182 -0
- package/resources/chats/chats.js.map +1 -0
- package/resources/chats/chats.mjs +177 -0
- package/resources/chats/chats.mjs.map +1 -0
- package/resources/chats/index.d.mts +5 -0
- package/resources/chats/index.d.mts.map +1 -0
- package/resources/chats/index.d.ts +5 -0
- package/resources/chats/index.d.ts.map +1 -0
- package/resources/chats/index.js +13 -0
- package/resources/chats/index.js.map +1 -0
- package/resources/chats/index.mjs +6 -0
- package/resources/chats/index.mjs.map +1 -0
- package/resources/chats/messages.d.mts +813 -0
- package/resources/chats/messages.d.mts.map +1 -0
- package/resources/chats/messages.d.ts +813 -0
- package/resources/chats/messages.d.ts.map +1 -0
- package/resources/chats/messages.js +56 -0
- package/resources/chats/messages.js.map +1 -0
- package/resources/chats/messages.mjs +52 -0
- package/resources/chats/messages.mjs.map +1 -0
- package/resources/chats/participants.d.mts +68 -0
- package/resources/chats/participants.d.mts.map +1 -0
- package/resources/chats/participants.d.ts +68 -0
- package/resources/chats/participants.d.ts.map +1 -0
- package/resources/chats/participants.js +51 -0
- package/resources/chats/participants.js.map +1 -0
- package/resources/chats/participants.mjs +47 -0
- package/resources/chats/participants.mjs.map +1 -0
- package/resources/chats/typing.d.mts +35 -0
- package/resources/chats/typing.d.mts.map +1 -0
- package/resources/chats/typing.d.ts +35 -0
- package/resources/chats/typing.d.ts.map +1 -0
- package/resources/chats/typing.js +50 -0
- package/resources/chats/typing.js.map +1 -0
- package/resources/chats/typing.mjs +46 -0
- package/resources/chats/typing.mjs.map +1 -0
- package/resources/chats.d.mts +2 -0
- package/resources/chats.d.mts.map +1 -0
- package/resources/chats.d.ts +2 -0
- package/resources/chats.d.ts.map +1 -0
- package/resources/chats.js +6 -0
- package/resources/chats.js.map +1 -0
- package/resources/chats.mjs +3 -0
- package/resources/chats.mjs.map +1 -0
- package/resources/index.d.mts +6 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +6 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +15 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -0
- package/resources/messages.d.mts +761 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +761 -0
- package/resources/messages.d.ts.map +1 -0
- package/resources/messages.js +90 -0
- package/resources/messages.js.map +1 -0
- package/resources/messages.mjs +86 -0
- package/resources/messages.mjs.map +1 -0
- package/resources/phone-numbers.d.mts +58 -0
- package/resources/phone-numbers.d.mts.map +1 -0
- package/resources/phone-numbers.d.ts +58 -0
- package/resources/phone-numbers.d.ts.map +1 -0
- package/resources/phone-numbers.js +17 -0
- package/resources/phone-numbers.js.map +1 -0
- package/resources/phone-numbers.mjs +13 -0
- package/resources/phone-numbers.mjs.map +1 -0
- package/resources/webhooks/events.d.mts +30 -0
- package/resources/webhooks/events.d.mts.map +1 -0
- package/resources/webhooks/events.d.ts +30 -0
- package/resources/webhooks/events.d.ts.map +1 -0
- package/resources/webhooks/events.js +22 -0
- package/resources/webhooks/events.js.map +1 -0
- package/resources/webhooks/events.mjs +18 -0
- package/resources/webhooks/events.mjs.map +1 -0
- package/resources/webhooks/index.d.mts +4 -0
- package/resources/webhooks/index.d.mts.map +1 -0
- package/resources/webhooks/index.d.ts +4 -0
- package/resources/webhooks/index.d.ts.map +1 -0
- package/resources/webhooks/index.js +11 -0
- package/resources/webhooks/index.js.map +1 -0
- package/resources/webhooks/index.mjs +5 -0
- package/resources/webhooks/index.mjs.map +1 -0
- package/resources/webhooks/subscriptions.d.mts +237 -0
- package/resources/webhooks/subscriptions.d.mts.map +1 -0
- package/resources/webhooks/subscriptions.d.ts +237 -0
- package/resources/webhooks/subscriptions.d.ts.map +1 -0
- package/resources/webhooks/subscriptions.js +107 -0
- package/resources/webhooks/subscriptions.js.map +1 -0
- package/resources/webhooks/subscriptions.mjs +103 -0
- package/resources/webhooks/subscriptions.mjs.map +1 -0
- package/resources/webhooks/webhooks.d.mts +14 -0
- package/resources/webhooks/webhooks.d.mts.map +1 -0
- package/resources/webhooks/webhooks.d.ts +14 -0
- package/resources/webhooks/webhooks.d.ts.map +1 -0
- package/resources/webhooks/webhooks.js +21 -0
- package/resources/webhooks/webhooks.js.map +1 -0
- package/resources/webhooks/webhooks.mjs +16 -0
- package/resources/webhooks/webhooks.mjs.map +1 -0
- package/resources/webhooks.d.mts +2 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +2 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +6 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +3 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +801 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/attachments.ts +344 -0
- package/src/resources/chats/chats.ts +1285 -0
- package/src/resources/chats/index.ts +29 -0
- package/src/resources/chats/messages.ts +968 -0
- package/src/resources/chats/participants.ts +98 -0
- package/src/resources/chats/typing.ts +50 -0
- package/src/resources/chats.ts +3 -0
- package/src/resources/index.ts +31 -0
- package/src/resources/messages.ts +937 -0
- package/src/resources/phone-numbers.ts +72 -0
- package/src/resources/webhooks/events.ts +55 -0
- package/src/resources/webhooks/index.ts +13 -0
- package/src/resources/webhooks/subscriptions.ts +409 -0
- package/src/resources/webhooks/webhooks.ts +37 -0
- package/src/resources/webhooks.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,1040 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as MessagesAPI from "./messages.js";
|
|
3
|
+
import { MessageListParams, MessageListResponse, MessageSendParams, MessageSendResponse, Messages } from "./messages.js";
|
|
4
|
+
import * as ParticipantsAPI from "./participants.js";
|
|
5
|
+
import { ParticipantAddParams, ParticipantAddResponse, ParticipantRemoveParams, ParticipantRemoveResponse, Participants } from "./participants.js";
|
|
6
|
+
import * as TypingAPI from "./typing.js";
|
|
7
|
+
import { Typing } from "./typing.js";
|
|
8
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
9
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
10
|
+
export declare class Chats extends APIResource {
|
|
11
|
+
participants: ParticipantsAPI.Participants;
|
|
12
|
+
typing: TypingAPI.Typing;
|
|
13
|
+
messages: MessagesAPI.Messages;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new chat with specified participants and send an initial message. The
|
|
16
|
+
* initial message is required when creating a chat.
|
|
17
|
+
*
|
|
18
|
+
* ## Message Effects
|
|
19
|
+
*
|
|
20
|
+
* You can add iMessage effects to make your messages more expressive. Effects are
|
|
21
|
+
* optional and can be either screen effects (full-screen animations) or bubble
|
|
22
|
+
* effects (message bubble animations).
|
|
23
|
+
*
|
|
24
|
+
* **Screen Effects:** `confetti`, `fireworks`, `lasers`, `sparkles`,
|
|
25
|
+
* `celebration`, `hearts`, `love`, `balloons`, `happy_birthday`, `echo`,
|
|
26
|
+
* `spotlight`
|
|
27
|
+
*
|
|
28
|
+
* **Bubble Effects:** `slam`, `loud`, `gentle`, `invisible`
|
|
29
|
+
*
|
|
30
|
+
* Only one effect type can be applied per message.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const chat = await client.chats.create({
|
|
35
|
+
* from: '+12052535597',
|
|
36
|
+
* message: {
|
|
37
|
+
* parts: [
|
|
38
|
+
* {
|
|
39
|
+
* type: 'text',
|
|
40
|
+
* value: 'Hello! How can I help you today?',
|
|
41
|
+
* },
|
|
42
|
+
* ],
|
|
43
|
+
* },
|
|
44
|
+
* to: ['+12052532136'],
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
create(body: ChatCreateParams, options?: RequestOptions): APIPromise<ChatCreateResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieve a chat by its unique identifier.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const chat = await client.chats.retrieve(
|
|
55
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
retrieve(chatID: string, options?: RequestOptions): APIPromise<ChatRetrieveResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Update chat properties such as display name and group chat icon.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const chat = await client.chats.update(
|
|
66
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
67
|
+
* { display_name: 'Team Discussion' },
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
update(chatID: string, body: ChatUpdateParams, options?: RequestOptions): APIPromise<ChatUpdateResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Retrieves a paginated list of chats for the authenticated partner filtered by
|
|
74
|
+
* phone number. Returns all chats involving the specified phone number with their
|
|
75
|
+
* participants and recent activity.
|
|
76
|
+
*
|
|
77
|
+
* **Pagination:**
|
|
78
|
+
*
|
|
79
|
+
* - Use `limit` to control page size (default: 20, max: 100)
|
|
80
|
+
* - The response includes `next_cursor` for fetching the next page
|
|
81
|
+
* - When `next_cursor` is `null`, there are no more results to fetch
|
|
82
|
+
* - Pass the `next_cursor` value as the `cursor` parameter for the next request
|
|
83
|
+
*
|
|
84
|
+
* **Example pagination flow:**
|
|
85
|
+
*
|
|
86
|
+
* 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
|
|
87
|
+
* 2. Response includes `next_cursor: "20"` (more results exist)
|
|
88
|
+
* 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
|
|
89
|
+
* 4. Response includes `next_cursor: null` (no more results)
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const chats = await client.chats.list({
|
|
94
|
+
* from: '+13343284472',
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
list(query: ChatListParams, options?: RequestOptions): APIPromise<ChatListResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Mark all messages in a chat as read.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* await client.chats.markAsRead(
|
|
105
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
106
|
+
* );
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
markAsRead(chatID: string, options?: RequestOptions): APIPromise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Send an audio file as an **iMessage voice memo bubble** to all participants in a
|
|
112
|
+
* chat. Voice memos appear with iMessage's native inline playback UI, unlike
|
|
113
|
+
* regular audio attachments sent via media parts which appear as downloadable
|
|
114
|
+
* files.
|
|
115
|
+
*
|
|
116
|
+
* **Supported audio formats:**
|
|
117
|
+
*
|
|
118
|
+
* - MP3 (audio/mpeg)
|
|
119
|
+
* - M4A (audio/x-m4a, audio/mp4)
|
|
120
|
+
* - AAC (audio/aac)
|
|
121
|
+
* - CAF (audio/x-caf) - Core Audio Format
|
|
122
|
+
* - WAV (audio/wav)
|
|
123
|
+
* - AIFF (audio/aiff, audio/x-aiff)
|
|
124
|
+
* - AMR (audio/amr)
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const response = await client.chats.sendVoicememo(
|
|
129
|
+
* 'f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd',
|
|
130
|
+
* {
|
|
131
|
+
* from: '+12052535597',
|
|
132
|
+
* voice_memo_url: 'https://example.com/voice-memo.m4a',
|
|
133
|
+
* },
|
|
134
|
+
* );
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
sendVoicememo(chatID: string, body: ChatSendVoicememoParams, options?: RequestOptions): APIPromise<ChatSendVoicememoResponse>;
|
|
138
|
+
/**
|
|
139
|
+
* Share your contact information (Name and Photo Sharing) with a chat.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* await client.chats.shareContactCard(
|
|
144
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
145
|
+
* );
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
shareContactCard(chatID: string, options?: RequestOptions): APIPromise<void>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Response for creating a new chat with an initial message
|
|
152
|
+
*/
|
|
153
|
+
export interface ChatCreateResponse {
|
|
154
|
+
chat: ChatCreateResponse.Chat;
|
|
155
|
+
}
|
|
156
|
+
export declare namespace ChatCreateResponse {
|
|
157
|
+
interface Chat {
|
|
158
|
+
/**
|
|
159
|
+
* Unique identifier for the created chat (UUID)
|
|
160
|
+
*/
|
|
161
|
+
id: string;
|
|
162
|
+
/**
|
|
163
|
+
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
164
|
+
* handles. Can be updated for group chats.
|
|
165
|
+
*/
|
|
166
|
+
display_name: string | null;
|
|
167
|
+
/**
|
|
168
|
+
* List of participants in the chat. Always contains at least two handles (your
|
|
169
|
+
* phone number and the other participant).
|
|
170
|
+
*/
|
|
171
|
+
handles: Array<Chat.Handle>;
|
|
172
|
+
/**
|
|
173
|
+
* Whether this is a group chat
|
|
174
|
+
*/
|
|
175
|
+
is_group: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
178
|
+
*/
|
|
179
|
+
message: Chat.Message;
|
|
180
|
+
/**
|
|
181
|
+
* Messaging service used
|
|
182
|
+
*/
|
|
183
|
+
service: string;
|
|
184
|
+
}
|
|
185
|
+
namespace Chat {
|
|
186
|
+
interface Handle {
|
|
187
|
+
/**
|
|
188
|
+
* Unique identifier for this handle
|
|
189
|
+
*/
|
|
190
|
+
id: string;
|
|
191
|
+
/**
|
|
192
|
+
* Phone number (E.164) or email address of the participant
|
|
193
|
+
*/
|
|
194
|
+
handle: string;
|
|
195
|
+
/**
|
|
196
|
+
* When this participant joined the chat
|
|
197
|
+
*/
|
|
198
|
+
joined_at: string;
|
|
199
|
+
/**
|
|
200
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
201
|
+
*/
|
|
202
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
203
|
+
/**
|
|
204
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
205
|
+
*/
|
|
206
|
+
is_me?: boolean | null;
|
|
207
|
+
/**
|
|
208
|
+
* When they left (if applicable)
|
|
209
|
+
*/
|
|
210
|
+
left_at?: string | null;
|
|
211
|
+
/**
|
|
212
|
+
* Participant status
|
|
213
|
+
*/
|
|
214
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
218
|
+
*/
|
|
219
|
+
interface Message {
|
|
220
|
+
/**
|
|
221
|
+
* Message identifier (UUID)
|
|
222
|
+
*/
|
|
223
|
+
id: string;
|
|
224
|
+
/**
|
|
225
|
+
* Current delivery status of a message
|
|
226
|
+
*/
|
|
227
|
+
delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'failed';
|
|
228
|
+
/**
|
|
229
|
+
* Whether the message has been read
|
|
230
|
+
*/
|
|
231
|
+
is_read: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Message parts in order (text and media)
|
|
234
|
+
*/
|
|
235
|
+
parts: Array<Message.TextPartResponse | Message.MediaPartResponse>;
|
|
236
|
+
/**
|
|
237
|
+
* When the message was sent
|
|
238
|
+
*/
|
|
239
|
+
sent_at: string;
|
|
240
|
+
/**
|
|
241
|
+
* When the message was delivered
|
|
242
|
+
*/
|
|
243
|
+
delivered_at?: string | null;
|
|
244
|
+
/**
|
|
245
|
+
* iMessage effect applied to a message (screen or bubble effect)
|
|
246
|
+
*/
|
|
247
|
+
effect?: Message.Effect | null;
|
|
248
|
+
/**
|
|
249
|
+
* The sender of this message as a full handle object
|
|
250
|
+
*/
|
|
251
|
+
from_handle?: Message.FromHandle | null;
|
|
252
|
+
/**
|
|
253
|
+
* Preferred service for sending this message
|
|
254
|
+
*/
|
|
255
|
+
preferred_service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
256
|
+
/**
|
|
257
|
+
* Indicates this message is a threaded reply to another message
|
|
258
|
+
*/
|
|
259
|
+
reply_to?: Message.ReplyTo | null;
|
|
260
|
+
/**
|
|
261
|
+
* Service used to send this message
|
|
262
|
+
*/
|
|
263
|
+
service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
264
|
+
}
|
|
265
|
+
namespace Message {
|
|
266
|
+
/**
|
|
267
|
+
* A text message part
|
|
268
|
+
*/
|
|
269
|
+
interface TextPartResponse {
|
|
270
|
+
/**
|
|
271
|
+
* Reactions on this message part
|
|
272
|
+
*/
|
|
273
|
+
reactions: Array<TextPartResponse.Reaction> | null;
|
|
274
|
+
/**
|
|
275
|
+
* Indicates this is a text message part
|
|
276
|
+
*/
|
|
277
|
+
type: 'text';
|
|
278
|
+
/**
|
|
279
|
+
* The text content
|
|
280
|
+
*/
|
|
281
|
+
value: string;
|
|
282
|
+
}
|
|
283
|
+
namespace TextPartResponse {
|
|
284
|
+
interface Reaction {
|
|
285
|
+
handle: Reaction.Handle;
|
|
286
|
+
/**
|
|
287
|
+
* Whether this reaction is from the current user
|
|
288
|
+
*/
|
|
289
|
+
is_me: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
292
|
+
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
293
|
+
* emoji in the custom_emoji field.
|
|
294
|
+
*/
|
|
295
|
+
type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
|
|
296
|
+
/**
|
|
297
|
+
* Custom emoji if type is "custom", null otherwise
|
|
298
|
+
*/
|
|
299
|
+
custom_emoji?: string | null;
|
|
300
|
+
}
|
|
301
|
+
namespace Reaction {
|
|
302
|
+
interface Handle {
|
|
303
|
+
/**
|
|
304
|
+
* Unique identifier for this handle
|
|
305
|
+
*/
|
|
306
|
+
id: string;
|
|
307
|
+
/**
|
|
308
|
+
* Phone number (E.164) or email address of the participant
|
|
309
|
+
*/
|
|
310
|
+
handle: string;
|
|
311
|
+
/**
|
|
312
|
+
* When this participant joined the chat
|
|
313
|
+
*/
|
|
314
|
+
joined_at: string;
|
|
315
|
+
/**
|
|
316
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
317
|
+
*/
|
|
318
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
319
|
+
/**
|
|
320
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
321
|
+
*/
|
|
322
|
+
is_me?: boolean | null;
|
|
323
|
+
/**
|
|
324
|
+
* When they left (if applicable)
|
|
325
|
+
*/
|
|
326
|
+
left_at?: string | null;
|
|
327
|
+
/**
|
|
328
|
+
* Participant status
|
|
329
|
+
*/
|
|
330
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* A media attachment part
|
|
336
|
+
*/
|
|
337
|
+
interface MediaPartResponse {
|
|
338
|
+
/**
|
|
339
|
+
* Unique attachment identifier
|
|
340
|
+
*/
|
|
341
|
+
id: string;
|
|
342
|
+
/**
|
|
343
|
+
* Original filename
|
|
344
|
+
*/
|
|
345
|
+
filename: string;
|
|
346
|
+
/**
|
|
347
|
+
* MIME type of the file
|
|
348
|
+
*/
|
|
349
|
+
mime_type: string;
|
|
350
|
+
/**
|
|
351
|
+
* Reactions on this message part
|
|
352
|
+
*/
|
|
353
|
+
reactions: Array<MediaPartResponse.Reaction> | null;
|
|
354
|
+
/**
|
|
355
|
+
* File size in bytes
|
|
356
|
+
*/
|
|
357
|
+
size_bytes: number;
|
|
358
|
+
/**
|
|
359
|
+
* Indicates this is a media attachment part
|
|
360
|
+
*/
|
|
361
|
+
type: 'media';
|
|
362
|
+
/**
|
|
363
|
+
* Presigned URL for downloading the attachment (expires in 1 hour).
|
|
364
|
+
*/
|
|
365
|
+
url: string;
|
|
366
|
+
}
|
|
367
|
+
namespace MediaPartResponse {
|
|
368
|
+
interface Reaction {
|
|
369
|
+
handle: Reaction.Handle;
|
|
370
|
+
/**
|
|
371
|
+
* Whether this reaction is from the current user
|
|
372
|
+
*/
|
|
373
|
+
is_me: boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
376
|
+
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
377
|
+
* emoji in the custom_emoji field.
|
|
378
|
+
*/
|
|
379
|
+
type: 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom';
|
|
380
|
+
/**
|
|
381
|
+
* Custom emoji if type is "custom", null otherwise
|
|
382
|
+
*/
|
|
383
|
+
custom_emoji?: string | null;
|
|
384
|
+
}
|
|
385
|
+
namespace Reaction {
|
|
386
|
+
interface Handle {
|
|
387
|
+
/**
|
|
388
|
+
* Unique identifier for this handle
|
|
389
|
+
*/
|
|
390
|
+
id: string;
|
|
391
|
+
/**
|
|
392
|
+
* Phone number (E.164) or email address of the participant
|
|
393
|
+
*/
|
|
394
|
+
handle: string;
|
|
395
|
+
/**
|
|
396
|
+
* When this participant joined the chat
|
|
397
|
+
*/
|
|
398
|
+
joined_at: string;
|
|
399
|
+
/**
|
|
400
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
401
|
+
*/
|
|
402
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
403
|
+
/**
|
|
404
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
405
|
+
*/
|
|
406
|
+
is_me?: boolean | null;
|
|
407
|
+
/**
|
|
408
|
+
* When they left (if applicable)
|
|
409
|
+
*/
|
|
410
|
+
left_at?: string | null;
|
|
411
|
+
/**
|
|
412
|
+
* Participant status
|
|
413
|
+
*/
|
|
414
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* iMessage effect applied to a message (screen or bubble effect)
|
|
420
|
+
*/
|
|
421
|
+
interface Effect {
|
|
422
|
+
/**
|
|
423
|
+
* Name of the effect. Common values:
|
|
424
|
+
*
|
|
425
|
+
* - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
|
|
426
|
+
* love, balloons, happy_birthday, echo, spotlight
|
|
427
|
+
* - Bubble effects: slam, loud, gentle, invisible
|
|
428
|
+
*/
|
|
429
|
+
name?: string;
|
|
430
|
+
/**
|
|
431
|
+
* Type of effect
|
|
432
|
+
*/
|
|
433
|
+
type?: 'screen' | 'bubble';
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The sender of this message as a full handle object
|
|
437
|
+
*/
|
|
438
|
+
interface FromHandle {
|
|
439
|
+
/**
|
|
440
|
+
* Unique identifier for this handle
|
|
441
|
+
*/
|
|
442
|
+
id: string;
|
|
443
|
+
/**
|
|
444
|
+
* Phone number (E.164) or email address of the participant
|
|
445
|
+
*/
|
|
446
|
+
handle: string;
|
|
447
|
+
/**
|
|
448
|
+
* When this participant joined the chat
|
|
449
|
+
*/
|
|
450
|
+
joined_at: string;
|
|
451
|
+
/**
|
|
452
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
453
|
+
*/
|
|
454
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
455
|
+
/**
|
|
456
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
457
|
+
*/
|
|
458
|
+
is_me?: boolean | null;
|
|
459
|
+
/**
|
|
460
|
+
* When they left (if applicable)
|
|
461
|
+
*/
|
|
462
|
+
left_at?: string | null;
|
|
463
|
+
/**
|
|
464
|
+
* Participant status
|
|
465
|
+
*/
|
|
466
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Indicates this message is a threaded reply to another message
|
|
470
|
+
*/
|
|
471
|
+
interface ReplyTo {
|
|
472
|
+
/**
|
|
473
|
+
* The ID of the message to reply to
|
|
474
|
+
*/
|
|
475
|
+
message_id: string;
|
|
476
|
+
/**
|
|
477
|
+
* The specific message part to reply to (0-based index). Defaults to 0 (first
|
|
478
|
+
* part) if not provided. Use this when replying to a specific part of a multipart
|
|
479
|
+
* message.
|
|
480
|
+
*/
|
|
481
|
+
part_index?: number;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
export interface ChatRetrieveResponse {
|
|
487
|
+
/**
|
|
488
|
+
* Unique identifier for the chat
|
|
489
|
+
*/
|
|
490
|
+
id: string;
|
|
491
|
+
/**
|
|
492
|
+
* When the chat was created
|
|
493
|
+
*/
|
|
494
|
+
created_at: string;
|
|
495
|
+
/**
|
|
496
|
+
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
497
|
+
* handles. Can be updated for group chats.
|
|
498
|
+
*/
|
|
499
|
+
display_name: string | null;
|
|
500
|
+
/**
|
|
501
|
+
* List of chat participants with full handle details. Always contains at least two
|
|
502
|
+
* handles (your phone number and the other participant).
|
|
503
|
+
*/
|
|
504
|
+
handles: Array<ChatRetrieveResponse.Handle>;
|
|
505
|
+
/**
|
|
506
|
+
* Whether the chat is archived
|
|
507
|
+
*/
|
|
508
|
+
is_archived: boolean;
|
|
509
|
+
/**
|
|
510
|
+
* Whether this is a group chat
|
|
511
|
+
*/
|
|
512
|
+
is_group: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* When the chat was last updated
|
|
515
|
+
*/
|
|
516
|
+
updated_at: string;
|
|
517
|
+
/**
|
|
518
|
+
* Service type for the chat
|
|
519
|
+
*/
|
|
520
|
+
service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
521
|
+
}
|
|
522
|
+
export declare namespace ChatRetrieveResponse {
|
|
523
|
+
interface Handle {
|
|
524
|
+
/**
|
|
525
|
+
* Unique identifier for this handle
|
|
526
|
+
*/
|
|
527
|
+
id: string;
|
|
528
|
+
/**
|
|
529
|
+
* Phone number (E.164) or email address of the participant
|
|
530
|
+
*/
|
|
531
|
+
handle: string;
|
|
532
|
+
/**
|
|
533
|
+
* When this participant joined the chat
|
|
534
|
+
*/
|
|
535
|
+
joined_at: string;
|
|
536
|
+
/**
|
|
537
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
538
|
+
*/
|
|
539
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
540
|
+
/**
|
|
541
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
542
|
+
*/
|
|
543
|
+
is_me?: boolean | null;
|
|
544
|
+
/**
|
|
545
|
+
* When they left (if applicable)
|
|
546
|
+
*/
|
|
547
|
+
left_at?: string | null;
|
|
548
|
+
/**
|
|
549
|
+
* Participant status
|
|
550
|
+
*/
|
|
551
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
export interface ChatUpdateResponse {
|
|
555
|
+
/**
|
|
556
|
+
* Unique identifier for the chat
|
|
557
|
+
*/
|
|
558
|
+
id: string;
|
|
559
|
+
/**
|
|
560
|
+
* When the chat was created
|
|
561
|
+
*/
|
|
562
|
+
created_at: string;
|
|
563
|
+
/**
|
|
564
|
+
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
565
|
+
* handles. Can be updated for group chats.
|
|
566
|
+
*/
|
|
567
|
+
display_name: string | null;
|
|
568
|
+
/**
|
|
569
|
+
* List of chat participants with full handle details. Always contains at least two
|
|
570
|
+
* handles (your phone number and the other participant).
|
|
571
|
+
*/
|
|
572
|
+
handles: Array<ChatUpdateResponse.Handle>;
|
|
573
|
+
/**
|
|
574
|
+
* Whether the chat is archived
|
|
575
|
+
*/
|
|
576
|
+
is_archived: boolean;
|
|
577
|
+
/**
|
|
578
|
+
* Whether this is a group chat
|
|
579
|
+
*/
|
|
580
|
+
is_group: boolean;
|
|
581
|
+
/**
|
|
582
|
+
* When the chat was last updated
|
|
583
|
+
*/
|
|
584
|
+
updated_at: string;
|
|
585
|
+
/**
|
|
586
|
+
* Service type for the chat
|
|
587
|
+
*/
|
|
588
|
+
service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
589
|
+
}
|
|
590
|
+
export declare namespace ChatUpdateResponse {
|
|
591
|
+
interface Handle {
|
|
592
|
+
/**
|
|
593
|
+
* Unique identifier for this handle
|
|
594
|
+
*/
|
|
595
|
+
id: string;
|
|
596
|
+
/**
|
|
597
|
+
* Phone number (E.164) or email address of the participant
|
|
598
|
+
*/
|
|
599
|
+
handle: string;
|
|
600
|
+
/**
|
|
601
|
+
* When this participant joined the chat
|
|
602
|
+
*/
|
|
603
|
+
joined_at: string;
|
|
604
|
+
/**
|
|
605
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
606
|
+
*/
|
|
607
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
608
|
+
/**
|
|
609
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
610
|
+
*/
|
|
611
|
+
is_me?: boolean | null;
|
|
612
|
+
/**
|
|
613
|
+
* When they left (if applicable)
|
|
614
|
+
*/
|
|
615
|
+
left_at?: string | null;
|
|
616
|
+
/**
|
|
617
|
+
* Participant status
|
|
618
|
+
*/
|
|
619
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
export interface ChatListResponse {
|
|
623
|
+
/**
|
|
624
|
+
* List of chats
|
|
625
|
+
*/
|
|
626
|
+
chats: Array<ChatListResponse.Chat>;
|
|
627
|
+
/**
|
|
628
|
+
* Cursor for fetching the next page of results. Null if there are no more results
|
|
629
|
+
* to fetch. Pass this value as the `cursor` parameter in the next request.
|
|
630
|
+
*/
|
|
631
|
+
next_cursor?: string | null;
|
|
632
|
+
}
|
|
633
|
+
export declare namespace ChatListResponse {
|
|
634
|
+
interface Chat {
|
|
635
|
+
/**
|
|
636
|
+
* Unique identifier for the chat
|
|
637
|
+
*/
|
|
638
|
+
id: string;
|
|
639
|
+
/**
|
|
640
|
+
* When the chat was created
|
|
641
|
+
*/
|
|
642
|
+
created_at: string;
|
|
643
|
+
/**
|
|
644
|
+
* Display name for the chat. Defaults to a comma-separated list of recipient
|
|
645
|
+
* handles. Can be updated for group chats.
|
|
646
|
+
*/
|
|
647
|
+
display_name: string | null;
|
|
648
|
+
/**
|
|
649
|
+
* List of chat participants with full handle details. Always contains at least two
|
|
650
|
+
* handles (your phone number and the other participant).
|
|
651
|
+
*/
|
|
652
|
+
handles: Array<Chat.Handle>;
|
|
653
|
+
/**
|
|
654
|
+
* Whether the chat is archived
|
|
655
|
+
*/
|
|
656
|
+
is_archived: boolean;
|
|
657
|
+
/**
|
|
658
|
+
* Whether this is a group chat
|
|
659
|
+
*/
|
|
660
|
+
is_group: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* When the chat was last updated
|
|
663
|
+
*/
|
|
664
|
+
updated_at: string;
|
|
665
|
+
/**
|
|
666
|
+
* Service type for the chat
|
|
667
|
+
*/
|
|
668
|
+
service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
669
|
+
}
|
|
670
|
+
namespace Chat {
|
|
671
|
+
interface Handle {
|
|
672
|
+
/**
|
|
673
|
+
* Unique identifier for this handle
|
|
674
|
+
*/
|
|
675
|
+
id: string;
|
|
676
|
+
/**
|
|
677
|
+
* Phone number (E.164) or email address of the participant
|
|
678
|
+
*/
|
|
679
|
+
handle: string;
|
|
680
|
+
/**
|
|
681
|
+
* When this participant joined the chat
|
|
682
|
+
*/
|
|
683
|
+
joined_at: string;
|
|
684
|
+
/**
|
|
685
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
686
|
+
*/
|
|
687
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
688
|
+
/**
|
|
689
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
690
|
+
*/
|
|
691
|
+
is_me?: boolean | null;
|
|
692
|
+
/**
|
|
693
|
+
* When they left (if applicable)
|
|
694
|
+
*/
|
|
695
|
+
left_at?: string | null;
|
|
696
|
+
/**
|
|
697
|
+
* Participant status
|
|
698
|
+
*/
|
|
699
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Response for sending a voice memo to a chat
|
|
705
|
+
*/
|
|
706
|
+
export interface ChatSendVoicememoResponse {
|
|
707
|
+
voice_memo: ChatSendVoicememoResponse.VoiceMemo;
|
|
708
|
+
}
|
|
709
|
+
export declare namespace ChatSendVoicememoResponse {
|
|
710
|
+
interface VoiceMemo {
|
|
711
|
+
/**
|
|
712
|
+
* Message identifier
|
|
713
|
+
*/
|
|
714
|
+
id: string;
|
|
715
|
+
chat: VoiceMemo.Chat;
|
|
716
|
+
/**
|
|
717
|
+
* When the voice memo was created
|
|
718
|
+
*/
|
|
719
|
+
created_at: string;
|
|
720
|
+
/**
|
|
721
|
+
* Sender phone number
|
|
722
|
+
*/
|
|
723
|
+
from: string;
|
|
724
|
+
/**
|
|
725
|
+
* Current delivery status
|
|
726
|
+
*/
|
|
727
|
+
status: string;
|
|
728
|
+
/**
|
|
729
|
+
* Recipient handles (phone numbers or email addresses)
|
|
730
|
+
*/
|
|
731
|
+
to: Array<string>;
|
|
732
|
+
voice_memo: VoiceMemo.VoiceMemo;
|
|
733
|
+
/**
|
|
734
|
+
* Service used to send this voice memo
|
|
735
|
+
*/
|
|
736
|
+
service?: 'iMessage' | 'SMS' | 'RCS' | null;
|
|
737
|
+
}
|
|
738
|
+
namespace VoiceMemo {
|
|
739
|
+
interface Chat {
|
|
740
|
+
/**
|
|
741
|
+
* Chat identifier
|
|
742
|
+
*/
|
|
743
|
+
id: string;
|
|
744
|
+
/**
|
|
745
|
+
* Chat participants
|
|
746
|
+
*/
|
|
747
|
+
handles: Array<Chat.Handle>;
|
|
748
|
+
/**
|
|
749
|
+
* Whether the chat is active
|
|
750
|
+
*/
|
|
751
|
+
is_active: boolean;
|
|
752
|
+
/**
|
|
753
|
+
* Whether this is a group chat
|
|
754
|
+
*/
|
|
755
|
+
is_group: boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Messaging service
|
|
758
|
+
*/
|
|
759
|
+
service: string;
|
|
760
|
+
}
|
|
761
|
+
namespace Chat {
|
|
762
|
+
interface Handle {
|
|
763
|
+
/**
|
|
764
|
+
* Unique identifier for this handle
|
|
765
|
+
*/
|
|
766
|
+
id: string;
|
|
767
|
+
/**
|
|
768
|
+
* Phone number (E.164) or email address of the participant
|
|
769
|
+
*/
|
|
770
|
+
handle: string;
|
|
771
|
+
/**
|
|
772
|
+
* When this participant joined the chat
|
|
773
|
+
*/
|
|
774
|
+
joined_at: string;
|
|
775
|
+
/**
|
|
776
|
+
* Service type (iMessage, SMS, RCS, etc.)
|
|
777
|
+
*/
|
|
778
|
+
service: 'iMessage' | 'SMS' | 'RCS';
|
|
779
|
+
/**
|
|
780
|
+
* Whether this handle belongs to the sender (your phone number)
|
|
781
|
+
*/
|
|
782
|
+
is_me?: boolean | null;
|
|
783
|
+
/**
|
|
784
|
+
* When they left (if applicable)
|
|
785
|
+
*/
|
|
786
|
+
left_at?: string | null;
|
|
787
|
+
/**
|
|
788
|
+
* Participant status
|
|
789
|
+
*/
|
|
790
|
+
status?: 'active' | 'left' | 'removed' | null;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
interface VoiceMemo {
|
|
794
|
+
/**
|
|
795
|
+
* Attachment identifier
|
|
796
|
+
*/
|
|
797
|
+
id: string;
|
|
798
|
+
/**
|
|
799
|
+
* Original filename
|
|
800
|
+
*/
|
|
801
|
+
filename: string;
|
|
802
|
+
/**
|
|
803
|
+
* Audio MIME type
|
|
804
|
+
*/
|
|
805
|
+
mime_type: string;
|
|
806
|
+
/**
|
|
807
|
+
* File size in bytes
|
|
808
|
+
*/
|
|
809
|
+
size_bytes: number;
|
|
810
|
+
/**
|
|
811
|
+
* CDN URL for downloading the voice memo
|
|
812
|
+
*/
|
|
813
|
+
url: string;
|
|
814
|
+
/**
|
|
815
|
+
* Duration in milliseconds
|
|
816
|
+
*/
|
|
817
|
+
duration_ms?: number | null;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
export interface ChatCreateParams {
|
|
822
|
+
/**
|
|
823
|
+
* Sender phone number in E.164 format. Must be a phone number that the
|
|
824
|
+
* authenticated partner has permission to send from.
|
|
825
|
+
*/
|
|
826
|
+
from: string;
|
|
827
|
+
/**
|
|
828
|
+
* Message content container. Groups all message-related fields together,
|
|
829
|
+
* separating the "what" (message content) from the "where" (routing fields like
|
|
830
|
+
* from/to).
|
|
831
|
+
*/
|
|
832
|
+
message: ChatCreateParams.Message;
|
|
833
|
+
/**
|
|
834
|
+
* Array of recipient handles (phone numbers in E.164 format or email addresses).
|
|
835
|
+
* For individual chats, provide one recipient. For group chats, provide multiple.
|
|
836
|
+
*/
|
|
837
|
+
to: Array<string>;
|
|
838
|
+
}
|
|
839
|
+
export declare namespace ChatCreateParams {
|
|
840
|
+
/**
|
|
841
|
+
* Message content container. Groups all message-related fields together,
|
|
842
|
+
* separating the "what" (message content) from the "where" (routing fields like
|
|
843
|
+
* from/to).
|
|
844
|
+
*/
|
|
845
|
+
interface Message {
|
|
846
|
+
/**
|
|
847
|
+
* Array of message parts. Each part can be either text or media. Parts are
|
|
848
|
+
* displayed in order. Text and media can be mixed.
|
|
849
|
+
*
|
|
850
|
+
* **Supported Media:**
|
|
851
|
+
*
|
|
852
|
+
* - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
|
|
853
|
+
* - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
|
|
854
|
+
* - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
|
|
855
|
+
* - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
|
|
856
|
+
* .pages, .numbers, .key, .epub, .zip, .html, .htm
|
|
857
|
+
* - Contact & Calendar: .vcf, .ics
|
|
858
|
+
*
|
|
859
|
+
* **Audio:**
|
|
860
|
+
*
|
|
861
|
+
* - Audio files (.m4a, .mp3, .aac, .caf, .wav, .aiff, .amr) are fully supported as
|
|
862
|
+
* media parts
|
|
863
|
+
* - To send audio as an **iMessage voice memo bubble** (inline playback UI), use
|
|
864
|
+
* the dedicated `/v3/chats/{chatId}/voicememo` endpoint instead
|
|
865
|
+
*
|
|
866
|
+
* **Validation Rule:** Consecutive text parts are not allowed. Text parts must be
|
|
867
|
+
* separated by media parts. For example, [text, text] is invalid, but [text,
|
|
868
|
+
* media, text] is valid.
|
|
869
|
+
*/
|
|
870
|
+
parts: Array<Message.TextPart | Message.MediaPart>;
|
|
871
|
+
/**
|
|
872
|
+
* iMessage effect to apply to this message (screen or bubble effect)
|
|
873
|
+
*/
|
|
874
|
+
effect?: Message.Effect;
|
|
875
|
+
/**
|
|
876
|
+
* Optional idempotency key for this message. Use this to prevent duplicate sends
|
|
877
|
+
* of the same message.
|
|
878
|
+
*/
|
|
879
|
+
idempotency_key?: string;
|
|
880
|
+
/**
|
|
881
|
+
* Preferred messaging service to use for this message. If not specified, uses
|
|
882
|
+
* default fallback chain: iMessage → RCS → SMS.
|
|
883
|
+
*
|
|
884
|
+
* - iMessage: Enforces iMessage without fallback to RCS or SMS. Message fails if
|
|
885
|
+
* recipient doesn't support iMessage.
|
|
886
|
+
* - RCS: Enforces RCS or SMS (no iMessage). Uses RCS if recipient supports it,
|
|
887
|
+
* otherwise falls back to SMS.
|
|
888
|
+
* - SMS: Enforces SMS (no iMessage). Uses RCS if recipient supports it, otherwise
|
|
889
|
+
* falls back to SMS.
|
|
890
|
+
*/
|
|
891
|
+
preferred_service?: 'iMessage' | 'RCS' | 'SMS';
|
|
892
|
+
/**
|
|
893
|
+
* Reply to another message to create a threaded conversation
|
|
894
|
+
*/
|
|
895
|
+
reply_to?: Message.ReplyTo;
|
|
896
|
+
}
|
|
897
|
+
namespace Message {
|
|
898
|
+
interface TextPart {
|
|
899
|
+
/**
|
|
900
|
+
* Indicates this is a text message part
|
|
901
|
+
*/
|
|
902
|
+
type: 'text';
|
|
903
|
+
/**
|
|
904
|
+
* The text content
|
|
905
|
+
*/
|
|
906
|
+
value: string;
|
|
907
|
+
/**
|
|
908
|
+
* Optional idempotency key for this specific message part. Use this to prevent
|
|
909
|
+
* duplicate sends of the same part.
|
|
910
|
+
*/
|
|
911
|
+
idempotency_key?: string;
|
|
912
|
+
}
|
|
913
|
+
interface MediaPart {
|
|
914
|
+
/**
|
|
915
|
+
* Indicates this is a media attachment part
|
|
916
|
+
*/
|
|
917
|
+
type: 'media';
|
|
918
|
+
/**
|
|
919
|
+
* Reference to a file pre-uploaded via `POST /v3/attachments` (optional). The file
|
|
920
|
+
* is already stored, so sends using this ID skip the download step — useful when
|
|
921
|
+
* sending the same file to many recipients.
|
|
922
|
+
*
|
|
923
|
+
* Either `url` or `attachment_id` must be provided, but not both.
|
|
924
|
+
*/
|
|
925
|
+
attachment_id?: string;
|
|
926
|
+
/**
|
|
927
|
+
* Optional idempotency key for this specific message part. Use this to prevent
|
|
928
|
+
* duplicate sends of the same part.
|
|
929
|
+
*/
|
|
930
|
+
idempotency_key?: string;
|
|
931
|
+
/**
|
|
932
|
+
* Any publicly accessible HTTPS URL to the media file. The server downloads and
|
|
933
|
+
* sends the file automatically — no pre-upload step required.
|
|
934
|
+
*
|
|
935
|
+
* **Size limit:** 10MB maximum for URL-based downloads. For larger files (up to
|
|
936
|
+
* 100MB), use the pre-upload flow: `POST /v3/attachments` to get a presigned URL,
|
|
937
|
+
* upload directly, then reference by `attachment_id`.
|
|
938
|
+
*
|
|
939
|
+
* **Requirements:**
|
|
940
|
+
*
|
|
941
|
+
* - URL must use HTTPS
|
|
942
|
+
* - File content must be a supported format (the server validates the actual file
|
|
943
|
+
* content)
|
|
944
|
+
*
|
|
945
|
+
* **Supported formats:**
|
|
946
|
+
*
|
|
947
|
+
* - Images: .jpg, .jpeg, .png, .gif, .heic, .heif, .tif, .tiff, .bmp
|
|
948
|
+
* - Videos: .mp4, .mov, .m4v, .mpeg, .mpg, .3gp
|
|
949
|
+
* - Audio: .m4a, .mp3, .aac, .caf, .wav, .aiff, .amr
|
|
950
|
+
* - Documents: .pdf, .txt, .rtf, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx,
|
|
951
|
+
* .pages, .numbers, .key, .epub, .zip, .html, .htm
|
|
952
|
+
* - Contact & Calendar: .vcf, .ics
|
|
953
|
+
*
|
|
954
|
+
* **Tip:** Audio sent here appears as a regular file attachment. To send audio as
|
|
955
|
+
* an iMessage voice memo bubble (with inline playback), use
|
|
956
|
+
* `/v3/chats/{chatId}/voicememo`. For repeated sends of the same file, use
|
|
957
|
+
* `attachment_id` to avoid redundant downloads.
|
|
958
|
+
*
|
|
959
|
+
* Either `url` or `attachment_id` must be provided, but not both.
|
|
960
|
+
*/
|
|
961
|
+
url?: string;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* iMessage effect to apply to this message (screen or bubble effect)
|
|
965
|
+
*/
|
|
966
|
+
interface Effect {
|
|
967
|
+
/**
|
|
968
|
+
* Name of the effect. Common values:
|
|
969
|
+
*
|
|
970
|
+
* - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
|
|
971
|
+
* love, balloons, happy_birthday, echo, spotlight
|
|
972
|
+
* - Bubble effects: slam, loud, gentle, invisible
|
|
973
|
+
*/
|
|
974
|
+
name?: string;
|
|
975
|
+
/**
|
|
976
|
+
* Type of effect
|
|
977
|
+
*/
|
|
978
|
+
type?: 'screen' | 'bubble';
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Reply to another message to create a threaded conversation
|
|
982
|
+
*/
|
|
983
|
+
interface ReplyTo {
|
|
984
|
+
/**
|
|
985
|
+
* The ID of the message to reply to
|
|
986
|
+
*/
|
|
987
|
+
message_id: string;
|
|
988
|
+
/**
|
|
989
|
+
* The specific message part to reply to (0-based index). Defaults to 0 (first
|
|
990
|
+
* part) if not provided. Use this when replying to a specific part of a multipart
|
|
991
|
+
* message.
|
|
992
|
+
*/
|
|
993
|
+
part_index?: number;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
export interface ChatUpdateParams {
|
|
998
|
+
/**
|
|
999
|
+
* New display name for the chat (group chats only)
|
|
1000
|
+
*/
|
|
1001
|
+
display_name?: string;
|
|
1002
|
+
/**
|
|
1003
|
+
* URL of an image to set as the group chat icon (group chats only)
|
|
1004
|
+
*/
|
|
1005
|
+
group_chat_icon?: string;
|
|
1006
|
+
}
|
|
1007
|
+
export interface ChatListParams {
|
|
1008
|
+
/**
|
|
1009
|
+
* Phone number to filter chats by. Returns all chats made from this phone number.
|
|
1010
|
+
* Must be in E.164 format (e.g., `+13343284472`). The `+` is automatically
|
|
1011
|
+
* URL-encoded by HTTP clients.
|
|
1012
|
+
*/
|
|
1013
|
+
from: string;
|
|
1014
|
+
/**
|
|
1015
|
+
* Pagination cursor from the previous response's `next_cursor` field. Omit this
|
|
1016
|
+
* parameter for the first page of results.
|
|
1017
|
+
*/
|
|
1018
|
+
cursor?: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* Maximum number of chats to return per page
|
|
1021
|
+
*/
|
|
1022
|
+
limit?: number;
|
|
1023
|
+
}
|
|
1024
|
+
export interface ChatSendVoicememoParams {
|
|
1025
|
+
/**
|
|
1026
|
+
* Sender phone number in E.164 format
|
|
1027
|
+
*/
|
|
1028
|
+
from: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* URL of the voice memo audio file. Must be a publicly accessible HTTPS URL.
|
|
1031
|
+
*/
|
|
1032
|
+
voice_memo_url: string;
|
|
1033
|
+
}
|
|
1034
|
+
export declare namespace Chats {
|
|
1035
|
+
export { type ChatCreateResponse as ChatCreateResponse, type ChatRetrieveResponse as ChatRetrieveResponse, type ChatUpdateResponse as ChatUpdateResponse, type ChatListResponse as ChatListResponse, type ChatSendVoicememoResponse as ChatSendVoicememoResponse, type ChatCreateParams as ChatCreateParams, type ChatUpdateParams as ChatUpdateParams, type ChatListParams as ChatListParams, type ChatSendVoicememoParams as ChatSendVoicememoParams, };
|
|
1036
|
+
export { Participants as Participants, type ParticipantAddResponse as ParticipantAddResponse, type ParticipantRemoveResponse as ParticipantRemoveResponse, type ParticipantAddParams as ParticipantAddParams, type ParticipantRemoveParams as ParticipantRemoveParams, };
|
|
1037
|
+
export { Typing as Typing };
|
|
1038
|
+
export { Messages as Messages, type MessageListResponse as MessageListResponse, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
1039
|
+
}
|
|
1040
|
+
//# sourceMappingURL=chats.d.ts.map
|