bump: 修改router为kevisual的router
This commit is contained in:
parent
d8fec88e54
commit
61d7004c8f
3
.npmrc
3
.npmrc
@ -1,2 +1,3 @@
|
|||||||
@abearxiong:registry=https://npm.pkg.github.com
|
@abearxiong:registry=https://npm.pkg.github.com
|
||||||
@build:registry=https://npm.xiongxiao.me
|
@build:registry=https://npm.xiongxiao.me
|
||||||
|
@kevisual:registry=https://npm.xiongxiao.me
|
21
package.json
21
package.json
@ -35,43 +35,44 @@
|
|||||||
"@abearxiong/auth": "1.0.2",
|
"@abearxiong/auth": "1.0.2",
|
||||||
"@abearxiong/router": "0.0.1-alpha.43",
|
"@abearxiong/router": "0.0.1-alpha.43",
|
||||||
"@abearxiong/use-config": "^0.0.2",
|
"@abearxiong/use-config": "^0.0.2",
|
||||||
"@babel/core": "^7.25.8",
|
"@babel/core": "^7.25.9",
|
||||||
"@babel/preset-env": "^7.25.8",
|
"@babel/preset-env": "^7.25.9",
|
||||||
"@babel/preset-typescript": "^7.25.7",
|
"@babel/preset-typescript": "^7.25.9",
|
||||||
"@kevisual/ai-graph": "workspace:^",
|
"@kevisual/ai-graph": "workspace:^",
|
||||||
"@kevisual/ai-lang": "workspace:^",
|
"@kevisual/ai-lang": "workspace:^",
|
||||||
"@supabase/supabase-js": "^2.45.4",
|
"@kevisual/router": "0.0.4-alpha-2",
|
||||||
|
"@supabase/supabase-js": "^2.45.6",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"dts-bundle-generator": "^9.5.1",
|
"dts-bundle-generator": "^9.5.1",
|
||||||
"formidable": "^3.5.1",
|
"formidable": "^3.5.2",
|
||||||
"ioredis": "^5.4.1",
|
"ioredis": "^5.4.1",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"minio": "^8.0.1",
|
"minio": "^8.0.2",
|
||||||
"nanoid": "^5.0.7",
|
"nanoid": "^5.0.7",
|
||||||
"neo4j-driver": "^5.26.0",
|
"neo4j-driver": "^5.26.0",
|
||||||
"neode": "^0.4.9",
|
"neode": "^0.4.9",
|
||||||
"node-fetch": "^3.3.2",
|
"node-fetch": "^3.3.2",
|
||||||
"ollama": "^0.5.9",
|
"ollama": "^0.5.9",
|
||||||
"pg": "^8.13.0",
|
"pg": "^8.13.1",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"sequelize": "^6.37.4",
|
"sequelize": "^6.37.4",
|
||||||
"socket.io": "^4.8.0",
|
"socket.io": "^4.8.1",
|
||||||
"strip-ansi": "^7.1.0",
|
"strip-ansi": "^7.1.0",
|
||||||
"uuid": "^10.0.0",
|
"uuid": "^10.0.0",
|
||||||
"zod": "^3.23.8"
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@abearxiong/use-file-store": "^0.0.1",
|
"@abearxiong/use-file-store": "^0.0.1",
|
||||||
"@types/archiver": "^6.0.2",
|
"@types/archiver": "^6.0.3",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/formidable": "^3.4.5",
|
"@types/formidable": "^3.4.5",
|
||||||
"@types/jsonwebtoken": "^9.0.7",
|
"@types/jsonwebtoken": "^9.0.7",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/node": "^22.7.5",
|
"@types/node": "^22.7.9",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@types/webpack-env": "^1.18.5",
|
"@types/webpack-env": "^1.18.5",
|
||||||
"concurrently": "^9.0.1",
|
"concurrently": "^9.0.1",
|
||||||
|
1443
pnpm-lock.yaml
generated
1443
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
3
src/admin/app.ts
Normal file
3
src/admin/app.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { App } from '@kevisual/router';
|
||||||
|
|
||||||
|
export const app = new App();
|
@ -1,5 +1,5 @@
|
|||||||
import { router } from '../../modules/router.ts';
|
import { router } from '../../modules/router.ts';
|
||||||
import { Route } from '@abearxiong/router';
|
import { Route } from '@kevisual/router';
|
||||||
import { RouterCodeModel, RouterCode } from '../../models/code.ts';
|
import { RouterCodeModel, RouterCode } from '../../models/code.ts';
|
||||||
|
|
||||||
export enum CodeStatus {
|
export enum CodeStatus {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// admin 需要最后运行,并在route中进行过滤。
|
// admin 需要最后运行,并在route中进行过滤。
|
||||||
import { Route } from '@abearxiong/router';
|
import { Route } from '@kevisual/router';
|
||||||
import { router } from '../modules/router.ts';
|
import { router } from '../modules/router.ts';
|
||||||
import { manager, updateNewCode, removeCode, stopCode, startCode } from './dashboard/manager.ts';
|
import { manager, updateNewCode, removeCode, stopCode, startCode } from './dashboard/manager.ts';
|
||||||
import { loadOne } from './dashboard/load.ts';
|
import { loadOne } from './dashboard/load.ts';
|
||||||
|
17
src/admin/modules/sequelize.ts
Normal file
17
src/admin/modules/sequelize.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { useConfig } from '@abearxiong/use-config';
|
||||||
|
import { Sequelize } from 'sequelize';
|
||||||
|
|
||||||
|
const config = useConfig();
|
||||||
|
|
||||||
|
const postgresConfig = config.postgres;
|
||||||
|
|
||||||
|
if (!postgresConfig) {
|
||||||
|
console.error('postgres config is required');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
// connect to db
|
||||||
|
export const sequelize = new Sequelize({
|
||||||
|
dialect: 'sqlite',
|
||||||
|
storage: 'db.sqlite',
|
||||||
|
// logging: false,
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
import { Route } from '@abearxiong/router';
|
import { Route } from '@kevisual/router';
|
||||||
import { router } from '../modules/router.ts';
|
import { router } from '../modules/router.ts';
|
||||||
import { getPackage, installPackage } from '../lib/npm.ts';
|
import { getPackage, installPackage } from '../lib/npm.ts';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// admin router manger
|
// admin router manger
|
||||||
|
|
||||||
import { CustomError, Route } from '@abearxiong/router';
|
import { CustomError, Route } from '@kevisual/router';
|
||||||
import { router } from '../modules/router.ts';
|
import { router } from '../modules/router.ts';
|
||||||
import { manager, updateNewCode, removeCode, stopCode, startCode } from './dashboard/manager.ts';
|
import { manager, updateNewCode, removeCode, stopCode, startCode } from './dashboard/manager.ts';
|
||||||
import { loadOne } from './dashboard/load.ts';
|
import { loadOne } from './dashboard/load.ts';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { App } from '@abearxiong/router';
|
import { App } from '@kevisual/router';
|
||||||
import { useConfig } from '@abearxiong/use-config';
|
import { useConfig } from '@abearxiong/use-config';
|
||||||
import { dynamicImport } from './lib/dynamic-import.ts';
|
import { dynamicImport } from './lib/dynamic-import.ts';
|
||||||
import { redisPublisher, redisSubscriber, redis } from './modules/redis.ts';
|
import { redisPublisher, redisSubscriber, redis } from './modules/redis.ts';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { router } from '../modules/router.ts';
|
import { router } from '../modules/router.ts';
|
||||||
import { Route } from '@abearxiong/router';
|
import { Route } from '@kevisual/router';
|
||||||
|
|
||||||
const getList = new Route('test', 'getList');
|
const getList = new Route('test', 'getList');
|
||||||
getList.run = async (ctx) => {
|
getList.run = async (ctx) => {
|
||||||
|
@ -4,7 +4,7 @@ import { DataTypes, Model, Op } from 'sequelize';
|
|||||||
import { createToken, checkToken } from '@abearxiong/auth/token';
|
import { createToken, checkToken } from '@abearxiong/auth/token';
|
||||||
import { cryptPwd } from '@abearxiong/auth';
|
import { cryptPwd } from '@abearxiong/auth';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { Org } from './org.ts';
|
import { Org } from './org.ts';
|
||||||
import { redis } from '@/app.ts';
|
import { redis } from '@/app.ts';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { AiAgent, AiProperties } from '@/models/agent.ts';
|
import { AiAgent, AiProperties } from '@/models/agent.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { agentManger } from '@kevisual/ai-lang';
|
import { agentManger } from '@kevisual/ai-lang';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
app
|
app
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { App, CustomError } from '@abearxiong/router';
|
import { App, CustomError } from '@kevisual/router';
|
||||||
import { AppModel, AppListModel } from './module/index.ts';
|
import { AppModel, AppListModel } from './module/index.ts';
|
||||||
import { app, redis } from '@/app.ts';
|
import { app, redis } from '@/app.ts';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { AppModel, AppListModel } from './module/index.ts';
|
import { AppModel, AppListModel } from './module/index.ts';
|
||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { setExpire } from './revoke.ts';
|
import { setExpire } from './revoke.ts';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { ChatHistory } from '@/models/chat-history.ts';
|
import { ChatHistory } from '@/models/chat-history.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
// Admin only
|
// Admin only
|
||||||
app
|
app
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { ChatSession } from '@/models/chat-session.ts';
|
import { ChatSession } from '@/models/chat-session.ts';
|
||||||
import { ChatPrompt } from '@/models/chat-prompt.ts';
|
import { ChatPrompt } from '@/models/chat-prompt.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
app
|
app
|
||||||
.route({
|
.route({
|
||||||
path: 'chat-session',
|
path: 'chat-session',
|
||||||
|
@ -2,7 +2,7 @@ import { app } from '@/app.ts';
|
|||||||
import { AiAgent } from '@/models/agent.ts';
|
import { AiAgent } from '@/models/agent.ts';
|
||||||
import { ChatPrompt } from '@/models/chat-prompt.ts';
|
import { ChatPrompt } from '@/models/chat-prompt.ts';
|
||||||
import { Prompt } from '@/models/prompt.ts';
|
import { Prompt } from '@/models/prompt.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
// Admin only
|
// Admin only
|
||||||
app
|
app
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { app } from '../../app.ts';
|
import { app } from '../../app.ts';
|
||||||
import { ContainerModel, ContainerData, Container } from './models/index.ts';
|
import { ContainerModel, ContainerData, Container } from './models/index.ts';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { getFileStat, getMinioList } from './module/get-minio-list.ts';
|
import { getFileStat, getMinioList } from './module/get-minio-list.ts';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { get } from 'http';
|
import { get } from 'http';
|
||||||
|
|
||||||
const handlePrefix = (prefix: string) => {
|
const handlePrefix = (prefix: string) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { getAccessToken } from './lib/get-token.ts';
|
import { getAccessToken } from './lib/get-token.ts';
|
||||||
import { GithubModel } from './models/github.ts';
|
import { GithubModel } from './models/github.ts';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { app } from '../../app.ts';
|
import { app } from '../../app.ts';
|
||||||
import { PageModel } from './models/index.ts';
|
import { PageModel } from './models/index.ts';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
@ -10,7 +10,7 @@ import { minioClient } from '@/app.ts';
|
|||||||
import { bucketName } from '@/modules/minio.ts';
|
import { bucketName } from '@/modules/minio.ts';
|
||||||
import { getContentType } from '@/utils/get-content-type.ts';
|
import { getContentType } from '@/utils/get-content-type.ts';
|
||||||
import archiver from 'archiver';
|
import archiver from 'archiver';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|
||||||
export const cacheFile = useFileStore('cache-file', {
|
export const cacheFile = useFileStore('cache-file', {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { app } from '../../app.ts';
|
import { app } from '../../app.ts';
|
||||||
import { PageModel } from './models/index.ts';
|
import { PageModel } from './models/index.ts';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { Prompt } from '@/models/prompt.ts';
|
import { Prompt } from '@/models/prompt.ts';
|
||||||
import { chat } from '@/modules/ollama.ts';
|
import { chat } from '@/modules/ollama.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { PromptTemplate } from '@kevisual/ai-graph';
|
import { PromptTemplate } from '@kevisual/ai-graph';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
app
|
app
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Prompt } from '@/models/prompt.ts';
|
import { Prompt } from '@/models/prompt.ts';
|
||||||
|
|
||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
app
|
app
|
||||||
.route('prompt', 'list')
|
.route('prompt', 'list')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ResourceData, ResourceModel } from './models/index.ts';
|
import { ResourceData, ResourceModel } from './models/index.ts';
|
||||||
import { app } from '../../app.ts';
|
import { app } from '../../app.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
app
|
app
|
||||||
.route({
|
.route({
|
||||||
|
@ -4,7 +4,7 @@ import { ContainerModel } from './../container/models/index.ts';
|
|||||||
import { app } from '../../app.ts';
|
import { app } from '../../app.ts';
|
||||||
import { Op } from 'sequelize';
|
import { Op } from 'sequelize';
|
||||||
import { publishJsCode } from './lib/publish-minio.ts';
|
import { publishJsCode } from './lib/publish-minio.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
// app
|
// app
|
||||||
// .route({
|
// .route({
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { User } from '@/models/user.ts';
|
import { User } from '@/models/user.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
app
|
app
|
||||||
.route({
|
.route({
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
import { Org } from '@/models/org.ts';
|
import { Org } from '@/models/org.ts';
|
||||||
import { User } from '@/models/user.ts';
|
import { User } from '@/models/user.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
|
|
||||||
app
|
app
|
||||||
.route({
|
.route({
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { app, sequelize } from '@/app.ts';
|
import { app, sequelize } from '@/app.ts';
|
||||||
import { Org } from '@/models/org.ts';
|
import { Org } from '@/models/org.ts';
|
||||||
import { User } from '@/models/user.ts';
|
import { User } from '@/models/user.ts';
|
||||||
import { CustomError } from '@abearxiong/router';
|
import { CustomError } from '@kevisual/router';
|
||||||
import { Op } from 'sequelize';
|
import { Op } from 'sequelize';
|
||||||
|
|
||||||
app
|
app
|
||||||
|
@ -68,7 +68,7 @@ module.exports = {
|
|||||||
extensions: ['.ts', '.js'],
|
extensions: ['.ts', '.js'],
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.join(__dirname, './src'),
|
'@': path.join(__dirname, './src'),
|
||||||
hexoid: 'hexoid/dist/index.js',
|
// hexoid: 'hexoid/dist/index.js',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user