@vibetools/dokploy-mcp 1.0.0 → 1.2.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/README.md +20 -14
- package/dist/api/client.d.ts +2 -0
- package/dist/api/client.js +44 -11
- package/dist/tools/_database.js +25 -6
- package/dist/tools/_factory.d.ts +2 -0
- package/dist/tools/_factory.js +21 -4
- package/dist/tools/application.js +219 -82
- package/dist/tools/backup.js +30 -0
- package/dist/tools/compose.js +273 -35
- package/dist/tools/deployment.js +82 -2
- package/dist/tools/docker.js +62 -2
- package/dist/tools/domain.js +15 -2
- package/dist/tools/environment.d.ts +2 -0
- package/dist/tools/environment.js +104 -0
- package/dist/tools/git-provider.d.ts +2 -0
- package/dist/tools/git-provider.js +22 -0
- package/dist/tools/github.d.ts +2 -0
- package/dist/tools/github.js +66 -0
- package/dist/tools/gitlab.d.ts +2 -0
- package/dist/tools/gitlab.js +98 -0
- package/dist/tools/index.js +24 -0
- package/dist/tools/mariadb.js +1 -1
- package/dist/tools/mongo.js +2 -1
- package/dist/tools/mounts.js +53 -9
- package/dist/tools/mysql.js +1 -1
- package/dist/tools/notification.d.ts +2 -0
- package/dist/tools/notification.js +559 -0
- package/dist/tools/patch.d.ts +2 -0
- package/dist/tools/patch.js +179 -0
- package/dist/tools/postgres.js +1 -1
- package/dist/tools/preview-deployment.d.ts +2 -0
- package/dist/tools/preview-deployment.js +50 -0
- package/dist/tools/project.js +32 -1
- package/dist/tools/redis.js +1 -1
- package/dist/tools/rollback.d.ts +2 -0
- package/dist/tools/rollback.js +28 -0
- package/dist/tools/schedule.d.ts +2 -0
- package/dist/tools/schedule.js +92 -0
- package/dist/tools/server.d.ts +2 -0
- package/dist/tools/server.js +192 -0
- package/dist/tools/settings.js +251 -0
- package/dist/tools/ssh-key.d.ts +2 -0
- package/dist/tools/ssh-key.js +74 -0
- package/dist/tools/user.js +75 -2
- package/dist/tools/volume-backups.d.ts +2 -0
- package/dist/tools/volume-backups.js +96 -0
- package/package.json +1 -1
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const stringArray = z.array(z.string()).min(1).describe('Target addresses');
|
|
4
|
+
const stringRecord = z.record(z.string(), z.string()).describe('String map');
|
|
5
|
+
const optionalBoolean = z.boolean().optional();
|
|
6
|
+
const optionalString = z.string().optional();
|
|
7
|
+
const optionalNumber = z.number().optional();
|
|
8
|
+
const notificationEventFieldFactories = {
|
|
9
|
+
appBuildError: () => optionalBoolean.describe('Notify on application build errors'),
|
|
10
|
+
databaseBackup: () => optionalBoolean.describe('Notify on database backups'),
|
|
11
|
+
volumeBackup: () => optionalBoolean.describe('Notify on volume backups'),
|
|
12
|
+
dokployRestart: () => optionalBoolean.describe('Notify on Dokploy restarts'),
|
|
13
|
+
name: () => optionalString.describe('Notification name'),
|
|
14
|
+
appDeploy: () => optionalBoolean.describe('Notify on application deployments'),
|
|
15
|
+
dockerCleanup: () => optionalBoolean.describe('Notify on Docker cleanup'),
|
|
16
|
+
serverThreshold: () => optionalBoolean.describe('Notify on server threshold alerts'),
|
|
17
|
+
};
|
|
18
|
+
function withRequired(shape, required) {
|
|
19
|
+
const entries = Object.entries(shape).map(([key, schema]) => {
|
|
20
|
+
if (required.includes(key)) {
|
|
21
|
+
return [key, schema instanceof z.ZodOptional ? schema.unwrap() : schema];
|
|
22
|
+
}
|
|
23
|
+
return [key, schema];
|
|
24
|
+
});
|
|
25
|
+
return Object.fromEntries(entries);
|
|
26
|
+
}
|
|
27
|
+
function notificationEventShape(requiredFields) {
|
|
28
|
+
const base = {
|
|
29
|
+
appBuildError: notificationEventFieldFactories.appBuildError(),
|
|
30
|
+
databaseBackup: notificationEventFieldFactories.databaseBackup(),
|
|
31
|
+
volumeBackup: notificationEventFieldFactories.volumeBackup(),
|
|
32
|
+
dokployRestart: notificationEventFieldFactories.dokployRestart(),
|
|
33
|
+
name: notificationEventFieldFactories.name(),
|
|
34
|
+
appDeploy: notificationEventFieldFactories.appDeploy(),
|
|
35
|
+
dockerCleanup: notificationEventFieldFactories.dockerCleanup(),
|
|
36
|
+
serverThreshold: notificationEventFieldFactories.serverThreshold(),
|
|
37
|
+
};
|
|
38
|
+
return withRequired(base, requiredFields);
|
|
39
|
+
}
|
|
40
|
+
function createSchema(eventRequired, providerShape, providerRequired) {
|
|
41
|
+
const fullShape = {
|
|
42
|
+
...notificationEventShape(eventRequired),
|
|
43
|
+
...providerShape,
|
|
44
|
+
};
|
|
45
|
+
const required = [...eventRequired, ...providerRequired];
|
|
46
|
+
return z.object(withRequired(fullShape, required)).strict();
|
|
47
|
+
}
|
|
48
|
+
function updateSchema(providerIds, providerIdRequired, providerShape) {
|
|
49
|
+
const fullShape = {
|
|
50
|
+
...notificationEventShape([]),
|
|
51
|
+
...providerShape,
|
|
52
|
+
...providerIds,
|
|
53
|
+
organizationId: optionalString.describe('Organization ID'),
|
|
54
|
+
};
|
|
55
|
+
const required = [...providerIdRequired];
|
|
56
|
+
return z.object(withRequired(fullShape, required)).strict();
|
|
57
|
+
}
|
|
58
|
+
function testSchema(providerShape, providerRequired) {
|
|
59
|
+
return z.object(withRequired(providerShape, providerRequired)).strict();
|
|
60
|
+
}
|
|
61
|
+
const customShape = {
|
|
62
|
+
endpoint: z.string().min(1).describe('Custom webhook endpoint'),
|
|
63
|
+
headers: stringRecord.optional().describe('HTTP headers'),
|
|
64
|
+
};
|
|
65
|
+
const discordShape = {
|
|
66
|
+
webhookUrl: z.string().min(1).describe('Discord webhook URL'),
|
|
67
|
+
decoration: optionalBoolean.describe('Whether to include decorations'),
|
|
68
|
+
};
|
|
69
|
+
const emailShape = {
|
|
70
|
+
smtpServer: z.string().min(1).describe('SMTP server'),
|
|
71
|
+
smtpPort: z.number().min(1).describe('SMTP port'),
|
|
72
|
+
username: z.string().min(1).describe('SMTP username'),
|
|
73
|
+
password: z.string().min(1).describe('SMTP password'),
|
|
74
|
+
fromAddress: z.string().min(1).describe('From address'),
|
|
75
|
+
toAddresses: stringArray,
|
|
76
|
+
};
|
|
77
|
+
const gotifyShape = {
|
|
78
|
+
serverUrl: z.string().min(1).describe('Gotify server URL'),
|
|
79
|
+
appToken: z.string().min(1).describe('Gotify app token'),
|
|
80
|
+
priority: z.number().min(1).describe('Notification priority'),
|
|
81
|
+
decoration: optionalBoolean.describe('Whether to include decorations'),
|
|
82
|
+
};
|
|
83
|
+
const larkShape = {
|
|
84
|
+
webhookUrl: z.string().min(1).describe('Lark webhook URL'),
|
|
85
|
+
};
|
|
86
|
+
const ntfyShape = {
|
|
87
|
+
serverUrl: z.string().min(1).describe('ntfy server URL'),
|
|
88
|
+
topic: z.string().min(1).describe('ntfy topic'),
|
|
89
|
+
accessToken: optionalString.describe('ntfy access token'),
|
|
90
|
+
priority: z.number().min(1).describe('Notification priority'),
|
|
91
|
+
};
|
|
92
|
+
const pushoverShape = {
|
|
93
|
+
userKey: z.string().min(1).describe('Pushover user key'),
|
|
94
|
+
apiToken: z.string().min(1).describe('Pushover API token'),
|
|
95
|
+
priority: optionalNumber.describe('Notification priority'),
|
|
96
|
+
retry: z.number().min(30).nullable().optional().describe('Retry interval'),
|
|
97
|
+
expire: z.number().min(1).max(10800).nullable().optional().describe('Expire time'),
|
|
98
|
+
};
|
|
99
|
+
const resendShape = {
|
|
100
|
+
apiKey: z.string().min(1).describe('Resend API key'),
|
|
101
|
+
fromAddress: z.string().min(1).describe('From address'),
|
|
102
|
+
toAddresses: stringArray,
|
|
103
|
+
};
|
|
104
|
+
const slackShape = {
|
|
105
|
+
webhookUrl: z.string().min(1).describe('Slack webhook URL'),
|
|
106
|
+
channel: optionalString.describe('Slack channel'),
|
|
107
|
+
};
|
|
108
|
+
const teamsShape = {
|
|
109
|
+
webhookUrl: z.string().min(1).describe('Teams webhook URL'),
|
|
110
|
+
};
|
|
111
|
+
const telegramShape = {
|
|
112
|
+
botToken: z.string().min(1).describe('Telegram bot token'),
|
|
113
|
+
chatId: z.string().min(1).describe('Telegram chat ID'),
|
|
114
|
+
messageThreadId: optionalString.describe('Telegram message thread ID'),
|
|
115
|
+
};
|
|
116
|
+
const createCustom = postTool({
|
|
117
|
+
name: 'dokploy_notification_create_custom',
|
|
118
|
+
title: 'Create Custom Notification',
|
|
119
|
+
description: 'Create a custom webhook notification channel in Dokploy.',
|
|
120
|
+
schema: createSchema(['name'], customShape, ['endpoint']),
|
|
121
|
+
endpoint: '/notification.createCustom',
|
|
122
|
+
});
|
|
123
|
+
const createDiscord = postTool({
|
|
124
|
+
name: 'dokploy_notification_create_discord',
|
|
125
|
+
title: 'Create Discord Notification',
|
|
126
|
+
description: 'Create a Discord notification channel in Dokploy.',
|
|
127
|
+
schema: createSchema([
|
|
128
|
+
'appBuildError',
|
|
129
|
+
'databaseBackup',
|
|
130
|
+
'volumeBackup',
|
|
131
|
+
'dokployRestart',
|
|
132
|
+
'name',
|
|
133
|
+
'appDeploy',
|
|
134
|
+
'dockerCleanup',
|
|
135
|
+
'serverThreshold',
|
|
136
|
+
], discordShape, ['webhookUrl', 'decoration']),
|
|
137
|
+
endpoint: '/notification.createDiscord',
|
|
138
|
+
});
|
|
139
|
+
const createEmail = postTool({
|
|
140
|
+
name: 'dokploy_notification_create_email',
|
|
141
|
+
title: 'Create Email Notification',
|
|
142
|
+
description: 'Create an SMTP email notification channel in Dokploy.',
|
|
143
|
+
schema: createSchema([
|
|
144
|
+
'appBuildError',
|
|
145
|
+
'databaseBackup',
|
|
146
|
+
'volumeBackup',
|
|
147
|
+
'dokployRestart',
|
|
148
|
+
'name',
|
|
149
|
+
'appDeploy',
|
|
150
|
+
'dockerCleanup',
|
|
151
|
+
'serverThreshold',
|
|
152
|
+
], emailShape, ['smtpServer', 'smtpPort', 'username', 'password', 'fromAddress', 'toAddresses']),
|
|
153
|
+
endpoint: '/notification.createEmail',
|
|
154
|
+
});
|
|
155
|
+
const createGotify = postTool({
|
|
156
|
+
name: 'dokploy_notification_create_gotify',
|
|
157
|
+
title: 'Create Gotify Notification',
|
|
158
|
+
description: 'Create a Gotify notification channel in Dokploy.',
|
|
159
|
+
schema: createSchema([
|
|
160
|
+
'appBuildError',
|
|
161
|
+
'databaseBackup',
|
|
162
|
+
'volumeBackup',
|
|
163
|
+
'dokployRestart',
|
|
164
|
+
'name',
|
|
165
|
+
'appDeploy',
|
|
166
|
+
'dockerCleanup',
|
|
167
|
+
], gotifyShape, ['serverUrl', 'appToken', 'priority']),
|
|
168
|
+
endpoint: '/notification.createGotify',
|
|
169
|
+
});
|
|
170
|
+
const createLark = postTool({
|
|
171
|
+
name: 'dokploy_notification_create_lark',
|
|
172
|
+
title: 'Create Lark Notification',
|
|
173
|
+
description: 'Create a Lark notification channel in Dokploy.',
|
|
174
|
+
schema: createSchema([
|
|
175
|
+
'appBuildError',
|
|
176
|
+
'databaseBackup',
|
|
177
|
+
'volumeBackup',
|
|
178
|
+
'dokployRestart',
|
|
179
|
+
'name',
|
|
180
|
+
'appDeploy',
|
|
181
|
+
'dockerCleanup',
|
|
182
|
+
'serverThreshold',
|
|
183
|
+
], larkShape, ['webhookUrl']),
|
|
184
|
+
endpoint: '/notification.createLark',
|
|
185
|
+
});
|
|
186
|
+
const createNtfy = postTool({
|
|
187
|
+
name: 'dokploy_notification_create_ntfy',
|
|
188
|
+
title: 'Create ntfy Notification',
|
|
189
|
+
description: 'Create an ntfy notification channel in Dokploy.',
|
|
190
|
+
schema: createSchema([
|
|
191
|
+
'appBuildError',
|
|
192
|
+
'databaseBackup',
|
|
193
|
+
'volumeBackup',
|
|
194
|
+
'dokployRestart',
|
|
195
|
+
'name',
|
|
196
|
+
'appDeploy',
|
|
197
|
+
'dockerCleanup',
|
|
198
|
+
], ntfyShape, ['serverUrl', 'topic', 'priority']),
|
|
199
|
+
endpoint: '/notification.createNtfy',
|
|
200
|
+
});
|
|
201
|
+
const createPushover = postTool({
|
|
202
|
+
name: 'dokploy_notification_create_pushover',
|
|
203
|
+
title: 'Create Pushover Notification',
|
|
204
|
+
description: 'Create a Pushover notification channel in Dokploy.',
|
|
205
|
+
schema: createSchema(['name'], pushoverShape, ['userKey', 'apiToken']),
|
|
206
|
+
endpoint: '/notification.createPushover',
|
|
207
|
+
});
|
|
208
|
+
const createResend = postTool({
|
|
209
|
+
name: 'dokploy_notification_create_resend',
|
|
210
|
+
title: 'Create Resend Notification',
|
|
211
|
+
description: 'Create a Resend email notification channel in Dokploy.',
|
|
212
|
+
schema: createSchema([
|
|
213
|
+
'appBuildError',
|
|
214
|
+
'databaseBackup',
|
|
215
|
+
'volumeBackup',
|
|
216
|
+
'dokployRestart',
|
|
217
|
+
'name',
|
|
218
|
+
'appDeploy',
|
|
219
|
+
'dockerCleanup',
|
|
220
|
+
'serverThreshold',
|
|
221
|
+
], resendShape, ['apiKey', 'fromAddress', 'toAddresses']),
|
|
222
|
+
endpoint: '/notification.createResend',
|
|
223
|
+
});
|
|
224
|
+
const createSlack = postTool({
|
|
225
|
+
name: 'dokploy_notification_create_slack',
|
|
226
|
+
title: 'Create Slack Notification',
|
|
227
|
+
description: 'Create a Slack notification channel in Dokploy.',
|
|
228
|
+
schema: createSchema([
|
|
229
|
+
'appBuildError',
|
|
230
|
+
'databaseBackup',
|
|
231
|
+
'volumeBackup',
|
|
232
|
+
'dokployRestart',
|
|
233
|
+
'name',
|
|
234
|
+
'appDeploy',
|
|
235
|
+
'dockerCleanup',
|
|
236
|
+
'serverThreshold',
|
|
237
|
+
], slackShape, ['webhookUrl']),
|
|
238
|
+
endpoint: '/notification.createSlack',
|
|
239
|
+
});
|
|
240
|
+
const createTeams = postTool({
|
|
241
|
+
name: 'dokploy_notification_create_teams',
|
|
242
|
+
title: 'Create Teams Notification',
|
|
243
|
+
description: 'Create a Microsoft Teams notification channel in Dokploy.',
|
|
244
|
+
schema: createSchema([
|
|
245
|
+
'appBuildError',
|
|
246
|
+
'databaseBackup',
|
|
247
|
+
'volumeBackup',
|
|
248
|
+
'dokployRestart',
|
|
249
|
+
'name',
|
|
250
|
+
'appDeploy',
|
|
251
|
+
'dockerCleanup',
|
|
252
|
+
'serverThreshold',
|
|
253
|
+
], teamsShape, ['webhookUrl']),
|
|
254
|
+
endpoint: '/notification.createTeams',
|
|
255
|
+
});
|
|
256
|
+
const createTelegram = postTool({
|
|
257
|
+
name: 'dokploy_notification_create_telegram',
|
|
258
|
+
title: 'Create Telegram Notification',
|
|
259
|
+
description: 'Create a Telegram notification channel in Dokploy.',
|
|
260
|
+
schema: createSchema([
|
|
261
|
+
'appBuildError',
|
|
262
|
+
'databaseBackup',
|
|
263
|
+
'volumeBackup',
|
|
264
|
+
'dokployRestart',
|
|
265
|
+
'name',
|
|
266
|
+
'appDeploy',
|
|
267
|
+
'dockerCleanup',
|
|
268
|
+
'serverThreshold',
|
|
269
|
+
], telegramShape, ['botToken', 'chatId']),
|
|
270
|
+
endpoint: '/notification.createTelegram',
|
|
271
|
+
});
|
|
272
|
+
const updateCustom = postTool({
|
|
273
|
+
name: 'dokploy_notification_update_custom',
|
|
274
|
+
title: 'Update Custom Notification',
|
|
275
|
+
description: 'Update a custom webhook notification channel in Dokploy.',
|
|
276
|
+
schema: updateSchema({
|
|
277
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
278
|
+
customId: z.string().min(1).describe('Custom notification ID'),
|
|
279
|
+
}, ['notificationId', 'customId'], customShape),
|
|
280
|
+
endpoint: '/notification.updateCustom',
|
|
281
|
+
});
|
|
282
|
+
const updateDiscord = postTool({
|
|
283
|
+
name: 'dokploy_notification_update_discord',
|
|
284
|
+
title: 'Update Discord Notification',
|
|
285
|
+
description: 'Update a Discord notification channel in Dokploy.',
|
|
286
|
+
schema: updateSchema({
|
|
287
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
288
|
+
discordId: z.string().min(1).describe('Discord notification ID'),
|
|
289
|
+
}, ['notificationId', 'discordId'], discordShape),
|
|
290
|
+
endpoint: '/notification.updateDiscord',
|
|
291
|
+
});
|
|
292
|
+
const updateEmail = postTool({
|
|
293
|
+
name: 'dokploy_notification_update_email',
|
|
294
|
+
title: 'Update Email Notification',
|
|
295
|
+
description: 'Update an SMTP email notification channel in Dokploy.',
|
|
296
|
+
schema: updateSchema({
|
|
297
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
298
|
+
emailId: z.string().min(1).describe('Email notification ID'),
|
|
299
|
+
}, ['notificationId', 'emailId'], emailShape),
|
|
300
|
+
endpoint: '/notification.updateEmail',
|
|
301
|
+
});
|
|
302
|
+
const updateGotify = postTool({
|
|
303
|
+
name: 'dokploy_notification_update_gotify',
|
|
304
|
+
title: 'Update Gotify Notification',
|
|
305
|
+
description: 'Update a Gotify notification channel in Dokploy.',
|
|
306
|
+
schema: updateSchema({
|
|
307
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
308
|
+
gotifyId: z.string().min(1).describe('Gotify notification ID'),
|
|
309
|
+
}, ['notificationId', 'gotifyId'], gotifyShape),
|
|
310
|
+
endpoint: '/notification.updateGotify',
|
|
311
|
+
});
|
|
312
|
+
const updateLark = postTool({
|
|
313
|
+
name: 'dokploy_notification_update_lark',
|
|
314
|
+
title: 'Update Lark Notification',
|
|
315
|
+
description: 'Update a Lark notification channel in Dokploy.',
|
|
316
|
+
schema: updateSchema({
|
|
317
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
318
|
+
larkId: z.string().min(1).describe('Lark notification ID'),
|
|
319
|
+
}, ['notificationId', 'larkId'], larkShape),
|
|
320
|
+
endpoint: '/notification.updateLark',
|
|
321
|
+
});
|
|
322
|
+
const updateNtfy = postTool({
|
|
323
|
+
name: 'dokploy_notification_update_ntfy',
|
|
324
|
+
title: 'Update ntfy Notification',
|
|
325
|
+
description: 'Update an ntfy notification channel in Dokploy.',
|
|
326
|
+
schema: updateSchema({
|
|
327
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
328
|
+
ntfyId: z.string().min(1).describe('ntfy notification ID'),
|
|
329
|
+
}, ['notificationId', 'ntfyId'], ntfyShape),
|
|
330
|
+
endpoint: '/notification.updateNtfy',
|
|
331
|
+
});
|
|
332
|
+
const updatePushover = postTool({
|
|
333
|
+
name: 'dokploy_notification_update_pushover',
|
|
334
|
+
title: 'Update Pushover Notification',
|
|
335
|
+
description: 'Update a Pushover notification channel in Dokploy.',
|
|
336
|
+
schema: updateSchema({
|
|
337
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
338
|
+
pushoverId: z.string().min(1).describe('Pushover notification ID'),
|
|
339
|
+
}, ['notificationId', 'pushoverId'], pushoverShape),
|
|
340
|
+
endpoint: '/notification.updatePushover',
|
|
341
|
+
});
|
|
342
|
+
const updateResend = postTool({
|
|
343
|
+
name: 'dokploy_notification_update_resend',
|
|
344
|
+
title: 'Update Resend Notification',
|
|
345
|
+
description: 'Update a Resend notification channel in Dokploy.',
|
|
346
|
+
schema: updateSchema({
|
|
347
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
348
|
+
resendId: z.string().min(1).describe('Resend notification ID'),
|
|
349
|
+
}, ['notificationId', 'resendId'], resendShape),
|
|
350
|
+
endpoint: '/notification.updateResend',
|
|
351
|
+
});
|
|
352
|
+
const updateSlack = postTool({
|
|
353
|
+
name: 'dokploy_notification_update_slack',
|
|
354
|
+
title: 'Update Slack Notification',
|
|
355
|
+
description: 'Update a Slack notification channel in Dokploy.',
|
|
356
|
+
schema: updateSchema({
|
|
357
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
358
|
+
slackId: z.string().min(1).describe('Slack notification ID'),
|
|
359
|
+
}, ['notificationId', 'slackId'], slackShape),
|
|
360
|
+
endpoint: '/notification.updateSlack',
|
|
361
|
+
});
|
|
362
|
+
const updateTeams = postTool({
|
|
363
|
+
name: 'dokploy_notification_update_teams',
|
|
364
|
+
title: 'Update Teams Notification',
|
|
365
|
+
description: 'Update a Microsoft Teams notification channel in Dokploy.',
|
|
366
|
+
schema: updateSchema({
|
|
367
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
368
|
+
teamsId: z.string().min(1).describe('Teams notification ID'),
|
|
369
|
+
}, ['notificationId', 'teamsId'], teamsShape),
|
|
370
|
+
endpoint: '/notification.updateTeams',
|
|
371
|
+
});
|
|
372
|
+
const updateTelegram = postTool({
|
|
373
|
+
name: 'dokploy_notification_update_telegram',
|
|
374
|
+
title: 'Update Telegram Notification',
|
|
375
|
+
description: 'Update a Telegram notification channel in Dokploy.',
|
|
376
|
+
schema: updateSchema({
|
|
377
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
378
|
+
telegramId: z.string().min(1).describe('Telegram notification ID'),
|
|
379
|
+
}, ['notificationId', 'telegramId'], telegramShape),
|
|
380
|
+
endpoint: '/notification.updateTelegram',
|
|
381
|
+
});
|
|
382
|
+
const testCustomConnection = postTool({
|
|
383
|
+
name: 'dokploy_notification_test_custom_connection',
|
|
384
|
+
title: 'Test Custom Notification Connection',
|
|
385
|
+
description: 'Test a custom webhook notification configuration in Dokploy.',
|
|
386
|
+
schema: testSchema(customShape, ['endpoint']),
|
|
387
|
+
endpoint: '/notification.testCustomConnection',
|
|
388
|
+
});
|
|
389
|
+
const testDiscordConnection = postTool({
|
|
390
|
+
name: 'dokploy_notification_test_discord_connection',
|
|
391
|
+
title: 'Test Discord Notification Connection',
|
|
392
|
+
description: 'Test a Discord notification configuration in Dokploy.',
|
|
393
|
+
schema: testSchema(discordShape, ['webhookUrl']),
|
|
394
|
+
endpoint: '/notification.testDiscordConnection',
|
|
395
|
+
});
|
|
396
|
+
const testEmailConnection = postTool({
|
|
397
|
+
name: 'dokploy_notification_test_email_connection',
|
|
398
|
+
title: 'Test Email Notification Connection',
|
|
399
|
+
description: 'Test an SMTP email notification configuration in Dokploy.',
|
|
400
|
+
schema: testSchema(emailShape, [
|
|
401
|
+
'smtpServer',
|
|
402
|
+
'smtpPort',
|
|
403
|
+
'username',
|
|
404
|
+
'password',
|
|
405
|
+
'toAddresses',
|
|
406
|
+
'fromAddress',
|
|
407
|
+
]),
|
|
408
|
+
endpoint: '/notification.testEmailConnection',
|
|
409
|
+
});
|
|
410
|
+
const testGotifyConnection = postTool({
|
|
411
|
+
name: 'dokploy_notification_test_gotify_connection',
|
|
412
|
+
title: 'Test Gotify Notification Connection',
|
|
413
|
+
description: 'Test a Gotify notification configuration in Dokploy.',
|
|
414
|
+
schema: testSchema(gotifyShape, ['serverUrl', 'appToken', 'priority']),
|
|
415
|
+
endpoint: '/notification.testGotifyConnection',
|
|
416
|
+
});
|
|
417
|
+
const testLarkConnection = postTool({
|
|
418
|
+
name: 'dokploy_notification_test_lark_connection',
|
|
419
|
+
title: 'Test Lark Notification Connection',
|
|
420
|
+
description: 'Test a Lark notification configuration in Dokploy.',
|
|
421
|
+
schema: testSchema(larkShape, ['webhookUrl']),
|
|
422
|
+
endpoint: '/notification.testLarkConnection',
|
|
423
|
+
});
|
|
424
|
+
const testNtfyConnection = postTool({
|
|
425
|
+
name: 'dokploy_notification_test_ntfy_connection',
|
|
426
|
+
title: 'Test ntfy Notification Connection',
|
|
427
|
+
description: 'Test an ntfy notification configuration in Dokploy.',
|
|
428
|
+
schema: testSchema(ntfyShape, ['serverUrl', 'topic', 'priority']),
|
|
429
|
+
endpoint: '/notification.testNtfyConnection',
|
|
430
|
+
});
|
|
431
|
+
const testPushoverConnection = postTool({
|
|
432
|
+
name: 'dokploy_notification_test_pushover_connection',
|
|
433
|
+
title: 'Test Pushover Notification Connection',
|
|
434
|
+
description: 'Test a Pushover notification configuration in Dokploy.',
|
|
435
|
+
schema: testSchema(pushoverShape, ['userKey', 'apiToken', 'priority']),
|
|
436
|
+
endpoint: '/notification.testPushoverConnection',
|
|
437
|
+
});
|
|
438
|
+
const testResendConnection = postTool({
|
|
439
|
+
name: 'dokploy_notification_test_resend_connection',
|
|
440
|
+
title: 'Test Resend Notification Connection',
|
|
441
|
+
description: 'Test a Resend notification configuration in Dokploy.',
|
|
442
|
+
schema: testSchema(resendShape, ['apiKey', 'fromAddress', 'toAddresses']),
|
|
443
|
+
endpoint: '/notification.testResendConnection',
|
|
444
|
+
});
|
|
445
|
+
const testSlackConnection = postTool({
|
|
446
|
+
name: 'dokploy_notification_test_slack_connection',
|
|
447
|
+
title: 'Test Slack Notification Connection',
|
|
448
|
+
description: 'Test a Slack notification configuration in Dokploy.',
|
|
449
|
+
schema: testSchema(slackShape, ['webhookUrl', 'channel']),
|
|
450
|
+
endpoint: '/notification.testSlackConnection',
|
|
451
|
+
});
|
|
452
|
+
const testTeamsConnection = postTool({
|
|
453
|
+
name: 'dokploy_notification_test_teams_connection',
|
|
454
|
+
title: 'Test Teams Notification Connection',
|
|
455
|
+
description: 'Test a Microsoft Teams notification configuration in Dokploy.',
|
|
456
|
+
schema: testSchema(teamsShape, ['webhookUrl']),
|
|
457
|
+
endpoint: '/notification.testTeamsConnection',
|
|
458
|
+
});
|
|
459
|
+
const testTelegramConnection = postTool({
|
|
460
|
+
name: 'dokploy_notification_test_telegram_connection',
|
|
461
|
+
title: 'Test Telegram Notification Connection',
|
|
462
|
+
description: 'Test a Telegram notification configuration in Dokploy.',
|
|
463
|
+
schema: testSchema(telegramShape, ['botToken', 'chatId']),
|
|
464
|
+
endpoint: '/notification.testTelegramConnection',
|
|
465
|
+
});
|
|
466
|
+
const all = getTool({
|
|
467
|
+
name: 'dokploy_notification_all',
|
|
468
|
+
title: 'List Notifications',
|
|
469
|
+
description: 'List all notification channels configured in Dokploy.',
|
|
470
|
+
schema: z.object({}).strict(),
|
|
471
|
+
endpoint: '/notification.all',
|
|
472
|
+
});
|
|
473
|
+
const getEmailProviders = getTool({
|
|
474
|
+
name: 'dokploy_notification_get_email_providers',
|
|
475
|
+
title: 'List Email Providers',
|
|
476
|
+
description: 'List email provider records available to Dokploy notifications.',
|
|
477
|
+
schema: z.object({}).strict(),
|
|
478
|
+
endpoint: '/notification.getEmailProviders',
|
|
479
|
+
});
|
|
480
|
+
const one = getTool({
|
|
481
|
+
name: 'dokploy_notification_one',
|
|
482
|
+
title: 'Get Notification',
|
|
483
|
+
description: 'Retrieve a notification channel by its ID.',
|
|
484
|
+
schema: z
|
|
485
|
+
.object({
|
|
486
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
487
|
+
})
|
|
488
|
+
.strict(),
|
|
489
|
+
endpoint: '/notification.one',
|
|
490
|
+
});
|
|
491
|
+
const receiveNotification = postTool({
|
|
492
|
+
name: 'dokploy_notification_receive_notification',
|
|
493
|
+
title: 'Receive Notification',
|
|
494
|
+
description: 'Send a server-threshold notification payload into Dokploy.',
|
|
495
|
+
schema: z
|
|
496
|
+
.object({
|
|
497
|
+
ServerType: z.enum(['Dokploy', 'Remote']).optional().describe('Server type'),
|
|
498
|
+
Type: z.enum(['Memory', 'CPU']).describe('Metric type'),
|
|
499
|
+
Value: z.number().describe('Metric value'),
|
|
500
|
+
Threshold: z.number().describe('Threshold value'),
|
|
501
|
+
Message: z.string().describe('Notification message'),
|
|
502
|
+
Timestamp: z.string().describe('Timestamp'),
|
|
503
|
+
Token: z.string().describe('Notification token'),
|
|
504
|
+
})
|
|
505
|
+
.strict(),
|
|
506
|
+
endpoint: '/notification.receiveNotification',
|
|
507
|
+
});
|
|
508
|
+
const remove = postTool({
|
|
509
|
+
name: 'dokploy_notification_remove',
|
|
510
|
+
title: 'Remove Notification',
|
|
511
|
+
description: 'Delete a notification channel from Dokploy. Requires the notification ID. This is a destructive action.',
|
|
512
|
+
schema: z
|
|
513
|
+
.object({
|
|
514
|
+
notificationId: z.string().min(1).describe('Notification ID'),
|
|
515
|
+
})
|
|
516
|
+
.strict(),
|
|
517
|
+
endpoint: '/notification.remove',
|
|
518
|
+
annotations: { destructiveHint: true },
|
|
519
|
+
});
|
|
520
|
+
export const notificationTools = [
|
|
521
|
+
all,
|
|
522
|
+
getEmailProviders,
|
|
523
|
+
one,
|
|
524
|
+
receiveNotification,
|
|
525
|
+
remove,
|
|
526
|
+
createCustom,
|
|
527
|
+
createDiscord,
|
|
528
|
+
createEmail,
|
|
529
|
+
createGotify,
|
|
530
|
+
createLark,
|
|
531
|
+
createNtfy,
|
|
532
|
+
createPushover,
|
|
533
|
+
createResend,
|
|
534
|
+
createSlack,
|
|
535
|
+
createTeams,
|
|
536
|
+
createTelegram,
|
|
537
|
+
updateCustom,
|
|
538
|
+
updateDiscord,
|
|
539
|
+
updateEmail,
|
|
540
|
+
updateGotify,
|
|
541
|
+
updateLark,
|
|
542
|
+
updateNtfy,
|
|
543
|
+
updatePushover,
|
|
544
|
+
updateResend,
|
|
545
|
+
updateSlack,
|
|
546
|
+
updateTeams,
|
|
547
|
+
updateTelegram,
|
|
548
|
+
testCustomConnection,
|
|
549
|
+
testDiscordConnection,
|
|
550
|
+
testEmailConnection,
|
|
551
|
+
testGotifyConnection,
|
|
552
|
+
testLarkConnection,
|
|
553
|
+
testNtfyConnection,
|
|
554
|
+
testPushoverConnection,
|
|
555
|
+
testResendConnection,
|
|
556
|
+
testSlackConnection,
|
|
557
|
+
testTeamsConnection,
|
|
558
|
+
testTelegramConnection,
|
|
559
|
+
];
|