mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-25 19:48:33 +08:00
refactor: redesign cli settings export/import API with endpoint-based schema
Replace nested settings structure with flat endpoints array for export/import. Add conflict strategy options (skip/overwrite/merge) and skipInvalid/disableImported flags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6159,28 +6159,17 @@ export async function upgradeCcwInstallation(
|
||||
*/
|
||||
export interface ExportedSettings {
|
||||
version: string;
|
||||
exportedAt: string;
|
||||
settings: {
|
||||
cliTools?: Record<string, unknown>;
|
||||
chineseResponse?: {
|
||||
claudeEnabled: boolean;
|
||||
codexEnabled: boolean;
|
||||
};
|
||||
windowsPlatform?: {
|
||||
enabled: boolean;
|
||||
};
|
||||
codexCliEnhancement?: {
|
||||
enabled: boolean;
|
||||
};
|
||||
};
|
||||
timestamp: string;
|
||||
endpoints: Array<Record<string, unknown>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import options for settings import
|
||||
*/
|
||||
export interface ImportOptions {
|
||||
overwrite?: boolean;
|
||||
dryRun?: boolean;
|
||||
conflictStrategy?: 'skip' | 'overwrite' | 'merge';
|
||||
skipInvalid?: boolean;
|
||||
disableImported?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -619,7 +619,7 @@ function ResponseLanguageSection() {
|
||||
const data = JSON.parse(text) as ExportedSettings;
|
||||
|
||||
// Validate basic structure
|
||||
if (!data.version || !data.settings) {
|
||||
if (!data.version || !data.endpoints) {
|
||||
toast.error(formatMessage({ id: 'settings.responseLanguage.importInvalidStructure' }));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user