@linqapp/sdk 0.2.0 → 0.5.0
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 +24 -0
- package/README.md +31 -0
- package/client.d.mts +21 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +21 -6
- package/client.d.ts.map +1 -1
- package/client.js +13 -0
- package/client.js.map +1 -1
- package/client.mjs +13 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +69 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +69 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +125 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +118 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/tslib.js +18 -18
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/capability.d.mts +9 -9
- package/resources/capability.d.ts +9 -9
- package/resources/capability.js +4 -4
- package/resources/capability.mjs +4 -4
- package/resources/chats/chats.d.mts +67 -84
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +67 -84
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +8 -4
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +9 -5
- 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 +12 -25
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +12 -25
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +7 -3
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +7 -3
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/index.d.mts +4 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +29 -131
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +29 -131
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +25 -4
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +25 -4
- package/resources/messages.mjs.map +1 -1
- package/resources/shared.d.mts +109 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +109 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/webhooks.d.mts +2506 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +2506 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +12 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +8 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +161 -24
- package/src/core/pagination.ts +212 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/capability.ts +14 -14
- package/src/resources/chats/chats.ts +77 -100
- package/src/resources/chats/index.ts +4 -3
- package/src/resources/chats/messages.ts +21 -30
- package/src/resources/index.ts +55 -12
- package/src/resources/messages.ts +41 -170
- package/src/resources/shared.ts +139 -0
- package/src/resources/webhooks.ts +3089 -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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { ListMessagesPagination, } from "../../core/pagination.mjs";
|
|
3
4
|
import { path } from "../../internal/utils/path.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* Messages are individual text or multimedia communications within a chat thread.
|
|
@@ -16,13 +17,16 @@ export class Messages extends APIResource {
|
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```ts
|
|
19
|
-
*
|
|
20
|
+
* // Automatically fetches more pages as needed.
|
|
21
|
+
* for await (const message of client.chats.messages.list(
|
|
20
22
|
* '550e8400-e29b-41d4-a716-446655440000',
|
|
21
|
-
* )
|
|
23
|
+
* )) {
|
|
24
|
+
* // ...
|
|
25
|
+
* }
|
|
22
26
|
* ```
|
|
23
27
|
*/
|
|
24
28
|
list(chatID, query = {}, options) {
|
|
25
|
-
return this._client.
|
|
29
|
+
return this._client.getAPIList(path `/v3/chats/${chatID}/messages`, (ListMessagesPagination), { query, ...options });
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
32
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAMf,EAAE,IAAI,EAAE;AAEf;;;;;;;;GAQG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAMf,EACL,sBAAsB,GAGvB;OAEM,EAAE,IAAI,EAAE;AAEf;;;;;;;;GAQG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAc,EACd,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,aAAa,MAAM,WAAW,EAClC,CAAA,sBAA2C,CAAA,EAC3C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * from "./shared.mjs";
|
|
2
2
|
export { Attachments, type SupportedContentType, type AttachmentCreateResponse, type AttachmentRetrieveResponse, type AttachmentCreateParams, } from "./attachments.mjs";
|
|
3
|
-
export { Capability, type
|
|
4
|
-
export { Chats, type Chat, type MessageContent, type
|
|
5
|
-
export { Messages, type ChatHandle, type
|
|
3
|
+
export { Capability, type CapabilityCheckiMessageResponse, type CapabilityCheckRCSResponse, type CapabilityCheckiMessageParams, type CapabilityCheckRCSParams, } from "./capability.mjs";
|
|
4
|
+
export { Chats, type Chat, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatUpdateParams, type ChatListChatsParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats/chats.mjs";
|
|
5
|
+
export { Messages, type ChatHandle, type Message, type MessageEffect, type ReplyTo, type MessageAddReactionResponse, type MessageUpdateParams, type MessageDeleteParams, type MessageAddReactionParams, type MessageListMessagesThreadParams, type MessagesListMessagesPagination, } from "./messages.mjs";
|
|
6
6
|
export { PhoneNumbers, type PhoneNumberListResponse } from "./phone-numbers.mjs";
|
|
7
7
|
export { Phonenumbers, type PhonenumberListResponse } from "./phonenumbers.mjs";
|
|
8
8
|
export { WebhookEvents, type WebhookEventType, type WebhookEventListResponse } from "./webhook-events.mjs";
|
|
9
9
|
export { WebhookSubscriptions, type WebhookSubscription, type WebhookSubscriptionCreateResponse, type WebhookSubscriptionListResponse, type WebhookSubscriptionCreateParams, type WebhookSubscriptionUpdateParams, } from "./webhook-subscriptions.mjs";
|
|
10
|
+
export { Webhooks, type MessageEventV2, type MessagePayload, type ReactionEventBase, type SchemasMediaPartResponse, type SchemasMessageEffect, type SchemasTextPartResponse, type MessageSentV2026WebhookEvent, type MessageReceivedV2026WebhookEvent, type MessageReadV2026WebhookEvent, type MessageDeliveredV2026WebhookEvent, type MessageFailedV2026WebhookEvent, type ReactionAddedV2026WebhookEvent, type ReactionRemovedV2026WebhookEvent, type ParticipantAddedV2026WebhookEvent, type ParticipantRemovedV2026WebhookEvent, type ChatGroupNameUpdatedV2026WebhookEvent, type ChatGroupIconUpdatedV2026WebhookEvent, type ChatGroupNameUpdateFailedV2026WebhookEvent, type ChatGroupIconUpdateFailedV2026WebhookEvent, type ChatCreatedV2026WebhookEvent, type ChatTypingIndicatorStartedV2026WebhookEvent, type ChatTypingIndicatorStoppedV2026WebhookEvent, type PhoneNumberStatusUpdatedV2026WebhookEvent, type MessageSentV2025WebhookEvent, type MessageReceivedV2025WebhookEvent, type MessageReadV2025WebhookEvent, type MessageDeliveredV2025WebhookEvent, type MessageFailedV2025WebhookEvent, type ReactionAddedV2025WebhookEvent, type ReactionRemovedV2025WebhookEvent, type ParticipantAddedV2025WebhookEvent, type ParticipantRemovedV2025WebhookEvent, type ChatGroupNameUpdatedV2025WebhookEvent, type ChatGroupIconUpdatedV2025WebhookEvent, type ChatGroupNameUpdateFailedV2025WebhookEvent, type ChatGroupIconUpdateFailedV2025WebhookEvent, type ChatCreatedV2025WebhookEvent, type ChatTypingIndicatorStartedV2025WebhookEvent, type ChatTypingIndicatorStoppedV2025WebhookEvent, type PhoneNumberStatusUpdatedV2025WebhookEvent, type EventsWebhookEvent, } from "./webhooks.mjs";
|
|
10
11
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B;OACM,EACL,UAAU,EACV,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,GAC9B;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B;OACM,EACL,UAAU,EACV,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,GAC9B;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B;OACM,EACL,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK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 @@
|
|
|
1
1
|
export * from "./shared.js";
|
|
2
2
|
export { Attachments, type SupportedContentType, type AttachmentCreateResponse, type AttachmentRetrieveResponse, type AttachmentCreateParams, } from "./attachments.js";
|
|
3
|
-
export { Capability, type
|
|
4
|
-
export { Chats, type Chat, type MessageContent, type
|
|
5
|
-
export { Messages, type ChatHandle, type
|
|
3
|
+
export { Capability, type CapabilityCheckiMessageResponse, type CapabilityCheckRCSResponse, type CapabilityCheckiMessageParams, type CapabilityCheckRCSParams, } from "./capability.js";
|
|
4
|
+
export { Chats, type Chat, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatUpdateParams, type ChatListChatsParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats/chats.js";
|
|
5
|
+
export { Messages, type ChatHandle, type Message, type MessageEffect, type ReplyTo, type MessageAddReactionResponse, type MessageUpdateParams, type MessageDeleteParams, type MessageAddReactionParams, type MessageListMessagesThreadParams, type MessagesListMessagesPagination, } from "./messages.js";
|
|
6
6
|
export { PhoneNumbers, type PhoneNumberListResponse } from "./phone-numbers.js";
|
|
7
7
|
export { Phonenumbers, type PhonenumberListResponse } from "./phonenumbers.js";
|
|
8
8
|
export { WebhookEvents, type WebhookEventType, type WebhookEventListResponse } from "./webhook-events.js";
|
|
9
9
|
export { WebhookSubscriptions, type WebhookSubscription, type WebhookSubscriptionCreateResponse, type WebhookSubscriptionListResponse, type WebhookSubscriptionCreateParams, type WebhookSubscriptionUpdateParams, } from "./webhook-subscriptions.js";
|
|
10
|
+
export { Webhooks, type MessageEventV2, type MessagePayload, type ReactionEventBase, type SchemasMediaPartResponse, type SchemasMessageEffect, type SchemasTextPartResponse, type MessageSentV2026WebhookEvent, type MessageReceivedV2026WebhookEvent, type MessageReadV2026WebhookEvent, type MessageDeliveredV2026WebhookEvent, type MessageFailedV2026WebhookEvent, type ReactionAddedV2026WebhookEvent, type ReactionRemovedV2026WebhookEvent, type ParticipantAddedV2026WebhookEvent, type ParticipantRemovedV2026WebhookEvent, type ChatGroupNameUpdatedV2026WebhookEvent, type ChatGroupIconUpdatedV2026WebhookEvent, type ChatGroupNameUpdateFailedV2026WebhookEvent, type ChatGroupIconUpdateFailedV2026WebhookEvent, type ChatCreatedV2026WebhookEvent, type ChatTypingIndicatorStartedV2026WebhookEvent, type ChatTypingIndicatorStoppedV2026WebhookEvent, type PhoneNumberStatusUpdatedV2026WebhookEvent, type MessageSentV2025WebhookEvent, type MessageReceivedV2025WebhookEvent, type MessageReadV2025WebhookEvent, type MessageDeliveredV2025WebhookEvent, type MessageFailedV2025WebhookEvent, type ReactionAddedV2025WebhookEvent, type ReactionRemovedV2025WebhookEvent, type ParticipantAddedV2025WebhookEvent, type ParticipantRemovedV2025WebhookEvent, type ChatGroupNameUpdatedV2025WebhookEvent, type ChatGroupIconUpdatedV2025WebhookEvent, type ChatGroupNameUpdateFailedV2025WebhookEvent, type ChatGroupIconUpdateFailedV2025WebhookEvent, type ChatCreatedV2025WebhookEvent, type ChatTypingIndicatorStartedV2025WebhookEvent, type ChatTypingIndicatorStoppedV2025WebhookEvent, type PhoneNumberStatusUpdatedV2025WebhookEvent, type EventsWebhookEvent, } from "./webhooks.js";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B;OACM,EACL,UAAU,EACV,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,GAC9B;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRo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AAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,KAAK,0CAA0C,EAC/C,KAAK,0CAA0C,EAC/C,KAAK,4BAA4B,EACjC,KAAK,2CAA2C,EAChD,KAAK,2CAA2C,EAChD,KAAK,yCAAyC,EAC9C,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,KAAK,0CAA0C,EAC/C,KAAK,0CAA0C,EAC/C,KAAK,4BAA4B,EACjC,KAAK,2CAA2C,EAChD,KAAK,2CAA2C,EAChD,KAAK,yCAAyC,EAC9C,KAAK,kBAAkB,GACxB"}
|
package/resources/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.WebhookSubscriptions = exports.WebhookEvents = exports.Phonenumbers = exports.PhoneNumbers = exports.Messages = exports.Chats = exports.Capability = exports.Attachments = void 0;
|
|
4
|
+
exports.Webhooks = exports.WebhookSubscriptions = exports.WebhookEvents = exports.Phonenumbers = exports.PhoneNumbers = exports.Messages = exports.Chats = exports.Capability = exports.Attachments = void 0;
|
|
5
5
|
const tslib_1 = require("../internal/tslib.js");
|
|
6
6
|
tslib_1.__exportStar(require("./shared.js"), exports);
|
|
7
7
|
var attachments_1 = require("./attachments.js");
|
|
@@ -20,4 +20,6 @@ var webhook_events_1 = require("./webhook-events.js");
|
|
|
20
20
|
Object.defineProperty(exports, "WebhookEvents", { enumerable: true, get: function () { return webhook_events_1.WebhookEvents; } });
|
|
21
21
|
var webhook_subscriptions_1 = require("./webhook-subscriptions.js");
|
|
22
22
|
Object.defineProperty(exports, "WebhookSubscriptions", { enumerable: true, get: function () { return webhook_subscriptions_1.WebhookSubscriptions; } });
|
|
23
|
+
var webhooks_1 = require("./webhooks.js");
|
|
24
|
+
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,gDAMuB;AALrB,0GAAA,WAAW,OAAA;AAMb,8CAMsB;AALpB,wGAAA,UAAU,OAAA;AAMZ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,gDAMuB;AALrB,0GAAA,WAAW,OAAA;AAMb,8CAMsB;AALpB,wGAAA,UAAU,OAAA;AAMZ,0CAauB;AAZrB,8FAAA,KAAK,OAAA;AAaP,0CAYoB;AAXlB,oGAAA,QAAQ,OAAA;AAYV,oDAA6E;AAApE,6GAAA,YAAY,OAAA;AACrB,kDAA4E;AAAnE,4GAAA,YAAY,OAAA;AACrB,sDAAuG;AAA9F,+GAAA,aAAa,OAAA;AACtB,oEAOiC;AAN/B,6HAAA,oBAAoB,OAAA;AAOtB,0CA2CoB;AA1ClB,oGAAA,QAAQ,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -8,4 +8,5 @@ export { PhoneNumbers } from "./phone-numbers.mjs";
|
|
|
8
8
|
export { Phonenumbers } from "./phonenumbers.mjs";
|
|
9
9
|
export { WebhookEvents } from "./webhook-events.mjs";
|
|
10
10
|
export { WebhookSubscriptions, } from "./webhook-subscriptions.mjs";
|
|
11
|
+
export { Webhooks, } from "./webhooks.mjs";
|
|
11
12
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,WAAW,GAKZ;OACM,EACL,UAAU,GAKX;OACM,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,WAAW,GAKZ;OACM,EACL,UAAU,GAKX;OACM,EACL,KAAK,GAYN;OACM,EACL,QAAQ,GAWT;OACM,EAAE,YAAY,EAAgC;OAC9C,EAAE,YAAY,EAAgC;OAC9C,EAAE,aAAa,EAAwD;OACvE,EACL,oBAAoB,GAMrB;OACM,EACL,QAAQ,GA0CT"}
|
package/resources/messages.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
2
|
import * as Shared from "./shared.mjs";
|
|
3
3
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { ListMessagesPagination, type ListMessagesPaginationParams, PagePromise } from "../core/pagination.mjs";
|
|
4
5
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
6
|
/**
|
|
6
7
|
* Messages are individual text or multimedia communications within a chat thread.
|
|
@@ -24,6 +25,18 @@ export declare class Messages extends APIResource {
|
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
retrieve(messageID: string, options?: RequestOptions): APIPromise<Message>;
|
|
28
|
+
/**
|
|
29
|
+
* Edit the text content of a specific part of a previously sent message.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const message = await client.messages.update(
|
|
34
|
+
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
35
|
+
* { text: 'This is the edited message content' },
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
update(messageID: string, body: MessageUpdateParams, options?: RequestOptions): APIPromise<Message>;
|
|
27
40
|
/**
|
|
28
41
|
* Deletes a message from the Linq API only. This does NOT unsend or remove the
|
|
29
42
|
* message from the actual chat - recipients will still see the message.
|
|
@@ -73,13 +86,17 @@ export declare class Messages extends APIResource {
|
|
|
73
86
|
*
|
|
74
87
|
* @example
|
|
75
88
|
* ```ts
|
|
76
|
-
*
|
|
89
|
+
* // Automatically fetches more pages as needed.
|
|
90
|
+
* for await (const message of client.messages.listMessagesThread(
|
|
77
91
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
78
|
-
* )
|
|
92
|
+
* )) {
|
|
93
|
+
* // ...
|
|
94
|
+
* }
|
|
79
95
|
* ```
|
|
80
96
|
*/
|
|
81
|
-
|
|
97
|
+
listMessagesThread(messageID: string, query?: MessageListMessagesThreadParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, Message>;
|
|
82
98
|
}
|
|
99
|
+
export type MessagesListMessagesPagination = ListMessagesPagination<Message>;
|
|
83
100
|
export interface ChatHandle {
|
|
84
101
|
/**
|
|
85
102
|
* Unique identifier for this handle
|
|
@@ -110,39 +127,6 @@ export interface ChatHandle {
|
|
|
110
127
|
*/
|
|
111
128
|
status?: 'active' | 'left' | 'removed' | null;
|
|
112
129
|
}
|
|
113
|
-
/**
|
|
114
|
-
* A media attachment part
|
|
115
|
-
*/
|
|
116
|
-
export interface MediaPart {
|
|
117
|
-
/**
|
|
118
|
-
* Unique attachment identifier
|
|
119
|
-
*/
|
|
120
|
-
id: string;
|
|
121
|
-
/**
|
|
122
|
-
* Original filename
|
|
123
|
-
*/
|
|
124
|
-
filename: string;
|
|
125
|
-
/**
|
|
126
|
-
* MIME type of the file
|
|
127
|
-
*/
|
|
128
|
-
mime_type: string;
|
|
129
|
-
/**
|
|
130
|
-
* Reactions on this message part
|
|
131
|
-
*/
|
|
132
|
-
reactions: Array<Reaction> | null;
|
|
133
|
-
/**
|
|
134
|
-
* File size in bytes
|
|
135
|
-
*/
|
|
136
|
-
size_bytes: number;
|
|
137
|
-
/**
|
|
138
|
-
* Indicates this is a media attachment part
|
|
139
|
-
*/
|
|
140
|
-
type: 'media';
|
|
141
|
-
/**
|
|
142
|
-
* Presigned URL for downloading the attachment (expires in 1 hour).
|
|
143
|
-
*/
|
|
144
|
-
url: string;
|
|
145
|
-
}
|
|
146
130
|
export interface Message {
|
|
147
131
|
/**
|
|
148
132
|
* Unique identifier for the message
|
|
@@ -192,7 +176,7 @@ export interface Message {
|
|
|
192
176
|
/**
|
|
193
177
|
* Message parts in order (text and media)
|
|
194
178
|
*/
|
|
195
|
-
parts?: Array<
|
|
179
|
+
parts?: Array<Shared.TextPartResponse | Shared.MediaPartResponse> | null;
|
|
196
180
|
/**
|
|
197
181
|
* Messaging service type
|
|
198
182
|
*/
|
|
@@ -231,64 +215,6 @@ export interface MessageEffect {
|
|
|
231
215
|
*/
|
|
232
216
|
type?: 'screen' | 'bubble';
|
|
233
217
|
}
|
|
234
|
-
export interface Reaction {
|
|
235
|
-
handle: ChatHandle;
|
|
236
|
-
/**
|
|
237
|
-
* Whether this reaction is from the current user
|
|
238
|
-
*/
|
|
239
|
-
is_me: boolean;
|
|
240
|
-
/**
|
|
241
|
-
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
242
|
-
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
243
|
-
* emoji in the custom_emoji field. Sticker reactions have type "sticker" with
|
|
244
|
-
* sticker attachment details in the sticker field.
|
|
245
|
-
*/
|
|
246
|
-
type: ReactionType;
|
|
247
|
-
/**
|
|
248
|
-
* Custom emoji if type is "custom", null otherwise
|
|
249
|
-
*/
|
|
250
|
-
custom_emoji?: string | null;
|
|
251
|
-
/**
|
|
252
|
-
* Sticker attachment details when reaction_type is "sticker". Null for non-sticker
|
|
253
|
-
* reactions.
|
|
254
|
-
*/
|
|
255
|
-
sticker?: Reaction.Sticker | null;
|
|
256
|
-
}
|
|
257
|
-
export declare namespace Reaction {
|
|
258
|
-
/**
|
|
259
|
-
* Sticker attachment details when reaction_type is "sticker". Null for non-sticker
|
|
260
|
-
* reactions.
|
|
261
|
-
*/
|
|
262
|
-
interface Sticker {
|
|
263
|
-
/**
|
|
264
|
-
* Filename of the sticker
|
|
265
|
-
*/
|
|
266
|
-
file_name?: string;
|
|
267
|
-
/**
|
|
268
|
-
* Sticker image height in pixels
|
|
269
|
-
*/
|
|
270
|
-
height?: number;
|
|
271
|
-
/**
|
|
272
|
-
* MIME type of the sticker image
|
|
273
|
-
*/
|
|
274
|
-
mime_type?: string;
|
|
275
|
-
/**
|
|
276
|
-
* Presigned URL for downloading the sticker image (expires in 1 hour).
|
|
277
|
-
*/
|
|
278
|
-
url?: string;
|
|
279
|
-
/**
|
|
280
|
-
* Sticker image width in pixels
|
|
281
|
-
*/
|
|
282
|
-
width?: number;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
287
|
-
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
288
|
-
* emoji in the custom_emoji field. Sticker reactions have type "sticker" with
|
|
289
|
-
* sticker attachment details in the sticker field.
|
|
290
|
-
*/
|
|
291
|
-
export type ReactionType = 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker';
|
|
292
218
|
/**
|
|
293
219
|
* Indicates this message is a threaded reply to another message
|
|
294
220
|
*/
|
|
@@ -304,40 +230,20 @@ export interface ReplyTo {
|
|
|
304
230
|
*/
|
|
305
231
|
part_index?: number;
|
|
306
232
|
}
|
|
307
|
-
/**
|
|
308
|
-
* A text message part
|
|
309
|
-
*/
|
|
310
|
-
export interface TextPart {
|
|
311
|
-
/**
|
|
312
|
-
* Reactions on this message part
|
|
313
|
-
*/
|
|
314
|
-
reactions: Array<Reaction> | null;
|
|
315
|
-
/**
|
|
316
|
-
* Indicates this is a text message part
|
|
317
|
-
*/
|
|
318
|
-
type: 'text';
|
|
319
|
-
/**
|
|
320
|
-
* The text content
|
|
321
|
-
*/
|
|
322
|
-
value: string;
|
|
323
|
-
}
|
|
324
233
|
export interface MessageAddReactionResponse {
|
|
325
234
|
message?: string;
|
|
326
235
|
status?: string;
|
|
327
236
|
trace_id?: string;
|
|
328
237
|
}
|
|
329
|
-
|
|
330
|
-
* Response containing messages in a thread with pagination
|
|
331
|
-
*/
|
|
332
|
-
export interface MessageRetrieveThreadResponse {
|
|
238
|
+
export interface MessageUpdateParams {
|
|
333
239
|
/**
|
|
334
|
-
*
|
|
240
|
+
* New text content for the message part
|
|
335
241
|
*/
|
|
336
|
-
|
|
242
|
+
text: string;
|
|
337
243
|
/**
|
|
338
|
-
*
|
|
244
|
+
* Index of the message part to edit. Defaults to 0.
|
|
339
245
|
*/
|
|
340
|
-
|
|
246
|
+
part_index?: number;
|
|
341
247
|
}
|
|
342
248
|
export interface MessageDeleteParams {
|
|
343
249
|
/**
|
|
@@ -356,7 +262,7 @@ export interface MessageAddReactionParams {
|
|
|
356
262
|
* emoji in the custom_emoji field. Sticker reactions have type "sticker" with
|
|
357
263
|
* sticker attachment details in the sticker field.
|
|
358
264
|
*/
|
|
359
|
-
type: ReactionType;
|
|
265
|
+
type: Shared.ReactionType;
|
|
360
266
|
/**
|
|
361
267
|
* Custom emoji string. Required when type is "custom".
|
|
362
268
|
*/
|
|
@@ -367,21 +273,13 @@ export interface MessageAddReactionParams {
|
|
|
367
273
|
*/
|
|
368
274
|
part_index?: number;
|
|
369
275
|
}
|
|
370
|
-
export interface
|
|
371
|
-
/**
|
|
372
|
-
* Pagination cursor from previous next_cursor response
|
|
373
|
-
*/
|
|
374
|
-
cursor?: string;
|
|
375
|
-
/**
|
|
376
|
-
* Maximum number of messages to return
|
|
377
|
-
*/
|
|
378
|
-
limit?: number;
|
|
276
|
+
export interface MessageListMessagesThreadParams extends ListMessagesPaginationParams {
|
|
379
277
|
/**
|
|
380
278
|
* Sort order for messages (asc = oldest first, desc = newest first)
|
|
381
279
|
*/
|
|
382
280
|
order?: 'asc' | 'desc';
|
|
383
281
|
}
|
|
384
282
|
export declare namespace Messages {
|
|
385
|
-
export { type ChatHandle as ChatHandle, type
|
|
283
|
+
export { type ChatHandle as ChatHandle, type Message as Message, type MessageEffect as MessageEffect, type ReplyTo as ReplyTo, type MessageAddReactionResponse as MessageAddReactionResponse, type MessagesListMessagesPagination as MessagesListMessagesPagination, type MessageUpdateParams as MessageUpdateParams, type MessageDeleteParams as MessageDeleteParams, type MessageAddReactionParams as MessageAddReactionParams, type MessageListMessagesThreadParams as MessageListMessagesThreadParams, };
|
|
386
284
|
}
|
|
387
285
|
//# sourceMappingURL=messages.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,WAAW,EAAE;OAE1E,EAAE,cAAc,EAAE;AAGzB;;;;;;;;GAQG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI1E;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,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;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAC;IAE5B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,+BAAgC,SAAQ,4BAA4B;IACnF;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
package/resources/messages.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import * as Shared from "./shared.js";
|
|
3
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { ListMessagesPagination, type ListMessagesPaginationParams, PagePromise } from "../core/pagination.js";
|
|
4
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
6
|
/**
|
|
6
7
|
* Messages are individual text or multimedia communications within a chat thread.
|
|
@@ -24,6 +25,18 @@ export declare class Messages extends APIResource {
|
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
retrieve(messageID: string, options?: RequestOptions): APIPromise<Message>;
|
|
28
|
+
/**
|
|
29
|
+
* Edit the text content of a specific part of a previously sent message.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const message = await client.messages.update(
|
|
34
|
+
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
35
|
+
* { text: 'This is the edited message content' },
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
update(messageID: string, body: MessageUpdateParams, options?: RequestOptions): APIPromise<Message>;
|
|
27
40
|
/**
|
|
28
41
|
* Deletes a message from the Linq API only. This does NOT unsend or remove the
|
|
29
42
|
* message from the actual chat - recipients will still see the message.
|
|
@@ -73,13 +86,17 @@ export declare class Messages extends APIResource {
|
|
|
73
86
|
*
|
|
74
87
|
* @example
|
|
75
88
|
* ```ts
|
|
76
|
-
*
|
|
89
|
+
* // Automatically fetches more pages as needed.
|
|
90
|
+
* for await (const message of client.messages.listMessagesThread(
|
|
77
91
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
78
|
-
* )
|
|
92
|
+
* )) {
|
|
93
|
+
* // ...
|
|
94
|
+
* }
|
|
79
95
|
* ```
|
|
80
96
|
*/
|
|
81
|
-
|
|
97
|
+
listMessagesThread(messageID: string, query?: MessageListMessagesThreadParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, Message>;
|
|
82
98
|
}
|
|
99
|
+
export type MessagesListMessagesPagination = ListMessagesPagination<Message>;
|
|
83
100
|
export interface ChatHandle {
|
|
84
101
|
/**
|
|
85
102
|
* Unique identifier for this handle
|
|
@@ -110,39 +127,6 @@ export interface ChatHandle {
|
|
|
110
127
|
*/
|
|
111
128
|
status?: 'active' | 'left' | 'removed' | null;
|
|
112
129
|
}
|
|
113
|
-
/**
|
|
114
|
-
* A media attachment part
|
|
115
|
-
*/
|
|
116
|
-
export interface MediaPart {
|
|
117
|
-
/**
|
|
118
|
-
* Unique attachment identifier
|
|
119
|
-
*/
|
|
120
|
-
id: string;
|
|
121
|
-
/**
|
|
122
|
-
* Original filename
|
|
123
|
-
*/
|
|
124
|
-
filename: string;
|
|
125
|
-
/**
|
|
126
|
-
* MIME type of the file
|
|
127
|
-
*/
|
|
128
|
-
mime_type: string;
|
|
129
|
-
/**
|
|
130
|
-
* Reactions on this message part
|
|
131
|
-
*/
|
|
132
|
-
reactions: Array<Reaction> | null;
|
|
133
|
-
/**
|
|
134
|
-
* File size in bytes
|
|
135
|
-
*/
|
|
136
|
-
size_bytes: number;
|
|
137
|
-
/**
|
|
138
|
-
* Indicates this is a media attachment part
|
|
139
|
-
*/
|
|
140
|
-
type: 'media';
|
|
141
|
-
/**
|
|
142
|
-
* Presigned URL for downloading the attachment (expires in 1 hour).
|
|
143
|
-
*/
|
|
144
|
-
url: string;
|
|
145
|
-
}
|
|
146
130
|
export interface Message {
|
|
147
131
|
/**
|
|
148
132
|
* Unique identifier for the message
|
|
@@ -192,7 +176,7 @@ export interface Message {
|
|
|
192
176
|
/**
|
|
193
177
|
* Message parts in order (text and media)
|
|
194
178
|
*/
|
|
195
|
-
parts?: Array<
|
|
179
|
+
parts?: Array<Shared.TextPartResponse | Shared.MediaPartResponse> | null;
|
|
196
180
|
/**
|
|
197
181
|
* Messaging service type
|
|
198
182
|
*/
|
|
@@ -231,64 +215,6 @@ export interface MessageEffect {
|
|
|
231
215
|
*/
|
|
232
216
|
type?: 'screen' | 'bubble';
|
|
233
217
|
}
|
|
234
|
-
export interface Reaction {
|
|
235
|
-
handle: ChatHandle;
|
|
236
|
-
/**
|
|
237
|
-
* Whether this reaction is from the current user
|
|
238
|
-
*/
|
|
239
|
-
is_me: boolean;
|
|
240
|
-
/**
|
|
241
|
-
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
242
|
-
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
243
|
-
* emoji in the custom_emoji field. Sticker reactions have type "sticker" with
|
|
244
|
-
* sticker attachment details in the sticker field.
|
|
245
|
-
*/
|
|
246
|
-
type: ReactionType;
|
|
247
|
-
/**
|
|
248
|
-
* Custom emoji if type is "custom", null otherwise
|
|
249
|
-
*/
|
|
250
|
-
custom_emoji?: string | null;
|
|
251
|
-
/**
|
|
252
|
-
* Sticker attachment details when reaction_type is "sticker". Null for non-sticker
|
|
253
|
-
* reactions.
|
|
254
|
-
*/
|
|
255
|
-
sticker?: Reaction.Sticker | null;
|
|
256
|
-
}
|
|
257
|
-
export declare namespace Reaction {
|
|
258
|
-
/**
|
|
259
|
-
* Sticker attachment details when reaction_type is "sticker". Null for non-sticker
|
|
260
|
-
* reactions.
|
|
261
|
-
*/
|
|
262
|
-
interface Sticker {
|
|
263
|
-
/**
|
|
264
|
-
* Filename of the sticker
|
|
265
|
-
*/
|
|
266
|
-
file_name?: string;
|
|
267
|
-
/**
|
|
268
|
-
* Sticker image height in pixels
|
|
269
|
-
*/
|
|
270
|
-
height?: number;
|
|
271
|
-
/**
|
|
272
|
-
* MIME type of the sticker image
|
|
273
|
-
*/
|
|
274
|
-
mime_type?: string;
|
|
275
|
-
/**
|
|
276
|
-
* Presigned URL for downloading the sticker image (expires in 1 hour).
|
|
277
|
-
*/
|
|
278
|
-
url?: string;
|
|
279
|
-
/**
|
|
280
|
-
* Sticker image width in pixels
|
|
281
|
-
*/
|
|
282
|
-
width?: number;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
|
|
287
|
-
* emphasize, question. Custom emoji reactions have type "custom" with the actual
|
|
288
|
-
* emoji in the custom_emoji field. Sticker reactions have type "sticker" with
|
|
289
|
-
* sticker attachment details in the sticker field.
|
|
290
|
-
*/
|
|
291
|
-
export type ReactionType = 'love' | 'like' | 'dislike' | 'laugh' | 'emphasize' | 'question' | 'custom' | 'sticker';
|
|
292
218
|
/**
|
|
293
219
|
* Indicates this message is a threaded reply to another message
|
|
294
220
|
*/
|
|
@@ -304,40 +230,20 @@ export interface ReplyTo {
|
|
|
304
230
|
*/
|
|
305
231
|
part_index?: number;
|
|
306
232
|
}
|
|
307
|
-
/**
|
|
308
|
-
* A text message part
|
|
309
|
-
*/
|
|
310
|
-
export interface TextPart {
|
|
311
|
-
/**
|
|
312
|
-
* Reactions on this message part
|
|
313
|
-
*/
|
|
314
|
-
reactions: Array<Reaction> | null;
|
|
315
|
-
/**
|
|
316
|
-
* Indicates this is a text message part
|
|
317
|
-
*/
|
|
318
|
-
type: 'text';
|
|
319
|
-
/**
|
|
320
|
-
* The text content
|
|
321
|
-
*/
|
|
322
|
-
value: string;
|
|
323
|
-
}
|
|
324
233
|
export interface MessageAddReactionResponse {
|
|
325
234
|
message?: string;
|
|
326
235
|
status?: string;
|
|
327
236
|
trace_id?: string;
|
|
328
237
|
}
|
|
329
|
-
|
|
330
|
-
* Response containing messages in a thread with pagination
|
|
331
|
-
*/
|
|
332
|
-
export interface MessageRetrieveThreadResponse {
|
|
238
|
+
export interface MessageUpdateParams {
|
|
333
239
|
/**
|
|
334
|
-
*
|
|
240
|
+
* New text content for the message part
|
|
335
241
|
*/
|
|
336
|
-
|
|
242
|
+
text: string;
|
|
337
243
|
/**
|
|
338
|
-
*
|
|
244
|
+
* Index of the message part to edit. Defaults to 0.
|
|
339
245
|
*/
|
|
340
|
-
|
|
246
|
+
part_index?: number;
|
|
341
247
|
}
|
|
342
248
|
export interface MessageDeleteParams {
|
|
343
249
|
/**
|
|
@@ -356,7 +262,7 @@ export interface MessageAddReactionParams {
|
|
|
356
262
|
* emoji in the custom_emoji field. Sticker reactions have type "sticker" with
|
|
357
263
|
* sticker attachment details in the sticker field.
|
|
358
264
|
*/
|
|
359
|
-
type: ReactionType;
|
|
265
|
+
type: Shared.ReactionType;
|
|
360
266
|
/**
|
|
361
267
|
* Custom emoji string. Required when type is "custom".
|
|
362
268
|
*/
|
|
@@ -367,21 +273,13 @@ export interface MessageAddReactionParams {
|
|
|
367
273
|
*/
|
|
368
274
|
part_index?: number;
|
|
369
275
|
}
|
|
370
|
-
export interface
|
|
371
|
-
/**
|
|
372
|
-
* Pagination cursor from previous next_cursor response
|
|
373
|
-
*/
|
|
374
|
-
cursor?: string;
|
|
375
|
-
/**
|
|
376
|
-
* Maximum number of messages to return
|
|
377
|
-
*/
|
|
378
|
-
limit?: number;
|
|
276
|
+
export interface MessageListMessagesThreadParams extends ListMessagesPaginationParams {
|
|
379
277
|
/**
|
|
380
278
|
* Sort order for messages (asc = oldest first, desc = newest first)
|
|
381
279
|
*/
|
|
382
280
|
order?: 'asc' | 'desc';
|
|
383
281
|
}
|
|
384
282
|
export declare namespace Messages {
|
|
385
|
-
export { type ChatHandle as ChatHandle, type
|
|
283
|
+
export { type ChatHandle as ChatHandle, type Message as Message, type MessageEffect as MessageEffect, type ReplyTo as ReplyTo, type MessageAddReactionResponse as MessageAddReactionResponse, type MessagesListMessagesPagination as MessagesListMessagesPagination, type MessageUpdateParams as MessageUpdateParams, type MessageDeleteParams as MessageDeleteParams, type MessageAddReactionParams as MessageAddReactionParams, type MessageListMessagesThreadParams as MessageListMessagesThreadParams, };
|
|
386
284
|
}
|
|
387
285
|
//# sourceMappingURL=messages.d.ts.map
|