Update dependencies 🚀
This commit is contained in:
@@ -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);
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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';
|
||||
|
@@ -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';
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user