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.
- package/dist/model/Controller.js +39 -39
- package/dist/model/Server.js +1 -2
- package/package.json +1 -1
package/dist/model/Controller.js
CHANGED
|
@@ -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.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
});
|
|
129
|
-
global.OPEN_API_DOC = {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
}
|
package/dist/model/Server.js
CHANGED
|
@@ -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",
|
|
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.
|
|
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>",
|