Skip to content

Commit cadc038

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into pr
2 parents 07e8449 + 71e908a commit cadc038

File tree

11 files changed

+153
-5
lines changed

11 files changed

+153
-5
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: "[EN] Bug report"
3+
about: Create a report to help us improve
4+
title: "[EN][BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
### Title: [Brief Description of the Bug]
11+
12+
#### Description:
13+
Describe in detail the problem you encountered. Include any relevant context that may help understand the origin of the bug.
14+
15+
#### Steps to Reproduce:
16+
1. List the steps necessary to reproduce the problem.
17+
2. Try to be as specific as possible.
18+
3. If the problem occurs in a specific scenario, describe it here.
19+
20+
#### Expected Behavior:
21+
Describe what you expected to happen when following the steps above.
22+
23+
#### Current Behavior:
24+
Explain what actually happens when you follow the steps above.
25+
26+
#### Screenshots/Videos:
27+
If possible, add screenshots or videos illustrating the problem. This can be extremely helpful in understanding the issue.
28+
29+
#### Environment:
30+
- **Server:** [e.g., Ubuntu 18.04]
31+
- **API Version:** [e.g., 1.5.4]
32+
- **Other Hardware/Software Specifications:** [e.g., CPU, GPU]
33+
34+
#### Submitting Logs:
35+
Please attach logs that may be related to the problem. If the logs contain sensitive information, consider sending them privately to one of the project maintainers.
36+
37+
#### Additional Notes:
38+
Include here any other information that you think might be useful in understanding or resolving the bug.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: "[EN] Feature request"
3+
about: Suggest an idea for the API
4+
title: "[EN][FEAT]"
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
### Title: [Brief Description of Feature Request]
11+
12+
#### Detailed Description:
13+
Clearly and in detail, describe the functionality you wish to be implemented. Explain how this fits into the context of the project.
14+
15+
#### Rationale:
16+
Explain why this functionality would be useful for the project. This helps in understanding the importance and priority of the request.
17+
18+
#### Usage Examples:
19+
Provide specific examples of how this feature could be used. This can include scenarios or use cases where the feature would be particularly beneficial.
20+
21+
#### Possible Implementations:
22+
If you have ideas on how this feature might be implemented, please share them here. This is not mandatory but can be helpful for the development team.
23+
24+
#### Impact on the Project:
25+
Discuss how this new feature could impact other parts of the project, if applicable.
26+
27+
#### Additional Notes:
28+
Any other information you believe is relevant to your request.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: "[PT] Reportar bug"
3+
about: Reportar um problema
4+
title: "[PT][BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
### Título: [Breve Descrição do Bug]
11+
12+
#### Descrição:
13+
Descreva detalhadamente o problema que você encontrou. Inclua qualquer contexto relevante que possa ajudar a entender a origem do bug.
14+
15+
#### Passos para Reproduzir:
16+
1. Liste os passos necessários para reproduzir o problema.
17+
2. Tente ser o mais específico possível.
18+
3. Se o problema ocorrer em um cenário específico, descreva-o aqui.
19+
20+
#### Comportamento Esperado:
21+
Descreva o que você esperava que acontecesse quando seguisse os passos acima.
22+
23+
#### Comportamento Atual:
24+
Explique o que realmente acontece quando você segue os passos acima.
25+
26+
#### Capturas de Tela/Vídeos:
27+
Se possível, adicione capturas de tela ou vídeos que ilustrem o problema. Isso pode ser extremamente útil para entender o problema.
28+
29+
#### Ambiente:
30+
- **Servidor:** [ex: Ubuntu 18.04]
31+
- **Versão da API:** [ex: 1.5.4]
32+
- **Outras Especificações de Hardware/Software:** [ex: CPU, GPU]
33+
34+
#### Envio de Logs:
35+
Por favor, anexe os logs que possam estar relacionados ao problema. Se os logs contiverem informações sensíveis, considere enviá-los de forma privada para um dos mantenedores do projeto.
36+
37+
#### Notas Adicionais:
38+
Inclua aqui qualquer outra informação que você ache que possa ser útil para entender ou resolver o bug.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: "[PT] Solicitar recurso"
3+
about: Sugira novos recursos para a API
4+
title: "[PT][FEAT]"
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
### Título: [Breve Descrição da Solicitação de Recurso]
11+
12+
#### Descrição Detalhada:
13+
Descreva claramente e em detalhes a funcionalidade que você deseja que seja implementada. Explique como isso se encaixa no contexto do projeto.
14+
15+
#### Racional:
16+
Explique por que essa funcionalidade seria útil para o projeto. Isso ajuda a entender a importância e a prioridade da solicitação.
17+
18+
#### Exemplos de Uso:
19+
Forneça exemplos específicos de como essa funcionalidade poderia ser utilizada. Isso pode incluir cenários ou casos de uso onde a funcionalidade seria particularmente benéfica.
20+
21+
#### Possíveis Implementações:
22+
Se você tem ideias sobre como essa funcionalidade pode ser implementada, por favor, compartilhe-as aqui. Isso não é obrigatório, mas pode ser útil para a equipe de desenvolvimento.
23+
24+
#### Impacto no Projeto:
25+
Discuta como essa nova funcionalidade poderia impactar outras partes do projeto, se aplicável.
26+
27+
#### Notas Adicionais:
28+
Qualquer outra informação que você acredita ser relevante para a sua solicitação.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ docker-compose.yaml
3939
/test/
4040
/src/env.yml
4141
/store
42+
*.env
4243

