@expressots/core 2.9.0 → 2.10.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 (95) hide show
  1. package/lib/CHANGELOG.md +133 -85
  2. package/lib/cjs/application/app-container.js +93 -94
  3. package/lib/cjs/application/application-factory.js +74 -74
  4. package/lib/cjs/application/index.js +7 -7
  5. package/lib/cjs/common/color-service.provider.js +46 -47
  6. package/lib/cjs/common/index.js +2 -2
  7. package/lib/cjs/common/package-resolver.provider.js +35 -35
  8. package/lib/cjs/common/project-config.provider.js +2 -2
  9. package/lib/cjs/console/console.js +60 -61
  10. package/lib/cjs/console/index.js +5 -5
  11. package/lib/cjs/container-module/container-module.js +111 -111
  12. package/lib/cjs/container-module/index.js +6 -6
  13. package/lib/cjs/controller/base-controller.js +74 -75
  14. package/lib/cjs/controller/index.js +5 -5
  15. package/lib/cjs/decorator/index.js +17 -17
  16. package/lib/cjs/decorator/scope-binding.js +44 -44
  17. package/lib/cjs/error/app-error.js +26 -26
  18. package/lib/cjs/error/error-handler-middleware.js +28 -28
  19. package/lib/cjs/error/index.js +9 -9
  20. package/lib/cjs/error/report.js +53 -54
  21. package/lib/cjs/error/status-code.js +89 -89
  22. package/lib/cjs/index.js +26 -26
  23. package/lib/cjs/middleware/index.js +32 -32
  24. package/lib/cjs/middleware/interfaces/body-parser.interface.js +2 -2
  25. package/lib/cjs/middleware/interfaces/compression.interface.js +2 -2
  26. package/lib/cjs/middleware/interfaces/cookie-parser.interface.js +2 -2
  27. package/lib/cjs/middleware/interfaces/cookie-session/cookie-session.interface.js +2 -2
  28. package/lib/cjs/middleware/interfaces/cookie-session/keygrip.interface.js +2 -2
  29. package/lib/cjs/middleware/interfaces/cors.interface.js +2 -2
  30. package/lib/cjs/middleware/interfaces/express-rate-limit.interface.js +2 -2
  31. package/lib/cjs/middleware/interfaces/express-session.interface.js +2 -2
  32. package/lib/cjs/middleware/interfaces/helmet.interface.js +2 -2
  33. package/lib/cjs/middleware/interfaces/morgan.interface.js +2 -2
  34. package/lib/cjs/middleware/interfaces/multer.interface.js +2 -2
  35. package/lib/cjs/middleware/interfaces/serve-favicon.interface.js +2 -2
  36. package/lib/cjs/middleware/interfaces/serve-static.interface.js +2 -2
  37. package/lib/cjs/middleware/middleware-resolver.js +72 -72
  38. package/lib/cjs/middleware/middleware-service.js +480 -481
  39. package/lib/cjs/provider/db-in-memory/db-in-memory.provider.js +82 -82
  40. package/lib/cjs/provider/dto-validator/dto-validator.provider.js +53 -53
  41. package/lib/cjs/provider/environment/env-validator.provider.js +98 -98
  42. package/lib/cjs/provider/index.js +13 -13
  43. package/lib/cjs/provider/logger/logger.provider.js +117 -117
  44. package/lib/cjs/provider/provider-manager.js +49 -50
  45. package/lib/cjs/render/handlebars.interface.js +2 -2
  46. package/lib/cjs/render/index.js +2 -2
  47. package/lib/cjs/render/render.type.js +2 -2
  48. package/lib/cjs/types/application/app-container.d.ts +62 -62
  49. package/lib/cjs/types/application/application-factory.d.ts +34 -34
  50. package/lib/cjs/types/application/index.d.ts +2 -2
  51. package/lib/cjs/types/common/color-service.provider.d.ts +29 -29
  52. package/lib/cjs/types/common/index.d.ts +1 -1
  53. package/lib/cjs/types/common/package-resolver.provider.d.ts +8 -8
  54. package/lib/cjs/types/common/project-config.provider.d.ts +56 -47
  55. package/lib/cjs/types/console/console.d.ts +27 -27
  56. package/lib/cjs/types/console/index.d.ts +1 -1
  57. package/lib/cjs/types/container-module/container-module.d.ts +28 -28
  58. package/lib/cjs/types/container-module/index.d.ts +1 -1
  59. package/lib/cjs/types/controller/base-controller.d.ts +48 -48
  60. package/lib/cjs/types/controller/index.d.ts +1 -1
  61. package/lib/cjs/types/decorator/index.d.ts +1 -1
  62. package/lib/cjs/types/decorator/scope-binding.d.ts +33 -33
  63. package/lib/cjs/types/error/app-error.d.ts +29 -29
  64. package/lib/cjs/types/error/error-handler-middleware.d.ts +11 -11
  65. package/lib/cjs/types/error/index.d.ts +3 -3
  66. package/lib/cjs/types/error/report.d.ts +25 -25
  67. package/lib/cjs/types/error/status-code.d.ts +136 -136
  68. package/lib/cjs/types/index.d.ts +10 -10
  69. package/lib/cjs/types/middleware/index.d.ts +13 -13
  70. package/lib/cjs/types/middleware/interfaces/body-parser.interface.d.ts +33 -33
  71. package/lib/cjs/types/middleware/interfaces/compression.interface.d.ts +98 -98
  72. package/lib/cjs/types/middleware/interfaces/cookie-parser.interface.d.ts +9 -9
  73. package/lib/cjs/types/middleware/interfaces/cookie-session/cookie-session.interface.d.ts +57 -57
  74. package/lib/cjs/types/middleware/interfaces/cookie-session/keygrip.interface.d.ts +27 -27
  75. package/lib/cjs/types/middleware/interfaces/cors.interface.d.ts +57 -57
  76. package/lib/cjs/types/middleware/interfaces/express-rate-limit.interface.d.ts +292 -292
  77. package/lib/cjs/types/middleware/interfaces/express-session.interface.d.ts +207 -207
  78. package/lib/cjs/types/middleware/interfaces/helmet.interface.d.ts +210 -210
  79. package/lib/cjs/types/middleware/interfaces/morgan.interface.d.ts +40 -40
  80. package/lib/cjs/types/middleware/interfaces/multer.interface.d.ts +255 -255
  81. package/lib/cjs/types/middleware/interfaces/serve-favicon.interface.d.ts +11 -11
  82. package/lib/cjs/types/middleware/interfaces/serve-static.interface.d.ts +70 -70
  83. package/lib/cjs/types/middleware/middleware-resolver.d.ts +11 -11
  84. package/lib/cjs/types/middleware/middleware-service.d.ts +368 -368
  85. package/lib/cjs/types/provider/db-in-memory/db-in-memory.provider.d.ts +43 -43
  86. package/lib/cjs/types/provider/dto-validator/dto-validator.provider.d.ts +11 -11
  87. package/lib/cjs/types/provider/environment/env-validator.provider.d.ts +35 -35
  88. package/lib/cjs/types/provider/index.d.ts +5 -5
  89. package/lib/cjs/types/provider/logger/logger.provider.d.ts +54 -54
  90. package/lib/cjs/types/provider/provider-manager.d.ts +16 -16
  91. package/lib/cjs/types/render/handlebars.interface.d.ts +46 -46
  92. package/lib/cjs/types/render/index.d.ts +2 -2
  93. package/lib/cjs/types/render/render.type.d.ts +12 -12
  94. package/lib/package.json +16 -17
  95. package/package.json +16 -17
