clever-tools 2.10.0 → 2.10.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.
- package/CHANGELOG.md +11 -0
- package/bin/clever.js +6 -2
- package/package.json +1 -1
- package/src/commands/database.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Unrelease (????-??-??)
|
|
4
4
|
|
|
5
|
+
## 2.10.1 (2023-02-20)
|
|
6
|
+
|
|
7
|
+
* `clever database` command
|
|
8
|
+
* Improve output when trying
|
|
9
|
+
* `clever database backups` command
|
|
10
|
+
* Improve output when there are no backups yet
|
|
11
|
+
* Fix command with personal orga
|
|
12
|
+
* Improve example for `database-id` option
|
|
13
|
+
|
|
14
|
+
## 2.10.0 (2023-02-16)
|
|
15
|
+
|
|
5
16
|
* add `clever database backups DATABASE-ID` command to list backups of a database
|
|
6
17
|
* add `clever database backups download DATABASE-ID BACKUP-IP` command to download a backup
|
|
7
18
|
* add `clever curl` so we can prefix any `curl` command with `clever` and benefit from the local oAuth v1 auth
|
package/bin/clever.js
CHANGED
|
@@ -89,7 +89,7 @@ function run () {
|
|
|
89
89
|
}),
|
|
90
90
|
appNameCreation: cliparse.argument('app-name', { description: 'Application name' }),
|
|
91
91
|
backupId: cliparse.argument('backup-id', { description: 'A Database backup ID (format: UUID)' }),
|
|
92
|
-
databaseId: cliparse.argument('database-id', { description: 'A database ID (format:
|
|
92
|
+
databaseId: cliparse.argument('database-id', { description: 'A database ID (format: postgresql_UUID, mysql_UUID, ...)' }),
|
|
93
93
|
drainId: cliparse.argument('drain-id', { description: 'Drain ID' }),
|
|
94
94
|
drainType: cliparse.argument('drain-type', {
|
|
95
95
|
description: 'Drain type',
|
|
@@ -1024,7 +1024,11 @@ function run () {
|
|
|
1024
1024
|
const databaseCommand = cliparse.command('database', {
|
|
1025
1025
|
description: 'List available databases',
|
|
1026
1026
|
commands: [backupsCommand],
|
|
1027
|
-
}, () =>
|
|
1027
|
+
}, () => {
|
|
1028
|
+
console.info('This command is not available, you can try the following commands:');
|
|
1029
|
+
console.info('clever database backups');
|
|
1030
|
+
console.info('clever database backups download');
|
|
1031
|
+
});
|
|
1028
1032
|
|
|
1029
1033
|
// CLI PARSER
|
|
1030
1034
|
const cliParser = cliparse.cli({
|
package/package.json
CHANGED
package/src/commands/database.js
CHANGED
|
@@ -20,6 +20,11 @@ async function listBackups (params) {
|
|
|
20
20
|
|
|
21
21
|
const backups = await getBackups({ ownerId, ref: databaseId }).then(sendToApi);
|
|
22
22
|
|
|
23
|
+
if (backups.length === 0) {
|
|
24
|
+
println('There are no backups yet');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
const formattedLines = backups
|
|
24
29
|
.sort((a, b) => a.creation_date.localeCompare(b.creation_date))
|
|
25
30
|
.map((backup) => [
|
|
@@ -83,7 +88,7 @@ async function resolveOwnerId (org, databaseId) {
|
|
|
83
88
|
|
|
84
89
|
const summary = await getSummary().then(sendToApi);
|
|
85
90
|
|
|
86
|
-
const userHasAddon = summary.user.addons.some((addon) => addon.
|
|
91
|
+
const userHasAddon = summary.user.addons.some((addon) => addon.realId === databaseId);
|
|
87
92
|
if (userHasAddon) {
|
|
88
93
|
return summary.user.id;
|
|
89
94
|
}
|