Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,940 changes: 1,683 additions & 257 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,26 @@
"testEnvironment": "node"
},
"dependencies": {
"@tsed/ajv": "^4.32.0",
"@tsed/common": "^4.32.0",
"@tsed/core": "^4.32.0",
"@tsed/multipartfiles": "^4.32.0",
"@tsed/servestatic": "^4.32.0",
"@tsed/swagger": "^4.32.0",
"ajv": "^6.0.1",
"bcrypt-nodejs": "^0.0.3",
"body-parser": "^1.18.2",
"body-parser": "^1.18.3",
"class-transformer": "^0.1.8",
"class-validator": "^0.7.3",
"compression": "^1.7.1",
"compression": "^1.7.3",
"cookie-parser": "^1.4.3",
"dotenv": "^2.0.0",
"errorhandler": "^1.5.0",
"express": "^4.16.2",
"express": "^4.16.4",
"jsonwebtoken": "^8.1.0",
"lodash": "^4.17.4",
"lusca": "^1.5.2",
"method-override": "^3.0.0",
"moment": "^2.20.1",
"mongoose": "^4.13.7",
"morgan": "^1.9.0",
Expand All @@ -58,22 +66,23 @@
"request": "^2.83.0",
"request-promise": "^4.2.2",
"swagger-ui-express": "^2.0.14",
"ts-express-decorators": "^3.7.0",
"ts-log-debug": "^4.0.2",
"tspath": "^1.2.10",
"typegoose": "3.4.7",
"typescript-param-validator": "^1.1.0"
},
"devDependencies": {
"@tsed/testing": "^4.32.0",
"@types/async": "^2.0.40",
"@types/bcrypt-nodejs": "0.0.30",
"@types/body-parser": "^1.16.2",
"@types/compression": "0.0.33",
"@types/connect-mongo": "0.0.34",
"@types/dotenv": "^2.0.20",
"@types/express": "^4.0.35",
"@types/express": "^4.16.0",
"@types/express-session": "^1.15.5",
"@types/jest": "^21.1.5",
"@types/jsonwebtoken": "^8.3.0",
"@types/lodash": "^4.14.80",
"@types/mongodb": "^2.2.18",
"@types/mongoose": "^4.7.9",
Expand All @@ -86,7 +95,7 @@
"@types/reflect-metadata": "^0.1.0",
"@types/request": "^2.0.7",
"@types/request-promise": "^4.1.39",
"@types/supertest": "^2.0.0",
"@types/supertest": "^2.0.6",
"eslint": "^4.14.0",
"jest": "^21.2.1",
"node-sass": "^4.5.2",
Expand All @@ -97,6 +106,6 @@
"ts-node": "^3.3.0",
"tsconfig-paths": "^3.1.1",
"tslint": "^5.8.0",
"typescript": "^2.4.0"
"typescript": "^2.9.2"
}
}
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'reflect-metadata';
import 'ts-express-decorators/swagger';
import '@tsed/swagger';

import * as Path from 'path';
import * as dotenv from 'dotenv';
Expand All @@ -10,7 +10,7 @@ import * as compression from 'compression';

dotenv.config({ path: '.env' });

import { ServerLoader, ServerSettings, GlobalAcceptMimesMiddleware } from 'ts-express-decorators';
import { ServerLoader, ServerSettings, GlobalAcceptMimesMiddleware } from "@tsed/common";
import { $log } from 'ts-log-debug';
import { MongooseService } from './services/shared/mongoose.service';

Expand Down
4 changes: 2 additions & 2 deletions src/controllers/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { NextFunction } from 'express';
import {
BodyParams, Controller, Next, Post, QueryParams, Request, Required, Response,
Status
} from 'ts-express-decorators';
import { Returns } from 'ts-express-decorators/lib/swagger';
} from '@tsed/common';
import { Returns } from '@tsed/swagger';
import { Validate, Validator } from 'typescript-param-validator';
import { AuthDto } from '../../services/auth/auth.dto';
import { AuthService } from '../../services/auth/auth.service';
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/auth/auth.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsEmail, IsNotEmpty as Required, IsOptional, IsUrl, MinLength } from 'class-validator';
import { JsonProperty } from 'ts-express-decorators';
import { JsonProperty } from '@tsed/common';