@@ -1,70 +1,70 @@
1
- /// <reference types="node" />
2
- import http from "http";
3
- interface ServeStaticOptions<R extends http.ServerResponse = http.ServerResponse> {
4
- /**
5
- * Enable or disable accepting ranged requests, defaults to true.
6
- * Disabling this will not send Accept-Ranges and ignore the contents of the Range request header.
7
- */
8
- acceptRanges?: boolean | undefined;
9
- /**
10
- * Enable or disable setting Cache-Control response header, defaults to true.
11
- * Disabling this will ignore the immutable and maxAge options.
12
- */
13
- cacheControl?: boolean | undefined;
14
- /**
15
- * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
16
- * Note this check is done on the path itself without checking if the path actually exists on the disk.
17
- * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
18
- * The default value is 'ignore'.
19
- * 'allow' No special treatment for dotfiles
20
- * 'deny' Send a 403 for any request for a dotfile
21
- * 'ignore' Pretend like the dotfile does not exist and call next()
22
- */
23
- dotfiles?: string | undefined;
24
- /**
25
- * Enable or disable etag generation, defaults to true.
26
- */
27
- etag?: boolean | undefined;
28
- /**
29
- * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
30
- * The first that exists will be served. Example: ['html', 'htm'].
31
- * The default value is false.
32
- */
33
- extensions?: Array<string> | false | undefined;
34
- /**
35
- * Let client errors fall-through as unhandled requests, otherwise forward a client error.
36
- * The default value is true.
37
- */
38
- fallthrough?: boolean | undefined;
39
- /**
40
- * Enable or disable the immutable directive in the Cache-Control response header.
41
- * If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
42
- */
43
- immutable?: boolean | undefined;
44
- /**
45
- * By default this module will send "index.html" files in response to a request on a directory.
46
- * To disable this set false or to supply a new index pass a string or an array in preferred order.
47
- */
48
- index?: boolean | string | Array<string> | undefined;
49
- /**
50
- * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
51
- */
52
- lastModified?: boolean | undefined;
53
- /**
54
- * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
55
- */
56
- maxAge?: number | string | undefined;
57
- /**
58
- * Redirect to trailing "/" when the pathname is a dir. Defaults to true.
59
- */
60
- redirect?: boolean | undefined;
61
- /**
62
- * Function to set custom headers on response. Alterations to the headers need to occur synchronously.
63
- * The function is called as fn(res, path, stat), where the arguments are:
64
- * res the response object
65
- * path the file path that is being sent
66
- * stat the stat object of the file that is being sent
67
- */
68
- setHeaders?: ((res: R, path: string, stat: any) => any) | undefined;
69
- }
70
- export { ServeStaticOptions };
1
+ /// <reference types="node" />
2
+ import http from "http";
3
+ interface ServeStaticOptions<R extends http.ServerResponse = http.ServerResponse> {
4
+ /**
5
+ * Enable or disable accepting ranged requests, defaults to true.
6
+ * Disabling this will not send Accept-Ranges and ignore the contents of the Range request header.
7
+ */
8
+ acceptRanges?: boolean | undefined;
9
+ /**
10
+ * Enable or disable setting Cache-Control response header, defaults to true.
11
+ * Disabling this will ignore the immutable and maxAge options.
12
+ */
13
+ cacheControl?: boolean | undefined;
14
+ /**
15
+ * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
16
+ * Note this check is done on the path itself without checking if the path actually exists on the disk.
17
+ * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
18
+ * The default value is 'ignore'.
19
+ * 'allow' No special treatment for dotfiles
20
+ * 'deny' Send a 403 for any request for a dotfile
21
+ * 'ignore' Pretend like the dotfile does not exist and call next()
22
+ */
23
+ dotfiles?: string | undefined;
24
+ /**
25
+ * Enable or disable etag generation, defaults to true.
26
+ */
27
+ etag?: boolean | undefined;
28
+ /**
29
+ * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
30
+ * The first that exists will be served. Example: ['html', 'htm'].
31
+ * The default value is false.
32
+ */
33
+ extensions?: Array<string> | false | undefined;
34
+ /**
35
+ * Let client errors fall-through as unhandled requests, otherwise forward a client error.
36
+ * The default value is true.
37
+ */
38
+ fallthrough?: boolean | undefined;
39
+ /**
40
+ * Enable or disable the immutable directive in the Cache-Control response header.
41
+ * If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
42
+ */
43
+ immutable?: boolean | undefined;
44
+ /**
45
+ * By default this module will send "index.html" files in response to a request on a directory.
46
+ * To disable this set false or to supply a new index pass a string or an array in preferred order.
47
+ */
48
+ index?: boolean | string | Array<string> | undefined;
49
+ /**
50
+ * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
51
+ */
52
+ lastModified?: boolean | undefined;
53
+ /**
54
+ * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
55
+ */
56
+ maxAge?: number | string | undefined;
57
+ /**
58
+ * Redirect to trailing "/" when the pathname is a dir. Defaults to true.
59
+ */
60
+ redirect?: boolean | undefined;
61
+ /**
62
+ * Function to set custom headers on response. Alterations to the headers need to occur synchronously.
63
+ * The function is called as fn(res, path, stat), where the arguments are:
64
+ * res the response object
65
+ * path the file path that is being sent
66
+ * stat the stat object of the file that is being sent
67
+ */
68
+ setHeaders?: ((res: R, path: string, stat: any) => any) | undefined;
69
+ }
70
+ export { ServeStaticOptions };
@@ -1,11 +1,11 @@
1
- import { ExpressHandler } from "./middleware-service";
2
- /**
3
- * A utility function that wraps the creation and retrieval of middleware.
4
- * It creates a new instance of MiddlewareResolver and calls the getMiddleware method.
5
- *
6
- * @param {string} middleware - The name of the middleware to be retrieved.
7
- * @param {...any} options - Optional arguments to configure the middleware.
8
- * @returns {express.RequestHandler | null} - Returns the configured middleware or null if not found or not installed.
9
- */
10
- declare function middlewareResolver(middleware: string, ...options: any): ExpressHandler | null;
11
- export { middlewareResolver };
1
+ import { ExpressHandler } from "./middleware-service";
2
+ /**
3
+ * A utility function that wraps the creation and retrieval of middleware.
4
+ * It creates a new instance of MiddlewareResolver and calls the getMiddleware method.
5
+ *
6
+ * @param {string} middleware - The name of the middleware to be retrieved.
7
+ * @param {...any} options - Optional arguments to configure the middleware.
8
+ * @returns {express.RequestHandler | null} - Returns the configured middleware or null if not found or not installed.
9
+ */
10
+ declare function middlewareResolver(middleware: string, ...options: any): ExpressHandler | null;
11
+ export { middlewareResolver };