Update feature

This commit is contained in:
Victor Radael
2022-08-12 10:38:20 -03:00
parent 7c5cf3f541
commit acd4dafc57
12 changed files with 229 additions and 177 deletions
@@ -1,3 +1,4 @@
import { NetworkConfigEntity } from '@dadosfera/protospack-v2/dist/lib/NetworkConfig/interfaces/entities';
import {
ApiProperty,
ApiPropertyOptional,
@@ -11,12 +12,10 @@ export enum NetworkConfigTypesEnum {
export enum NetworkConfigPluginsEnum {
openvpn = 'openvpn',
}
export class NetworkConfigDto {
export class NetworkConfigDto implements NetworkConfigEntity {
@ApiProperty()
id: string;
@ApiProperty()
secret_id: string;
@ApiProperty()
name: string;
@ApiProperty()
customer_name: string;
@@ -27,17 +26,26 @@ export class NetworkConfigDto {
@ApiProperty({ enum: NetworkConfigPluginsEnum })
plugin: string;
@ApiProperty()
credentials: any;
properties: any;
@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;
}
export class NetworkConfigNoSecrets extends OmitType(NetworkConfigDto, [
'secret_id',
'credentials',
'properties',
]) {}
export class NetworkConfigOpenVpnProperties {
@ApiProperty({ enum: NetworkConfigPluginsEnum })
@@ -15,9 +15,9 @@ export class NetworkConfigClientConfiguration {
NetworkConfig.ProtoPackages.ReadPackage,
NetworkConfig.ProtoPackages.WritePackage,
],
// credentials: undefined,
credentials:
process.env.ENV === 'local' ? undefined : credentials.createSsl(),
credentials: undefined,
// credentials:
// process.env.ENV === 'local' ? undefined : credentials.createSsl(),
protoPath: [
NetworkConfig.ProtoPaths.ReadFilePath,
NetworkConfig.ProtoPaths.WriteFilePath,