78 lines
2.0 KiB
TypeScript
78 lines
2.0 KiB
TypeScript
import { AuthDeduceRelationMap, EntityDict } from './Entity';
|
|
import { EntityDict as BaseEntityDict } from "../base-app-domain";
|
|
import { AsyncContext } from '../store/AsyncRowStore';
|
|
import { SyncConfig } from "./Sync";
|
|
import { AttrUpdateMatrix } from './EntityDesc';
|
|
import { ActionDefDict } from './Action';
|
|
import { StyleDict } from './Style';
|
|
/**
|
|
* 后台配置
|
|
*/
|
|
export type ServerConfiguration<ED extends BaseEntityDict & EntityDict, Cxt extends AsyncContext<ED>> = {
|
|
database: {
|
|
type: 'mysql';
|
|
host: string;
|
|
database: string;
|
|
port?: number;
|
|
user: string;
|
|
password?: string;
|
|
connectionLimit: number;
|
|
charset: "utf8mb4_general_ci";
|
|
};
|
|
workDir: {
|
|
path: string;
|
|
};
|
|
sync?: SyncConfig<ED, Cxt>;
|
|
};
|
|
/**
|
|
* 前后台访问配置
|
|
*/
|
|
export type AccessConfiguration = {
|
|
routerPrefixes?: {
|
|
aspect?: string;
|
|
endpoint?: string;
|
|
subscribe?: string;
|
|
getSubscribePoint?: string;
|
|
bridge?: string;
|
|
};
|
|
http: {
|
|
hostname: string;
|
|
port?: number;
|
|
ssl?: boolean;
|
|
path?: string;
|
|
};
|
|
};
|
|
/**
|
|
* 业务逻辑的通用配置
|
|
*/
|
|
export type CommonConfiguration<ED extends BaseEntityDict & EntityDict> = {
|
|
attrUpdateMatrix: AttrUpdateMatrix<ED>;
|
|
actionDefDict: ActionDefDict<ED>;
|
|
authDeduceRelationMap: AuthDeduceRelationMap<ED>;
|
|
selectFreeEntities?: (keyof ED)[];
|
|
updateFreeDict?: {
|
|
[A in keyof ED]?: string[];
|
|
};
|
|
cacheSavedEntities?: (keyof ED)[];
|
|
cacheKeepFreshPeriod?: number;
|
|
};
|
|
export type DependencyConfiguration = string[];
|
|
/**
|
|
* 渲染相关定义
|
|
*/
|
|
export type RenderConfiguration<ED extends BaseEntityDict & EntityDict> = {
|
|
styleDict: StyleDict<ED>;
|
|
};
|
|
/**
|
|
* 编译环境配置
|
|
*/
|
|
export type CompilerConfiguration = {
|
|
webpack?: {
|
|
resolve?: {
|
|
alias?: Record<string, string>;
|
|
fallback?: Record<string, string | false>;
|
|
};
|
|
extraOakModules?: (string | RegExp)[];
|
|
};
|
|
};
|