update
This commit is contained in:
@@ -143,19 +143,29 @@ export type AssistantConfigData = {
|
||||
enabled?: boolean;
|
||||
token?: string;
|
||||
}
|
||||
/**
|
||||
* 自定义脚本, asst 启动时会执行这些脚本
|
||||
*/
|
||||
scripts?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* 认证和权限配置
|
||||
* share: protected 需要认证代理访问(默认), public 公开访问, private 私有访问
|
||||
* share 是对外共享 pages 目录下的页面
|
||||
*/
|
||||
auth?: AuthPermission;
|
||||
storage?: AssistantStorage[];
|
||||
};
|
||||
type AssistantStorage = FileStorage | S3Storage;
|
||||
type FileStorage = {
|
||||
id: string;
|
||||
path: string;
|
||||
type: 'local'
|
||||
}
|
||||
type S3Storage = {
|
||||
id: string;
|
||||
bucket: string;
|
||||
region: string;
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
endpoint?: string;
|
||||
type: 's3' | 'minio';
|
||||
}
|
||||
let assistantConfig: AssistantConfigData;
|
||||
type AssistantConfigOptions = {
|
||||
configDir?: string;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const defaultApiProxy = [
|
||||
* @param paths ['/api/router', '/v1' ]
|
||||
* @returns
|
||||
*/
|
||||
export const createApiProxy = (api: string, paths: string[] = ['/api', '/v1']) => {
|
||||
export const createApiProxy = (api: string, paths: string[] = ['/api', '/v1']): ProxyInfo[] => {
|
||||
const pathList = paths.map((item) => {
|
||||
return {
|
||||
path: item,
|
||||
|
||||
@@ -36,10 +36,14 @@ export type ProxyInfo = {
|
||||
*/
|
||||
rootPath?: string;
|
||||
s3?: {
|
||||
bucket: string;
|
||||
region: string;
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
/**
|
||||
* 如何id存在,使用assistan-config的storage配置
|
||||
*/
|
||||
id?: string;
|
||||
bucket?: string;
|
||||
region?: string;
|
||||
accessKeyId?: string;
|
||||
secretAccessKey?: string;
|
||||
endpoint?: string;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user