web_api_base 6.1.1 → 6.1.3

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.
Files changed (213) hide show
  1. package/dist/Application.d.ts +29 -0
  2. package/dist/Application.d.ts.map +1 -0
  3. package/dist/Application.js +560 -0
  4. package/dist/Application.js.map +1 -0
  5. package/dist/ApplicationConfiguration.d.ts +24 -0
  6. package/dist/ApplicationConfiguration.d.ts.map +1 -0
  7. package/dist/ApplicationConfiguration.js +141 -0
  8. package/dist/ApplicationConfiguration.js.map +1 -0
  9. package/dist/bin/CreateApplication.d.ts +2 -0
  10. package/dist/bin/CreateApplication.d.ts.map +1 -0
  11. package/dist/bin/CreateApplication.js +6 -0
  12. package/dist/bin/CreateApplication.js.map +1 -0
  13. package/dist/bin/CreateController.d.ts +2 -0
  14. package/dist/bin/CreateController.d.ts.map +1 -0
  15. package/dist/bin/CreateController.js +5 -0
  16. package/dist/bin/CreateController.js.map +1 -0
  17. package/dist/bin/Factory.d.ts +3 -0
  18. package/dist/bin/Factory.d.ts.map +1 -0
  19. package/dist/bin/Factory.js +81 -0
  20. package/dist/bin/Factory.js.map +1 -0
  21. package/dist/controllers/AcceptedResult.d.ts +5 -0
  22. package/dist/controllers/AcceptedResult.d.ts.map +1 -0
  23. package/dist/controllers/AcceptedResult.js +13 -0
  24. package/dist/controllers/AcceptedResult.js.map +1 -0
  25. package/dist/controllers/ActionResult.d.ts +6 -0
  26. package/dist/controllers/ActionResult.d.ts.map +1 -0
  27. package/dist/controllers/ActionResult.js +10 -0
  28. package/dist/controllers/ActionResult.js.map +1 -0
  29. package/dist/controllers/BadRequestResult.d.ts +5 -0
  30. package/dist/controllers/BadRequestResult.d.ts.map +1 -0
  31. package/dist/controllers/BadRequestResult.js +13 -0
  32. package/dist/controllers/BadRequestResult.js.map +1 -0
  33. package/dist/controllers/CreatedResult.d.ts +5 -0
  34. package/dist/controllers/CreatedResult.d.ts.map +1 -0
  35. package/dist/controllers/CreatedResult.js +13 -0
  36. package/dist/controllers/CreatedResult.js.map +1 -0
  37. package/dist/controllers/DownloadFileResult.d.ts +5 -0
  38. package/dist/controllers/DownloadFileResult.d.ts.map +1 -0
  39. package/dist/controllers/DownloadFileResult.js +13 -0
  40. package/dist/controllers/DownloadFileResult.js.map +1 -0
  41. package/dist/controllers/ErrorResult.d.ts +5 -0
  42. package/dist/controllers/ErrorResult.d.ts.map +1 -0
  43. package/dist/controllers/ErrorResult.js +13 -0
  44. package/dist/controllers/ErrorResult.js.map +1 -0
  45. package/dist/controllers/ForbiddenResult.d.ts +5 -0
  46. package/dist/controllers/ForbiddenResult.d.ts.map +1 -0
  47. package/dist/controllers/ForbiddenResult.js +13 -0
  48. package/dist/controllers/ForbiddenResult.js.map +1 -0
  49. package/dist/controllers/GenericResult.d.ts +6 -0
  50. package/dist/controllers/GenericResult.d.ts.map +1 -0
  51. package/dist/controllers/GenericResult.js +13 -0
  52. package/dist/controllers/GenericResult.js.map +1 -0
  53. package/dist/controllers/NoContentResult.d.ts +5 -0
  54. package/dist/controllers/NoContentResult.d.ts.map +1 -0
  55. package/dist/controllers/NoContentResult.js +13 -0
  56. package/dist/controllers/NoContentResult.js.map +1 -0
  57. package/dist/controllers/NotFoundResult.d.ts +5 -0
  58. package/dist/controllers/NotFoundResult.d.ts.map +1 -0
  59. package/dist/controllers/NotFoundResult.js +13 -0
  60. package/dist/controllers/NotFoundResult.js.map +1 -0
  61. package/dist/controllers/OKResult.d.ts +5 -0
  62. package/dist/controllers/OKResult.d.ts.map +1 -0
  63. package/dist/controllers/OKResult.js +13 -0
  64. package/dist/controllers/OKResult.js.map +1 -0
  65. package/dist/controllers/SendFileResult.d.ts +5 -0
  66. package/dist/controllers/SendFileResult.d.ts.map +1 -0
  67. package/dist/controllers/SendFileResult.js +13 -0
  68. package/dist/controllers/SendFileResult.js.map +1 -0
  69. package/dist/controllers/UnauthorizedResult.d.ts +5 -0
  70. package/dist/controllers/UnauthorizedResult.d.ts.map +1 -0
  71. package/dist/controllers/UnauthorizedResult.js +13 -0
  72. package/dist/controllers/UnauthorizedResult.js.map +1 -0
  73. package/dist/controllers/base/ControllerBase.d.ts +33 -0
  74. package/dist/controllers/base/ControllerBase.d.ts.map +1 -0
  75. package/dist/controllers/base/ControllerBase.js +84 -0
  76. package/dist/controllers/base/ControllerBase.js.map +1 -0
  77. package/dist/decorators/controllers/ControllerDecorators.d.ts +66 -0
  78. package/dist/decorators/controllers/ControllerDecorators.d.ts.map +1 -0
  79. package/dist/decorators/controllers/ControllerDecorators.js +256 -0
  80. package/dist/decorators/controllers/ControllerDecorators.js.map +1 -0
  81. package/dist/decorators/documentation/DocumentationDecorators.d.ts +24 -0
  82. package/dist/decorators/documentation/DocumentationDecorators.d.ts.map +1 -0
  83. package/dist/decorators/documentation/DocumentationDecorators.js +69 -0
  84. package/dist/decorators/documentation/DocumentationDecorators.js.map +1 -0
  85. package/dist/decorators/metadata/MetadataDecorators.d.ts +17 -0
  86. package/dist/decorators/metadata/MetadataDecorators.d.ts.map +1 -0
  87. package/dist/decorators/metadata/MetadataDecorators.js +67 -0
  88. package/dist/decorators/metadata/MetadataDecorators.js.map +1 -0
  89. package/dist/decorators/validations/ValidationDecorators.d.ts +53 -0
  90. package/dist/decorators/validations/ValidationDecorators.d.ts.map +1 -0
  91. package/dist/decorators/validations/ValidationDecorators.js +180 -0
  92. package/dist/decorators/validations/ValidationDecorators.js.map +1 -0
  93. package/dist/dependencyInjection/DependecyService.d.ts +36 -0
  94. package/dist/dependencyInjection/DependecyService.d.ts.map +1 -0
  95. package/dist/dependencyInjection/DependecyService.js +204 -0
  96. package/dist/dependencyInjection/DependecyService.js.map +1 -0
  97. package/dist/dependencyInjection/IDIContext.d.ts +9 -0
  98. package/dist/dependencyInjection/IDIContext.d.ts.map +1 -0
  99. package/dist/dependencyInjection/IDIContext.js +3 -0
  100. package/dist/dependencyInjection/IDIContext.js.map +1 -0
  101. package/dist/documentation/CSS.d.ts +7 -0
  102. package/dist/documentation/CSS.d.ts.map +1 -0
  103. package/dist/documentation/CSS.js +302 -0
  104. package/dist/documentation/CSS.js.map +1 -0
  105. package/dist/documentation/Documentation.d.ts +8 -0
  106. package/dist/documentation/Documentation.d.ts.map +1 -0
  107. package/dist/documentation/Documentation.js +89 -0
  108. package/dist/documentation/Documentation.js.map +1 -0
  109. package/dist/documentation/HTML.d.ts +5 -0
  110. package/dist/documentation/HTML.d.ts.map +1 -0
  111. package/dist/documentation/HTML.js +26 -0
  112. package/dist/documentation/HTML.js.map +1 -0
  113. package/dist/documentation/JS.d.ts +6 -0
  114. package/dist/documentation/JS.d.ts.map +1 -0
  115. package/dist/documentation/JS.js +419 -0
  116. package/dist/documentation/JS.js.map +1 -0
  117. package/dist/enums/httpVerbs/HttpVerbs.d.ts +7 -0
  118. package/dist/enums/httpVerbs/HttpVerbs.d.ts.map +1 -0
  119. package/dist/enums/httpVerbs/HttpVerbs.js +11 -0
  120. package/dist/enums/httpVerbs/HttpVerbs.js.map +1 -0
  121. package/dist/exceptions/ArgumentNullException.d.ts +4 -0
  122. package/dist/exceptions/ArgumentNullException.d.ts.map +1 -0
  123. package/dist/exceptions/ArgumentNullException.js +10 -0
  124. package/dist/exceptions/ArgumentNullException.js.map +1 -0
  125. package/dist/exceptions/BodyParseException.d.ts +4 -0
  126. package/dist/exceptions/BodyParseException.d.ts.map +1 -0
  127. package/dist/exceptions/BodyParseException.js +10 -0
  128. package/dist/exceptions/BodyParseException.js.map +1 -0
  129. package/dist/exceptions/ControllerLoadException.d.ts +4 -0
  130. package/dist/exceptions/ControllerLoadException.d.ts.map +1 -0
  131. package/dist/exceptions/ControllerLoadException.js +10 -0
  132. package/dist/exceptions/ControllerLoadException.js.map +1 -0
  133. package/dist/exceptions/DecoratorException.d.ts +4 -0
  134. package/dist/exceptions/DecoratorException.d.ts.map +1 -0
  135. package/dist/exceptions/DecoratorException.js +10 -0
  136. package/dist/exceptions/DecoratorException.js.map +1 -0
  137. package/dist/exceptions/Exception.d.ts +5 -0
  138. package/dist/exceptions/Exception.d.ts.map +1 -0
  139. package/dist/exceptions/Exception.js +10 -0
  140. package/dist/exceptions/Exception.js.map +1 -0
  141. package/dist/exceptions/FileNotFoundException.d.ts +4 -0
  142. package/dist/exceptions/FileNotFoundException.d.ts.map +1 -0
  143. package/dist/exceptions/FileNotFoundException.js +10 -0
  144. package/dist/exceptions/FileNotFoundException.js.map +1 -0
  145. package/dist/exceptions/FindDependencyException.d.ts +4 -0
  146. package/dist/exceptions/FindDependencyException.d.ts.map +1 -0
  147. package/dist/exceptions/FindDependencyException.js +10 -0
  148. package/dist/exceptions/FindDependencyException.js.map +1 -0
  149. package/dist/exceptions/InvalidEntityException.d.ts +4 -0
  150. package/dist/exceptions/InvalidEntityException.d.ts.map +1 -0
  151. package/dist/exceptions/InvalidEntityException.js +10 -0
  152. package/dist/exceptions/InvalidEntityException.js.map +1 -0
  153. package/dist/exceptions/RegisterDependencyException.d.ts +4 -0
  154. package/dist/exceptions/RegisterDependencyException.d.ts.map +1 -0
  155. package/dist/exceptions/RegisterDependencyException.js +10 -0
  156. package/dist/exceptions/RegisterDependencyException.js.map +1 -0
  157. package/dist/file/AbstractFileService.d.ts +12 -0
  158. package/dist/file/AbstractFileService.d.ts.map +1 -0
  159. package/dist/file/AbstractFileService.js +6 -0
  160. package/dist/file/AbstractFileService.js.map +1 -0
  161. package/dist/file/AbstractMultiPartRequestService.d.ts +17 -0
  162. package/dist/file/AbstractMultiPartRequestService.d.ts.map +1 -0
  163. package/dist/file/AbstractMultiPartRequestService.js +12 -0
  164. package/dist/file/AbstractMultiPartRequestService.js.map +1 -0
  165. package/dist/file/File.d.ts +6 -0
  166. package/dist/file/File.d.ts.map +1 -0
  167. package/dist/file/File.js +10 -0
  168. package/dist/file/File.js.map +1 -0
  169. package/dist/file/FileService.d.ts +13 -0
  170. package/dist/file/FileService.d.ts.map +1 -0
  171. package/dist/file/FileService.js +136 -0
  172. package/dist/file/FileService.js.map +1 -0
  173. package/dist/file/FormidableMultiPartRequestService.d.ts +5 -0
  174. package/dist/file/FormidableMultiPartRequestService.d.ts.map +1 -0
  175. package/dist/file/FormidableMultiPartRequestService.js +73 -0
  176. package/dist/file/FormidableMultiPartRequestService.js.map +1 -0
  177. package/dist/index.d.ts +85 -0
  178. package/dist/index.d.ts.map +1 -0
  179. package/dist/index.js +262 -0
  180. package/dist/index.js.map +1 -0
  181. package/dist/interfaces/IApplication.d.ts +15 -0
  182. package/dist/interfaces/IApplication.d.ts.map +1 -0
  183. package/dist/interfaces/IApplication.js +3 -0
  184. package/dist/interfaces/IApplication.js.map +1 -0
  185. package/dist/interfaces/IApplicationConfiguration.d.ts +18 -0
  186. package/dist/interfaces/IApplicationConfiguration.d.ts.map +1 -0
  187. package/dist/interfaces/IApplicationConfiguration.js +3 -0
  188. package/dist/interfaces/IApplicationConfiguration.js.map +1 -0
  189. package/dist/interfaces/IController.d.ts +6 -0
  190. package/dist/interfaces/IController.d.ts.map +1 -0
  191. package/dist/interfaces/IController.js +3 -0
  192. package/dist/interfaces/IController.js.map +1 -0
  193. package/dist/metadata/FunctionAnalizer.d.ts +10 -0
  194. package/dist/metadata/FunctionAnalizer.d.ts.map +1 -0
  195. package/dist/metadata/FunctionAnalizer.js +57 -0
  196. package/dist/metadata/FunctionAnalizer.js.map +1 -0
  197. package/dist/metadata/OwnMetaDataContainer.d.ts +13 -0
  198. package/dist/metadata/OwnMetaDataContainer.d.ts.map +1 -0
  199. package/dist/metadata/OwnMetaDataContainer.js +43 -0
  200. package/dist/metadata/OwnMetaDataContainer.js.map +1 -0
  201. package/dist/metadata/Type.d.ts +10 -0
  202. package/dist/metadata/Type.d.ts.map +1 -0
  203. package/dist/metadata/Type.js +252 -0
  204. package/dist/metadata/Type.js.map +1 -0
  205. package/dist/midlewares/IMidleware.d.ts +20 -0
  206. package/dist/midlewares/IMidleware.d.ts.map +1 -0
  207. package/dist/midlewares/IMidleware.js +3 -0
  208. package/dist/midlewares/IMidleware.js.map +1 -0
  209. package/dist/utils/Utils.d.ts +4 -0
  210. package/dist/utils/Utils.d.ts.map +1 -0
  211. package/dist/utils/Utils.js +11 -0
  212. package/dist/utils/Utils.js.map +1 -0
  213. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class InvalidEntityException extends Exception_1.default {
8
+ }
9
+ exports.default = InvalidEntityException;
10
+ //# sourceMappingURL=InvalidEntityException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidEntityException.js","sourceRoot":"","sources":["../../exceptions/InvalidEntityException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAGpC,MAAqB,sBAAuB,SAAQ,mBAAS;CAC5D;AADD,yCACC"}
@@ -0,0 +1,4 @@
1
+ import Exception from "./Exception";
2
+ export default class RegisterDependencyException extends Exception {
3
+ }
4
+ //# sourceMappingURL=RegisterDependencyException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegisterDependencyException.d.ts","sourceRoot":"","sources":["../../exceptions/RegisterDependencyException.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAOpC,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,SAAS;CACjE"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class RegisterDependencyException extends Exception_1.default {
8
+ }
9
+ exports.default = RegisterDependencyException;
10
+ //# sourceMappingURL=RegisterDependencyException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegisterDependencyException.js","sourceRoot":"","sources":["../../exceptions/RegisterDependencyException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAOpC,MAAqB,2BAA4B,SAAQ,mBAAS;CACjE;AADD,8CACC"}
@@ -0,0 +1,12 @@
1
+ export default abstract class AbstractFileService {
2
+ abstract CopyAsync(origin: string, dest: string): Promise<void>;
3
+ abstract DeleteAsync(file: string): Promise<void>;
4
+ abstract GetAllFilesAsync(origin: string): Promise<string[]>;
5
+ abstract GetAllFordersAsync(origin: string): Promise<string[]>;
6
+ abstract FileExistsAsync(file: string): Promise<boolean>;
7
+ abstract DirectoryExistsAsync(path: string): Promise<boolean>;
8
+ abstract CreateDirectoryAsync(path: string): Promise<void>;
9
+ abstract WriteAllTextAsync(path: string, text: string, encoding: 'utf-8' | 'win-1252'): Promise<void>;
10
+ abstract ReadAllTextAsync(path: string, encoding: 'utf-8' | 'win-1252'): Promise<string>;
11
+ }
12
+ //# sourceMappingURL=AbstractFileService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractFileService.d.ts","sourceRoot":"","sources":["../../file/AbstractFileService.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,mBAAmB;aAG7B,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aACtD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aACxC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;aACnD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;aACrD,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;aAC/C,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;aACpD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aACjD,iBAAiB,CAAC,IAAI,EAAG,MAAM,EAAE,IAAI,EAAG,MAAM,EAAE,QAAQ,EAAG,OAAO,GAAG,UAAU,GAAI,OAAO,CAAC,IAAI,CAAC;aAChG,gBAAgB,CAAC,IAAI,EAAG,MAAM,EAAE,QAAQ,EAAG,OAAO,GAAG,UAAU,GAAI,OAAO,CAAC,MAAM,CAAC;CAErG"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class AbstractFileService {
4
+ }
5
+ exports.default = AbstractFileService;
6
+ //# sourceMappingURL=AbstractFileService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractFileService.js","sourceRoot":"","sources":["../../file/AbstractFileService.ts"],"names":[],"mappings":";;AACA,MAA8B,mBAAmB;CAahD;AAbD,sCAaC"}
@@ -0,0 +1,17 @@
1
+ export interface IGetPartsOptions {
2
+ MaxFileSize: number;
3
+ }
4
+ export default abstract class AbstractMultiPartRequestService {
5
+ abstract GetPartsFromRequestAsync(request: any, options?: IGetPartsOptions): Promise<IRequestPart[]>;
6
+ }
7
+ export interface IRequestPart {
8
+ Type: PartType;
9
+ Name: string;
10
+ Content: string;
11
+ Filename?: string;
12
+ }
13
+ export declare enum PartType {
14
+ FILE = 0,
15
+ TEXT = 1
16
+ }
17
+ //# sourceMappingURL=AbstractMultiPartRequestService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractMultiPartRequestService.d.ts","sourceRoot":"","sources":["../../file/AbstractMultiPartRequestService.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,gBAAgB;IAE7B,WAAW,EAAG,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,+BAA+B;aACzC,wBAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAG,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAC/G;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAG,MAAM,CAAA;CACrB;AAED,oBAAY,QAAQ;IAChB,IAAI,IAAA;IACJ,IAAI,IAAA;CACP"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartType = void 0;
4
+ class AbstractMultiPartRequestService {
5
+ }
6
+ exports.default = AbstractMultiPartRequestService;
7
+ var PartType;
8
+ (function (PartType) {
9
+ PartType[PartType["FILE"] = 0] = "FILE";
10
+ PartType[PartType["TEXT"] = 1] = "TEXT";
11
+ })(PartType || (exports.PartType = PartType = {}));
12
+ //# sourceMappingURL=AbstractMultiPartRequestService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractMultiPartRequestService.js","sourceRoot":"","sources":["../../file/AbstractMultiPartRequestService.ts"],"names":[],"mappings":";;;AAMA,MAA8B,+BAA+B;CAE5D;AAFD,kDAEC;AASD,IAAY,QAGX;AAHD,WAAY,QAAQ;IAChB,uCAAI,CAAA;IACJ,uCAAI,CAAA;AACR,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB"}
@@ -0,0 +1,6 @@
1
+ export default class File {
2
+ FileName: string;
3
+ Path: string;
4
+ constructor(filename: string, path: string);
5
+ }
6
+ //# sourceMappingURL=File.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../file/File.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IAEd,QAAQ,EAAG,MAAM,CAAC;IAClB,IAAI,EAAG,MAAM,CAAC;gBAET,QAAQ,EAAG,MAAM,EAAG,IAAI,EAAG,MAAM;CAKhD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class File {
4
+ constructor(filename, path) {
5
+ this.FileName = filename;
6
+ this.Path = path;
7
+ }
8
+ }
9
+ exports.default = File;
10
+ //# sourceMappingURL=File.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../file/File.ts"],"names":[],"mappings":";;AAAA,MAAqB,IAAI;IAKrB,YAAY,QAAiB,EAAG,IAAa;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CACJ;AAVD,uBAUC"}
@@ -0,0 +1,13 @@
1
+ import AbstractFileService from './AbstractFileService';
2
+ export default class FileService extends AbstractFileService {
3
+ WriteAllTextAsync(path: string, text: string, encoding: 'utf-8' | 'win-1252'): Promise<void>;
4
+ ReadAllTextAsync(path: string, encoding: 'utf-8' | 'win-1252'): Promise<string>;
5
+ CreateDirectoryAsync(path: string): Promise<void>;
6
+ FileExistsAsync(file: string): Promise<boolean>;
7
+ DirectoryExistsAsync(path: string): Promise<boolean>;
8
+ GetAllFilesAsync(origin: string): Promise<string[]>;
9
+ GetAllFordersAsync(origin: string): Promise<string[]>;
10
+ CopyAsync(origin: string, dest: string): Promise<void>;
11
+ DeleteAsync(file: string): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=FileService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileService.d.ts","sourceRoot":"","sources":["../../file/FileService.ts"],"names":[],"mappings":"AAIA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAMxD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,mBAAmB;IAG3C,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5F,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAkBrF,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjD,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAc/C,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAcpD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBnD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBrD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBtD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAuBlD"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const fs_1 = __importDefault(require("fs"));
16
+ const promises_1 = __importDefault(require("fs/promises"));
17
+ const path_1 = __importDefault(require("path"));
18
+ const AbstractFileService_1 = __importDefault(require("./AbstractFileService"));
19
+ const FileNotFoundException_1 = __importDefault(require("../exceptions/FileNotFoundException"));
20
+ const Exception_1 = __importDefault(require("../exceptions/Exception"));
21
+ class FileService extends AbstractFileService_1.default {
22
+ WriteAllTextAsync(path, text, encoding) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ return new Promise((resolve, reject) => {
25
+ fs_1.default.writeFile(path, text, encoding == "utf-8" ? "utf-8" : "latin1", (err) => {
26
+ if (err)
27
+ return reject(new Exception_1.default(err.message));
28
+ return resolve();
29
+ });
30
+ });
31
+ });
32
+ }
33
+ ReadAllTextAsync(path, encoding) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (!(yield this.FileExistsAsync(path)))
36
+ throw new FileNotFoundException_1.default(`File ${path} not exists`);
37
+ return new Promise((resolve, reject) => {
38
+ fs_1.default.readFile(path, encoding == "utf-8" ? "utf-8" : "latin1", (err, text) => {
39
+ if (err)
40
+ return reject(new Exception_1.default(err.message));
41
+ return resolve(text);
42
+ });
43
+ });
44
+ });
45
+ }
46
+ CreateDirectoryAsync(path) {
47
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
48
+ try {
49
+ if (!(yield this.DirectoryExistsAsync(path))) {
50
+ fs_1.default.mkdirSync(path, { recursive: true });
51
+ return resolve();
52
+ }
53
+ return resolve();
54
+ }
55
+ catch (err) {
56
+ return reject(err);
57
+ }
58
+ }));
59
+ }
60
+ FileExistsAsync(file) {
61
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
62
+ try {
63
+ return resolve(fs_1.default.existsSync(file) && fs_1.default.lstatSync(file).isFile());
64
+ }
65
+ catch (err) {
66
+ return reject(err);
67
+ }
68
+ }));
69
+ }
70
+ DirectoryExistsAsync(path) {
71
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
72
+ try {
73
+ return resolve(fs_1.default.existsSync(path) && fs_1.default.lstatSync(path).isDirectory());
74
+ }
75
+ catch (err) {
76
+ return reject(err);
77
+ }
78
+ }));
79
+ }
80
+ GetAllFilesAsync(origin) {
81
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
82
+ if (!fs_1.default.existsSync(origin))
83
+ return reject(new Error(`The path ${origin} not exists`));
84
+ try {
85
+ let files = yield promises_1.default.readdir(origin, { withFileTypes: true });
86
+ return resolve(files.filter(u => u.isFile()).map(u => path_1.default.join(origin, u.name)));
87
+ }
88
+ catch (err) {
89
+ return reject(err);
90
+ }
91
+ }));
92
+ }
93
+ GetAllFordersAsync(origin) {
94
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
95
+ if (!fs_1.default.existsSync(origin))
96
+ return reject(new Error(`The path ${origin} not exists`));
97
+ try {
98
+ let files = yield promises_1.default.readdir(origin, { withFileTypes: true });
99
+ return resolve(files.filter(u => u.isDirectory()).map(u => path_1.default.join(origin, u.name)));
100
+ }
101
+ catch (err) {
102
+ return reject(err);
103
+ }
104
+ }));
105
+ }
106
+ CopyAsync(origin, dest) {
107
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
108
+ try {
109
+ yield fs_1.default.copyFile(origin, dest, (err) => {
110
+ if (err)
111
+ throw err;
112
+ resolve();
113
+ });
114
+ }
115
+ catch (err) {
116
+ reject(err);
117
+ }
118
+ }));
119
+ }
120
+ DeleteAsync(file) {
121
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
122
+ try {
123
+ yield fs_1.default.unlink(file, (err) => {
124
+ if (err)
125
+ throw err;
126
+ resolve();
127
+ });
128
+ }
129
+ catch (err) {
130
+ reject(err);
131
+ }
132
+ }));
133
+ }
134
+ }
135
+ exports.default = FileService;
136
+ //# sourceMappingURL=FileService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileService.js","sourceRoot":"","sources":["../../file/FileService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,4CAAsB;AACtB,2DAAoC;AACpC,gDAAwB;AACxB,gFAAwD;AACxD,gGAAwE;AACxE,wEAAgD;AAIhD,MAAqB,WAAY,SAAQ,6BAAmB;IAG3C,iBAAiB,CAAC,IAAY,EAAE,IAAY,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B,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;IAEM,SAAS,CAAC,MAAc,EAAE,IAAY;QAEzC,OAAO,IAAI,OAAO,CAAO,CAAO,OAAO,EAAE,MAAM,EAAC,EAAE;YAE9C,IAAG,CAAC;gBACA,MAAM,YAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBAEtC,IAAG,GAAG;wBACF,MAAM,GAAG,CAAC;oBAEd,OAAO,EAAE,CAAC;gBACd,CAAC,CAAC,CAAA;YAEN,CAAC;YAAA,OAAM,GAAG,EACV,CAAC;gBACG,MAAM,CAAC,GAAG,CAAC,CAAC;YAChB,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IAEP,CAAC;IAEM,WAAW,CAAC,IAAY;QAE3B,OAAO,IAAI,OAAO,CAAO,CAAO,OAAO,EAAE,MAAM,EAAC,EAAE;YAE9C,IAAG,CAAC;gBACA,MAAM,YAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBAE5B,IAAG,GAAG;wBACF,MAAM,GAAG,CAAC;oBAEd,OAAO,EAAE,CAAC;gBACd,CAAC,CAAC,CAAA;YAEN,CAAC;YAAA,OAAM,GAAG,EACV,CAAC;gBACG,MAAM,CAAC,GAAG,CAAC,CAAC;YAChB,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IAEP,CAAC;CAIJ;AAzKD,8BAyKC"}
@@ -0,0 +1,5 @@
1
+ import AbstractMultiPartRequestService, { IGetPartsOptions, IRequestPart } from './AbstractMultiPartRequestService';
2
+ export default class FormidableMultiPartRequestService extends AbstractMultiPartRequestService {
3
+ GetPartsFromRequestAsync(request: any, options?: IGetPartsOptions): Promise<IRequestPart[]>;
4
+ }
5
+ //# sourceMappingURL=FormidableMultiPartRequestService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormidableMultiPartRequestService.d.ts","sourceRoot":"","sources":["../../file/FormidableMultiPartRequestService.ts"],"names":[],"mappings":"AAEA,OAAO,+BAA+B,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAY,MAAM,mCAAmC,CAAC;AAG9H,MAAM,CAAC,OAAO,OAAO,iCAAkC,SAAQ,+BAA+B;IAGnF,wBAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAG,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAyDtG"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const formidable_1 = __importDefault(require("formidable"));
30
+ const AbstractMultiPartRequestService_1 = __importStar(require("./AbstractMultiPartRequestService"));
31
+ const Exception_1 = __importDefault(require("../exceptions/Exception"));
32
+ class FormidableMultiPartRequestService extends AbstractMultiPartRequestService_1.default {
33
+ GetPartsFromRequestAsync(request, options) {
34
+ let maxFileSize = 200 * 1024 * 1024;
35
+ if (options && options.MaxFileSize > 0)
36
+ maxFileSize = options.MaxFileSize;
37
+ let form = (0, formidable_1.default)({ maxFileSize: maxFileSize });
38
+ return new Promise((resolve, reject) => {
39
+ form.parse(request, (err, fields, files) => {
40
+ let result = [];
41
+ if (err)
42
+ return reject(new Exception_1.default(err.message));
43
+ for (let c in fields)
44
+ result.push({
45
+ Name: c,
46
+ Type: AbstractMultiPartRequestService_1.PartType.TEXT,
47
+ Content: fields[c] ? fields[c].toString() : ""
48
+ });
49
+ for (let c in files) {
50
+ if (files[c].filepath == undefined) {
51
+ result.push({
52
+ Name: c,
53
+ Type: AbstractMultiPartRequestService_1.PartType.FILE,
54
+ Content: files[c][0].filepath,
55
+ Filename: files[c][0].originalFilename,
56
+ });
57
+ }
58
+ else {
59
+ result.push({
60
+ Name: c,
61
+ Type: AbstractMultiPartRequestService_1.PartType.FILE,
62
+ Content: files[c].filepath,
63
+ Filename: files[c].originalFilename,
64
+ });
65
+ }
66
+ }
67
+ return resolve(result);
68
+ });
69
+ });
70
+ }
71
+ }
72
+ exports.default = FormidableMultiPartRequestService;
73
+ //# sourceMappingURL=FormidableMultiPartRequestService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormidableMultiPartRequestService.js","sourceRoot":"","sources":["../../file/FormidableMultiPartRequestService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAoC;AAEpC,qGAA8H;AAC9H,wEAAgD;AAEhD,MAAqB,iCAAkC,SAAQ,yCAA+B;IAGnF,wBAAwB,CAAC,OAAY,EAAE,OAA2B;QAErE,IAAI,WAAW,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;QAEpC,IAAG,OAAO,IAAI,OAAO,CAAC,WAAW,GAAG,CAAC;YACjC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEtC,IAAI,IAAI,GAAG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C,CAAC,CAAS,CAAC,gBAAgB;yBAC/C,CAAC,CAAC;oBACX,CAAC;gBAEL,CAAC;gBAID,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QAEP,CAAC,CAAC,CAAC;IACP,CAAC;CAEJ;AA5DD,oDA4DC"}
@@ -0,0 +1,85 @@
1
+ import 'reflect-metadata';
2
+ export { default as Application } from "./Application";
3
+ export { default as ApplicationConfiguration } from "./ApplicationConfiguration";
4
+ export { default as ControllersDecorators } from "./decorators/controllers/ControllerDecorators";
5
+ export { ControllerBase } from "./controllers/base/ControllerBase";
6
+ export { HTTPVerbs } from './enums/httpVerbs/HttpVerbs';
7
+ export { default as Exception } from './exceptions/Exception';
8
+ import FileService from './file/FileService';
9
+ import AbstractFileService from './file/AbstractFileService';
10
+ export { FileService, AbstractFileService };
11
+ export { default as File } from './file/File';
12
+ export { default as DependecyService } from "./dependencyInjection/DependecyService";
13
+ export { default as IMidleware } from './midlewares/IMidleware';
14
+ export { default as IApplicationConfiguration } from "./interfaces/IApplicationConfiguration";
15
+ export { default as IApplication } from "./interfaces/IApplication";
16
+ export { default as IApplicatiIControllernConfiguration } from "./interfaces/IController";
17
+ export { IHTTPRequestContext, IRequestResult, IRequestResultHandler } from "./midlewares/IMidleware";
18
+ export { default as ActionResult } from './controllers/ActionResult';
19
+ export { default as AcceptedResult } from './controllers/AcceptedResult';
20
+ export { default as BadRequestResult } from './controllers/BadRequestResult';
21
+ export { default as CreatedResult } from './controllers/CreatedResult';
22
+ export { default as ErrorResult } from './controllers/ErrorResult';
23
+ export { default as ForbiddenResult } from './controllers/ForbiddenResult';
24
+ export { default as GenericResult } from './controllers/GenericResult';
25
+ export { default as NoContentResult } from './controllers/NoContentResult';
26
+ export { default as NotFoundResult } from './controllers/NotFoundResult';
27
+ export { default as OKResult } from './controllers/OKResult';
28
+ export { default as UnauthorizedResult } from './controllers/UnauthorizedResult';
29
+ import { DocumentationDecorators } from "./decorators/documentation/DocumentationDecorators";
30
+ import { HTTPVerbs } from "./enums/httpVerbs/HttpVerbs";
31
+ import IMidleware, { IRequestResultHandler } from "./midlewares/IMidleware";
32
+ export { default as BodyParseException } from "./exceptions/BodyParseException";
33
+ export { default as ControllerLoadException } from "./exceptions/ControllerLoadException";
34
+ export { default as ArgumentNullException } from "./exceptions/ArgumentNullException";
35
+ export { default as FindDependencyException } from "./exceptions/FindDependencyException";
36
+ export { default as DecoratorException } from "./exceptions/DecoratorException";
37
+ export { default as InvalidEntityException } from "./exceptions/InvalidEntityException";
38
+ export { default as FileNotFoundException } from "./exceptions/FileNotFoundException";
39
+ export declare function CreateMetada(): (target: any, property: string) => void;
40
+ export declare function IgnoreInDocumentation(): (target: any, property: string) => void;
41
+ export declare function ShowInDocumentation(): (target: Object, property: string) => void;
42
+ export declare function ArrayElementType(typeBuilder: () => new (...args: any[]) => any): (target: any, property: string) => void;
43
+ export declare function DefaultValue(value: any): (target: any, property: string) => void;
44
+ export declare function UseBefore(midleware: IMidleware): (target: Function) => void;
45
+ export declare function RunBefore(midleware: IMidleware): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
46
+ export declare function UseAfter(resultHandler: IRequestResultHandler): (target: Function) => void;
47
+ export declare function RunAfter(resultHandler: IRequestResultHandler): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
48
+ export declare function Action(actionName?: String): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
49
+ export declare function Route(route?: string): (target: Function) => void;
50
+ export declare function GET(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
51
+ export declare function POST(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
52
+ export declare function PUT(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
53
+ export declare function DELETE(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
54
+ export declare function ControllerHeader(header: string): (target: Object) => void;
55
+ export declare function ActionHeader(header: string): (target: Object, method: string, propertyDescriptor: PropertyDescriptor) => void;
56
+ export declare function Description(description: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
57
+ export declare function RequestJson(json: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
58
+ export declare function ProducesResponse(response: Parameters<typeof DocumentationDecorators.ProducesResponse>[0]): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
59
+ export declare function Verb(verb: HTTPVerbs): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
60
+ export declare function Inject(): (target: Object, property: string | symbol) => void;
61
+ export declare function InjectOne(constructorFunction: Function, genericArgumentType?: Function): (target: Object, property: string | symbol) => void;
62
+ export declare function InjectGenericTypeArgument(constructorFunction: Function, genericArgumentType: Function): (target: Object, property: string | symbol) => void;
63
+ export declare function InjectTypeArgument(genericArgumentType: Function): (target: Object, property: string | symbol) => void;
64
+ export declare function InjectAbstract(cTor: Function): (target: Object, property: string | symbol) => void;
65
+ export declare function Validate(): (target: Function) => void;
66
+ export declare function ValidateObject<T>(obj: T): {
67
+ Field: string;
68
+ Message: string;
69
+ }[];
70
+ export declare function Required(message?: string): (target: Object, property: string) => void;
71
+ export declare function MaxLenght(max: number, message?: string): (target: Object, property: string) => void;
72
+ export declare function MinLenght(min: number, message?: string): (target: Object, property: string) => void;
73
+ export declare function Max(max: number, message?: string): (target: Object, property: string) => void;
74
+ export declare function Min(min: number, message?: string): (target: Object, property: string) => void;
75
+ export declare function Regex(regex: RegExp, message?: string): (target: Object, property: string) => void;
76
+ export declare function Rule<T>(action: (a: T) => boolean, message?: string): (target: Object, property: string) => void;
77
+ export declare function RequiredFromBodyArg(paramName?: string): (target: Object, methodName: string, parameterIndex: number) => void;
78
+ export declare function OptionalFromBodyArg(paramName?: string): (target: Object, methodName: string, parameterIndex: number) => void;
79
+ export declare function FromBody(paramName?: string, required?: boolean): (target: Object, methodName: string, parameterIndex: number) => void;
80
+ export declare function FromFiles(fileName?: string, required?: boolean): (target: Object, methodName: string, parameterIndex: number) => void;
81
+ export declare function MaxFilesSize(bytes: number): (target: Function) => void;
82
+ export declare function RequiredFromQueryArg(paramName?: string): (target: Object, methodName: string, parameterIndex: number) => void;
83
+ export declare function OptionalFromQueryArg(paramName?: string): (target: Object, methodName: string, parameterIndex: number) => void;
84
+ export declare function FromQuery(paramName?: string, required?: boolean): (target: Object, methodName: string, parameterIndex: number) => void;
85
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,CAAC;AAE1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAErF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAA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