nx-kv 0.48.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/src/modules/auth/actions/auth-login.ts +3 -3
- package/src/modules/auth/actions/auth-logout.ts +3 -3
- package/src/modules/auth/actions/auth-me.ts +3 -3
- package/src/modules/auth/actions/auth-status.ts +3 -3
- package/src/modules/bundled/actions/bundled-get.ts +3 -3
- package/src/modules/bundled/actions/bundled-groups.ts +3 -3
- package/src/modules/bundled/actions/bundled-install.ts +3 -3
- package/src/modules/bundled/actions/bundled-list.ts +3 -3
- package/src/modules/db/actions/db-backup.ts +3 -3
- package/src/modules/db/actions/db-migrate.ts +3 -3
- package/src/modules/db/actions/db-status.ts +3 -3
- package/src/modules/db/actions/db-verify.ts +3 -3
- package/src/modules/docs/actions/doc-add.ts +3 -3
- package/src/modules/docs/actions/doc-attach-note.ts +3 -3
- package/src/modules/docs/actions/doc-attach.ts +3 -3
- package/src/modules/docs/actions/doc-attachments.ts +3 -3
- package/src/modules/docs/actions/doc-detach.ts +3 -3
- package/src/modules/docs/actions/doc-get.ts +3 -3
- package/src/modules/docs/actions/doc-list.ts +3 -3
- package/src/modules/docs/actions/doc-remove.ts +3 -3
- package/src/modules/docs/actions/doc-update.ts +3 -3
- package/src/modules/docs/actions/docs-bind.ts +3 -3
- package/src/modules/docs/actions/docs-index.ts +3 -3
- package/src/modules/docs/actions/docs-link.ts +3 -3
- package/src/modules/docs/actions/docs-notebind.ts +3 -3
- package/src/modules/docs/actions/docs-seed.ts +3 -3
- package/src/modules/file/actions/file-content.ts +9 -7
- package/src/modules/file/actions/file-get.ts +3 -3
- package/src/modules/file/actions/file-list.ts +3 -3
- package/src/modules/file/actions/file-orphans.ts +3 -3
- package/src/modules/file/actions/file-prune.ts +3 -3
- package/src/modules/file/actions/file-remove.ts +3 -3
- package/src/modules/file/actions/file-sync.ts +3 -3
- package/src/modules/file/actions/file-upload.ts +3 -3
- package/src/modules/localtask/actions/localtask-add.ts +3 -3
- package/src/modules/localtask/actions/localtask-attach-note.ts +3 -3
- package/src/modules/localtask/actions/localtask-attach.ts +3 -3
- package/src/modules/localtask/actions/localtask-attachments.ts +3 -3
- package/src/modules/localtask/actions/localtask-cancel.ts +3 -3
- package/src/modules/localtask/actions/localtask-cancelMany.ts +3 -3
- package/src/modules/localtask/actions/localtask-chain.ts +3 -3
- package/src/modules/localtask/actions/localtask-claim.ts +3 -3
- package/src/modules/localtask/actions/localtask-clone.ts +3 -3
- package/src/modules/localtask/actions/localtask-closeMany.ts +3 -3
- package/src/modules/localtask/actions/localtask-config.ts +5 -5
- package/src/modules/localtask/actions/localtask-detach.ts +3 -3
- package/src/modules/localtask/actions/localtask-done.ts +3 -3
- package/src/modules/localtask/actions/localtask-events.ts +8 -6
- package/src/modules/localtask/actions/localtask-fork.ts +3 -3
- package/src/modules/localtask/actions/localtask-get.ts +3 -3
- package/src/modules/localtask/actions/localtask-importRemote.ts +8 -6
- package/src/modules/localtask/actions/localtask-list.ts +3 -3
- package/src/modules/localtask/actions/localtask-presence.ts +3 -3
- package/src/modules/localtask/actions/localtask-preview.ts +3 -3
- package/src/modules/localtask/actions/localtask-prune.ts +3 -3
- package/src/modules/localtask/actions/localtask-remove.ts +3 -3
- package/src/modules/localtask/actions/localtask-removeMany.ts +3 -3
- package/src/modules/localtask/actions/localtask-reopen.ts +6 -4
- package/src/modules/localtask/actions/localtask-reorder.ts +3 -3
- package/src/modules/localtask/actions/localtask-task-restore.ts +3 -3
- package/src/modules/localtask/actions/localtask-timegoalLog.ts +3 -3
- package/src/modules/localtask/actions/localtask-topic-add.ts +3 -3
- package/src/modules/localtask/actions/localtask-topic-remove.ts +3 -3
- package/src/modules/localtask/actions/localtask-topic-removeMany.ts +3 -3
- package/src/modules/localtask/actions/localtask-update.ts +3 -3
- package/src/modules/localtask/actions/localtask-wait.ts +3 -3
- package/src/modules/localtask/actions/task-move.ts +3 -3
- package/src/modules/repos/actions/board-add.ts +3 -3
- package/src/modules/repos/actions/board-assign.ts +3 -3
- package/src/modules/repos/actions/board-export.ts +3 -3
- package/src/modules/repos/actions/board-get.ts +3 -3
- package/src/modules/repos/actions/board-import.ts +9 -4
- package/src/modules/repos/actions/board-list.ts +3 -3
- package/src/modules/repos/actions/board-note.ts +3 -3
- package/src/modules/repos/actions/board-prefix.ts +3 -3
- package/src/modules/repos/actions/board-prune.ts +3 -3
- package/src/modules/repos/actions/board-rekey.ts +3 -3
- package/src/modules/repos/actions/board-remove.ts +3 -3
- package/src/modules/repos/actions/board-update.ts +3 -3
- package/src/modules/repos/actions/repo-add.ts +3 -3
- package/src/modules/repos/actions/repo-bind-topics.ts +3 -3
- package/src/modules/repos/actions/repo-bind.ts +3 -3
- package/src/modules/repos/actions/repo-clone.ts +3 -3
- package/src/modules/repos/actions/repo-detect.ts +3 -3
- package/src/modules/repos/actions/repo-doc-add.ts +3 -3
- package/src/modules/repos/actions/repo-doc-list.ts +3 -3
- package/src/modules/repos/actions/repo-doc-remove.ts +3 -3
- package/src/modules/repos/actions/repo-export.ts +3 -3
- package/src/modules/repos/actions/repo-get.ts +3 -3
- package/src/modules/repos/actions/repo-import-diff.ts +3 -3
- package/src/modules/repos/actions/repo-import.ts +3 -3
- package/src/modules/repos/actions/repo-key-migrate.ts +3 -3
- package/src/modules/repos/actions/repo-key-refresh.ts +3 -3
- package/src/modules/repos/actions/repo-key-set.ts +3 -3
- package/src/modules/repos/actions/repo-knowledge.ts +3 -3
- package/src/modules/repos/actions/repo-list.ts +3 -3
- package/src/modules/repos/actions/repo-open.ts +3 -3
- package/src/modules/repos/actions/repo-ref-add.ts +3 -3
- package/src/modules/repos/actions/repo-ref-backfill.ts +3 -3
- package/src/modules/repos/actions/repo-ref-check.ts +3 -3
- package/src/modules/repos/actions/repo-ref-clone.ts +3 -3
- package/src/modules/repos/actions/repo-ref-note.ts +3 -3
- package/src/modules/repos/actions/repo-ref-of.ts +3 -3
- package/src/modules/repos/actions/repo-ref-sync.ts +3 -3
- package/src/modules/repos/actions/repo-remote-check.ts +3 -3
- package/src/modules/repos/actions/repo-remote-list.ts +3 -3
- package/src/modules/repos/actions/repo-remote-pick.ts +3 -3
- package/src/modules/repos/actions/repo-remote.ts +3 -3
- package/src/modules/repos/actions/repo-remove.ts +3 -3
- package/src/modules/repos/actions/repo-scan.ts +3 -3
- package/src/modules/repos/actions/repo-update.ts +3 -3
- package/src/modules/setting/actions/setting-get.ts +3 -3
- package/src/modules/setting/actions/setting-set.ts +3 -3
- package/src/modules/system/actions/bootstrap.ts +3 -4
- package/src/modules/system/actions/health.ts +3 -4
- package/src/modules/system/actions/routes.ts +3 -4
- package/src/modules/system/schemas.ts +2 -1
- package/src/modules/tasktool/actions/timegoal-check.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-clear.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-list.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-log.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-prune.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-set.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-show.ts +3 -3
- package/src/modules/tasktool/actions/timegoal-update.ts +3 -3
- package/src/modules/templates/actions/templates-add.ts +3 -3
- package/src/modules/templates/actions/templates-default.ts +3 -3
- package/src/modules/templates/actions/templates-list.ts +3 -3
- package/src/modules/templates/actions/templates-remove.ts +3 -3
- package/src/modules/templates/actions/templates-update.ts +3 -3
- package/src/modules/todo/actions/group-add.ts +3 -3
- package/src/modules/todo/actions/group-current.ts +3 -3
- package/src/modules/todo/actions/group-get.ts +3 -3
- package/src/modules/todo/actions/group-list.ts +3 -3
- package/src/modules/todo/actions/group-members.ts +3 -3
- package/src/modules/todo/actions/group-remove.ts +3 -3
- package/src/modules/todo/actions/group-update.ts +3 -3
- package/src/modules/todo/actions/group-use.ts +3 -3
- package/src/modules/todo/actions/prompt-get.ts +3 -3
- package/src/modules/todo/actions/prompt-remove.ts +3 -3
- package/src/modules/todo/actions/prompt-set.ts +3 -3
- package/src/modules/todo/actions/todo-add.ts +3 -3
- package/src/modules/todo/actions/todo-archive.ts +3 -3
- package/src/modules/todo/actions/todo-attach.ts +3 -3
- package/src/modules/todo/actions/todo-attachments.ts +3 -3
- package/src/modules/todo/actions/todo-done.ts +3 -3
- package/src/modules/todo/actions/todo-freeze.ts +3 -3
- package/src/modules/todo/actions/todo-get.ts +3 -3
- package/src/modules/todo/actions/todo-list.ts +3 -3
- package/src/modules/todo/actions/todo-remove.ts +3 -3
- package/src/modules/todo/actions/todo-unfreeze.ts +3 -3
- package/src/modules/todo/actions/todo-update.ts +3 -3
- package/src/modules/todo/actions/topic-add.ts +3 -3
- package/src/modules/todo/actions/topic-list.ts +3 -3
- package/src/modules/todo/actions/topic-remove.ts +3 -3
- package/src/runtime/action-base.ts +41 -1
- package/src/runtime/action-decorator.ts +26 -11
- package/src/web/frontend/api/client.generated.ts +294 -294
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录对外可见的变更。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)。
|
|
4
4
|
|
|
5
|
+
## [0.48.1] - 2026-11-11 action 入参泛型化(#177 第 3 轮)
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **action 入参类型走基类泛型模板**:`ActionBase<TInput>` 绑定 schema,
|
|
10
|
+
handler 统一写 `override run(ctx: ActionInput<this['_input']>)`——入参类型由类上的
|
|
11
|
+
类型实参推导,**schema 只声明一次**,154 个 action 文件不再手写 `z.output<typeof …>`、
|
|
12
|
+
也不再落 `ctx: any`(迁移器生成的那 151 条全部清掉)。
|
|
13
|
+
- **方法名统一为 `run`**(原按动作语义各叫各的):`@action` 装饰器只收元数据,
|
|
14
|
+
运行期分派本来就是走 run 闭包,方法名不外泄(`client.generated.ts` 的类型锚点
|
|
15
|
+
随之从 `['get']` 之类改为 `['run']`,重新 `pnpm gen` 即可)。
|
|
16
|
+
- **类型化顺带抓出 6 处「读未声明键」的死路径**(zod 会剥掉未声明键,这些读取恒为
|
|
17
|
+
undefined):`localtask.config` 的 camel 读法、`localtask.importRemote` 的 `refs`、
|
|
18
|
+
`localtask.reopen` 的 `attachments`、`board.import` 的 `json`。
|
|
19
|
+
**本次只保证运行期行为不变**(收敛到 kebab 或局部 cast + 注释);是否给 schema
|
|
20
|
+
补键以复活这些路径,留给后续裁决。
|
|
21
|
+
|
|
22
|
+
### Notes
|
|
23
|
+
|
|
24
|
+
- 本轮为纯类型层重构,对外行为不变(smoke 194 / unit 906 全绿)。
|
|
25
|
+
- 已知约束:TS 对类成员声明没有上下文类型注入通路(override 与装饰器都试过),
|
|
26
|
+
因此注解必须存在——但它是全项目统一样板,不再重述 schema 结构。
|
|
27
|
+
|
|
5
28
|
## [0.48.0] - 2026-11-11 全仓 TypeScript 毕业(#175)
|
|
6
29
|
|
|
7
30
|
### Changed
|
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { authLoginInput } from '../schemas.js';
|
|
7
7
|
import { configPathFromEnv as _configPathFromEnv } from '../../../core/config.js';
|
|
8
8
|
import { doLogin } from '../support.js';
|
|
9
9
|
const configPathFromEnv: any = _configPathFromEnv;
|
|
10
10
|
|
|
11
|
-
export class AuthLoginAction extends ActionBase {
|
|
11
|
+
export class AuthLoginAction extends ActionBase<typeof authLoginInput> {
|
|
12
12
|
@action({
|
|
13
13
|
id: 'auth.login',
|
|
14
14
|
cli: ['auth', 'login'],
|
|
@@ -18,7 +18,7 @@ export class AuthLoginAction extends ActionBase {
|
|
|
18
18
|
input: authLoginInput,
|
|
19
19
|
render: (d: any) => `已登录: ${d.email}(userId=${d.userId})\n配置: ${configPathFromEnv()}`,
|
|
20
20
|
})
|
|
21
|
-
async
|
|
21
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
22
22
|
return doLogin(ctx);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { authLogoutInput } from '../schemas.js';
|
|
7
7
|
import { loadConfig as _loadConfig, saveConfig as _saveConfig } from '../../../core/config.js';
|
|
8
8
|
const loadConfig: any = _loadConfig;
|
|
9
9
|
const saveConfig: any = _saveConfig;
|
|
10
10
|
|
|
11
|
-
export class AuthLogoutAction extends ActionBase {
|
|
11
|
+
export class AuthLogoutAction extends ActionBase<typeof authLogoutInput> {
|
|
12
12
|
@action({
|
|
13
13
|
id: 'auth.logout',
|
|
14
14
|
cli: ['auth', 'logout'],
|
|
@@ -17,7 +17,7 @@ export class AuthLogoutAction extends ActionBase {
|
|
|
17
17
|
input: authLogoutInput,
|
|
18
18
|
render: (d: any) => (d.was ? `已登出(原账号 ${d.was})` : '本就未登录'),
|
|
19
19
|
})
|
|
20
|
-
async
|
|
20
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
21
21
|
|
|
22
22
|
const before: any = await loadConfig();
|
|
23
23
|
// 只清登录态,保留 baseUrl 与当前工作空间选择
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { authMeInput } from '../schemas.js';
|
|
7
7
|
import { requireAuth as _requireAuth } from '../../../core/config.js';
|
|
8
8
|
import { userInfo as _userInfo } from '../../../core/kvapi.js';
|
|
9
9
|
const requireAuth: any = _requireAuth;
|
|
10
10
|
const userInfo: any = _userInfo;
|
|
11
11
|
|
|
12
|
-
export class AuthMeAction extends ActionBase {
|
|
12
|
+
export class AuthMeAction extends ActionBase<typeof authMeInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'auth.me',
|
|
15
15
|
cli: ['auth', 'me'],
|
|
@@ -18,7 +18,7 @@ export class AuthMeAction extends ActionBase {
|
|
|
18
18
|
input: authMeInput,
|
|
19
19
|
render: (d: any) => JSON.stringify(d, null, 2),
|
|
20
20
|
})
|
|
21
|
-
async
|
|
21
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
22
22
|
|
|
23
23
|
await requireAuth();
|
|
24
24
|
const info: any = await userInfo();
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { authStatusInput } from '../schemas.js';
|
|
7
7
|
import { loadConfig as _loadConfig, configPathFromEnv as _configPathFromEnv } from '../../../core/config.js';
|
|
8
8
|
const loadConfig: any = _loadConfig;
|
|
9
9
|
const configPathFromEnv: any = _configPathFromEnv;
|
|
10
10
|
|
|
11
|
-
export class AuthStatusAction extends ActionBase {
|
|
11
|
+
export class AuthStatusAction extends ActionBase<typeof authStatusInput> {
|
|
12
12
|
@action({
|
|
13
13
|
id: 'auth.status',
|
|
14
14
|
cli: ['auth', 'status'],
|
|
@@ -20,7 +20,7 @@ export class AuthStatusAction extends ActionBase {
|
|
|
20
20
|
? `已登录: ${d.email}(userId=${d.userId})\n后端: ${d.baseUrl}\n工作空间: ${d.groupId > 0 ? d.groupId : '默认组'}`
|
|
21
21
|
: `未登录(nx-kv auth login <email>)\n后端: ${d.baseUrl}`,
|
|
22
22
|
})
|
|
23
|
-
async
|
|
23
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
24
24
|
|
|
25
25
|
const cfg: any = await loadConfig();
|
|
26
26
|
return {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { bundledGetInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
import { exclusive, renderContent } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
export class BundledGetAction extends ActionBase {
|
|
11
|
+
export class BundledGetAction extends ActionBase<typeof bundledGetInput> {
|
|
12
12
|
@action({
|
|
13
13
|
id: 'bundled.get',
|
|
14
14
|
cli: ['skill', 'get'],
|
|
@@ -20,7 +20,7 @@ export class BundledGetAction extends ActionBase {
|
|
|
20
20
|
? d.skills.map(renderContent).join('\n\n' + '─'.repeat(60) + '\n\n')
|
|
21
21
|
: renderContent(d)),
|
|
22
22
|
})
|
|
23
|
-
async
|
|
23
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
24
24
|
|
|
25
25
|
exclusive(ctx, 'skill get');
|
|
26
26
|
return service.bundledSkillContent({ name: ctx.name, group: ctx.group, ref: ctx.ref, to: ctx.to });
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { bundledGroupsInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
export class BundledGroupsAction extends ActionBase {
|
|
10
|
+
export class BundledGroupsAction extends ActionBase<typeof bundledGroupsInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'bundled.groups',
|
|
13
13
|
cli: [['skill', 'groups'], ['bundled', 'groups']],
|
|
@@ -25,7 +25,7 @@ export class BundledGroupsAction extends ActionBase {
|
|
|
25
25
|
return lines.join('\n');
|
|
26
26
|
},
|
|
27
27
|
})
|
|
28
|
-
async
|
|
28
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
29
29
|
|
|
30
30
|
return service.groupsInfo();
|
|
31
31
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { bundledInstallInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
import { exclusive, renderScoped } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
export class BundledInstallAction extends ActionBase {
|
|
11
|
+
export class BundledInstallAction extends ActionBase<typeof bundledInstallInput> {
|
|
12
12
|
@action({
|
|
13
13
|
id: 'bundled.install',
|
|
14
14
|
cli: ['skill', 'install'],
|
|
@@ -28,7 +28,7 @@ export class BundledInstallAction extends ActionBase {
|
|
|
28
28
|
return `${d.replaced ? '已更新' : '已安装'} ${d.name}(${d.files} 个文件)-> ${d.path}`;
|
|
29
29
|
},
|
|
30
30
|
})
|
|
31
|
-
async
|
|
31
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
32
32
|
|
|
33
33
|
exclusive(ctx, 'skill install');
|
|
34
34
|
return service.installBundledSkill({
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput, type ActionRunMeta } from '../../../runtime/action-base.js';
|
|
6
6
|
import { bundledListInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
import { renderList } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
export class BundledListAction extends ActionBase {
|
|
11
|
+
export class BundledListAction extends ActionBase<typeof bundledListInput> {
|
|
12
12
|
@action({
|
|
13
13
|
id: 'bundled.list',
|
|
14
14
|
cli: [['skill', 'list'], ['skill', 'install', '--list'], ['bundled', 'list']],
|
|
@@ -17,7 +17,7 @@ export class BundledListAction extends ActionBase {
|
|
|
17
17
|
input: bundledListInput,
|
|
18
18
|
render: renderList,
|
|
19
19
|
})
|
|
20
|
-
async
|
|
20
|
+
override async run(__ctx: ActionInput<this['_input']>, meta: ActionRunMeta = {}) {
|
|
21
21
|
|
|
22
22
|
const info: any = await service.groupsInfo();
|
|
23
23
|
if (meta.transport !== 'http') return info;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { dbBackupInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
export class DbBackupAction extends ActionBase {
|
|
10
|
+
export class DbBackupAction extends ActionBase<typeof dbBackupInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'db.backup',
|
|
13
13
|
cli: ['db', 'backup'],
|
|
@@ -16,7 +16,7 @@ export class DbBackupAction extends ActionBase {
|
|
|
16
16
|
input: dbBackupInput,
|
|
17
17
|
render: (d: any) => service.renderBackup(d),
|
|
18
18
|
})
|
|
19
|
-
async
|
|
19
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
20
20
|
|
|
21
21
|
return service.backup({ dir: ctx.dir, keep: ctx.keep });
|
|
22
22
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { dbMigrateInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
export class DbMigrateAction extends ActionBase {
|
|
10
|
+
export class DbMigrateAction extends ActionBase<typeof dbMigrateInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'db.migrate',
|
|
13
13
|
cli: ['db', 'migrate'],
|
|
@@ -16,7 +16,7 @@ export class DbMigrateAction extends ActionBase {
|
|
|
16
16
|
input: dbMigrateInput,
|
|
17
17
|
render: (d: any) => service.renderMigrate(d),
|
|
18
18
|
})
|
|
19
|
-
async
|
|
19
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
20
20
|
|
|
21
21
|
return service.migrate({ dryRun: ctx['dry-run'] === true, apply: ctx.apply === true });
|
|
22
22
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { dbStatusInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
export class DbStatusAction extends ActionBase {
|
|
10
|
+
export class DbStatusAction extends ActionBase<typeof dbStatusInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'db.status',
|
|
13
13
|
cli: ['db', 'status'],
|
|
@@ -16,7 +16,7 @@ export class DbStatusAction extends ActionBase {
|
|
|
16
16
|
input: dbStatusInput,
|
|
17
17
|
render: (d: any) => service.renderStatus(d),
|
|
18
18
|
})
|
|
19
|
-
async
|
|
19
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
20
20
|
|
|
21
21
|
return service.status();
|
|
22
22
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { dbVerifyInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
export class DbVerifyAction extends ActionBase {
|
|
10
|
+
export class DbVerifyAction extends ActionBase<typeof dbVerifyInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'db.verify',
|
|
13
13
|
cli: ['db', 'verify'],
|
|
@@ -16,7 +16,7 @@ export class DbVerifyAction extends ActionBase {
|
|
|
16
16
|
input: dbVerifyInput,
|
|
17
17
|
render: (d: any) => service.renderVerify(d),
|
|
18
18
|
})
|
|
19
|
-
async
|
|
19
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
20
20
|
|
|
21
21
|
return service.verify();
|
|
22
22
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput, type ActionRunMeta } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docAddInput } from '../schemas.js';
|
|
7
7
|
import { addDoc as _addDoc } from '../service.js';
|
|
8
8
|
import { renderWritten as _renderWritten } from '../render.js';
|
|
9
9
|
const addDoc: any = _addDoc;
|
|
10
10
|
const renderWritten: any = _renderWritten;
|
|
11
11
|
|
|
12
|
-
export class DocAddAction extends ActionBase {
|
|
12
|
+
export class DocAddAction extends ActionBase<typeof docAddInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.add',
|
|
15
15
|
cli: ['docs', 'add'],
|
|
@@ -19,7 +19,7 @@ export class DocAddAction extends ActionBase {
|
|
|
19
19
|
input: docAddInput,
|
|
20
20
|
render: renderWritten,
|
|
21
21
|
})
|
|
22
|
-
async
|
|
22
|
+
override async run(ctx: ActionInput<this['_input']>, opts: ActionRunMeta = {}) {
|
|
23
23
|
|
|
24
24
|
return addDoc(
|
|
25
25
|
{ rel: ctx.rel, body: ctx.body, bodyFile: opts && opts.transport === 'http' ? undefined : (ctx.bodyFile ?? ctx['body-file']) },
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docAttachNoteInput } from '../schemas.js';
|
|
7
7
|
import { noteOnDoc as _noteOnDoc } from '../attach.js';
|
|
8
8
|
const noteOnDoc: any = _noteOnDoc;
|
|
9
9
|
|
|
10
|
-
export class DocAttachNoteAction extends ActionBase {
|
|
10
|
+
export class DocAttachNoteAction extends ActionBase<typeof docAttachNoteInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'doc.attach-note',
|
|
13
13
|
cli: ['docs', 'attach-note'],
|
|
@@ -17,7 +17,7 @@ export class DocAttachNoteAction extends ActionBase {
|
|
|
17
17
|
input: docAttachNoteInput,
|
|
18
18
|
render: (d: any) => `已更新 ${d.attachment} 的说明:${d.note || '(清空)'}`,
|
|
19
19
|
})
|
|
20
|
-
async
|
|
20
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
21
21
|
|
|
22
22
|
return noteOnDoc({ ref: ctx.ref, attachment: ctx.attachment, note: ctx.note });
|
|
23
23
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docAttachInput } from '../schemas.js';
|
|
7
7
|
import { attachToDoc as _attachToDoc } from '../attach.js';
|
|
8
8
|
import { renderAttach as _renderAttach } from '../render.js';
|
|
9
9
|
const attachToDoc: any = _attachToDoc;
|
|
10
10
|
const renderAttach: any = _renderAttach;
|
|
11
11
|
|
|
12
|
-
export class DocAttachAction extends ActionBase {
|
|
12
|
+
export class DocAttachAction extends ActionBase<typeof docAttachInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.attach',
|
|
15
15
|
cli: ['docs', 'attach'],
|
|
@@ -19,7 +19,7 @@ export class DocAttachAction extends ActionBase {
|
|
|
19
19
|
input: docAttachInput,
|
|
20
20
|
render: renderAttach,
|
|
21
21
|
})
|
|
22
|
-
async
|
|
22
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
23
23
|
return (attachToDoc as any)(ctx);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docAttachmentsInput } from '../schemas.js';
|
|
7
7
|
import { listDocAttachments as _listDocAttachments } from '../attach.js';
|
|
8
8
|
import { renderAttachments as _renderAttachments } from '../render.js';
|
|
9
9
|
const listDocAttachments: any = _listDocAttachments;
|
|
10
10
|
const renderAttachments: any = _renderAttachments;
|
|
11
11
|
|
|
12
|
-
export class DocAttachmentsAction extends ActionBase {
|
|
12
|
+
export class DocAttachmentsAction extends ActionBase<typeof docAttachmentsInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.attachments',
|
|
15
15
|
cli: ['docs', 'attachments'],
|
|
@@ -19,7 +19,7 @@ export class DocAttachmentsAction extends ActionBase {
|
|
|
19
19
|
input: docAttachmentsInput,
|
|
20
20
|
render: renderAttachments,
|
|
21
21
|
})
|
|
22
|
-
async
|
|
22
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
23
23
|
|
|
24
24
|
return listDocAttachments(ctx);
|
|
25
25
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docDetachInput } from '../schemas.js';
|
|
7
7
|
import { detachFromDoc as _detachFromDoc } from '../attach.js';
|
|
8
8
|
import { renderDetach as _renderDetach } from '../render.js';
|
|
9
9
|
const detachFromDoc: any = _detachFromDoc;
|
|
10
10
|
const renderDetach: any = _renderDetach;
|
|
11
11
|
|
|
12
|
-
export class DocDetachAction extends ActionBase {
|
|
12
|
+
export class DocDetachAction extends ActionBase<typeof docDetachInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.detach',
|
|
15
15
|
cli: ['docs', 'detach'],
|
|
@@ -19,7 +19,7 @@ export class DocDetachAction extends ActionBase {
|
|
|
19
19
|
input: docDetachInput,
|
|
20
20
|
render: renderDetach,
|
|
21
21
|
})
|
|
22
|
-
async
|
|
22
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
23
23
|
return (detachFromDoc as any)(ctx);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docGetInput } from '../schemas.js';
|
|
7
7
|
import { getDoc as _getDoc } from '../service.js';
|
|
8
8
|
import { renderGet as _renderGet } from '../render.js';
|
|
9
9
|
const getDoc: any = _getDoc;
|
|
10
10
|
const renderGet: any = _renderGet;
|
|
11
11
|
|
|
12
|
-
export class DocGetAction extends ActionBase {
|
|
12
|
+
export class DocGetAction extends ActionBase<typeof docGetInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.get',
|
|
15
15
|
cli: ['docs', 'get'],
|
|
@@ -19,7 +19,7 @@ export class DocGetAction extends ActionBase {
|
|
|
19
19
|
input: docGetInput,
|
|
20
20
|
render: renderGet,
|
|
21
21
|
})
|
|
22
|
-
async
|
|
22
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
23
23
|
|
|
24
24
|
return getDoc(ctx);
|
|
25
25
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docListInput } from '../schemas.js';
|
|
7
7
|
import { listDocs as _listDocs } from '../service.js';
|
|
8
8
|
import { renderList as _renderList } from '../render.js';
|
|
9
9
|
const listDocs: any = _listDocs;
|
|
10
10
|
const renderList: any = _renderList;
|
|
11
11
|
|
|
12
|
-
export class DocListAction extends ActionBase {
|
|
12
|
+
export class DocListAction extends ActionBase<typeof docListInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.list',
|
|
15
15
|
cli: ['docs', 'list'],
|
|
@@ -18,7 +18,7 @@ export class DocListAction extends ActionBase {
|
|
|
18
18
|
input: docListInput,
|
|
19
19
|
render: renderList,
|
|
20
20
|
})
|
|
21
|
-
async
|
|
21
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
22
22
|
|
|
23
23
|
return listDocs(ctx);
|
|
24
24
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docRemoveInput } from '../schemas.js';
|
|
7
7
|
import { removeDoc as _removeDoc } from '../service.js';
|
|
8
8
|
const removeDoc: any = _removeDoc;
|
|
9
9
|
|
|
10
|
-
export class DocRemoveAction extends ActionBase {
|
|
10
|
+
export class DocRemoveAction extends ActionBase<typeof docRemoveInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'doc.remove',
|
|
13
13
|
cli: ['docs', 'remove'],
|
|
@@ -17,7 +17,7 @@ export class DocRemoveAction extends ActionBase {
|
|
|
17
17
|
input: docRemoveInput,
|
|
18
18
|
render: (d: any) => `已删除: ${d.rel}`,
|
|
19
19
|
})
|
|
20
|
-
async
|
|
20
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
21
21
|
|
|
22
22
|
return removeDoc(ctx);
|
|
23
23
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput, type ActionRunMeta } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docUpdateInput } from '../schemas.js';
|
|
7
7
|
import { updateDoc as _updateDoc } from '../service.js';
|
|
8
8
|
import { renderWritten as _renderWritten } from '../render.js';
|
|
9
9
|
const updateDoc: any = _updateDoc;
|
|
10
10
|
const renderWritten: any = _renderWritten;
|
|
11
11
|
|
|
12
|
-
export class DocUpdateAction extends ActionBase {
|
|
12
|
+
export class DocUpdateAction extends ActionBase<typeof docUpdateInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'doc.update',
|
|
15
15
|
cli: ['docs', 'set'],
|
|
@@ -19,7 +19,7 @@ export class DocUpdateAction extends ActionBase {
|
|
|
19
19
|
input: docUpdateInput,
|
|
20
20
|
render: renderWritten,
|
|
21
21
|
})
|
|
22
|
-
async
|
|
22
|
+
override async run(ctx: ActionInput<this['_input']>, opts: ActionRunMeta = {}) {
|
|
23
23
|
|
|
24
24
|
return updateDoc(
|
|
25
25
|
{ ref: ctx.ref, body: ctx.body, bodyFile: opts && opts.transport === 'http' ? undefined : (ctx.bodyFile ?? ctx['body-file']) },
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docsBindInput } from '../schemas.js';
|
|
7
7
|
import * as refsNs from '../refs.js';
|
|
8
8
|
import { renderRef as _renderRef } from '../render.js';
|
|
9
9
|
const refs: any = refsNs;
|
|
10
10
|
const renderRef: any = _renderRef;
|
|
11
11
|
|
|
12
|
-
export class DocsBindAction extends ActionBase {
|
|
12
|
+
export class DocsBindAction extends ActionBase<typeof docsBindInput> {
|
|
13
13
|
@action({
|
|
14
14
|
id: 'docs.bind',
|
|
15
15
|
cli: ['docs', 'bind'],
|
|
@@ -18,7 +18,7 @@ export class DocsBindAction extends ActionBase {
|
|
|
18
18
|
input: docsBindInput,
|
|
19
19
|
render: renderRef,
|
|
20
20
|
})
|
|
21
|
-
async
|
|
21
|
+
override async run(ctx: ActionInput<this['_input']>) {
|
|
22
22
|
|
|
23
23
|
return refs.setDocRef(ctx);
|
|
24
24
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
-
import { ActionBase } from '../../../runtime/action-base.js';
|
|
5
|
+
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
6
|
import { docsIndexInput } from '../schemas.js';
|
|
7
7
|
import * as linksNs from '../links.js';
|
|
8
8
|
const links: any = linksNs;
|
|
9
9
|
|
|
10
|
-
export class DocsIndexAction extends ActionBase {
|
|
10
|
+
export class DocsIndexAction extends ActionBase<typeof docsIndexInput> {
|
|
11
11
|
@action({
|
|
12
12
|
id: 'docs.index',
|
|
13
13
|
cli: ['docs', 'index'],
|
|
@@ -16,7 +16,7 @@ export class DocsIndexAction extends ActionBase {
|
|
|
16
16
|
input: docsIndexInput,
|
|
17
17
|
render: (d: any) => d.index.map((x: any) => ` ${x.name} → ${x.docId}`).join('\n') || '(空)',
|
|
18
18
|
})
|
|
19
|
-
async
|
|
19
|
+
override async run(_ctx: ActionInput<this['_input']>) {
|
|
20
20
|
|
|
21
21
|
return ({ index: await links.buildIndex() });
|
|
22
22
|
|