database-proxy
Version:
Through a set of access control rules configuration database access to realize the client directly access the database via HTTP.
25 lines • 808 B
TypeScript
import { HandlerContext } from '..';
/**
* 用于各场景下的 condition 表达式执行,支持 get() 函数
* @param code js code
* @param objects 要注入执行环境的对象
* @param context 请求上下文
* @param defaultField 当前上下文可指定的字段,用于 query 或 data 验证字段
* @returns
*/
export declare function executeScript(code: string, objects: any, context: HandlerContext, defaultField?: string): Promise<{
result?: any;
error?: any;
}>;
/**
* 解析查询路径
* @param target target like '/users/_id' or `users/_id` or `_id` or undefined
* @param defaultCollection
* @param defaultField
* @returns
*/
export declare function parseQueryURI(target: string): {
collection?: string;
field?: string;
};
//# sourceMappingURL=script.d.ts.map