@thisisagile/easy
Advanced tools
Comparing version 1.12.3 to 1.12.4
@@ -1,4 +0,5 @@ | ||
import { Uri } from '../types'; | ||
import { List, Uri } from '../types'; | ||
import { HttpVerb } from './HttpVerb'; | ||
import { List } from '../types/List'; | ||
import { Req } from './Req'; | ||
export declare type Endpoint = (re: Req) => Promise<unknown | List<unknown>>; | ||
export declare const route: (uri: Uri) => ClassDecorator; | ||
@@ -9,5 +10,5 @@ declare class Router { | ||
get route(): Uri; | ||
get verbs(): List<{ | ||
get endpoints(): List<{ | ||
verb: HttpVerb; | ||
f: Function; | ||
f: Endpoint; | ||
}>; | ||
@@ -14,0 +15,0 @@ } |
@@ -12,5 +12,5 @@ "use strict"; | ||
get route() { return types_1.meta(this.resource).get('route'); } | ||
get verbs() { | ||
get endpoints() { | ||
return types_1.meta(this.resource).properties('verb') | ||
.map(p => ({ verb: p.get('verb').verb, f: () => p.property })); | ||
.map(p => ({ verb: p.get('verb').verb, f: this.resource[p.property] })); | ||
} | ||
@@ -17,0 +17,0 @@ } |
{ | ||
"name": "@thisisagile/easy", | ||
"version": "1.12.3", | ||
"version": "1.12.4", | ||
"description": "Straightforward library for building domain-driven microservice architectures", | ||
@@ -5,0 +5,0 @@ "author": "Sander Hoogendoorn", |
@@ -1,6 +0,8 @@ | ||
import { meta, Uri } from '../types'; | ||
import { List, meta, Uri } from '../types'; | ||
import { HttpVerb } from './HttpVerb'; | ||
import { Verb } from './Verb'; | ||
import { List } from '../types/List'; | ||
import { Req } from './Req'; | ||
export type Endpoint = (re: Req) => Promise<unknown | List<unknown>>; | ||
export const route = (uri: Uri): ClassDecorator => | ||
@@ -14,5 +16,5 @@ (subject: Function): void => { meta(subject).set('route', uri); }; | ||
get verbs(): List<{ verb: HttpVerb, f: Function }> { | ||
get endpoints(): List<{ verb: HttpVerb, f: Endpoint }> { | ||
return meta(this.resource).properties('verb') | ||
.map(p => ({ verb: p.get<Verb>('verb').verb, f: () => p.property })); | ||
.map(p => ({ verb: p.get<Verb>('verb').verb, f: (this.resource as any)[p.property] })); | ||
} | ||
@@ -19,0 +21,0 @@ } |
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
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
136616
2020