@dokploy/cli 0.2.6 → 0.2.7

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 (31) hide show
  1. package/dist/commands/app/create.js +1 -1
  2. package/dist/commands/app/delete.js +1 -1
  3. package/dist/commands/app/deploy.js +1 -1
  4. package/dist/commands/app/stop.js +1 -1
  5. package/dist/commands/authenticate.js +6 -2
  6. package/dist/commands/database/mariadb/create.js +1 -12
  7. package/dist/commands/database/mariadb/delete.js +1 -1
  8. package/dist/commands/database/mariadb/deploy.js +1 -1
  9. package/dist/commands/database/mariadb/stop.js +1 -1
  10. package/dist/commands/database/mongo/create.js +1 -1
  11. package/dist/commands/database/mongo/delete.js +1 -1
  12. package/dist/commands/database/mongo/deploy.js +1 -1
  13. package/dist/commands/database/mongo/stop.js +1 -1
  14. package/dist/commands/database/mysql/create.js +1 -12
  15. package/dist/commands/database/mysql/delete.js +1 -1
  16. package/dist/commands/database/mysql/deploy.js +1 -1
  17. package/dist/commands/database/mysql/stop.js +1 -1
  18. package/dist/commands/database/postgres/create.js +1 -11
  19. package/dist/commands/database/postgres/delete.js +1 -1
  20. package/dist/commands/database/postgres/deploy.js +1 -1
  21. package/dist/commands/database/postgres/stop.js +1 -1
  22. package/dist/commands/database/redis/create.js +1 -9
  23. package/dist/commands/database/redis/delete.js +1 -1
  24. package/dist/commands/database/redis/deploy.js +1 -1
  25. package/dist/commands/database/redis/stop.js +1 -1
  26. package/dist/commands/env/push.js +2 -2
  27. package/dist/commands/project/create.js +1 -5
  28. package/dist/commands/verify.js +2 -2
  29. package/dist/utils/shared.js +2 -2
  30. package/oclif.manifest.json +61 -61
  31. package/package.json +1 -1
@@ -111,7 +111,7 @@ export default class AppCreate extends Command {
111
111
  },
112
112
  }, {
113
113
  headers: {
114
- Authorization: `Bearer ${auth.token}`,
114
+ "x-api-key": auth.token,
115
115
  "Content-Type": "application/json",
116
116
  },
117
117
  });
@@ -90,7 +90,7 @@ export default class AppDelete extends Command {
90
90
  },
91
91
  }, {
92
92
  headers: {
93
- Authorization: `Bearer ${auth.token}`,
93
+ "x-api-key": auth.token,
94
94
  "Content-Type": "application/json",
95
95
  },
96
96
  });
@@ -91,7 +91,7 @@ export default class AppDeploy extends Command {
91
91
  },
92
92
  }, {
93
93
  headers: {
94
- Authorization: `Bearer ${auth.token}`,
94
+ "x-api-key": auth.token,
95
95
  "Content-Type": "application/json",
96
96
  },
97
97
  });
@@ -86,7 +86,7 @@ export default class AppStop extends Command {
86
86
  },
87
87
  }, {
88
88
  headers: {
89
- Authorization: `Bearer ${auth.token}`,
89
+ "x-api-key": auth.token,
90
90
  "Content-Type": "application/json",
91
91
  },
92
92
  });