export class FacebookTokenAuthQueryDto {
access_token: string;
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Controller, Get, PathParams, Authenticated, Required, Req } from 'ts-express-decorators';
import { Returns } from 'ts-express-decorators/lib/swagger';
import { Controller, Get, PathParams, Authenticated, Required, Req } from '@tsed/common';
import { Returns } from '@tsed/swagger';
import { User } from '../../dal/User';
import { UserService } from '../../services/user/user.service';
import { IAppRequest } from '../../types/app.types';
Expand Down
2 changes: 1 addition & 1 deletion src/dal/User.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InjectorService, JsonProperty } from 'ts-express-decorators';
import { InjectorService, JsonProperty } from '@tsed/common';
import { prop, Typegoose, InstanceType, arrayProp, instanceMethod, pre, ModelType } from 'typegoose';
import * as bcrypt from 'bcrypt-nodejs';
import { UserRepositoryToken } from './token-constants';
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/auth.middlewares.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request } from 'express';
import { IMiddleware, OverrideMiddleware, AuthenticatedMiddleware,
EndpointInfo, EndpointMetadata, Req
} from 'ts-express-decorators';
} from '@tsed/common';
import { AuthService } from '../services/auth/auth.service';
import { API_ERRORS } from '../types/app.errors';
import { ApiError } from '../utils/error';
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/error.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NextFunction as ExpressNext, Request as ExpressRequest, Response as Exp
import {
IMiddlewareError, Err, Next, Request, Response,
OverrideMiddleware, GlobalErrorHandlerMiddleware
} from 'ts-express-decorators';
} from '@tsed/common';
import { ValidatorError } from 'typescript-param-validator';
import { API_ERRORS } from '../types/app.errors';
import { ApiError } from '../utils/error';
Expand Down
2 changes: 1 addition & 1 deletion src/services/auth/auth.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonProperty } from 'ts-express-decorators';
import { JsonProperty } from '@tsed/common';
import { AuthToken } from '../../dal/User';

export interface IAuthProviderProfileDto {
Expand Down
4 changes: 2 additions & 2 deletions src/services/auth/auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as jwt from 'jsonwebtoken';
import * as moment from 'moment';

import { Inject, Service } from 'ts-express-decorators';
import { Inject, Service } from '@tsed/common';
import { UserRepositoryToken } from '../../dal/token-constants';
import { AuthProviderEnum, UserInstance, UserRepository } from '../../dal/User';
import { API_ERRORS } from '../../types/app.errors';
Expand Down Expand Up @@ -78,7 +78,7 @@ export class AuthService {

async validateToken(token: string) {
try {
const payload = jwt.verify(token, process.env.SECRET);
const payload = jwt.verify(token, process.env.SECRET) as any ;

return await this.rehydrateUser(payload._id);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/auth/passport/passport-auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NextFunction, Request, Response } from 'express';
import * as passport from 'passport';
import { Service } from 'ts-express-decorators';
import { Service } from '@tsed/common';
import { AuthDto } from '../auth.dto';
import { AUTH_STRATEGY } from './passport.service';

Expand Down
2 changes: 1 addition & 1 deletion src/services/auth/passport/passport.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as passport from 'passport';
import * as FacebookTokenStrategy from 'passport-facebook-token';
import { Strategy as LocalStrategy } from 'passport-local';
import { ExpressApplication, Inject, Service } from 'ts-express-decorators';
import { ExpressApplication, Inject, Service } from '@tsed/common';
import { AuthProviderEnum } from '../../../dal/User';
import { IAppRequest } from '../../../types/app.types';
import { IAuthProviderProfileDto } from '../auth.dto';
Expand Down
2 changes: 1 addition & 1 deletion src/services/shared/mongoose.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as mongoose from 'mongoose';
import { Service } from 'ts-express-decorators';
import { Service } from '@tsed/common';

(mongoose as any).Promise = global.Promise;

Expand Down
2 changes: 1 addition & 1 deletion src/services/user/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Inject, Service } from 'ts-express-decorators';
import { Inject, Service } from '@tsed/common';
import { UserRepositoryToken } from '../../dal/token-constants';
import { UserRepository } from '../../dal/User';

Expand Down
4 changes: 2 additions & 2 deletions src/utils/tests/injectors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { inject, Done } from 'ts-express-decorators/testing';
import { InjectorService } from 'ts-express-decorators';
import { inject, Done } from '@tsed/testing';
import { InjectorService } from '@tsed/common';

export function getInjectionService(ctx: Function): Promise<InjectorService> {
return new Promise((resolve) => {
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules"
]
}