dsh-config-manager 0.1.41 → 0.1.43
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 +21 -0
- package/lib/client.d.ts +47 -2
- package/lib/client.js +457 -207
- package/lib/client.js.map +1 -1
- package/lib/index.js +98 -3
- package/lib/index.js.map +1 -1
- package/lib/market/github-repos.d.ts +18 -0
- package/lib/market/github-repos.js +51 -0
- package/lib/market/github-repos.js.map +1 -1
- package/lib/market/my-repo.d.ts +5 -1
- package/lib/market/my-repo.js +14 -4
- package/lib/market/my-repo.js.map +1 -1
- package/lib/market/repo-url.d.ts +24 -0
- package/lib/market/repo-url.js +30 -0
- package/lib/market/repo-url.js.map +1 -0
- package/lib/market/star-cache.d.ts +48 -0
- package/lib/market/star-cache.js +57 -0
- package/lib/market/star-cache.js.map +1 -0
- package/lib/market/types.d.ts +2 -0
- package/lib/sync/ui-prefs.d.ts +14 -0
- package/lib/sync/ui-prefs.js +32 -4
- package/lib/sync/ui-prefs.js.map +1 -1
- package/lib/ui/star-prompt.d.ts +37 -0
- package/lib/ui/star-prompt.js +36 -0
- package/lib/ui/star-prompt.js.map +1 -0
- package/package.json +2 -1
- package/src/client/ConfigManagerSection.tsx +75 -1
- package/src/client/api.ts +51 -0
- package/src/client/common/ConfirmDialog.tsx +15 -6
- package/src/client/common/ui.tsx +4 -2
- package/src/client/config-manager.module.css +13 -2
- package/src/client/locales.ts +11 -0
- package/src/client/market/MarketPanel.tsx +43 -4
- package/src/client/market/MyConfigsView.tsx +3 -0
- package/src/client/market/market-locales.ts +19 -4
- package/src/client/market/market-view.test.ts +74 -3
- package/src/client/market/market-view.ts +56 -0
- package/src/client/market/my-configs-view.test.ts +23 -0
- package/src/client/market/my-configs-view.ts +5 -0
- package/src/client/run-store.ts +8 -0
- package/src/index.ts +94 -3
- package/src/market/github-repos.test.ts +64 -0
- package/src/market/github-repos.ts +55 -0
- package/src/market/my-repo.test.ts +2 -0
- package/src/market/my-repo.ts +16 -4
- package/src/market/repo-url.test.ts +60 -0
- package/src/market/repo-url.ts +45 -0
- package/src/market/star-cache.test.ts +102 -0
- package/src/market/star-cache.ts +91 -0
- package/src/market/types.ts +2 -0
- package/src/sync/ui-prefs.test.ts +58 -2
- package/src/sync/ui-prefs.ts +42 -4
- package/src/ui/star-prompt.test.ts +53 -0
- package/src/ui/star-prompt.ts +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xiajiajun516
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/client.d.ts
CHANGED
|
@@ -568,6 +568,31 @@ interface RestoreResponse {
|
|
|
568
568
|
plan?: RestorePlan;
|
|
569
569
|
report?: RestoreReport;
|
|
570
570
|
}
|
|
571
|
+
/** Star 引导弹窗状态(GET /star-prompt;纯偏好,无 secret) */
|
|
572
|
+
interface StarPromptStatus {
|
|
573
|
+
ok: boolean;
|
|
574
|
+
/** 引导用户点 Star 的 GitHub 仓库地址(Host 提供,硬编码常量) */
|
|
575
|
+
repoUrl: string;
|
|
576
|
+
/** 首次进入页面时间(ms 时间戳);undefined = 尚未进入过页面 */
|
|
577
|
+
firstSeenAt?: number;
|
|
578
|
+
/** 用户点过「不再提示」 */
|
|
579
|
+
dismissed: boolean;
|
|
580
|
+
/** 用户点过「去点 Star」(方案 A:引导完成) */
|
|
581
|
+
clicked: boolean;
|
|
582
|
+
}
|
|
583
|
+
/** Star 引导弹窗状态的局部更新补丁(POST /star-prompt;全部可选) */
|
|
584
|
+
interface StarPromptPatch {
|
|
585
|
+
firstSeenAt?: number;
|
|
586
|
+
dismissed?: boolean;
|
|
587
|
+
clicked?: boolean;
|
|
588
|
+
}
|
|
589
|
+
/** POST /star-prompt 响应(更新后的最新状态) */
|
|
590
|
+
interface StarPromptSaveResponse {
|
|
591
|
+
ok: boolean;
|
|
592
|
+
firstSeenAt?: number;
|
|
593
|
+
dismissed: boolean;
|
|
594
|
+
clicked: boolean;
|
|
595
|
+
}
|
|
571
596
|
/** 携带路由 JSON error 消息的错误类型 */
|
|
572
597
|
declare class ConfigManagerApiError extends Error {
|
|
573
598
|
constructor(message: string);
|
|
@@ -599,6 +624,11 @@ declare class ConfigManagerApi {
|
|
|
599
624
|
constructor(t?: UiT);
|
|
600
625
|
/** 健康/版本检查(主页横幅:插件版本 / DSH 版本 / 平台) */
|
|
601
626
|
status(): Promise<ServiceStatus>;
|
|
627
|
+
/** Star 引导弹窗状态(进入页面时判定是否展示 / 是否补记首次使用时间)。 */
|
|
628
|
+
starPromptStatus(): Promise<StarPromptStatus>;
|
|
629
|
+
/** 保存 Star 引导弹窗状态(局部更新:firstSeenAt / dismissed / clicked)。
|
|
630
|
+
* 纯偏好无 secret;失败由调用方静默降级(本次不弹/不记,下次再判)。 */
|
|
631
|
+
saveStarPrompt(patch: StarPromptPatch): Promise<StarPromptSaveResponse>;
|
|
602
632
|
/** ExportPort.export:调用 Host 侧导出编排(core Exporter)。加密密码随请求体传输(仅内存)。
|
|
603
633
|
* 带 AbortController 超时:宿主若卡死,客户端得到明确错误而不是永远停在进度条。 */
|
|
604
634
|
export(options: ExportOptions): Promise<ExportResponse>;
|
|
@@ -1085,6 +1115,8 @@ interface MarketListItem {
|
|
|
1085
1115
|
categories?: string[];
|
|
1086
1116
|
/** 条目来源仓库 URL(来自 index 条目;UI 据此显示来源徽章);缺省 = 市场仓库自身 */
|
|
1087
1117
|
repo?: string;
|
|
1118
|
+
/** 条目来源仓库的 star 数(仓库级,非条目级;undefined = 无数据——查询失败/非 GitHub 仓库) */
|
|
1119
|
+
stars?: number;
|
|
1088
1120
|
/** 本地缓存状态:cached | fresh | none(UI 徽章) */
|
|
1089
1121
|
cacheState: 'cached' | 'fresh' | 'none';
|
|
1090
1122
|
}
|
|
@@ -1278,6 +1310,8 @@ interface MyItemEntry {
|
|
|
1278
1310
|
prUrl?: string;
|
|
1279
1311
|
/** 用户公开仓库 URL */
|
|
1280
1312
|
repoUrl: string;
|
|
1313
|
+
/** 用户公开仓库(<login>/dsh-configs)的 star 数(仓库级;undefined = 无数据) */
|
|
1314
|
+
stars?: number;
|
|
1281
1315
|
}
|
|
1282
1316
|
//#endregion
|
|
1283
1317
|
//#region src/client/market/my-configs-api.d.ts
|
|
@@ -1489,6 +1523,10 @@ declare const zh$2: {
|
|
|
1489
1523
|
readonly 'report.needsRestart': "插件 / MCP 变更将在重启 DSH 后生效。";
|
|
1490
1524
|
readonly 'error.title': "操作失败";
|
|
1491
1525
|
readonly 'error.hint': "错误消息已自动脱敏,不会泄露任何密钥信息。";
|
|
1526
|
+
readonly 'starPrompt.title': "喜欢 Config Manager 吗?";
|
|
1527
|
+
readonly 'starPrompt.body': "如果你觉得这个插件有用,欢迎到 GitHub 点个 ⭐ Star 支持一下——你的支持是持续维护的最大动力!";
|
|
1528
|
+
readonly 'starPrompt.star': "去点 Star";
|
|
1529
|
+
readonly 'starPrompt.dismiss': "不再提示";
|
|
1492
1530
|
readonly 'about.title': "关于 DSH Config Manager";
|
|
1493
1531
|
readonly 'about.subtitle': "插件信息、作者与反馈入口";
|
|
1494
1532
|
readonly 'about.official': "官方";
|
|
@@ -1707,13 +1745,20 @@ declare const zh: {
|
|
|
1707
1745
|
readonly 'list.noItems': "该市场暂无条目。";
|
|
1708
1746
|
readonly 'list.searchPlaceholder': "搜索名称 / 作者 / 描述…";
|
|
1709
1747
|
readonly 'list.categoriesAll': "全部类别";
|
|
1748
|
+
readonly 'list.sourceAll': "全部来源";
|
|
1749
|
+
readonly 'list.sourceOfficial': "官方配置";
|
|
1750
|
+
readonly 'list.sourcePersonal': "个人配置";
|
|
1751
|
+
readonly 'list.sortDefault': "默认排序";
|
|
1752
|
+
readonly 'list.sortUpdated': "最新更新";
|
|
1753
|
+
readonly 'list.sortStars': "⭐ 最多";
|
|
1754
|
+
readonly 'list.sortName': "名称 A–Z";
|
|
1755
|
+
readonly 'list.stars': "⭐ {count}";
|
|
1756
|
+
readonly 'list.starsHint': "来源仓库 star 数(仓库级,非本条目)";
|
|
1710
1757
|
readonly 'list.count': "共 {count} 个条目";
|
|
1711
1758
|
readonly 'list.filtered': "(筛选后 {count} 个)";
|
|
1712
1759
|
readonly 'list.cacheCached': "已缓存";
|
|
1713
1760
|
readonly 'list.cacheFresh': "刚刚拉取";
|
|
1714
1761
|
readonly 'list.cacheNone': "未缓存";
|
|
1715
|
-
readonly 'list.sourceOfficial': "官方来源";
|
|
1716
|
-
readonly 'list.sourceThirdParty': "第三方来源";
|
|
1717
1762
|
readonly 'list.download': "查看详情";
|
|
1718
1763
|
readonly 'detail.title': "条目详情";
|
|
1719
1764
|
readonly 'detail.downloadedAt': "下载时间:{time}";
|