@zavudev/sdk 0.55.0 → 0.56.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 +8 -0
- package/client.d.mts +25 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +25 -10
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent-templates.d.mts +97 -0
- package/resources/agent-templates.d.mts.map +1 -0
- package/resources/agent-templates.d.ts +97 -0
- package/resources/agent-templates.d.ts.map +1 -0
- package/resources/agent-templates.js +39 -0
- package/resources/agent-templates.js.map +1 -0
- package/resources/agent-templates.mjs +35 -0
- package/resources/agent-templates.mjs.map +1 -0
- package/resources/agents/agents.d.mts +462 -0
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/agents/agents.d.ts +462 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +129 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +124 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/index.d.mts +3 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +3 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +9 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +4 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/senders.d.mts +54 -0
- package/resources/agents/senders.d.mts.map +1 -0
- package/resources/agents/senders.d.ts +54 -0
- package/resources/agents/senders.d.ts.map +1 -0
- package/resources/agents/senders.js +45 -0
- package/resources/agents/senders.js.map +1 -0
- package/resources/agents/senders.mjs +41 -0
- package/resources/agents/senders.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +6 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +3 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/calls.d.mts +530 -0
- package/resources/calls.d.mts.map +1 -0
- package/resources/calls.d.ts +530 -0
- package/resources/calls.d.ts.map +1 -0
- package/resources/calls.js +76 -0
- package/resources/calls.js.map +1 -0
- package/resources/calls.mjs +72 -0
- package/resources/calls.mjs.map +1 -0
- package/resources/conversations.d.mts +360 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +360 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +47 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +43 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/email-domains.d.mts +260 -0
- package/resources/email-domains.d.mts.map +1 -0
- package/resources/email-domains.d.ts +260 -0
- package/resources/email-domains.d.ts.map +1 -0
- package/resources/email-domains.js +77 -0
- package/resources/email-domains.js.map +1 -0
- package/resources/email-domains.mjs +73 -0
- package/resources/email-domains.mjs.map +1 -0
- package/resources/functions/functions.d.mts +122 -1
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +122 -1
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js +53 -0
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs +53 -0
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/git-link.d.mts +295 -0
- package/resources/functions/git-link.d.mts.map +1 -0
- package/resources/functions/git-link.d.ts +295 -0
- package/resources/functions/git-link.d.ts.map +1 -0
- package/resources/functions/git-link.js +97 -0
- package/resources/functions/git-link.js.map +1 -0
- package/resources/functions/git-link.mjs +93 -0
- package/resources/functions/git-link.mjs.map +1 -0
- package/resources/functions/index.d.mts +3 -1
- package/resources/functions/index.d.mts.map +1 -1
- package/resources/functions/index.d.ts +3 -1
- package/resources/functions/index.d.ts.map +1 -1
- package/resources/functions/index.js +5 -1
- package/resources/functions/index.js.map +1 -1
- package/resources/functions/index.mjs +2 -0
- package/resources/functions/index.mjs.map +1 -1
- package/resources/functions/triggers.d.mts +164 -0
- package/resources/functions/triggers.d.mts.map +1 -0
- package/resources/functions/triggers.d.ts +164 -0
- package/resources/functions/triggers.d.ts.map +1 -0
- package/resources/functions/triggers.js +74 -0
- package/resources/functions/triggers.js.map +1 -0
- package/resources/functions/triggers.mjs +70 -0
- package/resources/functions/triggers.mjs.map +1 -0
- package/resources/index.d.mts +10 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +10 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -1
- package/resources/introspect.d.mts +74 -1
- package/resources/introspect.d.mts.map +1 -1
- package/resources/introspect.d.ts +74 -1
- package/resources/introspect.d.ts.map +1 -1
- package/resources/introspect.js +22 -0
- package/resources/introspect.js.map +1 -1
- package/resources/introspect.mjs +22 -0
- package/resources/introspect.mjs.map +1 -1
- package/resources/messages.d.mts +54 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +54 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +18 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +18 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/senders/agent/agent.d.mts +4 -3
- package/resources/senders/agent/agent.d.mts.map +1 -1
- package/resources/senders/agent/agent.d.ts +4 -3
- package/resources/senders/agent/agent.d.ts.map +1 -1
- package/resources/senders/agent/agent.js +2 -2
- package/resources/senders/agent/agent.js.map +1 -1
- package/resources/senders/agent/agent.mjs +2 -2
- package/resources/senders/agent/agent.mjs.map +1 -1
- package/resources/senders/agent/index.d.mts +2 -2
- package/resources/senders/agent/index.d.mts.map +1 -1
- package/resources/senders/agent/index.d.ts +2 -2
- package/resources/senders/agent/index.d.ts.map +1 -1
- package/resources/senders/agent/index.js +2 -2
- package/resources/senders/agent/index.js.map +1 -1
- package/resources/senders/agent/index.mjs +1 -1
- package/resources/senders/agent/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts +56 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts +56 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.js +33 -0
- package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.mjs +33 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +2 -2
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +2 -2
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/tools/index.d.mts +3 -0
- package/resources/senders/agent/tools/index.d.mts.map +1 -0
- package/resources/senders/agent/tools/index.d.ts +3 -0
- package/resources/senders/agent/tools/index.d.ts.map +1 -0
- package/resources/senders/agent/tools/index.js +9 -0
- package/resources/senders/agent/tools/index.js.map +1 -0
- package/resources/senders/agent/tools/index.mjs +4 -0
- package/resources/senders/agent/tools/index.mjs.map +1 -0
- package/resources/senders/agent/tools/tools.d.mts +338 -0
- package/resources/senders/agent/tools/tools.d.mts.map +1 -0
- package/resources/senders/agent/tools/tools.d.ts +338 -0
- package/resources/senders/agent/tools/tools.d.ts.map +1 -0
- package/resources/senders/agent/tools/tools.js +163 -0
- package/resources/senders/agent/tools/tools.js.map +1 -0
- package/resources/senders/agent/tools/tools.mjs +158 -0
- package/resources/senders/agent/tools/tools.mjs.map +1 -0
- package/resources/senders/agent/tools/webhook.d.mts +28 -0
- package/resources/senders/agent/tools/webhook.d.mts.map +1 -0
- package/resources/senders/agent/tools/webhook.d.ts +28 -0
- package/resources/senders/agent/tools/webhook.d.ts.map +1 -0
- package/resources/senders/agent/tools/webhook.js +28 -0
- package/resources/senders/agent/tools/webhook.js.map +1 -0
- package/resources/senders/agent/tools/webhook.mjs +24 -0
- package/resources/senders/agent/tools/webhook.mjs.map +1 -0
- package/resources/senders/agent/tools.d.mts +1 -270
- package/resources/senders/agent/tools.d.mts.map +1 -1
- package/resources/senders/agent/tools.d.ts +1 -270
- package/resources/senders/agent/tools.d.ts.map +1 -1
- package/resources/senders/agent/tools.js +2 -131
- package/resources/senders/agent/tools.js.map +1 -1
- package/resources/senders/agent/tools.mjs +1 -129
- package/resources/senders/agent/tools.mjs.map +1 -1
- package/resources/senders/index.d.mts +2 -1
- package/resources/senders/index.d.mts.map +1 -1
- package/resources/senders/index.d.ts +2 -1
- package/resources/senders/index.d.ts.map +1 -1
- package/resources/senders/index.js +3 -1
- package/resources/senders/index.js.map +1 -1
- package/resources/senders/index.mjs +1 -0
- package/resources/senders/index.mjs.map +1 -1
- package/resources/senders/senders.d.mts +4 -0
- package/resources/senders/senders.d.mts.map +1 -1
- package/resources/senders/senders.d.ts +4 -0
- package/resources/senders/senders.d.ts.map +1 -1
- package/resources/senders/senders.js +4 -0
- package/resources/senders/senders.js.map +1 -1
- package/resources/senders/senders.mjs +4 -0
- package/resources/senders/senders.mjs.map +1 -1
- package/resources/senders/telegram.d.mts +48 -0
- package/resources/senders/telegram.d.mts.map +1 -0
- package/resources/senders/telegram.d.ts +48 -0
- package/resources/senders/telegram.d.ts.map +1 -0
- package/resources/senders/telegram.js +41 -0
- package/resources/senders/telegram.js.map +1 -0
- package/resources/senders/telegram.mjs +37 -0
- package/resources/senders/telegram.mjs.map +1 -0
- package/resources/templates.d.mts +66 -1
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +66 -1
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +31 -0
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +31 -0
- package/resources/templates.mjs.map +1 -1
- package/resources/urls.d.mts +24 -1
- package/resources/urls.d.mts.map +1 -1
- package/resources/urls.d.ts +24 -1
- package/resources/urls.d.ts.map +1 -1
- package/resources/urls.js +15 -0
- package/resources/urls.js.map +1 -1
- package/resources/urls.mjs +15 -0
- package/resources/urls.mjs.map +1 -1
- package/src/client.ts +129 -0
- package/src/resources/agent-templates.ts +128 -0
- package/src/resources/agents/agents.ts +603 -0
- package/src/resources/agents/index.ts +21 -0
- package/src/resources/agents/senders.ts +79 -0
- package/src/resources/agents.ts +3 -0
- package/src/resources/calls.ts +638 -0
- package/src/resources/conversations.ts +472 -0
- package/src/resources/email-domains.ts +337 -0
- package/src/resources/functions/functions.ts +202 -0
- package/src/resources/functions/git-link.ts +398 -0
- package/src/resources/functions/index.ts +22 -0
- package/src/resources/functions/triggers.ts +227 -0
- package/src/resources/index.ts +57 -0
- package/src/resources/introspect.ts +105 -0
- package/src/resources/messages.ts +66 -0
- package/src/resources/senders/agent/agent.ts +23 -17
- package/src/resources/senders/agent/index.ts +4 -1
- package/src/resources/senders/agent/knowledge-bases/documents.ts +89 -0
- package/src/resources/senders/agent/knowledge-bases/index.ts +4 -0
- package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +8 -0
- package/src/resources/senders/agent/tools/index.ts +21 -0
- package/src/resources/senders/agent/tools/tools.ts +460 -0
- package/src/resources/senders/agent/tools/webhook.ts +40 -0
- package/src/resources/senders/agent/tools.ts +1 -364
- package/src/resources/senders/index.ts +2 -0
- package/src/resources/senders/senders.ts +10 -0
- package/src/resources/senders/telegram.ts +73 -0
- package/src/resources/templates.ts +80 -0
- package/src/resources/urls.ts +35 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.mjs","sourceRoot":"","sources":["../src/resources/calls.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,MAAM,EAAkC,+BAA2B;AAE5E,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,MAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,SAAS,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as MessagesAPI from "./messages.mjs";
|
|
3
|
+
import { MessagesCursor } from "./messages.mjs";
|
|
4
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
|
|
6
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
7
|
+
export declare class Conversations extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get conversation
|
|
10
|
+
*/
|
|
11
|
+
retrieve(conversationID: string, options?: RequestOptions): APIPromise<ConversationRetrieveResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* List inbox threads, most recently active first. A conversation groups every
|
|
14
|
+
* message with one contact across channels, which is what you need to build an
|
|
15
|
+
* inbox: `GET /v1/messages` returns a flat log with no thread to hang it on.
|
|
16
|
+
*
|
|
17
|
+
* Use `senderId` to scope the list to a single number, and `channel` to keep only
|
|
18
|
+
* threads that have carried that channel.
|
|
19
|
+
*/
|
|
20
|
+
list(query?: ConversationListParams | null | undefined, options?: RequestOptions): PagePromise<ConversationListResponsesCursor, ConversationListResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Messages in this thread, newest first, across every channel it has carried.
|
|
23
|
+
* Reply with `POST /v1/messages`, passing the conversation's `senderId` as the
|
|
24
|
+
* `Zavu-Sender` header so the answer leaves from the number the contact already
|
|
25
|
+
* knows.
|
|
26
|
+
*/
|
|
27
|
+
listMessages(conversationID: string, query?: ConversationListMessagesParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, MessagesAPI.Message>;
|
|
28
|
+
/**
|
|
29
|
+
* Reset the thread's `unreadCount` to zero. Marks the thread read in your own
|
|
30
|
+
* inbox only: it does not send a read receipt to the contact.
|
|
31
|
+
*/
|
|
32
|
+
markAsRead(conversationID: string, options?: RequestOptions): APIPromise<ConversationMarkAsReadResponse>;
|
|
33
|
+
}
|
|
34
|
+
export type ConversationListResponsesCursor = Cursor<ConversationListResponse>;
|
|
35
|
+
export interface ConversationRetrieveResponse {
|
|
36
|
+
/**
|
|
37
|
+
* An inbox thread with one contact. A conversation groups every message exchanged
|
|
38
|
+
* with that contact across channels, so a contact who writes on WhatsApp and later
|
|
39
|
+
* by email stays in one thread.
|
|
40
|
+
*/
|
|
41
|
+
conversation: ConversationRetrieveResponse.Conversation;
|
|
42
|
+
}
|
|
43
|
+
export declare namespace ConversationRetrieveResponse {
|
|
44
|
+
/**
|
|
45
|
+
* An inbox thread with one contact. A conversation groups every message exchanged
|
|
46
|
+
* with that contact across channels, so a contact who writes on WhatsApp and later
|
|
47
|
+
* by email stays in one thread.
|
|
48
|
+
*/
|
|
49
|
+
interface Conversation {
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Every channel this thread has carried messages on.
|
|
53
|
+
*/
|
|
54
|
+
channels: Array<string>;
|
|
55
|
+
/**
|
|
56
|
+
* The key this thread is filed under: a phone number in E.164, a WhatsApp
|
|
57
|
+
* business-scoped user ID (BSUID), a numeric chat ID
|
|
58
|
+
* (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number,
|
|
59
|
+
* so do not parse it as one.
|
|
60
|
+
*/
|
|
61
|
+
contactIdentifier: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
/**
|
|
64
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
65
|
+
* fetch.
|
|
66
|
+
*/
|
|
67
|
+
lastMessage: Conversation.LastMessage;
|
|
68
|
+
messageCount: number;
|
|
69
|
+
/**
|
|
70
|
+
* Inbound messages not yet marked read. Reset with POST
|
|
71
|
+
* /v1/conversations/{conversationId}/read.
|
|
72
|
+
*/
|
|
73
|
+
unreadCount: number;
|
|
74
|
+
updatedAt: string;
|
|
75
|
+
/**
|
|
76
|
+
* ID of the contact this thread belongs to. Absent on group threads and on threads
|
|
77
|
+
* whose contact has not been resolved yet.
|
|
78
|
+
*/
|
|
79
|
+
contactId?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Email address of the thread, when the contact was reached by email.
|
|
82
|
+
*/
|
|
83
|
+
email?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Present when the thread is a group chat rather than a one-to-one conversation.
|
|
86
|
+
*/
|
|
87
|
+
group?: Conversation.Group;
|
|
88
|
+
/**
|
|
89
|
+
* Sender that last handled this thread. Use it as the `Zavu-Sender` header when
|
|
90
|
+
* replying so the answer leaves from the same number the contact knows.
|
|
91
|
+
*/
|
|
92
|
+
senderId?: string;
|
|
93
|
+
/**
|
|
94
|
+
* WhatsApp identity, present when the contact adopted a username.
|
|
95
|
+
*/
|
|
96
|
+
whatsapp?: Conversation.Whatsapp;
|
|
97
|
+
}
|
|
98
|
+
namespace Conversation {
|
|
99
|
+
/**
|
|
100
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
101
|
+
* fetch.
|
|
102
|
+
*/
|
|
103
|
+
interface LastMessage {
|
|
104
|
+
id: string;
|
|
105
|
+
at: string;
|
|
106
|
+
/**
|
|
107
|
+
* Delivery channel. Use 'auto' for intelligent routing.
|
|
108
|
+
*/
|
|
109
|
+
channel: MessagesAPI.Channel;
|
|
110
|
+
direction: 'inbound' | 'outbound';
|
|
111
|
+
/**
|
|
112
|
+
* Text or caption. Empty when the last message carried no text (e.g. media).
|
|
113
|
+
*/
|
|
114
|
+
text: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Present when the thread is a group chat rather than a one-to-one conversation.
|
|
118
|
+
*/
|
|
119
|
+
interface Group {
|
|
120
|
+
id: string;
|
|
121
|
+
participantCount?: number;
|
|
122
|
+
subject?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* WhatsApp identity, present when the contact adopted a username.
|
|
126
|
+
*/
|
|
127
|
+
interface Whatsapp {
|
|
128
|
+
/**
|
|
129
|
+
* Business-scoped user ID. Can be used as `to` when sending.
|
|
130
|
+
*/
|
|
131
|
+
bsuid?: string;
|
|
132
|
+
username?: string;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* An inbox thread with one contact. A conversation groups every message exchanged
|
|
138
|
+
* with that contact across channels, so a contact who writes on WhatsApp and later
|
|
139
|
+
* by email stays in one thread.
|
|
140
|
+
*/
|
|
141
|
+
export interface ConversationListResponse {
|
|
142
|
+
id: string;
|
|
143
|
+
/**
|
|
144
|
+
* Every channel this thread has carried messages on.
|
|
145
|
+
*/
|
|
146
|
+
channels: Array<string>;
|
|
147
|
+
/**
|
|
148
|
+
* The key this thread is filed under: a phone number in E.164, a WhatsApp
|
|
149
|
+
* business-scoped user ID (BSUID), a numeric chat ID
|
|
150
|
+
* (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number,
|
|
151
|
+
* so do not parse it as one.
|
|
152
|
+
*/
|
|
153
|
+
contactIdentifier: string;
|
|
154
|
+
createdAt: string;
|
|
155
|
+
/**
|
|
156
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
157
|
+
* fetch.
|
|
158
|
+
*/
|
|
159
|
+
lastMessage: ConversationListResponse.LastMessage;
|
|
160
|
+
messageCount: number;
|
|
161
|
+
/**
|
|
162
|
+
* Inbound messages not yet marked read. Reset with POST
|
|
163
|
+
* /v1/conversations/{conversationId}/read.
|
|
164
|
+
*/
|
|
165
|
+
unreadCount: number;
|
|
166
|
+
updatedAt: string;
|
|
167
|
+
/**
|
|
168
|
+
* ID of the contact this thread belongs to. Absent on group threads and on threads
|
|
169
|
+
* whose contact has not been resolved yet.
|
|
170
|
+
*/
|
|
171
|
+
contactId?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Email address of the thread, when the contact was reached by email.
|
|
174
|
+
*/
|
|
175
|
+
email?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Present when the thread is a group chat rather than a one-to-one conversation.
|
|
178
|
+
*/
|
|
179
|
+
group?: ConversationListResponse.Group;
|
|
180
|
+
/**
|
|
181
|
+
* Sender that last handled this thread. Use it as the `Zavu-Sender` header when
|
|
182
|
+
* replying so the answer leaves from the same number the contact knows.
|
|
183
|
+
*/
|
|
184
|
+
senderId?: string;
|
|
185
|
+
/**
|
|
186
|
+
* WhatsApp identity, present when the contact adopted a username.
|
|
187
|
+
*/
|
|
188
|
+
whatsapp?: ConversationListResponse.Whatsapp;
|
|
189
|
+
}
|
|
190
|
+
export declare namespace ConversationListResponse {
|
|
191
|
+
/**
|
|
192
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
193
|
+
* fetch.
|
|
194
|
+
*/
|
|
195
|
+
interface LastMessage {
|
|
196
|
+
id: string;
|
|
197
|
+
at: string;
|
|
198
|
+
/**
|
|
199
|
+
* Delivery channel. Use 'auto' for intelligent routing.
|
|
200
|
+
*/
|
|
201
|
+
channel: MessagesAPI.Channel;
|
|
202
|
+
direction: 'inbound' | 'outbound';
|
|
203
|
+
/**
|
|
204
|
+
* Text or caption. Empty when the last message carried no text (e.g. media).
|
|
205
|
+
*/
|
|
206
|
+
text: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Present when the thread is a group chat rather than a one-to-one conversation.
|
|
210
|
+
*/
|
|
211
|
+
interface Group {
|
|
212
|
+
id: string;
|
|
213
|
+
participantCount?: number;
|
|
214
|
+
subject?: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* WhatsApp identity, present when the contact adopted a username.
|
|
218
|
+
*/
|
|
219
|
+
interface Whatsapp {
|
|
220
|
+
/**
|
|
221
|
+
* Business-scoped user ID. Can be used as `to` when sending.
|
|
222
|
+
*/
|
|
223
|
+
bsuid?: string;
|
|
224
|
+
username?: string;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
export interface ConversationMarkAsReadResponse {
|
|
228
|
+
/**
|
|
229
|
+
* An inbox thread with one contact. A conversation groups every message exchanged
|
|
230
|
+
* with that contact across channels, so a contact who writes on WhatsApp and later
|
|
231
|
+
* by email stays in one thread.
|
|
232
|
+
*/
|
|
233
|
+
conversation: ConversationMarkAsReadResponse.Conversation;
|
|
234
|
+
}
|
|
235
|
+
export declare namespace ConversationMarkAsReadResponse {
|
|
236
|
+
/**
|
|
237
|
+
* An inbox thread with one contact. A conversation groups every message exchanged
|
|
238
|
+
* with that contact across channels, so a contact who writes on WhatsApp and later
|
|
239
|
+
* by email stays in one thread.
|
|
240
|
+
*/
|
|
241
|
+
interface Conversation {
|
|
242
|
+
id: string;
|
|
243
|
+
/**
|
|
244
|
+
* Every channel this thread has carried messages on.
|
|
245
|
+
*/
|
|
246
|
+
channels: Array<string>;
|
|
247
|
+
/**
|
|
248
|
+
* The key this thread is filed under: a phone number in E.164, a WhatsApp
|
|
249
|
+
* business-scoped user ID (BSUID), a numeric chat ID
|
|
250
|
+
* (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number,
|
|
251
|
+
* so do not parse it as one.
|
|
252
|
+
*/
|
|
253
|
+
contactIdentifier: string;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
/**
|
|
256
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
257
|
+
* fetch.
|
|
258
|
+
*/
|
|
259
|
+
lastMessage: Conversation.LastMessage;
|
|
260
|
+
messageCount: number;
|
|
261
|
+
/**
|
|
262
|
+
* Inbound messages not yet marked read. Reset with POST
|
|
263
|
+
* /v1/conversations/{conversationId}/read.
|
|
264
|
+
*/
|
|
265
|
+
unreadCount: number;
|
|
266
|
+
updatedAt: string;
|
|
267
|
+
/**
|
|
268
|
+
* ID of the contact this thread belongs to. Absent on group threads and on threads
|
|
269
|
+
* whose contact has not been resolved yet.
|
|
270
|
+
*/
|
|
271
|
+
contactId?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Email address of the thread, when the contact was reached by email.
|
|
274
|
+
*/
|
|
275
|
+
email?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Present when the thread is a group chat rather than a one-to-one conversation.
|
|
278
|
+
*/
|
|
279
|
+
group?: Conversation.Group;
|
|
280
|
+
/**
|
|
281
|
+
* Sender that last handled this thread. Use it as the `Zavu-Sender` header when
|
|
282
|
+
* replying so the answer leaves from the same number the contact knows.
|
|
283
|
+
*/
|
|
284
|
+
senderId?: string;
|
|
285
|
+
/**
|
|
286
|
+
* WhatsApp identity, present when the contact adopted a username.
|
|
287
|
+
*/
|
|
288
|
+
whatsapp?: Conversation.Whatsapp;
|
|
289
|
+
}
|
|
290
|
+
namespace Conversation {
|
|
291
|
+
/**
|
|
292
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
293
|
+
* fetch.
|
|
294
|
+
*/
|
|
295
|
+
interface LastMessage {
|
|
296
|
+
id: string;
|
|
297
|
+
at: string;
|
|
298
|
+
/**
|
|
299
|
+
* Delivery channel. Use 'auto' for intelligent routing.
|
|
300
|
+
*/
|
|
301
|
+
channel: MessagesAPI.Channel;
|
|
302
|
+
direction: 'inbound' | 'outbound';
|
|
303
|
+
/**
|
|
304
|
+
* Text or caption. Empty when the last message carried no text (e.g. media).
|
|
305
|
+
*/
|
|
306
|
+
text: string;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Present when the thread is a group chat rather than a one-to-one conversation.
|
|
310
|
+
*/
|
|
311
|
+
interface Group {
|
|
312
|
+
id: string;
|
|
313
|
+
participantCount?: number;
|
|
314
|
+
subject?: string;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* WhatsApp identity, present when the contact adopted a username.
|
|
318
|
+
*/
|
|
319
|
+
interface Whatsapp {
|
|
320
|
+
/**
|
|
321
|
+
* Business-scoped user ID. Can be used as `to` when sending.
|
|
322
|
+
*/
|
|
323
|
+
bsuid?: string;
|
|
324
|
+
username?: string;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
export interface ConversationListParams extends CursorParams {
|
|
329
|
+
/**
|
|
330
|
+
* Keep only threads that have carried this channel.
|
|
331
|
+
*/
|
|
332
|
+
channel?: 'sms' | 'sms_oneway' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
|
|
333
|
+
/**
|
|
334
|
+
* Search threads by identity: phone number (any format — `+1 (555) 123-4567` and
|
|
335
|
+
* `15551234567` both match), email address (full or local part), WhatsApp group
|
|
336
|
+
* subject, WhatsApp username, or BSUID. Matching is by whole word, with prefix
|
|
337
|
+
* matching on the last term, so `mar` finds `maria@example.com` and `+1555` finds
|
|
338
|
+
* `+15551234567`; a fragment from the middle or end of a number (`4567`) does not
|
|
339
|
+
* match.
|
|
340
|
+
*
|
|
341
|
+
* It does **not** search message bodies — only who the thread is with.
|
|
342
|
+
*
|
|
343
|
+
* Results come back ranked by relevance rather than by recency, so the usual "most
|
|
344
|
+
* recently active first" ordering does not apply while `q` is set. `senderId` and
|
|
345
|
+
* `channel` still narrow the results, and `cursor` paginates them as usual. An
|
|
346
|
+
* empty or whitespace-only `q` returns no items rather than the full list.
|
|
347
|
+
*/
|
|
348
|
+
search?: string;
|
|
349
|
+
/**
|
|
350
|
+
* Keep only threads last handled by this sender.
|
|
351
|
+
*/
|
|
352
|
+
senderId?: string;
|
|
353
|
+
}
|
|
354
|
+
export interface ConversationListMessagesParams extends CursorParams {
|
|
355
|
+
}
|
|
356
|
+
export declare namespace Conversations {
|
|
357
|
+
export { type ConversationRetrieveResponse as ConversationRetrieveResponse, type ConversationListResponse as ConversationListResponse, type ConversationMarkAsReadResponse as ConversationMarkAsReadResponse, type ConversationListResponsesCursor as ConversationListResponsesCursor, type ConversationListParams as ConversationListParams, type ConversationListMessagesParams as ConversationListMessagesParams, };
|
|
358
|
+
}
|
|
359
|
+
export { type MessagesCursor };
|
|
360
|
+
//# sourceMappingURL=conversations.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.mts","sourceRoot":"","sources":["../src/resources/conversations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAAE,cAAc,EAA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