Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore remove unecessary code #1399

Merged
merged 7 commits into from
May 21, 2021
Merged
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
2 changes: 1 addition & 1 deletion docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Logger configuration. See [logger section for more detail](/docs/logger.md).

### resolvers - External DI

- type: @@IDIResolver@@
- type: @@DIResolver@@

Ts.ED has its own DI container, but sometimes you have to work with other DI like Inversify or TypeDI. The version 5.39.0+
now allows you to configure multiple external DI by using the `resolvers` options.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/snippets/authentication/auth-decorator-example.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {IAuthOptions, Returns, UseAuth} from "@tsed/common";
import {IAuthOptions, UseAuth} from "@tsed/common";
import {useDecorators} from "@tsed/core";
import {Security, Returns} from "@tsed/schema";
import {CustomAuthMiddleware} from "../guards/CustomAuthMiddleware";
Expand All @@ -12,7 +12,7 @@ export function CustomAuth(options: ICustomAuthOptions = {}): Function {
return useDecorators(
UseAuth(CustomAuthMiddleware, options),
Security("oauth", ...(options.scopes || [])),
Returns(401, {description: "Unauthorized"}),
Returns(403, {description: "Forbidden"})
Returns(401),
Returns(403)
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {BodyParams, Controller, Get, Post, Returns, ReturnsArray} from "@tsed/common";
import {BodyParams, Controller, Get, Post} from "@tsed/common";
import {Returns} from "@tsed/schema/src";
import {Person} from "../models/Person";

@Controller("/")
export class PersonsCtrl {

@Post("/")
@Returns(Person)
@Returns(200, Person)
async save1(@BodyParams() person: Person): Promise<Person> {
console.log(person instanceof Person); // true

Expand All @@ -14,7 +15,7 @@ export class PersonsCtrl {


@Get("/")
@ReturnsArray(Person)
@Returns(200, Array).Of(Person)
async getPersons(): Promise<Person[]> {
return [
new Person()
Expand Down
7 changes: 4 additions & 3 deletions docs/tutorials/snippets/session/example-session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {BodyParams, Controller, Get, Post, Session, Status} from "@tsed/common";
import {BodyParams, Controller, Get, Post, Session} from "@tsed/common";
import {Returns} from "@tsed/schema";

@Controller("/")
export class MyCtrl {
Expand All @@ -11,14 +12,14 @@ export class MyCtrl {
}

@Post("/login")
@Status(204)
@Returns(204)
login(@BodyParams("name") name: string, @Session("user") user: any) {
user.id = "1";
user.name = name;
}

@Post("/logout")
@Status(204)
@Returns(204)
logout(@Session("user") user: any) {
user.id = null;
delete user.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Env} from "@tsed/core";
import {$log} from "@tsed/logger";
import {expect} from "chai";
import Sinon from "sinon";
import {ProviderScope, ProviderType} from "../../../../di/src/interfaces";
import {ProviderScope, ProviderType} from "@tsed/di";
import {PlatformConfiguration} from "./PlatformConfiguration";

describe("PlatformConfiguration", () => {
Expand Down
1 change: 0 additions & 1 deletion packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from "@tsed/di";
export * from "./config";
export * from "./jsonschema";
export * from "./mvc";
export * from "./platform";
export * from "./platform-cache";
Expand Down

This file was deleted.

21 changes: 0 additions & 21 deletions packages/common/src/jsonschema/decorators/additionalProperties.ts

This file was deleted.

74 changes: 0 additions & 74 deletions packages/common/src/jsonschema/decorators/any.spec.ts

This file was deleted.

43 changes: 0 additions & 43 deletions packages/common/src/jsonschema/decorators/any.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/common/src/jsonschema/decorators/const.spec.ts

This file was deleted.

68 changes: 0 additions & 68 deletions packages/common/src/jsonschema/decorators/const.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/common/src/jsonschema/decorators/default.spec.ts

This file was deleted.

Loading