@wabot-dev/framework 0.1.0-beta.20 → 0.1.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.d.ts
CHANGED
|
@@ -1021,7 +1021,7 @@ interface IGetConfig {
|
|
|
1021
1021
|
path?: string;
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
|
-
declare function get(config?: IGetConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1024
|
+
declare function get(config?: string | IGetConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1025
1025
|
|
|
1026
1026
|
interface IMiddleware {
|
|
1027
1027
|
handle(req: Request, res: Response, container: DependencyContainer$1): Promise<void>;
|
|
@@ -1033,13 +1033,13 @@ interface IPostConfig {
|
|
|
1033
1033
|
path?: string;
|
|
1034
1034
|
}
|
|
1035
1035
|
|
|
1036
|
-
declare function post(config?: IPostConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1036
|
+
declare function post(config?: string | IPostConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1037
1037
|
|
|
1038
1038
|
interface IRestControllerConfig {
|
|
1039
1039
|
path: string;
|
|
1040
1040
|
}
|
|
1041
1041
|
|
|
1042
|
-
declare function restController(config: IRestControllerConfig): (target: IConstructor<any>) => void;
|
|
1042
|
+
declare function restController(config: string | IRestControllerConfig): (target: IConstructor<any>) => void;
|
|
1043
1043
|
|
|
1044
1044
|
interface IEndPointMetadata {
|
|
1045
1045
|
method: 'get' | 'post';
|
|
@@ -6,7 +6,7 @@ function restController(config) {
|
|
|
6
6
|
const metaDataStore = container.resolve(RestControllerMetadataStore);
|
|
7
7
|
metaDataStore.saveControllerMetadata({
|
|
8
8
|
controllerConstructor: target,
|
|
9
|
-
path: config.path,
|
|
9
|
+
path: typeof config === 'string' ? config : config.path,
|
|
10
10
|
});
|
|
11
11
|
injectable()(target);
|
|
12
12
|
};
|