@marktoflow/integrations 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -16
- package/dist/adapters/claude-agent-types.d.ts +28 -28
- package/dist/adapters/claude-agent-workflow.d.ts +16 -16
- package/dist/adapters/codex-types.d.ts +6 -6
- package/dist/adapters/codex-workflow.d.ts +16 -16
- package/dist/adapters/github-copilot-types.d.ts +22 -22
- package/dist/adapters/github-copilot-workflow.d.ts +14 -14
- package/dist/adapters/ollama-types.d.ts +42 -42
- package/dist/adapters/openai-types.d.ts +552 -33
- package/dist/adapters/openai-types.d.ts.map +1 -1
- package/dist/adapters/openai-types.js +58 -5
- package/dist/adapters/openai-types.js.map +1 -1
- package/dist/adapters/openai.d.ts +59 -5
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +211 -32
- package/dist/adapters/openai.js.map +1 -1
- package/dist/services/playwright/client.d.ts +110 -0
- package/dist/services/playwright/client.d.ts.map +1 -0
- package/dist/services/playwright/client.js +690 -0
- package/dist/services/playwright/client.js.map +1 -0
- package/dist/services/playwright/index.d.ts +7 -0
- package/dist/services/playwright/index.d.ts.map +1 -0
- package/dist/services/playwright/index.js +7 -0
- package/dist/services/playwright/index.js.map +1 -0
- package/dist/services/playwright/initializer.d.ts +24 -0
- package/dist/services/playwright/initializer.d.ts.map +1 -0
- package/dist/services/playwright/initializer.js +99 -0
- package/dist/services/playwright/initializer.js.map +1 -0
- package/dist/services/playwright/types.d.ts +270 -0
- package/dist/services/playwright/types.d.ts.map +1 -0
- package/dist/services/playwright/types.js +5 -0
- package/dist/services/playwright/types.js.map +1 -0
- package/dist/services/playwright.d.ts +3 -675
- package/dist/services/playwright.d.ts.map +1 -1
- package/dist/services/playwright.js +3 -1138
- package/dist/services/playwright.js.map +1 -1
- package/package.json +25 -7
- package/dist/adapters/claude-agent-hooks.d.ts +0 -176
- package/dist/services/github.d.ts +0 -3
- package/dist/services/gmail-trigger.d.ts +0 -92
- package/dist/services/gmail.d.ts +0 -116
- package/dist/services/google-calendar.d.ts +0 -220
- package/dist/services/google-docs.d.ts +0 -197
- package/dist/services/google-drive.d.ts +0 -149
- package/dist/services/google-sheets.d.ts +0 -165
- package/dist/services/http.d.ts +0 -120
- package/dist/services/jira.d.ts +0 -3
- package/dist/services/linear.d.ts +0 -163
- package/dist/services/mysql.d.ts +0 -91
- package/dist/services/outlook-trigger.d.ts +0 -121
- package/dist/services/outlook.d.ts +0 -237
- package/dist/services/postgres.d.ts +0 -83
- package/dist/services/slack-socket.d.ts +0 -18
- package/dist/services/slack.d.ts +0 -3
- package/dist/services/whatsapp.d.ts +0 -311
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { Client } from '@microsoft/microsoft-graph-client';
|
|
2
|
-
import { SDKInitializer } from '@marktoflow/core';
|
|
3
|
-
export interface OutlookEmail {
|
|
4
|
-
id: string;
|
|
5
|
-
conversationId: string;
|
|
6
|
-
subject: string;
|
|
7
|
-
from: string;
|
|
8
|
-
fromAddress: string;
|
|
9
|
-
to: {
|
|
10
|
-
name: string;
|
|
11
|
-
address: string;
|
|
12
|
-
}[];
|
|
13
|
-
cc?: {
|
|
14
|
-
name: string;
|
|
15
|
-
address: string;
|
|
16
|
-
}[];
|
|
17
|
-
bcc?: {
|
|
18
|
-
name: string;
|
|
19
|
-
address: string;
|
|
20
|
-
}[];
|
|
21
|
-
receivedDateTime: string;
|
|
22
|
-
sentDateTime?: string;
|
|
23
|
-
bodyPreview: string;
|
|
24
|
-
body?: string;
|
|
25
|
-
bodyHtml?: string;
|
|
26
|
-
isRead: boolean;
|
|
27
|
-
hasAttachments: boolean;
|
|
28
|
-
importance: 'low' | 'normal' | 'high';
|
|
29
|
-
categories: string[];
|
|
30
|
-
webLink?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface GetEmailsOptions {
|
|
33
|
-
folder?: string;
|
|
34
|
-
filter?: string;
|
|
35
|
-
select?: string[];
|
|
36
|
-
top?: number;
|
|
37
|
-
skip?: number;
|
|
38
|
-
orderBy?: string;
|
|
39
|
-
search?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface SendEmailOptions {
|
|
42
|
-
to: string | string[] | {
|
|
43
|
-
name?: string;
|
|
44
|
-
address: string;
|
|
45
|
-
}[];
|
|
46
|
-
subject: string;
|
|
47
|
-
body: string;
|
|
48
|
-
bodyType?: 'text' | 'html';
|
|
49
|
-
cc?: string | string[] | {
|
|
50
|
-
name?: string;
|
|
51
|
-
address: string;
|
|
52
|
-
}[];
|
|
53
|
-
bcc?: string | string[] | {
|
|
54
|
-
name?: string;
|
|
55
|
-
address: string;
|
|
56
|
-
}[];
|
|
57
|
-
importance?: 'low' | 'normal' | 'high';
|
|
58
|
-
saveToSentItems?: boolean;
|
|
59
|
-
replyTo?: string | {
|
|
60
|
-
name?: string;
|
|
61
|
-
address: string;
|
|
62
|
-
}[];
|
|
63
|
-
}
|
|
64
|
-
export interface CreateDraftOptions {
|
|
65
|
-
to?: string | string[] | {
|
|
66
|
-
name?: string;
|
|
67
|
-
address: string;
|
|
68
|
-
}[];
|
|
69
|
-
subject?: string;
|
|
70
|
-
body?: string;
|
|
71
|
-
bodyType?: 'text' | 'html';
|
|
72
|
-
cc?: string | string[] | {
|
|
73
|
-
name?: string;
|
|
74
|
-
address: string;
|
|
75
|
-
}[];
|
|
76
|
-
bcc?: string | string[] | {
|
|
77
|
-
name?: string;
|
|
78
|
-
address: string;
|
|
79
|
-
}[];
|
|
80
|
-
importance?: 'low' | 'normal' | 'high';
|
|
81
|
-
}
|
|
82
|
-
export interface CalendarEvent {
|
|
83
|
-
id: string;
|
|
84
|
-
subject: string;
|
|
85
|
-
body?: string;
|
|
86
|
-
bodyHtml?: string;
|
|
87
|
-
start: {
|
|
88
|
-
dateTime: string;
|
|
89
|
-
timeZone: string;
|
|
90
|
-
};
|
|
91
|
-
end: {
|
|
92
|
-
dateTime: string;
|
|
93
|
-
timeZone: string;
|
|
94
|
-
};
|
|
95
|
-
location?: string;
|
|
96
|
-
attendees: {
|
|
97
|
-
name: string;
|
|
98
|
-
address: string;
|
|
99
|
-
type: string;
|
|
100
|
-
}[];
|
|
101
|
-
organizer?: {
|
|
102
|
-
name: string;
|
|
103
|
-
address: string;
|
|
104
|
-
};
|
|
105
|
-
isOnlineMeeting: boolean;
|
|
106
|
-
onlineMeetingUrl?: string;
|
|
107
|
-
webLink?: string;
|
|
108
|
-
}
|
|
109
|
-
export interface GetEventsOptions {
|
|
110
|
-
startDateTime?: string;
|
|
111
|
-
endDateTime?: string;
|
|
112
|
-
top?: number;
|
|
113
|
-
skip?: number;
|
|
114
|
-
filter?: string;
|
|
115
|
-
orderBy?: string;
|
|
116
|
-
}
|
|
117
|
-
export interface CreateEventOptions {
|
|
118
|
-
subject: string;
|
|
119
|
-
body?: string;
|
|
120
|
-
bodyType?: 'text' | 'html';
|
|
121
|
-
start: {
|
|
122
|
-
dateTime: string;
|
|
123
|
-
timeZone?: string;
|
|
124
|
-
};
|
|
125
|
-
end: {
|
|
126
|
-
dateTime: string;
|
|
127
|
-
timeZone?: string;
|
|
128
|
-
};
|
|
129
|
-
location?: string;
|
|
130
|
-
attendees?: (string | {
|
|
131
|
-
name?: string;
|
|
132
|
-
address: string;
|
|
133
|
-
})[];
|
|
134
|
-
isOnlineMeeting?: boolean;
|
|
135
|
-
reminderMinutesBeforeStart?: number;
|
|
136
|
-
}
|
|
137
|
-
export interface OutlookDraft {
|
|
138
|
-
id: string;
|
|
139
|
-
conversationId?: string;
|
|
140
|
-
webLink?: string;
|
|
141
|
-
}
|
|
142
|
-
export interface GetEmailsResult {
|
|
143
|
-
emails: OutlookEmail[];
|
|
144
|
-
nextLink?: string;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Outlook actions for workflow integration (Email + Calendar)
|
|
148
|
-
*/
|
|
149
|
-
export declare class OutlookActions {
|
|
150
|
-
private client;
|
|
151
|
-
constructor(client: Client);
|
|
152
|
-
/**
|
|
153
|
-
* Get emails from Outlook mailbox
|
|
154
|
-
*/
|
|
155
|
-
getEmails(options?: GetEmailsOptions): Promise<GetEmailsResult>;
|
|
156
|
-
/**
|
|
157
|
-
* Get a specific email by ID
|
|
158
|
-
*/
|
|
159
|
-
getEmail(id: string): Promise<OutlookEmail>;
|
|
160
|
-
/**
|
|
161
|
-
* Send an email via Outlook
|
|
162
|
-
*/
|
|
163
|
-
sendEmail(options: SendEmailOptions): Promise<void>;
|
|
164
|
-
/**
|
|
165
|
-
* Create a draft email in Outlook
|
|
166
|
-
*/
|
|
167
|
-
createDraft(options: CreateDraftOptions): Promise<OutlookDraft>;
|
|
168
|
-
/**
|
|
169
|
-
* Reply to an email
|
|
170
|
-
*/
|
|
171
|
-
reply(messageId: string, body: string, bodyType?: 'text' | 'html', replyAll?: boolean): Promise<void>;
|
|
172
|
-
/**
|
|
173
|
-
* Forward an email
|
|
174
|
-
*/
|
|
175
|
-
forward(messageId: string, to: string | string[] | {
|
|
176
|
-
name?: string;
|
|
177
|
-
address: string;
|
|
178
|
-
}[], comment?: string): Promise<void>;
|
|
179
|
-
/**
|
|
180
|
-
* Mark an email as read
|
|
181
|
-
*/
|
|
182
|
-
markAsRead(id: string): Promise<void>;
|
|
183
|
-
/**
|
|
184
|
-
* Mark an email as unread
|
|
185
|
-
*/
|
|
186
|
-
markAsUnread(id: string): Promise<void>;
|
|
187
|
-
/**
|
|
188
|
-
* Move an email to a folder
|
|
189
|
-
*/
|
|
190
|
-
moveToFolder(messageId: string, destinationFolderId: string): Promise<void>;
|
|
191
|
-
/**
|
|
192
|
-
* Delete an email (move to deleted items)
|
|
193
|
-
*/
|
|
194
|
-
delete(id: string): Promise<void>;
|
|
195
|
-
/**
|
|
196
|
-
* List mail folders
|
|
197
|
-
*/
|
|
198
|
-
listFolders(): Promise<{
|
|
199
|
-
id: string;
|
|
200
|
-
displayName: string;
|
|
201
|
-
totalItemCount: number;
|
|
202
|
-
}[]>;
|
|
203
|
-
/**
|
|
204
|
-
* Get calendar events
|
|
205
|
-
*/
|
|
206
|
-
getEvents(options?: GetEventsOptions): Promise<CalendarEvent[]>;
|
|
207
|
-
/**
|
|
208
|
-
* Get a specific calendar event by ID
|
|
209
|
-
*/
|
|
210
|
-
getEvent(id: string): Promise<CalendarEvent>;
|
|
211
|
-
/**
|
|
212
|
-
* Create a calendar event
|
|
213
|
-
*/
|
|
214
|
-
createEvent(options: CreateEventOptions): Promise<CalendarEvent>;
|
|
215
|
-
/**
|
|
216
|
-
* Update a calendar event
|
|
217
|
-
*/
|
|
218
|
-
updateEvent(id: string, updates: Partial<CreateEventOptions>): Promise<CalendarEvent>;
|
|
219
|
-
/**
|
|
220
|
-
* Delete a calendar event
|
|
221
|
-
*/
|
|
222
|
-
deleteEvent(id: string): Promise<void>;
|
|
223
|
-
/**
|
|
224
|
-
* Accept a meeting invitation
|
|
225
|
-
*/
|
|
226
|
-
acceptEvent(id: string, comment?: string, sendResponse?: boolean): Promise<void>;
|
|
227
|
-
/**
|
|
228
|
-
* Decline a meeting invitation
|
|
229
|
-
*/
|
|
230
|
-
declineEvent(id: string, comment?: string, sendResponse?: boolean): Promise<void>;
|
|
231
|
-
/**
|
|
232
|
-
* Tentatively accept a meeting invitation
|
|
233
|
-
*/
|
|
234
|
-
tentativelyAcceptEvent(id: string, comment?: string, sendResponse?: boolean): Promise<void>;
|
|
235
|
-
}
|
|
236
|
-
export declare const OutlookInitializer: SDKInitializer;
|
|
237
|
-
//# sourceMappingURL=outlook.d.ts.map
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PostgreSQL Integration
|
|
3
|
-
*
|
|
4
|
-
* Popular open-source relational database.
|
|
5
|
-
* API: Using node-postgres (pg) driver
|
|
6
|
-
*/
|
|
7
|
-
import { SDKInitializer } from '@marktoflow/core';
|
|
8
|
-
export interface PostgresConfig {
|
|
9
|
-
host: string;
|
|
10
|
-
port?: number;
|
|
11
|
-
database: string;
|
|
12
|
-
user: string;
|
|
13
|
-
password: string;
|
|
14
|
-
ssl?: boolean | {
|
|
15
|
-
rejectUnauthorized?: boolean;
|
|
16
|
-
};
|
|
17
|
-
connectionTimeoutMillis?: number;
|
|
18
|
-
idleTimeoutMillis?: number;
|
|
19
|
-
max?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface QueryResult<T = unknown> {
|
|
22
|
-
rows: T[];
|
|
23
|
-
rowCount: number;
|
|
24
|
-
command: string;
|
|
25
|
-
fields: {
|
|
26
|
-
name: string;
|
|
27
|
-
dataTypeID: number;
|
|
28
|
-
}[];
|
|
29
|
-
}
|
|
30
|
-
export interface PostgresTransaction {
|
|
31
|
-
query<T = unknown>(sql: string, params?: unknown[]): Promise<QueryResult<T>>;
|
|
32
|
-
commit(): Promise<void>;
|
|
33
|
-
rollback(): Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* PostgreSQL client wrapper for workflow integration
|
|
37
|
-
* Note: This is a lightweight wrapper. The actual pg module will be dynamically imported.
|
|
38
|
-
*/
|
|
39
|
-
export declare class PostgresClient {
|
|
40
|
-
private pool;
|
|
41
|
-
private config;
|
|
42
|
-
constructor(config: PostgresConfig);
|
|
43
|
-
/**
|
|
44
|
-
* Initialize the connection pool
|
|
45
|
-
*/
|
|
46
|
-
connect(): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Execute a SQL query
|
|
49
|
-
*/
|
|
50
|
-
query<T = unknown>(sql: string, params?: unknown[]): Promise<QueryResult<T>>;
|
|
51
|
-
/**
|
|
52
|
-
* Select data from a table
|
|
53
|
-
*/
|
|
54
|
-
select<T = Record<string, unknown>>(table: string, options?: {
|
|
55
|
-
columns?: string[];
|
|
56
|
-
where?: Record<string, unknown>;
|
|
57
|
-
orderBy?: string;
|
|
58
|
-
limit?: number;
|
|
59
|
-
offset?: number;
|
|
60
|
-
}): Promise<T[]>;
|
|
61
|
-
/**
|
|
62
|
-
* Insert data into a table
|
|
63
|
-
*/
|
|
64
|
-
insert<T = Record<string, unknown>>(table: string, data: Record<string, unknown> | Record<string, unknown>[], returning?: string[]): Promise<T[]>;
|
|
65
|
-
/**
|
|
66
|
-
* Update data in a table
|
|
67
|
-
*/
|
|
68
|
-
update<T = Record<string, unknown>>(table: string, data: Record<string, unknown>, where: Record<string, unknown>, returning?: string[]): Promise<T[]>;
|
|
69
|
-
/**
|
|
70
|
-
* Delete data from a table
|
|
71
|
-
*/
|
|
72
|
-
delete<T = Record<string, unknown>>(table: string, where: Record<string, unknown>, returning?: string[]): Promise<T[]>;
|
|
73
|
-
/**
|
|
74
|
-
* Begin a transaction
|
|
75
|
-
*/
|
|
76
|
-
transaction<T>(callback: (trx: PostgresTransaction) => Promise<T>): Promise<T>;
|
|
77
|
-
/**
|
|
78
|
-
* Close the connection pool
|
|
79
|
-
*/
|
|
80
|
-
close(): Promise<void>;
|
|
81
|
-
}
|
|
82
|
-
export declare const PostgresInitializer: SDKInitializer;
|
|
83
|
-
//# sourceMappingURL=postgres.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface SlackSocketTriggerConfig {
|
|
2
|
-
appToken: string;
|
|
3
|
-
botToken: string;
|
|
4
|
-
triggers: Array<{
|
|
5
|
-
id: string;
|
|
6
|
-
event: 'message' | 'app_mention';
|
|
7
|
-
handler: (payload: Record<string, unknown>) => Promise<void>;
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
10
|
-
export declare class SlackSocketTrigger {
|
|
11
|
-
private config;
|
|
12
|
-
private app?;
|
|
13
|
-
private handlersRegistered;
|
|
14
|
-
constructor(config: SlackSocketTriggerConfig);
|
|
15
|
-
start(): Promise<void>;
|
|
16
|
-
stop(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=slack-socket.d.ts.map
|
package/dist/services/slack.d.ts
DELETED
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WhatsApp Integration
|
|
3
|
-
*
|
|
4
|
-
* Messaging platform via WhatsApp Business API.
|
|
5
|
-
* API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api
|
|
6
|
-
*/
|
|
7
|
-
import { SDKInitializer } from '@marktoflow/core';
|
|
8
|
-
export interface WhatsAppMessage {
|
|
9
|
-
messagingProduct: 'whatsapp';
|
|
10
|
-
to: string;
|
|
11
|
-
type: 'text' | 'template' | 'image' | 'video' | 'document' | 'audio' | 'location' | 'contacts' | 'interactive';
|
|
12
|
-
text?: {
|
|
13
|
-
body: string;
|
|
14
|
-
previewUrl?: boolean;
|
|
15
|
-
};
|
|
16
|
-
template?: WhatsAppTemplate;
|
|
17
|
-
image?: {
|
|
18
|
-
link?: string;
|
|
19
|
-
id?: string;
|
|
20
|
-
caption?: string;
|
|
21
|
-
};
|
|
22
|
-
video?: {
|
|
23
|
-
link?: string;
|
|
24
|
-
id?: string;
|
|
25
|
-
caption?: string;
|
|
26
|
-
};
|
|
27
|
-
document?: {
|
|
28
|
-
link?: string;
|
|
29
|
-
id?: string;
|
|
30
|
-
caption?: string;
|
|
31
|
-
filename?: string;
|
|
32
|
-
};
|
|
33
|
-
audio?: {
|
|
34
|
-
link?: string;
|
|
35
|
-
id?: string;
|
|
36
|
-
};
|
|
37
|
-
location?: {
|
|
38
|
-
longitude: number;
|
|
39
|
-
latitude: number;
|
|
40
|
-
name?: string;
|
|
41
|
-
address?: string;
|
|
42
|
-
};
|
|
43
|
-
interactive?: WhatsAppInteractive;
|
|
44
|
-
}
|
|
45
|
-
export interface WhatsAppTemplate {
|
|
46
|
-
name: string;
|
|
47
|
-
language: {
|
|
48
|
-
code: string;
|
|
49
|
-
};
|
|
50
|
-
components?: WhatsAppTemplateComponent[];
|
|
51
|
-
}
|
|
52
|
-
export interface WhatsAppTemplateComponent {
|
|
53
|
-
type: 'header' | 'body' | 'button';
|
|
54
|
-
parameters: WhatsAppTemplateParameter[];
|
|
55
|
-
}
|
|
56
|
-
export interface WhatsAppTemplateParameter {
|
|
57
|
-
type: 'text' | 'currency' | 'date_time' | 'image' | 'document' | 'video';
|
|
58
|
-
text?: string;
|
|
59
|
-
currency?: {
|
|
60
|
-
fallbackValue: string;
|
|
61
|
-
code: string;
|
|
62
|
-
amount1000: number;
|
|
63
|
-
};
|
|
64
|
-
dateTime?: {
|
|
65
|
-
fallbackValue: string;
|
|
66
|
-
};
|
|
67
|
-
image?: {
|
|
68
|
-
link: string;
|
|
69
|
-
};
|
|
70
|
-
document?: {
|
|
71
|
-
link: string;
|
|
72
|
-
filename?: string;
|
|
73
|
-
};
|
|
74
|
-
video?: {
|
|
75
|
-
link: string;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
export interface WhatsAppInteractive {
|
|
79
|
-
type: 'button' | 'list' | 'product' | 'product_list';
|
|
80
|
-
header?: {
|
|
81
|
-
type: 'text' | 'image' | 'video' | 'document';
|
|
82
|
-
text?: string;
|
|
83
|
-
image?: {
|
|
84
|
-
link: string;
|
|
85
|
-
};
|
|
86
|
-
video?: {
|
|
87
|
-
link: string;
|
|
88
|
-
};
|
|
89
|
-
document?: {
|
|
90
|
-
link: string;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
body: {
|
|
94
|
-
text: string;
|
|
95
|
-
};
|
|
96
|
-
footer?: {
|
|
97
|
-
text: string;
|
|
98
|
-
};
|
|
99
|
-
action: WhatsAppAction;
|
|
100
|
-
}
|
|
101
|
-
export interface WhatsAppAction {
|
|
102
|
-
buttons?: WhatsAppButton[];
|
|
103
|
-
button?: string;
|
|
104
|
-
sections?: WhatsAppSection[];
|
|
105
|
-
}
|
|
106
|
-
export interface WhatsAppButton {
|
|
107
|
-
type: 'reply';
|
|
108
|
-
reply: {
|
|
109
|
-
id: string;
|
|
110
|
-
title: string;
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
export interface WhatsAppSection {
|
|
114
|
-
title?: string;
|
|
115
|
-
rows: WhatsAppRow[];
|
|
116
|
-
}
|
|
117
|
-
export interface WhatsAppRow {
|
|
118
|
-
id: string;
|
|
119
|
-
title: string;
|
|
120
|
-
description?: string;
|
|
121
|
-
}
|
|
122
|
-
export interface SendTextOptions {
|
|
123
|
-
to: string;
|
|
124
|
-
text: string;
|
|
125
|
-
previewUrl?: boolean;
|
|
126
|
-
}
|
|
127
|
-
export interface SendTemplateOptions {
|
|
128
|
-
to: string;
|
|
129
|
-
templateName: string;
|
|
130
|
-
languageCode: string;
|
|
131
|
-
components?: WhatsAppTemplateComponent[];
|
|
132
|
-
}
|
|
133
|
-
export interface SendMediaOptions {
|
|
134
|
-
to: string;
|
|
135
|
-
mediaUrl?: string;
|
|
136
|
-
mediaId?: string;
|
|
137
|
-
caption?: string;
|
|
138
|
-
filename?: string;
|
|
139
|
-
}
|
|
140
|
-
export interface SendLocationOptions {
|
|
141
|
-
to: string;
|
|
142
|
-
longitude: number;
|
|
143
|
-
latitude: number;
|
|
144
|
-
name?: string;
|
|
145
|
-
address?: string;
|
|
146
|
-
}
|
|
147
|
-
export interface SendInteractiveOptions {
|
|
148
|
-
to: string;
|
|
149
|
-
type: 'button' | 'list';
|
|
150
|
-
bodyText: string;
|
|
151
|
-
headerText?: string;
|
|
152
|
-
footerText?: string;
|
|
153
|
-
buttons?: {
|
|
154
|
-
id: string;
|
|
155
|
-
title: string;
|
|
156
|
-
}[];
|
|
157
|
-
listButton?: string;
|
|
158
|
-
sections?: WhatsAppSection[];
|
|
159
|
-
}
|
|
160
|
-
export interface WhatsAppWebhookMessage {
|
|
161
|
-
from: string;
|
|
162
|
-
id: string;
|
|
163
|
-
timestamp: string;
|
|
164
|
-
type: string;
|
|
165
|
-
text?: {
|
|
166
|
-
body: string;
|
|
167
|
-
};
|
|
168
|
-
image?: {
|
|
169
|
-
id: string;
|
|
170
|
-
mimeType: string;
|
|
171
|
-
sha256: string;
|
|
172
|
-
};
|
|
173
|
-
video?: {
|
|
174
|
-
id: string;
|
|
175
|
-
mimeType: string;
|
|
176
|
-
sha256: string;
|
|
177
|
-
};
|
|
178
|
-
document?: {
|
|
179
|
-
id: string;
|
|
180
|
-
mimeType: string;
|
|
181
|
-
sha256: string;
|
|
182
|
-
filename: string;
|
|
183
|
-
};
|
|
184
|
-
audio?: {
|
|
185
|
-
id: string;
|
|
186
|
-
mimeType: string;
|
|
187
|
-
sha256: string;
|
|
188
|
-
};
|
|
189
|
-
location?: {
|
|
190
|
-
longitude: number;
|
|
191
|
-
latitude: number;
|
|
192
|
-
name?: string;
|
|
193
|
-
address?: string;
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* WhatsApp Business API client for workflow integration
|
|
198
|
-
*/
|
|
199
|
-
export declare class WhatsAppClient {
|
|
200
|
-
private accessToken;
|
|
201
|
-
private apiUrl;
|
|
202
|
-
constructor(phoneNumberId: string, accessToken: string);
|
|
203
|
-
private request;
|
|
204
|
-
/**
|
|
205
|
-
* Send a text message
|
|
206
|
-
*/
|
|
207
|
-
sendText(options: SendTextOptions): Promise<{
|
|
208
|
-
messagingProduct: string;
|
|
209
|
-
contacts: unknown[];
|
|
210
|
-
messages: {
|
|
211
|
-
id: string;
|
|
212
|
-
}[];
|
|
213
|
-
}>;
|
|
214
|
-
/**
|
|
215
|
-
* Send a template message
|
|
216
|
-
*/
|
|
217
|
-
sendTemplate(options: SendTemplateOptions): Promise<{
|
|
218
|
-
messagingProduct: string;
|
|
219
|
-
contacts: unknown[];
|
|
220
|
-
messages: {
|
|
221
|
-
id: string;
|
|
222
|
-
}[];
|
|
223
|
-
}>;
|
|
224
|
-
/**
|
|
225
|
-
* Send an image
|
|
226
|
-
*/
|
|
227
|
-
sendImage(options: SendMediaOptions): Promise<{
|
|
228
|
-
messagingProduct: string;
|
|
229
|
-
contacts: unknown[];
|
|
230
|
-
messages: {
|
|
231
|
-
id: string;
|
|
232
|
-
}[];
|
|
233
|
-
}>;
|
|
234
|
-
/**
|
|
235
|
-
* Send a video
|
|
236
|
-
*/
|
|
237
|
-
sendVideo(options: SendMediaOptions): Promise<{
|
|
238
|
-
messagingProduct: string;
|
|
239
|
-
contacts: unknown[];
|
|
240
|
-
messages: {
|
|
241
|
-
id: string;
|
|
242
|
-
}[];
|
|
243
|
-
}>;
|
|
244
|
-
/**
|
|
245
|
-
* Send a document
|
|
246
|
-
*/
|
|
247
|
-
sendDocument(options: SendMediaOptions): Promise<{
|
|
248
|
-
messagingProduct: string;
|
|
249
|
-
contacts: unknown[];
|
|
250
|
-
messages: {
|
|
251
|
-
id: string;
|
|
252
|
-
}[];
|
|
253
|
-
}>;
|
|
254
|
-
/**
|
|
255
|
-
* Send an audio
|
|
256
|
-
*/
|
|
257
|
-
sendAudio(options: Omit<SendMediaOptions, 'caption' | 'filename'>): Promise<{
|
|
258
|
-
messagingProduct: string;
|
|
259
|
-
contacts: unknown[];
|
|
260
|
-
messages: {
|
|
261
|
-
id: string;
|
|
262
|
-
}[];
|
|
263
|
-
}>;
|
|
264
|
-
/**
|
|
265
|
-
* Send a location
|
|
266
|
-
*/
|
|
267
|
-
sendLocation(options: SendLocationOptions): Promise<{
|
|
268
|
-
messagingProduct: string;
|
|
269
|
-
contacts: unknown[];
|
|
270
|
-
messages: {
|
|
271
|
-
id: string;
|
|
272
|
-
}[];
|
|
273
|
-
}>;
|
|
274
|
-
/**
|
|
275
|
-
* Send an interactive message (buttons or list)
|
|
276
|
-
*/
|
|
277
|
-
sendInteractive(options: SendInteractiveOptions): Promise<{
|
|
278
|
-
messagingProduct: string;
|
|
279
|
-
contacts: unknown[];
|
|
280
|
-
messages: {
|
|
281
|
-
id: string;
|
|
282
|
-
}[];
|
|
283
|
-
}>;
|
|
284
|
-
/**
|
|
285
|
-
* Mark a message as read
|
|
286
|
-
*/
|
|
287
|
-
markAsRead(messageId: string): Promise<{
|
|
288
|
-
success: boolean;
|
|
289
|
-
}>;
|
|
290
|
-
/**
|
|
291
|
-
* Get media URL
|
|
292
|
-
*/
|
|
293
|
-
getMediaUrl(mediaId: string): Promise<{
|
|
294
|
-
url: string;
|
|
295
|
-
mimeType: string;
|
|
296
|
-
sha256: string;
|
|
297
|
-
fileSize: number;
|
|
298
|
-
}>;
|
|
299
|
-
/**
|
|
300
|
-
* Download media
|
|
301
|
-
*/
|
|
302
|
-
downloadMedia(mediaId: string): Promise<Buffer>;
|
|
303
|
-
/**
|
|
304
|
-
* Upload media
|
|
305
|
-
*/
|
|
306
|
-
uploadMedia(file: Buffer, mimeType: string): Promise<{
|
|
307
|
-
id: string;
|
|
308
|
-
}>;
|
|
309
|
-
}
|
|
310
|
-
export declare const WhatsAppInitializer: SDKInitializer;
|
|
311
|
-
//# sourceMappingURL=whatsapp.d.ts.map
|