@vibetools/dokploy-mcp 1.2.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +61 -168
  2. package/dist/api/client.d.ts +2 -1
  3. package/dist/api/client.js +3 -11
  4. package/dist/cli/index.js +1 -0
  5. package/dist/codemode/context/execute-context.d.ts +590 -0
  6. package/dist/codemode/context/execute-context.js +64 -0
  7. package/dist/codemode/context/search-context.d.ts +13851 -0
  8. package/dist/codemode/context/search-context.js +42 -0
  9. package/dist/codemode/gateway/api-gateway.d.ts +12 -0
  10. package/dist/codemode/gateway/api-gateway.js +160 -0
  11. package/dist/codemode/gateway/error-format.d.ts +13 -0
  12. package/dist/codemode/gateway/error-format.js +9 -0
  13. package/dist/codemode/gateway/request-normalizer.d.ts +3 -0
  14. package/dist/codemode/gateway/request-normalizer.js +21 -0
  15. package/dist/codemode/gateway/trace.d.ts +13 -0
  16. package/dist/codemode/gateway/trace.js +11 -0
  17. package/dist/codemode/sandbox/host.d.ts +11 -0
  18. package/dist/codemode/sandbox/host.js +28 -0
  19. package/dist/codemode/sandbox/limits.d.ts +2 -0
  20. package/dist/codemode/sandbox/limits.js +20 -0
  21. package/dist/codemode/sandbox/runner.d.ts +8 -0
  22. package/dist/codemode/sandbox/runner.js +113 -0
  23. package/dist/codemode/sandbox/runtime.d.ts +2 -0
  24. package/dist/codemode/sandbox/runtime.js +3 -0
  25. package/dist/codemode/sandbox/serialize.d.ts +1 -0
  26. package/dist/codemode/sandbox/serialize.js +45 -0
  27. package/dist/codemode/sandbox/subprocess-runner.d.ts +10 -0
  28. package/dist/codemode/sandbox/subprocess-runner.js +91 -0
  29. package/dist/codemode/sandbox/types.d.ts +12 -0
  30. package/dist/codemode/sandbox/types.js +1 -0
  31. package/dist/codemode/sandbox/worker-entry.d.ts +1 -0
  32. package/dist/codemode/sandbox/worker-entry.js +70 -0
  33. package/dist/codemode/server-codemode.d.ts +2 -0
  34. package/dist/codemode/server-codemode.js +17 -0
  35. package/dist/codemode/tools/execute.d.ts +583 -0
  36. package/dist/codemode/tools/execute.js +64 -0
  37. package/dist/codemode/tools/index.d.ts +2 -0
  38. package/dist/codemode/tools/index.js +3 -0
  39. package/dist/codemode/tools/search.d.ts +2 -0
  40. package/dist/codemode/tools/search.js +73 -0
  41. package/dist/generated/dokploy-catalog.d.ts +27 -0
  42. package/dist/generated/dokploy-catalog.js +16 -0
  43. package/dist/generated/dokploy-schemas.d.ts +17533 -0
  44. package/dist/generated/dokploy-schemas.js +20639 -0
  45. package/dist/generated/dokploy-sdk.d.ts +558 -0
  46. package/dist/generated/dokploy-sdk.js +561 -0
  47. package/dist/generated/openapi-index.json +10591 -0
  48. package/dist/{tools/_factory.js → mcp/tool-factory.js} +7 -5
  49. package/dist/server.d.ts +1 -1
  50. package/dist/server.js +2 -15
  51. package/package.json +22 -11
  52. package/dist/tools/_database.d.ts +0 -12
  53. package/dist/tools/_database.js +0 -115
  54. package/dist/tools/admin.d.ts +0 -2
  55. package/dist/tools/admin.js +0 -61
  56. package/dist/tools/application.d.ts +0 -2
  57. package/dist/tools/application.js +0 -601
  58. package/dist/tools/backup.d.ts +0 -2
  59. package/dist/tools/backup.js +0 -133
  60. package/dist/tools/certificates.d.ts +0 -2
  61. package/dist/tools/certificates.js +0 -54
  62. package/dist/tools/cluster.d.ts +0 -2
  63. package/dist/tools/cluster.js +0 -38
  64. package/dist/tools/compose.d.ts +0 -2
  65. package/dist/tools/compose.js +0 -451
  66. package/dist/tools/deployment.d.ts +0 -2
  67. package/dist/tools/deployment.js +0 -107
  68. package/dist/tools/destination.d.ts +0 -2
  69. package/dist/tools/destination.js +0 -78
  70. package/dist/tools/docker.d.ts +0 -2
  71. package/dist/tools/docker.js +0 -110
  72. package/dist/tools/domain.d.ts +0 -2
  73. package/dist/tools/domain.js +0 -147
  74. package/dist/tools/environment.d.ts +0 -2
  75. package/dist/tools/environment.js +0 -104
  76. package/dist/tools/git-provider.d.ts +0 -2
  77. package/dist/tools/git-provider.js +0 -22
  78. package/dist/tools/github.d.ts +0 -2
  79. package/dist/tools/github.js +0 -66
  80. package/dist/tools/gitlab.d.ts +0 -2
  81. package/dist/tools/gitlab.js +0 -98
  82. package/dist/tools/index.d.ts +0 -2
  83. package/dist/tools/index.js +0 -72
  84. package/dist/tools/mariadb.d.ts +0 -1
  85. package/dist/tools/mariadb.js +0 -14
  86. package/dist/tools/mongo.d.ts +0 -1
  87. package/dist/tools/mongo.js +0 -13
  88. package/dist/tools/mounts.d.ts +0 -2
  89. package/dist/tools/mounts.js +0 -109
  90. package/dist/tools/mysql.d.ts +0 -1
  91. package/dist/tools/mysql.js +0 -14
  92. package/dist/tools/notification.d.ts +0 -2
  93. package/dist/tools/notification.js +0 -559
  94. package/dist/tools/patch.d.ts +0 -2
  95. package/dist/tools/patch.js +0 -179
  96. package/dist/tools/port.d.ts +0 -2
  97. package/dist/tools/port.js +0 -54
  98. package/dist/tools/postgres.d.ts +0 -1
  99. package/dist/tools/postgres.js +0 -13
  100. package/dist/tools/preview-deployment.d.ts +0 -2
  101. package/dist/tools/preview-deployment.js +0 -50
  102. package/dist/tools/project.d.ts +0 -2
  103. package/dist/tools/project.js +0 -125
  104. package/dist/tools/redirects.d.ts +0 -2
  105. package/dist/tools/redirects.js +0 -53
  106. package/dist/tools/redis.d.ts +0 -1
  107. package/dist/tools/redis.js +0 -11
  108. package/dist/tools/registry.d.ts +0 -2
  109. package/dist/tools/registry.js +0 -81
  110. package/dist/tools/rollback.d.ts +0 -2
  111. package/dist/tools/rollback.js +0 -28
  112. package/dist/tools/schedule.d.ts +0 -2
  113. package/dist/tools/schedule.js +0 -92
  114. package/dist/tools/security.d.ts +0 -2
  115. package/dist/tools/security.js +0 -48
  116. package/dist/tools/server.d.ts +0 -2
  117. package/dist/tools/server.js +0 -192
  118. package/dist/tools/settings.d.ts +0 -2
  119. package/dist/tools/settings.js +0 -509
  120. package/dist/tools/ssh-key.d.ts +0 -2
  121. package/dist/tools/ssh-key.js +0 -74
  122. package/dist/tools/user.d.ts +0 -2
  123. package/dist/tools/user.js +0 -85
  124. package/dist/tools/volume-backups.d.ts +0 -2
  125. package/dist/tools/volume-backups.js +0 -96
  126. /package/dist/{tools/_factory.d.ts → mcp/tool-factory.d.ts} +0 -0
