* feat: getRepository * getRepository return type * export action * add: acl * feat: setResourceAction * feat: action alias * chore: code struct * feat: removeResourceAction * chore: file name * ignorecase * remove ACL * feat: ACL * feat: role toJSON * using emit Co-authored-by: chenos <chenlinxh@gmail.com>
23 lines
550 B
TypeScript
23 lines
550 B
TypeScript
import Koa from 'koa';
|
|
import { Database } from '@nocobase/database';
|
|
import { Action } from '@nocobase/resourcer';
|
|
import lodash from 'lodash';
|
|
import * as actions from './actions';
|
|
|
|
export type Next = () => Promise<any>;
|
|
|
|
export interface Context extends Koa.Context {
|
|
db: Database;
|
|
action: Action;
|
|
body: any;
|
|
[key: string]: any;
|
|
}
|
|
|
|
export function registerActions(api: any) {
|
|
api.actions(
|
|
lodash.pick(actions, ['add', 'create', 'destroy', 'get', 'list', 'remove', 'set', 'toggle', 'update', 'move']),
|
|
);
|
|
}
|
|
|
|
export default actions;
|