4344
/temp/*
4445

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Fixed the pairing code
1414
* Adjusts in typebot
1515
* Fix the problem when disconnecting the instance and connecting again using mongodb
16+
* Options to disable docs and manager
1617

1718

1819
# 1.6.0 (2023-12-12 17:24)
File renamed without changes.

src/config/env.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { readFileSync } from 'fs';
33
import { load } from 'js-yaml';
44
import { join } from 'path';
55

6-
export type HttpServer = { TYPE: 'http' | 'https'; PORT: number; URL: string };
6+
export type HttpServer = {
7+
TYPE: 'http' | 'https';
8+
PORT: number;
9+
URL: string;
10+
DISABLE_DOCS: boolean;
11+
DISABLE_MANAGER: boolean;
12+
};
713

814
export type HttpMethods = 'POST' | 'GET' | 'PUT' | 'DELETE';
915
export type Cors = {
@@ -186,6 +192,8 @@ export class ConfigService {
186192
TYPE: (process.env.SERVER_TYPE as 'http' | 'https') || 'http',
187193
PORT: Number.parseInt(process.env.SERVER_PORT) || 8080,
188194
URL: process.env.SERVER_URL,
195+
DISABLE_DOCS: process.env?.SERVER_DISABLE_DOCS === 'true',
196+
DISABLE_MANAGER: process.env?.SERVER_DISABLE_MANAGER === 'true',
189197
},
190198
CORS: {
191199
ORIGIN: process.env.CORS_ORIGIN.split(',') || ['*'],

src/dev-env.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ SERVER:
99
TYPE: http # https
1010
PORT: 8080 # 443
1111
URL: localhost
12+
DISABLE_MANAGER: false
13+
DISABLE_DOCS: false
14+
1215

1316
CORS:
1417
ORIGIN:

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ function bootstrap() {
5353
app.use('/store', express.static(join(ROOT_DIR, 'store')));
5454

5555
app.use('/', router);
56-
app.use(swaggerRouter);
56+
57+
if (!configService.get('SERVER').DISABLE_DOCS) app.use(swaggerRouter);
5758

5859
app.use(
5960
(err: Error, req: Request, res: Response, next: NextFunction) => {

0 commit comments

Comments
 (0)