@carno.js/swagger 0.2.9 → 0.2.10

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.
@@ -173,34 +173,34 @@ window.onload = () => {
173
173
  /**
174
174
  * Search controllers classes
175
175
  */
176
- // Percorra todos os arquivos de origem
176
+ // Walk through all source files
177
177
  for (const sourceFile of sourceFiles) {
178
- // Obtenha todas as classes no arquivo de origem
178
+ // Read all classes from the source file
179
179
  const classes = sourceFile.getClasses();
180
- // Percorra todas as classes
180
+ // Walk through each class
181
181
  for (const cls of classes) {
182
182
  // Verifique se a classe tem um decorador 'Controller'
183
183
  const controllerDecorator = cls.getDecorator('Controller');
184
184
  if (controllerDecorator) {
185
- // Obtenha o prefixo do controlador do decorador 'Controller'
185
+ // Read the controller prefix from the 'Controller' decorator
186
186
  const controllerPrefix = controllerDecorator.getArguments()[0]?.getText();
187
- // Percorra todos os métodos na classe
187
+ // Walk through every method in the class
188
188
  for (const method of cls.getMethods()) {
189
- // Verifique se o método tem um decorador HTTP
189
+ // Check whether the method has an HTTP decorator
190
190
  const httpDecorator = method.getDecorators().find(decorator => ['Get', 'Post', 'Put', 'Delete'].includes(decorator.getName()));
191
191
  if (httpDecorator) {
192
- // Obtenha o caminho da rota do decorador HTTP
192
+ // Read the route path from the HTTP decorator
193
193
  let routePath = httpDecorator.getArguments()[0]?.getText();
194
194
  routePath = controllerPrefix + routePath;
195
- // Obtenha o tipo de método HTTP do nome do decorador
195
+ // Read the HTTP method from the decorator name
196
196
  const httpMethod = httpDecorator.getName().toLowerCase();
197
- // Adicione a rota ao objeto Swagger
197
+ // Add the route to the Swagger object
198
198
  if (!swaggerObject.paths[routePath]) {
199
199
  swaggerObject.paths[routePath] = {};
200
200
  }
201
201
  swaggerObject.paths[routePath][httpMethod] = {
202
202
  summary: method.getJsDocs().map(jsDoc => jsDoc.getComment()).join('\n'),
203
- // Adicione mais propriedades conforme necessário
203
+ // Add more properties as needed
204
204
  };
205
205
  }
206
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carno.js/swagger",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Generate automatically swagger.json from your carno.js project",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
@@ -42,5 +42,5 @@
42
42
  "carno.js",
43
43
  "swagger"
44
44
  ],
45
- "gitHead": "cc116bcd2f96e3cf6e87bbb38d5e4dfe1245150a"
45
+ "gitHead": "5c765c2c9172bec7f509ca2513f6c10472ec89eb"
46
46
  }