mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-20 10:39:07 +00:00
FIX: Connection and Network Flows (Create and Delete)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user