dsh-plugin-update 0.5.6 → 0.5.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  格式为 Keep-a-Changelog 子集:`Added/Fixed/Changed` 必写,`Deprecated/Removed/Security` 有则透传,`Unreleased` 面板忽略,禁止 git-log 直倒。面板缺日志时中性提示,不挡安装。
4
4
 
5
+ ## [0.5.7] - 2026-10-06
6
+
7
+ ### Fixed
8
+ - 拆入口通道安装禁令(#58 真因):入口件 HTTP 直挂不再源码级禁 updateInstall(入口件核心本就没有安装代码路径,禁令只连坐入口件打开的面板;真正门禁在宿主侧核心);入口打开面板后安装电话端到端验证通过。
9
+
5
10
  ## [0.5.6] - 2026-10-06
6
11
 
7
12
  ### Added
package/dist/http.d.ts CHANGED
@@ -102,7 +102,12 @@ export interface UpdateEntryHttpOptions extends Omit<UpdateEntryOptions, "call"
102
102
  timeout?: number | HttpTimeouts;
103
103
  timeoutMs?: number | HttpTimeouts;
104
104
  }
105
- /** 入口件 HTTP 直挂:内部源码级禁安装电话,内核复用 mountUpdateEntry。 */
105
+ /** 入口件 HTTP 直挂:调用通道与面板直挂同一条,内核复用 mountUpdateEntry。
106
+ *
107
+ * 通道层不禁安装:入口件核心没有调安装的代码路径(只查 + 打开面板,见 README 铁律),
108
+ * 禁令只会连坐入口件打开的面板(#58:安装键亮着但永远抛错);真正的门禁在宿主侧核心
109
+ *(凭证/排队/安装键/装后校验),面板安装与面板直挂走同一套,不过不少。
110
+ */
106
111
  export declare function mountUpdateEntryHttp(container: UpdatePanelContainer, options: UpdateEntryHttpOptions): UpdateEntryController;
107
112
  export interface UpdateBatchPanelHttpOptions extends Omit<BatchPanelOptions, "call" | "prefix"> {
108
113
  /** 批量电话前缀(与宿主侧一致;五电话名从它算出,不写字面量)。 */
package/dist/http.js CHANGED
@@ -261,15 +261,9 @@ function mountUpdateEntryHttp(container, options) {
261
261
  throw new Error("[dsh-plugin-update] \u6302 HTTP \u5165\u53E3\u4EF6\u7F3A\u5C11\u914D\u7F6E\uFF1A\u63D2\u4EF6\u6807\u8BC6 pluginId \u4E0E\u7F51\u5173\u6839 baseUrl \u5FC5\u586B");
262
262
  }
263
263
  const prefix = options.prefix ?? DEFAULT_PREFIX;
264
- const rawCall = createHttpCall({ prefix, baseUrl: options.baseUrl, routes: options.routes, fetch: options.fetch, fetchImpl: options.fetchImpl, timeout: options.timeout, timeoutMs: options.timeoutMs });
265
- const guarded = async (name, args) => {
266
- if (shortActionOf(name) === "updateInstall") {
267
- throw new Error("[dsh-plugin-update] \u5165\u53E3\u4EF6\u53EA\u5141\u8BB8\u53EA\u8BFB\u7535\u8BDD\uFF0CupdateInstall \u7981\u6B62\uFF08\u6E90\u7801\u7EA7\uFF09");
268
- }
269
- return rawCall(name, args);
270
- };
264
+ const call = createHttpCall({ prefix, baseUrl: options.baseUrl, routes: options.routes, fetch: options.fetch, fetchImpl: options.fetchImpl, timeout: options.timeout, timeoutMs: options.timeoutMs });
271
265
  const { baseUrl: _b, routes: _r, fetch: _f, fetchImpl: _fi, timeout: _t, timeoutMs: _tm, prefix: _p, ...entryRest } = options;
272
- return mountUpdateEntry(container, { ...entryRest, pluginId: options.pluginId, prefix, call: guarded });
266
+ return mountUpdateEntry(container, { ...entryRest, pluginId: options.pluginId, prefix, call });
273
267
  }
274
268
  function mountUpdateBatchPanelHttp(container, options) {
275
269
  if (!options || typeof options !== "object") {
package/dist/lang.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /** 本包跟随的两种语言:中文(历史行为)与英文(其余语言落英文)。 */
2
+ export type AppLang = 'zh' | 'en';
3
+ /** 显式覆盖的两种形态:稳定码 'zh' | 'en',或带 getActive/subscribe 的服务对象(可注入假信号源,测试不依赖 jsdom)。 */
4
+ export interface LocaleService {
5
+ getActive(): string;
6
+ subscribe?(cb: () => void): () => void;
7
+ }
8
+ /** 入口件/面板/批量挂载点的语言选项:显式覆盖,不传即跟随全局信号。 */
9
+ export type LocaleOption = 'zh' | 'en' | LocaleService | string | null | undefined;
10
+ type LangCallback = (lang: AppLang) => void;
11
+ /**
12
+ * 归一语言标签:zh* → zh;形如 BCP47 的已知非中文标签 → en;空/垃圾 → zh(零回归)。
13
+ * 大小写不敏感,_ 视作 -。
14
+ */
15
+ export declare function normalizeLangTag(tag: unknown): AppLang;
16
+ /**
17
+ * 解出当前语言:显式覆盖 > html[lang] > navigator.languages > zh。
18
+ * 纯函数(除读全局信号外无副作用);无信号永不抛,落 zh。
19
+ */
20
+ export declare function resolveLang(override?: LocaleOption): AppLang;
21
+ /**
22
+ * 订阅语言变化:html[lang] 变化或可选服务源触发时回新语言。
23
+ * 模块级单例:多个挂载件共用一个 MutationObserver;返回 unsubscribe,unmount 后停订。
24
+ * 无 DOM 环境安全降级:没有 document/MutationObserver 时只记回调、永不触发,不抛。
25
+ */
26
+ export declare function subscribeLang(cb: LangCallback, override?: LocaleOption): () => void;
27
+ /** 测试/维护用:清空全部订阅并断开单例观察者(正常业务代码不调它)。 */
28
+ export declare function __resetLangState(): void;
29
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-update",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "可复用的更新系统装成的 npm 包:任何 DSH 插件照文档能集成检查更新等功能(地图 #579)",
5
5
  "license": "MIT",
6
6
  "author": "王辰浩",