@plumier/core
Advanced tools
Comparing version 1.0.0-dev.14 to 1.0.0-dev.15
import { Class } from "./common"; | ||
import { HttpMethod, RouteInfo } from "./types"; | ||
import { HttpMethod, RouteInfo, RouteAnalyzerIssue, RouteAnalyzerFunction } from "./types"; | ||
interface RouteDecorator { | ||
@@ -15,13 +15,9 @@ name: "Route"; | ||
} | ||
interface Issue { | ||
type: "error" | "warning" | "success"; | ||
message?: string; | ||
} | ||
interface TestResult { | ||
route: RouteInfo; | ||
issues: Issue[]; | ||
issues: RouteAnalyzerIssue[]; | ||
} | ||
declare function generateRoutes(executionPath: string, controller: string | Class[] | Class): RouteInfo[]; | ||
declare function analyzeRoutes(routes: RouteInfo[]): TestResult[]; | ||
declare function analyzeRoutes(routes: RouteInfo[], extensions?: RouteAnalyzerFunction[]): TestResult[]; | ||
declare function printAnalysis(results: TestResult[]): void; | ||
export { analyzeRoutes, generateRoutes, printAnalysis, RouteDecorator, IgnoreDecorator, RootDecorator }; |
@@ -224,3 +224,3 @@ "use strict"; | ||
} | ||
function analyzeRoutes(routes) { | ||
function analyzeRoutes(routes, extensions = []) { | ||
const tests = [ | ||
@@ -231,3 +231,3 @@ backingParameterTest, metadataTypeTest, | ||
]; | ||
return routes.map(x => analyzeRoute(x, tests, routes)); | ||
return routes.map(x => analyzeRoute(x, tests.concat(extensions), routes)); | ||
} | ||
@@ -234,0 +234,0 @@ exports.analyzeRoutes = analyzeRoutes; |
@@ -32,2 +32,7 @@ import Koa, { Context } from "koa"; | ||
} | ||
export interface RouteAnalyzerIssue { | ||
type: "error" | "warning" | "success"; | ||
message?: string; | ||
} | ||
export declare type RouteAnalyzerFunction = (route: RouteInfo, allRoutes: RouteInfo[]) => RouteAnalyzerIssue; | ||
export interface Facility { | ||
@@ -207,2 +212,3 @@ setup(app: Readonly<PlumierApplication>): void; | ||
authorizer?: AuthorizeStore; | ||
analyzers?: RouteAnalyzerFunction[]; | ||
} | ||
@@ -209,0 +215,0 @@ export interface PlumierConfiguration extends Configuration { |
{ | ||
"name": "@plumier/core", | ||
"version": "1.0.0-dev.14+39f91e9", | ||
"version": "1.0.0-dev.15+d2d1238", | ||
"description": "Delightful Node.js Rest Framework", | ||
@@ -41,3 +41,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "39f91e901a896446144a8ae7d6ef99593cf44cba", | ||
"gitHead": "d2d123809c2b2cecdf3024fe2e87de489cb3cba3", | ||
"devDependencies": { | ||
@@ -44,0 +44,0 @@ "upath": "^1.2.0" |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
121658
2775