[fix] white config
This commit is contained in:
6 files changed
+71
-64
No files matched your search
Vendored
+1
-5
@@ -9,9 +9,5 @@ export interface MailGatewayApi {
|
||||
testConnection(patch: MailboxPatch): Promise<RemoteResult<ConnectionTestResult>>;
|
||||
status(): Promise<RemoteResult<MailStatus>>;
|
||||
}
|
||||
/**
|
||||
* 直接调用已挂载贡献的方法描述符,不经过 `ctx.remote['mail-gateway']`。
|
||||
* 命名空间访问器要求调用方声明 `inject: ['remote.mail-gateway']`,而该服务只在
|
||||
* `$mount` 之后才存在,声明它会形成等待依赖的死锁。
|
||||
*/
|
||||
/** 调用方必须已声明 `inject: ['remote.mail-gateway']`,见 client/index.ts 的子插件。 */
|
||||
export declare function createApi(ctx: Context): MailGatewayApi;
|
||||
+7
-12
@@ -1,16 +1,11 @@
|
||||
import TYPERT_REMOTE from '../remote.js';
|
||||
/**
|
||||
* 直接调用已挂载贡献的方法描述符,不经过 `ctx.remote['mail-gateway']`。
|
||||
* 命名空间访问器要求调用方声明 `inject: ['remote.mail-gateway']`,而该服务只在
|
||||
* `$mount` 之后才存在,声明它会形成等待依赖的死锁。
|
||||
*/
|
||||
/** 调用方必须已声明 `inject: ['remote.mail-gateway']`,见 client/index.ts 的子插件。 */
|
||||
export function createApi(ctx) {
|
||||
const methods = TYPERT_REMOTE.methods;
|
||||
const remote = ctx.remote['mail-gateway'];
|
||||
return {
|
||||
get: () => methods['mail-gateway/get'].invoke(ctx.remote, {}),
|
||||
saveMailbox: patch => methods['mail-gateway/saveMailbox'].invoke(ctx.remote, { patch }),
|
||||
saveWhitelist: addresses => methods['mail-gateway/saveWhitelist'].invoke(ctx.remote, { addresses }),
|
||||
testConnection: patch => methods['mail-gateway/testConnection'].invoke(ctx.remote, { patch }),
|
||||
status: () => methods['mail-gateway/status'].invoke(ctx.remote, {}),
|
||||
get: () => remote.get(),
|
||||
saveMailbox: patch => remote.saveMailbox(patch),
|
||||
saveWhitelist: addresses => remote.saveWhitelist(addresses),
|
||||
testConnection: patch => remote.testConnection(patch),
|
||||
status: () => remote.status(),
|
||||
};
|
||||
}
|
||||
Vendored
+5
-1
@@ -1,5 +1,9 @@
|
||||
import type { Context } from '@deepseek-ai/cordis';
|
||||
export declare const name = "dsh-mail-sender";
|
||||
export declare const inject: string[];
|
||||
/** 挂载本插件的 Remote 命名空间,并在设置页注册“邮件网关”分区。 */
|
||||
/**
|
||||
* 先挂载本插件的 Remote 命名空间,再交给一个声明了 `remote.mail-gateway` 的子插件
|
||||
* 注册设置页分区。命名空间服务由 `$mount` 提供,若在同一个 fiber 的 `inject` 里声明
|
||||
* 它会因为“依赖自己提供”而永久等待激活。
|
||||
*/
|
||||
export declare function apply(ctx: Context): Promise<() => Promise<void>>;
|
||||
+26
-20
@@ -19984,13 +19984,13 @@ var remote_default = TYPERT_REMOTE;
|
||||
|
||||
// src/client/api.ts
|
||||
function createApi(ctx) {
|
||||
const methods = remote_default.methods;
|
||||
const remote = ctx.remote["mail-gateway"];
|
||||
return {
|
||||
get: () => methods["mail-gateway/get"].invoke(ctx.remote, {}),
|
||||
saveMailbox: (patch) => methods["mail-gateway/saveMailbox"].invoke(ctx.remote, { patch }),
|
||||
saveWhitelist: (addresses) => methods["mail-gateway/saveWhitelist"].invoke(ctx.remote, { addresses }),
|
||||
testConnection: (patch) => methods["mail-gateway/testConnection"].invoke(ctx.remote, { patch }),
|
||||
status: () => methods["mail-gateway/status"].invoke(ctx.remote, {})
|
||||
get: () => remote.get(),
|
||||
saveMailbox: (patch) => remote.saveMailbox(patch),
|
||||
saveWhitelist: (addresses) => remote.saveWhitelist(addresses),
|
||||
testConnection: (patch) => remote.testConnection(patch),
|
||||
status: () => remote.status()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20287,20 +20287,26 @@ var name = "dsh-mail-sender";
|
||||
var inject = ["slots", "remote"];
|
||||
async function apply(ctx) {
|
||||
const disposeRemote = await ctx.remote.$mount(remote_default);
|
||||
const api = createApi(ctx);
|
||||
ctx.slots.inject(
|
||||
"settings.section",
|
||||
() => ctx.slots.register(
|
||||
{
|
||||
name: "settings.section",
|
||||
id: "mail-gateway",
|
||||
order: 120,
|
||||
label: () => "\u90AE\u4EF6\u7F51\u5173",
|
||||
inject: () => ({ api })
|
||||
},
|
||||
MailGatewaySection
|
||||
)
|
||||
);
|
||||
ctx.plugin({
|
||||
name: "dsh-mail-sender/ui",
|
||||
inject: ["slots", "remote.mail-gateway"],
|
||||
apply(ui) {
|
||||
const api = createApi(ui);
|
||||
ui.slots.inject(
|
||||
"settings.section",
|
||||
() => ui.slots.register(
|
||||
{
|
||||
name: "settings.section",
|
||||
id: "mail-gateway",
|
||||
order: 120,
|
||||
label: () => "\u90AE\u4EF6\u7F51\u5173",
|
||||
inject: () => ({ api })
|
||||
},
|
||||
MailGatewaySection
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
return disposeRemote;
|
||||
}
|
||||
Object.defineProperty(module.exports,Symbol.toStringTag,{value:"Module"});return module.exports}});
|
||||
Reference in new issue
Block a user