Skip to content

Commit

Permalink
fix: bump typescript to v4.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Apr 2, 2022
1 parent 71de7dc commit fe87b3c
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 108 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/snippets/graphql/server-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@tsed/typegraphql";

@Configuration({
componentsScan: [
`${rootDir}/graphql/**/*.ts` // add this pattern to scan resolvers or datasources
`./graphql/**/*.ts` // add this pattern to scan resolvers or datasources
],
typegraphql: {
server1: {
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/snippets/passport/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export class Server {
cookie: {
path: "/",
httpOnly: true,
secure: false,
maxAge: null
secure: false
}
})
);
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@
"is-ci": "^3.0.1",
"jest": "^27.2.0",
"lint-staged": "^12.3.2",
"micromatch": "4.0.4",
"micromatch": "4.0.5",
"mocha": "8.2.1",
"moment": "2.29.1",
"nyc": "15.1.0",
"prettier": "2.5.1",
"prettier": "2.6.1",
"proxyquire": "2.1.3",
"semantic-release": "17.2.3",
"sinon": "9.0.3",
Expand All @@ -154,7 +154,7 @@
"ts-node": "^10.2.1",
"tsconfig-paths": "3.9.0",
"tslib": "2.3.1",
"typescript": "4.5.2"
"typescript": "4.6.3"
},
"directories": {
"packages": "packages",
Expand Down
16 changes: 15 additions & 1 deletion packages/graphql/typegraphql/test/app/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {buildContext} from "graphql-passport";
import methodOverride from "method-override";
import {resolve} from "path";
import {User} from "./graphql/auth/User";
import session from "express-session";

const rootDir = resolve(__dirname);

Expand Down Expand Up @@ -61,6 +62,19 @@ export class Server {
)
.use(cookieParser())
.use(compress({}))
.use(methodOverride());
.use(methodOverride())
.use(
session({
secret: "mysecretkey",
resave: true,
saveUninitialized: true,
// maxAge: 36000,
cookie: {
path: "/",
httpOnly: true,
secure: false
}
})
);
}
}
3 changes: 1 addition & 2 deletions packages/orm/mongoose/src/interfaces/MongooseModel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {JsonDeserializerOptions} from "@tsed/json-mapper";
import {Document, Model} from "mongoose";

// TODO since v5.11.5 Model require Document with id, See issue https://github.com/Automattic/mongoose/issues/9684
Expand All @@ -8,4 +7,4 @@ export interface MongooseDocumentMethods<T> {
toClass(): T;
}

export interface MongooseModel<T> extends Model<MongooseMergedDocument<Document & T & MongooseDocumentMethods<T>>> {}
export type MongooseModel<T> = Model<MongooseMergedDocument<Document & T & MongooseDocumentMethods<T>>>;
6 changes: 3 additions & 3 deletions packages/platform/common/src/services/PlatformResponse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {isBoolean, isNumber, isStream, isString} from "@tsed/core";
import {Injectable, ProviderScope, Scope} from "@tsed/di";
import {ServerResponse} from "http";
import {OutgoingHttpHeaders, ServerResponse} from "http";
import onFinished from "on-finished";
import {IncomingEvent} from "../interfaces/IncomingEvent";
import type {PlatformRequest} from "./PlatformRequest";
Expand Down Expand Up @@ -84,7 +84,7 @@ export class PlatformResponse<T extends Record<string, any> = any> {
return this.raw.get(name);
}

