dsh-config-manager 0.1.33 → 0.1.34
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/lib/client.d.ts +36 -7
- package/lib/client.js +420 -128
- package/lib/client.js.map +1 -1
- package/lib/index.js +13 -10
- package/lib/index.js.map +1 -1
- package/lib/sync/sync-config.d.ts +21 -4
- package/lib/sync/sync-config.js +86 -8
- package/lib/sync/sync-config.js.map +1 -1
- package/lib/ui/import-wizard.d.ts +3 -1
- package/lib/ui/import-wizard.js +5 -1
- package/lib/ui/import-wizard.js.map +1 -1
- package/package.json +1 -1
- package/src/client/ConfigManagerSection.tsx +37 -12
- package/src/client/about/AboutPanel.tsx +118 -0
- package/src/client/about/about-view.test.ts +91 -0
- package/src/client/about/about-view.ts +104 -0
- package/src/client/api.ts +50 -15
- package/src/client/common/ui.tsx +26 -2
- package/src/client/config-manager.module.css +27 -0
- package/src/client/export/ExportView.tsx +9 -7
- package/src/client/import/ImportWizardView.tsx +7 -2
- package/src/client/import/import-file-select.test.ts +13 -0
- package/src/client/import/import-file-select.ts +1 -1
- package/src/client/index.ts +4 -3
- package/src/client/locales.ts +31 -0
- package/src/client/sync/sync-api.ts +4 -3
- package/src/index.ts +14 -11
- package/src/sync/sync-config.test.ts +96 -12
- package/src/sync/sync-config.ts +87 -9
- package/src/ui/import-wizard.test.ts +37 -0
- package/src/ui/import-wizard.ts +4 -1
package/lib/client.d.ts
CHANGED
|
@@ -574,6 +574,10 @@ interface DownloadResult {
|
|
|
574
574
|
streamed: boolean;
|
|
575
575
|
bytes: number;
|
|
576
576
|
}
|
|
577
|
+
/** 下载选项:saveDialog=true 才弹系统保存对话框(需用户手势);缺省自动下载到浏览器下载目录 */
|
|
578
|
+
interface DownloadOptions {
|
|
579
|
+
saveDialog?: boolean;
|
|
580
|
+
}
|
|
577
581
|
/**
|
|
578
582
|
* Config Manager 浏览器半的唯一数据入口。
|
|
579
583
|
* 同时实现 `ExportPort`(export-flow 用)与 `ImportPort`(import-wizard 用)。
|
|
@@ -594,10 +598,13 @@ declare class ConfigManagerApi {
|
|
|
594
598
|
* 带 AbortController 超时:宿主若卡死,客户端得到明确错误而不是永远停在进度条。 */
|
|
595
599
|
export(options: ExportOptions): Promise<ExportResponse>;
|
|
596
600
|
/**
|
|
597
|
-
* 把导出的 ZIP
|
|
598
|
-
*
|
|
601
|
+
* 把导出的 ZIP 下载到本机。
|
|
602
|
+
* - 默认(saveDialog 缺省/false):读取为 Blob 后用 <a download> 触发浏览器
|
|
603
|
+
* 静默下载到「下载」目录,无需用户额外操作(导出完成即可自动调用);
|
|
604
|
+
* - saveDialog: true:优先 File System Access API 流式落盘(不占整文件内存),
|
|
605
|
+
* 用户可在系统保存对话框中选择位置;不可用/取消时回退 Blob 下载。
|
|
599
606
|
*/
|
|
600
|
-
download(zipPath: string, onProgress?: (received: number, total: number) => void): Promise<DownloadResult>;
|
|
607
|
+
download(zipPath: string, opts?: DownloadOptions, onProgress?: (received: number, total: number) => void): Promise<DownloadResult>;
|
|
601
608
|
/** 上传用户选择的 ZIP 到 Host 受控临时目录,返回可引用的 zipPath(dsh-ssh 同款原始字节上传) */
|
|
602
609
|
upload(file: File): Promise<UploadResponse>;
|
|
603
610
|
/** ImportPort.analyzeImport:零写入分析(校验/兼容性/差异/路径/秘密检测) */
|
|
@@ -663,14 +670,15 @@ type SyncTransportType = 'git' | 'webdav';
|
|
|
663
670
|
/** GET /sync/status 响应:配置/凭据/上次同步的只读事实(无任何 secret 值) */
|
|
664
671
|
interface SyncStatusResponse {
|
|
665
672
|
ok: boolean;
|
|
666
|
-
/** 是否已保存过仓库/通道配置(sync-config.json) */
|
|
673
|
+
/** 是否已保存过仓库/通道配置(sync-config.json;任一通道配置过即为 true) */
|
|
667
674
|
configured: boolean;
|
|
668
|
-
/** git
|
|
675
|
+
/** git 通道:已配置的仓库地址(不含 token,可回显;与当前通道无关,配置过即返回) */
|
|
669
676
|
repoUrl?: string;
|
|
670
677
|
/** git 通道:DSH credentials 中是否已存在 token(describe 只报状态,值永不返回) */
|
|
671
678
|
credentialConfigured: boolean;
|
|
672
679
|
credentialWritable: boolean;
|
|
673
|
-
/** webdav 通道:配置状态(url 可回显,username 非敏感;password
|
|
680
|
+
/** webdav 通道:配置状态(url 可回显,username 非敏感;password 值永不返回;
|
|
681
|
+
* 与当前通道无关,配置过即返回,供 git ↔ webdav 切换时回填表单) */
|
|
674
682
|
webdav?: WebDavStatusResponse;
|
|
675
683
|
/** sync-state.lastSyncAt;'' = 从未同步 */
|
|
676
684
|
lastSyncAt?: string;
|
|
@@ -1127,6 +1135,7 @@ declare const zh$2: {
|
|
|
1127
1135
|
readonly 'view.snapshots': "快照恢复";
|
|
1128
1136
|
readonly 'view.sync': "远程同步";
|
|
1129
1137
|
readonly 'view.market': "配置市场";
|
|
1138
|
+
readonly 'view.about': "关于";
|
|
1130
1139
|
readonly 'common.close': "关闭";
|
|
1131
1140
|
readonly 'common.cancel': "取消";
|
|
1132
1141
|
readonly 'common.back': "上一步";
|
|
@@ -1154,6 +1163,7 @@ declare const zh$2: {
|
|
|
1154
1163
|
readonly 'export.run': "开始导出";
|
|
1155
1164
|
readonly 'export.running': "正在导出…";
|
|
1156
1165
|
readonly 'export.download': "下载备份文件";
|
|
1166
|
+
readonly 'export.saved': "已保存到下载目录:{name}";
|
|
1157
1167
|
readonly 'export.selectionWarnings': "以下分区为设备相关数据,跨设备导入时可能不适用:";
|
|
1158
1168
|
readonly 'export.group.unknown': "其他";
|
|
1159
1169
|
readonly 'export.included': "已包含";
|
|
@@ -1250,6 +1260,19 @@ declare const zh$2: {
|
|
|
1250
1260
|
readonly 'report.needsRestart': "插件 / MCP 变更将在重启 DSH 后生效。";
|
|
1251
1261
|
readonly 'error.title': "操作失败";
|
|
1252
1262
|
readonly 'error.hint': "错误消息已自动脱敏,不会泄露任何密钥信息。";
|
|
1263
|
+
readonly 'about.title': "关于 DSH Config Manager";
|
|
1264
|
+
readonly 'about.subtitle': "插件信息、作者与反馈入口";
|
|
1265
|
+
readonly 'about.official': "官方";
|
|
1266
|
+
readonly 'about.version': "版本 {version}";
|
|
1267
|
+
readonly 'about.dshVersion': "DSH {version}";
|
|
1268
|
+
readonly 'about.links': "相关链接";
|
|
1269
|
+
readonly 'about.star': "⭐ 在 GitHub 上点赞";
|
|
1270
|
+
readonly 'about.repo': "GitHub 仓库";
|
|
1271
|
+
readonly 'about.docs': "使用文档";
|
|
1272
|
+
readonly 'about.issues': "反馈问题";
|
|
1273
|
+
readonly 'about.authorLabel': "作者";
|
|
1274
|
+
readonly 'about.loading': "正在获取版本信息…";
|
|
1275
|
+
readonly 'about.retryStatus': "重新获取";
|
|
1253
1276
|
};
|
|
1254
1277
|
/** 字典键联合(注册处 compile-time 校验) */
|
|
1255
1278
|
type ConfigManagerKey = keyof typeof zh$2;
|
|
@@ -1514,6 +1537,12 @@ interface MarketPanelProps {
|
|
|
1514
1537
|
t: TranslateNS<'config-manager-market'>;
|
|
1515
1538
|
}
|
|
1516
1539
|
//#endregion
|
|
1540
|
+
//#region src/client/about/AboutPanel.d.ts
|
|
1541
|
+
interface AboutPanelProps {
|
|
1542
|
+
api: ConfigManagerApi;
|
|
1543
|
+
t: TranslateNS<'config-manager'>;
|
|
1544
|
+
}
|
|
1545
|
+
//#endregion
|
|
1517
1546
|
//#region src/client/index.d.ts
|
|
1518
1547
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
1519
1548
|
interface LocaleNamespaceMap {
|
|
@@ -1533,7 +1562,7 @@ declare const inject: string[];
|
|
|
1533
1562
|
*/
|
|
1534
1563
|
declare function apply(ctx: ClientContext): void;
|
|
1535
1564
|
//#endregion
|
|
1536
|
-
export { type ConfigManagerApiError, type ConfigManagerKey, type ConfigManagerSectionProps, type DownloadResult, type ExportViewProps, type ImportWizardViewProps, type MarketKey, type MarketPanelProps, type ServiceStatus, type SyncKey, type SyncSettingsViewProps, type UploadResponse, apply, inject };
|
|
1565
|
+
export { type AboutPanelProps, type ConfigManagerApiError, type ConfigManagerKey, type ConfigManagerSectionProps, type DownloadResult, type ExportViewProps, type ImportWizardViewProps, type MarketKey, type MarketPanelProps, type ServiceStatus, type SyncKey, type SyncSettingsViewProps, type UploadResponse, apply, inject };
|
|
1537
1566
|
|
|
1538
1567
|
return module.exports;
|
|
1539
1568
|
}
|