初始化
This commit is contained in:
20
easyflow-ui-admin/packages/types/README.md
Normal file
20
easyflow-ui-admin/packages/types/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# @easyflow/types
|
||||
|
||||
用于多个 `app` 公用的工具类型,继承了 `@easyflow-core/typings` 的所有能力。业务上有通用的类型定义可以放在这里。
|
||||
|
||||
## 用法
|
||||
|
||||
### 添加依赖
|
||||
|
||||
```bash
|
||||
# 进入目标应用目录,例如 apps/xxxx-app
|
||||
# cd apps/xxxx-app
|
||||
pnpm add @easyflow/types
|
||||
```
|
||||
|
||||
### 使用
|
||||
|
||||
```ts
|
||||
// 推荐加上 type
|
||||
import type { SelectOption } from '@easyflow/types';
|
||||
```
|
||||
32
easyflow-ui-admin/packages/types/global.d.ts
vendored
Normal file
32
easyflow-ui-admin/packages/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { RouteMeta as IRouteMeta } from '@easyflow-core/typings';
|
||||
|
||||
import 'vue-router';
|
||||
|
||||
declare module 'vue-router' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface RouteMeta extends IRouteMeta {}
|
||||
}
|
||||
|
||||
export interface EasyFlowAdminProAppConfigRaw {
|
||||
VITE_GLOB_API_URL: string;
|
||||
VITE_GLOB_AUTH_DINGDING_CLIENT_ID: string;
|
||||
VITE_GLOB_AUTH_DINGDING_CORP_ID: string;
|
||||
}
|
||||
|
||||
interface AuthConfig {
|
||||
dingding?: {
|
||||
clientId: string;
|
||||
corpId: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApplicationConfig {
|
||||
apiURL: string;
|
||||
auth: AuthConfig;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
_APP_ADMIN_PRO_APP_CONF_: EasyFlowAdminProAppConfigRaw;
|
||||
}
|
||||
}
|
||||
20
easyflow-ui-admin/packages/types/package.json
Normal file
20
easyflow-ui-admin/packages/types/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@easyflow/types",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"default": "./src/index.ts"
|
||||
},
|
||||
"./global": {
|
||||
"types": "./global.d.ts"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@easyflow-core/typings": "workspace:*",
|
||||
"vue": "catalog:",
|
||||
"vue-router": "catalog:"
|
||||
}
|
||||
}
|
||||
5
easyflow-ui-admin/packages/types/src/api.ts
Normal file
5
easyflow-ui-admin/packages/types/src/api.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface RequestResult<T = any> {
|
||||
data: T;
|
||||
errorCode: number;
|
||||
message: string;
|
||||
}
|
||||
99
easyflow-ui-admin/packages/types/src/bot.ts
Normal file
99
easyflow-ui-admin/packages/types/src/bot.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
interface BotInfo {
|
||||
alias: string;
|
||||
anonymousEnabled: boolean;
|
||||
created: string;
|
||||
createdBy: number;
|
||||
deptId: number;
|
||||
description: string;
|
||||
icon: string;
|
||||
id: string;
|
||||
modelId: string;
|
||||
modelOptions: {
|
||||
maxMessageCount: number;
|
||||
maxReplyLength: number;
|
||||
systemPrompt?: string;
|
||||
temperature: number;
|
||||
topK: number;
|
||||
topP: number;
|
||||
welcomeMessage: string;
|
||||
};
|
||||
modified: string;
|
||||
modifiedBy: number;
|
||||
options: {
|
||||
anonymousEnabled: boolean;
|
||||
enableDeepThinking: boolean;
|
||||
EncodingAESKey: string;
|
||||
presetQuestions: presetQuestionsType[];
|
||||
reActModeEnabled: boolean;
|
||||
voiceEnabled: boolean;
|
||||
weChatMpAesKey: string;
|
||||
weChatMpAppId: string;
|
||||
weChatMpSecret: string;
|
||||
weChatMpToken: string;
|
||||
welcomeMessage?: string;
|
||||
};
|
||||
tenantId: number;
|
||||
title: string;
|
||||
categoryId: any;
|
||||
status: number;
|
||||
}
|
||||
|
||||
interface Session {
|
||||
botId: string;
|
||||
sessionId: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface presetQuestionsType {
|
||||
key: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
interface ChatMessage {
|
||||
role: 'assistant' | 'user';
|
||||
created: number;
|
||||
updateAt: number;
|
||||
id: string;
|
||||
content: string;
|
||||
options?: {
|
||||
type: number;
|
||||
user_input: string;
|
||||
};
|
||||
placement: 'end' | 'start';
|
||||
loading?: boolean;
|
||||
typing?: boolean;
|
||||
fileList?: File[];
|
||||
isFog?: boolean;
|
||||
}
|
||||
|
||||
interface AiLlm {
|
||||
brand: string;
|
||||
deptId: number;
|
||||
description: string;
|
||||
icon: string;
|
||||
id: string;
|
||||
llmApiKey: string;
|
||||
llmEndpoint: string;
|
||||
llmModel: string;
|
||||
options: {
|
||||
chatPath: string;
|
||||
embedPath: string;
|
||||
llmEndpoint: string;
|
||||
rerankPath: string;
|
||||
};
|
||||
supportAudioToAudio: boolean;
|
||||
supportChat: boolean;
|
||||
supportEmbed: boolean;
|
||||
supportFeatures: string[];
|
||||
supportFunctionCalling: boolean;
|
||||
supportImageToImage: boolean;
|
||||
supportImageToVideo: boolean;
|
||||
supportReranker: boolean;
|
||||
supportTextToAudio: boolean;
|
||||
supportTextToImage: boolean;
|
||||
supportTextToVideo: boolean;
|
||||
tenantId: number;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export type { AiLlm, BotInfo, ChatMessage, Session };
|
||||
4
easyflow-ui-admin/packages/types/src/index.ts
Normal file
4
easyflow-ui-admin/packages/types/src/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export type * from './api';
|
||||
export type * from './bot';
|
||||
export type * from './user';
|
||||
export type * from '@easyflow-core/typings';
|
||||
20
easyflow-ui-admin/packages/types/src/user.ts
Normal file
20
easyflow-ui-admin/packages/types/src/user.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { BasicUserInfo } from '@easyflow-core/typings';
|
||||
|
||||
/** 用户信息 */
|
||||
interface UserInfo extends BasicUserInfo {
|
||||
/**
|
||||
* 用户描述
|
||||
*/
|
||||
desc: string;
|
||||
/**
|
||||
* 首页地址
|
||||
*/
|
||||
homePath: string;
|
||||
|
||||
/**
|
||||
* accessToken
|
||||
*/
|
||||
token: string;
|
||||
}
|
||||
|
||||
export type { UserInfo };
|
||||
6
easyflow-ui-admin/packages/types/tsconfig.json
Normal file
6
easyflow-ui-admin/packages/types/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@easyflow/tsconfig/web.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user