smoonb 0.0.71 → 0.0.72
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/LICENSE.pt-BR.md +24 -0
- package/README.md +441 -363
- package/README.pt-BR.md +730 -0
- package/bin/smoonb.js +187 -128
- package/package.json +4 -2
- package/src/commands/backup/index.js +13 -12
- package/src/commands/backup/utils.js +25 -31
- package/src/commands/check.js +13 -8
- package/src/commands/config.js +142 -134
- package/src/commands/functions.js +14 -10
- package/src/commands/import.js +22 -19
- package/src/commands/restore/index.js +13 -12
- package/src/i18n/index.js +217 -0
- package/src/i18n/locales/en.json +251 -0
- package/src/i18n/locales/pt-BR.json +251 -0
- package/src/index.js +19 -18
- package/src/utils/banner.js +19 -16
- package/src/utils/prompt.js +4 -1
package/src/commands/config.js
CHANGED
|
@@ -1,135 +1,143 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
|
-
const fs = require('fs').promises;
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { showBetaBanner } = require('../utils/banner');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
await
|
|
19
|
-
} else {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
console.log(chalk.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
console.log(chalk.blue('\n
|
|
124
|
-
console.log(chalk.gray(` -
|
|
125
|
-
console.log(chalk.gray(` -
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const fs = require('fs').promises;
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { showBetaBanner } = require('../utils/banner');
|
|
5
|
+
const { t } = require('../i18n');
|
|
6
|
+
|
|
7
|
+
// Exportar FUNÇÃO em vez de objeto Command
|
|
8
|
+
module.exports = async (options) => {
|
|
9
|
+
showBetaBanner();
|
|
10
|
+
|
|
11
|
+
const getT = global.smoonbI18n?.t || t;
|
|
12
|
+
console.log(chalk.cyan.bold(`⚙️ ${getT('config.title')}\n`));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const configPath = path.join(process.cwd(), '.smoonbrc');
|
|
16
|
+
|
|
17
|
+
if (options.init) {
|
|
18
|
+
await initializeConfig(configPath);
|
|
19
|
+
} else if (options.show) {
|
|
20
|
+
await showConfig(configPath);
|
|
21
|
+
} else {
|
|
22
|
+
console.log(chalk.yellow(`💡 ${getT('config.options')}`));
|
|
23
|
+
console.log(chalk.gray(` ${getT('config.initOption')}`));
|
|
24
|
+
console.log(chalk.gray(` ${getT('config.showOption')}`));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
} catch (error) {
|
|
28
|
+
const getT = global.smoonbI18n?.t || t;
|
|
29
|
+
console.error(chalk.red(`❌ ${getT('config.error')}`), error.message);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Inicializar configuração
|
|
35
|
+
async function initializeConfig(configPath) {
|
|
36
|
+
const getT = global.smoonbI18n?.t || t;
|
|
37
|
+
console.log(chalk.blue(`🔧 ${getT('config.init')}`));
|
|
38
|
+
|
|
39
|
+
const defaultConfig = {
|
|
40
|
+
supabase: {
|
|
41
|
+
projectId: 'your-project-id-here',
|
|
42
|
+
url: 'https://your-project-id.supabase.co',
|
|
43
|
+
serviceKey: 'your-service-key-here',
|
|
44
|
+
anonKey: 'your-anon-key-here',
|
|
45
|
+
databaseUrl: 'postgresql://postgres:[password]@db.your-project-id.supabase.co:5432/postgres',
|
|
46
|
+
accessToken: 'your-personal-access-token-here'
|
|
47
|
+
},
|
|
48
|
+
backup: {
|
|
49
|
+
includeFunctions: true,
|
|
50
|
+
includeStorage: true,
|
|
51
|
+
includeAuth: true,
|
|
52
|
+
includeRealtime: true,
|
|
53
|
+
outputDir: './backups'
|
|
54
|
+
},
|
|
55
|
+
restore: {
|
|
56
|
+
cleanRestore: true,
|
|
57
|
+
verifyAfterRestore: true
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
const getT = global.smoonbI18n?.t || t;
|
|
63
|
+
await fs.writeFile(configPath, JSON.stringify(defaultConfig, null, 2));
|
|
64
|
+
console.log(chalk.green(`✅ ${getT('config.fileCreated', { path: '.smoonbrc' })}`));
|
|
65
|
+
console.log(chalk.yellow('\n📝 Próximos passos:'));
|
|
66
|
+
console.log(chalk.gray(' 1. Edite .smoonbrc com suas credenciais Supabase'));
|
|
67
|
+
console.log(chalk.gray(' 2. Substitua os valores placeholder pelos reais'));
|
|
68
|
+
console.log(chalk.gray(' 3. Execute: npx smoonb backup'));
|
|
69
|
+
} catch (error) {
|
|
70
|
+
const getT = global.smoonbI18n?.t || t;
|
|
71
|
+
throw new Error(`${getT('config.error')}: ${error.message}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Mostrar configuração atual
|
|
76
|
+
async function showConfig(configPath) {
|
|
77
|
+
const getT = global.smoonbI18n?.t || t;
|
|
78
|
+
console.log(chalk.blue(`📋 ${getT('config.show')}`));
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
const configContent = await fs.readFile(configPath, 'utf8');
|
|
82
|
+
const config = JSON.parse(configContent);
|
|
83
|
+
|
|
84
|
+
console.log(chalk.green('✅ Arquivo de configuração encontrado'));
|
|
85
|
+
console.log(chalk.gray(` - Localização: ${configPath}`));
|
|
86
|
+
|
|
87
|
+
if (config.supabase?.projectId && config.supabase.projectId !== 'your-project-id-here') {
|
|
88
|
+
console.log(chalk.gray(` - Project ID: ${config.supabase.projectId}`));
|
|
89
|
+
} else {
|
|
90
|
+
console.log(chalk.yellow(' - Project ID: Não configurado'));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (config.supabase?.url && config.supabase.url !== 'https://your-project-id.supabase.co') {
|
|
94
|
+
console.log(chalk.gray(` - Supabase URL: ${config.supabase.url}`));
|
|
95
|
+
} else {
|
|
96
|
+
console.log(chalk.yellow(' - Supabase URL: Não configurado'));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (config.supabase?.serviceKey && config.supabase.serviceKey !== 'your-service-key-here') {
|
|
100
|
+
console.log(chalk.gray(' - Service Key: Configurada'));
|
|
101
|
+
} else {
|
|
102
|
+
console.log(chalk.yellow(' - Service Key: Não configurada'));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (config.supabase?.anonKey && config.supabase.anonKey !== 'your-anon-key-here') {
|
|
106
|
+
console.log(chalk.gray(' - Anon Key: Configurada'));
|
|
107
|
+
} else {
|
|
108
|
+
console.log(chalk.yellow(' - Anon Key: Não configurada'));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (config.supabase?.databaseUrl && !config.supabase.databaseUrl.includes('[password]')) {
|
|
112
|
+
console.log(chalk.gray(' - Database URL: Configurada'));
|
|
113
|
+
} else {
|
|
114
|
+
console.log(chalk.yellow(' - Database URL: Não configurada'));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (config.supabase?.accessToken && config.supabase.accessToken !== 'your-personal-access-token-here') {
|
|
118
|
+
console.log(chalk.gray(' - Access Token: Configurado'));
|
|
119
|
+
} else {
|
|
120
|
+
console.log(chalk.yellow(' - Access Token: Não configurado (obrigatório para Management API)'));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
console.log(chalk.blue('\n📊 Configurações de backup:'));
|
|
124
|
+
console.log(chalk.gray(` - Output Dir: ${config.backup?.outputDir || './backups'}`));
|
|
125
|
+
console.log(chalk.gray(` - Include Functions: ${config.backup?.includeFunctions || true}`));
|
|
126
|
+
console.log(chalk.gray(` - Include Storage: ${config.backup?.includeStorage || true}`));
|
|
127
|
+
console.log(chalk.gray(` - Include Auth: ${config.backup?.includeAuth || true}`));
|
|
128
|
+
console.log(chalk.gray(` - Include Realtime: ${config.backup?.includeRealtime || true}`));
|
|
129
|
+
|
|
130
|
+
console.log(chalk.blue('\n🔄 Configurações de restore:'));
|
|
131
|
+
console.log(chalk.gray(` - Clean Restore: ${config.restore?.cleanRestore || true}`));
|
|
132
|
+
console.log(chalk.gray(` - Verify After Restore: ${config.restore?.verifyAfterRestore || true}`));
|
|
133
|
+
|
|
134
|
+
} catch (error) {
|
|
135
|
+
const getT = global.smoonbI18n?.t || t;
|
|
136
|
+
if (error.code === 'ENOENT') {
|
|
137
|
+
console.log(chalk.yellow(`⚠️ ${getT('config.fileNotFound', { path: configPath })}`));
|
|
138
|
+
console.log(chalk.gray(' - Use: npx smoonb config --init'));
|
|
139
|
+
} else {
|
|
140
|
+
throw new Error(`${getT('config.error')}: ${error.message}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
135
143
|
}
|
|
@@ -2,34 +2,38 @@ const chalk = require('chalk');
|
|
|
2
2
|
const { ensureBin, runCommand } = require('../utils/cli');
|
|
3
3
|
const { readConfig, validateFor } = require('../utils/config');
|
|
4
4
|
const { showBetaBanner } = require('../utils/banner');
|
|
5
|
+
const { t } = require('../i18n');
|
|
5
6
|
|
|
6
7
|
// Exportar FUNÇÃO em vez de objeto Command
|
|
7
8
|
module.exports = async (_options) => {
|
|
8
9
|
showBetaBanner();
|
|
9
10
|
|
|
10
11
|
try {
|
|
12
|
+
const getT = global.smoonbI18n?.t || t;
|
|
13
|
+
|
|
11
14
|
// Verificar se Supabase CLI está disponível
|
|
12
15
|
const supabasePath = await ensureBin('supabase');
|
|
13
16
|
if (!supabasePath) {
|
|
14
|
-
console.error(chalk.red(
|
|
15
|
-
console.log(chalk.yellow(
|
|
16
|
-
console.log(chalk.yellow(
|
|
17
|
-
console.log(chalk.yellow('
|
|
17
|
+
console.error(chalk.red(`❌ ${getT('functions.cliNotFound')}`));
|
|
18
|
+
console.log(chalk.yellow(`💡 ${getT('functions.installCli')}`));
|
|
19
|
+
console.log(chalk.yellow(` ${getT('functions.installLink')}`));
|
|
20
|
+
console.log(chalk.yellow(` ${getT('functions.orVisit')}`));
|
|
18
21
|
process.exit(1);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
console.log(chalk.blue(
|
|
22
|
-
console.log(chalk.yellow(
|
|
24
|
+
console.log(chalk.blue(`⚡ ${getT('functions.availableCommands')}`));
|
|
25
|
+
console.log(chalk.yellow(`\n📋 ${getT('functions.list')}`));
|
|
23
26
|
console.log(chalk.gray(' npx smoonb functions list'));
|
|
24
|
-
console.log(chalk.yellow(
|
|
27
|
+
console.log(chalk.yellow(`\n🚀 ${getT('functions.deploy')}`));
|
|
25
28
|
console.log(chalk.gray(' npx smoonb functions push'));
|
|
26
|
-
console.log(chalk.yellow(
|
|
29
|
+
console.log(chalk.yellow(`\n📥 ${getT('functions.pull')}`));
|
|
27
30
|
console.log(chalk.gray(' npx smoonb functions pull'));
|
|
28
|
-
console.log(chalk.yellow(
|
|
31
|
+
console.log(chalk.yellow(`\n💡 ${getT('functions.moreOptions')}`));
|
|
29
32
|
console.log(chalk.gray(' supabase functions --help'));
|
|
30
33
|
|
|
31
34
|
} catch (error) {
|
|
32
|
-
|
|
35
|
+
const getT = global.smoonbI18n?.t || t;
|
|
36
|
+
console.error(chalk.red(`❌ ${getT('functions.error', { message: error.message })}`));
|
|
33
37
|
process.exit(1);
|
|
34
38
|
}
|
|
35
39
|
};
|
package/src/commands/import.js
CHANGED
|
@@ -5,6 +5,7 @@ const { ensureDir } = require('../utils/fsx');
|
|
|
5
5
|
const { readEnvFile } = require('../utils/env');
|
|
6
6
|
const { showBetaBanner } = require('../utils/banner');
|
|
7
7
|
const { confirm } = require('../utils/prompt');
|
|
8
|
+
const { t } = require('../i18n');
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Comando para importar arquivo .backup.gz e opcionalmente .storage.zip do Dashboard do Supabase
|
|
@@ -13,21 +14,22 @@ module.exports = async (options) => {
|
|
|
13
14
|
showBetaBanner();
|
|
14
15
|
|
|
15
16
|
try {
|
|
17
|
+
const getT = global.smoonbI18n?.t || t;
|
|
18
|
+
|
|
16
19
|
// Termo de uso e aviso de risco
|
|
17
|
-
console.log(chalk.yellow.bold(
|
|
18
|
-
console.log(chalk.white('
|
|
19
|
-
console.log(chalk.white('
|
|
20
|
-
console.log(chalk.white('Observação para consumidores no Brasil (PT-BR) — Para consumidores brasileiros, este aviso não afasta direitos irrenunciáveis previstos no Código de Defesa do Consumidor (CDC); qualquer limitação aqui prevista só se aplica nos limites da lei e não impede a indenização obrigatória quando cabível.\n'));
|
|
20
|
+
console.log(chalk.yellow.bold(`\n⚠️ ${getT('disclaimer.title')}\n`));
|
|
21
|
+
console.log(chalk.white(`${getT('disclaimer.text')}\n`));
|
|
22
|
+
console.log(chalk.white(`${getT('disclaimer.limitation')}\n`));
|
|
21
23
|
|
|
22
|
-
const termsAccepted = await confirm('
|
|
24
|
+
const termsAccepted = await confirm(getT('disclaimer.acceptImport'), true);
|
|
23
25
|
if (!termsAccepted) {
|
|
24
|
-
console.log(chalk.red('
|
|
26
|
+
console.log(chalk.red(`🚫 ${getT('disclaimer.operationCancelled')}`));
|
|
25
27
|
process.exit(1);
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
|
|
28
30
|
// Validar que o arquivo de backup foi fornecido
|
|
29
31
|
if (!options.file) {
|
|
30
|
-
console.error(chalk.red(
|
|
32
|
+
console.error(chalk.red(`❌ ${getT('import.fileRequired')}`));
|
|
31
33
|
console.log(chalk.yellow('💡 Use: npx smoonb import --file <caminho-do-backup> [--storage <caminho-do-storage>]'));
|
|
32
34
|
console.log(chalk.white(' Exemplo: npx smoonb import --file "C:\\Downloads\\db_cluster-04-03-2024@14-16-59.backup.gz"'));
|
|
33
35
|
console.log(chalk.white(' Exemplo com storage: npx smoonb import --file "backup.backup.gz" --storage "meu-projeto.storage.zip"'));
|
|
@@ -40,13 +42,13 @@ module.exports = async (options) => {
|
|
|
40
42
|
try {
|
|
41
43
|
await fs.access(sourceFile);
|
|
42
44
|
} catch {
|
|
43
|
-
console.error(chalk.red(`❌
|
|
45
|
+
console.error(chalk.red(`❌ ${getT('import.fileNotFound', { path: sourceFile })}`));
|
|
44
46
|
process.exit(1);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
// Verificar se é um arquivo .backup.gz ou .backup
|
|
48
50
|
if (!sourceFile.endsWith('.backup.gz') && !sourceFile.endsWith('.backup')) {
|
|
49
|
-
console.error(chalk.red('
|
|
51
|
+
console.error(chalk.red(`❌ ${getT('import.invalidFormat')}`));
|
|
50
52
|
process.exit(1);
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -58,13 +60,13 @@ module.exports = async (options) => {
|
|
|
58
60
|
try {
|
|
59
61
|
await fs.access(sourceStorageFile);
|
|
60
62
|
} catch {
|
|
61
|
-
console.error(chalk.red(`❌
|
|
63
|
+
console.error(chalk.red(`❌ ${getT('import.storageNotFound', { path: sourceStorageFile })}`));
|
|
62
64
|
process.exit(1);
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
// Verificar se é um arquivo .storage.zip
|
|
66
68
|
if (!sourceStorageFile.endsWith('.storage.zip')) {
|
|
67
|
-
console.error(chalk.red('
|
|
69
|
+
console.error(chalk.red(`❌ ${getT('import.storageInvalidFormat')}`));
|
|
68
70
|
process.exit(1);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -87,9 +89,9 @@ module.exports = async (options) => {
|
|
|
87
89
|
const match = fileName.match(/db_cluster-(\d{2})-(\d{2})-(\d{4})@(\d{2})-(\d{2})-(\d{2})\.backup(\.gz)?/);
|
|
88
90
|
|
|
89
91
|
if (!match) {
|
|
90
|
-
console.error(chalk.red(
|
|
91
|
-
console.log(chalk.yellow('
|
|
92
|
-
console.log(chalk.white(`
|
|
92
|
+
console.error(chalk.red(`❌ ${getT('import.invalidFileName')}`));
|
|
93
|
+
console.log(chalk.yellow(`💡 ${getT('import.expectedFormat')}`));
|
|
94
|
+
console.log(chalk.white(` ${getT('import.fileReceived', { fileName })}`));
|
|
93
95
|
process.exit(1);
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -111,7 +113,7 @@ module.exports = async (options) => {
|
|
|
111
113
|
const stats = await fs.stat(destFile);
|
|
112
114
|
const sizeMB = (stats.size / (1024 * 1024)).toFixed(2);
|
|
113
115
|
|
|
114
|
-
console.log(chalk.green(`✅
|
|
116
|
+
console.log(chalk.green(`✅ ${getT('import.success')}`));
|
|
115
117
|
console.log(chalk.blue(`📦 Backup: ${fileName} (${sizeMB} MB)`));
|
|
116
118
|
|
|
117
119
|
// Copiar arquivo de storage se fornecido
|
|
@@ -123,15 +125,16 @@ module.exports = async (options) => {
|
|
|
123
125
|
const storageStats = await fs.stat(destStorageFile);
|
|
124
126
|
const storageSizeMB = (storageStats.size / (1024 * 1024)).toFixed(2);
|
|
125
127
|
|
|
126
|
-
console.log(chalk.green(`✅
|
|
128
|
+
console.log(chalk.green(`✅ ${getT('import.storageSuccess')}`));
|
|
127
129
|
console.log(chalk.blue(`📦 Storage: ${storageFileName} (${storageSizeMB} MB)`));
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
console.log(chalk.blue(`📁 Localização: ${backupDir}`));
|
|
131
|
-
console.log(chalk.cyan(`\n💡
|
|
133
|
+
console.log(chalk.cyan(`\n💡 ${getT('import.nextStep')}`));
|
|
132
134
|
|
|
133
135
|
} catch (error) {
|
|
134
|
-
|
|
136
|
+
const getT = global.smoonbI18n?.t || t;
|
|
137
|
+
console.error(chalk.red(`❌ ${getT('error.generic')}: ${error.message}`));
|
|
135
138
|
process.exit(1);
|
|
136
139
|
}
|
|
137
140
|
};
|
|
@@ -99,15 +99,17 @@ module.exports = async (options) => {
|
|
|
99
99
|
showBetaBanner();
|
|
100
100
|
|
|
101
101
|
try {
|
|
102
|
+
const { t } = require('../../i18n');
|
|
103
|
+
const getT = global.smoonbI18n?.t || t;
|
|
104
|
+
|
|
102
105
|
// Termo de uso e aviso de risco
|
|
103
|
-
console.log(chalk.yellow.bold(
|
|
104
|
-
console.log(chalk.white('
|
|
105
|
-
console.log(chalk.white('
|
|
106
|
-
console.log(chalk.white('Observação para consumidores no Brasil (PT-BR) — Para consumidores brasileiros, este aviso não afasta direitos irrenunciáveis previstos no Código de Defesa do Consumidor (CDC); qualquer limitação aqui prevista só se aplica nos limites da lei e não impede a indenização obrigatória quando cabível.\n'));
|
|
106
|
+
console.log(chalk.yellow.bold(`\n⚠️ ${getT('disclaimer.title')}\n`));
|
|
107
|
+
console.log(chalk.white(`${getT('disclaimer.text')}\n`));
|
|
108
|
+
console.log(chalk.white(`${getT('disclaimer.limitation')}\n`));
|
|
107
109
|
|
|
108
|
-
const termsAccepted = await confirm('
|
|
110
|
+
const termsAccepted = await confirm(getT('disclaimer.acceptRestore'), true);
|
|
109
111
|
if (!termsAccepted) {
|
|
110
|
-
console.log(chalk.red('
|
|
112
|
+
console.log(chalk.red(`🚫 ${getT('disclaimer.operationCancelled')}`));
|
|
111
113
|
process.exit(1);
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -115,13 +117,12 @@ module.exports = async (options) => {
|
|
|
115
117
|
await step00DockerValidation();
|
|
116
118
|
|
|
117
119
|
// Consentimento para leitura e escrita do .env.local
|
|
118
|
-
console.log(chalk.yellow(
|
|
119
|
-
console.log(chalk.yellow('
|
|
120
|
-
console.log(chalk.yellow(
|
|
121
|
-
|
|
122
|
-
const consentOk = await confirm('Você consente em prosseguir', true);
|
|
120
|
+
console.log(chalk.yellow(`\n⚠️ ${getT('consent.title')}`));
|
|
121
|
+
console.log(chalk.yellow(` ${getT('consent.backup')}`));
|
|
122
|
+
console.log(chalk.yellow(` ${getT('consent.mapping')}`));
|
|
123
|
+
const consentOk = await confirm(getT('consent.proceed'), true);
|
|
123
124
|
if (!consentOk) {
|
|
124
|
-
console.log(chalk.red('
|
|
125
|
+
console.log(chalk.red(`🚫 ${getT('disclaimer.operationCancelled')}`));
|
|
125
126
|
process.exit(1);
|
|
126
127
|
}
|
|
127
128
|
|