diff --git a/packages/migrate-hustoj/lib.ts b/packages/migrate-hustoj/lib.ts index fff43163c..19f93e443 100644 --- a/packages/migrate-hustoj/lib.ts +++ b/packages/migrate-hustoj/lib.ts @@ -1,6 +1,5 @@ -import { } from 'hydrooj'; +import { md5, sha1 } from 'hydrooj/src/lib/crypto'; -const { md5, sha1 } = global.Hydro.lib; const RE_MD5 = /^[\da-fA-F]{32}$/; function hash(password: string, stored: string) { diff --git a/packages/migrate-hustoj/script.ts b/packages/migrate-hustoj/script.ts index 158a69fa7..d93f9d5cb 100644 --- a/packages/migrate-hustoj/script.ts +++ b/packages/migrate-hustoj/script.ts @@ -1,10 +1,10 @@ /* eslint-disable no-tabs */ /* eslint-disable no-await-in-loop */ import mysql from 'mysql'; -import 'hydrooj'; import { buildContent } from 'hydrooj/src/lib/content'; - -const { user, problem, system } = global.Hydro.model; +import user from 'hydrooj/src/model/user'; +import problem from 'hydrooj/src/model/problem'; +import * as system from 'hydrooj/src/model/system'; export async function run({ host = 'localhost', port = 27017, name = 'vijos4', username, password, @@ -93,7 +93,7 @@ export async function run({ samples: [[pdoc.sample_input, pdoc.sample_output]], hint: pdoc.hint, source: pdoc.source, - }, 'html'), + }), 1, pdoc.source.split(' '), pdoc.defunct === 'Y', ); const [cdoc] = await query(`SELECT * FROM 'privilege' WHERE rightstr = 'p${pdoc.problem_id}'`);