@@ -61,9 +61,9 @@ export default class Authenticate extends Command {
61
61
  config.url = url;
62
62
  try {
63
63
  console.log(`\n${chalk.blue("Validating server...")}`);
64
- await axios.post(`${url}/api/trpc/auth.verifyToken`, {}, {
64
+ await axios.get(`${url}/api/trpc/user.get`, {
65
65
  headers: {
66
- Authorization: `Bearer ${token}`,
66
+ "x-api-key": token,
67
67
  "Content-Type": "application/json",
68
68
  },
69
69
  });
@@ -77,3 +77,7 @@ export default class Authenticate extends Command {
77
77
  }
78
78
  }
79
79
  }
80
+ // curl -X 'GET' \
81
+ // 'https://panel.jinza.app/api/project.all' \
82
+ // -H 'accept: application/json' \
83
+ // -H 'x-api-key: EawCkTREMhxoAqvCxJFZurgCGoDZPjYHHrLgUPghRjJTpXLaahFdhCOGfABZXTRP'
@@ -158,17 +158,6 @@ export default class DatabaseMariadbCreate extends Command {
158
158
  }
159
159
  }
160
160
  try {
161
- console.log(JSON.stringify({
162
- name,
163
- databaseName,
164
- description,
165
- databaseRootPassword,
166
- databasePassword,
167
- databaseUser,
168
- dockerImage,
169
- appName,
170
- projectId,
171
- }, null, 2));
172
161
  const response = await axios.post(`${auth.url}/api/trpc/mariadb.create`, {
173
162
  json: {
174
163
  name,
@@ -183,7 +172,7 @@ export default class DatabaseMariadbCreate extends Command {
183
172
  },
184
173
  }, {
185
174
  headers: {
186
- Authorization: `Bearer ${auth.token}`,
175
+ "x-api-key": auth.token,
187
176
  "Content-Type": "application/json",
188
177
  },
189
178
  });
@@ -88,7 +88,7 @@ export default class DatabaseMariadbDelete extends Command {
88
88
  },
89
89
  }, {
90
90
  headers: {
91
- Authorization: `Bearer ${auth.token}`,
91
+ "x-api-key": auth.token,
92
92
  "Content-Type": "application/json",
93
93
  },
94
94
  });
@@ -87,7 +87,7 @@ export default class DatabaseMariadbDeploy extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -87,7 +87,7 @@ export default class DatabaseMariadbStop extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -160,7 +160,7 @@ export default class DatabaseMongoCreate extends Command {
160
160
  },
161
161
  }, {
162
162
  headers: {
163
- Authorization: `Bearer ${auth.token}`,
163
+ "x-api-key": auth.token,
164
164
  "Content-Type": "application/json",
165
165
  },
166
166
  });
@@ -90,7 +90,7 @@ export default class DatabaseMongoDelete extends Command {
90
90
  },
91
91
  }, {
92
92
  headers: {
93
- Authorization: `Bearer ${auth.token}`,
93
+ "x-api-key": auth.token,
94
94
  "Content-Type": "application/json",
95
95
  },
96
96
  });
@@ -87,7 +87,7 @@ export default class DatabaseMongoDeploy extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -87,7 +87,7 @@ export default class DatabaseMongoStop extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -158,17 +158,6 @@ export default class DatabaseMysqlCreate extends Command {
158
158
  }
159
159
  }
160
160
  try {
161
- console.log(JSON.stringify({
162
- name,
163
- databaseName,
164
- description,
165
- databaseRootPassword,
166
- databasePassword,
167
- databaseUser,
168
- dockerImage,
169
- appName,
170
- projectId,
171
- }, null, 2));
172
161
  const response = await axios.post(`${auth.url}/api/trpc/mysql.create`, {
173
162
  json: {
174
163
  name,
@@ -183,7 +172,7 @@ export default class DatabaseMysqlCreate extends Command {
183
172
  },
184
173
  }, {
185
174
  headers: {
186
- Authorization: `Bearer ${auth.token}`,
175
+ "x-api-key": auth.token,
187
176
  "Content-Type": "application/json",
188
177
  },
189
178
  });
@@ -90,7 +90,7 @@ export default class DatabaseMysqlDelete extends Command {
90
90
  },
91
91
  }, {
92
92
  headers: {
93
- Authorization: `Bearer ${auth.token}`,
93
+ "x-api-key": auth.token,
94
94
  "Content-Type": "application/json",
95
95
  },
96
96
  });
@@ -70,7 +70,7 @@ export default class DatabaseMysqlDeploy extends Command {
70
70
  },
71
71
  }, {
72
72
  headers: {
73
- Authorization: `Bearer ${auth.token}`,
73
+ "x-api-key": auth.token,
74
74
  "Content-Type": "application/json",
75
75
  },
76
76
  });
@@ -70,7 +70,7 @@ export default class DatabaseMysqlStop extends Command {
70
70
  },
71
71
  }, {
72
72
  headers: {
73
- Authorization: `Bearer ${auth.token}`,
73
+ "x-api-key": auth.token,
74
74
  "Content-Type": "application/json",
75
75
  },
76
76
  });
@@ -147,16 +147,6 @@ export default class DatabasePostgresCreate extends Command {
147
147
  }
148
148
  }
149
149
  try {
150
- console.log(JSON.stringify({
151
- name,
152
- databaseName,
153
- description,
154
- databasePassword,
155
- databaseUser,
156
- dockerImage,
157
- appName,
158
- projectId,
159
- }, null, 2));
160
150
  const response = await axios.post(`${auth.url}/api/trpc/postgres.create`, {
161
151
  json: {
162
152
  name,
@@ -170,7 +160,7 @@ export default class DatabasePostgresCreate extends Command {
170
160
  },
171
161
  }, {
172
162
  headers: {
173
- Authorization: `Bearer ${auth.token}`,
163
+ "x-api-key": auth.token,
174
164
  "Content-Type": "application/json",
175
165
  },
176
166
  });
@@ -90,7 +90,7 @@ export default class DatabasePostgresDelete extends Command {
90
90
  },
91
91
  }, {
92
92
  headers: {
93
- Authorization: `Bearer ${auth.token}`,
93
+ "x-api-key": auth.token,
94
94
  "Content-Type": "application/json",
95
95
  },
96
96
  });
