core&ui: drop graphql apis

This commit is contained in:
undefined authored and GitHub committed 2025-04-29 15:02:20 +01:00
1 parent 0f7961d675
commit 6e16d03f67
52 files changed
+485 -583

No files matched your search

@@ -43,7 +43,6 @@
height: 30px;
box-sizing: border-box;
padding: 4px 6px;
width: 100%;
min-width: 30px;
flex-grow: 1;
border: 0;
+5 -1
View File
@@ -3,6 +3,7 @@
"version": "1.0.0-beta.1",
"main": "./frontend/index.ts",
"dependencies": {
"allotment": "^1.20.3",
"diff": "^7.0.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
@@ -15,6 +16,9 @@
"@types/diff": "^7.0.2",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.17.16",
"sass": "^1.86.3"
"sass": "^1.87.0"
},
"peerDependencies": {
"schemastery": "*"
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@elastic/elasticsearch": "^8.18.0"
"@elastic/elasticsearch": "^8.18.2"
},
"engines": {
"hydrooj": ">=5.0.0-alpha.1"
+1 -4
View File
@@ -18,7 +18,6 @@
"@aws-sdk/s3-request-presigner": "3.726.1",
"@babel/code-frame": "^7.26.2",
"@cordisjs/plugin-timer": "1.1.1",
"@graphql-tools/schema": "^10.0.23",
"@hydrooj/common": "workspace:^",
"@hydrooj/framework": "workspace:^",
"@hydrooj/utils": "workspace:^",
@@ -32,8 +31,6 @@
"emoji-regex": "^10.4.0",
"emojis-list": "2.1.0",
"fs-extra": "^11.3.0",
"graphql": "^16.10.0",
"graphql-scalars": "^1.24.2",
"js-yaml": "^4.1.0",
"koa-proxies": "^0.12.4",
"koa-static-cache": "^5.1.4",
@@ -41,7 +38,7 @@
"lru-cache": "^10.4.3",
"mime-types": "^3.0.1",
"moment-timezone": "^0.5.48",
"mongodb": "^6.15.0",
"mongodb": "^6.16.0",
"mongodb-uri": "^0.9.7",
"nanoid": "^5.1.5",
"nodemailer": "^6.10.1",
-1
View File
@@ -49,7 +49,6 @@ export async function apply(ctx: Context) {
resolve(c);
});
});
await ctx.plugin(require('../service/api'));
require('../lib/index');
ctx.plugin(require('../service/monitor'));
-27
View File
@@ -742,33 +742,6 @@ export async function apply(ctx: Context) {
}
await Promise.all(tasks);
});
ctx.inject(['api'], ({ api }) => {
api.value('Contest', [
['_id', 'ObjectID!'],
['domainId', 'String!'],
['docId', 'ObjectID!'],
['owner', 'Int!'],
['beginAt', 'Date!'],
['title', 'String!'],
['content', 'String!'],
['beginAt', 'Date!'],
['endAt', 'Date!'],
['attend', 'Int!'],
['pids', '[Int]!'],
['rated', 'Boolean!'],
]);
api.resolver(
'Query', 'contest(id: ObjectID!)', 'Contest',
async (arg, c) => {
c.checkPerm(PERM.PERM_VIEW);
arg.id = new ObjectId(arg.id);
c.tdoc = await contest.get(c.args.domainId, new ObjectId(arg.id));
if (!c.tdoc) throw new ContestNotFoundError(c.args.domainId, arg.id);
return c.tdoc;
},
'Get a contest by ID',
);
});
ctx.plugin(ScoreboardService);
ctx.inject(['scoreboard'], ({ Route, scoreboard }) => {
Route('contest_scoreboard', '/contest/:tid/scoreboard', ContestScoreboardHandler, PERM.PERM_VIEW_CONTEST_SCOREBOARD);
+39 -30
View File
@@ -1,6 +1,7 @@
import { load } from 'js-yaml';
import { Dictionary } from 'lodash';
import moment from 'moment-timezone';
import Schema from 'schemastery';
import type { Context } from '../context';
import {
CannotDeleteSystemDomainError, DomainJoinAlreadyMemberError, DomainJoinForbiddenError, ForbiddenError,
@@ -17,7 +18,7 @@ import { DOMAIN_SETTINGS, DOMAIN_SETTINGS_BY_KEY } from '../model/setting';
import * as system from '../model/system';
import user from '../model/user';
import {
Handler, param, post, query, requireSudo, Types,
Handler, Mutation, param, post, Query, query, requireSudo, Types,
} from '../service/server';
import { log2 } from '../utils';
@@ -412,6 +413,42 @@ class DomainSearchHandler extends Handler {
}
}
export const DomainApi = {
domain: Query(
Schema.object({
id: Schema.string(),
}),
async (ctx, args) => {
const ddoc = args.id ? await domain.get(args.id) : ctx.domain;
if (!ddoc) return null;
const udoc = await user.getById(ddoc._id, ctx.user._id);
if (!udoc.hasPerm(PERM.PERM_VIEW) && !udoc.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) return null;
return ddoc;
},
),
'domain.group': Mutation(
Schema.object({
name: Schema.string().required(),
uids: Schema.array(Schema.number()),
}),
async (ctx, args) => {
if (!ctx.user.hasPerm(PERM.PERM_EDIT_DOMAIN)) throw new PermissionError(PERM.PERM_EDIT_DOMAIN);
if (args.uids) {
const res = await user.updateGroup(ctx.domain._id, args.name, args.uids);
return res.upsertedCount > 0;
}
const res = await user.delGroup(ctx.domain._id, args.name);
return res.deletedCount > 0;
},
),
} as const;
declare module '@hydrooj/framework' {
interface Apis {
domain: typeof DomainApi;
}
}
export async function apply(ctx: Context) {
ctx.Route('ranking', '/ranking', DomainRankHandler, PERM.PERM_VIEW_RANKING);
ctx.Route('domain_dashboard', '/domain/dashboard', DomainDashboardHandler);
@@ -424,34 +461,6 @@ export async function apply(ctx: Context) {
ctx.Route('domain_join', '/domain/join', DomainJoinHandler, PRIV.PRIV_USER_PROFILE);
ctx.Route('domain_search', '/domain/search', DomainSearchHandler, PRIV.PRIV_USER_PROFILE);
ctx.inject(['api'], ({ api }) => {
api.value('GroupInfo', [
['name', 'String!'],
['uids', '[Int]!'],
]);
api.resolver('Query', 'domain(id: String)', 'Domain', async (args, c) => {
const ddoc = args.id ? await domain.get(args.id) : c.domain;
if (!ddoc) return null;
const udoc = await user.getById(ddoc._id, c.user._id);
if (!udoc.hasPerm(PERM.PERM_VIEW) && !udoc.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) return null;
c.udoc = udoc;
return ddoc;
});
api.resolver('Domain', 'manage', 'DomainManage', async (args, c) => {
if (!c.udoc.hasPerm(PERM.PERM_EDIT_DOMAIN)) throw new PermissionError(PERM.PERM_EDIT_DOMAIN);
return c.parent;
});
api.resolver('DomainManage', 'group', 'DomainGroup', (args, c) => c.parent);
api.resolver(
'DomainGroup', 'list(uid: Int)', '[GroupInfo]',
(args, c) => user.listGroup(c.parent._id, args.uid),
);
api.resolver(
'DomainGroup', 'update(name: String!, uids: [Int]!)', 'Boolean',
async (args, c) => !!(await user.updateGroup(c.parent._id, args.name, args.uids)).upsertedCount,
);
api.resolver(
'DomainGroup', 'del(name: String!)', 'Boolean',
async (args, c) => !!(await user.delGroup(c.parent._id, args.name)).deletedCount,
);
api.provide(DomainApi);
});
}
+5 -2
View File
@@ -321,9 +321,12 @@ const allPriv = Math.sum(Object.values(Priv));
class SystemUserPrivHandler extends SystemHandler {
@requireSudo
async get() {
@param('extraIgnore', Types.NumericArray, true)
async get({ }, extraIgnore: number[] = []) {
const defaultPriv = system.get('default.priv');
const udocs = await user.getMulti({ _id: { $gte: -1000, $ne: 1 }, priv: { $nin: [0, defaultPriv] } }).limit(1000).sort({ _id: 1 }).toArray();
const udocs = await user.getMulti({
_id: { $gte: -1000, $ne: 1 }, priv: { $nin: [0, defaultPriv, ...extraIgnore] },
}).limit(1000).sort({ _id: 1 }).toArray();
const banudocs = await user.getMulti({ _id: { $gte: -1000, $ne: 1 }, priv: 0 }).limit(1000).sort({ _id: 1 }).toArray();
this.response.body = {
udocs: [...udocs, ...banudocs],
+35 -60
View File
@@ -8,6 +8,7 @@ import {
import { Filter, ObjectId } from 'mongodb';
import { nanoid } from 'nanoid';
import sanitize from 'sanitize-filename';
import Schema from 'schemastery';
import parser from '@hydrooj/utils/lib/search';
import { sortFiles, streamToBuffer } from '@hydrooj/utils/lib/utils';
import type { Context } from '../context';
@@ -34,7 +35,7 @@ import storage from '../model/storage';
import * as system from '../model/system';
import user from '../model/user';
import {
Handler, param, post, query, route, Types,
Handler, param, post, Query, query, route, Types,
} from '../service/server';
import { ContestDetailBaseHandler } from './contest';
@@ -1021,6 +1022,38 @@ export class ProblemCreateHandler extends Handler {
}
}
export const ProblemApi = {
problem: Query(
Schema.object({
id: Schema.union([Schema.number().step(1), Schema.string()]).required(),
domainId: Schema.string().required(),
}),
async (ctx, args) => {
const pdoc = await problem.get(args.domainId, args.id);
if (!pdoc) return null;
if (pdoc.hidden) ctx.checkPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
return pdoc;
},
),
problems: Query(
Schema.object({
ids: Schema.array(Schema.number().step(1)).required(),
domainId: Schema.string().required(),
}),
async (ctx, args) => {
const pdocs = await problem.getList(args.domainId, args.ids, ctx.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || ctx.user._id,
undefined, undefined, true);
return Object.keys(pdocs).map((id) => pdocs[+id]);
},
),
} as const;
declare module '@hydrooj/framework' {
interface Apis {
problem: typeof ProblemApi;
}
}
export async function apply(ctx: Context) {
ctx.Route('problem_main', '/p', ProblemMainHandler, PERM.PERM_VIEW_PROBLEM);
ctx.Route('problem_random', '/problem/random', ProblemRandomHandler, PERM.PERM_VIEW_PROBLEM);
@@ -1038,64 +1071,6 @@ export async function apply(ctx: Context) {
ctx.Route('problem_statistics', '/p/:pid/stat', ProblemStatisticsHandler, PERM.PERM_VIEW_PROBLEM);
ctx.Route('problem_create', '/problem/create', ProblemCreateHandler, PERM.PERM_CREATE_PROBLEM);
ctx.inject(['api'], ({ api }) => {
api.value('FileInfo', [
['_id', 'String!'],
['name', 'String!'],
['size', 'Int'],
['lastModified', 'Date'],
]);
api.value('Problem', [
['_id', 'ObjectID!'],
['owner', 'Int!'],
['domainId', 'String!'],
['docId', 'Int!'],
['docType', 'Int!'],
['pid', 'String'],
['title', 'String!'],
['content', 'String!'],
['data', '[FileInfo]'],
['additional_file', '[FileInfo]'],
['nSubmit', 'Int'],
['nAccept', 'Int'],
['difficulty', 'Int'],
['tag', '[String]'],
['hidden', 'Boolean'],
]);
api.resolver(
'Query', 'problem(id: Int, pid: String)', 'Problem',
async (arg, c) => {
c.checkPerm(PERM.PERM_VIEW);
const pdoc = await problem.get(c.args.domainId, arg.pid || arg.id);
if (!pdoc) return null;
if (pdoc.hidden) c.checkPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
c.pdoc = pdoc;
return pdoc;
},
);
api.resolver('Query', 'problems(ids: [Int])', '[Problem]', async (arg, c) => {
c.checkPerm(PERM.PERM_VIEW);
const res = await problem.getList(c.args.domainId, arg.ids, c.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || c.user._id,
undefined, undefined, true);
return Object.keys(res).map((id) => res[+id]);
}, 'Get a list of problem by ids');
api.resolver(
'Problem', 'manage', 'ProblemManage',
(arg, c) => {
if (!c.user.own(c.pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) c.checkPerm(PERM.PERM_EDIT_PROBLEM);
return {};
},
);
api.resolver(
'ProblemManage', 'delete', 'Boolean!',
async (arg, c) => {
const tdocs = await contest.getRelated(c.args.domainId, c.pdoc.docId);
if (tdocs.length) throw new ProblemAlreadyUsedByContestError(c.pdoc.docId, tdocs[0]._id);
return problem.del(c.pdoc.domainId, c.pdoc.docId);
},
);
api.resolver(
'ProblemManage', 'edit(title: String, content: String, tag: [String], hidden: Boolean)', 'Problem!',
(arg, c) => problem.edit(c.args.domainId, c.pdoc.docId, arg),
);
api.provide(ProblemApi);
});
}
+64 -56
View File
@@ -2,6 +2,7 @@ import { generateAuthenticationOptions, verifyAuthenticationResponse } from '@si
import { isoBase64URL } from '@simplewebauthn/server/helpers';
import moment from 'moment-timezone';
import type { Binary } from 'mongodb';
import Schema from 'schemastery';
import type { Context } from '../context';
import {
AuthOperationError, BadRequestError, BlacklistedError, BuiltinLoginError,
@@ -25,7 +26,7 @@ import * as system from '../model/system';
import token from '../model/token';
import user, { deleteUserCache } from '../model/user';
import {
Handler, param, post, Types,
Handler, param, post, Query, Types,
} from '../service/server';
async function successfulAuth(this: Handler, udoc: User) {
@@ -515,6 +516,67 @@ class ContestModeHandler extends Handler {
export const inject = ['oauth'];
const UserApi = {
user: Query(Schema.object({
id: Schema.number().step(1),
uname: Schema.string(),
mail: Schema.string(),
domainId: Schema.string().required(),
}), (c, arg) => {
if (arg.id) return user.getById(arg.domainId, arg.id);
if (arg.mail) return user.getByEmail(arg.domainId, arg.mail);
if (arg.uname) return user.getByUname(arg.domainId, arg.uname);
return c.user;
}),
users: Query(Schema.object({
ids: Schema.array(Schema.number().step(1)),
auto: Schema.array(Schema.string()),
search: Schema.string(),
limit: Schema.number().step(1),
exact: Schema.boolean(),
}), async (c, arg) => {
const auto = (arg.ids?.length && arg.ids) || arg.auto || [];
if (auto.length) {
const maybeId = auto.filter((i) => !Number.isNaN(+i));
const result = [];
if (maybeId.length) {
const udocs = await user.getList(arg.domainId, maybeId.map((i) => +i));
for (const i in udocs) udocs[i].avatarUrl = avatar(udocs[i].avatar);
result.push(...Object.values(udocs));
}
const notFound = auto.filter((i) => !result.find((j) => j._id === +i));
if (notFound.length > 50) return result; // reject if too many
for (const i of notFound) {
// eslint-disable-next-line no-await-in-loop
const udoc = await user.getByUname(arg.domainId, i.toString()) || await user.getByEmail(arg.domainId, i.toString());
if (udoc) result.push(udoc);
}
return result;
}
if (!arg.search) return [];
const udoc = await user.getById(arg.domainId, +arg.search)
|| await user.getByUname(arg.domainId, arg.search)
|| await user.getByEmail(arg.domainId, arg.search);
const udocs: User[] = arg.exact
? []
: await user.getPrefixList(arg.domainId, arg.search, Math.min(arg.limit || 10, 10));
if (udoc && !udocs.find((i) => i._id === udoc._id)) {
udocs.pop();
udocs.unshift(udoc);
}
for (const i in udocs) {
udocs[i].avatarUrl = avatar(udocs[i].avatar);
}
return udocs;
}),
} as const;
declare module '@hydrooj/framework' {
interface Apis {
user: typeof UserApi;
}
}
export async function apply(ctx: Context) {
ctx.Route('user_login', '/login', UserLoginHandler);
ctx.Route('user_oauth', '/oauth/:type', OauthHandler);
@@ -544,60 +606,6 @@ export async function apply(ctx: Context) {
},
});
ctx.inject(['api'], ({ api }) => {
api.value('User', [
['_id', 'Int!'],
['uname', 'String!'],
['mail', 'String!'],
['perm', 'String'],
['role', 'String'],
['loginat', 'Date'],
['regat', 'Date!'],
['priv', 'Int!', 'User Privilege'],
['avatarUrl', 'String'],
['displayName', 'String @if(perm: "PERM_VIEW_DISPLAYNAME")'],
['rpInfo', 'JSONObject'],
]);
api.resolver('Query', 'user(id: Int, uname: String, mail: String)', 'User', (arg, c) => {
if (arg.id) return user.getById(c.args.domainId, arg.id);
if (arg.mail) return user.getByEmail(c.args.domainId, arg.mail);
if (arg.uname) return user.getByUname(c.args.domainId, arg.uname);
return c.user;
}, `Get a user by id, uname, or mail.
Returns current user if no argument is provided.`);
api.resolver('Query', 'users(ids: [Int], auto: [String], search: String, limit: Int, exact: Boolean)', '[User]', async (arg, c) => {
const auto = arg.ids || arg.auto || [];
if (auto.length) {
const maybeId = auto.filter((i) => !Number.isNaN(+i));
const result = [];
if (maybeId.length) {
const udocs = await user.getList(c.args.domainId, maybeId.map((i) => +i));
for (const i in udocs) udocs[i].avatarUrl = avatar(udocs[i].avatar);
result.push(...Object.values(udocs));
}
const notFound = auto.filter((i) => !result.find((j) => j._id === +i));
if (notFound.length > 50) return result; // reject if too many
for (const i of notFound) {
// eslint-disable-next-line no-await-in-loop
const udoc = await user.getByUname(c.args.domainId, i) || await user.getByEmail(c.args.domainId, i);
if (udoc) result.push(udoc);
}
return result;
}
if (!arg.search) return [];
const udoc = await user.getById(c.args.domainId, +arg.search)
|| await user.getByUname(c.args.domainId, arg.search)
|| await user.getByEmail(c.args.domainId, arg.search);
const udocs: User[] = arg.exact
? []
: await user.getPrefixList(c.args.domainId, arg.search, Math.min(arg.limit || 10, 10));
if (udoc && !udocs.find((i) => i._id === udoc._id)) {
udocs.pop();
udocs.unshift(udoc);
}
for (const i in udocs) {
udocs[i].avatarUrl = avatar(udocs[i].avatar);
}
return udocs;
}, 'Get a list of user by ids, or search users with the prefix.');
api.provide(UserApi);
});
}
+1 -1
View File
@@ -784,7 +784,7 @@ export async function add(
RULES[rule].check(data);
await bus.parallel('contest/before-add', data);
const docId = await document.add(domainId, content, owner, document.TYPE_CONTEST, null, null, null, {
...data, title, rule, beginAt, endAt, pids, attend: 0, rated,
assign: [], ...data, title, rule, beginAt, endAt, pids, attend: 0, rated,
});
await bus.parallel('contest/add', data, docId);
return docId;
+6 -1
View File
@@ -1,12 +1,13 @@
/* eslint-disable max-len */
/* eslint-disable no-await-in-loop */
import fs from 'fs';
import * as cordis from 'cordis';
import yaml from 'js-yaml';
import { Dictionary } from 'lodash';
import moment from 'moment-timezone';
import Schema from 'schemastery';
import { LangConfig, parseLang } from '@hydrooj/common';
import { retry } from '@hydrooj/utils';
import { findFileSync, retry } from '@hydrooj/utils';
import { Context, Service } from '../context';
import { Setting as _Setting } from '../interface';
import { Logger } from '../logger';
@@ -14,6 +15,8 @@ import * as builtin from './builtin';
type SettingDict = Dictionary<_Setting>;
const settingFile = yaml.load(fs.readFileSync(findFileSync('hydrooj/setting.yaml'), 'utf-8')) as any;
const logger = new Logger('model/setting');
const countries = moment.tz.countries();
const tzs = new Set();
@@ -344,6 +347,8 @@ SystemSetting(
Setting('setting_basic', 'pagination.solution', 20, 'number', 'pagination.solution', 'Solutions per page'),
Setting('setting_basic', 'pagination.training', 10, 'number', 'pagination.training', 'Trainings per page'),
Setting('setting_basic', 'pagination.reply', 50, 'number', 'pagination.reply', 'Replies per page'),
Setting('setting_basic', 'hydrooj.homepage', settingFile.homepage.default, 'yaml', 'hydrooj.homepage', 'Homepage config'),
Setting('setting_basic', 'hydrooj.langs', settingFile.langs.default, 'yaml', 'hydrooj.langs', 'Language config'),
Setting('setting_session', 'session.keys', [String.random(32)], 'text', 'session.keys', 'session.keys', FLAG_HIDDEN),
Setting('setting_session', 'session.domain', '', 'text', 'session.domain', 'session.domain', FLAG_HIDDEN),
Setting('setting_session', 'session.saved_expire_seconds', 3600 * 24 * 30,
-1
View File
@@ -55,4 +55,3 @@ export { db, pwsh };
// to load services into to context
export { } from './handler/contest';
export { } from './service/api';
-202
View File
@@ -1,202 +0,0 @@
import { makeExecutableSchema } from '@graphql-tools/schema';
import { getDirective, MapperKind, mapSchema } from '@graphql-tools/utils';
import { defaultFieldResolver, graphql, GraphQLSchema } from 'graphql';
import { resolvers, typeDefs } from 'graphql-scalars';
import { debounce } from 'lodash';
import { Context, Service } from '../context';
import { PERM, PRIV } from '../model/builtin';
import { Handler } from './server';
const types: Record<string, Record<string, string>> = Object.create(null);
const unions: Record<string, string> = Object.create(null);
const descriptions: Record<string, Record<string, string>> = Object.create(null);
const handlers: Record<string, Record<string, any>> = {
Query: Object.create(null),
};
const root: Record<string, any> = handlers.Query;
interface ApiContext extends ApiHandler {
[key: string]: any;
}
declare module '../context' {
interface Context {
api: ApiService;
}
}
function setDescription(desc: string) {
if (desc.includes('\n')) return ['"""', desc, '"""'].join('\n');
return JSON.stringify(desc);
}
let schema: GraphQLSchema;
let schemaStr = '';
const applyAuthDirective = (s) => mapSchema(s, {
// eslint-disable-next-line consistent-return
[MapperKind.OBJECT_FIELD]: (fieldConfig) => {
const authDirective = getDirective(s, fieldConfig, 'auth')?.[0];
if (authDirective) {
const { resolve = defaultFieldResolver } = fieldConfig;
return {
...fieldConfig,
async resolve(source, args, context, info) {
if (authDirective.perm) {
const perm = PERM[authDirective.perm];
if (!context.user.hasPerm(perm)) throw new Error(`Permission denied: ${authDirective.perm}`);
}
if (authDirective.priv) {
const priv = PRIV[authDirective.priv];
if (!context.user.hasPriv(priv)) throw new Error(`Permission denied: ${authDirective.priv}`);
}
return await resolve(source, args, context, info);
},
};
}
const ifDirective = getDirective(s, fieldConfig, 'if')?.[0];
if (ifDirective) {
const { resolve = defaultFieldResolver } = fieldConfig;
return {
...fieldConfig,
async resolve(source, args, context, info) {
if (ifDirective.perm && !context.user.hasPerm(PERM[ifDirective.perm])) return null;
if (ifDirective.priv && !context.user.hasPriv(PRIV[ifDirective.priv])) return null;
return await resolve(source, args, context, info);
},
};
}
},
});
class ApiHandler extends Handler {
category = '#api';
// FIXME: adding PERM_VIEW check will break omnibar search
query(q: string, variables: any) {
return graphql({
schema,
source: q,
rootValue: root,
contextValue: this,
variableValues: variables,
});
}
async get() {
const q = decodeURIComponent(this.request.querystring);
if (q === 'schema') {
this.response.type = 'application/json';
this.response.body = { schema: schemaStr };
} else if (q) {
this.response.type = 'application/json';
this.response.body = await this.query(q, {});
} else this.response.template = 'api.html';
}
async post() {
this.response.type = 'application/json';
this.response.body = await this.query(this.args.query, this.args.variables);
}
}
// TODO support dispose
class ApiService extends Service {
constructor(ctx: Context) {
super(ctx, 'api');
this.rebuild = debounce(this.rebuild.bind(this), 500, { trailing: true });
this.rebuild();
}
private rebuild() {
try {
const defs = [
...Object.keys(unions).map((i) => `union ${i} = ${unions[i]}`),
'directive @auth(perm: String, priv: String) on FIELD_DEFINITION',
'directive @if(perm: String, priv: String) on FIELD_DEFINITION',
...typeDefs,
...Object.keys(types).map((key) => {
let def = '';
if (descriptions[key]?._description) def += `${setDescription(descriptions[key]._description)}\n`;
def += `type ${key} {\n`;
for (const k in types[key]) {
if (descriptions[key]?.[k]) def += ` ${setDescription(descriptions[key][k])}\n`;
def += ` ${k}: ${types[key][k]}\n`;
}
def += '}\n';
return def;
}),
];
schema = makeExecutableSchema({
typeDefs: defs,
resolvers,
});
schema = applyAuthDirective(schema);
schemaStr = defs.join('\n');
} catch (e) {
console.error(e);
}
this.ctx.emit('api/update');
}
value(typeName: string, key: string, value: string, description?: string): void;
value(typeName: string, vals: [string, string, string?][]): void;
value(typeName: string, arg1: [string, string, string?][] | string, value?: string, description?: string) {
if (typeof arg1 === 'string') arg1 = [[arg1, value!, description]];
for (const [k, v, d] of arg1) {
if (!types[typeName]) types[typeName] = { [k]: v };
else types[typeName][k] = v;
if (d) {
if (!descriptions[typeName]) descriptions[typeName] = { [k]: d };
else descriptions[typeName][k] = d;
}
}
this.rebuild();
}
resolver(
typeName: string, key: string, value: string,
func: (args: any, ctx: ApiContext, info: any) => any,
description?: string,
) {
this.value(typeName, key, value, description);
const wrappedFunc = async (arg, ctx, info) => {
const res = await func(arg, ctx, info);
if (typeof res !== 'object' || res === null) return res;
let node = value.includes('!') ? value.split('!')[0] : value;
const isArray = node.includes('[');
node = node.replace('[', '').replace(']', '');
if (handlers[node]) {
if (!isArray) Object.assign(res, handlers[node]);
else if (res instanceof Array) for (const i of res) { Object.assign(i, handlers[node]); }
}
ctx.parent = res;
return res;
};
handlers[typeName] ||= {};
handlers[typeName][key.split('(')[0].trim()] = wrappedFunc;
this.rebuild();
}
union(typeName: string, ...unionTypes: string[]) {
unions[typeName] = unionTypes.join(' | ');
this.rebuild();
}
query(query: string, args: Record<string, any>) {
return graphql({
schema,
source: query,
rootValue: root,
contextValue: this,
variableValues: args,
});
}
}
export const sideEffect = true;
export const inject = ['server', 'setting'];
export function apply(ctx: Context) {
ctx.plugin(ApiService);
ctx.Route('api', '/api', ApiHandler);
}
+4 -1
View File
@@ -4,7 +4,7 @@ import fs from 'fs-extra';
import cache from 'koa-static-cache';
import { type FindCursor, ObjectId } from 'mongodb';
import {
ConnectionHandler as ConnectionHandlerOriginal,
applyApiHandler, ConnectionHandler as ConnectionHandlerOriginal,
Handler as HandlerOriginal, HydroError, NotFoundError, UserFacingError,
WebService,
} from '@hydrooj/framework';
@@ -41,6 +41,7 @@ declare module '@hydrooj/framework' {
export * from '@hydrooj/framework/decorators';
export * from '@hydrooj/framework/validator';
export { Query, Mutation } from '@hydrooj/framework/api';
/*
* For security concern, some API requires sudo privilege to access.
@@ -106,6 +107,8 @@ export async function apply(ctx: Context) {
}
});
applyApiHandler(ctx, 'api', '/api/:op');
for (const addon of [...Object.values(global.addons)].reverse()) {
const dir = resolve(addon, 'public');
if (!fs.existsSync(dir)) continue;
+2 -2
View File
@@ -6,8 +6,8 @@
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0-or-later",
"dependencies": {
"mariadb": "^3.4.1",
"mongodb": "^6.15.0",
"mariadb": "^3.4.2",
"mongodb": "^6.16.0",
"turndown": "^7.2.0",
"xml2js": "^0.6.2"
},
+9 -3
View File
@@ -276,10 +276,16 @@ export async function run({
const pdocs = tdoc.problems.split('|').map((i) => i.trim());
const pids = pdocs.map((i) => pidMap[i]).filter((i) => i);
const admin = uidMap[tdoc.holder_id] || uidMap[tdoc.admins.split('|')[0]];
const startAt = new Date(tdoc.start_time * 1000);
let endAt = new Date(tdoc.end_time * 1000);
if (startAt >= endAt) {
report({ message: `Invalid contest time: ${tdoc.title} ${tdoc.start_time} ${tdoc.end_time}` });
endAt = new Date(startAt.getTime() + 5000);
}
const tid = await ContestModel.add(
domainId, tdoc.title, `${tdoc.subtitle ? `#### ${tdoc.subtitle}\n` : ''}${tdoc.information || 'No Description'}`,
admin, contentTypeMap[tdoc.type], new Date(tdoc.start_time * 1000), new Date(tdoc.end_time * 1000),
pids, ratedTids.includes(tdoc.id), { maintainer: tdoc.admins.split('|').map((i) => uidMap[i]) },
admin, contentTypeMap[tdoc.type], startAt, endAt,
pids, ratedTids.includes(tdoc.id), { maintainer: tdoc.admins.split('|').map((i) => uidMap[i]), assign: [] },
);
tidMap[tdoc.id] = tid.toHexString();
}
@@ -461,7 +467,7 @@ export async function run({
`spj.${langMap[syzojConfig.specialJudge.language]}`, `${dataDir}/testdata/${file.name}/${syzojConfig.specialJudge.fileName}`);
config.checker = `spj.${langMap[syzojConfig.specialJudge.language]}`;
}
if (syzojConfig.subtasks) {
if (syzojConfig.subtasks && syzojConfig.inputFile && syzojConfig.outputFile) {
config.subtasks = syzojConfig.subtasks.map((subtask, index) => ({
score: subtask.score,
id: index + 1,
+2 -2
View File
@@ -134,7 +134,8 @@ export default async function (env: { watch?: boolean, production?: boolean, mea
extensions: ['.js', '.jsx', '.ts', '.tsx', '.cjs'],
alias: {
vj: root(),
'graphql-ws': root('../../modules/nop.ts'),
'react/jsx-runtime': require.resolve('react/jsx-runtime'),
react: require.resolve('react'),
},
},
module: {
@@ -291,7 +292,6 @@ export default async function (env: { watch?: boolean, production?: boolean, mea
{ from: root('components/navigation/nav-logo-small_dark.png'), to: 'components/navigation/nav-logo-small_dark.png' },
{ from: root(`${dirname(require.resolve('streamsaver/package.json'))}/mitm.html`), to: 'streamsaver/mitm.html' },
{ from: root(`${dirname(require.resolve('streamsaver/package.json'))}/sw.js`), to: 'streamsaver/sw.js' },
{ from: root(`${dirname(require.resolve('graphiql/package.json'))}/graphiql.min.css`), to: 'graphiql.min.css' },
{ from: `${dirname(require.resolve('monaco-themes/package.json'))}/themes`, to: 'monaco/themes/' },
],
}),
@@ -2,7 +2,7 @@ import { AutoComplete, AutoCompleteHandle, AutoCompleteProps } from '@hydrooj/co
import type { ProblemDoc } from 'hydrooj/src/interface';
import PropTypes from 'prop-types';
import React, { forwardRef } from 'react';
import { api, gql, request } from 'vj/utils';
import { api, request } from 'vj/utils';
const ProblemSelectAutoComplete = forwardRef<AutoCompleteHandle<ProblemDoc>, AutoCompleteProps<ProblemDoc>>((props, ref) => (
<AutoComplete<ProblemDoc>
@@ -12,13 +12,7 @@ const ProblemSelectAutoComplete = forwardRef<AutoCompleteHandle<ProblemDoc>, Aut
const { pdocs } = await request.get(`/d/${UiContext.domainId}/p`, { q: query, quick: true });
return pdocs;
}}
fetchItems={(ids) => api(gql`
problems(ids: ${ids.map((i) => +i)}) {
docId
pid
title
}
`, ['data', 'problems'])}
fetchItems={(ids) => api('problems', { ids: ids.map((i) => +i) }, ['docId', 'pid', 'title'])}
itemText={(pdoc) => `${`${pdoc.docId} ${pdoc.title}`}`}
itemKey={(pdoc) => `${pdoc.docId || pdoc}`}
renderItem={(pdoc) => (
@@ -2,27 +2,14 @@ import { AutoComplete, AutoCompleteHandle, AutoCompleteProps } from '@hydrooj/co
import type { Udoc } from 'hydrooj/src/interface';
import PropTypes from 'prop-types';
import { forwardRef } from 'react';
import { api, gql } from 'vj/utils';
import { api } from 'vj/utils';
const UserSelectAutoComplete = forwardRef<AutoCompleteHandle<Udoc>, AutoCompleteProps<Udoc>>((props, ref) => (
<AutoComplete<Udoc>
ref={ref as any}
cacheKey="user"
queryItems={(query) => api(gql`
users(search: ${query}) {
_id
uname
displayName
avatarUrl
}
`, ['data', 'users'])}
fetchItems={(ids) => api(gql`
users(auto: ${ids}) {
_id
uname
displayName
}
`, ['data', 'users'])}
queryItems={(query) => api('users', { search: query }, ['_id', 'uname', 'displayName', 'avatarUrl'])}
fetchItems={(ids) => api('users', { auto: ids }, ['_id', 'uname', 'displayName'])}
itemText={(user) => user.uname + (user.displayName ? ` (${user.displayName})` : '')}
itemKey={(user) => ((props.multi || /^[+-]?\d+$/.test(user.uname.trim())) ? user._id.toString() : user.uname)}
renderItem={(user) => (
@@ -16,6 +16,7 @@ const mapStateToProps = (state) => ({
: null,
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps)(class MessagePadDialogueContentContainer extends React.PureComponent {
componentDidMount() {
$(this.refs.list).scrollLock({ strict: true });
@@ -21,6 +21,7 @@ const mapDispatchToProps = (dispatch) => ({
},
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps, mapDispatchToProps)(class MessagePadDialogueListContainer extends React.PureComponent {
componentDidMount() {
$(this.refs.list).scrollLock({ strict: true });
@@ -42,6 +42,7 @@ const mapDispatchToProps = (dispatch) => ({
},
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps, mapDispatchToProps)(class MessagePadInputContainer extends React.PureComponent {
static contextTypes = {
store: PropTypes.object,
@@ -16,6 +16,7 @@ const mapDispatchToProps = (dispatch) => ({
},
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(null, mapDispatchToProps)(class MessagePadContainer extends React.PureComponent {
static propTypes = {
onAdd: PropTypes.func.isRequired,
@@ -2,7 +2,7 @@ import keyword from 'emojis-keywords';
import list from 'emojis-list';
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import qface from 'qface';
import { api, gql } from 'vj/utils';
import { api } from 'vj/utils';
function emoji(range) {
return keyword.map((i, index) => ({
@@ -40,12 +40,7 @@ monaco.languages.registerCodeLensProvider('markdown', {
dispose: () => { },
};
}
const { data } = await api(gql`
users(ids: ${users.map((i) => +i.matches[1])}) {
_id
uname
}
`);
const data = await api('users', { ids: users.map((i) => +i.matches[1]) }, ['_id', 'uname']);
return {
lenses: users.map((i, index) => ({
range: i.range,
@@ -53,7 +48,7 @@ monaco.languages.registerCodeLensProvider('markdown', {
command: {
id: 'hydro.openUserPage',
arguments: [i.matches[1]],
title: `@${data.users.find((doc) => doc._id.toString() === i.matches[1])?.uname || i.matches[1]}`,
title: `@${data.find((doc) => doc._id.toString() === i.matches[1])?.uname || i.matches[1]}`,
},
})),
dispose: () => { },
@@ -82,14 +77,7 @@ monaco.languages.registerCompletionItemProvider('markdown', {
endColumn: word.endColumn,
};
if (prefix === '@') {
const users = await api(gql`
users(search: ${word.word}) {
_id
uname
avatarUrl
priv
}
`, ['data', 'users']);
const users = await api('users', { search: word.word }, ['_id', 'uname']);
return {
suggestions: users.map((i) => ({
label: { label: `@${i.uname}`, description: `UID=${i._id}` },
@@ -4,7 +4,7 @@ import ReactDOM from 'react-dom/client';
import { STATUS_CODES } from 'vj/constant/record';
import { AutoloadPage } from 'vj/misc/Page';
import {
api, gql, i18n, request,
api, i18n, request,
} from 'vj/utils';
export default new AutoloadPage('omnibar', () => {
@@ -92,14 +92,7 @@ export default new AutoloadPage('omnibar', () => {
setSearching?.(true);
[{ pdocs, psdict }, udocs] = await Promise.all([
request.get(`/d/${UiContext.domainId}/p`, { q: query, limit: 10 }),
api(gql`
users(search: ${query}) {
_id
uname
displayName
avatarUrl
}
`, ['data', 'users']),
api('users', { search: query }, ['_id', 'uname', 'displayName', 'avatarUrl']),
]);
setSearching?.(false);
}
@@ -17,8 +17,8 @@ export function AddTestcase() {
const [autoOutput, setAutoOutput] = React.useState(true);
const testdata = useSelector((state: RootState) => state.testdata);
const store = useStore<RootState>();
const refInput = useRef();
const refOutput = useRef();
const refInput = useRef(null);
const refOutput = useRef(null);
useEffect(() => {
const inputValid = testdata.find((i) => i.name === input);
@@ -13,6 +13,7 @@ interface ScratchpadOptions {
commandDone?: () => void;
}
// eslint-disable-next-line react-refresh/only-export-components
export default connect((state: any) => ({
value: state.editor.code,
language: window.LANGS[state.editor.lang]?.monaco,
@@ -27,6 +27,7 @@ const mapDispatchToProps = (dispatch) => ({
},
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadPretestContainer extends React.PureComponent {
render() {
return (
@@ -11,6 +11,7 @@ const mapStateToProps = (state) => ({
isLoading: state.ui.records.isLoading,
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps)(class ScratchpadRecordsContainer extends React.PureComponent {
render() {
const cn = classNames('data-table is--full-row scratchpad__records__table', {
@@ -46,6 +46,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => ({
data: stateProps.items[ownProps.id],
});
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps, null, mergeProps)(class ScratchpadRecordsRowContainer extends React.PureComponent {
handleRowClick(ev, id) {
const url = substitute(
@@ -73,6 +73,7 @@ const mapDispatchToProps = (dispatch) => ({
const availableLangs = getAvailableLangs(UiContext.pdoc.config.langs);
const keys = Object.keys(availableLangs);
// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadToolbarContainer extends React.PureComponent {
static contextTypes = {
store: PropTypes.object,
@@ -4,7 +4,7 @@ import PQueue from 'p-queue';
import streamsaver from 'streamsaver';
import Notification from 'vj/components/notification';
import {
api, createZipStream, gql, i18n, pipeStream, request,
api, createZipStream, i18n, pipeStream, request,
} from 'vj/utils';
import { ctx } from '../../context';
@@ -94,23 +94,21 @@ export async function downloadProblemSet(pids, name = 'Export') {
try {
await ctx.serial('problemset/download', pids, name, targets);
for (const pid of pids) {
const pdoc = await api(gql`
problem(id: ${+pid}) {
pid
owner
title
content
tag
nSubmit
nAccept
data {
name
}
additional_file {
name
}
}
`, ['data', 'problem']);
const pdoc = await api('problem', { id: +pid }, {
pid: 1,
owner: 1,
title: 1,
content: 1,
tag: 1,
nSubmit: 1,
nAccept: 1,
data: {
name: 1,
},
additional_file: {
name: 1,
},
});
targets.push({
filename: `${pid}/problem.yaml`,
content: dump({
+4 -5
View File
@@ -11,7 +11,7 @@
"cli": false
},
"devDependencies": {
"@blueprintjs/core": "^5.18.0",
"@blueprintjs/core": "^5.19.0",
"@fontsource/dm-mono": "^5.2.5",
"@fontsource/fira-code": "^5.2.5",
"@fontsource/inconsolata": "^5.2.5",
@@ -21,7 +21,7 @@
"@fontsource/source-code-pro": "^5.2.5",
"@fontsource/ubuntu-mono": "^5.2.5",
"@hydrooj/utils": "workspace:^",
"@sentry/browser": "^9.13.0",
"@sentry/browser": "^9.14.0",
"@sentry/webpack-plugin": "^3.3.1",
"@simplewebauthn/browser": "13.1.0",
"@svgr/webpack": "^8.1.0",
@@ -60,7 +60,6 @@
"emojis-list": "2.1.0",
"esbuild-loader": "^4.3.0",
"flatpickr": "^4.6.13",
"graphiql": "^3.8.3",
"idb": "^8.0.2",
"jquery": "^3.7.1",
"jquery-scroll-lock": "^3.1.3",
@@ -99,7 +98,7 @@
"redux-promise-middleware": "^6.2.0",
"redux-thunk": "^3.1.0",
"rupture": "^0.7.1",
"sass": "^1.86.3",
"sass": "^1.87.0",
"sass-loader": "^16.0.5",
"schemastery": "^3.16.1",
"schemastery-react": "^0.1.2",
@@ -116,7 +115,7 @@
"timeago.js": "^4.0.2",
"ts-loader": "^9.5.2",
"web-streams-polyfill": "^4.1.0",
"webpack": "^5.99.6",
"webpack": "^5.99.7",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-dev-server": "^5.2.1",
"webpack-manifest-plugin": "^5.0.1",
-10
View File
@@ -1,10 +0,0 @@
.graphiql-container .doc-explorer-title, .graphiql-container .history-title
overflow: hidden;
padding: 5px 40px 0px 0px !important
.graphiql-container .docExplorerWrap
font-family: var(--code-font-family) !important
.graphiql-container .doc-explorer-back
overflow: hidden;
padding: 8px 20px 0px 20px !important
-29
View File
@@ -1,29 +0,0 @@
import { pick } from 'lodash';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { NamedPage } from 'vj/misc/Page';
import { request } from 'vj/utils';
const defaultQuery = `\
query Example(
$name: String!
) {
user(uname: $name) {
_id
uname
}
}`;
export default new NamedPage('api', async () => {
const { GraphiQL } = await import('graphiql');
GraphiQL.Logo = function () {
return <p></p>;
} as any;
createRoot(document.getElementById('main')!).render(
<GraphiQL
fetcher={(body, opts = {}) => request.post(`/d/${UiContext.domain._id}/api`, body, pick(opts, 'headers'))}
defaultQuery={defaultQuery}
variables='{"name": "Hydro"}'
/>,
);
});
+9 -12
View File
@@ -5,22 +5,19 @@ import { ActionDialog, ConfirmDialog } from 'vj/components/dialog';
import Notification from 'vj/components/notification';
import { NamedPage } from 'vj/misc/Page';
import {
api, delay, gql, i18n, tpl,
api, delay, i18n, tpl,
} from 'vj/utils';
function update(name: string, uids: number[]) {
return api(gql`
domain { manage { group {
update(name: ${name}, uids: ${uids})
} } }
`);
function update(name: string, uids: number[] = []) {
return api('domain.group', {
name,
uids,
}, []);
}
function del(name: string) {
return api(gql`
domain { manage { group {
del(name: ${name})
} } }
`);
return api('domain.group', {
name,
}, []);
}
const page = new NamedPage('domain_group', () => {
@@ -5,7 +5,7 @@ import VjNotification from 'vj/components/notification';
import selectUser from 'vj/components/selectUser';
import { ctx, Service } from 'vj/context';
import { NamedPage } from 'vj/misc/Page';
import { api, gql, loadReactRedux } from 'vj/utils';
import { api, loadReactRedux } from 'vj/utils';
class MessagePadService extends Service {
WebSocket: typeof import('../components/socket').default;
@@ -91,14 +91,10 @@ const page = new NamedPage('home_messages', () => {
async function loadSendTarget() {
const target = new URL(window.location.href).searchParams.get('target');
if (!target) return;
const user = await api(gql`
users(search: ${target}, exact: true) {
_id
uname
avatarUrl
mail
}
`, ['data', 'users']);
const user = await api(
'users', { search: target, exact: true },
['_id', 'uname', 'avatarUrl', 'mail'],
);
if (!user?.length) return;
createDialog(user[0]);
}
-10
View File
@@ -1,10 +0,0 @@
{% extends "layout/basic.html" %}
{% block content %}
<div style="height: 90vh" id="main"></div>
<style>
#main {
font-family: var(--code-font-family)
}
</style>
<link href="/graphiql.min.css" rel="stylesheet" />
{% endblock %}
@@ -23,7 +23,6 @@
</h1>
<div class="footer__category__expander"><ul class="footer__category__list">
<li class="footer__category__item"><a href="https://github.com/hydro-dev/Hydro" target="_blank">{{ _('Open Source') }}</a></li>
<li class="footer__category__item"><a href="{{ url('api') }}">{{ _('API') }}</a></li>
</ul></div>
</div>
<div class="medium-3 large-2 columns footer__category expandable end">
+3 -1
View File
@@ -8,7 +8,9 @@
<div class="section__body no-padding">
<div data-fragment-id="ranking">
{% if not udocs.length %}
<blockquote class="note">{{ _('The ranking page is not updated realtime.') }}</blockquote>
{% if page == 1 %}
<blockquote class="note">{{ _('The ranking page is not updated realtime.') }}</blockquote>
{% endif %}
{{ nothing.render('Sorry, there are no users in this domain.') }}
{% else %}
<table class="data-table">
+4 -23
View File
@@ -2,30 +2,11 @@ import 'streamsaver/examples/zip-stream';
import { request } from './base';
export async function api(q: string, path: string[] = []) {
let query = q.trim();
if (!query.startsWith('query')) query = `query{${query}}`;
const res = await request.post(`/d/${UiContext.domainId}/api`, { query });
if (res.errors) throw new Error(res.errors[0].message);
let cursor = res;
for (const p of path) {
cursor = cursor[p];
if (!cursor) return undefined;
}
return cursor;
}
export const gql = (
pieces: TemplateStringsArray,
...templates: (string | number | string[] | number[])[]
) => {
let res = '';
for (let i = 0; i < pieces.length; i++) {
res += pieces[i];
if (templates[i]) res += JSON.stringify(templates[i]);
}
export async function api(method: string, args: Record<string, any>, projection: any) {
const res = await request.post(`/d/${UiContext.domainId}/api/${encodeURIComponent(method)}`, { args, projection });
if (res.error) throw new Error(res.error);
return res;
};
}
export function getAvailableLangs(langsList?: string[]) {
const prefixes = new Set(Object.keys(window.LANGS).filter((i) => i.includes('.')).map((i) => i.split('.')[0]));
+1 -1
View File
@@ -16,6 +16,6 @@
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react-swc": "^3.9.0",
"vite": "^6.3.2"
"vite": "^6.3.3"
}
}
+1 -1
View File
@@ -13,7 +13,7 @@
"fs-extra": "^11.3.0",
"js-yaml": "^4.1.0",
"moment-timezone": "^0.5.48",
"mongodb": "^6.15.0",
"mongodb": "^6.16.0",
"reggol": "^2.1.0",
"search-query-parser": "^1.6.0",
"systeminformation": "^5.25.11"