[fix] white config
This commit is contained in:
6 files changed
+50
-43
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>>;
|
||||
+15
-9
@@ -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,10 +20287,14 @@ 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(
|
||||
ctx.plugin({
|
||||
name: "dsh-mail-sender/ui",
|
||||
inject: ["slots", "remote.mail-gateway"],
|
||||
apply(ui) {
|
||||
const api = createApi(ui);
|
||||
ui.slots.inject(
|
||||
"settings.section",
|
||||
() => ctx.slots.register(
|
||||
() => ui.slots.register(
|
||||
{
|
||||
name: "settings.section",
|
||||
id: "mail-gateway",
|
||||
@@ -20301,6 +20305,8 @@ async function apply(ctx) {
|
||||
MailGatewaySection
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
return disposeRemote;
|
||||
}
|
||||
Object.defineProperty(module.exports,Symbol.toStringTag,{value:"Module"});return module.exports}});
|
||||
+8
-12
@@ -1,7 +1,7 @@
|
||||
import type { Context } from '@deepseek-ai/cordis'
|
||||
import type {} from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import TYPERT_REMOTE from '../remote.js'
|
||||
import type {} from '../remote.js'
|
||||
import type {
|
||||
ConnectionTestResult,
|
||||
MailSnapshot,
|
||||
@@ -18,18 +18,14 @@ export interface MailGatewayApi {
|
||||
status(): Promise<RemoteResult<MailStatus>>
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接调用已挂载贡献的方法描述符,不经过 `ctx.remote['mail-gateway']`。
|
||||
* 命名空间访问器要求调用方声明 `inject: ['remote.mail-gateway']`,而该服务只在
|
||||
* `$mount` 之后才存在,声明它会形成等待依赖的死锁。
|
||||
*/
|
||||
/** 调用方必须已声明 `inject: ['remote.mail-gateway']`,见 client/index.ts 的子插件。 */
|
||||
export function createApi(ctx: Context): MailGatewayApi {
|
||||
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(),
|
||||
}
|
||||
}
|
||||
+14
-4
@@ -10,13 +10,21 @@ import { MailGatewaySection } from './MailGatewaySection.js'
|
||||
export const name = 'dsh-mail-sender'
|
||||
export const inject = ['slots', 'remote']
|
||||
|
||||
/** 挂载本插件的 Remote 命名空间,并在设置页注册“邮件网关”分区。 */
|
||||
/**
|
||||
* 先挂载本插件的 Remote 命名空间,再交给一个声明了 `remote.mail-gateway` 的子插件
|
||||
* 注册设置页分区。命名空间服务由 `$mount` 提供,若在同一个 fiber 的 `inject` 里声明
|
||||
* 它会因为“依赖自己提供”而永久等待激活。
|
||||
*/
|
||||
export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
||||
const disposeRemote = await ctx.remote.$mount(TYPERT_REMOTE)
|
||||
|
||||
const api = createApi(ctx)
|
||||
ctx.slots.inject('settings.section', () =>
|
||||
ctx.slots.register(
|
||||
ctx.plugin({
|
||||
name: 'dsh-mail-sender/ui',
|
||||
inject: ['slots', 'remote.mail-gateway'],
|
||||
apply(ui: Context): void {
|
||||
const api = createApi(ui)
|
||||
ui.slots.inject('settings.section', () =>
|
||||
ui.slots.register(
|
||||
{
|
||||
name: 'settings.section',
|
||||
id: 'mail-gateway',
|
||||
@@ -27,6 +35,8 @@ export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
||||
MailGatewaySection,
|
||||
),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
||||
return disposeRemote
|
||||
}
|
||||
Reference in new issue
Block a user