c2-http 1.0.49 → 1.0.51
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 +15 -25
- package/package.json +1 -1
package/dist/model/Controller.js
CHANGED
|
@@ -74,23 +74,22 @@ function OpenApi(target) {
|
|
|
74
74
|
return class extends target {
|
|
75
75
|
constructor() {
|
|
76
76
|
super(); // Chama o construtor da classe original
|
|
77
|
-
// const controller = target as unknown as Controller;
|
|
78
77
|
const paths = {};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
78
|
+
this.routesControlled.forEach((route) => {
|
|
79
|
+
const methods = {};
|
|
80
|
+
methods[route.method] = {
|
|
81
|
+
description: `Roles necessárias: ${route.middlewaresRoles.roles.join(", ")}`,
|
|
82
|
+
tags: [target.name],
|
|
83
|
+
security: [
|
|
84
|
+
{
|
|
85
|
+
OAuth2: route.middlewaresRoles.roles
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
paths[route.uri] = {
|
|
90
|
+
...paths[route.uri],
|
|
91
|
+
...methods
|
|
92
|
+
};
|
|
94
93
|
});
|
|
95
94
|
global.OPEN_API_DOC = {
|
|
96
95
|
...global.OPEN_API_DOC,
|
|
@@ -100,15 +99,6 @@ function OpenApi(target) {
|
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
101
|
}
|
|
103
|
-
getMethodsUsed2(obj) {
|
|
104
|
-
const trueProperties = [];
|
|
105
|
-
for (const key in obj) {
|
|
106
|
-
if (obj[key] === true) {
|
|
107
|
-
trueProperties.push(key);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return trueProperties;
|
|
111
|
-
}
|
|
112
102
|
};
|
|
113
103
|
}
|
|
114
104
|
exports.OpenApi = OpenApi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.51",
|
|
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>",
|