c2-http 1.0.110 → 1.0.111

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.
@@ -94,45 +94,45 @@ function OpenApi(target) {
94
94
  return class extends target {
95
95
  constructor() {
96
96
  super(); // Chama o construtor da classe original
97
- const paths = {};
98
- this.routesControlled.forEach((route) => {
99
- const methods = {};
100
- methods[route.method] = {
101
- tags: [target.name]
102
- };
103
- if (route.middlewareCheckAuthorization) {
104
- methods[route.method].description = `${methods[route.method].description ?? ""} \nRoles necessárias: ${route.middlewareCheckAuthorization.roles.join(", ")}`;
105
- methods[route.method].security = [
106
- {
107
- OAuth2: route.middlewareCheckAuthorization.roles
108
- }
109
- ];
110
- methods[route.method].responses =
111
- {
112
- "200": {
113
- "content": {
114
- "application/json": {
115
- "schema": {
116
- "type": "object"
117
- }
118
- }
119
- }
120
- }
121
- };
122
- }
123
- const pathsAux = route.uri.replace(/:([^/]+)/g, "{$1}");
124
- paths[pathsAux] = {
125
- ...paths[pathsAux],
126
- ...methods
127
- };
128
- });
129
- global.OPEN_API_DOC = {
130
- ...global.OPEN_API_DOC,
131
- paths: {
132
- ...global.OPEN_API_DOC.paths,
133
- ...paths
134
- }
135
- };
97
+ // const paths: { [key: string]: any } = {}
98
+ // this.forEach((route: any) => {
99
+ // const methods: { [key: string]: any } = {}
100
+ // methods[route.method] = {
101
+ // tags: [target.name]
102
+ // }
103
+ // if (route.middlewareCheckAuthorization) {
104
+ // methods[route.method].description = `${methods[route.method].description ?? ""} \nRoles necessárias: ${route.middlewareCheckAuthorization.roles.join(", ")}`
105
+ // methods[route.method].security = [
106
+ // {
107
+ // OAuth2: route.middlewareCheckAuthorization.roles
108
+ // }
109
+ // ]
110
+ // methods[route.method].responses =
111
+ // {
112
+ // "200": {
113
+ // "content": {
114
+ // "application/json": {
115
+ // "schema": {
116
+ // "type": "object"
117
+ // }
118
+ // }
119
+ // }
120
+ // }
121
+ // }
122
+ // }
123
+ // const pathsAux = route.uri.replace(/:([^/]+)/g, "{$1}")
124
+ // paths[pathsAux] = {
125
+ // ...paths[pathsAux],
126
+ // ...methods
127
+ // };
128
+ // });
129
+ // (global as any).OPEN_API_DOC = {
130
+ // ...(global as any).OPEN_API_DOC,
131
+ // paths: {
132
+ // ...(global as any).OPEN_API_DOC.paths,
133
+ // ...paths
134
+ // }
135
+ // }
136
136
  }
137
137
  };
138
138
  }
@@ -7,7 +7,6 @@ exports.Server = void 0;
7
7
  const c2_util_1 = require("c2-util");
8
8
  const express_1 = __importDefault(require("express"));
9
9
  const express_prom_bundle_1 = __importDefault(require("express-prom-bundle"));
10
- const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
11
10
  const i18n_1 = require("../i18n");
12
11
  const MiddlewareGlobals_1 = __importDefault(require("../middleware/global-middleware/MiddlewareGlobals"));
13
12
  const MiddlewareJwt_1 = __importDefault(require("../middleware/jwt-middlware/MiddlewareJwt"));
@@ -28,7 +27,7 @@ class Server {
28
27
  this.app.use(openController.router);
29
28
  pathsToMetrics = [...pathsToMetrics, ...openController.normalizedPaths];
30
29
  }
31
- this.app.use("/docs", swagger_ui_express_1.default.serve, swagger_ui_express_1.default.setup(global.OPEN_API_DOC));
30
+ // this.app.use("/docs", swaggerUI.serve, swaggerUI.setup((global as any).OPEN_API_DOC))
32
31
  (0, c2_util_1.log)("LOG", "Rotas abertas OK");
33
32
  this.app.use(MiddlewareJwt_1.default.config);
34
33
  for (const closeRouter of this.config.closeControllers) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.110",
3
+ "version": "1.0.111",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",