gencow 0.1.170 → 0.1.172

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.
@@ -80,18 +80,23 @@ function renderBackupHelp(logImpl = log, errorImpl = error, subCmd = null) {
80
80
  logImpl(` gencow backup download <id> Download backup file (Pro+)\n`);
81
81
  }
82
82
 
83
- async function promptRestoreConfirm(sourceLabel, { createInterfaceImpl }) {
83
+ export function buildRestoreConfirmPrompt(sourceLabel, { includeStorageRisk = false } = {}) {
84
+ const storageRisk = includeStorageRisk
85
+ ? `\n ${YELLOW}⚠ 백업 파일 복원은 DB만 교체하며 storage object/blob는 함께 이동하지 않습니다.${RESET}` +
86
+ `\n ${DIM}기본 용도는 같은 환경 복원(prod→prod, dev→dev)입니다. 다른 환경의 dump를 복원하면 이미지/파일 참조가 깨질 수 있습니다.${RESET}`
87
+ : "";
88
+ return `\n ${YELLOW}⚠ 현재 데이터베이스가 ${sourceLabel}로 교체됩니다.${RESET}${storageRisk}\n 계속하시겠습니까? (y/N): `;
89
+ }
90
+
91
+ async function promptRestoreConfirm(sourceLabel, { createInterfaceImpl, includeStorageRisk = false }) {
84
92
  const createInterface = createInterfaceImpl ?? (await import("readline")).createInterface;
85
93
  const rl = createInterface({ input: process.stdin, output: process.stdout });
86
94
  return await new Promise((resolveAnswer) => {
87
- rl.question(
88
- `\n ${YELLOW}⚠ 현재 데이터베이스가 ${sourceLabel}로 교체됩니다. 계속하시겠습니까? (y/N): ${RESET}`,
89
- (answer) => {
90
- rl.close();
91
- const normalized = answer.trim().toLowerCase();
92
- resolveAnswer(normalized === "y" || normalized === "yes");
93
- },
94
- );
95
+ rl.question(buildRestoreConfirmPrompt(sourceLabel, { includeStorageRisk }), (answer) => {
96
+ rl.close();
97
+ const normalized = answer.trim().toLowerCase();
98
+ resolveAnswer(normalized === "y" || normalized === "yes");
99
+ });
95
100
  });
96
101
  }
97
102
 
@@ -252,7 +257,10 @@ export function createBackupCommand({
252
257
  return;
253
258
  }
254
259
 
255
- const confirmed = await promptRestoreConfirm(`파일 ${filePath}`, { createInterfaceImpl });
260
+ const confirmed = await promptRestoreConfirm(`파일 ${filePath}`, {
261
+ createInterfaceImpl,
262
+ includeStorageRisk: true,
263
+ });
256
264
  if (!confirmed) {
257
265
  infoImpl("Restore cancelled.");
258
266
  return;