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