@tsed/platform-middlewares
Advanced tools
Comparing version 6.71.1 to 7.0.0-alpha.1
import { Type } from "@tsed/core"; | ||
export interface IAuthOptions { | ||
/** | ||
* @deprecated Since v6. Use @Returns from @tsed/schema | ||
*/ | ||
responses?: { | ||
[statusCode: string]: { | ||
description: string; | ||
}; | ||
}; | ||
/** | ||
* @deprecated Since v6. Use @Security from @tsed/schema | ||
*/ | ||
security?: { | ||
[securityName: string]: string[]; | ||
}[] | { | ||
[securityName: string]: string[]; | ||
}; | ||
[key: string]: any; | ||
} | ||
/** | ||
@@ -42,2 +23,2 @@ * Change authentication options. | ||
*/ | ||
export declare function AuthOptions(guardAuth: Type<any>, options?: IAuthOptions): Function; | ||
export declare function AuthOptions(guardAuth: Type<any>, options?: Record<string, unknown>): Function; |
import { Type } from "@tsed/core"; | ||
import { IAuthOptions } from "./authOptions"; | ||
/** | ||
@@ -23,2 +22,2 @@ * Use custom authentication strategy on your endpoint. | ||
*/ | ||
export declare function UseAuth(guardAuth: Type<any>, options?: IAuthOptions): Function; | ||
export declare function UseAuth(guardAuth: Type<any>, options?: Record<string, unknown>): Function; |
export interface MiddlewareMethods { | ||
use(...args: any[]): void | any | Promise<any>; | ||
} | ||
/** | ||
* @deprecated Since v6. Use MiddlewareMethods instead | ||
*/ | ||
export interface IMiddleware extends MiddlewareMethods { | ||
} |
@@ -46,23 +46,2 @@ var di = require('@tsed/di'); | ||
const store = entity.store; | ||
if (options.responses) { | ||
const { | ||
responses | ||
} = options; | ||
store.merge("responses", responses, true); | ||
delete options.responses; | ||
} | ||
if (options.security) { | ||
const { | ||
security | ||
} = options; | ||
[].concat(security).forEach(security => { | ||
Object.entries(security).forEach(([name, scopes]) => { | ||
entity.operation.addSecurityScopes(name, scopes); | ||
}); | ||
}); | ||
delete options.security; | ||
} | ||
store.merge(guardAuth, options, true); | ||
@@ -69,0 +48,0 @@ })(...args); |
@@ -46,23 +46,2 @@ import { Injectable, ProviderType } from '@tsed/di'; | ||
const store = entity.store; | ||
if (options.responses) { | ||
const { | ||
responses | ||
} = options; | ||
store.merge("responses", responses, true); | ||
delete options.responses; | ||
} | ||
if (options.security) { | ||
const { | ||
security | ||
} = options; | ||
[].concat(security).forEach(security => { | ||
Object.entries(security).forEach(([name, scopes]) => { | ||
entity.operation.addSecurityScopes(name, scopes); | ||
}); | ||
}); | ||
delete options.security; | ||
} | ||
store.merge(guardAuth, options, true); | ||
@@ -69,0 +48,0 @@ })(...args); |
{ | ||
"name": "@tsed/platform-middlewares", | ||
"version": "6.71.1", | ||
"version": "7.0.0-alpha.1", | ||
"description": "Middlewares module for Ts.ED Framework", | ||
@@ -20,10 +20,10 @@ "private": false, | ||
"devDependencies": { | ||
"@tsed/core": "6.71.1", | ||
"@tsed/di": "6.71.1", | ||
"@tsed/schema": "6.71.1" | ||
"@tsed/core": "7.0.0-alpha.1", | ||
"@tsed/di": "7.0.0-alpha.1", | ||
"@tsed/schema": "7.0.0-alpha.1" | ||
}, | ||
"peerDependencies": { | ||
"@tsed/core": "^6.71.1", | ||
"@tsed/di": "^6.71.1", | ||
"@tsed/schema": "^6.71.1" | ||
"@tsed/core": "^7.0.0-alpha.1", | ||
"@tsed/di": "^7.0.0-alpha.1", | ||
"@tsed/schema": "^7.0.0-alpha.1" | ||
}, | ||
@@ -34,5 +34,5 @@ "repository": "https://github.com/tsedio/tsed", | ||
}, | ||
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/platform/platform-middlewares", | ||
"homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/platform/platform-middlewares", | ||
"author": "Romain Lenzotti", | ||
"license": "MIT" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57022
764
1