@@ -87,7 +87,7 @@ export default class DatabasePostgresDeploy extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -87,7 +87,7 @@ export default class DatabasePostgresStop extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -124,14 +124,6 @@ export default class DatabaseRedisCreate extends Command {
124
124
  }
125
125
  }
126
126
  try {
127
- console.log(JSON.stringify({
128
- name,
129
- description,
130
- databasePassword,
131
- dockerImage,
132
- appName,
133
- projectId,
134
- }, null, 2));
135
127
  const response = await axios.post(`${auth.url}/api/trpc/redis.create`, {
136
128
  json: {
137
129
  name,
@@ -143,7 +135,7 @@ export default class DatabaseRedisCreate extends Command {
143
135
  },
144
136
  }, {
145
137
  headers: {
146
- Authorization: `Bearer ${auth.token}`,
138
+ "x-api-key": auth.token,
147
139
  "Content-Type": "application/json",
148
140
  },
149
141
  });
@@ -90,7 +90,7 @@ export default class DatabaseRedisDelete extends Command {
90
90
  },
91
91
  }, {
92
92
  headers: {
93
- Authorization: `Bearer ${auth.token}`,
93
+ "x-api-key": auth.token,
94
94
  "Content-Type": "application/json",
95
95
  },
96
96
  });
@@ -87,7 +87,7 @@ export default class DatabaseRedisDeploy extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -87,7 +87,7 @@ export default class DatabaseRedisStop extends Command {
87
87
  },
88
88
  }, {
89
89
  headers: {
90
- Authorization: `Bearer ${auth.token}`,
90
+ "x-api-key": auth.token,
91
91
  "Content-Type": "application/json",
92
92
  },
93
93
  });
@@ -75,7 +75,7 @@ export default class EnvPush extends Command {
75
75
  }
76
76
  }, {
77
77
  headers: {
78
- Authorization: `Bearer ${auth.token}`,
78
+ "x-api-key": auth.token,
79
79
  "Content-Type": "application/json",
80
80
  },
81
81
  });
@@ -93,7 +93,7 @@ export default class EnvPush extends Command {
93
93
  }
94
94
  }, {
95
95
  headers: {
96
- Authorization: `Bearer ${auth.token}`,
96
+ "x-api-key": auth.token,
97
97
  "Content-Type": "application/json",
98
98
  },
99
99
  });
@@ -66,10 +66,6 @@ export default class ProjectCreate extends Command {
66
66
  }
67
67
  }
