FIX: Connection and Network Flows (Create and Delete)

This commit is contained in:
Victor Radael
2022-08-17 15:58:00 -03:00
parent 6807b3e1a9
commit a9f68b87ca
6 changed files with 59 additions and 64 deletions
@@ -2,12 +2,7 @@ import {
NetworkConfigEntity,
NetworkConfigToCatalog,
} from '@dadosfera/protospack-v2/dist/lib/NetworkConfig/interfaces/entities';
import {
ApiProperty,
ApiPropertyOptional,
OmitType,
PickType,
} from '@nestjs/swagger';
import { ApiProperty, ApiPropertyOptional, PickType } from '@nestjs/swagger';
export enum NetworkConfigTypesEnum {
vpn = 'vpn',
@@ -19,37 +14,48 @@ export class NetworkConfigDto implements NetworkConfigEntity {
@ApiProperty()
id: string;
@ApiProperty()
name: string;
created_at: string;
@ApiProperty()
updated_at: string;
@ApiProperty()
customer_name: string;
@ApiProperty()
description: string;
customer_id: string;
@ApiProperty()
properties: any;
@ApiProperty()
user_id: string;
@ApiProperty()
keywords: string;
@ApiProperty()
tags: string;
@ApiProperty()
network_type_id: string;
@ApiProperty()
network_type_name: string;
@ApiProperty({ enum: NetworkConfigTypesEnum })
type: string;
@ApiProperty({ enum: NetworkConfigPluginsEnum })
plugin: string;
@ApiProperty()
properties: any;
name: string;
@ApiProperty()
created_at: string;
@ApiProperty()
updated_at: string;
@ApiProperty()
network_type_id: string;
@ApiProperty()
network_type_name: string;
@ApiProperty()
user_id: string;
@ApiProperty()
customer_id: string;
@ApiProperty()
keywords: string;
@ApiProperty()
tags: string;
description: string;
}
export class NetworkConfigNoSecrets extends OmitType(NetworkConfigDto, [
'properties',
]) {}
export class CreateNetworkConfigReq extends PickType(NetworkConfigDto, [
'network_type_id',
'network_type_name',
'name',
'description',
'type',
'plugin',
]) {
@ApiProperty({ format: 'binary' })
ovpn_file: string;
}
export class NetworkConfigOpenVpnProperties {
@ApiProperty({ enum: NetworkConfigPluginsEnum })
plugin: NetworkConfigPluginsEnum;
@@ -122,24 +128,7 @@ export class FindNetworkConfigByidDetailsRes {
@ApiProperty()
network_config: FindNetworkConfigByidDetails;
}
export class CreateNetworkConfigReq extends PickType(NetworkConfigDto, [
'name',
'description',
'type',
'network_type_id',
'plugin',
]) {
@ApiProperty({
type: 'file',
properties: {
file: {
type: 'string',
format: 'binary',
},
},
})
OVPN_FILE: any;
}
export class CreateNetworkConfigRes {
@ApiProperty()
network_config: NetworkConfigToCatalogDto;