@ququ-jiaxk/dsh-plugin-center 0.1.37 → 0.1.38
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.js +1 -1
- package/lib/index.js +19 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(client_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(client_exports);
|
|
31
31
|
var import_react = require("react");
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var PLUGIN_VERSION = true ? "0.1.
|
|
33
|
+
var PLUGIN_VERSION = true ? "0.1.38" : "0.0.0";
|
|
34
34
|
var PANEL_ID = "plugin-center";
|
|
35
35
|
var inject = ["slots", "remote", "remote.pluginManager"];
|
|
36
36
|
var hostCtx = null;
|
package/lib/index.js
CHANGED
|
@@ -402,6 +402,10 @@ export function apply(ctx) {
|
|
|
402
402
|
installedVersion: own.version ?? HOST_VERSION,
|
|
403
403
|
updatable: Boolean(own.updatable),
|
|
404
404
|
source: own.source ?? null,
|
|
405
|
+
availability: own.availability ?? null,
|
|
406
|
+
readOnlyReason: own.readOnlyReason ?? null,
|
|
407
|
+
official: Boolean(own.official),
|
|
408
|
+
error: own.error ?? null,
|
|
405
409
|
}
|
|
406
410
|
}
|
|
407
411
|
} catch {
|
|
@@ -437,13 +441,27 @@ export function apply(ctx) {
|
|
|
437
441
|
const installedVersion = own?.version ?? HOST_VERSION
|
|
438
442
|
if (!own?.updatable) {
|
|
439
443
|
const blocked = selfUpdateBlockedInfo(own)
|
|
444
|
+
// listVersions 对不可升级的 bundle 会直接返回 DSH 的原始拒绝理由(不走网络),
|
|
445
|
+
// 把它带出来,省得只能猜是来源、版本还是只读。
|
|
446
|
+
let detail = null
|
|
447
|
+
try {
|
|
448
|
+
const refused = await manager.listVersions(SELF_PACKAGE)
|
|
449
|
+
if (refused?.status === 'refused' && refused.reason) detail = String(refused.reason)
|
|
450
|
+
} catch {
|
|
451
|
+
/* 旧版管理器可能没有 listVersions,忽略 */
|
|
452
|
+
}
|
|
440
453
|
return send(res, 200, {
|
|
441
454
|
status: 'not-updatable',
|
|
442
455
|
version: HOST_VERSION,
|
|
443
456
|
installedVersion,
|
|
444
457
|
source: own?.source ?? null,
|
|
445
458
|
reason: blocked.reason,
|
|
446
|
-
|
|
459
|
+
detail,
|
|
460
|
+
availability: own?.availability ?? null,
|
|
461
|
+
readOnlyReason: own?.readOnlyReason ?? null,
|
|
462
|
+
official: own?.official ?? null,
|
|
463
|
+
error: own?.error ?? null,
|
|
464
|
+
hint: detail ? `${blocked.hint}(DSH 判断:${detail})` : blocked.hint,
|
|
447
465
|
})
|
|
448
466
|
}
|
|
449
467
|
|