c2-http 1.0.49 → 1.0.50
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 +14 -25
- package/package.json +1 -1
package/dist/model/Controller.js
CHANGED
|
@@ -74,23 +74,21 @@ 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
|
+
tags: [target.name],
|
|
82
|
+
security: [
|
|
83
|
+
{
|
|
84
|
+
OAuth2: route.middlewaresRoles.roles
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
paths[route.uri] = {
|
|
89
|
+
...paths[route.uri],
|
|
90
|
+
...methods
|
|
91
|
+
};
|
|
94
92
|
});
|
|
95
93
|
global.OPEN_API_DOC = {
|
|
96
94
|
...global.OPEN_API_DOC,
|
|
@@ -100,15 +98,6 @@ function OpenApi(target) {
|
|
|
100
98
|
}
|
|
101
99
|
};
|
|
102
100
|
}
|
|
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
101
|
};
|
|
113
102
|
}
|
|
114
103
|
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.50",
|
|
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>",
|