@hydrooj/fps-importer
Advanced tools
Comparing version
@@ -85,8 +85,8 @@ /* eslint-disable no-await-in-loop */ | ||
async post({ domainId }) { | ||
if (!this.request.files.file) throw new ValidationError('file'); | ||
const file = this.request.files.file; | ||
if (!file) throw new ValidationError('file'); | ||
const tasks = []; | ||
try { | ||
const file = await fs.stat(this.request.files.file.filepath); | ||
if (file.size > SystemModel.get('import-fps.limit')) throw new FileTooLargeError(); | ||
const content = fs.readFileSync(this.request.files.file.filepath, 'utf-8'); | ||
const content = await fs.readFile(file.filepath, 'utf-8'); | ||
const result = await xml2js.parseStringPromise(content); | ||
@@ -99,3 +99,3 @@ tasks.push(result); | ||
try { | ||
zip = new AdmZip(this.request.files.file.filepath); | ||
zip = new AdmZip(file.filepath); | ||
} catch (err) { | ||
@@ -102,0 +102,0 @@ throw new ValidationError('zip', null, err.message); |
{ | ||
"name": "@hydrooj/fps-importer", | ||
"version": "1.5.13", | ||
"version": "1.5.14-dev", | ||
"description": "Import FPS problems", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
@@ -1,1 +0,1 @@ | ||
{"compilerOptions":{"target":"es2020","module":"commonjs","esModuleInterop":true,"moduleResolution":"node","jsx":"react","sourceMap":false,"composite":true,"strictBindCallApply":true,"resolveJsonModule":true,"experimentalDecorators":true,"incremental":true,"outDir":"/home/runner/work/Hydro/Hydro/.cache/ts-out/packages/fps-importer","rootDir":".","paths":{"vj/*":["../../packages/ui-default/*"]}},"include":["**/*.ts"],"exclude":["**/public","**/frontend","**/node_modules","**/bin","**/dist","**/__mocks__"]} | ||
{"compilerOptions":{"target":"es2022","lib":["es2022"],"module":"preserve","esModuleInterop":true,"moduleResolution":"bundler","jsx":"react","sourceMap":false,"composite":true,"strictBindCallApply":true,"resolveJsonModule":true,"experimentalDecorators":true,"incremental":true,"outDir":"/home/runner/work/Hydro/Hydro/.cache/ts-out/packages/fps-importer","rootDir":".","paths":{"vj/*":["../../packages/ui-default/*"]}},"include":["**/*.ts"],"exclude":["**/public","**/frontend","**/node_modules","**/bin","**/dist","**/__mocks__"]} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
9619
-0.61%2
100%