diff --git a/src/core/model/Page.ts b/src/core/model/Page.ts index 8a063ca..da9e9f1 100644 --- a/src/core/model/Page.ts +++ b/src/core/model/Page.ts @@ -1,11 +1,11 @@ export interface Page { - content: T[]; - first: boolean; - last: boolean; - number: number; - numberOfElements: number; - size: number; - sort: any; - totalElements: number; - totalPages: number; + content: T[]; + first: boolean; + last: boolean; + number: number; + numberOfElements: number; + size: number; + sort: any; + totalElements: number; + totalPages: number; } diff --git a/src/model/discovery/DiscoverHost.ts b/src/model/discovery/DiscoverHost.ts index 0f42c0a..6578406 100644 --- a/src/model/discovery/DiscoverHost.ts +++ b/src/model/discovery/DiscoverHost.ts @@ -1,13 +1,12 @@ import { DiscoverPort } from "./DiscoverPort"; +import { MetaIPType } from "../meta"; export interface DiscoverHost { - firstScanRangev4?: string; - lastScanRangev4?: string; - excludeHostsv4?: string[]; - includeHostsv4?: string[]; - firstScanRangev6?: string; - lastScanRangev6?: string; - excludeHostsv6?: string[]; - includeHostsv6?: string[]; + metaIPType?: MetaIPType; + + firstScanRange?: string; + lastScanRange?: string; + excludeHosts?: string[]; + includeHosts?: string[]; discoverPort?: DiscoverPort; } diff --git a/src/model/discovery/Host.ts b/src/model/discovery/Host.ts index 3e8731e..3f025ca 100644 --- a/src/model/discovery/Host.ts +++ b/src/model/discovery/Host.ts @@ -1,11 +1,14 @@ import { Zone } from './Zone'; import { Port } from './Port'; +import { MetaIPType } from '../meta'; export interface Host { - metaIPTypeKey?: string; + metaIPType?: MetaIPType; address?: string; mac?: string; - discoveredDate?: Date; + zone?: Zone; portList?: Port[]; + + discoveredDate?: Date; } diff --git a/src/model/discovery/Port.ts b/src/model/discovery/Port.ts index 59239e6..ce64717 100644 --- a/src/model/discovery/Port.ts +++ b/src/model/discovery/Port.ts @@ -1,10 +1,12 @@ import { Host } from './Host'; import { Service } from './Service'; +import { MetaPortType } from '../meta'; export interface Port { - metaPortTypeKey?: string; + metaPortType?: MetaPortType; portNumber?: number; discoveredDate?: Date; + host?: Host; serviceList?: Service[]; } diff --git a/src/model/discovery/Service.ts b/src/model/discovery/Service.ts index 78c76fb..939e3a0 100644 --- a/src/model/discovery/Service.ts +++ b/src/model/discovery/Service.ts @@ -1,8 +1,11 @@ import { Port } from './Port'; +import { MetaCryptoType } from '../meta'; export interface Service { - metaCryptoTypeKey?: string; + metaCryptoType?: MetaCryptoType; name?: string; - discoveredDate?: Date; + port?: Port; + + discoveredDate?: Date; } \ No newline at end of file diff --git a/src/model/discovery/Zone.ts b/src/model/discovery/Zone.ts index 8111daf..c810e00 100644 --- a/src/model/discovery/Zone.ts +++ b/src/model/discovery/Zone.ts @@ -1,10 +1,12 @@ import { Host } from './Host'; +import { MetaIPType } from '../meta'; export interface Zone { network?: string; iface?: string; - metaIPTypeKey?: string; + metaIPType?: MetaIPType; address?: string; mac?: string; + discoveredDate?: Date; } diff --git a/src/model/domain/DomainMember.ts b/src/model/domain/DomainMember.ts index 890d095..54ae577 100644 --- a/src/model/domain/DomainMember.ts +++ b/src/model/domain/DomainMember.ts @@ -3,7 +3,7 @@ import { Member } from '../member'; export interface DomainMember { id?: number; - createDate?: Date; member?: Member; domain?: Domain; + createDate?: Date; } diff --git a/src/model/email/EmailAuth.ts b/src/model/email/EmailAuth.ts index 2266f84..ea473ce 100644 --- a/src/model/email/EmailAuth.ts +++ b/src/model/email/EmailAuth.ts @@ -5,10 +5,10 @@ import { Domain } from '../domain'; export interface EmailAuth { id?: number; - createDate?: Date; metaHistoryType?: MetaHistoryType; message?: string; probe?: Probe; member?: Member; domain?: Domain; + createDate?: Date; } diff --git a/src/model/history/History.ts b/src/model/history/History.ts index a06e783..d4a9abe 100644 --- a/src/model/history/History.ts +++ b/src/model/history/History.ts @@ -5,10 +5,10 @@ import { Domain } from '../domain'; export interface History { id?: number; - createDate?: Date; metaHistoryType?: MetaHistoryType; message?: string; probe?: Probe; member?: Member; domain?: Domain; + createDate?: Date; } diff --git a/src/model/member/Member.ts b/src/model/member/Member.ts index ced975b..4111209 100644 --- a/src/model/member/Member.ts +++ b/src/model/member/Member.ts @@ -3,7 +3,7 @@ import { MetaMemberStatus } from '../meta'; export interface Member { id?: number; email?: string; - pw?: string; + password?: string; name?: string; phone?: string; companyName?: string; diff --git a/src/model/member/MemberTotp.ts b/src/model/member/MemberTotp.ts index ebd1c68..ec9ee2a 100644 --- a/src/model/member/MemberTotp.ts +++ b/src/model/member/MemberTotp.ts @@ -4,7 +4,7 @@ export interface MemberTotp { id?: number; member?: Member; secretCode?: string; - createDate?: Date; updateDate?: Date; otpAuth?: string; + createDate?: Date; } diff --git a/src/model/meta/MetaCrawler.ts b/src/model/meta/MetaCrawler.ts index 2539b98..a673adf 100644 --- a/src/model/meta/MetaCrawler.ts +++ b/src/model/meta/MetaCrawler.ts @@ -2,6 +2,6 @@ export interface MetaCrawler { id?: number; key?: string; name?: string; - createDate?: Date; default?: boolean; + createDate?: Date; } diff --git a/src/model/meta/MetaCryptoType.ts b/src/model/meta/MetaCryptoType.ts index 8607bc6..0418b8d 100644 --- a/src/model/meta/MetaCryptoType.ts +++ b/src/model/meta/MetaCryptoType.ts @@ -4,3 +4,35 @@ export interface MetaCryptoType { key?: string; createDate?: Date; } + +export enum MetaCryptoTypeEnum { + NONE = 'NONE', + UNKNOWN = 'UNKNOWN', + AES = 'AES', + CIPHER = 'CIPHER', + DES = 'DES', + DSA = 'DSA', + ECDSA = 'ECDSA', + ELLIPTIC = 'ELLIPTIC', + HMAC = 'HMAC', + MD5 = 'MD5', + RAND = 'RAND', + RC4 = 'RC4', + RSA = 'RSA', + SHA1 = 'SHA1', + SHA256 = 'SHA256', + SUBTLE = 'SUBTLE', + TLS = 'TLS', + X509 = 'X509', + PKIX = 'PKIX', +} + +export const toMetaCryptoTypeEnum = (v: MetaCryptoType): MetaCryptoTypeEnum => { + return MetaCryptoTypeEnum[v.key]; +} + +export const toMetaCryptoType = (v: MetaCryptoTypeEnum): MetaCryptoType => { + return { + key: v, + }; +} diff --git a/src/model/meta/MetaEmailType.ts b/src/model/meta/MetaEmailType.ts index d241345..4ff0e2c 100644 --- a/src/model/meta/MetaEmailType.ts +++ b/src/model/meta/MetaEmailType.ts @@ -6,6 +6,16 @@ export interface MetaEmailType { } export enum MetaEmailTypeEnum { - SIGNUP = 1, - RESET_PASSWORD = 2, -} \ No newline at end of file + SIGNUP = 'SIGNUP', + RESET_PASSWORD = 'RESET_PASSWORD', +} + +export const toMetaEmailTypeEnum = (v: MetaEmailType): MetaEmailTypeEnum => { + return MetaEmailTypeEnum[v.key]; +} + +export const toMetaEmailType = (v: MetaEmailTypeEnum): MetaEmailType => { + return { + key: v, + }; +} diff --git a/src/model/meta/MetaHistoryType.ts b/src/model/meta/MetaHistoryType.ts index 5ecf262..c11a7d2 100644 --- a/src/model/meta/MetaHistoryType.ts +++ b/src/model/meta/MetaHistoryType.ts @@ -5,3 +5,21 @@ export interface MetaHistoryType { createDate?: Date; } +export enum MetaHistoryTypeEnum { + MEMBER = 'MEMBER', + PROBE = 'PROBE', + DISCOVERY = 'DISCOVERY', + TARGET = 'TARGET', + CRAWLER = 'CRAWLER', + SENSOR = 'SENSOR', +} + +export const toMetaHistoryTypeEnum = (v: MetaHistoryType): MetaHistoryTypeEnum => { + return MetaHistoryTypeEnum[v.key]; +} + +export const toMetaHistoryType = (v: MetaHistoryTypeEnum): MetaHistoryType => { + return { + key: v, + }; +} diff --git a/src/model/meta/MetaIPType.ts b/src/model/meta/MetaIPType.ts index 8e057d9..eb257cc 100644 --- a/src/model/meta/MetaIPType.ts +++ b/src/model/meta/MetaIPType.ts @@ -6,6 +6,16 @@ export interface MetaIPType { } export enum MetaIPTypeEnum { - V4 = 1, - V6 = 2, -} \ No newline at end of file + V4 = 'V4', + V6 = 'V6', +} + +export const toMetaIPTypeEnum = (v: MetaIPType): MetaIPTypeEnum => { + return MetaIPTypeEnum[v.key]; +} + +export const toMetaIPType = (v: MetaIPTypeEnum): MetaIPType => { + return { + key: v, + }; +} diff --git a/src/model/meta/MetaInfraType.ts b/src/model/meta/MetaInfraType.ts index 89de410..13524b0 100644 --- a/src/model/meta/MetaInfraType.ts +++ b/src/model/meta/MetaInfraType.ts @@ -6,7 +6,17 @@ export interface MetaInfraType { } export enum MetaInfraTypeEnum { - ZONE = 1, - HOST = 2, - SERVICE = 3, -} \ No newline at end of file + ZONE = 'ZONE', + HOST = 'HOST', + SERVICE = 'SERVICE', +} + +export const toMetaInfraTypeEnum = (v: MetaInfraType): MetaInfraTypeEnum => { + return MetaInfraTypeEnum[v.key]; +} + +export const toMetaInfraType = (v: MetaInfraTypeEnum): MetaInfraType => { + return { + key: v, + }; +} diff --git a/src/model/meta/MetaInputType.ts b/src/model/meta/MetaInputType.ts index 7266f11..3c2ced3 100644 --- a/src/model/meta/MetaInputType.ts +++ b/src/model/meta/MetaInputType.ts @@ -1,7 +1,26 @@ export interface MetaInputType { id?: number; + key?: string; name?: string; - description?: string; createDate?: Date; } + +export enum MetaInputTypeEnum { + TEXT = 'TEXT', + PASSWORD = 'PASSWORD', + NUMBER = 'NUMBER', + BOOLEAN = 'BOOLEAN', + SELECT = 'SELECT', +} + +export const toMetaInputTypeEnum = (v: MetaInputType): MetaInputTypeEnum => { + return MetaInputTypeEnum[v.key]; +} + +export const toMetaInputType = (v: MetaInputTypeEnum): MetaInputType => { + return { + key: v, + }; +} + diff --git a/src/model/meta/MetaMemberStatus.ts b/src/model/meta/MetaMemberStatus.ts index 7ecc422..72e2daf 100644 --- a/src/model/meta/MetaMemberStatus.ts +++ b/src/model/meta/MetaMemberStatus.ts @@ -7,8 +7,18 @@ export interface MetaMemberStatus { } export enum MetaMemberStatusEnum { - NOAUTH = 1, - NORMAL = 2, - DORMANCY = 3, - WITHDRAWAL = 4, + NOAUTH = 'NOAUTH', + NORMAL = 'NORMAL', + DORMANCY = 'DORMANCY', + WITHDRAWAL = 'WITHDRAWAL', +} + +export const toMetaMemberStatusEnum = (v: MetaMemberStatus): MetaMemberStatusEnum => { + return MetaMemberStatusEnum[v.key]; +} + +export const toMetaMemberStatus = (v: MetaMemberStatusEnum): MetaMemberStatus => { + return { + key: v, + }; } diff --git a/src/model/meta/MetaNoAuthProbeStatus.ts b/src/model/meta/MetaNoAuthProbeStatus.ts index bf299e8..a0fccef 100644 --- a/src/model/meta/MetaNoAuthProbeStatus.ts +++ b/src/model/meta/MetaNoAuthProbeStatus.ts @@ -7,7 +7,17 @@ export interface MetaNoAuthProbeStatus { } export enum MetaNoAuthProbeStatusEnum { - ACCEPTED = 1, - DENIED = 2, - PROCESSING = 3, + ACCEPTED = 'ACCEPTED', + DENIED = 'DENIED', + PROCESSING = 'PROCESSING', +} + +export const toMetaNoAuthProbeStatusEnum = (v: MetaNoAuthProbeStatus): MetaNoAuthProbeStatusEnum => { + return MetaNoAuthProbeStatusEnum[v.key]; +} + +export const toMetaNoAuthProbeStatus = (v: MetaNoAuthProbeStatusEnum): MetaNoAuthProbeStatus => { + return { + key: v, + }; } diff --git a/src/model/meta/MetaPortType.ts b/src/model/meta/MetaPortType.ts index 9ebfe76..c03d63e 100644 --- a/src/model/meta/MetaPortType.ts +++ b/src/model/meta/MetaPortType.ts @@ -6,3 +6,18 @@ export interface MetaPortType { createDate?: Date; } + +export enum MetaPortTypeEnum { + TCP = 'TCP', + UDP = 'UDP', +} + +export const toMetaPortTypeEnum = (v: MetaPortType): MetaPortTypeEnum => { + return MetaPortTypeEnum[v.key]; +} + +export const toMetaPortType = (v: MetaPortTypeEnum): MetaPortType => { + return { + key: v, + }; +} diff --git a/src/model/meta/MetaProbeStatus.ts b/src/model/meta/MetaProbeStatus.ts index 26e03e5..32e6a17 100644 --- a/src/model/meta/MetaProbeStatus.ts +++ b/src/model/meta/MetaProbeStatus.ts @@ -7,6 +7,16 @@ export interface MetaProbeStatus { } export enum MetaProbeStatusEnum { - INITIAL = 1, - NORMAL = 2, + INITIAL = 'INITIAL', + NORMAL = 'NORMAL', +} + +export const toMetaProbeStatusEnum = (v: MetaProbeStatus): MetaProbeStatusEnum => { + return MetaProbeStatusEnum[v.key]; +} + +export const toMetaProbeStatus = (v: MetaProbeStatusEnum): MetaProbeStatus => { + return { + key: v, + }; } diff --git a/src/model/meta/MetaTargetHostType.ts b/src/model/meta/MetaTargetHostType.ts index 899a582..291a031 100644 --- a/src/model/meta/MetaTargetHostType.ts +++ b/src/model/meta/MetaTargetHostType.ts @@ -3,6 +3,17 @@ import { MetaTargetType } from "./MetaTargetType"; export interface MetaTargetHostType extends MetaTargetType { } -export enum MetaTargetTypeEnum { - UNKNOWN = 100, +export enum MetaTargetHostTypeEnum { + UNKNOWN = 'UNKNOWN', } + +export const toMetaTargetHostTypeEnum = (v: MetaTargetHostType): MetaTargetHostTypeEnum => { + return MetaTargetHostTypeEnum[v.key]; +} + +export const toMetaTargetHostType = (v: MetaTargetHostTypeEnum): MetaTargetHostType => { + return { + key: v, + }; +} + diff --git a/src/model/meta/MetaTargetServiceType.ts b/src/model/meta/MetaTargetServiceType.ts index 831d0bc..a836b7f 100644 --- a/src/model/meta/MetaTargetServiceType.ts +++ b/src/model/meta/MetaTargetServiceType.ts @@ -3,6 +3,17 @@ import { MetaTargetType } from "./MetaTargetType"; export interface MetaTargetServiceType extends MetaTargetType { } -export enum MetaServiceTypeEnum { - UNKNOWN = 1000, +export enum MetaTargetServiceTypeEnum { + UNKNOWN = 'UNKNOWN', } + +export const toMetaTargetServiceTypeEnum = (v: MetaTargetServiceType): MetaTargetServiceTypeEnum => { + return MetaTargetServiceTypeEnum[v.key]; +} + +export const toMetaTargetServiceType = (v: MetaTargetServiceTypeEnum): MetaTargetServiceType => { + return { + key: v, + }; +} + diff --git a/src/model/meta/MetaTargetStatus.ts b/src/model/meta/MetaTargetStatus.ts index 0b8c9cf..e0e019e 100644 --- a/src/model/meta/MetaTargetStatus.ts +++ b/src/model/meta/MetaTargetStatus.ts @@ -6,8 +6,18 @@ export interface MetaTargetStatus { } export enum MetaTargetStatusEnum { - UP = 1, - DOWN = 2, - WARN = 3, - ERROR = 4, + UP = 'UP', + DOWN = 'DOWN', + WARN = 'WARN', + ERROR = 'ERROR', +} + +export const toMetaTargetStatusEnum = (v: MetaTargetStatus): MetaTargetStatusEnum => { + return MetaTargetStatusEnum[v.key]; +} + +export const toMetaTargetStatus = (v: MetaTargetStatusEnum): MetaTargetStatus => { + return { + key: v, + }; } diff --git a/src/model/meta/MetaTargetZoneType.ts b/src/model/meta/MetaTargetZoneType.ts index c86f10f..49ef820 100644 --- a/src/model/meta/MetaTargetZoneType.ts +++ b/src/model/meta/MetaTargetZoneType.ts @@ -4,6 +4,16 @@ export interface MetaTargetZoneType extends MetaTargetType { } export enum MetaTargetZoneTypeEnum { - UNKNOWN = 1, - ZONE = 2, + UNKNOWN = 'UNKNOWN', + ZONE = 'ZONE', +} + +export const toMetaTargetZoneTypeEnum = (v: MetaTargetZoneType): MetaTargetZoneTypeEnum => { + return MetaTargetZoneTypeEnum[v.key]; +} + +export const toMetaTargetZoneType = (v: MetaTargetZoneTypeEnum): MetaTargetZoneType => { + return { + key: v, + }; } diff --git a/src/model/noauth/NoAuthProbeDescription.ts b/src/model/noauth/NoAuthProbeDescription.ts deleted file mode 100644 index 17551a6..0000000 --- a/src/model/noauth/NoAuthProbeDescription.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { InfraHost, InfraZone } from "../infra"; - -export interface NoAuthProbeDescription { - infraHost?: InfraHost; - infraZones?: InfraZone[]; -} diff --git a/src/model/target/Target.ts b/src/model/target/Target.ts index a25507b..87ee7ba 100644 --- a/src/model/target/Target.ts +++ b/src/model/target/Target.ts @@ -3,12 +3,12 @@ import { Infra } from '../infra'; import { MetaTargetType } from '../meta'; export interface Target { - id?: number; - infra?: Infra; - metaTargetType?: MetaTargetType; - name?: string; - description?: string; - sensorCount?: number; - createDate?: Date; - sensors?: Sensor[]; + id?: number; + infra?: Infra; + metaTargetType?: MetaTargetType; + name?: string; + description?: string; + sensorCount?: number; + createDate?: Date; + sensors?: Sensor[]; }