mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
upgrade deps
This commit is contained in:
17 files changed
+60
-56
No files matched your search
@@ -21,13 +21,13 @@
|
||||
"@hydrooj/common": "workspace:^",
|
||||
"@hydrooj/framework": "workspace:^",
|
||||
"@hydrooj/utils": "workspace:^",
|
||||
"@simplewebauthn/server": "13.1.1",
|
||||
"@simplewebauthn/server": "13.1.2",
|
||||
"@undefined-moe/require-resolve-hook": "^1.1.0",
|
||||
"@zip.js/zip.js": "^2.7.62",
|
||||
"@zip.js/zip.js": "^2.7.64",
|
||||
"adm-zip": "0.5.16",
|
||||
"cac": "^6.7.14",
|
||||
"cordis": "4.0.0-beta.5",
|
||||
"csv-stringify": "^6.5.2",
|
||||
"csv-stringify": "^6.6.0",
|
||||
"emoji-regex": "^10.4.0",
|
||||
"emojis-list": "2.1.0",
|
||||
"fs-extra": "^11.3.0",
|
||||
@@ -41,7 +41,7 @@
|
||||
"mongodb": "^6.17.0",
|
||||
"mongodb-uri": "^0.9.7",
|
||||
"nanoid": "^5.1.5",
|
||||
"nodemailer": "^7.0.4",
|
||||
"nodemailer": "^7.0.5",
|
||||
"notp": "^2.0.3",
|
||||
"p-queue": "^8.1.0",
|
||||
"sanitize-filename": "^1.6.3",
|
||||
@@ -49,7 +49,7 @@
|
||||
"schemastery": "^3.16.1",
|
||||
"semver": "^7.7.2",
|
||||
"shorty.js": "^1.0.1",
|
||||
"superagent": "^10.2.1",
|
||||
"superagent": "^10.2.2",
|
||||
"tar": "6.2.1",
|
||||
"thirty-two": "^1.0.2",
|
||||
"ua-parser-js": "^2.0.4"
|
||||
@@ -60,7 +60,7 @@
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/koa-static-cache": "^5.1.4",
|
||||
"@types/lodash": "^4.17.19",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/mongodb-uri": "^0.9.4",
|
||||
"@types/nodemailer": "^6.4.17",
|
||||
|
||||
@@ -194,27 +194,28 @@ export class ProblemMainHandler extends Handler {
|
||||
async postCopy(domainId: string, pids: number[], target: string, hidden?: boolean) {
|
||||
let t = `,${this.domain.share || ''},`;
|
||||
if (t !== ',*,' && !t.includes(`,${target},`)) throw new ProblemNotAllowCopyError(this.domain._id, target);
|
||||
let ddoc = await domain.get(target);
|
||||
const ddoc = await domain.get(target);
|
||||
if (!ddoc) throw new NotFoundError(target);
|
||||
const dudoc = await user.getById(target, this.user._id);
|
||||
if (!dudoc.hasPerm(PERM.PERM_CREATE_PROBLEM)) throw new PermissionError(PERM.PERM_CREATE_PROBLEM);
|
||||
// Check if user can access all those problems
|
||||
const pdict = await problem.getList(
|
||||
domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id,
|
||||
true, ['docId'], true,
|
||||
true, ['domainId', 'docId', 'reference'], true,
|
||||
);
|
||||
const ids = [];
|
||||
for (const pid of pids) {
|
||||
let pdoc = pdict[pid];
|
||||
if (pdoc.reference) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
[pdoc, ddoc] = await Promise.all([
|
||||
const [sourcePdoc, sourceDdoc] = await Promise.all([
|
||||
problem.get(pdoc.reference.domainId, pdoc.reference.pid),
|
||||
domain.get(pdoc.reference.domainId),
|
||||
]);
|
||||
if (!pdoc) throw new ProblemNotFoundError(pdoc.reference.domainId, pdoc.reference.pid);
|
||||
t = `,${ddoc.share || ''},`;
|
||||
if (t !== ',*,' && !t.includes(`,${target},`)) throw new ProblemNotAllowCopyError(ddoc._id, target);
|
||||
if (!sourcePdoc) throw new ProblemNotFoundError(pdoc.reference.domainId, pdoc.reference.pid);
|
||||
else pdoc = sourcePdoc;
|
||||
t = `,${sourceDdoc.share || ''},`;
|
||||
if (t !== ',*,' && !t.includes(`,${target},`)) throw new ProblemNotAllowCopyError(sourceDdoc._id, target);
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
ids.push(await problem.copy(pdoc.domainId, pdoc.docId, target, undefined, hidden));
|
||||
@@ -317,7 +318,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
|
||||
if (this.pdoc.config.langs) t.push(this.pdoc.config.langs);
|
||||
if (ddoc.langs) t.push(ddoc.langs.split(',').map((i) => i.trim()).filter((i) => i));
|
||||
if (this.domain.langs) t.push(this.domain.langs.split(',').map((i) => i.trim()).filter((i) => i));
|
||||
if (this.tdoc?.langs) t.push(this.tdoc.langs);
|
||||
if (this.tdoc?.langs?.length) t.push(this.tdoc.langs);
|
||||
if (this.pdoc.config.type === 'remote_judge') {
|
||||
const p = this.pdoc.config.subType;
|
||||
const dl = Object.keys(setting.langs).filter((i) => i.startsWith(`${p}.`) || setting.langs[i].validAs[p]);
|
||||
|
||||
Reference in new issue
Block a user