[fix] dsh-mail-sender is waiting for activation
This commit is contained in:
5 files changed
+37
-21
No files matched your search
Vendored
+5
@@ -9,4 +9,9 @@ export interface MailGatewayApi {
|
|||||||
testConnection(patch: MailboxPatch): Promise<RemoteResult<ConnectionTestResult>>;
|
testConnection(patch: MailboxPatch): Promise<RemoteResult<ConnectionTestResult>>;
|
||||||
status(): Promise<RemoteResult<MailStatus>>;
|
status(): Promise<RemoteResult<MailStatus>>;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 直接调用已挂载贡献的方法描述符,不经过 `ctx.remote['mail-gateway']`。
|
||||||
|
* 命名空间访问器要求调用方声明 `inject: ['remote.mail-gateway']`,而该服务只在
|
||||||
|
* `$mount` 之后才存在,声明它会形成等待依赖的死锁。
|
||||||
|
*/
|
||||||
export declare function createApi(ctx: Context): MailGatewayApi;
|
export declare function createApi(ctx: Context): MailGatewayApi;
|
||||||
+12
-6
@@ -1,10 +1,16 @@
|
|||||||
|
import TYPERT_REMOTE from '../remote.js';
|
||||||
|
/**
|
||||||
|
* 直接调用已挂载贡献的方法描述符,不经过 `ctx.remote['mail-gateway']`。
|
||||||
|
* 命名空间访问器要求调用方声明 `inject: ['remote.mail-gateway']`,而该服务只在
|
||||||
|
* `$mount` 之后才存在,声明它会形成等待依赖的死锁。
|
||||||
|
*/
|
||||||
export function createApi(ctx) {
|
export function createApi(ctx) {
|
||||||
const remote = ctx.remote['mail-gateway'];
|
const methods = TYPERT_REMOTE.methods;
|
||||||
return {
|
return {
|
||||||
get: () => remote.get(),
|
get: () => methods['mail-gateway/get'].invoke(ctx.remote, {}),
|
||||||
saveMailbox: patch => remote.saveMailbox(patch),
|
saveMailbox: patch => methods['mail-gateway/saveMailbox'].invoke(ctx.remote, { patch }),
|
||||||
saveWhitelist: addresses => remote.saveWhitelist(addresses),
|
saveWhitelist: addresses => methods['mail-gateway/saveWhitelist'].invoke(ctx.remote, { addresses }),
|
||||||
testConnection: patch => remote.testConnection(patch),
|
testConnection: patch => methods['mail-gateway/testConnection'].invoke(ctx.remote, { patch }),
|
||||||
status: () => remote.status(),
|
status: () => methods['mail-gateway/status'].invoke(ctx.remote, {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
+7
-7
@@ -19984,13 +19984,13 @@ var remote_default = TYPERT_REMOTE;
|
|||||||
|
|
||||||
// src/client/api.ts
|
// src/client/api.ts
|
||||||
function createApi(ctx) {
|
function createApi(ctx) {
|
||||||
const remote = ctx.remote["mail-gateway"];
|
const methods = remote_default.methods;
|
||||||
return {
|
return {
|
||||||
get: () => remote.get(),
|
get: () => methods["mail-gateway/get"].invoke(ctx.remote, {}),
|
||||||
saveMailbox: (patch) => remote.saveMailbox(patch),
|
saveMailbox: (patch) => methods["mail-gateway/saveMailbox"].invoke(ctx.remote, { patch }),
|
||||||
saveWhitelist: (addresses) => remote.saveWhitelist(addresses),
|
saveWhitelist: (addresses) => methods["mail-gateway/saveWhitelist"].invoke(ctx.remote, { addresses }),
|
||||||
testConnection: (patch) => remote.testConnection(patch),
|
testConnection: (patch) => methods["mail-gateway/testConnection"].invoke(ctx.remote, { patch }),
|
||||||
status: () => remote.status()
|
status: () => methods["mail-gateway/status"].invoke(ctx.remote, {})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20284,7 +20284,7 @@ function MailGatewaySection({ api }) {
|
|||||||
|
|
||||||
// src/client/index.ts
|
// src/client/index.ts
|
||||||
var name = "dsh-mail-sender";
|
var name = "dsh-mail-sender";
|
||||||
var inject = ["slots", "remote", "remote.mail-gateway"];
|
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);
|
const api = createApi(ctx);
|
||||||
|
|||||||
+12
-7
@@ -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 type {} from '../remote.js'
|
import TYPERT_REMOTE from '../remote.js'
|
||||||
import type {
|
import type {
|
||||||
ConnectionTestResult,
|
ConnectionTestResult,
|
||||||
MailSnapshot,
|
MailSnapshot,
|
||||||
@@ -18,13 +18,18 @@ export interface MailGatewayApi {
|
|||||||
status(): Promise<RemoteResult<MailStatus>>
|
status(): Promise<RemoteResult<MailStatus>>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接调用已挂载贡献的方法描述符,不经过 `ctx.remote['mail-gateway']`。
|
||||||
|
* 命名空间访问器要求调用方声明 `inject: ['remote.mail-gateway']`,而该服务只在
|
||||||
|
* `$mount` 之后才存在,声明它会形成等待依赖的死锁。
|
||||||
|
*/
|
||||||
export function createApi(ctx: Context): MailGatewayApi {
|
export function createApi(ctx: Context): MailGatewayApi {
|
||||||
const remote = ctx.remote['mail-gateway']
|
const methods = TYPERT_REMOTE.methods
|
||||||
return {
|
return {
|
||||||
get: () => remote.get(),
|
get: () => methods['mail-gateway/get'].invoke(ctx.remote, {}),
|
||||||
saveMailbox: patch => remote.saveMailbox(patch),
|
saveMailbox: patch => methods['mail-gateway/saveMailbox'].invoke(ctx.remote, { patch }),
|
||||||
saveWhitelist: addresses => remote.saveWhitelist(addresses),
|
saveWhitelist: addresses => methods['mail-gateway/saveWhitelist'].invoke(ctx.remote, { addresses }),
|
||||||
testConnection: patch => remote.testConnection(patch),
|
testConnection: patch => methods['mail-gateway/testConnection'].invoke(ctx.remote, { patch }),
|
||||||
status: () => remote.status(),
|
status: () => methods['mail-gateway/status'].invoke(ctx.remote, {}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -8,7 +8,7 @@ import { createApi } from './api.js'
|
|||||||
import { MailGatewaySection } from './MailGatewaySection.js'
|
import { MailGatewaySection } from './MailGatewaySection.js'
|
||||||
|
|
||||||
export const name = 'dsh-mail-sender'
|
export const name = 'dsh-mail-sender'
|
||||||
export const inject = ['slots', 'remote', 'remote.mail-gateway']
|
export const inject = ['slots', 'remote']
|
||||||
|
|
||||||
/** 挂载本插件的 Remote 命名空间,并在设置页注册“邮件网关”分区。 */
|
/** 挂载本插件的 Remote 命名空间,并在设置页注册“邮件网关”分区。 */
|
||||||
export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
||||||
|
|||||||
Reference in new issue
Block a user