mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-20 20:19:08 +00:00
Update Network Config Manager
This commit is contained in:
@@ -7,6 +7,7 @@ import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||
import documentEmpty from '../swagger_empty.json';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
import { writeFileSync } from 'fs';
|
||||
async function bootstrap() {
|
||||
DadosferaLogger.setupLogger({
|
||||
serviceName: 'maestro',
|
||||
@@ -40,6 +41,8 @@ async function bootstrap() {
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
|
||||
await writeFileSync('swagger.json', JSON.stringify(document));
|
||||
|
||||
if (process.env.ENV != 'stg' && process.env.ENV != 'prd')
|
||||
SwaggerModule.setup('api', app, document);
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { NetworkConfigEntity } from '@dadosfera/protospack-v2/dist/lib/NetworkConfig/interfaces/entities';
|
||||
import {
|
||||
NetworkConfigEntity,
|
||||
NetworkConfigToCatalog,
|
||||
} from '@dadosfera/protospack-v2/dist/lib/NetworkConfig/interfaces/entities';
|
||||
import {
|
||||
ApiProperty,
|
||||
ApiPropertyOptional,
|
||||
@@ -59,14 +62,49 @@ export class NetworkConfigOpenVpnProperties {
|
||||
@ApiPropertyOptional()
|
||||
TLS_AUTH_FILE?: string;
|
||||
}
|
||||
|
||||
export class NetworkConfigToCatalogDto implements NetworkConfigToCatalog {
|
||||
@ApiProperty()
|
||||
id: string;
|
||||
|
||||
@ApiProperty()
|
||||
customer_id: string;
|
||||
|
||||
@ApiProperty()
|
||||
plugin: string;
|
||||
|
||||
@ApiProperty()
|
||||
type: string;
|
||||
|
||||
@ApiProperty()
|
||||
name: string;
|
||||
|
||||
@ApiProperty()
|
||||
description: string;
|
||||
|
||||
@ApiProperty()
|
||||
created_at: string;
|
||||
|
||||
@ApiProperty()
|
||||
updated_at: string;
|
||||
|
||||
@ApiProperty()
|
||||
network_type_id: string;
|
||||
|
||||
@ApiProperty()
|
||||
network_type_name: string;
|
||||
}
|
||||
export class FindAllNetworkConfigsRes {
|
||||
@ApiProperty({ type: [NetworkConfigNoSecrets] })
|
||||
network_configs: NetworkConfigNoSecrets[];
|
||||
@ApiProperty({ type: [NetworkConfigToCatalogDto] })
|
||||
network_configs: NetworkConfigToCatalogDto[];
|
||||
|
||||
@ApiProperty()
|
||||
message: string;
|
||||
}
|
||||
|
||||
export class FindNetworkConfigByidRes {
|
||||
@ApiProperty()
|
||||
network_config: NetworkConfigNoSecrets;
|
||||
network_config: NetworkConfigToCatalogDto;
|
||||
}
|
||||
|
||||
export class FindNetworkConfigByidDetails extends PickType(NetworkConfigDto, [
|
||||
@@ -104,7 +142,7 @@ export class CreateNetworkConfigReq extends PickType(NetworkConfigDto, [
|
||||
}
|
||||
export class CreateNetworkConfigRes {
|
||||
@ApiProperty()
|
||||
network_config: NetworkConfigNoSecrets;
|
||||
network_config: NetworkConfigToCatalogDto;
|
||||
}
|
||||
|
||||
export class UpdateNetworkConfigReq {
|
||||
@@ -115,7 +153,7 @@ export class UpdateNetworkConfigReq {
|
||||
}
|
||||
export class UpdateNetworkConfigRes {
|
||||
@ApiProperty()
|
||||
network_config: NetworkConfigNoSecrets;
|
||||
network_config: NetworkConfigToCatalogDto;
|
||||
}
|
||||
|
||||
export class DeleteNetworkConfigRes {
|
||||
|
||||
Reference in New Issue
Block a user