framework-do-dede 2.0.21 → 3.0.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 (91) hide show
  1. package/dist/application/controller.d.ts +70 -0
  2. package/dist/{decorators → application}/controller.js +45 -33
  3. package/dist/application/entity.d.ts +21 -0
  4. package/dist/application/entity.js +161 -0
  5. package/dist/application/index.d.ts +5 -0
  6. package/dist/application/index.js +4 -0
  7. package/dist/{protocols/StorageGateway.d.ts → application/services.d.ts} +2 -0
  8. package/dist/application/services.js +20 -0
  9. package/dist/application/usecase.d.ts +11 -0
  10. package/dist/application/usecase.js +24 -0
  11. package/dist/dede.d.ts +5 -4
  12. package/dist/dede.js +22 -26
  13. package/dist/{handlers → http}/controller.handler.d.ts +2 -2
  14. package/dist/http/controller.handler.js +160 -0
  15. package/dist/http/{ExpressHttpServer.d.ts → elysia-server.adapter.d.ts} +2 -2
  16. package/dist/http/{ElysiaHttpServer.js → elysia-server.adapter.js} +2 -2
  17. package/dist/http/{ElysiaHttpServer.d.ts → express-server.adapter.d.ts} +2 -2
  18. package/dist/http/express-server.adapter.js +25 -0
  19. package/dist/http/{HttpServer.d.ts → http-server.d.ts} +13 -0
  20. package/dist/http/{HttpServer.js → http-server.js} +4 -2
  21. package/dist/http/index.d.ts +2 -2
  22. package/dist/http/index.js +2 -2
  23. package/dist/infra/di/registry.d.ts +11 -0
  24. package/dist/infra/di/registry.js +32 -0
  25. package/package.json +5 -4
  26. package/dist/decorators/controller.d.ts +0 -38
  27. package/dist/decorators/di.d.ts +0 -1
  28. package/dist/decorators/di.js +0 -7
  29. package/dist/decorators/entity.d.ts +0 -12
  30. package/dist/decorators/entity.js +0 -65
  31. package/dist/decorators/index.d.ts +0 -6
  32. package/dist/decorators/index.js +0 -6
  33. package/dist/decorators/services.d.ts +0 -1
  34. package/dist/decorators/services.js +0 -27
  35. package/dist/decorators/usecase.d.ts +0 -4
  36. package/dist/decorators/usecase.js +0 -15
  37. package/dist/di/registry.d.ts +0 -17
  38. package/dist/di/registry.js +0 -51
  39. package/dist/domain/Entity.d.ts +0 -5
  40. package/dist/domain/Entity.js +0 -132
  41. package/dist/handlers/controller.handler.js +0 -215
  42. package/dist/handlers/index.d.ts +0 -3
  43. package/dist/handlers/index.js +0 -3
  44. package/dist/handlers/usecase.handler.d.ts +0 -4
  45. package/dist/handlers/usecase.handler.js +0 -43
  46. package/dist/http/ExpressHttpServer.js +0 -19
  47. package/dist/index.d.ts +0 -7
  48. package/dist/index.js +0 -6
  49. package/dist/protocols/Controller.d.ts +0 -17
  50. package/dist/protocols/Controller.js +0 -1
  51. package/dist/protocols/CreateRepository.d.ts +0 -4
  52. package/dist/protocols/CreateRepository.js +0 -1
  53. package/dist/protocols/DeleteRepository.d.ts +0 -3
  54. package/dist/protocols/DeleteRepository.js +0 -1
  55. package/dist/protocols/DeleteRepositoryBy.d.ts +0 -3
  56. package/dist/protocols/DeleteRepositoryBy.js +0 -1
  57. package/dist/protocols/ExistsBy.d.ts +0 -3
  58. package/dist/protocols/ExistsBy.js +0 -1
  59. package/dist/protocols/HttpMiddleware.d.ts +0 -3
  60. package/dist/protocols/HttpMiddleware.js +0 -1
  61. package/dist/protocols/HttpServerError.d.ts +0 -5
  62. package/dist/protocols/HttpServerError.js +0 -1
  63. package/dist/protocols/NotExistsBy.d.ts +0 -3
  64. package/dist/protocols/NotExistsBy.js +0 -1
  65. package/dist/protocols/Request.d.ts +0 -5
  66. package/dist/protocols/Request.js +0 -1
  67. package/dist/protocols/RequestMetrics.d.ts +0 -18
  68. package/dist/protocols/RequestMetrics.js +0 -1
  69. package/dist/protocols/RequestMetricsHandler.d.ts +0 -5
  70. package/dist/protocols/RequestMetricsHandler.js +0 -1
  71. package/dist/protocols/RestoreManyRepository.d.ts +0 -9
  72. package/dist/protocols/RestoreManyRepository.js +0 -1
  73. package/dist/protocols/RestoreRepository.d.ts +0 -3
  74. package/dist/protocols/RestoreRepository.js +0 -1
  75. package/dist/protocols/RestoreRepositoryBy.d.ts +0 -3
  76. package/dist/protocols/RestoreRepositoryBy.js +0 -1
  77. package/dist/protocols/StorageGateway.js +0 -1
  78. package/dist/protocols/UpdateRepository.d.ts +0 -4
  79. package/dist/protocols/UpdateRepository.js +0 -1
  80. package/dist/protocols/UseCase.d.ts +0 -3
  81. package/dist/protocols/UseCase.js +0 -1
  82. package/dist/protocols/Validation.d.ts +0 -3
  83. package/dist/protocols/Validation.js +0 -1
  84. package/dist/protocols/index.d.ts +0 -18
  85. package/dist/protocols/index.js +0 -1
  86. package/dist/utils/Log.d.ts +0 -6
  87. package/dist/utils/Log.js +0 -42
  88. /package/dist/http/{FrameworkError.d.ts → errors/framework.d.ts} +0 -0
  89. /package/dist/http/{FrameworkError.js → errors/framework.js} +0 -0
  90. /package/dist/http/{ServerError.d.ts → errors/server.d.ts} +0 -0
  91. /package/dist/http/{ServerError.js → errors/server.js} +0 -0
