@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.
@@ -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';
@@ -10,7 +10,7 @@ function get(config) {
10
10
  controllerConstructor: target.constructor,
11
11
  functionName,
12
12
  method: 'get',
13
- path: config?.path,
13
+ path: typeof config === 'string' ? config : config?.path,
14
14
  paramsTypes,
15
15
  });
16
16
  };
@@ -10,7 +10,7 @@ function post(config) {
10
10
  controllerConstructor: target.constructor,
11
11
  functionName,
12
12
  method: 'post',
13
- path: config?.path,
13
+ path: typeof config === 'string' ? config : config?.path,
14
14
  paramsTypes,
15
15
  });
16
16
  };
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wabot-dev/framework",
3
- "version": "0.1.0-beta.20",
3
+ "version": "0.1.0-beta.22",
4
4
  "description": "Framework for IA Chat Bots",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",