@@ -0,0 +1,590 @@
1
+ import type { GatewayCallResult } from '../gateway/api-gateway.js';
2
+ type CallExecutor = (procedure: string, input?: Record<string, unknown>) => Promise<GatewayCallResult>;
3
+ export declare function buildHelpers(): {
4
+ sleep(ms: number): Promise<void>;
5
+ assert(condition: unknown, message?: string): void;
6
+ pick<T extends Record<string, unknown>, K extends keyof T>(value: T, keys: K[]): Pick<T, K>;
7
+ limit<T>(items: T[], count: number): T[];
8
+ selectOne<T>(items: T[], predicate?: (item: T) => boolean): NonNullable<T> | null;
9
+ paginateUntil<T>(fetchPage: (offset: number) => Promise<{
10
+ items: T[];
11
+ total?: number;
12
+ }>, predicate: (item: T) => boolean, pageSize?: number): Promise<NonNullable<T> | null>;
13
+ };
14
+ export declare function createCallTracker(executor: CallExecutor, maxCalls: number): {
15
+ call: (procedure: string, input?: Record<string, unknown>) => Promise<unknown>;
16
+ getCalls(): import("../gateway/trace.js").GatewayTraceEntry[];
17
+ };
18
+ export declare function createExecuteContext(executor: CallExecutor, maxCalls: number): {
19
+ dokploy: {
20
+ call: (procedure: string, input?: Record<string, unknown>) => Promise<unknown>;
21
+ admin: {
22
+ setupMonitoring: (input?: {}) => Promise<unknown>;
23
+ };
24
+ ai: {
25
+ create: (input?: {}) => Promise<unknown>;
26
+ delete: (input?: {}) => Promise<unknown>;
27
+ deploy: (input?: {}) => Promise<unknown>;
28
+ get: (input?: {}) => Promise<unknown>;
29
+ getAll: (input?: {}) => Promise<unknown>;
30
+ getModels: (input?: {}) => Promise<unknown>;
31
+ one: (input?: {}) => Promise<unknown>;
32
+ suggest: (input?: {}) => Promise<unknown>;
33
+ update: (input?: {}) => Promise<unknown>;
34
+ };
35
+ application: {
36
+ cancelDeployment: (input?: {}) => Promise<unknown>;
37
+ cleanQueues: (input?: {}) => Promise<unknown>;
38
+ clearDeployments: (input?: {}) => Promise<unknown>;
39
+ create: (input?: {}) => Promise<unknown>;
40
+ delete: (input?: {}) => Promise<unknown>;
41
+ deploy: (input?: {}) => Promise<unknown>;
42
+ disconnectGitProvider: (input?: {}) => Promise<unknown>;
43
+ killBuild: (input?: {}) => Promise<unknown>;
44
+ markRunning: (input?: {}) => Promise<unknown>;
45
+ move: (input?: {}) => Promise<unknown>;
46
+ one: (input?: {}) => Promise<unknown>;
47
+ readAppMonitoring: (input?: {}) => Promise<unknown>;
48
+ readTraefikConfig: (input?: {}) => Promise<unknown>;
49
+ redeploy: (input?: {}) => Promise<unknown>;
50
+ refreshToken: (input?: {}) => Promise<unknown>;
51
+ reload: (input?: {}) => Promise<unknown>;
52
+ saveBitbucketProvider: (input?: {}) => Promise<unknown>;
53
+ saveBuildType: (input?: {}) => Promise<unknown>;
54
+ saveDockerProvider: (input?: {}) => Promise<unknown>;
55
+ saveEnvironment: (input?: {}) => Promise<unknown>;
56
+ saveGitProvider: (input?: {}) => Promise<unknown>;
57
+ saveGiteaProvider: (input?: {}) => Promise<unknown>;
58
+ saveGithubProvider: (input?: {}) => Promise<unknown>;
59
+ saveGitlabProvider: (input?: {}) => Promise<unknown>;
60
+ search: (input?: {}) => Promise<unknown>;
61
+ start: (input?: {}) => Promise<unknown>;
62
+ stop: (input?: {}) => Promise<unknown>;
63
+ update: (input?: {}) => Promise<unknown>;
64
+ updateTraefikConfig: (input?: {}) => Promise<unknown>;
65
+ };
66
+ auditLog: {
67
+ all: (input?: {}) => Promise<unknown>;
68
+ };
69
+ backup: {
70
+ create: (input?: {}) => Promise<unknown>;
71
+ listBackupFiles: (input?: {}) => Promise<unknown>;
72
+ manualBackupCompose: (input?: {}) => Promise<unknown>;
73
+ manualBackupMariadb: (input?: {}) => Promise<unknown>;
74
+ manualBackupMongo: (input?: {}) => Promise<unknown>;
75
+ manualBackupMySql: (input?: {}) => Promise<unknown>;
76
+ manualBackupPostgres: (input?: {}) => Promise<unknown>;
77
+ manualBackupWebServer: (input?: {}) => Promise<unknown>;
78
+ one: (input?: {}) => Promise<unknown>;
79
+ remove: (input?: {}) => Promise<unknown>;
80
+ update: (input?: {}) => Promise<unknown>;
81
+ };
82
+ bitbucket: {
83
+ bitbucketProviders: (input?: {}) => Promise<unknown>;
84
+ create: (input?: {}) => Promise<unknown>;
85
+ getBitbucketBranches: (input?: {}) => Promise<unknown>;
86
+ getBitbucketRepositories: (input?: {}) => Promise<unknown>;
87
+ one: (input?: {}) => Promise<unknown>;
88
+ testConnection: (input?: {}) => Promise<unknown>;
89
+ update: (input?: {}) => Promise<unknown>;
90
+ };
91
+ certificates: {
92
+ all: (input?: {}) => Promise<unknown>;
93
+ create: (input?: {}) => Promise<unknown>;
94
+ one: (input?: {}) => Promise<unknown>;
95
+ remove: (input?: {}) => Promise<unknown>;
96
+ };
97
+ cluster: {
98
+ addManager: (input?: {}) => Promise<unknown>;
99
+ addWorker: (input?: {}) => Promise<unknown>;
100
+ getNodes: (input?: {}) => Promise<unknown>;
101
+ removeWorker: (input?: {}) => Promise<unknown>;
102
+ };
103
+ compose: {
104
+ cancelDeployment: (input?: {}) => Promise<unknown>;
105
+ cleanQueues: (input?: {}) => Promise<unknown>;
106
+ clearDeployments: (input?: {}) => Promise<unknown>;
107
+ create: (input?: {}) => Promise<unknown>;
108
+ delete: (input?: {}) => Promise<unknown>;
109
+ deploy: (input?: {}) => Promise<unknown>;
110
+ deployTemplate: (input?: {}) => Promise<unknown>;
111
+ disconnectGitProvider: (input?: {}) => Promise<unknown>;
112
+ fetchSourceType: (input?: {}) => Promise<unknown>;
113
+ getConvertedCompose: (input?: {}) => Promise<unknown>;
114
+ getDefaultCommand: (input?: {}) => Promise<unknown>;
115
+ getTags: (input?: {}) => Promise<unknown>;
116
+ import: (input?: {}) => Promise<unknown>;
117
+ isolatedDeployment: (input?: {}) => Promise<unknown>;
118
+ killBuild: (input?: {}) => Promise<unknown>;
119
+ loadMountsByService: (input?: {}) => Promise<unknown>;
120
+ loadServices: (input?: {}) => Promise<unknown>;
121
+ move: (input?: {}) => Promise<unknown>;
122
+ one: (input?: {}) => Promise<unknown>;
123
+ processTemplate: (input?: {}) => Promise<unknown>;
124
+ randomizeCompose: (input?: {}) => Promise<unknown>;
125
+ redeploy: (input?: {}) => Promise<unknown>;
126
+ refreshToken: (input?: {}) => Promise<unknown>;
127
+ search: (input?: {}) => Promise<unknown>;
128
+ start: (input?: {}) => Promise<unknown>;
129
+ stop: (input?: {}) => Promise<unknown>;
130
+ templates: (input?: {}) => Promise<unknown>;
131
+ update: (input?: {}) => Promise<unknown>;
132
+ };
133
+ customRole: {
134
+ all: (input?: {}) => Promise<unknown>;
135
+ create: (input?: {}) => Promise<unknown>;
136
+ getStatements: (input?: {}) => Promise<unknown>;
137
+ membersByRole: (input?: {}) => Promise<unknown>;
138
+ remove: (input?: {}) => Promise<unknown>;
139
+ update: (input?: {}) => Promise<unknown>;
140
+ };
141
+ deployment: {
142
+ all: (input?: {}) => Promise<unknown>;
143
+ allByCompose: (input?: {}) => Promise<unknown>;
144
+ allByServer: (input?: {}) => Promise<unknown>;
145
+ allByType: (input?: {}) => Promise<unknown>;
146
+ allCentralized: (input?: {}) => Promise<unknown>;
147
+ killProcess: (input?: {}) => Promise<unknown>;
148
+ queueList: (input?: {}) => Promise<unknown>;
149
+ removeDeployment: (input?: {}) => Promise<unknown>;
150
+ };
151
+ destination: {
152
+ all: (input?: {}) => Promise<unknown>;
153
+ create: (input?: {}) => Promise<unknown>;
154
+ one: (input?: {}) => Promise<unknown>;
155
+ remove: (input?: {}) => Promise<unknown>;
156
+ testConnection: (input?: {}) => Promise<unknown>;
157
+ update: (input?: {}) => Promise<unknown>;
158
+ };
159
+ docker: {
160
+ getConfig: (input?: {}) => Promise<unknown>;
161
+ getContainers: (input?: {}) => Promise<unknown>;
162
+ getContainersByAppLabel: (input?: {}) => Promise<unknown>;
163
+ getContainersByAppNameMatch: (input?: {}) => Promise<unknown>;
164
+ getServiceContainersByAppName: (input?: {}) => Promise<unknown>;
165
+ getStackContainersByAppName: (input?: {}) => Promise<unknown>;
166
+ restartContainer: (input?: {}) => Promise<unknown>;
167
+ };
168
+ domain: {
169
+ byApplicationId: (input?: {}) => Promise<unknown>;
170
+ byComposeId: (input?: {}) => Promise<unknown>;
171
+ canGenerateTraefikMeDomains: (input?: {}) => Promise<unknown>;
172
+ create: (input?: {}) => Promise<unknown>;
173
+ delete: (input?: {}) => Promise<unknown>;
174
+ generateDomain: (input?: {}) => Promise<unknown>;
175
+ one: (input?: {}) => Promise<unknown>;
176
+ update: (input?: {}) => Promise<unknown>;
177
+ validateDomain: (input?: {}) => Promise<unknown>;
178
+ };
179
+ environment: {
180
+ byProjectId: (input?: {}) => Promise<unknown>;
181
+ create: (input?: {}) => Promise<unknown>;
182
+ duplicate: (input?: {}) => Promise<unknown>;
183
+ one: (input?: {}) => Promise<unknown>;
184
+ remove: (input?: {}) => Promise<unknown>;
185
+ search: (input?: {}) => Promise<unknown>;
186
+ update: (input?: {}) => Promise<unknown>;
187
+ };
188
+ gitea: {
189
+ create: (input?: {}) => Promise<unknown>;
190
+ getGiteaBranches: (input?: {}) => Promise<unknown>;
191
+ getGiteaRepositories: (input?: {}) => Promise<unknown>;
192
+ getGiteaUrl: (input?: {}) => Promise<unknown>;
193
+ giteaProviders: (input?: {}) => Promise<unknown>;
194
+ one: (input?: {}) => Promise<unknown>;
195
+ testConnection: (input?: {}) => Promise<unknown>;
196
+ update: (input?: {}) => Promise<unknown>;
197
+ };
198
+ github: {
199
+ getGithubBranches: (input?: {}) => Promise<unknown>;
200
+ getGithubRepositories: (input?: {}) => Promise<unknown>;
201
+ githubProviders: (input?: {}) => Promise<unknown>;
202
+ one: (input?: {}) => Promise<unknown>;
203
+ testConnection: (input?: {}) => Promise<unknown>;
204
+ update: (input?: {}) => Promise<unknown>;
205
+ };
206
+ gitlab: {
207
+ create: (input?: {}) => Promise<unknown>;
208
+ getGitlabBranches: (input?: {}) => Promise<unknown>;
209
+ getGitlabRepositories: (input?: {}) => Promise<unknown>;
210
+ gitlabProviders: (input?: {}) => Promise<unknown>;
211
+ one: (input?: {}) => Promise<unknown>;
212
+ testConnection: (input?: {}) => Promise<unknown>;
213
+ update: (input?: {}) => Promise<unknown>;
214
+ };
215
+ gitProvider: {
216
+ getAll: (input?: {}) => Promise<unknown>;
217
+ remove: (input?: {}) => Promise<unknown>;
218
+ };
219
+ licenseKey: {
220
+ activate: (input?: {}) => Promise<unknown>;
221
+ deactivate: (input?: {}) => Promise<unknown>;
222
+ getEnterpriseSettings: (input?: {}) => Promise<unknown>;
223
+ haveValidLicenseKey: (input?: {}) => Promise<unknown>;
224
+ updateEnterpriseSettings: (input?: {}) => Promise<unknown>;
225
+ validate: (input?: {}) => Promise<unknown>;
226
+ };
227
+ mariadb: {
228
+ changeStatus: (input?: {}) => Promise<unknown>;
229
+ create: (input?: {}) => Promise<unknown>;
230
+ deploy: (input?: {}) => Promise<unknown>;
231
+ move: (input?: {}) => Promise<unknown>;
232
+ one: (input?: {}) => Promise<unknown>;
233
+ rebuild: (input?: {}) => Promise<unknown>;
234
+ reload: (input?: {}) => Promise<unknown>;
235
+ remove: (input?: {}) => Promise<unknown>;
236
+ saveEnvironment: (input?: {}) => Promise<unknown>;
237
+ saveExternalPort: (input?: {}) => Promise<unknown>;
238
+ search: (input?: {}) => Promise<unknown>;
239
+ start: (input?: {}) => Promise<unknown>;
240
+ stop: (input?: {}) => Promise<unknown>;
241
+ update: (input?: {}) => Promise<unknown>;
242
+ };
243
+ mongo: {
244
+ changeStatus: (input?: {}) => Promise<unknown>;
245
+ create: (input?: {}) => Promise<unknown>;
246
+ deploy: (input?: {}) => Promise<unknown>;
247
+ move: (input?: {}) => Promise<unknown>;
248
+ one: (input?: {}) => Promise<unknown>;
249
+ rebuild: (input?: {}) => Promise<unknown>;
250
+ reload: (input?: {}) => Promise<unknown>;
251
+ remove: (input?: {}) => Promise<unknown>;
252
+ saveEnvironment: (input?: {}) => Promise<unknown>;
253
+ saveExternalPort: (input?: {}) => Promise<unknown>;
254
+ search: (input?: {}) => Promise<unknown>;
255
+ start: (input?: {}) => Promise<unknown>;
256
+ stop: (input?: {}) => Promise<unknown>;
257
+ update: (input?: {}) => Promise<unknown>;
258
+ };
259
+ mounts: {
260
+ allNamedByApplicationId: (input?: {}) => Promise<unknown>;
261
+ create: (input?: {}) => Promise<unknown>;
262
+ listByServiceId: (input?: {}) => Promise<unknown>;
263
+ one: (input?: {}) => Promise<unknown>;
264
+ remove: (input?: {}) => Promise<unknown>;
265
+ update: (input?: {}) => Promise<unknown>;
266
+ };
267
+ mysql: {
268
+ changeStatus: (input?: {}) => Promise<unknown>;
269
+ create: (input?: {}) => Promise<unknown>;
270
+ deploy: (input?: {}) => Promise<unknown>;
271
+ move: (input?: {}) => Promise<unknown>;
272
+ one: (input?: {}) => Promise<unknown>;
273
+ rebuild: (input?: {}) => Promise<unknown>;
274
+ reload: (input?: {}) => Promise<unknown>;
275
+ remove: (input?: {}) => Promise<unknown>;
276
+ saveEnvironment: (input?: {}) => Promise<unknown>;
277
+ saveExternalPort: (input?: {}) => Promise<unknown>;
278
+ search: (input?: {}) => Promise<unknown>;
279
+ start: (input?: {}) => Promise<unknown>;
280
+ stop: (input?: {}) => Promise<unknown>;
281
+ update: (input?: {}) => Promise<unknown>;
282
+ };
283
+ notification: {
284
+ all: (input?: {}) => Promise<unknown>;
285
+ createCustom: (input?: {}) => Promise<unknown>;
286
+ createDiscord: (input?: {}) => Promise<unknown>;
287
+ createEmail: (input?: {}) => Promise<unknown>;
288
+ createGotify: (input?: {}) => Promise<unknown>;
289
+ createLark: (input?: {}) => Promise<unknown>;
290
+ createNtfy: (input?: {}) => Promise<unknown>;
291
+ createPushover: (input?: {}) => Promise<unknown>;
292
+ createResend: (input?: {}) => Promise<unknown>;
293
+ createSlack: (input?: {}) => Promise<unknown>;
294
+ createTeams: (input?: {}) => Promise<unknown>;
295
+ createTelegram: (input?: {}) => Promise<unknown>;
296
+ getEmailProviders: (input?: {}) => Promise<unknown>;
297
+ one: (input?: {}) => Promise<unknown>;
298
+ receiveNotification: (input?: {}) => Promise<unknown>;
299
+ remove: (input?: {}) => Promise<unknown>;
300
+ testCustomConnection: (input?: {}) => Promise<unknown>;
301
+ testDiscordConnection: (input?: {}) => Promise<unknown>;
302
+ testEmailConnection: (input?: {}) => Promise<unknown>;
303
+ testGotifyConnection: (input?: {}) => Promise<unknown>;
304
+ testLarkConnection: (input?: {}) => Promise<unknown>;
305
+ testNtfyConnection: (input?: {}) => Promise<unknown>;
306
+ testPushoverConnection: (input?: {}) => Promise<unknown>;
307
+ testResendConnection: (input?: {}) => Promise<unknown>;
308
+ testSlackConnection: (input?: {}) => Promise<unknown>;
309
+ testTeamsConnection: (input?: {}) => Promise<unknown>;
310
+ testTelegramConnection: (input?: {}) => Promise<unknown>;
311
+ updateCustom: (input?: {}) => Promise<unknown>;
312
+ updateDiscord: (input?: {}) => Promise<unknown>;
313
+ updateEmail: (input?: {}) => Promise<unknown>;
314
+ updateGotify: (input?: {}) => Promise<unknown>;
315
+ updateLark: (input?: {}) => Promise<unknown>;
316
+ updateNtfy: (input?: {}) => Promise<unknown>;
317
+ updatePushover: (input?: {}) => Promise<unknown>;
318
+ updateResend: (input?: {}) => Promise<unknown>;
319
+ updateSlack: (input?: {}) => Promise<unknown>;
320
+ updateTeams: (input?: {}) => Promise<unknown>;
321
+ updateTelegram: (input?: {}) => Promise<unknown>;
322
+ };
323
+ organization: {
324
+ active: (input?: {}) => Promise<unknown>;
325
+ all: (input?: {}) => Promise<unknown>;
326
+ allInvitations: (input?: {}) => Promise<unknown>;
327
+ create: (input?: {}) => Promise<unknown>;
328
+ delete: (input?: {}) => Promise<unknown>;
329
+ inviteMember: (input?: {}) => Promise<unknown>;
330
+ one: (input?: {}) => Promise<unknown>;
331
+ removeInvitation: (input?: {}) => Promise<unknown>;
332
+ setDefault: (input?: {}) => Promise<unknown>;
333
+ update: (input?: {}) => Promise<unknown>;
334
+ updateMemberRole: (input?: {}) => Promise<unknown>;
335
+ };
336
+ patch: {
337
+ byEntityId: (input?: {}) => Promise<unknown>;
338
+ cleanPatchRepos: (input?: {}) => Promise<unknown>;
339
+ create: (input?: {}) => Promise<unknown>;
340
+ delete: (input?: {}) => Promise<unknown>;
341
+ ensureRepo: (input?: {}) => Promise<unknown>;
342
+ markFileForDeletion: (input?: {}) => Promise<unknown>;
343
+ one: (input?: {}) => Promise<unknown>;
344
+ readRepoDirectories: (input?: {}) => Promise<unknown>;
345
+ readRepoFile: (input?: {}) => Promise<unknown>;
346
+ saveFileAsPatch: (input?: {}) => Promise<unknown>;
347
+ toggleEnabled: (input?: {}) => Promise<unknown>;
348
+ update: (input?: {}) => Promise<unknown>;
349
+ };
350
+ port: {
351
+ create: (input?: {}) => Promise<unknown>;
352
+ delete: (input?: {}) => Promise<unknown>;
353
+ one: (input?: {}) => Promise<unknown>;
354
+ update: (input?: {}) => Promise<unknown>;
355
+ };
356
+ postgres: {
357
+ changeStatus: (input?: {}) => Promise<unknown>;
358
+ create: (input?: {}) => Promise<unknown>;
359
+ deploy: (input?: {}) => Promise<unknown>;
360
+ move: (input?: {}) => Promise<unknown>;
361
+ one: (input?: {}) => Promise<unknown>;
362
+ rebuild: (input?: {}) => Promise<unknown>;
363
+ reload: (input?: {}) => Promise<unknown>;
364
+ remove: (input?: {}) => Promise<unknown>;
365
+ saveEnvironment: (input?: {}) => Promise<unknown>;
366
+ saveExternalPort: (input?: {}) => Promise<unknown>;
367
+ search: (input?: {}) => Promise<unknown>;
368
+ start: (input?: {}) => Promise<unknown>;
369
+ stop: (input?: {}) => Promise<unknown>;
370
+ update: (input?: {}) => Promise<unknown>;
371
+ };
372
+ previewDeployment: {
373
+ all: (input?: {}) => Promise<unknown>;
374
+ delete: (input?: {}) => Promise<unknown>;
375
+ one: (input?: {}) => Promise<unknown>;
376
+ redeploy: (input?: {}) => Promise<unknown>;
377
+ };
378
+ project: {
379
+ all: (input?: {}) => Promise<unknown>;
380
+ allForPermissions: (input?: {}) => Promise<unknown>;
381
+ create: (input?: {}) => Promise<unknown>;
382
+ duplicate: (input?: {}) => Promise<unknown>;
383
+ one: (input?: {}) => Promise<unknown>;
384
+ remove: (input?: {}) => Promise<unknown>;
385
+ search: (input?: {}) => Promise<unknown>;
386
+ update: (input?: {}) => Promise<unknown>;
387
+ };
388
+ redirects: {
389
+ create: (input?: {}) => Promise<unknown>;
390
+ delete: (input?: {}) => Promise<unknown>;
391
+ one: (input?: {}) => Promise<unknown>;
392
+ update: (input?: {}) => Promise<unknown>;
393
+ };
394
+ redis: {
395
+ changeStatus: (input?: {}) => Promise<unknown>;
396
+ create: (input?: {}) => Promise<unknown>;
397
+ deploy: (input?: {}) => Promise<unknown>;
398
+ move: (input?: {}) => Promise<unknown>;
399
+ one: (input?: {}) => Promise<unknown>;
400
+ rebuild: (input?: {}) => Promise<unknown>;
401
+ reload: (input?: {}) => Promise<unknown>;
402
+ remove: (input?: {}) => Promise<unknown>;
403
+ saveEnvironment: (input?: {}) => Promise<unknown>;
404
+ saveExternalPort: (input?: {}) => Promise<unknown>;
405
+ search: (input?: {}) => Promise<unknown>;
406
+ start: (input?: {}) => Promise<unknown>;
407
+ stop: (input?: {}) => Promise<unknown>;
408
+ update: (input?: {}) => Promise<unknown>;
409
+ };
410
+ registry: {
411
+ all: (input?: {}) => Promise<unknown>;
412
+ create: (input?: {}) => Promise<unknown>;
413
+ one: (input?: {}) => Promise<unknown>;
414
+ remove: (input?: {}) => Promise<unknown>;
415
+ testRegistry: (input?: {}) => Promise<unknown>;
416
+ testRegistryById: (input?: {}) => Promise<unknown>;
417
+ update: (input?: {}) => Promise<unknown>;
418
+ };
419
+ rollback: {
420
+ delete: (input?: {}) => Promise<unknown>;
421
+ rollback: (input?: {}) => Promise<unknown>;
422
+ };
423
+ schedule: {
424
+ create: (input?: {}) => Promise<unknown>;
425
+ delete: (input?: {}) => Promise<unknown>;
426
+ list: (input?: {}) => Promise<unknown>;
427
+ one: (input?: {}) => Promise<unknown>;
428
+ runManually: (input?: {}) => Promise<unknown>;
429
+ update: (input?: {}) => Promise<unknown>;
430
+ };
431
+ security: {
432
+ create: (input?: {}) => Promise<unknown>;
433
+ delete: (input?: {}) => Promise<unknown>;
434
+ one: (input?: {}) => Promise<unknown>;
435
+ update: (input?: {}) => Promise<unknown>;
436
+ };
437
+ server: {
438
+ all: (input?: {}) => Promise<unknown>;
439
+ buildServers: (input?: {}) => Promise<unknown>;
440
+ count: (input?: {}) => Promise<unknown>;
441
+ create: (input?: {}) => Promise<unknown>;
442
+ getDefaultCommand: (input?: {}) => Promise<unknown>;
443
+ getServerMetrics: (input?: {}) => Promise<unknown>;
444
+ getServerTime: (input?: {}) => Promise<unknown>;
445
+ one: (input?: {}) => Promise<unknown>;
446
+ publicIp: (input?: {}) => Promise<unknown>;
447
+ remove: (input?: {}) => Promise<unknown>;
448
+ security: (input?: {}) => Promise<unknown>;
449
+ setup: (input?: {}) => Promise<unknown>;
450
+ setupMonitoring: (input?: {}) => Promise<unknown>;
451
+ update: (input?: {}) => Promise<unknown>;
452
+ validate: (input?: {}) => Promise<unknown>;
453
+ withSSHKey: (input?: {}) => Promise<unknown>;
454
+ };
455
+ settings: {
456
+ assignDomainServer: (input?: {}) => Promise<unknown>;
457
+ checkGPUStatus: (input?: {}) => Promise<unknown>;
458
+ cleanAll: (input?: {}) => Promise<unknown>;
459
+ cleanAllDeploymentQueue: (input?: {}) => Promise<unknown>;
460
+ cleanDockerBuilder: (input?: {}) => Promise<unknown>;
461
+ cleanDockerPrune: (input?: {}) => Promise<unknown>;
462
+ cleanMonitoring: (input?: {}) => Promise<unknown>;
463
+ cleanRedis: (input?: {}) => Promise<unknown>;
464
+ cleanSSHPrivateKey: (input?: {}) => Promise<unknown>;
465
+ cleanStoppedContainers: (input?: {}) => Promise<unknown>;
466
+ cleanUnusedImages: (input?: {}) => Promise<unknown>;
467
+ cleanUnusedVolumes: (input?: {}) => Promise<unknown>;
468
+ getDokployCloudIps: (input?: {}) => Promise<unknown>;
469
+ getDokployVersion: (input?: {}) => Promise<unknown>;
470
+ getIp: (input?: {}) => Promise<unknown>;
471
+ getLogCleanupStatus: (input?: {}) => Promise<unknown>;
472
+ getOpenApiDocument: (input?: {}) => Promise<unknown>;
473
+ getReleaseTag: (input?: {}) => Promise<unknown>;
474
+ getTraefikPorts: (input?: {}) => Promise<unknown>;
475
+ getUpdateData: (input?: {}) => Promise<unknown>;
476
+ getWebServerSettings: (input?: {}) => Promise<unknown>;
477
+ haveActivateRequests: (input?: {}) => Promise<unknown>;
478
+ haveTraefikDashboardPortEnabled: (input?: {}) => Promise<unknown>;
479
+ health: (input?: {}) => Promise<unknown>;
480
+ isCloud: (input?: {}) => Promise<unknown>;
481
+ isUserSubscribed: (input?: {}) => Promise<unknown>;
482
+ readDirectories: (input?: {}) => Promise<unknown>;
483
+ readMiddlewareTraefikConfig: (input?: {}) => Promise<unknown>;
484
+ readTraefikConfig: (input?: {}) => Promise<unknown>;
485
+ readTraefikEnv: (input?: {}) => Promise<unknown>;
486
+ readTraefikFile: (input?: {}) => Promise<unknown>;
487
+ readWebServerTraefikConfig: (input?: {}) => Promise<unknown>;
488
+ reloadRedis: (input?: {}) => Promise<unknown>;
489
+ reloadServer: (input?: {}) => Promise<unknown>;
490
+ reloadTraefik: (input?: {}) => Promise<unknown>;
491
+ saveSSHPrivateKey: (input?: {}) => Promise<unknown>;
492
+ setupGPU: (input?: {}) => Promise<unknown>;
493
+ toggleDashboard: (input?: {}) => Promise<unknown>;
494
+ toggleRequests: (input?: {}) => Promise<unknown>;
495
+ updateDockerCleanup: (input?: {}) => Promise<unknown>;
496
+ updateLogCleanup: (input?: {}) => Promise<unknown>;
497
+ updateMiddlewareTraefikConfig: (input?: {}) => Promise<unknown>;
498
+ updateServer: (input?: {}) => Promise<unknown>;
499
+ updateServerIp: (input?: {}) => Promise<unknown>;
500
+ updateTraefikConfig: (input?: {}) => Promise<unknown>;
501
+ updateTraefikFile: (input?: {}) => Promise<unknown>;
502
+ updateTraefikPorts: (input?: {}) => Promise<unknown>;
503
+ updateWebServerTraefikConfig: (input?: {}) => Promise<unknown>;
504
+ writeTraefikEnv: (input?: {}) => Promise<unknown>;
505
+ };
506
+ sshKey: {
507
+ all: (input?: {}) => Promise<unknown>;
508
+ create: (input?: {}) => Promise<unknown>;
509
+ generate: (input?: {}) => Promise<unknown>;
510
+ one: (input?: {}) => Promise<unknown>;
511
+ remove: (input?: {}) => Promise<unknown>;
512
+ update: (input?: {}) => Promise<unknown>;
513
+ };
514
+ sso: {
515
+ addTrustedOrigin: (input?: {}) => Promise<unknown>;
516
+ deleteProvider: (input?: {}) => Promise<unknown>;
517
+ getTrustedOrigins: (input?: {}) => Promise<unknown>;
518
+ listProviders: (input?: {}) => Promise<unknown>;
519
+ one: (input?: {}) => Promise<unknown>;
520
+ register: (input?: {}) => Promise<unknown>;
521
+ removeTrustedOrigin: (input?: {}) => Promise<unknown>;
522
+ showSignInWithSSO: (input?: {}) => Promise<unknown>;
523
+ update: (input?: {}) => Promise<unknown>;
524
+ updateTrustedOrigin: (input?: {}) => Promise<unknown>;
525
+ };
526
+ stripe: {
527
+ canCreateMoreServers: (input?: {}) => Promise<unknown>;
528
+ createCheckoutSession: (input?: {}) => Promise<unknown>;
529
+ createCustomerPortalSession: (input?: {}) => Promise<unknown>;
530
+ getCurrentPlan: (input?: {}) => Promise<unknown>;
531
+ getInvoices: (input?: {}) => Promise<unknown>;
532
+ getProducts: (input?: {}) => Promise<unknown>;
533
+ upgradeSubscription: (input?: {}) => Promise<unknown>;
534
+ };
535
+ swarm: {
536
+ getNodeApps: (input?: {}) => Promise<unknown>;
537
+ getNodeInfo: (input?: {}) => Promise<unknown>;
538
+ getNodes: (input?: {}) => Promise<unknown>;
539
+ };
540
+ user: {
541
+ all: (input?: {}) => Promise<unknown>;
542
+ assignPermissions: (input?: {}) => Promise<unknown>;
543
+ checkUserOrganizations: (input?: {}) => Promise<unknown>;
544
+ createApiKey: (input?: {}) => Promise<unknown>;
545
+ deleteApiKey: (input?: {}) => Promise<unknown>;
546
+ generateToken: (input?: {}) => Promise<unknown>;
547
+ get: (input?: {}) => Promise<unknown>;
548
+ getBackups: (input?: {}) => Promise<unknown>;
549
+ getContainerMetrics: (input?: {}) => Promise<unknown>;
550
+ getInvitations: (input?: {}) => Promise<unknown>;
551
+ getMetricsToken: (input?: {}) => Promise<unknown>;
552
+ getPermissions: (input?: {}) => Promise<unknown>;
553
+ getServerMetrics: (input?: {}) => Promise<unknown>;
554
+ getUserByToken: (input?: {}) => Promise<unknown>;
555
+ haveRootAccess: (input?: {}) => Promise<unknown>;
556
+ one: (input?: {}) => Promise<unknown>;
557
+ remove: (input?: {}) => Promise<unknown>;
558
+ sendInvitation: (input?: {}) => Promise<unknown>;
559
+ session: (input?: {}) => Promise<unknown>;
560
+ update: (input?: {}) => Promise<unknown>;
561
+ };
562
+ volumeBackups: {
563
+ create: (input?: {}) => Promise<unknown>;
564
+ delete: (input?: {}) => Promise<unknown>;
565
+ list: (input?: {}) => Promise<unknown>;
566
+ one: (input?: {}) => Promise<unknown>;
567
+ runManually: (input?: {}) => Promise<unknown>;
568
+ update: (input?: {}) => Promise<unknown>;
569
+ };
570
+ whitelabeling: {
571
+ get: (input?: {}) => Promise<unknown>;
572
+ getPublic: (input?: {}) => Promise<unknown>;
573
+ reset: (input?: {}) => Promise<unknown>;
574
+ update: (input?: {}) => Promise<unknown>;
575
+ };
576
+ };
577
+ helpers: {
578
+ sleep(ms: number): Promise<void>;
579
+ assert(condition: unknown, message?: string): void;
580
+ pick<T extends Record<string, unknown>, K extends keyof T>(value: T, keys: K[]): Pick<T, K>;
581
+ limit<T>(items: T[], count: number): T[];
582
+ selectOne<T>(items: T[], predicate?: (item: T) => boolean): NonNullable<T> | null;
583
+ paginateUntil<T>(fetchPage: (offset: number) => Promise<{
584
+ items: T[];
585
+ total?: number;
586
+ }>, predicate: (item: T) => boolean, pageSize?: number): Promise<NonNullable<T> | null>;
587
+ };
588
+ getCalls: () => import("../gateway/trace.js").GatewayTraceEntry[];
589
+ };
590
+ export {};
@@ -0,0 +1,64 @@
1
+ import { createGeneratedDokployRuntime } from '../../generated/dokploy-sdk.js';
2
+ export function buildHelpers() {
3
+ return {
4
+ sleep(ms) {
5
+ const clamped = Math.min(Math.max(0, ms), 15_000);
6
+ return new Promise((resolve) => setTimeout(resolve, clamped));
7
+ },
8
+ assert(condition, message = 'Assertion failed') {
9
+ if (!condition) {
10
+ throw new Error(message);
11
+ }
12
+ },
13
+ pick(value, keys) {
14
+ return Object.fromEntries(keys.map((key) => [key, value[key]]));
15
+ },
16
+ limit(items, count) {
17
+ return items.slice(0, count);
18
+ },
19
+ selectOne(items, predicate) {
20
+ if (!predicate)
21
+ return items[0] ?? null;
22
+ return items.find(predicate) ?? null;
23
+ },
24
+ async paginateUntil(fetchPage, predicate, pageSize = 20) {
25
+ let offset = 0;
26
+ while (true) {
27
+ const page = await fetchPage(offset);
28
+ const found = page.items.find(predicate);
29
+ if (found)
30
+ return found;
31
+ if (page.items.length < pageSize)
32
+ return null;
33
+ offset += pageSize;
34
+ }
35
+ },
36
+ };
37
+ }
38
+ export function createCallTracker(executor, maxCalls) {
39
+ const traces = [];
40
+ let callCount = 0;
41
+ async function call(procedure, input = {}) {
42
+ callCount += 1;
43
+ if (callCount > maxCalls) {
44
+ throw new Error(`Code Mode execute exceeded ${maxCalls} API calls.`);
45
+ }
46
+ const result = await executor(procedure, input);
47
+ traces.push(result.trace);
48
+ return result.data;
49
+ }
50
+ return {
51
+ call,
52
+ getCalls() {
53
+ return traces;
54
+ },
55
+ };
56
+ }
57
+ export function createExecuteContext(executor, maxCalls) {
58
+ const tracker = createCallTracker(executor, maxCalls);
59
+ return {
60
+ dokploy: createGeneratedDokployRuntime(tracker.call),
61
+ helpers: buildHelpers(),
62
+ getCalls: tracker.getCalls,
63
+ };
64
+ }