smoonb 0.0.5 → 0.0.6

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/.smoonbrc ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "supabase": {
3
+ "projectId": "your-project-id-here",
4
+ "url": "https://your-project.supabase.co",
5
+ "serviceKey": "your-service-key-here",
6
+ "anonKey": "your-anon-key-here",
7
+ "databaseUrl": "postgresql://postgres:[password]@db.your-project.supabase.co:5432/postgres"
8
+ },
9
+ "backup": {
10
+ "includeFunctions": true,
11
+ "includeStorage": true,
12
+ "includeAuth": true,
13
+ "includeRealtime": true,
14
+ "outputDir": "./backups"
15
+ },
16
+ "restore": {
17
+ "cleanRestore": false,
18
+ "verifyAfterRestore": true
19
+ }
20
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "timestamp": "2025-10-17T19:18:58.553Z",
3
+ "projectId": "itrnlqsdfsdfsdf",
4
+ "providers": [],
5
+ "policies": [],
6
+ "settings": {}
7
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "timestamp": "2025-10-17T19:18:58.559Z",
3
+ "projectId": "itrnlqsdfsdfsdf",
4
+ "version": "0.1.0-beta",
5
+ "components": {
6
+ "database": false,
7
+ "functions": true,
8
+ "auth": true,
9
+ "storage": true,
10
+ "realtime": true
11
+ },
12
+ "files": {
13
+ "database": null,
14
+ "functions": "functions/",
15
+ "auth": "auth-config.json",
16
+ "storage": "storage/",
17
+ "realtime": "realtime-config.json"
18
+ }
19
+ }
@@ -0,0 +1,4 @@
1
+ # Edge Functions Backup
2
+
3
+ Nenhuma Edge Function local foi encontrada.
4
+ Use o Supabase CLI para fazer backup das functions remotas.
@@ -0,0 +1,7 @@
1
+ {
2
+ "timestamp": "2025-10-17T19:18:58.558Z",
3
+ "projectId": "itrnlqsdfsdfsdf",
4
+ "enabled": false,
5
+ "channels": [],
6
+ "settings": {}
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2025-10-17T19:18:58.556Z",
3
+ "projectId": "itrnlqsdfsdfsdf",
4
+ "buckets": [],
5
+ "objects": []
6
+ }
package/bin/smoonb.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * smoonb - Complete Supabase backup and migration tool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoonb",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Complete Supabase backup and migration tool - EXPERIMENTAL VERSION - USE AT YOUR OWN RISK",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -32,6 +32,7 @@ async function backupCommand(options) {
32
32
  console.log(chalk.gray(' 1. Use: smoonb backup --project-id <seu-project-id>'));
33
33
  console.log(chalk.gray(' 2. Configure: smoonb config --init'));
34
34
  console.log(chalk.gray(' 3. Ou defina SUPABASE_PROJECT_ID no ambiente'));
35
+ console.log(chalk.gray(' 4. Ou edite ~/.smoonbrc e configure o projectId'));
35
36
  process.exit(1);
36
37
  }
37
38
 
@@ -130,7 +131,17 @@ async function backupDatabase(projectId, outputDir) {
130
131
 
131
132
  if (!dbUrl) {
132
133
  console.log(chalk.yellow('⚠️ Database URL não configurada'));
133
- console.log(chalk.gray(' - Configure DATABASE_URL ou use smoonb config --init'));
134
+ console.log(chalk.gray(' - Configure DATABASE_URL no ambiente'));
135
+ console.log(chalk.gray(' - Ou edite ~/.smoonbrc e configure databaseUrl'));
136
+ console.log(chalk.gray(' - Ou use smoonb config --init'));
137
+ return null;
138
+ }
139
+
140
+ // Verificar se a URL contém placeholder de senha
141
+ if (dbUrl.includes('[password]')) {
142
+ console.log(chalk.yellow('⚠️ Database URL contém placeholder [password]'));
143
+ console.log(chalk.gray(' - Substitua [password] pela senha real da database'));
144
+ console.log(chalk.gray(' - Ou configure DATABASE_URL completa no ambiente'));
134
145
  return null;
135
146
  }
136
147
 
@@ -146,8 +157,10 @@ async function backupDatabase(projectId, outputDir) {
146
157
 
147
158
  return filepath;
148
159
  } catch (error) {
149
- console.log(chalk.yellow('⚠️ Backup da database falhou (credenciais não configuradas)'));
150
- console.log(chalk.gray(' - Configure DATABASE_URL ou use smoonb config --init'));
160
+ console.log(chalk.yellow('⚠️ Backup da database falhou:'), error.message);
161
+ console.log(chalk.gray(' - Verifique se DATABASE_URL está correta'));
162
+ console.log(chalk.gray(' - Verifique se pg_dump está instalado'));
163
+ console.log(chalk.gray(' - Verifique se as credenciais estão corretas'));
151
164
  return null;
152
165
  }
153
166
  }
@@ -31,6 +31,7 @@ async function checkCommand(options) {
31
31
  console.log(chalk.gray(' 1. Use: smoonb check --project-id <seu-project-id>'));
32
32
  console.log(chalk.gray(' 2. Configure: smoonb config --init'));
33
33
  console.log(chalk.gray(' 3. Ou defina SUPABASE_PROJECT_ID no ambiente'));
34
+ console.log(chalk.gray(' 4. Ou edite ~/.smoonbrc e configure o projectId'));
34
35
  process.exit(1);
35
36
  }
36
37
 
@@ -31,6 +31,7 @@ async function restoreCommand(options) {
31
31
  console.log(chalk.gray(' 1. Use: smoonb restore --project-id <seu-project-id>'));
32
32
  console.log(chalk.gray(' 2. Configure: smoonb config --init'));
33
33
  console.log(chalk.gray(' 3. Ou defina SUPABASE_PROJECT_ID no ambiente'));
34
+ console.log(chalk.gray(' 4. Ou edite ~/.smoonbrc e configure o projectId'));
34
35
  process.exit(1);
35
36
  }
36
37
 
@@ -85,7 +85,7 @@ function getProjectId() {
85
85
 
86
86
  // Tentar configuração
87
87
  const config = loadConfig();
88
- if (config?.supabase?.projectId) {
88
+ if (config?.supabase?.projectId && config.supabase.projectId.trim() !== '') {
89
89
  return config.supabase.projectId;
90
90
  }
91
91
 
@@ -103,7 +103,7 @@ function getDatabaseUrl(projectId = null) {
103
103
 
104
104
  // Tentar configuração
105
105
  const config = loadConfig();
106
- if (config?.supabase?.databaseUrl) {
106
+ if (config?.supabase?.databaseUrl && config.supabase.databaseUrl.trim() !== '') {
107
107
  return config.supabase.databaseUrl;
108
108
  }
109
109