temp 更新
This commit is contained in:
parent
fe6ce9f97e
commit
b5fc5d279e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/code-center",
|
"name": "@kevisual/code-center",
|
||||||
"version": "0.0.5-alpha.2",
|
"version": "0.0.6-alpha.2",
|
||||||
"description": "code center",
|
"description": "code center",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@ -37,7 +37,7 @@
|
|||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"formidable": "^3.5.2",
|
"formidable": "^3.5.2",
|
||||||
"ioredis": "^5.5.0",
|
"ioredis": "^5.6.0",
|
||||||
"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",
|
||||||
@ -57,7 +57,7 @@
|
|||||||
"zod": "^3.24.2"
|
"zod": "^3.24.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kevisual/code-center-module": "0.0.11-alpha.3",
|
"@kevisual/code-center-module": "0.0.12",
|
||||||
"@kevisual/types": "^0.0.6",
|
"@kevisual/types": "^0.0.6",
|
||||||
"@rollup/plugin-alias": "^5.1.1",
|
"@rollup/plugin-alias": "^5.1.1",
|
||||||
"@rollup/plugin-commonjs": "^28.0.2",
|
"@rollup/plugin-commonjs": "^28.0.2",
|
||||||
|
34
pnpm-lock.yaml
generated
34
pnpm-lock.yaml
generated
@ -41,8 +41,8 @@ importers:
|
|||||||
specifier: ^3.5.2
|
specifier: ^3.5.2
|
||||||
version: 3.5.2
|
version: 3.5.2
|
||||||
ioredis:
|
ioredis:
|
||||||
specifier: ^5.5.0
|
specifier: ^5.6.0
|
||||||
version: 5.5.0
|
version: 5.6.0
|
||||||
json5:
|
json5:
|
||||||
specifier: ^2.2.3
|
specifier: ^2.2.3
|
||||||
version: 2.2.3
|
version: 2.2.3
|
||||||
@ -96,8 +96,8 @@ importers:
|
|||||||
version: 3.24.2
|
version: 3.24.2
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@kevisual/code-center-module':
|
'@kevisual/code-center-module':
|
||||||
specifier: 0.0.11-alpha.3
|
specifier: 0.0.12
|
||||||
version: 0.0.11-alpha.3(@kevisual/auth@1.0.5)(@kevisual/router@0.0.9)(@kevisual/use-config@1.0.9)(ioredis@5.5.0)(pg@8.13.3)(sequelize@6.37.6(pg@8.13.3))
|
version: 0.0.12(@kevisual/auth@1.0.5)(@kevisual/router@0.0.9)(@kevisual/use-config@1.0.9)(ioredis@5.6.0)(pg@8.13.3)(sequelize@6.37.6(pg@8.13.3))
|
||||||
'@kevisual/types':
|
'@kevisual/types':
|
||||||
specifier: ^0.0.6
|
specifier: ^0.0.6
|
||||||
version: 0.0.6
|
version: 0.0.6
|
||||||
@ -351,8 +351,8 @@ packages:
|
|||||||
'@kevisual/auth@1.0.5':
|
'@kevisual/auth@1.0.5':
|
||||||
resolution: {integrity: sha512-GwsLj7unKXi7lmMiIIgdig4LwwLiDJnOy15HHZR5gMbyK6s5/uJiMY5RXPB2+onGzTNDqFo/hXjsD2wkerHPVg==}
|
resolution: {integrity: sha512-GwsLj7unKXi7lmMiIIgdig4LwwLiDJnOy15HHZR5gMbyK6s5/uJiMY5RXPB2+onGzTNDqFo/hXjsD2wkerHPVg==}
|
||||||
|
|
||||||
'@kevisual/code-center-module@0.0.11-alpha.3':
|
'@kevisual/code-center-module@0.0.12':
|
||||||
resolution: {integrity: sha512-TAaONwi30ToVvcLVk+tpxCfuWRE+CE+7NtQB76oDC0UGXNx0MiouO8qut0bcoa3y+ZtVINXuz/9jrky9EESz6Q==}
|
resolution: {integrity: sha512-klQWlsifSeW7ej33B6/0ipB1UorEce5XHTvwNnX1QLGfUNCWm43j5xk+t71NuaVCmBO9OIRri88aU/GQc4G4fw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@kevisual/auth': ^1.0.5
|
'@kevisual/auth': ^1.0.5
|
||||||
'@kevisual/router': ^0.0.7
|
'@kevisual/router': ^0.0.7
|
||||||
@ -520,61 +520,51 @@ packages:
|
|||||||
resolution: {integrity: sha512-88I+D3TeKItrw+Y/2ud4Tw0+3CxQ2kLgu3QvrogZ0OfkmX/DEppehus7L3TS2Q4lpB+hYyxhkQiYPJ6Mf5/dPg==}
|
resolution: {integrity: sha512-88I+D3TeKItrw+Y/2ud4Tw0+3CxQ2kLgu3QvrogZ0OfkmX/DEppehus7L3TS2Q4lpB+hYyxhkQiYPJ6Mf5/dPg==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-musleabihf@4.34.9':
|
'@rollup/rollup-linux-arm-musleabihf@4.34.9':
|
||||||
resolution: {integrity: sha512-3qyfWljSFHi9zH0KgtEPG4cBXHDFhwD8kwg6xLfHQ0IWuH9crp005GfoUUh/6w9/FWGBwEHg3lxK1iHRN1MFlA==}
|
resolution: {integrity: sha512-3qyfWljSFHi9zH0KgtEPG4cBXHDFhwD8kwg6xLfHQ0IWuH9crp005GfoUUh/6w9/FWGBwEHg3lxK1iHRN1MFlA==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-gnu@4.34.9':
|
'@rollup/rollup-linux-arm64-gnu@4.34.9':
|
||||||
resolution: {integrity: sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw==}
|
resolution: {integrity: sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-musl@4.34.9':
|
'@rollup/rollup-linux-arm64-musl@4.34.9':
|
||||||
resolution: {integrity: sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A==}
|
resolution: {integrity: sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-loongarch64-gnu@4.34.9':
|
'@rollup/rollup-linux-loongarch64-gnu@4.34.9':
|
||||||
resolution: {integrity: sha512-dRAgTfDsn0TE0HI6cmo13hemKpVHOEyeciGtvlBTkpx/F65kTvShtY/EVyZEIfxFkV5JJTuQ9tP5HGBS0hfxIg==}
|
resolution: {integrity: sha512-dRAgTfDsn0TE0HI6cmo13hemKpVHOEyeciGtvlBTkpx/F65kTvShtY/EVyZEIfxFkV5JJTuQ9tP5HGBS0hfxIg==}
|
||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-powerpc64le-gnu@4.34.9':
|
'@rollup/rollup-linux-powerpc64le-gnu@4.34.9':
|
||||||
resolution: {integrity: sha512-PHcNOAEhkoMSQtMf+rJofwisZqaU8iQ8EaSps58f5HYll9EAY5BSErCZ8qBDMVbq88h4UxaNPlbrKqfWP8RfJA==}
|
resolution: {integrity: sha512-PHcNOAEhkoMSQtMf+rJofwisZqaU8iQ8EaSps58f5HYll9EAY5BSErCZ8qBDMVbq88h4UxaNPlbrKqfWP8RfJA==}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-gnu@4.34.9':
|
'@rollup/rollup-linux-riscv64-gnu@4.34.9':
|
||||||
resolution: {integrity: sha512-Z2i0Uy5G96KBYKjeQFKbbsB54xFOL5/y1P5wNBsbXB8yE+At3oh0DVMjQVzCJRJSfReiB2tX8T6HUFZ2k8iaKg==}
|
resolution: {integrity: sha512-Z2i0Uy5G96KBYKjeQFKbbsB54xFOL5/y1P5wNBsbXB8yE+At3oh0DVMjQVzCJRJSfReiB2tX8T6HUFZ2k8iaKg==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-s390x-gnu@4.34.9':
|
'@rollup/rollup-linux-s390x-gnu@4.34.9':
|
||||||
resolution: {integrity: sha512-U+5SwTMoeYXoDzJX5dhDTxRltSrIax8KWwfaaYcynuJw8mT33W7oOgz0a+AaXtGuvhzTr2tVKh5UO8GVANTxyQ==}
|
resolution: {integrity: sha512-U+5SwTMoeYXoDzJX5dhDTxRltSrIax8KWwfaaYcynuJw8mT33W7oOgz0a+AaXtGuvhzTr2tVKh5UO8GVANTxyQ==}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-gnu@4.34.9':
|
'@rollup/rollup-linux-x64-gnu@4.34.9':
|
||||||
resolution: {integrity: sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A==}
|
resolution: {integrity: sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-musl@4.34.9':
|
'@rollup/rollup-linux-x64-musl@4.34.9':
|
||||||
resolution: {integrity: sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA==}
|
resolution: {integrity: sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-win32-arm64-msvc@4.34.9':
|
'@rollup/rollup-win32-arm64-msvc@4.34.9':
|
||||||
resolution: {integrity: sha512-z4mQK9dAN6byRA/vsSgQiPeuO63wdiDxZ9yg9iyX2QTzKuQM7T4xlBoeUP/J8uiFkqxkcWndWi+W7bXdPbt27Q==}
|
resolution: {integrity: sha512-z4mQK9dAN6byRA/vsSgQiPeuO63wdiDxZ9yg9iyX2QTzKuQM7T4xlBoeUP/J8uiFkqxkcWndWi+W7bXdPbt27Q==}
|
||||||
@ -1357,8 +1347,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==}
|
resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
ioredis@5.5.0:
|
ioredis@5.6.0:
|
||||||
resolution: {integrity: sha512-7CutT89g23FfSa8MDoIFs2GYYa0PaNiW/OrT+nRyjRXHDZd17HmIgy+reOQ/yhh72NznNjGuS8kbCAcA4Ro4mw==}
|
resolution: {integrity: sha512-tBZlIIWbndeWBWCXWZiqtOF/yxf6yZX3tAlTJ7nfo5jhd6dctNxF7QnYlZLZ1a0o0pDoen7CgZqO+zjNaFbJAg==}
|
||||||
engines: {node: '>=12.22.0'}
|
engines: {node: '>=12.22.0'}
|
||||||
|
|
||||||
ip-address@9.0.5:
|
ip-address@9.0.5:
|
||||||
@ -2578,12 +2568,12 @@ snapshots:
|
|||||||
|
|
||||||
'@kevisual/auth@1.0.5': {}
|
'@kevisual/auth@1.0.5': {}
|
||||||
|
|
||||||
'@kevisual/code-center-module@0.0.11-alpha.3(@kevisual/auth@1.0.5)(@kevisual/router@0.0.9)(@kevisual/use-config@1.0.9)(ioredis@5.5.0)(pg@8.13.3)(sequelize@6.37.6(pg@8.13.3))':
|
'@kevisual/code-center-module@0.0.12(@kevisual/auth@1.0.5)(@kevisual/router@0.0.9)(@kevisual/use-config@1.0.9)(ioredis@5.6.0)(pg@8.13.3)(sequelize@6.37.6(pg@8.13.3))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@kevisual/auth': 1.0.5
|
'@kevisual/auth': 1.0.5
|
||||||
'@kevisual/router': 0.0.9
|
'@kevisual/router': 0.0.9
|
||||||
'@kevisual/use-config': 1.0.9
|
'@kevisual/use-config': 1.0.9
|
||||||
ioredis: 5.5.0
|
ioredis: 5.6.0
|
||||||
nanoid: 5.1.2
|
nanoid: 5.1.2
|
||||||
pg: 8.13.3
|
pg: 8.13.3
|
||||||
sequelize: 6.37.6(pg@8.13.3)
|
sequelize: 6.37.6(pg@8.13.3)
|
||||||
@ -3682,11 +3672,11 @@ snapshots:
|
|||||||
hasown: 2.0.2
|
hasown: 2.0.2
|
||||||
side-channel: 1.0.6
|
side-channel: 1.0.6
|
||||||
|
|
||||||
ioredis@5.5.0:
|
ioredis@5.6.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@ioredis/commands': 1.2.0
|
'@ioredis/commands': 1.2.0
|
||||||
cluster-key-slot: 1.1.2
|
cluster-key-slot: 1.1.2
|
||||||
debug: 4.3.7(supports-color@5.5.0)
|
debug: 4.4.0
|
||||||
denque: 2.1.0
|
denque: 2.1.0
|
||||||
lodash.defaults: 4.2.0
|
lodash.defaults: 4.2.0
|
||||||
lodash.isarguments: 3.1.0
|
lodash.isarguments: 3.1.0
|
||||||
|
@ -287,7 +287,11 @@
|
|||||||
|
|
||||||
// useContextKey('UserModel', () => UserServices);
|
// useContextKey('UserModel', () => UserServices);
|
||||||
|
|
||||||
import { User, UserServices, UserInit } from '@kevisual/code-center-module/models';
|
import { User, UserInit } from '@kevisual/code-center-module';
|
||||||
export { User, UserServices };
|
export { User, UserInit };
|
||||||
|
UserInit(null, null, {
|
||||||
UserInit();
|
alter: true,
|
||||||
|
logging: true,
|
||||||
|
}).catch((e) => {
|
||||||
|
console.error('User sync', e);
|
||||||
|
});
|
||||||
|
@ -11,7 +11,7 @@ export interface AppData {
|
|||||||
orgs?: string[];
|
orgs?: string[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export type AppType = 'web-single' | 'web-module';
|
export type AppType = 'web-single' | 'web-module'; // 可以做到网页代理
|
||||||
export enum AppStatus {
|
export enum AppStatus {
|
||||||
running = 'running',
|
running = 'running',
|
||||||
stop = 'stop',
|
stop = 'stop',
|
||||||
@ -32,6 +32,8 @@ export class AppModel extends Model {
|
|||||||
declare key: string;
|
declare key: string;
|
||||||
declare type: string;
|
declare type: string;
|
||||||
declare uid: string;
|
declare uid: string;
|
||||||
|
declare pid: string;
|
||||||
|
declare proxy: boolean;
|
||||||
declare user: string;
|
declare user: string;
|
||||||
declare status: string;
|
declare status: string;
|
||||||
}
|
}
|
||||||
@ -79,6 +81,14 @@ AppModel.init(
|
|||||||
type: DataTypes.UUID,
|
type: DataTypes.UUID,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
pid: {
|
||||||
|
type: DataTypes.UUID,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
|
proxy: {
|
||||||
|
type: DataTypes.BOOLEAN,
|
||||||
|
defaultValue: false,
|
||||||
|
},
|
||||||
user: {
|
user: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { UserServices } from '@/models/user.ts';
|
import { User } from '@/models/user.ts';
|
||||||
|
|
||||||
import { app } from '@/app.ts';
|
import { app } from '@/app.ts';
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ app
|
|||||||
if (!password) {
|
if (!password) {
|
||||||
ctx.throw(500, 'root password are required');
|
ctx.throw(500, 'root password are required');
|
||||||
}
|
}
|
||||||
const res = await UserServices.initializeUser(password);
|
const res = await User.initializeUser(password);
|
||||||
ctx.body = res;
|
ctx.body = res;
|
||||||
})
|
})
|
||||||
.addTo(app);
|
.addTo(app);
|
||||||
@ -28,7 +28,7 @@ app
|
|||||||
if (!username && username.startsWith('demo')) {
|
if (!username && username.startsWith('demo')) {
|
||||||
ctx.throw(500, 'username are required, and must start with demo');
|
ctx.throw(500, 'username are required, and must start with demo');
|
||||||
}
|
}
|
||||||
const res = await UserServices.createDemoUser(username, password);
|
const res = await User.createDemoUser(username, password);
|
||||||
ctx.body = res;
|
ctx.body = res;
|
||||||
})
|
})
|
||||||
.addTo(app);
|
.addTo(app);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { User } from '../models/user.ts';
|
import { sequelize } from '../modules/sequelize.ts';
|
||||||
|
import { User, UserInit } from '../models/user.ts';
|
||||||
|
|
||||||
// User.sync({ alter: true, logging: true }).then(() => {
|
// User.sync({ alter: true, logging: true }).then(() => {
|
||||||
// console.log('sync user done');
|
// console.log('sync user done');
|
||||||
@ -10,3 +11,16 @@ import { User } from '../models/user.ts';
|
|||||||
// console.log('sync user done');
|
// console.log('sync user done');
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
export const main = async () => {
|
||||||
|
|
||||||
|
await UserInit(null, null, {
|
||||||
|
alter: true,
|
||||||
|
logging: false,
|
||||||
|
});
|
||||||
|
const user = await User.findAll({});
|
||||||
|
for (const u of user) {
|
||||||
|
console.log(u.username, u.type);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
main();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user