add typedoc

This commit is contained in:
undefined committed 2021-05-09 12:10:13 +08:00
1 parent 41c0b0c608
commit e10f3de562
16 files changed
+105 -62

No files matched your search

+9 -5
View File
@@ -18,6 +18,7 @@
"snowpack": "cd packages/ui-default && snowpack dev",
"pub": "node build/publish",
"jest": "node build/jest",
"typedoc": "cross-env NODE_OPTIONS=--max_old_space_size=8192 typedoc",
"debug": "node --async-stack-traces --trace-deprecation --enable-source-maps build/start --debug --template",
"start": "node build/start",
"clean": "zsh -c \"rm -rf tsconfig.build.tsbuildinfo ./packages/*/tsconfig.tsbuildinfo ./packages/*/dist ./.coverage\""
@@ -28,12 +29,13 @@
"@shelf/jest-mongodb": "^1.2.3",
"@types/cross-spawn": "^6.0.2",
"@types/jest": "^26.0.23",
"@types/node": "^15.0.1",
"@types/node": "^15.0.2",
"@types/semver": "^7.3.5",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"eslint": "^7.25.0",
"eslint": "^7.26.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.22.1",
@@ -41,9 +43,11 @@
"globby": "^11.0.3",
"jest": "^26.6.3",
"latest-version": "^5.1.0",
"nmls": "^2.0.3",
"ora": "^5.4.0",
"semver": "^7.3.5",
"ts-jest": "^26.5.5",
"ts-jest": "^26.5.6",
"typedoc": "^0.20.36",
"typescript": "4.2.4",
"yargs": "^16.2.0"
}
+1 -1
View File
@@ -9,7 +9,7 @@
"dependencies": {
"adm-zip": "^0.5.5",
"decode-html": "^2.0.0",
"fs-extra": "^9.1.0",
"fs-extra": "^10.0.0",
"xml2js": "^0.4.23"
},
"devDependencies": {
+2 -2
View File
@@ -9,13 +9,13 @@
"@hydrooj/utils": "^1.0.14",
"axios": "^0.21.1",
"bson": "^4.3.0",
"fs-extra": "^9.1.0",
"fs-extra": "^10.0.0",
"js-yaml": "^4.0.0",
"lodash": "^4.17.21",
"p-queue": "^6.6.1",
"shell-quote": "^1.7.2",
"ws": "^7.4.5",
"yargs": "^16.2.0"
"yargs": "^17.0.1"
},
"license": "AGPL-3.0-only",
"devDependencies": {
+3 -3
View File
@@ -16,7 +16,7 @@
"ansi_up": "^5.0.1",
"cookies": "^0.8.0",
"detect-browser": "^5.1.1",
"fs-extra": "^9.1.0",
"fs-extra": "^10.0.0",
"inquirer": "^8.0.0",
"js-yaml": "^4.0.0",
"koa": "^2.13.1",
@@ -36,7 +36,7 @@
"serialize-javascript": "^5.0.1",
"sockjs": "^0.3.20",
"superagent": "^6.1.0",
"yargs": "^16.2.0"
"yargs": "^17.0.1"
},
"devDependencies": {
"@types/adm-zip": "^0.4.34",
@@ -54,7 +54,7 @@
"@types/nodemailer": "^6.4.1",
"@types/serialize-javascript": "^5.0.0",
"@types/sockjs": "^0.3.32",
"@types/superagent": "^4.1.8",
"@types/superagent": "^4.1.11",
"@types/yargs": "^16.0.1",
"formidable": "^1.2.2"
}
+44
View File
@@ -0,0 +1,44 @@
import * as interfaces from './interface';
import * as document from './model/document';
import user from './model/user';
import domain from './model/domain';
import problem from './model/problem';
import record from './model/record';
import task from './model/task';
import * as training from './model/training';
import blacklist from './model/blacklist';
import * as builtin from './model/builtin';
import oauth from './model/oauth';
import * as oplog from './model/oplog';
import * as system from './model/system';
import * as setting from './model/setting';
import solution from './model/solution';
import token from './model/token';
import message from './model/message';
import * as discussion from './model/discussion';
import * as contest from './model/contest';
import * as opcount from './model/opcount';
export const Interface = interfaces;
export namespace Model {
export const User = user;
export const Document = document;
export const Domain = domain;
export const Problem = problem;
export const Record = record;
export const Task = task;
export const Blacklist = blacklist;
export const Builtin = builtin;
export const Training = training;
export const Contest = contest;
export const System = system;
export const Setting = setting;
export const Solution = solution;
export const Token = token;
export const Oplog = oplog;
export const Opcount = opcount;
export const Oauth = oauth;
export const Discussion = discussion;
export const Message = message;
}
+1 -1
View File
@@ -9,6 +9,6 @@
"dependencies": {
"adm-zip": "^0.5.5",
"decode-html": "^2.0.0",
"fs-extra": "^9.1.0"
"fs-extra": "^10.0.0"
}
}
+1 -8
View File
@@ -1,14 +1,10 @@
import 'hydrooj';
import * as superagent from 'superagent';
import superagentProxy from 'superagent-proxy';
superagentProxy(superagent);
declare module 'hydrooj' {
interface SystemKeys {
'login-with-github.id': string,
'login-with-github.secret': string,
'login-with-github.proxy': string,
}
interface Lib {
oauth_github: typeof import('./lib'),
@@ -27,17 +23,15 @@ async function get() {
async function callback({ state, code }) {
const { system, token } = global.Hydro.model;
const { UserFacingError } = global.Hydro.error;
const [[appid, secret, proxy, url], s] = await Promise.all([
const [[appid, secret, url], s] = await Promise.all([
system.getMany([
'login-with-github.id',
'login-with-github.secret',
'login-with-github.proxy',
'server.url',
]),
token.get(state, token.TYPE_OAUTH),
]);
const res = await superagent.post('https://github.com/login/oauth/access_token')
.proxy(proxy)
.send({
client_id: appid,
client_secret: secret,
@@ -53,7 +47,6 @@ async function callback({ state, code }) {
}
const t = res.body.access_token;
const userInfo = await superagent.get('https://api.github.com/user')
.proxy(proxy)
.set('User-Agent', 'Hydro-OAuth')
.set('Authorization', `token ${t}`);
const ret = {
+2 -4
View File
@@ -10,14 +10,12 @@
"build": "tsc"
},
"devDependencies": {
"@types/superagent": "^4.1.8",
"@types/superagent-proxy": "^2.0.0"
"@types/superagent": "^4.1.11"
},
"peerDependencies": {
"hydrooj": "^2.15.0"
},
"dependencies": {
"superagent": "^6.1.0",
"superagent-proxy": "^2.0.0"
"superagent": "^6.1.0"
}
}
+1 -6
View File
@@ -7,9 +7,4 @@ secret:
type: text
category: system
desc: Github OAuth Secret
name: secret
proxy:
type: text
category: system
desc: Github OAuth Proxy
name: proxy
name: secret
+2 -7
View File
@@ -1,14 +1,10 @@
import 'hydrooj';
import * as superagent from 'superagent';
import proxy from 'superagent-proxy';
proxy(superagent);
declare module 'hydrooj' {
interface SystemKeys {
'login-with-google.id': string,
'login-with-google.secret': string,
'login-with-google.proxy': string,
}
interface Lib {
oauth_google: typeof import('./lib'),
@@ -33,16 +29,15 @@ async function callback({
const { UserFacingError } = global.Hydro.error;
if (error) throw new UserFacingError(error);
const [
[appid, secret, url, proxyUrl],
[appid, secret, url],
s,
] = await Promise.all([
system.getMany([
'login-with-google.id', 'login-with-google.secret', 'server.url', 'login-with-google.proxy',
'login-with-google.id', 'login-with-google.secret', 'server.url',
]),
token.get(state, token.TYPE_OAUTH),
]);
const res = await superagent.post('https://oauth2.googleapis.com/token')
.proxy(proxyUrl)
.send({
client_id: appid,
client_secret: secret,
+2 -4
View File
@@ -10,14 +10,12 @@
"build": "tsc"
},
"devDependencies": {
"@types/superagent": "^4.1.8",
"@types/superagent-proxy": "^2.0.0"
"@types/superagent": "^4.1.11"
},
"peerDependencies": {
"hydrooj": "^2.15.0"
},
"dependencies": {
"superagent": "^6.1.0",
"superagent-proxy": "^2.0.0"
"superagent": "^6.1.0"
}
}
+1 -8
View File
@@ -1,14 +1,10 @@
import 'hydrooj';
import * as superagent from 'superagent';
import superagentProxy from 'superagent-proxy';
superagentProxy(superagent);
declare module 'hydrooj' {
interface SystemKeys {
'login-with-osu.id': string,
'login-with-osu.secret': string,
'login-with-osu.proxy': string,
}
interface Lib {
oauth_osu: typeof import('./lib'),
@@ -32,17 +28,15 @@ async function get() {
async function callback({ state, code }) {
const { system, token } = global.Hydro.model;
const { UserFacingError } = global.Hydro.error;
const [[appid, secret, proxy, url], s] = await Promise.all([
const [[appid, secret, url], s] = await Promise.all([
system.getMany([
'login-with-osu.id',
'login-with-osu.secret',
'login-with-osu.proxy',
'server.url',
]),
token.get(state, token.TYPE_OAUTH),
]);
const res = await superagent.post(`${BASE_URL}oauth/token`)
.proxy(proxy)
.send({
client_id: appid,
client_secret: secret,
@@ -58,7 +52,6 @@ async function callback({ state, code }) {
}
const t = res.body.access_token;
const userInfo = await superagent.get(`${BASE_URL}api/v2/me`)
.proxy(proxy)
.set('User-Agent', 'Hydro-OAuth')
.set('Authorization', `Bearer ${t}`);
const ret = {
+3 -5
View File
@@ -10,14 +10,12 @@
"build": "tsc"
},
"devDependencies": {
"@types/superagent": "^4.1.8",
"@types/superagent-proxy": "^2.0.0"
"@types/superagent": "^4.1.11"
},
"peerDependencies": {
"hydrooj": "^2.15.0"
},
"dependencies": {
"superagent": "^6.1.0",
"superagent-proxy": "^2.0.0"
"superagent": "^6.1.0"
}
}
}
+7 -7
View File
@@ -18,7 +18,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/preset-env": "^7.14.0",
"@babel/preset-env": "^7.14.1",
"@babel/preset-react": "^7.13.13",
"@babel/register": "^7.13.14",
"@babel/runtime-corejs2": "^7.14.0",
@@ -35,7 +35,7 @@
"css-loader": "^4.2.2",
"diff-dom": "^4.2.2",
"emojify.js": "^1.1.0",
"eslint": "^7.22.0",
"eslint": "^7.26.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-import-resolver-webpack": "^0.13.0",
"eslint-plugin-babel": "^5.3.1",
@@ -57,7 +57,7 @@
"jquery-scroll-lock": "^3.1.3",
"jquery.easing": "^1.4.1",
"jquery.transit": "^0.9.12",
"mini-css-extract-plugin": "^1.4.0",
"mini-css-extract-plugin": "^1.6.0",
"moment": "^2.29.1",
"monaco-editor": "^0.23.0",
"monaco-editor-webpack-plugin": "^3.0.1",
@@ -67,7 +67,7 @@
"pickadate": "^3.6.4",
"plugin-error": "^1.0.1",
"postcss-loader": "^3.0.0",
"prism-themes": "^1.6.0",
"prism-themes": "^1.7.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
@@ -101,7 +101,7 @@
"dependencies": {
"98.css": "^0.1.16",
"js-yaml": "^4.0.0",
"katex": "^0.13.2",
"katex": "^0.13.9",
"lodash": "^4.17.21",
"markdown-it": "^12.0.6",
"markdown-it-anchor": "^7.1.0",
@@ -113,7 +113,7 @@
"prismjs": "^1.23.0",
"streamsaver": "^2.0.5",
"web-streams-polyfill": "^3.0.2",
"xss": "^1.0.8",
"yargs": "^16.2.0"
"xss": "^1.0.9",
"yargs": "^17.0.1"
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
"dependencies": {
"bson": "^4.3.0",
"moment": "^2.29.1",
"systeminformation": "^5.6.10"
"systeminformation": "^5.6.20"
},
"devDependencies": {
"moment-timezone": "^0.5.33"
+25
View File
@@ -0,0 +1,25 @@
{
"entryPoints": [
"packages/hydrooj/src/model/blacklist.ts",
"packages/hydrooj/src/model/builtin.ts",
"packages/hydrooj/src/model/contest.ts",
"packages/hydrooj/src/model/discussion.ts",
"packages/hydrooj/src/model/document.ts",
"packages/hydrooj/src/model/domain.ts",
"packages/hydrooj/src/model/message.ts",
"packages/hydrooj/src/model/oauth.ts",
"packages/hydrooj/src/model/opcount.ts",
"packages/hydrooj/src/model/oplog.ts",
"packages/hydrooj/src/model/problem.ts",
"packages/hydrooj/src/model/record.ts",
"packages/hydrooj/src/model/setting.ts",
"packages/hydrooj/src/model/solution.ts",
"packages/hydrooj/src/model/system.ts",
"packages/hydrooj/src/model/task.ts",
"packages/hydrooj/src/model/token.ts",
"packages/hydrooj/src/model/training.ts",
"packages/hydrooj/src/model/user.ts"
],
"tsconfig": "packages/hydrooj/tsconfig.json",
"out": "docs"
}