diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-27 05:50:34 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-27 05:50:34 +0900 |
| commit | 42a14508f6ee3a9aef374e8a8695230b3839dcb2 (patch) | |
| tree | bb177c017fe1d95796593ea9fca2e639e1035a9b /src/server | |
| parent | Update node version (diff) | |
| download | sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.gz sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.bz2 sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.zip | |
Update dependencies :rocket:
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/activitypub.ts | 10 | ||||
| -rw-r--r-- | src/server/activitypub/featured.ts | 4 | ||||
| -rw-r--r-- | src/server/activitypub/followers.ts | 4 | ||||
| -rw-r--r-- | src/server/activitypub/following.ts | 4 | ||||
| -rw-r--r-- | src/server/activitypub/outbox.ts | 4 | ||||
| -rw-r--r-- | src/server/api/api-handler.ts | 4 | ||||
| -rw-r--r-- | src/server/api/index.ts | 4 | ||||
| -rw-r--r-- | src/server/api/service/discord.ts | 2 | ||||
| -rw-r--r-- | src/server/api/service/github.ts | 2 | ||||
| -rw-r--r-- | src/server/api/service/twitter.ts | 2 | ||||
| -rw-r--r-- | src/server/file/index.ts | 2 | ||||
| -rw-r--r-- | src/server/index.ts | 2 | ||||
| -rw-r--r-- | src/server/nodeinfo.ts | 2 | ||||
| -rw-r--r-- | src/server/proxy/index.ts | 2 | ||||
| -rw-r--r-- | src/server/web/docs.ts | 2 | ||||
| -rw-r--r-- | src/server/web/index.ts | 2 | ||||
| -rw-r--r-- | src/server/well-known.ts | 2 |
17 files changed, 27 insertions, 27 deletions
diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 1803fef79c..2dbacf5194 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as json from 'koa-json-body'; import * as httpSignature from 'http-signature'; @@ -23,7 +23,7 @@ const router = new Router(); //#region Routing -function inbox(ctx: Router.IRouterContext) { +function inbox(ctx: Router.RouterContext) { let signature; ctx.req.headers.authorization = `Signature ${ctx.req.headers.signature}`; @@ -40,13 +40,13 @@ function inbox(ctx: Router.IRouterContext) { ctx.status = 202; } -function isActivityPubReq(ctx: Router.IRouterContext) { +function isActivityPubReq(ctx: Router.RouterContext) { ctx.response.vary('Accept'); const accepted = ctx.accepts('html', 'application/activity+json', 'application/ld+json'); return ['application/activity+json', 'application/ld+json'].includes(accepted as string); } -export function setResponseType(ctx: Router.IRouterContext) { +export function setResponseType(ctx: Router.RouterContext) { const accpet = ctx.accepts('application/activity+json', 'application/ld+json'); if (accpet === 'application/ld+json') { ctx.response.type = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"; charset=utf-8'; @@ -146,7 +146,7 @@ router.get('/users/:user/publickey', async ctx => { }); // user -async function userInfo(ctx: Router.IRouterContext, user: User | undefined) { +async function userInfo(ctx: Router.RouterContext, user: User | undefined) { if (user == null) { ctx.status = 404; return; diff --git a/src/server/activitypub/featured.ts b/src/server/activitypub/featured.ts index dae72f16b6..32871416d2 100644 --- a/src/server/activitypub/featured.ts +++ b/src/server/activitypub/featured.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import config from '../../config'; import { renderActivity } from '../../remote/activitypub/renderer'; import renderOrderedCollection from '../../remote/activitypub/renderer/ordered-collection'; @@ -7,7 +7,7 @@ import renderNote from '../../remote/activitypub/renderer/note'; import { Users, Notes, UserNotePinings } from '../../models'; import { ensure } from '../../prelude/ensure'; -export default async (ctx: Router.IRouterContext) => { +export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; // Verify user diff --git a/src/server/activitypub/followers.ts b/src/server/activitypub/followers.ts index e48dc57f7a..0678ce6d24 100644 --- a/src/server/activitypub/followers.ts +++ b/src/server/activitypub/followers.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import config from '../../config'; import $ from 'cafy'; import { ID } from '../../misc/cafy-id'; @@ -11,7 +11,7 @@ import { setResponseType } from '../activitypub'; import { Users, Followings } from '../../models'; import { LessThan } from 'typeorm'; -export default async (ctx: Router.IRouterContext) => { +export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; // Get 'cursor' parameter diff --git a/src/server/activitypub/following.ts b/src/server/activitypub/following.ts index 4a7314e0ce..36c7cafaa8 100644 --- a/src/server/activitypub/following.ts +++ b/src/server/activitypub/following.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import config from '../../config'; import $ from 'cafy'; import { ID } from '../../misc/cafy-id'; @@ -12,7 +12,7 @@ import { Users, Followings } from '../../models'; import { LessThan, FindConditions } from 'typeorm'; import { Following } from '../../models/entities/following'; -export default async (ctx: Router.IRouterContext) => { +export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; // Get 'cursor' parameter diff --git a/src/server/activitypub/outbox.ts b/src/server/activitypub/outbox.ts index 118d8f00a9..aa6053d479 100644 --- a/src/server/activitypub/outbox.ts +++ b/src/server/activitypub/outbox.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import config from '../../config'; import $ from 'cafy'; import { ID } from '../../misc/cafy-id'; @@ -17,7 +17,7 @@ import { Brackets } from 'typeorm'; import { Note } from '../../models/entities/note'; import { ensure } from '../../prelude/ensure'; -export default async (ctx: Router.IRouterContext) => { +export default async (ctx: Router.RouterContext) => { const userId = ctx.params.user; // Get 'sinceId' parameter diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts index 2de6994f32..a3be1f2aae 100644 --- a/src/server/api/api-handler.ts +++ b/src/server/api/api-handler.ts @@ -6,7 +6,7 @@ import call from './call'; import { ApiError } from './error'; export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) => { - const body = ctx.is('multipart/form-data') ? (ctx.req as any).body : ctx.request.body; + const body = ctx.request.body; const reply = (x?: any, y?: ApiError) => { if (x == null) { @@ -31,7 +31,7 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) // Authentication authenticate(body['i']).then(([user, app]) => { // API invoking - call(endpoint.name, user, app, body, (ctx.req as any).file).then((res: any) => { + call(endpoint.name, user, app, body, (ctx as any).file).then((res: any) => { reply(res); }).catch((e: ApiError) => { reply(e.httpStatusCode ? e.httpStatusCode : e.kind == 'client' ? 400 : 500, e); diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 49500b2b4a..258e632bd8 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -3,8 +3,8 @@ */ import * as Koa from 'koa'; -import * as Router from 'koa-router'; -import * as multer from 'koa-multer'; +import * as Router from '@koa/router'; +import * as multer from '@koa/multer'; import * as bodyParser from 'koa-bodyparser'; import * as cors from '@koa/cors'; diff --git a/src/server/api/service/discord.ts b/src/server/api/service/discord.ts index d5b0fcc755..369061138c 100644 --- a/src/server/api/service/discord.ts +++ b/src/server/api/service/discord.ts @@ -1,5 +1,5 @@ import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as request from 'request'; import { OAuth2 } from 'oauth'; import config from '../../../config'; diff --git a/src/server/api/service/github.ts b/src/server/api/service/github.ts index b78459e8c3..ef5a753a1a 100644 --- a/src/server/api/service/github.ts +++ b/src/server/api/service/github.ts @@ -1,5 +1,5 @@ import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as request from 'request'; import { OAuth2 } from 'oauth'; import config from '../../../config'; diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index 5338fd2deb..cdf674bab0 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -1,5 +1,5 @@ import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import { v4 as uuid } from 'uuid'; import autwh from 'autwh'; import redis from '../../../db/redis'; diff --git a/src/server/file/index.ts b/src/server/file/index.ts index 1cdf5207e4..e6df321d43 100644 --- a/src/server/file/index.ts +++ b/src/server/file/index.ts @@ -5,7 +5,7 @@ import * as fs from 'fs'; import * as Koa from 'koa'; import * as cors from '@koa/cors'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import sendDriveFile from './send-drive-file'; // Init app diff --git a/src/server/index.ts b/src/server/index.ts index b3ca47f232..b4652d01b7 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -8,7 +8,7 @@ import * as http2 from 'http2'; import * as https from 'https'; import * as zlib from 'zlib'; import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as mount from 'koa-mount'; import * as compress from 'koa-compress'; import * as koaLogger from 'koa-logger'; diff --git a/src/server/nodeinfo.ts b/src/server/nodeinfo.ts index da1e4e7b5e..d35ced0e42 100644 --- a/src/server/nodeinfo.ts +++ b/src/server/nodeinfo.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import config from '../config'; import { fetchMeta } from '../misc/fetch-meta'; // import User from '../models/user'; diff --git a/src/server/proxy/index.ts b/src/server/proxy/index.ts index 8d33af85da..9ef198d31b 100644 --- a/src/server/proxy/index.ts +++ b/src/server/proxy/index.ts @@ -4,7 +4,7 @@ import * as Koa from 'koa'; import * as cors from '@koa/cors'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import { proxyMedia } from './proxy-media'; // Init app diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts index 374dbf3bd2..558e811466 100644 --- a/src/server/web/docs.ts +++ b/src/server/web/docs.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import * as showdown from 'showdown'; import 'showdown-highlightjs-extension'; import ms = require('ms'); -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as send from 'koa-send'; import * as glob from 'glob'; import config from '../../config'; diff --git a/src/server/web/index.ts b/src/server/web/index.ts index f5845585ff..36f9788d79 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -5,7 +5,7 @@ import * as os from 'os'; import ms = require('ms'); import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as send from 'koa-send'; import * as favicon from 'koa-favicon'; import * as views from 'koa-views'; diff --git a/src/server/well-known.ts b/src/server/well-known.ts index d29b7a8888..94c871eca2 100644 --- a/src/server/well-known.ts +++ b/src/server/well-known.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import config from '../config'; import parseAcct from '../misc/acct/parse'; |