web_api_base 4.0.8 → 5.1.0

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 (56) hide show
  1. package/dist/Application.d.ts +3 -1
  2. package/dist/Application.js +173 -42
  3. package/dist/Application.js.map +1 -1
  4. package/dist/File/AbstractFileService.d.ts +11 -0
  5. package/dist/File/AbstractFileService.js +6 -0
  6. package/dist/File/AbstractFileService.js.map +1 -0
  7. package/dist/File/AbstractMultiPartRequestService.d.ts +16 -0
  8. package/dist/File/AbstractMultiPartRequestService.js +12 -0
  9. package/dist/File/AbstractMultiPartRequestService.js.map +1 -0
  10. package/dist/File/File.d.ts +5 -0
  11. package/dist/File/File.js +10 -0
  12. package/dist/File/File.js.map +1 -0
  13. package/dist/File/FileService.d.ts +12 -0
  14. package/dist/File/FileService.js +136 -0
  15. package/dist/File/FileService.js.map +1 -0
  16. package/dist/File/FormidableMultiPartRequestService.d.ts +4 -0
  17. package/dist/File/FormidableMultiPartRequestService.js +73 -0
  18. package/dist/File/FormidableMultiPartRequestService.js.map +1 -0
  19. package/dist/decorators/controllers/ControllerDecorators.d.ts +16 -0
  20. package/dist/decorators/controllers/ControllerDecorators.js +75 -0
  21. package/dist/decorators/controllers/ControllerDecorators.js.map +1 -1
  22. package/dist/decorators/documentation/DocumentationDecorators.js.map +1 -1
  23. package/dist/documentation/Documentation.js +6 -1
  24. package/dist/documentation/Documentation.js.map +1 -1
  25. package/dist/documentation/JS.js +103 -10
  26. package/dist/documentation/JS.js.map +1 -1
  27. package/dist/exceptions/DecoratorException.d.ts +3 -0
  28. package/dist/exceptions/DecoratorException.js +10 -0
  29. package/dist/exceptions/DecoratorException.js.map +1 -0
  30. package/dist/exceptions/FileNotFoundException.d.ts +3 -0
  31. package/dist/exceptions/FileNotFoundException.js +10 -0
  32. package/dist/exceptions/FileNotFoundException.js.map +1 -0
  33. package/dist/exceptions/InvalidEntityException.d.ts +3 -0
  34. package/dist/exceptions/InvalidEntityException.js +10 -0
  35. package/dist/exceptions/InvalidEntityException.js.map +1 -0
  36. package/dist/index.d.ts +7 -0
  37. package/dist/index.js +22 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/metadata/Type.d.ts +1 -0
  40. package/dist/metadata/Type.js +52 -0
  41. package/dist/metadata/Type.js.map +1 -1
  42. package/dist/midlewares/IMidleware.d.ts +3 -3
  43. package/dist/temp/Application.d.ts +5 -0
  44. package/dist/temp/Application.js +29 -0
  45. package/dist/temp/Application.js.map +1 -0
  46. package/dist/temp/Index.d.ts +1 -0
  47. package/dist/temp/Index.js +19 -0
  48. package/dist/temp/Index.js.map +1 -0
  49. package/dist/temp/controllers/StatusController.d.ts +25 -0
  50. package/dist/temp/controllers/StatusController.js +158 -0
  51. package/dist/temp/controllers/StatusController.js.map +1 -0
  52. package/dist/temp/service/SampleService.d.ts +11 -0
  53. package/dist/temp/service/SampleService.js +24 -0
  54. package/dist/temp/service/SampleService.js.map +1 -0
  55. package/package.json +3 -1
  56. package/readme.md +20 -0
package/readme.md CHANGED
@@ -257,6 +257,16 @@ export default class StatusController extends ControllerBase
257
257
  ```
258
258
 
259
259
 
260
+ ### @UseHeader()
261
+ Define that the request must have some header
262
+ ```typescript
263
+ @Route("/status")
264
+ @UseHeader('api_token')
265
+ export default class StatusController extends ControllerBase
266
+ {
267
+ ```
268
+
269
+
260
270
  # Model Bind decorators
261
271
 
262
272
  ### @FromBody()
@@ -304,8 +314,18 @@ public async GetByIdAsync(@FromQuery()id : number) : Promise<OKResult<User>>
304
314
  In the example above, the __model binding system__ will get the first query argument of request.
305
315
  We can also determine the name of parameter: __@FromQuery('id')__.
306
316
 
317
+ ### @FromFiles()
318
+ Extract a method File(web_api_base) type parameter from multipart/form-data request
307
319
 
308
320
 
321
+ ```typescript
322
+ @POST()
323
+ public async InsertAsync(@FromFiles()file: File) : Promise<User>
324
+ {
325
+ return await this._service.MoveFiles(file, newPath);
326
+ }
327
+ ```
328
+
309
329
  ## Sample of a complete controller
310
330
 
311
331
  ```typescript