getHeaders(): Record<string, HeaderValue> {
getHeaders(): OutgoingHttpHeaders {
return this.raw.getHeaders();
}

Expand Down Expand Up @@ -128,7 +128,7 @@ export class PlatformResponse<T extends Record<string, any> = any> {
*
* Aliased as `res.header()`.
*/
setHeaders(headers: Record<string, HeaderValue>) {
setHeaders(headers: OutgoingHttpHeaders) {
// apply headers
Object.entries(headers).forEach(([key, item]) => {
this.setHeader(key, item);
Expand Down
4 changes: 2 additions & 2 deletions packages/platform/common/src/utils/setResponseHeaders.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {JsonHeader} from "@tsed/schema";
import {OutgoingHttpHeaders} from "http";
import {PlatformContext} from "../domain/PlatformContext";
import {HeaderValue} from "../services/PlatformResponse";

function mergeHeaders(specHeaders: Record<string, JsonHeader & {example: string}>, headers: Record<string, HeaderValue>) {
function mergeHeaders(specHeaders: Record<string, JsonHeader & {example: string}>, headers: OutgoingHttpHeaders) {
return Object.entries(specHeaders).reduce((headers, [key, item]) => {
key = key.toLowerCase();
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/platform/platform-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@types/cache-manager": "^3.4.3",
"cache-manager": "^3.6.0",
"micromatch": "4.0.4",
"micromatch": "4.0.5",
"tslib": "2.3.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/platform/platform-koa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
"@types/koa-send": "4.1.3",
"@types/koa-session": "5.10.6",
"@types/koa__router": "8.0.11",
"koa": "2.13.0",
"koa": "2.13.4",
"koa-bodyparser": "4.3.0",
"koa-compress": "5.0.1",
"koa-compress": "5.1.0",
"koa-override": "3.0.0",
"koa-qs": "^3.0.0",
"koa-session": "6.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class PlatformKoaResponse extends PlatformResponse<Koa.Response> {
return this;
}

getBody() {
getBody(): any {
return this.raw.body;
}

Expand All @@ -100,7 +100,7 @@ export class PlatformKoaResponse extends PlatformResponse<Koa.Response> {

this.body(`${getStatusMessage(status)}. Redirecting to ${url}`);
this.status(status);
this.setHeader("Content-Length", Buffer.byteLength(this.raw.body));
this.setHeader("Content-Length", Buffer.byteLength(this.raw.body as any));

if (this.request.method === "HEAD") {
this.getRes().end();
Expand Down
2 changes: 1 addition & 1 deletion packages/security/oidc-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/lowdb": "1.0.11",
"@types/oidc-provider": "^7.1.1",
"@types/uuid": "8.3.4",
"oidc-provider": "7.10.1"
"oidc-provider": "7.10.6"
},
"peerDependencies": {
"@tsed/common": "6.107.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/security/passport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/passport-http": "0.3.9",
"@types/passport-local": "1.0.34",
"@types/passport-strategy": "0.2.35",
"passport": "0.4.1",
"passport": "0.5.2",
"passport-http": "0.3.0",
"passport-local": "1.0.0",
"passport-strategy": "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/specs/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"camel-case": "4.1.2",
"fs-extra": "^10.0.1",
"json-schema": "0.4.0",
"micromatch": "4.0.4",
"micromatch": "4.0.5",
"pascal-case": "3.1.2",
"statuses": ">=2.0.1",
"tslib": "2.3.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/specs/swagger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"@tsed/openspec": "6.107.5",
"fs-extra": "10.0.1",
"micromatch": "4.0.4",
"micromatch": "4.0.5",
"swagger-ui-dist": "^4.5.2",
"tslib": "2.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/third-parties/formio/src/domain/FormioHooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {MongooseDocument} from "@tsed/mongoose";
import {Request} from "express";
import {Request, Response} from "express";
import {FilterQuery, Schema, SchemaDefinition} from "mongoose";
import {Formio} from "./Formio";
import {FormioActions} from "./FormioActionsIndex";
Expand Down
4 changes: 2 additions & 2 deletions packages/third-parties/formio/src/domain/Resource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Express from "express";
import {Request, Response, NextFunction} from "express";

export type ResourceHttpHandler = (req: Request, res: Response, next: Express.NextFunction) => void;
export type ResourceHttpHandler = (req: Request, res: Response, next: NextFunction) => void;

export interface ResourceHttpMethodOptions {
before?: ResourceHttpHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export class FormioAuthService {
async getRoles(req?: Req) {
try {
const query = this.hooks.alter("roleQuery", {deleted: {$eq: null}}, req);

return await this.db.roleModel.find(query).sort({title: 1}).lean().exec();
} catch (err) {
throw new BadRequest(this.formio.util.errorCodes.role.EROLESLOAD);
Expand Down
Loading

0 comments on commit fe87b3c

Please sign in to comment.