@@ -1,18 +0,0 @@
1
- import type { HttpMiddleware } from './HttpMiddleware';
2
- import type { UseCase } from './UseCase';
3
- import type { Validation } from './Validation';
4
- import type { CreateRepository } from './CreateRepository';
5
- import type { DeleteRepository } from './DeleteRepository';
6
- import type { DeleteRepositoryBy } from './DeleteRepositoryBy';
7
- import type { UpdateRepository } from './UpdateRepository';
8
- import type { RestoreRepository } from './RestoreRepository';
9
- import type { RestoreRepositoryBy } from './RestoreRepositoryBy';
10
- import type { ExistsBy } from './ExistsBy';
11
- import type { NotExistsBy } from './NotExistsBy';
12
- import type { RestoreManyRepository } from './RestoreManyRepository';
13
- import type { RequestMetricsHandler } from './RequestMetricsHandler';
14
- import type { Request } from './Request';
15
- import type { RequestMetrics } from './RequestMetrics';
16
- import type { HttpServerError } from './HttpServerError';
17
- import type { StorageGateway } from './StorageGateway';
18
- export type { Request, RequestMetrics, HttpMiddleware, UseCase, Validation, CreateRepository, DeleteRepository, DeleteRepositoryBy, UpdateRepository, RestoreRepository, RestoreRepositoryBy, RestoreManyRepository, RequestMetricsHandler, HttpServerError, StorageGateway, ExistsBy, NotExistsBy };
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export declare class Log {
2
- static info: (text: string) => void;
3
- static error: (text: string) => void;
4
- static success: (text: string) => void;
5
- static warning: (text: string) => void;
6
- }
package/dist/utils/Log.js DELETED
@@ -1,42 +0,0 @@
1
- const logStyles = {
2
- reset: "\x1b[0m",
3
- bright: "\x1b[1m",
4
- dim: "\x1b[2m",
5
- underscore: "\x1b[4m",
6
- blink: "\x1b[5m",
7
- reverse: "\x1b[7m",
8
- hidden: "\x1b[8m",
9
- // Foreground (text) colors
10
- fg: {
11
- black: "\x1b[30m",
12
- red: "\x1b[31m",
13
- green: "\x1b[32m",
14
- yellow: "\x1b[33m",
15
- blue: "\x1b[34m",
16
- magenta: "\x1b[35m",
17
- cyan: "\x1b[36m",
18
- white: "\x1b[37m",
19
- crimson: "\x1b[38m"
20
- },
21
- // Background colors
22
- bg: {
23
- black: "\x1b[40m",
24
- red: "\x1b[41m",
25
- green: "\x1b[42m",
26
- yellow: "\x1b[43m",
27
- blue: "\x1b[44m",
28
- magenta: "\x1b[45m",
29
- cyan: "\x1b[46m",
30
- white: "\x1b[47m",
31
- crimson: "\x1b[48m"
32
- }
33
- };
34
- const log = (color, text) => {
35
- console.log(`${color}%s${logStyles.reset}`, text);
36
- };
37
- export class Log {
38
- static info = (text) => log(logStyles.fg.cyan, text);
39
- static error = (text) => log(logStyles.fg.red, text);
40
- static success = (text) => log(logStyles.fg.green, text);
41
- static warning = (text) => log(logStyles.fg.yellow, text);
42
- }
File without changes