smoonb 0.0.70 → 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 +446 -352
- package/README.pt-BR.md +730 -0
- package/bin/smoonb.js +187 -128
- package/package.json +4 -2
- package/src/commands/backup/index.js +22 -13
- package/src/commands/backup/steps/06-storage.js +228 -5
- 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
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Códigos de locale suportados
|
|
6
|
+
*/
|
|
7
|
+
const SUPPORTED_LOCALES = ['en', 'pt-BR'];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Aliases de locale (normalização)
|
|
11
|
+
*/
|
|
12
|
+
const LOCALE_ALIASES = {
|
|
13
|
+
'en-US': 'en',
|
|
14
|
+
'en_US': 'en',
|
|
15
|
+
'pt': 'pt-BR',
|
|
16
|
+
'pt_BR': 'pt-BR',
|
|
17
|
+
'pt-BR': 'pt-BR'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Cache de catálogos carregados
|
|
22
|
+
*/
|
|
23
|
+
const catalogCache = {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Normalizar código de locale
|
|
27
|
+
* @param {string} locale - Código de locale a normalizar
|
|
28
|
+
* @returns {string} - Código normalizado ou null se inválido
|
|
29
|
+
*/
|
|
30
|
+
function normalizeLocale(locale) {
|
|
31
|
+
if (!locale || typeof locale !== 'string') {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Normalizar separadores (underscore/hífen)
|
|
36
|
+
const normalized = locale.replace('_', '-');
|
|
37
|
+
|
|
38
|
+
// Verificar se é um alias conhecido
|
|
39
|
+
if (LOCALE_ALIASES[normalized]) {
|
|
40
|
+
return LOCALE_ALIASES[normalized];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Verificar se é um locale suportado diretamente
|
|
44
|
+
if (SUPPORTED_LOCALES.includes(normalized)) {
|
|
45
|
+
return normalized;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Tentar extrair código base (ex: pt-BR.UTF-8 -> pt-BR)
|
|
49
|
+
const baseLocale = normalized.split('.')[0].split('-')[0];
|
|
50
|
+
if (baseLocale === 'en') {
|
|
51
|
+
return 'en';
|
|
52
|
+
}
|
|
53
|
+
if (baseLocale === 'pt') {
|
|
54
|
+
return 'pt-BR';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Detectar locale do sistema
|
|
62
|
+
* @param {NodeJS.ProcessEnv} env - Variáveis de ambiente
|
|
63
|
+
* @returns {string|null} - Código de locale ou null
|
|
64
|
+
*/
|
|
65
|
+
function detectSystemLocale(env) {
|
|
66
|
+
// Verificar LANG, LC_ALL, LC_MESSAGES (ordem de precedência)
|
|
67
|
+
const localeVars = ['LANG', 'LC_ALL', 'LC_MESSAGES'];
|
|
68
|
+
|
|
69
|
+
for (const varName of localeVars) {
|
|
70
|
+
if (env[varName]) {
|
|
71
|
+
const normalized = normalizeLocale(env[varName]);
|
|
72
|
+
if (normalized) {
|
|
73
|
+
return normalized;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Detectar locale baseado em argumentos CLI, env e sistema
|
|
83
|
+
* @param {string[]} argv - Argumentos da linha de comando
|
|
84
|
+
* @param {NodeJS.ProcessEnv} env - Variáveis de ambiente
|
|
85
|
+
* @returns {string} - Código de locale (padrão: 'en')
|
|
86
|
+
*/
|
|
87
|
+
function detectLocale(argv = [], env = process.env) {
|
|
88
|
+
// 1. Verificar flag CLI --lang
|
|
89
|
+
const langIndex = argv.indexOf('--lang');
|
|
90
|
+
if (langIndex !== -1 && argv[langIndex + 1]) {
|
|
91
|
+
const normalized = normalizeLocale(argv[langIndex + 1]);
|
|
92
|
+
if (normalized) {
|
|
93
|
+
return normalized;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// 2. Verificar variável de ambiente SMOONB_LANG
|
|
98
|
+
if (env.SMOONB_LANG) {
|
|
99
|
+
const normalized = normalizeLocale(env.SMOONB_LANG);
|
|
100
|
+
if (normalized) {
|
|
101
|
+
return normalized;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 3. Verificar locale do sistema
|
|
106
|
+
const systemLocale = detectSystemLocale(env);
|
|
107
|
+
if (systemLocale) {
|
|
108
|
+
return systemLocale;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// 4. Fallback para inglês
|
|
112
|
+
return 'en';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Carregar catálogo de traduções
|
|
117
|
+
* @param {string} locale - Código de locale
|
|
118
|
+
* @returns {Object} - Catálogo de traduções
|
|
119
|
+
*/
|
|
120
|
+
function loadCatalog(locale) {
|
|
121
|
+
// Validar locale
|
|
122
|
+
const normalized = normalizeLocale(locale) || 'en';
|
|
123
|
+
|
|
124
|
+
// Verificar cache
|
|
125
|
+
if (catalogCache[normalized]) {
|
|
126
|
+
return catalogCache[normalized];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Caminho do arquivo de locale
|
|
130
|
+
const localePath = path.join(__dirname, 'locales', `${normalized}.json`);
|
|
131
|
+
|
|
132
|
+
// Carregar catálogo
|
|
133
|
+
let catalog = {};
|
|
134
|
+
try {
|
|
135
|
+
if (fs.existsSync(localePath)) {
|
|
136
|
+
const content = fs.readFileSync(localePath, 'utf8');
|
|
137
|
+
catalog = JSON.parse(content);
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error(`Erro ao carregar catálogo ${normalized}:`, error.message);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Sempre carregar fallback (en) para chaves ausentes
|
|
144
|
+
if (normalized !== 'en') {
|
|
145
|
+
const fallbackPath = path.join(__dirname, 'locales', 'en.json');
|
|
146
|
+
try {
|
|
147
|
+
if (fs.existsSync(fallbackPath)) {
|
|
148
|
+
const fallbackContent = fs.readFileSync(fallbackPath, 'utf8');
|
|
149
|
+
const fallbackCatalog = JSON.parse(fallbackContent);
|
|
150
|
+
// Mesclar com fallback (catálogo atual tem prioridade)
|
|
151
|
+
catalog = { ...fallbackCatalog, ...catalog };
|
|
152
|
+
}
|
|
153
|
+
} catch (error) {
|
|
154
|
+
console.error('Erro ao carregar catálogo fallback (en):', error.message);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Armazenar no cache
|
|
159
|
+
catalogCache[normalized] = catalog;
|
|
160
|
+
|
|
161
|
+
return catalog;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Função de tradução
|
|
166
|
+
* @param {string} id - ID da chave de tradução
|
|
167
|
+
* @param {Record<string, string|number>} vars - Variáveis para substituição
|
|
168
|
+
* @param {string} locale - Locale a usar (opcional, usa o atual se não fornecido)
|
|
169
|
+
* @returns {string} - Texto traduzido
|
|
170
|
+
*/
|
|
171
|
+
function t(id, vars = {}, locale = null) {
|
|
172
|
+
// Determinar locale a usar
|
|
173
|
+
const currentLocale = locale || (global.smoonbI18n?.locale || 'en');
|
|
174
|
+
const catalog = locale ? loadCatalog(locale) : (global.smoonbI18n?.catalog || loadCatalog('en'));
|
|
175
|
+
|
|
176
|
+
// Buscar tradução
|
|
177
|
+
let translation = catalog[id] || id;
|
|
178
|
+
|
|
179
|
+
// Substituir placeholders nomeados (ex: {name}, {path})
|
|
180
|
+
if (typeof translation === 'string' && Object.keys(vars).length > 0) {
|
|
181
|
+
translation = translation.replace(/{(\w+)}/g, (match, key) => {
|
|
182
|
+
return vars[key] !== undefined ? String(vars[key]) : match;
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return translation;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Inicializar i18n com locale detectado
|
|
191
|
+
* @param {string[]} argv - Argumentos da linha de comando
|
|
192
|
+
* @param {NodeJS.ProcessEnv} env - Variáveis de ambiente
|
|
193
|
+
* @returns {Object} - Objeto com locale, catalog e função t
|
|
194
|
+
*/
|
|
195
|
+
function initI18n(argv = process.argv, env = process.env) {
|
|
196
|
+
const locale = detectLocale(argv, env);
|
|
197
|
+
const catalog = loadCatalog(locale);
|
|
198
|
+
|
|
199
|
+
// Armazenar globalmente para acesso fácil
|
|
200
|
+
global.smoonbI18n = {
|
|
201
|
+
locale,
|
|
202
|
+
catalog,
|
|
203
|
+
t: (id, vars) => t(id, vars, locale)
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
return global.smoonbI18n;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
module.exports = {
|
|
210
|
+
detectLocale,
|
|
211
|
+
loadCatalog,
|
|
212
|
+
t,
|
|
213
|
+
initI18n,
|
|
214
|
+
SUPPORTED_LOCALES,
|
|
215
|
+
normalizeLocale
|
|
216
|
+
};
|
|
217
|
+
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app.title": "Supa Moonbase (smoonb)",
|
|
3
|
+
"app.tagline": "Backup and restore: complete and simple, as it should be",
|
|
4
|
+
"app.developedBy": "Developed by: Goalmoon Tecnologia LTDA",
|
|
5
|
+
"app.website": "Website: https://smoonb.com",
|
|
6
|
+
"app.documentation": "Documentation: https://github.com/almmello/smoonb",
|
|
7
|
+
"app.issues": "Issues: https://github.com/almmello/smoonb/issues",
|
|
8
|
+
|
|
9
|
+
"help.header": "Commands",
|
|
10
|
+
"help.usage": "Usage",
|
|
11
|
+
"help.footer": "Use \"{cmd} help [command]\" for more information about a command.",
|
|
12
|
+
"help.commands.backup": "Create a full backup of your Supabase project",
|
|
13
|
+
"help.commands.restore": "Restore a full backup (interactive mode with psql)",
|
|
14
|
+
"help.commands.check": "Verify project integrity after restore",
|
|
15
|
+
"help.commands.import": "Import a Dashboard backup and prepare the structure for restore",
|
|
16
|
+
|
|
17
|
+
"prompt.confirm": "Proceed?",
|
|
18
|
+
"prompt.confirmYes": "(Y/n)",
|
|
19
|
+
"prompt.confirmNo": "(y/N)",
|
|
20
|
+
"prompt.cancelled": "Operation cancelled.",
|
|
21
|
+
|
|
22
|
+
"error.generic": "Something went wrong.",
|
|
23
|
+
"error.pathNotFound": "Path not found: {path}",
|
|
24
|
+
"error.permissionDenied": "Permission denied: {path}",
|
|
25
|
+
"error.commandNotFound": "Command not recognized: {command}",
|
|
26
|
+
"error.useHelp": "Use {cmd} --help to see available commands",
|
|
27
|
+
"error.uncaughtException": "Uncaught error: {message}",
|
|
28
|
+
"error.unhandledRejection": "Unhandled promise rejection: {reason}",
|
|
29
|
+
|
|
30
|
+
"import.start": "Preparing directory structure for the imported backup...",
|
|
31
|
+
"import.scaffoldOnly": "Scaffolding structure without moving files.",
|
|
32
|
+
"import.done": "Import completed. Ready for restore.",
|
|
33
|
+
"import.fileRequired": "Backup file not provided",
|
|
34
|
+
"import.fileNotFound": "Backup file not found: {path}",
|
|
35
|
+
"import.invalidFormat": "Backup file must be .backup.gz or .backup",
|
|
36
|
+
"import.storageNotFound": "Storage file not found: {path}",
|
|
37
|
+
"import.storageInvalidFormat": "Storage file must be .storage.zip",
|
|
38
|
+
"import.invalidFileName": "Backup file name is not in the expected Dashboard format",
|
|
39
|
+
"import.expectedFormat": "Expected format: db_cluster-DD-MM-YYYY@HH-MM-SS.backup.gz",
|
|
40
|
+
"import.fileReceived": "File received: {fileName}",
|
|
41
|
+
"import.success": "Backup file imported successfully!",
|
|
42
|
+
"import.storageSuccess": "Storage file imported successfully!",
|
|
43
|
+
"import.nextStep": "Next step: Run 'npx smoonb restore' to restore this backup",
|
|
44
|
+
|
|
45
|
+
"check.start": "Verifying project integrity: {projectId}",
|
|
46
|
+
"check.done": "Verification completed!",
|
|
47
|
+
"check.reportSaved": "Report saved to: {path}",
|
|
48
|
+
"check.error": "Error during verification: {message}",
|
|
49
|
+
"check.psqlNotFound": "psql not found",
|
|
50
|
+
"check.installPostgres": "Install PostgreSQL:",
|
|
51
|
+
"check.databaseUrlNotConfigured": "databaseUrl not configured",
|
|
52
|
+
"check.configureDatabaseUrl": "Configure databaseUrl in .smoonbrc",
|
|
53
|
+
|
|
54
|
+
"docker.notInstalled": "DOCKER DESKTOP NOT FOUND",
|
|
55
|
+
"docker.notRunning": "DOCKER DESKTOP IS NOT RUNNING",
|
|
56
|
+
"docker.instructions": "To create a full backup of Supabase, you need to:",
|
|
57
|
+
"docker.installDocker": "1. Install Docker Desktop",
|
|
58
|
+
"docker.runDocker": "2. Run Docker Desktop",
|
|
59
|
+
"docker.waitInitialization": "Wait for complete initialization",
|
|
60
|
+
"docker.repeatCommand": "3. Repeat the backup command",
|
|
61
|
+
"docker.download": "Download: https://docs.docker.com/desktop/install/",
|
|
62
|
+
"docker.tip": "Tip: Docker Desktop must be running in the background",
|
|
63
|
+
"docker.required": "Docker Desktop is required for full Supabase backup",
|
|
64
|
+
"docker.requiredComponents": "Docker Desktop is required for full Supabase backup\n - PostgreSQL Database\n - Edge Functions\n - All components via Supabase CLI",
|
|
65
|
+
"docker.cancelled": "Backup cancelled - Prerequisites not met",
|
|
66
|
+
"docker.installComponents": "Install the required components and try again",
|
|
67
|
+
|
|
68
|
+
"supabase.cliNotFound": "SUPABASE CLI NOT FOUND",
|
|
69
|
+
"supabase.installInstructions": "To create a full backup of Supabase, you need to:",
|
|
70
|
+
"supabase.installCli": "1. Install Supabase CLI",
|
|
71
|
+
"supabase.repeatCommand": "2. Repeat the backup command",
|
|
72
|
+
"supabase.installLink": "Installation: npm install -g supabase",
|
|
73
|
+
"supabase.required": "Supabase CLI is required for full Supabase backup",
|
|
74
|
+
"supabase.requiredComponents": "Supabase CLI is required for full Supabase backup\n - PostgreSQL Database\n - Edge Functions\n - All components via Docker",
|
|
75
|
+
|
|
76
|
+
"backup.components": "Backup Components:",
|
|
77
|
+
"backup.database": "Database PostgreSQL (pg_dumpall + separate SQL)",
|
|
78
|
+
"backup.extensions": "Database Extensions and Settings",
|
|
79
|
+
"backup.roles": "Custom Roles",
|
|
80
|
+
"backup.functions": "Edge Functions",
|
|
81
|
+
"backup.auth": "Auth Settings",
|
|
82
|
+
"backup.storage": "Storage Buckets",
|
|
83
|
+
"backup.realtime": "Realtime Settings",
|
|
84
|
+
"backup.temp": "Supabase .temp",
|
|
85
|
+
"backup.migrations": "Migrations",
|
|
86
|
+
|
|
87
|
+
"restore.start": "Starting restore process...",
|
|
88
|
+
"restore.done": "Restore completed!",
|
|
89
|
+
"restore.error": "Error during restore: {message}",
|
|
90
|
+
|
|
91
|
+
"config.title": "smoonb Configuration...",
|
|
92
|
+
"config.init": "Initializing configuration...",
|
|
93
|
+
"config.show": "Showing configuration...",
|
|
94
|
+
"config.options": "Available options:",
|
|
95
|
+
"config.initOption": "--init Initialize configuration",
|
|
96
|
+
"config.showOption": "--show Show current configuration",
|
|
97
|
+
"config.error": "Configuration error:",
|
|
98
|
+
"config.fileCreated": "Configuration file created: {path}",
|
|
99
|
+
"config.fileExists": "Configuration file already exists: {path}",
|
|
100
|
+
"config.fileNotFound": "Configuration file not found: {path}",
|
|
101
|
+
|
|
102
|
+
"functions.cliNotFound": "Supabase CLI not found",
|
|
103
|
+
"functions.installCli": "Install Supabase CLI:",
|
|
104
|
+
"functions.installLink": "npm install -g supabase",
|
|
105
|
+
"functions.orVisit": "or visit: https://supabase.com/docs/guides/cli",
|
|
106
|
+
"functions.availableCommands": "Available commands for Edge Functions:",
|
|
107
|
+
"functions.list": "List functions:",
|
|
108
|
+
"functions.deploy": "Deploy functions:",
|
|
109
|
+
"functions.pull": "Pull functions (if available):",
|
|
110
|
+
"functions.moreOptions": "For more options, use Supabase CLI directly:",
|
|
111
|
+
"functions.error": "Error: {message}",
|
|
112
|
+
|
|
113
|
+
"disclaimer.title": "Universal Disclaimer / Aviso Legal Universal",
|
|
114
|
+
"disclaimer.text": "By continuing, you acknowledge and agree that Supa Moonbase (smoonb) is provided \"AS IS\" and \"AS AVAILABLE\", with no warranties of any kind—express, implied, or statutory—including but not limited to merchantability, fitness for a particular purpose, and non-infringement, to the maximum extent permitted by applicable law. Backup and restore operations inherently carry risk, environments vary widely, and we cannot foresee or validate all user setups. You are solely responsible for validating your own environment, keeping independent copies, and verifying results before relying on them in production. We build Supa Moonbase (smoonb) on public, auditable, open-source repositories to help people simplify their workflows, but this does not create any warranty, promise of support, or service-level commitment.",
|
|
115
|
+
"disclaimer.limitation": "Limitation of liability — To the maximum extent permitted by law, Goalmoon Tecnologia LTDA, its contributors, and licensors will not be liable for any indirect, incidental, special, consequential, exemplary, or punitive damages (including loss of data, interruption of business, or lost profits) arising from or related to the use of, inability to use, backup/restore operations performed by, or results produced by Supa Moonbase (smoonb). In any case, our aggregate liability for all claims relating to Supa Moonbase (smoonb) will not exceed the amount you paid for Supa Moonbase (smoonb) in the 12 months preceding the event. Nothing in this notice excludes or limits liability where such limits are prohibited by law, including (as applicable) for willful misconduct or gross negligence.",
|
|
116
|
+
"disclaimer.acceptBackup": "Do you accept the Terms of Use and Risk Warning for Backup?",
|
|
117
|
+
"disclaimer.acceptRestore": "Do you accept the Terms of Use and Risk Warning for Restore?",
|
|
118
|
+
"disclaimer.acceptImport": "Do you accept the Terms of Use and Risk Warning for Import?",
|
|
119
|
+
"disclaimer.operationCancelled": "Operation cancelled by user.",
|
|
120
|
+
|
|
121
|
+
"consent.title": "The smoonb will read and write the .env.local file locally.",
|
|
122
|
+
"consent.backup": "An automatic backup of .env.local will be created before any changes.",
|
|
123
|
+
"consent.mapping": "We will map your environment variables to ensure all required keys are present and have the correct values for the target project.",
|
|
124
|
+
"consent.proceed": "Do you consent to proceed?",
|
|
125
|
+
|
|
126
|
+
"help.configuration": "CONFIGURATION:",
|
|
127
|
+
"help.configurationDesc": "Configure the .env.local file in the project root with your Supabase credentials. The smoonb will map variables interactively on first execution.",
|
|
128
|
+
"help.update": "UPDATE TO LATEST VERSION:",
|
|
129
|
+
"help.updateCommand": "npm install smoonb@latest",
|
|
130
|
+
"help.manual": "MANUAL - COMPLETE EXAMPLES:",
|
|
131
|
+
"help.backupTitle": "1. BACKUP - Create full backup of project:",
|
|
132
|
+
"help.backupExample1": "npx smoonb backup",
|
|
133
|
+
"help.backupExample1Desc": "# Interactive process that captures all Supabase components",
|
|
134
|
+
"help.backupExample2": "npx smoonb backup --skip-realtime",
|
|
135
|
+
"help.backupExample2Desc": "# Skips interactive capture of Realtime Settings",
|
|
136
|
+
"help.restoreTitle": "2. RESTORE - Restore backup to a project:",
|
|
137
|
+
"help.restoreExample1": "npx smoonb restore",
|
|
138
|
+
"help.restoreExample1Desc": "# Interactive process that lists available backups and allows selection",
|
|
139
|
+
"help.restoreExample2": "npx smoonb restore --file \"C:\\Downloads\\db_cluster-04-03-2024@14-16-59.backup.gz\"",
|
|
140
|
+
"help.restoreExample2Desc": "# Imports and restores backup file directly (skips selection)",
|
|
141
|
+
"help.restoreExample3": "npx smoonb restore --file \"backup.backup.gz\" --storage \"my-project.storage.zip\"",
|
|
142
|
+
"help.restoreExample3Desc": "# Imports and restores backup and storage together",
|
|
143
|
+
"help.importTitle": "3. IMPORT - Import backup from Supabase Dashboard:",
|
|
144
|
+
"help.importExample1": "npx smoonb import --file \"C:\\Downloads\\db_cluster-04-03-2024@14-16-59.backup.gz\"",
|
|
145
|
+
"help.importExample1Desc": "# Imports database file only",
|
|
146
|
+
"help.importExample2": "npx smoonb import --file \"backup.backup.gz\" --storage \"my-project.storage.zip\"",
|
|
147
|
+
"help.importExample2Desc": "# Imports database and storage together (storage is optional)",
|
|
148
|
+
"help.checkTitle": "4. CHECK - Verify integrity after restore:",
|
|
149
|
+
"help.checkExample1": "npx smoonb check",
|
|
150
|
+
"help.checkExample1Desc": "# Verifies connection, extensions, tables, RLS, Realtime and Storage",
|
|
151
|
+
"help.tipsTitle": "IMPORTANT TIPS:",
|
|
152
|
+
"help.tip1": "• The import command requires a backup file (.backup.gz), but storage (.storage.zip) is optional",
|
|
153
|
+
"help.tip2": "• Storage depends on a backup, but backup does not depend on storage",
|
|
154
|
+
"help.tip3": "• Use absolute or relative paths for files in the import command",
|
|
155
|
+
"help.tip4": "• Backup file format must be: db_cluster-DD-MM-YYYY@HH-MM-SS.backup.gz",
|
|
156
|
+
"help.tip5": "• Storage file format must be: *.storage.zip",
|
|
157
|
+
|
|
158
|
+
"help.commands.backupDesc": "Create a full backup of your Supabase project using Supabase CLI",
|
|
159
|
+
"help.commands.backupSkipRealtime": "Skip interactive capture of Realtime Settings",
|
|
160
|
+
"help.commands.backupExamples": "Examples:",
|
|
161
|
+
"help.commands.backupExample1": "npx smoonb backup",
|
|
162
|
+
"help.commands.backupExample1Desc": "# Complete interactive process",
|
|
163
|
+
"help.commands.backupExample2": "npx smoonb backup --skip-realtime",
|
|
164
|
+
"help.commands.backupExample2Desc": "# Skips Realtime Settings configuration",
|
|
165
|
+
"help.commands.backupWhat": "What is captured:",
|
|
166
|
+
"help.commands.backupWhat1": "• Database PostgreSQL (pg_dumpall + separate SQL)",
|
|
167
|
+
"help.commands.backupWhat2": "• Database Extensions and Settings",
|
|
168
|
+
"help.commands.backupWhat3": "• Custom Roles",
|
|
169
|
+
"help.commands.backupWhat4": "• Edge Functions (automatic download)",
|
|
170
|
+
"help.commands.backupWhat5": "• Auth Settings (via Management API)",
|
|
171
|
+
"help.commands.backupWhat6": "• Storage Buckets (metadata via Management API)",
|
|
172
|
+
"help.commands.backupWhat7": "• Realtime Settings (7 interactive parameters)",
|
|
173
|
+
"help.commands.backupWhat8": "• Supabase .temp (temporary files)",
|
|
174
|
+
"help.commands.backupWhat9": "• Migrations (all project migrations)",
|
|
175
|
+
|
|
176
|
+
"help.commands.restoreDesc": "Restore a full backup using psql (interactive mode)",
|
|
177
|
+
"help.commands.restoreFile": "Full path of .backup.gz file to import and restore (optional)",
|
|
178
|
+
"help.commands.restoreStorage": "Full path of .storage.zip file to import with backup (optional)",
|
|
179
|
+
"help.commands.restoreExamples": "Examples:",
|
|
180
|
+
"help.commands.restoreExample1": "npx smoonb restore",
|
|
181
|
+
"help.commands.restoreExample1Desc": "# Interactive process that lists available backups",
|
|
182
|
+
"help.commands.restoreExample2": "npx smoonb restore --file \"C:\\Downloads\\db_cluster-04-03-2024@14-16-59.backup.gz\"",
|
|
183
|
+
"help.commands.restoreExample2Desc": "# Imports and restores backup file directly",
|
|
184
|
+
"help.commands.restoreExample3": "npx smoonb restore --file \"backup.backup.gz\" --storage \"my-project.storage.zip\"",
|
|
185
|
+
"help.commands.restoreExample3Desc": "# Imports and restores backup and storage together",
|
|
186
|
+
"help.commands.restoreFlow": "Restore flow:",
|
|
187
|
+
"help.commands.restoreFlow1": "1. Docker validation",
|
|
188
|
+
"help.commands.restoreFlow2": "2. Consent to read/write .env.local",
|
|
189
|
+
"help.commands.restoreFlow3": "3. Environment variable mapping",
|
|
190
|
+
"help.commands.restoreFlow4": "4. Backup selection (skips if --file provided)",
|
|
191
|
+
"help.commands.restoreFlow5": "5. Component selection to restore",
|
|
192
|
+
"help.commands.restoreFlow6": "6. Detailed summary and confirmation",
|
|
193
|
+
"help.commands.restoreFlow7": "7. Restore execution",
|
|
194
|
+
"help.commands.restoreWhenFile": "When to use --file:",
|
|
195
|
+
"help.commands.restoreWhenFile1": "• Automatically imports backup file before restoring",
|
|
196
|
+
"help.commands.restoreWhenFile2": "• Eliminates backup selection step",
|
|
197
|
+
"help.commands.restoreWhenFile3": "• If --storage provided, also imports storage file",
|
|
198
|
+
"help.commands.restoreWhenFile4": "• Useful for restoring backups downloaded directly from Dashboard",
|
|
199
|
+
"help.commands.restoreFormats": "Supported formats:",
|
|
200
|
+
"help.commands.restoreFormats1": "• .backup.gz (compressed) - Automatically decompresses",
|
|
201
|
+
"help.commands.restoreFormats2": "• .backup (uncompressed) - Restores directly",
|
|
202
|
+
|
|
203
|
+
"help.commands.checkDesc": "Verify Supabase project integrity after restore",
|
|
204
|
+
"help.commands.checkExamples": "Examples:",
|
|
205
|
+
"help.commands.checkExample1": "npx smoonb check",
|
|
206
|
+
"help.commands.checkExample1Desc": "# Verifies integrity and displays report in console",
|
|
207
|
+
"help.commands.checkWhat": "What is verified:",
|
|
208
|
+
"help.commands.checkWhat1": "• Database connection",
|
|
209
|
+
"help.commands.checkWhat2": "• Installed PostgreSQL extensions",
|
|
210
|
+
"help.commands.checkWhat3": "• Created tables",
|
|
211
|
+
"help.commands.checkWhat4": "• RLS policies (Row Level Security)",
|
|
212
|
+
"help.commands.checkWhat5": "• Realtime publications",
|
|
213
|
+
"help.commands.checkWhat6": "• Storage buckets",
|
|
214
|
+
|
|
215
|
+
"help.commands.importDesc": "Import .backup.gz file and optionally .storage.zip from Supabase Dashboard",
|
|
216
|
+
"help.commands.importFile": "Full path of .backup.gz file to import",
|
|
217
|
+
"help.commands.importStorage": "Full path of .storage.zip file to import (optional)",
|
|
218
|
+
"help.commands.importExamples": "Examples:",
|
|
219
|
+
"help.commands.importExample1": "npx smoonb import --file \"C:\\Downloads\\db_cluster-04-03-2024@14-16-59.backup.gz\"",
|
|
220
|
+
"help.commands.importExample1Desc": "# Imports database file only",
|
|
221
|
+
"help.commands.importExample2": "npx smoonb import --file \"backup.backup.gz\" --storage \"my-project.storage.zip\"",
|
|
222
|
+
"help.commands.importExample2Desc": "# Imports database and storage together",
|
|
223
|
+
"help.commands.importFormats": "File formats:",
|
|
224
|
+
"help.commands.importFormats1": "• Backup: db_cluster-DD-MM-YYYY@HH-MM-SS.backup.gz (required)",
|
|
225
|
+
"help.commands.importFormats2": "• Storage: *.storage.zip (optional)",
|
|
226
|
+
"help.commands.importImportant": "Important:",
|
|
227
|
+
"help.commands.importImportant1": "• Backup file is required",
|
|
228
|
+
"help.commands.importImportant2": "• Storage file is optional and depends on a backup",
|
|
229
|
+
"help.commands.importImportant3": "• Both files will be copied to the same backup folder",
|
|
230
|
+
"help.commands.importImportant4": "• Imported backup will be available for restore command",
|
|
231
|
+
"help.commands.importImportant5": "• Use absolute or relative paths",
|
|
232
|
+
|
|
233
|
+
"quickHelp.title": "MAIN COMMANDS:",
|
|
234
|
+
"quickHelp.backupTitle": "Full backup:",
|
|
235
|
+
"quickHelp.backupDesc": "npx smoonb backup # Full interactive backup using Docker",
|
|
236
|
+
"quickHelp.restoreTitle": "Full restoration:",
|
|
237
|
+
"quickHelp.restoreDesc": "npx smoonb restore # Interactive restoration using psql (Docker)",
|
|
238
|
+
"quickHelp.checkTitle": "Post-restore verification:",
|
|
239
|
+
"quickHelp.checkDesc": "npx smoonb check # Verifies project integrity",
|
|
240
|
+
"quickHelp.configuration": "CONFIGURATION:",
|
|
241
|
+
"quickHelp.configurationDesc": "Configure the .env.local file in the project root with your Supabase credentials. The smoonb will map variables interactively on first execution.",
|
|
242
|
+
"quickHelp.tokenTitle": "PERSONAL ACCESS TOKEN (REQUIRED):",
|
|
243
|
+
"quickHelp.tokenDesc": "For Management API (Edge Functions, Auth Settings, Storage):",
|
|
244
|
+
"quickHelp.tokenStep1": "1. Visit: https://supabase.com/dashboard/account/tokens",
|
|
245
|
+
"quickHelp.tokenStep2": "2. Click \"Generate new token\"",
|
|
246
|
+
"quickHelp.tokenStep3": "3. Copy the token (format: sbp_...)",
|
|
247
|
+
"quickHelp.tokenStep4": "4. Add to .env.local as SUPABASE_ACCESS_TOKEN",
|
|
248
|
+
"quickHelp.update": "UPDATE TO LATEST VERSION:",
|
|
249
|
+
"quickHelp.updateCommand": "npm install smoonb@latest"
|
|
250
|
+
}
|
|
251
|
+
|