68
68
  try {
69
- console.log(JSON.stringify({
70
- name,
71
- description,
72
- }, null, 2));
73
69
  const response = await axios.post(`${auth.url}/api/trpc/project.create`, {
74
70
  json: {
75
71
  name,
@@ -77,7 +73,7 @@ export default class ProjectCreate extends Command {
77
73
  },
78
74
  }, {
79
75
  headers: {
80
- Authorization: `Bearer ${auth.token}`,
76
+ "x-api-key": auth.token,
81
77
  "Content-Type": "application/json",
82
78
  },
83
79
  });
@@ -42,9 +42,9 @@ export default class Verify extends Command {
42
42
  // Validar el token contra el servidor
43
43
  try {
44
44
  console.log(chalk.blue("Validating token with server..."));
45
- const response = await axios.post(`${url}/api/trpc/auth.verifyToken`, {}, {
45
+ const response = await axios.get(`${url}/api/trpc/user.get`, {
46
46
  headers: {
47
- Authorization: `Bearer ${token}`,
47
+ "x-api-key": token,
48
48
  "Content-Type": "application/json",
49
49
  },
50
50
  });
@@ -4,7 +4,7 @@ export const getProjects = async (auth, command) => {
4
4
  try {
5
5
  const response = await axios.get(`${auth.url}/api/trpc/project.all`, {
6
6
  headers: {
7
- Authorization: `Bearer ${auth.token}`,
7
+ "x-api-key": auth.token,
8
8
  "Content-Type": "application/json",
9
9
  },
10
10
  });
@@ -30,7 +30,7 @@ export const getProject = async (projectId, auth, command) => {
30
30
  }
31
31
  const response = await axios.get(`${auth.url}/api/trpc/project.one`, {
32
32
  headers: {
33
- Authorization: `Bearer ${auth.token}`,
33
+ "x-api-key": auth.token,
34
34
  "Content-Type": "application/json",
35
35
  },
36
36
  params: {
@@ -284,66 +284,6 @@
284
284
  "stop.js"
285
285
  ]
286
286
  },
287
- "env:pull": {
288
- "aliases": [],
289
- "args": {
290
- "file": {
291
- "description": "write to file",
292
- "name": "file",
293
- "required": true
294
- }
295
- },
296
- "description": "Store remote environment variables in local",
297
- "examples": [
298
- "<%= config.bin %> <%= command.id %> .env.stage.local"
299
- ],
300
- "flags": {},
301
- "hasDynamicHelp": false,
302
- "hiddenAliases": [],
303
- "id": "env:pull",
304
- "pluginAlias": "@dokploy/cli",
305
- "pluginName": "@dokploy/cli",
306
- "pluginType": "core",
307
- "strict": true,
308
- "enableJsonFlag": false,
309
- "isESM": true,
310
- "relativePath": [
311
- "dist",
312
- "commands",
313
- "env",
314
- "pull.js"
315
- ]
316
- },
317
- "env:push": {
318
- "aliases": [],
319
- "args": {
320
- "file": {
321
- "description": ".env file to push",
322
- "name": "file",
323
- "required": true
324
- }
325
- },
326
- "description": "Push dotenv file to remote service",
327
- "examples": [
328
- "<%= config.bin %> <%= command.id %> .env.stage.local"
329
- ],
330
- "flags": {},
331
- "hasDynamicHelp": false,
332
- "hiddenAliases": [],
333
- "id": "env:push",
334
- "pluginAlias": "@dokploy/cli",
335
- "pluginName": "@dokploy/cli",
336
- "pluginType": "core",
337
- "strict": true,
338
- "enableJsonFlag": false,
339
- "isESM": true,
340
- "relativePath": [
341
- "dist",
342
- "commands",
343
- "env",
344
- "push.js"
345
- ]
346
- },
347
287
  "project:create": {
348
288
  "aliases": [],
349
289
  "args": {},
@@ -455,6 +395,66 @@
455
395
  "list.js"
456
396
  ]
457
397
  },
398
+ "env:pull": {
399
+ "aliases": [],
400
+ "args": {
401
+ "file": {
402
+ "description": "write to file",
403
+ "name": "file",
404
+ "required": true
405
+ }
406
+ },
407
+ "description": "Store remote environment variables in local",
408
+ "examples": [
409
+ "<%= config.bin %> <%= command.id %> .env.stage.local"
410
+ ],
411
+ "flags": {},
412
+ "hasDynamicHelp": false,
413
+ "hiddenAliases": [],
414
+ "id": "env:pull",
415
+ "pluginAlias": "@dokploy/cli",
416
+ "pluginName": "@dokploy/cli",
417
+ "pluginType": "core",
418
+ "strict": true,
419
+ "enableJsonFlag": false,
420
+ "isESM": true,
421
+ "relativePath": [
422
+ "dist",
423
+ "commands",
424
+ "env",
425
+ "pull.js"
426
+ ]
427
+ },
428
+ "env:push": {
429
+ "aliases": [],
430
+ "args": {
431
+ "file": {
432
+ "description": ".env file to push",
433
+ "name": "file",
434
+ "required": true
435
+ }
436
+ },
437
+ "description": "Push dotenv file to remote service",
438
+ "examples": [
439
+ "<%= config.bin %> <%= command.id %> .env.stage.local"
440
+ ],
441
+ "flags": {},
442
+ "hasDynamicHelp": false,
443
+ "hiddenAliases": [],
444
+ "id": "env:push",
445
+ "pluginAlias": "@dokploy/cli",
446
+ "pluginName": "@dokploy/cli",
447
+ "pluginType": "core",
448
+ "strict": true,
449
+ "enableJsonFlag": false,
450
+ "isESM": true,
451
+ "relativePath": [
452
+ "dist",
453
+ "commands",
454
+ "env",
455
+ "push.js"
456
+ ]
457
+ },
458
458
  "database:mariadb:create": {
459
459
  "aliases": [],
460
460
  "args": {},
@@ -1676,5 +1676,5 @@
1676
1676
  ]
1677
1677
  }
1678
1678
  },
1679
- "version": "v0.2.6"
1679
+ "version": "v0.2.7"
1680
1680
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dokploy/cli",
3
3
  "description": "A CLI to manage dokploy server remotely",
4
- "version": "v0.2.6",
4
+ "version": "v0.2.7",
5
5
  "author": "Mauricio Siu",
6
6
  "licenses": [{
7
7
  "type": "MIT",