refactor(api): move 4 misc methods to MiscApi (#6 commit 10/13)

Inlines `actions/misc.ts` into `apis/misc.ts::MiscApi`. The Api holds
the methods that didn't naturally group into any other area:
translation, mini-app ARK card builder, inline-keyboard callback,
group sign-in.

No renaming — these names are already descriptive at the call site
under `apis.misc.X`.

Callers updated: `actions/extended.ts` (4 sites).
Tests rewritten to use `new MiscApi(bridge as any).method(...)`.

587/587 tests pass.
This commit is contained in:
DrSmoothl committed 2026-05-20 23:35:37 +08:00
1 parent d953b9824c
commit e5ac2a61b1
7 files changed
+168 -188

No files matched your search

+4 -4
View File
@@ -975,7 +975,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
try {
const translated = await ctx.bridge.translateEn2Zh(words);
const translated = await ctx.bridge.apis.misc.translateEn2Zh(words);
return okResponse({ words: translated });
} catch (e) {
return failedResponse(RETCODE.ACTION_FAILED, String(e));
@@ -999,7 +999,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
try {
const data = await ctx.bridge.getMiniAppArk(
const data = await ctx.bridge.apis.misc.getMiniAppArk(
String(type),
String(title),
String(desc),
@@ -1025,7 +1025,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
try {
const data = await ctx.bridge.clickInlineKeyboardButton(
const data = await ctx.bridge.apis.misc.clickInlineKeyboardButton(
groupId,
botAppid,
String(buttonId),
@@ -1047,7 +1047,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
try {
await ctx.bridge.sendGroupSign(groupId);
await ctx.bridge.apis.misc.sendGroupSign(groupId);
return okResponse({});
} catch (e) {
return failedResponse(RETCODE.ACTION_FAILED, String(e));