nocobase/packages/core/actions/src/index.ts
Junyi dea4c6f9c7
feat(plugin-workflow): add sort and pagination to query node params (#2453)
* refactor(core): expose some utils and constants

* feat(plugin-workfow): add sort and pagination to query node params

* fix(plugin-workflow): fix job result json style

* fix(plugin-workflow): fix sort param

* fix(plugin-workflow): fix test cases
2023-08-14 20:32:51 -07:00

44 lines
799 B
TypeScript

import { Cache } from '@nocobase/cache';
import { Database } from '@nocobase/database';
import { Action } from '@nocobase/resourcer';
import Koa from 'koa';
import lodash from 'lodash';
import * as actions from './actions';
export * as utils from './utils';
export * from './constants';
export type Next = () => Promise<any>;
export interface Context extends Koa.Context {
db: Database;
cache: Cache;
action: Action;
body: any;
app: any;
[key: string]: any;
}
export function registerActions(api: any) {
api.actions(
lodash.pick(actions, [
'add',
'create',
'destroy',
'get',
'list',
'remove',
'set',
'toggle',
'update',
'move',
'firstOrCreate',
'updateOrCreate',
]),
);
}
export default actions;